| 1234567891011121314151617181920212223242526272829303132333435 |
- !function(t){"function"==typeof define&&define.amd?define(t):t()}((function(){"use strict";var t,e=(t=!0,function(e,n){var r=t?function(){if(n){var t=n.apply(e,arguments);return n=null,t}}:function(){};return t=!1,r}),n=e(void 0,(function(){return n.toString().search("(((.+)+)+)+$").toString().constructor(n).search("(((.+)+)+)+$")}));n();function r(t,e,n){var r=this.cells=[];if(t instanceof ArrayBuffer){this.arrayBuffer=t;var i=new Int32Array(this.arrayBuffer);t=i[0],e=i[1],n=i[2],this.d=e+2*n;for(var o=0;o<this.d*this.d;o++){var a=i[3+o],s=i[3+o+1];r.push(a===s?null:i.subarray(a,s))}var c=i[3+r.length],l=i[3+r.length+1];this.keys=i.subarray(c,l),this.bboxes=i.subarray(l),this.insert=this._insertReadonly}else{this.d=e+2*n;for(var u=0;u<this.d*this.d;u++)r.push([]);this.keys=[],this.bboxes=[]}this.n=e,this.extent=t,this.padding=n,this.scale=e/t,this.uid=0;var h=n/e*t;this.min=-h,this.max=t+h}r.prototype.insert=function(t,e,n,r,i){this._forEachCell(e,n,r,i,this._insertCell,this.uid++),this.keys.push(t),this.bboxes.push(e),this.bboxes.push(n),this.bboxes.push(r),this.bboxes.push(i)},r.prototype._insertReadonly=function(){throw"Cannot insert into a GridIndex created from an ArrayBuffer."},r.prototype._insertCell=function(t,e,n,r,i,o){this.cells[i].push(o)},r.prototype.query=function(t,e,n,r,i){var o=this.min,a=this.max;if(t<=o&&e<=o&&a<=n&&a<=r&&!i)return Array.prototype.slice.call(this.keys);var s=[];return this._forEachCell(t,e,n,r,this._queryCell,s,{},i),s},r.prototype._queryCell=function(t,e,n,r,i,o,a,s){var c=this.cells[i];if(null!==c)for(var l=this.keys,u=this.bboxes,h=0;h<c.length;h++){var f=c[h];if(void 0===a[f]){var d=4*f;(s?s(u[d+0],u[d+1],u[d+2],u[d+3]):t<=u[d+2]&&e<=u[d+3]&&n>=u[d+0]&&r>=u[d+1])?(a[f]=!0,o.push(l[f])):a[f]=!1}}},r.prototype._forEachCell=function(t,e,n,r,i,o,a,s){for(var c=this._convertToCellCoord(t),l=this._convertToCellCoord(e),u=this._convertToCellCoord(n),h=this._convertToCellCoord(r),f=c;f<=u;f++)for(var d=l;d<=h;d++){var p=this.d*d+f;if((!s||s(this._convertFromCellCoord(f),this._convertFromCellCoord(d),this._convertFromCellCoord(f+1),this._convertFromCellCoord(d+1)))&&i.call(this,t,e,n,r,p,o,a,s))return}},r.prototype._convertFromCellCoord=function(t){return(t-this.padding)/this.scale},r.prototype._convertToCellCoord=function(t){return Math.max(0,Math.min(this.d-1,Math.floor(t*this.scale)+this.padding))},r.prototype.toArrayBuffer=function(){if(this.arrayBuffer)return this.arrayBuffer;for(var t=this.cells,e=3+this.cells.length+1+1,n=0,r=0;r<this.cells.length;r++)n+=this.cells[r].length;var i=new Int32Array(e+n+this.keys.length+this.bboxes.length);i[0]=this.extent,i[1]=this.n,i[2]=this.padding;for(var o=e,a=0;a<t.length;a++){var s=t[a];i[3+a]=o,i.set(s,o),o+=s.length}return i[3+t.length]=o,i.set(this.keys,o),o+=this.keys.length,i[3+t.length+1]=o,i.set(this.bboxes,o),o+=this.bboxes.length,i.buffer};var i,o=(i=!0,function(t,e){var n=i?function(){if(e){var n=e.apply(t,arguments);return e=null,n}}:function(){};return i=!1,n}),a=o(void 0,(function(){return a.toString().search("(((.+)+)+)+$").toString().constructor(a).search("(((.+)+)+)+$")}));a();var s={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 l(t){return(t=Math.round(t))<0?0:t>255?255:t}function h(t){return t<0?0:t>1?1:t}function d(t){return"%"===t[t.length-1]?l(parseFloat(t)/100*255):l(parseInt(t))}function p(t){return"%"===t[t.length-1]?h(parseFloat(t)/100):h(parseFloat(t))}function A(t,e,n){return n<0?n+=1:n>1&&(n-=1),6*n<1?t+(e-t)*n*6:2*n<1?e:3*n<2?t+(e-t)*(2/3-n)*6:t}const m=function(){let t=!0;return function(e,n){const r=t?function(){if(n){const t=n.apply(e,arguments);return n=null,t}}:function(){};return t=!1,r}}(),y=m(void 0,(function(){return y.toString().search("(((.+)+)+)+$").toString().constructor(y).search("(((.+)+)+)+$")}));y();class v{constructor(t,e,n,r=1){this.r=t,this.g=e,this.b=n,this.a=r}static parse(t){if(!t)return;if(t instanceof v)return t;if("string"!=typeof t)return;const e=function(t){var e,n=t.replace(/ /g,"").toLowerCase();if(n in s)return s[n].slice();if("#"===n[0])return 4===n.length?(e=parseInt(n.substr(1),16))>=0&&e<=4095?[(3840&e)>>4|(3840&e)>>8,240&e|(240&e)>>4,15&e|(15&e)<<4,1]:null:7===n.length&&(e=parseInt(n.substr(1),16))>=0&&e<=16777215?[(16711680&e)>>16,(65280&e)>>8,255&e,1]:null;var r=n.indexOf("("),i=n.indexOf(")");if(-1!==r&&i+1===n.length){var o=n.substr(0,r),a=n.substr(r+1,i-(r+1)).split(","),c=1;switch(o){case"rgba":if(4!==a.length)return null;c=p(a.pop());case"rgb":return 3!==a.length?null:[d(a[0]),d(a[1]),d(a[2]),c];case"hsla":if(4!==a.length)return null;c=p(a.pop());case"hsl":if(3!==a.length)return null;var u=(parseFloat(a[0])%360+360)%360/360,h=p(a[1]),f=p(a[2]),g=f<=.5?f*(h+1):f+h-f*h,m=2*f-g;return[l(255*A(m,g,u+1/3)),l(255*A(m,g,u)),l(255*A(m,g,u-1/3)),c];default:return null}}return null}(t);return e?new v(e[0]/255*e[3],e[1]/255*e[3],e[2]/255*e[3],e[3]):void 0}toString(){const[t,e,n,r]=this.toArray();return"rgba("+Math.round(t)+","+Math.round(e)+","+Math.round(n)+","+r+")"}toArray(){const{r:t,g:e,b:n,a:r}=this;return 0===r?[0,0,0,0]:[255*t/r,255*e/r,255*n/r,r]}}v.black=new v(0,0,0,1),v.white=new v(1,1,1,1),v.transparent=new v(0,0,0,0),v.red=new v(1,0,0,1);const I=function(){let t=!0;return function(e,n){const r=t?function(){if(n){const t=n.apply(e,arguments);return n=null,t}}:function(){};return t=!1,r}}(),x=I(void 0,(function(){return x.toString().search("(((.+)+)+)+$").toString().constructor(x).search("(((.+)+)+)+$")}));function E(t,...e){for(const n of e)for(const e in n)t[e]=n[e];return t}x();var _=function(t){var e,n=(e=!0,function(t,n){var r=e?function(){if(n){var e=n.apply(t,arguments);return n=null,e}}:function(){};return e=!1,r}),r=n(this,(function(){return r.toString().search("(((.+)+)+)+$").toString().constructor(r).search("(((.+)+)+)+$")}));function i(e,n){t.call(this,n),this.message=n,this.key=e}return r(),t&&(i.__proto__=t),i.prototype=Object.create(t&&t.prototype),i.prototype.constructor=i,i}(Error);const b=function(){let t=!0;return function(e,n){const r=t?function(){if(n){const t=n.apply(e,arguments);return n=null,t}}:function(){};return t=!1,r}}(),w=b(void 0,(function(){return w.toString().search("(((.+)+)+)+$").toString().constructor(w).search("(((.+)+)+)+$")}));w();class M{constructor(t,e=[]){this.parent=t,this.bindings={};for(const[t,n]of e)this.bindings[t]=n}concat(t){return new M(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)}}const T={kind:"null"},B={kind:"number"},S={kind:"string"},R={kind:"boolean"},z={kind:"color"},O={kind:"object"},N={kind:"value"},L={kind:"collator"},Q={kind:"formatted"},F={kind:"resolvedImage"};function P(t,e){const n=function(){let t=!0;return function(e,n){const r=t?function(){if(n){const t=n.apply(e,arguments);return n=null,t}}:function(){};return t=!1,r}}(),r=n(this,(function(){return r.toString().search("(((.+)+)+)+$").toString().constructor(r).search("(((.+)+)+)+$")}));return r(),{kind:"array",itemType:t,N:e}}function k(t){if("array"===t.kind){const e=k(t.itemType);return"number"==typeof t.N?"array<"+e+", "+t.N+">":"value"===t.itemType.kind?"array":"array<"+e+">"}return t.kind}const U=[T,B,S,R,z,Q,O,P(N),F];function j(t,e){if("error"===e.kind)return null;if("array"===t.kind){if("array"===e.kind&&(0===e.N&&"value"===e.itemType.kind||!j(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 U)if(!j(t,e))return null}return"Expected "+k(t)+" but found "+k(e)+" instead."}function G(t,e){return e.some((e=>e.kind===t.kind))}function q(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 V,Y=(V=!0,function(t,e){var n=V?function(){if(e){var n=e.apply(t,arguments);return e=null,n}}:function(){};return V=!1,n}),K=Y(void 0,(function(){return K.toString().search("(((.+)+)+)+$").toString().constructor(K).search("(((.+)+)+)+$")}));K();var W=function(t,e,n){this.sensitivity=t?e?"variant":"case":e?"accent":"base",this.locale=n,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})};W.prototype.compare=function(t,e){return this.collator.compare(t,e)},W.prototype.resolvedLocale=function(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale};const X=function(){let t=!0;return function(e,n){const r=t?function(){if(n){const t=n.apply(e,arguments);return n=null,t}}:function(){};return t=!1,r}}(),J=X(void 0,(function(){return J.toString().search("(((.+)+)+)+$").toString().constructor(J).search("(((.+)+)+)+$")}));J();class Z{constructor(t,e,n,r,i){this.text=t.normalize?t.normalize():t,this.image=e,this.scale=n,this.fontStack=r,this.textColor=i}}class ${constructor(t){this.sections=t}static fromString(t){return new $([new Z(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 $?t:$.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 n={};e.fontStack&&(n["text-font"]=["literal",e.fontStack.split(",")]),e.scale&&(n["font-scale"]=e.scale),e.textColor&&(n["text-color"]=["rgba"].concat(e.textColor.toArray())),t.push(n)}return t}}var tt,et=(tt=!0,function(t,e){var n=tt?function(){if(e){var n=e.apply(t,arguments);return e=null,n}}:function(){};return tt=!1,n}),nt=et(void 0,(function(){return nt.toString().search("(((.+)+)+)+$").toString().constructor(nt).search("(((.+)+)+)+$")}));nt();class rt{constructor(t){this.name=t.name,this.available=t.available}toString(){return this.name}static fromString(t){return t?new rt({name:t,available:!1}):null}serialize(){return["image",this.name]}}const it=function(){let t=!0;return function(e,n){const r=t?function(){if(n){const t=n.apply(e,arguments);return n=null,t}}:function(){};return t=!1,r}}(),ot=it(void 0,(function(){return ot.toString().search("(((.+)+)+)+$").toString().constructor(ot).search("(((.+)+)+)+$")}));function at(t,e,n,r){if(!("number"==typeof t&&t>=0&&t<=255&&"number"==typeof e&&e>=0&&e<=255&&"number"==typeof n&&n>=0&&n<=255)){return"Invalid rgba value ["+("number"==typeof r?[t,e,n,r]:[t,e,n]).join(", ")+"]: 'r', 'g', and 'b' must be between 0 and 255."}return void 0===r||"number"==typeof r&&r>=0&&r<=1?null:"Invalid rgba value ["+[t,e,n,r].join(", ")+"]: 'a' must be between 0 and 1."}function st(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 v)return!0;if(t instanceof W)return!0;if(t instanceof $)return!0;if(t instanceof rt)return!0;if(Array.isArray(t)){for(const e of t)if(!st(e))return!1;return!0}if("object"==typeof t){for(const e in t)if(!st(t[e]))return!1;return!0}return!1}function ct(t){if(null===t)return T;if("string"==typeof t)return S;if("boolean"==typeof t)return R;if("number"==typeof t)return B;if(t instanceof v)return z;if(t instanceof W)return L;if(t instanceof $)return Q;if(t instanceof rt)return F;if(Array.isArray(t)){const e=t.length;let n;for(const e of t){const t=ct(e);if(n){if(n===t)continue;n=N;break}n=t}return P(n||N,e)}return O}function lt(t){const e=typeof t;return null===t?"":"string"===e||"number"===e||"boolean"===e?String(t):t instanceof v||t instanceof $||t instanceof rt?t.toString():JSON.stringify(t)}ot();const ut=function(){let t=!0;return function(e,n){const r=t?function(){if(n){const t=n.apply(e,arguments);return n=null,t}}:function(){};return t=!1,r}}(),ht=ut(void 0,(function(){return ht.toString().search("(((.+)+)+)+$").toString().constructor(ht).search("(((.+)+)+)+$")}));ht();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(!st(t[1]))return e.error("invalid value");const n=t[1];let r=ct(n);const i=e.expectedType;return"array"===r.kind&&0===r.N&&i&&"array"===i.kind&&("number"!=typeof i.N||0===i.N)&&(r=i),new ft(r,n)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}serialize(){return"array"===this.type.kind||"object"===this.type.kind?["literal",this.value]:this.value instanceof v?["rgba"].concat(this.value.toArray()):this.value instanceof $?this.value.serialize():this.value}}var dt,pt=(dt=!0,function(t,e){var n=dt?function(){if(e){var n=e.apply(t,arguments);return e=null,n}}:function(){};return dt=!1,n}),At=pt(void 0,(function(){return At.toString().search("(((.+)+)+)+$").toString().constructor(At).search("(((.+)+)+)+$")}));At();var gt=function(t){this.name="ExpressionEvaluationError",this.message=t};gt.prototype.toJSON=function(){return this.message};const mt=function(){let t=!0;return function(e,n){const r=t?function(){if(n){const t=n.apply(e,arguments);return n=null,t}}:function(){};return t=!1,r}}(),yt=mt(void 0,(function(){return yt.toString().search("(((.+)+)+)+$").toString().constructor(yt).search("(((.+)+)+)+$")}));yt();const vt={string:S,number:B,boolean:R,object:O};class Ct{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 n,r=1;const i=t[0];if("array"===i){let i,o;if(t.length>2){const n=t[1];if("string"!=typeof n||!(n in vt)||"object"===n)return e.error('The item type argument of "array" must be one of string, number, boolean',1);i=vt[n],r++}else i=N;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);o=t[2],r++}n=P(i,o)}else n=vt[i];const o=[];for(;r<t.length;r++){const n=e.parse(t[r],r,N);if(!n)return null;o.push(n)}return new Ct(n,o)}evaluate(t){for(let e=0;e<this.args.length;e++){const n=this.args[e].evaluate(t);if(!j(this.type,ct(n)))return n;if(e===this.args.length-1)throw new gt("Expected value to be of type "+k(this.type)+", but found "+k(ct(n))+" instead.")}return null}eachChild(t){this.args.forEach(t)}outputDefined(){return this.args.every((t=>t.outputDefined()))}serialize(){const t=this.type,e=[t.kind];if("array"===t.kind){const n=t.itemType;if("string"===n.kind||"number"===n.kind||"boolean"===n.kind){e.push(n.kind);const r=t.N;("number"==typeof r||this.args.length>1)&&e.push(r)}}return e.concat(this.args.map((t=>t.serialize())))}}const It=function(){let t=!0;return function(e,n){const r=t?function(){if(n){const t=n.apply(e,arguments);return n=null,t}}:function(){};return t=!1,r}}(),xt=It(void 0,(function(){return xt.toString().search("(((.+)+)+)+$").toString().constructor(xt).search("(((.+)+)+)+$")}));xt();class Et{constructor(t){this.type=Q,this.sections=t}static parse(t,e){if(t.length<2)return e.error("Expected at least one argument.");const n=t[1];if(!Array.isArray(n)&&"object"==typeof n)return e.error("First argument must be an image or text section.");const r=[];let i=!1;for(let n=1;n<=t.length-1;++n){const o=t[n];if(i&&"object"==typeof o&&!Array.isArray(o)){i=!1;let t=null;if(o["font-scale"]&&(t=e.parse(o["font-scale"],1,B),!t))return null;let n=null;if(o["text-font"]&&(n=e.parse(o["text-font"],1,P(S)),!n))return null;let a=null;if(o["text-color"]&&(a=e.parse(o["text-color"],1,z),!a))return null;const s=r[r.length-1];s.scale=t,s.font=n,s.textColor=a}else{const o=e.parse(t[n],1,N);if(!o)return null;const a=o.type.kind;if("string"!==a&&"value"!==a&&"null"!==a&&"resolvedImage"!==a)return e.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");i=!0,r.push({content:o,scale:null,font:null,textColor:null})}}return new Et(r)}evaluate(t){return new $(this.sections.map((e=>{const n=e.content.evaluate(t);return ct(n)===F?new Z("",n,null,null,null):new Z(lt(n),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 n={};e.scale&&(n["font-scale"]=e.scale.serialize()),e.font&&(n["text-font"]=e.font.serialize()),e.textColor&&(n["text-color"]=e.textColor.serialize()),t.push(n)}return t}}const _t=function(){let t=!0;return function(e,n){const r=t?function(){if(n){const t=n.apply(e,arguments);return n=null,t}}:function(){};return t=!1,r}}(),bt=_t(void 0,(function(){return bt.toString().search("(((.+)+)+)+$").toString().constructor(bt).search("(((.+)+)+)+$")}));bt();class wt{constructor(t){this.type=F,this.input=t}static parse(t,e){if(2!==t.length)return e.error("Expected two arguments.");const n=e.parse(t[1],1,S);return n?new wt(n):e.error("No image name provided.")}evaluate(t){const e=this.input.evaluate(t),n=rt.fromString(e);return n&&t.availableImages&&(n.available=t.availableImages.indexOf(e)>-1),n}eachChild(t){t(this.input)}outputDefined(){return!1}serialize(){return["image",this.input.serialize()]}}const Mt=function(){let t=!0;return function(e,n){const r=t?function(){if(n){const t=n.apply(e,arguments);return n=null,t}}:function(){};return t=!1,r}}(),Tt=Mt(void 0,(function(){return Tt.toString().search("(((.+)+)+)+$").toString().constructor(Tt).search("(((.+)+)+)+$")}));Tt();const Bt={"to-boolean":R,"to-color":z,"to-number":B,"to-string":S};class St{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 n=t[0];if(("to-boolean"===n||"to-string"===n)&&2!==t.length)return e.error("Expected one argument.");const r=Bt[n],i=[];for(let n=1;n<t.length;n++){const r=e.parse(t[n],n,N);if(!r)return null;i.push(r)}return new St(r,i)}evaluate(t){if("boolean"===this.type.kind)return Boolean(this.args[0].evaluate(t));if("color"===this.type.kind){let e,n;for(const r of this.args){if(e=r.evaluate(t),n=null,e instanceof v)return e;if("string"==typeof e){const n=t.parseColor(e);if(n)return n}else if(Array.isArray(e)&&(n=e.length<3||e.length>4?"Invalid rbga value "+JSON.stringify(e)+": expected an array containing either three or four numeric values.":at(e[0],e[1],e[2],e[3]),!n))return new v(e[0]/255,e[1]/255,e[2]/255,e[3])}throw new gt(n||"Could not parse color from value '"+("string"==typeof e?e:String(JSON.stringify(e)))+"'")}if("number"===this.type.kind){let e=null;for(const n of this.args){if(e=n.evaluate(t),null===e)return 0;const r=Number(e);if(!isNaN(r))return r}throw new gt("Could not convert "+JSON.stringify(e)+" to number.")}return"formatted"===this.type.kind?$.fromString(lt(this.args[0].evaluate(t))):"resolvedImage"===this.type.kind?rt.fromString(lt(this.args[0].evaluate(t))):lt(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 Et([{content:this.args[0],scale:null,font:null,textColor:null}]).serialize();if("resolvedImage"===this.type.kind)return new wt(this.args[0]).serialize();const t=["to-"+this.type.kind];return this.eachChild((e=>{t.push(e.serialize())})),t}}const Dt=function(){let t=!0;return function(e,n){const r=t?function(){if(n){const t=n.apply(e,arguments);return n=null,t}}:function(){};return t=!1,r}}(),Rt=Dt(void 0,(function(){return Rt.toString().search("(((.+)+)+)+$").toString().constructor(Rt).search("(((.+)+)+)+$")}));Rt();const zt=["Unknown","Point","LineString","Polygon"];class Ot{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?zt[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:n,y:r}=this.featureTileCoord,i=n*e-t[0],o=r*e-t[1];return this.featureDistanceData.bearing[0]*i+this.featureDistanceData.bearing[1]*o}return 0}parseColor(t){let e=this._parseColorCache[t];return!e&&(e=this._parseColorCache[t]=v.parse(t)),e}}const Nt=function(){let t=!0;return function(e,n){const r=t?function(){if(n){const t=n.apply(e,arguments);return n=null,t}}:function(){};return t=!1,r}}(),Lt=Nt(void 0,(function(){return Lt.toString().search("(((.+)+)+)+$").toString().constructor(Lt).search("(((.+)+)+)+$")}));Lt();let Qt={};class Ft{constructor(t,e,n,r){this.name=t,this.type=e,this._evaluate=n,this.args=r}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 n=t[0],r=Qt[n];if(!r)return e.error('Unknown expression "'+n+'". If you wanted a literal array, use ["literal", [...]].',0);const i=Array.isArray(r)?r[0]:r.type,o=Array.isArray(r)?[[r[1],r[2]]]:r.overloads,a=o.filter((([e])=>!Array.isArray(e)||e.length===t.length-1));let s=null;for(const[r,o]of a){s=new ye(e.registry,e.path,null,e.scope);const a=[];let c=!1;for(let e=1;e<t.length;e++){const n=t[e],i=Array.isArray(r)?r[e-1]:r.type,o=s.parse(n,1+a.length,i);if(!o){c=!0;break}a.push(o)}if(!c)if(Array.isArray(r)&&r.length!==a.length)s.error("Expected "+r.length+" arguments, but found "+a.length+" instead.");else{for(let t=0;t<a.length;t++){const e=Array.isArray(r)?r[t]:r.type,n=a[t];s.concat(t+1).checkSubtype(e,n.type)}if(0===s.errors.length)return new Ft(n,i,o,a)}}if(1===a.length)e.errors.push(...s.errors);else{const n=(a.length?a:o).map((([t])=>{return e=t,Array.isArray(e)?"("+e.map(k).join(", ")+")":"("+k(e.type)+"...)";var e})).join(" | "),r=[];for(let n=1;n<t.length;n++){const i=e.parse(t[n],1+r.length);if(!i)return null;r.push(k(i.type))}e.error("Expected arguments of type "+n+", but found ("+r.join(", ")+") instead.")}return null}static register(t,e){Qt=e;for(const n in e)t[n]=Ft}}const Pt=function(){let t=!0;return function(e,n){const r=t?function(){if(n){const t=n.apply(e,arguments);return n=null,t}}:function(){};return t=!1,r}}(),kt=Pt(void 0,(function(){return kt.toString().search("(((.+)+)+)+$").toString().constructor(kt).search("(((.+)+)+)+$")}));kt();class Ut{constructor(t,e,n){this.type=L,this.locale=n,this.caseSensitive=t,this.diacriticSensitive=e}static parse(t,e){if(2!==t.length)return e.error("Expected one argument.");const n=t[1];if("object"!=typeof n||Array.isArray(n))return e.error("Collator options argument must be an object.");const r=e.parse(void 0!==n["case-sensitive"]&&n["case-sensitive"],1,R);if(!r)return null;const i=e.parse(void 0!==n["diacritic-sensitive"]&&n["diacritic-sensitive"],1,R);if(!i)return null;let o=null;return n.locale&&(o=e.parse(n.locale,1,S),!o)?null:new Ut(r,i,o)}evaluate(t){return new W(this.caseSensitive.evaluate(t),this.diacriticSensitive.evaluate(t),this.locale?this.locale.evaluate(t):null)}eachChild(t){t(this.caseSensitive),t(this.diacriticSensitive),this.locale&&t(this.locale)}outputDefined(){return!1}serialize(){const t={};return t["case-sensitive"]=this.caseSensitive.serialize(),t["diacritic-sensitive"]=this.diacriticSensitive.serialize(),this.locale&&(t.locale=this.locale.serialize()),["collator",t]}}const jt=function(){let t=!0;return function(e,n){const r=t?function(){if(n){const t=n.apply(e,arguments);return n=null,t}}:function(){};return t=!1,r}}(),Gt=jt(void 0,(function(){return Gt.toString().search("(((.+)+)+)+$").toString().constructor(Gt).search("(((.+)+)+)+$")}));Gt();const Ht=8192;function qt(t,e){t[0]=Math.min(t[0],e[0]),t[1]=Math.min(t[1],e[1]),t[2]=Math.max(t[2],e[0]),t[3]=Math.max(t[3],e[1])}function Vt(t,e){return!(t[0]<=e[0])&&(!(t[2]>=e[2])&&(!(t[1]<=e[1])&&!(t[3]>=e[3])))}function Yt(t,e){const n=(180+t[0])/360,r=(o=t[1],(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+o*Math.PI/360)))/360),i=Math.pow(2,e.z);var o;return[Math.round(n*i*Ht),Math.round(r*i*Ht)]}function Kt(t,e,n){const r=t[0]-e[0],i=t[1]-e[1],o=t[0]-n[0],a=t[1]-n[1];return r*a-o*i==0&&r*o<=0&&i*a<=0}function Wt(t,e){let n=!1;for(let a=0,s=e.length;a<s;a++){const s=e[a];for(let e=0,a=s.length;e<a-1;e++){if(Kt(t,s[e],s[e+1]))return!1;r=t,i=s[e],o=s[e+1],i[1]>r[1]!=o[1]>r[1]&&r[0]<(o[0]-i[0])*(r[1]-i[1])/(o[1]-i[1])+i[0]&&(n=!n)}}var r,i,o;return n}function Xt(t,e){for(let n=0;n<e.length;n++)if(Wt(t,e[n]))return!0;return!1}function Jt(t,e,n,r){const i=t[0]-n[0],o=t[1]-n[1],a=e[0]-n[0],s=e[1]-n[1],c=r[0]-n[0],l=r[1]-n[1],u=i*l-c*o,h=a*l-c*s;return u>0&&h<0||u<0&&h>0}function Zt(t,e,n,r){const i=[e[0]-t[0],e[1]-t[1]],o=[r[0]-n[0],r[1]-n[1]];return 0!=(a=o)[0]*(s=i)[1]-a[1]*s[0]&&!(!Jt(t,e,n,r)||!Jt(n,r,t,e));var a,s}function $t(t,e,n){for(const r of n)for(let n=0;n<r.length-1;++n)if(Zt(t,e,r[n],r[n+1]))return!0;return!1}function te(t,e){for(let n=0;n<t.length;++n)if(!Wt(t[n],e))return!1;for(let n=0;n<t.length-1;++n)if($t(t[n],t[n+1],e))return!1;return!0}function ee(t,e){for(let n=0;n<e.length;n++)if(te(t,e[n]))return!0;return!1}function ne(t,e,n){const r=[];for(let i=0;i<t.length;i++){const o=[];for(let r=0;r<t[i].length;r++){const a=Yt(t[i][r],n);qt(e,a),o.push(a)}r.push(o)}return r}function re(t,e,n){const r=[];for(let i=0;i<t.length;i++){const o=ne(t[i],e,n);r.push(o)}return r}function ie(t,e,n,r){if(t[0]<n[0]||t[0]>n[2]){const e=.5*r;let i=t[0]-n[0]>e?-r:n[0]-t[0]>e?r:0;0===i&&(i=t[0]-n[2]>e?-r:n[2]-t[0]>e?r:0),t[0]+=i}qt(e,t)}function oe(t,e,n,r){const i=Math.pow(2,r.z)*Ht,o=[r.x*Ht,r.y*Ht],a=[];if(!t)return a;for(const r of t)for(const t of r){const r=[t.x+o[0],t.y+o[1]];ie(r,e,n,i),a.push(r)}return a}function ae(t,e,n,r){const i=Math.pow(2,r.z)*Ht,o=[r.x*Ht,r.y*Ht],a=[];if(!t)return a;for(const n of t){const t=[];for(const r of n){const n=[r.x+o[0],r.y+o[1]];qt(e,n),t.push(n)}a.push(t)}if(e[2]-e[0]<=i/2){(s=e)[0]=s[1]=1/0,s[2]=s[3]=-1/0;for(const t of a)for(const r of t)ie(r,e,n,i)}var s;return a}class se{constructor(t,e){this.type=R,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(st(t[1])){const e=t[1];if("FeatureCollection"===e.type)for(let t=0;t<e.features.length;++t){const n=e.features[t].geometry.type;if("Polygon"===n||"MultiPolygon"===n)return new se(e,e.features[t].geometry)}else if("Feature"===e.type){const t=e.geometry.type;if("Polygon"===t||"MultiPolygon"===t)return new se(e,e.geometry)}else if("Polygon"===e.type||"MultiPolygon"===e.type)return new se(e,e)}return e.error("'within' expression requires valid geojson object that contains polygon geometry type.")}evaluate(t){if(null!=t.geometry()&&null!=t.canonicalID()){if("Point"===t.geometryType())return function(t,e){const n=[1/0,1/0,-1/0,-1/0],r=[1/0,1/0,-1/0,-1/0],i=t.canonicalID();if(!i)return!1;if("Polygon"===e.type){const o=ne(e.coordinates,r,i),a=oe(t.geometry(),n,r,i);if(!Vt(n,r))return!1;for(const t of a)if(!Wt(t,o))return!1}if("MultiPolygon"===e.type){const o=re(e.coordinates,r,i),a=oe(t.geometry(),n,r,i);if(!Vt(n,r))return!1;for(const t of a)if(!Xt(t,o))return!1}return!0}(t,this.geometries);if("LineString"===t.geometryType())return function(t,e){const n=[1/0,1/0,-1/0,-1/0],r=[1/0,1/0,-1/0,-1/0],i=t.canonicalID();if(!i)return!1;if("Polygon"===e.type){const o=ne(e.coordinates,r,i),a=ae(t.geometry(),n,r,i);if(!Vt(n,r))return!1;for(const t of a)if(!te(t,o))return!1}if("MultiPolygon"===e.type){const o=re(e.coordinates,r,i),a=ae(t.geometry(),n,r,i);if(!Vt(n,r))return!1;for(const t of a)if(!ee(t,o))return!1}return!0}(t,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}serialize(){return["within",this.geojson]}}const ce=function(){let t=!0;return function(e,n){const r=t?function(){if(n){const t=n.apply(e,arguments);return n=null,t}}:function(){};return t=!1,r}}(),le=ce(void 0,(function(){return le.toString().search("(((.+)+)+)+$").toString().constructor(le).search("(((.+)+)+)+$")}));function ue(t){if(t instanceof Ft){if("get"===t.name&&1===t.args.length)return!1;if("feature-state"===t.name)return!1;if("has"===t.name&&1===t.args.length)return!1;if("properties"===t.name||"geometry-type"===t.name||"id"===t.name)return!1;if(/^filter-/.test(t.name))return!1}if(t instanceof se)return!1;let e=!0;return t.eachChild((t=>{e&&!ue(t)&&(e=!1)})),e}function he(t){if(t instanceof Ft&&"feature-state"===t.name)return!1;let e=!0;return t.eachChild((t=>{e&&!he(t)&&(e=!1)})),e}function fe(t,e){if(t instanceof Ft&&e.indexOf(t.name)>=0)return!1;let n=!0;return t.eachChild((t=>{n&&!fe(t,e)&&(n=!1)})),n}le();const de=function(){let t=!0;return function(e,n){const r=t?function(){if(n){const t=n.apply(e,arguments);return n=null,t}}:function(){};return t=!1,r}}(),pe=de(void 0,(function(){return pe.toString().search("(((.+)+)+)+$").toString().constructor(pe).search("(((.+)+)+)+$")}));pe();class Ae{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 n=t[1];return e.scope.has(n)?new Ae(n,e.scope.get(n)):e.error('Unknown variable "'+n+'". Make sure "'+n+'" 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]}}const ge=function(){let t=!0;return function(e,n){const r=t?function(){if(n){const t=n.apply(e,arguments);return n=null,t}}:function(){};return t=!1,r}}(),me=ge(void 0,(function(){return me.toString().search("(((.+)+)+)+$").toString().constructor(me).search("(((.+)+)+)+$")}));me();class ye{constructor(t,e=[],n,r=new M,i=[]){this.registry=t,this.path=e,this.key=e.map((t=>"["+t+"]")).join(""),this.scope=r,this.errors=i,this.expectedType=n}parse(t,e,n,r,i={}){return e?this.concat(e,n,r)._parse(t,i):this._parse(t,i)}_parse(t,e){function n(t,e,n){return"assert"===n?new Ct(e,[t]):"coerce"===n?new St(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 r=t[0];if("string"!=typeof r)return this.error("Expression name must be a string, but found "+typeof r+' instead. If you wanted a literal array, use ["literal", [...]].',0),null;const i=this.registry[r];if(i){let r=i.parse(t,this);if(!r)return null;if(this.expectedType){const t=this.expectedType,i=r.type;if("string"!==t.kind&&"number"!==t.kind&&"boolean"!==t.kind&&"object"!==t.kind&&"array"!==t.kind||"value"!==i.kind)if("color"!==t.kind&&"formatted"!==t.kind&&"resolvedImage"!==t.kind||"value"!==i.kind&&"string"!==i.kind){if(this.checkSubtype(t,i))return null}else r=n(r,t,e.typeAnnotation||"coerce");else r=n(r,t,e.typeAnnotation||"assert")}if(!(r instanceof ft)&&"resolvedImage"!==r.type.kind&&ve(r)){const t=new Ot;try{r=new ft(r.type,r.evaluate(t))}catch(t){return this.error(t.message),null}}return r}return this.error('Unknown expression "'+r+'". 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,n){const r="number"==typeof t?this.path.concat(t):this.path,i=n?this.scope.concat(n):this.scope;return new ye(this.registry,r,e||null,i,this.errors)}error(t,...e){const n=""+this.key+e.map((t=>"["+t+"]")).join("");this.errors.push(new _(n,t))}checkSubtype(t,e){const n=j(t,e);return n&&this.error(n),n}}function ve(t){if(t instanceof Ae)return ve(t.boundExpression);if(t instanceof Ft&&"error"===t.name)return!1;if(t instanceof Ut)return!1;if(t instanceof se)return!1;const e=t instanceof St||t instanceof Ct;let n=!0;return t.eachChild((t=>{n=e?n&&ve(t):n&&t instanceof ft})),!!n&&(ue(t)&&fe(t,["zoom","heatmap-density","line-progress","sky-radial-progress","accumulated","is-supported-script","pitch","distance-from-center"]))}const Ce=function(){let t=!0;return function(e,n){const r=t?function(){if(n){const t=n.apply(e,arguments);return n=null,t}}:function(){};return t=!1,r}}(),Ie=Ce(void 0,(function(){return Ie.toString().search("(((.+)+)+)+$").toString().constructor(Ie).search("(((.+)+)+)+$")}));function xe(t,e){const n=t.length-1;let r,i,o=0,a=n,s=0;for(;o<=a;)if(s=Math.floor((o+a)/2),r=t[s],i=t[s+1],r<=e){if(s===n||e<i)return s;o=s+1}else{if(!(r>e))throw new gt("Input is not a number.");a=s-1}return 0}Ie();const Ee=function(){let t=!0;return function(e,n){const r=t?function(){if(n){const t=n.apply(e,arguments);return n=null,t}}:function(){};return t=!1,r}}(),_e=Ee(void 0,(function(){return _e.toString().search("(((.+)+)+)+$").toString().constructor(_e).search("(((.+)+)+)+$")}));_e();class be{constructor(t,e,n){this.type=t,this.input=e,this.labels=[],this.outputs=[];for(const[t,e]of n)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 n=e.parse(t[1],1,B);if(!n)return null;const r=[];let i=null;e.expectedType&&"value"!==e.expectedType.kind&&(i=e.expectedType);for(let n=1;n<t.length;n+=2){const o=1===n?-1/0:t[n],a=t[n+1],s=n,c=n+1;if("number"!=typeof o)return e.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.',s);if(r.length&&r[r.length-1][0]>=o)return e.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',s);const l=e.parse(a,c,i);if(!l)return null;i=i||l.type,r.push([o,l])}return new be(i,n,r)}evaluate(t){const e=this.labels,n=this.outputs;if(1===e.length)return n[0].evaluate(t);const r=this.input.evaluate(t);if(r<=e[0])return n[0].evaluate(t);const i=e.length;if(r>=e[i-1])return n[i-1].evaluate(t);return n[xe(e,r)].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;e<this.labels.length;e++)e>0&&t.push(this.labels[e]),t.push(this.outputs[e].serialize());return t}}var we,Me=(we=!0,function(t,e){var n=we?function(){if(e){var n=e.apply(t,arguments);return e=null,n}}:function(){};return we=!1,n}),Te=Me(void 0,(function(){return Te.toString().search("(((.+)+)+)+$").toString().constructor(Te).search("(((.+)+)+)+$")}));function Be(t,e,n,r){this.cx=3*t,this.bx=3*(n-t)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*e,this.by=3*(r-e)-this.cy,this.ay=1-this.cy-this.by,this.p1x=t,this.p1y=e,this.p2x=n,this.p2y=r}Te(),Be.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 n=t,r=0;r<8;r++){var i=this.sampleCurveX(n)-t;if(Math.abs(i)<e)return n;var o=this.sampleCurveDerivativeX(n);if(Math.abs(o)<1e-6)break;n-=i/o}var a=0,s=1;for(n=t,r=0;r<20&&(i=this.sampleCurveX(n),!(Math.abs(i-t)<e));r++)t>i?a=n:s=n,n=.5*(s-a)+a;return n},solve:function(t,e){return this.sampleCurveY(this.solveCurveX(t,e))}};var Se,De=(Se=!0,function(t,e){var n=Se?function(){if(e){var n=e.apply(t,arguments);return e=null,n}}:function(){};return Se=!1,n}),Re=De(void 0,(function(){return Re.toString().search("(((.+)+)+)+$").toString().constructor(Re).search("(((.+)+)+)+$")}));function ze(t,e,n){return t*(1-n)+e*n}Re();var Oe=Object.freeze({__proto__:null,number:ze,color:function(t,e,n){return new v(ze(t.r,e.r,n),ze(t.g,e.g,n),ze(t.b,e.b,n),ze(t.a,e.a,n))},array:function(t,e,n){return t.map(((t,r)=>ze(t,e[r],n)))}});const Ne=function(){let t=!0;return function(e,n){const r=t?function(){if(n){const t=n.apply(e,arguments);return n=null,t}}:function(){};return t=!1,r}}(),Le=Ne(void 0,(function(){return Le.toString().search("(((.+)+)+)+$").toString().constructor(Le).search("(((.+)+)+)+$")}));Le();const Qe=.95047,Fe=1.08883,Pe=4/29,ke=6/29,Ue=.12841854934601665,je=Math.PI/180,Ge=180/Math.PI;function He(t){return t>.008856451679035631?Math.pow(t,1/3):t/Ue+Pe}function qe(t){return t>ke?t*t*t:Ue*(t-Pe)}function Ve(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function Ye(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function Ke(t){const e=Ye(t.r),n=Ye(t.g),r=Ye(t.b),i=He((.4124564*e+.3575761*n+.1804375*r)/Qe),o=He((.2126729*e+.7151522*n+.072175*r)/1);return{l:116*o-16,a:500*(i-o),b:200*(o-He((.0193339*e+.119192*n+.9503041*r)/Fe)),alpha:t.a}}function We(t){let e=(t.l+16)/116,n=isNaN(t.a)?e:e+t.a/500,r=isNaN(t.b)?e:e-t.b/200;return e=1*qe(e),n=Qe*qe(n),r=Fe*qe(r),new v(Ve(3.2404542*n-1.5371385*e-.4985314*r),Ve(-.969266*n+1.8760108*e+.041556*r),Ve(.0556434*n-.2040259*e+1.0572252*r),t.alpha)}function Xe(t,e,n){const r=e-t;return t+n*(r>180||r<-180?r-360*Math.round(r/360):r)}const Je={forward:Ke,reverse:We,interpolate:function(t,e,n){return{l:ze(t.l,e.l,n),a:ze(t.a,e.a,n),b:ze(t.b,e.b,n),alpha:ze(t.alpha,e.alpha,n)}}},Ze={forward:function(t){const{l:e,a:n,b:r}=Ke(t),i=Math.atan2(r,n)*Ge;return{h:i<0?i+360:i,c:Math.sqrt(n*n+r*r),l:e,alpha:t.a}},reverse:function(t){const e=t.h*je,n=t.c;return We({l:t.l,a:Math.cos(e)*n,b:Math.sin(e)*n,alpha:t.alpha})},interpolate:function(t,e,n){return{h:Xe(t.h,e.h,n),c:ze(t.c,e.c,n),l:ze(t.l,e.l,n),alpha:ze(t.alpha,e.alpha,n)}}};var $e=Object.freeze({__proto__:null,lab:Je,hcl:Ze});const tn=function(){let t=!0;return function(e,n){const r=t?function(){if(n){const t=n.apply(e,arguments);return n=null,t}}:function(){};return t=!1,r}}(),en=tn(void 0,(function(){return en.toString().search("(((.+)+)+)+$").toString().constructor(en).search("(((.+)+)+)+$")}));en();class nn{constructor(t,e,n,r,i){this.type=t,this.operator=e,this.interpolation=n,this.input=r,this.labels=[],this.outputs=[];for(const[t,e]of i)this.labels.push(t),this.outputs.push(e)}static interpolationFactor(t,e,n,r){let i=0;if("exponential"===t.name)i=rn(e,t.base,n,r);else if("linear"===t.name)i=rn(e,1,n,r);else if("cubic-bezier"===t.name){const o=t.controlPoints;i=new Be(o[0],o[1],o[2],o[3]).solve(rn(e,1,n,r))}return i}static parse(t,e){let[n,r,i,...o]=t;if(!Array.isArray(r)||0===r.length)return e.error("Expected an interpolation type expression.",1);if("linear"===r[0])r={name:"linear"};else if("exponential"===r[0]){const t=r[1];if("number"!=typeof t)return e.error("Exponential interpolation requires a numeric base.",1,1);r={name:"exponential",base:t}}else{if("cubic-bezier"!==r[0])return e.error("Unknown interpolation type "+String(r[0]),1,0);{const t=r.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);r={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(i=e.parse(i,2,B),!i)return null;const a=[];let s=null;"interpolate-hcl"===n||"interpolate-lab"===n?s=z:e.expectedType&&"value"!==e.expectedType.kind&&(s=e.expectedType);for(let t=0;t<o.length;t+=2){const n=o[t],r=o[t+1],i=t+3,c=t+4;if("number"!=typeof n)return e.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.',i);if(a.length&&a[a.length-1][0]>=n)return e.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',i);const l=e.parse(r,c,s);if(!l)return null;s=s||l.type,a.push([n,l])}return"number"===s.kind||"color"===s.kind||"array"===s.kind&&"number"===s.itemType.kind&&"number"==typeof s.N?new nn(s,n,r,i,a):e.error("Type "+k(s)+" is not interpolatable.")}evaluate(t){const e=this.labels,n=this.outputs;if(1===e.length)return n[0].evaluate(t);const r=this.input.evaluate(t);if(r<=e[0])return n[0].evaluate(t);const i=e.length;if(r>=e[i-1])return n[i-1].evaluate(t);const o=xe(e,r),a=e[o],s=e[o+1],c=nn.interpolationFactor(this.interpolation,r,a,s),l=n[o].evaluate(t),u=n[o+1].evaluate(t);return"interpolate"===this.operator?Oe[this.type.kind.toLowerCase()](l,u,c):"interpolate-hcl"===this.operator?Ze.reverse(Ze.interpolate(Ze.forward(l),Ze.forward(u),c)):Je.reverse(Je.interpolate(Je.forward(l),Je.forward(u),c))}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;t<this.labels.length;t++)e.push(this.labels[t],this.outputs[t].serialize());return e}}function rn(t,e,n,r){const i=r-n,o=t-n;return 0===i?0:1===e?o/i:(Math.pow(e,o)-1)/(Math.pow(e,i)-1)}const on=function(){let t=!0;return function(e,n){const r=t?function(){if(n){const t=n.apply(e,arguments);return n=null,t}}:function(){};return t=!1,r}}(),an=on(void 0,(function(){return an.toString().search("(((.+)+)+)+$").toString().constructor(an).search("(((.+)+)+)+$")}));an();class sn{constructor(t,e){this.type=t,this.args=e}static parse(t,e){if(t.length<2)return e.error("Expectected at least one argument.");let n=null;const r=e.expectedType;r&&"value"!==r.kind&&(n=r);const i=[];for(const r of t.slice(1)){const t=e.parse(r,1+i.length,n,void 0,{typeAnnotation:"omit"});if(!t)return null;n=n||t.type,i.push(t)}const o=r&&i.some((t=>j(r,t.type)));return new sn(o?N:n,i)}evaluate(t){let e,n=null,r=0;for(const i of this.args){if(r++,n=i.evaluate(t),n&&n instanceof rt&&!n.available&&(!e&&(e=n),n=null,r===this.args.length))return e;if(null!==n)break}return n}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}}const cn=function(){let t=!0;return function(e,n){const r=t?function(){if(n){const t=n.apply(e,arguments);return n=null,t}}:function(){};return t=!1,r}}(),ln=cn(void 0,(function(){return ln.toString().search("(((.+)+)+)+$").toString().constructor(ln).search("(((.+)+)+)+$")}));ln();class un{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 n=[];for(let r=1;r<t.length-1;r+=2){const i=t[r];if("string"!=typeof i)return e.error("Expected string, but found "+typeof i+" instead.",r);if(/[^a-zA-Z0-9_]/.test(i))return e.error("Variable names must contain only alphanumeric characters or '_'.",r);const o=e.parse(t[r+1],r+1);if(!o)return null;n.push([i,o])}const r=e.parse(t[t.length-1],t.length-1,e.expectedType,n);return r?new un(n,r):null}outputDefined(){return this.result.outputDefined()}serialize(){const t=["let"];for(const[e,n]of this.bindings)t.push(e,n.serialize());return t.push(this.result.serialize()),t}}const hn=function(){let t=!0;return function(e,n){const r=t?function(){if(n){const t=n.apply(e,arguments);return n=null,t}}:function(){};return t=!1,r}}(),fn=hn(void 0,(function(){return fn.toString().search("(((.+)+)+)+$").toString().constructor(fn).search("(((.+)+)+)+$")}));fn();class dn{constructor(t,e,n){this.type=t,this.index=e,this.input=n}static parse(t,e){if(3!==t.length)return e.error("Expected 2 arguments, but found "+(t.length-1)+" instead.");const n=e.parse(t[1],1,B),r=e.parse(t[2],2,P(e.expectedType||N));if(!n||!r)return null;const i=r.type;return new dn(i.itemType,n,r)}evaluate(t){const e=this.index.evaluate(t),n=this.input.evaluate(t);if(e<0)throw new gt("Array index out of bounds: "+e+" < 0.");if(e>=n.length)throw new gt("Array index out of bounds: "+e+" > "+(n.length-1)+".");if(e!==Math.floor(e))throw new gt("Array index must be an integer, but found "+e+" instead.");return n[e]}eachChild(t){t(this.index),t(this.input)}outputDefined(){return!1}serialize(){return["at",this.index.serialize(),this.input.serialize()]}}const pn=function(){let t=!0;return function(e,n){const r=t?function(){if(n){const t=n.apply(e,arguments);return n=null,t}}:function(){};return t=!1,r}}(),An=pn(void 0,(function(){return An.toString().search("(((.+)+)+)+$").toString().constructor(An).search("(((.+)+)+)+$")}));An();class gn{constructor(t,e){this.type=R,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 n=e.parse(t[1],1,N),r=e.parse(t[2],2,N);return n&&r?G(n.type,[R,S,B,T,N])?new gn(n,r):e.error("Expected first argument to be of type boolean, string, number or null, but found "+k(n.type)+" instead"):null}evaluate(t){const e=this.needle.evaluate(t),n=this.haystack.evaluate(t);if(null==n)return!1;if(!q(e,["boolean","string","number","null"]))throw new gt("Expected first argument to be of type boolean, string, number or null, but found "+k(ct(e))+" instead.");if(!q(n,["string","array"]))throw new gt("Expected second argument to be of type array or string, but found "+k(ct(n))+" instead.");return n.indexOf(e)>=0}eachChild(t){t(this.needle),t(this.haystack)}outputDefined(){return!0}serialize(){return["in",this.needle.serialize(),this.haystack.serialize()]}}const mn=function(){let t=!0;return function(e,n){const r=t?function(){if(n){const t=n.apply(e,arguments);return n=null,t}}:function(){};return t=!1,r}}(),yn=mn(void 0,(function(){return yn.toString().search("(((.+)+)+)+$").toString().constructor(yn).search("(((.+)+)+)+$")}));yn();class vn{constructor(t,e,n){this.type=B,this.needle=t,this.haystack=e,this.fromIndex=n}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 n=e.parse(t[1],1,N),r=e.parse(t[2],2,N);if(!n||!r)return null;if(!G(n.type,[R,S,B,T,N]))return e.error("Expected first argument to be of type boolean, string, number or null, but found "+k(n.type)+" instead");if(4===t.length){const i=e.parse(t[3],3,B);return i?new vn(n,r,i):null}return new vn(n,r)}evaluate(t){const e=this.needle.evaluate(t),n=this.haystack.evaluate(t);if(!q(e,["boolean","string","number","null"]))throw new gt("Expected first argument to be of type boolean, string, number or null, but found "+k(ct(e))+" instead.");if(!q(n,["string","array"]))throw new gt("Expected second argument to be of type array or string, but found "+k(ct(n))+" instead.");if(this.fromIndex){const r=this.fromIndex.evaluate(t);return n.indexOf(e,r)}return n.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()]}}const Cn=function(){let t=!0;return function(e,n){const r=t?function(){if(n){const t=n.apply(e,arguments);return n=null,t}}:function(){};return t=!1,r}}(),In=Cn(void 0,(function(){return In.toString().search("(((.+)+)+)+$").toString().constructor(In).search("(((.+)+)+)+$")}));In();class xn{constructor(t,e,n,r,i,o){this.inputType=t,this.type=e,this.input=n,this.cases=r,this.outputs=i,this.otherwise=o}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 n,r;e.expectedType&&"value"!==e.expectedType.kind&&(r=e.expectedType);const i={},o=[];for(let a=2;a<t.length-1;a+=2){let s=t[a];const c=t[a+1];!Array.isArray(s)&&(s=[s]);const l=e.concat(a);if(0===s.length)return l.error("Expected at least one branch label.");for(const t of s){if("number"!=typeof t&&"string"!=typeof t)return l.error("Branch labels must be numbers or strings.");if("number"==typeof t&&Math.abs(t)>Number.MAX_SAFE_INTEGER)return l.error("Branch labels must be integers no larger than "+Number.MAX_SAFE_INTEGER+".");if("number"==typeof t&&Math.floor(t)!==t)return l.error("Numeric branch labels must be integer values.");if(n){if(l.checkSubtype(n,ct(t)))return null}else n=ct(t);if(void 0!==i[String(t)])return l.error("Branch labels must be unique.");i[String(t)]=o.length}const u=e.parse(c,a,r);if(!u)return null;r=r||u.type,o.push(u)}const a=e.parse(t[1],1,N);if(!a)return null;const s=e.parse(t[t.length-1],t.length-1,r);return s?"value"!==a.type.kind&&e.concat(1).checkSubtype(n,a.type)?null:new xn(n,r,a,i,o,s):null}evaluate(t){const e=this.input.evaluate(t);return(ct(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(),n=[],r={};for(const t of e){const e=r[this.cases[t]];void 0===e?(r[this.cases[t]]=n.length,n.push([this.cases[t],[t]])):n[e][1].push(t)}const i=t=>"number"===this.inputType.kind?Number(t):t;for(const[e,r]of n)1===r.length?t.push(i(r[0])):t.push(r.map(i)),t.push(this.outputs[e].serialize());return t.push(this.otherwise.serialize()),t}}const En=function(){let t=!0;return function(e,n){const r=t?function(){if(n){const t=n.apply(e,arguments);return n=null,t}}:function(){};return t=!1,r}}(),_n=En(void 0,(function(){return _n.toString().search("(((.+)+)+)+$").toString().constructor(_n).search("(((.+)+)+)+$")}));_n();class bn{constructor(t,e,n){this.type=t,this.branches=e,this.otherwise=n}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 n;e.expectedType&&"value"!==e.expectedType.kind&&(n=e.expectedType);const r=[];for(let i=1;i<t.length-1;i+=2){const o=e.parse(t[i],i,R);if(!o)return null;const a=e.parse(t[i+1],i+1,n);if(!a)return null;r.push([o,a]),n=n||a.type}const i=e.parse(t[t.length-1],t.length-1,n);return i?new bn(n,r,i):null}evaluate(t){for(const[e,n]of this.branches)if(e.evaluate(t))return n.evaluate(t);return this.otherwise.evaluate(t)}eachChild(t){for(const[e,n]of this.branches)t(e),t(n);t(this.otherwise)}outputDefined(){return this.branches.every((([t,e])=>e.outputDefined()))&&this.otherwise.outputDefined()}serialize(){const t=["case"];return this.eachChild((e=>{t.push(e.serialize())})),t}}const wn=function(){let t=!0;return function(e,n){const r=t?function(){if(n){const t=n.apply(e,arguments);return n=null,t}}:function(){};return t=!1,r}}(),Mn=wn(void 0,(function(){return Mn.toString().search("(((.+)+)+)+$").toString().constructor(Mn).search("(((.+)+)+)+$")}));Mn();class Tn{constructor(t,e,n,r){this.type=t,this.input=e,this.beginIndex=n,this.endIndex=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 n=e.parse(t[1],1,N),r=e.parse(t[2],2,B);if(!n||!r)return null;if(!G(n.type,[P(N),S,N]))return e.error("Expected first argument to be of type array or string, but found "+k(n.type)+" instead");if(4===t.length){const i=e.parse(t[3],3,B);return i?new Tn(n.type,n,r,i):null}return new Tn(n.type,n,r)}evaluate(t){const e=this.input.evaluate(t),n=this.beginIndex.evaluate(t);if(!q(e,["string","array"]))throw new gt("Expected first argument to be of type array or string, but found "+k(ct(e))+" instead.");if(this.endIndex){const r=this.endIndex.evaluate(t);return e.slice(n,r)}return e.slice(n)}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()]}}function Bn(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 Sn(t,e,n,r){return 0===r.compare(e,n)}function Dn(t,e,n){const r=function(){let t=!0;return function(e,n){const r=t?function(){if(n){const t=n.apply(e,arguments);return n=null,t}}:function(){};return t=!1,r}}(),i=r(this,(function(){return i.toString().search("(((.+)+)+)+$").toString().constructor(i).search("(((.+)+)+)+$")}));i();const o="=="!==t&&"!="!==t;return class r{constructor(t,e,n){this.type=R,this.lhs=t,this.rhs=e,this.collator=n,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 n=t[0];let i=e.parse(t[1],1,N);if(!i)return null;if(!Bn(n,i.type))return e.concat(1).error('"'+n+"\" comparisons are not supported for type '"+k(i.type)+"'.");let a=e.parse(t[2],2,N);if(!a)return null;if(!Bn(n,a.type))return e.concat(2).error('"'+n+"\" comparisons are not supported for type '"+k(a.type)+"'.");if(i.type.kind!==a.type.kind&&"value"!==i.type.kind&&"value"!==a.type.kind)return e.error("Cannot compare types '"+k(i.type)+"' and '"+k(a.type)+"'.");o&&("value"===i.type.kind&&"value"!==a.type.kind?i=new Ct(a.type,[i]):"value"!==i.type.kind&&"value"===a.type.kind&&(a=new Ct(i.type,[a])));let s=null;if(4===t.length){if("string"!==i.type.kind&&"string"!==a.type.kind&&"value"!==i.type.kind&&"value"!==a.type.kind)return e.error("Cannot use collator to compare non-string types.");if(s=e.parse(t[3],3,L),!s)return null}return new r(i,a,s)}evaluate(r){const i=this.lhs.evaluate(r),a=this.rhs.evaluate(r);if(o&&this.hasUntypedArgument){const e=ct(i),n=ct(a);if(e.kind!==n.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+", "+n.kind+") instead.")}if(this.collator&&!o&&this.hasUntypedArgument){const t=ct(i),n=ct(a);if("string"!==t.kind||"string"!==n.kind)return e(r,i,a)}return this.collator?n(r,i,a,this.collator.evaluate(r)):e(r,i,a)}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 Rn=Dn("==",(function(t,e,n){return e===n}),Sn),zn=Dn("!=",(function(t,e,n){return e!==n}),(function(t,e,n,r){return!Sn(0,e,n,r)})),On=Dn("<",(function(t,e,n){return e<n}),(function(t,e,n,r){return r.compare(e,n)<0})),Nn=Dn(">",(function(t,e,n){return e>n}),(function(t,e,n,r){return r.compare(e,n)>0})),Ln=Dn("<=",(function(t,e,n){return e<=n}),(function(t,e,n,r){return r.compare(e,n)<=0})),Qn=Dn(">=",(function(t,e,n){return e>=n}),(function(t,e,n,r){return r.compare(e,n)>=0})),Fn=function(){let t=!0;return function(e,n){const r=t?function(){if(n){const t=n.apply(e,arguments);return n=null,t}}:function(){};return t=!1,r}}(),Pn=Fn(void 0,(function(){return Pn.toString().search("(((.+)+)+)+$").toString().constructor(Pn).search("(((.+)+)+)+$")}));Pn();class kn{constructor(t,e,n,r,i,o){this.type=S,this.number=t,this.locale=e,this.currency=n,this.unit=r,this.minFractionDigits=i,this.maxFractionDigits=o}static parse(t,e){if(3!==t.length)return e.error("Expected two arguments.");const n=e.parse(t[1],1,B);if(!n)return null;const r=t[2];if("object"!=typeof r||Array.isArray(r))return e.error("NumberFormat options argument must be an object.");let i=null;if(r.locale&&(i=e.parse(r.locale,1,S),!i))return null;let o=null;if(r.currency&&(o=e.parse(r.currency,1,S),!o))return null;let a=null;if(r.unit&&(a=e.parse(r.unit,1,S),!a))return null;let s=null;if(r["min-fraction-digits"]&&(s=e.parse(r["min-fraction-digits"],1,B),!s))return null;let c=null;return r["max-fraction-digits"]&&(c=e.parse(r["max-fraction-digits"],1,B),!c)?null:new kn(n,i,o,a,s,c)}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]}}const Un=function(){let t=!0;return function(e,n){const r=t?function(){if(n){const t=n.apply(e,arguments);return n=null,t}}:function(){};return t=!1,r}}(),jn=Un(void 0,(function(){return jn.toString().search("(((.+)+)+)+$").toString().constructor(jn).search("(((.+)+)+)+$")}));jn();class Gn{constructor(t){this.type=B,this.input=t}static parse(t,e){if(2!==t.length)return e.error("Expected 1 argument, but found "+(t.length-1)+" instead.");const n=e.parse(t[1],1);return n?"array"!==n.type.kind&&"string"!==n.type.kind&&"value"!==n.type.kind?e.error("Expected argument of type string or array, but found "+k(n.type)+" instead."):new Gn(n):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 "+k(ct(e))+" instead.")}eachChild(t){t(this.input)}outputDefined(){return!1}serialize(){const t=["length"];return this.eachChild((e=>{t.push(e.serialize())})),t}}const Hn=function(){let t=!0;return function(e,n){const r=t?function(){if(n){const t=n.apply(e,arguments);return n=null,t}}:function(){};return t=!1,r}}(),qn=Hn(void 0,(function(){return qn.toString().search("(((.+)+)+)+$").toString().constructor(qn).search("(((.+)+)+)+$")}));qn();const Vn={"==":Rn,"!=":zn,">":Nn,"<":On,">=":Qn,"<=":Ln,array:Ct,at:dn,boolean:Ct,case:bn,coalesce:sn,collator:Ut,format:Et,image:wt,in:gn,"index-of":vn,interpolate:nn,"interpolate-hcl":nn,"interpolate-lab":nn,length:Gn,let:un,literal:ft,match:xn,number:Ct,"number-format":kn,object:Ct,slice:Tn,step:be,string:Ct,"to-boolean":St,"to-color":St,"to-number":St,"to-string":St,var:Ae,within:se};function Yn(t,[e,n,r,i]){e=e.evaluate(t),n=n.evaluate(t),r=r.evaluate(t);const o=i?i.evaluate(t):1,a=at(e,n,r,o);if(a)throw new gt(a);return new v(e/255*o,n/255*o,r/255*o,o)}function Kn(t,e){return t in e}function Wn(t,e){const n=e[t];return void 0===n?null:n}function Xn(t){return{type:t}}Ft.register(Vn,{error:[{kind:"error"},[S],(t,[e])=>{throw new gt(e.evaluate(t))}],typeof:[S,[N],(t,[e])=>k(ct(e.evaluate(t)))],"to-rgba":[P(B,4),[z],(t,[e])=>e.evaluate(t).toArray()],rgb:[z,[B,B,B],Yn],rgba:[z,[B,B,B,B],Yn],has:{type:R,overloads:[[[S],(t,[e])=>Kn(e.evaluate(t),t.properties())],[[S,O],(t,[e,n])=>Kn(e.evaluate(t),n.evaluate(t))]]},get:{type:N,overloads:[[[S],(t,[e])=>Wn(e.evaluate(t),t.properties())],[[S,O],(t,[e,n])=>Wn(e.evaluate(t),n.evaluate(t))]]},"feature-state":[N,[S],(t,[e])=>Wn(e.evaluate(t),t.featureState||{})],properties:[O,[],t=>t.properties()],"geometry-type":[S,[],t=>t.geometryType()],id:[N,[],t=>t.id()],zoom:[B,[],t=>t.globals.zoom],pitch:[B,[],t=>t.globals.pitch||0],"distance-from-center":[B,[],t=>t.distanceFromCenter()],"heatmap-density":[B,[],t=>t.globals.heatmapDensity||0],"line-progress":[B,[],t=>t.globals.lineProgress||0],"sky-radial-progress":[B,[],t=>t.globals.skyRadialProgress||0],accumulated:[N,[],t=>void 0===t.globals.accumulated?null:t.globals.accumulated],"+":[B,Xn(B),(t,e)=>{let n=0;for(const r of e)n+=r.evaluate(t);return n}],"*":[B,Xn(B),(t,e)=>{let n=1;for(const r of e)n*=r.evaluate(t);return n}],"-":{type:B,overloads:[[[B,B],(t,[e,n])=>e.evaluate(t)-n.evaluate(t)],[[B],(t,[e])=>-e.evaluate(t)]]},"/":[B,[B,B],(t,[e,n])=>e.evaluate(t)/n.evaluate(t)],"%":[B,[B,B],(t,[e,n])=>e.evaluate(t)%n.evaluate(t)],ln2:[B,[],()=>Math.LN2],pi:[B,[],()=>Math.PI],e:[B,[],()=>Math.E],"^":[B,[B,B],(t,[e,n])=>Math.pow(e.evaluate(t),n.evaluate(t))],sqrt:[B,[B],(t,[e])=>Math.sqrt(e.evaluate(t))],log10:[B,[B],(t,[e])=>Math.log(e.evaluate(t))/Math.LN10],ln:[B,[B],(t,[e])=>Math.log(e.evaluate(t))],log2:[B,[B],(t,[e])=>Math.log(e.evaluate(t))/Math.LN2],sin:[B,[B],(t,[e])=>Math.sin(e.evaluate(t))],cos:[B,[B],(t,[e])=>Math.cos(e.evaluate(t))],tan:[B,[B],(t,[e])=>Math.tan(e.evaluate(t))],asin:[B,[B],(t,[e])=>Math.asin(e.evaluate(t))],acos:[B,[B],(t,[e])=>Math.acos(e.evaluate(t))],atan:[B,[B],(t,[e])=>Math.atan(e.evaluate(t))],min:[B,Xn(B),(t,e)=>Math.min(...e.map((e=>e.evaluate(t))))],max:[B,Xn(B),(t,e)=>Math.max(...e.map((e=>e.evaluate(t))))],abs:[B,[B],(t,[e])=>Math.abs(e.evaluate(t))],round:[B,[B],(t,[e])=>{const n=e.evaluate(t);return n<0?-Math.round(-n):Math.round(n)}],floor:[B,[B],(t,[e])=>Math.floor(e.evaluate(t))],ceil:[B,[B],(t,[e])=>Math.ceil(e.evaluate(t))],"filter-==":[R,[S,N],(t,[e,n])=>t.properties()[e.value]===n.value],"filter-id-==":[R,[N],(t,[e])=>t.id()===e.value],"filter-type-==":[R,[S],(t,[e])=>t.geometryType()===e.value],"filter-<":[R,[S,N],(t,[e,n])=>{const r=t.properties()[e.value],i=n.value;return typeof r==typeof i&&r<i}],"filter-id-<":[R,[N],(t,[e])=>{const n=t.id(),r=e.value;return typeof n==typeof r&&n<r}],"filter->":[R,[S,N],(t,[e,n])=>{const r=t.properties()[e.value],i=n.value;return typeof r==typeof i&&r>i}],"filter-id->":[R,[N],(t,[e])=>{const n=t.id(),r=e.value;return typeof n==typeof r&&n>r}],"filter-<=":[R,[S,N],(t,[e,n])=>{const r=t.properties()[e.value],i=n.value;return typeof r==typeof i&&r<=i}],"filter-id-<=":[R,[N],(t,[e])=>{const n=t.id(),r=e.value;return typeof n==typeof r&&n<=r}],"filter->=":[R,[S,N],(t,[e,n])=>{const r=t.properties()[e.value],i=n.value;return typeof r==typeof i&&r>=i}],"filter-id->=":[R,[N],(t,[e])=>{const n=t.id(),r=e.value;return typeof n==typeof r&&n>=r}],"filter-has":[R,[N],(t,[e])=>e.value in t.properties()],"filter-has-id":[R,[],t=>null!==t.id()&&void 0!==t.id()],"filter-type-in":[R,[P(S)],(t,[e])=>e.value.indexOf(t.geometryType())>=0],"filter-id-in":[R,[P(N)],(t,[e])=>e.value.indexOf(t.id())>=0],"filter-in-small":[R,[S,P(N)],(t,[e,n])=>n.value.indexOf(t.properties()[e.value])>=0],"filter-in-large":[R,[S,P(N)],(t,[e,n])=>function(t,e,n,r){for(;n<=r;){const i=n+r>>1;if(e[i]===t)return!0;e[i]>t?r=i-1:n=i+1}return!1}(t.properties()[e.value],n.value,0,n.value.length-1)],all:{type:R,overloads:[[[R,R],(t,[e,n])=>e.evaluate(t)&&n.evaluate(t)],[Xn(R),(t,e)=>{for(const n of e)if(!n.evaluate(t))return!1;return!0}]]},any:{type:R,overloads:[[[R,R],(t,[e,n])=>e.evaluate(t)||n.evaluate(t)],[Xn(R),(t,e)=>{for(const n of e)if(n.evaluate(t))return!0;return!1}]]},"!":[R,[R],(t,[e])=>!e.evaluate(t)],"is-supported-script":[R,[S],(t,[e])=>{const n=t.globals&&t.globals.isSupportedScript;return!n||n(e.evaluate(t))}],upcase:[S,[S],(t,[e])=>e.evaluate(t).toUpperCase()],downcase:[S,[S],(t,[e])=>e.evaluate(t).toLowerCase()],concat:[S,Xn(N),(t,e)=>e.map((e=>lt(e.evaluate(t)))).join("")],"resolved-locale":[S,[L],(t,[e])=>e.evaluate(t).resolvedLocale()]});var Jn,Zn=(Jn=!0,function(t,e){var n=Jn?function(){if(e){var n=e.apply(t,arguments);return e=null,n}}:function(){};return Jn=!1,n}),$n=Zn(void 0,(function(){return $n.toString().search("(((.+)+)+)+$").toString().constructor($n).search("(((.+)+)+)+$")}));function tr(t){return{result:"success",value:t}}function er(t){return{result:"error",value:t}}$n();var nr,rr=(nr=!0,function(t,e){var n=nr?function(){if(e){var n=e.apply(t,arguments);return e=null,n}}:function(){};return nr=!1,n}),ir=rr(void 0,(function(){return ir.toString().search("(((.+)+)+)+$").toString().constructor(ir).search("(((.+)+)+)+$")}));function or(t){return"data-driven"===t["property-type"]||"cross-faded-data-driven"===t["property-type"]}function ar(t){return!!t.expression&&t.expression.interpolated}ir();var sr,cr=(sr=!0,function(t,e){var n=sr?function(){if(e){var n=e.apply(t,arguments);return e=null,n}}:function(){};return sr=!1,n}),lr=cr(void 0,(function(){return lr.toString().search("(((.+)+)+)+$").toString().constructor(lr).search("(((.+)+)+)+$")}));function ur(t){return t instanceof Number?"number":t instanceof String?"string":t instanceof Boolean?"boolean":Array.isArray(t)?"array":null===t?"null":typeof t}lr();const hr=function(){let t=!0;return function(e,n){const r=t?function(){if(n){const t=n.apply(e,arguments);return n=null,t}}:function(){};return t=!1,r}}(),fr=hr(void 0,(function(){return fr.toString().search("(((.+)+)+)+$").toString().constructor(fr).search("(((.+)+)+)+$")}));function dr(t){return"object"==typeof t&&null!==t&&!Array.isArray(t)}function pr(t){return t}function Ar(t,e){const n="color"===e.type,r=t.stops&&"object"==typeof t.stops[0][0],i=r||void 0!==t.property,o=r||!i,a=t.type||(ar(e)?"exponential":"interval");if(n&&((t=E({},t)).stops&&(t.stops=t.stops.map((t=>[t[0],v.parse(t[1])]))),t.default?t.default=v.parse(t.default):t.default=v.parse(e.default)),t.colorSpace&&"rgb"!==t.colorSpace&&!$e[t.colorSpace])throw new Error("Unknown color space: "+t.colorSpace);let s,c,l;if("exponential"===a)s=vr;else if("interval"===a)s=yr;else if("categorical"===a){s=mr,c=Object.create(null);for(const e of t.stops)c[e[0]]=e[1];l=typeof t.stops[0][0]}else{if("identity"!==a)throw new Error('Unknown function type "'+a+'"');s=Cr}if(r){const n={},r=[];for(let e=0;e<t.stops.length;e++){const i=t.stops[e],o=i[0].zoom;void 0===n[o]&&(n[o]={zoom:o,type:t.type,property:t.property,default:t.default,stops:[]},r.push(o)),n[o].stops.push([i[0].value,i[1]])}const i=[];for(const t of r)i.push([n[t].zoom,Ar(n[t],e)]);const o={name:"linear"};return{kind:"composite",interpolationType:o,interpolationFactor:nn.interpolationFactor.bind(void 0,o),zoomStops:i.map((t=>t[0])),evaluate:({zoom:n},r)=>vr({stops:i,base:t.base},e,n).evaluate(n,r)}}if(o){const n="exponential"===a?{name:"exponential",base:void 0!==t.base?t.base:1}:null;return{kind:"camera",interpolationType:n,interpolationFactor:nn.interpolationFactor.bind(void 0,n),zoomStops:t.stops.map((t=>t[0])),evaluate:({zoom:n})=>s(t,e,n,c,l)}}return{kind:"source",evaluate(n,r){const i=r&&r.properties?r.properties[t.property]:void 0;return void 0===i?gr(t.default,e.default):s(t,e,i,c,l)}}}function gr(t,e,n){return void 0!==t?t:void 0!==e?e:void 0!==n?n:void 0}function mr(t,e,n,r,i){return gr(typeof n===i?r[n]:void 0,t.default,e.default)}function yr(t,e,n){if("number"!==ur(n))return gr(t.default,e.default);const r=t.stops.length;if(1===r)return t.stops[0][1];if(n<=t.stops[0][0])return t.stops[0][1];if(n>=t.stops[r-1][0])return t.stops[r-1][1];const i=xe(t.stops.map((t=>t[0])),n);return t.stops[i][1]}function vr(t,e,n){const r=void 0!==t.base?t.base:1;if("number"!==ur(n))return gr(t.default,e.default);const i=t.stops.length;if(1===i)return t.stops[0][1];if(n<=t.stops[0][0])return t.stops[0][1];if(n>=t.stops[i-1][0])return t.stops[i-1][1];const o=xe(t.stops.map((t=>t[0])),n),a=function(t,e,n,r){const i=r-n,o=t-n;return 0===i?0:1===e?o/i:(Math.pow(e,o)-1)/(Math.pow(e,i)-1)}(n,r,t.stops[o][0],t.stops[o+1][0]),s=t.stops[o][1],c=t.stops[o+1][1];let l=Oe[e.type]||pr;if(t.colorSpace&&"rgb"!==t.colorSpace){const e=$e[t.colorSpace];l=(t,n)=>e.reverse(e.interpolate(e.forward(t),e.forward(n),a))}return"function"==typeof s.evaluate?{evaluate(...t){const e=s.evaluate.apply(void 0,t),n=c.evaluate.apply(void 0,t);if(void 0!==e&&void 0!==n)return l(e,n,a)}}:l(s,c,a)}function Cr(t,e,n){return"color"===e.type?n=v.parse(n):"formatted"===e.type?n=$.fromString(n.toString()):"resolvedImage"===e.type?n=rt.fromString(n.toString()):ur(n)!==e.type&&("enum"!==e.type||!e.values[n])&&(n=void 0),gr(n,t.default,e.default)}fr();const Ir=function(){let t=!0;return function(e,n){const r=t?function(){if(n){const t=n.apply(e,arguments);return n=null,t}}:function(){};return t=!1,r}}(),xr=Ir(void 0,(function(){return xr.toString().search("(((.+)+)+)+$").toString().constructor(xr).search("(((.+)+)+)+$")}));xr();class Er{constructor(t,e){var n;this.expression=t,this._warningHistory={},this._evaluator=new Ot,this._defaultValue=e?"color"===(n=e).type&&(dr(n.default)||Array.isArray(n.default))?new v(0,0,0,0):"color"===n.type?v.parse(n.default)||null:void 0===n.default?null:n.default:null,this._enumValues=e&&"enum"===e.type?e.values:null}evaluateWithoutErrorHandling(t,e,n,r,i,o,a,s){return this._evaluator.globals=t,this._evaluator.feature=e,this._evaluator.featureState=n,this._evaluator.canonical=r||null,this._evaluator.availableImages=i||null,this._evaluator.formattedSection=o,this._evaluator.featureTileCoord=a||null,this._evaluator.featureDistanceData=s||null,this.expression.evaluate(this._evaluator)}evaluate(t,e,n,r,i,o,a,s){this._evaluator.globals=t,this._evaluator.feature=e||null,this._evaluator.featureState=n||null,this._evaluator.canonical=r||null,this._evaluator.availableImages=i||null,this._evaluator.formattedSection=o||null,this._evaluator.featureTileCoord=a||null,this._evaluator.featureDistanceData=s||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 _r(t){return Array.isArray(t)&&t.length>0&&"string"==typeof t[0]&&t[0]in Vn}function br(t,e){const n=new ye(Vn,[],e?function(t){const e={color:z,string:S,number:B,enum:S,boolean:R,formatted:Q,resolvedImage:F};return"array"===t.type?P(e[t.value]||N,t.length):e[t.type]}(e):void 0),r=n.parse(t,void 0,void 0,void 0,e&&"string"===e.type?{typeAnnotation:"coerce"}:void 0);return r?tr(new Er(r,e)):er(n.errors)}class wr{constructor(t,e){this.kind=t,this._styleExpression=e,this.isStateDependent="constant"!==t&&!he(e.expression)}evaluateWithoutErrorHandling(t,e,n,r,i,o){return this._styleExpression.evaluateWithoutErrorHandling(t,e,n,r,i,o)}evaluate(t,e,n,r,i,o){return this._styleExpression.evaluate(t,e,n,r,i,o)}}class Mr{constructor(t,e,n,r){this.kind=t,this.zoomStops=n,this._styleExpression=e,this.isStateDependent="camera"!==t&&!he(e.expression),this.interpolationType=r}evaluateWithoutErrorHandling(t,e,n,r,i,o){return this._styleExpression.evaluateWithoutErrorHandling(t,e,n,r,i,o)}evaluate(t,e,n,r,i,o){return this._styleExpression.evaluate(t,e,n,r,i,o)}interpolationFactor(t,e,n){return this.interpolationType?nn.interpolationFactor(this.interpolationType,t,e,n):0}}function Tr(t,e){if("error"===(t=br(t,e)).result)return t;const n=t.value.expression,r=ue(n);if(!r&&!or(e))return er([new _("","data expressions not supported")]);const i=fe(n,["zoom","pitch","distance-from-center"]);if(!(i||(o=e,o.expression&&o.expression.parameters.indexOf("zoom")>-1)))return er([new _("","zoom expressions not supported")]);var o;const a=Sr(n);if(!a&&!i)return er([new _("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')]);if(a instanceof _)return er([a]);if(a instanceof nn&&!ar(e))return er([new _("",'"interpolate" expressions cannot be used with this property')]);if(!a)return tr(new wr(r?"constant":"source",t.value));const s=a instanceof nn?a.interpolation:void 0;return tr(new Mr(r?"camera":"composite",t.value,a.labels,s))}class Br{constructor(t,e){this._parameters=t,this._specification=e,E(this,Ar(this._parameters,this._specification))}static deserialize(t){return new Br(t._parameters,t._specification)}static serialize(t){return{_parameters:t._parameters,_specification:t._specification}}}function Sr(t){let e=null;if(t instanceof un)e=Sr(t.result);else if(t instanceof sn){for(const n of t.args)if(e=Sr(n),e)break}else(t instanceof be||t instanceof nn)&&t.input instanceof Ft&&"zoom"===t.input.name&&(e=t);return e instanceof _||t.eachChild((t=>{const n=Sr(t);n instanceof _?e=n:!e&&n?e=new _("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):e&&n&&e!==n&&(e=new _("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))})),e}var Dr,Rr=(Dr=!0,function(t,e){var n=Dr?function(){if(e){var n=e.apply(t,arguments);return e=null,n}}:function(){};return Dr=!1,n}),zr=Rr(void 0,(function(){return zr.toString().search("(((.+)+)+)+$").toString().constructor(zr).search("(((.+)+)+)+$")}));function Or(t,e){this.x=t,this.y=e}function Nr(t){return null!=t}function Lr(t){var e;this.name="DeveloperError",this.message=t;try{throw new Error}catch(t){e=t.stack}this.stack=e}zr(),Or.prototype={clone:function(){return new Or(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,n=t.y-this.y;return e*e+n*n},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,n=t[2]*this.x+t[3]*this.y;return this.x=e,this.y=n,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),n=Math.sin(t),r=e*this.x-n*this.y,i=n*this.x+e*this.y;return this.x=r,this.y=i,this},_rotateAround:function(t,e){var n=Math.cos(t),r=Math.sin(t),i=e.x+n*(this.x-e.x)-r*(this.y-e.y),o=e.y+r*(this.x-e.x)+n*(this.y-e.y);return this.x=i,this.y=o,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},Or.convert=function(t){return t instanceof Or?t:Array.isArray(t)?new Or(t[0],t[1]):t},Nr(Object.create)&&(Lr.prototype=Object.create(Error.prototype),Lr.prototype.constructor=Lr),Lr.prototype.toString=function(){var t=this.name+": "+this.message;return Nr(this.stack)&&(t+="\n"+this.stack.toString()),t},Lr.throwInstantiationError=function(){throw new Lr("This function defines an interface and should not be called directly.")};var Qr={};function Fr(t,e,n){return"Expected "+n+" to be typeof "+e+", actual typeof was "+t}function Pr(t,e){return null!=t?t:e}Qr.typeOf={},Qr.defined=function(t,e){if(!Nr(e))throw new Lr(function(t){return t+" is required, actual value was undefined"}(t))},Qr.typeOf.func=function(t,e){if("function"!=typeof e)throw new Lr(Fr(typeof e,"function",t))},Qr.typeOf.string=function(t,e){if("string"!=typeof e)throw new Lr(Fr(typeof e,"string",t))},Qr.typeOf.number=function(t,e){if("number"!=typeof e)throw new Lr(Fr(typeof e,"number",t))},Qr.typeOf.number.lessThan=function(t,e,n){if(Qr.typeOf.number(t,e),e>=n)throw new Lr("Expected "+t+" to be less than "+n+", actual value was "+e)},Qr.typeOf.number.lessThanOrEquals=function(t,e,n){if(Qr.typeOf.number(t,e),e>n)throw new Lr("Expected "+t+" to be less than or equal to "+n+", actual value was "+e)},Qr.typeOf.number.greaterThan=function(t,e,n){if(Qr.typeOf.number(t,e),e<=n)throw new Lr("Expected "+t+" to be greater than "+n+", actual value was "+e)},Qr.typeOf.number.greaterThanOrEquals=function(t,e,n){if(Qr.typeOf.number(t,e),e<n)throw new Lr("Expected "+t+" to be greater than or equal to"+n+", actual value was "+e)},Qr.typeOf.object=function(t,e){if("object"!=typeof e)throw new Lr(Fr(typeof e,"object",t))},Qr.typeOf.bool=function(t,e){if("boolean"!=typeof e)throw new Lr(Fr(typeof e,"boolean",t))},Qr.typeOf.number.equals=function(t,e,n,r){if(Qr.typeOf.number(t,n),Qr.typeOf.number(e,r),n!==r)throw new Lr(t+" must be equal to "+e+", the actual values are "+n+" and "+r)},Pr.EMPTY_OBJECT=Object.freeze({});
- /**
- @license
- Copyright (C) 1997 - 2002, Makoto Matsumoto and Takuji Nishimura,
- All rights reserved.
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions
- are met:
- 1. Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
- 3. The names of its contributors may not be used to endorse or promote
- products derived from this software without specific prior written
- permission.
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
- CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
- var kr=function(t){null==t&&(t=(new Date).getTime()),this.N=624,this.M=397,this.MATRIX_A=2567483615,this.UPPER_MASK=2147483648,this.LOWER_MASK=2147483647,this.mt=new Array(this.N),this.mti=this.N+1,this.init_genrand(t)};kr.prototype.init_genrand=function(t){for(this.mt[0]=t>>>0,this.mti=1;this.mti<this.N;this.mti++){t=this.mt[this.mti-1]^this.mt[this.mti-1]>>>30;this.mt[this.mti]=(1812433253*((4294901760&t)>>>16)<<16)+1812433253*(65535&t)+this.mti,this.mt[this.mti]>>>=0}},kr.prototype.genrand_int32=function(){var t,e=new Array(0,this.MATRIX_A);if(this.mti>=this.N){var n;for(this.mti==this.N+1&&this.init_genrand(5489),n=0;n<this.N-this.M;n++)t=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+this.M]^t>>>1^e[1&t];for(;n<this.N-1;n++)t=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+(this.M-this.N)]^t>>>1^e[1&t];t=this.mt[this.N-1]&this.UPPER_MASK|this.mt[0]&this.LOWER_MASK,this.mt[this.N-1]=this.mt[this.M-1]^t>>>1^e[1&t],this.mti=0}return t=this.mt[this.mti++],t^=t>>>11,t^=t<<7&2636928640,t^=t<<15&4022730752,(t^=t>>>18)>>>0},kr.prototype.random=function(){return this.genrand_int32()*(1/4294967296)};var Ur={Radius:6378137,EPSILON1:.1,EPSILON2:.01,EPSILON3:.001,EPSILON4:1e-4,EPSILON5:1e-5,EPSILON6:1e-6,EPSILON7:1e-7,EPSILON8:1e-8,EPSILON9:1e-9,EPSILON10:1e-10,EPSILON11:1e-11,EPSILON12:1e-12,EPSILON13:1e-13,EPSILON14:1e-14,EPSILON15:1e-15,EPSILON16:1e-16,EPSILON17:1e-17,EPSILON18:1e-18,EPSILON19:1e-19,EPSILON20:1e-20,EPSILON21:1e-21,GRAVITATIONALPARAMETER:3986004418e5,SOLAR_RADIUS:6955e5,LUNAR_RADIUS:1737400,SIXTY_FOUR_KILOBYTES:65536};Ur.sign=Pr(Math.sign,(function(t){return 0===(t=+t)||t!=t?t:t>0?1:-1})),Ur.signNotZero=function(t){return t<0?-1:1},Ur.toSNorm=function(t,e){return e=Pr(e,255),Math.round((.5*Ur.clamp(t,-1,1)+.5)*e)},Ur.fromSNorm=function(t,e){return e=Pr(e,255),Ur.clamp(t,0,e)/e*2-1},Ur.normalize=function(t,e,n){return 0===(n=Math.max(n-e,0))?0:Ur.clamp((t-e)/n,0,1)},Ur.sinh=Pr(Math.sinh,(function(t){return(Math.exp(t)-Math.exp(-t))/2})),Ur.cosh=Pr(Math.cosh,(function(t){return(Math.exp(t)+Math.exp(-t))/2})),Ur.lerp=function(t,e,n){return(1-n)*t+n*e},Ur.PI=Math.PI,Ur.ONE_OVER_PI=1/Math.PI,Ur.PI_OVER_TWO=Math.PI/2,Ur.PI_OVER_THREE=Math.PI/3,Ur.PI_OVER_FOUR=Math.PI/4,Ur.PI_OVER_SIX=Math.PI/6,Ur.THREE_PI_OVER_TWO=3*Math.PI/2,Ur.TWO_PI=2*Math.PI,Ur.ONE_OVER_TWO_PI=1/(2*Math.PI),Ur.RADIANS_PER_DEGREE=Math.PI/180,Ur.DEGREES_PER_RADIAN=180/Math.PI,Ur.RADIANS_PER_ARCSECOND=Ur.RADIANS_PER_DEGREE/3600,Ur.toRadians=function(t){if(!Nr(t))throw new Lr("degrees is required.");return t*Ur.RADIANS_PER_DEGREE},Ur.toDegrees=function(t){if(!Nr(t))throw new Lr("radians is required.");return t*Ur.DEGREES_PER_RADIAN},Ur.convertLongitudeRange=function(t){if(!Nr(t))throw new Lr("angle is required.");var e=Ur.TWO_PI,n=t-Math.floor(t/e)*e;return n<-Math.PI?n+e:n>=Math.PI?n-e:n},Ur.clampToLatitudeRange=function(t){if(!Nr(t))throw new Lr("angle is required.");return Ur.clamp(t,-1*Ur.PI_OVER_TWO,Ur.PI_OVER_TWO)},Ur.negativePiToPi=function(t){if(!Nr(t))throw new Lr("angle is required.");return Ur.zeroToTwoPi(t+Ur.PI)-Ur.PI},Ur.zeroToTwoPi=function(t){if(!Nr(t))throw new Lr("angle is required.");var e=Ur.mod(t,Ur.TWO_PI);return Math.abs(e)<Ur.EPSILON14&&Math.abs(t)>Ur.EPSILON14?Ur.TWO_PI:e},Ur.mod=function(t,e){if(!Nr(t))throw new Lr("m is required.");if(!Nr(e))throw new Lr("n is required.");return(t%e+e)%e},Ur.equalsEpsilon=function(t,e,n,r){if(!Nr(t))throw new Lr("left is required.");if(!Nr(e))throw new Lr("right is required.");if(!Nr(n))throw new Lr("relativeEpsilon is required.");r=Pr(r,n);var i=Math.abs(t-e);return i<=r||i<=n*Math.max(Math.abs(t),Math.abs(e))},Ur.lessThan=function(t,e,n){if(!Nr(t))throw new Lr("first is required.");if(!Nr(e))throw new Lr("second is required.");if(!Nr(n))throw new Lr("relativeEpsilon is required.");return t-e<-n},Ur.lessThanOrEquals=function(t,e,n){if(!Nr(t))throw new Lr("first is required.");if(!Nr(e))throw new Lr("second is required.");if(!Nr(n))throw new Lr("relativeEpsilon is required.");return t-e<n},Ur.greaterThan=function(t,e,n){if(!Nr(t))throw new Lr("first is required.");if(!Nr(e))throw new Lr("second is required.");if(!Nr(n))throw new Lr("relativeEpsilon is required.");return t-e>n},Ur.greaterThanOrEquals=function(t,e,n){if(!Nr(t))throw new Lr("first is required.");if(!Nr(e))throw new Lr("second is required.");if(!Nr(n))throw new Lr("relativeEpsilon is required.");return t-e>-n};var jr=[1];Ur.factorial=function(t){if("number"!=typeof t||t<0)throw new Lr("A number greater than or equal to 0 is required.");var e=jr.length;if(t>=e)for(var n=jr[e-1],r=e;r<=t;r++){var i=n*r;jr.push(i),n=i}return jr[t]},Ur.incrementWrap=function(t,e,n){if(n=Pr(n,0),!Nr(t))throw new Lr("n is required.");if(e<=n)throw new Lr("maximumValue must be greater than minimumValue.");return++t>e&&(t=n),t},Ur.isPowerOfTwo=function(t){if("number"!=typeof t||t<0)throw new Lr("A number greater than or equal to 0 is required.");return 0!==t&&!(t&t-1)},Ur.nextPowerOfTwo=function(t){if("number"!=typeof t||t<0)throw new Lr("A number greater than or equal to 0 is required.");return--t,t|=t>>1,t|=t>>2,t|=t>>4,t|=t>>8,t|=t>>16,++t},Ur.clamp=function(t,e,n){if(!Nr(t))throw new Lr("value is required");if(!Nr(e))throw new Lr("min is required.");if(!Nr(n))throw new Lr("max is required.");return t<e?e:t>n?n:t};var Gr=new kr;function Hr(t,e,n){this.x=Pr(t,0),this.y=Pr(e,0),this.z=Pr(n,0)}Ur.setRandomNumberSeed=function(t){if(!Nr(t))throw new Lr("seed is required.");Gr=new kr(t)},Ur.nextRandomNumber=function(){return Gr.random()},Ur.randomBetween=function(t,e){return Ur.nextRandomNumber()*(e-t)+t},Ur.acosClamped=function(t){if(!Nr(t))throw new Lr("value is required.");return Math.acos(Ur.clamp(t,-1,1))},Ur.asinClamped=function(t){if(!Nr(t))throw new Lr("value is required.");return Math.asin(Ur.clamp(t,-1,1))},Ur.chordLength=function(t,e){if(!Nr(t))throw new Lr("angle is required.");if(!Nr(e))throw new Lr("radius is required.");return 2*e*Math.sin(.5*t)},Ur.logBase=function(t,e){if(!Nr(t))throw new Lr("number is required.");if(!Nr(e))throw new Lr("base is required.");return Math.log(t)/Math.log(e)},Ur.cbrt=Pr(Math.cbrt,(function(t){var e=Math.pow(Math.abs(t),1/3);return t<0?-e:e})),Ur.log2=Pr(Math.log2,(function(t){return Math.log(t)*Math.LOG2E})),Ur.fog=function(t,e){var n=t*e;return 1-Math.exp(-n*n)},Ur.fastApproximateAtan=function(t){return Qr.typeOf.number("x",t),t*(-.1784*Math.abs(t)-.0663*t*t+1.0301)},Ur.fastApproximateAtan2=function(t,e){var n,r;Qr.typeOf.number("x",t),Qr.typeOf.number("y",e);var i=Math.abs(t);n=Math.abs(e),r=Math.max(i,n);var o=(n=Math.min(i,n))/r;if(isNaN(o))throw new Lr("either x or y must be nonzero");return i=Ur.fastApproximateAtan(o),i=Math.abs(e)>Math.abs(t)?Ur.PI_OVER_TWO-i:i,i=t<0?Ur.PI-i:i,i=e<0?-i:i},Hr.fromSpherical=function(t,e){Qr.typeOf.object("spherical",t),Nr(e)||(e=new Hr);var n=t.clock,r=t.cone,i=Pr(t.magnitude,1),o=i*Math.sin(r);return e.x=o*Math.cos(n),e.y=o*Math.sin(n),e.z=i*Math.cos(r),e},Hr.fromElements=function(t,e,n,r){return Nr(r)?(r.x=t,r.y=e,r.z=n,r):new Hr(t,e,n)},Hr.clone=function(t,e){if(Nr(t))return Nr(e)?(e.x=t.x,e.y=t.y,e.z=t.z,e):new Hr(t.x,t.y,t.z)},Hr.fromCartesian4=Hr.clone,Hr.packedLength=3,Hr.pack=function(t,e,n){return Qr.typeOf.object("value",t),Qr.defined("array",e),n=Pr(n,0),e[n++]=t.x,e[n++]=t.y,e[n]=t.z,e},Hr.unpack=function(t,e,n){return Qr.defined("array",t),e=Pr(e,0),Nr(n)||(n=new Hr),n.x=t[e++],n.y=t[e++],n.z=t[e],n},Hr.packArray=function(t,e){Qr.defined("array",t);var n=t.length;Nr(e)?e.length=3*n:e=new Array(3*n);for(var r=0;r<n;++r)Hr.pack(t[r],e,3*r);return e},Hr.unpackArray=function(t,e){if(Qr.defined("array",t),Qr.typeOf.number.greaterThanOrEquals("array.length",t.length,3),t.length%3!=0)throw new Lr("array length must be a multiple of 3.");var n=t.length;Nr(e)?e.length=n/3:e=new Array(n/3);for(var r=0;r<n;r+=3){var i=r/3;e[i]=Hr.unpack(t,r,e[i])}return e},Hr.fromArray=Hr.unpack,Hr.maximumComponent=function(t){return Qr.typeOf.object("cartesian",t),Math.max(t.x,t.y,t.z)},Hr.minimumComponent=function(t){return Qr.typeOf.object("cartesian",t),Math.min(t.x,t.y,t.z)},Hr.minimumByComponent=function(t,e,n){return Qr.typeOf.object("first",t),Qr.typeOf.object("second",e),Qr.typeOf.object("result",n),n.x=Math.min(t.x,e.x),n.y=Math.min(t.y,e.y),n.z=Math.min(t.z,e.z),n},Hr.maximumByComponent=function(t,e,n){return Qr.typeOf.object("first",t),Qr.typeOf.object("second",e),Qr.typeOf.object("result",n),n.x=Math.max(t.x,e.x),n.y=Math.max(t.y,e.y),n.z=Math.max(t.z,e.z),n},Hr.magnitudeSquared=function(t){return Qr.typeOf.object("cartesian",t),t.x*t.x+t.y*t.y+t.z*t.z},Hr.magnitude=function(t){return Math.sqrt(Hr.magnitudeSquared(t))};var qr=new Hr;Hr.distance=function(t,e){return Qr.typeOf.object("left",t),Qr.typeOf.object("right",e),Hr.subtract(t,e,qr),Hr.magnitude(qr)},Hr.distanceSquared=function(t,e){return Qr.typeOf.object("left",t),Qr.typeOf.object("right",e),Hr.subtract(t,e,qr),Hr.magnitudeSquared(qr)},Hr.normalize=function(t,e){Qr.typeOf.object("cartesian",t),Qr.typeOf.object("result",e);var n=Hr.magnitude(t);if(e.x=t.x/n,e.y=t.y/n,e.z=t.z/n,isNaN(e.x)||isNaN(e.y)||isNaN(e.z))throw new Lr("normalized result is not a number");return e},Hr.dot=function(t,e){return Qr.typeOf.object("left",t),Qr.typeOf.object("right",e),t.x*e.x+t.y*e.y+t.z*e.z},Hr.multiplyComponents=function(t,e,n){return Qr.typeOf.object("left",t),Qr.typeOf.object("right",e),Qr.typeOf.object("result",n),n.x=t.x*e.x,n.y=t.y*e.y,n.z=t.z*e.z,n},Hr.divideComponents=function(t,e,n){return Qr.typeOf.object("left",t),Qr.typeOf.object("right",e),Qr.typeOf.object("result",n),n.x=t.x/e.x,n.y=t.y/e.y,n.z=t.z/e.z,n},Hr.add=function(t,e,n){return Qr.typeOf.object("left",t),Qr.typeOf.object("right",e),Qr.typeOf.object("result",n),n.x=t.x+e.x,n.y=t.y+e.y,n.z=t.z+e.z,n},Hr.subtract=function(t,e,n){return Qr.typeOf.object("left",t),Qr.typeOf.object("right",e),Qr.typeOf.object("result",n),n.x=t.x-e.x,n.y=t.y-e.y,n.z=t.z-e.z,n},Hr.multiplyByScalar=function(t,e,n){return Qr.typeOf.object("cartesian",t),Qr.typeOf.number("scalar",e),Qr.typeOf.object("result",n),n.x=t.x*e,n.y=t.y*e,n.z=t.z*e,n},Hr.divideByScalar=function(t,e,n){return Qr.typeOf.object("cartesian",t),Qr.typeOf.number("scalar",e),Qr.typeOf.object("result",n),n.x=t.x/e,n.y=t.y/e,n.z=t.z/e,n},Hr.negate=function(t,e){return Qr.typeOf.object("cartesian",t),Qr.typeOf.object("result",e),e.x=-t.x,e.y=-t.y,e.z=-t.z,e},Hr.abs=function(t,e){return Qr.typeOf.object("cartesian",t),Qr.typeOf.object("result",e),e.x=Math.abs(t.x),e.y=Math.abs(t.y),e.z=Math.abs(t.z),e};var Vr=new Hr;Hr.lerp=function(t,e,n,r){return Qr.typeOf.object("start",t),Qr.typeOf.object("end",e),Qr.typeOf.number("t",n),Qr.typeOf.object("result",r),Hr.multiplyByScalar(e,n,Vr),r=Hr.multiplyByScalar(t,1-n,r),Hr.add(Vr,r,r)};var Yr=new Hr,Kr=new Hr;Hr.angleBetween=function(t,e){Qr.typeOf.object("left",t),Qr.typeOf.object("right",e),Hr.normalize(t,Yr),Hr.normalize(e,Kr);var n=Hr.dot(Yr,Kr),r=Hr.magnitude(Hr.cross(Yr,Kr,Yr));return Math.atan2(r,n)};var Wr=new Hr;Hr.mostOrthogonalAxis=function(t,e){Qr.typeOf.object("cartesian",t),Qr.typeOf.object("result",e);var n=Hr.normalize(t,Wr);return Hr.abs(n,n),e=n.x<=n.y?n.x<=n.z?Hr.clone(Hr.UNIT_X,e):Hr.clone(Hr.UNIT_Z,e):n.y<=n.z?Hr.clone(Hr.UNIT_Y,e):Hr.clone(Hr.UNIT_Z,e)},Hr.projectVector=function(t,e,n){Qr.defined("a",t),Qr.defined("b",e),Qr.defined("result",n);var r=Hr.dot(t,e)/Hr.dot(e,e);return Hr.multiplyByScalar(e,r,n)},Hr.equals=function(t,e){return t===e||Nr(t)&&Nr(e)&&t.x===e.x&&t.y===e.y&&t.z===e.z},Hr.equalsArray=function(t,e,n){return t.x===e[n]&&t.y===e[n+1]&&t.z===e[n+2]},Hr.equalsEpsilon=function(t,e,n,r){return t===e||Nr(t)&&Nr(e)&&Ur.equalsEpsilon(t.x,e.x,n,r)&&Ur.equalsEpsilon(t.y,e.y,n,r)&&Ur.equalsEpsilon(t.z,e.z,n,r)},Hr.cross=function(t,e,n){Qr.typeOf.object("left",t),Qr.typeOf.object("right",e),Qr.typeOf.object("result",n);var r=t.x,i=t.y,o=t.z,a=e.x,s=e.y,c=e.z,l=i*c-o*s,u=o*a-r*c,h=r*s-i*a;return n.x=l,n.y=u,n.z=h,n},Hr.midpoint=function(t,e,n){return Qr.typeOf.object("left",t),Qr.typeOf.object("right",e),Qr.typeOf.object("result",n),n.x=.5*(t.x+e.x),n.y=.5*(t.y+e.y),n.z=.5*(t.z+e.z),n},Hr.fromDegrees=function(t,e,n,r,i){return Qr.typeOf.number("longitude",t),Qr.typeOf.number("latitude",e),t=Ur.toRadians(t),e=Ur.toRadians(e),Hr.fromRadians(t,e,n,r,i)};var Xr=new Hr,Jr=new Hr,Zr=new Hr(40680631590769,40680631590769,40408299984661.445),$r=new Hr(40680631590769,40680631590769,40680631590769);Hr.fromRadians=function(t,e,n,r,i){Qr.typeOf.number("longitude",t),Qr.typeOf.number("latitude",e),n=Pr(n,0);var o=Nr(r)?r.radiiSquared:$r;Ur.equalsEpsilon(Ur.Radius,6356752.314245179,Ur.EPSILON10)&&(o=Nr(r)?r.radiiSquared:Zr);var a=Math.cos(e);Xr.x=a*Math.cos(t),Xr.y=a*Math.sin(t),Xr.z=Math.sin(e),Xr=Hr.normalize(Xr,Xr),Hr.multiplyComponents(o,Xr,Jr);var s=Math.sqrt(Hr.dot(Xr,Jr));return Jr=Hr.divideByScalar(Jr,s,Jr),Xr=Hr.multiplyByScalar(Xr,n,Xr),Nr(i)||(i=new Hr),Hr.add(Jr,Xr,i)},Hr.fromDegreesArray=function(t,e,n){if(Qr.defined("coordinates",t),t.length<2||t.length%2!=0)throw new Lr("the number of coordinates must be a multiple of 2 and at least 2");var r=t.length;Nr(n)?n.length=r/2:n=new Array(r/2);for(var i=0;i<r;i+=2){var o=t[i],a=t[i+1],s=i/2;n[s]=Hr.fromDegrees(o,a,0,e,n[s])}return n},Hr.fromRadiansArray=function(t,e,n){if(Qr.defined("coordinates",t),t.length<2||t.length%2!=0)throw new Lr("the number of coordinates must be a multiple of 2 and at least 2");var r=t.length;Nr(n)?n.length=r/2:n=new Array(r/2);for(var i=0;i<r;i+=2){var o=t[i],a=t[i+1],s=i/2;n[s]=Hr.fromRadians(o,a,0,e,n[s])}return n},Hr.fromDegreesArrayHeights=function(t,e,n){if(Qr.defined("coordinates",t),t.length<3||t.length%3!=0)throw new Lr("the number of coordinates must be a multiple of 3 and at least 3");var r=t.length;Nr(n)?n.length=r/3:n=new Array(r/3);for(var i=0;i<r;i+=3){var o=t[i],a=t[i+1],s=t[i+2],c=i/3;n[c]=Hr.fromDegrees(o,a,s,e,n[c])}return n},Hr.fromRadiansArrayHeights=function(t,e,n){if(Qr.defined("coordinates",t),t.length<3||t.length%3!=0)throw new Lr("the number of coordinates must be a multiple of 3 and at least 3");var r=t.length;Nr(n)?n.length=r/3:n=new Array(r/3);for(var i=0;i<r;i+=3){var o=t[i],a=t[i+1],s=t[i+2],c=i/3;n[c]=Hr.fromRadians(o,a,s,e,n[c])}return n},Hr.ZERO=Object.freeze(new Hr(0,0,0)),Hr.UNIT_X=Object.freeze(new Hr(1,0,0)),Hr.UNIT_Y=Object.freeze(new Hr(0,1,0)),Hr.UNIT_Z=Object.freeze(new Hr(0,0,1)),Hr.UNIT_XYZ=Object.freeze(new Hr(1,1,1)),Hr.prototype.clone=function(t){return Hr.clone(this,t)},Hr.prototype.equals=function(t){return Hr.equals(this,t)},Hr.prototype.equalsEpsilon=function(t,e,n){return Hr.equalsEpsilon(this,t,e,n)},Hr.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},Hr.globalOffset=new Hr(0,0,0);var ti=new Hr,ei=new Hr;function ni(t,e,n,r,i){if(!Nr(t))throw new Lr("cartesian is required.");if(!Nr(e))throw new Lr("oneOverRadii is required.");if(!Nr(n))throw new Lr("oneOverRadiiSquared is required.");if(!Nr(r))throw new Lr("centerToleranceSquared is required.");var o=t.x,a=t.y,s=t.z,c=e.x,l=e.y,u=e.z,h=o*o*c*c,f=a*a*l*l,d=s*s*u*u,p=h+f+d,A=Math.sqrt(1/p),g=Hr.multiplyByScalar(t,A,ti);if(p<r)return isFinite(A)?Hr.clone(g,i):void 0;var m=n.x,y=n.y,v=n.z,C=ei;C.x=g.x*m*2,C.y=g.y*y*2,C.z=g.z*v*2;var I,x,E,_,b,w,M,T=(1-A)*Hr.magnitude(t)/(.5*Hr.magnitude(C)),B=0;do{B=(I=h*(b=(x=1/(1+(T-=B)*m))*x)+f*(w=(E=1/(1+T*y))*E)+d*(M=(_=1/(1+T*v))*_)-1)/(-2*(h*(b*x)*m+f*(w*E)*y+d*(M*_)*v))}while(Math.abs(I)>Ur.EPSILON12);return Nr(i)?(i.x=o*x,i.y=a*E,i.z=s*_,i):new Hr(o*x,a*E,s*_)}function ri(t,e,n){this.longitude=Pr(t,0),this.latitude=Pr(e,0),this.height=Pr(n,0)}ri.fromRadians=function(t,e,n,r){return Qr.typeOf.number("longitude",t),Qr.typeOf.number("latitude",e),n=Pr(n,0),Nr(r)?(r.longitude=t,r.latitude=e,r.height=n,r):new ri(t,e,n)},ri.fromDegrees=function(t,e,n,r){return Qr.typeOf.number("longitude",t),Qr.typeOf.number("latitude",e),t=Ur.toRadians(t),e=Ur.toRadians(e),ri.fromRadians(t,e,n,r)};var ii,oi,ai,si=new Hr,ci=new Hr,li=new Hr,ui=new Hr(1/6378137,1/6378137,1/6356752.314245179),hi=new Hr(1/6378137,1/6378137,1/6378137),fi=new Hr(1/40680631590769,1/40680631590769,1/40408299984661.445),di=new Hr(1/40680631590769,1/40680631590769,1/40680631590769),pi=Ur.EPSILON1;function Ai(t,e,n,r){return gi(t).then(e,n,r)}function gi(t){var e,n;return t instanceof mi?e=t:Ci(t)?(n=vi(),t.then((function(t){n.resolve(t)}),(function(t){n.reject(t)}),(function(t){n.progress(t)})),e=n.promise):e=function(t){var e=new mi((function(e){try{return gi(e?e(t):t)}catch(t){return yi(t)}}));return e}(t),e}function mi(t){this.then=t}function yi(t){var e=new mi((function(e,n){try{return n?gi(n(t)):yi(t)}catch(t){return yi(t)}}));return e}function vi(){var t,e,n,r,i,o;return t=new mi(a),e=[],n=[],r=function(t,r,i){var o,a;return o=vi(),a="function"==typeof i?function(t){try{o.progress(i(t))}catch(t){o.progress(t)}}:function(t){o.progress(t)},e.push((function(e){e.then(t,r).then(o.resolve,o.reject,a)})),n.push(a),o.promise},i=function(t){return _i(n,t),t},o=function(t){return t=gi(t),r=t.then,o=gi,i=wi,_i(e,t),n=e=ai,t},{then:a,resolve:s,reject:c,progress:l,promise:t,resolver:{resolve:s,reject:c,progress:l}};function a(t,e,n){return r(t,e,n)}function s(t){return o(t)}function c(t){return o(yi(t))}function l(t){return i(t)}}function Ci(t){return t&&"function"==typeof t.then}function Ii(t,e,n,r,i){return bi(2,arguments),Ai(t,(function(t){var o,a,s,c,l,u,h,f,d,p;if(d=t.length>>>0,o=Math.max(0,Math.min(e,d)),s=[],a=d-o+1,c=[],l=vi(),o)for(f=l.progress,h=function(t){c.push(t),--a||(u=h=wi,l.reject(c))},u=function(t){s.push(t),--o||(u=h=wi,l.resolve(s))},p=0;p<d;++p)p in t&&Ai(t[p],g,A,f);else l.resolve(s);return l.then(n,r,i);function A(t){h(t)}function g(t){u(t)}}))}function xi(t,e,n,r){return bi(1,arguments),Ei(t,Mi).then(e,n,r)}function Ei(t,e){return Ai(t,(function(t){var n,r,i,o,a,s;if(i=r=t.length>>>0,n=[],s=vi(),i)for(o=function(t,r){Ai(t,e).then((function(t){n[r]=t,--i||s.resolve(n)}),s.reject)},a=0;a<r;a++)a in t?o(t[a],a):--i;else s.resolve(n);return s.promise}))}function _i(t,e){for(var n,r=0;n=t[r++];)n(e)}function bi(t,e){for(var n,r=e.length;r>t;)if(null!=(n=e[--r])&&"function"!=typeof n)throw new Error("arg "+r+" must be a function")}function wi(){}function Mi(t){return t}function Ti(t,e){this.x=Pr(t,0),this.y=Pr(e,0)}ri.fromCartesian=function(t,e,n){var r=Nr(e)?e.oneOverRadii:hi,i=Nr(e)?e.oneOverRadiiSquared:di,o=Nr(e)?e._centerToleranceSquared:pi;Ur.equalsEpsilon(Ur.Radius,6356752.314245179,Ur.EPSILON10)&&(r=Nr(e)?e.oneOverRadii:ui,i=Nr(e)?e.oneOverRadiiSquared:fi);var a=ni(t,r,i,o,ci);if(Nr(a)){var s=Hr.multiplyComponents(a,i,si);s=Hr.normalize(s,s);var c=Hr.subtract(t,a,li),l=Math.atan2(s.y,s.x),u=Math.asin(s.z),h=Ur.sign(Hr.dot(c,t))*Hr.magnitude(c);return Nr(n)?(n.longitude=l,n.latitude=u,n.height=h,n):new ri(l,u,h)}},ri.toCartesian=function(t,e,n){return Qr.defined("cartographic",t),Hr.fromRadians(t.longitude,t.latitude,t.height,e,n)},ri.sphericalDistance=function(t,e,n,r){if(Qr.defined("longitudeA",t),Qr.defined("longitudeB",n),Qr.defined("latitudeA",e),Qr.defined("latitudeB",r),t===n&&e===r)return 0;var i=Ur.toRadians(e),o=Ur.toRadians(r),a=Ur.toRadians(t),s=Ur.toRadians(n),c=a*a+i*i,l=s*s+o*o,u=(c+l-((a-s)*(a-s)+(i-o)*(i-o)))/(2*Math.sqrt(c)*Math.sqrt(l));return u=Ur.clamp(u,-1,1),Math.acos(u)*Ur.Radius},ri.clone=function(t,e){if(Nr(t))return Nr(e)?(e.longitude=t.longitude,e.latitude=t.latitude,e.height=t.height,e):new ri(t.longitude,t.latitude,t.height)},ri.equals=function(t,e){return t===e||Nr(t)&&Nr(e)&&t.longitude===e.longitude&&t.latitude===e.latitude&&t.height===e.height},ri.equalsEpsilon=function(t,e,n){return Qr.typeOf.number("epsilon",n),t===e||Nr(t)&&Nr(e)&&Math.abs(t.longitude-e.longitude)<=n&&Math.abs(t.latitude-e.latitude)<=n&&Math.abs(t.height-e.height)<=n},ri.ZERO=Object.freeze(new ri(0,0,0)),ri.prototype.clone=function(t){return ri.clone(this,t)},ri.prototype.equals=function(t){return ri.equals(this,t)},ri.prototype.equalsEpsilon=function(t,e){return ri.equalsEpsilon(this,t,e)},ri.prototype.toString=function(){return"("+this.longitude+", "+this.latitude+", "+this.height+")"},Ai.defer=vi,Ai.resolve=gi,Ai.reject=function(t){return Ai(t,yi)},Ai.join=function(){return Ei(arguments,Mi)},Ai.all=xi,Ai.map=Ei,Ai.reduce=function(t,e){var n=oi.call(arguments,1);return Ai(t,(function(t){var r;return r=t.length,n[0]=function(t,n,i){return Ai(t,(function(t){return Ai(n,(function(n){return e(t,n,i,r)}))}))},ii.apply(t,n)}))},Ai.any=function(t,e,n,r){return Ii(t,1,(function(t){return e?e(t[0]):t[0]}),n,r)},Ai.some=Ii,Ai.allSettled=function(t,e,n,r){return bi(1,arguments),Ai(t,(function(t){var i,o,a,s,c,l,u,h,f;for(u=t.length>>>0,h=t.length>>>0,i=[],o=[],l=(a=vi()).progress,c=function(t){o.push(t),--h||(s=c=wi,a.resolve(i))},s=function(t,e){i[e]=t,--h||(s=c=wi,a.resolve(i))},f=0;f<u;++f)switch(f){case 0:Ai(t[f],A,d,l);break;case 1:Ai(t[f],g,d,l);break;case 2:Ai(t[f],m,d,l);break;case 3:Ai(t[f],y,d,l);break;case 4:Ai(t[f],v,d,l);break;default:Ai(t[f],p,d,l)}return a.then(e,n,r);function d(t){c(t)}function p(t){s(t,0)}function A(t){s(t,0)}function g(t){s(t,1)}function m(t){s(t,2)}function y(t){s(t,3)}function v(t){s(t,4)}}))},Ai.chain=function(t,e,n){var r=arguments.length>2;return Ai(t,(function(t){return t=r?n:t,e.resolve(t),t}),(function(t){return e.reject(t),yi(t)}),e.progress)},Ai.isPromise=Ci,mi.prototype={always:function(t,e){return this.then(t,t,e)},otherwise:function(t){return this.then(ai,t)},yield:function(t){return this.then((function(){return t}))},spread:function(t){return this.then((function(e){return xi(e,(function(e){return t.apply(ai,e)}))}))}},oi=[].slice,ii=[].reduce||function(t){var e,n,r,i,o;if(o=0,i=(e=Object(this)).length>>>0,(n=arguments).length<=1)for(;;){if(o in e){r=e[o++];break}if(++o>=i)throw new TypeError}else r=n[1];for(;o<i;++o)o in e&&(r=t(r,e[o],o,e));return r},Ti.fromElements=function(t,e,n){return Nr(n)?(n.x=t,n.y=e,n):new Ti(t,e)},Ti.clone=function(t,e){if(Nr(t))return Nr(e)?(e.x=t.x,e.y=t.y,e):new Ti(t.x,t.y)},Ti.fromCartesian3=Ti.clone,Ti.fromCartesian4=Ti.clone,Ti.packedLength=2,Ti.pack=function(t,e,n){return Qr.typeOf.object("value",t),Qr.defined("array",e),n=Pr(n,0),e[n++]=t.x,e[n]=t.y,e},Ti.unpack=function(t,e,n){return Qr.defined("array",t),e=Pr(e,0),Nr(n)||(n=new Ti),n.x=t[e++],n.y=t[e],n},Ti.packArray=function(t,e){Qr.defined("array",t);var n=t.length,r=2*n;if(Nr(e)){if(!Array.isArray(e)&&e.length!==r)throw new Lr("If result is a typed array, it must have exactly array.length * 2 elements");e.length!==r&&(e.length=r)}else e=new Array(r);for(var i=0;i<n;++i)Ti.pack(t[i],e,2*i);return e},Ti.unpackArray=function(t,e){if(Qr.defined("array",t),Qr.typeOf.number.greaterThanOrEquals("array.length",t.length,2),t.length%2!=0)throw new Lr("array length must be a multiple of 2.");var n=t.length;Nr(e)?e.length=n/2:e=new Array(n/2);for(var r=0;r<n;r+=2){var i=r/2;e[i]=Ti.unpack(t,r,e[i])}return e},Ti.fromArray=Ti.unpack,Ti.maximumComponent=function(t){return Qr.typeOf.object("cartesian",t),Math.max(t.x,t.y)},Ti.minimumComponent=function(t){return Qr.typeOf.object("cartesian",t),Math.min(t.x,t.y)},Ti.minimumByComponent=function(t,e,n){return Qr.typeOf.object("first",t),Qr.typeOf.object("second",e),Qr.typeOf.object("result",n),n.x=Math.min(t.x,e.x),n.y=Math.min(t.y,e.y),n},Ti.maximumByComponent=function(t,e,n){return Qr.typeOf.object("first",t),Qr.typeOf.object("second",e),Qr.typeOf.object("result",n),n.x=Math.max(t.x,e.x),n.y=Math.max(t.y,e.y),n},Ti.magnitudeSquared=function(t){return Qr.typeOf.object("cartesian",t),t.x*t.x+t.y*t.y},Ti.magnitude=function(t){return Math.sqrt(Ti.magnitudeSquared(t))};var Bi=new Ti;Ti.distance=function(t,e){return Qr.typeOf.object("left",t),Qr.typeOf.object("right",e),Ti.subtract(t,e,Bi),Ti.magnitude(Bi)},Ti.distanceSquared=function(t,e){return Qr.typeOf.object("left",t),Qr.typeOf.object("right",e),Ti.subtract(t,e,Bi),Ti.magnitudeSquared(Bi)},Ti.normalize=function(t,e){Qr.typeOf.object("cartesian",t),Qr.typeOf.object("result",e);var n=Ti.magnitude(t);if(e.x=t.x/n,e.y=t.y/n,isNaN(e.x)||isNaN(e.y))throw new Lr("normalized result is not a number");return e},Ti.dot=function(t,e){return Qr.typeOf.object("left",t),Qr.typeOf.object("right",e),t.x*e.x+t.y*e.y},Ti.multiplyComponents=function(t,e,n){return Qr.typeOf.object("left",t),Qr.typeOf.object("right",e),Qr.typeOf.object("result",n),n.x=t.x*e.x,n.y=t.y*e.y,n},Ti.divideComponents=function(t,e,n){return Qr.typeOf.object("left",t),Qr.typeOf.object("right",e),Qr.typeOf.object("result",n),n.x=t.x/e.x,n.y=t.y/e.y,n},Ti.add=function(t,e,n){return Qr.typeOf.object("left",t),Qr.typeOf.object("right",e),Qr.typeOf.object("result",n),n.x=t.x+e.x,n.y=t.y+e.y,n},Ti.subtract=function(t,e,n){return Qr.typeOf.object("left",t),Qr.typeOf.object("right",e),Qr.typeOf.object("result",n),n.x=t.x-e.x,n.y=t.y-e.y,n},Ti.multiplyByScalar=function(t,e,n){return Qr.typeOf.object("cartesian",t),Qr.typeOf.number("scalar",e),Qr.typeOf.object("result",n),n.x=t.x*e,n.y=t.y*e,n},Ti.divideByScalar=function(t,e,n){return Qr.typeOf.object("cartesian",t),Qr.typeOf.number("scalar",e),Qr.typeOf.object("result",n),n.x=t.x/e,n.y=t.y/e,n},Ti.negate=function(t,e){return Qr.typeOf.object("cartesian",t),Qr.typeOf.object("result",e),e.x=-t.x,e.y=-t.y,e},Ti.abs=function(t,e){return Qr.typeOf.object("cartesian",t),Qr.typeOf.object("result",e),e.x=Math.abs(t.x),e.y=Math.abs(t.y),e};var Si=new Ti;Ti.lerp=function(t,e,n,r){return Qr.typeOf.object("start",t),Qr.typeOf.object("end",e),Qr.typeOf.number("t",n),Qr.typeOf.object("result",r),Ti.multiplyByScalar(e,n,Si),r=Ti.multiplyByScalar(t,1-n,r),Ti.add(Si,r,r)};var Di=new Ti,Ri=new Ti;Ti.angleBetween=function(t,e){return Qr.typeOf.object("left",t),Qr.typeOf.object("right",e),Ti.normalize(t,Di),Ti.normalize(e,Ri),Ur.acosClamped(Ti.dot(Di,Ri))};var zi=new Ti;function Oi(t,e,n,r){this.x=Pr(t,0),this.y=Pr(e,0),this.z=Pr(n,0),this.w=Pr(r,0)}Ti.mostOrthogonalAxis=function(t,e){Qr.typeOf.object("cartesian",t),Qr.typeOf.object("result",e);var n=Ti.normalize(t,zi);return Ti.abs(n,n),e=n.x<=n.y?Ti.clone(Ti.UNIT_X,e):Ti.clone(Ti.UNIT_Y,e)},Ti.equals=function(t,e){return t===e||Nr(t)&&Nr(e)&&t.x===e.x&&t.y===e.y},Ti.equalsArray=function(t,e,n){return t.x===e[n]&&t.y===e[n+1]},Ti.equalsEpsilon=function(t,e,n,r){return t===e||Nr(t)&&Nr(e)&&Ur.equalsEpsilon(t.x,e.x,n,r)&&Ur.equalsEpsilon(t.y,e.y,n,r)},Ti.ZERO=Object.freeze(new Ti(0,0)),Ti.UNIT_X=Object.freeze(new Ti(1,0)),Ti.UNIT_Y=Object.freeze(new Ti(0,1)),Ti.prototype.clone=function(t){return Ti.clone(this,t)},Ti.prototype.equals=function(t){return Ti.equals(this,t)},Ti.prototype.equalsEpsilon=function(t,e,n){return Ti.equalsEpsilon(this,t,e,n)},Ti.prototype.toString=function(){return"("+this.x+", "+this.y+")"},Oi.fromElements=function(t,e,n,r,i){return Nr(i)?(i.x=t,i.y=e,i.z=n,i.w=r,i):new Oi(t,e,n,r)},Oi.fromColor=function(t,e){return Qr.typeOf.object("color",t),Nr(e)?(e.x=t.red,e.y=t.green,e.z=t.blue,e.w=t.alpha,e):new Oi(t.red,t.green,t.blue,t.alpha)},Oi.clone=function(t,e){if(Nr(t))return Nr(e)?(e.x=t.x,e.y=t.y,e.z=t.z,e.w=t.w,e):new Oi(t.x,t.y,t.z,t.w)},Oi.packedLength=4,Oi.pack=function(t,e,n){return Qr.typeOf.object("value",t),Qr.defined("array",e),n=Pr(n,0),e[n++]=t.x,e[n++]=t.y,e[n++]=t.z,e[n]=t.w,e},Oi.unpack=function(t,e,n){return Qr.defined("array",t),e=Pr(e,0),Nr(n)||(n=new Oi),n.x=t[e++],n.y=t[e++],n.z=t[e++],n.w=t[e],n},Oi.packArray=function(t,e){Qr.defined("array",t);var n=t.length,r=4*n;if(Nr(e)){if(!Array.isArray(e)&&e.length!==r)throw new Lr("If result is a typed array, it must have exactly array.length * 4 elements");e.length!==r&&(e.length=r)}else e=new Array(r);for(var i=0;i<n;++i)Oi.pack(t[i],e,4*i);return e},Oi.unpackArray=function(t,e){if(Qr.defined("array",t),Qr.typeOf.number.greaterThanOrEquals("array.length",t.length,4),t.length%4!=0)throw new Lr("array length must be a multiple of 4.");var n=t.length;Nr(e)?e.length=n/4:e=new Array(n/4);for(var r=0;r<n;r+=4){var i=r/4;e[i]=Oi.unpack(t,r,e[i])}return e},Oi.fromArray=Oi.unpack,Oi.maximumComponent=function(t){return Qr.typeOf.object("cartesian",t),Math.max(t.x,t.y,t.z,t.w)},Oi.minimumComponent=function(t){return Qr.typeOf.object("cartesian",t),Math.min(t.x,t.y,t.z,t.w)},Oi.minimumByComponent=function(t,e,n){return Qr.typeOf.object("first",t),Qr.typeOf.object("second",e),Qr.typeOf.object("result",n),n.x=Math.min(t.x,e.x),n.y=Math.min(t.y,e.y),n.z=Math.min(t.z,e.z),n.w=Math.min(t.w,e.w),n},Oi.maximumByComponent=function(t,e,n){return Qr.typeOf.object("first",t),Qr.typeOf.object("second",e),Qr.typeOf.object("result",n),n.x=Math.max(t.x,e.x),n.y=Math.max(t.y,e.y),n.z=Math.max(t.z,e.z),n.w=Math.max(t.w,e.w),n},Oi.magnitudeSquared=function(t){return Qr.typeOf.object("cartesian",t),t.x*t.x+t.y*t.y+t.z*t.z+t.w*t.w},Oi.magnitude=function(t){return Math.sqrt(Oi.magnitudeSquared(t))};var Ni=new Oi;Oi.distance=function(t,e){return Qr.typeOf.object("left",t),Qr.typeOf.object("right",e),Oi.subtract(t,e,Ni),Oi.magnitude(Ni)},Oi.distanceSquared=function(t,e){return Qr.typeOf.object("left",t),Qr.typeOf.object("right",e),Oi.subtract(t,e,Ni),Oi.magnitudeSquared(Ni)},Oi.normalize=function(t,e){Qr.typeOf.object("cartesian",t),Qr.typeOf.object("result",e);var n=Oi.magnitude(t);if(e.x=t.x/n,e.y=t.y/n,e.z=t.z/n,e.w=t.w/n,isNaN(e.x)||isNaN(e.y)||isNaN(e.z)||isNaN(e.w))throw new Lr("normalized result is not a number");return e},Oi.dot=function(t,e){return Qr.typeOf.object("left",t),Qr.typeOf.object("right",e),t.x*e.x+t.y*e.y+t.z*e.z+t.w*e.w},Oi.multiplyComponents=function(t,e,n){return Qr.typeOf.object("left",t),Qr.typeOf.object("right",e),Qr.typeOf.object("result",n),n.x=t.x*e.x,n.y=t.y*e.y,n.z=t.z*e.z,n.w=t.w*e.w,n},Oi.divideComponents=function(t,e,n){return Qr.typeOf.object("left",t),Qr.typeOf.object("right",e),Qr.typeOf.object("result",n),n.x=t.x/e.x,n.y=t.y/e.y,n.z=t.z/e.z,n.w=t.w/e.w,n},Oi.add=function(t,e,n){return Qr.typeOf.object("left",t),Qr.typeOf.object("right",e),Qr.typeOf.object("result",n),n.x=t.x+e.x,n.y=t.y+e.y,n.z=t.z+e.z,n.w=t.w+e.w,n},Oi.subtract=function(t,e,n){return Qr.typeOf.object("left",t),Qr.typeOf.object("right",e),Qr.typeOf.object("result",n),n.x=t.x-e.x,n.y=t.y-e.y,n.z=t.z-e.z,n.w=t.w-e.w,n},Oi.multiplyByScalar=function(t,e,n){return Qr.typeOf.object("cartesian",t),Qr.typeOf.number("scalar",e),Qr.typeOf.object("result",n),n.x=t.x*e,n.y=t.y*e,n.z=t.z*e,n.w=t.w*e,n},Oi.divideByScalar=function(t,e,n){return Qr.typeOf.object("cartesian",t),Qr.typeOf.number("scalar",e),Qr.typeOf.object("result",n),n.x=t.x/e,n.y=t.y/e,n.z=t.z/e,n.w=t.w/e,n},Oi.negate=function(t,e){return Qr.typeOf.object("cartesian",t),Qr.typeOf.object("result",e),e.x=-t.x,e.y=-t.y,e.z=-t.z,e.w=-t.w,e},Oi.abs=function(t,e){return Qr.typeOf.object("cartesian",t),Qr.typeOf.object("result",e),e.x=Math.abs(t.x),e.y=Math.abs(t.y),e.z=Math.abs(t.z),e.w=Math.abs(t.w),e};var Li=new Oi;Oi.lerp=function(t,e,n,r){return Qr.typeOf.object("start",t),Qr.typeOf.object("end",e),Qr.typeOf.number("t",n),Qr.typeOf.object("result",r),Oi.multiplyByScalar(e,n,Li),r=Oi.multiplyByScalar(t,1-n,r),Oi.add(Li,r,r)};var Qi=new Oi;Oi.mostOrthogonalAxis=function(t,e){Qr.typeOf.object("cartesian",t),Qr.typeOf.object("result",e);var n=Oi.normalize(t,Qi);return Oi.abs(n,n),e=n.x<=n.y?n.x<=n.z?n.x<=n.w?Oi.clone(Oi.UNIT_X,e):Oi.clone(Oi.UNIT_W,e):n.z<=n.w?Oi.clone(Oi.UNIT_Z,e):Oi.clone(Oi.UNIT_W,e):n.y<=n.z?n.y<=n.w?Oi.clone(Oi.UNIT_Y,e):Oi.clone(Oi.UNIT_W,e):n.z<=n.w?Oi.clone(Oi.UNIT_Z,e):Oi.clone(Oi.UNIT_W,e)},Oi.equals=function(t,e){return t===e||Nr(t)&&Nr(e)&&t.x===e.x&&t.y===e.y&&t.z===e.z&&t.w===e.w},Oi.equalsArray=function(t,e,n){return t.x===e[n]&&t.y===e[n+1]&&t.z===e[n+2]&&t.w===e[n+3]},Oi.equalsEpsilon=function(t,e,n,r){return t===e||Nr(t)&&Nr(e)&&Ur.equalsEpsilon(t.x,e.x,n,r)&&Ur.equalsEpsilon(t.y,e.y,n,r)&&Ur.equalsEpsilon(t.z,e.z,n,r)&&Ur.equalsEpsilon(t.w,e.w,n,r)},Oi.ZERO=Object.freeze(new Oi(0,0,0,0)),Oi.UNIT_X=Object.freeze(new Oi(1,0,0,0)),Oi.UNIT_Y=Object.freeze(new Oi(0,1,0,0)),Oi.UNIT_Z=Object.freeze(new Oi(0,0,1,0)),Oi.UNIT_W=Object.freeze(new Oi(0,0,0,1)),Oi.prototype.clone=function(t){return Oi.clone(this,t)},Oi.prototype.equals=function(t){return Oi.equals(this,t)},Oi.prototype.equalsEpsilon=function(t,e,n){return Oi.equalsEpsilon(this,t,e,n)},Oi.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"};var Fi=new Float32Array(1),Pi=256,ki=1/65536,Ui=1/16777216;function ji(t,e,n){Qr.defined("array",t),Qr.defined("itemToFind",e),Qr.defined("comparator",n);for(var r,i,o=0,a=t.length-1;o<=a;)if((i=n(t[r=~~((o+a)/2)],e))<0)o=r+1;else{if(!(i>0))return r;a=r-1}return~(a+1)}function Gi(t,e,n,r,i){this.xPoleWander=t,this.yPoleWander=e,this.xPoleOffset=n,this.yPoleOffset=r,this.ut1MinusUtc=i}function Hi(){var t=arguments,e=0,n=t[e++],r=function(t,e,n,r){n||(n=" ");var i=t.length>=e?"":Array(1+e-t.length>>>0).join(n);return r?t+i:i+t},i=function(t,e,n,i,o,a){var s=i-t.length;return s>0&&(t=n||!o?r(t,i,a,n):t.slice(0,e.length)+r("",s,"0",!0)+t.slice(e.length)),t},o=function(t,e,n,o,a,s,c){var l=t>>>0;return t=(n=n&&l&&{2:"0b",8:"0",16:"0x"}[e]||"")+r(l.toString(e),s||0,"0",!1),i(t,n,o,a,c)},a=function(t,e,n,r,o,a){return null!=r&&(t=t.slice(0,r)),i(t,"",e,n,o,a)};return n.replace(/%%|%(\d+\$)?([-+\'#0 ]*)(\*\d+\$|\*|\d+)?(\.(\*\d+\$|\*|\d+))?([scboxXuideEfFgG])/g,(function(n,s,c,l,u,h,f){var d,p,A,g,m;if("%%"==n)return"%";for(var y=!1,v="",C=!1,I=!1,x=" ",E=c.length,_=0;c&&_<E;_++)switch(c.charAt(_)){case" ":v=" ";break;case"+":v="+";break;case"-":y=!0;break;case"'":x=c.charAt(_+1);break;case"0":C=!0;break;case"#":I=!0}if((l=l?"*"==l?+t[e++]:"*"==l.charAt(0)?+t[l.slice(1,-1)]:+l:0)<0&&(l=-l,y=!0),!isFinite(l))throw new Error("sprintf: (minimum-)width must be finite");switch(h=h?"*"==h?+t[e++]:"*"==h.charAt(0)?+t[h.slice(1,-1)]:+h:"fFeE".indexOf(f)>-1?6:"d"==f?0:void 0,m=s?t[s.slice(0,-1)]:t[e++],f){case"s":return a(String(m),y,l,h,C,x);case"c":return a(String.fromCharCode(+m),y,l,h,C);case"b":return o(m,2,I,y,l,h,C);case"o":return o(m,8,I,y,l,h,C);case"x":return o(m,16,I,y,l,h,C);case"X":return o(m,16,I,y,l,h,C).toUpperCase();case"u":return o(m,10,I,y,l,h,C);case"i":case"d":return d=+m||0,m=(p=(d=Math.round(d-d%1))<0?"-":v)+r(String(Math.abs(d)),h,"0",!1),i(m,p,y,l,C);case"e":case"E":case"f":case"F":case"g":case"G":return p=(d=+m)<0?"-":v,A=["toExponential","toFixed","toPrecision"]["efg".indexOf(f.toLowerCase())],g=["toString","toUpperCase"]["eEfFgG".indexOf(f)%2],m=p+Math.abs(d)[A](h),i(m,p,y,l,C)[g]();default:return n}}))}function qi(t,e,n,r,i,o,a,s){this.year=t,this.month=e,this.day=n,this.hour=r,this.minute=i,this.second=o,this.millisecond=a,this.isLeapSecond=s}function Vi(t){if(null===t||isNaN(t))throw new Lr("year is required and must be a number.");return t%4==0&&t%100!=0||t%400==0}function Yi(t,e){this.julianDate=t,this.offset=e}Oi.packFloat=function(t,e){if(Qr.typeOf.number("value",t),Nr(e)||(e=new Oi),Fi[0]=t,0===(t=Fi[0]))return Oi.clone(Oi.ZERO,e);var n,r=t<0?1:0;isFinite(t)?(t=Math.abs(t),n=Math.floor(Ur.logBase(t,10))+1,t/=Math.pow(10,n)):(t=.1,n=38);var i=t*Pi;return e.x=Math.floor(i),i=(i-e.x)*Pi,e.y=Math.floor(i),i=(i-e.y)*Pi,e.z=Math.floor(i),e.w=2*(n+38)+r,e},Oi.unpackFloat=function(t){Qr.typeOf.object("packedFloat",t);var e=t.w/2,n=Math.floor(e),r=2*(e-n);if(r=-(r=2*r-1),(n-=38)>=38)return r<0?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY;var i=r*t.x*.00390625;return i+=r*t.y*ki,(i+=r*t.z*Ui)*Math.pow(10,n)};var Ki=Object.freeze({SECONDS_PER_MILLISECOND:.001,SECONDS_PER_MINUTE:60,MINUTES_PER_HOUR:60,HOURS_PER_DAY:24,SECONDS_PER_HOUR:3600,MINUTES_PER_DAY:1440,SECONDS_PER_DAY:86400,DAYS_PER_JULIAN_CENTURY:36525,PICOSECOND:1e-9,MODIFIED_JULIAN_DATE_DIFFERENCE:2400000.5}),Wi=Object.freeze({UTC:0,TAI:1}),Xi=new qi,Ji=[31,28,31,30,31,30,31,31,30,31,30,31];function Zi(t,e){return Ao.compare(t.julianDate,e.julianDate)}var $i=new Yi;function to(t){$i.julianDate=t;var e=Ao.leapSeconds,n=ji(e,$i,Zi);n<0&&(n=~n),n>=e.length&&(n=e.length-1);var r=e[n].offset;n>0&&(Ao.secondsDifference(e[n].julianDate,t)>r&&(r=e[--n].offset));Ao.addSeconds(t,r,t)}function eo(t,e){$i.julianDate=t;var n=Ao.leapSeconds,r=ji(n,$i,Zi);if(r<0&&(r=~r),0===r)return Ao.addSeconds(t,-n[0].offset,e);if(r>=n.length)return Ao.addSeconds(t,-n[r-1].offset,e);var i=Ao.secondsDifference(n[r].julianDate,t);return 0===i?Ao.addSeconds(t,-n[r].offset,e):i<=1?void 0:Ao.addSeconds(t,-n[--r].offset,e)}function no(t,e,n){var r=e/Ki.SECONDS_PER_DAY|0;return t+=r,(e-=Ki.SECONDS_PER_DAY*r)<0&&(t--,e+=Ki.SECONDS_PER_DAY),n.dayNumber=t,n.secondsOfDay=e,n}function ro(t,e,n,r,i,o,a){var s=(e-14)/12|0,c=t+4800+s,l=(1461*c/4|0)+(367*(e-2-12*s)/12|0)-(3*((c+100)/100|0)/4|0)+n-32075;(r-=12)<0&&(r+=24);var u=o+(r*Ki.SECONDS_PER_HOUR+i*Ki.SECONDS_PER_MINUTE+a*Ki.SECONDS_PER_MILLISECOND);return u>=43200&&(l-=1),[l,u]}var io=/^(\d{4})$/,oo=/^(\d{4})-(\d{2})$/,ao=/^(\d{4})-?(\d{3})$/,so=/^(\d{4})-?W(\d{2})-?(\d{1})?$/,co=/^(\d{4})-?(\d{2})-?(\d{2})$/,lo=/([Z+\-])?(\d{2})?:?(\d{2})?$/,uo=/^(\d{2})(\.\d+)?/.source+lo.source,ho=/^(\d{2}):?(\d{2})(\.\d+)?/.source+lo.source,fo=/^(\d{2}):?(\d{2}):?(\d{2})(\.\d+)?/.source+lo.source,po="Invalid ISO 8601 date.";function Ao(t,e,n){this.dayNumber=void 0,this.secondsOfDay=void 0,t=Pr(t,0),e=Pr(e,0),n=Pr(n,Wi.UTC);var r=0|t;no(r,e+=(t-r)*Ki.SECONDS_PER_DAY,this),n===Wi.UTC&&to(this)}Ao.fromGregorianDate=function(t,e){if(!(t instanceof qi))throw new Lr("date must be a valid GregorianDate.");var n=ro(t.year,t.month,t.day,t.hour,t.minute,t.second,t.millisecond);return Nr(e)?(no(n[0],n[1],e),to(e),e):new Ao(n[0],n[1],Wi.UTC)},Ao.fromDate=function(t,e){if(!(t instanceof Date)||isNaN(t.getTime()))throw new Lr("date must be a valid JavaScript Date.");var n=ro(t.getUTCFullYear(),t.getUTCMonth()+1,t.getUTCDate(),t.getUTCHours(),t.getUTCMinutes(),t.getUTCSeconds(),t.getUTCMilliseconds());return Nr(e)?(no(n[0],n[1],e),to(e),e):new Ao(n[0],n[1],Wi.UTC)},Ao.fromIso8601=function(t,e){if("string"!=typeof t)throw new Lr(po);var n,r,i,o,a,s=(t=t.replace(",",".")).split("T"),c=1,l=1,u=0,h=0,f=0,d=0,p=s[0],A=s[1];if(!Nr(p))throw new Lr(po);if(null!==(s=p.match(co))){if((o=p.split("-").length-1)>0&&2!==o)throw new Lr(po);n=+s[1],c=+s[2],l=+s[3]}else if(null!==(s=p.match(oo)))n=+s[1],c=+s[2];else if(null!==(s=p.match(io)))n=+s[1];else{var g;if(null!==(s=p.match(ao))){if(n=+s[1],g=+s[2],i=Vi(n),g<1||i&&g>366||!i&&g>365)throw new Lr(po)}else{if(null===(s=p.match(so)))throw new Lr(po);n=+s[1];var m=+s[2],y=+s[3]||0;if((o=p.split("-").length-1)>0&&(!Nr(s[3])&&1!==o||Nr(s[3])&&2!==o))throw new Lr(po);g=7*m+y-new Date(Date.UTC(n,0,4)).getUTCDay()-3}(r=new Date(Date.UTC(n,0,1))).setUTCDate(g),c=r.getUTCMonth()+1,l=r.getUTCDate()}if(i=Vi(n),c<1||c>12||l<1||(2!==c||!i)&&l>Ji[c-1]||i&&2===c&&l>29)throw new Lr(po);if(Nr(A)){if(null!==(s=A.match(fo))){if((o=A.split(":").length-1)>0&&2!==o&&3!==o)throw new Lr(po);u=+s[1],h=+s[2],f=+s[3],d=1e3*+(s[4]||0),a=5}else if(null!==(s=A.match(ho))){if((o=A.split(":").length-1)>2)throw new Lr(po);u=+s[1],h=+s[2],f=60*+(s[3]||0),a=4}else{if(null===(s=A.match(uo)))throw new Lr(po);u=+s[1],h=60*+(s[2]||0),a=3}if(h>=60||f>=61||u>24||24===u&&(h>0||f>0||d>0))throw new Lr(po);var v=s[a],C=+s[a+1],I=+(s[a+2]||0);switch(v){case"+":u-=C,h-=I;break;case"-":u+=C,h+=I;break;case"Z":break;default:h+=new Date(Date.UTC(n,c-1,l,u,h)).getTimezoneOffset()}}var x=60===f;for(x&&f--;h>=60;)h-=60,u++;for(;u>=24;)u-=24,l++;for(r=i&&2===c?29:Ji[c-1];l>r;)l-=r,++c>12&&(c-=12,n++),r=i&&2===c?29:Ji[c-1];for(;h<0;)h+=60,u--;for(;u<0;)u+=24,l--;for(;l<1;)--c<1&&(c+=12,n--),l+=r=i&&2===c?29:Ji[c-1];var E=ro(n,c,l,u,h,f,d);return Nr(e)?(no(E[0],E[1],e),to(e)):e=new Ao(E[0],E[1],Wi.UTC),x&&Ao.addSeconds(e,1,e),e},Ao.now=function(t){return Ao.fromDate(new Date,t)};var go=new Ao(0,0,Wi.TAI);function mo(t){if(t instanceof mo)this.scheme=t.scheme,this.authority=t.authority,this.path=t.path,this.query=t.query,this.fragment=t.fragment;else if(t){var e=yo.exec(t);this.scheme=e[1],this.authority=e[2],this.path=e[3],this.query=e[4],this.fragment=e[5]}}Ao.toGregorianDate=function(t,e){if(!Nr(t))throw new Lr("julianDate is required.");var n=!1,r=eo(t,go);Nr(r)||(Ao.addSeconds(t,-1,go),r=eo(go,go),n=!0);var i=r.dayNumber,o=r.secondsOfDay;o>=43200&&(i+=1);var a=i+68569|0,s=4*a/146097|0,c=4e3*((a=a-((146097*s+3)/4|0)|0)+1)/1461001|0,l=80*(a=a-(1461*c/4|0)+31|0)/2447|0,u=a-(2447*l/80|0)|0,h=l+2-12*(a=l/11|0)|0,f=100*(s-49)+c+a|0,d=o/Ki.SECONDS_PER_HOUR|0,p=o-d*Ki.SECONDS_PER_HOUR,A=p/Ki.SECONDS_PER_MINUTE|0,g=0|(p-=A*Ki.SECONDS_PER_MINUTE),m=(p-g)/Ki.SECONDS_PER_MILLISECOND;return(d+=12)>23&&(d-=24),n&&(g+=1),Nr(e)?(e.year=f,e.month=h,e.day=u,e.hour=d,e.minute=A,e.second=g,e.millisecond=m,e.isLeapSecond=n,e):new qi(f,h,u,d,A,g,m,n)},Ao.toDate=function(t){if(!Nr(t))throw new Lr("julianDate is required.");var e=Ao.toGregorianDate(t,Xi),n=e.second;return e.isLeapSecond&&(n-=1),new Date(Date.UTC(e.year,e.month-1,e.day,e.hour,e.minute,n,e.millisecond))},Ao.toIso8601=function(t,e){if(!Nr(t))throw new Lr("julianDate is required.");var n=Ao.toGregorianDate(t,Xi),r=n.year,i=n.month,o=n.day,a=n.hour,s=n.minute,c=n.second,l=n.millisecond;return 1e4===r&&1===i&&1===o&&0===a&&0===s&&0===c&&0===l&&(r=9999,i=12,o=31,a=24),Nr(e)||0===l?Nr(e)&&0!==e?Hi("%04d-%02d-%02dT%02d:%02d:%02d.%sZ",r,i,o,a,s,c,(.01*l).toFixed(e).replace(".","").slice(0,e)):Hi("%04d-%02d-%02dT%02d:%02d:%02dZ",r,i,o,a,s,c):Hi("%04d-%02d-%02dT%02d:%02d:%02d.%sZ",r,i,o,a,s,c,(.01*l).toString().replace(".",""))},Ao.clone=function(t,e){if(Nr(t))return Nr(e)?(e.dayNumber=t.dayNumber,e.secondsOfDay=t.secondsOfDay,e):new Ao(t.dayNumber,t.secondsOfDay,Wi.TAI)},Ao.compare=function(t,e){if(!Nr(t))throw new Lr("left is required.");if(!Nr(e))throw new Lr("right is required.");var n=t.dayNumber-e.dayNumber;return 0!==n?n:t.secondsOfDay-e.secondsOfDay},Ao.equals=function(t,e){return t===e||Nr(t)&&Nr(e)&&t.dayNumber===e.dayNumber&&t.secondsOfDay===e.secondsOfDay},Ao.equalsEpsilon=function(t,e,n){if(!Nr(n))throw new Lr("epsilon is required.");return t===e||Nr(t)&&Nr(e)&&Math.abs(Ao.secondsDifference(t,e))<=n},Ao.totalDays=function(t){if(!Nr(t))throw new Lr("julianDate is required.");return t.dayNumber+t.secondsOfDay/Ki.SECONDS_PER_DAY},Ao.secondsDifference=function(t,e){if(!Nr(t))throw new Lr("left is required.");if(!Nr(e))throw new Lr("right is required.");return(t.dayNumber-e.dayNumber)*Ki.SECONDS_PER_DAY+(t.secondsOfDay-e.secondsOfDay)},Ao.daysDifference=function(t,e){if(!Nr(t))throw new Lr("left is required.");if(!Nr(e))throw new Lr("right is required.");return t.dayNumber-e.dayNumber+(t.secondsOfDay-e.secondsOfDay)/Ki.SECONDS_PER_DAY},Ao.computeTaiMinusUtc=function(t){$i.julianDate=t;var e=Ao.leapSeconds,n=ji(e,$i,Zi);return n<0&&(n=~n,--n<0&&(n=0)),e[n].offset},Ao.addSeconds=function(t,e,n){if(!Nr(t))throw new Lr("julianDate is required.");if(!Nr(e))throw new Lr("seconds is required.");if(!Nr(n))throw new Lr("result is required.");return no(t.dayNumber,t.secondsOfDay+e,n)},Ao.addMinutes=function(t,e,n){if(!Nr(t))throw new Lr("julianDate is required.");if(!Nr(e))throw new Lr("minutes is required.");if(!Nr(n))throw new Lr("result is required.");var r=t.secondsOfDay+e*Ki.SECONDS_PER_MINUTE;return no(t.dayNumber,r,n)},Ao.addHours=function(t,e,n){if(!Nr(t))throw new Lr("julianDate is required.");if(!Nr(e))throw new Lr("hours is required.");if(!Nr(n))throw new Lr("result is required.");var r=t.secondsOfDay+e*Ki.SECONDS_PER_HOUR;return no(t.dayNumber,r,n)},Ao.addDays=function(t,e,n){if(!Nr(t))throw new Lr("julianDate is required.");if(!Nr(e))throw new Lr("days is required.");if(!Nr(n))throw new Lr("result is required.");return no(t.dayNumber+e,t.secondsOfDay,n)},Ao.lessThan=function(t,e){return Ao.compare(t,e)<0},Ao.lessThanOrEquals=function(t,e){return Ao.compare(t,e)<=0},Ao.greaterThan=function(t,e){return Ao.compare(t,e)>0},Ao.greaterThanOrEquals=function(t,e){return Ao.compare(t,e)>=0},Ao.prototype.clone=function(t){return Ao.clone(this,t)},Ao.prototype.equals=function(t){return Ao.equals(this,t)},Ao.prototype.equalsEpsilon=function(t,e){return Ao.equalsEpsilon(this,t,e)},Ao.prototype.toString=function(){return Ao.toIso8601(this)},Ao.leapSeconds=[new Yi(new Ao(2441317,43210,Wi.TAI),10),new Yi(new Ao(2441499,43211,Wi.TAI),11),new Yi(new Ao(2441683,43212,Wi.TAI),12),new Yi(new Ao(2442048,43213,Wi.TAI),13),new Yi(new Ao(2442413,43214,Wi.TAI),14),new Yi(new Ao(2442778,43215,Wi.TAI),15),new Yi(new Ao(2443144,43216,Wi.TAI),16),new Yi(new Ao(2443509,43217,Wi.TAI),17),new Yi(new Ao(2443874,43218,Wi.TAI),18),new Yi(new Ao(2444239,43219,Wi.TAI),19),new Yi(new Ao(2444786,43220,Wi.TAI),20),new Yi(new Ao(2445151,43221,Wi.TAI),21),new Yi(new Ao(2445516,43222,Wi.TAI),22),new Yi(new Ao(2446247,43223,Wi.TAI),23),new Yi(new Ao(2447161,43224,Wi.TAI),24),new Yi(new Ao(2447892,43225,Wi.TAI),25),new Yi(new Ao(2448257,43226,Wi.TAI),26),new Yi(new Ao(2448804,43227,Wi.TAI),27),new Yi(new Ao(2449169,43228,Wi.TAI),28),new Yi(new Ao(2449534,43229,Wi.TAI),29),new Yi(new Ao(2450083,43230,Wi.TAI),30),new Yi(new Ao(2450630,43231,Wi.TAI),31),new Yi(new Ao(2451179,43232,Wi.TAI),32),new Yi(new Ao(2453736,43233,Wi.TAI),33),new Yi(new Ao(2454832,43234,Wi.TAI),34),new Yi(new Ao(2456109,43235,Wi.TAI),35),new Yi(new Ao(2457204,43236,Wi.TAI),36),new Yi(new Ao(2457754,43237,Wi.TAI),37)],mo.prototype.scheme=null,mo.prototype.authority=null,mo.prototype.path="",mo.prototype.query=null,mo.prototype.fragment=null;var yo=new RegExp("^(?:([^:/?#]+):)?(?://([^/?#]*))?([^?#]*)(?:\\?([^#]*))?(?:#(.*))?$");mo.prototype.getScheme=function(){return this.scheme},mo.prototype.getAuthority=function(){return this.authority},mo.prototype.getPath=function(){return this.path},mo.prototype.getQuery=function(){return this.query},mo.prototype.getFragment=function(){return this.fragment},mo.prototype.isAbsolute=function(){return!!this.scheme&&!this.fragment},mo.prototype.isSameDocumentAs=function(t){return t.scheme==this.scheme&&t.authority==this.authority&&t.path==this.path&&t.query==this.query},mo.prototype.equals=function(t){return this.isSameDocumentAs(t)&&t.fragment==this.fragment},mo.prototype.normalize=function(){this.removeDotSegments(),this.scheme&&(this.scheme=this.scheme.toLowerCase()),this.authority&&(this.authority=this.authority.replace(Io,Eo).replace(vo,xo)),this.path&&(this.path=this.path.replace(vo,xo)),this.query&&(this.query=this.query.replace(vo,xo)),this.fragment&&(this.fragment=this.fragment.replace(vo,xo))};var vo=/%[0-9a-z]{2}/gi,Co=/[a-zA-Z0-9\-\._~]/,Io=/(.*@)?([^@:]*)(:.*)?/;function xo(t){var e=unescape(t);return Co.test(e)?e:t.toUpperCase()}function Eo(t,e,n,r){return(e||"")+n.toLowerCase()+(r||"")}function _o(t,e){if(null===t||"object"!=typeof t)return t;e=Pr(e,!1);var n=new t.constructor;for(var r in t)if(t.hasOwnProperty(r)){var i=t[r];e&&(i=_o(i,e)),n[r]=i}return n}function bo(t,e,n){n=Pr(n,!1);var r,i,o,a={},s=Nr(t),c=Nr(e);if(s)for(r in t)t.hasOwnProperty(r)&&(i=t[r],c&&n&&"object"==typeof i&&e.hasOwnProperty(r)?(o=e[r],a[r]="object"==typeof o?bo(i,o,n):i):a[r]=i);if(c)for(r in e)e.hasOwnProperty(r)&&!a.hasOwnProperty(r)&&(o=e[r],a[r]=o);return a}function wo(t,e){var n;return"undefined"!=typeof document&&(n=document),wo._implementation(t,e,n)}mo.prototype.resolve=function(t){var e=new mo;return this.scheme?(e.scheme=this.scheme,e.authority=this.authority,e.path=this.path,e.query=this.query):(e.scheme=t.scheme,this.authority?(e.authority=this.authority,e.path=this.path,e.query=this.query):(e.authority=t.authority,""==this.path?(e.path=t.path,e.query=this.query||t.query):("/"==this.path.charAt(0)?(e.path=this.path,e.removeDotSegments()):(t.authority&&""==t.path?e.path="/"+this.path:e.path=t.path.substring(0,t.path.lastIndexOf("/")+1)+this.path,e.removeDotSegments()),e.query=this.query))),e.fragment=this.fragment,e},mo.prototype.removeDotSegments=function(){var t,e=this.path.split("/"),n=[],r=""==e[0];for(r&&e.shift(),""==e[0]&&e.shift();e.length;)".."==(t=e.shift())?n.pop():"."!=t&&n.push(t);"."!=t&&".."!=t||n.push(""),r&&n.unshift(""),this.path=n.join("/")},mo.prototype.toString=function(){var t="";return this.scheme&&(t+=this.scheme+":"),this.authority&&(t+="//"+this.authority),t+=this.path,this.query&&(t+="?"+this.query),this.fragment&&(t+="#"+this.fragment),t},wo._implementation=function(t,e,n){if(!Nr(t))throw new Lr("relative uri is required.");if(!Nr(e)){if(void 0===n)return t;e=Pr(n.baseURI,n.location.href)}var r=new mo(e);return new mo(t).resolve(r).toString()};var Mo,To=/^blob:/i;function Bo(t){return Qr.typeOf.string("uri",t),To.test(t)}var So=/^data:/i;function Do(t){return Qr.typeOf.string("uri",t),So.test(t)}function Ro(t,e){if(!Nr(t))throw new Lr("obj is required.");var n="";for(var r in t)if(t.hasOwnProperty(r)){var i=t[r],o=encodeURIComponent(r)+"=";if(Array.isArray(i))for(var a=0,s=i.length;a<s;++a)n+=!0===e?o+encodeURI(i[a])+"&":o+encodeURIComponent(i[a])+"&";else n+=!0===e?o+encodeURI(i)+"&":o+encodeURIComponent(i)+"&"}return n=n.slice(0,-1)}var zo=Object.freeze({UNISSUED:0,ISSUED:1,ACTIVE:2,RECEIVED:3,CANCELLED:4,FAILED:5}),Oo=Object.freeze({TERRAIN:0,IMAGERY:1,TILES3D:2,OTHER:3,PACK:4,BLOCK:5,BLOCKPACK:6});function No(t){t=Pr(t,Pr.EMPTY_OBJECT);var e=Pr(t.throttleByServer,!1),n=Pr(t.throttle,!1);this.url=t.url,this.requestFunction=t.requestFunction,this.cancelFunction=t.cancelFunction,this.priorityFunction=t.priorityFunction,this.priority=Pr(t.priority,0),this.throttle=n,this.throttleByServer=e,this.type=Pr(t.type,Oo.OTHER),this.serverKey=void 0,this.state=zo.UNISSUED,this.deferred=void 0,this.cancelled=!1}function Lo(t,e,n){this.statusCode=t,this.response=e,this.responseHeaders=n,"string"==typeof this.responseHeaders&&(this.responseHeaders=function(t){var e={};if(!t)return e;for(var n=t.split("\r\n"),r=0;r<n.length;++r){var i=n[r],o=i.indexOf(": ");if(o>0){var a=i.substring(0,o),s=i.substring(o+2);e[a]=s}}return e}(this.responseHeaders))}function Qo(){this._listeners=[],this._scopes=[],this._toRemove=[],this._insideRaiseEvent=!1}function Fo(t,e){return e-t}function Po(t){Qr.typeOf.object("options",t),Qr.defined("options.comparator",t.comparator),this._comparator=t.comparator,this._array=[],this._length=0,this._maximumLength=void 0}function ko(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}No.prototype.cancel=function(){this.cancelled=!0},No.prototype.clone=function(t){return Nr(t)?(t.url=this.url,t.requestFunction=this.requestFunction,t.cancelFunction=this.cancelFunction,t.priorityFunction=this.priorityFunction,t.priority=this.priority,t.throttle=this.throttle,t.throttleByServer=this.throttleByServer,t.type=this.type,t.serverKey=this.serverKey,t.state=this.RequestState.UNISSUED,t.deferred=void 0,t.cancelled=!1,t):new No(this)},Lo.prototype.toString=function(){var t="Request has failed.";return Nr(this.statusCode)&&(t+=" Status Code: "+this.statusCode),t},Object.defineProperties(Qo.prototype,{numberOfListeners:{get:function(){return this._listeners.length-this._toRemove.length}}}),Qo.prototype.addEventListener=function(t,e){Qr.typeOf.func("listener",t),this._listeners.push(t),this._scopes.push(e);var n=this;return function(){n.removeEventListener(t,e)}},Qo.prototype.removeEventListener=function(t,e){Qr.typeOf.func("listener",t);for(var n=this._listeners,r=this._scopes,i=-1,o=0;o<n.length;o++)if(n[o]===t&&r[o]===e){i=o;break}return-1!==i&&(this._insideRaiseEvent?(this._toRemove.push(i),n[i]=void 0,r[i]=void 0):(n.splice(i,1),r.splice(i,1)),!0)},Qo.prototype.raiseEvent=function(){var t;this._insideRaiseEvent=!0;var e=this._listeners,n=this._scopes,r=e.length;for(t=0;t<r;t++){Nr(e[t])&&e[t].apply(n[t],arguments)}var i=this._toRemove;if((r=i.length)>0){for(i.sort(Fo),t=0;t<r;t++){var o=i[t];e.splice(o,1),n.splice(o,1)}i.length=0}this._insideRaiseEvent=!1},Object.defineProperties(Po.prototype,{length:{get:function(){return this._length}},internalArray:{get:function(){return this._array}},maximumLength:{get:function(){return this._maximumLength},set:function(t){this._maximumLength=t,this._length>t&&t>0&&(this._length=t,this._array.length=t)}},comparator:{get:function(){return this._comparator}}}),Po.prototype.reserve=function(t){t=Pr(t,this._length),this._array.length=t},Po.prototype.heapify=function(t){t=Pr(t,0);for(var e=this._length,n=this._comparator,r=this._array,i=-1,o=!0;o;){var a=2*(t+1),s=a-1;i=s<e&&n(r[s],r[t])<0?s:t,a<e&&n(r[a],r[i])<0&&(i=a),i!==t?(ko(r,i,t),t=i):o=!1}},Po.prototype.resort=function(){for(var t=this._length,e=Math.ceil(t/2);e>=0;--e)this.heapify(e)},Po.prototype.insert=function(t){Qr.defined("element",t);var e,n=this._array,r=this._comparator,i=this._maximumLength,o=this._length++;for(o<n.length?n[o]=t:n.push(t);0!==o;){var a=Math.floor((o-1)/2);if(!(r(n[o],n[a])<0))break;ko(n,o,a),o=a}return Nr(i)&&this._length>i&&(e=n[i],n.pop(),this._length=i),e},Po.prototype.pop=function(t){if(t=Pr(t,0),0!==this._length){Qr.typeOf.number.lessThan("index",t,this._length);var e=this._array,n=e[t];return ko(e,t,--this._length),e[this._length]=void 0,this.heapify(t),n}};var Uo="undefined"!=typeof performance&&"function"==typeof performance.now&&isFinite(performance.now())?function(){return performance.now()}:function(){return Date.now()};function jo(t,e){return t.priority-e.priority}var Go={numberOfAttemptedRequests:0,numberOfActiveRequests:0,numberOfCancelledRequests:0,numberOfCancelledActiveRequests:0,numberOfFailedRequests:0,numberOfActiveRequestsEver:0,lastNumberOfActiveRequests:0,totalRequestTime:0},Ho=20,qo=new Po({comparator:jo});qo.maximumLength=Ho,qo.reserve(Ho);var Vo=[],Yo={},Ko="undefined"!=typeof document?new mo(document.location.href):new mo,Wo=new Qo;function Xo(){}function Jo(t){Nr(t.priorityFunction)&&(t.priority=t.priorityFunction())}function Zo(t){var e=Pr(Xo.requestsByServer[t],Xo.maximumRequestsPerServer);return Yo[t]<e}function $o(t){return Nr(t.packKey)||(t.packKey=t.serverKey+"_"+t.providerName),t.packKey}function ta(t){return Nr(t.blockKey)||(t.blockKey=t.serverKey+"_"+t.providerName+"_"+t.quadKey+t.url.substring(t.url.indexOf("dataVersion"))),t.blockKey}function ea(t){var e=$o(t);return Nr(Xo.packRequestGroup[e])||(Xo.packRequestGroup[e]=[]),Nr(Xo.packRequestQuadKey[e])||(Xo.packRequestQuadKey[e]=""),Nr(Xo.packRequestPromise[e])||(Xo.packRequestPromise[e]=Ai.defer()),Nr(Xo.quadKeyIndex[e])||(Xo.quadKeyIndex[e]=0),t.quadKeyIndex=Xo.quadKeyIndex[e]++,t.deferred=Xo.packRequestPromise[e],t.state=zo.ISSUED,Xo.packRequestGroup[e].push(t),t.deferred.promise}function na(t){for(var e=0,n=t.length;e<n;e++){t[e].state=zo.CANCELLED}}function ra(t){for(var e=[],n={},r=0,i=t.length;r<i;r++){var o=t[r];if(!o.cancelled){var a=o.quadKey;n[a]||(n[a]=!0,e.push(a))}}return e}function ia(){var t=Xo.packRequestGroup;for(var e in t)if(t.hasOwnProperty(e)){var n=t[e];if(n.length<1)continue;var r=n[0].clone(),i=-1!==r.url.indexOf("rest/maps");r.serverKey=n[0].serverKey,r.state=n[0].state;var o=r.url,a=ra(n);if(a.length<1)continue;Xo.packRequestQuadKey[e]=i?a.join(","):a.join(";");var s=Xo.packRequestQuadKey[e];if(r.throttleByServer&&!Zo(r.serverKey)){na(n),Xo.packRequestPromise[e].reject();continue}r.deferred=Xo.packRequestPromise[e];var c=new mo(o);c.query=i?Nr(c.query)?c.query+"&tiles="+s:"tiles="+s:Nr(c.query)?c.query+"&extratiles="+s:"extratiles="+s,r.url=c.toString(),sa(r,r.url)}Xo.packRequestGroup={},Xo.packRequestPromise={},Xo.packRequestQuadKey={},Xo.quadKeyIndex={}}function oa(){var t=Xo.blockRequest;for(var e in t){if(t.hasOwnProperty(e))sa(t[e])}Xo.blockRequest={}}function aa(t){if(t.state===zo.UNISSUED)if(t.state=zo.ISSUED,t.type===Oo.PACK||t.type===Oo.BLOCKPACK){var e=$o(t);Nr(Xo.packRequestPromise[e])||(Xo.packRequestPromise[e]=Ai.defer()),t.deferred=Xo.packRequestPromise[e]}else t.deferred=Ai.defer();return t.deferred.promise}function sa(t,e){var n=aa(t);return t.state=zo.ACTIVE,Vo.push(t),++Go.numberOfActiveRequests,++Go.numberOfActiveRequestsEver,++Yo[t.serverKey],t.startTime=Uo(),t.requestFunction(e).then(function(t){return function(e){if(t.state!==zo.CANCELLED&&(--Go.numberOfActiveRequests,--Yo[t.serverKey],Wo.raiseEvent(),t.state=zo.RECEIVED,t.deferred.resolve(e),t.endTime=Uo(),(Xo.statisticRequestTime>0||t.type!==Oo.OTHER)&&(Go.totalRequestTime+=t.endTime-t.startTime),t.type===Oo.BLOCK||t.type===Oo.BLOCKPACK)){var n=ta(t);Nr(Xo.blockDefer[n])&&(Xo.blockDefer[n]=void 0,delete Xo.blockDefer[n])}}}(t)).otherwise(function(t){return function(e){t.state!==zo.CANCELLED&&(++Go.numberOfFailedRequests,--Go.numberOfActiveRequests,--Yo[t.serverKey],Wo.raiseEvent(e),t.state=zo.FAILED,t.deferred.reject(e))}}(t)),n}function ca(t){var e=t.state===zo.ACTIVE;t.state=zo.CANCELLED,++Go.numberOfCancelledRequests,t.deferred.reject(),e&&(--Go.numberOfActiveRequests,--Yo[t.serverKey],++Go.numberOfCancelledActiveRequests),Nr(t.cancelFunction)&&t.cancelFunction()}function la(t){var e;this.name="RuntimeError",this.message=t;try{throw new Error}catch(t){e=t.stack}this.stack=e}Xo.TIMEOUT=5e3,Xo.CANCLE_COUNT=3,Xo.statisticRequestTime=-1,Xo.maximumRequests=50,Xo.maximumRequestsPerServer=6,Xo.perPacketCount=20,Xo.requestsByServer={},Xo.throttleRequests=!0,Xo.debugShowStatistics=!1,Xo.requestCompletedEvent=Wo,Object.defineProperties(Xo,{activeRequestLength:{get:function(){return Vo.length}},statistics:{get:function(){return Go}},priorityHeapLength:{get:function(){return Ho},set:function(t){if(t<Ho)for(;qo.length>t;){ca(qo.pop())}Ho=t,qo.maximumLength=t,qo.reserve(t)}}}),Xo.packRequestGroup={},Xo.packRequestPromise={},Xo.packRequestQuadKey={},Xo.quadKeyIndex={},Xo.packRequestHeap={},Xo.blockDefer={},Xo.blockRequest={},Xo.update=function(){var t,e,n=0,r=Vo.length;for(t=0;t<r;++t)(e=Vo[t]).cancelled&&ca(e),e.state===zo.ACTIVE?n>0&&(Vo[t-n]=e):++n;Vo.length-=n;var i=qo.internalArray,o=qo.length;for(t=0;t<o;++t)Jo(i[t]);qo.resort(),function(){for(var t in Xo.packRequestHeap)if(Xo.packRequestHeap.hasOwnProperty(t)){for(var e=Xo.packRequestHeap[t],n=e.internalArray,r=e.length,i=0;i<r;++i)Jo(n[i]);e.resort()}}(),oa(),function(){for(var t in Xo.packRequestHeap)if(Xo.packRequestHeap.hasOwnProperty(t))for(var e=Xo.packRequestHeap[t];e.length>0;){var n=e.pop();n.cancelled?ca(n):ea(n)}ia()}();for(var a=Math.max(Xo.maximumRequests-Vo.length,0),s=0;s<a&&qo.length>0;)(e=qo.pop()).cancelled?ca(e):!e.throttleByServer||Zo(e.serverKey)?(sa(e),++s):ca(e);!function(){if(!Xo.debugShowStatistics)return;0===Go.numberOfActiveRequests&&Go.lastNumberOfActiveRequests>0&&(Go.numberOfAttemptedRequests>0&&(console.log("Number of attempted requests: "+Go.numberOfAttemptedRequests),Go.numberOfAttemptedRequests=0),Go.numberOfCancelledRequests>0&&(console.log("Number of cancelled requests: "+Go.numberOfCancelledRequests),Go.numberOfCancelledRequests=0),Go.numberOfCancelledActiveRequests>0&&(console.log("Number of cancelled active requests: "+Go.numberOfCancelledActiveRequests),Go.numberOfCancelledActiveRequests=0),Go.numberOfFailedRequests>0&&(console.log("Number of failed requests: "+Go.numberOfFailedRequests),Go.numberOfFailedRequests=0));Go.lastNumberOfActiveRequests=Go.numberOfActiveRequests}()},Xo.getServerKey=function(t){Qr.typeOf.string("url",t);var e=new mo(t).resolve(Ko);e.normalize();var n=e.authority;return/:/.test(n)||(n=n+":"+("https"===e.scheme?"443":"80")),Nr(Yo[n])||(Yo[n]=0),n},Xo.request=function(t){if(Qr.typeOf.object("request",t),Qr.typeOf.string("request.url",t.url),Qr.typeOf.func("request.requestFunction",t.requestFunction),Do(t.url)||Bo(t.url))return Wo.raiseEvent(),t.state=zo.RECEIVED,t.requestFunction();if(++Go.numberOfAttemptedRequests,Nr(t.serverKey)||(t.serverKey=Xo.getServerKey(t.url)),t.type===Oo.BLOCK)return function(t){var e=ta(t),n=Xo.blockDefer[e];return Nr(n)||(n=Xo.blockDefer[e]=Ai.defer(),Xo.blockRequest[e]=t),t.deferred=n,t.state=zo.ISSUED,t.deferred.promise}(t);if(!t.throttleByServer||Zo(t.serverKey)){if(!Xo.throttleRequests||!t.throttle)return sa(t);if(!(Vo.length>=Xo.maximumRequests)){var e;if(Jo(t),t.type===Oo.PACK||t.type===Oo.BLOCKPACK){var n=function(t){var e=$o(t),n=Xo.packRequestHeap[e];return Nr(n)||((n=Xo.packRequestHeap[e]=new Po({comparator:jo})).maximumLength=Xo.perPacketCount,n.reserve(Ho)),n}(t),r=!0;if(t.type===Oo.BLOCKPACK)for(var i=0;i<n.length;i++)if(n._array[i].quadKey===t.quadKey){t.blockRequest=n._array[i],r=!1;break}r&&(e=n.insert(t))}else e=qo.insert(t);if(Nr(e)){if(e===t)return;ca(e)}return aa(t)}}},Xo.clearForSpecs=function(){for(;qo.length>0;){ca(qo.pop())}for(var t=Vo.length,e=0;e<t;++e)ca(Vo[e]);Vo.length=0,Yo={},Go.numberOfAttemptedRequests=0,Go.numberOfActiveRequests=0,Go.numberOfCancelledRequests=0,Go.numberOfCancelledActiveRequests=0,Go.numberOfFailedRequests=0,Go.numberOfActiveRequestsEver=0,Go.lastNumberOfActiveRequests=0,Go.totalRequestTime=0},Xo.numberOfActiveRequestsByServer=function(t){return Yo[t]},Xo.requestHeap=qo,Nr(Object.create)&&(la.prototype=Object.create(Error.prototype),la.prototype.constructor=la),la.prototype.toString=function(){var t=this.name+": "+this.message;return Nr(this.stack)&&(t+="\n"+this.stack.toString()),t};var ua={},ha={};ua.add=function(t,e){if(!Nr(t))throw new Lr("host is required.");if(!Nr(e)||e<=0)throw new Lr("port is required to be greater than 0.");var n=t.toLowerCase()+":"+e;Nr(ha[n])||(ha[n]=!0)},ua.remove=function(t,e){if(!Nr(t))throw new Lr("host is required.");if(!Nr(e)||e<=0)throw new Lr("port is required to be greater than 0.");var n=t.toLowerCase()+":"+e;Nr(ha[n])&&delete ha[n]},ua.contains=function(t){if(!Nr(t))throw new Lr("url is required.");var e=function(t){var e=new mo(t);e.normalize();var n=e.getAuthority();if(Nr(n)){if(-1!==n.indexOf("@")){var r=n.split("@");n=r[1]}if(-1===n.indexOf(":")){var i=e.getScheme();if(Nr(i)||(i=(i=window.location.protocol).substring(0,i.length-1)),"http"===i)n+=":80";else{if("https"!==i)return;n+=":443"}}return n}}(t);return!(!Nr(e)||!Nr(ha[e]))},ua.clear=function(){ha={}};var fa,da=function(){try{var t=new XMLHttpRequest;return t.open("GET","#",!0),t.responseType="blob","blob"===t.responseType}catch(t){return!1}}();function pa(t,e,n,r){var i,o=t.query;if(!Nr(o)||0===o.length)return{};if(-1===o.indexOf("=")){var a={};a[o]=void 0,i=a}else i=function(t){if(!Nr(t))throw new Lr("queryString is required.");var e={};if(""===t)return e;for(var n=t.replace(/\+/g,"%20").split(/[&;]/),r=0,i=n.length;r<i;++r){var o=n[r].split("=");if(o.length>2){var a=n[r].indexOf("=");o=[n[r].substring(0,a),n[r].substring(a+1,n[r].length)]}var s=decodeURIComponent(o[0]),c=o[1];c=Nr(c)?decodeURIComponent(c):"";var l=e[s];"string"==typeof l?e[s]=[l,c]:Array.isArray(l)?l.push(c):e[s]=c}return e}(o);e._queryParameters=n?ma(i,e._queryParameters,r):i,t.query=void 0}function Aa(t,e){return Nr(t)?Nr(t.clone)?t.clone():_o(t):e}function ga(t){if(t.state===zo.ISSUED||t.state===zo.ACTIVE)throw new la("The Resource is already being fetched.");t.state=zo.UNISSUED,t.deferred=void 0}function ma(t,e,n){if(!n)return bo(t,e);var r=_o(t,!0);for(var i in e)if(e.hasOwnProperty(i)){var o=r[i],a=e[i];Nr(o)?(Array.isArray(o)||(o=r[i]=[o]),r[i]=o.concat(a)):r[i]=Array.isArray(a)?a.slice():a}return r}function ya(t){"string"==typeof(t=Pr(t,Pr.EMPTY_OBJECT))&&(t={url:t}),Qr.typeOf.string("options.url",t.url),this._url=void 0,this._templateValues=Aa(t.templateValues,{}),this._queryParameters=Aa(t.queryParameters,{}),this.headers=Aa(t.headers,{}),this.request=Pr(t.request,new No),this.proxy=t.proxy,this.retryCallback=t.retryCallback,this.retryAttempts=Pr(t.retryAttempts,0),this._retryCount=0;var e=new mo(t.url);pa(e,this,!0,!0),e.fragment=void 0,this._url=e.toString()}function va(t){var e=t.resource,n=t.flipY,r=t.preferImageBitmap,i=e.request;i.url=e.url,i.requestFunction=function(){var t=!1;e.isDataUri||e.isBlobUri||(t=e.isCrossOriginUrl);var o=Ai.defer();return ya._Implementations.createImage(i,t,o,n,r),o.promise};var o=Xo.request(i);if(Nr(o))return o.otherwise((function(t){return i.state!==zo.FAILED?Ai.reject(t):e.retryOnError(t).then((function(o){return o?(i.state=zo.UNISSUED,i.deferred=void 0,va({resource:e,flipY:n,preferImageBitmap:r})):Ai.reject(t)}))}))}function Ca(t,e,n){var r={};r[e]=n,t.setQueryParameters(r);var i=t.request;i.url=t.url,i.requestFunction=function(){var e=Ai.defer();return window[n]=function(t){e.resolve(t);try{delete window[n]}catch(t){window[n]=void 0}},ya._Implementations.loadAndExecuteScript(t.url,n,e),e.promise};var o=Xo.request(i);if(Nr(o))return o.otherwise((function(r){return i.state!==zo.FAILED?Ai.reject(r):t.retryOnError(r).then((function(o){return o?(i.state=zo.UNISSUED,i.deferred=void 0,Ca(t,e,n)):Ai.reject(r)}))}))}ya.createIfNeeded=function(t){return t instanceof ya?t.getDerivedResource({request:t.request}):"string"!=typeof t?t:new ya({url:t})},ya.supportsImageBitmapOptions=function(){if(Nr(fa))return fa;if("function"!=typeof createImageBitmap)return fa=Ai.resolve(!1);return fa=ya.fetchBlob({url:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVQImWP4////fwAJ+wP9CNHoHgAAAABJRU5ErkJggg=="}).then((function(t){return createImageBitmap(t,{imageOrientation:"flipY",premultiplyAlpha:"none"})})).then((function(t){return!0})).otherwise((function(){return!1}))},Object.defineProperties(ya,{isBlobSupported:{get:function(){return da}}}),Object.defineProperties(ya.prototype,{queryParameters:{get:function(){return this._queryParameters}},templateValues:{get:function(){return this._templateValues}},url:{get:function(){return this.getUrlComponent(!0,!0)},set:function(t){var e=new mo(t);pa(e,this,!1),e.fragment=void 0,this._url=e.toString()}},extension:{get:function(){return function(t){if(!Nr(t))throw new Lr("uri is required.");var e=new mo(t);e.normalize();var n=e.path,r=n.lastIndexOf("/");return-1!==r&&(n=n.substr(r+1)),r=n.lastIndexOf("."),-1===r?"":n.substr(r+1)}(this._url)}},isDataUri:{get:function(){return Do(this._url)}},isBlobUri:{get:function(){return Bo(this._url)}},isCrossOriginUrl:{get:function(){return function(t){Nr(Mo)||(Mo=document.createElement("a")),Mo.href=window.location.href;var e=Mo.host,n=Mo.protocol;return Mo.href=t,Mo.href=Mo.href,n!==Mo.protocol||e!==Mo.host}(this._url)}},hasHeaders:{get:function(){return Object.keys(this.headers).length>0}}}),ya.prototype.getUrlComponent=function(t,e){if(this.isDataUri)return this._url;var n=new mo(this._url);t&&function(t,e){var n=e._queryParameters,r=Object.keys(n);1!==r.length||Nr(n[r[0]])?t.query=Ro(n):t.query=r[0]}(n,this);var r=n.toString().replace(/%7B/g,"{").replace(/%7D/g,"}"),i=this._templateValues;return r=r.replace(/{(.*?)}/g,(function(t,e){var n=i[e];return Nr(n)&&"s"==e?encodeURI(n):Nr(n)?encodeURIComponent(n):t})),e&&Nr(this.proxy)&&(r=this.proxy.getURL(r)),r},ya.prototype.setQueryParameters=function(t,e){this._queryParameters=e?ma(this._queryParameters,t,!1):ma(t,this._queryParameters,!1)},ya.prototype.appendQueryParameters=function(t){this._queryParameters=ma(t,this._queryParameters,!0)},ya.prototype.setTemplateValues=function(t,e){this._templateValues=e?bo(this._templateValues,t):bo(t,this._templateValues)},ya.prototype.getDerivedResource=function(t){var e=this.clone();if(e._retryCount=0,Nr(t.url)){var n=new mo(t.url);pa(n,e,!0,Pr(t.preserveQueryParameters,!1)),n.fragment=void 0,e._url=n.resolve(new mo(wo(this._url))).toString()}return Nr(t.queryParameters)&&(e._queryParameters=bo(t.queryParameters,e._queryParameters)),Nr(t.templateValues)&&(e._templateValues=bo(t.templateValues,e.templateValues)),Nr(t.headers)&&(e.headers=bo(t.headers,e.headers)),Nr(t.proxy)&&(e.proxy=t.proxy),Nr(t.request)&&(e.request=t.request),Nr(t.retryCallback)&&(e.retryCallback=t.retryCallback),Nr(t.retryAttempts)&&(e.retryAttempts=t.retryAttempts),e},ya.prototype.retryOnError=function(t){var e=this.retryCallback;if("function"!=typeof e||this._retryCount>=this.retryAttempts)return Ai(!1);var n=this;return Ai(e(this,t)).then((function(t){return++n._retryCount,t}))},ya.prototype.clone=function(t){return Nr(t)||(t=new ya({url:this._url})),t._url=this._url,t._queryParameters=_o(this._queryParameters),t._templateValues=_o(this._templateValues),t.headers=_o(this.headers),t.proxy=this.proxy,t.retryCallback=this.retryCallback,t.retryAttempts=this.retryAttempts,t._retryCount=0,t.request=this.request.clone(),t},ya.prototype.getBaseUri=function(t){return function(t,e){if(!Nr(t))throw new Lr("uri is required.");var n="",r=t.lastIndexOf("/");return-1!==r&&(n=t.substring(0,r+1)),e?(Nr((t=new mo(t)).query)&&(n+="?"+t.query),Nr(t.fragment)&&(n+="#"+t.fragment),n):n}(this.getUrlComponent(t),t)},ya.prototype.appendForwardSlash=function(){var t;this._url=(0!==(t=this._url).length&&"/"===t[t.length-1]||(t+="/"),t)},ya.prototype.fetchArrayBuffer=function(){return this.fetch({responseType:"arraybuffer"})},ya.fetchArrayBuffer=function(t){return new ya(t).fetchArrayBuffer()},ya.prototype.fetchBlob=function(){return this.fetch({responseType:"blob"})},ya.fetchBlob=function(t){return new ya(t).fetchBlob()},ya.prototype.fetchImage=function(t){t=Pr(t,Pr.EMPTY_OBJECT);var e=Pr(t.preferImageBitmap,!1),n=Pr(t.preferBlob,!1),r=Pr(t.flipY,!1);if(ga(this.request),!da||this.isDataUri||this.isBlobUri||!this.hasHeaders&&!n)return va({resource:this,flipY:r,preferImageBitmap:e});var i,o,a,s=this.fetchBlob();return Nr(s)?ya.supportsImageBitmapOptions().then((function(t){return i=t&&e,s})).then((function(t){if(Nr(t)){if(a=t,i)return ya.createImageBitmapFromBlob(t,{flipY:r,premultiplyAlpha:!1});var e=window.URL.createObjectURL(t);return va({resource:o=new ya({url:e}),flipY:r,preferImageBitmap:!1})}})).then((function(t){if(Nr(t))return t.blob=a,i||window.URL.revokeObjectURL(o.url),t})).otherwise((function(t){return Nr(o)&&window.URL.revokeObjectURL(o.url),t.blob=a,Ai.reject(t)})):void 0},ya.fetchImage=function(t){return new ya(t).fetchImage({flipY:t.flipY,preferBlob:t.preferBlob,preferImageBitmap:t.preferImageBitmap})},ya.prototype.fetchText=function(){return this.fetch({responseType:"text"})},ya.fetchText=function(t){return new ya(t).fetchText()},ya.prototype.fetchJson=function(){var t=this.fetch({responseType:"text",headers:{Accept:"application/json,*/*;q=0.01"}});if(Nr(t))return t.then((function(t){if(Nr(t))return JSON.parse(t)}))},ya.fetchJson=function(t){return new ya(t).fetchJson()},ya.prototype.fetchXML=function(){return this.fetch({responseType:"document",overrideMimeType:"text/xml"})},ya.fetchXML=function(t){return new ya(t).fetchXML()},ya.prototype.fetchJsonp=function(t){var e;t=Pr(t,"callback"),ga(this.request);do{e="loadJsonp"+Math.random().toString().substring(2,8)}while(Nr(window[e]));return Ca(this,t,e)},ya.fetchJsonp=function(t){return new ya(t).fetchJsonp(t.callbackParameterName)},ya.prototype._makeRequest=function(t){var e=this;ga(e.request);var n=e.request;n.url=e.url,n.requestFunction=function(r){var i=t.responseType,o=bo(t.headers,e.headers),a=t.overrideMimeType,s=t.method,c=t.data,l=Ai.defer(),u=Nr(r)?r:e.url,h=ya._Implementations.loadWithXhr(u,i,s,c,o,l,a);return Nr(h)&&Nr(h.abort)&&(n.cancelFunction=function(){h.abort()}),l.promise};var r=Xo.request(n);if(Nr(r))return r.then((function(t){return t})).otherwise((function(r){return n.state!==zo.FAILED?Ai.reject(r):e.retryOnError(r).then((function(i){return i?(n.state=zo.UNISSUED,n.deferred=void 0,e.fetch(t)):Ai.reject(r)}))}))};var Ia=/^data:(.*?)(;base64)?,(.*)$/;function xa(t,e){var n=decodeURIComponent(e);return t?atob(n):n}function Ea(t,e){for(var n=xa(t,e),r=new ArrayBuffer(n.length),i=new Uint8Array(r),o=0;o<n.length;o++)i[o]=n.charCodeAt(o);return r}ya.prototype.fetch=function(t){return(t=Aa(t,{})).method="GET",this._makeRequest(t)},ya.fetch=function(t){return new ya(t).fetch({responseType:t.responseType,overrideMimeType:t.overrideMimeType})},ya.prototype.delete=function(t){return(t=Aa(t,{})).method="DELETE",this._makeRequest(t)},ya.delete=function(t){return new ya(t).delete({responseType:t.responseType,overrideMimeType:t.overrideMimeType,data:t.data})},ya.prototype.head=function(t){return(t=Aa(t,{})).method="HEAD",this._makeRequest(t)},ya.head=function(t){return new ya(t).head({responseType:t.responseType,overrideMimeType:t.overrideMimeType})},ya.prototype.options=function(t){return(t=Aa(t,{})).method="OPTIONS",this._makeRequest(t)},ya.options=function(t){return new ya(t).options({responseType:t.responseType,overrideMimeType:t.overrideMimeType})},ya.prototype.post=function(t,e){return Qr.defined("data",t),(e=Aa(e,{})).method="POST",e.data=t,this._makeRequest(e)},ya.post=function(t){return new ya(t).post(t.data,{responseType:t.responseType,overrideMimeType:t.overrideMimeType})},ya.prototype.put=function(t,e){return Qr.defined("data",t),(e=Aa(e,{})).method="PUT",e.data=t,this._makeRequest(e)},ya.put=function(t){return new ya(t).put(t.data,{responseType:t.responseType,overrideMimeType:t.overrideMimeType})},ya.prototype.patch=function(t,e){return Qr.defined("data",t),(e=Aa(e,{})).method="PATCH",e.data=t,this._makeRequest(e)},ya.patch=function(t){return new ya(t).patch(t.data,{responseType:t.responseType,overrideMimeType:t.overrideMimeType})},ya._Implementations={},ya._Implementations.createImage=function(t,e,n,r,i){var o=t.url;ya.supportsImageBitmapOptions().then((function(a){if(a&&i){var s=Ai.defer(),c=ya._Implementations.loadWithXhr(o,"blob","GET",void 0,void 0,s,void 0,void 0,void 0);return Nr(c)&&Nr(c.abort)&&(t.cancelFunction=function(){c.abort()}),s.promise.then((function(t){if(Nr(t))return ya.createImageBitmapFromBlob(t,{flipY:r,premultiplyAlpha:!1});n.reject(new la("Successfully retrieved "+o+" but it contained no content."))})).then(n.resolve)}!function(t,e,n){var r=new Image;r.crossOrigin="",r.onload=function(){n.resolve(r)},r.onerror=function(t){n.reject(t)},e&&(ua.contains(t)?r.crossOrigin="use-credentials":r.crossOrigin=""),r.src=t}(o,e,n)})).otherwise(n.reject)},ya.createImageBitmapFromBlob=function(t,e){return Qr.defined("options",e),Qr.typeOf.bool("options.flipY",e.flipY),Qr.typeOf.bool("options.premultiplyAlpha",e.premultiplyAlpha),createImageBitmap(t,{imageOrientation:e.flipY?"flipY":"none",premultiplyAlpha:e.premultiplyAlpha?"premultiply":"none"})};var _a="undefined"==typeof XMLHttpRequest;function ba(t){if(t=Pr(t,Pr.EMPTY_OBJECT),this._dates=void 0,this._samples=void 0,this._dateColumn=-1,this._xPoleWanderRadiansColumn=-1,this._yPoleWanderRadiansColumn=-1,this._ut1MinusUtcSecondsColumn=-1,this._xCelestialPoleOffsetRadiansColumn=-1,this._yCelestialPoleOffsetRadiansColumn=-1,this._taiMinusUtcSecondsColumn=-1,this._columnCount=0,this._lastIndex=-1,this._downloadPromise=void 0,this._dataError=void 0,this._addNewLeapSeconds=Pr(t.addNewLeapSeconds,!0),Nr(t.data))Ma(this,t.data);else if(Nr(t.url)){var e=ya.createIfNeeded(t.url),n=this;this._downloadPromise=Ai(e.fetchJson(),(function(t){Ma(n,t)}),(function(){n._dataError="An error occurred while retrieving the EOP data from the URL "+e.url+"."}))}else Ma(this,{columnNames:["dateIso8601","modifiedJulianDateUtc","xPoleWanderRadians","yPoleWanderRadians","ut1MinusUtcSeconds","lengthOfDayCorrectionSeconds","xCelestialPoleOffsetRadians","yCelestialPoleOffsetRadians","taiMinusUtcSeconds"],samples:[]})}function wa(t,e){return Ao.compare(t.julianDate,e)}function Ma(t,e){if(Nr(e.columnNames))if(Nr(e.samples)){var n=e.columnNames.indexOf("modifiedJulianDateUtc"),r=e.columnNames.indexOf("xPoleWanderRadians"),i=e.columnNames.indexOf("yPoleWanderRadians"),o=e.columnNames.indexOf("ut1MinusUtcSeconds"),a=e.columnNames.indexOf("xCelestialPoleOffsetRadians"),s=e.columnNames.indexOf("yCelestialPoleOffsetRadians"),c=e.columnNames.indexOf("taiMinusUtcSeconds");if(n<0||r<0||i<0||o<0||a<0||s<0||c<0)t._dataError="Error in loaded EOP data: The columnNames property must include modifiedJulianDateUtc, xPoleWanderRadians, yPoleWanderRadians, ut1MinusUtcSeconds, xCelestialPoleOffsetRadians, yCelestialPoleOffsetRadians, and taiMinusUtcSeconds columns";else{var l,u=t._samples=e.samples,h=t._dates=[];t._dateColumn=n,t._xPoleWanderRadiansColumn=r,t._yPoleWanderRadiansColumn=i,t._ut1MinusUtcSecondsColumn=o,t._xCelestialPoleOffsetRadiansColumn=a,t._yCelestialPoleOffsetRadiansColumn=s,t._taiMinusUtcSecondsColumn=c,t._columnCount=e.columnNames.length,t._lastIndex=void 0;for(var f=t._addNewLeapSeconds,d=0,p=u.length;d<p;d+=t._columnCount){var A=u[d+n],g=u[d+c],m=new Ao(A+Ki.MODIFIED_JULIAN_DATE_DIFFERENCE,g,Wi.TAI);if(h.push(m),f){if(g!==l&&Nr(l)){var y=Ao.leapSeconds,v=ji(y,m,wa);if(v<0){var C=new Yi(m,g);y.splice(~v,0,C)}}l=g}}}}else t._dataError="Error in loaded EOP data: The samples property is required.";else t._dataError="Error in loaded EOP data: The columnNames property is required."}function Ta(t,e,n,r,i){var o=n*r;i.xPoleWander=e[o+t._xPoleWanderRadiansColumn],i.yPoleWander=e[o+t._yPoleWanderRadiansColumn],i.xPoleOffset=e[o+t._xCelestialPoleOffsetRadiansColumn],i.yPoleOffset=e[o+t._yCelestialPoleOffsetRadiansColumn],i.ut1MinusUtc=e[o+t._ut1MinusUtcSecondsColumn]}function Ba(t,e,n){return e+t*(n-e)}function Sa(t,e,n,r,i,o,a){var s=t._columnCount;if(o>e.length-1)return a.xPoleWander=0,a.yPoleWander=0,a.xPoleOffset=0,a.yPoleOffset=0,a.ut1MinusUtc=0,a;var c=e[i],l=e[o];if(c.equals(l)||r.equals(c))return Ta(t,n,i,s,a),a;if(r.equals(l))return Ta(t,n,o,s,a),a;var u=Ao.secondsDifference(r,c)/Ao.secondsDifference(l,c),h=i*s,f=o*s,d=n[h+t._ut1MinusUtcSecondsColumn],p=n[f+t._ut1MinusUtcSecondsColumn],A=p-d;if(A>.5||A<-.5){var g=n[h+t._taiMinusUtcSecondsColumn],m=n[f+t._taiMinusUtcSecondsColumn];g!==m&&(l.equals(r)?d=p:p-=m-g)}return a.xPoleWander=Ba(u,n[h+t._xPoleWanderRadiansColumn],n[f+t._xPoleWanderRadiansColumn]),a.yPoleWander=Ba(u,n[h+t._yPoleWanderRadiansColumn],n[f+t._yPoleWanderRadiansColumn]),a.xPoleOffset=Ba(u,n[h+t._xCelestialPoleOffsetRadiansColumn],n[f+t._xCelestialPoleOffsetRadiansColumn]),a.yPoleOffset=Ba(u,n[h+t._yCelestialPoleOffsetRadiansColumn],n[f+t._yCelestialPoleOffsetRadiansColumn]),a.ut1MinusUtc=Ba(u,d,p),a}function Da(t,e,n,r){e=Pr(e,0),n=Pr(n,0),r=Pr(r,0),Qr.typeOf.number.greaterThanOrEquals("x",e,0),Qr.typeOf.number.greaterThanOrEquals("y",n,0),Qr.typeOf.number.greaterThanOrEquals("z",r,0),Ur.equalsEpsilon(r,6356752.314245179,Ur.EPSILON10)&&(Ur.Radius=r),t._radii=new Hr(e,n,r),t._radiiSquared=new Hr(e*e,n*n,r*r),t._radiiToTheFourth=new Hr(e*e*e*e,n*n*n*n,r*r*r*r),t._oneOverRadii=new Hr(0===e?0:1/e,0===n?0:1/n,0===r?0:1/r),t._oneOverRadiiSquared=new Hr(0===e?0:1/(e*e),0===n?0:1/(n*n),0===r?0:1/(r*r)),t._minimumRadius=Math.min(e,n,r),t._maximumRadius=Math.max(e,n,r),t._centerToleranceSquared=Ur.EPSILON1,t._radii.x>0&&(t._f=(t._radii.x-t._radii.z)/t._radii.x,t._e2=2*t._f-t._f*t._f),0!==t._radiiSquared.z&&(t._squaredXOverSquaredZ=t._radiiSquared.x/t._radiiSquared.z)}function Ra(t,e,n){this._radii=void 0,this._radiiSquared=void 0,this._radiiToTheFourth=void 0,this._oneOverRadii=void 0,this._oneOverRadiiSquared=void 0,this._minimumRadius=void 0,this._maximumRadius=void 0,this._centerToleranceSquared=void 0,this._squaredXOverSquaredZ=void 0,Da(this,t,e,n)}ya._Implementations.loadWithXhr=function(t,e,n,r,i,o,a){var s=Ia.exec(t);if(null===s){if(!_a){var c=new XMLHttpRequest;if(ua.contains(t)&&(c.withCredentials=!0),t=t.replace(/{/g,"%7B").replace(/}/g,"%7D"),c.open(n,t,!0),Nr(a)&&Nr(c.overrideMimeType)&&c.overrideMimeType(a),Nr(i))for(var l in i)i.hasOwnProperty(l)&&c.setRequestHeader(l,i[l]);Nr(e)&&(c.responseType=e);var u=!1;return"string"==typeof t&&(u=0===t.indexOf("file://")||"undefined"!=typeof window&&"file://"===window.location.origin),c.onload=function(){if(!(c.status<200||c.status>=300)||u&&0===c.status){var t=c.response,r=c.responseType;if("HEAD"===n||"OPTIONS"===n){var i=c.getAllResponseHeaders().trim().split(/[\r\n]+/),a={};return i.forEach((function(t){var e=t.split(": "),n=e.shift();a[n]=e.join(": ")})),void o.resolve(a)}if(204===c.status)o.resolve();else if(!Nr(t)||Nr(e)&&r!==e)if("json"===e&&"string"==typeof t)try{o.resolve(JSON.parse(t))}catch(t){o.reject(t)}else(""===r||"document"===r)&&Nr(c.responseXML)&&c.responseXML.hasChildNodes()?o.resolve(c.responseXML):""!==r&&"text"!==r||!Nr(c.responseText)?o.reject(new la("Invalid XMLHttpRequest response type.")):o.resolve(c.responseText);else o.resolve(t)}else o.reject(new Lo(c.status,c.response,c.getAllResponseHeaders()))},c.onerror=function(t){o.reject(new Lo)},c.send(r),c}!function(t,e,n,r,i,o){fetch(t,{method:n,headers:i}).then((async t=>{if(!t.ok){const e={};return t.headers.forEach(((t,n)=>{e[n]=t})),void o.reject(new Lo(t.status,t,e))}switch(e){case"text":o.resolve(t.text());break;case"json":o.resolve(t.json());break;default:o.resolve(new Uint8Array(await t.arrayBuffer()).buffer)}})).catch((()=>{o.reject(new Lo)}))}(t,e,n,0,i,o)}else o.resolve(function(t,e){e=Pr(e,"");var n=t[1],r=!!t[2],i=t[3];switch(e){case"":case"text":return xa(r,i);case"arraybuffer":return Ea(r,i);case"blob":var o=Ea(r,i);return new Blob([o],{type:n});case"document":return(new DOMParser).parseFromString(xa(r,i),n);case"json":return JSON.parse(xa(r,i));default:throw new Lr("Unhandled responseType: "+e)}}(s,e))},ya._Implementations.loadAndExecuteScript=function(t,e,n){return function(t){var e=Ai.defer(),n=document.createElement("script");n.async=!0,n.src=t;var r=document.getElementsByTagName("head")[0];return n.onload=function(){n.onload=void 0,r.removeChild(n),e.resolve()},n.onerror=function(t){e.reject(t)},r.appendChild(n),e.promise}(t).otherwise(n.reject)},ya._DefaultImplementations={},ya._DefaultImplementations.createImage=ya._Implementations.createImage,ya._DefaultImplementations.loadWithXhr=ya._Implementations.loadWithXhr,ya._DefaultImplementations.loadAndExecuteScript=ya._Implementations.loadAndExecuteScript,ya.DEFAULT=Object.freeze(new ya({url:"undefined"==typeof document?"":document.location.href.split("?")[0]})),ba.NONE=Object.freeze({getPromiseToLoad:function(){return Ai()},compute:function(t,e){return Nr(e)?(e.xPoleWander=0,e.yPoleWander=0,e.xPoleOffset=0,e.yPoleOffset=0,e.ut1MinusUtc=0):e=new Gi(0,0,0,0,0),e}}),ba.prototype.getPromiseToLoad=function(){return Ai(this._downloadPromise)},ba.prototype.compute=function(t,e){if(Nr(this._samples)){if(Nr(e)||(e=new Gi(0,0,0,0,0)),0===this._samples.length)return e.xPoleWander=0,e.yPoleWander=0,e.xPoleOffset=0,e.yPoleOffset=0,e.ut1MinusUtc=0,e;var n=this._dates,r=this._lastIndex,i=0,o=0;if(Nr(r)){var a=n[r],s=n[r+1],c=Ao.lessThanOrEquals(a,t),l=!Nr(s),u=l||Ao.greaterThanOrEquals(s,t);if(c&&u)return i=r,!l&&s.equals(t)&&++i,o=i+1,Sa(this,n,this._samples,t,i,o,e),e}var h=ji(n,t,Ao.compare,this._dateColumn);return h>=0?(h<n.length-1&&n[h+1].equals(t)&&++h,i=h,o=h):(i=(o=~h)-1)<0&&(i=0),this._lastIndex=i,Sa(this,n,this._samples,t,i,o,e),e}if(Nr(this._dataError))throw new la(this._dataError)},Object.defineProperties(Ra.prototype,{radii:{get:function(){return this._radii}},radiiSquared:{get:function(){return this._radiiSquared}},radiiToTheFourth:{get:function(){return this._radiiToTheFourth}},oneOverRadii:{get:function(){return this._oneOverRadii}},oneOverRadiiSquared:{get:function(){return this._oneOverRadiiSquared}},minimumRadius:{get:function(){return this._minimumRadius}},maximumRadius:{get:function(){return this._maximumRadius}}}),Ra.clone=function(t,e){if(Nr(t)){var n=t._radii;return Nr(e)?(Hr.clone(n,e._radii),Hr.clone(t._radiiSquared,e._radiiSquared),Hr.clone(t._radiiToTheFourth,e._radiiToTheFourth),Hr.clone(t._oneOverRadii,e._oneOverRadii),e._f=t._f,e._e2=t._e2,e._minimumRadius=t._minimumRadius,e._maximumRadius=t._maximumRadius,e._centerToleranceSquared=t._centerToleranceSquared,e):new Ra(n.x,n.y,n.z)}},Ra.fromCartesian3=function(t,e){return Nr(e)||(e=new Ra),Nr(t)?(Da(e,t.x,t.y,t.z),e):e},Ra.WGS84=Object.freeze(new Ra(6378137,6378137,Ur.Radius)),Ra.XIAN80=Object.freeze(new Ra(6378140,6378140,6356755.29)),Ra.CGCS2000=Object.freeze(new Ra(6378137,6378137,6356752.31)),Ra.UNIT_SPHERE=Object.freeze(new Ra(1,1,1)),Ra.MOON=Object.freeze(new Ra(Ur.LUNAR_RADIUS,Ur.LUNAR_RADIUS,Ur.LUNAR_RADIUS)),Ra.prototype.clone=function(t){return Ra.clone(this,t)},Ra.packedLength=Hr.packedLength,Ra.pack=function(t,e,n){return Qr.typeOf.object("value",t),Qr.defined("array",e),n=Pr(n,0),Hr.pack(t._radii,e,n),e},Ra.unpack=function(t,e,n){Qr.defined("array",t),e=Pr(e,0);var r=Hr.unpack(t,e);return Ra.fromCartesian3(r,n)},Ra.prototype.geocentricSurfaceNormal=Hr.normalize,Ra.prototype.geodeticSurfaceNormalCartographic=function(t,e){Qr.typeOf.object("cartographic",t);var n=t.longitude,r=t.latitude,i=Math.cos(r),o=i*Math.cos(n),a=i*Math.sin(n),s=Math.sin(r);return Nr(e)||(e=new Hr),e.x=o,e.y=a,e.z=s,Hr.normalize(e,e)},Ra.prototype.geodeticSurfaceNormal=function(t,e){return Nr(e)||(e=new Hr),e=Hr.multiplyComponents(t,this._oneOverRadiiSquared,e),Hr.normalize(e,e)};var za=new Hr,Oa=new Hr;Ra.prototype.cartographicToCartesian=function(t,e){var n=za,r=Oa;this.geodeticSurfaceNormalCartographic(t,n),Hr.multiplyComponents(this._radiiSquared,n,r);var i=Math.sqrt(Hr.dot(n,r));return Hr.divideByScalar(r,i,r),Hr.multiplyByScalar(n,t.height,n),Nr(e)||(e=new Hr),Hr.add(r,n,e)},Ra.prototype.cartographicArrayToCartesianArray=function(t,e){Qr.defined("cartographics",t);var n=t.length;Nr(e)?e.length=n:e=new Array(n);for(var r=0;r<n;r++)e[r]=this.cartographicToCartesian(t[r],e[r]);return e};var Na=new Hr,La=new Hr,Qa=new Hr;function Fa(t,e,n){this.heading=Pr(t,0),this.pitch=Pr(e,0),this.roll=Pr(n,0)}Ra.prototype.cartesianToCartographic=function(t,e){var n=this.scaleToGeodeticSurface(t,La);if(Nr(n)){var r=this.geodeticSurfaceNormal(n,Na),i=Hr.subtract(t,n,Qa),o=Math.atan2(r.y,r.x),a=Math.asin(r.z),s=Ur.sign(Hr.dot(i,t))*Hr.magnitude(i);return Nr(e)?(e.longitude=o,e.latitude=a,e.height=s,e):new ri(o,a,s)}},Ra.prototype.cartesianArrayToCartographicArray=function(t,e){Qr.defined("cartesians",t);var n=t.length;Nr(e)?e.length=n:e=new Array(n);for(var r=0;r<n;++r)e[r]=this.cartesianToCartographic(t[r],e[r]);return e},Ra.prototype.scaleToGeodeticSurface=function(t,e){return ni(t,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,e)},Ra.prototype.scaleToGeocentricSurface=function(t,e){Qr.typeOf.object("cartesian",t),Nr(e)||(e=new Hr);var n=t.x,r=t.y,i=t.z,o=this._oneOverRadiiSquared,a=1/Math.sqrt(n*n*o.x+r*r*o.y+i*i*o.z);return Hr.multiplyByScalar(t,a,e)},Ra.prototype.transformPositionToScaledSpace=function(t,e){return Nr(e)||(e=new Hr),Hr.multiplyComponents(t,this._oneOverRadii,e)},Ra.prototype.transformPositionFromScaledSpace=function(t,e){return Nr(e)||(e=new Hr),Hr.multiplyComponents(t,this._radii,e)},Ra.prototype.equals=function(t){return this===t||Nr(t)&&Hr.equals(this._radii,t._radii)},Ra.prototype.toString=function(){return this._radii.toString()},Ra.prototype.getSurfaceNormalIntersectionWithZAxis=function(t,e,n){if(Qr.typeOf.object("position",t),!Ur.equalsEpsilon(this._radii.x,this._radii.y,Ur.EPSILON15))throw new Lr("Ellipsoid must be an ellipsoid of revolution (radii.x == radii.y)");Qr.typeOf.number.greaterThan("Ellipsoid.radii.z",this._radii.z,0),e=Pr(e,0);var r=this._squaredXOverSquaredZ;if(Nr(n)||(n=new Hr),n.x=0,n.y=0,n.z=t.z*(1-r),!(Math.abs(n.z)>=this._radii.z-e))return n},Fa.fromQuaternion=function(t,e){if(!Nr(t))throw new Lr("quaternion is required");Nr(e)||(e=new Fa);var n=2*(t.w*t.y-t.z*t.x),r=1-2*(t.x*t.x+t.y*t.y),i=2*(t.w*t.x+t.y*t.z),o=1-2*(t.y*t.y+t.z*t.z),a=2*(t.w*t.z+t.x*t.y);return e.heading=-Math.atan2(a,o),e.roll=Math.atan2(i,r),e.pitch=-Ur.asinClamped(n),e},Fa.fromDegrees=function(t,e,n,r){if(!Nr(t))throw new Lr("heading is required");if(!Nr(e))throw new Lr("pitch is required");if(!Nr(n))throw new Lr("roll is required");return Nr(r)||(r=new Fa),r.heading=t*Ur.RADIANS_PER_DEGREE,r.pitch=e*Ur.RADIANS_PER_DEGREE,r.roll=n*Ur.RADIANS_PER_DEGREE,r},Fa.clone=function(t,e){if(Nr(t))return Nr(e)?(e.heading=t.heading,e.pitch=t.pitch,e.roll=t.roll,e):new Fa(t.heading,t.pitch,t.roll)},Fa.equals=function(t,e){return t===e||Nr(t)&&Nr(e)&&t.heading===e.heading&&t.pitch===e.pitch&&t.roll===e.roll},Fa.equalsEpsilon=function(t,e,n,r){return t===e||Nr(t)&&Nr(e)&&Ur.equalsEpsilon(t.heading,e.heading,n,r)&&Ur.equalsEpsilon(t.pitch,e.pitch,n,r)&&Ur.equalsEpsilon(t.roll,e.roll,n,r)},Fa.prototype.clone=function(t){return Fa.clone(this,t)},Fa.prototype.equals=function(t){return Fa.equals(this,t)},Fa.prototype.equalsEpsilon=function(t,e,n){return Fa.equalsEpsilon(this,t,e,n)},Fa.prototype.toString=function(){return"("+this.heading+", "+this.pitch+", "+this.roll+")"};var Pa,ka,Ua,ja=/((?:.*\/)|^)Cesium\.js$/;function Ga(t){return"undefined"==typeof document?t:(Nr(Pa)||(Pa=document.createElement("a")),Pa.href=t,Pa.href=Pa.href,Pa.href)}function Ha(){if(Nr(ka))return ka;var t;if(t="undefined"!=typeof CESIUM_BASE_URL?CESIUM_BASE_URL:"object"==typeof define&&Nr(define.amd)&&!define.amd.toUrlUndefined&&Nr(require.toUrl)?wo("..",Ya("Core/buildModuleUrl.js")):function(){for(var t=document.getElementsByTagName("script"),e=0,n=t.length;e<n;++e){var r=t[e].getAttribute("src"),i=ja.exec(r);if(null!==i)return i[1]}}(),!Nr(t))throw new Lr("Unable to determine Cesium base URL automatically, try defining a global variable called CESIUM_BASE_URL.");return(ka=new ya({url:Ga(t)})).appendForwardSlash(),ka}function qa(t){return Ga(require.toUrl("../"+t))}function Va(t){return Ha().getDerivedResource({url:t}).url}function Ya(t){return Nr(Ua)||(Ua="object"==typeof define&&Nr(define.amd)&&!define.amd.toUrlUndefined&&Nr(require.toUrl)?qa:Va),Ua(t)}function Ka(t,e,n){this.x=t,this.y=e,this.s=n}function Wa(t){t=Pr(t,Pr.EMPTY_OBJECT),this._xysFileUrlTemplate=ya.createIfNeeded(t.xysFileUrlTemplate),this._interpolationOrder=Pr(t.interpolationOrder,9),this._sampleZeroJulianEphemerisDate=Pr(t.sampleZeroJulianEphemerisDate,2442396.5),this._sampleZeroDateTT=new Ao(this._sampleZeroJulianEphemerisDate,0,Wi.TAI),this._stepSizeDays=Pr(t.stepSizeDays,1),this._samplesPerXysFile=Pr(t.samplesPerXysFile,1e3),this._totalSamples=Pr(t.totalSamples,27426),this._samples=new Array(3*this._totalSamples),this._chunkDownloadsInProgress=[];for(var e=this._interpolationOrder,n=this._denominators=new Array(e+1),r=this._xTable=new Array(e+1),i=Math.pow(this._stepSizeDays,e),o=0;o<=e;++o){n[o]=i,r[o]=o*this._stepSizeDays;for(var a=0;a<=e;++a)a!==o&&(n[o]*=o-a);n[o]=1/n[o]}this._work=new Array(e+1),this._coef=new Array(e+1)}Ya._cesiumScriptRegex=ja,Ya._buildModuleUrlFromBaseUrl=Va,Ya._clearBaseResource=function(){ka=void 0},Ya.setBaseUrl=function(t){ka=ya.DEFAULT.getDerivedResource({url:t})},Ya.getCesiumBaseUrl=Ha;var Xa=new Ao(0,0,Wi.TAI);function Ja(t,e,n){var r=Xa;return r.dayNumber=e,r.secondsOfDay=n,Ao.daysDifference(r,t._sampleZeroDateTT)}function Za(t,e){if(t._chunkDownloadsInProgress[e])return t._chunkDownloadsInProgress[e];var n=Ai.defer();t._chunkDownloadsInProgress[e]=n;var r=t._xysFileUrlTemplate;return Ai((Nr(r)?r.getDerivedResource({templateValues:{0:e}}):new ya({url:Ya("Assets/IAU2006_XYS/IAU2006_XYS_"+e+".json")})).fetchJson(),(function(r){t._chunkDownloadsInProgress[e]=!1;for(var i=t._samples,o=r.samples,a=e*t._samplesPerXysFile*3,s=0,c=o.length;s<c;++s)i[a+s]=o[s];n.resolve()})),n.promise}function $a(t,e,n,r,i,o,a,s,c){this[0]=Pr(t,0),this[1]=Pr(r,0),this[2]=Pr(a,0),this[3]=Pr(e,0),this[4]=Pr(i,0),this[5]=Pr(s,0),this[6]=Pr(n,0),this[7]=Pr(o,0),this[8]=Pr(c,0)}Wa.prototype.preload=function(t,e,n,r){var i=Ja(this,t,e),o=Ja(this,n,r),a=i/this._stepSizeDays-this._interpolationOrder/2|0;a<0&&(a=0);var s=o/this._stepSizeDays-this._interpolationOrder/2|0+this._interpolationOrder;s>=this._totalSamples&&(s=this._totalSamples-1);for(var c=a/this._samplesPerXysFile|0,l=s/this._samplesPerXysFile|0,u=[],h=c;h<=l;++h)u.push(Za(this,h));return Ai.all(u)},Wa.prototype.computeXysRadians=function(t,e,n){var r=Ja(this,t,e);if(!(r<0)){var i=r/this._stepSizeDays|0;if(!(i>=this._totalSamples)){var o=this._interpolationOrder,a=i-(o/2|0);a<0&&(a=0);var s=a+o;s>=this._totalSamples&&(a=(s=this._totalSamples-1)-o)<0&&(a=0);var c=!1,l=this._samples;if(Nr(l[3*a])||(Za(this,a/this._samplesPerXysFile|0),c=!0),Nr(l[3*s])||(Za(this,s/this._samplesPerXysFile|0),c=!0),!c){Nr(n)?(n.x=0,n.y=0,n.s=0):n=new Ka(0,0,0);var u,h,f=r-a*this._stepSizeDays,d=this._work,p=this._denominators,A=this._coef,g=this._xTable;for(u=0;u<=o;++u)d[u]=f-g[u];for(u=0;u<=o;++u){for(A[u]=1,h=0;h<=o;++h)h!==u&&(A[u]*=d[h]);A[u]*=p[u];var m=3*(a+u);n.x+=A[u]*l[m++],n.y+=A[u]*l[m++],n.s+=A[u]*l[m]}return n}}}},$a.packedLength=9,$a.pack=function(t,e,n){return Qr.typeOf.object("value",t),Qr.defined("array",e),n=Pr(n,0),e[n++]=t[0],e[n++]=t[1],e[n++]=t[2],e[n++]=t[3],e[n++]=t[4],e[n++]=t[5],e[n++]=t[6],e[n++]=t[7],e[n++]=t[8],e},$a.unpack=function(t,e,n){return Qr.defined("array",t),e=Pr(e,0),Nr(n)||(n=new $a),n[0]=t[e++],n[1]=t[e++],n[2]=t[e++],n[3]=t[e++],n[4]=t[e++],n[5]=t[e++],n[6]=t[e++],n[7]=t[e++],n[8]=t[e++],n},$a.clone=function(t,e){if(Nr(t))return Nr(e)?(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e):new $a(t[0],t[3],t[6],t[1],t[4],t[7],t[2],t[5],t[8])},$a.fromArray=function(t,e,n){return Qr.defined("array",t),e=Pr(e,0),Nr(n)||(n=new $a),n[0]=t[e],n[1]=t[e+1],n[2]=t[e+2],n[3]=t[e+3],n[4]=t[e+4],n[5]=t[e+5],n[6]=t[e+6],n[7]=t[e+7],n[8]=t[e+8],n},$a.fromColumnMajorArray=function(t,e){return Qr.defined("values",t),$a.clone(t,e)},$a.fromRowMajorArray=function(t,e){return Qr.defined("values",t),Nr(e)?(e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],e):new $a(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8])},$a.fromQuaternion=function(t,e){Qr.typeOf.object("quaternion",t);var n=t.x*t.x,r=t.x*t.y,i=t.x*t.z,o=t.x*t.w,a=t.y*t.y,s=t.y*t.z,c=t.y*t.w,l=t.z*t.z,u=t.z*t.w,h=t.w*t.w,f=n-a-l+h,d=2*(r-u),p=2*(i+c),A=2*(r+u),g=-n+a-l+h,m=2*(s-o),y=2*(i-c),v=2*(s+o),C=-n-a+l+h;return Nr(e)?(e[0]=f,e[1]=A,e[2]=y,e[3]=d,e[4]=g,e[5]=v,e[6]=p,e[7]=m,e[8]=C,e):new $a(f,d,p,A,g,m,y,v,C)},$a.fromHeadingPitchRoll=function(t,e){Qr.typeOf.object("headingPitchRoll",t);var n=Math.cos(-t.pitch),r=Math.cos(-t.heading),i=Math.cos(t.roll),o=Math.sin(-t.pitch),a=Math.sin(-t.heading),s=Math.sin(t.roll),c=n*r,l=-i*a+s*o*r,u=s*a+i*o*r,h=n*a,f=i*r+s*o*a,d=-s*r+i*o*a,p=-o,A=s*n,g=i*n;return Nr(e)?(e[0]=c,e[1]=h,e[2]=p,e[3]=l,e[4]=f,e[5]=A,e[6]=u,e[7]=d,e[8]=g,e):new $a(c,l,u,h,f,d,p,A,g)},$a.fromScale=function(t,e){return Qr.typeOf.object("scale",t),Nr(e)?(e[0]=t.x,e[1]=0,e[2]=0,e[3]=0,e[4]=t.y,e[5]=0,e[6]=0,e[7]=0,e[8]=t.z,e):new $a(t.x,0,0,0,t.y,0,0,0,t.z)},$a.fromUniformScale=function(t,e){return Qr.typeOf.number("scale",t),Nr(e)?(e[0]=t,e[1]=0,e[2]=0,e[3]=0,e[4]=t,e[5]=0,e[6]=0,e[7]=0,e[8]=t,e):new $a(t,0,0,0,t,0,0,0,t)},$a.fromCrossProduct=function(t,e){return Qr.typeOf.object("vector",t),Nr(e)?(e[0]=0,e[1]=t.z,e[2]=-t.y,e[3]=-t.z,e[4]=0,e[5]=t.x,e[6]=t.y,e[7]=-t.x,e[8]=0,e):new $a(0,-t.z,t.y,t.z,0,-t.x,-t.y,t.x,0)},$a.fromRotationX=function(t,e){Qr.typeOf.number("angle",t);var n=Math.cos(t),r=Math.sin(t);return Nr(e)?(e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=n,e[5]=r,e[6]=0,e[7]=-r,e[8]=n,e):new $a(1,0,0,0,n,-r,0,r,n)},$a.fromRotationY=function(t,e){Qr.typeOf.number("angle",t);var n=Math.cos(t),r=Math.sin(t);return Nr(e)?(e[0]=n,e[1]=0,e[2]=-r,e[3]=0,e[4]=1,e[5]=0,e[6]=r,e[7]=0,e[8]=n,e):new $a(n,0,r,0,1,0,-r,0,n)},$a.fromRotationZ=function(t,e){Qr.typeOf.number("angle",t);var n=Math.cos(t),r=Math.sin(t);return Nr(e)?(e[0]=n,e[1]=r,e[2]=0,e[3]=-r,e[4]=n,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e):new $a(n,-r,0,r,n,0,0,0,1)},$a.toArray=function(t,e){return Qr.typeOf.object("matrix",t),Nr(e)?(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e):[t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8]]},$a.getElementIndex=function(t,e){return Qr.typeOf.number.greaterThanOrEquals("row",e,0),Qr.typeOf.number.lessThanOrEquals("row",e,2),Qr.typeOf.number.greaterThanOrEquals("column",t,0),Qr.typeOf.number.lessThanOrEquals("column",t,2),3*t+e},$a.getColumn=function(t,e,n){Qr.typeOf.object("matrix",t),Qr.typeOf.number.greaterThanOrEquals("index",e,0),Qr.typeOf.number.lessThanOrEquals("index",e,2),Qr.typeOf.object("result",n);var r=3*e,i=t[r],o=t[r+1],a=t[r+2];return n.x=i,n.y=o,n.z=a,n},$a.setColumn=function(t,e,n,r){Qr.typeOf.object("matrix",t),Qr.typeOf.number.greaterThanOrEquals("index",e,0),Qr.typeOf.number.lessThanOrEquals("index",e,2),Qr.typeOf.object("cartesian",n),Qr.typeOf.object("result",r);var i=3*e;return(r=$a.clone(t,r))[i]=n.x,r[i+1]=n.y,r[i+2]=n.z,r},$a.getRow=function(t,e,n){Qr.typeOf.object("matrix",t),Qr.typeOf.number.greaterThanOrEquals("index",e,0),Qr.typeOf.number.lessThanOrEquals("index",e,2),Qr.typeOf.object("result",n);var r=t[e],i=t[e+3],o=t[e+6];return n.x=r,n.y=i,n.z=o,n},$a.setRow=function(t,e,n,r){return Qr.typeOf.object("matrix",t),Qr.typeOf.number.greaterThanOrEquals("index",e,0),Qr.typeOf.number.lessThanOrEquals("index",e,2),Qr.typeOf.object("cartesian",n),Qr.typeOf.object("result",r),(r=$a.clone(t,r))[e]=n.x,r[e+3]=n.y,r[e+6]=n.z,r};var ts=new Hr;$a.getScale=function(t,e){return Qr.typeOf.object("matrix",t),Qr.typeOf.object("result",e),e.x=Hr.magnitude(Hr.fromElements(t[0],t[1],t[2],ts)),e.y=Hr.magnitude(Hr.fromElements(t[3],t[4],t[5],ts)),e.z=Hr.magnitude(Hr.fromElements(t[6],t[7],t[8],ts)),e};var es=new Hr;$a.getMaximumScale=function(t){return $a.getScale(t,es),Hr.maximumComponent(es)},$a.multiply=function(t,e,n){Qr.typeOf.object("left",t),Qr.typeOf.object("right",e),Qr.typeOf.object("result",n);var r=t[0]*e[0]+t[3]*e[1]+t[6]*e[2],i=t[1]*e[0]+t[4]*e[1]+t[7]*e[2],o=t[2]*e[0]+t[5]*e[1]+t[8]*e[2],a=t[0]*e[3]+t[3]*e[4]+t[6]*e[5],s=t[1]*e[3]+t[4]*e[4]+t[7]*e[5],c=t[2]*e[3]+t[5]*e[4]+t[8]*e[5],l=t[0]*e[6]+t[3]*e[7]+t[6]*e[8],u=t[1]*e[6]+t[4]*e[7]+t[7]*e[8],h=t[2]*e[6]+t[5]*e[7]+t[8]*e[8];return n[0]=r,n[1]=i,n[2]=o,n[3]=a,n[4]=s,n[5]=c,n[6]=l,n[7]=u,n[8]=h,n},$a.add=function(t,e,n){return Qr.typeOf.object("left",t),Qr.typeOf.object("right",e),Qr.typeOf.object("result",n),n[0]=t[0]+e[0],n[1]=t[1]+e[1],n[2]=t[2]+e[2],n[3]=t[3]+e[3],n[4]=t[4]+e[4],n[5]=t[5]+e[5],n[6]=t[6]+e[6],n[7]=t[7]+e[7],n[8]=t[8]+e[8],n},$a.subtract=function(t,e,n){return Qr.typeOf.object("left",t),Qr.typeOf.object("right",e),Qr.typeOf.object("result",n),n[0]=t[0]-e[0],n[1]=t[1]-e[1],n[2]=t[2]-e[2],n[3]=t[3]-e[3],n[4]=t[4]-e[4],n[5]=t[5]-e[5],n[6]=t[6]-e[6],n[7]=t[7]-e[7],n[8]=t[8]-e[8],n},$a.multiplyByVector=function(t,e,n){Qr.typeOf.object("matrix",t),Qr.typeOf.object("cartesian",e),Qr.typeOf.object("result",n);var r=e.x,i=e.y,o=e.z,a=t[0]*r+t[3]*i+t[6]*o,s=t[1]*r+t[4]*i+t[7]*o,c=t[2]*r+t[5]*i+t[8]*o;return n.x=a,n.y=s,n.z=c,n},$a.multiplyByScalar=function(t,e,n){return Qr.typeOf.object("matrix",t),Qr.typeOf.number("scalar",e),Qr.typeOf.object("result",n),n[0]=t[0]*e,n[1]=t[1]*e,n[2]=t[2]*e,n[3]=t[3]*e,n[4]=t[4]*e,n[5]=t[5]*e,n[6]=t[6]*e,n[7]=t[7]*e,n[8]=t[8]*e,n},$a.multiplyByScale=function(t,e,n){return Qr.typeOf.object("matrix",t),Qr.typeOf.object("scale",e),Qr.typeOf.object("result",n),n[0]=t[0]*e.x,n[1]=t[1]*e.x,n[2]=t[2]*e.x,n[3]=t[3]*e.y,n[4]=t[4]*e.y,n[5]=t[5]*e.y,n[6]=t[6]*e.z,n[7]=t[7]*e.z,n[8]=t[8]*e.z,n},$a.negate=function(t,e){return Qr.typeOf.object("matrix",t),Qr.typeOf.object("result",e),e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=-t[3],e[4]=-t[4],e[5]=-t[5],e[6]=-t[6],e[7]=-t[7],e[8]=-t[8],e},$a.transpose=function(t,e){Qr.typeOf.object("matrix",t),Qr.typeOf.object("result",e);var n=t[0],r=t[3],i=t[6],o=t[1],a=t[4],s=t[7],c=t[2],l=t[5],u=t[8];return e[0]=n,e[1]=r,e[2]=i,e[3]=o,e[4]=a,e[5]=s,e[6]=c,e[7]=l,e[8]=u,e};var ns=new Hr(1,1,1);$a.getRotation=function(t,e){Qr.typeOf.object("matrix",t),Qr.typeOf.object("result",e);var n=Hr.divideComponents(ns,$a.getScale(t,es),es);return e=$a.multiplyByScale(t,n,e)};var rs=[1,0,0],is=[2,2,1];function os(t){for(var e=0,n=0;n<3;++n){var r=t[$a.getElementIndex(is[n],rs[n])];e+=2*r*r}return Math.sqrt(e)}function as(t,e){for(var n=Ur.EPSILON15,r=0,i=1,o=0;o<3;++o){var a=Math.abs(t[$a.getElementIndex(is[o],rs[o])]);a>r&&(i=o,r=a)}var s=1,c=0,l=rs[i],u=is[i];if(Math.abs(t[$a.getElementIndex(u,l)])>n){var h,f=(t[$a.getElementIndex(u,u)]-t[$a.getElementIndex(l,l)])/2/t[$a.getElementIndex(u,l)];c=(h=f<0?-1/(-f+Math.sqrt(1+f*f)):1/(f+Math.sqrt(1+f*f)))*(s=1/Math.sqrt(1+h*h))}return(e=$a.clone($a.IDENTITY,e))[$a.getElementIndex(l,l)]=e[$a.getElementIndex(u,u)]=s,e[$a.getElementIndex(u,l)]=c,e[$a.getElementIndex(l,u)]=-c,e}var ss=new $a,cs=new $a;function ls(t,e,n,r,i,o,a,s,c,l,u,h,f,d,p,A){this[0]=Pr(t,0),this[1]=Pr(i,0),this[2]=Pr(c,0),this[3]=Pr(f,0),this[4]=Pr(e,0),this[5]=Pr(o,0),this[6]=Pr(l,0),this[7]=Pr(d,0),this[8]=Pr(n,0),this[9]=Pr(a,0),this[10]=Pr(u,0),this[11]=Pr(p,0),this[12]=Pr(r,0),this[13]=Pr(s,0),this[14]=Pr(h,0),this[15]=Pr(A,0)}$a.computeEigenDecomposition=function(t,e){Qr.typeOf.object("matrix",t);var n=Ur.EPSILON20,r=0,i=0;Nr(e)||(e={});for(var o=e.unitary=$a.clone($a.IDENTITY,e.unitary),a=e.diagonal=$a.clone(t,e.diagonal),s=n*function(t){for(var e=0,n=0;n<9;++n){var r=t[n];e+=r*r}return Math.sqrt(e)}(a);i<10&&os(a)>s;)as(a,ss),$a.transpose(ss,cs),$a.multiply(a,ss,a),$a.multiply(cs,a,a),$a.multiply(o,ss,o),++r>2&&(++i,r=0);return e},$a.abs=function(t,e){return Qr.typeOf.object("matrix",t),Qr.typeOf.object("result",e),e[0]=Math.abs(t[0]),e[1]=Math.abs(t[1]),e[2]=Math.abs(t[2]),e[3]=Math.abs(t[3]),e[4]=Math.abs(t[4]),e[5]=Math.abs(t[5]),e[6]=Math.abs(t[6]),e[7]=Math.abs(t[7]),e[8]=Math.abs(t[8]),e},$a.determinant=function(t){Qr.typeOf.object("matrix",t);var e=t[0],n=t[3],r=t[6],i=t[1],o=t[4],a=t[7],s=t[2],c=t[5],l=t[8];return e*(o*l-c*a)+i*(c*r-n*l)+s*(n*a-o*r)},$a.inverse=function(t,e){Qr.typeOf.object("matrix",t),Qr.typeOf.object("result",e);var n=t[0],r=t[1],i=t[2],o=t[3],a=t[4],s=t[5],c=t[6],l=t[7],u=t[8],h=$a.determinant(t);if(Math.abs(h)<=Ur.EPSILON15)throw new Lr("matrix is not invertible");e[0]=a*u-l*s,e[1]=l*i-r*u,e[2]=r*s-a*i,e[3]=c*s-o*u,e[4]=n*u-c*i,e[5]=o*i-n*s,e[6]=o*l-c*a,e[7]=c*r-n*l,e[8]=n*a-o*r;var f=1/h;return $a.multiplyByScalar(e,f,e)},$a.equals=function(t,e){return t===e||Nr(t)&&Nr(e)&&t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]},$a.equalsEpsilon=function(t,e,n){return Qr.typeOf.number("epsilon",n),t===e||Nr(t)&&Nr(e)&&Math.abs(t[0]-e[0])<=n&&Math.abs(t[1]-e[1])<=n&&Math.abs(t[2]-e[2])<=n&&Math.abs(t[3]-e[3])<=n&&Math.abs(t[4]-e[4])<=n&&Math.abs(t[5]-e[5])<=n&&Math.abs(t[6]-e[6])<=n&&Math.abs(t[7]-e[7])<=n&&Math.abs(t[8]-e[8])<=n},$a.IDENTITY=Object.freeze(new $a(1,0,0,0,1,0,0,0,1)),$a.ZERO=Object.freeze(new $a(0,0,0,0,0,0,0,0,0)),$a.COLUMN0ROW0=0,$a.COLUMN0ROW1=1,$a.COLUMN0ROW2=2,$a.COLUMN1ROW0=3,$a.COLUMN1ROW1=4,$a.COLUMN1ROW2=5,$a.COLUMN2ROW0=6,$a.COLUMN2ROW1=7,$a.COLUMN2ROW2=8,Object.defineProperties($a.prototype,{length:{get:function(){return $a.packedLength}}}),$a.prototype.clone=function(t){return $a.clone(this,t)},$a.prototype.equals=function(t){return $a.equals(this,t)},$a.equalsArray=function(t,e,n){return t[0]===e[n]&&t[1]===e[n+1]&&t[2]===e[n+2]&&t[3]===e[n+3]&&t[4]===e[n+4]&&t[5]===e[n+5]&&t[6]===e[n+6]&&t[7]===e[n+7]&&t[8]===e[n+8]},$a.prototype.equalsEpsilon=function(t,e){return $a.equalsEpsilon(this,t,e)},$a.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n("+this[1]+", "+this[4]+", "+this[7]+")\n("+this[2]+", "+this[5]+", "+this[8]+")"},ls.packedLength=16,ls.pack=function(t,e,n){return Qr.typeOf.object("value",t),Qr.defined("array",e),n=Pr(n,0),e[n++]=t[0],e[n++]=t[1],e[n++]=t[2],e[n++]=t[3],e[n++]=t[4],e[n++]=t[5],e[n++]=t[6],e[n++]=t[7],e[n++]=t[8],e[n++]=t[9],e[n++]=t[10],e[n++]=t[11],e[n++]=t[12],e[n++]=t[13],e[n++]=t[14],e[n]=t[15],e},ls.unpack=function(t,e,n){return Qr.defined("array",t),e=Pr(e,0),Nr(n)||(n=new ls),n[0]=t[e++],n[1]=t[e++],n[2]=t[e++],n[3]=t[e++],n[4]=t[e++],n[5]=t[e++],n[6]=t[e++],n[7]=t[e++],n[8]=t[e++],n[9]=t[e++],n[10]=t[e++],n[11]=t[e++],n[12]=t[e++],n[13]=t[e++],n[14]=t[e++],n[15]=t[e],n},ls.clone=function(t,e){if(Nr(t))return Nr(e)?(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e):new ls(t[0],t[4],t[8],t[12],t[1],t[5],t[9],t[13],t[2],t[6],t[10],t[14],t[3],t[7],t[11],t[15])},ls.fromArray=ls.unpack,ls.fromColumnMajorArray=function(t,e){return Qr.defined("values",t),ls.clone(t,e)},ls.fromRowMajorArray=function(t,e){return Qr.defined("values",t),Nr(e)?(e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=t[1],e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=t[2],e[9]=t[6],e[10]=t[10],e[11]=t[14],e[12]=t[3],e[13]=t[7],e[14]=t[11],e[15]=t[15],e):new ls(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])},ls.fromRotationTranslation=function(t,e,n){return Qr.typeOf.object("rotation",t),e=Pr(e,Hr.ZERO),Nr(n)?(n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=0,n[4]=t[3],n[5]=t[4],n[6]=t[5],n[7]=0,n[8]=t[6],n[9]=t[7],n[10]=t[8],n[11]=0,n[12]=e.x,n[13]=e.y,n[14]=e.z,n[15]=1,n):new ls(t[0],t[3],t[6],e.x,t[1],t[4],t[7],e.y,t[2],t[5],t[8],e.z,0,0,0,1)},ls.fromTranslationQuaternionRotationScale=function(t,e,n,r){Qr.typeOf.object("translation",t),Qr.typeOf.object("rotation",e),Qr.typeOf.object("scale",n),Nr(r)||(r=new ls);var i=n.x,o=n.y,a=n.z,s=e.x*e.x,c=e.x*e.y,l=e.x*e.z,u=e.x*e.w,h=e.y*e.y,f=e.y*e.z,d=e.y*e.w,p=e.z*e.z,A=e.z*e.w,g=e.w*e.w,m=s-h-p+g,y=2*(c-A),v=2*(l+d),C=2*(c+A),I=-s+h-p+g,x=2*(f-u),E=2*(l-d),_=2*(f+u),b=-s-h+p+g;return r[0]=m*i,r[1]=C*i,r[2]=E*i,r[3]=0,r[4]=y*o,r[5]=I*o,r[6]=_*o,r[7]=0,r[8]=v*a,r[9]=x*a,r[10]=b*a,r[11]=0,r[12]=t.x,r[13]=t.y,r[14]=t.z,r[15]=1,r},ls.fromTranslationRotationScale=function(t,e){return Qr.typeOf.object("translationRotationScale",t),ls.fromTranslationQuaternionRotationScale(t.translation,t.rotation,t.scale,e)},ls.fromTranslation=function(t,e){return Qr.typeOf.object("translation",t),ls.fromRotationTranslation($a.IDENTITY,t,e)},ls.fromScale=function(t,e){return Qr.typeOf.object("scale",t),Nr(e)?(e[0]=t.x,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=t.y,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=t.z,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e):new ls(t.x,0,0,0,0,t.y,0,0,0,0,t.z,0,0,0,0,1)},ls.fromUniformScale=function(t,e){return Qr.typeOf.number("scale",t),Nr(e)?(e[0]=t,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=t,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=t,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e):new ls(t,0,0,0,0,t,0,0,0,0,t,0,0,0,0,1)};var us=new Hr,hs=new Hr,fs=new Hr;ls.fromCamera=function(t,e){Qr.typeOf.object("camera",t);var n=t.position,r=t.direction,i=t.up;Qr.typeOf.object("camera.position",n),Qr.typeOf.object("camera.direction",r),Qr.typeOf.object("camera.up",i),Hr.normalize(r,us),Hr.normalize(Hr.cross(us,i,hs),hs),Hr.normalize(Hr.cross(hs,us,fs),fs);var o=hs.x,a=hs.y,s=hs.z,c=us.x,l=us.y,u=us.z,h=fs.x,f=fs.y,d=fs.z,p=n.x,A=n.y,g=n.z,m=o*-p+a*-A+s*-g,y=h*-p+f*-A+d*-g,v=c*p+l*A+u*g;return Nr(e)?(e[0]=o,e[1]=h,e[2]=-c,e[3]=0,e[4]=a,e[5]=f,e[6]=-l,e[7]=0,e[8]=s,e[9]=d,e[10]=-u,e[11]=0,e[12]=m,e[13]=y,e[14]=v,e[15]=1,e):new ls(o,a,s,m,h,f,d,y,-c,-l,-u,v,0,0,0,1)},ls.computePerspectiveFieldOfView=function(t,e,n,r,i){Qr.typeOf.number.greaterThan("fovY",t,0),Qr.typeOf.number.lessThan("fovY",t,Math.PI),Qr.typeOf.number.greaterThan("near",n,0),Qr.typeOf.number.greaterThan("far",r,0),Qr.typeOf.object("result",i);var o=1/Math.tan(.5*t),a=o/e,s=(r+n)/(n-r),c=2*r*n/(n-r);return i[0]=a,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=o,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=s,i[11]=-1,i[12]=0,i[13]=0,i[14]=c,i[15]=0,i},ls.computeOrthographicOffCenter=function(t,e,n,r,i,o,a){Qr.typeOf.number("left",t),Qr.typeOf.number("right",e),Qr.typeOf.number("bottom",n),Qr.typeOf.number("top",r),Qr.typeOf.number("near",i),Qr.typeOf.number("far",o),Qr.typeOf.object("result",a);var s=1/(e-t),c=1/(r-n),l=1/(o-i),u=-(e+t)*s,h=-(r+n)*c,f=-(o+i)*l;return s*=2,c*=2,l*=-2,a[0]=s,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=c,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=l,a[11]=0,a[12]=u,a[13]=h,a[14]=f,a[15]=1,a},ls.computePerspectiveOffCenter=function(t,e,n,r,i,o,a){Qr.typeOf.number("left",t),Qr.typeOf.number("right",e),Qr.typeOf.number("bottom",n),Qr.typeOf.number("top",r),Qr.typeOf.number("near",i),Qr.typeOf.number("far",o),Qr.typeOf.object("result",a);var s=2*i/(e-t),c=2*i/(r-n),l=(e+t)/(e-t),u=(r+n)/(r-n),h=-(o+i)/(o-i),f=-2*o*i/(o-i);return a[0]=s,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=c,a[6]=0,a[7]=0,a[8]=l,a[9]=u,a[10]=h,a[11]=-1,a[12]=0,a[13]=0,a[14]=f,a[15]=0,a},ls.computeInfinitePerspectiveOffCenter=function(t,e,n,r,i,o){Qr.typeOf.number("left",t),Qr.typeOf.number("right",e),Qr.typeOf.number("bottom",n),Qr.typeOf.number("top",r),Qr.typeOf.number("near",i),Qr.typeOf.object("result",o);var a=2*i/(e-t),s=2*i/(r-n),c=(e+t)/(e-t),l=(r+n)/(r-n),u=-2*i;return o[0]=a,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=s,o[6]=0,o[7]=0,o[8]=c,o[9]=l,o[10]=-1,o[11]=-1,o[12]=0,o[13]=0,o[14]=u,o[15]=0,o},ls.computeViewportTransformation=function(t,e,n,r){Qr.typeOf.object("result",r),t=Pr(t,Pr.EMPTY_OBJECT);var i=Pr(t.x,0),o=Pr(t.y,0),a=Pr(t.width,0),s=Pr(t.height,0);e=Pr(e,0);var c=.5*a,l=.5*s,u=.5*((n=Pr(n,1))-e),h=c,f=l,d=u,p=i+c,A=o+l,g=e+u;return r[0]=h,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=f,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=d,r[11]=0,r[12]=p,r[13]=A,r[14]=g,r[15]=1,r},ls.computeView=function(t,e,n,r,i){return Qr.typeOf.object("position",t),Qr.typeOf.object("direction",e),Qr.typeOf.object("up",n),Qr.typeOf.object("right",r),Qr.typeOf.object("result",i),i[0]=r.x,i[1]=n.x,i[2]=-e.x,i[3]=0,i[4]=r.y,i[5]=n.y,i[6]=-e.y,i[7]=0,i[8]=r.z,i[9]=n.z,i[10]=-e.z,i[11]=0,i[12]=-Hr.dot(r,t),i[13]=-Hr.dot(n,t),i[14]=Hr.dot(e,t),i[15]=1,i},ls.toArray=function(t,e){return Qr.typeOf.object("matrix",t),Nr(e)?(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e):[t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15]]},ls.getElementIndex=function(t,e){return Qr.typeOf.number.greaterThanOrEquals("row",e,0),Qr.typeOf.number.lessThanOrEquals("row",e,3),Qr.typeOf.number.greaterThanOrEquals("column",t,0),Qr.typeOf.number.lessThanOrEquals("column",t,3),4*t+e},ls.getColumn=function(t,e,n){Qr.typeOf.object("matrix",t),Qr.typeOf.number.greaterThanOrEquals("index",e,0),Qr.typeOf.number.lessThanOrEquals("index",e,3),Qr.typeOf.object("result",n);var r=4*e,i=t[r],o=t[r+1],a=t[r+2],s=t[r+3];return n.x=i,n.y=o,n.z=a,n.w=s,n},ls.setColumn=function(t,e,n,r){Qr.typeOf.object("matrix",t),Qr.typeOf.number.greaterThanOrEquals("index",e,0),Qr.typeOf.number.lessThanOrEquals("index",e,3),Qr.typeOf.object("cartesian",n),Qr.typeOf.object("result",r);var i=4*e;return(r=ls.clone(t,r))[i]=n.x,r[i+1]=n.y,r[i+2]=n.z,r[i+3]=n.w,r},ls.setTranslation=function(t,e,n){return Qr.typeOf.object("matrix",t),Qr.typeOf.object("translation",e),Qr.typeOf.object("result",n),n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n[4]=t[4],n[5]=t[5],n[6]=t[6],n[7]=t[7],n[8]=t[8],n[9]=t[9],n[10]=t[10],n[11]=t[11],n[12]=e.x,n[13]=e.y,n[14]=e.z,n[15]=t[15],n};var ds=new Hr;ls.setScale=function(t,e,n){Qr.typeOf.object("matrix",t),Qr.typeOf.object("scale",e),Qr.typeOf.object("result",n);var r=ls.getScale(t,ds),i=Hr.divideComponents(e,r,ds);return ls.multiplyByScale(t,i,n)},ls.getRow=function(t,e,n){Qr.typeOf.object("matrix",t),Qr.typeOf.number.greaterThanOrEquals("index",e,0),Qr.typeOf.number.lessThanOrEquals("index",e,3),Qr.typeOf.object("result",n);var r=t[e],i=t[e+4],o=t[e+8],a=t[e+12];return n.x=r,n.y=i,n.z=o,n.w=a,n},ls.setRow=function(t,e,n,r){return Qr.typeOf.object("matrix",t),Qr.typeOf.number.greaterThanOrEquals("index",e,0),Qr.typeOf.number.lessThanOrEquals("index",e,3),Qr.typeOf.object("cartesian",n),Qr.typeOf.object("result",r),(r=ls.clone(t,r))[e]=n.x,r[e+4]=n.y,r[e+8]=n.z,r[e+12]=n.w,r};var ps=new Hr;ls.getScale=function(t,e){return Qr.typeOf.object("matrix",t),Qr.typeOf.object("result",e),e.x=Hr.magnitude(Hr.fromElements(t[0],t[1],t[2],ps)),e.y=Hr.magnitude(Hr.fromElements(t[4],t[5],t[6],ps)),e.z=Hr.magnitude(Hr.fromElements(t[8],t[9],t[10],ps)),e};var As=new Hr;ls.getMaximumScale=function(t){return ls.getScale(t,As),Hr.maximumComponent(As)},ls.multiply=function(t,e,n){Qr.typeOf.object("left",t),Qr.typeOf.object("right",e),Qr.typeOf.object("result",n);var r=t[0],i=t[1],o=t[2],a=t[3],s=t[4],c=t[5],l=t[6],u=t[7],h=t[8],f=t[9],d=t[10],p=t[11],A=t[12],g=t[13],m=t[14],y=t[15],v=e[0],C=e[1],I=e[2],x=e[3],E=e[4],_=e[5],b=e[6],w=e[7],M=e[8],T=e[9],B=e[10],S=e[11],D=e[12],R=e[13],z=e[14],O=e[15],N=r*v+s*C+h*I+A*x,L=i*v+c*C+f*I+g*x,Q=o*v+l*C+d*I+m*x,F=a*v+u*C+p*I+y*x,P=r*E+s*_+h*b+A*w,k=i*E+c*_+f*b+g*w,U=o*E+l*_+d*b+m*w,j=a*E+u*_+p*b+y*w,G=r*M+s*T+h*B+A*S,H=i*M+c*T+f*B+g*S,q=o*M+l*T+d*B+m*S,V=a*M+u*T+p*B+y*S,Y=r*D+s*R+h*z+A*O,K=i*D+c*R+f*z+g*O,W=o*D+l*R+d*z+m*O,X=a*D+u*R+p*z+y*O;return n[0]=N,n[1]=L,n[2]=Q,n[3]=F,n[4]=P,n[5]=k,n[6]=U,n[7]=j,n[8]=G,n[9]=H,n[10]=q,n[11]=V,n[12]=Y,n[13]=K,n[14]=W,n[15]=X,n},ls.add=function(t,e,n){return Qr.typeOf.object("left",t),Qr.typeOf.object("right",e),Qr.typeOf.object("result",n),n[0]=t[0]+e[0],n[1]=t[1]+e[1],n[2]=t[2]+e[2],n[3]=t[3]+e[3],n[4]=t[4]+e[4],n[5]=t[5]+e[5],n[6]=t[6]+e[6],n[7]=t[7]+e[7],n[8]=t[8]+e[8],n[9]=t[9]+e[9],n[10]=t[10]+e[10],n[11]=t[11]+e[11],n[12]=t[12]+e[12],n[13]=t[13]+e[13],n[14]=t[14]+e[14],n[15]=t[15]+e[15],n},ls.subtract=function(t,e,n){return Qr.typeOf.object("left",t),Qr.typeOf.object("right",e),Qr.typeOf.object("result",n),n[0]=t[0]-e[0],n[1]=t[1]-e[1],n[2]=t[2]-e[2],n[3]=t[3]-e[3],n[4]=t[4]-e[4],n[5]=t[5]-e[5],n[6]=t[6]-e[6],n[7]=t[7]-e[7],n[8]=t[8]-e[8],n[9]=t[9]-e[9],n[10]=t[10]-e[10],n[11]=t[11]-e[11],n[12]=t[12]-e[12],n[13]=t[13]-e[13],n[14]=t[14]-e[14],n[15]=t[15]-e[15],n},ls.multiplyTransformation=function(t,e,n){Qr.typeOf.object("left",t),Qr.typeOf.object("right",e),Qr.typeOf.object("result",n);var r=t[0],i=t[1],o=t[2],a=t[4],s=t[5],c=t[6],l=t[8],u=t[9],h=t[10],f=t[12],d=t[13],p=t[14],A=e[0],g=e[1],m=e[2],y=e[4],v=e[5],C=e[6],I=e[8],x=e[9],E=e[10],_=e[12],b=e[13],w=e[14],M=r*A+a*g+l*m,T=i*A+s*g+u*m,B=o*A+c*g+h*m,S=r*y+a*v+l*C,D=i*y+s*v+u*C,R=o*y+c*v+h*C,z=r*I+a*x+l*E,O=i*I+s*x+u*E,N=o*I+c*x+h*E,L=r*_+a*b+l*w+f,Q=i*_+s*b+u*w+d,F=o*_+c*b+h*w+p;return n[0]=M,n[1]=T,n[2]=B,n[3]=0,n[4]=S,n[5]=D,n[6]=R,n[7]=0,n[8]=z,n[9]=O,n[10]=N,n[11]=0,n[12]=L,n[13]=Q,n[14]=F,n[15]=1,n},ls.multiplyByMatrix3=function(t,e,n){Qr.typeOf.object("matrix",t),Qr.typeOf.object("rotation",e),Qr.typeOf.object("result",n);var r=t[0],i=t[1],o=t[2],a=t[4],s=t[5],c=t[6],l=t[8],u=t[9],h=t[10],f=e[0],d=e[1],p=e[2],A=e[3],g=e[4],m=e[5],y=e[6],v=e[7],C=e[8],I=r*f+a*d+l*p,x=i*f+s*d+u*p,E=o*f+c*d+h*p,_=r*A+a*g+l*m,b=i*A+s*g+u*m,w=o*A+c*g+h*m,M=r*y+a*v+l*C,T=i*y+s*v+u*C,B=o*y+c*v+h*C;return n[0]=I,n[1]=x,n[2]=E,n[3]=0,n[4]=_,n[5]=b,n[6]=w,n[7]=0,n[8]=M,n[9]=T,n[10]=B,n[11]=0,n[12]=t[12],n[13]=t[13],n[14]=t[14],n[15]=t[15],n},ls.multiplyByTranslation=function(t,e,n){Qr.typeOf.object("matrix",t),Qr.typeOf.object("translation",e),Qr.typeOf.object("result",n);var r=e.x,i=e.y,o=e.z,a=r*t[0]+i*t[4]+o*t[8]+t[12],s=r*t[1]+i*t[5]+o*t[9]+t[13],c=r*t[2]+i*t[6]+o*t[10]+t[14];return n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n[4]=t[4],n[5]=t[5],n[6]=t[6],n[7]=t[7],n[8]=t[8],n[9]=t[9],n[10]=t[10],n[11]=t[11],n[12]=a,n[13]=s,n[14]=c,n[15]=t[15],n};var gs=new Hr;ls.multiplyByUniformScale=function(t,e,n){return Qr.typeOf.object("matrix",t),Qr.typeOf.number("scale",e),Qr.typeOf.object("result",n),gs.x=e,gs.y=e,gs.z=e,ls.multiplyByScale(t,gs,n)},ls.multiplyByScale=function(t,e,n){Qr.typeOf.object("matrix",t),Qr.typeOf.object("scale",e),Qr.typeOf.object("result",n);var r=e.x,i=e.y,o=e.z;return 1===r&&1===i&&1===o?ls.clone(t,n):(n[0]=r*t[0],n[1]=r*t[1],n[2]=r*t[2],n[3]=0,n[4]=i*t[4],n[5]=i*t[5],n[6]=i*t[6],n[7]=0,n[8]=o*t[8],n[9]=o*t[9],n[10]=o*t[10],n[11]=0,n[12]=t[12],n[13]=t[13],n[14]=t[14],n[15]=1,n)},ls.multiplyByVector=function(t,e,n){Qr.typeOf.object("matrix",t),Qr.typeOf.object("cartesian",e),Qr.typeOf.object("result",n);var r=e.x,i=e.y,o=e.z,a=e.w,s=t[0]*r+t[4]*i+t[8]*o+t[12]*a,c=t[1]*r+t[5]*i+t[9]*o+t[13]*a,l=t[2]*r+t[6]*i+t[10]*o+t[14]*a,u=t[3]*r+t[7]*i+t[11]*o+t[15]*a;return n.x=s,n.y=c,n.z=l,n.w=u,n},ls.multiplyByPointAsVector=function(t,e,n){Qr.typeOf.object("matrix",t),Qr.typeOf.object("cartesian",e),Qr.typeOf.object("result",n);var r=e.x,i=e.y,o=e.z,a=t[0]*r+t[4]*i+t[8]*o,s=t[1]*r+t[5]*i+t[9]*o,c=t[2]*r+t[6]*i+t[10]*o;return n.x=a,n.y=s,n.z=c,n},ls.multiplyByPoint=function(t,e,n){Qr.typeOf.object("matrix",t),Qr.typeOf.object("cartesian",e),Qr.typeOf.object("result",n);var r=e.x,i=e.y,o=e.z,a=t[0]*r+t[4]*i+t[8]*o+t[12],s=t[1]*r+t[5]*i+t[9]*o+t[13],c=t[2]*r+t[6]*i+t[10]*o+t[14];return n.x=a,n.y=s,n.z=c,n},ls.multiplyByScalar=function(t,e,n){return Qr.typeOf.object("matrix",t),Qr.typeOf.number("scalar",e),Qr.typeOf.object("result",n),n[0]=t[0]*e,n[1]=t[1]*e,n[2]=t[2]*e,n[3]=t[3]*e,n[4]=t[4]*e,n[5]=t[5]*e,n[6]=t[6]*e,n[7]=t[7]*e,n[8]=t[8]*e,n[9]=t[9]*e,n[10]=t[10]*e,n[11]=t[11]*e,n[12]=t[12]*e,n[13]=t[13]*e,n[14]=t[14]*e,n[15]=t[15]*e,n},ls.multiplyByPlane=function(t,e,n){Qr.typeOf.object("matrix",t),Qr.typeOf.object("plane",e),Qr.typeOf.object("result",n);var r=new ls,i=new ls;ls.inverse(t,r),ls.transpose(r,i);var o=new Oi(e.normal.x,e.normal.y,e.normal.z,e.distance);ls.multiplyByVector(i,o,o),n.normal.x=o.x,n.normal.y=o.y,n.normal.z=o.z;var a=Hr.magnitude(n.normal);return Hr.normalize(n.normal,n.normal),n.distance=o.w/a,n},ls.negate=function(t,e){return Qr.typeOf.object("matrix",t),Qr.typeOf.object("result",e),e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=-t[3],e[4]=-t[4],e[5]=-t[5],e[6]=-t[6],e[7]=-t[7],e[8]=-t[8],e[9]=-t[9],e[10]=-t[10],e[11]=-t[11],e[12]=-t[12],e[13]=-t[13],e[14]=-t[14],e[15]=-t[15],e},ls.transpose=function(t,e){Qr.typeOf.object("matrix",t),Qr.typeOf.object("result",e);var n=t[1],r=t[2],i=t[3],o=t[6],a=t[7],s=t[11];return e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=n,e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=r,e[9]=o,e[10]=t[10],e[11]=t[14],e[12]=i,e[13]=a,e[14]=s,e[15]=t[15],e},ls.abs=function(t,e){return Qr.typeOf.object("matrix",t),Qr.typeOf.object("result",e),e[0]=Math.abs(t[0]),e[1]=Math.abs(t[1]),e[2]=Math.abs(t[2]),e[3]=Math.abs(t[3]),e[4]=Math.abs(t[4]),e[5]=Math.abs(t[5]),e[6]=Math.abs(t[6]),e[7]=Math.abs(t[7]),e[8]=Math.abs(t[8]),e[9]=Math.abs(t[9]),e[10]=Math.abs(t[10]),e[11]=Math.abs(t[11]),e[12]=Math.abs(t[12]),e[13]=Math.abs(t[13]),e[14]=Math.abs(t[14]),e[15]=Math.abs(t[15]),e},ls.equals=function(t,e){return t===e||Nr(t)&&Nr(e)&&t[12]===e[12]&&t[13]===e[13]&&t[14]===e[14]&&t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[8]===e[8]&&t[9]===e[9]&&t[10]===e[10]&&t[3]===e[3]&&t[7]===e[7]&&t[11]===e[11]&&t[15]===e[15]},ls.equalsEpsilon=function(t,e,n){return Qr.typeOf.number("epsilon",n),t===e||Nr(t)&&Nr(e)&&Math.abs(t[0]-e[0])<=n&&Math.abs(t[1]-e[1])<=n&&Math.abs(t[2]-e[2])<=n&&Math.abs(t[3]-e[3])<=n&&Math.abs(t[4]-e[4])<=n&&Math.abs(t[5]-e[5])<=n&&Math.abs(t[6]-e[6])<=n&&Math.abs(t[7]-e[7])<=n&&Math.abs(t[8]-e[8])<=n&&Math.abs(t[9]-e[9])<=n&&Math.abs(t[10]-e[10])<=n&&Math.abs(t[11]-e[11])<=n&&Math.abs(t[12]-e[12])<=n&&Math.abs(t[13]-e[13])<=n&&Math.abs(t[14]-e[14])<=n&&Math.abs(t[15]-e[15])<=n},ls.getTranslation=function(t,e){return Qr.typeOf.object("matrix",t),Qr.typeOf.object("result",e),e.x=t[12],e.y=t[13],e.z=t[14],e},ls.getMatrix3=function(t,e){return Qr.typeOf.object("matrix",t),Qr.typeOf.object("result",e),e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[4],e[4]=t[5],e[5]=t[6],e[6]=t[8],e[7]=t[9],e[8]=t[10],e},ls.getRotation=function(t,e){return Qr.typeOf.object("matrix",t),Qr.typeOf.object("result",e),e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[4],e[4]=t[5],e[5]=t[6],e[6]=t[8],e[7]=t[9],e[8]=t[10],e};var ms,ys=new $a,vs=new $a,Cs=new Oi,Is=new Oi(0,0,0,1);ls.inverse=function(t,e){Qr.typeOf.object("matrix",t),Qr.typeOf.object("result",e);var n=t[0],r=t[4],i=t[8],o=t[12],a=t[1],s=t[5],c=t[9],l=t[13],u=t[2],h=t[6],f=t[10],d=t[14],p=t[3],A=t[7],g=t[11],m=t[15],y=f*m,v=d*g,C=h*m,I=d*A,x=h*g,E=f*A,_=u*m,b=d*p,w=u*g,M=f*p,T=u*A,B=h*p,S=y*s+I*c+x*l-(v*s+C*c+E*l),D=v*a+_*c+M*l-(y*a+b*c+w*l),R=C*a+b*s+T*l-(I*a+_*s+B*l),z=E*a+w*s+B*c-(x*a+M*s+T*c),O=v*r+C*i+E*o-(y*r+I*i+x*o),N=y*n+b*i+w*o-(v*n+_*i+M*o),L=I*n+_*r+B*o-(C*n+b*r+T*o),Q=x*n+M*r+T*i-(E*n+w*r+B*i),F=(y=i*l)*A+(I=o*s)*g+(x=r*c)*m-((v=o*c)*A+(C=r*l)*g+(E=i*s)*m),P=v*p+(_=n*l)*g+(M=i*a)*m-(y*p+(b=o*a)*g+(w=n*c)*m),k=C*p+b*A+(T=n*s)*m-(I*p+_*A+(B=r*a)*m),U=E*p+w*A+B*g-(x*p+M*A+T*g),j=C*f+E*d+v*h-(x*d+y*h+I*f),G=w*d+y*u+b*f-(_*f+M*d+v*u),H=_*h+B*d+I*u-(T*d+C*u+b*h),q=T*f+x*u+M*h-(w*h+B*f+E*u),V=n*S+r*D+i*R+o*z;if(Math.abs(V)<Ur.EPSILON21){if($a.equalsEpsilon(ls.getRotation(t,ys),vs,Ur.EPSILON5)&&Oi.equals(ls.getRow(t,3,Cs),Is))return e[0]=0,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=0,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=0,e[11]=0,e[12]=-t[12],e[13]=-t[13],e[14]=-t[14],e[15]=1,e;throw new la("matrix is not invertible because its determinate is zero.")}return V=1/V,e[0]=S*V,e[1]=D*V,e[2]=R*V,e[3]=z*V,e[4]=O*V,e[5]=N*V,e[6]=L*V,e[7]=Q*V,e[8]=F*V,e[9]=P*V,e[10]=k*V,e[11]=U*V,e[12]=j*V,e[13]=G*V,e[14]=H*V,e[15]=q*V,e},ls.inverseTransformation=function(t,e){Qr.typeOf.object("matrix",t),Qr.typeOf.object("result",e);var n=t[0],r=t[1],i=t[2],o=t[4],a=t[5],s=t[6],c=t[8],l=t[9],u=t[10],h=t[12],f=t[13],d=t[14],p=-n*h-r*f-i*d,A=-o*h-a*f-s*d,g=-c*h-l*f-u*d;return e[0]=n,e[1]=o,e[2]=c,e[3]=0,e[4]=r,e[5]=a,e[6]=l,e[7]=0,e[8]=i,e[9]=s,e[10]=u,e[11]=0,e[12]=p,e[13]=A,e[14]=g,e[15]=1,e},ls.IDENTITY=Object.freeze(new ls(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),ls.ZERO=Object.freeze(new ls(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)),ls.COLUMN0ROW0=0,ls.COLUMN0ROW1=1,ls.COLUMN0ROW2=2,ls.COLUMN0ROW3=3,ls.COLUMN1ROW0=4,ls.COLUMN1ROW1=5,ls.COLUMN1ROW2=6,ls.COLUMN1ROW3=7,ls.COLUMN2ROW0=8,ls.COLUMN2ROW1=9,ls.COLUMN2ROW2=10,ls.COLUMN2ROW3=11,ls.COLUMN3ROW0=12,ls.COLUMN3ROW1=13,ls.COLUMN3ROW2=14,ls.COLUMN3ROW3=15,Object.defineProperties(ls.prototype,{length:{get:function(){return ls.packedLength}}}),ls.prototype.clone=function(t){return ls.clone(this,t)},ls.prototype.equals=function(t){return ls.equals(this,t)},ls.equalsArray=function(t,e,n){return t[0]===e[n]&&t[1]===e[n+1]&&t[2]===e[n+2]&&t[3]===e[n+3]&&t[4]===e[n+4]&&t[5]===e[n+5]&&t[6]===e[n+6]&&t[7]===e[n+7]&&t[8]===e[n+8]&&t[9]===e[n+9]&&t[10]===e[n+10]&&t[11]===e[n+11]&&t[12]===e[n+12]&&t[13]===e[n+13]&&t[14]===e[n+14]&&t[15]===e[n+15]},ls.prototype.equalsEpsilon=function(t,e){return ls.equalsEpsilon(this,t,e)},ls.prototype.toString=function(){return"("+this[0]+", "+this[4]+", "+this[8]+", "+this[12]+")\n("+this[1]+", "+this[5]+", "+this[9]+", "+this[13]+")\n("+this[2]+", "+this[6]+", "+this[10]+", "+this[14]+")\n("+this[3]+", "+this[7]+", "+this[11]+", "+this[15]+")"};var xs,Es,_s,bs,ws,Ms,Ts,Bs,Ss,Ds,Rs,zs,Os,Ns,Ls,Qs,Fs,Ps,ks,Us,js={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},Gs={};function Hs(t){for(var e=t.split("."),n=0,r=e.length;n<r;++n)e[n]=parseInt(e[n],10);return e}function qs(){if(!Nr(Es)&&(Es=!1,!Ws())){var t=/ Chrome\/([\.0-9]+)/.exec(xs.userAgent);null!==t&&(Es=!0,_s=Hs(t[1]))}return Es}function Vs(){if(!Nr(bs)&&(bs=!1,!qs()&&!Ws()&&/ Safari\/[\.0-9]+/.test(xs.userAgent))){var t=/ Version\/([\.0-9]+)/.exec(xs.userAgent);null!==t&&(bs=!0,ws=Hs(t[1]))}return bs}function Ys(){if(!Nr(Ms)){Ms=!1;var t=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(xs.userAgent);null!==t&&(Ms=!0,(Ts=Hs(t[1])).isNightly=!!t[2])}return Ms}function Ks(){var t;Nr(Bs)||(Bs=!1,"Microsoft Internet Explorer"===xs.appName?null!==(t=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(xs.userAgent))&&(Bs=!0,Ss=Hs(t[1])):"Netscape"===xs.appName&&null!==(t=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(xs.userAgent))&&(Bs=!0,Ss=Hs(t[1])));return Bs}function Ws(){if(!Nr(Ds)){Ds=!1;var t=/ Edge\/([\.0-9]+)/.exec(xs.userAgent);null!==t&&(Ds=!0,Rs=Hs(t[1]))}return Ds}function Xs(){if(!Nr(zs)){zs=!1;var t=/Firefox\/([\.0-9]+)/.exec(xs.userAgent);null!==t&&(zs=!0,Os=Hs(t[1]))}return zs}function Js(){if(!Nr(Ps)){var t=document.createElement("canvas");t.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");var e=t.style.imageRendering;(Ps=Nr(e)&&""!==e)&&(Fs=e)}return Ps}function Zs(){if(Nr(Us))return Us.promise;Us=Ai.defer(),Ws()&&(ks=!1,Us.resolve(ks));var t=new Image;return t.onload=function(){ks=t.width>0&&t.height>0,Us.resolve(ks)},t.onerror=function(){ks=!1,Us.resolve(ks)},t.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA",Us.promise}Object.defineProperties(Gs,{element:{get:function(){if(Gs.supportsFullscreen())return document[js.fullscreenElement]}},changeEventName:{get:function(){if(Gs.supportsFullscreen())return js.fullscreenchange}},errorEventName:{get:function(){if(Gs.supportsFullscreen())return js.fullscreenerror}},enabled:{get:function(){if(Gs.supportsFullscreen())return document[js.fullscreenEnabled]}},fullscreen:{get:function(){if(Gs.supportsFullscreen())return null!==Gs.element}}}),Gs.supportsFullscreen=function(){if(Nr(ms))return ms;ms=!1;var t=document.body;if("function"==typeof t.requestFullscreen)return js.requestFullscreen="requestFullscreen",js.exitFullscreen="exitFullscreen",js.fullscreenEnabled="fullscreenEnabled",js.fullscreenElement="fullscreenElement",js.fullscreenchange="fullscreenchange",js.fullscreenerror="fullscreenerror",ms=!0;for(var e,n=["webkit","moz","o","ms","khtml"],r=0,i=n.length;r<i;++r){var o=n[r];("function"==typeof t[e=o+"RequestFullscreen"]||"function"==typeof t[e=o+"RequestFullScreen"])&&(js.requestFullscreen=e,ms=!0),e=o+"ExitFullscreen","function"==typeof document[e]?js.exitFullscreen=e:(e=o+"CancelFullScreen","function"==typeof document[e]&&(js.exitFullscreen=e)),e=o+"FullscreenEnabled",void 0!==document[e]?js.fullscreenEnabled=e:(e=o+"FullScreenEnabled",void 0!==document[e]&&(js.fullscreenEnabled=e)),e=o+"FullscreenElement",void 0!==document[e]?js.fullscreenElement=e:(e=o+"FullScreenElement",void 0!==document[e]&&(js.fullscreenElement=e)),e=o+"fullscreenchange",void 0!==document["on"+e]&&("ms"===o&&(e="MSFullscreenChange"),js.fullscreenchange=e),e=o+"fullscreenerror",void 0!==document["on"+e]&&("ms"===o&&(e="MSFullscreenError"),js.fullscreenerror=e)}return ms},Gs.requestFullscreen=function(t,e){Gs.supportsFullscreen()&&t[js.requestFullscreen]({vrDisplay:e})},Gs.exitFullscreen=function(){Gs.supportsFullscreen()&&document[js.exitFullscreen]()},Gs._names=js,xs="undefined"!=typeof navigator?navigator:{};var $s=[];"undefined"!=typeof ArrayBuffer&&($s.push(Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array),"undefined"!=typeof Uint8ClampedArray&&$s.push(Uint8ClampedArray),"undefined"!=typeof CanvasPixelArray&&$s.push(CanvasPixelArray));var tc={isChrome:qs,chromeVersion:function(){return qs()&&_s},isSafari:Vs,safariVersion:function(){return Vs()&&ws},isWebkit:Ys,webkitVersion:function(){return Ys()&&Ts},isInternetExplorer:Ks,internetExplorerVersion:function(){return Ks()&&Ss},isEdge:Ws,edgeVersion:function(){return Ws()&&Rs},isFirefox:Xs,firefoxVersion:function(){return Xs()&&Os},isWindows:function(){return Nr(Ns)||(Ns=/Windows/i.test(xs.appVersion)),Ns},isNodeJs:function(){return Nr(Ls)||(Ls="object"==typeof process&&"[object process]"===Object.prototype.toString.call(process)),Ls},hardwareConcurrency:Pr(xs.hardwareConcurrency,3),supportsPointerEvents:function(){return Nr(Qs)||(Qs=!Xs()&&"undefined"!=typeof PointerEvent&&(!Nr(xs.pointerEnabled)||xs.pointerEnabled)),Qs},supportsImageRenderingPixelated:Js,supportsWebP:Zs,supportsWebPSync:function(){return Nr(Us)||Zs(),ks},imageRenderingValue:function(){return Js()?Fs:void 0},typedArrayTypes:$s,isPCBroswer:function(){var t=window.navigator.userAgent.toLowerCase(),e="ipad"==t.match(/ipad/i),n="iphone os"==t.match(/iphone os/i),r="midp"==t.match(/midp/i),i="ucweb"==t.match(/ucweb/i),o="android"==t.match(/android/i),a="windows ce"==t.match(/windows ce/i),s="windows mobile"==t.match(/windows mobile/i);return!(e||n||r||i||o||a||s)}};function ec(t,e,n,r){this.x=Pr(t,0),this.y=Pr(e,0),this.z=Pr(n,0),this.w=Pr(r,0)}tc.supportsFullscreen=function(){return Gs.supportsFullscreen()},tc.supportsTypedArrays=function(){return"undefined"!=typeof ArrayBuffer},tc.supportsWebWorkers=function(){return"undefined"!=typeof Worker},tc.supportsWebAssembly=function(){return"undefined"!=typeof WebAssembly&&!tc.isEdge()},tc.supportsOffscreenCanvas=function(){return"undefined"!=typeof OffscreenCanvas&&!tc.isEdge()},tc.supportsEsmWebWorkers=function(){return!Xs()||parseInt(Os)>=114};var nc=new Hr;ec.fromAxisAngle=function(t,e,n){Qr.typeOf.object("axis",t),Qr.typeOf.number("angle",e);var r=e/2,i=Math.sin(r),o=(nc=Hr.normalize(t,nc)).x*i,a=nc.y*i,s=nc.z*i,c=Math.cos(r);return Nr(n)?(n.x=o,n.y=a,n.z=s,n.w=c,n):new ec(o,a,s,c)};var rc=[1,2,0],ic=new Array(3);ec.fromRotationMatrix=function(t,e){var n,r,i,o,a;Qr.typeOf.object("matrix",t);var s=t[$a.COLUMN0ROW0],c=t[$a.COLUMN1ROW1],l=t[$a.COLUMN2ROW2],u=s+c+l;if(u>0)a=.5*(n=Math.sqrt(u+1)),n=.5/n,r=(t[$a.COLUMN1ROW2]-t[$a.COLUMN2ROW1])*n,i=(t[$a.COLUMN2ROW0]-t[$a.COLUMN0ROW2])*n,o=(t[$a.COLUMN0ROW1]-t[$a.COLUMN1ROW0])*n;else{var h=0;c>s&&(h=1),l>s&&l>c&&(h=2);var f=rc[h],d=rc[f];n=Math.sqrt(t[$a.getElementIndex(h,h)]-t[$a.getElementIndex(f,f)]-t[$a.getElementIndex(d,d)]+1);var p=ic;p[h]=.5*n,n=.5/n,a=(t[$a.getElementIndex(d,f)]-t[$a.getElementIndex(f,d)])*n,p[f]=(t[$a.getElementIndex(f,h)]+t[$a.getElementIndex(h,f)])*n,p[d]=(t[$a.getElementIndex(d,h)]+t[$a.getElementIndex(h,d)])*n,r=-p[0],i=-p[1],o=-p[2]}return Nr(e)?(e.x=r,e.y=i,e.z=o,e.w=a,e):new ec(r,i,o,a)};var oc=new ec,ac=new ec,sc=new ec,cc=new ec;ec.fromHeadingPitchRoll=function(t,e){return Qr.typeOf.object("headingPitchRoll",t),cc=ec.fromAxisAngle(Hr.UNIT_X,t.roll,oc),sc=ec.fromAxisAngle(Hr.UNIT_Y,-t.pitch,e),e=ec.multiply(sc,cc,sc),ac=ec.fromAxisAngle(Hr.UNIT_Z,-t.heading,oc),ec.multiply(ac,e,e)};var lc=new Hr,uc=new Hr,hc=new ec,fc=new ec,dc=new ec;ec.packedLength=4,ec.pack=function(t,e,n){return Qr.typeOf.object("value",t),Qr.defined("array",e),n=Pr(n,0),e[n++]=t.x,e[n++]=t.y,e[n++]=t.z,e[n]=t.w,e},ec.unpack=function(t,e,n){return Qr.defined("array",t),e=Pr(e,0),Nr(n)||(n=new ec),n.x=t[e],n.y=t[e+1],n.z=t[e+2],n.w=t[e+3],n},ec.packedInterpolationLength=3,ec.convertPackedArrayForInterpolation=function(t,e,n,r){ec.unpack(t,4*n,dc),ec.conjugate(dc,dc);for(var i=0,o=n-e+1;i<o;i++){var a=3*i;ec.unpack(t,4*(e+i),hc),ec.multiply(hc,dc,hc),hc.w<0&&ec.negate(hc,hc),ec.computeAxis(hc,lc);var s=ec.computeAngle(hc);r[a]=lc.x*s,r[a+1]=lc.y*s,r[a+2]=lc.z*s}},ec.unpackInterpolationResult=function(t,e,n,r,i){Nr(i)||(i=new ec),Hr.fromArray(t,0,uc);var o=Hr.magnitude(uc);return ec.unpack(e,4*r,fc),0===o?ec.clone(ec.IDENTITY,hc):ec.fromAxisAngle(uc,o,hc),ec.multiply(hc,fc,i)},ec.clone=function(t,e){if(Nr(t))return Nr(e)?(e.x=t.x,e.y=t.y,e.z=t.z,e.w=t.w,e):new ec(t.x,t.y,t.z,t.w)},ec.conjugate=function(t,e){return Qr.typeOf.object("quaternion",t),Qr.typeOf.object("result",e),e.x=-t.x,e.y=-t.y,e.z=-t.z,e.w=t.w,e},ec.magnitudeSquared=function(t){return Qr.typeOf.object("quaternion",t),t.x*t.x+t.y*t.y+t.z*t.z+t.w*t.w},ec.magnitude=function(t){return Math.sqrt(ec.magnitudeSquared(t))},ec.normalize=function(t,e){Qr.typeOf.object("result",e);var n=1/ec.magnitude(t),r=t.x*n,i=t.y*n,o=t.z*n,a=t.w*n;return e.x=r,e.y=i,e.z=o,e.w=a,e},ec.inverse=function(t,e){Qr.typeOf.object("result",e);var n=ec.magnitudeSquared(t);return e=ec.conjugate(t,e),ec.multiplyByScalar(e,1/n,e)},ec.add=function(t,e,n){return Qr.typeOf.object("left",t),Qr.typeOf.object("right",e),Qr.typeOf.object("result",n),n.x=t.x+e.x,n.y=t.y+e.y,n.z=t.z+e.z,n.w=t.w+e.w,n},ec.subtract=function(t,e,n){return Qr.typeOf.object("left",t),Qr.typeOf.object("right",e),Qr.typeOf.object("result",n),n.x=t.x-e.x,n.y=t.y-e.y,n.z=t.z-e.z,n.w=t.w-e.w,n},ec.negate=function(t,e){return Qr.typeOf.object("quaternion",t),Qr.typeOf.object("result",e),e.x=-t.x,e.y=-t.y,e.z=-t.z,e.w=-t.w,e},ec.dot=function(t,e){return Qr.typeOf.object("left",t),Qr.typeOf.object("right",e),t.x*e.x+t.y*e.y+t.z*e.z+t.w*e.w},ec.multiply=function(t,e,n){Qr.typeOf.object("left",t),Qr.typeOf.object("right",e),Qr.typeOf.object("result",n);var r=t.x,i=t.y,o=t.z,a=t.w,s=e.x,c=e.y,l=e.z,u=e.w,h=a*s+r*u+i*l-o*c,f=a*c-r*l+i*u+o*s,d=a*l+r*c-i*s+o*u,p=a*u-r*s-i*c-o*l;return n.x=h,n.y=f,n.z=d,n.w=p,n},ec.multiplyByVec=function(t,e,n){var r=new Hr,i=new Hr,o=new Hr(t.x,t.y,t.z);r=Hr.cross(o,e,r),i=Hr.cross(o,r,i);var a=new Hr;a=Hr.multiplyByScalar(r,2*t.w,a);var s=new Hr;return s=Hr.multiplyByScalar(r,2,s),n=Hr.add(e,a,n),n=Hr.add(n,s,n)},ec.multiplyByScalar=function(t,e,n){return Qr.typeOf.object("quaternion",t),Qr.typeOf.number("scalar",e),Qr.typeOf.object("result",n),n.x=t.x*e,n.y=t.y*e,n.z=t.z*e,n.w=t.w*e,n},ec.divideByScalar=function(t,e,n){return Qr.typeOf.object("quaternion",t),Qr.typeOf.number("scalar",e),Qr.typeOf.object("result",n),n.x=t.x/e,n.y=t.y/e,n.z=t.z/e,n.w=t.w/e,n},ec.computeAxis=function(t,e){Qr.typeOf.object("quaternion",t),Qr.typeOf.object("result",e);var n=t.w;if(Math.abs(n-1)<Ur.EPSILON6)return e.x=e.y=e.z=0,e;var r=1/Math.sqrt(1-n*n);return e.x=t.x*r,e.y=t.y*r,e.z=t.z*r,e},ec.computeAngle=function(t){return Qr.typeOf.object("quaternion",t),Math.abs(t.w-1)<Ur.EPSILON6?0:2*Math.acos(t.w)};var pc=new ec;ec.lerp=function(t,e,n,r){return Qr.typeOf.object("start",t),Qr.typeOf.object("end",e),Qr.typeOf.number("t",n),Qr.typeOf.object("result",r),pc=ec.multiplyByScalar(e,n,pc),r=ec.multiplyByScalar(t,1-n,r),ec.add(pc,r,r)};var Ac=new ec,gc=new ec,mc=new ec;ec.slerp=function(t,e,n,r){Qr.typeOf.object("start",t),Qr.typeOf.object("end",e),Qr.typeOf.number("t",n),Qr.typeOf.object("result",r);var i=ec.dot(t,e),o=e;if(i<0&&(i=-i,o=Ac=ec.negate(e,Ac)),1-i<Ur.EPSILON6)return ec.lerp(t,o,n,r);var a=Math.acos(i);return gc=ec.multiplyByScalar(t,Math.sin((1-n)*a),gc),mc=ec.multiplyByScalar(o,Math.sin(n*a),mc),r=ec.add(gc,mc,r),ec.multiplyByScalar(r,1/Math.sin(a),r)},ec.log=function(t,e){Qr.typeOf.object("quaternion",t),Qr.typeOf.object("result",e);var n=Ur.acosClamped(t.w),r=0;return 0!==n&&(r=n/Math.sin(n)),Hr.multiplyByScalar(t,r,e)},ec.exp=function(t,e){Qr.typeOf.object("cartesian",t),Qr.typeOf.object("result",e);var n=Hr.magnitude(t),r=0;return 0!==n&&(r=Math.sin(n)/n),e.x=t.x*r,e.y=t.y*r,e.z=t.z*r,e.w=Math.cos(n),e};var yc=new Hr,vc=new Hr,Cc=new ec,Ic=new ec;ec.computeInnerQuadrangle=function(t,e,n,r){Qr.typeOf.object("q0",t),Qr.typeOf.object("q1",e),Qr.typeOf.object("q2",n),Qr.typeOf.object("result",r);var i=ec.conjugate(e,Cc);ec.multiply(i,n,Ic);var o=ec.log(Ic,yc);ec.multiply(i,t,Ic);var a=ec.log(Ic,vc);return Hr.add(o,a,o),Hr.multiplyByScalar(o,.25,o),Hr.negate(o,o),ec.exp(o,Cc),ec.multiply(e,Cc,r)},ec.squad=function(t,e,n,r,i,o){Qr.typeOf.object("q0",t),Qr.typeOf.object("q1",e),Qr.typeOf.object("s0",n),Qr.typeOf.object("s1",r),Qr.typeOf.number("t",i),Qr.typeOf.object("result",o);var a=ec.slerp(t,e,i,Cc),s=ec.slerp(n,r,i,Ic);return ec.slerp(a,s,2*i*(1-i),o)};for(var xc=new ec,Ec=1.9011074535173003,_c=tc.supportsTypedArrays()?new Float32Array(8):[],bc=tc.supportsTypedArrays()?new Float32Array(8):[],wc=tc.supportsTypedArrays()?new Float32Array(8):[],Mc=tc.supportsTypedArrays()?new Float32Array(8):[],Tc=0;Tc<7;++Tc){var Bc=Tc+1,Sc=2*Bc+1;_c[Tc]=1/(Bc*Sc),bc[Tc]=Bc/Sc}function Dc(t){this._ellipsoid=Pr(t,Ra.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}_c[7]=Ec/136,bc[7]=8*Ec/17,ec.fastSlerp=function(t,e,n,r){Qr.typeOf.object("start",t),Qr.typeOf.object("end",e),Qr.typeOf.number("t",n),Qr.typeOf.object("result",r);var i,o=ec.dot(t,e);o>=0?i=1:(i=-1,o=-o);for(var a=o-1,s=1-n,c=n*n,l=s*s,u=7;u>=0;--u)wc[u]=(_c[u]*c-bc[u])*a,Mc[u]=(_c[u]*l-bc[u])*a;var h=i*n*(1+wc[0]*(1+wc[1]*(1+wc[2]*(1+wc[3]*(1+wc[4]*(1+wc[5]*(1+wc[6]*(1+wc[7])))))))),f=s*(1+Mc[0]*(1+Mc[1]*(1+Mc[2]*(1+Mc[3]*(1+Mc[4]*(1+Mc[5]*(1+Mc[6]*(1+Mc[7])))))))),d=ec.multiplyByScalar(t,f,xc);return ec.multiplyByScalar(e,h,r),ec.add(d,r,r)},ec.fastSquad=function(t,e,n,r,i,o){Qr.typeOf.object("q0",t),Qr.typeOf.object("q1",e),Qr.typeOf.object("s0",n),Qr.typeOf.object("s1",r),Qr.typeOf.number("t",i),Qr.typeOf.object("result",o);var a=ec.fastSlerp(t,e,i,Cc),s=ec.fastSlerp(n,r,i,Ic);return ec.fastSlerp(a,s,2*i*(1-i),o)},ec.equals=function(t,e){return t===e||Nr(t)&&Nr(e)&&t.x===e.x&&t.y===e.y&&t.z===e.z&&t.w===e.w},ec.equalsEpsilon=function(t,e,n){return Qr.typeOf.number("epsilon",n),t===e||Nr(t)&&Nr(e)&&Math.abs(t.x-e.x)<=n&&Math.abs(t.y-e.y)<=n&&Math.abs(t.z-e.z)<=n&&Math.abs(t.w-e.w)<=n},ec.ZERO=Object.freeze(new ec(0,0,0,0)),ec.IDENTITY=Object.freeze(new ec(0,0,0,1)),ec.prototype.clone=function(t){return ec.clone(this,t)},ec.prototype.equals=function(t){return ec.equals(this,t)},ec.prototype.equalsEpsilon=function(t,e){return ec.equalsEpsilon(this,t,e)},ec.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},Object.defineProperties(Dc.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),Dc.prototype.project=function(t,e){var n=this._semimajorAxis,r=t.longitude*n,i=t.latitude*n,o=t.height;return Nr(e)?(e.x=r,e.y=i,e.z=o,e):new Hr(r,i,o)},Dc.prototype.unproject=function(t,e){if(!Nr(t))throw new Lr("cartesian is required");var n=this._oneOverSemimajorAxis,r=t.x*n,i=t.y*n,o=t.z;return Nr(e)?(e.longitude=r,e.latitude=i,e.height=o,e):new ri(r,i,o)};var Rc={},zc={up:{south:"east",north:"west",west:"south",east:"north"},down:{south:"west",north:"east",west:"north",east:"south"},south:{up:"west",down:"east",west:"down",east:"up"},north:{up:"east",down:"west",west:"up",east:"down"},west:{up:"north",down:"south",north:"down",south:"up"},east:{up:"south",down:"north",north:"up",south:"down"}},Oc={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},Nc={},Lc={east:new Hr,north:new Hr,up:new Hr,west:new Hr,south:new Hr,down:new Hr},Qc=new Hr,Fc=new Hr,Pc=new Hr;Rc.localFrameToFixedFrameGenerator=function(t,e){if(!zc.hasOwnProperty(t)||!zc[t].hasOwnProperty(e))throw new Lr("firstAxis and secondAxis must be east, north, up, west, south or down.");var n,r=zc[t][e],i=t+e;return Nr(Nc[i])?n=Nc[i]:(n=function(n,i,o){if(!Nr(n))throw new Lr("origin is required.");if(Nr(o)||(o=new ls),Hr.equalsEpsilon(n,Hr.ZERO,Ur.EPSILON14))Hr.unpack(Oc[t],0,Qc),Hr.unpack(Oc[e],0,Fc),Hr.unpack(Oc[r],0,Pc);else if(Ur.equalsEpsilon(n.x,0,Ur.EPSILON14)&&Ur.equalsEpsilon(n.y,0,Ur.EPSILON14)){var a=Ur.sign(n.z);Hr.unpack(Oc[t],0,Qc),"east"!==t&&"west"!==t&&Hr.multiplyByScalar(Qc,a,Qc),Hr.unpack(Oc[e],0,Fc),"east"!==e&&"west"!==e&&Hr.multiplyByScalar(Fc,a,Fc),Hr.unpack(Oc[r],0,Pc),"east"!==r&&"west"!==r&&Hr.multiplyByScalar(Pc,a,Pc)}else{(i=Pr(i,Ra.WGS84)).geodeticSurfaceNormal(n,Lc.up);var s=Lc.up,c=Lc.east;c.x=-n.y,c.y=n.x,c.z=0,Hr.normalize(c,Lc.east),Hr.cross(s,c,Lc.north),Hr.multiplyByScalar(Lc.up,-1,Lc.down),Hr.multiplyByScalar(Lc.east,-1,Lc.west),Hr.multiplyByScalar(Lc.north,-1,Lc.south),Qc=Lc[t],Fc=Lc[e],Pc=Lc[r]}return o[0]=Qc.x,o[1]=Qc.y,o[2]=Qc.z,o[3]=0,o[4]=Fc.x,o[5]=Fc.y,o[6]=Fc.z,o[7]=0,o[8]=Pc.x,o[9]=Pc.y,o[10]=Pc.z,o[11]=0,o[12]=n.x,o[13]=n.y,o[14]=n.z,o[15]=1,o},Nc[i]=n),n},Rc.eastNorthUpToFixedFrame=Rc.localFrameToFixedFrameGenerator("east","north"),Rc.northEastDownToFixedFrame=Rc.localFrameToFixedFrameGenerator("north","east"),Rc.northUpEastToFixedFrame=Rc.localFrameToFixedFrameGenerator("north","up"),Rc.northWestUpToFixedFrame=Rc.localFrameToFixedFrameGenerator("north","west");var kc=new ec,Uc=new Hr(1,1,1),jc=new ls;Rc.headingPitchRollToFixedFrame=function(t,e,n,r,i){Qr.typeOf.object("HeadingPitchRoll",e),r=Pr(r,Rc.eastNorthUpToFixedFrame);var o=ec.fromHeadingPitchRoll(e,kc),a=ls.fromTranslationQuaternionRotationScale(Hr.ZERO,o,Uc,jc);return i=r(t,n,i),ls.multiply(i,a,i)};var Gc=new ls,Hc=new $a;Rc.headingPitchRollQuaternion=function(t,e,n,r,i){Qr.typeOf.object("HeadingPitchRoll",e);var o=Rc.headingPitchRollToFixedFrame(t,e,n,r,Gc),a=ls.getMatrix3(o,Hc);return ec.fromRotationMatrix(a,i)};var qc=new Hr(1,1,1),Vc=new Hr,Yc=new ls,Kc=new ls,Wc=new $a,Xc=new ec;Rc.fixedFrameToHeadingPitchRoll=function(t,e,n,r){Qr.defined("transform",t),e=Pr(e,Ra.WGS84),n=Pr(n,Rc.eastNorthUpToFixedFrame),Nr(r)||(r=new Fa);var i=ls.getTranslation(t,Vc);if(Hr.equals(i,Hr.ZERO))return r.heading=0,r.pitch=0,r.roll=0,r;var o=ls.inverseTransformation(n(i,e,Yc),Yc),a=ls.setScale(t,qc,Kc);a=ls.setTranslation(a,Hr.ZERO,a),o=ls.multiply(o,a,o);var s=ec.fromRotationMatrix(ls.getMatrix3(o,Wc),Xc);return s=ec.normalize(s,s),Fa.fromQuaternion(s,r)};var Jc=Ur.TWO_PI/86400,Zc=new Ao;Rc.computeTemeToPseudoFixedMatrix=function(t,e){if(!Nr(t))throw new Lr("date is required.");var n,r=(Zc=Ao.addSeconds(t,-Ao.computeTaiMinusUtc(t),Zc)).dayNumber,i=Zc.secondsOfDay,o=r-2451545,a=(24110.54841+(n=i>=43200?(o+.5)/Ki.DAYS_PER_JULIAN_CENTURY:(o-.5)/Ki.DAYS_PER_JULIAN_CENTURY)*(8640184.812866+n*(.093104+-62e-7*n)))*Jc%Ur.TWO_PI+(72921158553e-15+11772758384668e-32*(r-2451545.5))*((i+.5*Ki.SECONDS_PER_DAY)%Ki.SECONDS_PER_DAY),s=Math.cos(a),c=Math.sin(a);return Nr(e)?(e[0]=s,e[1]=-c,e[2]=0,e[3]=c,e[4]=s,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e):new $a(s,c,0,-c,s,0,0,0,1)},Rc.iau2006XysData=new Wa,Rc.earthOrientationParameters=ba.NONE;var $c=32.184;Rc.preloadIcrfFixed=function(t){var e=t.start.dayNumber,n=t.start.secondsOfDay+$c,r=t.stop.dayNumber,i=t.stop.secondsOfDay+$c,o=Rc.iau2006XysData.preload(e,n,r,i),a=Rc.earthOrientationParameters.getPromiseToLoad();return Ai.all([o,a])},Rc.computeIcrfToFixedMatrix=function(t,e){if(!Nr(t))throw new Lr("date is required.");Nr(e)||(e=new $a);var n=Rc.computeFixedToIcrfMatrix(t,e);if(Nr(n))return $a.transpose(n,e)};var tl=new Ka(0,0,0),el=new Gi(0,0,0,0,0),nl=new $a,rl=new $a;Rc.computeFixedToIcrfMatrix=function(t,e){if(!Nr(t))throw new Lr("date is required.");Nr(e)||(e=new $a);var n=Rc.earthOrientationParameters.compute(t,el);if(Nr(n)){var r=t.dayNumber,i=t.secondsOfDay+$c,o=Rc.iau2006XysData.computeXysRadians(r,i,tl);if(Nr(o)){var a=o.x+n.xPoleOffset,s=o.y+n.yPoleOffset,c=1/(1+Math.sqrt(1-a*a-s*s)),l=nl;l[0]=1-c*a*a,l[3]=-c*a*s,l[6]=a,l[1]=-c*a*s,l[4]=1-c*s*s,l[7]=s,l[2]=-a,l[5]=-s,l[8]=1-c*(a*a+s*s);var u=$a.fromRotationZ(-o.s,rl),h=$a.multiply(l,u,nl),f=t.dayNumber-2451545,d=(t.secondsOfDay-Ao.computeTaiMinusUtc(t)+n.ut1MinusUtc)/Ki.SECONDS_PER_DAY,p=.779057273264+d+.00273781191135448*(f+d);p=p%1*Ur.TWO_PI;var A=$a.fromRotationZ(p,rl),g=$a.multiply(h,A,nl),m=Math.cos(n.xPoleWander),y=Math.cos(n.yPoleWander),v=Math.sin(n.xPoleWander),C=Math.sin(n.yPoleWander),I=r-2451545+i/Ki.SECONDS_PER_DAY,x=-47e-6*(I/=36525)*Ur.RADIANS_PER_DEGREE/3600,E=Math.cos(x),_=Math.sin(x),b=rl;return b[0]=m*E,b[1]=m*_,b[2]=v,b[3]=-y*_+C*v*E,b[4]=y*E+C*v*_,b[5]=-C*m,b[6]=-C*_-y*v*E,b[7]=C*E-y*v*_,b[8]=y*m,$a.multiply(g,b,e)}}};var il=new Oi;Rc.pointToWindowCoordinates=function(t,e,n,r){return(r=Rc.pointToGLWindowCoordinates(t,e,n,r)).y=2*e[5]-r.y,r},Rc.pointToGLWindowCoordinates=function(t,e,n,r){if(!Nr(t))throw new Lr("modelViewProjectionMatrix is required.");if(!Nr(e))throw new Lr("viewportTransformation is required.");if(!Nr(n))throw new Lr("point is required.");Nr(r)||(r=new Ti);var i=il;return ls.multiplyByVector(t,Oi.fromElements(n.x,n.y,n.z,1,i),i),Oi.multiplyByScalar(i,1/i.w,i),ls.multiplyByVector(e,i,i),Ti.fromCartesian4(i,r)};var ol=new Hr,al=new Hr,sl=new Hr;Rc.rotationMatrixFromPositionVelocity=function(t,e,n,r){if(!Nr(t))throw new Lr("position is required.");if(!Nr(e))throw new Lr("velocity is required.");var i=Pr(n,Ra.WGS84).geodeticSurfaceNormal(t,ol),o=Hr.cross(e,i,al);Hr.equalsEpsilon(o,Hr.ZERO,Ur.EPSILON6)&&(o=Hr.clone(Hr.UNIT_X,o));var a=Hr.cross(o,e,sl);return Hr.normalize(a,a),Hr.cross(e,a,o),Hr.negate(o,o),Hr.normalize(o,o),Nr(r)||(r=new $a),r[0]=e.x,r[1]=e.y,r[2]=e.z,r[3]=o.x,r[4]=o.y,r[5]=o.z,r[6]=a.x,r[7]=a.y,r[8]=a.z,r};var cl=new ls(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1),ll=new ri,ul=new Hr,hl=new Hr,fl=new $a,dl=new ls,pl=new ls;Rc.basisTo2D=function(t,e,n){if(!Nr(t))throw new Lr("projection is required.");if(!Nr(e))throw new Lr("matrix is required.");if(!Nr(n))throw new Lr("result is required.");var r=ls.getTranslation(e,hl),i=t.ellipsoid,o=i.cartesianToCartographic(r,ll),a=t.project(o,ul);Hr.fromElements(a.z,a.x,a.y,a);var s=Rc.eastNorthUpToFixedFrame(r,i,dl),c=ls.inverseTransformation(s,pl),l=ls.getMatrix3(e,fl),u=ls.multiplyByMatrix3(c,l,n);return ls.multiply(cl,u,n),ls.setTranslation(n,a,n),n},Rc.wgs84To2DModelMatrix=function(t,e,n){if(!Nr(t))throw new Lr("projection is required.");if(!Nr(e))throw new Lr("center is required.");if(!Nr(n))throw new Lr("result is required.");var r=t.ellipsoid,i=Rc.eastNorthUpToFixedFrame(e,r,dl),o=ls.inverseTransformation(i,pl),a=r.cartesianToCartographic(e,ll),s=t.project(a,ul);Hr.fromElements(s.z,s.x,s.y,s);var c=ls.fromTranslation(s,dl);return ls.multiply(cl,o,n),ls.multiply(c,n,n),n},Rc.buildUp=function(t,e){var n=e.clone(),r=t.clone();r=Hr.normalize(r,r),Math.abs(Hr.dot(r,n))>=1&&(r=Math.abs(Hr.dot(n,Hr.UNIT_Y))<1?Hr.clone(Hr.UNIT_Y,r):Hr.clone(Hr.UNIT_Z,r));var i=new Hr;return Hr.cross(r,n,i),i=Hr.normalize(i,i),Hr.cross(n,i,r),r=Hr.normalize(r,r)},Rc.getHeading=function(t,e){var n;return n=Ur.equalsEpsilon(Math.abs(t.z),1,Ur.EPSILON3)?Math.atan2(e.y,e.x)-Ur.PI_OVER_TWO:Math.atan2(t.y,t.x)-Ur.PI_OVER_TWO,Ur.TWO_PI-Ur.zeroToTwoPi(n)},Rc.convertToColumbusCartesian=function(t){var e=new Dc,n=e.ellipsoid,r=new Hr,i=new ri;return n.cartesianToCartographic(t,i),e.project(i,r),Hr.fromElements(r.z,r.x,r.y)},Rc.convertTo3DCartesian=function(t){var e=new Dc,n=e.ellipsoid,r=new Hr,i=new ri;return r=Hr.fromElements(t.y,t.z,t.x),e.unproject(r,i),n.cartographicToCartesian(i,r)};var Al,gl={MORPHING:0,COLUMBUS_VIEW:1,SCENE2D:2,SCENE3D:3,getMorphTime:function(t){return t===gl.SCENE3D?1:t!==gl.MORPHING?0:void 0}},ml=Object.freeze(gl),yl=(Al=!0,function(t,e){var n=Al?function(){if(e){var n=e.apply(t,arguments);return e=null,n}}:function(){};return Al=!1,n}),vl=yl(void 0,(function(){return vl.toString().search("(((.+)+)+)+$").toString().constructor(vl).search("(((.+)+)+)+$")}));vl();var Cl=8192;const Il=function(){let t=!0;return function(e,n){const r=t?function(){if(n){const t=n.apply(e,arguments);return n=null,t}}:function(){};return t=!1,r}}(),xl=Il(void 0,(function(){return xl.toString().search("(((.+)+)+)+$").toString().constructor(xl).search("(((.+)+)+)+$")}));xl();var El=Object.freeze({OUTSIDE:-1,INTERSECTING:0,INSIDE:1});function _l(t,e){this.start=Pr(t,0),this.stop=Pr(e,0)}function bl(t,e,n,r){this.west=Pr(t,0),this.south=Pr(e,0),this.east=Pr(n,0),this.north=Pr(r,0)}Object.defineProperties(bl.prototype,{width:{get:function(){return bl.computeWidth(this)}},height:{get:function(){return bl.computeHeight(this)}}}),bl.packedLength=4,bl.pack=function(t,e,n){return Qr.typeOf.object("value",t),Qr.defined("array",e),n=Pr(n,0),e[n++]=t.west,e[n++]=t.south,e[n++]=t.east,e[n]=t.north,e},bl.unpack=function(t,e,n){return Qr.defined("array",t),e=Pr(e,0),Nr(n)||(n=new bl),n.west=t[e++],n.south=t[e++],n.east=t[e++],n.north=t[e],n},bl.computeWidth=function(t){Qr.typeOf.object("rectangle",t);var e=t.east,n=t.west;return e<n&&(e+=Ur.TWO_PI),e-n},bl.computeHeight=function(t){return Qr.typeOf.object("rectangle",t),t.north-t.south},bl.fromDegrees=function(t,e,n,r,i){return t=Ur.toRadians(Pr(t,0)),e=Ur.toRadians(Pr(e,0)),n=Ur.toRadians(Pr(n,0)),r=Ur.toRadians(Pr(r,0)),Nr(i)?(i.west=t,i.south=e,i.east=n,i.north=r,i):new bl(t,e,n,r)},bl.fromRadians=function(t,e,n,r,i){return Nr(i)?(i.west=Pr(t,0),i.south=Pr(e,0),i.east=Pr(n,0),i.north=Pr(r,0),i):new bl(t,e,n,r)},bl.fromCartographicArray=function(t,e){Qr.defined("cartographics",t);for(var n=Number.MAX_VALUE,r=-Number.MAX_VALUE,i=Number.MAX_VALUE,o=-Number.MAX_VALUE,a=Number.MAX_VALUE,s=-Number.MAX_VALUE,c=0,l=t.length;c<l;c++){var u=t[c];n=Math.min(n,u.longitude),r=Math.max(r,u.longitude),a=Math.min(a,u.latitude),s=Math.max(s,u.latitude);var h=u.longitude>=0?u.longitude:u.longitude+Ur.TWO_PI;i=Math.min(i,h),o=Math.max(o,h)}return r-n>o-i&&(n=i,(r=o)>Ur.PI&&(r-=Ur.TWO_PI),n>Ur.PI&&(n-=Ur.TWO_PI)),Nr(e)?(e.west=n,e.south=a,e.east=r,e.north=s,e):new bl(n,a,r,s)},bl.fromCartesianArray=function(t,e,n){Qr.defined("cartesians",t),e=Pr(e,Ra.WGS84);for(var r=Number.MAX_VALUE,i=-Number.MAX_VALUE,o=Number.MAX_VALUE,a=-Number.MAX_VALUE,s=Number.MAX_VALUE,c=-Number.MAX_VALUE,l=0,u=t.length;l<u;l++){var h=e.cartesianToCartographic(t[l]);r=Math.min(r,h.longitude),i=Math.max(i,h.longitude),s=Math.min(s,h.latitude),c=Math.max(c,h.latitude);var f=h.longitude>=0?h.longitude:h.longitude+Ur.TWO_PI;o=Math.min(o,f),a=Math.max(a,f)}return i-r>a-o&&(r=o,(i=a)>Ur.PI&&(i-=Ur.TWO_PI),r>Ur.PI&&(r-=Ur.TWO_PI)),Nr(n)?(n.west=r,n.south=s,n.east=i,n.north=c,n):new bl(r,s,i,c)},bl.clone=function(t,e){if(Nr(t))return Nr(e)?(e.west=t.west,e.south=t.south,e.east=t.east,e.north=t.north,e):new bl(t.west,t.south,t.east,t.north)},bl.equalsEpsilon=function(t,e,n){return Qr.typeOf.number("absoluteEpsilon",n),t===e||Nr(t)&&Nr(e)&&Math.abs(t.west-e.west)<=n&&Math.abs(t.south-e.south)<=n&&Math.abs(t.east-e.east)<=n&&Math.abs(t.north-e.north)<=n},bl.prototype.clone=function(t){return bl.clone(this,t)},bl.prototype.equals=function(t){return bl.equals(this,t)},bl.equals=function(t,e){return t===e||Nr(t)&&Nr(e)&&t.west===e.west&&t.south===e.south&&t.east===e.east&&t.north===e.north},bl.prototype.equalsEpsilon=function(t,e){return Qr.typeOf.number("epsilon",e),bl.equalsEpsilon(this,t,e)},bl.validate=function(t){Qr.typeOf.object("rectangle",t);var e=t.north;Qr.typeOf.number.greaterThanOrEquals("north",e,-Ur.PI_OVER_TWO),Qr.typeOf.number.lessThanOrEquals("north",e,Ur.PI_OVER_TWO);var n=t.south;Qr.typeOf.number.greaterThanOrEquals("south",n,-Ur.PI_OVER_TWO),Qr.typeOf.number.lessThanOrEquals("south",n,Ur.PI_OVER_TWO);var r=t.west;Qr.typeOf.number.greaterThanOrEquals("west",r,-Math.PI),Qr.typeOf.number.lessThanOrEquals("west",r,Math.PI);var i=t.east;Qr.typeOf.number.greaterThanOrEquals("east",i,-Math.PI),Qr.typeOf.number.lessThanOrEquals("east",i,Math.PI)},bl.southwest=function(t,e){return Qr.typeOf.object("rectangle",t),Nr(e)?(e.longitude=t.west,e.latitude=t.south,e.height=0,e):new ri(t.west,t.south)},bl.northwest=function(t,e){return Qr.typeOf.object("rectangle",t),Nr(e)?(e.longitude=t.west,e.latitude=t.north,e.height=0,e):new ri(t.west,t.north)},bl.northeast=function(t,e){return Qr.typeOf.object("rectangle",t),Nr(e)?(e.longitude=t.east,e.latitude=t.north,e.height=0,e):new ri(t.east,t.north)},bl.southeast=function(t,e){return Qr.typeOf.object("rectangle",t),Nr(e)?(e.longitude=t.east,e.latitude=t.south,e.height=0,e):new ri(t.east,t.south)},bl.center=function(t,e){Qr.typeOf.object("rectangle",t);var n=t.east,r=t.west;n<r&&(n+=Ur.TWO_PI);var i=Ur.negativePiToPi(.5*(r+n)),o=.5*(t.south+t.north);return Nr(e)?(e.longitude=i,e.latitude=o,e.height=0,e):new ri(i,o)},bl.intersection=function(t,e,n){Qr.typeOf.object("rectangle",t),Qr.typeOf.object("otherRectangle",e);var r=t.east,i=t.west,o=e.east,a=e.west;r<i&&o>0?r+=Ur.TWO_PI:o<a&&r>0&&(o+=Ur.TWO_PI),r<i&&a<0?a+=Ur.TWO_PI:o<a&&i<0&&(i+=Ur.TWO_PI);var s=Ur.negativePiToPi(Math.max(i,a)),c=Ur.negativePiToPi(Math.min(r,o));if(!((t.west<t.east||e.west<e.east)&&c<=s)){var l=Math.max(t.south,e.south),u=Math.min(t.north,e.north);if(!(l>=u))return Nr(n)?(n.west=s,n.south=l,n.east=c,n.north=u,n):new bl(s,l,c,u)}},bl.simpleIntersection=function(t,e,n){Qr.typeOf.object("rectangle",t),Qr.typeOf.object("otherRectangle",e);var r=Math.max(t.west,e.west),i=Math.max(t.south,e.south),o=Math.min(t.east,e.east),a=Math.min(t.north,e.north);if(!(i>=a||r>=o))return Nr(n)?(n.west=r,n.south=i,n.east=o,n.north=a,n):new bl(r,i,o,a)},bl.union=function(t,e,n){Qr.typeOf.object("rectangle",t),Qr.typeOf.object("otherRectangle",e),Nr(n)||(n=new bl);var r=t.east,i=t.west,o=e.east,a=e.west;r<i&&o>0?r+=Ur.TWO_PI:o<a&&r>0&&(o+=Ur.TWO_PI),r<i&&a<0?a+=Ur.TWO_PI:o<a&&i<0&&(i+=Ur.TWO_PI);var s=Ur.convertLongitudeRange(Math.min(i,a)),c=Ur.convertLongitudeRange(Math.max(r,o));return n.west=s,n.south=Math.min(t.south,e.south),n.east=c,n.north=Math.max(t.north,e.north),n},bl.expand=function(t,e,n){return Qr.typeOf.object("rectangle",t),Qr.typeOf.object("cartographic",e),Nr(n)||(n=new bl),n.west=Math.min(t.west,e.longitude),n.south=Math.min(t.south,e.latitude),n.east=Math.max(t.east,e.longitude),n.north=Math.max(t.north,e.latitude),n},bl.contains=function(t,e){Qr.typeOf.object("rectangle",t),Qr.typeOf.object("cartographic",e);var n=e.longitude,r=e.latitude,i=t.west,o=t.east;return o<i&&(o+=Ur.TWO_PI,n<0&&(n+=Ur.TWO_PI)),(n>i||Ur.equalsEpsilon(n,i,Ur.EPSILON14))&&(n<o||Ur.equalsEpsilon(n,o,Ur.EPSILON14))&&r>=t.south&&r<=t.north};var wl=new ri;bl.subsample=function(t,e,n,r){Qr.typeOf.object("rectangle",t),e=Pr(e,Ra.WGS84),n=Pr(n,0),Nr(r)||(r=[]);var i=0,o=t.north,a=t.south,s=t.east,c=t.west,l=wl;l.height=n,l.longitude=c,l.latitude=o,r[i]=e.cartographicToCartesian(l,r[i]),i++,l.longitude=s,r[i]=e.cartographicToCartesian(l,r[i]),i++,l.latitude=a,r[i]=e.cartographicToCartesian(l,r[i]),i++,l.longitude=c,r[i]=e.cartographicToCartesian(l,r[i]),i++,l.latitude=o<0?o:a>0?a:0;for(var u=1;u<8;++u)l.longitude=-Math.PI+u*Ur.PI_OVER_TWO,bl.contains(t,l)&&(r[i]=e.cartographicToCartesian(l,r[i]),i++);return 0===l.latitude&&(l.longitude=c,r[i]=e.cartographicToCartesian(l,r[i]),i++,l.longitude=s,r[i]=e.cartographicToCartesian(l,r[i]),i++),r.length=i,r};var Ml=new ri;function Tl(t,e){this.center=Hr.clone(Pr(t,Hr.ZERO)),this.radius=Pr(e,0)}bl.prototype.contains=function(t){return bl.contains(this,bl.southwest(t,Ml))&&bl.contains(this,bl.northwest(t,Ml))&&bl.contains(this,bl.southeast(t,Ml))&&bl.contains(this,bl.northeast(t,Ml))},bl.MAX_VALUE=Object.freeze(new bl(-Math.PI,-Ur.PI_OVER_TWO,Math.PI,Ur.PI_OVER_TWO));var Bl=new Hr,Sl=new Hr,Dl=new Hr,Rl=new Hr,zl=new Hr,Ol=new Hr,Nl=new Hr,Ll=new Hr,Ql=new Hr,Fl=new Hr,Pl=new Hr,kl=new Hr,Ul=4/3*Ur.PI;Tl.fromPoints=function(t,e){if(Nr(e)||(e=new Tl),!Nr(t)||0===t.length)return e.center=Hr.clone(Hr.ZERO,e.center),e.radius=0,e;var n,r=Hr.clone(t[0],Nl),i=Hr.clone(r,Bl),o=Hr.clone(r,Sl),a=Hr.clone(r,Dl),s=Hr.clone(r,Rl),c=Hr.clone(r,zl),l=Hr.clone(r,Ol),u=t.length;for(n=1;n<u;n++){Hr.clone(t[n],r);var h=r.x,f=r.y,d=r.z;h<i.x&&Hr.clone(r,i),h>s.x&&Hr.clone(r,s),f<o.y&&Hr.clone(r,o),f>c.y&&Hr.clone(r,c),d<a.z&&Hr.clone(r,a),d>l.z&&Hr.clone(r,l)}var p=Hr.magnitudeSquared(Hr.subtract(s,i,Ll)),A=Hr.magnitudeSquared(Hr.subtract(c,o,Ll)),g=Hr.magnitudeSquared(Hr.subtract(l,a,Ll)),m=i,y=s,v=p;A>v&&(v=A,m=o,y=c),g>v&&(v=g,m=a,y=l);var C=Ql;C.x=.5*(m.x+y.x),C.y=.5*(m.y+y.y),C.z=.5*(m.z+y.z);var I=Hr.magnitudeSquared(Hr.subtract(y,C,Ll)),x=Math.sqrt(I),E=Fl;E.x=i.x,E.y=o.y,E.z=a.z;var _=Pl;_.x=s.x,_.y=c.y,_.z=l.z;var b=Hr.midpoint(E,_,kl),w=0;for(n=0;n<u;n++){Hr.clone(t[n],r);var M=Hr.magnitude(Hr.subtract(r,b,Ll));M>w&&(w=M);var T=Hr.magnitudeSquared(Hr.subtract(r,C,Ll));if(T>I){var B=Math.sqrt(T);I=(x=.5*(x+B))*x;var S=B-x;C.x=(x*C.x+S*r.x)/B,C.y=(x*C.y+S*r.y)/B,C.z=(x*C.z+S*r.z)/B}}return x<w?(Hr.clone(C,e.center),e.radius=x):(Hr.clone(b,e.center),e.radius=w),e};var jl=new Dc,Gl=new Hr,Hl=new Hr,ql=new ri,Vl=new ri;Tl.fromRectangle2D=function(t,e,n){return Tl.fromRectangleWithHeights2D(t,e,0,0,n)},Tl.fromRectangleWithHeights2D=function(t,e,n,r,i){if(Nr(i)||(i=new Tl),!Nr(t))return i.center=Hr.clone(Hr.ZERO,i.center),i.radius=0,i;e=Pr(e,jl),bl.southwest(t,ql),ql.height=n,bl.northeast(t,Vl),Vl.height=r;var o=e.project(ql,Gl),a=e.project(Vl,Hl),s=a.x-o.x,c=a.y-o.y,l=a.z-o.z;i.radius=.5*Math.sqrt(s*s+c*c+l*l);var u=i.center;return u.x=o.x+.5*s,u.y=o.y+.5*c,u.z=o.z+.5*l,i};var Yl=[];Tl.fromRectangle3D=function(t,e,n,r){if(e=Pr(e,Ra.WGS84),n=Pr(n,0),Nr(r)||(r=new Tl),!Nr(t))return r.center=Hr.clone(Hr.ZERO,r.center),r.radius=0,r;var i=bl.subsample(t,e,n,Yl);return Tl.fromPoints(i,r)},Tl.fromVertices=function(t,e,n,r){if(Nr(r)||(r=new Tl),!Nr(t)||0===t.length)return r.center=Hr.clone(Hr.ZERO,r.center),r.radius=0,r;e=Pr(e,Hr.ZERO),n=Pr(n,3),Qr.typeOf.number.greaterThanOrEquals("stride",n,3);var i=Nl;i.x=t[0]+e.x,i.y=t[1]+e.y,i.z=t[2]+e.z;var o,a=Hr.clone(i,Bl),s=Hr.clone(i,Sl),c=Hr.clone(i,Dl),l=Hr.clone(i,Rl),u=Hr.clone(i,zl),h=Hr.clone(i,Ol),f=t.length;for(o=0;o<f;o+=n){var d=t[o]+e.x,p=t[o+1]+e.y,A=t[o+2]+e.z;i.x=d,i.y=p,i.z=A,d<a.x&&Hr.clone(i,a),d>l.x&&Hr.clone(i,l),p<s.y&&Hr.clone(i,s),p>u.y&&Hr.clone(i,u),A<c.z&&Hr.clone(i,c),A>h.z&&Hr.clone(i,h)}var g=Hr.magnitudeSquared(Hr.subtract(l,a,Ll)),m=Hr.magnitudeSquared(Hr.subtract(u,s,Ll)),y=Hr.magnitudeSquared(Hr.subtract(h,c,Ll)),v=a,C=l,I=g;m>I&&(I=m,v=s,C=u),y>I&&(I=y,v=c,C=h);var x=Ql;x.x=.5*(v.x+C.x),x.y=.5*(v.y+C.y),x.z=.5*(v.z+C.z);var E=Hr.magnitudeSquared(Hr.subtract(C,x,Ll)),_=Math.sqrt(E),b=Fl;b.x=a.x,b.y=s.y,b.z=c.z;var w=Pl;w.x=l.x,w.y=u.y,w.z=h.z;var M=Hr.midpoint(b,w,kl),T=0;for(o=0;o<f;o+=n){i.x=t[o]+e.x,i.y=t[o+1]+e.y,i.z=t[o+2]+e.z;var B=Hr.magnitude(Hr.subtract(i,M,Ll));B>T&&(T=B);var S=Hr.magnitudeSquared(Hr.subtract(i,x,Ll));if(S>E){var D=Math.sqrt(S);E=(_=.5*(_+D))*_;var R=D-_;x.x=(_*x.x+R*i.x)/D,x.y=(_*x.y+R*i.y)/D,x.z=(_*x.z+R*i.z)/D}}return _<T?(Hr.clone(x,r.center),r.radius=_):(Hr.clone(M,r.center),r.radius=T),r},Tl.fromEncodedCartesianVertices=function(t,e,n){if(Nr(n)||(n=new Tl),!Nr(t)||!Nr(e)||t.length!==e.length||0===t.length)return n.center=Hr.clone(Hr.ZERO,n.center),n.radius=0,n;var r=Nl;r.x=t[0]+e[0],r.y=t[1]+e[1],r.z=t[2]+e[2];var i,o=Hr.clone(r,Bl),a=Hr.clone(r,Sl),s=Hr.clone(r,Dl),c=Hr.clone(r,Rl),l=Hr.clone(r,zl),u=Hr.clone(r,Ol),h=t.length;for(i=0;i<h;i+=3){var f=t[i]+e[i],d=t[i+1]+e[i+1],p=t[i+2]+e[i+2];r.x=f,r.y=d,r.z=p,f<o.x&&Hr.clone(r,o),f>c.x&&Hr.clone(r,c),d<a.y&&Hr.clone(r,a),d>l.y&&Hr.clone(r,l),p<s.z&&Hr.clone(r,s),p>u.z&&Hr.clone(r,u)}var A=Hr.magnitudeSquared(Hr.subtract(c,o,Ll)),g=Hr.magnitudeSquared(Hr.subtract(l,a,Ll)),m=Hr.magnitudeSquared(Hr.subtract(u,s,Ll)),y=o,v=c,C=A;g>C&&(C=g,y=a,v=l),m>C&&(C=m,y=s,v=u);var I=Ql;I.x=.5*(y.x+v.x),I.y=.5*(y.y+v.y),I.z=.5*(y.z+v.z);var x=Hr.magnitudeSquared(Hr.subtract(v,I,Ll)),E=Math.sqrt(x),_=Fl;_.x=o.x,_.y=a.y,_.z=s.z;var b=Pl;b.x=c.x,b.y=l.y,b.z=u.z;var w=Hr.midpoint(_,b,kl),M=0;for(i=0;i<h;i+=3){r.x=t[i]+e[i],r.y=t[i+1]+e[i+1],r.z=t[i+2]+e[i+2];var T=Hr.magnitude(Hr.subtract(r,w,Ll));T>M&&(M=T);var B=Hr.magnitudeSquared(Hr.subtract(r,I,Ll));if(B>x){var S=Math.sqrt(B);x=(E=.5*(E+S))*E;var D=S-E;I.x=(E*I.x+D*r.x)/S,I.y=(E*I.y+D*r.y)/S,I.z=(E*I.z+D*r.z)/S}}return E<M?(Hr.clone(I,n.center),n.radius=E):(Hr.clone(w,n.center),n.radius=M),n},Tl.fromCornerPoints=function(t,e,n){Qr.typeOf.object("corner",t),Qr.typeOf.object("oppositeCorner",e),Nr(n)||(n=new Tl);var r=Hr.midpoint(t,e,n.center);return n.radius=Hr.distance(r,e),n},Tl.fromEllipsoid=function(t,e){return Qr.typeOf.object("ellipsoid",t),Nr(e)||(e=new Tl),Hr.clone(Hr.ZERO,e.center),e.radius=t.maximumRadius,e};var Kl=new Hr;Tl.fromBoundingSpheres=function(t,e){if(Nr(e)||(e=new Tl),!Nr(t)||0===t.length)return e.center=Hr.clone(Hr.ZERO,e.center),e.radius=0,e;var n=t.length;if(1===n)return Tl.clone(t[0],e);if(2===n)return Tl.union(t[0],t[1],e);var r,i=[];for(r=0;r<n;r++)i.push(t[r].center);var o=(e=Tl.fromPoints(i,e)).center,a=e.radius;for(r=0;r<n;r++){var s=t[r];a=Math.max(a,Hr.distance(o,s.center,Kl)+s.radius)}return e.radius=a,e};var Wl=new Hr,Xl=new Hr,Jl=new Hr;Tl.fromOrientedBoundingBox=function(t,e){Qr.defined("orientedBoundingBox",t),Nr(e)||(e=new Tl);var n=t.halfAxes,r=$a.getColumn(n,0,Wl),i=$a.getColumn(n,1,Xl),o=$a.getColumn(n,2,Jl);return Hr.add(r,i,r),Hr.add(r,o,r),e.center=Hr.clone(t.center,e.center),e.radius=Hr.magnitude(r),e},Tl.clone=function(t,e){if(Nr(t))return Nr(e)?(e.center=Hr.clone(t.center,e.center),e.radius=t.radius,e):new Tl(t.center,t.radius)},Tl.packedLength=4,Tl.pack=function(t,e,n){Qr.typeOf.object("value",t),Qr.defined("array",e),n=Pr(n,0);var r=t.center;return e[n++]=r.x,e[n++]=r.y,e[n++]=r.z,e[n]=t.radius,e},Tl.unpack=function(t,e,n){Qr.defined("array",t),e=Pr(e,0),Nr(n)||(n=new Tl);var r=n.center;return r.x=t[e++],r.y=t[e++],r.z=t[e++],n.radius=t[e],n};var Zl=new Hr,$l=new Hr;Tl.union=function(t,e,n){Qr.typeOf.object("left",t),Qr.typeOf.object("right",e),Nr(n)||(n=new Tl);var r=t.center,i=t.radius,o=e.center,a=e.radius,s=Hr.subtract(o,r,Zl),c=Hr.magnitude(s);if(i>=c+a)return t.clone(n),n;if(a>=c+i)return e.clone(n),n;var l=.5*(i+c+a),u=Hr.multiplyByScalar(s,(-i+l)/c,$l);return Hr.add(u,r,u),Hr.clone(u,n.center),n.radius=l,n};var tu=new Hr;Tl.expand=function(t,e,n){Qr.typeOf.object("sphere",t),Qr.typeOf.object("point",e),n=Tl.clone(t,n);var r=Hr.magnitude(Hr.subtract(e,n.center,tu));return r>n.radius&&(n.radius=r),n},Tl.intersectPlane=function(t,e){Qr.typeOf.object("sphere",t),Qr.typeOf.object("plane",e);var n=t.center,r=t.radius,i=e.normal,o=Hr.dot(i,n)+e.distance;return o<-r?El.OUTSIDE:o<r?El.INTERSECTING:El.INSIDE},Tl.transform=function(t,e,n){return Qr.typeOf.object("sphere",t),Qr.typeOf.object("transform",e),Nr(n)||(n=new Tl),n.center=ls.multiplyByPoint(e,t.center,n.center),n.radius=ls.getMaximumScale(e)*t.radius,n};var eu=new Hr;Tl.distanceSquaredTo=function(t,e){Qr.typeOf.object("sphere",t),Qr.typeOf.object("cartesian",e);var n=Hr.subtract(t.center,e,eu);return Hr.magnitudeSquared(n)-t.radius*t.radius},Tl.transformWithoutScale=function(t,e,n){return Qr.typeOf.object("sphere",t),Qr.typeOf.object("transform",e),Nr(n)||(n=new Tl),n.center=ls.multiplyByPoint(e,t.center,n.center),n.radius=t.radius,n};var nu=new Hr;Tl.computePlaneDistances=function(t,e,n,r){Qr.typeOf.object("sphere",t),Qr.typeOf.object("position",e),Qr.typeOf.object("direction",n),Nr(r)||(r=new _l);var i=Hr.subtract(t.center,e,nu),o=Hr.dot(n,i);return r.start=o-t.radius,r.stop=o+t.radius,r};for(var ru=new Hr,iu=new Hr,ou=new Hr,au=new Hr,su=new Hr,cu=new ri,lu=new Array(8),uu=0;uu<8;++uu)lu[uu]=new Hr;var hu=new Dc;function fu(t,e,n){this.minimum=Hr.clone(Pr(t,Hr.ZERO)),this.maximum=Hr.clone(Pr(e,Hr.ZERO)),n=Nr(n)?Hr.clone(n):Hr.midpoint(this.minimum,this.maximum,new Hr),this.center=n}Tl.projectTo2D=function(t,e,n){Qr.typeOf.object("sphere",t);var r,i=(e=Pr(e,hu)).ellipsoid,o=t.center,a=t.radius;r=Hr.equals(o,Hr.ZERO)?Hr.clone(Hr.UNIT_X,ru):i.geodeticSurfaceNormal(o,ru);var s=Hr.cross(Hr.UNIT_Z,r,iu);Hr.normalize(s,s);var c=Hr.cross(r,s,ou);Hr.normalize(c,c),Hr.multiplyByScalar(r,a,r),Hr.multiplyByScalar(c,a,c),Hr.multiplyByScalar(s,a,s);var l=Hr.negate(c,su),u=Hr.negate(s,au),h=lu,f=h[0];Hr.add(r,c,f),Hr.add(f,s,f),f=h[1],Hr.add(r,c,f),Hr.add(f,u,f),f=h[2],Hr.add(r,l,f),Hr.add(f,u,f),f=h[3],Hr.add(r,l,f),Hr.add(f,s,f),Hr.negate(r,r),f=h[4],Hr.add(r,c,f),Hr.add(f,s,f),f=h[5],Hr.add(r,c,f),Hr.add(f,u,f),f=h[6],Hr.add(r,l,f),Hr.add(f,u,f),f=h[7],Hr.add(r,l,f),Hr.add(f,s,f);for(var d=h.length,p=0;p<d;++p){var A=h[p];Hr.add(o,A,A);var g=i.cartesianToCartographic(A,cu);e.project(g,A)}var m=(o=(n=Tl.fromPoints(h,n)).center).x,y=o.y,v=o.z;return o.x=v,o.y=m,o.z=y,n},Tl.isOccluded=function(t,e){return Qr.typeOf.object("sphere",t),Qr.typeOf.object("occluder",e),!e.isBoundingSphereVisible(t)},Tl.equals=function(t,e){return t===e||Nr(t)&&Nr(e)&&Hr.equals(t.center,e.center)&&t.radius===e.radius},Tl.prototype.intersectPlane=function(t){return Tl.intersectPlane(this,t)},Tl.prototype.distanceSquaredTo=function(t){return Tl.distanceSquaredTo(this,t)},Tl.prototype.computePlaneDistances=function(t,e,n){return Tl.computePlaneDistances(this,t,e,n)},Tl.prototype.isOccluded=function(t){return Tl.isOccluded(this,t)},Tl.prototype.equals=function(t){return Tl.equals(this,t)},Tl.prototype.clone=function(t){return Tl.clone(this,t)},Tl.prototype.volume=function(){var t=this.radius;return Ul*t*t*t},fu.fromPoints=function(t,e){if(Nr(e)||(e=new fu),!Nr(t)||0===t.length)return e.minimum=Hr.clone(Hr.ZERO,e.minimum),e.maximum=Hr.clone(Hr.ZERO,e.maximum),e.center=Hr.clone(Hr.ZERO,e.center),e;for(var n=t[0].x,r=t[0].y,i=t[0].z,o=t[0].x,a=t[0].y,s=t[0].z,c=t.length,l=1;l<c;l++){var u=t[l],h=u.x,f=u.y,d=u.z;n=Math.min(h,n),o=Math.max(h,o),r=Math.min(f,r),a=Math.max(f,a),i=Math.min(d,i),s=Math.max(d,s)}var p=e.minimum;p.x=n,p.y=r,p.z=i;var A=e.maximum;return A.x=o,A.y=a,A.z=s,e.center=Hr.midpoint(p,A,e.center),e},fu.clone=function(t,e){if(Nr(t))return Nr(e)?(e.minimum=Hr.clone(t.minimum,e.minimum),e.maximum=Hr.clone(t.maximum,e.maximum),e.center=Hr.clone(t.center,e.center),e):new fu(t.minimum,t.maximum,t.center)},fu.equals=function(t,e){return t===e||Nr(t)&&Nr(e)&&Hr.equals(t.center,e.center)&&Hr.equals(t.minimum,e.minimum)&&Hr.equals(t.maximum,e.maximum)};var du=new Hr;fu.intersectPlane=function(t,e){Qr.defined("box",t),Qr.defined("plane",e),du=Hr.subtract(t.maximum,t.minimum,du);var n=Hr.multiplyByScalar(du,.5,du),r=e.normal,i=n.x*Math.abs(r.x)+n.y*Math.abs(r.y)+n.z*Math.abs(r.z),o=Hr.dot(t.center,r)+e.distance;return o-i>0?El.INSIDE:o+i<0?El.OUTSIDE:El.INTERSECTING},fu.prototype.clone=function(t){return fu.clone(this,t)},fu.prototype.intersectPlane=function(t){return fu.intersectPlane(this,t)},fu.prototype.equals=function(t){return fu.equals(this,t)};var pu={};function Au(t,e,n){var r=t+e;return Ur.sign(t)!==Ur.sign(e)&&Math.abs(r/Math.max(Math.abs(t),Math.abs(e)))<n?0:r}pu.computeDiscriminant=function(t,e,n){if("number"!=typeof t)throw new Lr("a is a required number.");if("number"!=typeof e)throw new Lr("b is a required number.");if("number"!=typeof n)throw new Lr("c is a required number.");return e*e-4*t*n},pu.computeRealRoots=function(t,e,n){if("number"!=typeof t)throw new Lr("a is a required number.");if("number"!=typeof e)throw new Lr("b is a required number.");if("number"!=typeof n)throw new Lr("c is a required number.");var r;if(0===t)return 0===e?[]:[-n/e];if(0===e){if(0===n)return[0,0];var i=Math.abs(n),o=Math.abs(t);if(i<o&&i/o<Ur.EPSILON14)return[0,0];if(i>o&&o/i<Ur.EPSILON14)return[];if((r=-n/t)<0)return[];var a=Math.sqrt(r);return[-a,a]}if(0===n)return(r=-e/t)<0?[r,0]:[0,r];var s=Au(e*e,-(4*t*n),Ur.EPSILON14);if(s<0)return[];var c=-.5*Au(e,Ur.sign(e)*Math.sqrt(s),Ur.EPSILON14);return e>0?[c/t,n/c]:[n/c,c/t]};var gu={};function mu(t,e,n,r){var i,o,a=t,s=e/3,c=n/3,l=r,u=a*c,h=s*l,f=s*s,d=c*c,p=a*c-f,A=a*l-s*c,g=s*l-d,m=4*p*g-A*A;if(m<0){var y,v,C;f*h>=u*d?(y=a,v=p,C=-2*s*p+a*A):(y=l,v=g,C=-l*A+2*c*g);var I=-(C<0?-1:1)*Math.abs(y)*Math.sqrt(-m),x=(o=-C+I)/2,E=x<0?-Math.pow(-x,1/3):Math.pow(x,1/3),_=o===I?-E:-v/E;return i=v<=0?E+_:-C/(E*E+_*_+v),f*h>=u*d?[(i-s)/a]:[-l/(i+c)]}var b=p,w=-2*s*p+a*A,M=g,T=-l*A+2*c*g,B=Math.sqrt(m),S=Math.sqrt(3)/2,D=Math.abs(Math.atan2(a*B,-w)/3);i=2*Math.sqrt(-b);var R=Math.cos(D);o=i*R;var z=i*(-R/2-S*Math.sin(D)),O=o+z>2*s?o-s:z-s,N=a,L=O/N;D=Math.abs(Math.atan2(l*B,-T)/3);var Q=-l,F=(o=(i=2*Math.sqrt(-M))*(R=Math.cos(D)))+(z=i*(-R/2-S*Math.sin(D)))<2*c?o+c:z+c,P=Q/F,k=-O*F-N*Q,U=(c*k-s*(O*Q))/(-s*k+c*(N*F));return L<=U?L<=P?U<=P?[L,U,P]:[L,P,U]:[P,L,U]:L<=P?[U,L,P]:U<=P?[U,P,L]:[P,U,L]}gu.computeDiscriminant=function(t,e,n,r){if("number"!=typeof t)throw new Lr("a is a required number.");if("number"!=typeof e)throw new Lr("b is a required number.");if("number"!=typeof n)throw new Lr("c is a required number.");if("number"!=typeof r)throw new Lr("d is a required number.");var i=e*e,o=n*n;return 18*t*e*n*r+i*o-27*(t*t)*(r*r)-4*(t*o*n+i*e*r)},gu.computeRealRoots=function(t,e,n,r){if("number"!=typeof t)throw new Lr("a is a required number.");if("number"!=typeof e)throw new Lr("b is a required number.");if("number"!=typeof n)throw new Lr("c is a required number.");if("number"!=typeof r)throw new Lr("d is a required number.");var i,o;if(0===t)return pu.computeRealRoots(e,n,r);if(0===e){if(0===n){if(0===r)return[0,0,0];var a=(o=-r/t)<0?-Math.pow(-o,1/3):Math.pow(o,1/3);return[a,a,a]}return 0===r?0===(i=pu.computeRealRoots(t,0,n)).Length?[0]:[i[0],0,i[1]]:mu(t,0,n,r)}return 0===n?0===r?(o=-e/t)<0?[o,0,0]:[0,0,o]:mu(t,e,0,r):0===r?0===(i=pu.computeRealRoots(t,e,n)).length?[0]:i[1]<=0?[i[0],i[1],0]:i[0]>=0?[0,i[0],i[1]]:[i[0],0,i[1]]:mu(t,e,n,r)};var yu={};function vu(t,e,n,r){var i=t*t,o=e-3*i/8,a=n-e*t/2+i*t/8,s=r-n*t/4+e*i/16-3*i*i/256,c=gu.computeRealRoots(1,2*o,o*o-4*s,-a*a);if(c.length>0){var l=-t/4,u=c[c.length-1];if(Math.abs(u)<Ur.EPSILON14){var h=pu.computeRealRoots(1,o,s);if(2===h.length){var f,d=h[0],p=h[1];if(d>=0&&p>=0){var A=Math.sqrt(d),g=Math.sqrt(p);return[l-g,l-A,l+A,l+g]}if(d>=0&&p<0)return[l-(f=Math.sqrt(d)),l+f];if(d<0&&p>=0)return[l-(f=Math.sqrt(p)),l+f]}return[]}if(u>0){var m=Math.sqrt(u),y=(o+u-a/m)/2,v=(o+u+a/m)/2,C=pu.computeRealRoots(1,m,y),I=pu.computeRealRoots(1,-m,v);return 0!==C.length?(C[0]+=l,C[1]+=l,0!==I.length?(I[0]+=l,I[1]+=l,C[1]<=I[0]?[C[0],C[1],I[0],I[1]]:I[1]<=C[0]?[I[0],I[1],C[0],C[1]]:C[0]>=I[0]&&C[1]<=I[1]?[I[0],C[0],C[1],I[1]]:I[0]>=C[0]&&I[1]<=C[1]?[C[0],I[0],I[1],C[1]]:C[0]>I[0]&&C[0]<I[1]?[I[0],C[0],I[1],C[1]]:[C[0],I[0],C[1],I[1]]):C):0!==I.length?(I[0]+=l,I[1]+=l,I):[]}}return[]}function Cu(t,e,n,r){var i=t*t,o=-2*e,a=n*t+e*e-4*r,s=i*r-n*e*t+n*n,c=gu.computeRealRoots(1,o,a,s);if(c.length>0){var l,u,h,f,d,p,A=c[0],g=e-A,m=g*g,y=t/2,v=g/2,C=m-4*r,I=m+4*Math.abs(r),x=i-4*A,E=i+4*Math.abs(A);if(A<0||C*E<x*I){var _=Math.sqrt(x);l=_/2,u=0===_?0:(t*v-n)/_}else{var b=Math.sqrt(C);l=0===b?0:(t*v-n)/b,u=b/2}0===y&&0===l?(h=0,f=0):Ur.sign(y)===Ur.sign(l)?f=A/(h=y+l):h=A/(f=y-l),0===v&&0===u?(d=0,p=0):Ur.sign(v)===Ur.sign(u)?p=r/(d=v+u):d=r/(p=v-u);var w=pu.computeRealRoots(1,h,d),M=pu.computeRealRoots(1,f,p);if(0!==w.length)return 0!==M.length?w[1]<=M[0]?[w[0],w[1],M[0],M[1]]:M[1]<=w[0]?[M[0],M[1],w[0],w[1]]:w[0]>=M[0]&&w[1]<=M[1]?[M[0],w[0],w[1],M[1]]:M[0]>=w[0]&&M[1]<=w[1]?[w[0],M[0],M[1],w[1]]:w[0]>M[0]&&w[0]<M[1]?[M[0],w[0],M[1],w[1]]:[w[0],M[0],w[1],M[1]]:w;if(0!==M.length)return M}return[]}function Iu(t,e){e=Hr.clone(Pr(e,Hr.ZERO)),Hr.equals(e,Hr.ZERO)||Hr.normalize(e,e),this.origin=Hr.clone(Pr(t,Hr.ZERO)),this.direction=e}yu.computeDiscriminant=function(t,e,n,r,i){if("number"!=typeof t)throw new Lr("a is a required number.");if("number"!=typeof e)throw new Lr("b is a required number.");if("number"!=typeof n)throw new Lr("c is a required number.");if("number"!=typeof r)throw new Lr("d is a required number.");if("number"!=typeof i)throw new Lr("e is a required number.");var o=t*t,a=e*e,s=a*e,c=n*n,l=c*n,u=r*r,h=u*r,f=i*i;return a*c*u-4*s*h-4*t*l*u+18*t*e*n*h-27*o*u*u+256*(o*t)*(f*i)+i*(18*s*n*r-4*a*l+16*t*c*c-80*t*e*c*r-6*t*a*u+144*o*n*u)+f*(144*t*a*n-27*a*a-128*o*c-192*o*e*r)},yu.computeRealRoots=function(t,e,n,r,i){if("number"!=typeof t)throw new Lr("a is a required number.");if("number"!=typeof e)throw new Lr("b is a required number.");if("number"!=typeof n)throw new Lr("c is a required number.");if("number"!=typeof r)throw new Lr("d is a required number.");if("number"!=typeof i)throw new Lr("e is a required number.");if(Math.abs(t)<Ur.EPSILON15)return gu.computeRealRoots(e,n,r,i);var o=e/t,a=n/t,s=r/t,c=i/t,l=o<0?1:0;switch(l+=a<0?l+1:l,l+=s<0?l+1:l,l+=c<0?l+1:l){case 0:case 3:case 4:case 6:case 7:case 9:case 10:case 12:case 13:case 14:case 15:return vu(o,a,s,c);case 1:case 2:case 5:case 8:case 11:return Cu(o,a,s,c);default:return}},Iu.clone=function(t,e){if(Nr(t))return Nr(e)?(e.origin=Hr.clone(t.origin),e.direction=Hr.clone(t.direction),e):new Iu(t.origin,t.direction)},Iu.getPoint=function(t,e,n){return Qr.typeOf.object("ray",t),Qr.typeOf.number("t",e),Nr(n)||(n=new Hr),n=Hr.multiplyByScalar(t.direction,e,n),Hr.add(t.origin,n,n)};var xu={rayPlane:function(t,e,n){if(!Nr(t))throw new Lr("ray is required.");if(!Nr(e))throw new Lr("plane is required.");Nr(n)||(n=new Hr);var r=t.origin,i=t.direction,o=e.normal,a=Hr.dot(o,i);if(!(Math.abs(a)<Ur.EPSILON15)){var s=(-e.distance-Hr.dot(o,r))/a;if(!(s<0))return n=Hr.multiplyByScalar(i,s,n),Hr.add(r,n,n)}}},Eu=new Hr,_u=new Hr,bu=new Hr,wu=new Hr,Mu=new Hr;xu.rayTriangleParametric=function(t,e,n,r,i){if(!Nr(t))throw new Lr("ray is required.");if(!Nr(e))throw new Lr("p0 is required.");if(!Nr(n))throw new Lr("p1 is required.");if(!Nr(r))throw new Lr("p2 is required.");i=Pr(i,!1);var o,a,s,c,l,u=t.origin,h=t.direction,f=Hr.subtract(n,e,Eu),d=Hr.subtract(r,e,_u),p=Hr.cross(h,d,bu),A=Hr.dot(f,p);if(i){if(A<Ur.EPSILON6)return;if(o=Hr.subtract(u,e,wu),(s=Hr.dot(o,p))<0||s>A)return;if(a=Hr.cross(o,f,Mu),(c=Hr.dot(h,a))<0||s+c>A)return;l=Hr.dot(d,a)/A}else{if(Math.abs(A)<Ur.EPSILON6)return;var g=1/A;if(o=Hr.subtract(u,e,wu),(s=Hr.dot(o,p)*g)<0||s>1)return;if(a=Hr.cross(o,f,Mu),(c=Hr.dot(h,a)*g)<0||s+c>1)return;l=Hr.dot(d,a)*g}return l},xu.rayTriangle=function(t,e,n,r,i,o){var a=xu.rayTriangleParametric(t,e,n,r,i);if(Nr(a)&&!(a<0))return Nr(o)||(o=new Hr),Hr.multiplyByScalar(t.direction,a,o),Hr.add(t.origin,o,o)};var Tu=new Iu;xu.lineSegmentTriangle=function(t,e,n,r,i,o,a){if(!Nr(t))throw new Lr("v0 is required.");if(!Nr(e))throw new Lr("v1 is required.");if(!Nr(n))throw new Lr("p0 is required.");if(!Nr(r))throw new Lr("p1 is required.");if(!Nr(i))throw new Lr("p2 is required.");var s=Tu;Hr.clone(t,s.origin),Hr.subtract(e,t,s.direction),Hr.normalize(s.direction,s.direction);var c=xu.rayTriangleParametric(s,n,r,i,o);if(!(!Nr(c)||c<0||c>Hr.distance(t,e)))return Nr(a)||(a=new Hr),Hr.multiplyByScalar(s.direction,c,a),Hr.add(s.origin,a,a)};var Bu={root0:0,root1:0};function Su(t,e,n){Nr(n)||(n=new _l);var r=t.origin,i=t.direction,o=e.center,a=e.radius*e.radius,s=Hr.subtract(r,o,bu),c=function(t,e,n,r){var i=e*e-4*t*n;if(!(i<0)){if(i>0){var o=1/(2*t),a=Math.sqrt(i),s=(-e+a)*o,c=(-e-a)*o;return s<c?(r.root0=s,r.root1=c):(r.root0=c,r.root1=s),r}var l=-e/(2*t);if(0!==l)return r.root0=r.root1=l,r}}(Hr.dot(i,i),2*Hr.dot(i,s),Hr.magnitudeSquared(s)-a,Bu);if(Nr(c))return n.start=c.root0,n.stop=c.root1,n}xu.raySphere=function(t,e,n){if(!Nr(t))throw new Lr("ray is required.");if(!Nr(e))throw new Lr("sphere is required.");if(Nr(n=Su(t,e,n))&&!(n.stop<0))return n.start=Math.max(n.start,0),n};var Du=new Iu;xu.lineSegmentSphere=function(t,e,n,r){if(!Nr(t))throw new Lr("p0 is required.");if(!Nr(e))throw new Lr("p1 is required.");if(!Nr(n))throw new Lr("sphere is required.");var i=Du;Hr.clone(t,i.origin);var o=Hr.subtract(e,t,i.direction),a=Hr.magnitude(o);if(Hr.normalize(o,o),!(!Nr(r=Su(i,n,r))||r.stop<0||r.start>a))return r.start=Math.max(r.start,0),r.stop=Math.min(r.stop,a),r};var Ru=new Hr,zu=new Hr;function Ou(t,e,n){var r=t+e;return Ur.sign(t)!==Ur.sign(e)&&Math.abs(r/Math.max(Math.abs(t),Math.abs(e)))<n?0:r}xu.rayEllipsoid=function(t,e){if(!Nr(t))throw new Lr("ray is required.");if(!Nr(e))throw new Lr("ellipsoid is required.");var n,r,i,o,a,s=e.oneOverRadii,c=Hr.multiplyComponents(s,t.origin,Ru),l=Hr.multiplyComponents(s,t.direction,zu),u=Hr.magnitudeSquared(c),h=Hr.dot(c,l);if(u>1){if(h>=0)return;var f=h*h;if(n=u-1,f<(i=(r=Hr.magnitudeSquared(l))*n))return;if(f>i){o=h*h-i;var d=(a=-h+Math.sqrt(o))/r,p=n/a;return d<p?new _l(d,p):{start:p,stop:d}}var A=Math.sqrt(n/r);return new _l(A,A)}return u<1?(n=u-1,o=h*h-(i=(r=Hr.magnitudeSquared(l))*n),new _l(0,(a=-h+Math.sqrt(o))/r)):h<0?new _l(0,-h/(r=Hr.magnitudeSquared(l))):void 0};var Nu=new Hr,Lu=new Hr,Qu=new Hr,Fu=new Hr,Pu=new Hr,ku=new $a,Uu=new $a,ju=new $a,Gu=new $a,Hu=new $a,qu=new $a,Vu=new $a,Yu=new Hr,Ku=new Hr,Wu=new ri;xu.grazingAltitudeLocation=function(t,e){if(!Nr(t))throw new Lr("ray is required.");if(!Nr(e))throw new Lr("ellipsoid is required.");var n=t.origin,r=t.direction;if(!Hr.equals(n,Hr.ZERO)){var i=e.geodeticSurfaceNormal(n,Nu);if(Hr.dot(r,i)>=0)return n}var o=Nr(this.rayEllipsoid(t,e)),a=e.transformPositionToScaledSpace(r,Nu),s=Hr.normalize(a,a),c=Hr.mostOrthogonalAxis(a,Fu),l=Hr.normalize(Hr.cross(c,s,Lu),Lu),u=Hr.normalize(Hr.cross(s,l,Qu),Qu),h=ku;h[0]=s.x,h[1]=s.y,h[2]=s.z,h[3]=l.x,h[4]=l.y,h[5]=l.z,h[6]=u.x,h[7]=u.y,h[8]=u.z;var f=$a.transpose(h,Uu),d=$a.fromScale(e.radii,ju),p=$a.fromScale(e.oneOverRadii,Gu),A=Hu;A[0]=0,A[1]=-r.z,A[2]=r.y,A[3]=r.z,A[4]=0,A[5]=-r.x,A[6]=-r.y,A[7]=r.x,A[8]=0;var g,m,y=$a.multiply($a.multiply(f,p,qu),A,qu),v=$a.multiply($a.multiply(y,d,Vu),h,Vu),C=$a.multiplyByVector(y,n,Pu),I=function(t,e,n,r,i){var o,a=r*r,s=i*i,c=(t[$a.COLUMN1ROW1]-t[$a.COLUMN2ROW2])*s,l=i*(r*Ou(t[$a.COLUMN1ROW0],t[$a.COLUMN0ROW1],Ur.EPSILON15)+e.y),u=t[$a.COLUMN0ROW0]*a+t[$a.COLUMN2ROW2]*s+r*e.x+n,h=s*Ou(t[$a.COLUMN2ROW1],t[$a.COLUMN1ROW2],Ur.EPSILON15),f=i*(r*Ou(t[$a.COLUMN2ROW0],t[$a.COLUMN0ROW2])+e.z),d=[];if(0===f&&0===h){if(0===(o=pu.computeRealRoots(c,l,u)).length)return d;var p=o[0],A=Math.sqrt(Math.max(1-p*p,0));if(d.push(new Hr(r,i*p,i*-A)),d.push(new Hr(r,i*p,i*A)),2===o.length){var g=o[1],m=Math.sqrt(Math.max(1-g*g,0));d.push(new Hr(r,i*g,i*-m)),d.push(new Hr(r,i*g,i*m))}return d}var y=f*f,v=h*h,C=f*h,I=c*c+v,x=2*(l*c+C),E=2*u*c+l*l-v+y,_=2*(u*l-C),b=u*u-y;if(0===I&&0===x&&0===E&&0===_)return d;var w=(o=yu.computeRealRoots(I,x,E,_,b)).length;if(0===w)return d;for(var M=0;M<w;++M){var T=o[M],B=T*T,S=Math.max(1-B,0),D=Math.sqrt(S),R=(Ur.sign(c)===Ur.sign(u)?Ou(c*B+u,l*T,Ur.EPSILON12):Ur.sign(u)===Ur.sign(l*T)?Ou(c*B,l*T+u,Ur.EPSILON12):Ou(c*B+l*T,u,Ur.EPSILON12))*Ou(h*T,f,Ur.EPSILON15);R<0?d.push(new Hr(r,i*T,i*D)):R>0?d.push(new Hr(r,i*T,i*-D)):0!==D?(d.push(new Hr(r,i*T,i*-D)),d.push(new Hr(r,i*T,i*D)),++M):d.push(new Hr(r,i*T,i*D))}return d}(v,Hr.negate(C,Nu),0,0,1),x=I.length;if(x>0){for(var E=Hr.clone(Hr.ZERO,Ku),_=Number.NEGATIVE_INFINITY,b=0;b<x;++b){g=$a.multiplyByVector(d,$a.multiplyByVector(h,I[b],Yu),Yu);var w=Hr.normalize(Hr.subtract(g,n,Fu),Fu),M=Hr.dot(w,r);M>_&&(_=M,E=Hr.clone(g,E))}var T=e.cartesianToCartographic(E,Wu);return _=Ur.clamp(_,0,1),m=Hr.magnitude(Hr.subtract(E,n,Fu))*Math.sqrt(1-_*_),m=o?-m:m,T.height=m,e.cartographicToCartesian(T,new Hr)}};var Xu=new Hr;function Ju(t,e){if(Qr.typeOf.object("normal",t),!Ur.equalsEpsilon(Hr.magnitude(t),1,Ur.EPSILON6))throw new Lr("normal must be normalized.");Qr.typeOf.number("distance",e),this.normal=Hr.clone(t),this.distance=e}xu.lineSegmentPlane=function(t,e,n,r){if(!Nr(t))throw new Lr("endPoint0 is required.");if(!Nr(e))throw new Lr("endPoint1 is required.");if(!Nr(n))throw new Lr("plane is required.");Nr(r)||(r=new Hr);var i=Hr.subtract(e,t,Xu),o=n.normal,a=Hr.dot(o,i);if(!(Math.abs(a)<Ur.EPSILON6)){var s=Hr.dot(o,t),c=-(n.distance+s)/a;if(!(c<0||c>1))return Hr.multiplyByScalar(i,c,r),Hr.add(t,r,r),r}},xu.trianglePlaneIntersection=function(t,e,n,r){if(!(Nr(t)&&Nr(e)&&Nr(n)&&Nr(r)))throw new Lr("p0, p1, p2, and plane are required.");var i,o,a=r.normal,s=r.distance,c=Hr.dot(a,t)+s<0,l=Hr.dot(a,e)+s<0,u=Hr.dot(a,n)+s<0,h=0;if(h+=c?1:0,h+=l?1:0,1!==(h+=u?1:0)&&2!==h||(i=new Hr,o=new Hr),1===h){if(c)return xu.lineSegmentPlane(t,e,r,i),xu.lineSegmentPlane(t,n,r,o),{positions:[t,e,n,i,o],indices:[0,3,4,1,2,4,1,4,3]};if(l)return xu.lineSegmentPlane(e,n,r,i),xu.lineSegmentPlane(e,t,r,o),{positions:[t,e,n,i,o],indices:[1,3,4,2,0,4,2,4,3]};if(u)return xu.lineSegmentPlane(n,t,r,i),xu.lineSegmentPlane(n,e,r,o),{positions:[t,e,n,i,o],indices:[2,3,4,0,1,4,0,4,3]}}else if(2===h){if(!c)return xu.lineSegmentPlane(e,t,r,i),xu.lineSegmentPlane(n,t,r,o),{positions:[t,e,n,i,o],indices:[1,2,4,1,4,3,0,3,4]};if(!l)return xu.lineSegmentPlane(n,e,r,i),xu.lineSegmentPlane(t,e,r,o),{positions:[t,e,n,i,o],indices:[2,0,4,2,4,3,1,3,4]};if(!u)return xu.lineSegmentPlane(t,n,r,i),xu.lineSegmentPlane(e,n,r,o),{positions:[t,e,n,i,o],indices:[0,1,4,0,4,3,2,3,4]}}},Ju.fromPointNormal=function(t,e,n){if(Qr.typeOf.object("point",t),Qr.typeOf.object("normal",e),!Ur.equalsEpsilon(Hr.magnitude(e),1,Ur.EPSILON6))throw new Lr("normal must be normalized.");var r=-Hr.dot(e,t);return Nr(n)?(Hr.clone(e,n.normal),n.distance=r,n):new Ju(e,r)};var Zu=new Hr;Ju.fromCartesian4=function(t,e){Qr.typeOf.object("coefficients",t);var n=Hr.fromCartesian4(t,Zu),r=t.w;if(!Ur.equalsEpsilon(Hr.magnitude(n),1,Ur.EPSILON6))throw new Lr("normal must be normalized.");return Nr(e)?(Hr.clone(n,e.normal),e.distance=r,e):new Ju(n,r)},Ju.getPointDistance=function(t,e){return Qr.typeOf.object("plane",t),Qr.typeOf.object("point",e),Hr.dot(t.normal,e)+t.distance};var $u=new Hr;Ju.projectPointOntoPlane=function(t,e,n){Qr.typeOf.object("plane",t),Qr.typeOf.object("point",e),Nr(n)||(n=new Hr);var r=Ju.getPointDistance(t,e),i=Hr.multiplyByScalar(t.normal,r,$u);return Hr.subtract(e,i,n)};var th=new Hr;Ju.transform=function(t,e,n){return Qr.typeOf.object("plane",t),Qr.typeOf.object("transform",e),ls.multiplyByPointAsVector(e,t.normal,Zu),Hr.normalize(Zu,Zu),Hr.multiplyByScalar(t.normal,-t.distance,th),ls.multiplyByPoint(e,th,th),Ju.fromPointNormal(th,Zu,n)},Ju.clone=function(t,e){return Qr.typeOf.object("plane",t),Nr(e)?(Hr.clone(t.normal,e.normal),e.distance=t.distance,e):new Ju(t.normal,t.distance)},Ju.equals=function(t,e){return Qr.typeOf.object("left",t),Qr.typeOf.object("right",e),t.distance===e.distance&&Hr.equals(t.normal,e.normal)},Ju.ORIGIN_XY_PLANE=Object.freeze(new Ju(Hr.UNIT_Z,0)),Ju.ORIGIN_YZ_PLANE=Object.freeze(new Ju(Hr.UNIT_X,0)),Ju.ORIGIN_ZX_PLANE=Object.freeze(new Ju(Hr.UNIT_Y,0));var eh=new Oi;function nh(t,e){if(Qr.defined("origin",t),!Nr(t=(e=Pr(e,Ra.WGS84)).scaleToGeodeticSurface(t)))throw new Lr("origin must not be at the center of the ellipsoid.");var n=Rc.eastNorthUpToFixedFrame(t,e);this._ellipsoid=e,this._origin=t,this._xAxis=Hr.fromCartesian4(ls.getColumn(n,0,eh)),this._yAxis=Hr.fromCartesian4(ls.getColumn(n,1,eh));var r=Hr.fromCartesian4(ls.getColumn(n,2,eh));this._plane=Ju.fromPointNormal(t,r)}Object.defineProperties(nh.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},origin:{get:function(){return this._origin}},plane:{get:function(){return this._plane}},xAxis:{get:function(){return this._xAxis}},yAxis:{get:function(){return this._yAxis}},zAxis:{get:function(){return this._plane.normal}}});var rh=new fu;nh.fromPoints=function(t,e){return Qr.defined("cartesians",t),new nh(fu.fromPoints(t,rh).center,e)};var ih=new Iu,oh=new Hr;nh.prototype.projectPointOntoPlane=function(t,e){Qr.defined("cartesian",t);var n=ih;n.origin=t,Hr.normalize(t,n.direction);var r=xu.rayPlane(n,this._plane,oh);if(Nr(r)||(Hr.negate(n.direction,n.direction),r=xu.rayPlane(n,this._plane,oh)),Nr(r)){var i=Hr.subtract(r,this._origin,r),o=Hr.dot(this._xAxis,i),a=Hr.dot(this._yAxis,i);return Nr(e)?(e.x=o,e.y=a,e):new Ti(o,a)}},nh.prototype.projectPointsOntoPlane=function(t,e){Qr.defined("cartesians",t),Nr(e)||(e=[]);for(var n=0,r=t.length,i=0;i<r;i++){var o=this.projectPointOntoPlane(t[i],e[n]);Nr(o)&&(e[n]=o,n++)}return e.length=n,e},nh.prototype.projectPointToNearestOnPlane=function(t,e){Qr.defined("cartesian",t),Nr(e)||(e=new Ti);var n=ih;n.origin=t,Hr.clone(this._plane.normal,n.direction);var r=xu.rayPlane(n,this._plane,oh);Nr(r)||(Hr.negate(n.direction,n.direction),r=xu.rayPlane(n,this._plane,oh));var i=Hr.subtract(r,this._origin,r),o=Hr.dot(this._xAxis,i),a=Hr.dot(this._yAxis,i);return e.x=o,e.y=a,e},nh.prototype.projectPointsToNearestOnPlane=function(t,e){Qr.defined("cartesians",t),Nr(e)||(e=[]);var n=t.length;e.length=n;for(var r=0;r<n;r++)e[r]=this.projectPointToNearestOnPlane(t[r],e[r]);return e};var ah=new Hr;function sh(t,e,n=2){const r=e&&e.length,i=r?e[0]*n:t.length;let o=ch(t,0,i,n,!0);const a=[];if(!o||o.next===o.prev)return a;let s,c,l;if(r&&(o=function(t,e,n,r){const i=[];for(let n=0,o=e.length;n<o;n++){const a=ch(t,e[n]*r,n<o-1?e[n+1]*r:t.length,r,!1);a===a.next&&(a.steiner=!0),i.push(vh(a))}i.sort(Ah);for(let t=0;t<i.length;t++)n=gh(i[t],n);return n}(t,e,o,n)),t.length>80*n){s=1/0,c=1/0;let e=-1/0,r=-1/0;for(let o=n;o<i;o+=n){const n=t[o],i=t[o+1];n<s&&(s=n),i<c&&(c=i),n>e&&(e=n),i>r&&(r=i)}l=Math.max(e-s,r-c),l=0!==l?32767/l:0}return uh(o,a,n,s,c,l,0),a}function ch(t,e,n,r,i){let o;if(i===function(t,e,n,r){let i=0;for(let o=e,a=n-r;o<n;o+=r)i+=(t[a]-t[o])*(t[o+1]+t[a+1]),a=o;return i}(t,e,n,r)>0)for(let i=e;i<n;i+=r)o=Sh(i/r|0,t[i],t[i+1],o);else for(let i=n-r;i>=e;i-=r)o=Sh(i/r|0,t[i],t[i+1],o);return o&&_h(o,o.next)&&(Dh(o),o=o.next),o}function lh(t,e){if(!t)return t;e||(e=t);let n,r=t;do{if(n=!1,r.steiner||!_h(r,r.next)&&0!==Eh(r.prev,r,r.next))r=r.next;else{if(Dh(r),r=e=r.prev,r===r.next)break;n=!0}}while(n||r!==e);return e}function uh(t,e,n,r,i,o,a){if(!t)return;!a&&o&&function(t,e,n,r){let i=t;do{0===i.z&&(i.z=yh(i.x,i.y,e,n,r)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==t);i.prevZ.nextZ=null,i.prevZ=null,function(t){let e,n=1;do{let r,i=t;t=null;let o=null;for(e=0;i;){e++;let a=i,s=0;for(let t=0;t<n&&(s++,a=a.nextZ,a);t++);let c=n;for(;s>0||c>0&&a;)0!==s&&(0===c||!a||i.z<=a.z)?(r=i,i=i.nextZ,s--):(r=a,a=a.nextZ,c--),o?o.nextZ=r:t=r,r.prevZ=o,o=r;i=a}o.nextZ=null,n*=2}while(e>1)}(i)}(t,r,i,o);let s=t;for(;t.prev!==t.next;){const c=t.prev,l=t.next;if(o?fh(t,r,i,o):hh(t))e.push(c.i,t.i,l.i),Dh(t),t=l.next,s=l.next;else if((t=l)===s){a?1===a?uh(t=dh(lh(t),e),e,n,r,i,o,2):2===a&&ph(t,e,n,r,i,o):uh(lh(t),e,n,r,i,o,1);break}}}function hh(t){const e=t.prev,n=t,r=t.next;if(Eh(e,n,r)>=0)return!1;const i=e.x,o=n.x,a=r.x,s=e.y,c=n.y,l=r.y,u=Math.min(i,o,a),h=Math.min(s,c,l),f=Math.max(i,o,a),d=Math.max(s,c,l);let p=r.next;for(;p!==e;){if(p.x>=u&&p.x<=f&&p.y>=h&&p.y<=d&&Ih(i,s,o,c,a,l,p.x,p.y)&&Eh(p.prev,p,p.next)>=0)return!1;p=p.next}return!0}function fh(t,e,n,r){const i=t.prev,o=t,a=t.next;if(Eh(i,o,a)>=0)return!1;const s=i.x,c=o.x,l=a.x,u=i.y,h=o.y,f=a.y,d=Math.min(s,c,l),p=Math.min(u,h,f),A=Math.max(s,c,l),g=Math.max(u,h,f),m=yh(d,p,e,n,r),y=yh(A,g,e,n,r);let v=t.prevZ,C=t.nextZ;for(;v&&v.z>=m&&C&&C.z<=y;){if(v.x>=d&&v.x<=A&&v.y>=p&&v.y<=g&&v!==i&&v!==a&&Ih(s,u,c,h,l,f,v.x,v.y)&&Eh(v.prev,v,v.next)>=0)return!1;if(v=v.prevZ,C.x>=d&&C.x<=A&&C.y>=p&&C.y<=g&&C!==i&&C!==a&&Ih(s,u,c,h,l,f,C.x,C.y)&&Eh(C.prev,C,C.next)>=0)return!1;C=C.nextZ}for(;v&&v.z>=m;){if(v.x>=d&&v.x<=A&&v.y>=p&&v.y<=g&&v!==i&&v!==a&&Ih(s,u,c,h,l,f,v.x,v.y)&&Eh(v.prev,v,v.next)>=0)return!1;v=v.prevZ}for(;C&&C.z<=y;){if(C.x>=d&&C.x<=A&&C.y>=p&&C.y<=g&&C!==i&&C!==a&&Ih(s,u,c,h,l,f,C.x,C.y)&&Eh(C.prev,C,C.next)>=0)return!1;C=C.nextZ}return!0}function dh(t,e){let n=t;do{const r=n.prev,i=n.next.next;!_h(r,i)&&bh(r,n,n.next,i)&&Th(r,i)&&Th(i,r)&&(e.push(r.i,n.i,i.i),Dh(n),Dh(n.next),n=t=i),n=n.next}while(n!==t);return lh(n)}function ph(t,e,n,r,i,o){let a=t;do{let t=a.next.next;for(;t!==a.prev;){if(a.i!==t.i&&xh(a,t)){let s=Bh(a,t);return a=lh(a,a.next),s=lh(s,s.next),uh(a,e,n,r,i,o,0),void uh(s,e,n,r,i,o,0)}t=t.next}a=a.next}while(a!==t)}function Ah(t,e){let n=t.x-e.x;if(0===n&&(n=t.y-e.y,0===n)){n=(t.next.y-t.y)/(t.next.x-t.x)-(e.next.y-e.y)/(e.next.x-e.x)}return n}function gh(t,e){const n=function(t,e){let n=e;const r=t.x,i=t.y;let o,a=-1/0;if(_h(t,n))return n;do{if(_h(t,n.next))return n.next;if(i<=n.y&&i>=n.next.y&&n.next.y!==n.y){const t=n.x+(i-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(t<=r&&t>a&&(a=t,o=n.x<n.next.x?n:n.next,t===r))return o}n=n.next}while(n!==e);if(!o)return null;const s=o,c=o.x,l=o.y;let u=1/0;n=o;do{if(r>=n.x&&n.x>=c&&r!==n.x&&Ch(i<l?r:a,i,c,l,i<l?a:r,i,n.x,n.y)){const e=Math.abs(i-n.y)/(r-n.x);Th(n,t)&&(e<u||e===u&&(n.x>o.x||n.x===o.x&&mh(o,n)))&&(o=n,u=e)}n=n.next}while(n!==s);return o}(t,e);if(!n)return e;const r=Bh(n,t);return lh(r,r.next),lh(n,n.next)}function mh(t,e){return Eh(t.prev,t,e.prev)<0&&Eh(e.next,t,t.next)<0}function yh(t,e,n,r,i){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-n)*i|0)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-r)*i|0)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function vh(t){let e=t,n=t;do{(e.x<n.x||e.x===n.x&&e.y<n.y)&&(n=e),e=e.next}while(e!==t);return n}function Ch(t,e,n,r,i,o,a,s){return(i-a)*(e-s)>=(t-a)*(o-s)&&(t-a)*(r-s)>=(n-a)*(e-s)&&(n-a)*(o-s)>=(i-a)*(r-s)}function Ih(t,e,n,r,i,o,a,s){return!(t===a&&e===s)&&Ch(t,e,n,r,i,o,a,s)}function xh(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){let n=t;do{if(n.i!==t.i&&n.next.i!==t.i&&n.i!==e.i&&n.next.i!==e.i&&bh(n,n.next,t,e))return!0;n=n.next}while(n!==t);return!1}(t,e)&&(Th(t,e)&&Th(e,t)&&function(t,e){let n=t,r=!1;const i=(t.x+e.x)/2,o=(t.y+e.y)/2;do{n.y>o!=n.next.y>o&&n.next.y!==n.y&&i<(n.next.x-n.x)*(o-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next}while(n!==t);return r}(t,e)&&(Eh(t.prev,t,e.prev)||Eh(t,e.prev,e))||_h(t,e)&&Eh(t.prev,t,t.next)>0&&Eh(e.prev,e,e.next)>0)}function Eh(t,e,n){return(e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y)}function _h(t,e){return t.x===e.x&&t.y===e.y}function bh(t,e,n,r){const i=Mh(Eh(t,e,n)),o=Mh(Eh(t,e,r)),a=Mh(Eh(n,r,t)),s=Mh(Eh(n,r,e));return i!==o&&a!==s||(!(0!==i||!wh(t,n,e))||(!(0!==o||!wh(t,r,e))||(!(0!==a||!wh(n,t,r))||!(0!==s||!wh(n,e,r)))))}function wh(t,e,n){return e.x<=Math.max(t.x,n.x)&&e.x>=Math.min(t.x,n.x)&&e.y<=Math.max(t.y,n.y)&&e.y>=Math.min(t.y,n.y)}function Mh(t){return t>0?1:t<0?-1:0}function Th(t,e){return Eh(t.prev,t,t.next)<0?Eh(t,e,t.next)>=0&&Eh(t,t.prev,e)>=0:Eh(t,e,t.prev)<0||Eh(t,t.next,e)<0}function Bh(t,e){const n=Rh(t.i,t.x,t.y),r=Rh(e.i,e.x,e.y),i=t.next,o=e.prev;return t.next=e,e.prev=t,n.next=i,i.prev=n,r.next=n,n.prev=r,o.next=r,r.prev=o,r}function Sh(t,e,n,r){const i=Rh(t,e,n);return r?(i.next=r.next,i.prev=r,r.next.prev=i,r.next=i):(i.prev=i,i.next=i),i}function Dh(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 Rh(t,e,n){return{i:t,x:e,y:n,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}nh.prototype.projectPointOntoEllipsoid=function(t,e){Qr.defined("cartesian",t),Nr(e)||(e=new Hr);var n=this._ellipsoid,r=this._origin,i=this._xAxis,o=this._yAxis,a=ah;return Hr.multiplyByScalar(i,t.x,a),e=Hr.add(r,a,e),Hr.multiplyByScalar(o,t.y,a),Hr.add(e,a,e),n.scaleToGeocentricSurface(e,e),e},nh.prototype.projectPointsOntoEllipsoid=function(t,e){Qr.defined("cartesians",t);var n=t.length;Nr(e)?e.length=n:e=new Array(n);for(var r=0;r<n;++r)e[r]=this.projectPointOntoEllipsoid(t[r],e[r]);return e};var zh=Object.freeze({DEPTH_BUFFER_BIT:256,STENCIL_BUFFER_BIT:1024,COLOR_BUFFER_BIT:16384,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,ZERO:0,ONE:1,SRC_COLOR:768,ONE_MINUS_SRC_COLOR:769,SRC_ALPHA:770,ONE_MINUS_SRC_ALPHA:771,DST_ALPHA:772,ONE_MINUS_DST_ALPHA:773,DST_COLOR:774,ONE_MINUS_DST_COLOR:775,SRC_ALPHA_SATURATE:776,FUNC_ADD:32774,BLEND_EQUATION:32777,BLEND_EQUATION_RGB:32777,BLEND_EQUATION_ALPHA:34877,FUNC_SUBTRACT:32778,FUNC_REVERSE_SUBTRACT:32779,BLEND_DST_RGB:32968,BLEND_SRC_RGB:32969,BLEND_DST_ALPHA:32970,BLEND_SRC_ALPHA:32971,CONSTANT_COLOR:32769,ONE_MINUS_CONSTANT_COLOR:32770,CONSTANT_ALPHA:32771,ONE_MINUS_CONSTANT_ALPHA:32772,BLEND_COLOR:32773,ARRAY_BUFFER:34962,ELEMENT_ARRAY_BUFFER:34963,ARRAY_BUFFER_BINDING:34964,ELEMENT_ARRAY_BUFFER_BINDING:34965,STREAM_DRAW:35040,STATIC_DRAW:35044,DYNAMIC_DRAW:35048,BUFFER_SIZE:34660,BUFFER_USAGE:34661,CURRENT_VERTEX_ATTRIB:34342,FRONT:1028,BACK:1029,FRONT_AND_BACK:1032,CULL_FACE:2884,BLEND:3042,DITHER:3024,STENCIL_TEST:2960,DEPTH_TEST:2929,SCISSOR_TEST:3089,POLYGON_OFFSET_FILL:32823,SAMPLE_ALPHA_TO_COVERAGE:32926,SAMPLE_COVERAGE:32928,NO_ERROR:0,INVALID_ENUM:1280,INVALID_VALUE:1281,INVALID_OPERATION:1282,OUT_OF_MEMORY:1285,CW:2304,CCW:2305,LINE_WIDTH:2849,ALIASED_POINT_SIZE_RANGE:33901,ALIASED_LINE_WIDTH_RANGE:33902,CULL_FACE_MODE:2885,FRONT_FACE:2886,DEPTH_RANGE:2928,DEPTH_WRITEMASK:2930,DEPTH_CLEAR_VALUE:2931,DEPTH_FUNC:2932,STENCIL_CLEAR_VALUE:2961,STENCIL_FUNC:2962,STENCIL_FAIL:2964,STENCIL_PASS_DEPTH_FAIL:2965,STENCIL_PASS_DEPTH_PASS:2966,STENCIL_REF:2967,STENCIL_VALUE_MASK:2963,STENCIL_WRITEMASK:2968,STENCIL_BACK_FUNC:34816,STENCIL_BACK_FAIL:34817,STENCIL_BACK_PASS_DEPTH_FAIL:34818,STENCIL_BACK_PASS_DEPTH_PASS:34819,STENCIL_BACK_REF:36003,STENCIL_BACK_VALUE_MASK:36004,STENCIL_BACK_WRITEMASK:36005,VIEWPORT:2978,SCISSOR_BOX:3088,COLOR_CLEAR_VALUE:3106,COLOR_WRITEMASK:3107,UNPACK_ALIGNMENT:3317,PACK_ALIGNMENT:3333,MAX_TEXTURE_SIZE:3379,MAX_VIEWPORT_DIMS:3386,SUBPIXEL_BITS:3408,RED_BITS:3410,GREEN_BITS:3411,BLUE_BITS:3412,ALPHA_BITS:3413,DEPTH_BITS:3414,STENCIL_BITS:3415,POLYGON_OFFSET_UNITS:10752,POLYGON_OFFSET_FACTOR:32824,TEXTURE_BINDING_2D:32873,SAMPLE_BUFFERS:32936,SAMPLES:32937,SAMPLE_COVERAGE_VALUE:32938,SAMPLE_COVERAGE_INVERT:32939,COMPRESSED_TEXTURE_FORMATS:34467,DONT_CARE:4352,FASTEST:4353,NICEST:4354,GENERATE_MIPMAP_HINT:33170,BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,DEPTH_COMPONENT:6402,ALPHA:6406,RGB:6407,RGBA:6408,LUMINANCE:6409,LUMINANCE_ALPHA:6410,UNSIGNED_SHORT_4_4_4_4:32819,UNSIGNED_SHORT_5_5_5_1:32820,UNSIGNED_SHORT_5_6_5:33635,FRAGMENT_SHADER:35632,VERTEX_SHADER:35633,MAX_VERTEX_ATTRIBS:34921,MAX_VERTEX_UNIFORM_VECTORS:36347,MAX_VARYING_VECTORS:36348,MAX_COMBINED_TEXTURE_IMAGE_UNITS:35661,MAX_VERTEX_TEXTURE_IMAGE_UNITS:35660,MAX_TEXTURE_IMAGE_UNITS:34930,MAX_FRAGMENT_UNIFORM_VECTORS:36349,SHADER_TYPE:35663,DELETE_STATUS:35712,LINK_STATUS:35714,VALIDATE_STATUS:35715,ATTACHED_SHADERS:35717,ACTIVE_UNIFORMS:35718,ACTIVE_ATTRIBUTES:35721,SHADING_LANGUAGE_VERSION:35724,CURRENT_PROGRAM:35725,NEVER:512,LESS:513,EQUAL:514,LEQUAL:515,GREATER:516,NOTEQUAL:517,GEQUAL:518,ALWAYS:519,KEEP:7680,REPLACE:7681,INCR:7682,DECR:7683,INVERT:5386,INCR_WRAP:34055,DECR_WRAP:34056,VENDOR:7936,RENDERER:7937,VERSION:7938,NEAREST:9728,LINEAR:9729,NEAREST_MIPMAP_NEAREST:9984,LINEAR_MIPMAP_NEAREST:9985,NEAREST_MIPMAP_LINEAR:9986,LINEAR_MIPMAP_LINEAR:9987,TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,TEXTURE_2D:3553,TEXTURE:5890,TEXTURE_CUBE_MAP:34067,TEXTURE_BINDING_CUBE_MAP:34068,TEXTURE_CUBE_MAP_POSITIVE_X:34069,TEXTURE_CUBE_MAP_NEGATIVE_X:34070,TEXTURE_CUBE_MAP_POSITIVE_Y:34071,TEXTURE_CUBE_MAP_NEGATIVE_Y:34072,TEXTURE_CUBE_MAP_POSITIVE_Z:34073,TEXTURE_CUBE_MAP_NEGATIVE_Z:34074,MAX_CUBE_MAP_TEXTURE_SIZE:34076,TEXTURE0:33984,TEXTURE1:33985,TEXTURE2:33986,TEXTURE3:33987,TEXTURE4:33988,TEXTURE5:33989,TEXTURE6:33990,TEXTURE7:33991,TEXTURE8:33992,TEXTURE9:33993,TEXTURE10:33994,TEXTURE11:33995,TEXTURE12:33996,TEXTURE13:33997,TEXTURE14:33998,TEXTURE15:33999,TEXTURE16:34e3,TEXTURE17:34001,TEXTURE18:34002,TEXTURE19:34003,TEXTURE20:34004,TEXTURE21:34005,TEXTURE22:34006,TEXTURE23:34007,TEXTURE24:34008,TEXTURE25:34009,TEXTURE26:34010,TEXTURE27:34011,TEXTURE28:34012,TEXTURE29:34013,TEXTURE30:34014,TEXTURE31:34015,ACTIVE_TEXTURE:34016,REPEAT:10497,CLAMP_TO_EDGE:33071,MIRRORED_REPEAT:33648,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,INT_VEC2:35667,INT_VEC3:35668,INT_VEC4:35669,BOOL:35670,BOOL_VEC2:35671,BOOL_VEC3:35672,BOOL_VEC4:35673,FLOAT_MAT2:35674,FLOAT_MAT3:35675,FLOAT_MAT4:35676,SAMPLER_2D:35678,SAMPLER_CUBE:35680,VERTEX_ATTRIB_ARRAY_ENABLED:34338,VERTEX_ATTRIB_ARRAY_SIZE:34339,VERTEX_ATTRIB_ARRAY_STRIDE:34340,VERTEX_ATTRIB_ARRAY_TYPE:34341,VERTEX_ATTRIB_ARRAY_NORMALIZED:34922,VERTEX_ATTRIB_ARRAY_POINTER:34373,VERTEX_ATTRIB_ARRAY_BUFFER_BINDING:34975,IMPLEMENTATION_COLOR_READ_TYPE:35738,IMPLEMENTATION_COLOR_READ_FORMAT:35739,COMPILE_STATUS:35713,LOW_FLOAT:36336,MEDIUM_FLOAT:36337,HIGH_FLOAT:36338,LOW_INT:36339,MEDIUM_INT:36340,HIGH_INT:36341,FRAMEBUFFER:36160,RENDERBUFFER:36161,RGBA4:32854,RGB5_A1:32855,RGB565:36194,DEPTH_COMPONENT16:33189,STENCIL_INDEX:6401,STENCIL_INDEX8:36168,DEPTH_STENCIL:34041,RENDERBUFFER_WIDTH:36162,RENDERBUFFER_HEIGHT:36163,RENDERBUFFER_INTERNAL_FORMAT:36164,RENDERBUFFER_RED_SIZE:36176,RENDERBUFFER_GREEN_SIZE:36177,RENDERBUFFER_BLUE_SIZE:36178,RENDERBUFFER_ALPHA_SIZE:36179,RENDERBUFFER_DEPTH_SIZE:36180,RENDERBUFFER_STENCIL_SIZE:36181,FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE:36048,FRAMEBUFFER_ATTACHMENT_OBJECT_NAME:36049,FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL:36050,FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE:36051,COLOR_ATTACHMENT0:36064,DEPTH_ATTACHMENT:36096,STENCIL_ATTACHMENT:36128,DEPTH_STENCIL_ATTACHMENT:33306,NONE:0,FRAMEBUFFER_COMPLETE:36053,FRAMEBUFFER_INCOMPLETE_ATTACHMENT:36054,FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:36055,FRAMEBUFFER_INCOMPLETE_DIMENSIONS:36057,FRAMEBUFFER_UNSUPPORTED:36061,FRAMEBUFFER_BINDING:36006,RENDERBUFFER_BINDING:36007,MAX_RENDERBUFFER_SIZE:34024,INVALID_FRAMEBUFFER_OPERATION:1286,UNPACK_FLIP_Y_WEBGL:37440,UNPACK_PREMULTIPLY_ALPHA_WEBGL:37441,CONTEXT_LOST_WEBGL:37442,UNPACK_COLORSPACE_CONVERSION_WEBGL:37443,BROWSER_DEFAULT_WEBGL:37444,COMPRESSED_RGB_S3TC_DXT1_EXT:33776,COMPRESSED_RGBA_S3TC_DXT1_EXT:33777,COMPRESSED_RGBA_S3TC_DXT3_EXT:33778,COMPRESSED_RGBA_S3TC_DXT5_EXT:33779,COMPRESSED_RGB_PVRTC_4BPPV1_IMG:35840,COMPRESSED_RGB_PVRTC_2BPPV1_IMG:35841,COMPRESSED_RGBA_PVRTC_4BPPV1_IMG:35842,COMPRESSED_RGBA_PVRTC_2BPPV1_IMG:35843,COMPRESSED_RGB_ETC1_WEBGL:36196,HALF_FLOAT_OES:36193,DOUBLE:5130,READ_BUFFER:3074,UNPACK_ROW_LENGTH:3314,UNPACK_SKIP_ROWS:3315,UNPACK_SKIP_PIXELS:3316,PACK_ROW_LENGTH:3330,PACK_SKIP_ROWS:3331,PACK_SKIP_PIXELS:3332,COLOR:6144,DEPTH:6145,STENCIL:6146,RED:6403,RGB8:32849,RGBA8:32856,RGB10_A2:32857,TEXTURE_BINDING_3D:32874,UNPACK_SKIP_IMAGES:32877,UNPACK_IMAGE_HEIGHT:32878,TEXTURE_3D:32879,TEXTURE_WRAP_R:32882,MAX_3D_TEXTURE_SIZE:32883,UNSIGNED_INT_2_10_10_10_REV:33640,MAX_ELEMENTS_VERTICES:33e3,MAX_ELEMENTS_INDICES:33001,TEXTURE_MIN_LOD:33082,TEXTURE_MAX_LOD:33083,TEXTURE_BASE_LEVEL:33084,TEXTURE_MAX_LEVEL:33085,MIN:32775,MAX:32776,DEPTH_COMPONENT24:33190,MAX_TEXTURE_LOD_BIAS:34045,TEXTURE_COMPARE_MODE:34892,TEXTURE_COMPARE_FUNC:34893,CURRENT_QUERY:34917,QUERY_RESULT:34918,QUERY_RESULT_AVAILABLE:34919,STREAM_READ:35041,STREAM_COPY:35042,STATIC_READ:35045,STATIC_COPY:35046,DYNAMIC_READ:35049,DYNAMIC_COPY:35050,MAX_DRAW_BUFFERS:34852,DRAW_BUFFER0:34853,DRAW_BUFFER1:34854,DRAW_BUFFER2:34855,DRAW_BUFFER3:34856,DRAW_BUFFER4:34857,DRAW_BUFFER5:34858,DRAW_BUFFER6:34859,DRAW_BUFFER7:34860,DRAW_BUFFER8:34861,DRAW_BUFFER9:34862,DRAW_BUFFER10:34863,DRAW_BUFFER11:34864,DRAW_BUFFER12:34865,DRAW_BUFFER13:34866,DRAW_BUFFER14:34867,DRAW_BUFFER15:34868,MAX_FRAGMENT_UNIFORM_COMPONENTS:35657,MAX_VERTEX_UNIFORM_COMPONENTS:35658,SAMPLER_3D:35679,SAMPLER_2D_SHADOW:35682,FRAGMENT_SHADER_DERIVATIVE_HINT:35723,PIXEL_PACK_BUFFER:35051,PIXEL_UNPACK_BUFFER:35052,PIXEL_PACK_BUFFER_BINDING:35053,PIXEL_UNPACK_BUFFER_BINDING:35055,FLOAT_MAT2x3:35685,FLOAT_MAT2x4:35686,FLOAT_MAT3x2:35687,FLOAT_MAT3x4:35688,FLOAT_MAT4x2:35689,FLOAT_MAT4x3:35690,SRGB:35904,SRGB8:35905,SRGB8_ALPHA8:35907,COMPARE_REF_TO_TEXTURE:34894,RGBA32F:34836,RGB32F:34837,RGBA16F:34842,RGB16F:34843,VERTEX_ATTRIB_ARRAY_INTEGER:35069,MAX_ARRAY_TEXTURE_LAYERS:35071,MIN_PROGRAM_TEXEL_OFFSET:35076,MAX_PROGRAM_TEXEL_OFFSET:35077,MAX_VARYING_COMPONENTS:35659,TEXTURE_2D_ARRAY:35866,TEXTURE_BINDING_2D_ARRAY:35869,R11F_G11F_B10F:35898,UNSIGNED_INT_10F_11F_11F_REV:35899,RGB9_E5:35901,UNSIGNED_INT_5_9_9_9_REV:35902,TRANSFORM_FEEDBACK_BUFFER_MODE:35967,MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS:35968,TRANSFORM_FEEDBACK_VARYINGS:35971,TRANSFORM_FEEDBACK_BUFFER_START:35972,TRANSFORM_FEEDBACK_BUFFER_SIZE:35973,TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN:35976,RASTERIZER_DISCARD:35977,MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS:35978,MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS:35979,INTERLEAVED_ATTRIBS:35980,SEPARATE_ATTRIBS:35981,TRANSFORM_FEEDBACK_BUFFER:35982,TRANSFORM_FEEDBACK_BUFFER_BINDING:35983,RGBA32UI:36208,RGB32UI:36209,RGBA16UI:36214,RGB16UI:36215,RGBA8UI:36220,RGB8UI:36221,RGBA32I:36226,RGB32I:36227,RGBA16I:36232,RGB16I:36233,RGBA8I:36238,RGB8I:36239,RED_INTEGER:36244,RGB_INTEGER:36248,RGBA_INTEGER:36249,SAMPLER_2D_ARRAY:36289,SAMPLER_2D_ARRAY_SHADOW:36292,SAMPLER_CUBE_SHADOW:36293,UNSIGNED_INT_VEC2:36294,UNSIGNED_INT_VEC3:36295,UNSIGNED_INT_VEC4:36296,INT_SAMPLER_2D:36298,INT_SAMPLER_3D:36299,INT_SAMPLER_CUBE:36300,INT_SAMPLER_2D_ARRAY:36303,UNSIGNED_INT_SAMPLER_2D:36306,UNSIGNED_INT_SAMPLER_3D:36307,UNSIGNED_INT_SAMPLER_CUBE:36308,UNSIGNED_INT_SAMPLER_2D_ARRAY:36311,DEPTH_COMPONENT32F:36012,DEPTH32F_STENCIL8:36013,FLOAT_32_UNSIGNED_INT_24_8_REV:36269,FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING:33296,FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE:33297,FRAMEBUFFER_ATTACHMENT_RED_SIZE:33298,FRAMEBUFFER_ATTACHMENT_GREEN_SIZE:33299,FRAMEBUFFER_ATTACHMENT_BLUE_SIZE:33300,FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE:33301,FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE:33302,FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE:33303,FRAMEBUFFER_DEFAULT:33304,UNSIGNED_INT_24_8:34042,DEPTH24_STENCIL8:35056,UNSIGNED_NORMALIZED:35863,DRAW_FRAMEBUFFER_BINDING:36006,READ_FRAMEBUFFER:36008,DRAW_FRAMEBUFFER:36009,READ_FRAMEBUFFER_BINDING:36010,RENDERBUFFER_SAMPLES:36011,FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER:36052,MAX_COLOR_ATTACHMENTS:36063,COLOR_ATTACHMENT1:36065,COLOR_ATTACHMENT2:36066,COLOR_ATTACHMENT3:36067,COLOR_ATTACHMENT4:36068,COLOR_ATTACHMENT5:36069,COLOR_ATTACHMENT6:36070,COLOR_ATTACHMENT7:36071,COLOR_ATTACHMENT8:36072,COLOR_ATTACHMENT9:36073,COLOR_ATTACHMENT10:36074,COLOR_ATTACHMENT11:36075,COLOR_ATTACHMENT12:36076,COLOR_ATTACHMENT13:36077,COLOR_ATTACHMENT14:36078,COLOR_ATTACHMENT15:36079,FRAMEBUFFER_INCOMPLETE_MULTISAMPLE:36182,MAX_SAMPLES:36183,HALF_FLOAT:5131,RG:33319,RG_INTEGER:33320,R8:33321,RG8:33323,R16F:33325,R32F:33326,RG16F:33327,RG32F:33328,R8I:33329,R8UI:33330,R16I:33331,R16UI:33332,R32I:33333,R32UI:33334,RG8I:33335,RG8UI:33336,RG16I:33337,RG16UI:33338,RG32I:33339,RG32UI:33340,VERTEX_ARRAY_BINDING:34229,R8_SNORM:36756,RG8_SNORM:36757,RGB8_SNORM:36758,RGBA8_SNORM:36759,SIGNED_NORMALIZED:36764,COPY_READ_BUFFER:36662,COPY_WRITE_BUFFER:36663,COPY_READ_BUFFER_BINDING:36662,COPY_WRITE_BUFFER_BINDING:36663,UNIFORM_BUFFER:35345,UNIFORM_BUFFER_BINDING:35368,UNIFORM_BUFFER_START:35369,UNIFORM_BUFFER_SIZE:35370,MAX_VERTEX_UNIFORM_BLOCKS:35371,MAX_FRAGMENT_UNIFORM_BLOCKS:35373,MAX_COMBINED_UNIFORM_BLOCKS:35374,MAX_UNIFORM_BUFFER_BINDINGS:35375,MAX_UNIFORM_BLOCK_SIZE:35376,MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS:35377,MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS:35379,UNIFORM_BUFFER_OFFSET_ALIGNMENT:35380,ACTIVE_UNIFORM_BLOCKS:35382,UNIFORM_TYPE:35383,UNIFORM_SIZE:35384,UNIFORM_BLOCK_INDEX:35386,UNIFORM_OFFSET:35387,UNIFORM_ARRAY_STRIDE:35388,UNIFORM_MATRIX_STRIDE:35389,UNIFORM_IS_ROW_MAJOR:35390,UNIFORM_BLOCK_BINDING:35391,UNIFORM_BLOCK_DATA_SIZE:35392,UNIFORM_BLOCK_ACTIVE_UNIFORMS:35394,UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES:35395,UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER:35396,UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER:35398,INVALID_INDEX:4294967295,MAX_VERTEX_OUTPUT_COMPONENTS:37154,MAX_FRAGMENT_INPUT_COMPONENTS:37157,MAX_SERVER_WAIT_TIMEOUT:37137,OBJECT_TYPE:37138,SYNC_CONDITION:37139,SYNC_STATUS:37140,SYNC_FLAGS:37141,SYNC_FENCE:37142,SYNC_GPU_COMMANDS_COMPLETE:37143,UNSIGNALED:37144,SIGNALED:37145,ALREADY_SIGNALED:37146,TIMEOUT_EXPIRED:37147,CONDITION_SATISFIED:37148,WAIT_FAILED:37149,SYNC_FLUSH_COMMANDS_BIT:1,VERTEX_ATTRIB_ARRAY_DIVISOR:35070,ANY_SAMPLES_PASSED:35887,ANY_SAMPLES_PASSED_CONSERVATIVE:36202,SAMPLER_BINDING:35097,RGB10_A2UI:36975,INT_2_10_10_10_REV:36255,TRANSFORM_FEEDBACK:36386,TRANSFORM_FEEDBACK_PAUSED:36387,TRANSFORM_FEEDBACK_ACTIVE:36388,TRANSFORM_FEEDBACK_BINDING:36389,COMPRESSED_R11_EAC:37488,COMPRESSED_SIGNED_R11_EAC:37489,COMPRESSED_RG11_EAC:37490,COMPRESSED_SIGNED_RG11_EAC:37491,COMPRESSED_RGB8_ETC2:37492,COMPRESSED_SRGB8_ETC2:37493,COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:37494,COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:37495,COMPRESSED_RGBA8_ETC2_EAC:37496,COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:37497,TEXTURE_IMMUTABLE_FORMAT:37167,MAX_ELEMENT_INDEX:36203,TEXTURE_IMMUTABLE_LEVELS:33503,MAX_TEXTURE_MAX_ANISOTROPY_EXT:34047}),Oh={BYTE:zh.BYTE,UNSIGNED_BYTE:zh.UNSIGNED_BYTE,SHORT:zh.SHORT,UNSIGNED_SHORT:zh.UNSIGNED_SHORT,INT:zh.INT,UNSIGNED_INT:zh.UNSIGNED_INT,FLOAT:zh.FLOAT,DOUBLE:zh.DOUBLE,getSizeInBytes:function(t){if(!Nr(t))throw new Lr("value is required.");switch(t){case Oh.BYTE:return Int8Array.BYTES_PER_ELEMENT;case Oh.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case Oh.SHORT:return Int16Array.BYTES_PER_ELEMENT;case Oh.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case Oh.INT:return Int32Array.BYTES_PER_ELEMENT;case Oh.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case Oh.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case Oh.DOUBLE:return Float64Array.BYTES_PER_ELEMENT;default:throw new Lr("componentDatatype is not a valid value.")}},fromTypedArray:function(t){return t instanceof Int8Array?Oh.BYTE:t instanceof Uint8Array?Oh.UNSIGNED_BYTE:t instanceof Int16Array?Oh.SHORT:t instanceof Uint16Array?Oh.UNSIGNED_SHORT:t instanceof Int32Array?Oh.INT:t instanceof Uint32Array?Oh.UNSIGNED_INT:t instanceof Float32Array?Oh.FLOAT:t instanceof Float64Array?Oh.DOUBLE:void 0},validate:function(t){return Nr(t)&&(t===Oh.BYTE||t===Oh.UNSIGNED_BYTE||t===Oh.SHORT||t===Oh.UNSIGNED_SHORT||t===Oh.INT||t===Oh.UNSIGNED_INT||t===Oh.FLOAT||t===Oh.DOUBLE)},createTypedArray:function(t,e){if(!Nr(t))throw new Lr("componentDatatype is required.");if(!Nr(e))throw new Lr("valuesOrLength is required.");switch(t){case Oh.BYTE:return new Int8Array(e);case Oh.UNSIGNED_BYTE:return new Uint8Array(e);case Oh.SHORT:return new Int16Array(e);case Oh.UNSIGNED_SHORT:return new Uint16Array(e);case Oh.INT:return new Int32Array(e);case Oh.UNSIGNED_INT:return new Uint32Array(e);case Oh.FLOAT:return new Float32Array(e);case Oh.DOUBLE:return new Float64Array(e);default:throw new Lr("componentDatatype is not a valid value.")}},createArrayBufferView:function(t,e,n,r){if(!Nr(t))throw new Lr("componentDatatype is required.");if(!Nr(e))throw new Lr("buffer is required.");switch(n=Pr(n,0),r=Pr(r,(e.byteLength-n)/Oh.getSizeInBytes(t)),t){case Oh.BYTE:return new Int8Array(e,n,r);case Oh.UNSIGNED_BYTE:return new Uint8Array(e,n,r);case Oh.SHORT:return new Int16Array(e,n,r);case Oh.UNSIGNED_SHORT:return new Uint16Array(e,n,r);case Oh.INT:return new Int32Array(e,n,r);case Oh.UNSIGNED_INT:return new Uint32Array(e,n,r);case Oh.FLOAT:return new Float32Array(e,n,r);case Oh.DOUBLE:return new Float64Array(e,n,r);default:throw new Lr("componentDatatype is not a valid value.")}},fromName:function(t){switch(t){case"BYTE":return Oh.BYTE;case"UNSIGNED_BYTE":return Oh.UNSIGNED_BYTE;case"SHORT":return Oh.SHORT;case"UNSIGNED_SHORT":return Oh.UNSIGNED_SHORT;case"INT":return Oh.INT;case"UNSIGNED_INT":return Oh.UNSIGNED_INT;case"FLOAT":return Oh.FLOAT;case"DOUBLE":return Oh.DOUBLE;default:throw new Lr("name is not a valid value.")}}},Nh=Object.freeze(Oh);function Lh(t,e,n){if(0===t)return e*n;var r=t*t,i=r*r,o=i*r,a=o*r,s=a*r,c=s*r,l=n;return e*((1-r/4-3*i/64-5*o/256-175*a/16384-441*s/65536-4851*c/1048576)*l-(3*r/8+3*i/32+45*o/1024+105*a/4096+2205*s/131072+6237*c/524288)*Math.sin(2*l)+(15*i/256+45*o/1024+525*a/16384+1575*s/65536+155925*c/8388608)*Math.sin(4*l)-(35*o/3072+175*a/12288+3675*s/262144+13475*c/1048576)*Math.sin(6*l)+(315*a/131072+2205*s/524288+43659*c/8388608)*Math.sin(8*l)-(693*s/1310720+6237*c/5242880)*Math.sin(10*l)+1001*c/8388608*Math.sin(12*l))}function Qh(t,e){if(0===t)return Math.log(Math.tan(.5*(Ur.PI_OVER_TWO+e)));var n=t*Math.sin(e);return Math.log(Math.tan(.5*(Ur.PI_OVER_TWO+e)))-t/2*Math.log((1+n)/(1-n))}var Fh=new Hr,Ph=new Hr;function kh(t,e,n,r){var i=Hr.normalize(r.cartographicToCartesian(e,Ph),Fh),o=Hr.normalize(r.cartographicToCartesian(n,Ph),Ph);Qr.typeOf.number.greaterThanOrEquals("value",Math.abs(Math.abs(Hr.angleBetween(i,o))-Math.PI),.0125);var a=r.maximumRadius,s=r.minimumRadius,c=a*a,l=s*s;t._ellipticitySquared=(c-l)/c,t._ellipticity=Math.sqrt(t._ellipticitySquared),t._start=ri.clone(e,t._start),t._start.height=0,t._end=ri.clone(n,t._end),t._end.height=0,t._heading=function(t,e,n,r,i){var o=Qh(t._ellipticity,n),a=Qh(t._ellipticity,i);return Math.atan2(Ur.negativePiToPi(r-e),a-o)}(t,e.longitude,e.latitude,n.longitude,n.latitude),t._distance=function(t,e,n,r,i,o,a){var s=t._heading,c=o-r,l=0;if(Ur.equalsEpsilon(Math.abs(s),Ur.PI_OVER_TWO,Ur.EPSILON8))if(e===n)l=e*Math.cos(i)*Ur.negativePiToPi(c);else{var u=Math.sin(i);l=e*Math.cos(i)*Ur.negativePiToPi(c)/Math.sqrt(1-t._ellipticitySquared*u*u)}else{var h=Lh(t._ellipticity,e,i);l=(Lh(t._ellipticity,e,a)-h)/Math.cos(s)}return Math.abs(l)}(t,r.maximumRadius,r.minimumRadius,e.longitude,e.latitude,n.longitude,n.latitude)}function Uh(t,e,n,r,i,o){var a,s,c,l=i*i;if(Math.abs(Ur.PI_OVER_TWO-Math.abs(e))>Ur.EPSILON8){s=function(t,e,n){var r=t/n;if(0===e)return r;var i=r*r,o=i*r,a=o*r,s=e*e,c=s*s,l=c*s,u=l*s,h=u*s,f=h*s,d=Math.sin(2*r),p=Math.cos(2*r),A=Math.sin(4*r),g=Math.cos(4*r),m=Math.sin(6*r),y=Math.cos(6*r),v=Math.sin(8*r),C=Math.cos(8*r),I=Math.sin(10*r);return r+r*s/4+7*r*c/64+15*r*l/256+579*r*u/16384+1515*r*h/65536+16837*r*f/1048576+(3*r*c/16+45*r*l/256-r*(32*i-561)*u/4096-r*(232*i-1677)*h/16384+r*(399985-90560*i+512*a)*f/5242880)*p+(21*r*l/256+483*r*u/4096-r*(224*i-1969)*h/16384-r*(33152*i-112599)*f/1048576)*g+(151*r*u/4096+4681*r*h/65536+1479*r*f/16384-453*o*f/32768)*y+(1097*r*h/65536+42783*r*f/1048576)*C+8011*r*f/1048576*Math.cos(10*r)+(3*s/8+3*c/16+213*l/2048-3*i*l/64+255*u/4096-33*i*u/512+20861*h/524288-33*i*h/512+a*h/1024+28273*f/1048576-471*i*f/8192+9*a*f/4096)*d+(21*c/256+21*l/256+533*u/8192-21*i*u/512+197*h/4096-315*i*h/4096+584039*f/16777216-12517*i*f/131072+7*a*f/2048)*A+(151*l/6144+151*u/4096+5019*h/131072-453*i*h/16384+26965*f/786432-8607*i*f/131072)*m+(1097*u/131072+1097*h/65536+225797*f/10485760-1097*i*f/65536)*v+(8011*h/2621440+8011*f/1048576)*I+293393*f/251658240*Math.sin(12*r)}(Lh(i,r,t.latitude)+n*Math.cos(e),i,r);var u=Qh(i,t.latitude),h=Qh(i,s);c=Math.tan(e)*(h-u),a=Ur.negativePiToPi(t.longitude+c)}else{var f;if(s=t.latitude,0===i)f=r*Math.cos(t.latitude);else{var d=Math.sin(t.latitude);f=r*Math.cos(t.latitude)/Math.sqrt(1-l*d*d)}c=n/f,a=e>0?Ur.negativePiToPi(t.longitude+c):Ur.negativePiToPi(t.longitude-c)}return Nr(o)?(o.longitude=a,o.latitude=s,o.height=0,o):new ri(a,s,0)}function jh(t,e,n){var r=Pr(n,Ra.WGS84);this._ellipsoid=r,this._start=new ri,this._end=new ri,this._heading=void 0,this._distance=void 0,this._ellipticity=void 0,this._ellipticitySquared=void 0,Nr(t)&&Nr(e)&&kh(this,t,e,r)}Object.defineProperties(jh.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},surfaceDistance:{get:function(){return Qr.defined("distance",this._distance),this._distance}},start:{get:function(){return this._start}},end:{get:function(){return this._end}},heading:{get:function(){return Qr.defined("distance",this._distance),this._heading}}}),jh.fromStartHeadingDistance=function(t,e,n,r,i){Qr.defined("start",t),Qr.defined("heading",e),Qr.defined("distance",n),Qr.typeOf.number.greaterThan("distance",n,0);var o=Pr(r,Ra.WGS84),a=o.maximumRadius,s=o.minimumRadius,c=a*a,l=s*s,u=Math.sqrt((c-l)/c),h=Uh(t,e=Ur.negativePiToPi(e),n,o.maximumRadius,u);return!Nr(i)||Nr(r)&&!r.equals(i.ellipsoid)?new jh(t,h,o):(i.setEndPoints(t,h),i)},jh.prototype.setEndPoints=function(t,e){Qr.defined("start",t),Qr.defined("end",e),kh(this,t,e,this._ellipsoid)},jh.prototype.interpolateUsingFraction=function(t,e){return this.interpolateUsingSurfaceDistance(t*this._distance,e)},jh.prototype.interpolateUsingSurfaceDistance=function(t,e){if(Qr.typeOf.number("distance",t),!Nr(this._distance)||0===this._distance)throw new Lr("EllipsoidRhumbLine must have distinct start and end set.");return Uh(this._start,this._heading,t,this._ellipsoid.maximumRadius,this._ellipticity,e)},jh.prototype.findIntersectionWithLongitude=function(t,e){if(Qr.typeOf.number("intersectionLongitude",t),!Nr(this._distance)||0===this._distance)throw new Lr("EllipsoidRhumbLine must have distinct start and end set.");var n=this._ellipticity,r=this._heading,i=Math.abs(r),o=this._start;if(t=Ur.negativePiToPi(t),Ur.equalsEpsilon(Math.abs(t),Math.PI,Ur.EPSILON14)&&(t=Ur.sign(o.longitude)*Math.PI),Nr(e)||(e=new ri),Math.abs(Ur.PI_OVER_TWO-i)<=Ur.EPSILON8)return e.longitude=t,e.latitude=o.latitude,e.height=0,e;if(Ur.equalsEpsilon(Math.abs(Ur.PI_OVER_TWO-i),Ur.PI_OVER_TWO,Ur.EPSILON8)){if(Ur.equalsEpsilon(t,o.longitude,Ur.EPSILON12))return;return e.longitude=t,e.latitude=Ur.PI_OVER_TWO*Ur.sign(Ur.PI_OVER_TWO-r),e.height=0,e}var a,s=o.latitude,c=n*Math.sin(s),l=Math.tan(.5*(Ur.PI_OVER_TWO+s))*Math.exp((t-o.longitude)/Math.tan(r)),u=(1+c)/(1-c),h=o.latitude;do{a=h;var f=n*Math.sin(a),d=(1+f)/(1-f);h=2*Math.atan(l*Math.pow(d/u,n/2))-Ur.PI_OVER_TWO}while(!Ur.equalsEpsilon(h,a,Ur.EPSILON12));return e.longitude=t,e.latitude=h,e.height=0,e},jh.prototype.findIntersectionWithLatitude=function(t,e){if(Qr.typeOf.number("intersectionLatitude",t),!Nr(this._distance)||0===this._distance)throw new Lr("EllipsoidRhumbLine must have distinct start and end set.");var n=this._ellipticity,r=this._heading,i=this._start;if(!Ur.equalsEpsilon(Math.abs(r),Ur.PI_OVER_TWO,Ur.EPSILON8)){var o=Qh(n,i.latitude),a=Qh(n,t),s=Math.tan(r)*(a-o),c=Ur.negativePiToPi(i.longitude+s);return Nr(e)?(e.longitude=c,e.latitude=t,e.height=0,e):new ri(c,t,0)}};var Gh=Object.freeze({NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3});function Hh(t,e,n,r){this[0]=Pr(t,0),this[1]=Pr(n,0),this[2]=Pr(e,0),this[3]=Pr(r,0)}Hh.packedLength=4,Hh.pack=function(t,e,n){return Qr.typeOf.object("value",t),Qr.defined("array",e),n=Pr(n,0),e[n++]=t[0],e[n++]=t[1],e[n++]=t[2],e[n++]=t[3],e},Hh.unpack=function(t,e,n){return Qr.defined("array",t),e=Pr(e,0),Nr(n)||(n=new Hh),n[0]=t[e++],n[1]=t[e++],n[2]=t[e++],n[3]=t[e++],n},Hh.clone=function(t,e){if(Nr(t))return Nr(e)?(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e):new Hh(t[0],t[2],t[1],t[3])},Hh.fromArray=function(t,e,n){return Qr.defined("array",t),e=Pr(e,0),Nr(n)||(n=new Hh),n[0]=t[e],n[1]=t[e+1],n[2]=t[e+2],n[3]=t[e+3],n},Hh.fromColumnMajorArray=function(t,e){return Qr.defined("values",t),Hh.clone(t,e)},Hh.fromRowMajorArray=function(t,e){return Qr.defined("values",t),Nr(e)?(e[0]=t[0],e[1]=t[2],e[2]=t[1],e[3]=t[3],e):new Hh(t[0],t[1],t[2],t[3])},Hh.fromScale=function(t,e){return Qr.typeOf.object("scale",t),Nr(e)?(e[0]=t.x,e[1]=0,e[2]=0,e[3]=t.y,e):new Hh(t.x,0,0,t.y)},Hh.fromUniformScale=function(t,e){return Qr.typeOf.number("scale",t),Nr(e)?(e[0]=t,e[1]=0,e[2]=0,e[3]=t,e):new Hh(t,0,0,t)},Hh.fromRotation=function(t,e){Qr.typeOf.number("angle",t);var n=Math.cos(t),r=Math.sin(t);return Nr(e)?(e[0]=n,e[1]=r,e[2]=-r,e[3]=n,e):new Hh(n,-r,r,n)},Hh.toArray=function(t,e){return Qr.typeOf.object("matrix",t),Nr(e)?(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e):[t[0],t[1],t[2],t[3]]},Hh.getElementIndex=function(t,e){return Qr.typeOf.number.greaterThanOrEquals("row",e,0),Qr.typeOf.number.lessThanOrEquals("row",e,1),Qr.typeOf.number.greaterThanOrEquals("column",t,0),Qr.typeOf.number.lessThanOrEquals("column",t,1),2*t+e},Hh.getColumn=function(t,e,n){Qr.typeOf.object("matrix",t),Qr.typeOf.number.greaterThanOrEquals("index",e,0),Qr.typeOf.number.lessThanOrEquals("index",e,1),Qr.typeOf.object("result",n);var r=2*e,i=t[r],o=t[r+1];return n.x=i,n.y=o,n},Hh.setColumn=function(t,e,n,r){Qr.typeOf.object("matrix",t),Qr.typeOf.number.greaterThanOrEquals("index",e,0),Qr.typeOf.number.lessThanOrEquals("index",e,1),Qr.typeOf.object("cartesian",n),Qr.typeOf.object("result",r);var i=2*e;return(r=Hh.clone(t,r))[i]=n.x,r[i+1]=n.y,r},Hh.getRow=function(t,e,n){Qr.typeOf.object("matrix",t),Qr.typeOf.number.greaterThanOrEquals("index",e,0),Qr.typeOf.number.lessThanOrEquals("index",e,1),Qr.typeOf.object("result",n);var r=t[e],i=t[e+2];return n.x=r,n.y=i,n},Hh.setRow=function(t,e,n,r){return Qr.typeOf.object("matrix",t),Qr.typeOf.number.greaterThanOrEquals("index",e,0),Qr.typeOf.number.lessThanOrEquals("index",e,1),Qr.typeOf.object("cartesian",n),Qr.typeOf.object("result",r),(r=Hh.clone(t,r))[e]=n.x,r[e+2]=n.y,r};var qh=new Ti;Hh.getScale=function(t,e){return Qr.typeOf.object("matrix",t),Qr.typeOf.object("result",e),e.x=Ti.magnitude(Ti.fromElements(t[0],t[1],qh)),e.y=Ti.magnitude(Ti.fromElements(t[2],t[3],qh)),e};var Vh=new Ti;Hh.getMaximumScale=function(t){return Hh.getScale(t,Vh),Ti.maximumComponent(Vh)},Hh.multiply=function(t,e,n){Qr.typeOf.object("left",t),Qr.typeOf.object("right",e),Qr.typeOf.object("result",n);var r=t[0]*e[0]+t[2]*e[1],i=t[0]*e[2]+t[2]*e[3],o=t[1]*e[0]+t[3]*e[1],a=t[1]*e[2]+t[3]*e[3];return n[0]=r,n[1]=o,n[2]=i,n[3]=a,n},Hh.add=function(t,e,n){return Qr.typeOf.object("left",t),Qr.typeOf.object("right",e),Qr.typeOf.object("result",n),n[0]=t[0]+e[0],n[1]=t[1]+e[1],n[2]=t[2]+e[2],n[3]=t[3]+e[3],n},Hh.subtract=function(t,e,n){return Qr.typeOf.object("left",t),Qr.typeOf.object("right",e),Qr.typeOf.object("result",n),n[0]=t[0]-e[0],n[1]=t[1]-e[1],n[2]=t[2]-e[2],n[3]=t[3]-e[3],n},Hh.multiplyByVector=function(t,e,n){Qr.typeOf.object("matrix",t),Qr.typeOf.object("cartesian",e),Qr.typeOf.object("result",n);var r=t[0]*e.x+t[2]*e.y,i=t[1]*e.x+t[3]*e.y;return n.x=r,n.y=i,n},Hh.multiplyByScalar=function(t,e,n){return Qr.typeOf.object("matrix",t),Qr.typeOf.number("scalar",e),Qr.typeOf.object("result",n),n[0]=t[0]*e,n[1]=t[1]*e,n[2]=t[2]*e,n[3]=t[3]*e,n},Hh.multiplyByScale=function(t,e,n){return Qr.typeOf.object("matrix",t),Qr.typeOf.object("scale",e),Qr.typeOf.object("result",n),n[0]=t[0]*e.x,n[1]=t[1]*e.x,n[2]=t[2]*e.y,n[3]=t[3]*e.y,n},Hh.negate=function(t,e){return Qr.typeOf.object("matrix",t),Qr.typeOf.object("result",e),e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=-t[3],e},Hh.transpose=function(t,e){Qr.typeOf.object("matrix",t),Qr.typeOf.object("result",e);var n=t[0],r=t[2],i=t[1],o=t[3];return e[0]=n,e[1]=r,e[2]=i,e[3]=o,e},Hh.abs=function(t,e){return Qr.typeOf.object("matrix",t),Qr.typeOf.object("result",e),e[0]=Math.abs(t[0]),e[1]=Math.abs(t[1]),e[2]=Math.abs(t[2]),e[3]=Math.abs(t[3]),e},Hh.equals=function(t,e){return t===e||Nr(t)&&Nr(e)&&t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]},Hh.equalsArray=function(t,e,n){return t[0]===e[n]&&t[1]===e[n+1]&&t[2]===e[n+2]&&t[3]===e[n+3]},Hh.equalsEpsilon=function(t,e,n){return Qr.typeOf.number("epsilon",n),t===e||Nr(t)&&Nr(e)&&Math.abs(t[0]-e[0])<=n&&Math.abs(t[1]-e[1])<=n&&Math.abs(t[2]-e[2])<=n&&Math.abs(t[3]-e[3])<=n},Hh.IDENTITY=Object.freeze(new Hh(1,0,0,1)),Hh.ZERO=Object.freeze(new Hh(0,0,0,0)),Hh.COLUMN0ROW0=0,Hh.COLUMN0ROW1=1,Hh.COLUMN1ROW0=2,Hh.COLUMN1ROW1=3,Object.defineProperties(Hh.prototype,{length:{get:function(){return Hh.packedLength}}}),Hh.prototype.clone=function(t){return Hh.clone(this,t)},Hh.prototype.equals=function(t){return Hh.equals(this,t)},Hh.prototype.equalsEpsilon=function(t,e){return Hh.equalsEpsilon(this,t,e)},Hh.prototype.toString=function(){return"("+this[0]+", "+this[2]+")\n("+this[1]+", "+this[3]+")"};var Yh={POINTS:zh.POINTS,LINES:zh.LINES,LINE_LOOP:zh.LINE_LOOP,LINE_STRIP:zh.LINE_STRIP,TRIANGLES:zh.TRIANGLES,TRIANGLE_STRIP:zh.TRIANGLE_STRIP,TRIANGLE_FAN:zh.TRIANGLE_FAN,validate:function(t){return t===Yh.POINTS||t===Yh.LINES||t===Yh.LINE_LOOP||t===Yh.LINE_STRIP||t===Yh.TRIANGLES||t===Yh.TRIANGLE_STRIP||t===Yh.TRIANGLE_FAN}},Kh=Object.freeze(Yh);function Wh(t){t=Pr(t,Pr.EMPTY_OBJECT),Qr.typeOf.object("options.attributes",t.attributes),this.attributes=t.attributes,this.indices=t.indices,this.primitiveType=Pr(t.primitiveType,Kh.TRIANGLES),this.boundingSphere=t.boundingSphere,this.geometryType=Pr(t.geometryType,Gh.NONE),this.boundingSphereCV=t.boundingSphereCV,this.offsetAttribute=t.offsetAttribute}Wh.computeNumberOfVertices=function(t){Qr.typeOf.object("geometry",t);var e=-1;for(var n in t.attributes)if(t.attributes.hasOwnProperty(n)&&Nr(t.attributes[n])&&Nr(t.attributes[n].values)){var r=t.attributes[n];if(r.isInstanceAttribute)continue;var i=r.values.length/r.componentsPerAttribute;if(e!==i&&-1!==e)throw new Lr("All attribute lists must have the same number of attributes.");e=i}return e};var Xh=new ri,Jh=new Hr,Zh=new ls,$h=[new ri,new ri,new ri],tf=[new Ti,new Ti,new Ti],ef=[new Ti,new Ti,new Ti],nf=new Hr,rf=new ec,of=new ls,af=new Hh;Wh._textureCoordinateRotationPoints=function(t,e,n,r){var i,o=bl.center(r,Xh),a=ri.toCartesian(o,n,Jh),s=Rc.eastNorthUpToFixedFrame(a,n,Zh),c=ls.inverse(s,Zh),l=tf,u=$h;u[0].longitude=r.west,u[0].latitude=r.south,u[1].longitude=r.west,u[1].latitude=r.north,u[2].longitude=r.east,u[2].latitude=r.south;var h=nf;for(i=0;i<3;i++)ri.toCartesian(u[i],n,h),h=ls.multiplyByPointAsVector(c,h,h),l[i].x=h.x,l[i].y=h.y;var f=ec.fromAxisAngle(Hr.UNIT_Z,-e,rf),d=$a.fromQuaternion(f,of),p=t.length,A=Number.POSITIVE_INFINITY,g=Number.POSITIVE_INFINITY,m=Number.NEGATIVE_INFINITY,y=Number.NEGATIVE_INFINITY;for(i=0;i<p;i++)h=ls.multiplyByPointAsVector(c,t[i],h),h=$a.multiplyByVector(d,h,h),A=Math.min(A,h.x),g=Math.min(g,h.y),m=Math.max(m,h.x),y=Math.max(y,h.y);var v=Hh.fromRotation(e,af),C=ef;C[0].x=A,C[0].y=g,C[1].x=A,C[1].y=y,C[2].x=m,C[2].y=g;var I=l[0],x=l[2].x-I.x,E=l[1].y-I.y;for(i=0;i<3;i++){var _=C[i];Hh.multiplyByVector(v,_,_),_.x=(_.x-I.x)/x,_.y=(_.y-I.y)/E}var b=C[0],w=C[1],M=C[2],T=new Array(6);return Ti.pack(b,T),Ti.pack(w,T,2),Ti.pack(M,T,4),T};var sf={CLOCKWISE:zh.CW,COUNTER_CLOCKWISE:zh.CCW,NONE:zh.NONE,validate:function(t){return t===sf.CLOCKWISE||t===sf.COUNTER_CLOCKWISE}},cf=Object.freeze(sf);function lf(){return!0}function uf(t,e){function n(){throw new Lr(e)}for(var r in e=Pr(e,"This object was destroyed, i.e., destroy() was called."),t)"function"==typeof t[r]&&(t[r]=n);t.isDestroyed=lf}new Hr,new Hr,new Hr,new Hr,new Hr,new Hr,new Hr,new Hr,new Hr,new ri,new ri,new ri,new ri;var hf={UNSIGNED_BYTE:zh.UNSIGNED_BYTE,UNSIGNED_SHORT:zh.UNSIGNED_SHORT,UNSIGNED_INT:zh.UNSIGNED_INT,getSizeInBytes:function(t){switch(t){case hf.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case hf.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case hf.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT}throw new Lr("indexDatatype is required and must be a valid IndexDatatype constant.")},fromSizeInBytes:function(t){switch(t){case 2:return hf.UNSIGNED_SHORT;case 4:return hf.UNSIGNED_INT;case 1:return hf.UNSIGNED_BYTE;default:throw new Lr("Size in bytes cannot be mapped to an IndexDatatype")}},validate:function(t){return Nr(t)&&(t===hf.UNSIGNED_BYTE||t===hf.UNSIGNED_SHORT||t===hf.UNSIGNED_INT)},createTypedArray:function(t,e){if(!Nr(t))throw new Lr("numberOfVertices is required.");return t>=Ur.SIXTY_FOUR_KILOBYTES?new Uint32Array(e):new Uint16Array(e)},createTypedArrayFromArrayBuffer:function(t,e,n,r){if(!Nr(t))throw new Lr("numberOfVertices is required.");if(!Nr(e))throw new Lr("sourceArray is required.");if(!Nr(n))throw new Lr("byteOffset is required.");return t>=Ur.SIXTY_FOUR_KILOBYTES?new Uint32Array(e,n,r):new Uint16Array(e,n,r)}},ff=Object.freeze(hf),df={STREAM_DRAW:zh.STREAM_DRAW,STATIC_DRAW:zh.STATIC_DRAW,DYNAMIC_DRAW:zh.DYNAMIC_DRAW,validate:function(t){return t===df.STREAM_DRAW||t===df.STATIC_DRAW||t===df.DYNAMIC_DRAW}};function pf(t){if(t=Pr(t,Pr.EMPTY_OBJECT),Qr.defined("options.context",t.context),!Nr(t.typedArray)&&!Nr(t.sizeInBytes))throw new Lr("Either options.sizeInBytes or options.typedArray is required.");if(Nr(t.typedArray)&&Nr(t.sizeInBytes))throw new Lr("Cannot pass in both options.sizeInBytes and options.typedArray.");if(Nr(t.typedArray)&&(Qr.typeOf.object("options.typedArray",t.typedArray),Qr.typeOf.number("options.typedArray.byteLength",t.typedArray.byteLength)),!df.validate(t.usage))throw new Lr("usage is invalid.");var e=t.context._gl,n=t.bufferTarget,r=t.typedArray,i=t.sizeInBytes,o=t.usage,a=Nr(r);a&&(i=r.byteLength),Qr.typeOf.number.greaterThan("sizeInBytes",i,0);var s=e.createBuffer();e.bindBuffer(n,s),e.bufferData(n,a?r:i,o),e.bindBuffer(n,null),this._gl=e,this._webgl2=t.context._webgl2,this._bufferTarget=n,this._sizeInBytes=i,this._usage=o,this._buffer=s,this.vertexArrayDestroyable=!0,this.context=t.context,t.context.memorySize+=i}pf.createVertexBuffer=function(t){return Qr.defined("options.context",t.context),new pf({context:t.context,bufferTarget:zh.ARRAY_BUFFER,typedArray:t.typedArray,sizeInBytes:t.sizeInBytes,usage:t.usage})},pf.createIndexBuffer=function(t){if(Qr.defined("options.context",t.context),!ff.validate(t.indexDatatype))throw new Lr("Invalid indexDatatype.");if(t.indexDatatype===ff.UNSIGNED_INT&&!t.context.elementIndexUint)throw new Lr("IndexDatatype.UNSIGNED_INT requires OES_element_index_uint, which is not supported on this system. Check context.elementIndexUint.");var e=t.context,n=t.indexDatatype,r=ff.getSizeInBytes(n),i=new pf({context:e,bufferTarget:zh.ELEMENT_ARRAY_BUFFER,typedArray:t.typedArray,sizeInBytes:t.sizeInBytes,usage:t.usage}),o=i.sizeInBytes/r;return Object.defineProperties(i,{indexDatatype:{get:function(){return n}},bytesPerIndex:{get:function(){return r}},numberOfIndices:{get:function(){return o}}}),i},Object.defineProperties(pf.prototype,{sizeInBytes:{get:function(){return this._sizeInBytes}},usage:{get:function(){return this._usage}}}),pf.prototype._getBuffer=function(){return this._buffer},pf.prototype.copyFromArrayView=function(t,e){e=Pr(e,0),Qr.defined("arrayView",t),Qr.typeOf.number.lessThanOrEquals("offsetInBytes + arrayView.byteLength",e+t.byteLength,this._sizeInBytes);var n=this._gl,r=this._bufferTarget;n.bindBuffer(r,this._buffer),n.bufferSubData(r,e,t),n.bindBuffer(r,null)},pf.prototype.copyFromBuffer=function(t,e,n,r){if(!this._webgl2)throw new Lr("A WebGL 2 context is required.");if(!Nr(t))throw new Lr("readBuffer must be defined.");if(!Nr(r)||r<=0)throw new Lr("sizeInBytes must be defined and be greater than zero.");if(!Nr(e)||e<0||e+r>t._sizeInBytes)throw new Lr("readOffset must be greater than or equal to zero and readOffset + sizeInBytes must be less than of equal to readBuffer.sizeInBytes.");if(!Nr(n)||n<0||n+r>this._sizeInBytes)throw new Lr("writeOffset must be greater than or equal to zero and writeOffset + sizeInBytes must be less than of equal to this.sizeInBytes.");if(this._buffer===t._buffer&&(n>=e&&n<e+r||e>n&&e<n+r))throw new Lr("When readBuffer is equal to this, the ranges [readOffset + sizeInBytes) and [writeOffset, writeOffset + sizeInBytes) must not overlap.");if(this._bufferTarget===zh.ELEMENT_ARRAY_BUFFER&&t._bufferTarget!==zh.ELEMENT_ARRAY_BUFFER||this._bufferTarget!==zh.ELEMENT_ARRAY_BUFFER&&t._bufferTarget===zh.ELEMENT_ARRAY_BUFFER)throw new Lr("Can not copy an index buffer into another buffer type.");var i=zh.COPY_READ_BUFFER,o=zh.COPY_WRITE_BUFFER,a=this._gl;a.bindBuffer(o,this._buffer),a.bindBuffer(i,t._buffer),a.copyBufferSubData(i,o,e,n,r),a.bindBuffer(o,null),a.bindBuffer(i,null)},pf.prototype.getBufferData=function(t,e,n,r){if(e=Pr(e,0),n=Pr(n,0),!this._webgl2)throw new Lr("A WebGL 2 context is required.");if(!Nr(t))throw new Lr("arrayView is required.");var i,o,a=t.byteLength;if(Nr(r)?(i=r,Nr(a)?o=1:(a=t.length,o=t.BYTES_PER_ELEMENT)):Nr(a)?(i=a-n,o=1):(i=(a=t.length)-n,o=t.BYTES_PER_ELEMENT),n<0||n>a)throw new Lr("destinationOffset must be greater than zero and less than the arrayView length.");if(n+i>a)throw new Lr("destinationOffset + length must be less than or equal to the arrayViewLength.");if(e<0||e>this._sizeInBytes)throw new Lr("sourceOffset must be greater than zero and less than the buffers size.");if(e+i*o>this._sizeInBytes)throw new Lr("sourceOffset + length must be less than the buffers size.");var s=this._gl,c=zh.COPY_READ_BUFFER;s.bindBuffer(c,this._buffer),s.getBufferSubData(c,e,t,n,r),s.bindBuffer(c,null)},pf.prototype.isDestroyed=function(){return!1},pf.prototype.destroy=function(){return this._gl.deleteBuffer(this._buffer),this.context.memorySize-=this.sizeInBytes,uf(this)};var Af={_maximumCombinedTextureImageUnits:0,_maximumCubeMapSize:0,_maximumFragmentUniformVectors:0,_maximumTextureImageUnits:0,_maximumRenderbufferSize:0,_maximumTextureSize:0,_maximumVaryingVectors:0,_maximumVertexAttributes:0,_maximumVertexTextureImageUnits:0,_maximumVertexUniformVectors:0,_minimumAliasedLineWidth:0,_maximumAliasedLineWidth:0,_minimumAliasedPointSize:0,_maximumAliasedPointSize:0,_maximumViewportWidth:0,_maximumViewportHeight:0,_maximumTextureFilterAnisotropy:0,_maximumDrawBuffers:0,_maximumColorAttachments:0,_highpFloatSupported:!1,_highpIntSupported:!1,_uniformBufferOffsetAlignment:256,_maxUniformBufferBinding:36,_maxArrayTextureLayers:256};function gf(t,e,n,r){var i=Nr(e.vertexBuffer),o=Nr(e.value),a=e.value?e.value.length:e.componentsPerAttribute;if(!i&&!o)throw new Lr("attribute must have a vertexBuffer or a value.");if(i&&o)throw new Lr("attribute cannot have both a vertexBuffer and a value. It must have either a vertexBuffer property defining per-vertex data or a value property defining data for all vertices.");if(1!==a&&2!==a&&3!==a&&4!==a){if(o)throw new Lr("attribute.value.length must be in the range [1, 4].");throw new Lr("attribute.componentsPerAttribute must be in the range [1, 4].")}if(Nr(e.componentDatatype)&&!Nh.validate(e.componentDatatype))throw new Lr("attribute must have a valid componentDatatype or not specify it.");if(Nr(e.strideInBytes)&&e.strideInBytes>255)throw new Lr("attribute must have a strideInBytes less than or equal to 255 or not specify it.");if(Nr(e.instanceDivisor)&&e.instanceDivisor>0&&!r.instancedArrays)throw new Lr("instanced arrays is not supported");if(Nr(e.instanceDivisor)&&e.instanceDivisor<0)throw new Lr("attribute must have an instanceDivisor greater than or equal to zero");if(Nr(e.instanceDivisor)&&o)throw new Lr("attribute cannot have have an instanceDivisor if it is not backed by a buffer");if(Nr(e.instanceDivisor)&&e.instanceDivisor>0&&0===e.index)throw new Lr("attribute zero cannot have an instanceDivisor greater than 0");var s={index:Pr(e.index,n),enabled:Pr(e.enabled,!0),vertexBuffer:e.vertexBuffer,value:o?e.value.slice(0):void 0,componentsPerAttribute:a,componentDatatype:Pr(e.componentDatatype,Nh.FLOAT),normalize:Pr(e.normalize,!1),offsetInBytes:Pr(e.offsetInBytes,0),strideInBytes:Pr(e.strideInBytes,0),instanceDivisor:Pr(e.instanceDivisor,0)};if(i)s.vertexAttrib=function(t){var e=this.index;t.bindBuffer(t.ARRAY_BUFFER,this.vertexBuffer._getBuffer()),t.vertexAttribPointer(e,this.componentsPerAttribute,this.componentDatatype,this.normalize,this.strideInBytes,this.offsetInBytes),t.enableVertexAttribArray(e),this.instanceDivisor>0&&(r.glVertexAttribDivisor(e,this.instanceDivisor),r._vertexAttribDivisors[e]=this.instanceDivisor,r._previousDrawInstanced=!0)},s.disableVertexAttribArray=function(t){t.disableVertexAttribArray(this.index),this.instanceDivisor>0&&r.glVertexAttribDivisor(n,0)};else{switch(s.componentsPerAttribute){case 1:s.vertexAttrib=function(t){t.vertexAttrib1fv(this.index,this.value)};break;case 2:s.vertexAttrib=function(t){t.vertexAttrib2fv(this.index,this.value)};break;case 3:s.vertexAttrib=function(t){t.vertexAttrib3fv(this.index,this.value)};break;case 4:s.vertexAttrib=function(t){t.vertexAttrib4fv(this.index,this.value)}}s.disableVertexAttribArray=function(t){}}t.push(s)}function mf(t,e,n){for(var r=0;r<e.length;++r){var i=e[r];i.enabled&&i.vertexAttrib(t)}Nr(n)&&t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,n._getBuffer())}function yf(t){t=Pr(t,Pr.EMPTY_OBJECT),Qr.defined("options.context",t.context),Qr.defined("options.attributes",t.attributes);var e,n=t.context,r=n._gl,i=t.attributes,o=t.indexBuffer,a=[],s=1,c=!1,l=!1,u=i.length;for(e=0;e<u;++e)gf(a,i[e],e,n);for(u=a.length,e=0;e<u;++e){var h=a[e];if(Nr(h.vertexBuffer)&&0===h.instanceDivisor){var f=h.strideInBytes||h.componentsPerAttribute*Nh.getSizeInBytes(h.componentDatatype);s=h.vertexBuffer.sizeInBytes/f;break}}for(e=0;e<u;++e)a[e].instanceDivisor>0&&(c=!0),Nr(a[e].value)&&(l=!0);var d,p={};for(e=0;e<u;++e){var A=a[e].index;if(p[A])throw new Lr("Index "+A+" is used by more than one attribute.");p[A]=!0}n.vertexArrayObject&&(d=n.glCreateVertexArray(),n.glBindVertexArray(d),mf(r,a,o),n.glBindVertexArray(null)),this._numberOfVertices=s,this._hasInstancedAttributes=c,this._hasConstantAttributes=l,this._context=n,this._gl=r,this._vao=d,this._attributes=a,this._indexBuffer=o}function vf(t){return t.values.length/t.componentsPerAttribute}function Cf(t){return Nh.getSizeInBytes(t.componentDatatype)*t.componentsPerAttribute}function If(t){t=Pr(t,Pr.EMPTY_OBJECT),this._boundingVolume=t.boundingVolume,this._orientedBoundingBox=t.orientedBoundingBox,this._cull=Pr(t.cull,!0),this._occlude=Pr(t.occlude,!0),this._modelMatrix=t.modelMatrix,this._primitiveType=Pr(t.primitiveType,Kh.TRIANGLES),this._vertexArray=t.vertexArray,this._count=t.count,this._offset=Pr(t.offset,0),this._instanceCount=Pr(t.instanceCount,0),this._shaderProgram=t.shaderProgram,this._uniformMap=t.uniformMap,this._renderState=t.renderState,this._framebuffer=t.framebuffer,this._pass=t.pass,this._executeInClosestFrustum=Pr(t.executeInClosestFrustum,!1),this._owner=t.owner,this._debugShowBoundingVolume=Pr(t.debugShowBoundingVolume,!1),this._debugOverlappingFrustums=0,this._castShadows=Pr(t.castShadows,!1),this._receiveShadows=Pr(t.receiveShadows,!1),this._selectCastShadows=!1,this._pickId=t.pickId,this._pickOnly=Pr(t.pickOnly,!1),this._isViewportQuad=Pr(t.isViewportQuad,!1),this.dirty=!0,this.lastDirtyTime=0,this.derivedCommands={},this._uniformBuffers=[]}function xf(t,e){var n=/#define OUTPUT_DECLARATION/,r=t.split("\n");if(/#version 300 es/g.test(t))return t;var i,o,a=-1;for(i=0;i<r.length;++i)if(o=r[i],n.test(o)){a=i;break}if(-1===a)throw new Lr("Could not find a #define OUTPUT_DECLARATION!");var s=[];for(i=0;i<10;i++){var c="gl_FragData\\["+i+"\\]",l="czm_out"+i;new RegExp(c,"g").test(t)&&(_f(l,s),Ef(c,l,r),r.splice(a,0,"layout(location = "+i+") out vec4 "+l+";"),a+=1)}var u="czm_fragColor";(function(t,e){for(var n=new RegExp("(^|[^\\w])("+t+")($|[^\\w])","g"),r=e.length,i=0;i<r;++i){var o=e[i];if(n.test(o))return!0}return!1})("gl_FragColor",r)&&(_f(u,s),Ef("gl_FragColor",u,r),r.splice(a,0,"layout(location = 0) out vec4 czm_fragColor;"),a+=1);var h=function(t,e){for(var n={},r=t.length,i=[],o=0;o<e.length;++o){var a=e[o],s=/(#ifdef|#if)/g.test(a),c=/#else/g.test(a),l=/#endif/g.test(a);if(s)i.push(a);else if(c){var u=i[i.length-1].replace("ifdef","ifndef");/if/g.test(u)&&(u=u.replace(/(#if\s+)(\S*)([^]*)/,"$1!($2)$3")),i.pop(),i.push(u)}else if(l)i.pop();else if(!/layout/g.test(a))for(var h=0;h<r;++h){var f=t[h];-1!==a.indexOf(f)&&(Nr(n[f])?n[f]=n[f].filter((function(t){return i.indexOf(t)>=0})):n[f]=i.slice())}}return n}(s,r),f={};for(i=0;i<r.length;i++)for(var d in o=r[i],h){if(h.hasOwnProperty(d))new RegExp("(layout)[^]+(out)[^]+("+d+")[^]+","g").test(o)&&(f[o]=d)}for(var p in f)if(f.hasOwnProperty(p)){var A,g=f[p],m=r.indexOf(p),y=h[g],v=y.length;for(A=0;A<v;A++)r.splice(m,0,y[A]);for(m+=v+1,A=v-1;A>=0;A--)r.splice(m,0,"#endif //"+y[A])}var C="#version 300 es",I=!1;for(i=0;i<r.length;i++)/#version/.test(r[i])&&(r[i]=C,I=!0);return I||r.splice(0,0,C),bf("EXT_draw_buffers",r),bf("EXT_frag_depth",r),Ef("texture2D","texture",r),Ef("texture3D","texture",r),Ef("textureCube","texture",r),Ef("gl_FragDepthEXT","gl_FragDepth",r),e?Ef("varying","in",r):(Ef("attribute","in",r),Ef("varying","out",r)),function(t){for(var e="",n=t.length,r=0;r<n;++r)e+=t[r]+"\n";return e}(r)}function Ef(t,e,n){for(var r=new RegExp("(^|[^\\w])("+t+")($|[^\\w])","g"),i=n.length,o=0;o<i;++o){var a=n[o];n[o]=a.replace(r,"$1"+e+"$3")}}function _f(t,e){-1===e.indexOf(t)&&e.push(t)}function bf(t,e){!function(t,e,n){for(var r=n.length,i=0;i<r;++i){var o=n[i];n[i]=o.replace(t,e)}}(new RegExp("#extension\\s+GL_"+t+"\\s+:\\s+[a-zA-Z0-9]+\\s*$","g"),"",e)}Object.defineProperties(Af,{maximumCombinedTextureImageUnits:{get:function(){return Af._maximumCombinedTextureImageUnits}},maximumCubeMapSize:{get:function(){return Af._maximumCubeMapSize}},maximumFragmentUniformVectors:{get:function(){return Af._maximumFragmentUniformVectors}},maximumTextureImageUnits:{get:function(){return Af._maximumTextureImageUnits}},maximumRenderbufferSize:{get:function(){return Af._maximumRenderbufferSize}},maximumTextureSize:{get:function(){return Af._maximumTextureSize}},maximumVaryingVectors:{get:function(){return Af._maximumVaryingVectors}},maximumVertexAttributes:{get:function(){return Af._maximumVertexAttributes}},maximumVertexTextureImageUnits:{get:function(){return Af._maximumVertexTextureImageUnits}},maximumVertexUniformVectors:{get:function(){return Af._maximumVertexUniformVectors}},minimumAliasedLineWidth:{get:function(){return Af._minimumAliasedLineWidth}},maximumAliasedLineWidth:{get:function(){return Af._maximumAliasedLineWidth}},minimumAliasedPointSize:{get:function(){return Af._minimumAliasedPointSize}},maximumAliasedPointSize:{get:function(){return Af._maximumAliasedPointSize}},maximumViewportWidth:{get:function(){return Af._maximumViewportWidth}},maximumViewportHeight:{get:function(){return Af._maximumViewportHeight}},maximumTextureFilterAnisotropy:{get:function(){return Af._maximumTextureFilterAnisotropy}},maximumDrawBuffers:{get:function(){return Af._maximumDrawBuffers}},maximumColorAttachments:{get:function(){return Af._maximumColorAttachments}},highpFloatSupported:{get:function(){return Af._highpFloatSupported}},highpIntSupported:{get:function(){return Af._highpIntSupported}},uniformBufferOffsetAlignment:{get:function(){return Af._uniformBufferOffsetAlignment}},maxUniformBufferBinding:{get:function(){return Af._maxUniformBufferBinding}},maxArrayTextureLayers:{get:function(){return Af._maxArrayTextureLayers}}}),yf.fromGeometry=function(t){t=Pr(t,Pr.EMPTY_OBJECT),Qr.defined("options.context",t.context);var e,n,r,i,o=t.context,a=Pr(t.geometry,Pr.EMPTY_OBJECT),s=Pr(t.bufferUsage,df.DYNAMIC_DRAW),c=Pr(t.attributeLocations,Pr.EMPTY_OBJECT),l=Pr(t.interleave,!1),u=t.vertexArrayAttributes,h=Nr(u)?u:[],f=a.attributes;if(l){var d=function(t){var e,n,r,i,o=[];for(n in t)t.hasOwnProperty(n)&&Nr(t[n])&&Nr(t[n].values)&&(o.push(n),t[n].componentDatatype===Nh.DOUBLE&&(t[n].componentDatatype=Nh.FLOAT,t[n].values=Nh.createTypedArray(Nh.FLOAT,t[n].values)));var a=o.length;if(a>0)for(i=vf(t[o[0]]),e=1;e<a;++e){var s=vf(t[o[e]]);if(s!==i)throw new la("Each attribute list must have the same number of vertices. Attribute "+o[e]+" has a different number of vertices ("+s.toString()+") than attribute "+o[0]+" ("+i.toString()+").")}o.sort((function(e,n){return Nh.getSizeInBytes(t[n].componentDatatype)-Nh.getSizeInBytes(t[e].componentDatatype)}));var c=0,l={};for(e=0;e<a;++e)n=o[e],r=t[n],l[n]=c,c+=Cf(r);if(c>0){var u=Nh.getSizeInBytes(t[o[0]].componentDatatype),h=c%u;0!==h&&(c+=u-h);var f=new ArrayBuffer(i*c),d={};for(e=0;e<a;++e){n=o[e];var p=Nh.getSizeInBytes(t[n].componentDatatype);d[n]={pointer:Nh.createTypedArray(t[n].componentDatatype,f),index:l[n]/p,strideInComponentType:c/p}}for(e=0;e<i;++e)for(var A=0;A<a;++A){n=o[A];for(var g=(r=t[n]).values,m=d[n],y=m.pointer,v=r.componentsPerAttribute,C=0;C<v;++C)y[m.index+C]=g[e*v+C];m.index+=m.strideInComponentType}return{buffer:f,offsetsInBytes:l,vertexSizeInBytes:c}}}(f);if(Nr(d)){r=pf.createVertexBuffer({context:o,typedArray:d.buffer,usage:s});var p=d.offsetsInBytes,A=d.vertexSizeInBytes;for(e in f)f.hasOwnProperty(e)&&Nr(f[e])&&(Nr((n=f[e]).values)?h.push({index:c[e],vertexBuffer:r,componentDatatype:n.componentDatatype,componentsPerAttribute:n.componentsPerAttribute,normalize:n.normalize,offsetInBytes:p[e],strideInBytes:A}):h.push({index:c[e],value:n.value,componentDatatype:n.componentDatatype,normalize:n.normalize}))}}else for(e in f)if(f.hasOwnProperty(e)&&Nr(f[e])){var g=(n=f[e]).componentDatatype;g===Nh.DOUBLE&&(g=Nh.FLOAT),r=void 0,Nr(n.values)&&(r=pf.createVertexBuffer({context:o,typedArray:Nh.createTypedArray(g,n.values),usage:s})),h.push({index:c[e],vertexBuffer:r,value:n.value,componentDatatype:g,componentsPerAttribute:n.componentsPerAttribute,normalize:n.normalize})}var m=a.indices;return Nr(m)&&(i=Wh.computeNumberOfVertices(a)>=Ur.SIXTY_FOUR_KILOBYTES&&o.elementIndexUint?pf.createIndexBuffer({context:o,typedArray:new Uint32Array(m),usage:s,indexDatatype:ff.UNSIGNED_INT}):pf.createIndexBuffer({context:o,typedArray:new Uint16Array(m),usage:s,indexDatatype:ff.UNSIGNED_SHORT})),new yf({context:o,attributes:h,indexBuffer:i})},Object.defineProperties(yf.prototype,{numberOfAttributes:{get:function(){return this._attributes.length}},numberOfVertices:{get:function(){return this._numberOfVertices}},indexBuffer:{get:function(){return this._indexBuffer}}}),yf.prototype.getAttribute=function(t){return Qr.defined("index",t),this._attributes[t]},yf.prototype._bind=function(){Nr(this._vao)?(this._context.glBindVertexArray(this._vao),this._context.instancedArrays&&function(t){var e=t._context,n=t._hasInstancedAttributes;if(n||e._previousDrawInstanced){e._previousDrawInstanced=n;var r,i=e._vertexAttribDivisors,o=t._attributes,a=Af.maximumVertexAttributes;if(n){var s=o.length;for(r=0;r<s;++r){var c=o[r];if(c.enabled){var l=c.instanceDivisor,u=c.index;l!==i[u]&&(e.glVertexAttribDivisor(u,l),i[u]=l)}}}else for(r=0;r<a;++r)i[r]>0&&(e.glVertexAttribDivisor(r,0),i[r]=0)}}(this),this._hasConstantAttributes&&function(t,e){for(var n=t._attributes,r=n.length,i=0;i<r;++i){var o=n[i];o.enabled&&Nr(o.value)&&o.vertexAttrib(e)}}(this,this._gl)):mf(this._gl,this._attributes,this._indexBuffer)},yf.prototype._unBind=function(){if(Nr(this._vao))this._context.glBindVertexArray(null);else{for(var t=this._attributes,e=this._gl,n=0;n<t.length;++n){var r=t[n];r.enabled&&r.disableVertexAttribArray(e)}this._indexBuffer&&e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,null)}},yf.prototype.isDestroyed=function(){return!1},yf.prototype.destroy=function(){for(var t=this._attributes,e=0;e<t.length;++e){var n=t[e].vertexBuffer;Nr(n)&&!n.isDestroyed()&&n.vertexArrayDestroyable&&n.destroy()}var r=this._indexBuffer;return Nr(r)&&!r.isDestroyed()&&r.vertexArrayDestroyable&&r.destroy(),Nr(this._vao)&&this._context.glDeleteVertexArray(this._vao),uf(this)},Object.defineProperties(If.prototype,{boundingVolume:{get:function(){return this._boundingVolume},set:function(t){this._boundingVolume!==t&&(this._boundingVolume=t,this.dirty=!0)}},orientedBoundingBox:{get:function(){return this._orientedBoundingBox},set:function(t){this._orientedBoundingBox!==t&&(this._orientedBoundingBox=t,this.dirty=!0)}},cull:{get:function(){return this._cull},set:function(t){this._cull!==t&&(this._cull=t,this.dirty=!0)}},occlude:{get:function(){return this._occlude},set:function(t){this._occlude!==t&&(this._occlude=t,this.dirty=!0)}},test:{get:function(){return this._test},set:function(t){this._test=t}},modelMatrix:{get:function(){return this._modelMatrix},set:function(t){this._modelMatrix!==t&&(this._modelMatrix=t,this.dirty=!0)}},primitiveType:{get:function(){return this._primitiveType},set:function(t){this._primitiveType!==t&&(this._primitiveType=t,this.dirty=!0)}},vertexArray:{get:function(){return this._vertexArray},set:function(t){this._vertexArray!==t&&(this._vertexArray=t,this.dirty=!0)}},count:{get:function(){return this._count},set:function(t){this._count!==t&&(this._count=t,this.dirty=!0)}},offset:{get:function(){return this._offset},set:function(t){this._offset!==t&&(this._offset=t,this.dirty=!0)}},instanceCount:{get:function(){return this._instanceCount},set:function(t){this._instanceCount!==t&&(this._instanceCount=t,this.dirty=!0)}},shaderProgram:{get:function(){return this._shaderProgram},set:function(t){this._shaderProgram!==t&&(this._shaderProgram=t,this.dirty=!0)}},castShadows:{get:function(){return this._castShadows},set:function(t){this._castShadows!==t&&(this._castShadows=t,this.dirty=!0)}},selectCastShadows:{get:function(){return this._selectCastShadows},set:function(t){this._selectCastShadows!==t&&(this._selectCastShadows=t,this.dirty=!0)}},receiveShadows:{get:function(){return this._receiveShadows},set:function(t){this._receiveShadows!==t&&(this._receiveShadows=t,this.dirty=!0)}},uniformMap:{get:function(){return this._uniformMap},set:function(t){this._uniformMap!==t&&(this._uniformMap=t,this.dirty=!0)}},renderState:{get:function(){return this._renderState},set:function(t){this._renderState!==t&&(this._renderState=t,this.dirty=!0)}},framebuffer:{get:function(){return this._framebuffer},set:function(t){this._framebuffer!==t&&(this._framebuffer=t,this.dirty=!0)}},pass:{get:function(){return this._pass},set:function(t){this._pass!==t&&(this._pass=t,this.dirty=!0)}},executeInClosestFrustum:{get:function(){return this._executeInClosestFrustum},set:function(t){this._executeInClosestFrustum!==t&&(this._executeInClosestFrustum=t,this.dirty=!0)}},owner:{get:function(){return this._owner},set:function(t){this._owner!==t&&(this._owner=t,this.dirty=!0)}},debugShowBoundingVolume:{get:function(){return this._debugShowBoundingVolume},set:function(t){this._debugShowBoundingVolume!==t&&(this._debugShowBoundingVolume=t,this.dirty=!0)}},debugOverlappingFrustums:{get:function(){return this._debugOverlappingFrustums},set:function(t){this._debugOverlappingFrustums!==t&&(this._debugOverlappingFrustums=t,this.dirty=!0)}},pickId:{get:function(){return this._pickId},set:function(t){this._pickId!==t&&(this._pickId=t,this.dirty=!0)}},pickOnly:{get:function(){return this._pickOnly},set:function(t){this._pickOnly!==t&&(this._pickOnly=t,this.dirty=!0)}},isViewportQuad:{get:function(){return this._isViewportQuad}}}),If.prototype.addUniformBuffer=function(t){t.increaseRef(),this._uniformBuffers.push(t)},If.prototype.removeAllUniformBuffer=function(){if(Nr(this._uniformBuffers)){for(var t=0;t<this._uniformBuffers.length;t++)this._uniformBuffers[t].decreaseRef();this._uniformBuffers=[]}},If.shallowClone=function(t,e){if(Nr(t))return Nr(e)||(e=new If),e._boundingVolume=t._boundingVolume,e._orientedBoundingBox=t._orientedBoundingBox,e._cull=t._cull,e._occlude=t._occlude,e._modelMatrix=t._modelMatrix,e._primitiveType=t._primitiveType,e._vertexArray=t._vertexArray,e._count=t._count,e._offset=t._offset,e._instanceCount=t._instanceCount,e._shaderProgram=t._shaderProgram,e._uniformMap=t._uniformMap,e._uniformBuffers=t._uniformBuffers,e._renderState=t._renderState,e._framebuffer=t._framebuffer,e._pass=t._pass,e._executeInClosestFrustum=t._executeInClosestFrustum,e._owner=t._owner,e._debugShowBoundingVolume=t._debugShowBoundingVolume,e._debugOverlappingFrustums=t._debugOverlappingFrustums,e._castShadows=t._castShadows,e._receiveShadows=t._receiveShadows,e._selectCastShadows=t._selectCastShadows,e._pickId=t._pickId,e._pickOnly=t._pickOnly,e._pointCloudEyeDomeLighting=t._pointCloudEyeDomeLighting,e.dirty=!0,e.lastDirtyTime=0,e},If.prototype.removeAllFastBundleAndBindGroups=function(){this.bindGroups=void 0,this._fastBundle={}},If.prototype.execute=function(t,e){t.draw(this,e)};var wf=new Hr;function Mf(t){this._size=t.size,this._datatype=t.datatype,this.getValue=t.getValue}var Tf={};Tf[zh.FLOAT]="float",Tf[zh.FLOAT_VEC2]="vec2",Tf[zh.FLOAT_VEC3]="vec3",Tf[zh.FLOAT_VEC4]="vec4",Tf[zh.INT]="int",Tf[zh.INT_VEC2]="ivec2",Tf[zh.INT_VEC3]="ivec3",Tf[zh.INT_VEC4]="ivec4",Tf[zh.BOOL]="bool",Tf[zh.BOOL_VEC2]="bvec2",Tf[zh.BOOL_VEC3]="bvec3",Tf[zh.BOOL_VEC4]="bvec4",Tf[zh.FLOAT_MAT2]="mat2",Tf[zh.FLOAT_MAT3]="mat3",Tf[zh.FLOAT_MAT4]="mat4",Tf[zh.SAMPLER_2D]="sampler2D",Tf[zh.SAMPLER_CUBE]="samplerCube",Mf.prototype.getDeclaration=function(t){var e="uniform "+Tf[this._datatype]+" "+t,n=this._size;return e+=1===n?";":"["+n.toString()+"];"};var Bf={czm_viewport:new Mf({size:1,datatype:zh.FLOAT_VEC4,getValue:function(t){return t.viewportCartesian4}}),czm_currentViewportOffset:new Mf({size:1,datatype:zh.FLOAT_VEC4,getValue:function(t){return t.viewportOffset}}),czm_viewportOrthographic:new Mf({size:1,datatype:zh.FLOAT_MAT4,getValue:function(t){return t.viewportOrthographic}}),czm_viewportTransformation:new Mf({size:1,datatype:zh.FLOAT_MAT4,getValue:function(t){return t.viewportTransformation}}),czm_globeDepthTexture:new Mf({size:1,datatype:zh.SAMPLER_2D,getValue:function(t){return t.globeDepthTexture}}),czm_model:new Mf({size:1,datatype:zh.FLOAT_MAT4,getValue:function(t){return t.model}}),czm_inverseModel:new Mf({size:1,datatype:zh.FLOAT_MAT4,getValue:function(t){return t.inverseModel}}),czm_view:new Mf({size:1,datatype:zh.FLOAT_MAT4,getValue:function(t){return t.view}}),czm_view3D:new Mf({size:1,datatype:zh.FLOAT_MAT4,getValue:function(t){return t.view3D}}),czm_viewRotation:new Mf({size:1,datatype:zh.FLOAT_MAT3,getValue:function(t){return t.viewRotation}}),czm_viewRotation3D:new Mf({size:1,datatype:zh.FLOAT_MAT3,getValue:function(t){return t.viewRotation3D}}),czm_inverseView:new Mf({size:1,datatype:zh.FLOAT_MAT4,getValue:function(t){return t.inverseView}}),czm_inverseView3D:new Mf({size:1,datatype:zh.FLOAT_MAT4,getValue:function(t){return t.inverseView3D}}),czm_inverseViewRotation:new Mf({size:1,datatype:zh.FLOAT_MAT3,getValue:function(t){return t.inverseViewRotation}}),czm_inverseViewRotation3D:new Mf({size:1,datatype:zh.FLOAT_MAT3,getValue:function(t){return t.inverseViewRotation3D}}),czm_projection:new Mf({size:1,datatype:zh.FLOAT_MAT4,getValue:function(t){return t.projection}}),czm_inverseProjection:new Mf({size:1,datatype:zh.FLOAT_MAT4,getValue:function(t){return t.inverseProjection}}),czm_infiniteProjection:new Mf({size:1,datatype:zh.FLOAT_MAT4,getValue:function(t){return t.infiniteProjection}}),czm_modelView:new Mf({size:1,datatype:zh.FLOAT_MAT4,getValue:function(t){return t.modelView}}),czm_modelView3D:new Mf({size:1,datatype:zh.FLOAT_MAT4,getValue:function(t){return t.modelView3D}}),czm_modelViewRelativeToEye:new Mf({size:1,datatype:zh.FLOAT_MAT4,getValue:function(t){return t.modelViewRelativeToEye}}),czm_inverseModelView:new Mf({size:1,datatype:zh.FLOAT_MAT4,getValue:function(t){return t.inverseModelView}}),czm_inverseModelView3D:new Mf({size:1,datatype:zh.FLOAT_MAT4,getValue:function(t){return t.inverseModelView3D}}),czm_viewProjection:new Mf({size:1,datatype:zh.FLOAT_MAT4,getValue:function(t){return t.viewProjection}}),czm_inverseViewProjection:new Mf({size:1,datatype:zh.FLOAT_MAT4,getValue:function(t){return t.inverseViewProjection}}),czm_modelViewProjection:new Mf({size:1,datatype:zh.FLOAT_MAT4,getValue:function(t){return t.modelViewProjection}}),czm_inverseModelViewProjection:new Mf({size:1,datatype:zh.FLOAT_MAT4,getValue:function(t){return t.inverseModelViewProjection}}),czm_modelViewProjectionRelativeToEye:new Mf({size:1,datatype:zh.FLOAT_MAT4,getValue:function(t){return t.modelViewProjectionRelativeToEye}}),czm_modelViewInfiniteProjection:new Mf({size:1,datatype:zh.FLOAT_MAT4,getValue:function(t){return t.modelViewInfiniteProjection}}),czm_orthographicIn3D:new Mf({size:1,datatype:zh.FLOAT,getValue:function(t){return t.orthographicIn3D?1:0}}),czm_normal:new Mf({size:1,datatype:zh.FLOAT_MAT3,getValue:function(t){return t.normal}}),czm_normal3D:new Mf({size:1,datatype:zh.FLOAT_MAT3,getValue:function(t){return t.normal3D}}),czm_inverseNormal:new Mf({size:1,datatype:zh.FLOAT_MAT3,getValue:function(t){return t.inverseNormal}}),czm_inverseNormal3D:new Mf({size:1,datatype:zh.FLOAT_MAT3,getValue:function(t){return t.inverseNormal3D}}),czm_eyeHeight2D:new Mf({size:1,datatype:zh.FLOAT_VEC2,getValue:function(t){return t.eyeHeight2D}}),czm_entireFrustum:new Mf({size:1,datatype:zh.FLOAT_VEC2,getValue:function(t){return t.entireFrustum}}),czm_currentFrustum:new Mf({size:1,datatype:zh.FLOAT_VEC2,getValue:function(t){return t.currentFrustum}}),czm_frustumPlanes:new Mf({size:1,datatype:zh.FLOAT_VEC4,getValue:function(t){return t.frustumPlanes}}),czm_farDepthFromNearPlusOne:new Mf({size:1,datatype:zh.FLOAT,getValue:function(t){return t.farDepthFromNearPlusOne}}),czm_log2FarDepthFromNearPlusOne:new Mf({size:1,datatype:zh.FLOAT,getValue:function(t){return t.log2FarDepthFromNearPlusOne}}),czm_oneOverLog2FarDepthFromNearPlusOne:new Mf({size:1,datatype:zh.FLOAT,getValue:function(t){return t.oneOverLog2FarDepthFromNearPlusOne}}),czm_sunPositionWC:new Mf({size:1,datatype:zh.FLOAT_VEC3,getValue:function(t){return t.sunPositionWC}}),czm_sunPositionColumbusView:new Mf({size:1,datatype:zh.FLOAT_VEC3,getValue:function(t){return t.sunPositionColumbusView}}),czm_sunDirectionEC:new Mf({size:1,datatype:zh.FLOAT_VEC3,getValue:function(t){return t.sunDirectionEC}}),czm_sunDirectionWC:new Mf({size:1,datatype:zh.FLOAT_VEC3,getValue:function(t){return t.sunDirectionWC}}),czm_moonDirectionEC:new Mf({size:1,datatype:zh.FLOAT_VEC3,getValue:function(t){return t.moonDirectionEC}}),czm_lightDirectionEC:new Mf({size:1,datatype:zh.FLOAT_VEC3,getValue:function(t){return t.lightDirectionEC}}),czm_lightDirectionWC:new Mf({size:1,datatype:zh.FLOAT_VEC3,getValue:function(t){return t.lightDirectionWC}}),czm_lightColor:new Mf({size:1,datatype:zh.FLOAT_VEC3,getValue:function(t){return t.lightColor}}),czm_lightColorHdr:new Mf({size:1,datatype:zh.FLOAT_VEC3,getValue:function(t){return t.lightColorHdr}}),czm_encodedCameraPositionMCHigh:new Mf({size:1,datatype:zh.FLOAT_VEC3,getValue:function(t){return t.encodedCameraPositionMCHigh}}),czm_encodedCameraPositionMCLow:new Mf({size:1,datatype:zh.FLOAT_VEC3,getValue:function(t){return t.encodedCameraPositionMCLow}}),czm_cameraPositionWC:new Mf({size:1,datatype:zh.FLOAT_VEC3,getValue:function(t){return t._cameraPosition}}),czm_viewerPositionWC:new Mf({size:1,datatype:zh.FLOAT_VEC3,getValue:function(t){return ls.getTranslation(t.inverseView,wf)}}),czm_frameNumber:new Mf({size:1,datatype:zh.FLOAT,getValue:function(t){return t.frameState.frameNumber}}),czm_morphTime:new Mf({size:1,datatype:zh.FLOAT,getValue:function(t){return t.frameState.morphTime}}),czm_sceneMode:new Mf({size:1,datatype:zh.FLOAT,getValue:function(t){return t.frameState.mode}}),czm_pass:new Mf({size:1,datatype:zh.FLOAT,getValue:function(t){return t.pass}}),czm_backgroundColor:new Mf({size:1,datatype:zh.FLOAT_VEC4,getValue:function(t){return t.backgroundColor}}),czm_brdfLut:new Mf({size:1,datatype:zh.SAMPLER_2D,getValue:function(t){return t.brdfLut}}),czm_environmentMap:new Mf({size:1,datatype:zh.SAMPLER_CUBE,getValue:function(t){return t.environmentMap}}),czm_specularEnvironmentMaps:new Mf({size:1,datatype:zh.SAMPLER_2D,getValue:function(t){return t.specularEnvironmentMaps}}),czm_specularEnvironmentMapSize:new Mf({size:1,datatype:zh.FLOAT_VEC2,getValue:function(t){return t.specularEnvironmentMapsDimensions}}),czm_specularEnvironmentMapsMaximumLOD:new Mf({size:1,datatype:zh.FLOAT,getValue:function(t){return t.specularEnvironmentMapsMaximumLOD}}),czm_sphericalHarmonicCoefficients:new Mf({size:9,datatype:zh.FLOAT_VEC3,getValue:function(t){return t.sphericalHarmonicCoefficients}}),czm_SH:new Mf({size:7,datatype:zh.FLOAT_VEC4,getValue:function(t){return t.sphericalHarmonics.shArr}}),czm_temeToPseudoFixed:new Mf({size:1,datatype:zh.FLOAT_MAT3,getValue:function(t){return t.temeToPseudoFixedMatrix}}),czm_pixelRatio:new Mf({size:1,datatype:zh.FLOAT,getValue:function(t){return t.pixelRatio}}),czm_resolutionScale:new Mf({size:1,datatype:zh.FLOAT,getValue:function(t){return t.resolutionScale}}),czm_fogDensity:new Mf({size:1,datatype:zh.FLOAT,getValue:function(t){return t.fogDensity}}),czm_imagerySplitPosition:new Mf({size:1,datatype:zh.FLOAT_VEC2,getValue:function(t){return t.imagerySplitPosition}}),czm_globeSplitPosition:new Mf({size:1,datatype:zh.FLOAT_VEC2,getValue:function(t){return t.globeSplitPosition}}),czm_geometricToleranceOverMeter:new Mf({size:1,datatype:zh.FLOAT,getValue:function(t){return t.geometricToleranceOverMeter}}),czm_minimumDisableDepthTestDistance:new Mf({size:1,datatype:zh.FLOAT,getValue:function(t){return t.minimumDisableDepthTestDistance}}),czm_invertClassificationColor:new Mf({size:1,datatype:zh.FLOAT_VEC4,getValue:function(t){return t.invertClassificationColor}}),czm_gamma:new Mf({size:1,datatype:zh.FLOAT,getValue:function(t){return t.gamma}}),czm_sunColor:new Mf({size:1,datatype:zh.FLOAT_VEC3,getValue:function(t){return t.sunColor}}),czm_globeDepthTextureDim:new Mf({size:1,datatype:zh.FLOAT_VEC2,getValue:function(t){return t.globeDepthTextureDim}}),czm_nonSelDepthTexture:new Mf({size:1,datatype:zh.SAMPLER_2D,getValue:function(t){return t.nonSelDepthTexture}}),czm_maskTexture:new Mf({size:1,datatype:zh.SAMPLER_2D,getValue:function(t){return t.maskTexture}}),czm_hdrEnvMap:new Mf({size:1,datatype:zh.SAMPLER_2D,getValue:function(t){return t.hdrEnvMap}}),czm_toneMappingExposure:new Mf({size:1,datatype:zh.FLOAT,getValue:function(t){return t.toneMappingExposure}}),czm_linearDepthOffset:new Mf({size:1,datatype:zh.FLOAT_VEC2,getValue:function(t){return t.linearDepthOffset}})};function Sf(t){}function Df(t){this.ifIndex=Nr(t.ifIndex)?t.ifIndex:void 0,this.elseIndex=Nr(t.elseIndex)?t.elseIndex:void 0,this.endIndex=Nr(t.endIndex)?t.endIndex:void 0,this.ifChildTokens=[],this.elseChildTokens=[],this.parentToken=Nr(t.parentToken)?t.parentToken:void 0,this.type=Nr(t.type)?t.type:void 0}function Rf(t,e){this.Key=t,this.String=e,this.StringLength=e.length}Sf.removeUnuseMacroCode=function(t,e,n){if(!function(t){if(t.indexOf("defined",0)>=0)return!1;if(t.indexOf("#if ",0)>=0)return!1;if(t.indexOf("#elif ",0)>=0)return!1;return!0}(n))return n;var r=function(t){var e=[],n=0,r=0,i=void 0;for(;-1!==n;){var o=Of(t,r);if(r=(n=o.findIndex)+o.type.StringLength,-1===n)break;switch(o.type.Key){case zf.TK_IFDEF.Key:case zf.TK_IFNEF.Key:var a=new Df({type:o.type,ifIndex:n});Nr(i)?Nr(i.endIndex)?(Nr(i.parentToken)||e.push(a),i=a):(i.addChildToken(a),a.parentToken=i,i=a):(i=a,e.push(a));break;case zf.TK_ELSE.Key:if(!Nr(i))continue;i.elseIndex=n;break;case zf.TK_END.Key:if(!Nr(i))continue;i.endIndex=n,Nr(i.parentToken)&&(i=i.parentToken)}}return e}(n),i=[];return function(t,e,n,r,i){if(0===n.length)return;for(var o=function(t,e,n){var r=e.defines,i={};if(Nr(r))for(var o=0;o<r.length;++o){i[r[o]]=1}if(Nr(t._sysShaderDefines))for(o=0;o<t._sysShaderDefines.length;++o){i[t._sysShaderDefines[o]]=1}var a=0,s=0;for(;-1!==a&&-1!==(a=n.indexOf("#define ",s));){var c=a+8,l=n.indexOf("\n",a);i[n.substring(c,l).trim()]=1,s=l}return i}(t,e,r),a=0;a<n.length;a++){Nf(n[a],o,r,i)}}(t,e,r,n,i),function(t,e){for(var n=t,r=0;r<e.length;r++){var i=e[r];if(i.endIndex-i.startIndex>1){var o=t.substring(i.startIndex,i.endIndex);n=n.replace(o,"")}}return n=n.replace(/(#ifdef|#ifndef|#else|#endif).*/gm,"")}(n,i)},Df.prototype.addChildToken=function(t){Nr(this.elseIndex)?this.elseChildTokens.push(t):this.ifChildTokens.push(t)},Rf.isEqual=function(t,e){return t.Key===e.Key};var zf={TK_IFDEF:new Rf(0,"#ifdef"),TK_IFNEF:new Rf(1,"#ifndef"),TK_ELSE:new Rf(2,"#else"),TK_END:new Rf(3,"#endif")};function Of(t,e){var n=-1,r=zf.TK_IFDEF;for(var i in zf){var o=zf[i],a=t.indexOf(o.String,e);(-1===n||a>=0&&a<n)&&(n=a,r=o)}return{type:r,findIndex:n}}function Nf(t,e,n,r){var i=0,o=function(t,e,n){var r=t.indexOf("\n",n+e+1),i=n+e+1;return t.substring(i,r)}(n,t.type.StringLength,t.ifIndex),a=function(t,e,n){return!(!Rf.isEqual(n,zf.TK_IFDEF)||!Nr(t[e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")]))||!(!Rf.isEqual(n,zf.TK_IFNEF)||Nr(t[e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")]))}(e,o,t.type);if(a){Nr(t.elseIndex)&&(i=t.elseIndex+zf.TK_ELSE.StringLength+1,r.push({startIndex:i,endIndex:t.endIndex}));for(var s=0;s<t.ifChildTokens.length;s++)Nf(t.ifChildTokens[s],e,n,r)}else{Nr(t.elseIndex)?r.push({startIndex:t.ifIndex+t.type.StringLength+Lf(n,t.ifIndex,t.type.String)+o.length,endIndex:t.elseIndex}):r.push({startIndex:t.ifIndex,endIndex:t.endIndex+zf.TK_END.StringLength});for(s=0;s<t.elseChildTokens.length;s++)Nf(t.elseChildTokens[s],e,n,r)}}function Lf(t,e,n){for(var r=n.length,i=e+r;i<t.length;i++){if(" "!==t.charAt(i))break}return i-(e+r)}var Qf={czm_degreesPerRadian:"/**\n * A built-in GLSL floating-point constant for converting radians to degrees.\n *\n * @alias czm_degreesPerRadian\n * @glslConstant\n *\n * @see CesiumMath.DEGREES_PER_RADIAN\n *\n * @example\n * // GLSL declaration\n * const float czm_degreesPerRadian = ...;\n *\n * // Example\n * float deg = czm_degreesPerRadian * rad;\n */\nconst float czm_degreesPerRadian = 57.29577951308232;\n",czm_depthRange:"/**\n * A built-in GLSL vec2 constant for defining the depth range.\n * This is a workaround to a bug where IE11 does not implement gl_DepthRange.\n *\n * @alias czm_depthRange\n * @glslConstant\n *\n * @example\n * // GLSL declaration\n * float depthRangeNear = czm_depthRange.near;\n * float depthRangeFar = czm_depthRange.far;\n *\n */\nconst czm_depthRangeStruct czm_depthRange = czm_depthRangeStruct(0.0, 1.0);\n",czm_ellipsoidInverseRadii:"/**\n * The reciprocal of the radius of the WGS84 ellipsoid.\n *\n * @name czm_ellipsoidInverseRadii\n * @glslConstant\n */\nconst vec3 czm_ellipsoidInverseRadii = vec3(1.0 / 6378137.0, 1.0 / 6378137.0, 1.0 / 6356752.314245);\n",czm_ellipsoidRadii:"/**\n * The radius of the WGS84 ellipsoid.\n *\n * @name czm_ellipsoidRadii\n * @glslConstant\n */\nconst vec3 czm_ellipsoidRadii = vec3(6378137.0, 6378137.0, 6356752.314245);\n",czm_epsilon1:"/**\n * 0.1\n *\n * @name czm_epsilon1\n * @glslConstant\n */\nconst float czm_epsilon1 = 0.1;\n",czm_epsilon2:"/**\n * 0.01\n *\n * @name czm_epsilon2\n * @glslConstant\n */\nconst float czm_epsilon2 = 0.01;\n",czm_epsilon3:"/**\n * 0.001\n *\n * @name czm_epsilon3\n * @glslConstant\n */\nconst float czm_epsilon3 = 0.001;\n",czm_epsilon4:"/**\n * 0.0001\n *\n * @name czm_epsilon4\n * @glslConstant\n */\nconst float czm_epsilon4 = 0.0001;\n",czm_epsilon5:"/**\n * 0.00001\n *\n * @name czm_epsilon5\n * @glslConstant\n */\nconst float czm_epsilon5 = 0.00001;\n",czm_epsilon6:"/**\n * 0.000001\n *\n * @name czm_epsilon6\n * @glslConstant\n */\nconst float czm_epsilon6 = 0.000001;\n",czm_epsilon7:"/**\n * 0.0000001\n *\n * @name czm_epsilon7\n * @glslConstant\n */\nconst float czm_epsilon7 = 0.0000001;\n",czm_infinity:"/**\n * DOC_TBA\n *\n * @name czm_infinity\n * @glslConstant\n */\nconst float czm_infinity = 5906376272000.0; // Distance from the Sun to Pluto in meters. TODO: What is best given lowp, mediump, and highp?\n",czm_oneOverPi:"/**\n * A built-in GLSL floating-point constant for <code>1/pi</code>.\n *\n * @alias czm_oneOverPi\n * @glslConstant\n *\n * @see CesiumMath.ONE_OVER_PI\n *\n * @example\n * // GLSL declaration\n * const float czm_oneOverPi = ...;\n *\n * // Example\n * float pi = 1.0 / czm_oneOverPi;\n */\nconst float czm_oneOverPi = 0.3183098861837907;\n",czm_oneOverTwoPi:"/**\n * A built-in GLSL floating-point constant for <code>1/2pi</code>.\n *\n * @alias czm_oneOverTwoPi\n * @glslConstant\n *\n * @see CesiumMath.ONE_OVER_TWO_PI\n *\n * @example\n * // GLSL declaration\n * const float czm_oneOverTwoPi = ...;\n *\n * // Example\n * float pi = 2.0 * czm_oneOverTwoPi;\n */\nconst float czm_oneOverTwoPi = 0.15915494309189535;\n",czm_passCesium3DTile:"/**\n * The automatic GLSL constant for {@link Pass#CESIUM_3D_TILE}\n *\n * @name czm_passCesium3DTile\n * @glslConstant\n *\n * @see czm_pass\n */\nconst float czm_passCesium3DTile = 4.0;\n",czm_passCesium3DTileClassification:"/**\n * The automatic GLSL constant for {@link Pass#CESIUM_3D_TILE_CLASSIFICATION}\n *\n * @name czm_passCesium3DTileClassification\n * @glslConstant\n *\n * @see czm_pass\n */\nconst float czm_passCesium3DTileClassification = 5.0;\n",czm_passCesium3DTileClassificationIgnoreShow:"/**\n * The automatic GLSL constant for {@link Pass#CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW}\n *\n * @name czm_passCesium3DTileClassificationIgnoreShow\n * @glslConstant\n *\n * @see czm_pass\n */\nconst float czm_passCesium3DTileClassificationIgnoreShow = 6.0;\n",czm_passClassification:"/**\n * The automatic GLSL constant for {@link Pass#CLASSIFICATION}\n *\n * @name czm_passClassification\n * @glslConstant\n *\n * @see czm_pass\n */\nconst float czm_passClassification = 7.0;\n",czm_passCompute:"/**\n * The automatic GLSL constant for {@link Pass#COMPUTE}\n *\n * @name czm_passCompute\n * @glslConstant\n *\n * @see czm_pass\n */\nconst float czm_passCompute = 1.0;\n",czm_passEnvironment:"/**\n * The automatic GLSL constant for {@link Pass#ENVIRONMENT}\n *\n * @name czm_passEnvironment\n * @glslConstant\n *\n * @see czm_pass\n */\nconst float czm_passEnvironment = 0.0;\n",czm_passGlobe:"/**\n * The automatic GLSL constant for {@link Pass#GLOBE}\n *\n * @name czm_passGlobe\n * @glslConstant\n *\n * @see czm_pass\n */\nconst float czm_passGlobe = 2.0;\n",czm_passGround:"/**\n * The automatic GLSL constant for {@link Pass#GROUND}\n *\n * @name czm_passGround\n * @glslConstant\n *\n * @see czm_pass\n */\nconst float czm_passGround = 4.0;\n",czm_passOpaque:"/**\n * The automatic GLSL constant for {@link Pass#OPAQUE}\n *\n * @name czm_passOpaque\n * @glslConstant\n *\n * @see czm_pass\n */\nconst float czm_passOpaque = 12.0;\n",czm_passOverlay:"/**\n * The automatic GLSL constant for {@link Pass#OVERLAY}\n *\n * @name czm_passOverlay\n * @glslConstant\n *\n * @see czm_pass\n */\nconst float czm_passOverlay = 20.0;",czm_passTerrainClassification:"/**\n * The automatic GLSL constant for {@link Pass#TERRAIN_CLASSIFICATION}\n *\n * @name czm_passTerrainClassification\n * @glslConstant\n *\n * @see czm_pass\n */\nconst float czm_passTerrainClassification = 3.0;\n",czm_passTranslucent:"/**\n * The automatic GLSL constant for {@link Pass#TRANSLUCENT}\n *\n * @name czm_passTranslucent\n * @glslConstant\n *\n * @see czm_pass\n */\nconst float czm_passTranslucent = 18.0;",czm_pi:"/**\n * A built-in GLSL floating-point constant for <code>Math.PI</code>.\n *\n * @alias czm_pi\n * @glslConstant\n *\n * @see CesiumMath.PI\n *\n * @example\n * // GLSL declaration\n * const float czm_pi = ...;\n *\n * // Example\n * float twoPi = 2.0 * czm_pi;\n */\nconst float czm_pi = 3.141592653589793;\n",czm_piOverFour:"/**\n * A built-in GLSL floating-point constant for <code>pi/4</code>.\n *\n * @alias czm_piOverFour\n * @glslConstant\n *\n * @see CesiumMath.PI_OVER_FOUR\n *\n * @example\n * // GLSL declaration\n * const float czm_piOverFour = ...;\n *\n * // Example\n * float pi = 4.0 * czm_piOverFour;\n */\nconst float czm_piOverFour = 0.7853981633974483;\n",czm_piOverSix:"/**\n * A built-in GLSL floating-point constant for <code>pi/6</code>.\n *\n * @alias czm_piOverSix\n * @glslConstant\n *\n * @see CesiumMath.PI_OVER_SIX\n *\n * @example\n * // GLSL declaration\n * const float czm_piOverSix = ...;\n *\n * // Example\n * float pi = 6.0 * czm_piOverSix;\n */\nconst float czm_piOverSix = 0.5235987755982988;\n",czm_piOverThree:"/**\n * A built-in GLSL floating-point constant for <code>pi/3</code>.\n *\n * @alias czm_piOverThree\n * @glslConstant\n *\n * @see CesiumMath.PI_OVER_THREE\n *\n * @example\n * // GLSL declaration\n * const float czm_piOverThree = ...;\n *\n * // Example\n * float pi = 3.0 * czm_piOverThree;\n */\nconst float czm_piOverThree = 1.0471975511965976;\n",czm_piOverTwo:"/**\n * A built-in GLSL floating-point constant for <code>pi/2</code>.\n *\n * @alias czm_piOverTwo\n * @glslConstant\n *\n * @see CesiumMath.PI_OVER_TWO\n *\n * @example\n * // GLSL declaration\n * const float czm_piOverTwo = ...;\n *\n * // Example\n * float pi = 2.0 * czm_piOverTwo;\n */\nconst float czm_piOverTwo = 1.5707963267948966;\n",czm_radiansPerDegree:"/**\n * A built-in GLSL floating-point constant for converting degrees to radians.\n *\n * @alias czm_radiansPerDegree\n * @glslConstant\n *\n * @see CesiumMath.RADIANS_PER_DEGREE\n *\n * @example\n * // GLSL declaration\n * const float czm_radiansPerDegree = ...;\n *\n * // Example\n * float rad = czm_radiansPerDegree * deg;\n */\nconst float czm_radiansPerDegree = 0.017453292519943295;\n",czm_sceneMode2D:"/**\n * The constant identifier for the 2D {@link SceneMode}\n *\n * @name czm_sceneMode2D\n * @glslConstant\n * @see czm_sceneMode\n * @see czm_sceneModeColumbusView\n * @see czm_sceneMode3D\n * @see czm_sceneModeMorphing\n */\nconst float czm_sceneMode2D = 2.0;\n",czm_sceneMode3D:"/**\n * The constant identifier for the 3D {@link SceneMode}\n *\n * @name czm_sceneMode3D\n * @glslConstant\n * @see czm_sceneMode\n * @see czm_sceneMode2D\n * @see czm_sceneModeColumbusView\n * @see czm_sceneModeMorphing\n */\nconst float czm_sceneMode3D = 3.0;\n",czm_sceneModeColumbusView:"/**\n * The constant identifier for the Columbus View {@link SceneMode}\n *\n * @name czm_sceneModeColumbusView\n * @glslConstant\n * @see czm_sceneMode\n * @see czm_sceneMode2D\n * @see czm_sceneMode3D\n * @see czm_sceneModeMorphing\n */\nconst float czm_sceneModeColumbusView = 1.0;\n",czm_sceneModeMorphing:"/**\n * The constant identifier for the Morphing {@link SceneMode}\n *\n * @name czm_sceneModeMorphing\n * @glslConstant\n * @see czm_sceneMode\n * @see czm_sceneMode2D\n * @see czm_sceneModeColumbusView\n * @see czm_sceneMode3D\n */\nconst float czm_sceneModeMorphing = 0.0;\n",czm_solarRadius:"/**\n * A built-in GLSL floating-point constant for one solar radius.\n *\n * @alias czm_solarRadius\n * @glslConstant\n *\n * @see CesiumMath.SOLAR_RADIUS\n *\n * @example\n * // GLSL declaration\n * const float czm_solarRadius = ...;\n */\nconst float czm_solarRadius = 695500000.0;\n",czm_threePiOver2:"/**\n * A built-in GLSL floating-point constant for <code>3pi/2</code>.\n *\n * @alias czm_threePiOver2\n * @glslConstant\n *\n * @see CesiumMath.THREE_PI_OVER_TWO\n *\n * @example\n * // GLSL declaration\n * const float czm_threePiOver2 = ...;\n *\n * // Example\n * float pi = (2.0 / 3.0) * czm_threePiOver2;\n */\nconst float czm_threePiOver2 = 4.71238898038469;\n",czm_twoPi:"/**\n * A built-in GLSL floating-point constant for <code>2pi</code>.\n *\n * @alias czm_twoPi\n * @glslConstant\n *\n * @see CesiumMath.TWO_PI\n *\n * @example\n * // GLSL declaration\n * const float czm_twoPi = ...;\n *\n * // Example\n * float pi = czm_twoPi / 2.0;\n */\nconst float czm_twoPi = 6.283185307179586;\n",czm_webMercatorMaxLatitude:"/**\n * The maximum latitude, in radians, both North and South, supported by a Web Mercator\n * (EPSG:3857) projection. Technically, the Mercator projection is defined\n * for any latitude up to (but not including) 90 degrees, but it makes sense\n * to cut it off sooner because it grows exponentially with increasing latitude.\n * The logic behind this particular cutoff value, which is the one used by\n * Google Maps, Bing Maps, and Esri, is that it makes the projection\n * square. That is, the rectangle is equal in the X and Y directions.\n *\n * The constant value is computed as follows:\n * czm_pi * 0.5 - (2.0 * atan(exp(-czm_pi)))\n *\n * @name czm_webMercatorMaxLatitude\n * @glslConstant\n */\nconst float czm_webMercatorMaxLatitude = 1.4844222297453324;\n",czm_depthRangeStruct:"/**\n * @name czm_depthRangeStruct\n * @glslStruct\n */\nstruct czm_depthRangeStruct\n{\n float near;\n float far;\n};\n",czm_ellipsoid:"/** DOC_TBA\n *\n * @name czm_ellipsoid\n * @glslStruct\n */\nstruct czm_ellipsoid\n{\n vec3 center;\n vec3 radii;\n vec3 inverseRadii;\n vec3 inverseRadiiSquared;\n};\n",czm_material:"/**\n * Holds material information that can be used for lighting. Returned by all czm_getMaterial functions.\n *\n * @name czm_material\n * @glslStruct\n *\n * @property {vec3} diffuse Incoming light that scatters evenly in all directions.\n * @property {float} specular Intensity of incoming light reflecting in a single direction.\n * @property {float} shininess The sharpness of the specular reflection. Higher values create a smaller, more focused specular highlight.\n * @property {vec3} normal Surface's normal in eye coordinates. It is used for effects such as normal mapping. The default is the surface's unmodified normal.\n * @property {vec3} emission Light emitted by the material equally in all directions. The default is vec3(0.0), which emits no light.\n * @property {float} alpha Opacity of this material. 0.0 is completely transparent; 1.0 is completely opaque.\n */\nstruct czm_material\n{\n vec3 diffuse;\n float specular;\n float shininess;\n vec3 normal;\n vec3 emission;\n float alpha;\n};\n",czm_materialInput:"/**\n * Used as input to every material's czm_getMaterial function.\n *\n * @name czm_materialInput\n * @glslStruct\n *\n * @property {float} s 1D texture coordinates.\n * @property {vec2} st 2D texture coordinates.\n * @property {vec3} str 3D texture coordinates.\n * @property {vec3} normalEC Unperturbed surface normal in eye coordinates.\n * @property {mat3} tangentToEyeMatrix Matrix for converting a tangent space normal to eye space.\n * @property {vec3} positionToEyeEC Vector from the fragment to the eye in eye coordinates. The magnitude is the distance in meters from the fragment to the eye.\n * @property {float} height The height of the terrain in meters above or below the WGS84 ellipsoid. Only available for globe materials.\n * @property {float} slope The slope of the terrain normalized from 0 to 1. 0 is completely vertical, 1 is completely flat. Only available for globe materials.\n */\nstruct czm_materialInput\n{\n float s;\n vec2 st;\n vec3 str;\n vec3 normalEC;\n mat3 tangentToEyeMatrix;\n vec3 positionToEyeEC;\n float height;\n float slope;\n};\n",czm_s3mMaterialInput:"struct czm_s3mMaterialInput\n{\n vec4 ambientColor;\n vec4 diffuseColor;\n vec4 ambientLightColor;\n vec4 sunLightColor;\n mat4 texMatrix;\n float texture0Width;\n float texture1Width;\n vec3 sunDirectionEC;\n float sunLightON;\n};\n",czm_ray:"/**\n * DOC_TBA\n *\n * @name czm_ray\n * @glslStruct\n */\nstruct czm_ray\n{\n vec3 origin;\n vec3 direction;\n};\n",czm_raySegment:"/**\n * DOC_TBA\n *\n * @name czm_raySegment\n * @glslStruct\n */\nstruct czm_raySegment\n{\n float start;\n float stop;\n};\n\n/**\n * DOC_TBA\n *\n * @name czm_emptyRaySegment\n * @glslConstant \n */\nconst czm_raySegment czm_emptyRaySegment = czm_raySegment(-czm_infinity, -czm_infinity);\n\n/**\n * DOC_TBA\n *\n * @name czm_fullRaySegment\n * @glslConstant \n */\nconst czm_raySegment czm_fullRaySegment = czm_raySegment(0.0, czm_infinity);\n",czm_shadowParameters:"struct czm_shadowParameters\n{\n#ifdef USE_CUBE_MAP_SHADOW\n vec3 texCoords;\n#else\n vec2 texCoords;\n#endif\n\n float depthBias;\n float depth;\n float nDotL;\n vec2 texelStepSize;\n float normalShadingSmooth;\n float darkness;\n};\n",czm_acesTonemapping:"// See:\n\nvec3 czm_acesTonemapping(vec3 color) {\n float g = 0.985;\n float a = 0.065;\n float b = 0.0001;\n float c = 0.433;\n float d = 0.238;\n\n color = (color * (color + a) - b) / (color * (g * color + c) + d);\n\n color = clamp(color, 0.0, 1.0);\n\n return color;\n}\n",czm_adjustColor:"uniform float uBrightness;\nuniform float uContrast;\nuniform float uHue;\nuniform float uSaturation;\nuniform float uOneOverGamma;\nvec3 czm_adjustColor(vec3 inputColor)\n{\n vec3 outputColor = inputColor;\n outputColor.rgb = mix(vec3(0.0), outputColor.rgb, uBrightness);\n outputColor.rgb = mix(vec3(0.5), outputColor.rgb, uContrast);\n outputColor.rgb = czm_hue(outputColor.rgb, uHue);\n outputColor.rgb = clamp(outputColor.rgb, 0.0, 1.0);\n outputColor.rgb = czm_saturation(outputColor.rgb, uSaturation);\n outputColor.rgb = pow(outputColor.rgb, vec3(uOneOverGamma));\n return outputColor;\n}",czm_alphaWeight:"/**\n * @private\n */\nfloat czm_alphaWeight(float a)\n{\n float z = (gl_FragCoord.z - czm_viewportTransformation[3][2]) / czm_viewportTransformation[2][2];\n\n // See Weighted Blended Order-Independent Transparency for examples of different weighting functions:\n return pow(a + 0.01, 4.0) + max(1e-2, min(3.0 * 1e3, 0.003 / (1e-5 + pow(abs(z) / 200.0, 4.0))));\n}\n",czm_antialias:"/**\n * Procedural anti-aliasing by blurring two colors that meet at a sharp edge.\n *\n * @name czm_antialias\n * @glslFunction\n *\n * @param {vec4} color1 The color on one side of the edge.\n * @param {vec4} color2 The color on the other side of the edge.\n * @param {vec4} currentcolor The current color, either <code>color1</code> or <code>color2</code>.\n * @param {float} dist The distance to the edge in texture coordinates.\n * @param {float} [fuzzFactor=0.1] Controls the blurriness between the two colors.\n * @returns {vec4} The anti-aliased color.\n *\n * @example\n * // GLSL declarations\n * vec4 czm_antialias(vec4 color1, vec4 color2, vec4 currentColor, float dist, float fuzzFactor);\n * vec4 czm_antialias(vec4 color1, vec4 color2, vec4 currentColor, float dist);\n *\n * // get the color for a material that has a sharp edge at the line y = 0.5 in texture space\n * float dist = abs(textureCoordinates.t - 0.5);\n * vec4 currentColor = mix(bottomColor, topColor, step(0.5, textureCoordinates.t));\n * vec4 color = czm_antialias(bottomColor, topColor, currentColor, dist, 0.1);\n */\nvec4 czm_antialias(vec4 color1, vec4 color2, vec4 currentColor, float dist, float fuzzFactor)\n{\n float val1 = clamp(dist / fuzzFactor, 0.0, 1.0);\n float val2 = clamp((dist - 0.5) / fuzzFactor, 0.0, 1.0);\n val1 = val1 * (1.0 - val2);\n val1 = val1 * val1 * (3.0 - (2.0 * val1));\n val1 = pow(val1, 0.5); //makes the transition nicer\n \n vec4 midColor = (color1 + color2) * 0.5;\n return mix(midColor, currentColor, val1);\n}\n\nvec4 czm_antialias(vec4 color1, vec4 color2, vec4 currentColor, float dist)\n{\n return czm_antialias(color1, color2, currentColor, dist, 0.1);\n}\n",czm_approximateSphericalCoordinates:"/**\n * Approximately computes spherical coordinates given a normal.\n * Uses approximate inverse trigonometry for speed and consistency,\n * since inverse trigonometry can differ from vendor-to-vendor and when compared with the CPU.\n *\n * @name czm_approximateSphericalCoordinates\n * @glslFunction\n *\n * @param {vec3} normal arbitrary-length normal.\n *\n * @returns {vec2} Approximate latitude and longitude spherical coordinates.\n */\nvec2 czm_approximateSphericalCoordinates(vec3 normal) {\n // Project into plane with vertical for latitude\n float latitudeApproximation = czm_fastApproximateAtan(sqrt(normal.x * normal.x + normal.y * normal.y), normal.z);\n float longitudeApproximation = czm_fastApproximateAtan(normal.x, normal.y);\n return vec2(latitudeApproximation, longitudeApproximation);\n}\n",czm_branchFreeTernary:"/**\n * Branchless ternary operator to be used when it's inexpensive to explicitly\n * evaluate both possibilities for a float expression.\n *\n * @name czm_branchFreeTernary\n * @glslFunction\n *\n * @param {bool} comparison A comparison statement\n * @param {float} a Value to return if the comparison is true.\n * @param {float} b Value to return if the comparison is false.\n *\n * @returns {float} equivalent of comparison ? a : b\n */\nfloat czm_branchFreeTernary(bool comparison, float a, float b) {\n float useA = float(comparison);\n return a * useA + b * (1.0 - useA);\n}\n\n/**\n * Branchless ternary operator to be used when it's inexpensive to explicitly\n * evaluate both possibilities for a vec2 expression.\n *\n * @name czm_branchFreeTernary\n * @glslFunction\n *\n * @param {bool} comparison A comparison statement\n * @param {vec2} a Value to return if the comparison is true.\n * @param {vec2} b Value to return if the comparison is false.\n *\n * @returns {vec2} equivalent of comparison ? a : b\n */\nvec2 czm_branchFreeTernary(bool comparison, vec2 a, vec2 b) {\n float useA = float(comparison);\n return a * useA + b * (1.0 - useA);\n}\n\n/**\n * Branchless ternary operator to be used when it's inexpensive to explicitly\n * evaluate both possibilities for a vec3 expression.\n *\n * @name czm_branchFreeTernary\n * @glslFunction\n *\n * @param {bool} comparison A comparison statement\n * @param {vec3} a Value to return if the comparison is true.\n * @param {vec3} b Value to return if the comparison is false.\n *\n * @returns {vec3} equivalent of comparison ? a : b\n */\nvec3 czm_branchFreeTernary(bool comparison, vec3 a, vec3 b) {\n float useA = float(comparison);\n return a * useA + b * (1.0 - useA);\n}\n\n/**\n * Branchless ternary operator to be used when it's inexpensive to explicitly\n * evaluate both possibilities for a vec4 expression.\n *\n * @name czm_branchFreeTernary\n * @glslFunction\n *\n * @param {bool} comparison A comparison statement\n * @param {vec3} a Value to return if the comparison is true.\n * @param {vec3} b Value to return if the comparison is false.\n *\n * @returns {vec3} equivalent of comparison ? a : b\n */\nvec4 czm_branchFreeTernary(bool comparison, vec4 a, vec4 b) {\n float useA = float(comparison);\n return a * useA + b * (1.0 - useA);\n}\n",czm_cascadeColor:"\nvec4 czm_cascadeColor(vec4 weights)\n{\n return vec4(1.0, 0.0, 0.0, 1.0) * weights.x +\n vec4(0.0, 1.0, 0.0, 1.0) * weights.y +\n vec4(0.0, 0.0, 1.0, 1.0) * weights.z +\n vec4(1.0, 0.0, 1.0, 1.0) * weights.w;\n}\n",czm_cascadeDistance:"\nuniform vec4 shadowMap_cascadeDistances;\n\nfloat czm_cascadeDistance(vec4 weights)\n{\n return dot(shadowMap_cascadeDistances, weights);\n}\n",czm_cascadeMatrix:"\nuniform mat4 shadowMap_cascadeMatrices[4];\n\nmat4 czm_cascadeMatrix(vec4 weights)\n{\n return shadowMap_cascadeMatrices[0] * weights.x +\n shadowMap_cascadeMatrices[1] * weights.y +\n shadowMap_cascadeMatrices[2] * weights.z +\n shadowMap_cascadeMatrices[3] * weights.w;\n}\n",czm_cascadeWeights:"\nuniform vec4 shadowMap_cascadeSplits[2];\n\nvec4 czm_cascadeWeights(float depthEye)\n{\n // One component is set to 1.0 and all others set to 0.0.\n vec4 near = step(shadowMap_cascadeSplits[0], vec4(depthEye));\n vec4 far = step(depthEye, shadowMap_cascadeSplits[1]);\n return near * far;\n}\n",czm_clip:"#ifdef GL_OES_standard_derivatives\n#extension GL_OES_standard_derivatives : enable\n#endif\nuniform float clip_mode;\nuniform vec4 clip_planes[6];\nuniform vec4 clip_line_color;\nconst float clip_lineWidth = 3.0;\n\nfloat GetClipDistance(vec3 pos, vec3 planeNormal, float disToOrigin)\n{\n\treturn dot(planeNormal, pos) + disToOrigin;\n}\n\nfloat ClipBehindAllPlane(float fBorderWidth, vec4 clip_vertex)\n{\nfloat distance = 0.0;\nfloat result = -1.0;\n#ifdef CLIPPLANE\ndistance = GetClipDistance(clip_vertex.xyz, clip_planes[0].xyz, clip_planes[0].w);\nif (distance < 0.0)\n{\nreturn 1.0;\n}\nelse if (distance < fBorderWidth)\n{\nresult = 0.0;\n}\n#else\nfor(int i = 0; i < 6; i++)\n{\ndistance = GetClipDistance(clip_vertex.xyz, clip_planes[i].xyz, clip_planes[i].w);\nif(distance < 0.0)\n{\nreturn 1.0;\n}\nelse if(distance < fBorderWidth)\n{\nresult = 0.0;\n}\n}\n#endif\nreturn result;\n}\n\nfloat ClipBehindAnyPlane(float fBorderWidth, vec4 clip_vertex)\n{\n\tfloat result = 1.0;\n\tfor(int i = 0; i < 6; i++)\n\t{\n\t\tfloat distance = GetClipDistance(clip_vertex.xyz, clip_planes[i].xyz, clip_planes[i].w);\n\t\tif((distance + fBorderWidth) < 0.0)\n\t\t{\n\t\t\treturn -1.0;\n\t\t}\n\t\telse if(distance < 0.0)\n\t\t{\n\t\t\tresult = 0.0;\n\t\t}\n\t}\n\treturn result;\n}\n\nfloat ClipAnythingButLine(float fBorderWidth, vec4 clip_vertex)\n{\n\tfloat result = -1.0;\n\tfor(int i = 0; i < 6; i++)\n\t{\n\t\tfloat distance = GetClipDistance(clip_vertex.xyz, clip_planes[i].xyz, clip_planes[i].w);\n\t\tif(distance < 0.0)\n\t\t{\n\t\t\treturn -1.0;\n\t\t}\n\t\telse if(distance < fBorderWidth)\n\t\t{\n\t\t\tresult = 0.0;\n\t\t}\n\t}\n\treturn result;\n}\n\nvec4 czm_clip(vec4 clip_vertex, float fIsFiltByID)\n{\n if(fIsFiltByID < 0.1)\n {\n return vec4(1.0);\n }\n\tif(clip_mode < 0.5)\n\t{\n\t\treturn vec4(1.0);\n\t}\n#ifdef GL_OES_standard_derivatives\n\tfloat dxc = abs(dFdx(clip_vertex.x));\n\tfloat dyc = abs(dFdy(clip_vertex.y));\n\tfloat fBorderWidth = max(dxc, dyc) * clip_lineWidth;\n#else\n\tfloat fBorderWidth = clip_lineWidth;\n#endif\n\tfloat clipResult = 1.0;\n\tif(clip_line_color.a < 0.01)\n\t{\n\t\tfBorderWidth = 0.0;\n\t}\n\tif(clip_mode < 1.5)\n\t{\n\t\tclipResult = ClipBehindAnyPlane(fBorderWidth, clip_vertex);\n\t}\n\telse if(clip_mode < 2.5)\n\t{\n\t\tclipResult = ClipBehindAllPlane(fBorderWidth, clip_vertex);\n\t}\n\telse if(clip_mode < 3.5)\n\t{\n\t\tclipResult = ClipAnythingButLine(fBorderWidth, clip_vertex);\n\t}\n\tif(clipResult < -0.5)\n\t{\n\t\tdiscard;\n\t}\n\telse if(clipResult < 0.5)\n\t{\n\t\treturn clip_line_color;\n\t}\n\telse\n\t{\n return vec4(1.0);\n\t}\n}",czm_columbusViewMorph:"/**\n * DOC_TBA\n *\n * @name czm_columbusViewMorph\n * @glslFunction\n */\nvec4 czm_columbusViewMorph(vec4 position2D, vec4 position3D, float time)\n{\n // Just linear for now.\n vec3 p = mix(position2D.xyz, position3D.xyz, time);\n return vec4(p, 1.0);\n}\n",czm_computeLightColorInFP:"vec4 czm_computeLightColorInFP(czm_s3mMaterialInput material, vec3 positionMC, float hasNormal, vec3 normal)\n{\n vec3 normalEC;\n if(hasNormal > 0.9)\n {\n normalEC = normalize(normal);\n }\n else\n {\n normalEC = normalize(czm_normal*czm_computeNormal(positionMC));\n }\n vec3 positionEC = vec3(czm_modelView * vec4(positionMC,1.0)).xyz;\n return czm_directionLight(material, normalEC, -positionEC, positionMC);\n}",czm_computeLightColorInstanceInFP:"vec4 czm_computeLightColorInstanceInFP(czm_s3mMaterialInput material, vec3 positionRotateMC, vec3 positionMC, float hasNormal, vec3 normal)\n{\n vec3 normalEC;\n if(hasNormal > 0.9)\n {\n normalEC = normalize(normal);\n }\n else\n {\n normalEC = normalize(czm_normal*czm_computeNormal(positionRotateMC));\n }\n vec3 positionEC = vec3(czm_modelView * vec4(positionMC,1.0)).xyz;\n return czm_directionLight(material, normalEC, -positionEC, positionMC);\n}",czm_computeNormal:"#ifdef GL_OES_standard_derivatives\n#extension GL_OES_standard_derivatives : enable\n#endif\nvec3 czm_computeNormal(in vec3 oriVertex)\n{\n\tvec3 normal = cross(vec3(dFdx(oriVertex.x), dFdx(oriVertex.y), dFdx(oriVertex.z)), vec3(dFdy(oriVertex.x), dFdy(oriVertex.y), dFdy(oriVertex.z)));\n\tnormal = normalize(normal);\n\treturn normal;\n}",czm_computePosition:"/**\n * Returns a position in model coordinates relative to eye taking into\n * account the current scene mode: 3D, 2D, or Columbus view.\n * <p>\n * This uses standard position attributes, <code>position3DHigh</code>, \n * <code>position3DLow</code>, <code>position2DHigh</code>, and <code>position2DLow</code>, \n * and should be used when writing a vertex shader for an {@link Appearance}.\n * </p>\n *\n * @name czm_computePosition\n * @glslFunction\n *\n * @returns {vec4} The position relative to eye.\n *\n * @example\n * vec4 p = czm_computePosition();\n * v_positionEC = (czm_modelViewRelativeToEye * p).xyz;\n * gl_Position = czm_modelViewProjectionRelativeToEye * p;\n *\n * @see czm_translateRelativeToEye\n */\nvec4 czm_computePosition();\n",czm_cosineAndSine:"/**\n * @private\n */\nvec2 cordic(float angle)\n{\n// Scale the vector by the appropriate factor for the 24 iterations to follow.\n vec2 vector = vec2(6.0725293500888267e-1, 0.0);\n// Iteration 1\n float sense = (angle < 0.0) ? -1.0 : 1.0;\n // float factor = sense * 1.0; // 2^-0\n mat2 rotation = mat2(1.0, sense, -sense, 1.0);\n vector = rotation * vector;\n angle -= sense * 7.8539816339744828e-1; // atan(2^-0)\n// Iteration 2\n sense = (angle < 0.0) ? -1.0 : 1.0;\n float factor = sense * 5.0e-1; // 2^-1\n rotation[0][1] = factor;\n rotation[1][0] = -factor;\n vector = rotation * vector;\n angle -= sense * 4.6364760900080609e-1; // atan(2^-1)\n// Iteration 3\n sense = (angle < 0.0) ? -1.0 : 1.0;\n factor = sense * 2.5e-1; // 2^-2\n rotation[0][1] = factor;\n rotation[1][0] = -factor;\n vector = rotation * vector;\n angle -= sense * 2.4497866312686414e-1; // atan(2^-2)\n// Iteration 4\n sense = (angle < 0.0) ? -1.0 : 1.0;\n factor = sense * 1.25e-1; // 2^-3\n rotation[0][1] = factor;\n rotation[1][0] = -factor;\n vector = rotation * vector;\n angle -= sense * 1.2435499454676144e-1; // atan(2^-3)\n// Iteration 5\n sense = (angle < 0.0) ? -1.0 : 1.0;\n factor = sense * 6.25e-2; // 2^-4\n rotation[0][1] = factor;\n rotation[1][0] = -factor;\n vector = rotation * vector;\n angle -= sense * 6.2418809995957350e-2; // atan(2^-4)\n// Iteration 6\n sense = (angle < 0.0) ? -1.0 : 1.0;\n factor = sense * 3.125e-2; // 2^-5\n rotation[0][1] = factor;\n rotation[1][0] = -factor;\n vector = rotation * vector;\n angle -= sense * 3.1239833430268277e-2; // atan(2^-5)\n// Iteration 7\n sense = (angle < 0.0) ? -1.0 : 1.0;\n factor = sense * 1.5625e-2; // 2^-6\n rotation[0][1] = factor;\n rotation[1][0] = -factor;\n vector = rotation * vector;\n angle -= sense * 1.5623728620476831e-2; // atan(2^-6)\n// Iteration 8\n sense = (angle < 0.0) ? -1.0 : 1.0;\n factor = sense * 7.8125e-3; // 2^-7\n rotation[0][1] = factor;\n rotation[1][0] = -factor;\n vector = rotation * vector;\n angle -= sense * 7.8123410601011111e-3; // atan(2^-7)\n// Iteration 9\n sense = (angle < 0.0) ? -1.0 : 1.0;\n factor = sense * 3.90625e-3; // 2^-8\n rotation[0][1] = factor;\n rotation[1][0] = -factor;\n vector = rotation * vector;\n angle -= sense * 3.9062301319669718e-3; // atan(2^-8)\n// Iteration 10\n sense = (angle < 0.0) ? -1.0 : 1.0;\n factor = sense * 1.953125e-3; // 2^-9\n rotation[0][1] = factor;\n rotation[1][0] = -factor;\n vector = rotation * vector;\n angle -= sense * 1.9531225164788188e-3; // atan(2^-9)\n// Iteration 11\n sense = (angle < 0.0) ? -1.0 : 1.0;\n factor = sense * 9.765625e-4; // 2^-10\n rotation[0][1] = factor;\n rotation[1][0] = -factor;\n vector = rotation * vector;\n angle -= sense * 9.7656218955931946e-4; // atan(2^-10)\n// Iteration 12\n sense = (angle < 0.0) ? -1.0 : 1.0;\n factor = sense * 4.8828125e-4; // 2^-11\n rotation[0][1] = factor;\n rotation[1][0] = -factor;\n vector = rotation * vector;\n angle -= sense * 4.8828121119489829e-4; // atan(2^-11)\n// Iteration 13\n sense = (angle < 0.0) ? -1.0 : 1.0;\n factor = sense * 2.44140625e-4; // 2^-12\n rotation[0][1] = factor;\n rotation[1][0] = -factor;\n vector = rotation * vector;\n angle -= sense * 2.4414062014936177e-4; // atan(2^-12)\n// Iteration 14\n sense = (angle < 0.0) ? -1.0 : 1.0;\n factor = sense * 1.220703125e-4; // 2^-13\n rotation[0][1] = factor;\n rotation[1][0] = -factor;\n vector = rotation * vector;\n angle -= sense * 1.2207031189367021e-4; // atan(2^-13)\n// Iteration 15\n sense = (angle < 0.0) ? -1.0 : 1.0;\n factor = sense * 6.103515625e-5; // 2^-14\n rotation[0][1] = factor;\n rotation[1][0] = -factor;\n vector = rotation * vector;\n angle -= sense * 6.1035156174208773e-5; // atan(2^-14)\n// Iteration 16\n sense = (angle < 0.0) ? -1.0 : 1.0;\n factor = sense * 3.0517578125e-5; // 2^-15\n rotation[0][1] = factor;\n rotation[1][0] = -factor;\n vector = rotation * vector;\n angle -= sense * 3.0517578115526096e-5; // atan(2^-15)\n// Iteration 17\n sense = (angle < 0.0) ? -1.0 : 1.0;\n factor = sense * 1.52587890625e-5; // 2^-16\n rotation[0][1] = factor;\n rotation[1][0] = -factor;\n vector = rotation * vector;\n angle -= sense * 1.5258789061315762e-5; // atan(2^-16)\n// Iteration 18\n sense = (angle < 0.0) ? -1.0 : 1.0;\n factor = sense * 7.62939453125e-6; // 2^-17\n rotation[0][1] = factor;\n rotation[1][0] = -factor;\n vector = rotation * vector;\n angle -= sense * 7.6293945311019700e-6; // atan(2^-17)\n// Iteration 19\n sense = (angle < 0.0) ? -1.0 : 1.0;\n factor = sense * 3.814697265625e-6; // 2^-18\n rotation[0][1] = factor;\n rotation[1][0] = -factor;\n vector = rotation * vector;\n angle -= sense * 3.8146972656064961e-6; // atan(2^-18)\n// Iteration 20\n sense = (angle < 0.0) ? -1.0 : 1.0;\n factor = sense * 1.9073486328125e-6; // 2^-19\n rotation[0][1] = factor;\n rotation[1][0] = -factor;\n vector = rotation * vector;\n angle -= sense * 1.9073486328101870e-6; // atan(2^-19)\n// Iteration 21\n sense = (angle < 0.0) ? -1.0 : 1.0;\n factor = sense * 9.5367431640625e-7; // 2^-20\n rotation[0][1] = factor;\n rotation[1][0] = -factor;\n vector = rotation * vector;\n angle -= sense * 9.5367431640596084e-7; // atan(2^-20)\n// Iteration 22\n sense = (angle < 0.0) ? -1.0 : 1.0;\n factor = sense * 4.76837158203125e-7; // 2^-21\n rotation[0][1] = factor;\n rotation[1][0] = -factor;\n vector = rotation * vector;\n angle -= sense * 4.7683715820308884e-7; // atan(2^-21)\n// Iteration 23\n sense = (angle < 0.0) ? -1.0 : 1.0;\n factor = sense * 2.384185791015625e-7; // 2^-22\n rotation[0][1] = factor;\n rotation[1][0] = -factor;\n vector = rotation * vector;\n angle -= sense * 2.3841857910155797e-7; // atan(2^-22)\n// Iteration 24\n sense = (angle < 0.0) ? -1.0 : 1.0;\n factor = sense * 1.1920928955078125e-7; // 2^-23\n rotation[0][1] = factor;\n rotation[1][0] = -factor;\n vector = rotation * vector;\n// angle -= sense * 1.1920928955078068e-7; // atan(2^-23)\n\n return vector;\n}\n\n/**\n * Computes the cosine and sine of the provided angle using the CORDIC algorithm.\n *\n * @name czm_cosineAndSine\n * @glslFunction\n *\n * @param {float} angle The angle in radians.\n *\n * @returns {vec2} The resulting cosine of the angle (as the x coordinate) and sine of the angle (as the y coordinate).\n *\n * @example\n * vec2 v = czm_cosineAndSine(czm_piOverSix);\n * float cosine = v.x;\n * float sine = v.y;\n */\nvec2 czm_cosineAndSine(float angle)\n{\n if (angle < -czm_piOverTwo || angle > czm_piOverTwo)\n {\n if (angle < 0.0)\n {\n return -cordic(angle + czm_pi);\n }\n else\n {\n return -cordic(angle - czm_pi);\n }\n }\n else\n {\n return cordic(angle);\n }\n}\n",czm_decompressTextureCoordinates:"/**\n * Decompresses texture coordinates that were packed into a single float.\n *\n * @name czm_decompressTextureCoordinates\n * @glslFunction\n *\n * @param {float} encoded The compressed texture coordinates.\n * @returns {vec2} The decompressed texture coordinates.\n */\n vec2 czm_decompressTextureCoordinates(float encoded)\n {\n float temp = encoded / 4096.0;\n float xZeroTo4095 = floor(temp);\n float stx = xZeroTo4095 / 4095.0;\n float sty = (encoded - xZeroTo4095 * 4096.0) / 4095.0;\n return vec2(stx, sty);\n }\n",czm_depthClampFarPlane:"// emulated noperspective\n#ifndef LOG_DEPTH\nvarying float v_WindowZ;\n#endif\n\n/**\n * Clamps a vertex to the far plane.\n *\n * @name czm_depthClampFarPlane\n * @glslFunction\n *\n * @param {vec4} coords The vertex in clip coordinates.\n * @returns {vec4} The vertex clipped to the far plane.\n *\n * @example\n * gl_Position = czm_depthClampFarPlane(czm_modelViewProjection * vec4(position, 1.0));\n *\n * @see czm_writeDepthClampedToFarPlane\n */\nvec4 czm_depthClampFarPlane(vec4 coords)\n{\n#ifndef LOG_DEPTH\n v_WindowZ = (0.5 * (coords.z / coords.w) + 0.5) * coords.w;\n coords.z = min(coords.z, coords.w);\n#endif\n return coords;\n}\n",czm_directionLight:"const vec3 SideLightColor = vec3(0.0);\nuniform vec4 uSpecularColor;\nuniform float uShininess;\nconst vec3 specular = vec3(0.066666);\nconst float shininess2 = 30.0;\nfloat saturate( in float a ) { return clamp( a, 0.0, 1.0 ); }\nfloat calcLightAttenuation( float lightDistance, float cutoffDistance, float decayExponent ) {\n if ( decayExponent > 0.0 ) {\n return pow( saturate( 1.0 - lightDistance / cutoffDistance ), decayExponent );\n }\n return 1.0;\n}\n#if POINT_LIGHTS > 0\n uniform vec3 uPointLightPositionEC[POINT_LIGHTS];\n uniform vec3 uPointLightColor[POINT_LIGHTS];\n uniform vec2 uPointLightDistanceAndDecay[POINT_LIGHTS];\n#endif\n#if SPOT_LIGHTS > 0\n uniform vec3 uSpotLightPosition[ SPOT_LIGHTS ];\n uniform vec3 uSpotLightColor[ SPOT_LIGHTS ];\n uniform vec3 uSpotLightPositionEC[ SPOT_LIGHTS ];\n uniform vec3 uSpotLightDirection[ SPOT_LIGHTS ];\n uniform float uSpotLightExponent[ SPOT_LIGHTS ];\n uniform vec4 uSpotLightDistanceDecayCosPenumbra[ SPOT_LIGHTS ];\n#endif\n#if DIR_LIGHTS > 0\n uniform vec3 uDirectionalLightDirection[ DIR_LIGHTS ];\n uniform vec3 uDirectionalLightColor[ DIR_LIGHTS];\n#endif\n#if HEMISPHERE_LIGHTS > 0\n uniform vec3 uSkyColor[ HEMISPHERE_LIGHTS ];\n uniform vec3 uGroundColor[ HEMISPHERE_LIGHTS];\n#endif\n vec4 czm_directionLight(czm_s3mMaterialInput material, vec3 normalEC, vec3 positionToEyeEC, vec3 positionMC)\n {\n vec3 totalDiffuseLight = vec3(0.0);\n vec3 totalSpecularLight = vec3(0.0);\n float sunLightDiffuseWeight = max( dot( normalEC, material.sunDirectionEC ), 0.0 );\n float sideLightDiffuseWeight = max( dot( normalEC, vec3(0.0,0.0,1.0) ), 0.0 );\n totalDiffuseLight = material.sunLightColor.rgb * sunLightDiffuseWeight * material.sunLightON + sideLightDiffuseWeight * SideLightColor;\n vec3 positionToEyeECDir = normalize(positionToEyeEC);\n\t#if HEMISPHERE_LIGHTS > 0\n for ( int i = 0; i < HEMISPHERE_LIGHTS; i ++ )\n {\n vec3 dirVectorEC = normalize(czm_normal * vec3(0.0, 0.0, 1.0));\n float dotProduct = dot( normalEC, dirVectorEC );\n\t\t\tvec3 skyColor = uSkyColor[i];\n vec3 groundColor = uGroundColor[i];\n\t\t\tfloat hemiDiffuseWeight = 0.5 * dotProduct + 0.5;\n\t\t\tvec3 irradiance = mix( groundColor, skyColor, hemiDiffuseWeight );\n\t\t\tirradiance *= 3.141592653589793;\n totalDiffuseLight += irradiance;\n }\n #endif\n #if DIR_LIGHTS > 0\n for ( int i = 0; i < DIR_LIGHTS; i ++ )\n {\n vec3 dirVectorEC = normalize((czm_view * vec4(uDirectionalLightDirection[ i ], 0.0)).xyz);\n float dotProduct = dot( normalEC, dirVectorEC );\n float dirDiffuseWeight = max( dotProduct, 0.0 );\n totalDiffuseLight += uDirectionalLightColor[ i ] * dirDiffuseWeight;\n }\n #endif\n #if POINT_LIGHTS > 0\n for ( int i = 0; i < POINT_LIGHTS; i ++ )\n {\n vec3 lVector = uPointLightPositionEC[i] + positionToEyeEC;\n float lengthToLight = length( lVector );\n float cutoffDis = uPointLightDistanceAndDecay[i].x;\n if(lengthToLight > cutoffDis)\n {\n continue;\n }\n float attenuation = calcLightAttenuation( lengthToLight, cutoffDis, uPointLightDistanceAndDecay[i].y);\n lVector = normalize( lVector );\n float dotProduct = dot( normalEC, lVector );\n float pointLightDiffuse = max( dotProduct, 0.0 );\n totalDiffuseLight += uPointLightColor[i] * pointLightDiffuse * attenuation;\n vec3 pointHalfVector = normalize( lVector + positionToEyeECDir );\n float pointDotNormalHalf = max( dot( normalEC, pointHalfVector ), 0.0 );\n float pointSpecularWeight = max( pow( pointDotNormalHalf, shininess2 ), 0.0 );\n float specularNormalization = ( shininess2 + 2.0 ) / 8.0;\n vec3 schlick = specular + vec3( 1.0 - specular ) * pow( max( 1.0 - dot( lVector, pointHalfVector ), 0.0 ), 5.0 );\n totalSpecularLight += schlick * uPointLightColor[ i ] * pointSpecularWeight * pointLightDiffuse * attenuation * specularNormalization;\n }\n #endif\n #if SPOT_LIGHTS > 0\n vec3 positionWC = (czm_model * vec4(positionMC, 1.0)).xyz;\n for ( int i = 0; i < SPOT_LIGHTS; i ++ )\n {\n vec3 lVector = uSpotLightPositionEC[i] + positionToEyeEC;\n float attenuation = calcLightAttenuation( length( lVector ), uSpotLightDistanceDecayCosPenumbra[i].x, uSpotLightDistanceDecayCosPenumbra[i].y);\n lVector = normalize( lVector );\n float spotEffect = dot( uSpotLightDirection[ i ], normalize( uSpotLightPosition[ i ] - positionWC ) );\n if ( spotEffect > uSpotLightDistanceDecayCosPenumbra[i].z ) {\n spotEffect = max( pow( max( spotEffect, 0.0 ), uSpotLightExponent[ i ] ), 0.0 );\n float dotProduct = dot( normalEC, lVector );\n float spotDiffuseWeight = max( dotProduct, 0.0 );\n totalDiffuseLight += uSpotLightColor[ i ] * spotDiffuseWeight * attenuation * spotEffect;\n vec3 spotHalfVector = normalize( lVector + positionToEyeECDir );\n float spotDotNormalHalf = max( dot( normalEC, spotHalfVector ), 0.0 );\n float spotSpecularWeight = max( pow( spotDotNormalHalf, shininess2 ), 0.0 );\n float specularNormalization = ( shininess2 + 2.0 ) / 8.0;\n vec3 schlick = specular + vec3( 1.0 - specular ) * pow( max( 1.0 - dot( lVector, spotHalfVector ), 0.0 ), 5.0 );\n totalSpecularLight += schlick * uSpotLightColor[ i ] * spotSpecularWeight * spotDiffuseWeight * attenuation * specularNormalization * spotEffect;\n }\n }\n #endif\n vec4 color = vec4(material.diffuseColor.rgb * totalDiffuseLight + material.ambientLightColor.rgb * 0.6 + totalSpecularLight, material.diffuseColor.a);\n return color;\n }\n\n",czm_eastNorthUpToEyeCoordinates:"/**\n * Computes a 3x3 rotation matrix that transforms vectors from an ellipsoid's east-north-up coordinate system \n * to eye coordinates. In east-north-up coordinates, x points east, y points north, and z points along the \n * surface normal. East-north-up can be used as an ellipsoid's tangent space for operations such as bump mapping.\n * <br /><br />\n * The ellipsoid is assumed to be centered at the model coordinate's origin.\n *\n * @name czm_eastNorthUpToEyeCoordinates\n * @glslFunction\n *\n * @param {vec3} positionMC The position on the ellipsoid in model coordinates.\n * @param {vec3} normalEC The normalized ellipsoid surface normal, at <code>positionMC</code>, in eye coordinates.\n *\n * @returns {mat3} A 3x3 rotation matrix that transforms vectors from the east-north-up coordinate system to eye coordinates.\n *\n * @example\n * // Transform a vector defined in the east-north-up coordinate \n * // system, (0, 0, 1) which is the surface normal, to eye \n * // coordinates.\n * mat3 m = czm_eastNorthUpToEyeCoordinates(positionMC, normalEC);\n * vec3 normalEC = m * vec3(0.0, 0.0, 1.0);\n */\nmat3 czm_eastNorthUpToEyeCoordinates(vec3 positionMC, vec3 normalEC)\n{\n vec3 tangentMC = normalize(vec3(-positionMC.y, positionMC.x, 0.0)); // normalized surface tangent in model coordinates\n vec3 tangentEC = normalize(czm_normal3D * tangentMC); // normalized surface tangent in eye coordiantes\n vec3 bitangentEC = normalize(cross(normalEC, tangentEC)); // normalized surface bitangent in eye coordinates\n\n return mat3(\n tangentEC.x, tangentEC.y, tangentEC.z,\n bitangentEC.x, bitangentEC.y, bitangentEC.z,\n normalEC.x, normalEC.y, normalEC.z);\n}\n",czm_ellipsoidContainsPoint:"/**\n * DOC_TBA\n *\n * @name czm_ellipsoidContainsPoint\n * @glslFunction\n *\n */\nbool czm_ellipsoidContainsPoint(vec3 ellipsoid_inverseRadii, vec3 point)\n{\n vec3 scaled = ellipsoid_inverseRadii * (czm_inverseModelView * vec4(point, 1.0)).xyz;\n return (dot(scaled, scaled) <= 1.0);\n}\n",czm_ellipsoidNew:"/**\n * DOC_TBA\n *\n * @name czm_ellipsoidNew\n * @glslFunction\n *\n */\nczm_ellipsoid czm_ellipsoidNew(vec3 center, vec3 radii)\n{\n vec3 inverseRadii = vec3(1.0 / radii.x, 1.0 / radii.y, 1.0 / radii.z);\n vec3 inverseRadiiSquared = inverseRadii * inverseRadii;\n czm_ellipsoid temp = czm_ellipsoid(center, radii, inverseRadii, inverseRadiiSquared);\n return temp;\n}\n",czm_ellipsoidWgs84TextureCoordinates:"/**\n * DOC_TBA\n *\n * @name czm_ellipsoidWgs84TextureCoordinates\n * @glslFunction\n */\nvec2 czm_ellipsoidWgs84TextureCoordinates(vec3 normal)\n{\n return vec2(atan(normal.y, normal.x) * czm_oneOverTwoPi + 0.5, asin(normal.z) * czm_oneOverPi + 0.5);\n}\n",czm_equalsEpsilon:"/**\n * Compares <code>left</code> and <code>right</code> componentwise. Returns <code>true</code>\n * if they are within <code>epsilon</code> and <code>false</code> otherwise. The inputs\n * <code>left</code> and <code>right</code> can be <code>float</code>s, <code>vec2</code>s,\n * <code>vec3</code>s, or <code>vec4</code>s.\n *\n * @name czm_equalsEpsilon\n * @glslFunction\n *\n * @param {} left The first vector.\n * @param {} right The second vector.\n * @param {float} epsilon The epsilon to use for equality testing.\n * @returns {bool} <code>true</code> if the components are within <code>epsilon</code> and <code>false</code> otherwise.\n *\n * @example\n * // GLSL declarations\n * bool czm_equalsEpsilon(float left, float right, float epsilon);\n * bool czm_equalsEpsilon(vec2 left, vec2 right, float epsilon);\n * bool czm_equalsEpsilon(vec3 left, vec3 right, float epsilon);\n * bool czm_equalsEpsilon(vec4 left, vec4 right, float epsilon);\n */\nbool czm_equalsEpsilon(vec4 left, vec4 right, float epsilon) {\n return all(lessThanEqual(abs(left - right), vec4(epsilon)));\n}\n\nbool czm_equalsEpsilon(vec3 left, vec3 right, float epsilon) {\n return all(lessThanEqual(abs(left - right), vec3(epsilon)));\n}\n\nbool czm_equalsEpsilon(vec2 left, vec2 right, float epsilon) {\n return all(lessThanEqual(abs(left - right), vec2(epsilon)));\n}\n\nbool czm_equalsEpsilon(float left, float right, float epsilon) {\n return (abs(left - right) <= epsilon);\n}\n",czm_executeExcavation:"#ifdef EXCAVATION\nuniform sampler2D uExcavationTexture;\nuniform float uExcavationMode;\nuniform vec4 uExcavationRect;\nvarying vec4 vExcavationVertexPos;\nvec2 CalculateExcavationPolyTexCoord(vec4 vertexPos, vec4 rectPos, out float ptInRect)\n{\n vec2 vecRatio = vec2(rectPos.z - rectPos.x, rectPos.w - rectPos.y);\n vec2 texCoord = vec2(vertexPos.x - rectPos.x, vertexPos.y - rectPos.y);\n texCoord.x = texCoord.x / vecRatio.x;\n texCoord.y = texCoord.y / vecRatio.y;\n ptInRect = step(0.0, texCoord.x) * step(0.0, texCoord.y) * step(0.0, 1.0 - texCoord.x) * step(0.0, 1.0 - texCoord.y);\n texCoord = clamp(texCoord, vec2(0.0), vec2(1.0));\n return texCoord;\n}\nbool czm_executeExcavation()\n{\n float hasExcavation = 1.0;\n vec2 vecExcavationTexCoord = CalculateExcavationPolyTexCoord(vExcavationVertexPos, uExcavationRect, hasExcavation);\n bool excavationInside = (uExcavationMode < 0.5);\n if(hasExcavation < 0.1)\n {\n return !excavationInside;\n }\n if(excavationInside)\n {\n return texture2D(uExcavationTexture, vecExcavationTexCoord.xy).r > 0.5;\n }\n else\n {\n return texture2D(uExcavationTexture, vecExcavationTexCoord.xy).r < 0.5;\n }\n}\n#endif",czm_eyeOffset:"/**\n * DOC_TBA\n *\n * @name czm_eyeOffset\n * @glslFunction\n *\n * @param {vec4} positionEC DOC_TBA.\n * @param {vec3} eyeOffset DOC_TBA.\n *\n * @returns {vec4} DOC_TBA.\n */\nvec4 czm_eyeOffset(vec4 positionEC, vec3 eyeOffset)\n{\n // This equation is approximate in x and y.\n vec4 p = positionEC;\n vec4 zEyeOffset = normalize(p) * eyeOffset.z;\n p.xy += eyeOffset.xy + zEyeOffset.xy;\n p.z += zEyeOffset.z;\n return p;\n}\n",czm_eyeToWindowCoordinates:"/**\n * Transforms a position from eye to window coordinates. The transformation\n * from eye to clip coordinates is done using {@link czm_projection}.\n * The transform from normalized device coordinates to window coordinates is\n * done using {@link czm_viewportTransformation}, which assumes a depth range\n * of <code>near = 0</code> and <code>far = 1</code>.\n * <br /><br />\n * This transform is useful when there is a need to manipulate window coordinates\n * in a vertex shader as done by {@link BillboardCollection}.\n *\n * @name czm_eyeToWindowCoordinates\n * @glslFunction\n *\n * @param {vec4} position The position in eye coordinates to transform.\n *\n * @returns {vec4} The transformed position in window coordinates.\n *\n * @see czm_modelToWindowCoordinates\n * @see czm_projection\n * @see czm_viewportTransformation\n * @see BillboardCollection\n *\n * @example\n * vec4 positionWC = czm_eyeToWindowCoordinates(positionEC);\n */\nvec4 czm_eyeToWindowCoordinates(vec4 positionEC)\n{\n vec4 q = czm_projection * positionEC; // clip coordinates\n q.xyz /= q.w; // normalized device coordinates\n q.xyz = (czm_viewportTransformation * vec4(q.xyz, 1.0)).xyz; // window coordinates\n return q;\n}\n",czm_fastApproximateAtan:"/**\n * Approxiamtes atan over the range [0, 1]. Safe to flip output for negative input.\n *\n * Based on Michal Drobot's approximation from ShaderFastLibs, which in turn is based on\n * \"Efficient approximations for the arctangent function,\" Rajan, S. Sichun Wang Inkol, R. Joyal, A., May 2006.\n * Adapted from ShaderFastLibs under MIT License.\n *\n * Chosen for the following characteristics over range [0, 1]:\n * - basically no error at 0 and 1, important for getting around range limit (naive atan2 via atan requires infinite range atan)\n * - no visible artifacts from first-derivative discontinuities, unlike latitude via range-reduced sqrt asin approximations (at equator)\n *\n * The original code is x * (-0.1784 * abs(x) - 0.0663 * x * x + 1.0301);\n * Removed the abs() in here because it isn't needed, the input range is guaranteed as [0, 1] by how we're approximating atan2.\n *\n * @name czm_fastApproximateAtan\n * @glslFunction\n *\n * @param {float} x Value between 0 and 1 inclusive.\n *\n * @returns {float} Approximation of atan(x)\n */\nfloat czm_fastApproximateAtan(float x) {\n return x * (-0.1784 * x - 0.0663 * x * x + 1.0301);\n}\n\n/**\n * Approximation of atan2.\n *\n * However, we replaced their atan curve with Michael Drobot's (see above).\n *\n * @name czm_fastApproximateAtan\n * @glslFunction\n *\n * @param {float} x Value between -1 and 1 inclusive.\n * @param {float} y Value between -1 and 1 inclusive.\n *\n * @returns {float} Approximation of atan2(x, y)\n */\nfloat czm_fastApproximateAtan(float x, float y) {\n // atan approximations are usually only reliable over [-1, 1], or, in our case, [0, 1] due to modifications.\n // So range-reduce using abs and by flipping whether x or y is on top.\n float t = abs(x); // t used as swap and atan result.\n float opposite = abs(y);\n float adjacent = max(t, opposite);\n opposite = min(t, opposite);\n\n t = czm_fastApproximateAtan(opposite / adjacent);\n\n // Undo range reduction\n t = czm_branchFreeTernary(abs(y) > abs(x), czm_piOverTwo - t, t);\n t = czm_branchFreeTernary(x < 0.0, czm_pi - t, t);\n t = czm_branchFreeTernary(y < 0.0, -t, t);\n return t;\n}\n",czm_fog:"/**\n * Gets the color with fog at a distance from the camera.\n *\n * @name czm_fog\n * @glslFunction\n *\n * @param {float} distanceToCamera The distance to the camera in meters.\n * @param {vec3} color The original color.\n * @param {vec3} fogColor The color of the fog.\n *\n * @returns {vec3} The color adjusted for fog at the distance from the camera.\n */\nvec3 czm_fog(float distanceToCamera, vec3 color, vec3 fogColor)\n{\n float scalar = distanceToCamera * czm_fogDensity;\n float fog = 1.0 - exp(-(scalar * scalar));\n return mix(color, fogColor, fog);\n}\n\n/**\n * Gets the color with fog at a distance from the camera.\n *\n * @name czm_fog\n * @glslFunction\n *\n * @param {float} distanceToCamera The distance to the camera in meters.\n * @param {vec3} color The original color.\n * @param {vec3} fogColor The color of the fog.\n * @param {float} fogModifierConstant A constant to modify the appearance of fog.\n *\n * @returns {vec3} The color adjusted for fog at the distance from the camera.\n */\nvec3 czm_fog(float distanceToCamera, vec3 color, vec3 fogColor, float fogModifierConstant)\n{\n float scalar = distanceToCamera * czm_fogDensity;\n float fog = 1.0 - exp(-((fogModifierConstant * scalar + fogModifierConstant) * (scalar * (1.0 + fogModifierConstant))));\n return mix(color, fogColor, fog);\n}\n",czm_gammaCorrect:"/**\n * Converts a color from RGB space to linear space.\n *\n * @name czm_gammaCorrect\n * @glslFunction\n *\n * @param {vec3} color The color in RGB space.\n * @returns {vec3} The color in linear space.\n */\nvec3 czm_gammaCorrect(vec3 color) {\n#ifdef HDR\n color = pow(color, vec3(czm_gamma));\n#endif\n return color;\n}\n\nvec4 czm_gammaCorrect(vec4 color) {\n#ifdef HDR\n color.rgb = pow(color.rgb, vec3(czm_gamma));\n#endif\n return color;\n}\n",czm_geodeticSurfaceNormal:"/**\n * DOC_TBA\n *\n * @name czm_geodeticSurfaceNormal\n * @glslFunction\n *\n * @param {vec3} positionOnEllipsoid DOC_TBA\n * @param {vec3} ellipsoidCenter DOC_TBA\n * @param {vec3} oneOverEllipsoidRadiiSquared DOC_TBA\n * \n * @returns {vec3} DOC_TBA.\n */\nvec3 czm_geodeticSurfaceNormal(vec3 positionOnEllipsoid, vec3 ellipsoidCenter, vec3 oneOverEllipsoidRadiiSquared)\n{\n return normalize((positionOnEllipsoid - ellipsoidCenter) * oneOverEllipsoidRadiiSquared);\n}\n",czm_getDefaultMaterial:"/**\n * An czm_material with default values. Every material's czm_getMaterial\n * should use this default material as a base for the material it returns.\n * The default normal value is given by materialInput.normalEC.\n *\n * @name czm_getDefaultMaterial\n * @glslFunction\n *\n * @param {czm_materialInput} input The input used to construct the default material.\n *\n * @returns {czm_material} The default material.\n *\n * @see czm_materialInput\n * @see czm_material\n * @see czm_getMaterial\n */\nczm_material czm_getDefaultMaterial(czm_materialInput materialInput)\n{\n czm_material material;\n material.diffuse = vec3(0.0);\n material.specular = 0.0;\n material.shininess = 1.0;\n material.normal = materialInput.normalEC;\n material.emission = vec3(0.0);\n material.alpha = 1.0;\n return material;\n}\n",czm_getEmissiveTextureColor:"uniform float uMaxCategoryOrHypCeil;\n uniform float uMinCategoryOrHypFloor;\n uniform sampler2D uEmissionTexAtlas;\n uniform vec4 uEmissionTexAtlasTilingAndOffset[EMISSION_TEXTURE_COUNT];\n uniform vec4 uEmissionTexAtlasRects[EMISSION_TEXTURE_COUNT];\n uniform float uLayerCornerLength;\n varying vec2 vLayerTexCoord;\n varying vec2 vModIndexAndTexIndex;\nvec3 czm_getEmissiveTextureColor(float w)\n{\n vec3 texColor = vec3(0.0);\n vec2 emissionTexCoord;\n int nEmissionTexTexIdx = int(floor(vModIndexAndTexIndex.y + 0.5));\n vec2 atlasTexCoord;\n for(int i = 0; i < EMISSION_TEXTURE_COUNT; i++){\n if(nEmissionTexTexIdx == i){\n emissionTexCoord.x = mod(length(vLayerTexCoord) * uLayerCornerLength / uEmissionTexAtlasTilingAndOffset[i].x, 1.0);\n emissionTexCoord.x += uEmissionTexAtlasTilingAndOffset[i].z;\n emissionTexCoord.y = mod((w - uMinCategoryOrHypFloor) / uEmissionTexAtlasTilingAndOffset[i].y, 1.0) ;\n emissionTexCoord.y += vModIndexAndTexIndex.x + uEmissionTexAtlasTilingAndOffset[i].w;\n emissionTexCoord.xy = fract(emissionTexCoord.xy);\n atlasTexCoord = mix(uEmissionTexAtlasRects[i].xy, uEmissionTexAtlasRects[i].zw, emissionTexCoord);\n break;\n }\n }\n texColor = texture2D(uEmissionTexAtlas, atlasTexCoord).rgb;\n return texColor;\n}",czm_getHorizontalColor:"uniform float uHorizontalLine;\nuniform vec4 uHorizontalColor;\nfloat computeContourline(float fValue)\n{\n\tfloat distanceToContour = uHorizontalLine;\n\tfloat dxc = abs(dFdx(fValue));\n\tfloat dyc = abs(dFdy(fValue));\n\tfloat dF = max(dxc, dyc);\n\treturn (abs(distanceToContour-fValue) < dF) ? 1.0 : 0.0;\n}\n\nvec4 czm_getHorizontalColor(vec4 oriColor, float fValue)\n{\n float finalOpacity = computeContourline(fValue);\n return mix(oriColor,uHorizontalColor, finalOpacity);\n}",czm_getHypsometricColor:"uniform sampler2D uHypsometricTexture;\nuniform sampler2D uHypsometricRenderTexture;\nuniform float uHypsometricVisible;\nuniform float uHypOpacity;\nuniform float uHypContourInterval;\nuniform vec4 uHypLineColor;\nuniform float uHypContourFillMode;\nuniform float uHypFloor;\nuniform float uHypCeil;\nuniform float uHypMaxVisibleValue;\nuniform float uHypMinVisibleValue;\nuniform float uHypHasAnalysisRegion;\nvarying vec2 vecHypTexCoord;\nuniform float uMixColorType;\nuniform vec4 uNoValueColor;\n#ifdef Volume\nvarying vec3 vecRotioCoord;\nuniform float uDataFloor;\nuniform float uDataCeil;\nuniform float uVolumeType;\n#endif\n\n#ifdef Volume2\nuniform float uDataFloor;\nuniform float uDataCeil;\nuniform float uFilterMode;\n#endif\n\nfloat computeMixCon(float fValue)\n{\n float distanceToContour;\n if(abs(uHypMaxVisibleValue - uHypMinVisibleValue) > 0.1)\n {\n\t if(fValue < 0.5)\n {\n distanceToContour = mod(fValue - 0.0002, uHypContourInterval);\n }\n else\n {\n float t = floor(fValue / uHypContourInterval);\n distanceToContour = abs(fValue - (t * uHypContourInterval) - 0.1);\n }\n\t}\n\telse\n\t{\n\t distanceToContour = abs(fValue - uHypMaxVisibleValue);\n\t}\n\tfloat dxc = abs(dFdx(fValue));\n\tfloat dyc = abs(dFdy(fValue));\n\tfloat dF = max(dxc, dyc);\n\treturn (distanceToContour < dF) ? 1.0 : 0.0;\n}\n\nvec4 computeContourMapColor(float fValue)\n{\n\t//float threshold = clamp(abs(uHypCeil - uHypFloor), 0.000001, 20000.0);\n\tfloat threshold = abs(uHypCeil - uHypFloor);\n\tfloat contourRate = (fValue - uHypFloor) / threshold;\n\tfloat finalCoord = clamp(contourRate, 0.0, 1.0);\n\tfloat count = floor(finalCoord * 16.0);\n\tfloat y = (count*2.0 + 1.0)/32.0;\n\tfloat x = fract(finalCoord*16.0);\n\tif(y > 1.0)\n\t{\n\t x = 1.0;\n\t}\n\tvec2 contourCoord = vec2(x, y);\n\treturn texture2D(uHypsometricTexture, contourCoord).rgba;\n}\n#ifdef Volume2\n\nvec4 czm_getContourMapColor(vec4 oriColor, vec4 volColor)\n{\n if(uFilterMode > 0.5)\n {\n vec4 finalColor = volColor * oriColor;\n\n if(uMixColorType > 0.5)\n {\n finalColor = volColor;\n }\n return finalColor;\n }\n\n vec4 contourMapColor = vec4(0.0);\n float finalOpacity = uHypOpacity;\n\n\tfloat noValue = volColor.a;\n\tfloat texTest = clamp(czm_unpackVolume(volColor.zyx),0.0,1.0);\n\n\tfloat fValue;\n\tif(noValue > 0.5)\n\t{\n fValue = uDataFloor + texTest * (uDataCeil - uDataFloor);\n }\n else\n {\n fValue = uHypMaxVisibleValue + abs(uHypMaxVisibleValue * 0.1);\n }\n\n float extendHeight = czm_branchFreeTernary(uHypContourFillMode > 2.9, 0.0, czm_branchFreeTernary(uHypContourFillMode > 1.9, 5.0, 0.0));\n if(fValue > uHypMaxVisibleValue + extendHeight || fValue < uHypMinVisibleValue - extendHeight)\n {\n return uNoValueColor * oriColor;\n }\n#ifdef GL_OES_standard_derivatives\n if(uHypContourFillMode > 2.9)\n {\n float mix_con = computeMixCon(fValue);\n contourMapColor = mix(computeContourMapColor(fValue), uHypLineColor, mix_con);\n }\n else if(uHypContourFillMode > 1.9)\n {\n finalOpacity = computeMixCon(fValue);\n contourMapColor = uHypLineColor;\n }\n else if(uHypContourFillMode > 0.9)\n#else\n if(uHypContourFillMode > 0.9)\n#endif\n {\n contourMapColor = computeContourMapColor(fValue);\n }\n else\n {\n finalOpacity = 0.0;\n }\n vec4 mixColor = mix(vec4(1.0,1.0,1.0,1.0), contourMapColor, finalOpacity);\n vec4 finalColor = mixColor * oriColor;\n#ifdef PT_CLOUD\n\tfinalColor = mixColor;\n#endif\n if(uMixColorType > 0.5)\n {\n finalColor = mixColor;\n }\n return finalColor;\n}\n\n#else\n\nvec4 czm_getContourMapColor(vec4 oriColor, float fValue)\n{\n vec4 contourMapColor = vec4(0.0);\n float finalOpacity = uHypOpacity;\n#ifdef Volume\n\tvec3 aRatioT = vecRotioCoord;\n\tif((aRatioT.x < 1.0 && aRatioT.x >0.0) && (aRatioT.y < 1.0 && aRatioT.y >0.0) && (aRatioT.z < 1.0 && aRatioT.z >0.0))\n\t{\n\t if(uVolumeType > 0.5)\n\t {\n\t\t\tvec4 volumeColor = czm_getVolumeValue(aRatioT);\n\t\t\tif(uMixColorType > 0.5)\n\t\t\t{\n\t\t\t\tvolumeColor = volumeColor * oriColor;\n\t\t\t}\n\t\t\treturn volumeColor;\n\t }\n\t float noValue;\n\t float texTest = czm_getVolumeValue(aRatioT, noValue);\n\t if(noValue > 0.5)\n\t {\n\t fValue = uDataFloor + texTest * (uDataCeil - uDataFloor);\n\t }\n\t else\n\t {\n\t fValue = uHypMaxVisibleValue + abs(uHypMaxVisibleValue * 0.1);\n\t }\n\t}\n\telse\n\t{\n\t fValue = uHypMaxVisibleValue + abs(uHypMaxVisibleValue * 0.1);\n\t}\n#endif\n float extendHeight = czm_branchFreeTernary(uHypContourFillMode > 2.9, 0.0, czm_branchFreeTernary(uHypContourFillMode > 1.9, 5.0, 0.0));\n if(fValue > uHypMaxVisibleValue + extendHeight || fValue < uHypMinVisibleValue - extendHeight)\n {\n return uNoValueColor * oriColor;\n }\n#ifdef GL_OES_standard_derivatives\n if(uHypContourFillMode > 2.9)\n {\n float mix_con = computeMixCon(fValue);\n contourMapColor = mix(computeContourMapColor(fValue), uHypLineColor, mix_con);\n }\n else if(uHypContourFillMode > 1.9)\n {\n finalOpacity = computeMixCon(fValue);\n contourMapColor = uHypLineColor;\n }\n else if(uHypContourFillMode > 0.9)\n#else\n if(uHypContourFillMode > 0.9)\n#endif\n {\n contourMapColor = computeContourMapColor(fValue);\n }\n else\n {\n finalOpacity = 0.0;\n }\n vec4 mixColor = mix(vec4(1.0,1.0,1.0,1.0), contourMapColor, finalOpacity);\n vec4 finalColor = mix(oriColor, contourMapColor, finalOpacity);\n#ifdef PT_CLOUD\n\tfinalColor = mixColor;\n#endif\n#ifdef Volume\n if(uMixColorType > 0.5)\n {\n finalColor = mixColor;\n }\n#endif\n return finalColor;\n}\n\n#endif\n\n#ifdef Volume2\nvec4 czm_getHypsometricColor(vec4 oriColor, vec4 volColor)\n{\n\tif(uHypHasAnalysisRegion > 0.1)\n {\n\t\tvec4 hypColor = texture2D(uHypsometricRenderTexture, vecHypTexCoord);\n\t\tif(hypColor.r < 0.1)\n\t\t{\n\t\t\treturn oriColor;\n\t\t}\n\t}\n return czm_getContourMapColor(oriColor, volColor);\n}\n#else\nvec4 czm_getHypsometricColor(vec4 oriColor, float wValue)\n{\n float fValue = wValue;\n\tif(uHypHasAnalysisRegion > 0.1)\n {\n\t\tvec4 hypColor = texture2D(uHypsometricRenderTexture, vecHypTexCoord);\n\t\tif(hypColor.r < 0.1)\n\t\t{\n\t\t\treturn oriColor;\n\t\t}\n\t}\n return czm_getContourMapColor(oriColor, fValue);\n}\n\nvec4 czm_getHypsometricColorByGeoBounds(vec4 oriColor, float wValue, vec4 hypRect, vec2 vTexCoord, vec4 geoBounds)\n{\n if(uHypHasAnalysisRegion > 0.1)\n {\n vec2 polyTexCoord = vTexCoord.xy;\n polyTexCoord.x = polyTexCoord.x * (geoBounds.z - geoBounds.x) + geoBounds.x;\n polyTexCoord.y = polyTexCoord.y * (geoBounds.w - geoBounds.y) + geoBounds.y;\n if(polyTexCoord.x < hypRect.x || polyTexCoord.x>hypRect.z || polyTexCoord.y< hypRect.y || polyTexCoord.y > hypRect.w)\n {\n return oriColor;\n }\n vec4 hypColor = texture2D(uHypsometricRenderTexture, polyTexCoord);\n if(hypColor.r < 0.1)\n {\n return oriColor;\n }\n }\n return czm_getContourMapColor(oriColor, wValue);\n}\n\n#endif",czm_getLambertDiffuse:"/**\n * Calculates the intensity of diffusely reflected light.\n *\n * @name czm_getLambertDiffuse\n * @glslFunction\n *\n * @param {vec3} lightDirectionEC Unit vector pointing to the light source in eye coordinates.\n * @param {vec3} normalEC The surface normal in eye coordinates.\n *\n * @returns {float} The intensity of the diffuse reflection.\n *\n * @see czm_phong\n *\n * @example\n * float diffuseIntensity = czm_getLambertDiffuse(lightDirectionEC, normalEC);\n * float specularIntensity = czm_getSpecular(lightDirectionEC, toEyeEC, normalEC, 200);\n * vec3 color = (diffuseColor * diffuseIntensity) + (specularColor * specularIntensity);\n */\nfloat czm_getLambertDiffuse(vec3 lightDirectionEC, vec3 normalEC)\n{\n return max(dot(lightDirectionEC, normalEC), 0.0);\n}\n",czm_getSpecular:"/**\n * Calculates the specular intensity of reflected light.\n *\n * @name czm_getSpecular\n * @glslFunction\n *\n * @param {vec3} lightDirectionEC Unit vector pointing to the light source in eye coordinates.\n * @param {vec3} toEyeEC Unit vector pointing to the eye position in eye coordinates.\n * @param {vec3} normalEC The surface normal in eye coordinates.\n * @param {float} shininess The sharpness of the specular reflection. Higher values create a smaller, more focused specular highlight.\n *\n * @returns {float} The intensity of the specular highlight.\n *\n * @see czm_phong\n *\n * @example\n * float diffuseIntensity = czm_getLambertDiffuse(lightDirectionEC, normalEC);\n * float specularIntensity = czm_getSpecular(lightDirectionEC, toEyeEC, normalEC, 200);\n * vec3 color = (diffuseColor * diffuseIntensity) + (specularColor * specularIntensity);\n */\nfloat czm_getSpecular(vec3 lightDirectionEC, vec3 toEyeEC, vec3 normalEC, float shininess)\n{\n vec3 toReflectedLight = reflect(-lightDirectionEC, normalEC);\n float specular = max(dot(toReflectedLight, toEyeEC), 0.0);\n\n // pow has undefined behavior if both parameters <= 0.\n // Prevent this by making sure shininess is at least czm_epsilon2.\n return pow(specular, max(shininess, czm_epsilon2));\n}\n",czm_getTexColorForS3M:"void CalculateMipLevel(in vec2 inTexCoord, in float vecTile, in float fMaxMip, inout float mipLevel)\n{\n\tvec2 dx = dFdx(inTexCoord * vecTile);\n\tvec2 dy = dFdy(inTexCoord * vecTile);\n\tfloat dotX = dot(dx, dx);\n\tfloat dotY = dot(dy, dy);\n\tfloat dMax = max(dotX, dotY);\n\tfloat dMin = min(dotX, dotY);\n\tfloat offset = (dMax - dMin) / (dMax + dMin);\n\toffset = clamp(offset, 0.0, 1.0);\n\tfloat d = dMax * (1.0 - offset) + dMin * offset;\n\tmipLevel = 0.5 * log2(d);\n\tmipLevel = clamp(mipLevel, 0.0, fMaxMip - 1.62);\n}\n\nvoid CalculateMipLevel(in vec2 inTexCoord, in vec2 vecTile, in float fMaxMip, inout float mipLevel)\n{\n\tvec2 dx = dFdx(inTexCoord * vecTile.x);\n\tvec2 dy = dFdy(inTexCoord * vecTile.y);\n\tfloat dotX = dot(dx, dx);\n\tfloat dotY = dot(dy, dy);\n\tfloat dMax = max(dotX, dotY);\n\tfloat dMin = min(dotX, dotY);\n\tfloat offset = (dMax - dMin) / (dMax + dMin);\n\toffset = clamp(offset, 0.0, 1.0);\n\tfloat d = dMax * (1.0 - offset) + dMin * offset;\n\tmipLevel = 0.5 * log2(d);\n\tmipLevel = clamp(mipLevel, 0.0, fMaxMip - 1.62);\n}\n\nvoid CalculateTexCoord(in vec3 inTexCoord, in float scale, in float XTran, in float YTran, in float fTile, in float mipLevel, inout vec2 outTexCoord)\n{\n if(inTexCoord.z < -9000.0)\n {\n outTexCoord = inTexCoord.xy;\n }\n else\n {\n\t vec2 fTexCoord = fract(inTexCoord.xy);\n\t float offset = 1.0 * pow(2.0, mipLevel) / fTile;\n\t fTexCoord = clamp(fTexCoord, offset, 1.0 - offset);\n\t outTexCoord.x = (fTexCoord.x + XTran) * scale;\n\t outTexCoord.y = (fTexCoord.y + YTran) * scale;\n\t}\n}\n\n\nvec4 czm_getTexColorForS3M(sampler2D curTexture, vec3 oriTexCoord, float texTileWidth, float fMaxMipLev, float fTexCoordScale, vec2 vecTexCoordTranslate,float isRGBA, vec4 texUVoffset, out vec2 outTexCoord)\n{\n\tvec4 color = vec4(1.0);\n float mipLevel = 0.0;\n#ifdef GL_OES_standard_derivatives\n CalculateMipLevel(oriTexCoord.xy, texTileWidth, fMaxMipLev, mipLevel);\n#endif\n vec2 realTexCoord;\n CalculateTexCoord(oriTexCoord, fTexCoordScale, vecTexCoordTranslate.x, vecTexCoordTranslate.y, texTileWidth, mipLevel, realTexCoord);\n\tif(isRGBA > 0.5)\n\t{\n\t vec2 rgbTexCoord;\n\t\trgbTexCoord.x = (realTexCoord.x + vecTexCoordTranslate.x * fTexCoordScale) * 0.5;\n\t\trgbTexCoord.y = (realTexCoord.y + vecTexCoordTranslate.y * fTexCoordScale) * 0.5;\n\t\trgbTexCoord.xy += texUVoffset.xy;\n color = texture2D(curTexture, rgbTexCoord.xy, -10.0);\n\t\tvec2 vecAlphaTexCoord;\n\t\tvecAlphaTexCoord.x = rgbTexCoord.x;\n\t\tvecAlphaTexCoord.y = rgbTexCoord.y + fTexCoordScale * 0.5;\n\t\tvecAlphaTexCoord.xy += texUVoffset.xy;\n\t color.a = texture2D(curTexture, vecAlphaTexCoord.xy, -10.0).r;\n\t}\n\telse\n\t{\n\t realTexCoord = realTexCoord * texUVoffset.zw + texUVoffset.xy;\n\t if(oriTexCoord.z < -9000.0)\n {\n color = texture2D(curTexture, realTexCoord.xy);\n }\n else\n {\n #ifdef GL_EXT_shader_texture_lod\n color = texture2DLodEXT(curTexture, realTexCoord.xy, mipLevel);\n #else\n #ifdef WEBEL2\n color = textureLod(curTexture, realTexCoord.xy, mipLevel);\n #else\n color = texture2D(curTexture, realTexCoord.xy, mipLevel);\n #endif\n #endif\n }\n #ifdef RGBTOBGR\n color = color.bgra;\n #endif\n\t}\n\toutTexCoord = realTexCoord;\n\treturn color;\n}\n\nvec4 czm_getTexColorForS3M(sampler2D texture, vec2 uv, vec2 texDim, vec2 texTran, vec2 texScale, float maxMipLevel, out vec2 outTexCoord)\n{\n if(maxMipLevel < 0.0)\n {\n return vec4(1.0);\n }\n\tvec4 colorCeil = vec4(1.0);\n float mipLevel = 0.0;\n#ifdef GL_OES_standard_derivatives\n CalculateMipLevel(uv, texDim, maxMipLevel, mipLevel);\n#endif\n\tfloat ceilMipLevel = ceil(mipLevel);\n\tvec2 translate = vec2(texTran.x, texTran.y);\n\tfloat temp;\n\tif(ceilMipLevel > 0.0)\n\t{\n\t\ttranslate.x = texTran.x + texScale.x;\n\t\ttemp = pow(2.0, ceilMipLevel - 1.0);\n\t\ttranslate.y = texTran.y + texScale.y * (temp - 1.0) / temp;\n\t}\n float scale = 1.0 / pow(2.0, ceilMipLevel);\n\tvec2 texcoord = fract(uv);\n\tfloat offsetX = pow(2.0, ceilMipLevel) / texDim.x;\n\tfloat offsetY = pow(2.0, ceilMipLevel) / texDim.y;\n\ttexcoord.x = clamp(texcoord.x, 0.0 + offsetX, 1.0 - offsetX);\n\ttexcoord.y = clamp(texcoord.y, 0.0 + offsetY, 1.0 - offsetY);\n\ttexcoord.x = texcoord.x * texScale.x * scale + translate.x;\n\ttexcoord.y = texcoord.y * texScale.y * scale + translate.y;\n\t#ifdef GL_EXT_shader_texture_lod\n colorCeil = texture2DLodEXT(texture, texcoord.xy, 0.0);\n #else\n #ifdef WEBEL2\n colorCeil = textureLod(texture, texcoord.xy, 0.0);\n #else\n colorCeil = texture2D(texture, texcoord.xy, -10.0);\n #endif\n #endif\n\tvec4 colorFloor = vec4(1.0);\n\tfloat floorMipLevel = floor(mipLevel);\n\ttranslate = vec2(texTran.x, texTran.y);\n\tif(floorMipLevel > 0.0)\n\t{\n\t translate.x = texTran.x + texScale.x;\n\t temp = pow(2.0, floorMipLevel - 1.0);\n\t translate.y = texTran.y + texScale.y * (temp - 1.0) / temp;\n\t}\n\tscale = 1.0 / pow(2.0, floorMipLevel);\n\ttexcoord = fract(uv);\n\toffsetX = pow(2.0, floorMipLevel) / texDim.x;\n\toffsetY = pow(2.0, floorMipLevel) / texDim.y;\n\ttexcoord.x = clamp(texcoord.x, 0.0 + offsetX, 1.0 - offsetX);\n\ttexcoord.y = clamp(texcoord.y, 0.0 + offsetY, 1.0 - offsetY);\n\ttexcoord.x = texcoord.x * texScale.x * scale + translate.x;\n\ttexcoord.y = texcoord.y * texScale.y * scale + translate.y;\n\t#ifdef GL_EXT_shader_texture_lod\n colorFloor = texture2DLodEXT(texture, texcoord.xy, 0.0);\n #else\n #ifdef WEBEL2\n colorFloor = textureLod(texture, texcoord.xy, 0.0);\n #else\n colorFloor = texture2D(texture, texcoord.xy, -10.0);\n #endif\n #endif\n\tvec4 color = colorCeil * 0.5 + colorFloor * 0.5;\n\treturn color;\n}",czm_getTextureMatrixFromZValue:"const float SHIFT_LEFT8 = 256.0;\nconst float SHIFT_RIGHT8 = 1.0 / 256.0;\nconst float SHIFT_RIGHT4 = 1.0 / 16.0;\nconst float SHIFT_LEFT4 = 16.0;\n\nvoid czm_getTextureMatrixFromZValue(in float nZ, inout float XTran, inout float YTran, inout float scale, inout float isRGBA)\n{\n if(nZ <= 0.0)\n {\n return;\n }\n float nDel8 = floor(nZ * SHIFT_RIGHT8);\n float nDel16 = floor(nDel8 * SHIFT_RIGHT8);\n float nDel20 = floor(nDel16 * SHIFT_RIGHT4);\n isRGBA = floor(nDel20);\n YTran = nZ - nDel8 * SHIFT_LEFT8;\n XTran = nDel8 - nDel16 * SHIFT_LEFT8;\n float nLevel = nDel16 - nDel20 * SHIFT_LEFT4;\n scale = 1.0 / pow(2.0, nLevel);\n}",czm_getVolumeValue:"uniform sampler2D uVolumeTexture;\n#ifdef TIME_ORDER\nuniform sampler2D uNextVolumeTexture;\nuniform float uTimeRatio;\n#endif\n\n#ifdef Volume\nuniform float width;\nuniform float height;\nuniform float depth;\nuniform float sideBlockCount;\nuniform float blockLength;\nuniform float texLength;\nuniform float uFilterMode;\n#endif\n\nfloat czm_unpackVolume(vec3 packedDepth)\n{\n return dot(packedDepth, vec3(1.0, 1.0 / 255.0, 1.0 / 65025.0));\n}\n\n#ifdef Volume\nvec2 computeVolumeTextureCoord(vec3 texCoord, float fLevel)\n{\n float yOffset = floor((fLevel+0.25/sideBlockCount) / sideBlockCount);\n float xOffset = fLevel - yOffset * sideBlockCount;\n float texCoordV = (texCoord.y * height + yOffset * blockLength) / texLength;\n float texCoordU = (texCoord.x * width + xOffset * blockLength) / texLength;\n return vec2(texCoordU, texCoordV);\n}\n\nfloat computeVolumeValue(sampler2D volumeTexture, vec2 topTexCoord, vec2 bottomTexCoord, float ratio, out float noValue)\n{\n vec4 volumeValue1 = texture2D(volumeTexture, topTexCoord);\n vec4 volumeValue2 = texture2D(volumeTexture, bottomTexCoord);\n float fValue1 = clamp(czm_unpackVolume(volumeValue1.xyz),0.0,1.0);\n float fValue2 = clamp(czm_unpackVolume(volumeValue2.xyz),0.0,1.0);\n if(uFilterMode >0.5)\n {\n if(ratio<0.5)\n {\n ratio = 0.0;\n }\n else\n {\n ratio = 1.0;\n }\n }\n noValue = mix(volumeValue1.a, volumeValue2.a, ratio);\n if(volumeValue1.a < 0.5)\n {\n fValue1 = fValue2;\n }\n if(volumeValue2.a < 0.5)\n {\n fValue2 = fValue1;\n }\n return mix(fValue1, fValue2, ratio);\n}\n\nfloat czm_getVolumeValue(vec3 texCoord, out float noValue)\n{\n float fLevel = (depth - 1.0) * texCoord.z;\n float bottomLevel= floor(fLevel);\n float topLevel = bottomLevel + 1.0;\n float ratio = topLevel - fLevel;\n vec2 topTexCoord = computeVolumeTextureCoord(texCoord, topLevel);\n vec2 bottomTexCoord = computeVolumeTextureCoord(texCoord, bottomLevel);\n float fResult = computeVolumeValue(uVolumeTexture, topTexCoord, bottomTexCoord, ratio, noValue);\n#ifdef TIME_ORDER\n float fNextResult = computeVolumeValue(uNextVolumeTexture, topTexCoord, bottomTexCoord, ratio, noValue);\n fResult = mix(fResult, fNextResult, uTimeRatio);\n#endif\n return fResult;\n}\n\nvec4 czm_getVolumeValue(vec3 texCoord)\n{\n\tfloat fLevel = (depth - 1.0) * texCoord.z;\n\tfloat bottomLevel= floor(fLevel);\n\tfloat topLevel = bottomLevel + 1.0;\n\tfloat ratio = topLevel - fLevel;\n\tfloat yOffset1 = floor((topLevel+0.25/sideBlockCount) / sideBlockCount);\n\tfloat xOffset1 = topLevel - yOffset1 * sideBlockCount;\n\tfloat texCoordV1 = (texCoord.y * height + yOffset1 * blockLength)/texLength;\n\tfloat texCoordU1 = (texCoord.x * width + xOffset1 * blockLength)/texLength;\n\tvec4 volumeColor1 = texture2D(uVolumeTexture, vec2(texCoordU1,texCoordV1));\n\tfloat yOffset2 = floor((bottomLevel+0.25/sideBlockCount) / sideBlockCount);\n\tfloat xOffset2 = bottomLevel - yOffset2 * sideBlockCount;\n\tfloat texCoordV2 = (texCoord.y * height + yOffset2 * blockLength)/texLength;\n\tfloat texCoordU2 = (texCoord.x * width + xOffset2 * blockLength)/texLength;\n\tvec4 volumeColor2 = texture2D(uVolumeTexture, vec2(texCoordU2, texCoordV2));\n\n\tif(uFilterMode >0.5)\n\t{\n\t\tif(ratio<0.5)\n\t\t{\n\t\t\tratio = 0.0;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tratio = 1.0;\n\t\t}\n\t}\n\n\tvec4 volumeColor = mix(volumeColor1, volumeColor2, ratio);\n\n\treturn volumeColor;\n}\n#endif",czm_getWaterNoise:"/**\n * @private\n */\nvec4 czm_getWaterNoise(sampler2D normalMap, vec2 uv, float time, float angleInRadians)\n{\n float cosAngle = cos(angleInRadians);\n float sinAngle = sin(angleInRadians);\n\n // time dependent sampling directions\n vec2 s0 = vec2(1.0/17.0, 0.0);\n vec2 s1 = vec2(-1.0/29.0, 0.0);\n vec2 s2 = vec2(1.0/101.0, 1.0/59.0);\n vec2 s3 = vec2(-1.0/109.0, -1.0/57.0);\n\n // rotate sampling direction by specified angle\n s0 = vec2((cosAngle * s0.x) - (sinAngle * s0.y), (sinAngle * s0.x) + (cosAngle * s0.y));\n s1 = vec2((cosAngle * s1.x) - (sinAngle * s1.y), (sinAngle * s1.x) + (cosAngle * s1.y));\n s2 = vec2((cosAngle * s2.x) - (sinAngle * s2.y), (sinAngle * s2.x) + (cosAngle * s2.y));\n s3 = vec2((cosAngle * s3.x) - (sinAngle * s3.y), (sinAngle * s3.x) + (cosAngle * s3.y));\n\n vec2 uv0 = (uv/103.0) + (time * s0);\n vec2 uv1 = uv/107.0 + (time * s1) + vec2(0.23);\n vec2 uv2 = uv/vec2(897.0, 983.0) + (time * s2) + vec2(0.51);\n vec2 uv3 = uv/vec2(991.0, 877.0) + (time * s3) + vec2(0.71);\n\n uv0 = fract(uv0);\n uv1 = fract(uv1);\n uv2 = fract(uv2);\n uv3 = fract(uv3);\n vec4 noise = (texture2D(normalMap, uv0)) +\n (texture2D(normalMap, uv1)) +\n (texture2D(normalMap, uv2)) +\n (texture2D(normalMap, uv3));\n\n // average and scale to between -1 and 1\n return ((noise / 4.0) - 0.5) * 2.0;\n}\n",czm_getWgs84EllipsoidEC:"/**\n * Returns the WGS84 ellipsoid, with its center at the origin of world coordinates, in eye coordinates.\n *\n * @name czm_getWgs84EllipsoidEC\n * @glslFunction\n *\n * @returns {czm_ellipsoid} The WGS84 ellipsoid, with its center at the origin of world coordinates, in eye coordinates.\n *\n * @see Ellipsoid.WGS84\n *\n * @example\n * czm_ellipsoid ellipsoid = czm_getWgs84EllipsoidEC();\n */\nczm_ellipsoid czm_getWgs84EllipsoidEC()\n{\n vec3 radii = vec3(6378137.0, 6378137.0, 6378137.0);\n vec3 inverseRadii = vec3(1.0 / radii.x, 1.0 / radii.y, 1.0 / radii.z);\n vec3 inverseRadiiSquared = inverseRadii * inverseRadii;\n czm_ellipsoid temp = czm_ellipsoid(czm_view[3].xyz, radii, inverseRadii, inverseRadiiSquared);\n return temp;\n}\n",czm_HSBToRGB:"/**\n * Converts an HSB color (hue, saturation, brightness) to RGB\n *\n * @name czm_HSBToRGB\n * @glslFunction\n * \n * @param {vec3} hsb The color in HSB.\n *\n * @returns {vec3} The color in RGB.\n *\n * @example\n * vec3 hsb = czm_RGBToHSB(rgb);\n * hsb.z *= 0.1;\n * rgb = czm_HSBToRGB(hsb);\n */\n\nconst vec4 K_HSB2RGB = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);\n\nvec3 czm_HSBToRGB(vec3 hsb)\n{\n vec3 p = abs(fract(hsb.xxx + K_HSB2RGB.xyz) * 6.0 - K_HSB2RGB.www);\n return hsb.z * mix(K_HSB2RGB.xxx, clamp(p - K_HSB2RGB.xxx, 0.0, 1.0), hsb.y);\n}\n",czm_HSLToRGB:"/**\n * Converts an HSL color (hue, saturation, lightness) to RGB\n *\n * @name czm_HSLToRGB\n * @glslFunction\n * \n * @param {vec3} rgb The color in HSL.\n *\n * @returns {vec3} The color in RGB.\n *\n * @example\n * vec3 hsl = czm_RGBToHSL(rgb);\n * hsl.z *= 0.1;\n * rgb = czm_HSLToRGB(hsl);\n */\n\nvec3 hueToRGB(float hue)\n{\n float r = abs(hue * 6.0 - 3.0) - 1.0;\n float g = 2.0 - abs(hue * 6.0 - 2.0);\n float b = 2.0 - abs(hue * 6.0 - 4.0);\n return clamp(vec3(r, g, b), 0.0, 1.0);\n}\n\nvec3 czm_HSLToRGB(vec3 hsl)\n{\n vec3 rgb = hueToRGB(hsl.x);\n float c = (1.0 - abs(2.0 * hsl.z - 1.0)) * hsl.y;\n return (rgb - 0.5) * c + hsl.z;\n}\n",czm_hue:"/**\n * Adjusts the hue of a color.\n * \n * @name czm_hue\n * @glslFunction\n * \n * @param {vec3} rgb The color.\n * @param {float} adjustment The amount to adjust the hue of the color in radians.\n *\n * @returns {float} The color with the hue adjusted.\n *\n * @example\n * vec3 adjustHue = czm_hue(color, czm_pi); // The same as czm_hue(color, -czm_pi)\n */\nvec3 czm_hue(vec3 rgb, float adjustment)\n{\n const mat3 toYIQ = mat3(0.299, 0.587, 0.114,\n 0.595716, -0.274453, -0.321263,\n 0.211456, -0.522591, 0.311135);\n const mat3 toRGB = mat3(1.0, 0.9563, 0.6210,\n 1.0, -0.2721, -0.6474,\n 1.0, -1.107, 1.7046);\n \n vec3 yiq = toYIQ * rgb;\n float hue = atan(yiq.z, yiq.y) + adjustment;\n float chroma = sqrt(yiq.z * yiq.z + yiq.y * yiq.y);\n \n vec3 color = vec3(yiq.x, chroma * cos(hue), chroma * sin(hue));\n return toRGB * color;\n}\n",czm_inverseGamma:"/**\n * Converts a color in linear space to RGB space.\n *\n * @name czm_inverseGamma\n * @glslFunction\n *\n * @param {vec3} color The color in linear space.\n * @returns {vec3} The color in RGB space.\n */\nvec3 czm_inverseGamma(vec3 color) {\n return pow(color, vec3(1.0 / czm_gamma));\n}\n",czm_isEmpty:"/**\n * Determines if a time interval is empty.\n *\n * @name czm_isEmpty\n * @glslFunction \n * \n * @param {czm_raySegment} interval The interval to test.\n * \n * @returns {bool} <code>true</code> if the time interval is empty; otherwise, <code>false</code>.\n *\n * @example\n * bool b0 = czm_isEmpty(czm_emptyRaySegment); // true\n * bool b1 = czm_isEmpty(czm_raySegment(0.0, 1.0)); // false\n * bool b2 = czm_isEmpty(czm_raySegment(1.0, 1.0)); // false, contains 1.0.\n */\nbool czm_isEmpty(czm_raySegment interval)\n{\n return (interval.stop < 0.0);\n}\n",czm_isFull:"/**\n * Determines if a time interval is empty.\n *\n * @name czm_isFull\n * @glslFunction \n * \n * @param {czm_raySegment} interval The interval to test.\n * \n * @returns {bool} <code>true</code> if the time interval is empty; otherwise, <code>false</code>.\n *\n * @example\n * bool b0 = czm_isEmpty(czm_emptyRaySegment); // true\n * bool b1 = czm_isEmpty(czm_raySegment(0.0, 1.0)); // false\n * bool b2 = czm_isEmpty(czm_raySegment(1.0, 1.0)); // false, contains 1.0.\n */\nbool czm_isFull(czm_raySegment interval)\n{\n return (interval.start == 0.0 && interval.stop == czm_infinity);\n}\n",czm_latitudeToWebMercatorFraction:"/**\n * Computes the fraction of a Web Wercator rectangle at which a given geodetic latitude is located.\n *\n * @name czm_latitudeToWebMercatorFraction\n * @glslFunction\n *\n * @param {float} latitude The geodetic latitude, in radians.\n * @param {float} southMercatorY The Web Mercator coordinate of the southern boundary of the rectangle.\n * @param {float} oneOverMercatorHeight The total height of the rectangle in Web Mercator coordinates.\n *\n * @returns {float} The fraction of the rectangle at which the latitude occurs. If the latitude is the southern\n * boundary of the rectangle, the return value will be zero. If it is the northern boundary, the return\n * value will be 1.0. Latitudes in between are mapped according to the Web Mercator projection.\n */ \nfloat czm_latitudeToWebMercatorFraction(float latitude, float southMercatorY, float oneOverMercatorHeight)\n{\n float sinLatitude = sin(latitude);\n float mercatorY = 0.5 * log((1.0 + sinLatitude) / (1.0 - sinLatitude));\n \n return (mercatorY - southMercatorY) * oneOverMercatorHeight;\n}\n",czm_lineDistance:"/**\n * Computes distance from an point in 2D to a line in 2D.\n *\n * @name czm_lineDistance\n * @glslFunction\n *\n * param {vec2} point1 A point along the line.\n * param {vec2} point2 A point along the line.\n * param {vec2} point A point that may or may not be on the line.\n * returns {float} The distance from the point to the line.\n */\nfloat czm_lineDistance(vec2 point1, vec2 point2, vec2 point) {\n return abs((point2.y - point1.y) * point.x - (point2.x - point1.x) * point.y + point2.x * point1.y - point2.y * point1.x) / distance(point2, point1);\n}\n",czm_luminance:"/**\n * Computes the luminance of a color. \n *\n * @name czm_luminance\n * @glslFunction\n *\n * @param {vec3} rgb The color.\n * \n * @returns {float} The luminance.\n *\n * @example\n * float light = czm_luminance(vec3(0.0)); // 0.0\n * float dark = czm_luminance(vec3(1.0)); // ~1.0 \n */\nfloat czm_luminance(vec3 rgb)\n{\n // Algorithm from Chapter 10 of Graphics Shaders.\n const vec3 W = vec3(0.2125, 0.7154, 0.0721);\n return dot(rgb, W);\n}\n",czm_metersPerPixel:"/**\n * Computes the size of a pixel in meters at a distance from the eye.\n * <p>\n * Use this version when passing in a custom pixel ratio. For example, passing in 1.0 will return meters per native device pixel.\n * </p>\n * @name czm_metersPerPixel\n * @glslFunction\n *\n * @param {vec3} positionEC The position to get the meters per pixel in eye coordinates.\n * @param {float} pixelRatio The scaling factor from pixel space to coordinate space\n *\n * @returns {float} The meters per pixel at positionEC.\n */\nfloat czm_metersPerPixel(vec4 positionEC, float pixelRatio)\n{\n float width = czm_viewport.z;\n float height = czm_viewport.w;\n float pixelWidth;\n float pixelHeight;\n\n float top = czm_frustumPlanes.x;\n float bottom = czm_frustumPlanes.y;\n float left = czm_frustumPlanes.z;\n float right = czm_frustumPlanes.w;\n\n if (czm_sceneMode == czm_sceneMode2D || czm_orthographicIn3D == 1.0)\n {\n float frustumWidth = right - left;\n float frustumHeight = top - bottom;\n pixelWidth = frustumWidth / width;\n pixelHeight = frustumHeight / height;\n }\n else\n {\n float distanceToPixel = -positionEC.z;\n float inverseNear = 1.0 / czm_currentFrustum.x;\n float tanTheta = top * inverseNear;\n pixelHeight = 2.0 * distanceToPixel * tanTheta / height;\n tanTheta = right * inverseNear;\n pixelWidth = 2.0 * distanceToPixel * tanTheta / width;\n }\n\n return max(pixelWidth, pixelHeight) * pixelRatio;\n}\n\n/**\n * Computes the size of a pixel in meters at a distance from the eye.\n * <p>\n * Use this version when scaling by pixel ratio.\n * </p>\n * @name czm_metersPerPixel\n * @glslFunction\n *\n * @param {vec3} positionEC The position to get the meters per pixel in eye coordinates.\n *\n * @returns {float} The meters per pixel at positionEC.\n */\nfloat czm_metersPerPixel(vec4 positionEC)\n{\n return czm_metersPerPixel(positionEC, czm_pixelRatio);\n}\n",czm_modelToWindowCoordinates:"/**\n * Transforms a position from model to window coordinates. The transformation\n * from model to clip coordinates is done using {@link czm_modelViewProjection}.\n * The transform from normalized device coordinates to window coordinates is\n * done using {@link czm_viewportTransformation}, which assumes a depth range\n * of <code>near = 0</code> and <code>far = 1</code>.\n * <br /><br />\n * This transform is useful when there is a need to manipulate window coordinates\n * in a vertex shader as done by {@link BillboardCollection}.\n * <br /><br />\n * This function should not be confused with {@link czm_viewportOrthographic},\n * which is an orthographic projection matrix that transforms from window \n * coordinates to clip coordinates.\n *\n * @name czm_modelToWindowCoordinates\n * @glslFunction\n *\n * @param {vec4} position The position in model coordinates to transform.\n *\n * @returns {vec4} The transformed position in window coordinates.\n *\n * @see czm_eyeToWindowCoordinates\n * @see czm_modelViewProjection\n * @see czm_viewportTransformation\n * @see czm_viewportOrthographic\n * @see BillboardCollection\n *\n * @example\n * vec4 positionWC = czm_modelToWindowCoordinates(positionMC);\n */\nvec4 czm_modelToWindowCoordinates(vec4 position)\n{\n vec4 q = czm_modelViewProjection * position; // clip coordinates\n q.xyz /= q.w; // normalized device coordinates\n q.xyz = (czm_viewportTransformation * vec4(q.xyz, 1.0)).xyz; // window coordinates\n return q;\n}\n",czm_multiplyWithColorBalance:"/**\n * DOC_TBA\n *\n * @name czm_multiplyWithColorBalance\n * @glslFunction\n */\nvec3 czm_multiplyWithColorBalance(vec3 left, vec3 right)\n{\n // Algorithm from Chapter 10 of Graphics Shaders.\n const vec3 W = vec3(0.2125, 0.7154, 0.0721);\n \n vec3 target = left * right;\n float leftLuminance = dot(left, W);\n float rightLuminance = dot(right, W);\n float targetLuminance = dot(target, W);\n \n return ((leftLuminance + rightLuminance) / (2.0 * targetLuminance)) * target;\n}\n",czm_nearFarScalar:"/**\n * Computes a value that scales with distance. The scaling is clamped at the near and\n * far distances, and does not extrapolate. This function works with the\n * {@link NearFarScalar} JavaScript class.\n *\n * @name czm_nearFarScalar\n * @glslFunction\n *\n * @param {vec4} nearFarScalar A vector with 4 components: Near distance (x), Near value (y), Far distance (z), Far value (w).\n * @param {float} cameraDistSq The square of the current distance from the camera.\n *\n * @returns {float} The value at this distance.\n */\nfloat czm_nearFarScalar(vec4 nearFarScalar, float cameraDistSq)\n{\n float valueAtMin = nearFarScalar.y;\n float valueAtMax = nearFarScalar.w;\n float nearDistanceSq = nearFarScalar.x * nearFarScalar.x;\n float farDistanceSq = nearFarScalar.z * nearFarScalar.z;\n\n float t = (cameraDistSq - nearDistanceSq) / (farDistanceSq - nearDistanceSq);\n\n t = pow(clamp(t, 0.0, 1.0), 0.2);\n\n return mix(valueAtMin, valueAtMax, t);\n}\n",czm_octDecode:" /**\n * Decodes a unit-length vector in 'oct' encoding to a normalized 3-component Cartesian vector.\n * The 'oct' encoding is described in \"A Survey of Efficient Representations of Independent Unit Vectors\",\n *\n * @name czm_octDecode\n * @param {vec2} encoded The oct-encoded, unit-length vector\n * @param {float} range The maximum value of the SNORM range. The encoded vector is stored in log2(rangeMax+1) bits.\n * @returns {vec3} The decoded and normalized vector\n */\n vec3 czm_octDecode(vec2 encoded, float range)\n {\n if (encoded.x == 0.0 && encoded.y == 0.0) {\n return vec3(0.0, 0.0, 0.0);\n }\n\n encoded = encoded / range * 2.0 - 1.0;\n vec3 v = vec3(encoded.x, encoded.y, 1.0 - abs(encoded.x) - abs(encoded.y));\n if (v.z < 0.0)\n {\n v.xy = (1.0 - abs(v.yx)) * czm_signNotZero(v.xy);\n }\n\n return normalize(v);\n }\n\n/**\n * Decodes a unit-length vector in 'oct' encoding to a normalized 3-component Cartesian vector.\n * The 'oct' encoding is described in \"A Survey of Efficient Representations of Independent Unit Vectors\",\n *\n * @name czm_octDecode\n * @param {vec2} encoded The oct-encoded, unit-length vector\n * @returns {vec3} The decoded and normalized vector\n */\n vec3 czm_octDecode(vec2 encoded)\n {\n return czm_octDecode(encoded, 255.0);\n }\n\n /**\n * Decodes a unit-length vector in 'oct' encoding packed into a floating-point number to a normalized 3-component Cartesian vector.\n * The 'oct' encoding is described in \"A Survey of Efficient Representations of Independent Unit Vectors\",\n *\n * @name czm_octDecode\n * @param {float} encoded The oct-encoded, unit-length vector\n * @returns {vec3} The decoded and normalized vector\n */\n vec3 czm_octDecode(float encoded)\n {\n float temp = encoded / 256.0;\n float x = floor(temp);\n float y = (temp - x) * 256.0;\n return czm_octDecode(vec2(x, y));\n }\n\n/**\n * Decodes three unit-length vectors in 'oct' encoding packed into two floating-point numbers to normalized 3-component Cartesian vectors.\n * The 'oct' encoding is described in \"A Survey of Efficient Representations of Independent Unit Vectors\",\n *\n * @name czm_octDecode\n * @param {vec2} encoded The packed oct-encoded, unit-length vectors.\n * @param {vec3} vector1 One decoded and normalized vector.\n * @param {vec3} vector2 One decoded and normalized vector.\n * @param {vec3} vector3 One decoded and normalized vector.\n */\n void czm_octDecode(vec2 encoded, out vec3 vector1, out vec3 vector2, out vec3 vector3)\n {\n float temp = encoded.x / 65536.0;\n float x = floor(temp);\n float encodedFloat1 = (temp - x) * 65536.0;\n\n temp = encoded.y / 65536.0;\n float y = floor(temp);\n float encodedFloat2 = (temp - y) * 65536.0;\n\n vector1 = czm_octDecode(encodedFloat1);\n vector2 = czm_octDecode(encodedFloat2);\n vector3 = czm_octDecode(vec2(x, y));\n }\n\n",czm_packDepth:"/**\n * Packs a depth value into a vec3 that can be represented by unsigned bytes.\n *\n * @name czm_packDepth\n * @glslFunction\n *\n * @param {float} depth The floating-point depth.\n * @returns {vec3} The packed depth.\n */\nvec4 czm_packDepth(float depth)\n{\n // See Aras Pranckevičius' post Encoding Floats to RGBA\n // http://aras-p.info/blog/2009/07/30/encoding-floats-to-rgba-the-final/\n vec4 enc = vec4(1.0, 255.0, 65025.0, 16581375.0) * depth;\n enc = fract(enc);\n enc -= enc.yzww * vec4(1.0 / 255.0, 1.0 / 255.0, 1.0 / 255.0, 0.0);\n return enc;\n}\n",czm_packValue:"/**\n * Packs a float value into a vec3 that can be represented by unsigned bytes.\n *\n * @name czm_packValue\n * @glslFunction\n *\n * @param {float} value The floating-point value.\n * @returns {vec3} The packed value.\n */\nvec4 czm_packValue(float value)\n{\n float SHIFT_LEFT8 = 256.0;\n\tfloat SHIFT_RIGHT8 = 1.0 / 256.0;\n\tvec4 result;\n\tresult.a = 255.0;\n\tfloat fPos = abs(value + 9000.0) * SHIFT_RIGHT8;\n\tresult.b = (fPos - floor(fPos)) * SHIFT_LEFT8;\n\tfPos = floor(fPos) * SHIFT_RIGHT8;\n\tresult.g = (fPos - floor(fPos)) * SHIFT_LEFT8;\n\tresult.r = floor(fPos);\n\tresult /= 255.0;\n\treturn result;\n}\n",czm_phong:"float czm_private_getLambertDiffuseOfMaterial(vec3 lightDirectionEC, czm_material material)\n{\n return czm_getLambertDiffuse(lightDirectionEC, material.normal);\n}\n\nfloat czm_private_getSpecularOfMaterial(vec3 lightDirectionEC, vec3 toEyeEC, czm_material material)\n{\n return czm_getSpecular(lightDirectionEC, toEyeEC, material.normal, material.shininess);\n}\n\n/**\n * Computes a color using the Phong lighting model.\n *\n * @name czm_phong\n * @glslFunction\n *\n * @param {vec3} toEye A normalized vector from the fragment to the eye in eye coordinates.\n * @param {czm_material} material The fragment's material.\n *\n * @returns {vec4} The computed color.\n *\n * @example\n * vec3 positionToEyeEC = // ...\n * czm_material material = // ...\n * vec3 lightDirectionEC = // ...\n * gl_FragColor = czm_phong(normalize(positionToEyeEC), material, lightDirectionEC);\n *\n * @see czm_getMaterial\n */\nvec4 czm_phong(vec3 toEye, czm_material material, vec3 lightDirectionEC)\n{\n // Diffuse from directional light sources at eye (for top-down)\n float diffuse = czm_private_getLambertDiffuseOfMaterial(vec3(0.0, 0.0, 1.0), material);\n if (czm_sceneMode == czm_sceneMode3D) {\n // (and horizon views in 3D)\n diffuse += czm_private_getLambertDiffuseOfMaterial(vec3(0.0, 1.0, 0.0), material);\n }\n\n float specular = czm_private_getSpecularOfMaterial(lightDirectionEC, toEye, material);\n\n // Temporary workaround for adding ambient.\n vec3 materialDiffuse = material.diffuse * 0.5;\n\n vec3 ambient = materialDiffuse;\n vec3 color = ambient + material.emission;\n color += materialDiffuse * diffuse * czm_lightColor;\n color += material.specular * specular * czm_lightColor;\n\n return vec4(color, material.alpha);\n}\n\nvec4 czm_private_phong(vec3 toEye, czm_material material, vec3 lightDirectionEC)\n{\n float diffuse = czm_private_getLambertDiffuseOfMaterial(lightDirectionEC, material);\n float specular = czm_private_getSpecularOfMaterial(lightDirectionEC, toEye, material);\n\n vec3 ambient = vec3(0.0);\n vec3 color = ambient + material.emission;\n color += material.diffuse * diffuse * czm_lightColor;\n color += material.specular * specular * czm_lightColor;\n\n return vec4(color, material.alpha);\n}\n",czm_planeDistance:"/**\n * Computes distance from a point to a plane.\n *\n * @name czm_planeDistance\n * @glslFunction\n *\n * param {vec4} plane A Plane in Hessian Normal Form. See Plane.js\n * param {vec3} point A point in the same space as the plane.\n * returns {float} The distance from the point to the plane.\n */\nfloat czm_planeDistance(vec4 plane, vec3 point) {\n return (dot(plane.xyz, point) + plane.w);\n}\n\n/**\n * Computes distance from a point to a plane.\n *\n * @name czm_planeDistance\n * @glslFunction\n *\n * param {vec3} planeNormal Normal for a plane in Hessian Normal Form. See Plane.js\n * param {float} planeDistance Distance for a plane in Hessian Normal form. See Plane.js\n * param {vec3} point A point in the same space as the plane.\n * returns {float} The distance from the point to the plane.\n */\nfloat czm_planeDistance(vec3 planeNormal, float planeDistance, vec3 point) {\n return (dot(planeNormal, point) + planeDistance);\n}\n",czm_pointAlongRay:"/**\n * Computes the point along a ray at the given time. <code>time</code> can be positive, negative, or zero.\n *\n * @name czm_pointAlongRay\n * @glslFunction\n *\n * @param {czm_ray} ray The ray to compute the point along.\n * @param {float} time The time along the ray.\n * \n * @returns {vec3} The point along the ray at the given time.\n * \n * @example\n * czm_ray ray = czm_ray(vec3(0.0), vec3(1.0, 0.0, 0.0)); // origin, direction\n * vec3 v = czm_pointAlongRay(ray, 2.0); // (2.0, 0.0, 0.0)\n */\nvec3 czm_pointAlongRay(czm_ray ray, float time)\n{\n return ray.origin + (time * ray.direction);\n}\n",czm_rayEllipsoidIntersectionInterval:"/**\n * DOC_TBA\n *\n * @name czm_rayEllipsoidIntersectionInterval\n * @glslFunction\n */\nczm_raySegment czm_rayEllipsoidIntersectionInterval(czm_ray ray, vec3 ellipsoid_center, vec3 ellipsoid_inverseRadii)\n{\n // ray and ellipsoid center in eye coordinates. radii in model coordinates.\n vec3 q = ellipsoid_inverseRadii * (czm_inverseModelView * vec4(ray.origin, 1.0)).xyz;\n vec3 w = ellipsoid_inverseRadii * (czm_inverseModelView * vec4(ray.direction, 0.0)).xyz;\n\n q = q - ellipsoid_inverseRadii * (czm_inverseModelView * vec4(ellipsoid_center, 1.0)).xyz;\n\n float q2 = dot(q, q);\n float qw = dot(q, w);\n\n if (q2 > 1.0) // Outside ellipsoid.\n {\n if (qw >= 0.0) // Looking outward or tangent (0 intersections).\n {\n return czm_emptyRaySegment;\n }\n else // qw < 0.0.\n {\n float qw2 = qw * qw;\n float difference = q2 - 1.0; // Positively valued.\n float w2 = dot(w, w);\n float product = w2 * difference;\n\n if (qw2 < product) // Imaginary roots (0 intersections).\n {\n return czm_emptyRaySegment;\n }\n else if (qw2 > product) // Distinct roots (2 intersections).\n {\n float discriminant = qw * qw - product;\n float temp = -qw + sqrt(discriminant); // Avoid cancellation.\n float root0 = temp / w2;\n float root1 = difference / temp;\n if (root0 < root1)\n {\n czm_raySegment i = czm_raySegment(root0, root1);\n return i;\n }\n else\n {\n czm_raySegment i = czm_raySegment(root1, root0);\n return i;\n }\n }\n else // qw2 == product. Repeated roots (2 intersections).\n {\n float root = sqrt(difference / w2);\n czm_raySegment i = czm_raySegment(root, root);\n return i;\n }\n }\n }\n else if (q2 < 1.0) // Inside ellipsoid (2 intersections).\n {\n float difference = q2 - 1.0; // Negatively valued.\n float w2 = dot(w, w);\n float product = w2 * difference; // Negatively valued.\n float discriminant = qw * qw - product;\n float temp = -qw + sqrt(discriminant); // Positively valued.\n czm_raySegment i = czm_raySegment(0.0, temp / w2);\n return i;\n }\n else // q2 == 1.0. On ellipsoid.\n {\n if (qw < 0.0) // Looking inward.\n {\n float w2 = dot(w, w);\n czm_raySegment i = czm_raySegment(0.0, -qw / w2);\n return i;\n }\n else // qw >= 0.0. Looking outward or tangent.\n {\n return czm_emptyRaySegment;\n }\n }\n}\n",czm_readDepth:"float czm_readDepth(sampler2D depthTexture, vec2 texCoords)\n{\n return czm_reverseLogDepth(texture2D(depthTexture, texCoords).r);\n}\n",czm_readNonPerspective:"/**\n * Reads a value previously transformed with {@link czm_writeNonPerspective}\n * by dividing it by `w`, the value used in the perspective divide.\n * This function is intended to be called in a fragment shader to access a\n * `varying` that should not be subject to perspective interpolation.\n * For example, screen-space texture coordinates. The value should have been\n * previously written in the vertex shader with a call to\n * {@link czm_writeNonPerspective}.\n *\n * @name czm_readNonPerspective\n * @glslFunction\n *\n * @param {float|vec2|vec3|vec4} value The non-perspective value to be read.\n * @param {float} oneOverW One over the perspective divide value, `w`. Usually this is simply `gl_FragCoord.w`.\n * @returns {float|vec2|vec3|vec4} The usable value.\n */\nfloat czm_readNonPerspective(float value, float oneOverW) {\n return value * oneOverW;\n}\n\nvec2 czm_readNonPerspective(vec2 value, float oneOverW) {\n return value * oneOverW;\n}\n\nvec3 czm_readNonPerspective(vec3 value, float oneOverW) {\n return value * oneOverW;\n}\n\nvec4 czm_readNonPerspective(vec4 value, float oneOverW) {\n return value * oneOverW;\n}\n",czm_reverseLogDepth:"float czm_reverseLogDepth(float logZ)\n{\n#ifdef LOG_DEPTH\n float near = czm_currentFrustum.x;\n float far = czm_currentFrustum.y;\n float log2Depth = logZ * czm_log2FarDepthFromNearPlusOne;\n float depthFromNear = pow(2.0, log2Depth) - 1.0;\n return far * (1.0 - near / (depthFromNear + near)) / (far - near);\n#endif\n return logZ;\n}\n",czm_RGBToHSB:"/**\n * Converts an RGB color to HSB (hue, saturation, brightness)\n *\n * @name czm_RGBToHSB\n * @glslFunction\n * \n * @param {vec3} rgb The color in RGB.\n *\n * @returns {vec3} The color in HSB.\n *\n * @example\n * vec3 hsb = czm_RGBToHSB(rgb);\n * hsb.z *= 0.1;\n * rgb = czm_HSBToRGB(hsb);\n */\n\nconst vec4 K_RGB2HSB = vec4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0);\n\nvec3 czm_RGBToHSB(vec3 rgb)\n{\n vec4 p = mix(vec4(rgb.bg, K_RGB2HSB.wz), vec4(rgb.gb, K_RGB2HSB.xy), step(rgb.b, rgb.g));\n vec4 q = mix(vec4(p.xyw, rgb.r), vec4(rgb.r, p.yzx), step(p.x, rgb.r));\n\n float d = q.x - min(q.w, q.y);\n return vec3(abs(q.z + (q.w - q.y) / (6.0 * d + czm_epsilon7)), d / (q.x + czm_epsilon7), q.x);\n}\n",czm_RGBToHSL:"/**\n * Converts an RGB color to HSL (hue, saturation, lightness)\n *\n * @name czm_RGBToHSL\n * @glslFunction\n * \n * @param {vec3} rgb The color in RGB.\n *\n * @returns {vec3} The color in HSL.\n *\n * @example\n * vec3 hsl = czm_RGBToHSL(rgb);\n * hsl.z *= 0.1;\n * rgb = czm_HSLToRGB(hsl);\n */\n \nvec3 RGBtoHCV(vec3 rgb)\n{\n // Based on work by Sam Hocevar and Emil Persson\n vec4 p = (rgb.g < rgb.b) ? vec4(rgb.bg, -1.0, 2.0 / 3.0) : vec4(rgb.gb, 0.0, -1.0 / 3.0);\n vec4 q = (rgb.r < p.x) ? vec4(p.xyw, rgb.r) : vec4(rgb.r, p.yzx);\n float c = q.x - min(q.w, q.y);\n float h = abs((q.w - q.y) / (6.0 * c + czm_epsilon7) + q.z);\n return vec3(h, c, q.x);\n}\n\nvec3 czm_RGBToHSL(vec3 rgb)\n{\n vec3 hcv = RGBtoHCV(rgb);\n float l = hcv.z - hcv.y * 0.5;\n float s = hcv.y / (1.0 - abs(l * 2.0 - 1.0) + czm_epsilon7);\n return vec3(hcv.x, s, l);\n}\n",czm_RGBToXYZ:"/**\n * Converts an RGB color to CIE Yxy.\n * <p>The conversion is described in\n * </p>\n * \n * @name czm_RGBToXYZ\n * @glslFunction\n * \n * @param {vec3} rgb The color in RGB.\n *\n * @returns {vec3} The color in CIE Yxy.\n *\n * @example\n * vec3 xyz = czm_RGBToXYZ(rgb);\n * xyz.x = max(xyz.x - luminanceThreshold, 0.0);\n * rgb = czm_XYZToRGB(xyz);\n */\nvec3 czm_RGBToXYZ(vec3 rgb)\n{\n const mat3 RGB2XYZ = mat3(0.4124, 0.2126, 0.0193,\n 0.3576, 0.7152, 0.1192,\n 0.1805, 0.0722, 0.9505);\n vec3 xyz = RGB2XYZ * rgb;\n vec3 Yxy;\n Yxy.r = xyz.g;\n float temp = dot(vec3(1.0), xyz);\n Yxy.gb = xyz.rg / temp;\n return Yxy;\n}\n",czm_RollerShutter:"void czm_RollerShutter(vec2 coord, vec4 region)\n{\nvec2 f = step(region.xw, coord);\nvec2 s = step(coord, region.zy);\nif (f.x * f.y * s.x * s.y < 1.0)\n{\ndiscard;\n};\n}\n",czm_s3mBatchOperation:"void czm_s3mBatchOperation(vec4 operationType, vec4 color, vec4 selectedColor, inout vec4 vertexColor, inout vec4 vertexPos, inout vec4 vIsFiltByID, vec3 translation)\n{\n float right_2 = operationType.x * 0.5;\n float right_4 = right_2 * 0.5;\n float right_8 = right_4 * 0.5;\n float right_16 = right_8 * 0.5;\n float isSetColor = fract(right_2);\n if(isSetColor > 0.1)\n {\n vertexColor *= color;\n }\n float isPicked = fract(floor(right_2)* 0.5);\n if(isPicked > 0.1)\n {\n vertexColor *= selectedColor;\n }\n float isHide = fract(floor(right_4)* 0.5);\n if(isHide > 0.1)\n {\n vertexColor.a = 0.0;\n }\n float isOffset = fract(floor(right_8)* 0.5);\n if(isOffset > 0.1)\n {\n vertexPos.xyz += translation;\n }\n float isClip = fract(floor(right_16) * 0.5);\n if(isClip > 0.1)\n {\n vIsFiltByID.x = 1.0;\n }\n}\n\nvoid czm_s3mBatchOperation(vec4 operationType, vec4 color, inout vec4 vertexColor, inout vec4 vertexPos, inout vec4 vIsFiltByID, vec3 translation, inout float fSelected)\n{\n float right_2 = operationType.x * 0.5;\n float right_4 = right_2 * 0.5;\n float right_8 = right_4 * 0.5;\n float right_16 = right_8 * 0.5;\n float isSetColor = fract(right_2);\n if(isSetColor > 0.1)\n {\n vertexColor *= color;\n }\n float isPicked = fract(floor(right_2)* 0.5);\n if(isPicked > 0.1)\n {\n fSelected = 1.0;\n }\n float isHide = fract(floor(right_4)* 0.5);\n if(isHide > 0.1)\n {\n vertexColor.a = 0.0;\n }\n float isOffset = fract(floor(right_8)* 0.5);\n if(isOffset > 0.1)\n {\n vertexPos.xyz += translation;\n }\n float isClip = fract(floor(right_16) * 0.5);\n if(isClip > 0.1)\n {\n vIsFiltByID.x = 1.0;\n }\n}\n\nvoid czm_s3mBatchOperation(vec4 operationType, vec4 color, vec4 selectedColor, inout vec4 vertexColor, inout vec4 vertexPos, inout vec4 vIsFiltByID, vec3 translation, inout float fSelected)\n{\n float right_2 = operationType.x * 0.5;\n float right_4 = right_2 * 0.5;\n float right_8 = right_4 * 0.5;\n float right_16 = right_8 * 0.5;\n float isSetColor = fract(right_2);\n if(isSetColor > 0.1)\n {\n fSelected = 1.0;\n vertexColor = color;\n }\n float isPicked = fract(floor(right_2)* 0.5);\n if(isPicked > 0.1)\n {\n fSelected = 1.0;\n #ifdef REPLACE_SELECT_TYPE\n vertexColor = selectedColor;\n #else\n vertexColor *= selectedColor;\n #endif\n }\n float isHide = fract(floor(right_4)* 0.5);\n if(isHide > 0.1)\n {\n vertexColor.a = 0.0;\n }\n float isOffset = fract(floor(right_8)* 0.5);\n if(isOffset > 0.1)\n {\n vertexPos.xyz += translation;\n }\n float isClip = fract(floor(right_16) * 0.5);\n if(isClip > 0.1)\n {\n vIsFiltByID.x = 1.0;\n }\n}\n\nvoid czm_s3mBatchOperation(vec4 operationType, vec4 color, vec4 selectedColor, inout vec4 vertexColor)\n{\n float right_2 = operationType.x * 0.5;\n float right_4 = right_2 * 0.5;\n float right_8 = right_4 * 0.5;\n float right_16 = right_8 * 0.5;\n float isSetColor = fract(right_2);\n if(isSetColor > 0.1)\n {\n vertexColor *= color;\n }\n float isPicked = fract(floor(right_2)* 0.5);\n if(isPicked > 0.1)\n {\n vertexColor *= selectedColor;\n }\n float isHide = fract(floor(right_4)* 0.5);\n if(isHide > 0.1)\n {\n vertexColor.a = 0.0;\n }\n}\n\nvoid czm_s3mBatchOperation(vec4 operationType, vec4 color, vec4 selectedColor, inout vec4 vertexColor, inout float fSelected)\n{\n float right_2 = operationType.x * 0.5;\n float right_4 = right_2 * 0.5;\n float right_8 = right_4 * 0.5;\n float right_16 = right_8 * 0.5;\n float isSetColor = fract(right_2);\n if(isSetColor > 0.1)\n {\n fSelected = 1.0;\n vertexColor = color;\n }\n float isPicked = fract(floor(right_2)* 0.5);\n if(isPicked > 0.1)\n {\n fSelected = 1.0;\n vertexColor = selectedColor;\n }\n float isHide = fract(floor(right_4)* 0.5);\n if(isHide > 0.1)\n {\n vertexColor.a = 0.0;\n }\n}\n",czm_S3MPBR:" uniform float u_metallicFactor;\n uniform float u_roughnessFactor;\n uniform vec4 u_emissiveFactor;\n uniform vec4 u_baseColorFactor;\n uniform float u_alphaCutoff;\n uniform sampler2D u_baseColorTexture;\n uniform sampler2D u_metallicRoughnessTexture;\n uniform sampler2D u_normalTexture;\n uniform sampler2D u_occlusionTexture;\n uniform sampler2D u_emissiveTexture;\n uniform vec4 u_baseColorUVOffsetAndTiling;\n uniform vec4 u_emissiveUVOffsetAndTiling;\n\n uniform float uSunLightON;\n #if DIR_LIGHTS > 0\n uniform vec3 uDirectionalLightDirectionEC[ DIR_LIGHTS ];\n uniform vec3 uDirectionalLightColor[ DIR_LIGHTS ];\n #endif\n #if POINT_LIGHTS > 0\n uniform vec3 uPointLightPositionEC[ POINT_LIGHTS ];\n uniform vec3 uPointLightColor[ POINT_LIGHTS ];\n uniform vec2 uPointLightDistanceAndDecay[ POINT_LIGHTS ];\n #endif\n #if SPOT_LIGHTS > 0\n uniform vec3 uSpotLightColor[ SPOT_LIGHTS ];\n uniform vec3 uSpotLightPositionEC[ SPOT_LIGHTS ];\n uniform vec3 uSpotLightDirectionEC[ SPOT_LIGHTS ];\n uniform vec3 uSpotLightDistanceDecayCos[ SPOT_LIGHTS ];\n uniform vec3 uSpotLightExponent[ SPOT_LIGHTS ];\n #endif\n\n const float M_PI = 3.141592653589793;\n\n vec3 lambertianDiffuse(vec3 diffuseColor)\n {\n return diffuseColor / M_PI;\n }\n\n vec3 fresnelSchlick2(vec3 f0, vec3 f90, float VdotH)\n {\n return f0 + (f90 - f0) * pow(clamp(1.0 - VdotH, 0.0, 1.0), 5.0);\n }\n\n vec3 fresnelSchlick(float metalness, float VdotH)\n {\n return metalness + (vec3(1.0) - metalness) * pow(1.0 - VdotH, 5.0);\n }\n\n vec3 F_Schlick(float ndv, vec3 spec)\n {\n return spec + (vec3(1.0) - spec) * pow(1.0 - ndv, 5.0);\n }\n\n float D_Phong(float g, float ndh)\n {\n float a = pow(8192.0, g);\n return (a + 2.0) / 8.0 * pow(ndh, a);\n }\n\n float smithVisibilityG1(float NdotV, float roughness)\n {\n float k = (roughness + 1.0) * (roughness + 1.0) / 8.0;\n return NdotV / (NdotV * (1.0 - k) + k);\n }\n\n float smithVisibilityGGX(float roughness, float NdotL, float NdotV)\n {\n return smithVisibilityG1(NdotL, roughness) * smithVisibilityG1(NdotV, roughness);\n }\n\n float GGX(float roughness, float NdotH)\n {\n float roughnessSquared = roughness * roughness;\n float f = (NdotH * roughnessSquared - NdotH) * NdotH + 1.0;\n return roughnessSquared / (M_PI * f * f);\n }\n\n void getLightColor(vec3 lightDir, vec3 viewDir, vec3 normal, vec3 lightColor, vec3 fresnelTerm, float roughness, out vec3 diffuseTerm, out vec3 specularTerm)\n {\n vec3 h = normalize(viewDir + lightDir);\n float NdotL = clamp(dot(normal, lightDir), 0.001, 1.0);\n float NdotH = clamp(dot(normal, h), 0.0, 1.0);\n vec3 li = lightColor * NdotL;\n diffuseTerm = li;\n specularTerm = li * fresnelTerm * D_Phong(1.0 - roughness, NdotH);\n }\n\n vec3 SRGBtoLINEAR3(vec3 srgbIn)\n {\n return pow(srgbIn, vec3(2.2));\n }\n\n vec4 SRGBtoLINEAR4(vec4 srgbIn)\n {\n vec3 linearOut = pow(srgbIn.rgb, vec3(2.2));\n return vec4(linearOut, srgbIn.a);\n }\n\n vec3 LINEARtoSRGB(vec3 linearIn)\n {\n#ifndef HDR\n return pow(linearIn, vec3(1.0/2.2));\n#else\n return linearIn;\n#endif\n }\n\n float calcLightAttenuation(float lightDistance, float cutoffDistance, float decayExponent)\n {\n return pow(clamp(1.0 - lightDistance / cutoffDistance, 0.0, 1.0), decayExponent);\n }\n\n vec4 czm_S3MPBR(vec3 normalEC, vec3 positionEC, vec2 texCoord, vec4 vertexColor)\n {\n vec3 ng = normalize(normalEC);\n vec3 positionWC = (czm_inverseView * vec4(positionEC, 1.0)).xyz;\n#ifdef HAS_NORMAL_TEXTURE\n vec3 pos_dx = dFdx(positionEC);\n vec3 pos_dy = dFdy(positionEC);\n vec3 tex_dx = dFdx(vec3(texCoord, 0.0));\n vec3 tex_dy = dFdy(vec3(texCoord, 0.0));\n vec3 t = (tex_dy.t * pos_dx - tex_dx.t * pos_dy) / (tex_dx.s * tex_dy.t - tex_dy.s * tex_dx.t);\n t = normalize(t - ng * dot(ng, t));\n vec3 b = normalize(cross(ng, t));\n mat3 tbn = mat3(t, b, ng);\n vec3 n = texture2D(u_normalTexture, texCoord).rgb;\n n = normalize(tbn * (2.0 * n - 1.0));\n#else\n vec3 n = ng;\n#endif\n\n vec3 v = -normalize(positionEC);\n#ifdef DOUBLE_SIDED\n if (dot(n, v) < 0.0) {\n n = -n;\n }\n#endif\n\n // Add base color to fragment shader\n#ifdef HAS_BASECOLOR_TEXTURE\n vec2 baseColorTexCoord = texCoord;\n baseColorTexCoord = baseColorTexCoord * u_baseColorUVOffsetAndTiling.zw + u_baseColorUVOffsetAndTiling.xy;\n vec4 baseColorWithAlpha = SRGBtoLINEAR4(texture2D(u_baseColorTexture, baseColorTexCoord));\n baseColorWithAlpha *= u_baseColorFactor;\n#else\n vec4 baseColorWithAlpha = u_baseColorFactor;\n#endif\n baseColorWithAlpha *= vertexColor;\n vec3 baseColor = baseColorWithAlpha.rgb;\n#ifdef HAS_METALLICROUGHNESS_TEXTURE\n vec3 metallicRoughness = texture2D(u_metallicRoughnessTexture, texCoord).rgb;\n float metalness = clamp(metallicRoughness.b, 0.0, 1.0);\n float roughness = clamp(metallicRoughness.g, 0.04, 1.0);\n metalness *= u_metallicFactor;\n roughness *= u_roughnessFactor;\n#else\n float metalness = clamp(u_metallicFactor, 0.0, 1.0);\n float roughness = clamp(u_roughnessFactor, 0.04, 1.0);\n#endif\n vec3 f0 = vec3(0.04);\n vec3 diffuseColor = baseColor * (1.0 - metalness) * (1.0 - f0);\n vec3 specularColor = mix(f0, baseColor, metalness);\n float NdotV = abs(dot(n, v)) + 0.001;\n vec3 diffuseTerm = vec3(0.0);\n vec3 specularTerm = vec3(0.0);\n vec3 fresnelTerm = F_Schlick(NdotV, specularColor);\n vec3 color = vec3(0.0);\n // 默认加一个平行光作为太阳光\n vec3 lightDiffuseTerm = vec3(0.0);\n vec3 lightSpecularTerm = vec3(0.0);\n getLightColor(czm_sunDirectionEC, v, n, vec3(0.8), fresnelTerm, roughness, lightDiffuseTerm, lightSpecularTerm);\n diffuseTerm +=lightDiffuseTerm * uSunLightON;\n specularTerm += lightSpecularTerm * uSunLightON;\n#if DIR_LIGHTS > 0 \n for (int i = 0; i < DIR_LIGHTS; i++) { \n getLightColor(uDirectionalLightDirectionEC[i], v, n, uDirectionalLightColor[i], fresnelTerm, roughness, lightDiffuseTerm, lightSpecularTerm);\n diffuseTerm +=lightDiffuseTerm;\n specularTerm += lightSpecularTerm;\n } \n#endif \n#if POINT_LIGHTS > 0 \n for (int i = 0; i < POINT_LIGHTS; i++) { \n vec3 lVector = uPointLightPositionEC[i] - v_positionEC;\n float lightDistance = length(lVector);\n float lightAttenuation = calcLightAttenuation(lightDistance, uPointLightDistanceAndDecay[i].x, uPointLightDistanceAndDecay[i].y);\n if(lightAttenuation < 0.001) {\n continue;\n }\n vec3 pointLightColor = uPointLightColor[i] * lightAttenuation;\n vec3 lightDiffuseTerm = vec3(0.0);\n vec3 lightSpecularTerm = vec3(0.0);\n getLightColor(normalize(lVector), v, n, pointLightColor, fresnelTerm, roughness, lightDiffuseTerm, lightSpecularTerm);\n diffuseTerm +=lightDiffuseTerm;\n specularTerm += lightSpecularTerm;\n }\n#endif \n#if SPOT_LIGHTS > 0 \n for (int i = 0; i < SPOT_LIGHTS; i++) { \n vec3 lVector = uSpotLightPositionEC[i] - v_positionEC;\n float lightDistance = length(lVector);\n float lightAttenuation = calcLightAttenuation(lightDistance, uSpotLightDistanceDecayCos[i].x, uSpotLightDistanceDecayCos[i].y);\n if(lightAttenuation < 0.001) {\n continue;\n }\n float spotEffect = dot(uSpotLightDirectionEC[i], normalize(lVector));\n if(spotEffect > uSpotLightDistanceDecayCos[i].z) {\n vec3 spotLightColor = uSpotLightColor[i] * lightAttenuation * spotEffect;\n vec3 lightDiffuseTerm = vec3(0.0);\n vec3 lightSpecularTerm = vec3(0.0);\n getLightColor(normalize(lVector), v, n, spotLightColor, fresnelTerm, roughness, lightDiffuseTerm, lightSpecularTerm);\n diffuseTerm +=lightDiffuseTerm;\n specularTerm += lightSpecularTerm;\n }\n }\n#endif \n color = baseColor; \n color *= max(diffuseTerm, vec3(0.0)); \n color += max(specularTerm, vec3(0.0)); \n // 计算环境光\n #ifdef USE_IBL_LIGHTING\n vec3 r = normalize(czm_inverseViewRotation * normalize(reflect(v, n)));\n // Figure out if the reflection vector hits the ellipsoid\n float vertexRadius = length(positionWC);\n float horizonDotNadir = 1.0 - min(1.0, 6378137.0 / vertexRadius);\n float reflectionDotNadir = dot(r, normalize(positionWC));\n // Flipping the X vector is a cheap way to get the inverse of czm_temeToPseudoFixed, since that's a rotation about Z.\n r.x = -r.x;\n r = -normalize(czm_temeToPseudoFixed * r);\n r.x = -r.x;\n float inverseRoughness = 1.04 - roughness;\n inverseRoughness *= inverseRoughness;\n vec3 sceneSkyBox = textureCube(czm_environmentMap, r).rgb * inverseRoughness;\n float atmosphereHeight = 0.05;\n float blendRegionSize = 0.1 * ((1.0 - inverseRoughness) * 8.0 + 1.1 - horizonDotNadir);\n float blendRegionOffset = roughness * -1.0;\n float farAboveHorizon = clamp(horizonDotNadir - blendRegionSize * 0.5 + blendRegionOffset, 1.0e-10 - blendRegionSize, 0.99999);\n float aroundHorizon = clamp(horizonDotNadir + blendRegionSize * 0.5, 1.0e-10 - blendRegionSize, 0.99999);\n float farBelowHorizon = clamp(horizonDotNadir + blendRegionSize * 1.5, 1.0e-10 - blendRegionSize, 0.99999);\n float smoothstepHeight = smoothstep(0.0, atmosphereHeight, horizonDotNadir);\n vec3 belowHorizonColor = mix(vec3(0.1, 0.15, 0.25), vec3(0.4, 0.7, 0.9), smoothstepHeight);\n vec3 nadirColor = belowHorizonColor * 0.5;\n vec3 aboveHorizonColor = mix(vec3(0.9, 1.0, 1.2), belowHorizonColor, roughness * 0.5);\n vec3 blueSkyColor = mix(vec3(0.18, 0.26, 0.48), aboveHorizonColor, reflectionDotNadir * inverseRoughness * 0.5 + 0.75);\n vec3 zenithColor = mix(blueSkyColor, sceneSkyBox, smoothstepHeight);\n\n vec3 blueSkyDiffuseColor = vec3(0.7, 0.85, 0.9);\n float diffuseIrradianceFromEarth = (1.0 - horizonDotNadir) * (reflectionDotNadir * 0.25 + 0.75) * smoothstepHeight;\n float diffuseIrradianceFromSky = (1.0 - smoothstepHeight) * (1.0 - (reflectionDotNadir * 0.25 + 0.25));\n vec3 diffuseIrradiance = blueSkyDiffuseColor * clamp(diffuseIrradianceFromEarth + diffuseIrradianceFromSky, 0.0, 1.0);\n\n float notDistantRough = (1.0 - horizonDotNadir * roughness * 0.8);\n vec3 specularIrradiance = mix(zenithColor, aboveHorizonColor, smoothstep(farAboveHorizon, aroundHorizon, reflectionDotNadir) * notDistantRough);\n specularIrradiance = mix(specularIrradiance, belowHorizonColor, smoothstep(aroundHorizon, farBelowHorizon, reflectionDotNadir) * inverseRoughness);\n specularIrradiance = mix(specularIrradiance, nadirColor, smoothstep(farBelowHorizon, 1.0, reflectionDotNadir) * inverseRoughness);\n\n vec2 iblFactor = vec2(1.0);\n float luminanceAtZenith = 0.5;\n #ifdef USE_SUN_LUMINANCE\n // Angle between sun and zenith\n float LdotZenith = clamp(dot(normalize(czm_inverseViewRotation * czm_sunDirectionEC), normalize(positionWC * -1.0)), 0.001, 1.0);\n float S = acos(LdotZenith);\n // Angle between zenith and current pixel\n float NdotZenith = clamp(dot(normalize(czm_inverseViewRotation * n), normalize(positionWC * -1.0)), 0.001, 1.0);\n // Angle between sun and current pixel\n float sunNdotL = clamp(dot(n, czm_sunDirectionEC), 0.001, 1.0);\n float gamma = acos(sunNdotL);\n float numerator = ((0.91 + 10.0 * exp(-3.0 * gamma) + 0.45 * pow(sunNdotL, 2.0)) * (1.0 - exp(-0.32 / NdotZenith)));\n float denominator = (0.91 + 10.0 * exp(-3.0 * S) + 0.45 * pow(LdotZenith,2.0)) * (1.0 - exp(-0.32));\n float luminance = luminanceAtZenith * (numerator / denominator);\n#endif\n\n vec2 brdfLut = texture2D(czm_brdfLut, vec2(NdotV, 1.0 - roughness)).rg;\n vec3 IBLColor = (diffuseIrradiance * diffuseColor * iblFactor.x) + (specularIrradiance * SRGBtoLINEAR3(specularColor * brdfLut.x + brdfLut.y) * iblFactor.y);\n#ifdef USE_SUN_LUMINANCE\n color += IBLColor * luminance;\n#else\n color += IBLColor;\n#endif // end of USE_SUN_LUMINANCE\n#endif // end of USE_IBL_LIGHTING\n\n#ifdef HAS_OCCLUSION_TEXTURE\n color *= texture2D(u_occlusionTexture, texCoord).r;\n#endif\n\n#ifdef HAS_EMISSIVE_TEXTURE\n vec2 emissiveTexCoord = texCoord;\n emissiveTexCoord = emissiveTexCoord * u_emissiveUVOffsetAndTiling.zw + u_emissiveUVOffsetAndTiling.xy;\n vec3 emissive = SRGBtoLINEAR3(texture2D(u_emissiveTexture, emissiveTexCoord).rgb);\n emissive *= u_emissiveFactor.rgb;\n color += emissive;\n#else\n color += u_emissiveFactor.rgb;\n#endif\n color = LINEARtoSRGB(color);\n vec4 resultColor = vec4(color, 1.0);\n#ifdef MASK\n if (baseColorWithAlpha.a < u_alphaCutoff)\n {\n discard;\n }\n resultColor = vec4(color, 1.0);\n#endif\n#ifdef BLEND\n resultColor = vec4(color, baseColorWithAlpha.a);\n#endif\n return resultColor;\n }",czm_sampleOctahedralProjection:"/**\n * Samples the 4 neighboring pixels and return the weighted average.\n *\n * @private\n */\nvec3 czm_sampleOctahedralProjectionWithFiltering(sampler2D projectedMap, vec2 textureSize, vec3 direction, float lod)\n{\n direction /= dot(vec3(1.0), abs(direction));\n vec2 rev = abs(direction.zx) - vec2(1.0);\n vec2 neg = vec2(direction.x < 0.0 ? rev.x : -rev.x,\n direction.z < 0.0 ? rev.y : -rev.y);\n vec2 uv = direction.y < 0.0 ? neg : direction.xz;\n vec2 coord = 0.5 * uv + vec2(0.5);\n vec2 pixel = 1.0 / textureSize;\n\n if (lod > 0.0)\n {\n // Each subseqeuent mip level is half the size\n float scale = 1.0 / pow(2.0, lod);\n float offset = ((textureSize.y + 1.0) / textureSize.x);\n\n coord.x *= offset;\n coord *= scale;\n\n coord.x += offset + pixel.x;\n coord.y += (1.0 - (1.0 / pow(2.0, lod - 1.0))) + pixel.y * (lod - 1.0) * 2.0;\n }\n else\n {\n coord.x *= (textureSize.y / textureSize.x);\n }\n\n // Do bilinear filtering\n #ifndef OES_texture_float_linear\n vec3 color1 = texture2D(projectedMap, coord + vec2(0.0, pixel.y)).rgb;\n vec3 color2 = texture2D(projectedMap, coord + vec2(pixel.x, 0.0)).rgb;\n vec3 color3 = texture2D(projectedMap, coord + pixel).rgb;\n vec3 color4 = texture2D(projectedMap, coord).rgb;\n\n vec2 texturePosition = coord * textureSize;\n\n float fu = fract(texturePosition.x);\n float fv = fract(texturePosition.y);\n\n vec3 average1 = mix(color4, color2, fu);\n vec3 average2 = mix(color1, color3, fu);\n\n vec3 color = mix(average1, average2, fv);\n #else\n vec3 color = texture2D(projectedMap, coord).rgb;\n #endif\n\n return color;\n}\n\n\n/**\n * Samples from a cube map that has been projected using an octahedral projection from the given direction.\n *\n * @name czm_sampleOctahedralProjection\n * @glslFunction\n *\n * @param {sampler2D} projectedMap The texture with the octahedral projected cube map.\n * @param {vec2} textureSize The width and height dimensions in pixels of the projected map.\n * @param {vec3} direction The normalized direction used to sample the cube map.\n * @param {float} lod The level of detail to sample.\n * @param {float} maxLod The maximum level of detail.\n * @returns {vec3} The color of the cube map at the direction.\n */\nvec3 czm_sampleOctahedralProjection(sampler2D projectedMap, vec2 textureSize, vec3 direction, float lod, float maxLod) {\n float currentLod = floor(lod + 0.5);\n float nextLod = min(currentLod + 1.0, maxLod);\n\n vec3 colorCurrentLod = czm_sampleOctahedralProjectionWithFiltering(projectedMap, textureSize, direction, currentLod);\n vec3 colorNextLod = czm_sampleOctahedralProjectionWithFiltering(projectedMap, textureSize, direction, nextLod);\n\n return mix(colorNextLod, colorCurrentLod, nextLod - lod);\n}\n",czm_saturation:"/**\n * Adjusts the saturation of a color.\n * \n * @name czm_saturation\n * @glslFunction\n * \n * @param {vec3} rgb The color.\n * @param {float} adjustment The amount to adjust the saturation of the color.\n *\n * @returns {float} The color with the saturation adjusted.\n *\n * @example\n * vec3 greyScale = czm_saturation(color, 0.0);\n * vec3 doubleSaturation = czm_saturation(color, 2.0);\n */\nvec3 czm_saturation(vec3 rgb, float adjustment)\n{\n // Algorithm from Chapter 16 of OpenGL Shading Language\n const vec3 W = vec3(0.2125, 0.7154, 0.0721);\n vec3 intensity = vec3(dot(rgb, W));\n return mix(intensity, rgb, adjustment);\n}\n",czm_shadowDepthCompare:"\nfloat czm_sampleShadowMap(samplerCube shadowMap, vec3 d)\n{\n return czm_unpackDepth(textureCube(shadowMap, d));\n}\n\nfloat czm_sampleShadowMap(sampler2D shadowMap, vec2 uv)\n{\n#ifdef USE_SHADOW_DEPTH_TEXTURE\n return texture2D(shadowMap, uv).r;\n#else\n return czm_unpackDepth(texture2D(shadowMap, uv));\n#endif\n}\n\nfloat czm_shadowDepthCompare(samplerCube shadowMap, vec3 uv, float depth)\n{\n return step(depth, czm_sampleShadowMap(shadowMap, uv));\n}\n\nfloat czm_shadowDepthCompare(sampler2D shadowMap, vec2 uv, float depth)\n{\n return step(depth, czm_sampleShadowMap(shadowMap, uv));\n}\n",czm_shadowVisibility:"\nfloat czm_private_shadowVisibility(float visibility, float nDotL, float normalShadingSmooth, float darkness)\n{\n#ifdef USE_NORMAL_SHADING\n#ifdef USE_NORMAL_SHADING_SMOOTH\n float strength = clamp(nDotL / normalShadingSmooth, 0.0, 1.0);\n#else\n float strength = step(0.0, nDotL);\n#endif\n visibility *= strength;\n#endif\n\n visibility = max(visibility, darkness);\n return visibility;\n}\n\n#ifdef USE_CUBE_MAP_SHADOW\nfloat czm_shadowVisibility(samplerCube shadowMap, czm_shadowParameters shadowParameters)\n{\n float depthBias = shadowParameters.depthBias;\n float depth = shadowParameters.depth;\n float nDotL = shadowParameters.nDotL;\n float normalShadingSmooth = shadowParameters.normalShadingSmooth;\n float darkness = shadowParameters.darkness;\n vec3 uvw = shadowParameters.texCoords;\n\n depth -= depthBias;\n float visibility = czm_shadowDepthCompare(shadowMap, uvw, depth);\n return czm_private_shadowVisibility(visibility, nDotL, normalShadingSmooth, darkness);\n}\n#else\nfloat czm_shadowVisibility(sampler2D shadowMap, czm_shadowParameters shadowParameters)\n{\n float depthBias = shadowParameters.depthBias;\n float depth = shadowParameters.depth;\n float nDotL = shadowParameters.nDotL;\n float normalShadingSmooth = shadowParameters.normalShadingSmooth;\n float darkness = shadowParameters.darkness;\n vec2 uv = shadowParameters.texCoords;\n\n depth -= depthBias;\n#ifdef USE_SOFT_SHADOWS\n vec2 texelStepSize = shadowParameters.texelStepSize;\n float radius = 1.0;\n float dx0 = -texelStepSize.x * radius;\n float dy0 = -texelStepSize.y * radius;\n float dx1 = texelStepSize.x * radius;\n float dy1 = texelStepSize.y * radius;\n float visibility = (\n czm_shadowDepthCompare(shadowMap, uv, depth) +\n czm_shadowDepthCompare(shadowMap, uv + vec2(dx0, dy0), depth) +\n czm_shadowDepthCompare(shadowMap, uv + vec2(0.0, dy0), depth) +\n czm_shadowDepthCompare(shadowMap, uv + vec2(dx1, dy0), depth) +\n czm_shadowDepthCompare(shadowMap, uv + vec2(dx0, 0.0), depth) +\n czm_shadowDepthCompare(shadowMap, uv + vec2(dx1, 0.0), depth) +\n czm_shadowDepthCompare(shadowMap, uv + vec2(dx0, dy1), depth) +\n czm_shadowDepthCompare(shadowMap, uv + vec2(0.0, dy1), depth) +\n czm_shadowDepthCompare(shadowMap, uv + vec2(dx1, dy1), depth)\n ) * (1.0 / 9.0);\n#else\n float visibility = czm_shadowDepthCompare(shadowMap, uv, depth);\n#endif\n\n return czm_private_shadowVisibility(visibility, nDotL, normalShadingSmooth, darkness);\n}\n#endif\n",czm_signNotZero:"/**\n * Returns 1.0 if the given value is positive or zero, and -1.0 if it is negative. This is similar to the GLSL\n * built-in function <code>sign</code> except that returns 1.0 instead of 0.0 when the input value is 0.0.\n * \n * @name czm_signNotZero\n * @glslFunction\n *\n * @param {} value The value for which to determine the sign.\n * @returns {} 1.0 if the value is positive or zero, -1.0 if the value is negative.\n */\nfloat czm_signNotZero(float value)\n{\n return value >= 0.0 ? 1.0 : -1.0;\n}\n\nvec2 czm_signNotZero(vec2 value)\n{\n return vec2(czm_signNotZero(value.x), czm_signNotZero(value.y));\n}\n\nvec3 czm_signNotZero(vec3 value)\n{\n return vec3(czm_signNotZero(value.x), czm_signNotZero(value.y), czm_signNotZero(value.z));\n}\n\nvec4 czm_signNotZero(vec4 value)\n{\n return vec4(czm_signNotZero(value.x), czm_signNotZero(value.y), czm_signNotZero(value.z), czm_signNotZero(value.w));\n}\n",czm_sketchMode:"uniform sampler2D uNormalDepthTexture;\nuniform int uFillStyle;\nfloat edgeDetection(float lineWidth)\n{\n vec2 center = vec2(gl_FragCoord.x / czm_viewport.z, gl_FragCoord.y / czm_viewport.w);\n vec2 off = vec2(lineWidth / czm_viewport.z, lineWidth / czm_viewport.w);\n vec4 tex_nw = vec4(center.x+off.x, center.y+off.y, 1.0, 1.0);\n vec4 val_nw = texture2D(uNormalDepthTexture, tex_nw.xy);\n val_nw.xyz = (val_nw.xyz * 2.0) - 1.0;\n vec4 tex_ne = vec4(center.x-off.x, center.y+off.y, 1.0, 1.0);\n vec4 val_ne = texture2D(uNormalDepthTexture, tex_ne.xy);\n val_ne.xyz = (val_ne.xyz * 2.0) - 1.0;\n vec4 tex_sw = vec4(center.x+off.x, center.y-off.y, 1.0, 1.0);\n vec4 val_sw = texture2D(uNormalDepthTexture, tex_sw.xy);\n val_sw.xyz = (val_sw.xyz * 2.0 ) - 1.0;\n vec4 tex_se = vec4(center.x-off.x, center.y-off.y, 1.0, 1.0);\n vec4 val_se = texture2D(uNormalDepthTexture, tex_se.xy);\n val_se.xyz = (val_se.xyz * 2.0) - 1.0;\n float discontinuity = 0.0;\n float dot0 = dot(val_nw.xyz, val_se.xyz);\n float dot1 = dot(val_ne.xyz, val_sw.xyz);\n discontinuity = 0.5*(dot0+dot1);\n return discontinuity;\n}\nvec4 czm_sketchMode(vec4 inputColor, vec4 lineColor, float lineWidth)\n{\n vec4 outputColor = inputColor;\n float discontinuity = edgeDetection(lineWidth);\n discontinuity = clamp(discontinuity, 0.0, 1.0);\n if(uFillStyle == 1)\n {\n outputColor = lineColor;\n outputColor.a = (1.0 - sign(discontinuity - 0.5)) * 0.5;\n outputColor.a *= lineColor.a;\n }\n else\n {\n vec3 mixLineColor = mix(inputColor.rgb, vec3(lineColor.rgb), lineColor.a);\n outputColor.rgb = mix(mixLineColor, inputColor.rgb, discontinuity);\n }\n return outputColor;\n}",czm_sphericalHarmonics:"/**\n * Computes a color from the third order spherical harmonic coefficients and a normalized direction vector.\n * <p>\n * The order of the coefficients is [L00, L1_1, L10, L11, L2_2, L2_1, L20, L21, L22].\n * </p>\n *\n * @name czm_sphericalHarmonics\n * @glslFunction\n *\n * @param {vec3} normal The normalized direction.\n * @param {vec3[9]} coefficients The third order spherical harmonic coefficients.\n * @returns {vec3} The color at the direction.\n *\n */\nvec3 czm_sphericalHarmonics(vec3 normal, vec3 coefficients[9])\n{\n const float c1 = 0.429043;\n const float c2 = 0.511664;\n const float c3 = 0.743125;\n const float c4 = 0.886227;\n const float c5 = 0.247708;\n\n vec3 L00 = coefficients[0];\n vec3 L1_1 = coefficients[1];\n vec3 L10 = coefficients[2];\n vec3 L11 = coefficients[3];\n vec3 L2_2 = coefficients[4];\n vec3 L2_1 = coefficients[5];\n vec3 L20 = coefficients[6];\n vec3 L21 = coefficients[7];\n vec3 L22 = coefficients[8];\n\n float x = normal.x;\n float y = normal.y;\n float z = normal.z;\n\n return c1 * L22 * (x * x - y * y) + c3 * L20 * z * z + c4 * L00 - c5 * L20 +\n 2.0 * c1 * (L2_2 * x * y + L21 * x * z + L2_1 * y * z) +\n 2.0 * c2 * (L11 * x + L1_1 * y + L10 * z);\n}\n",czm_tangentToEyeSpaceMatrix:"/**\n * Creates a matrix that transforms vectors from tangent space to eye space.\n *\n * @name czm_tangentToEyeSpaceMatrix\n * @glslFunction\n *\n * @param {vec3} normalEC The normal vector in eye coordinates.\n * @param {vec3} tangentEC The tangent vector in eye coordinates.\n * @param {vec3} bitangentEC The bitangent vector in eye coordinates.\n *\n * @returns {mat3} The matrix that transforms from tangent space to eye space.\n *\n * @example\n * mat3 tangentToEye = czm_tangentToEyeSpaceMatrix(normalEC, tangentEC, bitangentEC);\n * vec3 normal = tangentToEye * texture2D(normalMap, st).xyz;\n */\nmat3 czm_tangentToEyeSpaceMatrix(vec3 normalEC, vec3 tangentEC, vec3 bitangentEC)\n{\n vec3 normal = normalize(normalEC);\n vec3 tangent = normalize(tangentEC);\n vec3 bitangent = normalize(bitangentEC);\n return mat3(tangent.x , tangent.y , tangent.z,\n bitangent.x, bitangent.y, bitangent.z,\n normal.x , normal.y , normal.z);\n}\n",czm_transformPlane:"vec4 czm_transformPlane(vec4 clippingPlane, mat4 transform) {\n vec3 transformedDirection = normalize((transform * vec4(clippingPlane.xyz, 0.0)).xyz);\n vec3 transformedPosition = (transform * vec4(clippingPlane.xyz * -clippingPlane.w, 1.0)).xyz;\n vec4 transformedPlane;\n transformedPlane.xyz = transformedDirection;\n transformedPlane.w = -dot(transformedDirection, transformedPosition);\n return transformedPlane;\n}\n",czm_translateRelativeToEye:"/**\n * Translates a position (or any <code>vec3</code>) that was encoded with {@link EncodedCartesian3},\n * and then provided to the shader as separate <code>high</code> and <code>low</code> bits to\n * be relative to the eye. As shown in the example, the position can then be transformed in eye\n * or clip coordinates using {@link czm_modelViewRelativeToEye} or {@link czm_modelViewProjectionRelativeToEye},\n * respectively.\n * <p>\n * This technique, called GPU RTE, eliminates jittering artifacts when using large coordinates as\n * </p>\n *\n * @name czm_translateRelativeToEye\n * @glslFunction\n *\n * @param {vec3} high The position's high bits.\n * @param {vec3} low The position's low bits.\n * @returns {vec3} The position translated to be relative to the camera's position.\n *\n * @example\n * attribute vec3 positionHigh;\n * attribute vec3 positionLow;\n *\n * void main()\n * {\n * vec4 p = czm_translateRelativeToEye(positionHigh, positionLow);\n * gl_Position = czm_modelViewProjectionRelativeToEye * p;\n * }\n *\n * @see czm_modelViewRelativeToEye\n * @see czm_modelViewProjectionRelativeToEye\n * @see czm_computePosition\n * @see EncodedCartesian3\n */\nvec4 czm_translateRelativeToEye(vec3 high, vec3 low)\n{\n vec3 highDifference = high - czm_encodedCameraPositionMCHigh;\n vec3 lowDifference = low - czm_encodedCameraPositionMCLow;\n\n return vec4(highDifference + lowDifference, 1.0);\n}\n",czm_translucentPhong:"/**\n * @private\n */\nvec4 czm_translucentPhong(vec3 toEye, czm_material material, vec3 lightDirectionEC)\n{\n // Diffuse from directional light sources at eye (for top-down and horizon views)\n float diffuse = czm_getLambertDiffuse(vec3(0.0, 0.0, 1.0), material.normal);\n\n if (czm_sceneMode == czm_sceneMode3D) {\n // (and horizon views in 3D)\n diffuse += czm_getLambertDiffuse(vec3(0.0, 1.0, 0.0), material.normal);\n }\n\n diffuse = clamp(diffuse, 0.0, 1.0);\n\n float specular = czm_getSpecular(lightDirectionEC, toEye, material.normal, material.shininess);\n\n // Temporary workaround for adding ambient.\n vec3 materialDiffuse = material.diffuse * 0.5;\n\n vec3 ambient = materialDiffuse;\n vec3 color = ambient + material.emission;\n color += materialDiffuse * diffuse * czm_lightColor;\n color += material.specular * specular * czm_lightColor;\n\n return vec4(color, material.alpha);\n}\n",czm_transpose:"/**\n * Returns the transpose of the matrix. The input <code>matrix</code> can be\n * a <code>mat2</code>, <code>mat3</code>, or <code>mat4</code>.\n *\n * @name czm_transpose\n * @glslFunction\n *\n * @param {} matrix The matrix to transpose.\n *\n * @returns {} The transposed matrix.\n *\n * @example\n * // GLSL declarations\n * mat2 czm_transpose(mat2 matrix);\n * mat3 czm_transpose(mat3 matrix);\n * mat4 czm_transpose(mat4 matrix);\n *\n * // Transpose a 3x3 rotation matrix to find its inverse.\n * mat3 eastNorthUpToEye = czm_eastNorthUpToEyeCoordinates(\n * positionMC, normalEC);\n * mat3 eyeToEastNorthUp = czm_transpose(eastNorthUpToEye);\n */\nmat2 czm_transpose(mat2 matrix)\n{\n return mat2(\n matrix[0][0], matrix[1][0],\n matrix[0][1], matrix[1][1]);\n}\n\nmat3 czm_transpose(mat3 matrix)\n{\n return mat3(\n matrix[0][0], matrix[1][0], matrix[2][0],\n matrix[0][1], matrix[1][1], matrix[2][1],\n matrix[0][2], matrix[1][2], matrix[2][2]);\n}\n\nmat4 czm_transpose(mat4 matrix)\n{\n return mat4(\n matrix[0][0], matrix[1][0], matrix[2][0], matrix[3][0],\n matrix[0][1], matrix[1][1], matrix[2][1], matrix[3][1],\n matrix[0][2], matrix[1][2], matrix[2][2], matrix[3][2],\n matrix[0][3], matrix[1][3], matrix[2][3], matrix[3][3]);\n}\n",czm_inverseMatrix:"mat3 czm_inverseMatrix(mat3 m)\n{\n float Determinant =\n m[0][0] * (m[1][1] * m[2][2] - m[2][1] * m[1][2])\n - m[1][0] * (m[0][1] * m[2][2] - m[2][1] * m[0][2])\n + m[2][0] * (m[0][1] * m[1][2] - m[1][1] * m[0][2]);\n\n mat3 Inverse;\n Inverse[0][0] = + (m[1][1] * m[2][2] - m[2][1] * m[1][2]);\n Inverse[1][0] = - (m[1][0] * m[2][2] - m[2][0] * m[1][2]);\n Inverse[2][0] = + (m[1][0] * m[2][1] - m[2][0] * m[1][1]);\n Inverse[0][1] = - (m[0][1] * m[2][2] - m[2][1] * m[0][2]);\n Inverse[1][1] = + (m[0][0] * m[2][2] - m[2][0] * m[0][2]);\n Inverse[2][1] = - (m[0][0] * m[2][1] - m[2][0] * m[0][1]);\n Inverse[0][2] = + (m[0][1] * m[1][2] - m[1][1] * m[0][2]);\n Inverse[1][2] = - (m[0][0] * m[1][2] - m[1][0] * m[0][2]);\n Inverse[2][2] = + (m[0][0] * m[1][1] - m[1][0] * m[0][1]);\n Inverse /= Determinant;\n\n return Inverse;\n}\n\nmat4 czm_inverseMatrix(mat4 m)\n{\n float Coef00 = m[2][2] * m[3][3] - m[3][2] * m[2][3];\n float Coef02 = m[1][2] * m[3][3] - m[3][2] * m[1][3];\n float Coef03 = m[1][2] * m[2][3] - m[2][2] * m[1][3];\n\n float Coef04 = m[2][1] * m[3][3] - m[3][1] * m[2][3];\n float Coef06 = m[1][1] * m[3][3] - m[3][1] * m[1][3];\n float Coef07 = m[1][1] * m[2][3] - m[2][1] * m[1][3];\n\n float Coef08 = m[2][1] * m[3][2] - m[3][1] * m[2][2];\n float Coef10 = m[1][1] * m[3][2] - m[3][1] * m[1][2];\n float Coef11 = m[1][1] * m[2][2] - m[2][1] * m[1][2];\n\n float Coef12 = m[2][0] * m[3][3] - m[3][0] * m[2][3];\n float Coef14 = m[1][0] * m[3][3] - m[3][0] * m[1][3];\n float Coef15 = m[1][0] * m[2][3] - m[2][0] * m[1][3];\n\n float Coef16 = m[2][0] * m[3][2] - m[3][0] * m[2][2];\n float Coef18 = m[1][0] * m[3][2] - m[3][0] * m[1][2];\n float Coef19 = m[1][0] * m[2][2] - m[2][0] * m[1][2];\n\n float Coef20 = m[2][0] * m[3][1] - m[3][0] * m[2][1];\n float Coef22 = m[1][0] * m[3][1] - m[3][0] * m[1][1];\n float Coef23 = m[1][0] * m[2][1] - m[2][0] * m[1][1];\n\n const vec4 SignA = vec4( 1.0, -1.0, 1.0, -1.0);\n const vec4 SignB = vec4(-1.0, 1.0, -1.0, 1.0);\n\n vec4 Fac0 = vec4(Coef00, Coef00, Coef02, Coef03);\n vec4 Fac1 = vec4(Coef04, Coef04, Coef06, Coef07);\n vec4 Fac2 = vec4(Coef08, Coef08, Coef10, Coef11);\n vec4 Fac3 = vec4(Coef12, Coef12, Coef14, Coef15);\n vec4 Fac4 = vec4(Coef16, Coef16, Coef18, Coef19);\n vec4 Fac5 = vec4(Coef20, Coef20, Coef22, Coef23);\n\n vec4 Vec0 = vec4(m[1][0], m[0][0], m[0][0], m[0][0]);\n vec4 Vec1 = vec4(m[1][1], m[0][1], m[0][1], m[0][1]);\n vec4 Vec2 = vec4(m[1][2], m[0][2], m[0][2], m[0][2]);\n vec4 Vec3 = vec4(m[1][3], m[0][3], m[0][3], m[0][3]);\n\n vec4 Inv0 = SignA * (Vec1 * Fac0 - Vec2 * Fac1 + Vec3 * Fac2);\n vec4 Inv1 = SignB * (Vec0 * Fac0 - Vec2 * Fac3 + Vec3 * Fac4);\n vec4 Inv2 = SignA * (Vec0 * Fac1 - Vec1 * Fac3 + Vec3 * Fac5);\n vec4 Inv3 = SignB * (Vec0 * Fac2 - Vec1 * Fac4 + Vec2 * Fac5);\n\n mat4 Inverse = mat4(Inv0, Inv1, Inv2, Inv3);\n\n vec4 Row0 = vec4(Inverse[0][0], Inverse[1][0], Inverse[2][0], Inverse[3][0]);\n\n float Determinant = dot(m[0], Row0);\n\n Inverse /= Determinant;\n\n return Inverse;\n}\n",czm_unpackDepth:"/**\n * Unpacks a vec4 depth value to a float in [0, 1) range.\n *\n * @name czm_unpackDepth\n * @glslFunction\n *\n * @param {vec4} packedDepth The packed depth.\n *\n * @returns {float} The floating-point depth in [0, 1) range.\n */\n float czm_unpackDepth(vec4 packedDepth)\n {\n // See Aras Pranckevičius' post Encoding Floats to RGBA\n // http://aras-p.info/blog/2009/07/30/encoding-floats-to-rgba-the-final/\n return dot(packedDepth, vec4(1.0, 1.0 / 255.0, 1.0 / 65025.0, 1.0 / 16581375.0));\n }\n",czm_unpackFloat:"#define SHIFT_RIGHT_8 0.00390625 //1.0 / 256.0\n#define SHIFT_RIGHT_16 0.00001525878 //1.0 / 65536.0\n#define SHIFT_RIGHT_24 5.960464477539063e-8//1.0 / 16777216.0\n\n#define BIAS 38.0\n\n/**\n * Unpacks a vec4 value containing values expressable as uint8 to an arbitrary float.\n *\n * @name czm_unpackFloat\n * @glslFunction\n *\n * @param {vec4} packedFloat The packed float.\n *\n * @returns {float} The floating-point depth in arbitrary range.\n */\n float czm_unpackFloat(vec4 packedFloat)\n{\n packedFloat *= 255.0;\n float temp = packedFloat.w / 2.0;\n float exponent = floor(temp);\n float sign = (temp - exponent) * 2.0;\n exponent = exponent - float(BIAS);\n sign = sign * 2.0 - 1.0;\n sign = -sign;\n float unpacked = sign * packedFloat.x * float(SHIFT_RIGHT_8);\n unpacked += sign * packedFloat.y * float(SHIFT_RIGHT_16);\n unpacked += sign * packedFloat.z * float(SHIFT_RIGHT_24);\n return unpacked * pow(10.0, exponent);\n}\n",czm_unpackValue:"/**\n * Unpacks a vec4 value to a float.\n *\n * @name czm_unpackValue\n * @glslFunction\n *\n * @param {vec3} packedValue The packed value.\n *\n * @returns {float} The floating-point value.\n */\n float czm_unpackValue(vec4 packedValue)\n {\n float SHIFT_LEFT16 = 65536.0;\n\tfloat SHIFT_LEFT8 = 256.0;\n\tvec4 value = packedValue * 255.0;\n\treturn value.r * SHIFT_LEFT16 + value.g * SHIFT_LEFT8 + value.b - 9000.0;\n }\n",czm_vertexLogDepth:"#ifdef LOG_DEPTH\n// 1.0 at the near plane, increasing linearly from there.\nvarying float v_depthFromNearPlusOne;\n#ifdef SHADOW_MAP\nvarying vec3 v_logPositionEC;\n#endif\n#endif\n\nvec4 czm_updatePositionDepth(vec4 coords) {\n#if defined(LOG_DEPTH)\n\n#ifdef SHADOW_MAP\n vec3 logPositionEC = (czm_inverseProjection * coords).xyz;\n v_logPositionEC = logPositionEC;\n#endif\n\n // With the very high far/near ratios used with the logarithmic depth\n // buffer, floating point rounding errors can cause linear depth values\n // to end up on the wrong side of the far plane, even for vertices that\n // are really nowhere near it. Since we always write a correct logarithmic\n // depth value in the fragment shader anyway, we just need to make sure\n // such errors don't cause the primitive to be clipped entirely before\n // we even get to the fragment shader.\n coords.z = clamp(coords.z / coords.w, -1.0, 1.0) * coords.w;\n#endif\n\n return coords;\n}\n\n/**\n * Writes the logarithmic depth to gl_Position using the already computed gl_Position.\n *\n * @name czm_vertexLogDepth\n * @glslFunction\n */\nvoid czm_vertexLogDepth()\n{\n#ifdef LOG_DEPTH\n v_depthFromNearPlusOne = 1.0 - czm_currentFrustum.x + gl_Position.w;\n gl_Position = czm_updatePositionDepth(gl_Position);\n#endif\n}\n\n/**\n * Writes the logarithmic depth to gl_Position using the provided clip coordinates.\n * <p>\n * An example use case for this function would be moving the vertex in window coordinates\n * before converting back to clip coordinates. Use the original vertex clip coordinates.\n * </p>\n * @name czm_vertexLogDepth\n * @glslFunction\n *\n * @param {vec4} clipCoords The vertex in clip coordinates.\n *\n * @example\n * czm_vertexLogDepth(czm_projection * vec4(positionEyeCoordinates, 1.0));\n */\nvoid czm_vertexLogDepth(vec4 clipCoords)\n{\n#ifdef LOG_DEPTH\n v_depthFromNearPlusOne = 1.0 - czm_currentFrustum.x + clipCoords.w;\n czm_updatePositionDepth(clipCoords);\n#endif\n}\n",czm_windowToEyeCoordinates:"/**\n * Transforms a position from window to eye coordinates.\n * The transform from window to normalized device coordinates is done using components\n * of (@link czm_viewport} and {@link czm_viewportTransformation} instead of calculating\n * the inverse of <code>czm_viewportTransformation</code>. The transformation from\n * normalized device coordinates to clip coordinates is done using <code>fragmentCoordinate.w</code>,\n * which is expected to be the scalar used in the perspective divide. The transformation\n * from clip to eye coordinates is done using {@link czm_inverseProjection}.\n *\n * @name czm_windowToEyeCoordinates\n * @glslFunction\n *\n * @param {vec4} fragmentCoordinate The position in window coordinates to transform.\n *\n * @returns {vec4} The transformed position in eye coordinates.\n *\n * @see czm_modelToWindowCoordinates\n * @see czm_eyeToWindowCoordinates\n * @see czm_inverseProjection\n * @see czm_viewport\n * @see czm_viewportTransformation\n *\n * @example\n * vec4 positionEC = czm_windowToEyeCoordinates(gl_FragCoord);\n */\nvec4 czm_windowToEyeCoordinates(vec4 fragmentCoordinate)\n{\n // Reconstruct NDC coordinates\n float x = 2.0 * (fragmentCoordinate.x - czm_viewport.x) / czm_viewport.z - 1.0;\n float y = 2.0 * (fragmentCoordinate.y - czm_viewport.y) / czm_viewport.w - 1.0;\n float z = (fragmentCoordinate.z - czm_viewportTransformation[3][2]) / czm_viewportTransformation[2][2];\n vec4 q = vec4(x, y, z, 1.0);\n\n // Reverse the perspective division to obtain clip coordinates.\n q /= fragmentCoordinate.w;\n\n // Reverse the projection transformation to obtain eye coordinates.\n if (!(czm_inverseProjection == mat4(0.0))) // IE and Edge sometimes do something weird with != between mat4s\n {\n q = czm_inverseProjection * q;\n }\n else\n {\n float top = czm_frustumPlanes.x;\n float bottom = czm_frustumPlanes.y;\n float left = czm_frustumPlanes.z;\n float right = czm_frustumPlanes.w;\n\n float near = czm_currentFrustum.x;\n float far = czm_currentFrustum.y;\n\n q.x = (q.x * (right - left) + left + right) * 0.5;\n q.y = (q.y * (top - bottom) + bottom + top) * 0.5;\n q.z = (q.z * (near - far) - near - far) * 0.5;\n q.w = 1.0;\n }\n\n return q;\n}\n\n/**\n * Transforms a position given as window x/y and a depth or a log depth from window to eye coordinates.\n * This function produces more accurate results for window positions with log depth than\n * conventionally unpacking the log depth using czm_reverseLogDepth and using the standard version\n * of czm_windowToEyeCoordinates.\n *\n * @name czm_windowToEyeCoordinates\n * @glslFunction\n *\n * @param {vec2} fragmentCoordinateXY The XY position in window coordinates to transform.\n * @param {float} depthOrLogDepth A depth or log depth for the fragment.\n *\n * @see czm_modelToWindowCoordinates\n * @see czm_eyeToWindowCoordinates\n * @see czm_inverseProjection\n * @see czm_viewport\n * @see czm_viewportTransformation\n *\n * @returns {vec4} The transformed position in eye coordinates.\n */\nvec4 czm_windowToEyeCoordinates(vec2 fragmentCoordinateXY, float depthOrLogDepth)\n{\n // See reverseLogDepth.glsl. This is separate to re-use the pow.\n#ifdef LOG_DEPTH\n float near = czm_currentFrustum.x;\n float far = czm_currentFrustum.y;\n float log2Depth = depthOrLogDepth * czm_log2FarDepthFromNearPlusOne;\n float depthFromNear = pow(2.0, log2Depth) - 1.0;\n float depthFromCamera = depthFromNear + near;\n vec4 windowCoord = vec4(fragmentCoordinateXY, far * (1.0 - near / depthFromCamera) / (far - near), 1.0);\n vec4 eyeCoordinate = czm_windowToEyeCoordinates(windowCoord);\n eyeCoordinate.w = 1.0 / depthFromCamera; // Better precision\n return eyeCoordinate;\n#else\n vec4 windowCoord = vec4(fragmentCoordinateXY, depthOrLogDepth, 1.0);\n vec4 eyeCoordinate = czm_windowToEyeCoordinates(windowCoord);\n#endif\n return eyeCoordinate;\n}\n",czm_writeDepthClampedToFarPlane:"// emulated noperspective\n#ifndef LOG_DEPTH\nvarying float v_WindowZ;\n#endif\n/**\n * Clamps a vertex to the far plane by writing the fragments depth.\n * <p>\n * The shader must enable the GL_EXT_frag_depth extension.\n * </p>\n *\n * @name czm_writeDepthClampedToFarPlane\n * @glslFunction\n *\n * @example\n * gl_FragColor = color;\n * czm_writeDepthClampedToFarPlane();\n *\n * @see czm_depthClampFarPlane\n */\nvoid czm_writeDepthClampedToFarPlane()\n{\n#if (defined(GL_EXT_frag_depth) || defined(WEBGL2)) && !defined(LOG_DEPTH)\n gl_FragDepthEXT = min(v_WindowZ * gl_FragCoord.w, 1.0);\n#endif\n}\n",czm_writeLogDepth:"#ifdef LOG_DEPTH\nvarying float v_depthFromNearPlusOne;\n\n#ifdef POLYGON_OFFSET\nuniform vec2 u_polygonOffset;\n#endif\n\n#endif\n\n/**\n * Writes the fragment depth to the logarithmic depth buffer.\n * <p>\n * Use this when the vertex shader does not call {@link czm_vertexlogDepth}, for example, when\n * ray-casting geometry using a full screen quad.\n * </p>\n * @name czm_writeLogDepth\n * @glslFunction\n *\n * @param {float} depth The depth coordinate, where 1.0 is on the near plane and\n * depth increases in eye-space units from there\n *\n * @example\n * czm_writeLogDepth((czm_projection * v_positionEyeCoordinates).w + 1.0);\n */\nvoid czm_writeLogDepth(float depth)\n{\n#if (defined(GL_EXT_frag_depth) || defined(WEBGL2)) && defined(LOG_DEPTH)\n // Discard the vertex if it's not between the near and far planes.\n // We allow a bit of epsilon on the near plane comparison because a 1.0\n // from the vertex shader (indicating the vertex should be _on_ the near\n // plane) will not necessarily come here as exactly 1.0.\n if (depth <= 0.9999999 || depth > czm_farDepthFromNearPlusOne) {\n discard;\n }\n\n#ifdef POLYGON_OFFSET\n // Polygon offset: m * factor + r * units\n float factor = u_polygonOffset[0];\n float units = u_polygonOffset[1];\n\n // If we can't compute derivatives, just leave out the factor I guess?\n#ifdef GL_OES_standard_derivatives\n // m = sqrt(dZdX^2 + dZdY^2);\n float x = dFdx(depth);\n float y = dFdy(depth);\n float m = sqrt(x * x + y * y);\n\n // Apply the factor before computing the log depth.\n depth += m * factor;\n#endif\n\n#endif\n\n gl_FragDepthEXT = log2(depth) * czm_oneOverLog2FarDepthFromNearPlusOne;\n\n#ifdef POLYGON_OFFSET\n // Apply the units after the log depth.\n gl_FragDepthEXT += czm_epsilon7 * units;\n#endif\n\n#endif\n}\n\n/**\n * Writes the fragment depth to the logarithmic depth buffer.\n * <p>\n * Use this when the vertex shader calls {@link czm_vertexlogDepth}.\n * </p>\n *\n * @name czm_writeLogDepth\n * @glslFunction\n */\nvoid czm_writeLogDepth() {\n#ifdef LOG_DEPTH\n czm_writeLogDepth(v_depthFromNearPlusOne);\n#endif\n}\n",czm_writeNonPerspective:"/**\n * Transforms a value for non-perspective interpolation by multiplying\n * it by w, the value used in the perspective divide. This function is\n * intended to be called in a vertex shader to compute the value of a\n * `varying` that should not be subject to perspective interpolation.\n * For example, screen-space texture coordinates. The fragment shader\n * must call {@link czm_readNonPerspective} to retrieve the final\n * non-perspective value.\n *\n * @name czm_writeNonPerspective\n * @glslFunction\n *\n * @param {float|vec2|vec3|vec4} value The value to be interpolated without accounting for perspective.\n * @param {float} w The perspective divide value. Usually this is the computed `gl_Position.w`.\n * @returns {float|vec2|vec3|vec4} The transformed value, intended to be stored in a `varying` and read in the\n * fragment shader with {@link czm_readNonPerspective}.\n */\nfloat czm_writeNonPerspective(float value, float w) {\n return value * w;\n}\n\nvec2 czm_writeNonPerspective(vec2 value, float w) {\n return value * w;\n}\n\nvec3 czm_writeNonPerspective(vec3 value, float w) {\n return value * w;\n}\n\nvec4 czm_writeNonPerspective(vec4 value, float w) {\n return value * w;\n}\n",czm_XYZToRGB:"/**\n * Converts a CIE Yxy color to RGB.\n * <p>The conversion is described in\n * </p>\n * \n * @name czm_XYZToRGB\n * @glslFunction\n * \n * @param {vec3} Yxy The color in CIE Yxy.\n *\n * @returns {vec3} The color in RGB.\n *\n * @example\n * vec3 xyz = czm_RGBToXYZ(rgb);\n * xyz.x = max(xyz.x - luminanceThreshold, 0.0);\n * rgb = czm_XYZToRGB(xyz);\n */\nvec3 czm_XYZToRGB(vec3 Yxy)\n{\n const mat3 XYZ2RGB = mat3( 3.2405, -0.9693, 0.0556,\n -1.5371, 1.8760, -0.2040,\n -0.4985, 0.0416, 1.0572);\n vec3 xyz;\n xyz.r = Yxy.r * Yxy.g / Yxy.b;\n xyz.g = Yxy.r;\n xyz.b = Yxy.r * (1.0 - Yxy.g - Yxy.b) / Yxy.b;\n \n return XYZ2RGB * xyz;\n}\n"};const Ff={rainDecl:"\n#ifdef HAS_RAIN\nuniform float uAnimationSpeed;\nuniform sampler2D uRippleTexture;\nuniform float uRippleScale;\nuniform float uWindIntensity;\nuniform float uRain;\nuniform float uCameraDepth;\n \nvoid getTimeInfo(float animationSpeed, out vec2 timeVec)\n{\n\tfloat time = czm_frameNumber * animationSpeed;\n\ttime = floor(30.0 * time);\n\tfloat time_diff = floor(time*0.25);\n\ttime = mod(time, 4.0);\n\ttime_diff = mod(time_diff, 4.0);\n\ttimeVec = vec2(time, time_diff);\n}\n\nvoid getPosInfo(vec4 posMC, out vec2 posMC_frac1, out vec2 posMC_frac2)\n{\n\tfloat ripple_scale = 1.0 / uRippleScale;\n\tvec2 posXY = posMC.xy * ripple_scale;\n\tposMC_frac1 = fract(posXY);\n\tvec2 posStep = vec2(0.5);\n\tposMC_frac2 = fract(posXY + posStep);\n}\n\nfloat getAlpha(vec2 posMC_frac1)\n{\n\tvec2 dist = (posMC_frac1 - vec2(0.5)) * 2.0;\n\tdist = vec2(abs(dist.x), abs(dist.y));\n\tvec2 result = pow(dist, vec2(5.0));\n\treturn result.x + result.y;\n}\n\nvec4 getRippleValue(sampler2D uRippleTexture, vec2 timeVec, vec2 posMC_frac1, vec2 posMC_frac2, float alpha)\n{\n\tvec2 rippleUV_1 = (timeVec + posMC_frac1)*0.25;\n\tvec2 rippleUV_2 = (timeVec + posMC_frac2)*0.25;\n\tvec4 rippleValue_1 = texture2D(uRippleTexture, rippleUV_1.xy);\n\tvec4 rippleValue_2 = texture2D(uRippleTexture, rippleUV_2.xy);\n\treturn mix(rippleValue_1, rippleValue_2, alpha);\n}\n\nvec3 getRippleNormal(vec4 rippleValue, float wind_intensity, float rain, float depthFade)\n{\n\tvec2 rippleValueXY = rippleValue.xy;\n\tvec2 rippleValueZW = rippleValue.zw;\n\tconst vec2 _value = vec2(0.5);\n\tvec2 part_1 = (rippleValueZW - _value) * wind_intensity * 0.13;\n\tvec2 part_2 = (rippleValueXY - _value) * 0.6;\n\tvec2 mergedValue = mix(part_1, part_2, rain) * depthFade;\n\treturn vec3(mergedValue, 1.0);\n}\n\nfloat getNormalAlpha(vec3 normalWS,float wetness)\n{\n\tfloat valueZ = normalWS.z - 0.5;\n\tfloat wet_correction = wetness * clamp(valueZ * 2.5, 0.0, 1.0);\n\treturn pow(wet_correction, 15.0);\n}\n\nvec3 rippleNormalCorrection(vec3 rippleNormal,float normalAlpha)\n{\n\tconst vec3 blueNormal = vec3(0.0, 0.0, 1.0);\n\treturn mix(blueNormal, rippleNormal, normalAlpha);\n}\n\nvec3 rippleGenerator(sampler2D uRippleTexture, float animationSpeed,vec3 normalWS,float wetness)\n{\n\tvec2 timeVec = vec2(1.0);\n\tgetTimeInfo(animationSpeed, timeVec);\n\tvec2 posMC_frac1 = vec2(1.0);\n\tvec2 posMC_frac2 = vec2(1.0);\n\tgetPosInfo(vPositionMC, posMC_frac1, posMC_frac2);\n\tfloat alpha = getAlpha(posMC_frac1);\n\tvec4 rippleValue = getRippleValue(uRippleTexture, timeVec, posMC_frac1, posMC_frac2, alpha);\n\tvec3 rippleNormal = getRippleNormal(rippleValue, uWindIntensity, uRain, uCameraDepth);\n\tfloat normalAlpha = getNormalAlpha(normalWS, wetness);\n\treturn normalize(rippleNormalCorrection(rippleNormal, normalAlpha));\n}\n#endif\n",snowDecl:"\n#ifdef HAS_SNOW\nuniform float uSnowCoverageFactor;\nuniform sampler2D uSnowMaskTexture;\nuniform sampler2D uSnowNormalTexture;\n\nvec3 getSnowMaskValue(sampler2D uSnowMaskTexture, vec2 snowUV)\n{\n\treturn texture2D(uSnowMaskTexture, snowUV).rgb;\n}\n\nfloat getSnowCoverage(float snow_coverage, float max_snow_coverage, vec3 normalWS, float z_mask)\n{\n\tfloat normal_z = normalWS.z;\n\tnormal_z += 1.1 + z_mask;\n\tnormal_z = clamp(normal_z * 0.5, 0.0, 1.0);\n\tfloat final_snow_coverage = clamp(snow_coverage, 0.0, max_snow_coverage);\n\tfinal_snow_coverage = clamp(final_snow_coverage*normal_z, 0.0, 1.0);\n\treturn final_snow_coverage;\n}\n\nfloat getSnowCoverageWithMaskTexture(float finalSnowCoverage, float heightValue, float snow_scatter_value, float snow_scatter_alpha, float tighten_value)\n{\n\tfloat scatter_value = mix(heightValue, snow_scatter_value, snow_scatter_alpha);\n\treturn clamp((tighten_value + 1.0) * finalSnowCoverage - tighten_value * scatter_value, 0.0, 1.0);\n}\n\nfloat getSnowAlpha(vec3 normalWS, float snow_coverage, float z_mask)\n{\n\treturn clamp((normalWS.z + z_mask) * 5.0, 0.0, 1.0) * snow_coverage;\n}\n\nvec3 getFinalBaseColor(vec3 baseColor, vec3 snow_baseColor, float snowAlpha)\n{\n\treturn mix(baseColor, snow_baseColor, snowAlpha);\n}\n\nfloat getFinalRoughness(float roughness, float snow_roughness, float snowAlpha)\n{\n\treturn mix(roughness, snow_roughness, snowAlpha);\n}\n\nvec3 getFinalNormal(vec3 normalWS, vec3 snowNormal, float blendNormalValue, float snow_coverage)\n{\n\tvec3 snowNormal_part2 = vec3(snowNormal.xy - vec2(0.5), 1.0);\n\tfloat normal_alpha = (1.0 - blendNormalValue)* snow_coverage;\n\treturn mix(normalWS, snowNormal_part2, normal_alpha);\n}\n\nvoid snowGenerator(sampler2D uSnowMaskTexture, sampler2D uSnowNormalTexture, vec2 snowUV, float snow_coverage, inout vec3 normalWS, inout vec3 baseColor, inout float roughness)\n{\n\tvec3 snowMaskValue = texture2D(uSnowMaskTexture, snowUV).rgb;\n\tconst float max_snow_coverage = 1.0;\n\tconst float z_mask = 0.0;\n\tfloat snowCoverage = getSnowCoverage(snow_coverage, max_snow_coverage, normalWS, z_mask);\n\tconst float heightValue = 0.5;\n\tfloat snow_scatter_value = snowMaskValue.g;\n\tconst float snow_scatter_alpha = 0.5;\n\tconst float tighten_value = 4.0;\n snowCoverage = getSnowCoverageWithMaskTexture(snowCoverage, heightValue, snow_scatter_value, snow_scatter_alpha, tighten_value);\n\tfloat snow_alpha = getSnowAlpha(normalWS, snowCoverage, z_mask);\n\tbaseColor = getFinalBaseColor(baseColor, vec3(snowMaskValue.r), snow_alpha);\n\troughness = getFinalRoughness(roughness, snowMaskValue.b, snow_alpha);\n\tvec3 snowNormalValue = texture2D(uSnowNormalTexture, snowUV).rgb;\n\tconst float blendNormalValue = 0.3;\n\tnormalWS = getFinalNormal(normalWS, snowNormalValue, blendNormalValue, snowCoverage);\n}\n\n#endif\n",hemisphereLightDecl:"\n#ifdef HAS_HEMISPHERE_LIGHTS\n\nuniform vec3 uSkyColor[ HEMISPHERE_LIGHTS ];\nuniform vec3 uGroundColor[ HEMISPHERE_LIGHTS ];\nuniform vec3 uHemisphereLightDirectionEC[ HEMISPHERE_LIGHTS ];\n \nstruct HemisphereLight {\n vec3 direction;\n vec3 skyColor;\n vec3 groundColor;\n};\n\nvec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in GeometricContext geometry ) {\n float dotNL = dot( geometry.normal, hemiLight.direction );\n float hemiDiffuseWeight = 0.5 * dotNL + 0.5;\n vec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\n return irradiance;\n}\n\n#endif\n",pointLightDecl:"\n#ifdef HAS_POINT_LIGHTS\n\nuniform vec3 uPointLightPositionEC[ POINT_LIGHTS ];\nuniform vec3 uPointLightColor[ POINT_LIGHTS ];\nuniform vec2 uPointLightDistanceAndDecay[ POINT_LIGHTS ];\n\nstruct PointLight {\n vec3 position;\n vec3 color;\n float distance;\n float decay;\n};\n\nvoid getPointDirectLightIrradiance( const in PointLight pointLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n vec3 lVector = pointLight.position - geometry.position;\n directLight.direction = normalize( lVector );\n float lightDistance = length( lVector );\n directLight.color = pointLight.color;\n directLight.color *= punctualLightIntensityToIrradianceFactor( lightDistance, pointLight.distance, pointLight.decay );\n directLight.visible = ( directLight.color != vec3( 0.0 ) );\n}\n\n#endif\n",spotLightDecl:"\n#ifdef HAS_SPOT_LIGHTS\n\nuniform vec3 uSpotLightColor[ SPOT_LIGHTS ];\nuniform vec3 uSpotLightPositionEC[ SPOT_LIGHTS ];\nuniform vec3 uSpotLightDirectionEC[ SPOT_LIGHTS ];\nuniform vec4 uSpotLightDistanceDecayCosPenumbra[ SPOT_LIGHTS ];\nuniform vec3 uSpotLightExponent[ SPOT_LIGHTS ];\n \nstruct SpotLight {\n vec3 position;\n vec3 direction;\n vec3 color;\n float distance;\n float decay;\n float coneCos;\n float penumbraCos;\n};\n\nvoid getSpotDirectLightIrradiance( const in SpotLight spotLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n vec3 lVector = spotLight.position - geometry.position;\n directLight.direction = normalize( lVector );\n float lightDistance = length( lVector );\n float angleCos = dot( directLight.direction, spotLight.direction );\n if ( angleCos > spotLight.coneCos ) {\n float spotEffect = smoothstep( spotLight.coneCos, spotLight.penumbraCos, angleCos );\n directLight.color = spotLight.color;\n directLight.color *= spotEffect * punctualLightIntensityToIrradianceFactor( lightDistance, spotLight.distance, spotLight.decay );\n directLight.visible = true;\n } else {\n directLight.color = vec3( 0.0 );\n directLight.visible = false;\n }\n}\n\n#endif\n",directionLightDecl:"\n#ifdef HAS_DIR_LIGHTS\n\nuniform vec3 uDirectionalLightDirectionEC[ DIR_LIGHTS ];\nuniform vec3 uDirectionalLightColor[ DIR_LIGHTS ];\n \n#endif\n",lightSourceImpl:"\n\n#ifdef HAS_DIR_LIGHTS\nfor (int i = 0; i < DIR_LIGHTS; i++) {\n directLight.color = uDirectionalLightColor[i];\n directLight.direction = uDirectionalLightDirectionEC[i];\n directLight.visible = true;\n directPhysical( directLight, geometry, material, reflectedLight );\n}\n#endif\n\n#ifdef HAS_POINT_LIGHTS\nPointLight pointLight;\nfor (int i = 0; i < POINT_LIGHTS; i++) {\n pointLight.position = uPointLightPositionEC[i];\n pointLight.color = uPointLightColor[i];\n pointLight.distance = uPointLightDistanceAndDecay[i].x;\n pointLight.decay = uPointLightDistanceAndDecay[i].y;\n getPointDirectLightIrradiance( pointLight, geometry, directLight );\n if(!directLight.visible) continue;\n directPhysical( directLight, geometry, material, reflectedLight );\n}\n#endif\n\n#ifdef HAS_SPOT_LIGHTS\nSpotLight spotLight;\nfor (int i = 0; i < SPOT_LIGHTS; i++) {\n spotLight.position = uSpotLightPositionEC[i];\n spotLight.color = uSpotLightColor[i];\n spotLight.direction = uSpotLightDirectionEC[i];\n spotLight.coneCos = uSpotLightDistanceDecayCosPenumbra[i].z;\n spotLight.penumbraCos = uSpotLightDistanceDecayCosPenumbra[i].w;\n getSpotDirectLightIrradiance( spotLight, geometry, directLight );\n if(!directLight.visible) continue;\n directPhysical( directLight, geometry, material, reflectedLight );\n}\n#endif\n",brdf:"\n#ifdef BRDF\n#define RECIPROCAL_PI 0.31830988618\n#define M_PI 3.141592653589793\n#define EPSILON 1e-6\n#define CUBEUV_MAX_MIP 8.0\n#define CUBEUV_TEXEL_WIDTH 0.0013020833333333333\n#define CUBEUV_TEXEL_HEIGHT 0.0009765625\n#define saturate(a) clamp( a, 0.0, 1.0 )\nfloat pow2( const in float x ) { return x * x; }\n\nuniform vec4 uBaseColorFactor;\nuniform vec4 uEmissiveFactor;\nuniform float uMetallicFactor;\nuniform float uRoughnessFactor;\nuniform float uAlphaCutoff;\nuniform float uEnvMapIntensity;\nuniform float uCameraReflect;\nstruct IncidentLight {\n vec3 direction;\n vec3 color;\n bool visible;\n};\n\nstruct GeometricContext {\n vec3 position;\n vec3 normal;\n vec3 viewDir;\n};\n\nstruct PhysicalMaterial {\n vec3\tdiffuseColor;\n float\troughness;\n vec3\tspecularColor;\n float specularF90;\n};\n\nstruct ReflectedLight {\n vec3 directDiffuse;\n vec3 directSpecular;\n vec3 indirectDiffuse;\n vec3 indirectSpecular;\n};\n\n#ifdef HAS_BASE_TEXTURE\n uniform sampler2D uBaseTexture;\n#endif\n\n#ifdef HAS_NORMAL_TEXTURE\n uniform sampler2D uNormalTexture;\n uniform float uNormalTextureScale;\n#ifdef HAS_ANISOTROPY\n uniform vec4 uAnisotropy;\n#endif\n#endif\n\n#ifdef HAS_EMISSIVE_TEXTURE\n uniform sampler2D uEmissionTexture;\n uniform vec4 uEmissiveUVOffsetAndTiling;\n#endif\n\n#ifdef HAS_MetallicRoughness_TEXTURE\n uniform sampler2D uMetallicRoughnessTexture;\n#endif\n\n#ifdef HAS_OCCLUSION_TEXTURE\n uniform sampler2D uOcclusionTexture;\n#endif\n\n#ifdef REFRACTION\n uniform float uIndexOfRefraction;\n#endif\n\n#ifdef HAS_TRANSMISSION\n uniform float uTransmissionFactor;\n#endif\n\n#ifdef HAS_WETNESS\n uniform float uWetnessFactor;\n#endif\n\n#ifdef HAS_VOLUME\n uniform vec4 uTintColor;\n uniform vec4 uDiffusionDistance;\n uniform float uThickness;\n#endif\n\n#ifdef HAS_CLEARCOAT\n uniform float uClearcoatFactor;\n uniform float uClearcoatRoughnessFactor;\n#endif\n\n//参考UE4.24实现计算精确光源的衰减\nfloat punctualLightIntensityToIrradianceFactor( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {\n // float d = lightDistance;\n // float r = cutoffDistance;\n // float d2 = d * d;\n // float attenuation = 1.0 / (d2 + 1.0); \n // float m = saturate(1.0 - pow(d / r, 4.0));\n // float m2 = m * m;\n // return attenuation * m2;\n if ( decayExponent > 0.0 ) {\n return pow( saturate( 1.0 - lightDistance / cutoffDistance ), decayExponent );\n }\n return 1.0;\n}\n\n#include <hemisphereLightDecl>\n#include <directionLightDecl>\n#include <pointLightDecl>\n#include <spotLightDecl>\n#include <snowDecl>\n#include <rainDecl>\n\n#ifdef HAS_ANISOTROPY\nvec3 getAnisotropicBentNormals(const vec3 T, const vec3 B, const vec3 N, const vec3 V, float anisotropy) {\n vec3 anisotropicFrameDirection = anisotropy >= 0.0 ? B : T;\n vec3 anisotropicFrameTangent = cross(normalize(anisotropicFrameDirection), V);\n vec3 anisotropicFrameNormal = cross(anisotropicFrameTangent, anisotropicFrameDirection);\n vec3 anisotropicNormal = normalize(mix(N, anisotropicFrameNormal, abs(anisotropy)));\n return anisotropicNormal;\n}\n#endif\n\n#ifdef HAS_VOLUME\nvec3 computeColorAtDistanceInMedia(vec3 color, float distance) {\n return -log(color) / distance;\n}\nvec3 cocaLambert(vec3 alpha, float distance) {\n return exp(-alpha * distance);\n}\n#endif\n\n\nvec3 sRGBToLinear(vec3 srgbIn) \n{\n return pow(srgbIn, vec3(2.2));\n}\n\nvec4 sRGBToLinear(vec4 srgbIn)\n{\n srgbIn = srgbIn ;\n vec3 linearOut = pow(srgbIn.rgb, vec3(2.2));\n return vec4(linearOut, srgbIn.a);\n}\n\nvec3 LinearTosRGB(vec3 linearIn) \n{\n#ifndef HDR \n return pow(linearIn, vec3(1.0/2.2));\n#else \n return linearIn;\n#endif \n}\n\nvec3 lambertianDiffuse(vec3 diffuseColor) \n{\n return diffuseColor * RECIPROCAL_PI;\n}\n\nvec3 applyTonemapping(vec3 linearIn) \n{\n vec3 color = linearIn * czm_toneMappingExposure;\n return czm_acesTonemapping(color);\n}\n\nvec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) {\n float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );\n return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );\n}\n\nfloat GeometrySchlickGGX(float roughness, float NoV)\n{\n float k = pow(roughness + 1.0, 2.0) / 8.0;\n return NoV / (NoV * (1.0 - k) + k);\n}\n\nfloat D_GGX( const in float alpha, const in float dotNH ) {\n float a2 = pow2( alpha );\n float denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;\n return RECIPROCAL_PI * a2 / pow2( denom );\n}\n\nvec3 BRDF_GGX( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in vec3 f0, const in float f90, const in float roughness ) {\n float alpha = roughness * roughness;\n vec3 halfDir = normalize( lightDir + viewDir );\n float dotNL = clamp( dot( normal, lightDir ), 0.001, 1.0 );\n float dotNV = abs( dot( normal, viewDir ) ) + 0.001;\n float dotNH = saturate( dot( normal, halfDir ) );\n float dotLH = saturate( dot( lightDir, halfDir ) );\n float dotVH = saturate( dot( viewDir, halfDir ) );\n vec3 F = F_Schlick( f0, f90, dotVH );\n float G = GeometrySchlickGGX(alpha, dotNV) * GeometrySchlickGGX(alpha, dotNL);\n float D = D_GGX( alpha, dotNH );\n return F * ( G * D ) / (4.0 * dotNL * dotNV);\n}\n\nvoid directPhysical( const in IncidentLight directLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n float dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n vec3 irradiance = dotNL * directLight.color;\n reflectedLight.directSpecular += irradiance * BRDF_GGX( directLight.direction, geometry.viewDir, geometry.normal, material.specularColor, material.specularF90, material.roughness );\n reflectedLight.directDiffuse += irradiance * lambertianDiffuse( material.diffuseColor );\n}\n\n#ifdef HAS_NORMAL_TEXTURE\nvec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm, vec2 uv, vec3 mapN) {\n float fNormalLength = length(mapN);\n if(fNormalLength < 0.5) {\n return surf_norm;\n }\n mapN = mapN * 2.0 - 1.0;\n vec3 q0 = vec3( dFdx( eye_pos.x ), dFdx( eye_pos.y ), dFdx( eye_pos.z ) );\n vec3 q1 = vec3( dFdy( eye_pos.x ), dFdy( eye_pos.y ), dFdy( eye_pos.z ) );\n vec2 st0 = dFdx( uv.st );\n vec2 st1 = dFdy( uv.st );\n float scale = sign( st1.t * st0.s - st0.t * st1.s );\n vec3 S = normalize( ( q0 * st1.t - q1 * st0.t ) * scale );\n vec3 T = normalize( ( - q0 * st1.s + q1 * st0.s ) * scale );\n vec3 N = normalize( surf_norm );\n mat3 tsn = mat3( S, T, N );\n mapN.xy *= uNormalTextureScale;\n mapN.xy *= ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n return normalize( tsn * mapN );\n}\n#endif\n\n#include <cubeUV_reflection>\n\nvec3 inverseTransformDirection( in vec3 dir ) {\n mat3 fixedToENU = mat3(czm_modelView[0][0], czm_modelView[1][0], czm_modelView[2][0], czm_modelView[0][1], czm_modelView[1][1], czm_modelView[2][1], czm_modelView[0][2], czm_modelView[1][2], czm_modelView[2][2]);\n const mat3 yUpToZUp = mat3(1.0, 0.0, 0.0, 0.0, 0.0, -1.0, 0.0, 1.0, 0.0);\n return normalize( yUpToZUp * fixedToENU * dir );\n}\n\nvoid indirectDiffuse_Physical( const in vec3 irradiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n reflectedLight.indirectDiffuse += irradiance * lambertianDiffuse( material.diffuseColor );\n}\n\nvec2 DFGApprox( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {\n float dotNV = saturate( dot( normal, viewDir ) );\n const vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 );\n const vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 );\n vec4 r = roughness * c0 + c1;\n float a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y;\n vec2 fab = vec2( - 1.04, 1.04 ) * a004 + r.zw;\n return fab;\n}\n\nvoid computeMultiscattering( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n vec2 fab = DFGApprox( normal, viewDir, roughness );\n vec3 Fr = specularColor;\n vec3 FssEss = Fr * fab.x + specularF90 * fab.y;\n float Ess = fab.x + fab.y;\n float Ems = 1.0 - Ess;\n vec3 Favg = Fr + ( 1.0 - Fr ) * 0.047619;\n vec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg );\n singleScatter += FssEss;\n multiScatter += Fms * Ems;\n}\n\nvoid indirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n vec3 singleScattering = vec3( 0.0 );\n vec3 multiScattering = vec3( 0.0 );\n vec3 cosineWeightedIrradiance = irradiance;\n computeMultiscattering( geometry.normal, geometry.viewDir, material.specularColor, material.specularF90, material.roughness, singleScattering, multiScattering );\n vec3 totalScattering = singleScattering + multiScattering;\n vec3 diffuse = material.diffuseColor * ( 1.0 - max( max( totalScattering.r, totalScattering.g ), totalScattering.b ) );\n reflectedLight.indirectSpecular += radiance * singleScattering;\n reflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance;\n reflectedLight.indirectSpecular = (uCameraReflect * 0.5 + 0.5) * reflectedLight.indirectSpecular; // 粗糙度值偏小使计算出的环境图高光值偏大导致水面反射的模型泛白,故水面反射时不计算环境图的高光\n reflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance;\n}\n\nvec3 getIBLIrradiance( const in vec3 normal ) {\n vec3 worldNormal = inverseTransformDirection( normal );\n vec4 envMapColor = textureCubeUV( czm_hdrEnvMap, worldNormal, 1.0 );\n return envMapColor.rgb;\n}\n\nvec3 getIBLRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness ) {\n vec3 reflectVec = reflect( - viewDir, normal );\n reflectVec = normalize( mix( reflectVec, normal, roughness * roughness) );\n reflectVec = inverseTransformDirection( reflectVec );\n vec4 envMapColor = textureCubeUV( czm_hdrEnvMap, reflectVec, roughness );\n return envMapColor.rgb;\n}\n\nfloat computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {\n return saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\n}\n\nuniform float uPbrParTextureWidth;\nvoid calculateMipLevel(in vec2 inTexCoord, in vec2 vecTile, in float fMaxMip, inout float mipLevel)\n{\n\tvec2 dx = dFdx(inTexCoord * vecTile.x);\n\tvec2 dy = dFdy(inTexCoord * vecTile.y);\n\tfloat dotX = dot(dx, dx);\n\tfloat dotY = dot(dy, dy);\n\tfloat dMax = max(dotX, dotY);\n\tfloat dMin = min(dotX, dotY);\n\tfloat offset = (dMax - dMin) / (dMax + dMin);\n\toffset = clamp(offset, 0.0, 1.0);\n\tfloat d = dMax * (1.0 - offset) + dMin * offset;\n\tmipLevel = 0.5 * log2(d);\n\tmipLevel = clamp(mipLevel, 0.0, fMaxMip - 1.62);\n}\n\nvec3 getTexcoordAndMipmapLevel(vec2 uv, vec4 texMatrix, float texCoordZ) {\n vec2 translate = texMatrix.xy;\n float textureWidth = texMatrix.z * uPbrParTextureWidth;\n float scale = texMatrix.z;\n float maxMipmapLevel = texMatrix.w;\n float mipLevel = 0.0;\n calculateMipLevel(uv, vec2(textureWidth), maxMipmapLevel, mipLevel);\n vec2 texCoord;\n if(texCoordZ < -9000.0)\n {\n texCoord = vec2(uv.x, uv.y);\n }\n else\n {\n texCoord = fract(uv);\n float offset = pow(2.0, mipLevel) / textureWidth;\n texCoord = clamp(texCoord, offset, 1.0 - offset);\n texCoord.x = (texCoord.x + translate.x) * scale;\n texCoord.y = (texCoord.y + translate.y) * scale;\n }\n \n return vec3(texCoord.xy, mipLevel);\n}\n\nvec4 brdf(in vec4 baseColorWithAlpha, vec2 texCoord, vec2 oriTexCoord, vec3 posEC, vec3 posMC, vec3 vertexNormalEC, vec4 sunLightColor, float sunLightON) {\n vec2 uv = oriTexCoord;\n float mipmapLevel = 0.0;\n#ifdef USE_BatchPBR\n vec3 uvAndMiplevel = getTexcoordAndMipmapLevel(oriTexCoord, vTexMatrix, vTexCoordZ.x);\n uv = uvAndMiplevel.xy;\n mipmapLevel = uvAndMiplevel.z;\n#endif\n baseColorWithAlpha = baseColorWithAlpha * uBaseColorFactor;\n#ifdef BaseColorReplace\n baseColorWithAlpha = uBaseColorFactor;\n#endif\n //float faceDirection = (gl_FrontFacing ? 1.0 : - 1.0) * uCameraReflect;\n vec3 ng = normalize(vertexNormalEC);\n #ifndef HAS_NORMAL\n ng = normalize(czm_normal * czm_computeNormal(posMC.xyz));\n #else\n float faceDirection = (dot(ng, -normalize(posEC)) < 0.0 ? -1.0 : 1.0) * uCameraReflect;\n ng = ng * faceDirection;\n #endif\n \n#ifdef HAS_BASE_TEXTURE\n #ifdef USE_BatchPBR\n baseColorWithAlpha *= sRGBToLinear(texture2DLodEXT(uBaseTexture, uv * uTexUVOffset.zw + uTexUVOffset.xy, mipmapLevel));\n #else\n baseColorWithAlpha = sRGBToLinear(texture2D(uBaseTexture, oriTexCoord * uTexUVOffset.zw + uTexUVOffset.xy)) * uBaseColorFactor * vColor;\n #endif\n#endif\n#ifdef HAS_NORMAL_TEXTURE\n #ifdef USE_BatchPBR\n vec3 mapN = texture2DLodEXT( uNormalTexture, uv, mipmapLevel).xyz;\n #else\n vec3 mapN = texture2D( uNormalTexture, uv).xyz;\n #endif\n vec3 n = perturbNormal2Arb(posEC, ng, oriTexCoord, mapN);\n#ifdef HAS_ANISOTROPY\n float anisotropy = uAnisotropy.b;\n vec3 anisotropyDirection = vec3(uAnisotropy.xy, 0.0);\n vec3 anisotropicTangent = normalize(tbn * anisotropyDirection);\n vec3 anisotropicBitangent = normalize(cross(tbn[2], anisotropicTangent));\n n = getAnisotropicBentNormals(anisotropicTangent, anisotropicBitangent, n, v, anisotropy);\n#endif\n#else\n vec3 n = ng;\n#endif\n#ifdef HAS_WETNESS\n mat3 fixedToENU_wetness = mat3(czm_modelView[0][0], czm_modelView[1][0], czm_modelView[2][0], czm_modelView[0][1], czm_modelView[1][1], czm_modelView[2][1], czm_modelView[0][2], czm_modelView[1][2], czm_modelView[2][2]);\n vec3 normalWS_wetness = normalize(fixedToENU_wetness * n);\n#endif\n#ifdef HAS_RAIN\n n = rippleGenerator(uRippleTexture,uAnimationSpeed,normalWS_wetness,uWetnessFactor);\n#endif\n vec3 baseColor = baseColorWithAlpha.rgb;\n float roughness = uRoughnessFactor;\n float metalness = uMetallicFactor;\n vec4 emissiveFactor = uEmissiveFactor;\n vec2 emissiveTexCoord = texCoord.xy;\n#ifdef PBR_THEME\n int pbrIndex = int(vPBRIndex);\n if(vPBRIndex < 0.0)\n {\n return baseColorWithAlpha;\n }\n mat4 pbrPar = mat4(0.0);\n for(int i = 0;i < NUM_PBR_MATERIALS;i++)\n {\n if(i == pbrIndex)\n {\n pbrPar = uPBRMaterials[i];\n break;\n }\n }\n roughness = clamp(pbrPar[0][0], 0.04, 1.0);\n metalness = clamp(pbrPar[0][1], 0.0, 1.0);\n baseColor = (baseColorWithAlpha / uBaseColorFactor * vec4(pbrPar[0][2], pbrPar[0][3], pbrPar[1][0], pbrPar[1][1])).rgb;\n#endif\n#ifdef USE_BatchPBR\n metalness = vMetallicRoughness.x;\n roughness = vMetallicRoughness.y;\n emissiveFactor = vEmissiveFactor;\n emissiveTexCoord = texCoord.xy;\n#endif\n metalness = clamp(metalness, 0.0, 1.0);\n roughness = clamp(roughness, 0.0, 1.0);\n \n#ifdef HAS_MetallicRoughness_TEXTURE\n #ifdef USE_BatchPBR\n vec3 metallicRoughness = texture2DLodEXT(uMetallicRoughnessTexture, uv, mipmapLevel).rgb;\n #else\n vec3 metallicRoughness = texture2D(uMetallicRoughnessTexture, oriTexCoord).rgb;\n #endif\n metalness = clamp(metalness * metallicRoughness.r, 0.0, 1.0);\n roughness = clamp(roughness * metallicRoughness.g, 0.04, 1.0);\n#ifdef HAS_WETNESS\n float fWetness = clamp(uWetnessFactor,0.0,1.0);\n float fWetness_correction = pow(4.0*fWetness,2.0);\n fWetness_correction = clamp(fWetness_correction,clamp(fWetness,0.0,0.9),1.0);\n float fWerness_normalized = fWetness_correction * clamp(normalWS_wetness.z + 0.85,0.0,1.0);\n baseColor = mix(baseColor,baseColor*0.7,fWerness_normalized);\n roughness = mix(roughness,0.05,fWerness_normalized);\n#endif\n#ifdef HAS_SNOW\n mat3 fixedToENU_snow = mat3(czm_modelView[0][0], czm_modelView[1][0], czm_modelView[2][0], czm_modelView[0][1], czm_modelView[1][1], czm_modelView[2][1], czm_modelView[0][2], czm_modelView[1][2], czm_modelView[2][2]);\n vec3 normalWS_snow = normalize(fixedToENU_snow * n);\n snowGenerator(uSnowMaskTexture,uSnowNormalTexture, oriTexCoord,uSnowCoverageFactor,normalWS_snow,baseColor,roughness);\n#endif\n#endif\n\n vec3 lightColorHdr = vec3(2.0) * uSunLightON; // 太阳光\n vec3 l = normalize(czm_lightDirectionEC);\n vec3 v = -normalize(posEC);\n vec3 h = normalize(v + l);\n vec3 f0 = vec3(0.04);\n vec3 diffuseColor = baseColor * (1.0 - metalness) * (1.0 - f0);\n vec3 specularColor = mix(f0, baseColor, metalness);\n \n float alpha = roughness * roughness;\n float dotNL = clamp( dot( n, l ), 0.001, 1.0 );\n float dotNV = abs( dot( n, v ) ) + 0.001;\n float dotNH = saturate( dot( n, h ) );\n float dotLH = saturate( dot( l, h ) );\n float dotVH = saturate( dot( v, h ) );\n float reflectance = max(max(specularColor.r, specularColor.g), specularColor.b);\n float f90 = clamp(reflectance * 25.0, 0.0, 1.0);\n vec3 F = F_Schlick( specularColor, f90, dotVH );\n float G = GeometrySchlickGGX(alpha, dotNV) * GeometrySchlickGGX(alpha, dotNL);\n float D = D_GGX( alpha, dotNH );\n vec3 diffuseContribution = (1.0 - F) * lambertianDiffuse(diffuseColor);\n vec3 specularContribution = F * G * D / (4.0 * dotNL * dotNV);\n \n vec3 geometryNormal = ng;\n PhysicalMaterial material;\n material.diffuseColor = diffuseColor;\n vec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) );\n float geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );\n material.roughness = max( roughness, 0.0525 );\n material.roughness += geometryRoughness;\n material.roughness = min( material.roughness, 1.0 );\n material.specularColor = specularColor;\n material.specularF90 = 1.0;\n \n GeometricContext geometry;\n geometry.position = posEC;\n geometry.normal = n;\n geometry.viewDir = v;\n ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n reflectedLight.directDiffuse += dotNL * lightColorHdr * diffuseContribution;\n reflectedLight.directSpecular += dotNL * lightColorHdr * specularContribution;\n \n IncidentLight directLight; \n #include <lightSourceImpl>\n \n vec3 irradiance = vec3(0.0);\n vec3 radiance = vec3(0.0);\n \n#ifdef HAS_HEMISPHERE_LIGHTS\n HemisphereLight hemiLight;\n hemiLight.skyColor = uSkyColor[0];\n hemiLight.groundColor = uGroundColor[0];\n hemiLight.direction = normalize(czm_normal * vec3(0.0, 0.0, 1.0));\n irradiance += getHemisphereLightIrradiance( hemiLight, geometry );\n#endif\n\n#ifdef IBL\n\n#ifdef KtxEnvMap\n mat3 fixedToENU = mat3(czm_modelView[0][0], czm_modelView[1][0], czm_modelView[2][0], czm_modelView[0][1], czm_modelView[1][1], czm_modelView[2][1], czm_modelView[0][2], czm_modelView[1][2], czm_modelView[2][2]);\n const mat3 yUpToZUp = mat3(-1.0, 0.0, 0.0, 0.0, 0.0, -1.0, 0.0, 1.0, 0.0);\n vec3 cubeDir = normalize( yUpToZUp * fixedToENU * reflect(-v, n) );\n vec3 worldNormal = normalize( yUpToZUp * fixedToENU * n );\n irradiance += czm_sphericalHarmonics(worldNormal, czm_sphericalHarmonicCoefficients);\n radiance += czm_sampleOctahedralProjection(czm_specularEnvironmentMaps, czm_specularEnvironmentMapSize, cubeDir, roughness * czm_specularEnvironmentMapsMaximumLOD, czm_specularEnvironmentMapsMaximumLOD);\n#else\n irradiance += getIBLIrradiance( geometry.normal );\n radiance += getIBLRadiance( geometry.viewDir, geometry.normal, material.roughness );\n#endif\n \n#else\n vec3 positionWC = vec3(czm_inverseView * vec4(posEC, 1.0));\n vec3 r = normalize(czm_inverseViewRotation * normalize(reflect(v, n)));\n float vertexRadius = length(positionWC);\n float horizonDotNadir = 1.0 - min(1.0, czm_ellipsoidRadii.x / vertexRadius);\n float reflectionDotNadir = dot(r, normalize(positionWC));\n r.x = -r.x;\n r = -normalize(czm_temeToPseudoFixed * r);\n r.x = -r.x;\n float inverseRoughness = 1.04 - roughness;\n inverseRoughness *= inverseRoughness;\n vec3 sceneSkyBox = textureCube(czm_environmentMap, r).rgb * inverseRoughness;\n float atmosphereHeight = 0.05;\n float blendRegionSize = 0.1 * ((1.0 - inverseRoughness) * 8.0 + 1.1 - horizonDotNadir);\n float blendRegionOffset = roughness * -1.0;\n float farAboveHorizon = clamp(horizonDotNadir - blendRegionSize * 0.5 + blendRegionOffset, 1.0e-10 - blendRegionSize, 0.99999);\n float aroundHorizon = clamp(horizonDotNadir + blendRegionSize * 0.5, 1.0e-10 - blendRegionSize, 0.99999);\n float farBelowHorizon = clamp(horizonDotNadir + blendRegionSize * 1.5, 1.0e-10 - blendRegionSize, 0.99999);\n float smoothstepHeight = smoothstep(0.0, atmosphereHeight, horizonDotNadir);\n vec3 belowHorizonColor = mix(vec3(0.1, 0.15, 0.25), vec3(0.4, 0.7, 0.9), smoothstepHeight);\n vec3 nadirColor = belowHorizonColor * 0.5;\n vec3 aboveHorizonColor = mix(vec3(0.9, 1.0, 1.2), belowHorizonColor, roughness * 0.5);\n vec3 blueSkyColor = mix(vec3(0.18, 0.26, 0.48), aboveHorizonColor, reflectionDotNadir * inverseRoughness * 0.5 + 0.75);\n vec3 zenithColor = mix(blueSkyColor, sceneSkyBox, smoothstepHeight);\n vec3 blueSkyDiffuseColor = vec3(0.7, 0.85, 0.9);\n float diffuseIrradianceFromEarth = (1.0 - horizonDotNadir) * (reflectionDotNadir * 0.25 + 0.75) * smoothstepHeight;\n float diffuseIrradianceFromSky = (1.0 - smoothstepHeight) * (1.0 - (reflectionDotNadir * 0.25 + 0.25));\n vec3 diffuseIrradiance = blueSkyDiffuseColor * clamp(diffuseIrradianceFromEarth + diffuseIrradianceFromSky, 0.0, 1.0);\n float notDistantRough = (1.0 - horizonDotNadir * roughness * 0.8);\n vec3 specularIrradiance = mix(zenithColor, aboveHorizonColor, smoothstep(farAboveHorizon, aroundHorizon, reflectionDotNadir) * notDistantRough);\n specularIrradiance = mix(specularIrradiance, belowHorizonColor, smoothstep(aroundHorizon, farBelowHorizon, reflectionDotNadir) * inverseRoughness);\n specularIrradiance = mix(specularIrradiance, nadirColor, smoothstep(farBelowHorizon, 1.0, reflectionDotNadir) * inverseRoughness);\n \n float LdotZenith = clamp(dot(normalize(czm_inverseViewRotation * czm_sunDirectionEC), normalize(positionWC * -1.0)), 0.001, 1.0);\n float S = acos(LdotZenith);\n float NdotZenith = clamp(dot(normalize(czm_inverseViewRotation * n), normalize(positionWC * -1.0)), 0.001, 1.0);\n float sunNdotL = clamp(dot(n, czm_sunDirectionEC), 0.001, 1.0);\n float gamma = acos(sunNdotL);\n float numerator = ((0.91 + 10.0 * exp(-3.0 * gamma) + 0.45 * pow(sunNdotL, 2.0)) * (1.0 - exp(-0.32 / NdotZenith)));\n float denominator = (0.91 + 10.0 * exp(-3.0 * S) + 0.45 * pow(LdotZenith,2.0)) * (1.0 - exp(-0.32));\n float luminance = 0.2 * (numerator / denominator);\n irradiance += diffuseIrradiance * luminance;\n radiance += specularIrradiance * luminance;\n#endif\n irradiance *= uEnvMapIntensity;\n radiance *= uEnvMapIntensity;\n\n indirectSpecular_Physical(radiance, irradiance, geometry, material, reflectedLight);\n\n#ifdef HAS_OCCLUSION_TEXTURE\n #ifdef USE_BatchPBR\n float ambientOcclusion = texture2DLodEXT(uOcclusionTexture, uv, mipmapLevel).r;\n #else\n float ambientOcclusion = texture2D(uOcclusionTexture, oriTexCoord.xy).r;\n #endif\n reflectedLight.indirectDiffuse *= ambientOcclusion;\n#ifdef IBL\n reflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.roughness );\n#endif\n#endif\n\nvec3 color = reflectedLight.directDiffuse + reflectedLight.directSpecular + reflectedLight.indirectDiffuse + reflectedLight.indirectSpecular;\n\n#ifdef HAS_EMISSIVE_TEXTURE\n emissiveTexCoord = emissiveTexCoord * uEmissiveUVOffsetAndTiling.zw + uEmissiveUVOffsetAndTiling.xy;\n vec3 emissive = texture2D(uEmissionTexture, emissiveTexCoord).rgb;\n emissive *= emissiveFactor.rgb;\n color += emissive;\n#else\n color += emissiveFactor.rgb;\n#endif\n\n color = applyTonemapping(color);\n color = LinearTosRGB(color);\n \n#ifdef MASK\n if (baseColorWithAlpha.a < uAlphaCutoff)\n {\n discard;\n }\n return vec4(color.rgb, 1.0);\n#endif\n return vec4(color.rgb, baseColorWithAlpha.a);\n}\n#endif\n",cubeUV_reflection:"\n #define cubeUV_minMipLevel 4.0\n\t#define cubeUV_minTileSize 16.0\n\t#ifdef WEBGL2\n\t\t#define texture2DGradEXT textureGrad \n\t#endif\n\n\t// These shader functions convert between the UV coordinates of a single face of\n\t// a cubemap, the 0-5 integer index of a cube face, and the direction vector for\n\t// sampling a textureCube (not generally normalized ).\n\n\tfloat getFace( vec3 direction ) {\n\n\t\tvec3 absDirection = abs( direction );\n\n\t\tfloat face = - 1.0;\n\n\t\tif ( absDirection.x > absDirection.z ) {\n\n\t\t\tif ( absDirection.x > absDirection.y )\n\n\t\t\t\tface = direction.x > 0.0 ? 0.0 : 3.0;\n\n\t\t\telse\n\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\n\t\t} else {\n\n\t\t\tif ( absDirection.z > absDirection.y )\n\n\t\t\t\tface = direction.z > 0.0 ? 2.0 : 5.0;\n\n\t\t\telse\n\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\n\t\t}\n\n\t\treturn face;\n\n\t}\n\n\t// RH coordinate system; PMREM face-indexing convention\n\tvec2 getUV( vec3 direction, float face ) {\n\n\t\tvec2 uv;\n\n\t\tif ( face == 0.0 ) {\n\n\t\t\tuv = vec2( direction.z, direction.y ) / abs( direction.x ); // pos x\n\n\t\t} else if ( face == 1.0 ) {\n\n\t\t\tuv = vec2( - direction.x, - direction.z ) / abs( direction.y ); // pos y\n\n\t\t} else if ( face == 2.0 ) {\n\n\t\t\tuv = vec2( - direction.x, direction.y ) / abs( direction.z ); // pos z\n\n\t\t} else if ( face == 3.0 ) {\n\n\t\t\tuv = vec2( - direction.z, direction.y ) / abs( direction.x ); // neg x\n\n\t\t} else if ( face == 4.0 ) {\n\n\t\t\tuv = vec2( - direction.x, direction.z ) / abs( direction.y ); // neg y\n\n\t\t} else {\n\n\t\t\tuv = vec2( direction.x, direction.y ) / abs( direction.z ); // neg z\n\n\t\t}\n\n\t\treturn 0.5 * ( uv + 1.0 );\n\n\t}\n\n\tvec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) {\n\n\t\tfloat face = getFace( direction );\n\n\t\tfloat filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 );\n\n\t\tmipInt = max( mipInt, cubeUV_minMipLevel );\n\n\t\tfloat faceSize = exp2( mipInt );\n\n\t\tvec2 uv = getUV( direction, face ) * ( faceSize - 2.0 ) + 1.0;\n\n\t\tif ( face > 2.0 ) {\n\n\t\t\tuv.y += faceSize;\n\n\t\t\tface -= 3.0;\n\n\t\t}\n\n\t\tuv.x += face * faceSize;\n\n\t\tuv.x += filterInt * 3.0 * cubeUV_minTileSize;\n\n\t\tuv.y += 4.0 * ( exp2( CUBEUV_MAX_MIP ) - faceSize );\n\n\t\tuv.x *= CUBEUV_TEXEL_WIDTH;\n\t\tuv.y *= CUBEUV_TEXEL_HEIGHT;\n\n\t\treturn texture2DGradEXT( envMap, uv, vec2( 0.0 ), vec2( 0.0 ) ).rgb; // disable anisotropic filtering\n\n\t}\n\n\t// These defines must match with PMREMGenerator\n\n\t#define cubeUV_r0 1.0\n\t#define cubeUV_v0 0.339\n\t#define cubeUV_m0 - 2.0\n\t#define cubeUV_r1 0.8\n\t#define cubeUV_v1 0.276\n\t#define cubeUV_m1 - 1.0\n\t#define cubeUV_r4 0.4\n\t#define cubeUV_v4 0.046\n\t#define cubeUV_m4 2.0\n\t#define cubeUV_r5 0.305\n\t#define cubeUV_v5 0.016\n\t#define cubeUV_m5 3.0\n\t#define cubeUV_r6 0.21\n\t#define cubeUV_v6 0.0038\n\t#define cubeUV_m6 4.0\n\n\tfloat roughnessToMip( float roughness ) {\n\n\t\tfloat mip = 0.0;\n\n\t\tif ( roughness >= cubeUV_r1 ) {\n\n\t\t\tmip = ( cubeUV_r0 - roughness ) * ( cubeUV_m1 - cubeUV_m0 ) / ( cubeUV_r0 - cubeUV_r1 ) + cubeUV_m0;\n\n\t\t} else if ( roughness >= cubeUV_r4 ) {\n\n\t\t\tmip = ( cubeUV_r1 - roughness ) * ( cubeUV_m4 - cubeUV_m1 ) / ( cubeUV_r1 - cubeUV_r4 ) + cubeUV_m1;\n\n\t\t} else if ( roughness >= cubeUV_r5 ) {\n\n\t\t\tmip = ( cubeUV_r4 - roughness ) * ( cubeUV_m5 - cubeUV_m4 ) / ( cubeUV_r4 - cubeUV_r5 ) + cubeUV_m4;\n\n\t\t} else if ( roughness >= cubeUV_r6 ) {\n\n\t\t\tmip = ( cubeUV_r5 - roughness ) * ( cubeUV_m6 - cubeUV_m5 ) / ( cubeUV_r5 - cubeUV_r6 ) + cubeUV_m5;\n\n\t\t} else {\n\n\t\t\tmip = - 2.0 * log2( 1.16 * roughness ); // 1.16 = 1.79^0.25\n\t\t}\n\n\t\treturn mip;\n\n\t}\n\n\tvec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) {\n\n\t\tfloat mip = clamp( roughnessToMip( roughness ), cubeUV_m0, CUBEUV_MAX_MIP );\n\n\t\tfloat mipF = fract( mip );\n\n\t\tfloat mipInt = floor( mip );\n\n\t\tvec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt );\n\n\t\tif ( mipF == 0.0 ) {\n\n\t\t\treturn vec4( color0, 1.0 );\n\n\t\t} else {\n\n\t\t\tvec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 );\n\n\t\t\treturn vec4( mix( color0, color1, mipF ), 1.0 );\n\n\t\t}\n\n\t}\n",getMapboxColor:"\n#ifdef HAS_MAPBOX_MAP\n\nprecision mediump sampler2DArray;\n\nuniform sampler2D u_mapboxIndexTexture;\nuniform sampler2D u_innerMapboxIndexTexture;//精细索引纹理\nuniform sampler2D u_relativeBoundsTexture;\nuniform sampler2DArray u_mapboxTileTextureArray;\n\nvec2 calUVFromGeoBounds(vec2 geoCoord, vec4 geoBounds) {\n if(geoBounds.z > czm_pi && geoCoord.x < 0.0 ){\n geoCoord.x += czm_twoPi;\n }\n vec2 uv = geoCoord.xy - vec2(geoBounds.x, geoBounds.w);\n uv.x = uv.x / (geoBounds.z - geoBounds.x);\n uv.y = 1.0 - uv.y / (geoBounds.y - geoBounds.w);\n return uv;\n}\n\nbool isValidTexCoord(vec2 inUV){\n if(inUV.x < 0.0 || inUV.x > 1.0 || inUV.y < 0.0 || inUV.y > 1.0){\n return false;\n }\n return true;\n}\n\n//geoBounds's lng should be [-PI, 2PI]\nbool isGeoPosInGeoBounds(vec2 geoTexCoord, vec4 mapboxGeoBounds){\n if(mapboxGeoBounds.z > czm_pi && geoTexCoord.x < 0.0){\n geoTexCoord.x += czm_twoPi;\n } \n \n return geoTexCoord.x > mapboxGeoBounds.x &&\n geoTexCoord.x < mapboxGeoBounds.z &&\n geoTexCoord.y > mapboxGeoBounds.y &&\n geoTexCoord.y < mapboxGeoBounds.w;\n \n}\n\nbool isInInnerIndexTextureGeoBounds(vec2 geoTexCoord, vec4 innerIndexTextureGeoBounds){\n if(innerIndexTextureGeoBounds.x > innerIndexTextureGeoBounds.z || innerIndexTextureGeoBounds.y > innerIndexTextureGeoBounds.w){\n return false;\n }\n\n return isGeoPosInGeoBounds(geoTexCoord, innerIndexTextureGeoBounds);\n}\n\nvec4 calIndexByPointInsideGeoBounds(vec2 geoTexCoord, vec4 mapboxGeoBounds, vec4 innerIndexTextureGeoBounds){\n vec2 indexTextureCoord;\n vec4 indexTextureColor;\n //判断该点是否在精细索引纹理的范围内\n if(isInInnerIndexTextureGeoBounds(geoTexCoord, innerIndexTextureGeoBounds)){\n //该点在精细索引纹理的范围内,从精细索引纹理取索引\n indexTextureCoord = calUVFromGeoBounds(geoTexCoord, innerIndexTextureGeoBounds);\n indexTextureColor = textureLod(u_innerMapboxIndexTexture, indexTextureCoord, 0.0);\n \n if(indexTextureColor.r == 0.0){\n //从精细索引纹理里取不到索引,就从主纹理取\n indexTextureCoord = calUVFromGeoBounds(geoTexCoord, mapboxGeoBounds);\n indexTextureColor = textureLod(u_mapboxIndexTexture, indexTextureCoord, 0.0);\n }\n }else{\n //该点不在精细索引纹理的范围内,从主索引纹理取索引\n indexTextureCoord = calUVFromGeoBounds(geoTexCoord, mapboxGeoBounds);\n indexTextureColor = textureLod(u_mapboxIndexTexture, indexTextureCoord, 0.0);\n }\n return indexTextureColor;\n}\n\n\n\nstruct MapboxMapParam {\n vec2 relativeTileBoundsCoord;\n vec4 tileBounds;\n vec4 mapboxGeoBounds;\n vec4 innerMapboxGeoBounds; //精细索引纹理的地理范围\n float mapboxAlpha;\n};\n\nvec4 getMapboxMapColor(vec4 inColor, MapboxMapParam param){\n // 计算当前点的地理坐标\n vec2 geoTexCoord = param.relativeTileBoundsCoord.xy;\n geoTexCoord.x = geoTexCoord.x * (param.tileBounds.z - param.tileBounds.x) + param.tileBounds.x;\n geoTexCoord.y = geoTexCoord.y * (param.tileBounds.w - param.tileBounds.y) + param.tileBounds.y;\n // 判断是否在mapbox地图覆盖的地理范围内\n if(isGeoPosInGeoBounds(geoTexCoord, param.mapboxGeoBounds))\n {\n // 计算在mapbox索引纹理上的坐标并获得当前点在mapbox的tile的纹理数组中的索引号\n vec4 indexTextureColor = calIndexByPointInsideGeoBounds(geoTexCoord, param.mapboxGeoBounds, param.innerMapboxGeoBounds);\n if(indexTextureColor.r > 0.0)\n {\n float textureIndex = floor(indexTextureColor.r);\n // 计算当前点在mapbox的tile纹理中的坐标并获取最终颜色\n vec4 mapboxTileRelativeBounds = texelFetch(u_relativeBoundsTexture, ivec2(textureIndex , 0), 0);\n vec2 mapboxTileTextureCoord = (param.relativeTileBoundsCoord.xy - mapboxTileRelativeBounds.rg) / mapboxTileRelativeBounds.ba;\n\n if(!isValidTexCoord(mapboxTileTextureCoord)){\n for(int i = 0; i < MAXBOX_TILE_TEXTURE_SIZE; i++){\n mapboxTileRelativeBounds = texelFetch(u_relativeBoundsTexture, ivec2(i , 0), 0);\n mapboxTileTextureCoord = (param.relativeTileBoundsCoord.xy - mapboxTileRelativeBounds.rg) / mapboxTileRelativeBounds.ba;\n if(isValidTexCoord(mapboxTileTextureCoord)){\n textureIndex = float(i);\n break;\n }\n }\n }\n // return vec4(1.0, .0, 0., 0.5);\n#ifdef WEBGPU\n vec4 mapboxColor = textureLod(u_mapboxTileTextureArray, vec3(mapboxTileTextureCoord, textureIndex), 0.0);\n#else\n\n vec4 mapboxColor = texture(u_mapboxTileTextureArray, vec3(mapboxTileTextureCoord, textureIndex));\n#endif\n if(mapboxColor.a < 0.001){\n return inColor;\n }\n vec4 blendColor = inColor;\n float finalApha = param.mapboxAlpha * mapboxColor.a;\n blendColor.rgb = mapboxColor.rgb * param.mapboxAlpha + inColor.rgb * (1.0 -finalApha);\n return blendColor;\n }\n }\n return inColor;\n}\n#endif\n\n\n",clipPolygonsVS:"\n varying vec2 v_clippingPosition;\n flat varying int v_regionIndex;\n uniform highp sampler2D u_clippingExtentsTexture;\n uniform highp int uClippingPolygonRegionsLength;\n vec2 getLookupUv(vec2 dimensions, int i) {\n int pixY = i / int(dimensions.x);\n int pixX = i - (pixY * int(dimensions.x));\n float pixelWidth = 1.0 / dimensions.x;\n float pixelHeight = 1.0 / dimensions.y;\n float u = (float(pixX) + 0.5) * pixelWidth; // sample from center of pixel\n float v = (float(pixY) + 0.5) * pixelHeight;\n return vec2(u, v);\n }\n\n vec4 unpackClippingExtents(highp sampler2D extentsTexture, int index) {\n vec2 textureDimensions = vec2(textureSize(extentsTexture, 0));\n return texture(extentsTexture, getLookupUv(textureDimensions, index));\n }\n\n void calcClipRegionIndexAndUV(vec3 positionWC) {\n #ifdef SCENE3D\n vec2 sphericalLatLong = czm_approximateSphericalCoordinates(positionWC);\n #else\n vec2 sphericalLatLong = vec2(positionWC.z / 6378137.0, positionWC.y / 6378137.0);\n #endif\n sphericalLatLong.y = czm_branchFreeTernary(sphericalLatLong.y < czm_pi, sphericalLatLong.y, sphericalLatLong.y - czm_twoPi);\n \n vec2 minDistance = vec2(czm_infinity);\n v_regionIndex = -1;\n v_clippingPosition = vec2(czm_infinity);\n \n for (int regionIndex = 0; regionIndex < uClippingPolygonRegionsLength; regionIndex++) {\n vec4 extents = unpackClippingExtents(u_clippingExtentsTexture, regionIndex);\n vec2 rectUv = (sphericalLatLong.yx - extents.yx) * extents.wz;\n \n vec2 clamped = clamp(rectUv, vec2(0.0), vec2(1.0));\n vec2 distance = abs(rectUv - clamped) * extents.wz;\n \n if (minDistance.x > distance.x || minDistance.y > distance.y) {\n minDistance = distance;\n v_clippingPosition = rectUv;\n }\n \n float threshold = 0.01;\n if (rectUv.x > threshold && rectUv.y > threshold && rectUv.x < 1.0 - threshold && rectUv.y < 1.0 - threshold) {\n v_regionIndex = regionIndex;\n }\n }\n }\n",clipPolygonsFS:"\nuniform highp sampler2D u_SignedDistanceTexture;\nuniform highp sampler2D u_clippingExtentsTexture;\nuniform vec2 u_SignedDistanceTextureSize;\nuniform highp int uClippingPolygonRegionsLength;\nuniform float uExtentsDimension;\nvarying vec3 v_positionMC;\n\nfloat getSignedDistance(vec2 uv) {\n float signedDistance = czm_unpackDepth(textureLod(u_SignedDistanceTexture, uv, 0.0));\n return (signedDistance - 0.5) * 2.0;\n}\n\nvec2 getLookupUv(vec2 dimensions, int i) {\n int pixY = i / int(dimensions.x);\n int pixX = i - (pixY * int(dimensions.x));\n float pixelWidth = 1.0 / dimensions.x;\n float pixelHeight = 1.0 / dimensions.y;\n float u = (float(pixX) + 0.5) * pixelWidth; // sample from center of pixel\n float v = (float(pixY) + 0.5) * pixelHeight;\n return vec2(u, v);\n}\n\nvec4 unpackClippingExtents(int index) {\n vec2 textureDim = vec2(textureSize(u_clippingExtentsTexture, 0));\n return texture(u_clippingExtentsTexture, getLookupUv(textureDim, index));\n}\n\nvoid calcClipRegionIndexAndUV(vec3 positionMC, out vec2 clippingPosition, out int outRegionIndex) {\n vec2 minDistance = vec2(czm_infinity);\n outRegionIndex = -1;\n clippingPosition = vec2(czm_infinity);\n\n for (int regionIndex = 0; regionIndex < uClippingPolygonRegionsLength; regionIndex++) {\n vec4 extents = unpackClippingExtents(regionIndex);\n vec2 rectUv = (positionMC.xy - extents.xy) * extents.zw;\n\n vec2 clamped = clamp(rectUv, vec2(0.0), vec2(1.0));\n vec2 distance = abs(rectUv - clamped) * extents.zw;\n \n float threshold = 0.01;\n if (minDistance.x > distance.x || minDistance.y > distance.y) {\n minDistance = distance;\n if (rectUv.x > threshold && rectUv.y > threshold && rectUv.x < 1.0 - threshold && rectUv.y < 1.0 - threshold) {\n outRegionIndex = regionIndex;\n clippingPosition = rectUv;\n }\n }\n \n }\n}\n \nvoid clipPolygons() {\n // Position is completely outside of polygons bounds\n vec2 rectUv;\n int regionIndex;\n calcClipRegionIndexAndUV(v_positionMC, rectUv, regionIndex);\n if (regionIndex < 0 || rectUv.x <= 0.0 || rectUv.y <= 0.0 || rectUv.x >= 1.0 || rectUv.y >= 1.0) {\n #ifdef CLIPPING_INVERSE \n discard;\n #endif\n return;\n }\n\n vec2 sampleOffset = max(1.0 / u_SignedDistanceTextureSize, vec2(0.005));\n float dimension = uExtentsDimension;\n\n vec2 textureOffset = vec2(mod(float(regionIndex), dimension), floor(float(regionIndex) / dimension)) / dimension;\n vec2 uv = textureOffset + rectUv / dimension;\n\n float signedDistance = getSignedDistance(uv);\n\n #ifdef CLIPPING_INVERSE\n if (signedDistance > 0.0) {\n discard;\n }\n #else\n if (signedDistance < 0.0) {\n discard;\n }\n #endif\n}\n",writeLogDepthDecl:"\n#ifdef LOG_DEPTH\nvarying float v_depthFromNearPlusOne;\n#endif\n#ifdef POLYGON_OFFSET\nuniform vec4 uPolygonOffset;\n#endif\n\nvoid writeLogDepth(float depth)\n{\n#ifdef LOG_DEPTH\n#if defined(GL_EXT_frag_depth) || defined(WEBGL2)\n if (depth <= 0.9999999 || depth > czm_farDepthFromNearPlusOne) {\n discard;\n }\n#ifdef POLYGON_OFFSET\n float factor = uPolygonOffset.z;\n float units = uPolygonOffset.w;\n\n#if defined(GL_OES_standard_derivatives) || defined(WEBGL2)\n float x = dFdx(depth);\n float y = dFdy(depth);\n float m = sqrt(x * x + y * y);\n depth += m * factor;\n#endif\n\n#endif\n\n gl_FragDepthEXT = log2(depth) * czm_oneOverLog2FarDepthFromNearPlusOne;\n#ifdef POLYGON_OFFSET\n gl_FragDepthEXT += czm_epsilon7 * units;\n#endif\n\n#endif\n#endif\n}\n\n"};function Pf(t){return(t=t.replace(/\/\/.*/g,"")).replace(/\/\*\*[\s\S]*?\*\//gm,(function(t){for(var e=t.match(/\n/gm).length,n="",r=0;r<e;++r)n+="\n";return n}))}function kf(t,e,n){for(var r,i=0;i<n.length;++i)n[i].name===t&&(r=n[i]);return Nr(r)||(r={name:t,glslSource:e=Pf(e),dependsOn:[],requiredBy:[],evaluated:!1},n.push(r)),r}function Uf(t,e){if(!t.evaluated){t.evaluated=!0;var n=t.glslSource.match(/\bczm_[a-zA-Z0-9_]*/g);Nr(n)&&null!==n&&(n=n.filter((function(t,e){return n.indexOf(t)===e}))).forEach((function(n){if(n!==t.name&&Vf._czmBuiltinsAndUniforms.hasOwnProperty(n)){var r=kf(n,Vf._czmBuiltinsAndUniforms[n],e);t.dependsOn.push(r),r.requiredBy.push(t),Uf(r,e)}}))}}function jf(t,e,n){var r=[],i=kf("main",e,r);Uf(i,r),function(t){for(var e=[],n=[];t.length>0;){var r=t.pop();n.push(r),0===r.requiredBy.length&&e.push(r)}for(;e.length>0;){var i=e.shift();t.push(i);for(var o=0;o<i.dependsOn.length;++o){var a=i.dependsOn[o],s=a.requiredBy.indexOf(i);a.requiredBy.splice(s,1),0===a.requiredBy.length&&e.push(a)}}for(var c=[],l=0;l<n.length;++l)0!==n[l].requiredBy.length&&c.push(n[l]);if(0!==c.length){for(var u="A circular dependency was found in the following built-in functions/structs/constants: \n",h=0;h<c.length;++h)u=u+c[h].name+"\n";throw new Lr(u)}}(r);for(var o="",a=r.length-1;a>=0;--a)Gf(n,t)&&(r[a].glslSource=Sf.removeUnuseMacroCode(n,t,r[a].glslSource)),o=o+r[a].glslSource+"\n";return o.replace(i.glslSource,"")}function Gf(t,e){return!!(Nr(t)&&Nr(e)&&t.shaderPreprocess)}function Hf(t){return t.replace(/^[ \t]*#include +<([\w\d./]+)>/gm,(function(t,e){var n=Ff[e];if(void 0===n)throw new Error("Can not resolve #include <"+e+">");return Hf(n)}))}function qf(t,e,n){var r,i,o,a="",s=t.sources;if(Nr(s))for(r=0,i=s.length;r<i;++r)a+="\n#line 0\n"+s[r];a=(a=Pf(a)).replace(/#version\s+(.*?)\n/gm,(function(t,e){if(Nr(o)&&o!==e)throw new Lr("inconsistent versions found: "+o+" and "+e);return o=e,"\n"}));var c=[];a=a.replace(/#extension.*\n/gm,(function(t){return c.push(t),"\n"})),a=a.replace(/precision\s(lowp|mediump|highp)\s(float|int);/,"");var l=t.pickColorQualifier;Nr(l)&&(a=Vf.createPickFragmentShaderSource(a,l));var u="";Nr(o)&&(u="#version "+o+"\n");var h=c.length;for(r=0;r<h;r++)u+=c[r];e&&(u+="#ifdef GL_FRAGMENT_PRECISION_HIGH\nprecision highp float;\n#else\nprecision mediump float;\n#endif\n\n");var f=t.defines;if(Nr(f))for(r=0,i=f.length;r<i;++r){var d=f[r];0!==d.length&&(u+="#define "+d+"\n")}if(n.webgl2&&(u+="#define OUTPUT_DECLARATION\n\n",u+="#define WEBGL2\n\n",u+="#define texture2DLodEXT textureLod\n\n",u+="#define texture2DGradEXT textureGrad\n\n"),a=Hf(a),n.textureFloatLinear&&(u+="#define OES_texture_float_linear\n\n"),Gf(n,t)&&(a=Sf.removeUnuseMacroCode(n,t,a)),t.includeBuiltIns){var p=jf(t,a,n);for(c.length=0,p=p.replace(/#extension.*\n/gm,(function(t){return c.push(t),"\n"})),h=c.length,r=0;r<h;r++)u=c[r]+u;u+=p}return u+="\n#line 0\n",u+=a,n.webgl2&&(u=xf(u,e)),u}function Vf(t){var e=(t=Pr(t,Pr.EMPTY_OBJECT)).pickColorQualifier;if(Nr(e)&&"uniform"!==e&&"varying"!==e)throw new Lr("options.pickColorQualifier must be 'uniform' or 'varying'.");this.defines=Nr(t.defines)?t.defines.slice(0):[],this.sources=Nr(t.sources)?t.sources.slice(0):[],this.pickColorQualifier=e,this.includeBuiltIns=Pr(t.includeBuiltIns,!0),this.name=Nr(t.name)?t.name:void 0}for(var Yf in Vf.prototype.clone=function(){return new Vf({sources:this.sources,defines:this.defines,name:this.name,pickColorQualifier:this.pickColorQualifier,includeBuiltIns:this.includeBuiltIns})},Vf.replaceMain=function(t,e){return e="void "+e+"()",t.replace(/void\s+main\s*\(\s*(?:void)?\s*\)/g,e)},Vf.prototype.getCacheKey=function(t){const e=this.defines.slice().sort().join(","),n=this.pickColorQualifier||"";this.includeBuiltIns;return`${e}:${n}:${this.sources.join("\n")}`},Vf.prototype.createCombinedVertexShader=function(t){return qf(this,!1,t)},Vf.prototype.createCombinedFragmentShader=function(t){return qf(this,!0,t)},Vf._czmBuiltinsAndUniforms={},Qf)Qf.hasOwnProperty(Yf)&&(Vf._czmBuiltinsAndUniforms[Yf]=Qf[Yf]);for(var Kf in Bf)if(Bf.hasOwnProperty(Kf)){var Wf=Bf[Kf];"function"==typeof Wf.getDeclaration&&(Vf._czmBuiltinsAndUniforms[Kf]=Wf.getDeclaration(Kf))}Vf.createPickVertexShaderSource=function(t){return Vf.replaceMain(t,"czm_old_main")+"\nattribute vec4 pickColor; \nvarying vec4 czm_pickColor; \nvoid main() \n{ \n czm_old_main(); \n czm_pickColor = pickColor; \n}"},Vf.createPickFragmentShaderSource=function(t,e){return Vf.replaceMain(t,"czm_old_main")+"\n"+(e+" vec4 czm_pickColor; \nvoid main() \n{ \n czm_old_main(); \n if (gl_FragColor.a == 0.0) { \n discard; \n } \n gl_FragColor = czm_pickColor; \n}")},Vf.findVarying=function(t,e){for(var n=t.sources,r=e.length,i=0;i<r;++i)for(var o=e[i],a=n.length,s=0;s<a;++s)if(-1!==n[s].indexOf(o))return o};var Xf=["v_normalEC","v_normal","aNormal"];Vf.findNormalVarying=function(t){return Vf.findVarying(t,Xf)};var Jf,Zf,$f,td=["v_positionEC"];function ed(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),6*n<1?t+6*(e-t)*n:2*n<1?e:3*n<2?t+(e-t)*(2/3-n)*6:t}function nd(t,e,n,r){this.red=Pr(t,1),this.green=Pr(e,1),this.blue=Pr(n,1),this.alpha=Pr(r,1)}Vf.findPositionVarying=function(t){return Vf.findVarying(t,td)},nd.fromCartesian4=function(t,e){return Qr.typeOf.object("cartesian",t),Nr(e)?(e.red=t.x,e.green=t.y,e.blue=t.z,e.alpha=t.w,e):new nd(t.x,t.y,t.z,t.w)},nd.fromBytes=function(t,e,n,r,i){return t=nd.byteToFloat(Pr(t,255)),e=nd.byteToFloat(Pr(e,255)),n=nd.byteToFloat(Pr(n,255)),r=nd.byteToFloat(Pr(r,255)),Nr(i)?(i.red=t,i.green=e,i.blue=n,i.alpha=r,i):new nd(t,e,n,r)},nd.fromAlpha=function(t,e,n){return Qr.typeOf.object("color",t),Qr.typeOf.number("alpha",e),Nr(n)?(n.red=t.red,n.green=t.green,n.blue=t.blue,n.alpha=e,n):new nd(t.red,t.green,t.blue,e)},tc.supportsTypedArrays()&&(Jf=new ArrayBuffer(4),Zf=new Uint32Array(Jf),$f=new Uint8Array(Jf)),nd.fromRgba=function(t,e){return Zf[0]=t,nd.fromBytes($f[0],$f[1],$f[2],$f[3],e)},nd.byteToRgba=function(t,e,n,r){return $f[0]=t,$f[1]=e,$f[2]=n,$f[3]=r,Zf[0]},nd.fromHsl=function(t,e,n,r,i){t=Pr(t,0)%1,e=Pr(e,0),n=Pr(n,0),r=Pr(r,1);var o=n,a=n,s=n;if(0!==e){var c,l=2*n-(c=n<.5?n*(1+e):n+e-n*e);o=ed(l,c,t+1/3),a=ed(l,c,t),s=ed(l,c,t-1/3)}return Nr(i)?(i.red=o,i.green=a,i.blue=s,i.alpha=r,i):new nd(o,a,s,r)},nd.fromRandom=function(t,e){var n=(t=Pr(t,Pr.EMPTY_OBJECT)).red;if(!Nr(n)){var r=Pr(t.minimumRed,0),i=Pr(t.maximumRed,1);Qr.typeOf.number.lessThanOrEquals("minimumRed",r,i),n=r+Ur.nextRandomNumber()*(i-r)}var o=t.green;if(!Nr(o)){var a=Pr(t.minimumGreen,0),s=Pr(t.maximumGreen,1);Qr.typeOf.number.lessThanOrEquals("minimumGreen",a,s),o=a+Ur.nextRandomNumber()*(s-a)}var c=t.blue;if(!Nr(c)){var l=Pr(t.minimumBlue,0),u=Pr(t.maximumBlue,1);Qr.typeOf.number.lessThanOrEquals("minimumBlue",l,u),c=l+Ur.nextRandomNumber()*(u-l)}var h=t.alpha;if(!Nr(h)){var f=Pr(t.minimumAlpha,0),d=Pr(t.maximumAlpha,1);Qr.typeOf.number.lessThanOrEquals("minumumAlpha",f,d),h=f+Ur.nextRandomNumber()*(d-f)}return Nr(e)?(e.red=n,e.green=o,e.blue=c,e.alpha=h,e):new nd(n,o,c,h)};var rd=/^#([0-9a-f])([0-9a-f])([0-9a-f])$/i,id=/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i,od=/^rgba?\(\s*([0-9.]+%?)\s*,\s*([0-9.]+%?)\s*,\s*([0-9.]+%?)(?:\s*,\s*([0-9.]+))?\s*\)$/i,ad=/^hsla?\(\s*([0-9.]+)\s*,\s*([0-9.]+%)\s*,\s*([0-9.]+%)(?:\s*,\s*([0-9.]+))?\s*\)$/i;function sd(t,e,n,r){switch(e.type){case t.FLOAT:return new cd(t,e,n,r);case t.FLOAT_VEC2:return new ld(t,e,n,r);case t.FLOAT_VEC3:return new ud(t,e,n,r);case t.FLOAT_VEC4:return new hd(t,e,n,r);case t.SAMPLER_2D:case t.SAMPLER_CUBE:return new fd(t,e,n,r);case t.SAMPLER_2D_ARRAY:case t.SAMPLER_3D:return new dd(t,e,n,r);case t.INT:case t.BOOL:return new pd(t,e,n,r);case t.INT_VEC2:case t.BOOL_VEC2:return new Ad(t,e,n,r);case t.INT_VEC3:case t.BOOL_VEC3:return new gd(t,e,n,r);case t.INT_VEC4:case t.BOOL_VEC4:return new md(t,e,n,r);case t.FLOAT_MAT2:return new vd(t,e,n,r);case t.FLOAT_MAT3:return new Id(t,e,n,r);case t.FLOAT_MAT4:return new Ed(t,e,n,r);default:throw new la("Unrecognized uniform type: "+e.type+' for uniform "'+n+'".')}}function cd(t,e,n,r){this.name=n,this.value=void 0,this._value=0,this._gl=t,this._location=r}function ld(t,e,n,r){this.name=n,this.value=void 0,this._value=new Ti,this._gl=t,this._location=r}function ud(t,e,n,r){this.name=n,this.value=void 0,this._value=void 0,this._gl=t,this._location=r}function hd(t,e,n,r){this.name=n,this.value=void 0,this._value=void 0,this._gl=t,this._location=r}function fd(t,e,n,r){this.name=n,this.value=void 0,this._gl=t,this._location=r,this.textureUnitIndex=void 0}function dd(t,e,n,r){this.name=n,this.value=void 0,this._gl=t,this._location=r,this.textureUnitIndex=void 0}function pd(t,e,n,r){this.name=n,this.value=void 0,this._value=0,this._gl=t,this._location=r}function Ad(t,e,n,r){this.name=n,this.value=void 0,this._value=new Ti,this._gl=t,this._location=r}function gd(t,e,n,r){this.name=n,this.value=void 0,this._value=new Hr,this._gl=t,this._location=r}function md(t,e,n,r){this.name=n,this.value=void 0,this._value=new Oi,this._gl=t,this._location=r}nd.fromCssColorString=function(t,e){Qr.typeOf.string("color",t),Nr(e)||(e=new nd);var n=nd[t.toUpperCase()];if(Nr(n))return nd.clone(n,e),e;var r=rd.exec(t);return null!==r?(e.red=parseInt(r[1],16)/15,e.green=parseInt(r[2],16)/15,e.blue=parseInt(r[3],16)/15,e.alpha=1,e):null!==(r=id.exec(t))?(e.red=parseInt(r[1],16)/255,e.green=parseInt(r[2],16)/255,e.blue=parseInt(r[3],16)/255,e.alpha=1,e):null!==(r=od.exec(t))?(e.red=parseFloat(r[1])/("%"===r[1].substr(-1)?100:255),e.green=parseFloat(r[2])/("%"===r[2].substr(-1)?100:255),e.blue=parseFloat(r[3])/("%"===r[3].substr(-1)?100:255),e.alpha=parseFloat(Pr(r[4],"1.0")),e):null!==(r=ad.exec(t))?nd.fromHsl(parseFloat(r[1])/360,parseFloat(r[2])/100,parseFloat(r[3])/100,parseFloat(Pr(r[4],"1.0")),e):e=void 0},nd.packedLength=4,nd.pack=function(t,e,n){return Qr.typeOf.object("value",t),Qr.defined("array",e),n=Pr(n,0),e[n++]=t.red,e[n++]=t.green,e[n++]=t.blue,e[n]=t.alpha,e},nd.unpack=function(t,e,n){return Qr.defined("array",t),e=Pr(e,0),Nr(n)||(n=new nd),n.red=t[e++],n.green=t[e++],n.blue=t[e++],n.alpha=t[e],n},nd.byteToFloat=function(t){return t/255},nd.floatToByte=function(t){return 1===t?255:256*t|0},nd.clone=function(t,e){if(Nr(t))return Nr(e)?(e.red=t.red,e.green=t.green,e.blue=t.blue,e.alpha=t.alpha,e):new nd(t.red,t.green,t.blue,t.alpha)},nd.equals=function(t,e){return t===e||Nr(t)&&Nr(e)&&t.red===e.red&&t.green===e.green&&t.blue===e.blue&&t.alpha===e.alpha},nd.equalsArray=function(t,e,n){return t.red===e[n]&&t.green===e[n+1]&&t.blue===e[n+2]&&t.alpha===e[n+3]},nd.prototype.clone=function(t){return nd.clone(this,t)},nd.prototype.equals=function(t){return nd.equals(this,t)},nd.prototype.equalsEpsilon=function(t,e){return this===t||Nr(t)&&Math.abs(this.red-t.red)<=e&&Math.abs(this.green-t.green)<=e&&Math.abs(this.blue-t.blue)<=e&&Math.abs(this.alpha-t.alpha)<=e},nd.prototype.toString=function(){return"("+this.red+", "+this.green+", "+this.blue+", "+this.alpha+")"},nd.prototype.toCssColorString=function(){var t=nd.floatToByte(this.red),e=nd.floatToByte(this.green),n=nd.floatToByte(this.blue);return 1===this.alpha?"rgb("+t+","+e+","+n+")":"rgba("+t+","+e+","+n+","+this.alpha+")"},nd.prototype.toCssHexString=function(){let t=nd.floatToByte(this.red).toString(16);t.length<2&&(t=`0${t}`);let e=nd.floatToByte(this.green).toString(16);e.length<2&&(e=`0${e}`);let n=nd.floatToByte(this.blue).toString(16);if(n.length<2&&(n=`0${n}`),this.alpha<1){let r=nd.floatToByte(this.alpha).toString(16);return r.length<2&&(r=`0${r}`),`#${t}${e}${n}${r}`}return`#${t}${e}${n}`},nd.prototype.toBytes=function(t){var e=nd.floatToByte(this.red),n=nd.floatToByte(this.green),r=nd.floatToByte(this.blue),i=nd.floatToByte(this.alpha);return Nr(t)?(t[0]=e,t[1]=n,t[2]=r,t[3]=i,t):[e,n,r,i]},nd.prototype.toRgba=function(){return $f[0]=nd.floatToByte(this.red),$f[1]=nd.floatToByte(this.green),$f[2]=nd.floatToByte(this.blue),$f[3]=nd.floatToByte(this.alpha),Zf[0]},nd.prototype.brighten=function(t,e){return Qr.typeOf.number("magnitude",t),Qr.typeOf.number.greaterThanOrEquals("magnitude",t,0),Qr.typeOf.object("result",e),t=1-t,e.red=1-(1-this.red)*t,e.green=1-(1-this.green)*t,e.blue=1-(1-this.blue)*t,e.alpha=this.alpha,e},nd.prototype.darken=function(t,e){return Qr.typeOf.number("magnitude",t),Qr.typeOf.number.greaterThanOrEquals("magnitude",t,0),Qr.typeOf.object("result",e),t=1-t,e.red=this.red*t,e.green=this.green*t,e.blue=this.blue*t,e.alpha=this.alpha,e},nd.prototype.withAlpha=function(t,e){return nd.fromAlpha(this,t,e)},nd.add=function(t,e,n){return Qr.typeOf.object("left",t),Qr.typeOf.object("right",e),Qr.typeOf.object("result",n),n.red=t.red+e.red,n.green=t.green+e.green,n.blue=t.blue+e.blue,n.alpha=t.alpha+e.alpha,n},nd.subtract=function(t,e,n){return Qr.typeOf.object("left",t),Qr.typeOf.object("right",e),Qr.typeOf.object("result",n),n.red=t.red-e.red,n.green=t.green-e.green,n.blue=t.blue-e.blue,n.alpha=t.alpha-e.alpha,n},nd.multiply=function(t,e,n){return Qr.typeOf.object("left",t),Qr.typeOf.object("right",e),Qr.typeOf.object("result",n),n.red=t.red*e.red,n.green=t.green*e.green,n.blue=t.blue*e.blue,n.alpha=t.alpha*e.alpha,n},nd.divide=function(t,e,n){return Qr.typeOf.object("left",t),Qr.typeOf.object("right",e),Qr.typeOf.object("result",n),n.red=t.red/e.red,n.green=t.green/e.green,n.blue=t.blue/e.blue,n.alpha=t.alpha/e.alpha,n},nd.mod=function(t,e,n){return Qr.typeOf.object("left",t),Qr.typeOf.object("right",e),Qr.typeOf.object("result",n),n.red=t.red%e.red,n.green=t.green%e.green,n.blue=t.blue%e.blue,n.alpha=t.alpha%e.alpha,n},nd.lerp=function(t,e,n,r){return Qr.typeOf.object("start",t),Qr.typeOf.object("end",e),Qr.typeOf.number("t",n),Qr.typeOf.object("result",r),r.red=Ur.lerp(t.red,e.red,n),r.green=Ur.lerp(t.green,e.green,n),r.blue=Ur.lerp(t.blue,e.blue,n),r.alpha=Ur.lerp(t.alpha,e.alpha,n),r},nd.multiplyByScalar=function(t,e,n){return Qr.typeOf.object("color",t),Qr.typeOf.number("scalar",e),Qr.typeOf.object("result",n),n.red=t.red*e,n.green=t.green*e,n.blue=t.blue*e,n.alpha=t.alpha*e,n},nd.divideByScalar=function(t,e,n){return Qr.typeOf.object("color",t),Qr.typeOf.number("scalar",e),Qr.typeOf.object("result",n),n.red=t.red/e,n.green=t.green/e,n.blue=t.blue/e,n.alpha=t.alpha/e,n},nd.ALICEBLUE=Object.freeze(nd.fromCssColorString("#F0F8FF")),nd.ANTIQUEWHITE=Object.freeze(nd.fromCssColorString("#FAEBD7")),nd.AQUA=Object.freeze(nd.fromCssColorString("#00FFFF")),nd.AQUAMARINE=Object.freeze(nd.fromCssColorString("#7FFFD4")),nd.AZURE=Object.freeze(nd.fromCssColorString("#F0FFFF")),nd.BEIGE=Object.freeze(nd.fromCssColorString("#F5F5DC")),nd.BISQUE=Object.freeze(nd.fromCssColorString("#FFE4C4")),nd.BLACK=Object.freeze(nd.fromCssColorString("#000000")),nd.BLANCHEDALMOND=Object.freeze(nd.fromCssColorString("#FFEBCD")),nd.BLUE=Object.freeze(nd.fromCssColorString("#0000FF")),nd.BLUEVIOLET=Object.freeze(nd.fromCssColorString("#8A2BE2")),nd.BROWN=Object.freeze(nd.fromCssColorString("#A52A2A")),nd.BURLYWOOD=Object.freeze(nd.fromCssColorString("#DEB887")),nd.CADETBLUE=Object.freeze(nd.fromCssColorString("#5F9EA0")),nd.CHARTREUSE=Object.freeze(nd.fromCssColorString("#7FFF00")),nd.CHOCOLATE=Object.freeze(nd.fromCssColorString("#D2691E")),nd.CORAL=Object.freeze(nd.fromCssColorString("#FF7F50")),nd.CORNFLOWERBLUE=Object.freeze(nd.fromCssColorString("#6495ED")),nd.CORNSILK=Object.freeze(nd.fromCssColorString("#FFF8DC")),nd.CRIMSON=Object.freeze(nd.fromCssColorString("#DC143C")),nd.CYAN=Object.freeze(nd.fromCssColorString("#00FFFF")),nd.DARKBLUE=Object.freeze(nd.fromCssColorString("#00008B")),nd.DARKCYAN=Object.freeze(nd.fromCssColorString("#008B8B")),nd.DARKGOLDENROD=Object.freeze(nd.fromCssColorString("#B8860B")),nd.DARKGRAY=Object.freeze(nd.fromCssColorString("#A9A9A9")),nd.DARKGREEN=Object.freeze(nd.fromCssColorString("#006400")),nd.DARKGREY=nd.DARKGRAY,nd.DARKKHAKI=Object.freeze(nd.fromCssColorString("#BDB76B")),nd.DARKMAGENTA=Object.freeze(nd.fromCssColorString("#8B008B")),nd.DARKOLIVEGREEN=Object.freeze(nd.fromCssColorString("#556B2F")),nd.DARKORANGE=Object.freeze(nd.fromCssColorString("#FF8C00")),nd.DARKORCHID=Object.freeze(nd.fromCssColorString("#9932CC")),nd.DARKRED=Object.freeze(nd.fromCssColorString("#8B0000")),nd.DARKSALMON=Object.freeze(nd.fromCssColorString("#E9967A")),nd.DARKSEAGREEN=Object.freeze(nd.fromCssColorString("#8FBC8F")),nd.DARKSLATEBLUE=Object.freeze(nd.fromCssColorString("#483D8B")),nd.DARKSLATEGRAY=Object.freeze(nd.fromCssColorString("#2F4F4F")),nd.DARKSLATEGREY=nd.DARKSLATEGRAY,nd.DARKTURQUOISE=Object.freeze(nd.fromCssColorString("#00CED1")),nd.DARKVIOLET=Object.freeze(nd.fromCssColorString("#9400D3")),nd.DEEPPINK=Object.freeze(nd.fromCssColorString("#FF1493")),nd.DEEPSKYBLUE=Object.freeze(nd.fromCssColorString("#00BFFF")),nd.DIMGRAY=Object.freeze(nd.fromCssColorString("#696969")),nd.DIMGREY=nd.DIMGRAY,nd.DODGERBLUE=Object.freeze(nd.fromCssColorString("#1E90FF")),nd.FIREBRICK=Object.freeze(nd.fromCssColorString("#B22222")),nd.FLORALWHITE=Object.freeze(nd.fromCssColorString("#FFFAF0")),nd.FORESTGREEN=Object.freeze(nd.fromCssColorString("#228B22")),nd.FUCHSIA=Object.freeze(nd.fromCssColorString("#FF00FF")),nd.GAINSBORO=Object.freeze(nd.fromCssColorString("#DCDCDC")),nd.GHOSTWHITE=Object.freeze(nd.fromCssColorString("#F8F8FF")),nd.GOLD=Object.freeze(nd.fromCssColorString("#FFD700")),nd.GOLDENROD=Object.freeze(nd.fromCssColorString("#DAA520")),nd.GRAY=Object.freeze(nd.fromCssColorString("#808080")),nd.GREEN=Object.freeze(nd.fromCssColorString("#008000")),nd.GREENYELLOW=Object.freeze(nd.fromCssColorString("#ADFF2F")),nd.GREY=nd.GRAY,nd.HONEYDEW=Object.freeze(nd.fromCssColorString("#F0FFF0")),nd.HOTPINK=Object.freeze(nd.fromCssColorString("#FF69B4")),nd.INDIANRED=Object.freeze(nd.fromCssColorString("#CD5C5C")),nd.INDIGO=Object.freeze(nd.fromCssColorString("#4B0082")),nd.IVORY=Object.freeze(nd.fromCssColorString("#FFFFF0")),nd.KHAKI=Object.freeze(nd.fromCssColorString("#F0E68C")),nd.LAVENDER=Object.freeze(nd.fromCssColorString("#E6E6FA")),nd.LAVENDAR_BLUSH=Object.freeze(nd.fromCssColorString("#FFF0F5")),nd.LAWNGREEN=Object.freeze(nd.fromCssColorString("#7CFC00")),nd.LEMONCHIFFON=Object.freeze(nd.fromCssColorString("#FFFACD")),nd.LIGHTBLUE=Object.freeze(nd.fromCssColorString("#ADD8E6")),nd.LIGHTCORAL=Object.freeze(nd.fromCssColorString("#F08080")),nd.LIGHTCYAN=Object.freeze(nd.fromCssColorString("#E0FFFF")),nd.LIGHTGOLDENRODYELLOW=Object.freeze(nd.fromCssColorString("#FAFAD2")),nd.LIGHTGRAY=Object.freeze(nd.fromCssColorString("#D3D3D3")),nd.LIGHTGREEN=Object.freeze(nd.fromCssColorString("#90EE90")),nd.LIGHTGREY=nd.LIGHTGRAY,nd.LIGHTPINK=Object.freeze(nd.fromCssColorString("#FFB6C1")),nd.LIGHTSEAGREEN=Object.freeze(nd.fromCssColorString("#20B2AA")),nd.LIGHTSKYBLUE=Object.freeze(nd.fromCssColorString("#87CEFA")),nd.LIGHTSLATEGRAY=Object.freeze(nd.fromCssColorString("#778899")),nd.LIGHTSLATEGREY=nd.LIGHTSLATEGRAY,nd.LIGHTSTEELBLUE=Object.freeze(nd.fromCssColorString("#B0C4DE")),nd.LIGHTYELLOW=Object.freeze(nd.fromCssColorString("#FFFFE0")),nd.LIME=Object.freeze(nd.fromCssColorString("#00FF00")),nd.LIMEGREEN=Object.freeze(nd.fromCssColorString("#32CD32")),nd.LINEN=Object.freeze(nd.fromCssColorString("#FAF0E6")),nd.MAGENTA=Object.freeze(nd.fromCssColorString("#FF00FF")),nd.MAROON=Object.freeze(nd.fromCssColorString("#800000")),nd.MEDIUMAQUAMARINE=Object.freeze(nd.fromCssColorString("#66CDAA")),nd.MEDIUMBLUE=Object.freeze(nd.fromCssColorString("#0000CD")),nd.MEDIUMORCHID=Object.freeze(nd.fromCssColorString("#BA55D3")),nd.MEDIUMPURPLE=Object.freeze(nd.fromCssColorString("#9370DB")),nd.MEDIUMSEAGREEN=Object.freeze(nd.fromCssColorString("#3CB371")),nd.MEDIUMSLATEBLUE=Object.freeze(nd.fromCssColorString("#7B68EE")),nd.MEDIUMSPRINGGREEN=Object.freeze(nd.fromCssColorString("#00FA9A")),nd.MEDIUMTURQUOISE=Object.freeze(nd.fromCssColorString("#48D1CC")),nd.MEDIUMVIOLETRED=Object.freeze(nd.fromCssColorString("#C71585")),nd.MIDNIGHTBLUE=Object.freeze(nd.fromCssColorString("#191970")),nd.MINTCREAM=Object.freeze(nd.fromCssColorString("#F5FFFA")),nd.MISTYROSE=Object.freeze(nd.fromCssColorString("#FFE4E1")),nd.MOCCASIN=Object.freeze(nd.fromCssColorString("#FFE4B5")),nd.NAVAJOWHITE=Object.freeze(nd.fromCssColorString("#FFDEAD")),nd.NAVY=Object.freeze(nd.fromCssColorString("#000080")),nd.OLDLACE=Object.freeze(nd.fromCssColorString("#FDF5E6")),nd.OLIVE=Object.freeze(nd.fromCssColorString("#808000")),nd.OLIVEDRAB=Object.freeze(nd.fromCssColorString("#6B8E23")),nd.ORANGE=Object.freeze(nd.fromCssColorString("#FFA500")),nd.ORANGERED=Object.freeze(nd.fromCssColorString("#FF4500")),nd.ORCHID=Object.freeze(nd.fromCssColorString("#DA70D6")),nd.PALEGOLDENROD=Object.freeze(nd.fromCssColorString("#EEE8AA")),nd.PALEGREEN=Object.freeze(nd.fromCssColorString("#98FB98")),nd.PALETURQUOISE=Object.freeze(nd.fromCssColorString("#AFEEEE")),nd.PALEVIOLETRED=Object.freeze(nd.fromCssColorString("#DB7093")),nd.PAPAYAWHIP=Object.freeze(nd.fromCssColorString("#FFEFD5")),nd.PEACHPUFF=Object.freeze(nd.fromCssColorString("#FFDAB9")),nd.PERU=Object.freeze(nd.fromCssColorString("#CD853F")),nd.PINK=Object.freeze(nd.fromCssColorString("#FFC0CB")),nd.PLUM=Object.freeze(nd.fromCssColorString("#DDA0DD")),nd.POWDERBLUE=Object.freeze(nd.fromCssColorString("#B0E0E6")),nd.PURPLE=Object.freeze(nd.fromCssColorString("#800080")),nd.RED=Object.freeze(nd.fromCssColorString("#FF0000")),nd.ROSYBROWN=Object.freeze(nd.fromCssColorString("#BC8F8F")),nd.ROYALBLUE=Object.freeze(nd.fromCssColorString("#4169E1")),nd.SADDLEBROWN=Object.freeze(nd.fromCssColorString("#8B4513")),nd.SALMON=Object.freeze(nd.fromCssColorString("#FA8072")),nd.SANDYBROWN=Object.freeze(nd.fromCssColorString("#F4A460")),nd.SEAGREEN=Object.freeze(nd.fromCssColorString("#2E8B57")),nd.SEASHELL=Object.freeze(nd.fromCssColorString("#FFF5EE")),nd.SIENNA=Object.freeze(nd.fromCssColorString("#A0522D")),nd.SILVER=Object.freeze(nd.fromCssColorString("#C0C0C0")),nd.SKYBLUE=Object.freeze(nd.fromCssColorString("#87CEEB")),nd.SLATEBLUE=Object.freeze(nd.fromCssColorString("#6A5ACD")),nd.SLATEGRAY=Object.freeze(nd.fromCssColorString("#708090")),nd.SLATEGREY=nd.SLATEGRAY,nd.SNOW=Object.freeze(nd.fromCssColorString("#FFFAFA")),nd.SPRINGGREEN=Object.freeze(nd.fromCssColorString("#00FF7F")),nd.STEELBLUE=Object.freeze(nd.fromCssColorString("#4682B4")),nd.TAN=Object.freeze(nd.fromCssColorString("#D2B48C")),nd.TEAL=Object.freeze(nd.fromCssColorString("#008080")),nd.THISTLE=Object.freeze(nd.fromCssColorString("#D8BFD8")),nd.TOMATO=Object.freeze(nd.fromCssColorString("#FF6347")),nd.TURQUOISE=Object.freeze(nd.fromCssColorString("#40E0D0")),nd.VIOLET=Object.freeze(nd.fromCssColorString("#EE82EE")),nd.WHEAT=Object.freeze(nd.fromCssColorString("#F5DEB3")),nd.WHITE=Object.freeze(nd.fromCssColorString("#FFFFFF")),nd.WHITESMOKE=Object.freeze(nd.fromCssColorString("#F5F5F5")),nd.YELLOW=Object.freeze(nd.fromCssColorString("#FFFF00")),nd.YELLOWGREEN=Object.freeze(nd.fromCssColorString("#9ACD32")),nd.TRANSPARENT=Object.freeze(new nd(0,0,0,0)),cd.prototype.set=function(){this.value!==this._value&&(this._value=this.value,this._gl.uniform1f(this._location,this.value))},ld.prototype.set=function(){var t=this.value;Ti.equals(t,this._value)||(Ti.clone(t,this._value),this._gl.uniform2f(this._location,t.x,t.y))},ud.prototype.set=function(){var t=this.value;if(Nr(t.red))nd.equals(t,this._value)||(this._value=nd.clone(t,this._value),this._gl.uniform3f(this._location,t.red,t.green,t.blue));else{if(!Nr(t.x))throw new Lr('Invalid vec3 value for uniform "'+this.name+'".');Hr.equals(t,this._value)||(this._value=Hr.clone(t,this._value),this._gl.uniform3f(this._location,t.x,t.y,t.z))}},hd.prototype.set=function(){var t=this.value;if(Nr(t.red))nd.equals(t,this._value)||(this._value=nd.clone(t,this._value),this._gl.uniform4f(this._location,t.red,t.green,t.blue,t.alpha));else{if(!Nr(t.x))throw new Lr('Invalid vec4 value for uniform "'+this.name+'".');Oi.equals(t,this._value)||(this._value=Oi.clone(t,this._value),this._gl.uniform4f(this._location,t.x,t.y,t.z,t.w))}},fd.prototype.set=function(){var t=this._gl;t.activeTexture(t.TEXTURE0+this.textureUnitIndex);var e=this.value;t.bindTexture(e._target,e._texture)},fd.prototype._setSampler=function(t){return this.textureUnitIndex=t,this._gl.uniform1i(this._location,t),t+1},dd.prototype.set=function(){var t=this.value,e=this._gl;e.activeTexture(e.TEXTURE0+this.textureUnitIndex),e.bindTexture(t._target,t._texture)},dd.prototype._setSampler=function(t){return this.textureUnitIndex=t,this._gl.uniform1i(this._location,t),t+1},pd.prototype.set=function(){this.value!==this._value&&(this._value=this.value,this._gl.uniform1i(this._location,this.value))},Ad.prototype.set=function(){var t=this.value;Ti.equals(t,this._value)||(Ti.clone(t,this._value),this._gl.uniform2i(this._location,t.x,t.y))},gd.prototype.set=function(){var t=this.value;Hr.equals(t,this._value)||(Hr.clone(t,this._value),this._gl.uniform3i(this._location,t.x,t.y,t.z))},md.prototype.set=function(){var t=this.value;Oi.equals(t,this._value)||(Oi.clone(t,this._value),this._gl.uniform4i(this._location,t.x,t.y,t.z,t.w))};var yd=new Float32Array(4);function vd(t,e,n,r){this.name=n,this.value=void 0,this._value=new Hh,this._gl=t,this._location=r}vd.prototype.set=function(){if(!Hh.equalsArray(this.value,this._value,0)){Hh.clone(this.value,this._value);var t=Hh.toArray(this.value,yd);this._gl.uniformMatrix2fv(this._location,!1,t)}};var Cd=new Float32Array(9);function Id(t,e,n,r){this.name=n,this.value=void 0,this._value=new $a,this._gl=t,this._location=r}Id.prototype.set=function(){if(!$a.equalsArray(this.value,this._value,0)){$a.clone(this.value,this._value);var t=$a.toArray(this.value,Cd);this._gl.uniformMatrix3fv(this._location,!1,t)}};var xd=new Float32Array(16);function Ed(t,e,n,r){this.name=n,this.value=void 0,this._value=new ls,this._gl=t,this._location=r}function _d(t,e,n,r){switch(e.type){case t.FLOAT:return new bd(t,e,n,r);case t.FLOAT_VEC2:return new wd(t,e,n,r);case t.FLOAT_VEC3:return new Md(t,e,n,r);case t.FLOAT_VEC4:return new Td(t,e,n,r);case t.SAMPLER_2D:case t.SAMPLER_CUBE:return new Bd(t,e,n,r);case t.INT:case t.BOOL:return new Sd(t,e,n,r);case t.INT_VEC2:case t.BOOL_VEC2:return new Dd(t,e,n,r);case t.INT_VEC3:case t.BOOL_VEC3:return new Rd(t,e,n,r);case t.INT_VEC4:case t.BOOL_VEC4:return new zd(t,e,n,r);case t.FLOAT_MAT2:return new Od(t,e,n,r);case t.FLOAT_MAT3:return new Nd(t,e,n,r);case t.FLOAT_MAT4:return new Ld(t,e,n,r);default:throw new la("Unrecognized uniform type: "+e.type+' for uniform "'+n+'".')}}function bd(t,e,n,r){var i=r.length;this.name=n,this.value=new Array(i),this._value=new Float32Array(i),this._gl=t,this._location=r[0]}function wd(t,e,n,r){var i=r.length;this.name=n,this.value=new Array(i),this._value=new Float32Array(2*i),this._gl=t,this._location=r[0]}function Md(t,e,n,r){var i=r.length;this.name=n,this.value=new Array(i),this._value=new Float32Array(3*i),this._gl=t,this._location=r[0]}function Td(t,e,n,r){var i=r.length;this.name=n,this.value=new Array(i),this._value=new Float32Array(4*i),this._gl=t,this._location=r[0]}function Bd(t,e,n,r){var i=r.length;this.name=n,this.value=new Array(i),this._value=new Float32Array(i),this._gl=t,this._locations=r,this.textureUnitIndex=void 0}function Sd(t,e,n,r){var i=r.length;this.name=n,this.value=new Array(i),this._value=new Int32Array(i),this._gl=t,this._location=r[0]}function Dd(t,e,n,r){var i=r.length;this.name=n,this.value=new Array(i),this._value=new Int32Array(2*i),this._gl=t,this._location=r[0]}function Rd(t,e,n,r){var i=r.length;this.name=n,this.value=new Array(i),this._value=new Int32Array(3*i),this._gl=t,this._location=r[0]}function zd(t,e,n,r){var i=r.length;this.name=n,this.value=new Array(i),this._value=new Int32Array(4*i),this._gl=t,this._location=r[0]}function Od(t,e,n,r){var i=r.length;this.name=n,this.value=new Array(i),this._value=new Float32Array(4*i),this._gl=t,this._location=r[0]}function Nd(t,e,n,r){var i=r.length;this.name=n,this.value=new Array(i),this._value=new Float32Array(9*i),this._gl=t,this._location=r[0]}function Ld(t,e,n,r){var i=r.length;this.name=n,this.value=new Array(i),this._value=new Float32Array(16*i),this._gl=t,this._location=r[0]}Ed.prototype.set=function(){if(!ls.equalsArray(this.value,this._value,0)){ls.clone(this.value,this._value);var t=ls.toArray(this.value,xd);this._gl.uniformMatrix4fv(this._location,!1,t)}},bd.prototype.set=function(){for(var t=this.value,e=t.length,n=this._value,r=!1,i=0;i<e;++i){var o=t[i];o!==n[i]&&(n[i]=o,r=!0)}r&&this._gl.uniform1fv(this._location,n)},wd.prototype.set=function(){for(var t=this.value,e=t.length,n=this._value,r=!1,i=0,o=0;o<e;++o){var a=t[o];Ti.equalsArray(a,n,i)||(Ti.pack(a,n,i),r=!0),i+=2}r&&this._gl.uniform2fv(this._location,n)},Md.prototype.set=function(){for(var t=this.value,e=t.length,n=this._value,r=!1,i=0,o=0;o<e;++o){var a=t[o];if(Nr(a.red))a.red===n[i]&&a.green===n[i+1]&&a.blue===n[i+2]||(n[i]=a.red,n[i+1]=a.green,n[i+2]=a.blue,r=!0);else{if(!Nr(a.x))throw new Lr("Invalid vec3 value.");Hr.equalsArray(a,n,i)||(Hr.pack(a,n,i),r=!0)}i+=3}r&&this._gl.uniform3fv(this._location,n)},Td.prototype.set=function(){for(var t=this.value,e=t.length,n=this._value,r=!1,i=0,o=0;o<e;++o){var a=t[o];if(Nr(a.red))nd.equalsArray(a,n,i)||(nd.pack(a,n,i),r=!0);else{if(!Nr(a.x))throw new Lr("Invalid vec4 value.");Oi.equalsArray(a,n,i)||(Oi.pack(a,n,i),r=!0)}i+=4}r&&this._gl.uniform4fv(this._location,n)},Bd.prototype.set=function(){for(var t=this._gl,e=t.TEXTURE0+this.textureUnitIndex,n=this.value,r=n.length,i=0;i<r;++i){var o=n[i];t.activeTexture(e+i),t.bindTexture(o._target,o._texture)}},Bd.prototype._setSampler=function(t){this.textureUnitIndex=t;for(var e=this._locations,n=e.length,r=0;r<n;++r){var i=t+r;this._gl.uniform1i(e[r],i)}return t+n},Sd.prototype.set=function(){for(var t=this.value,e=t.length,n=this._value,r=!1,i=0;i<e;++i){var o=t[i];o!==n[i]&&(n[i]=o,r=!0)}r&&this._gl.uniform1iv(this._location,n)},Dd.prototype.set=function(){for(var t=this.value,e=t.length,n=this._value,r=!1,i=0,o=0;o<e;++o){var a=t[o];Ti.equalsArray(a,n,i)||(Ti.pack(a,n,i),r=!0),i+=2}r&&this._gl.uniform2iv(this._location,n)},Rd.prototype.set=function(){for(var t=this.value,e=t.length,n=this._value,r=!1,i=0,o=0;o<e;++o){var a=t[o];Hr.equalsArray(a,n,i)||(Hr.pack(a,n,i),r=!0),i+=3}r&&this._gl.uniform3iv(this._location,n)},zd.prototype.set=function(){for(var t=this.value,e=t.length,n=this._value,r=!1,i=0,o=0;o<e;++o){var a=t[o];Oi.equalsArray(a,n,i)||(Oi.pack(a,n,i),r=!0),i+=4}r&&this._gl.uniform4iv(this._location,n)},Od.prototype.set=function(){for(var t=this.value,e=t.length,n=this._value,r=!1,i=0,o=0;o<e;++o){var a=t[o];Hh.equalsArray(a,n,i)||(Hh.pack(a,n,i),r=!0),i+=4}r&&this._gl.uniformMatrix2fv(this._location,!1,n)},Nd.prototype.set=function(){for(var t=this.value,e=t.length,n=this._value,r=!1,i=0,o=0;o<e;++o){var a=t[o];$a.equalsArray(a,n,i)||($a.pack(a,n,i),r=!0),i+=9}r&&this._gl.uniformMatrix3fv(this._location,!1,n)},Ld.prototype.set=function(){for(var t=this.value,e=t.length,n=this._value,r=!1,i=0,o=0;o<e;++o){var a=t[o];ls.equalsArray(a,n,i)||(ls.pack(a,n,i),r=!0),i+=16}r&&this._gl.uniformMatrix4fv(this._location,!1,n)};var Qd=0;function Fd(t){var e=function(t,e){var n={};if(!Af.highpFloatSupported||!Af.highpIntSupported){var r,i,o,a,s=Pd(t),c=Pd(e),l=s.length,u=c.length;for(r=0;r<l;r++)for(i=0;i<u;i++)if(s[r]===c[i]){a="czm_mediump_"+(o=s[r]);var h=new RegExp(o+"\\b","g");e=e.replace(h,a),n[a]=o}}return{fragmentShaderText:e,duplicateUniformNames:n}}(t.vertexShaderText,t.fragmentShaderText);this._gl=t.gl,this._logShaderCompilation=t.logShaderCompilation,this._debugShaders=t.debugShaders,this._attributeLocations=t.attributeLocations,this._varyings=t.varyings,this._bufferMode=t.bufferMode,this._program=void 0,this._numberOfVertexAttributes=void 0,this._vertexAttributes=void 0,this._uniformsByName=void 0,this._uniforms=void 0,this._automaticUniforms=void 0,this._manualUniforms=void 0,this._duplicateUniformNames=e.duplicateUniformNames,this._cachedShader=void 0,this._uniformBlockLocation={},this.maximumTextureUnitIndex=void 0,this._vertexShaderSource=t.vertexShaderSource,this._vertexShaderText=t.vertexShaderText,this._fragmentShaderSource=t.fragmentShaderSource,this._fragmentShaderText=e.fragmentShaderText,this.id=Qd++}function Pd(t){var e=[],n=t.match(/uniform.*?(?![^{]*})(?=[=\[;])/g);if(Nr(n))for(var r=n.length,i=0;i<r;i++){var o=n[i].trim(),a=o.slice(o.lastIndexOf(" ")+1);e.push(a)}return e}Fd.fromCache=function(t){return t=Pr(t,Pr.EMPTY_OBJECT),Qr.defined("options.context",t.context),t.context.shaderCache.getShaderProgram(t)},Fd.replaceCache=function(t){return t=Pr(t,Pr.EMPTY_OBJECT),Qr.defined("options.context",t.context),t.context.shaderCache.replaceShaderProgram(t)},Object.defineProperties(Fd.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},vertexAttributes:{get:function(){return Ud(this),this._vertexAttributes}},numberOfVertexAttributes:{get:function(){return Ud(this),this._numberOfVertexAttributes}},allUniforms:{get:function(){return Ud(this),this._uniformsByName}}});var kd="[Cesium WebGL] ";function Ud(t){if(!Nr(t._program)){var e=t._gl,n=function(t,e){var n=e._vertexShaderText,r=e._fragmentShaderText,i=t.createShader(t.VERTEX_SHADER);t.shaderSource(i,n),t.compileShader(i);var o=t.createShader(t.FRAGMENT_SHADER);t.shaderSource(o,r),t.compileShader(o);var a=t.createProgram();t.attachShader(a,i),t.attachShader(a,o),t.deleteShader(i),t.deleteShader(o);var s=e._attributeLocations;if(Nr(s))for(var c in s)s.hasOwnProperty(c)&&t.bindAttribLocation(a,s[c],c);var l,u=e._varyings,h=e._bufferMode;if(Nr(u)&&Nr(h)&&t.transformFeedbackVaryings(a,u,h),t.linkProgram(a),!t.getProgramParameter(a,t.LINK_STATUS)){var f=e._debugShaders;if(!t.getShaderParameter(o,t.COMPILE_STATUS)){if(l=t.getShaderInfoLog(o),console.error(kd+"Fragment shader compile log: "+l),Nr(f)){var d=f.getTranslatedShaderSource(o);""!==d?console.error(kd+"Translated fragment shader source:\n"+d):console.error(kd+"Fragment shader translation failed.")}throw t.deleteProgram(a),new la("Fragment shader failed to compile. Compile log: "+l)}if(!t.getShaderParameter(i,t.COMPILE_STATUS)){if(l=t.getShaderInfoLog(i),console.error(kd+"Vertex shader compile log: "+l),Nr(f)){var p=f.getTranslatedShaderSource(i);""!==p?console.error(kd+"Translated vertex shader source:\n"+p):console.error(kd+"Vertex shader translation failed.")}throw t.deleteProgram(a),new la("Vertex shader failed to compile. Compile log: "+l)}throw l=t.getProgramInfoLog(a),console.error(kd+"Shader program link log: "+l),Nr(f)&&(console.error(kd+"Translated vertex shader source:\n"+f.getTranslatedShaderSource(i)),console.error(kd+"Translated fragment shader source:\n"+f.getTranslatedShaderSource(o))),t.deleteProgram(a),new la("Program failed to link. Link log: "+l)}var A=e._logShaderCompilation;return A&&Nr(l=t.getShaderInfoLog(i))&&l.length>0&&console.log(kd+"Vertex shader compile log: "+l),A&&Nr(l=t.getShaderInfoLog(o))&&l.length>0&&console.log(kd+"Fragment shader compile log: "+l),A&&Nr(l=t.getProgramInfoLog(a))&&l.length>0&&console.log(kd+"Shader program link log: "+l),a}(e,t,t._debugShaders),r=e.getProgramParameter(n,e.ACTIVE_ATTRIBUTES),i=function(t,e){for(var n={},r=[],i=[],o=t.getProgramParameter(e,t.ACTIVE_UNIFORMS),a=0;a<o;++a){var s=t.getActiveUniform(e,a),c=-1!==s.name.indexOf("[0]",s.name.length-3)?s.name.slice(0,s.name.length-3):s.name;if(0!==c.indexOf("gl_"))if(s.name.indexOf("[")<0){var l=t.getUniformLocation(e,c);if(null!==l){var u=sd(t,s,c,l);n[c]=u,r.push(u),u._setSampler&&i.push(u)}}else{var h,f,d,p,A=c.indexOf("[");if(A>=0){if(!Nr(h=n[c.slice(0,A)]))continue;(f=h._locations).length<=1&&(d=h.value,null!==(p=t.getUniformLocation(e,c))&&(f.push(p),d.push(t.getUniform(e,p))))}else{f=[];for(var g=0;g<s.size;++g)null!==(p=t.getUniformLocation(e,c+"["+g+"]"))&&f.push(p);h=_d(t,s,c,f),n[c]=h,r.push(h),h._setSampler&&i.push(h)}}}return{uniformsByName:n,uniforms:r,samplerUniforms:i}}(e,n),o=function(t,e){var n=[],r=[];for(var i in e)if(e.hasOwnProperty(i)){var o=e[i],a=i,s=t._duplicateUniformNames[a];Nr(s)&&(o.name=s,a=s);var c=Bf[a];Nr(c)?n.push({uniform:o,automaticUniform:c}):r.push(o)}return{automaticUniforms:n,manualUniforms:r}}(t,i.uniformsByName);t._program=n,t._numberOfVertexAttributes=r,t._vertexAttributes=function(t,e,n){for(var r={},i=0;i<n;++i){var o=t.getActiveAttrib(e,i),a=t.getAttribLocation(e,o.name);r[o.name]={name:o.name,type:o.type,index:a}}return r}(e,n,r),t._uniformsByName=i.uniformsByName,t._uniforms=i.uniforms,t._automaticUniforms=o.automaticUniforms,t._manualUniforms=o.manualUniforms,t.maximumTextureUnitIndex=function(t,e,n){t.useProgram(e);for(var r=0,i=n.length,o=0;o<i;++o)r=n[o]._setSampler(r);return t.useProgram(null),r}(e,n,i.samplerUniforms)}}Fd.prototype._bind=function(){Ud(this),this._gl.useProgram(this._program)},Fd.prototype._setUniforms=function(t,e,n){var r,i;if(Nr(t)){var o=this._manualUniforms;for(r=o.length,i=0;i<r;++i){var a=o[i];a.value=t[a.name]()}}var s=this._automaticUniforms;for(r=s.length,i=0;i<r;++i){var c=s[i];c.uniform.value=c.automaticUniform.getValue(e)}var l=this._uniforms;for(r=l.length,i=0;i<r;++i)l[i].set();if(n){var u=this._gl,h=this._program;if(u.validateProgram(h),!u.getProgramParameter(h,u.VALIDATE_STATUS))throw new Lr("Program validation failed. Program info log: "+u.getProgramInfoLog(h))}},Fd.prototype.isDestroyed=function(){return!1},Fd.prototype.destroy=function(){this._cachedShader.cache.releaseShaderProgram(this)},Fd.prototype.finalDestroy=function(){return this._gl.deleteProgram(this._program),uf(this)};var jd={ADD:zh.FUNC_ADD,SUBTRACT:zh.FUNC_SUBTRACT,REVERSE_SUBTRACT:zh.FUNC_REVERSE_SUBTRACT,MIN:zh.MIN,MAX:zh.MAX},Gd=Object.freeze(jd),Hd={ZERO:zh.ZERO,ONE:zh.ONE,SOURCE_COLOR:zh.SRC_COLOR,ONE_MINUS_SOURCE_COLOR:zh.ONE_MINUS_SRC_COLOR,DESTINATION_COLOR:zh.DST_COLOR,ONE_MINUS_DESTINATION_COLOR:zh.ONE_MINUS_DST_COLOR,SOURCE_ALPHA:zh.SRC_ALPHA,ONE_MINUS_SOURCE_ALPHA:zh.ONE_MINUS_SRC_ALPHA,DESTINATION_ALPHA:zh.DST_ALPHA,ONE_MINUS_DESTINATION_ALPHA:zh.ONE_MINUS_DST_ALPHA,CONSTANT_COLOR:zh.CONSTANT_COLOR,ONE_MINUS_CONSTANT_COLOR:zh.ONE_MINUS_CONSTANT_COLOR,CONSTANT_ALPHA:zh.CONSTANT_ALPHA,ONE_MINUS_CONSTANT_ALPHA:zh.ONE_MINUS_CONSTANT_ALPHA,SOURCE_ALPHA_SATURATE:zh.SRC_ALPHA_SATURATE},qd=Object.freeze(Hd),Vd={DISABLED:Object.freeze({enabled:!1}),ALPHA_BLEND:Object.freeze({enabled:!0,equationRgb:Gd.ADD,equationAlpha:Gd.ADD,functionSourceRgb:qd.SOURCE_ALPHA,functionSourceAlpha:qd.ONE,functionDestinationRgb:qd.ONE_MINUS_SOURCE_ALPHA,functionDestinationAlpha:qd.ONE_MINUS_SOURCE_ALPHA}),PRE_MULTIPLIED_ALPHA_BLEND:Object.freeze({enabled:!0,equationRgb:Gd.ADD,equationAlpha:Gd.ADD,functionSourceRgb:qd.ONE,functionSourceAlpha:qd.ONE,functionDestinationRgb:qd.ONE_MINUS_SOURCE_ALPHA,functionDestinationAlpha:qd.ONE_MINUS_SOURCE_ALPHA}),ADDITIVE_BLEND:Object.freeze({enabled:!0,equationRgb:Gd.ADD,equationAlpha:Gd.ADD,functionSourceRgb:qd.SOURCE_ALPHA,functionSourceAlpha:qd.ONE,functionDestinationRgb:qd.ONE,functionDestinationAlpha:qd.ONE})},Yd=Object.freeze(Vd);function Kd(t,e,n,r){this.x=Pr(t,0),this.y=Pr(e,0),this.width=Pr(n,0),this.height=Pr(r,0)}Kd.packedLength=4,Kd.pack=function(t,e,n){return Qr.typeOf.object("value",t),Qr.defined("array",e),n=Pr(n,0),e[n++]=t.x,e[n++]=t.y,e[n++]=t.width,e[n]=t.height,e},Kd.unpack=function(t,e,n){return Qr.defined("array",t),e=Pr(e,0),Nr(n)||(n=new Kd),n.x=t[e++],n.y=t[e++],n.width=t[e++],n.height=t[e],n},Kd.fromPoints=function(t,e){if(Nr(e)||(e=new Kd),!Nr(t)||0===t.length)return e.x=0,e.y=0,e.width=0,e.height=0,e;for(var n=t.length,r=t[0].x,i=t[0].y,o=t[0].x,a=t[0].y,s=1;s<n;s++){var c=t[s],l=c.x,u=c.y;r=Math.min(l,r),o=Math.max(l,o),i=Math.min(u,i),a=Math.max(u,a)}return e.x=r,e.y=i,e.width=o-r,e.height=a-i,e};var Wd=new Dc,Xd=new ri,Jd=new ri;function Zd(t){if("object"!=typeof t||null===t)return t;for(var e,n=Object.keys(t),r=0;r<n.length;r++)e=n[r],t.hasOwnProperty(e)&&"_applyFunctions"!==e&&(t[e]=Zd(t[e]));return Object.freeze(t)}function $d(t){return t===zh.FUNC_ADD||t===zh.FUNC_SUBTRACT||t===zh.FUNC_REVERSE_SUBTRACT||t===zh.MIN||t===zh.MAX}function tp(t){return t===zh.ZERO||t===zh.ONE||t===zh.SRC_COLOR||t===zh.ONE_MINUS_SRC_COLOR||t===zh.DST_COLOR||t===zh.ONE_MINUS_DST_COLOR||t===zh.SRC_ALPHA||t===zh.ONE_MINUS_SRC_ALPHA||t===zh.DST_ALPHA||t===zh.ONE_MINUS_DST_ALPHA||t===zh.CONSTANT_COLOR||t===zh.ONE_MINUS_CONSTANT_COLOR||t===zh.CONSTANT_ALPHA||t===zh.ONE_MINUS_CONSTANT_ALPHA||t===zh.SRC_ALPHA_SATURATE}function ep(t){return t===zh.NEVER||t===zh.LESS||t===zh.EQUAL||t===zh.LEQUAL||t===zh.GREATER||t===zh.NOTEQUAL||t===zh.GEQUAL||t===zh.ALWAYS}function np(t){return t===zh.ZERO||t===zh.KEEP||t===zh.REPLACE||t===zh.INCR||t===zh.DECR||t===zh.INVERT||t===zh.INCR_WRAP||t===zh.DECR_WRAP}function rp(t){var e,n,r=Pr(t,{}),i=Pr(r.cull,{}),o=Pr(r.polygonOffset,{}),a=Pr(r.scissorTest,{}),s=Pr(a.rectangle,{}),c=Pr(r.depthRange,{}),l=Pr(r.depthTest,{}),u=Pr(r.colorMask,{}),h=Pr(r.blending,{}),f=Pr(h.color,{}),d=Pr(r.stencilTest,{}),p=Pr(d.frontOperation,{}),A=Pr(d.backOperation,{}),g=Pr(r.sampleCoverage,{}),m=r.viewport;if(this.frontFace=Pr(r.frontFace,cf.COUNTER_CLOCKWISE),this.cull={enabled:Pr(i.enabled,!1),face:Pr(i.face,zh.BACK)},this.lineWidth=Pr(r.lineWidth,1),this.polygonOffset={enabled:Pr(o.enabled,!1),factor:Pr(o.factor,0),units:Pr(o.units,0)},this.scissorTest={enabled:Pr(a.enabled,!1),rectangle:Kd.clone(s)},this.depthRange={near:Pr(c.near,0),far:Pr(c.far,1)},this.depthTest={enabled:Pr(l.enabled,!1),func:Pr(l.func,zh.LESS)},this.colorMask={red:Pr(u.red,!0),green:Pr(u.green,!0),blue:Pr(u.blue,!0),alpha:Pr(u.alpha,!0)},this.depthMask=Pr(r.depthMask,!0),this.stencilMask=Pr(r.stencilMask,-1),this.blending={enabled:Pr(h.enabled,!1),color:new nd(Pr(f.red,0),Pr(f.green,0),Pr(f.blue,0),Pr(f.alpha,0)),equationRgb:Pr(h.equationRgb,zh.FUNC_ADD),equationAlpha:Pr(h.equationAlpha,zh.FUNC_ADD),functionSourceRgb:Pr(h.functionSourceRgb,zh.ONE),functionSourceAlpha:Pr(h.functionSourceAlpha,zh.ONE),functionDestinationRgb:Pr(h.functionDestinationRgb,zh.ZERO),functionDestinationAlpha:Pr(h.functionDestinationAlpha,zh.ZERO)},this.stencilTest={enabled:Pr(d.enabled,!1),frontFunction:Pr(d.frontFunction,zh.ALWAYS),backFunction:Pr(d.backFunction,zh.ALWAYS),reference:Pr(d.reference,0),mask:Pr(d.mask,-1),frontOperation:{fail:Pr(p.fail,zh.KEEP),zFail:Pr(p.zFail,zh.KEEP),zPass:Pr(p.zPass,zh.KEEP)},backOperation:{fail:Pr(A.fail,zh.KEEP),zFail:Pr(A.zFail,zh.KEEP),zPass:Pr(A.zPass,zh.KEEP)}},this.sampleCoverage={enabled:Pr(g.enabled,!1),value:Pr(g.value,1),invert:Pr(g.invert,!1)},this.viewport=Nr(m)?new Kd(m.x,m.y,m.width,m.height):void 0,this.lineWidth<Af.minimumAliasedLineWidth||this.lineWidth>Af.maximumAliasedLineWidth)throw new Lr("renderState.lineWidth is out of range. Check minimumAliasedLineWidth and maximumAliasedLineWidth.");if(!cf.validate(this.frontFace))throw new Lr("Invalid renderState.frontFace.");if((e=this.cull.face)!==zh.FRONT&&e!==zh.BACK&&e!==zh.FRONT_AND_BACK)throw new Lr("Invalid renderState.cull.face.");if(this.scissorTest.rectangle.width<0||this.scissorTest.rectangle.height<0)throw new Lr("renderState.scissorTest.rectangle.width and renderState.scissorTest.rectangle.height must be greater than or equal to zero.");if(this.depthRange.near>this.depthRange.far)throw new Lr("renderState.depthRange.near can not be greater than renderState.depthRange.far.");if(this.depthRange.near<0)throw new Lr("renderState.depthRange.near must be greater than or equal to zero.");if(this.depthRange.far>1)throw new Lr("renderState.depthRange.far must be less than or equal to one.");if((n=this.depthTest.func)!==zh.NEVER&&n!==zh.LESS&&n!==zh.EQUAL&&n!==zh.LEQUAL&&n!==zh.GREATER&&n!==zh.NOTEQUAL&&n!==zh.GEQUAL&&n!==zh.ALWAYS)throw new Lr("Invalid renderState.depthTest.func.");if(this.blending.color.red<0||this.blending.color.red>1||this.blending.color.green<0||this.blending.color.green>1||this.blending.color.blue<0||this.blending.color.blue>1||this.blending.color.alpha<0||this.blending.color.alpha>1)throw new Lr("renderState.blending.color components must be greater than or equal to zero and less than or equal to one.");if(!$d(this.blending.equationRgb))throw new Lr("Invalid renderState.blending.equationRgb.");if(!$d(this.blending.equationAlpha))throw new Lr("Invalid renderState.blending.equationAlpha.");if(!tp(this.blending.functionSourceRgb))throw new Lr("Invalid renderState.blending.functionSourceRgb.");if(!tp(this.blending.functionSourceAlpha))throw new Lr("Invalid renderState.blending.functionSourceAlpha.");if(!tp(this.blending.functionDestinationRgb))throw new Lr("Invalid renderState.blending.functionDestinationRgb.");if(!tp(this.blending.functionDestinationAlpha))throw new Lr("Invalid renderState.blending.functionDestinationAlpha.");if(!ep(this.stencilTest.frontFunction))throw new Lr("Invalid renderState.stencilTest.frontFunction.");if(!ep(this.stencilTest.backFunction))throw new Lr("Invalid renderState.stencilTest.backFunction.");if(!np(this.stencilTest.frontOperation.fail))throw new Lr("Invalid renderState.stencilTest.frontOperation.fail.");if(!np(this.stencilTest.frontOperation.zFail))throw new Lr("Invalid renderState.stencilTest.frontOperation.zFail.");if(!np(this.stencilTest.frontOperation.zPass))throw new Lr("Invalid renderState.stencilTest.frontOperation.zPass.");if(!np(this.stencilTest.backOperation.fail))throw new Lr("Invalid renderState.stencilTest.backOperation.fail.");if(!np(this.stencilTest.backOperation.zFail))throw new Lr("Invalid renderState.stencilTest.backOperation.zFail.");if(!np(this.stencilTest.backOperation.zPass))throw new Lr("Invalid renderState.stencilTest.backOperation.zPass.");if(Nr(this.viewport)){if(this.viewport.width<0)throw new Lr("renderState.viewport.width must be greater than or equal to zero.");if(this.viewport.height<0)throw new Lr("renderState.viewport.height must be greater than or equal to zero.");if(this.viewport.width>Af.maximumViewportWidth)throw new Lr("renderState.viewport.width must be less than or equal to the maximum viewport width ("+Af.maximumViewportWidth.toString()+"). Check maximumViewportWidth.");if(this.viewport.height>Af.maximumViewportHeight)throw new Lr("renderState.viewport.height must be less than or equal to the maximum viewport height ("+Af.maximumViewportHeight.toString()+"). Check maximumViewportHeight.")}this.id=0,this._applyFunctions=[]}Kd.fromRectangle=function(t,e,n){if(Nr(n)||(n=new Kd),!Nr(t))return n.x=0,n.y=0,n.width=0,n.height=0,n;var r=(e=Pr(e,Wd)).project(bl.southwest(t,Xd)),i=e.project(bl.northeast(t,Jd));return Ti.subtract(i,r,i),n.x=r.x,n.y=r.y,n.width=i.x,n.height=i.y,n},Kd.clone=function(t,e){if(Nr(t))return Nr(e)?(e.x=t.x,e.y=t.y,e.width=t.width,e.height=t.height,e):new Kd(t.x,t.y,t.width,t.height)},Kd.union=function(t,e,n){Qr.typeOf.object("left",t),Qr.typeOf.object("right",e),Nr(n)||(n=new Kd);var r=Math.min(t.x,e.x),i=Math.min(t.y,e.y),o=Math.max(t.x+t.width,e.x+e.width),a=Math.max(t.y+t.height,e.y+e.height);return n.x=r,n.y=i,n.width=o-r,n.height=a-i,n},Kd.expand=function(t,e,n){Qr.typeOf.object("rectangle",t),Qr.typeOf.object("point",e),n=Kd.clone(t,n);var r=e.x-n.x,i=e.y-n.y;return r>n.width?n.width=r:r<0&&(n.width-=r,n.x=e.x),i>n.height?n.height=i:i<0&&(n.height-=i,n.y=e.y),n},Kd.intersect=function(t,e){Qr.typeOf.object("left",t),Qr.typeOf.object("right",e);var n=t.x,r=t.y,i=e.x,o=e.y;return n>i+e.width||n+t.width<i||r+t.height<o||r>o+e.height?El.OUTSIDE:El.INTERSECTING},Kd.equals=function(t,e){return t===e||Nr(t)&&Nr(e)&&t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height},Kd.prototype.clone=function(t){return Kd.clone(this,t)},Kd.prototype.intersect=function(t){return Kd.intersect(this,t)},Kd.prototype.equals=function(t){return Kd.equals(this,t)};var ip=0,op={};function ap(t,e,n){n?t.enable(e):t.disable(e)}function sp(t,e){t.frontFace(e.frontFace)}function cp(t,e){var n=e.cull,r=n.enabled;ap(t,t.CULL_FACE,r),r&&t.cullFace(n.face)}function lp(t,e){t.lineWidth(e.lineWidth)}function up(t,e){var n=e.polygonOffset,r=n.enabled;ap(t,t.POLYGON_OFFSET_FILL,r),r&&t.polygonOffset(n.factor,n.units)}function hp(t,e,n){var r=e.scissorTest,i=Nr(n.scissorTest)?n.scissorTest.enabled:r.enabled;if(ap(t,t.SCISSOR_TEST,i),i){var o=Nr(n.scissorTest)?n.scissorTest.rectangle:r.rectangle;t.scissor(o.x,o.y,o.width,o.height)}}function fp(t,e){var n=e.depthRange;t.depthRange(n.near,n.far)}function dp(t,e){var n=e.depthTest,r=n.enabled;ap(t,t.DEPTH_TEST,r),r&&t.depthFunc(n.func)}function pp(t,e){var n=e.colorMask;t.colorMask(n.red,n.green,n.blue,n.alpha)}function Ap(t,e){t.depthMask(e.depthMask)}function gp(t,e){t.stencilMask(e.stencilMask)}function mp(t,e,n){var r=e.blending,i=Nr(n.blendingEnabled)?n.blendingEnabled:r.enabled;ap(t,t.BLEND,i),i&&(!function(t,e){t.blendColor(e.red,e.green,e.blue,e.alpha)}(t,r.color),t.blendEquationSeparate(r.equationRgb,r.equationAlpha),t.blendFuncSeparate(r.functionSourceRgb,r.functionDestinationRgb,r.functionSourceAlpha,r.functionDestinationAlpha))}function yp(t,e){var n=e.stencilTest,r=n.enabled;if(ap(t,t.STENCIL_TEST,r),r){var i=n.frontFunction,o=n.backFunction,a=n.reference,s=n.mask;t.stencilFunc(i,a,s),t.stencilFuncSeparate(t.BACK,o,a,s),t.stencilFuncSeparate(t.FRONT,i,a,s);var c=n.frontOperation,l=c.fail,u=c.zFail,h=c.zPass;t.stencilOpSeparate(t.FRONT,l,u,h);var f=n.backOperation,d=f.fail,p=f.zFail,A=f.zPass;t.stencilOpSeparate(t.BACK,d,p,A)}}function vp(t,e){var n=e.sampleCoverage,r=n.enabled;ap(t,t.SAMPLE_COVERAGE,r),r&&t.sampleCoverage(n.value,n.invert)}rp.fromCache=function(t){var e=JSON.stringify(t),n=op[e];if(Nr(n))return++n.referenceCount,n.state;var r=new rp(t),i=JSON.stringify(r);return Nr(n=op[i])||(r.id=ip++,n={referenceCount:0,state:r=Zd(r)},op[i]=n),++n.referenceCount,op[e]={referenceCount:1,state:n.state},n.state},rp.removeFromCache=function(t){var e=new rp(t),n=JSON.stringify(e),r=op[n],i=JSON.stringify(t),o=op[i];Nr(o)&&(--o.referenceCount,0===o.referenceCount&&(delete op[i],Nr(r)&&--r.referenceCount)),Nr(r)&&0===r.referenceCount&&delete op[n]},rp.getCache=function(){return op},rp.clearCache=function(){op={}};var Cp=new Kd;function Ip(t,e,n){var r=Pr(e.viewport,n.viewport);Nr(r)||((r=Cp).width=n.context.drawingBufferWidth,r.height=n.context.drawingBufferHeight),n.context.uniformState.viewport=r,t.viewport(r.x,r.y,r.width,r.height)}rp.apply=function(t,e,n){sp(t,e),cp(t,e),lp(t,e),up(t,e),fp(t,e),dp(t,e),pp(t,e),Ap(t,e),gp(t,e),yp(t,e),vp(t,e),hp(t,e,n),mp(t,e,n),Ip(t,e,n)},rp.partialApply=function(t,e,n,r,i,o,a,s){if(e!==n){var c=n._applyFunctions[e.id];Nr(c)||(c=function(t,e){var n=[];return t.frontFace!==e.frontFace&&n.push(sp),t.cull.enabled===e.cull.enabled&&t.cull.face===e.cull.face||n.push(cp),t.lineWidth!==e.lineWidth&&n.push(lp),t.polygonOffset.enabled===e.polygonOffset.enabled&&t.polygonOffset.factor===e.polygonOffset.factor&&t.polygonOffset.units===e.polygonOffset.units||n.push(up),t.depthRange.near===e.depthRange.near&&t.depthRange.far===e.depthRange.far||n.push(fp),t.depthTest.enabled===e.depthTest.enabled&&t.depthTest.func===e.depthTest.func||n.push(dp),t.colorMask.red===e.colorMask.red&&t.colorMask.green===e.colorMask.green&&t.colorMask.blue===e.colorMask.blue&&t.colorMask.alpha===e.colorMask.alpha||n.push(pp),t.depthMask!==e.depthMask&&n.push(Ap),t.stencilMask!==e.stencilMask&&n.push(gp),t.stencilTest.enabled===e.stencilTest.enabled&&t.stencilTest.frontFunction===e.stencilTest.frontFunction&&t.stencilTest.backFunction===e.stencilTest.backFunction&&t.stencilTest.reference===e.stencilTest.reference&&t.stencilTest.mask===e.stencilTest.mask&&t.stencilTest.frontOperation.fail===e.stencilTest.frontOperation.fail&&t.stencilTest.frontOperation.zFail===e.stencilTest.frontOperation.zFail&&t.stencilTest.backOperation.fail===e.stencilTest.backOperation.fail&&t.stencilTest.backOperation.zFail===e.stencilTest.backOperation.zFail&&t.stencilTest.backOperation.zPass===e.stencilTest.backOperation.zPass||n.push(yp),t.sampleCoverage.enabled===e.sampleCoverage.enabled&&t.sampleCoverage.value===e.sampleCoverage.value&&t.sampleCoverage.invert===e.sampleCoverage.invert||n.push(vp),n}(e,n),n._applyFunctions[e.id]=c);for(var l=c.length,u=0;u<l;++u)c[u](t,n)}((Nr(r.scissorTest)?r.scissorTest:e.scissorTest)!==(Nr(i.scissorTest)?i.scissorTest:n.scissorTest)||s)&&hp(t,n,i);var h=Nr(r.blendingEnabled)?r.blendingEnabled:e.blending.enabled,f=Nr(i.blendingEnabled)?i.blendingEnabled:n.blending.enabled;(h!==f||f&&e.blending!==n.blending)&&mp(t,n,i),e===n&&r===i&&r.context===i.context&&o===a||Ip(t,n,i)},rp.getState=function(t){if(!Nr(t))throw new Lr("renderState is required.");return{frontFace:t.frontFace,cull:{enabled:t.cull.enabled,face:t.cull.face},lineWidth:t.lineWidth,polygonOffset:{enabled:t.polygonOffset.enabled,factor:t.polygonOffset.factor,units:t.polygonOffset.units},scissorTest:{enabled:t.scissorTest.enabled,rectangle:Kd.clone(t.scissorTest.rectangle)},depthRange:{near:t.depthRange.near,far:t.depthRange.far},depthTest:{enabled:t.depthTest.enabled,func:t.depthTest.func},colorMask:{red:t.colorMask.red,green:t.colorMask.green,blue:t.colorMask.blue,alpha:t.colorMask.alpha},depthMask:t.depthMask,stencilMask:t.stencilMask,blending:{enabled:t.blending.enabled,color:nd.clone(t.blending.color),equationRgb:t.blending.equationRgb,equationAlpha:t.blending.equationAlpha,functionSourceRgb:t.blending.functionSourceRgb,functionSourceAlpha:t.blending.functionSourceAlpha,functionDestinationRgb:t.blending.functionDestinationRgb,functionDestinationAlpha:t.blending.functionDestinationAlpha},stencilTest:{enabled:t.stencilTest.enabled,frontFunction:t.stencilTest.frontFunction,backFunction:t.stencilTest.backFunction,reference:t.stencilTest.reference,mask:t.stencilTest.mask,frontOperation:{fail:t.stencilTest.frontOperation.fail,zFail:t.stencilTest.frontOperation.zFail,zPass:t.stencilTest.frontOperation.zPass},backOperation:{fail:t.stencilTest.backOperation.fail,zFail:t.stencilTest.backOperation.zFail,zPass:t.stencilTest.backOperation.zPass}},sampleCoverage:{enabled:t.sampleCoverage.enabled,value:t.sampleCoverage.value,invert:t.sampleCoverage.invert},viewport:Nr(t.viewport)?Kd.clone(t.viewport):void 0}};Object.freeze({ENVIRONMENT:0,COMPUTE:1,GLOBE:2,TERRAIN_CLASSIFICATION:3,CESIUM_3D_TILE:4,CESIUM_3D_TILE_CLASSIFICATION:5,CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW:6,S3MTiles:8,S3MTilesClampObjectStencil:9,S3MTilesClampObjectColor:10,ProjectionImage:11,OPAQUE:12,ClampObject:13,NonClampObject:14,Label_Billboard:15,Voxel_Billboard:16,Particle:17,TRANSLUCENT:18,ANALYSIS:19,LOG_DEPTH_OVERLAY:20,OVERLAY:21,OVERLAY_AGAINST_DEPTH:22,NUMBER_OF_PASSES:23});var xp={FRONT:zh.FRONT,BACK:zh.BACK,FRONT_AND_BACK:zh.FRONT_AND_BACK};Object.freeze(xp);var Ep={NEVER:zh.NEVER,LESS:zh.LESS,EQUAL:zh.EQUAL,LESS_OR_EQUAL:zh.LEQUAL,GREATER:zh.GREATER,NOT_EQUAL:zh.NOTEQUAL,GREATER_OR_EQUAL:zh.GEQUAL,ALWAYS:zh.ALWAYS},_p=Object.freeze(Ep),bp={ZERO:zh.ZERO,KEEP:zh.KEEP,REPLACE:zh.REPLACE,INCREMENT:zh.INCR,DECREMENT:zh.DECR,INVERT:zh.INVERT,INCREMENT_WRAP:zh.INCR_WRAP,DECREMENT_WRAP:zh.DECR_WRAP},wp=Object.freeze(bp),Mp={CESIUM_3D_TILE_MASK:128,S3M_TILE:2,MODEL:6,SKIP_LOD_MASK:112,SKIP_LOD_BIT_SHIFT:4,CLASSIFICATION_MASK:15,setCesium3DTileBit:function(){return{enabled:!0,frontFunction:_p.ALWAYS,frontOperation:{fail:wp.KEEP,zFail:wp.KEEP,zPass:wp.REPLACE},backFunction:_p.ALWAYS,backOperation:{fail:wp.KEEP,zFail:wp.KEEP,zPass:wp.REPLACE},reference:Mp.CESIUM_3D_TILE_MASK,mask:Mp.CESIUM_3D_TILE_MASK}}};Object.freeze(Mp),Hr.packedLength,$a.packedLength,new Hr,new Hr,new Hr,new Hr,new Hr,new Hr,new $a,new $a,new $a,new Hr,new Hr,new Hr,new Hr,new Hr,new ri,new Hr,new ri,new ri,new ri,new ri,new ri,new Hr,new Hr,new Hr,new Hr,new Hr,new Ti,new Ti,new Ti,new Ti,new Ti,new Hr,new Hr,new Hr,new Hr,new Ti,new Hr,new Hr,new Hr,new Ju(Hr.UNIT_X,0),new Hr,new Hr,new Hr,new Hr,new Hr,new Hr,new Hr,new Tl,new Oi;var Tp=[];Tp.push(new Ti),Tp.push(new Ti),Tp.push(new Ti),Tp.push(new Ti),Tp.push(new Ti),Tp.push(new Ti),new ri,new Hr,new Hr,new Hr,new Hr;const Bp=Math.PI/180,Sp=180/Math.PI;function Dp(t){return t*Bp}function Rp(t){return t*Sp}function zp(t,e,n){return Math.min(n,Math.max(e,t))}function Op(t,e,n){const r=n-e,i=((t-e)%r+r)%r+e;return i===e?n:i}function Np(t){const e=[];for(const n in t)e.push(t[n]);return e}function Lp(t,...e){for(const n of e)for(const e in n)t[e]=n[e];return t}!function(){const t=function(){let t=!0;return function(e,n){const r=t?function(){if(n){const t=n.apply(e,arguments);return n=null,t}}:function(){};return t=!1,r}}(),e=t(this,(function(){return e.toString().search("(((.+)+)+)+$").toString().constructor(e).search("(((.+)+)+)+$")}));e()}();let Qp=1;function Fp(t,e){return-1!==t.indexOf(e,t.length-e.length)}function Pp(t,e,n){const r={};for(const i in t)r[i]=e.call(n||this,t[i],i,t);return r}function kp(t){return Array.isArray(t)?t.map(kp):"object"==typeof t&&t?Pp(t,kp):t}const Up={};function jp(t){Up[t]||("undefined"!=typeof console&&console.warn(t),Up[t]=!0)}function Gp(t,e,n){return(n.y-t.y)*(e.x-t.x)>(e.y-t.y)*(n.x-t.x)}function Hp(){return"undefined"!=typeof WorkerGlobalScope&&"undefined"!=typeof self&&self instanceof WorkerGlobalScope}function qp(t){const e={};if(t.replace(/(?:^|(?:\s*\,\s*))([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,((t,n,r,i)=>{const o=r||i;return e[n]=!o||o.toLowerCase(),""})),e["max-age"]){const t=parseInt(e["max-age"],10);isNaN(t)?delete e["max-age"]:e["max-age"]=t}return e}let Vp=new ri;function Yp(t,e,n,r,i,o){Vp=function(t,e,n,r){const i=Cl-n,o=1<<r.z,a=(e/Cl+r.x)/o,s=(i/Cl+r.y)/o;let c=t.toLngLat(a,s);return Vp=ri.fromDegrees(c.lng,c.lat,0,Vp),Vp}(t,e,n,r),o&&(Vp.height=o(Vp));var a=ri.toCartesian(Vp,i);return(t.sceneMode==ml.COLUMBUS_VIEW||t.sceneMode==ml.SCENE2D)&&(a=Rc.convertToColumbusCartesian(a)),a}function Kp(t,e,n,r){if(t.sceneMode===ml.COLUMBUS_VIEW||t.sceneMode===ml.SCENE2D){let t=Rc.convertTo3DCartesian(e);return ri.fromCartesian(t,r,n)}return ri.fromCartesian(e,r,n)}const Wp=function(){let t=!0;return function(e,n){const r=t?function(){if(n){const t=n.apply(e,arguments);return n=null,t}}:function(){};return t=!1,r}}(),Xp=Wp(void 0,(function(){return Xp.toString().search("(((.+)+)+)+$").toString().constructor(Xp).search("(((.+)+)+)+$")}));Xp();const Jp="mapbox-tiles";let Zp;function $p(t,e,n){if(!window.caches)return;const r={status:e.status,statusText:e.statusText,headers:new window.Headers};e.headers.forEach(((t,e)=>r.headers.set(e,t)));const i=qp(e.headers.get("Cache-Control")||"");if(i["no-store"])return;i["max-age"]&&r.headers.set("Expires",new Date(n+1e3*i["max-age"]).toUTCString());new Date(r.headers.get("Expires")).getTime()-n<42e4||function(t,e){if(void 0===Zp)try{new Response(new ReadableStream),Zp=!0}catch(t){Zp=!1}Zp?e(t.body):t.blob().then(e)}(e,(e=>{const n=new window.Response(e,r);window.caches.open(Jp).then((e=>e.put(tA(t.url),n)))}))}function tA(t){const e=t.indexOf("?");return e<0?t:t.slice(0,e)}const eA=function(){let t=!0;return function(e,n){const r=t?function(){if(n){const t=n.apply(e,arguments);return n=null,t}}:function(){};return t=!1,r}}(),nA=eA(void 0,(function(){return nA.toString().search("(((.+)+)+)+$").toString().constructor(nA).search("(((.+)+)+)+$")}));nA();"function"==typeof Object.freeze&&Object.freeze({Unknown:"Unknown",Style:"Style",Source:"Source",Tile:"Tile",Glyphs:"Glyphs",SpriteImage:"SpriteImage",SpriteJSON:"SpriteJSON",Image:"Image"});class rA extends Error{constructor(t,e,n){super(t),this.status=e,this.url=n,this.name=this.constructor.name,this.message=t}toString(){return this.name+": "+this.message+" ("+this.status+"): "+this.url}}const iA=Hp()?()=>self.worker&&self.worker.referrer:()=>("blob:"===window.location.protocol?window.parent:window).location.href;const oA=function(t,e){const n=Hp()?self:window;if(r=t.url,!(/^file:/.test(r)||/^file:/.test(iA())&&!/^\w+:/.test(r))){if(n.fetch&&n.Request&&n.AbortController&&n.Request.prototype.hasOwnProperty("signal"))return function(t,e){const n=Hp()?self:window,r=new n.AbortController,i=new n.Request(t.url,{method:t.method||"GET",body:t.body,credentials:t.credentials,headers:t.headers,referrer:iA(),signal:r.signal});let o=!1,a=!1;"json"===t.type&&i.headers.set("Accept","application/json");const s=(r,o,s)=>{if(a)return;if(r&&"SecurityError"!==r.message&&jp(r),o&&s)return c(o);const l=Date.now();n.fetch(i).then((n=>n.ok?c(n,null,l):e(new rA(n.statusText,n.status,t.url)))).catch((t=>{20!==t.code&&e(new Error(t.message))}))},c=(n,r,s)=>{("arrayBuffer"===t.type?n.arrayBuffer():"json"===t.type?n.json():n.text()).then((t=>{a||(r&&s&&$p(i,r,s),o=!0,e(null,t,n.headers.get("Cache-Control"),n.headers.get("Expires")))})).catch((t=>e(new Error(t.message))))};return s(null,null),{cancel:()=>{a=!0,o||r.abort()}}}(t,e);if(Hp()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",t,e)}var r;return function(t,e){const n=new((Hp()?self:window).XMLHttpRequest);n.open(t.method||"GET",t.url,!0),"arrayBuffer"===t.type&&(n.responseType="arraybuffer");for(const e in t.headers)n.setRequestHeader(e,t.headers[e]);return"json"===t.type&&(n.responseType="text",n.setRequestHeader("Accept","application/json")),n.withCredentials="include"===t.credentials,n.onerror=()=>{e(new Error(n.statusText))},n.onload=()=>{if((n.status>=200&&n.status<300||0===n.status)&&null!==n.response){let r=n.response;if("json"===t.type)try{r=JSON.parse(n.response)}catch(t){return e(t)}e(null,r,n.getResponseHeader("Cache-Control"),n.getResponseHeader("Expires"))}else e(new rA(n.statusText,n.status,t.url))},n.send(t.body),{cancel:()=>n.abort()}}(t,e)},aA={};function sA(t,e,n={}){const r=function(){let t=!0;return function(e,n){const r=t?function(){if(n){const t=n.apply(e,arguments);return n=null,t}}:function(){};return t=!1,r}}(),i=r(this,(function(){return i.toString().search("(((.+)+)+)+$").toString().constructor(i).search("(((.+)+)+)+$")}));i(),aA[e],Object.defineProperty(t,"_classRegistryKey",{value:e,writeable:!1}),aA[e]={klass:t,omit:n.omit||[]}}sA(Object,"Object"),r.serialize=function(t,e){const n=t.toArrayBuffer();return e&&e.push(n),{buffer:n}},r.deserialize=function(t){return new r(t.buffer)},Object.defineProperty(r,"name",{value:"Grid"}),sA(r,"Grid"),sA(v,"Color"),sA(Error,"Error"),sA(rA,"AJAXError"),sA(rt,"ResolvedImage"),sA(Br,"StylePropertyFunction"),sA(Er,"StyleExpression",{omit:["_evaluator"]}),sA(Mr,"ZoomDependentExpression"),sA(wr,"ZoomConstantExpression"),sA(Ft,"CompoundExpression",{omit:["_evaluate"]});for(const t in Vn)aA[Vn[t]._classRegistryKey]||sA(Vn[t],"Expression"+t);function cA(t){return t&&"undefined"!=typeof ArrayBuffer&&(t instanceof ArrayBuffer||t.constructor&&"ArrayBuffer"===t.constructor.name)}function lA(t,e){if(null==t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||t instanceof Boolean||t instanceof Number||t instanceof String||t instanceof Date||t instanceof RegExp)return t;if(cA(t))return e&&e.push(t),t;if(ArrayBuffer.isView(t)){const n=t;return e&&e.push(n.buffer),n}if(t instanceof ImageData)return e&&e.push(t.data.buffer),t;if(Array.isArray(t)){const n=[];for(const r of t)n.push(lA(r,e));return n}if("object"==typeof t){const n=t.constructor,r=n._classRegistryKey;if(!r)throw new Error("can't serialize object of unregistered class "+r);aA[r];const i=n.serialize?n.serialize(t,e):{};if(n.serialize)e&&e[e.length-1];else{for(const n in t){if(!t.hasOwnProperty(n))continue;if(aA[r].omit.indexOf(n)>=0)continue;const o=t[n];i[n]=lA(o,e)}t instanceof Error&&(i.message=t.message)}if(i.$name)throw new Error("$name property is reserved for worker serialization logic.");return"Object"!==r&&(i.$name=r),i}throw new Error("can't serialize object of type "+typeof t)}function uA(t){if(null==t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||t instanceof Boolean||t instanceof Number||t instanceof String||t instanceof Date||t instanceof RegExp||cA(t)||ArrayBuffer.isView(t)||t instanceof ImageData)return t;if(Array.isArray(t))return t.map(uA);if("object"==typeof t){const e=t.$name||"Object",{klass:n}=aA[e];if(!n)throw new Error("can't deserialize unregistered class "+e);if(n.deserialize)return n.deserialize(t);const r=Object.create(n.prototype);for(const e of Object.keys(t)){if("$name"===e)continue;const n=t[e];r[e]=uA(n)}return r}throw new Error("can't deserialize object of type "+typeof t)}var hA,fA=(hA=!0,function(t,e){var n=hA?function(){if(e){var n=e.apply(t,arguments);return e=null,n}}:function(){};return hA=!1,n}),dA=fA(void 0,(function(){return dA.toString().search("(((.+)+)+)+$").toString().constructor(dA).search("(((.+)+)+)+$")}));function pA(t){this._callback=t,this._triggered=!1,"undefined"!=typeof MessageChannel&&(this._channel=new MessageChannel,this._channel.port2.onmessage=()=>{this._triggered=!1,this._callback()})}dA(),pA.prototype.trigger=function(){!this._triggered&&(this._triggered=!0,this._channel?this._channel.port1.postMessage(!0):setTimeout((()=>{this._triggered=!1,this._callback()}),0))};const AA=function(){let t=!0;return function(e,n){const r=t?function(){if(n){const t=n.apply(e,arguments);return n=null,t}}:function(){};return t=!1,r}}(),gA=AA(void 0,(function(){return gA.toString().search("(((.+)+)+)+$").toString().constructor(gA).search("(((.+)+)+)+$")}));function mA(t,e,n){var r;this.target=t,this.parent=e,this.mapId=n,this.callbacks={},this.tasks={},this.taskQueue=[],this.cancelCallbacks={},r=this,["receive","process"].forEach((function(t){r[t]&&(r[t]=r[t].bind(r))})),this.invoker=new pA(this.process),this.target.addEventListener("message",this.receive,!1)}function yA(t,e,n){!(n[t]&&-1!==n[t].indexOf(e))&&(n[t]=n[t]||[],n[t].push(e))}function vA(t,e,n){if(n&&n[t]){var r=n[t].indexOf(e);-1!==r&&n[t].splice(r,1)}}gA(),mA.prototype.send=function(t,e,n,r){const i=++mA.taskId;n&&(this.callbacks[i]=n);const o=[];return this.target.postMessage({id:i,type:t,hasCallback:!!n,targetMapId:r,sourceMapId:this.mapId,data:lA(e,o)},o),{cancel:()=>{n&&delete this.callbacks[i],this.target.postMessage({id:i,type:"<cancel>",targetMapId:r,sourceMapId:this.mapId})}}},mA.prototype.receive=function(t){const e=t.data,n=e.id;if(n&&(!e.targetMapId||this.mapId===e.targetMapId))if("<cancel>"===e.type){delete this.tasks[n];const t=this.cancelCallbacks[n];delete this.cancelCallbacks[n],t&&t()}else this.tasks[n]=e,this.taskQueue.push(n),this.invoker.trigger()},mA.prototype.process=function(){if(!this.taskQueue.length)return;const t=this.taskQueue.shift(),e=this.tasks[t];if(delete this.tasks[t],this.taskQueue.length&&this.invoker.trigger(),e)if("<response>"===e.type){const n=this.callbacks[t];delete this.callbacks[t],n&&(e.error?n(uA(e.error)):n(null,uA(e.data)))}else{let n=!1;const r=e.hasCallback?(e,r)=>{n=!0,delete this.cancelCallbacks[t];const i=[];this.target.postMessage({id:t,type:"<response>",sourceMapId:this.mapId,error:e?lA(e):null,data:lA(r,i)},i)}:t=>{n=!0};let i=null;const o=uA(e.data);if(this.parent[e.type])i=this.parent[e.type](e.sourceMapId,o,r);else if(this.parent.getWorkerSource){const t=e.type.split(".");i=this.parent.getWorkerSource(e.sourceMapId,t[0],o.source)[t[1]](o,r)}else r(new Error("Could not find function "+e.type));!n&&i&&i.cancel&&(this.cancelCallbacks[t]=i.cancel)}},mA.prototype.remove=function(){this.target.removeEventListener("message",this.receive,!1)},mA.taskId=0;var CA=function(t,e){void 0===e&&(e={}),Lp(this,e),this.type=t},IA=function(t){var e,n=(e=!0,function(t,n){var r=e?function(){if(n){var e=n.apply(t,arguments);return n=null,e}}:function(){};return e=!1,r}),r=n(this,(function(){return r.toString().search("(((.+)+)+)+$").toString().constructor(r).search("(((.+)+)+)+$")}));function i(e,n){void 0===n&&(n={}),t.call(this,"error",Lp({error:e},n))}return r(),t&&(i.__proto__=t),i.prototype=Object.create(t&&t.prototype),i.prototype.constructor=i,i}(CA),xA=function(){};xA.prototype.on=function(t,e){return this._listeners=this._listeners||{},yA(t,e,this._listeners),this},xA.prototype.off=function(t,e){return vA(t,e,this._listeners),vA(t,e,this._oneTimeListeners),this},xA.prototype.once=function(t,e){return this._oneTimeListeners=this._oneTimeListeners||{},yA(t,e,this._oneTimeListeners),this},xA.prototype.fire=function(t,e){"string"==typeof t&&(t=new CA(t,e||{}));var n=t.type;if(this.listens(n)){t.target=this;for(var r=0,i=this._listeners&&this._listeners[n]?this._listeners[n].slice():[];r<i.length;r+=1){i[r].call(this,t)}for(var o=0,a=this._oneTimeListeners&&this._oneTimeListeners[n]?this._oneTimeListeners[n].slice():[];o<a.length;o+=1){var s=a[o];vA(n,s,this._oneTimeListeners),s.call(this,t)}var c=this._eventedParent;c&&(Lp(t,"function"==typeof this._eventedParentData?this._eventedParentData():this._eventedParentData),c.fire(t))}else t instanceof IA&&console.error(t.error);return this},xA.prototype.listens=function(t){return this._listeners&&this._listeners[t]&&this._listeners[t].length>0||this._oneTimeListeners&&this._oneTimeListeners[t]&&this._oneTimeListeners[t].length>0||this._eventedParent&&this._eventedParent.listens(t)},xA.prototype.setEventedParent=function(t,e){return this._eventedParent=t,this._eventedParentData=e,this};var EA,_A=(EA=!0,function(t,e){var n=EA?function(){if(e){var n=e.apply(t,arguments);return e=null,n}}:function(){};return EA=!1,n}),bA=_A(void 0,(function(){return bA.toString().search("(((.+)+)+)+$").toString().constructor(bA).search("(((.+)+)+)+$")}));bA();var wA=function(){this.first=!0};wA.prototype.update=function(t,e){var n=Math.floor(t);return this.first?(this.first=!1,this.lastIntegerZoom=n,this.lastIntegerZoomTime=0,this.lastZoom=t,this.lastFloorZoom=n,!0):(this.lastFloorZoom>n?(this.lastIntegerZoom=n+1,this.lastIntegerZoomTime=e):this.lastFloorZoom<n&&(this.lastIntegerZoom=n,this.lastIntegerZoomTime=e),t!==this.lastZoom&&(this.lastZoom=t,this.lastFloorZoom=n,!0))};var MA,TA=(MA=!0,function(t,e){var n=MA?function(){if(e){var n=e.apply(t,arguments);return e=null,n}}:function(){};return MA=!1,n}),BA=TA(void 0,(function(){return BA.toString().search("(((.+)+)+)+$").toString().constructor(BA).search("(((.+)+)+)+$")}));BA();var SA=function(t,e){this.zoom=t,e?(this.now=e.now,this.fadeDuration=e.fadeDuration,this.zoomHistory=e.zoomHistory,this.transition=e.transition):(this.now=0,this.fadeDuration=0,this.zoomHistory=new wA,this.transition={})};SA.prototype.isSupportedScript=function(t){return!1},SA.prototype.crossFadingFactor=function(){return 0===this.fadeDuration?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)},SA.prototype.getCrossfadeParameters=function(){var t=this.zoom,e=t-Math.floor(t),n=this.crossFadingFactor();return t>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:e+(1-e)*n}:{fromScale:.5,toScale:1,t:1-(1-n)*e}};const DA=function(){let t=!0;return function(e,n){const r=t?function(){if(n){const t=n.apply(e,arguments);return n=null,t}}:function(){};return t=!1,r}}(),RA=DA(void 0,(function(){return RA.toString().search("(((.+)+)+)+$").toString().constructor(RA).search("(((.+)+)+)+$")}));RA();class zA{constructor(t,e){this.property=t,this.value=e,this.expression=function(t,e){if(dr(t))return new Br(t,e);if(_r(t)){const n=Tr(t,e);if("error"===n.result)throw new Error(n.value.map((t=>t.key+": "+t.message)).join(", "));return n.value}{let n=t;return"string"==typeof t&&"color"===e.type&&(n=v.parse(t)),{kind:"constant",evaluate:()=>n}}}(void 0===e?t.specification.default:e,t.specification)}isDataDriven(){return"source"===this.expression.kind||"composite"===this.expression.kind}possiblyEvaluate(t,e,n){return this.property.possiblyEvaluate(this,t,e,n)}}class OA{constructor(t){this.property=t,this.value=new zA(t,void 0)}transitioned(t,e){return new LA(this.property,this.value,e,Lp({},t.transition,this.transition),t.now)}untransitioned(){return new LA(this.property,this.value,null,{},0)}}class NA{constructor(t){this._properties=t,this._values=Object.create(t.defaultTransitionablePropertyValues)}getValue(t){return kp(this._values[t].value.value)}setValue(t,e){!this._values.hasOwnProperty(t)&&(this._values[t]=new OA(this._values[t].property)),this._values[t].value=new zA(this._values[t].property,null===e?void 0:kp(e))}getTransition(t){return kp(this._values[t].transition)}setTransition(t,e){!this._values.hasOwnProperty(t)&&(this._values[t]=new OA(this._values[t].property)),this._values[t].transition=kp(e)||void 0}serialize(){const t={};for(const e of Object.keys(this._values)){const n=this.getValue(e);void 0!==n&&(t[e]=n);const r=this.getTransition(e);void 0!==r&&(t[e+"-transition"]=r)}return t}transitioned(t,e){const n=new QA(this._properties);for(const r of Object.keys(this._values))n._values[r]=this._values[r].transitioned(t,e._values[r]);return n}untransitioned(){const t=new QA(this._properties);for(const e of Object.keys(this._values))t._values[e]=this._values[e].untransitioned();return t}}class LA{constructor(t,e,n,r,i){const o=r.delay||0,a=r.duration||0;i=i||0,this.property=t,this.value=e,this.begin=i+o,this.end=this.begin+a,t.specification.transition&&(r.delay||r.duration)&&(this.prior=n)}possiblyEvaluate(t,e,n){const r=t.now||0,i=this.value.possiblyEvaluate(t,e,n),o=this.prior;if(o){if(r>this.end)return this.prior=null,i;if(this.value.isDataDriven())return this.prior=null,i;if(r<this.begin)return o.possiblyEvaluate(t,e,n);{const a=(r-this.begin)/(this.end-this.begin);return this.property.interpolate(o.possiblyEvaluate(t,e,n),i,function(t){if(t<=0)return 0;if(t>=1)return 1;const e=t*t,n=e*t;return 4*(t<.5?n:3*(t-e)+n-.75)}(a))}}return i}}class QA{constructor(t){this._properties=t,this._values=Object.create(t.defaultTransitioningPropertyValues)}possiblyEvaluate(t,e,n){const r=new kA(this._properties);for(const i of Object.keys(this._values))r._values[i]=this._values[i].possiblyEvaluate(t,e,n);return r}hasTransition(){for(const t of Object.keys(this._values))if(this._values[t].prior)return!0;return!1}}class FA{constructor(t){this._properties=t,this._values=Object.create(t.defaultPropertyValues)}getValue(t){return kp(this._values[t].value)}setValue(t,e){this._values[t]=new zA(this._values[t].property,null===e?void 0:kp(e))}serialize(){const t={};for(const e of Object.keys(this._values)){const n=this.getValue(e);void 0!==n&&(t[e]=n)}return t}possiblyEvaluate(t,e,n){const r=new kA(this._properties);for(const i of Object.keys(this._values))r._values[i]=this._values[i].possiblyEvaluate(t,e,n);return r}}class PA{constructor(t,e,n){this.property=t,this.value=e,this.parameters=n}isConstant(){return"constant"===this.value.kind}constantOr(t){return"constant"===this.value.kind?this.value.value:t}evaluate(t,e,n,r){return this.property.evaluate(this.value,this.parameters,t,e,n,r)}}class kA{constructor(t){this._properties=t,this._values=Object.create(t.defaultPossiblyEvaluatedValues)}get(t){return this._values[t]}}class UA{constructor(t){this.specification=t}possiblyEvaluate(t,e){return t.expression.evaluate(e)}interpolate(t,e,n){const r=Oe[this.specification.type];return r?r(t,e,n):t}}class jA{constructor(t,e){this.specification=t,this.overrides=e}possiblyEvaluate(t,e,n,r){return"constant"===t.expression.kind||"camera"===t.expression.kind?new PA(this,{kind:"constant",value:t.expression.evaluate(e,null,{},n,r)},e):new PA(this,t.expression,e)}interpolate(t,e,n){if("constant"!==t.value.kind||"constant"!==e.value.kind)return t;if(void 0===t.value.value||void 0===e.value.value)return new PA(this,{kind:"constant",value:void 0},t.parameters);const r=Oe[this.specification.type];return r?new PA(this,{kind:"constant",value:r(t.value.value,e.value.value,n)},t.parameters):t}evaluate(t,e,n,r,i,o){return"constant"===t.kind?t.value:t.evaluate(e,n,r,i,o)}}class GA{constructor(t){this.specification=t}possiblyEvaluate(t,e,n,r){return!!t.expression.evaluate(e,null,{},n,r)}interpolate(){return!1}}class HA{constructor(t){this.properties=t,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[];const e=new SA(0,{});for(const n in t){const r=t[n];r.specification.overridable&&this.overridableProperties.push(n);const i=this.defaultPropertyValues[n]=new zA(r,void 0),o=this.defaultTransitionablePropertyValues[n]=new OA(r);this.defaultTransitioningPropertyValues[n]=o.untransitioned(),this.defaultPossiblyEvaluatedValues[n]=i.possiblyEvaluate(e)}}}sA(jA,"DataDrivenProperty"),sA(UA,"DataConstantProperty"),sA(GA,"ColorRampProperty");var qA,VA=(qA=!0,function(t,e){var n=qA?function(){if(e){var n=e.apply(t,arguments);return e=null,n}}:function(){};return qA=!1,n}),YA=VA(void 0,(function(){return YA.toString().search("(((.+)+)+)+$").toString().constructor(YA).search("(((.+)+)+)+$")}));function KA(t,e){return 256*(t=zp(Math.floor(t),0,255))+(e=zp(Math.floor(e),0,255))}YA();const WA=function(){let t=!0;return function(e,n){const r=t?function(){if(n){const t=n.apply(e,arguments);return n=null,t}}:function(){};return t=!1,r}}(),XA=WA(void 0,(function(){return XA.toString().search("(((.+)+)+)+$").toString().constructor(XA).search("(((.+)+)+)+$")}));XA();const JA={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array};class ZA{constructor(t,e){this._structArray=t,this._pos1=e*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8}}class $A{constructor(){this.isTransferred=!1,this.capacity=-1,this.resize(0)}static serialize(t,e){return this.isTransferred,t._trim(),e&&(t.isTransferred=!0,e.push(t.arrayBuffer)),{length:t.length,arrayBuffer:t.arrayBuffer}}static deserialize(t){const e=Object.create(this.prototype);return e.arrayBuffer=t.arrayBuffer,e.length=t.length,e.capacity=t.arrayBuffer.byteLength/e.bytesPerElement,e._refreshViews(),e}_trim(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())}clear(){this.length=0}resize(t){this.isTransferred,this.reserve(t),this.length=t}reserve(t){if(t>this.capacity){this.capacity=Math.max(t,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);const e=this.uint8;this._refreshViews(),e&&this.uint8.set(e)}}_refreshViews(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")}destroy(){this.int8=this.uint8=this.int16=this.uint16=this.int32=this.uint32=this.float32=null,this.arrayBuffer=null}}function tg(t,e=1){let n=0,r=0;return{members:t.map((t=>{!t.name||t.name.length;const i=(s=t.type,JA[s].BYTES_PER_ELEMENT),o=n=eg(n,Math.max(e,i)),a=t.components||1;var s;return r=Math.max(r,i),n+=i*a,{name:t.name,type:t.type,components:a,offset:o}})),size:eg(n,Math.max(r,e)),alignment:e}}function eg(t,e){return Math.ceil(t/e)*e}const ng=function(){let t=!0;return function(e,n){const r=t?function(){if(n){const t=n.apply(e,arguments);return n=null,t}}:function(){};return t=!1,r}}(),rg=ng(void 0,(function(){return rg.toString().search("(((.+)+)+)+$").toString().constructor(rg).search("(((.+)+)+)+$")}));rg();class ig extends $A{constructor(){super()}_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,e){const n=this.length;return this.resize(n+1),this.emplace(n,t,e)}emplace(t,e,n){const r=2*t;return this.int16[r+0]=e,this.int16[r+1]=n,t}}ig.prototype.bytesPerElement=4,sA(ig,"StructArrayLayout2i4");class og extends $A{constructor(){super()}_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,e,n){const r=this.length;return this.resize(r+1),this.emplace(r,t,e,n)}emplace(t,e,n,r){const i=3*t;return this.int16[i+0]=e,this.int16[i+1]=n,this.int16[i+2]=r,t}}og.prototype.bytesPerElement=6,sA(og,"StructArrayLayout3i6");class ag extends $A{constructor(){super()}_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,e,n,r){const i=this.length;return this.resize(i+1),this.emplace(i,t,e,n,r)}emplace(t,e,n,r,i){const o=4*t;return this.int16[o+0]=e,this.int16[o+1]=n,this.int16[o+2]=r,this.int16[o+3]=i,t}}ag.prototype.bytesPerElement=8,sA(ag,"StructArrayLayout4i8");class sg extends $A{constructor(){super()}_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,e,n,r,i,o,a){const s=this.length;return this.resize(s+1),this.emplace(s,t,e,n,r,i,o,a)}emplace(t,e,n,r,i,o,a,s){const c=6*t,l=12*t,u=3*t;return this.int16[c+0]=e,this.int16[c+1]=n,this.uint8[l+4]=r,this.uint8[l+5]=i,this.uint8[l+6]=o,this.uint8[l+7]=a,this.float32[u+2]=s,t}}sg.prototype.bytesPerElement=12,sA(sg,"StructArrayLayout2i4ub1f12");class cg extends $A{constructor(){super()}_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,e,n,r){const i=this.length;return this.resize(i+1),this.emplace(i,t,e,n,r)}emplace(t,e,n,r,i){const o=4*t;return this.float32[o+0]=e,this.float32[o+1]=n,this.float32[o+2]=r,this.float32[o+3]=i,t}}cg.prototype.bytesPerElement=16,sA(cg,"StructArrayLayout4f16");class lg extends $A{constructor(){super()}_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,e,n,r,i){const o=this.length;return this.resize(o+1),this.emplace(o,t,e,n,r,i)}emplace(t,e,n,r,i,o){const a=6*t,s=3*t;return this.uint16[a+0]=e,this.uint16[a+1]=n,this.uint16[a+2]=r,this.uint16[a+3]=i,this.float32[s+2]=o,t}}lg.prototype.bytesPerElement=12,sA(lg,"StructArrayLayout4ui1f12");class ug extends $A{constructor(){super()}_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,e,n,r){const i=this.length;return this.resize(i+1),this.emplace(i,t,e,n,r)}emplace(t,e,n,r,i){const o=4*t;return this.uint16[o+0]=e,this.uint16[o+1]=n,this.uint16[o+2]=r,this.uint16[o+3]=i,t}}ug.prototype.bytesPerElement=8,sA(ug,"StructArrayLayout4ui8");class hg extends $A{constructor(){super()}_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,e,n,r,i,o,a,s){const c=this.length;return this.resize(c+1),this.emplace(c,t,e,n,r,i,o,a,s)}emplace(t,e,n,r,i,o,a,s,c){const l=14*t,u=7*t;return this.int16[l+0]=e,this.int16[l+1]=n,this.float32[u+1]=r,this.float32[u+2]=i,this.float32[u+3]=o,this.float32[u+4]=a,this.float32[u+5]=s,this.float32[u+6]=c,t}}hg.prototype.bytesPerElement=28,sA(hg,"StructArrayLayout2i6f28");class fg extends $A{constructor(){super()}_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,e,n,r,i,o){const a=this.length;return this.resize(a+1),this.emplace(a,t,e,n,r,i,o)}emplace(t,e,n,r,i,o,a){const s=6*t;return this.int16[s+0]=e,this.int16[s+1]=n,this.int16[s+2]=r,this.int16[s+3]=i,this.int16[s+4]=o,this.int16[s+5]=a,t}}fg.prototype.bytesPerElement=12,sA(fg,"StructArrayLayout6i12");class dg extends $A{constructor(){super()}_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,e,n,r,i,o,a,s,c,l,u,h){const f=this.length;return this.resize(f+1),this.emplace(f,t,e,n,r,i,o,a,s,c,l,u,h)}emplace(t,e,n,r,i,o,a,s,c,l,u,h,f){const d=12*t;return this.int16[d+0]=e,this.int16[d+1]=n,this.int16[d+2]=r,this.int16[d+3]=i,this.uint16[d+4]=o,this.uint16[d+5]=a,this.uint16[d+6]=s,this.uint16[d+7]=c,this.int16[d+8]=l,this.int16[d+9]=u,this.int16[d+10]=h,this.int16[d+11]=f,t}}dg.prototype.bytesPerElement=24,sA(dg,"StructArrayLayout4i4ui4i24");class pg extends $A{constructor(){super()}_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,e,n,r,i,o,a,s,c,l,u,h,f,d,p,A,g,m){const y=this.length;return this.resize(y+1),this.emplace(y,t,e,n,r,i,o,a,s,c,l,u,h,f,d,p,A,g,m)}emplace(t,e,n,r,i,o,a,s,c,l,u,h,f,d,p,A,g,m,y){const v=24*t,C=12*t;return this.int16[v+0]=e,this.int16[v+1]=n,this.int16[v+2]=r,this.int16[v+3]=i,this.uint16[v+4]=o,this.uint16[v+5]=a,this.uint16[v+6]=s,this.uint16[v+7]=c,this.int16[v+8]=l,this.int16[v+9]=u,this.int16[v+10]=h,this.int16[v+11]=f,this.float32[C+6]=d,this.float32[C+7]=p,this.float32[C+8]=A,this.float32[C+9]=g,this.float32[C+10]=m,this.float32[C+11]=y,t}}pg.prototype.bytesPerElement=48,sA(pg,"StructArrayLayout4i4ui4i6f48");class Ag extends $A{constructor(){super()}_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,e,n,r,i,o){const a=this.length;return this.resize(a+1),this.emplace(a,t,e,n,r,i,o)}emplace(t,e,n,r,i,o,a){const s=10*t,c=5*t;return this.int16[s+0]=e,this.int16[s+1]=n,this.int16[s+2]=r,this.float32[c+2]=i,this.float32[c+3]=o,this.float32[c+4]=a,t}}Ag.prototype.bytesPerElement=20,sA(Ag,"StructArrayLayout3i3f20");class gg extends $A{constructor(){super()}_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(t){const e=this.length;return this.resize(e+1),this.emplace(e,t)}emplace(t,e){const n=1*t;return this.uint32[n+0]=e,t}}gg.prototype.bytesPerElement=4,sA(gg,"StructArrayLayout1ul4");class mg extends $A{constructor(){super()}_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,e,n,r,i,o,a,s,c,l,u,h,f,d,p,A){const g=this.length;return this.resize(g+1),this.emplace(g,t,e,n,r,i,o,a,s,c,l,u,h,f,d,p,A)}emplace(t,e,n,r,i,o,a,s,c,l,u,h,f,d,p,A,g){const m=26*t,y=13*t;return this.int16[m+0]=e,this.int16[m+1]=n,this.int16[m+2]=r,this.int16[m+3]=i,this.int16[m+4]=o,this.float32[y+3]=a,this.float32[y+4]=s,this.float32[y+5]=c,this.float32[y+6]=l,this.int16[m+14]=u,this.uint32[y+8]=h,this.uint16[m+18]=f,this.uint16[m+19]=d,this.float32[y+10]=p,this.float32[y+11]=A,this.float32[y+12]=g,t}}mg.prototype.bytesPerElement=52,sA(mg,"StructArrayLayout5i4f1i1ul2ui3f52");class yg extends $A{constructor(){super()}_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,e,n,r,i,o,a){const s=this.length;return this.resize(s+1),this.emplace(s,t,e,n,r,i,o,a)}emplace(t,e,n,r,i,o,a,s){const c=8*t;return this.int16[c+0]=e,this.int16[c+1]=n,this.int16[c+2]=r,this.int16[c+4]=i,this.int16[c+5]=o,this.int16[c+6]=a,this.int16[c+7]=s,t}}yg.prototype.bytesPerElement=16,sA(yg,"StructArrayLayout3i2i2i16");class vg extends $A{constructor(){super()}_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,e,n,r,i){const o=this.length;return this.resize(o+1),this.emplace(o,t,e,n,r,i)}emplace(t,e,n,r,i,o){const a=4*t,s=8*t;return this.float32[a+0]=e,this.float32[a+1]=n,this.float32[a+2]=r,this.int16[s+6]=i,this.int16[s+7]=o,t}}vg.prototype.bytesPerElement=16,sA(vg,"StructArrayLayout2f1f2i16");class Cg extends $A{constructor(){super()}_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,e,n,r){const i=this.length;return this.resize(i+1),this.emplace(i,t,e,n,r)}emplace(t,e,n,r,i){const o=12*t,a=3*t;return this.uint8[o+0]=e,this.uint8[o+1]=n,this.float32[a+1]=r,this.float32[a+2]=i,t}}Cg.prototype.bytesPerElement=12,sA(Cg,"StructArrayLayout2ub2f12");class Ig extends $A{constructor(){super()}_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,e,n){const r=this.length;return this.resize(r+1),this.emplace(r,t,e,n)}emplace(t,e,n,r){const i=3*t;return this.float32[i+0]=e,this.float32[i+1]=n,this.float32[i+2]=r,t}}Ig.prototype.bytesPerElement=12,sA(Ig,"StructArrayLayout3f12");class xg extends $A{constructor(){super()}_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,e,n){const r=this.length;return this.resize(r+1),this.emplace(r,t,e,n)}emplace(t,e,n,r){const i=3*t;return this.uint16[i+0]=e,this.uint16[i+1]=n,this.uint16[i+2]=r,t}get(t){const e=3*t;return[this.uint16[e+0],this.uint16[e+1],this.uint16[e+2]]}}xg.prototype.bytesPerElement=6,sA(xg,"StructArrayLayout3ui6");class Eg extends $A{constructor(){super()}_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(t,e,n){const r=this.length;return this.resize(r+1),this.emplace(r,t,e,n)}emplace(t,e,n,r){const i=3*t;return this.uint32[i+0]=e,this.uint32[i+1]=n,this.uint32[i+2]=r,t}copyFrom3ui6(t){if(!(t instanceof xg))throw new Error("expect array to be type of StructArrayLayout3ui6");this.clear();for(let e=0;e<t.length;e++){let n=t.get(e);this.emplaceBack(n[0],n[1],n[2])}}}Eg.prototype.bytesPerElement=12,sA(Eg,"StructArrayLayout3ul12");class _g extends $A{constructor(){super()}_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(t,e,n,r,i,o,a,s,c,l,u,h,f,d,p,A,g,m,y,v,C){const I=this.length;return this.resize(I+1),this.emplace(I,t,e,n,r,i,o,a,s,c,l,u,h,f,d,p,A,g,m,y,v,C)}emplace(t,e,n,r,i,o,a,s,c,l,u,h,f,d,p,A,g,m,y,v,C,I){const x=30*t,E=15*t,_=60*t;return this.int16[x+0]=e,this.int16[x+1]=n,this.int16[x+2]=r,this.float32[E+2]=i,this.float32[E+3]=o,this.uint16[x+8]=a,this.uint16[x+9]=s,this.uint32[E+5]=c,this.uint32[E+6]=l,this.uint32[E+7]=u,this.uint16[x+16]=h,this.uint16[x+17]=f,this.uint16[x+18]=d,this.float32[E+10]=p,this.float32[E+11]=A,this.uint8[_+48]=g,this.uint8[_+49]=m,this.uint8[_+50]=y,this.uint32[E+13]=v,this.int16[x+28]=C,this.uint8[_+58]=I,t}}_g.prototype.bytesPerElement=60,sA(_g,"StructArrayLayout3i2f2ui3ul3ui2f3ub1ul1i1ub60");class bg extends $A{constructor(){super()}_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(t,e,n,r,i,o,a,s,c,l,u,h,f,d,p,A,g,m,y,v,C,I,x,E,_,b,w,M,T,B){const S=this.length;return this.resize(S+1),this.emplace(S,t,e,n,r,i,o,a,s,c,l,u,h,f,d,p,A,g,m,y,v,C,I,x,E,_,b,w,M,T,B)}emplace(t,e,n,r,i,o,a,s,c,l,u,h,f,d,p,A,g,m,y,v,C,I,x,E,_,b,w,M,T,B,S){const D=38*t,R=19*t;return this.int16[D+0]=e,this.int16[D+1]=n,this.int16[D+2]=r,this.float32[R+2]=i,this.float32[R+3]=o,this.int16[D+8]=a,this.int16[D+9]=s,this.int16[D+10]=c,this.int16[D+11]=l,this.int16[D+12]=u,this.int16[D+13]=h,this.uint16[D+14]=f,this.uint16[D+15]=d,this.uint16[D+16]=p,this.uint16[D+17]=A,this.uint16[D+18]=g,this.uint16[D+19]=m,this.uint16[D+20]=y,this.uint16[D+21]=v,this.uint16[D+22]=C,this.uint16[D+23]=I,this.uint16[D+24]=x,this.uint16[D+25]=E,this.uint16[D+26]=_,this.uint16[D+27]=b,this.uint16[D+28]=w,this.uint32[R+15]=M,this.float32[R+16]=T,this.float32[R+17]=B,this.float32[R+18]=S,t}}bg.prototype.bytesPerElement=76,sA(bg,"StructArrayLayout3i2f6i15ui1ul3f76");class wg extends $A{constructor(){super()}_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t){const e=this.length;return this.resize(e+1),this.emplace(e,t)}emplace(t,e){const n=1*t;return this.float32[n+0]=e,t}}wg.prototype.bytesPerElement=4,sA(wg,"StructArrayLayout1f4");class Mg extends $A{constructor(){super()}_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,e,n,r,i){const o=this.length;return this.resize(o+1),this.emplace(o,t,e,n,r,i)}emplace(t,e,n,r,i,o){const a=5*t;return this.float32[a+0]=e,this.float32[a+1]=n,this.float32[a+2]=r,this.float32[a+3]=i,this.float32[a+4]=o,t}}Mg.prototype.bytesPerElement=20,sA(Mg,"StructArrayLayout5f20");class Tg extends $A{constructor(){super()}_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,e,n,r,i,o){const a=this.length;return this.resize(a+1),this.emplace(a,t,e,n,r,i,o)}emplace(t,e,n,r,i,o,a){const s=6*t;return this.float32[s+0]=e,this.float32[s+1]=n,this.float32[s+2]=r,this.float32[s+3]=i,this.float32[s+4]=o,this.float32[s+5]=a,t}}Tg.prototype.bytesPerElement=24,sA(Tg,"StructArrayLayout6f24");class Bg extends $A{constructor(){super()}_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,e,n,r,i,o,a,s,c){const l=this.length;return this.resize(l+1),this.emplace(l,t,e,n,r,i,o,a,s,c)}emplace(t,e,n,r,i,o,a,s,c,l){const u=9*t;return this.float32[u+0]=e,this.float32[u+1]=n,this.float32[u+2]=r,this.float32[u+3]=i,this.float32[u+4]=o,this.float32[u+5]=a,this.float32[u+6]=s,this.float32[u+7]=c,this.float32[u+8]=l,t}}Bg.prototype.bytesPerElement=36,sA(Bg,"StructArrayLayout9f36");class Sg extends $A{constructor(){super()}_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,e,n,r,i,o,a,s,c,l){const u=this.length;return this.resize(u+1),this.emplace(u,t,e,n,r,i,o,a,s,c,l)}emplace(t,e,n,r,i,o,a,s,c,l,u){const h=10*t;return this.float32[h+0]=e,this.float32[h+1]=n,this.float32[h+2]=r,this.float32[h+3]=i,this.float32[h+4]=o,this.float32[h+5]=a,this.float32[h+6]=s,this.float32[h+7]=c,this.float32[h+8]=l,this.float32[h+9]=u,t}}Sg.prototype.bytesPerElement=40,sA(Sg,"StructArrayLayout10f40");class Dg extends $A{constructor(){super()}_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,e,n,r,i,o,a,s,c,l,u,h){const f=this.length;return this.resize(f+1),this.emplace(f,t,e,n,r,i,o,a,s,c,l,u,h)}emplace(t,e,n,r,i,o,a,s,c,l,u,h,f){const d=12*t;return this.float32[d+0]=e,this.float32[d+1]=n,this.float32[d+2]=r,this.float32[d+3]=i,this.float32[d+4]=o,this.float32[d+5]=a,this.float32[d+6]=s,this.float32[d+7]=c,this.float32[d+8]=l,this.float32[d+9]=u,this.float32[d+10]=h,this.float32[d+11]=f,t}}Dg.prototype.bytesPerElement=48,sA(Dg,"StructArrayLayout12f48");class Rg extends $A{constructor(){super()}_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,e,n,r){const i=this.length;return this.resize(i+1),this.emplace(i,t,e,n,r)}emplace(t,e,n,r,i){const o=3*t,a=6*t;return this.uint32[o+0]=e,this.uint16[a+2]=n,this.uint16[a+3]=r,this.uint16[a+4]=i,t}}Rg.prototype.bytesPerElement=12,sA(Rg,"StructArrayLayout1ul3ui12");class zg extends $A{constructor(){super()}_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,e){const n=this.length;return this.resize(n+1),this.emplace(n,t,e)}emplace(t,e,n){const r=2*t;return this.uint16[r+0]=e,this.uint16[r+1]=n,t}get(t){const e=2*t;return[this.uint16[e+0],this.uint16[e+1]]}}zg.prototype.bytesPerElement=4,sA(zg,"StructArrayLayout2ui4");class Og extends $A{constructor(){super()}_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(t,e){const n=this.length;return this.resize(n+1),this.emplace(n,t,e)}emplace(t,e,n){const r=2*t;return this.uint32[r+0]=e,this.uint32[r+1]=n,t}copyFrom2ui4(t){if(!(t instanceof zg))throw new Error("expect array to be type of StructArrayLayout2ui4");this.clear();for(let e=0;e<t.length;e++){let n=t.get(e);this.emplaceBack(n[0],n[1])}}}Og.prototype.bytesPerElement=8,sA(Og,"StructArrayLayout2ul8");class Ng extends $A{constructor(){super()}_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t){const e=this.length;return this.resize(e+1),this.emplace(e,t)}emplace(t,e){const n=1*t;return this.uint16[n+0]=e,t}}Ng.prototype.bytesPerElement=2,sA(Ng,"StructArrayLayout1ui2");class Lg extends $A{constructor(){super()}_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,e){const n=this.length;return this.resize(n+1),this.emplace(n,t,e)}emplace(t,e,n){const r=2*t;return this.float32[r+0]=e,this.float32[r+1]=n,t}}Lg.prototype.bytesPerElement=8,sA(Lg,"StructArrayLayout2f8");class Qg extends ZA{constructor(t,e){super(t,e)}get projectedAnchorX(){return this._structArray.int16[this._pos2+0]}get projectedAnchorY(){return this._structArray.int16[this._pos2+1]}get projectedAnchorZ(){return this._structArray.int16[this._pos2+2]}get tileAnchorX(){return this._structArray.int16[this._pos2+3]}get tileAnchorY(){return this._structArray.int16[this._pos2+4]}get x1(){return this._structArray.float32[this._pos4+3]}get y1(){return this._structArray.float32[this._pos4+4]}get x2(){return this._structArray.float32[this._pos4+5]}get y2(){return this._structArray.float32[this._pos4+6]}get padding(){return this._structArray.int16[this._pos2+14]}get featureIndex(){return this._structArray.uint32[this._pos4+8]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+18]}get bucketIndex(){return this._structArray.uint16[this._pos2+19]}get ecefX(){return this._structArray.float32[this._pos4+10]}get ecefY(){return this._structArray.float32[this._pos4+11]}get ecefZ(){return this._structArray.float32[this._pos4+12]}}Qg.prototype.size=52;class Fg extends mg{constructor(){super()}get(t){return new Qg(this,t)}}sA(Fg,"CollisionBoxArray");class Pg extends ZA{constructor(t,e){super(t,e)}get projectedAnchorX(){return this._structArray.int16[this._pos2+0]}get projectedAnchorY(){return this._structArray.int16[this._pos2+1]}get projectedAnchorZ(){return this._structArray.int16[this._pos2+2]}get tileAnchorX(){return this._structArray.float32[this._pos4+2]}get tileAnchorY(){return this._structArray.float32[this._pos4+3]}get glyphStartIndex(){return this._structArray.uint16[this._pos2+8]}get numGlyphs(){return this._structArray.uint16[this._pos2+9]}get vertexStartIndex(){return this._structArray.uint32[this._pos4+5]}get lineStartIndex(){return this._structArray.uint32[this._pos4+6]}get lineLength(){return this._structArray.uint32[this._pos4+7]}get segment(){return this._structArray.uint16[this._pos2+16]}get lowerSize(){return this._structArray.uint16[this._pos2+17]}get upperSize(){return this._structArray.uint16[this._pos2+18]}get lineOffsetX(){return this._structArray.float32[this._pos4+10]}get lineOffsetY(){return this._structArray.float32[this._pos4+11]}get writingMode(){return this._structArray.uint8[this._pos1+48]}get placedOrientation(){return this._structArray.uint8[this._pos1+49]}set placedOrientation(t){this._structArray.uint8[this._pos1+49]=t}get hidden(){return this._structArray.uint8[this._pos1+50]}set hidden(t){this._structArray.uint8[this._pos1+50]=t}get crossTileID(){return this._structArray.uint32[this._pos4+13]}set crossTileID(t){this._structArray.uint32[this._pos4+13]=t}get associatedIconIndex(){return this._structArray.int16[this._pos2+28]}get flipState(){return this._structArray.uint8[this._pos1+58]}set flipState(t){this._structArray.uint8[this._pos1+58]=t}}Pg.prototype.size=60;class kg extends _g{constructor(){super()}get(t){return new Pg(this,t)}}sA(kg,"PlacedSymbolArray");class Ug extends ZA{constructor(t,e){super(t,e)}get projectedAnchorX(){return this._structArray.int16[this._pos2+0]}get projectedAnchorY(){return this._structArray.int16[this._pos2+1]}get projectedAnchorZ(){return this._structArray.int16[this._pos2+2]}get tileAnchorX(){return this._structArray.float32[this._pos4+2]}get tileAnchorY(){return this._structArray.float32[this._pos4+3]}get rightJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+8]}get centerJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+9]}get leftJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+10]}get verticalPlacedTextSymbolIndex(){return this._structArray.int16[this._pos2+11]}get placedIconSymbolIndex(){return this._structArray.int16[this._pos2+12]}get verticalPlacedIconSymbolIndex(){return this._structArray.int16[this._pos2+13]}get key(){return this._structArray.uint16[this._pos2+14]}get textBoxStartIndex(){return this._structArray.uint16[this._pos2+15]}get textBoxEndIndex(){return this._structArray.uint16[this._pos2+16]}get verticalTextBoxStartIndex(){return this._structArray.uint16[this._pos2+17]}get verticalTextBoxEndIndex(){return this._structArray.uint16[this._pos2+18]}get iconBoxStartIndex(){return this._structArray.uint16[this._pos2+19]}get iconBoxEndIndex(){return this._structArray.uint16[this._pos2+20]}get verticalIconBoxStartIndex(){return this._structArray.uint16[this._pos2+21]}get verticalIconBoxEndIndex(){return this._structArray.uint16[this._pos2+22]}get featureIndex(){return this._structArray.uint16[this._pos2+23]}get numHorizontalGlyphVertices(){return this._structArray.uint16[this._pos2+24]}get numVerticalGlyphVertices(){return this._structArray.uint16[this._pos2+25]}get numIconVertices(){return this._structArray.uint16[this._pos2+26]}get numVerticalIconVertices(){return this._structArray.uint16[this._pos2+27]}get useRuntimeCollisionCircles(){return this._structArray.uint16[this._pos2+28]}get crossTileID(){return this._structArray.uint32[this._pos4+15]}set crossTileID(t){this._structArray.uint32[this._pos4+15]=t}get textOffset0(){return this._structArray.float32[this._pos4+16]}get textOffset1(){return this._structArray.float32[this._pos4+17]}get collisionCircleDiameter(){return this._structArray.float32[this._pos4+18]}}Ug.prototype.size=76;class jg extends bg{constructor(){super()}get(t){return new Ug(this,t)}}sA(jg,"SymbolInstanceArray");class Gg extends wg{constructor(){super()}getoffsetX(t){return this.float32[1*t+0]}}sA(Gg,"GlyphOffsetArray");class Hg extends ig{constructor(){super()}getx(t){return this.int16[2*t+0]}gety(t){return this.int16[2*t+1]}}sA(Hg,"SymbolLineVertexArray");class qg extends ZA{constructor(t,e){super(t,e)}get featureIndex(){return this._structArray.uint32[this._pos4+0]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+2]}get bucketIndex(){return this._structArray.uint16[this._pos2+3]}get layoutVertexArrayOffset(){return this._structArray.uint16[this._pos2+4]}}qg.prototype.size=12;class Vg extends Rg{constructor(){super()}get(t){return new qg(this,t)}}sA(Vg,"FeatureIndexArray");class Yg extends zg{constructor(){super()}geta_centroid_pos0(t){return this.uint16[2*t+0]}geta_centroid_pos1(t){return this.uint16[2*t+1]}}sA(Yg,"FillExtrusionCentroidArray");class Kg extends ZA{constructor(t,e){super(t,e)}get lng(){return this._structArray.float32[this._pos4]}get lat(){return this._structArray.float32[this._pos4+1]}get height(){return this._structArray.float32[this._pos4+2]}get quads(){return this._structArray.float32[this._pos4+3]}set height(t){this._structArray.float32[this._pos4+2]=t}}Kg.prototype.size=16;class Wg extends cg{constructor(){super()}get(t){return new Kg(this,t)}}sA(Wg,"LngLatHeightQuadArray");class Xg extends ZA{constructor(t,e){super(t,e)}get lng(){return this._structArray.float32[this._pos4]}get lat(){return this._structArray.float32[this._pos4+1]}get height(){return this._structArray.float32[this._pos4+2]}set height(t){this._structArray.float32[this._pos4+2]=t}}Xg.prototype.size=12;class Jg extends Ig{constructor(){super()}get(t){return new Xg(this,t)}}sA(Jg,"LngLatHeightArray");const Zg=function(){let t=!0;return function(e,n){const r=t?function(){if(n){const t=n.apply(e,arguments);return n=null,t}}:function(){};return t=!1,r}}(),$g=Zg(void 0,(function(){return $g.toString().search("(((.+)+)+)+$").toString().constructor($g).search("(((.+)+)+)+$")}));$g();const tm=tg([{name:"a_pattern",components:4,type:"Uint16"},{name:"a_pixel_ratio",components:1,type:"Float32"}]),em=function(){let t=!0;return function(e,n){const r=t?function(){if(n){const t=n.apply(e,arguments);return n=null,t}}:function(){};return t=!1,r}}(),nm=em(void 0,(function(){return nm.toString().search("(((.+)+)+)+$").toString().constructor(nm).search("(((.+)+)+)+$")}));nm();const rm=tg([{name:"a_dash",components:4,type:"Uint16"}]);var im,om=(im=!0,function(t,e){var n=im?function(){if(e){var n=e.apply(t,arguments);return e=null,n}}:function(){};return im=!1,n}),am=om(void 0,(function(){return am.toString().search("(((.+)+)+)+$").toString().constructor(am).search("(((.+)+)+)+$")}));am();var sm=function(){this.ids=[],this.positions=[],this.indexed=!1};function cm(t,e,n,r){if(!(n>=r)){for(var i=t[n+r>>1],o=n-1,a=r+1;;){do{o++}while(t[o]<i);do{a--}while(t[a]>i);if(o>=a)break;lm(t,o,a),lm(e,3*o,3*a),lm(e,3*o+1,3*a+1),lm(e,3*o+2,3*a+2)}cm(t,e,n,a),cm(t,e,a+1,r)}}function lm(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}sm.prototype.add=function(t,e,n,r){this.ids.push(t),this.positions.push(e,n,r)},sm.prototype.getPositions=function(t){for(var e=0,n=this.ids.length-1;e<n;){var r=e+n>>1;this.ids[r]>=t?n=r:e=r+1}for(var i=[];this.ids[e]===t;){var o=this.positions[3*e],a=this.positions[3*e+1],s=this.positions[3*e+2];i.push({index:o,start:a,end:s}),e++}return i},sm.serialize=function(t,e){var n=new Float64Array(t.ids),r=new Uint32Array(t.positions);return cm(n,r,0,n.length-1),e&&e.push(n.buffer,r.buffer),{ids:n,positions:r}},sm.deserialize=function(t){var e=new sm;return e.ids=t.ids,e.positions=t.positions,e.indexed=!0,e},sA(sm,"FeaturePositionMap");var um,hm=(um=!0,function(t,e){var n=um?function(){if(e){var n=e.apply(t,arguments);return e=null,n}}:function(){};return um=!1,n}),fm=hm(void 0,(function(){return fm.toString().search("(((.+)+)+)+$").toString().constructor(fm).search("(((.+)+)+)+$")}));function dm(){}fm(),dm.toVertexBuffer=function(t,e,n,r){var i=pf.createVertexBuffer({context:t,typedArray:e.arrayBuffer,usage:r?df.DYNAMIC_DRAW:df.STATIC_DRAW,owner:"MVT"});return i.vertexArrayDestroyable=!1,i.bytesPerElement=e.bytesPerElement,i.length=e.length,i.attributes=n,i.itemSize=e.bytesPerElement,i.dynamicDraw=r,!r&&e.destroy(),i},dm.toIndexBuffer=function(t,e,n){var r=pf.createIndexBuffer({context:t,typedArray:e.arrayBuffer,usage:df.STATIC_DRAW,indexDatatype:void 0!==e.uint16?ff.UNSIGNED_SHORT:ff.UNSIGNED_INT,owner:"MVT"});return r.vertexArrayDestroyable=!1,r.dynamicDraw=n,!r.dynamicDraw&&e.destroy(),r},dm.toRenderState=function(t,e,n,r){var i=Yd.DISABLED;t.blendFunction[0]==zh.ONE&&t.blendFunction[1]==zh.ONE_MINUS_SRC_ALPHA&&(i={enabled:!0,equationRgb:Gd.ADD,equationAlpha:Gd.ADD,functionSourceRgb:qd.ONE,functionSourceAlpha:qd.ONE,functionDestinationRgb:qd.ONE_MINUS_SOURCE_ALPHA,functionDestinationAlpha:qd.ONE_MINUS_SOURCE_ALPHA});var o=!1;o=!(n.test.func===zh.ALWAYS&&!n.mask);var a={frontFace:r.frontFace,cull:{enabled:r.enable,face:r.mode},depthRange:{near:e.range[0],far:e.range[1]},depthTest:{enabled:e.func!==zh.ALWAYS,func:e.func},depthMask:e.mask,colorMask:{red:t.mask[0],green:t.mask[1],blue:t.mask[2],alpha:t.mask[3]},stencilMask:n.mask,stencilTest:{enabled:o,frontFunction:n.test.func,backFunction:n.test.func,reference:n.ref,mask:n.test.mask,frontOperation:{fail:n.fail,zFail:n.depthFail,zPass:n.pass},backOperation:{fail:n.fail,zFail:n.depthFail,zPass:n.pass}},blending:i};return rp.fromCache(a)},dm.toComponentDatatype=function(t){switch(t){case"Int8":return Nh.BYTE;case"Uint8":return Nh.UNSIGNED_BYTE;case"Int16":return Nh.SHORT;case"Uint16":return Nh.UNSIGNED_SHORT;case"Int32":return Nh.INT;case"Uint32":return Nh.UNSIGNED_INT;default:return Nh.FLOAT}},dm.mbxAttributeToCesiumVertexArrtribute=function(t,e,n,r){var i=this.toComponentDatatype(t.type);Nh.getSizeInBytes(i);var o=t.strideInBytes||e.bytesPerElement,a=t.offset+o*(r||0);return{name:t.name,index:n,vertexBuffer:e,componentsPerAttribute:t.components,componentDatatype:i,offsetInBytes:a,strideInBytes:o,normalize:!1}},dm.copyFromArrayView=function(t,e,n){t.copyFromArrayView(e,n)};const pm=function(){let t=!0;return function(e,n){const r=t?function(){if(n){const t=n.apply(e,arguments);return n=null,t}}:function(){};return t=!1,r}}(),Am=pm(void 0,(function(){return Am.toString().search("(((.+)+)+)+$").toString().constructor(Am).search("(((.+)+)+)+$")}));Am();class gm{constructor(t){this.gl=t.gl,this.initialized=!1}fetchUniformLocation(t,e){return!this.location&&!this.initialized&&(this.location=this.gl.getUniformLocation(t,e),this.initialized=!0),!!this.location}set(t,e,n){}}class mm extends gm{constructor(t){super(t),this.current=0}set(t,e,n){this.fetchUniformLocation(t,e)&&this.current!==n&&(this.current=n,this.gl.uniform1f(this.location,n))}}class ym extends gm{constructor(t){super(t),this.current=[0,0,0,0]}set(t,e,n){this.fetchUniformLocation(t,e)&&(n[0]!==this.current[0]||n[1]!==this.current[1]||n[2]!==this.current[2]||n[3]!==this.current[3])&&(this.current=n,this.gl.uniform4f(this.location,n[0],n[1],n[2],n[3]))}}class vm extends gm{constructor(t){super(t),this.current=v.transparent}set(t,e,n){this.fetchUniformLocation(t,e)&&(n.r!==this.current.r||n.g!==this.current.g||n.b!==this.current.b||n.a!==this.current.a)&&(this.current=n,this.gl.uniform4f(this.location,n.r,n.g,n.b,n.a))}}const Cm=function(){let t=!0;return function(e,n){const r=t?function(){if(n){const t=n.apply(e,arguments);return n=null,t}}:function(){};return t=!1,r}}(),Im=Cm(void 0,(function(){return Im.toString().search("(((.+)+)+)+$").toString().constructor(Im).search("(((.+)+)+)+$")}));Im();var xm=new Oi;function Em(t){return[KA(255*t.r,255*t.g),KA(255*t.b,255*t.a)]}class _m{constructor(t,e,n){this.value=t,this.uniformNames=e.map((t=>"u_"+t)),this.type=n}setUniform(t,e,n,r,i){e.set(t,i,r.constantOr(this.value))}getBinding(t,e){return"color"===this.type?new vm(t):new mm(t)}setUniformMap(t,e,n,r,i){var o=this;t[e]=function(){var t=r.get(n).constantOr(o.value);return"color"===o.type&&(t.red=t.r,t.green=t.g,t.blue=t.b,t.alpha=t.a),t}}}class bm{constructor(t,e){this.uniformNames=e.map((t=>"u_"+t)),this.pattern=null,this.pixelRatio=1}setConstantPatternPositions(t){this.pixelRatio=t.pixelRatio||1,this.pattern=t.tl.concat(t.br)}setUniform(t,e,n,r,i){const o="u_pattern"===i||"u_dash"===i?this.pattern:"u_pixel_ratio"===i?this.pixelRatio:null;o&&e.set(t,i,o)}getBinding(t,e){return"u_pattern"===e||"u_dash"===e?new ym(t):new mm(t)}setUniformMap(t,e,n,r,i){if("u_pattern"===e||"u_dash"===e){const n=this.pattern;t[e]=function(){return xm.x=n[0],xm.y=n[1],xm.z=n[2],xm.w=n[3],xm}}else if("u_pixel_ratio"===e){const n=this.pixelRatio;t[e]=function(){return n}}}}class wm{constructor(t,e,n,r){this.expression=t,this.type=n,this.maxValue=0,this.paintVertexAttributes=e.map((t=>({name:"a_"+t,type:"Float32",components:"color"===n?2:1,offset:0}))),this.paintVertexArray=new r}populatePaintArray(t,e,n,r,i,o){const a=this.paintVertexArray.length,s=this.expression.evaluate(new SA(0),e,{},i,r,o);this.paintVertexArray.resize(t),this._setPaintValue(a,t,s)}updatePaintArray(t,e,n,r,i){const o=this.expression.evaluate({zoom:0},n,r,void 0,i);this._setPaintValue(t,e,o)}_setPaintValue(t,e,n){if("color"===this.type){const r=Em(n);for(let n=t;n<e;n++)this.paintVertexArray.emplace(n,r[0],r[1])}else{for(let r=t;r<e;r++)this.paintVertexArray.emplace(r,n);this.maxValue=Math.max(this.maxValue,Math.abs(n))}}upload(t){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.copy(this.paintVertexArray):this.paintVertexBuffer=dm.toVertexBuffer(t,this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}}class Mm{constructor(t,e,n,r,i,o){this.expression=t,this.uniformNames=e.map((t=>"u_"+t+"_t")),this.type=n,this.useIntegerZoom=r,this.zoom=i,this.maxValue=0,this.paintVertexAttributes=e.map((t=>({name:"a_"+t,type:"Float32",components:"color"===n?4:2,offset:0}))),this.paintVertexArray=new o}populatePaintArray(t,e,n,r,i,o){const a=this.expression.evaluate(new SA(this.zoom),e,{},i,r,o),s=this.expression.evaluate(new SA(this.zoom+1),e,{},i,r,o),c=this.paintVertexArray.length;this.paintVertexArray.resize(t),this._setPaintValue(c,t,a,s)}updatePaintArray(t,e,n,r,i){const o=this.expression.evaluate({zoom:this.zoom},n,r,void 0,i),a=this.expression.evaluate({zoom:this.zoom+1},n,r,void 0,i);this._setPaintValue(t,e,o,a)}_setPaintValue(t,e,n,r){if("color"===this.type){const i=Em(n),o=Em(r);for(let n=t;n<e;n++)this.paintVertexArray.emplace(n,i[0],i[1],o[0],o[1])}else{for(let i=t;i<e;i++)this.paintVertexArray.emplace(i,n,r);this.maxValue=Math.max(this.maxValue,Math.abs(n),Math.abs(r))}}upload(t){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.copyFromArrayView(this.paintVertexArray.arrayBuffer):this.paintVertexBuffer=dm.toVertexBuffer(t,this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}setUniform(t,e,n,r,i){const o=this.useIntegerZoom?Math.floor(n.zoom):n.zoom,a=zp(this.expression.interpolationFactor(o,this.zoom,this.zoom+1),0,1);e.set(t,i,a)}setUniformMap(t,e,n,r,i){const o=this.useIntegerZoom?Math.floor(i.zoom):i.zoom,a=zp(this.expression.interpolationFactor(o,this.zoom,this.zoom+1),0,1);t[e]=function(){return a}}getBinding(t,e){return new mm(t)}}class Tm{constructor(t,e,n,r,i){this.expression=t,this.layerId=i,this.paintVertexAttributes=("array"===n?rm:tm).members;for(let t=0;t<e.length;++t);this.paintVertexArray=new r}populatePaintArray(t,e,n){const r=this.paintVertexArray.length;this.paintVertexArray.resize(t),this._setPaintValues(r,t,e.patterns&&e.patterns[this.layerId],n)}updatePaintArray(t,e,n,r,i,o){this._setPaintValues(t,e,n.patterns&&n.patterns[this.layerId],o)}_setPaintValues(t,e,n,r){if(!r||!n)return;const i=r[n];if(!i)return;const{tl:o,br:a,pixelRatio:s}=i;for(let n=t;n<e;n++)this.paintVertexArray.emplace(n,o[0],o[1],a[0],a[1],s)}upload(t){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer=dm.toVertexBuffer(t,this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}}class Bm{constructor(t,e,n){this.binders={},this._buffers=[];const r=[];if(t)for(const a in t.paint._values){if(n&&!n(a))continue;const s=t.paint.get(a);if(!(s instanceof PA&&or(s.property.specification)))continue;const c=(i=a,o=t.type,Dm[i]||[i.replace(o+"-","").replace(/-/g,"_")]),l=s.value,u=s.property.specification.type,h=!!s.property.useIntegerZoom,f="line-dasharray"===a||a.endsWith("pattern"),d="line-dasharray"===a&&"constant"!==t.layout.get("line-cap").value.kind;if("constant"!==l.kind||d)if("source"===l.kind||d||f){const e=Om(a,u,"source");this.binders[a]=f?new Tm(l,c,u,e,t.id):new wm(l,c,u,e),r.push("/a_"+a)}else{const t=Om(a,u,"composite");this.binders[a]=new Mm(l,c,u,h,e,t),r.push("/z_"+a)}else this.binders[a]=f?new bm(l.value,c):new _m(l.value,c,u),r.push("/u_"+a)}var i,o;this.cacheKey=r.sort().join("")}getMaxValue(t){const e=this.binders[t];return e instanceof wm||e instanceof Mm?e.maxValue:0}populatePaintArrays(t,e,n,r,i,o){for(const a in this.binders){const s=this.binders[a];(s instanceof wm||s instanceof Mm||s instanceof Tm)&&s.populatePaintArray(t,e,n,r,i,o)}}setConstantPatternPositions(t){for(const e in this.binders){const n=this.binders[e];n instanceof bm&&n.setConstantPatternPositions(t)}}updatePaintArrays(t,e,n,r,i,o){let a=!1;for(const s in t){const c=e.getPositions(s);for(const e of c){const c=n.feature(e.index);for(const n in this.binders){const l=this.binders[n];if((l instanceof wm||l instanceof Mm||l instanceof Tm)&&!0===l.expression.isStateDependent){const u=r.paint.get(n);l.expression=u.value,l.updatePaintArray(e.start,e.end,c,t[s],i,o),a=!0}}}}return a}defines(){const t=[];for(const e in this.binders){const n=this.binders[e];(n instanceof _m||n instanceof bm)&&t.push(...n.uniformNames.map((t=>"HAS_UNIFORM_"+t)))}return t}getBinderAttributes(){const t=[];for(const e in this.binders){const n=this.binders[e];if(n instanceof wm||n instanceof Mm||n instanceof Tm)for(let e=0;e<n.paintVertexAttributes.length;e++)t.push(n.paintVertexAttributes[e].name)}return t}getBinderUniforms(){const t=[];for(const e in this.binders){const n=this.binders[e];if(n instanceof _m||n instanceof bm||n instanceof Mm)for(const e of n.uniformNames)t.push(e)}return t}getPaintVertexBuffers(){return this._buffers}getUniforms(t){const e=[];for(const n in this.binders){const r=this.binders[n];if(r instanceof _m||r instanceof bm||r instanceof Mm)for(const i of r.uniformNames)e.push({name:i,property:n,binding:r.getBinding(t,i)})}return e}setUniforms(t,e,n,r,i){for(const{name:e,property:o,binding:a}of n)this.binders[o].setUniform(t,a,i,r.get(o),e)}updatePaintBuffers(){this._buffers=[];for(const t in this.binders){const e=this.binders[t];(e instanceof wm||e instanceof Mm||e instanceof Tm)&&e.paintVertexBuffer&&this._buffers.push(e.paintVertexBuffer)}}upload(t){for(const e in this.binders){const n=this.binders[e];(n instanceof wm||n instanceof Mm||n instanceof Tm)&&n.upload(t)}this.updatePaintBuffers()}getAttributeLocation(){for(var t=0,e={},n=0;n<this.layoutAttributes.length;n++){e[this.layoutAttributes[n].name]=n,t++}for(var r=this.getPaintVertexBuffers(),i=0;r&&i<r.length;i++)for(var o=r[i],a=0;a<o.attributes.length;a++){e[o.attributes[a].name]=t++}return e}getUniformMaps(t,e,n,r){for(var i in this.binders){var o=this.binders[i];if(o.uniformNames)for(var a=0,s=o.uniformNames;a<s.length;a+=1){var c=s[a];t[c]&&o.setUniformMap(n,c,i,e,{zoom:r})}}for(var l in t)!n[l]&&l.endsWith("_t")&&(n[l]=function(){return 0});return n}destroy(){for(const t in this.binders){const e=this.binders[t];(e instanceof wm||e instanceof Mm||e instanceof Tm)&&e.destroy()}}}class Sm{constructor(t,e,n,r){this.programConfigurations={};for(const i of e)this.programConfigurations[i.id]=new Bm(i,n,r),this.programConfigurations[i.id].layoutAttributes=t;this.needsUpload=!1,this._featureMap=new sm,this._bufferOffset=0}populatePaintArrays(t,e,n,r,i,o,a){for(const n in this.programConfigurations)this.programConfigurations[n].populatePaintArrays(t,e,r,i,o,a);void 0!==e.id&&this._featureMap.add(e.id,n,this._bufferOffset,t),this._bufferOffset=t,this.needsUpload=!0}updatePaintArrays(t,e,n,r,i){for(const o of n)this.needsUpload=this.programConfigurations[o.id].updatePaintArrays(t,this._featureMap,e,o,r,i)||this.needsUpload}get(t){return this.programConfigurations[t]}upload(t){if(this.needsUpload){for(const e in this.programConfigurations)this.programConfigurations[e].upload(t);this.needsUpload=!1}}destroy(){for(const t in this.programConfigurations)this.programConfigurations[t].destroy()}}const Dm={"text-opacity":["opacity"],"icon-opacity":["opacity"],"text-color":["fill_color"],"icon-color":["fill_color"],"text-halo-color":["halo_color"],"icon-halo-color":["halo_color"],"text-halo-blur":["halo_blur"],"icon-halo-blur":["halo_blur"],"text-halo-width":["halo_width"],"icon-halo-width":["halo_width"],"line-gap-width":["gapwidth"],"line-pattern":["pattern","pixel_ratio"],"fill-pattern":["pattern","pixel_ratio"],"fill-extrusion-pattern":["pattern","pixel_ratio"],"line-dasharray":["dash"]};const Rm={"line-pattern":{source:lg,composite:lg},"fill-pattern":{source:lg,composite:lg},"fill-extrusion-pattern":{source:lg,composite:lg},"line-dasharray":{source:ug,composite:ug}},zm={color:{source:Lg,composite:cg},number:{source:wg,composite:Lg}};function Om(t,e,n){const r=Rm[t];return r&&r[n]||zm[e][n]}sA(_m,"ConstantBinder"),sA(bm,"PatternConstantBinder"),sA(wm,"SourceExpressionBinder"),sA(Tm,"PatternCompositeBinder"),sA(Mm,"CompositeExpressionBinder"),sA(Bm,"ProgramConfiguration",{omit:["_buffers"]}),sA(Sm,"ProgramConfigurationSet");const Nm=function(){let t=!0;return function(e,n){const r=t?function(){if(n){const t=n.apply(e,arguments);return n=null,t}}:function(){};return t=!1,r}}(),Lm=Nm(void 0,(function(){return Lm.toString().search("(((.+)+)+)+$").toString().constructor(Lm).search("(((.+)+)+)+$")}));function Qm(t){if(Array.isArray(t))return t.map(Qm);if(t instanceof Object&&!(t instanceof Number||t instanceof String||t instanceof Boolean)){const e={};for(const n in t)e[n]=Qm(t[n]);return e}return(e=t)instanceof Number||e instanceof String||e instanceof Boolean?e.valueOf():e;var e}Lm();var Fm,Pm=(Fm=!0,function(t,e){var n=Fm?function(){if(e){var n=e.apply(t,arguments);return e=null,n}}:function(){};return Fm=!1,n}),km=Pm(void 0,(function(){return km.toString().search("(((.+)+)+)+$").toString().constructor(km).search("(((.+)+)+)+$")}));km();var Um={$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:""},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."},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]."},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]."},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."}},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:""},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:""},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 `{<sourceLayer>: <propertyName>}`. 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."},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:""},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:""},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:""},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."},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:""},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 `{<sourceLayer>: <propertyName>}`."}},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"}}},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:""},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."},"line-direction":{doc:"The label is placed in the order defined by the vector data. "}},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:"","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"},"ignore-line-rotation":{type:"boolean",values:{true:{doc:"this style is active only if text is alongline, true means not allow line rotation"},false:{doc:"this style is active only if text is alongline, false means allow line rotation"}},default:!1,doc:"In combination with `text-rotation-alignment`, determines the rotation behavior of all glyphs forming the text.",requires:["text-field"],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<number>`, 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:"",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:"",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"}}},"fill-extrusion-rounded-roof":{type:"boolean",default:!0,doc:"Indicates whether top edges should be rounded when fill-extrusion-edge-radius has a value greater than 0. If false, rounded edges are only applied to the sides. Default is true.",requires:["fill-extrusion-edge-radius"],transition:!1,"sdk-support":{"basic functionality":{js:"2.15.0",android:"10.10.0",ios:"10.10.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},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:"#ffffff",transition:!0,doc:"",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:"",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."}}};const jm=function(){let t=!0;return function(e,n){const r=t?function(){if(n){const t=n.apply(e,arguments);return n=null,t}}:function(){};return t=!1,r}}(),Gm=jm(void 0,(function(){return Gm.toString().search("(((.+)+)+)+$").toString().constructor(Gm).search("(((.+)+)+)+$")}));function Hm(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(!Hm(e)&&"boolean"!=typeof e)return!1;return!0;default:return!0}}function qm(t,e="fill"){if(null==t)return{filter:()=>!0,needGeometry:!1,needFeature:!1};!Hm(t)&&(t=Zm(t));const n=t;let r=!0;try{r=function(t){if(!Km(t))return t;let e=Qm(t);return Ym(e),e=Vm(e),e}(n)}catch(t){console.warn("Failed to extract static filter. Filter will continue working, but at higher memory usage and slower framerate.\nFilter Expression:\n"+JSON.stringify(n,null,2)+"\n ")}const i=Um["filter_"+e],o=br(r,i);let a=null;if("error"===o.result)throw new Error(o.value.map((t=>t.key+": "+t.message)).join(", "));a=(t,e,n)=>o.value.evaluate(t,e,{},n);let s=null,c=null;if(r!==n){const t=br(n,i);if("error"===t.result)throw new Error(t.value.map((t=>t.key+": "+t.message)).join(", "));s=(e,n,r,i,o)=>t.value.evaluate(e,n,{},r,void 0,void 0,i,o),c=!ue(t.value.expression)}return{filter:a,dynamicFilter:s||void 0,needGeometry:Jm(r),needFeature:!!c}}function Vm(t){if(!Array.isArray(t))return t;const e=function(t){if(Wm.has(t[0]))for(let e=1;e<t.length;e++){if(Km(t[e]))return!0}return t}(t);return!0===e?e:e.map((t=>Vm(t)))}function Ym(t){let e=!1;const n=[];if("case"===t[0]){for(let r=1;r<t.length-1;r+=2)e=e||Km(t[r]),n.push(t[r+1]);n.push(t[t.length-1])}else if("match"===t[0]){e=e||Km(t[1]);for(let e=2;e<t.length-1;e+=2)n.push(t[e+1]);n.push(t[t.length-1])}else if("step"===t[0]){e=e||Km(t[1]);for(let e=1;e<t.length-1;e+=2)n.push(t[e+1])}e&&(t.length=0,t.push("any",...n));for(let e=1;e<t.length;e++)Ym(t[e])}function Km(t){if(!Array.isArray(t))return!1;if("pitch"===(e=t[0])||"distance-from-center"===e)return!0;var e;for(let e=1;e<t.length;e++){if(Km(t[e]))return!0}return!1}Gm();const Wm=new Set(["in","==","!=",">",">=","<","<=","to-boolean"]);function Xm(t,e){return t<e?-1:t>e?1:0}function Jm(t){if(!Array.isArray(t))return!1;if("within"===t[0])return!0;for(let e=1;e<t.length;e++)if(Jm(t[e]))return!0;return!1}function Zm(t){if(!t)return!0;const e=t[0];if(t.length<=1)return"any"!==e;var n;return"=="===e?$m(t[1],t[2],"=="):"!="===e?ny($m(t[1],t[2],"==")):"<"===e||">"===e||"<="===e||">="===e?$m(t[1],t[2],e):"any"===e?(n=t.slice(1),["any"].concat(n.map(Zm))):"all"===e?["all"].concat(t.slice(1).map(Zm)):"none"===e?["all"].concat(t.slice(1).map(Zm).map(ny)):"in"===e?ty(t[1],t.slice(2)):"!in"===e?ny(ty(t[1],t.slice(2))):"has"===e?ey(t[1]):"!has"===e?ny(ey(t[1])):"within"!==e||t}function $m(t,e,n){switch(t){case"$type":return["filter-type-"+n,e];case"$id":return["filter-id-"+n,e];default:return["filter-"+n,t,e]}}function ty(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(Xm)]]:["filter-in-small",t,["literal",e]]}}function ey(t){switch(t){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",t]}}function ny(t){return["!",t]}const ry=function(){let t=!0;return function(e,n){const r=t?function(){if(n){const t=n.apply(e,arguments);return n=null,t}}:function(){};return t=!1,r}}(),iy=ry(void 0,(function(){return iy.toString().search("(((.+)+)+)+$").toString().constructor(iy).search("(((.+)+)+)+$")}));iy();const oy="-transition";class ay extends xA{constructor(t,e,n){if(super(),this.id=t.id,this.type=t.type,this._featureFilter={filter:()=>!0,needGeometry:!1,needFeature:!1},this._filterCompiled=!1,"custom"!==t.type&&(this.metadata=t.metadata,this.minzoom=t.minzoom,this.maxzoom=t.maxzoom,"background"!==t.type&&(this.source=t.source,this.sourceLayer=t["source-layer"],this.filter=t.filter),e.layout&&(this._unevaluatedLayout=new FA(e.layout)),e.paint)){this._transitionablePaint=new NA(e.paint);for(const e in t.paint)this.setPaintProperty(e,t.paint[e],{validate:!1});for(const e in t.layout)this.setLayoutProperty(e,t.layout[e],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new kA(e.paint)}}getLayoutProperty(t){return"visibility"===t?this.visibility:this._unevaluatedLayout.getValue(t)}setLayoutProperty(t,e,n){"visibility"!==t?this._unevaluatedLayout.setValue(t,e):this.visibility=e}getPaintProperty(t){return Fp(t,oy)?this._transitionablePaint.getTransition(t.slice(0,-11)):this._transitionablePaint.getValue(t)}setPaintProperty(t,e,n={}){if(Fp(t,oy))return this._transitionablePaint.setTransition(t.slice(0,-11),e||void 0),!1;{const n=this._transitionablePaint._values[t],r=n.value.isDataDriven(),i=n.value;this._transitionablePaint.setValue(t,e),this._handleSpecialPaintPropertyUpdate(t);const o=this._transitionablePaint._values[t].value,a=o.isDataDriven(),s=Fp(t,"pattern")||"line-dasharray"===t;return a||r||s||this._handleOverridablePaintPropertyUpdate(t,i,o)}}_handleSpecialPaintPropertyUpdate(t){}getProgramIds(){return null}getProgramConfiguration(t){return null}_handleOverridablePaintPropertyUpdate(t,e,n){return!1}isHidden(t){return!!(this.minzoom&&t<this.minzoom)||(!!(this.maxzoom&&t>=this.maxzoom)||"none"===this.visibility)}updateTransitions(t){this._transitioningPaint=this._transitionablePaint.transitioned(t,this._transitioningPaint)}hasTransition(){return this._transitioningPaint.hasTransition()}recalculate(t,e){this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(t,void 0,e)),this.paint=this._transitioningPaint.possiblyEvaluate(t,void 0,e)}serialize(){const t={id:this.id,type:this.type,source:this.source,"source-layer":this.sourceLayer,metadata:this.metadata,minzoom:this.minzoom,maxzoom:this.maxzoom,filter:this.filter,layout:this._unevaluatedLayout&&this._unevaluatedLayout.serialize(),paint:this._transitionablePaint&&this._transitionablePaint.serialize()};return this.visibility&&(t.layout=t.layout||{},t.layout.visibility=this.visibility),function(t,e,n){const r={};for(const i in t)e.call(n||this,t[i],i,t)&&(r[i]=t[i]);return r}(t,((t,e)=>!(void 0===t||"layout"===e&&!Object.keys(t).length||"paint"===e&&!Object.keys(t).length)))}_validate(t,e,n,r,i={}){return!0}is3D(){return!1}isSky(){return!1}isTileClipped(){return!1}hasOffscreenPass(){return!1}resize(){}isStateDependent(){for(const t in this.paint._values){const e=this.paint.get(t);if(e instanceof PA&&or(e.property.specification)&&(("source"===e.value.kind||"composite"===e.value.kind)&&e.value.isStateDependent))return!0}return!1}compileFilter(){!this._filterCompiled&&(this._featureFilter=qm(this.filter),this._filterCompiled=!0)}invalidateCompiledFilter(){this._filterCompiled=!1}dynamicFilter(){return this._featureFilter.dynamicFilter}dynamicFilterNeedsFeature(){return this._featureFilter.needFeature}}const sy=function(){let t=!0;return function(e,n){const r=t?function(){if(n){const t=n.apply(e,arguments);return n=null,t}}:function(){};return t=!1,r}}(),cy=sy(void 0,(function(){return cy.toString().search("(((.+)+)+)+$").toString().constructor(cy).search("(((.+)+)+)+$")}));cy();const ly=tg([{name:"a_pos",components:2,type:"Int16"},{name:"a_ecef_pos_high",components:3,type:"Float32"},{name:"a_ecef_pos_low",components:3,type:"Float32"}],4);var uy,hy=(uy=!0,function(t,e){var n=uy?function(){if(e){var n=e.apply(t,arguments);return e=null,n}}:function(){};return uy=!1,n}),fy=hy(void 0,(function(){return fy.toString().search("(((.+)+)+)+$").toString().constructor(fy).search("(((.+)+)+)+$")}));fy();var dy=function(t){void 0===t&&(t=[]),this.segments=t};dy.prototype.prepareSegment=function(t,e,n,r){var i=this.segments[this.segments.length-1];return(!i||i.vertexLength+t>dy.MAX_VERTEX_ARRAY_LENGTH||i.sortKey!==r)&&(i={vertexOffset:e.length,primitiveOffset:n.length,vertexLength:0,primitiveLength:0},void 0!==r&&(i.sortKey=r),this.segments.push(i)),i},dy.prototype.get=function(){return this.segments},dy.prototype.destroy=function(){for(var t=0,e=this.segments;t<e.length;t+=1){var n=e[t];for(var r in n.cesiumVaos)n.cesiumVaos[r].destroy()}},dy.simpleSegment=function(t,e,n,r){return new dy([{vertexOffset:t,primitiveOffset:e,vertexLength:n,primitiveLength:r,vaos:{},cesiumVaos:{},drawCommands:{},sortKey:0}])},dy.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,sA(dy,"SegmentVector");var py,Ay=(py=!0,function(t,e){var n=py?function(){if(e){var n=e.apply(t,arguments);return e=null,n}}:function(){};return py=!1,n}),gy=Ay(void 0,(function(){return gy.toString().search("(((.+)+)+)+$").toString().constructor(gy).search("(((.+)+)+)+$")}));gy();const my=function(){let t=!0;return function(e,n){const r=t?function(){if(n){const t=n.apply(e,arguments);return n=null,t}}:function(){};return t=!1,r}}(),yy=my(void 0,(function(){return yy.toString().search("(((.+)+)+)+$").toString().constructor(yy).search("(((.+)+)+)+$")}));yy();function vy(t,e,n){return Math.min(n,Math.max(e,t))}var Cy=function(t){var e,n=(e=!0,function(t,n){var r=e?function(){if(n){var e=n.apply(t,arguments);return n=null,e}}:function(){};return e=!1,r}),r=n(this,(function(){return r.toString().search("(((.+)+)+)+$").toString().constructor(r).search("(((.+)+)+)+$")}));return r(),{min:-1*Math.pow(2,t-1),max:Math.pow(2,t-1)-1}}(15);function Iy(t,e=true){for(var n=Cl/t.extent,r=t.loadGeometry(),i=0;i<r.length;i++)for(var o=r[i],a=0;a<o.length;a++){var s=o[a];s.x=Math.round(s.x*n),s.y=e?Cl-Math.round(s.y*n):Math.round(s.y*n),(s.x<Cy.min||s.x>Cy.max||s.y<Cy.min||s.y>Cy.max)&&(s.x=vy(s.x,Cy.min,Cy.max),s.y=vy(s.y,Cy.min,Cy.max))}return r}var xy,Ey=(xy=!0,function(t,e){var n=xy?function(){if(e){var n=e.apply(t,arguments);return e=null,n}}:function(){};return xy=!1,n}),_y=Ey(void 0,(function(){return _y.toString().search("(((.+)+)+)+$").toString().constructor(_y).search("(((.+)+)+)+$")}));function by(t,e){return{type:t.type,id:t.id,properties:t.properties,geometry:e?Iy(t):[]}}function wy(){this.high=Hr.clone(Hr.ZERO),this.low=Hr.clone(Hr.ZERO)}_y(),wy.encode=function(t,e){var n;return Qr.typeOf.number("value",t),Nr(e)||(e={high:0,low:0}),t>=0?(n=65536*Math.floor(t/65536),e.high=n,e.low=t-n):(n=65536*Math.floor(-t/65536),e.high=-n,e.low=t+n),e};var My={high:0,low:0};wy.fromCartesian=function(t,e){Qr.typeOf.object("cartesian",t),Nr(e)||(e=new wy);var n=e.high,r=e.low;return wy.encode(t.x,My),n.x=My.high,r.x=My.low,wy.encode(t.y,My),n.y=My.high,r.y=My.low,wy.encode(t.z,My),n.z=My.high,r.z=My.low,e};var Ty=new wy;wy.writeElements=function(t,e,n){Qr.defined("cartesianArray",e),Qr.typeOf.number("index",n),Qr.typeOf.number.greaterThanOrEquals("index",n,0),wy.fromCartesian(t,Ty);var r=Ty.high,i=Ty.low;e[n]=r.x,e[n+1]=r.y,e[n+2]=r.z,e[n+3]=i.x,e[n+4]=i.y,e[n+5]=i.z};const By=(t,e,n,r)=>{let i=e;const o=n>>>1,a=t[i-1];for(;e<=o;){(e=i<<1)<n&&0>r(t[e-1],t[e])&&++e;const o=t[e-1];if(0>=r(o,a))break;t[i-1]=o,i=e}t[i-1]=a},Sy=(t,e)=>t<e?-1:t>e?1:0;function Dy(){}function Ry(t=1){this._seed=t}function zy(){}function Oy(t){return t}function Ny(t){return t?(ky.seed=t,()=>ky.getFloat()):Math.random}Dy.sort=function(t,e,n,r){void 0===e&&(e=0),void 0===n&&(n=t.length),void 0===r&&(r=Sy);for(var i=n>>>1;i>e;i--)By(t,i,n,r);for(i=e+1,--n;n>e;n--){const o=t[e];t[e]=t[n],t[n]=o,By(t,i,n,r)}},Dy.iterableSort=function*(t,e,n,r){void 0===e&&(e=0),void 0===n&&(n=t.length),void 0===r&&(r=Sy);for(var i=n>>>1;i>e;i--)By(t,i,n,r),yield;for(i=e+1,--n;n>e;n--){const o=t[e];t[e]=t[n],t[n]=o,By(t,i,n,r),yield}},Object.defineProperties(Ry.prototype,{seed:{set:function(t){this._seed=null==t?Math.random()*c._m:t}}}),Ry.prototype.getInt=function(){return this._seed=(c._a*this._seed+c._c)%c._m},Ry.prototype.getFloat=function(){return this.getInt()/(c._m-1)},Ry.prototype.getIntRange=function(t,e){return Math.round(this.getFloatRange(t,e))},Ry.prototype.getFloatRange=function(t,e){e-=t;return t+this.getInt()/c._m*e},Ry._m=2147483647,Ry._a=48271,Ry._c=0;const Ly=!!Array.prototype.fill;function Qy(){this.last=0}const Fy=new Qy,Py=new Set,ky=new Ry;function Uy(t){t.data.length>1.5*t.length&&(t.data.length=Math.floor(1.1*t.length))}function jy(t){this.data=[],this._length=0,this._allocator=void 0,this._deallocator=()=>null,this._shrink=()=>{},this._hint=new Qy,t&&(t.initialSize&&(this.data=Array(t.initialSize)),t.allocator&&(this._allocator=t.allocator),void 0!==t.deallocator&&(this._deallocator=t.deallocator),t.shrink&&(this._shrink=()=>Uy(this)))}function Gy(t,e=30){this.name=t,this._counter=0,this._samples=Array(e)}function Hy(){}function qy(){}function Vy(){this._groups=new Map}function Yy(){}function Ky(t){return{remove:()=>{t&&(t(),t=void 0)}}}function Wy(t,e,n,r=1,i=0){if(this._ctor=t,this._acquireFunction=e,this._releaseFunction=n,this.allocationSize=r,this._pool=Array(i),this._initialSize=i,this._ctor)for(t=0;t<i;t++)this._pool[t]=new this._ctor;this.allocationSize=Math.max(r,1)}function Xy(t){t.length=0}function Jy(t=50,e=50){this._pool=new Wy(Array,void 0,Xy,e,t)}zy.EmptyArray=[],zy.ReallocGrowthFactor=1.5,zy.ReallocShrinkFactor=1/1.5,zy.ReallocShrinkTreshold=.5,zy.binaryFindClosest=function(t,e,n){if(t&&0!==t.length){var r=t.length-1,i=t[0];if(e<=n(i))return i;if(e>=n(i=t[r]))return i;var o=0;i=0;for(var a=r;o<a;){const c=t[i=o+Math.floor((a-o)/2)],l=n(c);if(l===e)return c;if(e<l){if(0<i){var s=n(a=t[i-1]);if(e>s)return e-s>=l-e?c:a}a=i}else{if(i<r&&e<(s=n(o=t[i+1])))return e-l>=s-e?o:c;o=i+1}}return t[i]}},zy.binaryIndexOf=function(t,e,n){const r=t.length;let i=0;for(var o=r-1;i<o;){const n=i+Math.floor((o-i)/2);e>t[n]?i=n+1:o=n}return o=t[i],n?e>=t[r-1]?-1:o===e?i:i-1:o===e?i:-1},zy.constant=function(t,e){if(Ly)return Array(t).fill(e);const n=Array(t);for(let r=0;r<t;r++)n[r]=e;return n},zy.difference=function(t,e,n){let r,i;return n?(r=e.filter((e=>!t.some((t=>n(t,e))))),i=t.filter((t=>!e.some((e=>n(e,t)))))):(r=e.filter((e=>!t.includes(e))),i=t.filter((t=>!e.includes(t)))),{added:r,removed:i}},zy.equals=function(t,e,n){if(null==t&&null==e)return!0;if(null==t||null==e||t.length!==e.length)return!1;if(n){for(let r=0;r<t.length;r++)if(!n(t[r],e[r]))return!1}else for(let n=0;n<t.length;n++)if(t[n]!==e[n])return!1;return!0},zy.filterInPlace=function(t,e){let n=0;for(let r=0;r<t.length;++r){const i=t[r];e(i,r)&&(t[n]=i,n++)}t.length=n},zy.first=function(t){if(t)return 0<t.length?t[0]:void 0},zy.groupToMap=function(t,e){const n=new Map,r=t.length;for(let i=0;i<r;i++){const r=t[i],o=e(r,i,t),a=n.get(o);a?a.push(r):n.set(o,[r])}return n},zy.intersect=function(t,e,n){return t&&e?n?t.filter((t=>-1<e.findIndex((e=>n(t,e))))):t.filter((t=>e.includes(t))):[]},zy.isArrayLike=function(t){return t&&"number"==typeof t.length},zy.isSome=function(t,e){return null!=t},zy.last=function(t){if(t){var e=t.length;return 0<e?t[e-1]:void 0}},zy.max=function(t,e=Oy){if(t&&0!==t.length){var n=t[0],r=e(n);for(let i=1;i<t.length;++i){const o=t[i],a=Number(e(o));a>r&&(r=a,n=o)}return n}},zy.min=function(t,e=Oy){return zy.max(t,(t=>-e(t)))},zy.pickRandom=function(t,e,n){const r=t.length;if(e>=r)return t.slice(0);let i=Ny(n);const o=new Set,a=[];for(;a.length<e;){const e=Math.floor(i()*r);o.has(e)||(o.add(e),a.push(t[e]))}return a},zy.range=function(t,e){void 0===e&&(e=t,t=0);const n=Array(e-t);for(let r=t;r<e;r++)n[r-t]=r;return n},zy.indexOf=function(t,e,n,r){r=r||Fy;var i=Math.max(0,r.last-10);for(let o=i;o<n;++o)if(t[o]===e)return r.last=o;for(n=Math.min(i,n),i=0;i<n;++i)if(t[i]===e)return r.last=i;return-1},zy.remove=function(t,e){const n=t.indexOf(e);return-1!==n?(t.splice(n,1),e):null},zy.removeUnordered=function(t,e,n,r){const i=null==n?t.length:n;let o=zy.indexOf(t,e,i,r);if(-1!==o)return t[o]=t[i-1],null==n&&t.pop(),e},zy.removeUnorderedMany=function(t,e,n=t.length,r=e.length,i,o){if(0===r||0===n)return n;Py.clear();for(let t=0;t<r;++t)Py.add(e[t]);i=i||Fy;let a=Math.max(0,i.last-10);for(var s=a;s<n;++s)if(Py.has(t[s])&&(o&&o.push(t[s]),Py.delete(t[s]),t[s]=t[n-1],--n,--s,0===Py.size||0===n))return Py.clear(),n;for(s=0;s<a;++s)if(Py.has(t[s])&&(o&&o.push(t[s]),Py.delete(t[s]),t[s]=t[n-1],--n,--s,0===Py.size||0===n))return Py.clear(),n;return Py.clear(),n},zy.shuffle=function(t,e){let n=Ny(e);for(let e=t.length-1;0<e;e--){const r=Math.floor(n()*(e+1)),i=t[e];t[e]=t[r],t[r]=i}return t},zy.splitIntoChunks=function(t,e){const n=t.length;if(0===n)return[];const r=[];for(let i=0;i<n;i+=e)r.push(t.slice(i,i+e));return r},zy.unique=function(t,e){return e?t.filter(((t,n,r)=>r.findIndex(e.bind(null,t))===n)):t.filter(((t,e,n)=>n.indexOf(t)===e))},zy.update=function(t,e){let n=t.length!==e.length;n&&(t.length=e.length);for(let r=0;r<e.length;++r)t[r]!==e[r]&&(t[r]=e[r],n=!0);return n},jy.prototype.toArray=function(){return this.data.slice(0,this.length)},jy.prototype.filter=function(t){const e=[];for(let n=0;n<this._length;n++){const r=this.data[n];t(r)&&e.push(r)}return e},jy.prototype.at=function(t){if(0>(t=Math.trunc(t)||0)&&(t+=this._length),!(0>t||t>=this._length))return this.data[t]},jy.prototype.includes=function(t,e){return-1!==(t=this.data.indexOf(t,e))&&t<this.length},jy.prototype.clear=function(){this.length=0},jy.prototype.prune=function(){this.clear(),this.data=[]},jy.prototype.push=function(t){this.data[this._length++]=t},jy.prototype.pushArray=function(t,e=t.length){for(let n=0;n<e;n++)this.data[this._length++]=t[n]},jy.prototype.fill=function(t,e){for(let n=0;n<e;n++)this.data[this._length++]=t},jy.prototype.pushNew=function(){this._allocator&&(this.data[this.length]=this._allocator(this.data[this.length]));const t=this.data[this._length];return++this._length,t},jy.prototype.unshift=function(t){this.data.unshift(t),this._length++,Uy(this)},jy.prototype.pop=function(){if(0!==this.length){var t=this.data[this.length-1];return--this.length,this._shrink(),t}},jy.prototype.remove=function(t){const e=zy.indexOf(this.data,t,this.length,this._hint);if(-1!==e)return this.data.splice(e,1),--this.length,t},jy.prototype.removeUnordered=function(t){return this.removeUnorderedIndex(zy.indexOf(this.data,t,this.length,this._hint))},jy.prototype.removeUnorderedIndex=function(t){if(!(t>=this.length||0>t))return this.swapElements(t,this.length-1),this.pop()},jy.prototype.removeUnorderedMany=function(t,e=t.length,n){this.length=zy.removeUnorderedMany(this.data,t,this.length,e,this._hint,n),this._shrink()},jy.prototype.front=function(){if(0!==this.length)return this.data[0]},jy.prototype.back=function(){if(0!==this.length)return this.data[this.length-1]},jy.prototype.swapElements=function(t,e){if(!(t>=this.length||e>=this.length||t===e)){var n=this.data[t];this.data[t]=this.data[e],this.data[e]=n}},jy.prototype.sort=function(t){Dy.sort(this.data,0,this.length,t)},jy.prototype.iterableSort=function(t){return Dy.iterableSort(this.data,0,this.length,t)},jy.prototype.some=function(t,e){for(let n=0;n<this.length;++n)if(t.call(e,this.data[n],n,this.data))return!0;return!1},jy.prototype.find=function(t,e){for(let n=0;n<this.length;++n){const r=this.data[n];if(t.call(e,r,n))return r}},jy.prototype.filterInPlace=function(t,e){let n=0;for(let r=0;r<this._length;++r){const i=this.data[r];t.call(e,i,r,this.data)&&(this.data[r]=this.data[n],this.data[n]=i,n++)}if(this._deallocator)for(t=n;t<this._length;t++)this.data[t]=this._deallocator(this.data[t]);return this._length=n,this._shrink(),this},jy.prototype.forAll=function(t,e){const n=this.length,r=this.data;for(let i=0;i<n;++i)t.call(e,r[i],i,r)},jy.prototype.forEach=function(t,e){for(let n=0;n<this.length;++n)t.call(e,this.data[n],n,this.data)},jy.prototype.map=function(t,e){const n=Array(this.length);for(let r=0;r<this.length;++r)n[r]=t.call(e,this.data[r],r,this.data);return n},jy.prototype.reduce=function(t,e){for(let n=0;n<this.length;++n)e=t(e,this.data[n],n,this.data);return e},jy.prototype.has=function(t){const e=this.length,n=this.data;for(let r=0;r<e;++r)if(n[r]===t)return!0;return!1},Object.defineProperties(jy.prototype,{length:{get:function(){return this._length},set:function(t){if(t>this._length)if(this._allocator)for(;this._length<t;)this.data[this._length++]=this._allocator(this.data[this._length]);else this._length=t;else{if(this._deallocator)for(let e=t;e<this._length;++e)this.data[e]=this._deallocator(this.data[e]);this._length=t,this._shrink()}}}}),Object.defineProperties(Gy.prototype,{median:{get:function(){return this._samples.slice().sort(((t,e)=>t-e))[Math.floor(this._samples.length/2)]}},average:{get:function(){return this._samples.reduce(((t,e)=>t+e),0)/this._samples.length}},last:{get:function(){return this._samples[this._counter%this._samples.length]}}}),Gy.prototype.record=function(t){null!=t&&(this._samples[++this._counter%this._samples.length]=t)},Hy.cache=function(t){const e=[];return function*(){yield*e;for(const n of t)e.push(n),yield n}},Hy.find=function(t,e){for(const n of t)if(null!=n&&e(n))return n},Hy.isIterable=function(t){return null!=t&&"function"==typeof t[Symbol.iterator]},qy.abortMaybe=function(t){return t&&t.abort(),null},qy.applySome=function(t,e){return null!=t?e(t):null},qy.assertIsSome=function(t,e){if(null==t)throw Error(e||"value is None")},qy.assumeNonNull=function(t){return t},qy.destroyMaybe=function(t){return t&&t.destroy(),null},qy.disposeMaybe=function(t){return t&&t.dispose(),null},qy.equalsMaybe=function(t,e,n){return null!=t&&null!=e?null!=n?n(t,e):t.equals(e):t===e},qy.forEachSome=function(t,e){for(const n of t)qy.applySome(n,e)},qy.mapMany=function(t,e){const n=[];for(const r of t)n.push(null!=r?e(r):null);return n},qy.nullifyNonNullableForDispose=function(t){return null},qy.releaseMaybe=function(t){return t&&t.release(),null},qy.removeMaybe=function(t){return t&&t.remove(),null},qy.unwrapOrThrow=function(t,e){return qy.assertIsSome(t,e),t},Object.defineProperties(Vy.prototype,{size:{get:function(){let t=0;return this._groups.forEach((e=>{t+=e.length})),t}}}),Vy.prototype.destroy=function(){this.removeAll()},Vy.prototype.add=function(t,e){if(Hy.isIterable(t)){e=this._getOrCreateGroup(e);for(const n of t)this._isHandle(n)&&e.push(n)}else this._isHandle(t)&&this._getOrCreateGroup(e).push(t);return this},Vy.prototype.forEach=function(t,e){if("function"==typeof t)this._groups.forEach((e=>e.forEach(t)));else{const n=this._getGroup(t);n&&e&&n.forEach(e)}},Vy.prototype.has=function(t){return this._groups.has(this._ensureGroupKey(t))},Vy.prototype.remove=function(t){if("string"!=typeof t&&Hy.isIterable(t)){for(const e of t)this.remove(e);return this}return this.has(t)?(this._removeAllFromGroup(this._getGroup(t)),this._groups.delete(this._ensureGroupKey(t)),this):this},Vy.prototype.removeAll=function(){return this._groups.forEach((t=>this._removeAllFromGroup(t))),this._groups.clear(),this},Vy.prototype._isHandle=function(t){return t&&(!!t.remove||t instanceof f)},Vy.prototype._getOrCreateGroup=function(t){if(this.has(t))return this._getGroup(t);const e=[];return this._groups.set(this._ensureGroupKey(t),e),e},Vy.prototype._getGroup=function(t){return qy.assumeNonNull(this._groups.get(this._ensureGroupKey(t)))},Vy.prototype._ensureGroupKey=function(t){return t||"_default_"},Vy.prototype._removeAllFromGroup=function(t){for(const e of t)e instanceof f?e.removeAll():e.remove()},Yy.abortHandle=function(t){return Ky((()=>t&&t.abort()))},Yy.asyncHandle=function(t,e){let n=!1,r=null;return t.then((t=>{n?t.remove():r=t})),Ky((()=>{n=!0,null!=r?r.remove():null!=e&&(e.abort(),e=null)}))},Yy.destroyHandle=function(t){return Ky(null!=t?()=>t.destroy():void 0)},Yy.handlesGroup=function(t){return Ky((()=>t.forEach((t=>null!=t&&t.remove()))))},Yy.makeHandle=Ky,Yy.refHandle=function(t){return Ky((()=>{const e=t();null!=e&&e.remove()}))},Yy.timeoutHandle=function(t,e){const n=setTimeout(t,e);return Ky((()=>clearTimeout(n)))},Wy.prototype.destroy=function(){this.prune(0)},Wy.prototype.acquire=function(...t){if(Wy.test.disabled)var e=new this._ctor;else{if(0===this._pool.length){e=this.allocationSize;for(let t=0;t<e;t++)this._pool[t]=new this._ctor}e=this._pool.pop()}return this._acquireFunction?this._acquireFunction(e,...t):e&&e.acquire&&"function"==typeof e.acquire&&e.acquire(...t),e},Wy.prototype.release=function(t){t&&!Wy.test.disabled&&(this._releaseFunction?this._releaseFunction(t):t&&t.release&&"function"==typeof t.release&&t.release(),this._pool.push(t))},Wy.prototype.prune=function(t=this._initialSize){if(!(t>=this._pool.length)){for(let e=t;e<this._pool.length;++e)this._dispose(this._pool[e]);this._pool.length=t}},Wy.prototype._dispose=function(t){t.dispose&&"function"==typeof t.dispose&&t.dispose()},Wy.test={disabled:!1},Jy.prototype.acquire=function(){return this._pool.acquire()},Jy.prototype.release=function(t){this._pool.release(t)},Jy.prototype.prune=function(){this._pool.prune(0)},Jy.acquire=function(){return Zy.acquire()},Jy.release=function(t){return Zy.release(t)},Jy.prune=function(){Zy.prune()};const Zy=new Jy(100);function $y(){}function tv(t){return"Int8Array"===t&&t.constructor&&t.constructor.name}function ev(t){return"Uint8Array"===t&&t.constructor&&t.constructor.name}function nv(t){return"Uint8ClampedArray"===t&&t.constructor&&t.constructor.name}function rv(t){return"Int16Array"===t&&t.constructor&&t.constructor.name}function iv(t){return"Uint16Array"===t&&t.constructor&&t.constructor.name}function ov(t){return"Int32Array"===t&&t.constructor&&t.constructor.name}function av(t){return"Uint32Array"===t&&t.constructor&&t.constructor.name}function sv(t){return"Float32Array"===t&&t.constructor&&t.constructor.name}function cv(t){return"Float64Array"===t&&t.constructor&&t.constructor.name}function lv(t){return!("buffer"in t)}function uv(){}function hv(t){return"function"==typeof t.map&&"function"==typeof t.forEach}function fv(t){if($y.isInt8Array(t)||$y.isUint8Array(t)||$y.isUint8ClampedArray(t)||$y.isInt16Array(t)||$y.isUint16Array(t)||$y.isInt32Array(t)||$y.isUint32Array(t)||$y.isFloat32Array(t)||$y.isFloat64Array(t))return t.slice();if(t instanceof Date)return new Date(t.getTime());if(t instanceof ArrayBuffer)return t.slice(0,t.byteLength);if(t instanceof Map){var e=new Map;for(const[n,r]of t)e.set(n,uv.clone(r));return e}if(t instanceof Set){e=new Set;for(const n of t)e.add(uv.clone(n));return e}return null}function dv(){Wy.call(this,...arguments),this._set=new Set}function pv(){}$y.NATIVE_ARRAY_MAX_SIZE=1024,$y.estimateSize=function(t){return null!=t?lv(t)?8*t.length+12:t.byteLength+145:0},$y.isArray=lv,$y.isArrayBuffer=function(t){return t instanceof ArrayBuffer},$y.isFloat=function(t){return cv(t)||sv(t)},$y.isFloat32Array=sv,$y.isFloat64Array=cv,$y.isInt16Array=rv,$y.isInt32Array=ov,$y.isInt8Array=tv,$y.isSigned=function(t){return cv(t)||sv(t)||ov(t)||rv(t)||tv(t)},$y.isUint16Array=iv,$y.isUint32Array=av,$y.isUint8Array=ev,$y.isUint8ClampedArray=nv,$y.maximumValue=function(t){return cv(t)?179769e303:sv(t)?3402823e32:av(t)?4294967295:iv(t)?65535:ev(t)||nv(t)?255:ov(t)?2147483647:rv(t)?32767:tv(t)?127:256},$y.typedArrayStaticSize=145,uv.clone=function(t){if(!t||"object"!=typeof t||"function"==typeof t)return t;var e=fv(t);if(null!=e)return e;if(uv.isClonable(t))return t.clone();if(hv(t))return t.map(g);if(uv.isAccessorLike(t))return t.clone();e={};for(const n of Object.getOwnPropertyNames(t))e[n]=uv.clone(t[n]);return e},uv.equals=function(t,e){return t===e||"number"==typeof t&&isNaN(t)&&"number"==typeof e&&isNaN(e)||"function"==typeof(t||{}).getTime&&"function"==typeof(e||{}).getTime&&t.getTime()===e.getTime()||!1},uv.equalsShallow=function(t,e){if(t===e)return!0;if(null==t||"string"==typeof t)return t===e;if("number"==typeof t)return t===e||"number"==typeof e&&isNaN(t)&&isNaN(e);if(t instanceof Date)return e instanceof Date&&t.getTime()===e.getTime();if(Array.isArray(t))return Array.isArray(e)&&zy.equals(t,e);if(t instanceof Set){var n;if(n=e instanceof Set)t:if(t.size!==e.size)n=!1;else{for(const r of t)if(!e.has(r)){n=!1;break t}n=!0}return n}if(t instanceof Map){if(n=e instanceof Map)t:if(t.size!==e.size)n=!1;else{for(const[r,i]of t)if((t=e.get(r))!==i||void 0===t&&!e.has(r)){n=!1;break t}n=!0}return n}return!!uv.isPlainObject(t)&&(uv.isPlainObject(e)&&function(t,e){if(null===t||null===e)return!1;const n=Object.keys(t);if(null===e||Object.keys(e).length!==n.length)return!1;for(const r of n)if(t[r]!==e[r]||!Object.prototype.hasOwnProperty.call(e,r))return!1;return!0}(t,e))},uv.fixJson=function(t,e){let n;if(e)for(n in t)t.hasOwnProperty(n)&&(void 0===t[n]?delete t[n]:t[n]instanceof Object&&uv.fixJson(t[n],!0));else for(n in t)t.hasOwnProperty(n)&&void 0===t[n]&&delete t[n];return t},uv.isAccessorLike=function(t){return"function"==typeof t.notifyChange&&"function"==typeof t.watch},uv.isClonable=function(t){return"function"==typeof t.clone},uv.isPlainObject=function(t){return"[object Object]"===Object.prototype.toString.call(t)&&(null===(t=Object.getPrototypeOf(t))||t===Object.prototype)},uv.tryClone=function(t){if(!t||"object"!=typeof t||"function"==typeof t||"HTMLElement"in globalThis&&t instanceof HTMLElement)return t;var e=fv(t);if(null!=e)return e;if(hv(t)){let e=!0;return t=t.map((t=>{const n=uv.tryClone(t);return null!=t&&null==n&&(e=!1),n})),e?t:null}if(u(t))return t.clone();if(t instanceof File||t instanceof Blob)return t;if(!uv.isAccessorLike(t)){e=new(Object.getPrototypeOf(t).constructor);for(const n of Object.getOwnPropertyNames(t)){const r=t[n],i=uv.tryClone(r);if(null!=r&&null==i)return null;e[n]=i}return e}return null},dv.prototype=Object.create(Wy.prototype),dv.prototype.constructor=dv,dv.prototype.destroy=function(){Wy.prototype.destroy.apply(this),this._set=null},dv.prototype.acquire=function(...t){return t=Wy.prototype.acquire.apply(this,Array.prototype.slice.apply(arguments)),this._set.delete(t),t},dv.prototype.release=function(t){t&&!this._set.has(t)&&(Wy.prototype.release.apply(this,t),this._set.add(t))},dv.prototype._dispose=function(t){this._set.delete(t),Wy.prototype._dispose.apply(this,t)};const Av=[];function gv(){}function mv(){for(;vv.length;){const t=vv.shift();t.isActive&&t.callback()}Cv.willDispatch=!1}pv.nextTick=function(t){Av.push(t),1===Av.length&&queueMicrotask((()=>{const t=Av.slice();Av.length=0;for(const e of t)e()}))};class yv{constructor(t){this.callback=t,this.isActive=!0}remove(){this.isActive=!1}}var vv=[];const Cv={willDispatch:!1,dispatch:mv};gv.schedule=function(t){return t=new yv(t),vv.push(t),Cv.willDispatch||(Cv.willDispatch=!0,pv.nextTick(mv)),t};let Iv=0;function xv(){}function Ev(){}function _v(t){return t.__accessor__?t.__accessor__:null}function bv(t,e,n){return e?Object.keys(e).reduce(((t,r)=>{let i=null;var o="merge";if(n&&(i=n.path?`${n.path}.${r}`:r,o=n.policy(i)),"replace"===o||"replace-arrays"===o&&Array.isArray(t[r]))return t[r]=e[r],t;if(void 0===t[r])return t[r]=uv.clone(e[r]),t;let a=t[r];if(o=e[r],a===o)return t;if(Array.isArray(o)||Array.isArray(t))a=a?Array.isArray(a)?t[r]=a.concat():t[r]=[a]:t[r]=[],o&&(Array.isArray(o)||(o=[o]),o.forEach((t=>{a.includes(t)||a.push(t)})));else if(o&&"object"==typeof o)if(n){const e=n.path;n.path=qy.assumeNonNull(i),t[r]=bv(a,o,n),n.path=e}else t[r]=bv(a,o,null);else t.hasOwnProperty(r)&&!e.hasOwnProperty(r)||(t[r]=o);return t}),t||{}):t}function wv(t){return Array.isArray(t)?t:t.split(".")}function Mv(t){return t.includes(",")?t.split(",").map((t=>t.trim())):[t.trim()]}function Tv(t){if(Array.isArray(t)){const e=[];for(const n of t)e.push(...Mv(n));return e}return Mv(t)}function Bv(){}function Sv(t,e){if(t="?"===t[t.length-1]?t.slice(0,-1):t,null!=e.getItemAt||Array.isArray(e)){var n=parseInt(t,10);if(!isNaN(n))return Array.isArray(e)?e[n]:e.at(n)}return n=Ev.getProperties(e),Ev.isPropertyDeclared(n,t)?n.get(t):e[t]}function Dv(t,e,n){return null==t?t:!(t=Sv(e[n],t))&&n<e.length-1?void 0:n===e.length-1?t:Dv(t,e,n+1)}function Rv(t,e,n=0){return"string"!=typeof e||e.includes(".")?Dv(t,Ev.pathToArray(e),n):Sv(e,t)}function zv(){}function Ov(t){this._notify=t,this._invalidCount=0,this.destroyed=!1}function Nv(t){this._accessed=[],this._handles=[],this._observerObject=new Ov(t)}xv.NullUID=0,xv.generateUID=function(){return++Iv},Ev.getDependsInfo=function(t,e){const n=_v(t);return n?n.getDependsInfo(t,e,""):""},Ev.getProperties=_v,Ev.isPropertyDeclared=function(t,e){return null!=t&&t.metadatas&&null!=t.metadatas[e]},Ev.merge=function(t,e,n){return bv(t,e,n?{policy:n,path:""}:null)},Ev.once=function(t){let e=!1;return()=>{e||(e=!0,t())}},Ev.parse=function(t,e,n,r){return 1!==(e=Tv(e)).length?(e=e.map((e=>r(t,e,n))),Yy.handlesGroup(e)):r(t,e[0],n)},Ev.parseConditionalPath=function(t){if(!t.includes("?"))return null;t=wv(t);const e=Array(t.length);for(let n=0;n<t.length;n++){const r=t[n];e[n]="?"===r[r.length-1],e[n]&&(t[n]=r.slice(0,-1))}return{fullPath:t.join("."),conditional:e}},Ev.pathToArray=wv,Ev.pathToStringOrArray=function(t){return!t||"string"==typeof t&&!t.includes(".")?t:wv(t)},Ev.splitPath=Tv,Bv.exists=function(t,e){return void 0!==Rv(e,t)},Bv.get=function(t,e){return Rv(t,e)},Bv.valueOf=Rv,Ov.prototype.onInvalidated=function(){this._invalidCount++},Ov.prototype.onCommitted=function(){if(!this.destroyed){var t=this._invalidCount;1===t?(this._invalidCount=0,this._notify()):this._invalidCount=0<t?t-1:0}},Ov.prototype.destroy=function(){this.destroyed=!0,this._notify=zv},Nv.prototype.destroy=function(){this._accessed.length=0,this._observerObject&&this._observerObject.destroy(),this.clear()},Nv.prototype.onObservableAccessed=function(t){const e=this._accessed;e.includes(t)||e.push(t)},Nv.prototype.onTrackingEnd=function(){const t=this._handles,e=this._accessed,n=this._observerObject;for(let r=0;r<e.length;++r)t.push(e[r].observe(n));e.length=0},Nv.prototype.clear=function(){const t=this._handles;for(let e=0;e<t.length;++e)t[e].remove();t.length=0};let Lv={};function Qv(){}function Fv(){var t=Uv.length;if(1<t){const e=Uv.pop();jv=Uv[t-2],e.onTrackingEnd()}else if(1===t){const t=Uv.pop();jv=kv,t.onTrackingEnd()}else jv=kv}function Pv(t,e,n){if(e="?"===e[e.length-1]?e.slice(0,-1):e,null!=t.getItemAt||Array.isArray(t)){var r=parseInt(e,10);if(!isNaN(r))return Array.isArray(t)?t[r]:t.at(r)}return(r=Ev.getProperties(t))&&(r=r.propertiesByName.get(e))&&(Qv.trackAccess(r.observerObject),Qv.initializeDependencyTracking(t,r)),n?t[e]:void 0}Lv[Lv.Dirty=1]="Dirty",Lv[Lv.Overriden=2]="Overriden",Lv[Lv.Computing=4]="Computing",Lv[Lv.NonNullable=8]="NonNullable",Lv[Lv.HasDefaultValue=16]="HasDefaultValue",Lv[Lv.DepTrackingInitialized=32]="DepTrackingInitialized",Lv[Lv.AutoTracked=64]="AutoTracked",Lv[Lv.ExplicitlyTracking=128]="ExplicitlyTracking";const kv={onObservableAccessed:()=>{},onTrackingEnd:()=>{}},Uv=[];let jv=kv,Gv=!1,Hv=!1;const qv=[];function Vv(){}Qv.initializeDependencyTracking=function(t,e){if(!(e.flags&Lv.DepTrackingInitialized)){var n=Hv;Hv=!1,e.flags&Lv.AutoTracked?Qv.runTrackedNoThrow(e,e.metadata.get,t):Qv.trackExplicitDependencies(t,e),Hv=n}},Qv.runTracked=function(t,e,n){if(Gv)return Qv.runTrackedNoThrow(t,e,n);jv=t,Uv.push(t);var r=e.call(n);return Fv(),r},Qv.runTrackedNoThrow=function(t,e,n){const r=Gv;Gv=!0,jv=t,Uv.push(t),t=null;try{t=e.call(n)}catch(t){Hv&&console.log("core.accessorSupport.tracking",t)}return Fv(),Gv=r,t},Qv.runUntracked=function(t,e){return Qv.runTracked(kv,t,e)},Qv.trackAccess=function(t){jv.onObservableAccessed(t)},Qv.trackExplicitDependencies=function(t,e){const n=e.observerObject;n.flags&Lv.ExplicitlyTracking||(n.flags|=Lv.ExplicitlyTracking,Qv.runTrackedNoThrow(e,(()=>{var n=e.metadata.dependsOn||qv;for(const e of n)if("string"!=typeof e||e.includes(".")){n=Ev.pathToArray(e);for(let e=0,r=t;e<n.length&&null!=r&&"object"==typeof r;++e)r=Pv(r,n[e],e!==n.length-1)}else Pv(t,e,!1)})),n.flags&=~Lv.ExplicitlyTracking)};let Yv=!1;const Kv=[];function Wv(){this.uid=xv.generateUID(),this.removed=!1,this.equals=null,this.path=null,this.target=null,this.getValue=null,this.callback=null,this.oldValue=null,this.type=null}function Xv(){}function Jv(t){rC.delete(t),rC.add(t),iC||(iC=gv.schedule($v))}function Zv(t){if(!t.removed){var e=t.oldValue,n=t.getValue();t.equals(e,n)||(t.oldValue=n,t.notify(n,e))}}function $v(){let t=10;for(;iC&&t--;){iC=null;const t=tC(),e=nC.acquire();for(const n of t){const t=n.uid;Zv(n),t===n.uid&&n.removed&&e.push(n)}for(const t of rC)t.removed&&(e.push(t),rC.delete(t));for(const t of e)Wv.pool.release(t);nC.release(e),nC.release(t),oC.forEach((t=>t()))}}function tC(){const t=nC.acquire();t.length=rC.size;let e=0;for(const n of rC)t[e]=n,++e;return rC.clear(),t}var eC;Vv.autorun=function(t){let e=new Nv((function r(){if(e&&!n)if(Yv)Kv.includes(r)||Kv.unshift(r);else for(e.clear(),n=Yv=!0,Qv.runTracked(e,t),Yv=n=!1;Kv.length;)Kv.pop()()})),n=!1;return n=!0,Qv.runTracked(e,t),n=!1,{remove:function(){e&&(e.destroy(),e=null)}}},Vv.reaction=function(t,e){let n=new Nv((function o(){if(n&&!i)if(Yv)Kv.includes(o)||Kv.unshift(o);else{var a=r;for(n.clear(),i=Yv=!0,r=Qv.runTracked(n,t),Yv=i=!1,e(r,a);Kv.length;)Kv.pop()()}})),r=null,i=!1;return i=!0,r=Qv.runTracked(n,t),i=!1,{remove:function(){n&&(n.destroy(),r=n=null)}}},Vv.reactionDeferred=function(t,e){function n(){return r?(r.clear(),i=Qv.runTracked(r,t)):null}let r=new Nv((function(){e(i,n)}));var i=null;return n(),{remove:function(){r&&(r.destroy(),r=null),i=null}}},Wv.acquireUntracked=function(t,e,n,r,i){return this.pool.acquire(eC.Untracked,t,e,n,r,i,uv.equals)},Wv.acquireTracked=function(t,e,n,r){return this.pool.acquire(eC.Tracked,t,e,n,null,null,r)},Wv.prototype.notify=function(t,e){this.type===eC.Untracked?this.callback.call(this.target,t,e,this.path,this.target):this.callback.call(null,t,e,void 0,void 0)},Wv.prototype.acquire=function(t,e,n,r,i,o,a){this.uid=xv.generateUID(),this.removed=!1,this.type=t,this.oldValue=e,this.callback=n,this.getValue=r,this.target=i,this.path=o,this.equals=a},Wv.prototype.release=function(){this.target=null,this.path=null,this.oldValue=null,this.callback=null,this.getValue=null,this.uid=xv.generateUID(),this.removed=!1},Wv.pool=new dv(Wv),function(t){t[t.Untracked=0]="Untracked",t[t.Tracked=1]="Tracked"}(eC||(eC={}));const nC=new Jy,rC=new Set;let iC;const oC=new Set;function aC(){}function sC(t="Aborted"){return{type:"AbortError",status:t}}function cC(t,e="Aborted"){if(uC(t))throw sC(e)}function lC(t){return null!=t?"aborted"in t?t:t.signal:t}function uC(t){return null!=(t=lC(t))&&t.aborted}function hC(t,e){null!=(t=lC(t))&&t.aborted&&e()}function fC(t){return"AbortError"===t&&t.name}async function dC(t){if(t){if("function"!=typeof t.forEach){const e=Object.keys(t),n=e.map((e=>t[e])),r=await dC(n),i={};return e.map(((t,e)=>i[t]=r[e])),i}return Promise.allSettled(t).then((e=>Array.from(t,((t,n)=>"fulfilled"===(n=e[n]).status?{promise:t,value:n.value}:{promise:t,error:n.reason}))))}}function pC(t){return t&&"function"==typeof t.then}function AC(){}function gC(t,e,n={},r){let i=null;const o=n.once?(t,n)=>{r(t)&&(qy.removeMaybe(i),e(t,n))}:(t,n)=>{r(t)&&e(t,n)};if(i=Xv.watchTracked(t,o,n.sync,n.equals),n.initial){let e=t();o(e,e)}return i}function mC(t,e,n){if(aC.isAborted(n))return Promise.reject(aC.createAbortError());const r=t();if(e&&e(r))return Promise.resolve(r);let i=null;return new Promise(((r,o)=>{i=Yy.handlesGroup([aC.onAbort(n,(()=>{i=qy.removeMaybe(i),o(aC.createAbortError())})),gC(t,(t=>{i=qy.removeMaybe(i),r(t)}),{sync:!1,once:!0},e||yC)])}))}function yC(t){return!0}function vC(t){return!!t}function CC(t,e){this._observers=t,this._observer=e}function IC(){this._observers=null,this.destroyed=!1}Xv.afterDispatch=function(t){return oC.add(t),Yy.makeHandle((()=>oC.delete(t)))},Xv.dispatch=$v,Xv.removeTarget=function(t){for(const e of rC.values())e.target===t&&(e.removed=!0)},Xv.watch=function(t,e,n,r=!1){return!t.__accessor__||t.__accessor__.destroyed?Yy.makeHandle():r?function(t,e,n){const r=Ev.parse(t,e,n,((t,e,n)=>{let i=!1;return Vv.reaction((()=>Bv.valueOf(t,e)),((o,a)=>{t.__accessor__.destroyed?r.remove():i||(i=!0,uv.equals(a,o)||n.call(t,o,a,e,t),i=!1)}))}));return r}(t,e,n):function(t,e,n){let r=Ev.parse(t,e,n,((t,e,n)=>{let i,o,a=Vv.reactionDeferred((()=>Bv.valueOf(t,e)),((a,s)=>{t.__accessor__.destroyed||i&&i.uid!==o?r.remove():(i||(i=Wv.acquireUntracked(a,n,s,t,e),o=i.uid),Jv(i))}));return Yy.makeHandle((()=>{a.remove(),i&&(i.uid!==o||i.removed||(i.removed=!0,Jv(i)),i=null),r=a=null}))}));return r}(t,e,n)},Xv.watchTracked=function(t,e,n=!1,r=uv.equalsShallow){return n?function(t,e,n){let r=!1;return Vv.reaction(t,((t,i)=>{r||(r=!0,n(i,t)||e(t,i),r=!1)}))}(t,e,r):function(t,e,n){var r,i,o=Vv.reactionDeferred(t,((t,a)=>{r&&r.uid!==i?o.remove():(r||(r=Wv.acquireTracked(t,e,a,n),i=r.uid),Jv(r))}));return Yy.makeHandle((()=>{o.remove(),r&&(r.uid!==i||r.removed||(r.removed=!0,Jv(r)),r=null),o=null}))}(t,e,r)},aC.after=function(t,e,n){const r=new AbortController;return hC(n,(()=>r.abort())),new Promise(((n,i)=>{let o=setTimeout((()=>{o=0,n(e)}),t);hC(r,(()=>{o&&(clearTimeout(o),i(sC()))}))}))},aC.allSettledErrors=async function(t){return(await Promise.allSettled(t)).filter((t=>"rejected"===t.status)).map((t=>t.reason))},aC.allSettledValues=async function(t){return(await Promise.allSettled(t)).filter((t=>"fulfilled"===t.status)).map((t=>t.value))},aC.always=function(t,e){return t.then(e,e)},aC.createAbortError=sC,aC.eachAlways=dC,aC.eachAlwaysValues=async function(t){return(await dC(t)).filter((t=>!!t.value)).map((t=>t.value))},aC.filter=async function(t,e){const n=t.slice(),r=await Promise.all(t.map(((t,n)=>e(t,n))));return n.filter(((t,e)=>r[e]))},aC.ignoreAbortErrors=async function(t){try{return await t}catch(t){if(!fC(t))throw t}},aC.isAbortError=fC,aC.isAborted=uC,aC.isPromiseLike=pC,aC.onAbort=hC,aC.settleWithPromise=function(t,e){e.then(t.resolve,t.reject)},aC.throwIfAbortError=function(t){if(fC(t))throw t},aC.throwIfAborted=cC,aC.throwIfNotAbortError=function(t){if(!fC(t))throw t},aC.waitTick=async function(t){await Promise.resolve(),cC(t)},aC.when=function(t){return pC(t)?t:Promise.resolve(t)},aC.whenOrAbort=function(t,e){return null==lC(e)?t:new Promise(((n,r)=>{let i=hC(e,(()=>r(sC())));const o=()=>{i=qy.removeMaybe(i)};t.then(o,o),t.then(n,r)}))},AC.autorun=Vv.autorun,AC.initial={initial:!0},AC.pausable=function(t,e,n={}){let r=!1;const i=AC.watch(t,((t,n)=>{r||e(t,n)}),n);return{remove(){i.remove()},pause(){r=!0},resume(){r=!1}}},AC.sync={sync:!0},AC.syncAndInitial={sync:!0,initial:!0},AC.watch=function(t,e,n={}){return gC(t,e,n,yC)},AC.when=function(t,e,n={}){return gC(t,e,n,vC)},AC.once=function(t,e){return mC(t,null,e)},AC.whenOnce=function(t,e){return mC(t,vC,e)},CC.prototype.remove=function(){zy.remove(this._observers,this._observer)},IC.prototype.observe=function(t){if(this.destroyed||t.destroyed)return xC;null==this._observers&&(this._observers=[]);const e=this._observers;let n=!1,r=!1;const i=e.length;for(let o=0;o<i;++o){const i=e[o];if(i.destroyed)r=!0;else if(i===t){n=!0;break}}return n||(e.push(t),r&&this._removeDestroyedObservers()),new CC(e,t)},IC.prototype._removeDestroyedObservers=function(){const t=this._observers;if(t&&0!==t.length){var e=t.length,n=0;for(let r=0;r<e;++r){for(;r+n<e&&t[r+n].destroyed;)++n;if(0<n){if(!(r+n<e))break;t[r]=t[r+n]}}t.length=e-n}},IC.prototype.destroy=function(){if(!this.destroyed){this.destroyed=!0;var t=this._observers;if(null!=t){for(const e of t)e.onCommitted();this._observers=null}}};const xC=Yy.makeHandle();function EC(){IC.call(this)}function _C(t,e){this._observable=new EC,this._value=t,this._equalityFunction=e}function bC(t,e,n,r,i){this.resolve=t,this.reject=e,this.callback=n,this.signal=r,this.abortCallback=i}function wC(){this._tasks=[],this._running=_C.signal(!1)}EC.prototype=Object.create(IC.prototype),EC.prototype.constructor=IC,EC.prototype.notify=function(){var t=this._observers;if(t&&0<t.length){t=t.slice();for(const e of t)e.onInvalidated(),e.onCommitted()}},Object.defineProperties(_C.prototype,{value:{get:function(){return Qv.trackAccess(this._observable),this._value},set:function(t){this._equalityFunction(t,this._value)||(this._value=t,this._observable.notify())}}}),_C.prototype.mutate=function(t){t(this._value),this._observable.notify()},_C.signal=function(t,e=uv.equalsShallow){return new _C(t,e)},Object.defineProperties(wC.prototype,{length:{get:function(){return this._tasks.length}},running:{get:function(){return this._running.value}}}),wC.prototype.destroy=function(){this.cancelAll()},wC.prototype.runTask=function(t){for(;!t.done&&this._process(t);)t.madeProgress()},wC.prototype.push=function(t,e,n){return this._running.value=!0,new Promise(((r,i)=>this._tasks.push(new bC(r,i,t,e,n))))},wC.prototype.unshift=function(t,e,n){return this._running.value=!0,new Promise(((r,i)=>this._tasks.unshift(new bC(r,i,t,e,n))))},wC.prototype._process=function(t){if(0===this._tasks.length)return!1;const e=this._tasks.shift();try{const n=c.isAborted(e.signal);if(n&&!e.abortCallback)e.reject(c.createAbortError());else{const r=n?e.abortCallback&&e.abortCallback(c.createAbortError()):e.callback(t);c.isPromiseLike(r)?r.then(e.resolve,e.reject):e.resolve(r)}}catch(t){e.reject(t)}return this._running.value=0<this._tasks.length,!0},wC.prototype.cancelAll=function(){const t=c.createAbortError();for(const e of this._tasks)if(e.abortCallback){const n=e.abortCallback(t);e.resolve(n)}else e.reject(t);this._tasks.length=0,this._running.value=!1};const MC="YIELD",TC="INTERACTING",BC="IDLE";function SC(t){return LC.has(t)?LC.get(t):"number"==typeof t?t:1}const DC={TESTA:"immediate",TESTB:"schedule",TESTC:"slide",SHADOW_ACCUMULATOR:"shadow accumulator",GRAPHICS_DECONFLICTOR:"graphics deconflictor",LABELER:"LABELER",GET_ELEVATION:"GET_ELEVATION"},RC="s",zC="r",OC="w",NC="i",LC=new Map([[DC.RESOURCE_CONTROLLER_IMMEDIATE,0],[DC.RESOURCE_CONTROLLER,4],[DC.GRAPHICS_DECONFLICTOR,4],[DC.LABELER,8],[DC.GET_ELEVATION,9],[DC.SLIDE,0],[DC.SHADOW_ACCUMULATOR,30]]);function QC(t){this._updating=_C.signal(!0),this._microTaskQueued=!1,this._frameNumber=0,this.performanceInfo={total:new Gy("total"),tasks:new Map},this._frameTaskTimes=new Map,this._budget=new FC,this._state=TC,this._tasks=new jy,this._runQueue=new jy,this._load=0,this._idleStateCallbacks=new jy,this._debug=!1,this._forceTask=!1,this._idleUpdatesStartFired=!1,this._cameraChangeTime=0;for(const t of Object.keys(DC))this.performanceInfo.tasks.set(DC[t],new Gy(DC[t]));const e=this;t.camera.changed.addEventListener((()=>{e._cameraChangeTime=performance.now()}))}Object.defineProperties(QC.prototype,{updating:{get:function(){return this._updating.value}},load:{get:function(){return this._load}},state:{get:function(){return this._state},set:function(t){this._state!==t&&(this._state=t,this.state!==BC&&this._idleUpdatesStartFired&&(this._idleUpdatesStartFired=!1,this._idleStateCallbacks.forAll((t=>t.idleEnd()))))}},test:{get:function(){return this._test}}}),QC.prototype._updatingChanged=function(){this._updating.value=this._tasks.some((t=>t.needsUpdate))},QC.prototype.destroy=function(){this._tasks.toArray().forEach((t=>t.remove())),this._tasks.clear(),this._microTaskQueued=!1,this._updatingChanged()},QC.prototype.taskRunningChanged=function(t){this._updatingChanged(),t&&0<this._budget.remaining&&!this._microTaskQueued&&(this._microTaskQueued=!0,queueMicrotask((()=>{this._microTaskQueued&&(this._microTaskQueued=!1,0<this._budget.remaining&&this._schedule()&&this.frame())})))},QC.prototype.registerTask=function(t,e){return e=new PC(this,t,e,SC(t)),this._tasks.push(e),this._updatingChanged(),this.performanceInfo.tasks.has(t)||this.performanceInfo.tasks.set(H,new Gy(t)),e},QC.prototype.registerIdleStateCallbacks=function(t,e){const n={idleBegin:t,idleEnd:e};this._idleStateCallbacks.push(n),this.state===BC&&this._idleUpdatesStartFired&&n.idleBegin();const r=this;return{remove:()=>this._removeIdleStateCallbacks(n),set idleBegin(t){r._idleUpdatesStartFired&&(n.idleEnd(),r._state===BC&&t()),n.idleBegin=t},set idleEnd(t){n.idleEnd=t}}};function FC(){this._begin="undefined"!=typeof performance?performance.now():0,this._budget=0,this._state=BC,this._progressed=this._done=!1,this._enabled=!0}function PC(t,e,n,r){this._scheduler=t,this.name=e,this._basePriority=r,this.runtime=this.blockFrame=0,this._queue=new wC,this._handles=new Vy,this.schedulePriority=this._basePriority,this._task=_C.signal(null!=n?n:this._queue),this._handles.add(AC.when((()=>{this.task.running}),(e=>t.taskRunningChanged(e))))}function kC(t){Qr.defined("scene",t.scene),Qr.defined("globe",t.globe),this._scene=t.scene,this._globe=t.globe,this._running=!0,this._frameTask=this._scene._frameScheduler.registerTask(DC.GET_ELEVATION,this),this._requestManager=new qC}QC.prototype.updateBudget=function(t){++this._frameNumber;let e=6.5,n=t.frameDuration,r=1;switch(this.state){case BC:e=0,n=Math.max(60,t.frameDuration),r=15;break;case TC:n=Math.max(5,t.frameDuration)}return n=n-t.elapsedFrameTime-e,this.state!==BC&&n<1&&!this._forceTask?(this._forceTask=!0,!1):(n=Math.max(n,r),this._budget.reset(n,this.state),this._updateLoad(),this._schedule())},QC.prototype.frame=function(){switch(300>=performance.now()-this._cameraChangeTime?this._state=TC:this._state=BC,this._microTaskQueued=this._forceTask=!1,this.state){case BC:this._idleUpdatesStartFired||(this._idleUpdatesStartFired=!0,this._idleStateCallbacks.forAll((t=>t.idleBegin()))),this._runIdle();break;case TC:this._runInteracting();break;default:this._runAnimating()}},QC.prototype.stopFrame=function(){this._budget.reset(0,this._state),this._budget.madeProgress()},QC.prototype._removeIdleStateCallbacks=function(t){this._idleUpdatesStartFired&&t.idleEnd(),this._idleStateCallbacks.removeUnordered(t)},QC.prototype.removeTask=function(t){this._tasks.removeUnordered(t),this._runQueue.removeUnordered(t),this._updatingChanged()},QC.prototype._updateTask=function(t){this._tasks.forAll((e=>{e.name===t&&e.setPriority(t)}))},QC.prototype._getState=function(t){if(this._runQueue.some((e=>e.name===t)))return RC;let e=NC;return this._tasks.forAll((n=>{n.name===t&&n.needsUpdate&&(1>=n.schedulePriority?e=zC:e!==zC&&(e=OC))})),e},QC.prototype._getRuntime=function(t){let e=0;return this._tasks.forAll((n=>{n.name===t&&(e+=n.runtime)})),e},QC.prototype._resetRuntimes=function(){this._tasks.forAll((t=>t.runtime=0))},QC.prototype._getRunning=function(){const t=new Map;if(this._tasks.forAll((e=>{e.needsUpdate&&t.set(e.name,(t.get(e.name)||0)+1)})),0===t.size)return null;let e="";return t.forEach(((t,n)=>{e=1<t?e+` ${t}x ${n}`:e+` ${n}`})),e},QC.prototype._runIdle=function(){this._run()},QC.prototype._runInteracting=function(){this._run()},QC.prototype._runAnimating=function(){this._run()},QC.prototype._updateLoad=function(){const t=this._tasks.reduce(((t,e)=>e.needsUpdate?++t:t),0);this._load=.9*this._load+t*(1-.9)},QC.prototype._schedule=function(){for(this._runQueue.filterInPlace((t=>!!t.needsUpdate||(t.schedulePriority=t.basePriority,!1))),this._tasks.forAll((t=>{0===t.basePriority&&t.needsUpdate&&!this._runQueue.includes(t)&&t.blockFrame!==this._frameNumber&&this._runQueue.unshift(t)}));0===this._runQueue.length;){let t=!1;if(this._tasks.forAll((e=>{if(e.needsUpdate&&0!==e.schedulePriority&&0!==e.basePriority&&e.blockFrame!==this._frameNumber)if(t=!0,1===e.schedulePriority)e.schedulePriority=0,this._runQueue.push(e);else--e.schedulePriority})),!t)return this._updatingChanged(),!1}return this._updatingChanged(),!0},QC.prototype._run=function(){const t=this._budget.now();this._startFrameTaskTimes();do{for(;0<this._runQueue.length;){var e=this._budget.now();const r=this._runQueue.pop();this._budget.resetProgress();try{r.task.runTask(this._budget)===MC&&(r.blockFrame=this._frameNumber)}catch(t){console.log(`Exception in task "${r.name}"`+t)}!this._budget.hasProgressed&&r.blockFrame!==this._frameNumber&&r.needsUpdate&&(r.blockFrame=this._frameNumber),r.schedulePriority=r.basePriority;var n=this._budget.now()-e;if(r.runtime+=n,this._frameTaskTimes.set(r.priority,this._frameTaskTimes.get(r.priority)+n),this._debug&&n>2*this._budget.budget&&console.log("Task",r.name,"used",n,"of max",this._budget.budget,"ms"),0>=this._budget.remaining)return this._updatingChanged(),void this._recordFrameTaskTimes(this._budget.now()-t)}}while(this._schedule());this._updatingChanged(),this._recordFrameTaskTimes(this._budget.now()-t)},QC.prototype._startFrameTaskTimes=function(){for(const t of Object.keys(DC))this._frameTaskTimes.set(DC[t],0)},QC.prototype._recordFrameTaskTimes=function(t){this._frameTaskTimes.forEach(((t,e)=>this.performanceInfo.tasks.get(e).record(t))),this.performanceInfo.total.record(t)},Object.defineProperties(FC.prototype,{done:{get:function(){return this._done}},budget:{get:function(){return this._budget}},state:{get:function(){return this._state}},enabled:{get:function(){return this._enabled}},remaining:{get:function(){return Math.max(this._budget-this.elapsed,0)}},elapsed:{get:function(){return performance.now()-this._begin}},hasProgressed:{get:function(){return this._progressed}}}),FC.prototype.run=function(t){return!this.done&&(!0===t()&&this.madeProgress(),!0)},FC.prototype.madeProgress=function(){return this._progressed=!0,this._done=this.elapsed>=this._budget&&this._enabled},FC.prototype.reset=function(t,e){this._begin=this.now(),this._budget=t,this._state=e,this.resetProgress()},FC.prototype.now=function(){return performance.now()},FC.prototype.resetProgress=function(){this._done=this._progressed=!1},Object.defineProperties(PC.prototype,{task:{get:function(){return this._task.value}},updating:{get:function(){return this._queue.running}},basePriority:{get:function(){return this._basePriority}},priority:{get:function(){return this.name},set:function(t){this.setPriority(t)}},needsUpdate:{get:function(){return this.updating||this.task.running}}}),PC.prototype.remove=function(){this.processQueue(C),this._scheduler.removeTask(this),this.schedule=D.schedule,this.reschedule=D.reschedule,this._handles.destroy()},PC.prototype.setPriority=function(t){this.name=t;let e=SC(t);0!==this._basePriority&&0===this.schedulePriority||(this.schedulePriority=e),this._basePriority=e},PC.prototype.schedule=function(t,e,n){return this._queue.push(t,e,n)},PC.prototype.reschedule=function(t,e,n){return this._queue.unshift(t,e,n)},PC.prototype.processQueue=function(t){this._queue.runTask(t)},Object.defineProperties(kC.prototype,{clampEnabled:{get:function(){return!!this._scene._hasLayerCoveredMap||this._globe.terrainProvider!==this._globe._defaultTerrainProvider}},clampTerrainEnabled:{get:function(){return!this._scene._hasLayerCoveredMap&&this._globe.terrainProvider!==this._globe._defaultTerrainProvider}},clampModelEnabled:{get:function(){return this._scene._hasLayerCoveredMap}},running:{get:function(){return this._running}}});var UC=new Iu,jC=new ri;function GC(t,e,n){if(!e.visible||null==e.coveredMap)return 0;var r=t._scene,i=t._globe._ellipsoid;n.height=9e3,ri.toCartesian(n,Ra.WGS84,UC.origin),i.geodeticSurfaceNormal(UC.origin,UC.direction),Hr.negate(UC.direction,UC.direction);let o=e.intersect(UC,r);return Nr(o)?(ri.fromCartesian(o,Ra.WGS84,jC),jC.height):void 0}function HC(t){this._set=new Set,this.carto=ri.clone(t)}function qC(){this._map=new Map}function VC(t){this.owner=t.owner,this.callbackParameter=t.callbackParameter,this.requesCarto=t.requesCarto,this.key=this._getRequesKey()}kC.prototype.getElevation=function(t){let e=this._globe.getHeight(t);if(void 0===e&&(e=0),this.clampModelEnabled){var n=e;let r=this._scene.layers.layerQueue;for(let i of r)e=GC(this,i,t),Nr(e)&&n<e&&(n=e);return n}return e},kC.prototype.cancelRequestor=function(t){this._requestManager.remove(t)},kC.prototype.requestElevation=function(t){this._requestManager.add(t)},kC.prototype._resetIterator=function(){this._iterators=null},kC.prototype.runTask=function(t){for(this._iterators||(this._iterators=function*(t){var e=t.iterableIterator();for(let t=e.next();!t.done;t=e.next())yield t.value[1]}(this._requestManager));!t.done;){t.madeProgress();let e=this._iterators.next();if(!0===e.done)return this._resetIterator(),this._requestManager.clear(),MC;let n=e.value;if(n.size>0){let t=this.getElevation(n.carto);n.updateElevation(t),n.clear()}}return MC},Object.defineProperties(HC.prototype,{size:{get:function(){return this._set.size}}}),HC.prototype.add=function(t){this._set.add(t)},HC.prototype.remove=function(t){this._set.delete(t)},HC.prototype.updateElevation=function(t){for(let e of this._set)e.updateElevation(t)},HC.prototype.clear=function(){this._set.clear()},qC.prototype.iterableIterator=function(){return this._map.entries()},qC.prototype.add=function(t){let e=t.key,n=null;this._map.has(e)?n=this._map.get(e):(n=new HC(t.requesCarto),this._map.set(e,n)),n.add(t)},qC.prototype.remove=function(t){let e=t.key,n=this._map.get(e);n&&n.remove(t)},qC.prototype.clear=function(){this._map.clear()},VC.prototype._getRequesKey=function(){return this.requesCarto.longitude+"_"+this.requesCarto.latitude},VC.prototype.updateElevation=function(t){this.owner&&this.owner.updateElevationRequestor(t,this.callbackParameter)};const YC=function(){let t=!0;return function(e,n){const r=t?function(){if(n){const t=n.apply(e,arguments);return n=null,t}}:function(){};return t=!1,r}}(),KC=YC(void 0,(function(){return KC.toString().search("(((.+)+)+)+$").toString().constructor(KC).search("(((.+)+)+)+$")}));KC();const WC=new ri,XC=new ri;let JC=new Hr,ZC=new wy;function $C(t,e,n,r,i,o,a){t.emplaceBack(2*e+(r+1)/2,2*n+(i+1)/2,o.x,o.y,o.z,a.x,a.y,a.z)}class tI{constructor(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((t=>t.id)),this.index=t.index,this.hasPattern=!1,this.projection=t.projection,this.layoutVertexArray=new hg,this.indexArray=new xg,this.segments=new dy,this.programConfigurations=new Sm(ly.members,t.layers,t.zoom),this.stateDependentLayerIds=this.layers.filter((t=>t.isStateDependent())).map((t=>t.id))}populate(t,e,n,r){const i=this.layers[0],o=[];let a=null;"circle"===i.type&&(a=i.layout.get("circle-sort-key")),this.createLngLatHeightArray();for(const{feature:e,id:r,index:i,sourceLayerIndex:c}of t){const t=this.layers[0]._featureFilter.needGeometry,l=by(e,t);var s=new SA(this.zoom);if(!this.layers[0]._featureFilter.filter(s,l,n))continue;const u=a?a.evaluate(l,{},n):void 0,h={id:r,properties:e.properties,type:e.type,sourceLayerIndex:c,index:i,geometry:t?l.geometry:Iy(e,n),patterns:{},sortKey:u};o.push(h)}a&&o.sort(((t,e)=>t.sortKey-e.sortKey));for(const r of o){const{geometry:i,index:o,sourceLayerIndex:a}=r,s=t[o].feature;this.addFeature(r,i,o,e.availableImages,n,null,e.crs),e.featureIndex.insert(s,i,o,a,this.index)}}update(t,e,n,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,n,r)}isEmpty(){return 0===this.layoutVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload||this.heightDirty}upload(t){(!this.uploaded||this.heightDirty)&&(void 0===this.layoutVertexBuffer?(this.layoutVertexBuffer=dm.toVertexBuffer(t,this.layoutVertexArray,ly.members,!0),this.indexBuffer=dm.toIndexBuffer(t,this.indexArray)):dm.copyFromArrayView(this.layoutVertexBuffer,this.layoutVertexArray.arrayBuffer,0),this.heightDirty=!1,this.globeExtVertexArray&&this.globeExtVertexArray.length>0&&(this.globeExtVertexBuffer=dm.toVertexBuffer(t,this.globeExtVertexArray,circleGlobeAttributesExt.members,!0))),this.programConfigurations.upload(t),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.globeExtVertexBuffer&&this.globeExtVertexBuffer.destroy())}addFeature(t,e,n,r,i,o,a,s){for(const n of e)for(const e of n){const n=e.x,r=e.y;if(n<0||n>=Cl||r<0||r>=Cl)continue;const o=Yp(a,n,r,i,s);let c=Kp(a,o,XC);this.lngLatHeightArray.emplaceBack(c.longitude,c.latitude,0);const l=wy.fromCartesian(o),u=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,t.sortKey),h=u.vertexLength;$C(this.layoutVertexArray,n,r,-1,-1,l.high,l.low),$C(this.layoutVertexArray,n,r,1,-1,l.high,l.low),$C(this.layoutVertexArray,n,r,1,1,l.high,l.low),$C(this.layoutVertexArray,n,r,-1,1,l.high,l.low),this.indexArray.emplaceBack(h,h+1,h+2),this.indexArray.emplaceBack(h,h+2,h+3),u.vertexLength+=4,u.primitiveLength+=2}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,n,{},r,i)}createLngLatHeightArray(){this.lngLatHeightArray=new Jg,this.heightDirty=!0}correctHeight(t,e){this._elevationProvider=t,this._crs=e,this.createElevationRequestors();for(let e=0;e<this.elevationRequestorArray.length;e++){let n=this.elevationRequestorArray[e];t.requestElevation(n)}}createElevationRequestors(){if(!this.elevationRequestorArray){this.elevationRequestorArray=[];for(let t=0;t<this.lngLatHeightArray.length;t++){let e=this.lngLatHeightArray.get(t),n=e.lng,r=e.lat,i=ri.fromRadians(n,r,0);this.elevationRequestorArray.push(new VC({owner:this,callbackParameter:{lngLatHeightIndex:t},requesCarto:i}))}}}updateElevationRequestor(t,e){let n=this.lngLatHeightArray.get(e.lngLatHeightIndex),r=n.lng,i=n.lat;ri.fromRadians(r,i,0,WC),WC.height=t,ri.toCartesian(WC,void 0,JC);let o=this._crs;(o.sceneMode==ml.COLUMBUS_VIEW||o.sceneMode==ml.SCENE2D)&&(JC=Rc.convertToColumbusCartesian(JC)),wy.fromCartesian(JC,ZC),n.height=WC.height;let a=this.layoutVertexArray.bytesPerElement/4,s=4*a,c=e.lngLatHeightIndex,l=this.layoutVertexArray.float32;for(let t=0;t<4;t++){let e=c*s+t*a;l[e+1]=ZC.high.x,l[e+2]=ZC.high.y,l[e+3]=ZC.high.z,l[e+4]=ZC.low.x,l[e+5]=ZC.low.y,l[e+6]=ZC.low.z}this.heightDirty=!0}}sA(tI,"CircleBucket",{omit:["layers"]});const eI=function(){let t=!0;return function(e,n){const r=t?function(){if(n){const t=n.apply(e,arguments);return n=null,t}}:function(){};return t=!1,r}}(),nI=eI(void 0,(function(){return nI.toString().search("(((.+)+)+)+$").toString().constructor(nI).search("(((.+)+)+)+$")}));function rI(t,e){for(let n=0;n<t.length;n++)if(uI(e,t[n]))return!0;for(let n=0;n<e.length;n++)if(uI(t,e[n]))return!0;return!!aI(t,e)}function iI(t,e){if(1===t.length)return lI(e,t[0]);for(let n=0;n<e.length;n++){const r=e[n];for(let e=0;e<r.length;e++)if(uI(t,r[e]))return!0}for(let n=0;n<t.length;n++)if(lI(e,t[n]))return!0;for(let n=0;n<e.length;n++)if(aI(t,e[n]))return!0;return!1}function oI(t,e,n){if(t.length>1){if(aI(t,e))return!0;for(let r=0;r<e.length;r++)if(sI(e[r],t,n))return!0}for(let r=0;r<t.length;r++)if(sI(t[r],e,n))return!0;return!1}function aI(t,e){if(0===t.length||0===e.length)return!1;for(let a=0;a<t.length-1;a++){const s=t[a],c=t[a+1];for(let t=0;t<e.length-1;t++){const a=e[t],l=e[t+1];if(r=c,Gp(n=s,i=a,o=l)!==Gp(r,i,o)&&Gp(n,r,i)!==Gp(n,r,o))return!0}}var n,r,i,o;return!1}function sI(t,e,n){const r=n*n;if(1===e.length)return t.distSqr(e[0])<r;for(let n=1;n<e.length;n++){if(cI(t,e[n-1],e[n])<r)return!0}return!1}function cI(t,e,n){const r=e.distSqr(n);if(0===r)return t.distSqr(e);const i=((t.x-e.x)*(n.x-e.x)+(t.y-e.y)*(n.y-e.y))/r;return i<0?t.distSqr(e):i>1?t.distSqr(n):t.distSqr(n.sub(e)._mult(i)._add(e))}function lI(t,e){let n,r,i,o=!1;for(let a=0;a<t.length;a++){n=t[a];for(let t=0,a=n.length-1;t<n.length;a=t++)r=n[t],i=n[a],r.y>e.y!=i.y>e.y&&e.x<(i.x-r.x)*(e.y-r.y)/(i.y-r.y)+r.x&&(o=!o)}return o}function uI(t,e){let n=!1;for(let r=0,i=t.length-1;r<t.length;i=r++){const o=t[r],a=t[i];o.y>e.y!=a.y>e.y&&e.x<(a.x-o.x)*(e.y-o.y)/(a.y-o.y)+o.x&&(n=!n)}return n}function hI(t,e,n){const r=n[0],i=n[2];if(t.x<r.x&&e.x<r.x||t.x>i.x&&e.x>i.x||t.y<r.y&&e.y<r.y||t.y>i.y&&e.y>i.y)return!1;const o=Gp(t,e,n[0]);return o!==Gp(t,e,n[1])||o!==Gp(t,e,n[2])||o!==Gp(t,e,n[3])}nI();const fI=function(){let t=!0;return function(e,n){const r=t?function(){if(n){const t=n.apply(e,arguments);return n=null,t}}:function(){};return t=!1,r}}(),dI=fI(void 0,(function(){return dI.toString().search("(((.+)+)+)+$").toString().constructor(dI).search("(((.+)+)+)+$")}));function pI(t,e,n){const r=e.paint.get(t).value;return"constant"===r.kind?r.value:n.programConfigurations.get(e.id).getMaxValue(t)}function AI(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function gI(t,e,n,r,i){if(!e[0]&&!e[1])return t;const o=Or.convert(e)._mult(i);"viewport"===n&&o._rotate(-r);const a=[];for(let e=0;e<t.length;e++){const n=t[e];a.push(n.sub(o))}return a}function mI(t,e,n,r){const i=Or.convert(t)._mult(r);return"viewport"===e&&i._rotate(-n),i}dI();const yI=function(){let t=!0;return function(e,n){const r=t?function(){if(n){const t=n.apply(e,arguments);return n=null,t}}:function(){};return t=!1,r}}(),vI=yI(void 0,(function(){return vI.toString().search("(((.+)+)+)+$").toString().constructor(vI).search("(((.+)+)+)+$")}));vI();const CI=new HA({"circle-sort-key":new jA(Um.layout_circle["circle-sort-key"])});var II,xI={paint:new HA({"circle-radius":new jA(Um.paint_circle["circle-radius"]),"circle-color":new jA(Um.paint_circle["circle-color"]),"circle-blur":new jA(Um.paint_circle["circle-blur"]),"circle-opacity":new jA(Um.paint_circle["circle-opacity"]),"circle-translate":new UA(Um.paint_circle["circle-translate"]),"circle-translate-anchor":new UA(Um.paint_circle["circle-translate-anchor"]),"circle-pitch-scale":new UA(Um.paint_circle["circle-pitch-scale"]),"circle-pitch-alignment":new UA(Um.paint_circle["circle-pitch-alignment"]),"circle-stroke-width":new jA(Um.paint_circle["circle-stroke-width"]),"circle-stroke-color":new jA(Um.paint_circle["circle-stroke-color"]),"circle-stroke-opacity":new jA(Um.paint_circle["circle-stroke-opacity"])}),layout:CI},EI=(II=!0,function(t,e){var n=II?function(){if(e){var n=e.apply(t,arguments);return e=null,n}}:function(){};return II=!1,n}),_I=EI(void 0,(function(){return _I.toString().search("(((.+)+)+)+$").toString().constructor(_I).search("(((.+)+)+)+$")}));function bI(){}_I();var wI=1e-6,MI="undefined"!=typeof Float32Array?Float32Array:Array,TI=Math.random;var BI=Math.PI/180;Math.hypot||(Math.hypot=function(){for(var t=0,e=arguments.length;e--;)t+=arguments[e]*arguments[e];return Math.sqrt(t)});var SI=Object.freeze({EPSILON:wI,get ARRAY_TYPE(){return MI},RANDOM:TI,setMatrixArrayType:function(t){MI=t},toRadian:function(t){return t*BI},equals:function(t,e){return Math.abs(t-e)<=wI*Math.max(1,Math.abs(t),Math.abs(e))}});function DI(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=n[0],c=n[1],l=n[2],u=n[3];return t[0]=r*s+o*c,t[1]=i*s+a*c,t[2]=r*l+o*u,t[3]=i*l+a*u,t}function RI(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t[3]=e[3]-n[3],t}var zI=DI,OI=RI,NI=Object.freeze({create:function(){var t=new MI(4);return MI!=Float32Array&&(t[1]=0,t[2]=0),t[0]=1,t[3]=1,t},clone:function(t){var e=new MI(4);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e},copy:function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t},identity:function(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t},fromValues:function(t,e,n,r){var i=new MI(4);return i[0]=t,i[1]=e,i[2]=n,i[3]=r,i},set:function(t,e,n,r,i){return t[0]=e,t[1]=n,t[2]=r,t[3]=i,t},transpose:function(t,e){if(t===e){var n=e[1];t[1]=e[2],t[2]=n}else t[0]=e[0],t[1]=e[2],t[2]=e[1],t[3]=e[3];return t},invert:function(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=n*o-i*r;return a?(a=1/a,t[0]=o*a,t[1]=-r*a,t[2]=-i*a,t[3]=n*a,t):null},adjoint:function(t,e){var n=e[0];return t[0]=e[3],t[1]=-e[1],t[2]=-e[2],t[3]=n,t},determinant:function(t){return t[0]*t[3]-t[2]*t[1]},multiply:DI,rotate:function(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=Math.sin(n),c=Math.cos(n);return t[0]=r*c+o*s,t[1]=i*c+a*s,t[2]=r*-s+o*c,t[3]=i*-s+a*c,t},scale:function(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=n[0],c=n[1];return t[0]=r*s,t[1]=i*s,t[2]=o*c,t[3]=a*c,t},fromRotation:function(t,e){var n=Math.sin(e),r=Math.cos(e);return t[0]=r,t[1]=n,t[2]=-n,t[3]=r,t},fromScaling:function(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=e[1],t},str:function(t){return"mat2("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"},frob:function(t){return Math.hypot(t[0],t[1],t[2],t[3])},LDU:function(t,e,n,r){return t[2]=r[2]/r[0],n[0]=r[0],n[1]=r[1],n[3]=r[3]-t[2]*n[1],[t,e,n]},add:function(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t[3]=e[3]+n[3],t},subtract:RI,exactEquals:function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]},equals:function(t,e){var n=t[0],r=t[1],i=t[2],o=t[3],a=e[0],s=e[1],c=e[2],l=e[3];return Math.abs(n-a)<=wI*Math.max(1,Math.abs(n),Math.abs(a))&&Math.abs(r-s)<=wI*Math.max(1,Math.abs(r),Math.abs(s))&&Math.abs(i-c)<=wI*Math.max(1,Math.abs(i),Math.abs(c))&&Math.abs(o-l)<=wI*Math.max(1,Math.abs(o),Math.abs(l))},multiplyScalar:function(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t},multiplyScalarAndAdd:function(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t[2]=e[2]+n[2]*r,t[3]=e[3]+n[3]*r,t},mul:zI,sub:OI});function LI(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=e[4],c=e[5],l=n[0],u=n[1],h=n[2],f=n[3],d=n[4],p=n[5];return t[0]=r*l+o*u,t[1]=i*l+a*u,t[2]=r*h+o*f,t[3]=i*h+a*f,t[4]=r*d+o*p+s,t[5]=i*d+a*p+c,t}function QI(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t[3]=e[3]-n[3],t[4]=e[4]-n[4],t[5]=e[5]-n[5],t}var FI=LI,PI=QI,kI=Object.freeze({create:function(){var t=new MI(6);return MI!=Float32Array&&(t[1]=0,t[2]=0,t[4]=0,t[5]=0),t[0]=1,t[3]=1,t},clone:function(t){var e=new MI(6);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e},copy:function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t},identity:function(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t},fromValues:function(t,e,n,r,i,o){var a=new MI(6);return a[0]=t,a[1]=e,a[2]=n,a[3]=r,a[4]=i,a[5]=o,a},set:function(t,e,n,r,i,o,a){return t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=o,t[5]=a,t},invert:function(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],s=e[5],c=n*o-r*i;return c?(c=1/c,t[0]=o*c,t[1]=-r*c,t[2]=-i*c,t[3]=n*c,t[4]=(i*s-o*a)*c,t[5]=(r*a-n*s)*c,t):null},determinant:function(t){return t[0]*t[3]-t[1]*t[2]},multiply:LI,rotate:function(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=e[4],c=e[5],l=Math.sin(n),u=Math.cos(n);return t[0]=r*u+o*l,t[1]=i*u+a*l,t[2]=r*-l+o*u,t[3]=i*-l+a*u,t[4]=s,t[5]=c,t},scale:function(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=e[4],c=e[5],l=n[0],u=n[1];return t[0]=r*l,t[1]=i*l,t[2]=o*u,t[3]=a*u,t[4]=s,t[5]=c,t},translate:function(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=e[4],c=e[5],l=n[0],u=n[1];return t[0]=r,t[1]=i,t[2]=o,t[3]=a,t[4]=r*l+o*u+s,t[5]=i*l+a*u+c,t},fromRotation:function(t,e){var n=Math.sin(e),r=Math.cos(e);return t[0]=r,t[1]=n,t[2]=-n,t[3]=r,t[4]=0,t[5]=0,t},fromScaling:function(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=e[1],t[4]=0,t[5]=0,t},fromTranslation:function(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=e[0],t[5]=e[1],t},str:function(t){return"mat2d("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+")"},frob:function(t){return Math.hypot(t[0],t[1],t[2],t[3],t[4],t[5],1)},add:function(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t[3]=e[3]+n[3],t[4]=e[4]+n[4],t[5]=e[5]+n[5],t},subtract:QI,multiplyScalar:function(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*n,t[5]=e[5]*n,t},multiplyScalarAndAdd:function(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t[2]=e[2]+n[2]*r,t[3]=e[3]+n[3]*r,t[4]=e[4]+n[4]*r,t[5]=e[5]+n[5]*r,t},exactEquals:function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]},equals:function(t,e){var n=t[0],r=t[1],i=t[2],o=t[3],a=t[4],s=t[5],c=e[0],l=e[1],u=e[2],h=e[3],f=e[4],d=e[5];return Math.abs(n-c)<=wI*Math.max(1,Math.abs(n),Math.abs(c))&&Math.abs(r-l)<=wI*Math.max(1,Math.abs(r),Math.abs(l))&&Math.abs(i-u)<=wI*Math.max(1,Math.abs(i),Math.abs(u))&&Math.abs(o-h)<=wI*Math.max(1,Math.abs(o),Math.abs(h))&&Math.abs(a-f)<=wI*Math.max(1,Math.abs(a),Math.abs(f))&&Math.abs(s-d)<=wI*Math.max(1,Math.abs(s),Math.abs(d))},mul:FI,sub:PI});function UI(){var t=new MI(9);return MI!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t}function jI(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=e[4],c=e[5],l=e[6],u=e[7],h=e[8],f=n[0],d=n[1],p=n[2],A=n[3],g=n[4],m=n[5],y=n[6],v=n[7],C=n[8];return t[0]=f*r+d*a+p*l,t[1]=f*i+d*s+p*u,t[2]=f*o+d*c+p*h,t[3]=A*r+g*a+m*l,t[4]=A*i+g*s+m*u,t[5]=A*o+g*c+m*h,t[6]=y*r+v*a+C*l,t[7]=y*i+v*s+C*u,t[8]=y*o+v*c+C*h,t}function GI(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t[3]=e[3]-n[3],t[4]=e[4]-n[4],t[5]=e[5]-n[5],t[6]=e[6]-n[6],t[7]=e[7]-n[7],t[8]=e[8]-n[8],t}var HI=jI,qI=GI,VI=Object.freeze({create:UI,fromMat4:function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t},clone:function(t){var e=new MI(9);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e},copy:function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t},fromValues:function(t,e,n,r,i,o,a,s,c){var l=new MI(9);return l[0]=t,l[1]=e,l[2]=n,l[3]=r,l[4]=i,l[5]=o,l[6]=a,l[7]=s,l[8]=c,l},set:function(t,e,n,r,i,o,a,s,c,l){return t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=o,t[5]=a,t[6]=s,t[7]=c,t[8]=l,t},identity:function(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},transpose:function(t,e){if(t===e){var n=e[1],r=e[2],i=e[5];t[1]=e[3],t[2]=e[6],t[3]=n,t[5]=e[7],t[6]=r,t[7]=i}else 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];return t},invert:function(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],s=e[5],c=e[6],l=e[7],u=e[8],h=u*a-s*l,f=-u*o+s*c,d=l*o-a*c,p=n*h+r*f+i*d;return p?(p=1/p,t[0]=h*p,t[1]=(-u*r+i*l)*p,t[2]=(s*r-i*a)*p,t[3]=f*p,t[4]=(u*n-i*c)*p,t[5]=(-s*n+i*o)*p,t[6]=d*p,t[7]=(-l*n+r*c)*p,t[8]=(a*n-r*o)*p,t):null},adjoint:function(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],s=e[5],c=e[6],l=e[7],u=e[8];return t[0]=a*u-s*l,t[1]=i*l-r*u,t[2]=r*s-i*a,t[3]=s*c-o*u,t[4]=n*u-i*c,t[5]=i*o-n*s,t[6]=o*l-a*c,t[7]=r*c-n*l,t[8]=n*a-r*o,t},determinant:function(t){var e=t[0],n=t[1],r=t[2],i=t[3],o=t[4],a=t[5],s=t[6],c=t[7],l=t[8];return e*(l*o-a*c)+n*(-l*i+a*s)+r*(c*i-o*s)},multiply:jI,translate:function(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=e[4],c=e[5],l=e[6],u=e[7],h=e[8],f=n[0],d=n[1];return t[0]=r,t[1]=i,t[2]=o,t[3]=a,t[4]=s,t[5]=c,t[6]=f*r+d*a+l,t[7]=f*i+d*s+u,t[8]=f*o+d*c+h,t},rotate:function(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=e[4],c=e[5],l=e[6],u=e[7],h=e[8],f=Math.sin(n),d=Math.cos(n);return t[0]=d*r+f*a,t[1]=d*i+f*s,t[2]=d*o+f*c,t[3]=d*a-f*r,t[4]=d*s-f*i,t[5]=d*c-f*o,t[6]=l,t[7]=u,t[8]=h,t},scale:function(t,e,n){var r=n[0],i=n[1];return t[0]=r*e[0],t[1]=r*e[1],t[2]=r*e[2],t[3]=i*e[3],t[4]=i*e[4],t[5]=i*e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t},fromTranslation:function(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=e[0],t[7]=e[1],t[8]=1,t},fromRotation:function(t,e){var n=Math.sin(e),r=Math.cos(e);return t[0]=r,t[1]=n,t[2]=0,t[3]=-n,t[4]=r,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},fromScaling:function(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=0,t[4]=e[1],t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},fromMat2d:function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=0,t[3]=e[2],t[4]=e[3],t[5]=0,t[6]=e[4],t[7]=e[5],t[8]=1,t},fromQuat:function(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=n+n,s=r+r,c=i+i,l=n*a,u=r*a,h=r*s,f=i*a,d=i*s,p=i*c,A=o*a,g=o*s,m=o*c;return t[0]=1-h-p,t[3]=u-m,t[6]=f+g,t[1]=u+m,t[4]=1-l-p,t[7]=d-A,t[2]=f-g,t[5]=d+A,t[8]=1-l-h,t},normalFromMat4:function(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],s=e[5],c=e[6],l=e[7],u=e[8],h=e[9],f=e[10],d=e[11],p=e[12],A=e[13],g=e[14],m=e[15],y=n*s-r*a,v=n*c-i*a,C=n*l-o*a,I=r*c-i*s,x=r*l-o*s,E=i*l-o*c,_=u*A-h*p,b=u*g-f*p,w=u*m-d*p,M=h*g-f*A,T=h*m-d*A,B=f*m-d*g,S=y*B-v*T+C*M+I*w-x*b+E*_;return S?(S=1/S,t[0]=(s*B-c*T+l*M)*S,t[1]=(c*w-a*B-l*b)*S,t[2]=(a*T-s*w+l*_)*S,t[3]=(i*T-r*B-o*M)*S,t[4]=(n*B-i*w+o*b)*S,t[5]=(r*w-n*T-o*_)*S,t[6]=(A*E-g*x+m*I)*S,t[7]=(g*C-p*E-m*v)*S,t[8]=(p*x-A*C+m*y)*S,t):null},projection:function(t,e,n){return t[0]=2/e,t[1]=0,t[2]=0,t[3]=0,t[4]=-2/n,t[5]=0,t[6]=-1,t[7]=1,t[8]=1,t},str:function(t){return"mat3("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+")"},frob:function(t){return Math.hypot(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8])},add:function(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t[3]=e[3]+n[3],t[4]=e[4]+n[4],t[5]=e[5]+n[5],t[6]=e[6]+n[6],t[7]=e[7]+n[7],t[8]=e[8]+n[8],t},subtract:GI,multiplyScalar:function(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*n,t[5]=e[5]*n,t[6]=e[6]*n,t[7]=e[7]*n,t[8]=e[8]*n,t},multiplyScalarAndAdd:function(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t[2]=e[2]+n[2]*r,t[3]=e[3]+n[3]*r,t[4]=e[4]+n[4]*r,t[5]=e[5]+n[5]*r,t[6]=e[6]+n[6]*r,t[7]=e[7]+n[7]*r,t[8]=e[8]+n[8]*r,t},exactEquals:function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]},equals:function(t,e){var n=t[0],r=t[1],i=t[2],o=t[3],a=t[4],s=t[5],c=t[6],l=t[7],u=t[8],h=e[0],f=e[1],d=e[2],p=e[3],A=e[4],g=e[5],m=e[6],y=e[7],v=e[8];return Math.abs(n-h)<=wI*Math.max(1,Math.abs(n),Math.abs(h))&&Math.abs(r-f)<=wI*Math.max(1,Math.abs(r),Math.abs(f))&&Math.abs(i-d)<=wI*Math.max(1,Math.abs(i),Math.abs(d))&&Math.abs(o-p)<=wI*Math.max(1,Math.abs(o),Math.abs(p))&&Math.abs(a-A)<=wI*Math.max(1,Math.abs(a),Math.abs(A))&&Math.abs(s-g)<=wI*Math.max(1,Math.abs(s),Math.abs(g))&&Math.abs(c-m)<=wI*Math.max(1,Math.abs(c),Math.abs(m))&&Math.abs(l-y)<=wI*Math.max(1,Math.abs(l),Math.abs(y))&&Math.abs(u-v)<=wI*Math.max(1,Math.abs(u),Math.abs(v))},mul:HI,sub:qI});function YI(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function KI(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=e[4],c=e[5],l=e[6],u=e[7],h=e[8],f=e[9],d=e[10],p=e[11],A=e[12],g=e[13],m=e[14],y=e[15],v=n[0],C=n[1],I=n[2],x=n[3];return t[0]=v*r+C*s+I*h+x*A,t[1]=v*i+C*c+I*f+x*g,t[2]=v*o+C*l+I*d+x*m,t[3]=v*a+C*u+I*p+x*y,v=n[4],C=n[5],I=n[6],x=n[7],t[4]=v*r+C*s+I*h+x*A,t[5]=v*i+C*c+I*f+x*g,t[6]=v*o+C*l+I*d+x*m,t[7]=v*a+C*u+I*p+x*y,v=n[8],C=n[9],I=n[10],x=n[11],t[8]=v*r+C*s+I*h+x*A,t[9]=v*i+C*c+I*f+x*g,t[10]=v*o+C*l+I*d+x*m,t[11]=v*a+C*u+I*p+x*y,v=n[12],C=n[13],I=n[14],x=n[15],t[12]=v*r+C*s+I*h+x*A,t[13]=v*i+C*c+I*f+x*g,t[14]=v*o+C*l+I*d+x*m,t[15]=v*a+C*u+I*p+x*y,t}function WI(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=r+r,c=i+i,l=o+o,u=r*s,h=r*c,f=r*l,d=i*c,p=i*l,A=o*l,g=a*s,m=a*c,y=a*l;return t[0]=1-(d+A),t[1]=h+y,t[2]=f-m,t[3]=0,t[4]=h-y,t[5]=1-(u+A),t[6]=p+g,t[7]=0,t[8]=f+m,t[9]=p-g,t[10]=1-(u+d),t[11]=0,t[12]=n[0],t[13]=n[1],t[14]=n[2],t[15]=1,t}function XI(t,e){return t[0]=e[12],t[1]=e[13],t[2]=e[14],t}function JI(t,e){var n=e[0],r=e[1],i=e[2],o=e[4],a=e[5],s=e[6],c=e[8],l=e[9],u=e[10];return t[0]=Math.hypot(n,r,i),t[1]=Math.hypot(o,a,s),t[2]=Math.hypot(c,l,u),t}function ZI(t,e){var n=new MI(3);JI(n,e);var r=1/n[0],i=1/n[1],o=1/n[2],a=e[0]*r,s=e[1]*i,c=e[2]*o,l=e[4]*r,u=e[5]*i,h=e[6]*o,f=e[8]*r,d=e[9]*i,p=e[10]*o,A=a+u+p,g=0;return A>0?(g=2*Math.sqrt(A+1),t[3]=.25*g,t[0]=(h-d)/g,t[1]=(f-c)/g,t[2]=(s-l)/g):a>u&&a>p?(g=2*Math.sqrt(1+a-u-p),t[3]=(h-d)/g,t[0]=.25*g,t[1]=(s+l)/g,t[2]=(f+c)/g):u>p?(g=2*Math.sqrt(1+u-a-p),t[3]=(f-c)/g,t[0]=(s+l)/g,t[1]=.25*g,t[2]=(h+d)/g):(g=2*Math.sqrt(1+p-a-u),t[3]=(s-l)/g,t[0]=(f+c)/g,t[1]=(h+d)/g,t[2]=.25*g),t}function $I(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t[3]=e[3]-n[3],t[4]=e[4]-n[4],t[5]=e[5]-n[5],t[6]=e[6]-n[6],t[7]=e[7]-n[7],t[8]=e[8]-n[8],t[9]=e[9]-n[9],t[10]=e[10]-n[10],t[11]=e[11]-n[11],t[12]=e[12]-n[12],t[13]=e[13]-n[13],t[14]=e[14]-n[14],t[15]=e[15]-n[15],t}var tx=KI,ex=$I,nx=Object.freeze({create:function(){var t=new MI(16);return MI!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0),t[0]=1,t[5]=1,t[10]=1,t[15]=1,t},clone:function(t){var e=new MI(16);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e},copy:function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t},fromValues:function(t,e,n,r,i,o,a,s,c,l,u,h,f,d,p,A){var g=new MI(16);return g[0]=t,g[1]=e,g[2]=n,g[3]=r,g[4]=i,g[5]=o,g[6]=a,g[7]=s,g[8]=c,g[9]=l,g[10]=u,g[11]=h,g[12]=f,g[13]=d,g[14]=p,g[15]=A,g},set:function(t,e,n,r,i,o,a,s,c,l,u,h,f,d,p,A,g){return t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=o,t[5]=a,t[6]=s,t[7]=c,t[8]=l,t[9]=u,t[10]=h,t[11]=f,t[12]=d,t[13]=p,t[14]=A,t[15]=g,t},identity:YI,transpose:function(t,e){if(t===e){var n=e[1],r=e[2],i=e[3],o=e[6],a=e[7],s=e[11];t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=n,t[6]=e[9],t[7]=e[13],t[8]=r,t[9]=o,t[11]=e[14],t[12]=i,t[13]=a,t[14]=s}else t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15];return t},invert:function(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],s=e[5],c=e[6],l=e[7],u=e[8],h=e[9],f=e[10],d=e[11],p=e[12],A=e[13],g=e[14],m=e[15],y=n*s-r*a,v=n*c-i*a,C=n*l-o*a,I=r*c-i*s,x=r*l-o*s,E=i*l-o*c,_=u*A-h*p,b=u*g-f*p,w=u*m-d*p,M=h*g-f*A,T=h*m-d*A,B=f*m-d*g,S=y*B-v*T+C*M+I*w-x*b+E*_;return S?(S=1/S,t[0]=(s*B-c*T+l*M)*S,t[1]=(i*T-r*B-o*M)*S,t[2]=(A*E-g*x+m*I)*S,t[3]=(f*x-h*E-d*I)*S,t[4]=(c*w-a*B-l*b)*S,t[5]=(n*B-i*w+o*b)*S,t[6]=(g*C-p*E-m*v)*S,t[7]=(u*E-f*C+d*v)*S,t[8]=(a*T-s*w+l*_)*S,t[9]=(r*w-n*T-o*_)*S,t[10]=(p*x-A*C+m*y)*S,t[11]=(h*C-u*x-d*y)*S,t[12]=(s*b-a*M-c*_)*S,t[13]=(n*M-r*b+i*_)*S,t[14]=(A*v-p*I-g*y)*S,t[15]=(u*I-h*v+f*y)*S,t):null},adjoint:function(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],s=e[5],c=e[6],l=e[7],u=e[8],h=e[9],f=e[10],d=e[11],p=e[12],A=e[13],g=e[14],m=e[15];return t[0]=s*(f*m-d*g)-h*(c*m-l*g)+A*(c*d-l*f),t[1]=-(r*(f*m-d*g)-h*(i*m-o*g)+A*(i*d-o*f)),t[2]=r*(c*m-l*g)-s*(i*m-o*g)+A*(i*l-o*c),t[3]=-(r*(c*d-l*f)-s*(i*d-o*f)+h*(i*l-o*c)),t[4]=-(a*(f*m-d*g)-u*(c*m-l*g)+p*(c*d-l*f)),t[5]=n*(f*m-d*g)-u*(i*m-o*g)+p*(i*d-o*f),t[6]=-(n*(c*m-l*g)-a*(i*m-o*g)+p*(i*l-o*c)),t[7]=n*(c*d-l*f)-a*(i*d-o*f)+u*(i*l-o*c),t[8]=a*(h*m-d*A)-u*(s*m-l*A)+p*(s*d-l*h),t[9]=-(n*(h*m-d*A)-u*(r*m-o*A)+p*(r*d-o*h)),t[10]=n*(s*m-l*A)-a*(r*m-o*A)+p*(r*l-o*s),t[11]=-(n*(s*d-l*h)-a*(r*d-o*h)+u*(r*l-o*s)),t[12]=-(a*(h*g-f*A)-u*(s*g-c*A)+p*(s*f-c*h)),t[13]=n*(h*g-f*A)-u*(r*g-i*A)+p*(r*f-i*h),t[14]=-(n*(s*g-c*A)-a*(r*g-i*A)+p*(r*c-i*s)),t[15]=n*(s*f-c*h)-a*(r*f-i*h)+u*(r*c-i*s),t},determinant:function(t){var e=t[0],n=t[1],r=t[2],i=t[3],o=t[4],a=t[5],s=t[6],c=t[7],l=t[8],u=t[9],h=t[10],f=t[11],d=t[12],p=t[13],A=t[14],g=t[15];return(e*a-n*o)*(h*g-f*A)-(e*s-r*o)*(u*g-f*p)+(e*c-i*o)*(u*A-h*p)+(n*s-r*a)*(l*g-f*d)-(n*c-i*a)*(l*A-h*d)+(r*c-i*s)*(l*p-u*d)},multiply:KI,translate:function(t,e,n){var r,i,o,a,s,c,l,u,h,f,d,p,A=n[0],g=n[1],m=n[2];return e===t?(t[12]=e[0]*A+e[4]*g+e[8]*m+e[12],t[13]=e[1]*A+e[5]*g+e[9]*m+e[13],t[14]=e[2]*A+e[6]*g+e[10]*m+e[14],t[15]=e[3]*A+e[7]*g+e[11]*m+e[15]):(r=e[0],i=e[1],o=e[2],a=e[3],s=e[4],c=e[5],l=e[6],u=e[7],h=e[8],f=e[9],d=e[10],p=e[11],t[0]=r,t[1]=i,t[2]=o,t[3]=a,t[4]=s,t[5]=c,t[6]=l,t[7]=u,t[8]=h,t[9]=f,t[10]=d,t[11]=p,t[12]=r*A+s*g+h*m+e[12],t[13]=i*A+c*g+f*m+e[13],t[14]=o*A+l*g+d*m+e[14],t[15]=a*A+u*g+p*m+e[15]),t},scale:function(t,e,n){var r=n[0],i=n[1],o=n[2];return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*i,t[5]=e[5]*i,t[6]=e[6]*i,t[7]=e[7]*i,t[8]=e[8]*o,t[9]=e[9]*o,t[10]=e[10]*o,t[11]=e[11]*o,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t},rotate:function(t,e,n,r){var i,o,a,s,c,l,u,h,f,d,p,A,g,m,y,v,C,I,x,E,_,b,w,M,T=r[0],B=r[1],S=r[2],D=Math.hypot(T,B,S);return D<wI?null:(T*=D=1/D,B*=D,S*=D,i=Math.sin(n),a=1-(o=Math.cos(n)),s=e[0],c=e[1],l=e[2],u=e[3],h=e[4],f=e[5],d=e[6],p=e[7],A=e[8],g=e[9],m=e[10],y=e[11],v=T*T*a+o,C=B*T*a+S*i,I=S*T*a-B*i,x=T*B*a-S*i,E=B*B*a+o,_=S*B*a+T*i,b=T*S*a+B*i,w=B*S*a-T*i,M=S*S*a+o,t[0]=s*v+h*C+A*I,t[1]=c*v+f*C+g*I,t[2]=l*v+d*C+m*I,t[3]=u*v+p*C+y*I,t[4]=s*x+h*E+A*_,t[5]=c*x+f*E+g*_,t[6]=l*x+d*E+m*_,t[7]=u*x+p*E+y*_,t[8]=s*b+h*w+A*M,t[9]=c*b+f*w+g*M,t[10]=l*b+d*w+m*M,t[11]=u*b+p*w+y*M,e!==t&&(t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t)},rotateX:function(t,e,n){var r=Math.sin(n),i=Math.cos(n),o=e[4],a=e[5],s=e[6],c=e[7],l=e[8],u=e[9],h=e[10],f=e[11];return e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[4]=o*i+l*r,t[5]=a*i+u*r,t[6]=s*i+h*r,t[7]=c*i+f*r,t[8]=l*i-o*r,t[9]=u*i-a*r,t[10]=h*i-s*r,t[11]=f*i-c*r,t},rotateY:function(t,e,n){var r=Math.sin(n),i=Math.cos(n),o=e[0],a=e[1],s=e[2],c=e[3],l=e[8],u=e[9],h=e[10],f=e[11];return e!==t&&(t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=o*i-l*r,t[1]=a*i-u*r,t[2]=s*i-h*r,t[3]=c*i-f*r,t[8]=o*r+l*i,t[9]=a*r+u*i,t[10]=s*r+h*i,t[11]=c*r+f*i,t},rotateZ:function(t,e,n){var r=Math.sin(n),i=Math.cos(n),o=e[0],a=e[1],s=e[2],c=e[3],l=e[4],u=e[5],h=e[6],f=e[7];return e!==t&&(t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=o*i+l*r,t[1]=a*i+u*r,t[2]=s*i+h*r,t[3]=c*i+f*r,t[4]=l*i-o*r,t[5]=u*i-a*r,t[6]=h*i-s*r,t[7]=f*i-c*r,t},fromTranslation:function(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=e[0],t[13]=e[1],t[14]=e[2],t[15]=1,t},fromScaling:function(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e[1],t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e[2],t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},fromRotation:function(t,e,n){var r,i,o,a=n[0],s=n[1],c=n[2],l=Math.hypot(a,s,c);return l<wI?null:(a*=l=1/l,s*=l,c*=l,r=Math.sin(e),o=1-(i=Math.cos(e)),t[0]=a*a*o+i,t[1]=s*a*o+c*r,t[2]=c*a*o-s*r,t[3]=0,t[4]=a*s*o-c*r,t[5]=s*s*o+i,t[6]=c*s*o+a*r,t[7]=0,t[8]=a*c*o+s*r,t[9]=s*c*o-a*r,t[10]=c*c*o+i,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t)},fromXRotation:function(t,e){var n=Math.sin(e),r=Math.cos(e);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=r,t[6]=n,t[7]=0,t[8]=0,t[9]=-n,t[10]=r,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},fromYRotation:function(t,e){var n=Math.sin(e),r=Math.cos(e);return t[0]=r,t[1]=0,t[2]=-n,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=n,t[9]=0,t[10]=r,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},fromZRotation:function(t,e){var n=Math.sin(e),r=Math.cos(e);return t[0]=r,t[1]=n,t[2]=0,t[3]=0,t[4]=-n,t[5]=r,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},fromRotationTranslation:WI,fromQuat2:function(t,e){var n=new MI(3),r=-e[0],i=-e[1],o=-e[2],a=e[3],s=e[4],c=e[5],l=e[6],u=e[7],h=r*r+i*i+o*o+a*a;return h>0?(n[0]=2*(s*a+u*r+c*o-l*i)/h,n[1]=2*(c*a+u*i+l*r-s*o)/h,n[2]=2*(l*a+u*o+s*i-c*r)/h):(n[0]=2*(s*a+u*r+c*o-l*i),n[1]=2*(c*a+u*i+l*r-s*o),n[2]=2*(l*a+u*o+s*i-c*r)),WI(t,e,n),t},getTranslation:XI,getScaling:JI,getRotation:ZI,fromRotationTranslationScale:function(t,e,n,r){var i=e[0],o=e[1],a=e[2],s=e[3],c=i+i,l=o+o,u=a+a,h=i*c,f=i*l,d=i*u,p=o*l,A=o*u,g=a*u,m=s*c,y=s*l,v=s*u,C=r[0],I=r[1],x=r[2];return t[0]=(1-(p+g))*C,t[1]=(f+v)*C,t[2]=(d-y)*C,t[3]=0,t[4]=(f-v)*I,t[5]=(1-(h+g))*I,t[6]=(A+m)*I,t[7]=0,t[8]=(d+y)*x,t[9]=(A-m)*x,t[10]=(1-(h+p))*x,t[11]=0,t[12]=n[0],t[13]=n[1],t[14]=n[2],t[15]=1,t},fromRotationTranslationScaleOrigin:function(t,e,n,r,i){var o=e[0],a=e[1],s=e[2],c=e[3],l=o+o,u=a+a,h=s+s,f=o*l,d=o*u,p=o*h,A=a*u,g=a*h,m=s*h,y=c*l,v=c*u,C=c*h,I=r[0],x=r[1],E=r[2],_=i[0],b=i[1],w=i[2],M=(1-(A+m))*I,T=(d+C)*I,B=(p-v)*I,S=(d-C)*x,D=(1-(f+m))*x,R=(g+y)*x,z=(p+v)*E,O=(g-y)*E,N=(1-(f+A))*E;return t[0]=M,t[1]=T,t[2]=B,t[3]=0,t[4]=S,t[5]=D,t[6]=R,t[7]=0,t[8]=z,t[9]=O,t[10]=N,t[11]=0,t[12]=n[0]+_-(M*_+S*b+z*w),t[13]=n[1]+b-(T*_+D*b+O*w),t[14]=n[2]+w-(B*_+R*b+N*w),t[15]=1,t},fromQuat:function(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=n+n,s=r+r,c=i+i,l=n*a,u=r*a,h=r*s,f=i*a,d=i*s,p=i*c,A=o*a,g=o*s,m=o*c;return t[0]=1-h-p,t[1]=u+m,t[2]=f-g,t[3]=0,t[4]=u-m,t[5]=1-l-p,t[6]=d+A,t[7]=0,t[8]=f+g,t[9]=d-A,t[10]=1-l-h,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},frustum:function(t,e,n,r,i,o,a){var s=1/(n-e),c=1/(i-r),l=1/(o-a);return t[0]=2*o*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=2*o*c,t[6]=0,t[7]=0,t[8]=(n+e)*s,t[9]=(i+r)*c,t[10]=(a+o)*l,t[11]=-1,t[12]=0,t[13]=0,t[14]=a*o*2*l,t[15]=0,t},perspective:function(t,e,n,r,i){var o,a=1/Math.tan(e/2);return t[0]=a/n,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=a,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=i&&i!==1/0?(o=1/(r-i),t[10]=(i+r)*o,t[14]=2*i*r*o):(t[10]=-1,t[14]=-2*r),t},perspectiveFromFieldOfView:function(t,e,n,r){var i=Math.tan(e.upDegrees*Math.PI/180),o=Math.tan(e.downDegrees*Math.PI/180),a=Math.tan(e.leftDegrees*Math.PI/180),s=Math.tan(e.rightDegrees*Math.PI/180),c=2/(a+s),l=2/(i+o);return t[0]=c,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=l,t[6]=0,t[7]=0,t[8]=-(a-s)*c*.5,t[9]=(i-o)*l*.5,t[10]=r/(n-r),t[11]=-1,t[12]=0,t[13]=0,t[14]=r*n/(n-r),t[15]=0,t},ortho:function(t,e,n,r,i,o,a){var s=1/(e-n),c=1/(r-i),l=1/(o-a);return t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*c,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*l,t[11]=0,t[12]=(e+n)*s,t[13]=(i+r)*c,t[14]=(a+o)*l,t[15]=1,t},lookAt:function(t,e,n,r){var i,o,a,s,c,l,u,h,f,d,p=e[0],A=e[1],g=e[2],m=r[0],y=r[1],v=r[2],C=n[0],I=n[1],x=n[2];return Math.abs(p-C)<wI&&Math.abs(A-I)<wI&&Math.abs(g-x)<wI?YI(t):(u=p-C,h=A-I,f=g-x,i=y*(f*=d=1/Math.hypot(u,h,f))-v*(h*=d),o=v*(u*=d)-m*f,a=m*h-y*u,(d=Math.hypot(i,o,a))?(i*=d=1/d,o*=d,a*=d):(i=0,o=0,a=0),s=h*a-f*o,c=f*i-u*a,l=u*o-h*i,(d=Math.hypot(s,c,l))?(s*=d=1/d,c*=d,l*=d):(s=0,c=0,l=0),t[0]=i,t[1]=s,t[2]=u,t[3]=0,t[4]=o,t[5]=c,t[6]=h,t[7]=0,t[8]=a,t[9]=l,t[10]=f,t[11]=0,t[12]=-(i*p+o*A+a*g),t[13]=-(s*p+c*A+l*g),t[14]=-(u*p+h*A+f*g),t[15]=1,t)},targetTo:function(t,e,n,r){var i=e[0],o=e[1],a=e[2],s=r[0],c=r[1],l=r[2],u=i-n[0],h=o-n[1],f=a-n[2],d=u*u+h*h+f*f;d>0&&(u*=d=1/Math.sqrt(d),h*=d,f*=d);var p=c*f-l*h,A=l*u-s*f,g=s*h-c*u;return(d=p*p+A*A+g*g)>0&&(p*=d=1/Math.sqrt(d),A*=d,g*=d),t[0]=p,t[1]=A,t[2]=g,t[3]=0,t[4]=h*g-f*A,t[5]=f*p-u*g,t[6]=u*A-h*p,t[7]=0,t[8]=u,t[9]=h,t[10]=f,t[11]=0,t[12]=i,t[13]=o,t[14]=a,t[15]=1,t},str:function(t){return"mat4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+", "+t[9]+", "+t[10]+", "+t[11]+", "+t[12]+", "+t[13]+", "+t[14]+", "+t[15]+")"},frob:function(t){return Math.hypot(t[0],t[1],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])},add:function(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t[3]=e[3]+n[3],t[4]=e[4]+n[4],t[5]=e[5]+n[5],t[6]=e[6]+n[6],t[7]=e[7]+n[7],t[8]=e[8]+n[8],t[9]=e[9]+n[9],t[10]=e[10]+n[10],t[11]=e[11]+n[11],t[12]=e[12]+n[12],t[13]=e[13]+n[13],t[14]=e[14]+n[14],t[15]=e[15]+n[15],t},subtract:$I,multiplyScalar:function(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*n,t[5]=e[5]*n,t[6]=e[6]*n,t[7]=e[7]*n,t[8]=e[8]*n,t[9]=e[9]*n,t[10]=e[10]*n,t[11]=e[11]*n,t[12]=e[12]*n,t[13]=e[13]*n,t[14]=e[14]*n,t[15]=e[15]*n,t},multiplyScalarAndAdd:function(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t[2]=e[2]+n[2]*r,t[3]=e[3]+n[3]*r,t[4]=e[4]+n[4]*r,t[5]=e[5]+n[5]*r,t[6]=e[6]+n[6]*r,t[7]=e[7]+n[7]*r,t[8]=e[8]+n[8]*r,t[9]=e[9]+n[9]*r,t[10]=e[10]+n[10]*r,t[11]=e[11]+n[11]*r,t[12]=e[12]+n[12]*r,t[13]=e[13]+n[13]*r,t[14]=e[14]+n[14]*r,t[15]=e[15]+n[15]*r,t},exactEquals:function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]&&t[9]===e[9]&&t[10]===e[10]&&t[11]===e[11]&&t[12]===e[12]&&t[13]===e[13]&&t[14]===e[14]&&t[15]===e[15]},equals:function(t,e){var n=t[0],r=t[1],i=t[2],o=t[3],a=t[4],s=t[5],c=t[6],l=t[7],u=t[8],h=t[9],f=t[10],d=t[11],p=t[12],A=t[13],g=t[14],m=t[15],y=e[0],v=e[1],C=e[2],I=e[3],x=e[4],E=e[5],_=e[6],b=e[7],w=e[8],M=e[9],T=e[10],B=e[11],S=e[12],D=e[13],R=e[14],z=e[15];return Math.abs(n-y)<=wI*Math.max(1,Math.abs(n),Math.abs(y))&&Math.abs(r-v)<=wI*Math.max(1,Math.abs(r),Math.abs(v))&&Math.abs(i-C)<=wI*Math.max(1,Math.abs(i),Math.abs(C))&&Math.abs(o-I)<=wI*Math.max(1,Math.abs(o),Math.abs(I))&&Math.abs(a-x)<=wI*Math.max(1,Math.abs(a),Math.abs(x))&&Math.abs(s-E)<=wI*Math.max(1,Math.abs(s),Math.abs(E))&&Math.abs(c-_)<=wI*Math.max(1,Math.abs(c),Math.abs(_))&&Math.abs(l-b)<=wI*Math.max(1,Math.abs(l),Math.abs(b))&&Math.abs(u-w)<=wI*Math.max(1,Math.abs(u),Math.abs(w))&&Math.abs(h-M)<=wI*Math.max(1,Math.abs(h),Math.abs(M))&&Math.abs(f-T)<=wI*Math.max(1,Math.abs(f),Math.abs(T))&&Math.abs(d-B)<=wI*Math.max(1,Math.abs(d),Math.abs(B))&&Math.abs(p-S)<=wI*Math.max(1,Math.abs(p),Math.abs(S))&&Math.abs(A-D)<=wI*Math.max(1,Math.abs(A),Math.abs(D))&&Math.abs(g-R)<=wI*Math.max(1,Math.abs(g),Math.abs(R))&&Math.abs(m-z)<=wI*Math.max(1,Math.abs(m),Math.abs(z))},mul:tx,sub:ex});function rx(){var t=new MI(3);return MI!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function ix(t){var e=t[0],n=t[1],r=t[2];return Math.hypot(e,n,r)}function ox(t,e,n){var r=new MI(3);return r[0]=t,r[1]=e,r[2]=n,r}function ax(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t}function sx(t,e,n){return t[0]=e[0]*n[0],t[1]=e[1]*n[1],t[2]=e[2]*n[2],t}function cx(t,e,n){return t[0]=e[0]/n[0],t[1]=e[1]/n[1],t[2]=e[2]/n[2],t}function lx(t,e){var n=e[0]-t[0],r=e[1]-t[1],i=e[2]-t[2];return Math.hypot(n,r,i)}function ux(t,e){var n=e[0]-t[0],r=e[1]-t[1],i=e[2]-t[2];return n*n+r*r+i*i}function hx(t){var e=t[0],n=t[1],r=t[2];return e*e+n*n+r*r}function fx(t,e){var n=e[0],r=e[1],i=e[2],o=n*n+r*r+i*i;return o>0&&(o=1/Math.sqrt(o)),t[0]=e[0]*o,t[1]=e[1]*o,t[2]=e[2]*o,t}function dx(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function px(t,e,n){var r=e[0],i=e[1],o=e[2],a=n[0],s=n[1],c=n[2];return t[0]=i*c-o*s,t[1]=o*a-r*c,t[2]=r*s-i*a,t}var Ax,gx=ax,mx=sx,yx=cx,vx=lx,Cx=ux,Ix=ix,xx=hx,Ex=(Ax=rx(),function(t,e,n,r,i,o){var a,s;for(!e&&(e=3),!n&&(n=0),s=r?Math.min(r*e+n,t.length):t.length,a=n;a<s;a+=e)Ax[0]=t[a],Ax[1]=t[a+1],Ax[2]=t[a+2],i(Ax,Ax,o),t[a]=Ax[0],t[a+1]=Ax[1],t[a+2]=Ax[2];return t}),_x=Object.freeze({create:rx,clone:function(t){var e=new MI(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e},length:ix,fromValues:ox,copy:function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t},set:function(t,e,n,r){return t[0]=e,t[1]=n,t[2]=r,t},add:function(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t},subtract:ax,multiply:sx,divide:cx,ceil:function(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t[2]=Math.ceil(e[2]),t},floor:function(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t[2]=Math.floor(e[2]),t},min:function(t,e,n){return t[0]=Math.min(e[0],n[0]),t[1]=Math.min(e[1],n[1]),t[2]=Math.min(e[2],n[2]),t},max:function(t,e,n){return t[0]=Math.max(e[0],n[0]),t[1]=Math.max(e[1],n[1]),t[2]=Math.max(e[2],n[2]),t},round:function(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t[2]=Math.round(e[2]),t},scale:function(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t},scaleAndAdd:function(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t[2]=e[2]+n[2]*r,t},distance:lx,squaredDistance:ux,squaredLength:hx,negate:function(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t},inverse:function(t,e){return t[0]=1/e[0],t[1]=1/e[1],t[2]=1/e[2],t},normalize:fx,dot:dx,cross:px,lerp:function(t,e,n,r){var i=e[0],o=e[1],a=e[2];return t[0]=i+r*(n[0]-i),t[1]=o+r*(n[1]-o),t[2]=a+r*(n[2]-a),t},hermite:function(t,e,n,r,i,o){var a=o*o,s=a*(2*o-3)+1,c=a*(o-2)+o,l=a*(o-1),u=a*(3-2*o);return t[0]=e[0]*s+n[0]*c+r[0]*l+i[0]*u,t[1]=e[1]*s+n[1]*c+r[1]*l+i[1]*u,t[2]=e[2]*s+n[2]*c+r[2]*l+i[2]*u,t},bezier:function(t,e,n,r,i,o){var a=1-o,s=a*a,c=o*o,l=s*a,u=3*o*s,h=3*c*a,f=c*o;return t[0]=e[0]*l+n[0]*u+r[0]*h+i[0]*f,t[1]=e[1]*l+n[1]*u+r[1]*h+i[1]*f,t[2]=e[2]*l+n[2]*u+r[2]*h+i[2]*f,t},random:function(t,e){e=e||1;var n=2*TI()*Math.PI,r=2*TI()-1,i=Math.sqrt(1-r*r)*e;return t[0]=Math.cos(n)*i,t[1]=Math.sin(n)*i,t[2]=r*e,t},transformMat4:function(t,e,n){var r=e[0],i=e[1],o=e[2],a=n[3]*r+n[7]*i+n[11]*o+n[15];return a=a||1,t[0]=(n[0]*r+n[4]*i+n[8]*o+n[12])/a,t[1]=(n[1]*r+n[5]*i+n[9]*o+n[13])/a,t[2]=(n[2]*r+n[6]*i+n[10]*o+n[14])/a,t},transformMat3:function(t,e,n){var r=e[0],i=e[1],o=e[2];return t[0]=r*n[0]+i*n[3]+o*n[6],t[1]=r*n[1]+i*n[4]+o*n[7],t[2]=r*n[2]+i*n[5]+o*n[8],t},transformQuat:function(t,e,n){var r=n[0],i=n[1],o=n[2],a=n[3],s=e[0],c=e[1],l=e[2],u=i*l-o*c,h=o*s-r*l,f=r*c-i*s,d=i*f-o*h,p=o*u-r*f,A=r*h-i*u,g=2*a;return u*=g,h*=g,f*=g,d*=2,p*=2,A*=2,t[0]=s+u+d,t[1]=c+h+p,t[2]=l+f+A,t},rotateX:function(t,e,n,r){var i=[],o=[];return i[0]=e[0]-n[0],i[1]=e[1]-n[1],i[2]=e[2]-n[2],o[0]=i[0],o[1]=i[1]*Math.cos(r)-i[2]*Math.sin(r),o[2]=i[1]*Math.sin(r)+i[2]*Math.cos(r),t[0]=o[0]+n[0],t[1]=o[1]+n[1],t[2]=o[2]+n[2],t},rotateY:function(t,e,n,r){var i=[],o=[];return i[0]=e[0]-n[0],i[1]=e[1]-n[1],i[2]=e[2]-n[2],o[0]=i[2]*Math.sin(r)+i[0]*Math.cos(r),o[1]=i[1],o[2]=i[2]*Math.cos(r)-i[0]*Math.sin(r),t[0]=o[0]+n[0],t[1]=o[1]+n[1],t[2]=o[2]+n[2],t},rotateZ:function(t,e,n,r){var i=[],o=[];return i[0]=e[0]-n[0],i[1]=e[1]-n[1],i[2]=e[2]-n[2],o[0]=i[0]*Math.cos(r)-i[1]*Math.sin(r),o[1]=i[0]*Math.sin(r)+i[1]*Math.cos(r),o[2]=i[2],t[0]=o[0]+n[0],t[1]=o[1]+n[1],t[2]=o[2]+n[2],t},angle:function(t,e){var n=ox(t[0],t[1],t[2]),r=ox(e[0],e[1],e[2]);fx(n,n),fx(r,r);var i=dx(n,r);return i>1?0:i<-1?Math.PI:Math.acos(i)},zero:function(t){return t[0]=0,t[1]=0,t[2]=0,t},str:function(t){return"vec3("+t[0]+", "+t[1]+", "+t[2]+")"},exactEquals:function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]},equals:function(t,e){var n=t[0],r=t[1],i=t[2],o=e[0],a=e[1],s=e[2];return Math.abs(n-o)<=wI*Math.max(1,Math.abs(n),Math.abs(o))&&Math.abs(r-a)<=wI*Math.max(1,Math.abs(r),Math.abs(a))&&Math.abs(i-s)<=wI*Math.max(1,Math.abs(i),Math.abs(s))},sub:gx,mul:mx,div:yx,dist:vx,sqrDist:Cx,len:Ix,sqrLen:xx,forEach:Ex});function bx(){var t=new MI(4);return MI!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t}function wx(t){var e=new MI(4);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}function Mx(t,e,n,r){var i=new MI(4);return i[0]=t,i[1]=e,i[2]=n,i[3]=r,i}function Tx(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}function Bx(t,e,n,r,i){return t[0]=e,t[1]=n,t[2]=r,t[3]=i,t}function Sx(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t[3]=e[3]+n[3],t}function Dx(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t[3]=e[3]-n[3],t}function Rx(t,e,n){return t[0]=e[0]*n[0],t[1]=e[1]*n[1],t[2]=e[2]*n[2],t[3]=e[3]*n[3],t}function zx(t,e,n){return t[0]=e[0]/n[0],t[1]=e[1]/n[1],t[2]=e[2]/n[2],t[3]=e[3]/n[3],t}function Ox(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t}function Nx(t,e){var n=e[0]-t[0],r=e[1]-t[1],i=e[2]-t[2],o=e[3]-t[3];return Math.hypot(n,r,i,o)}function Lx(t,e){var n=e[0]-t[0],r=e[1]-t[1],i=e[2]-t[2],o=e[3]-t[3];return n*n+r*r+i*i+o*o}function Qx(t){var e=t[0],n=t[1],r=t[2],i=t[3];return Math.hypot(e,n,r,i)}function Fx(t){var e=t[0],n=t[1],r=t[2],i=t[3];return e*e+n*n+r*r+i*i}function Px(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=n*n+r*r+i*i+o*o;return a>0&&(a=1/Math.sqrt(a)),t[0]=n*a,t[1]=r*a,t[2]=i*a,t[3]=o*a,t}function kx(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]}function Ux(t,e,n,r){var i=e[0],o=e[1],a=e[2],s=e[3];return t[0]=i+r*(n[0]-i),t[1]=o+r*(n[1]-o),t[2]=a+r*(n[2]-a),t[3]=s+r*(n[3]-s),t}function jx(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]}function Gx(t,e){var n=t[0],r=t[1],i=t[2],o=t[3],a=e[0],s=e[1],c=e[2],l=e[3];return Math.abs(n-a)<=wI*Math.max(1,Math.abs(n),Math.abs(a))&&Math.abs(r-s)<=wI*Math.max(1,Math.abs(r),Math.abs(s))&&Math.abs(i-c)<=wI*Math.max(1,Math.abs(i),Math.abs(c))&&Math.abs(o-l)<=wI*Math.max(1,Math.abs(o),Math.abs(l))}var Hx,qx=Dx,Vx=Rx,Yx=zx,Kx=Nx,Wx=Lx,Xx=Qx,Jx=Fx,Zx=(Hx=bx(),function(t,e,n,r,i,o){var a,s;for(!e&&(e=4),!n&&(n=0),s=r?Math.min(r*e+n,t.length):t.length,a=n;a<s;a+=e)Hx[0]=t[a],Hx[1]=t[a+1],Hx[2]=t[a+2],Hx[3]=t[a+3],i(Hx,Hx,o),t[a]=Hx[0],t[a+1]=Hx[1],t[a+2]=Hx[2],t[a+3]=Hx[3];return t}),$x=Object.freeze({create:bx,clone:wx,fromValues:Mx,copy:Tx,set:Bx,add:Sx,subtract:Dx,multiply:Rx,divide:zx,ceil:function(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t[2]=Math.ceil(e[2]),t[3]=Math.ceil(e[3]),t},floor:function(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t[2]=Math.floor(e[2]),t[3]=Math.floor(e[3]),t},min:function(t,e,n){return t[0]=Math.min(e[0],n[0]),t[1]=Math.min(e[1],n[1]),t[2]=Math.min(e[2],n[2]),t[3]=Math.min(e[3],n[3]),t},max:function(t,e,n){return t[0]=Math.max(e[0],n[0]),t[1]=Math.max(e[1],n[1]),t[2]=Math.max(e[2],n[2]),t[3]=Math.max(e[3],n[3]),t},round:function(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t[2]=Math.round(e[2]),t[3]=Math.round(e[3]),t},scale:Ox,scaleAndAdd:function(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t[2]=e[2]+n[2]*r,t[3]=e[3]+n[3]*r,t},distance:Nx,squaredDistance:Lx,length:Qx,squaredLength:Fx,negate:function(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t},inverse:function(t,e){return t[0]=1/e[0],t[1]=1/e[1],t[2]=1/e[2],t[3]=1/e[3],t},normalize:Px,dot:kx,cross:function(t,e,n,r){var i=n[0]*r[1]-n[1]*r[0],o=n[0]*r[2]-n[2]*r[0],a=n[0]*r[3]-n[3]*r[0],s=n[1]*r[2]-n[2]*r[1],c=n[1]*r[3]-n[3]*r[1],l=n[2]*r[3]-n[3]*r[2],u=e[0],h=e[1],f=e[2],d=e[3];return t[0]=h*l-f*c+d*s,t[1]=-u*l+f*a-d*o,t[2]=u*c-h*a+d*i,t[3]=-u*s+h*o-f*i,t},lerp:Ux,random:function(t,e){var n,r,i,o,a,s;e=e||1;do{a=(n=2*TI()-1)*n+(r=2*TI()-1)*r}while(a>=1);do{s=(i=2*TI()-1)*i+(o=2*TI()-1)*o}while(s>=1);var c=Math.sqrt((1-a)/s);return t[0]=e*n,t[1]=e*r,t[2]=e*i*c,t[3]=e*o*c,t},transformMat4:function(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3];return t[0]=n[0]*r+n[4]*i+n[8]*o+n[12]*a,t[1]=n[1]*r+n[5]*i+n[9]*o+n[13]*a,t[2]=n[2]*r+n[6]*i+n[10]*o+n[14]*a,t[3]=n[3]*r+n[7]*i+n[11]*o+n[15]*a,t},transformQuat:function(t,e,n){var r=e[0],i=e[1],o=e[2],a=n[0],s=n[1],c=n[2],l=n[3],u=l*r+s*o-c*i,h=l*i+c*r-a*o,f=l*o+a*i-s*r,d=-a*r-s*i-c*o;return t[0]=u*l+d*-a+h*-c-f*-s,t[1]=h*l+d*-s+f*-a-u*-c,t[2]=f*l+d*-c+u*-s-h*-a,t[3]=e[3],t},zero:function(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=0,t},str:function(t){return"vec4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"},exactEquals:jx,equals:Gx,sub:qx,mul:Vx,div:Yx,dist:Kx,sqrDist:Wx,len:Xx,sqrLen:Jx,forEach:Zx});function tE(){var t=new MI(4);return MI!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}function eE(t,e,n){n*=.5;var r=Math.sin(n);return t[0]=r*e[0],t[1]=r*e[1],t[2]=r*e[2],t[3]=Math.cos(n),t}function nE(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=n[0],c=n[1],l=n[2],u=n[3];return t[0]=r*u+a*s+i*l-o*c,t[1]=i*u+a*c+o*s-r*l,t[2]=o*u+a*l+r*c-i*s,t[3]=a*u-r*s-i*c-o*l,t}function rE(t,e,n){n*=.5;var r=e[0],i=e[1],o=e[2],a=e[3],s=Math.sin(n),c=Math.cos(n);return t[0]=r*c+a*s,t[1]=i*c+o*s,t[2]=o*c-i*s,t[3]=a*c-r*s,t}function iE(t,e,n){n*=.5;var r=e[0],i=e[1],o=e[2],a=e[3],s=Math.sin(n),c=Math.cos(n);return t[0]=r*c-o*s,t[1]=i*c+a*s,t[2]=o*c+r*s,t[3]=a*c-i*s,t}function oE(t,e,n){n*=.5;var r=e[0],i=e[1],o=e[2],a=e[3],s=Math.sin(n),c=Math.cos(n);return t[0]=r*c+i*s,t[1]=i*c-r*s,t[2]=o*c+a*s,t[3]=a*c-o*s,t}function aE(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=Math.sqrt(n*n+r*r+i*i),s=Math.exp(o),c=a>0?s*Math.sin(a)/a:0;return t[0]=n*c,t[1]=r*c,t[2]=i*c,t[3]=s*Math.cos(a),t}function sE(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=Math.sqrt(n*n+r*r+i*i),s=a>0?Math.atan2(a,o)/a:0;return t[0]=n*s,t[1]=r*s,t[2]=i*s,t[3]=.5*Math.log(n*n+r*r+i*i+o*o),t}function cE(t,e,n,r){var i,o,a,s,c,l=e[0],u=e[1],h=e[2],f=e[3],d=n[0],p=n[1],A=n[2],g=n[3];return(o=l*d+u*p+h*A+f*g)<0&&(o=-o,d=-d,p=-p,A=-A,g=-g),1-o>wI?(i=Math.acos(o),a=Math.sin(i),s=Math.sin((1-r)*i)/a,c=Math.sin(r*i)/a):(s=1-r,c=r),t[0]=s*l+c*d,t[1]=s*u+c*p,t[2]=s*h+c*A,t[3]=s*f+c*g,t}function lE(t,e){var n,r=e[0]+e[4]+e[8];if(r>0)n=Math.sqrt(r+1),t[3]=.5*n,n=.5/n,t[0]=(e[5]-e[7])*n,t[1]=(e[6]-e[2])*n,t[2]=(e[1]-e[3])*n;else{var i=0;e[4]>e[0]&&(i=1),e[8]>e[3*i+i]&&(i=2);var o=(i+1)%3,a=(i+2)%3;n=Math.sqrt(e[3*i+i]-e[3*o+o]-e[3*a+a]+1),t[i]=.5*n,n=.5/n,t[3]=(e[3*o+a]-e[3*a+o])*n,t[o]=(e[3*o+i]+e[3*i+o])*n,t[a]=(e[3*a+i]+e[3*i+a])*n}return t}var uE,hE,fE,dE,pE,AE,gE=wx,mE=Mx,yE=Tx,vE=Bx,CE=Sx,IE=nE,xE=Ox,EE=kx,_E=Ux,bE=Qx,wE=bE,ME=Fx,TE=ME,BE=Px,SE=jx,DE=Gx,RE=(dE=rx(),pE=ox(1,0,0),AE=ox(0,1,0),function(t,e,n){var r=dx(e,n);return r<-.999999?(px(dE,pE,e),Ix(dE)<1e-6&&px(dE,AE,e),fx(dE,dE),eE(t,dE,Math.PI),t):r>.999999?(t[0]=0,t[1]=0,t[2]=0,t[3]=1,t):(px(dE,e,n),t[0]=dE[0],t[1]=dE[1],t[2]=dE[2],t[3]=1+r,BE(t,t))}),zE=(hE=tE(),fE=tE(),function(t,e,n,r,i,o){return cE(hE,e,i,o),cE(fE,n,r,o),cE(t,hE,fE,2*o*(1-o)),t}),OE=(uE=UI(),function(t,e,n,r){return uE[0]=n[0],uE[3]=n[1],uE[6]=n[2],uE[1]=r[0],uE[4]=r[1],uE[7]=r[2],uE[2]=-e[0],uE[5]=-e[1],uE[8]=-e[2],BE(t,lE(t,uE))}),NE=Object.freeze({create:tE,identity:function(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t},setAxisAngle:eE,getAxisAngle:function(t,e){var n=2*Math.acos(e[3]),r=Math.sin(n/2);return r>wI?(t[0]=e[0]/r,t[1]=e[1]/r,t[2]=e[2]/r):(t[0]=1,t[1]=0,t[2]=0),n},getAngle:function(t,e){var n=EE(t,e);return Math.acos(2*n*n-1)},multiply:nE,rotateX:rE,rotateY:iE,rotateZ:oE,calculateW:function(t,e){var n=e[0],r=e[1],i=e[2];return t[0]=n,t[1]=r,t[2]=i,t[3]=Math.sqrt(Math.abs(1-n*n-r*r-i*i)),t},exp:aE,ln:sE,pow:function(t,e,n){return sE(t,e),xE(t,t,n),aE(t,t),t},slerp:cE,random:function(t){var e=TI(),n=TI(),r=TI(),i=Math.sqrt(1-e),o=Math.sqrt(e);return t[0]=i*Math.sin(2*Math.PI*n),t[1]=i*Math.cos(2*Math.PI*n),t[2]=o*Math.sin(2*Math.PI*r),t[3]=o*Math.cos(2*Math.PI*r),t},invert:function(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=n*n+r*r+i*i+o*o,s=a?1/a:0;return t[0]=-n*s,t[1]=-r*s,t[2]=-i*s,t[3]=o*s,t},conjugate:function(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=e[3],t},fromMat3:lE,fromEuler:function(t,e,n,r){var i=.5*Math.PI/180;e*=i,n*=i,r*=i;var o=Math.sin(e),a=Math.cos(e),s=Math.sin(n),c=Math.cos(n),l=Math.sin(r),u=Math.cos(r);return t[0]=o*c*u-a*s*l,t[1]=a*s*u+o*c*l,t[2]=a*c*l-o*s*u,t[3]=a*c*u+o*s*l,t},str:function(t){return"quat("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"},clone:gE,fromValues:mE,copy:yE,set:vE,add:CE,mul:IE,scale:xE,dot:EE,lerp:_E,length:bE,len:wE,squaredLength:ME,sqrLen:TE,normalize:BE,exactEquals:SE,equals:DE,rotationTo:RE,sqlerp:zE,setAxes:OE});function LE(t,e,n){var r=.5*n[0],i=.5*n[1],o=.5*n[2],a=e[0],s=e[1],c=e[2],l=e[3];return t[0]=a,t[1]=s,t[2]=c,t[3]=l,t[4]=r*l+i*c-o*s,t[5]=i*l+o*a-r*c,t[6]=o*l+r*s-i*a,t[7]=-r*a-i*s-o*c,t}function QE(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t}var FE=yE;var PE=yE;function kE(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=n[4],c=n[5],l=n[6],u=n[7],h=e[4],f=e[5],d=e[6],p=e[7],A=n[0],g=n[1],m=n[2],y=n[3];return t[0]=r*y+a*A+i*m-o*g,t[1]=i*y+a*g+o*A-r*m,t[2]=o*y+a*m+r*g-i*A,t[3]=a*y-r*A-i*g-o*m,t[4]=r*u+a*s+i*l-o*c+h*y+p*A+f*m-d*g,t[5]=i*u+a*c+o*s-r*l+f*y+p*g+d*A-h*m,t[6]=o*u+a*l+r*c-i*s+d*y+p*m+h*g-f*A,t[7]=a*u-r*s-i*c-o*l+p*y-h*A-f*g-d*m,t}var UE=kE;var jE=EE;var GE=bE,HE=GE,qE=ME,VE=qE;var YE=Object.freeze({create:function(){var t=new MI(8);return MI!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[4]=0,t[5]=0,t[6]=0,t[7]=0),t[3]=1,t},clone:function(t){var e=new MI(8);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e},fromValues:function(t,e,n,r,i,o,a,s){var c=new MI(8);return c[0]=t,c[1]=e,c[2]=n,c[3]=r,c[4]=i,c[5]=o,c[6]=a,c[7]=s,c},fromRotationTranslationValues:function(t,e,n,r,i,o,a){var s=new MI(8);s[0]=t,s[1]=e,s[2]=n,s[3]=r;var c=.5*i,l=.5*o,u=.5*a;return s[4]=c*r+l*n-u*e,s[5]=l*r+u*t-c*n,s[6]=u*r+c*e-l*t,s[7]=-c*t-l*e-u*n,s},fromRotationTranslation:LE,fromTranslation:function(t,e){return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t[4]=.5*e[0],t[5]=.5*e[1],t[6]=.5*e[2],t[7]=0,t},fromRotation:function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=0,t[5]=0,t[6]=0,t[7]=0,t},fromMat4:function(t,e){var n=tE();ZI(n,e);var r=new MI(3);return XI(r,e),LE(t,n,r),t},copy:QE,identity:function(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t[6]=0,t[7]=0,t},set:function(t,e,n,r,i,o,a,s,c){return t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=o,t[5]=a,t[6]=s,t[7]=c,t},getReal:FE,getDual:function(t,e){return t[0]=e[4],t[1]=e[5],t[2]=e[6],t[3]=e[7],t},setReal:PE,setDual:function(t,e){return t[4]=e[0],t[5]=e[1],t[6]=e[2],t[7]=e[3],t},getTranslation:function(t,e){var n=e[4],r=e[5],i=e[6],o=e[7],a=-e[0],s=-e[1],c=-e[2],l=e[3];return t[0]=2*(n*l+o*a+r*c-i*s),t[1]=2*(r*l+o*s+i*a-n*c),t[2]=2*(i*l+o*c+n*s-r*a),t},translate:function(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=.5*n[0],c=.5*n[1],l=.5*n[2],u=e[4],h=e[5],f=e[6],d=e[7];return t[0]=r,t[1]=i,t[2]=o,t[3]=a,t[4]=a*s+i*l-o*c+u,t[5]=a*c+o*s-r*l+h,t[6]=a*l+r*c-i*s+f,t[7]=-r*s-i*c-o*l+d,t},rotateX:function(t,e,n){var r=-e[0],i=-e[1],o=-e[2],a=e[3],s=e[4],c=e[5],l=e[6],u=e[7],h=s*a+u*r+c*o-l*i,f=c*a+u*i+l*r-s*o,d=l*a+u*o+s*i-c*r,p=u*a-s*r-c*i-l*o;return rE(t,e,n),r=t[0],i=t[1],o=t[2],a=t[3],t[4]=h*a+p*r+f*o-d*i,t[5]=f*a+p*i+d*r-h*o,t[6]=d*a+p*o+h*i-f*r,t[7]=p*a-h*r-f*i-d*o,t},rotateY:function(t,e,n){var r=-e[0],i=-e[1],o=-e[2],a=e[3],s=e[4],c=e[5],l=e[6],u=e[7],h=s*a+u*r+c*o-l*i,f=c*a+u*i+l*r-s*o,d=l*a+u*o+s*i-c*r,p=u*a-s*r-c*i-l*o;return iE(t,e,n),r=t[0],i=t[1],o=t[2],a=t[3],t[4]=h*a+p*r+f*o-d*i,t[5]=f*a+p*i+d*r-h*o,t[6]=d*a+p*o+h*i-f*r,t[7]=p*a-h*r-f*i-d*o,t},rotateZ:function(t,e,n){var r=-e[0],i=-e[1],o=-e[2],a=e[3],s=e[4],c=e[5],l=e[6],u=e[7],h=s*a+u*r+c*o-l*i,f=c*a+u*i+l*r-s*o,d=l*a+u*o+s*i-c*r,p=u*a-s*r-c*i-l*o;return oE(t,e,n),r=t[0],i=t[1],o=t[2],a=t[3],t[4]=h*a+p*r+f*o-d*i,t[5]=f*a+p*i+d*r-h*o,t[6]=d*a+p*o+h*i-f*r,t[7]=p*a-h*r-f*i-d*o,t},rotateByQuatAppend:function(t,e,n){var r=n[0],i=n[1],o=n[2],a=n[3],s=e[0],c=e[1],l=e[2],u=e[3];return t[0]=s*a+u*r+c*o-l*i,t[1]=c*a+u*i+l*r-s*o,t[2]=l*a+u*o+s*i-c*r,t[3]=u*a-s*r-c*i-l*o,s=e[4],c=e[5],l=e[6],u=e[7],t[4]=s*a+u*r+c*o-l*i,t[5]=c*a+u*i+l*r-s*o,t[6]=l*a+u*o+s*i-c*r,t[7]=u*a-s*r-c*i-l*o,t},rotateByQuatPrepend:function(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=n[0],c=n[1],l=n[2],u=n[3];return t[0]=r*u+a*s+i*l-o*c,t[1]=i*u+a*c+o*s-r*l,t[2]=o*u+a*l+r*c-i*s,t[3]=a*u-r*s-i*c-o*l,s=n[4],c=n[5],l=n[6],u=n[7],t[4]=r*u+a*s+i*l-o*c,t[5]=i*u+a*c+o*s-r*l,t[6]=o*u+a*l+r*c-i*s,t[7]=a*u-r*s-i*c-o*l,t},rotateAroundAxis:function(t,e,n,r){if(Math.abs(r)<wI)return QE(t,e);var i=Math.hypot(n[0],n[1],n[2]);r*=.5;var o=Math.sin(r),a=o*n[0]/i,s=o*n[1]/i,c=o*n[2]/i,l=Math.cos(r),u=e[0],h=e[1],f=e[2],d=e[3];t[0]=u*l+d*a+h*c-f*s,t[1]=h*l+d*s+f*a-u*c,t[2]=f*l+d*c+u*s-h*a,t[3]=d*l-u*a-h*s-f*c;var p=e[4],A=e[5],g=e[6],m=e[7];return t[4]=p*l+m*a+A*c-g*s,t[5]=A*l+m*s+g*a-p*c,t[6]=g*l+m*c+p*s-A*a,t[7]=m*l-p*a-A*s-g*c,t},add:function(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t[3]=e[3]+n[3],t[4]=e[4]+n[4],t[5]=e[5]+n[5],t[6]=e[6]+n[6],t[7]=e[7]+n[7],t},multiply:kE,mul:UE,scale:function(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*n,t[5]=e[5]*n,t[6]=e[6]*n,t[7]=e[7]*n,t},dot:jE,lerp:function(t,e,n,r){var i=1-r;return jE(e,n)<0&&(r=-r),t[0]=e[0]*i+n[0]*r,t[1]=e[1]*i+n[1]*r,t[2]=e[2]*i+n[2]*r,t[3]=e[3]*i+n[3]*r,t[4]=e[4]*i+n[4]*r,t[5]=e[5]*i+n[5]*r,t[6]=e[6]*i+n[6]*r,t[7]=e[7]*i+n[7]*r,t},invert:function(t,e){var n=qE(e);return t[0]=-e[0]/n,t[1]=-e[1]/n,t[2]=-e[2]/n,t[3]=e[3]/n,t[4]=-e[4]/n,t[5]=-e[5]/n,t[6]=-e[6]/n,t[7]=e[7]/n,t},conjugate:function(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=e[3],t[4]=-e[4],t[5]=-e[5],t[6]=-e[6],t[7]=e[7],t},length:GE,len:HE,squaredLength:qE,sqrLen:VE,normalize:function(t,e){var n=qE(e);if(n>0){n=Math.sqrt(n);var r=e[0]/n,i=e[1]/n,o=e[2]/n,a=e[3]/n,s=e[4],c=e[5],l=e[6],u=e[7],h=r*s+i*c+o*l+a*u;t[0]=r,t[1]=i,t[2]=o,t[3]=a,t[4]=(s-r*h)/n,t[5]=(c-i*h)/n,t[6]=(l-o*h)/n,t[7]=(u-a*h)/n}return t},str:function(t){return"quat2("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+")"},exactEquals:function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]},equals:function(t,e){var n=t[0],r=t[1],i=t[2],o=t[3],a=t[4],s=t[5],c=t[6],l=t[7],u=e[0],h=e[1],f=e[2],d=e[3],p=e[4],A=e[5],g=e[6],m=e[7];return Math.abs(n-u)<=wI*Math.max(1,Math.abs(n),Math.abs(u))&&Math.abs(r-h)<=wI*Math.max(1,Math.abs(r),Math.abs(h))&&Math.abs(i-f)<=wI*Math.max(1,Math.abs(i),Math.abs(f))&&Math.abs(o-d)<=wI*Math.max(1,Math.abs(o),Math.abs(d))&&Math.abs(a-p)<=wI*Math.max(1,Math.abs(a),Math.abs(p))&&Math.abs(s-A)<=wI*Math.max(1,Math.abs(s),Math.abs(A))&&Math.abs(c-g)<=wI*Math.max(1,Math.abs(c),Math.abs(g))&&Math.abs(l-m)<=wI*Math.max(1,Math.abs(l),Math.abs(m))}});function KE(){var t=new MI(2);return MI!=Float32Array&&(t[0]=0,t[1]=0),t}function WE(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t}function XE(t,e,n){return t[0]=e[0]*n[0],t[1]=e[1]*n[1],t}function JE(t,e,n){return t[0]=e[0]/n[0],t[1]=e[1]/n[1],t}function ZE(t,e){var n=e[0]-t[0],r=e[1]-t[1];return Math.hypot(n,r)}function $E(t,e){var n=e[0]-t[0],r=e[1]-t[1];return n*n+r*r}function t_(t){var e=t[0],n=t[1];return Math.hypot(e,n)}function e_(t){var e=t[0],n=t[1];return e*e+n*n}var n_,r_=t_,i_=WE,o_=XE,a_=JE,s_=ZE,c_=$E,l_=e_,u_=(n_=KE(),function(t,e,n,r,i,o){var a,s;for(!e&&(e=2),!n&&(n=0),s=r?Math.min(r*e+n,t.length):t.length,a=n;a<s;a+=e)n_[0]=t[a],n_[1]=t[a+1],i(n_,n_,o),t[a]=n_[0],t[a+1]=n_[1];return t}),h_=Object.freeze({create:KE,clone:function(t){var e=new MI(2);return e[0]=t[0],e[1]=t[1],e},fromValues:function(t,e){var n=new MI(2);return n[0]=t,n[1]=e,n},copy:function(t,e){return t[0]=e[0],t[1]=e[1],t},set:function(t,e,n){return t[0]=e,t[1]=n,t},add:function(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t},subtract:WE,multiply:XE,divide:JE,ceil:function(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t},floor:function(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t},min:function(t,e,n){return t[0]=Math.min(e[0],n[0]),t[1]=Math.min(e[1],n[1]),t},max:function(t,e,n){return t[0]=Math.max(e[0],n[0]),t[1]=Math.max(e[1],n[1]),t},round:function(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t},scale:function(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t},scaleAndAdd:function(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t},distance:ZE,squaredDistance:$E,length:t_,squaredLength:e_,negate:function(t,e){return t[0]=-e[0],t[1]=-e[1],t},inverse:function(t,e){return t[0]=1/e[0],t[1]=1/e[1],t},normalize:function(t,e){var n=e[0],r=e[1],i=n*n+r*r;return i>0&&(i=1/Math.sqrt(i)),t[0]=e[0]*i,t[1]=e[1]*i,t},dot:function(t,e){return t[0]*e[0]+t[1]*e[1]},cross:function(t,e,n){var r=e[0]*n[1]-e[1]*n[0];return t[0]=t[1]=0,t[2]=r,t},lerp:function(t,e,n,r){var i=e[0],o=e[1];return t[0]=i+r*(n[0]-i),t[1]=o+r*(n[1]-o),t},random:function(t,e){e=e||1;var n=2*TI()*Math.PI;return t[0]=Math.cos(n)*e,t[1]=Math.sin(n)*e,t},transformMat2:function(t,e,n){var r=e[0],i=e[1];return t[0]=n[0]*r+n[2]*i,t[1]=n[1]*r+n[3]*i,t},transformMat2d:function(t,e,n){var r=e[0],i=e[1];return t[0]=n[0]*r+n[2]*i+n[4],t[1]=n[1]*r+n[3]*i+n[5],t},transformMat3:function(t,e,n){var r=e[0],i=e[1];return t[0]=n[0]*r+n[3]*i+n[6],t[1]=n[1]*r+n[4]*i+n[7],t},transformMat4:function(t,e,n){var r=e[0],i=e[1];return t[0]=n[0]*r+n[4]*i+n[12],t[1]=n[1]*r+n[5]*i+n[13],t},rotate:function(t,e,n,r){var i=e[0]-n[0],o=e[1]-n[1],a=Math.sin(r),s=Math.cos(r);return t[0]=i*s-o*a+n[0],t[1]=i*a+o*s+n[1],t},angle:function(t,e){var n=t[0],r=t[1],i=e[0],o=e[1],a=n*n+r*r;a>0&&(a=1/Math.sqrt(a));var s=i*i+o*o;s>0&&(s=1/Math.sqrt(s));var c=(n*i+r*o)*a*s;return c>1?0:c<-1?Math.PI:Math.acos(c)},zero:function(t){return t[0]=0,t[1]=0,t},str:function(t){return"vec2("+t[0]+", "+t[1]+")"},exactEquals:function(t,e){return t[0]===e[0]&&t[1]===e[1]},equals:function(t,e){var n=t[0],r=t[1],i=e[0],o=e[1];return Math.abs(n-i)<=wI*Math.max(1,Math.abs(n),Math.abs(i))&&Math.abs(r-o)<=wI*Math.max(1,Math.abs(r),Math.abs(o))},len:r_,sub:i_,mul:o_,div:a_,dist:s_,sqrDist:c_,sqrLen:l_,forEach:u_});bI.glMatrix=SI,bI.mat2=NI,bI.mat2d=kI,bI.mat3=VI,bI.mat4=nx,bI.quat=NE,bI.quat2=YE,bI.vec2=h_,bI.vec3=_x,bI.vec4=$x;const f_=function(){let t=!0;return function(e,n){const r=t?function(){if(n){const t=n.apply(e,arguments);return n=null,t}}:function(){};return t=!1,r}}(),d_=f_(void 0,(function(){return d_.toString().search("(((.+)+)+)+$").toString().constructor(d_).search("(((.+)+)+)+$")}));d_();const p_=function(){let t=!0;return function(e,n){const r=t?function(){if(n){const t=n.apply(e,arguments);return n=null,t}}:function(){};return t=!1,r}}(),A_=p_(void 0,(function(){return A_.toString().search("(((.+)+)+)+$").toString().constructor(A_).search("(((.+)+)+)+$")}));A_();class g_{constructor(t,e){t&&(e?this.setSouthWest(t).setNorthEast(e):4===t.length?this.setSouthWest([t[0],t[1]]).setNorthEast([t[2],t[3]]):this.setSouthWest(t[0]).setNorthEast(t[1]))}setNorthEast(t){return this._ne=t instanceof I_?new I_(t.lng,t.lat):I_.convert(t),this}setSouthWest(t){return this._sw=t instanceof I_?new I_(t.lng,t.lat):I_.convert(t),this}extend(t){const e=this._sw,n=this._ne;let r,i;if(t instanceof I_)r=t,i=t;else{if(!(t instanceof g_))return Array.isArray(t)?t.every(Array.isArray)?this.extend(g_.convert(t)):this.extend(I_.convert(t)):this;if(r=t._sw,i=t._ne,!r||!i)return this}return e||n?(e.lng=Math.min(r.lng,e.lng),e.lat=Math.min(r.lat,e.lat),n.lng=Math.max(i.lng,n.lng),n.lat=Math.max(i.lat,n.lat)):(this._sw=new I_(r.lng,r.lat),this._ne=new I_(i.lng,i.lat)),this}getCenter(){return new I_((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)}getSouthWest(){return this._sw}getNorthEast(){return this._ne}getNorthWest(){return new I_(this.getWest(),this.getNorth())}getSouthEast(){return new I_(this.getEast(),this.getSouth())}getWest(){return this._sw.lng}getSouth(){return this._sw.lat}getEast(){return this._ne.lng}getNorth(){return this._ne.lat}toArray(){return[this._sw.toArray(),this._ne.toArray()]}toString(){return"LngLatBounds("+this._sw.toString()+", "+this._ne.toString()+")"}isEmpty(){return!(this._sw&&this._ne)}contains(t){const{lng:e,lat:n}=I_.convert(t),r=this._sw.lat<=n&&n<=this._ne.lat;let i=this._sw.lng<=e&&e<=this._ne.lng;return this._sw.lng>this._ne.lng&&(i=this._sw.lng>=e&&e>=this._ne.lng),r&&i}static convert(t){return!t||t instanceof g_?t:new g_(t)}}const m_=function(){let t=!0;return function(e,n){const r=t?function(){if(n){const t=n.apply(e,arguments);return n=null,t}}:function(){};return t=!1,r}}(),y_=m_(void 0,(function(){return y_.toString().search("(((.+)+)+)+$").toString().constructor(y_).search("(((.+)+)+)+$")}));y_();const v_=6371008.8,C_=2*Math.PI*v_;class I_{constructor(t,e){if(isNaN(t)||isNaN(e))throw new Error("Invalid LngLat object: ("+t+", "+e+")");this.lng=+t,this.lat=+e,this.lat>90||this.lat}wrap(){return new I_(Op(this.lng,-180,180),this.lat)}toArray(){return[this.lng,this.lat]}toString(){return"LngLat("+this.lng+", "+this.lat+")"}distanceTo(t){const e=Math.PI/180,n=this.lat*e,r=t.lat*e,i=Math.sin(n)*Math.sin(r)+Math.cos(n)*Math.cos(r)*Math.cos((t.lng-this.lng)*e);return v_*Math.acos(Math.min(i,1))}toBounds(t=0){const e=360*t/40075017,n=e/Math.cos(Math.PI/180*this.lat);return new g_(new I_(this.lng-n,this.lat-e),new I_(this.lng+n,this.lat+e))}static convert(t){if(t instanceof I_)return t;if(Array.isArray(t)&&(2===t.length||3===t.length))return new I_(Number(t[0]),Number(t[1]));if(!Array.isArray(t)&&"object"==typeof t&&null!==t)return new I_(Number("lng"in t?t.lng:t.lon),Number(t.lat));throw new Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: <lng>, lat: <lat>}, an object {lon: <lng>, lat: <lat>}, or an array of [<lng>, <lat>]")}}const x_=function(){let t=!0;return function(e,n){const r=t?function(){if(n){const t=n.apply(e,arguments);return n=null,t}}:function(){};return t=!1,r}}(),E_=x_(void 0,(function(){return E_.toString().search("(((.+)+)+)+$").toString().constructor(E_).search("(((.+)+)+)+$")}));function __(t){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t*Math.PI/360)))/360}function b_(t,e){return t/(n=e,C_*Math.cos(n*Math.PI/180));var n}function w_(t){return 360*t-180}function M_(t){const e=180-360*t;return 360/Math.PI*Math.atan(Math.exp(e*Math.PI/180))-90}E_();const T_=85.051129,B_=function(){let t=!0;return function(e,n){const r=t?function(){if(n){const t=n.apply(e,arguments);return n=null,t}}:function(){};return t=!1,r}}(),S_=B_(void 0,(function(){return S_.toString().search("(((.+)+)+)+$").toString().constructor(S_).search("(((.+)+)+)+$")}));S_();var D_=new ls,R_=new Hr;function z_(t,e,n,r){const i=Yp(t.crs,e,n,r),o=[0,0,0,1];bI.vec4.transformMat4(o,[i.x,i.y,i.z,1],t.sceneViewProjMatrix);const a=o[3];o[0]/=a,o[1]/=a,o[2]/=a;var s=new Hr(o[0],o[1],o[2]),c={x:0,y:0,width:t.width,height:t.height},l=ls.computeViewportTransformation(c,0,1,D_),u=ls.multiplyByPoint(l,s,R_);return new Or(u.x,u.y)}function O_(t,e,n,r,i,o,a,s,c){if(o&&t.queryGeometry.isAboveHorizon)return!1;o&&(c*=t.pixelToTileUnitsFactor);const l=t.tileID.canonical;n.projection.upVectorScale(l,n.center.lat,n.worldSize).metersToTile;for(const i of e)for(const e of i){const i=e.add(s),d=0,p=o?i:z_(n,i.x,i.y,l),A=o?t.tilespaceRays.map((t=>Q_(t,d))):t.tilespaceGeometry.map((t=>z_(n,t.x,t.y,l))),g=bI.vec4.transformMat4([],[p.x,p.y,0,1],r);if(!a&&o&&(c*=g[3]/n.cameraToCenterDistance),o){const t=M_((e.y/Cl+l.y)/(1<<l.z));c/=n.projection.pixelsPerMeter(t,1)/b_(1,t)}if(f=c,uI(u=A,h=p)||sI(h,u,f))return!0}var u,h,f;return!1}const N_=bI.vec3.fromValues(0,0,0),L_=bI.vec3.fromValues(0,0,1);function Q_(t,e){const n=bI.vec3.create();return N_[2]=e,t.intersectsPlane(N_,L_,n),new Or(n[0],n[1])}const F_=function(){let t=!0;return function(e,n){const r=t?function(){if(n){const t=n.apply(e,arguments);return n=null,t}}:function(){};return t=!1,r}}(),P_=F_(void 0,(function(){return P_.toString().search("(((.+)+)+)+$").toString().constructor(P_).search("(((.+)+)+)+$")}));P_();var k_={paint:new HA({"heatmap-radius":new jA(Um.paint_heatmap["heatmap-radius"]),"heatmap-weight":new jA(Um.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new UA(Um.paint_heatmap["heatmap-intensity"]),"heatmap-color":new GA(Um.paint_heatmap["heatmap-color"]),"heatmap-opacity":new UA(Um.paint_heatmap["heatmap-opacity"])})};const U_=function(){let t=!0;return function(e,n){const r=t?function(){if(n){const t=n.apply(e,arguments);return n=null,t}}:function(){};return t=!1,r}}(),j_=U_(void 0,(function(){return j_.toString().search("(((.+)+)+)+$").toString().constructor(j_).search("(((.+)+)+)+$")}));function G_(t,{width:e,height:n},r,i){if(i){if(i instanceof Uint8ClampedArray)i=new Uint8Array(i.buffer);else if(i.length!==e*n*r)throw new RangeError("mismatched image size")}else i=new Uint8Array(e*n*r);return t.width=e,t.height=n,t.data=i,t}function H_(t,e,n){const{width:r,height:i}=e;r===t.width&&i===t.height||(q_(t,e,{x:0,y:0},{x:0,y:0},{width:Math.min(t.width,r),height:Math.min(t.height,i)},n),t.width=r,t.height=i,t.data=e.data)}function q_(t,e,n,r,i,o){if(0===i.width||0===i.height)return e;if(i.width>t.width||i.height>t.height||n.x>t.width-i.width||n.y>t.height-i.height)throw new RangeError("out of range source coordinates for image copy");if(i.width>e.width||i.height>e.height||r.x>e.width-i.width||r.y>e.height-i.height)throw new RangeError("out of range destination coordinates for image copy");const a=t.data,s=e.data;for(let c=0;c<i.height;c++){const l=((n.y+c)*t.width+n.x)*o,u=((r.y+c)*e.width+r.x)*o;for(let t=0;t<i.width*o;t++)s[u+t]=a[l+t]}return e}j_();class V_{constructor(t,e){G_(this,t,1,e)}resize(t){H_(this,new V_(t),1)}clone(){return new V_({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(t,e,n,r,i){q_(t,e,n,r,i,1)}}class Y_{constructor(t,e){G_(this,t,4,e)}resize(t){H_(this,new Y_(t),4)}replace(t,e){e?this.data.set(t):t instanceof Uint8ClampedArray?this.data=new Uint8Array(t.buffer):this.data=t}clone(){return new Y_({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(t,e,n,r,i){q_(t,e,n,r,i,4)}}sA(V_,"AlphaImage"),sA(Y_,"RGBAImage");const K_=function(){let t=!0;return function(e,n){const r=t?function(){if(n){const t=n.apply(e,arguments);return n=null,t}}:function(){};return t=!1,r}}(),W_=K_(void 0,(function(){return W_.toString().search("(((.+)+)+)+$").toString().constructor(W_).search("(((.+)+)+)+$")}));function X_(t){const e={},n=t.resolution||256,r=t.clips?t.clips.length:1,i=t.image||new Y_({width:n,height:r});var o;o=n,Math.log(o)/Math.LN2%1!=0&&console.log("renderColorRamp width must be isPowerOfTwo.");const a=(n,r,o)=>{e[t.evaluationKey]=o;const a=t.expression.evaluate(evaluationGlobal);i.data[n+r+0]=Math.floor(255*a.r/a.a),i.data[n+r+1]=Math.floor(255*a.g/a.a),i.data[n+r+2]=Math.floor(255*a.b/a.a),i.data[n+r+3]=Math.floor(255*a.a)};if(t.clips)for(let e=0,i=0;e<r;++e,i+=4*n)for(let r=0,o=0;r<n;r++,o+=4){const s=r/(n-1),{start:c,end:l}=t.clips[e];a(i,o,c*(1-s)+l*s)}else for(let t=0,e=0;t<n;t++,e+=4){a(0,e,t/(n-1))}return i}W_();const J_=function(){let t=!0;return function(e,n){const r=t?function(){if(n){const t=n.apply(e,arguments);return n=null,t}}:function(){};return t=!1,r}}(),Z_=J_(void 0,(function(){return Z_.toString().search("(((.+)+)+)+$").toString().constructor(Z_).search("(((.+)+)+)+$")}));Z_();const $_=function(){let t=!0;return function(e,n){const r=t?function(){if(n){const t=n.apply(e,arguments);return n=null,t}}:function(){};return t=!1,r}}(),tb=$_(void 0,(function(){return tb.toString().search("(((.+)+)+)+$").toString().constructor(tb).search("(((.+)+)+)+$")}));tb();const eb=tg([{name:"a_pos",components:2,type:"Int16"}],4).members;function nb(t,e,n,r,i){rb(t,e,n||0,r||t.length-1,i||ob)}function rb(t,e,n,r,i){for(;r>n;){if(r-n>600){var o=r-n+1,a=e-n+1,s=Math.log(o),c=.5*Math.exp(2*s/3),l=.5*Math.sqrt(s*c*(o-c)/o)*(a-o/2<0?-1:1);rb(t,e,Math.max(n,Math.floor(e-a*c/o+l)),Math.min(r,Math.floor(e+(o-a)*c/o+l)),i)}var u=t[e],h=n,f=r;for(ib(t,n,e),i(t[r],u)>0&&ib(t,n,r);h<f;){for(ib(t,h,f),h++,f--;i(t[h],u)<0;)h++;for(;i(t[f],u)>0;)f--}0===i(t[n],u)?ib(t,n,f):ib(t,++f,r),f<=e&&(n=f+1),e<=f&&(r=f-1)}}function ib(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function ob(t,e){return t<e?-1:t>e?1:0}var ab,sb=(ab=!0,function(t,e){var n=ab?function(){if(e){var n=e.apply(t,arguments);return e=null,n}}:function(){};return ab=!1,n}),cb=sb(void 0,(function(){return cb.toString().search("(((.+)+)+)+$").toString().constructor(cb).search("(((.+)+)+)+$")}));function lb(t){for(var e=0,n=0,r=t.length,i=r-1,o=void 0,a=void 0;n<r;i=n++)o=t[n],e+=((a=t[i]).x-o.x)*(o.y+a.y);return e}function ub(t,e){var n=t.length;if(n<=1)return[t];for(var r,i,o=[],a=0;a<n;a++){var s=lb(t[a]);0!==s&&(t[a].area=Math.abs(s),void 0===i&&(i=s<0),i===s<0?(r&&o.push(r),r=[t[a]]):r.push(t[a]))}if(r&&o.push(r),e>1)for(var c=0;c<o.length;c++)o[c].length<=e||(nb(o[c],e,1,o[c].length-1,hb),o[c]=o[c].slice(0,e));return o}function hb(t,e){return e.area-t.area}cb();const fb=function(){let t=!0;return function(e,n){const r=t?function(){if(n){const t=n.apply(e,arguments);return n=null,t}}:function(){};return t=!1,r}}(),db=fb(void 0,(function(){return db.toString().search("(((.+)+)+)+$").toString().constructor(db).search("(((.+)+)+)+$")}));function pb(t,e,n){const r=n.patternDependencies;let i=!1;for(const n of e){const e=n.paint.get(t+"-pattern");!e.isConstant()&&(i=!0);const o=e.constantOr(null);o&&(i=!0,r[o]=!0)}return i}function Ab(t,e,n,r,i){const o=i.patternDependencies;for(const a of e){const e=a.paint.get(t+"-pattern").value;if("constant"!==e.kind){let t=e.evaluate({zoom:r},n,{},i.availableImages);t=t&&t.name?t.name:t,o[t]=!0,n.patterns[a.id]=t}}return n}db();const gb=function(){let t=!0;return function(e,n){const r=t?function(){if(n){const t=n.apply(e,arguments);return n=null,t}}:function(){};return t=!1,r}}(),mb=gb(void 0,(function(){return mb.toString().search("(((.+)+)+)+$").toString().constructor(mb).search("(((.+)+)+)+$")}));mb();class yb{constructor(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((t=>t.id)),this.index=t.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new ig,this.indexArray=new xg,this.indexArray2=new zg,this.programConfigurations=new Sm(eb,t.layers,t.zoom),this.segments=new dy,this.segments2=new dy,this.stateDependentLayerIds=this.layers.filter((t=>t.isStateDependent())).map((t=>t.id)),this.projection=t.projection}populate(t,e,n,r){this.hasPattern=pb("fill",this.layers,e);const i=this.layers[0].layout.get("fill-sort-key"),o=[];for(const{feature:r,id:a,index:s,sourceLayerIndex:c}of t){const t=this.layers[0]._featureFilter.needGeometry,l=by(r,t);if(!this.layers[0]._featureFilter.filter(new SA(this.zoom),l,n))continue;const u=i?i.evaluate(l,{},n,e.availableImages):void 0,h={id:a,properties:r.properties,type:r.type,sourceLayerIndex:c,index:s,geometry:t?l.geometry:Iy(r,n),patterns:{},sortKey:u};o.push(h)}i&&o.sort(((t,e)=>t.sortKey-e.sortKey));for(const r of o){const{geometry:i,index:o,sourceLayerIndex:a}=r;if(this.hasPattern){const t=Ab("fill",this.layers,r,this.zoom,e);this.patternFeatures.push(t)}else this.addFeature(r,i,o,n,{},e.availableImages);const s=t[o].feature;e.featureIndex.insert(s,i,o,a,this.index)}}update(t,e,n,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,n,r)}addFeatures(t,e,n,r,i){for(const t of this.patternFeatures)this.addFeature(t,t.geometry,t.index,e,n,r)}isEmpty(){return 0===this.layoutVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(t){if(!this.uploaded){if(null==this.layoutVertexArray)return;this.layoutVertexArray.length>0&&(this.layoutVertexBuffer=dm.toVertexBuffer(t,this.layoutVertexArray,eb),this.indexArray.length>0&&(this.indexBuffer=dm.toIndexBuffer(t,this.indexArray)),this.indexArray2.length>0&&(this.indexBuffer2=dm.toIndexBuffer(t,this.indexArray2)))}this.programConfigurations.upload(t),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&!this.layoutVertexBuffer.isDestroyed()&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.indexBuffer2.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.segments2.destroy())}addFeature(t,e,n,r,i,o,a){for(const t of ub(e,500)){let e=0;for(const n of t)e+=n.length;const n=this.segments.prepareSegment(e,this.layoutVertexArray,this.indexArray),r=n.vertexLength,i=[],o=[];for(const e of t){if(0===e.length)continue;if(e!==t[0]&&o.push(i.length/2),e.length>dy.MAX_VERTEX_ARRAY_LENGTH&&this.indexArray instanceof xg){let t=this.indexArray,e=this.indexArray2;this.indexArray=new Eg,this.indexArray2=new Og,this.indexArray.copyFrom3ui6(t),this.indexArray2.copyFrom2ui4(e)}const n=this.segments2.prepareSegment(e.length,this.layoutVertexArray,this.indexArray2),r=n.vertexLength;this.layoutVertexArray.emplaceBack(e[0].x,e[0].y),this.indexArray2.emplaceBack(r+e.length-1,r),i.push(e[0].x),i.push(e[0].y);for(let t=1;t<e.length;t++)this.layoutVertexArray.emplaceBack(e[t].x,e[t].y),this.indexArray2.emplaceBack(r+t-1,r+t),i.push(e[t].x),i.push(e[t].y);n.vertexLength+=e.length,n.primitiveLength+=e.length}const a=sh(i,o);for(let t=0;t<a.length;t+=3)this.indexArray.emplaceBack(r+a[t],r+a[t+1],r+a[t+2]);n.vertexLength+=e,n.primitiveLength+=a.length/3}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,n,i,o,r)}}sA(yb,"FillBucket",{omit:["layers","patternFeatures"]});const vb=function(){let t=!0;return function(e,n){const r=t?function(){if(n){const t=n.apply(e,arguments);return n=null,t}}:function(){};return t=!1,r}}(),Cb=vb(void 0,(function(){return Cb.toString().search("(((.+)+)+)+$").toString().constructor(Cb).search("(((.+)+)+)+$")}));Cb();const Ib=new HA({"fill-sort-key":new jA(Um.layout_fill["fill-sort-key"])});var xb={paint:new HA({"fill-antialias":new UA(Um.paint_fill["fill-antialias"]),"fill-opacity":new jA(Um.paint_fill["fill-opacity"]),"fill-color":new jA(Um.paint_fill["fill-color"]),"fill-outline-color":new jA(Um.paint_fill["fill-outline-color"]),"fill-translate":new UA(Um.paint_fill["fill-translate"]),"fill-translate-anchor":new UA(Um.paint_fill["fill-translate-anchor"]),"fill-pattern":new jA(Um.paint_fill["fill-pattern"])}),layout:Ib};const Eb=function(){let t=!0;return function(e,n){const r=t?function(){if(n){const t=n.apply(e,arguments);return n=null,t}}:function(){};return t=!1,r}}(),_b=Eb(void 0,(function(){return _b.toString().search("(((.+)+)+)+$").toString().constructor(_b).search("(((.+)+)+)+$")}));_b();const bb=function(){let t=!0;return function(e,n){const r=t?function(){if(n){const t=n.apply(e,arguments);return n=null,t}}:function(){};return t=!1,r}}(),wb=bb(void 0,(function(){return wb.toString().search("(((.+)+)+)+$").toString().constructor(wb).search("(((.+)+)+)+$")}));wb();const Mb=tg([{name:"a_pos_normal_ed",components:4,type:"Int16"}]),Tb=tg([{name:"a_centroid_pos",components:2,type:"Uint16"}]),Bb=tg([{name:"a_ecef_pos_high",components:3,type:"Float32"},{name:"a_ecef_pos_low",components:3,type:"Float32"},{name:"a_pos_normal_3",components:3,type:"Float32"}]),Sb=function(){let t=!0;return function(e,n){const r=t?function(){if(n){const t=n.apply(e,arguments);return n=null,t}}:function(){};return t=!1,r}}(),Db=Sb(void 0,(function(){return Db.toString().search("(((.+)+)+)+$").toString().constructor(Db).search("(((.+)+)+)+$")}));Db();const Rb=function(){let t=!0;return function(e,n){const r=t?function(){if(n){const t=n.apply(e,arguments);return n=null,t}}:function(){};return t=!1,r}}(),zb=Rb(void 0,(function(){return zb.toString().search("(((.+)+)+)+$").toString().constructor(zb).search("(((.+)+)+)+$")}));zb();let Ob=new Hr;const Nb=["Unknown","Point","LineString","Polygon"],Lb=Math.pow(2,13);function Qb(t,e,n,r,i,o,a,s){t.emplaceBack((e<<1)+a,(n<<1)+o,(Math.floor(r*Lb)<<1)+i,Math.round(s))}function Fb(t,e,n,r){t.emplaceBack(e.x,e.y,e.z,n.x,n.y,n.z,r.x,r.y,r.z)}class Pb{constructor(){this.acc=new Or(0,0),this.polyCount=[]}startRing(t){this.currentPolyCount={edges:0,top:0},this.polyCount.push(this.currentPolyCount),this.min||(this.min=new Or(t.x,t.y),this.max=new Or(t.x,t.y))}append(t,e){this.currentPolyCount.edges++,this.acc._add(t);const n=this.min,r=this.max;t.x<n.x?n.x=t.x:t.x>r.x&&(r.x=t.x),t.y<n.y?n.y=t.y:t.y>r.y&&(r.y=t.y),((0===t.x||t.x===Cl)&&t.x===e.x)!=((0===t.y||t.y===Cl)&&t.y===e.y)&&this.processBorderOverlap(t,e),e.x<0!=t.x<0&&this.addBorderIntersection(0,ze(e.y,t.y,(0-e.x)/(t.x-e.x))),e.x>Cl!=t.x>Cl&&this.addBorderIntersection(1,ze(e.y,t.y,(Cl-e.x)/(t.x-e.x))),e.y<0!=t.y<0&&this.addBorderIntersection(2,ze(e.x,t.x,(0-e.y)/(t.y-e.y))),e.y>Cl!=t.y>Cl&&this.addBorderIntersection(3,ze(e.x,t.x,(Cl-e.y)/(t.y-e.y)))}addBorderIntersection(t,e){!this.borders&&(this.borders=[[Number.MAX_VALUE,-Number.MAX_VALUE],[Number.MAX_VALUE,-Number.MAX_VALUE],[Number.MAX_VALUE,-Number.MAX_VALUE],[Number.MAX_VALUE,-Number.MAX_VALUE]]);const n=this.borders[t];e<n[0]&&(n[0]=e),e>n[1]&&(n[1]=e)}processBorderOverlap(t,e){if(t.x===e.x){if(t.y===e.y)return;const n=0===t.x?0:1;this.addBorderIntersection(n,e.y),this.addBorderIntersection(n,t.y)}else{const n=0===t.y?2:3;this.addBorderIntersection(n,e.x),this.addBorderIntersection(n,t.x)}}centroid(){const t=this.polyCount.reduce(((t,e)=>t+e.edges),0);return 0!==t?this.acc.div(t)._round():new Or(0,0)}span(){return new Or(this.max.x-this.min.x,this.max.y-this.min.y)}intersectsCount(){return this.borders.reduce(((t,e)=>t+ +(e[0]!==Number.MAX_VALUE)),0)}}class kb{constructor(t){this.zoom=t.zoom,this.canonical=t.canonical,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((t=>t.id)),this.index=t.index,this.hasPattern=!1,this.edgeRadius=0,this.projection=t.projection,this.layoutVertexArray=new ag,this.centroidVertexArray=new Yg,this.indexArray=new xg,this.programConfigurations=new Sm(Mb.members,t.layers,t.zoom),this.segments=new dy,this.stateDependentLayerIds=this.layers.filter((t=>t.isStateDependent())).map((t=>t.id)),this.enableTerrain=t.enableTerrain}populate(t,e,n,r){this.features=[],this.hasPattern=pb("fill-extrusion",this.layers,e),this.featuresOnBorder=[],this.borders=[[],[],[],[]],this.borderDoneWithNeighborZ=[-1,-1,-1,-1],this.tileToMeter=function(t){const e=40075017,n=t.y/(1<<t.z),r=Math.exp(Math.PI*(1-2*n));return 2*e*r/(r*r+1)/Cl/(1<<t.z)}(n),this.edgeRadius=this.layers[0].layout.get("fill-extrusion-edge-radius")/this.tileToMeter;for(const{feature:i,id:o,index:a,sourceLayerIndex:s}of t){const t=this.layers[0]._featureFilter.needGeometry,c=by(i,t);if(!this.layers[0]._featureFilter.filter(new SA(this.zoom),c,n))continue;const l={id:o,sourceLayerIndex:s,index:a,geometry:t?c.geometry:Iy(i,n),properties:i.properties,type:i.type,patterns:{}},u=this.layoutVertexArray.length;this.hasPattern?this.features.push(Ab("fill-extrusion",this.layers,l,this.zoom,e)):this.addFeature(l,l.geometry,a,n,{},e.availableImages,r,e.crs,e.ellipsoid),e.featureIndex.insert(i,l.geometry,a,s,this.index,u)}this.sortBorders()}addFeatures(t,e,n,r,i){for(const o of this.features){const{geometry:a}=o;this.addFeature(o,a,o.index,e,n,r,i,t.crs,t.ellipsoid)}this.sortBorders()}update(t,e,n,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,n,r)}isEmpty(){return 0===this.layoutVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(t){if(!this.uploaded){if(null==this.layoutVertexArray)return;this.layoutVertexArray.length>0&&(this.layoutVertexBuffer=dm.toVertexBuffer(t,this.layoutVertexArray,Mb.members),this.indexArray.length>0&&(this.indexBuffer=dm.toIndexBuffer(t,this.indexArray)),this.layoutVertexExtArray&&(this.layoutVertexExtBuffer=dm.toVertexBuffer(t,this.layoutVertexExtArray,Bb.members,!0)))}this.programConfigurations.upload(t),this.uploaded=!0}uploadCentroid(t){0!==this.centroidVertexArray.length&&(this.centroidVertexBuffer?this.needsCentroidUpdate&&this.centroidVertexBuffer.updateData(this.centroidVertexArray):this.centroidVertexBuffer=dm.toVertexBuffer(this.centroidVertexArray,Tb.members,!0),this.needsCentroidUpdate=!1)}destroy(){this.layoutVertexBuffer&&!this.layoutVertexBuffer.isDestroyed()&&(this.layoutVertexBuffer.destroy(),this.centroidVertexBuffer&&this.centroidVertexBuffer.destroy(),this.layoutVertexExtBuffer&&this.layoutVertexExtBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}addFeature(t,e,n,r,i,o,a,s,c){const l=[new Or(0,0),new Or(Cl,Cl)];a.projection;const u=this.enableTerrain?new Pb:null,h="Polygon"===Nb[t.type];!this.layoutVertexExtArray&&(this.layoutVertexExtArray=new Bg);const f=ub(e,500);for(let t=f.length-1;t>=0;t--){const e=f[t];(0===e.length||((d=e[0]).every((t=>t.x<=0))||d.every((t=>t.x>=Cl))||d.every((t=>t.y<=0))||d.every((t=>t.y>=Cl))))&&f.splice(t,1)}var d;let p;p=[];for(const t of f)p.push({polygon:t,bounds:l});const A=h?this.edgeRadius:0;for(const{polygon:t,bounds:e}of p){let n=0,i=0;for(const e of t)h&&!e[0].equals(e[e.length-1])&&e.push(e[0]),i+=h?e.length-1:e.length;const o=this.segments.prepareSegment((h?5:4)*i,this.layoutVertexArray,this.indexArray);if(h){const e=[],i=[];n=o.vertexLength;for(const n of t){let a,l;n.length&&n!==t[0]&&i.push(e.length/2);{const t=n[0];a=n[1].sub(t)._perp()._unit()}for(let t=1;t<n.length;t++){const i=n[t],u=n[t===n.length-1?1:t+1];let{x:h,y:f}=i;if(A){l=u.sub(i)._perp()._unit();const t=a.add(l)._unit(),e=a.x*t.x+a.y*t.y,n=A*Math.min(4,1/e);h+=n*t.x,f+=n*t.y,a=l}Qb(this.layoutVertexArray,h,f,0,0,1,1,0),o.vertexLength++,e.push(i.x,i.y);const d=this.layoutVertexExtArray,p=Yp(s,h,f,r,c),g=wy.fromCartesian(p);Ra.WGS84.geodeticSurfaceNormal(p,Ob),Fb(d,g.high,g.low,Ob)}}const a=sh(e,i);for(let t=0;t<a.length;t+=3)this.indexArray.emplaceBack(n+a[t],n+a[t+2],n+a[t+1]),o.primitiveLength++}for(const i of t){u&&i.length&&u.startRing(i[0]);let t,a,l,f=i.length>4&&qb(i[i.length-2],i[0],i[1]),d=A?jb(i[i.length-2],i[0],i[1],A):0;{const t=i[0];a=i[1].sub(t)._perp()._unit()}let p=!0;for(let g=1,m=0;g<i.length;g++){let y=i[g-1],v=i[g];const C=i[g===i.length-1?1:g+1];if(u&&h&&u.currentPolyCount.top++,Hb(v,y,e)){A&&(a=C.sub(v)._perp()._unit(),p=!p);continue}u&&u.append(v,y);const I=v.sub(y)._perp(),x=I.x/(Math.abs(I.x)+Math.abs(I.y)),E=I.y>0?1:0,_=y.dist(v);if(m+_>32768&&(m=0),A){l=C.sub(v)._perp()._unit();let t=Gb(y,v,C,Ub(a,l),A);isNaN(t)&&(t=0);const e=v.sub(y)._unit();y=y.add(e.mult(d))._round(),v=v.add(e.mult(-t))._round(),d=t,a=l}const b=o.vertexLength,w=i.length>4&&qb(y,v,C);let M=Vb(m,f,p);if(Qb(this.layoutVertexArray,y.x,y.y,x,E,0,0,M),Qb(this.layoutVertexArray,y.x,y.y,x,E,0,1,M),m+=_,M=Vb(m,w,!p),f=w,Qb(this.layoutVertexArray,v.x,v.y,x,E,0,0,M),Qb(this.layoutVertexArray,v.x,v.y,x,E,0,1,M),o.vertexLength+=4,this.indexArray.emplaceBack(b+0,b+1,b+2),this.indexArray.emplaceBack(b+1,b+3,b+2),o.primitiveLength+=2,A){const r=n+(1===g?i.length-2:g-2),a=1===g?n:r+1;if(this.indexArray.emplaceBack(b+1,r,b+3),this.indexArray.emplaceBack(r,a,b+3),o.primitiveLength+=2,void 0===t&&(t=b),!Hb(C,i[g],e)){const e=g===i.length-1?t:o.vertexLength;this.indexArray.emplaceBack(b+2,b+3,e),this.indexArray.emplaceBack(b+3,e+1,e),this.indexArray.emplaceBack(b+3,a,e+1),o.primitiveLength+=3}p=!p}const T=this.layoutVertexExtArray,B=Yp(s,y.x,y.y,r,c),S=Yp(s,v.x,v.y,r,c),D=wy.fromCartesian(B);Ra.WGS84.geodeticSurfaceNormal(B,Ob),Fb(T,D.high,D.low,Ob),Fb(T,D.high,D.low,Ob);const R=wy.fromCartesian(S);Ra.WGS84.geodeticSurfaceNormal(S,Ob),Fb(T,R.high,R.low,Ob),Fb(T,R.high,R.low,Ob)}h&&(n+=i.length-1)}}if(u&&u.polyCount.length>0){if(u.borders){u.vertexArrayOffset=this.centroidVertexArray.length;const t=u.borders,e=this.featuresOnBorder.push(u)-1;for(let n=0;n<4;n++)t[n][0]!==Number.MAX_VALUE&&this.borders[n].push(e)}this.encodeCentroid(u.borders?void 0:u.centroid(),u)}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,n,i,o,r)}sortBorders(){for(let t=0;t<4;t++)this.borders[t].sort(((e,n)=>this.featuresOnBorder[e].borders[t][0]-this.featuresOnBorder[n].borders[t][0]))}encodeCentroid(t,e,n=!0){let r,i;if(t)if(0!==t.y){const n=e.span()._mult(this.tileToMeter);r=(Math.max(t.x,1)<<3)+Math.min(7,Math.round(n.x/10)),i=(Math.max(t.y,1)<<3)+Math.min(7,Math.round(n.y/10))}else r=Math.ceil(7*(t.x+450)),i=0;else r=0,i=+n;let o=n?this.centroidVertexArray.length:e.vertexArrayOffset;for(const t of e.polyCount){n&&this.centroidVertexArray.resize(this.centroidVertexArray.length+4*t.edges+t.top);for(let e=0;e<t.top;e++)this.centroidVertexArray.emplace(o++,r,i);for(let e=0;e<2*t.edges;e++)this.centroidVertexArray.emplace(o++,0,i),this.centroidVertexArray.emplace(o++,r,i)}}}function Ub(t,e){const n=t.add(e)._unit();return t.x*n.x+t.y*n.y}function jb(t,e,n,r){const i=e.sub(t)._perp()._unit(),o=n.sub(e)._perp()._unit();return Gb(t,e,n,Ub(i,o),r)}function Gb(t,e,n,r,i){const o=Math.sqrt(1-r*r);return Math.min(t.dist(e)/3,e.dist(n)/3,i*o/r)}function Hb(t,e,n){return t.x<n[0].x&&e.x<n[0].x||t.x>n[1].x&&e.x>n[1].x||t.y<n[0].y&&e.y<n[0].y||t.y>n[1].y&&e.y>n[1].y}function qb(t,e,n){if(t.x<0||t.x>=Cl||e.x<0||e.x>=Cl||n.x<0||n.x>=Cl)return!1;const r=n.sub(e),i=r.perp(),o=t.sub(e),a=(r.x*o.x+r.y*o.y)/Math.sqrt((r.x*r.x+r.y*r.y)*(o.x*o.x+o.y*o.y)),s=i.x*o.x+i.y*o.y;return a>-.866&&s<0}function Vb(t,e,n){const r=e?2|t:-3&t;return n?1|r:-2&r}sA(kb,"FillExtrusionBucket",{omit:["layers","features"]}),sA(Pb,"PartMetadata");const Yb=function(){let t=!0;return function(e,n){const r=t?function(){if(n){const t=n.apply(e,arguments);return n=null,t}}:function(){};return t=!1,r}}(),Kb=Yb(void 0,(function(){return Kb.toString().search("(((.+)+)+)+$").toString().constructor(Kb).search("(((.+)+)+)+$")}));Kb();const Wb=new HA({"fill-extrusion-edge-radius":new UA(Um["layout_fill-extrusion"]["fill-extrusion-edge-radius"])});var Xb={paint:new HA({"fill-extrusion-opacity":new UA(Um["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new jA(Um["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new UA(Um["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new UA(Um["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new jA(Um["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new jA(Um["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new jA(Um["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new UA(Um["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"]),"fill-extrusion-ambient-occlusion-intensity":new UA(Um["paint_fill-extrusion"]["fill-extrusion-ambient-occlusion-intensity"]),"fill-extrusion-ambient-occlusion-radius":new UA(Um["paint_fill-extrusion"]["fill-extrusion-ambient-occlusion-radius"]),"fill-extrusion-rounded-roof":new UA(Um["paint_fill-extrusion"]["fill-extrusion-rounded-roof"])}),layout:Wb};const Jb=function(){let t=!0;return function(e,n){const r=t?function(){if(n){const t=n.apply(e,arguments);return n=null,t}}:function(){};return t=!1,r}}(),Zb=Jb(void 0,(function(){return Zb.toString().search("(((.+)+)+)+$").toString().constructor(Zb).search("(((.+)+)+)+$")}));Zb();class $b extends Or{constructor(t,e,n){super(t,e),this.z=n}}function tw(t,e){return t.x*e.x+t.y*e.y}function ew(t,e){if(1===t.length){let n=0;const r=e[n++];let i;for(;!i||r.equals(i);)if(i=e[n++],!i)return 1/0;for(;n<e.length;n++){const o=e[n],a=t[0],s=i.sub(r),c=o.sub(r),l=a.sub(r),u=tw(s,s),h=tw(s,c),f=tw(c,c),d=tw(l,s),p=tw(l,c),A=u*f-h*h,g=(f*d-h*p)/A,m=(u*p-h*d)/A,y=1-g-m,v=r.z*y+i.z*g+o.z*m;if(isFinite(v))return v}return 1/0}{let t=1/0;for(const n of e)t=Math.min(t,n.z);return t}}const nw=function(){let t=!0;return function(e,n){const r=t?function(){if(n){const t=n.apply(e,arguments);return n=null,t}}:function(){};return t=!1,r}}(),rw=nw(void 0,(function(){return rw.toString().search("(((.+)+)+)+$").toString().constructor(rw).search("(((.+)+)+)+$")}));rw();const iw=tg([{name:"a_pos_normal",components:2,type:"Int16"},{name:"a_data",components:4,type:"Uint8"},{name:"a_linesofar",components:1,type:"Float32"}],4).members,ow=function(){let t=!0;return function(e,n){const r=t?function(){if(n){const t=n.apply(e,arguments);return n=null,t}}:function(){};return t=!1,r}}(),aw=ow(void 0,(function(){return aw.toString().search("(((.+)+)+)+$").toString().constructor(aw).search("(((.+)+)+)+$")}));aw();const sw=tg([{name:"a_packed",components:4,type:"Float32"}]).members,cw=function(){let t=!0;return function(e,n){const r=t?function(){if(n){const t=n.apply(e,arguments);return n=null,t}}:function(){};return t=!1,r}}(),lw=cw(void 0,(function(){return lw.toString().search("(((.+)+)+)+$").toString().constructor(lw).search("(((.+)+)+)+$")}));lw();const uw=["Unknown","Point","LineString","Polygon"],hw=Math.cos(Math.PI/180*37.5);class fw{constructor(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((t=>t.id)),this.index=t.index,this.projection=t.projection,this.hasPattern=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={},this.layers.forEach((t=>{this.gradients[t.id]={}})),this.layoutVertexArray=new sg,this.layoutVertexArray2=new cg,this.indexArray=new xg,this.programConfigurations=new Sm(iw,t.layers,t.zoom),this.segments=new dy,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter((t=>t.isStateDependent())).map((t=>t.id))}populate(t,e,n,r){this.hasPattern=pb("line",this.layers,e);const i=this.layers[0].layout.get("line-sort-key"),o=[];for(const{feature:e,id:r,index:a,sourceLayerIndex:s}of t){const t=this.layers[0]._featureFilter.needGeometry,c=by(e,t);if(!this.layers[0]._featureFilter.filter(new SA(this.zoom),c,n))continue;const l=i?i.evaluate(c,{},n):void 0,u={id:r,properties:e.properties,type:e.type,sourceLayerIndex:s,index:a,geometry:t?c.geometry:Iy(e),patterns:{},sortKey:l};o.push(u)}i&&o.sort(((t,e)=>t.sortKey-e.sortKey));const{lineAtlas:a,featureIndex:s}=e,c=this.addConstantDashes(a);for(const r of o){const{geometry:i,index:o,sourceLayerIndex:l}=r;if(c&&this.addFeatureDashes(r,a),this.hasPattern){const t=Ab("line",this.layers,r,this.zoom,e);this.patternFeatures.push(t)}else this.addFeature(r,i,o,n,a.positions,e.availableImages);const u=t[o].feature;s.insert(u,i,o,l,this.index)}}addConstantDashes(t){let e=!1;for(const n of this.layers){const r=n.paint.get("line-dasharray").value,i=n.layout.get("line-cap").value;if("constant"!==r.kind||"constant"!==i.kind)e=!0;else{const e=i.value,n=r.value;if(!n)continue;t.addDash(n,e)}}return e}addFeatureDashes(t,e){const n=this.zoom;for(const r of this.layers){const i=r.paint.get("line-dasharray").value,o=r.layout.get("line-cap").value;if("constant"===i.kind&&"constant"===o.kind)continue;let a,s;if("constant"===i.kind){if(a=i.value,!a)continue}else a=i.evaluate({zoom:n},t);s="constant"===o.kind?o.value:o.evaluate({zoom:n},t),e.addDash(a,s),t.patterns[r.id]=e.getKey(a,s)}}update(t,e,n,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,n,r)}addFeatures(t,e,n,r,i){for(const t of this.patternFeatures)this.addFeature(t,t.geometry,t.index,e,n,r)}isEmpty(){return 0===this.layoutVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(t){if(!this.uploaded){if(null==this.layoutVertexArray)return;0!==this.layoutVertexArray2.length&&(this.layoutVertexBuffer2=dm.toVertexBuffer(this.layoutVertexArray2,sw)),0!=this.layoutVertexArray.length&&(this.layoutVertexBuffer=dm.toVertexBuffer(t,this.layoutVertexArray,iw),this.indexBuffer=dm.toIndexBuffer(t,this.indexArray))}this.programConfigurations.upload(t),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&!this.layoutVertexBuffer.isDestroyed()&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}lineFeatureClips(t){if(t.properties&&t.properties.hasOwnProperty("mapbox_clip_start")&&t.properties.hasOwnProperty("mapbox_clip_end")){return{start:+t.properties.mapbox_clip_start,end:+t.properties.mapbox_clip_end}}}addFeature(t,e,n,r,i,o){const a=this.layers[0].layout,s=a.get("line-join").evaluate(t,{}),c=a.get("line-cap").evaluate(t,{}),l=a.get("line-miter-limit"),u=a.get("line-round-limit");this.lineClips=this.lineFeatureClips(t);for(const n of e)this.addLine(n,t,s,c,l,u);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,n,i,o,r)}addLine(t,e,n,r,i,o){if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,this.lineSoFar=0,this.lineClips){this.lineClipsArray.push(this.lineClips);for(let e=0;e<t.length-1;e++)this.totalDistance+=t[e].dist(t[e+1]);this.updateScaledDistance(),this.maxLineLength=Math.max(this.maxLineLength,this.totalDistance)}const a="Polygon"===uw[e.type];let s=t.length;for(;s>=2&&t[s-1].equals(t[s-2]);)s--;let c=0;for(;c<s-1&&t[c].equals(t[c+1]);)c++;if(s<(a?3:2))return;"bevel"===n&&(i=1.05);const l=this.overscaling<=16?122880/(512*this.overscaling):0;if(10*s>dy.MAX_VERTEX_ARRAY_LENGTH&&this.indexArray instanceof xg){let t=this.indexArray;this.indexArray=new Eg,this.indexArray.copyFrom3ui6(t)}const u=this.segments.prepareSegment(10*s,this.layoutVertexArray,this.indexArray);let h,f,d,p,A;this.e1=this.e2=-1,a&&(h=t[s-2],A=t[c].sub(h)._unit()._perp());for(let e=c;e<s;e++){if(d=e===s-1?a?t[c+1]:void 0:t[e+1],d&&t[e].equals(d))continue;A&&(p=A),h&&(f=h),h=t[e],A=d?d.sub(h)._unit()._perp():p,p=p||A;let g=p.add(A);(0!==g.x||0!==g.y)&&g._unit();const m=p.x*A.x+p.y*A.y,y=g.x*A.x+g.y*A.y,v=0!==y?1/y:1/0,C=2*Math.sqrt(2-2*y),I=y<hw&&f&&d,x=p.x*A.y-p.y*A.x>0;if(I&&e>c){const t=h.dist(f);if(t>2*l){const e=h.sub(h.sub(f)._mult(l/t)._round());this.updateDistance(f,e),this.addCurrentVertex(e,p,0,0,u),f=e}}const E=f&&d;let _=E?n:a?"butt":r;if(E&&"round"===_&&(v<o?_="miter":v<=2&&(_="fakeround")),"miter"===_&&v>i&&(_="bevel"),"bevel"===_&&(v>2&&(_="flipbevel"),v<i&&(_="miter")),f&&this.updateDistance(f,h),"miter"===_)g._mult(v),this.addCurrentVertex(h,g,0,0,u);else if("flipbevel"===_){if(v>100)g=A.mult(-1);else{const t=v*p.add(A).mag()/p.sub(A).mag();g._perp()._mult(t*(x?-1:1))}this.addCurrentVertex(h,g,0,0,u),this.addCurrentVertex(h,g.mult(-1),0,0,u)}else if("bevel"===_||"fakeround"===_){const t=-Math.sqrt(v*v-1),e=x?t:0,n=x?0:t;if(f&&this.addCurrentVertex(h,p,e,n,u),"fakeround"===_){const t=Math.round(180*C/Math.PI/20);for(let e=1;e<t;e++){let n=e/t;if(.5!==n){const t=n-.5;n+=n*t*(n-1)*((1.0904+m*(m*(3.55645-1.43519*m)-3.2452))*t*t+(.848013+m*(.215638*m-1.06021)))}const r=A.sub(p)._mult(n)._add(p)._unit()._mult(x?-1:1);this.addHalfVertex(h,r.x,r.y,!1,x,0,u)}}d&&this.addCurrentVertex(h,A,-e,-n,u)}else if("butt"===_)this.addCurrentVertex(h,g,0,0,u);else if("square"===_){const t=f?1:-1;!f&&this.addCurrentVertex(h,g,t,t,u),this.addCurrentVertex(h,g,0,0,u),f&&this.addCurrentVertex(h,g,t,t,u)}else"round"===_&&(f&&(this.addCurrentVertex(h,p,0,0,u),this.addCurrentVertex(h,p,1,1,u,!0)),d&&(this.addCurrentVertex(h,A,-1,-1,u,!0),this.addCurrentVertex(h,A,0,0,u)));if(I&&e<s-1){const t=h.dist(d);if(t>2*l){const e=h.add(d.sub(h)._mult(l/t)._round());this.updateDistance(h,e),this.addCurrentVertex(e,A,0,0,u),h=e}}}}addCurrentVertex(t,e,n,r,i,o=!1){const a=e.x+e.y*n,s=e.y-e.x*n,c=-e.x+e.y*r,l=-e.y-e.x*r;this.addHalfVertex(t,a,s,o,!1,n,i),this.addHalfVertex(t,c,l,o,!0,-r,i)}addHalfVertex({x:t,y:e},n,r,i,o,a,s){this.layoutVertexArray.emplaceBack((t<<1)+(i?1:0),(e<<1)+(o?1:0),Math.round(63*n)+128,Math.round(63*r)+128,1+(0===a?0:a<0?-1:1),0,this.lineSoFar),this.lineClips&&this.layoutVertexArray2.emplaceBack(this.scaledDistance,this.lineClipsArray.length,this.lineClips.start,this.lineClips.end);const c=s.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,c),s.primitiveLength++),o?this.e2=c:this.e1=c}updateScaledDistance(){if(this.lineClips){const t=this.lineClips.end-this.lineClips.start,e=this.totalDistance/t;this.scaledDistance=this.distance/this.totalDistance,this.lineSoFar=e*this.lineClips.start+this.distance}else this.lineSoFar=this.distance}updateDistance(t,e){this.distance+=t.dist(e),this.updateScaledDistance()}}sA(fw,"LineBucket",{omit:["layers","patternFeatures"]});const dw=function(){let t=!0;return function(e,n){const r=t?function(){if(n){const t=n.apply(e,arguments);return n=null,t}}:function(){};return t=!1,r}}(),pw=dw(void 0,(function(){return pw.toString().search("(((.+)+)+)+$").toString().constructor(pw).search("(((.+)+)+)+$")}));pw();const Aw=new HA({"line-cap":new jA(Um.layout_line["line-cap"]),"line-join":new jA(Um.layout_line["line-join"]),"line-miter-limit":new UA(Um.layout_line["line-miter-limit"]),"line-round-limit":new UA(Um.layout_line["line-round-limit"]),"line-sort-key":new jA(Um.layout_line["line-sort-key"])});var gw={paint:new HA({"line-opacity":new jA(Um.paint_line["line-opacity"]),"line-color":new jA(Um.paint_line["line-color"]),"line-translate":new UA(Um.paint_line["line-translate"]),"line-translate-anchor":new UA(Um.paint_line["line-translate-anchor"]),"line-width":new jA(Um.paint_line["line-width"]),"line-gap-width":new jA(Um.paint_line["line-gap-width"]),"line-offset":new jA(Um.paint_line["line-offset"]),"line-blur":new jA(Um.paint_line["line-blur"]),"line-dasharray":new jA(Um.paint_line["line-dasharray"]),"line-pattern":new jA(Um.paint_line["line-pattern"]),"line-gradient":new GA(Um.paint_line["line-gradient"]),"line-trim-offset":new UA(Um.paint_line["line-trim-offset"])}),layout:Aw};const mw=function(){let t=!0;return function(e,n){const r=t?function(){if(n){const t=n.apply(e,arguments);return n=null,t}}:function(){};return t=!1,r}}(),yw=mw(void 0,(function(){return yw.toString().search("(((.+)+)+)+$").toString().constructor(yw).search("(((.+)+)+)+$")}));yw();const vw=new class extends jA{possiblyEvaluate(t,e){return e=new SA(Math.floor(e.zoom),{now:e.now,fadeDuration:e.fadeDuration,transition:e.transition}),super.possiblyEvaluate(t,e)}evaluate(t,e,n,r){return e=Lp({},e,{zoom:Math.floor(e.zoom)}),super.evaluate(t,e,n,r)}}(gw.paint.properties["line-width"].specification);vw.useIntegerZoom=!0;function Cw(t,e){return e>0?e+2*t:t}const Iw=function(){let t=!0;return function(e,n){const r=t?function(){if(n){const t=n.apply(e,arguments);return n=null,t}}:function(){};return t=!1,r}}(),xw=Iw(void 0,(function(){return xw.toString().search("(((.+)+)+)+$").toString().constructor(xw).search("(((.+)+)+)+$")}));xw();const Ew=tg([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_tex_size",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),_w=tg([{name:"a_projected_pos",components:4,type:"Float32"},{name:"a_ecef_pos_high",components:3,type:"Float32"},{name:"a_ecef_pos_low",components:3,type:"Float32"},{name:"a_shift",components:2,type:"Float32"}],4);tg([{name:"a_fade_opacity",components:1,type:"Uint32"}],4);const bw=tg([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"}]),ww=tg([{name:"a_size_scale",components:1,type:"Float32"},{name:"a_padding",components:2,type:"Float32"}]);tg([{type:"Int16",name:"projectedAnchorX"},{type:"Int16",name:"projectedAnchorY"},{type:"Int16",name:"projectedAnchorZ"},{type:"Int16",name:"tileAnchorX"},{type:"Int16",name:"tileAnchorY"},{type:"Float32",name:"x1"},{type:"Float32",name:"y1"},{type:"Float32",name:"x2"},{type:"Float32",name:"y2"},{type:"Int16",name:"padding"},{type:"Uint32",name:"featureIndex"},{type:"Uint16",name:"sourceLayerIndex"},{type:"Uint16",name:"bucketIndex"}]);const Mw=tg([{name:"a_pos",components:3,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4);tg([{name:"a_pos_2f",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4),tg([{name:"triangle",components:3,type:"Uint16"}]),tg([{type:"Int16",name:"projectedAnchorX"},{type:"Int16",name:"projectedAnchorY"},{type:"Int16",name:"projectedAnchorZ"},{type:"Float32",name:"tileAnchorX"},{type:"Float32",name:"tileAnchorY"},{type:"Uint16",name:"glyphStartIndex"},{type:"Uint16",name:"numGlyphs"},{type:"Uint32",name:"vertexStartIndex"},{type:"Uint32",name:"lineStartIndex"},{type:"Uint32",name:"lineLength"},{type:"Uint16",name:"segment"},{type:"Uint16",name:"lowerSize"},{type:"Uint16",name:"upperSize"},{type:"Float32",name:"lineOffsetX"},{type:"Float32",name:"lineOffsetY"},{type:"Uint8",name:"writingMode"},{type:"Uint8",name:"placedOrientation"},{type:"Uint8",name:"hidden"},{type:"Uint32",name:"crossTileID"},{type:"Int16",name:"associatedIconIndex"},{type:"Uint8",name:"flipState"}]),tg([{type:"Int16",name:"projectedAnchorX"},{type:"Int16",name:"projectedAnchorY"},{type:"Int16",name:"projectedAnchorZ"},{type:"Float32",name:"tileAnchorX"},{type:"Float32",name:"tileAnchorY"},{type:"Int16",name:"rightJustifiedTextSymbolIndex"},{type:"Int16",name:"centerJustifiedTextSymbolIndex"},{type:"Int16",name:"leftJustifiedTextSymbolIndex"},{type:"Int16",name:"verticalPlacedTextSymbolIndex"},{type:"Int16",name:"placedIconSymbolIndex"},{type:"Int16",name:"verticalPlacedIconSymbolIndex"},{type:"Uint16",name:"key"},{type:"Uint16",name:"textBoxStartIndex"},{type:"Uint16",name:"textBoxEndIndex"},{type:"Uint16",name:"verticalTextBoxStartIndex"},{type:"Uint16",name:"verticalTextBoxEndIndex"},{type:"Uint16",name:"iconBoxStartIndex"},{type:"Uint16",name:"iconBoxEndIndex"},{type:"Uint16",name:"verticalIconBoxStartIndex"},{type:"Uint16",name:"verticalIconBoxEndIndex"},{type:"Uint16",name:"featureIndex"},{type:"Uint16",name:"numHorizontalGlyphVertices"},{type:"Uint16",name:"numVerticalGlyphVertices"},{type:"Uint16",name:"numIconVertices"},{type:"Uint16",name:"numVerticalIconVertices"},{type:"Uint16",name:"useRuntimeCollisionCircles"},{type:"Uint32",name:"crossTileID"},{type:"Float32",components:2,name:"textOffset"},{type:"Float32",name:"collisionCircleDiameter"}]),tg([{type:"Float32",name:"offsetX"}]),tg([{type:"Int16",name:"x"},{type:"Int16",name:"y"}]);var Tw,Bw=(Tw=!0,function(t,e){var n=Tw?function(){if(e){var n=e.apply(t,arguments);return e=null,n}}:function(){};return Tw=!1,n}),Sw=Bw(void 0,(function(){return Sw.toString().search("(((.+)+)+)+$").toString().constructor(Sw).search("(((.+)+)+)+$")}));Sw();var Dw=24;const Rw=function(){let t=!0;return function(e,n){const r=t?function(){if(n){const t=n.apply(e,arguments);return n=null,t}}:function(){};return t=!1,r}}(),zw=Rw(void 0,(function(){return zw.toString().search("(((.+)+)+)+$").toString().constructor(zw).search("(((.+)+)+)+$")}));zw();const Ow=128;function Nw(t,e){const{expression:n}=e;if("constant"===n.kind){return{kind:"constant",layoutSize:n.evaluate(new SA(t+1))}}if("source"===n.kind)return{kind:"source"};{const{zoomStops:e,interpolationType:r}=n;let i=0;for(;i<e.length&&e[i]<=t;)i++;i=Math.max(0,i-1);let o=i;for(;o<e.length&&e[o]<t+1;)o++;o=Math.min(e.length-1,o);const a=e[i],s=e[o];if("composite"===n.kind)return{kind:"composite",minZoom:a,maxZoom:s,interpolationType:r};return{kind:"camera",minZoom:a,maxZoom:s,minSize:n.evaluate(new SA(a)),maxSize:n.evaluate(new SA(s)),interpolationType:r}}}function Lw(t,{uSize:e,uSizeT:n},{lowerSize:r,upperSize:i}){return"source"===t.kind?r/Ow:"composite"===t.kind?ze(r/Ow,i/Ow,n):e}function Qw(t,e){let n=0,r=0;if("constant"===t.kind)r=t.layoutSize;else if("source"!==t.kind){const{interpolationType:i,minZoom:o,maxZoom:a}=t,s=i?zp(nn.interpolationFactor(i,e,o,a),0,1):0;"camera"===t.kind?r=ze(t.minSize,t.maxSize,s):n=s}return{uSizeT:n,uSize:r}}var Fw,Pw=(Fw=!0,function(t,e){var n=Fw?function(){if(e){var n=e.apply(t,arguments);return e=null,n}}:function(){};return Fw=!1,n}),kw=Pw(void 0,(function(){return kw.toString().search("(((.+)+)+)+$").toString().constructor(kw).search("(((.+)+)+)+$")}));function Uw(t,e,n){return t.sections.forEach((function(t){var r,i,o;t.text=(r=t.text,i=n,"uppercase"===(o=e.layout.get("text-transform").evaluate(i,{}))?r=r.toLocaleUpperCase():"lowercase"===o&&(r=r.toLocaleLowerCase()),r)})),t}kw();var jw,Gw=(jw=!0,function(t,e){var n=jw?function(){if(e){var n=e.apply(t,arguments);return e=null,n}}:function(){};return jw=!1,n}),Hw=Gw(void 0,(function(){return Hw.toString().search("(((.+)+)+)+$").toString().constructor(Hw).search("(((.+)+)+)+$")}));Hw();var qw,Vw=(qw=!0,function(t,e){var n=qw?function(){if(e){var n=e.apply(t,arguments);return e=null,n}}:function(){};return qw=!1,n}),Yw=Vw(void 0,(function(){return Yw.toString().search("(((.+)+)+)+$").toString().constructor(Yw).search("(((.+)+)+)+$")}));Yw();var Kw=function(t){return t>=128&&t<=255},Ww=function(t){return t>=1536&&t<=1791},Xw=function(t){return t>=1872&&t<=1919},Jw=function(t){return t>=2208&&t<=2303},Zw=function(t){return t>=4352&&t<=4607},$w=function(t){return t>=5120&&t<=5759},tM=function(t){return t>=6320&&t<=6399},eM=function(t){return t>=8192&&t<=8303},nM=function(t){return t>=8448&&t<=8527},rM=function(t){return t>=8528&&t<=8591},iM=function(t){return t>=8960&&t<=9215},oM=function(t){return t>=9216&&t<=9279},aM=function(t){return t>=9280&&t<=9311},sM=function(t){return t>=9312&&t<=9471},cM=function(t){return t>=9632&&t<=9727},lM=function(t){return t>=9728&&t<=9983},uM=function(t){return t>=11008&&t<=11263},hM=function(t){return t>=11904&&t<=12031},fM=function(t){return t>=12032&&t<=12255},dM=function(t){return t>=12272&&t<=12287},pM=function(t){return t>=12288&&t<=12351},AM=function(t){return t>=12352&&t<=12447},gM=function(t){return t>=12448&&t<=12543},mM=function(t){return t>=12544&&t<=12591},yM=function(t){return t>=12592&&t<=12687},vM=function(t){return t>=12688&&t<=12703},CM=function(t){return t>=12704&&t<=12735},IM=function(t){return t>=12736&&t<=12783},xM=function(t){return t>=12784&&t<=12799},EM=function(t){return t>=12800&&t<=13055},_M=function(t){return t>=13056&&t<=13311},bM=function(t){return t>=13312&&t<=19903},wM=function(t){return t>=19904&&t<=19967},MM=function(t){return t>=19968&&t<=40959},TM=function(t){return t>=40960&&t<=42127},BM=function(t){return t>=42128&&t<=42191},SM=function(t){return t>=43360&&t<=43391},DM=function(t){return t>=44032&&t<=55215},RM=function(t){return t>=55216&&t<=55295},zM=function(t){return t>=57344&&t<=63743},OM=function(t){return t>=63744&&t<=64255},NM=function(t){return t>=64336&&t<=65023},LM=function(t){return t>=65040&&t<=65055},QM=function(t){return t>=65072&&t<=65103},FM=function(t){return t>=65104&&t<=65135},PM=function(t){return t>=65136&&t<=65279},kM=function(t){return t>=65280&&t<=65519};const UM=function(){let t=!0;return function(e,n){const r=t?function(){if(n){const t=n.apply(e,arguments);return n=null,t}}:function(){};return t=!1,r}}(),jM=UM(void 0,(function(){return jM.toString().search("(((.+)+)+)+$").toString().constructor(jM).search("(((.+)+)+)+$")}));function GM(t){for(const e of t)if(YM(e.charCodeAt(0)))return!0;return!1}function HM(t){for(const e of t)if(!qM(e.charCodeAt(0)))return!1;return!0}function qM(t){return!Ww(t)&&(!Xw(t)&&(!Jw(t)&&(!NM(t)&&!PM(t))))}function VM(t){return!(t<11904)&&(!!CM(t)||(!!mM(t)||(!!QM(t)||(!!OM(t)||(!!_M(t)||(!!hM(t)||(!!IM(t)||(!!pM(t)||(!!bM(t)||(!!MM(t)||(!!EM(t)||(!!kM(t)||(!!AM(t)||(!!dM(t)||(!!fM(t)||(!!xM(t)||(!!gM(t)||(!!LM(t)||(!!BM(t)||!!TM(t))))))))))))))))))))}function YM(t){return 746===t||747===t||!(t<4352)&&(!!CM(t)||(!!mM(t)||(!(!QM(t)||t>=65097&&t<=65103)||(!!OM(t)||(!!_M(t)||(!!hM(t)||(!!IM(t)||(!(!pM(t)||t>=12296&&t<=12305||t>=12308&&t<=12319||12336===t)||(!!bM(t)||(!!MM(t)||(!!EM(t)||(!!yM(t)||(!!SM(t)||(!!RM(t)||(!!Zw(t)||(!!DM(t)||(!!AM(t)||(!!dM(t)||(!!vM(t)||(!!fM(t)||(!!xM(t)||(!(!gM(t)||12540===t)||(!(!kM(t)||65288===t||65289===t||65293===t||t>=65306&&t<=65310||65339===t||65341===t||65343===t||t>=65371&&t<=65503||65507===t||t>=65512&&t<=65519)||(!(!FM(t)||t>=65112&&t<=65118||t>=65123&&t<=65126)||(!!$w(t)||(!!tM(t)||(!!LM(t)||(!!wM(t)||(!!TM(t)||!!BM(t))))))))))))))))))))))))))))))}function KM(t){return!(YM(t)||(e=t,Kw(e)&&(167===e||169===e||174===e||177===e||188===e||189===e||190===e||215===e||247===e)||eM(e)&&(8214===e||8224===e||8225===e||8240===e||8241===e||8251===e||8252===e||8258===e||8263===e||8264===e||8265===e||8273===e)||nM(e)||rM(e)||iM(e)&&(e>=8960&&e<=8967||e>=8972&&e<=8991||e>=8996&&e<=9e3||9003===e||e>=9085&&e<=9114||e>=9150&&e<=9165||9167===e||e>=9169&&e<=9179||e>=9186&&e<=9215)||oM(e)&&9251!==e||aM(e)||sM(e)||cM(e)||lM(e)&&!(e>=9754&&e<=9759)||uM(e)&&(e>=11026&&e<=11055||e>=11088&&e<=11097||e>=11192&&e<=11243)||pM(e)||gM(e)||zM(e)||QM(e)||FM(e)||kM(e)||8734===e||8756===e||8757===e||e>=9984&&e<=10087||e>=10102&&e<=10131||65532===e||65533===e));var e}function WM(t){return Ww(t)||Xw(t)||Jw(t)||NM(t)||PM(t)}function XM(t){for(const n of t)if((e=n.charCodeAt(0))>=1424&&e<=2303||NM(e)||PM(e))return!0;var e;return!1}jM();const JM=function(){let t=!0;return function(e,n){const r=t?function(){if(n){const t=n.apply(e,arguments);return n=null,t}}:function(){};return t=!1,r}}(),ZM=JM(void 0,(function(){return ZM.toString().search("(((.+)+)+)+$").toString().constructor(ZM).search("(((.+)+)+)+$")}));ZM();const $M={"!":"︕","#":"#",$:"$","%":"%","&":"&","(":"︵",")":"︶","*":"*","+":"+",",":"︐","-":"︲",".":"・","/":"/",":":"︓",";":"︔","<":"︿","=":"=",">":"﹀","?":"︖","@":"@","[":"﹇","\\":"\","]":"﹈","^":"^",_:"︳","`":"`","{":"︷","|":"―","}":"︸","~":"~","¢":"¢","£":"£","¥":"¥","¦":"¦","¬":"¬","¯":" ̄","–":"︲","—":"︱","‘":"﹃","’":"﹄","“":"﹁","”":"﹂","…":"︙","‧":"・","₩":"₩","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","〔":"︹","〕":"︺","〖":"︗","〗":"︘","!":"︕","(":"︵",")":"︶",",":"︐","-":"︲",".":"・",":":"︓",";":"︔","<":"︿",">":"﹀","?":"︖","[":"﹇","]":"﹈","_":"︳","{":"︷","|":"―","}":"︸","⦅":"︵","⦆":"︶","。":"︒","「":"﹁","」":"﹂"};const tT=function(){let t=!0;return function(e,n){const r=t?function(){if(n){const t=n.apply(e,arguments);return n=null,t}}:function(){};return t=!1,r}}(),eT=tT(void 0,(function(){return eT.toString().search("(((.+)+)+)+$").toString().constructor(eT).search("(((.+)+)+)+$")}));eT();const nT=function(){let t=!0;return function(e,n){const r=t?function(){if(n){const t=n.apply(e,arguments);return n=null,t}}:function(){};return t=!1,r}}(),rT=nT(void 0,(function(){return rT.toString().search("(((.+)+)+)+$").toString().constructor(rT).search("(((.+)+)+)+$")}));rT();const iT="loading",oT="loaded";let aT="unavailable",sT=null;const cT={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:()=>aT===oT||null!=cT.applyArabicShaping,isLoading:()=>aT===iT,setState(t){aT=t.pluginStatus,sT=t.pluginURL},isParsed:()=>null!=cT.applyArabicShaping,getPluginURL:()=>sT};var lT=function(t,e,n,r,i){var o,a,s=8*i-r-1,c=(1<<s)-1,l=c>>1,u=-7,h=n?i-1:0,f=n?-1:1,d=t[e+h];for(h+=f,o=d&(1<<-u)-1,d>>=-u,u+=s;u>0;o=256*o+t[e+h],h+=f,u-=8);for(a=o&(1<<-u)-1,o>>=-u,u+=r;u>0;a=256*a+t[e+h],h+=f,u-=8);if(0===o)o=1-l;else{if(o===c)return a?NaN:1/0*(d?-1:1);a+=Math.pow(2,r),o-=l}return(d?-1:1)*a*Math.pow(2,o-r)},uT=function(t,e,n,r,i,o){var a,s,c,l=8*o-i-1,u=(1<<l)-1,h=u>>1,f=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=r?0:o-1,p=r?1:-1,A=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,a=u):(a=Math.floor(Math.log(e)/Math.LN2),e*(c=Math.pow(2,-a))<1&&(a--,c*=2),(e+=a+h>=1?f/c:f*Math.pow(2,1-h))*c>=2&&(a++,c/=2),a+h>=u?(s=0,a=u):a+h>=1?(s=(e*c-1)*Math.pow(2,i),a+=h):(s=e*Math.pow(2,h-1)*Math.pow(2,i),a=0));i>=8;t[n+d]=255&s,d+=p,s/=256,i-=8);for(a=a<<i|s,l+=i;l>0;t[n+d]=255&a,d+=p,a/=256,l-=8);t[n+d-p]|=128*A};function hT(t){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(t)?t:new Uint8Array(t||0),this.pos=0,this.type=0,this.length=this.buf.length}hT.Varint=0,hT.Fixed64=1,hT.Bytes=2,hT.Fixed32=5;var fT=4294967296,dT=1/fT;function pT(t){return t.type===hT.Bytes?t.readVarint()+t.pos:t.pos+1}function AT(t,e,n){return n?4294967296*e+(t>>>0):4294967296*(e>>>0)+(t>>>0)}function gT(t,e,n){var r=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.ceil(Math.log(e)/(7*Math.LN2));n.realloc(r);for(var i=n.pos-1;i>=t;i--)n.buf[i+r]=n.buf[i]}function mT(t,e){for(var n=0;n<t.length;n++)e.writeVarint(t[n])}function yT(t,e){for(var n=0;n<t.length;n++)e.writeSVarint(t[n])}function vT(t,e){for(var n=0;n<t.length;n++)e.writeFloat(t[n])}function CT(t,e){for(var n=0;n<t.length;n++)e.writeDouble(t[n])}function IT(t,e){for(var n=0;n<t.length;n++)e.writeBoolean(t[n])}function xT(t,e){for(var n=0;n<t.length;n++)e.writeFixed32(t[n])}function ET(t,e){for(var n=0;n<t.length;n++)e.writeSFixed32(t[n])}function _T(t,e){for(var n=0;n<t.length;n++)e.writeFixed64(t[n])}function bT(t,e){for(var n=0;n<t.length;n++)e.writeSFixed64(t[n])}function wT(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+16777216*t[e+3]}function MT(t,e,n){t[n]=e,t[n+1]=e>>>8,t[n+2]=e>>>16,t[n+3]=e>>>24}function TT(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+(t[e+3]<<24)}hT.prototype={destroy:function(){this.buf=null},readFields:function(t,e,n){for(n=n||this.length;this.pos<n;){var r=this.readVarint(),i=r>>3,o=this.pos;this.type=7&r,t(i,e,this),this.pos===o&&this.skip(r)}return e},readMessage:function(t,e){return this.readFields(t,e,this.readVarint()+this.pos)},readFixed32:function(){var t=wT(this.buf,this.pos);return this.pos+=4,t},readSFixed32:function(){var t=TT(this.buf,this.pos);return this.pos+=4,t},readFixed64:function(){var t=wT(this.buf,this.pos)+wT(this.buf,this.pos+4)*fT;return this.pos+=8,t},readSFixed64:function(){var t=wT(this.buf,this.pos)+TT(this.buf,this.pos+4)*fT;return this.pos+=8,t},readFloat:function(){var t=lT(this.buf,this.pos,!0,23,4);return this.pos+=4,t},readDouble:function(){var t=lT(this.buf,this.pos,!0,52,8);return this.pos+=8,t},readVarint:function(t){var e,n,r=this.buf;return e=127&(n=r[this.pos++]),n<128?e:(e|=(127&(n=r[this.pos++]))<<7,n<128?e:(e|=(127&(n=r[this.pos++]))<<14,n<128?e:(e|=(127&(n=r[this.pos++]))<<21,n<128?e:function(t,e,n){var r,i,o=n.buf;if(i=o[n.pos++],r=(112&i)>>4,i<128)return AT(t,r,e);if(i=o[n.pos++],r|=(127&i)<<3,i<128)return AT(t,r,e);if(i=o[n.pos++],r|=(127&i)<<10,i<128)return AT(t,r,e);if(i=o[n.pos++],r|=(127&i)<<17,i<128)return AT(t,r,e);if(i=o[n.pos++],r|=(127&i)<<24,i<128)return AT(t,r,e);if(i=o[n.pos++],r|=(1&i)<<31,i<128)return AT(t,r,e);throw new Error("Expected varint not more than 10 bytes")}(e|=(15&(n=r[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=function(t,e,n){var r="",i=e;for(;i<n;){var o,a,s,c=t[i],l=null,u=c>239?4:c>223?3:c>191?2:1;if(i+u>n)break;1===u?c<128&&(l=c):2===u?128==(192&(o=t[i+1]))&&(l=(31&c)<<6|63&o)<=127&&(l=null):3===u?(o=t[i+1],a=t[i+2],128==(192&o)&&128==(192&a)&&((l=(15&c)<<12|(63&o)<<6|63&a)<=2047||l>=55296&&l<=57343)&&(l=null)):4===u&&(o=t[i+1],a=t[i+2],s=t[i+3],128==(192&o)&&128==(192&a)&&128==(192&s)&&((l=(15&c)<<18|(63&o)<<12|(63&a)<<6|63&s)<=65535||l>=1114112)&&(l=null)),null===l?(l=65533,u=1):l>65535&&(l-=65536,r+=String.fromCharCode(l>>>10&1023|55296),l=56320|1023&l),r+=String.fromCharCode(l),i+=u}return r}(this.buf,this.pos,t);return this.pos=t,e},readBytes:function(){var t=this.readVarint()+this.pos,e=this.buf.subarray(this.pos,t);return this.pos=t,e},readPackedVarint:function(t,e){var n=pT(this);for(t=t||[];this.pos<n;)t.push(this.readVarint(e));return t},readPackedSVarint:function(t){var e=pT(this);for(t=t||[];this.pos<e;)t.push(this.readSVarint());return t},readPackedBoolean:function(t){var e=pT(this);for(t=t||[];this.pos<e;)t.push(this.readBoolean());return t},readPackedFloat:function(t){var e=pT(this);for(t=t||[];this.pos<e;)t.push(this.readFloat());return t},readPackedDouble:function(t){var e=pT(this);for(t=t||[];this.pos<e;)t.push(this.readDouble());return t},readPackedFixed32:function(t){var e=pT(this);for(t=t||[];this.pos<e;)t.push(this.readFixed32());return t},readPackedSFixed32:function(t){var e=pT(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed32());return t},readPackedFixed64:function(t){var e=pT(this);for(t=t||[];this.pos<e;)t.push(this.readFixed64());return t},readPackedSFixed64:function(t){var e=pT(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed64());return t},skip:function(t){var e=7&t;if(e===hT.Varint)for(;this.buf[this.pos++]>127;);else if(e===hT.Bytes)this.pos=this.readVarint()+this.pos;else if(e===hT.Fixed32)this.pos+=4;else{if(e!==hT.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;e<this.pos+t;)e*=2;if(e!==this.length){var n=new Uint8Array(e);n.set(this.buf),this.buf=n,this.length=e}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(t){this.realloc(4),MT(this.buf,t,this.pos),this.pos+=4},writeSFixed32:function(t){this.realloc(4),MT(this.buf,t,this.pos),this.pos+=4},writeFixed64:function(t){this.realloc(8),MT(this.buf,-1&t,this.pos),MT(this.buf,Math.floor(t*dT),this.pos+4),this.pos+=8},writeSFixed64:function(t){this.realloc(8),MT(this.buf,-1&t,this.pos),MT(this.buf,Math.floor(t*dT),this.pos+4),this.pos+=8},writeVarint:function(t){(t=+t||0)>268435455||t<0?function(t,e){var n,r;t>=0?(n=t%4294967296|0,r=t/4294967296|0):(r=~(-t/4294967296),4294967295^(n=~(-t%4294967296))?n=n+1|0:(n=0,r=r+1|0));if(t>=0x10000000000000000||t<-0x10000000000000000)throw new Error("Given varint doesn't fit into 10 bytes");e.realloc(10),function(t,e,n){n.buf[n.pos++]=127&t|128,t>>>=7,n.buf[n.pos++]=127&t|128,t>>>=7,n.buf[n.pos++]=127&t|128,t>>>=7,n.buf[n.pos++]=127&t|128,t>>>=7,n.buf[n.pos]=127&t}(n,0,e),function(t,e){var n=(7&t)<<4;if(e.buf[e.pos++]|=n|((t>>>=3)?128:0),!t)return;if(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),!t)return;if(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),!t)return;if(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),!t)return;if(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),!t)return;e.buf[e.pos++]=127&t}(r,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,n){for(var r,i,o=0;o<e.length;o++){if((r=e.charCodeAt(o))>55295&&r<57344){if(!i){r>56319||o+1===e.length?(t[n++]=239,t[n++]=191,t[n++]=189):i=r;continue}if(r<56320){t[n++]=239,t[n++]=191,t[n++]=189,i=r;continue}r=i-55296<<10|r-56320|65536,i=null}else i&&(t[n++]=239,t[n++]=191,t[n++]=189,i=null);r<128?t[n++]=r:(r<2048?t[n++]=r>>6|192:(r<65536?t[n++]=r>>12|224:(t[n++]=r>>18|240,t[n++]=r>>12&63|128),t[n++]=r>>6&63|128),t[n++]=63&r|128)}return n}(this.buf,t,this.pos);var n=this.pos-e;n>=128&&gT(e,n,this),this.pos=e-1,this.writeVarint(n),this.pos+=n},writeFloat:function(t){this.realloc(4),uT(this.buf,t,this.pos,!0,23,4),this.pos+=4},writeDouble:function(t){this.realloc(8),uT(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 n=0;n<e;n++)this.buf[this.pos++]=t[n]},writeRawMessage:function(t,e){this.pos++;var n=this.pos;t(e,this);var r=this.pos-n;r>=128&&gT(n,r,this),this.pos=n-1,this.writeVarint(r),this.pos+=r},writeMessage:function(t,e,n){this.writeTag(t,hT.Bytes),this.writeRawMessage(e,n)},writePackedVarint:function(t,e){this.writeMessage(t,mT,e)},writePackedSVarint:function(t,e){this.writeMessage(t,yT,e)},writePackedBoolean:function(t,e){this.writeMessage(t,IT,e)},writePackedFloat:function(t,e){this.writeMessage(t,vT,e)},writePackedDouble:function(t,e){this.writeMessage(t,CT,e)},writePackedFixed32:function(t,e){this.writeMessage(t,xT,e)},writePackedSFixed32:function(t,e){this.writeMessage(t,ET,e)},writePackedFixed64:function(t,e){this.writeMessage(t,_T,e)},writePackedSFixed64:function(t,e){this.writeMessage(t,bT,e)},writeBytesField:function(t,e){this.writeTag(t,hT.Bytes),this.writeBytes(e)},writeFixed32Field:function(t,e){this.writeTag(t,hT.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(t,e){this.writeTag(t,hT.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(t,e){this.writeTag(t,hT.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(t,e){this.writeTag(t,hT.Fixed64),this.writeSFixed64(e)},writeVarintField:function(t,e){this.writeTag(t,hT.Varint),this.writeVarint(e)},writeSVarintField:function(t,e){this.writeTag(t,hT.Varint),this.writeSVarint(e)},writeStringField:function(t,e){this.writeTag(t,hT.Bytes),this.writeString(e)},writeFloatField:function(t,e){this.writeTag(t,hT.Fixed32),this.writeFloat(e)},writeDoubleField:function(t,e){this.writeTag(t,hT.Fixed64),this.writeDouble(e)},writeBooleanField:function(t,e){this.writeVarintField(t,Boolean(e))}};const BT=function(){let t=!0;return function(e,n){const r=t?function(){if(n){const t=n.apply(e,arguments);return n=null,t}}:function(){};return t=!1,r}}(),ST=BT(void 0,(function(){return ST.toString().search("(((.+)+)+)+$").toString().constructor(ST).search("(((.+)+)+)+$")}));ST();function DT(t){for(var e=0,n=0,r=0,i=t;r<i.length;r+=1){var o=i[r];e+=o.w*o.h,n=Math.max(n,o.w)}t.sort((function(t,e){return e.h-t.h}));for(var a=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(e/.95)),n),h:1/0}],s=0,c=0,l=0,u=t;l<u.length;l+=1)for(var h=u[l],f=a.length-1;f>=0;f--){var d=a[f];if(!(h.w>d.w||h.h>d.h)){if(h.x=d.x,h.y=d.y,c=Math.max(c,h.y+h.h),s=Math.max(s,h.x+h.w),h.w===d.w&&h.h===d.h){var p=a.pop();f<a.length&&(a[f]=p)}else h.h===d.h?(d.x+=h.w,d.w-=h.w):h.w===d.w?(d.y+=h.h,d.h-=h.h):(a.push({x:d.x+h.w,y:d.y,w:d.w-h.w,h:h.h}),d.y+=h.h,d.h-=h.h);break}}return{w:s,h:c,fill:e/(s*c)||0}}const RT=function(){let t=!0;return function(e,n){const r=t?function(){if(n){const t=n.apply(e,arguments);return n=null,t}}:function(){};return t=!1,r}}(),zT=RT(void 0,(function(){return zT.toString().search("(((.+)+)+)+$").toString().constructor(zT).search("(((.+)+)+)+$")}));zT();class OT{constructor(t,{pixelRatio:e,version:n,stretchX:r,stretchY:i,content:o}){this.paddedRect=t,this.pixelRatio=e,this.stretchX=r,this.stretchY=i,this.content=o,this.version=n}get tl(){return[this.paddedRect.x+1,this.paddedRect.y+1]}get br(){return[this.paddedRect.x+this.paddedRect.w-1,this.paddedRect.y+this.paddedRect.h-1]}get displaySize(){return[(this.paddedRect.w-2)/this.pixelRatio,(this.paddedRect.h-2)/this.pixelRatio]}}class NT{constructor(t,e){const n={},r={};this.haveRenderCallbacks=[];const i=[];this.addImages(t,n,i),this.addImages(e,r,i);const{w:o,h:a}=DT(i),s=new Y_({width:o||1,height:a||1});for(const e in t){const r=t[e],i=n[e].paddedRect;Y_.copy(r.data,s,{x:0,y:0},{x:i.x+1,y:i.y+1},r.data)}for(const t in e){const n=e[t],i=r[t].paddedRect,o=i.x+1,a=i.y+1,c=n.data.width,l=n.data.height;Y_.copy(n.data,s,{x:0,y:0},{x:o,y:a},n.data),Y_.copy(n.data,s,{x:0,y:l-1},{x:o,y:a-1},{width:c,height:1}),Y_.copy(n.data,s,{x:0,y:0},{x:o,y:a+l},{width:c,height:1}),Y_.copy(n.data,s,{x:c-1,y:0},{x:o-1,y:a},{width:1,height:l}),Y_.copy(n.data,s,{x:0,y:0},{x:o+c,y:a},{width:1,height:l})}this.image=s,this.iconPositions=n,this.patternPositions=r}addImages(t,e,n){for(const r in t){const i=t[r],o={x:0,y:0,w:i.data.width+2,h:i.data.height+2};n.push(o),e[r]=new OT(o,i),i.hasRenderCallback&&this.haveRenderCallbacks.push(r)}}patchUpdatedImages(t,e){this.haveRenderCallbacks=this.haveRenderCallbacks.filter((e=>t.hasImage(e))),t.dispatchRenderCallbacks(this.haveRenderCallbacks);for(const n in t.updatedImages)this.patchUpdatedImage(this.iconPositions[n],t.getImage(n),e),this.patchUpdatedImage(this.patternPositions[n],t.getImage(n),e)}patchUpdatedImage(t,e,n){if(!t||!e)return;if(t.version===e.version)return;t.version=e.version;const[r,i]=t.tl;n.update(e.data,void 0,{x:r,y:i})}}sA(OT,"ImagePosition"),sA(NT,"ImageAtlas");const LT=function(){let t=!0;return function(e,n){const r=t?function(){if(n){const t=n.apply(e,arguments);return n=null,t}}:function(){};return t=!1,r}}(),QT=LT(void 0,(function(){return QT.toString().search("(((.+)+)+)+$").toString().constructor(QT).search("(((.+)+)+)+$")}));QT();const FT={horizontal:1,vertical:2,horizontalOnly:3},PT=-17;class kT{constructor(){this.scale=1,this.fontStack="",this.imageName=null}static forText(t,e){const n=new kT;return n.scale=t||1,n.fontStack=e,n}static forImage(t){const e=new kT;return e.imageName=t,e}}class UT{constructor(){this.text="",this.sectionIndex=[],this.sections=[],this.imageSectionID=null}static fromFeature(t,e){const n=new UT;for(let r=0;r<t.sections.length;r++){const i=t.sections[r];i.image?n.addImageSection(i):n.addTextSection(i,e)}return n}length(){return this.text.length}getSection(t){return this.sections[this.sectionIndex[t]]}getSections(){return this.sections}getSectionIndex(t){return this.sectionIndex[t]}getCharCode(t){return this.text.charCodeAt(t)}verticalizePunctuation(t){this.text=function(t){let e="";for(let n=0;n<t.length;n++){const r=t.charCodeAt(n+1)||null,i=t.charCodeAt(n-1)||null;r&&KM(r)&&!$M[t[n+1]]||i&&KM(i)&&!$M[t[n-1]]||!$M[t[n]]?e+=t[n]:e+=$M[t[n]]}return e}(this.text)}trim(){let t=0;for(let e=0;e<this.text.length&>[this.text.charCodeAt(e)];e++)t++;let e=this.text.length;for(let n=this.text.length-1;n>=0&&n>=t&>[this.text.charCodeAt(n)];n--)e--;this.text=this.text.substring(t,e),this.sectionIndex=this.sectionIndex.slice(t,e)}substring(t,e){const n=new UT;return n.text=this.text.substring(t,e),n.sectionIndex=this.sectionIndex.slice(t,e),n.sections=this.sections,n}toString(){return this.text}getMaxScale(){return this.sectionIndex.reduce(((t,e)=>Math.max(t,this.sections[e].scale)),0)}addTextSection(t,e){this.text+=t.text,this.sections.push(kT.forText(t.scale,t.fontStack||e));const n=this.sections.length-1;for(let e=0;e<t.text.length;++e)this.sectionIndex.push(n)}addImageSection(t){const e=t.image?t.image.name:"";if(0===e.length)return void jp("Can't add FormattedSection with an empty image.");const n=this.getNextImageSectionCharCode();n?(this.text+=String.fromCharCode(n),this.sections.push(kT.forImage(e)),this.sectionIndex.push(this.sections.length-1)):jp("Reached maximum number of images 6401")}getNextImageSectionCharCode(){return this.imageSectionID?this.imageSectionID>=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)}}function jT(t,e,n,r,i,o,a,s,c,l,u,h,f,d,p){const A=UT.fromFeature(t,i);h===FT.vertical&&A.verticalizePunctuation(f);let g=[];const m=function(t,e,n,r,i,o){if(!t)return[];const a=[],s=function(t,e,n,r,i,o){let a=0;for(let n=0;n<t.length();n++){const s=t.getSection(n);a+=qT(t.getCharCode(n),s,r,i,e,o)}const s=Math.max(1,Math.ceil(a/n));return a/s}(t,e,n,r,i,o),c=t.text.indexOf("")>=0;let l=0;for(let n=0;n<t.length();n++){const u=t.getSection(n),h=t.getCharCode(n);if(GT[h]||(l+=qT(h,u,r,i,e,o)),n<t.length()-1){const e=VM(h);(HT[h]||e||u.imageName)&&a.push(KT(n+1,l,s,a,YT(h,t.getCharCode(n+1),e&&c),!1))}}return WT(KT(t.length(),l,s,a,0,!0))}(A,l,o,e,r,d),{processBidirectionalText:y,processStyledBidirectionalText:v}=cT;if(y&&1===A.sections.length){const t=y(A.toString(),m);for(const e of t){const t=new UT;t.text=e,t.sections=A.sections;for(let n=0;n<e.length;n++)t.sectionIndex.push(0);g.push(t)}}else if(v){const t=v(A.text,A.sectionIndex,m);for(const e of t){const t=new UT;t.text=e[0],t.sectionIndex=e[1],t.sections=A.sections,g.push(t)}}else g=function(t,e){const n=[],r=t.text;let i=0;for(const r of e)n.push(t.substring(i,r)),i=r;return i<r.length&&n.push(t.substring(i,r.length)),n}(A,m);const C=[],I={positionedLines:C,text:A.toString(),top:u[1],bottom:u[1],left:u[0],right:u[0],writingMode:h,iconsInText:!1,verticalizable:!1,hasBaseline:!1};return function(t,e,n,r,i,o,a,s,c,l,u,h){let f=0,d=0,p=0;const A="right"===s?1:"left"===s?0:.5;let g=!1;for(const t of i){const n=t.getSections();for(const t of n){if(t.imageName)continue;const n=e[t.fontStack];if(n&&(g=void 0!==n.ascender&&void 0!==n.descender,!g))break}if(!g)break}let m=0;for(const a of i){a.trim();const i=a.getMaxScale(),s=(i-1)*Dw,y={positionedGlyphs:[],lineOffset:0};t.positionedLines[m]=y;const v=y.positionedGlyphs;let C=0;if(!a.length()){d+=o,++m;continue}let I=0,x=0;for(let o=0;o<a.length();o++){const s=a.getSection(o),p=a.getSectionIndex(o),A=a.getCharCode(o);let m=s.scale,y=null,E=null,_=null,b=Dw,w=0;const M=!(c===FT.horizontal||!u&&!YM(A)||u&&(GT[A]||WM(A)));if(s.imageName){const e=r[s.imageName];if(!e)continue;_=s.imageName,t.iconsInText=t.iconsInText||!0,E=e.paddedRect;const n=e.displaySize;if(m=m*Dw/h,y={width:n[0],height:n[1],left:1,top:-3,advance:M?n[1]:n[0],localGlyph:!1},g){w=-y.height*m}else w=PT+i*Dw-n[1]*m;b=y.advance;const o=(M?n[0]:n[1])*m-Dw*i;o>0&&o>C&&(C=o)}else{const t=n[s.fontStack];if(!t)continue;t[A]&&(E=t[A]);const r=e[s.fontStack];if(!r)continue;const o=r.glyphs[A];if(!o)continue;if(y=o.metrics,b=8203!==A?Dw:0,g){const t=void 0!==r.ascender?Math.abs(r.ascender):0,e=void 0!==r.descender?Math.abs(r.descender):0,n=(t+e)*m;I<n&&(I=n,x=(t-e)/2*m),w=-t*m}else w=PT+(i-m)*Dw}M?(t.verticalizable=!0,v.push({glyph:A,imageName:_,x:f,y:d+w,vertical:M,scale:m,localGlyph:y.localGlyph,fontStack:s.fontStack,sectionIndex:p,metrics:y,rect:E}),f+=b*m+l):(v.push({glyph:A,imageName:_,x:f,y:d+w,vertical:M,scale:m,localGlyph:y.localGlyph,fontStack:s.fontStack,sectionIndex:p,metrics:y,rect:E}),f+=y.advance*m+l)}if(0!==v.length){const t=f-l;p=Math.max(t,p),g?JT(v,A,C,x,o*i/2):JT(v,A,C,0,o/2)}f=0;const E=o*i+C;y.lineOffset=Math.max(C,s),d+=E,++m}const y=d,{horizontalAlign:v,verticalAlign:C}=XT(a);(function(t,e,n,r,i,o){const a=(e-n)*i,s=-o*r;for(const e of t)for(const t of e.positionedGlyphs)t.x+=a,t.y+=s})(t.positionedLines,A,v,C,p,y),t.top+=-C*y,t.bottom=t.top+y,t.left+=-v*p,t.right=t.left+p,t.hasBaseline=g}(I,e,n,r,g,a,s,c,h,l,f,p),!function(t){for(const e of t)if(0!==e.positionedGlyphs.length)return!1;return!0}(C)&&I}const GT={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},HT={10:!0,32:!0,38:!0,40:!0,41:!0,43:!0,45:!0,47:!0,173:!0,183:!0,8203:!0,8208:!0,8211:!0,8231:!0};function qT(t,e,n,r,i,o){if(e.imageName){const t=r[e.imageName];return t?t.displaySize[0]*e.scale*Dw/o+i:0}{const r=n[e.fontStack],o=r&&r.glyphs[t];return o?o.metrics.advance*e.scale+i:0}}function VT(t,e,n,r){const i=Math.pow(t-e,2);return r?t<e?i/2:2*i:i+Math.abs(n)*n}function YT(t,e,n){let r=0;return 10===t&&(r-=1e4),n&&(r+=150),(40===t||65288===t)&&(r+=50),(41===e||65289===e)&&(r+=50),r}function KT(t,e,n,r,i,o){let a=null,s=VT(e,n,i,o);for(const t of r){const r=VT(e-t.x,n,i,o)+t.badness;r<=s&&(a=t,s=r)}return{index:t,x:e,priorBreak:a,badness:s}}function WT(t){return t?WT(t.priorBreak).concat(t.index):[]}function XT(t){let e=.5,n=.5;switch(t){case"right":case"top-right":case"bottom-right":e=1;break;case"left":case"top-left":case"bottom-left":e=0}switch(t){case"bottom":case"bottom-right":case"bottom-left":n=1;break;case"top":case"top-right":case"top-left":n=0}return{horizontalAlign:e,verticalAlign:n}}function JT(t,e,n,r,i){if(!(e||n||r||i))return;const o=t.length-1,a=t[o],s=a.metrics.advance*a.scale,c=(a.x+s)*e;for(let e=0;e<=o;e++)t[e].x-=c,t[e].y+=n+r+i}function ZT(t,e,n){const{horizontalAlign:r,verticalAlign:i}=XT(n),o=e[0],a=e[1],s=o-t.displaySize[0]*r,c=s+t.displaySize[0],l=a-t.displaySize[1]*i;return{image:t,top:l,bottom:l+t.displaySize[1],left:s,right:c}}function $T(t,e,n,r,i,o){"none"===n&&console.log("textFit === 'none'"),(!Array.isArray(r)||4!==r.length)&&console.log("!Array.isArray(padding) || padding.length !== 4"),(!Array.isArray(i)||2!==i.length)&&console.log("!Array.isArray(iconOffset) || iconOffset.length !== 2");const a=t.image;let s;if(a.content){const t=a.content,e=a.pixelRatio||1;s=[t[0]/e,t[1]/e,a.displaySize[0]-t[2]/e,a.displaySize[1]-t[3]/e]}const c=e.left*o,l=e.right*o;let u,h,f,d;"width"===n||"both"===n?(d=i[0]+c-r[3],h=i[0]+l+r[1]):(d=i[0]+(c+l-a.displaySize[0])/2,h=d+a.displaySize[0]);const p=e.top*o,A=e.bottom*o;return"height"===n||"both"===n?(u=i[1]+p-r[0],f=i[1]+A+r[2]):(u=i[1]+(p+A-a.displaySize[1])/2,f=u+a.displaySize[1]),{image:a,top:u,right:h,bottom:f,left:d,collisionPadding:s}}var tB=function(t){var e,n=(e=!0,function(t,n){var r=e?function(){if(n){var e=n.apply(t,arguments);return n=null,e}}:function(){};return e=!1,r}),r=n(this,(function(){return r.toString().search("(((.+)+)+)+$").toString().constructor(r).search("(((.+)+)+)+$")}));function i(e,n,r,i,o){t.call(this,e,n),this.angle=i,this.z=r,void 0!==o&&(this.segment=o)}return r(),t&&(i.__proto__=t),i.prototype=Object.create(t&&t.prototype),i.prototype.constructor=i,i.prototype.clone=function(){return new i(this.x,this.y,this.z,this.angle,this.segment)},i}(Or);sA(tB,"Anchor");var eB,nB=(eB=!0,function(t,e){var n=eB?function(){if(e){var n=e.apply(t,arguments);return e=null,n}}:function(){};return eB=!1,n}),rB=nB(void 0,(function(){return rB.toString().search("(((.+)+)+)+$").toString().constructor(rB).search("(((.+)+)+)+$")}));function iB(t,e,n,r,i){if(void 0===e.segment)return!0;for(var o=e,a=e.segment+1,s=0;s>-n/2;){if(--a<0)return!1;s-=t[a].dist(o),o=t[a]}s+=t[a].dist(t[a+1]),a++;for(var c=[],l=0;s<n/2;){var u=t[a-1],h=t[a],f=t[a+1];if(!f)return!1;var d=u.angleTo(h)-h.angleTo(f);for(d=Math.abs((d+3*Math.PI)%(2*Math.PI)-Math.PI),c.push({distance:s,angleDelta:d}),l+=d;s-c[0].distance>r;)l-=c.shift().angleDelta;if(l>i)return!1;a++,s+=h.dist(f)}return!0}rB();const oB=function(){let t=!0;return function(e,n){const r=t?function(){if(n){const t=n.apply(e,arguments);return n=null,t}}:function(){};return t=!1,r}}(),aB=oB(void 0,(function(){return aB.toString().search("(((.+)+)+)+$").toString().constructor(aB).search("(((.+)+)+)+$")}));function sB(t){let e=0;for(let n=0;n<t.length-1;n++)e+=t[n].dist(t[n+1]);return e}function cB(t,e,n){return t?.6*e*n:0}function lB(t,e){return Math.max(t?t.right-t.left:0,e?e.right-e.left:0)}function uB(t,e,n,r,i,o){const a=cB(n,i,o),s=lB(n,r)*o;let c=0;const l=sB(t)/2;for(let n=0;n<t.length-1;n++){const r=t[n],i=t[n+1],o=r.dist(i);if(c+o>l){const u=(l-c)/o,h=ze(r.x,i.x,u),f=ze(r.y,i.y,u),d=new tB(h,f,0,i.angleTo(r),n);return!a||iB(t,d,s,a,e)?d:void 0}c+=o}}function hB(t,e,n,r,i,o,a,s,c,l){const u=cB(r,o,a),h=lB(r,i),f=h*a,d=0===t[0].x||t[0].x===c||0===t[0].y||t[0].y===c;e-f<e/4&&(e=f+e/4);return fB(t,d?e/2*s%e:(h/2+2*o)*a*s%e,e,u,n,f,d,!1,c,l)}function fB(t,e,n,r,i,o,a,s,c,l){const u=o/2,h=sB(t);let f=0,d=e-n,p=[];for(let e=0;e<t.length-1;e++){const a=t[e],s=t[e+1],A=a.dist(s),g=s.angleTo(a);for(;d+n<f+A;){d+=n;const m=(d-f)/A,y=ze(a.x,s.x,m),v=ze(a.y,s.y,m);if(y>=0&&y<c&&v>=0&&v<c&&d-u>=0&&d+u<=h){const n=new tB(y,v,0,g,e);n._round(),(l||!r||iB(t,n,o,r,i))&&p.push(n)}}f+=A}return!s&&!p.length&&!a&&(p=fB(t,f/2,n,r,i,o,a,!0,c)),p}aB();var dB,pB=(dB=!0,function(t,e){var n=dB?function(){if(e){var n=e.apply(t,arguments);return e=null,n}}:function(){};return dB=!1,n}),AB=pB(void 0,(function(){return AB.toString().search("(((.+)+)+)+$").toString().constructor(AB).search("(((.+)+)+)+$")}));AB();const gB=function(){let t=!0;return function(e,n){const r=t?function(){if(n){const t=n.apply(e,arguments);return n=null,t}}:function(){};return t=!1,r}}(),mB=gB(void 0,(function(){return mB.toString().search("(((.+)+)+)+$").toString().constructor(mB).search("(((.+)+)+)+$")}));mB();const yB=function(){let t=!0;return function(e,n){const r=t?function(){if(n){const t=n.apply(e,arguments);return n=null,t}}:function(){};return t=!1,r}}(),vB=yB(void 0,(function(){return vB.toString().search("(((.+)+)+)+$").toString().constructor(vB).search("(((.+)+)+)+$")}));vB();const CB=function(){let t=!0;return function(e,n){const r=t?function(){if(n){const t=n.apply(e,arguments);return n=null,t}}:function(){};return t=!1,r}}(),IB=CB(void 0,(function(){return IB.toString().search("(((.+)+)+)+$").toString().constructor(IB).search("(((.+)+)+)+$")}));IB();const xB=function(){let t=!0;return function(e,n){const r=t?function(){if(n){const t=n.apply(e,arguments);return n=null,t}}:function(){};return t=!1,r}}(),EB=xB(void 0,(function(){return EB.toString().search("(((.+)+)+)+$").toString().constructor(EB).search("(((.+)+)+)+$")}));EB();function _B(t,e,n,r){const i=[],o=t.image,a=o.pixelRatio,s=o.paddedRect.w-2,c=o.paddedRect.h-2,l=t.right-t.left,u=t.bottom-t.top,h=o.stretchX||[[0,s]],f=o.stretchY||[[0,c]],d=(t,e)=>t+e[1]-e[0],p=h.reduce(d,0),A=f.reduce(d,0),g=s-p,m=c-A;let y=0,v=p,C=0,I=A,x=0,E=g,_=0,b=m;if(o.content&&r){const t=o.content;y=bB(h,0,t[0]),C=bB(f,0,t[1]),v=bB(h,t[0],t[2]),I=bB(f,t[1],t[3]),x=t[0]-y,_=t[1]-C,E=t[2]-t[0]-v,b=t[3]-t[1]-I}const w=(r,i,s,c)=>{const h=MB(r.stretch-y,v,l,t.left),f=TB(r.fixed-x,E,r.stretch,p),d=MB(i.stretch-C,I,u,t.top),g=TB(i.fixed-_,b,i.stretch,A),m=MB(s.stretch-y,v,l,t.left),w=TB(s.fixed-x,E,s.stretch,p),M=MB(c.stretch-C,I,u,t.top),T=TB(c.fixed-_,b,c.stretch,A),B=new Or(h,d),S=new Or(m,d),D=new Or(m,M),R=new Or(h,M),z=new Or(f/a,g/a),O=new Or(w/a,T/a),N=e*Math.PI/180;if(N){const t=Math.sin(N),e=Math.cos(N),n=[e,-t,t,e];B._matMult(n),S._matMult(n),R._matMult(n),D._matMult(n)}const L=r.stretch+r.fixed,Q=s.stretch+s.fixed,F=i.stretch+i.fixed,P=c.stretch+c.fixed;return{tl:B,tr:S,bl:R,br:D,tex:{x:o.paddedRect.x+1+L,y:o.paddedRect.y+1+F,w:Q-L,h:P-F},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:z,pixelOffsetBR:O,minFontScaleX:E/a/l,minFontScaleY:b/a/u,isSDF:n}};if(r&&(o.stretchX||o.stretchY)){const t=wB(h,g,p),e=wB(f,m,A);for(let n=0;n<t.length-1;n++){const r=t[n],o=t[n+1];for(let t=0;t<e.length-1;t++){const n=e[t],a=e[t+1];i.push(w(r,n,o,a))}}}else i.push(w({fixed:0,stretch:-1},{fixed:0,stretch:-1},{fixed:0,stretch:s+1},{fixed:0,stretch:c+1}));return i}function bB(t,e,n){let r=0;for(const i of t)r+=Math.max(e,Math.min(n,i[1]))-Math.max(e,Math.min(n,i[0]));return r}function wB(t,e,n){const r=[{fixed:-1,stretch:0}];for(const[e,n]of t){const t=r[r.length-1];r.push({fixed:e-t.stretch,stretch:t.stretch}),r.push({fixed:e-t.stretch,stretch:t.stretch+(n-e)})}return r.push({fixed:e+1,stretch:n}),r}function MB(t,e,n,r){return t/e*n+r}function TB(t,e,n,r){return t-e*n/r}function BB(t,e,n,r){const i=e+t.positionedLines[r].lineOffset;if(0===r)return n+i/2;return n+(i+(e+t.positionedLines[r-1].lineOffset))/2}var SB,DB=(SB=!0,function(t,e){var n=SB?function(){if(e){var n=e.apply(t,arguments);return e=null,n}}:function(){};return SB=!1,n}),RB=DB(void 0,(function(){return RB.toString().search("(((.+)+)+)+$").toString().constructor(RB).search("(((.+)+)+)+$")}));function zB(t,e,n){void 0===e&&(e=1),void 0===n&&(n=!1);for(var r=1/0,i=1/0,o=-1/0,a=-1/0,s=t[0],c=0;c<s.length;c++){var l=s[c];(!c||l.x<r)&&(r=l.x),(!c||l.y<i)&&(i=l.y),(!c||l.x>o)&&(o=l.x),(!c||l.y>a)&&(a=l.y)}var u=o-r,h=a-i,f=Math.min(u,h),d=f/2,p=new TinyQueue([],OB);if(0===f)return new Or(r,i);for(var A=r;A<o;A+=f)for(var g=i;g<a;g+=f)p.push(new NB(A+d,g+d,d,t));for(var m=function(t){for(var e=0,n=0,r=0,i=t[0],o=0,a=i.length,s=a-1;o<a;s=o++){var c=i[o],l=i[s],u=c.x*l.y-l.x*c.y;n+=(c.x+l.x)*u,r+=(c.y+l.y)*u,e+=3*u}return new NB(n/e,r/e,0,t)}(t),y=p.length;p.length;){var v=p.pop();(v.d>m.d||!m.d)&&(m=v,n&&console.log("found best %d after %d probes",Math.round(1e4*v.d)/1e4,y)),v.max-m.d<=e||(d=v.h/2,p.push(new NB(v.p.x-d,v.p.y-d,d,t)),p.push(new NB(v.p.x+d,v.p.y-d,d,t)),p.push(new NB(v.p.x-d,v.p.y+d,d,t)),p.push(new NB(v.p.x+d,v.p.y+d,d,t)),y+=4)}return n&&(console.log("num probes: "+y),console.log("best distance: "+m.d)),m.p}function OB(t,e){return e.max-t.max}function NB(t,e,n,r){this.p=new Or(t,e),this.h=n,this.d=function(t,e){for(var n=!1,r=1/0,i=0;i<e.length;i++)for(var o=e[i],a=0,s=o.length,c=s-1;a<s;c=a++){var l=o[a],u=o[c];l.y>t.y!=u.y>t.y&&t.x<(u.x-l.x)*(t.y-l.y)/(u.y-l.y)+l.x&&(n=!n),r=Math.min(r,cI(t,l,u))}return(n?1:-1)*Math.sqrt(r)}(this.p,r),this.max=this.d+this.h*Math.SQRT2}function LB(t,e){var n,r,i,o,a,s,c,l;for(n=3&t.length,r=t.length-n,i=e,a=3432918353,s=461845907,l=0;l<r;)c=255&t.charCodeAt(l)|(255&t.charCodeAt(++l))<<8|(255&t.charCodeAt(++l))<<16|(255&t.charCodeAt(++l))<<24,++l,i=27492+(65535&(o=5*(65535&(i=(i^=c=(65535&(c=(c=(65535&c)*a+(((c>>>16)*a&65535)<<16)&4294967295)<<15|c>>>17))*s+(((c>>>16)*s&65535)<<16)&4294967295)<<13|i>>>19))+((5*(i>>>16)&65535)<<16)&4294967295))+((58964+(o>>>16)&65535)<<16);switch(c=0,n){case 3:c^=(255&t.charCodeAt(l+2))<<16;case 2:c^=(255&t.charCodeAt(l+1))<<8;case 1:i^=c=(65535&(c=(c=(65535&(c^=255&t.charCodeAt(l)))*a+(((c>>>16)*a&65535)<<16)&4294967295)<<15|c>>>17))*s+(((c>>>16)*s&65535)<<16)&4294967295}return i^=t.length,i=2246822507*(65535&(i^=i>>>16))+((2246822507*(i>>>16)&65535)<<16)&4294967295,i=3266489909*(65535&(i^=i>>>13))+((3266489909*(i>>>16)&65535)<<16)&4294967295,(i^=i>>>16)>>>0}RB();const QB=function(){let t=!0;return function(e,n){const r=t?function(){if(n){const t=n.apply(e,arguments);return n=null,t}}:function(){};return t=!1,r}}(),FB=QB(void 0,(function(){return FB.toString().search("(((.+)+)+)+$").toString().constructor(FB).search("(((.+)+)+)+$")}));FB();const PB=Number.POSITIVE_INFINITY,kB=Math.sqrt(2);function UB(t,[e,n]){let r=0,i=0;if(n===PB){e<0&&(e=0);const n=e/kB;switch(t){case"top-right":case"top-left":i=n-7;break;case"bottom-right":case"bottom-left":i=7-n;break;case"bottom":i=7-e;break;case"top":i=e-7}switch(t){case"top-right":case"bottom-right":r=-n;break;case"top-left":case"bottom-left":r=n;break;case"left":r=e;break;case"right":r=-e}}else{switch(e=Math.abs(e),n=Math.abs(n),t){case"top-right":case"top-left":case"top":i=n-7;break;case"bottom-right":case"bottom-left":case"bottom":i=7-n}switch(t){case"top-right":case"bottom-right":case"right":r=-e;break;case"top-left":case"bottom-left":case"left":r=e}}return[r,i]}function jB(t,e,n,r,i,o,a,s,c,l,u,h){t.createArrays();const f=512*t.overscaling;t.tilePixelRatio=Cl/f,t.compareText={},t.iconsNeedLinear=!1;const d=t.layers[0].layout,p=t.layers[0]._unevaluatedLayout._values,A={};if("composite"===t.textSizeData.kind){const{minZoom:e,maxZoom:n}=t.textSizeData;A.compositeTextSizes=[p["text-size"].possiblyEvaluate(new SA(e),s),p["text-size"].possiblyEvaluate(new SA(n),s)]}if("composite"===t.iconSizeData.kind){const{minZoom:e,maxZoom:n}=t.iconSizeData;A.compositeIconSizes=[p["icon-size"].possiblyEvaluate(new SA(e),s),p["icon-size"].possiblyEvaluate(new SA(n),s)]}A.layoutTextSize=p["text-size"].possiblyEvaluate(new SA(c+1),s),A.layoutIconSize=p["icon-size"].possiblyEvaluate(new SA(c+1),s),A.textMaxSize=p["text-size"].possiblyEvaluate(new SA(18),s);const g="map"===d.get("text-rotation-alignment")&&"point"!==d.get("symbol-placement"),m=d.get("text-size");!g&&(t.text.createLngLatQuadsArray(),t.icon.createLngLatQuadsArray());for(const o of t.features){const c=d.get("text-font").evaluate(o,{},s).join(","),f=m.evaluate(o,{},s),p=A.layoutTextSize.evaluate(o,{},s),y=A.layoutIconSize.evaluate(o,{},s),v={horizontal:{},vertical:void 0},C=o.text;let I=[0,0];if(C){const r=C.toString(),a=d.get("text-letter-spacing").evaluate(o,{},s)*Dw,l=d.get("text-line-height").evaluate(o,{},s)*Dw,u=HM(r)?a:0,h=d.get("text-anchor").evaluate(o,{},s),A=d.get("text-variable-anchor");if(!A){const t=d.get("text-radial-offset").evaluate(o,{},s);I=t?UB(h,[t*Dw,PB]):d.get("text-offset").evaluate(o,{},s).map((t=>t*Dw))}let m=g?"center":d.get("text-justify").evaluate(o,{},s);const y="point"===d.get("symbol-placement"),x=y?d.get("text-max-width").evaluate(o,{},s)*Dw:1/0,E=o=>{t.allowVerticalPlacement&&GM(r)&&(v.vertical=jT(C,e,n,i,c,x,l,h,o,u,I,FT.vertical,!0,p,f))};if(!g&&A){const t="auto"===m?A.map((t=>GB(t))):[m];let r=!1;for(let o=0;o<t.length;o++){const a=t[o];if(!v.horizontal[a])if(r)v.horizontal[a]=v.horizontal[0];else{const t=jT(C,e,n,i,c,x,l,"center",a,u,I,FT.horizontal,!1,p,f);t&&(v.horizontal[a]=t,r=1===t.positionedLines.length)}}E("left")}else{if("auto"===m&&(m=GB(h)),y||d.get("text-writing-mode").indexOf("horizontal")>=0||!GM(r)){const t=jT(C,e,n,i,c,x,l,h,m,u,I,FT.horizontal,!1,p,f);t&&(v.horizontal[m]=t)}E(y?"left":m)}}let x,E=!1;if(o.icon&&o.icon.name){const e=r[o.icon.name];e&&(x=ZT(i[o.icon.name],d.get("icon-offset").evaluate(o,{},s),d.get("icon-anchor").evaluate(o,{},s)),E=e.sdf,void 0===t.sdfIcons?t.sdfIcons=e.sdf:t.sdfIcons!==e.sdf&&jp("Style sheet warning: Cannot mix SDF and non-SDF icons in one buffer"),(e.pixelRatio!==t.pixelRatio||0!==d.get("icon-rotate").constantOr(1))&&(t.iconsNeedLinear=!0))}const _=KB(v.horizontal)||v.vertical;!t.iconsInText&&(t.iconsInText=!!_&&_.iconsInText),(_||x)&&HB(t,o,v,x,r,A,p,y,I,E,a,s,l,u,h)}o&&t.generateCollisionDebugBuffers(c,t.collisionBoxArray)}function GB(t){switch(t){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}function HB(t,e,n,r,i,o,a,s,c,l,u,h,f,d,p){let A=o.textMaxSize.evaluate(e,{},h);void 0===A&&(A=a);const g=t.layers[0].layout,m=g.get("icon-offset").evaluate(e,{},h),y=KB(n.horizontal)||n.vertical,v=a/24,C=t.tilePixelRatio*A/24,I=(t.tilePixelRatio,function(t,e){e>18&&t>2&&(t>>=1);const n=Cl/(512*t);return Math.max(n,1)}(t.overscaling,t.zoom)*g.get("symbol-spacing")),x=g.get("text-padding")*t.tilePixelRatio,E=g.get("icon-padding")*t.tilePixelRatio,_=Dp(g.get("text-max-angle")),b="map"===g.get("text-rotation-alignment")&&"point"!==g.get("symbol-placement"),w="map"===g.get("icon-rotation-alignment")&&"point"!==g.get("symbol-placement"),M=g.get("symbol-placement"),T=I/2,B=g.get("ignore-line-rotation"),S=g.get("icon-text-fit");let D;r&&"none"!==S&&(t.allowVerticalPlacement&&n.vertical&&(D=$T(r,n.vertical,S,g.get("icon-text-fit-padding"),m,v)),y&&(r=$T(r,y,S,g.get("icon-text-fit-padding"),m,v)));const R=(a,s,f)=>{if(s.x<0||s.x>=Cl||s.y<0||s.y>=Cl)return;const A=Yp(d,s.x,s.y,f,p);!function(t,e,n,r,i,o,a,s,c,l,u,h,f,d,p,A,g,m,y,v,C,I,x,E,_,b,w,M){const T=t.addToLineVertexArray(e,i);let B,S,D,R,z,O,N,L=0,Q=0,F=0,P=0,k=-1,U=-1;const j={};let G=LB("");const H=r?r.anchor:e;let q=0,V=0;if(void 0===l._unevaluatedLayout.getValue("text-radial-offset")?[q,V]=l.layout.get("text-offset").evaluate(I,{},b).map((t=>t*Dw)):(q=l.layout.get("text-radial-offset").evaluate(I,{},b)*Dw,V=PB),t.allowVerticalPlacement&&o.vertical){const t=o.vertical;if(A)O=XB(t),c&&(N=XB(c));else{const r=l.layout.get("text-rotate").evaluate(I,{},b)+90;D=WB(u,H,e,n,h,f,d,t,p,r,g),c&&(R=WB(u,H,e,n,h,f,d,c,y,r))}}if(a){const i=l.layout.get("icon-rotate").evaluate(I,{},b),o="none"!==l.layout.get("icon-text-fit"),s=_B(a,i,E,o),p=c?_B(c,i,E,o):void 0;S=WB(u,H,e,n,h,f,d,a,y,i),L=4*s.length;const A=t.iconSizeData;let g=null;"source"===A.kind?(g=[Ow*l.layout.get("icon-size").evaluate(I,{},b)],g[0]>VB&&jp(t.layerIds[0]+': Value for "icon-size" is >= '+qB+'. Reduce your "icon-size".')):"composite"===A.kind&&(g=[Ow*x.compositeIconSizes[0].evaluate(I,{},b),Ow*x.compositeIconSizes[1].evaluate(I,{},b)],(g[0]>VB||g[1]>VB)&&jp(t.layerIds[0]+': Value for "icon-size" is >= '+qB+'. Reduce your "icon-size".')),t.addSymbols(t.icon,s,g,C,v,I,!1,r,e,n,T.lineStartIndex,T.lineLength,-1,_,b,w,M),k=t.icon.placedSymbolArray.length-1,p&&(Q=4*p.length,t.addSymbols(t.icon,p,g,C,v,I,FT.vertical,r,e,n,T.lineStartIndex,T.lineLength,-1,_,b,w,M),U=t.icon.placedSymbolArray.length-1)}for(const i in o.horizontal){const a=o.horizontal[i];if(!B)if(G=LB(a.text),A)z=XB(a);else{B=WB(u,H,e,n,h,f,d,a,p,l.layout.get("text-rotate").evaluate(I,{},b),g)}const c=1===a.positionedLines.length;if(F+=YB(t,r,e,n,a,s,l,A,I,g,T,o.vertical?FT.horizontal:FT.horizontalOnly,c?Object.keys(o.horizontal):[i],j,k,x,_,b,w,M),c)break}o.vertical&&(P+=YB(t,r,e,n,o.vertical,s,l,A,I,g,T,FT.vertical,["vertical"],j,U,x,_,b,w,M));let Y=-1;const K=(t,e)=>t?Math.max(t,e):e;Y=K(z,Y),Y=K(O,Y),Y=K(N,Y);const W=Y>-1?1:0;t.glyphOffsetArray.length>=65535&&jp("Too many glyphs being rendered in a tile.");void 0!==I.sortKey&&t.addToSortKeyRanges(t.symbolInstances.length,I.sortKey);const X=H;t.symbolInstances.emplaceBack(X.x,X.y,X.z,e.x,e.y,j.right>=0?j.right:-1,j.center>=0?j.center:-1,j.left>=0?j.left:-1,j.vertical>=0?j.vertical:-1,k,U,G,void 0!==B?B:t.collisionBoxArray.length,void 0!==B?B+1:t.collisionBoxArray.length,void 0!==D?D:t.collisionBoxArray.length,void 0!==D?D+1:t.collisionBoxArray.length,void 0!==S?S:t.collisionBoxArray.length,void 0!==S?S+1:t.collisionBoxArray.length,R||t.collisionBoxArray.length,R?R+1:t.collisionBoxArray.length,h,F,P,L,Q,W,0,q,V,Y)}(t,s,A,null,a,n,r,i,D,t.layers[0],t.collisionBoxArray,e.index,e.sourceLayerIndex,t.index,x,b,c,0,E,w,m,e,o,l,u,h,d,p)};if("line"===M||"line-direction"===M)for(const i of function(t,e,n,r,i){for(var o=[],a=0;a<t.length;a++)for(var s=t[a],c=void 0,l=0;l<s.length-1;l++){var u=s[l],h=s[l+1];u.x<e&&h.x<e||(u.x<e?u=new Or(e,u.y+(h.y-u.y)*((e-u.x)/(h.x-u.x)))._round():h.x<e&&(h=new Or(e,u.y+(h.y-u.y)*((e-u.x)/(h.x-u.x)))._round()),u.y<n&&h.y<n||(u.y<n?u=new Or(u.x+(h.x-u.x)*((n-u.y)/(h.y-u.y)),n)._round():h.y<n&&(h=new Or(u.x+(h.x-u.x)*((n-u.y)/(h.y-u.y)),n)._round()),u.x>=r&&h.x>=r||(u.x>=r?u=new Or(r,u.y+(h.y-u.y)*((r-u.x)/(h.x-u.x)))._round():h.x>=r&&(h=new Or(r,u.y+(h.y-u.y)*((r-u.x)/(h.x-u.x)))._round()),u.y>=i&&h.y>=i||(u.y>=i?u=new Or(u.x+(h.x-u.x)*((i-u.y)/(h.y-u.y)),i)._round():h.y>=i&&(h=new Or(u.x+(h.x-u.x)*((i-u.y)/(h.y-u.y)),i)._round()),(!c||!u.equals(c[c.length-1]))&&(c=[u],o.push(c)),c.push(h)))))}return o}(e.geometry,0,0,Cl,Cl)){const e=hB(i,I,_,n.vertical||y,r,24,C,t.overscaling,Cl,B);for(const n of e){(!y||!JB(t,y.text,T,n))&&R(i,n,h)}}else if("line-center"===M){for(const t of e.geometry)if(t.length>1){const e=uB(t,_,n.vertical||y,r,24,C);e&&R(t,e,h)}}else if("Polygon"===e.type)for(const t of ub(e.geometry,0)){const e=zB(t,16);R(t[0],new tB(e.x,e.y,0,0,void 0),h)}else if("LineString"===e.type)for(const t of e.geometry)R(t,new tB(t[0].x,t[0].y,0,0,void 0),h);else if("Point"===e.type)for(const t of e.geometry)for(const e of t)R([e],new tB(e.x,e.y,0,0,void 0),h)}const qB=255,VB=qB*Ow;function YB(t,e,n,r,i,o,a,s,c,l,u,h,f,d,p,A,g,m,y,v){const C=function(t,e,n,r,i,o,a,s){const c=[];if(0===e.positionedLines.length)return c;const l=r.layout.get("text-rotate").evaluate(o,{})*Math.PI/180,u=function(t){const e=t[0],n=t[1],r=e*n;return r>0?[e,-n]:r<0?[-e,n]:0===e?[n,e]:[n,-e]}(n);let h=Math.abs(e.top-e.bottom);for(const t of e.positionedLines)h-=t.lineOffset;const f=e.positionedLines.length,d=h/f;let p=e.top-n[1];for(let t=0;t<f;++t){const r=e.positionedLines[t];p=BB(e,d,p,t);for(const t of r.positionedGlyphs){if(!t.rect)continue;const r=t.rect||{};let o=4,h=!0,f=1,d=0;if(t.imageName){const e=a[t.imageName];if(!e)continue;if(e.sdf){jp("SDF images are not supported in formatted text and will be ignored.");continue}h=!1,f=e.pixelRatio,o=1/f}const m=(i||s)&&t.vertical,y=t.metrics.advance*t.scale/2,v=t.metrics,C=t.rect;if(null===C)continue;s&&e.verticalizable&&(d=t.imageName?y-t.metrics.width*t.scale/2:0);const I=i?[t.x+y,t.y]:[0,0];let x=[0,0],E=[0,0],_=!1;!i&&(m?(E=[t.x+y+u[0],t.y+u[1]-d],_=!0):x=[t.x+y+n[0],t.y+n[1]-d]);const b=C.w*t.scale/(f*(t.localGlyph?2:1)),w=C.h*t.scale/(f*(t.localGlyph?2:1));let M,T,B,S;if(m){const e=t.y-p,n=new Or(-y,y-e),r=-Math.PI/2,i=new Or(...E);M=new Or(-y+x[0],x[1]),M._rotateAround(r,n)._add(i),M.x+=-e+y,M.y-=(v.left-o)*t.scale;const a=t.imageName?v.advance*t.scale:Dw*t.scale,s=String.fromCharCode(t.glyph);if("︶"===(g=s)||"﹈"===g||"︸"===g||"﹄"===g||"﹂"===g||"︾"===g||"︼"===g||"︺"===g||"︘"===g||"﹀"===g||"︐"===g||"︓"===g||"︔"===g||"`"===g||" ̄"===g||"︑"===g||"︒"===g)M.x+=(1-o)*t.scale;else if("︵"===(A=s)||"﹇"===A||"︷"===A||"﹃"===A||"﹁"===A||"︽"===A||"︻"===A||"︹"===A||"︗"===A||"︿"===A){const e=a-v.height*t.scale;M.x+=e+(-o-1)*t.scale}else if(t.imageName||v.width+2*o===C.w&&v.height+2*o===C.h){const t=a-w;M.x+=t/2}else{const e=a-(v.height+2*o)*t.scale;M.x+=e/2}T=new Or(M.x,M.y-b),B=new Or(M.x+w,M.y),S=new Or(M.x+w,M.y-b)}else{const e=(v.left-o)*t.scale-y+x[0],n=(-v.top-o)*t.scale+x[1],r=e+b,i=n+w;M=new Or(e,n),T=new Or(r,n),B=new Or(e,i),S=new Or(r,i)}if(l){let t;t=i?new Or(0,0):_?new Or(u[0],u[1]):new Or(n[0],n[1]),M._rotateAround(l,t),T._rotateAround(l,t),B._rotateAround(l,t),S._rotateAround(l,t)}const D=new Or(0,0),R=new Or(0,0),z=0,O=0;c.push({tl:M,tr:T,bl:B,br:S,tex:r,writingMode:e.writingMode,glyphOffset:I,sectionIndex:t.sectionIndex,isSDF:h,pixelOffsetTL:D,pixelOffsetBR:R,minFontScaleX:z,minFontScaleY:O})}}var A,g;return c}(0,i,l,a,s,c,o,t.allowVerticalPlacement),I=t.textSizeData;let x=null;"source"===I.kind?(x=[Ow*a.layout.get("text-size").evaluate(c,{},m)],x[0]>VB&&jp(t.layerIds[0]+': Value for "text-size" is >= '+qB+'. Reduce your "text-size".')):"composite"===I.kind&&(x=[Ow*A.compositeTextSizes[0].evaluate(c,{},m),Ow*A.compositeTextSizes[1].evaluate(c,{},m)],(x[0]>VB||x[1]>VB)&&jp(t.layerIds[0]+': Value for "text-size" is >= '+qB+'. Reduce your "text-size".')),t.addSymbols(t.text,C,x,l,s,c,h,e,n,r,u.lineStartIndex,u.lineLength,p,g,m,y,v);for(const e of f)d[e]=t.text.placedSymbolArray.length-1;return 4*C.length}function KB(t){for(const e in t)return t[e];return null}function WB(t,e,n,r,i,o,a,s,c,l,u){let h=s.top,f=s.bottom,d=s.left,p=s.right;const A=s.collisionPadding;if(A&&(d-=A[0],h-=A[1],p+=A[2],f+=A[3]),l){const t=new Or(d,h),e=new Or(p,h),n=new Or(d,f),r=new Or(p,f),i=Dp(l);let o=new Or(0,0);u&&(o=new Or(u[0],u[1])),t._rotateAround(i,o),e._rotateAround(i,o),n._rotateAround(i,o),r._rotateAround(i,o),d=Math.min(t.x,e.x,n.x,r.x),p=Math.max(t.x,e.x,n.x,r.x),h=Math.min(t.y,e.y,n.y,r.y),f=Math.max(t.y,e.y,n.y,r.y)}return t.emplaceBack(e.x,e.y,e.z,n.x,n.y,d,h,p,f,c,i,o,a,r.x,r.y,r.z),t.length-1}function XB(t){t.collisionPadding&&(t.top-=t.collisionPadding[1],t.bottom+=t.collisionPadding[3]);const e=t.bottom-t.top;return e>0?Math.max(10,e):null}function JB(t,e,n,r){const i=t.compareText;if(e in i){const t=i[e];for(let e=t.length-1;e>=0;e--)if(r.dist(t[e])<n)return!0}else i[e]=[];return i[e].push(r),!1}const ZB=function(){let t=!0;return function(e,n){const r=t?function(){if(n){const t=n.apply(e,arguments);return n=null,t}}:function(){};return t=!1,r}}(),$B=ZB(void 0,(function(){return $B.toString().search("(((.+)+)+)+$").toString().constructor($B).search("(((.+)+)+)+$")}));$B();var tS=Object.freeze({ISERVER_TOKEN:"token",IPORTAL_KEY:"key"});function eS(t,e,n){if(!Nr(t))throw new Lr("first is required");if(!Nr(e))throw new Lr("second is required");if(n=Pr(n,!0),t instanceof mo||(t=new mo(t)),e instanceof mo||(e=new mo(e)),"data"===t.scheme)return t.toString();if("data"===e.scheme)return e.toString();Nr(e.authority)&&!Nr(e.scheme)&&("undefined"!=typeof document&&Nr(document.location)&&Nr(document.location.href)?e.scheme=new mo(document.location.href).scheme:e.scheme=t.scheme);var r=t;e.isAbsolute()&&(r=e);var i="";Nr(r.scheme)&&(i+=r.scheme+":"),Nr(r.authority)&&(i+="//"+r.authority,""!==r.path&&"/"!==r.path&&(i=i.replace(/\/?$/,"/"),r.path=r.path.replace(/^\/?/g,""),""===r.authority&&(i+="/"))),i+=r===t?n?t.path.replace(/\/?$/,"/")+e.path.replace(/^\/?/g,""):t.path+e.path:e.path;var o=Nr(t.query),a=Nr(e.query);o&&a?i+="?"+t.query+"&"+e.query:o&&!a?i+="?"+t.query:!o&&a&&(i+="?"+e.query);var s=Nr(e.fragment);return Nr(t.fragment)&&!s?i+="#"+t.fragment:s&&(i+="#"+e.fragment),i}function nS(t,e){this._keymap={},this.addCredential(t,e)}Object.defineProperties(nS.prototype,{value:{get:function(){return this._value},set:function(t){this._value=t}},name:{get:function(){return this._name},set:function(t){this._name=t}}}),nS.addToken=function(t){var e,n=t.substring(0,t.indexOf("/realspace")+10);if(Nr(nS.CREDENTIAL._keymap[n]))switch(nS.CREDENTIAL._keymap[n].type){case tS.ISERVER_TOKEN:e="?"+Ro({token:nS.CREDENTIAL._keymap[n].value});break;case tS.IPORTAL_KEY:e="?"+Ro({key:nS.CREDENTIAL._keymap[n].value});break;default:e=""}else switch(nS.CREDENTIAL.name){case tS.ISERVER_TOKEN:e="?"+Ro({token:nS.CREDENTIAL.value});break;case tS.IPORTAL_KEY:e="?"+Ro({key:nS.CREDENTIAL.value});break;default:e="?"+nS.CREDENTIAL.name+"="+nS.CREDENTIAL.value}return eS(t,e,!1)},nS.addTokenWithKey=function(t,e){var n;if(Nr(nS.CREDENTIAL._keymap[t])){if(nS.CREDENTIAL._keymap[t].type instanceof Array){var r,i=nS.CREDENTIAL._keymap[t].type,o=nS.CREDENTIAL._keymap[t].value;(s={})[i[0]]=o[0],r=eS(e,"?"+Ro(s),!1);for(var a=1;a<i.length;a++){(s={})[i[a]]=o[a],r=r+"&"+Ro(s)}return r}switch(nS.CREDENTIAL._keymap[t].type){case tS.ISERVER_TOKEN:n="?"+Ro({token:nS.CREDENTIAL._keymap[t].value});break;case tS.IPORTAL_KEY:n="?"+Ro({key:nS.CREDENTIAL._keymap[t].value});break;default:var s;(s={})[nS.CREDENTIAL._keymap[t].type]=nS.CREDENTIAL._keymap[t].value,n="?"+Ro(s)}}else switch(nS.CREDENTIAL.name){case tS.ISERVER_TOKEN:n="?"+Ro({token:nS.CREDENTIAL.value});break;case tS.IPORTAL_KEY:n="?"+Ro({key:nS.CREDENTIAL.value});break;default:n="?"+nS.CREDENTIAL.name+"="+nS.CREDENTIAL.value}return eS(e,n,!1)},nS.prototype.addCredential=function(t,e){if(t instanceof Array){for(var n=0,r=t.length;n<r;n++)if(this._keymap[t[n].rooturl]={type:t[n].type||tS.ISERVER_TOKEN,value:t[n].value},-1!==t[n].rooturl.indexOf("/realspace")){var i=t[n].rooturl.substring(0,t[n].rooturl.lastIndexOf("/realspace")+10);this._keymap[i]={type:t[n].type||tS.ISERVER_TOKEN,value:t[n].value}}}else{if(this._value=Pr(t,""),null==t)throw new Lr("Credential.value is necessory.");this._name=Pr(e,tS.ISERVER_TOKEN),this._keymap.default={type:this._name,value:this._value}}},nS.CREDENTIAL=null;var rS=484813681109536e-20,iS=Math.PI/2,oS=1e-10,aS=.017453292519943295,sS=57.29577951308232,cS=Math.PI/4,lS=2*Math.PI,uS=3.14159265359,hS={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},fS={ft:{to_meter:.3048},"us-ft":{to_meter:1200/3937}},dS=/[\s_\-\/\(\)]/g;function pS(t,e){if(t[e])return t[e];for(var n,r=Object.keys(t),i=e.toLowerCase().replace(dS,""),o=-1;++o<r.length;)if((n=r[o]).toLowerCase().replace(dS,"")===i)return t[n]}var AS=function(t){var e,n,r,i={},o=t.split("+").map((function(t){return t.trim()})).filter((function(t){return t})).reduce((function(t,e){var n=e.split("=");return n.push(!0),t[n[0].toLowerCase()]=n[1],t}),{}),a={proj:"projName",datum:"datumCode",rf:function(t){i.rf=parseFloat(t)},lat_0:function(t){i.lat0=t*aS},lat_1:function(t){i.lat1=t*aS},lat_2:function(t){i.lat2=t*aS},lat_ts:function(t){i.lat_ts=t*aS},lon_0:function(t){i.long0=t*aS},lon_1:function(t){i.long1=t*aS},lon_2:function(t){i.long2=t*aS},alpha:function(t){i.alpha=parseFloat(t)*aS},lonc:function(t){i.longc=t*aS},x_0:function(t){i.x0=parseFloat(t)},y_0:function(t){i.y0=parseFloat(t)},k_0:function(t){i.k0=parseFloat(t)},k:function(t){i.k0=parseFloat(t)},a:function(t){i.a=parseFloat(t)},b:function(t){i.b=parseFloat(t)},r_a:function(){i.R_A=!0},zone:function(t){i.zone=parseInt(t,10)},south:function(){i.utmSouth=!0},towgs84:function(t){i.datum_params=t.split(",").map((function(t){return parseFloat(t)}))},to_meter:function(t){i.to_meter=parseFloat(t)},units:function(t){i.units=t;var e=pS(fS,t);e&&(i.to_meter=e.to_meter)},from_greenwich:function(t){i.from_greenwich=t*aS},pm:function(t){var e=pS(hS,t);i.from_greenwich=(e||parseFloat(t))*aS},nadgrids:function(t){"@null"===t?i.datumCode="none":i.nadgrids=t},axis:function(t){var e="ewnsud";3===t.length&&-1!==e.indexOf(t.substr(0,1))&&-1!==e.indexOf(t.substr(1,1))&&-1!==e.indexOf(t.substr(2,1))&&(i.axis=t)}};for(e in o)n=o[e],e in a?"function"==typeof(r=a[e])?r(n):i[r]=n:i[e]=n;return"string"==typeof i.datumCode&&"WGS84"!==i.datumCode&&(i.datumCode=i.datumCode.toLowerCase()),i},gS=/\s/,mS=/[A-Za-z]/,yS=/[A-Za-z84]/,vS=/[,\]]/,CS=/[\d\.E\-\+]/;function IS(t){if("string"!=typeof t)throw new Error("not a string");this.text=t.trim(),this.level=0,this.place=0,this.root=null,this.stack=[],this.currentObject=null,this.state=1}function xS(t,e,n){Array.isArray(e)&&(n.unshift(e),e=null);var r=e?{}:t,i=n.reduce((function(t,e){return ES(e,t),t}),r);e&&(t[e]=i)}function ES(t,e){if(Array.isArray(t)){var n=t.shift();if("PARAMETER"===n&&(n=t.shift()),1===t.length)return Array.isArray(t[0])?(e[n]={},void ES(t[0],e[n])):void(e[n]=t[0]);if(t.length)if("TOWGS84"!==n){if("AXIS"===n)return n in e||(e[n]=[]),void e[n].push(t);var r;switch(Array.isArray(n)||(e[n]={}),n){case"UNIT":case"PRIMEM":case"VERT_DATUM":return e[n]={name:t[0].toLowerCase(),convert:t[1]},void(3===t.length&&ES(t[2],e[n]));case"SPHEROID":case"ELLIPSOID":return e[n]={name:t[0],a:t[1],rf:t[2]},void(4===t.length&&ES(t[3],e[n]));case"PROJECTEDCRS":case"PROJCRS":case"GEOGCS":case"GEOCCS":case"PROJCS":case"LOCAL_CS":case"GEODCRS":case"GEODETICCRS":case"GEODETICDATUM":case"EDATUM":case"ENGINEERINGDATUM":case"VERT_CS":case"VERTCRS":case"VERTICALCRS":case"COMPD_CS":case"COMPOUNDCRS":case"ENGINEERINGCRS":case"ENGCRS":case"FITTED_CS":case"LOCAL_DATUM":case"DATUM":return t[0]=["name",t[0]],void xS(e,n,t);default:for(r=-1;++r<t.length;)if(!Array.isArray(t[r]))return ES(t,e[n]);return xS(e,n,t)}}else e[n]=t;else e[n]=!0}else e[t]=!0}IS.prototype.readCharicter=function(){var t=this.text[this.place++];if(4!==this.state)for(;gS.test(t);){if(this.place>=this.text.length)return;t=this.text[this.place++]}switch(this.state){case 1: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}},IS.prototype.afterquote=function(t){if('"'===t)return this.word+='"',void(this.state=4);if(vS.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)},IS.prototype.afterItem=function(t){return","===t?(null!==this.word&&this.currentObject.push(this.word),this.word=null,void(this.state=1)):"]"===t?(this.level--,null!==this.word&&(this.currentObject.push(this.word),this.word=null),this.state=1,this.currentObject=this.stack.pop(),void(this.currentObject||(this.state=-1))):void 0},IS.prototype.number=function(t){if(!CS.test(t)){if(vS.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},IS.prototype.quoted=function(t){'"'!==t?this.word+=t:this.state=5},IS.prototype.keyword=function(t){if(yS.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=1)}if(!vS.test(t))throw new Error("havn't handled \""+t+'" in keyword yet, index '+this.place);this.afterItem(t)}},IS.prototype.neutral=function(t){if(mS.test(t))return this.word=t,void(this.state=2);if('"'===t)return this.word="",void(this.state=4);if(CS.test(t))return this.word=t,void(this.state=3);if(!vS.test(t))throw new Error("havn't handled \""+t+'" in neutral yet, index '+this.place);this.afterItem(t)},IS.prototype.output=function(){for(;this.place<this.text.length;)this.readCharicter();if(-1===this.state)return this.root;throw new Error('unable to parse string "'+this.text+'". State is '+this.state)};function _S(t){return.017453292519943295*t}var bS=function(t){var e=new IS(t).output(),n=e.shift(),r=e.shift();e.unshift(["name",r]),e.unshift(["type",n]);var i={};return ES(e,i),function(t){if("GEOGCS"===t.type?t.projName="longlat":"LOCAL_CS"===t.type?(t.projName="identity",t.local=!0):"object"==typeof t.PROJECTION?t.projName=Object.keys(t.PROJECTION)[0]:t.projName=t.PROJECTION,t.AXIS){for(var e="",n=0,r=t.AXIS.length;n<r;++n){var i=t.AXIS[n][0].toLowerCase();-1!==i.indexOf("north")?e+="n":-1!==i.indexOf("south")?e+="s":-1!==i.indexOf("east")?e+="e":-1!==i.indexOf("west")&&(e+="w")}2===e.length&&(e+="u"),3===e.length&&(t.axis=e)}t.UNIT&&(t.units=t.UNIT.name.toLowerCase(),"metre"===t.units&&(t.units="meter"),t.UNIT.convert&&("GEOGCS"===t.type?t.DATUM&&t.DATUM.SPHEROID&&(t.to_meter=t.UNIT.convert*t.DATUM.SPHEROID.a):t.to_meter=t.UNIT.convert));var o=t.GEOGCS;function a(e){return e*(t.to_meter||1)}"GEOGCS"===t.type&&(o=t),o&&(o.DATUM?t.datumCode=o.DATUM.name.toLowerCase():t.datumCode=o.name.toLowerCase(),"d_"===t.datumCode.slice(0,2)&&(t.datumCode=t.datumCode.slice(2)),"new_zealand_geodetic_datum_1949"!==t.datumCode&&"new_zealand_1949"!==t.datumCode||(t.datumCode="nzgd49"),"wgs_1984"!==t.datumCode&&"world_geodetic_system_1984"!==t.datumCode||("Mercator_Auxiliary_Sphere"===t.PROJECTION&&(t.sphere=!0),t.datumCode="wgs84"),"_ferro"===t.datumCode.slice(-6)&&(t.datumCode=t.datumCode.slice(0,-6)),"_jakarta"===t.datumCode.slice(-8)&&(t.datumCode=t.datumCode.slice(0,-8)),~t.datumCode.indexOf("belge")&&(t.datumCode="rnb72"),o.DATUM&&o.DATUM.SPHEROID&&(t.ellps=o.DATUM.SPHEROID.name.replace("_19","").replace(/[Cc]larke\_18/,"clrk"),"international"===t.ellps.toLowerCase().slice(0,13)&&(t.ellps="intl"),t.a=o.DATUM.SPHEROID.a,t.rf=parseFloat(o.DATUM.SPHEROID.rf,10)),o.DATUM&&o.DATUM.TOWGS84&&(t.datum_params=o.DATUM.TOWGS84),~t.datumCode.indexOf("osgb_1936")&&(t.datumCode="osgb36"),~t.datumCode.indexOf("osni_1952")&&(t.datumCode="osni52"),(~t.datumCode.indexOf("tm65")||~t.datumCode.indexOf("geodetic_datum_of_1965"))&&(t.datumCode="ire65"),"ch1903+"===t.datumCode&&(t.datumCode="ch1903"),~t.datumCode.indexOf("israel")&&(t.datumCode="isr93")),t.b&&!isFinite(t.b)&&(t.b=t.a),[["standard_parallel_1","Standard_Parallel_1"],["standard_parallel_2","Standard_Parallel_2"],["false_easting","False_Easting"],["false_northing","False_Northing"],["central_meridian","Central_Meridian"],["latitude_of_origin","Latitude_Of_Origin"],["latitude_of_origin","Central_Parallel"],["scale_factor","Scale_Factor"],["k0","scale_factor"],["latitude_of_center","Latitude_Of_Center"],["latitude_of_center","Latitude_of_center"],["lat0","latitude_of_center",_S],["longitude_of_center","Longitude_Of_Center"],["longitude_of_center","Longitude_of_center"],["longc","longitude_of_center",_S],["x0","false_easting",a],["y0","false_northing",a],["long0","central_meridian",_S],["lat0","latitude_of_origin",_S],["lat0","standard_parallel_1",_S],["lat1","standard_parallel_1",_S],["lat2","standard_parallel_2",_S],["azimuth","Azimuth"],["alpha","azimuth",_S],["srsCode","name"]].forEach((function(e){return n=t,i=(r=e)[0],o=r[1],void(!(i in n)&&o in n&&(n[i]=n[o],3===r.length&&(n[i]=r[2](n[i]))));var n,r,i,o})),t.long0||!t.longc||"Albers_Conic_Equal_Area"!==t.projName&&"Lambert_Azimuthal_Equal_Area"!==t.projName||(t.long0=t.longc),t.lat_ts||!t.lat1||"Stereographic_South_Pole"!==t.projName&&"Polar Stereographic (variant B)"!==t.projName||(t.lat0=_S(t.lat1>0?90:-90),t.lat_ts=t.lat1)}(i),i};function wS(t){var e=this;if(2===arguments.length){var n=arguments[1];"string"==typeof n?"+"===n.charAt(0)?wS[t]=AS(arguments[1]):wS[t]=bS(arguments[1]):wS[t]=n}else if(1===arguments.length){if(Array.isArray(t))return t.map((function(t){Array.isArray(t)?wS.apply(e,t):wS(t)}));if("string"==typeof t){if(t in wS)return wS[t]}else"EPSG"in t?wS["EPSG:"+t.EPSG]=t:"ESRI"in t?wS["ESRI:"+t.ESRI]=t:"IAU2000"in t?wS["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"]}(wS);var MS=["PROJECTEDCRS","PROJCRS","GEOGCS","GEOCCS","PROJCS","LOCAL_CS","GEODCRS","GEODETICCRS","GEODETICDATUM","ENGCRS","ENGINEERINGCRS"];var TS=["3857","900913","3785","102113"];function BS(t){if(!function(t){return"string"==typeof t}(t))return t;if(function(t){return t in wS}(t))return wS[t];if(function(t){return MS.some((function(e){return t.indexOf(e)>-1}))}(t)){var e=bS(t);if(function(t){var e=pS(t,"authority");if(e){var n=pS(e,"epsg");return n&&TS.indexOf(n)>-1}}(e))return wS["EPSG:3857"];var n=function(t){var e=pS(t,"extension");if(e)return pS(e,"proj4")}(e);return n?AS(n):e}return function(t){return"+"===t[0]}(t)?AS(t):void 0}var SS=function(t,e){var n,r;if(t=t||{},!e)return t;for(r in e)void 0!==(n=e[r])&&(t[r]=n);return t},DS=function(t,e,n){var r=t*e;return n/Math.sqrt(1-r*r)},RS=function(t){return t<0?-1:1},zS=function(t){return Math.abs(t)<=uS?t:t-RS(t)*lS},OS=function(t,e,n){var r=t*n,i=.5*t;return r=Math.pow((1-r)/(1+r),i),Math.tan(.5*(iS-e))/r},NS=function(t,e){for(var n,r,i=.5*t,o=iS-2*Math.atan(e),a=0;a<=15;a++)if(n=t*Math.sin(o),o+=r=iS-2*Math.atan(e*Math.pow((1-n)/(1+n),i))-o,Math.abs(r)<=1e-10)return o;return-9999};var LS={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=DS(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,n,r=t.x,i=t.y;if(i*sS>90&&i*sS<-90&&r*sS>180&&r*sS<-180)return null;if(Math.abs(Math.abs(i)-iS)<=oS)return null;if(this.sphere)e=this.x0+this.a*this.k0*zS(r-this.long0),n=this.y0+this.a*this.k0*Math.log(Math.tan(cS+.5*i));else{var o=Math.sin(i),a=OS(this.e,i,o);e=this.x0+this.a*this.k0*zS(r-this.long0),n=this.y0-this.a*this.k0*Math.log(a)}return t.x=e,t.y=n,t},inverse:function(t){var e,n,r=t.x-this.x0,i=t.y-this.y0;if(this.sphere)n=iS-2*Math.atan(Math.exp(-i/(this.a*this.k0)));else{var o=Math.exp(-i/(this.a*this.k0));if(-9999===(n=NS(this.e,o)))return null}return e=zS(this.long0+r/(this.a*this.k0)),t.x=e,t.y=n,t},names:["Mercator","Popular Visualisation Pseudo Mercator","Mercator_1SP","Mercator_Auxiliary_Sphere","merc"]};function QS(t){return t}var FS=[LS,{init:function(){},forward:QS,inverse:QS,names:["longlat","identity"]}],PS={},kS=[];function US(t,e){var n=kS.length;return t.names?(kS[n]=t,t.names.forEach((function(t){PS[t.toLowerCase()]=n})),this):(console.log(e),!0)}var jS={start:function(){FS.forEach(US)},add:US,get:function(t){if(!t)return!1;var e=t.toLowerCase();return void 0!==PS[e]&&kS[PS[e]]?kS[PS[e]]:void 0}},GS={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."},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"}},HS=GS.WGS84={a:6378137,rf:298.257223563,ellipseName:"WGS 84"};GS.sphere={a:6370997,b:6370997,ellipseName:"Normal Sphere (r=6370997)"};var qS={};function VS(t,e){if(!(this instanceof VS))return new VS(t);e=e||function(t){if(t)throw t};var n=BS(t);if("object"==typeof n){var r=VS.projections.get(n.projName);if(r){if(n.datumCode&&"none"!==n.datumCode){var i=pS(qS,n.datumCode);i&&(n.datum_params=i.towgs84?i.towgs84.split(","):null,n.ellps=i.ellipse,n.datumName=i.datumName?i.datumName:n.datumCode)}n.k0=n.k0||1,n.axis=n.axis||"enu",n.ellps=n.ellps||"wgs84";var o=function(t,e,n,r,i){if(!t){var o=pS(GS,r);o||(o=HS),t=o.a,e=o.b,n=o.rf}return n&&!e&&(e=(1-1/n)*t),(0===n||Math.abs(t-e)<oS)&&(i=!0,e=t),{a:t,b:e,rf:n,sphere:i}}(n.a,n.b,n.rf,n.ellps,n.sphere),a=function(t,e,n,r){var i=t*t,o=e*e,a=(i-o)/i,s=0;return r?(i=(t*=1-a*(.16666666666666666+a*(.04722222222222222+.022156084656084655*a)))*t,a=0):s=Math.sqrt(a),{es:a,e:s,ep2:(i-o)/o}}(o.a,o.b,o.rf,n.R_A),s=n.datum||function(t,e,n,r,i,o){var a={};return a.datum_type=void 0===t||"none"===t?5:4,e&&(a.datum_params=e.map(parseFloat),0===a.datum_params[0]&&0===a.datum_params[1]&&0===a.datum_params[2]||(a.datum_type=1),a.datum_params.length>3&&(0===a.datum_params[3]&&0===a.datum_params[4]&&0===a.datum_params[5]&&0===a.datum_params[6]||(a.datum_type=2,a.datum_params[3]*=rS,a.datum_params[4]*=rS,a.datum_params[5]*=rS,a.datum_params[6]=a.datum_params[6]/1e6+1))),a.a=n,a.b=r,a.es=i,a.ep2=o,a}(n.datumCode,n.datum_params,o.a,o.b,a.es,a.ep2);SS(this,n),SS(this,r),this.a=o.a,this.b=o.b,this.rf=o.rf,this.sphere=o.sphere,this.es=a.es,this.e=a.e,this.ep2=a.ep2,this.datum=s,this.init(),e(null,this)}else e(t)}else e(t)}function YS(t,e,n){var r,i,o,a,s=t.x,c=t.y,l=t.z?t.z:0;if(c<-iS&&c>-1.001*iS)c=-iS;else if(c>iS&&c<1.001*iS)c=iS;else{if(c<-iS)return{x:-1/0,y:-1/0,z:t.z};if(c>iS)return{x:1/0,y:1/0,z:t.z}}return s>Math.PI&&(s-=2*Math.PI),i=Math.sin(c),a=Math.cos(c),o=i*i,{x:((r=n/Math.sqrt(1-e*o))+l)*a*Math.cos(s),y:(r+l)*a*Math.sin(s),z:(r*(1-e)+l)*i}}function KS(t,e,n,r){var i,o,a,s,c,l,u,h,f,d,p,A,g,m,y,v=1e-12,C=t.x,I=t.y,x=t.z?t.z:0;if(i=Math.sqrt(C*C+I*I),o=Math.sqrt(C*C+I*I+x*x),i/n<v){if(m=0,o/n<v)return y=-r,{x:t.x,y:t.y,z:t.z}}else m=Math.atan2(I,C);a=x/o,h=(s=i/o)*(1-e)*(c=1/Math.sqrt(1-e*(2-e)*s*s)),f=a*c,g=0;do{g++,l=e*(u=n/Math.sqrt(1-e*f*f))/(u+(y=i*h+x*f-u*(1-e*f*f))),A=(p=a*(c=1/Math.sqrt(1-l*(2-l)*s*s)))*h-(d=s*(1-l)*c)*f,h=d,f=p}while(A*A>1e-24&&g<30);return{x:m,y:Math.atan(p/Math.abs(d)),z:y}}function WS(t){return 1===t||2===t}qS.wgs84={towgs84:"0,0,0",ellipse:"WGS84",datumName:"WGS84"},qS.ch1903={towgs84:"674.374,15.056,405.346",ellipse:"bessel",datumName:"swiss"},qS.ggrs87={towgs84:"-199.87,74.79,246.62",ellipse:"GRS80",datumName:"Greek_Geodetic_Reference_System_1987"},qS.nad83={towgs84:"0,0,0",ellipse:"GRS80",datumName:"North_American_Datum_1983"},qS.nad27={nadgrids:"@conus,@alaska,@ntv2_0.gsb,@ntv1_can.dat",ellipse:"clrk66",datumName:"North_American_Datum_1927"},qS.potsdam={towgs84:"606.0,23.0,413.0",ellipse:"bessel",datumName:"Potsdam Rauenberg 1950 DHDN"},qS.carthage={towgs84:"-263.0,6.0,431.0",ellipse:"clark80",datumName:"Carthage 1934 Tunisia"},qS.hermannskogel={towgs84:"653.0,-212.0,449.0",ellipse:"bessel",datumName:"Hermannskogel"},qS.osni52={towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"airy",datumName:"Irish National"},qS.ire65={towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"mod_airy",datumName:"Ireland 1965"},qS.rassadiran={towgs84:"-133.63,-157.5,-158.62",ellipse:"intl",datumName:"Rassadiran"},qS.nzgd49={towgs84:"59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993",ellipse:"intl",datumName:"New Zealand Geodetic Datum 1949"},qS.osgb36={towgs84:"446.448,-125.157,542.060,0.1502,0.2470,0.8421,-20.4894",ellipse:"airy",datumName:"Airy 1830"},qS.s_jtsk={towgs84:"589,76,480",ellipse:"bessel",datumName:"S-JTSK (Ferro)"},qS.beduaram={towgs84:"-106,-87,188",ellipse:"clrk80",datumName:"Beduaram"},qS.gunung_segara={towgs84:"-403,684,41",ellipse:"bessel",datumName:"Gunung Segara Jakarta"},qS.rnb72={towgs84:"106.869,-52.2978,103.724,-0.33657,0.456955,-1.84218,1",ellipse:"intl",datumName:"Reseau National Belge 1972"},VS.projections=jS,VS.projections.start();var XS=function(t,e,n){return function(t,e){return t.datum_type===e.datum_type&&!(t.a!==e.a||Math.abs(t.es-e.es)>5e-11)&&(1===t.datum_type?t.datum_params[0]===e.datum_params[0]&&t.datum_params[1]===e.datum_params[1]&&t.datum_params[2]===e.datum_params[2]:2!==t.datum_type||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)||5===t.datum_type||5===e.datum_type?n:t.es!==e.es||t.a!==e.a||WS(t.datum_type)||WS(e.datum_type)?(n=YS(n,t.es,t.a),WS(t.datum_type)&&(n=function(t,e,n){if(1===e)return{x:t.x+n[0],y:t.y+n[1],z:t.z+n[2]};if(2===e){var r=n[0],i=n[1],o=n[2],a=n[3],s=n[4],c=n[5],l=n[6];return{x:l*(t.x-c*t.y+s*t.z)+r,y:l*(c*t.x+t.y-a*t.z)+i,z:l*(-s*t.x+a*t.y+t.z)+o}}}(n,t.datum_type,t.datum_params)),WS(e.datum_type)&&(n=function(t,e,n){if(1===e)return{x:t.x-n[0],y:t.y-n[1],z:t.z-n[2]};if(2===e){var r=n[0],i=n[1],o=n[2],a=n[3],s=n[4],c=n[5],l=n[6],u=(t.x-r)/l,h=(t.y-i)/l,f=(t.z-o)/l;return{x:u+c*h-s*f,y:-c*u+h+a*f,z:s*u-a*h+f}}}(n,e.datum_type,e.datum_params)),KS(n,e.es,e.a,e.b)):n},JS=function(t,e,n){var r,i,o,a=n.x,s=n.y,c=n.z||0,l={};for(o=0;o<3;o++)if(!e||2!==o||void 0!==n.z)switch(0===o?(r=a,i=-1!=="ew".indexOf(t.axis[o])?"x":"y"):1===o?(r=s,i=-1!=="ns".indexOf(t.axis[o])?"y":"x"):(r=c,i="z"),t.axis[o]){case"e":case"w":case"n":case"s":l[i]=r;break;case"u":void 0!==n[i]&&(l.z=r);break;case"d":void 0!==n[i]&&(l.z=-r);break;default:return null}return l},ZS=function(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 $S(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 tD(t,e,n){var r;return Array.isArray(n)&&(n=ZS(n)),function(t){$S(t.x),$S(t.y)}(n),t.datum&&e.datum&&function(t,e){return(1===t.datum.datum_type||2===t.datum.datum_type)&&"WGS84"!==e.datumCode||(1===e.datum.datum_type||2===e.datum.datum_type)&&"WGS84"!==t.datumCode}(t,e)&&(n=tD(t,r=new VS("WGS84"),n),t=r),"enu"!==t.axis&&(n=JS(t,!1,n)),"longlat"===t.projName?n={x:n.x*aS,y:n.y*aS,z:n.z||0}:(t.to_meter&&(n={x:n.x*t.to_meter,y:n.y*t.to_meter,z:n.z||0}),n=t.inverse(n)),t.from_greenwich&&(n.x+=t.from_greenwich),n=XS(t.datum,e.datum,n),e.from_greenwich&&(n={x:n.x-e.from_greenwich,y:n.y,z:n.z||0}),"longlat"===e.projName?n={x:n.x*sS,y:n.y*sS,z:n.z||0}:(n=e.forward(n),e.to_meter&&(n={x:n.x/e.to_meter,y:n.y/e.to_meter,z:n.z||0})),"enu"!==e.axis?JS(e,!0,n):n}var eD=VS("WGS84");function nD(t,e,n){var r,i,o;return Array.isArray(n)?(r=tD(t,e,n)||{x:NaN,y:NaN},n.length>2?void 0!==t.name&&"geocent"===t.name||void 0!==e.name&&"geocent"===e.name?"number"==typeof r.z?[r.x,r.y,r.z].concat(n.splice(3)):[r.x,r.y,n[2]].concat(n.splice(3)):[r.x,r.y].concat(n.splice(2)):[r.x,r.y]):(i=tD(t,e,n),2===(o=Object.keys(n)).length||o.forEach((function(r){if(void 0!==t.name&&"geocent"===t.name||void 0!==e.name&&"geocent"===e.name){if("x"===r||"y"===r||"z"===r)return}else if("x"===r||"y"===r)return;i[r]=n[r]})),i)}function rD(t){return t instanceof VS?t:t.oProj?t.oProj:VS(t)}function iD(t,e,n){t=rD(t);var r,i=!1;return void 0===e?(e=t,t=eD,i=!0):(void 0!==e.x||Array.isArray(e))&&(n=e,e=t,t=eD,i=!0),e=rD(e),n?nD(t,e,n):(r={forward:function(n){return nD(t,e,n)},inverse:function(n){return nD(e,t,n)}},i&&(r.oProj=e),r)}var oD="AJSAJS",aD="AFAFAF",sD=65,cD=73,lD=79,uD=86,hD=90,fD={forward:dD,inverse:function(t){var e=mD(CD(t.toUpperCase()));if(e.lat&&e.lon)return[e.lon,e.lat,e.lon,e.lat];return[e.left,e.bottom,e.right,e.top]},toPoint:pD};function dD(t,e){return e=e||5,function(t,e){var n="00000"+t.easting,r="00000"+t.northing;return t.zoneNumber+t.zoneLetter+(d=t.easting,p=t.northing,A=t.zoneNumber,g=vD(A),m=Math.floor(d/1e5),y=Math.floor(p/1e5)%20,i=m,o=y,a=g,s=a-1,c=oD.charCodeAt(s),l=aD.charCodeAt(s),u=c+i-1,h=l+o,f=!1,u>hD&&(u=u-hD+sD-1,f=!0),(u===cD||c<cD&&u>cD||(u>cD||c<cD)&&f)&&u++,(u===lD||c<lD&&u>lD||(u>lD||c<lD)&&f)&&++u===cD&&u++,u>hD&&(u=u-hD+sD-1),h>uD?(h=h-uD+sD-1,f=!0):f=!1,(h===cD||l<cD&&h>cD||(h>cD||l<cD)&&f)&&h++,(h===lD||l<lD&&h>lD||(h>lD||l<lD)&&f)&&++h===cD&&h++,h>uD&&(h=h-uD+sD-1),String.fromCharCode(u)+String.fromCharCode(h))+n.substr(n.length-5,e)+r.substr(r.length-5,e);var i,o,a,s,c,l,u,h,f;var d,p,A,g,m,y}(function(t){var e,n,r,i,o,a,s,c,l=t.lat,u=t.lon,h=6378137,f=.00669438,d=.9996,p=AD(l),A=AD(u);c=Math.floor((u+180)/6)+1,180===u&&(c=60);l>=56&&l<64&&u>=3&&u<12&&(c=32);l>=72&&l<84&&(u>=0&&u<9?c=31:u>=9&&u<21?c=33:u>=21&&u<33?c=35:u>=33&&u<42&&(c=37));s=AD(6*(c-1)-180+3),e=f/(1-f),n=h/Math.sqrt(1-f*Math.sin(p)*Math.sin(p)),r=Math.tan(p)*Math.tan(p),i=e*Math.cos(p)*Math.cos(p),o=Math.cos(p)*(A-s),a=h*((1-f/4-3*f*f/64-5*f*f*f/256)*p-(3*f/8+3*f*f/32+45*f*f*f/1024)*Math.sin(2*p)+(15*f*f/256+45*f*f*f/1024)*Math.sin(4*p)-35*f*f*f/3072*Math.sin(6*p));var g=d*n*(o+(1-r+i)*o*o*o/6+(5-18*r+r*r+72*i-58*e)*o*o*o*o*o/120)+5e5,m=d*(a+n*Math.tan(p)*(o*o/2+(5-r+9*i+4*i*i)*o*o*o*o/24+(61-58*r+r*r+600*i-330*e)*o*o*o*o*o*o/720));l<0&&(m+=1e7);return{northing:Math.round(m),easting:Math.round(g),zoneNumber:c,zoneLetter:yD(l)}}({lat:t[1],lon:t[0]}),e)}function pD(t){var e=mD(CD(t.toUpperCase()));return e.lat&&e.lon?[e.lon,e.lat]:[(e.left+e.right)/2,(e.top+e.bottom)/2]}function AD(t){return t*(Math.PI/180)}function gD(t){return t/Math.PI*180}function mD(t){var e=t.northing,n=t.easting,r=t.zoneLetter,i=t.zoneNumber;if(i<0||i>60)return null;var o,a,s,c,l,u,h,f,d,p=.9996,A=6378137,g=.00669438,m=(1-Math.sqrt(.99330562))/(1+Math.sqrt(.99330562)),y=n-5e5,v=e;r<"N"&&(v-=1e7),h=6*(i-1)-180+3,o=.006739496752268451,d=(f=v/p/6367449.145945056)+(3*m/2-27*m*m*m/32)*Math.sin(2*f)+(21*m*m/16-55*m*m*m*m/32)*Math.sin(4*f)+151*m*m*m/96*Math.sin(6*f),a=A/Math.sqrt(1-g*Math.sin(d)*Math.sin(d)),s=Math.tan(d)*Math.tan(d),c=o*Math.cos(d)*Math.cos(d),l=.99330562*A/Math.pow(1-g*Math.sin(d)*Math.sin(d),1.5),u=y/(a*p);var C=d-a*Math.tan(d)/l*(u*u/2-(5+3*s+10*c-4*c*c-9*o)*u*u*u*u/24+(61+90*s+298*c+45*s*s-1.6983531815716497-3*c*c)*u*u*u*u*u*u/720);C=gD(C);var I,x=(u-(1+2*s+c)*u*u*u/6+(5-2*c+28*s-3*c*c+8*o+24*s*s)*u*u*u*u*u/120)/Math.cos(d);if(x=h+gD(x),t.accuracy){var E=mD({northing:t.northing+t.accuracy,easting:t.easting+t.accuracy,zoneLetter:t.zoneLetter,zoneNumber:t.zoneNumber});I={top:E.lat,right:E.lon,bottom:C,left:x}}else I={lat:C,lon:x};return I}function yD(t){var e="Z";return 84>=t&&t>=72?e="X":72>t&&t>=64?e="W":64>t&&t>=56?e="V":56>t&&t>=48?e="U":48>t&&t>=40?e="T":40>t&&t>=32?e="S":32>t&&t>=24?e="R":24>t&&t>=16?e="Q":16>t&&t>=8?e="P":8>t&&t>=0?e="N":0>t&&t>=-8?e="M":-8>t&&t>=-16?e="L":-16>t&&t>=-24?e="K":-24>t&&t>=-32?e="J":-32>t&&t>=-40?e="H":-40>t&&t>=-48?e="G":-48>t&&t>=-56?e="F":-56>t&&t>=-64?e="E":-64>t&&t>=-72?e="D":-72>t&&t>=-80&&(e="C"),e}function vD(t){var e=t%6;return 0===e&&(e=6),e}function CD(t){if(t&&0===t.length)throw"MGRSPoint coverting from nothing";for(var e,n=t.length,r=null,i="",o=0;!/[A-Z]/.test(e=t.charAt(o));){if(o>=2)throw"MGRSPoint bad conversion from: "+t;i+=e,o++}var a=parseInt(i,10);if(0===o||o+3>n)throw"MGRSPoint bad conversion from: "+t;var s=t.charAt(o++);if(s<="A"||"B"===s||"Y"===s||s>="Z"||"I"===s||"O"===s)throw"MGRSPoint zone letter "+s+" not handled: "+t;r=t.substring(o,o+=2);for(var c=vD(a),l=function(t,e){var n=oD.charCodeAt(e-1),r=1e5,i=!1;for(;n!==t.charCodeAt(0);){if(++n===cD&&n++,n===lD&&n++,n>hD){if(i)throw"Bad character: "+t;n=sD,i=!0}r+=1e5}return r}(r.charAt(0),c),u=function(t,e){if(t>"V")throw"MGRSPoint given invalid Northing "+t;var n=aD.charCodeAt(e-1),r=0,i=!1;for(;n!==t.charCodeAt(0);){if(++n===cD&&n++,n===lD&&n++,n>uD){if(i)throw"Bad character: "+t;n=sD,i=!0}r+=1e5}return r}(r.charAt(1),c);u<ID(s);)u+=2e6;var h=n-o;if(h%2!=0)throw"MGRSPoint has to have an even number \nof digits after the zone letter and two 100km letters - front \nhalf for easting meters, second half for \nnorthing meters"+t;var f,d,p,A=h/2,g=0,m=0;return A>0&&(f=1e5/Math.pow(10,A),d=t.substring(o,o+A),g=parseFloat(d)*f,p=t.substring(o+A),m=parseFloat(p)*f),{easting:g+l,northing:m+u,zoneLetter:s,zoneNumber:a,accuracy:f}}function ID(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 xD(t,e,n){if(!(this instanceof xD))return new xD(t,e,n);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 r=t.split(",");this.x=parseFloat(r[0],10),this.y=parseFloat(r[1],10),this.z=parseFloat(r[2],10)||0}else this.x=t,this.y=e,this.z=n||0;console.warn("proj4.Point will be removed in version 3, use proj4.toPoint")}xD.fromMGRS=function(t){return new xD(pD(t))},xD.prototype.toMGRS=function(t){return dD([this.x,this.y],t)};var ED=.046875,_D=.01953125,bD=.01068115234375,wD=function(t){var e=[];e[0]=1-t*(.25+t*(ED+t*(_D+t*bD))),e[1]=t*(.75-t*(ED+t*(_D+t*bD)));var n=t*t;return e[2]=n*(.46875-t*(.013020833333333334+.007120768229166667*t)),n*=t,e[3]=n*(.3645833333333333-.005696614583333333*t),e[4]=n*t*.3076171875,e},MD=function(t,e,n,r){return n*=e,e*=e,r[0]*t-n*(r[1]+e*(r[2]+e*(r[3]+e*r[4])))},TD=function(t,e,n){for(var r=1/(1-e),i=t,o=20;o;--o){var a=Math.sin(i),s=1-e*a*a;if(i-=s=(MD(i,a,Math.cos(i),n)-t)*(s*Math.sqrt(s))*r,Math.abs(s)<oS)return i}return i};var BD={init:function(){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.es&&(this.en=wD(this.es),this.ml0=MD(this.lat0,Math.sin(this.lat0),Math.cos(this.lat0),this.en))},forward:function(t){var e,n,r,i=t.x,o=t.y,a=zS(i-this.long0),s=Math.sin(o),c=Math.cos(o);if(this.es){var l=c*a,u=Math.pow(l,2),h=this.ep2*Math.pow(c,2),f=Math.pow(h,2),d=Math.abs(c)>oS?Math.tan(o):0,p=Math.pow(d,2),A=Math.pow(p,2);e=1-this.es*Math.pow(s,2),l/=Math.sqrt(e);var g=MD(o,s,c,this.en);n=this.a*(this.k0*l*(1+u/6*(1-p+h+u/20*(5-18*p+A+14*h-58*p*h+u/42*(61+179*A-A*p-479*p)))))+this.x0,r=this.a*(this.k0*(g-this.ml0+s*a*l/2*(1+u/12*(5-p+9*h+4*f+u/30*(61+A-58*p+270*h-330*p*h+u/56*(1385+543*A-A*p-3111*p))))))+this.y0}else{var m=c*Math.sin(a);if(Math.abs(Math.abs(m)-1)<oS)return 93;if(n=.5*this.a*this.k0*Math.log((1+m)/(1-m))+this.x0,r=c*Math.cos(a)/Math.sqrt(1-Math.pow(m,2)),(m=Math.abs(r))>=1){if(m-1>oS)return 93;r=0}else r=Math.acos(r);o<0&&(r=-r),r=this.a*this.k0*(r-this.lat0)+this.y0}return t.x=n,t.y=r,t},inverse:function(t){var e,n,r,i,o=(t.x-this.x0)*(1/this.a),a=(t.y-this.y0)*(1/this.a);if(this.es)if(e=this.ml0+a/this.k0,n=TD(e,this.es,this.en),Math.abs(n)<iS){var s=Math.sin(n),c=Math.cos(n),l=Math.abs(c)>oS?Math.tan(n):0,u=this.ep2*Math.pow(c,2),h=Math.pow(u,2),f=Math.pow(l,2),d=Math.pow(f,2);e=1-this.es*Math.pow(s,2);var p=o*Math.sqrt(e)/this.k0,A=Math.pow(p,2);r=n-(e*=l)*A/(1-this.es)*.5*(1-A/12*(5+3*f-9*u*f+u-4*h-A/30*(61+90*f-252*u*f+45*d+46*u-A/56*(1385+3633*f+4095*d+1574*d*f)))),i=zS(this.long0+p*(1-A/6*(1+2*f+u-A/20*(5+28*f+24*d+8*u*f+6*u-A/42*(61+662*f+1320*d+720*d*f))))/c)}else r=iS*RS(a),i=0;else{var g=Math.exp(o/this.k0),m=.5*(g-1/g),y=this.lat0+a/this.k0,v=Math.cos(y);e=Math.sqrt((1-Math.pow(v,2))/(1+Math.pow(m,2))),r=Math.asin(e),a<0&&(r=-r),i=0===m&&0===v?0:zS(Math.atan2(m,v)+this.long0)}return t.x=i,t.y=r,t},names:["Transverse_Mercator","Transverse Mercator","tmerc"]},SD=function(t){var e=Math.exp(t);return e=(e-1/e)/2},DD=function(t,e){t=Math.abs(t),e=Math.abs(e);var n=Math.max(t,e),r=Math.min(t,e)/(n||1);return n*Math.sqrt(1+Math.pow(r,2))},RD=function(t){var e=Math.abs(t);return e=function(t){var e=1+t,n=e-1;return 0===n?t:t*Math.log(e)/n}(e*(1+e/(DD(1,e)+1))),t<0?-e:e},zD=function(t,e){for(var n,r=2*Math.cos(2*e),i=t.length-1,o=t[i],a=0;--i>=0;)n=r*o-a+t[i],a=o,o=n;return e+n*Math.sin(2*e)},OD=function(t,e,n){for(var r,i,o=Math.sin(e),a=Math.cos(e),s=SD(n),c=function(t){var e=Math.exp(t);return(e+1/e)/2}(n),l=2*a*c,u=-2*o*s,h=t.length-1,f=t[h],d=0,p=0,A=0;--h>=0;)r=p,i=d,f=l*(p=f)-r-u*(d=A)+t[h],A=u*p-i+l*d;return[(l=o*c)*f-(u=a*s)*A,l*A+u*f]};var ND={init:function(){if(void 0===this.es||this.es<=0)throw new Error("incorrect elliptical usage");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),n=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),n*=e,this.cgb[1]=n*(7/3+e*(e*(-227/45+e*(2704/315+e*(2323/945)))-1.6)),this.cbg[1]=n*(5/3+e*(-16/15+e*(-13/9+e*(904/315+e*(-1522/945))))),n*=e,this.cgb[2]=n*(56/15+e*(-136/35+e*(-1262/105+e*(73814/2835)))),this.cbg[2]=n*(-26/15+e*(34/21+e*(1.6+e*(-12686/2835)))),n*=e,this.cgb[3]=n*(4279/630+e*(-332/35+e*(-399572/14175))),this.cbg[3]=n*(1237/630+e*(e*(-24832/14175)-2.4)),n*=e,this.cgb[4]=n*(4174/315+e*(-144838/6237)),this.cbg[4]=n*(-734/315+e*(109598/31185)),n*=e,this.cgb[5]=n*(601676/22275),this.cbg[5]=n*(444337/155925),n=Math.pow(e,2),this.Qn=this.k0/(1+e)*(1+n*(1/4+n*(1/64+n/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]=n*(-1/48+e*(-1/15+e*(437/1440+e*(-46/105+e*(1118711/3870720))))),this.gtu[1]=n*(13/48+e*(e*(557/1440+e*(281/630+e*(-1983433/1935360)))-.6)),n*=e,this.utg[2]=n*(-17/480+e*(37/840+e*(209/4480+e*(-5569/90720)))),this.gtu[2]=n*(61/240+e*(-103/140+e*(15061/26880+e*(167603/181440)))),n*=e,this.utg[3]=n*(-4397/161280+e*(11/504+e*(830251/7257600))),this.gtu[3]=n*(49561/161280+e*(-179/168+e*(6601661/7257600))),n*=e,this.utg[4]=n*(-4583/161280+e*(108847/3991680)),this.gtu[4]=n*(34729/80640+e*(-3418889/1995840)),n*=e,this.utg[5]=n*(-20648693/638668800),this.gtu[5]=.6650675310896665*n;var r=zD(this.cbg,this.lat0);this.Zb=-this.Qn*(r+function(t,e){for(var n,r=2*Math.cos(e),i=t.length-1,o=t[i],a=0;--i>=0;)n=r*o-a+t[i],a=o,o=n;return Math.sin(e)*n}(this.gtu,2*r))},forward:function(t){var e=zS(t.x-this.long0),n=t.y;n=zD(this.cbg,n);var r=Math.sin(n),i=Math.cos(n),o=Math.sin(e),a=Math.cos(e);n=Math.atan2(r,a*i),e=Math.atan2(o*i,DD(r,i*a)),e=RD(Math.tan(e));var s,c,l=OD(this.gtu,2*n,2*e);return n+=l[0],e+=l[1],Math.abs(e)<=2.623395162778?(s=this.a*(this.Qn*e)+this.x0,c=this.a*(this.Qn*n+this.Zb)+this.y0):(s=1/0,c=1/0),t.x=s,t.y=c,t},inverse:function(t){var e,n,r=(t.x-this.x0)*(1/this.a),i=(t.y-this.y0)*(1/this.a);if(i=(i-this.Zb)/this.Qn,r/=this.Qn,Math.abs(r)<=2.623395162778){var o=OD(this.utg,2*i,2*r);i+=o[0],r+=o[1],r=Math.atan(SD(r));var a=Math.sin(i),s=Math.cos(i),c=Math.sin(r),l=Math.cos(r);i=Math.atan2(a*l,DD(c,l*s)),r=Math.atan2(c,l*s),e=zS(r+this.long0),n=zD(this.cgb,i)}else e=1/0,n=1/0;return t.x=e,t.y=n,t},names:["Extended_Transverse_Mercator","Extended Transverse Mercator","etmerc"]};var LD={init:function(){var t=function(t,e){if(void 0===t){if((t=Math.floor(30*(zS(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)*aS,this.x0=5e5,this.y0=this.utmSouth?1e7:0,this.k0=.9996,ND.init.apply(this),this.forward=ND.forward,this.inverse=ND.inverse},names:["Universal Transverse Mercator System","utm"],dependsOn:"etmerc"},QD=function(t,e){return Math.pow((1-t)/(1+t),e)};var FD={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+cS)/(Math.pow(Math.tan(.5*this.lat0+cS),this.C)*QD(this.e*t,this.ratexp))},forward:function(t){var e=t.x,n=t.y;return t.y=2*Math.atan(this.K*Math.pow(Math.tan(.5*n+cS),this.C)*QD(this.e*Math.sin(n),this.ratexp))-iS,t.x=this.C*e,t},inverse:function(t){for(var e=t.x/this.C,n=t.y,r=Math.pow(Math.tan(.5*n+cS)/this.K,1/this.C),i=20;i>0&&(n=2*Math.atan(r*QD(this.e*Math.sin(t.y),-.5*this.e))-iS,!(Math.abs(n-t.y)<1e-14));--i)t.y=n;return i?(t.x=e,t.y=n,t):null},names:["gauss"]};var PD={init:function(){FD.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,n,r,i;return t.x=zS(t.x-this.long0),FD.forward.apply(this,[t]),e=Math.sin(t.y),n=Math.cos(t.y),r=Math.cos(t.x),i=this.k0*this.R2/(1+this.sinc0*e+this.cosc0*n*r),t.x=i*n*Math.sin(t.x),t.y=i*(this.cosc0*e-this.sinc0*n*r),t.x=this.a*t.x+this.x0,t.y=this.a*t.y+this.y0,t},inverse:function(t){var e,n,r,i,o;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,o=Math.sqrt(t.x*t.x+t.y*t.y)){var a=2*Math.atan2(o,this.R2);e=Math.sin(a),n=Math.cos(a),i=Math.asin(n*this.sinc0+t.y*e*this.cosc0/o),r=Math.atan2(t.x*e,o*this.cosc0*n-t.y*this.sinc0*e)}else i=this.phic0,r=0;return t.x=r,t.y=i,FD.inverse.apply(this,[t]),t.x=zS(t.x+this.long0),t},names:["Stereographic_North_Pole","Oblique_Stereographic","Polar_Stereographic","sterea","Oblique Stereographic Alternative","Double_Stereographic"]};var kD={init:function(){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)<=oS&&(this.k0=.5*(1+RS(this.lat0)*Math.sin(this.lat_ts))):(Math.abs(this.coslat0)<=oS&&(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)<=oS&&(this.k0=.5*this.cons*DS(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts))/OS(this.e,this.con*this.lat_ts,this.con*Math.sin(this.lat_ts))),this.ms1=DS(this.e,this.sinlat0,this.coslat0),this.X0=2*Math.atan(this.ssfn_(this.lat0,this.sinlat0,this.e))-iS,this.cosX0=Math.cos(this.X0),this.sinX0=Math.sin(this.X0))},forward:function(t){var e,n,r,i,o,a,s=t.x,c=t.y,l=Math.sin(c),u=Math.cos(c),h=zS(s-this.long0);return Math.abs(Math.abs(s-this.long0)-Math.PI)<=oS&&Math.abs(c+this.lat0)<=oS?(t.x=NaN,t.y=NaN,t):this.sphere?(e=2*this.k0/(1+this.sinlat0*l+this.coslat0*u*Math.cos(h)),t.x=this.a*e*u*Math.sin(h)+this.x0,t.y=this.a*e*(this.coslat0*l-this.sinlat0*u*Math.cos(h))+this.y0,t):(n=2*Math.atan(this.ssfn_(c,l,this.e))-iS,i=Math.cos(n),r=Math.sin(n),Math.abs(this.coslat0)<=oS?(o=OS(this.e,c*this.con,this.con*l),a=2*this.a*this.k0*o/this.cons,t.x=this.x0+a*Math.sin(s-this.long0),t.y=this.y0-this.con*a*Math.cos(s-this.long0),t):(Math.abs(this.sinlat0)<oS?(e=2*this.a*this.k0/(1+i*Math.cos(h)),t.y=e*r):(e=2*this.a*this.k0*this.ms1/(this.cosX0*(1+this.sinX0*r+this.cosX0*i*Math.cos(h))),t.y=e*(this.cosX0*r-this.sinX0*i*Math.cos(h))+this.y0),t.x=e*i*Math.sin(h)+this.x0,t))},inverse:function(t){var e,n,r,i,o;t.x-=this.x0,t.y-=this.y0;var a=Math.sqrt(t.x*t.x+t.y*t.y);if(this.sphere){var s=2*Math.atan(a/(2*this.a*this.k0));return e=this.long0,n=this.lat0,a<=oS?(t.x=e,t.y=n,t):(n=Math.asin(Math.cos(s)*this.sinlat0+t.y*Math.sin(s)*this.coslat0/a),e=Math.abs(this.coslat0)<oS?this.lat0>0?zS(this.long0+Math.atan2(t.x,-1*t.y)):zS(this.long0+Math.atan2(t.x,t.y)):zS(this.long0+Math.atan2(t.x*Math.sin(s),a*this.coslat0*Math.cos(s)-t.y*this.sinlat0*Math.sin(s))),t.x=e,t.y=n,t)}if(Math.abs(this.coslat0)<=oS){if(a<=oS)return n=this.lat0,e=this.long0,t.x=e,t.y=n,t;t.x*=this.con,t.y*=this.con,r=a*this.cons/(2*this.a*this.k0),n=this.con*NS(this.e,r),e=this.con*zS(this.con*this.long0+Math.atan2(t.x,-1*t.y))}else i=2*Math.atan(a*this.cosX0/(2*this.a*this.k0*this.ms1)),e=this.long0,a<=oS?o=this.X0:(o=Math.asin(Math.cos(i)*this.sinX0+t.y*Math.sin(i)*this.cosX0/a),e=zS(this.long0+Math.atan2(t.x*Math.sin(i),a*this.cosX0*Math.cos(i)-t.y*this.sinX0*Math.sin(i)))),n=-1*NS(this.e,Math.tan(.5*(iS+o)));return t.x=e,t.y=n,t},names:["stere","Stereographic_South_Pole","Polar Stereographic (variant B)"],ssfn_:function(t,e,n){return e*=n,Math.tan(.5*(iS+t))*Math.pow((1-e)/(1+e),.5*n)}};var UD={init:function(){var t=this.lat0;this.lambda0=this.long0;var e=Math.sin(t),n=this.a,r=1/this.rf,i=2*r-Math.pow(r,2),o=this.e=Math.sqrt(i);this.R=this.k0*n*Math.sqrt(1-i)/(1-i*Math.pow(e,2)),this.alpha=Math.sqrt(1+i/(1-i)*Math.pow(Math.cos(t),4)),this.b0=Math.asin(e/this.alpha);var a=Math.log(Math.tan(Math.PI/4+this.b0/2)),s=Math.log(Math.tan(Math.PI/4+t/2)),c=Math.log((1+o*e)/(1-o*e));this.K=a-this.alpha*s+this.alpha*o/2*c},forward:function(t){var e=Math.log(Math.tan(Math.PI/4-t.y/2)),n=this.e/2*Math.log((1+this.e*Math.sin(t.y))/(1-this.e*Math.sin(t.y))),r=-this.alpha*(e+n)+this.K,i=2*(Math.atan(Math.exp(r))-Math.PI/4),o=this.alpha*(t.x-this.lambda0),a=Math.atan(Math.sin(o)/(Math.sin(this.b0)*Math.tan(i)+Math.cos(this.b0)*Math.cos(o))),s=Math.asin(Math.cos(this.b0)*Math.sin(i)-Math.sin(this.b0)*Math.cos(i)*Math.cos(o));return t.y=this.R/2*Math.log((1+Math.sin(s))/(1-Math.sin(s)))+this.y0,t.x=this.R*a+this.x0,t},inverse:function(t){for(var e=t.x-this.x0,n=t.y-this.y0,r=e/this.R,i=2*(Math.atan(Math.exp(n/this.R))-Math.PI/4),o=Math.asin(Math.cos(this.b0)*Math.sin(i)+Math.sin(this.b0)*Math.cos(i)*Math.cos(r)),a=Math.atan(Math.sin(r)/(Math.cos(this.b0)*Math.cos(r)-Math.sin(this.b0)*Math.tan(i))),s=this.lambda0+a/this.alpha,c=0,l=o,u=-1e3,h=0;Math.abs(l-u)>1e-7;){if(++h>20)return;c=1/this.alpha*(Math.log(Math.tan(Math.PI/4+o/2))-this.K)+this.e*Math.log(Math.tan(Math.PI/4+Math.asin(this.e*Math.sin(l))/2)),u=l,l=2*Math.atan(Math.exp(c))-Math.PI/2}return t.x=s,t.y=l,t},names:["somerc"]};var jD={init:function(){this.no_off=this.no_off||!1,this.no_rot=this.no_rot||!1,isNaN(this.k0)&&(this.k0=1);var t=Math.sin(this.lat0),e=Math.cos(this.lat0),n=this.e*t;this.bl=Math.sqrt(1+this.es/(1-this.es)*Math.pow(e,4)),this.al=this.a*this.bl*this.k0*Math.sqrt(1-this.es)/(1-n*n);var r,i,o=OS(this.e,this.lat0,t),a=this.bl/e*Math.sqrt((1-this.es)/(1-n*n));if(a*a<1&&(a=1),isNaN(this.longc)){var s=OS(this.e,this.lat1,Math.sin(this.lat1)),c=OS(this.e,this.lat2,Math.sin(this.lat2));this.lat0>=0?this.el=(a+Math.sqrt(a*a-1))*Math.pow(o,this.bl):this.el=(a-Math.sqrt(a*a-1))*Math.pow(o,this.bl);var l=Math.pow(s,this.bl),u=Math.pow(c,this.bl);i=.5*((r=this.el/l)-1/r);var h=(this.el*this.el-u*l)/(this.el*this.el+u*l),f=(u-l)/(u+l),d=zS(this.long1-this.long2);this.long0=.5*(this.long1+this.long2)-Math.atan(h*Math.tan(.5*this.bl*d)/f)/this.bl,this.long0=zS(this.long0);var p=zS(this.long1-this.long0);this.gamma0=Math.atan(Math.sin(this.bl*p)/i),this.alpha=Math.asin(a*Math.sin(this.gamma0))}else r=this.lat0>=0?a+Math.sqrt(a*a-1):a-Math.sqrt(a*a-1),this.el=r*Math.pow(o,this.bl),i=.5*(r-1/r),this.gamma0=Math.asin(Math.sin(this.alpha)/a),this.long0=this.longc-Math.asin(i*Math.tan(this.gamma0))/this.bl;this.no_off?this.uc=0:this.lat0>=0?this.uc=this.al/this.bl*Math.atan2(Math.sqrt(a*a-1),Math.cos(this.alpha)):this.uc=-1*this.al/this.bl*Math.atan2(Math.sqrt(a*a-1),Math.cos(this.alpha))},forward:function(t){var e,n,r,i=t.x,o=t.y,a=zS(i-this.long0);if(Math.abs(Math.abs(o)-iS)<=oS)r=o>0?-1:1,n=this.al/this.bl*Math.log(Math.tan(cS+r*this.gamma0*.5)),e=-1*r*iS*this.al/this.bl;else{var s=OS(this.e,o,Math.sin(o)),c=this.el/Math.pow(s,this.bl),l=.5*(c-1/c),u=.5*(c+1/c),h=Math.sin(this.bl*a),f=(l*Math.sin(this.gamma0)-h*Math.cos(this.gamma0))/u;n=Math.abs(Math.abs(f)-1)<=oS?Number.POSITIVE_INFINITY:.5*this.al*Math.log((1-f)/(1+f))/this.bl,e=Math.abs(Math.cos(this.bl*a))<=oS?this.al*this.bl*a:this.al*Math.atan2(l*Math.cos(this.gamma0)+h*Math.sin(this.gamma0),Math.cos(this.bl*a))/this.bl}return this.no_rot?(t.x=this.x0+e,t.y=this.y0+n):(e-=this.uc,t.x=this.x0+n*Math.cos(this.alpha)+e*Math.sin(this.alpha),t.y=this.y0+e*Math.cos(this.alpha)-n*Math.sin(this.alpha)),t},inverse:function(t){var e,n;this.no_rot?(n=t.y-this.y0,e=t.x-this.x0):(n=(t.x-this.x0)*Math.cos(this.alpha)-(t.y-this.y0)*Math.sin(this.alpha),e=(t.y-this.y0)*Math.cos(this.alpha)+(t.x-this.x0)*Math.sin(this.alpha),e+=this.uc);var r=Math.exp(-1*this.bl*n/this.al),i=.5*(r-1/r),o=.5*(r+1/r),a=Math.sin(this.bl*e/this.al),s=(a*Math.cos(this.gamma0)+i*Math.sin(this.gamma0))/o,c=Math.pow(this.el/Math.sqrt((1+s)/(1-s)),1/this.bl);return Math.abs(s-1)<oS?(t.x=this.long0,t.y=iS):Math.abs(s+1)<oS?(t.x=this.long0,t.y=-1*iS):(t.y=NS(this.e,c),t.x=zS(this.long0-Math.atan2(i*Math.cos(this.gamma0)-a*Math.sin(this.gamma0),Math.cos(this.bl*e/this.al))/this.bl)),t},names:["Hotine_Oblique_Mercator","Hotine Oblique Mercator","Hotine_Oblique_Mercator_Azimuth_Natural_Origin","Hotine_Oblique_Mercator_Azimuth_Center","omerc"]};var GD={init:function(){if(this.lat2||(this.lat2=this.lat1),this.k0||(this.k0=1),this.x0=this.x0||0,this.y0=this.y0||0,!(Math.abs(this.lat1+this.lat2)<oS)){var t=this.b/this.a;this.e=Math.sqrt(1-t*t);var e=Math.sin(this.lat1),n=Math.cos(this.lat1),r=DS(this.e,e,n),i=OS(this.e,this.lat1,e),o=Math.sin(this.lat2),a=Math.cos(this.lat2),s=DS(this.e,o,a),c=OS(this.e,this.lat2,o),l=OS(this.e,this.lat0,Math.sin(this.lat0));Math.abs(this.lat1-this.lat2)>oS?this.ns=Math.log(r/s)/Math.log(i/c):this.ns=e,isNaN(this.ns)&&(this.ns=e),this.f0=r/(this.ns*Math.pow(i,this.ns)),this.rh=this.a*this.f0*Math.pow(l,this.ns),this.title||(this.title="Lambert Conformal Conic")}},forward:function(t){var e=t.x,n=t.y;Math.abs(2*Math.abs(n)-Math.PI)<=oS&&(n=RS(n)*(iS-2e-10));var r,i,o=Math.abs(Math.abs(n)-iS);if(o>oS)r=OS(this.e,n,Math.sin(n)),i=this.a*this.f0*Math.pow(r,this.ns);else{if((o=n*this.ns)<=0)return null;i=0}var a=this.ns*zS(e-this.long0);return t.x=this.k0*(i*Math.sin(a))+this.x0,t.y=this.k0*(this.rh-i*Math.cos(a))+this.y0,t},inverse:function(t){var e,n,r,i,o,a=(t.x-this.x0)/this.k0,s=this.rh-(t.y-this.y0)/this.k0;this.ns>0?(e=Math.sqrt(a*a+s*s),n=1):(e=-Math.sqrt(a*a+s*s),n=-1);var c=0;if(0!==e&&(c=Math.atan2(n*a,n*s)),0!==e||this.ns>0){if(n=1/this.ns,r=Math.pow(e/(this.a*this.f0),n),-9999===(i=NS(this.e,r)))return null}else i=-iS;return o=zS(c/this.ns+this.long0),t.x=o,t.y=i,t},names:["Lambert Tangential Conformal Conic Projection","Lambert_Conformal_Conic","Lambert_Conformal_Conic_2SP","lcc"]};var HD={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,n,r,i,o,a,s,c=t.x,l=t.y,u=zS(c-this.long0);return e=Math.pow((1+this.e*Math.sin(l))/(1-this.e*Math.sin(l)),this.alfa*this.e/2),n=2*(Math.atan(this.k*Math.pow(Math.tan(l/2+this.s45),this.alfa)/e)-this.s45),r=-u*this.alfa,i=Math.asin(Math.cos(this.ad)*Math.sin(n)+Math.sin(this.ad)*Math.cos(n)*Math.cos(r)),o=Math.asin(Math.cos(n)*Math.sin(r)/Math.cos(i)),a=this.n*o,s=this.ro0*Math.pow(Math.tan(this.s0/2+this.s45),this.n)/Math.pow(Math.tan(i/2+this.s45),this.n),t.y=s*Math.cos(a)/1,t.x=s*Math.sin(a)/1,this.czech||(t.y*=-1,t.x*=-1),t},inverse:function(t){var e,n,r,i,o,a,s,c=t.x;t.x=t.y,t.y=c,this.czech||(t.y*=-1,t.x*=-1),o=Math.sqrt(t.x*t.x+t.y*t.y),i=Math.atan2(t.y,t.x)/Math.sin(this.s0),r=2*(Math.atan(Math.pow(this.ro0/o,1/this.n)*Math.tan(this.s0/2+this.s45))-this.s45),e=Math.asin(Math.cos(this.ad)*Math.sin(r)-Math.sin(this.ad)*Math.cos(r)*Math.cos(i)),n=Math.asin(Math.cos(r)*Math.sin(i)/Math.cos(e)),t.x=this.long0-n/this.alfa,a=e,s=0;var l=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(a))/(1-this.e*Math.sin(a)),this.e/2))-this.s45),Math.abs(a-t.y)<1e-10&&(s=1),a=t.y,l+=1}while(0===s&&l<15);return l>=15?null:t},names:["Krovak","krovak"]},qD=function(t,e,n,r,i){return t*i-e*Math.sin(2*i)+n*Math.sin(4*i)-r*Math.sin(6*i)},VD=function(t){return 1-.25*t*(1+t/16*(3+1.25*t))},YD=function(t){return.375*t*(1+.25*t*(1+.46875*t))},KD=function(t){return.05859375*t*t*(1+.75*t)},WD=function(t){return t*t*t*(35/3072)},XD=function(t,e,n){var r=e*n;return t/Math.sqrt(1-r*r)},JD=function(t){return Math.abs(t)<iS?t:t-RS(t)*Math.PI},ZD=function(t,e,n,r,i){var o,a;o=t/e;for(var s=0;s<15;s++)if(o+=a=(t-(e*o-n*Math.sin(2*o)+r*Math.sin(4*o)-i*Math.sin(6*o)))/(e-2*n*Math.cos(2*o)+4*r*Math.cos(4*o)-6*i*Math.cos(6*o)),Math.abs(a)<=1e-10)return o;return NaN};var $D={init:function(){this.sphere||(this.e0=VD(this.es),this.e1=YD(this.es),this.e2=KD(this.es),this.e3=WD(this.es),this.ml0=this.a*qD(this.e0,this.e1,this.e2,this.e3,this.lat0))},forward:function(t){var e,n,r=t.x,i=t.y;if(r=zS(r-this.long0),this.sphere)e=this.a*Math.asin(Math.cos(i)*Math.sin(r)),n=this.a*(Math.atan2(Math.tan(i),Math.cos(r))-this.lat0);else{var o=Math.sin(i),a=Math.cos(i),s=XD(this.a,this.e,o),c=Math.tan(i)*Math.tan(i),l=r*Math.cos(i),u=l*l,h=this.es*a*a/(1-this.es);e=s*l*(1-u*c*(1/6-(8-c+8*h)*u/120)),n=this.a*qD(this.e0,this.e1,this.e2,this.e3,i)-this.ml0+s*o/a*u*(.5+(5-c+6*h)*u/24)}return t.x=e+this.x0,t.y=n+this.y0,t},inverse:function(t){t.x-=this.x0,t.y-=this.y0;var e,n,r=t.x/this.a,i=t.y/this.a;if(this.sphere){var o=i+this.lat0;e=Math.asin(Math.sin(o)*Math.cos(r)),n=Math.atan2(Math.tan(r),Math.cos(o))}else{var a=this.ml0/this.a+i,s=ZD(a,this.e0,this.e1,this.e2,this.e3);if(Math.abs(Math.abs(s)-iS)<=oS)return t.x=this.long0,t.y=iS,i<0&&(t.y*=-1),t;var c=XD(this.a,this.e,Math.sin(s)),l=c*c*c/this.a/this.a*(1-this.es),u=Math.pow(Math.tan(s),2),h=r*this.a/c,f=h*h;e=s-c*Math.tan(s)/l*h*h*(.5-(1+3*u)*h*h/24),n=h*(1-f*(u/3+(1+3*u)*u*f/15))/Math.cos(s)}return t.x=zS(n+this.long0),t.y=JD(e),t},names:["Cassini","Cassini_Soldner","cass"]},tR=function(t,e){var n;return t>1e-7?(1-t*t)*(e/(1-(n=t*e)*n)-.5/t*Math.log((1-n)/(1+n))):2*e};var eR=.3333333333333333,nR=.17222222222222222,rR=.10257936507936508,iR=.06388888888888888,oR=.0664021164021164,aR=.016415012942191543;var sR={init:function(){var t,e=Math.abs(this.lat0);if(Math.abs(e-iS)<oS?this.mode=this.lat0<0?this.S_POLE:this.N_POLE:Math.abs(e)<oS?this.mode=this.EQUIT:this.mode=this.OBLIQ,this.es>0)switch(this.qp=tR(this.e,1),this.mmf=.5/(1-this.es),this.apa=function(t){var e,n=[];return n[0]=t*eR,e=t*t,n[0]+=e*nR,n[1]=e*iR,e*=t,n[0]+=e*rR,n[1]+=e*oR,n[2]=e*aR,n}(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=tR(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,n,r,i,o,a,s,c,l,u,h=t.x,f=t.y;if(h=zS(h-this.long0),this.sphere){if(o=Math.sin(f),u=Math.cos(f),r=Math.cos(h),this.mode===this.OBLIQ||this.mode===this.EQUIT){if((n=this.mode===this.EQUIT?1+u*r:1+this.sinph0*o+this.cosph0*u*r)<=oS)return null;e=(n=Math.sqrt(2/n))*u*Math.sin(h),n*=this.mode===this.EQUIT?o:this.cosph0*o-this.sinph0*u*r}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(r=-r),Math.abs(f+this.phi0)<oS)return null;n=cS-.5*f,e=(n=2*(this.mode===this.S_POLE?Math.cos(n):Math.sin(n)))*Math.sin(h),n*=r}}else{switch(s=0,c=0,l=0,r=Math.cos(h),i=Math.sin(h),o=Math.sin(f),a=tR(this.e,o),this.mode!==this.OBLIQ&&this.mode!==this.EQUIT||(s=a/this.qp,c=Math.sqrt(1-s*s)),this.mode){case this.OBLIQ:l=1+this.sinb1*s+this.cosb1*c*r;break;case this.EQUIT:l=1+c*r;break;case this.N_POLE:l=iS+f,a=this.qp-a;break;case this.S_POLE:l=f-iS,a=this.qp+a}if(Math.abs(l)<oS)return null;switch(this.mode){case this.OBLIQ:case this.EQUIT:l=Math.sqrt(2/l),n=this.mode===this.OBLIQ?this.ymf*l*(this.cosb1*s-this.sinb1*c*r):(l=Math.sqrt(2/(1+c*r)))*s*this.ymf,e=this.xmf*l*c*i;break;case this.N_POLE:case this.S_POLE:a>=0?(e=(l=Math.sqrt(a))*i,n=r*(this.mode===this.S_POLE?l:-l)):e=n=0}}return t.x=this.a*e+this.x0,t.y=this.a*n+this.y0,t},inverse:function(t){t.x-=this.x0,t.y-=this.y0;var e,n,r,i,o,a,s,c=t.x/this.a,l=t.y/this.a;if(this.sphere){var u,h=0,f=0;if((n=.5*(u=Math.sqrt(c*c+l*l)))>1)return null;switch(n=2*Math.asin(n),this.mode!==this.OBLIQ&&this.mode!==this.EQUIT||(f=Math.sin(n),h=Math.cos(n)),this.mode){case this.EQUIT:n=Math.abs(u)<=oS?0:Math.asin(l*f/u),c*=f,l=h*u;break;case this.OBLIQ:n=Math.abs(u)<=oS?this.phi0:Math.asin(h*this.sinph0+l*f*this.cosph0/u),c*=f*this.cosph0,l=(h-Math.sin(n)*this.sinph0)*u;break;case this.N_POLE:l=-l,n=iS-n;break;case this.S_POLE:n-=iS}e=0!==l||this.mode!==this.EQUIT&&this.mode!==this.OBLIQ?Math.atan2(c,l):0}else{if(s=0,this.mode===this.OBLIQ||this.mode===this.EQUIT){if(c/=this.dd,l*=this.dd,(a=Math.sqrt(c*c+l*l))<oS)return t.x=0,t.y=this.phi0,t;i=2*Math.asin(.5*a/this.rq),r=Math.cos(i),c*=i=Math.sin(i),this.mode===this.OBLIQ?(s=r*this.sinb1+l*i*this.cosb1/a,o=this.qp*s,l=a*this.cosb1*r-l*this.sinb1*i):(s=l*i/a,o=this.qp*s,l=a*r)}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(l=-l),!(o=c*c+l*l))return t.x=0,t.y=this.phi0,t;s=1-o/this.qp,this.mode===this.S_POLE&&(s=-s)}e=Math.atan2(c,l),n=function(t,e){var n=t+t;return t+e[0]*Math.sin(n)+e[1]*Math.sin(n+n)+e[2]*Math.sin(n+n+n)}(Math.asin(s),this.apa)}return t.x=zS(this.long0+e),t.y=n,t},names:["Lambert Azimuthal Equal Area","Lambert_Azimuthal_Equal_Area","laea"],S_POLE:1,N_POLE:2,EQUIT:3,OBLIQ:4},cR=function(t){return Math.abs(t)>1&&(t=t>1?1:-1),Math.asin(t)};var lR={init:function(){Math.abs(this.lat1+this.lat2)<oS||(this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e3=Math.sqrt(this.es),this.sin_po=Math.sin(this.lat1),this.cos_po=Math.cos(this.lat1),this.t1=this.sin_po,this.con=this.sin_po,this.ms1=DS(this.e3,this.sin_po,this.cos_po),this.qs1=tR(this.e3,this.sin_po,this.cos_po),this.sin_po=Math.sin(this.lat2),this.cos_po=Math.cos(this.lat2),this.t2=this.sin_po,this.ms2=DS(this.e3,this.sin_po,this.cos_po),this.qs2=tR(this.e3,this.sin_po,this.cos_po),this.sin_po=Math.sin(this.lat0),this.cos_po=Math.cos(this.lat0),this.t3=this.sin_po,this.qs0=tR(this.e3,this.sin_po,this.cos_po),Math.abs(this.lat1-this.lat2)>oS?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,n=t.y;this.sin_phi=Math.sin(n),this.cos_phi=Math.cos(n);var r=tR(this.e3,this.sin_phi,this.cos_phi),i=this.a*Math.sqrt(this.c-this.ns0*r)/this.ns0,o=this.ns0*zS(e-this.long0),a=i*Math.sin(o)+this.x0,s=this.rh-i*Math.cos(o)+this.y0;return t.x=a,t.y=s,t},inverse:function(t){var e,n,r,i,o,a;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),r=1):(e=-Math.sqrt(t.x*t.x+t.y*t.y),r=-1),i=0,0!==e&&(i=Math.atan2(r*t.x,r*t.y)),r=e*this.ns0/this.a,this.sphere?a=Math.asin((this.c-r*r)/(2*this.ns0)):(n=(this.c-r*r)/this.ns0,a=this.phi1z(this.e3,n)),o=zS(i/this.ns0+this.long0),t.x=o,t.y=a,t},names:["Albers_Conic_Equal_Area","Albers","aea"],phi1z:function(t,e){var n,r,i,o,a=cR(.5*e);if(t<oS)return a;for(var s=t*t,c=1;c<=25;c++)if(a+=o=.5*(i=1-(r=t*(n=Math.sin(a)))*r)*i/Math.cos(a)*(e/(1-s)-n/i+.5/t*Math.log((1-r)/(1+r))),Math.abs(o)<=1e-7)return a;return null}};var uR={init:function(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0),this.infinity_dist=1e3*this.a,this.rc=1},forward:function(t){var e,n,r,i,o,a,s,c=t.x,l=t.y;return r=zS(c-this.long0),e=Math.sin(l),n=Math.cos(l),i=Math.cos(r),(o=this.sin_p14*e+this.cos_p14*n*i)>0||Math.abs(o)<=oS?(a=this.x0+1*this.a*n*Math.sin(r)/o,s=this.y0+1*this.a*(this.cos_p14*e-this.sin_p14*n*i)/o):(a=this.x0+this.infinity_dist*n*Math.sin(r),s=this.y0+this.infinity_dist*(this.cos_p14*e-this.sin_p14*n*i)),t.x=a,t.y=s,t},inverse:function(t){var e,n,r,i,o,a;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))?(i=Math.atan2(e,this.rc),n=Math.sin(i),r=Math.cos(i),a=cR(r*this.sin_p14+t.y*n*this.cos_p14/e),o=Math.atan2(t.x*n,e*this.cos_p14*r-t.y*this.sin_p14*n),o=zS(this.long0+o)):(a=this.phic0,o=0),t.x=o,t.y=a,t},names:["gnom"]};var hR={init:function(){this.sphere||(this.k0=DS(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)))},forward:function(t){var e,n,r=t.x,i=t.y,o=zS(r-this.long0);if(this.sphere)e=this.x0+this.a*o*Math.cos(this.lat_ts),n=this.y0+this.a*Math.sin(i)/Math.cos(this.lat_ts);else{var a=tR(this.e,Math.sin(i));e=this.x0+this.a*this.k0*o,n=this.y0+this.a*a*.5/this.k0}return t.x=e,t.y=n,t},inverse:function(t){var e,n;return t.x-=this.x0,t.y-=this.y0,this.sphere?(e=zS(this.long0+t.x/this.a/Math.cos(this.lat_ts)),n=Math.asin(t.y/this.a*Math.cos(this.lat_ts))):(n=function(t,e){var n=1-(1-t*t)/(2*t)*Math.log((1-t)/(1+t));if(Math.abs(Math.abs(e)-n)<1e-6)return e<0?-1*iS:iS;for(var r,i,o,a,s=Math.asin(.5*e),c=0;c<30;c++)if(i=Math.sin(s),o=Math.cos(s),a=t*i,s+=r=Math.pow(1-a*a,2)/(2*o)*(e/(1-t*t)-i/(1-a*a)+.5/t*Math.log((1-a)/(1+a))),Math.abs(r)<=1e-10)return s;return NaN}(this.e,2*t.y*this.k0/this.a),e=zS(this.long0+t.x/(this.a*this.k0))),t.x=e,t.y=n,t},names:["cea"]};var fR={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,n=t.y,r=zS(e-this.long0),i=JD(n-this.lat0);return t.x=this.x0+this.a*r*this.rc,t.y=this.y0+this.a*i,t},inverse:function(t){var e=t.x,n=t.y;return t.x=zS(this.long0+(e-this.x0)/(this.a*this.rc)),t.y=JD(this.lat0+(n-this.y0)/this.a),t},names:["Equirectangular","Equidistant_Cylindrical","eqc"]};var dR={init:function(){this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e=Math.sqrt(this.es),this.e0=VD(this.es),this.e1=YD(this.es),this.e2=KD(this.es),this.e3=WD(this.es),this.ml0=this.a*qD(this.e0,this.e1,this.e2,this.e3,this.lat0)},forward:function(t){var e,n,r,i=t.x,o=t.y,a=zS(i-this.long0);if(r=a*Math.sin(o),this.sphere)Math.abs(o)<=oS?(e=this.a*a,n=-1*this.a*this.lat0):(e=this.a*Math.sin(r)/Math.tan(o),n=this.a*(JD(o-this.lat0)+(1-Math.cos(r))/Math.tan(o)));else if(Math.abs(o)<=oS)e=this.a*a,n=-1*this.ml0;else{var s=XD(this.a,this.e,Math.sin(o))/Math.tan(o);e=s*Math.sin(r),n=this.a*qD(this.e0,this.e1,this.e2,this.e3,o)-this.ml0+s*(1-Math.cos(r))}return t.x=e+this.x0,t.y=n+this.y0,t},inverse:function(t){var e,n,r,i,o,a,s,c,l;if(r=t.x-this.x0,i=t.y-this.y0,this.sphere)if(Math.abs(i+this.a*this.lat0)<=oS)e=zS(r/this.a+this.long0),n=0;else{var u;for(a=this.lat0+i/this.a,s=r*r/this.a/this.a+a*a,c=a,o=20;o;--o)if(c+=l=-1*(a*(c*(u=Math.tan(c))+1)-c-.5*(c*c+s)*u)/((c-a)/u-1),Math.abs(l)<=oS){n=c;break}e=zS(this.long0+Math.asin(r*Math.tan(c)/this.a)/Math.sin(n))}else if(Math.abs(i+this.ml0)<=oS)n=0,e=zS(this.long0+r/this.a);else{var h,f,d,p,A;for(a=(this.ml0+i)/this.a,s=r*r/this.a/this.a+a*a,c=a,o=20;o;--o)if(A=this.e*Math.sin(c),h=Math.sqrt(1-A*A)*Math.tan(c),f=this.a*qD(this.e0,this.e1,this.e2,this.e3,c),d=this.e0-2*this.e1*Math.cos(2*c)+4*this.e2*Math.cos(4*c)-6*this.e3*Math.cos(6*c),c-=l=(a*(h*(p=f/this.a)+1)-p-.5*h*(p*p+s))/(this.es*Math.sin(2*c)*(p*p+s-2*a*p)/(4*h)+(a-p)*(h*d-2/Math.sin(2*c))-d),Math.abs(l)<=oS){n=c;break}h=Math.sqrt(1-this.es*Math.pow(Math.sin(n),2))*Math.tan(n),e=zS(this.long0+Math.asin(r*h/this.a)/Math.sin(n))}return t.x=e,t.y=n,t},names:["Polyconic","poly"]};var pR={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,n=t.x,r=t.y-this.lat0,i=n-this.long0,o=r/rS*1e-5,a=i,s=1,c=0;for(e=1;e<=10;e++)s*=o,c+=this.A[e]*s;var l,u=c,h=a,f=1,d=0,p=0,A=0;for(e=1;e<=6;e++)l=d*u+f*h,f=f*u-d*h,d=l,p=p+this.B_re[e]*f-this.B_im[e]*d,A=A+this.B_im[e]*f+this.B_re[e]*d;return t.x=A*this.a+this.x0,t.y=p*this.a+this.y0,t},inverse:function(t){var e,n,r=t.x,i=t.y,o=r-this.x0,a=(i-this.y0)/this.a,s=o/this.a,c=1,l=0,u=0,h=0;for(e=1;e<=6;e++)n=l*a+c*s,c=c*a-l*s,l=n,u=u+this.C_re[e]*c-this.C_im[e]*l,h=h+this.C_im[e]*c+this.C_re[e]*l;for(var f=0;f<this.iterations;f++){var d,p=u,A=h,g=a,m=s;for(e=2;e<=6;e++)d=A*u+p*h,p=p*u-A*h,A=d,g+=(e-1)*(this.B_re[e]*p-this.B_im[e]*A),m+=(e-1)*(this.B_im[e]*p+this.B_re[e]*A);p=1,A=0;var y=this.B_re[1],v=this.B_im[1];for(e=2;e<=6;e++)d=A*u+p*h,p=p*u-A*h,A=d,y+=e*(this.B_re[e]*p-this.B_im[e]*A),v+=e*(this.B_im[e]*p+this.B_re[e]*A);var C=y*y+v*v;u=(g*y+m*v)/C,h=(m*y-g*v)/C}var I=u,x=h,E=1,_=0;for(e=1;e<=9;e++)E*=I,_+=this.D[e]*E;var b=this.lat0+_*rS*1e5,w=this.long0+x;return t.x=w,t.y=b,t},names:["New_Zealand_Map_Grid","nzmg"]};var AR={init:function(){},forward:function(t){var e=t.x,n=t.y,r=zS(e-this.long0),i=this.x0+this.a*r,o=this.y0+this.a*Math.log(Math.tan(Math.PI/4+n/2.5))*1.25;return t.x=i,t.y=o,t},inverse:function(t){t.x-=this.x0,t.y-=this.y0;var e=zS(this.long0+t.x/this.a),n=2.5*(Math.atan(Math.exp(.8*t.y/this.a))-Math.PI/4);return t.x=e,t.y=n,t},names:["Miller_Cylindrical","mill"]};var gR={init:function(){this.sphere?(this.n=1,this.m=0,this.es=0,this.C_y=Math.sqrt((this.m+1)/this.n),this.C_x=this.C_y/(this.m+1)):this.en=wD(this.es)},forward:function(t){var e,n,r=t.x,i=t.y;if(r=zS(r-this.long0),this.sphere){if(this.m)for(var o=this.n*Math.sin(i),a=20;a;--a){var s=(this.m*i+Math.sin(i)-o)/(this.m+Math.cos(i));if(i-=s,Math.abs(s)<oS)break}else i=1!==this.n?Math.asin(this.n*Math.sin(i)):i;e=this.a*this.C_x*r*(this.m+Math.cos(i)),n=this.a*this.C_y*i}else{var c=Math.sin(i),l=Math.cos(i);n=this.a*MD(i,c,l,this.en),e=this.a*r*l/Math.sqrt(1-this.es*c*c)}return t.x=e,t.y=n,t},inverse:function(t){var e,n,r,i;return t.x-=this.x0,r=t.x/this.a,t.y-=this.y0,e=t.y/this.a,this.sphere?(e/=this.C_y,r/=this.C_x*(this.m+Math.cos(e)),this.m?e=cR((this.m*e+Math.sin(e))/this.n):1!==this.n&&(e=cR(Math.sin(e)/this.n)),r=zS(r+this.long0),e=JD(e)):(e=TD(t.y/this.a,this.es,this.en),(i=Math.abs(e))<iS?(i=Math.sin(e),n=this.long0+t.x*Math.sqrt(1-this.es*i*i)/(this.a*Math.cos(e)),r=zS(n)):i-oS<iS&&(r=this.long0)),t.x=r,t.y=e,t},names:["Sinusoidal","sinu"]};var mR={init:function(){},forward:function(t){for(var e=t.x,n=t.y,r=zS(e-this.long0),i=n,o=Math.PI*Math.sin(n);;){var a=-(i+Math.sin(i)-o)/(1+Math.cos(i));if(i+=a,Math.abs(a)<oS)break}i/=2,Math.PI/2-Math.abs(n)<oS&&(r=0);var s=.900316316158*this.a*r*Math.cos(i)+this.x0,c=1.4142135623731*this.a*Math.sin(i)+this.y0;return t.x=s,t.y=c,t},inverse:function(t){var e,n;t.x-=this.x0,t.y-=this.y0,n=t.y/(1.4142135623731*this.a),Math.abs(n)>.999999999999&&(n=.999999999999),e=Math.asin(n);var r=zS(this.long0+t.x/(.900316316158*this.a*Math.cos(e)));r<-Math.PI&&(r=-Math.PI),r>Math.PI&&(r=Math.PI),n=(2*e+Math.sin(2*e))/Math.PI,Math.abs(n)>1&&(n=1);var i=Math.asin(n);return t.x=r,t.y=i,t},names:["Mollweide","moll"]};var yR={init:function(){Math.abs(this.lat1+this.lat2)<oS||(this.lat2=this.lat2||this.lat1,this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e=Math.sqrt(this.es),this.e0=VD(this.es),this.e1=YD(this.es),this.e2=KD(this.es),this.e3=WD(this.es),this.sinphi=Math.sin(this.lat1),this.cosphi=Math.cos(this.lat1),this.ms1=DS(this.e,this.sinphi,this.cosphi),this.ml1=qD(this.e0,this.e1,this.e2,this.e3,this.lat1),Math.abs(this.lat1-this.lat2)<oS?this.ns=this.sinphi:(this.sinphi=Math.sin(this.lat2),this.cosphi=Math.cos(this.lat2),this.ms2=DS(this.e,this.sinphi,this.cosphi),this.ml2=qD(this.e0,this.e1,this.e2,this.e3,this.lat2),this.ns=(this.ms1-this.ms2)/(this.ml2-this.ml1)),this.g=this.ml1+this.ms1/this.ns,this.ml0=qD(this.e0,this.e1,this.e2,this.e3,this.lat0),this.rh=this.a*(this.g-this.ml0))},forward:function(t){var e,n=t.x,r=t.y;if(this.sphere)e=this.a*(this.g-r);else{var i=qD(this.e0,this.e1,this.e2,this.e3,r);e=this.a*(this.g-i)}var o=this.ns*zS(n-this.long0),a=this.x0+e*Math.sin(o),s=this.y0+this.rh-e*Math.cos(o);return t.x=a,t.y=s,t},inverse:function(t){var e,n,r,i;t.x-=this.x0,t.y=this.rh-t.y+this.y0,this.ns>=0?(n=Math.sqrt(t.x*t.x+t.y*t.y),e=1):(n=-Math.sqrt(t.x*t.x+t.y*t.y),e=-1);var o=0;if(0!==n&&(o=Math.atan2(e*t.x,e*t.y)),this.sphere)return i=zS(this.long0+o/this.ns),r=JD(this.g-n/this.a),t.x=i,t.y=r,t;var a=this.g-n/this.a;return r=ZD(a,this.e0,this.e1,this.e2,this.e3),i=zS(this.long0+o/this.ns),t.x=i,t.y=r,t},names:["Equidistant_Conic","eqdc"]};var vR={init:function(){this.R=this.a},forward:function(t){var e,n,r=t.x,i=t.y,o=zS(r-this.long0);Math.abs(i)<=oS&&(e=this.x0+this.R*o,n=this.y0);var a=cR(2*Math.abs(i/Math.PI));(Math.abs(o)<=oS||Math.abs(Math.abs(i)-iS)<=oS)&&(e=this.x0,n=i>=0?this.y0+Math.PI*this.R*Math.tan(.5*a):this.y0+Math.PI*this.R*-Math.tan(.5*a));var s=.5*Math.abs(Math.PI/o-o/Math.PI),c=s*s,l=Math.sin(a),u=Math.cos(a),h=u/(l+u-1),f=h*h,d=h*(2/l-1),p=d*d,A=Math.PI*this.R*(s*(h-p)+Math.sqrt(c*(h-p)*(h-p)-(p+c)*(f-p)))/(p+c);o<0&&(A=-A),e=this.x0+A;var g=c+h;return A=Math.PI*this.R*(d*g-s*Math.sqrt((p+c)*(c+1)-g*g))/(p+c),n=i>=0?this.y0+A:this.y0-A,t.x=e,t.y=n,t},inverse:function(t){var e,n,r,i,o,a,s,c,l,u,h,f;return t.x-=this.x0,t.y-=this.y0,h=Math.PI*this.R,o=(r=t.x/h)*r+(i=t.y/h)*i,h=3*(i*i/(c=-2*(a=-Math.abs(i)*(1+o))+1+2*i*i+o*o)+(2*(s=a-2*i*i+r*r)*s*s/c/c/c-9*a*s/c/c)/27)/(l=(a-s*s/3/c)/c)/(u=2*Math.sqrt(-l/3)),Math.abs(h)>1&&(h=h>=0?1:-1),f=Math.acos(h)/3,n=t.y>=0?(-u*Math.cos(f+Math.PI/3)-s/3/c)*Math.PI:-(-u*Math.cos(f+Math.PI/3)-s/3/c)*Math.PI,e=Math.abs(r)<oS?this.long0:zS(this.long0+Math.PI*(o-1+Math.sqrt(1+2*(r*r-i*i)+o*o))/2/r),t.x=e,t.y=n,t},names:["Van_der_Grinten_I","VanDerGrinten","vandg"]};var CR={init:function(){this.sin_p12=Math.sin(this.lat0),this.cos_p12=Math.cos(this.lat0)},forward:function(t){var e,n,r,i,o,a,s,c,l,u,h,f,d,p,A,g,m,y,v,C,I,x,E=t.x,_=t.y,b=Math.sin(t.y),w=Math.cos(t.y),M=zS(E-this.long0);return this.sphere?Math.abs(this.sin_p12-1)<=oS?(t.x=this.x0+this.a*(iS-_)*Math.sin(M),t.y=this.y0-this.a*(iS-_)*Math.cos(M),t):Math.abs(this.sin_p12+1)<=oS?(t.x=this.x0+this.a*(iS+_)*Math.sin(M),t.y=this.y0+this.a*(iS+_)*Math.cos(M),t):(y=this.sin_p12*b+this.cos_p12*w*Math.cos(M),m=(g=Math.acos(y))/Math.sin(g),t.x=this.x0+this.a*m*w*Math.sin(M),t.y=this.y0+this.a*m*(this.cos_p12*b-this.sin_p12*w*Math.cos(M)),t):(e=VD(this.es),n=YD(this.es),r=KD(this.es),i=WD(this.es),Math.abs(this.sin_p12-1)<=oS?(o=this.a*qD(e,n,r,i,iS),a=this.a*qD(e,n,r,i,_),t.x=this.x0+(o-a)*Math.sin(M),t.y=this.y0-(o-a)*Math.cos(M),t):Math.abs(this.sin_p12+1)<=oS?(o=this.a*qD(e,n,r,i,iS),a=this.a*qD(e,n,r,i,_),t.x=this.x0+(o+a)*Math.sin(M),t.y=this.y0+(o+a)*Math.cos(M),t):(s=b/w,c=XD(this.a,this.e,this.sin_p12),l=XD(this.a,this.e,b),u=Math.atan((1-this.es)*s+this.es*c*this.sin_p12/(l*w)),v=0===(h=Math.atan2(Math.sin(M),this.cos_p12*Math.tan(u)-this.sin_p12*Math.cos(M)))?Math.asin(this.cos_p12*Math.sin(u)-this.sin_p12*Math.cos(u)):Math.abs(Math.abs(h)-Math.PI)<=oS?-Math.asin(this.cos_p12*Math.sin(u)-this.sin_p12*Math.cos(u)):Math.asin(Math.sin(M)*Math.cos(u)/Math.sin(h)),f=this.e*this.sin_p12/Math.sqrt(1-this.es),g=c*v*(1-(C=v*v)*(A=(d=this.e*this.cos_p12*Math.cos(h)/Math.sqrt(1-this.es))*d)*(1-A)/6+(I=C*v)/8*(p=f*d)*(1-2*A)+(x=I*v)/120*(A*(4-7*A)-3*f*f*(1-7*A))-x*v/48*p),t.x=this.x0+g*Math.sin(h),t.y=this.y0+g*Math.cos(h),t))},inverse:function(t){var e,n,r,i,o,a,s,c,l,u,h,f,d,p,A,g,m,y,v,C,I,x;if(t.x-=this.x0,t.y-=this.y0,this.sphere){if((e=Math.sqrt(t.x*t.x+t.y*t.y))>2*iS*this.a)return;return n=e/this.a,r=Math.sin(n),i=Math.cos(n),o=this.long0,Math.abs(e)<=oS?a=this.lat0:(a=cR(i*this.sin_p12+t.y*r*this.cos_p12/e),s=Math.abs(this.lat0)-iS,o=Math.abs(s)<=oS?this.lat0>=0?zS(this.long0+Math.atan2(t.x,-t.y)):zS(this.long0-Math.atan2(-t.x,t.y)):zS(this.long0+Math.atan2(t.x*r,e*this.cos_p12*i-t.y*this.sin_p12*r))),t.x=o,t.y=a,t}return c=VD(this.es),l=YD(this.es),u=KD(this.es),h=WD(this.es),Math.abs(this.sin_p12-1)<=oS?(f=this.a*qD(c,l,u,h,iS),e=Math.sqrt(t.x*t.x+t.y*t.y),a=ZD((f-e)/this.a,c,l,u,h),o=zS(this.long0+Math.atan2(t.x,-1*t.y)),t.x=o,t.y=a,t):Math.abs(this.sin_p12+1)<=oS?(f=this.a*qD(c,l,u,h,iS),e=Math.sqrt(t.x*t.x+t.y*t.y),a=ZD((e-f)/this.a,c,l,u,h),o=zS(this.long0+Math.atan2(t.x,t.y)),t.x=o,t.y=a,t):(e=Math.sqrt(t.x*t.x+t.y*t.y),A=Math.atan2(t.x,t.y),d=XD(this.a,this.e,this.sin_p12),g=Math.cos(A),y=-(m=this.e*this.cos_p12*g)*m/(1-this.es),v=3*this.es*(1-y)*this.sin_p12*this.cos_p12*g/(1-this.es),x=1-y*(I=(C=e/d)-y*(1+y)*Math.pow(C,3)/6-v*(1+3*y)*Math.pow(C,4)/24)*I/2-C*I*I*I/6,p=Math.asin(this.sin_p12*Math.cos(I)+this.cos_p12*Math.sin(I)*g),o=zS(this.long0+Math.asin(Math.sin(A)*Math.sin(I)/Math.cos(p))),a=Math.atan((1-this.es*x*this.sin_p12/Math.sin(p))*Math.tan(p)/(1-this.es)),t.x=o,t.y=a,t)},names:["Azimuthal_Equidistant","aeqd"]};var IR={init:function(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0)},forward:function(t){var e,n,r,i,o,a,s,c=t.x,l=t.y;return r=zS(c-this.long0),e=Math.sin(l),n=Math.cos(l),i=Math.cos(r),((o=this.sin_p14*e+this.cos_p14*n*i)>0||Math.abs(o)<=oS)&&(a=1*this.a*n*Math.sin(r),s=this.y0+1*this.a*(this.cos_p14*e-this.sin_p14*n*i)),t.x=a,t.y=s,t},inverse:function(t){var e,n,r,i,o,a,s;return t.x-=this.x0,t.y-=this.y0,e=Math.sqrt(t.x*t.x+t.y*t.y),n=cR(e/this.a),r=Math.sin(n),i=Math.cos(n),a=this.long0,Math.abs(e)<=oS?(s=this.lat0,t.x=a,t.y=s,t):(s=cR(i*this.sin_p14+t.y*r*this.cos_p14/e),o=Math.abs(this.lat0)-iS,Math.abs(o)<=oS?(a=this.lat0>=0?zS(this.long0+Math.atan2(t.x,-t.y)):zS(this.long0-Math.atan2(-t.x,t.y)),t.x=a,t.y=s,t):(a=zS(this.long0+Math.atan2(t.x*r,e*this.cos_p14*i-t.y*this.sin_p14*r)),t.x=a,t.y=s,t))},names:["ortho"]},xR=1,ER=2,_R=3,bR=4,wR=5,MR=6,TR=1,BR=2,SR=3,DR=4;function RR(t,e,n,r){var i;return t<oS?(r.value=TR,i=0):(i=Math.atan2(e,n),Math.abs(i)<=cS?r.value=TR:i>cS&&i<=iS+cS?(r.value=BR,i-=iS):i>iS+cS||i<=-(iS+cS)?(r.value=SR,i=i>=0?i-uS:i+uS):(r.value=DR,i+=iS)),i}function zR(t,e){var n=t+e;return n<-uS?n+=lS:n>+uS&&(n-=lS),n}var OR={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>=iS-cS/2?this.face=wR:this.lat0<=-(iS-cS/2)?this.face=MR:Math.abs(this.long0)<=cS?this.face=xR:Math.abs(this.long0)<=iS+cS?this.face=this.long0>0?ER:bR:this.face=_R,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,n,r,i,o,a,s={x:0,y:0},c={value:0};if(t.x-=this.long0,e=0!==this.es?Math.atan(this.one_minus_f_squared*Math.tan(t.y)):t.y,n=t.x,this.face===wR)i=iS-e,n>=cS&&n<=iS+cS?(c.value=TR,r=n-iS):n>iS+cS||n<=-(iS+cS)?(c.value=BR,r=n>0?n-uS:n+uS):n>-(iS+cS)&&n<=-cS?(c.value=SR,r=n+iS):(c.value=DR,r=n);else if(this.face===MR)i=iS+e,n>=cS&&n<=iS+cS?(c.value=TR,r=-n+iS):n<cS&&n>=-cS?(c.value=BR,r=-n):n<-cS&&n>=-(iS+cS)?(c.value=SR,r=-n-iS):(c.value=DR,r=n>0?-n+uS:-n-uS);else{var l,u,h,f,d,p;this.face===ER?n=zR(n,+iS):this.face===_R?n=zR(n,+uS):this.face===bR&&(n=zR(n,-iS)),f=Math.sin(e),d=Math.cos(e),p=Math.sin(n),l=d*Math.cos(n),u=d*p,h=f,this.face===xR?r=RR(i=Math.acos(l),h,u,c):this.face===ER?r=RR(i=Math.acos(u),h,-l,c):this.face===_R?r=RR(i=Math.acos(-l),h,-u,c):this.face===bR?r=RR(i=Math.acos(-u),h,l,c):(i=r=0,c.value=TR)}return a=Math.atan(12/uS*(r+Math.acos(Math.sin(r)*Math.cos(cS))-iS)),o=Math.sqrt((1-Math.cos(i))/(Math.cos(a)*Math.cos(a))/(1-Math.cos(Math.atan(1/Math.cos(r))))),c.value===BR?a+=iS:c.value===SR?a+=uS:c.value===DR&&(a+=1.5*uS),s.x=o*Math.cos(a),s.y=o*Math.sin(a),s.x=s.x*this.a+this.x0,s.y=s.y*this.a+this.y0,t.x=s.x,t.y=s.y,t},inverse:function(t){var e,n,r,i,o,a,s,c,l,u,h,f,d={lam:0,phi:0},p={value:0};if(t.x=(t.x-this.x0)/this.a,t.y=(t.y-this.y0)/this.a,n=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)?p.value=TR:t.y>=0&&t.y>=Math.abs(t.x)?(p.value=BR,e-=iS):t.x<0&&-t.x>=Math.abs(t.y)?(p.value=SR,e=e<0?e+uS:e-uS):(p.value=DR,e+=iS),l=uS/12*Math.tan(e),o=Math.sin(l)/(Math.cos(l)-1/Math.sqrt(2)),a=Math.atan(o),(s=1-(r=Math.cos(e))*r*(i=Math.tan(n))*i*(1-Math.cos(Math.atan(1/Math.cos(a)))))<-1?s=-1:s>1&&(s=1),this.face===wR)c=Math.acos(s),d.phi=iS-c,p.value===TR?d.lam=a+iS:p.value===BR?d.lam=a<0?a+uS:a-uS:p.value===SR?d.lam=a-iS:d.lam=a;else if(this.face===MR)c=Math.acos(s),d.phi=c-iS,p.value===TR?d.lam=-a+iS:p.value===BR?d.lam=-a:p.value===SR?d.lam=-a-iS:d.lam=a<0?-a-uS:-a+uS;else{var A,g,m;l=(A=s)*A,g=(l+=(m=l>=1?0:Math.sqrt(1-l)*Math.sin(a))*m)>=1?0:Math.sqrt(1-l),p.value===BR?(l=g,g=-m,m=l):p.value===SR?(g=-g,m=-m):p.value===DR&&(l=g,g=m,m=-l),this.face===ER?(l=A,A=-g,g=l):this.face===_R?(A=-A,g=-g):this.face===bR&&(l=A,A=g,g=-l),d.phi=Math.acos(-m)-iS,d.lam=Math.atan2(g,A),this.face===ER?d.lam=zR(d.lam,-iS):this.face===_R?d.lam=zR(d.lam,-uS):this.face===bR&&(d.lam=zR(d.lam,+iS))}return 0!==this.es&&(u=d.phi<0?1:0,h=Math.tan(d.phi),f=this.b/Math.sqrt(h*h+this.one_minus_f_squared),d.phi=Math.atan(Math.sqrt(this.a*this.a-f*f)/(this.one_minus_f*f)),u&&(d.phi=-d.phi)),d.lam+=this.long0,t.x=d.lam,t.y=d.phi,t},names:["Quadrilateralized Spherical Cube","Quadrilateralized_Spherical_Cube","qsc"]},NR=[[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]],LR=[[-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]],QR=.8487,FR=1.3523,PR=sS/5,kR=1/PR,UR=18,jR=function(t,e){return t[0]+e*(t[1]+e*(t[2]+e*t[3]))};var GR={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=zS(t.x-this.long0),n=Math.abs(t.y),r=Math.floor(n*PR);r<0?r=0:r>=UR&&(r=17);var i={x:jR(NR[r],n=sS*(n-kR*r))*e,y:jR(LR[r],n)};return t.y<0&&(i.y=-i.y),i.x=i.x*this.a*QR+this.x0,i.y=i.y*this.a*FR+this.y0,i},inverse:function(t){var e={x:(t.x-this.x0)/(this.a*QR),y:Math.abs(t.y-this.y0)/(this.a*FR)};if(e.y>=1)e.x/=NR[18][0],e.y=t.y<0?-iS:iS;else{var n=Math.floor(e.y*UR);for(n<0?n=0:n>=UR&&(n=17);;)if(LR[n][0]>e.y)--n;else{if(!(LR[n+1][0]<=e.y))break;++n}var r=LR[n],i=5*(e.y-r[0])/(LR[n+1][0]-r[0]);i=function(t,e,n,r){for(var i=e;r;--r){var o=t(i);if(i-=o,Math.abs(o)<n)break}return i}((function(t){return(jR(r,t)-e.y)/function(t,e){return t[1]+e*(2*t[2]+3*e*t[3])}(r,t)}),i,oS,100),e.x/=jR(NR[n],i),e.y=(5*n+i)*aS,t.y<0&&(e.y=-e.y)}return e.x=zS(e.x+this.long0),e},names:["Robinson","robin"]};var HR,qR={init:function(){this.name="geocent"},forward:function(t){return YS(t,this.es,this.a)},inverse:function(t){return KS(t,this.es,this.a,this.b)},names:["Geocentric","geocentric","geocent","Geocent"]};iD.defaultDatum="WGS84",iD.Proj=VS,iD.WGS84=new iD.Proj("WGS84"),iD.Point=xD,iD.toPoint=ZS,iD.defs=wS,iD.transform=tD,iD.mgrs=fD,iD.version="2.6.1",(HR=iD).Proj.projections.add(BD),HR.Proj.projections.add(ND),HR.Proj.projections.add(LD),HR.Proj.projections.add(PD),HR.Proj.projections.add(kD),HR.Proj.projections.add(UD),HR.Proj.projections.add(jD),HR.Proj.projections.add(GD),HR.Proj.projections.add(HD),HR.Proj.projections.add($D),HR.Proj.projections.add(sR),HR.Proj.projections.add(lR),HR.Proj.projections.add(uR),HR.Proj.projections.add(hR),HR.Proj.projections.add(fR),HR.Proj.projections.add(dR),HR.Proj.projections.add(pR),HR.Proj.projections.add(AR),HR.Proj.projections.add(gR),HR.Proj.projections.add(mR),HR.Proj.projections.add(yR),HR.Proj.projections.add(vR),HR.Proj.projections.add(CR),HR.Proj.projections.add(IR),HR.Proj.projections.add(OR),HR.Proj.projections.add(GR),HR.Proj.projections.add(qR);var VR,YR=(VR=!0,function(t,e){var n=VR?function(){if(e){var n=e.apply(t,arguments);return e=null,n}}:function(){};return VR=!1,n}),KR=YR(void 0,(function(){return KR.toString().search("(((.+)+)+)+$").toString().constructor(KR).search("(((.+)+)+)+$")}));KR();const WR={"EPSG:4490":'GEOGCS["China Geodetic Coordinate System 2000",DATUM["China_2000",SPHEROID["CGCS2000",6378137,298.257222101,AUTHORITY["EPSG","1024"]],AUTHORITY["EPSG","1043"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4490"]]',"EPSG:4214":'GEOGCS["Beijing 1954",DATUM["Beijing_1954",SPHEROID["Krassowsky 1940",6378245,298.3],TOWGS84[15.8,-154.4,-82.3,0,0,0,0]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4214"]]',"EPSG:4610":'GEOGCS["Xian 1980",DATUM["Xian_1980",SPHEROID["IAG 1975",6378140,298.257,AUTHORITY["EPSG","7049"]],AUTHORITY["EPSG","6610"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4610"]]'};class XR{constructor(t,e,n){this.epsgCode=t,this.extent=n,this.sceneMode=ml.SCENE3D,Array.isArray(e)&&(this.extent=e),this.getExtent(),this.WKT=e,(!this.WKT||Array.isArray(this.WKT))&&(this.WKT=WR[t]),this.WKT&&iD.defs(t,this.WKT);var r=iD.defs(t);if(!r)throw new Error(t+" was not defined,make sure the WKT param was not null");this.unit=r.units||"degree",this.proj4Projection=iD(t),this._id=Qp++}getExtent(){if(!this._rectifyExtent){var t=this.extent[2]-this.extent[0],e=this.extent[3]-this.extent[1];if(t===e)this._rectifyExtent=[this.extent[0],this.extent[1],this.extent[2],this.extent[3]];else{var n=Math.max(t,e);this._rectifyExtent=[this.extent[0],this.extent[3]-n,this.extent[0]+n,this.extent[3]]}}return this._rectifyExtent}getLngLatCenter(){return this._rectifyLngLatExtent||this.getLngLatExtent(),[this._rectifyLngLatExtent[2]+(this._rectifyLngLatExtent[2]-this._rectifyLngLatExtent[0])/2,this._rectifyLngLatExtent[3]-(this._rectifyLngLatExtent[3]-this._rectifyLngLatExtent[1])/2]}getLngLatExtent(){if(!this._rectifyLngLatExtent){var t=this.proj4Projection.inverse([this.extent[0],this.extent[1]]),e=this.proj4Projection.inverse([this.extent[2],this.extent[3]]),n=e[0]-t[0],r=e[1]-t[1];if(n===r)this._rectifyLngLatExtent=[t[0],t[1],e[0],e[0]];else{var i=Math.max(n,r);this._rectifyLngLatExtent=[t[0],e[1]-i,t[0]+i,e[1]]}}return this._rectifyLngLatExtent}getOrigin(){return[this.extent[0],this.extent[3]]}getEpsgCode(){return this.epsgCode}getUnit(){return this.unit}getWKT(){return this.WKT}getWidth(){return this._rectifyExtent[2]-this._rectifyExtent[0]}getHeight(){return this._rectifyExtent[3]-this._rectifyExtent[1]}getOriginX(){return this._rectifyExtent[0]}getOriginY(){return this._rectifyExtent[3]}toWGS84(t){return this.proj4Projection.inverse(t)}fromWGS84(t){return this.proj4Projection.forward(t)}fromLngLat(t,e){var n=I_.convert(t),r=this.proj4Projection.forward([n.lng,n.lat]);return{x:(r[0]-this.getOriginX())/this.getWidth(),y:(this.getOriginY()-r[1])/this.getHeight(),z:e||0}}toLngLat(t,e){var n=this.proj4Projection.inverse([t*this.getWidth()+this.getOriginX(),this.getOriginY()-e*this.getHeight()]);return new I_(n[0],n[1])}isProj(){return!("degree"==this.unit||"degrees"==this.unit||"d"==this.unit)}static get(t){for(var e in XR)if(XR.hasOwnProperty(e)&&XR[e].getEpsgCode&&XR[e].getEpsgCode()===t)return XR[e];return null}static set(t){var e=t.getEpsgCode().replace(":","").toUpperCase();XR[e]=t}static fromEpsgCode(t,e,n){"number"==typeof t&&(t="EPSG:"+t);let r=XR[t.replace(":","")];if(void 0===r){if(void 0===e||void 0===n)throw new Error("Invalid epsgCode: "+t);return new XR(t,e,n)}return r}}let JR;function ZR(t){let e="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",n="";const r=JR.crypto||JR.webkitCrypto||JR.mozCrypto||JR.oCrypto||JR.msCrypto;for(let i=t;i>0;--i)n+=e[Math.floor(r.getRandomValues(new Uint32Array(1))[0]%.9999*62)];return n}XR.EPSG4326=new XR("EPSG:4326",[-180,-90,180,90]),XR.EPSG4490=new XR("EPSG:4490",[-180,-90,180,90]),XR.EPSG4214=new XR("EPSG:4214",[-180,-90,180,90]),XR.EPSG4610=new XR("EPSG:4610",[-180,-90,180,90]),XR.EPSG3857=new XR("EPSG:3857",[-20037508.3427892,-20037508.3427892,20037508.3427892,20037508.3427892]),JR=Hp()?self:window,ZR(16),ZR(12);var $R,tz=($R=!0,function(t,e){var n=$R?function(){if(e){var n=e.apply(t,arguments);return e=null,n}}:function(){};return $R=!1,n}),ez=tz(void 0,(function(){return ez.toString().search("(((.+)+)+)+$").toString().constructor(ez).search("(((.+)+)+)+$")}));ez();const nz=function(){let t=!0;return function(e,n){const r=t?function(){if(n){const t=n.apply(e,arguments);return n=null,t}}:function(){};return t=!1,r}}(),rz=nz(void 0,(function(){return rz.toString().search("(((.+)+)+)+$").toString().constructor(rz).search("(((.+)+)+)+$")}));rz();class iz{constructor(t,e,n,r){this.z=t,this.x=e,this.y=n,this.key=sz(0,t,t,e,n),r&&(this.indexExtent=r,this.worldWidth=r[2]-r[0],this.worldHeight=r[3]-r[1])}equals(t){return this.z===t.z&&this.x===t.x&&this.y===t.y}getTileBBox(){var t=Math.pow(2,this.z);return this.indexExtent,this.indexExtent[0]+this.worldWidth*this.x/t+","+(this.indexExtent[3]-this.worldHeight*(this.y+1)/t)+","+(this.indexExtent[0]+this.worldWidth*(this.x+1)/t)+","+(this.indexExtent[3]-this.worldHeight*this.y/t)}url(t,e,n,r){const i=this.getTileBBox(),o=function(t,e,n){let r,i="";for(let o=t;o>0;o--)r=1<<o-1,i+=(e&r?1:0)+(n&r?2:0);return i}(this.z,this.x,this.y),a=this.x,s=this.y,c=this.z;var l,u,h;let f=t[(l=this.x,u=this.y,h=t.length,(l+u)%h)].replace("{prefix}",(this.x%16).toString(16)+(this.y%16).toString(16)).replace(/{z}/g,String(c)).replace(/{x}/g,String(a)).replace(/{y}/g,String("tms"===e?Math.pow(2,this.z)-this.y-1:s)).replace("{quadkey}",o).replace("{bbox-epsg-3857}",i).replace("{bbox}",i).replace("{width}",n).replace("{height}",n);if(this.getViewBounds){var d=this.getViewBounds();d&&(f=f.replace("{viewBounds}",d))}return r&&(f=f.replace("{scale}",r)),f}getViewBounds(){var t=Math.pow(2,this.z);let e=this.indexExtent[0]+this.worldWidth*this.x/t,n=this.indexExtent[0]+this.worldWidth*(this.x+1)/t;return'{"leftBottom":{"x":'+e+',"y":'+(this.indexExtent[3]-this.worldHeight*(this.y+1/t))+'},"rightTop":{"x":'+n+',"y":'+(this.indexExtent[3]-this.worldHeight*(this.y/t))+"}}"}toString(){return this.z+"/"+this.x+"/"+this.y}}class oz{constructor(t,e){this.wrap=t,this.canonical=e,this.key=sz(t,e.z,e.z,e.x,e.y)}}class az{constructor(t,e,n,r,i,o){this.overscaledZ=t,this.wrap=e,this.canonical=new iz(n,+r,+i,o),this.key=0===e&&t===n?this.canonical.key:sz(e,t,n,r,i),this.indexExtent=o}equals(t){return this.overscaledZ===t.overscaledZ&&this.wrap===t.wrap&&this.canonical.equals(t.canonical)}scaledTo(t){const e=this.canonical.z-t;return t>this.canonical.z?new az(t,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y,this.indexExtent):new az(t,this.wrap,t,this.canonical.x>>e,this.canonical.y>>e,this.indexExtent)}calculateScaledKey(t,e=!0){if(this.overscaledZ===t&&e)return this.key;if(t>this.canonical.z)return sz(this.wrap*+e,t,this.canonical.z,this.canonical.x,this.canonical.y);{const n=this.canonical.z-t;return sz(this.wrap*+e,t,t,this.canonical.x>>n,this.canonical.y>>n)}}isChildOf(t){if(t.wrap!==this.wrap)return!1;const e=this.canonical.z-t.canonical.z;return 0===t.overscaledZ||t.overscaledZ<this.overscaledZ&&t.canonical.x===this.canonical.x>>e&&t.canonical.y===this.canonical.y>>e}children(t){if(this.overscaledZ>=t)return[new az(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y,this.indexExtent)];const e=this.canonical.z+1,n=2*this.canonical.x,r=2*this.canonical.y;return[new az(e,this.wrap,e,n,r,this.indexExtent),new az(e,this.wrap,e,n+1,r,this.indexExtent),new az(e,this.wrap,e,n,r+1,this.indexExtent),new az(e,this.wrap,e,n+1,r+1,this.indexExtent)]}isLessThan(t){return this.wrap<t.wrap||!(this.wrap>t.wrap)&&(this.overscaledZ<t.overscaledZ||!(this.overscaledZ>t.overscaledZ)&&(this.canonical.x<t.canonical.x||!(this.canonical.x>t.canonical.x)&&this.canonical.y<t.canonical.y))}wrapped(){return new az(this.overscaledZ,0,this.canonical.z,this.canonical.x,this.canonical.y,this.indexExtent)}unwrapTo(t){return new az(this.overscaledZ,t,this.canonical.z,this.canonical.x,this.canonical.y,this.indexExtent)}overscaleFactor(){return Math.pow(2,this.overscaledZ-this.canonical.z)}toUnwrapped(){return new oz(this.wrap,this.canonical)}toString(){return this.overscaledZ+"/"+this.canonical.x+"/"+this.canonical.y}}function sz(t,e,n,r,i){const o=1<<Math.min(n,22);let a=o*(i%o)+r%o;if(t&&n<22){a+=o*o*((t<0?-2*t-1:2*t)%(1<<2*(22-n)))}return 16*(32*a+n)+(e-n)}sA(iz,"CanonicalTileID"),sA(az,"OverscaledTileID",{omit:["projMatrix"]});const cz=function(){let t=!0;return function(e,n){const r=t?function(){if(n){const t=n.apply(e,arguments);return n=null,t}}:function(){};return t=!1,r}}(),lz=cz(void 0,(function(){return lz.toString().search("(((.+)+)+)+$").toString().constructor(lz).search("(((.+)+)+)+$")}));function uz(t,e){if(!e.isReprojectedInTileSpace)return{scale:1<<t.z,x:t.x,y:t.y,x2:t.x+1,y2:t.y+1,projection:e};const n=Math.pow(2,-t.z),r=t.x*n,i=(t.x+1)*n,o=t.y*n,a=(t.y+1)*n,s=w_(r),c=w_(i),l=M_(o),u=M_(a),h=e.project(s,l),f=e.project(c,l),d=e.project(c,u),p=e.project(s,u);let A=Math.min(h.x,f.x,d.x,p.x),g=Math.min(h.y,f.y,d.y,p.y),m=Math.max(h.x,f.x,d.x,p.x),y=Math.max(h.y,f.y,d.y,p.y);const v=n/16;function C(t,n,r,i,o,a){const s=(r+o)/2,c=(i+a)/2,l=e.project(w_(s),M_(c)),u=Math.max(0,A-l.x,g-l.y,l.x-m,l.y-y);A=Math.min(A,l.x),m=Math.max(m,l.x),g=Math.min(g,l.y),y=Math.max(y,l.y),u>v&&(C(t,l,r,i,s,c),C(l,n,s,c,o,a))}C(h,f,r,o,i,o),C(f,d,i,o,i,a),C(d,p,i,a,r,a),C(p,h,r,a,r,o),A-=v,g-=v,m+=v,y+=v;const I=1/Math.max(m-A,y-g);return{scale:I,x:A*I,y:g*I,x2:m*I,y2:y*I,projection:e}}lz();const hz=function(){let t=!0;return function(e,n){const r=t?function(){if(n){const t=n.apply(e,arguments);return n=null,t}}:function(){};return t=!1,r}}(),fz=hz(void 0,(function(){return fz.toString().search("(((.+)+)+)+$").toString().constructor(fz).search("(((.+)+)+)+$")}));fz();const dz=bI.mat4.identity(new Float32Array(16));class pz{constructor(t){this.spec=t,this.name=t.name,this.wrap=!1,this.requiresDraping=!1,this.supportsWorldCopies=!1,this.supportsTerrain=!1,this.supportsFreeCamera=!1,this.zAxisUnit="meters",this.isReprojectedInTileSpace=!0,this.unsupportedLayers=["custom"],this.center=[0,0],this.range=[3.5,7]}project(t,e){return{x:0,y:0,z:0}}unproject(t,e){return new I_(0,0)}projectTilePoint(t,e,n){return{x:t,y:e,z:0}}locationPoint(t,e,n=!0){return t._coordinatePoint(t.locationCoordinate(e),n)}pixelsPerMeter(t,e){return b_(1,t)*e}pixelSpaceConversion(t,e,n){return 1}farthestPixelDistance(t){return function(t){const e=t.fovAboveCenter,n=(t._camera.position[2]*t.worldSize-0)/Math.cos(t._pitch),r=Math.sin(e)*n/Math.sin(Math.max(Math.PI/2-t._pitch-e,.01)),i=Math.sin(t._pitch)*r+n,o=n*(1/t._horizonShift);return Math.min(1.01*i,o)}(t,t.pixelsPerMeter)}pointCoordinate(t,e,n,r){const i=t.horizonLineFromTop(!1),o=new Or(e,Math.max(i,n));return t.rayIntersectionCoordinate(t.pointRayIntersection(o,r))}pointCoordinate3D(t,e,n){const r=new Or(e,n),i=this.pointCoordinate(t,r.x,r.y,0);return[i.x,i.y,i.z]}isPointAboveHorizon(t,e){const n=t.horizonLineFromTop();return e.y<n}createInversionMatrix(t,e){return dz}createTileMatrix(t,e,n){let r,i,o;const a=n.canonical,s=bI.mat4.identity(new Float64Array(16));if(this.isReprojectedInTileSpace){const c=uz(a,this);r=1,i=c.x+n.wrap*c.scale,o=c.y,bI.mat4.scale(s,s,[r/c.scale,r/c.scale,t.pixelsPerMeter/e])}else{r=e/t.zoomScale(a.z);i=(a.x+Math.pow(2,a.z)*n.wrap)*r,o=a.y*r}return bI.mat4.translate(s,s,[i,o,0]),bI.mat4.scale(s,s,[r/Cl,r/Cl,1]),s}upVector(t,e,n){return[0,0,1]}upVectorScale(t,e,n){return{metersToTile:1}}}const Az=function(){let t=!0;return function(e,n){const r=t?function(){if(n){const t=n.apply(e,arguments);return n=null,t}}:function(){};return t=!1,r}}(),gz=Az(void 0,(function(){return gz.toString().search("(((.+)+)+)+$").toString().constructor(gz).search("(((.+)+)+)+$")}));gz();class mz extends pz{constructor(t){super(t),this.range=[4,7],this.center=t.center||[-96,37.5];const[e,n]=this.parallels=t.parallels||[29.5,45.5],r=Math.sin(Dp(e));this.n=(r+Math.sin(Dp(n)))/2,this.c=1+r*(2*this.n-r),this.r0=Math.sqrt(this.c)/this.n}project(t,e){const{n:n,c:r,r0:i}=this,o=Dp(t-this.center[0]),a=Dp(e),s=Math.sqrt(r-2*n*Math.sin(a))/n;return{x:s*Math.sin(o*n),y:s*Math.cos(o*n)-i,z:0}}unproject(t,e){const{n:n,c:r,r0:i}=this,o=i+e;let a=Math.atan2(t,Math.abs(o))*Math.sign(o);o*n<0&&(a-=Math.PI*Math.sign(t)*Math.sign(o));const s=Dp(this.center[0])*n;a=Op(a,-Math.PI-s,Math.PI-s);const c=zp(Rp(a/n)+this.center[0],-180,180),l=Math.asin(zp((r-(t*t+o*o)*n*n)/(2*n),-1,1)),u=zp(Rp(l),-85.051129,T_);return new I_(c,u)}}const yz=function(){let t=!0;return function(e,n){const r=t?function(){if(n){const t=n.apply(e,arguments);return n=null,t}}:function(){};return t=!1,r}}(),vz=yz(void 0,(function(){return vz.toString().search("(((.+)+)+)+$").toString().constructor(vz).search("(((.+)+)+)+$")}));vz();const Cz=1.340264,Iz=-.081106,xz=893e-6,Ez=.003796,_z=Math.sqrt(3)/2;class bz extends pz{project(t,e){e=e/180*Math.PI,t=t/180*Math.PI;const n=Math.asin(_z*Math.sin(e)),r=n*n,i=r*r*r,o=t*Math.cos(n)/(_z*(Cz+3*Iz*r+i*(7*xz+.034164*r))),a=n*(Cz+Iz*r+i*(xz+Ez*r));return{x:.5*(o/Math.PI+.5),y:1-.5*(a/Math.PI+1),z:0}}unproject(t,e){t=(2*t-.5)*Math.PI;let n=e=(2*(1-e)-1)*Math.PI,r=n*n,i=r*r*r;for(let t,o,a,s=0;s<12&&(o=n*(Cz+Iz*r+i*(xz+Ez*r))-e,a=Cz+3*Iz*r+i*(7*xz+.034164*r),t=o/a,n=zp(n-t,-Math.PI/3,Math.PI/3),r=n*n,i=r*r*r,!(Math.abs(t)<1e-12));++s);const o=_z*t*(Cz+3*Iz*r+i*(7*xz+.034164*r))/Math.cos(n),a=Math.asin(Math.sin(n)/_z),s=zp(180*o/Math.PI,-180,180),c=zp(180*a/Math.PI,-85.051129,T_);return new I_(s,c)}}const wz=function(){let t=!0;return function(e,n){const r=t?function(){if(n){const t=n.apply(e,arguments);return n=null,t}}:function(){};return t=!1,r}}(),Mz=wz(void 0,(function(){return Mz.toString().search("(((.+)+)+)+$").toString().constructor(Mz).search("(((.+)+)+)+$")}));Mz();class Tz extends pz{constructor(t){super(t),this.wrap=!0,this.supportsWorldCopies=!0}project(t,e){return{x:.5+t/360,y:.5-e/360,z:0}}unproject(t,e){const n=360*(t-.5),r=zp(360*(.5-e),-85.051129,T_);return new I_(n,r)}}const Bz=function(){let t=!0;return function(e,n){const r=t?function(){if(n){const t=n.apply(e,arguments);return n=null,t}}:function(){};return t=!1,r}}(),Sz=Bz(void 0,(function(){return Sz.toString().search("(((.+)+)+)+$").toString().constructor(Sz).search("(((.+)+)+)+$")}));Sz();const Dz=Math.PI/2;function Rz(t){return Math.tan((Dz+t)/2)}class zz extends pz{constructor(t){super(t),this.center=t.center||[0,30];const[e,n]=this.parallels=t.parallels||[30,30];let r=Dp(e),i=Dp(n);this.southernCenter=r+i<0,this.southernCenter&&(r=-r,i=-i);const o=Math.cos(r),a=Rz(r);this.n=r===i?Math.sin(r):Math.log(o/Math.cos(i))/Math.log(Rz(i)/a),this.f=o*Math.pow(Rz(r),this.n)/this.n}project(t,e){e=Dp(e),this.southernCenter&&(e=-e),t=Dp(t-this.center[0]);const n=1e-6,{n:r,f:i}=this;i>0?e<-Dz+n&&(e=-Dz+n):e>Dz-n&&(e=Dz-n);const o=i/Math.pow(Rz(e),r);let a=o*Math.sin(r*t),s=i-o*Math.cos(r*t);return a=.5*(a/Math.PI+.5),s=.5*(s/Math.PI+.5),{x:a,y:this.southernCenter?s:1-s,z:0}}unproject(t,e){t=(2*t-.5)*Math.PI,this.southernCenter&&(e=1-e),e=(2*(1-e)-.5)*Math.PI;const{n:n,f:r}=this,i=r-e,o=Math.sign(i),a=Math.sign(n)*Math.sqrt(t*t+i*i);let s=Math.atan2(t,Math.abs(i))*o;i*n<0&&(s-=Math.PI*Math.sign(t)*o);const c=zp(Rp(s/n)+this.center[0],-180,180),l=zp(Rp(2*Math.atan(Math.pow(r/a,1/n))-Dz),-85.051129,T_);return new I_(c,this.southernCenter?-l:l)}}const Oz=function(){let t=!0;return function(e,n){const r=t?function(){if(n){const t=n.apply(e,arguments);return n=null,t}}:function(){};return t=!1,r}}(),Nz=Oz(void 0,(function(){return Nz.toString().search("(((.+)+)+)+$").toString().constructor(Nz).search("(((.+)+)+)+$")}));Nz();class Lz extends pz{constructor(t){super(t),this.wrap=!0,this.supportsWorldCopies=!0,this.supportsTerrain=!0,this.supportsFreeCamera=!0,this.isReprojectedInTileSpace=!1,this.unsupportedLayers=[],this.range=null}project(t,e){return{x:(180+t)/360,y:__(e),z:0}}unproject(t,e){const n=w_(t),r=M_(e);return new I_(n,r)}}const Qz=function(){let t=!0;return function(e,n){const r=t?function(){if(n){const t=n.apply(e,arguments);return n=null,t}}:function(){};return t=!1,r}}(),Fz=Qz(void 0,(function(){return Fz.toString().search("(((.+)+)+)+$").toString().constructor(Fz).search("(((.+)+)+)+$")}));Fz();const Pz=Dp(T_);class kz extends pz{project(t,e){const n=(e=Dp(e))*e,r=n*n,i=e*(1.007226+n*(.015085+r*(.028874*n-.044475-.005916*r)));return{x:.5*((t=Dp(t))*(.8707-.131979*n+r*(r*(.003971*n-.001529*r)-.013791))/Math.PI+.5),y:1-.5*(i/Math.PI+1),z:0}}unproject(t,e){t=(2*t-.5)*Math.PI;let n=e=(2*(1-e)-1)*Math.PI,r=25,i=0,o=n*n;do{o=n*n;const t=o*o;i=(n*(1.007226+o*(.015085+t*(.028874*o-.044475-.005916*t)))-e)/(1.007226+o*(.045255+t*(.259866*o-.311325-.005916*11*t))),n=zp(n-i,-Pz,Pz)}while(Math.abs(i)>1e-6&&--r>0);o=n*n;const a=zp(Rp(t/(.8707+o*(o*(o*o*o*(.003971-.001529*o)-.013791)-.131979))),-180,180),s=Rp(n);return new I_(a,s)}}const Uz=function(){let t=!0;return function(e,n){const r=t?function(){if(n){const t=n.apply(e,arguments);return n=null,t}}:function(){};return t=!1,r}}(),jz=Uz(void 0,(function(){return jz.toString().search("(((.+)+)+)+$").toString().constructor(jz).search("(((.+)+)+)+$")}));jz();const Gz=Dp(T_);class Hz extends pz{project(t,e){e=Dp(e),t=Dp(t);const n=Math.cos(e),r=2/Math.PI,i=Math.acos(n*Math.cos(t/2)),o=Math.sin(i)/i,a=.5*(t*r+2*n*Math.sin(t/2)/o)||0,s=.5*(e+Math.sin(e)/o)||0;return{x:.5*(a/Math.PI+.5),y:1-.5*(s/Math.PI+1),z:0}}unproject(t,e){let n=t=(2*t-.5)*Math.PI,r=e=(2*(1-e)-1)*Math.PI,i=25;const o=1e-6;let a=0,s=0;do{const i=Math.cos(r),o=Math.sin(r),c=2*o*i,l=o*o,u=i*i,h=Math.cos(n/2),f=Math.sin(n/2),d=2*h*f,p=f*f,A=1-u*h*h,g=A?1/A:0,m=A?Math.acos(i*h)*Math.sqrt(1/A):0,y=.5*(2*m*i*f+2*n/Math.PI)-t,v=.5*(m*o+r)-e,C=.5*g*(u*p+m*i*h*l)+1/Math.PI,I=g*(d*c/4-m*o*f),x=.125*g*(c*f-m*o*u*d),E=.5*g*(l*h+m*p*i)+.5,_=I*x-E*C;a=(v*I-y*E)/_,s=(y*x-v*C)/_,n=zp(n-a,-Math.PI,Math.PI),r=zp(r-s,-Gz,Gz)}while((Math.abs(a)>o||Math.abs(s)>o)&&--i>0);return new I_(Rp(n),Rp(r))}}const qz=function(){let t=!0;return function(e,n){const r=t?function(){if(n){const t=n.apply(e,arguments);return n=null,t}}:function(){};return t=!1,r}}(),Vz=qz(void 0,(function(){return Vz.toString().search("(((.+)+)+)+$").toString().constructor(Vz).search("(((.+)+)+)+$")}));Vz();class Yz extends pz{constructor(t){super(t),this.center=t.center||[0,0],this.parallels=t.parallels||[0,0],this.cosPhi=Math.max(.01,Math.cos(Dp(this.parallels[0]))),this.scale=1/(2*Math.max(Math.PI*this.cosPhi,1/this.cosPhi)),this.wrap=!0,this.supportsWorldCopies=!0}project(t,e){const{scale:n,cosPhi:r}=this;return{x:Dp(t)*r*n+.5,y:-(Math.sin(Dp(e))/r)*n+.5,z:0}}unproject(t,e){const{scale:n,cosPhi:r}=this,i=-(e-.5)/n,o=zp(Rp((t-.5)/n)/r,-180,180),a=i*r,s=Math.asin(zp(a,-1,1)),c=zp(Rp(s),-85.051129,T_);return new I_(o,c)}}const Kz=function(){let t=!0;return function(e,n){const r=t?function(){if(n){const t=n.apply(e,arguments);return n=null,t}}:function(){};return t=!1,r}}(),Wz=Kz(void 0,(function(){return Wz.toString().search("(((.+)+)+)+$").toString().constructor(Wz).search("(((.+)+)+)+$")}));function Xz(t){const e=t.parallels,n=!!e&&Math.abs(e[0]+e[1])<.01;switch(t.name){case"mercator":return new Lz(t);case"equirectangular":return new Tz(t);case"naturalEarth":return new kz(t);case"equalEarth":return new bz(t);case"winkelTripel":return new Hz(t);case"albers":return n?new Yz(t):new mz(t);case"lambertConformalConic":return n?new Yz(t):new zz(t)}throw new Error("Invalid projection name: "+t.name)}Wz();const Jz=function(){let t=!0;return function(e,n){const r=t?function(){if(n){const t=n.apply(e,arguments);return n=null,t}}:function(){};return t=!1,r}}(),Zz=Jz(void 0,(function(){return Zz.toString().search("(((.+)+)+)+$").toString().constructor(Zz).search("(((.+)+)+)+$")}));Zz();let $z=new ri,tO=new ri,eO=new Hr,nO=new wy;var rO=["Unknown","Point","LineString","Polygon"];const iO=[{name:"a_fade_opacity",components:1,type:"Uint8",offset:0,strideInBytes:1}],oO=[{name:"a_fade_opacity",components:1,type:"Uint32",offset:0,strideInBytes:4}];function aO(t,e,n,r,i,o,a,s,c,l,u,h,f){const d=s?Math.min(VB,Math.round(s[0])):0,p=s?Math.min(VB,Math.round(s[1])):0;t.emplaceBack(e,n,Math.round(32*r),Math.round(32*i),o,a,(d<<1)+(c?1:0),p,16*l,16*u,256*h,256*f)}function sO(t){for(const e of t.sections)if(XM(e.text))return!0;return!1}class cO{constructor(t){this.layoutVertexArray=new dg,this.indexArray=new xg,this.programConfigurations=t,this.segments=new dy,this.dynamicLayoutVertexArray=new Dg,this.opacityVertexArray=new gg,this.placedSymbolArray=new kg,this.alongLine=!0}createLngLatQuadsArray(){this.lngLatQuadsArray=new Wg,this.alongLine=!1,this.heightDirty=!0}isEmpty(){return 0===this.layoutVertexArray.length&&0===this.indexArray.length&&0===this.dynamicLayoutVertexArray.length&&0===this.opacityVertexArray.length}upload(t,e,n,r){this.isEmpty()||((n||!this.alongLine&&this.heightDirty)&&(void 0===this.dynamicLayoutVertexBuffer?this.dynamicLayoutVertexBuffer=dm.toVertexBuffer(t,this.dynamicLayoutVertexArray,_w.members,!0):dm.copyFromArrayView(this.dynamicLayoutVertexBuffer,this.dynamicLayoutVertexArray.arrayBuffer,0),!this.alongLine&&(this.heightDirty=!1)),n&&(this.layoutVertexBuffer=dm.toVertexBuffer(t,this.layoutVertexArray,Ew.members),this.indexBuffer=dm.toIndexBuffer(t,this.indexArray,e),this.opacityVertexBuffer=dm.toVertexBuffer(t,this.opacityVertexArray,t.webgpu?oO:iO,!0),this.opacityVertexBuffer.itemSize=1),(n||r)&&this.programConfigurations.upload(t))}updateElevationRequestor(t,e){let n=this.lngLatQuadsArray.get(e.lngLatQuadsIndex),r=n.lng,i=n.lat,o=n.quads;ri.fromRadians(r,i,0,$z),$z.height=t,ri.toCartesian($z,void 0,eO);let a=this._crs;(a.sceneMode==ml.COLUMBUS_VIEW||a.sceneMode==ml.SCENE2D)&&(eO=Rc.convertToColumbusCartesian(eO)),wy.fromCartesian(eO,nO),n.height=$z.height;let s=this.dynamicLayoutVertexArray.bytesPerElement/4,c=4*s,l=e.quadIndex,u=this.dynamicLayoutVertexArray.float32;for(let t=0;t<o;t++){for(let t=0;t<4;t++){let e=l*c+t*s;u[e+4]=nO.high.x,u[e+5]=nO.high.y,u[e+6]=nO.high.z,u[e+7]=nO.low.x,u[e+8]=nO.low.y,u[e+9]=nO.low.z}l++}this.heightDirty=!0}correctHeight(t,e){if(this._elevationProvider=t,this._crs=e,!this.alongLine){this.createElevationRequestors();for(let e=0;e<this.elevationRequestorArray.length;e++){let n=this.elevationRequestorArray[e];t.requestElevation(n)}}}createElevationRequestors(){if(this.elevationRequestorArray)return;this.elevationRequestorArray=[];let t=0;for(let e=0;e<this.lngLatQuadsArray.length;e++){let n=this.lngLatQuadsArray.get(e),r=n.lng,i=n.lat,o=ri.fromRadians(r,i,0),a=n.quads;this.elevationRequestorArray.push(new VC({owner:this,callbackParameter:{quadIndex:t,lngLatQuadsIndex:e},requesCarto:o})),t+=a}}destroy(){if(this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.dynamicLayoutVertexBuffer.destroy(),this.opacityVertexBuffer.destroy(),this.lngLatQuadsArray&&this.lngLatQuadsArray.destroy(),this.elevationRequestorArray)){for(let t=0;t<this.elevationRequestorArray.length;t++){let e=this.elevationRequestorArray[t];this._elevationProvider.cancelRequestor(e)}this.elevationRequestorArray=[]}}}sA(cO,"SymbolBuffers");class lO{constructor(t,e,n){this.layoutVertexArray=new t,this.layoutAttributes=e,this.indexArray=new n,this.segments=new dy,this.collisionVertexArray=new Cg,this.collisionVertexArrayExt=new Ig}upload(t){this.layoutVertexBuffer=dm.toVertexBuffer(t,this.layoutVertexArray,this.layoutAttributes.members),this.indexBuffer=dm.toIndexBuffer(t,this.indexArray),this.collisionVertexBuffer=dm.toVertexBuffer(t,this.collisionVertexArray,bw.members,!0),this.collisionVertexBufferExt=dm.toVertexBuffer(t,this.collisionVertexArrayExt,ww.members,!0)}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.collisionVertexBuffer.destroy(),this.collisionVertexBufferExt.destroy())}}sA(lO,"CollisionBuffers");class uO{constructor(t){this.collisionBoxArray=t.collisionBoxArray,this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((t=>t.id)),this.index=t.index,this.pixelRatio=t.pixelRatio,this.sourceLayerIndex=t.sourceLayerIndex,this.hasPattern=!1,this.hasRTLText=!1,this.fullyClipped=!1,this.webgpu=t.webgpu,this.sortKeyRanges=[],this.collisionCircleArray=[],this.placementInvProjMatrix=bI.mat4.identity([]),this.placementViewportMatrix=bI.mat4.identity([]);const e=this.layers[0]._unevaluatedLayout._values;this.textSizeData=Nw(this.zoom,e["text-size"]),this.iconSizeData=Nw(this.zoom,e["icon-size"]);const n=this.layers[0].layout,r=n.get("symbol-sort-key"),i=n.get("symbol-z-order");this.canOverlap=n.get("text-allow-overlap")||n.get("icon-allow-overlap")||n.get("text-ignore-placement")||n.get("icon-ignore-placement"),this.sortFeaturesByKey="viewport-y"!==i&&void 0!==r.constantOr(1);const o="viewport-y"===i||"auto"===i&&!this.sortFeaturesByKey;this.sortFeaturesByY=o&&this.canOverlap,this.writingModes=n.get("text-writing-mode").map((t=>FT[t])),this.stateDependentLayerIds=this.layers.filter((t=>t.isStateDependent())).map((t=>t.id)),this.sourceID=t.sourceID,this.projection=t.projection}createArrays(){var t=Ew.members;this.text=new cO(new Sm(t,this.layers,this.zoom,(t=>/^text/.test(t))),this.webgpu),this.icon=new cO(new Sm(t,this.layers,this.zoom,(t=>/^icon/.test(t))),this.webgpu),this.glyphOffsetArray=new Gg,this.lineVertexArray=new Hg,this.symbolInstances=new jg}calculateGlyphDependencies(t,e,n,r,i){for(let n=0;n<t.length;n++)if(e[t.charCodeAt(n)]=!0,r&&i){const r=$M[t.charAt(n)];r&&(e[r.charCodeAt(0)]=!0)}}populate(t,e,n,r){const i=this.layers[0],o=i.layout,a=o.get("text-font"),s=o.get("text-field"),c=o.get("icon-image"),l=("constant"!==s.value.kind||s.value.value instanceof $&&!s.value.value.isEmpty()||s.value.value.toString().length>0)&&("constant"!==a.value.kind||a.value.value.length>0),u="constant"!==c.value.kind||!!c.value.value||Object.keys(c.parameters).length>0,h=o.get("symbol-sort-key");if(this.features=[],!l&&!u)return;const f=e.iconDependencies,d=e.glyphDependencies,p=e.availableImages,A=new SA(this.zoom);for(const{feature:e,id:r,index:s,sourceLayerIndex:c}of t){const t=i._featureFilter.needGeometry,g=by(e,t);if(!i._featureFilter.filter(A,g,n))continue;let m,y;if(t||(g.geometry=Iy(e)),l){const t=i.getValueAndResolveTokens("text-field",g,n,p),e=$.factory(t);sO(e)&&(this.hasRTLText=!0),(!this.hasRTLText||"unavailable"===aT||this.hasRTLText&&cT.isParsed())&&(m=Uw(e,i,g))}if(u){const t=i.getValueAndResolveTokens("icon-image",g,n,p);y=t instanceof rt?t:rt.fromString(t)}if(!m&&!y)continue;const v=this.sortFeaturesByKey?h.evaluate(g,{},n):void 0,C={id:r,text:m,icon:y,index:s,sourceLayerIndex:c,geometry:g.geometry,properties:e.properties,type:rO[e.type],sortKey:v};if(this.features.push(C),y&&(f[y.name]=!0),m){const t=a.evaluate(g,{},n).join(","),e="map"===o.get("text-rotation-alignment")&&"point"!==o.get("symbol-placement");this.allowVerticalPlacement=this.writingModes&&this.writingModes.indexOf(FT.vertical)>=0;for(const n of m.sections)if(n.image)f[n.image.name]=!0;else{const r=GM(m.toString()),i=n.fontStack||t,o=d[i]=d[i]||{};this.calculateGlyphDependencies(n.text,o,e,this.allowVerticalPlacement,r)}}}("line"===o.get("symbol-placement")||"line-direction"===o.get("symbol-placement"))&&(this.features=function(t){var e={},n={},r=[],i=0;function o(e){r.push(t[e]),i++}function a(t,e,i){var o=n[t];return delete n[t],n[e]=o,r[o].geometry[0].pop(),r[o].geometry[0]=r[o].geometry[0].concat(i[0]),o}function s(t,n,i){var o=e[n];return delete e[n],e[t]=o,r[o].geometry[0].shift(),r[o].geometry[0]=i[0].concat(r[o].geometry[0]),o}function c(t,e,n){var r=n?e[0][e[0].length-1]:e[0][0];return t+":"+r.x+":"+r.y}for(var l=0;l<t.length;l++){var u=t[l],h=u.geometry,f=u.text?u.text.toString():null;if(f){var d=c(f,h),p=c(f,h,!0);if(d in n&&p in e&&n[d]!==e[p]){var A=s(d,p,h),g=a(d,p,r[A].geometry);delete e[d],delete n[p],n[c(f,r[g].geometry,!0)]=g,r[A].geometry=null}else d in n?a(d,p,h):p in e?s(d,p,h):(o(l),e[d]=i-1,n[p]=i-1)}else o(l)}return r.filter((function(t){return t.geometry}))}(this.features)),this.sortFeaturesByKey&&this.features.sort(((t,e)=>t.sortKey-e.sortKey))}update(t,e,n,r){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(t,e,this.layers,n,r),this.icon.programConfigurations.updatePaintArrays(t,e,this.layers,n,r))}isEmpty(){return 0===this.symbolInstances.length&&!this.hasRTLText}uploadPending(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload||this.text.heightDirty||this.icon.heightDirty}upload(t){!this.uploaded&&this.hasDebugData()&&(this.textCollisionBox.upload(t),this.iconCollisionBox.upload(t)),this.text.upload(t,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload),this.icon.upload(t,this.sortFeaturesByY,!this.uploaded,this.icon.programConfigurations.needsUpload),this.uploaded=!0}destroyDebugData(){this.textCollisionBox.destroy(),this.iconCollisionBox.destroy()}getProjection(){return!this.projectionInstance&&(this.projectionInstance=Xz(this.projection)),this.projectionInstance}destroy(){this.text.destroy(),this.icon.destroy(),this.hasDebugData()&&this.destroyDebugData()}addToLineVertexArray(t,e){const n=this.lineVertexArray.length;if(void 0!==t.segment)for(const{x:t,y:n}of e)this.lineVertexArray.emplaceBack(t,n);return{lineStartIndex:n,lineLength:this.lineVertexArray.length-n}}addSymbols(t,e,n,r,i,o,a,s,c,l,u,h,f,d,p,A,g){const m=t.indexArray,y=t.layoutVertexArray,v=t.segments.prepareSegment(4*e.length,y,m,this.canOverlap?o.sortKey:void 0),C=this.glyphOffsetArray.length,I=v.vertexLength,x=this.allowVerticalPlacement&&a===FT.vertical?Math.PI/2:0,E=o.text&&o.text.sections;if(!i){let n=Kp(A,l,tO,g);t.lngLatQuadsArray.emplaceBack(n.longitude,n.latitude,0,e.length)}for(let r=0;r<e.length;r++){const{tl:i,tr:a,bl:s,br:u,tex:h,pixelOffsetTL:f,pixelOffsetBR:A,minFontScaleX:g,minFontScaleY:C,glyphOffset:I,isSDF:_,sectionIndex:b}=e[r],w=v.vertexLength,M=I[1];aO(y,c.x,c.y,i.x,M+i.y,h.x,h.y,n,_,f.x,f.y,g,C),aO(y,c.x,c.y,a.x,M+a.y,h.x+h.w,h.y,n,_,A.x,f.y,g,C),aO(y,c.x,c.y,s.x,M+s.y,h.x,h.y+h.h,n,_,f.x,A.y,g,C),aO(y,c.x,c.y,u.x,M+u.y,h.x+h.w,h.y+h.h,n,_,A.x,A.y,g,C);const T=wy.fromCartesian(l);uO.addDynamicAttributes(t.dynamicLayoutVertexArray,c.x,c.y,c.z,x,T.high.x,T.high.y,T.high.z,T.low.x,T.low.y,T.low.z,0,0),m.emplaceBack(w,w+1,w+2),m.emplaceBack(w+1,w+2,w+3),v.vertexLength+=4,v.primitiveLength+=2,this.glyphOffsetArray.emplaceBack(I[0]),(r===e.length-1||b!==e[r+1].sectionIndex)&&t.programConfigurations.populatePaintArrays(y.length,o,o.index,{},d,p,E&&E[b])}const _=c;t.placedSymbolArray.emplaceBack(_.x,_.y,_.z,c.x,c.y,C,this.glyphOffsetArray.length-C,I,u,h,c.segment,n?n[0]:0,n?n[1]:0,r[0],r[1],a,0,!1,0,f,0)}_commitLayoutVertex(t,e,n,r,i,o,a){t.emplaceBack(e,n,r,i,o,Math.round(a.x),Math.round(a.y))}_addCollisionDebugVertices(t,e,n,r,i,o,a){const s=n.segments.prepareSegment(4,n.layoutVertexArray,n.indexArray),c=s.vertexLength,l=a.tileAnchorX,u=a.tileAnchorY;for(let t=0;t<4;t++)n.collisionVertexArray.emplaceBack(0,0,0,0);n.collisionVertexArrayExt.emplaceBack(e,-t.padding,-t.padding),n.collisionVertexArrayExt.emplaceBack(e,t.padding,-t.padding),n.collisionVertexArrayExt.emplaceBack(e,t.padding,t.padding),n.collisionVertexArrayExt.emplaceBack(e,-t.padding,t.padding),this._commitLayoutVertex(n.layoutVertexArray,r,i,o,l,u,new Or(t.x1,t.y1)),this._commitLayoutVertex(n.layoutVertexArray,r,i,o,l,u,new Or(t.x2,t.y1)),this._commitLayoutVertex(n.layoutVertexArray,r,i,o,l,u,new Or(t.x2,t.y2)),this._commitLayoutVertex(n.layoutVertexArray,r,i,o,l,u,new Or(t.x1,t.y2)),s.vertexLength+=4;const h=n.indexArray;h.emplaceBack(c,c+1),h.emplaceBack(c+1,c+2),h.emplaceBack(c+2,c+3),h.emplaceBack(c+3,c),s.primitiveLength+=4}_addTextDebugCollisionBoxes(t,e,n,r,i,o){for(let a=r;a<i;a++){const r=n.get(a),i=this.getSymbolInstanceTextSize(t,o,e,a);this._addCollisionDebugVertices(r,i,this.textCollisionBox,r.projectedAnchorX,r.projectedAnchorY,r.projectedAnchorZ,o)}}_addIconDebugCollisionBoxes(t,e,n,r,i,o){for(let a=r;a<i;a++){const r=n.get(a),i=this.getSymbolInstanceIconSize(t,e,o.placedIconSymbolIndex);this._addCollisionDebugVertices(r,i,this.iconCollisionBox,r.projectedAnchorX,r.projectedAnchorY,r.projectedAnchorZ,o)}}generateCollisionDebugBuffers(t,e){this.hasDebugData()&&this.destroyDebugData(),this.textCollisionBox=new lO(yg,Mw.members,zg),this.iconCollisionBox=new lO(yg,Mw.members,zg);const n=Qw(this.iconSizeData,t),r=Qw(this.textSizeData,t);for(let i=0;i<this.symbolInstances.length;i++){const o=this.symbolInstances.get(i);this._addTextDebugCollisionBoxes(r,t,e,o.textBoxStartIndex,o.textBoxEndIndex,o),this._addTextDebugCollisionBoxes(r,t,e,o.verticalTextBoxStartIndex,o.verticalTextBoxEndIndex,o),this._addIconDebugCollisionBoxes(n,t,e,o.iconBoxStartIndex,o.iconBoxEndIndex,o),this._addIconDebugCollisionBoxes(n,t,e,o.verticalIconBoxStartIndex,o.verticalIconBoxEndIndex,o)}}getSymbolInstanceText(t){let e=this.symbolInstances.get(t);return e.rightJustifiedTextSymbolIndex>=0?e.rightJustifiedTextSymbolIndex:e.centerJustifiedTextSymbolIndex>=0?e.centerJustifiedTextSymbolIndex:e.leftJustifiedTextSymbolIndex>=0?e.leftJustifiedTextSymbolIndex:e.verticalPlacedTextSymbolIndex>=0?e.verticalPlacedTextSymbolIndex:t}getSymbolInstanceTextSize(t,e,n,r){const i=e.rightJustifiedTextSymbolIndex>=0?e.rightJustifiedTextSymbolIndex:e.centerJustifiedTextSymbolIndex>=0?e.centerJustifiedTextSymbolIndex:e.leftJustifiedTextSymbolIndex>=0?e.leftJustifiedTextSymbolIndex:e.verticalPlacedTextSymbolIndex>=0?e.verticalPlacedTextSymbolIndex:r,o=this.text.placedSymbolArray.get(i),a=Lw(this.textSizeData,t,o)/Dw;return this.tilePixelRatio*a}getSymbolInstanceIconSize(t,e,n){const r=this.icon.placedSymbolArray.get(n),i=Lw(this.iconSizeData,t,r);return this.tilePixelRatio*i}_commitDebugCollisionVertexUpdate(t,e,n){t.emplaceBack(e,-n,-n),t.emplaceBack(e,n,-n),t.emplaceBack(e,n,n),t.emplaceBack(e,-n,n)}_updateTextDebugCollisionBoxes(t,e,n,r,i,o){for(let a=r;a<i;a++){const r=n.get(a),i=this.getSymbolInstanceTextSize(t,o,e,a),s=this.textCollisionBox.collisionVertexArrayExt;this._commitDebugCollisionVertexUpdate(s,i,r.padding)}}_updateIconDebugCollisionBoxes(t,e,n,r,i,o){for(let a=r;a<i;a++){const r=n.get(a),i=this.getSymbolInstanceIconSize(t,e,o),s=this.iconCollisionBox.collisionVertexArrayExt;this._commitDebugCollisionVertexUpdate(s,i,r.padding)}}updateCollisionDebugBuffers(t,e){if(!this.hasDebugData())return;this.hasTextCollisionBoxData()&&this.textCollisionBox.collisionVertexArrayExt.clear(),this.hasIconCollisionBoxData()&&this.iconCollisionBox.collisionVertexArrayExt.clear();const n=Qw(this.iconSizeData,t),r=Qw(this.textSizeData,t);for(let i=0;i<this.symbolInstances.length;i++){const o=this.symbolInstances.get(i);this._updateTextDebugCollisionBoxes(r,t,e,o.textBoxStartIndex,o.textBoxEndIndex,o),this._updateTextDebugCollisionBoxes(r,t,e,o.verticalTextBoxStartIndex,o.verticalTextBoxEndIndex,o),this._updateIconDebugCollisionBoxes(n,t,e,o.iconBoxStartIndex,o.iconBoxEndIndex,o.placedIconSymbolIndex),this._updateIconDebugCollisionBoxes(n,t,e,o.verticalIconBoxStartIndex,o.verticalIconBoxEndIndex,o.placedIconSymbolIndex)}this.hasTextCollisionBoxData()&&this.textCollisionBox.collisionVertexBufferExt&&this.textCollisionBox.collisionVertexBufferExt.copyFromArrayView(this.textCollisionBox.collisionVertexArrayExt.arrayBuffer),this.hasIconCollisionBoxData()&&this.iconCollisionBox.collisionVertexBufferExt&&this.iconCollisionBox.collisionVertexBufferExt.copyFromArrayView(this.iconCollisionBox.collisionVertexArrayExt.arrayBuffer)}_deserializeCollisionBoxesForSymbol(t,e,n,r,i,o,a,s,c){const l={};if(e<n){const{x1:n,y1:r,x2:i,y2:o,padding:a,projectedAnchorX:s,projectedAnchorY:c,projectedAnchorZ:u,tileAnchorX:h,tileAnchorY:f,featureIndex:d,ecefX:p,ecefY:A,ecefZ:g}=t.get(e);l.textBox={x1:n,y1:r,x2:i,y2:o,padding:a,projectedAnchorX:s,projectedAnchorY:c,projectedAnchorZ:u,tileAnchorX:h,tileAnchorY:f,ecefX:p,ecefY:A,ecefZ:g},l.textFeatureIndex=d}if(r<i){const{x1:e,y1:n,x2:i,y2:o,padding:a,projectedAnchorX:s,projectedAnchorY:c,projectedAnchorZ:u,tileAnchorX:h,tileAnchorY:f,featureIndex:d,ecefX:p,ecefY:A,ecefZ:g}=t.get(r);l.verticalTextBox={x1:e,y1:n,x2:i,y2:o,padding:a,projectedAnchorX:s,projectedAnchorY:c,projectedAnchorZ:u,tileAnchorX:h,tileAnchorY:f,ecefX:p,ecefY:A,ecefZ:g},l.verticalTextFeatureIndex=d}if(o<a){const{x1:e,y1:n,x2:r,y2:i,padding:a,projectedAnchorX:s,projectedAnchorY:c,projectedAnchorZ:u,tileAnchorX:h,tileAnchorY:f,featureIndex:d,ecefX:p,ecefY:A,ecefZ:g}=t.get(o);l.iconBox={x1:e,y1:n,x2:r,y2:i,padding:a,projectedAnchorX:s,projectedAnchorY:c,projectedAnchorZ:u,tileAnchorX:h,tileAnchorY:f,ecefX:p,ecefY:A,ecefZ:g},l.iconFeatureIndex=d}if(s<c){const{x1:e,y1:n,x2:r,y2:i,padding:o,projectedAnchorX:a,projectedAnchorY:c,projectedAnchorZ:u,tileAnchorX:h,tileAnchorY:f,featureIndex:d,ecefX:p,ecefY:A,ecefZ:g}=t.get(s);l.verticalIconBox={x1:e,y1:n,x2:r,y2:i,padding:o,projectedAnchorX:a,projectedAnchorY:c,projectedAnchorZ:u,tileAnchorX:h,tileAnchorY:f,ecefX:p,ecefY:A,ecefZ:g},l.verticalIconFeatureIndex=d}return l}deserializeCollisionBoxes(t){this.collisionArrays=[];for(let e=0;e<this.symbolInstances.length;e++){const n=this.symbolInstances.get(e);this.collisionArrays.push(this._deserializeCollisionBoxesForSymbol(t,n.textBoxStartIndex,n.textBoxEndIndex,n.verticalTextBoxStartIndex,n.verticalTextBoxEndIndex,n.iconBoxStartIndex,n.iconBoxEndIndex,n.verticalIconBoxStartIndex,n.verticalIconBoxEndIndex))}}hasTextData(){return this.text.segments.get().length>0}hasIconData(){return this.icon.segments.get().length>0}hasDebugData(){return this.textCollisionBox&&this.iconCollisionBox}hasTextCollisionBoxData(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0}hasIconCollisionBoxData(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0}addIndicesForPlacedSymbol(t,e){const n=t.placedSymbolArray.get(e),r=n.vertexStartIndex+4*n.numGlyphs;for(let e=n.vertexStartIndex;e<r;e+=4)t.indexArray.emplaceBack(e,e+1,e+2),t.indexArray.emplaceBack(e+1,e+2,e+3)}getSortedSymbolIndexes(t){if(this.sortedAngle===t&&void 0!==this.symbolInstanceIndexes)return this.symbolInstanceIndexes;const e=Math.sin(t),n=Math.cos(t),r=[],i=[],o=[];for(let t=0;t<this.symbolInstances.length;++t){o.push(t);const a=this.symbolInstances.get(t);r.push(0|Math.round(e*a.tileAnchorX+n*a.tileAnchorY)),i.push(a.featureIndex)}return o.sort(((t,e)=>r[t]-r[e]||i[e]-i[t])),o}addToSortKeyRanges(t,e){const n=this.sortKeyRanges[this.sortKeyRanges.length-1];n&&n.sortKey===e?n.symbolInstanceEnd=t+1:this.sortKeyRanges.push({sortKey:e,symbolInstanceStart:t,symbolInstanceEnd:t+1})}sortFeatures(t){if(this.sortFeaturesByY&&this.sortedAngle!==t&&!(this.text.segments.get().length>1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(t),this.sortedAngle=t,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(const t of this.symbolInstanceIndexes){const e=this.symbolInstances.get(t);this.featureSortOrder.push(e.featureIndex);const{rightJustifiedTextSymbolIndex:n,centerJustifiedTextSymbolIndex:r,leftJustifiedTextSymbolIndex:i,verticalPlacedTextSymbolIndex:o,placedIconSymbolIndex:a,verticalPlacedIconSymbolIndex:s}=e;n>=0&&this.addIndicesForPlacedSymbol(this.text,n),r>=0&&r!==n&&this.addIndicesForPlacedSymbol(this.text,r),i>=0&&i!==r&&i!==n&&this.addIndicesForPlacedSymbol(this.text,i),o>=0&&this.addIndicesForPlacedSymbol(this.text,o),a>=0&&this.addIndicesForPlacedSymbol(this.icon,a),s>=0&&this.addIndicesForPlacedSymbol(this.icon,s)}this.text.indexBuffer&&this.text.indexBuffer.copyFromArrayView(this.text.indexArray.arrayBuffer),this.icon.indexBuffer&&this.icon.indexBuffer.copyFromArrayView(this.icon.indexArray.arrayBuffer)}}static addDynamicAttributes(t,e,n,r,i,o,a,s,c,l,u,h,f){t.emplaceBack(e,n,r,i,o,a,s,c,l,u,h,f),t.emplaceBack(e,n,r,i,o,a,s,c,l,u,h,f),t.emplaceBack(e,n,r,i,o,a,s,c,l,u,h,f),t.emplaceBack(e,n,r,i,o,a,s,c,l,u,h,f)}}sA(uO,"SymbolBucket",{omit:["layers","collisionBoxArray","features","compareText"]});var hO,fO=(hO=!0,function(t,e){var n=hO?function(){if(e){var n=e.apply(t,arguments);return e=null,n}}:function(){};return hO=!1,n}),dO=fO(void 0,(function(){return dO.toString().search("(((.+)+)+)+$").toString().constructor(dO).search("(((.+)+)+)+$")}));dO();const pO=function(){let t=!0;return function(e,n){const r=t?function(){if(n){const t=n.apply(e,arguments);return n=null,t}}:function(){};return t=!1,r}}(),AO=pO(void 0,(function(){return AO.toString().search("(((.+)+)+)+$").toString().constructor(AO).search("(((.+)+)+)+$")}));AO();const gO=new HA({"symbol-placement":new UA(Um.layout_symbol["symbol-placement"]),"symbol-spacing":new UA(Um.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new UA(Um.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new jA(Um.layout_symbol["symbol-sort-key"]),"symbol-z-order":new UA(Um.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new UA(Um.layout_symbol["icon-allow-overlap"]),"icon-ignore-placement":new UA(Um.layout_symbol["icon-ignore-placement"]),"icon-optional":new UA(Um.layout_symbol["icon-optional"]),"icon-rotation-alignment":new UA(Um.layout_symbol["icon-rotation-alignment"]),"icon-size":new jA(Um.layout_symbol["icon-size"]),"icon-text-fit":new UA(Um.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new UA(Um.layout_symbol["icon-text-fit-padding"]),"icon-image":new jA(Um.layout_symbol["icon-image"]),"icon-rotate":new jA(Um.layout_symbol["icon-rotate"]),"icon-padding":new UA(Um.layout_symbol["icon-padding"]),"icon-keep-upright":new UA(Um.layout_symbol["icon-keep-upright"]),"icon-offset":new jA(Um.layout_symbol["icon-offset"]),"icon-anchor":new jA(Um.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new UA(Um.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new UA(Um.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new UA(Um.layout_symbol["text-rotation-alignment"]),"text-field":new jA(Um.layout_symbol["text-field"]),"text-font":new jA(Um.layout_symbol["text-font"]),"text-size":new jA(Um.layout_symbol["text-size"]),"text-max-width":new jA(Um.layout_symbol["text-max-width"]),"text-line-height":new jA(Um.layout_symbol["text-line-height"]),"text-letter-spacing":new jA(Um.layout_symbol["text-letter-spacing"]),"text-justify":new jA(Um.layout_symbol["text-justify"]),"text-radial-offset":new jA(Um.layout_symbol["text-radial-offset"]),"text-variable-anchor":new UA(Um.layout_symbol["text-variable-anchor"]),"text-anchor":new jA(Um.layout_symbol["text-anchor"]),"text-max-angle":new UA(Um.layout_symbol["text-max-angle"]),"text-writing-mode":new UA(Um.layout_symbol["text-writing-mode"]),"text-rotate":new jA(Um.layout_symbol["text-rotate"]),"text-padding":new UA(Um.layout_symbol["text-padding"]),"text-keep-upright":new UA(Um.layout_symbol["text-keep-upright"]),"text-transform":new jA(Um.layout_symbol["text-transform"]),"text-offset":new jA(Um.layout_symbol["text-offset"]),"text-allow-overlap":new UA(Um.layout_symbol["text-allow-overlap"]),"text-ignore-placement":new UA(Um.layout_symbol["text-ignore-placement"]),"text-optional":new UA(Um.layout_symbol["text-optional"]),"ignore-line-rotation":new UA(Um.layout_symbol["ignore-line-rotation"])});var mO={paint:new HA({"icon-opacity":new jA(Um.paint_symbol["icon-opacity"]),"icon-color":new jA(Um.paint_symbol["icon-color"]),"icon-halo-color":new jA(Um.paint_symbol["icon-halo-color"]),"icon-halo-width":new jA(Um.paint_symbol["icon-halo-width"]),"icon-halo-blur":new jA(Um.paint_symbol["icon-halo-blur"]),"icon-translate":new UA(Um.paint_symbol["icon-translate"]),"icon-translate-anchor":new UA(Um.paint_symbol["icon-translate-anchor"]),"text-opacity":new jA(Um.paint_symbol["text-opacity"]),"text-color":new jA(Um.paint_symbol["text-color"],{runtimeType:z,getOverride:t=>t.textColor,hasOverride:t=>!!t.textColor}),"text-halo-color":new jA(Um.paint_symbol["text-halo-color"]),"text-halo-width":new jA(Um.paint_symbol["text-halo-width"]),"text-halo-blur":new jA(Um.paint_symbol["text-halo-blur"]),"text-translate":new UA(Um.paint_symbol["text-translate"]),"text-translate-anchor":new UA(Um.paint_symbol["text-translate-anchor"])}),layout:gO};const yO=function(){let t=!0;return function(e,n){const r=t?function(){if(n){const t=n.apply(e,arguments);return n=null,t}}:function(){};return t=!1,r}}(),vO=yO(void 0,(function(){return vO.toString().search("(((.+)+)+)+$").toString().constructor(vO).search("(((.+)+)+)+$")}));vO();class CO{constructor(t){this.type=t.property.overrides?t.property.overrides.runtimeType:T,this.defaultValue=t}evaluate(t){if(t.formattedSection){const e=this.defaultValue.property.overrides;if(e&&e.hasOverride(t.formattedSection))return e.getOverride(t.formattedSection)}return t.feature&&t.featureState?this.defaultValue.evaluate(t.feature,t.featureState):this.defaultValue.property.specification.default}eachChild(t){if(!this.defaultValue.isConstant()){t(this.defaultValue.value._styleExpression.expression)}}outputDefined(){return!1}serialize(){return null}}sA(CO,"FormatSectionOverride",{omit:["defaultValue"]});const IO=function(){let t=!0;return function(e,n){const r=t?function(){if(n){const t=n.apply(e,arguments);return n=null,t}}:function(){};return t=!1,r}}(),xO=IO(void 0,(function(){return xO.toString().search("(((.+)+)+)+$").toString().constructor(xO).search("(((.+)+)+)+$")}));xO();class EO extends ay{constructor(t){super(t,mO)}recalculate(t,e){super.recalculate(t,e),"auto"===this.layout.get("icon-rotation-alignment")&&("point"!==this.layout.get("symbol-placement")?this.layout._values["icon-rotation-alignment"]="map":this.layout._values["icon-rotation-alignment"]="viewport"),"auto"===this.layout.get("text-rotation-alignment")&&("point"!==this.layout.get("symbol-placement")?this.layout._values["text-rotation-alignment"]="map":this.layout._values["text-rotation-alignment"]="viewport"),"auto"===this.layout.get("text-pitch-alignment")&&(this.layout._values["text-pitch-alignment"]=this.layout.get("text-rotation-alignment")),"auto"===this.layout.get("icon-pitch-alignment")&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment"));const n=this.layout.get("text-writing-mode");if(n){const t=[];for(const e of n)t.indexOf(e)<0&&t.push(e);this.layout._values["text-writing-mode"]=t}else"point"===this.layout.get("symbol-placement")?this.layout._values["text-writing-mode"]=["horizontal"]:this.layout._values["text-writing-mode"]=["horizontal","vertical"];this._setPaintOverrides()}getValueAndResolveTokens(t,e,n,r){const i=this.layout.get(t).evaluate(e,{},n,r),o=this._unevaluatedLayout._values[t];return o.isDataDriven()||_r(o.value)||!i?i:(a=e.properties,i.replace(/{([^{}]+)}/g,((t,e)=>e in a?String(a[e]):"")));var a}createBucket(t){return new uO(t)}queryRadius(){return 0}queryIntersectsFeature(){return!1}_setPaintOverrides(){for(const t of mO.paint.overridableProperties){if(!EO.hasPaintOverride(this.layout,t))continue;const e=this.paint.get(t),n=new CO(e),r=new Er(n,e.property.specification);let i=null;i="constant"===e.value.kind||"source"===e.value.kind?new wr("source",r):new Mr("composite",r,e.value.zoomStops,e.value._interpolationType),this.paint._values[t]=new PA(e.property,i,e.parameters)}}_handleOverridablePaintPropertyUpdate(t,e,n){return!(!this.layout||e.isDataDriven()||n.isDataDriven())&&EO.hasPaintOverride(this.layout,t)}static hasPaintOverride(t,e){const n=t.get("text-field"),r=mO.paint.properties[e];let i=!1;const o=t=>{for(const e of t)if(r.overrides&&r.overrides.hasOverride(e))return void(i=!0)};if("constant"===n.value.kind&&n.value.value instanceof $)o(n.value.value.sections);else if("source"===n.value.kind){const t=e=>{if(!i)if(e instanceof ft&&ct(e.value)===Q){const t=e.value;o(t.sections)}else e instanceof Et?o(e.sections):e.eachChild(t)},e=n.value;e._styleExpression&&t(e._styleExpression.expression)}return i}getProgramConfiguration(t){return new Bm(this,t)}}const _O=function(){let t=!0;return function(e,n){const r=t?function(){if(n){const t=n.apply(e,arguments);return n=null,t}}:function(){};return t=!1,r}}(),bO=_O(void 0,(function(){return bO.toString().search("(((.+)+)+)+$").toString().constructor(bO).search("(((.+)+)+)+$")}));bO();var wO={paint:new HA({"background-color":new UA(Um.paint_background["background-color"]),"background-pattern":new UA(Um.paint_background["background-pattern"]),"background-opacity":new UA(Um.paint_background["background-opacity"])})};const MO=function(){let t=!0;return function(e,n){const r=t?function(){if(n){const t=n.apply(e,arguments);return n=null,t}}:function(){};return t=!1,r}}(),TO=MO(void 0,(function(){return TO.toString().search("(((.+)+)+)+$").toString().constructor(TO).search("(((.+)+)+)+$")}));TO();const BO=function(){let t=!0;return function(e,n){const r=t?function(){if(n){const t=n.apply(e,arguments);return n=null,t}}:function(){};return t=!1,r}}(),SO=BO(void 0,(function(){return SO.toString().search("(((.+)+)+)+$").toString().constructor(SO).search("(((.+)+)+)+$")}));SO();var DO,RO={paint:new HA({"raster-opacity":new UA(Um.paint_raster["raster-opacity"]),"raster-hue-rotate":new UA(Um.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new UA(Um.paint_raster["raster-brightness-min"]),"raster-brightness-max":new UA(Um.paint_raster["raster-brightness-max"]),"raster-saturation":new UA(Um.paint_raster["raster-saturation"]),"raster-contrast":new UA(Um.paint_raster["raster-contrast"]),"raster-resampling":new UA(Um.paint_raster["raster-resampling"]),"raster-fade-duration":new UA(Um.paint_raster["raster-fade-duration"])})},zO=(DO=!0,function(t,e){var n=DO?function(){if(e){var n=e.apply(t,arguments);return e=null,n}}:function(){};return DO=!1,n}),OO=zO(void 0,(function(){return OO.toString().search("(((.+)+)+)+$").toString().constructor(OO).search("(((.+)+)+)+$")}));OO();const NO=function(){let t=!0;return function(e,n){const r=t?function(){if(n){const t=n.apply(e,arguments);return n=null,t}}:function(){};return t=!1,r}}(),LO=NO(void 0,(function(){return LO.toString().search("(((.+)+)+)+$").toString().constructor(LO).search("(((.+)+)+)+$")}));LO();class QO extends ay{constructor(t){super(t,{}),this.implementation=t}is3D(){return"3d"===this.implementation.renderingMode}hasOffscreenPass(){return void 0!==this.implementation.prerender}isLayerDraped(){return void 0!==this.implementation.renderToTile}shouldRedrape(){return!!this.implementation.shouldRerenderTiles&&this.implementation.shouldRerenderTiles()}recalculate(){}updateTransitions(){}hasTransition(){return!1}serialize(){}onAdd(t){this.implementation.onAdd&&this.implementation.onAdd(t,t.painter.context.gl)}onRemove(t){this.implementation.onRemove&&this.implementation.onRemove(t,t.painter.context.gl)}}const FO=function(){let t=!0;return function(e,n){const r=t?function(){if(n){const t=n.apply(e,arguments);return n=null,t}}:function(){};return t=!1,r}}(),PO=FO(void 0,(function(){return PO.toString().search("(((.+)+)+)+$").toString().constructor(PO).search("(((.+)+)+)+$")}));PO();const kO={circle:class extends ay{constructor(t){super(t,xI)}createBucket(t){return new tI(t)}queryRadius(t){const e=t;return pI("circle-radius",this,e)+pI("circle-stroke-width",this,e)+AI(this.paint.get("circle-translate"))}queryIntersectsFeature(t,e,n,r,i,o,a,s){const c=mI(this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),o.angle,t.pixelToTileUnitsFactor),l=this.paint.get("circle-radius").evaluate(e,n)+this.paint.get("circle-stroke-width").evaluate(e,n);return O_(t,r,o,a,s,"map"===this.paint.get("circle-pitch-alignment"),"map"===this.paint.get("circle-pitch-scale"),c,l)}getProgramIds(){return["circle"]}getProgramConfiguration(t){return new Bm(this,t)}},heatmap:class extends ay{createBucket(t){return new HeatmapBucket(t)}constructor(t){super(t,k_),this._updateColorRamp()}_handleSpecialPaintPropertyUpdate(t){"heatmap-color"===t&&this._updateColorRamp()}_updateColorRamp(){const t=this._transitionablePaint._values["heatmap-color"].value.expression;this.colorRamp=X_({expression:t,evaluationKey:"heatmapDensity",image:this.colorRamp}),this.colorRampTexture=null}resize(){this.heatmapFbo&&(this.heatmapFbo.destroy(),this.heatmapFbo=null)}queryRadius(t){return pI("heatmap-radius",this,t)}queryIntersectsFeature(t,e,n,r,i,o,a,s){const c=this.paint.get("heatmap-radius").evaluate(e,n);return O_(t,r,o,a,0,!0,!0,new Or(0,0),c)}hasOffscreenPass(){return 0!==this.paint.get("heatmap-opacity")&&"none"!==this.visibility}getProgramIds(){return["heatmap","heatmapTexture"]}getProgramConfiguration(t){return new Bm(this,t)}},fill:class extends ay{constructor(t){super(t,xb)}getProgramIds(){const t=this.paint.get("fill-pattern"),e=t&&t.constantOr(1),n=[e?"fillPattern":"fill"];return this.paint.get("fill-antialias")&&n.push(e&&!this.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline"),n}getProgramConfiguration(t){return new Bm(this,t)}recalculate(t,e){super.recalculate(t,e);const n=this.paint._values["fill-outline-color"];"constant"===n.value.kind&&void 0===n.value.value&&(this.paint._values["fill-outline-color"]=this.paint._values["fill-color"])}createBucket(t){return new yb(t)}queryRadius(){return AI(this.paint.get("fill-translate"))}queryIntersectsFeature(t,e,n,r,i,o){if(t.queryGeometry.isAboveHorizon)return!1;return iI(gI(t.tilespaceGeometry,this.paint.get("fill-translate"),this.paint.get("fill-translate-anchor"),o.angle,t.pixelToTileUnitsFactor),r)}isTileClipped(){return!0}},"fill-extrusion":class extends ay{constructor(t){super(t,Xb)}createBucket(t){return new kb(t)}queryRadius(){return AI(this.paint.get("fill-extrusion-translate"))}is3D(){return!0}getProgramIds(){return[this.paint.get("fill-extrusion-pattern").constantOr(1)?"fillExtrusionPattern":"fillExtrusion"]}getProgramConfiguration(t){return new Bm(this,t)}queryIntersectsFeature(t,e,n,r,i,o,a,s,c){const l=mI(this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),o.angle,t.pixelToTileUnitsFactor),u=this.paint.get("fill-extrusion-height").evaluate(e,n),h=this.paint.get("fill-extrusion-base").evaluate(e,n),[f,d]=function(t,e,n,r,i){const o=[],a=[],s=i[8]*e,c=i[9]*e,l=i[10]*e,u=i[11]*e,h=i[8]*n,f=i[9]*n,d=i[10]*n,p=i[11]*n;for(const e of t){const t=[],n=[];for(const o of e){const e=o.x+r.x,a=o.y+r.y,A=i[0]*e+i[4]*a+i[12],g=i[1]*e+i[5]*a+i[13],m=i[2]*e+i[6]*a+i[14],y=i[3]*e+i[7]*a+i[15],v=A+s,C=g+c,I=m+l,x=Math.max(y+u,1e-5),E=A+h,_=g+f,b=m+d,w=Math.max(y+p,1e-5);t.push(new $b(v/x,C/x,I/x)),n.push(new $b(E/w,_/w,b/w))}o.push(t),a.push(n)}return[o,a]}(r,h,u,l,a),p=t.queryGeometry;return function(t,e,n){let r=1/0;iI(n,e)&&(r=ew(n,e[0]));for(let i=0;i<e.length;i++){const o=e[i],a=t[i];for(let t=0;t<o.length-1;t++){const e=o[t],i=o[t+1],s=a[t],c=[e,i,a[t+1],s,e];rI(n,c)&&(r=Math.min(r,ew(n,c)))}}return r!==1/0&&r}(f,d,p.isPointQuery()?p.screenBounds:p.screenGeometry)}},line:class extends ay{constructor(t){super(t,gw),this.gradientVersion=0}_handleSpecialPaintPropertyUpdate(t){if("line-gradient"===t){const t=this._transitionablePaint._values["line-gradient"].value.expression;this.stepInterpolant=t._styleExpression&&t._styleExpression.expression instanceof be,this.gradientVersion=(this.gradientVersion+1)%Number.MAX_SAFE_INTEGER}}gradientExpression(){return this._transitionablePaint._values["line-gradient"].value.expression}widthExpression(){return this._transitionablePaint._values["line-width"].value.expression}recalculate(t,e){super.recalculate(t,e),this.paint._values["line-floorwidth"]=vw.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,t)}createBucket(t){return new fw(t)}getProgramIds(){return[this.paint.get("line-pattern").constantOr(1)?"linePattern":"line"]}getProgramConfiguration(t){return new Bm(this,t)}queryRadius(t){const e=t,n=Cw(pI("line-width",this,e),pI("line-gap-width",this,e)),r=pI("line-offset",this,e);return n/2+Math.abs(r)+AI(this.paint.get("line-translate"))}queryIntersectsFeature(t,e,n,r,i,o){if(t.queryGeometry.isAboveHorizon)return!1;const a=gI(t.tilespaceGeometry,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),o.angle,t.pixelToTileUnitsFactor),s=t.pixelToTileUnitsFactor/2*Cw(this.paint.get("line-width").evaluate(e,n),this.paint.get("line-gap-width").evaluate(e,n)),c=this.paint.get("line-offset").evaluate(e,n);return c&&(r=function(t,e){const n=[],r=new Or(0,0);for(let i=0;i<t.length;i++){const o=t[i],a=[];for(let t=0;t<o.length;t++){const n=o[t-1],i=o[t],s=o[t+1],c=0===t?r:i.sub(n)._unit()._perp(),l=t===o.length-1?r:s.sub(i)._unit()._perp(),u=c._add(l)._unit(),h=u.x*l.x+u.y*l.y;u._mult(1/h),a.push(u._mult(e)._add(i))}n.push(a)}return n}(r,c*t.pixelToTileUnitsFactor)),function(t,e,n){for(let r=0;r<e.length;r++){const i=e[r];if(t.length>=3)for(let e=0;e<i.length;e++)if(uI(t,i[e]))return!0;if(oI(t,i,n))return!0}return!1}(a,r,s)}isTileClipped(){return!0}},symbol:EO,background:class extends ay{constructor(t){super(t,wO)}getProgramIds(){return[this.paint.get("background-pattern")?"backgroundPattern":"background"]}},raster:class extends ay{constructor(t){super(t,RO)}getProgramIds(){return["raster"]}}};var UO,jO=(UO=!0,function(t,e){var n=UO?function(){if(e){var n=e.apply(t,arguments);return e=null,n}}:function(){};return UO=!1,n}),GO=jO(void 0,(function(){return GO.toString().search("(((.+)+)+)+$").toString().constructor(GO).search("(((.+)+)+)+$")}));GO();var HO=["type","source","source-layer","minzoom","maxzoom","filter","layout"];const qO=function(){let t=!0;return function(e,n){const r=t?function(){if(n){const t=n.apply(e,arguments);return n=null,t}}:function(){};return t=!1,r}}(),VO=qO(void 0,(function(){return VO.toString().search("(((.+)+)+)+$").toString().constructor(VO).search("(((.+)+)+)+$")}));function YO(t){if("number"==typeof t||"boolean"==typeof t||"string"==typeof t||null==t)return JSON.stringify(t);if(Array.isArray(t)){let e="[";for(const n of t)e+=YO(n)+",";return e+"]"}let e="{";for(const n of Object.keys(t).sort())e+=n+":"+YO(t[n])+",";return e+"}"}function KO(t){let e="";for(const n of HO)e+="/"+YO(t[n]);return e}VO();const WO=function(){let t=!0;return function(e,n){const r=t?function(){if(n){const t=n.apply(e,arguments);return n=null,t}}:function(){};return t=!1,r}}(),XO=WO(void 0,(function(){return XO.toString().search("(((.+)+)+)+$").toString().constructor(XO).search("(((.+)+)+)+$")}));XO();class JO{constructor(t){this.keyCache={},t&&this.replace(t)}replace(t){this._layerConfigs={},this._layers={},this.update(t,[])}update(t,e){for(const e of t){this._layerConfigs[e.id]=e;(this._layers[e.id]="custom"===(n=e).type?new QO(n):new kO[n.type](n)).compileFilter(),this.keyCache[e.id]&&delete this.keyCache[e.id]}var n;for(const t of e)delete this.keyCache[t],delete this._layerConfigs[t],delete this._layers[t];this.familiesBySource={};const r=function(t,e){const n={};for(let r=0;r<t.length;r++){const i=e&&e[t[r].id]||KO(t[r]);e&&(e[t[r].id]=i);let o=n[i];!o&&(o=n[i]=[]),o.push(t[r])}const r=[];for(const t in n)r.push(n[t]);return r}(Np(this._layerConfigs),this.keyCache);for(const t of r){const e=t.map((t=>this._layers[t.id])),n=e[0];if("none"===n.visibility)continue;const r=n.source||"";let i=this.familiesBySource[r];!i&&(i=this.familiesBySource[r]={});const o=n.sourceLayer||"_geojsonTileLayer";let a=i[o];!a&&(a=i[o]=[]),a.push(e)}}}var ZO,$O=(ZO=!0,function(t,e){var n=ZO?function(){if(e){var n=e.apply(t,arguments);return e=null,n}}:function(){};return ZO=!1,n}),tN=$O(void 0,(function(){return tN.toString().search("(((.+)+)+)+$").toString().constructor(tN).search("(((.+)+)+)+$")}));function eN(t,e,n,r,i){this.properties={},this.extent=n,this.type=0,this._pbf=t,this._geometry=-1,this._keys=r,this._values=i,t.readFields(nN,this,e)}function nN(t,e,n){1==t?e.id=n.readVarint():2==t?function(t,e){var n=t.readVarint()+t.pos;for(;t.pos<n;){var r=e._keys[t.readVarint()],i=e._values[t.readVarint()];e.properties[r]=i}}(n,e):3==t?e.type=n.readVarint():4==t&&(e._geometry=n.pos)}function rN(t){for(var e,n,r=0,i=0,o=t.length,a=o-1;i<o;a=i++)e=t[i],r+=((n=t[a]).x-e.x)*(e.y+n.y);return r}tN(),eN.types=["Unknown","Point","LineString","Polygon"],eN.prototype.loadGeometry=function(){var t=this._pbf;t.pos=this._geometry;for(var e,n=t.readVarint()+t.pos,r=1,i=0,o=0,a=0,s=[];t.pos<n;){if(i<=0){var c=t.readVarint();r=7&c,i=c>>3}i--,1===r||2===r?(o+=t.readSVarint(),a+=t.readSVarint(),1===r&&(e&&s.push(e),e=[]),e.push(new Or(o,a))):7===r?e&&e.push(e[0].clone()):console.log("VectorTileFeature loadGeometry unknown command "+r)}return e&&s.push(e),s},eN.prototype.bbox=function(){var t=this._pbf;t.pos=this._geometry;for(var e=t.readVarint()+t.pos,n=1,r=0,i=0,o=0,a=1/0,s=-1/0,c=1/0,l=-1/0;t.pos<e;){if(r<=0){var u=t.readVarint();n=7&u,r=u>>3}if(r--,1===n||2===n)(i+=t.readSVarint())<a&&(a=i),i>s&&(s=i),(o+=t.readSVarint())<c&&(c=o),o>l&&(l=o);else if(7!==n)throw new Error("unknown command "+n)}return[a,c,s,l]},eN.prototype.toGeoJSON=function(t,e,n){var r,i,o=this.extent*Math.pow(2,n),a=this.extent*t,s=this.extent*e,c=this.loadGeometry(),l=eN.types[this.type];function u(t){for(var e=0;e<t.length;e++){var n=t[e],r=180-360*(n.y+s)/o;t[e]=[360*(n.x+a)/o-180,360/Math.PI*Math.atan(Math.exp(r*Math.PI/180))-90]}}switch(this.type){case 1:var h=[];for(r=0;r<c.length;r++)h[r]=c[r][0];u(c=h);break;case 2:for(r=0;r<c.length;r++)u(c[r]);break;case 3:for(c=function(t){var e=t.length;if(e<=1)return[t];for(var n,r,i=[],o=0;o<e;o++){var a=rN(t[o]);0!==a&&(void 0===r&&(r=a<0),r===a<0?(n&&i.push(n),n=[t[o]]):n.push(t[o]))}n&&i.push(n);return i}(c),r=0;r<c.length;r++)for(i=0;i<c[r].length;i++)u(c[r][i])}1===c.length?c=c[0]:l="Multi"+l;var f={type:"Feature",geometry:{type:l,coordinates:c},properties:this.properties};return"id"in this&&(f.id=this.id),f};var iN,oN=(iN=!0,function(t,e){var n=iN?function(){if(e){var n=e.apply(t,arguments);return e=null,n}}:function(){};return iN=!1,n}),aN=oN(void 0,(function(){return aN.toString().search("(((.+)+)+)+$").toString().constructor(aN).search("(((.+)+)+)+$")}));function sN(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(cN,this,e),this.length=this._features.length}function cN(t,e,n){15===t?e.version=n.readVarint():1===t?e.name=n.readString():5===t?e.extent=n.readVarint():2===t?e._features.push(n.pos):3===t?e._keys.push(n.readString()):4===t&&e._values.push(function(t){var e=null,n=t.readVarint()+t.pos;for(;t.pos<n;){var r=t.readVarint()>>3;e=1===r?t.readString():2===r?t.readFloat():3===r?t.readDouble():4===r?t.readVarint64():5===r?t.readVarint():6===r?t.readSVarint():7===r?t.readBoolean():null}return e}(n))}aN(),sN.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 eN(this._pbf,e,this.extent,this._keys,this._values)};var lN,uN=(lN=!0,function(t,e){var n=lN?function(){if(e){var n=e.apply(t,arguments);return e=null,n}}:function(){};return lN=!1,n}),hN=uN(void 0,(function(){return hN.toString().search("(((.+)+)+)+$").toString().constructor(hN).search("(((.+)+)+)+$")}));function fN(t,e){this.layers=t.readFields(dN,{},e)}function dN(t,e,n){if(3===t){var r=new sN(n,n.readVarint()+n.pos);r.length&&(e[r.name]=r)}}hN();const pN=function(){let t=!0;return function(e,n){const r=t?function(){if(n){const t=n.apply(e,arguments);return n=null,t}}:function(){};return t=!1,r}}(),AN=pN(void 0,(function(){return AN.toString().search("(((.+)+)+)+$").toString().constructor(AN).search("(((.+)+)+)+$")}));AN();class gN{constructor(t){this._stringToNumber={},this._numberToString=[];for(let e=0;e<t.length;e++){const n=t[e];this._stringToNumber[n]=e,this._numberToString[e]=n}}encode(t){return this._stringToNumber[t]}decode(t){return this._numberToString[t]}}const mN=function(){let t=!0;return function(e,n){const r=t?function(){if(n){const t=n.apply(e,arguments);return n=null,t}}:function(){};return t=!1,r}}(),yN=mN(void 0,(function(){return yN.toString().search("(((.+)+)+)+$").toString().constructor(yN).search("(((.+)+)+)+$")}));yN();const vN=["tile","layer","source","sourceLayer","state"];class CN{constructor(t,e,n,r,i){this.type="Feature",this._vectorTileFeature=t,this._z=e,this._x=n,this._y=r,this.properties=t.properties,this.id=i}get geometry(){return void 0===this._geometry&&(this._geometry=this._vectorTileFeature.toGeoJSON(this._x,this._y,this._z).geometry),this._geometry}set geometry(t){this._geometry=t}toJSON(){const t={type:"Feature",state:void 0,geometry:this.geometry,properties:this.properties};void 0!==this.id&&(t.id=this.id);for(const e of vN)void 0!==this[e]&&(t[e]=this[e]);return t}}const IN=function(){let t=!0;return function(e,n){const r=t?function(){if(n){const t=n.apply(e,arguments);return n=null,t}}:function(){};return t=!1,r}}(),xN=IN(void 0,(function(){return xN.toString().search("(((.+)+)+)+$").toString().constructor(xN).search("(((.+)+)+)+$")}));xN();const EN={UNSIGNED_BYTE:zh.UNSIGNED_BYTE,UNSIGNED_SHORT:zh.UNSIGNED_SHORT,UNSIGNED_INT:zh.UNSIGNED_INT,FLOAT:zh.FLOAT,HALF_FLOAT:zh.HALF_FLOAT_OES,UNSIGNED_INT_24_8:zh.UNSIGNED_INT_24_8,UNSIGNED_SHORT_4_4_4_4:zh.UNSIGNED_SHORT_4_4_4_4,UNSIGNED_SHORT_5_5_5_1:zh.UNSIGNED_SHORT_5_5_5_1,UNSIGNED_SHORT_5_6_5:zh.UNSIGNED_SHORT_5_6_5,toWebGLConstant:function(t,e){switch(t){case EN.UNSIGNED_BYTE:return zh.UNSIGNED_BYTE;case EN.UNSIGNED_SHORT:return zh.UNSIGNED_SHORT;case EN.UNSIGNED_INT:return zh.UNSIGNED_INT;case EN.FLOAT:return zh.FLOAT;case EN.HALF_FLOAT:return e.webgl2?zh.HALF_FLOAT:zh.HALF_FLOAT_OES;case EN.UNSIGNED_INT_24_8:return zh.UNSIGNED_INT_24_8;case EN.UNSIGNED_SHORT_4_4_4_4:return zh.UNSIGNED_SHORT_4_4_4_4;case EN.UNSIGNED_SHORT_5_5_5_1:return zh.UNSIGNED_SHORT_5_5_5_1;case EN.UNSIGNED_SHORT_5_6_5:return EN.UNSIGNED_SHORT_5_6_5}},isPacked:function(t){return t===EN.UNSIGNED_INT_24_8||t===EN.UNSIGNED_SHORT_4_4_4_4||t===EN.UNSIGNED_SHORT_5_5_5_1||t===EN.UNSIGNED_SHORT_5_6_5},sizeInBytes:function(t){switch(t){case EN.UNSIGNED_BYTE:return 1;case EN.UNSIGNED_SHORT:case EN.UNSIGNED_SHORT_4_4_4_4:case EN.UNSIGNED_SHORT_5_5_5_1:case EN.UNSIGNED_SHORT_5_6_5:case EN.HALF_FLOAT:return 2;case EN.UNSIGNED_INT:case EN.FLOAT:case EN.UNSIGNED_INT_24_8:return 4}},validate:function(t){return t===EN.UNSIGNED_BYTE||t===EN.UNSIGNED_SHORT||t===EN.UNSIGNED_INT||t===EN.FLOAT||t===EN.HALF_FLOAT||t===EN.UNSIGNED_INT_24_8||t===EN.UNSIGNED_SHORT_4_4_4_4||t===EN.UNSIGNED_SHORT_5_5_5_1||t===EN.UNSIGNED_SHORT_5_6_5}};var _N=Object.freeze(EN);const bN={DEPTH_COMPONENT:zh.DEPTH_COMPONENT,DEPTH_COMPONENT16:zh.DEPTH_COMPONENT16,DEPTH_STENCIL:zh.DEPTH_STENCIL,ALPHA:zh.ALPHA,RGB:zh.RGB,RG:zh.RG,RGBA:zh.RGBA,LUMINANCE:zh.LUMINANCE,LUMINANCE_ALPHA:zh.LUMINANCE_ALPHA,RGB_DXT1:zh.COMPRESSED_RGB_S3TC_DXT1_EXT,RGBA_DXT1:zh.COMPRESSED_RGBA_S3TC_DXT1_EXT,RGBA_DXT3:zh.COMPRESSED_RGBA_S3TC_DXT3_EXT,RGBA_DXT5:zh.COMPRESSED_RGBA_S3TC_DXT5_EXT,RGB_PVRTC_4BPPV1:zh.COMPRESSED_RGB_PVRTC_4BPPV1_IMG,RGB_PVRTC_2BPPV1:zh.COMPRESSED_RGB_PVRTC_2BPPV1_IMG,RGBA_PVRTC_4BPPV1:zh.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG,RGBA_PVRTC_2BPPV1:zh.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG,RGBA_ASTC:zh.COMPRESSED_RGBA_ASTC_4x4_WEBGL,RGB_ETC1:zh.COMPRESSED_RGB_ETC1_WEBGL,RGB8_ETC2:zh.COMPRESSED_RGB8_ETC2,RGBA8_ETC2_EAC:zh.COMPRESSED_RGBA8_ETC2_EAC,RGBA_BC7:zh.COMPRESSED_RGBA_BPTC_UNORM,RED_INTEGER:zh.RED_INTEGER,RED:zh.RED,componentsLength:function(t){switch(t){case bN.RGB:return 3;case bN.RGBA:return 4;case bN.LUMINANCE_ALPHA:case bN.RG:return 2;case bN.ALPHA:case bN.LUMINANCE:case bN.RED:case bN.RED_INTEGER:default:return 1}},validate:function(t){return t===bN.DEPTH_COMPONENT||t===bN.DEPTH_COMPONENT16||t===bN.DEPTH_STENCIL||t===bN.ALPHA||t===bN.RED||t===bN.RED_INTEGER||t===bN.RG||t===bN.RGB||t===bN.RGBA||t===bN.LUMINANCE||t===bN.LUMINANCE_ALPHA||t===bN.RGB_DXT1||t===bN.RGBA_DXT1||t===bN.RGBA_DXT3||t===bN.RGBA_DXT5||t===bN.RGB_PVRTC_4BPPV1||t===bN.RGB_PVRTC_2BPPV1||t===bN.RGBA_PVRTC_4BPPV1||t===bN.RGBA_PVRTC_2BPPV1||t===bN.RGBA_ASTC||t===bN.RGB_ETC1||t===bN.RGB8_ETC2||t===bN.RGBA8_ETC2_EAC||t===bN.RGBA_BC7},isColorFormat:function(t){return t===bN.ALPHA||t===bN.RED||t===bN.RED_INTEGER||t===bN.RGB||t===bN.RGBA||t===bN.LUMINANCE||t===bN.LUMINANCE_ALPHA},isDepthFormat:function(t){return t===bN.DEPTH_COMPONENT||t===bN.DEPTH_COMPONENT16||t===bN.DEPTH_STENCIL},isCompressedFormat:function(t){return t===bN.RGB_DXT1||t===bN.RGBA_DXT1||t===bN.RGBA_DXT3||t===bN.RGBA_DXT5||t===bN.RGB_PVRTC_4BPPV1||t===bN.RGB_PVRTC_2BPPV1||t===bN.RGBA_PVRTC_4BPPV1||t===bN.RGBA_PVRTC_2BPPV1||t===bN.RGBA_ASTC||t===bN.RGB_ETC1||t===bN.RGB8_ETC2||t===bN.RGBA8_ETC2_EAC||t===bN.RGBA_BC7},isDXTFormat:function(t){return t===bN.RGB_DXT1||t===bN.RGBA_DXT1||t===bN.RGBA_DXT3||t===bN.RGBA_DXT5},isPVRTCFormat:function(t){return t===bN.RGB_PVRTC_4BPPV1||t===bN.RGB_PVRTC_2BPPV1||t===bN.RGBA_PVRTC_4BPPV1||t===bN.RGBA_PVRTC_2BPPV1},isASTCFormat:function(t){return t===bN.RGBA_ASTC},isETC1Format:function(t){return t===bN.RGB_ETC1},isETC2Format:function(t){return t===bN.RGB8_ETC2||t===bN.RGBA8_ETC2_EAC},isBC7Format:function(t){return t===bN.RGBA_BC7},compressedTextureSizeInBytes:function(t,e,n){switch(t){case bN.RGB_DXT1:case bN.RGBA_DXT1:case bN.RGB_ETC1:case bN.RGB8_ETC2:return Math.floor((e+3)/4)*Math.floor((n+3)/4)*8;case bN.RGBA_DXT3:case bN.RGBA_DXT5:case bN.RGBA_ASTC:case bN.RGBA8_ETC2_EAC:return Math.floor((e+3)/4)*Math.floor((n+3)/4)*16;case bN.RGB_PVRTC_4BPPV1:case bN.RGBA_PVRTC_4BPPV1:return Math.floor((Math.max(e,8)*Math.max(n,8)*4+7)/8);case bN.RGB_PVRTC_2BPPV1:case bN.RGBA_PVRTC_2BPPV1:return Math.floor((Math.max(e,16)*Math.max(n,8)*2+7)/8);case bN.RGBA_BC7:return Math.ceil(e/4)*Math.ceil(n/4)*16;default:return 0}},textureSizeInBytes:function(t,e,n,r){let i=bN.componentsLength(t);return _N.isPacked(e)&&(i=1),i*_N.sizeInBytes(e)*n*r},alignmentInBytes:function(t,e,n){const r=bN.textureSizeInBytes(t,e,n,1)%4;return 0===r?4:2===r?2:1},createTypedArray:function(t,e,n,r){let i;const o=_N.sizeInBytes(e);i=o===Uint8Array.BYTES_PER_ELEMENT?Uint8Array:o===Uint16Array.BYTES_PER_ELEMENT?Uint16Array:o===Float32Array.BYTES_PER_ELEMENT&&e===_N.FLOAT?Float32Array:Uint32Array;return new i(bN.componentsLength(t)*n*r)},flipY:function(t,e,n,r,i){if(1===i)return t;const o=bN.createTypedArray(e,n,r,i),a=bN.componentsLength(e),s=r*a;for(let e=0;e<i;++e){const n=e*r*a,c=(i-e-1)*r*a;for(let e=0;e<s;++e)o[c+e]=t[n+e]}return o},RGBToRGBA:function(t,e,n,r){for(var i=bN.createTypedArray(bN.RGBA,e,n,r),o=t.length/3,a=0;a<o;a++)i[4*a]=t[3*a],i[4*a+1]=t[3*a+1],i[4*a+2]=t[3*a+2];return i},toInternalFormat:function(t,e,n){if(!n.webgl2)return t;if(t===bN.DEPTH_STENCIL)return zh.DEPTH24_STENCIL8;if(t===bN.DEPTH_COMPONENT){if(e===_N.UNSIGNED_SHORT)return zh.DEPTH_COMPONENT16;if(e===_N.UNSIGNED_INT)return zh.DEPTH_COMPONENT24;if(e===_N.FLOAT)return zh.DEPTH_COMPONENT32F}if(t===bN.DEPTH_COMPONENT16)return zh.DEPTH_COMPONENT16;if(t===bN.DEPTH_COMPONENT32F)return zh.DEPTH_COMPONENT32F;if(e===_N.UNSIGNED_BYTE)switch(t){case bN.RGBA:return zh.RGBA8;case bN.RGB:return zh.RGB8;case bN.RED:return zh.R8}if(e===_N.UNSIGNED_SHORT_4_4_4_4&&t===bN.RGBA)return zh.RGBA4;if(e===_N.FLOAT)switch(t){case bN.RGBA:return zh.RGBA32F;case bN.RGB:return zh.RGB32F;case bN.RG:return zh.RG32F;case bN.RED:return zh.R32F}if(e===_N.HALF_FLOAT)switch(t){case bN.RGBA:return zh.RGBA16F;case bN.RGB:return zh.RGB16F;case bN.RG:return zh.RG16F;case bN.RED:return zh.R16F}return t}};var wN=Object.freeze(bN),MN={DONT_CARE:zh.DONT_CARE,FASTEST:zh.FASTEST,NICEST:zh.NICEST,validate:function(t){return t===MN.DONT_CARE||t===MN.FASTEST||t===MN.NICEST}},TN=Object.freeze(MN),BN={NEAREST:zh.NEAREST,LINEAR:zh.LINEAR,validate:function(t){return t===BN.NEAREST||t===BN.LINEAR}},SN=Object.freeze(BN),DN={NEAREST:zh.NEAREST,LINEAR:zh.LINEAR,NEAREST_MIPMAP_NEAREST:zh.NEAREST_MIPMAP_NEAREST,LINEAR_MIPMAP_NEAREST:zh.LINEAR_MIPMAP_NEAREST,NEAREST_MIPMAP_LINEAR:zh.NEAREST_MIPMAP_LINEAR,LINEAR_MIPMAP_LINEAR:zh.LINEAR_MIPMAP_LINEAR,validate:function(t){return t===DN.NEAREST||t===DN.LINEAR||t===DN.NEAREST_MIPMAP_NEAREST||t===DN.LINEAR_MIPMAP_NEAREST||t===DN.NEAREST_MIPMAP_LINEAR||t===DN.LINEAR_MIPMAP_LINEAR}},RN=Object.freeze(DN),zN={CLAMP_TO_EDGE:zh.CLAMP_TO_EDGE,REPEAT:zh.REPEAT,MIRRORED_REPEAT:zh.MIRRORED_REPEAT,validate:function(t){return t===zN.CLAMP_TO_EDGE||t===zN.REPEAT||t===zN.MIRRORED_REPEAT}},ON=Object.freeze(zN);function NN(t){t=Pr(t,Pr.EMPTY_OBJECT);const e=Pr(t.wrapS,ON.CLAMP_TO_EDGE),n=Pr(t.wrapT,ON.CLAMP_TO_EDGE),r=Pr(t.minificationFilter,RN.LINEAR),i=Pr(t.magnificationFilter,SN.LINEAR),o=Nr(t.maximumAnisotropy)?t.maximumAnisotropy:1;if(!ON.validate(e))throw new Lr("Invalid sampler.wrapS.");if(!ON.validate(n))throw new Lr("Invalid sampler.wrapT.");if(!RN.validate(r))throw new Lr("Invalid sampler.minificationFilter.");if(!SN.validate(i))throw new Lr("Invalid sampler.magnificationFilter.");Qr.typeOf.number.greaterThanOrEquals("maximumAnisotropy",o,1),this._wrapS=e,this._wrapT=n,this._minificationFilter=r,this._magnificationFilter=i,this._maximumAnisotropy=o}function LN(t){t=Pr(t,Pr.EMPTY_OBJECT),Qr.defined("options.context",t.context);const e=t.context;let n=t.width,r=t.height;const i=t.source;Nr(i)&&(Nr(n)||(n=Pr(i.videoWidth,i.width)),Nr(r)||(r=Pr(i.videoHeight,i.height)));const o=Pr(t.pixelFormat,wN.RGBA),a=Pr(t.pixelDatatype,_N.UNSIGNED_BYTE),s=wN.toInternalFormat(o,a,e),c=wN.isCompressedFormat(s);if(!Nr(n)||!Nr(r))throw new Lr("options requires a source field to create an initialized texture or width and height fields to create a blank texture.");if(Qr.typeOf.number.greaterThan("width",n,0),n>Af.maximumTextureSize)throw new Lr(`Width must be less than or equal to the maximum texture size (${Af.maximumTextureSize}). Check maximumTextureSize.`);if(Qr.typeOf.number.greaterThan("height",r,0),r>Af.maximumTextureSize)throw new Lr(`Height must be less than or equal to the maximum texture size (${Af.maximumTextureSize}). Check maximumTextureSize.`);if(!wN.validate(o))throw new Lr("Invalid options.pixelFormat.");if(!c&&!_N.validate(a))throw new Lr("Invalid options.pixelDatatype.");if(o===wN.DEPTH_COMPONENT&&a!==_N.UNSIGNED_SHORT&&a!==_N.UNSIGNED_INT)throw new Lr("When options.pixelFormat is DEPTH_COMPONENT, options.pixelDatatype must be UNSIGNED_SHORT or UNSIGNED_INT.");if(o===wN.DEPTH_STENCIL&&a!==_N.UNSIGNED_INT_24_8)throw new Lr("When options.pixelFormat is DEPTH_STENCIL, options.pixelDatatype must be UNSIGNED_INT_24_8.");if(a===_N.FLOAT&&!e.floatingPointTexture)throw new Lr("When options.pixelDatatype is FLOAT, this WebGL implementation must support the OES_texture_float extension. Check context.floatingPointTexture.");if(a===_N.HALF_FLOAT&&!e.halfFloatingPointTexture)throw new Lr("When options.pixelDatatype is HALF_FLOAT, this WebGL implementation must support the OES_texture_half_float extension. Check context.halfFloatingPointTexture.");if(wN.isDepthFormat(o)){if(Nr(i))throw new Lr("When options.pixelFormat is DEPTH_COMPONENT or DEPTH_STENCIL, source cannot be provided.");if(!e.depthTexture)throw new Lr("When options.pixelFormat is DEPTH_COMPONENT or DEPTH_STENCIL, this WebGL implementation must support WEBGL_depth_texture. Check context.depthTexture.")}if(c){if(!Nr(i)||!Nr(i.arrayBufferView))throw new Lr("When options.pixelFormat is compressed, options.source.arrayBufferView must be defined.");if(wN.isDXTFormat(s)&&!e.s3tc)throw new Lr("When options.pixelFormat is S3TC compressed, this WebGL implementation must support the WEBGL_compressed_texture_s3tc extension. Check context.s3tc.");if(wN.isPVRTCFormat(s)&&!e.pvrtc)throw new Lr("When options.pixelFormat is PVRTC compressed, this WebGL implementation must support the WEBGL_compressed_texture_pvrtc extension. Check context.pvrtc.");if(wN.isASTCFormat(s)&&!e.astc)throw new Lr("When options.pixelFormat is ASTC compressed, this WebGL implementation must support the WEBGL_compressed_texture_astc extension. Check context.astc.");if(wN.isETC2Format(s)&&!e.etc)throw new Lr("When options.pixelFormat is ETC2 compressed, this WebGL implementation must support the WEBGL_compressed_texture_etc extension. Check context.etc.");if(wN.isETC1Format(s)&&!e.etc1)throw new Lr("When options.pixelFormat is ETC1 compressed, this WebGL implementation must support the WEBGL_compressed_texture_etc1 extension. Check context.etc1.");if(wN.isBC7Format(s)&&!e.bc7)throw new Lr("When options.pixelFormat is BC7 compressed, this WebGL implementation must support the EXT_texture_compression_bptc extension. Check context.bc7.");if(wN.compressedTextureSizeInBytes(s,n,r)!==i.arrayBufferView.byteLength)throw new Lr("The byte length of the array buffer is invalid for the compressed texture with the given width and height.")}const l=t.preMultiplyAlpha||o===wN.RGB||o===wN.LUMINANCE,u=Pr(t.flipY,!0),h=Pr(t.skipColorSpaceConversion,!1);let f=!0;const d=e._gl,p=d.TEXTURE_2D,A=d.createTexture();d.activeTexture(d.TEXTURE0),d.bindTexture(p,A);let g,m=4;if(Nr(i)&&Nr(i.arrayBufferView)&&!c&&(m=wN.alignmentInBytes(o,a,n)),d.pixelStorei(d.UNPACK_ALIGNMENT,m),h?d.pixelStorei(d.UNPACK_COLORSPACE_CONVERSION_WEBGL,d.NONE):d.pixelStorei(d.UNPACK_COLORSPACE_CONVERSION_WEBGL,d.BROWSER_DEFAULT_WEBGL),Nr(i))if(Nr(i.arrayBufferView)){d.pixelStorei(d.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),d.pixelStorei(d.UNPACK_FLIP_Y_WEBGL,!1);let t,l,h,f=i.arrayBufferView;if(c){if(d.compressedTexImage2D(p,0,s,n,r,0,f),Nr(i.mipLevels))for(l=n,h=r,t=0;t<i.mipLevels.length;++t)l=0|Math.floor(l/2),l<1&&(l=1),h=0|Math.floor(h/2),h<1&&(h=1),d.compressedTexImage2D(p,t+1,s,l,h,0,i.mipLevels[t])}else if(u&&(f=wN.flipY(f,o,a,n,r)),d.texImage2D(p,0,s,n,r,0,o,_N.toWebGLConstant(a,e),f),Nr(i.mipLevels))for(l=n,h=r,t=0;t<i.mipLevels.length;++t)l=0|Math.floor(l/2),l<1&&(l=1),h=0|Math.floor(h/2),h<1&&(h=1),d.texImage2D(p,t+1,s,l,h,0,o,_N.toWebGLConstant(a,e),i.mipLevels[t])}else if(Nr(i.framebuffer))d.pixelStorei(d.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),d.pixelStorei(d.UNPACK_FLIP_Y_WEBGL,!1),i.framebuffer!==e.defaultFramebuffer&&i.framebuffer._bind(),d.copyTexImage2D(p,0,s,i.xOffset,i.yOffset,n,r,0),i.framebuffer!==e.defaultFramebuffer&&i.framebuffer._unBind();else{d.pixelStorei(d.UNPACK_PREMULTIPLY_ALPHA_WEBGL,l),d.pixelStorei(d.UNPACK_FLIP_Y_WEBGL,u),d.texImage2D(p,0,s,o,_N.toWebGLConstant(a,e),i);let n=t.mipLevels;if(Nr(n))for(var y=0,v=n.length;y<v;++y)d.texImage2D(p,y+1,s,o,_N.toWebGLConstant(a,e),n[y])}else d.texImage2D(p,0,s,n,r,0,o,_N.toWebGLConstant(a,e),null),f=!1;d.bindTexture(p,null),g=c?wN.compressedTextureSizeInBytes(o,n,r):wN.textureSizeInBytes(o,a,n,r),this._id="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(t){var e=16*Math.random()|0;return("x"===t?e:3&e|8).toString(16)})),this._context=e,this._textureFilterAnisotropic=e._textureFilterAnisotropic,this._textureTarget=p,this._texture=A,this._internalFormat=s,this._pixelFormat=o,this._pixelDatatype=a,this._width=n,this._height=r,this._dimensions=new Ti(n,r),this._hasMipmap=!1,this._sizeInBytes=g,this._preMultiplyAlpha=l,this._flipY=u,this._initialized=f,this._sampler=void 0,this._samples=Pr(t.samples,1),this.sampler=Nr(t.sampler)?t.sampler:new NN,e.memorySize+=g}Object.defineProperties(NN.prototype,{wrapS:{get:function(){return this._wrapS}},wrapT:{get:function(){return this._wrapT}},minificationFilter:{get:function(){return this._minificationFilter}},magnificationFilter:{get:function(){return this._magnificationFilter}},maximumAnisotropy:{get:function(){return this._maximumAnisotropy}}}),NN.equals=function(t,e){return t===e||Nr(t)&&Nr(e)&&t._wrapS===e._wrapS&&t._wrapT===e._wrapT&&t._minificationFilter===e._minificationFilter&&t._magnificationFilter===e._magnificationFilter&&t._maximumAnisotropy===e._maximumAnisotropy},NN.NEAREST=Object.freeze(new NN({wrapS:ON.CLAMP_TO_EDGE,wrapT:ON.CLAMP_TO_EDGE,minificationFilter:RN.NEAREST,magnificationFilter:SN.NEAREST})),LN.create=function(t){return new LN(t)},LN.fromFramebuffer=function(t){t=Pr(t,Pr.EMPTY_OBJECT),Qr.defined("options.context",t.context);const e=t.context,n=e._gl,r=Pr(t.pixelFormat,wN.RGB),i=Pr(t.framebufferXOffset,0),o=Pr(t.framebufferYOffset,0),a=Pr(t.width,n.drawingBufferWidth),s=Pr(t.height,n.drawingBufferHeight),c=t.framebuffer;if(!wN.validate(r))throw new Lr("Invalid pixelFormat.");if(wN.isDepthFormat(r)||wN.isCompressedFormat(r))throw new Lr("pixelFormat cannot be DEPTH_COMPONENT, DEPTH_STENCIL or a compressed format.");if(Qr.defined("options.context",t.context),Qr.typeOf.number.greaterThanOrEquals("framebufferXOffset",i,0),Qr.typeOf.number.greaterThanOrEquals("framebufferYOffset",o,0),i+a>n.drawingBufferWidth)throw new Lr("framebufferXOffset + width must be less than or equal to drawingBufferWidth");if(o+s>n.drawingBufferHeight)throw new Lr("framebufferYOffset + height must be less than or equal to drawingBufferHeight.");return new LN({context:e,width:a,height:s,pixelFormat:r,source:{framebuffer:Nr(c)?c:e.defaultFramebuffer,xOffset:i,yOffset:o,width:a,height:s}})},Object.defineProperties(LN.prototype,{id:{get:function(){return this._id},set:function(t){this._id=t}},is3D:{get:function(){return!1}},is2DArray:{get:function(){return!1}},sampler:{get:function(){return this._sampler},set:function(t){let e=t.minificationFilter,n=t.magnificationFilter;const r=this._context,i=this._pixelFormat,o=this._pixelDatatype,a=e===RN.NEAREST_MIPMAP_NEAREST||e===RN.NEAREST_MIPMAP_LINEAR||e===RN.LINEAR_MIPMAP_NEAREST||e===RN.LINEAR_MIPMAP_LINEAR;(o===_N.FLOAT&&!r.textureFloatLinear||o===_N.HALF_FLOAT&&!r.textureHalfFloatLinear)&&(e=a?RN.NEAREST_MIPMAP_NEAREST:RN.NEAREST,n=SN.NEAREST),r.webgl2&&wN.isDepthFormat(i)&&(e=RN.NEAREST,n=SN.NEAREST);const s=r._gl,c=this._textureTarget;s.activeTexture(s.TEXTURE0),s.bindTexture(c,this._texture),s.texParameteri(c,s.TEXTURE_MIN_FILTER,e),s.texParameteri(c,s.TEXTURE_MAG_FILTER,n),s.texParameteri(c,s.TEXTURE_WRAP_S,t.wrapS),s.texParameteri(c,s.TEXTURE_WRAP_T,t.wrapT),Nr(this._textureFilterAnisotropic)&&s.texParameteri(c,this._textureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,t.maximumAnisotropy),s.bindTexture(c,null),this._sampler=t}},pixelFormat:{get:function(){return this._pixelFormat}},pixelDatatype:{get:function(){return this._pixelDatatype}},dimensions:{get:function(){return this._dimensions}},preMultiplyAlpha:{get:function(){return this._preMultiplyAlpha}},flipY:{get:function(){return this._flipY}},width:{get:function(){return this._width}},height:{get:function(){return this._height}},sizeInBytes:{get:function(){return this._hasMipmap?Math.floor(4*this._sizeInBytes/3):this._sizeInBytes}},_target:{get:function(){return this._textureTarget}},samples:{get:function(){return this._samples}}}),LN.prototype.copyFrom=function(t,e,n){if(e=Pr(e,0),n=Pr(n,0),Qr.defined("source",t),wN.isDepthFormat(this._pixelFormat))throw new Lr("Cannot call copyFrom when the texture pixel format is DEPTH_COMPONENT or DEPTH_STENCIL.");if(wN.isCompressedFormat(this._pixelFormat))throw new Lr("Cannot call copyFrom with a compressed texture pixel format.");Qr.typeOf.number.greaterThanOrEquals("xOffset",e,0),Qr.typeOf.number.greaterThanOrEquals("yOffset",n,0),Qr.typeOf.number.lessThanOrEquals("xOffset + source.width",e+t.width,this._width),Qr.typeOf.number.lessThanOrEquals("yOffset + source.height",n+t.height,this._height);const r=this._context;var i=r._gl,o=this._textureTarget;i.activeTexture(i.TEXTURE0),i.bindTexture(o,this._texture);var a=t.width,s=t.height,c=t.arrayBufferView,l=this._width,u=this._height,h=this._pixelFormat,f=this._pixelDatatype;const d=this._internalFormat;var p=this._preMultiplyAlpha,A=this._flipY,g=4;Nr(c)&&(g=wN.alignmentInBytes(h,f,a)),i.pixelStorei(i.UNPACK_ALIGNMENT,g),i.pixelStorei(i.UNPACK_COLORSPACE_CONVERSION_WEBGL,i.BROWSER_DEFAULT_WEBGL);var m=!1;if(!this._initialized){if(0===e&&0===n&&a===l&&s===u)Nr(c)?(i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,!1),A&&(c=wN.flipY(c,h,f,l,u)),i.texImage2D(o,0,d,l,u,0,h,_N.toWebGLConstant(f,r),c)):(i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,p),i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,A),i.texImage2D(o,0,d,h,_N.toWebGLConstant(f,r),t)),m=!0;else{i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,!1);var y=wN.createTypedArray(h,f,l,u);i.texImage2D(o,0,d,l,u,0,h,_N.toWebGLConstant(f,r),y)}this._initialized=!0}m||(Nr(c)?(i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,!1),A&&(c=wN.flipY(c,h,f,a,s)),i.texSubImage2D(o,0,e,n,a,s,h,_N.toWebGLConstant(f,r),c)):(i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,p),i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,A),i.texSubImage2D(o,0,e,n,h,_N.toWebGLConstant(f,r),t))),i.bindTexture(o,null)},LN.prototype.copyFromFramebuffer=function(t,e,n,r,i,o){if(t=Pr(t,0),e=Pr(e,0),n=Pr(n,0),r=Pr(r,0),i=Pr(i,this._width),o=Pr(o,this._height),wN.isDepthFormat(this._pixelFormat))throw new Lr("Cannot call copyFromFramebuffer when the texture pixel format is DEPTH_COMPONENT or DEPTH_STENCIL.");if(this._pixelDatatype===_N.FLOAT)throw new Lr("Cannot call copyFromFramebuffer when the texture pixel data type is FLOAT.");if(this._pixelDatatype===_N.HALF_FLOAT)throw new Lr("Cannot call copyFromFramebuffer when the texture pixel data type is HALF_FLOAT.");if(wN.isCompressedFormat(this._pixelFormat))throw new Lr("Cannot call copyFrom with a compressed texture pixel format.");Qr.typeOf.number.greaterThanOrEquals("xOffset",t,0),Qr.typeOf.number.greaterThanOrEquals("yOffset",e,0),Qr.typeOf.number.greaterThanOrEquals("framebufferXOffset",n,0),Qr.typeOf.number.greaterThanOrEquals("framebufferYOffset",r,0),Qr.typeOf.number.lessThanOrEquals("xOffset + width",t+i,this._width),Qr.typeOf.number.lessThanOrEquals("yOffset + height",e+o,this._height);const a=this._context._gl,s=this._textureTarget;a.activeTexture(a.TEXTURE0),a.bindTexture(s,this._texture),a.copyTexSubImage2D(s,0,t,e,n,r,i,o),a.bindTexture(s,null),this._initialized=!0},LN.prototype.copyFromTexture=function(t,e,n,r,i,o,a){var s=this._context,c=new Framebuffer({context:s,colorTextures:[t],destroyAttachments:!1});if(c!==s._currentFramebuffer&&(s._currentFramebuffer=c,Nr(c))){c._bind();var l=c._getActiveColorAttachments();s.drawBuffers&&s.glDrawBuffers(l)}this.copyFromFramebuffer(e,n,r,i,o,a),c.destroy()},LN.prototype.generateMipmap=function(t){if(t=Pr(t,TN.DONT_CARE),wN.isDepthFormat(this._pixelFormat))throw new Lr("Cannot call generateMipmap when the texture pixel format is DEPTH_COMPONENT or DEPTH_STENCIL.");if(wN.isCompressedFormat(this._pixelFormat))throw new Lr("Cannot call generateMipmap with a compressed pixel format.");if(!this._context.webgl2){if(this._width>1&&!Ur.isPowerOfTwo(this._width))throw new Lr("width must be a power of two to call generateMipmap() in a WebGL1 context.");if(this._height>1&&!Ur.isPowerOfTwo(this._height))throw new Lr("height must be a power of two to call generateMipmap() in a WebGL1 context.")}if(!TN.validate(t))throw new Lr("hint is invalid.");this._hasMipmap=!0;const e=this._context._gl,n=this._textureTarget;e.hint(e.GENERATE_MIPMAP_HINT,t),e.activeTexture(e.TEXTURE0),e.bindTexture(n,this._texture),e.generateMipmap(n),e.bindTexture(n,null)},LN.prototype.isDestroyed=function(){return!1},LN.prototype.destroy=function(){return this._context._gl.deleteTexture(this._texture),this._context.memorySize-=this._sizeInBytes,uf(this)};var QN,FN=(QN=!0,function(t,e){var n=QN?function(){if(e){var n=e.apply(t,arguments);return e=null,n}}:function(){};return QN=!1,n}),PN=FN(void 0,(function(){return PN.toString().search("(((.+)+)+)+$").toString().constructor(PN).search("(((.+)+)+)+$")}));PN();const kN=function(){let t=!0;return function(e,n){const r=t?function(){if(n){const t=n.apply(e,arguments);return n=null,t}}:function(){};return t=!1,r}}(),UN=kN(void 0,(function(){return UN.toString().search("(((.+)+)+)+$").toString().constructor(UN).search("(((.+)+)+)+$")}));UN();const jN=new Uint16Array(8184);for(let t=0;t<2046;t++){let e=t+2,n=0,r=0,i=0,o=0,a=0,s=0;for(1&e?i=o=a=32:n=r=s=32;(e>>=1)>1;){const t=n+i>>1,c=r+o>>1;1&e?(i=n,o=r,n=a,r=s):(n=i,r=o,i=a,o=s),a=t,s=c}const c=4*t;jN[c+0]=n,jN[c+1]=r,jN[c+2]=i,jN[c+3]=o}var GN,HN=(GN=!0,function(t,e){var n=GN?function(){if(e){var n=e.apply(t,arguments);return e=null,n}}:function(){};return GN=!1,n}),qN=HN(void 0,(function(){return qN.toString().search("(((.+)+)+)+$").toString().constructor(qN).search("(((.+)+)+)+$")}));qN(),tg([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]);var VN,YN=(VN=!0,function(t,e){var n=VN?function(){if(e){var n=e.apply(t,arguments);return e=null,n}}:function(){};return VN=!1,n}),KN=YN(void 0,(function(){return KN.toString().search("(((.+)+)+)+$").toString().constructor(KN).search("(((.+)+)+)+$")}));KN(),tg([{name:"a_pos",type:"Int16",components:2}]);const WN=function(){let t=!0;return function(e,n){const r=t?function(){if(n){const t=n.apply(e,arguments);return n=null,t}}:function(){};return t=!1,r}}(),XN=WN(void 0,(function(){return XN.toString().search("(((.+)+)+)+$").toString().constructor(XN).search("(((.+)+)+)+$")}));XN(),new bl;const JN=function(){let t=!0;return function(e,n){const r=t?function(){if(n){const t=n.apply(e,arguments);return n=null,t}}:function(){};return t=!1,r}}(),ZN=JN(void 0,(function(){return ZN.toString().search("(((.+)+)+)+$").toString().constructor(ZN).search("(((.+)+)+)+$")}));ZN();const $N=function(){let t=!0;return function(e,n){const r=t?function(){if(n){const t=n.apply(e,arguments);return n=null,t}}:function(){};return t=!1,r}}(),tL=$N(void 0,(function(){return tL.toString().search("(((.+)+)+)+$").toString().constructor(tL).search("(((.+)+)+)+$")}));tL();class eL{constructor(t,e){this.tileID=t,this.x=t.canonical.x,this.y=t.canonical.y,this.z=t.canonical.z,this.grid=new r(Cl,16,0),this.featureIndexArray=new Vg,this.promoteId=e}insert(t,e,n,r,i,o=0){const a=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(n,r,i,o);const s=this.grid;for(let t=0;t<e.length;t++){const n=e[t],r=[1/0,1/0,-1/0,-1/0];for(let t=0;t<n.length;t++){const e=n[t];r[0]=Math.min(r[0],e.x),r[1]=Math.min(r[1],Cl-e.y),r[2]=Math.max(r[2],e.x),r[3]=Math.max(r[3],Cl-e.y)}r[0]<Cl&&r[1]<Cl&&r[2]>=0&&r[3]>=0&&s.insert(a,r[0],r[1],r[2],r[3])}}loadVTLayers(){if(!this.vtLayers){this.vtLayers=new fN(new hT(this.rawTileData)).layers,this.sourceLayerCoder=new gN(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"]),this.vtFeatures={};for(const t in this.vtLayers)this.vtFeatures[t]=[]}return this.vtLayers}query(t,e,n,r){this.loadVTLayers();const i=t.params||{},o=qm(i.filter),a=t.tileResult;t.transform;const s=a.bufferedTilespaceBounds,c=this.grid.query(s.min.x,s.min.y,s.max.x,s.max.y,((t,e,n,r)=>function(t,e,n,r,i){for(const o of t)if(e<=o.x&&n<=o.y&&r>=o.x&&i>=o.y)return!0;const o=[new Or(e,n),new Or(e,i),new Or(r,i),new Or(r,n)];if(t.length>2)for(const e of o)if(uI(t,e))return!0;for(let e=0;e<t.length-1;e++)if(hI(t[e],t[e+1],o))return!0;return!1}(a.bufferedTilespaceGeometry,t,e,n,r)));c.sort(rL);const l={};let u;for(let s=0;s<c.length;s++){const h=c[s];if(h===u)continue;u=h;const f=this.featureIndexArray.get(h);let d=null;this.loadMatchingFeature(l,f,o,i.layers,i.availableImages,e,n,r,((e,n,r,i=0)=>(!d&&(d=Iy(e,!1)),n.queryIntersectsFeature(a,e,r,d,this.z,t.transform,t.pixelPosMatrix,null,i))))}return l}loadMatchingFeature(t,e,n,r,i,o,a,s,c){const{featureIndex:l,bucketIndex:u,sourceLayerIndex:h,layoutVertexArrayOffset:f}=e,d=this.bucketLayerIDs[u];if(r&&!function(t,e){for(let n=0;n<t.length;n++)if(e.indexOf(t[n])>=0)return!0;return!1}(r,d))return;const p=this.sourceLayerCoder.decode(h),A=this.vtLayers[p].feature(l);if(n.needGeometry){const t=by(A,!0);if(!n.filter(new SA(this.tileID.overscaledZ),t,this.tileID.canonical))return}else if(!n.filter(new SA(this.tileID.overscaledZ),A))return;const g=this.getId(A,p);for(let e=0;e<d.length;e++){const n=d[e];if(r&&r.indexOf(n)<0)continue;const u=o[n];if(!u)continue;let h={};void 0!==g&&s&&(h=s.getState(u.sourceLayer||"_geojsonTileLayer",g));const p=Lp({},a[n]);p.paint=nL(p.paint,u.paint,A,h,i),p.layout=nL(p.layout,u.layout,A,h,i);const m=!c||c(A,u,h,f);if(!m)continue;const y=new CN(A,this.z,this.x,this.y,g);y.layer=p;let v=t[n];void 0===v&&(v=t[n]=[]),v.push({featureIndex:l,feature:y,intersectionZ:m})}}lookupSymbolFeatures(t,e,n,r,i,o,a,s){const c={};this.loadVTLayers();const l=qm(i);for(const i of t)this.loadMatchingFeature(c,{bucketIndex:n,sourceLayerIndex:r,featureIndex:i,layoutVertexArrayOffset:0},l,o,a,s,e);return c}loadFeature(t){const{featureIndex:e,sourceLayerIndex:n}=t;this.loadVTLayers();const r=this.sourceLayerCoder.decode(n),i=this.vtFeatures[r];if(i[e])return i[e];const o=this.vtLayers[r].feature(e);return i[e]=o,o}hasLayer(t){for(const e of this.bucketLayerIDs)for(const n of e)if(t===n)return!0;return!1}getId(t,e){let n=t.id;if(this.promoteId){const r="string"==typeof this.promoteId?this.promoteId:this.promoteId[e];null!=r&&(n=t.properties[r]),"boolean"==typeof n&&(n=Number(n))}return n}}function nL(t,e,n,r,i){return Pp(t,((t,o)=>{const a=e instanceof kA?e.get(o):null;return a&&a.evaluate?a.evaluate(n,r,i):a}))}function rL(t,e){return e-t}sA(eL,"FeatureIndex",{omit:["rawTileData","sourceLayerCoder"]});const iL=function(){let t=!0;return function(e,n){const r=t?function(){if(n){const t=n.apply(e,arguments);return n=null,t}}:function(){};return t=!1,r}}(),oL=iL(void 0,(function(){return oL.toString().search("(((.+)+)+)+$").toString().constructor(oL).search("(((.+)+)+)+$")}));oL();class aL{constructor(t,e){this.width=t,this.height=e,this.nextRow=0,this.image=new V_({width:t,height:e}),this.positions={},this.uploaded=!1}getDash(t,e){const n=this.getKey(t,e);return this.positions[n]}trim(){const t=this.width,e=this.height=(n=this.nextRow)<=1?1:Math.pow(2,Math.ceil(Math.log(n)/Math.LN2));var n;this.image.resize({width:t,height:e})}getKey(t,e){return t.join(",")+e}getDashRanges(t,e,n){const r=[];let i=t.length%2==1?-t[t.length-1]*n:0,o=t[0]*n,a=!0;r.push({left:i,right:o,isDash:a,zeroLength:0===t[0]});let s=t[0];for(let e=1;e<t.length;e++){a=!a;const c=t[e];i=s*n,s+=c,o=s*n,r.push({left:i,right:o,isDash:a,zeroLength:0===c})}return r}addRoundDash(t,e,n){const r=e/2;for(let e=-n;e<=n;e++){const i=this.nextRow+n+e,o=this.width*i;let a=0,s=t[a];for(let i=0;i<this.width;i++){i/s.right>1&&(s=t[++a]);const c=Math.abs(i-s.left),l=Math.abs(i-s.right),u=Math.min(c,l);let h;const f=e/n*(r+1);if(s.isDash){const t=r-Math.abs(f);h=Math.sqrt(u*u+t*t)}else h=r-Math.sqrt(u*u+f*f);this.image.data[o+i]=Math.max(0,Math.min(255,h+128))}}}addRegularDash(t,e){for(let e=t.length-1;e>=0;--e){const n=t[e],r=t[e+1];n.zeroLength?t.splice(e,1):r&&r.isDash===n.isDash&&(r.left=n.left,t.splice(e,1))}const n=t[0],r=t[t.length-1];n.isDash===r.isDash&&(n.left=r.left-this.width,r.right=n.right+this.width);const i=this.width*this.nextRow;let o=0,a=t[o];for(let n=0;n<this.width;n++){n/a.right>1&&(a=t[++o]);const r=Math.abs(n-a.left),s=Math.abs(n-a.right),c=Math.min(r,s),l=(a.isDash?c:-c)+e;this.image.data[i+n]=Math.max(0,Math.min(255,l+128))}}addDash(t,e){const n=this.getKey(t,e);if(this.positions[n])return this.positions[n];const r="round"===e,i=r?7:0,o=2*i+1;if(this.nextRow+o>this.height)return jp("LineAtlas out of space"),null;0===t.length&&t.push(1);let a=0;for(let e=0;e<t.length;e++)t[e]<0&&(jp("Negative value is found in line dasharray, replacing values with 0"),t[e]=0),a+=t[e];if(0!==a){const n=this.width/a,o=this.getDashRanges(t,this.width,n);if(r)this.addRoundDash(o,n,i);else{const t="square"===e?.5*n:0;this.addRegularDash(o,t)}}const s=this.nextRow+i;this.nextRow+=o;const c={tl:[s,i],br:[a,0]};return this.positions[n]=c,c}}sA(aL,"LineAtlas");const sL=function(){let t=!0;return function(e,n){const r=t?function(){if(n){const t=n.apply(e,arguments);return n=null,t}}:function(){};return t=!1,r}}(),cL=sL(void 0,(function(){return cL.toString().search("(((.+)+)+)+$").toString().constructor(cL).search("(((.+)+)+)+$")}));cL();class lL{constructor(t){const e={},n=[];for(const r in t){const i=t[r],o=e[r]={};for(const t in i.glyphs){const e=i.glyphs[+t];if(!e||0===e.bitmap.width||0===e.bitmap.height)continue;const r=e.metrics.localGlyph?2:1,a={x:0,y:0,w:e.bitmap.width+2*r,h:e.bitmap.height+2*r};n.push(a),o[t]=a}}const{w:r,h:i}=DT(n),o=new V_({width:r||1,height:i||1});for(const n in t){const r=t[n];for(const t in r.glyphs){const i=r.glyphs[+t];if(!i||0===i.bitmap.width||0===i.bitmap.height)continue;const a=e[n][t],s=i.metrics.localGlyph?2:1;V_.copy(i.bitmap,o,{x:0,y:0},{x:a.x+s,y:a.y+s},i.bitmap)}}this.image=o,this.positions=e}}sA(lL,"GlyphAtlas");const uL=function(){let t=!0;return function(e,n){const r=t?function(){if(n){const t=n.apply(e,arguments);return n=null,t}}:function(){};return t=!1,r}}(),hL=uL(void 0,(function(){return hL.toString().search("(((.+)+)+)+$").toString().constructor(hL).search("(((.+)+)+)+$")}));hL();class fL{constructor(t){this.tileID=new az(t.tileID.overscaledZ,t.tileID.wrap,t.tileID.canonical.z,t.tileID.canonical.x,t.tileID.canonical.y,t.tileID.canonical.indexExtent),this.tileZoom=t.tileZoom,this.uid=t.uid,this.zoom=t.zoom,this.canonical=t.tileID.canonical,this.pixelRatio=t.pixelRatio,this.tileSize=t.tileSize,this.source=t.source,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=t.showCollisionBoxes,this.collectResourceTiming=!!t.collectResourceTiming,this.returnDependencies=!!t.returnDependencies,this.promoteId=t.promoteId,this.enableTerrain=!!t.enableTerrain,this.isSymbolTile=t.isSymbolTile,this.tileTransform=uz(t.tileID.canonical,t.projection),this.projection=t.projection,this.crs=t.crs,this.detailLevelOffset=t.detailLevelOffset||0}parse(t,e,n,r,i,o){this.status="parsing",this.data=e,this.collisionBoxArray=new Fg;const a=new gN(Object.keys(e.layers).sort()),s=new eL(this.tileID,this.promoteId);s.bucketLayerIDs=[];const c={},l=new aL(256,256),u={featureIndex:s,iconDependencies:{},patternDependencies:{},glyphDependencies:{},lineAtlas:l,availableImages:r,crs:this.crs,ellipsoid:new Ra(t.ellipsoid[0],t.ellipsoid[1],t.ellipsoid[2])},h=n.familiesBySource[this.source];for(const n in h){const i=e.layers[n];if(!i)continue;let o=!1,l=!1;for(const t of h[n])"symbol"===t[0].type?o=!0:l=!0;if(!0===this.isSymbolTile&&!o)continue;if(!1===this.isSymbolTile&&!l)continue;1===i.version&&jp('Vector tile source "'+this.source+'" layer "'+n+'" does not use vector tile spec v2 and therefore may have some rendering errors.');const f=a.encode(n),d=[];for(let t=0;t<i.length;t++){const e=i.feature(t),r=s.getId(e,n);d.push({feature:e,id:r,index:t,sourceLayerIndex:f})}for(const e of h[n]){const n=e[0];if(void 0!==this.isSymbolTile&&"symbol"===n.type!==this.isSymbolTile)continue;if(n.minzoom&&this.zoom<Math.max(Math.floor(n.minzoom-this.detailLevelOffset),0))continue;if(n.maxzoom&&this.zoom>=n.maxzoom)continue;if("none"===n.visibility)continue;dL(e,this.zoom,r);(c[n.id]=n.createBucket({index:s.bucketLayerIDs.length,layers:e,zoom:this.zoom,canonical:this.canonical,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:f,sourceID:this.source,enableTerrain:this.enableTerrain,projection:this.projection.spec,availableImages:r,webgpu:t.webgpu})).populate(d,u,this.tileID.canonical,this.tileTransform),s.bucketLayerIDs.push(e.map((t=>t.id)))}}let f,d,p,A;l.trim();const g={type:"maybePrepare",isSymbolTile:this.isSymbolTile,zoom:this.zoom},m=()=>{if(f)return o(f);if(d&&p&&A){const t=new lL(d),e=new NT(p,A);for(const n in c){const i=c[n];if(i instanceof uO)dL(i.layers,this.zoom,r),jB(i,d,t.positions,p,e.iconPositions,this.showCollisionBoxes,r,this.tileID.canonical,this.tileZoom,this.projection,this.crs,u.ellipsoid);else if(i.hasPattern&&(i instanceof fw||i instanceof yb)){dL(i.layers,this.zoom,r);const t=e.patternPositions;i.addFeatures(u,this.tileID.canonical,t,r,this.tileTransform)}}this.status="done",o(null,{buckets:Np(c).filter((t=>!t.isEmpty())),featureIndex:s,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:t.image,lineAtlas:l,imageAtlas:e,glyphMap:this.returnDependencies?d:null,iconMap:this.returnDependencies?p:null,glyphPositions:this.returnDependencies?t.positions:null})}},y=Pp(u.glyphDependencies,(t=>Object.keys(t).map(Number)));Object.keys(y).length?i.send("getGlyphs",{uid:this.uid,stacks:y,source:this.source},((t,e)=>{!f&&(f=t,d=e,m())}),void 0,!1,g):d={};const v=Object.keys(u.iconDependencies);v.length?i.send("getImages",{icons:v,source:this.source,tileID:this.tileID,type:"icons"},((t,e)=>{!f&&(f=t,p=e,m())}),void 0,!1,g):p={};const C=Object.keys(u.patternDependencies);C.length?i.send("getImages",{icons:C,source:this.source,tileID:this.tileID,type:"patterns"},((t,e)=>{!f&&(f=t,A=e,m())}),void 0,!1,g):A={},m()}}function dL(t,e,n){const r=new SA(e);for(const e of t)e.recalculate(r,n)}var pL,AL,gL=void 0!==gL?gL:{},mL=Object.assign({},gL),yL="object"==typeof window,vL="function"==typeof importScripts,CL="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node,IL="";if(CL){var xL=require("fs"),EL=require("path");IL=vL?EL.dirname(IL)+"/":__dirname+"/",pL=(t,e)=>(t=UL(t)?new URL(t):EL.normalize(t),xL.readFileSync(t,e?void 0:"utf8")),AL=t=>{var e=pL(t,!0);return e.buffer||(e=new Uint8Array(e)),e},!gL.thisProgram&&process.argv.length>1&&process.argv[1].replace(/\\/g,"/"),process.argv.slice(2),"undefined"!=typeof module&&(module.exports=gL),process.on("uncaughtException",(t=>{if(!("unwind"===t||t instanceof HL||t.context instanceof HL))throw t})),gL.inspect=()=>"[Emscripten Module object]"}else(yL||vL)&&(vL?IL=self.location.href:"undefined"!=typeof document&&document.currentScript&&(IL=document.currentScript.src),IL=0!==IL.indexOf("blob:")?IL.substr(0,IL.replace(/[?#].*/,"").lastIndexOf("/")+1):"",pL=t=>{var e=new XMLHttpRequest;return e.open("GET",t,!1),e.send(null),e.responseText},vL&&(AL=t=>{var e=new XMLHttpRequest;return e.open("GET",t,!1),e.responseType="arraybuffer",e.send(null),new Uint8Array(e.response)}));gL.print||console.log.bind(console);var _L,bL,wL=gL.printErr||console.error.bind(console);function ML(t){if(kL(t))return function(t){if(void 0!==CL&&CL){var e=Buffer.from(t,"base64");return new Uint8Array(e.buffer,e.byteOffset,e.length)}for(var n=atob(t),r=new Uint8Array(n.length),i=0;i<n.length;++i)r[i]=n.charCodeAt(i);return r}(t.slice(PL.length))}Object.assign(gL,mL),mL=null,gL.arguments&&gL.arguments,gL.thisProgram&&gL.thisProgram,gL.quit&&gL.quit,gL.wasmBinary&&(_L=gL.wasmBinary),"object"!=typeof WebAssembly&&LL("no native wasm support detected");var TL,BL=!1;function SL(){var t=bL.buffer;gL.HEAP8=new Int8Array(t),gL.HEAP16=new Int16Array(t),gL.HEAPU8=TL=new Uint8Array(t),gL.HEAPU16=new Uint16Array(t),gL.HEAP32=new Int32Array(t),gL.HEAPU32=new Uint32Array(t),gL.HEAPF32=new Float32Array(t),gL.HEAPF64=new Float64Array(t)}var DL=[],RL=[],zL=[];var OL=0,NL=null;function LL(t){throw gL.onAbort&&gL.onAbort(t),wL(t="Aborted("+t+")"),BL=!0,t+=". Build with -sASSERTIONS for more info.",new WebAssembly.RuntimeError(t)}var QL,FL,PL="data:application/octet-stream;base64,",kL=t=>t.startsWith(PL),UL=t=>t.startsWith("file://");function jL(t){return Promise.resolve().then((()=>function(t){if(t==QL&&_L)return new Uint8Array(_L);var e=ML(t);if(e)return e;if(AL)return AL(t);throw"both async and sync fetching of the wasm failed"}(t)))}function GL(t,e,n,r){return function(t,e,n){return jL(t).then((t=>WebAssembly.instantiate(t,e))).then((t=>t)).then(n,(t=>{wL(`failed to asynchronously prepare wasm: ${t}`),LL(t)}))}(e,n,r)}function HL(t){this.name="ExitStatus",this.message=`Program terminated with exit(${t})`,this.status=t}kL(QL="data:application/octet-stream;base64,AGFzbQEAAAABHwZgAX8Bf2ABfwBgAABgA39/fwBgA39/fwF/YAJ/fwACDQIBYQFhAAABYQFiAAIDExIAAwAAAgEBAQUDAAMFAQQEAQQEBQFwAQEBBQcBAYACgIACBggBfwFBkJAECwchCAFjAgABZAAGAWUAEwFmABEBZwAQAWgBAAFpAAwBagASCuZdEioBAX8jAEEQayIBIAA6AA8gAS0ADyIAQQF0IABBB3VBAXFBG2xzQf8BcQufAQEBfyMAQRBrIgMgADoADyADIAE2AgggAyACNgIEIANBADoAAwNAIAMtAANBBE9FBEAgA0EAOgACA0AgAy0AAiIBQQRPRQRAIAEgAy0AA0ECdCICIAMoAghqaiIAIAMoAgQgASACIAMtAA9BBHRqamotAAAgAC0AAHM6AAAgAyADLQACQQFqOgACDAELCyADIAMtAANBAWo6AAMMAQsLC08BAn9BkAwoAgAiASAAQQdqQXhxIgJqIQACQCACQQAgACABTRsNACAAPwBBEHRLBEAgABAARQ0BC0GQDCAANgIAIAEPC0GUDEEwNgIAQX8LNQEBf0EBIAAgAEEBTRshAAJAA0AgABAMIgENAUGIECgCACIBBEAgARECAAwBCwsQAQALIAELAgAL+AEBAX8jAEEQayIBIAA2AgwgASABKAIMLQANOgALIAEoAgwgASgCDC0ACToADSABKAIMIAEoAgwtAAU6AAkgASgCDCABKAIMLQABOgAFIAEoAgwgAS0ACzoAASABIAEoAgwtAAI6AAsgASgCDCABKAIMLQAKOgACIAEoAgwgAS0ACzoACiABIAEoAgwtAAY6AAsgASgCDCABKAIMLQAOOgAGIAEoAgwgAS0ACzoADiABIAEoAgwtAAM6AAsgASgCDCABKAIMLQAHOgADIAEoAgwgASgCDC0ACzoAByABKAIMIAEoAgwtAA86AAsgASgCDCABLQALOgAPC/gBAQF/IwBBEGsiASAANgIMIAEgASgCDC0AAToACyABKAIMIAEoAgwtAAU6AAEgASgCDCABKAIMLQAJOgAFIAEoAgwgASgCDC0ADToACSABKAIMIAEtAAs6AA0gASABKAIMLQACOgALIAEoAgwgASgCDC0ACjoAAiABKAIMIAEtAAs6AAogASABKAIMLQAGOgALIAEoAgwgASgCDC0ADjoABiABKAIMIAEtAAs6AA4gASABKAIMLQADOgALIAEoAgwgASgCDC0ADzoAAyABKAIMIAEoAgwtAAs6AA8gASgCDCABKAIMLQAHOgALIAEoAgwgAS0ACzoABwt7AQF/IwBBEGsiASAANgIMIAFBADoACwNAIAEtAAtBBE9FBEAgAUEAOgAKA0AgAS0ACiIAQQRPRQRAIAEtAAsgASgCDCAAQQJ0amoiACAALQAALQCACDoAACABIAEtAApBAWo6AAoMAQsLIAEgAS0AC0EBajoACwwBCwsL6wQBAX8jAEEQayICJAAgAiAANgIMIAIgATYCCCACQQA6AAdBACACKAIMIAIoAggQAyACQQE6AAcDQCACLQAHQQ5JBEAgAigCDBAJIAIoAgwQCCACKAIMIQEjAEEQayIAJAAgACABNgIMIABBADoACwNAIAAtAAsiAUEESQRAIAAgACgCDCABQQJ0ai0AADoACCAAIAAoAgwgAC0AC0ECdGoiAS0AAyABLQACIAEtAAAgAS0AAXNzczoACiAAIAAoAgwgAC0AC0ECdGotAAAgACgCDCAALQALQQJ0ai0AAXM6AAkgACAALQAJEAI6AAkgACgCDCAALQALQQJ0aiIBIAEtAAAgAC0ACSAALQAKc3M6AAAgACAAKAIMIAAtAAtBAnRqLQABIAAoAgwgAC0AC0ECdGotAAJzOgAJIAAgAC0ACRACOgAJIAAoAgwgAC0AC0ECdGoiASABLQABIAAtAAkgAC0ACnNzOgABIAAgACgCDCAALQALQQJ0ai0AAiAAKAIMIAAtAAtBAnRqLQADczoACSAAIAAtAAkQAjoACSAAKAIMIAAtAAtBAnRqIgEgAS0AAiAALQAJIAAtAApzczoAAiAAIAAoAgwgAC0AC0ECdGotAAMgAC0ACHM6AAkgACAALQAJEAI6AAkgACgCDCAALQALQQJ0aiIBIAEtAAMgAC0ACSAALQAKc3M6AAMgACAALQALQQFqOgALDAELCyAAQRBqJAAgAi0AByACKAIMIAIoAggQAyACIAItAAdBAWo6AAcMAQsLIAIoAgwQCSACKAIMEAhBDiACKAIMIAIoAggQAyACQRBqJAALmwYBAX8jAEEQayIDJAAgAyAANgIMIAMgATYCCCADIAI2AgQgAygCCCEBIwBBIGsiACADKAIMNgIcIAAgATYCGCAAQQA2AhQDQCAAKAIUIgFBCEkEQCABQQJ0IgEgACgCHGogASAAKAIYai0AADoAACAAKAIUQQJ0QQFqIgEgACgCHGogASAAKAIYai0AADoAACAAKAIUQQJ0QQJqIgEgACgCHGogASAAKAIYai0AADoAACAAKAIUQQJ0QQNqIgEgACgCHGogASAAKAIYai0AADoAACAAIAAoAhRBAWo2AhQMAQsLIABBCDYCFANAIAAoAhQiAUE8SQRAIAAgAUEBa0ECdDYCDCAAIAAoAhwgACgCDGotAAA6AAggACAAKAIcIAAoAgxBAWpqLQAAOgAJIAAgACgCHCAAKAIMQQJqai0AADoACiAAIAAoAhwgACgCDEEDamotAAA6AAsgACgCFEEHcUUEQCAAIAAtAAg6AAcgACAALQAJOgAIIAAgAC0ACjoACSAAIAAtAAs6AAogACAALQAHOgALIAAgAC0ACC0AgAg6AAggACAALQAJLQCACDoACSAAIAAtAAotAIAIOgAKIAAgAC0ACy0AgAg6AAsgACAALQAIIAAoAhRBA3YtAIAKczoACAsgACgCFEEHcUEERgRAIAAgAC0ACC0AgAg6AAggACAALQAJLQCACDoACSAAIAAtAAotAIAIOgAKIAAgAC0ACy0AgAg6AAsLIAAgACgCFEECdDYCECAAIAAoAhRBCGtBAnQ2AgwgACgCHCIBIAAoAhBqIAAoAgwgAWotAAAgAC0ACHM6AAAgACgCHCAAKAIQQQFqaiAAKAIcIAAoAgxBAWpqLQAAIAAtAAlzOgAAIAAoAhwgACgCEEECamogACgCHCAAKAIMQQJqai0AACAALQAKczoAACAAKAIcIAAoAhBBA2pqIAAoAhwgACgCDEEDamotAAAgAC0AC3M6AAAgACAAKAIUQQFqNgIUDAELCyADKAIMIgAgAygCBCIBKQAANwDwASAAIAEpAAg3APgBIANBEGokAAvOJwEMfyMAQRBrIgokAAJAAkACQAJAAkACQAJAAkACQCAAQfQBTQRAQZgMKAIAIgZBECAAQQtqQXhxIABBC0kbIgVBA3YiAHYiAUEDcQRAAkAgAUF/c0EBcSAAaiICQQN0IgFBwAxqIgAgAUHIDGooAgAiASgCCCIDRgRAQZgMIAZBfiACd3E2AgAMAQsgAyAANgIMIAAgAzYCCAsgAUEIaiEAIAEgAkEDdCICQQNyNgIEIAEgAmoiASABKAIEQQFyNgIEDAoLIAVBoAwoAgAiB00NASABBEACQEECIAB0IgJBACACa3IgASAAdHFoIgFBA3QiAEHADGoiAiAAQcgMaigCACIAKAIIIgNGBEBBmAwgBkF+IAF3cSIGNgIADAELIAMgAjYCDCACIAM2AggLIAAgBUEDcjYCBCAAIAVqIgQgAUEDdCIBIAVrIgNBAXI2AgQgACABaiADNgIAIAcEQCAHQXhxQcAMaiEBQawMKAIAIQICfyAGQQEgB0EDdnQiBXFFBEBBmAwgBSAGcjYCACABDAELIAEoAggLIQUgASACNgIIIAUgAjYCDCACIAE2AgwgAiAFNgIICyAAQQhqIQBBrAwgBDYCAEGgDCADNgIADAoLQZwMKAIAIgtFDQEgC2hBAnRByA5qKAIAIgIoAgRBeHEgBWshBCACIQEDQAJAIAEoAhAiAEUEQCABKAIUIgBFDQELIAAoAgRBeHEgBWsiASAEIAEgBEkiARshBCAAIAIgARshAiAAIQEMAQsLIAIoAhghCSACIAIoAgwiA0cEQEGoDCgCABogAigCCCIAIAM2AgwgAyAANgIIDAkLIAJBFGoiASgCACIARQRAIAIoAhAiAEUNAyACQRBqIQELA0AgASEIIAAiA0EUaiIBKAIAIgANACADQRBqIQEgAygCECIADQALIAhBADYCAAwIC0F/IQUgAEG/f0sNACAAQQtqIgBBeHEhBUGcDCgCACIIRQ0AQQAgBWshBAJAAkACQAJ/QQAgBUGAAkkNABpBHyAFQf///wdLDQAaIAVBJiAAQQh2ZyIAa3ZBAXEgAEEBdGtBPmoLIgdBAnRByA5qKAIAIgFFBEBBACEADAELQQAhACAFQRkgB0EBdmtBACAHQR9HG3QhAgNAAkAgASgCBEF4cSAFayIGIARPDQAgASEDIAYiBA0AQQAhBCABIQAMAwsgACABKAIUIgYgBiABIAJBHXZBBHFqKAIQIgFGGyAAIAYbIQAgAkEBdCECIAENAAsLIAAgA3JFBEBBACEDQQIgB3QiAEEAIABrciAIcSIARQ0DIABoQQJ0QcgOaigCACEACyAARQ0BCwNAIAAoAgRBeHEgBWsiAiAESSEBIAIgBCABGyEEIAAgAyABGyEDIAAoAhAiAQR/IAEFIAAoAhQLIgANAAsLIANFDQAgBEGgDCgCACAFa08NACADKAIYIQcgAyADKAIMIgJHBEBBqAwoAgAaIAMoAggiACACNgIMIAIgADYCCAwHCyADQRRqIgEoAgAiAEUEQCADKAIQIgBFDQMgA0EQaiEBCwNAIAEhBiAAIgJBFGoiASgCACIADQAgAkEQaiEBIAIoAhAiAA0ACyAGQQA2AgAMBgsgBUGgDCgCACIDTQRAQawMKAIAIQACQCADIAVrIgFBEE8EQCAAIAVqIgIgAUEBcjYCBCAAIANqIAE2AgAgACAFQQNyNgIEDAELIAAgA0EDcjYCBCAAIANqIgEgASgCBEEBcjYCBEEAIQJBACEBC0GgDCABNgIAQawMIAI2AgAgAEEIaiEADAgLIAVBpAwoAgAiAkkEQEGkDCACIAVrIgE2AgBBsAxBsAwoAgAiACAFaiICNgIAIAIgAUEBcjYCBCAAIAVBA3I2AgQgAEEIaiEADAgLQQAhACAFQS9qIgQCf0HwDygCAARAQfgPKAIADAELQfwPQn83AgBB9A9CgKCAgICABDcCAEHwDyAKQQxqQXBxQdiq1aoFczYCAEGEEEEANgIAQdQPQQA2AgBBgCALIgFqIgZBACABayIIcSIBIAVNDQdB0A8oAgAiAwRAQcgPKAIAIgcgAWoiCSAHTQ0IIAMgCUkNCAsCQEHUDy0AAEEEcUUEQAJAAkACQAJAQbAMKAIAIgMEQEHYDyEAA0AgAyAAKAIAIgdPBEAgByAAKAIEaiADSw0DCyAAKAIIIgANAAsLQQAQBCICQX9GDQMgASEGQfQPKAIAIgBBAWsiAyACcQRAIAEgAmsgAiADakEAIABrcWohBgsgBSAGTw0DQdAPKAIAIgAEQEHIDygCACIDIAZqIgggA00NBCAAIAhJDQQLIAYQBCIAIAJHDQEMBQsgBiACayAIcSIGEAQiAiAAKAIAIAAoAgRqRg0BIAIhAAsgAEF/Rg0BIAVBMGogBk0EQCAAIQIMBAtB+A8oAgAiAiAEIAZrakEAIAJrcSICEARBf0YNASACIAZqIQYgACECDAMLIAJBf0cNAgtB1A9B1A8oAgBBBHI2AgALIAEQBCECQQAQBCEAIAJBf0YNBSAAQX9GDQUgACACTQ0FIAAgAmsiBiAFQShqTQ0FC0HID0HIDygCACAGaiIANgIAQcwPKAIAIABJBEBBzA8gADYCAAsCQEGwDCgCACIEBEBB2A8hAANAIAIgACgCACIBIAAoAgQiA2pGDQIgACgCCCIADQALDAQLQagMKAIAIgBBACAAIAJNG0UEQEGoDCACNgIAC0EAIQBB3A8gBjYCAEHYDyACNgIAQbgMQX82AgBBvAxB8A8oAgA2AgBB5A9BADYCAANAIABBA3QiAUHIDGogAUHADGoiAzYCACABQcwMaiADNgIAIABBAWoiAEEgRw0AC0GkDCAGQShrIgBBeCACa0EHcSIBayIDNgIAQbAMIAEgAmoiATYCACABIANBAXI2AgQgACACakEoNgIEQbQMQYAQKAIANgIADAQLIAIgBE0NAiABIARLDQIgACgCDEEIcQ0CIAAgAyAGajYCBEGwDCAEQXggBGtBB3EiAGoiATYCAEGkDEGkDCgCACAGaiICIABrIgA2AgAgASAAQQFyNgIEIAIgBGpBKDYCBEG0DEGAECgCADYCAAwDC0EAIQMMBQtBACECDAMLQagMKAIAIAJLBEBBqAwgAjYCAAsgAiAGaiEBQdgPIQACQAJAAkADQCABIAAoAgBHBEAgACgCCCIADQEMAgsLIAAtAAxBCHFFDQELQdgPIQADQAJAIAQgACgCACIBTwRAIAEgACgCBGoiAyAESw0BCyAAKAIIIQAMAQsLQaQMIAZBKGsiAEF4IAJrQQdxIgFrIgg2AgBBsAwgASACaiIBNgIAIAEgCEEBcjYCBCAAIAJqQSg2AgRBtAxBgBAoAgA2AgAgBCADQScgA2tBB3FqQS9rIgAgACAEQRBqSRsiAUEbNgIEIAFB4A8pAgA3AhAgAUHYDykCADcCCEHgDyABQQhqNgIAQdwPIAY2AgBB2A8gAjYCAEHkD0EANgIAIAFBGGohAANAIABBBzYCBCAAQQhqIQwgAEEEaiEAIAwgA0kNAAsgASAERg0CIAEgASgCBEF+cTYCBCAEIAEgBGsiAkEBcjYCBCABIAI2AgAgAkH/AU0EQCACQXhxQcAMaiEAAn9BmAwoAgAiAUEBIAJBA3Z0IgJxRQRAQZgMIAEgAnI2AgAgAAwBCyAAKAIICyEBIAAgBDYCCCABIAQ2AgwgBCAANgIMIAQgATYCCAwDC0EfIQAgAkH///8HTQRAIAJBJiACQQh2ZyIAa3ZBAXEgAEEBdGtBPmohAAsgBCAANgIcIARCADcCECAAQQJ0QcgOaiEBAkBBnAwoAgAiA0EBIAB0IgZxRQRAQZwMIAMgBnI2AgAgASAENgIADAELIAJBGSAAQQF2a0EAIABBH0cbdCEAIAEoAgAhAwNAIAMiASgCBEF4cSACRg0DIABBHXYhAyAAQQF0IQAgASADQQRxaiIGKAIQIgMNAAsgBiAENgIQCyAEIAE2AhggBCAENgIMIAQgBDYCCAwCCyAAIAI2AgAgACAAKAIEIAZqNgIEIAJBeCACa0EHcWoiByAFQQNyNgIEIAFBeCABa0EHcWoiBCAFIAdqIgVrIQYCQEGwDCgCACAERgRAQbAMIAU2AgBBpAxBpAwoAgAgBmoiADYCACAFIABBAXI2AgQMAQtBrAwoAgAgBEYEQEGsDCAFNgIAQaAMQaAMKAIAIAZqIgA2AgAgBSAAQQFyNgIEIAAgBWogADYCAAwBCyAEKAIEIgJBA3FBAUYEQCACQXhxIQkCQCACQf8BTQRAIAQoAgwiACAEKAIIIgFGBEBBmAxBmAwoAgBBfiACQQN2d3E2AgAMAgsgASAANgIMIAAgATYCCAwBCyAEKAIYIQgCQCAEIAQoAgwiAEcEQEGoDCgCABogBCgCCCIBIAA2AgwgACABNgIIDAELAkAgBEEUaiIBKAIAIgJFBEAgBCgCECICRQ0BIARBEGohAQsDQCABIQMgAiIAQRRqIgEoAgAiAg0AIABBEGohASAAKAIQIgINAAsgA0EANgIADAELQQAhAAsgCEUNAAJAIAQoAhwiAUECdEHIDmoiAigCACAERgRAIAIgADYCACAADQFBnAxBnAwoAgBBfiABd3E2AgAMAgsgCEEQQRQgCCgCECAERhtqIAA2AgAgAEUNAQsgACAINgIYIAQoAhAiAQRAIAAgATYCECABIAA2AhgLIAQoAhQiAUUNACAAIAE2AhQgASAANgIYCyAGIAlqIQYgBCAJaiIEKAIEIQILIAQgAkF+cTYCBCAFIAZBAXI2AgQgBSAGaiAGNgIAIAZB/wFNBEAgBkF4cUHADGohAAJ/QZgMKAIAIgFBASAGQQN2dCICcUUEQEGYDCABIAJyNgIAIAAMAQsgACgCCAshASAAIAU2AgggASAFNgIMIAUgADYCDCAFIAE2AggMAQtBHyECIAZB////B00EQCAGQSYgBkEIdmciAGt2QQFxIABBAXRrQT5qIQILIAUgAjYCHCAFQgA3AhAgAkECdEHIDmohAQJAAkBBnAwoAgAiAEEBIAJ0IgNxRQRAQZwMIAAgA3I2AgAgASAFNgIADAELIAZBGSACQQF2a0EAIAJBH0cbdCECIAEoAgAhAANAIAAiASgCBEF4cSAGRg0CIAJBHXYhACACQQF0IQIgASAAQQRxaiIDKAIQIgANAAsgAyAFNgIQCyAFIAE2AhggBSAFNgIMIAUgBTYCCAwBCyABKAIIIgAgBTYCDCABIAU2AgggBUEANgIYIAUgATYCDCAFIAA2AggLIAdBCGohAAwFCyABKAIIIgAgBDYCDCABIAQ2AgggBEEANgIYIAQgATYCDCAEIAA2AggLQaQMKAIAIgAgBU0NAEGkDCAAIAVrIgE2AgBBsAxBsAwoAgAiACAFaiICNgIAIAIgAUEBcjYCBCAAIAVBA3I2AgQgAEEIaiEADAMLQZQMQTA2AgBBACEADAILAkAgB0UNAAJAIAMoAhwiAEECdEHIDmoiASgCACADRgRAIAEgAjYCACACDQFBnAwgCEF+IAB3cSIINgIADAILIAdBEEEUIAcoAhAgA0YbaiACNgIAIAJFDQELIAIgBzYCGCADKAIQIgAEQCACIAA2AhAgACACNgIYCyADKAIUIgBFDQAgAiAANgIUIAAgAjYCGAsCQCAEQQ9NBEAgAyAEIAVqIgBBA3I2AgQgACADaiIAIAAoAgRBAXI2AgQMAQsgAyAFQQNyNgIEIAMgBWoiAiAEQQFyNgIEIAIgBGogBDYCACAEQf8BTQRAIARBeHFBwAxqIQACf0GYDCgCACIBQQEgBEEDdnQiBXFFBEBBmAwgASAFcjYCACAADAELIAAoAggLIQEgACACNgIIIAEgAjYCDCACIAA2AgwgAiABNgIIDAELQR8hACAEQf///wdNBEAgBEEmIARBCHZnIgBrdkEBcSAAQQF0a0E+aiEACyACIAA2AhwgAkIANwIQIABBAnRByA5qIQECQAJAIAhBASAAdCIFcUUEQEGcDCAFIAhyNgIAIAEgAjYCAAwBCyAEQRkgAEEBdmtBACAAQR9HG3QhACABKAIAIQUDQCAFIgEoAgRBeHEgBEYNAiAAQR12IQUgAEEBdCEAIAEgBUEEcWoiBigCECIFDQALIAYgAjYCEAsgAiABNgIYIAIgAjYCDCACIAI2AggMAQsgASgCCCIAIAI2AgwgASACNgIIIAJBADYCGCACIAE2AgwgAiAANgIICyADQQhqIQAMAQsCQCAJRQ0AAkAgAigCHCIAQQJ0QcgOaiIBKAIAIAJGBEAgASADNgIAIAMNAUGcDCALQX4gAHdxNgIADAILIAlBEEEUIAkoAhAgAkYbaiADNgIAIANFDQELIAMgCTYCGCACKAIQIgAEQCADIAA2AhAgACADNgIYCyACKAIUIgBFDQAgAyAANgIUIAAgAzYCGAsCQCAEQQ9NBEAgAiAEIAVqIgBBA3I2AgQgACACaiIAIAAoAgRBAXI2AgQMAQsgAiAFQQNyNgIEIAIgBWoiAyAEQQFyNgIEIAMgBGogBDYCACAHBEAgB0F4cUHADGohAEGsDCgCACEBAn9BASAHQQN2dCIFIAZxRQRAQZgMIAUgBnI2AgAgAAwBCyAAKAIICyEFIAAgATYCCCAFIAE2AgwgASAANgIMIAEgBTYCCAtBrAwgAzYCAEGgDCAENgIACyACQQhqIQALIApBEGokACAAC60CAQF/IwBBMGsiAyQAIAMgADYCLCADIAE2AiggAyACNgIkIANBADYCDCADQRA2AggDQCADKAIMIAMoAiRJBEAgAygCCEEQRgRAIANBEGoiACADKAIsIgEpAPABNwAAIAAgASkA+AE3AAggACADKAIsEAogA0EPNgIIA0ACQCADKAIIIgBBAEgNAAJAIAAgAygCLEHwAWpqIgAtAABB/wFGBEAgAEEAOgAADAELIAMoAgggAygCLEHwAWpqIgAgAC0AAEEBajoAAAwBCyADIAMoAghBAWs2AggMAQsLIANBADYCCAsgAygCKCADKAIMaiIAIAAtAAAgAygCCCADQRBqai0AAHM6AAAgAyADKAIMQQFqNgIMIAMgAygCCEEBajYCCAwBCwsgA0EwaiQAC1wBAX8jAEEQayICIAA2AgwgAiABNgIIIAJBADoABwNAIAItAAciAUEQT0UEQCABIAIoAgxqIgAgASACKAIIai0AACAALQAAczoAACACIAItAAdBAWo6AAcMAQsLC3sBAX8jAEEQayIBIAA2AgwgAUEAOgALA0AgAS0AC0EET0UEQCABQQA6AAoDQCABLQAKIgBBBE9FBEAgAS0ACyABKAIMIABBAnRqaiIAIAAtAAAtAJAKOgAAIAEgAS0ACkEBajoACgwBCwsgASABLQALQQFqOgALDAELCwuCEQEDfyMAQYACayIFJAACQCABRQ0AIAJFDQAgBSAAKAIEIAAoAggQCwJAAkACQCAAKAIAQQFrDgIAAQILIwBBIGsiAyQAIAMgBTYCHCADIAE2AhggAyACNgIUIANBADYCEANAIAMoAhAgAygCFEkEQCADIAMoAhgiACkAADcAACADIAApAAg3AAggAygCGCEAIAMoAhwhBCMAQRBrIgEkACABIAA2AgwgASAENgIIIAFBADoAB0EOIAEoAgwgASgCCBADIAFBDToABwNAIAEtAAcEQCABKAIMEAcgASgCDBAPIAEtAAcgASgCDCABKAIIEAMgASgCDCEEIwBBEGsiACQAIAAgBDYCDCAAQQA2AggDQCAAKAIIIgRBBEgEQCAAIAAoAgwgBEECdGotAAA6AAcgACAAKAIMIAAoAghBAnRqLQABOgAGIAAgACgCDCAAKAIIQQJ0ai0AAjoABSAAIAAoAgwgACgCCEECdGotAAM6AAQgAC0AByIEQQBsIAQQAkH/AXFzIAAtAAcQAkH/AXEQAkH/AXFzIAAtAAcQAkH/AXEQAkH/AXEQAkH/AXFzIAAtAAcQAkH/AXEQAkH/AXEQAkH/AXEQAkH/AXFBAGxzIAAtAAYiBCAEEAJB/wFxcyAALQAGEAJB/wFxEAJB/wFxQQBscyAALQAGEAJB/wFxEAJB/wFxEAJB/wFxcyAALQAGEAJB/wFxEAJB/wFxEAJB/wFxEAJB/wFxQQBsc3MgAC0ABSIEIAQQAkH/AXFBAGxzIAAtAAUQAkH/AXEQAkH/AXFzIAAtAAUQAkH/AXEQAkH/AXEQAkH/AXFzIAAtAAUQAkH/AXEQAkH/AXEQAkH/AXEQAkH/AXFBAGxzcyAALQAEIgQgBBACQf8BcUEAbHMgAC0ABBACQf8BcRACQf8BcUEAbHMgAC0ABBACQf8BcRACQf8BcRACQf8BcXMgAC0ABBACQf8BcRACQf8BcRACQf8BcRACQf8BcUEAbHNzIQQgACgCDCAAKAIIQQJ0aiAEOgAAIAAtAAcgAC0ABxACQf8BcUEAbHMgAC0ABxACQf8BcRACQf8BcUEAbHMgAC0ABxACQf8BcRACQf8BcRACQf8BcXMgAC0ABxACQf8BcRACQf8BcRACQf8BcRACQf8BcUEAbHMgAC0ABkEAbCAALQAGEAJB/wFxcyAALQAGEAJB/wFxEAJB/wFxcyAALQAGEAJB/wFxEAJB/wFxEAJB/wFxcyAALQAGEAJB/wFxEAJB/wFxEAJB/wFxEAJB/wFxQQBsc3MgAC0ABSAALQAFEAJB/wFxcyAALQAFEAJB/wFxEAJB/wFxQQBscyAALQAFEAJB/wFxEAJB/wFxEAJB/wFxcyAALQAFEAJB/wFxEAJB/wFxEAJB/wFxEAJB/wFxQQBsc3MgAC0ABCAALQAEEAJB/wFxQQBscyAALQAEEAJB/wFxEAJB/wFxcyAALQAEEAJB/wFxEAJB/wFxEAJB/wFxcyAALQAEEAJB/wFxEAJB/wFxEAJB/wFxEAJB/wFxQQBsc3MhBCAAKAIMIAAoAghBAnRqIAQ6AAEgAC0AByAALQAHEAJB/wFxQQBscyAALQAHEAJB/wFxEAJB/wFxcyAALQAHEAJB/wFxEAJB/wFxEAJB/wFxcyAALQAHEAJB/wFxEAJB/wFxEAJB/wFxEAJB/wFxQQBscyAALQAGIAAtAAYQAkH/AXFBAGxzIAAtAAYQAkH/AXEQAkH/AXFBAGxzIAAtAAYQAkH/AXEQAkH/AXEQAkH/AXFzIAAtAAYQAkH/AXEQAkH/AXEQAkH/AXEQAkH/AXFBAGxzcyAALQAFQQBsIAAtAAUQAkH/AXFzIAAtAAUQAkH/AXEQAkH/AXFzIAAtAAUQAkH/AXEQAkH/AXEQAkH/AXFzIAAtAAUQAkH/AXEQAkH/AXEQAkH/AXEQAkH/AXFBAGxzcyAALQAEIAAtAAQQAkH/AXFzIAAtAAQQAkH/AXEQAkH/AXFBAGxzIAAtAAQQAkH/AXEQAkH/AXEQAkH/AXFzIAAtAAQQAkH/AXEQAkH/AXEQAkH/AXEQAkH/AXFBAGxzcyEEIAAoAgwgACgCCEECdGogBDoAAiAALQAHIAAtAAcQAkH/AXFzIAAtAAcQAkH/AXEQAkH/AXFBAGxzIAAtAAcQAkH/AXEQAkH/AXEQAkH/AXFzIAAtAAcQAkH/AXEQAkH/AXEQAkH/AXEQAkH/AXFBAGxzIAAtAAYgAC0ABhACQf8BcUEAbHMgAC0ABhACQf8BcRACQf8BcXMgAC0ABhACQf8BcRACQf8BcRACQf8BcXMgAC0ABhACQf8BcRACQf8BcRACQf8BcRACQf8BcUEAbHNzIAAtAAUgAC0ABRACQf8BcUEAbHMgAC0ABRACQf8BcRACQf8BcUEAbHMgAC0ABRACQf8BcRACQf8BcRACQf8BcXMgAC0ABRACQf8BcRACQf8BcRACQf8BcRACQf8BcUEAbHNzIAAtAARBAGwgAC0ABBACQf8BcXMgAC0ABBACQf8BcRACQf8BcXMgAC0ABBACQf8BcRACQf8BcRACQf8BcXMgAC0ABBACQf8BcRACQf8BcRACQf8BcRACQf8BcUEAbHNzIQQgACgCDCAAKAIIQQJ0aiAEOgADIAAgACgCCEEBajYCCAwBCwsgAEEQaiQAIAEgAS0AB0EBazoABwwBCwsgASgCDBAHIAEoAgwQD0EAIAEoAgwgASgCCBADIAFBEGokACADKAIYIAMoAhxB8AFqEA4gAygCHCIAIAMpAAA3APABIAAgAykACDcA+AEgAyADKAIYQRBqNgIYIAMgAygCEEEQajYCEAwBCwsgA0EgaiQADAELIAUgASACEA0LIAIhAwsgBUGAAmokACADC4ACAQJ/IwBBgAJrIgMkAAJAIAFFDQAgAkUNACADIAAoAgQgACgCCBALAkACQAJAIAAoAgBBAWsOAgABAgsjAEEgayIAJAAgACADNgIcIAAgATYCGCAAIAI2AhQgACAAKAIcQfABajYCDCAAQQA2AhADQCAAKAIQIAAoAhRJBEAgACgCGCAAKAIMEA4gACgCGCAAKAIcEAogACAAKAIYNgIMIAAgACgCGEEQajYCGCAAIAAoAhBBEGo2AhAMAQsLIAAoAhwiASAAKAIMIgQpAAA3APABIAEgBCkACDcA+AEgAEEgaiQADAELIAMgASACEA0LIAIhBAsgA0GAAmokACAEC9ILAQd/AkAgAEUNACAAQQhrIgIgAEEEaygCACIBQXhxIgBqIQUCQCABQQFxDQAgAUEDcUUNASACIAIoAgAiAWsiAkGoDCgCAEkNASAAIAFqIQACQAJAQawMKAIAIAJHBEAgAUH/AU0EQCABQQN2IQQgAigCDCIBIAIoAggiA0YEQEGYDEGYDCgCAEF+IAR3cTYCAAwFCyADIAE2AgwgASADNgIIDAQLIAIoAhghBiACIAIoAgwiAUcEQCACKAIIIgMgATYCDCABIAM2AggMAwsgAkEUaiIEKAIAIgNFBEAgAigCECIDRQ0CIAJBEGohBAsDQCAEIQcgAyIBQRRqIgQoAgAiAw0AIAFBEGohBCABKAIQIgMNAAsgB0EANgIADAILIAUoAgQiAUEDcUEDRw0CQaAMIAA2AgAgBSABQX5xNgIEIAIgAEEBcjYCBCAFIAA2AgAPC0EAIQELIAZFDQACQCACKAIcIgNBAnRByA5qIgQoAgAgAkYEQCAEIAE2AgAgAQ0BQZwMQZwMKAIAQX4gA3dxNgIADAILIAZBEEEUIAYoAhAgAkYbaiABNgIAIAFFDQELIAEgBjYCGCACKAIQIgMEQCABIAM2AhAgAyABNgIYCyACKAIUIgNFDQAgASADNgIUIAMgATYCGAsgAiAFTw0AIAUoAgQiAUEBcUUNAAJAAkACQAJAIAFBAnFFBEBBsAwoAgAgBUYEQEGwDCACNgIAQaQMQaQMKAIAIABqIgA2AgAgAiAAQQFyNgIEIAJBrAwoAgBHDQZBoAxBADYCAEGsDEEANgIADwtBrAwoAgAgBUYEQEGsDCACNgIAQaAMQaAMKAIAIABqIgA2AgAgAiAAQQFyNgIEIAAgAmogADYCAA8LIAFBeHEgAGohACABQf8BTQRAIAFBA3YhBCAFKAIMIgEgBSgCCCIDRgRAQZgMQZgMKAIAQX4gBHdxNgIADAULIAMgATYCDCABIAM2AggMBAsgBSgCGCEGIAUgBSgCDCIBRwRAQagMKAIAGiAFKAIIIgMgATYCDCABIAM2AggMAwsgBUEUaiIEKAIAIgNFBEAgBSgCECIDRQ0CIAVBEGohBAsDQCAEIQcgAyIBQRRqIgQoAgAiAw0AIAFBEGohBCABKAIQIgMNAAsgB0EANgIADAILIAUgAUF+cTYCBCACIABBAXI2AgQgACACaiAANgIADAMLQQAhAQsgBkUNAAJAIAUoAhwiA0ECdEHIDmoiBCgCACAFRgRAIAQgATYCACABDQFBnAxBnAwoAgBBfiADd3E2AgAMAgsgBkEQQRQgBigCECAFRhtqIAE2AgAgAUUNAQsgASAGNgIYIAUoAhAiAwRAIAEgAzYCECADIAE2AhgLIAUoAhQiA0UNACABIAM2AhQgAyABNgIYCyACIABBAXI2AgQgACACaiAANgIAIAJBrAwoAgBHDQBBoAwgADYCAA8LIABB/wFNBEAgAEF4cUHADGohAQJ/QZgMKAIAIgNBASAAQQN2dCIAcUUEQEGYDCAAIANyNgIAIAEMAQsgASgCCAshACABIAI2AgggACACNgIMIAIgATYCDCACIAA2AggPC0EfIQMgAEH///8HTQRAIABBJiAAQQh2ZyIBa3ZBAXEgAUEBdGtBPmohAwsgAiADNgIcIAJCADcCECADQQJ0QcgOaiEBAkACQAJAQZwMKAIAIgRBASADdCIHcUUEQEGcDCAEIAdyNgIAIAEgAjYCACACIAE2AhgMAQsgAEEZIANBAXZrQQAgA0EfRxt0IQMgASgCACEBA0AgASIEKAIEQXhxIABGDQIgA0EddiEBIANBAXQhAyAEIAFBBHFqIgdBEGooAgAiAQ0ACyAHIAI2AhAgAiAENgIYCyACIAI2AgwgAiACNgIIDAELIAQoAggiACACNgIMIAQgAjYCCCACQQA2AhggAiAENgIMIAIgADYCCAtBuAxBuAwoAgBBAWsiAEF/IAAbNgIACwtjAQF/QQwQBSIDIAA2AgAgA0EgEAUiADYCBCAAIAEpABg3ABggACABKQAQNwAQIAAgASkACDcACCAAIAEpAAA3AAAgA0EQEAUiADYCCCAAIAIpAAg3AAggACACKQAANwAAIAMLC6EEAgBBgAgLkARjfHd78mtvxTABZyv+16t2yoLJffpZR/Ct1KKvnKRywLf9kyY2P/fMNKXl8XHYMRUExyPDGJYFmgcSgOLrJ7J1CYMsGhtuWqBSO9azKeMvhFPRAO0g/LFbasu+OUpMWM/Q76r7Q00zhUX5An9QPJ+oUaNAj5KdOPW8ttohEP/z0s0ME+xfl0QXxKd+PWRdGXNggU/cIiqQiEbuuBTeXgvb4DI6CkkGJFzC06xikZXkeefIN22N1U6pbFb06mV6rgi6eCUuHKa0xujddB9LvYuKcD61ZkgD9g5hNVe5hsEdnuH4mBFp2Y6Umx6H6c5VKN+MoYkNv+ZCaEGZLQ+wVLsWjQECBAgQIECAGzYAAAAAAFIJatUwNqU4v0CjnoHz1/t84zmCmy//hzSOQ0TE3unLVHuUMqbCIz3uTJULQvrDTgguoWYo2SSydluiSW2L0SVy+PZkhmiYFtSkXMxdZbaSbHBIUP3tudpeFUZXp42dhJDYqwCMvNMK9+RYBbizRQbQLB6Pyj8PAsGvvQMBE4prOpERQU9n3OqX8s/O8LTmc5asdCLnrTWF4vk36Bx1325H8RpxHSnFiW+3Yg6qGL4b/FY+S8bSeSCa28D+eM1a9B/dqDOIB8cxsRIQWSeA7F9gUX+pGbVKDS3lep+TyZzvoOA7Ta4q9bDI67s8g1OZYRcrBH66d9Ym4WkUY1UhDH0AQZAMCwMQCAE=")||(FL=QL,QL=gL.locateFile?gL.locateFile(FL,IL):IL+FL);var qL=t=>{for(;t.length>0;)t.shift()(gL)};gL.noExitRuntime;var VL,YL=t=>{var e=(t-bL.buffer.byteLength+65535)/65536;try{return bL.grow(e),SL(),1}catch(t){}},KL={b:()=>{LL("")},a:t=>{var e=TL.length,n=2147483648;if((t>>>=0)>n)return!1;for(var r=(t,e)=>t+(e-t%e)%e,i=1;i<=4;i*=2){var o=e*(1+.2/i);o=Math.min(o,t+100663296);var a=Math.min(n,r(Math.max(t,o),65536));if(YL(a))return!0}return!1}},WL=function(){var t={a:KL};function e(t,e){var n;return WL=t.exports,bL=WL.c,SL(),n=WL.d,RL.unshift(n),function(){if(OL--,gL.monitorRunDependencies&&gL.monitorRunDependencies(OL),0==OL&&NL){var t=NL;NL=null,t()}}(),WL}if(OL++,gL.monitorRunDependencies&&gL.monitorRunDependencies(OL),gL.instantiateWasm)try{return gL.instantiateWasm(t,e)}catch(t){return wL(`Module.instantiateWasm callback failed with error: ${t}`),!1}return GL(0,QL,t,(function(t){e(t.instance)})),{}}();function XL(){function t(){VL||(VL=!0,gL.calledRun=!0,BL||(qL(RL),gL.onRuntimeInitialized&&gL.onRuntimeInitialized(),function(){if(gL.postRun)for("function"==typeof gL.postRun&&(gL.postRun=[gL.postRun]);gL.postRun.length;)t=gL.postRun.shift(),zL.unshift(t);var t;qL(zL)}()))}OL>0||(!function(){if(gL.preRun)for("function"==typeof gL.preRun&&(gL.preRun=[gL.preRun]);gL.preRun.length;)t=gL.preRun.shift(),DL.unshift(t);var t;qL(DL)}(),OL>0||(gL.setStatus?(gL.setStatus("Running..."),setTimeout((function(){setTimeout((function(){gL.setStatus("")}),1),t()}),1)):t()))}if(gL._UGCWasm_CipherAES_New=(t,e,n)=>(gL._UGCWasm_CipherAES_New=WL.e)(t,e,n),gL._UGCWasm_CipherAES_Encrypt=(t,e,n)=>(gL._UGCWasm_CipherAES_Encrypt=WL.f)(t,e,n),gL._UGCWasm_CipherAES_Decrypt=(t,e,n)=>(gL._UGCWasm_CipherAES_Decrypt=WL.g)(t,e,n),gL._malloc=t=>(gL._malloc=WL.i)(t),gL._free=t=>(gL._free=WL.j)(t),NL=function t(){VL||XL(),VL||(NL=t)},gL.preInit)for("function"==typeof gL.preInit&&(gL.preInit=[gL.preInit]);gL.preInit.length>0;)gL.preInit.pop()();XL();var JL=function(t){t=void 0!==t?t:{};var e,n,r=Object.assign({},t),i="object"==typeof window,o="function"==typeof importScripts,a="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node,s="";if(a){var c=require("fs"),l=require("path");s=o?l.dirname(s)+"/":__dirname+"/",e=(t,e)=>(t=b(t)?new URL(t):l.normalize(t),c.readFileSync(t,e?void 0:"utf8")),n=t=>{var n=e(t,!0);return n.buffer||(n=new Uint8Array(n)),n},!t.thisProgram&&process.argv.length>1&&process.argv[1].replace(/\\/g,"/"),process.argv.slice(2),"undefined"!=typeof module&&(module.exports=t),process.on("uncaughtException",(t=>{if(!("unwind"===t||t instanceof T||t.context instanceof T))throw t})),t.inspect=()=>"[Emscripten Module object]"}else(i||o)&&(o?s=self.location.href:"undefined"!=typeof document&&document.currentScript&&(s=document.currentScript.src),s=0!==s.indexOf("blob:")?s.substr(0,s.replace(/[?#].*/,"").lastIndexOf("/")+1):"",e=t=>{var e=new XMLHttpRequest;return e.open("GET",t,!1),e.send(null),e.responseText},o&&(n=t=>{var e=new XMLHttpRequest;return e.open("GET",t,!1),e.responseType="arraybuffer",e.send(null),new Uint8Array(e.response)}));t.print||console.log.bind(console);var u,h,f=t.printErr||console.error.bind(console);Object.assign(t,r),r=null,t.arguments&&t.arguments,t.thisProgram&&t.thisProgram,t.quit&&t.quit,t.wasmBinary&&(u=t.wasmBinary),"object"!=typeof WebAssembly&&I("no native wasm support detected");var d,p=!1;function A(){var e=h.buffer;t.HEAP8=new Int8Array(e),t.HEAP16=new Int16Array(e),t.HEAPU8=d=new Uint8Array(e),t.HEAPU16=new Uint16Array(e),t.HEAP32=new Int32Array(e),t.HEAPU32=new Uint32Array(e),t.HEAPF32=new Float32Array(e),t.HEAPF64=new Float64Array(e)}var g=[],m=[],y=[],v=0,C=null;function I(e){throw t.onAbort&&t.onAbort(e),f(e="Aborted("+e+")"),p=!0,e+=". Build with -sASSERTIONS for more info.",new WebAssembly.RuntimeError(e)}var x,E="data:application/octet-stream;base64,",_=t=>t.startsWith(E),b=t=>t.startsWith("file://");function w(t){if(t==x&&u)return new Uint8Array(u);var e=function(t){if(_(t))return function(t){if(void 0!==a&&a){var e=Buffer.from(t,"base64");return new Uint8Array(e.buffer,e.byteOffset,e.length)}for(var n=atob(t),r=new Uint8Array(n.length),i=0;i<n.length;++i)r[i]=n.charCodeAt(i);return r}(t.slice(37))}(t);if(e)return e;if(n)return n(t);throw"both async and sync fetching of the wasm failed"}function M(t,e,n){return function(t){return Promise.resolve().then((()=>w(t)))}(t).then((t=>WebAssembly.instantiate(t,e))).then((t=>t)).then(n,(t=>{f(`failed to asynchronously prepare wasm: ${t}`),I(t)}))}function T(t){this.name="ExitStatus",this.message=`Program terminated with exit(${t})`,this.status=t}_(x="data:application/octet-stream;base64,AGFzbQEAAAABLghgAX8Bf2AAAGADf39/AGADf39/AX9gAX8AYAR/f39/AGACf38AYAV/f39/fwACEwMBYQFhAAEBYQFiAAABYQFjAAIDDw4EAAACAQIFBgcABAMDAwQFAXABAQEFBwEBgAKAgAIGCAF/AUGQlwQLByUJAWQCAAFlAAcBZgAQAWcADwFoAA4BaQANAWoBAAFrAAwBbAADCuvpAQ7SCwEHfwJAIABFDQAgAEEIayICIABBBGsoAgAiAUF4cSIAaiEFAkAgAUEBcQ0AIAFBA3FFDQEgAiACKAIAIgFrIgJBqBMoAgBJDQEgACABaiEAAkACQEGsEygCACACRwRAIAFB/wFNBEAgAUEDdiEEIAIoAgwiASACKAIIIgNGBEBBmBNBmBMoAgBBfiAEd3E2AgAMBQsgAyABNgIMIAEgAzYCCAwECyACKAIYIQYgAiACKAIMIgFHBEAgAigCCCIDIAE2AgwgASADNgIIDAMLIAJBFGoiBCgCACIDRQRAIAIoAhAiA0UNAiACQRBqIQQLA0AgBCEHIAMiAUEUaiIEKAIAIgMNACABQRBqIQQgASgCECIDDQALIAdBADYCAAwCCyAFKAIEIgFBA3FBA0cNAkGgEyAANgIAIAUgAUF+cTYCBCACIABBAXI2AgQgBSAANgIADwtBACEBCyAGRQ0AAkAgAigCHCIDQQJ0QcgVaiIEKAIAIAJGBEAgBCABNgIAIAENAUGcE0GcEygCAEF+IAN3cTYCAAwCCyAGQRBBFCAGKAIQIAJGG2ogATYCACABRQ0BCyABIAY2AhggAigCECIDBEAgASADNgIQIAMgATYCGAsgAigCFCIDRQ0AIAEgAzYCFCADIAE2AhgLIAIgBU8NACAFKAIEIgFBAXFFDQACQAJAAkACQCABQQJxRQRAQbATKAIAIAVGBEBBsBMgAjYCAEGkE0GkEygCACAAaiIANgIAIAIgAEEBcjYCBCACQawTKAIARw0GQaATQQA2AgBBrBNBADYCAA8LQawTKAIAIAVGBEBBrBMgAjYCAEGgE0GgEygCACAAaiIANgIAIAIgAEEBcjYCBCAAIAJqIAA2AgAPCyABQXhxIABqIQAgAUH/AU0EQCABQQN2IQQgBSgCDCIBIAUoAggiA0YEQEGYE0GYEygCAEF+IAR3cTYCAAwFCyADIAE2AgwgASADNgIIDAQLIAUoAhghBiAFIAUoAgwiAUcEQEGoEygCABogBSgCCCIDIAE2AgwgASADNgIIDAMLIAVBFGoiBCgCACIDRQRAIAUoAhAiA0UNAiAFQRBqIQQLA0AgBCEHIAMiAUEUaiIEKAIAIgMNACABQRBqIQQgASgCECIDDQALIAdBADYCAAwCCyAFIAFBfnE2AgQgAiAAQQFyNgIEIAAgAmogADYCAAwDC0EAIQELIAZFDQACQCAFKAIcIgNBAnRByBVqIgQoAgAgBUYEQCAEIAE2AgAgAQ0BQZwTQZwTKAIAQX4gA3dxNgIADAILIAZBEEEUIAYoAhAgBUYbaiABNgIAIAFFDQELIAEgBjYCGCAFKAIQIgMEQCABIAM2AhAgAyABNgIYCyAFKAIUIgNFDQAgASADNgIUIAMgATYCGAsgAiAAQQFyNgIEIAAgAmogADYCACACQawTKAIARw0AQaATIAA2AgAPCyAAQf8BTQRAIABBeHFBwBNqIQECf0GYEygCACIDQQEgAEEDdnQiAHFFBEBBmBMgACADcjYCACABDAELIAEoAggLIQAgASACNgIIIAAgAjYCDCACIAE2AgwgAiAANgIIDwtBHyEDIABB////B00EQCAAQSYgAEEIdmciAWt2QQFxIAFBAXRrQT5qIQMLIAIgAzYCHCACQgA3AhAgA0ECdEHIFWohAQJAAkACQEGcEygCACIEQQEgA3QiB3FFBEBBnBMgBCAHcjYCACABIAI2AgAgAiABNgIYDAELIABBGSADQQF2a0EAIANBH0cbdCEDIAEoAgAhAQNAIAEiBCgCBEF4cSAARg0CIANBHXYhASADQQF0IQMgBCABQQRxaiIHQRBqKAIAIgENAAsgByACNgIQIAIgBDYCGAsgAiACNgIMIAIgAjYCCAwBCyAEKAIIIgAgAjYCDCAEIAI2AgggAkEANgIYIAIgBDYCDCACIAA2AggLQbgTQbgTKAIAQQFrIgBBfyAAGzYCAAsLTwECf0GQEygCACIBIABBB2pBeHEiAmohAAJAIAJBACAAIAFNGw0AIAA/AEEQdEsEQCAAEAFFDQELQZATIAA2AgAgAQ8LQZQTQTA2AgBBfws1AQF/QQEgACAAQQFNGyEAAkADQCAAEAwiAQ0BQYgXKAIAIgEEQCABEQEADAELCxAAAAsgAQuOTwEBfyMAQTBrIgMgADYCLCADIAE2AiggAyACNgIkIAMgAygCLDYCICADIAMoAigiAC0AAEEYdCAALQABQRB0ciAALQACQQh0ciAALQADcjYCHCADIAMoAigtAAcgAygCKC0ABEEYdCADKAIoLQAFQRB0ciADKAIoLQAGQQh0cnI2AhggAyADKAIoLQALIAMoAigtAAhBGHQgAygCKC0ACUEQdHIgAygCKC0ACkEIdHJyNgIUIAMgAygCKC0ADyADKAIoLQAMQRh0IAMoAigtAA1BEHRyIAMoAigtAA5BCHRycjYCECADIAMoAiAoAgAgAygCECADKAIYIAMoAhRzc3M2AgwgAyADKAIMQf8BcUECdEGACmooAgAiAEEIdCAAQRh2cjYCCCADIAMoAgxBCHY2AgwgAyADKAIIIAMoAhxzNgIcIAMgAygCDEH/AXFBAnRBgApqKAIAQRB0IAMoAgxB/wFxQQJ0QYAKaigCAEEQdnI2AgggAyADKAIMQQh2NgIMIAMgAygCCCADKAIcczYCHCADIAMoAgxB/wFxQQJ0QYAKaigCAEEYdCADKAIMQf8BcUECdEGACmooAgBBCHZyNgIIIAMgAygCDEEIdjYCDCADIAMoAgggAygCHHM2AhwgAyADKAIMQQJ0QYAKaigCADYCBCADIAMoAhwgAygCBHM2AgwgAyADKAIgKAIEIAMoAgwgAygCFCADKAIQc3NzNgIcIAMgAygCHEH/AXFBAnRBgApqKAIAIgBBCHQgAEEYdnI2AgggAyADKAIcQQh2NgIcIAMgAygCCCADKAIYczYCGCADIAMoAhxB/wFxQQJ0QYAKaigCAEEQdCADKAIcQf8BcUECdEGACmooAgBBEHZyNgIIIAMgAygCHEEIdjYCHCADIAMoAgggAygCGHM2AhggAyADKAIcQf8BcUECdEGACmooAgBBGHQgAygCHEH/AXFBAnRBgApqKAIAQQh2cjYCCCADIAMoAhxBCHY2AhwgAyADKAIIIAMoAhhzNgIYIAMgAygCHEECdEGACmooAgA2AgQgAyADKAIYIAMoAgRzNgIcIAMgAygCICgCCCADKAIcIAMoAhAgAygCDHNzczYCGCADIAMoAhhB/wFxQQJ0QYAKaigCACIAQQh0IABBGHZyNgIIIAMgAygCGEEIdjYCGCADIAMoAgggAygCFHM2AhQgAyADKAIYQf8BcUECdEGACmooAgBBEHQgAygCGEH/AXFBAnRBgApqKAIAQRB2cjYCCCADIAMoAhhBCHY2AhggAyADKAIIIAMoAhRzNgIUIAMgAygCGEH/AXFBAnRBgApqKAIAQRh0IAMoAhhB/wFxQQJ0QYAKaigCAEEIdnI2AgggAyADKAIYQQh2NgIYIAMgAygCCCADKAIUczYCFCADIAMoAhhBAnRBgApqKAIANgIEIAMgAygCFCADKAIEczYCGCADIAMoAiAoAgwgAygCGCADKAIMIAMoAhxzc3M2AhQgAyADKAIUQf8BcUECdEGACmooAgAiAEEIdCAAQRh2cjYCCCADIAMoAhRBCHY2AhQgAyADKAIIIAMoAhBzNgIQIAMgAygCFEH/AXFBAnRBgApqKAIAQRB0IAMoAhRB/wFxQQJ0QYAKaigCAEEQdnI2AgggAyADKAIUQQh2NgIUIAMgAygCCCADKAIQczYCECADIAMoAhRB/wFxQQJ0QYAKaigCAEEYdCADKAIUQf8BcUECdEGACmooAgBBCHZyNgIIIAMgAygCFEEIdjYCFCADIAMoAgggAygCEHM2AhAgAyADKAIUQQJ0QYAKaigCADYCBCADIAMoAhAgAygCBHM2AhQgAyADKAIgKAIQIAMoAhQgAygCHCADKAIYc3NzNgIQIAMgAygCEEH/AXFBAnRBgApqKAIAIgBBCHQgAEEYdnI2AgggAyADKAIQQQh2NgIQIAMgAygCCCADKAIMczYCDCADIAMoAhBB/wFxQQJ0QYAKaigCAEEQdCADKAIQQf8BcUECdEGACmooAgBBEHZyNgIIIAMgAygCEEEIdjYCECADIAMoAgggAygCDHM2AgwgAyADKAIQQf8BcUECdEGACmooAgBBGHQgAygCEEH/AXFBAnRBgApqKAIAQQh2cjYCCCADIAMoAhBBCHY2AhAgAyADKAIIIAMoAgxzNgIMIAMgAygCEEECdEGACmooAgA2AgQgAyADKAIMIAMoAgRzNgIQIAMgAygCICgCFCADKAIQIAMoAhggAygCFHNzczYCDCADIAMoAgxB/wFxQQJ0QYAKaigCAEEIdCADKAIMQf8BcUECdEGACmooAgBBGHZyNgIIIAMgAygCDEEIdjYCDCADIAMoAgggAygCHHM2AhwgAyADKAIMQf8BcUECdEGACmooAgBBEHQgAygCDEH/AXFBAnRBgApqKAIAQRB2cjYCCCADIAMoAgxBCHY2AgwgAyADKAIIIAMoAhxzNgIcIAMgAygCDEH/AXFBAnRBgApqKAIAQRh0IAMoAgxB/wFxQQJ0QYAKaigCAEEIdnI2AgggAyADKAIMQQh2NgIMIAMgAygCCCADKAIcczYCHCADIAMoAgxBAnRBgApqKAIANgIEIAMgAygCHCADKAIEczYCDCADIAMoAiAoAhggAygCDCADKAIUIAMoAhBzc3M2AhwgAyADKAIcQf8BcUECdEGACmooAgBBCHQgAygCHEH/AXFBAnRBgApqKAIAQRh2cjYCCCADIAMoAhxBCHY2AhwgAyADKAIIIAMoAhhzNgIYIAMgAygCHEH/AXFBAnRBgApqKAIAQRB0IAMoAhxB/wFxQQJ0QYAKaigCAEEQdnI2AgggAyADKAIcQQh2NgIcIAMgAygCCCADKAIYczYCGCADIAMoAhxB/wFxQQJ0QYAKaigCAEEYdCADKAIcQf8BcUECdEGACmooAgBBCHZyNgIIIAMgAygCHEEIdjYCHCADIAMoAgggAygCGHM2AhggAyADKAIcQQJ0QYAKaigCADYCBCADIAMoAhggAygCBHM2AhwgAyADKAIgKAIcIAMoAhwgAygCECADKAIMc3NzNgIYIAMgAygCGEH/AXFBAnRBgApqKAIAQQh0IAMoAhhB/wFxQQJ0QYAKaigCAEEYdnI2AgggAyADKAIYQQh2NgIYIAMgAygCCCADKAIUczYCFCADIAMoAhhB/wFxQQJ0QYAKaigCAEEQdCADKAIYQf8BcUECdEGACmooAgBBEHZyNgIIIAMgAygCGEEIdjYCGCADIAMoAgggAygCFHM2AhQgAyADKAIYQf8BcUECdEGACmooAgBBGHQgAygCGEH/AXFBAnRBgApqKAIAQQh2cjYCCCADIAMoAhhBCHY2AhggAyADKAIIIAMoAhRzNgIUIAMgAygCGEECdEGACmooAgA2AgQgAyADKAIUIAMoAgRzNgIYIAMgAygCICgCICADKAIYIAMoAgwgAygCHHNzczYCFCADIAMoAhRB/wFxQQJ0QYAKaigCAEEIdCADKAIUQf8BcUECdEGACmooAgBBGHZyNgIIIAMgAygCFEEIdjYCFCADIAMoAgggAygCEHM2AhAgAyADKAIUQf8BcUECdEGACmooAgBBEHQgAygCFEH/AXFBAnRBgApqKAIAQRB2cjYCCCADIAMoAhRBCHY2AhQgAyADKAIIIAMoAhBzNgIQIAMgAygCFEH/AXFBAnRBgApqKAIAQRh0IAMoAhRB/wFxQQJ0QYAKaigCAEEIdnI2AgggAyADKAIUQQh2NgIUIAMgAygCCCADKAIQczYCECADIAMoAhRBAnRBgApqKAIANgIEIAMgAygCECADKAIEczYCFCADIAMoAiAoAiQgAygCFCADKAIcIAMoAhhzc3M2AhAgAyADKAIQQf8BcUECdEGACmooAgBBCHQgAygCEEH/AXFBAnRBgApqKAIAQRh2cjYCCCADIAMoAhBBCHY2AhAgAyADKAIIIAMoAgxzNgIMIAMgAygCEEH/AXFBAnRBgApqKAIAQRB0IAMoAhBB/wFxQQJ0QYAKaigCAEEQdnI2AgggAyADKAIQQQh2NgIQIAMgAygCCCADKAIMczYCDCADIAMoAhBB/wFxQQJ0QYAKaigCAEEYdCADKAIQQf8BcUECdEGACmooAgBBCHZyNgIIIAMgAygCEEEIdjYCECADIAMoAgggAygCDHM2AgwgAyADKAIQQQJ0QYAKaigCADYCBCADIAMoAgwgAygCBHM2AhAgAyADKAIgKAIoIAMoAhAgAygCGCADKAIUc3NzNgIMIAMgAygCDEH/AXFBAnRBgApqKAIAQQh0IAMoAgxB/wFxQQJ0QYAKaigCAEEYdnI2AgggAyADKAIMQQh2NgIMIAMgAygCCCADKAIcczYCHCADIAMoAgxB/wFxQQJ0QYAKaigCAEEQdCADKAIMQf8BcUECdEGACmooAgBBEHZyNgIIIAMgAygCDEEIdjYCDCADIAMoAgggAygCHHM2AhwgAyADKAIMQf8BcUECdEGACmooAgBBGHQgAygCDEH/AXFBAnRBgApqKAIAQQh2cjYCCCADIAMoAgxBCHY2AgwgAyADKAIIIAMoAhxzNgIcIAMgAygCDEECdEGACmooAgA2AgQgAyADKAIcIAMoAgRzNgIMIAMgAygCICgCLCADKAIMIAMoAhQgAygCEHNzczYCHCADIAMoAhxB/wFxQQJ0QYAKaigCAEEIdCADKAIcQf8BcUECdEGACmooAgBBGHZyNgIIIAMgAygCHEEIdjYCHCADIAMoAgggAygCGHM2AhggAyADKAIcQf8BcUECdEGACmooAgBBEHQgAygCHEH/AXFBAnRBgApqKAIAQRB2cjYCCCADIAMoAhxBCHY2AhwgAyADKAIIIAMoAhhzNgIYIAMgAygCHEH/AXFBAnRBgApqKAIAQRh0IAMoAhxB/wFxQQJ0QYAKaigCAEEIdnI2AgggAyADKAIcQQh2NgIcIAMgAygCCCADKAIYczYCGCADIAMoAhxBAnRBgApqKAIANgIEIAMgAygCGCADKAIEczYCHCADIAMoAiAoAjAgAygCHCADKAIQIAMoAgxzc3M2AhggAyADKAIYQf8BcUECdEGACmooAgBBCHQgAygCGEH/AXFBAnRBgApqKAIAQRh2cjYCCCADIAMoAhhBCHY2AhggAyADKAIIIAMoAhRzNgIUIAMgAygCGEH/AXFBAnRBgApqKAIAQRB0IAMoAhhB/wFxQQJ0QYAKaigCAEEQdnI2AgggAyADKAIYQQh2NgIYIAMgAygCCCADKAIUczYCFCADIAMoAhhB/wFxQQJ0QYAKaigCAEEYdCADKAIYQf8BcUECdEGACmooAgBBCHZyNgIIIAMgAygCGEEIdjYCGCADIAMoAgggAygCFHM2AhQgAyADKAIYQQJ0QYAKaigCADYCBCADIAMoAhQgAygCBHM2AhggAyADKAIgKAI0IAMoAhggAygCDCADKAIcc3NzNgIUIAMgAygCFEH/AXFBAnRBgApqKAIAQQh0IAMoAhRB/wFxQQJ0QYAKaigCAEEYdnI2AgggAyADKAIUQQh2NgIUIAMgAygCCCADKAIQczYCECADIAMoAhRB/wFxQQJ0QYAKaigCAEEQdCADKAIUQf8BcUECdEGACmooAgBBEHZyNgIIIAMgAygCFEEIdjYCFCADIAMoAgggAygCEHM2AhAgAyADKAIUQf8BcUECdEGACmooAgBBGHQgAygCFEH/AXFBAnRBgApqKAIAQQh2cjYCCCADIAMoAhRBCHY2AhQgAyADKAIIIAMoAhBzNgIQIAMgAygCFEECdEGACmooAgA2AgQgAyADKAIQIAMoAgRzNgIUIAMgAygCICgCOCADKAIUIAMoAhwgAygCGHNzczYCECADIAMoAhBB/wFxQQJ0QYAKaigCAEEIdCADKAIQQf8BcUECdEGACmooAgBBGHZyNgIIIAMgAygCEEEIdjYCECADIAMoAgggAygCDHM2AgwgAyADKAIQQf8BcUECdEGACmooAgBBEHQgAygCEEH/AXFBAnRBgApqKAIAQRB2cjYCCCADIAMoAhBBCHY2AhAgAyADKAIIIAMoAgxzNgIMIAMgAygCEEH/AXFBAnRBgApqKAIAQRh0IAMoAhBB/wFxQQJ0QYAKaigCAEEIdnI2AgggAyADKAIQQQh2NgIQIAMgAygCCCADKAIMczYCDCADIAMoAhBBAnRBgApqKAIANgIEIAMgAygCDCADKAIEczYCECADIAMoAiAoAjwgAygCECADKAIYIAMoAhRzc3M2AgwgAyADKAIMQf8BcUECdEGACmooAgBBCHQgAygCDEH/AXFBAnRBgApqKAIAQRh2cjYCCCADIAMoAgxBCHY2AgwgAyADKAIIIAMoAhxzNgIcIAMgAygCDEH/AXFBAnRBgApqKAIAQRB0IAMoAgxB/wFxQQJ0QYAKaigCAEEQdnI2AgggAyADKAIMQQh2NgIMIAMgAygCCCADKAIcczYCHCADIAMoAgxB/wFxQQJ0QYAKaigCAEEYdCADKAIMQf8BcUECdEGACmooAgBBCHZyNgIIIAMgAygCDEEIdjYCDCADIAMoAgggAygCHHM2AhwgAyADKAIMQQJ0QYAKaigCADYCBCADIAMoAhwgAygCBHM2AgwgAyADKAIgKAJAIAMoAgwgAygCFCADKAIQc3NzNgIcIAMgAygCHEH/AXFBAnRBgApqKAIAQQh0IAMoAhxB/wFxQQJ0QYAKaigCAEEYdnI2AgggAyADKAIcQQh2NgIcIAMgAygCCCADKAIYczYCGCADIAMoAhxB/wFxQQJ0QYAKaigCAEEQdCADKAIcQf8BcUECdEGACmooAgBBEHZyNgIIIAMgAygCHEEIdjYCHCADIAMoAgggAygCGHM2AhggAyADKAIcQf8BcUECdEGACmooAgBBGHQgAygCHEH/AXFBAnRBgApqKAIAQQh2cjYCCCADIAMoAhxBCHY2AhwgAyADKAIIIAMoAhhzNgIYIAMgAygCHEECdEGACmooAgA2AgQgAyADKAIYIAMoAgRzNgIcIAMgAygCICgCRCADKAIcIAMoAhAgAygCDHNzczYCGCADIAMoAhhB/wFxQQJ0QYAKaigCAEEIdCADKAIYQf8BcUECdEGACmooAgBBGHZyNgIIIAMgAygCGEEIdjYCGCADIAMoAgggAygCFHM2AhQgAyADKAIYQf8BcUECdEGACmooAgBBEHQgAygCGEH/AXFBAnRBgApqKAIAQRB2cjYCCCADIAMoAhhBCHY2AhggAyADKAIIIAMoAhRzNgIUIAMgAygCGEH/AXFBAnRBgApqKAIAQRh0IAMoAhhB/wFxQQJ0QYAKaigCAEEIdnI2AgggAyADKAIYQQh2NgIYIAMgAygCCCADKAIUczYCFCADIAMoAhhBAnRBgApqKAIANgIEIAMgAygCFCADKAIEczYCGCADIAMoAiAoAkggAygCGCADKAIMIAMoAhxzc3M2AhQgAyADKAIUQf8BcUECdEGACmooAgBBCHQgAygCFEH/AXFBAnRBgApqKAIAQRh2cjYCCCADIAMoAhRBCHY2AhQgAyADKAIIIAMoAhBzNgIQIAMgAygCFEH/AXFBAnRBgApqKAIAQRB0IAMoAhRB/wFxQQJ0QYAKaigCAEEQdnI2AgggAyADKAIUQQh2NgIUIAMgAygCCCADKAIQczYCECADIAMoAhRB/wFxQQJ0QYAKaigCAEEYdCADKAIUQf8BcUECdEGACmooAgBBCHZyNgIIIAMgAygCFEEIdjYCFCADIAMoAgggAygCEHM2AhAgAyADKAIUQQJ0QYAKaigCADYCBCADIAMoAhAgAygCBHM2AhQgAyADKAIgKAJMIAMoAhQgAygCHCADKAIYc3NzNgIQIAMgAygCEEH/AXFBAnRBgApqKAIAQQh0IAMoAhBB/wFxQQJ0QYAKaigCAEEYdnI2AgggAyADKAIQQQh2NgIQIAMgAygCCCADKAIMczYCDCADIAMoAhBB/wFxQQJ0QYAKaigCAEEQdCADKAIQQf8BcUECdEGACmooAgBBEHZyNgIIIAMgAygCEEEIdjYCECADIAMoAgggAygCDHM2AgwgAyADKAIQQf8BcUECdEGACmooAgBBGHQgAygCEEH/AXFBAnRBgApqKAIAQQh2cjYCCCADIAMoAhBBCHY2AhAgAyADKAIIIAMoAgxzNgIMIAMgAygCEEECdEGACmooAgA2AgQgAyADKAIMIAMoAgRzNgIQIAMgAygCICgCUCADKAIQIAMoAhggAygCFHNzczYCDCADIAMoAgxB/wFxQQJ0QYAKaigCAEEIdCADKAIMQf8BcUECdEGACmooAgBBGHZyNgIIIAMgAygCDEEIdjYCDCADIAMoAgggAygCHHM2AhwgAyADKAIMQf8BcUECdEGACmooAgBBEHQgAygCDEH/AXFBAnRBgApqKAIAQRB2cjYCCCADIAMoAgxBCHY2AgwgAyADKAIIIAMoAhxzNgIcIAMgAygCDEH/AXFBAnRBgApqKAIAQRh0IAMoAgxB/wFxQQJ0QYAKaigCAEEIdnI2AgggAyADKAIMQQh2NgIMIAMgAygCCCADKAIcczYCHCADIAMoAgxBAnRBgApqKAIANgIEIAMgAygCHCADKAIEczYCDCADIAMoAiAoAlQgAygCDCADKAIUIAMoAhBzc3M2AhwgAyADKAIcQf8BcUECdEGACmooAgBBCHQgAygCHEH/AXFBAnRBgApqKAIAQRh2cjYCCCADIAMoAhxBCHY2AhwgAyADKAIIIAMoAhhzNgIYIAMgAygCHEH/AXFBAnRBgApqKAIAQRB0IAMoAhxB/wFxQQJ0QYAKaigCAEEQdnI2AgggAyADKAIcQQh2NgIcIAMgAygCCCADKAIYczYCGCADIAMoAhxB/wFxQQJ0QYAKaigCAEEYdCADKAIcQf8BcUECdEGACmooAgBBCHZyNgIIIAMgAygCHEEIdjYCHCADIAMoAgggAygCGHM2AhggAyADKAIcQQJ0QYAKaigCADYCBCADIAMoAhggAygCBHM2AhwgAyADKAIgKAJYIAMoAhwgAygCECADKAIMc3NzNgIYIAMgAygCGEH/AXFBAnRBgApqKAIAQQh0IAMoAhhB/wFxQQJ0QYAKaigCAEEYdnI2AgggAyADKAIYQQh2NgIYIAMgAygCCCADKAIUczYCFCADIAMoAhhB/wFxQQJ0QYAKaigCAEEQdCADKAIYQf8BcUECdEGACmooAgBBEHZyNgIIIAMgAygCGEEIdjYCGCADIAMoAgggAygCFHM2AhQgAyADKAIYQf8BcUECdEGACmooAgBBGHQgAygCGEH/AXFBAnRBgApqKAIAQQh2cjYCCCADIAMoAhhBCHY2AhggAyADKAIIIAMoAhRzNgIUIAMgAygCGEECdEGACmooAgA2AgQgAyADKAIUIAMoAgRzNgIYIAMgAygCICgCXCADKAIYIAMoAgwgAygCHHNzczYCFCADIAMoAhRB/wFxQQJ0QYAKaigCAEEIdCADKAIUQf8BcUECdEGACmooAgBBGHZyNgIIIAMgAygCFEEIdjYCFCADIAMoAgggAygCEHM2AhAgAyADKAIUQf8BcUECdEGACmooAgBBEHQgAygCFEH/AXFBAnRBgApqKAIAQRB2cjYCCCADIAMoAhRBCHY2AhQgAyADKAIIIAMoAhBzNgIQIAMgAygCFEH/AXFBAnRBgApqKAIAQRh0IAMoAhRB/wFxQQJ0QYAKaigCAEEIdnI2AgggAyADKAIUQQh2NgIUIAMgAygCCCADKAIQczYCECADIAMoAhRBAnRBgApqKAIANgIEIAMgAygCECADKAIEczYCFCADIAMoAiAoAmAgAygCFCADKAIcIAMoAhhzc3M2AhAgAyADKAIQQf8BcUECdEGACmooAgBBCHQgAygCEEH/AXFBAnRBgApqKAIAQRh2cjYCCCADIAMoAhBBCHY2AhAgAyADKAIIIAMoAgxzNgIMIAMgAygCEEH/AXFBAnRBgApqKAIAQRB0IAMoAhBB/wFxQQJ0QYAKaigCAEEQdnI2AgggAyADKAIQQQh2NgIQIAMgAygCCCADKAIMczYCDCADIAMoAhBB/wFxQQJ0QYAKaigCAEEYdCADKAIQQf8BcUECdEGACmooAgBBCHZyNgIIIAMgAygCEEEIdjYCECADIAMoAgggAygCDHM2AgwgAyADKAIQQQJ0QYAKaigCADYCBCADIAMoAgwgAygCBHM2AhAgAyADKAIgKAJkIAMoAhAgAygCGCADKAIUc3NzNgIMIAMgAygCDEH/AXFBAnRBgApqKAIAQQh0IAMoAgxB/wFxQQJ0QYAKaigCAEEYdnI2AgggAyADKAIMQQh2NgIMIAMgAygCCCADKAIcczYCHCADIAMoAgxB/wFxQQJ0QYAKaigCAEEQdCADKAIMQf8BcUECdEGACmooAgBBEHZyNgIIIAMgAygCDEEIdjYCDCADIAMoAgggAygCHHM2AhwgAyADKAIMQf8BcUECdEGACmooAgBBGHQgAygCDEH/AXFBAnRBgApqKAIAQQh2cjYCCCADIAMoAgxBCHY2AgwgAyADKAIIIAMoAhxzNgIcIAMgAygCDEECdEGACmooAgA2AgQgAyADKAIcIAMoAgRzNgIMIAMgAygCICgCaCADKAIMIAMoAhQgAygCEHNzczYCHCADIAMoAhxB/wFxQQJ0QYAKaigCAEEIdCADKAIcQf8BcUECdEGACmooAgBBGHZyNgIIIAMgAygCHEEIdjYCHCADIAMoAgggAygCGHM2AhggAyADKAIcQf8BcUECdEGACmooAgBBEHQgAygCHEH/AXFBAnRBgApqKAIAQRB2cjYCCCADIAMoAhxBCHY2AhwgAyADKAIIIAMoAhhzNgIYIAMgAygCHEH/AXFBAnRBgApqKAIAQRh0IAMoAhxB/wFxQQJ0QYAKaigCAEEIdnI2AgggAyADKAIcQQh2NgIcIAMgAygCCCADKAIYczYCGCADIAMoAhxBAnRBgApqKAIANgIEIAMgAygCGCADKAIEczYCHCADIAMoAiAoAmwgAygCHCADKAIQIAMoAgxzc3M2AhggAyADKAIYQf8BcUECdEGACmooAgBBCHQgAygCGEH/AXFBAnRBgApqKAIAQRh2cjYCCCADIAMoAhhBCHY2AhggAyADKAIIIAMoAhRzNgIUIAMgAygCGEH/AXFBAnRBgApqKAIAQRB0IAMoAhhB/wFxQQJ0QYAKaigCAEEQdnI2AgggAyADKAIYQQh2NgIYIAMgAygCCCADKAIUczYCFCADIAMoAhhB/wFxQQJ0QYAKaigCAEEYdCADKAIYQf8BcUECdEGACmooAgBBCHZyNgIIIAMgAygCGEEIdjYCGCADIAMoAgggAygCFHM2AhQgAyADKAIYQQJ0QYAKaigCADYCBCADIAMoAhQgAygCBHM2AhggAyADKAIgKAJwIAMoAhggAygCDCADKAIcc3NzNgIUIAMgAygCFEH/AXFBAnRBgApqKAIAQQh0IAMoAhRB/wFxQQJ0QYAKaigCAEEYdnI2AgggAyADKAIUQQh2NgIUIAMgAygCCCADKAIQczYCECADIAMoAhRB/wFxQQJ0QYAKaigCAEEQdCADKAIUQf8BcUECdEGACmooAgBBEHZyNgIIIAMgAygCFEEIdjYCFCADIAMoAgggAygCEHM2AhAgAyADKAIUQf8BcUECdEGACmooAgBBGHQgAygCFEH/AXFBAnRBgApqKAIAQQh2cjYCCCADIAMoAhRBCHY2AhQgAyADKAIIIAMoAhBzNgIQIAMgAygCFEECdEGACmooAgA2AgQgAyADKAIQIAMoAgRzNgIUIAMgAygCICgCdCADKAIUIAMoAhwgAygCGHNzczYCECADIAMoAhBB/wFxQQJ0QYAKaigCAEEIdCADKAIQQf8BcUECdEGACmooAgBBGHZyNgIIIAMgAygCEEEIdjYCECADIAMoAgggAygCDHM2AgwgAyADKAIQQf8BcUECdEGACmooAgBBEHQgAygCEEH/AXFBAnRBgApqKAIAQRB2cjYCCCADIAMoAhBBCHY2AhAgAyADKAIIIAMoAgxzNgIMIAMgAygCEEH/AXFBAnRBgApqKAIAQRh0IAMoAhBB/wFxQQJ0QYAKaigCAEEIdnI2AgggAyADKAIQQQh2NgIQIAMgAygCCCADKAIMczYCDCADIAMoAhBBAnRBgApqKAIANgIEIAMgAygCDCADKAIEczYCECADIAMoAiAoAnggAygCECADKAIYIAMoAhRzc3M2AgwgAyADKAIMQf8BcUECdEGACmooAgBBCHQgAygCDEH/AXFBAnRBgApqKAIAQRh2cjYCCCADIAMoAgxBCHY2AgwgAyADKAIIIAMoAhxzNgIcIAMgAygCDEH/AXFBAnRBgApqKAIAQRB0IAMoAgxB/wFxQQJ0QYAKaigCAEEQdnI2AgggAyADKAIMQQh2NgIMIAMgAygCCCADKAIcczYCHCADIAMoAgxB/wFxQQJ0QYAKaigCAEEYdCADKAIMQf8BcUECdEGACmooAgBBCHZyNgIIIAMgAygCDEEIdjYCDCADIAMoAgggAygCHHM2AhwgAyADKAIMQQJ0QYAKaigCADYCBCADIAMoAhwgAygCBHM2AgwgAyADKAIgKAJ8IAMoAgwgAygCFCADKAIQc3NzNgIcIAMgAygCHEH/AXFBAnRBgApqKAIAQQh0IAMoAhxB/wFxQQJ0QYAKaigCAEEYdnI2AgggAyADKAIcQQh2NgIcIAMgAygCCCADKAIYczYCGCADIAMoAhxB/wFxQQJ0QYAKaigCAEEQdCADKAIcQf8BcUECdEGACmooAgBBEHZyNgIIIAMgAygCHEEIdjYCHCADIAMoAgggAygCGHM2AhggAyADKAIcQf8BcUECdEGACmooAgBBGHQgAygCHEH/AXFBAnRBgApqKAIAQQh2cjYCCCADIAMoAhxBCHY2AhwgAyADKAIIIAMoAhhzNgIYIAMgAygCHEECdEGACmooAgA2AgQgAyADKAIYIAMoAgRzNgIcIAMoAiQgAygCHEEYdjoAACADKAIkIAMoAhxBEHY6AAEgAygCJCADKAIcQQh2OgACIAMoAiQgAygCHDoAAyADKAIkIAMoAgxBGHY6AAQgAygCJCADKAIMQRB2OgAFIAMoAiQgAygCDEEIdjoABiADKAIkIAMoAgw6AAcgAygCJCADKAIQQRh2OgAIIAMoAiQgAygCEEEQdjoACSADKAIkIAMoAhBBCHY6AAogAygCJCADKAIQOgALIAMoAiQgAygCFEEYdjoADCADKAIkIAMoAhRBEHY6AA0gAygCJCADKAIUQQh2OgAOIAMoAiQgAygCFDoADwsCAAv8AwECfyACQYAETwRAIAAgASACEAIPCyAAIAJqIQMCQCAAIAFzQQNxRQRAAkAgAEEDcUUEQCAAIQIMAQsgAkUEQCAAIQIMAQsgACECA0AgAiABLQAAOgAAIAFBAWohASACQQFqIgJBA3FFDQEgAiADSQ0ACwsCQCADQXxxIgBBwABJDQAgAiAAQUBqIgRLDQADQCACIAEoAgA2AgAgAiABKAIENgIEIAIgASgCCDYCCCACIAEoAgw2AgwgAiABKAIQNgIQIAIgASgCFDYCFCACIAEoAhg2AhggAiABKAIcNgIcIAIgASgCIDYCICACIAEoAiQ2AiQgAiABKAIoNgIoIAIgASgCLDYCLCACIAEoAjA2AjAgAiABKAI0NgI0IAIgASgCODYCOCACIAEoAjw2AjwgAUFAayEBIAJBQGsiAiAETQ0ACwsgACACTQ0BA0AgAiABKAIANgIAIAFBBGohASACQQRqIgIgAEkNAAsMAQsgA0EESQRAIAAhAgwBCyAAIANBBGsiBEsEQCAAIQIMAQsgACECA0AgAiABLQAAOgAAIAIgAS0AAToAASACIAEtAAI6AAIgAiABLQADOgADIAFBBGohASACQQRqIgIgBE0NAAsLIAIgA0kEQANAIAIgAS0AADoAACABQQFqIQEgAkEBaiICIANHDQALCwuPAQEBfyMAQSBrIgQgADYCHCAEIAE2AhggBCACNgIUIAQgAzYCECAEIAQoAhw2AgwgBCAEKAIYNgIIIAQgBCgCFDYCBCAEQQA2AgADQCAEKAIAIgAgBCgCEE9FBEAgACAEKAIMaiAAIAQoAghqLQAAIAAgBCgCBGotAABzOgAAIAQgBCgCAEEBajYCAAwBCwsLkSwBAX8jAEEgayICIAA2AhwgAiABNgIYIAIgAigCHDYCFCACQYASKAIAIAIoAhgiAC0AAEEYdCAALQABQRB0ciAALQACQQh0ciAALQADcnM2AhAgAkGEEigCACACKAIYLQAHIAIoAhgtAARBGHQgAigCGC0ABUEQdHIgAigCGC0ABkEIdHJyczYCDCACQYgSKAIAIAIoAhgtAAsgAigCGC0ACEEYdCACKAIYLQAJQRB0ciACKAIYLQAKQQh0cnJzNgIIIAJBjBIoAgAgAigCGC0ADyACKAIYLQAMQRh0IAIoAhgtAA1BEHRyIAIoAhgtAA5BCHRycnM2AgQgAkGQEigCACACKAIEIAIoAgwgAigCCHNzczYCACACIAIoAgAiAEEYdi0AgAhBGHQgAEEQdkH/AXEtAIAIQRB0cyAAQQh2Qf8BcS0AgAhBCHRzIABB/wFxLQCACHM2AgAgAiACKAIQIAIoAgAgAigCAEENdCACKAIAIgBBE3ZycyACKAIAQRd0IABBCXZyc3M2AgAgAigCFCACKAIANgIAIAJBlBIoAgAgAigCACACKAIIIAIoAgRzc3M2AhAgAiACKAIQQf8BcS0AgAggAigCEEEYdi0AgAhBGHQgAigCEEEQdkH/AXEtAIAIQRB0cyACKAIQQQh2Qf8BcS0AgAhBCHRzczYCECACIAIoAgwgAigCECACKAIQQQ10IAIoAhAiAEETdnJzIAIoAhBBF3QgAEEJdnJzczYCECACKAIUIAIoAhA2AgQgAkGYEigCACACKAIQIAIoAgQgAigCAHNzczYCDCACIAIoAgxB/wFxLQCACCACKAIMQRh2LQCACEEYdCACKAIMQRB2Qf8BcS0AgAhBEHRzIAIoAgxBCHZB/wFxLQCACEEIdHNzNgIMIAIgAigCCCACKAIMIAIoAgxBDXQgAigCDCIAQRN2cnMgAigCDEEXdCAAQQl2cnNzNgIMIAIoAhQgAigCDDYCCCACQZwSKAIAIAIoAgwgAigCACACKAIQc3NzNgIIIAIgAigCCEH/AXEtAIAIIAIoAghBGHYtAIAIQRh0IAIoAghBEHZB/wFxLQCACEEQdHMgAigCCEEIdkH/AXEtAIAIQQh0c3M2AgggAiACKAIEIAIoAgggAigCCEENdCACKAIIIgBBE3ZycyACKAIIQRd0IABBCXZyc3M2AgggAigCFCACKAIINgIMIAJBoBIoAgAgAigCCCACKAIQIAIoAgxzc3M2AgQgAiACKAIEQf8BcS0AgAggAigCBEEYdi0AgAhBGHQgAigCBEEQdkH/AXEtAIAIQRB0cyACKAIEQQh2Qf8BcS0AgAhBCHRzczYCBCACIAIoAgAgAigCBCACKAIEQQ10IAIoAgQiAEETdnJzIAIoAgRBF3QgAEEJdnJzczYCBCACKAIUIAIoAgQ2AhAgAkGkEigCACACKAIEIAIoAgwgAigCCHNzczYCACACIAIoAgBB/wFxLQCACCACKAIAQRh2LQCACEEYdCACKAIAQRB2Qf8BcS0AgAhBEHRzIAIoAgBBCHZB/wFxLQCACEEIdHNzNgIAIAIgAigCECACKAIAQRd0IAIoAgBBCXZyIAIoAgAgAigCAEENdCACKAIAQRN2cnNzczYCACACKAIUIAIoAgA2AhQgAkGoEigCACACKAIAIAIoAgggAigCBHNzczYCECACIAIoAhBB/wFxLQCACCACKAIQQRh2LQCACEEYdCACKAIQQRB2Qf8BcS0AgAhBEHRzIAIoAhBBCHZB/wFxLQCACEEIdHNzNgIQIAIgAigCDCACKAIQQRd0IAIoAhBBCXZyIAIoAhAgAigCEEENdCACKAIQQRN2cnNzczYCECACKAIUIAIoAhA2AhggAkGsEigCACACKAIQIAIoAgQgAigCAHNzczYCDCACIAIoAgxB/wFxLQCACCACKAIMQRh2LQCACEEYdCACKAIMQRB2Qf8BcS0AgAhBEHRzIAIoAgxBCHZB/wFxLQCACEEIdHNzNgIMIAIgAigCCCACKAIMQRd0IAIoAgxBCXZyIAIoAgwgAigCDEENdCACKAIMQRN2cnNzczYCDCACKAIUIAIoAgw2AhwgAkGwEigCACACKAIMIAIoAgAgAigCEHNzczYCCCACIAIoAghB/wFxLQCACCACKAIIQRh2LQCACEEYdCACKAIIQRB2Qf8BcS0AgAhBEHRzIAIoAghBCHZB/wFxLQCACEEIdHNzNgIIIAIgAigCBCACKAIIQRd0IAIoAghBCXZyIAIoAgggAigCCEENdCACKAIIQRN2cnNzczYCCCACKAIUIAIoAgg2AiAgAkG0EigCACACKAIIIAIoAhAgAigCDHNzczYCBCACIAIoAgRB/wFxLQCACCACKAIEQRh2LQCACEEYdCACKAIEQRB2Qf8BcS0AgAhBEHRzIAIoAgRBCHZB/wFxLQCACEEIdHNzNgIEIAIgAigCACACKAIEQRd0IAIoAgRBCXZyIAIoAgQgAigCBEENdCACKAIEQRN2cnNzczYCBCACKAIUIAIoAgQ2AiQgAkG4EigCACACKAIEIAIoAgwgAigCCHNzczYCACACIAIoAgBB/wFxLQCACCACKAIAQRh2LQCACEEYdCACKAIAQRB2Qf8BcS0AgAhBEHRzIAIoAgBBCHZB/wFxLQCACEEIdHNzNgIAIAIgAigCECACKAIAQRd0IAIoAgBBCXZyIAIoAgAgAigCAEENdCACKAIAQRN2cnNzczYCACACKAIUIAIoAgA2AiggAkG8EigCACACKAIAIAIoAgggAigCBHNzczYCECACIAIoAhBB/wFxLQCACCACKAIQQRh2LQCACEEYdCACKAIQQRB2Qf8BcS0AgAhBEHRzIAIoAhBBCHZB/wFxLQCACEEIdHNzNgIQIAIgAigCDCACKAIQQRd0IAIoAhBBCXZyIAIoAhAgAigCEEENdCACKAIQQRN2cnNzczYCECACKAIUIAIoAhA2AiwgAkHAEigCACACKAIQIAIoAgQgAigCAHNzczYCDCACIAIoAgxB/wFxLQCACCACKAIMQRh2LQCACEEYdCACKAIMQRB2Qf8BcS0AgAhBEHRzIAIoAgxBCHZB/wFxLQCACEEIdHNzNgIMIAIgAigCCCACKAIMQRd0IAIoAgxBCXZyIAIoAgwgAigCDEENdCACKAIMQRN2cnNzczYCDCACKAIUIAIoAgw2AjAgAkHEEigCACACKAIMIAIoAgAgAigCEHNzczYCCCACIAIoAghB/wFxLQCACCACKAIIQRh2LQCACEEYdCACKAIIQRB2Qf8BcS0AgAhBEHRzIAIoAghBCHZB/wFxLQCACEEIdHNzNgIIIAIgAigCBCACKAIIQRd0IAIoAghBCXZyIAIoAgggAigCCEENdCACKAIIQRN2cnNzczYCCCACKAIUIAIoAgg2AjQgAkHIEigCACACKAIIIAIoAhAgAigCDHNzczYCBCACIAIoAgRB/wFxLQCACCACKAIEQRh2LQCACEEYdCACKAIEQRB2Qf8BcS0AgAhBEHRzIAIoAgRBCHZB/wFxLQCACEEIdHNzNgIEIAIgAigCACACKAIEQRd0IAIoAgRBCXZyIAIoAgQgAigCBEENdCACKAIEQRN2cnNzczYCBCACKAIUIAIoAgQ2AjggAkHMEigCACACKAIEIAIoAgwgAigCCHNzczYCACACIAIoAgBB/wFxLQCACCACKAIAQRh2LQCACEEYdCACKAIAQRB2Qf8BcS0AgAhBEHRzIAIoAgBBCHZB/wFxLQCACEEIdHNzNgIAIAIgAigCECACKAIAQRd0IAIoAgBBCXZyIAIoAgAgAigCAEENdCACKAIAQRN2cnNzczYCACACKAIUIAIoAgA2AjwgAkHQEigCACACKAIAIAIoAgggAigCBHNzczYCECACIAIoAhBB/wFxLQCACCACKAIQQRh2LQCACEEYdCACKAIQQRB2Qf8BcS0AgAhBEHRzIAIoAhBBCHZB/wFxLQCACEEIdHNzNgIQIAIgAigCDCACKAIQQRd0IAIoAhBBCXZyIAIoAhAgAigCEEENdCACKAIQQRN2cnNzczYCECACKAIUIAIoAhA2AkAgAkHUEigCACACKAIQIAIoAgQgAigCAHNzczYCDCACIAIoAgxB/wFxLQCACCACKAIMQRh2LQCACEEYdCACKAIMQRB2Qf8BcS0AgAhBEHRzIAIoAgxBCHZB/wFxLQCACEEIdHNzNgIMIAIgAigCCCACKAIMQRd0IAIoAgxBCXZyIAIoAgwgAigCDEENdCACKAIMQRN2cnNzczYCDCACKAIUIAIoAgw2AkQgAkHYEigCACACKAIMIAIoAgAgAigCEHNzczYCCCACIAIoAghB/wFxLQCACCACKAIIQRh2LQCACEEYdCACKAIIQRB2Qf8BcS0AgAhBEHRzIAIoAghBCHZB/wFxLQCACEEIdHNzNgIIIAIgAigCBCACKAIIQRd0IAIoAghBCXZyIAIoAgggAigCCEENdCACKAIIQRN2cnNzczYCCCACKAIUIAIoAgg2AkggAkHcEigCACACKAIIIAIoAhAgAigCDHNzczYCBCACIAIoAgRB/wFxLQCACCACKAIEQRh2LQCACEEYdCACKAIEQRB2Qf8BcS0AgAhBEHRzIAIoAgRBCHZB/wFxLQCACEEIdHNzNgIEIAIgAigCACACKAIEQRd0IAIoAgRBCXZyIAIoAgQgAigCBEENdCACKAIEQRN2cnNzczYCBCACKAIUIAIoAgQ2AkwgAkHgEigCACACKAIEIAIoAgwgAigCCHNzczYCACACIAIoAgBB/wFxLQCACCACKAIAQRh2LQCACEEYdCACKAIAQRB2Qf8BcS0AgAhBEHRzIAIoAgBBCHZB/wFxLQCACEEIdHNzNgIAIAIgAigCECACKAIAQRd0IAIoAgBBCXZyIAIoAgAgAigCAEENdCACKAIAQRN2cnNzczYCACACKAIUIAIoAgA2AlAgAkHkEigCACACKAIAIAIoAgggAigCBHNzczYCECACIAIoAhBB/wFxLQCACCACKAIQQRh2LQCACEEYdCACKAIQQRB2Qf8BcS0AgAhBEHRzIAIoAhBBCHZB/wFxLQCACEEIdHNzNgIQIAIgAigCDCACKAIQQRd0IAIoAhBBCXZyIAIoAhAgAigCEEENdCACKAIQQRN2cnNzczYCECACKAIUIAIoAhA2AlQgAkHoEigCACACKAIQIAIoAgQgAigCAHNzczYCDCACIAIoAgxB/wFxLQCACCACKAIMQRh2LQCACEEYdCACKAIMQRB2Qf8BcS0AgAhBEHRzIAIoAgxBCHZB/wFxLQCACEEIdHNzNgIMIAIgAigCCCACKAIMQRd0IAIoAgxBCXZyIAIoAgwgAigCDEENdCACKAIMQRN2cnNzczYCDCACKAIUIAIoAgw2AlggAkHsEigCACACKAIMIAIoAgAgAigCEHNzczYCCCACIAIoAghB/wFxLQCACCACKAIIQRh2LQCACEEYdCACKAIIQRB2Qf8BcS0AgAhBEHRzIAIoAghBCHZB/wFxLQCACEEIdHNzNgIIIAIgAigCBCACKAIIQRd0IAIoAghBCXZyIAIoAgggAigCCEENdCACKAIIQRN2cnNzczYCCCACKAIUIAIoAgg2AlwgAkHwEigCACACKAIIIAIoAhAgAigCDHNzczYCBCACIAIoAgRB/wFxLQCACCACKAIEQRh2LQCACEEYdCACKAIEQRB2Qf8BcS0AgAhBEHRzIAIoAgRBCHZB/wFxLQCACEEIdHNzNgIEIAIgAigCACACKAIEQRd0IAIoAgRBCXZyIAIoAgQgAigCBEENdCACKAIEQRN2cnNzczYCBCACKAIUIAIoAgQ2AmAgAkH0EigCACACKAIEIAIoAgwgAigCCHNzczYCACACIAIoAgBB/wFxLQCACCACKAIAQRh2LQCACEEYdCACKAIAQRB2Qf8BcS0AgAhBEHRzIAIoAgBBCHZB/wFxLQCACEEIdHNzNgIAIAIgAigCECACKAIAQRd0IAIoAgBBCXZyIAIoAgAgAigCAEENdCACKAIAQRN2cnNzczYCACACKAIUIAIoAgA2AmQgAkH4EigCACACKAIAIAIoAgggAigCBHNzczYCECACIAIoAhBB/wFxLQCACCACKAIQQRh2LQCACEEYdCACKAIQQRB2Qf8BcS0AgAhBEHRzIAIoAhBBCHZB/wFxLQCACEEIdHNzNgIQIAIgAigCDCACKAIQQRd0IAIoAhBBCXZyIAIoAhAgAigCEEENdCACKAIQQRN2cnNzczYCECACKAIUIAIoAhA2AmggAkH8EigCACACKAIQIAIoAgQgAigCAHNzczYCDCACIAIoAgxB/wFxLQCACCACKAIMQRh2LQCACEEYdCACKAIMQRB2Qf8BcS0AgAhBEHRzIAIoAgxBCHZB/wFxLQCACEEIdHNzNgIMIAIgAigCCCACKAIMQRd0IAIoAgxBCXZyIAIoAgwgAigCDEENdCACKAIMQRN2cnNzczYCDCACKAIUIAIoAgw2AmwgAkGAEygCACACKAIMIAIoAgAgAigCEHNzczYCCCACIAIoAghB/wFxLQCACCACKAIIQRh2LQCACEEYdCACKAIIQRB2Qf8BcS0AgAhBEHRzIAIoAghBCHZB/wFxLQCACEEIdHNzNgIIIAIgAigCBCACKAIIQRd0IAIoAghBCXZyIAIoAgggAigCCEENdCACKAIIQRN2cnNzczYCCCACKAIUIAIoAgg2AnAgAkGEEygCACACKAIIIAIoAhAgAigCDHNzczYCBCACIAIoAgRB/wFxLQCACCACKAIEQRh2LQCACEEYdCACKAIEQRB2Qf8BcS0AgAhBEHRzIAIoAgRBCHZB/wFxLQCACEEIdHNzNgIEIAIgAigCACACKAIEQRd0IAIoAgRBCXZyIAIoAgQgAigCBEENdCACKAIEQRN2cnNzczYCBCACKAIUIAIoAgQ2AnQgAkGIEygCACACKAIEIAIoAgwgAigCCHNzczYCACACIAIoAgBB/wFxLQCACCACKAIAQRh2LQCACEEYdCACKAIAQRB2Qf8BcS0AgAhBEHRzIAIoAgBBCHZB/wFxLQCACEEIdHNzNgIAIAIgAigCECACKAIAQRd0IAIoAgBBCXZyIAIoAgAgAigCAEENdCACKAIAQRN2cnNzczYCACACKAIUIAIoAgA2AnggAkGMEygCACACKAIAIAIoAgggAigCBHNzczYCECACIAIoAhBB/wFxLQCACCACKAIQQRh2LQCACEEYdCACKAIQQRB2Qf8BcS0AgAhBEHRzIAIoAhBBCHZB/wFxLQCACEEIdHNzNgIQIAIgAigCDCACKAIQQRd0IAIoAhBBCXZyIAIoAhAgAigCEEENdCACKAIQQRN2cnNzczYCECACKAIUIAIoAhA2AnwgAkEANgIAIAJBADYCBCACQQA2AgggAkEANgIMIAJBADYCEAuHAgEBfyMAQUBqIgUkACAFIAA2AjwgBSABNgI4IAUgAjYCNCAFIAM2AjAgBSAENgIsA0AgBSgCMCIABEAgBUEQIAAgAEEQTxs2AgwgBSgCPCAFKAI4IAVBEGoiABAGIAUoAiwgBSgCNCAAIAUoAgwQCSMAQRBrIgAgBSgCODYCDCAAQQ82AggDQAJAIAAoAggiAUEASA0AIAEgACgCDGoiASABLQAAQQFqOgAAIAAoAgwgACgCCGotAAANACAAIAAoAghBAWs2AggMAQsLIAUgBSgCDCAFKAI0ajYCNCAFIAUoAgwgBSgCLGo2AiwgBSAFKAIwIAUoAgxrNgIwDAELCyAFQUBrJAALxicBDH8jAEEQayIKJAACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIABB9AFNBEBBmBMoAgAiBkEQIABBC2pBeHEgAEELSRsiBUEDdiIAdiIBQQNxBEACQCABQX9zQQFxIABqIgJBA3QiAUHAE2oiACABQcgTaigCACIBKAIIIgRGBEBBmBMgBkF+IAJ3cTYCAAwBCyAEIAA2AgwgACAENgIICyABQQhqIQAgASACQQN0IgJBA3I2AgQgASACaiIBIAEoAgRBAXI2AgQMDwsgBUGgEygCACIHTQ0BIAEEQAJAQQIgAHQiAkEAIAJrciABIAB0cWgiAUEDdCIAQcATaiICIABByBNqKAIAIgAoAggiBEYEQEGYEyAGQX4gAXdxIgY2AgAMAQsgBCACNgIMIAIgBDYCCAsgACAFQQNyNgIEIAAgBWoiCCABQQN0IgEgBWsiBEEBcjYCBCAAIAFqIAQ2AgAgBwRAIAdBeHFBwBNqIQFBrBMoAgAhAgJ/IAZBASAHQQN2dCIDcUUEQEGYEyADIAZyNgIAIAEMAQsgASgCCAshAyABIAI2AgggAyACNgIMIAIgATYCDCACIAM2AggLIABBCGohAEGsEyAINgIAQaATIAQ2AgAMDwtBnBMoAgAiC0UNASALaEECdEHIFWooAgAiAigCBEF4cSAFayEDIAIhAQNAAkAgASgCECIARQRAIAEoAhQiAEUNAQsgACgCBEF4cSAFayIBIAMgASADSSIBGyEDIAAgAiABGyECIAAhAQwBCwsgAigCGCEJIAIgAigCDCIERwRAQagTKAIAGiACKAIIIgAgBDYCDCAEIAA2AggMDgsgAkEUaiIBKAIAIgBFBEAgAigCECIARQ0DIAJBEGohAQsDQCABIQggACIEQRRqIgEoAgAiAA0AIARBEGohASAEKAIQIgANAAsgCEEANgIADA0LQX8hBSAAQb9/Sw0AIABBC2oiAEF4cSEFQZwTKAIAIghFDQBBACAFayEDAkACQAJAAn9BACAFQYACSQ0AGkEfIAVB////B0sNABogBUEmIABBCHZnIgBrdkEBcSAAQQF0a0E+agsiB0ECdEHIFWooAgAiAUUEQEEAIQAMAQtBACEAIAVBGSAHQQF2a0EAIAdBH0cbdCECA0ACQCABKAIEQXhxIAVrIgYgA08NACABIQQgBiIDDQBBACEDIAEhAAwDCyAAIAEoAhQiBiAGIAEgAkEddkEEcWooAhAiAUYbIAAgBhshACACQQF0IQIgAQ0ACwsgACAEckUEQEEAIQRBAiAHdCIAQQAgAGtyIAhxIgBFDQMgAGhBAnRByBVqKAIAIQALIABFDQELA0AgACgCBEF4cSAFayICIANJIQEgAiADIAEbIQMgACAEIAEbIQQgACgCECIBBH8gAQUgACgCFAsiAA0ACwsgBEUNACADQaATKAIAIAVrTw0AIAQoAhghByAEIAQoAgwiAkcEQEGoEygCABogBCgCCCIAIAI2AgwgAiAANgIIDAwLIARBFGoiASgCACIARQRAIAQoAhAiAEUNAyAEQRBqIQELA0AgASEGIAAiAkEUaiIBKAIAIgANACACQRBqIQEgAigCECIADQALIAZBADYCAAwLCyAFQaATKAIAIgRNBEBBrBMoAgAhAAJAIAQgBWsiAUEQTwRAIAAgBWoiAiABQQFyNgIEIAAgBGogATYCACAAIAVBA3I2AgQMAQsgACAEQQNyNgIEIAAgBGoiASABKAIEQQFyNgIEQQAhAkEAIQELQaATIAE2AgBBrBMgAjYCACAAQQhqIQAMDQsgBUGkEygCACICSQRAQaQTIAIgBWsiATYCAEGwE0GwEygCACIAIAVqIgI2AgAgAiABQQFyNgIEIAAgBUEDcjYCBCAAQQhqIQAMDQtBACEAIAVBL2oiAwJ/QfAWKAIABEBB+BYoAgAMAQtB/BZCfzcCAEH0FkKAoICAgIAENwIAQfAWIApBDGpBcHFB2KrVqgVzNgIAQYQXQQA2AgBB1BZBADYCAEGAIAsiAWoiBkEAIAFrIghxIgEgBU0NDEHQFigCACIEBEBByBYoAgAiByABaiIJIAdNDQ0gBCAJSQ0NCwJAQdQWLQAAQQRxRQRAAkACQAJAAkBBsBMoAgAiBARAQdgWIQADQCAEIAAoAgAiB08EQCAHIAAoAgRqIARLDQMLIAAoAggiAA0ACwtBABAEIgJBf0YNAyABIQZB9BYoAgAiAEEBayIEIAJxBEAgASACayACIARqQQAgAGtxaiEGCyAFIAZPDQNB0BYoAgAiAARAQcgWKAIAIgQgBmoiCCAETQ0EIAAgCEkNBAsgBhAEIgAgAkcNAQwFCyAGIAJrIAhxIgYQBCICIAAoAgAgACgCBGpGDQEgAiEACyAAQX9GDQEgBUEwaiAGTQRAIAAhAgwEC0H4FigCACICIAMgBmtqQQAgAmtxIgIQBEF/Rg0BIAIgBmohBiAAIQIMAwsgAkF/Rw0CC0HUFkHUFigCAEEEcjYCAAsgARAEIQJBABAEIQAgAkF/Rg0FIABBf0YNBSAAIAJNDQUgACACayIGIAVBKGpNDQULQcgWQcgWKAIAIAZqIgA2AgBBzBYoAgAgAEkEQEHMFiAANgIACwJAQbATKAIAIgMEQEHYFiEAA0AgAiAAKAIAIgEgACgCBCIEakYNAiAAKAIIIgANAAsMBAtBqBMoAgAiAEEAIAAgAk0bRQRAQagTIAI2AgALQQAhAEHcFiAGNgIAQdgWIAI2AgBBuBNBfzYCAEG8E0HwFigCADYCAEHkFkEANgIAA0AgAEEDdCIBQcgTaiABQcATaiIENgIAIAFBzBNqIAQ2AgAgAEEBaiIAQSBHDQALQaQTIAZBKGsiAEF4IAJrQQdxIgFrIgQ2AgBBsBMgASACaiIBNgIAIAEgBEEBcjYCBCAAIAJqQSg2AgRBtBNBgBcoAgA2AgAMBAsgAiADTQ0CIAEgA0sNAiAAKAIMQQhxDQIgACAEIAZqNgIEQbATIANBeCADa0EHcSIAaiIBNgIAQaQTQaQTKAIAIAZqIgIgAGsiADYCACABIABBAXI2AgQgAiADakEoNgIEQbQTQYAXKAIANgIADAMLQQAhBAwKC0EAIQIMCAtBqBMoAgAgAksEQEGoEyACNgIACyACIAZqIQFB2BYhAAJAAkACQANAIAEgACgCAEcEQCAAKAIIIgANAQwCCwsgAC0ADEEIcUUNAQtB2BYhAANAIAMgACgCACIBTwRAIAEgACgCBGoiBCADSw0DCyAAKAIIIQAMAAsACyAAIAI2AgAgACAAKAIEIAZqNgIEIAJBeCACa0EHcWoiByAFQQNyNgIEIAFBeCABa0EHcWoiBiAFIAdqIgVrIQAgAyAGRgRAQbATIAU2AgBBpBNBpBMoAgAgAGoiADYCACAFIABBAXI2AgQMCAtBrBMoAgAgBkYEQEGsEyAFNgIAQaATQaATKAIAIABqIgA2AgAgBSAAQQFyNgIEIAAgBWogADYCAAwICyAGKAIEIgNBA3FBAUcNBiADQXhxIQkgA0H/AU0EQCAGKAIMIgEgBigCCCICRgRAQZgTQZgTKAIAQX4gA0EDdndxNgIADAcLIAIgATYCDCABIAI2AggMBgsgBigCGCEIIAYgBigCDCICRwRAIAYoAggiASACNgIMIAIgATYCCAwFCyAGQRRqIgEoAgAiA0UEQCAGKAIQIgNFDQQgBkEQaiEBCwNAIAEhBCADIgJBFGoiASgCACIDDQAgAkEQaiEBIAIoAhAiAw0ACyAEQQA2AgAMBAtBpBMgBkEoayIAQXggAmtBB3EiAWsiCDYCAEGwEyABIAJqIgE2AgAgASAIQQFyNgIEIAAgAmpBKDYCBEG0E0GAFygCADYCACADIARBJyAEa0EHcWpBL2siACAAIANBEGpJGyIBQRs2AgQgAUHgFikCADcCECABQdgWKQIANwIIQeAWIAFBCGo2AgBB3BYgBjYCAEHYFiACNgIAQeQWQQA2AgAgAUEYaiEAA0AgAEEHNgIEIABBCGohDCAAQQRqIQAgDCAESQ0ACyABIANGDQAgASABKAIEQX5xNgIEIAMgASADayICQQFyNgIEIAEgAjYCACACQf8BTQRAIAJBeHFBwBNqIQACf0GYEygCACIBQQEgAkEDdnQiAnFFBEBBmBMgASACcjYCACAADAELIAAoAggLIQEgACADNgIIIAEgAzYCDCADIAA2AgwgAyABNgIIDAELQR8hACACQf///wdNBEAgAkEmIAJBCHZnIgBrdkEBcSAAQQF0a0E+aiEACyADIAA2AhwgA0IANwIQIABBAnRByBVqIQECQAJAQZwTKAIAIgRBASAAdCIGcUUEQEGcEyAEIAZyNgIAIAEgAzYCAAwBCyACQRkgAEEBdmtBACAAQR9HG3QhACABKAIAIQQDQCAEIgEoAgRBeHEgAkYNAiAAQR12IQQgAEEBdCEAIAEgBEEEcWoiBigCECIEDQALIAYgAzYCEAsgAyABNgIYIAMgAzYCDCADIAM2AggMAQsgASgCCCIAIAM2AgwgASADNgIIIANBADYCGCADIAE2AgwgAyAANgIIC0GkEygCACIAIAVNDQBBpBMgACAFayIBNgIAQbATQbATKAIAIgAgBWoiAjYCACACIAFBAXI2AgQgACAFQQNyNgIEIABBCGohAAwIC0GUE0EwNgIAQQAhAAwHC0EAIQILIAhFDQACQCAGKAIcIgFBAnRByBVqIgQoAgAgBkYEQCAEIAI2AgAgAg0BQZwTQZwTKAIAQX4gAXdxNgIADAILIAhBEEEUIAgoAhAgBkYbaiACNgIAIAJFDQELIAIgCDYCGCAGKAIQIgEEQCACIAE2AhAgASACNgIYCyAGKAIUIgFFDQAgAiABNgIUIAEgAjYCGAsgACAJaiEAIAYgCWoiBigCBCEDCyAGIANBfnE2AgQgBSAAQQFyNgIEIAAgBWogADYCACAAQf8BTQRAIABBeHFBwBNqIQECf0GYEygCACICQQEgAEEDdnQiAHFFBEBBmBMgACACcjYCACABDAELIAEoAggLIQAgASAFNgIIIAAgBTYCDCAFIAE2AgwgBSAANgIIDAELQR8hAyAAQf///wdNBEAgAEEmIABBCHZnIgFrdkEBcSABQQF0a0E+aiEDCyAFIAM2AhwgBUIANwIQIANBAnRByBVqIQECQAJAQZwTKAIAIgJBASADdCIEcUUEQEGcEyACIARyNgIAIAEgBTYCAAwBCyAAQRkgA0EBdmtBACADQR9HG3QhAyABKAIAIQIDQCACIgEoAgRBeHEgAEYNAiADQR12IQIgA0EBdCEDIAEgAkEEcWoiBCgCECICDQALIAQgBTYCEAsgBSABNgIYIAUgBTYCDCAFIAU2AggMAQsgASgCCCIAIAU2AgwgASAFNgIIIAVBADYCGCAFIAE2AgwgBSAANgIICyAHQQhqIQAMAgsCQCAHRQ0AAkAgBCgCHCIAQQJ0QcgVaiIBKAIAIARGBEAgASACNgIAIAINAUGcEyAIQX4gAHdxIgg2AgAMAgsgB0EQQRQgBygCECAERhtqIAI2AgAgAkUNAQsgAiAHNgIYIAQoAhAiAARAIAIgADYCECAAIAI2AhgLIAQoAhQiAEUNACACIAA2AhQgACACNgIYCwJAIANBD00EQCAEIAMgBWoiAEEDcjYCBCAAIARqIgAgACgCBEEBcjYCBAwBCyAEIAVBA3I2AgQgBCAFaiICIANBAXI2AgQgAiADaiADNgIAIANB/wFNBEAgA0F4cUHAE2ohAAJ/QZgTKAIAIgFBASADQQN2dCIDcUUEQEGYEyABIANyNgIAIAAMAQsgACgCCAshASAAIAI2AgggASACNgIMIAIgADYCDCACIAE2AggMAQtBHyEAIANB////B00EQCADQSYgA0EIdmciAGt2QQFxIABBAXRrQT5qIQALIAIgADYCHCACQgA3AhAgAEECdEHIFWohAQJAAkAgCEEBIAB0IgZxRQRAQZwTIAYgCHI2AgAgASACNgIADAELIANBGSAAQQF2a0EAIABBH0cbdCEAIAEoAgAhBQNAIAUiASgCBEF4cSADRg0CIABBHXYhBiAAQQF0IQAgASAGQQRxaiIGKAIQIgUNAAsgBiACNgIQCyACIAE2AhggAiACNgIMIAIgAjYCCAwBCyABKAIIIgAgAjYCDCABIAI2AgggAkEANgIYIAIgATYCDCACIAA2AggLIARBCGohAAwBCwJAIAlFDQACQCACKAIcIgBBAnRByBVqIgEoAgAgAkYEQCABIAQ2AgAgBA0BQZwTIAtBfiAAd3E2AgAMAgsgCUEQQRQgCSgCECACRhtqIAQ2AgAgBEUNAQsgBCAJNgIYIAIoAhAiAARAIAQgADYCECAAIAQ2AhgLIAIoAhQiAEUNACAEIAA2AhQgACAENgIYCwJAIANBD00EQCACIAMgBWoiAEEDcjYCBCAAIAJqIgAgACgCBEEBcjYCBAwBCyACIAVBA3I2AgQgAiAFaiIEIANBAXI2AgQgAyAEaiADNgIAIAcEQCAHQXhxQcATaiEAQawTKAIAIQECf0EBIAdBA3Z0IgUgBnFFBEBBmBMgBSAGcjYCACAADAELIAAoAggLIQYgACABNgIIIAYgATYCDCABIAA2AgwgASAGNgIIC0GsEyAENgIAQaATIAM2AgALIAJBCGohAAsgCkEQaiQAIAALNwEBfyAABEAgACgCBCIBBEAgARADIABBADYCBAsgACgCCCIBBEAgARADIABBADYCCAsLIAAQAwu7LwEGfyMAQZABayIFJAACQCABRQ0AIAJFDQAgAhAFIQYCQAJAAkACQAJAIAAoAgBBAWsOAgIAAQsgBUEQaiIDIAAoAgQQCiAFIAAoAggiACkAADcDACAFIAApAAg3AwggAyAFIAEgAiAGEAsMAgsgBhADQX8hAgwCCyAAKAIEIQQjAEEgayIIIgMgBUEQaiIHNgIcIAMgBDYCGCADIAMoAhw2AhQgA0GAEigCACADKAIYIgQtAABBGHQgBC0AAUEQdHIgBC0AAkEIdHIgBC0AA3JzNgIQIANBhBIoAgAgAygCGC0AByADKAIYLQAEQRh0IAMoAhgtAAVBEHRyIAMoAhgtAAZBCHRycnM2AgwgA0GIEigCACADKAIYLQALIAMoAhgtAAhBGHQgAygCGC0ACUEQdHIgAygCGC0ACkEIdHJyczYCCCADQYwSKAIAIAMoAhgtAA8gAygCGC0ADEEYdCADKAIYLQANQRB0ciADKAIYLQAOQQh0cnJzNgIEIANBkBIoAgAgAygCBCADKAIMIAMoAghzc3M2AgAgAyADKAIAIgRBGHYtAIAIQRh0IARBEHZB/wFxLQCACEEQdHMgBEEIdkH/AXEtAIAIQQh0cyAEQf8BcS0AgAhzNgIAIAMgAygCECADKAIAIAMoAgBBDXQgAygCACIEQRN2cnMgAygCAEEXdCAEQQl2cnNzNgIAIAMoAhQgAygCADYCfCADQZQSKAIAIAMoAgAgAygCCCADKAIEc3NzNgIQIAMgAygCEEH/AXEtAIAIIAMoAhBBGHYtAIAIQRh0IAMoAhBBEHZB/wFxLQCACEEQdHMgAygCEEEIdkH/AXEtAIAIQQh0c3M2AhAgAyADKAIMIAMoAhAgAygCEEENdCADKAIQIgRBE3ZycyADKAIQQRd0IARBCXZyc3M2AhAgAygCFCADKAIQNgJ4IANBmBIoAgAgAygCECADKAIEIAMoAgBzc3M2AgwgAyADKAIMQf8BcS0AgAggAygCDEEYdi0AgAhBGHQgAygCDEEQdkH/AXEtAIAIQRB0cyADKAIMQQh2Qf8BcS0AgAhBCHRzczYCDCADIAMoAgggAygCDCADKAIMQQ10IAMoAgwiBEETdnJzIAMoAgxBF3QgBEEJdnJzczYCDCADKAIUIAMoAgw2AnQgA0GcEigCACADKAIMIAMoAgAgAygCEHNzczYCCCADIAMoAghB/wFxLQCACCADKAIIQRh2LQCACEEYdCADKAIIQRB2Qf8BcS0AgAhBEHRzIAMoAghBCHZB/wFxLQCACEEIdHNzNgIIIAMgAygCBCADKAIIIAMoAghBDXQgAygCCCIEQRN2cnMgAygCCEEXdCAEQQl2cnNzNgIIIAMoAhQgAygCCDYCcCADQaASKAIAIAMoAgggAygCECADKAIMc3NzNgIEIAMgAygCBEH/AXEtAIAIIAMoAgRBGHYtAIAIQRh0IAMoAgRBEHZB/wFxLQCACEEQdHMgAygCBEEIdkH/AXEtAIAIQQh0c3M2AgQgAyADKAIAIAMoAgQgAygCBEENdCADKAIEIgRBE3ZycyADKAIEQRd0IARBCXZyc3M2AgQgAygCFCADKAIENgJsIANBpBIoAgAgAygCBCADKAIMIAMoAghzc3M2AgAgAyADKAIAQf8BcS0AgAggAygCAEEYdi0AgAhBGHQgAygCAEEQdkH/AXEtAIAIQRB0cyADKAIAQQh2Qf8BcS0AgAhBCHRzczYCACADIAMoAhAgAygCAEEXdCADKAIAQQl2ciADKAIAIAMoAgBBDXQgAygCAEETdnJzc3M2AgAgAygCFCADKAIANgJoIANBqBIoAgAgAygCACADKAIIIAMoAgRzc3M2AhAgAyADKAIQQf8BcS0AgAggAygCEEEYdi0AgAhBGHQgAygCEEEQdkH/AXEtAIAIQRB0cyADKAIQQQh2Qf8BcS0AgAhBCHRzczYCECADIAMoAgwgAygCEEEXdCADKAIQQQl2ciADKAIQIAMoAhBBDXQgAygCEEETdnJzc3M2AhAgAygCFCADKAIQNgJkIANBrBIoAgAgAygCECADKAIEIAMoAgBzc3M2AgwgAyADKAIMQf8BcS0AgAggAygCDEEYdi0AgAhBGHQgAygCDEEQdkH/AXEtAIAIQRB0cyADKAIMQQh2Qf8BcS0AgAhBCHRzczYCDCADIAMoAgggAygCDEEXdCADKAIMQQl2ciADKAIMIAMoAgxBDXQgAygCDEETdnJzc3M2AgwgAygCFCADKAIMNgJgIANBsBIoAgAgAygCDCADKAIAIAMoAhBzc3M2AgggAyADKAIIQf8BcS0AgAggAygCCEEYdi0AgAhBGHQgAygCCEEQdkH/AXEtAIAIQRB0cyADKAIIQQh2Qf8BcS0AgAhBCHRzczYCCCADIAMoAgQgAygCCEEXdCADKAIIQQl2ciADKAIIIAMoAghBDXQgAygCCEETdnJzc3M2AgggAygCFCADKAIINgJcIANBtBIoAgAgAygCCCADKAIQIAMoAgxzc3M2AgQgAyADKAIEQf8BcS0AgAggAygCBEEYdi0AgAhBGHQgAygCBEEQdkH/AXEtAIAIQRB0cyADKAIEQQh2Qf8BcS0AgAhBCHRzczYCBCADIAMoAgAgAygCBEEXdCADKAIEQQl2ciADKAIEIAMoAgRBDXQgAygCBEETdnJzc3M2AgQgAygCFCADKAIENgJYIANBuBIoAgAgAygCBCADKAIMIAMoAghzc3M2AgAgAyADKAIAQf8BcS0AgAggAygCAEEYdi0AgAhBGHQgAygCAEEQdkH/AXEtAIAIQRB0cyADKAIAQQh2Qf8BcS0AgAhBCHRzczYCACADIAMoAhAgAygCAEEXdCADKAIAQQl2ciADKAIAIAMoAgBBDXQgAygCAEETdnJzc3M2AgAgAygCFCADKAIANgJUIANBvBIoAgAgAygCACADKAIIIAMoAgRzc3M2AhAgAyADKAIQQf8BcS0AgAggAygCEEEYdi0AgAhBGHQgAygCEEEQdkH/AXEtAIAIQRB0cyADKAIQQQh2Qf8BcS0AgAhBCHRzczYCECADIAMoAgwgAygCEEEXdCADKAIQQQl2ciADKAIQIAMoAhBBDXQgAygCEEETdnJzc3M2AhAgAygCFCADKAIQNgJQIANBwBIoAgAgAygCECADKAIEIAMoAgBzc3M2AgwgAyADKAIMQf8BcS0AgAggAygCDEEYdi0AgAhBGHQgAygCDEEQdkH/AXEtAIAIQRB0cyADKAIMQQh2Qf8BcS0AgAhBCHRzczYCDCADIAMoAgggAygCDEEXdCADKAIMQQl2ciADKAIMIAMoAgxBDXQgAygCDEETdnJzc3M2AgwgAygCFCADKAIMNgJMIANBxBIoAgAgAygCDCADKAIAIAMoAhBzc3M2AgggAyADKAIIQf8BcS0AgAggAygCCEEYdi0AgAhBGHQgAygCCEEQdkH/AXEtAIAIQRB0cyADKAIIQQh2Qf8BcS0AgAhBCHRzczYCCCADIAMoAgQgAygCCEEXdCADKAIIQQl2ciADKAIIIAMoAghBDXQgAygCCEETdnJzc3M2AgggAygCFCADKAIINgJIIANByBIoAgAgAygCCCADKAIQIAMoAgxzc3M2AgQgAyADKAIEQf8BcS0AgAggAygCBEEYdi0AgAhBGHQgAygCBEEQdkH/AXEtAIAIQRB0cyADKAIEQQh2Qf8BcS0AgAhBCHRzczYCBCADIAMoAgAgAygCBEEXdCADKAIEQQl2ciADKAIEIAMoAgRBDXQgAygCBEETdnJzc3M2AgQgAygCFCADKAIENgJEIANBzBIoAgAgAygCBCADKAIMIAMoAghzc3M2AgAgAyADKAIAQf8BcS0AgAggAygCAEEYdi0AgAhBGHQgAygCAEEQdkH/AXEtAIAIQRB0cyADKAIAQQh2Qf8BcS0AgAhBCHRzczYCACADIAMoAhAgAygCAEEXdCADKAIAQQl2ciADKAIAIAMoAgBBDXQgAygCAEETdnJzc3M2AgAgAygCFEFAayADKAIANgIAIANB0BIoAgAgAygCACADKAIIIAMoAgRzc3M2AhAgAyADKAIQQf8BcS0AgAggAygCEEEYdi0AgAhBGHQgAygCEEEQdkH/AXEtAIAIQRB0cyADKAIQQQh2Qf8BcS0AgAhBCHRzczYCECADIAMoAgwgAygCEEEXdCADKAIQQQl2ciADKAIQIAMoAhBBDXQgAygCEEETdnJzc3M2AhAgAygCFCADKAIQNgI8IANB1BIoAgAgAygCECADKAIEIAMoAgBzc3M2AgwgAyADKAIMQf8BcS0AgAggAygCDEEYdi0AgAhBGHQgAygCDEEQdkH/AXEtAIAIQRB0cyADKAIMQQh2Qf8BcS0AgAhBCHRzczYCDCADIAMoAgggAygCDEEXdCADKAIMQQl2ciADKAIMIAMoAgxBDXQgAygCDEETdnJzc3M2AgwgAygCFCADKAIMNgI4IANB2BIoAgAgAygCDCADKAIAIAMoAhBzc3M2AgggAyADKAIIQf8BcS0AgAggAygCCEEYdi0AgAhBGHQgAygCCEEQdkH/AXEtAIAIQRB0cyADKAIIQQh2Qf8BcS0AgAhBCHRzczYCCCADIAMoAgQgAygCCEEXdCADKAIIQQl2ciADKAIIIAMoAghBDXQgAygCCEETdnJzc3M2AgggAygCFCADKAIINgI0IANB3BIoAgAgAygCCCADKAIQIAMoAgxzc3M2AgQgAyADKAIEQf8BcS0AgAggAygCBEEYdi0AgAhBGHQgAygCBEEQdkH/AXEtAIAIQRB0cyADKAIEQQh2Qf8BcS0AgAhBCHRzczYCBCADIAMoAgAgAygCBEEXdCADKAIEQQl2ciADKAIEIAMoAgRBDXQgAygCBEETdnJzc3M2AgQgAygCFCADKAIENgIwIANB4BIoAgAgAygCBCADKAIMIAMoAghzc3M2AgAgAyADKAIAQf8BcS0AgAggAygCAEEYdi0AgAhBGHQgAygCAEEQdkH/AXEtAIAIQRB0cyADKAIAQQh2Qf8BcS0AgAhBCHRzczYCACADIAMoAhAgAygCAEEXdCADKAIAQQl2ciADKAIAIAMoAgBBDXQgAygCAEETdnJzc3M2AgAgAygCFCADKAIANgIsIANB5BIoAgAgAygCACADKAIIIAMoAgRzc3M2AhAgAyADKAIQQf8BcS0AgAggAygCEEEYdi0AgAhBGHQgAygCEEEQdkH/AXEtAIAIQRB0cyADKAIQQQh2Qf8BcS0AgAhBCHRzczYCECADIAMoAgwgAygCEEEXdCADKAIQQQl2ciADKAIQIAMoAhBBDXQgAygCEEETdnJzc3M2AhAgAygCFCADKAIQNgIoIANB6BIoAgAgAygCECADKAIEIAMoAgBzc3M2AgwgAyADKAIMQf8BcS0AgAggAygCDEEYdi0AgAhBGHQgAygCDEEQdkH/AXEtAIAIQRB0cyADKAIMQQh2Qf8BcS0AgAhBCHRzczYCDCADIAMoAgggAygCDEEXdCADKAIMQQl2ciADKAIMIAMoAgxBDXQgAygCDEETdnJzc3M2AgwgAygCFCADKAIMNgIkIANB7BIoAgAgAygCDCADKAIAIAMoAhBzc3M2AgggAyADKAIIQf8BcS0AgAggAygCCEEYdi0AgAhBGHQgAygCCEEQdkH/AXEtAIAIQRB0cyADKAIIQQh2Qf8BcS0AgAhBCHRzczYCCCADIAMoAgQgAygCCEEXdCADKAIIQQl2ciADKAIIIAMoAghBDXQgAygCCEETdnJzc3M2AgggAygCFCADKAIINgIgIANB8BIoAgAgAygCCCADKAIQIAMoAgxzc3M2AgQgAyADKAIEQf8BcS0AgAggAygCBEEYdi0AgAhBGHQgAygCBEEQdkH/AXEtAIAIQRB0cyADKAIEQQh2Qf8BcS0AgAhBCHRzczYCBCADIAMoAgAgAygCBEEXdCADKAIEQQl2ciADKAIEIAMoAgRBDXQgAygCBEETdnJzc3M2AgQgAygCFCADKAIENgIcIANB9BIoAgAgAygCBCADKAIMIAMoAghzc3M2AgAgAyADKAIAQf8BcS0AgAggAygCAEEYdi0AgAhBGHQgAygCAEEQdkH/AXEtAIAIQRB0cyADKAIAQQh2Qf8BcS0AgAhBCHRzczYCACADIAMoAhAgAygCAEEXdCADKAIAQQl2ciADKAIAIAMoAgBBDXQgAygCAEETdnJzc3M2AgAgAygCFCADKAIANgIYIANB+BIoAgAgAygCACADKAIIIAMoAgRzc3M2AhAgAyADKAIQQf8BcS0AgAggAygCEEEYdi0AgAhBGHQgAygCEEEQdkH/AXEtAIAIQRB0cyADKAIQQQh2Qf8BcS0AgAhBCHRzczYCECADIAMoAgwgAygCEEEXdCADKAIQQQl2ciADKAIQIAMoAhBBDXQgAygCEEETdnJzc3M2AhAgAygCFCADKAIQNgIUIANB/BIoAgAgAygCECADKAIEIAMoAgBzc3M2AgwgAyADKAIMQf8BcS0AgAggAygCDEEYdi0AgAhBGHQgAygCDEEQdkH/AXEtAIAIQRB0cyADKAIMQQh2Qf8BcS0AgAhBCHRzczYCDCADIAMoAgggAygCDEEXdCADKAIMQQl2ciADKAIMIAMoAgxBDXQgAygCDEETdnJzc3M2AgwgAygCFCADKAIMNgIQIANBgBMoAgAgAygCDCADKAIAIAMoAhBzc3M2AgggAyADKAIIQf8BcS0AgAggAygCCEEYdi0AgAhBGHQgAygCCEEQdkH/AXEtAIAIQRB0cyADKAIIQQh2Qf8BcS0AgAhBCHRzczYCCCADIAMoAgQgAygCCEEXdCADKAIIQQl2ciADKAIIIAMoAghBDXQgAygCCEETdnJzc3M2AgggAygCFCADKAIINgIMIANBhBMoAgAgAygCCCADKAIQIAMoAgxzc3M2AgQgAyADKAIEQf8BcS0AgAggAygCBEEYdi0AgAhBGHQgAygCBEEQdkH/AXEtAIAIQRB0cyADKAIEQQh2Qf8BcS0AgAhBCHRzczYCBCADIAMoAgAgAygCBEEXdCADKAIEQQl2ciADKAIEIAMoAgRBDXQgAygCBEETdnJzc3M2AgQgAygCFCADKAIENgIIIANBiBMoAgAgAygCBCADKAIMIAMoAghzc3M2AgAgAyADKAIAQf8BcS0AgAggAygCAEEYdi0AgAhBGHQgAygCAEEQdkH/AXEtAIAIQRB0cyADKAIAQQh2Qf8BcS0AgAhBCHRzczYCACADIAMoAhAgAygCAEEXdCADKAIAQQl2ciADKAIAIAMoAgBBDXQgAygCAEETdnJzc3M2AgAgAygCFCADKAIANgIEIANBjBMoAgAgAygCACADKAIIIAMoAgRzc3M2AhAgAyADKAIQQf8BcS0AgAggAygCEEEYdi0AgAhBGHQgAygCEEEQdkH/AXEtAIAIQRB0cyADKAIQQQh2Qf8BcS0AgAhBCHRzczYCECADIAMoAgwgAygCEEEXdCADKAIQQQl2ciADKAIQIAMoAhBBDXQgAygCEEETdnJzc3M2AhAgAygCFCADKAIQNgIAIANBADYCACADQQA2AgQgA0EANgIIIANBADYCDCADQQA2AhAgACgCCCEDIAgiACQAIAAgBzYCHCAAIAM2AhggACABNgIUIAAgAkEEdjYCECAAIAY2AgwDQCAAIAAoAhAiA0EBazYCECADBEAgACgCHCAAKAIUIAAoAgwQBiAAKAIYIQQjAEEgayIDIAAoAgw2AhwgAyAENgIYIANBEDYCFCADIAMoAhw2AhAgAyADKAIYNgIMIANBADYCCANAIAMoAggiBCADKAIUSQRAIAQgAygCEGoiByAEIAMoAgxqLQAAIActAABzOgAAIAMgAygCCEEBajYCCAwBCwsgACAAKAIUNgIYIAAgACgCFEEQajYCFCAAIAAoAgxBEGo2AgwMAQsLIABBIGokAAsgASAGIAIQCCAGEAMLIAIhAwsgBUGQAWokACADC68CAQN/IwBBkAFrIgMkAAJAIAFFDQAgAkUNACADQRBqIAAoAgQQCiACEAUhBUF/IQQCQAJAAkACQCAAKAIAQQFrDgIAAQMLIAAoAgghBCMAQSBrIgAkACAAIANBEGo2AhwgACAENgIYIAAgATYCFCAAIAJBBHY2AhAgACAFNgIMA0AgACAAKAIQIgRBAWs2AhAgBARAIAAoAgwgACgCFCAAKAIYQRAQCSAAKAIcIAAoAgwgACgCDBAGIAAgACgCDDYCGCAAIAAoAhRBEGo2AhQgACAAKAIMQRBqNgIMDAELCyAAQSBqJAAMAQsgAyAAKAIIIgApAAA3AwAgAyAAKQAINwMIIANBEGogAyABIAIgBRALCyABIAUgAhAIIAIhBAsgBRADCyADQZABaiQAIAQLYwEBf0EMEAUiAyAANgIAIANBIBAFIgA2AgQgACABKQAYNwAYIAAgASkAEDcAECAAIAEpAAg3AAggACABKQAANwAAIANBEBAFIgA2AgggACACKQAINwAIIAAgAikAADcAACADCwuiCwIAQYAIC4AK1pDp/szhPbcWthTCKPssBStnmnYqvgTDqkQTJkmGBpmcQlD0ke+YejNUC0Ptz6xi5LMcqckI6JWA35T6dY8/pkcHp/zzcxe6g1k8GeaFT6hoa4GycWTai/jrD0twVp01HiQOXmNY0aIlInw7ASF4h9QARlef0ydSTDYC56DEyJ7qv4rSQMc4taP38s75YRWh4K5dpJs0GlWtkzIw9Yyx4x324i6CZspgwCkjqw1TTm/V2zdF3v2OLwP/anJtbFtRjRuvkrvdvH8R2VxBHxBa2ArBMYilzXu9LXTQErjltLCJaZdKDJZ3fmW58QnFbsaEGPB97DrcTSB57l8+18s5SFtb1Y5CQpLQp6fqTfv7/QYzM8/8h4fiZfT0Pcne3rVrWFgWTtratG5QUBRECwvByqCgKIjv7/gXsLAsnBQUBRGsrCuHnZ1m+2pqmPLZ2XeuqKgqgvr6vEYQEAQUDw/Az6qqqAIREUVUTEwTX5iYJr4lJUhtGhqEnhgYBh5mZpv9cnKe7AkJQ0pBQVEQ09P3JEZGk9W/v+xTYmKa+Onpe5LMzDP/UVFVBCwsCycNDUJPt7fuWT8/zPOysq4ciYlj6pOT53TOzrF/cHAcbKamqw0nJ8rtICAIKKOj60hWVpfBAgKCgH9/3KNSUpbE6+v5EtXVdKE+Po2z/Pw/w5qapD4dHUZbHBwHG56epTvz8/8Mz8/wP83Ncr9cXBdL6uq4Ug4OgY9lZVg98PA8zGRkGX2bm+V+FhaHkT09TnOioqoIoaFpyK2tascGBoOFysqwesXFcLWRkWX0a2vZsi4uiafj4/sYr6/oRzw8DzMtLUpnwcFxsFlZVw52dp/p1NQ14Xh4HmaQkCS0ODgONnl5XyaNjWLvYWFZOEdH0pWKiqAqlJQlsYiIIqrx8X2M7Ow71wQEAQWEhCGl4eF5mB4ehZtTU9eEAAAAABkZR15dXVYLfn6d409P0J+cnCe7SUlTGjExTXzY2DbuCAgCCp+f5HuCgqIgExPH1CMjy+h6epzmq6vpQv7+vUMqKoiiS0vRmgEBQUAfH8Tb4OA42NbWt2GOjqEv39/0K8vL8To7O8325+f6HYWFYOVUVBVBhoajJYOD42C6uqwWdXVcKZKSpjRubpn30NA05GhoGnJVVVQBtravGU5Okd/IyDL6wMAw8NfX9iEyMo68xsazdY+P4G90dB1p29v1LouL4Wq4uC6WCgqAipmZZ/4rK8nigYFh4AMDw8CkpCmNjIwjr66uqQc0NA05TU1SHzk5T3a9vW7TV1fWgW9v2Lfc3DfrFRVEUXt73ab39/4JOjqMtry8L5MMDAMP///8A6mpa8LJyXO6tbVs2bGxbdxtbVo3RUVQFTY2j7lsbBt3vr6tE0pKkNru7rlXd3feqfLyvkz9/X6DREQRVWdn2r1xcV0sBQVARXx8H2NAQBBQaWlbMmNj27goKAoiBwfCxcTEMfUiIoqolpanMTc3zvnt7XqX9va/SbS0LZnR0XWkQ0PTkEhIElri4rpYl5fmcdLStmTCwrJwJiaLraWlaM1eXpXLKSlLYjAwDDxaWpTO3d12q/n5f4aVlWTx5ua7XcfH8jUkJAktFxfG0bm5b9YbG8XeEhKGlGBgGHjDw/Mw9fV8ibOz71zo6DrSc3PfrDU1THmAgCCg5eV4nbu77VZ9fV4j+Pg+xl9f1IsvL8jn5OQ53SEhSWgAQYASC5MBxrqxo1AzqlaXkX1n3CJwshUOBwAxKiMcTUY/OGliW1SFfndwoZqTjL22r6jZ0svE9e7n4BEKA/wtJh8YSUI7NGVeV1CBenNsnZaPiLmyq6TVzsfA8erj3A0G//gpIhsURT43MGFaU0x9dm9omZKLhLWup6DRysO87ebf2AkC+/QlHhcQQTozLF1WT0h5cmtkkAsB")||(x=function(e){return t.locateFile?t.locateFile(e,s):s+e}(x));var B=e=>{for(;e.length>0;)e.shift()(t)};t.noExitRuntime;var S,D=t=>{var e=(t-h.buffer.byteLength+65535)/65536;try{return h.grow(e),A(),1}catch(t){}},R={a:()=>{I("")},c:(t,e,n)=>d.copyWithin(t,e,e+n),b:t=>{var e=d.length,n=2147483648;if((t>>>=0)>n)return!1;for(var r=(t,e)=>t+(e-t%e)%e,i=1;i<=4;i*=2){var o=e*(1+.2/i);o=Math.min(o,t+100663296);var a=Math.min(n,r(Math.max(t,o),65536));if(D(a))return!0}return!1}},z=function(){var e={a:R};function n(e,n){var r;return z=e.exports,h=z.d,A(),r=z.e,m.unshift(r),function(){if(v--,t.monitorRunDependencies&&t.monitorRunDependencies(v),0==v&&C){var e=C;C=null,e()}}(),z}if(v++,t.monitorRunDependencies&&t.monitorRunDependencies(v),t.instantiateWasm)try{return t.instantiateWasm(e,n)}catch(t){return f(`Module.instantiateWasm callback failed with error: ${t}`),!1}return M(x,e,(function(t){n(t.instance)})),{}}();function O(){function e(){S||(S=!0,t.calledRun=!0,p||(B(m),t.onRuntimeInitialized&&t.onRuntimeInitialized(),function(){if(t.postRun)for("function"==typeof t.postRun&&(t.postRun=[t.postRun]);t.postRun.length;)e=t.postRun.shift(),y.unshift(e);var e;B(y)}()))}v>0||(function(){if(t.preRun)for("function"==typeof t.preRun&&(t.preRun=[t.preRun]);t.preRun.length;)e=t.preRun.shift(),g.unshift(e);var e;B(g)}(),v>0||(t.setStatus?(t.setStatus("Running..."),setTimeout((function(){setTimeout((function(){t.setStatus("")}),1),e()}),1)):e()))}if(t._UGCWasm_CipherSM4_New=(e,n,r)=>(t._UGCWasm_CipherSM4_New=z.f)(e,n,r),t._UGCWasm_CipherSM4_Encrypt=(e,n,r)=>(t._UGCWasm_CipherSM4_Encrypt=z.g)(e,n,r),t._UGCWasm_CipherSM4_Decrypt=(e,n,r)=>(t._UGCWasm_CipherSM4_Decrypt=z.h)(e,n,r),t._UGCWasm_CipherSM4_Delete=e=>(t._UGCWasm_CipherSM4_Delete=z.i)(e),t._malloc=e=>(t._malloc=z.k)(e),t._free=e=>(t._free=z.l)(e),C=function t(){S||O(),S||(C=t)},t.preInit)for("function"==typeof t.preInit&&(t.preInit=[t.preInit]);t.preInit.length>0;)t.preInit.pop()();return O(),t}();function ZL(){}var $L=!1,tQ=!1,eQ=!1;function nQ(t,e){if(t.byteLength<=e)return t;return t.subarray(0,e)}function rQ(t,e){for(let n=0;n<t.length;n++)e[n]=t[n];return e}gL.onRuntimeInitialized=()=>{($L=!0)&&tQ&&(eQ=!0)},JL.onRuntimeInitialized=()=>{tQ=!0,$L&&tQ&&(eQ=!0)},ZL.parse=function(t,e){return eQ?e="SM4"===t.type?function(t,e){const n=new Uint8Array(e),r=nQ(n,256),i=new Uint8Array(t),o=JL._malloc(i.length*i.BYTES_PER_ELEMENT);JL.HEAPU8.set(i,o/i.BYTES_PER_ELEMENT);const a=new Uint8Array([48,49,50,51,52,53,54,55,56,57,97,98,99,100,101,102]),s=JL._malloc(a.length*a.BYTES_PER_ELEMENT);JL.HEAPU8.set(a,s/a.BYTES_PER_ELEMENT);const c=JL._UGCWasm_CipherSM4_New(2,o,s);JL._free(o),JL._free(s);const l=JL._malloc(r.length*r.BYTES_PER_ELEMENT);JL.HEAPU8.set(r,l/r.BYTES_PER_ELEMENT),JL._UGCWasm_CipherSM4_Decrypt(c,l,r.length);const u=rQ(JL.HEAPU8.subarray(l,l+r.length),n);return JL._UGCWasm_CipherSM4_Delete(c),JL._free(l),u.buffer}(t.key,e):function(t,e){var n=new Uint8Array(e);const r=new Uint8Array(t),i=gL._malloc(r.length*r.BYTES_PER_ELEMENT);gL.HEAPU8.set(r,i/r.BYTES_PER_ELEMENT);var o=new Uint8Array([1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16]),a=gL._malloc(o.length*o.BYTES_PER_ELEMENT);gL.HEAPU8.set(o,a/o.BYTES_PER_ELEMENT);var s=gL._UGCWasm_CipherAES_New(2,i,a);gL._free(i),gL._free(a);const c=nQ(n,256);return function(t,e,n){const r=gL._malloc(t.length*t.BYTES_PER_ELEMENT);gL.HEAPU8.set(t,r/t.BYTES_PER_ELEMENT),gL._UGCWasm_CipherAES_Encrypt(e,r,t.length);let i=gL.HEAPU8.subarray(r,r+t.length);const o=rQ(i,n);return gL._free(r),o}(c,s,n).buffer}(t.key,e):null};const iQ=function(){let t=!0;return function(e,n){const r=t?function(){if(n){const t=n.apply(e,arguments);return n=null,t}}:function(){};return t=!1,r}}(),oQ=iQ(void 0,(function(){return oQ.toString().search("(((.+)+)+)+$").toString().constructor(oQ).search("(((.+)+)+)+$")}));oQ();class aQ{constructor(t){this.entries={},this.scheduler=t}request(t,e,n,r){const i=this.entries[t]=this.entries[t]||{callbacks:[]};if(i.result){const[t,n]=i.result;return this.scheduler?this.scheduler.add((()=>{r(t,n)}),e):r(t,n),()=>{}}return i.callbacks.push(r),!i.cancel&&(i.cancel=n(((n,r)=>{i.result=[n,r];for(const t of i.callbacks)this.scheduler?this.scheduler.add((()=>{t(n,r)}),e):t(n,r);setTimeout((()=>delete this.entries[t]),3e3)}))),()=>{i.result||(i.callbacks=i.callbacks.filter((t=>t!==r)),!i.callbacks.length&&(i.cancel(),delete this.entries[t]))}}}function sQ(t,e,n){const r=JSON.stringify(t.request);t.data&&(this.deduped.entries[r]={result:[null,t.data]});const i={type:"parseTile",isSymbolTile:t.isSymbolTile,zoom:t.tileZoom};return this.deduped.request(r,i,(e=>{const n=(r=t.request,i=(n,r,i,o)=>{if(n)e(n);else if(r){if(Nr(t.encryptInfo)&&null==(r=ZL.parse(t.encryptInfo,r)))return void e(null);r.byteLength,e(null,{vectorTile:new fN(new hT(r)),rawData:r,cacheControl:i,expires:o})}},oA(Lp(r,{type:"arrayBuffer"}),i));var r,i;return()=>{n.cancel(),e()}}),e)}class cQ extends xA{constructor(t,e,n,r,i){super(),this.actor=t,this.layerIndex=e,this.availableImages=n,this.loadVectorData=i||sQ,this.loading={},this.loaded={},this.deduped=new aQ(t.scheduler),this.isSpriteLoaded=r,this.scheduler=t.scheduler}loadTile(t,e){const n=t.uid,r=t&&t.request;r&&r.collectResourceTiming;const i=this.loading[n]=new fL(t);i.abort=this.loadVectorData(t,((r,o)=>{const a=!this.loading[n];if(delete this.loading[n],a||r||!o)return i.status="done",a||(this.loaded[n]=i),e(r);const s=o.rawData,c={};o.expires&&(c.expires=o.expires),o.cacheControl&&(c.cacheControl=o.cacheControl),i.vectorTile=o.vectorTile||new fN(new hT(s));const l=()=>{i.parse(t,i.vectorTile,this.layerIndex,this.availableImages,this.actor,((t,n)=>{if(t||!n)return e(t);e(null,Lp({rawTileData:s.slice(0)},n,c,{}))}))};this.isSpriteLoaded?l():this.once("isSpriteLoaded",(()=>{if(this.scheduler){const e={type:"parseTile",isSymbolTile:t.isSymbolTile,zoom:t.tileZoom};this.scheduler.add(l,e)}else l()})),this.loaded=this.loaded||{},this.loaded[n]=i}))}reloadTile(t,e){const n=this.loaded,r=t.uid,i=this;if(n&&n[r]){const o=n[r];o.showCollisionBoxes=t.showCollisionBoxes,o.enableTerrain=!!t.enableTerrain,o.projection=t.projection,o.tileTransform=uz(t.tileID.canonical,t.projection);const a=(n,r)=>{const a=o.reloadCallback;a&&(delete o.reloadCallback,o.parse(t,o.vectorTile,i.layerIndex,this.availableImages,i.actor,a)),e(n,r)};"parsing"===o.status?o.reloadCallback=a:"done"===o.status&&(o.vectorTile?o.parse(t,o.vectorTile,this.layerIndex,this.availableImages,this.actor,a):a())}}abortTile(t,e){const n=t.uid,r=this.loading[n];r&&(r.abort&&r.abort(),delete this.loading[n]),e()}removeTile(t,e){const n=this.loaded,r=t.uid;n&&n[r]&&delete n[r],e()}}var lQ,uQ=(lQ=!0,function(t,e){var n=lQ?function(){if(e){var n=e.apply(t,arguments);return e=null,n}}:function(){};return lQ=!1,n}),hQ=uQ(void 0,(function(){return hQ.toString().search("(((.+)+)+)+$").toString().constructor(hQ).search("(((.+)+)+)+$")}));function fQ(t,e){var n,r=t&&t.type;if("FeatureCollection"===r)for(n=0;n<t.features.length;n++)fQ(t.features[n],e);else if("GeometryCollection"===r)for(n=0;n<t.geometries.length;n++)fQ(t.geometries[n],e);else if("Feature"===r)fQ(t.geometry,e);else if("Polygon"===r)dQ(t.coordinates,e);else if("MultiPolygon"===r)for(n=0;n<t.coordinates.length;n++)dQ(t.coordinates[n],e);return t}function dQ(t,e){if(0!==t.length){pQ(t[0],e);for(var n=1;n<t.length;n++)pQ(t[n],!e)}}function pQ(t,e){for(var n=0,r=0,i=0,o=t.length,a=o-1;i<o;a=i++){var s=(t[i][0]-t[a][0])*(t[a][1]+t[i][1]),c=n+s;r+=Math.abs(n)>=Math.abs(s)?n-c+s:s-c+n,n=c}n+r>=0!=!!e&&t.reverse()}hQ();const AQ=function(){let t=!0;return function(e,n){const r=t?function(){if(n){const t=n.apply(e,arguments);return n=null,t}}:function(){};return t=!1,r}}(),gQ=AQ(void 0,(function(){return gQ.toString().search("(((.+)+)+)+$").toString().constructor(gQ).search("(((.+)+)+)+$")}));gQ();class mQ{constructor(t){this._feature=t,this.extent=Cl,this.type=t.type,this.properties=t.tags,"id"in t&&!isNaN(t.id)&&(this.id=parseInt(t.id,10))}loadGeometry(){if(1===this._feature.type){const t=[];for(const e of this._feature.geometry)t.push([new Or(e[0],e[1])]);return t}{const t=[];for(const e of this._feature.geometry){const n=[];for(const t of e)n.push(new Or(t[0],t[1]));t.push(n)}return t}}toGeoJSON(t,e,n){return eN.prototype.toGeoJSON.call(this,t,e,n)}}class yQ{constructor(t){this.layers={_geojsonTileLayer:this},this.name="_geojsonTileLayer",this.extent=Cl,this.length=t.length,this._features=t}feature(t){return new mQ(this._features[t])}}var vQ,CQ=(vQ=!0,function(t,e){var n=vQ?function(){if(e){var n=e.apply(t,arguments);return e=null,n}}:function(){};return vQ=!1,n}),IQ=CQ(void 0,(function(){return IQ.toString().search("(((.+)+)+)+$").toString().constructor(IQ).search("(((.+)+)+)+$")}));IQ();var xQ,EQ=(xQ=!0,function(t,e){var n=xQ?function(){if(e){var n=e.apply(t,arguments);return e=null,n}}:function(){};return xQ=!1,n}),_Q=EQ(void 0,(function(){return _Q.toString().search("(((.+)+)+)+$").toString().constructor(_Q).search("(((.+)+)+)+$")}));function bQ(t){var e=new hT;return function(t,e){for(var n in t.layers)e.writeMessage(3,wQ,t.layers[n])}(t,e),e.finish()}function wQ(t,e){e.writeVarintField(15,t.version||1),e.writeStringField(1,t.name||""),e.writeVarintField(5,t.extent||4096);var n,r={keys:[],values:[],keycache:{},valuecache:{}};for(n=0;n<t.length;n++)r.feature=t.feature(n),e.writeMessage(2,MQ,r);var i=r.keys;for(n=0;n<i.length;n++)e.writeStringField(3,i[n]);var o=r.values;for(n=0;n<o.length;n++)e.writeMessage(4,RQ,o[n])}function MQ(t,e){var n=t.feature;void 0!==n.id&&e.writeVarintField(1,n.id),e.writeMessage(2,TQ,t),e.writeVarintField(3,n.type),e.writeMessage(4,DQ,n)}function TQ(t,e){var n=t.feature,r=t.keys,i=t.values,o=t.keycache,a=t.valuecache;for(var s in n.properties){var c=n.properties[s],l=o[s];if(null!==c){void 0===l&&(r.push(s),l=r.length-1,o[s]=l),e.writeVarint(l);var u=typeof c;"string"!==u&&"boolean"!==u&&"number"!==u&&(c=JSON.stringify(c));var h=u+":"+c,f=a[h];void 0===f&&(i.push(c),f=i.length-1,a[h]=f),e.writeVarint(f)}}}function BQ(t,e){return(e<<3)+(7&t)}function SQ(t){return t<<1^t>>31}function DQ(t,e){for(var n=t.loadGeometry(),r=t.type,i=0,o=0,a=n.length,s=0;s<a;s++){var c=n[s],l=1;1===r&&(l=c.length),e.writeVarint(BQ(1,l));for(var u=3===r?c.length-1:c.length,h=0;h<u;h++){1===h&&1!==r&&e.writeVarint(BQ(2,u-1));var f=c[h].x-i,d=c[h].y-o;e.writeVarint(SQ(f)),e.writeVarint(SQ(d)),i+=f,o+=d}3===r&&e.writeVarint(BQ(7,1))}}function RQ(t,e){var n=typeof t;"string"===n?e.writeStringField(1,t):"boolean"===n?e.writeBooleanField(7,t):"number"===n&&(t%1!=0?e.writeDoubleField(3,t):t<0?e.writeSVarintField(6,t):e.writeVarintField(5,t))}_Q();const zQ=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array];function OQ(t,e=64,n=Float64Array,r){if(isNaN(t)||t<0)throw new Error(`Unpexpected numItems value: ${t}.`);this.numItems=+t,this.nodeSize=Math.min(Math.max(+e,2),65535),this.ArrayType=n,this.IndexArrayType=t<65536?Uint16Array:Uint32Array;const i=zQ.indexOf(this.ArrayType),o=2*t*this.ArrayType.BYTES_PER_ELEMENT,a=t*this.IndexArrayType.BYTES_PER_ELEMENT,s=(8-a%8)%8;if(i<0)throw new Error(`Unexpected typed array class: ${n}.`);r&&r instanceof ArrayBuffer?(this.data=r,this.ids=new this.IndexArrayType(this.data,8,t),this.coords=new this.ArrayType(this.data,8+a+s,2*t),this._pos=2*t,this._finished=!0):(this.data=new ArrayBuffer(8+o+a+s),this.ids=new this.IndexArrayType(this.data,8,t),this.coords=new this.ArrayType(this.data,8+a+s,2*t),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,16+i]),new Uint16Array(this.data,2,1)[0]=e,new Uint32Array(this.data,4,1)[0]=t)}function NQ(t,e,n,r,i,o){if(i-r<=n)return;const a=r+i>>1;LQ(t,e,a,r,i,o),NQ(t,e,n,r,a-1,1-o),NQ(t,e,n,a+1,i,1-o)}function LQ(t,e,n,r,i,o){for(;i>r;){if(i-r>600){const a=i-r+1,s=n-r+1,c=Math.log(a),l=.5*Math.exp(2*c/3),u=.5*Math.sqrt(c*l*(a-l)/a)*(s-a/2<0?-1:1);LQ(t,e,n,Math.max(r,Math.floor(n-s*l/a+u)),Math.min(i,Math.floor(n+(a-s)*l/a+u)),o)}const a=e[2*n+o];let s=r,c=i;for(QQ(t,e,r,n),e[2*i+o]>a&&QQ(t,e,r,i);s<c;){for(QQ(t,e,s,c),s++,c--;e[2*s+o]<a;)s++;for(;e[2*c+o]>a;)c--}e[2*r+o]===a?QQ(t,e,r,c):(c++,QQ(t,e,c,i)),c<=n&&(r=c+1),n<=c&&(i=c-1)}}function QQ(t,e,n,r){FQ(t,n,r),FQ(e,2*n,2*r),FQ(e,2*n+1,2*r+1)}function FQ(t,e,n){const r=t[e];t[e]=t[n],t[n]=r}function PQ(t,e,n,r){const i=t-n,o=e-r;return i*i+o*o}function kQ(t,e,n,r,i,o){var a=i-n,s=o-r,c={x:t-.5*a,y:e-.5*s,width:a,height:s},l={x:n,y:r,width:a,height:s},u=c.x,h=c.y,f=l.x,d=l.y;return!(u>f+l.width||u+c.width<f||h+c.height<d||h>d+l.height)}OQ.prototype.add=function(t,e){const n=this._pos>>1;return this.ids[n]=n,this.coords[this._pos++]=t,this.coords[this._pos++]=e,n},OQ.prototype.finish=function(){const t=this._pos>>1;if(t!==this.numItems)throw new Error(`Added ${t} items when expected ${this.numItems}.`);return NQ(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this},OQ.prototype.range=function(t,e,n,r){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:i,coords:o,nodeSize:a}=this,s=[0,i.length-1,0],c=[];for(;s.length;){const l=s.pop()||0,u=s.pop()||0,h=s.pop()||0;if(u-h<=a){for(let a=h;a<=u;a++){const s=o[2*a],l=o[2*a+1];s>=t&&s<=n&&l>=e&&l<=r&&c.push(i[a])}continue}const f=h+u>>1,d=o[2*f],p=o[2*f+1];d>=t&&d<=n&&p>=e&&p<=r&&c.push(i[f]),(0===l?t<=d:e<=p)&&(s.push(h),s.push(f-1),s.push(1-l)),(0===l?n>=d:r>=p)&&(s.push(f+1),s.push(u),s.push(1-l))}return c},OQ.prototype.within=function(t,e,n){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:r,coords:i,nodeSize:o}=this,a=[0,r.length-1,0],s=[],c=n*n;for(;a.length;){const l=a.pop()||0,u=a.pop()||0,h=a.pop()||0;if(u-h<=o){for(let n=h;n<=u;n++)PQ(i[2*n],i[2*n+1],t,e)<=c&&s.push(r[n]);continue}const f=h+u>>1,d=i[2*f],p=i[2*f+1];PQ(d,p,t,e)<=c&&s.push(r[f]),(0===l?t-n<=d:e-n<=p)&&(a.push(h),a.push(f-1),a.push(1-l)),(0===l?t+n>=d:e+n>=p)&&(a.push(f+1),a.push(u),a.push(1-l))}return s},OQ.prototype.intersect=function(t,e,n,r,i){const{ids:o,coords:a,nodeSize:s}=this;var c,l,u=[0,o.length-1,0],h=[];for(i=i||kQ;u.length;){var f=u.pop(),d=u.pop(),p=u.pop();if(d-p<=s)for(var A=p;A<=d;A++)i(c=a[2*A],l=a[2*A+1],t,e,n,r,A,o[A])&&h.push(o[A]);else{var g=p+d>>1;i(c=a[2*g],l=a[2*g+1],t,e,n,r,g,o[g])&&h.push(o[g]);var m=1-f;(0===f?t<=c:e<=l)&&(u.push(p),u.push(g-1),u.push(m)),(0===f?n>=c:r>=l)&&(u.push(g+1),u.push(d),u.push(m))}}return h},OQ.from=function(t){if(!(t instanceof ArrayBuffer))throw new Error("Data must be an instance of ArrayBuffer.");const[e,n]=new Uint8Array(t,0,2);if(219!==e)throw new Error("Data does not appear to be in a KDBush format.");const r=n>>4;if(1!==r)throw new Error(`Got v${r} data when expected v1.`);const i=zQ[15&n];if(!i)throw new Error("Unrecognized array type.");const[o]=new Uint16Array(t,2,1),[a]=new Uint32Array(t,4,1);return new OQ(a,o,i,t)};const UQ=function(){let t=!0;return function(e,n){const r=t?function(){if(n){const t=n.apply(e,arguments);return n=null,t}}:function(){};return t=!1,r}}(),jQ=UQ(void 0,(function(){return jQ.toString().search("(((.+)+)+)+$").toString().constructor(jQ).search("(((.+)+)+)+$")}));jQ();const GQ={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:t=>t},HQ=Math.fround||(qQ=new Float32Array(1),t=>(qQ[0]=+t,qQ[0]));var qQ;class VQ{constructor(t){this.options=Object.assign(Object.create(GQ),t),this.trees=new Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[]}load(t){const{log:e,minZoom:n,maxZoom:r}=this.options;e&&console.time("total time");const i="prepare "+t.length+" points";e&&console.time(i),this.points=t;const o=[];for(let e=0;e<t.length;e++){const n=t[e];if(!n.geometry)continue;const[r,i]=n.geometry.coordinates,a=HQ(WQ(r)),s=HQ(XQ(i));o.push(a,s,1/0,e,-1,1),this.options.reduce&&o.push(0)}let a=this.trees[r+1]=this._createTree(o);e&&console.timeEnd(i);for(let t=r;t>=n;t--){const n=+Date.now();a=this.trees[t]=this._createTree(this._cluster(a,t)),e&&console.log("z%d: %d clusters in %dms",t,a.numItems,+Date.now()-n)}return e&&console.timeEnd("total time"),this}getClusters(t,e){let n=((t[0]+180)%360+360)%360-180;const r=Math.max(-90,Math.min(90,t[1]));let i=180===t[2]?180:((t[2]+180)%360+360)%360-180;const o=Math.max(-90,Math.min(90,t[3]));if(t[2]-t[0]>=360)n=-180,i=180;else if(n>i){const t=this.getClusters([n,r,180,o],e),a=this.getClusters([-180,r,i,o],e);return t.concat(a)}const a=this.trees[this._limitZoom(e)],s=a.range(WQ(n),XQ(o),WQ(i),XQ(r)),c=a.data,l=[];for(const t of s){const e=this.stride*t;l.push(c[e+5]>1?YQ(c,e,this.clusterProps):this.points[c[e+3]])}return l}getChildren(t){const e=this._getOriginId(t),n=this._getOriginZoom(t),r="No cluster with the specified id.",i=this.trees[n];if(!i)throw new Error(r);const o=i.data;if(e*this.stride>=o.length)throw new Error(r);const a=this.options.radius/(this.options.extent*Math.pow(2,n-1)),s=o[e*this.stride],c=o[e*this.stride+1],l=i.within(s,c,a),u=[];for(const e of l){const n=e*this.stride;o[n+4]===t&&u.push(o[n+5]>1?YQ(o,n,this.clusterProps):this.points[o[n+3]])}if(0===u.length)throw new Error(r);return u}getLeaves(t,e,n){e=e||10,n=n||0;const r=[];return this._appendLeaves(r,t,e,n,0),r}getTile(t,e,n){const r=this.trees[this._limitZoom(t)],i=Math.pow(2,t),{extent:o,radius:a}=this.options,s=a/o,c=(n-s)/i,l=(n+1+s)/i,u={features:[]};return this._addTileFeatures(r.range((e-s)/i,c,(e+1+s)/i,l),r.data,e,n,i,u),0===e&&this._addTileFeatures(r.range(1-s/i,c,1,l),r.data,i,n,i,u),e===i-1&&this._addTileFeatures(r.range(0,c,s/i,l),r.data,-1,n,i,u),u.features.length?u:null}getClusterExpansionZoom(t){let e=this._getOriginZoom(t)-1;for(;e<=this.options.maxZoom;){const n=this.getChildren(t);if(e++,1!==n.length)break;t=n[0].properties.cluster_id}return e}_appendLeaves(t,e,n,r,i){const o=this.getChildren(e);for(const e of o){const o=e.properties;if(o&&o.cluster?i+o.point_count<=r?i+=o.point_count:i=this._appendLeaves(t,o.cluster_id,n,r,i):i<r?i++:t.push(e),t.length===n)break}return i}_createTree(t){const e=new OQ(t.length/this.stride|0,this.options.nodeSize,Float32Array);for(let n=0;n<t.length;n+=this.stride)e.add(t[n],t[n+1]);return e.finish(),e.data=t,e}_addTileFeatures(t,e,n,r,i,o){for(const a of t){const t=a*this.stride,s=e[t+5]>1;let c,l,u;if(s)c=KQ(e,t,this.clusterProps),l=e[t],u=e[t+1];else{const n=this.points[e[t+3]];c=n.properties;const[r,i]=n.geometry.coordinates;l=WQ(r),u=XQ(i)}const h={type:1,geometry:[[Math.round(this.options.extent*(l*i-n)),Math.round(this.options.extent*(u*i-r))]],tags:c};let f;f=s||this.options.generateId?e[t+3]:this.points[e[t+3]].id,void 0!==f&&(h.id=f),o.features.push(h)}}_limitZoom(t){return Math.max(this.options.minZoom,Math.min(Math.floor(+t),this.options.maxZoom+1))}_cluster(t,e){const{radius:n,extent:r,reduce:i,minPoints:o}=this.options,a=n/(r*Math.pow(2,e)),s=t.data,c=[],l=this.stride;for(let n=0;n<s.length;n+=l){if(s[n+2]<=e)continue;s[n+2]=e;const r=s[n],u=s[n+1],h=t.within(s[n],s[n+1],a),f=s[n+5];let d=f;for(const t of h){const n=t*l;s[n+2]>e&&(d+=s[n+5])}if(d>f&&d>=o){let t,o=r*f,a=u*f,p=-1;const A=(n/l<<5)+(e+1)+this.points.length;for(const r of h){const c=r*l;if(s[c+2]<=e)continue;s[c+2]=e;const u=s[c+5];o+=s[c]*u,a+=s[c+1]*u,s[c+4]=A,i&&(!t&&(t=this._map(s,n,!0),p=this.clusterProps.length,this.clusterProps.push(t)),i(t,this._map(s,c)))}s[n+4]=A,c.push(o/d,a/d,1/0,A,-1,d),i&&c.push(p)}else{for(let t=0;t<l;t++)c.push(s[n+t]);if(d>1)for(const t of h){const n=t*l;if(!(s[n+2]<=e)){s[n+2]=e;for(let t=0;t<l;t++)c.push(s[n+t])}}}}return c}_getOriginId(t){return t-this.points.length>>5}_getOriginZoom(t){return(t-this.points.length)%32}_map(t,e,n){if(t[e+5]>1){const r=this.clusterProps[t[e+6]];return n?Object.assign({},r):r}const r=this.points[t[e+3]].properties,i=this.options.map(r);return n&&i===r?Object.assign({},i):i}}function YQ(t,e,n){return{type:"Feature",id:t[e+3],properties:KQ(t,e,n),geometry:{type:"Point",coordinates:[(r=t[e],360*(r-.5)),JQ(t[e+1])]}};var r}function KQ(t,e,n){const r=t[e+5],i=r>=1e4?Math.round(r/1e3)+"k":r>=1e3?Math.round(r/100)/10+"k":r,o=t[e+6],a=-1===o?{}:Object.assign({},n[o]);return Object.assign(a,{cluster:!0,cluster_id:t[e+3],point_count:r,point_count_abbreviated:i})}function WQ(t){return t/360+.5}function XQ(t){const e=Math.sin(t*Math.PI/180),n=.5-.25*Math.log((1+e)/(1-e))/Math.PI;return n<0?0:n>1?1:n}function JQ(t){const e=(180-360*t)*Math.PI/180;return 360*Math.atan(Math.exp(e))/Math.PI-90}var ZQ,$Q=(ZQ=!0,function(t,e){var n=ZQ?function(){if(e){var n=e.apply(t,arguments);return e=null,n}}:function(){};return ZQ=!1,n}),tF=$Q(void 0,(function(){return tF.toString().search("(((.+)+)+)+$").toString().constructor(tF).search("(((.+)+)+)+$")}));function eF(t,e,n,r){for(var i,o=r,a=n-e>>1,s=n-e,c=t[e],l=t[e+1],u=t[n],h=t[n+1],f=e+3;f<n;f+=3){var d=nF(t[f],t[f+1],c,l,u,h);if(d>o)i=f,o=d;else if(d===o){var p=Math.abs(f-a);p<s&&(i=f,s=p)}}o>r&&(i-e>3&&eF(t,e,i,r),t[i+2]=o,n-i>3&&eF(t,i,n,r))}function nF(t,e,n,r,i,o){var a=i-n,s=o-r;if(0!==a||0!==s){var c=((t-n)*a+(e-r)*s)/(a*a+s*s);c>1?(n=i,r=o):c>0&&(n+=a*c,r+=s*c)}return(a=t-n)*a+(s=e-r)*s}tF();var rF,iF=(rF=!0,function(t,e){var n=rF?function(){if(e){var n=e.apply(t,arguments);return e=null,n}}:function(){};return rF=!1,n}),oF=iF(void 0,(function(){return oF.toString().search("(((.+)+)+)+$").toString().constructor(oF).search("(((.+)+)+)+$")}));function aF(t,e,n,r){var i={id:void 0===t?null:t,type:e,geometry:n,tags:r,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};return function(t){var e=t.geometry,n=t.type;if("Point"===n||"MultiPoint"===n||"LineString"===n)sF(t,e);else if("Polygon"===n||"MultiLineString"===n)for(var r=0;r<e.length;r++)sF(t,e[r]);else if("MultiPolygon"===n)for(r=0;r<e.length;r++)for(var i=0;i<e[r].length;i++)sF(t,e[r][i])}(i),i}function sF(t,e){for(var n=0;n<e.length;n+=3)t.minX=Math.min(t.minX,e[n]),t.minY=Math.min(t.minY,e[n+1]),t.maxX=Math.max(t.maxX,e[n]),t.maxY=Math.max(t.maxY,e[n+1])}oF();var cF,lF=(cF=!0,function(t,e){var n=cF?function(){if(e){var n=e.apply(t,arguments);return e=null,n}}:function(){};return cF=!1,n}),uF=lF(void 0,(function(){return uF.toString().search("(((.+)+)+)+$").toString().constructor(uF).search("(((.+)+)+)+$")}));function hF(t,e,n,r,i){if(e.geometry){var o=e.geometry.coordinates,a=e.geometry.type,s=Math.pow(n.tolerance/((1<<n.maxZoom)*n.extent),2),c=[],l=e.id;if(n.promoteId?l=e.properties[n.promoteId]:n.generateId&&(l=r||0),"Point"===a)fF(o,c,i);else if("MultiPoint"===a)for(var u=0;u<o.length;u++)fF(o[u],c,i);else if("LineString"===a)dF(o,c,s,!1,i);else if("MultiLineString"===a){if(n.lineMetrics){for(u=0;u<o.length;u++)c=[],dF(o[u],c,s,!1,i),t.push(aF(l,"LineString",c,e.properties));return}pF(o,c,s,!1,i)}else if("Polygon"===a)pF(o,c,s,!0,i);else{if("MultiPolygon"!==a){if("GeometryCollection"===a){for(u=0;u<e.geometry.geometries.length;u++)hF(t,{id:l,geometry:e.geometry.geometries[u],properties:e.properties},n,r,i);return}throw new Error("Input data is not a valid GeoJSON object.")}for(u=0;u<o.length;u++){var h=[];pF(o[u],h,s,!0,i),c.push(h)}}t.push(aF(l,a,c,e.properties))}}function fF(t,e,n){var{x:r,y:i}=n.fromLngLat(t);e.push(r,i),e.push(0)}function dF(t,e,n,r,i){for(var o,a,s=0,c=0;c<t.length;c++){var{x:l,y:u}=i.fromLngLat(t[c]);e.push(l,u),e.push(0),c>0&&(s+=r?(o*u-l*a)/2:Math.sqrt(Math.pow(l-o,2)+Math.pow(u-a,2))),o=l,a=u}var h=e.length-3;e[2]=1,eF(e,0,h,n),e[h+2]=1,e.size=Math.abs(s),e.start=0,e.end=e.size}function pF(t,e,n,r,i){for(var o=0;o<t.length;o++){var a=[];dF(t[o],a,n,r,i),e.push(a)}}uF();var AF,gF=(AF=!0,function(t,e){var n=AF?function(){if(e){var n=e.apply(t,arguments);return e=null,n}}:function(){};return AF=!1,n}),mF=gF(void 0,(function(){return mF.toString().search("(((.+)+)+)+$").toString().constructor(mF).search("(((.+)+)+)+$")}));function yF(t,e,n,r,i,o,a,s){if(r/=e,o>=(n/=e)&&a<r)return t;if(a<n||o>=r)return null;for(var c=[],l=0;l<t.length;l++){var u=t[l],h=u.geometry,f=u.type,d=0===i?u.minX:u.minY,p=0===i?u.maxX:u.maxY;if(d>=n&&p<r)c.push(u);else if(!(p<n||d>=r)){var A=[];if("Point"===f||"MultiPoint"===f)vF(h,A,n,r,i);else if("LineString"===f)CF(h,A,n,r,i,!1,s.lineMetrics);else if("MultiLineString"===f)xF(h,A,n,r,i,!1);else if("Polygon"===f)xF(h,A,n,r,i,!0);else if("MultiPolygon"===f)for(var g=0;g<h.length;g++){var m=[];xF(h[g],m,n,r,i,!0),m.length&&A.push(m)}if(A.length){if(s.lineMetrics&&"LineString"===f){for(g=0;g<A.length;g++)c.push(aF(u.id,f,A[g],u.tags));continue}("LineString"===f||"MultiLineString"===f)&&(1===A.length?(f="LineString",A=A[0]):f="MultiLineString"),("Point"===f||"MultiPoint"===f)&&(f=3===A.length?"Point":"MultiPoint"),c.push(aF(u.id,f,A,u.tags))}}}return c.length?c:null}function vF(t,e,n,r,i){for(var o=0;o<t.length;o+=3){var a=t[o+i];a>=n&&a<=r&&(e.push(t[o]),e.push(t[o+1]),e.push(t[o+2]))}}function CF(t,e,n,r,i,o,a){for(var s,c,l=IF(t),u=0===i?_F:bF,h=t.start,f=0;f<t.length-3;f+=3){var d=t[f],p=t[f+1],A=t[f+2],g=t[f+3],m=t[f+4],y=0===i?d:p,v=0===i?g:m,C=!1;a&&(s=Math.sqrt(Math.pow(d-g,2)+Math.pow(p-m,2))),y<n?v>n&&(c=u(l,d,p,g,m,n),a&&(l.start=h+s*c)):y>r?v<r&&(c=u(l,d,p,g,m,r),a&&(l.start=h+s*c)):EF(l,d,p,A),v<n&&y>=n&&(c=u(l,d,p,g,m,n),C=!0),v>r&&y<=r&&(c=u(l,d,p,g,m,r),C=!0),!o&&C&&(a&&(l.end=h+s*c),e.push(l),l=IF(t)),a&&(h+=s)}var I=t.length-3;d=t[I],p=t[I+1],A=t[I+2],(y=0===i?d:p)>=n&&y<=r&&EF(l,d,p,A),I=l.length-3,o&&I>=3&&(l[I]!==l[0]||l[I+1]!==l[1])&&EF(l,l[0],l[1],l[2]),l.length&&e.push(l)}function IF(t){var e=[];return e.size=t.size,e.start=t.start,e.end=t.end,e}function xF(t,e,n,r,i,o){for(var a=0;a<t.length;a++)CF(t[a],e,n,r,i,o,!1)}function EF(t,e,n,r){t.push(e),t.push(n),t.push(r)}function _F(t,e,n,r,i,o){var a=(o-e)/(r-e);return t.push(o),t.push(n+(i-n)*a),t.push(1),a}function bF(t,e,n,r,i,o){var a=(o-n)/(i-n);return t.push(e+(r-e)*a),t.push(o),t.push(1),a}mF();var wF,MF=(wF=!0,function(t,e){var n=wF?function(){if(e){var n=e.apply(t,arguments);return e=null,n}}:function(){};return wF=!1,n}),TF=MF(void 0,(function(){return TF.toString().search("(((.+)+)+)+$").toString().constructor(TF).search("(((.+)+)+)+$")}));function BF(t,e){for(var n=[],r=0;r<t.length;r++){var i,o=t[r],a=o.type;if("Point"===a||"MultiPoint"===a||"LineString"===a)i=SF(o.geometry,e);else if("MultiLineString"===a||"Polygon"===a){i=[];for(var s=0;s<o.geometry.length;s++)i.push(SF(o.geometry[s],e))}else if("MultiPolygon"===a)for(i=[],s=0;s<o.geometry.length;s++){for(var c=[],l=0;l<o.geometry[s].length;l++)c.push(SF(o.geometry[s][l],e));i.push(c)}n.push(aF(o.id,a,i,o.tags))}return n}function SF(t,e){var n=[];n.size=t.size,void 0!==t.start&&(n.start=t.start,n.end=t.end);for(var r=0;r<t.length;r+=3)n.push(t[r]+e,t[r+1],t[r+2]);return n}TF();var DF,RF=(DF=!0,function(t,e){var n=DF?function(){if(e){var n=e.apply(t,arguments);return e=null,n}}:function(){};return DF=!1,n}),zF=RF(void 0,(function(){return zF.toString().search("(((.+)+)+)+$").toString().constructor(zF).search("(((.+)+)+)+$")}));function OF(t,e){if(t.transformed)return t;var n,r,i,o=1<<t.z,a=t.x,s=t.y;for(n=0;n<t.features.length;n++){var c=t.features[n],l=c.geometry,u=c.type;if(c.geometry=[],1===u)for(r=0;r<l.length;r+=2)c.geometry.push(NF(l[r],l[r+1],e,o,a,s));else for(r=0;r<l.length;r++){var h=[];for(i=0;i<l[r].length;i+=2)h.push(NF(l[r][i],l[r][i+1],e,o,a,s));c.geometry.push(h)}}return t.transformed=!0,t}function NF(t,e,n,r,i,o){return[Math.round(n*(t*r-i)),Math.round(n*(e*r-o))]}zF();var LF,QF=(LF=!0,function(t,e){var n=LF?function(){if(e){var n=e.apply(t,arguments);return e=null,n}}:function(){};return LF=!1,n}),FF=QF(void 0,(function(){return FF.toString().search("(((.+)+)+)+$").toString().constructor(FF).search("(((.+)+)+)+$")}));function PF(t,e,n,r,i){for(var o=e===i.maxZoom?0:i.tolerance/((1<<e)*i.extent),a={features:[],numPoints:0,numSimplified:0,numFeatures:0,source:null,x:n,y:r,z:e,transformed:!1,minX:2,minY:1,maxX:-1,maxY:0},s=0;s<t.length;s++){a.numFeatures++,kF(a,t[s],o,i);var c=t[s].minX,l=t[s].minY,u=t[s].maxX,h=t[s].maxY;c<a.minX&&(a.minX=c),l<a.minY&&(a.minY=l),u>a.maxX&&(a.maxX=u),h>a.maxY&&(a.maxY=h)}return a}function kF(t,e,n,r){var i=e.geometry,o=e.type,a=[];if("Point"===o||"MultiPoint"===o)for(var s=0;s<i.length;s+=3)a.push(i[s]),a.push(i[s+1]),t.numPoints++,t.numSimplified++;else if("LineString"===o)UF(a,i,t,n,!1,!1);else if("MultiLineString"===o||"Polygon"===o)for(s=0;s<i.length;s++)UF(a,i[s],t,n,"Polygon"===o,0===s);else if("MultiPolygon"===o)for(var c=0;c<i.length;c++){var l=i[c];for(s=0;s<l.length;s++)UF(a,l[s],t,n,!0,0===s)}if(a.length){var u=e.tags||null;if("LineString"===o&&r.lineMetrics){for(var h in u={},e.tags)u[h]=e.tags[h];u.mapbox_clip_start=i.start/i.size,u.mapbox_clip_end=i.end/i.size}var f={geometry:a,type:"Polygon"===o||"MultiPolygon"===o?3:"LineString"===o||"MultiLineString"===o?2:1,tags:u};null!==e.id&&(f.id=e.id),t.features.push(f)}}function UF(t,e,n,r,i,o){var a=r*r;if(r>0&&e.size<(i?a:r))n.numPoints+=e.length/3;else{for(var s=[],c=0;c<e.length;c+=3)(0===r||e[c+2]>a)&&(n.numSimplified++,s.push(e[c]),s.push(e[c+1])),n.numPoints++;i&&function(t,e){for(var n=0,r=0,i=t.length,o=i-2;r<i;o=r,r+=2)n+=(t[r]-t[o])*(t[r+1]+t[o+1]);if(n>0===e)for(r=0,i=t.length;r<i/2;r+=2){var a=t[r],s=t[r+1];t[r]=t[i-2-r],t[r+1]=t[i-1-r],t[i-2-r]=a,t[i-1-r]=s}}(s,o),t.push(s)}}FF();var jF,GF=(jF=!0,function(t,e){var n=jF?function(){if(e){var n=e.apply(t,arguments);return e=null,n}}:function(){};return jF=!1,n}),HF=GF(void 0,(function(){return HF.toString().search("(((.+)+)+)+$").toString().constructor(HF).search("(((.+)+)+)+$")}));function qF(t,e){var n=(e=this.options=function(t,e){for(var n in e)t[n]=e[n];return t}(Object.create(this.options),e)).debug;if(n&&console.time("preprocess data"),e.maxZoom<0||e.maxZoom>24)throw new Error("maxZoom should be in the 0-24 range");if(e.promoteId&&e.generateId)throw new Error("promoteId and generateId cannot be used together.");var r,i,o,a,s,c,l=function(t,e){var n=[],r=e.epsgCode||3857,i=XR.fromEpsgCode(r);if("FeatureCollection"===t.type)for(var o=0;o<t.features.length;o++)hF(n,t.features[o],e,o,i);else"Feature"===t.type?hF(n,t,e,void 0,i):hF(n,{geometry:t},e,void 0,i);return n}(t,e);this.tiles={},this.tileCoords=[],n&&(console.timeEnd("preprocess data"),console.log("index: maxZoom: %d, maxPoints: %d",e.indexMaxZoom,e.indexMaxPoints),console.time("generate tiles"),this.stats={},this.total=0),r=l,o=(i=e).buffer/i.extent,a=r,s=yF(r,1,-1-o,o,0,-1,2,i),c=yF(r,1,1-o,2+o,0,-1,2,i),(s||c)&&(a=yF(r,1,-o,1+o,0,-1,2,i)||[],s&&(a=BF(s,1).concat(a)),c&&(a=a.concat(BF(c,-1)))),(l=a).length&&this.splitTile(l,0,0,0),n&&(l.length&&console.log("features: %d, points: %d",this.tiles[0].numFeatures,this.tiles[0].numPoints),console.timeEnd("generate tiles"),console.log("tiles generated:",this.total,JSON.stringify(this.stats)))}function VF(t,e,n){return 32*((1<<t)*n+e)+t}HF(),qF.prototype.options={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,debug:0},qF.prototype.splitTile=function(t,e,n,r,i,o,a){for(var s=[t,e,n,r],c=this.options,l=c.debug;s.length;){r=s.pop(),n=s.pop(),e=s.pop(),t=s.pop();var u=1<<e,h=VF(e,n,r),f=this.tiles[h];if(!f&&(l>1&&console.time("creation"),f=this.tiles[h]=PF(t,e,n,r,c),this.tileCoords.push({z:e,x:n,y:r}),l)){l>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",e,n,r,f.numFeatures,f.numPoints,f.numSimplified),console.timeEnd("creation"));var d="z"+e;this.stats[d]=(this.stats[d]||0)+1,this.total++}if(f.source=t,i){if(e===c.maxZoom||e===i)continue;var p=1<<i-e;if(n!==Math.floor(o/p)||r!==Math.floor(a/p))continue}else if(e===c.indexMaxZoom||f.numPoints<=c.indexMaxPoints)continue;if(f.source=null,0!==t.length){l>1&&console.time("clipping");var A,g,m,y,v,C,I=.5*c.buffer/c.extent,x=.5-I,E=.5+I,_=1+I;A=g=m=y=null,v=yF(t,u,n-I,n+E,0,f.minX,f.maxX,c),C=yF(t,u,n+x,n+_,0,f.minX,f.maxX,c),t=null,v&&(A=yF(v,u,r-I,r+E,1,f.minY,f.maxY,c),g=yF(v,u,r+x,r+_,1,f.minY,f.maxY,c),v=null),C&&(m=yF(C,u,r-I,r+E,1,f.minY,f.maxY,c),y=yF(C,u,r+x,r+_,1,f.minY,f.maxY,c),C=null),l>1&&console.timeEnd("clipping"),s.push(A||[],e+1,2*n,2*r),s.push(g||[],e+1,2*n,2*r+1),s.push(m||[],e+1,2*n+1,2*r),s.push(y||[],e+1,2*n+1,2*r+1)}}},qF.prototype.getTile=function(t,e,n){var r=this.options,i=r.extent,o=r.debug;if(t<0||t>24)return null;var a=1<<t,s=VF(t,e=(e%a+a)%a,n);if(this.tiles[s])return OF(this.tiles[s],i);o>1&&console.log("drilling down to z%d-%d-%d",t,e,n);for(var c,l=t,u=e,h=n;!c&&l>0;)l--,u=Math.floor(u/2),h=Math.floor(h/2),c=this.tiles[VF(l,u,h)];return c&&c.source?(o>1&&console.log("found parent tile z%d-%d-%d",l,u,h),o>1&&console.time("drilling down"),this.splitTile(c.source,l,u,h,t,e,n),o>1&&console.timeEnd("drilling down"),this.tiles[s]?OF(this.tiles[s],i):null):null};const YF=function(){let t=!0;return function(e,n){const r=t?function(){if(n){const t=n.apply(e,arguments);return n=null,t}}:function(){};return t=!1,r}}(),KF=YF(void 0,(function(){return KF.toString().search("(((.+)+)+)+$").toString().constructor(KF).search("(((.+)+)+)+$")}));function WF(t,e){const n=t.tileID.canonical;if(!this._geoJSONIndex)return e(null,null);const r=this._geoJSONIndex.getTile(n.z,n.x,n.y);if(!r)return e(null,null);const i=new yQ(r.features);let o=bQ(i);(0!==o.byteOffset||o.byteLength!==o.buffer.byteLength)&&(o=new Uint8Array(o)),e(null,{vectorTile:i,rawData:o.buffer})}KF();class XF extends cQ{constructor(t,e,n,r,i){super(t,e,n,r,WF),i&&(this.loadGeoJSON=i)}loadData(t,e){const n=t&&t.request;n&&n.collectResourceTiming,this.loadGeoJSON(t,((n,r)=>{if(n||!r)return e(n);if("object"!=typeof r)return e(new Error("Input data given to '"+t.source+"' is not a valid GeoJSON object."));fQ(r,!0);try{if(t.filter){const e=br(t.filter,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if("error"===e.result)throw new Error(e.value.map((t=>t.key+": "+t.message)).join(", "));const n=r.features.filter((t=>e.value.evaluate({zoom:0},t)));r={type:"FeatureCollection",features:n}}t.geojsonVtOptions.epsgCode=t.epsgCode,this._geoJSONIndex=t.cluster?new VQ(function({superclusterOptions:t,clusterProperties:e}){if(!e||!t)return t;const n={},r={},i={accumulated:null,zoom:0},o={properties:null},a=Object.keys(e);for(const t of a){const[i,o]=e[t],a=br(o),s=br("string"==typeof i?[i,["accumulated"],["get",t]]:i);n[t]=a.value,r[t]=s.value}return t.map=t=>{o.properties=t;const e={};for(const t of a)e[t]=n[t].evaluate(i,o);return e},t.reduce=(t,e)=>{o.properties=e;for(const e of a)i.accumulated=t[e],t[e]=r[e].evaluate(i,o)},t}(t)).load(r.features):(i=r,o=t.geojsonVtOptions,new qF(i,o))}catch(t){return e(t)}this.loaded={};e(null,{});var i,o}))}reloadTile(t,e){const n=this.loaded,r=t.uid;return n&&n[r]?super.reloadTile(t,e):this.loadTile(t,e)}loadGeoJSON(t,e){if(t.request)n=t.request,r=e,oA(Lp(n,{type:"json"}),r);else{if("string"!=typeof t.data)return e(new Error("Input data given to '"+t.source+"' is not a valid GeoJSON object."));try{return e(null,JSON.parse(t.data))}catch(n){return e(new Error("Input data given to '"+t.source+"' is not a valid GeoJSON object."))}}var n,r}getClusterExpansionZoom(t,e){try{e(null,this._geoJSONIndex.getClusterExpansionZoom(t.clusterId))}catch(t){e(t)}}getClusterChildren(t,e){try{e(null,this._geoJSONIndex.getChildren(t.clusterId))}catch(t){e(t)}}getClusterLeaves(t,e){try{e(null,this._geoJSONIndex.getLeaves(t.clusterId,t.limit,t.offset))}catch(t){e(t)}}}const JF=function(){let t=!0;return function(e,n){const r=t?function(){if(n){const t=n.apply(e,arguments);return n=null,t}}:function(){};return t=!1,r}}(),ZF=JF(void 0,(function(){return ZF.toString().search("(((.+)+)+)+$").toString().constructor(ZF).search("(((.+)+)+)+$")}));ZF();"undefined"!=typeof WorkerGlobalScope&&"undefined"!=typeof self&&self instanceof WorkerGlobalScope&&(self.worker=new class{constructor(t){this.self=t,this.actor=new mA(t,this),this.layerIndexes={},this.availableImages={},this.isSpriteLoaded={},this.projections={},this.coordinateReferenceSystems={},this.defaultProjection=Xz({name:"mercator"}),this.defaultCrs=XR.EPSG3857,this.webgpu=!1,this.workerSourceTypes={vector:cQ,geojson:XF},this.workerSources={},this.demWorkerSources={}}clearCaches(t,e,n){delete this.layerIndexes[t],delete this.availableImages[t],delete this.workerSources[t],n()}checkIfReady(t,e,n){n()}setReferrer(t,e){this.referrer=e}spriteLoaded(t,e){this.isSpriteLoaded[t]=e;for(const n in this.workerSources[t]){const r=this.workerSources[t][n];for(const t in r)r[t]instanceof cQ&&(r[t].isSpriteLoaded=e,r[t].fire(new CA("isSpriteLoaded")))}}setImages(t,e,n){this.availableImages[t]=e,n()}enableTerrain(t,e,n){this.terrain=e,n()}setProjection(t,e){this.projections[t]=Xz(e)}setCrs(t,e){let n=XR.fromEpsgCode(e.epsgCode,e.WKT,e.extent);(n.extent[2]!=e.extent[2]||n.extent[3]!=e.extent[3])&&(n=new XR(e.epsgCode,e.extent)),this.coordinateReferenceSystems[t]=n,this.setSceneMode(t,e.sceneMode)}setSceneMode(t,e){this.coordinateReferenceSystems[t].sceneMode=e}setLayers(t,e,n){this.getLayerIndex(t).replace(e),n()}updateLayers(t,e,n){this.getLayerIndex(t).update(e.layers,e.removedIds),n()}loadTile(t,e,n){const r=e;r.projection=this.projections[t]||this.defaultProjection,r.crs=this.coordinateReferenceSystems[t]||this.defaultCrs,r.webgpu=this.webgpu,this.getWorkerSource(t,e.type,e.source).loadTile(r,n)}reloadTile(t,e,n){const r=e;r.projection=this.projections[t]||this.defaultProjection,r.crs=this.coordinateReferenceSystems[t]||this.defaultCrs,r.webgpu=this.webgpu,this.getWorkerSource(t,e.type,e.source).reloadTile(e,n)}abortTile(t,e,n){this.getWorkerSource(t,e.type,e.source).abortTile(e,n)}removeTile(t,e,n){this.getWorkerSource(t,e.type,e.source).removeTile(e,n)}removeSource(t,e,n){if(!this.workerSources[t]||!this.workerSources[t][e.type]||!this.workerSources[t][e.type][e.source])return;const r=this.workerSources[t][e.type][e.source];delete this.workerSources[t][e.type][e.source],void 0!==r.removeSource?r.removeSource(e,n):n()}loadWorkerSource(t,e,n){try{this.self.importScripts(e.url),n()}catch(t){n(t.toString())}}getAvailableImages(t){let e=this.availableImages[t];return!e&&(e=[]),e}getLayerIndex(t){let e=this.layerIndexes[t];return!e&&(e=this.layerIndexes[t]=new JO),e}getWorkerSource(t,e,n){if(this.workerSources[t]||(this.workerSources[t]={}),this.workerSources[t][e]||(this.workerSources[t][e]={}),!this.workerSources[t][e][n]){const r={send:(e,n,r)=>{this.actor.send(e,n,r,t)}};!this.workerSourceTypes[e]&&console.log("no "+e),this.workerSources[t][e][n]=new this.workerSourceTypes[e](r,this.getLayerIndex(t),this.getAvailableImages(t),this.isSpriteLoaded[t])}return this.workerSources[t][e][n]}enforceCacheSizeLimit(t,e){}setUseWebgpu(t,e){this.webgpu=e}}(self))}));
|