@deck.gl/geo-layers 8.9.32 → 8.9.34
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/dist.dev.js +5 -5
- package/dist/es5/terrain-layer/terrain-layer.js +4 -0
- package/dist/es5/terrain-layer/terrain-layer.js.map +1 -1
- package/dist/es5/tile-3d-layer/tile-3d-layer.js +11 -8
- package/dist/es5/tile-3d-layer/tile-3d-layer.js.map +1 -1
- package/dist/es5/wms-layer/wms-layer.js +7 -5
- package/dist/es5/wms-layer/wms-layer.js.map +1 -1
- package/dist/esm/terrain-layer/terrain-layer.js +4 -0
- package/dist/esm/terrain-layer/terrain-layer.js.map +1 -1
- package/dist/esm/tile-3d-layer/tile-3d-layer.js +3 -4
- package/dist/esm/tile-3d-layer/tile-3d-layer.js.map +1 -1
- package/dist/esm/wms-layer/wms-layer.js +3 -1
- package/dist/esm/wms-layer/wms-layer.js.map +1 -1
- package/dist.min.js +16 -16
- package/package.json +2 -2
- package/src/terrain-layer/terrain-layer.ts +5 -1
- package/src/tile-3d-layer/tile-3d-layer.ts +1 -2
- package/src/wms-layer/wms-layer.ts +1 -1
- package/typed/terrain-layer/terrain-layer.d.ts +1 -1
- package/typed/terrain-layer/terrain-layer.d.ts.map +1 -1
- package/typed/tile-3d-layer/tile-3d-layer.d.ts.map +1 -1
package/dist.min.js
CHANGED
|
@@ -11,16 +11,16 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
11
11
|
`);for(var t=new Ci("!xml"),n=t,i="",a="",o=0;o<r.length;o++){var s=r[o];if(s==="<")if(r[o+1]==="/"){var u=Vr(r,">",o,"Closing Tag is not closed."),f=r.substring(o+2,u).trim();if(this.options.removeNSPrefix){var l=f.indexOf(":");l!==-1&&(f=f.substr(l+1))}this.options.transformTagName&&(f=this.options.transformTagName(f)),n&&(i=this.saveTextToParentTag(i,n,a));var h=a.substring(a.lastIndexOf(".")+1);if(f&&this.options.unpairedTags.indexOf(f)!==-1)throw new Error("Unpaired tag can not be used as closing tag: </".concat(f,">"));var d=0;h&&this.options.unpairedTags.indexOf(h)!==-1?(d=a.lastIndexOf(".",a.lastIndexOf(".")-1),this.tagsNodeStack.pop()):d=a.lastIndexOf("."),a=a.substring(0,d),n=this.tagsNodeStack.pop(),i="",o=u}else if(r[o+1]==="?"){var p=Mu(r,o,!1,"?>");if(!p)throw new Error("Pi Tag is not closed.");if(i=this.saveTextToParentTag(i,n,a),!(this.options.ignoreDeclaration&&p.tagName==="?xml"||this.options.ignorePiTags)){var m=new Ci(p.tagName);m.add(this.options.textNodeName,""),p.tagName!==p.tagExp&&p.attrExpPresent&&(m[":@"]=this.buildAttributesMap(p.tagExp,a,p.tagName)),this.addChild(n,m,a)}o=p.closeIndex+1}else if(r.substr(o+1,3)==="!--"){var v=Vr(r,"-->",o+4,"Comment is not closed.");if(this.options.commentPropName){var g=r.substring(o+4,v-2);i=this.saveTextToParentTag(i,n,a),n.add(this.options.commentPropName,[c({},this.options.textNodeName,g)])}o=v}else if(r.substr(o+1,2)==="!D"){var y=RT(r,o);this.docTypeEntities=y.entities,o=y.i}else if(r.substr(o+1,2)==="!["){var A=Vr(r,"]]>",o,"CDATA is not closed.")-2,x=r.substring(o+9,A);if(i=this.saveTextToParentTag(i,n,a),this.options.cdataPropName)n.add(this.options.cdataPropName,[c({},this.options.textNodeName,x)]);else{var b=this.parseTextData(x,n.tagname,a,!0,!1,!0);b==null&&(b=""),n.add(this.options.textNodeName,b)}o=A+2}else{var M=Mu(r,o,this.options.removeNSPrefix),C=M.tagName,F=M.tagExp,B=M.attrExpPresent,S=M.closeIndex;this.options.transformTagName&&(C=this.options.transformTagName(C)),n&&i&&n.tagname!=="!xml"&&(i=this.saveTextToParentTag(i,n,a,!1));var _=n;if(_&&this.options.unpairedTags.indexOf(_.tagname)!==-1&&(n=this.tagsNodeStack.pop(),a=a.substring(0,a.lastIndexOf("."))),C!==t.tagname&&(a+=a?"."+C:C),this.isItStopNode(this.options.stopNodes,a,C)){var R="";if(F.length>0&&F.lastIndexOf("/")===F.length-1)o=M.closeIndex;else if(this.options.unpairedTags.indexOf(C)!==-1)o=M.closeIndex;else{var k=this.readStopNodeData(r,C,S+1);if(!k)throw new Error("Unexpected end of ".concat(C));o=k.i,R=k.tagContent}var U=new Ci(C);C!==F&&B&&(U[":@"]=this.buildAttributesMap(F,a,C)),R&&(R=this.parseTextData(R,C,a,!0,B,!0,!0)),a=a.substr(0,a.lastIndexOf(".")),U.add(this.options.textNodeName,R),this.addChild(n,U,a)}else{if(F.length>0&&F.lastIndexOf("/")===F.length-1){C[C.length-1]==="/"?(C=C.substr(0,C.length-1),a=a.substr(0,a.length-1),F=C):F=F.substr(0,F.length-1),this.options.transformTagName&&(C=this.options.transformTagName(C));var j=new Ci(C);C!==F&&B&&(j[":@"]=this.buildAttributesMap(F,a,C)),this.addChild(n,j,a),a=a.substr(0,a.lastIndexOf("."))}else{var Z=new Ci(C);this.tagsNodeStack.push(n),C!==F&&B&&(Z[":@"]=this.buildAttributesMap(F,a,C)),this.addChild(n,Z,a),n=Z}i="",o=S}}else i+=r[o]}return t.child};function HT(e,r,t){var n=this.options.updateTag(r.tagname,t,r[":@"]);n===!1||(typeof n=="string"&&(r.tagname=n),e.addChild(r))}var VT=function(r){if(this.options.processEntities){for(var t in this.docTypeEntities){var n=this.docTypeEntities[t];r=r.replace(n.regx,n.val)}for(var i in this.lastEntities){var a=this.lastEntities[i];r=r.replace(a.regex,a.val)}if(this.options.htmlEntities)for(var o in this.htmlEntities){var s=this.htmlEntities[o];r=r.replace(s.regex,s.val)}r=r.replace(this.ampEntity.regex,this.ampEntity.val)}return r};function zT(e,r,t,n){return e&&(n===void 0&&(n=Object.keys(r.child).length===0),e=this.parseTextData(e,r.tagname,t,!1,r[":@"]?Object.keys(r[":@"]).length!==0:!1,n),e!==void 0&&e!==""&&r.add(this.options.textNodeName,e),e=""),e}function WT(e,r,t){var n="*."+t;for(var i in e){var a=e[i];if(n===a||r===a)return!0}return!1}function JT(e,r){for(var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:">",n,i="",a=r;a<e.length;a++){var o=e[a];if(n)o===n&&(n="");else if(o==='"'||o==="'")n=o;else if(o===t[0])if(t[1]){if(e[a+1]===t[1])return{data:i,index:a}}else return{data:i,index:a};else o===" "&&(o=" ");i+=o}}function Vr(e,r,t,n){var i=e.indexOf(r,t);if(i===-1)throw new Error(n);return i+r.length-1}function Mu(e,r,t){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:">",i=JT(e,r+1,n);if(i){var a=i.data,o=i.index,s=a.search(/\s/),u=a,f=!0;if(s!==-1&&(u=a.substr(0,s).replace(/\s\s*$/,""),a=a.substr(s+1)),t){var l=u.indexOf(":");l!==-1&&(u=u.substr(l+1),f=u!==i.data.substr(l+1))}return{tagName:u,tagExp:a,closeIndex:o,attrExpPresent:f}}}function XT(e,r,t){for(var n=t,i=1;t<e.length;t++)if(e[t]==="<")if(e[t+1]==="/"){var a=Vr(e,">",t,"".concat(r," is not closed")),o=e.substring(t+2,a).trim();if(o===r&&(i--,i===0))return{tagContent:e.substring(n,t),i:a};t=a}else if(e[t+1]==="?"){var s=Vr(e,"?>",t+1,"StopNode is not closed.");t=s}else if(e.substr(t+1,3)==="!--"){var u=Vr(e,"-->",t+3,"StopNode is not closed.");t=u}else if(e.substr(t+1,2)==="!["){var f=Vr(e,"]]>",t,"StopNode is not closed.")-2;t=f}else{var l=Mu(e,t,">");if(l){var h=l&&l.tagName;h===r&&l.tagExp[l.tagExp.length-1]!=="/"&&i++,t=l.closeIndex}}}function Ou(e,r,t){if(r&&typeof e=="string"){var n=e.trim();return n==="true"?!0:n==="false"?!1:FT(e,t)}else return Pu.isExist(e)?e:""}yp.exports=LT});var Tp=Ce(bp=>{"use strict";function qT(e,r){return _p(e,r)}function _p(e,r,t){for(var n,i={},a=0;a<e.length;a++){var o=e[a],s=KT(o),u="";if(t===void 0?u=s:u=t+"."+s,s===r.textNodeName)n===void 0?n=o[s]:n+=""+o[s];else{if(s===void 0)continue;if(o[s]){var f=_p(o[s],r,u),l=ZT(f,r);o[":@"]?YT(f,o[":@"],u,r):Object.keys(f).length===1&&f[r.textNodeName]!==void 0&&!r.alwaysCreateTextNode?f=f[r.textNodeName]:Object.keys(f).length===0&&(r.alwaysCreateTextNode?f[r.textNodeName]="":f=""),i[s]!==void 0&&i.hasOwnProperty(s)?(Array.isArray(i[s])||(i[s]=[i[s]]),i[s].push(f)):r.isArray(s,u,l)?i[s]=[f]:i[s]=f}}}return typeof n=="string"?n.length>0&&(i[r.textNodeName]=n):n!==void 0&&(i[r.textNodeName]=n),i}function KT(e){for(var r=Object.keys(e),t=0;t<r.length;t++){var n=r[t];if(n!==":@")return n}}function YT(e,r,t,n){if(r)for(var i=Object.keys(r),a=i.length,o=0;o<a;o++){var s=i[o];n.isArray(s,t+"."+s,!0,!0)?e[s]=[r[s]]:e[s]=r[s]}}function ZT(e,r){var t=r.textNodeName,n=Object.keys(e).length;return!!(n===0||n===1&&(e[t]||typeof e[t]=="boolean"||e[t]===0))}bp.prettify=qT});var Ep=Ce((bF,xp)=>{q();Y();var $T=cp(),QT=$T.buildOptions,ex=Ap(),tx=Tp(),rx=tx.prettify,nx=Cu(),ix=function(){function e(r){T(this,e),this.externalEntities={},this.options=QT(r)}return w(e,[{key:"parse",value:function(t,n){if(typeof t!="string")if(t.toString)t=t.toString();else throw new Error("XML data is accepted in String or Bytes[] form.");if(n){n===!0&&(n={});var i=nx.validate(t,n);if(i!==!0)throw Error("".concat(i.err.msg,":").concat(i.err.line,":").concat(i.err.col))}var a=new ex(this.options);a.addExternalEntities(this.externalEntities);var o=a.parseXml(t);return this.options.preserveOrder||o===void 0?o:rx(o,this.options)}},{key:"addEntity",value:function(t,n){if(n.indexOf("&")!==-1)throw new Error("Entity value can't have '&'");if(t.indexOf("&")!==-1||t.indexOf(";")!==-1)throw new Error("An entity must be set without '&' and ';'. Eg. use '#xD' for '
'");if(n==="&")throw new Error("An entity with value '&' is not permitted");this.externalEntities[t]=n}}]),e}();xp.exports=ix});var Mp=Ce((TF,Bp)=>{var ax=`
|
|
12
12
|
`;function ox(e,r){var t="";return r.format&&r.indentBy.length>0&&(t=ax),wp(e,r,"",t)}function wp(e,r,t,n){for(var i="",a=!1,o=0;o<e.length;o++){var s=e[o],u=sx(s),f="";if(t.length===0?f=u:f="".concat(t,".").concat(u),u===r.textNodeName){var l=s[u];ux(f,r)||(l=r.tagValueProcessor(u,l),l=Cp(l,r)),a&&(i+=n),i+=l,a=!1;continue}else if(u===r.cdataPropName){a&&(i+=n),i+="<![CDATA[".concat(s[u][0][r.textNodeName],"]]>"),a=!1;continue}else if(u===r.commentPropName){i+=n+"<!--".concat(s[u][0][r.textNodeName],"-->"),a=!0;continue}else if(u[0]==="?"){var h=Sp(s[":@"],r),d=u==="?xml"?"":n,p=s[u][0][r.textNodeName];p=p.length!==0?" "+p:"",i+=d+"<".concat(u).concat(p).concat(h,"?>"),a=!0;continue}var m=n;m!==""&&(m+=r.indentBy);var v=Sp(s[":@"],r),g=n+"<".concat(u).concat(v),y=wp(s[u],r,f,m);r.unpairedTags.indexOf(u)!==-1?r.suppressUnpairedNode?i+=g+">":i+=g+"/>":(!y||y.length===0)&&r.suppressEmptyNode?i+=g+"/>":y&&y.endsWith(">")?i+=g+">".concat(y).concat(n,"</").concat(u,">"):(i+=g+">",y&&n!==""&&(y.includes("/>")||y.includes("</"))?i+=n+r.indentBy+y+n:i+=y,i+="</".concat(u,">")),a=!0}return i}function sx(e){for(var r=Object.keys(e),t=0;t<r.length;t++){var n=r[t];if(n!==":@")return n}}function Sp(e,r){var t="";if(e&&!r.ignoreAttributes)for(var n in e){var i=r.attributeValueProcessor(n,e[n]);i=Cp(i,r),i===!0&&r.suppressBooleanAttributes?t+=" ".concat(n.substr(r.attributeNamePrefix.length)):t+=" ".concat(n.substr(r.attributeNamePrefix.length),'="').concat(i,'"')}return t}function ux(e,r){e=e.substr(0,e.length-r.textNodeName.length-1);var t=e.substr(e.lastIndexOf(".")+1);for(var n in r.stopNodes)if(r.stopNodes[n]===e||r.stopNodes[n]==="*."+t)return!0;return!1}function Cp(e,r){if(e&&e.length>0&&r.processEntities)for(var t=0;t<r.entities.length;t++){var n=r.entities[t];e=e.replace(n.regex,n.val)}return e}Bp.exports=ox});var Pp=Ce((SF,Op)=>{"use strict";Le();N();var fx=Mp(),lx={attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,cdataPropName:!1,format:!1,indentBy:" ",suppressEmptyNode:!1,suppressUnpairedNode:!0,suppressBooleanAttributes:!0,tagValueProcessor:function(r,t){return t},attributeValueProcessor:function(r,t){return t},preserveOrder:!1,commentPropName:!1,unpairedTags:[],entities:[{regex:new RegExp("&","g"),val:"&"},{regex:new RegExp(">","g"),val:">"},{regex:new RegExp("<","g"),val:"<"},{regex:new RegExp("'","g"),val:"'"},{regex:new RegExp('"',"g"),val:"""}],processEntities:!0,stopNodes:[],oneListGroup:!1};function mr(e){this.options=Object.assign({},lx,e),this.options.ignoreAttributes||this.options.attributesGroupName?this.isAttribute=function(){return!1}:(this.attrPrefixLen=this.options.attributeNamePrefix.length,this.isAttribute=dx),this.processTextOrObjNode=cx,this.options.format?(this.indentate=hx,this.tagEndChar=`>
|
|
13
13
|
`,this.newLine=`
|
|
14
|
-
`):(this.indentate=function(){return""},this.tagEndChar=">",this.newLine="")}mr.prototype.build=function(e){return this.options.preserveOrder?fx(e,this.options):(Array.isArray(e)&&this.options.arrayNodeName&&this.options.arrayNodeName.length>1&&(e=c({},this.options.arrayNodeName,e)),this.j2x(e,0).val)};mr.prototype.j2x=function(e,r){var t="",n="";for(var i in e)if(typeof e[i]>"u")this.isAttribute(i)&&(n+="");else if(e[i]===null)this.isAttribute(i)?n+="":i[0]==="?"?n+=this.indentate(r)+"<"+i+"?"+this.tagEndChar:n+=this.indentate(r)+"<"+i+"/"+this.tagEndChar;else if(e[i]instanceof Date)n+=this.buildTextValNode(e[i],i,"",r);else if(te(e[i])!=="object"){var a=this.isAttribute(i);if(a)t+=this.buildAttrPairStr(a,""+e[i]);else if(i===this.options.textNodeName){var o=this.options.tagValueProcessor(i,""+e[i]);n+=this.replaceEntitiesValue(o)}else n+=this.buildTextValNode(e[i],i,"",r)}else if(Array.isArray(e[i])){for(var s=e[i].length,u="",f=0;f<s;f++){var l=e[i][f];typeof l>"u"||(l===null?i[0]==="?"?n+=this.indentate(r)+"<"+i+"?"+this.tagEndChar:n+=this.indentate(r)+"<"+i+"/"+this.tagEndChar:te(l)==="object"?this.options.oneListGroup?u+=this.j2x(l,r+1).val:u+=this.processTextOrObjNode(l,i,r):u+=this.buildTextValNode(l,i,"",r))}this.options.oneListGroup&&(u=this.buildObjectNode(u,i,"",r)),n+=u}else if(this.options.attributesGroupName&&i===this.options.attributesGroupName)for(var h=Object.keys(e[i]),d=h.length,p=0;p<d;p++)t+=this.buildAttrPairStr(h[p],""+e[i][h[p]]);else n+=this.processTextOrObjNode(e[i],i,r);return{attrStr:t,val:n}};mr.prototype.buildAttrPairStr=function(e,r){return r=this.options.attributeValueProcessor(e,""+r),r=this.replaceEntitiesValue(r),this.options.suppressBooleanAttributes&&r==="true"?" "+e:" "+e+'="'+r+'"'};function cx(e,r,t){var n=this.j2x(e,t+1);return e[this.options.textNodeName]!==void 0&&Object.keys(e).length===1?this.buildTextValNode(e[this.options.textNodeName],r,n.attrStr,t):this.buildObjectNode(n.val,r,n.attrStr,t)}mr.prototype.buildObjectNode=function(e,r,t,n){if(e==="")return r[0]==="?"?this.indentate(n)+"<"+r+t+"?"+this.tagEndChar:this.indentate(n)+"<"+r+t+this.closeTag(r)+this.tagEndChar;var i="</"+r+this.tagEndChar,a="";return r[0]==="?"&&(a="?",i=""),(t||t==="")&&e.indexOf("<")===-1?this.indentate(n)+"<"+r+t+a+">"+e+i:this.options.commentPropName!==!1&&r===this.options.commentPropName&&a.length===0?this.indentate(n)+"<!--".concat(e,"-->")+this.newLine:this.indentate(n)+"<"+r+t+a+this.tagEndChar+e+this.indentate(n)+i};mr.prototype.closeTag=function(e){var r="";return this.options.unpairedTags.indexOf(e)!==-1?this.options.suppressUnpairedNode||(r="/"):this.options.suppressEmptyNode?r="/":r="></".concat(e),r};mr.prototype.buildTextValNode=function(e,r,t,n){if(this.options.cdataPropName!==!1&&r===this.options.cdataPropName)return this.indentate(n)+"<![CDATA[".concat(e,"]]>")+this.newLine;if(this.options.commentPropName!==!1&&r===this.options.commentPropName)return this.indentate(n)+"<!--".concat(e,"-->")+this.newLine;if(r[0]==="?")return this.indentate(n)+"<"+r+t+"?"+this.tagEndChar;var i=this.options.tagValueProcessor(r,e);return i=this.replaceEntitiesValue(i),i===""?this.indentate(n)+"<"+r+t+this.closeTag(r)+this.tagEndChar:this.indentate(n)+"<"+r+t+">"+i+"</"+r+this.tagEndChar};mr.prototype.replaceEntitiesValue=function(e){if(e&&e.length>0&&this.options.processEntities)for(var r=0;r<this.options.entities.length;r++){var t=this.options.entities[r];e=e.replace(t.regex,t.val)}return e};function hx(e){return this.options.indentBy.repeat(e)}function dx(e){return e.startsWith(this.options.attributeNamePrefix)&&e!==this.options.textNodeName?e.substr(this.attrPrefixLen):!1}Op.exports=mr});var Rp=Ce((wF,Ip)=>{"use strict";var px=Cu(),mx=Ep(),vx=Pp();Ip.exports={XMLParser:mx,XMLValidator:px,XMLBuilder:vx}});var zp=Ce(()=>{});var Df=Ce((lv,qi)=>{(function(e,r){typeof define=="function"&&define.amd?define([],r):typeof Jd=="function"&&typeof qi=="object"&&qi&&qi.exports?qi.exports=r():(e.dcodeIO=e.dcodeIO||{}).Long=r()})(lv,function(){"use strict";function e(S,_,R){this.low=S|0,this.high=_|0,this.unsigned=!!R}e.prototype.__isLong__,Object.defineProperty(e.prototype,"__isLong__",{value:!0,enumerable:!1,configurable:!1});function r(S){return(S&&S.__isLong__)===!0}e.isLong=r;var t={},n={};function i(S,_){var R,k,U;return _?(S>>>=0,(U=0<=S&&S<256)&&(k=n[S],k)?k:(R=o(S,(S|0)<0?-1:0,!0),U&&(n[S]=R),R)):(S|=0,(U=-128<=S&&S<128)&&(k=t[S],k)?k:(R=o(S,S<0?-1:0,!1),U&&(t[S]=R),R))}e.fromInt=i;function a(S,_){if(isNaN(S)||!isFinite(S))return _?y:g;if(_){if(S<0)return y;if(S>=p)return C}else{if(S<=-m)return F;if(S+1>=m)return M}return S<0?a(-S,_).neg():o(S%d|0,S/d|0,_)}e.fromNumber=a;function o(S,_,R){return new e(S,_,R)}e.fromBits=o;var s=Math.pow;function u(S,_,R){if(S.length===0)throw Error("empty string");if(S==="NaN"||S==="Infinity"||S==="+Infinity"||S==="-Infinity")return g;if(typeof _=="number"?(R=_,_=!1):_=!!_,R=R||10,R<2||36<R)throw RangeError("radix");var k;if((k=S.indexOf("-"))>0)throw Error("interior hyphen");if(k===0)return u(S.substring(1),_,R).neg();for(var U=a(s(R,8)),j=g,Z=0;Z<S.length;Z+=8){var P=Math.min(8,S.length-Z),O=parseInt(S.substring(Z,Z+P),R);if(P<8){var G=a(s(R,P));j=j.mul(G).add(a(O))}else j=j.mul(U),j=j.add(a(O))}return j.unsigned=_,j}e.fromString=u;function f(S){return S instanceof e?S:typeof S=="number"?a(S):typeof S=="string"?u(S):o(S.low,S.high,S.unsigned)}e.fromValue=f;var l=1<<16,h=1<<24,d=l*l,p=d*d,m=p/2,v=i(h),g=i(0);e.ZERO=g;var y=i(0,!0);e.UZERO=y;var A=i(1);e.ONE=A;var x=i(1,!0);e.UONE=x;var b=i(-1);e.NEG_ONE=b;var M=o(-1,2147483647,!1);e.MAX_VALUE=M;var C=o(-1,-1,!0);e.MAX_UNSIGNED_VALUE=C;var F=o(0,-2147483648,!1);e.MIN_VALUE=F;var B=e.prototype;return B.toInt=function(){return this.unsigned?this.low>>>0:this.low},B.toNumber=function(){return this.unsigned?(this.high>>>0)*d+(this.low>>>0):this.high*d+(this.low>>>0)},B.toString=function(_){if(_=_||10,_<2||36<_)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative())if(this.eq(F)){var R=a(_),k=this.div(R),U=k.mul(R).sub(this);return k.toString(_)+U.toInt().toString(_)}else return"-"+this.neg().toString(_);for(var j=a(s(_,6),this.unsigned),Z=this,P="";;){var O=Z.div(j),G=Z.sub(O.mul(j)).toInt()>>>0,J=G.toString(_);if(Z=O,Z.isZero())return J+P;for(;J.length<6;)J="0"+J;P=""+J+P}},B.getHighBits=function(){return this.high},B.getHighBitsUnsigned=function(){return this.high>>>0},B.getLowBits=function(){return this.low},B.getLowBitsUnsigned=function(){return this.low>>>0},B.getNumBitsAbs=function(){if(this.isNegative())return this.eq(F)?64:this.neg().getNumBitsAbs();for(var _=this.high!=0?this.high:this.low,R=31;R>0&&!(_&1<<R);R--);return this.high!=0?R+33:R+1},B.isZero=function(){return this.high===0&&this.low===0},B.isNegative=function(){return!this.unsigned&&this.high<0},B.isPositive=function(){return this.unsigned||this.high>=0},B.isOdd=function(){return(this.low&1)===1},B.isEven=function(){return(this.low&1)===0},B.equals=function(_){return r(_)||(_=f(_)),this.unsigned!==_.unsigned&&this.high>>>31===1&&_.high>>>31===1?!1:this.high===_.high&&this.low===_.low},B.eq=B.equals,B.notEquals=function(_){return!this.eq(_)},B.neq=B.notEquals,B.lessThan=function(_){return this.comp(_)<0},B.lt=B.lessThan,B.lessThanOrEqual=function(_){return this.comp(_)<=0},B.lte=B.lessThanOrEqual,B.greaterThan=function(_){return this.comp(_)>0},B.gt=B.greaterThan,B.greaterThanOrEqual=function(_){return this.comp(_)>=0},B.gte=B.greaterThanOrEqual,B.compare=function(_){if(r(_)||(_=f(_)),this.eq(_))return 0;var R=this.isNegative(),k=_.isNegative();return R&&!k?-1:!R&&k?1:this.unsigned?_.high>>>0>this.high>>>0||_.high===this.high&&_.low>>>0>this.low>>>0?-1:1:this.sub(_).isNegative()?-1:1},B.comp=B.compare,B.negate=function(){return!this.unsigned&&this.eq(F)?F:this.not().add(A)},B.neg=B.negate,B.add=function(_){r(_)||(_=f(_));var R=this.high>>>16,k=this.high&65535,U=this.low>>>16,j=this.low&65535,Z=_.high>>>16,P=_.high&65535,O=_.low>>>16,G=_.low&65535,J=0,V=0,ee=0,ie=0;return ie+=j+G,ee+=ie>>>16,ie&=65535,ee+=U+O,V+=ee>>>16,ee&=65535,V+=k+P,J+=V>>>16,V&=65535,J+=R+Z,J&=65535,o(ee<<16|ie,J<<16|V,this.unsigned)},B.subtract=function(_){return r(_)||(_=f(_)),this.add(_.neg())},B.sub=B.subtract,B.multiply=function(_){if(this.isZero()||(r(_)||(_=f(_)),_.isZero()))return g;if(this.eq(F))return _.isOdd()?F:g;if(_.eq(F))return this.isOdd()?F:g;if(this.isNegative())return _.isNegative()?this.neg().mul(_.neg()):this.neg().mul(_).neg();if(_.isNegative())return this.mul(_.neg()).neg();if(this.lt(v)&&_.lt(v))return a(this.toNumber()*_.toNumber(),this.unsigned);var R=this.high>>>16,k=this.high&65535,U=this.low>>>16,j=this.low&65535,Z=_.high>>>16,P=_.high&65535,O=_.low>>>16,G=_.low&65535,J=0,V=0,ee=0,ie=0;return ie+=j*G,ee+=ie>>>16,ie&=65535,ee+=U*G,V+=ee>>>16,ee&=65535,ee+=j*O,V+=ee>>>16,ee&=65535,V+=k*G,J+=V>>>16,V&=65535,V+=U*O,J+=V>>>16,V&=65535,V+=j*P,J+=V>>>16,V&=65535,J+=R*G+k*O+U*P+j*Z,J&=65535,o(ee<<16|ie,J<<16|V,this.unsigned)},B.mul=B.multiply,B.divide=function(_){if(r(_)||(_=f(_)),_.isZero())throw Error("division by zero");if(this.isZero())return this.unsigned?y:g;var R,k,U;if(this.unsigned){if(_.unsigned||(_=_.toUnsigned()),_.gt(this))return y;if(_.gt(this.shru(1)))return x;U=y}else{if(this.eq(F)){if(_.eq(A)||_.eq(b))return F;if(_.eq(F))return A;var j=this.shr(1);return R=j.div(_).shl(1),R.eq(g)?_.isNegative()?A:b:(k=this.sub(_.mul(R)),U=R.add(k.div(_)),U)}else if(_.eq(F))return this.unsigned?y:g;if(this.isNegative())return _.isNegative()?this.neg().div(_.neg()):this.neg().div(_).neg();if(_.isNegative())return this.div(_.neg()).neg();U=g}for(k=this;k.gte(_);){R=Math.max(1,Math.floor(k.toNumber()/_.toNumber()));for(var Z=Math.ceil(Math.log(R)/Math.LN2),P=Z<=48?1:s(2,Z-48),O=a(R),G=O.mul(_);G.isNegative()||G.gt(k);)R-=P,O=a(R,this.unsigned),G=O.mul(_);O.isZero()&&(O=A),U=U.add(O),k=k.sub(G)}return U},B.div=B.divide,B.modulo=function(_){return r(_)||(_=f(_)),this.sub(this.div(_).mul(_))},B.mod=B.modulo,B.not=function(){return o(~this.low,~this.high,this.unsigned)},B.and=function(_){return r(_)||(_=f(_)),o(this.low&_.low,this.high&_.high,this.unsigned)},B.or=function(_){return r(_)||(_=f(_)),o(this.low|_.low,this.high|_.high,this.unsigned)},B.xor=function(_){return r(_)||(_=f(_)),o(this.low^_.low,this.high^_.high,this.unsigned)},B.shiftLeft=function(_){return r(_)&&(_=_.toInt()),(_&=63)===0?this:_<32?o(this.low<<_,this.high<<_|this.low>>>32-_,this.unsigned):o(0,this.low<<_-32,this.unsigned)},B.shl=B.shiftLeft,B.shiftRight=function(_){return r(_)&&(_=_.toInt()),(_&=63)===0?this:_<32?o(this.low>>>_|this.high<<32-_,this.high>>_,this.unsigned):o(this.high>>_-32,this.high>=0?0:-1,this.unsigned)},B.shr=B.shiftRight,B.shiftRightUnsigned=function(_){if(r(_)&&(_=_.toInt()),_&=63,_===0)return this;var R=this.high;if(_<32){var k=this.low;return o(k>>>_|R<<32-_,R>>>_,this.unsigned)}else return _===32?o(R,0,this.unsigned):o(R>>>_-32,0,this.unsigned)},B.shru=B.shiftRightUnsigned,B.toSigned=function(){return this.unsigned?o(this.low,this.high,!1):this},B.toUnsigned=function(){return this.unsigned?this:o(this.low,this.high,!0)},B.toBytes=function(S){return S?this.toBytesLE():this.toBytesBE()},B.toBytesLE=function(){var S=this.high,_=this.low;return[_&255,_>>>8&255,_>>>16&255,_>>>24&255,S&255,S>>>8&255,S>>>16&255,S>>>24&255]},B.toBytesBE=function(){var S=this.high,_=this.low;return[S>>>24&255,S>>>16&255,S>>>8&255,S&255,_>>>24&255,_>>>16&255,_>>>8&255,_&255]},e})});var hl=Ce((nj,Cg)=>{Cg.exports=globalThis.h3||{}});var pl=Ce((Ej,kg)=>{kg.exports=globalThis.luma});var Ho=Ce((Sj,Dg)=>{Dg.exports=globalThis.deck});var ni=Ce((HW,Hy)=>{Hy.exports=globalThis.loaders});var W_=Ce((Mte,z_)=>{z_.exports=globalThis.deck});var lb=Ce(Od=>{Od.read=function(e,r,t,n,i){var a,o,s=i*8-n-1,u=(1<<s)-1,f=u>>1,l=-7,h=t?i-1:0,d=t?-1:1,p=e[r+h];for(h+=d,a=p&(1<<-l)-1,p>>=-l,l+=s;l>0;a=a*256+e[r+h],h+=d,l-=8);for(o=a&(1<<-l)-1,a>>=-l,l+=n;l>0;o=o*256+e[r+h],h+=d,l-=8);if(a===0)a=1-f;else{if(a===u)return o?NaN:(p?-1:1)*(1/0);o=o+Math.pow(2,n),a=a-f}return(p?-1:1)*o*Math.pow(2,a-n)};Od.write=function(e,r,t,n,i,a){var o,s,u,f=a*8-i-1,l=(1<<f)-1,h=l>>1,d=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:a-1,m=n?1:-1,v=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(s=isNaN(r)?1:0,o=l):(o=Math.floor(Math.log(r)/Math.LN2),r*(u=Math.pow(2,-o))<1&&(o--,u*=2),o+h>=1?r+=d/u:r+=d*Math.pow(2,1-h),r*u>=2&&(o++,u/=2),o+h>=l?(s=0,o=l):o+h>=1?(s=(r*u-1)*Math.pow(2,i),o=o+h):(s=r*Math.pow(2,h-1)*Math.pow(2,i),o=0));i>=8;e[t+p]=s&255,p+=m,s/=256,i-=8);for(o=o<<i|s,f+=i;f>0;e[t+p]=o&255,p+=m,o/=256,f-=8);e[t+p-m]|=v*128}});var vb=Ce((_re,mb)=>{"use strict";mb.exports=Ae;var lu=lb();function Ae(e){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(e)?e:new Uint8Array(e||0),this.pos=0,this.type=0,this.length=this.buf.length}Ae.Varint=0;Ae.Fixed64=1;Ae.Bytes=2;Ae.Fixed32=5;var Pd=(1<<16)*(1<<16),cb=1/Pd,vI=12,pb=typeof TextDecoder>"u"?null:new TextDecoder("utf8");Ae.prototype={destroy:function(){this.buf=null},readFields:function(e,r,t){for(t=t||this.length;this.pos<t;){var n=this.readVarint(),i=n>>3,a=this.pos;this.type=n&7,e(i,r,this),this.pos===a&&this.skip(n)}return r},readMessage:function(e,r){return this.readFields(e,r,this.readVarint()+this.pos)},readFixed32:function(){var e=cu(this.buf,this.pos);return this.pos+=4,e},readSFixed32:function(){var e=db(this.buf,this.pos);return this.pos+=4,e},readFixed64:function(){var e=cu(this.buf,this.pos)+cu(this.buf,this.pos+4)*Pd;return this.pos+=8,e},readSFixed64:function(){var e=cu(this.buf,this.pos)+db(this.buf,this.pos+4)*Pd;return this.pos+=8,e},readFloat:function(){var e=lu.read(this.buf,this.pos,!0,23,4);return this.pos+=4,e},readDouble:function(){var e=lu.read(this.buf,this.pos,!0,52,8);return this.pos+=8,e},readVarint:function(e){var r=this.buf,t,n;return n=r[this.pos++],t=n&127,n<128||(n=r[this.pos++],t|=(n&127)<<7,n<128)||(n=r[this.pos++],t|=(n&127)<<14,n<128)||(n=r[this.pos++],t|=(n&127)<<21,n<128)?t:(n=r[this.pos],t|=(n&15)<<28,gI(t,e,this))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var e=this.readVarint();return e%2===1?(e+1)/-2:e/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var e=this.readVarint()+this.pos,r=this.pos;return this.pos=e,e-r>=vI&&pb?PI(this.buf,r,e):OI(this.buf,r,e)},readBytes:function(){var e=this.readVarint()+this.pos,r=this.buf.subarray(this.pos,e);return this.pos=e,r},readPackedVarint:function(e,r){if(this.type!==Ae.Bytes)return e.push(this.readVarint(r));var t=dr(this);for(e=e||[];this.pos<t;)e.push(this.readVarint(r));return e},readPackedSVarint:function(e){if(this.type!==Ae.Bytes)return e.push(this.readSVarint());var r=dr(this);for(e=e||[];this.pos<r;)e.push(this.readSVarint());return e},readPackedBoolean:function(e){if(this.type!==Ae.Bytes)return e.push(this.readBoolean());var r=dr(this);for(e=e||[];this.pos<r;)e.push(this.readBoolean());return e},readPackedFloat:function(e){if(this.type!==Ae.Bytes)return e.push(this.readFloat());var r=dr(this);for(e=e||[];this.pos<r;)e.push(this.readFloat());return e},readPackedDouble:function(e){if(this.type!==Ae.Bytes)return e.push(this.readDouble());var r=dr(this);for(e=e||[];this.pos<r;)e.push(this.readDouble());return e},readPackedFixed32:function(e){if(this.type!==Ae.Bytes)return e.push(this.readFixed32());var r=dr(this);for(e=e||[];this.pos<r;)e.push(this.readFixed32());return e},readPackedSFixed32:function(e){if(this.type!==Ae.Bytes)return e.push(this.readSFixed32());var r=dr(this);for(e=e||[];this.pos<r;)e.push(this.readSFixed32());return e},readPackedFixed64:function(e){if(this.type!==Ae.Bytes)return e.push(this.readFixed64());var r=dr(this);for(e=e||[];this.pos<r;)e.push(this.readFixed64());return e},readPackedSFixed64:function(e){if(this.type!==Ae.Bytes)return e.push(this.readSFixed64());var r=dr(this);for(e=e||[];this.pos<r;)e.push(this.readSFixed64());return e},skip:function(e){var r=e&7;if(r===Ae.Varint)for(;this.buf[this.pos++]>127;);else if(r===Ae.Bytes)this.pos=this.readVarint()+this.pos;else if(r===Ae.Fixed32)this.pos+=4;else if(r===Ae.Fixed64)this.pos+=8;else throw new Error("Unimplemented type: "+r)},writeTag:function(e,r){this.writeVarint(e<<3|r)},realloc:function(e){for(var r=this.length||16;r<this.pos+e;)r*=2;if(r!==this.length){var t=new Uint8Array(r);t.set(this.buf),this.buf=t,this.length=r}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(e){this.realloc(4),Ei(this.buf,e,this.pos),this.pos+=4},writeSFixed32:function(e){this.realloc(4),Ei(this.buf,e,this.pos),this.pos+=4},writeFixed64:function(e){this.realloc(8),Ei(this.buf,e&-1,this.pos),Ei(this.buf,Math.floor(e*cb),this.pos+4),this.pos+=8},writeSFixed64:function(e){this.realloc(8),Ei(this.buf,e&-1,this.pos),Ei(this.buf,Math.floor(e*cb),this.pos+4),this.pos+=8},writeVarint:function(e){if(e=+e||0,e>268435455||e<0){yI(e,this);return}this.realloc(4),this.buf[this.pos++]=e&127|(e>127?128:0),!(e<=127)&&(this.buf[this.pos++]=(e>>>=7)&127|(e>127?128:0),!(e<=127)&&(this.buf[this.pos++]=(e>>>=7)&127|(e>127?128:0),!(e<=127)&&(this.buf[this.pos++]=e>>>7&127)))},writeSVarint:function(e){this.writeVarint(e<0?-e*2-1:e*2)},writeBoolean:function(e){this.writeVarint(Boolean(e))},writeString:function(e){e=String(e),this.realloc(e.length*4),this.pos++;var r=this.pos;this.pos=II(this.buf,e,this.pos);var t=this.pos-r;t>=128&&hb(r,t,this),this.pos=r-1,this.writeVarint(t),this.pos+=t},writeFloat:function(e){this.realloc(4),lu.write(this.buf,e,this.pos,!0,23,4),this.pos+=4},writeDouble:function(e){this.realloc(8),lu.write(this.buf,e,this.pos,!0,52,8),this.pos+=8},writeBytes:function(e){var r=e.length;this.writeVarint(r),this.realloc(r);for(var t=0;t<r;t++)this.buf[this.pos++]=e[t]},writeRawMessage:function(e,r){this.pos++;var t=this.pos;e(r,this);var n=this.pos-t;n>=128&&hb(t,n,this),this.pos=t-1,this.writeVarint(n),this.pos+=n},writeMessage:function(e,r,t){this.writeTag(e,Ae.Bytes),this.writeRawMessage(r,t)},writePackedVarint:function(e,r){r.length&&this.writeMessage(e,bI,r)},writePackedSVarint:function(e,r){r.length&&this.writeMessage(e,TI,r)},writePackedBoolean:function(e,r){r.length&&this.writeMessage(e,SI,r)},writePackedFloat:function(e,r){r.length&&this.writeMessage(e,xI,r)},writePackedDouble:function(e,r){r.length&&this.writeMessage(e,EI,r)},writePackedFixed32:function(e,r){r.length&&this.writeMessage(e,wI,r)},writePackedSFixed32:function(e,r){r.length&&this.writeMessage(e,CI,r)},writePackedFixed64:function(e,r){r.length&&this.writeMessage(e,BI,r)},writePackedSFixed64:function(e,r){r.length&&this.writeMessage(e,MI,r)},writeBytesField:function(e,r){this.writeTag(e,Ae.Bytes),this.writeBytes(r)},writeFixed32Field:function(e,r){this.writeTag(e,Ae.Fixed32),this.writeFixed32(r)},writeSFixed32Field:function(e,r){this.writeTag(e,Ae.Fixed32),this.writeSFixed32(r)},writeFixed64Field:function(e,r){this.writeTag(e,Ae.Fixed64),this.writeFixed64(r)},writeSFixed64Field:function(e,r){this.writeTag(e,Ae.Fixed64),this.writeSFixed64(r)},writeVarintField:function(e,r){this.writeTag(e,Ae.Varint),this.writeVarint(r)},writeSVarintField:function(e,r){this.writeTag(e,Ae.Varint),this.writeSVarint(r)},writeStringField:function(e,r){this.writeTag(e,Ae.Bytes),this.writeString(r)},writeFloatField:function(e,r){this.writeTag(e,Ae.Fixed32),this.writeFloat(r)},writeDoubleField:function(e,r){this.writeTag(e,Ae.Fixed64),this.writeDouble(r)},writeBooleanField:function(e,r){this.writeVarintField(e,Boolean(r))}};function gI(e,r,t){var n=t.buf,i,a;if(a=n[t.pos++],i=(a&112)>>4,a<128||(a=n[t.pos++],i|=(a&127)<<3,a<128)||(a=n[t.pos++],i|=(a&127)<<10,a<128)||(a=n[t.pos++],i|=(a&127)<<17,a<128)||(a=n[t.pos++],i|=(a&127)<<24,a<128)||(a=n[t.pos++],i|=(a&1)<<31,a<128))return xi(e,i,r);throw new Error("Expected varint not more than 10 bytes")}function dr(e){return e.type===Ae.Bytes?e.readVarint()+e.pos:e.pos+1}function xi(e,r,t){return t?r*4294967296+(e>>>0):(r>>>0)*4294967296+(e>>>0)}function yI(e,r){var t,n;if(e>=0?(t=e%4294967296|0,n=e/4294967296|0):(t=~(-e%4294967296),n=~(-e/4294967296),t^4294967295?t=t+1|0:(t=0,n=n+1|0)),e>=18446744073709552e3||e<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");r.realloc(10),AI(t,n,r),_I(n,r)}function AI(e,r,t){t.buf[t.pos++]=e&127|128,e>>>=7,t.buf[t.pos++]=e&127|128,e>>>=7,t.buf[t.pos++]=e&127|128,e>>>=7,t.buf[t.pos++]=e&127|128,e>>>=7,t.buf[t.pos]=e&127}function _I(e,r){var t=(e&7)<<4;r.buf[r.pos++]|=t|((e>>>=3)?128:0),e&&(r.buf[r.pos++]=e&127|((e>>>=7)?128:0),e&&(r.buf[r.pos++]=e&127|((e>>>=7)?128:0),e&&(r.buf[r.pos++]=e&127|((e>>>=7)?128:0),e&&(r.buf[r.pos++]=e&127|((e>>>=7)?128:0),e&&(r.buf[r.pos++]=e&127)))))}function hb(e,r,t){var n=r<=16383?1:r<=2097151?2:r<=268435455?3:Math.floor(Math.log(r)/(Math.LN2*7));t.realloc(n);for(var i=t.pos-1;i>=e;i--)t.buf[i+n]=t.buf[i]}function bI(e,r){for(var t=0;t<e.length;t++)r.writeVarint(e[t])}function TI(e,r){for(var t=0;t<e.length;t++)r.writeSVarint(e[t])}function xI(e,r){for(var t=0;t<e.length;t++)r.writeFloat(e[t])}function EI(e,r){for(var t=0;t<e.length;t++)r.writeDouble(e[t])}function SI(e,r){for(var t=0;t<e.length;t++)r.writeBoolean(e[t])}function wI(e,r){for(var t=0;t<e.length;t++)r.writeFixed32(e[t])}function CI(e,r){for(var t=0;t<e.length;t++)r.writeSFixed32(e[t])}function BI(e,r){for(var t=0;t<e.length;t++)r.writeFixed64(e[t])}function MI(e,r){for(var t=0;t<e.length;t++)r.writeSFixed64(e[t])}function cu(e,r){return(e[r]|e[r+1]<<8|e[r+2]<<16)+e[r+3]*16777216}function Ei(e,r,t){e[t]=r,e[t+1]=r>>>8,e[t+2]=r>>>16,e[t+3]=r>>>24}function db(e,r){return(e[r]|e[r+1]<<8|e[r+2]<<16)+(e[r+3]<<24)}function OI(e,r,t){for(var n="",i=r;i<t;){var a=e[i],o=null,s=a>239?4:a>223?3:a>191?2:1;if(i+s>t)break;var u,f,l;s===1?a<128&&(o=a):s===2?(u=e[i+1],(u&192)===128&&(o=(a&31)<<6|u&63,o<=127&&(o=null))):s===3?(u=e[i+1],f=e[i+2],(u&192)===128&&(f&192)===128&&(o=(a&15)<<12|(u&63)<<6|f&63,(o<=2047||o>=55296&&o<=57343)&&(o=null))):s===4&&(u=e[i+1],f=e[i+2],l=e[i+3],(u&192)===128&&(f&192)===128&&(l&192)===128&&(o=(a&15)<<18|(u&63)<<12|(f&63)<<6|l&63,(o<=65535||o>=1114112)&&(o=null))),o===null?(o=65533,s=1):o>65535&&(o-=65536,n+=String.fromCharCode(o>>>10&1023|55296),o=56320|o&1023),n+=String.fromCharCode(o),i+=s}return n}function PI(e,r,t){return pb.decode(e.subarray(r,t))}function II(e,r,t){for(var n=0,i,a;n<r.length;n++){if(i=r.charCodeAt(n),i>55295&&i<57344)if(a)if(i<56320){e[t++]=239,e[t++]=191,e[t++]=189,a=i;continue}else i=a-55296<<10|i-56320|65536,a=null;else{i>56319||n+1===r.length?(e[t++]=239,e[t++]=191,e[t++]=189):a=i;continue}else a&&(e[t++]=239,e[t++]=191,e[t++]=189,a=null);i<128?e[t++]=i:(i<2048?e[t++]=i>>6|192:(i<65536?e[t++]=i>>12|224:(e[t++]=i>>18|240,e[t++]=i>>12&63|128),e[t++]=i>>6&63|128),e[t++]=i&63|128)}return t}});var Da={};bt(Da,{GeohashLayer:()=>gu,GreatCircleLayer:()=>ho,H3ClusterLayer:()=>jo,H3HexagonLayer:()=>nn,MVTLayer:()=>vu,QuadkeyLayer:()=>vo,S2Layer:()=>mo,TerrainLayer:()=>nu,Tile3DLayer:()=>qs,TileLayer:()=>er,TripsLayer:()=>Go,_GeoCellLayer:()=>mt,_Tile2DHeader:()=>Yi,_Tileset2D:()=>ra,_WMSLayer:()=>co,_getURLFromTemplate:()=>jt});var It={},qd=X(Tt());pr(It,X(Tt()));if(!qd.GeoJsonLayer)throw new Error("@deck.gl/layers is not found");pr(Da,It);ue();function $d(e,r,t,n,i,a,o){try{var s=e[a](o),u=s.value}catch(f){t(f);return}s.done?r(u):Promise.resolve(u).then(n,i)}function I(e){return function(){var r=this,t=arguments;return new Promise(function(n,i){var a=e.apply(r,t);function o(u){$d(a,n,i,o,s,"next",u)}function s(u){$d(a,n,i,o,s,"throw",u)}o(void 0)})}}q();Y();function oe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function L(e){return L=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},L(e)}function xu(e,r){for(;!Object.prototype.hasOwnProperty.call(e,r)&&(e=L(e),e!==null););return e}function be(e,r,t){return typeof Reflect<"u"&&Reflect.get?be=Reflect.get:be=function(i,a,o){var s=xu(i,a);if(s){var u=Object.getOwnPropertyDescriptor(s,a);return u.get?u.get.call(o):u.value}},be(e,r,t||e)}function Hr(e,r){return Hr=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},Hr(e,r)}function H(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),r&&Hr(e,r)}Le();function $(e,r){if(r&&(te(r)==="object"||typeof r=="function"))return r;if(r!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return oe(e)}N();var Qr=X(re()),en=X(xt()),ov=X(Tt());N();var Ru=X(re());N();var Lp=X(Rp());function Fp(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),t.push.apply(t,n)}return t}function gx(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{};r%2?Fp(Object(t),!0).forEach(function(n){c(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Fp(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}function kp(e,r){var t=new Lp.XMLParser(gx({ignoreAttributes:!1,attributeNamePrefix:""},r)),n=t.parse(e);return n}ue();Le();function yx(e){return typeof e=="string"?e.charAt(0).toLowerCase()+e.slice(1):e}function ja(e){if(Array.isArray(e))return e.map(function(s){return ja(s)});if(e&&te(e)==="object"){for(var r={},t=0,n=Object.entries(e);t<n.length;t++){var i=D(n[t],2),a=i[0],o=i[1];r[yx(a)]=ja(o)}return r}return e}function Dp(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),t.push.apply(t,n)}return t}function Iu(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{};r%2?Dp(Object(t),!0).forEach(function(n){c(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Dp(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}var Ax="3.4.13",pt={name:"XML",id:"xml",module:"xml",version:Ax,worker:!1,extensions:["xml"],mimeTypes:["application/xml","text/xml"],testText:_x,options:{xml:{parser:"fast-xml-parser",uncapitalizeKeys:!1,removeNSPrefix:!1,textNodeName:"value",arrayPaths:[]}},parse:function(){var e=I(Ru.default.mark(function t(n,i){return Ru.default.wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return o.abrupt("return",Gp(new TextDecoder().decode(n),i));case 1:case"end":return o.stop()}},t)}));function r(t,n){return e.apply(this,arguments)}return r}(),parseTextSync:function(r,t){return Gp(r,t)}};function _x(e){return e.startsWith("<?xml")}function Gp(e,r){var t,n=Iu(Iu({},pt.options.xml),r?.xml);switch(n.parser){case"fast-xml-parser":var i=Iu({allowBooleanAttributes:!0,ignoreDeclaration:!0,removeNSPrefix:n.removeNSPrefix,textNodeName:n.textNodeName,isArray:function(s,u,f,l){var h,d=Boolean(n==null||(h=n.arrayPaths)===null||h===void 0?void 0:h.some(function(p){return u===p}));return d}},r?._fastXML),a=kp(e,i);return n.uncapitalizeKeys?ja(a):a;default:throw new Error(r==null||(t=r.xml)===null||t===void 0?void 0:t.parser)}}function ce(e,r){if(!e)throw new Error(r||"loader assertion failed.")}Le();var Rt={self:typeof self<"u"&&self,window:typeof window<"u"&&window,global:typeof global<"u"&&global,document:typeof document<"u"&&document},bx=Rt.self||Rt.window||Rt.global||{},Tx=Rt.window||Rt.self||Rt.global||{},xx=Rt.global||Rt.self||Rt.window||{},Ex=Rt.document||{};var Bi=Boolean((typeof process>"u"?"undefined":te(process))!=="object"||String(process)!=="[object process]"||process.browser);var Np=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version),Sx=Np&&parseFloat(Np[1])||0;Le();ue();N();function Up(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),t.push.apply(t,n)}return t}function wx(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{};r%2?Up(Object(t),!0).forEach(function(n){c(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Up(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}function Fu(e,r){for(var t=wx({},e),n=0,i=Object.entries(r);n<i.length;n++){var a=D(i[n],2),o=a[0],s=a[1];s&&te(s)==="object"?(t[o]=t[o]||{},Object.assign(t[o],r[o])):t[o]=r[o]}return t}function jp(e,r){if(!e)throw new Error(r||"loaders.gl assertion failed.")}Le();var Ft={self:typeof self<"u"&&self,window:typeof window<"u"&&window,global:typeof global<"u"&&global,document:typeof document<"u"&&document},JF=Ft.self||Ft.window||Ft.global||{},XF=Ft.window||Ft.self||Ft.global||{},Vp=Ft.global||Ft.self||Ft.window||{},qF=Ft.document||{};var qt=(typeof process>"u"?"undefined":te(process))!=="object"||String(process)!=="[object process]"||process.browser,Mi=typeof importScripts=="function",KF=typeof window<"u"&&typeof window.orientation<"u",Hp=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version),YF=Hp&&parseFloat(Hp[1])||0;var Oi=X(re());var zr=X(zp());var Cx="3.4.13",Lu={};function Lt(e){return ku.apply(this,arguments)}function ku(){return ku=I(Oi.default.mark(function e(r){var t,n,i=arguments;return Oi.default.wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return t=i.length>1&&i[1]!==void 0?i[1]:null,n=i.length>2&&i[2]!==void 0?i[2]:{},t&&(r=Wp(r,t,n)),Lu[r]=Lu[r]||Bx(r),o.next=6,Lu[r];case 6:return o.abrupt("return",o.sent);case 7:case"end":return o.stop()}},e)})),ku.apply(this,arguments)}function Wp(e,r,t){if(e.startsWith("http"))return e;var n=t.modules||{};return n[e]?n[e]:qt?t.CDN?(jp(t.CDN.startsWith("http")),"".concat(t.CDN,"/").concat(r,"@").concat(Cx,"/dist/libs/").concat(e)):Mi?"../src/libs/".concat(e):"modules/".concat(r,"/src/libs/").concat(e):"modules/".concat(r,"/dist/libs/").concat(e)}function Bx(e){return Du.apply(this,arguments)}function Du(){return Du=I(Oi.default.mark(function e(r){var t,n,i;return Oi.default.wrap(function(o){for(;;)switch(o.prev=o.next){case 0:if(!r.endsWith("wasm")){o.next=7;break}return o.next=3,fetch(r);case 3:return t=o.sent,o.next=6,t.arrayBuffer();case 6:return o.abrupt("return",o.sent);case 7:if(qt){o.next=20;break}if(o.prev=8,o.t0=zr&&zr.requireFromFile,!o.t0){o.next=14;break}return o.next=13,zr.requireFromFile(r);case 13:o.t0=o.sent;case 14:return o.abrupt("return",o.t0);case 17:return o.prev=17,o.t1=o.catch(8),o.abrupt("return",null);case 20:if(!Mi){o.next=22;break}return o.abrupt("return",importScripts(r));case 22:return o.next=24,fetch(r);case 24:return n=o.sent,o.next=27,n.text();case 27:return i=o.sent,o.abrupt("return",Mx(i,r));case 29:case"end":return o.stop()}},e,null,[[8,17]])})),Du.apply(this,arguments)}function Mx(e,r){if(!qt)return zr.requireFromString&&zr.requireFromString(e,r);if(Mi)return eval.call(Vp,e),null;var t=document.createElement("script");t.id=r;try{t.appendChild(document.createTextNode(e))}catch{t.text=e}return document.body.appendChild(t),null}function Xp(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:5;if(typeof e=="string")return e.slice(0,r);if(ArrayBuffer.isView(e))return Jp(e.buffer,e.byteOffset,r);if(e instanceof ArrayBuffer){var t=0;return Jp(e,t,r)}return""}function Jp(e,r,t){if(e.byteLength<=r+t)return"";for(var n=new DataView(e),i="",a=0;a<t;a++)i+=String.fromCharCode(n.getUint8(r+a));return i}function Gu(e){try{return JSON.parse(e)}catch{throw new Error('Failed to parse JSON from data starting with "'.concat(Xp(e),'"'))}}function Pi(){for(var e=arguments.length,r=new Array(e),t=0;t<e;t++)r[t]=arguments[t];var n=r,i=n&&n.length>1&&n[0].constructor||null;if(!i)throw new Error('"concatenateTypedArrays" - incorrect quantity of arguments or arguments have incompatible data types');for(var a=n.reduce(function(h,d){return h+d.length},0),o=new i(a),s=0,u=0,f=n;u<f.length;u++){var l=f[u];o.set(l,s),s+=l.length}return o}function Wr(e,r,t){var n=t!==void 0?new Uint8Array(e).subarray(r,r+t):new Uint8Array(e).subarray(r),i=new Uint8Array(n);return i.buffer}function vr(e,r){return ce(e>=0),ce(r>0),e+(r-1)&~(r-1)}function Nu(e,r,t){var n;if(e instanceof ArrayBuffer)n=new Uint8Array(e);else{var i=e.byteOffset,a=e.byteLength;n=new Uint8Array(e.buffer||e.arrayBuffer,i,a)}return r.set(n,t),t+vr(n.byteLength,4)}N();q();Y();N();N();N();function Ii(){let e;if(typeof window<"u"&&window.performance)e=window.performance.now();else if(typeof process<"u"&&process.hrtime){let r=process.hrtime();e=r[0]*1e3+r[1]/1e6}else e=Date.now();return e}var Jr=class{constructor(r,t){c(this,"name",void 0),c(this,"type",void 0),c(this,"sampleSize",1),c(this,"time",0),c(this,"count",0),c(this,"samples",0),c(this,"lastTiming",0),c(this,"lastSampleTime",0),c(this,"lastSampleCount",0),c(this,"_count",0),c(this,"_time",0),c(this,"_samples",0),c(this,"_startTime",0),c(this,"_timerPending",!1),this.name=r,this.type=t,this.reset()}reset(){return this.time=0,this.count=0,this.samples=0,this.lastTiming=0,this.lastSampleTime=0,this.lastSampleCount=0,this._count=0,this._time=0,this._samples=0,this._startTime=0,this._timerPending=!1,this}setSampleSize(r){return this.sampleSize=r,this}incrementCount(){return this.addCount(1),this}decrementCount(){return this.subtractCount(1),this}addCount(r){return this._count+=r,this._samples++,this._checkSampling(),this}subtractCount(r){return this._count-=r,this._samples++,this._checkSampling(),this}addTime(r){return this._time+=r,this.lastTiming=r,this._samples++,this._checkSampling(),this}timeStart(){return this._startTime=Ii(),this._timerPending=!0,this}timeEnd(){return this._timerPending?(this.addTime(Ii()-this._startTime),this._timerPending=!1,this._checkSampling(),this):this}getSampleAverageCount(){return this.sampleSize>0?this.lastSampleCount/this.sampleSize:0}getSampleAverageTime(){return this.sampleSize>0?this.lastSampleTime/this.sampleSize:0}getSampleHz(){return this.lastSampleTime>0?this.sampleSize/(this.lastSampleTime/1e3):0}getAverageCount(){return this.samples>0?this.count/this.samples:0}getAverageTime(){return this.samples>0?this.time/this.samples:0}getHz(){return this.time>0?this.samples/(this.time/1e3):0}_checkSampling(){this._samples===this.sampleSize&&(this.lastSampleTime=this._time,this.lastSampleCount=this._count,this.count+=this._count,this.time+=this._time,this.samples+=this._samples,this._time=0,this._count=0,this._samples=0)}};var Ln=class{constructor(r){c(this,"id",void 0),c(this,"stats",{}),this.id=r.id,this.stats={},this._initializeStats(r.stats),Object.seal(this)}get(r){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"count";return this._getOrCreate({name:r,type:t})}get size(){return Object.keys(this.stats).length}reset(){for(let r of Object.values(this.stats))r.reset();return this}forEach(r){for(let t of Object.values(this.stats))r(t)}getTable(){let r={};return this.forEach(t=>{r[t.name]={time:t.time||0,count:t.count||0,average:t.getAverageTime()||0,hz:t.getHz()||0}}),r}_initializeStats(){(arguments.length>0&&arguments[0]!==void 0?arguments[0]:[]).forEach(t=>this._getOrCreate(t))}_getOrCreate(r){let{name:t,type:n}=r,i=this.stats[t];return i||(r instanceof Jr?i=r:i=new Jr(t,n),this.stats[t]=i),i}};function qp(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),t.push.apply(t,n)}return t}function Kp(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{};r%2?qp(Object(t),!0).forEach(function(n){c(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):qp(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}var Ox="Queued Requests",Px="Active Requests",Ix="Cancelled Requests",Rx="Queued Requests Ever",Fx="Active Requests Ever",Lx={id:"request-scheduler",throttleRequests:!0,maxRequests:6},Ri=function(){function e(){T(this,e);var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};c(this,"props",void 0),c(this,"stats",void 0),c(this,"activeRequestCount",0),c(this,"requestQueue",[]),c(this,"requestMap",new Map),c(this,"deferredUpdate",null),this.props=Kp(Kp({},Lx),r),this.stats=new Ln({id:this.props.id}),this.stats.get(Ox),this.stats.get(Px),this.stats.get(Ix),this.stats.get(Rx),this.stats.get(Fx)}return w(e,[{key:"scheduleRequest",value:function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:function(){return 0};if(!this.props.throttleRequests)return Promise.resolve({done:function(){}});if(this.requestMap.has(t))return this.requestMap.get(t);var i={handle:t,priority:0,getPriority:n},a=new Promise(function(o){return i.resolve=o,i});return this.requestQueue.push(i),this.requestMap.set(t,a),this._issueNewRequests(),a}},{key:"_issueRequest",value:function(t){var n=this,i=t.handle,a=t.resolve,o=!1,s=function(){o||(o=!0,n.requestMap.delete(i),n.activeRequestCount--,n._issueNewRequests())};return this.activeRequestCount++,a?a({done:s}):Promise.resolve({done:s})}},{key:"_issueNewRequests",value:function(){var t=this;this.deferredUpdate||(this.deferredUpdate=setTimeout(function(){return t._issueNewRequestsAsync()},0))}},{key:"_issueNewRequestsAsync",value:function(){this.deferredUpdate=null;var t=Math.max(this.props.maxRequests-this.activeRequestCount,0);if(t!==0){this._updateAllRequests();for(var n=0;n<t;++n){var i=this.requestQueue.shift();i&&this._issueRequest(i)}}}},{key:"_updateAllRequests",value:function(){for(var t=this.requestQueue,n=0;n<t.length;++n){var i=t[n];this._updateRequest(i)||(t.splice(n,1),this.requestMap.delete(i.handle),n--)}t.sort(function(a,o){return a.priority-o.priority})}},{key:"_updateRequest",value:function(t){return t.priority=t.getPriority(t.handle),t.priority<0?(t.resolve(null),!1):!0}}]),e}();var kn={};bt(kn,{dirname:()=>Dx,filename:()=>kx,join:()=>Gx,resolve:()=>Nx});function Yp(){var e;if(typeof process<"u"&&typeof process.cwd<"u")return process.cwd();var r=(e=window.location)===null||e===void 0?void 0:e.pathname;return r?.slice(0,r.lastIndexOf("/")+1)||""}function kx(e){var r=e?e.lastIndexOf("/"):-1;return r>=0?e.substr(r+1):""}function Dx(e){var r=e?e.lastIndexOf("/"):-1;return r>=0?e.substr(0,r):""}function Gx(){for(var e=arguments.length,r=new Array(e),t=0;t<e;t++)r[t]=arguments[t];var n="/";return r=r.map(function(i,a){return a&&(i=i.replace(new RegExp("^".concat(n)),"")),a!==r.length-1&&(i=i.replace(new RegExp("".concat(n,"$")),"")),i}),r.join(n)}function Nx(){for(var e=[],r=0;r<arguments.length;r++)e[r]=r<0||arguments.length<=r?void 0:arguments[r];for(var t="",n=!1,i,a=e.length-1;a>=-1&&!n;a--){var o=void 0;a>=0?o=e[a]:(i===void 0&&(i=Yp()),o=i),o.length!==0&&(t="".concat(o,"/").concat(t),n=o.charCodeAt(0)===Fi)}return t=Ux(t,!n),n?"/".concat(t):t.length>0?t:"."}var Fi=47,Uu=46;function Ux(e,r){for(var t="",n=-1,i=0,a,o=!1,s=0;s<=e.length;++s){if(s<e.length)a=e.charCodeAt(s);else{if(a===Fi)break;a=Fi}if(a===Fi){if(!(n===s-1||i===1))if(n!==s-1&&i===2){if(t.length<2||!o||t.charCodeAt(t.length-1)!==Uu||t.charCodeAt(t.length-2)!==Uu){if(t.length>2){for(var u=t.length-1,f=u;f>=0&&t.charCodeAt(f)!==Fi;--f);if(f!==u){t=f===-1?"":t.slice(0,f),n=s,i=0,o=!1;continue}}else if(t.length===2||t.length===1){t="",n=s,i=0,o=!1;continue}}r&&(t.length>0?t+="/..":t="..",o=!0)}else{var l=e.slice(n+1,s);t.length>0?t+="/".concat(l):t=l,o=!1}n=s,i=0}else a===Uu&&i!==-1?++i:i=-1}return t}N();var Hu=X(re());function Zp(e,r){var t,n,i,a=(t=pt.parseTextSync)===null||t===void 0?void 0:t.call(pt,e,r),o=(a==null||(n=a.ServiceExceptionReport)===null||n===void 0?void 0:n.ServiceException)||(a==null||(i=a["ogc:ServiceExceptionReport"])===null||i===void 0?void 0:i["ogc:ServiceException"]),s=typeof o=="string"?o:o.value||o.code||"Unknown error";return s}function $p(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),t.push.apply(t,n)}return t}function Qp(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{};r%2?$p(Object(t),!0).forEach(function(n){c(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):$p(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}var jx="3.4.13",Dn={id:"wms-error",name:"WMS Error",module:"wms",version:jx,worker:!1,extensions:["xml"],mimeTypes:["application/vnd.ogc.se_xml","application/xml","text/xml"],testText:Hx,options:{wms:{throwOnError:!1}},parse:function(){var e=I(Hu.default.mark(function t(n,i){return Hu.default.wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return o.abrupt("return",ju(new TextDecoder().decode(n),i));case 1:case"end":return o.stop()}},t)}));function r(t,n){return e.apply(this,arguments)}return r}(),parseSync:function(r,t){return ju(new TextDecoder().decode(r),t)},parseTextSync:function(r,t){return ju(r,t)}};function Hx(e){return e.startsWith("<?xml")}function ju(e,r){var t=Qp(Qp({},Dn.options.wms),r?.wms),n=Zp(e,t),i=t.minimalErrors?n:"WMS Service error: ".concat(n);if(t.throwOnError)throw new Error(i);return i}var Xu=X(re());_u();function Vu(e){if(Array.isArray(e))return Fn(e)}function zu(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}bu();function Wu(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
14
|
+
`):(this.indentate=function(){return""},this.tagEndChar=">",this.newLine="")}mr.prototype.build=function(e){return this.options.preserveOrder?fx(e,this.options):(Array.isArray(e)&&this.options.arrayNodeName&&this.options.arrayNodeName.length>1&&(e=c({},this.options.arrayNodeName,e)),this.j2x(e,0).val)};mr.prototype.j2x=function(e,r){var t="",n="";for(var i in e)if(typeof e[i]>"u")this.isAttribute(i)&&(n+="");else if(e[i]===null)this.isAttribute(i)?n+="":i[0]==="?"?n+=this.indentate(r)+"<"+i+"?"+this.tagEndChar:n+=this.indentate(r)+"<"+i+"/"+this.tagEndChar;else if(e[i]instanceof Date)n+=this.buildTextValNode(e[i],i,"",r);else if(te(e[i])!=="object"){var a=this.isAttribute(i);if(a)t+=this.buildAttrPairStr(a,""+e[i]);else if(i===this.options.textNodeName){var o=this.options.tagValueProcessor(i,""+e[i]);n+=this.replaceEntitiesValue(o)}else n+=this.buildTextValNode(e[i],i,"",r)}else if(Array.isArray(e[i])){for(var s=e[i].length,u="",f=0;f<s;f++){var l=e[i][f];typeof l>"u"||(l===null?i[0]==="?"?n+=this.indentate(r)+"<"+i+"?"+this.tagEndChar:n+=this.indentate(r)+"<"+i+"/"+this.tagEndChar:te(l)==="object"?this.options.oneListGroup?u+=this.j2x(l,r+1).val:u+=this.processTextOrObjNode(l,i,r):u+=this.buildTextValNode(l,i,"",r))}this.options.oneListGroup&&(u=this.buildObjectNode(u,i,"",r)),n+=u}else if(this.options.attributesGroupName&&i===this.options.attributesGroupName)for(var h=Object.keys(e[i]),d=h.length,p=0;p<d;p++)t+=this.buildAttrPairStr(h[p],""+e[i][h[p]]);else n+=this.processTextOrObjNode(e[i],i,r);return{attrStr:t,val:n}};mr.prototype.buildAttrPairStr=function(e,r){return r=this.options.attributeValueProcessor(e,""+r),r=this.replaceEntitiesValue(r),this.options.suppressBooleanAttributes&&r==="true"?" "+e:" "+e+'="'+r+'"'};function cx(e,r,t){var n=this.j2x(e,t+1);return e[this.options.textNodeName]!==void 0&&Object.keys(e).length===1?this.buildTextValNode(e[this.options.textNodeName],r,n.attrStr,t):this.buildObjectNode(n.val,r,n.attrStr,t)}mr.prototype.buildObjectNode=function(e,r,t,n){if(e==="")return r[0]==="?"?this.indentate(n)+"<"+r+t+"?"+this.tagEndChar:this.indentate(n)+"<"+r+t+this.closeTag(r)+this.tagEndChar;var i="</"+r+this.tagEndChar,a="";return r[0]==="?"&&(a="?",i=""),(t||t==="")&&e.indexOf("<")===-1?this.indentate(n)+"<"+r+t+a+">"+e+i:this.options.commentPropName!==!1&&r===this.options.commentPropName&&a.length===0?this.indentate(n)+"<!--".concat(e,"-->")+this.newLine:this.indentate(n)+"<"+r+t+a+this.tagEndChar+e+this.indentate(n)+i};mr.prototype.closeTag=function(e){var r="";return this.options.unpairedTags.indexOf(e)!==-1?this.options.suppressUnpairedNode||(r="/"):this.options.suppressEmptyNode?r="/":r="></".concat(e),r};mr.prototype.buildTextValNode=function(e,r,t,n){if(this.options.cdataPropName!==!1&&r===this.options.cdataPropName)return this.indentate(n)+"<![CDATA[".concat(e,"]]>")+this.newLine;if(this.options.commentPropName!==!1&&r===this.options.commentPropName)return this.indentate(n)+"<!--".concat(e,"-->")+this.newLine;if(r[0]==="?")return this.indentate(n)+"<"+r+t+"?"+this.tagEndChar;var i=this.options.tagValueProcessor(r,e);return i=this.replaceEntitiesValue(i),i===""?this.indentate(n)+"<"+r+t+this.closeTag(r)+this.tagEndChar:this.indentate(n)+"<"+r+t+">"+i+"</"+r+this.tagEndChar};mr.prototype.replaceEntitiesValue=function(e){if(e&&e.length>0&&this.options.processEntities)for(var r=0;r<this.options.entities.length;r++){var t=this.options.entities[r];e=e.replace(t.regex,t.val)}return e};function hx(e){return this.options.indentBy.repeat(e)}function dx(e){return e.startsWith(this.options.attributeNamePrefix)&&e!==this.options.textNodeName?e.substr(this.attrPrefixLen):!1}Op.exports=mr});var Rp=Ce((wF,Ip)=>{"use strict";var px=Cu(),mx=Ep(),vx=Pp();Ip.exports={XMLParser:mx,XMLValidator:px,XMLBuilder:vx}});var zp=Ce(()=>{});var Df=Ce((lv,qi)=>{(function(e,r){typeof define=="function"&&define.amd?define([],r):typeof Jd=="function"&&typeof qi=="object"&&qi&&qi.exports?qi.exports=r():(e.dcodeIO=e.dcodeIO||{}).Long=r()})(lv,function(){"use strict";function e(S,_,R){this.low=S|0,this.high=_|0,this.unsigned=!!R}e.prototype.__isLong__,Object.defineProperty(e.prototype,"__isLong__",{value:!0,enumerable:!1,configurable:!1});function r(S){return(S&&S.__isLong__)===!0}e.isLong=r;var t={},n={};function i(S,_){var R,k,U;return _?(S>>>=0,(U=0<=S&&S<256)&&(k=n[S],k)?k:(R=o(S,(S|0)<0?-1:0,!0),U&&(n[S]=R),R)):(S|=0,(U=-128<=S&&S<128)&&(k=t[S],k)?k:(R=o(S,S<0?-1:0,!1),U&&(t[S]=R),R))}e.fromInt=i;function a(S,_){if(isNaN(S)||!isFinite(S))return _?y:g;if(_){if(S<0)return y;if(S>=p)return C}else{if(S<=-m)return F;if(S+1>=m)return M}return S<0?a(-S,_).neg():o(S%d|0,S/d|0,_)}e.fromNumber=a;function o(S,_,R){return new e(S,_,R)}e.fromBits=o;var s=Math.pow;function u(S,_,R){if(S.length===0)throw Error("empty string");if(S==="NaN"||S==="Infinity"||S==="+Infinity"||S==="-Infinity")return g;if(typeof _=="number"?(R=_,_=!1):_=!!_,R=R||10,R<2||36<R)throw RangeError("radix");var k;if((k=S.indexOf("-"))>0)throw Error("interior hyphen");if(k===0)return u(S.substring(1),_,R).neg();for(var U=a(s(R,8)),j=g,Z=0;Z<S.length;Z+=8){var P=Math.min(8,S.length-Z),O=parseInt(S.substring(Z,Z+P),R);if(P<8){var G=a(s(R,P));j=j.mul(G).add(a(O))}else j=j.mul(U),j=j.add(a(O))}return j.unsigned=_,j}e.fromString=u;function f(S){return S instanceof e?S:typeof S=="number"?a(S):typeof S=="string"?u(S):o(S.low,S.high,S.unsigned)}e.fromValue=f;var l=1<<16,h=1<<24,d=l*l,p=d*d,m=p/2,v=i(h),g=i(0);e.ZERO=g;var y=i(0,!0);e.UZERO=y;var A=i(1);e.ONE=A;var x=i(1,!0);e.UONE=x;var b=i(-1);e.NEG_ONE=b;var M=o(-1,2147483647,!1);e.MAX_VALUE=M;var C=o(-1,-1,!0);e.MAX_UNSIGNED_VALUE=C;var F=o(0,-2147483648,!1);e.MIN_VALUE=F;var B=e.prototype;return B.toInt=function(){return this.unsigned?this.low>>>0:this.low},B.toNumber=function(){return this.unsigned?(this.high>>>0)*d+(this.low>>>0):this.high*d+(this.low>>>0)},B.toString=function(_){if(_=_||10,_<2||36<_)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative())if(this.eq(F)){var R=a(_),k=this.div(R),U=k.mul(R).sub(this);return k.toString(_)+U.toInt().toString(_)}else return"-"+this.neg().toString(_);for(var j=a(s(_,6),this.unsigned),Z=this,P="";;){var O=Z.div(j),G=Z.sub(O.mul(j)).toInt()>>>0,J=G.toString(_);if(Z=O,Z.isZero())return J+P;for(;J.length<6;)J="0"+J;P=""+J+P}},B.getHighBits=function(){return this.high},B.getHighBitsUnsigned=function(){return this.high>>>0},B.getLowBits=function(){return this.low},B.getLowBitsUnsigned=function(){return this.low>>>0},B.getNumBitsAbs=function(){if(this.isNegative())return this.eq(F)?64:this.neg().getNumBitsAbs();for(var _=this.high!=0?this.high:this.low,R=31;R>0&&!(_&1<<R);R--);return this.high!=0?R+33:R+1},B.isZero=function(){return this.high===0&&this.low===0},B.isNegative=function(){return!this.unsigned&&this.high<0},B.isPositive=function(){return this.unsigned||this.high>=0},B.isOdd=function(){return(this.low&1)===1},B.isEven=function(){return(this.low&1)===0},B.equals=function(_){return r(_)||(_=f(_)),this.unsigned!==_.unsigned&&this.high>>>31===1&&_.high>>>31===1?!1:this.high===_.high&&this.low===_.low},B.eq=B.equals,B.notEquals=function(_){return!this.eq(_)},B.neq=B.notEquals,B.lessThan=function(_){return this.comp(_)<0},B.lt=B.lessThan,B.lessThanOrEqual=function(_){return this.comp(_)<=0},B.lte=B.lessThanOrEqual,B.greaterThan=function(_){return this.comp(_)>0},B.gt=B.greaterThan,B.greaterThanOrEqual=function(_){return this.comp(_)>=0},B.gte=B.greaterThanOrEqual,B.compare=function(_){if(r(_)||(_=f(_)),this.eq(_))return 0;var R=this.isNegative(),k=_.isNegative();return R&&!k?-1:!R&&k?1:this.unsigned?_.high>>>0>this.high>>>0||_.high===this.high&&_.low>>>0>this.low>>>0?-1:1:this.sub(_).isNegative()?-1:1},B.comp=B.compare,B.negate=function(){return!this.unsigned&&this.eq(F)?F:this.not().add(A)},B.neg=B.negate,B.add=function(_){r(_)||(_=f(_));var R=this.high>>>16,k=this.high&65535,U=this.low>>>16,j=this.low&65535,Z=_.high>>>16,P=_.high&65535,O=_.low>>>16,G=_.low&65535,J=0,V=0,ee=0,ie=0;return ie+=j+G,ee+=ie>>>16,ie&=65535,ee+=U+O,V+=ee>>>16,ee&=65535,V+=k+P,J+=V>>>16,V&=65535,J+=R+Z,J&=65535,o(ee<<16|ie,J<<16|V,this.unsigned)},B.subtract=function(_){return r(_)||(_=f(_)),this.add(_.neg())},B.sub=B.subtract,B.multiply=function(_){if(this.isZero()||(r(_)||(_=f(_)),_.isZero()))return g;if(this.eq(F))return _.isOdd()?F:g;if(_.eq(F))return this.isOdd()?F:g;if(this.isNegative())return _.isNegative()?this.neg().mul(_.neg()):this.neg().mul(_).neg();if(_.isNegative())return this.mul(_.neg()).neg();if(this.lt(v)&&_.lt(v))return a(this.toNumber()*_.toNumber(),this.unsigned);var R=this.high>>>16,k=this.high&65535,U=this.low>>>16,j=this.low&65535,Z=_.high>>>16,P=_.high&65535,O=_.low>>>16,G=_.low&65535,J=0,V=0,ee=0,ie=0;return ie+=j*G,ee+=ie>>>16,ie&=65535,ee+=U*G,V+=ee>>>16,ee&=65535,ee+=j*O,V+=ee>>>16,ee&=65535,V+=k*G,J+=V>>>16,V&=65535,V+=U*O,J+=V>>>16,V&=65535,V+=j*P,J+=V>>>16,V&=65535,J+=R*G+k*O+U*P+j*Z,J&=65535,o(ee<<16|ie,J<<16|V,this.unsigned)},B.mul=B.multiply,B.divide=function(_){if(r(_)||(_=f(_)),_.isZero())throw Error("division by zero");if(this.isZero())return this.unsigned?y:g;var R,k,U;if(this.unsigned){if(_.unsigned||(_=_.toUnsigned()),_.gt(this))return y;if(_.gt(this.shru(1)))return x;U=y}else{if(this.eq(F)){if(_.eq(A)||_.eq(b))return F;if(_.eq(F))return A;var j=this.shr(1);return R=j.div(_).shl(1),R.eq(g)?_.isNegative()?A:b:(k=this.sub(_.mul(R)),U=R.add(k.div(_)),U)}else if(_.eq(F))return this.unsigned?y:g;if(this.isNegative())return _.isNegative()?this.neg().div(_.neg()):this.neg().div(_).neg();if(_.isNegative())return this.div(_.neg()).neg();U=g}for(k=this;k.gte(_);){R=Math.max(1,Math.floor(k.toNumber()/_.toNumber()));for(var Z=Math.ceil(Math.log(R)/Math.LN2),P=Z<=48?1:s(2,Z-48),O=a(R),G=O.mul(_);G.isNegative()||G.gt(k);)R-=P,O=a(R,this.unsigned),G=O.mul(_);O.isZero()&&(O=A),U=U.add(O),k=k.sub(G)}return U},B.div=B.divide,B.modulo=function(_){return r(_)||(_=f(_)),this.sub(this.div(_).mul(_))},B.mod=B.modulo,B.not=function(){return o(~this.low,~this.high,this.unsigned)},B.and=function(_){return r(_)||(_=f(_)),o(this.low&_.low,this.high&_.high,this.unsigned)},B.or=function(_){return r(_)||(_=f(_)),o(this.low|_.low,this.high|_.high,this.unsigned)},B.xor=function(_){return r(_)||(_=f(_)),o(this.low^_.low,this.high^_.high,this.unsigned)},B.shiftLeft=function(_){return r(_)&&(_=_.toInt()),(_&=63)===0?this:_<32?o(this.low<<_,this.high<<_|this.low>>>32-_,this.unsigned):o(0,this.low<<_-32,this.unsigned)},B.shl=B.shiftLeft,B.shiftRight=function(_){return r(_)&&(_=_.toInt()),(_&=63)===0?this:_<32?o(this.low>>>_|this.high<<32-_,this.high>>_,this.unsigned):o(this.high>>_-32,this.high>=0?0:-1,this.unsigned)},B.shr=B.shiftRight,B.shiftRightUnsigned=function(_){if(r(_)&&(_=_.toInt()),_&=63,_===0)return this;var R=this.high;if(_<32){var k=this.low;return o(k>>>_|R<<32-_,R>>>_,this.unsigned)}else return _===32?o(R,0,this.unsigned):o(R>>>_-32,0,this.unsigned)},B.shru=B.shiftRightUnsigned,B.toSigned=function(){return this.unsigned?o(this.low,this.high,!1):this},B.toUnsigned=function(){return this.unsigned?this:o(this.low,this.high,!0)},B.toBytes=function(S){return S?this.toBytesLE():this.toBytesBE()},B.toBytesLE=function(){var S=this.high,_=this.low;return[_&255,_>>>8&255,_>>>16&255,_>>>24&255,S&255,S>>>8&255,S>>>16&255,S>>>24&255]},B.toBytesBE=function(){var S=this.high,_=this.low;return[S>>>24&255,S>>>16&255,S>>>8&255,S&255,_>>>24&255,_>>>16&255,_>>>8&255,_&255]},e})});var hl=Ce((nj,Cg)=>{Cg.exports=globalThis.h3||{}});var pl=Ce((Ej,kg)=>{kg.exports=globalThis.luma});var Ho=Ce((Sj,Dg)=>{Dg.exports=globalThis.deck});var ni=Ce((HW,Hy)=>{Hy.exports=globalThis.loaders});var W_=Ce((Ote,z_)=>{z_.exports=globalThis.deck});var lb=Ce(Od=>{Od.read=function(e,r,t,n,i){var a,o,s=i*8-n-1,u=(1<<s)-1,f=u>>1,l=-7,h=t?i-1:0,d=t?-1:1,p=e[r+h];for(h+=d,a=p&(1<<-l)-1,p>>=-l,l+=s;l>0;a=a*256+e[r+h],h+=d,l-=8);for(o=a&(1<<-l)-1,a>>=-l,l+=n;l>0;o=o*256+e[r+h],h+=d,l-=8);if(a===0)a=1-f;else{if(a===u)return o?NaN:(p?-1:1)*(1/0);o=o+Math.pow(2,n),a=a-f}return(p?-1:1)*o*Math.pow(2,a-n)};Od.write=function(e,r,t,n,i,a){var o,s,u,f=a*8-i-1,l=(1<<f)-1,h=l>>1,d=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:a-1,m=n?1:-1,v=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(s=isNaN(r)?1:0,o=l):(o=Math.floor(Math.log(r)/Math.LN2),r*(u=Math.pow(2,-o))<1&&(o--,u*=2),o+h>=1?r+=d/u:r+=d*Math.pow(2,1-h),r*u>=2&&(o++,u/=2),o+h>=l?(s=0,o=l):o+h>=1?(s=(r*u-1)*Math.pow(2,i),o=o+h):(s=r*Math.pow(2,h-1)*Math.pow(2,i),o=0));i>=8;e[t+p]=s&255,p+=m,s/=256,i-=8);for(o=o<<i|s,f+=i;f>0;e[t+p]=o&255,p+=m,o/=256,f-=8);e[t+p-m]|=v*128}});var vb=Ce((bre,mb)=>{"use strict";mb.exports=Ae;var lu=lb();function Ae(e){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(e)?e:new Uint8Array(e||0),this.pos=0,this.type=0,this.length=this.buf.length}Ae.Varint=0;Ae.Fixed64=1;Ae.Bytes=2;Ae.Fixed32=5;var Pd=(1<<16)*(1<<16),cb=1/Pd,vI=12,pb=typeof TextDecoder>"u"?null:new TextDecoder("utf8");Ae.prototype={destroy:function(){this.buf=null},readFields:function(e,r,t){for(t=t||this.length;this.pos<t;){var n=this.readVarint(),i=n>>3,a=this.pos;this.type=n&7,e(i,r,this),this.pos===a&&this.skip(n)}return r},readMessage:function(e,r){return this.readFields(e,r,this.readVarint()+this.pos)},readFixed32:function(){var e=cu(this.buf,this.pos);return this.pos+=4,e},readSFixed32:function(){var e=db(this.buf,this.pos);return this.pos+=4,e},readFixed64:function(){var e=cu(this.buf,this.pos)+cu(this.buf,this.pos+4)*Pd;return this.pos+=8,e},readSFixed64:function(){var e=cu(this.buf,this.pos)+db(this.buf,this.pos+4)*Pd;return this.pos+=8,e},readFloat:function(){var e=lu.read(this.buf,this.pos,!0,23,4);return this.pos+=4,e},readDouble:function(){var e=lu.read(this.buf,this.pos,!0,52,8);return this.pos+=8,e},readVarint:function(e){var r=this.buf,t,n;return n=r[this.pos++],t=n&127,n<128||(n=r[this.pos++],t|=(n&127)<<7,n<128)||(n=r[this.pos++],t|=(n&127)<<14,n<128)||(n=r[this.pos++],t|=(n&127)<<21,n<128)?t:(n=r[this.pos],t|=(n&15)<<28,gI(t,e,this))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var e=this.readVarint();return e%2===1?(e+1)/-2:e/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var e=this.readVarint()+this.pos,r=this.pos;return this.pos=e,e-r>=vI&&pb?PI(this.buf,r,e):OI(this.buf,r,e)},readBytes:function(){var e=this.readVarint()+this.pos,r=this.buf.subarray(this.pos,e);return this.pos=e,r},readPackedVarint:function(e,r){if(this.type!==Ae.Bytes)return e.push(this.readVarint(r));var t=dr(this);for(e=e||[];this.pos<t;)e.push(this.readVarint(r));return e},readPackedSVarint:function(e){if(this.type!==Ae.Bytes)return e.push(this.readSVarint());var r=dr(this);for(e=e||[];this.pos<r;)e.push(this.readSVarint());return e},readPackedBoolean:function(e){if(this.type!==Ae.Bytes)return e.push(this.readBoolean());var r=dr(this);for(e=e||[];this.pos<r;)e.push(this.readBoolean());return e},readPackedFloat:function(e){if(this.type!==Ae.Bytes)return e.push(this.readFloat());var r=dr(this);for(e=e||[];this.pos<r;)e.push(this.readFloat());return e},readPackedDouble:function(e){if(this.type!==Ae.Bytes)return e.push(this.readDouble());var r=dr(this);for(e=e||[];this.pos<r;)e.push(this.readDouble());return e},readPackedFixed32:function(e){if(this.type!==Ae.Bytes)return e.push(this.readFixed32());var r=dr(this);for(e=e||[];this.pos<r;)e.push(this.readFixed32());return e},readPackedSFixed32:function(e){if(this.type!==Ae.Bytes)return e.push(this.readSFixed32());var r=dr(this);for(e=e||[];this.pos<r;)e.push(this.readSFixed32());return e},readPackedFixed64:function(e){if(this.type!==Ae.Bytes)return e.push(this.readFixed64());var r=dr(this);for(e=e||[];this.pos<r;)e.push(this.readFixed64());return e},readPackedSFixed64:function(e){if(this.type!==Ae.Bytes)return e.push(this.readSFixed64());var r=dr(this);for(e=e||[];this.pos<r;)e.push(this.readSFixed64());return e},skip:function(e){var r=e&7;if(r===Ae.Varint)for(;this.buf[this.pos++]>127;);else if(r===Ae.Bytes)this.pos=this.readVarint()+this.pos;else if(r===Ae.Fixed32)this.pos+=4;else if(r===Ae.Fixed64)this.pos+=8;else throw new Error("Unimplemented type: "+r)},writeTag:function(e,r){this.writeVarint(e<<3|r)},realloc:function(e){for(var r=this.length||16;r<this.pos+e;)r*=2;if(r!==this.length){var t=new Uint8Array(r);t.set(this.buf),this.buf=t,this.length=r}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(e){this.realloc(4),Ei(this.buf,e,this.pos),this.pos+=4},writeSFixed32:function(e){this.realloc(4),Ei(this.buf,e,this.pos),this.pos+=4},writeFixed64:function(e){this.realloc(8),Ei(this.buf,e&-1,this.pos),Ei(this.buf,Math.floor(e*cb),this.pos+4),this.pos+=8},writeSFixed64:function(e){this.realloc(8),Ei(this.buf,e&-1,this.pos),Ei(this.buf,Math.floor(e*cb),this.pos+4),this.pos+=8},writeVarint:function(e){if(e=+e||0,e>268435455||e<0){yI(e,this);return}this.realloc(4),this.buf[this.pos++]=e&127|(e>127?128:0),!(e<=127)&&(this.buf[this.pos++]=(e>>>=7)&127|(e>127?128:0),!(e<=127)&&(this.buf[this.pos++]=(e>>>=7)&127|(e>127?128:0),!(e<=127)&&(this.buf[this.pos++]=e>>>7&127)))},writeSVarint:function(e){this.writeVarint(e<0?-e*2-1:e*2)},writeBoolean:function(e){this.writeVarint(Boolean(e))},writeString:function(e){e=String(e),this.realloc(e.length*4),this.pos++;var r=this.pos;this.pos=II(this.buf,e,this.pos);var t=this.pos-r;t>=128&&hb(r,t,this),this.pos=r-1,this.writeVarint(t),this.pos+=t},writeFloat:function(e){this.realloc(4),lu.write(this.buf,e,this.pos,!0,23,4),this.pos+=4},writeDouble:function(e){this.realloc(8),lu.write(this.buf,e,this.pos,!0,52,8),this.pos+=8},writeBytes:function(e){var r=e.length;this.writeVarint(r),this.realloc(r);for(var t=0;t<r;t++)this.buf[this.pos++]=e[t]},writeRawMessage:function(e,r){this.pos++;var t=this.pos;e(r,this);var n=this.pos-t;n>=128&&hb(t,n,this),this.pos=t-1,this.writeVarint(n),this.pos+=n},writeMessage:function(e,r,t){this.writeTag(e,Ae.Bytes),this.writeRawMessage(r,t)},writePackedVarint:function(e,r){r.length&&this.writeMessage(e,bI,r)},writePackedSVarint:function(e,r){r.length&&this.writeMessage(e,TI,r)},writePackedBoolean:function(e,r){r.length&&this.writeMessage(e,SI,r)},writePackedFloat:function(e,r){r.length&&this.writeMessage(e,xI,r)},writePackedDouble:function(e,r){r.length&&this.writeMessage(e,EI,r)},writePackedFixed32:function(e,r){r.length&&this.writeMessage(e,wI,r)},writePackedSFixed32:function(e,r){r.length&&this.writeMessage(e,CI,r)},writePackedFixed64:function(e,r){r.length&&this.writeMessage(e,BI,r)},writePackedSFixed64:function(e,r){r.length&&this.writeMessage(e,MI,r)},writeBytesField:function(e,r){this.writeTag(e,Ae.Bytes),this.writeBytes(r)},writeFixed32Field:function(e,r){this.writeTag(e,Ae.Fixed32),this.writeFixed32(r)},writeSFixed32Field:function(e,r){this.writeTag(e,Ae.Fixed32),this.writeSFixed32(r)},writeFixed64Field:function(e,r){this.writeTag(e,Ae.Fixed64),this.writeFixed64(r)},writeSFixed64Field:function(e,r){this.writeTag(e,Ae.Fixed64),this.writeSFixed64(r)},writeVarintField:function(e,r){this.writeTag(e,Ae.Varint),this.writeVarint(r)},writeSVarintField:function(e,r){this.writeTag(e,Ae.Varint),this.writeSVarint(r)},writeStringField:function(e,r){this.writeTag(e,Ae.Bytes),this.writeString(r)},writeFloatField:function(e,r){this.writeTag(e,Ae.Fixed32),this.writeFloat(r)},writeDoubleField:function(e,r){this.writeTag(e,Ae.Fixed64),this.writeDouble(r)},writeBooleanField:function(e,r){this.writeVarintField(e,Boolean(r))}};function gI(e,r,t){var n=t.buf,i,a;if(a=n[t.pos++],i=(a&112)>>4,a<128||(a=n[t.pos++],i|=(a&127)<<3,a<128)||(a=n[t.pos++],i|=(a&127)<<10,a<128)||(a=n[t.pos++],i|=(a&127)<<17,a<128)||(a=n[t.pos++],i|=(a&127)<<24,a<128)||(a=n[t.pos++],i|=(a&1)<<31,a<128))return xi(e,i,r);throw new Error("Expected varint not more than 10 bytes")}function dr(e){return e.type===Ae.Bytes?e.readVarint()+e.pos:e.pos+1}function xi(e,r,t){return t?r*4294967296+(e>>>0):(r>>>0)*4294967296+(e>>>0)}function yI(e,r){var t,n;if(e>=0?(t=e%4294967296|0,n=e/4294967296|0):(t=~(-e%4294967296),n=~(-e/4294967296),t^4294967295?t=t+1|0:(t=0,n=n+1|0)),e>=18446744073709552e3||e<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");r.realloc(10),AI(t,n,r),_I(n,r)}function AI(e,r,t){t.buf[t.pos++]=e&127|128,e>>>=7,t.buf[t.pos++]=e&127|128,e>>>=7,t.buf[t.pos++]=e&127|128,e>>>=7,t.buf[t.pos++]=e&127|128,e>>>=7,t.buf[t.pos]=e&127}function _I(e,r){var t=(e&7)<<4;r.buf[r.pos++]|=t|((e>>>=3)?128:0),e&&(r.buf[r.pos++]=e&127|((e>>>=7)?128:0),e&&(r.buf[r.pos++]=e&127|((e>>>=7)?128:0),e&&(r.buf[r.pos++]=e&127|((e>>>=7)?128:0),e&&(r.buf[r.pos++]=e&127|((e>>>=7)?128:0),e&&(r.buf[r.pos++]=e&127)))))}function hb(e,r,t){var n=r<=16383?1:r<=2097151?2:r<=268435455?3:Math.floor(Math.log(r)/(Math.LN2*7));t.realloc(n);for(var i=t.pos-1;i>=e;i--)t.buf[i+n]=t.buf[i]}function bI(e,r){for(var t=0;t<e.length;t++)r.writeVarint(e[t])}function TI(e,r){for(var t=0;t<e.length;t++)r.writeSVarint(e[t])}function xI(e,r){for(var t=0;t<e.length;t++)r.writeFloat(e[t])}function EI(e,r){for(var t=0;t<e.length;t++)r.writeDouble(e[t])}function SI(e,r){for(var t=0;t<e.length;t++)r.writeBoolean(e[t])}function wI(e,r){for(var t=0;t<e.length;t++)r.writeFixed32(e[t])}function CI(e,r){for(var t=0;t<e.length;t++)r.writeSFixed32(e[t])}function BI(e,r){for(var t=0;t<e.length;t++)r.writeFixed64(e[t])}function MI(e,r){for(var t=0;t<e.length;t++)r.writeSFixed64(e[t])}function cu(e,r){return(e[r]|e[r+1]<<8|e[r+2]<<16)+e[r+3]*16777216}function Ei(e,r,t){e[t]=r,e[t+1]=r>>>8,e[t+2]=r>>>16,e[t+3]=r>>>24}function db(e,r){return(e[r]|e[r+1]<<8|e[r+2]<<16)+(e[r+3]<<24)}function OI(e,r,t){for(var n="",i=r;i<t;){var a=e[i],o=null,s=a>239?4:a>223?3:a>191?2:1;if(i+s>t)break;var u,f,l;s===1?a<128&&(o=a):s===2?(u=e[i+1],(u&192)===128&&(o=(a&31)<<6|u&63,o<=127&&(o=null))):s===3?(u=e[i+1],f=e[i+2],(u&192)===128&&(f&192)===128&&(o=(a&15)<<12|(u&63)<<6|f&63,(o<=2047||o>=55296&&o<=57343)&&(o=null))):s===4&&(u=e[i+1],f=e[i+2],l=e[i+3],(u&192)===128&&(f&192)===128&&(l&192)===128&&(o=(a&15)<<18|(u&63)<<12|(f&63)<<6|l&63,(o<=65535||o>=1114112)&&(o=null))),o===null?(o=65533,s=1):o>65535&&(o-=65536,n+=String.fromCharCode(o>>>10&1023|55296),o=56320|o&1023),n+=String.fromCharCode(o),i+=s}return n}function PI(e,r,t){return pb.decode(e.subarray(r,t))}function II(e,r,t){for(var n=0,i,a;n<r.length;n++){if(i=r.charCodeAt(n),i>55295&&i<57344)if(a)if(i<56320){e[t++]=239,e[t++]=191,e[t++]=189,a=i;continue}else i=a-55296<<10|i-56320|65536,a=null;else{i>56319||n+1===r.length?(e[t++]=239,e[t++]=191,e[t++]=189):a=i;continue}else a&&(e[t++]=239,e[t++]=191,e[t++]=189,a=null);i<128?e[t++]=i:(i<2048?e[t++]=i>>6|192:(i<65536?e[t++]=i>>12|224:(e[t++]=i>>18|240,e[t++]=i>>12&63|128),e[t++]=i>>6&63|128),e[t++]=i&63|128)}return t}});var Da={};bt(Da,{GeohashLayer:()=>gu,GreatCircleLayer:()=>ho,H3ClusterLayer:()=>jo,H3HexagonLayer:()=>nn,MVTLayer:()=>vu,QuadkeyLayer:()=>vo,S2Layer:()=>mo,TerrainLayer:()=>nu,Tile3DLayer:()=>qs,TileLayer:()=>er,TripsLayer:()=>Go,_GeoCellLayer:()=>mt,_Tile2DHeader:()=>Yi,_Tileset2D:()=>ra,_WMSLayer:()=>co,_getURLFromTemplate:()=>jt});var It={},qd=X(Tt());pr(It,X(Tt()));if(!qd.GeoJsonLayer)throw new Error("@deck.gl/layers is not found");pr(Da,It);ue();function $d(e,r,t,n,i,a,o){try{var s=e[a](o),u=s.value}catch(f){t(f);return}s.done?r(u):Promise.resolve(u).then(n,i)}function I(e){return function(){var r=this,t=arguments;return new Promise(function(n,i){var a=e.apply(r,t);function o(u){$d(a,n,i,o,s,"next",u)}function s(u){$d(a,n,i,o,s,"throw",u)}o(void 0)})}}q();Y();function oe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function L(e){return L=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},L(e)}function xu(e,r){for(;!Object.prototype.hasOwnProperty.call(e,r)&&(e=L(e),e!==null););return e}function _e(e,r,t){return typeof Reflect<"u"&&Reflect.get?_e=Reflect.get:_e=function(i,a,o){var s=xu(i,a);if(s){var u=Object.getOwnPropertyDescriptor(s,a);return u.get?u.get.call(o):u.value}},_e(e,r,t||e)}function Hr(e,r){return Hr=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},Hr(e,r)}function H(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),r&&Hr(e,r)}Le();function $(e,r){if(r&&(te(r)==="object"||typeof r=="function"))return r;if(r!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return oe(e)}N();var Qr=X(re()),en=X(xt()),ov=X(Tt());N();var Ru=X(re());N();var Lp=X(Rp());function Fp(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),t.push.apply(t,n)}return t}function gx(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{};r%2?Fp(Object(t),!0).forEach(function(n){c(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Fp(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}function kp(e,r){var t=new Lp.XMLParser(gx({ignoreAttributes:!1,attributeNamePrefix:""},r)),n=t.parse(e);return n}ue();Le();function yx(e){return typeof e=="string"?e.charAt(0).toLowerCase()+e.slice(1):e}function ja(e){if(Array.isArray(e))return e.map(function(s){return ja(s)});if(e&&te(e)==="object"){for(var r={},t=0,n=Object.entries(e);t<n.length;t++){var i=D(n[t],2),a=i[0],o=i[1];r[yx(a)]=ja(o)}return r}return e}function Dp(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),t.push.apply(t,n)}return t}function Iu(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{};r%2?Dp(Object(t),!0).forEach(function(n){c(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Dp(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}var Ax="3.4.13",pt={name:"XML",id:"xml",module:"xml",version:Ax,worker:!1,extensions:["xml"],mimeTypes:["application/xml","text/xml"],testText:_x,options:{xml:{parser:"fast-xml-parser",uncapitalizeKeys:!1,removeNSPrefix:!1,textNodeName:"value",arrayPaths:[]}},parse:function(){var e=I(Ru.default.mark(function t(n,i){return Ru.default.wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return o.abrupt("return",Gp(new TextDecoder().decode(n),i));case 1:case"end":return o.stop()}},t)}));function r(t,n){return e.apply(this,arguments)}return r}(),parseTextSync:function(r,t){return Gp(r,t)}};function _x(e){return e.startsWith("<?xml")}function Gp(e,r){var t,n=Iu(Iu({},pt.options.xml),r?.xml);switch(n.parser){case"fast-xml-parser":var i=Iu({allowBooleanAttributes:!0,ignoreDeclaration:!0,removeNSPrefix:n.removeNSPrefix,textNodeName:n.textNodeName,isArray:function(s,u,f,l){var h,d=Boolean(n==null||(h=n.arrayPaths)===null||h===void 0?void 0:h.some(function(p){return u===p}));return d}},r?._fastXML),a=kp(e,i);return n.uncapitalizeKeys?ja(a):a;default:throw new Error(r==null||(t=r.xml)===null||t===void 0?void 0:t.parser)}}function ce(e,r){if(!e)throw new Error(r||"loader assertion failed.")}Le();var Rt={self:typeof self<"u"&&self,window:typeof window<"u"&&window,global:typeof global<"u"&&global,document:typeof document<"u"&&document},bx=Rt.self||Rt.window||Rt.global||{},Tx=Rt.window||Rt.self||Rt.global||{},xx=Rt.global||Rt.self||Rt.window||{},Ex=Rt.document||{};var Bi=Boolean((typeof process>"u"?"undefined":te(process))!=="object"||String(process)!=="[object process]"||process.browser);var Np=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version),Sx=Np&&parseFloat(Np[1])||0;Le();ue();N();function Up(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),t.push.apply(t,n)}return t}function wx(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{};r%2?Up(Object(t),!0).forEach(function(n){c(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Up(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}function Fu(e,r){for(var t=wx({},e),n=0,i=Object.entries(r);n<i.length;n++){var a=D(i[n],2),o=a[0],s=a[1];s&&te(s)==="object"?(t[o]=t[o]||{},Object.assign(t[o],r[o])):t[o]=r[o]}return t}function jp(e,r){if(!e)throw new Error(r||"loaders.gl assertion failed.")}Le();var Ft={self:typeof self<"u"&&self,window:typeof window<"u"&&window,global:typeof global<"u"&&global,document:typeof document<"u"&&document},JF=Ft.self||Ft.window||Ft.global||{},XF=Ft.window||Ft.self||Ft.global||{},Vp=Ft.global||Ft.self||Ft.window||{},qF=Ft.document||{};var qt=(typeof process>"u"?"undefined":te(process))!=="object"||String(process)!=="[object process]"||process.browser,Mi=typeof importScripts=="function",KF=typeof window<"u"&&typeof window.orientation<"u",Hp=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version),YF=Hp&&parseFloat(Hp[1])||0;var Oi=X(re());var zr=X(zp());var Cx="3.4.13",Lu={};function Lt(e){return ku.apply(this,arguments)}function ku(){return ku=I(Oi.default.mark(function e(r){var t,n,i=arguments;return Oi.default.wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return t=i.length>1&&i[1]!==void 0?i[1]:null,n=i.length>2&&i[2]!==void 0?i[2]:{},t&&(r=Wp(r,t,n)),Lu[r]=Lu[r]||Bx(r),o.next=6,Lu[r];case 6:return o.abrupt("return",o.sent);case 7:case"end":return o.stop()}},e)})),ku.apply(this,arguments)}function Wp(e,r,t){if(e.startsWith("http"))return e;var n=t.modules||{};return n[e]?n[e]:qt?t.CDN?(jp(t.CDN.startsWith("http")),"".concat(t.CDN,"/").concat(r,"@").concat(Cx,"/dist/libs/").concat(e)):Mi?"../src/libs/".concat(e):"modules/".concat(r,"/src/libs/").concat(e):"modules/".concat(r,"/dist/libs/").concat(e)}function Bx(e){return Du.apply(this,arguments)}function Du(){return Du=I(Oi.default.mark(function e(r){var t,n,i;return Oi.default.wrap(function(o){for(;;)switch(o.prev=o.next){case 0:if(!r.endsWith("wasm")){o.next=7;break}return o.next=3,fetch(r);case 3:return t=o.sent,o.next=6,t.arrayBuffer();case 6:return o.abrupt("return",o.sent);case 7:if(qt){o.next=20;break}if(o.prev=8,o.t0=zr&&zr.requireFromFile,!o.t0){o.next=14;break}return o.next=13,zr.requireFromFile(r);case 13:o.t0=o.sent;case 14:return o.abrupt("return",o.t0);case 17:return o.prev=17,o.t1=o.catch(8),o.abrupt("return",null);case 20:if(!Mi){o.next=22;break}return o.abrupt("return",importScripts(r));case 22:return o.next=24,fetch(r);case 24:return n=o.sent,o.next=27,n.text();case 27:return i=o.sent,o.abrupt("return",Mx(i,r));case 29:case"end":return o.stop()}},e,null,[[8,17]])})),Du.apply(this,arguments)}function Mx(e,r){if(!qt)return zr.requireFromString&&zr.requireFromString(e,r);if(Mi)return eval.call(Vp,e),null;var t=document.createElement("script");t.id=r;try{t.appendChild(document.createTextNode(e))}catch{t.text=e}return document.body.appendChild(t),null}function Xp(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:5;if(typeof e=="string")return e.slice(0,r);if(ArrayBuffer.isView(e))return Jp(e.buffer,e.byteOffset,r);if(e instanceof ArrayBuffer){var t=0;return Jp(e,t,r)}return""}function Jp(e,r,t){if(e.byteLength<=r+t)return"";for(var n=new DataView(e),i="",a=0;a<t;a++)i+=String.fromCharCode(n.getUint8(r+a));return i}function Gu(e){try{return JSON.parse(e)}catch{throw new Error('Failed to parse JSON from data starting with "'.concat(Xp(e),'"'))}}function Pi(){for(var e=arguments.length,r=new Array(e),t=0;t<e;t++)r[t]=arguments[t];var n=r,i=n&&n.length>1&&n[0].constructor||null;if(!i)throw new Error('"concatenateTypedArrays" - incorrect quantity of arguments or arguments have incompatible data types');for(var a=n.reduce(function(h,d){return h+d.length},0),o=new i(a),s=0,u=0,f=n;u<f.length;u++){var l=f[u];o.set(l,s),s+=l.length}return o}function Wr(e,r,t){var n=t!==void 0?new Uint8Array(e).subarray(r,r+t):new Uint8Array(e).subarray(r),i=new Uint8Array(n);return i.buffer}function vr(e,r){return ce(e>=0),ce(r>0),e+(r-1)&~(r-1)}function Nu(e,r,t){var n;if(e instanceof ArrayBuffer)n=new Uint8Array(e);else{var i=e.byteOffset,a=e.byteLength;n=new Uint8Array(e.buffer||e.arrayBuffer,i,a)}return r.set(n,t),t+vr(n.byteLength,4)}N();q();Y();N();N();N();function Ii(){let e;if(typeof window<"u"&&window.performance)e=window.performance.now();else if(typeof process<"u"&&process.hrtime){let r=process.hrtime();e=r[0]*1e3+r[1]/1e6}else e=Date.now();return e}var Jr=class{constructor(r,t){c(this,"name",void 0),c(this,"type",void 0),c(this,"sampleSize",1),c(this,"time",0),c(this,"count",0),c(this,"samples",0),c(this,"lastTiming",0),c(this,"lastSampleTime",0),c(this,"lastSampleCount",0),c(this,"_count",0),c(this,"_time",0),c(this,"_samples",0),c(this,"_startTime",0),c(this,"_timerPending",!1),this.name=r,this.type=t,this.reset()}reset(){return this.time=0,this.count=0,this.samples=0,this.lastTiming=0,this.lastSampleTime=0,this.lastSampleCount=0,this._count=0,this._time=0,this._samples=0,this._startTime=0,this._timerPending=!1,this}setSampleSize(r){return this.sampleSize=r,this}incrementCount(){return this.addCount(1),this}decrementCount(){return this.subtractCount(1),this}addCount(r){return this._count+=r,this._samples++,this._checkSampling(),this}subtractCount(r){return this._count-=r,this._samples++,this._checkSampling(),this}addTime(r){return this._time+=r,this.lastTiming=r,this._samples++,this._checkSampling(),this}timeStart(){return this._startTime=Ii(),this._timerPending=!0,this}timeEnd(){return this._timerPending?(this.addTime(Ii()-this._startTime),this._timerPending=!1,this._checkSampling(),this):this}getSampleAverageCount(){return this.sampleSize>0?this.lastSampleCount/this.sampleSize:0}getSampleAverageTime(){return this.sampleSize>0?this.lastSampleTime/this.sampleSize:0}getSampleHz(){return this.lastSampleTime>0?this.sampleSize/(this.lastSampleTime/1e3):0}getAverageCount(){return this.samples>0?this.count/this.samples:0}getAverageTime(){return this.samples>0?this.time/this.samples:0}getHz(){return this.time>0?this.samples/(this.time/1e3):0}_checkSampling(){this._samples===this.sampleSize&&(this.lastSampleTime=this._time,this.lastSampleCount=this._count,this.count+=this._count,this.time+=this._time,this.samples+=this._samples,this._time=0,this._count=0,this._samples=0)}};var Ln=class{constructor(r){c(this,"id",void 0),c(this,"stats",{}),this.id=r.id,this.stats={},this._initializeStats(r.stats),Object.seal(this)}get(r){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"count";return this._getOrCreate({name:r,type:t})}get size(){return Object.keys(this.stats).length}reset(){for(let r of Object.values(this.stats))r.reset();return this}forEach(r){for(let t of Object.values(this.stats))r(t)}getTable(){let r={};return this.forEach(t=>{r[t.name]={time:t.time||0,count:t.count||0,average:t.getAverageTime()||0,hz:t.getHz()||0}}),r}_initializeStats(){(arguments.length>0&&arguments[0]!==void 0?arguments[0]:[]).forEach(t=>this._getOrCreate(t))}_getOrCreate(r){let{name:t,type:n}=r,i=this.stats[t];return i||(r instanceof Jr?i=r:i=new Jr(t,n),this.stats[t]=i),i}};function qp(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),t.push.apply(t,n)}return t}function Kp(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{};r%2?qp(Object(t),!0).forEach(function(n){c(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):qp(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}var Ox="Queued Requests",Px="Active Requests",Ix="Cancelled Requests",Rx="Queued Requests Ever",Fx="Active Requests Ever",Lx={id:"request-scheduler",throttleRequests:!0,maxRequests:6},Ri=function(){function e(){T(this,e);var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};c(this,"props",void 0),c(this,"stats",void 0),c(this,"activeRequestCount",0),c(this,"requestQueue",[]),c(this,"requestMap",new Map),c(this,"deferredUpdate",null),this.props=Kp(Kp({},Lx),r),this.stats=new Ln({id:this.props.id}),this.stats.get(Ox),this.stats.get(Px),this.stats.get(Ix),this.stats.get(Rx),this.stats.get(Fx)}return w(e,[{key:"scheduleRequest",value:function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:function(){return 0};if(!this.props.throttleRequests)return Promise.resolve({done:function(){}});if(this.requestMap.has(t))return this.requestMap.get(t);var i={handle:t,priority:0,getPriority:n},a=new Promise(function(o){return i.resolve=o,i});return this.requestQueue.push(i),this.requestMap.set(t,a),this._issueNewRequests(),a}},{key:"_issueRequest",value:function(t){var n=this,i=t.handle,a=t.resolve,o=!1,s=function(){o||(o=!0,n.requestMap.delete(i),n.activeRequestCount--,n._issueNewRequests())};return this.activeRequestCount++,a?a({done:s}):Promise.resolve({done:s})}},{key:"_issueNewRequests",value:function(){var t=this;this.deferredUpdate||(this.deferredUpdate=setTimeout(function(){return t._issueNewRequestsAsync()},0))}},{key:"_issueNewRequestsAsync",value:function(){this.deferredUpdate=null;var t=Math.max(this.props.maxRequests-this.activeRequestCount,0);if(t!==0){this._updateAllRequests();for(var n=0;n<t;++n){var i=this.requestQueue.shift();i&&this._issueRequest(i)}}}},{key:"_updateAllRequests",value:function(){for(var t=this.requestQueue,n=0;n<t.length;++n){var i=t[n];this._updateRequest(i)||(t.splice(n,1),this.requestMap.delete(i.handle),n--)}t.sort(function(a,o){return a.priority-o.priority})}},{key:"_updateRequest",value:function(t){return t.priority=t.getPriority(t.handle),t.priority<0?(t.resolve(null),!1):!0}}]),e}();var kn={};bt(kn,{dirname:()=>Dx,filename:()=>kx,join:()=>Gx,resolve:()=>Nx});function Yp(){var e;if(typeof process<"u"&&typeof process.cwd<"u")return process.cwd();var r=(e=window.location)===null||e===void 0?void 0:e.pathname;return r?.slice(0,r.lastIndexOf("/")+1)||""}function kx(e){var r=e?e.lastIndexOf("/"):-1;return r>=0?e.substr(r+1):""}function Dx(e){var r=e?e.lastIndexOf("/"):-1;return r>=0?e.substr(0,r):""}function Gx(){for(var e=arguments.length,r=new Array(e),t=0;t<e;t++)r[t]=arguments[t];var n="/";return r=r.map(function(i,a){return a&&(i=i.replace(new RegExp("^".concat(n)),"")),a!==r.length-1&&(i=i.replace(new RegExp("".concat(n,"$")),"")),i}),r.join(n)}function Nx(){for(var e=[],r=0;r<arguments.length;r++)e[r]=r<0||arguments.length<=r?void 0:arguments[r];for(var t="",n=!1,i,a=e.length-1;a>=-1&&!n;a--){var o=void 0;a>=0?o=e[a]:(i===void 0&&(i=Yp()),o=i),o.length!==0&&(t="".concat(o,"/").concat(t),n=o.charCodeAt(0)===Fi)}return t=Ux(t,!n),n?"/".concat(t):t.length>0?t:"."}var Fi=47,Uu=46;function Ux(e,r){for(var t="",n=-1,i=0,a,o=!1,s=0;s<=e.length;++s){if(s<e.length)a=e.charCodeAt(s);else{if(a===Fi)break;a=Fi}if(a===Fi){if(!(n===s-1||i===1))if(n!==s-1&&i===2){if(t.length<2||!o||t.charCodeAt(t.length-1)!==Uu||t.charCodeAt(t.length-2)!==Uu){if(t.length>2){for(var u=t.length-1,f=u;f>=0&&t.charCodeAt(f)!==Fi;--f);if(f!==u){t=f===-1?"":t.slice(0,f),n=s,i=0,o=!1;continue}}else if(t.length===2||t.length===1){t="",n=s,i=0,o=!1;continue}}r&&(t.length>0?t+="/..":t="..",o=!0)}else{var l=e.slice(n+1,s);t.length>0?t+="/".concat(l):t=l,o=!1}n=s,i=0}else a===Uu&&i!==-1?++i:i=-1}return t}N();var Hu=X(re());function Zp(e,r){var t,n,i,a=(t=pt.parseTextSync)===null||t===void 0?void 0:t.call(pt,e,r),o=(a==null||(n=a.ServiceExceptionReport)===null||n===void 0?void 0:n.ServiceException)||(a==null||(i=a["ogc:ServiceExceptionReport"])===null||i===void 0?void 0:i["ogc:ServiceException"]),s=typeof o=="string"?o:o.value||o.code||"Unknown error";return s}function $p(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),t.push.apply(t,n)}return t}function Qp(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{};r%2?$p(Object(t),!0).forEach(function(n){c(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):$p(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}var jx="3.4.13",Dn={id:"wms-error",name:"WMS Error",module:"wms",version:jx,worker:!1,extensions:["xml"],mimeTypes:["application/vnd.ogc.se_xml","application/xml","text/xml"],testText:Hx,options:{wms:{throwOnError:!1}},parse:function(){var e=I(Hu.default.mark(function t(n,i){return Hu.default.wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return o.abrupt("return",ju(new TextDecoder().decode(n),i));case 1:case"end":return o.stop()}},t)}));function r(t,n){return e.apply(this,arguments)}return r}(),parseSync:function(r,t){return ju(new TextDecoder().decode(r),t)},parseTextSync:function(r,t){return ju(r,t)}};function Hx(e){return e.startsWith("<?xml")}function ju(e,r){var t=Qp(Qp({},Dn.options.wms),r?.wms),n=Zp(e,t),i=t.minimalErrors?n:"WMS Service error: ".concat(n);if(t.throwOnError)throw new Error(i);return i}var Xu=X(re());_u();function Vu(e){if(Array.isArray(e))return Fn(e)}function zu(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}bu();function Wu(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
15
15
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function K(e){return Vu(e)||zu(e)||Si(e)||Wu()}ue();Le();function Xr(e){return Array.isArray(e)?e:e?[e]:[]}function Li(e){var r=Xr(e);return r.length>0&&r.every(function(t){return typeof t=="string"})?r:[]}function ki(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:void 0;switch(te(e)){case"number":return e;case"string":return parseFloat(e);default:return}}function Ha(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:void 0;switch(te(e)){case"number":return e;case"string":return parseInt(e,10);default:return}}function qr(e){switch(e){case"true":return!0;case"false":return!1;case"1":return!0;case"0":return!1;default:return!1}}function Va(e,r){var t=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=Vx(e))||r&&e&&typeof e.length=="number"){t&&(e=t);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(f){throw f},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
16
16
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){t=t.call(e)},n:function(){var f=t.next();return a=f.done,f},e:function(f){o=!0,s=f},f:function(){try{!a&&t.return!=null&&t.return()}finally{if(o)throw s}}}}function Vx(e,r){if(e){if(typeof e=="string")return em(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);if(t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set")return Array.from(e);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return em(e,r)}}function em(e,r){(r==null||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function Ju(e,r){var t=pt.parseTextSync(e,r),n=t.WMT_MS_Capabilities||t.WMS_Capabilities||t,i=zx(n);if(r!=null&&r.inheritedLayerProps){var a=Va(i.layers),o;try{for(a.s();!(o=a.n()).done;){var s=o.value;rm(s,null)}}catch(u){a.e(u)}finally{a.f()}}return(r!=null&&r.includeRawData||r!=null&&r.raw)&&(i.raw=n),r!=null&&r.includeXMLText&&(i.xml=e),i}function zx(e){var r,t,n,i,a,o,s,u,f,l,h,d,p,m,v,g,y={version:String(e.version||""),name:String(((r=e.Service)===null||r===void 0?void 0:r.Name)||"unnamed"),title:(t=e.Service)!==null&&t!==void 0&&t.Title?String((n=e.Service)===null||n===void 0?void 0:n.Title):void 0,abstract:(i=e.Service)!==null&&i!==void 0&&i.Abstract?String((a=e.Service)===null||a===void 0?void 0:a.Abstract):void 0,keywords:Li((o=e.Service)===null||o===void 0||(s=o.KeywordList)===null||s===void 0?void 0:s.Keyword),fees:(u=e.Service)!==null&&u!==void 0&&u.Fees?JSON.stringify((f=e.Service)===null||f===void 0?void 0:f.Fees):void 0,accessConstraints:(l=e.Service)!==null&&l!==void 0&&l.AccessConstraints?JSON.stringify((h=e.Service)===null||h===void 0?void 0:h.AccessConstraints):void 0,layerLimit:Ha((d=e.Service)===null||d===void 0?void 0:d.LayerLimit),maxWidth:Ha((p=e.Service)===null||p===void 0?void 0:p.maxWidth),maxHeight:Ha((m=e.Service)===null||m===void 0?void 0:m.maxHeight),layers:[],requests:Wx((v=e.Capability)===null||v===void 0?void 0:v.Request),exceptions:Jx(e.Exception)},A=Xr((g=e.Capability)===null||g===void 0?void 0:g.Layer),x=Va(A),b;try{for(x.s();!(b=x.n()).done;){var M=b.value;y.layers.push(tm(M))}}catch(R){x.e(R)}finally{x.f()}for(var C=0,F=Object.entries(y);C<F.length;C++){var B=D(F[C],2),S=B[0],_=B[1];_===void 0&&delete y[S]}return y}function Wx(e){for(var r={},t=0,n=Object.entries(e||{});t<n.length;t++){var i=D(n[t],2),a=i[0],o=i[1],s=Li(o?.Format);r[a]={mimeTypes:s}}return r}function Jx(e){var r=Xr(e?.Format);if(r.length>0)return{mimeTypes:Li(e)}}function tm(e){var r,t={title:String(e?.Title||""),name:e?.Name&&String(e?.Name),abstract:e?.Name&&String(e?.Abstract),keywords:Li((r=e.KeywordList)===null||r===void 0?void 0:r.Keyword)},n=e?.CRS||e?.SRS;n&&Array.isArray(n)&&n.every(function(A){return typeof A=="string"})&&(t.crs=n);var i=e?.EX_GeographicBoundingBox&&Xx(e?.EX_GeographicBoundingBox);i&&(t.geographicBoundingBox=i),i=e?.LatLonBoundingBox&&qx(e?.LatLonBoundingBox),i&&(t.geographicBoundingBox=i);var a=e?.BoundingBox&&Kx(e?.BoundingBox);a&&a.length>0&&(t.boundingBoxes=a);var o=Xr(e?.Dimension),s=o.map(function(A){return Zx(A)});s.length&&(t.dimensions=s),e!=null&&e.opaque&&(t.opaque=qr(e?.opaque)),e!=null&&e.cascaded&&(t.cascaded=qr(e?.cascaded)),e!=null&&e.queryable&&(t.queryable=qr(e?.queryable));var u=Xr(e?.Layer),f=[],l=Va(u),h;try{for(l.s();!(h=l.n()).done;){var d=h.value;f.push(tm(d))}}catch(A){l.e(A)}finally{l.f()}f.length>0&&(t.layers=f);for(var p=0,m=Object.entries(t);p<m.length;p++){var v=D(m[p],2),g=v[0],y=v[1];y===void 0&&delete t[g]}return t}function Xx(e){var r=e.westBoundLongitude,t=e.northBoundLatitude,n=e.eastBoundLongitude,i=e.southBoundLatitude;return[[r,i],[n,t]]}function qx(e){var r=e.minx,t=e.miny,n=e.maxx,i=e.maxy;return[[r,t],[n,i]]}function Kx(e){var r=Xr(e);return r.map(function(t){return Yx(t)})}function Yx(e){var r=e.CRS,t=e.SRS,n=e.minx,i=e.miny,a=e.maxx,o=e.maxy,s=e.resx,u=e.resy,f={crs:r||t,boundingBox:[[ki(n),ki(i)],[ki(a),ki(o)]]};return s&&(f.xResolution=s),u&&(f.yResolution=u),f}function Zx(e){var r=e.name,t=e.units,n=e.value,i={name:r,units:t,extent:n};return e.unitSymbol&&(i.unitSymbol=e.unitSymbol),e.default&&(i.defaultValue=e.default),e.multipleValues&&(i.multipleValues=qr(e.multipleValues)),e.nearestValue&&(i.nearestValue=qr(e.nearestValue)),e.current&&(i.current=qr(e.current)),i}function rm(e,r){r!=null&&r.geographicBoundingBox&&!e.geographicBoundingBox&&(e.geographicBoundingBox=K(r.geographicBoundingBox)),r!=null&&r.crs&&!e.crs&&(e.crs=K(r.crs)),r!=null&&r.boundingBoxes&&!e.boundingBoxes&&(e.boundingBoxes=K(r.boundingBoxes)),r!=null&&r.dimensions&&!e.dimensions&&(e.dimensions=K(r.dimensions));var t=Va(e.layers||[]),n;try{for(t.s();!(n=t.n()).done;){var i=n.value;rm(i,e)}}catch(a){t.e(a)}finally{t.f()}}var $x="3.4.13",Kr={id:"wms-capabilities",name:"WMS Capabilities",module:"wms",version:$x,worker:!1,extensions:["xml"],mimeTypes:["application/vnd.ogc.wms_xml","application/xml","text/xml"],testText:Qx,options:{wms:{}},parse:function(){var e=I(Xu.default.mark(function t(n,i){return Xu.default.wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return o.abrupt("return",Ju(new TextDecoder().decode(n),i?.wms));case 1:case"end":return o.stop()}},t)}));function r(t,n){return e.apply(this,arguments)}return r}(),parseTextSync:function(r,t){return Ju(r,t?.wms)}};function Qx(e){return e.startsWith("<?xml")}N();var Ku=X(re());function qu(e,r){var t,n=pt.parseTextSync(e,r),i=((t=n.FeatureInfoResponse)===null||t===void 0?void 0:t.FIELDS)||[],a=Array.isArray(i)?i:[i];return{features:a.map(function(o){return eE(o)})}}function eE(e){var r=e||{};return{attributes:r,type:"",bounds:{bottom:0,top:0,left:0,right:0}}}function nm(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),t.push.apply(t,n)}return t}function im(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{};r%2?nm(Object(t),!0).forEach(function(n){c(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):nm(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}var Yu=im(im({},Kr),{},{id:"wms-feature-info",name:"WMS FeatureInfo",parse:function(){var e=I(Ku.default.mark(function t(n,i){return Ku.default.wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return o.abrupt("return",qu(new TextDecoder().decode(n),i));case 1:case"end":return o.stop()}},t)}));function r(t,n){return e.apply(this,arguments)}return r}(),parseTextSync:function(r,t){return qu(r,t)}});N();var $u=X(re());function Zu(e,r){var t,n=(t=pt.parseTextSync)===null||t===void 0?void 0:t.call(pt,e,r);return n}function am(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),t.push.apply(t,n)}return t}function om(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{};r%2?am(Object(t),!0).forEach(function(n){c(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):am(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}var Qu=om(om({},Kr),{},{id:"wms-layer-description",name:"WMS DescribeLayer",parse:function(){var e=I($u.default.mark(function t(n,i){return $u.default.wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return o.abrupt("return",Zu(new TextDecoder().decode(n),i));case 1:case"end":return o.stop()}},t)}));function r(t,n){return e.apply(this,arguments)}return r}(),parseTextSync:function(r,t){return Zu(r,t)}});q();N();q();Y();N();function sm(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),t.push.apply(t,n)}return t}function um(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{};r%2?sm(Object(t),!0).forEach(function(n){c(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):sm(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}var fm=function(){function e(r){T(this,e),c(this,"fetch",void 0),c(this,"loadOptions",void 0),c(this,"_needsRefresh",!0),c(this,"props",void 0),this.props=um({},r),this.loadOptions=um({},r.loadOptions),this.fetch=tE(this.loadOptions)}return w(e,[{key:"setProps",value:function(t){this.props=Object.assign(this.props,t),this.setNeedsRefresh()}},{key:"setNeedsRefresh",value:function(){this._needsRefresh=!0}},{key:"getNeedsRefresh",value:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,n=this._needsRefresh;return t&&(this._needsRefresh=!1),n}}]),e}();function tE(e){var r=e?.fetch;if(r&&typeof r=="function")return function(n,i){return r(n,i)};var t=e?.fetch;return t&&typeof t!="function"?function(n){return fetch(n,t)}:function(n){return fetch(n)}}function rE(e){var r=nE();return function(){var n=L(e),i;if(r){var a=L(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return $(this,i)}}function nE(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var Kt=function(e){H(t,e);var r=rE(t);function t(){return T(this,t),r.apply(this,arguments)}return t}(fm);N();ue();q();Y();var Hi=X(re());N();var lm="3.4.13";var df=X(re());var iE=globalThis._parseImageNode,ef=typeof Image<"u",tf=typeof ImageBitmap<"u",aE=Boolean(iE),rf=Bi?!0:aE;function cm(e){switch(e){case"auto":return tf||ef||rf;case"imagebitmap":return tf;case"image":return ef;case"data":return rf;default:throw new Error("@loaders.gl/images: image ".concat(e," not supported in this environment"))}}function hm(){if(tf)return"imagebitmap";if(ef)return"image";if(rf)return"data";throw new Error("Install '@loaders.gl/polyfills' to parse images under Node.js")}Le();function oE(e){var r=sE(e);if(!r)throw new Error("Not an image");return r}function dm(e){switch(oE(e)){case"data":return e;case"image":case"imagebitmap":var r=document.createElement("canvas"),t=r.getContext("2d");if(!t)throw new Error("getImageData");return r.width=e.width,r.height=e.height,t.drawImage(e,0,0),t.getImageData(0,0,e.width,e.height);default:throw new Error("getImageData")}}function sE(e){return typeof ImageBitmap<"u"&&e instanceof ImageBitmap?"imagebitmap":typeof Image<"u"&&e instanceof Image?"image":e&&te(e)==="object"&&e.data&&e.width&&e.height?"data":null}var Di=X(re());var uE=/^data:image\/svg\+xml/,fE=/\.svg((\?|#).*)?$/;function za(e){return e&&(uE.test(e)||fE.test(e))}function pm(e,r){if(za(r)){var t=new TextDecoder,n=t.decode(e);try{typeof unescape=="function"&&typeof encodeURIComponent=="function"&&(n=unescape(encodeURIComponent(n)))}catch(a){throw new Error(a.message)}var i="data:image/svg+xml;base64,".concat(btoa(n));return i}return nf(e,r)}function nf(e,r){if(za(r))throw new Error("SVG cannot be parsed directly to imagebitmap");return new Blob([new Uint8Array(e)])}function Gi(e,r,t){return af.apply(this,arguments)}function af(){return af=I(Di.default.mark(function e(r,t,n){var i,a,o;return Di.default.wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return i=pm(r,n),a=self.URL||self.webkitURL,o=typeof i!="string"&&a.createObjectURL(i),u.prev=3,u.next=6,lE(o||i,t);case 6:return u.abrupt("return",u.sent);case 7:return u.prev=7,o&&a.revokeObjectURL(o),u.finish(7);case 10:case"end":return u.stop()}},e,null,[[3,,7,10]])})),af.apply(this,arguments)}function lE(e,r){return of.apply(this,arguments)}function of(){return of=I(Di.default.mark(function e(r,t){var n;return Di.default.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:if(n=new Image,n.src=r,!(t.image&&t.image.decode&&n.decode)){a.next=6;break}return a.next=5,n.decode();case 5:return a.abrupt("return",n);case 6:return a.next=8,new Promise(function(o,s){try{n.onload=function(){return o(n)},n.onerror=function(u){return s(new Error("Could not load image ".concat(r,": ").concat(u)))}}catch(u){s(u)}});case 8:return a.abrupt("return",a.sent);case 9:case"end":return a.stop()}},e)})),of.apply(this,arguments)}var Ni=X(re());var cE={},mm=!0;function ff(e,r,t){return sf.apply(this,arguments)}function sf(){return sf=I(Ni.default.mark(function e(r,t,n){var i,a,o;return Ni.default.wrap(function(u){for(;;)switch(u.prev=u.next){case 0:if(!za(n)){u.next=7;break}return u.next=3,Gi(r,t,n);case 3:a=u.sent,i=a,u.next=8;break;case 7:i=nf(r,n);case 8:return o=t&&t.imagebitmap,u.next=11,hE(i,o);case 11:return u.abrupt("return",u.sent);case 12:case"end":return u.stop()}},e)})),sf.apply(this,arguments)}function hE(e){return uf.apply(this,arguments)}function uf(){return uf=I(Ni.default.mark(function e(r){var t,n=arguments;return Ni.default.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:if(t=n.length>1&&n[1]!==void 0?n[1]:null,(dE(t)||!mm)&&(t=null),!t){a.next=13;break}return a.prev=3,a.next=6,createImageBitmap(r,t);case 6:return a.abrupt("return",a.sent);case 9:a.prev=9,a.t0=a.catch(3),console.warn(a.t0),mm=!1;case 13:return a.next=15,createImageBitmap(r);case 15:return a.abrupt("return",a.sent);case 16:case"end":return a.stop()}},e,null,[[3,9]])})),uf.apply(this,arguments)}function dE(e){for(var r in e||cE)return!1;return!0}var lf=X(re());function vm(e){return!gE(e,"ftyp",4)||!(e[8]&96)?null:pE(e)}function pE(e){var r=mE(e,8,12).replace("\0"," ").trim();switch(r){case"avif":case"avis":return{extension:"avif",mimeType:"image/avif"};default:return null}}function mE(e,r,t){return String.fromCharCode.apply(String,K(e.slice(r,t)))}function vE(e){return K(e).map(function(r){return r.charCodeAt(0)})}function gE(e,r){for(var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,n=vE(r),i=0;i<n.length;++i)if(n[i]!==e[i+t])return!1;return!0}var kt=!1,Ui=!0;function Yr(e){var r=ji(e);return AE(r)||TE(r)||_E(r)||bE(r)||yE(r)}function yE(e){var r=new Uint8Array(e instanceof DataView?e.buffer:e),t=vm(r);return t?{mimeType:t.mimeType,width:0,height:0}:null}function AE(e){var r=ji(e),t=r.byteLength>=24&&r.getUint32(0,kt)===2303741511;return t?{mimeType:"image/png",width:r.getUint32(16,kt),height:r.getUint32(20,kt)}:null}function _E(e){var r=ji(e),t=r.byteLength>=10&&r.getUint32(0,kt)===1195984440;return t?{mimeType:"image/gif",width:r.getUint16(6,Ui),height:r.getUint16(8,Ui)}:null}function bE(e){var r=ji(e),t=r.byteLength>=14&&r.getUint16(0,kt)===16973&&r.getUint32(2,Ui)===r.byteLength;return t?{mimeType:"image/bmp",width:r.getUint32(18,Ui),height:r.getUint32(22,Ui)}:null}function TE(e){var r=ji(e),t=r.byteLength>=3&&r.getUint16(0,kt)===65496&&r.getUint8(2)===255;if(!t)return null;for(var n=xE(),i=n.tableMarkers,a=n.sofMarkers,o=2;o+9<r.byteLength;){var s=r.getUint16(o,kt);if(a.has(s))return{mimeType:"image/jpeg",height:r.getUint16(o+5,kt),width:r.getUint16(o+7,kt)};if(!i.has(s))return null;o+=2,o+=r.getUint16(o,kt)}return null}function xE(){for(var e=new Set([65499,65476,65484,65501,65534]),r=65504;r<65520;++r)e.add(r);var t=new Set([65472,65473,65474,65475,65477,65478,65479,65481,65482,65483,65485,65486,65487,65502]);return{tableMarkers:e,sofMarkers:t}}function ji(e){if(e instanceof DataView)return e;if(ArrayBuffer.isView(e))return new DataView(e.buffer);if(e instanceof ArrayBuffer)return new DataView(e);throw new Error("toDataView")}function hf(e,r){return cf.apply(this,arguments)}function cf(){return cf=I(lf.default.mark(function e(r,t){var n,i,a;return lf.default.wrap(function(s){for(;;)switch(s.prev=s.next){case 0:return n=Yr(r)||{},i=n.mimeType,a=globalThis._parseImageNode,ce(a),s.next=5,a(r,i);case 5:return s.abrupt("return",s.sent);case 6:case"end":return s.stop()}},e)})),cf.apply(this,arguments)}function mf(e,r,t){return pf.apply(this,arguments)}function pf(){return pf=I(df.default.mark(function e(r,t,n){var i,a,o,s,u,f;return df.default.wrap(function(h){for(;;)switch(h.prev=h.next){case 0:t=t||{},i=t.image||{},a=i.type||"auto",o=n||{},s=o.url,u=EE(a),h.t0=u,h.next=h.t0==="imagebitmap"?8:h.t0==="image"?12:h.t0==="data"?16:20;break;case 8:return h.next=10,ff(r,t,s);case 10:return f=h.sent,h.abrupt("break",21);case 12:return h.next=14,Gi(r,t,s);case 14:return f=h.sent,h.abrupt("break",21);case 16:return h.next=18,hf(r,t);case 18:return f=h.sent,h.abrupt("break",21);case 20:ce(!1);case 21:return a==="data"&&(f=dm(f)),h.abrupt("return",f);case 23:case"end":return h.stop()}},e)})),pf.apply(this,arguments)}function EE(e){switch(e){case"auto":case"data":return hm();default:return cm(e),e}}var SE=["png","jpg","jpeg","gif","webp","bmp","ico","svg","avif"],wE=["image/png","image/jpeg","image/gif","image/webp","image/avif","image/bmp","image/vnd.microsoft.icon","image/svg+xml"],CE={image:{type:"auto",decode:!0}},Yt={id:"image",module:"images",name:"Images",version:lm,mimeTypes:wE,extensions:SE,parse:mf,tests:[function(e){return Boolean(Yr(new DataView(e)))}],options:CE};var BE=X(re());var vf={};function gf(e){if(vf[e]===void 0){var r=Bi?OE(e):ME(e);vf[e]=r}return vf[e]}function ME(e){var r=["image/png","image/jpeg","image/gif"],t=globalThis._parseImageNode,n=globalThis._imageFormatsNode,i=n===void 0?r:n;return Boolean(t)&&i.includes(e)}function OE(e){switch(e){case"image/avif":case"image/webp":return PE(e);default:return!0}}function PE(e){try{var r=document.createElement("canvas"),t=r.toDataURL(e);return t.indexOf("data:".concat(e))===0}catch{return!1}}function gm(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),t.push.apply(t,n)}return t}function ym(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{};r%2?gm(Object(t),!0).forEach(function(n){c(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):gm(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}function IE(e){var r=RE();return function(){var n=L(e),i;if(r){var a=L(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return $(this,i)}}function RE(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var Vi=function(e){H(t,e);var r=IE(t);function t(n){return T(this,t),r.call(this,n)}return w(t,[{key:"getMetadata",value:function(){var n=I(Hi.default.mark(function a(){return Hi.default.wrap(function(s){for(;;)switch(s.prev=s.next){case 0:throw new Error("ImageSource.getMetadata not implemented");case 1:case"end":return s.stop()}},a)}));function i(){return n.apply(this,arguments)}return i}()},{key:"getImage",value:function(){var n=I(Hi.default.mark(function a(o){var s,u,f,l;return Hi.default.wrap(function(d){for(;;)switch(d.prev=d.next){case 0:return s=this.getGranularParameters(o),u=this.getURLFromTemplate(s),d.next=4,this.fetch(u);case 4:return f=d.sent,d.next=7,f.arrayBuffer();case 7:return l=d.sent,d.next=10,Yt.parse(l);case 10:return d.abrupt("return",d.sent);case 11:case"end":return d.stop()}},a,this)}));function i(a){return n.apply(this,arguments)}return i}()},{key:"getGranularParameters",value:function(i){var a=D(i.bbox,4),o=a[0],s=a[1],u=a[2],f=a[3];return ym(ym({},i),{},{east:o,north:s,south:f,west:u})}},{key:"getURLFromTemplate",value:function(i){for(var a=this.props.url,o=0,s=Object.entries(i);o<s.length;o++){var u=D(s[o],2),f=u[0],l=u[1];a=a.replace("${".concat(f,"}"),String(l)),a=a.replace("{".concat(f,"}"),String(l))}return a}}]),t}(Kt);c(Vi,"type","template");c(Vi,"testURL",function(e){return e.toLowerCase().includes("{")});ue();N();q();Y();var je=X(re());N();function FE(e,r){var t=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=LE(e))||r&&e&&typeof e.length=="number"){t&&(e=t);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(f){throw f},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
17
17
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){t=t.call(e)},n:function(){var f=t.next();return a=f.done,f},e:function(f){o=!0,s=f},f:function(){try{!a&&t.return!=null&&t.return()}finally{if(o)throw s}}}}function LE(e,r){if(e){if(typeof e=="string")return Am(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);if(t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set")return Array.from(e);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return Am(e,r)}}function Am(e,r){(r==null||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function _m(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),t.push.apply(t,n)}return t}function Dt(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{};r%2?_m(Object(t),!0).forEach(function(n){c(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):_m(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}function kE(e){var r=DE();return function(){var n=L(e),i;if(r){var a=L(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return $(this,i)}}function DE(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var zi=function(e){H(t,e);var r=kE(t);function t(n){var i;T(this,t);var a;return i=r.call(this,n),c(oe(i),"url",void 0),c(oe(i),"substituteCRS84",void 0),c(oe(i),"flipCRS",void 0),c(oe(i),"wmsParameters",void 0),c(oe(i),"vendorParameters",void 0),c(oe(i),"capabilities",null),c(oe(i),"loaders",[Yt,Dn,Kr,Yu,Qu]),i.url=n.url,i.substituteCRS84=(a=n.substituteCRS84)!==null&&a!==void 0?a:!1,i.flipCRS=["EPSG:4326"],i.wmsParameters=Dt({layers:void 0,query_layers:void 0,styles:void 0,version:"1.3.0",crs:"EPSG:4326",format:"image/png",info_format:"text/plain",transparent:void 0,time:void 0,elevation:void 0},n.wmsParameters),i.vendorParameters=n.vendorParameters||{},i}return w(t,[{key:"getMetadata",value:function(){var n=I(je.default.mark(function a(){var o;return je.default.wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return u.next=2,this.getCapabilities();case 2:return o=u.sent,u.abrupt("return",this.normalizeMetadata(o));case 4:case"end":return u.stop()}},a,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"getImage",value:function(){var n=I(je.default.mark(function a(o){return je.default.wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return u.next=2,this.getMap(o);case 2:return u.abrupt("return",u.sent);case 3:case"end":return u.stop()}},a,this)}));function i(a){return n.apply(this,arguments)}return i}()},{key:"normalizeMetadata",value:function(i){return i}},{key:"getCapabilities",value:function(){var n=I(je.default.mark(function a(o,s){var u,f,l,h;return je.default.wrap(function(p){for(;;)switch(p.prev=p.next){case 0:return u=this.getCapabilitiesURL(o,s),p.next=3,this.fetch(u);case 3:return f=p.sent,p.next=6,f.arrayBuffer();case 6:return l=p.sent,this._checkResponse(f,l),p.next=10,Kr.parse(l,this.loadOptions);case 10:return h=p.sent,this.capabilities=h,p.abrupt("return",h);case 13:case"end":return p.stop()}},a,this)}));function i(a,o){return n.apply(this,arguments)}return i}()},{key:"getMap",value:function(){var n=I(je.default.mark(function a(o,s){var u,f,l;return je.default.wrap(function(d){for(;;)switch(d.prev=d.next){case 0:return u=this.getMapURL(o,s),d.next=3,this.fetch(u);case 3:return f=d.sent,d.next=6,f.arrayBuffer();case 6:return l=d.sent,this._checkResponse(f,l),d.prev=8,d.next=11,Yt.parse(l,this.loadOptions);case 11:return d.abrupt("return",d.sent);case 14:throw d.prev=14,d.t0=d.catch(8),this._parseError(l);case 17:case"end":return d.stop()}},a,this,[[8,14]])}));function i(a,o){return n.apply(this,arguments)}return i}()},{key:"getFeatureInfo",value:function(){var n=I(je.default.mark(function a(o,s){var u,f,l;return je.default.wrap(function(d){for(;;)switch(d.prev=d.next){case 0:return u=this.getFeatureInfoURL(o,s),d.next=3,this.fetch(u);case 3:return f=d.sent,d.next=6,f.arrayBuffer();case 6:return l=d.sent,this._checkResponse(f,l),d.next=10,Yu.parse(l,this.loadOptions);case 10:return d.abrupt("return",d.sent);case 11:case"end":return d.stop()}},a,this)}));function i(a,o){return n.apply(this,arguments)}return i}()},{key:"getFeatureInfoText",value:function(){var n=I(je.default.mark(function a(o,s){var u,f,l;return je.default.wrap(function(d){for(;;)switch(d.prev=d.next){case 0:return u=this.getFeatureInfoURL(o,s),d.next=3,this.fetch(u);case 3:return f=d.sent,d.next=6,f.arrayBuffer();case 6:return l=d.sent,this._checkResponse(f,l),d.abrupt("return",new TextDecoder().decode(l));case 9:case"end":return d.stop()}},a,this)}));function i(a,o){return n.apply(this,arguments)}return i}()},{key:"describeLayer",value:function(){var n=I(je.default.mark(function a(o,s){var u,f,l;return je.default.wrap(function(d){for(;;)switch(d.prev=d.next){case 0:return u=this.describeLayerURL(o,s),d.next=3,this.fetch(u);case 3:return f=d.sent,d.next=6,f.arrayBuffer();case 6:return l=d.sent,this._checkResponse(f,l),d.next=10,Qu.parse(l,this.loadOptions);case 10:return d.abrupt("return",d.sent);case 11:case"end":return d.stop()}},a,this)}));function i(a,o){return n.apply(this,arguments)}return i}()},{key:"getLegendGraphic",value:function(){var n=I(je.default.mark(function a(o,s){var u,f,l;return je.default.wrap(function(d){for(;;)switch(d.prev=d.next){case 0:return u=this.getLegendGraphicURL(o,s),d.next=3,this.fetch(u);case 3:return f=d.sent,d.next=6,f.arrayBuffer();case 6:return l=d.sent,this._checkResponse(f,l),d.prev=8,d.next=11,Yt.parse(l,this.loadOptions);case 11:return d.abrupt("return",d.sent);case 14:throw d.prev=14,d.t0=d.catch(8),this._parseError(l);case 17:case"end":return d.stop()}},a,this,[[8,14]])}));function i(a,o){return n.apply(this,arguments)}return i}()},{key:"getCapabilitiesURL",value:function(i,a){var o=Dt({version:this.wmsParameters.version},i);return this._getWMSUrl("GetCapabilities",o,a)}},{key:"getMapURL",value:function(i,a){i=this._getWMS130Parameters(i);var o=Dt({version:this.wmsParameters.version,format:this.wmsParameters.format,transparent:this.wmsParameters.transparent,time:this.wmsParameters.time,elevation:this.wmsParameters.elevation,layers:this.wmsParameters.layers,styles:this.wmsParameters.styles,crs:this.wmsParameters.crs},i);return this._getWMSUrl("GetMap",o,a)}},{key:"getFeatureInfoURL",value:function(i,a){var o=Dt({version:this.wmsParameters.version,info_format:this.wmsParameters.info_format,layers:this.wmsParameters.layers,query_layers:this.wmsParameters.query_layers,styles:this.wmsParameters.styles,crs:this.wmsParameters.crs},i);return this._getWMSUrl("GetFeatureInfo",o,a)}},{key:"describeLayerURL",value:function(i,a){var o=Dt({version:this.wmsParameters.version},i);return this._getWMSUrl("DescribeLayer",o,a)}},{key:"getLegendGraphicURL",value:function(i,a){var o=Dt({version:this.wmsParameters.version},i);return this._getWMSUrl("GetLegendGraphic",o,a)}},{key:"_parseWMSUrl",value:function(i){var a=i.split("?"),o=D(a,2),s=o[0],u=o[1],f=u.split("&"),l={},h=FE(f),d;try{for(h.s();!(d=h.n()).done;){var p=d.value,m=p.split("="),v=D(m,2),g=v[0],y=v[1];l[g]=y}}catch(A){h.e(A)}finally{h.f()}return{url:s,parameters:l}}},{key:"_getWMSUrl",value:function(i,a,o){for(var s=this.url,u=!0,f=Dt(Dt(Dt({service:"WMS",version:a.version,request:i},a),this.vendorParameters),o),l=["transparent","time","elevation"],h=0,d=Object.entries(f);h<d.length;h++){var p=D(d[h],2),m=p[0],v=p[1];(!l.includes(m)||v)&&(s+=u?"?":"&",u=!1,s+=this._getURLParameter(m,v,a))}return encodeURI(s)}},{key:"_getWMS130Parameters",value:function(i){var a=Dt({},i);return a.srs&&(a.crs=a.crs||a.srs,delete a.srs),a}},{key:"_getURLParameter",value:function(i,a,o){switch(i){case"crs":o.version!=="1.3.0"?i="srs":this.substituteCRS84&&a==="EPSG:4326"&&(a="CRS:84");break;case"srs":o.version==="1.3.0"&&(i="crs");break;case"bbox":var s=this._flipBoundingBox(a,o);s&&(a=s);break;default:}return i=i.toUpperCase(),Array.isArray(a)?"".concat(i,"=").concat(a.join(",")):"".concat(i,"=").concat(a?String(a):"")}},{key:"_flipBoundingBox",value:function(i,a){if(!Array.isArray(i)||i.length!==4)return null;var o=a.version==="1.3.0"&&this.flipCRS.includes(a.crs||"")&&!(this.substituteCRS84&&a.crs==="EPSG:4326"),s=i;return o?[s[1],s[0],s[3],s[2]]:s}},{key:"_fetchArrayBuffer",value:function(){var n=I(je.default.mark(function a(o){var s,u;return je.default.wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return l.next=2,this.fetch(o);case 2:return s=l.sent,l.next=5,s.arrayBuffer();case 5:return u=l.sent,this._checkResponse(s,u),l.abrupt("return",u);case 8:case"end":return l.stop()}},a,this)}));function i(a){return n.apply(this,arguments)}return i}()},{key:"_checkResponse",value:function(i,a){var o=i.headers["content-type"];if(!i.ok||Dn.mimeTypes.includes(o)){var s=Fu(this.loadOptions,{wms:{throwOnError:!0}}),u=Dn.parseSync(a,s);throw new Error(u)}}},{key:"_parseError",value:function(i){var a=Dn.parseSync(i,this.loadOptions);return new Error(a)}}]),t}(Kt);c(zi,"type","wms");c(zi,"testURL",function(e){return e.toLowerCase().includes("wms")});ue();N();q();Y();var Zt=X(re());N();function bm(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),t.push.apply(t,n)}return t}function Tm(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{};r%2?bm(Object(t),!0).forEach(function(n){c(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):bm(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}function GE(e){var r=NE();return function(){var n=L(e),i;if(r){var a=L(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return $(this,i)}}function NE(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var Wa=function(e){H(t,e);var r=GE(t);function t(n){return T(this,t),r.call(this,n)}return w(t,[{key:"getMetadata",value:function(){var n=I(Zt.default.mark(function a(){return Zt.default.wrap(function(s){for(;;)switch(s.prev=s.next){case 0:return s.next=2,this.metadata();case 2:return s.abrupt("return",s.sent);case 3:case"end":return s.stop()}},a,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"getImage",value:function(){var n=I(Zt.default.mark(function a(o){return Zt.default.wrap(function(u){for(;;)switch(u.prev=u.next){case 0:throw new Error("not implemented");case 1:case"end":return u.stop()}},a)}));function i(a){return n.apply(this,arguments)}return i}()},{key:"metadata",value:function(){var n=I(Zt.default.mark(function a(){return Zt.default.wrap(function(s){for(;;)switch(s.prev=s.next){case 0:throw new Error("not implemented");case 1:case"end":return s.stop()}},a)}));function i(){return n.apply(this,arguments)}return i}()},{key:"exportImage",value:function(i){throw new Error("not implemented")}},{key:"metadataURL",value:function(i){return"".concat(this.props.url,"?f=pjson")}},{key:"exportImageURL",value:function(i){var a="bbox=".concat(i.bbox[0],",").concat(i.bbox[1],",").concat(i.bbox[2],",").concat(i.bbox[3]),o="size=".concat(i.width,",").concat(i.height),s=Tm(Tm({},i),{},{bbox:a,size:o});return delete s.width,delete s.height,this.getUrl("exportImage",s)}},{key:"getUrl",value:function(i,a,o){for(var s="".concat(this.props.url,"/").concat(i),u=!0,f=0,l=Object.entries(a);f<l.length;f++){var h=D(l[f],2),d=h[0],p=h[1];s+=u?"?":"&",u=!1,Array.isArray(p)?s+="".concat(d.toUpperCase(),"=").concat(p.join(",")):s+="".concat(d.toUpperCase(),"=").concat(p?String(p):"")}return s}},{key:"checkResponse",value:function(){var n=I(Zt.default.mark(function a(o){return Zt.default.wrap(function(u){for(;;)switch(u.prev=u.next){case 0:if(o.ok){u.next=2;break}throw new Error("error");case 2:case"end":return u.stop()}},a)}));function i(a){return n.apply(this,arguments)}return i}()}]),t}(Kt);c(Wa,"type","arcgis-image-server");c(Wa,"testURL",function(e){return e.toLowerCase().includes("ImageServer")});function UE(e,r){var t=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=jE(e))||r&&e&&typeof e.length=="number"){t&&(e=t);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(f){throw f},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
18
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){t=t.call(e)},n:function(){var f=t.next();return a=f.done,f},e:function(f){o=!0,s=f},f:function(){try{!a&&t.return!=null&&t.return()}finally{if(o)throw s}}}}function jE(e,r){if(e){if(typeof e=="string")return xm(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);if(t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set")return Array.from(e);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return xm(e,r)}}function xm(e,r){(r==null||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}var HE=[zi,Wa,Vi];function yf(e){var r=e.type,t=r===void 0?"auto":r,n=t==="auto"?VE(e.url):t;switch(n){case"template":return new Vi(e);case"wms":return new zi(e);default:throw new Error("Not a valid image source type")}}function VE(e){var r=UE(HE),t;try{for(r.s();!(t=r.n()).done;){var n=t.value;if(n.testURL&&n.testURL(e))return n.type}}catch(i){r.e(i)}finally{r.f()}return"wms"}ue();q();Y();N();var Te=1e-6,Je=typeof Float32Array<"u"?Float32Array:Array;var TG=Math.PI/180;Math.hypot||(Math.hypot=function(){for(var e=0,r=arguments.length;r--;)e+=arguments[r]*arguments[r];return Math.sqrt(e)});function zE(){var e=new Je(4);return Je!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0,e[3]=0),e}function Em(e,r,t){return e[0]=r[0]+t[0],e[1]=r[1]+t[1],e[2]=r[2]+t[2],e[3]=r[3]+t[3],e}function Ja(e,r,t){return e[0]=r[0]*t,e[1]=r[1]*t,e[2]=r[2]*t,e[3]=r[3]*t,e}function Sm(e){var r=e[0],t=e[1],n=e[2],i=e[3];return Math.hypot(r,t,n,i)}function wm(e){var r=e[0],t=e[1],n=e[2],i=e[3];return r*r+t*t+n*n+i*i}function Cm(e,r){var t=r[0],n=r[1],i=r[2],a=r[3],o=t*t+n*n+i*i+a*a;return o>0&&(o=1/Math.sqrt(o)),e[0]=t*o,e[1]=n*o,e[2]=i*o,e[3]=a*o,e}function Bm(e,r){return e[0]*r[0]+e[1]*r[1]+e[2]*r[2]+e[3]*r[3]}function Mm(e,r,t,n){var i=r[0],a=r[1],o=r[2],s=r[3];return e[0]=i+n*(t[0]-i),e[1]=a+n*(t[1]-a),e[2]=o+n*(t[2]-o),e[3]=s+n*(t[3]-s),e}function Xa(e,r,t){var n=r[0],i=r[1],a=r[2],o=r[3];return e[0]=t[0]*n+t[4]*i+t[8]*a+t[12]*o,e[1]=t[1]*n+t[5]*i+t[9]*a+t[13]*o,e[2]=t[2]*n+t[6]*i+t[10]*a+t[14]*o,e[3]=t[3]*n+t[7]*i+t[11]*a+t[15]*o,e}function Om(e,r,t){var n=r[0],i=r[1],a=r[2],o=t[0],s=t[1],u=t[2],f=t[3],l=f*n+s*a-u*i,h=f*i+u*n-o*a,d=f*a+o*i-s*n,p=-o*n-s*i-u*a;return e[0]=l*f+p*-o+h*-u-d*-s,e[1]=h*f+p*-s+d*-o-l*-u,e[2]=d*f+p*-u+l*-s-h*-o,e[3]=r[3],e}var xG=function(){var e=zE();return function(r,t,n,i,a,o){var s,u;for(t||(t=4),n||(n=0),i?u=Math.min(i*t+n,r.length):u=r.length,s=n;s<u;s+=t)e[0]=r[s],e[1]=r[s+1],e[2]=r[s+2],e[3]=r[s+3],a(e,e,o),r[s]=e[0],r[s+1]=e[1],r[s+2]=e[2],r[s+3]=e[3];return r}}();function Nn(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}function gr(e,r){var t=Xa([],r,e);return Ja(t,t,1/t[3]),t}function Wi(e,r,t){return e<r?r:e>t?t:e}function WE(e){return Math.log(e)*Math.LOG2E}var qa=Math.log2||WE;ue();function JE(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function Pm(e,r){if(e===r){var t=r[1],n=r[2],i=r[3],a=r[6],o=r[7],s=r[11];e[1]=r[4],e[2]=r[8],e[3]=r[12],e[4]=t,e[6]=r[9],e[7]=r[13],e[8]=n,e[9]=a,e[11]=r[14],e[12]=i,e[13]=o,e[14]=s}else e[0]=r[0],e[1]=r[4],e[2]=r[8],e[3]=r[12],e[4]=r[1],e[5]=r[5],e[6]=r[9],e[7]=r[13],e[8]=r[2],e[9]=r[6],e[10]=r[10],e[11]=r[14],e[12]=r[3],e[13]=r[7],e[14]=r[11],e[15]=r[15];return e}function Ka(e,r){var t=r[0],n=r[1],i=r[2],a=r[3],o=r[4],s=r[5],u=r[6],f=r[7],l=r[8],h=r[9],d=r[10],p=r[11],m=r[12],v=r[13],g=r[14],y=r[15],A=t*s-n*o,x=t*u-i*o,b=t*f-a*o,M=n*u-i*s,C=n*f-a*s,F=i*f-a*u,B=l*v-h*m,S=l*g-d*m,_=l*y-p*m,R=h*g-d*v,k=h*y-p*v,U=d*y-p*g,j=A*U-x*k+b*R+M*_-C*S+F*B;return j?(j=1/j,e[0]=(s*U-u*k+f*R)*j,e[1]=(i*k-n*U-a*R)*j,e[2]=(v*F-g*C+y*M)*j,e[3]=(d*C-h*F-p*M)*j,e[4]=(u*_-o*U-f*S)*j,e[5]=(t*U-i*_+a*S)*j,e[6]=(g*b-m*F-y*x)*j,e[7]=(l*F-d*b+p*x)*j,e[8]=(o*k-s*_+f*B)*j,e[9]=(n*_-t*k-a*B)*j,e[10]=(m*C-v*b+y*A)*j,e[11]=(h*b-l*C-p*A)*j,e[12]=(s*S-o*R-u*B)*j,e[13]=(t*R-n*S+i*B)*j,e[14]=(v*x-m*M-g*A)*j,e[15]=(l*M-h*x+d*A)*j,e):null}function Im(e){var r=e[0],t=e[1],n=e[2],i=e[3],a=e[4],o=e[5],s=e[6],u=e[7],f=e[8],l=e[9],h=e[10],d=e[11],p=e[12],m=e[13],v=e[14],g=e[15],y=r*o-t*a,A=r*s-n*a,x=r*u-i*a,b=t*s-n*o,M=t*u-i*o,C=n*u-i*s,F=f*m-l*p,B=f*v-h*p,S=f*g-d*p,_=l*v-h*m,R=l*g-d*m,k=h*g-d*v;return y*k-A*R+x*_+b*S-M*B+C*F}function Zr(e,r,t){var n=r[0],i=r[1],a=r[2],o=r[3],s=r[4],u=r[5],f=r[6],l=r[7],h=r[8],d=r[9],p=r[10],m=r[11],v=r[12],g=r[13],y=r[14],A=r[15],x=t[0],b=t[1],M=t[2],C=t[3];return e[0]=x*n+b*s+M*h+C*v,e[1]=x*i+b*u+M*d+C*g,e[2]=x*a+b*f+M*p+C*y,e[3]=x*o+b*l+M*m+C*A,x=t[4],b=t[5],M=t[6],C=t[7],e[4]=x*n+b*s+M*h+C*v,e[5]=x*i+b*u+M*d+C*g,e[6]=x*a+b*f+M*p+C*y,e[7]=x*o+b*l+M*m+C*A,x=t[8],b=t[9],M=t[10],C=t[11],e[8]=x*n+b*s+M*h+C*v,e[9]=x*i+b*u+M*d+C*g,e[10]=x*a+b*f+M*p+C*y,e[11]=x*o+b*l+M*m+C*A,x=t[12],b=t[13],M=t[14],C=t[15],e[12]=x*n+b*s+M*h+C*v,e[13]=x*i+b*u+M*d+C*g,e[14]=x*a+b*f+M*p+C*y,e[15]=x*o+b*l+M*m+C*A,e}function $r(e,r,t){var n=t[0],i=t[1],a=t[2],o,s,u,f,l,h,d,p,m,v,g,y;return r===e?(e[12]=r[0]*n+r[4]*i+r[8]*a+r[12],e[13]=r[1]*n+r[5]*i+r[9]*a+r[13],e[14]=r[2]*n+r[6]*i+r[10]*a+r[14],e[15]=r[3]*n+r[7]*i+r[11]*a+r[15]):(o=r[0],s=r[1],u=r[2],f=r[3],l=r[4],h=r[5],d=r[6],p=r[7],m=r[8],v=r[9],g=r[10],y=r[11],e[0]=o,e[1]=s,e[2]=u,e[3]=f,e[4]=l,e[5]=h,e[6]=d,e[7]=p,e[8]=m,e[9]=v,e[10]=g,e[11]=y,e[12]=o*n+l*i+m*a+r[12],e[13]=s*n+h*i+v*a+r[13],e[14]=u*n+d*i+g*a+r[14],e[15]=f*n+p*i+y*a+r[15]),e}function Un(e,r,t){var n=t[0],i=t[1],a=t[2];return e[0]=r[0]*n,e[1]=r[1]*n,e[2]=r[2]*n,e[3]=r[3]*n,e[4]=r[4]*i,e[5]=r[5]*i,e[6]=r[6]*i,e[7]=r[7]*i,e[8]=r[8]*a,e[9]=r[9]*a,e[10]=r[10]*a,e[11]=r[11]*a,e[12]=r[12],e[13]=r[13],e[14]=r[14],e[15]=r[15],e}function Rm(e,r,t,n){var i=n[0],a=n[1],o=n[2],s=Math.hypot(i,a,o),u,f,l,h,d,p,m,v,g,y,A,x,b,M,C,F,B,S,_,R,k,U,j,Z;return s<Te?null:(s=1/s,i*=s,a*=s,o*=s,u=Math.sin(t),f=Math.cos(t),l=1-f,h=r[0],d=r[1],p=r[2],m=r[3],v=r[4],g=r[5],y=r[6],A=r[7],x=r[8],b=r[9],M=r[10],C=r[11],F=i*i*l+f,B=a*i*l+o*u,S=o*i*l-a*u,_=i*a*l-o*u,R=a*a*l+f,k=o*a*l+i*u,U=i*o*l+a*u,j=a*o*l-i*u,Z=o*o*l+f,e[0]=h*F+v*B+x*S,e[1]=d*F+g*B+b*S,e[2]=p*F+y*B+M*S,e[3]=m*F+A*B+C*S,e[4]=h*_+v*R+x*k,e[5]=d*_+g*R+b*k,e[6]=p*_+y*R+M*k,e[7]=m*_+A*R+C*k,e[8]=h*U+v*j+x*Z,e[9]=d*U+g*j+b*Z,e[10]=p*U+y*j+M*Z,e[11]=m*U+A*j+C*Z,r!==e&&(e[12]=r[12],e[13]=r[13],e[14]=r[14],e[15]=r[15]),e)}function Ya(e,r,t){var n=Math.sin(t),i=Math.cos(t),a=r[4],o=r[5],s=r[6],u=r[7],f=r[8],l=r[9],h=r[10],d=r[11];return r!==e&&(e[0]=r[0],e[1]=r[1],e[2]=r[2],e[3]=r[3],e[12]=r[12],e[13]=r[13],e[14]=r[14],e[15]=r[15]),e[4]=a*i+f*n,e[5]=o*i+l*n,e[6]=s*i+h*n,e[7]=u*i+d*n,e[8]=f*i-a*n,e[9]=l*i-o*n,e[10]=h*i-s*n,e[11]=d*i-u*n,e}function Fm(e,r,t){var n=Math.sin(t),i=Math.cos(t),a=r[0],o=r[1],s=r[2],u=r[3],f=r[8],l=r[9],h=r[10],d=r[11];return r!==e&&(e[4]=r[4],e[5]=r[5],e[6]=r[6],e[7]=r[7],e[12]=r[12],e[13]=r[13],e[14]=r[14],e[15]=r[15]),e[0]=a*i-f*n,e[1]=o*i-l*n,e[2]=s*i-h*n,e[3]=u*i-d*n,e[8]=a*n+f*i,e[9]=o*n+l*i,e[10]=s*n+h*i,e[11]=u*n+d*i,e}function Za(e,r,t){var n=Math.sin(t),i=Math.cos(t),a=r[0],o=r[1],s=r[2],u=r[3],f=r[4],l=r[5],h=r[6],d=r[7];return r!==e&&(e[8]=r[8],e[9]=r[9],e[10]=r[10],e[11]=r[11],e[12]=r[12],e[13]=r[13],e[14]=r[14],e[15]=r[15]),e[0]=a*i+f*n,e[1]=o*i+l*n,e[2]=s*i+h*n,e[3]=u*i+d*n,e[4]=f*i-a*n,e[5]=l*i-o*n,e[6]=h*i-s*n,e[7]=d*i-u*n,e}function Lm(e,r){var t=r[0],n=r[1],i=r[2],a=r[4],o=r[5],s=r[6],u=r[8],f=r[9],l=r[10];return e[0]=Math.hypot(t,n,i),e[1]=Math.hypot(a,o,s),e[2]=Math.hypot(u,f,l),e}function km(e,r){var t=r[0],n=r[1],i=r[2],a=r[3],o=t+t,s=n+n,u=i+i,f=t*o,l=n*o,h=n*s,d=i*o,p=i*s,m=i*u,v=a*o,g=a*s,y=a*u;return e[0]=1-h-m,e[1]=l+y,e[2]=d-g,e[3]=0,e[4]=l-y,e[5]=1-f-m,e[6]=p+v,e[7]=0,e[8]=d+g,e[9]=p-v,e[10]=1-f-h,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function Dm(e,r,t,n,i,a,o){var s=1/(t-r),u=1/(i-n),f=1/(a-o);return e[0]=a*2*s,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a*2*u,e[6]=0,e[7]=0,e[8]=(t+r)*s,e[9]=(i+n)*u,e[10]=(o+a)*f,e[11]=-1,e[12]=0,e[13]=0,e[14]=o*a*2*f,e[15]=0,e}function XE(e,r,t,n,i){var a=1/Math.tan(r/2),o;return e[0]=a/t,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,i!=null&&i!==1/0?(o=1/(n-i),e[10]=(i+n)*o,e[14]=2*i*n*o):(e[10]=-1,e[14]=-2*n),e}var $a=XE;function qE(e,r,t,n,i,a,o){var s=1/(r-t),u=1/(n-i),f=1/(a-o);return e[0]=-2*s,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*u,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*f,e[11]=0,e[12]=(r+t)*s,e[13]=(i+n)*u,e[14]=(o+a)*f,e[15]=1,e}var Gm=qE;function Nm(e,r,t,n){var i,a,o,s,u,f,l,h,d,p,m=r[0],v=r[1],g=r[2],y=n[0],A=n[1],x=n[2],b=t[0],M=t[1],C=t[2];return Math.abs(m-b)<Te&&Math.abs(v-M)<Te&&Math.abs(g-C)<Te?JE(e):(l=m-b,h=v-M,d=g-C,p=1/Math.hypot(l,h,d),l*=p,h*=p,d*=p,i=A*d-x*h,a=x*l-y*d,o=y*h-A*l,p=Math.hypot(i,a,o),p?(p=1/p,i*=p,a*=p,o*=p):(i=0,a=0,o=0),s=h*o-d*a,u=d*i-l*o,f=l*a-h*i,p=Math.hypot(s,u,f),p?(p=1/p,s*=p,u*=p,f*=p):(s=0,u=0,f=0),e[0]=i,e[1]=s,e[2]=l,e[3]=0,e[4]=a,e[5]=u,e[6]=h,e[7]=0,e[8]=o,e[9]=f,e[10]=d,e[11]=0,e[12]=-(i*m+a*v+o*g),e[13]=-(s*m+u*v+f*g),e[14]=-(l*m+h*v+d*g),e[15]=1,e)}function bf(e,r){var t=e[0],n=e[1],i=e[2],a=e[3],o=e[4],s=e[5],u=e[6],f=e[7],l=e[8],h=e[9],d=e[10],p=e[11],m=e[12],v=e[13],g=e[14],y=e[15],A=r[0],x=r[1],b=r[2],M=r[3],C=r[4],F=r[5],B=r[6],S=r[7],_=r[8],R=r[9],k=r[10],U=r[11],j=r[12],Z=r[13],P=r[14],O=r[15];return Math.abs(t-A)<=Te*Math.max(1,Math.abs(t),Math.abs(A))&&Math.abs(n-x)<=Te*Math.max(1,Math.abs(n),Math.abs(x))&&Math.abs(i-b)<=Te*Math.max(1,Math.abs(i),Math.abs(b))&&Math.abs(a-M)<=Te*Math.max(1,Math.abs(a),Math.abs(M))&&Math.abs(o-C)<=Te*Math.max(1,Math.abs(o),Math.abs(C))&&Math.abs(s-F)<=Te*Math.max(1,Math.abs(s),Math.abs(F))&&Math.abs(u-B)<=Te*Math.max(1,Math.abs(u),Math.abs(B))&&Math.abs(f-S)<=Te*Math.max(1,Math.abs(f),Math.abs(S))&&Math.abs(l-_)<=Te*Math.max(1,Math.abs(l),Math.abs(_))&&Math.abs(h-R)<=Te*Math.max(1,Math.abs(h),Math.abs(R))&&Math.abs(d-k)<=Te*Math.max(1,Math.abs(d),Math.abs(k))&&Math.abs(p-U)<=Te*Math.max(1,Math.abs(p),Math.abs(U))&&Math.abs(m-j)<=Te*Math.max(1,Math.abs(m),Math.abs(j))&&Math.abs(v-Z)<=Te*Math.max(1,Math.abs(v),Math.abs(Z))&&Math.abs(g-P)<=Te*Math.max(1,Math.abs(g),Math.abs(P))&&Math.abs(y-O)<=Te*Math.max(1,Math.abs(y),Math.abs(O))}function KE(){var e=new Je(2);return Je!=Float32Array&&(e[0]=0,e[1]=0),e}function Tf(e,r,t){return e[0]=r[0]+t[0],e[1]=r[1]+t[1],e}function Um(e,r){return e[0]=-r[0],e[1]=-r[1],e}function eo(e,r,t,n){var i=r[0],a=r[1];return e[0]=i+n*(t[0]-i),e[1]=a+n*(t[1]-a),e}function jm(e,r,t){var n=r[0],i=r[1];return e[0]=t[0]*n+t[2]*i,e[1]=t[1]*n+t[3]*i,e}function Hm(e,r,t){var n=r[0],i=r[1];return e[0]=t[0]*n+t[2]*i+t[4],e[1]=t[1]*n+t[3]*i+t[5],e}function to(e,r,t){var n=r[0],i=r[1];return e[0]=t[0]*n+t[3]*i+t[6],e[1]=t[1]*n+t[4]*i+t[7],e}function ro(e,r,t){var n=r[0],i=r[1];return e[0]=t[0]*n+t[4]*i+t[12],e[1]=t[1]*n+t[5]*i+t[13],e}var wG=function(){var e=KE();return function(r,t,n,i,a,o){var s,u;for(t||(t=2),n||(n=0),i?u=Math.min(i*t+n,r.length):u=r.length,s=n;s<u;s+=t)e[0]=r[s],e[1]=r[s+1],a(e,e,o),r[s]=e[0],r[s+1]=e[1];return r}}();function xf(){var e=new Je(3);return Je!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e}function Ef(e){var r=e[0],t=e[1],n=e[2];return Math.hypot(r,t,n)}function Sf(e,r,t){var n=new Je(3);return n[0]=e,n[1]=r,n[2]=t,n}function Vm(e,r,t){return e[0]=r[0]+t[0],e[1]=r[1]+t[1],e[2]=r[2]+t[2],e}function YE(e,r,t){return e[0]=r[0]*t[0],e[1]=r[1]*t[1],e[2]=r[2]*t[2],e}function zm(e,r){return e[0]=-r[0],e[1]=-r[1],e[2]=-r[2],e}function Wm(e,r){var t=r[0],n=r[1],i=r[2],a=t*t+n*n+i*i;return a>0&&(a=1/Math.sqrt(a)),e[0]=r[0]*a,e[1]=r[1]*a,e[2]=r[2]*a,e}function Ji(e,r){return e[0]*r[0]+e[1]*r[1]+e[2]*r[2]}function Hn(e,r,t){var n=r[0],i=r[1],a=r[2],o=t[0],s=t[1],u=t[2];return e[0]=i*u-a*s,e[1]=a*o-n*u,e[2]=n*s-i*o,e}function Vn(e,r,t){var n=r[0],i=r[1],a=r[2],o=t[3]*n+t[7]*i+t[11]*a+t[15];return o=o||1,e[0]=(t[0]*n+t[4]*i+t[8]*a+t[12])/o,e[1]=(t[1]*n+t[5]*i+t[9]*a+t[13])/o,e[2]=(t[2]*n+t[6]*i+t[10]*a+t[14])/o,e}function no(e,r,t){var n=r[0],i=r[1],a=r[2];return e[0]=n*t[0]+i*t[3]+a*t[6],e[1]=n*t[1]+i*t[4]+a*t[7],e[2]=n*t[2]+i*t[5]+a*t[8],e}function io(e,r,t){var n=t[0],i=t[1],a=t[2],o=t[3],s=r[0],u=r[1],f=r[2],l=i*f-a*u,h=a*s-n*f,d=n*u-i*s,p=i*d-a*h,m=a*l-n*d,v=n*h-i*l,g=o*2;return l*=g,h*=g,d*=g,p*=2,m*=2,v*=2,e[0]=s+l+p,e[1]=u+h+m,e[2]=f+d+v,e}function Jm(e,r,t,n){var i=[],a=[];return i[0]=r[0]-t[0],i[1]=r[1]-t[1],i[2]=r[2]-t[2],a[0]=i[0],a[1]=i[1]*Math.cos(n)-i[2]*Math.sin(n),a[2]=i[1]*Math.sin(n)+i[2]*Math.cos(n),e[0]=a[0]+t[0],e[1]=a[1]+t[1],e[2]=a[2]+t[2],e}function Xm(e,r,t,n){var i=[],a=[];return i[0]=r[0]-t[0],i[1]=r[1]-t[1],i[2]=r[2]-t[2],a[0]=i[2]*Math.sin(n)+i[0]*Math.cos(n),a[1]=i[1],a[2]=i[2]*Math.cos(n)-i[0]*Math.sin(n),e[0]=a[0]+t[0],e[1]=a[1]+t[1],e[2]=a[2]+t[2],e}function qm(e,r,t,n){var i=[],a=[];return i[0]=r[0]-t[0],i[1]=r[1]-t[1],i[2]=r[2]-t[2],a[0]=i[0]*Math.cos(n)-i[1]*Math.sin(n),a[1]=i[0]*Math.sin(n)+i[1]*Math.cos(n),a[2]=i[2],e[0]=a[0]+t[0],e[1]=a[1]+t[1],e[2]=a[2]+t[2],e}function Km(e,r){var t=e[0],n=e[1],i=e[2],a=r[0],o=r[1],s=r[2],u=Math.sqrt(t*t+n*n+i*i),f=Math.sqrt(a*a+o*o+s*s),l=u*f,h=l&&Ji(e,r)/l;return Math.acos(Math.min(Math.max(h,-1),1))}var Ym=YE;var Zm=Ef;var CG=function(){var e=xf();return function(r,t,n,i,a,o){var s,u;for(t||(t=3),n||(n=0),i?u=Math.min(i*t+n,r.length):u=r.length,s=n;s<u;s+=t)e[0]=r[s],e[1]=r[s+1],e[2]=r[s+2],a(e,e,o),r[s]=e[0],r[s+1]=e[1],r[s+2]=e[2];return r}}();function Et(e,r){if(!e)throw new Error(r||"@math.gl/web-mercator: assertion failed.")}var St=Math.PI,Qm=St/4,Gt=St/180,wf=180/St,Xi=512,$m=4003e4,Wn=85.051129,Cf=1.5;function ao(e){return Math.pow(2,e)}function $e(e){var r=D(e,2),t=r[0],n=r[1];Et(Number.isFinite(t)),Et(Number.isFinite(n)&&n>=-90&&n<=90,"invalid latitude");var i=t*Gt,a=n*Gt,o=Xi*(i+St)/(2*St),s=Xi*(St+Math.log(Math.tan(Qm+a*.5)))/(2*St);return[o,s]}function at(e){var r=D(e,2),t=r[0],n=r[1],i=t/Xi*(2*St)-St,a=2*(Math.atan(Math.exp(n/Xi*(2*St)-St))-Qm);return[i*wf,a*wf]}function Bf(e){var r=e.latitude,t=e.longitude,n=e.highPrecision,i=n===void 0?!1:n;Et(Number.isFinite(r)&&Number.isFinite(t));var a=Xi,o=Math.cos(r*Gt),s=a/360,u=s/o,f=a/$m/o,l={unitsPerMeter:[f,f,f],metersPerUnit:[1/f,1/f,1/f],unitsPerDegree:[s,u,f],degreesPerUnit:[1/s,1/u,1/f]};if(i){var h=Gt*Math.tan(r*Gt)/o,d=s*h/2,p=a/$m*h,m=p/u*f;l.unitsPerDegree2=[0,d,p],l.unitsPerMeter2=[m,0,m]}return l}function Mf(e){var r=e.height,t=e.pitch,n=e.bearing,i=e.altitude,a=e.scale,o=e.center,s=Nn();$r(s,s,[0,0,-i]),Ya(s,s,-t*Gt),Za(s,s,n*Gt);var u=a/r;return Un(s,s,[u,u,u]),o&&$r(s,s,zm([],o)),s}function ev(e){var r=e.width,t=e.height,n=e.altitude,i=e.pitch,a=i===void 0?0:i,o=e.offset,s=e.center,u=e.scale,f=e.nearZMultiplier,l=f===void 0?1:f,h=e.farZMultiplier,d=h===void 0?1:h,p=e.fovy,m=p===void 0?zn(Cf):p;n!==void 0&&(m=zn(n));var v=m*Gt,g=a*Gt,y=oo(m),A=y;s&&(A+=s[2]*u/Math.cos(g)/t);var x=v*(.5+(o?o[1]:0)/t),b=Math.sin(x)*A/Math.sin(Wi(Math.PI/2-g-x,.01,Math.PI-.01)),M=Math.sin(g)*b+A,C=A*10,F=Math.min(M*d,C);return{fov:v,aspect:r/t,focalDistance:y,near:l,far:F}}function Of(e){var r=ev(e),t=r.fov,n=r.aspect,i=r.near,a=r.far,o=$a([],t,n,i,a);return o}function zn(e){return 2*Math.atan(.5/e)*wf}function oo(e){return .5/Math.tan(.5*e*Gt)}function Pf(e,r){var t=D(e,3),n=t[0],i=t[1],a=t[2],o=a===void 0?0:a;return Et(Number.isFinite(n)&&Number.isFinite(i)&&Number.isFinite(o)),gr(r,[n,i,o,1])}function so(e,r){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,n=D(e,3),i=n[0],a=n[1],o=n[2];if(Et(Number.isFinite(i)&&Number.isFinite(a),"invalid pixel coordinate"),Number.isFinite(o)){var s=gr(r,[i,a,o,1]);return s}var u=gr(r,[i,a,0,1]),f=gr(r,[i,a,1,1]),l=u[2],h=f[2],d=l===h?0:((t||0)-l)/(h-l);return eo([],u,f,d)}ue();function uo(e){var r=e.width,t=e.height,n=e.bounds,i=e.minExtent,a=i===void 0?0:i,o=e.maxZoom,s=o===void 0?24:o,u=e.offset,f=u===void 0?[0,0]:u,l=D(n,2),h=D(l[0],2),d=h[0],p=h[1],m=D(l[1],2),v=m[0],g=m[1],y=ZE(e.padding),A=$e([d,Wi(g,-Wn,Wn)]),x=$e([v,Wi(p,-Wn,Wn)]),b=[Math.max(Math.abs(x[0]-A[0]),a),Math.max(Math.abs(x[1]-A[1]),a)],M=[r-y.left-y.right-Math.abs(f[0])*2,t-y.top-y.bottom-Math.abs(f[1])*2];Et(M[0]>0&&M[1]>0);var C=M[0]/b[0],F=M[1]/b[1],B=(y.right-y.left)/2/C,S=(y.bottom-y.top)/2/F,_=[(x[0]+A[0])/2+B,(x[1]+A[1])/2+S],R=at(_),k=Math.min(s,qa(Math.abs(Math.min(C,F))));return Et(Number.isFinite(k)),{longitude:R[0],latitude:R[1],zoom:k}}function ZE(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return typeof e=="number"?{top:e,bottom:e,left:e,right:e}:(Et(Number.isFinite(e.top)&&Number.isFinite(e.bottom)&&Number.isFinite(e.left)&&Number.isFinite(e.right)),e)}var tv=Math.PI/180;function fo(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,t=e.width,n=e.height,i=e.unproject,a={targetZ:r},o=i([0,n],a),s=i([t,n],a),u,f,l=e.fovy?.5*e.fovy*tv:Math.atan(.5/e.altitude),h=(90-e.pitch)*tv;return l>h-.01?(u=rv(e,0,r),f=rv(e,t,r)):(u=i([0,0],a),f=i([t,0],a)),[o,s,f,u]}function rv(e,r,t){var n=e.pixelUnprojectionMatrix,i=gr(n,[r,0,1,1]),a=gr(n,[r,e.height,1,1]),o=t*e.distanceScales.unitsPerMeter[2],s=(o-i[2])/(a[2]-i[2]),u=eo([],i,a,s),f=at(u);return f.push(t),f}var nv=function(){function e(){var r=this,t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{width:1,height:1};T(this,e),c(this,"latitude",void 0),c(this,"longitude",void 0),c(this,"zoom",void 0),c(this,"pitch",void 0),c(this,"bearing",void 0),c(this,"altitude",void 0),c(this,"fovy",void 0),c(this,"meterOffset",void 0),c(this,"center",void 0),c(this,"width",void 0),c(this,"height",void 0),c(this,"scale",void 0),c(this,"distanceScales",void 0),c(this,"viewMatrix",void 0),c(this,"projectionMatrix",void 0),c(this,"viewProjectionMatrix",void 0),c(this,"pixelProjectionMatrix",void 0),c(this,"pixelUnprojectionMatrix",void 0),c(this,"equals",function(k){return k instanceof e?k.width===r.width&&k.height===r.height&&bf(k.projectionMatrix,r.projectionMatrix)&&bf(k.viewMatrix,r.viewMatrix):!1}),c(this,"project",function(k){var U=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},j=U.topLeft,Z=j===void 0?!0:j,P=r.projectPosition(k),O=Pf(P,r.pixelProjectionMatrix),G=D(O,2),J=G[0],V=G[1],ee=Z?V:r.height-V;return k.length===2?[J,ee]:[J,ee,O[2]]}),c(this,"unproject",function(k){var U=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},j=U.topLeft,Z=j===void 0?!0:j,P=U.targetZ,O=P===void 0?void 0:P,G=D(k,3),J=G[0],V=G[1],ee=G[2],ie=Z?V:r.height-V,we=O&&O*r.distanceScales.unitsPerMeter[2],Me=so([J,ie,ee],r.pixelUnprojectionMatrix,we),Re=r.unprojectPosition(Me),Xe=D(Re,3),nt=Xe[0],Fe=Xe[1],Rn=Xe[2];return Number.isFinite(ee)?[nt,Fe,Rn]:Number.isFinite(O)?[nt,Fe,O]:[nt,Fe]}),c(this,"projectPosition",function(k){var U=$e(k),j=D(U,2),Z=j[0],P=j[1],O=(k[2]||0)*r.distanceScales.unitsPerMeter[2];return[Z,P,O]}),c(this,"unprojectPosition",function(k){var U=at(k),j=D(U,2),Z=j[0],P=j[1],O=(k[2]||0)*r.distanceScales.metersPerUnit[2];return[Z,P,O]});var n=t.width,i=t.height,a=t.altitude,o=a===void 0?null:a,s=t.fovy,u=s===void 0?null:s,f=t.latitude,l=f===void 0?0:f,h=t.longitude,d=h===void 0?0:h,p=t.zoom,m=p===void 0?0:p,v=t.pitch,g=v===void 0?0:v,y=t.bearing,A=y===void 0?0:y,x=t.position,b=x===void 0?null:x,M=t.nearZMultiplier,C=M===void 0?.02:M,F=t.farZMultiplier,B=F===void 0?1.01:F;n=n||1,i=i||1,u===null&&o===null?(o=Cf,u=zn(o)):u===null?u=zn(o):o===null&&(o=oo(u));var S=ao(m);o=Math.max(.75,o);var _=Bf({longitude:d,latitude:l}),R=$e([d,l]);R.push(0),b&&Vm(R,R,Ym([],b,_.unitsPerMeter)),this.projectionMatrix=Of({width:n,height:i,scale:S,center:R,pitch:g,fovy:u,nearZMultiplier:C,farZMultiplier:B}),this.viewMatrix=Mf({height:i,scale:S,center:R,pitch:g,bearing:A,altitude:o}),this.width=n,this.height=i,this.scale=S,this.latitude=l,this.longitude=d,this.zoom=m,this.pitch=g,this.bearing=A,this.altitude=o,this.fovy=u,this.center=R,this.meterOffset=b||[0,0,0],this.distanceScales=_,this._initMatrices(),Object.freeze(this)}return w(e,[{key:"_initMatrices",value:function(){var t=this.width,n=this.height,i=this.projectionMatrix,a=this.viewMatrix,o=Nn();Zr(o,o,i),Zr(o,o,a),this.viewProjectionMatrix=o;var s=Nn();Un(s,s,[t/2,-n/2,1]),$r(s,s,[1,-1,0]),Zr(s,s,o);var u=Ka(Nn(),s);if(!u)throw new Error("Pixel project matrix not invertible");this.pixelProjectionMatrix=s,this.pixelUnprojectionMatrix=u}},{key:"projectFlat",value:function(t){return $e(t)}},{key:"unprojectFlat",value:function(t){return at(t)}},{key:"getMapCenterByLngLatPosition",value:function(t){var n=t.lngLat,i=t.pos,a=so(i,this.pixelUnprojectionMatrix),o=$e(n),s=Tf([],o,Um([],a)),u=Tf([],this.center,s);return at(u)}},{key:"fitBounds",value:function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=this.width,a=this.height,o=uo(Object.assign({width:i,height:a,bounds:t},n)),s=o.longitude,u=o.latitude,f=o.zoom;return new e({width:i,height:a,longitude:s,latitude:u,zoom:f})}},{key:"getBounds",value:function(t){var n=this.getBoundingRegion(t),i=Math.min.apply(Math,K(n.map(function(u){return u[0]}))),a=Math.max.apply(Math,K(n.map(function(u){return u[0]}))),o=Math.min.apply(Math,K(n.map(function(u){return u[1]}))),s=Math.max.apply(Math,K(n.map(function(u){return u[1]})));return[[i,o],[a,s]]}},{key:"getBoundingRegion",value:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return fo(this,t.z||0)}},{key:"getLocationAtPoint",value:function(t){var n=t.lngLat,i=t.pos;return this.getMapCenterByLngLatPosition({lngLat:n,pos:i})}}]),e}();N();var iv=6378137*Math.PI;function If(e){var r=$e(e);return r[0]=(r[0]/256-1)*iv,r[1]=(r[1]/256-1)*iv,r}function av(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),t.push.apply(t,n)}return t}function lo(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{};r%2?av(Object(t),!0).forEach(function(n){c(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):av(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}function QE(e){var r=eS();return function(){var n=L(e),i;if(r){var a=L(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return $(this,i)}}function eS(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var tS={id:"imagery-layer",data:"",serviceType:"auto",srs:"auto",layers:{type:"array",compare:!0,value:[]},onMetadataLoad:{type:"function",value:function(){}},onMetadataLoadError:{type:"function",value:console.error},onImageLoadStart:{type:"function",value:function(){}},onImageLoad:{type:"function",value:function(){}},onImageLoadError:{type:"function",compare:!1,value:function(r,t){return console.error(t,r)}}},co=function(e){H(t,e);var r=QE(t);function t(){var n;T(this,t);for(var i=arguments.length,a=new Array(i),o=0;o<i;o++)a[o]=arguments[o];return n=r.call.apply(r,[this].concat(a)),c(oe(n),"state",void 0),n}return w(t,[{key:"isLoaded",get:function(){return Boolean(this.state)&&this.state.loadCounter===0&&be(L(t.prototype),"isLoaded",this)}},{key:"shouldUpdateState",value:function(){return!0}},{key:"initializeState",value:function(){this.state._nextRequestId=0,this.state.lastRequestId=-1,this.state.loadCounter=0}},{key:"updateState",value:function(i){var a=this,o=i.changeFlags,s=i.props,u=i.oldProps,f=this.context.viewport;o.dataChanged||s.serviceType!==u.serviceType?(this.state.imageSource=this._createImageSource(s),this._loadMetadata(),this.debounce(function(){return a.loadImage(f,"image source changed")},0)):(0,en._deepEqual)(s.layers,u.layers,1)?o.viewportChanged&&this.debounce(function(){return a.loadImage(f,"viewport changed")}):this.debounce(function(){return a.loadImage(f,"layers changed")},0)}},{key:"finalizeState",value:function(){}},{key:"renderLayers",value:function(){var i=this.state,a=i.bounds,o=i.image,s=i.lastRequestParameters;return o&&new ov.BitmapLayer(lo(lo({},this.getSubLayerProps({id:"bitmap"})),{},{_imageCoordinateSystem:s.srs==="EPSG:4326"?en.COORDINATE_SYSTEM.LNGLAT:en.COORDINATE_SYSTEM.CARTESIAN,bounds:a,image:o}))}},{key:"getFeatureInfoText",value:function(){var n=I(Qr.default.mark(function a(o,s){var u,f,l,h;return Qr.default.wrap(function(p){for(;;)switch(p.prev=p.next){case 0:if(u=this.state.lastRequestParameters,!u){p.next=6;break}return p.next=4,(f=(l=this.state.imageSource).getFeatureInfoText)===null||f===void 0?void 0:f.call(l,lo(lo({},u),{},{query_layers:u.layers,x:o,y:s,info_format:"application/vnd.ogc.gml"}));case 4:return h=p.sent,p.abrupt("return",h);case 6:return p.abrupt("return","");case 7:case"end":return p.stop()}},a,this)}));function i(a,o){return n.apply(this,arguments)}return i}()},{key:"_createImageSource",value:function(i){if(i.data instanceof Kt)return i.data;if(typeof i.data=="string")return yf({url:i.data,loadOptions:i.loadOptions,type:i.serviceType});throw new Error("invalid image source in props.data")}},{key:"_loadMetadata",value:function(){var n=I(Qr.default.mark(function a(){var o,s,u,f;return Qr.default.wrap(function(h){for(;;)switch(h.prev=h.next){case 0:return o=this.state.imageSource,h.prev=1,this.state.loadCounter++,h.next=5,o.getMetadata();case 5:s=h.sent,this.state.imageSource===o&&((u=this.getCurrentLayer())===null||u===void 0||u.props.onMetadataLoad(s)),h.next=12;break;case 9:h.prev=9,h.t0=h.catch(1),(f=this.getCurrentLayer())===null||f===void 0||f.props.onMetadataLoadError(h.t0);case 12:return h.prev=12,this.state.loadCounter--,h.finish(12);case 15:case"end":return h.stop()}},a,this,[[1,9,12,15]])}));function i(){return n.apply(this,arguments)}return i}()},{key:"loadImage",value:function(){var n=I(Qr.default.mark(function a(o,s){var u,f,l,h,d,p,m,v,g,y,A,x,b,M,C,F,B,S,_,R;return Qr.default.wrap(function(U){for(;;)switch(U.prev=U.next){case 0:if(u=this.props,f=u.layers,l=u.serviceType,!(l==="wms"&&f.length===0)){U.next=3;break}return U.abrupt("return");case 3:return h=o.getBounds(),d=o.width,p=o.height,m=this.getRequestId(),v=this.props.srs,v==="auto"&&(v=o.resolution?"EPSG:4326":"EPSG:3857"),g={width:d,height:p,bbox:h,layers:f,srs:v},v==="EPSG:3857"&&(y=If([h[0],h[1]]),A=D(y,2),x=A[0],b=A[1],M=If([h[2],h[3]]),C=D(M,2),F=C[0],B=C[1],g.bbox=[x,b,F,B]),U.prev=10,this.state.loadCounter++,this.props.onImageLoadStart(m),U.next=15,this.state.imageSource.getImage(g);case 15:S=U.sent,this.state.lastRequestId<m&&((_=this.getCurrentLayer())===null||_===void 0||_.props.onImageLoad(m),this.setState({image:S,bounds:h,lastRequestParameters:g,lastRequestId:m})),U.next=23;break;case 19:U.prev=19,U.t0=U.catch(10),this.raiseError(U.t0,"Load image"),(R=this.getCurrentLayer())===null||R===void 0||R.props.onImageLoadError(m,U.t0);case 23:return U.prev=23,this.state.loadCounter--,U.finish(23);case 26:case"end":return U.stop()}},a,this,[[10,19,23,26]])}));function i(a,o){return n.apply(this,arguments)}return i}()},{key:"getRequestId",value:function(){return this.state._nextRequestId++}},{key:"debounce",value:function(i){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:500;clearTimeout(this.state._timeoutId),this.state._timeoutId=setTimeout(function(){return i()},a)}}]),t}(en.CompositeLayer);c(co,"layerName","WMSLayer");c(co,"defaultProps",tS);q();N();var sv=X(Tt());function rS(e){var r=nS();return function(){var n=L(e),i;if(r){var a=L(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return $(this,i)}}function nS(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var iS={getHeight:{type:"accessor",value:0},greatCircle:!0},ho=function(e){H(t,e);var r=rS(t);function t(){return T(this,t),r.apply(this,arguments)}return t}(sv.ArcLayer);c(ho,"layerName","GreatCircleLayer");c(ho,"defaultProps",iS);q();Y();N();function Rf(e,r){if(e==null)return{};var t={},n=Object.keys(e),i,a;for(a=0;a<n.length;a++)i=n[a],!(r.indexOf(i)>=0)&&(t[i]=e[i]);return t}function Ff(e,r){if(e==null)return{};var t=Rf(e,r),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)n=a[i],!(r.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(t[n]=e[n])}return t}q();Y();N();var fv=X(xt()),kf=X(Tt()),aS=["updateTriggers"];function oS(e){var r=sS();return function(){var n=L(e),i;if(r){var a=L(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return $(this,i)}}function sS(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function uv(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),t.push.apply(t,n)}return t}function Lf(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{};r%2?uv(Object(t),!0).forEach(function(n){c(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):uv(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}var uS=Lf({},kf.PolygonLayer.defaultProps),mt=function(e){H(t,e);var r=oS(t);function t(){return T(this,t),r.apply(this,arguments)}return w(t,[{key:"indexToBounds",value:function(){return null}},{key:"renderLayers",value:function(){var i=this.props,a=i.elevationScale,o=i.extruded,s=i.wireframe,u=i.filled,f=i.stroked,l=i.lineWidthUnits,h=i.lineWidthScale,d=i.lineWidthMinPixels,p=i.lineWidthMaxPixels,m=i.lineJointRounded,v=i.lineMiterLimit,g=i.lineDashJustified,y=i.getElevation,A=i.getFillColor,x=i.getLineColor,b=i.getLineWidth,M=this.props,C=M.updateTriggers,F=M.material,B=M.transitions,S=this.getSubLayerClass("cell",kf.PolygonLayer),_=this.indexToBounds()||{},R=_.updateTriggers,k=Ff(_,aS);return new S({filled:u,wireframe:s,extruded:o,elevationScale:a,stroked:f,lineWidthUnits:l,lineWidthScale:h,lineWidthMinPixels:d,lineWidthMaxPixels:p,lineJointRounded:m,lineMiterLimit:v,lineDashJustified:g,material:F,transitions:B,getElevation:y,getFillColor:A,getLineColor:x,getLineWidth:b},this.getSubLayerProps({id:"cell",updateTriggers:C&&Lf(Lf({},R),{},{getElevation:C.getElevation,getFillColor:C.getFillColor,getLineColor:C.getLineColor,getLineWidth:C.getLineWidth})}),k)}}]),t}(fv.CompositeLayer);c(mt,"layerName","GeoCellLayer");c(mt,"defaultProps",uS);ue();var po=X(Df()),fS=3,lS=30,cS=2*lS+1,cv=180/Math.PI;function dv(e,r,t){var n=1<<r;return[(e[0]+t[0])/n,(e[1]+t[1])/n]}function hv(e){return e>=.5?1/3*(4*e*e-1):1/3*(1-4*(1-e)*(1-e))}function pv(e){return[hv(e[0]),hv(e[1])]}function mv(e,r){var t=D(r,2),n=t[0],i=t[1];switch(e){case 0:return[1,n,i];case 1:return[-n,1,i];case 2:return[-n,-i,1];case 3:return[-1,-i,-n];case 4:return[i,-1,-n];case 5:return[i,n,-1];default:throw new Error("Invalid face")}}function vv(e){var r=D(e,3),t=r[0],n=r[1],i=r[2],a=Math.atan2(i,Math.sqrt(t*t+n*n)),o=Math.atan2(n,t);return[o*cv,a*cv]}function gv(e){for(var r=po.default.fromString(e,!0,10).toString(2);r.length<fS+cS;)r="0"+r;for(var t=r.lastIndexOf("1"),n=r.substring(0,3),i=r.substring(3,t),a=i.length/2,o=po.default.fromString(n,!0,2).toString(10),s=po.default.fromString(i,!0,2).toString(4);s.length<a;)s="0"+s;return"".concat(o,"/").concat(s)}function hS(e,r,t,n){if(n===0){t===1&&(r[0]=e-1-r[0],r[1]=e-1-r[1]);var i=r[0];r[0]=r[1],r[1]=i}}function yv(e){for(var r=e.split("/"),t=parseInt(r[0],10),n=r[1],i=n.length,a=[0,0],o,s=i-1;s>=0;s--){o=i-s;var u=n[s],f=0,l=0;u==="1"?l=1:u==="2"?(f=1,l=1):u==="3"&&(f=1);var h=Math.pow(2,o-1);hS(h,a,f,l),a[0]+=h*f,a[1]+=h*l}if(t%2===1){var d=a[0];a[0]=a[1],a[1]=d}return{face:t,ij:a,level:o}}var Av=X(Df());function dS(e){var r=e.padEnd(16,"0");return Av.default.fromString(r,16)}var pS=100;function mS(e){for(var r=e.face,t=e.ij,n=e.level,i=[[0,0],[0,1],[1,1],[1,0],[0,0]],a=Math.max(1,Math.ceil(pS*Math.pow(2,-n))),o=new Float64Array(4*a*2+2),s=0,u=0,f=0;f<4;f++)for(var l=i[f].slice(0),h=i[f+1],d=(h[0]-l[0])/a,p=(h[1]-l[1])/a,m=0;m<a;m++){l[0]+=d,l[1]+=p;var v=dv(t,n,l),g=pv(v),y=mv(r,g),A=vv(y);Math.abs(A[1])>89.999&&(A[0]=u);var x=A[0]-u;A[0]+=x>180?-360:x<-180?360:0,o[s++]=A[0],o[s++]=A[1],u=A[0]}return o[s++]=o[0],o[s++]=o[1],o}function vS(e){if(typeof e=="string"){if(e.indexOf("/")>0)return e;e=dS(e)}return gv(e.toString())}function _v(e){var r=vS(e),t=yv(r);return mS(t)}function gS(e){var r=yS();return function(){var n=L(e),i;if(r){var a=L(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return $(this,i)}}function yS(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var AS={getS2Token:{type:"accessor",value:function(r){return r.token}}},mo=function(e){H(t,e);var r=gS(t);function t(){return T(this,t),r.apply(this,arguments)}return w(t,[{key:"indexToBounds",value:function(){var i=this.props,a=i.data,o=i.getS2Token;return{data:a,_normalize:!1,positionFormat:"XY",getPolygon:function(u,f){return _v(o(u,f))}}}}]),t}(mt);c(mo,"layerName","S2Layer");c(mo,"defaultProps",AS);q();Y();N();ue();var Gf=512;function _S(e,r){for(var t=0,n=0,i=1<<e.length,a=i/Gf,o=0;o<e.length;o++){i>>=1;var s=parseInt(e[o]);s%2&&(t|=i),s>1&&(n|=i)}return[[t/a,Gf-n/a],[(t+r)/a,Gf-(n+r)/a]]}function bv(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,t=_S(e,r),n=D(t,2),i=n[0],a=n[1],o=at(i),s=D(o,2),u=s[0],f=s[1],l=at(a),h=D(l,2),d=h[0],p=h[1];return[d,f,d,p,u,p,u,f,d,f]}function bS(e){var r=TS();return function(){var n=L(e),i;if(r){var a=L(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return $(this,i)}}function TS(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var xS={getQuadkey:{type:"accessor",value:function(r){return r.quadkey}}},vo=function(e){H(t,e);var r=bS(t);function t(){return T(this,t),r.apply(this,arguments)}return w(t,[{key:"indexToBounds",value:function(){var i=this.props,a=i.data,o=i.extruded,s=i.getQuadkey,u=o?.99:1;return{data:a,_normalize:!1,positionFormat:"XY",getPolygon:function(l,h){return bv(s(l,h),u)},updateTriggers:{getPolygon:u}}}}]),t}(mt);c(vo,"layerName","QuadkeyLayer");c(vo,"defaultProps",xS);q();Y();N();var Do=X(xt()),xg=X(Tt());ue();q();Y();N();q();Y();q();Y();q();Y();Le();function de(e,r){if(!e)throw new Error("math.gl assertion ".concat(r))}var ES=1/Math.PI*180,SS=1/180*Math.PI,xe={EPSILON:1e-12,debug:!1,precision:4,printTypes:!1,printDegrees:!1,printRowMajor:!0};function Nf(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=r.precision,n=t===void 0?xe.precision:t;return e=wS(e),"".concat(parseFloat(e.toPrecision(n)))}function Qe(e){return Array.isArray(e)||ArrayBuffer.isView(e)&&!(e instanceof DataView)}function Uf(e){return Tv(e)}function jf(e){return wt(e)}function Tv(e,r){return Hf(e,function(t){return t*SS},r)}function wt(e,r){return Hf(e,function(t){return t*ES},r)}function go(e,r,t){return Hf(e,function(n){return Math.max(r,Math.min(t,n))})}function Ar(e,r,t){return Qe(e)?e.map(function(n,i){return Ar(n,r[i],t)}):t*r+(1-t)*e}function He(e,r,t){var n=xe.EPSILON;t&&(xe.EPSILON=t);try{if(e===r)return!0;if(Qe(e)&&Qe(r)){if(e.length!==r.length)return!1;for(var i=0;i<e.length;++i)if(!He(e[i],r[i]))return!1;return!0}return e&&e.equals?e.equals(r):r&&r.equals?r.equals(e):typeof e=="number"&&typeof r=="number"?Math.abs(e-r)<=xe.EPSILON*Math.max(1,Math.abs(e),Math.abs(r)):!1}finally{xe.EPSILON=n}}function wS(e){return Math.round(e/xe.EPSILON)*xe.EPSILON}function CS(e){return e.clone?e.clone():new Array(e.length)}function Hf(e,r,t){if(Qe(e)){var n=e;t=t||CS(n);for(var i=0;i<t.length&&i<n.length;++i)t[i]=r(e[i],i,t);return t}return r(e)}function BS(e){var r=MS();return function(){var n=L(e),i;if(r){var a=L(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return $(this,i)}}function MS(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function OS(e){function r(){var t=Reflect.construct(e,Array.from(arguments));return Object.setPrototypeOf(t,Object.getPrototypeOf(this)),t}return r.prototype=Object.create(e.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),Object.setPrototypeOf?Object.setPrototypeOf(r,e):r.__proto__=e,r}var Jn=function(e){H(t,e);var r=BS(t);function t(){return T(this,t),r.apply(this,arguments)}return w(t,[{key:"clone",value:function(){return new this.constructor().copy(this)}},{key:"fromArray",value:function(i){for(var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,o=0;o<this.ELEMENTS;++o)this[o]=i[o+a];return this.check()}},{key:"toArray",value:function(){for(var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,o=0;o<this.ELEMENTS;++o)i[a+o]=this[o];return i}},{key:"from",value:function(i){return Array.isArray(i)?this.copy(i):this.fromObject(i)}},{key:"to",value:function(i){return i===this?this:Qe(i)?this.toArray(i):this.toObject(i)}},{key:"toTarget",value:function(i){return i?this.to(i):this}},{key:"toFloat32Array",value:function(){return new Float32Array(this)}},{key:"toString",value:function(){return this.formatString(xe)}},{key:"formatString",value:function(i){for(var a="",o=0;o<this.ELEMENTS;++o)a+=(o>0?", ":"")+Nf(this[o],i);return"".concat(i.printTypes?this.constructor.name:"","[").concat(a,"]")}},{key:"equals",value:function(i){if(!i||this.length!==i.length)return!1;for(var a=0;a<this.ELEMENTS;++a)if(!He(this[a],i[a]))return!1;return!0}},{key:"exactEquals",value:function(i){if(!i||this.length!==i.length)return!1;for(var a=0;a<this.ELEMENTS;++a)if(this[a]!==i[a])return!1;return!0}},{key:"negate",value:function(){for(var i=0;i<this.ELEMENTS;++i)this[i]=-this[i];return this.check()}},{key:"lerp",value:function(i,a,o){if(o===void 0)return this.lerp(this,i,a);for(var s=0;s<this.ELEMENTS;++s){var u=i[s];this[s]=u+o*(a[s]-u)}return this.check()}},{key:"min",value:function(i){for(var a=0;a<this.ELEMENTS;++a)this[a]=Math.min(i[a],this[a]);return this.check()}},{key:"max",value:function(i){for(var a=0;a<this.ELEMENTS;++a)this[a]=Math.max(i[a],this[a]);return this.check()}},{key:"clamp",value:function(i,a){for(var o=0;o<this.ELEMENTS;++o)this[o]=Math.min(Math.max(this[o],i[o]),a[o]);return this.check()}},{key:"add",value:function(){for(var i=arguments.length,a=new Array(i),o=0;o<i;o++)a[o]=arguments[o];for(var s=0,u=a;s<u.length;s++)for(var f=u[s],l=0;l<this.ELEMENTS;++l)this[l]+=f[l];return this.check()}},{key:"subtract",value:function(){for(var i=arguments.length,a=new Array(i),o=0;o<i;o++)a[o]=arguments[o];for(var s=0,u=a;s<u.length;s++)for(var f=u[s],l=0;l<this.ELEMENTS;++l)this[l]-=f[l];return this.check()}},{key:"scale",value:function(i){if(typeof i=="number")for(var a=0;a<this.ELEMENTS;++a)this[a]*=i;else for(var o=0;o<this.ELEMENTS&&o<i.length;++o)this[o]*=i[o];return this.check()}},{key:"multiplyByScalar",value:function(i){for(var a=0;a<this.ELEMENTS;++a)this[a]*=i;return this.check()}},{key:"check",value:function(){if(xe.debug&&!this.validate())throw new Error("math.gl: ".concat(this.constructor.name," some fields set to invalid numbers'"));return this}},{key:"validate",value:function(){for(var i=this.length===this.ELEMENTS,a=0;a<this.ELEMENTS;++a)i=i&&Number.isFinite(this[a]);return i}},{key:"sub",value:function(i){return this.subtract(i)}},{key:"setScalar",value:function(i){for(var a=0;a<this.ELEMENTS;++a)this[a]=i;return this.check()}},{key:"addScalar",value:function(i){for(var a=0;a<this.ELEMENTS;++a)this[a]+=i;return this.check()}},{key:"subScalar",value:function(i){return this.addScalar(-i)}},{key:"multiplyScalar",value:function(i){for(var a=0;a<this.ELEMENTS;++a)this[a]*=i;return this.check()}},{key:"divideScalar",value:function(i){return this.multiplyByScalar(1/i)}},{key:"clampScalar",value:function(i,a){for(var o=0;o<this.ELEMENTS;++o)this[o]=Math.min(Math.max(this[o],i),a);return this.check()}},{key:"elements",get:function(){return this}}]),t}(OS(Array));function PS(e,r){if(e.length!==r)return!1;for(var t=0;t<e.length;++t)if(!Number.isFinite(e[t]))return!1;return!0}function le(e){if(!Number.isFinite(e))throw new Error("Invalid number ".concat(e));return e}function _r(e,r){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"";if(xe.debug&&!PS(e,r))throw new Error("math.gl: ".concat(t," some fields set to invalid numbers'"));return e}function IS(e){var r=RS();return function(){var n=L(e),i;if(r){var a=L(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return $(this,i)}}function RS(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var Xn=function(e){H(t,e);var r=IS(t);function t(){return T(this,t),r.apply(this,arguments)}return w(t,[{key:"x",get:function(){return this[0]},set:function(i){this[0]=le(i)}},{key:"y",get:function(){return this[1]},set:function(i){this[1]=le(i)}},{key:"len",value:function(){return Math.sqrt(this.lengthSquared())}},{key:"magnitude",value:function(){return this.len()}},{key:"lengthSquared",value:function(){for(var i=0,a=0;a<this.ELEMENTS;++a)i+=this[a]*this[a];return i}},{key:"magnitudeSquared",value:function(){return this.lengthSquared()}},{key:"distance",value:function(i){return Math.sqrt(this.distanceSquared(i))}},{key:"distanceSquared",value:function(i){for(var a=0,o=0;o<this.ELEMENTS;++o){var s=this[o]-i[o];a+=s*s}return le(a)}},{key:"dot",value:function(i){for(var a=0,o=0;o<this.ELEMENTS;++o)a+=this[o]*i[o];return le(a)}},{key:"normalize",value:function(){var i=this.magnitude();if(i!==0)for(var a=0;a<this.ELEMENTS;++a)this[a]/=i;return this.check()}},{key:"multiply",value:function(){for(var i=arguments.length,a=new Array(i),o=0;o<i;o++)a[o]=arguments[o];for(var s=0,u=a;s<u.length;s++)for(var f=u[s],l=0;l<this.ELEMENTS;++l)this[l]*=f[l];return this.check()}},{key:"divide",value:function(){for(var i=arguments.length,a=new Array(i),o=0;o<i;o++)a[o]=arguments[o];for(var s=0,u=a;s<u.length;s++)for(var f=u[s],l=0;l<this.ELEMENTS;++l)this[l]/=f[l];return this.check()}},{key:"lengthSq",value:function(){return this.lengthSquared()}},{key:"distanceTo",value:function(i){return this.distance(i)}},{key:"distanceToSquared",value:function(i){return this.distanceSquared(i)}},{key:"getComponent",value:function(i){return de(i>=0&&i<this.ELEMENTS,"index is out of range"),le(this[i])}},{key:"setComponent",value:function(i,a){return de(i>=0&&i<this.ELEMENTS,"index is out of range"),this[i]=a,this.check()}},{key:"addVectors",value:function(i,a){return this.copy(i).add(a)}},{key:"subVectors",value:function(i,a){return this.copy(i).subtract(a)}},{key:"multiplyVectors",value:function(i,a){return this.copy(i).multiply(a)}},{key:"addScaledVector",value:function(i,a){return this.add(new this.constructor(i).multiplyScalar(a))}}]),t}(Jn);function yo(e,r,t){var n=r[0],i=r[1],a=t[3]*n+t[7]*i||1;return e[0]=(t[0]*n+t[4]*i)/a,e[1]=(t[1]*n+t[5]*i)/a,e}function Ao(e,r,t){var n=r[0],i=r[1],a=r[2],o=t[3]*n+t[7]*i+t[11]*a||1;return e[0]=(t[0]*n+t[4]*i+t[8]*a)/o,e[1]=(t[1]*n+t[5]*i+t[9]*a)/o,e[2]=(t[2]*n+t[6]*i+t[10]*a)/o,e}function xv(e,r,t){var n=r[0],i=r[1];return e[0]=t[0]*n+t[2]*i,e[1]=t[1]*n+t[3]*i,e[2]=r[2],e}function Ev(e,r,t){var n=r[0],i=r[1];return e[0]=t[0]*n+t[2]*i,e[1]=t[1]*n+t[3]*i,e[2]=r[2],e[3]=r[3],e}function _o(e,r,t){var n=r[0],i=r[1],a=r[2];return e[0]=t[0]*n+t[3]*i+t[6]*a,e[1]=t[1]*n+t[4]*i+t[7]*a,e[2]=t[2]*n+t[5]*i+t[8]*a,e[3]=r[3],e}function FS(e){var r=LS();return function(){var n=L(e),i;if(r){var a=L(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return $(this,i)}}function LS(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var tn=function(e){H(t,e);var r=FS(t);function t(){var n,i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return T(this,t),n=r.call(this,2),Qe(i)&&arguments.length===1?n.copy(i):(xe.debug&&(le(i),le(a)),n[0]=i,n[1]=a),n}return w(t,[{key:"set",value:function(i,a){return this[0]=i,this[1]=a,this.check()}},{key:"copy",value:function(i){return this[0]=i[0],this[1]=i[1],this.check()}},{key:"fromObject",value:function(i){return xe.debug&&(le(i.x),le(i.y)),this[0]=i.x,this[1]=i.y,this.check()}},{key:"toObject",value:function(i){return i.x=this[0],i.y=this[1],i}},{key:"ELEMENTS",get:function(){return 2}},{key:"horizontalAngle",value:function(){return Math.atan2(this.y,this.x)}},{key:"verticalAngle",value:function(){return Math.atan2(this.x,this.y)}},{key:"transform",value:function(i){return this.transformAsPoint(i)}},{key:"transformAsPoint",value:function(i){return ro(this,this,i),this.check()}},{key:"transformAsVector",value:function(i){return yo(this,this,i),this.check()}},{key:"transformByMatrix3",value:function(i){return to(this,this,i),this.check()}},{key:"transformByMatrix2x3",value:function(i){return Hm(this,this,i),this.check()}},{key:"transformByMatrix2",value:function(i){return jm(this,this,i),this.check()}}]),t}(Xn);q();Y();function kS(e){var r=DS();return function(){var n=L(e),i;if(r){var a=L(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return $(this,i)}}function DS(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var Vf=[0,0,0],bo,E=function(e){H(t,e);var r=kS(t);function t(){var n,i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;return T(this,t),n=r.call(this,-0,-0,-0),arguments.length===1&&Qe(i)?n.copy(i):(xe.debug&&(le(i),le(a),le(o)),n[0]=i,n[1]=a,n[2]=o),n}return w(t,[{key:"set",value:function(i,a,o){return this[0]=i,this[1]=a,this[2]=o,this.check()}},{key:"copy",value:function(i){return this[0]=i[0],this[1]=i[1],this[2]=i[2],this.check()}},{key:"fromObject",value:function(i){return xe.debug&&(le(i.x),le(i.y),le(i.z)),this[0]=i.x,this[1]=i.y,this[2]=i.z,this.check()}},{key:"toObject",value:function(i){return i.x=this[0],i.y=this[1],i.z=this[2],i}},{key:"ELEMENTS",get:function(){return 3}},{key:"z",get:function(){return this[2]},set:function(i){this[2]=le(i)}},{key:"angle",value:function(i){return Km(this,i)}},{key:"cross",value:function(i){return Hn(this,this,i),this.check()}},{key:"rotateX",value:function(i){var a=i.radians,o=i.origin,s=o===void 0?Vf:o;return Jm(this,this,s,a),this.check()}},{key:"rotateY",value:function(i){var a=i.radians,o=i.origin,s=o===void 0?Vf:o;return Xm(this,this,s,a),this.check()}},{key:"rotateZ",value:function(i){var a=i.radians,o=i.origin,s=o===void 0?Vf:o;return qm(this,this,s,a),this.check()}},{key:"transform",value:function(i){return this.transformAsPoint(i)}},{key:"transformAsPoint",value:function(i){return Vn(this,this,i),this.check()}},{key:"transformAsVector",value:function(i){return Ao(this,this,i),this.check()}},{key:"transformByMatrix3",value:function(i){return no(this,this,i),this.check()}},{key:"transformByMatrix2",value:function(i){return xv(this,this,i),this.check()}},{key:"transformByQuaternion",value:function(i){return io(this,this,i),this.check()}}],[{key:"ZERO",get:function(){return bo||(bo=new t(0,0,0),Object.freeze(bo)),bo}}]),t}(Xn);q();Y();function GS(e){var r=NS();return function(){var n=L(e),i;if(r){var a=L(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return $(this,i)}}function NS(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var To,Sv=function(e){H(t,e);var r=GS(t);function t(){var n,i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0;return T(this,t),n=r.call(this,-0,-0,-0,-0),Qe(i)&&arguments.length===1?n.copy(i):(xe.debug&&(le(i),le(a),le(o),le(s)),n[0]=i,n[1]=a,n[2]=o,n[3]=s),n}return w(t,[{key:"set",value:function(i,a,o,s){return this[0]=i,this[1]=a,this[2]=o,this[3]=s,this.check()}},{key:"copy",value:function(i){return this[0]=i[0],this[1]=i[1],this[2]=i[2],this[3]=i[3],this.check()}},{key:"fromObject",value:function(i){return xe.debug&&(le(i.x),le(i.y),le(i.z),le(i.w)),this[0]=i.x,this[1]=i.y,this[2]=i.z,this[3]=i.w,this}},{key:"toObject",value:function(i){return i.x=this[0],i.y=this[1],i.z=this[2],i.w=this[3],i}},{key:"ELEMENTS",get:function(){return 4}},{key:"z",get:function(){return this[2]},set:function(i){this[2]=le(i)}},{key:"w",get:function(){return this[3]},set:function(i){this[3]=le(i)}},{key:"transform",value:function(i){return Vn(this,this,i),this.check()}},{key:"transformByMatrix3",value:function(i){return _o(this,this,i),this.check()}},{key:"transformByMatrix2",value:function(i){return Ev(this,this,i),this.check()}},{key:"transformByQuaternion",value:function(i){return io(this,this,i),this.check()}},{key:"applyMatrix4",value:function(i){return i.transform(this,this),this}}],[{key:"ZERO",get:function(){return To||(To=new t(0,0,0,0),Object.freeze(To)),To}}]),t}(Xn);q();Y();q();Y();function US(e){var r=jS();return function(){var n=L(e),i;if(r){var a=L(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return $(this,i)}}function jS(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var xo=function(e){H(t,e);var r=US(t);function t(){return T(this,t),r.apply(this,arguments)}return w(t,[{key:"toString",value:function(){var i="[";if(xe.printRowMajor){i+="row-major:";for(var a=0;a<this.RANK;++a)for(var o=0;o<this.RANK;++o)i+=" ".concat(this[o*this.RANK+a])}else{i+="column-major:";for(var s=0;s<this.ELEMENTS;++s)i+=" ".concat(this[s])}return i+="]",i}},{key:"getElementIndex",value:function(i,a){return a*this.RANK+i}},{key:"getElement",value:function(i,a){return this[a*this.RANK+i]}},{key:"setElement",value:function(i,a,o){return this[a*this.RANK+i]=le(o),this}},{key:"getColumn",value:function(i){for(var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:new Array(this.RANK).fill(-0),o=i*this.RANK,s=0;s<this.RANK;++s)a[s]=this[o+s];return a}},{key:"setColumn",value:function(i,a){for(var o=i*this.RANK,s=0;s<this.RANK;++s)this[o+s]=a[s];return this}}]),t}(Jn);function wv(){var e=new Je(9);return Je!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[5]=0,e[6]=0,e[7]=0),e[0]=1,e[4]=1,e[8]=1,e}function Cv(e,r){if(e===r){var t=r[1],n=r[2],i=r[5];e[1]=r[3],e[2]=r[6],e[3]=t,e[5]=r[7],e[6]=n,e[7]=i}else e[0]=r[0],e[1]=r[3],e[2]=r[6],e[3]=r[1],e[4]=r[4],e[5]=r[7],e[6]=r[2],e[7]=r[5],e[8]=r[8];return e}function Bv(e,r){var t=r[0],n=r[1],i=r[2],a=r[3],o=r[4],s=r[5],u=r[6],f=r[7],l=r[8],h=l*o-s*f,d=-l*a+s*u,p=f*a-o*u,m=t*h+n*d+i*p;return m?(m=1/m,e[0]=h*m,e[1]=(-l*n+i*f)*m,e[2]=(s*n-i*o)*m,e[3]=d*m,e[4]=(l*t-i*u)*m,e[5]=(-s*t+i*a)*m,e[6]=p*m,e[7]=(-f*t+n*u)*m,e[8]=(o*t-n*a)*m,e):null}function Mv(e){var r=e[0],t=e[1],n=e[2],i=e[3],a=e[4],o=e[5],s=e[6],u=e[7],f=e[8];return r*(f*a-o*u)+t*(-f*i+o*s)+n*(u*i-a*s)}function zf(e,r,t){var n=r[0],i=r[1],a=r[2],o=r[3],s=r[4],u=r[5],f=r[6],l=r[7],h=r[8],d=t[0],p=t[1],m=t[2],v=t[3],g=t[4],y=t[5],A=t[6],x=t[7],b=t[8];return e[0]=d*n+p*o+m*f,e[1]=d*i+p*s+m*l,e[2]=d*a+p*u+m*h,e[3]=v*n+g*o+y*f,e[4]=v*i+g*s+y*l,e[5]=v*a+g*u+y*h,e[6]=A*n+x*o+b*f,e[7]=A*i+x*s+b*l,e[8]=A*a+x*u+b*h,e}function Ov(e,r,t){var n=r[0],i=r[1],a=r[2],o=r[3],s=r[4],u=r[5],f=r[6],l=r[7],h=r[8],d=t[0],p=t[1];return e[0]=n,e[1]=i,e[2]=a,e[3]=o,e[4]=s,e[5]=u,e[6]=d*n+p*o+f,e[7]=d*i+p*s+l,e[8]=d*a+p*u+h,e}function Pv(e,r,t){var n=r[0],i=r[1],a=r[2],o=r[3],s=r[4],u=r[5],f=r[6],l=r[7],h=r[8],d=Math.sin(t),p=Math.cos(t);return e[0]=p*n+d*o,e[1]=p*i+d*s,e[2]=p*a+d*u,e[3]=p*o-d*n,e[4]=p*s-d*i,e[5]=p*u-d*a,e[6]=f,e[7]=l,e[8]=h,e}function Wf(e,r,t){var n=t[0],i=t[1];return e[0]=n*r[0],e[1]=n*r[1],e[2]=n*r[2],e[3]=i*r[3],e[4]=i*r[4],e[5]=i*r[5],e[6]=r[6],e[7]=r[7],e[8]=r[8],e}function Iv(e,r){var t=r[0],n=r[1],i=r[2],a=r[3],o=t+t,s=n+n,u=i+i,f=t*o,l=n*o,h=n*s,d=i*o,p=i*s,m=i*u,v=a*o,g=a*s,y=a*u;return e[0]=1-h-m,e[3]=l-y,e[6]=d+g,e[1]=l+y,e[4]=1-f-m,e[7]=p-v,e[2]=d-g,e[5]=p+v,e[8]=1-f-h,e}function HS(e){var r=VS();return function(){var n=L(e),i;if(r){var a=L(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return $(this,i)}}function VS(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var Jf;(function(e){e[e.COL0ROW0=0]="COL0ROW0",e[e.COL0ROW1=1]="COL0ROW1",e[e.COL0ROW2=2]="COL0ROW2",e[e.COL1ROW0=3]="COL1ROW0",e[e.COL1ROW1=4]="COL1ROW1",e[e.COL1ROW2=5]="COL1ROW2",e[e.COL2ROW0=6]="COL2ROW0",e[e.COL2ROW1=7]="COL2ROW1",e[e.COL2ROW2=8]="COL2ROW2"})(Jf||(Jf={}));var zS=Object.freeze([1,0,0,0,1,0,0,0,1]),_e=function(e){H(t,e);var r=HS(t);function t(n){for(var i,a=arguments.length,o=new Array(a>1?a-1:0),s=1;s<a;s++)o[s-1]=arguments[s];return T(this,t),i=r.call(this,-0,-0,-0,-0,-0,-0,-0,-0,-0),arguments.length===1&&Array.isArray(n)?i.copy(n):o.length>0?i.copy([n].concat(o)):i.identity(),i}return w(t,[{key:"ELEMENTS",get:function(){return 9}},{key:"RANK",get:function(){return 3}},{key:"INDICES",get:function(){return Jf}},{key:"copy",value:function(i){return this[0]=i[0],this[1]=i[1],this[2]=i[2],this[3]=i[3],this[4]=i[4],this[5]=i[5],this[6]=i[6],this[7]=i[7],this[8]=i[8],this.check()}},{key:"identity",value:function(){return this.copy(zS)}},{key:"fromObject",value:function(i){return this.check()}},{key:"fromQuaternion",value:function(i){return Iv(this,i),this.check()}},{key:"set",value:function(i,a,o,s,u,f,l,h,d){return this[0]=i,this[1]=a,this[2]=o,this[3]=s,this[4]=u,this[5]=f,this[6]=l,this[7]=h,this[8]=d,this.check()}},{key:"setRowMajor",value:function(i,a,o,s,u,f,l,h,d){return this[0]=i,this[1]=s,this[2]=l,this[3]=a,this[4]=u,this[5]=h,this[6]=o,this[7]=f,this[8]=d,this.check()}},{key:"determinant",value:function(){return Mv(this)}},{key:"transpose",value:function(){return Cv(this,this),this.check()}},{key:"invert",value:function(){return Bv(this,this),this.check()}},{key:"multiplyLeft",value:function(i){return zf(this,i,this),this.check()}},{key:"multiplyRight",value:function(i){return zf(this,this,i),this.check()}},{key:"rotate",value:function(i){return Pv(this,this,i),this.check()}},{key:"scale",value:function(i){return Array.isArray(i)?Wf(this,this,i):Wf(this,this,[i,i]),this.check()}},{key:"translate",value:function(i){return Ov(this,this,i),this.check()}},{key:"transform",value:function(i,a){var o;switch(i.length){case 2:o=to(a||[-0,-0],i,this);break;case 3:o=no(a||[-0,-0,-0],i,this);break;case 4:o=_o(a||[-0,-0,-0,-0],i,this);break;default:throw new Error("Illegal vector")}return _r(o,i.length),o}},{key:"transformVector",value:function(i,a){return this.transform(i,a)}},{key:"transformVector2",value:function(i,a){return this.transform(i,a)}},{key:"transformVector3",value:function(i,a){return this.transform(i,a)}}],[{key:"IDENTITY",get:function(){return JS()}},{key:"ZERO",get:function(){return WS()}}]),t}(xo);var Eo,So;function WS(){return Eo||(Eo=new _e([0,0,0,0,0,0,0,0,0]),Object.freeze(Eo)),Eo}function JS(){return So||(So=new _e,Object.freeze(So)),So}q();Y();function XS(e){var r=qS();return function(){var n=L(e),i;if(r){var a=L(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return $(this,i)}}function qS(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var Kf;(function(e){e[e.COL0ROW0=0]="COL0ROW0",e[e.COL0ROW1=1]="COL0ROW1",e[e.COL0ROW2=2]="COL0ROW2",e[e.COL0ROW3=3]="COL0ROW3",e[e.COL1ROW0=4]="COL1ROW0",e[e.COL1ROW1=5]="COL1ROW1",e[e.COL1ROW2=6]="COL1ROW2",e[e.COL1ROW3=7]="COL1ROW3",e[e.COL2ROW0=8]="COL2ROW0",e[e.COL2ROW1=9]="COL2ROW1",e[e.COL2ROW2=10]="COL2ROW2",e[e.COL2ROW3=11]="COL2ROW3",e[e.COL3ROW0=12]="COL3ROW0",e[e.COL3ROW1=13]="COL3ROW1",e[e.COL3ROW2=14]="COL3ROW2",e[e.COL3ROW3=15]="COL3ROW3"})(Kf||(Kf={}));var KS=45*Math.PI/180,YS=1,Xf=.1,qf=500,ZS=Object.freeze([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),se=function(e){H(t,e);var r=XS(t);function t(n){var i;return T(this,t),i=r.call(this,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0),arguments.length===1&&Array.isArray(n)?i.copy(n):i.identity(),i}return w(t,[{key:"ELEMENTS",get:function(){return 16}},{key:"RANK",get:function(){return 4}},{key:"INDICES",get:function(){return Kf}},{key:"copy",value:function(i){return this[0]=i[0],this[1]=i[1],this[2]=i[2],this[3]=i[3],this[4]=i[4],this[5]=i[5],this[6]=i[6],this[7]=i[7],this[8]=i[8],this[9]=i[9],this[10]=i[10],this[11]=i[11],this[12]=i[12],this[13]=i[13],this[14]=i[14],this[15]=i[15],this.check()}},{key:"set",value:function(i,a,o,s,u,f,l,h,d,p,m,v,g,y,A,x){return this[0]=i,this[1]=a,this[2]=o,this[3]=s,this[4]=u,this[5]=f,this[6]=l,this[7]=h,this[8]=d,this[9]=p,this[10]=m,this[11]=v,this[12]=g,this[13]=y,this[14]=A,this[15]=x,this.check()}},{key:"setRowMajor",value:function(i,a,o,s,u,f,l,h,d,p,m,v,g,y,A,x){return this[0]=i,this[1]=u,this[2]=d,this[3]=g,this[4]=a,this[5]=f,this[6]=p,this[7]=y,this[8]=o,this[9]=l,this[10]=m,this[11]=A,this[12]=s,this[13]=h,this[14]=v,this[15]=x,this.check()}},{key:"toRowMajor",value:function(i){return i[0]=this[0],i[1]=this[4],i[2]=this[8],i[3]=this[12],i[4]=this[1],i[5]=this[5],i[6]=this[9],i[7]=this[13],i[8]=this[2],i[9]=this[6],i[10]=this[10],i[11]=this[14],i[12]=this[3],i[13]=this[7],i[14]=this[11],i[15]=this[15],i}},{key:"identity",value:function(){return this.copy(ZS)}},{key:"fromObject",value:function(i){return this.check()}},{key:"fromQuaternion",value:function(i){return km(this,i),this.check()}},{key:"frustum",value:function(i){var a=i.left,o=i.right,s=i.bottom,u=i.top,f=i.near,l=f===void 0?Xf:f,h=i.far,d=h===void 0?qf:h;return d===1/0?ew(this,a,o,s,u,l):Dm(this,a,o,s,u,l,d),this.check()}},{key:"lookAt",value:function(i){var a=i.eye,o=i.center,s=o===void 0?[0,0,0]:o,u=i.up,f=u===void 0?[0,1,0]:u;return Nm(this,a,s,f),this.check()}},{key:"ortho",value:function(i){var a=i.left,o=i.right,s=i.bottom,u=i.top,f=i.near,l=f===void 0?Xf:f,h=i.far,d=h===void 0?qf:h;return Gm(this,a,o,s,u,l,d),this.check()}},{key:"orthographic",value:function(i){var a=i.fovy,o=a===void 0?KS:a,s=i.aspect,u=s===void 0?YS:s,f=i.focalDistance,l=f===void 0?1:f,h=i.near,d=h===void 0?Xf:h,p=i.far,m=p===void 0?qf:p;Fv(o);var v=o/2,g=l*Math.tan(v),y=g*u;return this.ortho({left:-y,right:y,bottom:-g,top:g,near:d,far:m})}},{key:"perspective",value:function(i){var a=i.fovy,o=a===void 0?45*Math.PI/180:a,s=i.aspect,u=s===void 0?1:s,f=i.near,l=f===void 0?.1:f,h=i.far,d=h===void 0?500:h;return Fv(o),$a(this,o,u,l,d),this.check()}},{key:"determinant",value:function(){return Im(this)}},{key:"getScale",value:function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[-0,-0,-0];return i[0]=Math.sqrt(this[0]*this[0]+this[1]*this[1]+this[2]*this[2]),i[1]=Math.sqrt(this[4]*this[4]+this[5]*this[5]+this[6]*this[6]),i[2]=Math.sqrt(this[8]*this[8]+this[9]*this[9]+this[10]*this[10]),i}},{key:"getTranslation",value:function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[-0,-0,-0];return i[0]=this[12],i[1]=this[13],i[2]=this[14],i}},{key:"getRotation",value:function(i,a){i=i||[-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0],a=a||[-0,-0,-0];var o=this.getScale(a),s=1/o[0],u=1/o[1],f=1/o[2];return i[0]=this[0]*s,i[1]=this[1]*u,i[2]=this[2]*f,i[3]=0,i[4]=this[4]*s,i[5]=this[5]*u,i[6]=this[6]*f,i[7]=0,i[8]=this[8]*s,i[9]=this[9]*u,i[10]=this[10]*f,i[11]=0,i[12]=0,i[13]=0,i[14]=0,i[15]=1,i}},{key:"getRotationMatrix3",value:function(i,a){i=i||[-0,-0,-0,-0,-0,-0,-0,-0,-0],a=a||[-0,-0,-0];var o=this.getScale(a),s=1/o[0],u=1/o[1],f=1/o[2];return i[0]=this[0]*s,i[1]=this[1]*u,i[2]=this[2]*f,i[3]=this[4]*s,i[4]=this[5]*u,i[5]=this[6]*f,i[6]=this[8]*s,i[7]=this[9]*u,i[8]=this[10]*f,i}},{key:"transpose",value:function(){return Pm(this,this),this.check()}},{key:"invert",value:function(){return Ka(this,this),this.check()}},{key:"multiplyLeft",value:function(i){return Zr(this,i,this),this.check()}},{key:"multiplyRight",value:function(i){return Zr(this,this,i),this.check()}},{key:"rotateX",value:function(i){return Ya(this,this,i),this.check()}},{key:"rotateY",value:function(i){return Fm(this,this,i),this.check()}},{key:"rotateZ",value:function(i){return Za(this,this,i),this.check()}},{key:"rotateXYZ",value:function(i){return this.rotateX(i[0]).rotateY(i[1]).rotateZ(i[2])}},{key:"rotateAxis",value:function(i,a){return Rm(this,this,i,a),this.check()}},{key:"scale",value:function(i){return Un(this,this,Array.isArray(i)?i:[i,i,i]),this.check()}},{key:"translate",value:function(i){return $r(this,this,i),this.check()}},{key:"transform",value:function(i,a){return i.length===4?(a=Xa(a||[-0,-0,-0,-0],i,this),_r(a,4),a):this.transformAsPoint(i,a)}},{key:"transformAsPoint",value:function(i,a){var o=i.length,s;switch(o){case 2:s=ro(a||[-0,-0],i,this);break;case 3:s=Vn(a||[-0,-0,-0],i,this);break;default:throw new Error("Illegal vector")}return _r(s,i.length),s}},{key:"transformAsVector",value:function(i,a){var o;switch(i.length){case 2:o=yo(a||[-0,-0],i,this);break;case 3:o=Ao(a||[-0,-0,-0],i,this);break;default:throw new Error("Illegal vector")}return _r(o,i.length),o}},{key:"transformPoint",value:function(i,a){return this.transformAsPoint(i,a)}},{key:"transformVector",value:function(i,a){return this.transformAsPoint(i,a)}},{key:"transformDirection",value:function(i,a){return this.transformAsVector(i,a)}},{key:"makeRotationX",value:function(i){return this.identity().rotateX(i)}},{key:"makeTranslation",value:function(i,a,o){return this.identity().translate([i,a,o])}}],[{key:"IDENTITY",get:function(){return QS()}},{key:"ZERO",get:function(){return $S()}}]),t}(xo);var wo,Co;function $S(){return wo||(wo=new se([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),Object.freeze(wo)),wo}function QS(){return Co||(Co=new se,Object.freeze(Co)),Co}function Fv(e){if(e>Math.PI*2)throw Error("expected radians")}function ew(e,r,t,n,i,a){var o=2*a/(t-r),s=2*a/(i-n),u=(t+r)/(t-r),f=(i+n)/(i-n),l=-1,h=-1,d=-2*a;return e[0]=o,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=s,e[6]=0,e[7]=0,e[8]=u,e[9]=f,e[10]=l,e[11]=h,e[12]=0,e[13]=0,e[14]=d,e[15]=0,e}q();Y();function Lv(){var e=new Je(4);return Je!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e[3]=1,e}function kv(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e}function Yf(e,r,t){t=t*.5;var n=Math.sin(t);return e[0]=n*r[0],e[1]=n*r[1],e[2]=n*r[2],e[3]=Math.cos(t),e}function Zf(e,r,t){var n=r[0],i=r[1],a=r[2],o=r[3],s=t[0],u=t[1],f=t[2],l=t[3];return e[0]=n*l+o*s+i*f-a*u,e[1]=i*l+o*u+a*s-n*f,e[2]=a*l+o*f+n*u-i*s,e[3]=o*l-n*s-i*u-a*f,e}function Dv(e,r,t){t*=.5;var n=r[0],i=r[1],a=r[2],o=r[3],s=Math.sin(t),u=Math.cos(t);return e[0]=n*u+o*s,e[1]=i*u+a*s,e[2]=a*u-i*s,e[3]=o*u-n*s,e}function Gv(e,r,t){t*=.5;var n=r[0],i=r[1],a=r[2],o=r[3],s=Math.sin(t),u=Math.cos(t);return e[0]=n*u-a*s,e[1]=i*u+o*s,e[2]=a*u+n*s,e[3]=o*u-i*s,e}function Nv(e,r,t){t*=.5;var n=r[0],i=r[1],a=r[2],o=r[3],s=Math.sin(t),u=Math.cos(t);return e[0]=n*u+i*s,e[1]=i*u-n*s,e[2]=a*u+o*s,e[3]=o*u-a*s,e}function Uv(e,r){var t=r[0],n=r[1],i=r[2];return e[0]=t,e[1]=n,e[2]=i,e[3]=Math.sqrt(Math.abs(1-t*t-n*n-i*i)),e}function Ki(e,r,t,n){var i=r[0],a=r[1],o=r[2],s=r[3],u=t[0],f=t[1],l=t[2],h=t[3],d,p,m,v,g;return p=i*u+a*f+o*l+s*h,p<0&&(p=-p,u=-u,f=-f,l=-l,h=-h),1-p>Te?(d=Math.acos(p),m=Math.sin(d),v=Math.sin((1-n)*d)/m,g=Math.sin(n*d)/m):(v=1-n,g=n),e[0]=v*i+g*u,e[1]=v*a+g*f,e[2]=v*o+g*l,e[3]=v*s+g*h,e}function jv(e,r){var t=r[0],n=r[1],i=r[2],a=r[3],o=t*t+n*n+i*i+a*a,s=o?1/o:0;return e[0]=-t*s,e[1]=-n*s,e[2]=-i*s,e[3]=a*s,e}function Hv(e,r){return e[0]=-r[0],e[1]=-r[1],e[2]=-r[2],e[3]=r[3],e}function $f(e,r){var t=r[0]+r[4]+r[8],n;if(t>0)n=Math.sqrt(t+1),e[3]=.5*n,n=.5/n,e[0]=(r[5]-r[7])*n,e[1]=(r[6]-r[2])*n,e[2]=(r[1]-r[3])*n;else{var i=0;r[4]>r[0]&&(i=1),r[8]>r[i*3+i]&&(i=2);var a=(i+1)%3,o=(i+2)%3;n=Math.sqrt(r[i*3+i]-r[a*3+a]-r[o*3+o]+1),e[i]=.5*n,n=.5/n,e[3]=(r[a*3+o]-r[o*3+a])*n,e[a]=(r[a*3+i]+r[i*3+a])*n,e[o]=(r[o*3+i]+r[i*3+o])*n}return e}var Vv=Em;var zv=Ja,Wv=Bm,Jv=Mm,Xv=Sm;var qv=wm;var Kv=Cm;var Yv=function(){var e=xf(),r=Sf(1,0,0),t=Sf(0,1,0);return function(n,i,a){var o=Ji(i,a);return o<-.999999?(Hn(e,r,i),Zm(e)<1e-6&&Hn(e,t,i),Wm(e,e),Yf(n,e,Math.PI),n):o>.999999?(n[0]=0,n[1]=0,n[2]=0,n[3]=1,n):(Hn(e,i,a),n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=1+o,Kv(n,n))}}(),t8=function(){var e=Lv(),r=Lv();return function(t,n,i,a,o,s){return Ki(e,n,o,s),Ki(r,i,a,s),Ki(t,e,r,2*s*(1-s)),t}}(),r8=function(){var e=wv();return function(r,t,n,i){return e[0]=n[0],e[3]=n[1],e[6]=n[2],e[1]=i[0],e[4]=i[1],e[7]=i[2],e[2]=-t[0],e[5]=-t[1],e[8]=-t[2],Kv(r,$f(r,e))}}();function rw(e){var r=nw();return function(){var n=L(e),i;if(r){var a=L(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return $(this,i)}}function nw(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var iw=[0,0,0,1],br=function(e){H(t,e);var r=rw(t);function t(){var n,i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:1;return T(this,t),n=r.call(this,-0,-0,-0,-0),Array.isArray(i)&&arguments.length===1?n.copy(i):n.set(i,a,o,s),n}return w(t,[{key:"copy",value:function(i){return this[0]=i[0],this[1]=i[1],this[2]=i[2],this[3]=i[3],this.check()}},{key:"set",value:function(i,a,o,s){return this[0]=i,this[1]=a,this[2]=o,this[3]=s,this.check()}},{key:"fromObject",value:function(i){return this[0]=i.x,this[1]=i.y,this[2]=i.z,this[3]=i.w,this.check()}},{key:"fromMatrix3",value:function(i){return $f(this,i),this.check()}},{key:"fromAxisRotation",value:function(i,a){return Yf(this,i,a),this.check()}},{key:"identity",value:function(){return kv(this),this.check()}},{key:"setAxisAngle",value:function(i,a){return this.fromAxisRotation(i,a)}},{key:"ELEMENTS",get:function(){return 4}},{key:"x",get:function(){return this[0]},set:function(i){this[0]=le(i)}},{key:"y",get:function(){return this[1]},set:function(i){this[1]=le(i)}},{key:"z",get:function(){return this[2]},set:function(i){this[2]=le(i)}},{key:"w",get:function(){return this[3]},set:function(i){this[3]=le(i)}},{key:"len",value:function(){return Xv(this)}},{key:"lengthSquared",value:function(){return qv(this)}},{key:"dot",value:function(i){return Wv(this,i)}},{key:"rotationTo",value:function(i,a){return Yv(this,i,a),this.check()}},{key:"add",value:function(i){return Vv(this,this,i),this.check()}},{key:"calculateW",value:function(){return Uv(this,this),this.check()}},{key:"conjugate",value:function(){return Hv(this,this),this.check()}},{key:"invert",value:function(){return jv(this,this),this.check()}},{key:"lerp",value:function(i,a,o){return o===void 0?this.lerp(this,i,a):(Jv(this,i,a,o),this.check())}},{key:"multiplyRight",value:function(i){return Zf(this,this,i),this.check()}},{key:"multiplyLeft",value:function(i){return Zf(this,i,this),this.check()}},{key:"normalize",value:function(){var i=this.len(),a=i>0?1/i:0;return this[0]=this[0]*a,this[1]=this[1]*a,this[2]=this[2]*a,this[3]=this[3]*a,i===0&&(this[3]=1),this.check()}},{key:"rotateX",value:function(i){return Dv(this,this,i),this.check()}},{key:"rotateY",value:function(i){return Gv(this,this,i),this.check()}},{key:"rotateZ",value:function(i){return Nv(this,this,i),this.check()}},{key:"scale",value:function(i){return zv(this,this,i),this.check()}},{key:"slerp",value:function(i,a,o){var s,u,f;switch(arguments.length){case 1:var l=i.start;s=l===void 0?iw:l,u=i.target,f=i.ratio;break;case 2:s=this,u=i,f=a;break;default:s=i,u=a,f=o}return Ki(this,s,u,f),this.check()}},{key:"transformVector4",value:function(i){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:new Sv;return Om(a,i,this),_r(a,4)}},{key:"lengthSq",value:function(){return this.lengthSquared()}},{key:"setFromAxisAngle",value:function(i,a){return this.setAxisAngle(i,a)}},{key:"premultiply",value:function(i){return this.multiplyLeft(i)}},{key:"multiply",value:function(i){return this.multiplyRight(i)}}]),t}(Jn);var Nt={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,PI_OVER_TWO:Math.PI/2,PI_OVER_FOUR:Math.PI/4,PI_OVER_SIX:Math.PI/6,TWO_PI:Math.PI*2};q();Y();N();var Qf=X(re()),Yi=function(){function e(r){T(this,e),c(this,"index",void 0),c(this,"isVisible",void 0),c(this,"isSelected",void 0),c(this,"parent",void 0),c(this,"children",void 0),c(this,"content",void 0),c(this,"state",void 0),c(this,"layers",void 0),c(this,"id",void 0),c(this,"zoom",void 0),c(this,"userData",void 0),c(this,"boundingBox",void 0),c(this,"_abortController",void 0),c(this,"_loader",void 0),c(this,"_loaderId",void 0),c(this,"_isLoaded",void 0),c(this,"_isCancelled",void 0),c(this,"_needsReload",void 0),c(this,"_bbox",void 0),this.index=r,this.isVisible=!1,this.isSelected=!1,this.parent=null,this.children=[],this.content=null,this._loader=void 0,this._abortController=null,this._loaderId=0,this._isLoaded=!1,this._isCancelled=!1,this._needsReload=!1}return w(e,[{key:"bbox",get:function(){return this._bbox},set:function(t){this._bbox||(this._bbox=t,"west"in t?this.boundingBox=[[t.west,t.south],[t.east,t.north]]:this.boundingBox=[[t.left,t.top],[t.right,t.bottom]])}},{key:"data",get:function(){var t=this;return this.isLoading&&this._loader?this._loader.then(function(){return t.data}):this.content}},{key:"isLoaded",get:function(){return this._isLoaded&&!this._needsReload}},{key:"isLoading",get:function(){return Boolean(this._loader)&&!this._isCancelled}},{key:"needsReload",get:function(){return this._needsReload||this._isCancelled}},{key:"byteLength",get:function(){var t=this.content?this.content.byteLength:0;return Number.isFinite(t)||console.error("byteLength not defined in tile data"),t}},{key:"_loadData",value:function(){var r=I(Qf.default.mark(function n(i){var a,o,s,u,f,l,h,d,p,m,v,g,y,A;return Qf.default.wrap(function(b){for(;;)switch(b.prev=b.next){case 0:return a=i.getData,o=i.requestScheduler,s=i.onLoad,u=i.onError,f=this.index,l=this.id,h=this.bbox,d=this.userData,p=this.zoom,m=this._loaderId,this._abortController=new AbortController,v=this._abortController.signal,b.next=7,o.scheduleRequest(this,function(M){return M.isSelected?1:-1});case 7:if(g=b.sent,g){b.next=11;break}return this._isCancelled=!0,b.abrupt("return");case 11:if(!this._isCancelled){b.next=14;break}return g.done(),b.abrupt("return");case 14:return y=null,b.prev=15,b.next=18,a({index:f,id:l,bbox:h,userData:d,zoom:p,signal:v});case 18:y=b.sent,b.next=24;break;case 21:b.prev=21,b.t0=b.catch(15),A=b.t0||!0;case 24:return b.prev=24,g.done(),b.finish(24);case 27:if(m===this._loaderId){b.next=29;break}return b.abrupt("return");case 29:if(this._loader=void 0,this.content=y,!(this._isCancelled&&!y)){b.next=34;break}return this._isLoaded=!1,b.abrupt("return");case 34:this._isLoaded=!0,this._isCancelled=!1,A?u(A,this):s(this);case 37:case"end":return b.stop()}},n,this,[[15,21,24,27]])}));function t(n){return r.apply(this,arguments)}return t}()},{key:"loadData",value:function(t){return this._isLoaded=!1,this._isCancelled=!1,this._needsReload=!1,this._loaderId++,this._loader=this._loadData(t),this._loader}},{key:"setNeedsReload",value:function(){this.isLoading&&(this.abort(),this._loader=void 0),this._needsReload=!0}},{key:"abort",value:function(){var t;this.isLoaded||(this._isCancelled=!0,(t=this._abortController)===null||t===void 0||t.abort())}}]),e}();ue();ue();q();Y();N();var Qi=X(xt());var De={OUTSIDE:-1,INTERSECTING:0,INSIDE:1};q();Y();N();var Zv=new E,aw=new E,Bo=function(){function e(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[0,0,0],t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[0,0,0],n=arguments.length>2?arguments[2]:void 0;T(this,e),c(this,"center",void 0),c(this,"halfDiagonal",void 0),c(this,"minimum",void 0),c(this,"maximum",void 0),n=n||Zv.copy(r).add(t).scale(.5),this.center=new E(n),this.halfDiagonal=new E(t).subtract(this.center),this.minimum=new E(r),this.maximum=new E(t)}return w(e,[{key:"clone",value:function(){return new e(this.minimum,this.maximum,this.center)}},{key:"equals",value:function(t){return this===t||Boolean(t)&&this.minimum.equals(t.minimum)&&this.maximum.equals(t.maximum)}},{key:"transform",value:function(t){return this.center.transformAsPoint(t),this.halfDiagonal.transform(t),this.minimum.transform(t),this.maximum.transform(t),this}},{key:"intersectPlane",value:function(t){var n=this.halfDiagonal,i=aw.from(t.normal),a=n.x*Math.abs(i.x)+n.y*Math.abs(i.y)+n.z*Math.abs(i.z),o=this.center.dot(i)+t.distance;return o-a>0?De.INSIDE:o+a<0?De.OUTSIDE:De.INTERSECTING}},{key:"distanceTo",value:function(t){return Math.sqrt(this.distanceSquaredTo(t))}},{key:"distanceSquaredTo",value:function(t){var n=Zv.from(t).subtract(this.center),i=this.halfDiagonal,a=0,o;return o=Math.abs(n.x)-i.x,o>0&&(a+=o*o),o=Math.abs(n.y)-i.y,o>0&&(a+=o*o),o=Math.abs(n.z)-i.z,o>0&&(a+=o*o),a}}]),e}();q();Y();N();var Zi=new E,$v=new E,Tr=function(){function e(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[0,0,0],t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;T(this,e),c(this,"center",void 0),c(this,"radius",void 0),this.radius=-0,this.center=new E,this.fromCenterRadius(r,t)}return w(e,[{key:"fromCenterRadius",value:function(t,n){return this.center.from(t),this.radius=n,this}},{key:"fromCornerPoints",value:function(t,n){return n=Zi.from(n),this.center=new E().from(t).add(n).scale(.5),this.radius=this.center.distance(n),this}},{key:"equals",value:function(t){return this===t||Boolean(t)&&this.center.equals(t.center)&&this.radius===t.radius}},{key:"clone",value:function(){return new e(this.center,this.radius)}},{key:"union",value:function(t){var n=this.center,i=this.radius,a=t.center,o=t.radius,s=Zi.copy(a).subtract(n),u=s.magnitude();if(i>=u+o)return this.clone();if(o>=u+i)return t.clone();var f=(i+u+o)*.5;return $v.copy(s).scale((-i+f)/u).add(n),this.center.copy($v),this.radius=f,this}},{key:"expand",value:function(t){var n=Zi.from(t),i=n.subtract(this.center).magnitude();return i>this.radius&&(this.radius=i),this}},{key:"transform",value:function(t){this.center.transform(t);var n=Lm(Zi,t);return this.radius=Math.max(n[0],Math.max(n[1],n[2]))*this.radius,this}},{key:"distanceSquaredTo",value:function(t){var n=this.distanceTo(t);return n*n}},{key:"distanceTo",value:function(t){var n=Zi.from(t),i=n.subtract(this.center);return Math.max(0,i.len()-this.radius)}},{key:"intersectPlane",value:function(t){var n=this.center,i=this.radius,a=t.normal,o=a.dot(n)+t.distance;return o<-i?De.OUTSIDE:o<i?De.INTERSECTING:De.INSIDE}}]),e}();q();Y();N();var ow=new E,sw=new E,Mo=new E,Oo=new E,Po=new E,uw=new E,fw=new E,$t={COLUMN0ROW0:0,COLUMN0ROW1:1,COLUMN0ROW2:2,COLUMN1ROW0:3,COLUMN1ROW1:4,COLUMN1ROW2:5,COLUMN2ROW0:6,COLUMN2ROW1:7,COLUMN2ROW2:8},rn=function(){function e(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[0,0,0],t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[0,0,0,0,0,0,0,0,0];T(this,e),c(this,"center",void 0),c(this,"halfAxes",void 0),this.center=new E().from(r),this.halfAxes=new _e(t)}return w(e,[{key:"halfSize",get:function(){var t=this.halfAxes.getColumn(0),n=this.halfAxes.getColumn(1),i=this.halfAxes.getColumn(2);return[new E(t).len(),new E(n).len(),new E(i).len()]}},{key:"quaternion",get:function(){var t=this.halfAxes.getColumn(0),n=this.halfAxes.getColumn(1),i=this.halfAxes.getColumn(2),a=new E(t).normalize(),o=new E(n).normalize(),s=new E(i).normalize();return new br().fromMatrix3(new _e([].concat(K(a),K(o),K(s))))}},{key:"fromCenterHalfSizeQuaternion",value:function(t,n,i){var a=new br(i),o=new _e().fromQuaternion(a);return o[0]=o[0]*n[0],o[1]=o[1]*n[0],o[2]=o[2]*n[0],o[3]=o[3]*n[1],o[4]=o[4]*n[1],o[5]=o[5]*n[1],o[6]=o[6]*n[2],o[7]=o[7]*n[2],o[8]=o[8]*n[2],this.center=new E().from(t),this.halfAxes=o,this}},{key:"clone",value:function(){return new e(this.center,this.halfAxes)}},{key:"equals",value:function(t){return this===t||Boolean(t)&&this.center.equals(t.center)&&this.halfAxes.equals(t.halfAxes)}},{key:"getBoundingSphere",value:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:new Tr,n=this.halfAxes,i=n.getColumn(0,Mo),a=n.getColumn(1,Oo),o=n.getColumn(2,Po),s=ow.copy(i).add(a).add(o);return t.center.copy(this.center),t.radius=s.magnitude(),t}},{key:"intersectPlane",value:function(t){var n=this.center,i=t.normal,a=this.halfAxes,o=i.x,s=i.y,u=i.z,f=Math.abs(o*a[$t.COLUMN0ROW0]+s*a[$t.COLUMN0ROW1]+u*a[$t.COLUMN0ROW2])+Math.abs(o*a[$t.COLUMN1ROW0]+s*a[$t.COLUMN1ROW1]+u*a[$t.COLUMN1ROW2])+Math.abs(o*a[$t.COLUMN2ROW0]+s*a[$t.COLUMN2ROW1]+u*a[$t.COLUMN2ROW2]),l=i.dot(n)+t.distance;return l<=-f?De.OUTSIDE:l>=f?De.INSIDE:De.INTERSECTING}},{key:"distanceTo",value:function(t){return Math.sqrt(this.distanceSquaredTo(t))}},{key:"distanceSquaredTo",value:function(t){var n=sw.from(t).subtract(this.center),i=this.halfAxes,a=i.getColumn(0,Mo),o=i.getColumn(1,Oo),s=i.getColumn(2,Po),u=a.magnitude(),f=o.magnitude(),l=s.magnitude();a.normalize(),o.normalize(),s.normalize();var h=0,d;return d=Math.abs(n.dot(a))-u,d>0&&(h+=d*d),d=Math.abs(n.dot(o))-f,d>0&&(h+=d*d),d=Math.abs(n.dot(s))-l,d>0&&(h+=d*d),h}},{key:"computePlaneDistances",value:function(t,n){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[-0,-0],a=Number.POSITIVE_INFINITY,o=Number.NEGATIVE_INFINITY,s=this.center,u=this.halfAxes,f=u.getColumn(0,Mo),l=u.getColumn(1,Oo),h=u.getColumn(2,Po),d=uw.copy(f).add(l).add(h).add(s),p=fw.copy(d).subtract(t),m=n.dot(p);return a=Math.min(m,a),o=Math.max(m,o),d.copy(s).add(f).add(l).subtract(h),p.copy(d).subtract(t),m=n.dot(p),a=Math.min(m,a),o=Math.max(m,o),d.copy(s).add(f).subtract(l).add(h),p.copy(d).subtract(t),m=n.dot(p),a=Math.min(m,a),o=Math.max(m,o),d.copy(s).add(f).subtract(l).subtract(h),p.copy(d).subtract(t),m=n.dot(p),a=Math.min(m,a),o=Math.max(m,o),s.copy(d).subtract(f).add(l).add(h),p.copy(d).subtract(t),m=n.dot(p),a=Math.min(m,a),o=Math.max(m,o),s.copy(d).subtract(f).add(l).subtract(h),p.copy(d).subtract(t),m=n.dot(p),a=Math.min(m,a),o=Math.max(m,o),s.copy(d).subtract(f).subtract(l).add(h),p.copy(d).subtract(t),m=n.dot(p),a=Math.min(m,a),o=Math.max(m,o),s.copy(d).subtract(f).subtract(l).subtract(h),p.copy(d).subtract(t),m=n.dot(p),a=Math.min(m,a),o=Math.max(m,o),i[0]=a,i[1]=o,i}},{key:"transform",value:function(t){this.center.transformAsPoint(t);var n=this.halfAxes.getColumn(0,Mo);n.transformAsPoint(t);var i=this.halfAxes.getColumn(1,Oo);i.transformAsPoint(t);var a=this.halfAxes.getColumn(2,Po);return a.transformAsPoint(t),this.halfAxes=new _e([].concat(K(n),K(i),K(a))),this}},{key:"getTransform",value:function(){throw new Error("not implemented")}}]),e}();q();Y();N();q();Y();N();var Qv=new E,eg=new E,Ge=function(){function e(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[0,0,1],t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;T(this,e),c(this,"normal",void 0),c(this,"distance",void 0),this.normal=new E,this.distance=-0,this.fromNormalDistance(r,t)}return w(e,[{key:"fromNormalDistance",value:function(t,n){return de(Number.isFinite(n)),this.normal.from(t).normalize(),this.distance=n,this}},{key:"fromPointNormal",value:function(t,n){t=Qv.from(t),this.normal.from(n).normalize();var i=-this.normal.dot(t);return this.distance=i,this}},{key:"fromCoefficients",value:function(t,n,i,a){return this.normal.set(t,n,i),de(He(this.normal.len(),1)),this.distance=a,this}},{key:"clone",value:function(){return new e(this.normal,this.distance)}},{key:"equals",value:function(t){return He(this.distance,t.distance)&&He(this.normal,t.normal)}},{key:"getPointDistance",value:function(t){return this.normal.dot(t)+this.distance}},{key:"transform",value:function(t){var n=eg.copy(this.normal).transformAsVector(t).normalize(),i=this.normal.scale(-this.distance).transform(t);return this.fromPointNormal(i,n)}},{key:"projectPointOntoPlane",value:function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[0,0,0];t=Qv.from(t);var i=this.getPointDistance(t),a=eg.copy(this.normal).scale(i);return t.subtract(a).to(n)}}]),e}();function tg(e,r){var t=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=lw(e))||r&&e&&typeof e.length=="number"){t&&(e=t);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(f){throw f},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
19
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){t=t.call(e)},n:function(){var f=t.next();return a=f.done,f},e:function(f){o=!0,s=f},f:function(){try{!a&&t.return!=null&&t.return()}finally{if(o)throw s}}}}function lw(e,r){if(e){if(typeof e=="string")return rg(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);if(t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set")return Array.from(e);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return rg(e,r)}}function rg(e,r){(r==null||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}var ng=[new E([1,0,0]),new E([0,1,0]),new E([0,0,1])],ig=new E,cw=new E,m4=new Ge(new E(1,0,0),0),ot=function(){function e(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];T(this,e),c(this,"planes",void 0),this.planes=r}return w(e,[{key:"fromBoundingSphere",value:function(t){this.planes.length=2*ng.length;var n=t.center,i=t.radius,a=0,o=tg(ng),s;try{for(o.s();!(s=o.n()).done;){var u=s.value,f=this.planes[a],l=this.planes[a+1];f||(f=this.planes[a]=new Ge),l||(l=this.planes[a+1]=new Ge);var h=ig.copy(u).scale(-i).add(n),d=-u.dot(h);f.fromPointNormal(h,u);var p=ig.copy(u).scale(i).add(n),m=cw.copy(u).negate(),v=-m.dot(p);l.fromPointNormal(p,m),a+=2}}catch(g){o.e(g)}finally{o.f()}return this}},{key:"computeVisibility",value:function(t){var n=De.INSIDE,i=tg(this.planes),a;try{for(i.s();!(a=i.n()).done;){var o=a.value,s=t.intersectPlane(o);switch(s){case De.OUTSIDE:return De.OUTSIDE;case De.INTERSECTING:n=De.INTERSECTING;break;default:}}}catch(u){i.e(u)}finally{i.f()}return n}},{key:"computeVisibilityWithPlaneMask",value:function(t,n){if(de(Number.isFinite(n),"parentPlaneMask is required."),n===e.MASK_OUTSIDE||n===e.MASK_INSIDE)return n;for(var i=e.MASK_INSIDE,a=this.planes,o=0;o<this.planes.length;++o){var s=o<31?1<<o:0;if(!(o<31&&!(n&s))){var u=a[o],f=t.intersectPlane(u);if(f===De.OUTSIDE)return e.MASK_OUTSIDE;f===De.INTERSECTING&&(i|=s)}}return i}}]),e}();c(ot,"MASK_OUTSIDE",4294967295);c(ot,"MASK_INSIDE",0);c(ot,"MASK_INDETERMINATE",2147483647);q();Y();N();var hw=new E,dw=new E,pw=new E,mw=new E,vw=new E,el=function(){function e(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};T(this,e),c(this,"left",void 0),c(this,"_left",void 0),c(this,"right",void 0),c(this,"_right",void 0),c(this,"top",void 0),c(this,"_top",void 0),c(this,"bottom",void 0),c(this,"_bottom",void 0),c(this,"near",void 0),c(this,"_near",void 0),c(this,"far",void 0),c(this,"_far",void 0),c(this,"_cullingVolume",new ot([new Ge,new Ge,new Ge,new Ge,new Ge,new Ge])),c(this,"_perspectiveMatrix",new se),c(this,"_infinitePerspective",new se);var t=r.near,n=t===void 0?1:t,i=r.far,a=i===void 0?5e8:i;this.left=r.left,this._left=void 0,this.right=r.right,this._right=void 0,this.top=r.top,this._top=void 0,this.bottom=r.bottom,this._bottom=void 0,this.near=n,this._near=n,this.far=a,this._far=a}return w(e,[{key:"clone",value:function(){return new e({right:this.right,left:this.left,top:this.top,bottom:this.bottom,near:this.near,far:this.far})}},{key:"equals",value:function(t){return t&&t instanceof e&&this.right===t.right&&this.left===t.left&&this.top===t.top&&this.bottom===t.bottom&&this.near===t.near&&this.far===t.far}},{key:"projectionMatrix",get:function(){return this._update(),this._perspectiveMatrix}},{key:"infiniteProjectionMatrix",get:function(){return this._update(),this._infinitePerspective}},{key:"computeCullingVolume",value:function(t,n,i){de(t,"position is required."),de(n,"direction is required."),de(i,"up is required.");var a=this._cullingVolume.planes;i=hw.copy(i).normalize();var o=dw.copy(n).cross(i).normalize(),s=pw.copy(n).multiplyByScalar(this.near).add(t),u=mw.copy(n).multiplyByScalar(this.far).add(t),f=vw;return f.copy(o).multiplyByScalar(this.left).add(s).subtract(t).cross(i),a[0].fromPointNormal(t,f),f.copy(o).multiplyByScalar(this.right).add(s).subtract(t).cross(i).negate(),a[1].fromPointNormal(t,f),f.copy(i).multiplyByScalar(this.bottom).add(s).subtract(t).cross(o).negate(),a[2].fromPointNormal(t,f),f.copy(i).multiplyByScalar(this.top).add(s).subtract(t).cross(o),a[3].fromPointNormal(t,f),f=new E().copy(n),a[4].fromPointNormal(s,f),f.negate(),a[5].fromPointNormal(u,f),this._cullingVolume}},{key:"getPixelDimensions",value:function(t,n,i,a){this._update(),de(Number.isFinite(t)&&Number.isFinite(n)),de(t>0),de(n>0),de(i>0),de(a);var o=1/this.near,s=this.top*o,u=2*i*s/n;s=this.right*o;var f=2*i*s/t;return a.x=f,a.y=u,a}},{key:"_update",value:function(){de(Number.isFinite(this.right)&&Number.isFinite(this.left)&&Number.isFinite(this.top)&&Number.isFinite(this.bottom)&&Number.isFinite(this.near)&&Number.isFinite(this.far));var t=this.top,n=this.bottom,i=this.right,a=this.left,o=this.near,s=this.far;(t!==this._top||n!==this._bottom||a!==this._left||i!==this._right||o!==this._near||s!==this._far)&&(de(this.near>0&&this.near<this.far,"near must be greater than zero and less than far."),this._left=a,this._right=i,this._top=t,this._bottom=n,this._near=o,this._far=s,this._perspectiveMatrix=new se().frustum({left:a,right:i,bottom:n,top:t,near:o,far:s}),this._infinitePerspective=new se().frustum({left:a,right:i,bottom:n,top:t,near:o,far:1/0}))}}]),e}();q();Y();N();var gw=function(r){return r!==null&&typeof r<"u"},yw=function(){function e(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};T(this,e),c(this,"_offCenterFrustum",new el),c(this,"fov",void 0),c(this,"_fov",void 0),c(this,"_fovy",void 0),c(this,"_sseDenominator",void 0),c(this,"aspectRatio",void 0),c(this,"_aspectRatio",void 0),c(this,"near",void 0),c(this,"_near",void 0),c(this,"far",void 0),c(this,"_far",void 0),c(this,"xOffset",void 0),c(this,"_xOffset",void 0),c(this,"yOffset",void 0),c(this,"_yOffset",void 0);var t=r.fov,n=r.aspectRatio,i=r.near,a=i===void 0?1:i,o=r.far,s=o===void 0?5e8:o,u=r.xOffset,f=u===void 0?0:u,l=r.yOffset,h=l===void 0?0:l;this.fov=t,this.aspectRatio=n,this.near=a,this.far=s,this.xOffset=f,this.yOffset=h}return w(e,[{key:"clone",value:function(){return new e({aspectRatio:this.aspectRatio,fov:this.fov,near:this.near,far:this.far})}},{key:"equals",value:function(t){return!gw(t)||!(t instanceof e)?!1:(this._update(),t._update(),this.fov===t.fov&&this.aspectRatio===t.aspectRatio&&this.near===t.near&&this.far===t.far&&this._offCenterFrustum.equals(t._offCenterFrustum))}},{key:"projectionMatrix",get:function(){return this._update(),this._offCenterFrustum.projectionMatrix}},{key:"infiniteProjectionMatrix",get:function(){return this._update(),this._offCenterFrustum.infiniteProjectionMatrix}},{key:"fovy",get:function(){return this._update(),this._fovy}},{key:"sseDenominator",get:function(){return this._update(),this._sseDenominator}},{key:"computeCullingVolume",value:function(t,n,i){return this._update(),this._offCenterFrustum.computeCullingVolume(t,n,i)}},{key:"getPixelDimensions",value:function(t,n,i,a){return this._update(),this._offCenterFrustum.getPixelDimensions(t,n,i,a||new tn)}},{key:"_update",value:function(){de(Number.isFinite(this.fov)&&Number.isFinite(this.aspectRatio)&&Number.isFinite(this.near)&&Number.isFinite(this.far));var t=this._offCenterFrustum;(this.fov!==this._fov||this.aspectRatio!==this._aspectRatio||this.near!==this._near||this.far!==this._far||this.xOffset!==this._xOffset||this.yOffset!==this._yOffset)&&(de(this.fov>=0&&this.fov<Math.PI),de(this.aspectRatio>0),de(this.near>=0&&this.near<this.far),this._aspectRatio=this.aspectRatio,this._fov=this.fov,this._fovy=this.aspectRatio<=1?this.fov:Math.atan(Math.tan(this.fov*.5)/this.aspectRatio)*2,this._near=this.near,this._far=this.far,this._sseDenominator=2*Math.tan(.5*this._fovy),this._xOffset=this.xOffset,this._yOffset=this.yOffset,t.top=this.near*Math.tan(.5*this._fovy),t.bottom=-t.top,t.right=this.aspectRatio*t.top,t.left=-t.right,t.near=this.near,t.far=this.far,t.right+=this.xOffset,t.left+=this.xOffset,t.top+=this.yOffset,t.bottom+=this.yOffset)}}]),e}();var I4=new E,R4=new E,F4=new E,L4=new E,k4=new E,D4=new E,G4=new E,N4=new E,U4=new E,j4=new E,H4=new E,V4=new E,z4=4/3*Math.PI;var Ut=new
|
|
20
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){t=t.call(e)},n:function(){var f=t.next();return a=f.done,f},e:function(f){o=!0,s=f},f:function(){try{!a&&t.return!=null&&t.return()}finally{if(o)throw s}}}}function Ew(e,r){if(e){if(typeof e=="string")return og(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);if(t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set")return Array.from(e);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return og(e,r)}}function og(e,r){(r==null||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}var xr=new E,Sw=new E,ww=new E,Cw=new E,Bw=new E,Mw=new
|
|
18
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){t=t.call(e)},n:function(){var f=t.next();return a=f.done,f},e:function(f){o=!0,s=f},f:function(){try{!a&&t.return!=null&&t.return()}finally{if(o)throw s}}}}function jE(e,r){if(e){if(typeof e=="string")return xm(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);if(t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set")return Array.from(e);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return xm(e,r)}}function xm(e,r){(r==null||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}var HE=[zi,Wa,Vi];function yf(e){var r=e.type,t=r===void 0?"auto":r,n=t==="auto"?VE(e.url):t;switch(n){case"template":return new Vi(e);case"wms":return new zi(e);default:throw new Error("Not a valid image source type")}}function VE(e){var r=UE(HE),t;try{for(r.s();!(t=r.n()).done;){var n=t.value;if(n.testURL&&n.testURL(e))return n.type}}catch(i){r.e(i)}finally{r.f()}return"wms"}ue();q();Y();N();var Te=1e-6,Je=typeof Float32Array<"u"?Float32Array:Array;var TG=Math.PI/180;Math.hypot||(Math.hypot=function(){for(var e=0,r=arguments.length;r--;)e+=arguments[r]*arguments[r];return Math.sqrt(e)});function zE(){var e=new Je(4);return Je!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0,e[3]=0),e}function Em(e,r,t){return e[0]=r[0]+t[0],e[1]=r[1]+t[1],e[2]=r[2]+t[2],e[3]=r[3]+t[3],e}function Ja(e,r,t){return e[0]=r[0]*t,e[1]=r[1]*t,e[2]=r[2]*t,e[3]=r[3]*t,e}function Sm(e){var r=e[0],t=e[1],n=e[2],i=e[3];return Math.hypot(r,t,n,i)}function wm(e){var r=e[0],t=e[1],n=e[2],i=e[3];return r*r+t*t+n*n+i*i}function Cm(e,r){var t=r[0],n=r[1],i=r[2],a=r[3],o=t*t+n*n+i*i+a*a;return o>0&&(o=1/Math.sqrt(o)),e[0]=t*o,e[1]=n*o,e[2]=i*o,e[3]=a*o,e}function Bm(e,r){return e[0]*r[0]+e[1]*r[1]+e[2]*r[2]+e[3]*r[3]}function Mm(e,r,t,n){var i=r[0],a=r[1],o=r[2],s=r[3];return e[0]=i+n*(t[0]-i),e[1]=a+n*(t[1]-a),e[2]=o+n*(t[2]-o),e[3]=s+n*(t[3]-s),e}function Xa(e,r,t){var n=r[0],i=r[1],a=r[2],o=r[3];return e[0]=t[0]*n+t[4]*i+t[8]*a+t[12]*o,e[1]=t[1]*n+t[5]*i+t[9]*a+t[13]*o,e[2]=t[2]*n+t[6]*i+t[10]*a+t[14]*o,e[3]=t[3]*n+t[7]*i+t[11]*a+t[15]*o,e}function Om(e,r,t){var n=r[0],i=r[1],a=r[2],o=t[0],s=t[1],u=t[2],f=t[3],l=f*n+s*a-u*i,h=f*i+u*n-o*a,d=f*a+o*i-s*n,p=-o*n-s*i-u*a;return e[0]=l*f+p*-o+h*-u-d*-s,e[1]=h*f+p*-s+d*-o-l*-u,e[2]=d*f+p*-u+l*-s-h*-o,e[3]=r[3],e}var xG=function(){var e=zE();return function(r,t,n,i,a,o){var s,u;for(t||(t=4),n||(n=0),i?u=Math.min(i*t+n,r.length):u=r.length,s=n;s<u;s+=t)e[0]=r[s],e[1]=r[s+1],e[2]=r[s+2],e[3]=r[s+3],a(e,e,o),r[s]=e[0],r[s+1]=e[1],r[s+2]=e[2],r[s+3]=e[3];return r}}();function Nn(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}function gr(e,r){var t=Xa([],r,e);return Ja(t,t,1/t[3]),t}function Wi(e,r,t){return e<r?r:e>t?t:e}function WE(e){return Math.log(e)*Math.LOG2E}var qa=Math.log2||WE;ue();function JE(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function Pm(e,r){if(e===r){var t=r[1],n=r[2],i=r[3],a=r[6],o=r[7],s=r[11];e[1]=r[4],e[2]=r[8],e[3]=r[12],e[4]=t,e[6]=r[9],e[7]=r[13],e[8]=n,e[9]=a,e[11]=r[14],e[12]=i,e[13]=o,e[14]=s}else e[0]=r[0],e[1]=r[4],e[2]=r[8],e[3]=r[12],e[4]=r[1],e[5]=r[5],e[6]=r[9],e[7]=r[13],e[8]=r[2],e[9]=r[6],e[10]=r[10],e[11]=r[14],e[12]=r[3],e[13]=r[7],e[14]=r[11],e[15]=r[15];return e}function Ka(e,r){var t=r[0],n=r[1],i=r[2],a=r[3],o=r[4],s=r[5],u=r[6],f=r[7],l=r[8],h=r[9],d=r[10],p=r[11],m=r[12],v=r[13],g=r[14],y=r[15],A=t*s-n*o,x=t*u-i*o,b=t*f-a*o,M=n*u-i*s,C=n*f-a*s,F=i*f-a*u,B=l*v-h*m,S=l*g-d*m,_=l*y-p*m,R=h*g-d*v,k=h*y-p*v,U=d*y-p*g,j=A*U-x*k+b*R+M*_-C*S+F*B;return j?(j=1/j,e[0]=(s*U-u*k+f*R)*j,e[1]=(i*k-n*U-a*R)*j,e[2]=(v*F-g*C+y*M)*j,e[3]=(d*C-h*F-p*M)*j,e[4]=(u*_-o*U-f*S)*j,e[5]=(t*U-i*_+a*S)*j,e[6]=(g*b-m*F-y*x)*j,e[7]=(l*F-d*b+p*x)*j,e[8]=(o*k-s*_+f*B)*j,e[9]=(n*_-t*k-a*B)*j,e[10]=(m*C-v*b+y*A)*j,e[11]=(h*b-l*C-p*A)*j,e[12]=(s*S-o*R-u*B)*j,e[13]=(t*R-n*S+i*B)*j,e[14]=(v*x-m*M-g*A)*j,e[15]=(l*M-h*x+d*A)*j,e):null}function Im(e){var r=e[0],t=e[1],n=e[2],i=e[3],a=e[4],o=e[5],s=e[6],u=e[7],f=e[8],l=e[9],h=e[10],d=e[11],p=e[12],m=e[13],v=e[14],g=e[15],y=r*o-t*a,A=r*s-n*a,x=r*u-i*a,b=t*s-n*o,M=t*u-i*o,C=n*u-i*s,F=f*m-l*p,B=f*v-h*p,S=f*g-d*p,_=l*v-h*m,R=l*g-d*m,k=h*g-d*v;return y*k-A*R+x*_+b*S-M*B+C*F}function Zr(e,r,t){var n=r[0],i=r[1],a=r[2],o=r[3],s=r[4],u=r[5],f=r[6],l=r[7],h=r[8],d=r[9],p=r[10],m=r[11],v=r[12],g=r[13],y=r[14],A=r[15],x=t[0],b=t[1],M=t[2],C=t[3];return e[0]=x*n+b*s+M*h+C*v,e[1]=x*i+b*u+M*d+C*g,e[2]=x*a+b*f+M*p+C*y,e[3]=x*o+b*l+M*m+C*A,x=t[4],b=t[5],M=t[6],C=t[7],e[4]=x*n+b*s+M*h+C*v,e[5]=x*i+b*u+M*d+C*g,e[6]=x*a+b*f+M*p+C*y,e[7]=x*o+b*l+M*m+C*A,x=t[8],b=t[9],M=t[10],C=t[11],e[8]=x*n+b*s+M*h+C*v,e[9]=x*i+b*u+M*d+C*g,e[10]=x*a+b*f+M*p+C*y,e[11]=x*o+b*l+M*m+C*A,x=t[12],b=t[13],M=t[14],C=t[15],e[12]=x*n+b*s+M*h+C*v,e[13]=x*i+b*u+M*d+C*g,e[14]=x*a+b*f+M*p+C*y,e[15]=x*o+b*l+M*m+C*A,e}function $r(e,r,t){var n=t[0],i=t[1],a=t[2],o,s,u,f,l,h,d,p,m,v,g,y;return r===e?(e[12]=r[0]*n+r[4]*i+r[8]*a+r[12],e[13]=r[1]*n+r[5]*i+r[9]*a+r[13],e[14]=r[2]*n+r[6]*i+r[10]*a+r[14],e[15]=r[3]*n+r[7]*i+r[11]*a+r[15]):(o=r[0],s=r[1],u=r[2],f=r[3],l=r[4],h=r[5],d=r[6],p=r[7],m=r[8],v=r[9],g=r[10],y=r[11],e[0]=o,e[1]=s,e[2]=u,e[3]=f,e[4]=l,e[5]=h,e[6]=d,e[7]=p,e[8]=m,e[9]=v,e[10]=g,e[11]=y,e[12]=o*n+l*i+m*a+r[12],e[13]=s*n+h*i+v*a+r[13],e[14]=u*n+d*i+g*a+r[14],e[15]=f*n+p*i+y*a+r[15]),e}function Un(e,r,t){var n=t[0],i=t[1],a=t[2];return e[0]=r[0]*n,e[1]=r[1]*n,e[2]=r[2]*n,e[3]=r[3]*n,e[4]=r[4]*i,e[5]=r[5]*i,e[6]=r[6]*i,e[7]=r[7]*i,e[8]=r[8]*a,e[9]=r[9]*a,e[10]=r[10]*a,e[11]=r[11]*a,e[12]=r[12],e[13]=r[13],e[14]=r[14],e[15]=r[15],e}function Rm(e,r,t,n){var i=n[0],a=n[1],o=n[2],s=Math.hypot(i,a,o),u,f,l,h,d,p,m,v,g,y,A,x,b,M,C,F,B,S,_,R,k,U,j,Z;return s<Te?null:(s=1/s,i*=s,a*=s,o*=s,u=Math.sin(t),f=Math.cos(t),l=1-f,h=r[0],d=r[1],p=r[2],m=r[3],v=r[4],g=r[5],y=r[6],A=r[7],x=r[8],b=r[9],M=r[10],C=r[11],F=i*i*l+f,B=a*i*l+o*u,S=o*i*l-a*u,_=i*a*l-o*u,R=a*a*l+f,k=o*a*l+i*u,U=i*o*l+a*u,j=a*o*l-i*u,Z=o*o*l+f,e[0]=h*F+v*B+x*S,e[1]=d*F+g*B+b*S,e[2]=p*F+y*B+M*S,e[3]=m*F+A*B+C*S,e[4]=h*_+v*R+x*k,e[5]=d*_+g*R+b*k,e[6]=p*_+y*R+M*k,e[7]=m*_+A*R+C*k,e[8]=h*U+v*j+x*Z,e[9]=d*U+g*j+b*Z,e[10]=p*U+y*j+M*Z,e[11]=m*U+A*j+C*Z,r!==e&&(e[12]=r[12],e[13]=r[13],e[14]=r[14],e[15]=r[15]),e)}function Ya(e,r,t){var n=Math.sin(t),i=Math.cos(t),a=r[4],o=r[5],s=r[6],u=r[7],f=r[8],l=r[9],h=r[10],d=r[11];return r!==e&&(e[0]=r[0],e[1]=r[1],e[2]=r[2],e[3]=r[3],e[12]=r[12],e[13]=r[13],e[14]=r[14],e[15]=r[15]),e[4]=a*i+f*n,e[5]=o*i+l*n,e[6]=s*i+h*n,e[7]=u*i+d*n,e[8]=f*i-a*n,e[9]=l*i-o*n,e[10]=h*i-s*n,e[11]=d*i-u*n,e}function Fm(e,r,t){var n=Math.sin(t),i=Math.cos(t),a=r[0],o=r[1],s=r[2],u=r[3],f=r[8],l=r[9],h=r[10],d=r[11];return r!==e&&(e[4]=r[4],e[5]=r[5],e[6]=r[6],e[7]=r[7],e[12]=r[12],e[13]=r[13],e[14]=r[14],e[15]=r[15]),e[0]=a*i-f*n,e[1]=o*i-l*n,e[2]=s*i-h*n,e[3]=u*i-d*n,e[8]=a*n+f*i,e[9]=o*n+l*i,e[10]=s*n+h*i,e[11]=u*n+d*i,e}function Za(e,r,t){var n=Math.sin(t),i=Math.cos(t),a=r[0],o=r[1],s=r[2],u=r[3],f=r[4],l=r[5],h=r[6],d=r[7];return r!==e&&(e[8]=r[8],e[9]=r[9],e[10]=r[10],e[11]=r[11],e[12]=r[12],e[13]=r[13],e[14]=r[14],e[15]=r[15]),e[0]=a*i+f*n,e[1]=o*i+l*n,e[2]=s*i+h*n,e[3]=u*i+d*n,e[4]=f*i-a*n,e[5]=l*i-o*n,e[6]=h*i-s*n,e[7]=d*i-u*n,e}function Lm(e,r){var t=r[0],n=r[1],i=r[2],a=r[4],o=r[5],s=r[6],u=r[8],f=r[9],l=r[10];return e[0]=Math.hypot(t,n,i),e[1]=Math.hypot(a,o,s),e[2]=Math.hypot(u,f,l),e}function km(e,r){var t=r[0],n=r[1],i=r[2],a=r[3],o=t+t,s=n+n,u=i+i,f=t*o,l=n*o,h=n*s,d=i*o,p=i*s,m=i*u,v=a*o,g=a*s,y=a*u;return e[0]=1-h-m,e[1]=l+y,e[2]=d-g,e[3]=0,e[4]=l-y,e[5]=1-f-m,e[6]=p+v,e[7]=0,e[8]=d+g,e[9]=p-v,e[10]=1-f-h,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function Dm(e,r,t,n,i,a,o){var s=1/(t-r),u=1/(i-n),f=1/(a-o);return e[0]=a*2*s,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a*2*u,e[6]=0,e[7]=0,e[8]=(t+r)*s,e[9]=(i+n)*u,e[10]=(o+a)*f,e[11]=-1,e[12]=0,e[13]=0,e[14]=o*a*2*f,e[15]=0,e}function XE(e,r,t,n,i){var a=1/Math.tan(r/2),o;return e[0]=a/t,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,i!=null&&i!==1/0?(o=1/(n-i),e[10]=(i+n)*o,e[14]=2*i*n*o):(e[10]=-1,e[14]=-2*n),e}var $a=XE;function qE(e,r,t,n,i,a,o){var s=1/(r-t),u=1/(n-i),f=1/(a-o);return e[0]=-2*s,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*u,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*f,e[11]=0,e[12]=(r+t)*s,e[13]=(i+n)*u,e[14]=(o+a)*f,e[15]=1,e}var Gm=qE;function Nm(e,r,t,n){var i,a,o,s,u,f,l,h,d,p,m=r[0],v=r[1],g=r[2],y=n[0],A=n[1],x=n[2],b=t[0],M=t[1],C=t[2];return Math.abs(m-b)<Te&&Math.abs(v-M)<Te&&Math.abs(g-C)<Te?JE(e):(l=m-b,h=v-M,d=g-C,p=1/Math.hypot(l,h,d),l*=p,h*=p,d*=p,i=A*d-x*h,a=x*l-y*d,o=y*h-A*l,p=Math.hypot(i,a,o),p?(p=1/p,i*=p,a*=p,o*=p):(i=0,a=0,o=0),s=h*o-d*a,u=d*i-l*o,f=l*a-h*i,p=Math.hypot(s,u,f),p?(p=1/p,s*=p,u*=p,f*=p):(s=0,u=0,f=0),e[0]=i,e[1]=s,e[2]=l,e[3]=0,e[4]=a,e[5]=u,e[6]=h,e[7]=0,e[8]=o,e[9]=f,e[10]=d,e[11]=0,e[12]=-(i*m+a*v+o*g),e[13]=-(s*m+u*v+f*g),e[14]=-(l*m+h*v+d*g),e[15]=1,e)}function bf(e,r){var t=e[0],n=e[1],i=e[2],a=e[3],o=e[4],s=e[5],u=e[6],f=e[7],l=e[8],h=e[9],d=e[10],p=e[11],m=e[12],v=e[13],g=e[14],y=e[15],A=r[0],x=r[1],b=r[2],M=r[3],C=r[4],F=r[5],B=r[6],S=r[7],_=r[8],R=r[9],k=r[10],U=r[11],j=r[12],Z=r[13],P=r[14],O=r[15];return Math.abs(t-A)<=Te*Math.max(1,Math.abs(t),Math.abs(A))&&Math.abs(n-x)<=Te*Math.max(1,Math.abs(n),Math.abs(x))&&Math.abs(i-b)<=Te*Math.max(1,Math.abs(i),Math.abs(b))&&Math.abs(a-M)<=Te*Math.max(1,Math.abs(a),Math.abs(M))&&Math.abs(o-C)<=Te*Math.max(1,Math.abs(o),Math.abs(C))&&Math.abs(s-F)<=Te*Math.max(1,Math.abs(s),Math.abs(F))&&Math.abs(u-B)<=Te*Math.max(1,Math.abs(u),Math.abs(B))&&Math.abs(f-S)<=Te*Math.max(1,Math.abs(f),Math.abs(S))&&Math.abs(l-_)<=Te*Math.max(1,Math.abs(l),Math.abs(_))&&Math.abs(h-R)<=Te*Math.max(1,Math.abs(h),Math.abs(R))&&Math.abs(d-k)<=Te*Math.max(1,Math.abs(d),Math.abs(k))&&Math.abs(p-U)<=Te*Math.max(1,Math.abs(p),Math.abs(U))&&Math.abs(m-j)<=Te*Math.max(1,Math.abs(m),Math.abs(j))&&Math.abs(v-Z)<=Te*Math.max(1,Math.abs(v),Math.abs(Z))&&Math.abs(g-P)<=Te*Math.max(1,Math.abs(g),Math.abs(P))&&Math.abs(y-O)<=Te*Math.max(1,Math.abs(y),Math.abs(O))}function KE(){var e=new Je(2);return Je!=Float32Array&&(e[0]=0,e[1]=0),e}function Tf(e,r,t){return e[0]=r[0]+t[0],e[1]=r[1]+t[1],e}function Um(e,r){return e[0]=-r[0],e[1]=-r[1],e}function eo(e,r,t,n){var i=r[0],a=r[1];return e[0]=i+n*(t[0]-i),e[1]=a+n*(t[1]-a),e}function jm(e,r,t){var n=r[0],i=r[1];return e[0]=t[0]*n+t[2]*i,e[1]=t[1]*n+t[3]*i,e}function Hm(e,r,t){var n=r[0],i=r[1];return e[0]=t[0]*n+t[2]*i+t[4],e[1]=t[1]*n+t[3]*i+t[5],e}function to(e,r,t){var n=r[0],i=r[1];return e[0]=t[0]*n+t[3]*i+t[6],e[1]=t[1]*n+t[4]*i+t[7],e}function ro(e,r,t){var n=r[0],i=r[1];return e[0]=t[0]*n+t[4]*i+t[12],e[1]=t[1]*n+t[5]*i+t[13],e}var wG=function(){var e=KE();return function(r,t,n,i,a,o){var s,u;for(t||(t=2),n||(n=0),i?u=Math.min(i*t+n,r.length):u=r.length,s=n;s<u;s+=t)e[0]=r[s],e[1]=r[s+1],a(e,e,o),r[s]=e[0],r[s+1]=e[1];return r}}();function xf(){var e=new Je(3);return Je!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e}function Ef(e){var r=e[0],t=e[1],n=e[2];return Math.hypot(r,t,n)}function Sf(e,r,t){var n=new Je(3);return n[0]=e,n[1]=r,n[2]=t,n}function Vm(e,r,t){return e[0]=r[0]+t[0],e[1]=r[1]+t[1],e[2]=r[2]+t[2],e}function YE(e,r,t){return e[0]=r[0]*t[0],e[1]=r[1]*t[1],e[2]=r[2]*t[2],e}function zm(e,r){return e[0]=-r[0],e[1]=-r[1],e[2]=-r[2],e}function Wm(e,r){var t=r[0],n=r[1],i=r[2],a=t*t+n*n+i*i;return a>0&&(a=1/Math.sqrt(a)),e[0]=r[0]*a,e[1]=r[1]*a,e[2]=r[2]*a,e}function Ji(e,r){return e[0]*r[0]+e[1]*r[1]+e[2]*r[2]}function Hn(e,r,t){var n=r[0],i=r[1],a=r[2],o=t[0],s=t[1],u=t[2];return e[0]=i*u-a*s,e[1]=a*o-n*u,e[2]=n*s-i*o,e}function Vn(e,r,t){var n=r[0],i=r[1],a=r[2],o=t[3]*n+t[7]*i+t[11]*a+t[15];return o=o||1,e[0]=(t[0]*n+t[4]*i+t[8]*a+t[12])/o,e[1]=(t[1]*n+t[5]*i+t[9]*a+t[13])/o,e[2]=(t[2]*n+t[6]*i+t[10]*a+t[14])/o,e}function no(e,r,t){var n=r[0],i=r[1],a=r[2];return e[0]=n*t[0]+i*t[3]+a*t[6],e[1]=n*t[1]+i*t[4]+a*t[7],e[2]=n*t[2]+i*t[5]+a*t[8],e}function io(e,r,t){var n=t[0],i=t[1],a=t[2],o=t[3],s=r[0],u=r[1],f=r[2],l=i*f-a*u,h=a*s-n*f,d=n*u-i*s,p=i*d-a*h,m=a*l-n*d,v=n*h-i*l,g=o*2;return l*=g,h*=g,d*=g,p*=2,m*=2,v*=2,e[0]=s+l+p,e[1]=u+h+m,e[2]=f+d+v,e}function Jm(e,r,t,n){var i=[],a=[];return i[0]=r[0]-t[0],i[1]=r[1]-t[1],i[2]=r[2]-t[2],a[0]=i[0],a[1]=i[1]*Math.cos(n)-i[2]*Math.sin(n),a[2]=i[1]*Math.sin(n)+i[2]*Math.cos(n),e[0]=a[0]+t[0],e[1]=a[1]+t[1],e[2]=a[2]+t[2],e}function Xm(e,r,t,n){var i=[],a=[];return i[0]=r[0]-t[0],i[1]=r[1]-t[1],i[2]=r[2]-t[2],a[0]=i[2]*Math.sin(n)+i[0]*Math.cos(n),a[1]=i[1],a[2]=i[2]*Math.cos(n)-i[0]*Math.sin(n),e[0]=a[0]+t[0],e[1]=a[1]+t[1],e[2]=a[2]+t[2],e}function qm(e,r,t,n){var i=[],a=[];return i[0]=r[0]-t[0],i[1]=r[1]-t[1],i[2]=r[2]-t[2],a[0]=i[0]*Math.cos(n)-i[1]*Math.sin(n),a[1]=i[0]*Math.sin(n)+i[1]*Math.cos(n),a[2]=i[2],e[0]=a[0]+t[0],e[1]=a[1]+t[1],e[2]=a[2]+t[2],e}function Km(e,r){var t=e[0],n=e[1],i=e[2],a=r[0],o=r[1],s=r[2],u=Math.sqrt(t*t+n*n+i*i),f=Math.sqrt(a*a+o*o+s*s),l=u*f,h=l&&Ji(e,r)/l;return Math.acos(Math.min(Math.max(h,-1),1))}var Ym=YE;var Zm=Ef;var CG=function(){var e=xf();return function(r,t,n,i,a,o){var s,u;for(t||(t=3),n||(n=0),i?u=Math.min(i*t+n,r.length):u=r.length,s=n;s<u;s+=t)e[0]=r[s],e[1]=r[s+1],e[2]=r[s+2],a(e,e,o),r[s]=e[0],r[s+1]=e[1],r[s+2]=e[2];return r}}();function Et(e,r){if(!e)throw new Error(r||"@math.gl/web-mercator: assertion failed.")}var St=Math.PI,Qm=St/4,Gt=St/180,wf=180/St,Xi=512,$m=4003e4,Wn=85.051129,Cf=1.5;function ao(e){return Math.pow(2,e)}function $e(e){var r=D(e,2),t=r[0],n=r[1];Et(Number.isFinite(t)),Et(Number.isFinite(n)&&n>=-90&&n<=90,"invalid latitude");var i=t*Gt,a=n*Gt,o=Xi*(i+St)/(2*St),s=Xi*(St+Math.log(Math.tan(Qm+a*.5)))/(2*St);return[o,s]}function at(e){var r=D(e,2),t=r[0],n=r[1],i=t/Xi*(2*St)-St,a=2*(Math.atan(Math.exp(n/Xi*(2*St)-St))-Qm);return[i*wf,a*wf]}function Bf(e){var r=e.latitude,t=e.longitude,n=e.highPrecision,i=n===void 0?!1:n;Et(Number.isFinite(r)&&Number.isFinite(t));var a=Xi,o=Math.cos(r*Gt),s=a/360,u=s/o,f=a/$m/o,l={unitsPerMeter:[f,f,f],metersPerUnit:[1/f,1/f,1/f],unitsPerDegree:[s,u,f],degreesPerUnit:[1/s,1/u,1/f]};if(i){var h=Gt*Math.tan(r*Gt)/o,d=s*h/2,p=a/$m*h,m=p/u*f;l.unitsPerDegree2=[0,d,p],l.unitsPerMeter2=[m,0,m]}return l}function Mf(e){var r=e.height,t=e.pitch,n=e.bearing,i=e.altitude,a=e.scale,o=e.center,s=Nn();$r(s,s,[0,0,-i]),Ya(s,s,-t*Gt),Za(s,s,n*Gt);var u=a/r;return Un(s,s,[u,u,u]),o&&$r(s,s,zm([],o)),s}function ev(e){var r=e.width,t=e.height,n=e.altitude,i=e.pitch,a=i===void 0?0:i,o=e.offset,s=e.center,u=e.scale,f=e.nearZMultiplier,l=f===void 0?1:f,h=e.farZMultiplier,d=h===void 0?1:h,p=e.fovy,m=p===void 0?zn(Cf):p;n!==void 0&&(m=zn(n));var v=m*Gt,g=a*Gt,y=oo(m),A=y;s&&(A+=s[2]*u/Math.cos(g)/t);var x=v*(.5+(o?o[1]:0)/t),b=Math.sin(x)*A/Math.sin(Wi(Math.PI/2-g-x,.01,Math.PI-.01)),M=Math.sin(g)*b+A,C=A*10,F=Math.min(M*d,C);return{fov:v,aspect:r/t,focalDistance:y,near:l,far:F}}function Of(e){var r=ev(e),t=r.fov,n=r.aspect,i=r.near,a=r.far,o=$a([],t,n,i,a);return o}function zn(e){return 2*Math.atan(.5/e)*wf}function oo(e){return .5/Math.tan(.5*e*Gt)}function Pf(e,r){var t=D(e,3),n=t[0],i=t[1],a=t[2],o=a===void 0?0:a;return Et(Number.isFinite(n)&&Number.isFinite(i)&&Number.isFinite(o)),gr(r,[n,i,o,1])}function so(e,r){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,n=D(e,3),i=n[0],a=n[1],o=n[2];if(Et(Number.isFinite(i)&&Number.isFinite(a),"invalid pixel coordinate"),Number.isFinite(o)){var s=gr(r,[i,a,o,1]);return s}var u=gr(r,[i,a,0,1]),f=gr(r,[i,a,1,1]),l=u[2],h=f[2],d=l===h?0:((t||0)-l)/(h-l);return eo([],u,f,d)}ue();function uo(e){var r=e.width,t=e.height,n=e.bounds,i=e.minExtent,a=i===void 0?0:i,o=e.maxZoom,s=o===void 0?24:o,u=e.offset,f=u===void 0?[0,0]:u,l=D(n,2),h=D(l[0],2),d=h[0],p=h[1],m=D(l[1],2),v=m[0],g=m[1],y=ZE(e.padding),A=$e([d,Wi(g,-Wn,Wn)]),x=$e([v,Wi(p,-Wn,Wn)]),b=[Math.max(Math.abs(x[0]-A[0]),a),Math.max(Math.abs(x[1]-A[1]),a)],M=[r-y.left-y.right-Math.abs(f[0])*2,t-y.top-y.bottom-Math.abs(f[1])*2];Et(M[0]>0&&M[1]>0);var C=M[0]/b[0],F=M[1]/b[1],B=(y.right-y.left)/2/C,S=(y.bottom-y.top)/2/F,_=[(x[0]+A[0])/2+B,(x[1]+A[1])/2+S],R=at(_),k=Math.min(s,qa(Math.abs(Math.min(C,F))));return Et(Number.isFinite(k)),{longitude:R[0],latitude:R[1],zoom:k}}function ZE(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return typeof e=="number"?{top:e,bottom:e,left:e,right:e}:(Et(Number.isFinite(e.top)&&Number.isFinite(e.bottom)&&Number.isFinite(e.left)&&Number.isFinite(e.right)),e)}var tv=Math.PI/180;function fo(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,t=e.width,n=e.height,i=e.unproject,a={targetZ:r},o=i([0,n],a),s=i([t,n],a),u,f,l=e.fovy?.5*e.fovy*tv:Math.atan(.5/e.altitude),h=(90-e.pitch)*tv;return l>h-.01?(u=rv(e,0,r),f=rv(e,t,r)):(u=i([0,0],a),f=i([t,0],a)),[o,s,f,u]}function rv(e,r,t){var n=e.pixelUnprojectionMatrix,i=gr(n,[r,0,1,1]),a=gr(n,[r,e.height,1,1]),o=t*e.distanceScales.unitsPerMeter[2],s=(o-i[2])/(a[2]-i[2]),u=eo([],i,a,s),f=at(u);return f.push(t),f}var nv=function(){function e(){var r=this,t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{width:1,height:1};T(this,e),c(this,"latitude",void 0),c(this,"longitude",void 0),c(this,"zoom",void 0),c(this,"pitch",void 0),c(this,"bearing",void 0),c(this,"altitude",void 0),c(this,"fovy",void 0),c(this,"meterOffset",void 0),c(this,"center",void 0),c(this,"width",void 0),c(this,"height",void 0),c(this,"scale",void 0),c(this,"distanceScales",void 0),c(this,"viewMatrix",void 0),c(this,"projectionMatrix",void 0),c(this,"viewProjectionMatrix",void 0),c(this,"pixelProjectionMatrix",void 0),c(this,"pixelUnprojectionMatrix",void 0),c(this,"equals",function(k){return k instanceof e?k.width===r.width&&k.height===r.height&&bf(k.projectionMatrix,r.projectionMatrix)&&bf(k.viewMatrix,r.viewMatrix):!1}),c(this,"project",function(k){var U=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},j=U.topLeft,Z=j===void 0?!0:j,P=r.projectPosition(k),O=Pf(P,r.pixelProjectionMatrix),G=D(O,2),J=G[0],V=G[1],ee=Z?V:r.height-V;return k.length===2?[J,ee]:[J,ee,O[2]]}),c(this,"unproject",function(k){var U=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},j=U.topLeft,Z=j===void 0?!0:j,P=U.targetZ,O=P===void 0?void 0:P,G=D(k,3),J=G[0],V=G[1],ee=G[2],ie=Z?V:r.height-V,we=O&&O*r.distanceScales.unitsPerMeter[2],Me=so([J,ie,ee],r.pixelUnprojectionMatrix,we),Re=r.unprojectPosition(Me),Xe=D(Re,3),nt=Xe[0],Fe=Xe[1],Rn=Xe[2];return Number.isFinite(ee)?[nt,Fe,Rn]:Number.isFinite(O)?[nt,Fe,O]:[nt,Fe]}),c(this,"projectPosition",function(k){var U=$e(k),j=D(U,2),Z=j[0],P=j[1],O=(k[2]||0)*r.distanceScales.unitsPerMeter[2];return[Z,P,O]}),c(this,"unprojectPosition",function(k){var U=at(k),j=D(U,2),Z=j[0],P=j[1],O=(k[2]||0)*r.distanceScales.metersPerUnit[2];return[Z,P,O]});var n=t.width,i=t.height,a=t.altitude,o=a===void 0?null:a,s=t.fovy,u=s===void 0?null:s,f=t.latitude,l=f===void 0?0:f,h=t.longitude,d=h===void 0?0:h,p=t.zoom,m=p===void 0?0:p,v=t.pitch,g=v===void 0?0:v,y=t.bearing,A=y===void 0?0:y,x=t.position,b=x===void 0?null:x,M=t.nearZMultiplier,C=M===void 0?.02:M,F=t.farZMultiplier,B=F===void 0?1.01:F;n=n||1,i=i||1,u===null&&o===null?(o=Cf,u=zn(o)):u===null?u=zn(o):o===null&&(o=oo(u));var S=ao(m);o=Math.max(.75,o);var _=Bf({longitude:d,latitude:l}),R=$e([d,l]);R.push(0),b&&Vm(R,R,Ym([],b,_.unitsPerMeter)),this.projectionMatrix=Of({width:n,height:i,scale:S,center:R,pitch:g,fovy:u,nearZMultiplier:C,farZMultiplier:B}),this.viewMatrix=Mf({height:i,scale:S,center:R,pitch:g,bearing:A,altitude:o}),this.width=n,this.height=i,this.scale=S,this.latitude=l,this.longitude=d,this.zoom=m,this.pitch=g,this.bearing=A,this.altitude=o,this.fovy=u,this.center=R,this.meterOffset=b||[0,0,0],this.distanceScales=_,this._initMatrices(),Object.freeze(this)}return w(e,[{key:"_initMatrices",value:function(){var t=this.width,n=this.height,i=this.projectionMatrix,a=this.viewMatrix,o=Nn();Zr(o,o,i),Zr(o,o,a),this.viewProjectionMatrix=o;var s=Nn();Un(s,s,[t/2,-n/2,1]),$r(s,s,[1,-1,0]),Zr(s,s,o);var u=Ka(Nn(),s);if(!u)throw new Error("Pixel project matrix not invertible");this.pixelProjectionMatrix=s,this.pixelUnprojectionMatrix=u}},{key:"projectFlat",value:function(t){return $e(t)}},{key:"unprojectFlat",value:function(t){return at(t)}},{key:"getMapCenterByLngLatPosition",value:function(t){var n=t.lngLat,i=t.pos,a=so(i,this.pixelUnprojectionMatrix),o=$e(n),s=Tf([],o,Um([],a)),u=Tf([],this.center,s);return at(u)}},{key:"fitBounds",value:function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=this.width,a=this.height,o=uo(Object.assign({width:i,height:a,bounds:t},n)),s=o.longitude,u=o.latitude,f=o.zoom;return new e({width:i,height:a,longitude:s,latitude:u,zoom:f})}},{key:"getBounds",value:function(t){var n=this.getBoundingRegion(t),i=Math.min.apply(Math,K(n.map(function(u){return u[0]}))),a=Math.max.apply(Math,K(n.map(function(u){return u[0]}))),o=Math.min.apply(Math,K(n.map(function(u){return u[1]}))),s=Math.max.apply(Math,K(n.map(function(u){return u[1]})));return[[i,o],[a,s]]}},{key:"getBoundingRegion",value:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return fo(this,t.z||0)}},{key:"getLocationAtPoint",value:function(t){var n=t.lngLat,i=t.pos;return this.getMapCenterByLngLatPosition({lngLat:n,pos:i})}}]),e}();N();var iv=6378137*Math.PI;function If(e){var r=$e(e);return r[0]=(r[0]/256-1)*iv,r[1]=(r[1]/256-1)*iv,r}function av(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),t.push.apply(t,n)}return t}function lo(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{};r%2?av(Object(t),!0).forEach(function(n){c(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):av(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}function QE(e){var r=eS();return function(){var n=L(e),i;if(r){var a=L(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return $(this,i)}}function eS(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var tS={id:"imagery-layer",data:"",serviceType:"auto",srs:"auto",layers:{type:"array",compare:!0,value:[]},onMetadataLoad:{type:"function",value:function(){}},onMetadataLoadError:{type:"function",value:console.error},onImageLoadStart:{type:"function",value:function(){}},onImageLoad:{type:"function",value:function(){}},onImageLoadError:{type:"function",compare:!1,value:function(r,t){return console.error(t,r)}}},co=function(e){H(t,e);var r=QE(t);function t(){var n;T(this,t);for(var i=arguments.length,a=new Array(i),o=0;o<i;o++)a[o]=arguments[o];return n=r.call.apply(r,[this].concat(a)),c(oe(n),"state",void 0),n}return w(t,[{key:"isLoaded",get:function(){var i;return((i=this.state)===null||i===void 0?void 0:i.loadCounter)===0&&_e(L(t.prototype),"isLoaded",this)}},{key:"shouldUpdateState",value:function(){return!0}},{key:"initializeState",value:function(){this.state._nextRequestId=0,this.state.lastRequestId=-1,this.state.loadCounter=0}},{key:"updateState",value:function(i){var a=this,o=i.changeFlags,s=i.props,u=i.oldProps,f=this.context.viewport;o.dataChanged||s.serviceType!==u.serviceType?(this.state.imageSource=this._createImageSource(s),this._loadMetadata(),this.debounce(function(){return a.loadImage(f,"image source changed")},0)):(0,en._deepEqual)(s.layers,u.layers,1)?o.viewportChanged&&this.debounce(function(){return a.loadImage(f,"viewport changed")}):this.debounce(function(){return a.loadImage(f,"layers changed")},0)}},{key:"finalizeState",value:function(){}},{key:"renderLayers",value:function(){var i=this.state,a=i.bounds,o=i.image,s=i.lastRequestParameters;return o&&new ov.BitmapLayer(lo(lo({},this.getSubLayerProps({id:"bitmap"})),{},{_imageCoordinateSystem:s.srs==="EPSG:4326"?en.COORDINATE_SYSTEM.LNGLAT:en.COORDINATE_SYSTEM.CARTESIAN,bounds:a,image:o}))}},{key:"getFeatureInfoText",value:function(){var n=I(Qr.default.mark(function a(o,s){var u,f,l,h;return Qr.default.wrap(function(p){for(;;)switch(p.prev=p.next){case 0:if(u=this.state.lastRequestParameters,!u){p.next=6;break}return p.next=4,(f=(l=this.state.imageSource).getFeatureInfoText)===null||f===void 0?void 0:f.call(l,lo(lo({},u),{},{query_layers:u.layers,x:o,y:s,info_format:"application/vnd.ogc.gml"}));case 4:return h=p.sent,p.abrupt("return",h);case 6:return p.abrupt("return","");case 7:case"end":return p.stop()}},a,this)}));function i(a,o){return n.apply(this,arguments)}return i}()},{key:"_createImageSource",value:function(i){if(i.data instanceof Kt)return i.data;if(typeof i.data=="string")return yf({url:i.data,loadOptions:i.loadOptions,type:i.serviceType});throw new Error("invalid image source in props.data")}},{key:"_loadMetadata",value:function(){var n=I(Qr.default.mark(function a(){var o,s,u,f;return Qr.default.wrap(function(h){for(;;)switch(h.prev=h.next){case 0:return o=this.state.imageSource,h.prev=1,this.state.loadCounter++,h.next=5,o.getMetadata();case 5:s=h.sent,this.state.imageSource===o&&((u=this.getCurrentLayer())===null||u===void 0||u.props.onMetadataLoad(s)),h.next=12;break;case 9:h.prev=9,h.t0=h.catch(1),(f=this.getCurrentLayer())===null||f===void 0||f.props.onMetadataLoadError(h.t0);case 12:return h.prev=12,this.state.loadCounter--,h.finish(12);case 15:case"end":return h.stop()}},a,this,[[1,9,12,15]])}));function i(){return n.apply(this,arguments)}return i}()},{key:"loadImage",value:function(){var n=I(Qr.default.mark(function a(o,s){var u,f,l,h,d,p,m,v,g,y,A,x,b,M,C,F,B,S,_,R;return Qr.default.wrap(function(U){for(;;)switch(U.prev=U.next){case 0:if(u=this.props,f=u.layers,l=u.serviceType,!(l==="wms"&&f.length===0)){U.next=3;break}return U.abrupt("return");case 3:return h=o.getBounds(),d=o.width,p=o.height,m=this.getRequestId(),v=this.props.srs,v==="auto"&&(v=o.resolution?"EPSG:4326":"EPSG:3857"),g={width:d,height:p,bbox:h,layers:f,srs:v},v==="EPSG:3857"&&(y=If([h[0],h[1]]),A=D(y,2),x=A[0],b=A[1],M=If([h[2],h[3]]),C=D(M,2),F=C[0],B=C[1],g.bbox=[x,b,F,B]),U.prev=10,this.state.loadCounter++,this.props.onImageLoadStart(m),U.next=15,this.state.imageSource.getImage(g);case 15:S=U.sent,this.state.lastRequestId<m&&((_=this.getCurrentLayer())===null||_===void 0||_.props.onImageLoad(m),this.setState({image:S,bounds:h,lastRequestParameters:g,lastRequestId:m})),U.next=23;break;case 19:U.prev=19,U.t0=U.catch(10),this.raiseError(U.t0,"Load image"),(R=this.getCurrentLayer())===null||R===void 0||R.props.onImageLoadError(m,U.t0);case 23:return U.prev=23,this.state.loadCounter--,U.finish(23);case 26:case"end":return U.stop()}},a,this,[[10,19,23,26]])}));function i(a,o){return n.apply(this,arguments)}return i}()},{key:"getRequestId",value:function(){return this.state._nextRequestId++}},{key:"debounce",value:function(i){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:500;clearTimeout(this.state._timeoutId),this.state._timeoutId=setTimeout(function(){return i()},a)}}]),t}(en.CompositeLayer);c(co,"layerName","WMSLayer");c(co,"defaultProps",tS);q();N();var sv=X(Tt());function rS(e){var r=nS();return function(){var n=L(e),i;if(r){var a=L(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return $(this,i)}}function nS(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var iS={getHeight:{type:"accessor",value:0},greatCircle:!0},ho=function(e){H(t,e);var r=rS(t);function t(){return T(this,t),r.apply(this,arguments)}return t}(sv.ArcLayer);c(ho,"layerName","GreatCircleLayer");c(ho,"defaultProps",iS);q();Y();N();function Rf(e,r){if(e==null)return{};var t={},n=Object.keys(e),i,a;for(a=0;a<n.length;a++)i=n[a],!(r.indexOf(i)>=0)&&(t[i]=e[i]);return t}function Ff(e,r){if(e==null)return{};var t=Rf(e,r),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)n=a[i],!(r.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(t[n]=e[n])}return t}q();Y();N();var fv=X(xt()),kf=X(Tt()),aS=["updateTriggers"];function oS(e){var r=sS();return function(){var n=L(e),i;if(r){var a=L(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return $(this,i)}}function sS(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function uv(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),t.push.apply(t,n)}return t}function Lf(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{};r%2?uv(Object(t),!0).forEach(function(n){c(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):uv(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}var uS=Lf({},kf.PolygonLayer.defaultProps),mt=function(e){H(t,e);var r=oS(t);function t(){return T(this,t),r.apply(this,arguments)}return w(t,[{key:"indexToBounds",value:function(){return null}},{key:"renderLayers",value:function(){var i=this.props,a=i.elevationScale,o=i.extruded,s=i.wireframe,u=i.filled,f=i.stroked,l=i.lineWidthUnits,h=i.lineWidthScale,d=i.lineWidthMinPixels,p=i.lineWidthMaxPixels,m=i.lineJointRounded,v=i.lineMiterLimit,g=i.lineDashJustified,y=i.getElevation,A=i.getFillColor,x=i.getLineColor,b=i.getLineWidth,M=this.props,C=M.updateTriggers,F=M.material,B=M.transitions,S=this.getSubLayerClass("cell",kf.PolygonLayer),_=this.indexToBounds()||{},R=_.updateTriggers,k=Ff(_,aS);return new S({filled:u,wireframe:s,extruded:o,elevationScale:a,stroked:f,lineWidthUnits:l,lineWidthScale:h,lineWidthMinPixels:d,lineWidthMaxPixels:p,lineJointRounded:m,lineMiterLimit:v,lineDashJustified:g,material:F,transitions:B,getElevation:y,getFillColor:A,getLineColor:x,getLineWidth:b},this.getSubLayerProps({id:"cell",updateTriggers:C&&Lf(Lf({},R),{},{getElevation:C.getElevation,getFillColor:C.getFillColor,getLineColor:C.getLineColor,getLineWidth:C.getLineWidth})}),k)}}]),t}(fv.CompositeLayer);c(mt,"layerName","GeoCellLayer");c(mt,"defaultProps",uS);ue();var po=X(Df()),fS=3,lS=30,cS=2*lS+1,cv=180/Math.PI;function dv(e,r,t){var n=1<<r;return[(e[0]+t[0])/n,(e[1]+t[1])/n]}function hv(e){return e>=.5?1/3*(4*e*e-1):1/3*(1-4*(1-e)*(1-e))}function pv(e){return[hv(e[0]),hv(e[1])]}function mv(e,r){var t=D(r,2),n=t[0],i=t[1];switch(e){case 0:return[1,n,i];case 1:return[-n,1,i];case 2:return[-n,-i,1];case 3:return[-1,-i,-n];case 4:return[i,-1,-n];case 5:return[i,n,-1];default:throw new Error("Invalid face")}}function vv(e){var r=D(e,3),t=r[0],n=r[1],i=r[2],a=Math.atan2(i,Math.sqrt(t*t+n*n)),o=Math.atan2(n,t);return[o*cv,a*cv]}function gv(e){for(var r=po.default.fromString(e,!0,10).toString(2);r.length<fS+cS;)r="0"+r;for(var t=r.lastIndexOf("1"),n=r.substring(0,3),i=r.substring(3,t),a=i.length/2,o=po.default.fromString(n,!0,2).toString(10),s=po.default.fromString(i,!0,2).toString(4);s.length<a;)s="0"+s;return"".concat(o,"/").concat(s)}function hS(e,r,t,n){if(n===0){t===1&&(r[0]=e-1-r[0],r[1]=e-1-r[1]);var i=r[0];r[0]=r[1],r[1]=i}}function yv(e){for(var r=e.split("/"),t=parseInt(r[0],10),n=r[1],i=n.length,a=[0,0],o,s=i-1;s>=0;s--){o=i-s;var u=n[s],f=0,l=0;u==="1"?l=1:u==="2"?(f=1,l=1):u==="3"&&(f=1);var h=Math.pow(2,o-1);hS(h,a,f,l),a[0]+=h*f,a[1]+=h*l}if(t%2===1){var d=a[0];a[0]=a[1],a[1]=d}return{face:t,ij:a,level:o}}var Av=X(Df());function dS(e){var r=e.padEnd(16,"0");return Av.default.fromString(r,16)}var pS=100;function mS(e){for(var r=e.face,t=e.ij,n=e.level,i=[[0,0],[0,1],[1,1],[1,0],[0,0]],a=Math.max(1,Math.ceil(pS*Math.pow(2,-n))),o=new Float64Array(4*a*2+2),s=0,u=0,f=0;f<4;f++)for(var l=i[f].slice(0),h=i[f+1],d=(h[0]-l[0])/a,p=(h[1]-l[1])/a,m=0;m<a;m++){l[0]+=d,l[1]+=p;var v=dv(t,n,l),g=pv(v),y=mv(r,g),A=vv(y);Math.abs(A[1])>89.999&&(A[0]=u);var x=A[0]-u;A[0]+=x>180?-360:x<-180?360:0,o[s++]=A[0],o[s++]=A[1],u=A[0]}return o[s++]=o[0],o[s++]=o[1],o}function vS(e){if(typeof e=="string"){if(e.indexOf("/")>0)return e;e=dS(e)}return gv(e.toString())}function _v(e){var r=vS(e),t=yv(r);return mS(t)}function gS(e){var r=yS();return function(){var n=L(e),i;if(r){var a=L(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return $(this,i)}}function yS(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var AS={getS2Token:{type:"accessor",value:function(r){return r.token}}},mo=function(e){H(t,e);var r=gS(t);function t(){return T(this,t),r.apply(this,arguments)}return w(t,[{key:"indexToBounds",value:function(){var i=this.props,a=i.data,o=i.getS2Token;return{data:a,_normalize:!1,positionFormat:"XY",getPolygon:function(u,f){return _v(o(u,f))}}}}]),t}(mt);c(mo,"layerName","S2Layer");c(mo,"defaultProps",AS);q();Y();N();ue();var Gf=512;function _S(e,r){for(var t=0,n=0,i=1<<e.length,a=i/Gf,o=0;o<e.length;o++){i>>=1;var s=parseInt(e[o]);s%2&&(t|=i),s>1&&(n|=i)}return[[t/a,Gf-n/a],[(t+r)/a,Gf-(n+r)/a]]}function bv(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,t=_S(e,r),n=D(t,2),i=n[0],a=n[1],o=at(i),s=D(o,2),u=s[0],f=s[1],l=at(a),h=D(l,2),d=h[0],p=h[1];return[d,f,d,p,u,p,u,f,d,f]}function bS(e){var r=TS();return function(){var n=L(e),i;if(r){var a=L(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return $(this,i)}}function TS(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var xS={getQuadkey:{type:"accessor",value:function(r){return r.quadkey}}},vo=function(e){H(t,e);var r=bS(t);function t(){return T(this,t),r.apply(this,arguments)}return w(t,[{key:"indexToBounds",value:function(){var i=this.props,a=i.data,o=i.extruded,s=i.getQuadkey,u=o?.99:1;return{data:a,_normalize:!1,positionFormat:"XY",getPolygon:function(l,h){return bv(s(l,h),u)},updateTriggers:{getPolygon:u}}}}]),t}(mt);c(vo,"layerName","QuadkeyLayer");c(vo,"defaultProps",xS);q();Y();N();var Do=X(xt()),xg=X(Tt());ue();q();Y();N();q();Y();q();Y();q();Y();Le();function de(e,r){if(!e)throw new Error("math.gl assertion ".concat(r))}var ES=1/Math.PI*180,SS=1/180*Math.PI,xe={EPSILON:1e-12,debug:!1,precision:4,printTypes:!1,printDegrees:!1,printRowMajor:!0};function Nf(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=r.precision,n=t===void 0?xe.precision:t;return e=wS(e),"".concat(parseFloat(e.toPrecision(n)))}function Qe(e){return Array.isArray(e)||ArrayBuffer.isView(e)&&!(e instanceof DataView)}function Uf(e){return Tv(e)}function jf(e){return wt(e)}function Tv(e,r){return Hf(e,function(t){return t*SS},r)}function wt(e,r){return Hf(e,function(t){return t*ES},r)}function go(e,r,t){return Hf(e,function(n){return Math.max(r,Math.min(t,n))})}function Ar(e,r,t){return Qe(e)?e.map(function(n,i){return Ar(n,r[i],t)}):t*r+(1-t)*e}function He(e,r,t){var n=xe.EPSILON;t&&(xe.EPSILON=t);try{if(e===r)return!0;if(Qe(e)&&Qe(r)){if(e.length!==r.length)return!1;for(var i=0;i<e.length;++i)if(!He(e[i],r[i]))return!1;return!0}return e&&e.equals?e.equals(r):r&&r.equals?r.equals(e):typeof e=="number"&&typeof r=="number"?Math.abs(e-r)<=xe.EPSILON*Math.max(1,Math.abs(e),Math.abs(r)):!1}finally{xe.EPSILON=n}}function wS(e){return Math.round(e/xe.EPSILON)*xe.EPSILON}function CS(e){return e.clone?e.clone():new Array(e.length)}function Hf(e,r,t){if(Qe(e)){var n=e;t=t||CS(n);for(var i=0;i<t.length&&i<n.length;++i)t[i]=r(e[i],i,t);return t}return r(e)}function BS(e){var r=MS();return function(){var n=L(e),i;if(r){var a=L(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return $(this,i)}}function MS(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function OS(e){function r(){var t=Reflect.construct(e,Array.from(arguments));return Object.setPrototypeOf(t,Object.getPrototypeOf(this)),t}return r.prototype=Object.create(e.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),Object.setPrototypeOf?Object.setPrototypeOf(r,e):r.__proto__=e,r}var Jn=function(e){H(t,e);var r=BS(t);function t(){return T(this,t),r.apply(this,arguments)}return w(t,[{key:"clone",value:function(){return new this.constructor().copy(this)}},{key:"fromArray",value:function(i){for(var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,o=0;o<this.ELEMENTS;++o)this[o]=i[o+a];return this.check()}},{key:"toArray",value:function(){for(var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,o=0;o<this.ELEMENTS;++o)i[a+o]=this[o];return i}},{key:"from",value:function(i){return Array.isArray(i)?this.copy(i):this.fromObject(i)}},{key:"to",value:function(i){return i===this?this:Qe(i)?this.toArray(i):this.toObject(i)}},{key:"toTarget",value:function(i){return i?this.to(i):this}},{key:"toFloat32Array",value:function(){return new Float32Array(this)}},{key:"toString",value:function(){return this.formatString(xe)}},{key:"formatString",value:function(i){for(var a="",o=0;o<this.ELEMENTS;++o)a+=(o>0?", ":"")+Nf(this[o],i);return"".concat(i.printTypes?this.constructor.name:"","[").concat(a,"]")}},{key:"equals",value:function(i){if(!i||this.length!==i.length)return!1;for(var a=0;a<this.ELEMENTS;++a)if(!He(this[a],i[a]))return!1;return!0}},{key:"exactEquals",value:function(i){if(!i||this.length!==i.length)return!1;for(var a=0;a<this.ELEMENTS;++a)if(this[a]!==i[a])return!1;return!0}},{key:"negate",value:function(){for(var i=0;i<this.ELEMENTS;++i)this[i]=-this[i];return this.check()}},{key:"lerp",value:function(i,a,o){if(o===void 0)return this.lerp(this,i,a);for(var s=0;s<this.ELEMENTS;++s){var u=i[s];this[s]=u+o*(a[s]-u)}return this.check()}},{key:"min",value:function(i){for(var a=0;a<this.ELEMENTS;++a)this[a]=Math.min(i[a],this[a]);return this.check()}},{key:"max",value:function(i){for(var a=0;a<this.ELEMENTS;++a)this[a]=Math.max(i[a],this[a]);return this.check()}},{key:"clamp",value:function(i,a){for(var o=0;o<this.ELEMENTS;++o)this[o]=Math.min(Math.max(this[o],i[o]),a[o]);return this.check()}},{key:"add",value:function(){for(var i=arguments.length,a=new Array(i),o=0;o<i;o++)a[o]=arguments[o];for(var s=0,u=a;s<u.length;s++)for(var f=u[s],l=0;l<this.ELEMENTS;++l)this[l]+=f[l];return this.check()}},{key:"subtract",value:function(){for(var i=arguments.length,a=new Array(i),o=0;o<i;o++)a[o]=arguments[o];for(var s=0,u=a;s<u.length;s++)for(var f=u[s],l=0;l<this.ELEMENTS;++l)this[l]-=f[l];return this.check()}},{key:"scale",value:function(i){if(typeof i=="number")for(var a=0;a<this.ELEMENTS;++a)this[a]*=i;else for(var o=0;o<this.ELEMENTS&&o<i.length;++o)this[o]*=i[o];return this.check()}},{key:"multiplyByScalar",value:function(i){for(var a=0;a<this.ELEMENTS;++a)this[a]*=i;return this.check()}},{key:"check",value:function(){if(xe.debug&&!this.validate())throw new Error("math.gl: ".concat(this.constructor.name," some fields set to invalid numbers'"));return this}},{key:"validate",value:function(){for(var i=this.length===this.ELEMENTS,a=0;a<this.ELEMENTS;++a)i=i&&Number.isFinite(this[a]);return i}},{key:"sub",value:function(i){return this.subtract(i)}},{key:"setScalar",value:function(i){for(var a=0;a<this.ELEMENTS;++a)this[a]=i;return this.check()}},{key:"addScalar",value:function(i){for(var a=0;a<this.ELEMENTS;++a)this[a]+=i;return this.check()}},{key:"subScalar",value:function(i){return this.addScalar(-i)}},{key:"multiplyScalar",value:function(i){for(var a=0;a<this.ELEMENTS;++a)this[a]*=i;return this.check()}},{key:"divideScalar",value:function(i){return this.multiplyByScalar(1/i)}},{key:"clampScalar",value:function(i,a){for(var o=0;o<this.ELEMENTS;++o)this[o]=Math.min(Math.max(this[o],i),a);return this.check()}},{key:"elements",get:function(){return this}}]),t}(OS(Array));function PS(e,r){if(e.length!==r)return!1;for(var t=0;t<e.length;++t)if(!Number.isFinite(e[t]))return!1;return!0}function le(e){if(!Number.isFinite(e))throw new Error("Invalid number ".concat(e));return e}function _r(e,r){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"";if(xe.debug&&!PS(e,r))throw new Error("math.gl: ".concat(t," some fields set to invalid numbers'"));return e}function IS(e){var r=RS();return function(){var n=L(e),i;if(r){var a=L(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return $(this,i)}}function RS(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var Xn=function(e){H(t,e);var r=IS(t);function t(){return T(this,t),r.apply(this,arguments)}return w(t,[{key:"x",get:function(){return this[0]},set:function(i){this[0]=le(i)}},{key:"y",get:function(){return this[1]},set:function(i){this[1]=le(i)}},{key:"len",value:function(){return Math.sqrt(this.lengthSquared())}},{key:"magnitude",value:function(){return this.len()}},{key:"lengthSquared",value:function(){for(var i=0,a=0;a<this.ELEMENTS;++a)i+=this[a]*this[a];return i}},{key:"magnitudeSquared",value:function(){return this.lengthSquared()}},{key:"distance",value:function(i){return Math.sqrt(this.distanceSquared(i))}},{key:"distanceSquared",value:function(i){for(var a=0,o=0;o<this.ELEMENTS;++o){var s=this[o]-i[o];a+=s*s}return le(a)}},{key:"dot",value:function(i){for(var a=0,o=0;o<this.ELEMENTS;++o)a+=this[o]*i[o];return le(a)}},{key:"normalize",value:function(){var i=this.magnitude();if(i!==0)for(var a=0;a<this.ELEMENTS;++a)this[a]/=i;return this.check()}},{key:"multiply",value:function(){for(var i=arguments.length,a=new Array(i),o=0;o<i;o++)a[o]=arguments[o];for(var s=0,u=a;s<u.length;s++)for(var f=u[s],l=0;l<this.ELEMENTS;++l)this[l]*=f[l];return this.check()}},{key:"divide",value:function(){for(var i=arguments.length,a=new Array(i),o=0;o<i;o++)a[o]=arguments[o];for(var s=0,u=a;s<u.length;s++)for(var f=u[s],l=0;l<this.ELEMENTS;++l)this[l]/=f[l];return this.check()}},{key:"lengthSq",value:function(){return this.lengthSquared()}},{key:"distanceTo",value:function(i){return this.distance(i)}},{key:"distanceToSquared",value:function(i){return this.distanceSquared(i)}},{key:"getComponent",value:function(i){return de(i>=0&&i<this.ELEMENTS,"index is out of range"),le(this[i])}},{key:"setComponent",value:function(i,a){return de(i>=0&&i<this.ELEMENTS,"index is out of range"),this[i]=a,this.check()}},{key:"addVectors",value:function(i,a){return this.copy(i).add(a)}},{key:"subVectors",value:function(i,a){return this.copy(i).subtract(a)}},{key:"multiplyVectors",value:function(i,a){return this.copy(i).multiply(a)}},{key:"addScaledVector",value:function(i,a){return this.add(new this.constructor(i).multiplyScalar(a))}}]),t}(Jn);function yo(e,r,t){var n=r[0],i=r[1],a=t[3]*n+t[7]*i||1;return e[0]=(t[0]*n+t[4]*i)/a,e[1]=(t[1]*n+t[5]*i)/a,e}function Ao(e,r,t){var n=r[0],i=r[1],a=r[2],o=t[3]*n+t[7]*i+t[11]*a||1;return e[0]=(t[0]*n+t[4]*i+t[8]*a)/o,e[1]=(t[1]*n+t[5]*i+t[9]*a)/o,e[2]=(t[2]*n+t[6]*i+t[10]*a)/o,e}function xv(e,r,t){var n=r[0],i=r[1];return e[0]=t[0]*n+t[2]*i,e[1]=t[1]*n+t[3]*i,e[2]=r[2],e}function Ev(e,r,t){var n=r[0],i=r[1];return e[0]=t[0]*n+t[2]*i,e[1]=t[1]*n+t[3]*i,e[2]=r[2],e[3]=r[3],e}function _o(e,r,t){var n=r[0],i=r[1],a=r[2];return e[0]=t[0]*n+t[3]*i+t[6]*a,e[1]=t[1]*n+t[4]*i+t[7]*a,e[2]=t[2]*n+t[5]*i+t[8]*a,e[3]=r[3],e}function FS(e){var r=LS();return function(){var n=L(e),i;if(r){var a=L(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return $(this,i)}}function LS(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var tn=function(e){H(t,e);var r=FS(t);function t(){var n,i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return T(this,t),n=r.call(this,2),Qe(i)&&arguments.length===1?n.copy(i):(xe.debug&&(le(i),le(a)),n[0]=i,n[1]=a),n}return w(t,[{key:"set",value:function(i,a){return this[0]=i,this[1]=a,this.check()}},{key:"copy",value:function(i){return this[0]=i[0],this[1]=i[1],this.check()}},{key:"fromObject",value:function(i){return xe.debug&&(le(i.x),le(i.y)),this[0]=i.x,this[1]=i.y,this.check()}},{key:"toObject",value:function(i){return i.x=this[0],i.y=this[1],i}},{key:"ELEMENTS",get:function(){return 2}},{key:"horizontalAngle",value:function(){return Math.atan2(this.y,this.x)}},{key:"verticalAngle",value:function(){return Math.atan2(this.x,this.y)}},{key:"transform",value:function(i){return this.transformAsPoint(i)}},{key:"transformAsPoint",value:function(i){return ro(this,this,i),this.check()}},{key:"transformAsVector",value:function(i){return yo(this,this,i),this.check()}},{key:"transformByMatrix3",value:function(i){return to(this,this,i),this.check()}},{key:"transformByMatrix2x3",value:function(i){return Hm(this,this,i),this.check()}},{key:"transformByMatrix2",value:function(i){return jm(this,this,i),this.check()}}]),t}(Xn);q();Y();function kS(e){var r=DS();return function(){var n=L(e),i;if(r){var a=L(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return $(this,i)}}function DS(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var Vf=[0,0,0],bo,E=function(e){H(t,e);var r=kS(t);function t(){var n,i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;return T(this,t),n=r.call(this,-0,-0,-0),arguments.length===1&&Qe(i)?n.copy(i):(xe.debug&&(le(i),le(a),le(o)),n[0]=i,n[1]=a,n[2]=o),n}return w(t,[{key:"set",value:function(i,a,o){return this[0]=i,this[1]=a,this[2]=o,this.check()}},{key:"copy",value:function(i){return this[0]=i[0],this[1]=i[1],this[2]=i[2],this.check()}},{key:"fromObject",value:function(i){return xe.debug&&(le(i.x),le(i.y),le(i.z)),this[0]=i.x,this[1]=i.y,this[2]=i.z,this.check()}},{key:"toObject",value:function(i){return i.x=this[0],i.y=this[1],i.z=this[2],i}},{key:"ELEMENTS",get:function(){return 3}},{key:"z",get:function(){return this[2]},set:function(i){this[2]=le(i)}},{key:"angle",value:function(i){return Km(this,i)}},{key:"cross",value:function(i){return Hn(this,this,i),this.check()}},{key:"rotateX",value:function(i){var a=i.radians,o=i.origin,s=o===void 0?Vf:o;return Jm(this,this,s,a),this.check()}},{key:"rotateY",value:function(i){var a=i.radians,o=i.origin,s=o===void 0?Vf:o;return Xm(this,this,s,a),this.check()}},{key:"rotateZ",value:function(i){var a=i.radians,o=i.origin,s=o===void 0?Vf:o;return qm(this,this,s,a),this.check()}},{key:"transform",value:function(i){return this.transformAsPoint(i)}},{key:"transformAsPoint",value:function(i){return Vn(this,this,i),this.check()}},{key:"transformAsVector",value:function(i){return Ao(this,this,i),this.check()}},{key:"transformByMatrix3",value:function(i){return no(this,this,i),this.check()}},{key:"transformByMatrix2",value:function(i){return xv(this,this,i),this.check()}},{key:"transformByQuaternion",value:function(i){return io(this,this,i),this.check()}}],[{key:"ZERO",get:function(){return bo||(bo=new t(0,0,0),Object.freeze(bo)),bo}}]),t}(Xn);q();Y();function GS(e){var r=NS();return function(){var n=L(e),i;if(r){var a=L(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return $(this,i)}}function NS(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var To,Sv=function(e){H(t,e);var r=GS(t);function t(){var n,i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0;return T(this,t),n=r.call(this,-0,-0,-0,-0),Qe(i)&&arguments.length===1?n.copy(i):(xe.debug&&(le(i),le(a),le(o),le(s)),n[0]=i,n[1]=a,n[2]=o,n[3]=s),n}return w(t,[{key:"set",value:function(i,a,o,s){return this[0]=i,this[1]=a,this[2]=o,this[3]=s,this.check()}},{key:"copy",value:function(i){return this[0]=i[0],this[1]=i[1],this[2]=i[2],this[3]=i[3],this.check()}},{key:"fromObject",value:function(i){return xe.debug&&(le(i.x),le(i.y),le(i.z),le(i.w)),this[0]=i.x,this[1]=i.y,this[2]=i.z,this[3]=i.w,this}},{key:"toObject",value:function(i){return i.x=this[0],i.y=this[1],i.z=this[2],i.w=this[3],i}},{key:"ELEMENTS",get:function(){return 4}},{key:"z",get:function(){return this[2]},set:function(i){this[2]=le(i)}},{key:"w",get:function(){return this[3]},set:function(i){this[3]=le(i)}},{key:"transform",value:function(i){return Vn(this,this,i),this.check()}},{key:"transformByMatrix3",value:function(i){return _o(this,this,i),this.check()}},{key:"transformByMatrix2",value:function(i){return Ev(this,this,i),this.check()}},{key:"transformByQuaternion",value:function(i){return io(this,this,i),this.check()}},{key:"applyMatrix4",value:function(i){return i.transform(this,this),this}}],[{key:"ZERO",get:function(){return To||(To=new t(0,0,0,0),Object.freeze(To)),To}}]),t}(Xn);q();Y();q();Y();function US(e){var r=jS();return function(){var n=L(e),i;if(r){var a=L(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return $(this,i)}}function jS(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var xo=function(e){H(t,e);var r=US(t);function t(){return T(this,t),r.apply(this,arguments)}return w(t,[{key:"toString",value:function(){var i="[";if(xe.printRowMajor){i+="row-major:";for(var a=0;a<this.RANK;++a)for(var o=0;o<this.RANK;++o)i+=" ".concat(this[o*this.RANK+a])}else{i+="column-major:";for(var s=0;s<this.ELEMENTS;++s)i+=" ".concat(this[s])}return i+="]",i}},{key:"getElementIndex",value:function(i,a){return a*this.RANK+i}},{key:"getElement",value:function(i,a){return this[a*this.RANK+i]}},{key:"setElement",value:function(i,a,o){return this[a*this.RANK+i]=le(o),this}},{key:"getColumn",value:function(i){for(var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:new Array(this.RANK).fill(-0),o=i*this.RANK,s=0;s<this.RANK;++s)a[s]=this[o+s];return a}},{key:"setColumn",value:function(i,a){for(var o=i*this.RANK,s=0;s<this.RANK;++s)this[o+s]=a[s];return this}}]),t}(Jn);function wv(){var e=new Je(9);return Je!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[5]=0,e[6]=0,e[7]=0),e[0]=1,e[4]=1,e[8]=1,e}function Cv(e,r){if(e===r){var t=r[1],n=r[2],i=r[5];e[1]=r[3],e[2]=r[6],e[3]=t,e[5]=r[7],e[6]=n,e[7]=i}else e[0]=r[0],e[1]=r[3],e[2]=r[6],e[3]=r[1],e[4]=r[4],e[5]=r[7],e[6]=r[2],e[7]=r[5],e[8]=r[8];return e}function Bv(e,r){var t=r[0],n=r[1],i=r[2],a=r[3],o=r[4],s=r[5],u=r[6],f=r[7],l=r[8],h=l*o-s*f,d=-l*a+s*u,p=f*a-o*u,m=t*h+n*d+i*p;return m?(m=1/m,e[0]=h*m,e[1]=(-l*n+i*f)*m,e[2]=(s*n-i*o)*m,e[3]=d*m,e[4]=(l*t-i*u)*m,e[5]=(-s*t+i*a)*m,e[6]=p*m,e[7]=(-f*t+n*u)*m,e[8]=(o*t-n*a)*m,e):null}function Mv(e){var r=e[0],t=e[1],n=e[2],i=e[3],a=e[4],o=e[5],s=e[6],u=e[7],f=e[8];return r*(f*a-o*u)+t*(-f*i+o*s)+n*(u*i-a*s)}function zf(e,r,t){var n=r[0],i=r[1],a=r[2],o=r[3],s=r[4],u=r[5],f=r[6],l=r[7],h=r[8],d=t[0],p=t[1],m=t[2],v=t[3],g=t[4],y=t[5],A=t[6],x=t[7],b=t[8];return e[0]=d*n+p*o+m*f,e[1]=d*i+p*s+m*l,e[2]=d*a+p*u+m*h,e[3]=v*n+g*o+y*f,e[4]=v*i+g*s+y*l,e[5]=v*a+g*u+y*h,e[6]=A*n+x*o+b*f,e[7]=A*i+x*s+b*l,e[8]=A*a+x*u+b*h,e}function Ov(e,r,t){var n=r[0],i=r[1],a=r[2],o=r[3],s=r[4],u=r[5],f=r[6],l=r[7],h=r[8],d=t[0],p=t[1];return e[0]=n,e[1]=i,e[2]=a,e[3]=o,e[4]=s,e[5]=u,e[6]=d*n+p*o+f,e[7]=d*i+p*s+l,e[8]=d*a+p*u+h,e}function Pv(e,r,t){var n=r[0],i=r[1],a=r[2],o=r[3],s=r[4],u=r[5],f=r[6],l=r[7],h=r[8],d=Math.sin(t),p=Math.cos(t);return e[0]=p*n+d*o,e[1]=p*i+d*s,e[2]=p*a+d*u,e[3]=p*o-d*n,e[4]=p*s-d*i,e[5]=p*u-d*a,e[6]=f,e[7]=l,e[8]=h,e}function Wf(e,r,t){var n=t[0],i=t[1];return e[0]=n*r[0],e[1]=n*r[1],e[2]=n*r[2],e[3]=i*r[3],e[4]=i*r[4],e[5]=i*r[5],e[6]=r[6],e[7]=r[7],e[8]=r[8],e}function Iv(e,r){var t=r[0],n=r[1],i=r[2],a=r[3],o=t+t,s=n+n,u=i+i,f=t*o,l=n*o,h=n*s,d=i*o,p=i*s,m=i*u,v=a*o,g=a*s,y=a*u;return e[0]=1-h-m,e[3]=l-y,e[6]=d+g,e[1]=l+y,e[4]=1-f-m,e[7]=p-v,e[2]=d-g,e[5]=p+v,e[8]=1-f-h,e}function HS(e){var r=VS();return function(){var n=L(e),i;if(r){var a=L(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return $(this,i)}}function VS(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var Jf;(function(e){e[e.COL0ROW0=0]="COL0ROW0",e[e.COL0ROW1=1]="COL0ROW1",e[e.COL0ROW2=2]="COL0ROW2",e[e.COL1ROW0=3]="COL1ROW0",e[e.COL1ROW1=4]="COL1ROW1",e[e.COL1ROW2=5]="COL1ROW2",e[e.COL2ROW0=6]="COL2ROW0",e[e.COL2ROW1=7]="COL2ROW1",e[e.COL2ROW2=8]="COL2ROW2"})(Jf||(Jf={}));var zS=Object.freeze([1,0,0,0,1,0,0,0,1]),be=function(e){H(t,e);var r=HS(t);function t(n){for(var i,a=arguments.length,o=new Array(a>1?a-1:0),s=1;s<a;s++)o[s-1]=arguments[s];return T(this,t),i=r.call(this,-0,-0,-0,-0,-0,-0,-0,-0,-0),arguments.length===1&&Array.isArray(n)?i.copy(n):o.length>0?i.copy([n].concat(o)):i.identity(),i}return w(t,[{key:"ELEMENTS",get:function(){return 9}},{key:"RANK",get:function(){return 3}},{key:"INDICES",get:function(){return Jf}},{key:"copy",value:function(i){return this[0]=i[0],this[1]=i[1],this[2]=i[2],this[3]=i[3],this[4]=i[4],this[5]=i[5],this[6]=i[6],this[7]=i[7],this[8]=i[8],this.check()}},{key:"identity",value:function(){return this.copy(zS)}},{key:"fromObject",value:function(i){return this.check()}},{key:"fromQuaternion",value:function(i){return Iv(this,i),this.check()}},{key:"set",value:function(i,a,o,s,u,f,l,h,d){return this[0]=i,this[1]=a,this[2]=o,this[3]=s,this[4]=u,this[5]=f,this[6]=l,this[7]=h,this[8]=d,this.check()}},{key:"setRowMajor",value:function(i,a,o,s,u,f,l,h,d){return this[0]=i,this[1]=s,this[2]=l,this[3]=a,this[4]=u,this[5]=h,this[6]=o,this[7]=f,this[8]=d,this.check()}},{key:"determinant",value:function(){return Mv(this)}},{key:"transpose",value:function(){return Cv(this,this),this.check()}},{key:"invert",value:function(){return Bv(this,this),this.check()}},{key:"multiplyLeft",value:function(i){return zf(this,i,this),this.check()}},{key:"multiplyRight",value:function(i){return zf(this,this,i),this.check()}},{key:"rotate",value:function(i){return Pv(this,this,i),this.check()}},{key:"scale",value:function(i){return Array.isArray(i)?Wf(this,this,i):Wf(this,this,[i,i]),this.check()}},{key:"translate",value:function(i){return Ov(this,this,i),this.check()}},{key:"transform",value:function(i,a){var o;switch(i.length){case 2:o=to(a||[-0,-0],i,this);break;case 3:o=no(a||[-0,-0,-0],i,this);break;case 4:o=_o(a||[-0,-0,-0,-0],i,this);break;default:throw new Error("Illegal vector")}return _r(o,i.length),o}},{key:"transformVector",value:function(i,a){return this.transform(i,a)}},{key:"transformVector2",value:function(i,a){return this.transform(i,a)}},{key:"transformVector3",value:function(i,a){return this.transform(i,a)}}],[{key:"IDENTITY",get:function(){return JS()}},{key:"ZERO",get:function(){return WS()}}]),t}(xo);var Eo,So;function WS(){return Eo||(Eo=new be([0,0,0,0,0,0,0,0,0]),Object.freeze(Eo)),Eo}function JS(){return So||(So=new be,Object.freeze(So)),So}q();Y();function XS(e){var r=qS();return function(){var n=L(e),i;if(r){var a=L(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return $(this,i)}}function qS(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var Kf;(function(e){e[e.COL0ROW0=0]="COL0ROW0",e[e.COL0ROW1=1]="COL0ROW1",e[e.COL0ROW2=2]="COL0ROW2",e[e.COL0ROW3=3]="COL0ROW3",e[e.COL1ROW0=4]="COL1ROW0",e[e.COL1ROW1=5]="COL1ROW1",e[e.COL1ROW2=6]="COL1ROW2",e[e.COL1ROW3=7]="COL1ROW3",e[e.COL2ROW0=8]="COL2ROW0",e[e.COL2ROW1=9]="COL2ROW1",e[e.COL2ROW2=10]="COL2ROW2",e[e.COL2ROW3=11]="COL2ROW3",e[e.COL3ROW0=12]="COL3ROW0",e[e.COL3ROW1=13]="COL3ROW1",e[e.COL3ROW2=14]="COL3ROW2",e[e.COL3ROW3=15]="COL3ROW3"})(Kf||(Kf={}));var KS=45*Math.PI/180,YS=1,Xf=.1,qf=500,ZS=Object.freeze([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),se=function(e){H(t,e);var r=XS(t);function t(n){var i;return T(this,t),i=r.call(this,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0),arguments.length===1&&Array.isArray(n)?i.copy(n):i.identity(),i}return w(t,[{key:"ELEMENTS",get:function(){return 16}},{key:"RANK",get:function(){return 4}},{key:"INDICES",get:function(){return Kf}},{key:"copy",value:function(i){return this[0]=i[0],this[1]=i[1],this[2]=i[2],this[3]=i[3],this[4]=i[4],this[5]=i[5],this[6]=i[6],this[7]=i[7],this[8]=i[8],this[9]=i[9],this[10]=i[10],this[11]=i[11],this[12]=i[12],this[13]=i[13],this[14]=i[14],this[15]=i[15],this.check()}},{key:"set",value:function(i,a,o,s,u,f,l,h,d,p,m,v,g,y,A,x){return this[0]=i,this[1]=a,this[2]=o,this[3]=s,this[4]=u,this[5]=f,this[6]=l,this[7]=h,this[8]=d,this[9]=p,this[10]=m,this[11]=v,this[12]=g,this[13]=y,this[14]=A,this[15]=x,this.check()}},{key:"setRowMajor",value:function(i,a,o,s,u,f,l,h,d,p,m,v,g,y,A,x){return this[0]=i,this[1]=u,this[2]=d,this[3]=g,this[4]=a,this[5]=f,this[6]=p,this[7]=y,this[8]=o,this[9]=l,this[10]=m,this[11]=A,this[12]=s,this[13]=h,this[14]=v,this[15]=x,this.check()}},{key:"toRowMajor",value:function(i){return i[0]=this[0],i[1]=this[4],i[2]=this[8],i[3]=this[12],i[4]=this[1],i[5]=this[5],i[6]=this[9],i[7]=this[13],i[8]=this[2],i[9]=this[6],i[10]=this[10],i[11]=this[14],i[12]=this[3],i[13]=this[7],i[14]=this[11],i[15]=this[15],i}},{key:"identity",value:function(){return this.copy(ZS)}},{key:"fromObject",value:function(i){return this.check()}},{key:"fromQuaternion",value:function(i){return km(this,i),this.check()}},{key:"frustum",value:function(i){var a=i.left,o=i.right,s=i.bottom,u=i.top,f=i.near,l=f===void 0?Xf:f,h=i.far,d=h===void 0?qf:h;return d===1/0?ew(this,a,o,s,u,l):Dm(this,a,o,s,u,l,d),this.check()}},{key:"lookAt",value:function(i){var a=i.eye,o=i.center,s=o===void 0?[0,0,0]:o,u=i.up,f=u===void 0?[0,1,0]:u;return Nm(this,a,s,f),this.check()}},{key:"ortho",value:function(i){var a=i.left,o=i.right,s=i.bottom,u=i.top,f=i.near,l=f===void 0?Xf:f,h=i.far,d=h===void 0?qf:h;return Gm(this,a,o,s,u,l,d),this.check()}},{key:"orthographic",value:function(i){var a=i.fovy,o=a===void 0?KS:a,s=i.aspect,u=s===void 0?YS:s,f=i.focalDistance,l=f===void 0?1:f,h=i.near,d=h===void 0?Xf:h,p=i.far,m=p===void 0?qf:p;Fv(o);var v=o/2,g=l*Math.tan(v),y=g*u;return this.ortho({left:-y,right:y,bottom:-g,top:g,near:d,far:m})}},{key:"perspective",value:function(i){var a=i.fovy,o=a===void 0?45*Math.PI/180:a,s=i.aspect,u=s===void 0?1:s,f=i.near,l=f===void 0?.1:f,h=i.far,d=h===void 0?500:h;return Fv(o),$a(this,o,u,l,d),this.check()}},{key:"determinant",value:function(){return Im(this)}},{key:"getScale",value:function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[-0,-0,-0];return i[0]=Math.sqrt(this[0]*this[0]+this[1]*this[1]+this[2]*this[2]),i[1]=Math.sqrt(this[4]*this[4]+this[5]*this[5]+this[6]*this[6]),i[2]=Math.sqrt(this[8]*this[8]+this[9]*this[9]+this[10]*this[10]),i}},{key:"getTranslation",value:function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[-0,-0,-0];return i[0]=this[12],i[1]=this[13],i[2]=this[14],i}},{key:"getRotation",value:function(i,a){i=i||[-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0],a=a||[-0,-0,-0];var o=this.getScale(a),s=1/o[0],u=1/o[1],f=1/o[2];return i[0]=this[0]*s,i[1]=this[1]*u,i[2]=this[2]*f,i[3]=0,i[4]=this[4]*s,i[5]=this[5]*u,i[6]=this[6]*f,i[7]=0,i[8]=this[8]*s,i[9]=this[9]*u,i[10]=this[10]*f,i[11]=0,i[12]=0,i[13]=0,i[14]=0,i[15]=1,i}},{key:"getRotationMatrix3",value:function(i,a){i=i||[-0,-0,-0,-0,-0,-0,-0,-0,-0],a=a||[-0,-0,-0];var o=this.getScale(a),s=1/o[0],u=1/o[1],f=1/o[2];return i[0]=this[0]*s,i[1]=this[1]*u,i[2]=this[2]*f,i[3]=this[4]*s,i[4]=this[5]*u,i[5]=this[6]*f,i[6]=this[8]*s,i[7]=this[9]*u,i[8]=this[10]*f,i}},{key:"transpose",value:function(){return Pm(this,this),this.check()}},{key:"invert",value:function(){return Ka(this,this),this.check()}},{key:"multiplyLeft",value:function(i){return Zr(this,i,this),this.check()}},{key:"multiplyRight",value:function(i){return Zr(this,this,i),this.check()}},{key:"rotateX",value:function(i){return Ya(this,this,i),this.check()}},{key:"rotateY",value:function(i){return Fm(this,this,i),this.check()}},{key:"rotateZ",value:function(i){return Za(this,this,i),this.check()}},{key:"rotateXYZ",value:function(i){return this.rotateX(i[0]).rotateY(i[1]).rotateZ(i[2])}},{key:"rotateAxis",value:function(i,a){return Rm(this,this,i,a),this.check()}},{key:"scale",value:function(i){return Un(this,this,Array.isArray(i)?i:[i,i,i]),this.check()}},{key:"translate",value:function(i){return $r(this,this,i),this.check()}},{key:"transform",value:function(i,a){return i.length===4?(a=Xa(a||[-0,-0,-0,-0],i,this),_r(a,4),a):this.transformAsPoint(i,a)}},{key:"transformAsPoint",value:function(i,a){var o=i.length,s;switch(o){case 2:s=ro(a||[-0,-0],i,this);break;case 3:s=Vn(a||[-0,-0,-0],i,this);break;default:throw new Error("Illegal vector")}return _r(s,i.length),s}},{key:"transformAsVector",value:function(i,a){var o;switch(i.length){case 2:o=yo(a||[-0,-0],i,this);break;case 3:o=Ao(a||[-0,-0,-0],i,this);break;default:throw new Error("Illegal vector")}return _r(o,i.length),o}},{key:"transformPoint",value:function(i,a){return this.transformAsPoint(i,a)}},{key:"transformVector",value:function(i,a){return this.transformAsPoint(i,a)}},{key:"transformDirection",value:function(i,a){return this.transformAsVector(i,a)}},{key:"makeRotationX",value:function(i){return this.identity().rotateX(i)}},{key:"makeTranslation",value:function(i,a,o){return this.identity().translate([i,a,o])}}],[{key:"IDENTITY",get:function(){return QS()}},{key:"ZERO",get:function(){return $S()}}]),t}(xo);var wo,Co;function $S(){return wo||(wo=new se([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),Object.freeze(wo)),wo}function QS(){return Co||(Co=new se,Object.freeze(Co)),Co}function Fv(e){if(e>Math.PI*2)throw Error("expected radians")}function ew(e,r,t,n,i,a){var o=2*a/(t-r),s=2*a/(i-n),u=(t+r)/(t-r),f=(i+n)/(i-n),l=-1,h=-1,d=-2*a;return e[0]=o,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=s,e[6]=0,e[7]=0,e[8]=u,e[9]=f,e[10]=l,e[11]=h,e[12]=0,e[13]=0,e[14]=d,e[15]=0,e}q();Y();function Lv(){var e=new Je(4);return Je!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e[3]=1,e}function kv(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e}function Yf(e,r,t){t=t*.5;var n=Math.sin(t);return e[0]=n*r[0],e[1]=n*r[1],e[2]=n*r[2],e[3]=Math.cos(t),e}function Zf(e,r,t){var n=r[0],i=r[1],a=r[2],o=r[3],s=t[0],u=t[1],f=t[2],l=t[3];return e[0]=n*l+o*s+i*f-a*u,e[1]=i*l+o*u+a*s-n*f,e[2]=a*l+o*f+n*u-i*s,e[3]=o*l-n*s-i*u-a*f,e}function Dv(e,r,t){t*=.5;var n=r[0],i=r[1],a=r[2],o=r[3],s=Math.sin(t),u=Math.cos(t);return e[0]=n*u+o*s,e[1]=i*u+a*s,e[2]=a*u-i*s,e[3]=o*u-n*s,e}function Gv(e,r,t){t*=.5;var n=r[0],i=r[1],a=r[2],o=r[3],s=Math.sin(t),u=Math.cos(t);return e[0]=n*u-a*s,e[1]=i*u+o*s,e[2]=a*u+n*s,e[3]=o*u-i*s,e}function Nv(e,r,t){t*=.5;var n=r[0],i=r[1],a=r[2],o=r[3],s=Math.sin(t),u=Math.cos(t);return e[0]=n*u+i*s,e[1]=i*u-n*s,e[2]=a*u+o*s,e[3]=o*u-a*s,e}function Uv(e,r){var t=r[0],n=r[1],i=r[2];return e[0]=t,e[1]=n,e[2]=i,e[3]=Math.sqrt(Math.abs(1-t*t-n*n-i*i)),e}function Ki(e,r,t,n){var i=r[0],a=r[1],o=r[2],s=r[3],u=t[0],f=t[1],l=t[2],h=t[3],d,p,m,v,g;return p=i*u+a*f+o*l+s*h,p<0&&(p=-p,u=-u,f=-f,l=-l,h=-h),1-p>Te?(d=Math.acos(p),m=Math.sin(d),v=Math.sin((1-n)*d)/m,g=Math.sin(n*d)/m):(v=1-n,g=n),e[0]=v*i+g*u,e[1]=v*a+g*f,e[2]=v*o+g*l,e[3]=v*s+g*h,e}function jv(e,r){var t=r[0],n=r[1],i=r[2],a=r[3],o=t*t+n*n+i*i+a*a,s=o?1/o:0;return e[0]=-t*s,e[1]=-n*s,e[2]=-i*s,e[3]=a*s,e}function Hv(e,r){return e[0]=-r[0],e[1]=-r[1],e[2]=-r[2],e[3]=r[3],e}function $f(e,r){var t=r[0]+r[4]+r[8],n;if(t>0)n=Math.sqrt(t+1),e[3]=.5*n,n=.5/n,e[0]=(r[5]-r[7])*n,e[1]=(r[6]-r[2])*n,e[2]=(r[1]-r[3])*n;else{var i=0;r[4]>r[0]&&(i=1),r[8]>r[i*3+i]&&(i=2);var a=(i+1)%3,o=(i+2)%3;n=Math.sqrt(r[i*3+i]-r[a*3+a]-r[o*3+o]+1),e[i]=.5*n,n=.5/n,e[3]=(r[a*3+o]-r[o*3+a])*n,e[a]=(r[a*3+i]+r[i*3+a])*n,e[o]=(r[o*3+i]+r[i*3+o])*n}return e}var Vv=Em;var zv=Ja,Wv=Bm,Jv=Mm,Xv=Sm;var qv=wm;var Kv=Cm;var Yv=function(){var e=xf(),r=Sf(1,0,0),t=Sf(0,1,0);return function(n,i,a){var o=Ji(i,a);return o<-.999999?(Hn(e,r,i),Zm(e)<1e-6&&Hn(e,t,i),Wm(e,e),Yf(n,e,Math.PI),n):o>.999999?(n[0]=0,n[1]=0,n[2]=0,n[3]=1,n):(Hn(e,i,a),n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=1+o,Kv(n,n))}}(),t8=function(){var e=Lv(),r=Lv();return function(t,n,i,a,o,s){return Ki(e,n,o,s),Ki(r,i,a,s),Ki(t,e,r,2*s*(1-s)),t}}(),r8=function(){var e=wv();return function(r,t,n,i){return e[0]=n[0],e[3]=n[1],e[6]=n[2],e[1]=i[0],e[4]=i[1],e[7]=i[2],e[2]=-t[0],e[5]=-t[1],e[8]=-t[2],Kv(r,$f(r,e))}}();function rw(e){var r=nw();return function(){var n=L(e),i;if(r){var a=L(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return $(this,i)}}function nw(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var iw=[0,0,0,1],br=function(e){H(t,e);var r=rw(t);function t(){var n,i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:1;return T(this,t),n=r.call(this,-0,-0,-0,-0),Array.isArray(i)&&arguments.length===1?n.copy(i):n.set(i,a,o,s),n}return w(t,[{key:"copy",value:function(i){return this[0]=i[0],this[1]=i[1],this[2]=i[2],this[3]=i[3],this.check()}},{key:"set",value:function(i,a,o,s){return this[0]=i,this[1]=a,this[2]=o,this[3]=s,this.check()}},{key:"fromObject",value:function(i){return this[0]=i.x,this[1]=i.y,this[2]=i.z,this[3]=i.w,this.check()}},{key:"fromMatrix3",value:function(i){return $f(this,i),this.check()}},{key:"fromAxisRotation",value:function(i,a){return Yf(this,i,a),this.check()}},{key:"identity",value:function(){return kv(this),this.check()}},{key:"setAxisAngle",value:function(i,a){return this.fromAxisRotation(i,a)}},{key:"ELEMENTS",get:function(){return 4}},{key:"x",get:function(){return this[0]},set:function(i){this[0]=le(i)}},{key:"y",get:function(){return this[1]},set:function(i){this[1]=le(i)}},{key:"z",get:function(){return this[2]},set:function(i){this[2]=le(i)}},{key:"w",get:function(){return this[3]},set:function(i){this[3]=le(i)}},{key:"len",value:function(){return Xv(this)}},{key:"lengthSquared",value:function(){return qv(this)}},{key:"dot",value:function(i){return Wv(this,i)}},{key:"rotationTo",value:function(i,a){return Yv(this,i,a),this.check()}},{key:"add",value:function(i){return Vv(this,this,i),this.check()}},{key:"calculateW",value:function(){return Uv(this,this),this.check()}},{key:"conjugate",value:function(){return Hv(this,this),this.check()}},{key:"invert",value:function(){return jv(this,this),this.check()}},{key:"lerp",value:function(i,a,o){return o===void 0?this.lerp(this,i,a):(Jv(this,i,a,o),this.check())}},{key:"multiplyRight",value:function(i){return Zf(this,this,i),this.check()}},{key:"multiplyLeft",value:function(i){return Zf(this,i,this),this.check()}},{key:"normalize",value:function(){var i=this.len(),a=i>0?1/i:0;return this[0]=this[0]*a,this[1]=this[1]*a,this[2]=this[2]*a,this[3]=this[3]*a,i===0&&(this[3]=1),this.check()}},{key:"rotateX",value:function(i){return Dv(this,this,i),this.check()}},{key:"rotateY",value:function(i){return Gv(this,this,i),this.check()}},{key:"rotateZ",value:function(i){return Nv(this,this,i),this.check()}},{key:"scale",value:function(i){return zv(this,this,i),this.check()}},{key:"slerp",value:function(i,a,o){var s,u,f;switch(arguments.length){case 1:var l=i.start;s=l===void 0?iw:l,u=i.target,f=i.ratio;break;case 2:s=this,u=i,f=a;break;default:s=i,u=a,f=o}return Ki(this,s,u,f),this.check()}},{key:"transformVector4",value:function(i){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:new Sv;return Om(a,i,this),_r(a,4)}},{key:"lengthSq",value:function(){return this.lengthSquared()}},{key:"setFromAxisAngle",value:function(i,a){return this.setAxisAngle(i,a)}},{key:"premultiply",value:function(i){return this.multiplyLeft(i)}},{key:"multiply",value:function(i){return this.multiplyRight(i)}}]),t}(Jn);var Nt={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,PI_OVER_TWO:Math.PI/2,PI_OVER_FOUR:Math.PI/4,PI_OVER_SIX:Math.PI/6,TWO_PI:Math.PI*2};q();Y();N();var Qf=X(re()),Yi=function(){function e(r){T(this,e),c(this,"index",void 0),c(this,"isVisible",void 0),c(this,"isSelected",void 0),c(this,"parent",void 0),c(this,"children",void 0),c(this,"content",void 0),c(this,"state",void 0),c(this,"layers",void 0),c(this,"id",void 0),c(this,"zoom",void 0),c(this,"userData",void 0),c(this,"boundingBox",void 0),c(this,"_abortController",void 0),c(this,"_loader",void 0),c(this,"_loaderId",void 0),c(this,"_isLoaded",void 0),c(this,"_isCancelled",void 0),c(this,"_needsReload",void 0),c(this,"_bbox",void 0),this.index=r,this.isVisible=!1,this.isSelected=!1,this.parent=null,this.children=[],this.content=null,this._loader=void 0,this._abortController=null,this._loaderId=0,this._isLoaded=!1,this._isCancelled=!1,this._needsReload=!1}return w(e,[{key:"bbox",get:function(){return this._bbox},set:function(t){this._bbox||(this._bbox=t,"west"in t?this.boundingBox=[[t.west,t.south],[t.east,t.north]]:this.boundingBox=[[t.left,t.top],[t.right,t.bottom]])}},{key:"data",get:function(){var t=this;return this.isLoading&&this._loader?this._loader.then(function(){return t.data}):this.content}},{key:"isLoaded",get:function(){return this._isLoaded&&!this._needsReload}},{key:"isLoading",get:function(){return Boolean(this._loader)&&!this._isCancelled}},{key:"needsReload",get:function(){return this._needsReload||this._isCancelled}},{key:"byteLength",get:function(){var t=this.content?this.content.byteLength:0;return Number.isFinite(t)||console.error("byteLength not defined in tile data"),t}},{key:"_loadData",value:function(){var r=I(Qf.default.mark(function n(i){var a,o,s,u,f,l,h,d,p,m,v,g,y,A;return Qf.default.wrap(function(b){for(;;)switch(b.prev=b.next){case 0:return a=i.getData,o=i.requestScheduler,s=i.onLoad,u=i.onError,f=this.index,l=this.id,h=this.bbox,d=this.userData,p=this.zoom,m=this._loaderId,this._abortController=new AbortController,v=this._abortController.signal,b.next=7,o.scheduleRequest(this,function(M){return M.isSelected?1:-1});case 7:if(g=b.sent,g){b.next=11;break}return this._isCancelled=!0,b.abrupt("return");case 11:if(!this._isCancelled){b.next=14;break}return g.done(),b.abrupt("return");case 14:return y=null,b.prev=15,b.next=18,a({index:f,id:l,bbox:h,userData:d,zoom:p,signal:v});case 18:y=b.sent,b.next=24;break;case 21:b.prev=21,b.t0=b.catch(15),A=b.t0||!0;case 24:return b.prev=24,g.done(),b.finish(24);case 27:if(m===this._loaderId){b.next=29;break}return b.abrupt("return");case 29:if(this._loader=void 0,this.content=y,!(this._isCancelled&&!y)){b.next=34;break}return this._isLoaded=!1,b.abrupt("return");case 34:this._isLoaded=!0,this._isCancelled=!1,A?u(A,this):s(this);case 37:case"end":return b.stop()}},n,this,[[15,21,24,27]])}));function t(n){return r.apply(this,arguments)}return t}()},{key:"loadData",value:function(t){return this._isLoaded=!1,this._isCancelled=!1,this._needsReload=!1,this._loaderId++,this._loader=this._loadData(t),this._loader}},{key:"setNeedsReload",value:function(){this.isLoading&&(this.abort(),this._loader=void 0),this._needsReload=!0}},{key:"abort",value:function(){var t;this.isLoaded||(this._isCancelled=!0,(t=this._abortController)===null||t===void 0||t.abort())}}]),e}();ue();ue();q();Y();N();var Qi=X(xt());var De={OUTSIDE:-1,INTERSECTING:0,INSIDE:1};q();Y();N();var Zv=new E,aw=new E,Bo=function(){function e(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[0,0,0],t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[0,0,0],n=arguments.length>2?arguments[2]:void 0;T(this,e),c(this,"center",void 0),c(this,"halfDiagonal",void 0),c(this,"minimum",void 0),c(this,"maximum",void 0),n=n||Zv.copy(r).add(t).scale(.5),this.center=new E(n),this.halfDiagonal=new E(t).subtract(this.center),this.minimum=new E(r),this.maximum=new E(t)}return w(e,[{key:"clone",value:function(){return new e(this.minimum,this.maximum,this.center)}},{key:"equals",value:function(t){return this===t||Boolean(t)&&this.minimum.equals(t.minimum)&&this.maximum.equals(t.maximum)}},{key:"transform",value:function(t){return this.center.transformAsPoint(t),this.halfDiagonal.transform(t),this.minimum.transform(t),this.maximum.transform(t),this}},{key:"intersectPlane",value:function(t){var n=this.halfDiagonal,i=aw.from(t.normal),a=n.x*Math.abs(i.x)+n.y*Math.abs(i.y)+n.z*Math.abs(i.z),o=this.center.dot(i)+t.distance;return o-a>0?De.INSIDE:o+a<0?De.OUTSIDE:De.INTERSECTING}},{key:"distanceTo",value:function(t){return Math.sqrt(this.distanceSquaredTo(t))}},{key:"distanceSquaredTo",value:function(t){var n=Zv.from(t).subtract(this.center),i=this.halfDiagonal,a=0,o;return o=Math.abs(n.x)-i.x,o>0&&(a+=o*o),o=Math.abs(n.y)-i.y,o>0&&(a+=o*o),o=Math.abs(n.z)-i.z,o>0&&(a+=o*o),a}}]),e}();q();Y();N();var Zi=new E,$v=new E,Tr=function(){function e(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[0,0,0],t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;T(this,e),c(this,"center",void 0),c(this,"radius",void 0),this.radius=-0,this.center=new E,this.fromCenterRadius(r,t)}return w(e,[{key:"fromCenterRadius",value:function(t,n){return this.center.from(t),this.radius=n,this}},{key:"fromCornerPoints",value:function(t,n){return n=Zi.from(n),this.center=new E().from(t).add(n).scale(.5),this.radius=this.center.distance(n),this}},{key:"equals",value:function(t){return this===t||Boolean(t)&&this.center.equals(t.center)&&this.radius===t.radius}},{key:"clone",value:function(){return new e(this.center,this.radius)}},{key:"union",value:function(t){var n=this.center,i=this.radius,a=t.center,o=t.radius,s=Zi.copy(a).subtract(n),u=s.magnitude();if(i>=u+o)return this.clone();if(o>=u+i)return t.clone();var f=(i+u+o)*.5;return $v.copy(s).scale((-i+f)/u).add(n),this.center.copy($v),this.radius=f,this}},{key:"expand",value:function(t){var n=Zi.from(t),i=n.subtract(this.center).magnitude();return i>this.radius&&(this.radius=i),this}},{key:"transform",value:function(t){this.center.transform(t);var n=Lm(Zi,t);return this.radius=Math.max(n[0],Math.max(n[1],n[2]))*this.radius,this}},{key:"distanceSquaredTo",value:function(t){var n=this.distanceTo(t);return n*n}},{key:"distanceTo",value:function(t){var n=Zi.from(t),i=n.subtract(this.center);return Math.max(0,i.len()-this.radius)}},{key:"intersectPlane",value:function(t){var n=this.center,i=this.radius,a=t.normal,o=a.dot(n)+t.distance;return o<-i?De.OUTSIDE:o<i?De.INTERSECTING:De.INSIDE}}]),e}();q();Y();N();var ow=new E,sw=new E,Mo=new E,Oo=new E,Po=new E,uw=new E,fw=new E,$t={COLUMN0ROW0:0,COLUMN0ROW1:1,COLUMN0ROW2:2,COLUMN1ROW0:3,COLUMN1ROW1:4,COLUMN1ROW2:5,COLUMN2ROW0:6,COLUMN2ROW1:7,COLUMN2ROW2:8},rn=function(){function e(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[0,0,0],t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[0,0,0,0,0,0,0,0,0];T(this,e),c(this,"center",void 0),c(this,"halfAxes",void 0),this.center=new E().from(r),this.halfAxes=new be(t)}return w(e,[{key:"halfSize",get:function(){var t=this.halfAxes.getColumn(0),n=this.halfAxes.getColumn(1),i=this.halfAxes.getColumn(2);return[new E(t).len(),new E(n).len(),new E(i).len()]}},{key:"quaternion",get:function(){var t=this.halfAxes.getColumn(0),n=this.halfAxes.getColumn(1),i=this.halfAxes.getColumn(2),a=new E(t).normalize(),o=new E(n).normalize(),s=new E(i).normalize();return new br().fromMatrix3(new be([].concat(K(a),K(o),K(s))))}},{key:"fromCenterHalfSizeQuaternion",value:function(t,n,i){var a=new br(i),o=new be().fromQuaternion(a);return o[0]=o[0]*n[0],o[1]=o[1]*n[0],o[2]=o[2]*n[0],o[3]=o[3]*n[1],o[4]=o[4]*n[1],o[5]=o[5]*n[1],o[6]=o[6]*n[2],o[7]=o[7]*n[2],o[8]=o[8]*n[2],this.center=new E().from(t),this.halfAxes=o,this}},{key:"clone",value:function(){return new e(this.center,this.halfAxes)}},{key:"equals",value:function(t){return this===t||Boolean(t)&&this.center.equals(t.center)&&this.halfAxes.equals(t.halfAxes)}},{key:"getBoundingSphere",value:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:new Tr,n=this.halfAxes,i=n.getColumn(0,Mo),a=n.getColumn(1,Oo),o=n.getColumn(2,Po),s=ow.copy(i).add(a).add(o);return t.center.copy(this.center),t.radius=s.magnitude(),t}},{key:"intersectPlane",value:function(t){var n=this.center,i=t.normal,a=this.halfAxes,o=i.x,s=i.y,u=i.z,f=Math.abs(o*a[$t.COLUMN0ROW0]+s*a[$t.COLUMN0ROW1]+u*a[$t.COLUMN0ROW2])+Math.abs(o*a[$t.COLUMN1ROW0]+s*a[$t.COLUMN1ROW1]+u*a[$t.COLUMN1ROW2])+Math.abs(o*a[$t.COLUMN2ROW0]+s*a[$t.COLUMN2ROW1]+u*a[$t.COLUMN2ROW2]),l=i.dot(n)+t.distance;return l<=-f?De.OUTSIDE:l>=f?De.INSIDE:De.INTERSECTING}},{key:"distanceTo",value:function(t){return Math.sqrt(this.distanceSquaredTo(t))}},{key:"distanceSquaredTo",value:function(t){var n=sw.from(t).subtract(this.center),i=this.halfAxes,a=i.getColumn(0,Mo),o=i.getColumn(1,Oo),s=i.getColumn(2,Po),u=a.magnitude(),f=o.magnitude(),l=s.magnitude();a.normalize(),o.normalize(),s.normalize();var h=0,d;return d=Math.abs(n.dot(a))-u,d>0&&(h+=d*d),d=Math.abs(n.dot(o))-f,d>0&&(h+=d*d),d=Math.abs(n.dot(s))-l,d>0&&(h+=d*d),h}},{key:"computePlaneDistances",value:function(t,n){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[-0,-0],a=Number.POSITIVE_INFINITY,o=Number.NEGATIVE_INFINITY,s=this.center,u=this.halfAxes,f=u.getColumn(0,Mo),l=u.getColumn(1,Oo),h=u.getColumn(2,Po),d=uw.copy(f).add(l).add(h).add(s),p=fw.copy(d).subtract(t),m=n.dot(p);return a=Math.min(m,a),o=Math.max(m,o),d.copy(s).add(f).add(l).subtract(h),p.copy(d).subtract(t),m=n.dot(p),a=Math.min(m,a),o=Math.max(m,o),d.copy(s).add(f).subtract(l).add(h),p.copy(d).subtract(t),m=n.dot(p),a=Math.min(m,a),o=Math.max(m,o),d.copy(s).add(f).subtract(l).subtract(h),p.copy(d).subtract(t),m=n.dot(p),a=Math.min(m,a),o=Math.max(m,o),s.copy(d).subtract(f).add(l).add(h),p.copy(d).subtract(t),m=n.dot(p),a=Math.min(m,a),o=Math.max(m,o),s.copy(d).subtract(f).add(l).subtract(h),p.copy(d).subtract(t),m=n.dot(p),a=Math.min(m,a),o=Math.max(m,o),s.copy(d).subtract(f).subtract(l).add(h),p.copy(d).subtract(t),m=n.dot(p),a=Math.min(m,a),o=Math.max(m,o),s.copy(d).subtract(f).subtract(l).subtract(h),p.copy(d).subtract(t),m=n.dot(p),a=Math.min(m,a),o=Math.max(m,o),i[0]=a,i[1]=o,i}},{key:"transform",value:function(t){this.center.transformAsPoint(t);var n=this.halfAxes.getColumn(0,Mo);n.transformAsPoint(t);var i=this.halfAxes.getColumn(1,Oo);i.transformAsPoint(t);var a=this.halfAxes.getColumn(2,Po);return a.transformAsPoint(t),this.halfAxes=new be([].concat(K(n),K(i),K(a))),this}},{key:"getTransform",value:function(){throw new Error("not implemented")}}]),e}();q();Y();N();q();Y();N();var Qv=new E,eg=new E,Ge=function(){function e(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[0,0,1],t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;T(this,e),c(this,"normal",void 0),c(this,"distance",void 0),this.normal=new E,this.distance=-0,this.fromNormalDistance(r,t)}return w(e,[{key:"fromNormalDistance",value:function(t,n){return de(Number.isFinite(n)),this.normal.from(t).normalize(),this.distance=n,this}},{key:"fromPointNormal",value:function(t,n){t=Qv.from(t),this.normal.from(n).normalize();var i=-this.normal.dot(t);return this.distance=i,this}},{key:"fromCoefficients",value:function(t,n,i,a){return this.normal.set(t,n,i),de(He(this.normal.len(),1)),this.distance=a,this}},{key:"clone",value:function(){return new e(this.normal,this.distance)}},{key:"equals",value:function(t){return He(this.distance,t.distance)&&He(this.normal,t.normal)}},{key:"getPointDistance",value:function(t){return this.normal.dot(t)+this.distance}},{key:"transform",value:function(t){var n=eg.copy(this.normal).transformAsVector(t).normalize(),i=this.normal.scale(-this.distance).transform(t);return this.fromPointNormal(i,n)}},{key:"projectPointOntoPlane",value:function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[0,0,0];t=Qv.from(t);var i=this.getPointDistance(t),a=eg.copy(this.normal).scale(i);return t.subtract(a).to(n)}}]),e}();function tg(e,r){var t=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=lw(e))||r&&e&&typeof e.length=="number"){t&&(e=t);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(f){throw f},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
19
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){t=t.call(e)},n:function(){var f=t.next();return a=f.done,f},e:function(f){o=!0,s=f},f:function(){try{!a&&t.return!=null&&t.return()}finally{if(o)throw s}}}}function lw(e,r){if(e){if(typeof e=="string")return rg(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);if(t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set")return Array.from(e);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return rg(e,r)}}function rg(e,r){(r==null||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}var ng=[new E([1,0,0]),new E([0,1,0]),new E([0,0,1])],ig=new E,cw=new E,m4=new Ge(new E(1,0,0),0),ot=function(){function e(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];T(this,e),c(this,"planes",void 0),this.planes=r}return w(e,[{key:"fromBoundingSphere",value:function(t){this.planes.length=2*ng.length;var n=t.center,i=t.radius,a=0,o=tg(ng),s;try{for(o.s();!(s=o.n()).done;){var u=s.value,f=this.planes[a],l=this.planes[a+1];f||(f=this.planes[a]=new Ge),l||(l=this.planes[a+1]=new Ge);var h=ig.copy(u).scale(-i).add(n),d=-u.dot(h);f.fromPointNormal(h,u);var p=ig.copy(u).scale(i).add(n),m=cw.copy(u).negate(),v=-m.dot(p);l.fromPointNormal(p,m),a+=2}}catch(g){o.e(g)}finally{o.f()}return this}},{key:"computeVisibility",value:function(t){var n=De.INSIDE,i=tg(this.planes),a;try{for(i.s();!(a=i.n()).done;){var o=a.value,s=t.intersectPlane(o);switch(s){case De.OUTSIDE:return De.OUTSIDE;case De.INTERSECTING:n=De.INTERSECTING;break;default:}}}catch(u){i.e(u)}finally{i.f()}return n}},{key:"computeVisibilityWithPlaneMask",value:function(t,n){if(de(Number.isFinite(n),"parentPlaneMask is required."),n===e.MASK_OUTSIDE||n===e.MASK_INSIDE)return n;for(var i=e.MASK_INSIDE,a=this.planes,o=0;o<this.planes.length;++o){var s=o<31?1<<o:0;if(!(o<31&&!(n&s))){var u=a[o],f=t.intersectPlane(u);if(f===De.OUTSIDE)return e.MASK_OUTSIDE;f===De.INTERSECTING&&(i|=s)}}return i}}]),e}();c(ot,"MASK_OUTSIDE",4294967295);c(ot,"MASK_INSIDE",0);c(ot,"MASK_INDETERMINATE",2147483647);q();Y();N();var hw=new E,dw=new E,pw=new E,mw=new E,vw=new E,el=function(){function e(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};T(this,e),c(this,"left",void 0),c(this,"_left",void 0),c(this,"right",void 0),c(this,"_right",void 0),c(this,"top",void 0),c(this,"_top",void 0),c(this,"bottom",void 0),c(this,"_bottom",void 0),c(this,"near",void 0),c(this,"_near",void 0),c(this,"far",void 0),c(this,"_far",void 0),c(this,"_cullingVolume",new ot([new Ge,new Ge,new Ge,new Ge,new Ge,new Ge])),c(this,"_perspectiveMatrix",new se),c(this,"_infinitePerspective",new se);var t=r.near,n=t===void 0?1:t,i=r.far,a=i===void 0?5e8:i;this.left=r.left,this._left=void 0,this.right=r.right,this._right=void 0,this.top=r.top,this._top=void 0,this.bottom=r.bottom,this._bottom=void 0,this.near=n,this._near=n,this.far=a,this._far=a}return w(e,[{key:"clone",value:function(){return new e({right:this.right,left:this.left,top:this.top,bottom:this.bottom,near:this.near,far:this.far})}},{key:"equals",value:function(t){return t&&t instanceof e&&this.right===t.right&&this.left===t.left&&this.top===t.top&&this.bottom===t.bottom&&this.near===t.near&&this.far===t.far}},{key:"projectionMatrix",get:function(){return this._update(),this._perspectiveMatrix}},{key:"infiniteProjectionMatrix",get:function(){return this._update(),this._infinitePerspective}},{key:"computeCullingVolume",value:function(t,n,i){de(t,"position is required."),de(n,"direction is required."),de(i,"up is required.");var a=this._cullingVolume.planes;i=hw.copy(i).normalize();var o=dw.copy(n).cross(i).normalize(),s=pw.copy(n).multiplyByScalar(this.near).add(t),u=mw.copy(n).multiplyByScalar(this.far).add(t),f=vw;return f.copy(o).multiplyByScalar(this.left).add(s).subtract(t).cross(i),a[0].fromPointNormal(t,f),f.copy(o).multiplyByScalar(this.right).add(s).subtract(t).cross(i).negate(),a[1].fromPointNormal(t,f),f.copy(i).multiplyByScalar(this.bottom).add(s).subtract(t).cross(o).negate(),a[2].fromPointNormal(t,f),f.copy(i).multiplyByScalar(this.top).add(s).subtract(t).cross(o),a[3].fromPointNormal(t,f),f=new E().copy(n),a[4].fromPointNormal(s,f),f.negate(),a[5].fromPointNormal(u,f),this._cullingVolume}},{key:"getPixelDimensions",value:function(t,n,i,a){this._update(),de(Number.isFinite(t)&&Number.isFinite(n)),de(t>0),de(n>0),de(i>0),de(a);var o=1/this.near,s=this.top*o,u=2*i*s/n;s=this.right*o;var f=2*i*s/t;return a.x=f,a.y=u,a}},{key:"_update",value:function(){de(Number.isFinite(this.right)&&Number.isFinite(this.left)&&Number.isFinite(this.top)&&Number.isFinite(this.bottom)&&Number.isFinite(this.near)&&Number.isFinite(this.far));var t=this.top,n=this.bottom,i=this.right,a=this.left,o=this.near,s=this.far;(t!==this._top||n!==this._bottom||a!==this._left||i!==this._right||o!==this._near||s!==this._far)&&(de(this.near>0&&this.near<this.far,"near must be greater than zero and less than far."),this._left=a,this._right=i,this._top=t,this._bottom=n,this._near=o,this._far=s,this._perspectiveMatrix=new se().frustum({left:a,right:i,bottom:n,top:t,near:o,far:s}),this._infinitePerspective=new se().frustum({left:a,right:i,bottom:n,top:t,near:o,far:1/0}))}}]),e}();q();Y();N();var gw=function(r){return r!==null&&typeof r<"u"},yw=function(){function e(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};T(this,e),c(this,"_offCenterFrustum",new el),c(this,"fov",void 0),c(this,"_fov",void 0),c(this,"_fovy",void 0),c(this,"_sseDenominator",void 0),c(this,"aspectRatio",void 0),c(this,"_aspectRatio",void 0),c(this,"near",void 0),c(this,"_near",void 0),c(this,"far",void 0),c(this,"_far",void 0),c(this,"xOffset",void 0),c(this,"_xOffset",void 0),c(this,"yOffset",void 0),c(this,"_yOffset",void 0);var t=r.fov,n=r.aspectRatio,i=r.near,a=i===void 0?1:i,o=r.far,s=o===void 0?5e8:o,u=r.xOffset,f=u===void 0?0:u,l=r.yOffset,h=l===void 0?0:l;this.fov=t,this.aspectRatio=n,this.near=a,this.far=s,this.xOffset=f,this.yOffset=h}return w(e,[{key:"clone",value:function(){return new e({aspectRatio:this.aspectRatio,fov:this.fov,near:this.near,far:this.far})}},{key:"equals",value:function(t){return!gw(t)||!(t instanceof e)?!1:(this._update(),t._update(),this.fov===t.fov&&this.aspectRatio===t.aspectRatio&&this.near===t.near&&this.far===t.far&&this._offCenterFrustum.equals(t._offCenterFrustum))}},{key:"projectionMatrix",get:function(){return this._update(),this._offCenterFrustum.projectionMatrix}},{key:"infiniteProjectionMatrix",get:function(){return this._update(),this._offCenterFrustum.infiniteProjectionMatrix}},{key:"fovy",get:function(){return this._update(),this._fovy}},{key:"sseDenominator",get:function(){return this._update(),this._sseDenominator}},{key:"computeCullingVolume",value:function(t,n,i){return this._update(),this._offCenterFrustum.computeCullingVolume(t,n,i)}},{key:"getPixelDimensions",value:function(t,n,i,a){return this._update(),this._offCenterFrustum.getPixelDimensions(t,n,i,a||new tn)}},{key:"_update",value:function(){de(Number.isFinite(this.fov)&&Number.isFinite(this.aspectRatio)&&Number.isFinite(this.near)&&Number.isFinite(this.far));var t=this._offCenterFrustum;(this.fov!==this._fov||this.aspectRatio!==this._aspectRatio||this.near!==this._near||this.far!==this._far||this.xOffset!==this._xOffset||this.yOffset!==this._yOffset)&&(de(this.fov>=0&&this.fov<Math.PI),de(this.aspectRatio>0),de(this.near>=0&&this.near<this.far),this._aspectRatio=this.aspectRatio,this._fov=this.fov,this._fovy=this.aspectRatio<=1?this.fov:Math.atan(Math.tan(this.fov*.5)/this.aspectRatio)*2,this._near=this.near,this._far=this.far,this._sseDenominator=2*Math.tan(.5*this._fovy),this._xOffset=this.xOffset,this._yOffset=this.yOffset,t.top=this.near*Math.tan(.5*this._fovy),t.bottom=-t.top,t.right=this.aspectRatio*t.top,t.left=-t.right,t.near=this.near,t.far=this.far,t.right+=this.xOffset,t.left+=this.xOffset,t.top+=this.yOffset,t.bottom+=this.yOffset)}}]),e}();var I4=new E,R4=new E,F4=new E,L4=new E,k4=new E,D4=new E,G4=new E,N4=new E,U4=new E,j4=new E,H4=new E,V4=new E,z4=4/3*Math.PI;var Ut=new be,Aw=new be,_w=new be,Io=new be,ag=new be;function Ro(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=Nt.EPSILON20,n=10,i=0,a=0,o=Aw,s=_w;o.identity(),s.copy(e);for(var u=t*bw(s);a<n&&Tw(s)>u;)xw(s,Io),ag.copy(Io).transpose(),s.multiplyRight(Io),s.multiplyLeft(ag),o.multiplyRight(Io),++i>2&&(++a,i=0);return r.unitary=o.toTarget(r.unitary),r.diagonal=s.toTarget(r.diagonal),r}function bw(e){for(var r=0,t=0;t<9;++t){var n=e[t];r+=n*n}return Math.sqrt(r)}var tl=[1,0,0],rl=[2,2,1];function Tw(e){for(var r=0,t=0;t<3;++t){var n=e[Ut.getElementIndex(rl[t],tl[t])];r+=2*n*n}return Math.sqrt(r)}function xw(e,r){for(var t=Nt.EPSILON15,n=0,i=1,a=0;a<3;++a){var o=Math.abs(e[Ut.getElementIndex(rl[a],tl[a])]);o>n&&(i=a,n=o)}var s=tl[i],u=rl[i],f=1,l=0;if(Math.abs(e[Ut.getElementIndex(u,s)])>t){var h=e[Ut.getElementIndex(u,u)],d=e[Ut.getElementIndex(s,s)],p=e[Ut.getElementIndex(u,s)],m=(h-d)/2/p,v;m<0?v=-1/(-m+Math.sqrt(1+m*m)):v=1/(m+Math.sqrt(1+m*m)),f=1/Math.sqrt(1+v*v),l=v*f}return be.IDENTITY.to(r),r[Ut.getElementIndex(s,s)]=r[Ut.getElementIndex(u,u)]=f,r[Ut.getElementIndex(u,s)]=l,r[Ut.getElementIndex(s,u)]=-l,r}function nl(e,r){var t=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=Ew(e))||r&&e&&typeof e.length=="number"){t&&(e=t);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(f){throw f},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
20
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){t=t.call(e)},n:function(){var f=t.next();return a=f.done,f},e:function(f){o=!0,s=f},f:function(){try{!a&&t.return!=null&&t.return()}finally{if(o)throw s}}}}function Ew(e,r){if(e){if(typeof e=="string")return og(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);if(t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set")return Array.from(e);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return og(e,r)}}function og(e,r){(r==null||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}var xr=new E,Sw=new E,ww=new E,Cw=new E,Bw=new E,Mw=new be,Ow={diagonal:new be,unitary:new be};function $i(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:new rn;if(!e||e.length===0)return r.halfAxes=new be([0,0,0,0,0,0,0,0,0]),r.center=new E,r;var t=e.length,n=new E(0,0,0),i=nl(e),a;try{for(i.s();!(a=i.n()).done;){var o=a.value;n.add(o)}}catch(V){i.e(V)}finally{i.f()}var s=1/t;n.multiplyByScalar(s);var u=0,f=0,l=0,h=0,d=0,p=0,m=nl(e),v;try{for(m.s();!(v=m.n()).done;){var g=v.value,y=xr.copy(g).subtract(n);u+=y.x*y.x,f+=y.x*y.y,l+=y.x*y.z,h+=y.y*y.y,d+=y.y*y.z,p+=y.z*y.z}}catch(V){m.e(V)}finally{m.f()}u*=s,f*=s,l*=s,h*=s,d*=s,p*=s;var A=Mw;A[0]=u,A[1]=f,A[2]=l,A[3]=f,A[4]=h,A[5]=d,A[6]=l,A[7]=d,A[8]=p;var x=Ro(A,Ow),b=x.unitary,M=r.halfAxes.copy(b),C=M.getColumn(0,ww),F=M.getColumn(1,Cw),B=M.getColumn(2,Bw),S=-Number.MAX_VALUE,_=-Number.MAX_VALUE,R=-Number.MAX_VALUE,k=Number.MAX_VALUE,U=Number.MAX_VALUE,j=Number.MAX_VALUE,Z=nl(e),P;try{for(Z.s();!(P=Z.n()).done;){var O=P.value;xr.copy(O),S=Math.max(xr.dot(C),S),_=Math.max(xr.dot(F),_),R=Math.max(xr.dot(B),R),k=Math.min(xr.dot(C),k),U=Math.min(xr.dot(F),U),j=Math.min(xr.dot(B),j)}}catch(V){Z.e(V)}finally{Z.f()}C=C.multiplyByScalar(.5*(k+S)),F=F.multiplyByScalar(.5*(U+_)),B=B.multiplyByScalar(.5*(j+R)),r.center.copy(C).add(F).add(B);var G=Sw.set(S-k,_-U,R-j).multiplyByScalar(.5),J=new be([G[0],0,0,0,G[1],0,0,0,G[2]]);return r.halfAxes.multiplyRight(J),r}function il(e,r){var t=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=Pw(e))||r&&e&&typeof e.length=="number"){t&&(e=t);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(f){throw f},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
21
21
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){t=t.call(e)},n:function(){var f=t.next();return a=f.done,f},e:function(f){o=!0,s=f},f:function(){try{!a&&t.return!=null&&t.return()}finally{if(o)throw s}}}}function Pw(e,r){if(e){if(typeof e=="string")return sg(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);if(t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set")return Array.from(e);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return sg(e,r)}}function sg(e,r){(r==null||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}var qn=512,ug=3,fg=[[.5,.5],[0,0],[0,1],[1,0],[1,1]],lg=fg.concat([[0,.5],[.5,0],[1,.5],[.5,1]]),Iw=lg.concat([[.25,.5],[.75,.5]]),Rw=function(){function e(r,t,n){T(this,e),c(this,"x",void 0),c(this,"y",void 0),c(this,"z",void 0),c(this,"childVisible",void 0),c(this,"selected",void 0),c(this,"_children",void 0),this.x=r,this.y=t,this.z=n}return w(e,[{key:"children",get:function(){if(!this._children){var t=this.x*2,n=this.y*2,i=this.z+1;this._children=[new e(t,n,i),new e(t,n+1,i),new e(t+1,n,i),new e(t+1,n+1,i)]}return this._children}},{key:"update",value:function(t){var n=t.viewport,i=t.cullingVolume,a=t.elevationBounds,o=t.minZ,s=t.maxZ,u=t.bounds,f=t.offset,l=t.project,h=this.getBoundingVolume(a,f,l);if(u&&!this.insideBounds(u))return!1;var d=i.computeVisibility(h);if(d<0)return!1;if(!this.childVisible){var p=this.z;if(p<s&&p>=o){var m=h.distanceTo(n.cameraPosition)*n.scale/n.height;p+=Math.floor(Math.log2(m))}if(p>=s)return this.selected=!0,!0}this.selected=!1,this.childVisible=!0;var v=il(this.children),g;try{for(v.s();!(g=v.n()).done;){var y=g.value;y.update(t)}}catch(A){v.e(A)}finally{v.f()}return!0}},{key:"getSelected",value:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];if(this.selected&&t.push(this),this._children){var n=il(this._children),i;try{for(n.s();!(i=n.n()).done;){var a=i.value;a.getSelected(t)}}catch(o){n.e(o)}finally{n.f()}}return t}},{key:"insideBounds",value:function(t){var n=D(t,4),i=n[0],a=n[1],o=n[2],s=n[3],u=Math.pow(2,this.z),f=qn/u;return this.x*f<o&&this.y*f<s&&(this.x+1)*f>i&&(this.y+1)*f>a}},{key:"getBoundingVolume",value:function(t,n,i){if(i){var a=this.z<1?Iw:this.z<2?lg:fg,o=[],s=il(a),u;try{for(s.s();!(u=s.n()).done;){var f=u.value,l=Fo(this.x+f[0],this.y+f[1],this.z);l[2]=t[0],o.push(i(l)),t[0]!==t[1]&&(l[2]=t[1],o.push(i(l)))}}catch(v){s.e(v)}finally{s.f()}return $i(o)}var h=Math.pow(2,this.z),d=qn/h,p=this.x*d+n*qn,m=qn-(this.y+1)*d;return new Bo([p,m,t[0]],[p+d,m+d,t[1]])}}]),e}();function cg(e,r,t,n){var i=e instanceof Qi._GlobeViewport&&e.resolution?e.projectPosition:null,a=Object.values(e.getFrustumPlanes()).map(function(M){var C=M.normal,F=M.distance;return new Ge(C.clone().negate(),F)}),o=new ot(a),s=e.distanceScales.unitsPerMeter[2],u=t&&t[0]*s||0,f=t&&t[1]*s||0,l=e instanceof Qi.WebMercatorViewport&&e.pitch<=60?r:0;if(n){var h=n,d=D(h,4),p=d[0],m=d[1],v=d[2],g=d[3],y=$e([p,g]),A=$e([v,m]);n=[y[0],qn-y[1],A[0],qn-A[1]]}var x=new Rw(0,0,0),b={viewport:e,project:i,cullingVolume:o,elevationBounds:[u,f],minZ:l,maxZ:r,bounds:n,offset:0};if(x.update(b),e instanceof Qi.WebMercatorViewport&&e.subViewports&&e.subViewports.length>1){for(b.offset=-1;x.update(b)&&!(--b.offset<-ug););for(b.offset=1;x.update(b)&&!(++b.offset>ug););}return x.getSelected()}var Qt=512,Fw=[-1/0,-1/0,1/0,1/0],Er={type:"object",value:null,validate:function(r,t){return t.optional&&r===null||typeof r=="string"||Array.isArray(r)&&r.every(function(n){return typeof n=="string"})},equal:function(r,t){if(r===t)return!0;if(!Array.isArray(r)||!Array.isArray(t))return!1;var n=r.length;if(n!==t.length)return!1;for(var i=0;i<n;i++)if(r[i]!==t[i])return!1;return!0}};function dg(e,r){var t=[r.transformAsPoint([e[0],e[1]]),r.transformAsPoint([e[2],e[1]]),r.transformAsPoint([e[0],e[3]]),r.transformAsPoint([e[2],e[3]])],n=[Math.min.apply(Math,K(t.map(function(i){return i[0]}))),Math.min.apply(Math,K(t.map(function(i){return i[1]}))),Math.max.apply(Math,K(t.map(function(i){return i[0]}))),Math.max.apply(Math,K(t.map(function(i){return i[1]})))];return n}function Lw(e){return Math.abs(e.split("").reduce(function(r,t){return(r<<5)-r+t.charCodeAt(0)|0},0))}function jt(e,r){if(!e||!e.length)return null;var t=r.index,n=r.id;if(Array.isArray(e)){var i=Lw(n)%e.length;e=e[i]}for(var a=e,o=0,s=Object.keys(t);o<s.length;o++){var u=s[o],f=new RegExp("{".concat(u,"}"),"g");a=a.replace(f,String(t[u]))}return Number.isInteger(t.y)&&Number.isInteger(t.z)&&(a=a.replace(/\{-y\}/g,String(Math.pow(2,t.z)-t.y-1))),a}function kw(e,r,t){var n;if(r&&r.length===2){var i=D(r,2),a=i[0],o=i[1],s=e.getBounds({z:a}),u=e.getBounds({z:o});n=[Math.min(s[0],u[0]),Math.min(s[1],u[1]),Math.max(s[2],u[2]),Math.max(s[3],u[3])]}else n=e.getBounds();return e.isGeospatial?[Math.max(n[0],t[0]),Math.max(n[1],t[1]),Math.min(n[2],t[2]),Math.min(n[3],t[3])]:[Math.max(Math.min(n[0],t[2]),t[0]),Math.max(Math.min(n[1],t[3]),t[1]),Math.min(Math.max(n[2],t[0]),t[2]),Math.min(Math.max(n[3],t[1]),t[3])]}function pg(e){var r=e.viewport,t=e.z,n=t===void 0?0:t,i=e.cullRect,a=r.subViewports||[r];return a.map(function(o){return al(o,n,i)})}function al(e,r,t){if(!Array.isArray(r)){var n=t.x-e.x,i=t.y-e.y,a=t.width,o=t.height,s={targetZ:r},u=e.unproject([n,i],s),f=e.unproject([n+a,i],s),l=e.unproject([n,i+o],s),h=e.unproject([n+a,i+o],s);return[Math.min(u[0],f[0],l[0],h[0]),Math.min(u[1],f[1],l[1],h[1]),Math.max(u[0],f[0],l[0],h[0]),Math.max(u[1],f[1],l[1],h[1])]}var d=al(e,r[0],t),p=al(e,r[1],t);return[Math.min(d[0],p[0]),Math.min(d[1],p[1]),Math.max(d[2],p[2]),Math.max(d[3],p[3])]}function Dw(e,r,t){if(t){var n=dg(e,t).map(function(i){return i*r/Qt});return n}return e.map(function(i){return i*r/Qt})}function ol(e,r){return Math.pow(2,e)*Qt/r}function Fo(e,r,t){var n=ol(t,Qt),i=e/n*360-180,a=Math.PI-2*Math.PI*r/n,o=180/Math.PI*Math.atan(.5*(Math.exp(a)-Math.exp(-a)));return[i,o]}function hg(e,r,t,n){var i=ol(t,n);return[e/i*Qt,r/i*Qt]}function sl(e,r,t,n){var i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:Qt;if(e.isGeospatial){var a=Fo(r,t,n),o=D(a,2),s=o[0],u=o[1],f=Fo(r+1,t+1,n),l=D(f,2),h=l[0],d=l[1];return{west:s,north:u,east:h,south:d}}var p=hg(r,t,n,i),m=D(p,2),v=m[0],g=m[1],y=hg(r+1,t+1,n,i),A=D(y,2),x=A[0],b=A[1];return{left:v,top:g,right:x,bottom:b}}function Gw(e,r,t,n,i){for(var a=kw(e,null,n),o=ol(r,t),s=Dw(a,o,i),u=D(s,4),f=u[0],l=u[1],h=u[2],d=u[3],p=[],m=Math.floor(f);m<h;m++)for(var v=Math.floor(l);v<d;v++)p.push({x:m,y:v,z:r});return p}function ul(e){var r=e.viewport,t=e.maxZoom,n=e.minZoom,i=e.zRange,a=e.extent,o=e.tileSize,s=o===void 0?Qt:o,u=e.modelMatrix,f=e.modelMatrixInverse,l=e.zoomOffset,h=l===void 0?0:l,d=r.isGeospatial?Math.round(r.zoom+Math.log2(Qt/s))+h:Math.ceil(r.zoom)+h;if(typeof n=="number"&&Number.isFinite(n)&&d<n){if(!a)return[];d=n}typeof t=="number"&&Number.isFinite(t)&&d>t&&(d=t);var p=a;return u&&f&&a&&!r.isGeospatial&&(p=dg(a,u)),r.isGeospatial?cg(r,d,i,a):Gw(r,d,s,p||Fw,f)}function fl(e){return/(?=.*{z})(?=.*{x})(?=.*({y}|{-y}))/.test(e)}function ll(e){return Number.isFinite(e.west)&&Number.isFinite(e.north)&&Number.isFinite(e.east)&&Number.isFinite(e.south)}function mg(e){var r={},t;return function(n){for(var i in n)if(!Nw(n[i],r[i])){t=e(n),r=n;break}return t}}function Nw(e,r){if(e===r)return!0;if(Array.isArray(e)){var t=e.length;if(!r||r.length!==t)return!1;for(var n=0;n<t;n++)if(e[n]!==r[n])return!1;return!0}return!1}var ea;function ze(e,r){var t=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=Uw(e))||r&&e&&typeof e.length=="number"){t&&(e=t);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(f){throw f},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
22
22
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){t=t.call(e)},n:function(){var f=t.next();return a=f.done,f},e:function(f){o=!0,s=f},f:function(){try{!a&&t.return!=null&&t.return()}finally{if(o)throw s}}}}function Uw(e,r){if(e){if(typeof e=="string")return vg(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);if(t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set")return Array.from(e);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return vg(e,r)}}function vg(e,r){(r==null||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function gg(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),t.push.apply(t,n)}return t}function yg(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{};r%2?gg(Object(t),!0).forEach(function(n){c(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):gg(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}var Ag=1,Lo=2,jw="never",Hw="no-overlap",ta="best-available",Vw=5,zw=(ea={},c(ea,ta,Jw),c(ea,Hw,Xw),c(ea,jw,function(){}),ea),Ww={extent:null,tileSize:512,maxZoom:null,minZoom:null,maxCacheSize:null,maxCacheByteSize:null,refinementStrategy:"best-available",zRange:null,maxRequests:6,zoomOffset:0,onTileLoad:function(){},onTileUnload:function(){},onTileError:function(){}},ra=function(){function e(r){var t=this;T(this,e),c(this,"opts",void 0),c(this,"_requestScheduler",void 0),c(this,"_cache",void 0),c(this,"_dirty",void 0),c(this,"_tiles",void 0),c(this,"_cacheByteSize",void 0),c(this,"_viewport",void 0),c(this,"_zRange",void 0),c(this,"_selectedTiles",void 0),c(this,"_frameNumber",void 0),c(this,"_modelMatrix",void 0),c(this,"_modelMatrixInverse",void 0),c(this,"_maxZoom",void 0),c(this,"_minZoom",void 0),c(this,"onTileLoad",void 0),c(this,"_getCullBounds",mg(pg)),this.opts=yg(yg({},Ww),r),this.onTileLoad=function(n){var i,a;(i=(a=t.opts).onTileLoad)===null||i===void 0||i.call(a,n),t.opts.maxCacheByteSize&&(t._cacheByteSize+=n.byteLength,t._resizeCache())},this._requestScheduler=new Ri({maxRequests:r.maxRequests,throttleRequests:Boolean(r.maxRequests&&r.maxRequests>0)}),this._cache=new Map,this._tiles=[],this._dirty=!1,this._cacheByteSize=0,this._viewport=null,this._selectedTiles=null,this._frameNumber=0,this._modelMatrix=new se,this._modelMatrixInverse=new se,this.setOptions(r)}return w(e,[{key:"tiles",get:function(){return this._tiles}},{key:"selectedTiles",get:function(){return this._selectedTiles}},{key:"isLoaded",get:function(){return this._selectedTiles!==null&&this._selectedTiles.every(function(t){return t.isLoaded})}},{key:"needsReload",get:function(){return this._selectedTiles!==null&&this._selectedTiles.some(function(t){return t.needsReload})}},{key:"setOptions",value:function(t){Object.assign(this.opts,t),Number.isFinite(t.maxZoom)&&(this._maxZoom=Math.floor(t.maxZoom)),Number.isFinite(t.minZoom)&&(this._minZoom=Math.ceil(t.minZoom))}},{key:"finalize",value:function(){var t=ze(this._cache.values()),n;try{for(t.s();!(n=t.n()).done;){var i=n.value;i.isLoading&&i.abort()}}catch(a){t.e(a)}finally{t.f()}this._cache.clear(),this._tiles=[],this._selectedTiles=null}},{key:"reloadAll",value:function(){var t=ze(this._cache.keys()),n;try{for(t.s();!(n=t.n()).done;){var i=n.value,a=this._cache.get(i);!this._selectedTiles||!this._selectedTiles.includes(a)?this._cache.delete(i):a.setNeedsReload()}}catch(o){t.e(o)}finally{t.f()}}},{key:"update",value:function(t){var n=this,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=i.zRange,o=i.modelMatrix,s=new se(o),u=!s.equals(this._modelMatrix);if(!this._viewport||!t.equals(this._viewport)||!He(this._zRange,a)||u){u&&(this._modelMatrixInverse=s.clone().invert(),this._modelMatrix=s),this._viewport=t,this._zRange=a;var f=this.getTileIndices({viewport:t,maxZoom:this._maxZoom,minZoom:this._minZoom,zRange:a,modelMatrix:this._modelMatrix,modelMatrixInverse:this._modelMatrixInverse});this._selectedTiles=f.map(function(h){return n._getTile(h,!0)}),this._dirty&&this._rebuildTree()}else this.needsReload&&(this._selectedTiles=this._selectedTiles.map(function(h){return n._getTile(h.index,!0)}));var l=this.updateTileStates();return this._pruneRequests(),this._dirty&&this._resizeCache(),l&&this._frameNumber++,this._frameNumber}},{key:"isTileVisible",value:function(t,n){if(!t.isVisible)return!1;if(n&&this._viewport){var i=this._getCullBounds({viewport:this._viewport,z:this._zRange,cullRect:n}),a=t.bbox,o=ze(i),s;try{for(o.s();!(s=o.n()).done;){var u=D(s.value,4),f=u[0],l=u[1],h=u[2],d=u[3],p=void 0;if("west"in a)p=a.west<h&&a.east>f&&a.south<d&&a.north>l;else{var m=Math.min(a.top,a.bottom),v=Math.max(a.top,a.bottom);p=a.left<h&&a.right>f&&m<d&&v>l}if(p)return!0}}catch(g){o.e(g)}finally{o.f()}return!1}return!0}},{key:"getTileIndices",value:function(t){var n=t.viewport,i=t.maxZoom,a=t.minZoom,o=t.zRange,s=t.modelMatrix,u=t.modelMatrixInverse,f=this.opts,l=f.tileSize,h=f.extent,d=f.zoomOffset;return ul({viewport:n,maxZoom:i,minZoom:a,zRange:o,tileSize:l,extent:h,modelMatrix:s,modelMatrixInverse:u,zoomOffset:d})}},{key:"getTileId",value:function(t){return"".concat(t.x,"-").concat(t.y,"-").concat(t.z)}},{key:"getTileZoom",value:function(t){return t.z}},{key:"getTileMetadata",value:function(t){var n=this.opts.tileSize;return{bbox:sl(this._viewport,t.x,t.y,t.z,n)}}},{key:"getParentIndex",value:function(t){var n=Math.floor(t.x/2),i=Math.floor(t.y/2),a=t.z-1;return{x:n,y:i,z:a}}},{key:"updateTileStates",value:function(){var t=this.opts.refinementStrategy||ta,n=new Array(this._cache.size),i=0,a=ze(this._cache.values()),o;try{for(a.s();!(o=a.n()).done;){var s=o.value;n[i++]=s.isVisible,s.isSelected=!1,s.isVisible=!1}}catch(m){a.e(m)}finally{a.f()}var u=ze(this._selectedTiles),f;try{for(u.s();!(f=u.n()).done;){var l=f.value;l.isSelected=!0,l.isVisible=!0}}catch(m){u.e(m)}finally{u.f()}(typeof t=="function"?t:zw[t])(Array.from(this._cache.values())),i=0;var h=ze(this._cache.values()),d;try{for(h.s();!(d=h.n()).done;){var p=d.value;if(n[i++]!==p.isVisible)return!0}}catch(m){h.e(m)}finally{h.f()}return!1}},{key:"_pruneRequests",value:function(){var t=this.opts.maxRequests,n=t===void 0?0:t,i=[],a=0,o=ze(this._cache.values()),s;try{for(o.s();!(s=o.n()).done;){var u=s.value;u.isLoading&&(a++,!u.isSelected&&!u.isVisible&&i.push(u))}}catch(l){o.e(l)}finally{o.f()}for(;n>0&&a>n&&i.length>0;){var f=i.shift();f.abort(),a--}}},{key:"_rebuildTree",value:function(){var t=this._cache,n=ze(t.values()),i;try{for(n.s();!(i=n.n()).done;){var a=i.value;a.parent=null,a.children&&(a.children.length=0)}}catch(l){n.e(l)}finally{n.f()}var o=ze(t.values()),s;try{for(o.s();!(s=o.n()).done;){var u=s.value,f=this._getNearestAncestor(u);u.parent=f,f!=null&&f.children&&f.children.push(u)}}catch(l){o.e(l)}finally{o.f()}}},{key:"_resizeCache",value:function(){var t=this._cache,n=this.opts,i=n.maxCacheSize||(n.maxCacheByteSize?1/0:Vw*this.selectedTiles.length),a=n.maxCacheByteSize||1/0,o=t.size>i||this._cacheByteSize>a;if(o){var s=ze(t),u;try{for(s.s();!(u=s.n()).done;){var f=D(u.value,2),l=f[0],h=f[1];if(!h.isVisible&&!h.isSelected){var d,p;this._cacheByteSize-=n.maxCacheByteSize?h.byteLength:0,t.delete(l),(d=(p=this.opts).onTileUnload)===null||d===void 0||d.call(p,h)}if(t.size<=i&&this._cacheByteSize<=a)break}}catch(m){s.e(m)}finally{s.f()}this._rebuildTree(),this._dirty=!0}this._dirty&&(this._tiles=Array.from(this._cache.values()).sort(function(m,v){return m.zoom-v.zoom}),this._dirty=!1)}},{key:"_getTile",value:function(t,n){var i=this.getTileId(t),a=this._cache.get(i),o=!1;return!a&&n?(a=new Yi(t),Object.assign(a,this.getTileMetadata(a.index)),Object.assign(a,{id:i,zoom:this.getTileZoom(a.index)}),o=!0,this._cache.set(i,a),this._dirty=!0):a&&a.needsReload&&(o=!0),a&&o&&a.loadData({getData:this.opts.getTileData,requestScheduler:this._requestScheduler,onLoad:this.onTileLoad,onError:this.opts.onTileError}),a}},{key:"_getNearestAncestor",value:function(t){for(var n=this._minZoom,i=n===void 0?0:n,a=t.index;this.getTileZoom(a)>i;){a=this.getParentIndex(a);var o=this._getTile(a);if(o)return o}return null}}]),e}();function Jw(e){var r=ze(e),t;try{for(r.s();!(t=r.n()).done;){var n=t.value;n.state=0}}catch(l){r.e(l)}finally{r.f()}var i=ze(e),a;try{for(i.s();!(a=i.n()).done;){var o=a.value;o.isSelected&&!_g(o)&&cl(o)}}catch(l){i.e(l)}finally{i.f()}var s=ze(e),u;try{for(s.s();!(u=s.n()).done;){var f=u.value;f.isVisible=Boolean(f.state&Lo)}}catch(l){s.e(l)}finally{s.f()}}function Xw(e){var r=ze(e),t;try{for(r.s();!(t=r.n()).done;){var n=t.value;n.state=0}}catch(m){r.e(m)}finally{r.f()}var i=ze(e),a;try{for(i.s();!(a=i.n()).done;){var o=a.value;o.isSelected&&_g(o)}}catch(m){i.e(m)}finally{i.f()}var s=Array.from(e).sort(function(m,v){return m.zoom-v.zoom}),u=ze(s),f;try{for(u.s();!(f=u.n()).done;){var l=f.value;if(l.isVisible=Boolean(l.state&Lo),l.children&&(l.isVisible||l.state&Ag)){var h=ze(l.children),d;try{for(h.s();!(d=h.n()).done;){var p=d.value;p.state=Ag}}catch(m){h.e(m)}finally{h.f()}}else l.isSelected&&cl(l)}}catch(m){u.e(m)}finally{u.f()}}function _g(e){for(var r=e;r;){if(r.isLoaded||r.content)return r.state|=Lo,!0;r=r.parent}return!1}function cl(e){var r=ze(e.children),t;try{for(r.s();!(t=r.n()).done;){var n=t.value;n.isLoaded||n.content?n.state|=Lo:cl(n)}}catch(i){r.e(i)}finally{r.f()}}function bg(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),t.push.apply(t,n)}return t}function ko(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{};r%2?bg(Object(t),!0).forEach(function(n){c(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):bg(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}function qw(e,r){var t=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=Kw(e))||r&&e&&typeof e.length=="number"){t&&(e=t);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(f){throw f},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
23
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){t=t.call(e)},n:function(){var f=t.next();return a=f.done,f},e:function(f){o=!0,s=f},f:function(){try{!a&&t.return!=null&&t.return()}finally{if(o)throw s}}}}function Kw(e,r){if(e){if(typeof e=="string")return Tg(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);if(t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set")return Array.from(e);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return Tg(e,r)}}function Tg(e,r){(r==null||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function Yw(e){var r=Zw();return function(){var n=L(e),i;if(r){var a=L(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return $(this,i)}}function Zw(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var $w={TilesetClass:ra,data:{type:"data",value:[]},dataComparator:Er.equal,renderSubLayers:{type:"function",value:function(r){return new xg.GeoJsonLayer(r)}},getTileData:{type:"function",optional:!0,value:null},onViewportLoad:{type:"function",optional:!0,value:null},onTileLoad:{type:"function",value:function(r){}},onTileUnload:{type:"function",value:function(r){}},onTileError:{type:"function",value:function(r){return console.error(r)}},extent:{type:"array",optional:!0,value:null,compare:!0},tileSize:512,maxZoom:null,minZoom:0,maxCacheSize:null,maxCacheByteSize:null,refinementStrategy:ta,zRange:null,maxRequests:6,zoomOffset:0},er=function(e){H(t,e);var r=Yw(t);function t(){return T(this,t),r.apply(this,arguments)}return w(t,[{key:"initializeState",value:function(){this.state={tileset:null,isLoaded:!1}}},{key:"finalizeState",value:function(){var i,a;(i=this.state)===null||i===void 0||(a=i.tileset)===null||a===void 0||a.finalize()}},{key:"isLoaded",get:function(){var i,a,o;return(i=this.state)===null||i===void 0||(a=i.tileset)===null||a===void 0||(o=a.selectedTiles)===null||o===void 0?void 0:o.every(function(s){return s.isLoaded&&s.layers&&s.layers.every(function(u){return u.isLoaded})})}},{key:"shouldUpdateState",value:function(i){var a=i.changeFlags;return a.somethingChanged}},{key:"updateState",value:function(i){var a=i.changeFlags,o=this.state.tileset,s=a.propsOrDataChanged||a.updateTriggersChanged,u=a.dataChanged||a.updateTriggersChanged&&(a.updateTriggersChanged.all||a.updateTriggersChanged.getTileData);o?s&&(o.setOptions(this._getTilesetOptions()),u?o.reloadAll():this.state.tileset.tiles.forEach(function(f){f.layers=null})):(o=new this.props.TilesetClass(this._getTilesetOptions()),this.setState({tileset:o})),this._updateTileset()}},{key:"_getTilesetOptions",value:function(){var i=this.props,a=i.tileSize,o=i.maxCacheSize,s=i.maxCacheByteSize,u=i.refinementStrategy,f=i.extent,l=i.maxZoom,h=i.minZoom,d=i.maxRequests,p=i.zoomOffset;return{maxCacheSize:o,maxCacheByteSize:s,maxZoom:l,minZoom:h,tileSize:a,refinementStrategy:u,extent:f,maxRequests:d,zoomOffset:p,getTileData:this.getTileData.bind(this),onTileLoad:this._onTileLoad.bind(this),onTileError:this._onTileError.bind(this),onTileUnload:this._onTileUnload.bind(this)}}},{key:"_updateTileset",value:function(){var i=this.state.tileset,a=this.props,o=a.zRange,s=a.modelMatrix,u=i.update(this.context.viewport,{zRange:o,modelMatrix:s}),f=i.isLoaded,l=this.state.isLoaded!==f,h=this.state.frameNumber!==u;f&&(l||h)&&this._onViewportLoad(),h&&this.setState({frameNumber:u}),this.state.isLoaded=f}},{key:"_onViewportLoad",value:function(){var i=this.state.tileset,a=this.props.onViewportLoad;a&&a(i.selectedTiles)}},{key:"_onTileLoad",value:function(i){this.props.onTileLoad(i),i.layers=null,this.setNeedsUpdate()}},{key:"_onTileError",value:function(i,a){this.props.onTileError(i),a.layers=null,this.setNeedsUpdate()}},{key:"_onTileUnload",value:function(i){this.props.onTileUnload(i)}},{key:"getTileData",value:function(i){var a=this.props,o=a.data,s=a.getTileData,u=a.fetch,f=i.signal;return i.url=typeof o=="string"||Array.isArray(o)?jt(o,i):null,s?s(i):u&&i.url?u(i.url,{propName:"data",layer:this,signal:f}):null}},{key:"renderSubLayers",value:function(i){return this.props.renderSubLayers(i)}},{key:"getSubLayerPropsByTile",value:function(i){return null}},{key:"getPickingInfo",value:function(i){var a=i.info,o=i.sourceLayer,s=o.props.tile;return a.picked&&(a.tile=s),a.sourceTile=s,a}},{key:"_updateAutoHighlight",value:function(i){var a=i.sourceTile;if(a&&a.layers){var o=qw(a.layers),s;try{for(o.s();!(s=o.n()).done;){var u=s.value;u.updateAutoHighlight(i)}}catch(f){o.e(f)}finally{o.f()}}}},{key:"renderLayers",value:function(){var i=this;return this.state.tileset.tiles.map(function(a){var o=i.getSubLayerPropsByTile(a);if(!(!a.isLoaded&&!a.content))if(a.layers)o&&a.layers[0]&&Object.keys(o).some(function(u){return a.layers[0].props[u]!==o[u]})&&(a.layers=a.layers.map(function(u){return u.clone(o)}));else{var s=i.renderSubLayers(ko(ko(ko({},i.props),i.getSubLayerProps({id:a.id,updateTriggers:i.props.updateTriggers})),{},{data:a.content,_offset:0,tile:a}));a.layers=(0,Do._flatten)(s,Boolean).map(function(u){return u.clone(ko({tile:a},o))})}return a.layers})}},{key:"filterSubLayer",value:function(i){var a=i.layer,o=i.cullRect,s=a.props.tile;return this.state.tileset.isTileVisible(s,o)}}]),t}(Do.CompositeLayer);c(er,"defaultProps",$w);c(er,"layerName","TileLayer");q();Y();N();var wg=X(Tt());function Eg(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),t.push.apply(t,n)}return t}function Sg(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{};r%2?Eg(Object(t),!0).forEach(function(n){c(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Eg(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}function Qw(e){var r=eC();return function(){var n=L(e),i;if(r){var a=L(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return $(this,i)}}function eC(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var tC={fadeTrail:!0,trailLength:{type:"number",value:120,min:0},currentTime:{type:"number",value:0,min:0},getTimestamps:{type:"accessor",value:function(r){return r.timestamps}}},Go=function(e){H(t,e);var r=Qw(t);function t(){return T(this,t),r.apply(this,arguments)}return w(t,[{key:"getShaders",value:function(){var i=
|
|
23
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){t=t.call(e)},n:function(){var f=t.next();return a=f.done,f},e:function(f){o=!0,s=f},f:function(){try{!a&&t.return!=null&&t.return()}finally{if(o)throw s}}}}function Kw(e,r){if(e){if(typeof e=="string")return Tg(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);if(t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set")return Array.from(e);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return Tg(e,r)}}function Tg(e,r){(r==null||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function Yw(e){var r=Zw();return function(){var n=L(e),i;if(r){var a=L(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return $(this,i)}}function Zw(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var $w={TilesetClass:ra,data:{type:"data",value:[]},dataComparator:Er.equal,renderSubLayers:{type:"function",value:function(r){return new xg.GeoJsonLayer(r)}},getTileData:{type:"function",optional:!0,value:null},onViewportLoad:{type:"function",optional:!0,value:null},onTileLoad:{type:"function",value:function(r){}},onTileUnload:{type:"function",value:function(r){}},onTileError:{type:"function",value:function(r){return console.error(r)}},extent:{type:"array",optional:!0,value:null,compare:!0},tileSize:512,maxZoom:null,minZoom:0,maxCacheSize:null,maxCacheByteSize:null,refinementStrategy:ta,zRange:null,maxRequests:6,zoomOffset:0},er=function(e){H(t,e);var r=Yw(t);function t(){return T(this,t),r.apply(this,arguments)}return w(t,[{key:"initializeState",value:function(){this.state={tileset:null,isLoaded:!1}}},{key:"finalizeState",value:function(){var i,a;(i=this.state)===null||i===void 0||(a=i.tileset)===null||a===void 0||a.finalize()}},{key:"isLoaded",get:function(){var i,a,o;return(i=this.state)===null||i===void 0||(a=i.tileset)===null||a===void 0||(o=a.selectedTiles)===null||o===void 0?void 0:o.every(function(s){return s.isLoaded&&s.layers&&s.layers.every(function(u){return u.isLoaded})})}},{key:"shouldUpdateState",value:function(i){var a=i.changeFlags;return a.somethingChanged}},{key:"updateState",value:function(i){var a=i.changeFlags,o=this.state.tileset,s=a.propsOrDataChanged||a.updateTriggersChanged,u=a.dataChanged||a.updateTriggersChanged&&(a.updateTriggersChanged.all||a.updateTriggersChanged.getTileData);o?s&&(o.setOptions(this._getTilesetOptions()),u?o.reloadAll():this.state.tileset.tiles.forEach(function(f){f.layers=null})):(o=new this.props.TilesetClass(this._getTilesetOptions()),this.setState({tileset:o})),this._updateTileset()}},{key:"_getTilesetOptions",value:function(){var i=this.props,a=i.tileSize,o=i.maxCacheSize,s=i.maxCacheByteSize,u=i.refinementStrategy,f=i.extent,l=i.maxZoom,h=i.minZoom,d=i.maxRequests,p=i.zoomOffset;return{maxCacheSize:o,maxCacheByteSize:s,maxZoom:l,minZoom:h,tileSize:a,refinementStrategy:u,extent:f,maxRequests:d,zoomOffset:p,getTileData:this.getTileData.bind(this),onTileLoad:this._onTileLoad.bind(this),onTileError:this._onTileError.bind(this),onTileUnload:this._onTileUnload.bind(this)}}},{key:"_updateTileset",value:function(){var i=this.state.tileset,a=this.props,o=a.zRange,s=a.modelMatrix,u=i.update(this.context.viewport,{zRange:o,modelMatrix:s}),f=i.isLoaded,l=this.state.isLoaded!==f,h=this.state.frameNumber!==u;f&&(l||h)&&this._onViewportLoad(),h&&this.setState({frameNumber:u}),this.state.isLoaded=f}},{key:"_onViewportLoad",value:function(){var i=this.state.tileset,a=this.props.onViewportLoad;a&&a(i.selectedTiles)}},{key:"_onTileLoad",value:function(i){this.props.onTileLoad(i),i.layers=null,this.setNeedsUpdate()}},{key:"_onTileError",value:function(i,a){this.props.onTileError(i),a.layers=null,this.setNeedsUpdate()}},{key:"_onTileUnload",value:function(i){this.props.onTileUnload(i)}},{key:"getTileData",value:function(i){var a=this.props,o=a.data,s=a.getTileData,u=a.fetch,f=i.signal;return i.url=typeof o=="string"||Array.isArray(o)?jt(o,i):null,s?s(i):u&&i.url?u(i.url,{propName:"data",layer:this,signal:f}):null}},{key:"renderSubLayers",value:function(i){return this.props.renderSubLayers(i)}},{key:"getSubLayerPropsByTile",value:function(i){return null}},{key:"getPickingInfo",value:function(i){var a=i.info,o=i.sourceLayer,s=o.props.tile;return a.picked&&(a.tile=s),a.sourceTile=s,a}},{key:"_updateAutoHighlight",value:function(i){var a=i.sourceTile;if(a&&a.layers){var o=qw(a.layers),s;try{for(o.s();!(s=o.n()).done;){var u=s.value;u.updateAutoHighlight(i)}}catch(f){o.e(f)}finally{o.f()}}}},{key:"renderLayers",value:function(){var i=this;return this.state.tileset.tiles.map(function(a){var o=i.getSubLayerPropsByTile(a);if(!(!a.isLoaded&&!a.content))if(a.layers)o&&a.layers[0]&&Object.keys(o).some(function(u){return a.layers[0].props[u]!==o[u]})&&(a.layers=a.layers.map(function(u){return u.clone(o)}));else{var s=i.renderSubLayers(ko(ko(ko({},i.props),i.getSubLayerProps({id:a.id,updateTriggers:i.props.updateTriggers})),{},{data:a.content,_offset:0,tile:a}));a.layers=(0,Do._flatten)(s,Boolean).map(function(u){return u.clone(ko({tile:a},o))})}return a.layers})}},{key:"filterSubLayer",value:function(i){var a=i.layer,o=i.cullRect,s=a.props.tile;return this.state.tileset.isTileVisible(s,o)}}]),t}(Do.CompositeLayer);c(er,"defaultProps",$w);c(er,"layerName","TileLayer");q();Y();N();var wg=X(Tt());function Eg(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),t.push.apply(t,n)}return t}function Sg(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{};r%2?Eg(Object(t),!0).forEach(function(n){c(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Eg(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}function Qw(e){var r=eC();return function(){var n=L(e),i;if(r){var a=L(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return $(this,i)}}function eC(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var tC={fadeTrail:!0,trailLength:{type:"number",value:120,min:0},currentTime:{type:"number",value:0,min:0},getTimestamps:{type:"accessor",value:function(r){return r.timestamps}}},Go=function(e){H(t,e);var r=Qw(t);function t(){return T(this,t),r.apply(this,arguments)}return w(t,[{key:"getShaders",value:function(){var i=_e(L(t.prototype),"getShaders",this).call(this);return i.inject={"vs:#decl":`uniform float trailLength;
|
|
24
24
|
attribute float instanceTimestamps;
|
|
25
25
|
attribute float instanceNextTimestamps;
|
|
26
26
|
varying float vTime;
|
|
@@ -35,16 +35,16 @@ varying float vTime;
|
|
|
35
35
|
`,"fs:DECKGL_FILTER_COLOR":`if(fadeTrail) {
|
|
36
36
|
color.a *= 1.0 - (currentTime - vTime) / trailLength;
|
|
37
37
|
}
|
|
38
|
-
`},i}},{key:"initializeState",value:function(){
|
|
38
|
+
`},i}},{key:"initializeState",value:function(){_e(L(t.prototype),"initializeState",this).call(this);var i=this.getAttributeManager();i.addInstanced({timestamps:{size:1,accessor:"getTimestamps",shaderAttributes:{instanceTimestamps:{vertexOffset:0},instanceNextTimestamps:{vertexOffset:1}}}})}},{key:"draw",value:function(i){var a=this.props,o=a.fadeTrail,s=a.trailLength,u=a.currentTime;i.uniforms=Sg(Sg({},i.uniforms),{},{fadeTrail:o,trailLength:s,currentTime:u}),_e(L(t.prototype),"draw",this).call(this,i)}}]),t}(wg.PathLayer);c(Go,"layerName","TripsLayer");c(Go,"defaultProps",tC);q();Y();N();var Fg=X(hl()),Lg=X(xt());q();Y();N();Le();ue();var qe=X(hl());var Uo=X(xt()),na=X(Tt());function rC(e){var r=nC();return function(){var n=L(e),i;if(r){var a=L(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return $(this,i)}}function nC(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Bg(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),t.push.apply(t,n)}return t}function No(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{};r%2?Bg(Object(t),!0).forEach(function(n){c(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Bg(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}function dl(e,r){var t=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=iC(e))||r&&e&&typeof e.length=="number"){t&&(e=t);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(f){throw f},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
39
39
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){t=t.call(e)},n:function(){var f=t.next();return a=f.done,f},e:function(f){o=!0,s=f},f:function(){try{!a&&t.return!=null&&t.return()}finally{if(o)throw s}}}}function iC(e,r){if(e){if(typeof e=="string")return Mg(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);if(t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set")return Array.from(e);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return Mg(e,r)}}function Mg(e,r){(r==null||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}var aC=10;function Pg(e,r){r=r===void 0?e[0][0]:r;var t=dl(e),n;try{for(t.s();!(n=t.n()).done;){var i=n.value,a=i[0]-r;a>180?i[0]-=360:a<-180&&(i[0]+=360)}}catch(o){t.e(o)}finally{t.f()}}function oC(e,r,t){var n=(0,qe.h3ToGeo)(e),i=D(n,2),a=i[0],o=i[1],s=r.length;Pg(r,o);for(var u=r[0]===r[s-1]?s-1:s,f=0;f<u;f++)r[f][0]=Ar(o,r[f][0],t),r[f][1]=Ar(a,r[f][1],t)}function sC(e,r,t){var n=e(r,t),i=(0,qe.h3ToGeo)(n),a=D(i,2),o=a[0],s=a[1];return[s,o]}function Og(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,t=(0,qe.h3ToGeoBoundary)(e,!0);return r!==1?oC(e,t,r):Pg(t),t}function uC(e){var r=new Float64Array(e.length*2),t=0,n=dl(e),i;try{for(n.s();!(i=n.n()).done;){var a=i.value;r[t++]=a[0],r[t++]=a[1]}}catch(o){n.e(o)}finally{n.f()}return r}function fC(e,r){var t;return e==null?t=r:te(e)==="object"?t=No(No({},e),{},{coverage:r}):t={getHexagon:e,coverage:r},t}var lC=No(No({},na.PolygonLayer.defaultProps),{},{highPrecision:"auto",coverage:{type:"number",min:0,max:1,value:1},centerHexagon:null,getHexagon:{type:"accessor",value:function(r){return r.hexagon}},extruded:!0}),nn=function(e){H(t,e);var r=rC(t);function t(){var n;T(this,t);for(var i=arguments.length,a=new Array(i),o=0;o<i;o++)a[o]=arguments[o];return n=r.call.apply(r,[this].concat(a)),c(oe(n),"state",void 0),n}return w(t,[{key:"initializeState",value:function(){t._checkH3Lib(),this.state={edgeLengthKM:0,resolution:-1}}},{key:"shouldUpdateState",value:function(i){var a=i.changeFlags;return this._shouldUseHighPrecision()?a.propsOrDataChanged:a.somethingChanged}},{key:"updateState",value:function(i){var a=i.props,o=i.changeFlags;if(a.highPrecision!==!0&&(o.dataChanged||o.updateTriggersChanged&&o.updateTriggersChanged.getHexagon)){var s=this._calculateH3DataProps();this.setState(s)}this._updateVertices(this.context.viewport)}},{key:"_calculateH3DataProps",value:function(){var i=-1,a=!1,o=!1,s=(0,Uo.createIterable)(this.props.data),u=s.iterable,f=s.objectInfo,l=dl(u),h;try{for(l.s();!(h=l.n()).done;){var d=h.value;f.index++;var p=this.props.getHexagon(d,f),m=(0,qe.h3GetResolution)(p);if(i<0){if(i=m,!this.props.highPrecision)break}else if(i!==m){o=!0;break}if((0,qe.h3IsPentagon)(p)){a=!0;break}}}catch(v){l.e(v)}finally{l.f()}return{resolution:i,edgeLengthKM:i>=0?(0,qe.edgeLength)(i,"km"):0,hasMultipleRes:o,hasPentagon:a}}},{key:"_shouldUseHighPrecision",value:function(){if(this.props.highPrecision==="auto"){var i=this.state,a=i.resolution,o=i.hasPentagon,s=i.hasMultipleRes,u=this.context.viewport;return Boolean(u?.resolution)||s||o||a>=0&&a<=5}return this.props.highPrecision}},{key:"_updateVertices",value:function(i){if(!this._shouldUseHighPrecision()){var a=this.state,o=a.resolution,s=a.edgeLengthKM,u=a.centerHex;if(!(o<0)){var f=this.props.centerHexagon||(0,qe.geoToH3)(i.latitude,i.longitude,o);if(u!==f){if(u){var l=(0,qe.h3Distance)(u,f);if(l>=0&&l*s<aC)return}var h=i.distanceScales.unitsPerMeter,d=Og(f),p=(0,qe.h3ToGeo)(f),m=D(p,2),v=m[0],g=m[1],y=i.projectFlat([g,v]),A=D(y,2),x=A[0],b=A[1];d=d.map(function(M){var C=i.projectFlat(M);return[(C[0]-x)/h[0],(C[1]-b)/h[1]]}),this.setState({centerHex:f,vertices:d})}}}}},{key:"renderLayers",value:function(){return this._shouldUseHighPrecision()?this._renderPolygonLayer():this._renderColumnLayer()}},{key:"_getForwardProps",value:function(){var i=this.props,a=i.elevationScale,o=i.material,s=i.coverage,u=i.extruded,f=i.wireframe,l=i.stroked,h=i.filled,d=i.lineWidthUnits,p=i.lineWidthScale,m=i.lineWidthMinPixels,v=i.lineWidthMaxPixels,g=i.getFillColor,y=i.getElevation,A=i.getLineColor,x=i.getLineWidth,b=i.transitions,M=i.updateTriggers;return{elevationScale:a,extruded:u,coverage:s,wireframe:f,stroked:l,filled:h,lineWidthUnits:d,lineWidthScale:p,lineWidthMinPixels:m,lineWidthMaxPixels:v,material:o,getElevation:y,getFillColor:g,getLineColor:A,getLineWidth:x,transitions:b,updateTriggers:{getFillColor:M.getFillColor,getElevation:M.getElevation,getLineColor:M.getLineColor,getLineWidth:M.getLineWidth}}}},{key:"_renderPolygonLayer",value:function(){var i=this.props,a=i.data,o=i.getHexagon,s=i.updateTriggers,u=i.coverage,f=this.getSubLayerClass("hexagon-cell-hifi",na.PolygonLayer),l=this._getForwardProps();return l.updateTriggers.getPolygon=fC(s.getHexagon,u),new f(l,this.getSubLayerProps({id:"hexagon-cell-hifi",updateTriggers:l.updateTriggers}),{data:a,_normalize:!1,_windingOrder:"CCW",positionFormat:"XY",getPolygon:function(d,p){var m=o(d,p);return uC(Og(m,u))}})}},{key:"_renderColumnLayer",value:function(){var i=this.props,a=i.data,o=i.getHexagon,s=i.updateTriggers,u=this.getSubLayerClass("hexagon-cell",na.ColumnLayer),f=this._getForwardProps();return f.updateTriggers.getPosition=s.getHexagon,new u(f,this.getSubLayerProps({id:"hexagon-cell",flatShading:!0,updateTriggers:f.updateTriggers}),{data:a,diskResolution:6,radius:1,vertices:this.state.vertices,getPosition:sC.bind(null,o)})}}]),t}(Uo.CompositeLayer);c(nn,"defaultProps",lC);c(nn,"layerName","H3HexagonLayer");c(nn,"_checkH3Lib",function(){});function Ig(e,r){var t=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=cC(e))||r&&e&&typeof e.length=="number"){t&&(e=t);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(f){throw f},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
40
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){t=t.call(e)},n:function(){var f=t.next();return a=f.done,f},e:function(f){o=!0,s=f},f:function(){try{!a&&t.return!=null&&t.return()}finally{if(o)throw s}}}}function cC(e,r){if(e){if(typeof e=="string")return Rg(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);if(t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set")return Array.from(e);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return Rg(e,r)}}function Rg(e,r){(r==null||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function hC(e){var r=dC();return function(){var n=L(e),i;if(r){var a=L(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return $(this,i)}}function dC(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var pC={getHexagons:{type:"accessor",value:function(r){return r.hexagons}}},jo=function(e){H(t,e);var r=hC(t);function t(){return T(this,t),r.apply(this,arguments)}return w(t,[{key:"initializeState",value:function(){nn._checkH3Lib()}},{key:"updateState",value:function(i){var a=i.props,o=i.changeFlags;if(o.dataChanged||o.updateTriggersChanged&&o.updateTriggersChanged.getHexagons){var s=a.data,u=a.getHexagons,f=[],l=(0,Lg.createIterable)(s),h=l.iterable,d=l.objectInfo,p=Ig(h),m;try{for(p.s();!(m=p.n()).done;){var v=m.value;d.index++;var g=u(v,d),y=(0,Fg.h3SetToMultiPolygon)(g,!0),A=Ig(y),x;try{for(A.s();!(x=A.n()).done;){var b=x.value;f.push(this.getSubLayerRow({polygon:b},v,d.index))}}catch(M){A.e(M)}finally{A.f()}}}catch(M){p.e(M)}finally{p.f()}this.setState({polygons:f})}}},{key:"indexToBounds",value:function(){var i=this.props,a=i.getElevation,o=i.getFillColor,s=i.getLineColor,u=i.getLineWidth;return{data:this.state.polygons,getPolygon:function(l){return l.polygon},getElevation:this.getSubLayerAccessor(a),getFillColor:this.getSubLayerAccessor(o),getLineColor:this.getSubLayerAccessor(s),getLineWidth:this.getSubLayerAccessor(u)}}}]),t}(mt);c(jo,"layerName","H3ClusterLayer");c(jo,"defaultProps",pC);q();Y();N();var ld=X(re()),M_=X(pl()),Gr=X(xt()),O_=X(Tt()),P_=X(Ho());q();Y();N();Le();N();q();Y();N();Le();Le();function ml(e){if(typeof window<"u"&&te(window.process)==="object"&&window.process.type==="renderer"||typeof process<"u"&&te(process.versions)==="object"&&Boolean(process.versions.electron))return!0;var r=(typeof navigator>"u"?"undefined":te(navigator))==="object"&&typeof navigator.userAgent=="string"&&navigator.userAgent,t=e||r;return!!(t&&t.indexOf("Electron")>=0)}function et(){var e=(typeof process>"u"?"undefined":te(process))==="object"&&String(process)==="[object process]"&&!process.browser;return!e||ml()}Le();var Sr={self:typeof self<"u"&&self,window:typeof window<"u"&&window,global:typeof global<"u"&&global,document:typeof document<"u"&&document,process:(typeof process>"u"?"undefined":te(process))==="object"&&process};var mC=Sr.self||Sr.window||Sr.global,Kn=Sr.window||Sr.self||Sr.global,vC=Sr.document||{},an=Sr.process||{};var Vo="8.9.
|
|
40
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){t=t.call(e)},n:function(){var f=t.next();return a=f.done,f},e:function(f){o=!0,s=f},f:function(){try{!a&&t.return!=null&&t.return()}finally{if(o)throw s}}}}function cC(e,r){if(e){if(typeof e=="string")return Rg(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);if(t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set")return Array.from(e);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return Rg(e,r)}}function Rg(e,r){(r==null||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function hC(e){var r=dC();return function(){var n=L(e),i;if(r){var a=L(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return $(this,i)}}function dC(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var pC={getHexagons:{type:"accessor",value:function(r){return r.hexagons}}},jo=function(e){H(t,e);var r=hC(t);function t(){return T(this,t),r.apply(this,arguments)}return w(t,[{key:"initializeState",value:function(){nn._checkH3Lib()}},{key:"updateState",value:function(i){var a=i.props,o=i.changeFlags;if(o.dataChanged||o.updateTriggersChanged&&o.updateTriggersChanged.getHexagons){var s=a.data,u=a.getHexagons,f=[],l=(0,Lg.createIterable)(s),h=l.iterable,d=l.objectInfo,p=Ig(h),m;try{for(p.s();!(m=p.n()).done;){var v=m.value;d.index++;var g=u(v,d),y=(0,Fg.h3SetToMultiPolygon)(g,!0),A=Ig(y),x;try{for(A.s();!(x=A.n()).done;){var b=x.value;f.push(this.getSubLayerRow({polygon:b},v,d.index))}}catch(M){A.e(M)}finally{A.f()}}}catch(M){p.e(M)}finally{p.f()}this.setState({polygons:f})}}},{key:"indexToBounds",value:function(){var i=this.props,a=i.getElevation,o=i.getFillColor,s=i.getLineColor,u=i.getLineWidth;return{data:this.state.polygons,getPolygon:function(l){return l.polygon},getElevation:this.getSubLayerAccessor(a),getFillColor:this.getSubLayerAccessor(o),getLineColor:this.getSubLayerAccessor(s),getLineWidth:this.getSubLayerAccessor(u)}}}]),t}(mt);c(jo,"layerName","H3ClusterLayer");c(jo,"defaultProps",pC);q();Y();N();var ld=X(re()),M_=X(pl()),Gr=X(xt()),O_=X(Tt()),P_=X(Ho());q();Y();N();Le();N();q();Y();N();Le();Le();function ml(e){if(typeof window<"u"&&te(window.process)==="object"&&window.process.type==="renderer"||typeof process<"u"&&te(process.versions)==="object"&&Boolean(process.versions.electron))return!0;var r=(typeof navigator>"u"?"undefined":te(navigator))==="object"&&typeof navigator.userAgent=="string"&&navigator.userAgent,t=e||r;return!!(t&&t.indexOf("Electron")>=0)}function et(){var e=(typeof process>"u"?"undefined":te(process))==="object"&&String(process)==="[object process]"&&!process.browser;return!e||ml()}Le();var Sr={self:typeof self<"u"&&self,window:typeof window<"u"&&window,global:typeof global<"u"&&global,document:typeof document<"u"&&document,process:(typeof process>"u"?"undefined":te(process))==="object"&&process};var mC=Sr.self||Sr.window||Sr.global,Kn=Sr.window||Sr.self||Sr.global,vC=Sr.document||{},an=Sr.process||{};var Vo="8.9.34",Fj=et();q();Y();N();function gC(e){try{var r=window[e],t="__storage_test__";return r.setItem(t,t),r.removeItem(t),r}catch{return null}}var Gg=function(){function e(r){T(this,e);var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"sessionStorage";c(this,"storage",void 0),c(this,"id",void 0),c(this,"config",{}),this.storage=gC(n),this.id=r,this.config={},Object.assign(this.config,t),this._loadConfiguration()}return w(e,[{key:"getConfiguration",value:function(){return this.config}},{key:"setConfiguration",value:function(t){return this.config={},this.updateConfiguration(t)}},{key:"updateConfiguration",value:function(t){if(Object.assign(this.config,t),this.storage){var n=JSON.stringify(this.config);this.storage.setItem(this.id,n)}return this}},{key:"_loadConfiguration",value:function(){var t={};if(this.storage){var n=this.storage.getItem(this.id);t=n?JSON.parse(n):{}}return Object.assign(this.config,t),this}}]),e}();function Ng(e){var r;return e<10?r="".concat(e.toFixed(2),"ms"):e<100?r="".concat(e.toFixed(1),"ms"):e<1e3?r="".concat(e.toFixed(0),"ms"):r="".concat((e/1e3).toFixed(2),"s"),r}function Ug(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:8,t=Math.max(r-e.length,0);return"".concat(" ".repeat(t)).concat(e)}function zo(e,r,t){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:600,i=e.src.replace(/\(/g,"%28").replace(/\)/g,"%29");e.width>n&&(t=Math.min(t,n/e.width));var a=e.width*t,o=e.height*t,s=["font-size:1px;","padding:".concat(Math.floor(o/2),"px ").concat(Math.floor(a/2),"px;"),"line-height:".concat(o,"px;"),"background:url(".concat(i,");"),"background-size:".concat(a,"px ").concat(o,"px;"),"color:transparent;"].join("");return["".concat(r," %c+"),s]}var Wo;(function(e){e[e.BLACK=30]="BLACK",e[e.RED=31]="RED",e[e.GREEN=32]="GREEN",e[e.YELLOW=33]="YELLOW",e[e.BLUE=34]="BLUE",e[e.MAGENTA=35]="MAGENTA",e[e.CYAN=36]="CYAN",e[e.WHITE=37]="WHITE",e[e.BRIGHT_BLACK=90]="BRIGHT_BLACK",e[e.BRIGHT_RED=91]="BRIGHT_RED",e[e.BRIGHT_GREEN=92]="BRIGHT_GREEN",e[e.BRIGHT_YELLOW=93]="BRIGHT_YELLOW",e[e.BRIGHT_BLUE=94]="BRIGHT_BLUE",e[e.BRIGHT_MAGENTA=95]="BRIGHT_MAGENTA",e[e.BRIGHT_CYAN=96]="BRIGHT_CYAN",e[e.BRIGHT_WHITE=97]="BRIGHT_WHITE"})(Wo||(Wo={}));function jg(e){return typeof e=="string"?Wo[e.toUpperCase()]||Wo.WHITE:e}function Hg(e,r,t){return!et&&typeof e=="string"&&(r&&(r=jg(r),e="\x1B[".concat(r,"m").concat(e,"\x1B[39m")),t&&(r=jg(t),e="\x1B[".concat(t+10,"m").concat(e,"\x1B[49m"))),e}function yC(e,r){var t=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=AC(e))||r&&e&&typeof e.length=="number"){t&&(e=t);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(f){throw f},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
41
41
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){t=t.call(e)},n:function(){var f=t.next();return a=f.done,f},e:function(f){o=!0,s=f},f:function(){try{!a&&t.return!=null&&t.return()}finally{if(o)throw s}}}}function AC(e,r){if(e){if(typeof e=="string")return Vg(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);if(t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set")return Array.from(e);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return Vg(e,r)}}function Vg(e,r){(r==null||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function zg(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:["constructor"],t=Object.getPrototypeOf(e),n=Object.getOwnPropertyNames(t),i=yC(n),a;try{var o=function(){var u=a.value;typeof e[u]=="function"&&(r.find(function(f){return u===f})||(e[u]=e[u].bind(e)))};for(i.s();!(a=i.n()).done;)o()}catch(s){i.e(s)}finally{i.f()}}function Yn(e,r){if(!e)throw new Error(r||"Assertion failed")}function on(){var e;if(et&&"performance"in Kn){var r,t;e=Kn===null||Kn===void 0||(r=Kn.performance)===null||r===void 0||(t=r.now)===null||t===void 0?void 0:t.call(r)}else if("hrtime"in an){var n,i=an===null||an===void 0||(n=an.hrtime)===null||n===void 0?void 0:n.call(an);e=i[0]*1e3+i[1]/1e6}else e=Date.now();return e}var Zn={debug:et&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},_C={enabled:!0,level:0};function vt(){}var Wg={},Jg={once:!0},$n=function(){function e(){T(this,e);var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{id:""},t=r.id;c(this,"id",void 0),c(this,"VERSION",Vo),c(this,"_startTs",on()),c(this,"_deltaTs",on()),c(this,"_storage",void 0),c(this,"userData",{}),c(this,"LOG_THROTTLE_TIMEOUT",0),this.id=t,this._storage=new Gg("__probe-".concat(this.id,"__"),_C),this.userData={},this.timeStamp("".concat(this.id," started")),zg(this),Object.seal(this)}return w(e,[{key:"level",get:function(){return this.getLevel()},set:function(t){this.setLevel(t)}},{key:"isEnabled",value:function(){return this._storage.config.enabled}},{key:"getLevel",value:function(){return this._storage.config.level}},{key:"getTotal",value:function(){return Number((on()-this._startTs).toPrecision(10))}},{key:"getDelta",value:function(){return Number((on()-this._deltaTs).toPrecision(10))}},{key:"priority",get:function(){return this.level},set:function(t){this.level=t}},{key:"getPriority",value:function(){return this.level}},{key:"enable",value:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;return this._storage.updateConfiguration({enabled:t}),this}},{key:"setLevel",value:function(t){return this._storage.updateConfiguration({level:t}),this}},{key:"get",value:function(t){return this._storage.config[t]}},{key:"set",value:function(t,n){this._storage.updateConfiguration(c({},t,n))}},{key:"settings",value:function(){console.table?console.table(this._storage.config):console.log(this._storage.config)}},{key:"assert",value:function(t,n){Yn(t,n)}},{key:"warn",value:function(t){return this._getLogFunction(0,t,Zn.warn,arguments,Jg)}},{key:"error",value:function(t){return this._getLogFunction(0,t,Zn.error,arguments)}},{key:"deprecated",value:function(t,n){return this.warn("`".concat(t,"` is deprecated and will be removed in a later version. Use `").concat(n,"` instead"))}},{key:"removed",value:function(t,n){return this.error("`".concat(t,"` has been removed. Use `").concat(n,"` instead"))}},{key:"probe",value:function(t,n){return this._getLogFunction(t,n,Zn.log,arguments,{time:!0,once:!0})}},{key:"log",value:function(t,n){return this._getLogFunction(t,n,Zn.debug,arguments)}},{key:"info",value:function(t,n){return this._getLogFunction(t,n,console.info,arguments)}},{key:"once",value:function(t,n){for(var i=arguments.length,a=new Array(i>2?i-2:0),o=2;o<i;o++)a[o-2]=arguments[o];return this._getLogFunction(t,n,Zn.debug||Zn.info,arguments,Jg)}},{key:"table",value:function(t,n,i){return n?this._getLogFunction(t,n,console.table||vt,i&&[i],{tag:EC(n)}):vt}},{key:"image",value:function(t){var n=t.logLevel,i=t.priority,a=t.image,o=t.message,s=o===void 0?"":o,u=t.scale,f=u===void 0?1:u;return this._shouldLog(n||i)?et?xC({image:a,message:s,scale:f}):TC({image:a,message:s,scale:f}):vt}},{key:"time",value:function(t,n){return this._getLogFunction(t,n,console.time?console.time:console.info)}},{key:"timeEnd",value:function(t,n){return this._getLogFunction(t,n,console.timeEnd?console.timeEnd:console.info)}},{key:"timeStamp",value:function(t,n){return this._getLogFunction(t,n,console.timeStamp||vt)}},{key:"group",value:function(t,n){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{collapsed:!1},a=Xg({logLevel:t,message:n,opts:i}),o=i.collapsed;return a.method=(o?console.groupCollapsed:console.group)||console.info,this._getLogFunction(a)}},{key:"groupCollapsed",value:function(t,n){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.group(t,n,Object.assign({},i,{collapsed:!0}))}},{key:"groupEnd",value:function(t){return this._getLogFunction(t,"",console.groupEnd||vt)}},{key:"withGroup",value:function(t,n,i){this.group(t,n)();try{i()}finally{this.groupEnd(t)()}}},{key:"trace",value:function(){console.trace&&console.trace()}},{key:"_shouldLog",value:function(t){return this.isEnabled()&&this.getLevel()>=qg(t)}},{key:"_getLogFunction",value:function(t,n,i,a,o){if(this._shouldLog(t)){var s;o=Xg({logLevel:t,message:n,args:a,opts:o}),i=i||o.method,Yn(i),o.total=this.getTotal(),o.delta=this.getDelta(),this._deltaTs=on();var u=o.tag||o.message;if(o.once)if(!Wg[u])Wg[u]=on();else return vt;return n=bC(this.id,o.message,o),(s=i).bind.apply(s,[console,n].concat(K(o.args)))}return vt}}]),e}();c($n,"VERSION",Vo);function qg(e){if(!e)return 0;var r;switch(te(e)){case"number":r=e;break;case"object":r=e.logLevel||e.priority||0;break;default:return 0}return Yn(Number.isFinite(r)&&r>=0),r}function Xg(e){var r=e.logLevel,t=e.message;e.logLevel=qg(r);for(var n=e.args?Array.from(e.args):[];n.length&&n.shift()!==t;);switch(te(r)){case"string":case"function":t!==void 0&&n.unshift(t),e.message=r;break;case"object":Object.assign(e,r);break;default:}typeof e.message=="function"&&(e.message=e.message());var i=te(e.message);return Yn(i==="string"||i==="object"),Object.assign(e,{args:n},e.opts)}function bC(e,r,t){if(typeof r=="string"){var n=t.time?Ug(Ng(t.total)):"";r=t.time?"".concat(e,": ").concat(n," ").concat(r):"".concat(e,": ").concat(r),r=Hg(r,t.color,t.background)}return r}function TC(e){var r=e.image,t=e.message,n=t===void 0?"":t,i=e.scale,a=i===void 0?1:i,o=null;try{o=module.require("asciify-image")}catch{}return o?function(){return o(r,{fit:"box",width:"".concat(Math.round(80*a),"%")}).then(function(s){return console.log(s)})}:vt}function xC(e){var r=e.image,t=e.message,n=t===void 0?"":t,i=e.scale,a=i===void 0?1:i;if(typeof r=="string"){var o=new Image;return o.onload=function(){var l,h=zo(o,n,a);(l=console).log.apply(l,K(h))},o.src=r,vt}var s=r.nodeName||"";if(s.toLowerCase()==="img"){var u;return(u=console).log.apply(u,K(zo(r,n,a))),vt}if(s.toLowerCase()==="canvas"){var f=new Image;return f.onload=function(){var l;return(l=console).log.apply(l,K(zo(f,n,a)))},f.src=r.toDataURL(),vt}return vt}function EC(e){for(var r in e)for(var t in e[r])return t||"untitled";return"empty"}var mH=new $n({id:"@probe.gl/log"});var he=new $n({id:"luma.gl"});function Ue(e,r){if(!e)throw new Error(r||"luma.gl: assertion failed.")}var SC="Invalid WebGLRenderingContext";var wC="Requires WebGL2";function Jo(e){return typeof WebGLRenderingContext<"u"&&e instanceof WebGLRenderingContext||typeof WebGL2RenderingContext<"u"&&e instanceof WebGL2RenderingContext?!0:Boolean(e&&Number.isFinite(e._version))}function pe(e){return typeof WebGL2RenderingContext<"u"&&e instanceof WebGL2RenderingContext?!0:Boolean(e&&e._version===2)}function vl(e){return pe(e)?e:null}function ia(e){return Ue(Jo(e),SC),e}function We(e){return Ue(pe(e),wC),e}var aa={};function CC(e){globalThis.console&&globalThis.console.error&&globalThis.console.error(e)}function BC(e){globalThis.console&&globalThis.console.log&&globalThis.console.log(e)}function MC(e,r){aa[e]=!0,r!==void 0&&CC(r)}function OC(e){var r=e.getError;e.getError=function(){var n;do n=r.apply(e),n!==0&&(aa[n]=!0);while(n!==0);for(n in aa)if(aa[n])return delete aa[n],parseInt(n,10);return 0}}var oa=function e(r){var t=r.gl;this.ext=r,this.isAlive=!0,this.hasBeenBound=!1,this.elementArrayBuffer=null,this.attribs=new Array(r.maxVertexAttribs);for(var n=0;n<this.attribs.length;n++){var i=new e.VertexAttrib(t);this.attribs[n]=i}this.maxAttrib=0};oa.VertexAttrib=function(r){this.enabled=!1,this.buffer=null,this.size=4,this.type=5126,this.normalized=!1,this.stride=16,this.offset=0,this.cached="",this.recache()};oa.VertexAttrib.prototype.recache=function(){this.cached=[this.size,this.type,this.normalized,this.stride,this.offset].join(":")};var sn=function(r){var t=this;this.gl=r,OC(r);var n=this.original={getParameter:r.getParameter,enableVertexAttribArray:r.enableVertexAttribArray,disableVertexAttribArray:r.disableVertexAttribArray,bindBuffer:r.bindBuffer,getVertexAttrib:r.getVertexAttrib,vertexAttribPointer:r.vertexAttribPointer};r.getParameter=function(a){return a===t.VERTEX_ARRAY_BINDING_OES?t.currentVertexArrayObject===t.defaultVertexArrayObject?null:t.currentVertexArrayObject:n.getParameter.apply(this,arguments)},r.enableVertexAttribArray=function(a){var o=t.currentVertexArrayObject;o.maxAttrib=Math.max(o.maxAttrib,a);var s=o.attribs[a];return s.enabled=!0,n.enableVertexAttribArray.apply(this,arguments)},r.disableVertexAttribArray=function(a){var o=t.currentVertexArrayObject;o.maxAttrib=Math.max(o.maxAttrib,a);var s=o.attribs[a];return s.enabled=!1,n.disableVertexAttribArray.apply(this,arguments)},r.bindBuffer=function(a,o){switch(a){case 34962:t.currentArrayBuffer=o;break;case 34963:t.currentVertexArrayObject.elementArrayBuffer=o;break;default:}return n.bindBuffer.apply(this,arguments)},r.getVertexAttrib=function(a,o){var s=t.currentVertexArrayObject,u=s.attribs[a];switch(o){case 34975:return u.buffer;case 34338:return u.enabled;case 34339:return u.size;case 34340:return u.stride;case 34341:return u.type;case 34922:return u.normalized;default:return n.getVertexAttrib.apply(this,arguments)}},r.vertexAttribPointer=function(a,o,s,u,f,l){var h=t.currentVertexArrayObject;h.maxAttrib=Math.max(h.maxAttrib,a);var d=h.attribs[a];return d.buffer=t.currentArrayBuffer,d.size=o,d.type=s,d.normalized=u,d.stride=f,d.offset=l,d.recache(),n.vertexAttribPointer.apply(this,arguments)},r.instrumentExtension&&r.instrumentExtension(this,"OES_vertex_array_object"),r.canvas&&r.canvas.addEventListener("webglcontextrestored",function(){BC("OESVertexArrayObject emulation library context restored"),t.reset_()},!0),this.reset_()};sn.prototype.VERTEX_ARRAY_BINDING_OES=34229;sn.prototype.reset_=function(){var r=this.vertexArrayObjects!==void 0;if(r)for(var t=0;t<this.vertexArrayObjects.length;++t)this.vertexArrayObjects.isAlive=!1;var n=this.gl;this.maxVertexAttribs=n.getParameter(34921),this.defaultVertexArrayObject=new oa(this),this.currentVertexArrayObject=null,this.currentArrayBuffer=null,this.vertexArrayObjects=[this.defaultVertexArrayObject],this.bindVertexArrayOES(null)};sn.prototype.createVertexArrayOES=function(){var r=new oa(this);return this.vertexArrayObjects.push(r),r};sn.prototype.deleteVertexArrayOES=function(r){r.isAlive=!1,this.vertexArrayObjects.splice(this.vertexArrayObjects.indexOf(r),1),this.currentVertexArrayObject===r&&this.bindVertexArrayOES(null)};sn.prototype.isVertexArrayOES=function(r){return!!(r&&r instanceof oa&&r.hasBeenBound&&r.ext===this)};sn.prototype.bindVertexArrayOES=function(r){var t=this.gl;if(r&&!r.isAlive){MC(1282,"bindVertexArrayOES: attempt to bind deleted arrayObject");return}var n=this.original,i=this.currentVertexArrayObject;this.currentVertexArrayObject=r||this.defaultVertexArrayObject,this.currentVertexArrayObject.hasBeenBound=!0;var a=this.currentVertexArrayObject;if(i!==a){(!i||a.elementArrayBuffer!==i.elementArrayBuffer)&&n.bindBuffer.call(t,34963,a.elementArrayBuffer);for(var o=this.currentArrayBuffer,s=Math.max(i?i.maxAttrib:0,a.maxAttrib),u=0;u<=s;u++){var f=a.attribs[u],l=i?i.attribs[u]:null;if((!i||f.enabled!==l.enabled)&&(f.enabled?n.enableVertexAttribArray.call(t,u):n.disableVertexAttribArray.call(t,u)),f.enabled){var h=!1;(!i||f.buffer!==l.buffer)&&(o!==f.buffer&&(n.bindBuffer.call(t,34962,f.buffer),o=f.buffer),h=!0),(h||f.cached!==l.cached)&&n.vertexAttribPointer.call(t,u,f.size,f.type,f.normalized,f.stride,f.offset)}}this.currentArrayBuffer!==o&&n.bindBuffer.call(t,34962,this.currentArrayBuffer)}};function Kg(e){if(typeof e.createVertexArray!="function"){var r=e.getSupportedExtensions;e.getSupportedExtensions=function(){var i=r.call(this)||[];return i.indexOf("OES_vertex_array_object")<0&&i.push("OES_vertex_array_object"),i};var t=e.getExtension;e.getExtension=function(i){var a=t.call(this,i);return a||(i!=="OES_vertex_array_object"?null:(e.__OESVertexArrayObject||(this.__OESVertexArrayObject=new sn(this)),this.__OESVertexArrayObject))}}}N();N();var fe,Yg="OES_element_index",Zg="WEBGL_draw_buffers",PC="EXT_disjoint_timer_query",IC="EXT_disjoint_timer_query_webgl2",RC="EXT_texture_filter_anisotropic",$g="WEBGL_debug_renderer_info",FC=35723,LC=4352,kC=36795,DC=34047,GC=37445,NC=37446,Ee=function(r){return pe(r)?void 0:0},UC=(fe={},c(fe,3074,function(r){return pe(r)?void 0:36064}),c(fe,FC,function(e){return pe(e)?void 0:LC}),c(fe,35977,Ee),c(fe,32937,Ee),c(fe,kC,function(e,r){var t=pe(e)?e.getExtension(IC):e.getExtension(PC);return t&&t.GPU_DISJOINT_EXT?r(t.GPU_DISJOINT_EXT):0}),c(fe,GC,function(e,r){var t=e.getExtension($g);return r(t&&t.UNMASKED_VENDOR_WEBGL||7936)}),c(fe,NC,function(e,r){var t=e.getExtension($g);return r(t&&t.UNMASKED_RENDERER_WEBGL||7937)}),c(fe,DC,function(e,r){var t=e.luma.extensions[RC];return t?r(t.MAX_TEXTURE_MAX_ANISOTROPY_EXT):1}),c(fe,32883,Ee),c(fe,35071,Ee),c(fe,37447,Ee),c(fe,36063,function(r,t){if(!pe(r)){var n=r.getExtension(Zg);return n?t(n.MAX_COLOR_ATTACHMENTS_WEBGL):0}}),c(fe,35379,Ee),c(fe,35374,Ee),c(fe,35377,Ee),c(fe,34852,function(r){if(!pe(r)){var t=r.getExtension(Zg);return t?t.MAX_DRAW_BUFFERS_WEBGL:0}}),c(fe,36203,function(r){return r.getExtension(Yg)?2147483647:65535}),c(fe,33001,function(r){return r.getExtension(Yg)?16777216:65535}),c(fe,33e3,function(r){return 16777216}),c(fe,37157,Ee),c(fe,35373,Ee),c(fe,35657,Ee),c(fe,36183,Ee),c(fe,37137,Ee),c(fe,34045,Ee),c(fe,35978,Ee),c(fe,35979,Ee),c(fe,35968,Ee),c(fe,35376,Ee),c(fe,35375,Ee),c(fe,35659,Ee),c(fe,37154,Ee),c(fe,35371,Ee),c(fe,35658,Ee),c(fe,35076,Ee),c(fe,35077,Ee),c(fe,35380,Ee),fe);function Qg(e,r,t){var n=UC[t],i=typeof n=="function"?n(e,r,t):n,a=i!==void 0?i:r(t);return a}var Qn,jC="OES_vertex_array_object",ey="ANGLE_instanced_arrays",HC="WEBGL_draw_buffers",VC="EXT_disjoint_timer_query",zC="EXT_texture_filter_anisotropic",WC="VertexArray requires WebGL2 or OES_vertex_array_object extension";function JC(e,r){return{webgl2:pe(e),ext:e.getExtension(r)}}var gl=(Qn={},c(Qn,jC,{meta:{suffix:"OES"},createVertexArray:function(){Ue(!1,WC)},deleteVertexArray:function(){},bindVertexArray:function(){},isVertexArray:function(){return!1}}),c(Qn,ey,{meta:{suffix:"ANGLE"},vertexAttribDivisor:function(r,t){Ue(t===0,"WebGL instanced rendering not supported")},drawElementsInstanced:function(){},drawArraysInstanced:function(){}}),c(Qn,HC,{meta:{suffix:"WEBGL"},drawBuffers:function(){Ue(!1)}}),c(Qn,VC,{meta:{suffix:"EXT"},createQuery:function(){Ue(!1)},deleteQuery:function(){Ue(!1)},beginQuery:function(){Ue(!1)},endQuery:function(){},getQuery:function(r,t){return this.getQueryObject(r,t)},getQueryParameter:function(r,t){return this.getQueryObject(r,t)},getQueryObject:function(){}}),Qn),Xo={readBuffer:function(r,t,n){pe(r)&&t(n)},getVertexAttrib:function(r,t,n,i){var a=JC(r,ey),o=a.webgl2,s=a.ext,u;switch(i){case 35069:u=o?void 0:!1;break;case 35070:u=!o&&!s?0:void 0;break;default:}return u!==void 0?u:t(n,i)},getProgramParameter:function(r,t,n,i){if(!pe(r))switch(i){case 35967:return 35981;case 35971:return 0;case 35382:return 0;default:}return t(n,i)},getInternalformatParameter:function(r,t,n,i,a){if(!pe(r))switch(a){case 32937:return new Int32Array([0]);default:}return r.getInternalformatParameter(n,i,a)},getTexParameter:function(r,t,n,i){switch(i){case 34046:var a=r.luma.extensions,o=a[zC];i=o&&o.TEXTURE_MAX_ANISOTROPY_EXT||34046;break;default:}return t(n,i)},getParameter:Qg,hint:function(r,t,n,i){return t(n,i)}};function ry(e,r){var t=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=XC(e))||r&&e&&typeof e.length=="number"){t&&(e=t);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(f){throw f},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
42
42
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){t=t.call(e)},n:function(){var f=t.next();return a=f.done,f},e:function(f){o=!0,s=f},f:function(){try{!a&&t.return!=null&&t.return()}finally{if(o)throw s}}}}function XC(e,r){if(e){if(typeof e=="string")return ty(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);if(t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set")return Array.from(e);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return ty(e,r)}}function ty(e,r){(r==null||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function ny(e){e.luma=e.luma||{};var r=e.luma;return r.polyfilled||(Kg(e),qC(e),YC(e,gl),KC(e,{target:r,target2:e}),r.polyfilled=!0),e}globalThis.polyfillContext=ny;function qC(e){e.luma.extensions={};var r=e.getSupportedExtensions()||[],t=ry(r),n;try{for(t.s();!(n=t.n()).done;){var i=n.value;e.luma[i]=e.getExtension(i)}}catch(a){t.e(a)}finally{t.f()}}function KC(e,r){var t=r.target,n=r.target2;Object.keys(Xo).forEach(function(i){if(typeof Xo[i]=="function"){var a=e[i]?e[i].bind(e):function(){},o=Xo[i].bind(null,e,a);t[i]=o,n[i]=o}})}function YC(e,r){var t=ry(Object.getOwnPropertyNames(r)),n;try{for(t.s();!(n=t.n()).done;){var i=n.value;i!=="overrides"&&ZC(e,{extension:i,target:e.luma,target2:e})}}catch(a){t.e(a)}finally{t.f()}}function ZC(e,r){var t=r.extension,n=r.target,i=r.target2,a=gl[t];Ue(a);for(var o=a.meta,s=o===void 0?{}:o,u=s.suffix,f=u===void 0?"":u,l=e.getExtension(t),h=function(){var v=p[d],g="".concat(v).concat(f),y=null;v==="meta"||typeof e[v]=="function"||(l&&typeof l[g]=="function"?y=function(){return l[g].apply(l,arguments)}:typeof a[v]=="function"&&(y=a[v].bind(n))),y&&(n[v]=y,i[v]=y)},d=0,p=Object.keys(a);d<p.length;d++)h()}ue();N();var Q,z,gt,qo=(Q={},c(Q,3042,!1),c(Q,32773,new Float32Array([0,0,0,0])),c(Q,32777,32774),c(Q,34877,32774),c(Q,32969,1),c(Q,32968,0),c(Q,32971,1),c(Q,32970,0),c(Q,3106,new Float32Array([0,0,0,0])),c(Q,3107,[!0,!0,!0,!0]),c(Q,2884,!1),c(Q,2885,1029),c(Q,2929,!1),c(Q,2931,1),c(Q,2932,513),c(Q,2928,new Float32Array([0,1])),c(Q,2930,!0),c(Q,3024,!0),c(Q,36006,null),c(Q,2886,2305),c(Q,33170,4352),c(Q,2849,1),c(Q,32823,!1),c(Q,32824,0),c(Q,10752,0),c(Q,32938,1),c(Q,32939,!1),c(Q,3089,!1),c(Q,3088,new Int32Array([0,0,1024,1024])),c(Q,2960,!1),c(Q,2961,0),c(Q,2968,4294967295),c(Q,36005,4294967295),c(Q,2962,519),c(Q,2967,0),c(Q,2963,4294967295),c(Q,34816,519),c(Q,36003,0),c(Q,36004,4294967295),c(Q,2964,7680),c(Q,2965,7680),c(Q,2966,7680),c(Q,34817,7680),c(Q,34818,7680),c(Q,34819,7680),c(Q,2978,[0,0,1024,1024]),c(Q,3333,4),c(Q,3317,4),c(Q,37440,!1),c(Q,37441,!1),c(Q,37443,37444),c(Q,35723,4352),c(Q,36010,null),c(Q,35977,!1),c(Q,3330,0),c(Q,3332,0),c(Q,3331,0),c(Q,3314,0),c(Q,32878,0),c(Q,3316,0),c(Q,3315,0),c(Q,32877,0),Q),wr=function(r,t,n){return t?r.enable(n):r.disable(n)},iy=function(r,t,n){return r.hint(n,t)},ht=function(r,t,n){return r.pixelStorei(n,t)},$C=function(r,t){var n=pe(r)?36009:36160;return r.bindFramebuffer(n,t)},QC=function(r,t){return r.bindFramebuffer(36008,t)};function sa(e){return Array.isArray(e)||ArrayBuffer.isView(e)}var ay=(z={},c(z,3042,wr),c(z,32773,function(r,t){return r.blendColor.apply(r,K(t))}),c(z,32777,"blendEquation"),c(z,34877,"blendEquation"),c(z,32969,"blendFunc"),c(z,32968,"blendFunc"),c(z,32971,"blendFunc"),c(z,32970,"blendFunc"),c(z,3106,function(r,t){return r.clearColor.apply(r,K(t))}),c(z,3107,function(r,t){return r.colorMask.apply(r,K(t))}),c(z,2884,wr),c(z,2885,function(r,t){return r.cullFace(t)}),c(z,2929,wr),c(z,2931,function(r,t){return r.clearDepth(t)}),c(z,2932,function(r,t){return r.depthFunc(t)}),c(z,2928,function(r,t){return r.depthRange.apply(r,K(t))}),c(z,2930,function(r,t){return r.depthMask(t)}),c(z,3024,wr),c(z,35723,iy),c(z,36006,$C),c(z,2886,function(r,t){return r.frontFace(t)}),c(z,33170,iy),c(z,2849,function(r,t){return r.lineWidth(t)}),c(z,32823,wr),c(z,32824,"polygonOffset"),c(z,10752,"polygonOffset"),c(z,35977,wr),c(z,32938,"sampleCoverage"),c(z,32939,"sampleCoverage"),c(z,3089,wr),c(z,3088,function(r,t){return r.scissor.apply(r,K(t))}),c(z,2960,wr),c(z,2961,function(r,t){return r.clearStencil(t)}),c(z,2968,function(r,t){return r.stencilMaskSeparate(1028,t)}),c(z,36005,function(r,t){return r.stencilMaskSeparate(1029,t)}),c(z,2962,"stencilFuncFront"),c(z,2967,"stencilFuncFront"),c(z,2963,"stencilFuncFront"),c(z,34816,"stencilFuncBack"),c(z,36003,"stencilFuncBack"),c(z,36004,"stencilFuncBack"),c(z,2964,"stencilOpFront"),c(z,2965,"stencilOpFront"),c(z,2966,"stencilOpFront"),c(z,34817,"stencilOpBack"),c(z,34818,"stencilOpBack"),c(z,34819,"stencilOpBack"),c(z,2978,function(r,t){return r.viewport.apply(r,K(t))}),c(z,3333,ht),c(z,3317,ht),c(z,37440,ht),c(z,37441,ht),c(z,37443,ht),c(z,3330,ht),c(z,3332,ht),c(z,3331,ht),c(z,36010,QC),c(z,3314,ht),c(z,32878,ht),c(z,3316,ht),c(z,3315,ht),c(z,32877,ht),c(z,"framebuffer",function(r,t){var n=t&&"handle"in t?t.handle:t;return r.bindFramebuffer(36160,n)}),c(z,"blend",function(r,t){return t?r.enable(3042):r.disable(3042)}),c(z,"blendColor",function(r,t){return r.blendColor.apply(r,K(t))}),c(z,"blendEquation",function(r,t){t=sa(t)?t:[t,t],r.blendEquationSeparate.apply(r,K(t))}),c(z,"blendFunc",function(r,t){t=sa(t)&&t.length===2?[].concat(K(t),K(t)):t,r.blendFuncSeparate.apply(r,K(t))}),c(z,"clearColor",function(r,t){return r.clearColor.apply(r,K(t))}),c(z,"clearDepth",function(r,t){return r.clearDepth(t)}),c(z,"clearStencil",function(r,t){return r.clearStencil(t)}),c(z,"colorMask",function(r,t){return r.colorMask.apply(r,K(t))}),c(z,"cull",function(r,t){return t?r.enable(2884):r.disable(2884)}),c(z,"cullFace",function(r,t){return r.cullFace(t)}),c(z,"depthTest",function(r,t){return t?r.enable(2929):r.disable(2929)}),c(z,"depthFunc",function(r,t){return r.depthFunc(t)}),c(z,"depthMask",function(r,t){return r.depthMask(t)}),c(z,"depthRange",function(r,t){return r.depthRange.apply(r,K(t))}),c(z,"dither",function(r,t){return t?r.enable(3024):r.disable(3024)}),c(z,"derivativeHint",function(r,t){r.hint(35723,t)}),c(z,"frontFace",function(r,t){return r.frontFace(t)}),c(z,"mipmapHint",function(r,t){return r.hint(33170,t)}),c(z,"lineWidth",function(r,t){return r.lineWidth(t)}),c(z,"polygonOffsetFill",function(r,t){return t?r.enable(32823):r.disable(32823)}),c(z,"polygonOffset",function(r,t){return r.polygonOffset.apply(r,K(t))}),c(z,"sampleCoverage",function(r,t){return r.sampleCoverage.apply(r,K(t))}),c(z,"scissorTest",function(r,t){return t?r.enable(3089):r.disable(3089)}),c(z,"scissor",function(r,t){return r.scissor.apply(r,K(t))}),c(z,"stencilTest",function(r,t){return t?r.enable(2960):r.disable(2960)}),c(z,"stencilMask",function(r,t){t=sa(t)?t:[t,t];var n=t,i=D(n,2),a=i[0],o=i[1];r.stencilMaskSeparate(1028,a),r.stencilMaskSeparate(1029,o)}),c(z,"stencilFunc",function(r,t){t=sa(t)&&t.length===3?[].concat(K(t),K(t)):t;var n=t,i=D(n,6),a=i[0],o=i[1],s=i[2],u=i[3],f=i[4],l=i[5];r.stencilFuncSeparate(1028,a,o,s),r.stencilFuncSeparate(1029,u,f,l)}),c(z,"stencilOp",function(r,t){t=sa(t)&&t.length===3?[].concat(K(t),K(t)):t;var n=t,i=D(n,6),a=i[0],o=i[1],s=i[2],u=i[3],f=i[4],l=i[5];r.stencilOpSeparate(1028,a,o,s),r.stencilOpSeparate(1029,u,f,l)}),c(z,"viewport",function(r,t){return r.viewport.apply(r,K(t))}),z);function ke(e,r,t){return r[e]!==void 0?r[e]:t[e]}var oy={blendEquation:function(r,t,n){return r.blendEquationSeparate(ke(32777,t,n),ke(34877,t,n))},blendFunc:function(r,t,n){return r.blendFuncSeparate(ke(32969,t,n),ke(32968,t,n),ke(32971,t,n),ke(32970,t,n))},polygonOffset:function(r,t,n){return r.polygonOffset(ke(32824,t,n),ke(10752,t,n))},sampleCoverage:function(r,t,n){return r.sampleCoverage(ke(32938,t,n),ke(32939,t,n))},stencilFuncFront:function(r,t,n){return r.stencilFuncSeparate(1028,ke(2962,t,n),ke(2967,t,n),ke(2963,t,n))},stencilFuncBack:function(r,t,n){return r.stencilFuncSeparate(1029,ke(34816,t,n),ke(36003,t,n),ke(36004,t,n))},stencilOpFront:function(r,t,n){return r.stencilOpSeparate(1028,ke(2964,t,n),ke(2965,t,n),ke(2966,t,n))},stencilOpBack:function(r,t,n){return r.stencilOpSeparate(1029,ke(34817,t,n),ke(34818,t,n),ke(34819,t,n))}},yl={enable:function(r,t){return r(c({},t,!0))},disable:function(r,t){return r(c({},t,!1))},pixelStorei:function(r,t,n){return r(c({},t,n))},hint:function(r,t,n){return r(c({},t,n))},bindFramebuffer:function(r,t,n){var i;switch(t){case 36160:return r((i={},c(i,36006,n),c(i,36010,n),i));case 36009:return r(c({},36006,n));case 36008:return r(c({},36010,n));default:return null}},blendColor:function(r,t,n,i,a){return r(c({},32773,new Float32Array([t,n,i,a])))},blendEquation:function(r,t){var n;return r((n={},c(n,32777,t),c(n,34877,t),n))},blendEquationSeparate:function(r,t,n){var i;return r((i={},c(i,32777,t),c(i,34877,n),i))},blendFunc:function(r,t,n){var i;return r((i={},c(i,32969,t),c(i,32968,n),c(i,32971,t),c(i,32970,n),i))},blendFuncSeparate:function(r,t,n,i,a){var o;return r((o={},c(o,32969,t),c(o,32968,n),c(o,32971,i),c(o,32970,a),o))},clearColor:function(r,t,n,i,a){return r(c({},3106,new Float32Array([t,n,i,a])))},clearDepth:function(r,t){return r(c({},2931,t))},clearStencil:function(r,t){return r(c({},2961,t))},colorMask:function(r,t,n,i,a){return r(c({},3107,[t,n,i,a]))},cullFace:function(r,t){return r(c({},2885,t))},depthFunc:function(r,t){return r(c({},2932,t))},depthRange:function(r,t,n){return r(c({},2928,new Float32Array([t,n])))},depthMask:function(r,t){return r(c({},2930,t))},frontFace:function(r,t){return r(c({},2886,t))},lineWidth:function(r,t){return r(c({},2849,t))},polygonOffset:function(r,t,n){var i;return r((i={},c(i,32824,t),c(i,10752,n),i))},sampleCoverage:function(r,t,n){var i;return r((i={},c(i,32938,t),c(i,32939,n),i))},scissor:function(r,t,n,i,a){return r(c({},3088,new Int32Array([t,n,i,a])))},stencilMask:function(r,t){var n;return r((n={},c(n,2968,t),c(n,36005,t),n))},stencilMaskSeparate:function(r,t,n){return r(c({},t===1028?2968:36005,n))},stencilFunc:function(r,t,n,i){var a;return r((a={},c(a,2962,t),c(a,2967,n),c(a,2963,i),c(a,34816,t),c(a,36003,n),c(a,36004,i),a))},stencilFuncSeparate:function(r,t,n,i,a){var o;return r((o={},c(o,t===1028?2962:34816,n),c(o,t===1028?2967:36003,i),c(o,t===1028?2963:36004,a),o))},stencilOp:function(r,t,n,i){var a;return r((a={},c(a,2964,t),c(a,2965,n),c(a,2966,i),c(a,34817,t),c(a,34818,n),c(a,34819,i),a))},stencilOpSeparate:function(r,t,n,i,a){var o;return r((o={},c(o,t===1028?2964:34817,n),c(o,t===1028?2965:34818,i),c(o,t===1028?2966:34819,a),o))},viewport:function(r,t,n,i,a){return r(c({},2978,[t,n,i,a]))}},Ht=function(r,t){return r.isEnabled(t)},Al=(gt={},c(gt,3042,Ht),c(gt,2884,Ht),c(gt,2929,Ht),c(gt,3024,Ht),c(gt,32823,Ht),c(gt,32926,Ht),c(gt,32928,Ht),c(gt,3089,Ht),c(gt,2960,Ht),c(gt,35977,Ht),gt);q();Y();function _l(e){for(var r in e)return!1;return!0}function sy(e,r){if(e===r)return!0;var t=Array.isArray(e)||ArrayBuffer.isView(e),n=Array.isArray(r)||ArrayBuffer.isView(r);if(t&&n&&e.length===r.length){for(var i=0;i<e.length;++i)if(e[i]!==r[i])return!1;return!0}return!1}function uy(e,r){var t=e[r].bind(e);e[r]=function(){var i=arguments.length<=0?void 0:arguments[0];return i in e.state.cache&&e.state.enable?e.state.cache[i]:t.apply(void 0,arguments)},Object.defineProperty(e[r],"name",{value:"".concat(r,"-from-cache"),configurable:!1})}function e2(e,r,t){var n=e[r].bind(e);e[r]=function(){for(var a=arguments.length,o=new Array(a),s=0;s<a;s++)o[s]=arguments[s];var u=t.apply(void 0,[e.state._updateCache].concat(o)),f=u.valueChanged,l=u.oldValue;return f&&n.apply(void 0,o),l},Object.defineProperty(e[r],"name",{value:"".concat(r,"-to-cache"),configurable:!1})}function t2(e){var r=e.useProgram.bind(e);e.useProgram=function(n){e.state.program!==n&&(r(n),e.state.program=n)}}var r2=function(){function e(r){T(this,e);var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=t.copyState,i=n===void 0?!1:n,a=t.log,o=a===void 0?function(){}:a;this.gl=r,this.program=null,this.stateStack=[],this.enable=!0,this.cache=i?xl(r):Object.assign({},qo),this.log=o,this._updateCache=this._updateCache.bind(this),Object.seal(this)}return w(e,[{key:"push",value:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.stateStack.push({})}},{key:"pop",value:function(){Ue(this.stateStack.length>0);var t=this.stateStack[this.stateStack.length-1];Yo(this.gl,t),this.stateStack.pop()}},{key:"_updateCache",value:function(t){var n=!1,i,a=this.stateStack.length>0&&this.stateStack[this.stateStack.length-1];for(var o in t){Ue(o!==void 0);var s=t[o],u=this.cache[o];sy(s,u)||(n=!0,i=u,a&&!(o in a)&&(a[o]=u),this.cache[o]=s)}return{valueChanged:n,oldValue:i}}}]),e}();function bl(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=r.enable,n=t===void 0?!0:t,i=r.copyState;if(Ue(i!==void 0),!e.state){var a=globalThis.polyfillContext;a&&a(e),e.state=new r2(e,{copyState:i}),t2(e);for(var o in yl){var s=yl[o];e2(e,o,s)}uy(e,"getParameter"),uy(e,"isEnabled")}return e.state.enable=n,e}function Tl(e){e.state||bl(e,{copyState:!1}),e.state.push()}function Ko(e){Ue(e.state),e.state.pop()}function n2(e,r){var t=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=i2(e))||r&&e&&typeof e.length=="number"){t&&(e=t);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(f){throw f},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
43
43
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){t=t.call(e)},n:function(){var f=t.next();return a=f.done,f},e:function(f){o=!0,s=f},f:function(){try{!a&&t.return!=null&&t.return()}finally{if(o)throw s}}}}function i2(e,r){if(e){if(typeof e=="string")return fy(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);if(t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set")return Array.from(e);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return fy(e,r)}}function fy(e,r){(r==null||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function Yo(e,r){if(Ue(Jo(e),"setParameters requires a WebGL context"),!_l(r)){var t={};for(var n in r){var i=Number(n),a=ay[n];a&&(typeof a=="string"?t[a]=!0:a(e,r[n],i))}var o=e.state&&e.state.cache;if(o)for(var s in t){var u=oy[s];u(e,r,o)}}}function xl(e,r){if(r=r||qo,typeof r=="number"){var t=r,n=Al[t];return n?n(e,t):e.getParameter(t)}var i=Array.isArray(r)?r:Object.keys(r),a={},o=n2(i),s;try{for(o.s();!(s=o.n()).done;){var u=s.value,f=Al[u];a[u]=f?f(e,Number(u)):e.getParameter(Number(u))}}catch(l){o.e(l)}finally{o.f()}return a}function tr(e,r,t){if(_l(r))return t(e);var n=r.nocatch,i=n===void 0?!0:n;Tl(e),Yo(e,r);var a;if(i)a=t(e),Ko(e);else try{a=t(e)}finally{Ko(e)}return a}var fV=et();q();Y();q();Y();N();q();Y();N();function ua(){var e;if(typeof window<"u"&&window.performance)e=window.performance.now();else if(typeof process<"u"&&process.hrtime){var r=process.hrtime();e=r[0]*1e3+r[1]/1e6}else e=Date.now();return e}var Zo=function(){function e(r,t){T(this,e),c(this,"name",void 0),c(this,"type",void 0),c(this,"sampleSize",1),c(this,"time",void 0),c(this,"count",void 0),c(this,"samples",void 0),c(this,"lastTiming",void 0),c(this,"lastSampleTime",void 0),c(this,"lastSampleCount",void 0),c(this,"_count",0),c(this,"_time",0),c(this,"_samples",0),c(this,"_startTime",0),c(this,"_timerPending",!1),this.name=r,this.type=t,this.reset()}return w(e,[{key:"setSampleSize",value:function(t){return this.sampleSize=t,this}},{key:"incrementCount",value:function(){return this.addCount(1),this}},{key:"decrementCount",value:function(){return this.subtractCount(1),this}},{key:"addCount",value:function(t){return this._count+=t,this._samples++,this._checkSampling(),this}},{key:"subtractCount",value:function(t){return this._count-=t,this._samples++,this._checkSampling(),this}},{key:"addTime",value:function(t){return this._time+=t,this.lastTiming=t,this._samples++,this._checkSampling(),this}},{key:"timeStart",value:function(){return this._startTime=ua(),this._timerPending=!0,this}},{key:"timeEnd",value:function(){return this._timerPending?(this.addTime(ua()-this._startTime),this._timerPending=!1,this._checkSampling(),this):this}},{key:"getSampleAverageCount",value:function(){return this.sampleSize>0?this.lastSampleCount/this.sampleSize:0}},{key:"getSampleAverageTime",value:function(){return this.sampleSize>0?this.lastSampleTime/this.sampleSize:0}},{key:"getSampleHz",value:function(){return this.lastSampleTime>0?this.sampleSize/(this.lastSampleTime/1e3):0}},{key:"getAverageCount",value:function(){return this.samples>0?this.count/this.samples:0}},{key:"getAverageTime",value:function(){return this.samples>0?this.time/this.samples:0}},{key:"getHz",value:function(){return this.time>0?this.samples/(this.time/1e3):0}},{key:"reset",value:function(){return this.time=0,this.count=0,this.samples=0,this.lastTiming=0,this.lastSampleTime=0,this.lastSampleCount=0,this._count=0,this._time=0,this._samples=0,this._startTime=0,this._timerPending=!1,this}},{key:"_checkSampling",value:function(){this._samples===this.sampleSize&&(this.lastSampleTime=this._time,this.lastSampleCount=this._count,this.count+=this._count,this.time+=this._time,this.samples+=this._samples,this._time=0,this._count=0,this._samples=0)}}]),e}();var El=function(){function e(r){T(this,e),c(this,"id",void 0),c(this,"stats",{}),this.id=r.id,this.stats={},this._initializeStats(r.stats),Object.seal(this)}return w(e,[{key:"get",value:function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"count";return this._getOrCreate({name:t,type:n})}},{key:"size",get:function(){return Object.keys(this.stats).length}},{key:"reset",value:function(){for(var t in this.stats)this.stats[t].reset();return this}},{key:"forEach",value:function(t){for(var n in this.stats)t(this.stats[n])}},{key:"getTable",value:function(){var t={};return this.forEach(function(n){t[n.name]={time:n.time||0,count:n.count||0,average:n.getAverageTime()||0,hz:n.getHz()||0}}),t}},{key:"_initializeStats",value:function(){var t=this,n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];n.forEach(function(i){return t._getOrCreate(i)})}},{key:"_getOrCreate",value:function(t){if(!t||!t.name)return null;var n=t.name,i=t.type;return this.stats[n]||(t instanceof Zo?this.stats[n]=t:this.stats[n]=new Zo(n,i)),this.stats[n]}}]),e}();var fa="8.5.21",a2="set luma.log.level=1 (or higher) to trace rendering",o2=function(){function e(){T(this,e),this.stats=new Map}return w(e,[{key:"get",value:function(t){return this.stats.has(t)||this.stats.set(t,new El({id:t})),this.stats.get(t)}}]),e}(),ei=new o2;if(globalThis.luma&&globalThis.luma.VERSION!==fa)throw new Error("luma.gl - multiple VERSIONs detected: ".concat(globalThis.luma.VERSION," vs ").concat(fa));globalThis.luma||(et()&&he.log(1,"luma.gl ".concat(fa," - ").concat(a2))(),globalThis.luma=globalThis.luma||{VERSION:fa,version:fa,log:he,stats:ei,globals:{modules:{},nodeIO:{}}});var JV=globalThis.luma;N();q();Y();ue();q();Y();q();Y();function ne(e,r){if(!e)throw new Error(r||"luma.gl: assertion failed.")}function $o(e,r){if(typeof r!="string")return r;var t=Number(r);if(!isNaN(t))return t;r=r.replace(/^.*\./,"");var n=e[r];return ne(n!==void 0,"Accessing undefined constant GL.".concat(r)),n}function un(e,r){r=Number(r);for(var t in e)if(e[t]===r)return"GL.".concat(t);return String(r)}var Sl={};function Qo(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"id";Sl[e]=Sl[e]||1;var r=Sl[e]++;return"".concat(e,"-").concat(r)}function wl(e){return ne(typeof e=="number","Input must be a number"),e&&(e&e-1)===0}function ly(e,r,t,n){var i="See luma.gl ".concat(t," Upgrade Guide at https://luma.gl/docs/upgrade-guide"),a=Object.getPrototypeOf(e);n.forEach(function(o){a.methodName||(a[o]=function(){throw he.removed("Calling removed method ".concat(r,".").concat(o,": "),i)(),new Error(o)})})}function s2(e,r){var t=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=u2(e))||r&&e&&typeof e.length=="number"){t&&(e=t);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(f){throw f},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
44
44
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){t=t.call(e)},n:function(){var f=t.next();return a=f.done,f},e:function(f){o=!0,s=f},f:function(){try{!a&&t.return!=null&&t.return()}finally{if(o)throw s}}}}function u2(e,r){if(e){if(typeof e=="string")return cy(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);if(t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set")return Array.from(e);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return cy(e,r)}}function cy(e,r){(r==null||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}var ti="Resource subclass must define virtual methods",Cr=function(e){function r(t){T(this,r);var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};ia(t);var i=n.id,a=n.userData,o=a===void 0?{}:a;this.gl=t,this.gl2=t,this.id=i||Qo(this[Symbol.toStringTag]),this.userData=o,this._bound=!1,this._handle=n.handle,this._handle===void 0&&(this._handle=this._createHandle()),this.byteLength=0,this._addStats()}return w(r,[{key:e,get:function(){return"Resource"}},{key:"toString",value:function(){return"".concat(this[Symbol.toStringTag]||this.constructor.name,"(").concat(this.id,")")}},{key:"handle",get:function(){return this._handle}},{key:"delete",value:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=n.deleteChildren,a=i===void 0?!1:i,o=this._handle&&this._deleteHandle(this._handle);return this._handle&&this._removeStats(),this._handle=null,o&&a&&o.filter(Boolean).forEach(function(s){return s.delete()}),this}},{key:"bind",value:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.handle;if(typeof n!="function")return this._bindHandle(n),this;var i;return this._bound?i=n():(this._bindHandle(this.handle),this._bound=!0,i=n(),this._bound=!1,this._bindHandle(null)),i}},{key:"unbind",value:function(){this.bind(null)}},{key:"getParameter",value:function(n){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};n=$o(this.gl,n),ne(n);var a=this.constructor.PARAMETERS||{},o=a[n];if(o){var s=pe(this.gl),u=(!("webgl2"in o)||s)&&(!("extension"in o)||this.gl.getExtension(o.extension));if(!u){var f=o.webgl1,l="webgl2"in o?o.webgl2:o.webgl1,h=s?l:f;return h}}return this._getParameter(n,i)}},{key:"getParameters",value:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=n.parameters,a=n.keys,o=this.constructor.PARAMETERS||{},s=pe(this.gl),u={},f=i||Object.keys(o),l=s2(f),h;try{for(l.s();!(h=l.n()).done;){var d=h.value,p=o[d],m=p&&(!("webgl2"in p)||s)&&(!("extension"in p)||this.gl.getExtension(p.extension));if(m){var v=a?un(this.gl,d):d;u[v]=this.getParameter(d,n),a&&p.type==="GLenum"&&(u[v]=un(this.gl,u[v]))}}}catch(g){l.e(g)}finally{l.f()}return u}},{key:"setParameter",value:function(n,i){n=$o(this.gl,n),ne(n);var a=this.constructor.PARAMETERS||{},o=a[n];if(o){var s=pe(this.gl),u=(!("webgl2"in o)||s)&&(!("extension"in o)||this.gl.getExtension(o.extension));if(!u)throw new Error("Parameter not available on this platform");o.type==="GLenum"&&(i=$o(i))}return this._setParameter(n,i),this}},{key:"setParameters",value:function(n){for(var i in n)this.setParameter(i,n[i]);return this}},{key:"stubRemovedMethods",value:function(n,i,a){return ly(this,n,i,a)}},{key:"initialize",value:function(n){}},{key:"_createHandle",value:function(){throw new Error(ti)}},{key:"_deleteHandle",value:function(){throw new Error(ti)}},{key:"_bindHandle",value:function(n){throw new Error(ti)}},{key:"_getOptsFromHandle",value:function(){throw new Error(ti)}},{key:"_getParameter",value:function(n,i){throw new Error(ti)}},{key:"_setParameter",value:function(n,i){throw new Error(ti)}},{key:"_context",value:function(){return this.gl.luma=this.gl.luma||{},this.gl.luma}},{key:"_addStats",value:function(){var n=this[Symbol.toStringTag],i=ei.get("Resource Counts");i.get("Resources Created").incrementCount(),i.get("".concat(n,"s Created")).incrementCount(),i.get("".concat(n,"s Active")).incrementCount()}},{key:"_removeStats",value:function(){var n=this[Symbol.toStringTag],i=ei.get("Resource Counts");i.get("".concat(n,"s Active")).decrementCount()}},{key:"_trackAllocatedMemory",value:function(n){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this[Symbol.toStringTag];this._trackAllocatedMemoryForContext(n,i),this._trackAllocatedMemoryForContext(n,i,this.gl.canvas&&this.gl.canvas.id),this.byteLength=n}},{key:"_trackAllocatedMemoryForContext",value:function(n){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this[Symbol.toStringTag],a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"",o=ei.get("Memory Usage".concat(a));o.get("GPU Memory").addCount(n),o.get("".concat(i," Memory")).addCount(n)}},{key:"_trackDeallocatedMemory",value:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this[Symbol.toStringTag];this._trackDeallocatedMemoryForContext(n),this._trackDeallocatedMemoryForContext(n,this.gl.canvas&&this.gl.canvas.id),this.byteLength=0}},{key:"_trackDeallocatedMemoryForContext",value:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this[Symbol.toStringTag],i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",a=ei.get("Memory Usage".concat(i));a.get("GPU Memory").subtractCount(this.byteLength),a.get("".concat(n," Memory")).subtractCount(this.byteLength)}}]),r}(Symbol.toStringTag);q();Y();function Cl(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function ri(e,r,t){return Cl()?ri=Reflect.construct:ri=function(i,a,o){var s=[null];s.push.apply(s,a);var u=Function.bind.apply(i,s),f=new u;return o&&Hr(f,o.prototype),f},ri.apply(null,arguments)}q();Y();var f2="Failed to deduce GL constant from typed array";function la(e){var r=ArrayBuffer.isView(e)?e.constructor:e;switch(r){case Float32Array:return 5126;case Uint16Array:return 5123;case Uint32Array:return 5125;case Uint8Array:return 5121;case Uint8ClampedArray:return 5121;case Int8Array:return 5120;case Int16Array:return 5122;case Int32Array:return 5124;default:throw new Error(f2)}}function Br(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=r.clamped,n=t===void 0?!0:t;switch(e){case 5126:return Float32Array;case 5123:case 33635:case 32819:case 32820:return Uint16Array;case 5125:return Uint32Array;case 5121:return n?Uint8ClampedArray:Uint8Array;case 5120:return Int8Array;case 5122:return Int16Array;case 5124:return Int32Array;default:throw new Error("Failed to deduce typed array type from GL constant")}}function hy(e){var r=e.data,t=e.width,n=e.height,i=e.bytesPerPixel,a=i===void 0?4:i,o=e.temp,s=t*a;o=o||new Uint8Array(s);for(var u=0;u<n/2;++u){var f=u*s,l=(n-u-1)*s;o.set(r.subarray(f,f+s)),r.copyWithin(f,l,l+s),r.set(o,l)}}function dy(e){for(var r=e.data,t=e.width,n=e.height,i=Math.round(t/2),a=Math.round(n/2),o=new Uint8Array(i*a*4),s=0;s<a;s++)for(var u=0;u<i;u++)for(var f=0;f<4;f++)o[(s*i+u)*4+f]=r[(s*2*t+u*2)*4+f];return{data:o,width:i,height:a}}function ca(e,r,t){var n=t.removedProps,i=n===void 0?{}:n,a=t.deprecatedProps,o=a===void 0?{}:a,s=t.replacedProps,u=s===void 0?{}:s;for(var f in i)if(f in r){var l=i[f],h=l?"".concat(e,".").concat(i[f]):"N/A";he.removed("".concat(e,".").concat(f),h)()}for(var d in o)if(d in r){var p=o[d];he.deprecated("".concat(e,".").concat(d),"".concat(e,".").concat(p))()}var m=null;for(var v in u)if(v in r){var g=u[v];he.deprecated("".concat(e,".").concat(v),"".concat(e,".").concat(g))(),m=m||Object.assign({},r),m[g]=r[v],delete m[v]}return m||r}var l2={offset:0,stride:0,type:5126,size:1,divisor:0,normalized:!1,integer:!1},c2={deprecatedProps:{instanced:"divisor",isInstanced:"divisor"}},fn=function(){function e(){var r=this;T(this,e);for(var t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];n.forEach(function(a){return r._assign(a)}),Object.freeze(this)}return w(e,[{key:"toString",value:function(){return JSON.stringify(this)}},{key:"BYTES_PER_ELEMENT",get:function(){return e.getBytesPerElement(this)}},{key:"BYTES_PER_VERTEX",get:function(){return e.getBytesPerVertex(this)}},{key:"_assign",value:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return t=ca("Accessor",t,c2),t.type!==void 0&&(this.type=t.type,(t.type===5124||t.type===5125)&&(this.integer=!0)),t.size!==void 0&&(this.size=t.size),t.offset!==void 0&&(this.offset=t.offset),t.stride!==void 0&&(this.stride=t.stride),t.normalized!==void 0&&(this.normalized=t.normalized),t.integer!==void 0&&(this.integer=t.integer),t.divisor!==void 0&&(this.divisor=t.divisor),t.buffer!==void 0&&(this.buffer=t.buffer),t.index!==void 0&&(typeof t.index=="boolean"?this.index=t.index?1:0:this.index=t.index),t.instanced!==void 0&&(this.divisor=t.instanced?1:0),t.isInstanced!==void 0&&(this.divisor=t.isInstanced?1:0),this}}],[{key:"getBytesPerElement",value:function(t){var n=Br(t.type||5126);return n.BYTES_PER_ELEMENT}},{key:"getBytesPerVertex",value:function(t){ne(t.size);var n=Br(t.type||5126);return n.BYTES_PER_ELEMENT*t.size}},{key:"resolve",value:function(){for(var t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];return ri(e,[l2].concat(n))}}]),e}();function h2(e){var r=d2();return function(){var n=L(e),i;if(r){var a=L(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return $(this,i)}}function d2(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var py=10,my={offset:"accessor.offset",stride:"accessor.stride",type:"accessor.type",size:"accessor.size",divisor:"accessor.divisor",normalized:"accessor.normalized",integer:"accessor.integer",instanced:"accessor.divisor",isInstanced:"accessor.divisor"},p2={removedProps:{},replacedProps:{bytes:"byteLength"},deprecatedProps:my},m2={removedProps:my},Bl=function(e,r){H(n,e);var t=h2(n);function n(i){var a;T(this,n);var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return a=t.call(this,i,o),a.stubRemovedMethods("Buffer","v6.0",["layout","setLayout","getIndexedParameter"]),a.target=o.target||(a.gl.webgl2?36662:34962),a.initialize(o),Object.seal(oe(a)),a}return w(n,[{key:r,get:function(){return"Buffer"}},{key:"getElementCount",value:function(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.accessor;return Math.round(this.byteLength/fn.getBytesPerElement(a))}},{key:"getVertexCount",value:function(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.accessor;return Math.round(this.byteLength/fn.getBytesPerVertex(a))}},{key:"initialize",value:function(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return ArrayBuffer.isView(a)&&(a={data:a}),Number.isFinite(a)&&(a={byteLength:a}),a=ca("Buffer",a,p2),this.usage=a.usage||35044,this.debugData=null,this.setAccessor(Object.assign({},a,a.accessor)),a.data?this._setData(a.data,a.offset,a.byteLength):this._setByteLength(a.byteLength||0),this}},{key:"setProps",value:function(a){return a=ca("Buffer",a,m2),"accessor"in a&&this.setAccessor(a.accessor),this}},{key:"setAccessor",value:function(a){return a=Object.assign({},a),delete a.buffer,this.accessor=new fn(a),this}},{key:"reallocate",value:function(a){return a>this.byteLength?(this._setByteLength(a),!0):(this.bytesUsed=a,!1)}},{key:"setData",value:function(a){return this.initialize(a)}},{key:"subData",value:function(a){ArrayBuffer.isView(a)&&(a={data:a});var o=a,s=o.data,u=o.offset,f=u===void 0?0:u,l=o.srcOffset,h=l===void 0?0:l,d=a.byteLength||a.length;ne(s);var p=this.gl.webgl2?36663:this.target;return this.gl.bindBuffer(p,this.handle),h!==0||d!==void 0?(We(this.gl),this.gl.bufferSubData(this.target,f,s,h,d)):this.gl.bufferSubData(p,f,s),this.gl.bindBuffer(p,null),this.debugData=null,this._inferType(s),this}},{key:"copyData",value:function(a){var o=a.sourceBuffer,s=a.readOffset,u=s===void 0?0:s,f=a.writeOffset,l=f===void 0?0:f,h=a.size,d=this.gl;return We(d),d.bindBuffer(36662,o.handle),d.bindBuffer(36663,this.handle),d.copyBufferSubData(36662,36663,u,l,h),d.bindBuffer(36662,null),d.bindBuffer(36663,null),this.debugData=null,this}},{key:"getData",value:function(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},o=a.dstData,s=o===void 0?null:o,u=a.srcByteOffset,f=u===void 0?0:u,l=a.dstOffset,h=l===void 0?0:l,d=a.length,p=d===void 0?0:d;We(this.gl);var m=Br(this.accessor.type||5126,{clamped:!1}),v=this._getAvailableElementCount(f),g=h,y,A;s?(A=s.length,y=A-g):(y=Math.min(v,p||v),A=g+y);var x=Math.min(v,y);return p=p||x,ne(p<=x),s=s||new m(A),this.gl.bindBuffer(36662,this.handle),this.gl.getBufferSubData(36662,f,s,h,p),this.gl.bindBuffer(36662,null),s}},{key:"bind",value:function(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},o=a.target,s=o===void 0?this.target:o,u=a.index,f=u===void 0?this.accessor&&this.accessor.index:u,l=a.offset,h=l===void 0?0:l,d=a.size;return s===35345||s===35982?d!==void 0?this.gl.bindBufferRange(s,f,this.handle,h,d):(ne(h===0),this.gl.bindBufferBase(s,f,this.handle)):this.gl.bindBuffer(s,this.handle),this}},{key:"unbind",value:function(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},o=a.target,s=o===void 0?this.target:o,u=a.index,f=u===void 0?this.accessor&&this.accessor.index:u,l=s===35345||s===35982;return l?this.gl.bindBufferBase(s,f,null):this.gl.bindBuffer(s,null),this}},{key:"getDebugData",value:function(){return this.debugData?{data:this.debugData,changed:!1}:(this.debugData=this.getData({length:Math.min(py,this.byteLength)}),{data:this.debugData,changed:!0})}},{key:"invalidateDebugData",value:function(){this.debugData=null}},{key:"_setData",value:function(a){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:a.byteLength+o;ne(ArrayBuffer.isView(a)),this._trackDeallocatedMemory();var u=this._getTarget();this.gl.bindBuffer(u,this.handle),this.gl.bufferData(u,s,this.usage),this.gl.bufferSubData(u,o,a),this.gl.bindBuffer(u,null),this.debugData=a.slice(0,py),this.bytesUsed=s,this._trackAllocatedMemory(s);var f=la(a);return ne(f),this.setAccessor(new fn(this.accessor,{type:f})),this}},{key:"_setByteLength",value:function(a){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.usage;ne(a>=0),this._trackDeallocatedMemory();var s=a;a===0&&(s=new Float32Array(0));var u=this._getTarget();return this.gl.bindBuffer(u,this.handle),this.gl.bufferData(u,s,o),this.gl.bindBuffer(u,null),this.usage=o,this.debugData=null,this.bytesUsed=a,this._trackAllocatedMemory(a),this}},{key:"_getTarget",value:function(){return this.gl.webgl2?36663:this.target}},{key:"_getAvailableElementCount",value:function(a){var o=Br(this.accessor.type||5126,{clamped:!1}),s=a/o.BYTES_PER_ELEMENT;return this.getElementCount()-s}},{key:"_inferType",value:function(a){this.accessor.type||this.setAccessor(new fn(this.accessor,{type:la(a)}))}},{key:"_createHandle",value:function(){return this.gl.createBuffer()}},{key:"_deleteHandle",value:function(){this.gl.deleteBuffer(this.handle),this._trackDeallocatedMemory()}},{key:"_getParameter",value:function(a){this.gl.bindBuffer(this.target,this.handle);var o=this.gl.getBufferParameter(this.target,a);return this.gl.bindBuffer(this.target,null),o}},{key:"type",get:function(){return he.deprecated("Buffer.type","Buffer.accessor.type")(),this.accessor.type}},{key:"bytes",get:function(){return he.deprecated("Buffer.bytes","Buffer.byteLength")(),this.byteLength}},{key:"setByteLength",value:function(a){return he.deprecated("setByteLength","reallocate")(),this.reallocate(a)}},{key:"updateAccessor",value:function(a){return he.deprecated("updateAccessor(...)","setAccessor(new Accessor(buffer.accessor, ...)")(),this.accessor=new fn(this.accessor,a),this}}]),n}(Cr,Symbol.toStringTag);N();var Ct,tt,Vt,es=(Ct={},c(Ct,6407,{dataFormat:6407,types:[5121,33635]}),c(Ct,6408,{dataFormat:6408,types:[5121,32819,32820]}),c(Ct,6406,{dataFormat:6406,types:[5121]}),c(Ct,6409,{dataFormat:6409,types:[5121]}),c(Ct,6410,{dataFormat:6410,types:[5121]}),c(Ct,33326,{dataFormat:6403,types:[5126],gl2:!0}),c(Ct,33328,{dataFormat:33319,types:[5126],gl2:!0}),c(Ct,34837,{dataFormat:6407,types:[5126],gl2:!0}),c(Ct,34836,{dataFormat:6408,types:[5126],gl2:!0}),Ct),vy=(tt={},c(tt,6403,1),c(tt,36244,1),c(tt,33319,2),c(tt,33320,2),c(tt,6407,3),c(tt,36248,3),c(tt,6408,4),c(tt,36249,4),c(tt,6402,1),c(tt,34041,1),c(tt,6406,1),c(tt,6409,1),c(tt,6410,2),tt),gy=(Vt={},c(Vt,5126,4),c(Vt,5125,4),c(Vt,5124,4),c(Vt,5123,2),c(Vt,5122,2),c(Vt,5131,2),c(Vt,5120,1),c(Vt,5121,1),Vt);function yy(e,r){var t=es[r];if(!t)return!1;if(t.gl1===void 0&&t.gl2===void 0)return!0;var n=pe(e)&&t.gl2||t.gl1;return typeof n=="string"?e.getExtension(n):n}function Ay(e,r){var t=es[r];switch(t&&t.types[0]){case 5126:return e.getExtension("OES_texture_float_linear");case 5131:return e.getExtension("OES_texture_half_float_linear");default:return!0}}function v2(e,r){var t=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=g2(e))||r&&e&&typeof e.length=="number"){t&&(e=t);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(f){throw f},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
45
45
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){t=t.call(e)},n:function(){var f=t.next();return a=f.done,f},e:function(f){o=!0,s=f},f:function(){try{!a&&t.return!=null&&t.return()}finally{if(o)throw s}}}}function g2(e,r){if(e){if(typeof e=="string")return _y(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);if(t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set")return Array.from(e);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return _y(e,r)}}function _y(e,r){(r==null||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function y2(e){var r=A2();return function(){var n=L(e),i;if(r){var a=L(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return $(this,i)}}function A2(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var _2=[9729,9728],by=globalThis.WebGLBuffer||function(){},Ml=function(e,r){H(n,e);var t=y2(n);function n(i,a){var o;T(this,n);var s=a.id,u=s===void 0?Qo("texture"):s,f=a.handle,l=a.target;return o=t.call(this,i,{id:u,handle:f}),o.target=l,o.textureUnit=void 0,o.loaded=!1,o.width=void 0,o.height=void 0,o.depth=void 0,o.format=void 0,o.type=void 0,o.dataFormat=void 0,o.border=void 0,o.textureUnit=void 0,o.mipmaps=void 0,o}return w(n,[{key:r,get:function(){return"Texture"}},{key:"toString",value:function(){return"Texture(".concat(this.id,",").concat(this.width,"x").concat(this.height,")")}},{key:"initialize",value:function(){var a=this,o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},s=o.data;if(s instanceof Promise)return s.then(function(G){return a.initialize(Object.assign({},o,{pixels:G,data:G}))}),this;var u=typeof HTMLVideoElement<"u"&&s instanceof HTMLVideoElement;if(u&&s.readyState<HTMLVideoElement.HAVE_METADATA)return this._video=null,s.addEventListener("loadeddata",function(){return a.initialize(o)}),this;var f=o.pixels,l=f===void 0?null:f,h=o.format,d=h===void 0?6408:h,p=o.border,m=p===void 0?0:p,v=o.recreate,g=v===void 0?!1:v,y=o.parameters,A=y===void 0?{}:y,x=o.pixelStore,b=x===void 0?{}:x,M=o.textureUnit,C=M===void 0?void 0:M;s||(s=l);var F=o.width,B=o.height,S=o.dataFormat,_=o.type,R=o.compressed,k=R===void 0?!1:R,U=o.mipmaps,j=U===void 0?!0:U,Z=o.depth,P=Z===void 0?0:Z,O=this._deduceParameters({format:d,type:_,dataFormat:S,compressed:k,data:s,width:F,height:B});return F=O.width,B=O.height,k=O.compressed,S=O.dataFormat,_=O.type,this.width=F,this.height=B,this.depth=P,this.format=d,this.type=_,this.dataFormat=S,this.border=m,this.textureUnit=C,Number.isFinite(this.textureUnit)&&(this.gl.activeTexture(33984+this.textureUnit),this.gl.bindTexture(this.target,this.handle)),j&&this._isNPOT()&&(he.warn("texture: ".concat(this," is Non-Power-Of-Two, disabling mipmaping"))(),j=!1,this._updateForNPOT(A)),this.mipmaps=j,this.setImageData({data:s,width:F,height:B,depth:P,format:d,type:_,dataFormat:S,border:m,mipmaps:j,parameters:b,compressed:k}),j&&this.generateMipmap(),this.setParameters(A),g&&(this.data=s),u&&(this._video={video:s,parameters:A,lastTime:s.readyState>=HTMLVideoElement.HAVE_CURRENT_DATA?s.currentTime:-1}),this}},{key:"update",value:function(){if(this._video){var a=this._video,o=a.video,s=a.parameters,u=a.lastTime;if(u===o.currentTime||o.readyState<HTMLVideoElement.HAVE_CURRENT_DATA)return;this.setSubImageData({data:o,parameters:s}),this.mipmaps&&this.generateMipmap(),this._video.lastTime=o.currentTime}}},{key:"resize",value:function(a){var o=a.height,s=a.width,u=a.mipmaps,f=u===void 0?!1:u;return s!==this.width||o!==this.height?this.initialize({width:s,height:o,format:this.format,type:this.type,dataFormat:this.dataFormat,border:this.border,mipmaps:f}):this}},{key:"generateMipmap",value:function(){var a=this,o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return this._isNPOT()?(he.warn("texture: ".concat(this," is Non-Power-Of-Two, disabling mipmaping"))(),this):(this.mipmaps=!0,this.gl.bindTexture(this.target,this.handle),tr(this.gl,o,function(){a.gl.generateMipmap(a.target)}),this.gl.bindTexture(this.target,null),this)}},{key:"setImageData",value:function(a){this._trackDeallocatedMemory("Texture");var o=a.target,s=o===void 0?this.target:o,u=a.pixels,f=u===void 0?null:u,l=a.level,h=l===void 0?0:l,d=a.format,p=d===void 0?this.format:d,m=a.border,v=m===void 0?this.border:m,g=a.offset,y=g===void 0?0:g,A=a.parameters,x=A===void 0?{}:A,b=a.data,M=b===void 0?null:b,C=a.type,F=C===void 0?this.type:C,B=a.width,S=B===void 0?this.width:B,_=a.height,R=_===void 0?this.height:_,k=a.dataFormat,U=k===void 0?this.dataFormat:k,j=a.compressed,Z=j===void 0?!1:j;M||(M=f);var P=this._deduceParameters({format:p,type:F,dataFormat:U,compressed:Z,data:M,width:S,height:R});F=P.type,U=P.dataFormat,Z=P.compressed,S=P.width,R=P.height;var O=this.gl;O.bindTexture(this.target,this.handle);var G=null,J=this._getDataType({data:M,compressed:Z});M=J.data,G=J.dataType;var V,ee=0;if(tr(this.gl,x,function(){switch(G){case"null":O.texImage2D(s,h,p,S,R,v,U,F,M);break;case"typed-array":O.texImage2D(s,h,p,S,R,v,U,F,M,y);break;case"buffer":V=We(O),V.bindBuffer(35052,M.handle||M),V.texImage2D(s,h,p,S,R,v,U,F,y),V.bindBuffer(35052,null);break;case"browser-object":pe(O)?O.texImage2D(s,h,p,S,R,v,U,F,M):O.texImage2D(s,h,p,U,F,M);break;case"compressed":var Me=v2(M.entries()),Re;try{for(Me.s();!(Re=Me.n()).done;){var Xe=D(Re.value,2),nt=Xe[0],Fe=Xe[1];O.compressedTexImage2D(s,nt,Fe.format,Fe.width,Fe.height,v,Fe.data),ee+=Fe.levelSize}}catch(Rn){Me.e(Rn)}finally{Me.f()}break;default:ne(!1,"Unknown image data type")}}),G==="compressed")this._trackAllocatedMemory(ee,"Texture");else if(M&&M.byteLength)this._trackAllocatedMemory(M.byteLength,"Texture");else{var ie=vy[this.dataFormat]||4,we=gy[this.type]||1;this._trackAllocatedMemory(this.width*this.height*ie*we,"Texture")}return this.loaded=!0,this}},{key:"setSubImageData",value:function(a){var o=this,s=a.target,u=s===void 0?this.target:s,f=a.pixels,l=f===void 0?null:f,h=a.data,d=h===void 0?null:h,p=a.x,m=p===void 0?0:p,v=a.y,g=v===void 0?0:v,y=a.width,A=y===void 0?this.width:y,x=a.height,b=x===void 0?this.height:x,M=a.level,C=M===void 0?0:M,F=a.format,B=F===void 0?this.format:F,S=a.type,_=S===void 0?this.type:S,R=a.dataFormat,k=R===void 0?this.dataFormat:R,U=a.compressed,j=U===void 0?!1:U,Z=a.offset,P=Z===void 0?0:Z,O=a.border,G=O===void 0?this.border:O,J=a.parameters,V=J===void 0?{}:J,ee=this._deduceParameters({format:B,type:_,dataFormat:k,compressed:j,data:d,width:A,height:b});if(_=ee.type,k=ee.dataFormat,j=ee.compressed,A=ee.width,b=ee.height,ne(this.depth===0,"texSubImage not supported for 3D textures"),d||(d=l),d&&d.data){var ie=d;d=ie.data,A=ie.shape[0],b=ie.shape[1]}d instanceof Bl&&(d=d.handle),this.gl.bindTexture(this.target,this.handle),tr(this.gl,V,function(){if(j)o.gl.compressedTexSubImage2D(u,C,m,g,A,b,B,d);else if(d===null)o.gl.texSubImage2D(u,C,m,g,A,b,k,_,null);else if(ArrayBuffer.isView(d))o.gl.texSubImage2D(u,C,m,g,A,b,k,_,d,P);else if(d instanceof by){var we=We(o.gl);we.bindBuffer(35052,d),we.texSubImage2D(u,C,m,g,A,b,k,_,P),we.bindBuffer(35052,null)}else if(pe(o.gl)){var Me=We(o.gl);Me.texSubImage2D(u,C,m,g,A,b,k,_,d)}else o.gl.texSubImage2D(u,C,m,g,k,_,d)}),this.gl.bindTexture(this.target,null)}},{key:"copyFramebuffer",value:function(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return he.error("Texture.copyFramebuffer({...}) is no logner supported, use copyToTexture(source, target, opts})")(),null}},{key:"getActiveUnit",value:function(){return this.gl.getParameter(34016)-33984}},{key:"bind",value:function(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.textureUnit,o=this.gl;return a!==void 0&&(this.textureUnit=a,o.activeTexture(33984+a)),o.bindTexture(this.target,this.handle),a}},{key:"unbind",value:function(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.textureUnit,o=this.gl;return a!==void 0&&(this.textureUnit=a,o.activeTexture(33984+a)),o.bindTexture(this.target,null),a}},{key:"_getDataType",value:function(a){var o=a.data,s=a.compressed,u=s===void 0?!1:s;return u?{data:o,dataType:"compressed"}:o===null?{data:o,dataType:"null"}:ArrayBuffer.isView(o)?{data:o,dataType:"typed-array"}:o instanceof Bl?{data:o.handle,dataType:"buffer"}:o instanceof by?{data:o,dataType:"buffer"}:{data:o,dataType:"browser-object"}}},{key:"_deduceParameters",value:function(a){var o=a.format,s=a.data,u=a.width,f=a.height,l=a.dataFormat,h=a.type,d=a.compressed,p=es[o];l=l||p&&p.dataFormat,h=h||p&&p.types[0],d=d||p&&p.compressed;var m=this._deduceImageSize(s,u,f);return u=m.width,f=m.height,{dataFormat:l,type:h,compressed:d,width:u,height:f,format:o,data:s}}},{key:"_deduceImageSize",value:function(a,o,s){var u;return typeof ImageData<"u"&&a instanceof ImageData?u={width:a.width,height:a.height}:typeof HTMLImageElement<"u"&&a instanceof HTMLImageElement?u={width:a.naturalWidth,height:a.naturalHeight}:typeof HTMLCanvasElement<"u"&&a instanceof HTMLCanvasElement?u={width:a.width,height:a.height}:typeof ImageBitmap<"u"&&a instanceof ImageBitmap?u={width:a.width,height:a.height}:typeof HTMLVideoElement<"u"&&a instanceof HTMLVideoElement?u={width:a.videoWidth,height:a.videoHeight}:a?u={width:o,height:s}:u={width:o>=0?o:1,height:s>=0?s:1},ne(u,"Could not deduced texture size"),ne(o===void 0||u.width===o,"Deduced texture width does not match supplied width"),ne(s===void 0||u.height===s,"Deduced texture height does not match supplied height"),u}},{key:"_createHandle",value:function(){return this.gl.createTexture()}},{key:"_deleteHandle",value:function(){this.gl.deleteTexture(this.handle),this._trackDeallocatedMemory("Texture")}},{key:"_getParameter",value:function(a){switch(a){case 4096:return this.width;case 4097:return this.height;default:this.gl.bindTexture(this.target,this.handle);var o=this.gl.getTexParameter(this.target,a);return this.gl.bindTexture(this.target,null),o}}},{key:"_setParameter",value:function(a,o){switch(this.gl.bindTexture(this.target,this.handle),o=this._getNPOTParam(a,o),a){case 33082:case 33083:this.gl.texParameterf(this.handle,a,o);break;case 4096:case 4097:ne(!1);break;default:this.gl.texParameteri(this.target,a,o);break}return this.gl.bindTexture(this.target,null),this}},{key:"_isNPOT",value:function(){return pe(this.gl)||!this.width||!this.height?!1:!wl(this.width)||!wl(this.height)}},{key:"_updateForNPOT",value:function(a){a[this.gl.TEXTURE_MIN_FILTER]===void 0&&(a[this.gl.TEXTURE_MIN_FILTER]=this.gl.LINEAR),a[this.gl.TEXTURE_WRAP_S]===void 0&&(a[this.gl.TEXTURE_WRAP_S]=this.gl.CLAMP_TO_EDGE),a[this.gl.TEXTURE_WRAP_T]===void 0&&(a[this.gl.TEXTURE_WRAP_T]=this.gl.CLAMP_TO_EDGE)}},{key:"_getNPOTParam",value:function(a,o){if(this._isNPOT())switch(a){case 10241:_2.indexOf(o)===-1&&(o=9729);break;case 10242:case 10243:o!==33071&&(o=33071);break;default:break}return o}}],[{key:"isSupported",value:function(a){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=o.format,u=o.linearFiltering,f=!0;return s&&(f=f&&yy(a,s),f=f&&(!u||Ay(a,s))),f}}]),n}(Cr,Symbol.toStringTag);var b2="";function Ty(e,r){return ne(typeof e=="string"),e=b2+e,new Promise(function(t,n){try{var i=new Image;i.onload=function(){return t(i)},i.onerror=function(){return n(new Error("Could not load image ".concat(e,".")))},i.crossOrigin=r&&r.crossOrigin||"anonymous",i.src=e}catch(a){n(a)}})}function T2(e){var r=x2();return function(){var n=L(e),i;if(r){var a=L(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return $(this,i)}}function x2(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var ln=function(e,r){H(n,e);var t=T2(n);function n(i){var a;T(this,n);var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return ia(i),(o instanceof Promise||typeof o=="string")&&(o={data:o}),typeof o.data=="string"&&(o=Object.assign({},o,{data:Ty(o.data)})),a=t.call(this,i,Object.assign({},o,{target:3553})),a.initialize(o),Object.seal(oe(a)),a}return w(n,[{key:r,get:function(){return"Texture2D"}}],[{key:"isSupported",value:function(a,o){return Ml.isSupported(a,o)}}]),n}(Ml,Symbol.toStringTag);N();ue();q();Y();q();Y();N();var ae,cn="EXT_color_buffer_float",Ol=(ae={},c(ae,33189,{bpp:2}),c(ae,33190,{gl2:!0,bpp:3}),c(ae,36012,{gl2:!0,bpp:4}),c(ae,36168,{bpp:1}),c(ae,34041,{bpp:4}),c(ae,35056,{gl2:!0,bpp:4}),c(ae,36013,{gl2:!0,bpp:5}),c(ae,32854,{bpp:2}),c(ae,36194,{bpp:2}),c(ae,32855,{bpp:2}),c(ae,33321,{gl2:!0,bpp:1}),c(ae,33330,{gl2:!0,bpp:1}),c(ae,33329,{gl2:!0,bpp:1}),c(ae,33332,{gl2:!0,bpp:2}),c(ae,33331,{gl2:!0,bpp:2}),c(ae,33334,{gl2:!0,bpp:4}),c(ae,33333,{gl2:!0,bpp:4}),c(ae,33323,{gl2:!0,bpp:2}),c(ae,33336,{gl2:!0,bpp:2}),c(ae,33335,{gl2:!0,bpp:2}),c(ae,33338,{gl2:!0,bpp:4}),c(ae,33337,{gl2:!0,bpp:4}),c(ae,33340,{gl2:!0,bpp:8}),c(ae,33339,{gl2:!0,bpp:8}),c(ae,32849,{gl2:!0,bpp:3}),c(ae,32856,{gl2:!0,bpp:4}),c(ae,32857,{gl2:!0,bpp:4}),c(ae,36220,{gl2:!0,bpp:4}),c(ae,36238,{gl2:!0,bpp:4}),c(ae,36975,{gl2:!0,bpp:4}),c(ae,36214,{gl2:!0,bpp:8}),c(ae,36232,{gl2:!0,bpp:8}),c(ae,36226,{gl2:!0,bpp:16}),c(ae,36208,{gl2:!0,bpp:16}),c(ae,33325,{gl2:cn,bpp:2}),c(ae,33327,{gl2:cn,bpp:4}),c(ae,34842,{gl2:cn,bpp:8}),c(ae,33326,{gl2:cn,bpp:4}),c(ae,33328,{gl2:cn,bpp:8}),c(ae,34836,{gl2:cn,bpp:16}),c(ae,35898,{gl2:cn,bpp:4}),ae);function E2(e){var r=S2();return function(){var n=L(e),i;if(r){var a=L(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return $(this,i)}}function S2(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function w2(e,r,t){var n=t[r];if(!n)return!1;var i=pe(e)&&n.gl2||n.gl1;return typeof i=="string"?e.getExtension(i):i}var ha=function(e,r){H(n,e);var t=E2(n);function n(i){var a;T(this,n);var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return a=t.call(this,i,o),a.initialize(o),Object.seal(oe(a)),a}return w(n,[{key:r,get:function(){return"Renderbuffer"}},{key:"initialize",value:function(a){var o=a.format,s=a.width,u=s===void 0?1:s,f=a.height,l=f===void 0?1:f,h=a.samples,d=h===void 0?0:h;return ne(o,"Needs format"),this._trackDeallocatedMemory(),this.gl.bindRenderbuffer(36161,this.handle),d!==0&&pe(this.gl)?this.gl.renderbufferStorageMultisample(36161,d,o,u,l):this.gl.renderbufferStorage(36161,o,u,l),this.format=o,this.width=u,this.height=l,this.samples=d,this._trackAllocatedMemory(this.width*this.height*(this.samples||1)*Ol[this.format].bpp),this}},{key:"resize",value:function(a){var o=a.width,s=a.height;return o!==this.width||s!==this.height?this.initialize({width:o,height:s,format:this.format,samples:this.samples}):this}},{key:"_createHandle",value:function(){return this.gl.createRenderbuffer()}},{key:"_deleteHandle",value:function(){this.gl.deleteRenderbuffer(this.handle),this._trackDeallocatedMemory()}},{key:"_bindHandle",value:function(a){this.gl.bindRenderbuffer(36161,a)}},{key:"_syncHandle",value:function(a){this.format=this.getParameter(36164),this.width=this.getParameter(36162),this.height=this.getParameter(36163),this.samples=this.getParameter(36011)}},{key:"_getParameter",value:function(a){this.gl.bindRenderbuffer(36161,this.handle);var o=this.gl.getRenderbufferParameter(36161,a);return o}}],[{key:"isSupported",value:function(a){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{format:null},s=o.format;return!s||w2(a,s,Ol)}},{key:"getSamplesForFormat",value:function(a,o){var s=o.format;return a.getInternalformatParameter(36161,s,32937)}}]),n}(Cr,Symbol.toStringTag);ue();var C2=256,B2=1024,M2=16384,xy=6144,Ey=6145,Sy=6146,wy=34041,Cy="clear: bad arguments";function By(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=r.framebuffer,n=t===void 0?null:t,i=r.color,a=i===void 0?null:i,o=r.depth,s=o===void 0?null:o,u=r.stencil,f=u===void 0?null:u,l={};n&&(l.framebuffer=n);var h=0;a&&(h|=M2,a!==!0&&(l.clearColor=a)),s&&(h|=C2,s!==!0&&(l.clearDepth=s)),f&&(h|=B2,s!==!0&&(l.clearStencil=s)),ne(h!==0,Cy),tr(e,l,function(){e.clear(h)})}function My(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=r.framebuffer,n=t===void 0?null:t,i=r.buffer,a=i===void 0?xy:i,o=r.drawBuffer,s=o===void 0?0:o,u=r.value,f=u===void 0?[0,0,0,0]:u;We(e),tr(e,{framebuffer:n},function(){switch(a){case xy:switch(f.constructor){case Int32Array:e.clearBufferiv(a,s,f);break;case Uint32Array:e.clearBufferuiv(a,s,f);break;case Float32Array:default:e.clearBufferfv(a,s,f)}break;case Ey:e.clearBufferfv(Ey,0,[f]);break;case Sy:e.clearBufferiv(Sy,0,[f]);break;case wy:var l=D(f,2),h=l[0],d=l[1];e.clearBufferfi(wy,0,h,d);break;default:ne(!1,Cy)}})}function Oy(e){switch(e){case 6406:case 33326:case 6403:return 1;case 33328:case 33319:return 2;case 6407:case 34837:return 3;case 6408:case 34836:return 4;default:return ne(!1),0}}function O2(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=r.sourceX,n=t===void 0?0:t,i=r.sourceY,a=i===void 0?0:i,o=r.sourceFormat,s=o===void 0?6408:o,u=r.sourceAttachment,f=u===void 0?36064:u,l=r.target,h=l===void 0?null:l,d=r.sourceWidth,p=r.sourceHeight,m=r.sourceType,v=P2(e),g=v.framebuffer,y=v.deleteFramebuffer;ne(g);var A=g.gl,x=g.handle,b=g.attachments;d=d||g.width,p=p||g.height,f===36064&&x===null&&(f=1028),ne(b[f]),m=m||b[f].type,h=I2(h,m,s,d,p),m=m||la(h);var M=A.bindFramebuffer(36160,x);return A.readPixels(n,a,d,p,s,m,h),A.bindFramebuffer(36160,M||null),y&&g.delete(),h}function Pl(e){for(var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=r.sourceAttachment,n=t===void 0?36064:t,i=r.targetMaxHeight,a=i===void 0?Number.MAX_SAFE_INTEGER:i,o=O2(e,{sourceAttachment:n}),s=e.width,u=e.height;u>a;){var f=dy({data:o,width:s,height:u});o=f.data,s=f.width,u=f.height}hy({data:o,width:s,height:u});var l=document.createElement("canvas");l.width=s,l.height=u;var h=l.getContext("2d"),d=h.createImageData(s,u);return d.data.set(o),h.putImageData(d,0,0),l.toDataURL()}function P2(e){return e instanceof Mr?{framebuffer:e,deleteFramebuffer:!1}:{framebuffer:Py(e),deleteFramebuffer:!0}}function I2(e,r,t,n,i){if(e)return e;r=r||5121;var a=Br(r,{clamped:!1}),o=Oy(t);return new a(n*i*o)}N();var Oe,Be={WEBGL2:"WEBGL2",VERTEX_ARRAY_OBJECT:"VERTEX_ARRAY_OBJECT",TIMER_QUERY:"TIMER_QUERY",INSTANCED_RENDERING:"INSTANCED_RENDERING",MULTIPLE_RENDER_TARGETS:"MULTIPLE_RENDER_TARGETS",ELEMENT_INDEX_UINT32:"ELEMENT_INDEX_UINT32",BLEND_EQUATION_MINMAX:"BLEND_EQUATION_MINMAX",FLOAT_BLEND:"FLOAT_BLEND",COLOR_ENCODING_SRGB:"COLOR_ENCODING_SRGB",TEXTURE_DEPTH:"TEXTURE_DEPTH",TEXTURE_FLOAT:"TEXTURE_FLOAT",TEXTURE_HALF_FLOAT:"TEXTURE_HALF_FLOAT",TEXTURE_FILTER_LINEAR_FLOAT:"TEXTURE_FILTER_LINEAR_FLOAT",TEXTURE_FILTER_LINEAR_HALF_FLOAT:"TEXTURE_FILTER_LINEAR_HALF_FLOAT",TEXTURE_FILTER_ANISOTROPIC:"TEXTURE_FILTER_ANISOTROPIC",COLOR_ATTACHMENT_RGBA32F:"COLOR_ATTACHMENT_RGBA32F",COLOR_ATTACHMENT_FLOAT:"COLOR_ATTACHMENT_FLOAT",COLOR_ATTACHMENT_HALF_FLOAT:"COLOR_ATTACHMENT_HALF_FLOAT",GLSL_FRAG_DATA:"GLSL_FRAG_DATA",GLSL_FRAG_DEPTH:"GLSL_FRAG_DEPTH",GLSL_DERIVATIVES:"GLSL_DERIVATIVES",GLSL_TEXTURE_LOD:"GLSL_TEXTURE_LOD"};function R2(e){var r=new ln(e,{format:6408,type:5126,dataFormat:6408}),t=new Mr(e,{id:"test-framebuffer",check:!1,attachments:c({},36064,r)}),n=t.getStatus();return r.delete(),t.delete(),n===36053}var Il=(Oe={},c(Oe,Be.WEBGL2,[!1,!0]),c(Oe,Be.VERTEX_ARRAY_OBJECT,["OES_vertex_array_object",!0]),c(Oe,Be.TIMER_QUERY,["EXT_disjoint_timer_query","EXT_disjoint_timer_query_webgl2"]),c(Oe,Be.INSTANCED_RENDERING,["ANGLE_instanced_arrays",!0]),c(Oe,Be.MULTIPLE_RENDER_TARGETS,["WEBGL_draw_buffers",!0]),c(Oe,Be.ELEMENT_INDEX_UINT32,["OES_element_index_uint",!0]),c(Oe,Be.BLEND_EQUATION_MINMAX,["EXT_blend_minmax",!0]),c(Oe,Be.FLOAT_BLEND,["EXT_float_blend"]),c(Oe,Be.COLOR_ENCODING_SRGB,["EXT_sRGB",!0]),c(Oe,Be.TEXTURE_DEPTH,["WEBGL_depth_texture",!0]),c(Oe,Be.TEXTURE_FLOAT,["OES_texture_float",!0]),c(Oe,Be.TEXTURE_HALF_FLOAT,["OES_texture_half_float",!0]),c(Oe,Be.TEXTURE_FILTER_LINEAR_FLOAT,["OES_texture_float_linear"]),c(Oe,Be.TEXTURE_FILTER_LINEAR_HALF_FLOAT,["OES_texture_half_float_linear"]),c(Oe,Be.TEXTURE_FILTER_ANISOTROPIC,["EXT_texture_filter_anisotropic"]),c(Oe,Be.COLOR_ATTACHMENT_RGBA32F,[R2,"EXT_color_buffer_float"]),c(Oe,Be.COLOR_ATTACHMENT_FLOAT,[!1,"EXT_color_buffer_float"]),c(Oe,Be.COLOR_ATTACHMENT_HALF_FLOAT,["EXT_color_buffer_half_float"]),c(Oe,Be.GLSL_FRAG_DATA,["WEBGL_draw_buffers",!0]),c(Oe,Be.GLSL_FRAG_DEPTH,["EXT_frag_depth",!0]),c(Oe,Be.GLSL_DERIVATIVES,["OES_standard_derivatives",!0]),c(Oe,Be.GLSL_TEXTURE_LOD,["EXT_shader_texture_lod",!0]),Oe);function F2(e,r){var t=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=L2(e))||r&&e&&typeof e.length=="number"){t&&(e=t);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(f){throw f},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
46
46
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){t=t.call(e)},n:function(){var f=t.next();return a=f.done,f},e:function(f){o=!0,s=f},f:function(){try{!a&&t.return!=null&&t.return()}finally{if(o)throw s}}}}function L2(e,r){if(e){if(typeof e=="string")return Iy(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);if(t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set")return Array.from(e);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return Iy(e,r)}}function Iy(e,r){(r==null||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}var k2=2;function ts(e,r){return Rl(e,r)}function Rl(e,r){return r=Array.isArray(r)?r:[r],r.every(function(t){return Ry(e,t)})}function rs(e){e.luma=e.luma||{},e.luma.caps=e.luma.caps||{};for(var r in Il)e.luma.caps[r]===void 0&&(e.luma.caps[r]=Ry(e,r));return e.luma.caps}function Ry(e,r){return e.luma=e.luma||{},e.luma.caps=e.luma.caps||{},e.luma.caps[r]===void 0&&(e.luma.caps[r]=D2(e,r)),e.luma.caps[r]||he.log(k2,"Feature: ".concat(r," not supported"))(),e.luma.caps[r]}function D2(e,r){var t=Il[r];ne(t,r);var n,i=pe(e)&&t[1]||t[0];if(typeof i=="function")n=i(e);else if(Array.isArray(i)){n=!0;var a=F2(i),o;try{for(a.s();!(o=a.n()).done;){var s=o.value;n=n&&Boolean(e.getExtension(s))}}catch(u){a.e(u)}finally{a.f()}}else typeof i=="string"?n=Boolean(e.getExtension(i)):typeof i=="boolean"?n=i:ne(!1);return n}function Fy(e,r){var t=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=G2(e))||r&&e&&typeof e.length=="number"){t&&(e=t);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(f){throw f},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
47
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){t=t.call(e)},n:function(){var f=t.next();return a=f.done,f},e:function(f){o=!0,s=f},f:function(){try{!a&&t.return!=null&&t.return()}finally{if(o)throw s}}}}function G2(e,r){if(e){if(typeof e=="string")return Ly(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);if(t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set")return Array.from(e);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return Ly(e,r)}}function Ly(e,r){(r==null||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function N2(e){var r=U2();return function(){var n=L(e),i;if(r){var a=L(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return $(this,i)}}function U2(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var ky="Multiple render targets not supported",Mr=function(e,r){H(n,e);var t=N2(n);function n(i){var a;T(this,n);var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return a=t.call(this,i,o),a.width=null,a.height=null,a.attachments={},a.readBuffer=36064,a.drawBuffers=[36064],a.ownResources=[],a.initialize(o),Object.seal(oe(a)),a}return w(n,[{key:r,get:function(){return"Framebuffer"}},{key:"MAX_COLOR_ATTACHMENTS",get:function(){var a=We(this.gl);return a.getParameter(a.MAX_COLOR_ATTACHMENTS)}},{key:"MAX_DRAW_BUFFERS",get:function(){var a=We(this.gl);return a.getParameter(a.MAX_DRAW_BUFFERS)}},{key:"color",get:function(){return this.attachments[36064]||null}},{key:"texture",get:function(){return this.attachments[36064]||null}},{key:"depth",get:function(){return this.attachments[36096]||this.attachments[33306]||null}},{key:"stencil",get:function(){return this.attachments[36128]||this.attachments[33306]||null}},{key:"initialize",value:function(a){var o=a.width,s=o===void 0?1:o,u=a.height,f=u===void 0?1:u,l=a.attachments,h=l===void 0?null:l,d=a.color,p=d===void 0?!0:d,m=a.depth,v=m===void 0?!0:m,g=a.stencil,y=g===void 0?!1:g,A=a.check,x=A===void 0?!0:A,b=a.readBuffer,M=b===void 0?void 0:b,C=a.drawBuffers,F=C===void 0?void 0:C;if(ne(s>=0&&f>=0,"Width and height need to be integers"),this.width=s,this.height=f,h)for(var B in h){var S=h[B],_=Array.isArray(S)?S[0]:S;_.resize({width:s,height:f})}else h=this._createDefaultAttachments(p,v,y,s,f);this.update({clearAttachments:!0,attachments:h,readBuffer:M,drawBuffers:F}),h&&x&&this.checkStatus()}},{key:"delete",value:function(){var a=Fy(this.ownResources),o;try{for(a.s();!(o=a.n()).done;){var s=o.value;s.delete()}}catch(u){a.e(u)}finally{a.f()}return be(L(n.prototype),"delete",this).call(this),this}},{key:"update",value:function(a){var o=a.attachments,s=o===void 0?{}:o,u=a.readBuffer,f=a.drawBuffers,l=a.clearAttachments,h=l===void 0?!1:l,d=a.resizeAttachments,p=d===void 0?!0:d;this.attach(s,{clearAttachments:h,resizeAttachments:p});var m=this.gl,v=m.bindFramebuffer(36160,this.handle);return u&&this._setReadBuffer(u),f&&this._setDrawBuffers(f),m.bindFramebuffer(36160,v||null),this}},{key:"resize",value:function(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},o=a.width,s=a.height;if(this.handle===null)return ne(o===void 0&&s===void 0),this.width=this.gl.drawingBufferWidth,this.height=this.gl.drawingBufferHeight,this;o===void 0&&(o=this.gl.drawingBufferWidth),s===void 0&&(s=this.gl.drawingBufferHeight),o!==this.width&&s!==this.height&&he.log(2,"Resizing framebuffer ".concat(this.id," to ").concat(o,"x").concat(s))();for(var u in this.attachments)this.attachments[u].resize({width:o,height:s});return this.width=o,this.height=s,this}},{key:"attach",value:function(a){var o=this,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},u=s.clearAttachments,f=u===void 0?!1:u,l=s.resizeAttachments,h=l===void 0?!0:l,d={};f&&Object.keys(this.attachments).forEach(function(B){d[B]=null}),Object.assign(d,a);var p=this.gl.bindFramebuffer(36160,this.handle);for(var m in d){ne(m!==void 0,"Misspelled framebuffer binding point?");var v=Number(m),g=d[v],y=g;if(!y)this._unattach(v);else if(y instanceof ha)this._attachRenderbuffer({attachment:v,renderbuffer:y});else if(Array.isArray(g)){var A=D(g,3),x=A[0],b=A[1],M=b===void 0?0:b,C=A[2],F=C===void 0?0:C;y=x,this._attachTexture({attachment:v,texture:x,layer:M,level:F})}else this._attachTexture({attachment:v,texture:y,layer:0,level:0});h&&y&&y.resize({width:this.width,height:this.height})}this.gl.bindFramebuffer(36160,p||null),Object.assign(this.attachments,a),Object.keys(this.attachments).filter(function(B){return!o.attachments[B]}).forEach(function(B){delete o.attachments[B]})}},{key:"checkStatus",value:function(){var a=this.gl,o=this.getStatus();if(o!==36053)throw new Error(H2(o));return this}},{key:"getStatus",value:function(){var a=this.gl,o=a.bindFramebuffer(36160,this.handle),s=a.checkFramebufferStatus(36160);return a.bindFramebuffer(36160,o||null),s}},{key:"clear",value:function(){var a=this,o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},s=o.color,u=o.depth,f=o.stencil,l=o.drawBuffers,h=l===void 0?[]:l,d=this.gl.bindFramebuffer(36160,this.handle);return(s||u||f)&&By(this.gl,{color:s,depth:u,stencil:f}),h.forEach(function(p,m){My(a.gl,{drawBuffer:m,value:p})}),this.gl.bindFramebuffer(36160,d||null),this}},{key:"readPixels",value:function(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return he.error("Framebuffer.readPixels() is no logner supported, use readPixelsToArray(framebuffer)")(),null}},{key:"readPixelsToBuffer",value:function(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return he.error("Framebuffer.readPixelsToBuffer()is no logner supported, use readPixelsToBuffer(framebuffer)")(),null}},{key:"copyToDataUrl",value:function(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return he.error("Framebuffer.copyToDataUrl() is no logner supported, use copyToDataUrl(framebuffer)")(),null}},{key:"copyToImage",value:function(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return he.error("Framebuffer.copyToImage() is no logner supported, use copyToImage(framebuffer)")(),null}},{key:"copyToTexture",value:function(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return he.error("Framebuffer.copyToTexture({...}) is no logner supported, use copyToTexture(source, target, opts})")(),null}},{key:"blit",value:function(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return he.error("Framebuffer.blit({...}) is no logner supported, use blit(source, target, opts)")(),null}},{key:"invalidate",value:function(a){var o=a.attachments,s=o===void 0?[]:o,u=a.x,f=u===void 0?0:u,l=a.y,h=l===void 0?0:l,d=a.width,p=a.height,m=We(this.gl),v=m.bindFramebuffer(36008,this.handle),g=f===0&&h===0&&d===void 0&&p===void 0;return g?m.invalidateFramebuffer(36008,s):m.invalidateFramebuffer(36008,s,f,h,d,p),m.bindFramebuffer(36008,v),this}},{key:"getAttachmentParameter",value:function(a,o,s){var u=this._getAttachmentParameterFallback(o);return u===null&&(this.gl.bindFramebuffer(36160,this.handle),u=this.gl.getFramebufferAttachmentParameter(36160,a,o),this.gl.bindFramebuffer(36160,null)),s&&u>1e3&&(u=un(this.gl,u)),u}},{key:"getAttachmentParameters",value:function(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:36064,o=arguments.length>1?arguments[1]:void 0,s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.constructor.ATTACHMENT_PARAMETERS||[],u={},f=Fy(s),l;try{for(f.s();!(l=f.n()).done;){var h=l.value,d=o?un(this.gl,h):h;u[d]=this.getAttachmentParameter(a,h,o)}}catch(p){f.e(p)}finally{f.f()}return u}},{key:"getParameters",value:function(){for(var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,o=Object.keys(this.attachments),s={},u=0,f=o;u<f.length;u++){var l=f[u],h=Number(l),d=a?un(this.gl,h):h;s[d]=this.getAttachmentParameters(h,a)}return s}},{key:"show",value:function(){return typeof window<"u"&&window.open(Pl(this),"luma-debug-texture"),this}},{key:"log",value:function(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";if(a>he.level||typeof window>"u")return this;o=o||"Framebuffer ".concat(this.id);var s=Pl(this,{targetMaxHeight:100});return he.image({logLevel:a,message:o,image:s},o)(),this}},{key:"bind",value:function(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},o=a.target,s=o===void 0?36160:o;return this.gl.bindFramebuffer(s,this.handle),this}},{key:"unbind",value:function(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},o=a.target,s=o===void 0?36160:o;return this.gl.bindFramebuffer(s,null),this}},{key:"_createDefaultAttachments",value:function(a,o,s,u,f){var l=null;if(a){var h;l=l||{},l[36064]=new ln(this.gl,{id:"".concat(this.id,"-color0"),pixels:null,format:6408,type:5121,width:u,height:f,mipmaps:!1,parameters:(h={},c(h,10241,9729),c(h,10240,9729),c(h,10242,33071),c(h,10243,33071),h)}),this.ownResources.push(l[36064])}return o&&s?(l=l||{},l[33306]=new ha(this.gl,{id:"".concat(this.id,"-depth-stencil"),format:35056,width:u,height:111}),this.ownResources.push(l[33306])):o?(l=l||{},l[36096]=new ha(this.gl,{id:"".concat(this.id,"-depth"),format:33189,width:u,height:f}),this.ownResources.push(l[36096])):s&&ne(!1),l}},{key:"_unattach",value:function(a){var o=this.attachments[a];o&&(o instanceof ha?this.gl.framebufferRenderbuffer(36160,a,36161,null):this.gl.framebufferTexture2D(36160,a,3553,null,0),delete this.attachments[a])}},{key:"_attachRenderbuffer",value:function(a){var o=a.attachment,s=o===void 0?36064:o,u=a.renderbuffer,f=this.gl;f.framebufferRenderbuffer(36160,s,36161,u.handle),this.attachments[s]=u}},{key:"_attachTexture",value:function(a){var o=a.attachment,s=o===void 0?36064:o,u=a.texture,f=a.layer,l=a.level,h=this.gl;switch(h.bindTexture(u.target,u.handle),u.target){case 35866:case 32879:var d=We(h);d.framebufferTextureLayer(36160,s,u.target,l,f);break;case 34067:var p=j2(f);h.framebufferTexture2D(36160,s,p,u.handle,l);break;case 3553:h.framebufferTexture2D(36160,s,3553,u.handle,l);break;default:ne(!1,"Illegal texture type")}h.bindTexture(u.target,null),this.attachments[s]=u}},{key:"_setReadBuffer",value:function(a){var o=vl(this.gl);o?o.readBuffer(a):ne(a===36064||a===1029,ky),this.readBuffer=a}},{key:"_setDrawBuffers",value:function(a){var o=this.gl,s=We(o);if(s)s.drawBuffers(a);else{var u=o.getExtension("WEBGL_draw_buffers");u?u.drawBuffersWEBGL(a):ne(a.length===1&&(a[0]===36064||a[0]===1029),ky)}this.drawBuffers=a}},{key:"_getAttachmentParameterFallback",value:function(a){var o=rs(this.gl);switch(a){case 36052:return o.WEBGL2?null:0;case 33298:case 33299:case 33300:case 33301:case 33302:case 33303:return o.WEBGL2?null:8;case 33297:return o.WEBGL2?null:5125;case 33296:return!o.WEBGL2&&!o.EXT_sRGB?9729:null;default:return null}}},{key:"_createHandle",value:function(){return this.gl.createFramebuffer()}},{key:"_deleteHandle",value:function(){this.gl.deleteFramebuffer(this.handle)}},{key:"_bindHandle",value:function(a){return this.gl.bindFramebuffer(36160,a)}}],[{key:"isSupported",value:function(a){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=o.colorBufferFloat,u=o.colorBufferHalfFloat,f=!0;return s&&(f=Boolean(a.getExtension("EXT_color_buffer_float")||a.getExtension("WEBGL_color_buffer_float")||a.getExtension("OES_texture_float"))),u&&(f=f&&Boolean(a.getExtension("EXT_color_buffer_float")||a.getExtension("EXT_color_buffer_half_float"))),f}},{key:"getDefaultFramebuffer",value:function(a){return a.luma=a.luma||{},a.luma.defaultFramebuffer=a.luma.defaultFramebuffer||new n(a,{id:"default-framebuffer",handle:null,attachments:{}}),a.luma.defaultFramebuffer}}]),n}(Cr,Symbol.toStringTag);function j2(e){return e<34069?e+34069:e}function H2(e){var r=Mr.STATUS||{};return r[e]||"Framebuffer error ".concat(e)}var V2=[36049,36048,33296,33298,33299,33300,33301,33302,33303];Mr.ATTACHMENT_PARAMETERS=V2;function Py(e,r){var t=e.gl,n=e.width,i=e.height,a=e.id,o=new Mr(t,Object.assign({},r,{id:"framebuffer-for-".concat(a),width:n,height:i,attachments:c({},36064,e)}));return o}N();q();Y();function Dy(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),t.push.apply(t,n)}return t}function Fl(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{};r%2?Dy(Object(t),!0).forEach(function(n){c(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Dy(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}var Ll=function(){function e(r,t){T(this,e);var n=t.attributes,i=t.material,a=t.pbrDebug,o=t.imageBasedLightingEnvironment,s=t.lights,u=t.useTangents;this.gl=r,this.defines={MANUAL_SRGB:1,SRGB_FAST_APPROXIMATION:1},ts(r,Be.GLSL_TEXTURE_LOD)&&(this.defines.USE_TEX_LOD=1),this.uniforms={u_Camera:[0,0,0],u_MetallicRoughnessValues:[1,1]},this.parameters={},this.generatedTextures=[],o&&(this.uniforms.u_DiffuseEnvSampler=o.getDiffuseEnvSampler(),this.uniforms.u_SpecularEnvSampler=o.getSpecularEnvSampler(),this.uniforms.u_brdfLUT=o.getBrdfTexture(),this.uniforms.u_ScaleIBLAmbient=[1,1]),a&&(this.uniforms.u_ScaleDiffBaseMR=[0,0,0,0],this.uniforms.u_ScaleFGDSpec=[0,0,0,0]),this.defineIfPresent(n.NORMAL,"HAS_NORMALS"),this.defineIfPresent(n.TANGENT&&u,"HAS_TANGENTS"),this.defineIfPresent(n.TEXCOORD_0,"HAS_UV"),this.defineIfPresent(o,"USE_IBL"),this.defineIfPresent(s,"USE_LIGHTS"),this.defineIfPresent(a,"PBR_DEBUG"),i&&this.parseMaterial(i)}return w(e,[{key:"defineIfPresent",value:function(t,n){t&&(this.defines[n]=1)}},{key:"parseTexture",value:function(t,n){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,a=t.texture&&t.texture.sampler&&t.texture.sampler.parameters||{},o=t.texture.source.image,s,u={};o.compressed?(s=o,u=c({},this.gl.TEXTURE_MIN_FILTER,o.data.length>1?this.gl.LINEAR_MIPMAP_NEAREST:this.gl.LINEAR)):s={data:o};var f=new ln(this.gl,Fl({id:t.name||t.id,parameters:Fl(Fl({},a),u),pixelStore:c({},this.gl.UNPACK_FLIP_Y_WEBGL,!1)},s));this.uniforms[n]=f,this.defineIfPresent(i,i),this.generatedTextures.push(f)}},{key:"parsePbrMetallicRoughness",value:function(t){t.baseColorTexture&&this.parseTexture(t.baseColorTexture,"u_BaseColorSampler","HAS_BASECOLORMAP"),this.uniforms.u_BaseColorFactor=t.baseColorFactor||[1,1,1,1],t.metallicRoughnessTexture&&this.parseTexture(t.metallicRoughnessTexture,"u_MetallicRoughnessSampler","HAS_METALROUGHNESSMAP");var n=t.metallicFactor,i=n===void 0?1:n,a=t.roughnessFactor,o=a===void 0?1:a;this.uniforms.u_MetallicRoughnessValues=[i,o]}},{key:"parseMaterial",value:function(t){if(this.uniforms.pbr_uUnlit=Boolean(t.unlit),t.pbrMetallicRoughness&&this.parsePbrMetallicRoughness(t.pbrMetallicRoughness),t.normalTexture){this.parseTexture(t.normalTexture,"u_NormalSampler","HAS_NORMALMAP");var n=t.normalTexture.scale,i=n===void 0?1:n;this.uniforms.u_NormalScale=i}if(t.occlusionTexture){this.parseTexture(t.occlusionTexture,"u_OcclusionSampler","HAS_OCCLUSIONMAP");var a=t.occlusionTexture.strength,o=a===void 0?1:a;this.uniforms.u_OcclusionStrength=o}if(t.emissiveTexture&&(this.parseTexture(t.emissiveTexture,"u_EmissiveSampler","HAS_EMISSIVEMAP"),this.uniforms.u_EmissiveFactor=t.emissiveFactor||[0,0,0]),t.alphaMode==="MASK"){var s=t.alphaCutoff,u=s===void 0?.5:s;this.defines.ALPHA_CUTOFF=1,this.uniforms.u_AlphaCutoff=u}else t.alphaMode==="BLEND"&&(he.warn("BLEND alphaMode might not work well because it requires mesh sorting")(),Object.assign(this.parameters,{blend:!0,blendEquation:this.gl.FUNC_ADD,blendFunc:[this.gl.SRC_ALPHA,this.gl.ONE_MINUS_SRC_ALPHA,this.gl.ONE,this.gl.ONE_MINUS_SRC_ALPHA]}))}},{key:"delete",value:function(){this.generatedTextures.forEach(function(t){return t.delete()})}}]),e}();var ns=X(pl()),jy=X(Ho());var Gy=`#version 300 es
|
|
47
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){t=t.call(e)},n:function(){var f=t.next();return a=f.done,f},e:function(f){o=!0,s=f},f:function(){try{!a&&t.return!=null&&t.return()}finally{if(o)throw s}}}}function G2(e,r){if(e){if(typeof e=="string")return Ly(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);if(t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set")return Array.from(e);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return Ly(e,r)}}function Ly(e,r){(r==null||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function N2(e){var r=U2();return function(){var n=L(e),i;if(r){var a=L(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return $(this,i)}}function U2(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var ky="Multiple render targets not supported",Mr=function(e,r){H(n,e);var t=N2(n);function n(i){var a;T(this,n);var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return a=t.call(this,i,o),a.width=null,a.height=null,a.attachments={},a.readBuffer=36064,a.drawBuffers=[36064],a.ownResources=[],a.initialize(o),Object.seal(oe(a)),a}return w(n,[{key:r,get:function(){return"Framebuffer"}},{key:"MAX_COLOR_ATTACHMENTS",get:function(){var a=We(this.gl);return a.getParameter(a.MAX_COLOR_ATTACHMENTS)}},{key:"MAX_DRAW_BUFFERS",get:function(){var a=We(this.gl);return a.getParameter(a.MAX_DRAW_BUFFERS)}},{key:"color",get:function(){return this.attachments[36064]||null}},{key:"texture",get:function(){return this.attachments[36064]||null}},{key:"depth",get:function(){return this.attachments[36096]||this.attachments[33306]||null}},{key:"stencil",get:function(){return this.attachments[36128]||this.attachments[33306]||null}},{key:"initialize",value:function(a){var o=a.width,s=o===void 0?1:o,u=a.height,f=u===void 0?1:u,l=a.attachments,h=l===void 0?null:l,d=a.color,p=d===void 0?!0:d,m=a.depth,v=m===void 0?!0:m,g=a.stencil,y=g===void 0?!1:g,A=a.check,x=A===void 0?!0:A,b=a.readBuffer,M=b===void 0?void 0:b,C=a.drawBuffers,F=C===void 0?void 0:C;if(ne(s>=0&&f>=0,"Width and height need to be integers"),this.width=s,this.height=f,h)for(var B in h){var S=h[B],_=Array.isArray(S)?S[0]:S;_.resize({width:s,height:f})}else h=this._createDefaultAttachments(p,v,y,s,f);this.update({clearAttachments:!0,attachments:h,readBuffer:M,drawBuffers:F}),h&&x&&this.checkStatus()}},{key:"delete",value:function(){var a=Fy(this.ownResources),o;try{for(a.s();!(o=a.n()).done;){var s=o.value;s.delete()}}catch(u){a.e(u)}finally{a.f()}return _e(L(n.prototype),"delete",this).call(this),this}},{key:"update",value:function(a){var o=a.attachments,s=o===void 0?{}:o,u=a.readBuffer,f=a.drawBuffers,l=a.clearAttachments,h=l===void 0?!1:l,d=a.resizeAttachments,p=d===void 0?!0:d;this.attach(s,{clearAttachments:h,resizeAttachments:p});var m=this.gl,v=m.bindFramebuffer(36160,this.handle);return u&&this._setReadBuffer(u),f&&this._setDrawBuffers(f),m.bindFramebuffer(36160,v||null),this}},{key:"resize",value:function(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},o=a.width,s=a.height;if(this.handle===null)return ne(o===void 0&&s===void 0),this.width=this.gl.drawingBufferWidth,this.height=this.gl.drawingBufferHeight,this;o===void 0&&(o=this.gl.drawingBufferWidth),s===void 0&&(s=this.gl.drawingBufferHeight),o!==this.width&&s!==this.height&&he.log(2,"Resizing framebuffer ".concat(this.id," to ").concat(o,"x").concat(s))();for(var u in this.attachments)this.attachments[u].resize({width:o,height:s});return this.width=o,this.height=s,this}},{key:"attach",value:function(a){var o=this,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},u=s.clearAttachments,f=u===void 0?!1:u,l=s.resizeAttachments,h=l===void 0?!0:l,d={};f&&Object.keys(this.attachments).forEach(function(B){d[B]=null}),Object.assign(d,a);var p=this.gl.bindFramebuffer(36160,this.handle);for(var m in d){ne(m!==void 0,"Misspelled framebuffer binding point?");var v=Number(m),g=d[v],y=g;if(!y)this._unattach(v);else if(y instanceof ha)this._attachRenderbuffer({attachment:v,renderbuffer:y});else if(Array.isArray(g)){var A=D(g,3),x=A[0],b=A[1],M=b===void 0?0:b,C=A[2],F=C===void 0?0:C;y=x,this._attachTexture({attachment:v,texture:x,layer:M,level:F})}else this._attachTexture({attachment:v,texture:y,layer:0,level:0});h&&y&&y.resize({width:this.width,height:this.height})}this.gl.bindFramebuffer(36160,p||null),Object.assign(this.attachments,a),Object.keys(this.attachments).filter(function(B){return!o.attachments[B]}).forEach(function(B){delete o.attachments[B]})}},{key:"checkStatus",value:function(){var a=this.gl,o=this.getStatus();if(o!==36053)throw new Error(H2(o));return this}},{key:"getStatus",value:function(){var a=this.gl,o=a.bindFramebuffer(36160,this.handle),s=a.checkFramebufferStatus(36160);return a.bindFramebuffer(36160,o||null),s}},{key:"clear",value:function(){var a=this,o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},s=o.color,u=o.depth,f=o.stencil,l=o.drawBuffers,h=l===void 0?[]:l,d=this.gl.bindFramebuffer(36160,this.handle);return(s||u||f)&&By(this.gl,{color:s,depth:u,stencil:f}),h.forEach(function(p,m){My(a.gl,{drawBuffer:m,value:p})}),this.gl.bindFramebuffer(36160,d||null),this}},{key:"readPixels",value:function(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return he.error("Framebuffer.readPixels() is no logner supported, use readPixelsToArray(framebuffer)")(),null}},{key:"readPixelsToBuffer",value:function(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return he.error("Framebuffer.readPixelsToBuffer()is no logner supported, use readPixelsToBuffer(framebuffer)")(),null}},{key:"copyToDataUrl",value:function(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return he.error("Framebuffer.copyToDataUrl() is no logner supported, use copyToDataUrl(framebuffer)")(),null}},{key:"copyToImage",value:function(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return he.error("Framebuffer.copyToImage() is no logner supported, use copyToImage(framebuffer)")(),null}},{key:"copyToTexture",value:function(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return he.error("Framebuffer.copyToTexture({...}) is no logner supported, use copyToTexture(source, target, opts})")(),null}},{key:"blit",value:function(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return he.error("Framebuffer.blit({...}) is no logner supported, use blit(source, target, opts)")(),null}},{key:"invalidate",value:function(a){var o=a.attachments,s=o===void 0?[]:o,u=a.x,f=u===void 0?0:u,l=a.y,h=l===void 0?0:l,d=a.width,p=a.height,m=We(this.gl),v=m.bindFramebuffer(36008,this.handle),g=f===0&&h===0&&d===void 0&&p===void 0;return g?m.invalidateFramebuffer(36008,s):m.invalidateFramebuffer(36008,s,f,h,d,p),m.bindFramebuffer(36008,v),this}},{key:"getAttachmentParameter",value:function(a,o,s){var u=this._getAttachmentParameterFallback(o);return u===null&&(this.gl.bindFramebuffer(36160,this.handle),u=this.gl.getFramebufferAttachmentParameter(36160,a,o),this.gl.bindFramebuffer(36160,null)),s&&u>1e3&&(u=un(this.gl,u)),u}},{key:"getAttachmentParameters",value:function(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:36064,o=arguments.length>1?arguments[1]:void 0,s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.constructor.ATTACHMENT_PARAMETERS||[],u={},f=Fy(s),l;try{for(f.s();!(l=f.n()).done;){var h=l.value,d=o?un(this.gl,h):h;u[d]=this.getAttachmentParameter(a,h,o)}}catch(p){f.e(p)}finally{f.f()}return u}},{key:"getParameters",value:function(){for(var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,o=Object.keys(this.attachments),s={},u=0,f=o;u<f.length;u++){var l=f[u],h=Number(l),d=a?un(this.gl,h):h;s[d]=this.getAttachmentParameters(h,a)}return s}},{key:"show",value:function(){return typeof window<"u"&&window.open(Pl(this),"luma-debug-texture"),this}},{key:"log",value:function(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";if(a>he.level||typeof window>"u")return this;o=o||"Framebuffer ".concat(this.id);var s=Pl(this,{targetMaxHeight:100});return he.image({logLevel:a,message:o,image:s},o)(),this}},{key:"bind",value:function(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},o=a.target,s=o===void 0?36160:o;return this.gl.bindFramebuffer(s,this.handle),this}},{key:"unbind",value:function(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},o=a.target,s=o===void 0?36160:o;return this.gl.bindFramebuffer(s,null),this}},{key:"_createDefaultAttachments",value:function(a,o,s,u,f){var l=null;if(a){var h;l=l||{},l[36064]=new ln(this.gl,{id:"".concat(this.id,"-color0"),pixels:null,format:6408,type:5121,width:u,height:f,mipmaps:!1,parameters:(h={},c(h,10241,9729),c(h,10240,9729),c(h,10242,33071),c(h,10243,33071),h)}),this.ownResources.push(l[36064])}return o&&s?(l=l||{},l[33306]=new ha(this.gl,{id:"".concat(this.id,"-depth-stencil"),format:35056,width:u,height:111}),this.ownResources.push(l[33306])):o?(l=l||{},l[36096]=new ha(this.gl,{id:"".concat(this.id,"-depth"),format:33189,width:u,height:f}),this.ownResources.push(l[36096])):s&&ne(!1),l}},{key:"_unattach",value:function(a){var o=this.attachments[a];o&&(o instanceof ha?this.gl.framebufferRenderbuffer(36160,a,36161,null):this.gl.framebufferTexture2D(36160,a,3553,null,0),delete this.attachments[a])}},{key:"_attachRenderbuffer",value:function(a){var o=a.attachment,s=o===void 0?36064:o,u=a.renderbuffer,f=this.gl;f.framebufferRenderbuffer(36160,s,36161,u.handle),this.attachments[s]=u}},{key:"_attachTexture",value:function(a){var o=a.attachment,s=o===void 0?36064:o,u=a.texture,f=a.layer,l=a.level,h=this.gl;switch(h.bindTexture(u.target,u.handle),u.target){case 35866:case 32879:var d=We(h);d.framebufferTextureLayer(36160,s,u.target,l,f);break;case 34067:var p=j2(f);h.framebufferTexture2D(36160,s,p,u.handle,l);break;case 3553:h.framebufferTexture2D(36160,s,3553,u.handle,l);break;default:ne(!1,"Illegal texture type")}h.bindTexture(u.target,null),this.attachments[s]=u}},{key:"_setReadBuffer",value:function(a){var o=vl(this.gl);o?o.readBuffer(a):ne(a===36064||a===1029,ky),this.readBuffer=a}},{key:"_setDrawBuffers",value:function(a){var o=this.gl,s=We(o);if(s)s.drawBuffers(a);else{var u=o.getExtension("WEBGL_draw_buffers");u?u.drawBuffersWEBGL(a):ne(a.length===1&&(a[0]===36064||a[0]===1029),ky)}this.drawBuffers=a}},{key:"_getAttachmentParameterFallback",value:function(a){var o=rs(this.gl);switch(a){case 36052:return o.WEBGL2?null:0;case 33298:case 33299:case 33300:case 33301:case 33302:case 33303:return o.WEBGL2?null:8;case 33297:return o.WEBGL2?null:5125;case 33296:return!o.WEBGL2&&!o.EXT_sRGB?9729:null;default:return null}}},{key:"_createHandle",value:function(){return this.gl.createFramebuffer()}},{key:"_deleteHandle",value:function(){this.gl.deleteFramebuffer(this.handle)}},{key:"_bindHandle",value:function(a){return this.gl.bindFramebuffer(36160,a)}}],[{key:"isSupported",value:function(a){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=o.colorBufferFloat,u=o.colorBufferHalfFloat,f=!0;return s&&(f=Boolean(a.getExtension("EXT_color_buffer_float")||a.getExtension("WEBGL_color_buffer_float")||a.getExtension("OES_texture_float"))),u&&(f=f&&Boolean(a.getExtension("EXT_color_buffer_float")||a.getExtension("EXT_color_buffer_half_float"))),f}},{key:"getDefaultFramebuffer",value:function(a){return a.luma=a.luma||{},a.luma.defaultFramebuffer=a.luma.defaultFramebuffer||new n(a,{id:"default-framebuffer",handle:null,attachments:{}}),a.luma.defaultFramebuffer}}]),n}(Cr,Symbol.toStringTag);function j2(e){return e<34069?e+34069:e}function H2(e){var r=Mr.STATUS||{};return r[e]||"Framebuffer error ".concat(e)}var V2=[36049,36048,33296,33298,33299,33300,33301,33302,33303];Mr.ATTACHMENT_PARAMETERS=V2;function Py(e,r){var t=e.gl,n=e.width,i=e.height,a=e.id,o=new Mr(t,Object.assign({},r,{id:"framebuffer-for-".concat(a),width:n,height:i,attachments:c({},36064,e)}));return o}N();q();Y();function Dy(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),t.push.apply(t,n)}return t}function Fl(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{};r%2?Dy(Object(t),!0).forEach(function(n){c(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Dy(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}var Ll=function(){function e(r,t){T(this,e);var n=t.attributes,i=t.material,a=t.pbrDebug,o=t.imageBasedLightingEnvironment,s=t.lights,u=t.useTangents;this.gl=r,this.defines={MANUAL_SRGB:1,SRGB_FAST_APPROXIMATION:1},ts(r,Be.GLSL_TEXTURE_LOD)&&(this.defines.USE_TEX_LOD=1),this.uniforms={u_Camera:[0,0,0],u_MetallicRoughnessValues:[1,1]},this.parameters={},this.generatedTextures=[],o&&(this.uniforms.u_DiffuseEnvSampler=o.getDiffuseEnvSampler(),this.uniforms.u_SpecularEnvSampler=o.getSpecularEnvSampler(),this.uniforms.u_brdfLUT=o.getBrdfTexture(),this.uniforms.u_ScaleIBLAmbient=[1,1]),a&&(this.uniforms.u_ScaleDiffBaseMR=[0,0,0,0],this.uniforms.u_ScaleFGDSpec=[0,0,0,0]),this.defineIfPresent(n.NORMAL,"HAS_NORMALS"),this.defineIfPresent(n.TANGENT&&u,"HAS_TANGENTS"),this.defineIfPresent(n.TEXCOORD_0,"HAS_UV"),this.defineIfPresent(o,"USE_IBL"),this.defineIfPresent(s,"USE_LIGHTS"),this.defineIfPresent(a,"PBR_DEBUG"),i&&this.parseMaterial(i)}return w(e,[{key:"defineIfPresent",value:function(t,n){t&&(this.defines[n]=1)}},{key:"parseTexture",value:function(t,n){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,a=t.texture&&t.texture.sampler&&t.texture.sampler.parameters||{},o=t.texture.source.image,s,u={};o.compressed?(s=o,u=c({},this.gl.TEXTURE_MIN_FILTER,o.data.length>1?this.gl.LINEAR_MIPMAP_NEAREST:this.gl.LINEAR)):s={data:o};var f=new ln(this.gl,Fl({id:t.name||t.id,parameters:Fl(Fl({},a),u),pixelStore:c({},this.gl.UNPACK_FLIP_Y_WEBGL,!1)},s));this.uniforms[n]=f,this.defineIfPresent(i,i),this.generatedTextures.push(f)}},{key:"parsePbrMetallicRoughness",value:function(t){t.baseColorTexture&&this.parseTexture(t.baseColorTexture,"u_BaseColorSampler","HAS_BASECOLORMAP"),this.uniforms.u_BaseColorFactor=t.baseColorFactor||[1,1,1,1],t.metallicRoughnessTexture&&this.parseTexture(t.metallicRoughnessTexture,"u_MetallicRoughnessSampler","HAS_METALROUGHNESSMAP");var n=t.metallicFactor,i=n===void 0?1:n,a=t.roughnessFactor,o=a===void 0?1:a;this.uniforms.u_MetallicRoughnessValues=[i,o]}},{key:"parseMaterial",value:function(t){if(this.uniforms.pbr_uUnlit=Boolean(t.unlit),t.pbrMetallicRoughness&&this.parsePbrMetallicRoughness(t.pbrMetallicRoughness),t.normalTexture){this.parseTexture(t.normalTexture,"u_NormalSampler","HAS_NORMALMAP");var n=t.normalTexture.scale,i=n===void 0?1:n;this.uniforms.u_NormalScale=i}if(t.occlusionTexture){this.parseTexture(t.occlusionTexture,"u_OcclusionSampler","HAS_OCCLUSIONMAP");var a=t.occlusionTexture.strength,o=a===void 0?1:a;this.uniforms.u_OcclusionStrength=o}if(t.emissiveTexture&&(this.parseTexture(t.emissiveTexture,"u_EmissiveSampler","HAS_EMISSIVEMAP"),this.uniforms.u_EmissiveFactor=t.emissiveFactor||[0,0,0]),t.alphaMode==="MASK"){var s=t.alphaCutoff,u=s===void 0?.5:s;this.defines.ALPHA_CUTOFF=1,this.uniforms.u_AlphaCutoff=u}else t.alphaMode==="BLEND"&&(he.warn("BLEND alphaMode might not work well because it requires mesh sorting")(),Object.assign(this.parameters,{blend:!0,blendEquation:this.gl.FUNC_ADD,blendFunc:[this.gl.SRC_ALPHA,this.gl.ONE_MINUS_SRC_ALPHA,this.gl.ONE,this.gl.ONE_MINUS_SRC_ALPHA]}))}},{key:"delete",value:function(){this.generatedTextures.forEach(function(t){return t.delete()})}}]),e}();var ns=X(pl()),jy=X(Ho());var Gy=`#version 300 es
|
|
48
48
|
#define SHADER_NAME simple-mesh-layer-vs
|
|
49
49
|
uniform float sizeScale;
|
|
50
50
|
uniform bool composeModelMatrix;
|
|
@@ -162,9 +162,9 @@ void main(void) {
|
|
|
162
162
|
|
|
163
163
|
DECKGL_FILTER_COLOR(fragColor, geometry);
|
|
164
164
|
}
|
|
165
|
-
`;function Uy(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),t.push.apply(t,n)}return t}function Or(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{};r%2?Uy(Object(t),!0).forEach(function(n){c(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Uy(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}function z2(e){var r=W2();return function(){var n=L(e),i;if(r){var a=L(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return $(this,i)}}function W2(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function J2(e){var r=e.COLOR_0||e.colors;r||(e.colors={constant:!0,value:new Float32Array([1,1,1])})}var X2={pbrMaterial:{type:"object",value:null},featureIds:{type:"array",value:null,optional:!0}},is=function(e){H(t,e);var r=z2(t);function t(){return T(this,t),r.apply(this,arguments)}return w(t,[{key:"getShaders",value:function(){var i=be(L(t.prototype),"getShaders",this).call(this),a=i.modules;return a.push(ns.pbr),Or(Or({},i),{},{vs:Gy,fs:Ny})}},{key:"initializeState",value:function(){var i=this.props.featureIds;be(L(t.prototype),"initializeState",this).call(this);var a=this.getAttributeManager();i&&a.add({featureIdsPickingColors:{type:5121,size:3,noAlloc:!0,update:this.calculateFeatureIdsPickingColors}})}},{key:"updateState",value:function(i){be(L(t.prototype),"updateState",this).call(this,i);var a=i.props,o=i.oldProps;a.pbrMaterial!==o.pbrMaterial&&this.updatePbrMaterialUniforms(a.pbrMaterial)}},{key:"draw",value:function(i){var a=this.props.featureIds;this.state.model&&(this.state.model.setUniforms({u_Camera:this.state.model.getUniforms().project_uCameraPosition,pickFeatureIds:Boolean(a)}),be(L(t.prototype),"draw",this).call(this,i))}},{key:"getModel",value:function(i){var a=this.props,o=a.id,s=a.pbrMaterial,u=this.parseMaterial(s,i);this.setState({materialParser:u});var f=this.getShaders();J2(i.attributes);var l=new ns.Model(this.context.gl,Or(Or({},this.getShaders()),{},{id:o,geometry:i,defines:Or(Or(Or({},f.defines),u?.defines),{},{HAS_UV_REGIONS:i.attributes.uvRegions}),parameters:u?.parameters,isInstanced:!0}));return l}},{key:"updatePbrMaterialUniforms",value:function(i){var a=this.state.model;if(a){var o=this.props.mesh,s=this.parseMaterial(i,o);this.setState({materialParser:s}),a.setUniforms(s.uniforms)}}},{key:"parseMaterial",value:function(i,a){var o,s=Boolean(i.pbrMetallicRoughness&&i.pbrMetallicRoughness.baseColorTexture);return(o=this.state.materialParser)===null||o===void 0||o.delete(),new Ll(this.context.gl,{attributes:{NORMAL:a.attributes.normals,TEXCOORD_0:a.attributes.texCoords},material:Or({unlit:s},i),pbrDebug:!1,imageBasedLightingEnvironment:null,lights:!0,useTangents:!1})}},{key:"calculateFeatureIdsPickingColors",value:function(i){for(var a=this.props.featureIds,o=new Uint8ClampedArray(a.length*i.size),s=[],u=0;u<a.length;u++)this.encodePickingColor(a[u],s),o[u*3]=s[0],o[u*3+1]=s[1],o[u*3+2]=s[2];i.value=o}},{key:"finalizeState",value:function(i){var a;be(L(t.prototype),"finalizeState",this).call(this,i),(a=this.state.materialParser)===null||a===void 0||a.delete(),this.setState({materialParser:null})}}]),t}(jy.SimpleMeshLayer);c(is,"layerName","MeshLayer");c(is,"defaultProps",X2);var I_=X(ni());ue();N();q();Y();var pn=X(re());N();ue();q();Y();N();var rr=6378137,nr=6378137,ir=6356752314245179e-9,q2={radii:[rr,nr,ir],radiiSquared:[rr*rr,nr*nr,ir*ir],oneOverRadii:[1/rr,1/nr,1/ir],oneOverRadiiSquared:[1/(rr*rr),1/(nr*nr),1/(ir*ir)],maximumRadius:Math.max(rr,nr,ir),centerToleranceSquared:.1};function as(e){return e}var JW=new E;function K2(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:as;return"longitude"in e?(r[0]=t(e.longitude),r[1]=t(e.latitude),r[2]=e.height):"x"in e?(r[0]=t(e.x),r[1]=t(e.y),r[2]=e.z):(r[0]=t(e[0]),r[1]=t(e[1]),r[2]=e[2]),r}function Vy(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];return K2(e,r,xe._cartographicRadians?as:Uf)}function Y2(e,r){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:as;return"longitude"in r?(r.longitude=t(e[0]),r.latitude=t(e[1]),r.height=e[2]):"x"in r?(r.x=t(e[0]),r.y=t(e[1]),r.z=e[2]):(r[0]=t(e[0]),r[1]=t(e[1]),r[2]=e[2]),r}function zy(e,r){return Y2(e,r,xe._cartographicRadians?as:jf)}var ii=new E,Z2=new E,$2=new E;function kl(e,r){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[],n=r.oneOverRadii,i=r.oneOverRadiiSquared,a=r.centerToleranceSquared;ii.from(e);var o=ii.x,s=ii.y,u=ii.z,f=n.x,l=n.y,h=n.z,d=o*o*f*f,p=s*s*l*l,m=u*u*h*h,v=d+p+m,g=Math.sqrt(1/v);if(Number.isFinite(g)){var y=Z2;if(y.copy(e).scale(g),v<a)return y.to(t);var A=i.x,x=i.y,b=i.z,M=$2;M.set(y.x*A*2,y.y*x*2,y.z*b*2);var C=(1-g)*ii.len()/(.5*M.len()),F=0,B,S,_,R;do{C-=F,B=1/(1+C*A),S=1/(1+C*x),_=1/(1+C*b);var k=B*B,U=S*S,j=_*_,Z=k*B,P=U*S,O=j*_;R=d*k+p*U+m*j-1;var G=d*Z*A+p*P*x+m*O*b,J=-2*G;F=R/J}while(Math.abs(R)>Nt.EPSILON12);return ii.scale([B,S,_]).to(t)}}var Wy=1e-14,Q2=new E,Jy={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"}},Dl={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},ar={east:new E,north:new E,up:new E,west:new E,south:new E,down:new E},eB=new E,tB=new E,rB=new E;function os(e,r,t,n,i,a){var o=Jy[r]&&Jy[r][t];de(o&&(!n||n===o));var s,u,f,l=Q2.copy(i),h=He(l.x,0,Wy)&&He(l.y,0,Wy);if(h){var d=Math.sign(l.z);s=eB.fromArray(Dl[r]),r!=="east"&&r!=="west"&&s.scale(d),u=tB.fromArray(Dl[t]),t!=="east"&&t!=="west"&&u.scale(d),f=rB.fromArray(Dl[n]),n!=="east"&&n!=="west"&&f.scale(d)}else{var p=ar.up,m=ar.east,v=ar.north;m.set(-l.y,l.x,0).normalize(),e.geodeticSurfaceNormal(l,p),v.copy(p).cross(m);var g=ar.down,y=ar.west,A=ar.south;g.copy(p).scale(-1),y.copy(m).scale(-1),A.copy(v).scale(-1),s=ar[r],u=ar[t],f=ar[n]}return a[0]=s.x,a[1]=s.y,a[2]=s.z,a[3]=0,a[4]=u.x,a[5]=u.y,a[6]=u.z,a[7]=0,a[8]=f.x,a[9]=f.y,a[10]=f.z,a[11]=0,a[12]=l.x,a[13]=l.y,a[14]=l.z,a[15]=1,a}var ss=new E,Xy=new E,nB=new E,Bt=new E,iB=new E,us=new E;var ve=function(){function e(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;T(this,e),c(this,"radii",void 0),c(this,"radiiSquared",void 0),c(this,"radiiToTheFourth",void 0),c(this,"oneOverRadii",void 0),c(this,"oneOverRadiiSquared",void 0),c(this,"minimumRadius",void 0),c(this,"maximumRadius",void 0),c(this,"centerToleranceSquared",Nt.EPSILON1),c(this,"squaredXOverSquaredZ",void 0),de(r>=0),de(t>=0),de(n>=0),this.radii=new E(r,t,n),this.radiiSquared=new E(r*r,t*t,n*n),this.radiiToTheFourth=new E(r*r*r*r,t*t*t*t,n*n*n*n),this.oneOverRadii=new E(r===0?0:1/r,t===0?0:1/t,n===0?0:1/n),this.oneOverRadiiSquared=new E(r===0?0:1/(r*r),t===0?0:1/(t*t),n===0?0:1/(n*n)),this.minimumRadius=Math.min(r,t,n),this.maximumRadius=Math.max(r,t,n),this.radiiSquared.z!==0&&(this.squaredXOverSquaredZ=this.radiiSquared.x/this.radiiSquared.z),Object.freeze(this)}return w(e,[{key:"equals",value:function(t){return this===t||Boolean(t&&this.radii.equals(t.radii))}},{key:"toString",value:function(){return this.radii.toString()}},{key:"cartographicToCartesian",value:function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[0,0,0],i=Xy,a=nB,o=D(t,3),s=o[2];this.geodeticSurfaceNormalCartographic(t,i),a.copy(this.radiiSquared).scale(i);var u=Math.sqrt(i.dot(a));return a.scale(1/u),i.scale(s),a.add(i),a.to(n)}},{key:"cartesianToCartographic",value:function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[0,0,0];us.from(t);var i=this.scaleToGeodeticSurface(us,Bt);if(i){var a=this.geodeticSurfaceNormal(i,Xy),o=iB;o.copy(us).subtract(i);var s=Math.atan2(a.y,a.x),u=Math.asin(a.z),f=Math.sign(Ji(o,us))*Ef(o);return zy([s,u,f],n)}}},{key:"eastNorthUpToFixedFrame",value:function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:new se;return os(this,"east","north","up",t,n)}},{key:"localFrameToFixedFrame",value:function(t,n,i,a){var o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:new se;return os(this,t,n,i,a,o)}},{key:"geocentricSurfaceNormal",value:function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[0,0,0];return ss.from(t).normalize().to(n)}},{key:"geodeticSurfaceNormalCartographic",value:function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[0,0,0],i=Vy(t),a=i[0],o=i[1],s=Math.cos(o);return ss.set(s*Math.cos(a),s*Math.sin(a),Math.sin(o)).normalize(),ss.to(n)}},{key:"geodeticSurfaceNormal",value:function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[0,0,0];return ss.from(t).scale(this.oneOverRadiiSquared).normalize().to(n)}},{key:"scaleToGeodeticSurface",value:function(t,n){return kl(t,this,n)}},{key:"scaleToGeocentricSurface",value:function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[0,0,0];Bt.from(t);var i=Bt.x,a=Bt.y,o=Bt.z,s=this.oneOverRadiiSquared,u=1/Math.sqrt(i*i*s.x+a*a*s.y+o*o*s.z);return Bt.multiplyScalar(u).to(n)}},{key:"transformPositionToScaledSpace",value:function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[0,0,0];return Bt.from(t).scale(this.oneOverRadii).to(n)}},{key:"transformPositionFromScaledSpace",value:function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[0,0,0];return Bt.from(t).scale(this.radii).to(n)}},{key:"getSurfaceNormalIntersectionWithZAxis",value:function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[0,0,0];de(He(this.radii.x,this.radii.y,Nt.EPSILON15)),de(this.radii.z>0),Bt.from(t);var a=Bt.z*(1-this.squaredXOverSquaredZ);if(!(Math.abs(a)>=this.radii.z-n))return Bt.set(0,0,a).to(i)}}]),e}();c(ve,"WGS84",new ve(rr,nr,ir));N();N();function da(){let e;if(typeof window<"u"&&window.performance)e=window.performance.now();else if(typeof process<"u"&&process.hrtime){let r=process.hrtime();e=r[0]*1e3+r[1]/1e6}else e=Date.now();return e}var hn=class{constructor(r,t){c(this,"name",void 0),c(this,"type",void 0),c(this,"sampleSize",1),c(this,"time",0),c(this,"count",0),c(this,"samples",0),c(this,"lastTiming",0),c(this,"lastSampleTime",0),c(this,"lastSampleCount",0),c(this,"_count",0),c(this,"_time",0),c(this,"_samples",0),c(this,"_startTime",0),c(this,"_timerPending",!1),this.name=r,this.type=t,this.reset()}reset(){return this.time=0,this.count=0,this.samples=0,this.lastTiming=0,this.lastSampleTime=0,this.lastSampleCount=0,this._count=0,this._time=0,this._samples=0,this._startTime=0,this._timerPending=!1,this}setSampleSize(r){return this.sampleSize=r,this}incrementCount(){return this.addCount(1),this}decrementCount(){return this.subtractCount(1),this}addCount(r){return this._count+=r,this._samples++,this._checkSampling(),this}subtractCount(r){return this._count-=r,this._samples++,this._checkSampling(),this}addTime(r){return this._time+=r,this.lastTiming=r,this._samples++,this._checkSampling(),this}timeStart(){return this._startTime=da(),this._timerPending=!0,this}timeEnd(){return this._timerPending?(this.addTime(da()-this._startTime),this._timerPending=!1,this._checkSampling(),this):this}getSampleAverageCount(){return this.sampleSize>0?this.lastSampleCount/this.sampleSize:0}getSampleAverageTime(){return this.sampleSize>0?this.lastSampleTime/this.sampleSize:0}getSampleHz(){return this.lastSampleTime>0?this.sampleSize/(this.lastSampleTime/1e3):0}getAverageCount(){return this.samples>0?this.count/this.samples:0}getAverageTime(){return this.samples>0?this.time/this.samples:0}getHz(){return this.time>0?this.samples/(this.time/1e3):0}_checkSampling(){this._samples===this.sampleSize&&(this.lastSampleTime=this._time,this.lastSampleCount=this._count,this.count+=this._count,this.time+=this._time,this.samples+=this._samples,this._time=0,this._count=0,this._samples=0)}};var ai=class{constructor(r){c(this,"id",void 0),c(this,"stats",{}),this.id=r.id,this.stats={},this._initializeStats(r.stats),Object.seal(this)}get(r){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"count";return this._getOrCreate({name:r,type:t})}get size(){return Object.keys(this.stats).length}reset(){for(let r of Object.values(this.stats))r.reset();return this}forEach(r){for(let t of Object.values(this.stats))r(t)}getTable(){let r={};return this.forEach(t=>{r[t.name]={time:t.time||0,count:t.count||0,average:t.getAverageTime()||0,hz:t.getHz()||0}}),r}_initializeStats(){(arguments.length>0&&arguments[0]!==void 0?arguments[0]:[]).forEach(t=>this._getOrCreate(t))}_getOrCreate(r){let{name:t,type:n}=r,i=this.stats[t];return i||(r instanceof hn?i=r:i=new hn(t,n),this.stats[t]=i),i}};q();Y();N();q();Y();N();q();N();var qy=function e(r,t,n){T(this,e),c(this,"item",void 0),c(this,"previous",void 0),c(this,"next",void 0),this.item=r,this.previous=t,this.next=n};var Ky=function(){function e(){T(this,e),c(this,"head",null),c(this,"tail",null),c(this,"_length",0)}return w(e,[{key:"length",get:function(){return this._length}},{key:"add",value:function(t){var n=new qy(t,this.tail,null);return this.tail?(this.tail.next=n,this.tail=n):(this.head=n,this.tail=n),++this._length,n}},{key:"remove",value:function(t){t&&(t.previous&&t.next?(t.previous.next=t.next,t.next.previous=t.previous):t.previous?(t.previous.next=null,this.tail=t.previous):t.next?(t.next.previous=null,this.head=t.next):(this.head=null,this.tail=null),t.next=null,t.previous=null,--this._length)}},{key:"splice",value:function(t,n){t!==n&&(this.remove(n),this._insert(t,n))}},{key:"_insert",value:function(t,n){var i=t.next;t.next=n,this.tail===t?this.tail=n:i.previous=n,n.next=i,n.previous=t,++this._length}}]),e}();var Yy=function(){function e(){T(this,e),c(this,"_list",void 0),c(this,"_sentinel",void 0),c(this,"_trimTiles",void 0),this._list=new Ky,this._sentinel=this._list.add("sentinel"),this._trimTiles=!1}return w(e,[{key:"reset",value:function(){this._list.splice(this._list.tail,this._sentinel)}},{key:"touch",value:function(t){var n=t._cacheNode;n&&this._list.splice(this._sentinel,n)}},{key:"add",value:function(t,n,i){n._cacheNode||(n._cacheNode=this._list.add(n),i&&i(t,n))}},{key:"unloadTile",value:function(t,n,i){var a=n._cacheNode;a&&(this._list.remove(a),n._cacheNode=null,i&&i(t,n))}},{key:"unloadTiles",value:function(t,n){var i=this._trimTiles;this._trimTiles=!1;for(var a=this._list,o=t.maximumMemoryUsage*1024*1024,s=this._sentinel,u=a.head;u!==s&&(t.gpuMemoryUsageInBytes>o||i);){var f=u.item;u=u.next,this.unloadTile(t,f,n)}}},{key:"trim",value:function(){this._trimTiles=!0}}]),e}();function Zy(e,r){ce(e),ce(r);var t=r.rtcCenter,n=r.gltfUpAxis,i=e.computedTransform,a=e.boundingVolume.center,o=new se(i);switch(t&&o.translate(t),n){case"Z":break;case"Y":var s=new se().rotateX(Math.PI/2);o=o.multiplyRight(s);break;case"X":var u=new se().rotateY(-Math.PI/2);o=o.multiplyRight(u);break;default:break}r.isQuantized&&o.translate(r.quantizedVolumeOffset).scale(r.quantizedVolumeScale);var f=new E(a);r.cartesianModelMatrix=o,r.cartesianOrigin=f;var l=ve.WGS84.cartesianToCartographic(f,new E),h=ve.WGS84.eastNorthUpToFixedFrame(f),d=h.invert();r.cartographicModelMatrix=d.multiplyRight(o),r.cartographicOrigin=l,r.coordinateSystem||(r.modelMatrix=r.cartographicModelMatrix)}ue();function aB(e,r){var t=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=oB(e))||r&&e&&typeof e.length=="number"){t&&(e=t);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(f){throw f},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
166
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){t=t.call(e)},n:function(){var f=t.next();return a=f.done,f},e:function(f){o=!0,s=f},f:function(){try{!a&&t.return!=null&&t.return()}finally{if(o)throw s}}}}function oB(e,r){if(e){if(typeof e=="string")return $y(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);if(t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set")return Array.from(e);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return $y(e,r)}}function $y(e,r){(r==null||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}var Qy=new E,Gl=new E,Nl=new ot([new Ge,new Ge,new Ge,new Ge,new Ge,new Ge]);function t0(e,r){var t=e.cameraDirection,n=e.cameraUp,i=e.height,a=e.distanceScales.metersPerUnit,o=fs(e,e.center),s=ve.WGS84.eastNorthUpToFixedFrame(o),u=e.unprojectPosition(e.cameraPosition),f=ve.WGS84.cartographicToCartesian(u,new E),l=new E(s.transformAsVector(new E(t).scale(a))).normalize(),h=new E(s.transformAsVector(new E(n).scale(a))).normalize();sB(e);var d=e.constructor,p=e.longitude,m=e.latitude,v=e.width,g=e.bearing,y=e.zoom,A=new d({longitude:p,latitude:m,height:i,width:v,bearing:g,zoom:y,pitch:0});return{camera:{position:f,direction:l,up:h},viewport:e,topDownViewport:A,height:i,cullingVolume:Nl,frameNumber:r,sseDenominator:1.15}}function r0(e,r,t){if(t===0||e.length<=t)return[e,[]];var n=[],i=r.viewport,a=i.longitude,o=i.latitude,s=aB(e.entries()),u;try{for(s.s();!(u=s.n()).done;){var f=D(u.value,2),l=f[0],h=f[1],d=D(h.header.mbs,2),p=d[0],m=d[1],v=Math.abs(a-p),g=Math.abs(o-m),y=Math.sqrt(g*g+v*v);n.push([l,y])}}catch(F){s.e(F)}finally{s.f()}for(var A=n.sort(function(F,B){return F[1]-B[1]}),x=[],b=0;b<t;b++)x.push(e[A[b][0]]);for(var M=[],C=t;C<A.length;C++)M.push(e[A[C][0]]);return[x,M]}function sB(e){var r=e.getFrustumPlanes(),t=e0(r.near,e.cameraPosition),n=fs(e,t),i=fs(e,e.cameraPosition,Gl),a=0;Nl.planes[a++].fromPointNormal(n,Qy.copy(n).subtract(i));for(var o in r)if(o!=="near"){var s=r[o],u=e0(s,t,Gl),f=fs(e,u,Gl);Nl.planes[a++].fromPointNormal(f,Qy.copy(n).subtract(f))}}function e0(e,r){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:new E,n=e.normal.dot(r);return t.copy(e.normal).scale(e.distance-n).add(r),t}function fs(e,r){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:new E,n=e.unprojectPosition(r);return ve.WGS84.cartographicToCartesian(n,t)}ue();var uB=6378137,fB=6378137,Ul=6356752314245179e-9,n0=new E;function i0(e,r){if(e instanceof rn){var t=e.halfAxes,n=lB(t);return Math.log2(Ul/(n+r[2]))}else if(e instanceof Tr){var i=e.radius;return Math.log2(Ul/(i+r[2]))}else if(e.width&&e.height){var a=e.width,o=e.height,s=Math.log2(uB/a),u=Math.log2(fB/o);return(s+u)/2}return 1}function jl(e,r,t){var n=ve.WGS84.cartographicToCartesian([e.xmax,e.ymax,e.zmax],new E),i=Math.sqrt(Math.pow(n[0]-t[0],2)+Math.pow(n[1]-t[1],2)+Math.pow(n[2]-t[2],2));return Math.log2(Ul/(i+r[2]))}function a0(e,r,t){var n=D(e,4),i=n[0],a=n[1],o=n[2],s=n[3];return jl({xmin:i,xmax:o,ymin:a,ymax:s,zmin:0,zmax:0},r,t)}function lB(e){e.getColumn(0,n0);var r=e.getColumn(1),t=e.getColumn(2),n=n0.add(r).add(t),i=n.len();return i}N();q();Y();var Jl=X(re());N();var T0=X(ni());var rt={UNLOADED:0,LOADING:1,PROCESSING:2,READY:3,EXPIRED:4,FAILED:5},st={ADD:1,REPLACE:2},or={EMPTY:"empty",SCENEGRAPH:"scenegraph",POINTCLOUD:"pointcloud",MESH:"mesh"},Ke={I3S:"I3S",TILES3D:"TILES3D"},dn={GEOMETRIC_ERROR:"geometricError",MAX_SCREEN_THRESHOLD:"maxScreenThreshold"},o0={NOT_COMPUTED:-1,USE_OPTIMIZATION:1,SKIP_OPTIMIZATION:0};ue();function u0(e){return e!=null}var Ye=new E,ls=new E,cB=new E,hB=new E;function cs(e,r,t){if(ce(e,"3D Tile: boundingVolume must be defined"),e.box)return dB(e.box,r,t);if(e.region){var n=D(e.region,6),i=n[0],a=n[1],o=n[2],s=n[3],u=n[4],f=n[5],l=ve.WGS84.cartographicToCartesian([wt(i),wt(s),u],cB),h=ve.WGS84.cartographicToCartesian([wt(o),wt(a),f],hB),d=new E().addVectors(l,h).multiplyScalar(.5),p=new E().subVectors(l,h).len()/2;return s0([d[0],d[1],d[2],p],new se)}if(e.sphere)return s0(e.sphere,r,t);throw new Error("3D Tile: boundingVolume must contain a sphere, region, or box")}function f0(e,r){if(e.box)return pB(r);if(e.region){var t=D(e.region,6),n=t[0],i=t[1],a=t[2],o=t[3],s=t[4],u=t[5];return[[wt(n),wt(i),s],[wt(a),wt(o),u]]}if(e.sphere)return mB(r);throw new Error("Unkown boundingVolume type")}function dB(e,r,t){var n=new E(e[0],e[1],e[2]);r.transform(n,n);var i=[];if(e.length===10){var a=e.slice(3,6),o=new br;o.fromArray(e,6);var s=new E([1,0,0]),u=new E([0,1,0]),f=new E([0,0,1]);s.transformByQuaternion(o),s.scale(a[0]),u.transformByQuaternion(o),u.scale(a[1]),f.transformByQuaternion(o),f.scale(a[2]),i=[].concat(K(s.toArray()),K(u.toArray()),K(f.toArray()))}else i=[].concat(K(e.slice(3,6)),K(e.slice(6,9)),K(e.slice(9,12)));var l=r.transformAsVector(i.slice(0,3)),h=r.transformAsVector(i.slice(3,6)),d=r.transformAsVector(i.slice(6,9)),p=new
|
|
167
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){t=t.call(e)},n:function(){var f=t.next();return a=f.done,f},e:function(f){o=!0,s=f},f:function(){try{!a&&t.return!=null&&t.return()}finally{if(o)throw s}}}}function AB(e,r){if(e){if(typeof e=="string")return y0(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);if(t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set")return Array.from(e);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return y0(e,r)}}function y0(e,r){(r==null||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function A0(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),t.push.apply(t,n)}return t}function ds(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{};r%2?A0(Object(t),!0).forEach(function(n){c(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):A0(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}var _B={loadSiblings:!1,skipLevelOfDetail:!1,maximumScreenSpaceError:2,updateTransforms:!0,onTraversalEnd:function(){},viewportTraversersMap:{},basePath:""},Ir=function(){function e(r){T(this,e),c(this,"options",void 0),c(this,"root",null),c(this,"selectedTiles",{}),c(this,"requestedTiles",{}),c(this,"emptyTiles",{}),c(this,"lastUpdate",new Date().getTime()),c(this,"updateDebounceTime",1e3),c(this,"_traversalStack",new Wl),c(this,"_emptyTraversalStack",new Wl),c(this,"_frameNumber",null),this.options=ds(ds({},_B),r)}return w(e,[{key:"traversalFinished",value:function(t){return!0}},{key:"traverse",value:function(t,n,i){this.root=t,this.options=ds(ds({},this.options),i),this.reset(),this.updateTile(t,n),this._frameNumber=n.frameNumber,this.executeTraversal(t,n)}},{key:"reset",value:function(){this.requestedTiles={},this.selectedTiles={},this.emptyTiles={},this._traversalStack.reset(),this._emptyTraversalStack.reset()}},{key:"executeTraversal",value:function(t,n){var i=this._traversalStack;for(t._selectionDepth=1,i.push(t);i.length>0;){var a=i.pop(),o=!1;this.canTraverse(a,n)&&(this.updateChildTiles(a,n),o=this.updateAndPushChildren(a,n,i,a.hasRenderContent?a._selectionDepth+1:a._selectionDepth));var s=a.parent,u=Boolean(!s||s._shouldRefine),f=!o;a.hasRenderContent?a.refine===st.ADD?(this.loadTile(a,n),this.selectTile(a,n)):a.refine===st.REPLACE&&(this.loadTile(a,n),f&&this.selectTile(a,n)):(this.emptyTiles[a.id]=a,this.loadTile(a,n),f&&this.selectTile(a,n)),this.touchTile(a,n),a._shouldRefine=o&&u}var l=new Date().getTime();(this.traversalFinished(n)||l-this.lastUpdate>this.updateDebounceTime)&&(this.lastUpdate=l,this.options.onTraversalEnd(n))}},{key:"updateChildTiles",value:function(t,n){var i=t.children,a=hs(i),o;try{for(a.s();!(o=a.n()).done;){var s=o.value;this.updateTile(s,n)}}catch(u){a.e(u)}finally{a.f()}}},{key:"updateAndPushChildren",value:function(t,n,i,a){var o=this.options,s=o.loadSiblings,u=o.skipLevelOfDetail,f=t.children;f.sort(this.compareDistanceToCamera.bind(this));var l=t.refine===st.REPLACE&&t.hasRenderContent&&!u,h=!1,d=!0,p=hs(f),m;try{for(p.s();!(m=p.n()).done;){var v=m.value;if(v._selectionDepth=a,v.isVisibleAndInRequestVolume?(i.find(v)&&i.delete(v),i.push(v),h=!0):(l||s)&&(this.loadTile(v,n),this.touchTile(v,n)),l){var g=void 0;if(v._inRequestVolume?v.hasRenderContent?g=v.contentAvailable:g=this.executeEmptyTraversal(v,n):g=!1,d=d&&g,!d)return!1}}}catch(y){p.e(y)}finally{p.f()}return h||(d=!1),d}},{key:"updateTile",value:function(t,n){this.updateTileVisibility(t,n)}},{key:"selectTile",value:function(t,n){this.shouldSelectTile(t)&&(t._selectedFrame=n.frameNumber,this.selectedTiles[t.id]=t)}},{key:"loadTile",value:function(t,n){this.shouldLoadTile(t)&&(t._requestedFrame=n.frameNumber,t._priority=t._getPriority(),this.requestedTiles[t.id]=t)}},{key:"touchTile",value:function(t,n){t.tileset._cache.touch(t),t._touchedFrame=n.frameNumber}},{key:"canTraverse",value:function(t,n){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;return t.hasChildren?t.hasTilesetContent?!t.contentExpired:!a&&!t.isVisibleAndInRequestVolume?!1:this.shouldRefine(t,n,i):!1}},{key:"shouldLoadTile",value:function(t){return t.hasUnloadedContent||t.contentExpired}},{key:"shouldSelectTile",value:function(t){return t.contentAvailable&&!this.options.skipLevelOfDetail}},{key:"shouldRefine",value:function(t,n){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,a=t._screenSpaceError;return i&&(a=t.getScreenSpaceError(n,!0)),a>this.options.maximumScreenSpaceError}},{key:"updateTileVisibility",value:function(t,n){var i=[];if(this.options.viewportTraversersMap)for(var a in this.options.viewportTraversersMap){var o=this.options.viewportTraversersMap[a];o===n.viewport.id&&i.push(a)}else i.push(n.viewport.id);t.updateVisibility(n,i)}},{key:"compareDistanceToCamera",value:function(t,n){return t._distanceToCamera-n._distanceToCamera}},{key:"anyChildrenVisible",value:function(t,n){var i=!1,a=hs(t.children),o;try{for(a.s();!(o=a.n()).done;){var s=o.value;s.updateVisibility(n),i=i||s.isVisibleAndInRequestVolume}}catch(u){a.e(u)}finally{a.f()}return i}},{key:"executeEmptyTraversal",value:function(t,n){var i=!0,a=this._emptyTraversalStack;for(a.push(t);a.length>0&&i;){var o=a.pop();this.updateTile(o,n),o.isVisibleAndInRequestVolume||this.loadTile(o,n),this.touchTile(o,n);var s=!o.hasRenderContent&&this.canTraverse(o,n,!1,!0);if(s){var u=o.children,f=hs(u),l;try{for(f.s();!(l=f.n()).done;){var h=l.value;a.find(h)&&a.delete(h),a.push(h)}}catch(d){f.e(d)}finally{f.f()}}else!o.contentAvailable&&!o.hasEmptyContent&&(i=!1)}return i}}]),e}();function _0(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),t.push.apply(t,n)}return t}function oi(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{};r%2?_0(Object(t),!0).forEach(function(n){c(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):_0(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}var b0=new E;function bB(e){return e!=null}var pa=function(){function e(r,t,n){T(this,e);var i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"";c(this,"tileset",void 0),c(this,"header",void 0),c(this,"id",void 0),c(this,"url",void 0),c(this,"parent",void 0),c(this,"refine",void 0),c(this,"type",void 0),c(this,"contentUrl",void 0),c(this,"lodMetricType","geometricError"),c(this,"lodMetricValue",0),c(this,"boundingVolume",null),c(this,"content",null),c(this,"contentState",rt.UNLOADED),c(this,"gpuMemoryUsageInBytes",0),c(this,"children",[]),c(this,"depth",0),c(this,"viewportIds",[]),c(this,"transform",new se),c(this,"extensions",null),c(this,"implicitTiling",null),c(this,"userData",{}),c(this,"computedTransform",void 0),c(this,"hasEmptyContent",!1),c(this,"hasTilesetContent",!1),c(this,"traverser",new Ir({})),c(this,"_cacheNode",null),c(this,"_frameNumber",null),c(this,"_expireDate",null),c(this,"_expiredContent",null),c(this,"_boundingBox",void 0),c(this,"_distanceToCamera",0),c(this,"_screenSpaceError",0),c(this,"_visibilityPlaneMask",void 0),c(this,"_visible",void 0),c(this,"_contentBoundingVolume",void 0),c(this,"_viewerRequestVolume",void 0),c(this,"_initialTransform",new se),c(this,"_priority",0),c(this,"_selectedFrame",0),c(this,"_requestedFrame",0),c(this,"_selectionDepth",0),c(this,"_touchedFrame",0),c(this,"_centerZDepth",0),c(this,"_shouldRefine",!1),c(this,"_stackLength",0),c(this,"_visitedFrame",0),c(this,"_inRequestVolume",!1),c(this,"_lodJudge",null),this.header=t,this.tileset=r,this.id=i||t.id,this.url=t.url,this.parent=n,this.refine=this._getRefine(t.refine),this.type=t.type,this.contentUrl=t.contentUrl,this._initializeLodMetric(t),this._initializeTransforms(t),this._initializeBoundingVolumes(t),this._initializeContent(t),this._initializeRenderingState(t),Object.seal(this)}return w(e,[{key:"destroy",value:function(){this.header=null}},{key:"isDestroyed",value:function(){return this.header===null}},{key:"selected",get:function(){return this._selectedFrame===this.tileset._frameNumber}},{key:"isVisible",get:function(){return this._visible}},{key:"isVisibleAndInRequestVolume",get:function(){return this._visible&&this._inRequestVolume}},{key:"hasRenderContent",get:function(){return!this.hasEmptyContent&&!this.hasTilesetContent}},{key:"hasChildren",get:function(){return this.children.length>0||this.header.children&&this.header.children.length>0}},{key:"contentReady",get:function(){return this.contentState===rt.READY||this.hasEmptyContent}},{key:"contentAvailable",get:function(){return Boolean(this.contentReady&&this.hasRenderContent||this._expiredContent&&!this.contentFailed)}},{key:"hasUnloadedContent",get:function(){return this.hasRenderContent&&this.contentUnloaded}},{key:"contentUnloaded",get:function(){return this.contentState===rt.UNLOADED}},{key:"contentExpired",get:function(){return this.contentState===rt.EXPIRED}},{key:"contentFailed",get:function(){return this.contentState===rt.FAILED}},{key:"distanceToCamera",get:function(){return this._distanceToCamera}},{key:"screenSpaceError",get:function(){return this._screenSpaceError}},{key:"boundingBox",get:function(){return this._boundingBox||(this._boundingBox=f0(this.header.boundingVolume,this.boundingVolume)),this._boundingBox}},{key:"getScreenSpaceError",value:function(t,n){switch(this.tileset.type){case Ke.I3S:return zl(this,t);case Ke.TILES3D:return h0(this,t,n);default:throw new Error("Unsupported tileset type")}}},{key:"unselect",value:function(){this._selectedFrame=0}},{key:"_getGpuMemoryUsageInBytes",value:function(){return this.content.gpuMemoryUsageInBytes||this.content.byteLength||0}},{key:"_getPriority",value:function(){var t=this.tileset._traverser,n=t.options.skipLevelOfDetail,i=this.refine===st.ADD||n;if(i&&!this.isVisible&&this._visible!==void 0||this.tileset._frameNumber-this._touchedFrame>=1||this.contentState===rt.UNLOADED)return-1;var a=this.parent,o=a&&(!i||this._screenSpaceError===0||a.hasTilesetContent),s=o?a._screenSpaceError:this._screenSpaceError,u=t.root?t.root._screenSpaceError:0;return Math.max(u-s,0)}},{key:"loadContent",value:function(){var r=I(Jl.default.mark(function n(){var i,a,o,s,u;return Jl.default.wrap(function(l){for(;;)switch(l.prev=l.next){case 0:if(!this.hasEmptyContent){l.next=2;break}return l.abrupt("return",!1);case 2:if(!this.content){l.next=4;break}return l.abrupt("return",!0);case 4:return i=this.contentExpired,i&&(this._expireDate=null),this.contentState=rt.LOADING,l.next=9,this.tileset._requestScheduler.scheduleRequest(this.id,this._getPriority.bind(this));case 9:if(a=l.sent,a){l.next=13;break}return this.contentState=rt.UNLOADED,l.abrupt("return",!1);case 13:return l.prev=13,o=this.tileset.getTileUrl(this.contentUrl),s=this.tileset.loader,u=oi(oi({},this.tileset.loadOptions),{},c({},s.id,oi(oi({},this.tileset.loadOptions[s.id]),{},{isTileset:this.type==="json"},this._getLoaderSpecificOptions(s.id)))),l.next=19,(0,T0.load)(o,s,u);case 19:if(this.content=l.sent,!this.tileset.options.contentLoader){l.next=23;break}return l.next=23,this.tileset.options.contentLoader(this);case 23:return this._isTileset()&&this.tileset._initializeTileHeaders(this.content,this),this.contentState=rt.READY,this._onContentLoaded(),l.abrupt("return",!0);case 29:throw l.prev=29,l.t0=l.catch(13),this.contentState=rt.FAILED,l.t0;case 33:return l.prev=33,a.done(),l.finish(33);case 36:case"end":return l.stop()}},n,this,[[13,29,33,36]])}));function t(){return r.apply(this,arguments)}return t}()},{key:"unloadContent",value:function(){return this.content&&this.content.destroy&&this.content.destroy(),this.content=null,this.header.content&&this.header.content.destroy&&this.header.content.destroy(),this.header.content=null,this.contentState=rt.UNLOADED,!0}},{key:"updateVisibility",value:function(t,n){if(this._frameNumber!==t.frameNumber){var i=this.parent,a=i?i._visibilityPlaneMask:ot.MASK_INDETERMINATE;if(this.tileset._traverser.options.updateTransforms){var o=i?i.computedTransform:this.tileset.modelMatrix;this._updateTransform(o)}this._distanceToCamera=this.distanceToTile(t),this._screenSpaceError=this.getScreenSpaceError(t,!1),this._visibilityPlaneMask=this.visibility(t,a),this._visible=this._visibilityPlaneMask!==ot.MASK_OUTSIDE,this._inRequestVolume=this.insideViewerRequestVolume(t),this._frameNumber=t.frameNumber,this.viewportIds=n}}},{key:"visibility",value:function(t,n){var i=t.cullingVolume,a=this.boundingVolume;return i.computeVisibilityWithPlaneMask(a,n)}},{key:"contentVisibility",value:function(){return!0}},{key:"distanceToTile",value:function(t){var n=this.boundingVolume;return Math.sqrt(Math.max(n.distanceSquaredTo(t.camera.position),0))}},{key:"cameraSpaceZDepth",value:function(t){var n=t.camera,i=this.boundingVolume;return b0.subVectors(i.center,n.position),n.direction.dot(b0)}},{key:"insideViewerRequestVolume",value:function(t){var n=this._viewerRequestVolume;return!n||n.distanceSquaredTo(t.camera.position)<=0}},{key:"updateExpiration",value:function(){if(bB(this._expireDate)&&this.contentReady&&!this.hasEmptyContent){var t=Date.now();Date.lessThan(this._expireDate,t)&&(this.contentState=rt.EXPIRED,this._expiredContent=this.content)}}},{key:"extras",get:function(){return this.header.extras}},{key:"_initializeLodMetric",value:function(t){"lodMetricType"in t?this.lodMetricType=t.lodMetricType:(this.lodMetricType=this.parent&&this.parent.lodMetricType||this.tileset.lodMetricType,console.warn("3D Tile: Required prop lodMetricType is undefined. Using parent lodMetricType")),"lodMetricValue"in t?this.lodMetricValue=t.lodMetricValue:(this.lodMetricValue=this.parent&&this.parent.lodMetricValue||this.tileset.lodMetricValue,console.warn("3D Tile: Required prop lodMetricValue is undefined. Using parent lodMetricValue"))}},{key:"_initializeTransforms",value:function(t){this.transform=t.transform?new se(t.transform):new se;var n=this.parent,i=this.tileset,a=n&&n.computedTransform?n.computedTransform.clone():i.modelMatrix.clone();this.computedTransform=new se(a).multiplyRight(this.transform);var o=n&&n._initialTransform?n._initialTransform.clone():new se;this._initialTransform=new se(o).multiplyRight(this.transform)}},{key:"_initializeBoundingVolumes",value:function(t){this._contentBoundingVolume=null,this._viewerRequestVolume=null,this._updateBoundingVolume(t)}},{key:"_initializeContent",value:function(t){this.content={_tileset:this.tileset,_tile:this},this.hasEmptyContent=!0,this.contentState=rt.UNLOADED,this.hasTilesetContent=!1,t.contentUrl&&(this.content=null,this.hasEmptyContent=!1)}},{key:"_initializeRenderingState",value:function(t){this.depth=t.level||(this.parent?this.parent.depth+1:0),this._shouldRefine=!1,this._distanceToCamera=0,this._centerZDepth=0,this._screenSpaceError=0,this._visibilityPlaneMask=ot.MASK_INDETERMINATE,this._visible=void 0,this._inRequestVolume=!1,this._stackLength=0,this._selectionDepth=0,this._frameNumber=0,this._touchedFrame=0,this._visitedFrame=0,this._selectedFrame=0,this._requestedFrame=0,this._priority=0}},{key:"_getRefine",value:function(t){return t||this.parent&&this.parent.refine||st.REPLACE}},{key:"_isTileset",value:function(){return this.contentUrl.indexOf(".json")!==-1}},{key:"_onContentLoaded",value:function(){switch(this.content&&this.content.type){case"vctr":case"geom":this.tileset._traverser.disableSkipLevelOfDetail=!0;break;default:}this._isTileset()?this.hasTilesetContent=!0:this.gpuMemoryUsageInBytes=this._getGpuMemoryUsageInBytes()}},{key:"_updateBoundingVolume",value:function(t){this.boundingVolume=cs(t.boundingVolume,this.computedTransform,this.boundingVolume);var n=t.content;n&&(n.boundingVolume&&(this._contentBoundingVolume=cs(n.boundingVolume,this.computedTransform,this._contentBoundingVolume)),t.viewerRequestVolume&&(this._viewerRequestVolume=cs(t.viewerRequestVolume,this.computedTransform,this._viewerRequestVolume)))}},{key:"_updateTransform",value:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:new se,n=t.clone().multiplyRight(this.transform),i=!n.equals(this.computedTransform);i&&(this.computedTransform=n,this._updateBoundingVolume(this.header))}},{key:"_getLoaderSpecificOptions",value:function(t){switch(t){case"i3s":return oi(oi({},this.tileset.options.i3s),{},{_tileOptions:{attributeUrls:this.header.attributeUrls,textureUrl:this.header.textureUrl,textureFormat:this.header.textureFormat,textureLoaderOptions:this.header.textureLoaderOptions,materialDefinition:this.header.materialDefinition,isDracoGeometry:this.header.isDracoGeometry,mbs:this.header.mbs},_tilesetOptions:{store:this.tileset.tileset.store,attributeStorageInfo:this.tileset.tileset.attributeStorageInfo,fields:this.tileset.tileset.fields},isTileHeader:!1});case"3d-tiles":case"cesium-ion":default:return g0(this.tileset.tileset)}}}]),e}();q();Y();function TB(e){var r=xB();return function(){var n=L(e),i;if(r){var a=L(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return $(this,i)}}function xB(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var x0=function(e){H(t,e);var r=TB(t);function t(){return T(this,t),r.apply(this,arguments)}return w(t,[{key:"compareDistanceToCamera",value:function(i,a){return a._distanceToCamera===0&&i._distanceToCamera===0?a._centerZDepth-i._centerZDepth:a._distanceToCamera-i._distanceToCamera}},{key:"updateTileVisibility",value:function(i,a){if(be(L(t.prototype),"updateTileVisibility",this).call(this,i,a),!!i.isVisibleAndInRequestVolume){var o=i.children.length>0;if(i.hasTilesetContent&&o){var s=i.children[0];this.updateTileVisibility(s,a),i._visible=s._visible;return}if(this.meetsScreenSpaceErrorEarly(i,a)){i._visible=!1;return}var u=i.refine===st.REPLACE,f=i._optimChildrenWithinParent===o0.USE_OPTIMIZATION;if(u&&f&&o&&!this.anyChildrenVisible(i,a)){i._visible=!1;return}}}},{key:"meetsScreenSpaceErrorEarly",value:function(i,a){var o=i.parent;return!o||o.hasTilesetContent||o.refine!==st.ADD?!1:!this.shouldRefine(i,a,!0)}}]),t}(Ir);N();q();Y();var ql=X(re());N();var B0=X(ni());q();Y();N();q();Y();N();var E0=function(){function e(){T(this,e),c(this,"frameNumberMap",new Map)}return w(e,[{key:"register",value:function(t,n){var i=this.frameNumberMap.get(t)||new Map,a=i.get(n)||0;i.set(n,a+1),this.frameNumberMap.set(t,i)}},{key:"deregister",value:function(t,n){var i=this.frameNumberMap.get(t);if(i){var a=i.get(n)||1;i.set(n,a-1)}}},{key:"isZero",value:function(t,n){var i,a=((i=this.frameNumberMap.get(t))===null||i===void 0?void 0:i.get(n))||0;return a===0}}]),e}();var Xl={REQUESTED:"REQUESTED",COMPLETED:"COMPLETED",ERROR:"ERROR"},S0=function(){function e(){T(this,e),c(this,"_statusMap",void 0),c(this,"pendingTilesRegister",new E0),this._statusMap={}}return w(e,[{key:"add",value:function(t,n,i,a){var o=this;if(!this._statusMap[n]){var s=a.frameNumber,u=a.viewport.id;this._statusMap[n]={request:t,callback:i,key:n,frameState:a,status:Xl.REQUESTED},this.pendingTilesRegister.register(u,s),t().then(function(f){o._statusMap[n].status=Xl.COMPLETED;var l=o._statusMap[n].frameState,h=l.frameNumber,d=l.viewport.id;o.pendingTilesRegister.deregister(d,h),o._statusMap[n].callback(f,a)}).catch(function(f){o._statusMap[n].status=Xl.ERROR;var l=o._statusMap[n].frameState,h=l.frameNumber,d=l.viewport.id;o.pendingTilesRegister.deregister(d,h),i(f)})}}},{key:"update",value:function(t,n){if(this._statusMap[t]){var i=this._statusMap[t].frameState,a=i.frameNumber,o=i.viewport.id;this.pendingTilesRegister.deregister(o,a);var s=n.frameNumber,u=n.viewport.id;this.pendingTilesRegister.register(u,s),this._statusMap[t].frameState=n}}},{key:"find",value:function(t){return this._statusMap[t]}},{key:"hasPendingTiles",value:function(t,n){return!this.pendingTilesRegister.isZero(t,n)}}]),e}();function w0(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),t.push.apply(t,n)}return t}function ps(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{};r%2?w0(Object(t),!0).forEach(function(n){c(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):w0(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}function EB(e,r){var t=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=SB(e))||r&&e&&typeof e.length=="number"){t&&(e=t);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(f){throw f},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
165
|
+
`;function Uy(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),t.push.apply(t,n)}return t}function Or(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{};r%2?Uy(Object(t),!0).forEach(function(n){c(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Uy(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}function z2(e){var r=W2();return function(){var n=L(e),i;if(r){var a=L(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return $(this,i)}}function W2(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function J2(e){var r=e.COLOR_0||e.colors;r||(e.colors={constant:!0,value:new Float32Array([1,1,1])})}var X2={pbrMaterial:{type:"object",value:null},featureIds:{type:"array",value:null,optional:!0}},is=function(e){H(t,e);var r=z2(t);function t(){return T(this,t),r.apply(this,arguments)}return w(t,[{key:"getShaders",value:function(){var i=_e(L(t.prototype),"getShaders",this).call(this),a=i.modules;return a.push(ns.pbr),Or(Or({},i),{},{vs:Gy,fs:Ny})}},{key:"initializeState",value:function(){var i=this.props.featureIds;_e(L(t.prototype),"initializeState",this).call(this);var a=this.getAttributeManager();i&&a.add({featureIdsPickingColors:{type:5121,size:3,noAlloc:!0,update:this.calculateFeatureIdsPickingColors}})}},{key:"updateState",value:function(i){_e(L(t.prototype),"updateState",this).call(this,i);var a=i.props,o=i.oldProps;a.pbrMaterial!==o.pbrMaterial&&this.updatePbrMaterialUniforms(a.pbrMaterial)}},{key:"draw",value:function(i){var a=this.props.featureIds;this.state.model&&(this.state.model.setUniforms({u_Camera:this.state.model.getUniforms().project_uCameraPosition,pickFeatureIds:Boolean(a)}),_e(L(t.prototype),"draw",this).call(this,i))}},{key:"getModel",value:function(i){var a=this.props,o=a.id,s=a.pbrMaterial,u=this.parseMaterial(s,i);this.setState({materialParser:u});var f=this.getShaders();J2(i.attributes);var l=new ns.Model(this.context.gl,Or(Or({},this.getShaders()),{},{id:o,geometry:i,defines:Or(Or(Or({},f.defines),u?.defines),{},{HAS_UV_REGIONS:i.attributes.uvRegions}),parameters:u?.parameters,isInstanced:!0}));return l}},{key:"updatePbrMaterialUniforms",value:function(i){var a=this.state.model;if(a){var o=this.props.mesh,s=this.parseMaterial(i,o);this.setState({materialParser:s}),a.setUniforms(s.uniforms)}}},{key:"parseMaterial",value:function(i,a){var o,s=Boolean(i.pbrMetallicRoughness&&i.pbrMetallicRoughness.baseColorTexture);return(o=this.state.materialParser)===null||o===void 0||o.delete(),new Ll(this.context.gl,{attributes:{NORMAL:a.attributes.normals,TEXCOORD_0:a.attributes.texCoords},material:Or({unlit:s},i),pbrDebug:!1,imageBasedLightingEnvironment:null,lights:!0,useTangents:!1})}},{key:"calculateFeatureIdsPickingColors",value:function(i){for(var a=this.props.featureIds,o=new Uint8ClampedArray(a.length*i.size),s=[],u=0;u<a.length;u++)this.encodePickingColor(a[u],s),o[u*3]=s[0],o[u*3+1]=s[1],o[u*3+2]=s[2];i.value=o}},{key:"finalizeState",value:function(i){var a;_e(L(t.prototype),"finalizeState",this).call(this,i),(a=this.state.materialParser)===null||a===void 0||a.delete(),this.setState({materialParser:null})}}]),t}(jy.SimpleMeshLayer);c(is,"layerName","MeshLayer");c(is,"defaultProps",X2);var I_=X(ni());ue();N();q();Y();var pn=X(re());N();ue();q();Y();N();var rr=6378137,nr=6378137,ir=6356752314245179e-9,q2={radii:[rr,nr,ir],radiiSquared:[rr*rr,nr*nr,ir*ir],oneOverRadii:[1/rr,1/nr,1/ir],oneOverRadiiSquared:[1/(rr*rr),1/(nr*nr),1/(ir*ir)],maximumRadius:Math.max(rr,nr,ir),centerToleranceSquared:.1};function as(e){return e}var JW=new E;function K2(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:as;return"longitude"in e?(r[0]=t(e.longitude),r[1]=t(e.latitude),r[2]=e.height):"x"in e?(r[0]=t(e.x),r[1]=t(e.y),r[2]=e.z):(r[0]=t(e[0]),r[1]=t(e[1]),r[2]=e[2]),r}function Vy(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];return K2(e,r,xe._cartographicRadians?as:Uf)}function Y2(e,r){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:as;return"longitude"in r?(r.longitude=t(e[0]),r.latitude=t(e[1]),r.height=e[2]):"x"in r?(r.x=t(e[0]),r.y=t(e[1]),r.z=e[2]):(r[0]=t(e[0]),r[1]=t(e[1]),r[2]=e[2]),r}function zy(e,r){return Y2(e,r,xe._cartographicRadians?as:jf)}var ii=new E,Z2=new E,$2=new E;function kl(e,r){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[],n=r.oneOverRadii,i=r.oneOverRadiiSquared,a=r.centerToleranceSquared;ii.from(e);var o=ii.x,s=ii.y,u=ii.z,f=n.x,l=n.y,h=n.z,d=o*o*f*f,p=s*s*l*l,m=u*u*h*h,v=d+p+m,g=Math.sqrt(1/v);if(Number.isFinite(g)){var y=Z2;if(y.copy(e).scale(g),v<a)return y.to(t);var A=i.x,x=i.y,b=i.z,M=$2;M.set(y.x*A*2,y.y*x*2,y.z*b*2);var C=(1-g)*ii.len()/(.5*M.len()),F=0,B,S,_,R;do{C-=F,B=1/(1+C*A),S=1/(1+C*x),_=1/(1+C*b);var k=B*B,U=S*S,j=_*_,Z=k*B,P=U*S,O=j*_;R=d*k+p*U+m*j-1;var G=d*Z*A+p*P*x+m*O*b,J=-2*G;F=R/J}while(Math.abs(R)>Nt.EPSILON12);return ii.scale([B,S,_]).to(t)}}var Wy=1e-14,Q2=new E,Jy={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"}},Dl={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},ar={east:new E,north:new E,up:new E,west:new E,south:new E,down:new E},eB=new E,tB=new E,rB=new E;function os(e,r,t,n,i,a){var o=Jy[r]&&Jy[r][t];de(o&&(!n||n===o));var s,u,f,l=Q2.copy(i),h=He(l.x,0,Wy)&&He(l.y,0,Wy);if(h){var d=Math.sign(l.z);s=eB.fromArray(Dl[r]),r!=="east"&&r!=="west"&&s.scale(d),u=tB.fromArray(Dl[t]),t!=="east"&&t!=="west"&&u.scale(d),f=rB.fromArray(Dl[n]),n!=="east"&&n!=="west"&&f.scale(d)}else{var p=ar.up,m=ar.east,v=ar.north;m.set(-l.y,l.x,0).normalize(),e.geodeticSurfaceNormal(l,p),v.copy(p).cross(m);var g=ar.down,y=ar.west,A=ar.south;g.copy(p).scale(-1),y.copy(m).scale(-1),A.copy(v).scale(-1),s=ar[r],u=ar[t],f=ar[n]}return a[0]=s.x,a[1]=s.y,a[2]=s.z,a[3]=0,a[4]=u.x,a[5]=u.y,a[6]=u.z,a[7]=0,a[8]=f.x,a[9]=f.y,a[10]=f.z,a[11]=0,a[12]=l.x,a[13]=l.y,a[14]=l.z,a[15]=1,a}var ss=new E,Xy=new E,nB=new E,Bt=new E,iB=new E,us=new E;var ve=function(){function e(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;T(this,e),c(this,"radii",void 0),c(this,"radiiSquared",void 0),c(this,"radiiToTheFourth",void 0),c(this,"oneOverRadii",void 0),c(this,"oneOverRadiiSquared",void 0),c(this,"minimumRadius",void 0),c(this,"maximumRadius",void 0),c(this,"centerToleranceSquared",Nt.EPSILON1),c(this,"squaredXOverSquaredZ",void 0),de(r>=0),de(t>=0),de(n>=0),this.radii=new E(r,t,n),this.radiiSquared=new E(r*r,t*t,n*n),this.radiiToTheFourth=new E(r*r*r*r,t*t*t*t,n*n*n*n),this.oneOverRadii=new E(r===0?0:1/r,t===0?0:1/t,n===0?0:1/n),this.oneOverRadiiSquared=new E(r===0?0:1/(r*r),t===0?0:1/(t*t),n===0?0:1/(n*n)),this.minimumRadius=Math.min(r,t,n),this.maximumRadius=Math.max(r,t,n),this.radiiSquared.z!==0&&(this.squaredXOverSquaredZ=this.radiiSquared.x/this.radiiSquared.z),Object.freeze(this)}return w(e,[{key:"equals",value:function(t){return this===t||Boolean(t&&this.radii.equals(t.radii))}},{key:"toString",value:function(){return this.radii.toString()}},{key:"cartographicToCartesian",value:function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[0,0,0],i=Xy,a=nB,o=D(t,3),s=o[2];this.geodeticSurfaceNormalCartographic(t,i),a.copy(this.radiiSquared).scale(i);var u=Math.sqrt(i.dot(a));return a.scale(1/u),i.scale(s),a.add(i),a.to(n)}},{key:"cartesianToCartographic",value:function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[0,0,0];us.from(t);var i=this.scaleToGeodeticSurface(us,Bt);if(i){var a=this.geodeticSurfaceNormal(i,Xy),o=iB;o.copy(us).subtract(i);var s=Math.atan2(a.y,a.x),u=Math.asin(a.z),f=Math.sign(Ji(o,us))*Ef(o);return zy([s,u,f],n)}}},{key:"eastNorthUpToFixedFrame",value:function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:new se;return os(this,"east","north","up",t,n)}},{key:"localFrameToFixedFrame",value:function(t,n,i,a){var o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:new se;return os(this,t,n,i,a,o)}},{key:"geocentricSurfaceNormal",value:function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[0,0,0];return ss.from(t).normalize().to(n)}},{key:"geodeticSurfaceNormalCartographic",value:function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[0,0,0],i=Vy(t),a=i[0],o=i[1],s=Math.cos(o);return ss.set(s*Math.cos(a),s*Math.sin(a),Math.sin(o)).normalize(),ss.to(n)}},{key:"geodeticSurfaceNormal",value:function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[0,0,0];return ss.from(t).scale(this.oneOverRadiiSquared).normalize().to(n)}},{key:"scaleToGeodeticSurface",value:function(t,n){return kl(t,this,n)}},{key:"scaleToGeocentricSurface",value:function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[0,0,0];Bt.from(t);var i=Bt.x,a=Bt.y,o=Bt.z,s=this.oneOverRadiiSquared,u=1/Math.sqrt(i*i*s.x+a*a*s.y+o*o*s.z);return Bt.multiplyScalar(u).to(n)}},{key:"transformPositionToScaledSpace",value:function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[0,0,0];return Bt.from(t).scale(this.oneOverRadii).to(n)}},{key:"transformPositionFromScaledSpace",value:function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[0,0,0];return Bt.from(t).scale(this.radii).to(n)}},{key:"getSurfaceNormalIntersectionWithZAxis",value:function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[0,0,0];de(He(this.radii.x,this.radii.y,Nt.EPSILON15)),de(this.radii.z>0),Bt.from(t);var a=Bt.z*(1-this.squaredXOverSquaredZ);if(!(Math.abs(a)>=this.radii.z-n))return Bt.set(0,0,a).to(i)}}]),e}();c(ve,"WGS84",new ve(rr,nr,ir));N();N();function da(){let e;if(typeof window<"u"&&window.performance)e=window.performance.now();else if(typeof process<"u"&&process.hrtime){let r=process.hrtime();e=r[0]*1e3+r[1]/1e6}else e=Date.now();return e}var hn=class{constructor(r,t){c(this,"name",void 0),c(this,"type",void 0),c(this,"sampleSize",1),c(this,"time",0),c(this,"count",0),c(this,"samples",0),c(this,"lastTiming",0),c(this,"lastSampleTime",0),c(this,"lastSampleCount",0),c(this,"_count",0),c(this,"_time",0),c(this,"_samples",0),c(this,"_startTime",0),c(this,"_timerPending",!1),this.name=r,this.type=t,this.reset()}reset(){return this.time=0,this.count=0,this.samples=0,this.lastTiming=0,this.lastSampleTime=0,this.lastSampleCount=0,this._count=0,this._time=0,this._samples=0,this._startTime=0,this._timerPending=!1,this}setSampleSize(r){return this.sampleSize=r,this}incrementCount(){return this.addCount(1),this}decrementCount(){return this.subtractCount(1),this}addCount(r){return this._count+=r,this._samples++,this._checkSampling(),this}subtractCount(r){return this._count-=r,this._samples++,this._checkSampling(),this}addTime(r){return this._time+=r,this.lastTiming=r,this._samples++,this._checkSampling(),this}timeStart(){return this._startTime=da(),this._timerPending=!0,this}timeEnd(){return this._timerPending?(this.addTime(da()-this._startTime),this._timerPending=!1,this._checkSampling(),this):this}getSampleAverageCount(){return this.sampleSize>0?this.lastSampleCount/this.sampleSize:0}getSampleAverageTime(){return this.sampleSize>0?this.lastSampleTime/this.sampleSize:0}getSampleHz(){return this.lastSampleTime>0?this.sampleSize/(this.lastSampleTime/1e3):0}getAverageCount(){return this.samples>0?this.count/this.samples:0}getAverageTime(){return this.samples>0?this.time/this.samples:0}getHz(){return this.time>0?this.samples/(this.time/1e3):0}_checkSampling(){this._samples===this.sampleSize&&(this.lastSampleTime=this._time,this.lastSampleCount=this._count,this.count+=this._count,this.time+=this._time,this.samples+=this._samples,this._time=0,this._count=0,this._samples=0)}};var ai=class{constructor(r){c(this,"id",void 0),c(this,"stats",{}),this.id=r.id,this.stats={},this._initializeStats(r.stats),Object.seal(this)}get(r){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"count";return this._getOrCreate({name:r,type:t})}get size(){return Object.keys(this.stats).length}reset(){for(let r of Object.values(this.stats))r.reset();return this}forEach(r){for(let t of Object.values(this.stats))r(t)}getTable(){let r={};return this.forEach(t=>{r[t.name]={time:t.time||0,count:t.count||0,average:t.getAverageTime()||0,hz:t.getHz()||0}}),r}_initializeStats(){(arguments.length>0&&arguments[0]!==void 0?arguments[0]:[]).forEach(t=>this._getOrCreate(t))}_getOrCreate(r){let{name:t,type:n}=r,i=this.stats[t];return i||(r instanceof hn?i=r:i=new hn(t,n),this.stats[t]=i),i}};q();Y();N();q();Y();N();q();N();var qy=function e(r,t,n){T(this,e),c(this,"item",void 0),c(this,"previous",void 0),c(this,"next",void 0),this.item=r,this.previous=t,this.next=n};var Ky=function(){function e(){T(this,e),c(this,"head",null),c(this,"tail",null),c(this,"_length",0)}return w(e,[{key:"length",get:function(){return this._length}},{key:"add",value:function(t){var n=new qy(t,this.tail,null);return this.tail?(this.tail.next=n,this.tail=n):(this.head=n,this.tail=n),++this._length,n}},{key:"remove",value:function(t){t&&(t.previous&&t.next?(t.previous.next=t.next,t.next.previous=t.previous):t.previous?(t.previous.next=null,this.tail=t.previous):t.next?(t.next.previous=null,this.head=t.next):(this.head=null,this.tail=null),t.next=null,t.previous=null,--this._length)}},{key:"splice",value:function(t,n){t!==n&&(this.remove(n),this._insert(t,n))}},{key:"_insert",value:function(t,n){var i=t.next;t.next=n,this.tail===t?this.tail=n:i.previous=n,n.next=i,n.previous=t,++this._length}}]),e}();var Yy=function(){function e(){T(this,e),c(this,"_list",void 0),c(this,"_sentinel",void 0),c(this,"_trimTiles",void 0),this._list=new Ky,this._sentinel=this._list.add("sentinel"),this._trimTiles=!1}return w(e,[{key:"reset",value:function(){this._list.splice(this._list.tail,this._sentinel)}},{key:"touch",value:function(t){var n=t._cacheNode;n&&this._list.splice(this._sentinel,n)}},{key:"add",value:function(t,n,i){n._cacheNode||(n._cacheNode=this._list.add(n),i&&i(t,n))}},{key:"unloadTile",value:function(t,n,i){var a=n._cacheNode;a&&(this._list.remove(a),n._cacheNode=null,i&&i(t,n))}},{key:"unloadTiles",value:function(t,n){var i=this._trimTiles;this._trimTiles=!1;for(var a=this._list,o=t.maximumMemoryUsage*1024*1024,s=this._sentinel,u=a.head;u!==s&&(t.gpuMemoryUsageInBytes>o||i);){var f=u.item;u=u.next,this.unloadTile(t,f,n)}}},{key:"trim",value:function(){this._trimTiles=!0}}]),e}();function Zy(e,r){ce(e),ce(r);var t=r.rtcCenter,n=r.gltfUpAxis,i=e.computedTransform,a=e.boundingVolume.center,o=new se(i);switch(t&&o.translate(t),n){case"Z":break;case"Y":var s=new se().rotateX(Math.PI/2);o=o.multiplyRight(s);break;case"X":var u=new se().rotateY(-Math.PI/2);o=o.multiplyRight(u);break;default:break}r.isQuantized&&o.translate(r.quantizedVolumeOffset).scale(r.quantizedVolumeScale);var f=new E(a);r.cartesianModelMatrix=o,r.cartesianOrigin=f;var l=ve.WGS84.cartesianToCartographic(f,new E),h=ve.WGS84.eastNorthUpToFixedFrame(f),d=h.invert();r.cartographicModelMatrix=d.multiplyRight(o),r.cartographicOrigin=l,r.coordinateSystem||(r.modelMatrix=r.cartographicModelMatrix)}ue();function aB(e,r){var t=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=oB(e))||r&&e&&typeof e.length=="number"){t&&(e=t);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(f){throw f},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
166
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){t=t.call(e)},n:function(){var f=t.next();return a=f.done,f},e:function(f){o=!0,s=f},f:function(){try{!a&&t.return!=null&&t.return()}finally{if(o)throw s}}}}function oB(e,r){if(e){if(typeof e=="string")return $y(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);if(t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set")return Array.from(e);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return $y(e,r)}}function $y(e,r){(r==null||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}var Qy=new E,Gl=new E,Nl=new ot([new Ge,new Ge,new Ge,new Ge,new Ge,new Ge]);function t0(e,r){var t=e.cameraDirection,n=e.cameraUp,i=e.height,a=e.distanceScales.metersPerUnit,o=fs(e,e.center),s=ve.WGS84.eastNorthUpToFixedFrame(o),u=e.unprojectPosition(e.cameraPosition),f=ve.WGS84.cartographicToCartesian(u,new E),l=new E(s.transformAsVector(new E(t).scale(a))).normalize(),h=new E(s.transformAsVector(new E(n).scale(a))).normalize();sB(e);var d=e.constructor,p=e.longitude,m=e.latitude,v=e.width,g=e.bearing,y=e.zoom,A=new d({longitude:p,latitude:m,height:i,width:v,bearing:g,zoom:y,pitch:0});return{camera:{position:f,direction:l,up:h},viewport:e,topDownViewport:A,height:i,cullingVolume:Nl,frameNumber:r,sseDenominator:1.15}}function r0(e,r,t){if(t===0||e.length<=t)return[e,[]];var n=[],i=r.viewport,a=i.longitude,o=i.latitude,s=aB(e.entries()),u;try{for(s.s();!(u=s.n()).done;){var f=D(u.value,2),l=f[0],h=f[1],d=D(h.header.mbs,2),p=d[0],m=d[1],v=Math.abs(a-p),g=Math.abs(o-m),y=Math.sqrt(g*g+v*v);n.push([l,y])}}catch(F){s.e(F)}finally{s.f()}for(var A=n.sort(function(F,B){return F[1]-B[1]}),x=[],b=0;b<t;b++)x.push(e[A[b][0]]);for(var M=[],C=t;C<A.length;C++)M.push(e[A[C][0]]);return[x,M]}function sB(e){var r=e.getFrustumPlanes(),t=e0(r.near,e.cameraPosition),n=fs(e,t),i=fs(e,e.cameraPosition,Gl),a=0;Nl.planes[a++].fromPointNormal(n,Qy.copy(n).subtract(i));for(var o in r)if(o!=="near"){var s=r[o],u=e0(s,t,Gl),f=fs(e,u,Gl);Nl.planes[a++].fromPointNormal(f,Qy.copy(n).subtract(f))}}function e0(e,r){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:new E,n=e.normal.dot(r);return t.copy(e.normal).scale(e.distance-n).add(r),t}function fs(e,r){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:new E,n=e.unprojectPosition(r);return ve.WGS84.cartographicToCartesian(n,t)}ue();var uB=6378137,fB=6378137,Ul=6356752314245179e-9,n0=new E;function i0(e,r){if(e instanceof rn){var t=e.halfAxes,n=lB(t);return Math.log2(Ul/(n+r[2]))}else if(e instanceof Tr){var i=e.radius;return Math.log2(Ul/(i+r[2]))}else if(e.width&&e.height){var a=e.width,o=e.height,s=Math.log2(uB/a),u=Math.log2(fB/o);return(s+u)/2}return 1}function jl(e,r,t){var n=ve.WGS84.cartographicToCartesian([e.xmax,e.ymax,e.zmax],new E),i=Math.sqrt(Math.pow(n[0]-t[0],2)+Math.pow(n[1]-t[1],2)+Math.pow(n[2]-t[2],2));return Math.log2(Ul/(i+r[2]))}function a0(e,r,t){var n=D(e,4),i=n[0],a=n[1],o=n[2],s=n[3];return jl({xmin:i,xmax:o,ymin:a,ymax:s,zmin:0,zmax:0},r,t)}function lB(e){e.getColumn(0,n0);var r=e.getColumn(1),t=e.getColumn(2),n=n0.add(r).add(t),i=n.len();return i}N();q();Y();var Jl=X(re());N();var T0=X(ni());var rt={UNLOADED:0,LOADING:1,PROCESSING:2,READY:3,EXPIRED:4,FAILED:5},st={ADD:1,REPLACE:2},or={EMPTY:"empty",SCENEGRAPH:"scenegraph",POINTCLOUD:"pointcloud",MESH:"mesh"},Ke={I3S:"I3S",TILES3D:"TILES3D"},dn={GEOMETRIC_ERROR:"geometricError",MAX_SCREEN_THRESHOLD:"maxScreenThreshold"},o0={NOT_COMPUTED:-1,USE_OPTIMIZATION:1,SKIP_OPTIMIZATION:0};ue();function u0(e){return e!=null}var Ye=new E,ls=new E,cB=new E,hB=new E;function cs(e,r,t){if(ce(e,"3D Tile: boundingVolume must be defined"),e.box)return dB(e.box,r,t);if(e.region){var n=D(e.region,6),i=n[0],a=n[1],o=n[2],s=n[3],u=n[4],f=n[5],l=ve.WGS84.cartographicToCartesian([wt(i),wt(s),u],cB),h=ve.WGS84.cartographicToCartesian([wt(o),wt(a),f],hB),d=new E().addVectors(l,h).multiplyScalar(.5),p=new E().subVectors(l,h).len()/2;return s0([d[0],d[1],d[2],p],new se)}if(e.sphere)return s0(e.sphere,r,t);throw new Error("3D Tile: boundingVolume must contain a sphere, region, or box")}function f0(e,r){if(e.box)return pB(r);if(e.region){var t=D(e.region,6),n=t[0],i=t[1],a=t[2],o=t[3],s=t[4],u=t[5];return[[wt(n),wt(i),s],[wt(a),wt(o),u]]}if(e.sphere)return mB(r);throw new Error("Unkown boundingVolume type")}function dB(e,r,t){var n=new E(e[0],e[1],e[2]);r.transform(n,n);var i=[];if(e.length===10){var a=e.slice(3,6),o=new br;o.fromArray(e,6);var s=new E([1,0,0]),u=new E([0,1,0]),f=new E([0,0,1]);s.transformByQuaternion(o),s.scale(a[0]),u.transformByQuaternion(o),u.scale(a[1]),f.transformByQuaternion(o),f.scale(a[2]),i=[].concat(K(s.toArray()),K(u.toArray()),K(f.toArray()))}else i=[].concat(K(e.slice(3,6)),K(e.slice(6,9)),K(e.slice(9,12)));var l=r.transformAsVector(i.slice(0,3)),h=r.transformAsVector(i.slice(3,6)),d=r.transformAsVector(i.slice(6,9)),p=new be([l[0],l[1],l[2],h[0],h[1],h[2],d[0],d[1],d[2]]);return u0(t)?(t.center=n,t.halfAxes=p,t):new rn(n,p)}function s0(e,r,t){var n=new E(e[0],e[1],e[2]);r.transform(n,n);var i=r.getScale(ls),a=Math.max(Math.max(i[0],i[1]),i[2]),o=e[3]*a;return u0(t)?(t.center=n,t.radius=o,t):new Tr(n,o)}function pB(e){for(var r=l0(),t=e.halfAxes,n=new E(t.getColumn(0)),i=new E(t.getColumn(1)),a=new E(t.getColumn(2)),o=0;o<2;o++){for(var s=0;s<2;s++){for(var u=0;u<2;u++)Ye.copy(e.center),Ye.add(n),Ye.add(i),Ye.add(a),c0(r,Ye),a.negate();i.negate()}n.negate()}return r}function mB(e){var r=l0(),t=e.center,n=e.radius,i=ve.WGS84.scaleToGeodeticSurface(t,Ye),a;i?a=ve.WGS84.geodeticSurfaceNormal(i):a=new E(0,0,1);var o=new E(a[2],-a[1],0);o.len()>0?o.normalize():o=new E(0,1,0);for(var s=o.clone().cross(a),u=0,f=[o,s,a];u<f.length;u++){var l=f[u];ls.copy(l).scale(n);for(var h=0;h<2;h++)Ye.copy(t),Ye.add(ls),c0(r,Ye),ls.negate()}return r}function l0(){return[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]]}function c0(e,r){ve.WGS84.cartesianToCartographic(r,Ye),e[0][0]=Math.min(e[0][0],Ye[0]),e[0][1]=Math.min(e[0][1],Ye[1]),e[0][2]=Math.min(e[0][2],Ye[2]),e[1][0]=Math.max(e[1][0],Ye[0]),e[1][1]=Math.max(e[1][1],Ye[1]),e[1][2]=Math.max(e[1][2],Ye[2])}var aX=new E,oX=new E,sX=new se,uX=new E,fX=new E,lX=new E;function vB(e,r){var t=e*r;return 1-Math.exp(-(t*t))}function gB(e,r){if(e.dynamicScreenSpaceError&&e.dynamicScreenSpaceErrorComputedDensity){var t=e.dynamicScreenSpaceErrorComputedDensity,n=e.dynamicScreenSpaceErrorFactor,i=vB(r,t)*n;return i}return 0}function h0(e,r,t){var n=e.tileset,i=e.parent&&e.parent.lodMetricValue||e.lodMetricValue,a=t?i:e.lodMetricValue;if(a===0)return 0;var o=Math.max(e._distanceToCamera,1e-7),s=r.height,u=r.sseDenominator,f=n.options.viewDistanceScale,l=a*s*(f||1)/(o*u);return l-=gB(n,o),l}var Hl=new E,d0=new E,Pr=new E,p0=new E,yB=new E,Vl=new se,m0=new se;function v0(e,r){if(e.lodMetricValue===0||isNaN(e.lodMetricValue))return"DIG";var t=2*zl(e,r);return t<2?"OUT":!e.header.children||t<=e.lodMetricValue?"DRAW":e.header.children?"DIG":"OUT"}function zl(e,r){var t=r.topDownViewport,n=e.header.mbs[1],i=e.header.mbs[0],a=e.header.mbs[2],o=e.header.mbs[3],s=K(e.boundingVolume.center),u=t.unprojectPosition(t.cameraPosition);ve.WGS84.cartographicToCartesian(u,Hl),d0.copy(Hl).subtract(s).normalize(),ve.WGS84.eastNorthUpToFixedFrame(s,Vl),m0.copy(Vl).invert(),Pr.copy(Hl).transform(m0);var f=Math.sqrt(Pr[0]*Pr[0]+Pr[1]*Pr[1]),l=f*f/Pr[2];p0.copy([Pr[0],Pr[1],l]);var h=p0.transform(Vl),d=h.subtract(s).normalize(),p=d0.cross(d).normalize().scale(o),m=p.add(s),v=ve.WGS84.cartesianToCartographic(m),g=t.project([i,n,a]),y=t.project(v),A=yB.copy(g).subtract(y).magnitude();return A}function g0(e){return{assetGltfUpAxis:e.asset&&e.asset.gltfUpAxis||"Y"}}N();q();Y();N();q();Y();N();var Wl=function(){function e(){T(this,e);var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;c(this,"_map",new Map),c(this,"_array",void 0),c(this,"_length",void 0),this._array=new Array(r),this._length=r}return w(e,[{key:"length",get:function(){return this._length},set:function(t){this._length=t,t>this._array.length&&(this._array.length=t)}},{key:"values",get:function(){return this._array}},{key:"get",value:function(t){return ce(t<this._array.length),this._array[t]}},{key:"set",value:function(t,n){ce(t>=0),t>=this.length&&(this.length=t+1),this._map.has(this._array[t])&&this._map.delete(this._array[t]),this._array[t]=n,this._map.set(n,t)}},{key:"delete",value:function(t){var n=this._map.get(t);n>=0&&(this._array.splice(n,1),this._map.delete(t),this.length--)}},{key:"peek",value:function(){return this._array[this._length-1]}},{key:"push",value:function(t){if(!this._map.has(t)){var n=this.length++;this._array[n]=t,this._map.set(t,n)}}},{key:"pop",value:function(){var t=this._array[--this.length];return this._map.delete(t),t}},{key:"reserve",value:function(t){ce(t>=0),t>this._array.length&&(this._array.length=t)}},{key:"resize",value:function(t){ce(t>=0),this.length=t}},{key:"trim",value:function(t){t==null&&(t=this.length),this._array.length=t}},{key:"reset",value:function(){this._array=[],this._map=new Map,this._length=0}},{key:"find",value:function(t){return this._map.has(t)}}]),e}();function hs(e,r){var t=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=AB(e))||r&&e&&typeof e.length=="number"){t&&(e=t);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(f){throw f},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
167
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){t=t.call(e)},n:function(){var f=t.next();return a=f.done,f},e:function(f){o=!0,s=f},f:function(){try{!a&&t.return!=null&&t.return()}finally{if(o)throw s}}}}function AB(e,r){if(e){if(typeof e=="string")return y0(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);if(t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set")return Array.from(e);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return y0(e,r)}}function y0(e,r){(r==null||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function A0(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),t.push.apply(t,n)}return t}function ds(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{};r%2?A0(Object(t),!0).forEach(function(n){c(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):A0(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}var _B={loadSiblings:!1,skipLevelOfDetail:!1,maximumScreenSpaceError:2,updateTransforms:!0,onTraversalEnd:function(){},viewportTraversersMap:{},basePath:""},Ir=function(){function e(r){T(this,e),c(this,"options",void 0),c(this,"root",null),c(this,"selectedTiles",{}),c(this,"requestedTiles",{}),c(this,"emptyTiles",{}),c(this,"lastUpdate",new Date().getTime()),c(this,"updateDebounceTime",1e3),c(this,"_traversalStack",new Wl),c(this,"_emptyTraversalStack",new Wl),c(this,"_frameNumber",null),this.options=ds(ds({},_B),r)}return w(e,[{key:"traversalFinished",value:function(t){return!0}},{key:"traverse",value:function(t,n,i){this.root=t,this.options=ds(ds({},this.options),i),this.reset(),this.updateTile(t,n),this._frameNumber=n.frameNumber,this.executeTraversal(t,n)}},{key:"reset",value:function(){this.requestedTiles={},this.selectedTiles={},this.emptyTiles={},this._traversalStack.reset(),this._emptyTraversalStack.reset()}},{key:"executeTraversal",value:function(t,n){var i=this._traversalStack;for(t._selectionDepth=1,i.push(t);i.length>0;){var a=i.pop(),o=!1;this.canTraverse(a,n)&&(this.updateChildTiles(a,n),o=this.updateAndPushChildren(a,n,i,a.hasRenderContent?a._selectionDepth+1:a._selectionDepth));var s=a.parent,u=Boolean(!s||s._shouldRefine),f=!o;a.hasRenderContent?a.refine===st.ADD?(this.loadTile(a,n),this.selectTile(a,n)):a.refine===st.REPLACE&&(this.loadTile(a,n),f&&this.selectTile(a,n)):(this.emptyTiles[a.id]=a,this.loadTile(a,n),f&&this.selectTile(a,n)),this.touchTile(a,n),a._shouldRefine=o&&u}var l=new Date().getTime();(this.traversalFinished(n)||l-this.lastUpdate>this.updateDebounceTime)&&(this.lastUpdate=l,this.options.onTraversalEnd(n))}},{key:"updateChildTiles",value:function(t,n){var i=t.children,a=hs(i),o;try{for(a.s();!(o=a.n()).done;){var s=o.value;this.updateTile(s,n)}}catch(u){a.e(u)}finally{a.f()}}},{key:"updateAndPushChildren",value:function(t,n,i,a){var o=this.options,s=o.loadSiblings,u=o.skipLevelOfDetail,f=t.children;f.sort(this.compareDistanceToCamera.bind(this));var l=t.refine===st.REPLACE&&t.hasRenderContent&&!u,h=!1,d=!0,p=hs(f),m;try{for(p.s();!(m=p.n()).done;){var v=m.value;if(v._selectionDepth=a,v.isVisibleAndInRequestVolume?(i.find(v)&&i.delete(v),i.push(v),h=!0):(l||s)&&(this.loadTile(v,n),this.touchTile(v,n)),l){var g=void 0;if(v._inRequestVolume?v.hasRenderContent?g=v.contentAvailable:g=this.executeEmptyTraversal(v,n):g=!1,d=d&&g,!d)return!1}}}catch(y){p.e(y)}finally{p.f()}return h||(d=!1),d}},{key:"updateTile",value:function(t,n){this.updateTileVisibility(t,n)}},{key:"selectTile",value:function(t,n){this.shouldSelectTile(t)&&(t._selectedFrame=n.frameNumber,this.selectedTiles[t.id]=t)}},{key:"loadTile",value:function(t,n){this.shouldLoadTile(t)&&(t._requestedFrame=n.frameNumber,t._priority=t._getPriority(),this.requestedTiles[t.id]=t)}},{key:"touchTile",value:function(t,n){t.tileset._cache.touch(t),t._touchedFrame=n.frameNumber}},{key:"canTraverse",value:function(t,n){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;return t.hasChildren?t.hasTilesetContent?!t.contentExpired:!a&&!t.isVisibleAndInRequestVolume?!1:this.shouldRefine(t,n,i):!1}},{key:"shouldLoadTile",value:function(t){return t.hasUnloadedContent||t.contentExpired}},{key:"shouldSelectTile",value:function(t){return t.contentAvailable&&!this.options.skipLevelOfDetail}},{key:"shouldRefine",value:function(t,n){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,a=t._screenSpaceError;return i&&(a=t.getScreenSpaceError(n,!0)),a>this.options.maximumScreenSpaceError}},{key:"updateTileVisibility",value:function(t,n){var i=[];if(this.options.viewportTraversersMap)for(var a in this.options.viewportTraversersMap){var o=this.options.viewportTraversersMap[a];o===n.viewport.id&&i.push(a)}else i.push(n.viewport.id);t.updateVisibility(n,i)}},{key:"compareDistanceToCamera",value:function(t,n){return t._distanceToCamera-n._distanceToCamera}},{key:"anyChildrenVisible",value:function(t,n){var i=!1,a=hs(t.children),o;try{for(a.s();!(o=a.n()).done;){var s=o.value;s.updateVisibility(n),i=i||s.isVisibleAndInRequestVolume}}catch(u){a.e(u)}finally{a.f()}return i}},{key:"executeEmptyTraversal",value:function(t,n){var i=!0,a=this._emptyTraversalStack;for(a.push(t);a.length>0&&i;){var o=a.pop();this.updateTile(o,n),o.isVisibleAndInRequestVolume||this.loadTile(o,n),this.touchTile(o,n);var s=!o.hasRenderContent&&this.canTraverse(o,n,!1,!0);if(s){var u=o.children,f=hs(u),l;try{for(f.s();!(l=f.n()).done;){var h=l.value;a.find(h)&&a.delete(h),a.push(h)}}catch(d){f.e(d)}finally{f.f()}}else!o.contentAvailable&&!o.hasEmptyContent&&(i=!1)}return i}}]),e}();function _0(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),t.push.apply(t,n)}return t}function oi(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{};r%2?_0(Object(t),!0).forEach(function(n){c(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):_0(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}var b0=new E;function bB(e){return e!=null}var pa=function(){function e(r,t,n){T(this,e);var i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"";c(this,"tileset",void 0),c(this,"header",void 0),c(this,"id",void 0),c(this,"url",void 0),c(this,"parent",void 0),c(this,"refine",void 0),c(this,"type",void 0),c(this,"contentUrl",void 0),c(this,"lodMetricType","geometricError"),c(this,"lodMetricValue",0),c(this,"boundingVolume",null),c(this,"content",null),c(this,"contentState",rt.UNLOADED),c(this,"gpuMemoryUsageInBytes",0),c(this,"children",[]),c(this,"depth",0),c(this,"viewportIds",[]),c(this,"transform",new se),c(this,"extensions",null),c(this,"implicitTiling",null),c(this,"userData",{}),c(this,"computedTransform",void 0),c(this,"hasEmptyContent",!1),c(this,"hasTilesetContent",!1),c(this,"traverser",new Ir({})),c(this,"_cacheNode",null),c(this,"_frameNumber",null),c(this,"_expireDate",null),c(this,"_expiredContent",null),c(this,"_boundingBox",void 0),c(this,"_distanceToCamera",0),c(this,"_screenSpaceError",0),c(this,"_visibilityPlaneMask",void 0),c(this,"_visible",void 0),c(this,"_contentBoundingVolume",void 0),c(this,"_viewerRequestVolume",void 0),c(this,"_initialTransform",new se),c(this,"_priority",0),c(this,"_selectedFrame",0),c(this,"_requestedFrame",0),c(this,"_selectionDepth",0),c(this,"_touchedFrame",0),c(this,"_centerZDepth",0),c(this,"_shouldRefine",!1),c(this,"_stackLength",0),c(this,"_visitedFrame",0),c(this,"_inRequestVolume",!1),c(this,"_lodJudge",null),this.header=t,this.tileset=r,this.id=i||t.id,this.url=t.url,this.parent=n,this.refine=this._getRefine(t.refine),this.type=t.type,this.contentUrl=t.contentUrl,this._initializeLodMetric(t),this._initializeTransforms(t),this._initializeBoundingVolumes(t),this._initializeContent(t),this._initializeRenderingState(t),Object.seal(this)}return w(e,[{key:"destroy",value:function(){this.header=null}},{key:"isDestroyed",value:function(){return this.header===null}},{key:"selected",get:function(){return this._selectedFrame===this.tileset._frameNumber}},{key:"isVisible",get:function(){return this._visible}},{key:"isVisibleAndInRequestVolume",get:function(){return this._visible&&this._inRequestVolume}},{key:"hasRenderContent",get:function(){return!this.hasEmptyContent&&!this.hasTilesetContent}},{key:"hasChildren",get:function(){return this.children.length>0||this.header.children&&this.header.children.length>0}},{key:"contentReady",get:function(){return this.contentState===rt.READY||this.hasEmptyContent}},{key:"contentAvailable",get:function(){return Boolean(this.contentReady&&this.hasRenderContent||this._expiredContent&&!this.contentFailed)}},{key:"hasUnloadedContent",get:function(){return this.hasRenderContent&&this.contentUnloaded}},{key:"contentUnloaded",get:function(){return this.contentState===rt.UNLOADED}},{key:"contentExpired",get:function(){return this.contentState===rt.EXPIRED}},{key:"contentFailed",get:function(){return this.contentState===rt.FAILED}},{key:"distanceToCamera",get:function(){return this._distanceToCamera}},{key:"screenSpaceError",get:function(){return this._screenSpaceError}},{key:"boundingBox",get:function(){return this._boundingBox||(this._boundingBox=f0(this.header.boundingVolume,this.boundingVolume)),this._boundingBox}},{key:"getScreenSpaceError",value:function(t,n){switch(this.tileset.type){case Ke.I3S:return zl(this,t);case Ke.TILES3D:return h0(this,t,n);default:throw new Error("Unsupported tileset type")}}},{key:"unselect",value:function(){this._selectedFrame=0}},{key:"_getGpuMemoryUsageInBytes",value:function(){return this.content.gpuMemoryUsageInBytes||this.content.byteLength||0}},{key:"_getPriority",value:function(){var t=this.tileset._traverser,n=t.options.skipLevelOfDetail,i=this.refine===st.ADD||n;if(i&&!this.isVisible&&this._visible!==void 0||this.tileset._frameNumber-this._touchedFrame>=1||this.contentState===rt.UNLOADED)return-1;var a=this.parent,o=a&&(!i||this._screenSpaceError===0||a.hasTilesetContent),s=o?a._screenSpaceError:this._screenSpaceError,u=t.root?t.root._screenSpaceError:0;return Math.max(u-s,0)}},{key:"loadContent",value:function(){var r=I(Jl.default.mark(function n(){var i,a,o,s,u;return Jl.default.wrap(function(l){for(;;)switch(l.prev=l.next){case 0:if(!this.hasEmptyContent){l.next=2;break}return l.abrupt("return",!1);case 2:if(!this.content){l.next=4;break}return l.abrupt("return",!0);case 4:return i=this.contentExpired,i&&(this._expireDate=null),this.contentState=rt.LOADING,l.next=9,this.tileset._requestScheduler.scheduleRequest(this.id,this._getPriority.bind(this));case 9:if(a=l.sent,a){l.next=13;break}return this.contentState=rt.UNLOADED,l.abrupt("return",!1);case 13:return l.prev=13,o=this.tileset.getTileUrl(this.contentUrl),s=this.tileset.loader,u=oi(oi({},this.tileset.loadOptions),{},c({},s.id,oi(oi({},this.tileset.loadOptions[s.id]),{},{isTileset:this.type==="json"},this._getLoaderSpecificOptions(s.id)))),l.next=19,(0,T0.load)(o,s,u);case 19:if(this.content=l.sent,!this.tileset.options.contentLoader){l.next=23;break}return l.next=23,this.tileset.options.contentLoader(this);case 23:return this._isTileset()&&this.tileset._initializeTileHeaders(this.content,this),this.contentState=rt.READY,this._onContentLoaded(),l.abrupt("return",!0);case 29:throw l.prev=29,l.t0=l.catch(13),this.contentState=rt.FAILED,l.t0;case 33:return l.prev=33,a.done(),l.finish(33);case 36:case"end":return l.stop()}},n,this,[[13,29,33,36]])}));function t(){return r.apply(this,arguments)}return t}()},{key:"unloadContent",value:function(){return this.content&&this.content.destroy&&this.content.destroy(),this.content=null,this.header.content&&this.header.content.destroy&&this.header.content.destroy(),this.header.content=null,this.contentState=rt.UNLOADED,!0}},{key:"updateVisibility",value:function(t,n){if(this._frameNumber!==t.frameNumber){var i=this.parent,a=i?i._visibilityPlaneMask:ot.MASK_INDETERMINATE;if(this.tileset._traverser.options.updateTransforms){var o=i?i.computedTransform:this.tileset.modelMatrix;this._updateTransform(o)}this._distanceToCamera=this.distanceToTile(t),this._screenSpaceError=this.getScreenSpaceError(t,!1),this._visibilityPlaneMask=this.visibility(t,a),this._visible=this._visibilityPlaneMask!==ot.MASK_OUTSIDE,this._inRequestVolume=this.insideViewerRequestVolume(t),this._frameNumber=t.frameNumber,this.viewportIds=n}}},{key:"visibility",value:function(t,n){var i=t.cullingVolume,a=this.boundingVolume;return i.computeVisibilityWithPlaneMask(a,n)}},{key:"contentVisibility",value:function(){return!0}},{key:"distanceToTile",value:function(t){var n=this.boundingVolume;return Math.sqrt(Math.max(n.distanceSquaredTo(t.camera.position),0))}},{key:"cameraSpaceZDepth",value:function(t){var n=t.camera,i=this.boundingVolume;return b0.subVectors(i.center,n.position),n.direction.dot(b0)}},{key:"insideViewerRequestVolume",value:function(t){var n=this._viewerRequestVolume;return!n||n.distanceSquaredTo(t.camera.position)<=0}},{key:"updateExpiration",value:function(){if(bB(this._expireDate)&&this.contentReady&&!this.hasEmptyContent){var t=Date.now();Date.lessThan(this._expireDate,t)&&(this.contentState=rt.EXPIRED,this._expiredContent=this.content)}}},{key:"extras",get:function(){return this.header.extras}},{key:"_initializeLodMetric",value:function(t){"lodMetricType"in t?this.lodMetricType=t.lodMetricType:(this.lodMetricType=this.parent&&this.parent.lodMetricType||this.tileset.lodMetricType,console.warn("3D Tile: Required prop lodMetricType is undefined. Using parent lodMetricType")),"lodMetricValue"in t?this.lodMetricValue=t.lodMetricValue:(this.lodMetricValue=this.parent&&this.parent.lodMetricValue||this.tileset.lodMetricValue,console.warn("3D Tile: Required prop lodMetricValue is undefined. Using parent lodMetricValue"))}},{key:"_initializeTransforms",value:function(t){this.transform=t.transform?new se(t.transform):new se;var n=this.parent,i=this.tileset,a=n&&n.computedTransform?n.computedTransform.clone():i.modelMatrix.clone();this.computedTransform=new se(a).multiplyRight(this.transform);var o=n&&n._initialTransform?n._initialTransform.clone():new se;this._initialTransform=new se(o).multiplyRight(this.transform)}},{key:"_initializeBoundingVolumes",value:function(t){this._contentBoundingVolume=null,this._viewerRequestVolume=null,this._updateBoundingVolume(t)}},{key:"_initializeContent",value:function(t){this.content={_tileset:this.tileset,_tile:this},this.hasEmptyContent=!0,this.contentState=rt.UNLOADED,this.hasTilesetContent=!1,t.contentUrl&&(this.content=null,this.hasEmptyContent=!1)}},{key:"_initializeRenderingState",value:function(t){this.depth=t.level||(this.parent?this.parent.depth+1:0),this._shouldRefine=!1,this._distanceToCamera=0,this._centerZDepth=0,this._screenSpaceError=0,this._visibilityPlaneMask=ot.MASK_INDETERMINATE,this._visible=void 0,this._inRequestVolume=!1,this._stackLength=0,this._selectionDepth=0,this._frameNumber=0,this._touchedFrame=0,this._visitedFrame=0,this._selectedFrame=0,this._requestedFrame=0,this._priority=0}},{key:"_getRefine",value:function(t){return t||this.parent&&this.parent.refine||st.REPLACE}},{key:"_isTileset",value:function(){return this.contentUrl.indexOf(".json")!==-1}},{key:"_onContentLoaded",value:function(){switch(this.content&&this.content.type){case"vctr":case"geom":this.tileset._traverser.disableSkipLevelOfDetail=!0;break;default:}this._isTileset()?this.hasTilesetContent=!0:this.gpuMemoryUsageInBytes=this._getGpuMemoryUsageInBytes()}},{key:"_updateBoundingVolume",value:function(t){this.boundingVolume=cs(t.boundingVolume,this.computedTransform,this.boundingVolume);var n=t.content;n&&(n.boundingVolume&&(this._contentBoundingVolume=cs(n.boundingVolume,this.computedTransform,this._contentBoundingVolume)),t.viewerRequestVolume&&(this._viewerRequestVolume=cs(t.viewerRequestVolume,this.computedTransform,this._viewerRequestVolume)))}},{key:"_updateTransform",value:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:new se,n=t.clone().multiplyRight(this.transform),i=!n.equals(this.computedTransform);i&&(this.computedTransform=n,this._updateBoundingVolume(this.header))}},{key:"_getLoaderSpecificOptions",value:function(t){switch(t){case"i3s":return oi(oi({},this.tileset.options.i3s),{},{_tileOptions:{attributeUrls:this.header.attributeUrls,textureUrl:this.header.textureUrl,textureFormat:this.header.textureFormat,textureLoaderOptions:this.header.textureLoaderOptions,materialDefinition:this.header.materialDefinition,isDracoGeometry:this.header.isDracoGeometry,mbs:this.header.mbs},_tilesetOptions:{store:this.tileset.tileset.store,attributeStorageInfo:this.tileset.tileset.attributeStorageInfo,fields:this.tileset.tileset.fields},isTileHeader:!1});case"3d-tiles":case"cesium-ion":default:return g0(this.tileset.tileset)}}}]),e}();q();Y();function TB(e){var r=xB();return function(){var n=L(e),i;if(r){var a=L(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return $(this,i)}}function xB(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var x0=function(e){H(t,e);var r=TB(t);function t(){return T(this,t),r.apply(this,arguments)}return w(t,[{key:"compareDistanceToCamera",value:function(i,a){return a._distanceToCamera===0&&i._distanceToCamera===0?a._centerZDepth-i._centerZDepth:a._distanceToCamera-i._distanceToCamera}},{key:"updateTileVisibility",value:function(i,a){if(_e(L(t.prototype),"updateTileVisibility",this).call(this,i,a),!!i.isVisibleAndInRequestVolume){var o=i.children.length>0;if(i.hasTilesetContent&&o){var s=i.children[0];this.updateTileVisibility(s,a),i._visible=s._visible;return}if(this.meetsScreenSpaceErrorEarly(i,a)){i._visible=!1;return}var u=i.refine===st.REPLACE,f=i._optimChildrenWithinParent===o0.USE_OPTIMIZATION;if(u&&f&&o&&!this.anyChildrenVisible(i,a)){i._visible=!1;return}}}},{key:"meetsScreenSpaceErrorEarly",value:function(i,a){var o=i.parent;return!o||o.hasTilesetContent||o.refine!==st.ADD?!1:!this.shouldRefine(i,a,!0)}}]),t}(Ir);N();q();Y();var ql=X(re());N();var B0=X(ni());q();Y();N();q();Y();N();var E0=function(){function e(){T(this,e),c(this,"frameNumberMap",new Map)}return w(e,[{key:"register",value:function(t,n){var i=this.frameNumberMap.get(t)||new Map,a=i.get(n)||0;i.set(n,a+1),this.frameNumberMap.set(t,i)}},{key:"deregister",value:function(t,n){var i=this.frameNumberMap.get(t);if(i){var a=i.get(n)||1;i.set(n,a-1)}}},{key:"isZero",value:function(t,n){var i,a=((i=this.frameNumberMap.get(t))===null||i===void 0?void 0:i.get(n))||0;return a===0}}]),e}();var Xl={REQUESTED:"REQUESTED",COMPLETED:"COMPLETED",ERROR:"ERROR"},S0=function(){function e(){T(this,e),c(this,"_statusMap",void 0),c(this,"pendingTilesRegister",new E0),this._statusMap={}}return w(e,[{key:"add",value:function(t,n,i,a){var o=this;if(!this._statusMap[n]){var s=a.frameNumber,u=a.viewport.id;this._statusMap[n]={request:t,callback:i,key:n,frameState:a,status:Xl.REQUESTED},this.pendingTilesRegister.register(u,s),t().then(function(f){o._statusMap[n].status=Xl.COMPLETED;var l=o._statusMap[n].frameState,h=l.frameNumber,d=l.viewport.id;o.pendingTilesRegister.deregister(d,h),o._statusMap[n].callback(f,a)}).catch(function(f){o._statusMap[n].status=Xl.ERROR;var l=o._statusMap[n].frameState,h=l.frameNumber,d=l.viewport.id;o.pendingTilesRegister.deregister(d,h),i(f)})}}},{key:"update",value:function(t,n){if(this._statusMap[t]){var i=this._statusMap[t].frameState,a=i.frameNumber,o=i.viewport.id;this.pendingTilesRegister.deregister(o,a);var s=n.frameNumber,u=n.viewport.id;this.pendingTilesRegister.register(u,s),this._statusMap[t].frameState=n}}},{key:"find",value:function(t){return this._statusMap[t]}},{key:"hasPendingTiles",value:function(t,n){return!this.pendingTilesRegister.isZero(t,n)}}]),e}();function w0(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),t.push.apply(t,n)}return t}function ps(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{};r%2?w0(Object(t),!0).forEach(function(n){c(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):w0(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}function EB(e,r){var t=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=SB(e))||r&&e&&typeof e.length=="number"){t&&(e=t);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(f){throw f},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
168
168
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){t=t.call(e)},n:function(){var f=t.next();return a=f.done,f},e:function(f){o=!0,s=f},f:function(){try{!a&&t.return!=null&&t.return()}finally{if(o)throw s}}}}function SB(e,r){if(e){if(typeof e=="string")return C0(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);if(t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set")return Array.from(e);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return C0(e,r)}}function C0(e,r){(r==null||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function wB(e){var r=CB();return function(){var n=L(e),i;if(r){var a=L(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return $(this,i)}}function CB(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var M0=function(e){H(t,e);var r=wB(t);function t(n){var i;return T(this,t),i=r.call(this,n),c(oe(i),"_tileManager",void 0),i._tileManager=new S0,i}return w(t,[{key:"traversalFinished",value:function(i){return!this._tileManager.hasPendingTiles(i.viewport.id,this._frameNumber||0)}},{key:"shouldRefine",value:function(i,a){return i._lodJudge=v0(i,a),i._lodJudge==="DIG"}},{key:"updateChildTiles",value:function(i,a){var o=this,s=i.header.children||[],u=i.children,f=i.tileset,l=EB(s),h;try{var d=function(){var m=h.value,v="".concat(m.id,"-").concat(a.viewport.id),g=u&&u.find(function(x){return x.id===v});if(g)g&&o.updateTile(g,a);else{var y=function(){return o._loadTile(m.id,f)},A=o._tileManager.find(v);A?o._tileManager.update(v,a):(f.tileset.nodePages&&(y=function(){return f.tileset.nodePagesTile.formTileFromNodePages(m.id)}),o._tileManager.add(y,v,function(x){return o._onTileLoad(x,i,v)},a))}};for(l.s();!(h=l.n()).done;)d()}catch(p){l.e(p)}finally{l.f()}return!1}},{key:"_loadTile",value:function(){var n=I(ql.default.mark(function a(o,s){var u,f,l;return ql.default.wrap(function(d){for(;;)switch(d.prev=d.next){case 0:return u=s.loader,f=s.getTileUrl("".concat(s.url,"/nodes/").concat(o)),l=ps(ps({},s.loadOptions),{},{i3s:ps(ps({},s.loadOptions.i3s),{},{isTileHeader:!0})}),d.next=5,(0,B0.load)(f,u,l);case 5:return d.abrupt("return",d.sent);case 6:case"end":return d.stop()}},a)}));function i(a,o){return n.apply(this,arguments)}return i}()},{key:"_onTileLoad",value:function(i,a,o){var s=new pa(a.tileset,i,a,o);a.children.push(s);var u=this._tileManager.find(s.id).frameState;this.updateTile(s,u),this._frameNumber===u.frameNumber&&(this.traversalFinished(u)||new Date().getTime()-this.lastUpdate>this.updateDebounceTime)&&this.executeTraversal(s,u)}}]),t}(Ir);function sr(e,r){var t=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=BB(e))||r&&e&&typeof e.length=="number"){t&&(e=t);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(f){throw f},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
169
169
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){t=t.call(e)},n:function(){var f=t.next();return a=f.done,f},e:function(f){o=!0,s=f},f:function(){try{!a&&t.return!=null&&t.return()}finally{if(o)throw s}}}}function BB(e,r){if(e){if(typeof e=="string")return O0(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);if(t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set")return Array.from(e);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return O0(e,r)}}function O0(e,r){(r==null||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function P0(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),t.push.apply(t,n)}return t}function Rr(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{};r%2?P0(Object(t),!0).forEach(function(n){c(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):P0(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}var MB={description:"",ellipsoid:ve.WGS84,modelMatrix:new se,throttleRequests:!0,maxRequests:64,maximumMemoryUsage:32,maximumTilesSelected:0,debounceTime:0,onTileLoad:function(){},onTileUnload:function(){},onTileError:function(){},onTraversalComplete:function(r){return r},contentLoader:void 0,viewDistanceScale:1,maximumScreenSpaceError:8,loadTiles:!0,updateTransforms:!0,viewportTraversersMap:null,loadOptions:{fetch:{}},attributions:[],basePath:"",i3s:{}},ms="Tiles In Tileset(s)",Kl="Tiles In Memory",I0="Tiles In View",R0="Tiles To Render",F0="Tiles Loaded",Yl="Tiles Loading",L0="Tiles Unloaded",k0="Failed Tile Loads",D0="Points/Vertices",Zl="Tile Memory Use",$l=function(){function e(r,t){T(this,e),c(this,"options",void 0),c(this,"loadOptions",void 0),c(this,"type",void 0),c(this,"tileset",void 0),c(this,"loader",void 0),c(this,"url",void 0),c(this,"basePath",void 0),c(this,"modelMatrix",void 0),c(this,"ellipsoid",void 0),c(this,"lodMetricType",void 0),c(this,"lodMetricValue",void 0),c(this,"refine",void 0),c(this,"root",null),c(this,"roots",{}),c(this,"asset",{}),c(this,"description",""),c(this,"properties",void 0),c(this,"extras",null),c(this,"attributions",{}),c(this,"credits",{}),c(this,"stats",void 0),c(this,"contentFormats",{draco:!1,meshopt:!1,dds:!1,ktx2:!1}),c(this,"cartographicCenter",null),c(this,"cartesianCenter",null),c(this,"zoom",1),c(this,"boundingVolume",null),c(this,"dynamicScreenSpaceErrorComputedDensity",0),c(this,"maximumMemoryUsage",32),c(this,"gpuMemoryUsageInBytes",0),c(this,"_frameNumber",0),c(this,"_queryParams",{}),c(this,"_extensionsUsed",[]),c(this,"_tiles",{}),c(this,"_pendingCount",0),c(this,"selectedTiles",[]),c(this,"traverseCounter",0),c(this,"geometricError",0),c(this,"lastUpdatedVieports",null),c(this,"_requestedTiles",[]),c(this,"_emptyTiles",[]),c(this,"frameStateData",{}),c(this,"_traverser",void 0),c(this,"_cache",new Yy),c(this,"_requestScheduler",void 0),c(this,"updatePromise",null),c(this,"tilesetInitializationPromise",void 0),this.options=Rr(Rr({},MB),t),this.tileset=r,this.loader=r.loader,this.type=r.type,this.url=r.url,this.basePath=r.basePath||kn.dirname(this.url),this.modelMatrix=this.options.modelMatrix,this.ellipsoid=this.options.ellipsoid,this.lodMetricType=r.lodMetricType,this.lodMetricValue=r.lodMetricValue,this.refine=r.root.refine,this.loadOptions=this.options.loadOptions||{},this._traverser=this._initializeTraverser(),this._requestScheduler=new Ri({throttleRequests:this.options.throttleRequests,maxRequests:this.options.maxRequests}),this.stats=new ai({id:this.url}),this._initializeStats(),this.tilesetInitializationPromise=this._initializeTileSet(r)}return w(e,[{key:"destroy",value:function(){this._destroy()}},{key:"isLoaded",value:function(){return this._pendingCount===0&&this._frameNumber!==0&&this._requestedTiles.length===0}},{key:"tiles",get:function(){return Object.values(this._tiles)}},{key:"frameNumber",get:function(){return this._frameNumber}},{key:"queryParams",get:function(){return new URLSearchParams(this._queryParams).toString()}},{key:"setProps",value:function(t){this.options=Rr(Rr({},this.options),t)}},{key:"setOptions",value:function(t){this.options=Rr(Rr({},this.options),t)}},{key:"getTileUrl",value:function(t){var n=t.startsWith("data:");return n?t:"".concat(t).concat(t.includes("?")?"&":"?").concat(this.queryParams)}},{key:"hasExtension",value:function(t){return Boolean(this._extensionsUsed.indexOf(t)>-1)}},{key:"update",value:function(){var t=this,n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;this.tilesetInitializationPromise.then(function(){!n&&t.lastUpdatedVieports?n=t.lastUpdatedVieports:t.lastUpdatedVieports=n,n&&t.doUpdate(n)})}},{key:"selectTiles",value:function(){var r=I(pn.default.mark(function n(){var i=this,a,o=arguments;return pn.default.wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return a=o.length>0&&o[0]!==void 0?o[0]:null,u.next=3,this.tilesetInitializationPromise;case 3:return a&&(this.lastUpdatedVieports=a),this.updatePromise||(this.updatePromise=new Promise(function(f){setTimeout(function(){i.lastUpdatedVieports&&i.doUpdate(i.lastUpdatedVieports),f(i._frameNumber),i.updatePromise=null},i.options.debounceTime)})),u.abrupt("return",this.updatePromise);case 6:case"end":return u.stop()}},n,this)}));function t(){return r.apply(this,arguments)}return t}()},{key:"doUpdate",value:function(t){if(!("loadTiles"in this.options&&!this.options.loadTiles)&&!(this.traverseCounter>0)){var n=t instanceof Array?t:[t];this._cache.reset(),this._frameNumber++,this.traverseCounter=n.length;var i=[],a=sr(n),o;try{for(a.s();!(o=a.n()).done;){var s=o.value,u=s.id;this._needTraverse(u)?i.push(u):this.traverseCounter--}}catch(m){a.e(m)}finally{a.f()}var f=sr(n),l;try{for(f.s();!(l=f.n()).done;){var h=l.value,d=h.id;if(this.roots[d]||(this.roots[d]=this._initializeTileHeaders(this.tileset,null)),!!i.includes(d)){var p=t0(h,this._frameNumber);this._traverser.traverse(this.roots[d],p,this.options)}}}catch(m){f.e(m)}finally{f.f()}}}},{key:"_needTraverse",value:function(t){var n=t;return this.options.viewportTraversersMap&&(n=this.options.viewportTraversersMap[t]),n===t}},{key:"_onTraversalEnd",value:function(t){var n=t.viewport.id;this.frameStateData[n]||(this.frameStateData[n]={selectedTiles:[],_requestedTiles:[],_emptyTiles:[]});var i=this.frameStateData[n],a=Object.values(this._traverser.selectedTiles),o=r0(a,t,this.options.maximumTilesSelected),s=D(o,2),u=s[0],f=s[1];i.selectedTiles=u;var l=sr(f),h;try{for(l.s();!(h=l.n()).done;){var d=h.value;d.unselect()}}catch(p){l.e(p)}finally{l.f()}i._requestedTiles=Object.values(this._traverser.requestedTiles),i._emptyTiles=Object.values(this._traverser.emptyTiles),this.traverseCounter--,!(this.traverseCounter>0)&&this._updateTiles()}},{key:"_updateTiles",value:function(){this.selectedTiles=[],this._requestedTiles=[],this._emptyTiles=[];for(var t in this.frameStateData){var n=this.frameStateData[t];this.selectedTiles=this.selectedTiles.concat(n.selectedTiles),this._requestedTiles=this._requestedTiles.concat(n._requestedTiles),this._emptyTiles=this._emptyTiles.concat(n._emptyTiles)}this.selectedTiles=this.options.onTraversalComplete(this.selectedTiles);var i=sr(this.selectedTiles),a;try{for(i.s();!(a=i.n()).done;){var o=a.value;this._tiles[o.id]=o}}catch(s){i.e(s)}finally{i.f()}this._loadTiles(),this._unloadTiles(),this._updateStats()}},{key:"_tilesChanged",value:function(t,n){if(t.length!==n.length)return!0;var i=new Set(t.map(function(s){return s.id})),a=new Set(n.map(function(s){return s.id})),o=t.filter(function(s){return!a.has(s.id)}).length>0;return o=o||n.filter(function(s){return!i.has(s.id)}).length>0,o}},{key:"_loadTiles",value:function(){var t=sr(this._requestedTiles),n;try{for(t.s();!(n=t.n()).done;){var i=n.value;i.contentUnloaded&&this._loadTile(i)}}catch(a){t.e(a)}finally{t.f()}}},{key:"_unloadTiles",value:function(){this._cache.unloadTiles(this,function(t,n){return t._unloadTile(n)})}},{key:"_updateStats",value:function(){var t=0,n=0,i=sr(this.selectedTiles),a;try{for(i.s();!(a=i.n()).done;){var o=a.value;o.contentAvailable&&o.content&&(t++,o.content.pointCount?n+=o.content.pointCount:n+=o.content.vertexCount)}}catch(s){i.e(s)}finally{i.f()}this.stats.get(I0).count=this.selectedTiles.length,this.stats.get(R0).count=t,this.stats.get(D0).count=n}},{key:"_initializeTileSet",value:function(){var r=I(pn.default.mark(function n(i){return pn.default.wrap(function(o){for(;;)switch(o.prev=o.next){case 0:if(this.type!==Ke.I3S){o.next=5;break}return this.calculateViewPropsI3S(),o.next=4,i.root;case 4:i.root=o.sent;case 5:this.root=this._initializeTileHeaders(i,null),this.type===Ke.TILES3D&&(this._initializeTiles3DTileset(i),this.calculateViewPropsTiles3D()),this.type===Ke.I3S&&this._initializeI3STileset();case 8:case"end":return o.stop()}},n,this)}));function t(n){return r.apply(this,arguments)}return t}()},{key:"calculateViewPropsI3S",value:function(){var t,n=this.tileset.fullExtent;if(n){var i=n.xmin,a=n.xmax,o=n.ymin,s=n.ymax,u=n.zmin,f=n.zmax;this.cartographicCenter=new E(i+(a-i)/2,o+(s-o)/2,u+(f-u)/2),this.cartesianCenter=ve.WGS84.cartographicToCartesian(this.cartographicCenter,new E),this.zoom=jl(n,this.cartographicCenter,this.cartesianCenter);return}var l=(t=this.tileset.store)===null||t===void 0?void 0:t.extent;if(l){var h=D(l,4),d=h[0],p=h[1],m=h[2],v=h[3];this.cartographicCenter=new E(d+(m-d)/2,p+(v-p)/2,0),this.cartesianCenter=ve.WGS84.cartographicToCartesian(this.cartographicCenter,new E),this.zoom=a0(l,this.cartographicCenter,this.cartesianCenter);return}console.warn("Extent is not defined in the tileset header"),this.cartographicCenter=new E,this.zoom=1}},{key:"calculateViewPropsTiles3D",value:function(){var t=this.root,n=t.boundingVolume.center;if(!n){console.warn("center was not pre-calculated for the root tile"),this.cartographicCenter=new E,this.zoom=1;return}n[0]!==0||n[1]!==0||n[2]!==0?this.cartographicCenter=ve.WGS84.cartesianToCartographic(n,new E):this.cartographicCenter=new E(0,0,-ve.WGS84.radii[0]),this.cartesianCenter=n,this.zoom=i0(t.boundingVolume,this.cartographicCenter)}},{key:"_initializeStats",value:function(){this.stats.get(ms),this.stats.get(Yl),this.stats.get(Kl),this.stats.get(I0),this.stats.get(R0),this.stats.get(F0),this.stats.get(L0),this.stats.get(k0),this.stats.get(D0),this.stats.get(Zl,"memory")}},{key:"_initializeTileHeaders",value:function(t,n){var i=new pa(this,t.root,n);if(n&&(n.children.push(i),i.depth=n.depth+1),this.type===Ke.TILES3D){var a=[];for(a.push(i);a.length>0;){var o=a.pop();this.stats.get(ms).incrementCount();var s=o.header.children||[],u=sr(s),f;try{for(u.s();!(f=u.n()).done;){var l=f.value,h,d=new pa(this,l,o);if((h=d.contentUrl)!==null&&h!==void 0&&h.includes("?session=")){var p=new URL(d.contentUrl),m=p.searchParams.get("session");m&&(this._queryParams.session=m)}o.children.push(d),d.depth=o.depth+1,a.push(d)}}catch(v){u.e(v)}finally{u.f()}}}return i}},{key:"_initializeTraverser",value:function(){var t,n=this.type;switch(n){case Ke.TILES3D:t=x0;break;case Ke.I3S:t=M0;break;default:t=Ir}return new t({basePath:this.basePath,onTraversalEnd:this._onTraversalEnd.bind(this)})}},{key:"_destroyTileHeaders",value:function(t){this._destroySubtree(t)}},{key:"_loadTile",value:function(){var r=I(pn.default.mark(function n(i){var a;return pn.default.wrap(function(s){for(;;)switch(s.prev=s.next){case 0:return s.prev=0,this._onStartTileLoading(),s.next=4,i.loadContent();case 4:a=s.sent,s.next=10;break;case 7:s.prev=7,s.t0=s.catch(0),this._onTileLoadError(i,s.t0 instanceof Error?s.t0:new Error("load failed"));case 10:return s.prev=10,this._onEndTileLoading(),this._onTileLoad(i,a),s.finish(10);case 14:case"end":return s.stop()}},n,this,[[0,7,10,14]])}));function t(n){return r.apply(this,arguments)}return t}()},{key:"_onTileLoadError",value:function(t,n){this.stats.get(k0).incrementCount();var i=n.message||n.toString(),a=t.url;console.error("A 3D tile failed to load: ".concat(t.url," ").concat(i)),this.options.onTileError(t,i,a)}},{key:"_onTileLoad",value:function(t,n){if(n){if(this.type===Ke.I3S){var i,a,o=((i=this.tileset)===null||i===void 0||(a=i.nodePagesTile)===null||a===void 0?void 0:a.nodesInNodePages)||0;this.stats.get(ms).reset(),this.stats.get(ms).addCount(o)}t&&t.content&&Zy(t,t.content),this.updateContentTypes(t),this._addTileToCache(t),this.options.onTileLoad(t)}}},{key:"updateContentTypes",value:function(t){if(this.type===Ke.I3S)switch(t.header.isDracoGeometry&&(this.contentFormats.draco=!0),t.header.textureFormat){case"dds":this.contentFormats.dds=!0;break;case"ktx2":this.contentFormats.ktx2=!0;break;default:}else if(this.type===Ke.TILES3D){var n,i=((n=t.content)===null||n===void 0?void 0:n.gltf)||{},a=i.extensionsRemoved,o=a===void 0?[]:a;o.includes("KHR_draco_mesh_compression")&&(this.contentFormats.draco=!0),o.includes("EXT_meshopt_compression")&&(this.contentFormats.meshopt=!0),o.includes("KHR_texture_basisu")&&(this.contentFormats.ktx2=!0)}}},{key:"_onStartTileLoading",value:function(){this._pendingCount++,this.stats.get(Yl).incrementCount()}},{key:"_onEndTileLoading",value:function(){this._pendingCount--,this.stats.get(Yl).decrementCount()}},{key:"_addTileToCache",value:function(t){this._cache.add(this,t,function(n){return n._updateCacheStats(t)})}},{key:"_updateCacheStats",value:function(t){this.stats.get(F0).incrementCount(),this.stats.get(Kl).incrementCount(),this.gpuMemoryUsageInBytes+=t.gpuMemoryUsageInBytes||0,this.stats.get(Zl).count=this.gpuMemoryUsageInBytes}},{key:"_unloadTile",value:function(t){this.gpuMemoryUsageInBytes-=t.gpuMemoryUsageInBytes||0,this.stats.get(Kl).decrementCount(),this.stats.get(L0).incrementCount(),this.stats.get(Zl).count=this.gpuMemoryUsageInBytes,this.options.onTileUnload(t),t.unloadContent()}},{key:"_destroy",value:function(){var t=[];for(this.root&&t.push(this.root);t.length>0;){var n=t.pop(),i=sr(n.children),a;try{for(i.s();!(a=i.n()).done;){var o=a.value;t.push(o)}}catch(s){i.e(s)}finally{i.f()}this._destroyTile(n)}this.root=null}},{key:"_destroySubtree",value:function(t){var n=t,i=[];for(i.push(n);i.length>0;){t=i.pop();var a=sr(t.children),o;try{for(a.s();!(o=a.n()).done;){var s=o.value;i.push(s)}}catch(u){a.e(u)}finally{a.f()}t!==n&&this._destroyTile(t)}n.children=[]}},{key:"_destroyTile",value:function(t){this._cache.unloadTile(this,t),this._unloadTile(t),t.destroy()}},{key:"_initializeTiles3DTileset",value:function(t){if(t.queryString){var n=new URLSearchParams(t.queryString),i=Object.fromEntries(n.entries());this._queryParams=Rr(Rr({},this._queryParams),i)}if(this.asset=t.asset,!this.asset)throw new Error("Tileset must have an asset property.");if(this.asset.version!=="0.0"&&this.asset.version!=="1.0")throw new Error("The tileset must be 3D Tiles version 0.0 or 1.0.");"tilesetVersion"in this.asset&&(this._queryParams.v=this.asset.tilesetVersion),this.credits={attributions:this.options.attributions||[]},this.description=this.options.description||"",this.properties=t.properties,this.geometricError=t.geometricError,this._extensionsUsed=t.extensionsUsed||[],this.extras=t.extras}},{key:"_initializeI3STileset",value:function(){this.loadOptions.i3s&&"token"in this.loadOptions.i3s&&(this._queryParams.token=this.loadOptions.i3s.token)}}]),e}();var Bn=X(re());var vs="3.4.13";var Rh=X(re());var mn={COMPOSITE:"cmpt",POINT_CLOUD:"pnts",BATCHED_3D_MODEL:"b3dm",INSTANCED_3D_MODEL:"i3dm",GEOMETRY:"geom",VECTOR:"vect",GLTF:"glTF"},Wq=Object.keys(mn);function Ql(e,r,t){ce(e instanceof ArrayBuffer);var n=new TextDecoder("utf8"),i=new Uint8Array(e,r,t),a=n.decode(i);return a}function G0(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,t=new DataView(e);return"".concat(String.fromCharCode(t.getUint8(r+0))).concat(String.fromCharCode(t.getUint8(r+1))).concat(String.fromCharCode(t.getUint8(r+2))).concat(String.fromCharCode(t.getUint8(r+3)))}N();var yn=X(re());N();var uc=X(re());Le();var N0="3.4.13";var OB={draco:{decoderType:(typeof WebAssembly>"u"?"undefined":te(WebAssembly))==="object"?"wasm":"js",libraryPath:"libs/",extraAttributes:{},attributeNameEntry:void 0}},U0={name:"Draco",id:qt?"draco":"draco-nodejs",module:"draco",shapes:["mesh"],version:N0,worker:!0,extensions:["drc"],mimeTypes:["application/octet-stream"],binary:!0,tests:["DRACO"],options:OB};ue();N();q();Y();N();function vn(e){for(var r=1/0,t=1/0,n=1/0,i=-1/0,a=-1/0,o=-1/0,s=e.POSITION?e.POSITION.value:[],u=s&&s.length,f=0;f<u;f+=3){var l=s[f],h=s[f+1],d=s[f+2];r=l<r?l:r,t=h<t?h:t,n=d<n?d:n,i=l>i?l:i,a=h>a?h:a,o=d>o?d:o}return[[r,t,n],[i,a,o]]}q();Y();N();function j0(e,r){if(!e)throw new Error(r||"loader assertion failed.")}function ec(e,r){var t=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=PB(e))||r&&e&&typeof e.length=="number"){t&&(e=t);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(f){throw f},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
170
170
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){t=t.call(e)},n:function(){var f=t.next();return a=f.done,f},e:function(f){o=!0,s=f},f:function(){try{!a&&t.return!=null&&t.return()}finally{if(o)throw s}}}}function PB(e,r){if(e){if(typeof e=="string")return H0(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);if(t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set")return Array.from(e);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return H0(e,r)}}function H0(e,r){(r==null||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}var ma=function(){function e(r,t){T(this,e),c(this,"fields",void 0),c(this,"metadata",void 0),j0(Array.isArray(r)),IB(r),this.fields=r,this.metadata=t||new Map}return w(e,[{key:"compareTo",value:function(t){if(this.metadata!==t.metadata||this.fields.length!==t.fields.length)return!1;for(var n=0;n<this.fields.length;++n)if(!this.fields[n].compareTo(t.fields[n]))return!1;return!0}},{key:"select",value:function(){for(var t=Object.create(null),n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];for(var o=0,s=i;o<s.length;o++){var u=s[o];t[u]=!0}var f=this.fields.filter(function(l){return t[l.name]});return new e(f,this.metadata)}},{key:"selectAt",value:function(){for(var t=this,n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];var o=i.map(function(s){return t.fields[s]}).filter(Boolean);return new e(o,this.metadata)}},{key:"assign",value:function(t){var n,i=this.metadata;if(t instanceof e){var a=t;n=a.fields,i=V0(V0(new Map,this.metadata),a.metadata)}else n=t;var o=Object.create(null),s=ec(this.fields),u;try{for(s.s();!(u=s.n()).done;){var f=u.value;o[f.name]=f}}catch(m){s.e(m)}finally{s.f()}var l=ec(n),h;try{for(l.s();!(h=l.n()).done;){var d=h.value;o[d.name]=d}}catch(m){l.e(m)}finally{l.f()}var p=Object.values(o);return new e(p,i)}}]),e}();function IB(e){var r={},t=ec(e),n;try{for(t.s();!(n=t.n()).done;){var i=n.value;r[i.name]&&console.warn("Schema: duplicated field name",i.name,i),r[i.name]=!0}}catch(a){t.e(a)}finally{t.f()}}function V0(e,r){return new Map([].concat(K(e||new Map),K(r||new Map)))}q();Y();N();var va=function(){function e(r,t){T(this,e);var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:new Map;c(this,"name",void 0),c(this,"type",void 0),c(this,"nullable",void 0),c(this,"metadata",void 0),this.name=r,this.type=t,this.nullable=n,this.metadata=i}return w(e,[{key:"typeId",get:function(){return this.type&&this.type.typeId}},{key:"clone",value:function(){return new e(this.name,this.type,this.nullable,this.metadata)}},{key:"compareTo",value:function(t){return this.name===t.name&&this.type===t.type&&this.nullable===t.nullable&&this.metadata===t.metadata}},{key:"toString",value:function(){return"".concat(this.type).concat(this.nullable?", nullable":"").concat(this.metadata?", metadata: ".concat(this.metadata):"")}}]),e}();q();Y();N();var ge=function(e){return e[e.NONE=0]="NONE",e[e.Null=1]="Null",e[e.Int=2]="Int",e[e.Float=3]="Float",e[e.Binary=4]="Binary",e[e.Utf8=5]="Utf8",e[e.Bool=6]="Bool",e[e.Decimal=7]="Decimal",e[e.Date=8]="Date",e[e.Time=9]="Time",e[e.Timestamp=10]="Timestamp",e[e.Interval=11]="Interval",e[e.List=12]="List",e[e.Struct=13]="Struct",e[e.Union=14]="Union",e[e.FixedSizeBinary=15]="FixedSizeBinary",e[e.FixedSizeList=16]="FixedSizeList",e[e.Map=17]="Map",e[e.Dictionary=-1]="Dictionary",e[e.Int8=-2]="Int8",e[e.Int16=-3]="Int16",e[e.Int32=-4]="Int32",e[e.Int64=-5]="Int64",e[e.Uint8=-6]="Uint8",e[e.Uint16=-7]="Uint16",e[e.Uint32=-8]="Uint32",e[e.Uint64=-9]="Uint64",e[e.Float16=-10]="Float16",e[e.Float32=-11]="Float32",e[e.Float64=-12]="Float64",e[e.DateDay=-13]="DateDay",e[e.DateMillisecond=-14]="DateMillisecond",e[e.TimestampSecond=-15]="TimestampSecond",e[e.TimestampMillisecond=-16]="TimestampMillisecond",e[e.TimestampMicrosecond=-17]="TimestampMicrosecond",e[e.TimestampNanosecond=-18]="TimestampNanosecond",e[e.TimeSecond=-19]="TimeSecond",e[e.TimeMillisecond=-20]="TimeMillisecond",e[e.TimeMicrosecond=-21]="TimeMicrosecond",e[e.TimeNanosecond=-22]="TimeNanosecond",e[e.DenseUnion=-23]="DenseUnion",e[e.SparseUnion=-24]="SparseUnion",e[e.IntervalDayTime=-25]="IntervalDayTime",e[e.IntervalYearMonth=-26]="IntervalYearMonth",e}({});function me(e){var r=RB();return function(){var n=L(e),i;if(r){var a=L(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return $(this,i)}}function RB(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var z0,W0,J0,X0,q0,K0,Y0,Z0,ut=function(){function e(){T(this,e)}return w(e,[{key:"typeId",get:function(){return ge.NONE}},{key:"compareTo",value:function(t){return this===t}}],[{key:"isNull",value:function(t){return t&&t.typeId===ge.Null}},{key:"isInt",value:function(t){return t&&t.typeId===ge.Int}},{key:"isFloat",value:function(t){return t&&t.typeId===ge.Float}},{key:"isBinary",value:function(t){return t&&t.typeId===ge.Binary}},{key:"isUtf8",value:function(t){return t&&t.typeId===ge.Utf8}},{key:"isBool",value:function(t){return t&&t.typeId===ge.Bool}},{key:"isDecimal",value:function(t){return t&&t.typeId===ge.Decimal}},{key:"isDate",value:function(t){return t&&t.typeId===ge.Date}},{key:"isTime",value:function(t){return t&&t.typeId===ge.Time}},{key:"isTimestamp",value:function(t){return t&&t.typeId===ge.Timestamp}},{key:"isInterval",value:function(t){return t&&t.typeId===ge.Interval}},{key:"isList",value:function(t){return t&&t.typeId===ge.List}},{key:"isStruct",value:function(t){return t&&t.typeId===ge.Struct}},{key:"isUnion",value:function(t){return t&&t.typeId===ge.Union}},{key:"isFixedSizeBinary",value:function(t){return t&&t.typeId===ge.FixedSizeBinary}},{key:"isFixedSizeList",value:function(t){return t&&t.typeId===ge.FixedSizeList}},{key:"isMap",value:function(t){return t&&t.typeId===ge.Map}},{key:"isDictionary",value:function(t){return t&&t.typeId===ge.Dictionary}}]),e}(),$0=function(e,r){H(n,e);var t=me(n);function n(){return T(this,n),t.apply(this,arguments)}return w(n,[{key:"typeId",get:function(){return ge.Null}},{key:r,get:function(){return"Null"}},{key:"toString",value:function(){return"Null"}}]),n}(ut,Symbol.toStringTag),Q0=function(e,r){H(n,e);var t=me(n);function n(){return T(this,n),t.apply(this,arguments)}return w(n,[{key:"typeId",get:function(){return ge.Bool}},{key:r,get:function(){return"Bool"}},{key:"toString",value:function(){return"Bool"}}]),n}(ut,Symbol.toStringTag);z0=Symbol.toStringTag;var zt=function(e,r){H(n,e);var t=me(n);function n(i,a){var o;return T(this,n),o=t.call(this),c(oe(o),"isSigned",void 0),c(oe(o),"bitWidth",void 0),o.isSigned=i,o.bitWidth=a,o}return w(n,[{key:"typeId",get:function(){return ge.Int}},{key:r,get:function(){return"Int"}},{key:"toString",value:function(){return"".concat(this.isSigned?"I":"Ui","nt").concat(this.bitWidth)}}]),n}(ut,z0),gs=function(e){H(t,e);var r=me(t);function t(){return T(this,t),r.call(this,!0,8)}return t}(zt),ys=function(e){H(t,e);var r=me(t);function t(){return T(this,t),r.call(this,!0,16)}return t}(zt),As=function(e){H(t,e);var r=me(t);function t(){return T(this,t),r.call(this,!0,32)}return t}(zt),e1=function(e){H(t,e);var r=me(t);function t(){return T(this,t),r.call(this,!0,64)}return t}(zt),_s=function(e){H(t,e);var r=me(t);function t(){return T(this,t),r.call(this,!1,8)}return t}(zt),bs=function(e){H(t,e);var r=me(t);function t(){return T(this,t),r.call(this,!1,16)}return t}(zt),Ts=function(e){H(t,e);var r=me(t);function t(){return T(this,t),r.call(this,!1,32)}return t}(zt),t1=function(e){H(t,e);var r=me(t);function t(){return T(this,t),r.call(this,!1,64)}return t}(zt),tc={HALF:16,SINGLE:32,DOUBLE:64};W0=Symbol.toStringTag;var ga=function(e,r){H(n,e);var t=me(n);function n(i){var a;return T(this,n),a=t.call(this),c(oe(a),"precision",void 0),a.precision=i,a}return w(n,[{key:"typeId",get:function(){return ge.Float}},{key:r,get:function(){return"Float"}},{key:"toString",value:function(){return"Float".concat(this.precision)}}]),n}(ut,W0),r1=function(e){H(t,e);var r=me(t);function t(){return T(this,t),r.call(this,tc.HALF)}return t}(ga),xs=function(e){H(t,e);var r=me(t);function t(){return T(this,t),r.call(this,tc.SINGLE)}return t}(ga),Es=function(e){H(t,e);var r=me(t);function t(){return T(this,t),r.call(this,tc.DOUBLE)}return t}(ga),n1=function(e,r){H(n,e);var t=me(n);function n(){return T(this,n),t.call(this)}return w(n,[{key:"typeId",get:function(){return ge.Binary}},{key:"toString",value:function(){return"Binary"}},{key:r,get:function(){return"Binary"}}]),n}(ut,Symbol.toStringTag),i1=function(e,r){H(n,e);var t=me(n);function n(){return T(this,n),t.apply(this,arguments)}return w(n,[{key:"typeId",get:function(){return ge.Utf8}},{key:r,get:function(){return"Utf8"}},{key:"toString",value:function(){return"Utf8"}}]),n}(ut,Symbol.toStringTag),rc={DAY:0,MILLISECOND:1};J0=Symbol.toStringTag;var Ss=function(e,r){H(n,e);var t=me(n);function n(i){var a;return T(this,n),a=t.call(this),c(oe(a),"unit",void 0),a.unit=i,a}return w(n,[{key:"typeId",get:function(){return ge.Date}},{key:r,get:function(){return"Date"}},{key:"toString",value:function(){return"Date".concat((this.unit+1)*32,"<").concat(rc[this.unit],">")}}]),n}(ut,J0),a1=function(e){H(t,e);var r=me(t);function t(){return T(this,t),r.call(this,rc.DAY)}return t}(Ss),o1=function(e){H(t,e);var r=me(t);function t(){return T(this,t),r.call(this,rc.MILLISECOND)}return t}(Ss),Fr={SECOND:1,MILLISECOND:1e3,MICROSECOND:1e6,NANOSECOND:1e9};X0=Symbol.toStringTag;var ws=function(e,r){H(n,e);var t=me(n);function n(i,a){var o;return T(this,n),o=t.call(this),c(oe(o),"unit",void 0),c(oe(o),"bitWidth",void 0),o.unit=i,o.bitWidth=a,o}return w(n,[{key:"typeId",get:function(){return ge.Time}},{key:"toString",value:function(){return"Time".concat(this.bitWidth,"<").concat(Fr[this.unit],">")}},{key:r,get:function(){return"Time"}}]),n}(ut,X0),s1=function(e){H(t,e);var r=me(t);function t(){return T(this,t),r.call(this,Fr.SECOND,32)}return t}(ws),u1=function(e){H(t,e);var r=me(t);function t(){return T(this,t),r.call(this,Fr.MILLISECOND,32)}return t}(ws);q0=Symbol.toStringTag;var si=function(e,r){H(n,e);var t=me(n);function n(i){var a;T(this,n);var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return a=t.call(this),c(oe(a),"unit",void 0),c(oe(a),"timezone",void 0),a.unit=i,a.timezone=o,a}return w(n,[{key:"typeId",get:function(){return ge.Timestamp}},{key:r,get:function(){return"Timestamp"}},{key:"toString",value:function(){return"Timestamp<".concat(Fr[this.unit]).concat(this.timezone?", ".concat(this.timezone):"",">")}}]),n}(ut,q0),f1=function(e){H(t,e);var r=me(t);function t(){T(this,t);var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;return r.call(this,Fr.SECOND,n)}return t}(si),l1=function(e){H(t,e);var r=me(t);function t(){T(this,t);var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;return r.call(this,Fr.MILLISECOND,n)}return t}(si),c1=function(e){H(t,e);var r=me(t);function t(){T(this,t);var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;return r.call(this,Fr.MICROSECOND,n)}return t}(si),h1=function(e){H(t,e);var r=me(t);function t(){T(this,t);var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;return r.call(this,Fr.NANOSECOND,n)}return t}(si),nc={DAY_TIME:0,YEAR_MONTH:1};K0=Symbol.toStringTag;var Cs=function(e,r){H(n,e);var t=me(n);function n(i){var a;return T(this,n),a=t.call(this),c(oe(a),"unit",void 0),a.unit=i,a}return w(n,[{key:"typeId",get:function(){return ge.Interval}},{key:r,get:function(){return"Interval"}},{key:"toString",value:function(){return"Interval<".concat(nc[this.unit],">")}}]),n}(ut,K0),d1=function(e){H(t,e);var r=me(t);function t(){return T(this,t),r.call(this,nc.DAY_TIME)}return t}(Cs),p1=function(e){H(t,e);var r=me(t);function t(){return T(this,t),r.call(this,nc.YEAR_MONTH)}return t}(Cs);Y0=Symbol.toStringTag;var Bs=function(e,r){H(n,e);var t=me(n);function n(i,a){var o;return T(this,n),o=t.call(this),c(oe(o),"listSize",void 0),c(oe(o),"children",void 0),o.listSize=i,o.children=[a],o}return w(n,[{key:"typeId",get:function(){return ge.FixedSizeList}},{key:"valueType",get:function(){return this.children[0].type}},{key:"valueField",get:function(){return this.children[0]}},{key:r,get:function(){return"FixedSizeList"}},{key:"toString",value:function(){return"FixedSizeList[".concat(this.listSize,"]<").concat(this.valueType,">")}}]),n}(ut,Y0);Z0=Symbol.toStringTag;var m1=function(e,r){H(n,e);var t=me(n);function n(i){var a;return T(this,n),a=t.call(this),c(oe(a),"children",void 0),a.children=i,a}return w(n,[{key:"typeId",get:function(){return ge.Struct}},{key:"toString",value:function(){return"Struct<{".concat(this.children.map(function(a){return"".concat(a.name,":").concat(a.type)}).join(", "),"}>")}},{key:r,get:function(){return"Struct"}}]),n}(ut,Z0);function v1(e){switch(e.constructor){case Int8Array:return new gs;case Uint8Array:return new _s;case Int16Array:return new ys;case Uint16Array:return new bs;case Int32Array:return new As;case Uint32Array:return new Ts;case Float32Array:return new xs;case Float64Array:return new Es;default:throw new Error("array type not supported")}}function ic(e,r,t){var n=v1(r.value),i=t||g1(r),a=new va(e,new Bs(r.size,new va("value",n)),!1,i);return a}function g1(e){var r=new Map;return"byteOffset"in e&&r.set("byteOffset",e.byteOffset.toString(10)),"byteStride"in e&&r.set("byteStride",e.byteStride.toString(10)),"normalized"in e&&r.set("normalized",e.normalized.toString()),r}function A1(e,r,t){var n=_1(r.metadata),i=[],a=FB(r.attributes);for(var o in e){var s=e[o],u=y1(o,s,a[o]);i.push(u)}if(t){var f=y1("indices",t);i.push(f)}return new ma(i,n)}function FB(e){var r={};for(var t in e){var n=e[t];r[n.name||"undefined"]=n}return r}function y1(e,r,t){var n=t?_1(t.metadata):void 0,i=ic(e,r,n);return i}function _1(e){var r=new Map;for(var t in e)r.set("".concat(t,".string"),JSON.stringify(e[t]));return r}function LB(e,r){var t=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=kB(e))||r&&e&&typeof e.length=="number"){t&&(e=t);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(f){throw f},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
@@ -175,20 +175,20 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
175
175
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){t=t.call(e)},n:function(){var f=t.next();return a=f.done,f},e:function(f){o=!0,s=f},f:function(){try{!a&&t.return!=null&&t.return()}finally{if(o)throw s}}}}function QM(e,r){if(e){if(typeof e=="string")return gA(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);if(t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set")return Array.from(e);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return gA(e,r)}}function gA(e,r){(r==null||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}var pi="EXT_texture_webp",eO=pi;function tO(e,r){var t=new Pe(e);if(!gf("image/webp")){if(t.getRequiredExtensions().includes(pi))throw new Error("gltf: Required extension ".concat(pi," not supported by browser"));return}var n=t.json,i=$M(n.textures||[]),a;try{for(i.s();!(a=i.n()).done;){var o=a.value,s=t.getObjectExtension(o,pi);s&&(o.source=s.source),t.removeObjectExtension(o,pi)}}catch(u){i.e(u)}finally{i.f()}t.removeExtension(pi)}var Hc={};bt(Hc,{name:()=>iO,preprocess:()=>aO});function rO(e,r){var t=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=nO(e))||r&&e&&typeof e.length=="number"){t&&(e=t);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(f){throw f},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
176
176
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){t=t.call(e)},n:function(){var f=t.next();return a=f.done,f},e:function(f){o=!0,s=f},f:function(){try{!a&&t.return!=null&&t.return()}finally{if(o)throw s}}}}function nO(e,r){if(e){if(typeof e=="string")return yA(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);if(t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set")return Array.from(e);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return yA(e,r)}}function yA(e,r){(r==null||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}var ks="KHR_texture_basisu",iO=ks;function aO(e,r){var t=new Pe(e),n=t.json,i=rO(n.textures||[]),a;try{for(i.s();!(a=i.n()).done;){var o=a.value,s=t.getObjectExtension(o,ks);s&&(o.source=s.source),t.removeObjectExtension(o,ks)}}catch(u){i.e(u)}finally{i.f()}t.removeExtension(ks)}var Xc={};bt(Xc,{decode:()=>dO,encode:()=>pO,name:()=>cO,preprocess:()=>hO});ue();N();var bn=X(re());function AA(e){var r={};for(var t in e){var n=e[t];if(t!=="indices"){var i=Vc(n);r[t]=i}}return r}function Vc(e){var r=oO(e),t=r.buffer,n=r.size,i=r.count,a={value:t,size:n,byteOffset:0,count:i,type:Fs(n),componentType:Ls(t)};return a}function oO(e){var r=e,t=1,n=0;return e&&e.value&&(r=e.value,t=e.size||1),r&&(ArrayBuffer.isView(r)||(r=sO(r,Float32Array)),n=r.length/t),{buffer:r,size:t,count:n}}function sO(e,r){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return e?Array.isArray(e)?new r(e):t&&!(e instanceof r)?new r(e):e:null}function _A(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),t.push.apply(t,n)}return t}function uO(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{};r%2?_A(Object(t),!0).forEach(function(n){c(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):_A(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}var fO=bn.default.mark(Jc);function Ta(e,r){var t=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=lO(e))||r&&e&&typeof e.length=="number"){t&&(e=t);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(f){throw f},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
177
177
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){t=t.call(e)},n:function(){var f=t.next();return a=f.done,f},e:function(f){o=!0,s=f},f:function(){try{!a&&t.return!=null&&t.return()}finally{if(o)throw s}}}}function lO(e,r){if(e){if(typeof e=="string")return bA(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);if(t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set")return Array.from(e);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return bA(e,r)}}function bA(e,r){(r==null||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}var Tn="KHR_draco_mesh_compression",cO=Tn;function hO(e,r,t){var n=new Pe(e),i=Ta(Jc(n)),a;try{for(i.s();!(a=i.n()).done;){var o=a.value;n.getObjectExtension(o,Tn)}}catch(s){i.e(s)}finally{i.f()}}function dO(e,r,t){return zc.apply(this,arguments)}function zc(){return zc=I(bn.default.mark(function e(r,t,n){var i,a,o,s,u,f;return bn.default.wrap(function(h){for(;;)switch(h.prev=h.next){case 0:if(t!=null&&(i=t.gltf)!==null&&i!==void 0&&i.decompressMeshes){h.next=2;break}return h.abrupt("return");case 2:a=new Pe(r),o=[],s=Ta(Jc(a));try{for(s.s();!(u=s.n()).done;)f=u.value,a.getObjectExtension(f,Tn)&&o.push(mO(a,f,t,n))}catch(d){s.e(d)}finally{s.f()}return h.next=8,Promise.all(o);case 8:a.removeExtension(Tn);case 9:case"end":return h.stop()}},e)})),zc.apply(this,arguments)}function pO(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=new Pe(e),n=Ta(t.json.meshes||[]),i;try{for(n.s();!(i=n.n()).done;){var a=i.value;vO(a,r),t.addRequiredExtension(Tn)}}catch(o){n.e(o)}finally{n.f()}}function mO(e,r,t,n){return Wc.apply(this,arguments)}function Wc(){return Wc=I(bn.default.mark(function e(r,t,n,i){var a,o,s,u,f,l,h,d,p,m,v,g,y,A;return bn.default.wrap(function(b){for(;;)switch(b.prev=b.next){case 0:if(a=r.getObjectExtension(t,Tn),a){b.next=3;break}return b.abrupt("return");case 3:return o=r.getTypedArrayForBufferView(a.bufferView),s=Wr(o.buffer,o.byteOffset),u=i.parse,f=uO({},n),delete f["3d-tiles"],b.next=10,u(s,Ms,f,i);case 10:for(l=b.sent,h=AA(l.attributes),d=0,p=Object.entries(h);d<p.length;d++)m=D(p[d],2),v=m[0],g=m[1],v in t.attributes&&(y=t.attributes[v],A=r.getAccessor(y),A!=null&&A.min&&A!==null&&A!==void 0&&A.max&&(g.min=A.min,g.max=A.max));t.attributes=h,l.indices&&(t.indices=Vc(l.indices)),gO(t);case 16:case"end":return b.stop()}},e)})),Wc.apply(this,arguments)}function vO(e,r){var t,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:4,i=arguments.length>3?arguments[3]:void 0,a=arguments.length>4?arguments[4]:void 0;if(!i.DracoWriter)throw new Error("options.gltf.DracoWriter not provided");var o=i.DracoWriter.encodeSync({attributes:e}),s=a==null||(t=a.parseSync)===null||t===void 0?void 0:t.call(a,{attributes:e}),u=i._addFauxAttributes(s.attributes),f=i.addBufferView(o),l={primitives:[{attributes:u,mode:n,extensions:c({},Tn,{bufferView:f,attributes:u})}]};return l}function gO(e){if(!e.attributes&&Object.keys(e.attributes).length>0)throw new Error("glTF: Empty primitive detected: Draco decompression failure?")}function Jc(e){var r,t,n,i,a,o;return bn.default.wrap(function(u){for(;;)switch(u.prev=u.next){case 0:r=Ta(e.json.meshes||[]),u.prev=1,r.s();case 3:if((t=r.n()).done){u.next=24;break}n=t.value,i=Ta(n.primitives),u.prev=6,i.s();case 8:if((a=i.n()).done){u.next=14;break}return o=a.value,u.next=12,o;case 12:u.next=8;break;case 14:u.next=19;break;case 16:u.prev=16,u.t0=u.catch(6),i.e(u.t0);case 19:return u.prev=19,i.f(),u.finish(19);case 22:u.next=3;break;case 24:u.next=29;break;case 26:u.prev=26,u.t1=u.catch(1),r.e(u.t1);case 29:return u.prev=29,r.f(),u.finish(29);case 32:case"end":return u.stop()}},fO,null,[[1,26,29,32],[6,16,19,22]])}var Zc={};bt(Zc,{decode:()=>TO,name:()=>AO});ue();var qc=X(re());var TA={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},xA={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4};function EA(e,r){var t=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=yO(e))||r&&e&&typeof e.length=="number"){t&&(e=t);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(f){throw f},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
178
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){t=t.call(e)},n:function(){var f=t.next();return a=f.done,f},e:function(f){o=!0,s=f},f:function(){try{!a&&t.return!=null&&t.return()}finally{if(o)throw s}}}}function yO(e,r){if(e){if(typeof e=="string")return SA(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);if(t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set")return Array.from(e);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return SA(e,r)}}function SA(e,r){(r==null||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}var Yc="KHR_texture_transform",AO=Yc,Ds=new E,_O=new
|
|
178
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){t=t.call(e)},n:function(){var f=t.next();return a=f.done,f},e:function(f){o=!0,s=f},f:function(){try{!a&&t.return!=null&&t.return()}finally{if(o)throw s}}}}function yO(e,r){if(e){if(typeof e=="string")return SA(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);if(t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set")return Array.from(e);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return SA(e,r)}}function SA(e,r){(r==null||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}var Yc="KHR_texture_transform",AO=Yc,Ds=new E,_O=new be,bO=new be;function TO(e,r){return Kc.apply(this,arguments)}function Kc(){return Kc=I(qc.default.mark(function e(r,t){var n,i,a,o;return qc.default.wrap(function(u){for(;;)switch(u.prev=u.next){case 0:if(n=new Pe(r),i=n.getExtension(Yc),i){u.next=4;break}return u.abrupt("return");case 4:for(a=r.json.materials||[],o=0;o<a.length;o++)xO(o,r);case 6:case"end":return u.stop()}},e)})),Kc.apply(this,arguments)}function xO(e,r){var t,n,i,a=[],o=(t=r.json.materials)===null||t===void 0?void 0:t[e],s=o==null||(n=o.pbrMetallicRoughness)===null||n===void 0?void 0:n.baseColorTexture;s&&xa(r,e,s,a);var u=o?.emissiveTexture;u&&xa(r,e,u,a);var f=o?.normalTexture;f&&xa(r,e,f,a);var l=o?.occlusionTexture;l&&xa(r,e,l,a);var h=o==null||(i=o.pbrMetallicRoughness)===null||i===void 0?void 0:i.metallicRoughnessTexture;h&&xa(r,e,h,a)}function xa(e,r,t,n){var i=EO(t,n);if(i){var a=e.json.meshes||[],o=EA(a),s;try{for(o.s();!(s=o.n()).done;){var u=s.value,f=EA(u.primitives),l;try{for(f.s();!(l=f.n()).done;){var h=l.value,d=h.material;Number.isFinite(d)&&r===d&&SO(e,h,i)}}catch(p){f.e(p)}finally{f.f()}}}catch(p){o.e(p)}finally{o.f()}}}function EO(e,r){var t,n=(t=e.extensions)===null||t===void 0?void 0:t[Yc],i=e.texCoord,a=i===void 0?0:i,o=n.texCoord,s=o===void 0?a:o,u=r.findIndex(function(l){var h=D(l,2),d=h[0],p=h[1];return d===a&&p===s})!==-1;if(!u){var f=BO(n);return a!==s&&(e.texCoord=s),r.push([a,s]),{originalTexCoord:a,texCoord:s,matrix:f}}return null}function SO(e,r,t){var n=t.originalTexCoord,i=t.texCoord,a=t.matrix,o=r.attributes["TEXCOORD_".concat(n)];if(Number.isFinite(o)){var s,u=(s=e.json.accessors)===null||s===void 0?void 0:s[o];if(u&&u.bufferView){var f,l=(f=e.json.bufferViews)===null||f===void 0?void 0:f[u.bufferView];if(l){for(var h=e.buffers[l.buffer],d=h.arrayBuffer,p=h.byteOffset,m=(p||0)+(u.byteOffset||0)+(l.byteOffset||0),v=di(u,l),g=v.ArrayType,y=v.length,A=xA[u.componentType],x=TA[u.type],b=l.byteStride||A*x,M=new Float32Array(y),C=0;C<u.count;C++){var F=new g(d,m+C*b,2);Ds.set(F[0],F[1],1),Ds.transformByMatrix3(a),M.set([Ds[0],Ds[1]],C*x)}n===i?wO(u,l,e.buffers,M):CO(i,u,r,e,M)}}}}function wO(e,r,t,n){e.componentType=5126,t.push({arrayBuffer:n.buffer,byteOffset:0,byteLength:n.buffer.byteLength}),r.buffer=t.length-1,r.byteLength=n.buffer.byteLength,r.byteOffset=0,delete r.byteStride}function CO(e,r,t,n,i){n.buffers.push({arrayBuffer:i.buffer,byteOffset:0,byteLength:i.buffer.byteLength});var a=n.json.bufferViews;if(a){a.push({buffer:n.buffers.length-1,byteLength:i.buffer.byteLength,byteOffset:0});var o=n.json.accessors;o&&(o.push({bufferView:a?.length-1,byteOffset:0,componentType:5126,count:r.count,type:"VEC2"}),t.attributes["TEXCOORD_".concat(e)]=o.length-1)}}function BO(e){var r=e.offset,t=r===void 0?[0,0]:r,n=e.rotation,i=n===void 0?0:n,a=e.scale,o=a===void 0?[1,1]:a,s=new be().set(1,0,0,0,1,0,t[0],t[1],1),u=_O.set(Math.cos(i),Math.sin(i),0,-Math.sin(i),Math.cos(i),0,0,0,1),f=bO.set(o[0],0,0,0,o[1],0,0,0,1);return s.multiplyRight(u).multiplyRight(f)}var eh={};bt(eh,{decode:()=>PO,encode:()=>IO,name:()=>OO});var Ea=X(re());function CA(e,r){var t=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=MO(e))||r&&e&&typeof e.length=="number"){t&&(e=t);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(f){throw f},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
179
179
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){t=t.call(e)},n:function(){var f=t.next();return a=f.done,f},e:function(f){o=!0,s=f},f:function(){try{!a&&t.return!=null&&t.return()}finally{if(o)throw s}}}}function MO(e,r){if(e){if(typeof e=="string")return wA(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);if(t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set")return Array.from(e);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return wA(e,r)}}function wA(e,r){(r==null||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}var xn="KHR_lights_punctual",OO=xn;function PO(e){return $c.apply(this,arguments)}function $c(){return $c=I(Ea.default.mark(function e(r){var t,n,i,a,o,s,u;return Ea.default.wrap(function(l){for(;;)switch(l.prev=l.next){case 0:t=new Pe(r),n=t.json,i=t.getExtension(xn),i&&(t.json.lights=i.lights,t.removeExtension(xn)),a=CA(n.nodes||[]);try{for(a.s();!(o=a.n()).done;)s=o.value,u=t.getObjectExtension(s,xn),u&&(s.light=u.light),t.removeObjectExtension(s,xn)}catch(h){a.e(h)}finally{a.f()}case 6:case"end":return l.stop()}},e)})),$c.apply(this,arguments)}function IO(e){return Qc.apply(this,arguments)}function Qc(){return Qc=I(Ea.default.mark(function e(r){var t,n,i,a,o,s,u;return Ea.default.wrap(function(l){for(;;)switch(l.prev=l.next){case 0:if(t=new Pe(r),n=t.json,n.lights&&(i=t.addExtension(xn),Ve(!i.lights),i.lights=n.lights,delete n.lights),t.json.lights){a=CA(t.json.lights);try{for(a.s();!(o=a.n()).done;)s=o.value,u=s.node,t.addObjectExtension(u,xn,s)}catch(h){a.e(h)}finally{a.f()}delete t.json.lights}case 4:case"end":return l.stop()}},e)})),Qc.apply(this,arguments)}var nh={};bt(nh,{decode:()=>LO,encode:()=>kO,name:()=>FO});var th=X(re());function MA(e,r){var t=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=RO(e))||r&&e&&typeof e.length=="number"){t&&(e=t);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(f){throw f},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
180
180
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){t=t.call(e)},n:function(){var f=t.next();return a=f.done,f},e:function(f){o=!0,s=f},f:function(){try{!a&&t.return!=null&&t.return()}finally{if(o)throw s}}}}function RO(e,r){if(e){if(typeof e=="string")return BA(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);if(t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set")return Array.from(e);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return BA(e,r)}}function BA(e,r){(r==null||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}var Sa="KHR_materials_unlit",FO=Sa;function LO(e){return rh.apply(this,arguments)}function rh(){return rh=I(th.default.mark(function e(r){var t,n,i,a,o,s;return th.default.wrap(function(f){for(;;)switch(f.prev=f.next){case 0:t=new Pe(r),n=t.json,i=MA(n.materials||[]);try{for(i.s();!(a=i.n()).done;)o=a.value,s=o.extensions&&o.extensions.KHR_materials_unlit,s&&(o.unlit=!0),t.removeObjectExtension(o,Sa)}catch(l){i.e(l)}finally{i.f()}t.removeExtension(Sa);case 5:case"end":return f.stop()}},e)})),rh.apply(this,arguments)}function kO(e){var r=new Pe(e),t=r.json;if(r.materials){var n=MA(t.materials||[]),i;try{for(n.s();!(i=n.n()).done;){var a=i.value;a.unlit&&(delete a.unlit,r.addObjectExtension(a,Sa,{}),r.addExtension(Sa))}}catch(o){n.e(o)}finally{n.f()}}}var oh={};bt(oh,{decode:()=>UO,encode:()=>jO,name:()=>NO});Le();var Ca=X(re());function DO(e,r){var t=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=GO(e))||r&&e&&typeof e.length=="number"){t&&(e=t);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(f){throw f},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
181
181
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){t=t.call(e)},n:function(){var f=t.next();return a=f.done,f},e:function(f){o=!0,s=f},f:function(){try{!a&&t.return!=null&&t.return()}finally{if(o)throw s}}}}function GO(e,r){if(e){if(typeof e=="string")return OA(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);if(t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set")return Array.from(e);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return OA(e,r)}}function OA(e,r){(r==null||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}var wa="KHR_techniques_webgl",NO=wa;function UO(e){return ih.apply(this,arguments)}function ih(){return ih=I(Ca.default.mark(function e(r){var t,n,i,a,o,s,u,f;return Ca.default.wrap(function(h){for(;;)switch(h.prev=h.next){case 0:if(t=new Pe(r),n=t.json,i=t.getExtension(wa),i){a=HO(i,t),o=DO(n.materials||[]);try{for(o.s();!(s=o.n()).done;)u=s.value,f=t.getObjectExtension(u,wa),f&&(u.technique=Object.assign({},f,a[f.technique]),u.technique.values=VO(u.technique,t)),t.removeObjectExtension(u,wa)}catch(d){o.e(d)}finally{o.f()}t.removeExtension(wa)}case 4:case"end":return h.stop()}},e)})),ih.apply(this,arguments)}function jO(e,r){return ah.apply(this,arguments)}function ah(){return ah=I(Ca.default.mark(function e(r,t){return Ca.default.wrap(function(i){for(;;)switch(i.prev=i.next){case 0:case"end":return i.stop()}},e)})),ah.apply(this,arguments)}function HO(e,r){var t=e.programs,n=t===void 0?[]:t,i=e.shaders,a=i===void 0?[]:i,o=e.techniques,s=o===void 0?[]:o,u=new TextDecoder;return a.forEach(function(f){if(Number.isFinite(f.bufferView))f.code=u.decode(r.getTypedArrayForBufferView(f.bufferView));else throw new Error("KHR_techniques_webgl: no shader code")}),n.forEach(function(f){f.fragmentShader=a[f.fragmentShader],f.vertexShader=a[f.vertexShader]}),s.forEach(function(f){f.program=n[f.program]}),s}function VO(e,r){var t=Object.assign({},e.values);return Object.keys(e.uniforms||{}).forEach(function(n){e.uniforms[n].value&&!(n in t)&&(t[n]=e.uniforms[n].value)}),Object.keys(t).forEach(function(n){te(t[n])==="object"&&t[n].index!==void 0&&(t[n].texture=r.getTexture(t[n].index))}),t}var fh={};bt(fh,{decode:()=>WO,name:()=>zO});var sh=X(re());var PA="EXT_feature_metadata",zO=PA;function WO(e){return uh.apply(this,arguments)}function uh(){return uh=I(sh.default.mark(function e(r){var t;return sh.default.wrap(function(i){for(;;)switch(i.prev=i.next){case 0:t=new Pe(r),JO(t);case 2:case"end":return i.stop()}},e)})),uh.apply(this,arguments)}function JO(e){var r,t=e.getExtension(PA),n=t==null||(r=t.schema)===null||r===void 0?void 0:r.classes,i=t?.featureTables,a=t?.featureTextures;if(a&&console.warn('featureTextures is not yet supported in the "EXT_feature_metadata" extension.'),n&&i)for(var o in n){var s=n[o],u=KO(i,o);u&&XO(e,u,s)}}function XO(e,r,t){for(var n in t.properties){var i,a=t.properties[n],o=r==null||(i=r.properties)===null||i===void 0?void 0:i[n],s=r.count;if(o){var u=qO(e,a,s,o);o.data=u}}}function qO(e,r,t,n){var i=n.bufferView,a=e.getTypedArrayForBufferView(i);switch(r.type){case"STRING":{var o=n.stringOffsetBufferView,s=e.getTypedArrayForBufferView(o);a=YO(a,s,t);break}default:}return a}function KO(e,r){for(var t in e){var n=e[t];if(n.class===r)return n}return null}function YO(e,r,t){for(var n=[],i=new TextDecoder("utf8"),a=0,o=4,s=0;s<t;s++){var u=r[(s+1)*o]-r[s*o],f=e.subarray(a,u+a),l=i.decode(f);n.push(l),a+=u}return n}function RA(e,r){var t=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=ZO(e))||r&&e&&typeof e.length=="number"){t&&(e=t);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(f){throw f},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
182
182
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){t=t.call(e)},n:function(){var f=t.next();return a=f.done,f},e:function(f){o=!0,s=f},f:function(){try{!a&&t.return!=null&&t.return()}finally{if(o)throw s}}}}function ZO(e,r){if(e){if(typeof e=="string")return IA(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);if(t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set")return Array.from(e);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return IA(e,r)}}function IA(e,r){(r==null||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}var FA=[Uc,jc,Hc,Xc,eh,nh,oh,Zc,fh];function LA(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=arguments.length>2?arguments[2]:void 0,n=FA.filter(function(u){return DA(u.name,r)}),i=RA(n),a;try{for(i.s();!(a=i.n()).done;){var o=a.value,s;(s=o.preprocess)===null||s===void 0||s.call(o,e,r,t)}}catch(u){i.e(u)}finally{i.f()}}function kA(e){return ch.apply(this,arguments)}function ch(){return ch=I(lh.default.mark(function e(r){var t,n,i,a,o,s,u,f=arguments;return lh.default.wrap(function(h){for(;;)switch(h.prev=h.next){case 0:t=f.length>1&&f[1]!==void 0?f[1]:{},n=f.length>2?f[2]:void 0,i=FA.filter(function(d){return DA(d.name,t)}),a=RA(i),h.prev=4,a.s();case 6:if((o=a.n()).done){h.next=12;break}return s=o.value,h.next=10,(u=s.decode)===null||u===void 0?void 0:u.call(s,r,t,n);case 10:h.next=6;break;case 12:h.next=17;break;case 14:h.prev=14,h.t0=h.catch(4),a.e(h.t0);case 17:return h.prev=17,a.f(),h.finish(17);case 20:case"end":return h.stop()}},e,null,[[4,14,17,20]])})),ch.apply(this,arguments)}function DA(e,r){var t,n=(r==null||(t=r.gltf)===null||t===void 0?void 0:t.excludeExtensions)||{},i=e in n&&!n[e];return!i}q();Y();N();function $O(e,r){var t=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=QO(e))||r&&e&&typeof e.length=="number"){t&&(e=t);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(f){throw f},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
183
183
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){t=t.call(e)},n:function(){var f=t.next();return a=f.done,f},e:function(f){o=!0,s=f},f:function(){try{!a&&t.return!=null&&t.return()}finally{if(o)throw s}}}}function QO(e,r){if(e){if(typeof e=="string")return GA(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);if(t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set")return Array.from(e);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return GA(e,r)}}function GA(e,r){(r==null||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}var hh="KHR_binary_glTF";function NA(e){var r=new Pe(e),t=r.json,n=$O(t.images||[]),i;try{for(n.s();!(i=n.n()).done;){var a=i.value,o=r.getObjectExtension(a,hh);o&&Object.assign(a,o),r.removeObjectExtension(a,hh)}}catch(s){n.e(s)}finally{n.f()}t.buffers&&t.buffers[0]&&delete t.buffers[0].uri,r.removeExtension(hh)}function Dr(e,r){var t=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=t3(e))||r&&e&&typeof e.length=="number"){t&&(e=t);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(f){throw f},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
184
184
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){t=t.call(e)},n:function(){var f=t.next();return a=f.done,f},e:function(f){o=!0,s=f},f:function(){try{!a&&t.return!=null&&t.return()}finally{if(o)throw s}}}}function t3(e,r){if(e){if(typeof e=="string")return UA(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);if(t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set")return Array.from(e);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return UA(e,r)}}function UA(e,r){(r==null||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}var jA={accessors:"accessor",animations:"animation",buffers:"buffer",bufferViews:"bufferView",images:"image",materials:"material",meshes:"mesh",nodes:"node",samplers:"sampler",scenes:"scene",skins:"skin",textures:"texture"},r3={accessor:"accessors",animations:"animation",buffer:"buffers",bufferView:"bufferViews",image:"images",material:"materials",mesh:"meshes",node:"nodes",sampler:"samplers",scene:"scenes",skin:"skins",texture:"textures"},n3=function(){function e(){T(this,e),c(this,"idToIndexMap",{animations:{},accessors:{},buffers:{},bufferViews:{},images:{},materials:{},meshes:{},nodes:{},samplers:{},scenes:{},skins:{},textures:{}}),c(this,"json",void 0)}return w(e,[{key:"normalize",value:function(t,n){this.json=t.json;var i=t.json;switch(i.asset&&i.asset.version){case"2.0":return;case void 0:case"1.0":break;default:console.warn("glTF: Unknown version ".concat(i.asset.version));return}if(!n.normalize)throw new Error("glTF v1 is not supported.");console.warn("Converting glTF v1 to glTF v2 format. This is experimental and may fail."),this._addAsset(i),this._convertTopLevelObjectsToArrays(i),NA(t),this._convertObjectIdsToArrayIndices(i),this._updateObjects(i),this._updateMaterial(i)}},{key:"_addAsset",value:function(t){t.asset=t.asset||{},t.asset.version="2.0",t.asset.generator=t.asset.generator||"Normalized to glTF 2.0 by loaders.gl"}},{key:"_convertTopLevelObjectsToArrays",value:function(t){for(var n in jA)this._convertTopLevelObjectToArray(t,n)}},{key:"_convertTopLevelObjectToArray",value:function(t,n){var i=t[n];if(!(!i||Array.isArray(i))){t[n]=[];for(var a in i){var o=i[a];o.id=o.id||a;var s=t[n].length;t[n].push(o),this.idToIndexMap[n][a]=s}}}},{key:"_convertObjectIdsToArrayIndices",value:function(t){for(var n in jA)this._convertIdsToIndices(t,n);"scene"in t&&(t.scene=this._convertIdToIndex(t.scene,"scene"));var i=Dr(t.textures),a;try{for(i.s();!(a=i.n()).done;){var o=a.value;this._convertTextureIds(o)}}catch(g){i.e(g)}finally{i.f()}var s=Dr(t.meshes),u;try{for(s.s();!(u=s.n()).done;){var f=u.value;this._convertMeshIds(f)}}catch(g){s.e(g)}finally{s.f()}var l=Dr(t.nodes),h;try{for(l.s();!(h=l.n()).done;){var d=h.value;this._convertNodeIds(d)}}catch(g){l.e(g)}finally{l.f()}var p=Dr(t.scenes),m;try{for(p.s();!(m=p.n()).done;){var v=m.value;this._convertSceneIds(v)}}catch(g){p.e(g)}finally{p.f()}}},{key:"_convertTextureIds",value:function(t){t.source&&(t.source=this._convertIdToIndex(t.source,"image"))}},{key:"_convertMeshIds",value:function(t){var n=Dr(t.primitives),i;try{for(n.s();!(i=n.n()).done;){var a=i.value,o=a.attributes,s=a.indices,u=a.material;for(var f in o)o[f]=this._convertIdToIndex(o[f],"accessor");s&&(a.indices=this._convertIdToIndex(s,"accessor")),u&&(a.material=this._convertIdToIndex(u,"material"))}}catch(l){n.e(l)}finally{n.f()}}},{key:"_convertNodeIds",value:function(t){var n=this;t.children&&(t.children=t.children.map(function(i){return n._convertIdToIndex(i,"node")})),t.meshes&&(t.meshes=t.meshes.map(function(i){return n._convertIdToIndex(i,"mesh")}))}},{key:"_convertSceneIds",value:function(t){var n=this;t.nodes&&(t.nodes=t.nodes.map(function(i){return n._convertIdToIndex(i,"node")}))}},{key:"_convertIdsToIndices",value:function(t,n){t[n]||(console.warn("gltf v1: json doesn't contain attribute ".concat(n)),t[n]=[]);var i=Dr(t[n]),a;try{for(i.s();!(a=i.n()).done;){var o=a.value;for(var s in o){var u=o[s],f=this._convertIdToIndex(u,s);o[s]=f}}}catch(l){i.e(l)}finally{i.f()}}},{key:"_convertIdToIndex",value:function(t,n){var i=r3[n];if(i in this.idToIndexMap){var a=this.idToIndexMap[i][t];if(!Number.isFinite(a))throw new Error("gltf v1: failed to resolve ".concat(n," with id ").concat(t));return a}return t}},{key:"_updateObjects",value:function(t){var n=Dr(this.json.buffers),i;try{for(n.s();!(i=n.n()).done;){var a=i.value;delete a.type}}catch(o){n.e(o)}finally{n.f()}}},{key:"_updateMaterial",value:function(t){var n=Dr(t.materials),i;try{var a=function(){var l=i.value;l.pbrMetallicRoughness={baseColorFactor:[1,1,1,1],metallicFactor:1,roughnessFactor:1};var h=((o=l.values)===null||o===void 0?void 0:o.tex)||((s=l.values)===null||s===void 0?void 0:s.texture2d_0)||((u=l.values)===null||u===void 0?void 0:u.diffuseTex),d=t.textures.findIndex(function(p){return p.id===h});d!==-1&&(l.pbrMetallicRoughness.baseColorTexture={index:d})};for(n.s();!(i=n.n()).done;){var o,s,u;a()}}catch(f){n.e(f)}finally{n.f()}}}]),e}();function HA(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return new n3().normalize(e,r)}Le();q();Y();N();N();var mi;function VA(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),t.push.apply(t,n)}return t}function fr(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{};r%2?VA(Object(t),!0).forEach(function(n){c(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):VA(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}var i3={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},a3={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},yt={TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,REPEAT:10497,LINEAR:9729,NEAREST_MIPMAP_LINEAR:9986},o3={magFilter:yt.TEXTURE_MAG_FILTER,minFilter:yt.TEXTURE_MIN_FILTER,wrapS:yt.TEXTURE_WRAP_S,wrapT:yt.TEXTURE_WRAP_T},s3=(mi={},c(mi,yt.TEXTURE_MAG_FILTER,yt.LINEAR),c(mi,yt.TEXTURE_MIN_FILTER,yt.NEAREST_MIPMAP_LINEAR),c(mi,yt.TEXTURE_WRAP_S,yt.REPEAT),c(mi,yt.TEXTURE_WRAP_T,yt.REPEAT),mi);function u3(e){return a3[e]}function f3(e){return i3[e]}var l3=function(){function e(){T(this,e),c(this,"baseUri",""),c(this,"json",{}),c(this,"buffers",[]),c(this,"images",[])}return w(e,[{key:"postProcess",value:function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=t.json,a=t.buffers,o=a===void 0?[]:a,s=t.images,u=s===void 0?[]:s,f=t.baseUri,l=f===void 0?"":f;return Ve(i),this.baseUri=l,this.json=i,this.buffers=o,this.images=u,this._resolveTree(this.json,n),this.json}},{key:"_resolveTree",value:function(t){var n=this,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};t.bufferViews&&(t.bufferViews=t.bufferViews.map(function(a,o){return n._resolveBufferView(a,o)})),t.images&&(t.images=t.images.map(function(a,o){return n._resolveImage(a,o)})),t.samplers&&(t.samplers=t.samplers.map(function(a,o){return n._resolveSampler(a,o)})),t.textures&&(t.textures=t.textures.map(function(a,o){return n._resolveTexture(a,o)})),t.accessors&&(t.accessors=t.accessors.map(function(a,o){return n._resolveAccessor(a,o)})),t.materials&&(t.materials=t.materials.map(function(a,o){return n._resolveMaterial(a,o)})),t.meshes&&(t.meshes=t.meshes.map(function(a,o){return n._resolveMesh(a,o)})),t.nodes&&(t.nodes=t.nodes.map(function(a,o){return n._resolveNode(a,o)})),t.skins&&(t.skins=t.skins.map(function(a,o){return n._resolveSkin(a,o)})),t.scenes&&(t.scenes=t.scenes.map(function(a,o){return n._resolveScene(a,o)})),t.scene!==void 0&&(t.scene=t.scenes[this.json.scene])}},{key:"getScene",value:function(t){return this._get("scenes",t)}},{key:"getNode",value:function(t){return this._get("nodes",t)}},{key:"getSkin",value:function(t){return this._get("skins",t)}},{key:"getMesh",value:function(t){return this._get("meshes",t)}},{key:"getMaterial",value:function(t){return this._get("materials",t)}},{key:"getAccessor",value:function(t){return this._get("accessors",t)}},{key:"getCamera",value:function(t){return null}},{key:"getTexture",value:function(t){return this._get("textures",t)}},{key:"getSampler",value:function(t){return this._get("samplers",t)}},{key:"getImage",value:function(t){return this._get("images",t)}},{key:"getBufferView",value:function(t){return this._get("bufferViews",t)}},{key:"getBuffer",value:function(t){return this._get("buffers",t)}},{key:"_get",value:function(t,n){if(te(n)==="object")return n;var i=this.json[t]&&this.json[t][n];return i||console.warn("glTF file error: Could not find ".concat(t,"[").concat(n,"]")),i}},{key:"_resolveScene",value:function(t,n){var i=this;return t.id=t.id||"scene-".concat(n),t.nodes=(t.nodes||[]).map(function(a){return i.getNode(a)}),t}},{key:"_resolveNode",value:function(t,n){var i=this;return t.id=t.id||"node-".concat(n),t.children&&(t.children=t.children.map(function(a){return i.getNode(a)})),t.mesh!==void 0?t.mesh=this.getMesh(t.mesh):t.meshes!==void 0&&t.meshes.length&&(t.mesh=t.meshes.reduce(function(a,o){var s=i.getMesh(o);return a.id=s.id,a.primitives=a.primitives.concat(s.primitives),a},{primitives:[]})),t.camera!==void 0&&(t.camera=this.getCamera(t.camera)),t.skin!==void 0&&(t.skin=this.getSkin(t.skin)),t}},{key:"_resolveSkin",value:function(t,n){return t.id=t.id||"skin-".concat(n),t.inverseBindMatrices=this.getAccessor(t.inverseBindMatrices),t}},{key:"_resolveMesh",value:function(t,n){var i=this;return t.id=t.id||"mesh-".concat(n),t.primitives&&(t.primitives=t.primitives.map(function(a){a=fr({},a);var o=a.attributes;a.attributes={};for(var s in o)a.attributes[s]=i.getAccessor(o[s]);return a.indices!==void 0&&(a.indices=i.getAccessor(a.indices)),a.material!==void 0&&(a.material=i.getMaterial(a.material)),a})),t}},{key:"_resolveMaterial",value:function(t,n){if(t.id=t.id||"material-".concat(n),t.normalTexture&&(t.normalTexture=fr({},t.normalTexture),t.normalTexture.texture=this.getTexture(t.normalTexture.index)),t.occlusionTexture&&(t.occlustionTexture=fr({},t.occlustionTexture),t.occlusionTexture.texture=this.getTexture(t.occlusionTexture.index)),t.emissiveTexture&&(t.emmisiveTexture=fr({},t.emmisiveTexture),t.emissiveTexture.texture=this.getTexture(t.emissiveTexture.index)),t.emissiveFactor||(t.emissiveFactor=t.emmisiveTexture?[1,1,1]:[0,0,0]),t.pbrMetallicRoughness){t.pbrMetallicRoughness=fr({},t.pbrMetallicRoughness);var i=t.pbrMetallicRoughness;i.baseColorTexture&&(i.baseColorTexture=fr({},i.baseColorTexture),i.baseColorTexture.texture=this.getTexture(i.baseColorTexture.index)),i.metallicRoughnessTexture&&(i.metallicRoughnessTexture=fr({},i.metallicRoughnessTexture),i.metallicRoughnessTexture.texture=this.getTexture(i.metallicRoughnessTexture.index))}return t}},{key:"_resolveAccessor",value:function(t,n){if(t.id=t.id||"accessor-".concat(n),t.bufferView!==void 0&&(t.bufferView=this.getBufferView(t.bufferView)),t.bytesPerComponent=u3(t.componentType),t.components=f3(t.type),t.bytesPerElement=t.bytesPerComponent*t.components,t.bufferView){var i=t.bufferView.buffer,a=di(t,t.bufferView),o=a.ArrayType,s=a.byteLength,u=(t.bufferView.byteOffset||0)+(t.byteOffset||0)+i.byteOffset,f=i.arrayBuffer.slice(u,u+s);t.bufferView.byteStride&&(f=this._getValueFromInterleavedBuffer(i,u,t.bufferView.byteStride,t.bytesPerElement,t.count)),t.value=new o(f)}return t}},{key:"_getValueFromInterleavedBuffer",value:function(t,n,i,a,o){for(var s=new Uint8Array(o*a),u=0;u<o;u++){var f=n+u*i;s.set(new Uint8Array(t.arrayBuffer.slice(f,f+a)),u*a)}return s.buffer}},{key:"_resolveTexture",value:function(t,n){return t.id=t.id||"texture-".concat(n),t.sampler="sampler"in t?this.getSampler(t.sampler):s3,t.source=this.getImage(t.source),t}},{key:"_resolveSampler",value:function(t,n){t.id=t.id||"sampler-".concat(n),t.parameters={};for(var i in t){var a=this._enumSamplerParameter(i);a!==void 0&&(t.parameters[a]=t[i])}return t}},{key:"_enumSamplerParameter",value:function(t){return o3[t]}},{key:"_resolveImage",value:function(t,n){t.id=t.id||"image-".concat(n),t.bufferView!==void 0&&(t.bufferView=this.getBufferView(t.bufferView));var i=this.images[n];return i&&(t.image=i),t}},{key:"_resolveBufferView",value:function(t,n){var i=t.buffer,a=fr(fr({id:"bufferView-".concat(n)},t),{},{buffer:this.buffers[i]}),o=this.buffers[i].arrayBuffer,s=this.buffers[i].byteOffset||0;return"byteOffset"in t&&(s+=t.byteOffset),a.data=new Uint8Array(o,s,t.byteLength),a}},{key:"_resolveCamera",value:function(t,n){return t.id=t.id||"camera-".concat(n),t.perspective,t.orthographic,t}}]),e}();function zA(e,r){return new l3().postProcess(e,r)}var WA=1735152710,mh=12,Gs=8,c3=1313821514,h3=5130562,d3=0,p3=1,m3=0,vi=!0;function v3(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return"".concat(String.fromCharCode(e.getUint8(r+0))).concat(String.fromCharCode(e.getUint8(r+1))).concat(String.fromCharCode(e.getUint8(r+2))).concat(String.fromCharCode(e.getUint8(r+3)))}function JA(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},n=new DataView(e),i=t.magic,a=i===void 0?WA:i,o=n.getUint32(r,!1);return o===a||o===WA}function vh(e,r){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},i=new DataView(r),a=v3(i,t+0),o=i.getUint32(t+4,vi),s=i.getUint32(t+8,vi);switch(Object.assign(e,{header:{byteOffset:t,byteLength:s,hasBinChunk:!1},type:a,version:o,json:{},binChunks:[]}),t+=mh,e.version){case 1:return g3(e,i,t);case 2:return y3(e,i,t,n={});default:throw new Error("Invalid GLB version ".concat(e.version,". Only supports v1 and v2."))}}function g3(e,r,t){ce(e.header.byteLength>mh+Gs);var n=r.getUint32(t+0,vi),i=r.getUint32(t+4,vi);return t+=Gs,ce(i===m3),dh(e,r,t,n),t+=n,t+=ph(e,r,t,e.header.byteLength),t}function y3(e,r,t,n){return ce(e.header.byteLength>mh+Gs),A3(e,r,t,n),t+e.header.byteLength}function A3(e,r,t,n){for(;t+8<=e.header.byteLength;){var i=r.getUint32(t+0,vi),a=r.getUint32(t+4,vi);switch(t+=Gs,a){case c3:dh(e,r,t,i);break;case h3:ph(e,r,t,i);break;case d3:n.strict||dh(e,r,t,i);break;case p3:n.strict||ph(e,r,t,i);break;default:break}t+=vr(i,4)}return t}function dh(e,r,t,n){var i=new Uint8Array(r.buffer,t,n),a=new TextDecoder("utf8"),o=a.decode(i);return e.json=JSON.parse(o),vr(n,4)}function ph(e,r,t,n){return e.header.hasBinChunk=!0,e.binChunks.push({byteOffset:t,byteLength:n,arrayBuffer:r.buffer}),vr(n,4)}function qA(e,r){var t=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=_3(e))||r&&e&&typeof e.length=="number"){t&&(e=t);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(f){throw f},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
185
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){t=t.call(e)},n:function(){var f=t.next();return a=f.done,f},e:function(f){o=!0,s=f},f:function(){try{!a&&t.return!=null&&t.return()}finally{if(o)throw s}}}}function _3(e,r){if(e){if(typeof e=="string")return XA(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);if(t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set")return Array.from(e);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return XA(e,r)}}function XA(e,r){(r==null||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function KA(e,r){return gh.apply(this,arguments)}function gh(){return gh=I(lr.default.mark(function e(r,t){var n,i,a,o,s,u,f,l,h,d,p=arguments;return lr.default.wrap(function(v){for(;;)switch(v.prev=v.next){case 0:if(s=p.length>2&&p[2]!==void 0?p[2]:0,u=p.length>3?p[3]:void 0,f=p.length>4?p[4]:void 0,b3(r,t,s,u),HA(r,{normalize:u==null||(n=u.gltf)===null||n===void 0?void 0:n.normalize}),LA(r,u,f),l=[],!(u!=null&&(i=u.gltf)!==null&&i!==void 0&&i.loadBuffers&&r.json.buffers)){v.next=10;break}return v.next=10,T3(r,u,f);case 10:return u!=null&&(a=u.gltf)!==null&&a!==void 0&&a.loadImages&&(h=x3(r,u,f),l.push(h)),d=kA(r,u,f),l.push(d),v.next=15,Promise.all(l);case 15:return v.abrupt("return",u!=null&&(o=u.gltf)!==null&&o!==void 0&&o.postProcess?zA(r,u):r);case 16:case"end":return v.stop()}},e)})),gh.apply(this,arguments)}function b3(e,r,t,n){if(n.uri&&(e.baseUri=n.uri),r instanceof ArrayBuffer&&!JA(r,t,n)){var i=new TextDecoder;r=i.decode(r)}if(typeof r=="string")e.json=Gu(r);else if(r instanceof ArrayBuffer){var a={};t=vh(a,r,t,n.glb),Ve(a.type==="glTF","Invalid GLB magic string ".concat(a.type)),e._glb=a,e.json=a.json}else Ve(!1,"GLTF: must be ArrayBuffer or string");var o=e.json.buffers||[];if(e.buffers=new Array(o.length).fill(null),e._glb&&e._glb.header.hasBinChunk){var s=e._glb.binChunks;e.buffers[0]={arrayBuffer:s[0].arrayBuffer,byteOffset:s[0].byteOffset,byteLength:s[0].byteLength}}var u=e.json.images||[];e.images=new Array(u.length).fill({})}function T3(e,r,t){return yh.apply(this,arguments)}function yh(){return yh=I(lr.default.mark(function e(r,t,n){var i,a,o,s,u,f,l,h,d;return lr.default.wrap(function(m){for(;;)switch(m.prev=m.next){case 0:i=r.json.buffers||[],a=0;case 2:if(!(a<i.length)){m.next=22;break}if(o=i[a],!o.uri){m.next=18;break}return f=n.fetch,Ve(f),l=Ic(o.uri,t),m.next=10,n==null||(s=n.fetch)===null||s===void 0?void 0:s.call(n,l);case 10:return h=m.sent,m.next=13,h==null||(u=h.arrayBuffer)===null||u===void 0?void 0:u.call(h);case 13:d=m.sent,r.buffers[a]={arrayBuffer:d,byteOffset:0,byteLength:d.byteLength},delete o.uri,m.next=19;break;case 18:r.buffers[a]===null&&(r.buffers[a]={arrayBuffer:new ArrayBuffer(o.byteLength),byteOffset:0,byteLength:o.byteLength});case 19:++a,m.next=2;break;case 22:case"end":return m.stop()}},e)})),yh.apply(this,arguments)}function x3(e,r,t){return Ah.apply(this,arguments)}function Ah(){return Ah=I(lr.default.mark(function e(r,t,n){var i,a,o,s,u,f;return lr.default.wrap(function(h){for(;;)switch(h.prev=h.next){case 0:i=E3(r),a=r.json.images||[],o=[],s=qA(i);try{for(s.s();!(u=s.n()).done;)f=u.value,o.push(S3(r,a[f],f,t,n))}catch(d){s.e(d)}finally{s.f()}return h.next=7,Promise.all(o);case 7:return h.abrupt("return",h.sent);case 8:case"end":return h.stop()}},e)})),Ah.apply(this,arguments)}function E3(e){var r=new Set,t=e.json.textures||[],n=qA(t),i;try{for(n.s();!(i=n.n()).done;){var a=i.value;a.source!==void 0&&r.add(a.source)}}catch(o){n.e(o)}finally{n.f()}return Array.from(r).sort()}function S3(e,r,t,n,i){return _h.apply(this,arguments)}function _h(){return _h=I(lr.default.mark(function e(r,t,n,i,a){var o,s,u,f,l,h,d;return lr.default.wrap(function(m){for(;;)switch(m.prev=m.next){case 0:if(o=a.fetch,s=a.parse,!(t.uri&&!t.hasOwnProperty("bufferView"))){m.next=10;break}return f=Ic(t.uri,i),m.next=5,o(f);case 5:return l=m.sent,m.next=8,l.arrayBuffer();case 8:u=m.sent,t.bufferView={data:u};case 10:return Number.isFinite(t.bufferView)&&(h=lA(r.json,r.buffers,t.bufferView),u=Wr(h.buffer,h.byteOffset,h.byteLength)),Ve(u,"glTF image has no data"),m.next=14,s(u,[Yt,Pc],{mimeType:t.mimeType,basis:i.basis||{format:Rs()}},a);case 14:d=m.sent,d&&d[0]&&(d={compressed:!0,mipmaps:!1,width:d[0].width,height:d[0].height,data:d[0]}),r.images=r.images||[],r.images[n]=d;case 18:case"end":return m.stop()}},e)})),_h.apply(this,arguments)}function YA(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),t.push.apply(t,n)}return t}function Ns(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{};r%2?YA(Object(t),!0).forEach(function(n){c(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):YA(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}var En={name:"glTF",id:"gltf",module:"gltf",version:z1,extensions:["gltf","glb"],mimeTypes:["model/gltf+json","model/gltf-binary"],text:!0,binary:!0,tests:["glTF"],parse:w3,options:{gltf:{normalize:!0,loadBuffers:!0,loadImages:!0,decompressMeshes:!0,postProcess:!0},log:console},deprecatedOptions:{fetchImages:"gltf.loadImages",createImages:"gltf.loadImages",decompress:"gltf.decompressMeshes",postProcess:"gltf.postProcess",gltf:{decompress:"gltf.decompressMeshes"}}};function w3(e){return Th.apply(this,arguments)}function Th(){return Th=I(bh.default.mark(function e(r){var t,n,i,a,o,s,u=arguments;return bh.default.wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return t=u.length>1&&u[1]!==void 0?u[1]:{},n=u.length>2?u[2]:void 0,t=Ns(Ns({},En.options),t),t.gltf=Ns(Ns({},En.options.gltf),t.gltf),i=t,a=i.byteOffset,o=a===void 0?0:a,s={},l.next=8,KA(s,r,o,t,n);case 8:return l.abrupt("return",l.sent);case 9:case"end":return l.stop()}},e)})),Th.apply(this,arguments)}var Us={URI:0,EMBEDDED:1};function js(e,r,t,n){e.rotateYtoZ=!0;var i=e.byteOffset+e.byteLength-t;if(i===0)throw new Error("glTF byte length must be greater than 0.");return e.gltfUpAxis=n["3d-tiles"]&&n["3d-tiles"].assetGltfUpAxis?n["3d-tiles"].assetGltfUpAxis:"Y",e.gltfArrayBuffer=Wr(r,t,i),e.gltfByteOffset=0,e.gltfByteLength=i,t%4===0||console.warn("".concat(e.type,": embedded glb is not aligned to a 4-byte boundary.")),e.byteOffset+e.byteLength}function Hs(e,r,t,n){return Eh.apply(this,arguments)}function Eh(){return Eh=I(xh.default.mark(function e(r,t,n,i){var a,o,s;return xh.default.wrap(function(f){for(;;)switch(f.prev=f.next){case 0:if(a=n["3d-tiles"]||{},C3(r,t,n),!a.loadGLTF){f.next=17;break}if(o=i.parse,s=i.fetch,!r.gltfUrl){f.next=9;break}return f.next=7,s(r.gltfUrl,n);case 7:r.gltfArrayBuffer=f.sent,r.gltfByteOffset=0;case 9:if(!r.gltfArrayBuffer){f.next=17;break}return f.next=12,o(r.gltfArrayBuffer,En,n,i);case 12:r.gltf=f.sent,r.gpuMemoryUsageInBytes=_a(r.gltf),delete r.gltfArrayBuffer,delete r.gltfByteOffset,delete r.gltfByteLength;case 17:case"end":return f.stop()}},e)})),Eh.apply(this,arguments)}function C3(e,r,t){switch(r){case Us.URI:var n=new Uint8Array(e.gltfArrayBuffer,e.gltfByteOffset),i=new TextDecoder,a=i.decode(n);e.gltfUrl=a.replace(/[\s\0]+$/,""),delete e.gltfArrayBuffer,delete e.gltfByteOffset,delete e.gltfByteLength;break;case Us.EMBEDDED:break;default:throw new Error("b3dm: Illegal glTF format field")}}function ZA(e,r,t,n,i){return wh.apply(this,arguments)}function wh(){return wh=I(Sh.default.mark(function e(r,t,n,i,a){var o,s;return Sh.default.wrap(function(f){for(;;)switch(f.prev=f.next){case 0:return n=B3(r,t,n,i,a),f.next=3,Hs(r,Us.EMBEDDED,i,a);case 3:return s=r==null||(o=r.gltf)===null||o===void 0?void 0:o.extensions,s&&s.CESIUM_RTC&&(r.rtcCenter=s.CESIUM_RTC.center),f.abrupt("return",n);case 6:case"end":return f.stop()}},e)})),wh.apply(this,arguments)}function B3(e,r,t,n,i){t=kr(e,r,t),t=ci(e,r,t),t=hi(e,r,t,n),t=js(e,r,t,n);var a=new ui(e.featureTableJson,e.featureTableBinary);return e.rtcCenter=a.getGlobalProperty("RTC_CENTER",5126,3),t}var Ch=X(re());function $A(e,r,t,n,i){return Bh.apply(this,arguments)}function Bh(){return Bh=I(Ch.default.mark(function e(r,t,n,i,a){return Ch.default.wrap(function(s){for(;;)switch(s.prev=s.next){case 0:return n=M3(r,t,n,i,a),s.next=3,Hs(r,r.gltfFormat,i,a);case 3:return s.abrupt("return",n);case 4:case"end":return s.stop()}},e)})),Bh.apply(this,arguments)}function M3(e,r,t,n,i){if(t=kr(e,r,t),e.version!==1)throw new Error("Instanced 3D Model version ".concat(e.version," is not supported"));t=ci(e,r,t);var a=new DataView(r);if(e.gltfFormat=a.getUint32(t,!0),t+=4,t=hi(e,r,t,n),t=js(e,r,t,n),e.featureTableJsonByteLength===0)throw new Error("i3dm parser: featureTableJsonByteLength is zero.");var o=new ui(e.featureTableJson,e.featureTableBinary),s=o.getGlobalProperty("INSTANCES_LENGTH");if(o.featuresLength=s,!Number.isFinite(s))throw new Error("i3dm parser: INSTANCES_LENGTH must be defined");e.eastNorthUp=o.getGlobalProperty("EAST_NORTH_UP"),e.rtcCenter=o.getGlobalProperty("RTC_CENTER",5126,3);var u=new Ps(e.batchTableJson,e.batchTableBinary,s);return O3(e,o,u,s),t}function O3(e,r,t,n){for(var i={instances:new Array(n),batchTable:e._batchTable,cull:!1,url:void 0,gltf:void 0,basePath:void 0,incrementallyLoadTextures:!1,forwardAxis:[1,0,0]},a=i.instances,o=new E,s=new E,u=new E,f=new E,l=new _e,h=new br,d=new E,p={},m=new se,v=[],g=[],y=new E,A=new E,x=0;x<n;x++){var b=void 0;if(r.hasProperty("POSITION"))b=r.getProperty("POSITION",5126,3,x,o);else if(r.hasProperty("POSITION_QUANTIZED")){b=r.getProperty("POSITION_QUANTIZED",5123,3,x,o);var M=r.getGlobalProperty("QUANTIZED_VOLUME_OFFSET",5126,3,y);if(!M)throw new Error("i3dm parser: QUANTIZED_VOLUME_OFFSET must be defined for quantized positions.");var C=r.getGlobalProperty("QUANTIZED_VOLUME_SCALE",5126,3,A);if(!C)throw new Error("i3dm parser: QUANTIZED_VOLUME_SCALE must be defined for quantized positions.");for(var F=65535,B=0;B<3;B++)b[B]=b[B]/F*C[B]+M[B]}if(!b)throw new Error("i3dm: POSITION or POSITION_QUANTIZED must be defined for each instance.");o.copy(b),p.translation=o,e.normalUp=r.getProperty("NORMAL_UP",5126,3,x,v),e.normalRight=r.getProperty("NORMAL_RIGHT",5126,3,x,g);var S=!1;if(e.normalUp){if(!e.normalRight)throw new Error("i3dm: Custom orientation requires both NORMAL_UP and NORMAL_RIGHT.");e.hasCustomOrientation=!0}else{if(e.octNormalUp=r.getProperty("NORMAL_UP_OCT32P",5123,2,v),e.octNormalRight=r.getProperty("NORMAL_RIGHT_OCT32P",5123,2,g),e.octNormalUp)throw e.octNormalRight?new Error("i3dm: oct-encoded orientation not implemented"):new Error("i3dm: oct-encoded orientation requires NORMAL_UP_OCT32P and NORMAL_RIGHT_OCT32P");e.eastNorthUp?(ve.WGS84.eastNorthUpToFixedFrame(o,m),m.getRotationMatrix3(l)):l.identity()}S&&(f.copy(s).cross(u).normalize(),l.setColumn(0,s),l.setColumn(1,u),l.setColumn(2,f)),h.fromMatrix3(l),p.rotation=h,d.set(1,1,1);var _=r.getProperty("SCALE",5126,1,x);Number.isFinite(_)&&d.multiplyByScalar(_);var R=r.getProperty("SCALE_NON_UNIFORM",5126,3,x,v);R&&d.scale(R),p.scale=d;var k=r.getProperty("BATCH_ID",5123,1,x);k===void 0&&(k=x);var U=new se().fromQuaternion(p.rotation);m.identity(),m.translate(p.translation),m.multiplyRight(U),m.scale(p.scale);var j=m.clone();a[x]={modelMatrix:j,batchId:k}}e.instances=a}var Mh=X(re());function QA(e,r,t,n,i,a){return Oh.apply(this,arguments)}function Oh(){return Oh=I(Mh.default.mark(function e(r,t,n,i,a,o){var s,u;return Mh.default.wrap(function(l){for(;;)switch(l.prev=l.next){case 0:n=kr(r,t,n),s=new DataView(t),r.tilesLength=s.getUint32(n,!0),n+=4,r.tiles=[];case 5:if(!(r.tiles.length<r.tilesLength&&r.byteLength-n>12)){l.next=13;break}return u={},r.tiles.push(u),l.next=10,o(t,n,i,a,u);case 10:n=l.sent,l.next=5;break;case 13:return l.abrupt("return",n);case 14:case"end":return l.stop()}},e)})),Oh.apply(this,arguments)}var Ph=X(re());function e_(e,r,t,n){return Ih.apply(this,arguments)}function Ih(){return Ih=I(Ph.default.mark(function e(r,t,n,i){var a;return Ph.default.wrap(function(s){for(;;)switch(s.prev=s.next){case 0:return r.rotateYtoZ=!0,r.gltfUpAxis=n["3d-tiles"]&&n["3d-tiles"].assetGltfUpAxis?n["3d-tiles"].assetGltfUpAxis:"Y",a=i.parse,s.next=5,a(t,En,n,i);case 5:r.gltf=s.sent,r.gpuMemoryUsageInBytes=_a(r.gltf);case 7:case"end":return s.stop()}},e)})),Ih.apply(this,arguments)}function Lh(e){return Fh.apply(this,arguments)}function Fh(){return Fh=I(Rh.default.mark(function e(r){var t,n,i,a,o=arguments;return Rh.default.wrap(function(u){for(;;)switch(u.prev=u.next){case 0:t=o.length>1&&o[1]!==void 0?o[1]:0,n=o.length>2?o[2]:void 0,i=o.length>3?o[3]:void 0,a=o.length>4&&o[4]!==void 0?o[4]:{},a.byteOffset=t,a.type=G0(r,t),u.t0=a.type,u.next=u.t0===mn.COMPOSITE?9:u.t0===mn.BATCHED_3D_MODEL?12:u.t0===mn.GLTF?15:u.t0===mn.INSTANCED_3D_MODEL?18:u.t0===mn.POINT_CLOUD?21:24;break;case 9:return u.next=11,QA(a,r,t,n,i,Lh);case 11:return u.abrupt("return",u.sent);case 12:return u.next=14,ZA(a,r,t,n,i);case 14:return u.abrupt("return",u.sent);case 15:return u.next=17,e_(a,r,n,i);case 17:return u.abrupt("return",u.sent);case 18:return u.next=20,$A(a,r,t,n,i);case 20:return u.abrupt("return",u.sent);case 21:return u.next=23,V1(a,r,t,n,i);case 23:return u.abrupt("return",u.sent);case 24:throw new Error("3DTileLoader: unknown type ".concat(a.type));case 25:case"end":return u.stop()}},e)})),Fh.apply(this,arguments)}var Cn=X(re());var Ba=X(re()),P3=1952609651,I3=1;function Nh(e,r,t){return Dh.apply(this,arguments)}function Dh(){return Dh=I(Ba.default.mark(function e(r,t,n){var i,a,o,s,u,f,l,h,d;return Ba.default.wrap(function(m){for(;;)switch(m.prev=m.next){case 0:if(i=new Uint32Array(r.slice(0,4)),i[0]===P3){m.next=3;break}throw new Error("Wrong subtree file magic number");case 3:if(a=new Uint32Array(r.slice(4,8)),a[0]===I3){m.next=6;break}throw new Error("Wrong subtree file verson, must be 1");case 6:if(o=t_(r.slice(8,16)),s=new Uint8Array(r,24,o),u=new TextDecoder("utf8"),f=u.decode(s),l=JSON.parse(f),h=t_(r.slice(16,24)),d=new ArrayBuffer(0),h&&(d=r.slice(24+o)),!("bufferView"in l.tileAvailability)){m.next=18;break}return m.next=17,kh(l,"tileAvailability",d,n);case 17:l.tileAvailability.explicitBitstream=m.sent;case 18:if(!("bufferView"in l.contentAvailability)){m.next=22;break}return m.next=21,kh(l,"contentAvailability",d,n);case 21:l.contentAvailability.explicitBitstream=m.sent;case 22:if(!("bufferView"in l.childSubtreeAvailability)){m.next=26;break}return m.next=25,kh(l,"childSubtreeAvailability",d,n);case 25:l.childSubtreeAvailability.explicitBitstream=m.sent;case 26:return m.abrupt("return",l);case 27:case"end":return m.stop()}},e)})),Dh.apply(this,arguments)}function R3(e,r){var t=r.startsWith("http");if(t){var n=new URL(e,r);return decodeURI(n.toString())}var i="http://".concat(r),a=new URL(e,i);return"/".concat(a.host).concat(a.pathname)}function kh(e,r,t,n){return Gh.apply(this,arguments)}function Gh(){return Gh=I(Ba.default.mark(function e(r,t,n,i){var a,o,s,u,f,l;return Ba.default.wrap(function(d){for(;;)switch(d.prev=d.next){case 0:if(a=r[t].bufferView,o=r.bufferViews[a],s=r.buffers[o.buffer],!(!(i!=null&&i.url)||!i.fetch)){d.next=5;break}throw new Error("Url is not provided");case 5:if(i.fetch){d.next=7;break}throw new Error("fetch is not provided");case 7:if(!s.uri){d.next=16;break}return u=R3(s.uri,i?.url),d.next=11,i.fetch(u);case 11:return f=d.sent,d.next=14,f.arrayBuffer();case 14:return l=d.sent,d.abrupt("return",new Uint8Array(l,o.byteOffset,o.byteLength));case 16:return d.abrupt("return",new Uint8Array(n,o.byteOffset,o.byteLength));case 17:case"end":return d.stop()}},e)})),Gh.apply(this,arguments)}function t_(e){var r=new DataView(e),t=r.getUint32(0,!0),n=r.getUint32(4,!0);return t+Math.pow(2,32)*n}var Vs={id:"3d-tiles-subtree",name:"3D Tiles Subtree",module:"3d-tiles",version:vs,extensions:["subtree"],mimeTypes:["application/octet-stream"],tests:["subtree"],parse:Nh,options:{}};var S_=X(ni());ue();N();var $h=X(re());var __=X(ni());var At=null;try{At=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch{}function Se(e,r,t){this.low=e|0,this.high=r|0,this.unsigned=!!t}Se.prototype.__isLong__;Object.defineProperty(Se.prototype,"__isLong__",{value:!0});function Ze(e){return(e&&e.__isLong__)===!0}function r_(e){var r=Math.clz32(e&-e);return e?31-r:r}Se.isLong=Ze;var n_={},i_={};function Sn(e,r){var t,n,i;return r?(e>>>=0,(i=0<=e&&e<256)&&(n=i_[e],n)?n:(t=ye(e,0,!0),i&&(i_[e]=t),t)):(e|=0,(i=-128<=e&&e<128)&&(n=n_[e],n)?n:(t=ye(e,e<0?-1:0,!1),i&&(n_[e]=t),t))}Se.fromInt=Sn;function _t(e,r){if(isNaN(e))return r?cr:Mt;if(r){if(e<0)return cr;if(e>=u_)return c_}else{if(e<=-o_)return lt;if(e+1>=o_)return l_}return e<0?_t(-e,r).neg():ye(e%yi|0,e/yi|0,r)}Se.fromNumber=_t;function ye(e,r,t){return new Se(e,r,t)}Se.fromBits=ye;var zs=Math.pow;function jh(e,r,t){if(e.length===0)throw Error("empty string");if(typeof r=="number"?(t=r,r=!1):r=!!r,e==="NaN"||e==="Infinity"||e==="+Infinity"||e==="-Infinity")return r?cr:Mt;if(t=t||10,t<2||36<t)throw RangeError("radix");var n;if((n=e.indexOf("-"))>0)throw Error("interior hyphen");if(n===0)return jh(e.substring(1),r,t).neg();for(var i=_t(zs(t,8)),a=Mt,o=0;o<e.length;o+=8){var s=Math.min(8,e.length-o),u=parseInt(e.substring(o,o+s),t);if(s<8){var f=_t(zs(t,s));a=a.mul(f).add(_t(u))}else a=a.mul(i),a=a.add(_t(u))}return a.unsigned=r,a}Se.fromString=jh;function Ot(e,r){return typeof e=="number"?_t(e,r):typeof e=="string"?jh(e,r):ye(e.low,e.high,typeof r=="boolean"?r:e.unsigned)}Se.fromValue=Ot;var a_=1<<16,F3=1<<24,yi=a_*a_,u_=yi*yi,o_=u_/2,s_=Sn(F3),Mt=Sn(0);Se.ZERO=Mt;var cr=Sn(0,!0);Se.UZERO=cr;var gi=Sn(1);Se.ONE=gi;var f_=Sn(1,!0);Se.UONE=f_;var Uh=Sn(-1);Se.NEG_ONE=Uh;var l_=ye(-1,2147483647,!1);Se.MAX_VALUE=l_;var c_=ye(-1,-1,!0);Se.MAX_UNSIGNED_VALUE=c_;var lt=ye(0,-2147483648,!1);Se.MIN_VALUE=lt;var W=Se.prototype;W.toInt=function(){return this.unsigned?this.low>>>0:this.low};W.toNumber=function(){return this.unsigned?(this.high>>>0)*yi+(this.low>>>0):this.high*yi+(this.low>>>0)};W.toString=function(r){if(r=r||10,r<2||36<r)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative())if(this.eq(lt)){var t=_t(r),n=this.div(t),i=n.mul(t).sub(this);return n.toString(r)+i.toInt().toString(r)}else return"-"+this.neg().toString(r);for(var a=_t(zs(r,6),this.unsigned),o=this,s="";;){var u=o.div(a),f=o.sub(u.mul(a)).toInt()>>>0,l=f.toString(r);if(o=u,o.isZero())return l+s;for(;l.length<6;)l="0"+l;s=""+l+s}};W.getHighBits=function(){return this.high};W.getHighBitsUnsigned=function(){return this.high>>>0};W.getLowBits=function(){return this.low};W.getLowBitsUnsigned=function(){return this.low>>>0};W.getNumBitsAbs=function(){if(this.isNegative())return this.eq(lt)?64:this.neg().getNumBitsAbs();for(var r=this.high!=0?this.high:this.low,t=31;t>0&&!(r&1<<t);t--);return this.high!=0?t+33:t+1};W.isZero=function(){return this.high===0&&this.low===0};W.eqz=W.isZero;W.isNegative=function(){return!this.unsigned&&this.high<0};W.isPositive=function(){return this.unsigned||this.high>=0};W.isOdd=function(){return(this.low&1)===1};W.isEven=function(){return(this.low&1)===0};W.equals=function(r){return Ze(r)||(r=Ot(r)),this.unsigned!==r.unsigned&&this.high>>>31===1&&r.high>>>31===1?!1:this.high===r.high&&this.low===r.low};W.eq=W.equals;W.notEquals=function(r){return!this.eq(r)};W.neq=W.notEquals;W.ne=W.notEquals;W.lessThan=function(r){return this.comp(r)<0};W.lt=W.lessThan;W.lessThanOrEqual=function(r){return this.comp(r)<=0};W.lte=W.lessThanOrEqual;W.le=W.lessThanOrEqual;W.greaterThan=function(r){return this.comp(r)>0};W.gt=W.greaterThan;W.greaterThanOrEqual=function(r){return this.comp(r)>=0};W.gte=W.greaterThanOrEqual;W.ge=W.greaterThanOrEqual;W.compare=function(r){if(Ze(r)||(r=Ot(r)),this.eq(r))return 0;var t=this.isNegative(),n=r.isNegative();return t&&!n?-1:!t&&n?1:this.unsigned?r.high>>>0>this.high>>>0||r.high===this.high&&r.low>>>0>this.low>>>0?-1:1:this.sub(r).isNegative()?-1:1};W.comp=W.compare;W.negate=function(){return!this.unsigned&&this.eq(lt)?lt:this.not().add(gi)};W.neg=W.negate;W.add=function(r){Ze(r)||(r=Ot(r));var t=this.high>>>16,n=this.high&65535,i=this.low>>>16,a=this.low&65535,o=r.high>>>16,s=r.high&65535,u=r.low>>>16,f=r.low&65535,l=0,h=0,d=0,p=0;return p+=a+f,d+=p>>>16,p&=65535,d+=i+u,h+=d>>>16,d&=65535,h+=n+s,l+=h>>>16,h&=65535,l+=t+o,l&=65535,ye(d<<16|p,l<<16|h,this.unsigned)};W.subtract=function(r){return Ze(r)||(r=Ot(r)),this.add(r.neg())};W.sub=W.subtract;W.multiply=function(r){if(this.isZero())return this;if(Ze(r)||(r=Ot(r)),At){var t=At.mul(this.low,this.high,r.low,r.high);return ye(t,At.get_high(),this.unsigned)}if(r.isZero())return this.unsigned?cr:Mt;if(this.eq(lt))return r.isOdd()?lt:Mt;if(r.eq(lt))return this.isOdd()?lt:Mt;if(this.isNegative())return r.isNegative()?this.neg().mul(r.neg()):this.neg().mul(r).neg();if(r.isNegative())return this.mul(r.neg()).neg();if(this.lt(s_)&&r.lt(s_))return _t(this.toNumber()*r.toNumber(),this.unsigned);var n=this.high>>>16,i=this.high&65535,a=this.low>>>16,o=this.low&65535,s=r.high>>>16,u=r.high&65535,f=r.low>>>16,l=r.low&65535,h=0,d=0,p=0,m=0;return m+=o*l,p+=m>>>16,m&=65535,p+=a*l,d+=p>>>16,p&=65535,p+=o*f,d+=p>>>16,p&=65535,d+=i*l,h+=d>>>16,d&=65535,d+=a*f,h+=d>>>16,d&=65535,d+=o*u,h+=d>>>16,d&=65535,h+=n*l+i*f+a*u+o*s,h&=65535,ye(p<<16|m,h<<16|d,this.unsigned)};W.mul=W.multiply;W.divide=function(r){if(Ze(r)||(r=Ot(r)),r.isZero())throw Error("division by zero");if(At){if(!this.unsigned&&this.high===-2147483648&&r.low===-1&&r.high===-1)return this;var t=(this.unsigned?At.div_u:At.div_s)(this.low,this.high,r.low,r.high);return ye(t,At.get_high(),this.unsigned)}if(this.isZero())return this.unsigned?cr:Mt;var n,i,a;if(this.unsigned){if(r.unsigned||(r=r.toUnsigned()),r.gt(this))return cr;if(r.gt(this.shru(1)))return f_;a=cr}else{if(this.eq(lt)){if(r.eq(gi)||r.eq(Uh))return lt;if(r.eq(lt))return gi;var o=this.shr(1);return n=o.div(r).shl(1),n.eq(Mt)?r.isNegative()?gi:Uh:(i=this.sub(r.mul(n)),a=n.add(i.div(r)),a)}else if(r.eq(lt))return this.unsigned?cr:Mt;if(this.isNegative())return r.isNegative()?this.neg().div(r.neg()):this.neg().div(r).neg();if(r.isNegative())return this.div(r.neg()).neg();a=Mt}for(i=this;i.gte(r);){n=Math.max(1,Math.floor(i.toNumber()/r.toNumber()));for(var s=Math.ceil(Math.log(n)/Math.LN2),u=s<=48?1:zs(2,s-48),f=_t(n),l=f.mul(r);l.isNegative()||l.gt(i);)n-=u,f=_t(n,this.unsigned),l=f.mul(r);f.isZero()&&(f=gi),a=a.add(f),i=i.sub(l)}return a};W.div=W.divide;W.modulo=function(r){if(Ze(r)||(r=Ot(r)),At){var t=(this.unsigned?At.rem_u:At.rem_s)(this.low,this.high,r.low,r.high);return ye(t,At.get_high(),this.unsigned)}return this.sub(this.div(r).mul(r))};W.mod=W.modulo;W.rem=W.modulo;W.not=function(){return ye(~this.low,~this.high,this.unsigned)};W.countLeadingZeros=function(){return this.high?Math.clz32(this.high):Math.clz32(this.low)+32};W.clz=W.countLeadingZeros;W.countTrailingZeros=function(){return this.low?r_(this.low):r_(this.high)+32};W.ctz=W.countTrailingZeros;W.and=function(r){return Ze(r)||(r=Ot(r)),ye(this.low&r.low,this.high&r.high,this.unsigned)};W.or=function(r){return Ze(r)||(r=Ot(r)),ye(this.low|r.low,this.high|r.high,this.unsigned)};W.xor=function(r){return Ze(r)||(r=Ot(r)),ye(this.low^r.low,this.high^r.high,this.unsigned)};W.shiftLeft=function(r){return Ze(r)&&(r=r.toInt()),(r&=63)===0?this:r<32?ye(this.low<<r,this.high<<r|this.low>>>32-r,this.unsigned):ye(0,this.low<<r-32,this.unsigned)};W.shl=W.shiftLeft;W.shiftRight=function(r){return Ze(r)&&(r=r.toInt()),(r&=63)===0?this:r<32?ye(this.low>>>r|this.high<<32-r,this.high>>r,this.unsigned):ye(this.high>>r-32,this.high>=0?0:-1,this.unsigned)};W.shr=W.shiftRight;W.shiftRightUnsigned=function(r){return Ze(r)&&(r=r.toInt()),(r&=63)===0?this:r<32?ye(this.low>>>r|this.high<<32-r,this.high>>>r,this.unsigned):r===32?ye(this.high,0,this.unsigned):ye(this.high>>>r-32,0,this.unsigned)};W.shru=W.shiftRightUnsigned;W.shr_u=W.shiftRightUnsigned;W.rotateLeft=function(r){var t;return Ze(r)&&(r=r.toInt()),(r&=63)===0?this:r===32?ye(this.high,this.low,this.unsigned):r<32?(t=32-r,ye(this.low<<r|this.high>>>t,this.high<<r|this.low>>>t,this.unsigned)):(r-=32,t=32-r,ye(this.high<<r|this.low>>>t,this.low<<r|this.high>>>t,this.unsigned))};W.rotl=W.rotateLeft;W.rotateRight=function(r){var t;return Ze(r)&&(r=r.toInt()),(r&=63)===0?this:r===32?ye(this.high,this.low,this.unsigned):r<32?(t=32-r,ye(this.high<<t|this.low>>>r,this.low<<t|this.high>>>r,this.unsigned)):(r-=32,t=32-r,ye(this.low<<t|this.high>>>r,this.high<<t|this.low>>>r,this.unsigned))};W.rotr=W.rotateRight;W.toSigned=function(){return this.unsigned?ye(this.low,this.high,!1):this};W.toUnsigned=function(){return this.unsigned?this:ye(this.low,this.high,!0)};W.toBytes=function(r){return r?this.toBytesLE():this.toBytesBE()};W.toBytesLE=function(){var r=this.high,t=this.low;return[t&255,t>>>8&255,t>>>16&255,t>>>24,r&255,r>>>8&255,r>>>16&255,r>>>24]};W.toBytesBE=function(){var r=this.high,t=this.low;return[r>>>24,r>>>16&255,r>>>8&255,r&255,t>>>24,t>>>16&255,t>>>8&255,t&255]};Se.fromBytes=function(r,t,n){return n?Se.fromBytesLE(r,t):Se.fromBytesBE(r,t)};Se.fromBytesLE=function(r,t){return new Se(r[0]|r[1]<<8|r[2]<<16|r[3]<<24,r[4]|r[5]<<8|r[6]<<16|r[7]<<24,t)};Se.fromBytesBE=function(r,t){return new Se(r[4]<<24|r[5]<<16|r[6]<<8|r[7],r[0]<<24|r[1]<<16|r[2]<<8|r[3],t)};var Ai=Se;var L3=16;function Ma(e){e==="X"&&(e="");var r=e.padEnd(L3,"0");return Ai.fromString(r,!0,16)}function Hh(e){if(e.isZero())return"X";var r=e.countTrailingZeros(),t=r%4;r=(r-t)/4;var n=r;r*=4;var i=e.shiftRightUnsigned(r),a=i.toString(16).replace(/0+$/,""),o=Array(17-n-a.length).join("0");return o+a}function Vh(e,r){var t=k3(e).shiftRightUnsigned(2),n=e.add(Ai.fromNumber(2*r+1-4).multiply(t));return n}function k3(e){return e.and(e.not().add(1))}ue();var D3=3,G3=30,N3=2*G3+1,h_=180/Math.PI;function p_(e){if(e.length===0)throw new Error("Invalid Hilbert quad key ".concat(e));for(var r=e.split("/"),t=parseInt(r[0],10),n=r[1],i=n.length,a=0,o=[0,0],s=i-1;s>=0;s--){a=i-s;var u=n[s],f=0,l=0;u==="1"?l=1:u==="2"?(f=1,l=1):u==="3"&&(f=1);var h=Math.pow(2,a-1);U3(h,o,f,l),o[0]+=h*f,o[1]+=h*l}if(t%2===1){var d=o[0];o[0]=o[1],o[1]=d}return{face:t,ij:o,level:a}}function m_(e){if(e.isZero())return"";for(var r=e.toString(2);r.length<D3+N3;)r="0"+r;var t=r.lastIndexOf("1"),n=r.substring(0,3),i=r.substring(3,t),a=i.length/2,o=Ai.fromString(n,!0,2).toString(10),s="";if(a!==0)for(s=Ai.fromString(i,!0,2).toString(4);s.length<a;)s="0"+s;return"".concat(o,"/").concat(s)}function zh(e,r,t){var n=1<<r;return[(e[0]+t[0])/n,(e[1]+t[1])/n]}function d_(e){return e>=.5?1/3*(4*e*e-1):1/3*(1-4*(1-e)*(1-e))}function Wh(e){return[d_(e[0]),d_(e[1])]}function Jh(e,r){var t=D(r,2),n=t[0],i=t[1];switch(e){case 0:return[1,n,i];case 1:return[-n,1,i];case 2:return[-n,-i,1];case 3:return[-1,-i,-n];case 4:return[i,-1,-n];case 5:return[i,n,-1];default:throw new Error("Invalid face")}}function Xh(e){var r=D(e,3),t=r[0],n=r[1],i=r[2],a=Math.atan2(i,Math.sqrt(t*t+n*n)),o=Math.atan2(n,t);return[o*h_,a*h_]}function U3(e,r,t,n){if(n===0){t===1&&(r[0]=e-1-r[0],r[1]=e-1-r[1]);var i=r[0];r[0]=r[1],r[1]=i}}function v_(e){var r=zh(e.ij,e.level,[.5,.5]),t=Wh(r),n=Jh(e.face,t);return Xh(n)}var j3=100;function qh(e){for(var r=e.face,t=e.ij,n=e.level,i=[[0,0],[0,1],[1,1],[1,0],[0,0]],a=Math.max(1,Math.ceil(j3*Math.pow(2,-n))),o=new Float64Array(4*a*2+2),s=0,u=0,f=0;f<4;f++)for(var l=i[f].slice(0),h=i[f+1],d=(h[0]-l[0])/a,p=(h[1]-l[1])/a,m=0;m<a;m++){l[0]+=d,l[1]+=p;var v=zh(t,n,l),g=Wh(v),y=Jh(r,g),A=Xh(y);Math.abs(A[1])>89.999&&(A[0]=u);var x=A[0]-u;A[0]+=x>180?-360:x<-180?360:0,o[s++]=A[0],o[s++]=A[1],u=A[0]}return o[s++]=o[0],o[s++]=o[1],o}function _i(e){var r=H3(e),t=p_(r);return t}function H3(e){if(e.indexOf("/")>0)return e;var r=Ma(e);return m_(r)}function Kh(e){var r=_i(e);return v_(r)}function y_(e){var r;if(e.face===2||e.face===5){for(var t=null,n=0,i=0;i<4;i++){var a="".concat(e.face,"/").concat(i),o=_i(a),s=qh(o);(typeof t>"u"||t===null)&&(t=new Float64Array(4*s.length)),t.set(s,n),n+=s.length}r=g_(t)}else{var u=qh(e);r=g_(u)}return r}function g_(e){if(e.length%2!==0)throw new Error("Invalid corners");for(var r=[],t=[],n=0;n<e.length;n+=2)r.push(e[n]),t.push(e[n+1]);return r.sort(function(i,a){return i-a}),t.sort(function(i,a){return i-a}),{west:r[0],east:r[r.length-1],north:t[t.length-1],south:t[0]}}function Yh(e,r){var t=r?.minimumHeight||0,n=r?.maximumHeight||0,i=_i(e),a=y_(i),o=a.west,s=a.south,u=a.east,f=a.north,l=[];return l.push(new E(o,f,t)),l.push(new E(u,f,t)),l.push(new E(u,s,t)),l.push(new E(o,s,t)),l.push(new E(o,f,n)),l.push(new E(u,f,n)),l.push(new E(u,s,n)),l.push(new E(o,s,n)),l}function Ws(e){var r=e.token,t={minimumHeight:e.minimumHeight,maximumHeight:e.maximumHeight},n=Yh(r,t),i=Kh(r),a=i[0],o=i[1],s=ve.WGS84.cartographicToCartesian([a,o,t.maximumHeight]),u=new E(s[0],s[1],s[2]);n.push(u);var f=$i(n),l=[].concat(K(f.center),K(f.halfAxes));return l}function A_(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),t.push.apply(t,n)}return t}function V3(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{};r%2?A_(Object(t),!0).forEach(function(n){c(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):A_(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}var z3=4,W3=8,J3={QUADTREE:z3,OCTREE:W3};function X3(e,r,t){if(e!=null&&e.box){var n=Ma(e.s2VolumeInfo.token),i=Vh(n,r),a=Hh(i),o=V3({},e.s2VolumeInfo);switch(o.token=a,t){case"OCTREE":var s=e.s2VolumeInfo,u=s.maximumHeight-s.minimumHeight,f=u/2,l=s.minimumHeight+u/2;s.minimumHeight=l-f,s.maximumHeight=l+f;break;default:break}var h=Ws(o),d={box:h,s2VolumeInfo:o};return d}}function ed(e){return Qh.apply(this,arguments)}function Qh(){return Qh=I($h.default.mark(function e(r){var t,n,i,a,o,s,u,f,l,h,d,p,m,v,g,y,A,x,b,M,C,F,B,S,_,R,k,U,j,Z,P,O,G,J,V,ee,ie,we,Me,Re,Xe,nt,Fe,Rn,zd,Wd;return $h.default.wrap(function(ct){for(;;)switch(ct.prev=ct.next){case 0:if(t=r.options,n=r.parentData,i=n===void 0?{mortonIndex:0,x:0,y:0,z:0}:n,a=r.childIndex,o=a===void 0?0:a,s=r.globalData,u=s===void 0?{level:0,mortonIndex:0,x:0,y:0,z:0}:s,f=r.s2VolumeBox,l=r.subtree,h=r.level,d=h===void 0?0:h,p=t.subdivisionScheme,m=t.subtreeLevels,v=t.maximumLevel,g=t.contentUrlTemplate,y=t.subtreesUriTemplate,A=t.basePath,x={children:[],lodMetricValue:0,contentUrl:""},b=J3[p],M=o&1,C=o>>1&1,F=o>>2&1,B=(Math.pow(b,d)-1)/(b-1),S=wn(i.mortonIndex,o),_=B+S,R=wn(i.x,M),k=wn(i.y,C),U=wn(i.z,F),j=!1,d+1>m&&(j=Zh(l.childSubtreeAvailability,S)),Z=wn(u.x,R),P=wn(u.y,k),O=wn(u.z,U),G=d+u.level,!j){ct.next=38;break}return J="".concat(A,"/").concat(y),V=Js(J,G,Z,P,O),ct.next=25,(0,__.load)(V,Vs);case 25:ee=ct.sent,l=ee,u.mortonIndex=S,u.x=R,u.y=k,u.z=U,u.level=d,S=0,_=0,R=0,k=0,U=0,d=0;case 38:if(ie=Zh(l.tileAvailability,_),!(!ie||d>v)){ct.next=41;break}return ct.abrupt("return",x);case 41:we=Zh(l.contentAvailability,_),we&&(x.contentUrl=Js(g,G,Z,P,O)),Me=d+1,Re={mortonIndex:S,x:R,y:k,z:U},Xe=0;case 46:if(!(Xe<b)){ct.next=55;break}return nt=X3(f,Xe,p),ct.next=50,ed({subtree:l,options:t,parentData:Re,childIndex:Xe,level:Me,globalData:u,s2VolumeBox:nt});case 50:Fe=ct.sent,(Fe.contentUrl||Fe.children.length)&&(Rn=G+1,zd={childTileX:R,childTileY:k,childTileZ:U},Wd=q3(Fe,Rn,zd,t,f),x.children.push(Wd));case 52:Xe++,ct.next=46;break;case 55:return ct.abrupt("return",x);case 56:case"end":return ct.stop()}},e)})),Qh.apply(this,arguments)}function Zh(e,r){return"constant"in e?Boolean(e.constant):e.explicitBitstream?Z3(r,e.explicitBitstream):!1}function q3(e,r,t,n,i){var a=n.basePath,o=n.refine,s=n.getRefine,u=n.lodMetricType,f=n.getTileType,l=n.rootLodMetricValue,h=n.rootBoundingVolume,d=e.contentUrl&&e.contentUrl.replace("".concat(a,"/"),""),p=l/Math.pow(2,r),m=i!=null&&i.box?{box:i.box}:h,v=K3(r,m,t);return{children:e.children,contentUrl:e.contentUrl,content:{uri:d},id:e.contentUrl,refine:s(o),type:f(e),lodMetricType:u,lodMetricValue:p,geometricError:p,transform:e.transform,boundingVolume:v}}function K3(e,r,t){if(r.region){var n=t.childTileX,i=t.childTileY,a=t.childTileZ,o=D(r.region,6),s=o[0],u=o[1],f=o[2],l=o[3],h=o[4],d=o[5],p=Math.pow(2,e),m=(f-s)/p,v=(l-u)/p,g=(d-h)/p,y=s+m*n,A=s+m*(n+1),x=u+v*i,b=u+v*(i+1),M=h+g*a,C=h+g*(a+1);return{region:[y,x,A,b,M,C]}}if(r.box)return r;throw new Error("Unsupported bounding volume type ".concat(r))}function wn(e,r){return parseInt(e.toString(2)+r.toString(2),2)}function Js(e,r,t,n,i){var a=Y3({level:r,x:t,y:n,z:i});return e.replace(/{level}|{x}|{y}|{z}/gi,function(o){return a[o]})}function Y3(e){var r={};for(var t in e)r["{".concat(t,"}")]=e[t];return r}function Z3(e,r){var t=Math.floor(e/8),n=e%8,i=r[t]>>n&1;return i===1}function $3(e,r){var t=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=Q3(e))||r&&e&&typeof e.length=="number"){t&&(e=t);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(f){throw f},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
186
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){t=t.call(e)},n:function(){var f=t.next();return a=f.done,f},e:function(f){o=!0,s=f},f:function(){try{!a&&t.return!=null&&t.return()}finally{if(o)throw s}}}}function Q3(e,r){if(e){if(typeof e=="string")return b_(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);if(t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set")return Array.from(e);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return b_(e,r)}}function b_(e,r){(r==null||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function ad(e){if(!e.contentUrl)return or.EMPTY;var r=e.contentUrl.split("?")[0],t=r.split(".").pop();switch(t){case"pnts":return or.POINTCLOUD;case"i3dm":case"b3dm":case"glb":case"gltf":return or.SCENEGRAPH;default:return t}}function od(e){switch(e){case"REPLACE":case"replace":return st.REPLACE;case"ADD":case"add":return st.ADD;default:return e}}function td(e,r){var t=/^[a-z][0-9a-z+.-]*:/i;if(t.test(r)){var n=new URL(e,"".concat(r,"/"));return decodeURI(n.toString())}else if(e.startsWith("/"))return e;return"".concat(r,"/").concat(e)}function T_(e,r){if(!e)return null;if(e.content){var t=e.content.uri||e.content.url;e.contentUrl=td(t,r.basePath)}return e.id=e.contentUrl,e.lodMetricType=dn.GEOMETRIC_ERROR,e.lodMetricValue=e.geometricError,e.transformMatrix=e.transform,e.type=ad(e),e.refine=od(e.refine),e}function w_(e,r){return rd.apply(this,arguments)}function rd(){return rd=I(Cn.default.mark(function e(r,t){var n,i,a,o,s,u,f,l,h,d;return Cn.default.wrap(function(m){for(;;)switch(m.prev=m.next){case 0:if(n=r.basePath,a=E_(r?.root),!(a&&r.root)){m.next=8;break}return m.next=5,x_(r.root,r,a,t);case 5:i=m.sent,m.next=9;break;case 8:i=T_(r.root,r);case 9:o=[],o.push(i);case 11:if(!(o.length>0)){m.next=40;break}s=o.pop()||{},u=s.children||[],f=$3(u),m.prev=15,f.s();case 17:if((l=f.n()).done){m.next=30;break}if(h=l.value,d=E_(h),!d){m.next=26;break}return m.next=23,x_(h,r,d,t);case 23:h=m.sent,m.next=27;break;case 26:T_(h,{basePath:n});case 27:o.push(h);case 28:m.next=17;break;case 30:m.next=35;break;case 32:m.prev=32,m.t0=m.catch(15),f.e(m.t0);case 35:return m.prev=35,f.f(),m.finish(35);case 38:m.next=11;break;case 40:return m.abrupt("return",i);case 41:case"end":return m.stop()}},e,null,[[15,32,35,38]])})),rd.apply(this,arguments)}function x_(e,r,t,n){return nd.apply(this,arguments)}function nd(){return nd=I(Cn.default.mark(function e(r,t,n,i){var a,o,s,u,f,l,h,d,p,m,v,g,y,A,x,b,M,C;return Cn.default.wrap(function(B){for(;;)switch(B.prev=B.next){case 0:return s=t.basePath,u=n.subdivisionScheme,f=n.maximumLevel,l=n.subtreeLevels,h=n.subtrees.uri,d=Js(h,0,0,0,0),p=td(d,s),B.next=6,(0,S_.load)(p,Vs,i);case 6:return m=B.sent,v=td(r.content.uri,s),g=t==null||(a=t.root)===null||a===void 0?void 0:a.refine,y=r.geometricError,A=(o=r.boundingVolume.extensions)===null||o===void 0?void 0:o["3DTILES_bounding_volume_S2"],A&&(x=Ws(A),b={box:x,s2VolumeInfo:A},r.boundingVolume=b),M=r.boundingVolume,C={contentUrlTemplate:v,subtreesUriTemplate:h,subdivisionScheme:u,subtreeLevels:l,maximumLevel:f,refine:g,basePath:s,lodMetricType:dn.GEOMETRIC_ERROR,rootLodMetricValue:y,rootBoundingVolume:M,getTileType:ad,getRefine:od},B.next=16,eP(r,m,C);case 16:return B.abrupt("return",B.sent);case 17:case"end":return B.stop()}},e)})),nd.apply(this,arguments)}function eP(e,r,t){return id.apply(this,arguments)}function id(){return id=I(Cn.default.mark(function e(r,t,n){var i,a,o;return Cn.default.wrap(function(u){for(;;)switch(u.prev=u.next){case 0:if(r){u.next=2;break}return u.abrupt("return",null);case 2:return r.lodMetricType=dn.GEOMETRIC_ERROR,r.lodMetricValue=r.geometricError,r.transformMatrix=r.transform,u.next=7,ed({subtree:t,options:n,s2VolumeBox:r});case 7:return i=u.sent,a=i.children,o=i.contentUrl,o&&(r.contentUrl=o,r.content={uri:o.replace("".concat(n.basePath,"/"),"")}),r.refine=od(r.refine),r.type=ad(r),r.children=a,r.id=r.contentUrl,u.abrupt("return",r);case 16:case"end":return u.stop()}},e)})),id.apply(this,arguments)}function E_(e){var r;return(e==null||(r=e.extensions)===null||r===void 0?void 0:r["3DTILES_implicit_tiling"])||e?.implicitTiling}var Xs={id:"3d-tiles",name:"3D Tiles",module:"3d-tiles",version:vs,extensions:["cmpt","pnts","b3dm","i3dm"],mimeTypes:["application/octet-stream"],tests:["cmpt","pnts","b3dm","i3dm"],parse:iP,options:{"3d-tiles":{loadGLTF:!0,decodeQuantizedPositions:!1,isTileset:"auto",assetGltfUpAxis:null}}};function tP(e){return kn.dirname(e.url)}function rP(e,r,t){return sd.apply(this,arguments)}function sd(){return sd=I(Bn.default.mark(function e(r,t,n){var i,a;return Bn.default.wrap(function(s){for(;;)switch(s.prev=s.next){case 0:return i={content:{featureIds:null}},a=0,s.next=4,Lh(r,a,t,n,i.content);case 4:return s.abrupt("return",i.content);case 5:case"end":return s.stop()}},e)})),sd.apply(this,arguments)}function nP(e,r,t){return ud.apply(this,arguments)}function ud(){return ud=I(Bn.default.mark(function e(r,t,n){var i,a;return Bn.default.wrap(function(s){for(;;)switch(s.prev=s.next){case 0:return a=JSON.parse(new TextDecoder().decode(r)),a.loader=t.loader||Xs,a.url=n.url,a.queryString=n.queryString,a.basePath=tP(a),s.next=7,w_(a,t);case 7:return a.root=s.sent,a.type=Ke.TILES3D,a.lodMetricType=dn.GEOMETRIC_ERROR,a.lodMetricValue=((i=a.root)===null||i===void 0?void 0:i.lodMetricValue)||0,s.abrupt("return",a);case 12:case"end":return s.stop()}},e)})),ud.apply(this,arguments)}function iP(e,r,t){return fd.apply(this,arguments)}function fd(){return fd=I(Bn.default.mark(function e(r,t,n){var i,a;return Bn.default.wrap(function(s){for(;;)switch(s.prev=s.next){case 0:if(i=t["3d-tiles"]||{},i.isTileset==="auto"?a=n.url&&n.url.indexOf(".json")!==-1:a=i.isTileset,!a){s.next=8;break}return s.next=5,nP(r,t,n);case 5:r=s.sent,s.next=11;break;case 8:return s.next=10,rP(r,t,n);case 10:r=s.sent;case 11:return s.abrupt("return",r);case 12:case"end":return s.stop()}},e)})),fd.apply(this,arguments)}function C_(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),t.push.apply(t,n)}return t}function bi(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{};r%2?C_(Object(t),!0).forEach(function(n){c(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):C_(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}function aP(e){var r=oP();return function(){var n=L(e),i;if(r){var a=L(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return $(this,i)}}function oP(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var B_=[0],sP={getPointColor:{type:"accessor",value:[0,0,0,255]},pointSize:1,data:"",loader:Xs,onTilesetLoad:{type:"function",value:function(r){}},onTileLoad:{type:"function",value:function(r){}},onTileUnload:{type:"function",value:function(r){}},onTileError:{type:"function",value:function(r,t,n){}},_getMeshColor:{type:"function",value:function(r){return[255,255,255]}}},qs=function(e){H(t,e);var r=aP(t);function t(){var n;T(this,t);for(var i=arguments.length,a=new Array(i),o=0;o<i;o++)a[o]=arguments[o];return n=r.call.apply(r,[this].concat(a)),c(oe(n),"state",void 0),n}return w(t,[{key:"initializeState",value:function(){"onTileLoadFail"in this.props&&Gr.log.removed("onTileLoadFail","onTileError")(),this.state={layerMap:{},tileset3d:null,activeViewports:{},lastUpdatedViewports:null}}},{key:"isLoaded",get:function(){var i=this.state.tileset3d;return i!==null&&i.isLoaded()}},{key:"shouldUpdateState",value:function(i){var a=i.changeFlags;return a.somethingChanged}},{key:"updateState",value:function(i){var a=i.props,o=i.oldProps,s=i.changeFlags;if(a.data&&a.data!==o.data&&this._loadTileset(a.data),s.viewportChanged){var u=this.state.activeViewports,f=Object.keys(u).length;f&&(this._updateTileset(u),this.state.lastUpdatedViewports=u,this.state.activeViewports={})}if(s.propsChanged){var l=this.state.layerMap;for(var h in l)l[h].needsUpdate=!0}}},{key:"activateViewport",value:function(i){var a=this.state,o=a.activeViewports,s=a.lastUpdatedViewports;this.internalState.viewport=i,o[i.id]=i;var u=s?.[i.id];(!u||!i.equals(u))&&(this.setChangeFlags({viewportChanged:!0}),this.setNeedsUpdate())}},{key:"getPickingInfo",value:function(i){var a=i.info,o=i.sourceLayer,s=o&&o.props.tile;return a.picked&&(a.object=s),a.sourceTile=s,a}},{key:"filterSubLayer",value:function(i){var a=i.layer,o=i.viewport,s=a.props,u=s.tile,f=o.id;return u.selected&&u.viewportIds.includes(f)}},{key:"_updateAutoHighlight",value:function(i){var a=i.sourceTile,o=this.state.layerMap[a?.id];o&&o.layer&&o.layer.updateAutoHighlight(i)}},{key:"_loadTileset",value:function(){var n=I(ld.default.mark(function a(o){var s,u,f,l,h,d,p,m;return ld.default.wrap(function(g){for(;;)switch(g.prev=g.next){case 0:if(s=this.props.loadOptions,u=s===void 0?{}:s,f=this.props.loader||this.props.loaders,Array.isArray(f)&&(f=f[0]),l={loadOptions:bi({},u)},h=o,!f.preload){g.next=12;break}return g.next=8,f.preload(o,u);case 8:d=g.sent,d.url&&(h=d.url),d.headers&&(l.loadOptions.fetch=bi(bi({},l.loadOptions.fetch),{},{headers:d.headers})),Object.assign(l,d);case 12:return g.next=14,(0,I_.load)(h,f,l.loadOptions);case 14:p=g.sent,m=new $l(p,bi({onTileLoad:this._onTileLoad.bind(this),onTileUnload:this._onTileUnload.bind(this),onTileError:this.props.onTileError},l)),this.setState({tileset3d:m,layerMap:{}}),this._updateTileset(this.state.activeViewports),this.props.onTilesetLoad(m);case 19:case"end":return g.stop()}},a,this)}));function i(a){return n.apply(this,arguments)}return i}()},{key:"_onTileLoad",value:function(i){var a=this.state.lastUpdatedViewports;this.props.onTileLoad(i),this._updateTileset(a),this.setNeedsUpdate()}},{key:"_onTileUnload",value:function(i){delete this.state.layerMap[i.id],this.props.onTileUnload(i)}},{key:"_updateTileset",value:function(i){var a=this;if(i){var o=this.state.tileset3d,s=this.context.timeline,u=Object.keys(i).length;!s||!u||!o||o.selectTiles(Object.values(i)).then(function(f){var l=a.state.frameNumber!==f;l&&a.setState({frameNumber:f})})}}},{key:"_getSubLayer",value:function(i,a){if(!i.content)return null;switch(i.type){case or.POINTCLOUD:return this._makePointCloudLayer(i,a);case or.SCENEGRAPH:return this._make3DModelLayer(i);case or.MESH:return this._makeSimpleMeshLayer(i,a);default:throw new Error("Tile3DLayer: Failed to render layer of type ".concat(i.content.type))}}},{key:"_makePointCloudLayer",value:function(i,a){var o=i.content,s=o.attributes,u=o.pointCount,f=o.constantRGBA,l=o.cartographicOrigin,h=o.modelMatrix,d=s.positions,p=s.normals,m=s.colors;if(!d)return null;var v=a&&a.props.data||{header:{vertexCount:u},attributes:{POSITION:d,NORMAL:p,COLOR_0:m}},g=this.props,y=g.pointSize,A=g.getPointColor,x=this.getSubLayerClass("pointcloud",O_.PointCloudLayer);return new x({pointSize:y},this.getSubLayerProps({id:"pointcloud"}),{id:"".concat(this.id,"-pointcloud-").concat(i.id),tile:i,data:v,coordinateSystem:Gr.COORDINATE_SYSTEM.METER_OFFSETS,coordinateOrigin:l,modelMatrix:h,getColor:f||A,_offset:0})}},{key:"_make3DModelLayer",value:function(i){var a=i.content,o=a.gltf,s=a.instances,u=a.cartographicOrigin,f=a.modelMatrix,l=this.getSubLayerClass("scenegraph",P_.ScenegraphLayer);return new l({_lighting:"pbr"},this.getSubLayerProps({id:"scenegraph"}),{id:"".concat(this.id,"-scenegraph-").concat(i.id),tile:i,data:s||B_,scenegraph:o,coordinateSystem:Gr.COORDINATE_SYSTEM.METER_OFFSETS,coordinateOrigin:u,modelMatrix:f,getTransformMatrix:function(d){return d.modelMatrix},getPosition:[0,0,0],_offset:0})}},{key:"_makeSimpleMeshLayer",value:function(i,a){var o=i.content,s=o.attributes,u=o.indices,f=o.modelMatrix,l=o.cartographicOrigin,h=o.coordinateSystem,d=h===void 0?Gr.COORDINATE_SYSTEM.METER_OFFSETS:h,p=o.material,m=o.featureIds,v=this.props._getMeshColor,g=a&&a.props.mesh||new M_.Geometry({drawMode:4,attributes:uP(s),indices:u}),y=this.getSubLayerClass("mesh",is);return new y(this.getSubLayerProps({id:"mesh"}),{id:"".concat(this.id,"-mesh-").concat(i.id),tile:i,mesh:g,data:B_,getColor:v(i),pbrMaterial:p,modelMatrix:f,coordinateOrigin:l,coordinateSystem:d,featureIds:m,_offset:0})}},{key:"renderLayers",value:function(){var i=this,a=this.state,o=a.tileset3d,s=a.layerMap;return o?o.tiles.map(function(u){var f=s[u.id]=s[u.id]||{tile:u},l=f.layer;return u.selected&&(l?f.needsUpdate&&(l=i._getSubLayer(u,l),f.needsUpdate=!1):l=i._getSubLayer(u)),f.layer=l,l}).filter(Boolean):null}}]),t}(Gr.CompositeLayer);c(qs,"defaultProps",sP);c(qs,"layerName","Tile3DLayer");function uP(e){var r={};return r.positions=bi(bi({},e.positions),{},{value:new Float32Array(e.positions.value)}),e.normals&&(r.normals=e.normals),e.texCoords&&(r.texCoords=e.texCoords),e.colors&&(r.colors=e.colors),e.uvRegions&&(r.uvRegions=e.uvRegions),r}ue();q();Y();N();var ru=X(xt()),yd=X(Ho()),V_=X(xt());N();var gd=X(re());ue();ue();function fP(e,r){var t=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=lP(e))||r&&e&&typeof e.length=="number"){t&&(e=t);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(f){throw f},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
187
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){t=t.call(e)},n:function(){var f=t.next();return a=f.done,f},e:function(f){o=!0,s=f},f:function(){try{!a&&t.return!=null&&t.return()}finally{if(o)throw s}}}}function lP(e,r){if(e){if(typeof e=="string")return R_(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);if(t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set")return Array.from(e);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return R_(e,r)}}function R_(e,r){(r==null||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}var cP=new Map([["centerX",Float64Array.BYTES_PER_ELEMENT],["centerY",Float64Array.BYTES_PER_ELEMENT],["centerZ",Float64Array.BYTES_PER_ELEMENT],["minHeight",Float32Array.BYTES_PER_ELEMENT],["maxHeight",Float32Array.BYTES_PER_ELEMENT],["boundingSphereCenterX",Float64Array.BYTES_PER_ELEMENT],["boundingSphereCenterY",Float64Array.BYTES_PER_ELEMENT],["boundingSphereCenterZ",Float64Array.BYTES_PER_ELEMENT],["boundingSphereRadius",Float64Array.BYTES_PER_ELEMENT],["horizonOcclusionPointX",Float64Array.BYTES_PER_ELEMENT],["horizonOcclusionPointY",Float64Array.BYTES_PER_ELEMENT],["horizonOcclusionPointZ",Float64Array.BYTES_PER_ELEMENT]]);function cd(e){return e>>1^-(e&1)}function hP(e){var r=0,t={},n=fP(cP),i;try{for(n.s();!(i=n.n()).done;){var a=D(i.value,2),o=a[0],s=a[1],u=s===8?e.getFloat64:e.getFloat32;t[o]=u.call(e,r,!0),r+=s}}catch(f){n.e(f)}finally{n.f()}return{header:t,headerEndPosition:r}}function dP(e,r){var t=r,n=3,i=e.getUint32(t,!0),a=new Uint16Array(i*n);t+=Uint32Array.BYTES_PER_ELEMENT;for(var o=Uint16Array.BYTES_PER_ELEMENT,s=i*o,u=t,f=u+s,l=f+s,h=0,d=0,p=0,m=0;m<i;m++)h+=cd(e.getUint16(u+o*m,!0)),d+=cd(e.getUint16(f+o*m,!0)),p+=cd(e.getUint16(l+o*m,!0)),a[m]=h,a[m+i]=d,a[m+i*2]=p;return t+=s*3,{vertexData:a,vertexDataEndPosition:t}}function Oa(e,r,t,n){var i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,a;if(n===2?a=new Uint16Array(e,r,t):a=new Uint32Array(e,r,t),!i)return a;for(var o=0,s=0;s<a.length;++s){var u=a[s];a[s]=o-u,u===0&&++o}return a}function pP(e,r,t){var n=t,i=3,a=r.length/i,o=a>65536?Uint32Array.BYTES_PER_ELEMENT:Uint16Array.BYTES_PER_ELEMENT;n%o!==0&&(n+=o-n%o);var s=e.getUint32(n,!0);n+=Uint32Array.BYTES_PER_ELEMENT;var u=s*3,f=Oa(e.buffer,n,u,o);return n+=u*o,{triangleIndicesEndPosition:n,triangleIndices:f}}function mP(e,r,t){var n=t,i=3,a=r.length/i,o=a>65536?Uint32Array.BYTES_PER_ELEMENT:Uint16Array.BYTES_PER_ELEMENT,s=e.getUint32(n,!0);n+=Uint32Array.BYTES_PER_ELEMENT;var u=Oa(e.buffer,n,s,o,!1);n+=s*o;var f=e.getUint32(n,!0);n+=Uint32Array.BYTES_PER_ELEMENT;var l=Oa(e.buffer,n,f,o,!1);n+=f*o;var h=e.getUint32(n,!0);n+=Uint32Array.BYTES_PER_ELEMENT;var d=Oa(e.buffer,n,h,o,!1);n+=h*o;var p=e.getUint32(n,!0);n+=Uint32Array.BYTES_PER_ELEMENT;var m=Oa(e.buffer,n,p,o,!1);return n+=p*o,{edgeIndicesEndPosition:n,westIndices:u,southIndices:l,eastIndices:d,northIndices:m}}function vP(e){return new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}function gP(e){return e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength)}function yP(e,r){var t={};if(e.byteLength<=r)return{extensions:t,extensionsEndPosition:r};for(var n=r;n<e.byteLength;){var i=e.getUint8(n,!0);n+=Uint8Array.BYTES_PER_ELEMENT;var a=e.getUint32(n,!0);n+=Uint32Array.BYTES_PER_ELEMENT;var o=new DataView(e.buffer,n,a);switch(i){case 1:{t.vertexNormals=vP(o);break}case 2:{t.waterMask=gP(o);break}default:}n+=a}return{extensions:t,extensionsEndPosition:n}}var Mn={header:0,vertices:1,triangleIndices:2,edgeIndices:3,extensions:4},AP={maxDecodingStep:Mn.extensions};function hd(e,r){var t=Object.assign({},AP,r),n=new DataView(e),i=hP(n),a=i.header,o=i.headerEndPosition;if(t.maxDecodingStep<Mn.vertices)return{header:a};var s=dP(n,o),u=s.vertexData,f=s.vertexDataEndPosition;if(t.maxDecodingStep<Mn.triangleIndices)return{header:a,vertexData:u};var l=pP(n,u,f),h=l.triangleIndices,d=l.triangleIndicesEndPosition;if(t.maxDecodingStep<Mn.edgeIndices)return{header:a,vertexData:u,triangleIndices:h};var p=mP(n,u,d),m=p.westIndices,v=p.southIndices,g=p.eastIndices,y=p.northIndices,A=p.edgeIndicesEndPosition;if(t.maxDecodingStep<Mn.extensions)return{header:a,vertexData:u,triangleIndices:h,westIndices:m,northIndices:y,eastIndices:g,southIndices:v};var x=yP(n,A),b=x.extensions;return{header:a,vertexData:u,triangleIndices:h,westIndices:m,northIndices:y,eastIndices:g,southIndices:v,extensions:b}}function Ks(e,r,t,n){for(var i=n?bP(n,e.POSITION.value):_P(r),a=new e.POSITION.value.constructor(i.length*6),o=new e.TEXCOORD_0.value.constructor(i.length*4),s=new r.constructor(i.length*6),u=0;u<i.length;u++){var f=i[u];TP({edge:f,edgeIndex:u,attributes:e,skirtHeight:t,newPosition:a,newTexcoord0:o,newTriangles:s})}e.POSITION.value=Pi(e.POSITION.value,a),e.TEXCOORD_0.value=Pi(e.TEXCOORD_0.value,o);var l=r instanceof Array?r.concat(s):Pi(r,s);return{attributes:e,triangles:l}}function _P(e){for(var r=[],t=0;t<e.length;t+=3)r.push([e[t],e[t+1]]),r.push([e[t+1],e[t+2]]),r.push([e[t+2],e[t]]);r.sort(function(s,u){return Math.min.apply(Math,K(s))-Math.min.apply(Math,K(u))||Math.max.apply(Math,K(s))-Math.max.apply(Math,K(u))});for(var n=[],i=0;i<r.length;){var a,o;r[i][0]===((a=r[i+1])===null||a===void 0?void 0:a[1])&&r[i][1]===((o=r[i+1])===null||o===void 0?void 0:o[0])?i+=2:(n.push(r[i]),i++)}return n}function bP(e,r){e.westIndices.sort(function(o,s){return r[3*o+1]-r[3*s+1]}),e.eastIndices.sort(function(o,s){return r[3*s+1]-r[3*o+1]}),e.southIndices.sort(function(o,s){return r[3*s]-r[3*o]}),e.northIndices.sort(function(o,s){return r[3*o]-r[3*s]});var t=[];for(var n in e)for(var i=e[n],a=0;a<i.length-1;a++)t.push([i[a],i[a+1]]);return t}function TP(e){var r=e.edge,t=e.edgeIndex,n=e.attributes,i=e.skirtHeight,a=e.newPosition,o=e.newTexcoord0,s=e.newTriangles,u=n.POSITION.value.length,f=t*2,l=t*2+1;a.set(n.POSITION.value.subarray(r[0]*3,r[0]*3+3),f*3),a[f*3+2]=a[f*3+2]-i,a.set(n.POSITION.value.subarray(r[1]*3,r[1]*3+3),l*3),a[l*3+2]=a[l*3+2]-i,o.set(n.TEXCOORD_0.value.subarray(r[0]*2,r[0]*2+2),f*2),o.set(n.TEXCOORD_0.value.subarray(r[1]*2,r[1]*2+2),l*2);var h=t*2*3;s[h]=r[0],s[h+1]=u/3+l,s[h+2]=r[1],s[h+3]=u/3+l,s[h+4]=r[0],s[h+5]=u/3+f}function xP(e,r,t){for(var n=r.minHeight,i=r.maxHeight,a=t||[0,0,1,1],o=D(a,4),s=o[0],u=o[1],f=o[2],l=o[3],h=f-s,d=l-u,p=i-n,m=e.length/3,v=new Float32Array(m*3),g=new Float32Array(m*2),y=0;y<m;y++){var A=e[y]/32767,x=e[y+m]/32767,b=e[y+m*2]/32767;v[3*y+0]=A*h+s,v[3*y+1]=x*d+u,v[3*y+2]=b*p+n,g[2*y+0]=A,g[2*y+1]=x}return{POSITION:{value:v,size:3},TEXCOORD_0:{value:g,size:2}}}function EP(e,r){if(!e)return null;var t=r.bounds,n=hd(e,Mn.triangleIndices),i=n.header,a=n.vertexData,o=n.triangleIndices,s=n.westIndices,u=n.northIndices,f=n.eastIndices,l=n.southIndices,h=o,d=xP(a,i,t),p=vn(d);if(r.skirtHeight){var m=Ks(d,h,r.skirtHeight,{westIndices:s,northIndices:u,eastIndices:f,southIndices:l}),v=m.attributes,g=m.triangles;d=v,h=g}return{loaderData:{header:{}},header:{vertexCount:h.length,boundingBox:p},mode:4,indices:{value:h,size:1},attributes:d}}function Ys(e,r){return EP(e,r["quantized-mesh"])}N();ue();var pd=X(re());var Pa=class{constructor(r=257){this.gridSize=r;let t=r-1;if(t&t-1)throw new Error(`Expected grid size to be 2^n+1, got ${r}.`);this.numTriangles=t*t*2-2,this.numParentTriangles=this.numTriangles-t*t,this.indices=new Uint32Array(this.gridSize*this.gridSize),this.coords=new Uint16Array(this.numTriangles*4);for(let n=0;n<this.numTriangles;n++){let i=n+2,a=0,o=0,s=0,u=0,f=0,l=0;for(i&1?s=u=f=t:a=o=l=t;(i>>=1)>1;){let d=a+s>>1,p=o+u>>1;i&1?(s=a,u=o,a=f,o=l):(a=s,o=u,s=f,u=l),f=d,l=p}let h=n*4;this.coords[h+0]=a,this.coords[h+1]=o,this.coords[h+2]=s,this.coords[h+3]=u}}createTile(r){return new dd(r,this)}},dd=class{constructor(r,t){let n=t.gridSize;if(r.length!==n*n)throw new Error(`Expected terrain data of length ${n*n} (${n} x ${n}), got ${r.length}.`);this.terrain=r,this.martini=t,this.errors=new Float32Array(r.length),this.update()}update(){let{numTriangles:r,numParentTriangles:t,coords:n,gridSize:i}=this.martini,{terrain:a,errors:o}=this;for(let s=r-1;s>=0;s--){let u=s*4,f=n[u+0],l=n[u+1],h=n[u+2],d=n[u+3],p=f+h>>1,m=l+d>>1,v=p+m-l,g=m+f-p,y=(a[l*i+f]+a[d*i+h])/2,A=m*i+p,x=Math.abs(y-a[A]);if(o[A]=Math.max(o[A],x),s<t){let b=(l+g>>1)*i+(f+v>>1),M=(d+g>>1)*i+(h+v>>1);o[A]=Math.max(o[A],o[b],o[M])}}}getMesh(r=0){let{gridSize:t,indices:n}=this.martini,{errors:i}=this,a=0,o=0,s=t-1;n.fill(0);function u(p,m,v,g,y,A){let x=p+v>>1,b=m+g>>1;Math.abs(p-y)+Math.abs(m-A)>1&&i[b*t+x]>r?(u(y,A,p,m,x,b),u(v,g,y,A,x,b)):(n[m*t+p]=n[m*t+p]||++a,n[g*t+v]=n[g*t+v]||++a,n[A*t+y]=n[A*t+y]||++a,o++)}u(0,0,s,s,s,0),u(s,s,0,0,0,s);let f=new Uint16Array(a*2),l=new Uint32Array(o*3),h=0;function d(p,m,v,g,y,A){let x=p+v>>1,b=m+g>>1;if(Math.abs(p-y)+Math.abs(m-A)>1&&i[b*t+x]>r)d(y,A,p,m,x,b),d(v,g,y,A,x,b);else{let M=n[m*t+p]-1,C=n[g*t+v]-1,F=n[A*t+y]-1;f[2*M]=p,f[2*M+1]=m,f[2*C]=v,f[2*C+1]=g,f[2*F]=y,f[2*F+1]=A,l[h++]=M,l[h++]=C,l[h++]=F}}return d(0,0,s,s,s,0),d(s,s,0,0,0,s),{vertices:f,triangles:l}}};q();Y();var F_=function(){function e(r,t){T(this,e);var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:t;this.data=r,this.width=t,this.height=n,this.coords=[],this.triangles=[],this._halfedges=[],this._candidates=[],this._queueIndices=[],this._queue=[],this._errors=[],this._rms=[],this._pending=[],this._pendingLen=0,this._rmsSum=0;var i=t-1,a=n-1,o=this._addPoint(0,0),s=this._addPoint(i,0),u=this._addPoint(0,a),f=this._addPoint(i,a),l=this._addTriangle(f,o,u,-1,-1,-1);this._addTriangle(o,f,s,l,-1,-1),this._flush()}return w(e,[{key:"run",value:function(){for(var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1;this.getMaxError()>t;)this.refine()}},{key:"refine",value:function(){this._step(),this._flush()}},{key:"getMaxError",value:function(){return this._errors[0]}},{key:"getRMSD",value:function(){return this._rmsSum>0?Math.sqrt(this._rmsSum/(this.width*this.height)):0}},{key:"heightAt",value:function(t,n){return this.data[this.width*n+t]}},{key:"_flush",value:function(){for(var t=this.coords,n=0;n<this._pendingLen;n++){var i=this._pending[n],a=2*this.triangles[i*3+0],o=2*this.triangles[i*3+1],s=2*this.triangles[i*3+2];this._findCandidate(t[a],t[a+1],t[o],t[o+1],t[s],t[s+1],i)}this._pendingLen=0}},{key:"_findCandidate",value:function(t,n,i,a,o,s,u){for(var f=Math.min(t,i,o),l=Math.min(n,a,s),h=Math.max(t,i,o),d=Math.max(n,a,s),p=On(i,a,o,s,f,l),m=On(o,s,t,n,f,l),v=On(t,n,i,a,f,l),g=a-n,y=t-i,A=s-a,x=i-o,b=n-s,M=o-t,C=On(t,n,i,a,o,s),F=this.heightAt(t,n)/C,B=this.heightAt(i,a)/C,S=this.heightAt(o,s)/C,_=0,R=0,k=0,U=0,j=l;j<=d;j++){var Z=0;p<0&&A!==0&&(Z=Math.max(Z,Math.floor(-p/A))),m<0&&b!==0&&(Z=Math.max(Z,Math.floor(-m/b))),v<0&&g!==0&&(Z=Math.max(Z,Math.floor(-v/g)));for(var P=p+A*Z,O=m+b*Z,G=v+g*Z,J=!1,V=f+Z;V<=h;V++){if(P>=0&&O>=0&&G>=0){J=!0;var ee=F*P+B*O+S*G,ie=Math.abs(ee-this.heightAt(V,j));U+=ie*ie,ie>_&&(_=ie,R=V,k=j)}else if(J)break;P+=A,O+=b,G+=g}p+=x,m+=M,v+=y}(R===t&&k===n||R===i&&k===a||R===o&&k===s)&&(_=0),this._candidates[2*u]=R,this._candidates[2*u+1]=k,this._rms[u]=U,this._queuePush(u,_,U)}},{key:"_step",value:function(){var t=this._queuePop(),n=t*3+0,i=t*3+1,a=t*3+2,o=this.triangles[n],s=this.triangles[i],u=this.triangles[a],f=this.coords[2*o],l=this.coords[2*o+1],h=this.coords[2*s],d=this.coords[2*s+1],p=this.coords[2*u],m=this.coords[2*u+1],v=this._candidates[2*t],g=this._candidates[2*t+1],y=this._addPoint(v,g);if(On(f,l,h,d,v,g)===0)this._handleCollinear(y,n);else if(On(h,d,p,m,v,g)===0)this._handleCollinear(y,i);else if(On(p,m,f,l,v,g)===0)this._handleCollinear(y,a);else{var A=this._halfedges[n],x=this._halfedges[i],b=this._halfedges[a],M=this._addTriangle(o,s,y,A,-1,-1,n),C=this._addTriangle(s,u,y,x,-1,M+1),F=this._addTriangle(u,o,y,b,M+2,C+1);this._legalize(M),this._legalize(C),this._legalize(F)}}},{key:"_addPoint",value:function(t,n){var i=this.coords.length>>1;return this.coords.push(t,n),i}},{key:"_addTriangle",value:function(t,n,i,a,o,s){var u=arguments.length>6&&arguments[6]!==void 0?arguments[6]:this.triangles.length,f=u/3;return this.triangles[u+0]=t,this.triangles[u+1]=n,this.triangles[u+2]=i,this._halfedges[u+0]=a,this._halfedges[u+1]=o,this._halfedges[u+2]=s,a>=0&&(this._halfedges[a]=u+0),o>=0&&(this._halfedges[o]=u+1),s>=0&&(this._halfedges[s]=u+2),this._candidates[2*f+0]=0,this._candidates[2*f+1]=0,this._queueIndices[f]=-1,this._rms[f]=0,this._pending[this._pendingLen++]=f,u}},{key:"_legalize",value:function(t){var n=this._halfedges[t];if(!(n<0)){var i=t-t%3,a=n-n%3,o=i+(t+1)%3,s=i+(t+2)%3,u=a+(n+2)%3,f=a+(n+1)%3,l=this.triangles[s],h=this.triangles[t],d=this.triangles[o],p=this.triangles[u],m=this.coords;if(SP(m[2*l],m[2*l+1],m[2*h],m[2*h+1],m[2*d],m[2*d+1],m[2*p],m[2*p+1])){var v=this._halfedges[o],g=this._halfedges[s],y=this._halfedges[u],A=this._halfedges[f];this._queueRemove(i/3),this._queueRemove(a/3);var x=this._addTriangle(l,p,d,-1,y,v,i),b=this._addTriangle(p,l,h,x,g,A,a);this._legalize(x+1),this._legalize(b+2)}}}},{key:"_handleCollinear",value:function(t,n){var i=n-n%3,a=i+(n+1)%3,o=i+(n+2)%3,s=this.triangles[o],u=this.triangles[n],f=this.triangles[a],l=this._halfedges[a],h=this._halfedges[o],d=this._halfedges[n];if(d<0){var p=this._addTriangle(t,s,u,-1,h,-1,i),m=this._addTriangle(s,t,f,p,-1,l);this._legalize(p+1),this._legalize(m+2);return}var v=d-d%3,g=v+(d+2)%3,y=v+(d+1)%3,A=this.triangles[g],x=this._halfedges[g],b=this._halfedges[y];this._queueRemove(v/3);var M=this._addTriangle(s,u,t,h,-1,-1,i),C=this._addTriangle(u,A,t,b,-1,M+1,v),F=this._addTriangle(A,f,t,x,-1,C+1),B=this._addTriangle(f,s,t,l,M+2,F+1);this._legalize(M),this._legalize(C),this._legalize(F),this._legalize(B)}},{key:"_queuePush",value:function(t,n,i){var a=this._queue.length;this._queueIndices[t]=a,this._queue.push(t),this._errors.push(n),this._rmsSum+=i,this._queueUp(a)}},{key:"_queuePop",value:function(){var t=this._queue.length-1;return this._queueSwap(0,t),this._queueDown(0,t),this._queuePopBack()}},{key:"_queuePopBack",value:function(){var t=this._queue.pop();return this._errors.pop(),this._rmsSum-=this._rms[t],this._queueIndices[t]=-1,t}},{key:"_queueRemove",value:function(t){var n=this._queueIndices[t];if(n<0){var i=this._pending.indexOf(t);if(i!==-1)this._pending[i]=this._pending[--this._pendingLen];else throw new Error("Broken triangulation (something went wrong).");return}var a=this._queue.length-1;a!==n&&(this._queueSwap(n,a),this._queueDown(n,a)||this._queueUp(n)),this._queuePopBack()}},{key:"_queueLess",value:function(t,n){return this._errors[t]>this._errors[n]}},{key:"_queueSwap",value:function(t,n){var i=this._queue[t],a=this._queue[n];this._queue[t]=a,this._queue[n]=i,this._queueIndices[i]=n,this._queueIndices[a]=t;var o=this._errors[t];this._errors[t]=this._errors[n],this._errors[n]=o}},{key:"_queueUp",value:function(t){for(var n=t;;){var i=n-1>>1;if(i===n||!this._queueLess(n,i))break;this._queueSwap(i,n),n=i}}},{key:"_queueDown",value:function(t,n){for(var i=t;;){var a=2*i+1;if(a>=n||a<0)break;var o=a+1,s=a;if(o<n&&this._queueLess(o,a)&&(s=o),!this._queueLess(s,i))break;this._queueSwap(i,s),i=s}return i>t}}]),e}();function On(e,r,t,n,i,a){return(t-i)*(r-a)-(n-a)*(e-i)}function SP(e,r,t,n,i,a,o,s){var u=e-o,f=r-s,l=t-o,h=n-s,d=i-o,p=a-s,m=u*u+f*f,v=l*l+h*h,g=d*d+p*p;return u*(h*g-v*p)-f*(l*g-v*d)+m*(l*p-h*d)<0}function L_(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),t.push.apply(t,n)}return t}function Zs(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{};r%2?L_(Object(t),!0).forEach(function(n){c(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):L_(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}function $s(e,r,t,n,i){for(var a=n.rScaler,o=n.bScaler,s=n.gScaler,u=n.offset,f=new Float32Array((r+1)*(t+1)),l=0,h=0;h<t;h++)for(var d=0;d<r;d++,l++){var p=l*4,m=e[p+0],v=e[p+1],g=e[p+2];f[l+h]=m*a+v*s+g*o+u}if(i==="martini"){for(var y=(r+1)*r,A=0;A<r;A++,y++)f[y]=f[y-r-1];for(var x=t,b=0;b<t+1;b++,x+=t+1)f[x]=f[x-1]}return f}function wP(e,r,t,n,i){for(var a=t+1,o=e.length/2,s=new Float32Array(o*3),u=new Float32Array(o*2),f=i||[0,0,t,n],l=D(f,4),h=l[0],d=l[1],p=l[2],m=l[3],v=(p-h)/t,g=(m-d)/n,y=0;y<o;y++){var A=e[y*2],x=e[y*2+1],b=x*a+A;s[3*y+0]=A*v+h,s[3*y+1]=-x*g+m,s[3*y+2]=r[b],u[2*y+0]=A/t,u[2*y+1]=x/n}return{POSITION:{value:s,size:3},TEXCOORD_0:{value:u,size:2}}}function CP(e,r){if(e===null)return null;var t=r.meshMaxError,n=r.bounds,i=r.elevationDecoder,a=e.data,o=e.width,s=e.height,u,f;switch(r.tesselator){case"martini":u=$s(a,o,s,i,r.tesselator),f=k_(t,o,u);break;case"delatin":u=$s(a,o,s,i,r.tesselator),f=D_(t,o,s,u);break;default:o===s&&!(s&o-1)?(u=$s(a,o,s,i,"martini"),f=k_(t,o,u)):(u=$s(a,o,s,i,"delatin"),f=D_(t,o,s,u));break}var l=f,h=l.vertices,d=f,p=d.triangles,m=wP(h,u,o,s,n),v=vn(m);if(r.skirtHeight){var g=Ks(m,p,r.skirtHeight),y=g.attributes,A=g.triangles;m=y,p=A}return{loaderData:{header:{}},header:{vertexCount:p.length,boundingBox:v},mode:4,indices:{value:Uint32Array.from(p),size:1},attributes:m}}function k_(e,r,t){var n=r+1,i=new Pa(n),a=i.createTile(t),o=a.getMesh(e),s=o.vertices,u=o.triangles;return{vertices:s,triangles:u}}function D_(e,r,t,n){var i=new F_(n,r+1,t+1);i.run(e);var a=i.coords,o=i.triangles,s=a;return{vertices:s,triangles:o}}function vd(e,r,t){return md.apply(this,arguments)}function md(){return md=I(pd.default.mark(function e(r,t,n){var i,a;return pd.default.wrap(function(s){for(;;)switch(s.prev=s.next){case 0:return i=Zs(Zs({},t),{},{mimeType:"application/x.image",image:Zs(Zs({},t.image),{},{type:"data"})}),s.next=3,n.parse(r,i);case 3:return a=s.sent,s.abrupt("return",CP(a,t.terrain));case 5:case"end":return s.stop()}},e)})),md.apply(this,arguments)}var Qs="3.4.13";var eu={name:"Terrain",id:"terrain",module:"terrain",version:Qs,worker:!0,extensions:["png","pngraw","jpg","jpeg","gif","webp","bmp"],mimeTypes:["image/png","image/jpeg","image/gif","image/webp","image/bmp"],options:{terrain:{tesselator:"auto",bounds:null,meshMaxError:10,elevationDecoder:{rScaler:1,gScaler:0,bScaler:0,offset:0},skirtHeight:null}}};var G_={name:"Quantized Mesh",id:"quantized-mesh",module:"terrain",version:Qs,worker:!0,extensions:["terrain"],mimeTypes:["application/vnd.quantized-mesh"],options:{"quantized-mesh":{bounds:[0,0,1,1],skirtHeight:null}}};function N_(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),t.push.apply(t,n)}return t}function tu(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{};r%2?N_(Object(t),!0).forEach(function(n){c(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):N_(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}var dte=tu(tu({},eu),{},{parse:vd});var pte=tu(tu({},G_),{},{parseSync:Ys,parse:function(){var e=I(gd.default.mark(function t(n,i){return gd.default.wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return o.abrupt("return",Ys(n,i));case 1:case"end":return o.stop()}},t)}));function r(t,n){return e.apply(this,arguments)}return r}()});function BP(e){var r=MP();return function(){var n=L(e),i;if(r){var a=L(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return $(this,i)}}function MP(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function U_(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),t.push.apply(t,n)}return t}function Nr(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{};r%2?U_(Object(t),!0).forEach(function(n){c(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):U_(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}var j_=[1],OP=Nr(Nr({},er.defaultProps),{},{elevationData:Er,texture:Nr(Nr({},Er),{},{optional:!0}),meshMaxError:{type:"number",value:4},bounds:{type:"array",value:null,optional:!0,compare:!0},color:{type:"color",value:[255,255,255]},elevationDecoder:{type:"object",value:{rScaler:1,gScaler:0,bScaler:0,offset:0}},workerUrl:"",wireframe:!1,material:!0,loaders:[eu]});function H_(e){return Array.isArray(e)?e.join(";"):e||""}var nu=function(e){H(t,e);var r=BP(t);function t(){var n;T(this,t);for(var i=arguments.length,a=new Array(i),o=0;o<i;o++)a[o]=arguments[o];return n=r.call.apply(r,[this].concat(a)),c(oe(n),"state",void 0),n}return w(t,[{key:"updateState",value:function(i){var a=i.props,o=i.oldProps,s=a.elevationData!==o.elevationData;if(s){var u=a.elevationData,f=u&&(Array.isArray(u)||u.includes("{x}")&&u.includes("{y}"));this.setState({isTiled:f})}var l=s||a.meshMaxError!==o.meshMaxError||a.elevationDecoder!==o.elevationDecoder||a.bounds!==o.bounds;if(!this.state.isTiled&&l){var h=this.loadTerrain(a);this.setState({terrain:h})}a.workerUrl&&ru.log.removed("workerUrl","loadOptions.terrain.workerUrl")()}},{key:"loadTerrain",value:function(i){var a,o=i.elevationData,s=i.bounds,u=i.elevationDecoder,f=i.meshMaxError,l=i.signal;if(!o)return null;var h=this.getLoadOptions();h=Nr(Nr({},h),{},{terrain:Nr(Nr({skirtHeight:this.state.isTiled?f*2:0},(a=h)===null||a===void 0?void 0:a.terrain),{},{bounds:s,meshMaxError:f,elevationDecoder:u})});var d=this.props.fetch;return d(o,{propName:"elevationData",layer:this,loadOptions:h,signal:l})}},{key:"getTiledTerrainData",value:function(i){var a=this.props,o=a.elevationData,s=a.fetch,u=a.texture,f=a.elevationDecoder,l=a.meshMaxError,h=this.context.viewport,d=jt(o,i),p=u&&jt(u,i),m=i.signal,v=[0,0],g=[0,0];if(h.isGeospatial){var y=i.bbox;v=h.projectFlat([y.west,y.south]),g=h.projectFlat([y.east,y.north])}else{var A=i.bbox;v=[A.left,A.bottom],g=[A.right,A.top]}var x=[v[0],v[1],g[0],g[1]],b=this.loadTerrain({elevationData:d,bounds:x,elevationDecoder:f,meshMaxError:l,signal:m}),M=p?s(p,{propName:"texture",layer:this,loaders:[],signal:m}).catch(function(C){return null}):Promise.resolve(null);return Promise.all([b,M])}},{key:"renderSubLayers",value:function(i){var a=this.getSubLayerClass("mesh",yd.SimpleMeshLayer),o=this.props,s=o.color,u=o.wireframe,f=o.material,l=i.data;if(!l)return null;var h=D(l,2),d=h[0],p=h[1];return new a(i,{data:j_,mesh:d,texture:p,_instanced:!1,coordinateSystem:V_.COORDINATE_SYSTEM.CARTESIAN,getPosition:function(v){return[0,0,0]},getColor:s,wireframe:u,material:f})}},{key:"onViewportLoad",value:function(i){if(i){var a=this.state.zRange,o=i.map(function(f){return f.content}).filter(Boolean).map(function(f){var l=f[0].header.boundingBox;return l.map(function(h){return h[2]})});if(o.length!==0){var s=Math.min.apply(Math,K(o.map(function(f){return f[0]}))),u=Math.max.apply(Math,K(o.map(function(f){return f[1]})));(!a||s<a[0]||u>a[1])&&this.setState({zRange:[s,u]})}}}},{key:"renderLayers",value:function(){var i=this.props,a=i.color,o=i.material,s=i.elevationData,u=i.texture,f=i.wireframe,l=i.meshMaxError,h=i.elevationDecoder,d=i.tileSize,p=i.maxZoom,m=i.minZoom,v=i.extent,g=i.maxRequests,y=i.onTileLoad,A=i.onTileUnload,x=i.onTileError,b=i.maxCacheSize,M=i.maxCacheByteSize,C=i.refinementStrategy;if(this.state.isTiled)return new er(this.getSubLayerProps({id:"tiles"}),{getTileData:this.getTiledTerrainData.bind(this),renderSubLayers:this.renderSubLayers.bind(this),updateTriggers:{getTileData:{elevationData:H_(s),texture:H_(u),meshMaxError:l,elevationDecoder:h}},onViewportLoad:this.onViewportLoad.bind(this),zRange:this.state.zRange||null,tileSize:d,maxZoom:p,minZoom:m,extent:v,maxRequests:g,onTileLoad:y,onTileUnload:A,onTileError:x,maxCacheSize:b,maxCacheByteSize:M,refinementStrategy:C});var F=this.getSubLayerClass("mesh",yd.SimpleMeshLayer);return new F(this.getSubLayerProps({id:"mesh"}),{data:j_,mesh:this.state.terrain,texture:u,_instanced:!1,getPosition:function(S){return[0,0,0]},getColor:a,material:o,wireframe:f})}}]),t}(ru.CompositeLayer);c(nu,"defaultProps",OP);c(nu,"layerName","TerrainLayer");q();Y();N();var Hd=X(re()),mu=X(xt()),Vd=X(Tt()),qb=X(W_());N();var Dd=X(re());ue();N();q();Y();N();function Ad(e,r){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},n=J_(e,t);return n!==r?(PP(e,t),!0):!1}function J_(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return Math.sign(hr(e,r))}function hr(e){for(var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=r.start,n=t===void 0?0:t,i=r.end,a=i===void 0?e.length:i,o=r.size||2,s=0,u=n,f=a-o;u<a;u+=o)s+=(e[u]-e[f])*(e[u+1]+e[f+1]),f=u;return s/2}function _d(e,r){for(var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},n=t.start,i=n===void 0?0:n,a=t.end,o=a===void 0?e.length:a,s=t.size,u=s===void 0?2:s,f=t.isClosed,l=(o-i)/u,h=0;h<l-1;++h)r(e[i+h*u],e[i+h*u+1],e[i+(h+1)*u],e[i+(h+1)*u+1],h,h+1);var d=i+(l-1)*u,p=f||He(e[i],e[d])&&He(e[i+1],e[d+1]);p||r(e[d],e[d+1],e[i],e[i+1],l-1,0)}function PP(e,r){for(var t=r.start,n=t===void 0?0:t,i=r.end,a=i===void 0?e.length:i,o=r.size,s=o===void 0?2:o,u=(a-n)/s,f=Math.floor(u/2),l=0;l<f;++l)for(var h=n+l*s,d=n+(u-1-l)*s,p=0;p<s;++p){var m=e[h+p];e[h+p]=e[d+p],e[d+p]=m}}function X_(e,r){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},n=IP(e,t);return n!==r?(e.reverse(),!0):!1}function IP(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return Math.sign(bd(e,r))}function bd(e){for(var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=r.start,n=t===void 0?0:t,i=r.end,a=i===void 0?e.length:i,o=0,s=n,u=a-1;s<a;++s)o+=(e[s][0]-e[u][0])*(e[s][1]+e[u][1]),u=s;return o/2}function q_(e,r){for(var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},n=t.start,i=n===void 0?0:n,a=t.end,o=a===void 0?e.length:a,s=t.isClosed,u=i;u<o-1;++u)r(e[u],e[u+1],u,u+1);var f=s||He(e[o-1],e[0]);f||r(e[o-1],e[0],o-1,0)}var K_=function(){function e(r){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};T(this,e),c(this,"points",void 0),c(this,"isFlatArray",void 0),c(this,"options",void 0),this.points=r,this.isFlatArray=!Qe(r[0]),this.options={start:t.start||0,end:t.end||r.length,size:t.size||2,isClosed:t.isClosed},Object.freeze(this)}return w(e,[{key:"getSignedArea",value:function(){return this.isFlatArray?hr(this.points,this.options):bd(this.points,this.options)}},{key:"getArea",value:function(){return Math.abs(this.getSignedArea())}},{key:"getWindingDirection",value:function(){return Math.sign(this.getSignedArea())}},{key:"forEachSegment",value:function(t){this.isFlatArray?_d(this.points,function(n,i,a,o,s,u){t([n,i],[a,o],s,u)},this.options):q_(this.points,t,this.options)}},{key:"modifyWindingDirection",value:function(t){return this.isFlatArray?Ad(this.points,t,this.options):X_(this.points,t,this.options)}}]),e}();function Ed(e,r){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:2,n=arguments.length>3?arguments[3]:void 0,i=r&&r.length,a=i?r[0]*t:e.length,o=Z_(e,0,a,t,!0,n&&n[0]),s=[];if(!o||o.next===o.prev)return s;var u,f,l,h,d,p,m;if(i&&(o=DP(e,r,o,t,n)),e.length>80*t){h=f=e[0],d=l=e[1];for(var v=t;v<a;v+=t)p=e[v],m=e[v+1],p<h&&(h=p),m<d&&(d=m),p>f&&(f=p),m>l&&(l=m);u=Math.max(f-h,l-d),u=u!==0?1/u:0}return Ia(o,s,t,h,d,u),s}function Z_(e,r,t,n,i,a){var o,s;if(a===void 0&&(a=hr(e,{start:r,end:t,size:n})),i===a<0)for(o=r;o<t;o+=n)s=Y_(o,e[o],e[o+1],s);else for(o=t-n;o>=r;o-=n)s=Y_(o,e[o],e[o+1],s);return s&&ou(s,s.next)&&(Fa(s),s=s.next),s}function Ur(e,r){if(!e)return e;r||(r=e);var t=e,n;do if(n=!1,!t.steiner&&(ou(t,t.next)||Ie(t.prev,t,t.next)===0)){if(Fa(t),t=r=t.prev,t===t.next)break;n=!0}else t=t.next;while(n||t!==r);return r}function Ia(e,r,t,n,i,a,o){if(e){!o&&a&&HP(e,n,i,a);for(var s=e,u,f;e.prev!==e.next;){if(u=e.prev,f=e.next,a?FP(e,n,i,a):RP(e)){r.push(u.i/t),r.push(e.i/t),r.push(f.i/t),Fa(e),e=f.next,s=f.next;continue}if(e=f,e===s){o?o===1?(e=LP(Ur(e),r,t),Ia(e,r,t,n,i,a,2)):o===2&&kP(e,r,t,n,i,a):Ia(Ur(e),r,t,n,i,a,1);break}}}}function RP(e){var r=e.prev,t=e,n=e.next;if(Ie(r,t,n)>=0)return!1;for(var i=e.next.next;i!==e.prev;){if(Ti(r.x,r.y,t.x,t.y,n.x,n.y,i.x,i.y)&&Ie(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}function FP(e,r,t,n){var i=e.prev,a=e,o=e.next;if(Ie(i,a,o)>=0)return!1;for(var s=i.x<a.x?i.x<o.x?i.x:o.x:a.x<o.x?a.x:o.x,u=i.y<a.y?i.y<o.y?i.y:o.y:a.y<o.y?a.y:o.y,f=i.x>a.x?i.x>o.x?i.x:o.x:a.x>o.x?a.x:o.x,l=i.y>a.y?i.y>o.y?i.y:o.y:a.y>o.y?a.y:o.y,h=Td(s,u,r,t,n),d=Td(f,l,r,t,n),p=e.prevZ,m=e.nextZ;p&&p.z>=h&&m&&m.z<=d;){if(p!==e.prev&&p!==e.next&&Ti(i.x,i.y,a.x,a.y,o.x,o.y,p.x,p.y)&&Ie(p.prev,p,p.next)>=0||(p=p.prevZ,m!==e.prev&&m!==e.next&&Ti(i.x,i.y,a.x,a.y,o.x,o.y,m.x,m.y)&&Ie(m.prev,m,m.next)>=0))return!1;m=m.nextZ}for(;p&&p.z>=h;){if(p!==e.prev&&p!==e.next&&Ti(i.x,i.y,a.x,a.y,o.x,o.y,p.x,p.y)&&Ie(p.prev,p,p.next)>=0)return!1;p=p.prevZ}for(;m&&m.z<=d;){if(m!==e.prev&&m!==e.next&&Ti(i.x,i.y,a.x,a.y,o.x,o.y,m.x,m.y)&&Ie(m.prev,m,m.next)>=0)return!1;m=m.nextZ}return!0}function LP(e,r,t){var n=e;do{var i=n.prev,a=n.next.next;!ou(i,a)&&$_(i,n,n.next,a)&&Ra(i,a)&&Ra(a,i)&&(r.push(i.i/t),r.push(n.i/t),r.push(a.i/t),Fa(n),Fa(n.next),n=e=a),n=n.next}while(n!==e);return Ur(n)}function kP(e,r,t,n,i,a){var o=e;do{for(var s=o.next.next;s!==o.prev;){if(o.i!==s.i&&WP(o,s)){var u=Q_(o,s);o=Ur(o,o.next),u=Ur(u,u.next),Ia(o,r,t,n,i,a),Ia(u,r,t,n,i,a);return}s=s.next}o=o.next}while(o!==e)}function DP(e,r,t,n,i){var a=[],o,s,u,f,l;for(o=0,s=r.length;o<s;o++)u=r[o]*n,f=o<s-1?r[o+1]*n:e.length,l=Z_(e,u,f,n,!1,i&&i[o+1]),l===l.next&&(l.steiner=!0),a.push(zP(l));for(a.sort(GP),o=0;o<a.length;o++)NP(a[o],t),t=Ur(t,t.next);return t}function GP(e,r){return e.x-r.x}function NP(e,r){if(r=UP(e,r),r){var t=Q_(r,e);Ur(r,r.next),Ur(t,t.next)}}function UP(e,r){var t=r,n=e.x,i=e.y,a=-1/0,o;do{if(i<=t.y&&i>=t.next.y&&t.next.y!==t.y){var s=t.x+(i-t.y)*(t.next.x-t.x)/(t.next.y-t.y);if(s<=n&&s>a){if(a=s,s===n){if(i===t.y)return t;if(i===t.next.y)return t.next}o=t.x<t.next.x?t:t.next}}t=t.next}while(t!==r);if(!o)return null;if(n===a)return o;var u=o,f=o.x,l=o.y,h=1/0,d;t=o;do n>=t.x&&t.x>=f&&n!==t.x&&Ti(i<l?n:a,i,f,l,i<l?a:n,i,t.x,t.y)&&(d=Math.abs(i-t.y)/(n-t.x),Ra(t,e)&&(d<h||d===h&&(t.x>o.x||t.x===o.x&&jP(o,t)))&&(o=t,h=d)),t=t.next;while(t!==u);return o}function jP(e,r){return Ie(e.prev,e,r.prev)<0&&Ie(r.next,e,e.next)<0}function HP(e,r,t,n){var i=e;do i.z===null&&(i.z=Td(i.x,i.y,r,t,n)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next;while(i!==e);i.prevZ.nextZ=null,i.prevZ=null,VP(i)}function VP(e){var r,t,n=1,i,a,o,s,u,f;do{for(a=e,e=null,f=null,i=0;a;){for(i++,s=a,o=0,t=0;t<n&&(o++,s=s.nextZ,!!s);t++);for(u=n;o>0||u>0&&s;)o!==0&&(u===0||!s||a.z<=s.z)?(r=a,a=a.nextZ,o--):(r=s,s=s.nextZ,u--),f?f.nextZ=r:e=r,r.prevZ=f,f=r;a=s}f.nextZ=null,n*=2}while(i>1);return e}function Td(e,r,t,n,i){return e=32767*(e-t)*i,r=32767*(r-n)*i,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,r=(r|r<<8)&16711935,r=(r|r<<4)&252645135,r=(r|r<<2)&858993459,r=(r|r<<1)&1431655765,e|r<<1}function zP(e){var r=e,t=e;do(r.x<t.x||r.x===t.x&&r.y<t.y)&&(t=r),r=r.next;while(r!==e);return t}function Ti(e,r,t,n,i,a,o,s){return(i-o)*(r-s)-(e-o)*(a-s)>=0&&(e-o)*(n-s)-(t-o)*(r-s)>=0&&(t-o)*(a-s)-(i-o)*(n-s)>=0}function WP(e,r){return e.next.i!==r.i&&e.prev.i!==r.i&&!JP(e,r)&&(Ra(e,r)&&Ra(r,e)&&XP(e,r)&&(Ie(e.prev,e,r.prev)||Ie(e,r.prev,r))||ou(e,r)&&Ie(e.prev,e,e.next)>0&&Ie(r.prev,r,r.next)>0)}function Ie(e,r,t){return(r.y-e.y)*(t.x-r.x)-(r.x-e.x)*(t.y-r.y)}function ou(e,r){return e.x===r.x&&e.y===r.y}function $_(e,r,t,n){var i=au(Ie(e,r,t)),a=au(Ie(e,r,n)),o=au(Ie(t,n,e)),s=au(Ie(t,n,r));return!!(i!==a&&o!==s||i===0&&iu(e,t,r)||a===0&&iu(e,n,r)||o===0&&iu(t,e,n)||s===0&&iu(t,r,n))}function iu(e,r,t){return r.x<=Math.max(e.x,t.x)&&r.x>=Math.min(e.x,t.x)&&r.y<=Math.max(e.y,t.y)&&r.y>=Math.min(e.y,t.y)}function au(e){return e>0?1:e<0?-1:0}function JP(e,r){var t=e;do{if(t.i!==e.i&&t.next.i!==e.i&&t.i!==r.i&&t.next.i!==r.i&&$_(t,t.next,e,r))return!0;t=t.next}while(t!==e);return!1}function Ra(e,r){return Ie(e.prev,e,e.next)<0?Ie(e,r,e.next)>=0&&Ie(e,e.prev,r)>=0:Ie(e,r,e.prev)<0||Ie(e,e.next,r)<0}function XP(e,r){var t=e,n=!1,i=(e.x+r.x)/2,a=(e.y+r.y)/2;do t.y>a!=t.next.y>a&&t.next.y!==t.y&&i<(t.next.x-t.x)*(a-t.y)/(t.next.y-t.y)+t.x&&(n=!n),t=t.next;while(t!==e);return n}function Q_(e,r){var t=new xd(e.i,e.x,e.y),n=new xd(r.i,r.x,r.y),i=e.next,a=r.prev;return e.next=r,r.prev=e,t.next=i,i.prev=t,n.next=t,t.prev=n,a.next=n,n.prev=a,n}function Y_(e,r,t,n){var i=new xd(e,r,t);return n?(i.next=n.next,i.prev=n,n.next.prev=i,n.next=i):(i.prev=i,i.next=i),i}function Fa(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function xd(e,r,t){this.i=e,this.x=r,this.y=t,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function Cd(e,r){var t=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=ZP(e))||r&&e&&typeof e.length=="number"){t&&(e=t);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(f){throw f},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
185
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){t=t.call(e)},n:function(){var f=t.next();return a=f.done,f},e:function(f){o=!0,s=f},f:function(){try{!a&&t.return!=null&&t.return()}finally{if(o)throw s}}}}function _3(e,r){if(e){if(typeof e=="string")return XA(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);if(t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set")return Array.from(e);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return XA(e,r)}}function XA(e,r){(r==null||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function KA(e,r){return gh.apply(this,arguments)}function gh(){return gh=I(lr.default.mark(function e(r,t){var n,i,a,o,s,u,f,l,h,d,p=arguments;return lr.default.wrap(function(v){for(;;)switch(v.prev=v.next){case 0:if(s=p.length>2&&p[2]!==void 0?p[2]:0,u=p.length>3?p[3]:void 0,f=p.length>4?p[4]:void 0,b3(r,t,s,u),HA(r,{normalize:u==null||(n=u.gltf)===null||n===void 0?void 0:n.normalize}),LA(r,u,f),l=[],!(u!=null&&(i=u.gltf)!==null&&i!==void 0&&i.loadBuffers&&r.json.buffers)){v.next=10;break}return v.next=10,T3(r,u,f);case 10:return u!=null&&(a=u.gltf)!==null&&a!==void 0&&a.loadImages&&(h=x3(r,u,f),l.push(h)),d=kA(r,u,f),l.push(d),v.next=15,Promise.all(l);case 15:return v.abrupt("return",u!=null&&(o=u.gltf)!==null&&o!==void 0&&o.postProcess?zA(r,u):r);case 16:case"end":return v.stop()}},e)})),gh.apply(this,arguments)}function b3(e,r,t,n){if(n.uri&&(e.baseUri=n.uri),r instanceof ArrayBuffer&&!JA(r,t,n)){var i=new TextDecoder;r=i.decode(r)}if(typeof r=="string")e.json=Gu(r);else if(r instanceof ArrayBuffer){var a={};t=vh(a,r,t,n.glb),Ve(a.type==="glTF","Invalid GLB magic string ".concat(a.type)),e._glb=a,e.json=a.json}else Ve(!1,"GLTF: must be ArrayBuffer or string");var o=e.json.buffers||[];if(e.buffers=new Array(o.length).fill(null),e._glb&&e._glb.header.hasBinChunk){var s=e._glb.binChunks;e.buffers[0]={arrayBuffer:s[0].arrayBuffer,byteOffset:s[0].byteOffset,byteLength:s[0].byteLength}}var u=e.json.images||[];e.images=new Array(u.length).fill({})}function T3(e,r,t){return yh.apply(this,arguments)}function yh(){return yh=I(lr.default.mark(function e(r,t,n){var i,a,o,s,u,f,l,h,d;return lr.default.wrap(function(m){for(;;)switch(m.prev=m.next){case 0:i=r.json.buffers||[],a=0;case 2:if(!(a<i.length)){m.next=22;break}if(o=i[a],!o.uri){m.next=18;break}return f=n.fetch,Ve(f),l=Ic(o.uri,t),m.next=10,n==null||(s=n.fetch)===null||s===void 0?void 0:s.call(n,l);case 10:return h=m.sent,m.next=13,h==null||(u=h.arrayBuffer)===null||u===void 0?void 0:u.call(h);case 13:d=m.sent,r.buffers[a]={arrayBuffer:d,byteOffset:0,byteLength:d.byteLength},delete o.uri,m.next=19;break;case 18:r.buffers[a]===null&&(r.buffers[a]={arrayBuffer:new ArrayBuffer(o.byteLength),byteOffset:0,byteLength:o.byteLength});case 19:++a,m.next=2;break;case 22:case"end":return m.stop()}},e)})),yh.apply(this,arguments)}function x3(e,r,t){return Ah.apply(this,arguments)}function Ah(){return Ah=I(lr.default.mark(function e(r,t,n){var i,a,o,s,u,f;return lr.default.wrap(function(h){for(;;)switch(h.prev=h.next){case 0:i=E3(r),a=r.json.images||[],o=[],s=qA(i);try{for(s.s();!(u=s.n()).done;)f=u.value,o.push(S3(r,a[f],f,t,n))}catch(d){s.e(d)}finally{s.f()}return h.next=7,Promise.all(o);case 7:return h.abrupt("return",h.sent);case 8:case"end":return h.stop()}},e)})),Ah.apply(this,arguments)}function E3(e){var r=new Set,t=e.json.textures||[],n=qA(t),i;try{for(n.s();!(i=n.n()).done;){var a=i.value;a.source!==void 0&&r.add(a.source)}}catch(o){n.e(o)}finally{n.f()}return Array.from(r).sort()}function S3(e,r,t,n,i){return _h.apply(this,arguments)}function _h(){return _h=I(lr.default.mark(function e(r,t,n,i,a){var o,s,u,f,l,h,d;return lr.default.wrap(function(m){for(;;)switch(m.prev=m.next){case 0:if(o=a.fetch,s=a.parse,!(t.uri&&!t.hasOwnProperty("bufferView"))){m.next=10;break}return f=Ic(t.uri,i),m.next=5,o(f);case 5:return l=m.sent,m.next=8,l.arrayBuffer();case 8:u=m.sent,t.bufferView={data:u};case 10:return Number.isFinite(t.bufferView)&&(h=lA(r.json,r.buffers,t.bufferView),u=Wr(h.buffer,h.byteOffset,h.byteLength)),Ve(u,"glTF image has no data"),m.next=14,s(u,[Yt,Pc],{mimeType:t.mimeType,basis:i.basis||{format:Rs()}},a);case 14:d=m.sent,d&&d[0]&&(d={compressed:!0,mipmaps:!1,width:d[0].width,height:d[0].height,data:d[0]}),r.images=r.images||[],r.images[n]=d;case 18:case"end":return m.stop()}},e)})),_h.apply(this,arguments)}function YA(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),t.push.apply(t,n)}return t}function Ns(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{};r%2?YA(Object(t),!0).forEach(function(n){c(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):YA(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}var En={name:"glTF",id:"gltf",module:"gltf",version:z1,extensions:["gltf","glb"],mimeTypes:["model/gltf+json","model/gltf-binary"],text:!0,binary:!0,tests:["glTF"],parse:w3,options:{gltf:{normalize:!0,loadBuffers:!0,loadImages:!0,decompressMeshes:!0,postProcess:!0},log:console},deprecatedOptions:{fetchImages:"gltf.loadImages",createImages:"gltf.loadImages",decompress:"gltf.decompressMeshes",postProcess:"gltf.postProcess",gltf:{decompress:"gltf.decompressMeshes"}}};function w3(e){return Th.apply(this,arguments)}function Th(){return Th=I(bh.default.mark(function e(r){var t,n,i,a,o,s,u=arguments;return bh.default.wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return t=u.length>1&&u[1]!==void 0?u[1]:{},n=u.length>2?u[2]:void 0,t=Ns(Ns({},En.options),t),t.gltf=Ns(Ns({},En.options.gltf),t.gltf),i=t,a=i.byteOffset,o=a===void 0?0:a,s={},l.next=8,KA(s,r,o,t,n);case 8:return l.abrupt("return",l.sent);case 9:case"end":return l.stop()}},e)})),Th.apply(this,arguments)}var Us={URI:0,EMBEDDED:1};function js(e,r,t,n){e.rotateYtoZ=!0;var i=e.byteOffset+e.byteLength-t;if(i===0)throw new Error("glTF byte length must be greater than 0.");return e.gltfUpAxis=n["3d-tiles"]&&n["3d-tiles"].assetGltfUpAxis?n["3d-tiles"].assetGltfUpAxis:"Y",e.gltfArrayBuffer=Wr(r,t,i),e.gltfByteOffset=0,e.gltfByteLength=i,t%4===0||console.warn("".concat(e.type,": embedded glb is not aligned to a 4-byte boundary.")),e.byteOffset+e.byteLength}function Hs(e,r,t,n){return Eh.apply(this,arguments)}function Eh(){return Eh=I(xh.default.mark(function e(r,t,n,i){var a,o,s;return xh.default.wrap(function(f){for(;;)switch(f.prev=f.next){case 0:if(a=n["3d-tiles"]||{},C3(r,t,n),!a.loadGLTF){f.next=17;break}if(o=i.parse,s=i.fetch,!r.gltfUrl){f.next=9;break}return f.next=7,s(r.gltfUrl,n);case 7:r.gltfArrayBuffer=f.sent,r.gltfByteOffset=0;case 9:if(!r.gltfArrayBuffer){f.next=17;break}return f.next=12,o(r.gltfArrayBuffer,En,n,i);case 12:r.gltf=f.sent,r.gpuMemoryUsageInBytes=_a(r.gltf),delete r.gltfArrayBuffer,delete r.gltfByteOffset,delete r.gltfByteLength;case 17:case"end":return f.stop()}},e)})),Eh.apply(this,arguments)}function C3(e,r,t){switch(r){case Us.URI:var n=new Uint8Array(e.gltfArrayBuffer,e.gltfByteOffset),i=new TextDecoder,a=i.decode(n);e.gltfUrl=a.replace(/[\s\0]+$/,""),delete e.gltfArrayBuffer,delete e.gltfByteOffset,delete e.gltfByteLength;break;case Us.EMBEDDED:break;default:throw new Error("b3dm: Illegal glTF format field")}}function ZA(e,r,t,n,i){return wh.apply(this,arguments)}function wh(){return wh=I(Sh.default.mark(function e(r,t,n,i,a){var o,s;return Sh.default.wrap(function(f){for(;;)switch(f.prev=f.next){case 0:return n=B3(r,t,n,i,a),f.next=3,Hs(r,Us.EMBEDDED,i,a);case 3:return s=r==null||(o=r.gltf)===null||o===void 0?void 0:o.extensions,s&&s.CESIUM_RTC&&(r.rtcCenter=s.CESIUM_RTC.center),f.abrupt("return",n);case 6:case"end":return f.stop()}},e)})),wh.apply(this,arguments)}function B3(e,r,t,n,i){t=kr(e,r,t),t=ci(e,r,t),t=hi(e,r,t,n),t=js(e,r,t,n);var a=new ui(e.featureTableJson,e.featureTableBinary);return e.rtcCenter=a.getGlobalProperty("RTC_CENTER",5126,3),t}var Ch=X(re());function $A(e,r,t,n,i){return Bh.apply(this,arguments)}function Bh(){return Bh=I(Ch.default.mark(function e(r,t,n,i,a){return Ch.default.wrap(function(s){for(;;)switch(s.prev=s.next){case 0:return n=M3(r,t,n,i,a),s.next=3,Hs(r,r.gltfFormat,i,a);case 3:return s.abrupt("return",n);case 4:case"end":return s.stop()}},e)})),Bh.apply(this,arguments)}function M3(e,r,t,n,i){if(t=kr(e,r,t),e.version!==1)throw new Error("Instanced 3D Model version ".concat(e.version," is not supported"));t=ci(e,r,t);var a=new DataView(r);if(e.gltfFormat=a.getUint32(t,!0),t+=4,t=hi(e,r,t,n),t=js(e,r,t,n),e.featureTableJsonByteLength===0)throw new Error("i3dm parser: featureTableJsonByteLength is zero.");var o=new ui(e.featureTableJson,e.featureTableBinary),s=o.getGlobalProperty("INSTANCES_LENGTH");if(o.featuresLength=s,!Number.isFinite(s))throw new Error("i3dm parser: INSTANCES_LENGTH must be defined");e.eastNorthUp=o.getGlobalProperty("EAST_NORTH_UP"),e.rtcCenter=o.getGlobalProperty("RTC_CENTER",5126,3);var u=new Ps(e.batchTableJson,e.batchTableBinary,s);return O3(e,o,u,s),t}function O3(e,r,t,n){for(var i={instances:new Array(n),batchTable:e._batchTable,cull:!1,url:void 0,gltf:void 0,basePath:void 0,incrementallyLoadTextures:!1,forwardAxis:[1,0,0]},a=i.instances,o=new E,s=new E,u=new E,f=new E,l=new be,h=new br,d=new E,p={},m=new se,v=[],g=[],y=new E,A=new E,x=0;x<n;x++){var b=void 0;if(r.hasProperty("POSITION"))b=r.getProperty("POSITION",5126,3,x,o);else if(r.hasProperty("POSITION_QUANTIZED")){b=r.getProperty("POSITION_QUANTIZED",5123,3,x,o);var M=r.getGlobalProperty("QUANTIZED_VOLUME_OFFSET",5126,3,y);if(!M)throw new Error("i3dm parser: QUANTIZED_VOLUME_OFFSET must be defined for quantized positions.");var C=r.getGlobalProperty("QUANTIZED_VOLUME_SCALE",5126,3,A);if(!C)throw new Error("i3dm parser: QUANTIZED_VOLUME_SCALE must be defined for quantized positions.");for(var F=65535,B=0;B<3;B++)b[B]=b[B]/F*C[B]+M[B]}if(!b)throw new Error("i3dm: POSITION or POSITION_QUANTIZED must be defined for each instance.");o.copy(b),p.translation=o,e.normalUp=r.getProperty("NORMAL_UP",5126,3,x,v),e.normalRight=r.getProperty("NORMAL_RIGHT",5126,3,x,g);var S=!1;if(e.normalUp){if(!e.normalRight)throw new Error("i3dm: Custom orientation requires both NORMAL_UP and NORMAL_RIGHT.");e.hasCustomOrientation=!0}else{if(e.octNormalUp=r.getProperty("NORMAL_UP_OCT32P",5123,2,v),e.octNormalRight=r.getProperty("NORMAL_RIGHT_OCT32P",5123,2,g),e.octNormalUp)throw e.octNormalRight?new Error("i3dm: oct-encoded orientation not implemented"):new Error("i3dm: oct-encoded orientation requires NORMAL_UP_OCT32P and NORMAL_RIGHT_OCT32P");e.eastNorthUp?(ve.WGS84.eastNorthUpToFixedFrame(o,m),m.getRotationMatrix3(l)):l.identity()}S&&(f.copy(s).cross(u).normalize(),l.setColumn(0,s),l.setColumn(1,u),l.setColumn(2,f)),h.fromMatrix3(l),p.rotation=h,d.set(1,1,1);var _=r.getProperty("SCALE",5126,1,x);Number.isFinite(_)&&d.multiplyByScalar(_);var R=r.getProperty("SCALE_NON_UNIFORM",5126,3,x,v);R&&d.scale(R),p.scale=d;var k=r.getProperty("BATCH_ID",5123,1,x);k===void 0&&(k=x);var U=new se().fromQuaternion(p.rotation);m.identity(),m.translate(p.translation),m.multiplyRight(U),m.scale(p.scale);var j=m.clone();a[x]={modelMatrix:j,batchId:k}}e.instances=a}var Mh=X(re());function QA(e,r,t,n,i,a){return Oh.apply(this,arguments)}function Oh(){return Oh=I(Mh.default.mark(function e(r,t,n,i,a,o){var s,u;return Mh.default.wrap(function(l){for(;;)switch(l.prev=l.next){case 0:n=kr(r,t,n),s=new DataView(t),r.tilesLength=s.getUint32(n,!0),n+=4,r.tiles=[];case 5:if(!(r.tiles.length<r.tilesLength&&r.byteLength-n>12)){l.next=13;break}return u={},r.tiles.push(u),l.next=10,o(t,n,i,a,u);case 10:n=l.sent,l.next=5;break;case 13:return l.abrupt("return",n);case 14:case"end":return l.stop()}},e)})),Oh.apply(this,arguments)}var Ph=X(re());function e_(e,r,t,n){return Ih.apply(this,arguments)}function Ih(){return Ih=I(Ph.default.mark(function e(r,t,n,i){var a;return Ph.default.wrap(function(s){for(;;)switch(s.prev=s.next){case 0:return r.rotateYtoZ=!0,r.gltfUpAxis=n["3d-tiles"]&&n["3d-tiles"].assetGltfUpAxis?n["3d-tiles"].assetGltfUpAxis:"Y",a=i.parse,s.next=5,a(t,En,n,i);case 5:r.gltf=s.sent,r.gpuMemoryUsageInBytes=_a(r.gltf);case 7:case"end":return s.stop()}},e)})),Ih.apply(this,arguments)}function Lh(e){return Fh.apply(this,arguments)}function Fh(){return Fh=I(Rh.default.mark(function e(r){var t,n,i,a,o=arguments;return Rh.default.wrap(function(u){for(;;)switch(u.prev=u.next){case 0:t=o.length>1&&o[1]!==void 0?o[1]:0,n=o.length>2?o[2]:void 0,i=o.length>3?o[3]:void 0,a=o.length>4&&o[4]!==void 0?o[4]:{},a.byteOffset=t,a.type=G0(r,t),u.t0=a.type,u.next=u.t0===mn.COMPOSITE?9:u.t0===mn.BATCHED_3D_MODEL?12:u.t0===mn.GLTF?15:u.t0===mn.INSTANCED_3D_MODEL?18:u.t0===mn.POINT_CLOUD?21:24;break;case 9:return u.next=11,QA(a,r,t,n,i,Lh);case 11:return u.abrupt("return",u.sent);case 12:return u.next=14,ZA(a,r,t,n,i);case 14:return u.abrupt("return",u.sent);case 15:return u.next=17,e_(a,r,n,i);case 17:return u.abrupt("return",u.sent);case 18:return u.next=20,$A(a,r,t,n,i);case 20:return u.abrupt("return",u.sent);case 21:return u.next=23,V1(a,r,t,n,i);case 23:return u.abrupt("return",u.sent);case 24:throw new Error("3DTileLoader: unknown type ".concat(a.type));case 25:case"end":return u.stop()}},e)})),Fh.apply(this,arguments)}var Cn=X(re());var Ba=X(re()),P3=1952609651,I3=1;function Nh(e,r,t){return Dh.apply(this,arguments)}function Dh(){return Dh=I(Ba.default.mark(function e(r,t,n){var i,a,o,s,u,f,l,h,d;return Ba.default.wrap(function(m){for(;;)switch(m.prev=m.next){case 0:if(i=new Uint32Array(r.slice(0,4)),i[0]===P3){m.next=3;break}throw new Error("Wrong subtree file magic number");case 3:if(a=new Uint32Array(r.slice(4,8)),a[0]===I3){m.next=6;break}throw new Error("Wrong subtree file verson, must be 1");case 6:if(o=t_(r.slice(8,16)),s=new Uint8Array(r,24,o),u=new TextDecoder("utf8"),f=u.decode(s),l=JSON.parse(f),h=t_(r.slice(16,24)),d=new ArrayBuffer(0),h&&(d=r.slice(24+o)),!("bufferView"in l.tileAvailability)){m.next=18;break}return m.next=17,kh(l,"tileAvailability",d,n);case 17:l.tileAvailability.explicitBitstream=m.sent;case 18:if(!("bufferView"in l.contentAvailability)){m.next=22;break}return m.next=21,kh(l,"contentAvailability",d,n);case 21:l.contentAvailability.explicitBitstream=m.sent;case 22:if(!("bufferView"in l.childSubtreeAvailability)){m.next=26;break}return m.next=25,kh(l,"childSubtreeAvailability",d,n);case 25:l.childSubtreeAvailability.explicitBitstream=m.sent;case 26:return m.abrupt("return",l);case 27:case"end":return m.stop()}},e)})),Dh.apply(this,arguments)}function R3(e,r){var t=r.startsWith("http");if(t){var n=new URL(e,r);return decodeURI(n.toString())}var i="http://".concat(r),a=new URL(e,i);return"/".concat(a.host).concat(a.pathname)}function kh(e,r,t,n){return Gh.apply(this,arguments)}function Gh(){return Gh=I(Ba.default.mark(function e(r,t,n,i){var a,o,s,u,f,l;return Ba.default.wrap(function(d){for(;;)switch(d.prev=d.next){case 0:if(a=r[t].bufferView,o=r.bufferViews[a],s=r.buffers[o.buffer],!(!(i!=null&&i.url)||!i.fetch)){d.next=5;break}throw new Error("Url is not provided");case 5:if(i.fetch){d.next=7;break}throw new Error("fetch is not provided");case 7:if(!s.uri){d.next=16;break}return u=R3(s.uri,i?.url),d.next=11,i.fetch(u);case 11:return f=d.sent,d.next=14,f.arrayBuffer();case 14:return l=d.sent,d.abrupt("return",new Uint8Array(l,o.byteOffset,o.byteLength));case 16:return d.abrupt("return",new Uint8Array(n,o.byteOffset,o.byteLength));case 17:case"end":return d.stop()}},e)})),Gh.apply(this,arguments)}function t_(e){var r=new DataView(e),t=r.getUint32(0,!0),n=r.getUint32(4,!0);return t+Math.pow(2,32)*n}var Vs={id:"3d-tiles-subtree",name:"3D Tiles Subtree",module:"3d-tiles",version:vs,extensions:["subtree"],mimeTypes:["application/octet-stream"],tests:["subtree"],parse:Nh,options:{}};var S_=X(ni());ue();N();var $h=X(re());var __=X(ni());var At=null;try{At=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch{}function Se(e,r,t){this.low=e|0,this.high=r|0,this.unsigned=!!t}Se.prototype.__isLong__;Object.defineProperty(Se.prototype,"__isLong__",{value:!0});function Ze(e){return(e&&e.__isLong__)===!0}function r_(e){var r=Math.clz32(e&-e);return e?31-r:r}Se.isLong=Ze;var n_={},i_={};function Sn(e,r){var t,n,i;return r?(e>>>=0,(i=0<=e&&e<256)&&(n=i_[e],n)?n:(t=ye(e,0,!0),i&&(i_[e]=t),t)):(e|=0,(i=-128<=e&&e<128)&&(n=n_[e],n)?n:(t=ye(e,e<0?-1:0,!1),i&&(n_[e]=t),t))}Se.fromInt=Sn;function _t(e,r){if(isNaN(e))return r?cr:Mt;if(r){if(e<0)return cr;if(e>=u_)return c_}else{if(e<=-o_)return lt;if(e+1>=o_)return l_}return e<0?_t(-e,r).neg():ye(e%yi|0,e/yi|0,r)}Se.fromNumber=_t;function ye(e,r,t){return new Se(e,r,t)}Se.fromBits=ye;var zs=Math.pow;function jh(e,r,t){if(e.length===0)throw Error("empty string");if(typeof r=="number"?(t=r,r=!1):r=!!r,e==="NaN"||e==="Infinity"||e==="+Infinity"||e==="-Infinity")return r?cr:Mt;if(t=t||10,t<2||36<t)throw RangeError("radix");var n;if((n=e.indexOf("-"))>0)throw Error("interior hyphen");if(n===0)return jh(e.substring(1),r,t).neg();for(var i=_t(zs(t,8)),a=Mt,o=0;o<e.length;o+=8){var s=Math.min(8,e.length-o),u=parseInt(e.substring(o,o+s),t);if(s<8){var f=_t(zs(t,s));a=a.mul(f).add(_t(u))}else a=a.mul(i),a=a.add(_t(u))}return a.unsigned=r,a}Se.fromString=jh;function Ot(e,r){return typeof e=="number"?_t(e,r):typeof e=="string"?jh(e,r):ye(e.low,e.high,typeof r=="boolean"?r:e.unsigned)}Se.fromValue=Ot;var a_=1<<16,F3=1<<24,yi=a_*a_,u_=yi*yi,o_=u_/2,s_=Sn(F3),Mt=Sn(0);Se.ZERO=Mt;var cr=Sn(0,!0);Se.UZERO=cr;var gi=Sn(1);Se.ONE=gi;var f_=Sn(1,!0);Se.UONE=f_;var Uh=Sn(-1);Se.NEG_ONE=Uh;var l_=ye(-1,2147483647,!1);Se.MAX_VALUE=l_;var c_=ye(-1,-1,!0);Se.MAX_UNSIGNED_VALUE=c_;var lt=ye(0,-2147483648,!1);Se.MIN_VALUE=lt;var W=Se.prototype;W.toInt=function(){return this.unsigned?this.low>>>0:this.low};W.toNumber=function(){return this.unsigned?(this.high>>>0)*yi+(this.low>>>0):this.high*yi+(this.low>>>0)};W.toString=function(r){if(r=r||10,r<2||36<r)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative())if(this.eq(lt)){var t=_t(r),n=this.div(t),i=n.mul(t).sub(this);return n.toString(r)+i.toInt().toString(r)}else return"-"+this.neg().toString(r);for(var a=_t(zs(r,6),this.unsigned),o=this,s="";;){var u=o.div(a),f=o.sub(u.mul(a)).toInt()>>>0,l=f.toString(r);if(o=u,o.isZero())return l+s;for(;l.length<6;)l="0"+l;s=""+l+s}};W.getHighBits=function(){return this.high};W.getHighBitsUnsigned=function(){return this.high>>>0};W.getLowBits=function(){return this.low};W.getLowBitsUnsigned=function(){return this.low>>>0};W.getNumBitsAbs=function(){if(this.isNegative())return this.eq(lt)?64:this.neg().getNumBitsAbs();for(var r=this.high!=0?this.high:this.low,t=31;t>0&&!(r&1<<t);t--);return this.high!=0?t+33:t+1};W.isZero=function(){return this.high===0&&this.low===0};W.eqz=W.isZero;W.isNegative=function(){return!this.unsigned&&this.high<0};W.isPositive=function(){return this.unsigned||this.high>=0};W.isOdd=function(){return(this.low&1)===1};W.isEven=function(){return(this.low&1)===0};W.equals=function(r){return Ze(r)||(r=Ot(r)),this.unsigned!==r.unsigned&&this.high>>>31===1&&r.high>>>31===1?!1:this.high===r.high&&this.low===r.low};W.eq=W.equals;W.notEquals=function(r){return!this.eq(r)};W.neq=W.notEquals;W.ne=W.notEquals;W.lessThan=function(r){return this.comp(r)<0};W.lt=W.lessThan;W.lessThanOrEqual=function(r){return this.comp(r)<=0};W.lte=W.lessThanOrEqual;W.le=W.lessThanOrEqual;W.greaterThan=function(r){return this.comp(r)>0};W.gt=W.greaterThan;W.greaterThanOrEqual=function(r){return this.comp(r)>=0};W.gte=W.greaterThanOrEqual;W.ge=W.greaterThanOrEqual;W.compare=function(r){if(Ze(r)||(r=Ot(r)),this.eq(r))return 0;var t=this.isNegative(),n=r.isNegative();return t&&!n?-1:!t&&n?1:this.unsigned?r.high>>>0>this.high>>>0||r.high===this.high&&r.low>>>0>this.low>>>0?-1:1:this.sub(r).isNegative()?-1:1};W.comp=W.compare;W.negate=function(){return!this.unsigned&&this.eq(lt)?lt:this.not().add(gi)};W.neg=W.negate;W.add=function(r){Ze(r)||(r=Ot(r));var t=this.high>>>16,n=this.high&65535,i=this.low>>>16,a=this.low&65535,o=r.high>>>16,s=r.high&65535,u=r.low>>>16,f=r.low&65535,l=0,h=0,d=0,p=0;return p+=a+f,d+=p>>>16,p&=65535,d+=i+u,h+=d>>>16,d&=65535,h+=n+s,l+=h>>>16,h&=65535,l+=t+o,l&=65535,ye(d<<16|p,l<<16|h,this.unsigned)};W.subtract=function(r){return Ze(r)||(r=Ot(r)),this.add(r.neg())};W.sub=W.subtract;W.multiply=function(r){if(this.isZero())return this;if(Ze(r)||(r=Ot(r)),At){var t=At.mul(this.low,this.high,r.low,r.high);return ye(t,At.get_high(),this.unsigned)}if(r.isZero())return this.unsigned?cr:Mt;if(this.eq(lt))return r.isOdd()?lt:Mt;if(r.eq(lt))return this.isOdd()?lt:Mt;if(this.isNegative())return r.isNegative()?this.neg().mul(r.neg()):this.neg().mul(r).neg();if(r.isNegative())return this.mul(r.neg()).neg();if(this.lt(s_)&&r.lt(s_))return _t(this.toNumber()*r.toNumber(),this.unsigned);var n=this.high>>>16,i=this.high&65535,a=this.low>>>16,o=this.low&65535,s=r.high>>>16,u=r.high&65535,f=r.low>>>16,l=r.low&65535,h=0,d=0,p=0,m=0;return m+=o*l,p+=m>>>16,m&=65535,p+=a*l,d+=p>>>16,p&=65535,p+=o*f,d+=p>>>16,p&=65535,d+=i*l,h+=d>>>16,d&=65535,d+=a*f,h+=d>>>16,d&=65535,d+=o*u,h+=d>>>16,d&=65535,h+=n*l+i*f+a*u+o*s,h&=65535,ye(p<<16|m,h<<16|d,this.unsigned)};W.mul=W.multiply;W.divide=function(r){if(Ze(r)||(r=Ot(r)),r.isZero())throw Error("division by zero");if(At){if(!this.unsigned&&this.high===-2147483648&&r.low===-1&&r.high===-1)return this;var t=(this.unsigned?At.div_u:At.div_s)(this.low,this.high,r.low,r.high);return ye(t,At.get_high(),this.unsigned)}if(this.isZero())return this.unsigned?cr:Mt;var n,i,a;if(this.unsigned){if(r.unsigned||(r=r.toUnsigned()),r.gt(this))return cr;if(r.gt(this.shru(1)))return f_;a=cr}else{if(this.eq(lt)){if(r.eq(gi)||r.eq(Uh))return lt;if(r.eq(lt))return gi;var o=this.shr(1);return n=o.div(r).shl(1),n.eq(Mt)?r.isNegative()?gi:Uh:(i=this.sub(r.mul(n)),a=n.add(i.div(r)),a)}else if(r.eq(lt))return this.unsigned?cr:Mt;if(this.isNegative())return r.isNegative()?this.neg().div(r.neg()):this.neg().div(r).neg();if(r.isNegative())return this.div(r.neg()).neg();a=Mt}for(i=this;i.gte(r);){n=Math.max(1,Math.floor(i.toNumber()/r.toNumber()));for(var s=Math.ceil(Math.log(n)/Math.LN2),u=s<=48?1:zs(2,s-48),f=_t(n),l=f.mul(r);l.isNegative()||l.gt(i);)n-=u,f=_t(n,this.unsigned),l=f.mul(r);f.isZero()&&(f=gi),a=a.add(f),i=i.sub(l)}return a};W.div=W.divide;W.modulo=function(r){if(Ze(r)||(r=Ot(r)),At){var t=(this.unsigned?At.rem_u:At.rem_s)(this.low,this.high,r.low,r.high);return ye(t,At.get_high(),this.unsigned)}return this.sub(this.div(r).mul(r))};W.mod=W.modulo;W.rem=W.modulo;W.not=function(){return ye(~this.low,~this.high,this.unsigned)};W.countLeadingZeros=function(){return this.high?Math.clz32(this.high):Math.clz32(this.low)+32};W.clz=W.countLeadingZeros;W.countTrailingZeros=function(){return this.low?r_(this.low):r_(this.high)+32};W.ctz=W.countTrailingZeros;W.and=function(r){return Ze(r)||(r=Ot(r)),ye(this.low&r.low,this.high&r.high,this.unsigned)};W.or=function(r){return Ze(r)||(r=Ot(r)),ye(this.low|r.low,this.high|r.high,this.unsigned)};W.xor=function(r){return Ze(r)||(r=Ot(r)),ye(this.low^r.low,this.high^r.high,this.unsigned)};W.shiftLeft=function(r){return Ze(r)&&(r=r.toInt()),(r&=63)===0?this:r<32?ye(this.low<<r,this.high<<r|this.low>>>32-r,this.unsigned):ye(0,this.low<<r-32,this.unsigned)};W.shl=W.shiftLeft;W.shiftRight=function(r){return Ze(r)&&(r=r.toInt()),(r&=63)===0?this:r<32?ye(this.low>>>r|this.high<<32-r,this.high>>r,this.unsigned):ye(this.high>>r-32,this.high>=0?0:-1,this.unsigned)};W.shr=W.shiftRight;W.shiftRightUnsigned=function(r){return Ze(r)&&(r=r.toInt()),(r&=63)===0?this:r<32?ye(this.low>>>r|this.high<<32-r,this.high>>>r,this.unsigned):r===32?ye(this.high,0,this.unsigned):ye(this.high>>>r-32,0,this.unsigned)};W.shru=W.shiftRightUnsigned;W.shr_u=W.shiftRightUnsigned;W.rotateLeft=function(r){var t;return Ze(r)&&(r=r.toInt()),(r&=63)===0?this:r===32?ye(this.high,this.low,this.unsigned):r<32?(t=32-r,ye(this.low<<r|this.high>>>t,this.high<<r|this.low>>>t,this.unsigned)):(r-=32,t=32-r,ye(this.high<<r|this.low>>>t,this.low<<r|this.high>>>t,this.unsigned))};W.rotl=W.rotateLeft;W.rotateRight=function(r){var t;return Ze(r)&&(r=r.toInt()),(r&=63)===0?this:r===32?ye(this.high,this.low,this.unsigned):r<32?(t=32-r,ye(this.high<<t|this.low>>>r,this.low<<t|this.high>>>r,this.unsigned)):(r-=32,t=32-r,ye(this.low<<t|this.high>>>r,this.high<<t|this.low>>>r,this.unsigned))};W.rotr=W.rotateRight;W.toSigned=function(){return this.unsigned?ye(this.low,this.high,!1):this};W.toUnsigned=function(){return this.unsigned?this:ye(this.low,this.high,!0)};W.toBytes=function(r){return r?this.toBytesLE():this.toBytesBE()};W.toBytesLE=function(){var r=this.high,t=this.low;return[t&255,t>>>8&255,t>>>16&255,t>>>24,r&255,r>>>8&255,r>>>16&255,r>>>24]};W.toBytesBE=function(){var r=this.high,t=this.low;return[r>>>24,r>>>16&255,r>>>8&255,r&255,t>>>24,t>>>16&255,t>>>8&255,t&255]};Se.fromBytes=function(r,t,n){return n?Se.fromBytesLE(r,t):Se.fromBytesBE(r,t)};Se.fromBytesLE=function(r,t){return new Se(r[0]|r[1]<<8|r[2]<<16|r[3]<<24,r[4]|r[5]<<8|r[6]<<16|r[7]<<24,t)};Se.fromBytesBE=function(r,t){return new Se(r[4]<<24|r[5]<<16|r[6]<<8|r[7],r[0]<<24|r[1]<<16|r[2]<<8|r[3],t)};var Ai=Se;var L3=16;function Ma(e){e==="X"&&(e="");var r=e.padEnd(L3,"0");return Ai.fromString(r,!0,16)}function Hh(e){if(e.isZero())return"X";var r=e.countTrailingZeros(),t=r%4;r=(r-t)/4;var n=r;r*=4;var i=e.shiftRightUnsigned(r),a=i.toString(16).replace(/0+$/,""),o=Array(17-n-a.length).join("0");return o+a}function Vh(e,r){var t=k3(e).shiftRightUnsigned(2),n=e.add(Ai.fromNumber(2*r+1-4).multiply(t));return n}function k3(e){return e.and(e.not().add(1))}ue();var D3=3,G3=30,N3=2*G3+1,h_=180/Math.PI;function p_(e){if(e.length===0)throw new Error("Invalid Hilbert quad key ".concat(e));for(var r=e.split("/"),t=parseInt(r[0],10),n=r[1],i=n.length,a=0,o=[0,0],s=i-1;s>=0;s--){a=i-s;var u=n[s],f=0,l=0;u==="1"?l=1:u==="2"?(f=1,l=1):u==="3"&&(f=1);var h=Math.pow(2,a-1);U3(h,o,f,l),o[0]+=h*f,o[1]+=h*l}if(t%2===1){var d=o[0];o[0]=o[1],o[1]=d}return{face:t,ij:o,level:a}}function m_(e){if(e.isZero())return"";for(var r=e.toString(2);r.length<D3+N3;)r="0"+r;var t=r.lastIndexOf("1"),n=r.substring(0,3),i=r.substring(3,t),a=i.length/2,o=Ai.fromString(n,!0,2).toString(10),s="";if(a!==0)for(s=Ai.fromString(i,!0,2).toString(4);s.length<a;)s="0"+s;return"".concat(o,"/").concat(s)}function zh(e,r,t){var n=1<<r;return[(e[0]+t[0])/n,(e[1]+t[1])/n]}function d_(e){return e>=.5?1/3*(4*e*e-1):1/3*(1-4*(1-e)*(1-e))}function Wh(e){return[d_(e[0]),d_(e[1])]}function Jh(e,r){var t=D(r,2),n=t[0],i=t[1];switch(e){case 0:return[1,n,i];case 1:return[-n,1,i];case 2:return[-n,-i,1];case 3:return[-1,-i,-n];case 4:return[i,-1,-n];case 5:return[i,n,-1];default:throw new Error("Invalid face")}}function Xh(e){var r=D(e,3),t=r[0],n=r[1],i=r[2],a=Math.atan2(i,Math.sqrt(t*t+n*n)),o=Math.atan2(n,t);return[o*h_,a*h_]}function U3(e,r,t,n){if(n===0){t===1&&(r[0]=e-1-r[0],r[1]=e-1-r[1]);var i=r[0];r[0]=r[1],r[1]=i}}function v_(e){var r=zh(e.ij,e.level,[.5,.5]),t=Wh(r),n=Jh(e.face,t);return Xh(n)}var j3=100;function qh(e){for(var r=e.face,t=e.ij,n=e.level,i=[[0,0],[0,1],[1,1],[1,0],[0,0]],a=Math.max(1,Math.ceil(j3*Math.pow(2,-n))),o=new Float64Array(4*a*2+2),s=0,u=0,f=0;f<4;f++)for(var l=i[f].slice(0),h=i[f+1],d=(h[0]-l[0])/a,p=(h[1]-l[1])/a,m=0;m<a;m++){l[0]+=d,l[1]+=p;var v=zh(t,n,l),g=Wh(v),y=Jh(r,g),A=Xh(y);Math.abs(A[1])>89.999&&(A[0]=u);var x=A[0]-u;A[0]+=x>180?-360:x<-180?360:0,o[s++]=A[0],o[s++]=A[1],u=A[0]}return o[s++]=o[0],o[s++]=o[1],o}function _i(e){var r=H3(e),t=p_(r);return t}function H3(e){if(e.indexOf("/")>0)return e;var r=Ma(e);return m_(r)}function Kh(e){var r=_i(e);return v_(r)}function y_(e){var r;if(e.face===2||e.face===5){for(var t=null,n=0,i=0;i<4;i++){var a="".concat(e.face,"/").concat(i),o=_i(a),s=qh(o);(typeof t>"u"||t===null)&&(t=new Float64Array(4*s.length)),t.set(s,n),n+=s.length}r=g_(t)}else{var u=qh(e);r=g_(u)}return r}function g_(e){if(e.length%2!==0)throw new Error("Invalid corners");for(var r=[],t=[],n=0;n<e.length;n+=2)r.push(e[n]),t.push(e[n+1]);return r.sort(function(i,a){return i-a}),t.sort(function(i,a){return i-a}),{west:r[0],east:r[r.length-1],north:t[t.length-1],south:t[0]}}function Yh(e,r){var t=r?.minimumHeight||0,n=r?.maximumHeight||0,i=_i(e),a=y_(i),o=a.west,s=a.south,u=a.east,f=a.north,l=[];return l.push(new E(o,f,t)),l.push(new E(u,f,t)),l.push(new E(u,s,t)),l.push(new E(o,s,t)),l.push(new E(o,f,n)),l.push(new E(u,f,n)),l.push(new E(u,s,n)),l.push(new E(o,s,n)),l}function Ws(e){var r=e.token,t={minimumHeight:e.minimumHeight,maximumHeight:e.maximumHeight},n=Yh(r,t),i=Kh(r),a=i[0],o=i[1],s=ve.WGS84.cartographicToCartesian([a,o,t.maximumHeight]),u=new E(s[0],s[1],s[2]);n.push(u);var f=$i(n),l=[].concat(K(f.center),K(f.halfAxes));return l}function A_(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),t.push.apply(t,n)}return t}function V3(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{};r%2?A_(Object(t),!0).forEach(function(n){c(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):A_(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}var z3=4,W3=8,J3={QUADTREE:z3,OCTREE:W3};function X3(e,r,t){if(e!=null&&e.box){var n=Ma(e.s2VolumeInfo.token),i=Vh(n,r),a=Hh(i),o=V3({},e.s2VolumeInfo);switch(o.token=a,t){case"OCTREE":var s=e.s2VolumeInfo,u=s.maximumHeight-s.minimumHeight,f=u/2,l=s.minimumHeight+u/2;s.minimumHeight=l-f,s.maximumHeight=l+f;break;default:break}var h=Ws(o),d={box:h,s2VolumeInfo:o};return d}}function ed(e){return Qh.apply(this,arguments)}function Qh(){return Qh=I($h.default.mark(function e(r){var t,n,i,a,o,s,u,f,l,h,d,p,m,v,g,y,A,x,b,M,C,F,B,S,_,R,k,U,j,Z,P,O,G,J,V,ee,ie,we,Me,Re,Xe,nt,Fe,Rn,zd,Wd;return $h.default.wrap(function(ct){for(;;)switch(ct.prev=ct.next){case 0:if(t=r.options,n=r.parentData,i=n===void 0?{mortonIndex:0,x:0,y:0,z:0}:n,a=r.childIndex,o=a===void 0?0:a,s=r.globalData,u=s===void 0?{level:0,mortonIndex:0,x:0,y:0,z:0}:s,f=r.s2VolumeBox,l=r.subtree,h=r.level,d=h===void 0?0:h,p=t.subdivisionScheme,m=t.subtreeLevels,v=t.maximumLevel,g=t.contentUrlTemplate,y=t.subtreesUriTemplate,A=t.basePath,x={children:[],lodMetricValue:0,contentUrl:""},b=J3[p],M=o&1,C=o>>1&1,F=o>>2&1,B=(Math.pow(b,d)-1)/(b-1),S=wn(i.mortonIndex,o),_=B+S,R=wn(i.x,M),k=wn(i.y,C),U=wn(i.z,F),j=!1,d+1>m&&(j=Zh(l.childSubtreeAvailability,S)),Z=wn(u.x,R),P=wn(u.y,k),O=wn(u.z,U),G=d+u.level,!j){ct.next=38;break}return J="".concat(A,"/").concat(y),V=Js(J,G,Z,P,O),ct.next=25,(0,__.load)(V,Vs);case 25:ee=ct.sent,l=ee,u.mortonIndex=S,u.x=R,u.y=k,u.z=U,u.level=d,S=0,_=0,R=0,k=0,U=0,d=0;case 38:if(ie=Zh(l.tileAvailability,_),!(!ie||d>v)){ct.next=41;break}return ct.abrupt("return",x);case 41:we=Zh(l.contentAvailability,_),we&&(x.contentUrl=Js(g,G,Z,P,O)),Me=d+1,Re={mortonIndex:S,x:R,y:k,z:U},Xe=0;case 46:if(!(Xe<b)){ct.next=55;break}return nt=X3(f,Xe,p),ct.next=50,ed({subtree:l,options:t,parentData:Re,childIndex:Xe,level:Me,globalData:u,s2VolumeBox:nt});case 50:Fe=ct.sent,(Fe.contentUrl||Fe.children.length)&&(Rn=G+1,zd={childTileX:R,childTileY:k,childTileZ:U},Wd=q3(Fe,Rn,zd,t,f),x.children.push(Wd));case 52:Xe++,ct.next=46;break;case 55:return ct.abrupt("return",x);case 56:case"end":return ct.stop()}},e)})),Qh.apply(this,arguments)}function Zh(e,r){return"constant"in e?Boolean(e.constant):e.explicitBitstream?Z3(r,e.explicitBitstream):!1}function q3(e,r,t,n,i){var a=n.basePath,o=n.refine,s=n.getRefine,u=n.lodMetricType,f=n.getTileType,l=n.rootLodMetricValue,h=n.rootBoundingVolume,d=e.contentUrl&&e.contentUrl.replace("".concat(a,"/"),""),p=l/Math.pow(2,r),m=i!=null&&i.box?{box:i.box}:h,v=K3(r,m,t);return{children:e.children,contentUrl:e.contentUrl,content:{uri:d},id:e.contentUrl,refine:s(o),type:f(e),lodMetricType:u,lodMetricValue:p,geometricError:p,transform:e.transform,boundingVolume:v}}function K3(e,r,t){if(r.region){var n=t.childTileX,i=t.childTileY,a=t.childTileZ,o=D(r.region,6),s=o[0],u=o[1],f=o[2],l=o[3],h=o[4],d=o[5],p=Math.pow(2,e),m=(f-s)/p,v=(l-u)/p,g=(d-h)/p,y=s+m*n,A=s+m*(n+1),x=u+v*i,b=u+v*(i+1),M=h+g*a,C=h+g*(a+1);return{region:[y,x,A,b,M,C]}}if(r.box)return r;throw new Error("Unsupported bounding volume type ".concat(r))}function wn(e,r){return parseInt(e.toString(2)+r.toString(2),2)}function Js(e,r,t,n,i){var a=Y3({level:r,x:t,y:n,z:i});return e.replace(/{level}|{x}|{y}|{z}/gi,function(o){return a[o]})}function Y3(e){var r={};for(var t in e)r["{".concat(t,"}")]=e[t];return r}function Z3(e,r){var t=Math.floor(e/8),n=e%8,i=r[t]>>n&1;return i===1}function $3(e,r){var t=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=Q3(e))||r&&e&&typeof e.length=="number"){t&&(e=t);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(f){throw f},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
186
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){t=t.call(e)},n:function(){var f=t.next();return a=f.done,f},e:function(f){o=!0,s=f},f:function(){try{!a&&t.return!=null&&t.return()}finally{if(o)throw s}}}}function Q3(e,r){if(e){if(typeof e=="string")return b_(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);if(t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set")return Array.from(e);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return b_(e,r)}}function b_(e,r){(r==null||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function ad(e){if(!e.contentUrl)return or.EMPTY;var r=e.contentUrl.split("?")[0],t=r.split(".").pop();switch(t){case"pnts":return or.POINTCLOUD;case"i3dm":case"b3dm":case"glb":case"gltf":return or.SCENEGRAPH;default:return t}}function od(e){switch(e){case"REPLACE":case"replace":return st.REPLACE;case"ADD":case"add":return st.ADD;default:return e}}function td(e,r){var t=/^[a-z][0-9a-z+.-]*:/i;if(t.test(r)){var n=new URL(e,"".concat(r,"/"));return decodeURI(n.toString())}else if(e.startsWith("/"))return e;return"".concat(r,"/").concat(e)}function T_(e,r){if(!e)return null;if(e.content){var t=e.content.uri||e.content.url;e.contentUrl=td(t,r.basePath)}return e.id=e.contentUrl,e.lodMetricType=dn.GEOMETRIC_ERROR,e.lodMetricValue=e.geometricError,e.transformMatrix=e.transform,e.type=ad(e),e.refine=od(e.refine),e}function w_(e,r){return rd.apply(this,arguments)}function rd(){return rd=I(Cn.default.mark(function e(r,t){var n,i,a,o,s,u,f,l,h,d;return Cn.default.wrap(function(m){for(;;)switch(m.prev=m.next){case 0:if(n=r.basePath,a=E_(r?.root),!(a&&r.root)){m.next=8;break}return m.next=5,x_(r.root,r,a,t);case 5:i=m.sent,m.next=9;break;case 8:i=T_(r.root,r);case 9:o=[],o.push(i);case 11:if(!(o.length>0)){m.next=40;break}s=o.pop()||{},u=s.children||[],f=$3(u),m.prev=15,f.s();case 17:if((l=f.n()).done){m.next=30;break}if(h=l.value,d=E_(h),!d){m.next=26;break}return m.next=23,x_(h,r,d,t);case 23:h=m.sent,m.next=27;break;case 26:T_(h,{basePath:n});case 27:o.push(h);case 28:m.next=17;break;case 30:m.next=35;break;case 32:m.prev=32,m.t0=m.catch(15),f.e(m.t0);case 35:return m.prev=35,f.f(),m.finish(35);case 38:m.next=11;break;case 40:return m.abrupt("return",i);case 41:case"end":return m.stop()}},e,null,[[15,32,35,38]])})),rd.apply(this,arguments)}function x_(e,r,t,n){return nd.apply(this,arguments)}function nd(){return nd=I(Cn.default.mark(function e(r,t,n,i){var a,o,s,u,f,l,h,d,p,m,v,g,y,A,x,b,M,C;return Cn.default.wrap(function(B){for(;;)switch(B.prev=B.next){case 0:return s=t.basePath,u=n.subdivisionScheme,f=n.maximumLevel,l=n.subtreeLevels,h=n.subtrees.uri,d=Js(h,0,0,0,0),p=td(d,s),B.next=6,(0,S_.load)(p,Vs,i);case 6:return m=B.sent,v=td(r.content.uri,s),g=t==null||(a=t.root)===null||a===void 0?void 0:a.refine,y=r.geometricError,A=(o=r.boundingVolume.extensions)===null||o===void 0?void 0:o["3DTILES_bounding_volume_S2"],A&&(x=Ws(A),b={box:x,s2VolumeInfo:A},r.boundingVolume=b),M=r.boundingVolume,C={contentUrlTemplate:v,subtreesUriTemplate:h,subdivisionScheme:u,subtreeLevels:l,maximumLevel:f,refine:g,basePath:s,lodMetricType:dn.GEOMETRIC_ERROR,rootLodMetricValue:y,rootBoundingVolume:M,getTileType:ad,getRefine:od},B.next=16,eP(r,m,C);case 16:return B.abrupt("return",B.sent);case 17:case"end":return B.stop()}},e)})),nd.apply(this,arguments)}function eP(e,r,t){return id.apply(this,arguments)}function id(){return id=I(Cn.default.mark(function e(r,t,n){var i,a,o;return Cn.default.wrap(function(u){for(;;)switch(u.prev=u.next){case 0:if(r){u.next=2;break}return u.abrupt("return",null);case 2:return r.lodMetricType=dn.GEOMETRIC_ERROR,r.lodMetricValue=r.geometricError,r.transformMatrix=r.transform,u.next=7,ed({subtree:t,options:n,s2VolumeBox:r});case 7:return i=u.sent,a=i.children,o=i.contentUrl,o&&(r.contentUrl=o,r.content={uri:o.replace("".concat(n.basePath,"/"),"")}),r.refine=od(r.refine),r.type=ad(r),r.children=a,r.id=r.contentUrl,u.abrupt("return",r);case 16:case"end":return u.stop()}},e)})),id.apply(this,arguments)}function E_(e){var r;return(e==null||(r=e.extensions)===null||r===void 0?void 0:r["3DTILES_implicit_tiling"])||e?.implicitTiling}var Xs={id:"3d-tiles",name:"3D Tiles",module:"3d-tiles",version:vs,extensions:["cmpt","pnts","b3dm","i3dm"],mimeTypes:["application/octet-stream"],tests:["cmpt","pnts","b3dm","i3dm"],parse:iP,options:{"3d-tiles":{loadGLTF:!0,decodeQuantizedPositions:!1,isTileset:"auto",assetGltfUpAxis:null}}};function tP(e){return kn.dirname(e.url)}function rP(e,r,t){return sd.apply(this,arguments)}function sd(){return sd=I(Bn.default.mark(function e(r,t,n){var i,a;return Bn.default.wrap(function(s){for(;;)switch(s.prev=s.next){case 0:return i={content:{featureIds:null}},a=0,s.next=4,Lh(r,a,t,n,i.content);case 4:return s.abrupt("return",i.content);case 5:case"end":return s.stop()}},e)})),sd.apply(this,arguments)}function nP(e,r,t){return ud.apply(this,arguments)}function ud(){return ud=I(Bn.default.mark(function e(r,t,n){var i,a;return Bn.default.wrap(function(s){for(;;)switch(s.prev=s.next){case 0:return a=JSON.parse(new TextDecoder().decode(r)),a.loader=t.loader||Xs,a.url=n.url,a.queryString=n.queryString,a.basePath=tP(a),s.next=7,w_(a,t);case 7:return a.root=s.sent,a.type=Ke.TILES3D,a.lodMetricType=dn.GEOMETRIC_ERROR,a.lodMetricValue=((i=a.root)===null||i===void 0?void 0:i.lodMetricValue)||0,s.abrupt("return",a);case 12:case"end":return s.stop()}},e)})),ud.apply(this,arguments)}function iP(e,r,t){return fd.apply(this,arguments)}function fd(){return fd=I(Bn.default.mark(function e(r,t,n){var i,a;return Bn.default.wrap(function(s){for(;;)switch(s.prev=s.next){case 0:if(i=t["3d-tiles"]||{},i.isTileset==="auto"?a=n.url&&n.url.indexOf(".json")!==-1:a=i.isTileset,!a){s.next=8;break}return s.next=5,nP(r,t,n);case 5:r=s.sent,s.next=11;break;case 8:return s.next=10,rP(r,t,n);case 10:r=s.sent;case 11:return s.abrupt("return",r);case 12:case"end":return s.stop()}},e)})),fd.apply(this,arguments)}function C_(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),t.push.apply(t,n)}return t}function bi(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{};r%2?C_(Object(t),!0).forEach(function(n){c(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):C_(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}function aP(e){var r=oP();return function(){var n=L(e),i;if(r){var a=L(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return $(this,i)}}function oP(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var B_=[0],sP={getPointColor:{type:"accessor",value:[0,0,0,255]},pointSize:1,data:"",loader:Xs,onTilesetLoad:{type:"function",value:function(r){}},onTileLoad:{type:"function",value:function(r){}},onTileUnload:{type:"function",value:function(r){}},onTileError:{type:"function",value:function(r,t,n){}},_getMeshColor:{type:"function",value:function(r){return[255,255,255]}}},qs=function(e){H(t,e);var r=aP(t);function t(){var n;T(this,t);for(var i=arguments.length,a=new Array(i),o=0;o<i;o++)a[o]=arguments[o];return n=r.call.apply(r,[this].concat(a)),c(oe(n),"state",void 0),n}return w(t,[{key:"initializeState",value:function(){"onTileLoadFail"in this.props&&Gr.log.removed("onTileLoadFail","onTileError")(),this.state={layerMap:{},tileset3d:null,activeViewports:{},lastUpdatedViewports:null}}},{key:"isLoaded",get:function(){var i,a;return Boolean(((i=this.state)===null||i===void 0||(a=i.tileset3d)===null||a===void 0?void 0:a.isLoaded())&&_e(L(t.prototype),"isLoaded",this))}},{key:"shouldUpdateState",value:function(i){var a=i.changeFlags;return a.somethingChanged}},{key:"updateState",value:function(i){var a=i.props,o=i.oldProps,s=i.changeFlags;if(a.data&&a.data!==o.data&&this._loadTileset(a.data),s.viewportChanged){var u=this.state.activeViewports,f=Object.keys(u).length;f&&(this._updateTileset(u),this.state.lastUpdatedViewports=u,this.state.activeViewports={})}if(s.propsChanged){var l=this.state.layerMap;for(var h in l)l[h].needsUpdate=!0}}},{key:"activateViewport",value:function(i){var a=this.state,o=a.activeViewports,s=a.lastUpdatedViewports;this.internalState.viewport=i,o[i.id]=i;var u=s?.[i.id];(!u||!i.equals(u))&&(this.setChangeFlags({viewportChanged:!0}),this.setNeedsUpdate())}},{key:"getPickingInfo",value:function(i){var a=i.info,o=i.sourceLayer,s=o&&o.props.tile;return a.picked&&(a.object=s),a.sourceTile=s,a}},{key:"filterSubLayer",value:function(i){var a=i.layer,o=i.viewport,s=a.props,u=s.tile,f=o.id;return u.selected&&u.viewportIds.includes(f)}},{key:"_updateAutoHighlight",value:function(i){var a=i.sourceTile,o=this.state.layerMap[a?.id];o&&o.layer&&o.layer.updateAutoHighlight(i)}},{key:"_loadTileset",value:function(){var n=I(ld.default.mark(function a(o){var s,u,f,l,h,d,p,m;return ld.default.wrap(function(g){for(;;)switch(g.prev=g.next){case 0:if(s=this.props.loadOptions,u=s===void 0?{}:s,f=this.props.loader||this.props.loaders,Array.isArray(f)&&(f=f[0]),l={loadOptions:bi({},u)},h=o,!f.preload){g.next=12;break}return g.next=8,f.preload(o,u);case 8:d=g.sent,d.url&&(h=d.url),d.headers&&(l.loadOptions.fetch=bi(bi({},l.loadOptions.fetch),{},{headers:d.headers})),Object.assign(l,d);case 12:return g.next=14,(0,I_.load)(h,f,l.loadOptions);case 14:p=g.sent,m=new $l(p,bi({onTileLoad:this._onTileLoad.bind(this),onTileUnload:this._onTileUnload.bind(this),onTileError:this.props.onTileError},l)),this.setState({tileset3d:m,layerMap:{}}),this._updateTileset(this.state.activeViewports),this.props.onTilesetLoad(m);case 19:case"end":return g.stop()}},a,this)}));function i(a){return n.apply(this,arguments)}return i}()},{key:"_onTileLoad",value:function(i){var a=this.state.lastUpdatedViewports;this.props.onTileLoad(i),this._updateTileset(a),this.setNeedsUpdate()}},{key:"_onTileUnload",value:function(i){delete this.state.layerMap[i.id],this.props.onTileUnload(i)}},{key:"_updateTileset",value:function(i){var a=this;if(i){var o=this.state.tileset3d,s=this.context.timeline,u=Object.keys(i).length;!s||!u||!o||o.selectTiles(Object.values(i)).then(function(f){var l=a.state.frameNumber!==f;l&&a.setState({frameNumber:f})})}}},{key:"_getSubLayer",value:function(i,a){if(!i.content)return null;switch(i.type){case or.POINTCLOUD:return this._makePointCloudLayer(i,a);case or.SCENEGRAPH:return this._make3DModelLayer(i);case or.MESH:return this._makeSimpleMeshLayer(i,a);default:throw new Error("Tile3DLayer: Failed to render layer of type ".concat(i.content.type))}}},{key:"_makePointCloudLayer",value:function(i,a){var o=i.content,s=o.attributes,u=o.pointCount,f=o.constantRGBA,l=o.cartographicOrigin,h=o.modelMatrix,d=s.positions,p=s.normals,m=s.colors;if(!d)return null;var v=a&&a.props.data||{header:{vertexCount:u},attributes:{POSITION:d,NORMAL:p,COLOR_0:m}},g=this.props,y=g.pointSize,A=g.getPointColor,x=this.getSubLayerClass("pointcloud",O_.PointCloudLayer);return new x({pointSize:y},this.getSubLayerProps({id:"pointcloud"}),{id:"".concat(this.id,"-pointcloud-").concat(i.id),tile:i,data:v,coordinateSystem:Gr.COORDINATE_SYSTEM.METER_OFFSETS,coordinateOrigin:l,modelMatrix:h,getColor:f||A,_offset:0})}},{key:"_make3DModelLayer",value:function(i){var a=i.content,o=a.gltf,s=a.instances,u=a.cartographicOrigin,f=a.modelMatrix,l=this.getSubLayerClass("scenegraph",P_.ScenegraphLayer);return new l({_lighting:"pbr"},this.getSubLayerProps({id:"scenegraph"}),{id:"".concat(this.id,"-scenegraph-").concat(i.id),tile:i,data:s||B_,scenegraph:o,coordinateSystem:Gr.COORDINATE_SYSTEM.METER_OFFSETS,coordinateOrigin:u,modelMatrix:f,getTransformMatrix:function(d){return d.modelMatrix},getPosition:[0,0,0],_offset:0})}},{key:"_makeSimpleMeshLayer",value:function(i,a){var o=i.content,s=o.attributes,u=o.indices,f=o.modelMatrix,l=o.cartographicOrigin,h=o.coordinateSystem,d=h===void 0?Gr.COORDINATE_SYSTEM.METER_OFFSETS:h,p=o.material,m=o.featureIds,v=this.props._getMeshColor,g=a&&a.props.mesh||new M_.Geometry({drawMode:4,attributes:uP(s),indices:u}),y=this.getSubLayerClass("mesh",is);return new y(this.getSubLayerProps({id:"mesh"}),{id:"".concat(this.id,"-mesh-").concat(i.id),tile:i,mesh:g,data:B_,getColor:v(i),pbrMaterial:p,modelMatrix:f,coordinateOrigin:l,coordinateSystem:d,featureIds:m,_offset:0})}},{key:"renderLayers",value:function(){var i=this,a=this.state,o=a.tileset3d,s=a.layerMap;return o?o.tiles.map(function(u){var f=s[u.id]=s[u.id]||{tile:u},l=f.layer;return u.selected&&(l?f.needsUpdate&&(l=i._getSubLayer(u,l),f.needsUpdate=!1):l=i._getSubLayer(u)),f.layer=l,l}).filter(Boolean):null}}]),t}(Gr.CompositeLayer);c(qs,"defaultProps",sP);c(qs,"layerName","Tile3DLayer");function uP(e){var r={};return r.positions=bi(bi({},e.positions),{},{value:new Float32Array(e.positions.value)}),e.normals&&(r.normals=e.normals),e.texCoords&&(r.texCoords=e.texCoords),e.colors&&(r.colors=e.colors),e.uvRegions&&(r.uvRegions=e.uvRegions),r}ue();q();Y();N();var ru=X(xt()),yd=X(Ho()),V_=X(xt());N();var gd=X(re());ue();ue();function fP(e,r){var t=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=lP(e))||r&&e&&typeof e.length=="number"){t&&(e=t);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(f){throw f},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
187
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){t=t.call(e)},n:function(){var f=t.next();return a=f.done,f},e:function(f){o=!0,s=f},f:function(){try{!a&&t.return!=null&&t.return()}finally{if(o)throw s}}}}function lP(e,r){if(e){if(typeof e=="string")return R_(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);if(t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set")return Array.from(e);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return R_(e,r)}}function R_(e,r){(r==null||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}var cP=new Map([["centerX",Float64Array.BYTES_PER_ELEMENT],["centerY",Float64Array.BYTES_PER_ELEMENT],["centerZ",Float64Array.BYTES_PER_ELEMENT],["minHeight",Float32Array.BYTES_PER_ELEMENT],["maxHeight",Float32Array.BYTES_PER_ELEMENT],["boundingSphereCenterX",Float64Array.BYTES_PER_ELEMENT],["boundingSphereCenterY",Float64Array.BYTES_PER_ELEMENT],["boundingSphereCenterZ",Float64Array.BYTES_PER_ELEMENT],["boundingSphereRadius",Float64Array.BYTES_PER_ELEMENT],["horizonOcclusionPointX",Float64Array.BYTES_PER_ELEMENT],["horizonOcclusionPointY",Float64Array.BYTES_PER_ELEMENT],["horizonOcclusionPointZ",Float64Array.BYTES_PER_ELEMENT]]);function cd(e){return e>>1^-(e&1)}function hP(e){var r=0,t={},n=fP(cP),i;try{for(n.s();!(i=n.n()).done;){var a=D(i.value,2),o=a[0],s=a[1],u=s===8?e.getFloat64:e.getFloat32;t[o]=u.call(e,r,!0),r+=s}}catch(f){n.e(f)}finally{n.f()}return{header:t,headerEndPosition:r}}function dP(e,r){var t=r,n=3,i=e.getUint32(t,!0),a=new Uint16Array(i*n);t+=Uint32Array.BYTES_PER_ELEMENT;for(var o=Uint16Array.BYTES_PER_ELEMENT,s=i*o,u=t,f=u+s,l=f+s,h=0,d=0,p=0,m=0;m<i;m++)h+=cd(e.getUint16(u+o*m,!0)),d+=cd(e.getUint16(f+o*m,!0)),p+=cd(e.getUint16(l+o*m,!0)),a[m]=h,a[m+i]=d,a[m+i*2]=p;return t+=s*3,{vertexData:a,vertexDataEndPosition:t}}function Oa(e,r,t,n){var i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,a;if(n===2?a=new Uint16Array(e,r,t):a=new Uint32Array(e,r,t),!i)return a;for(var o=0,s=0;s<a.length;++s){var u=a[s];a[s]=o-u,u===0&&++o}return a}function pP(e,r,t){var n=t,i=3,a=r.length/i,o=a>65536?Uint32Array.BYTES_PER_ELEMENT:Uint16Array.BYTES_PER_ELEMENT;n%o!==0&&(n+=o-n%o);var s=e.getUint32(n,!0);n+=Uint32Array.BYTES_PER_ELEMENT;var u=s*3,f=Oa(e.buffer,n,u,o);return n+=u*o,{triangleIndicesEndPosition:n,triangleIndices:f}}function mP(e,r,t){var n=t,i=3,a=r.length/i,o=a>65536?Uint32Array.BYTES_PER_ELEMENT:Uint16Array.BYTES_PER_ELEMENT,s=e.getUint32(n,!0);n+=Uint32Array.BYTES_PER_ELEMENT;var u=Oa(e.buffer,n,s,o,!1);n+=s*o;var f=e.getUint32(n,!0);n+=Uint32Array.BYTES_PER_ELEMENT;var l=Oa(e.buffer,n,f,o,!1);n+=f*o;var h=e.getUint32(n,!0);n+=Uint32Array.BYTES_PER_ELEMENT;var d=Oa(e.buffer,n,h,o,!1);n+=h*o;var p=e.getUint32(n,!0);n+=Uint32Array.BYTES_PER_ELEMENT;var m=Oa(e.buffer,n,p,o,!1);return n+=p*o,{edgeIndicesEndPosition:n,westIndices:u,southIndices:l,eastIndices:d,northIndices:m}}function vP(e){return new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}function gP(e){return e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength)}function yP(e,r){var t={};if(e.byteLength<=r)return{extensions:t,extensionsEndPosition:r};for(var n=r;n<e.byteLength;){var i=e.getUint8(n,!0);n+=Uint8Array.BYTES_PER_ELEMENT;var a=e.getUint32(n,!0);n+=Uint32Array.BYTES_PER_ELEMENT;var o=new DataView(e.buffer,n,a);switch(i){case 1:{t.vertexNormals=vP(o);break}case 2:{t.waterMask=gP(o);break}default:}n+=a}return{extensions:t,extensionsEndPosition:n}}var Mn={header:0,vertices:1,triangleIndices:2,edgeIndices:3,extensions:4},AP={maxDecodingStep:Mn.extensions};function hd(e,r){var t=Object.assign({},AP,r),n=new DataView(e),i=hP(n),a=i.header,o=i.headerEndPosition;if(t.maxDecodingStep<Mn.vertices)return{header:a};var s=dP(n,o),u=s.vertexData,f=s.vertexDataEndPosition;if(t.maxDecodingStep<Mn.triangleIndices)return{header:a,vertexData:u};var l=pP(n,u,f),h=l.triangleIndices,d=l.triangleIndicesEndPosition;if(t.maxDecodingStep<Mn.edgeIndices)return{header:a,vertexData:u,triangleIndices:h};var p=mP(n,u,d),m=p.westIndices,v=p.southIndices,g=p.eastIndices,y=p.northIndices,A=p.edgeIndicesEndPosition;if(t.maxDecodingStep<Mn.extensions)return{header:a,vertexData:u,triangleIndices:h,westIndices:m,northIndices:y,eastIndices:g,southIndices:v};var x=yP(n,A),b=x.extensions;return{header:a,vertexData:u,triangleIndices:h,westIndices:m,northIndices:y,eastIndices:g,southIndices:v,extensions:b}}function Ks(e,r,t,n){for(var i=n?bP(n,e.POSITION.value):_P(r),a=new e.POSITION.value.constructor(i.length*6),o=new e.TEXCOORD_0.value.constructor(i.length*4),s=new r.constructor(i.length*6),u=0;u<i.length;u++){var f=i[u];TP({edge:f,edgeIndex:u,attributes:e,skirtHeight:t,newPosition:a,newTexcoord0:o,newTriangles:s})}e.POSITION.value=Pi(e.POSITION.value,a),e.TEXCOORD_0.value=Pi(e.TEXCOORD_0.value,o);var l=r instanceof Array?r.concat(s):Pi(r,s);return{attributes:e,triangles:l}}function _P(e){for(var r=[],t=0;t<e.length;t+=3)r.push([e[t],e[t+1]]),r.push([e[t+1],e[t+2]]),r.push([e[t+2],e[t]]);r.sort(function(s,u){return Math.min.apply(Math,K(s))-Math.min.apply(Math,K(u))||Math.max.apply(Math,K(s))-Math.max.apply(Math,K(u))});for(var n=[],i=0;i<r.length;){var a,o;r[i][0]===((a=r[i+1])===null||a===void 0?void 0:a[1])&&r[i][1]===((o=r[i+1])===null||o===void 0?void 0:o[0])?i+=2:(n.push(r[i]),i++)}return n}function bP(e,r){e.westIndices.sort(function(o,s){return r[3*o+1]-r[3*s+1]}),e.eastIndices.sort(function(o,s){return r[3*s+1]-r[3*o+1]}),e.southIndices.sort(function(o,s){return r[3*s]-r[3*o]}),e.northIndices.sort(function(o,s){return r[3*o]-r[3*s]});var t=[];for(var n in e)for(var i=e[n],a=0;a<i.length-1;a++)t.push([i[a],i[a+1]]);return t}function TP(e){var r=e.edge,t=e.edgeIndex,n=e.attributes,i=e.skirtHeight,a=e.newPosition,o=e.newTexcoord0,s=e.newTriangles,u=n.POSITION.value.length,f=t*2,l=t*2+1;a.set(n.POSITION.value.subarray(r[0]*3,r[0]*3+3),f*3),a[f*3+2]=a[f*3+2]-i,a.set(n.POSITION.value.subarray(r[1]*3,r[1]*3+3),l*3),a[l*3+2]=a[l*3+2]-i,o.set(n.TEXCOORD_0.value.subarray(r[0]*2,r[0]*2+2),f*2),o.set(n.TEXCOORD_0.value.subarray(r[1]*2,r[1]*2+2),l*2);var h=t*2*3;s[h]=r[0],s[h+1]=u/3+l,s[h+2]=r[1],s[h+3]=u/3+l,s[h+4]=r[0],s[h+5]=u/3+f}function xP(e,r,t){for(var n=r.minHeight,i=r.maxHeight,a=t||[0,0,1,1],o=D(a,4),s=o[0],u=o[1],f=o[2],l=o[3],h=f-s,d=l-u,p=i-n,m=e.length/3,v=new Float32Array(m*3),g=new Float32Array(m*2),y=0;y<m;y++){var A=e[y]/32767,x=e[y+m]/32767,b=e[y+m*2]/32767;v[3*y+0]=A*h+s,v[3*y+1]=x*d+u,v[3*y+2]=b*p+n,g[2*y+0]=A,g[2*y+1]=x}return{POSITION:{value:v,size:3},TEXCOORD_0:{value:g,size:2}}}function EP(e,r){if(!e)return null;var t=r.bounds,n=hd(e,Mn.triangleIndices),i=n.header,a=n.vertexData,o=n.triangleIndices,s=n.westIndices,u=n.northIndices,f=n.eastIndices,l=n.southIndices,h=o,d=xP(a,i,t),p=vn(d);if(r.skirtHeight){var m=Ks(d,h,r.skirtHeight,{westIndices:s,northIndices:u,eastIndices:f,southIndices:l}),v=m.attributes,g=m.triangles;d=v,h=g}return{loaderData:{header:{}},header:{vertexCount:h.length,boundingBox:p},mode:4,indices:{value:h,size:1},attributes:d}}function Ys(e,r){return EP(e,r["quantized-mesh"])}N();ue();var pd=X(re());var Pa=class{constructor(r=257){this.gridSize=r;let t=r-1;if(t&t-1)throw new Error(`Expected grid size to be 2^n+1, got ${r}.`);this.numTriangles=t*t*2-2,this.numParentTriangles=this.numTriangles-t*t,this.indices=new Uint32Array(this.gridSize*this.gridSize),this.coords=new Uint16Array(this.numTriangles*4);for(let n=0;n<this.numTriangles;n++){let i=n+2,a=0,o=0,s=0,u=0,f=0,l=0;for(i&1?s=u=f=t:a=o=l=t;(i>>=1)>1;){let d=a+s>>1,p=o+u>>1;i&1?(s=a,u=o,a=f,o=l):(a=s,o=u,s=f,u=l),f=d,l=p}let h=n*4;this.coords[h+0]=a,this.coords[h+1]=o,this.coords[h+2]=s,this.coords[h+3]=u}}createTile(r){return new dd(r,this)}},dd=class{constructor(r,t){let n=t.gridSize;if(r.length!==n*n)throw new Error(`Expected terrain data of length ${n*n} (${n} x ${n}), got ${r.length}.`);this.terrain=r,this.martini=t,this.errors=new Float32Array(r.length),this.update()}update(){let{numTriangles:r,numParentTriangles:t,coords:n,gridSize:i}=this.martini,{terrain:a,errors:o}=this;for(let s=r-1;s>=0;s--){let u=s*4,f=n[u+0],l=n[u+1],h=n[u+2],d=n[u+3],p=f+h>>1,m=l+d>>1,v=p+m-l,g=m+f-p,y=(a[l*i+f]+a[d*i+h])/2,A=m*i+p,x=Math.abs(y-a[A]);if(o[A]=Math.max(o[A],x),s<t){let b=(l+g>>1)*i+(f+v>>1),M=(d+g>>1)*i+(h+v>>1);o[A]=Math.max(o[A],o[b],o[M])}}}getMesh(r=0){let{gridSize:t,indices:n}=this.martini,{errors:i}=this,a=0,o=0,s=t-1;n.fill(0);function u(p,m,v,g,y,A){let x=p+v>>1,b=m+g>>1;Math.abs(p-y)+Math.abs(m-A)>1&&i[b*t+x]>r?(u(y,A,p,m,x,b),u(v,g,y,A,x,b)):(n[m*t+p]=n[m*t+p]||++a,n[g*t+v]=n[g*t+v]||++a,n[A*t+y]=n[A*t+y]||++a,o++)}u(0,0,s,s,s,0),u(s,s,0,0,0,s);let f=new Uint16Array(a*2),l=new Uint32Array(o*3),h=0;function d(p,m,v,g,y,A){let x=p+v>>1,b=m+g>>1;if(Math.abs(p-y)+Math.abs(m-A)>1&&i[b*t+x]>r)d(y,A,p,m,x,b),d(v,g,y,A,x,b);else{let M=n[m*t+p]-1,C=n[g*t+v]-1,F=n[A*t+y]-1;f[2*M]=p,f[2*M+1]=m,f[2*C]=v,f[2*C+1]=g,f[2*F]=y,f[2*F+1]=A,l[h++]=M,l[h++]=C,l[h++]=F}}return d(0,0,s,s,s,0),d(s,s,0,0,0,s),{vertices:f,triangles:l}}};q();Y();var F_=function(){function e(r,t){T(this,e);var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:t;this.data=r,this.width=t,this.height=n,this.coords=[],this.triangles=[],this._halfedges=[],this._candidates=[],this._queueIndices=[],this._queue=[],this._errors=[],this._rms=[],this._pending=[],this._pendingLen=0,this._rmsSum=0;var i=t-1,a=n-1,o=this._addPoint(0,0),s=this._addPoint(i,0),u=this._addPoint(0,a),f=this._addPoint(i,a),l=this._addTriangle(f,o,u,-1,-1,-1);this._addTriangle(o,f,s,l,-1,-1),this._flush()}return w(e,[{key:"run",value:function(){for(var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1;this.getMaxError()>t;)this.refine()}},{key:"refine",value:function(){this._step(),this._flush()}},{key:"getMaxError",value:function(){return this._errors[0]}},{key:"getRMSD",value:function(){return this._rmsSum>0?Math.sqrt(this._rmsSum/(this.width*this.height)):0}},{key:"heightAt",value:function(t,n){return this.data[this.width*n+t]}},{key:"_flush",value:function(){for(var t=this.coords,n=0;n<this._pendingLen;n++){var i=this._pending[n],a=2*this.triangles[i*3+0],o=2*this.triangles[i*3+1],s=2*this.triangles[i*3+2];this._findCandidate(t[a],t[a+1],t[o],t[o+1],t[s],t[s+1],i)}this._pendingLen=0}},{key:"_findCandidate",value:function(t,n,i,a,o,s,u){for(var f=Math.min(t,i,o),l=Math.min(n,a,s),h=Math.max(t,i,o),d=Math.max(n,a,s),p=On(i,a,o,s,f,l),m=On(o,s,t,n,f,l),v=On(t,n,i,a,f,l),g=a-n,y=t-i,A=s-a,x=i-o,b=n-s,M=o-t,C=On(t,n,i,a,o,s),F=this.heightAt(t,n)/C,B=this.heightAt(i,a)/C,S=this.heightAt(o,s)/C,_=0,R=0,k=0,U=0,j=l;j<=d;j++){var Z=0;p<0&&A!==0&&(Z=Math.max(Z,Math.floor(-p/A))),m<0&&b!==0&&(Z=Math.max(Z,Math.floor(-m/b))),v<0&&g!==0&&(Z=Math.max(Z,Math.floor(-v/g)));for(var P=p+A*Z,O=m+b*Z,G=v+g*Z,J=!1,V=f+Z;V<=h;V++){if(P>=0&&O>=0&&G>=0){J=!0;var ee=F*P+B*O+S*G,ie=Math.abs(ee-this.heightAt(V,j));U+=ie*ie,ie>_&&(_=ie,R=V,k=j)}else if(J)break;P+=A,O+=b,G+=g}p+=x,m+=M,v+=y}(R===t&&k===n||R===i&&k===a||R===o&&k===s)&&(_=0),this._candidates[2*u]=R,this._candidates[2*u+1]=k,this._rms[u]=U,this._queuePush(u,_,U)}},{key:"_step",value:function(){var t=this._queuePop(),n=t*3+0,i=t*3+1,a=t*3+2,o=this.triangles[n],s=this.triangles[i],u=this.triangles[a],f=this.coords[2*o],l=this.coords[2*o+1],h=this.coords[2*s],d=this.coords[2*s+1],p=this.coords[2*u],m=this.coords[2*u+1],v=this._candidates[2*t],g=this._candidates[2*t+1],y=this._addPoint(v,g);if(On(f,l,h,d,v,g)===0)this._handleCollinear(y,n);else if(On(h,d,p,m,v,g)===0)this._handleCollinear(y,i);else if(On(p,m,f,l,v,g)===0)this._handleCollinear(y,a);else{var A=this._halfedges[n],x=this._halfedges[i],b=this._halfedges[a],M=this._addTriangle(o,s,y,A,-1,-1,n),C=this._addTriangle(s,u,y,x,-1,M+1),F=this._addTriangle(u,o,y,b,M+2,C+1);this._legalize(M),this._legalize(C),this._legalize(F)}}},{key:"_addPoint",value:function(t,n){var i=this.coords.length>>1;return this.coords.push(t,n),i}},{key:"_addTriangle",value:function(t,n,i,a,o,s){var u=arguments.length>6&&arguments[6]!==void 0?arguments[6]:this.triangles.length,f=u/3;return this.triangles[u+0]=t,this.triangles[u+1]=n,this.triangles[u+2]=i,this._halfedges[u+0]=a,this._halfedges[u+1]=o,this._halfedges[u+2]=s,a>=0&&(this._halfedges[a]=u+0),o>=0&&(this._halfedges[o]=u+1),s>=0&&(this._halfedges[s]=u+2),this._candidates[2*f+0]=0,this._candidates[2*f+1]=0,this._queueIndices[f]=-1,this._rms[f]=0,this._pending[this._pendingLen++]=f,u}},{key:"_legalize",value:function(t){var n=this._halfedges[t];if(!(n<0)){var i=t-t%3,a=n-n%3,o=i+(t+1)%3,s=i+(t+2)%3,u=a+(n+2)%3,f=a+(n+1)%3,l=this.triangles[s],h=this.triangles[t],d=this.triangles[o],p=this.triangles[u],m=this.coords;if(SP(m[2*l],m[2*l+1],m[2*h],m[2*h+1],m[2*d],m[2*d+1],m[2*p],m[2*p+1])){var v=this._halfedges[o],g=this._halfedges[s],y=this._halfedges[u],A=this._halfedges[f];this._queueRemove(i/3),this._queueRemove(a/3);var x=this._addTriangle(l,p,d,-1,y,v,i),b=this._addTriangle(p,l,h,x,g,A,a);this._legalize(x+1),this._legalize(b+2)}}}},{key:"_handleCollinear",value:function(t,n){var i=n-n%3,a=i+(n+1)%3,o=i+(n+2)%3,s=this.triangles[o],u=this.triangles[n],f=this.triangles[a],l=this._halfedges[a],h=this._halfedges[o],d=this._halfedges[n];if(d<0){var p=this._addTriangle(t,s,u,-1,h,-1,i),m=this._addTriangle(s,t,f,p,-1,l);this._legalize(p+1),this._legalize(m+2);return}var v=d-d%3,g=v+(d+2)%3,y=v+(d+1)%3,A=this.triangles[g],x=this._halfedges[g],b=this._halfedges[y];this._queueRemove(v/3);var M=this._addTriangle(s,u,t,h,-1,-1,i),C=this._addTriangle(u,A,t,b,-1,M+1,v),F=this._addTriangle(A,f,t,x,-1,C+1),B=this._addTriangle(f,s,t,l,M+2,F+1);this._legalize(M),this._legalize(C),this._legalize(F),this._legalize(B)}},{key:"_queuePush",value:function(t,n,i){var a=this._queue.length;this._queueIndices[t]=a,this._queue.push(t),this._errors.push(n),this._rmsSum+=i,this._queueUp(a)}},{key:"_queuePop",value:function(){var t=this._queue.length-1;return this._queueSwap(0,t),this._queueDown(0,t),this._queuePopBack()}},{key:"_queuePopBack",value:function(){var t=this._queue.pop();return this._errors.pop(),this._rmsSum-=this._rms[t],this._queueIndices[t]=-1,t}},{key:"_queueRemove",value:function(t){var n=this._queueIndices[t];if(n<0){var i=this._pending.indexOf(t);if(i!==-1)this._pending[i]=this._pending[--this._pendingLen];else throw new Error("Broken triangulation (something went wrong).");return}var a=this._queue.length-1;a!==n&&(this._queueSwap(n,a),this._queueDown(n,a)||this._queueUp(n)),this._queuePopBack()}},{key:"_queueLess",value:function(t,n){return this._errors[t]>this._errors[n]}},{key:"_queueSwap",value:function(t,n){var i=this._queue[t],a=this._queue[n];this._queue[t]=a,this._queue[n]=i,this._queueIndices[i]=n,this._queueIndices[a]=t;var o=this._errors[t];this._errors[t]=this._errors[n],this._errors[n]=o}},{key:"_queueUp",value:function(t){for(var n=t;;){var i=n-1>>1;if(i===n||!this._queueLess(n,i))break;this._queueSwap(i,n),n=i}}},{key:"_queueDown",value:function(t,n){for(var i=t;;){var a=2*i+1;if(a>=n||a<0)break;var o=a+1,s=a;if(o<n&&this._queueLess(o,a)&&(s=o),!this._queueLess(s,i))break;this._queueSwap(i,s),i=s}return i>t}}]),e}();function On(e,r,t,n,i,a){return(t-i)*(r-a)-(n-a)*(e-i)}function SP(e,r,t,n,i,a,o,s){var u=e-o,f=r-s,l=t-o,h=n-s,d=i-o,p=a-s,m=u*u+f*f,v=l*l+h*h,g=d*d+p*p;return u*(h*g-v*p)-f*(l*g-v*d)+m*(l*p-h*d)<0}function L_(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),t.push.apply(t,n)}return t}function Zs(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{};r%2?L_(Object(t),!0).forEach(function(n){c(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):L_(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}function $s(e,r,t,n,i){for(var a=n.rScaler,o=n.bScaler,s=n.gScaler,u=n.offset,f=new Float32Array((r+1)*(t+1)),l=0,h=0;h<t;h++)for(var d=0;d<r;d++,l++){var p=l*4,m=e[p+0],v=e[p+1],g=e[p+2];f[l+h]=m*a+v*s+g*o+u}if(i==="martini"){for(var y=(r+1)*r,A=0;A<r;A++,y++)f[y]=f[y-r-1];for(var x=t,b=0;b<t+1;b++,x+=t+1)f[x]=f[x-1]}return f}function wP(e,r,t,n,i){for(var a=t+1,o=e.length/2,s=new Float32Array(o*3),u=new Float32Array(o*2),f=i||[0,0,t,n],l=D(f,4),h=l[0],d=l[1],p=l[2],m=l[3],v=(p-h)/t,g=(m-d)/n,y=0;y<o;y++){var A=e[y*2],x=e[y*2+1],b=x*a+A;s[3*y+0]=A*v+h,s[3*y+1]=-x*g+m,s[3*y+2]=r[b],u[2*y+0]=A/t,u[2*y+1]=x/n}return{POSITION:{value:s,size:3},TEXCOORD_0:{value:u,size:2}}}function CP(e,r){if(e===null)return null;var t=r.meshMaxError,n=r.bounds,i=r.elevationDecoder,a=e.data,o=e.width,s=e.height,u,f;switch(r.tesselator){case"martini":u=$s(a,o,s,i,r.tesselator),f=k_(t,o,u);break;case"delatin":u=$s(a,o,s,i,r.tesselator),f=D_(t,o,s,u);break;default:o===s&&!(s&o-1)?(u=$s(a,o,s,i,"martini"),f=k_(t,o,u)):(u=$s(a,o,s,i,"delatin"),f=D_(t,o,s,u));break}var l=f,h=l.vertices,d=f,p=d.triangles,m=wP(h,u,o,s,n),v=vn(m);if(r.skirtHeight){var g=Ks(m,p,r.skirtHeight),y=g.attributes,A=g.triangles;m=y,p=A}return{loaderData:{header:{}},header:{vertexCount:p.length,boundingBox:v},mode:4,indices:{value:Uint32Array.from(p),size:1},attributes:m}}function k_(e,r,t){var n=r+1,i=new Pa(n),a=i.createTile(t),o=a.getMesh(e),s=o.vertices,u=o.triangles;return{vertices:s,triangles:u}}function D_(e,r,t,n){var i=new F_(n,r+1,t+1);i.run(e);var a=i.coords,o=i.triangles,s=a;return{vertices:s,triangles:o}}function vd(e,r,t){return md.apply(this,arguments)}function md(){return md=I(pd.default.mark(function e(r,t,n){var i,a;return pd.default.wrap(function(s){for(;;)switch(s.prev=s.next){case 0:return i=Zs(Zs({},t),{},{mimeType:"application/x.image",image:Zs(Zs({},t.image),{},{type:"data"})}),s.next=3,n.parse(r,i);case 3:return a=s.sent,s.abrupt("return",CP(a,t.terrain));case 5:case"end":return s.stop()}},e)})),md.apply(this,arguments)}var Qs="3.4.13";var eu={name:"Terrain",id:"terrain",module:"terrain",version:Qs,worker:!0,extensions:["png","pngraw","jpg","jpeg","gif","webp","bmp"],mimeTypes:["image/png","image/jpeg","image/gif","image/webp","image/bmp"],options:{terrain:{tesselator:"auto",bounds:null,meshMaxError:10,elevationDecoder:{rScaler:1,gScaler:0,bScaler:0,offset:0},skirtHeight:null}}};var G_={name:"Quantized Mesh",id:"quantized-mesh",module:"terrain",version:Qs,worker:!0,extensions:["terrain"],mimeTypes:["application/vnd.quantized-mesh"],options:{"quantized-mesh":{bounds:[0,0,1,1],skirtHeight:null}}};function N_(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),t.push.apply(t,n)}return t}function tu(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{};r%2?N_(Object(t),!0).forEach(function(n){c(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):N_(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}var pte=tu(tu({},eu),{},{parse:vd});var mte=tu(tu({},G_),{},{parseSync:Ys,parse:function(){var e=I(gd.default.mark(function t(n,i){return gd.default.wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return o.abrupt("return",Ys(n,i));case 1:case"end":return o.stop()}},t)}));function r(t,n){return e.apply(this,arguments)}return r}()});function BP(e){var r=MP();return function(){var n=L(e),i;if(r){var a=L(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return $(this,i)}}function MP(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function U_(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),t.push.apply(t,n)}return t}function Nr(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{};r%2?U_(Object(t),!0).forEach(function(n){c(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):U_(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}var j_=[1],OP=Nr(Nr({},er.defaultProps),{},{elevationData:Er,texture:Nr(Nr({},Er),{},{optional:!0}),meshMaxError:{type:"number",value:4},bounds:{type:"array",value:null,optional:!0,compare:!0},color:{type:"color",value:[255,255,255]},elevationDecoder:{type:"object",value:{rScaler:1,gScaler:0,bScaler:0,offset:0}},workerUrl:"",wireframe:!1,material:!0,loaders:[eu]});function H_(e){return Array.isArray(e)?e.join(";"):e||""}var nu=function(e){H(t,e);var r=BP(t);function t(){var n;T(this,t);for(var i=arguments.length,a=new Array(i),o=0;o<i;o++)a[o]=arguments[o];return n=r.call.apply(r,[this].concat(a)),c(oe(n),"state",void 0),n}return w(t,[{key:"updateState",value:function(i){var a=i.props,o=i.oldProps,s=a.elevationData!==o.elevationData;if(s){var u=a.elevationData,f=u&&(Array.isArray(u)||u.includes("{x}")&&u.includes("{y}"));this.setState({isTiled:f})}var l=s||a.meshMaxError!==o.meshMaxError||a.elevationDecoder!==o.elevationDecoder||a.bounds!==o.bounds;if(!this.state.isTiled&&l){var h=this.loadTerrain(a);this.setState({terrain:h})}a.workerUrl&&ru.log.removed("workerUrl","loadOptions.terrain.workerUrl")()}},{key:"loadTerrain",value:function(i){var a,o=i.elevationData,s=i.bounds,u=i.elevationDecoder,f=i.meshMaxError,l=i.signal;if(!o)return null;var h=this.getLoadOptions();h=Nr(Nr({},h),{},{terrain:Nr(Nr({skirtHeight:this.state.isTiled?f*2:0},(a=h)===null||a===void 0?void 0:a.terrain),{},{bounds:s,meshMaxError:f,elevationDecoder:u})});var d=this.props.fetch;return d(o,{propName:"elevationData",layer:this,loadOptions:h,signal:l})}},{key:"getTiledTerrainData",value:function(i){var a=this.props,o=a.elevationData,s=a.fetch,u=a.texture,f=a.elevationDecoder,l=a.meshMaxError,h=this.context.viewport,d=jt(o,i),p=u&&jt(u,i),m=i.signal,v=[0,0],g=[0,0];if(h.isGeospatial){var y=i.bbox;v=h.projectFlat([y.west,y.south]),g=h.projectFlat([y.east,y.north])}else{var A=i.bbox;v=[A.left,A.bottom],g=[A.right,A.top]}var x=[v[0],v[1],g[0],g[1]],b=this.loadTerrain({elevationData:d,bounds:x,elevationDecoder:f,meshMaxError:l,signal:m}),M=p?s(p,{propName:"texture",layer:this,loaders:[],signal:m}).catch(function(C){return null}):Promise.resolve(null);return Promise.all([b,M])}},{key:"renderSubLayers",value:function(i){var a=this.getSubLayerClass("mesh",yd.SimpleMeshLayer),o=this.props,s=o.color,u=o.wireframe,f=o.material,l=i.data;if(!l)return null;var h=D(l,2),d=h[0],p=h[1];return new a(i,{data:j_,mesh:d,texture:p,_instanced:!1,coordinateSystem:V_.COORDINATE_SYSTEM.CARTESIAN,getPosition:function(v){return[0,0,0]},getColor:s,wireframe:u,material:f})}},{key:"onViewportLoad",value:function(i){if(i){var a=this.state.zRange,o=i.map(function(f){return f.content}).filter(Boolean).map(function(f){var l=f[0].header.boundingBox;return l.map(function(h){return h[2]})});if(o.length!==0){var s=Math.min.apply(Math,K(o.map(function(f){return f[0]}))),u=Math.max.apply(Math,K(o.map(function(f){return f[1]})));(!a||s<a[0]||u>a[1])&&this.setState({zRange:[s,u]})}}}},{key:"renderLayers",value:function(){var i=this.props,a=i.color,o=i.material,s=i.elevationData,u=i.texture,f=i.wireframe,l=i.meshMaxError,h=i.elevationDecoder,d=i.tileSize,p=i.maxZoom,m=i.minZoom,v=i.extent,g=i.maxRequests,y=i.onTileLoad,A=i.onTileUnload,x=i.onTileError,b=i.maxCacheSize,M=i.maxCacheByteSize,C=i.refinementStrategy;if(this.state.isTiled)return new er(this.getSubLayerProps({id:"tiles"}),{getTileData:this.getTiledTerrainData.bind(this),renderSubLayers:this.renderSubLayers.bind(this),updateTriggers:{getTileData:{elevationData:H_(s),texture:H_(u),meshMaxError:l,elevationDecoder:h}},onViewportLoad:this.onViewportLoad.bind(this),zRange:this.state.zRange||null,tileSize:d,maxZoom:p,minZoom:m,extent:v,maxRequests:g,onTileLoad:y,onTileUnload:A,onTileError:x,maxCacheSize:b,maxCacheByteSize:M,refinementStrategy:C});if(!s)return null;var F=this.getSubLayerClass("mesh",yd.SimpleMeshLayer);return new F(this.getSubLayerProps({id:"mesh"}),{data:j_,mesh:this.state.terrain,texture:u,_instanced:!1,getPosition:function(S){return[0,0,0]},getColor:a,material:o,wireframe:f})}}]),t}(ru.CompositeLayer);c(nu,"defaultProps",OP);c(nu,"layerName","TerrainLayer");q();Y();N();var Hd=X(re()),mu=X(xt()),Vd=X(Tt()),qb=X(W_());N();var Dd=X(re());ue();N();q();Y();N();function Ad(e,r){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},n=J_(e,t);return n!==r?(PP(e,t),!0):!1}function J_(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return Math.sign(hr(e,r))}function hr(e){for(var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=r.start,n=t===void 0?0:t,i=r.end,a=i===void 0?e.length:i,o=r.size||2,s=0,u=n,f=a-o;u<a;u+=o)s+=(e[u]-e[f])*(e[u+1]+e[f+1]),f=u;return s/2}function _d(e,r){for(var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},n=t.start,i=n===void 0?0:n,a=t.end,o=a===void 0?e.length:a,s=t.size,u=s===void 0?2:s,f=t.isClosed,l=(o-i)/u,h=0;h<l-1;++h)r(e[i+h*u],e[i+h*u+1],e[i+(h+1)*u],e[i+(h+1)*u+1],h,h+1);var d=i+(l-1)*u,p=f||He(e[i],e[d])&&He(e[i+1],e[d+1]);p||r(e[d],e[d+1],e[i],e[i+1],l-1,0)}function PP(e,r){for(var t=r.start,n=t===void 0?0:t,i=r.end,a=i===void 0?e.length:i,o=r.size,s=o===void 0?2:o,u=(a-n)/s,f=Math.floor(u/2),l=0;l<f;++l)for(var h=n+l*s,d=n+(u-1-l)*s,p=0;p<s;++p){var m=e[h+p];e[h+p]=e[d+p],e[d+p]=m}}function X_(e,r){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},n=IP(e,t);return n!==r?(e.reverse(),!0):!1}function IP(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return Math.sign(bd(e,r))}function bd(e){for(var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=r.start,n=t===void 0?0:t,i=r.end,a=i===void 0?e.length:i,o=0,s=n,u=a-1;s<a;++s)o+=(e[s][0]-e[u][0])*(e[s][1]+e[u][1]),u=s;return o/2}function q_(e,r){for(var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},n=t.start,i=n===void 0?0:n,a=t.end,o=a===void 0?e.length:a,s=t.isClosed,u=i;u<o-1;++u)r(e[u],e[u+1],u,u+1);var f=s||He(e[o-1],e[0]);f||r(e[o-1],e[0],o-1,0)}var K_=function(){function e(r){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};T(this,e),c(this,"points",void 0),c(this,"isFlatArray",void 0),c(this,"options",void 0),this.points=r,this.isFlatArray=!Qe(r[0]),this.options={start:t.start||0,end:t.end||r.length,size:t.size||2,isClosed:t.isClosed},Object.freeze(this)}return w(e,[{key:"getSignedArea",value:function(){return this.isFlatArray?hr(this.points,this.options):bd(this.points,this.options)}},{key:"getArea",value:function(){return Math.abs(this.getSignedArea())}},{key:"getWindingDirection",value:function(){return Math.sign(this.getSignedArea())}},{key:"forEachSegment",value:function(t){this.isFlatArray?_d(this.points,function(n,i,a,o,s,u){t([n,i],[a,o],s,u)},this.options):q_(this.points,t,this.options)}},{key:"modifyWindingDirection",value:function(t){return this.isFlatArray?Ad(this.points,t,this.options):X_(this.points,t,this.options)}}]),e}();function Ed(e,r){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:2,n=arguments.length>3?arguments[3]:void 0,i=r&&r.length,a=i?r[0]*t:e.length,o=Z_(e,0,a,t,!0,n&&n[0]),s=[];if(!o||o.next===o.prev)return s;var u,f,l,h,d,p,m;if(i&&(o=DP(e,r,o,t,n)),e.length>80*t){h=f=e[0],d=l=e[1];for(var v=t;v<a;v+=t)p=e[v],m=e[v+1],p<h&&(h=p),m<d&&(d=m),p>f&&(f=p),m>l&&(l=m);u=Math.max(f-h,l-d),u=u!==0?1/u:0}return Ia(o,s,t,h,d,u),s}function Z_(e,r,t,n,i,a){var o,s;if(a===void 0&&(a=hr(e,{start:r,end:t,size:n})),i===a<0)for(o=r;o<t;o+=n)s=Y_(o,e[o],e[o+1],s);else for(o=t-n;o>=r;o-=n)s=Y_(o,e[o],e[o+1],s);return s&&ou(s,s.next)&&(Fa(s),s=s.next),s}function Ur(e,r){if(!e)return e;r||(r=e);var t=e,n;do if(n=!1,!t.steiner&&(ou(t,t.next)||Ie(t.prev,t,t.next)===0)){if(Fa(t),t=r=t.prev,t===t.next)break;n=!0}else t=t.next;while(n||t!==r);return r}function Ia(e,r,t,n,i,a,o){if(e){!o&&a&&HP(e,n,i,a);for(var s=e,u,f;e.prev!==e.next;){if(u=e.prev,f=e.next,a?FP(e,n,i,a):RP(e)){r.push(u.i/t),r.push(e.i/t),r.push(f.i/t),Fa(e),e=f.next,s=f.next;continue}if(e=f,e===s){o?o===1?(e=LP(Ur(e),r,t),Ia(e,r,t,n,i,a,2)):o===2&&kP(e,r,t,n,i,a):Ia(Ur(e),r,t,n,i,a,1);break}}}}function RP(e){var r=e.prev,t=e,n=e.next;if(Ie(r,t,n)>=0)return!1;for(var i=e.next.next;i!==e.prev;){if(Ti(r.x,r.y,t.x,t.y,n.x,n.y,i.x,i.y)&&Ie(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}function FP(e,r,t,n){var i=e.prev,a=e,o=e.next;if(Ie(i,a,o)>=0)return!1;for(var s=i.x<a.x?i.x<o.x?i.x:o.x:a.x<o.x?a.x:o.x,u=i.y<a.y?i.y<o.y?i.y:o.y:a.y<o.y?a.y:o.y,f=i.x>a.x?i.x>o.x?i.x:o.x:a.x>o.x?a.x:o.x,l=i.y>a.y?i.y>o.y?i.y:o.y:a.y>o.y?a.y:o.y,h=Td(s,u,r,t,n),d=Td(f,l,r,t,n),p=e.prevZ,m=e.nextZ;p&&p.z>=h&&m&&m.z<=d;){if(p!==e.prev&&p!==e.next&&Ti(i.x,i.y,a.x,a.y,o.x,o.y,p.x,p.y)&&Ie(p.prev,p,p.next)>=0||(p=p.prevZ,m!==e.prev&&m!==e.next&&Ti(i.x,i.y,a.x,a.y,o.x,o.y,m.x,m.y)&&Ie(m.prev,m,m.next)>=0))return!1;m=m.nextZ}for(;p&&p.z>=h;){if(p!==e.prev&&p!==e.next&&Ti(i.x,i.y,a.x,a.y,o.x,o.y,p.x,p.y)&&Ie(p.prev,p,p.next)>=0)return!1;p=p.prevZ}for(;m&&m.z<=d;){if(m!==e.prev&&m!==e.next&&Ti(i.x,i.y,a.x,a.y,o.x,o.y,m.x,m.y)&&Ie(m.prev,m,m.next)>=0)return!1;m=m.nextZ}return!0}function LP(e,r,t){var n=e;do{var i=n.prev,a=n.next.next;!ou(i,a)&&$_(i,n,n.next,a)&&Ra(i,a)&&Ra(a,i)&&(r.push(i.i/t),r.push(n.i/t),r.push(a.i/t),Fa(n),Fa(n.next),n=e=a),n=n.next}while(n!==e);return Ur(n)}function kP(e,r,t,n,i,a){var o=e;do{for(var s=o.next.next;s!==o.prev;){if(o.i!==s.i&&WP(o,s)){var u=Q_(o,s);o=Ur(o,o.next),u=Ur(u,u.next),Ia(o,r,t,n,i,a),Ia(u,r,t,n,i,a);return}s=s.next}o=o.next}while(o!==e)}function DP(e,r,t,n,i){var a=[],o,s,u,f,l;for(o=0,s=r.length;o<s;o++)u=r[o]*n,f=o<s-1?r[o+1]*n:e.length,l=Z_(e,u,f,n,!1,i&&i[o+1]),l===l.next&&(l.steiner=!0),a.push(zP(l));for(a.sort(GP),o=0;o<a.length;o++)NP(a[o],t),t=Ur(t,t.next);return t}function GP(e,r){return e.x-r.x}function NP(e,r){if(r=UP(e,r),r){var t=Q_(r,e);Ur(r,r.next),Ur(t,t.next)}}function UP(e,r){var t=r,n=e.x,i=e.y,a=-1/0,o;do{if(i<=t.y&&i>=t.next.y&&t.next.y!==t.y){var s=t.x+(i-t.y)*(t.next.x-t.x)/(t.next.y-t.y);if(s<=n&&s>a){if(a=s,s===n){if(i===t.y)return t;if(i===t.next.y)return t.next}o=t.x<t.next.x?t:t.next}}t=t.next}while(t!==r);if(!o)return null;if(n===a)return o;var u=o,f=o.x,l=o.y,h=1/0,d;t=o;do n>=t.x&&t.x>=f&&n!==t.x&&Ti(i<l?n:a,i,f,l,i<l?a:n,i,t.x,t.y)&&(d=Math.abs(i-t.y)/(n-t.x),Ra(t,e)&&(d<h||d===h&&(t.x>o.x||t.x===o.x&&jP(o,t)))&&(o=t,h=d)),t=t.next;while(t!==u);return o}function jP(e,r){return Ie(e.prev,e,r.prev)<0&&Ie(r.next,e,e.next)<0}function HP(e,r,t,n){var i=e;do i.z===null&&(i.z=Td(i.x,i.y,r,t,n)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next;while(i!==e);i.prevZ.nextZ=null,i.prevZ=null,VP(i)}function VP(e){var r,t,n=1,i,a,o,s,u,f;do{for(a=e,e=null,f=null,i=0;a;){for(i++,s=a,o=0,t=0;t<n&&(o++,s=s.nextZ,!!s);t++);for(u=n;o>0||u>0&&s;)o!==0&&(u===0||!s||a.z<=s.z)?(r=a,a=a.nextZ,o--):(r=s,s=s.nextZ,u--),f?f.nextZ=r:e=r,r.prevZ=f,f=r;a=s}f.nextZ=null,n*=2}while(i>1);return e}function Td(e,r,t,n,i){return e=32767*(e-t)*i,r=32767*(r-n)*i,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,r=(r|r<<8)&16711935,r=(r|r<<4)&252645135,r=(r|r<<2)&858993459,r=(r|r<<1)&1431655765,e|r<<1}function zP(e){var r=e,t=e;do(r.x<t.x||r.x===t.x&&r.y<t.y)&&(t=r),r=r.next;while(r!==e);return t}function Ti(e,r,t,n,i,a,o,s){return(i-o)*(r-s)-(e-o)*(a-s)>=0&&(e-o)*(n-s)-(t-o)*(r-s)>=0&&(t-o)*(a-s)-(i-o)*(n-s)>=0}function WP(e,r){return e.next.i!==r.i&&e.prev.i!==r.i&&!JP(e,r)&&(Ra(e,r)&&Ra(r,e)&&XP(e,r)&&(Ie(e.prev,e,r.prev)||Ie(e,r.prev,r))||ou(e,r)&&Ie(e.prev,e,e.next)>0&&Ie(r.prev,r,r.next)>0)}function Ie(e,r,t){return(r.y-e.y)*(t.x-r.x)-(r.x-e.x)*(t.y-r.y)}function ou(e,r){return e.x===r.x&&e.y===r.y}function $_(e,r,t,n){var i=au(Ie(e,r,t)),a=au(Ie(e,r,n)),o=au(Ie(t,n,e)),s=au(Ie(t,n,r));return!!(i!==a&&o!==s||i===0&&iu(e,t,r)||a===0&&iu(e,n,r)||o===0&&iu(t,e,n)||s===0&&iu(t,r,n))}function iu(e,r,t){return r.x<=Math.max(e.x,t.x)&&r.x>=Math.min(e.x,t.x)&&r.y<=Math.max(e.y,t.y)&&r.y>=Math.min(e.y,t.y)}function au(e){return e>0?1:e<0?-1:0}function JP(e,r){var t=e;do{if(t.i!==e.i&&t.next.i!==e.i&&t.i!==r.i&&t.next.i!==r.i&&$_(t,t.next,e,r))return!0;t=t.next}while(t!==e);return!1}function Ra(e,r){return Ie(e.prev,e,e.next)<0?Ie(e,r,e.next)>=0&&Ie(e,e.prev,r)>=0:Ie(e,r,e.prev)<0||Ie(e,e.next,r)<0}function XP(e,r){var t=e,n=!1,i=(e.x+r.x)/2,a=(e.y+r.y)/2;do t.y>a!=t.next.y>a&&t.next.y!==t.y&&i<(t.next.x-t.x)*(a-t.y)/(t.next.y-t.y)+t.x&&(n=!n),t=t.next;while(t!==e);return n}function Q_(e,r){var t=new xd(e.i,e.x,e.y),n=new xd(r.i,r.x,r.y),i=e.next,a=r.prev;return e.next=r,r.prev=e,t.next=i,i.prev=t,n.next=t,t.prev=n,a.next=n,n.prev=a,n}function Y_(e,r,t,n){var i=new xd(e,r,t);return n?(i.next=n.next,i.prev=n,n.next.prev=i,n.next=i):(i.prev=i,i.next=i),i}function Fa(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function xd(e,r,t){this.i=e,this.x=r,this.y=t,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function Cd(e,r){var t=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=ZP(e))||r&&e&&typeof e.length=="number"){t&&(e=t);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(f){throw f},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
188
188
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){t=t.call(e)},n:function(){var f=t.next();return a=f.done,f},e:function(f){o=!0,s=f},f:function(){try{!a&&t.return!=null&&t.return()}finally{if(o)throw s}}}}function ZP(e,r){if(e){if(typeof e=="string")return rb(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);if(t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set")return Array.from(e);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return rb(e,r)}}function rb(e,r){(r==null||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function nb(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),t.push.apply(t,n)}return t}function Pn(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{};r%2?nb(Object(t),!0).forEach(function(n){c(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):nb(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}function Bd(e,r,t){var n=$P(e),i=Object.keys(n).filter(function(a){return n[a]!==Array});return QP(e,Pn({propArrayTypes:n},r),{numericPropKeys:t&&t.numericPropKeys||i,PositionDataType:t?t.PositionDataType:Float32Array,triangulate:t?t.triangulate:!0})}function $P(e){var r={},t=Cd(e),n;try{for(t.s();!(n=t.n()).done;){var i=n.value;if(i.properties)for(var a in i.properties){var o=i.properties[a];r[a]=aI(o,r[a])}}}catch(s){t.e(s)}finally{t.f()}return r}function QP(e,r,t){var n=r.pointPositionsCount,i=r.pointFeaturesCount,a=r.linePositionsCount,o=r.linePathsCount,s=r.lineFeaturesCount,u=r.polygonPositionsCount,f=r.polygonObjectsCount,l=r.polygonRingsCount,h=r.polygonFeaturesCount,d=r.propArrayTypes,p=r.coordLength,m=t.numericPropKeys,v=m===void 0?[]:m,g=t.PositionDataType,y=g===void 0?Float32Array:g,A=t.triangulate,x=A===void 0?!0:A,b=e[0]&&"id"in e[0],M=e.length>65535?Uint32Array:Uint16Array,C={type:"Point",positions:new y(n*p),globalFeatureIds:new M(n),featureIds:i>65535?new Uint32Array(n):new Uint16Array(n),numericProps:{},properties:[],fields:[]},F={type:"LineString",pathIndices:a>65535?new Uint32Array(o+1):new Uint16Array(o+1),positions:new y(a*p),globalFeatureIds:new M(a),featureIds:s>65535?new Uint32Array(a):new Uint16Array(a),numericProps:{},properties:[],fields:[]},B={type:"Polygon",polygonIndices:u>65535?new Uint32Array(f+1):new Uint16Array(f+1),primitivePolygonIndices:u>65535?new Uint32Array(l+1):new Uint16Array(l+1),positions:new y(u*p),globalFeatureIds:new M(u),featureIds:h>65535?new Uint32Array(u):new Uint16Array(u),numericProps:{},properties:[],fields:[]};x&&(B.triangles=[]);for(var S=0,_=[C,F,B];S<_.length;S++){var R=_[S],k=Cd(v),U;try{for(k.s();!(U=k.n()).done;){var j=U.value,Z=d[j];R.numericProps[j]=new Z(R.positions.length/p)}}catch(ie){k.e(ie)}finally{k.f()}}F.pathIndices[o]=a,B.polygonIndices[f]=u,B.primitivePolygonIndices[l]=u;var P={pointPosition:0,pointFeature:0,linePosition:0,linePath:0,lineFeature:0,polygonPosition:0,polygonObject:0,polygonRing:0,polygonFeature:0,feature:0},O=Cd(e),G;try{for(O.s();!(G=O.n()).done;){var J=G.value,V=J.geometry,ee=J.properties||{};switch(V.type){case"Point":eI(V,C,P,p,ee),C.properties.push(wd(ee,v)),b&&C.fields.push({id:J.id}),P.pointFeature++;break;case"LineString":tI(V,F,P,p,ee),F.properties.push(wd(ee,v)),b&&F.fields.push({id:J.id}),P.lineFeature++;break;case"Polygon":rI(V,B,P,p,ee),B.properties.push(wd(ee,v)),b&&B.fields.push({id:J.id}),P.polygonFeature++;break;default:throw new Error("Invalid geometry type")}P.feature++}}catch(ie){O.e(ie)}finally{O.f()}return iI(C,F,B,p)}function eI(e,r,t,n,i){r.positions.set(e.data,t.pointPosition*n);var a=e.data.length/n;Md(r,i,t.pointPosition,a),r.globalFeatureIds.fill(t.feature,t.pointPosition,t.pointPosition+a),r.featureIds.fill(t.pointFeature,t.pointPosition,t.pointPosition+a),t.pointPosition+=a}function tI(e,r,t,n,i){r.positions.set(e.data,t.linePosition*n);var a=e.data.length/n;Md(r,i,t.linePosition,a),r.globalFeatureIds.fill(t.feature,t.linePosition,t.linePosition+a),r.featureIds.fill(t.lineFeature,t.linePosition,t.linePosition+a);for(var o=0,s=e.indices.length;o<s;++o){var u=e.indices[o],f=o===s-1?e.data.length:e.indices[o+1];r.pathIndices[t.linePath++]=t.linePosition,t.linePosition+=(f-u)/n}}function rI(e,r,t,n,i){r.positions.set(e.data,t.polygonPosition*n);var a=e.data.length/n;Md(r,i,t.polygonPosition,a),r.globalFeatureIds.fill(t.feature,t.polygonPosition,t.polygonPosition+a),r.featureIds.fill(t.polygonFeature,t.polygonPosition,t.polygonPosition+a);for(var o=0,s=e.indices.length;o<s;++o){var u=t.polygonPosition;r.polygonIndices[t.polygonObject++]=u;for(var f=e.areas[o],l=e.indices[o],h=e.indices[o+1],d=0,p=l.length;d<p;++d){var m=l[d],v=d===p-1?h===void 0?e.data.length:h[0]:l[d+1];r.primitivePolygonIndices[t.polygonRing++]=t.polygonPosition,t.polygonPosition+=(v-m)/n}var g=t.polygonPosition;nI(r,f,l,{startPosition:u,endPosition:g,coordLength:n})}}function nI(e,r,t,n){var i=n.startPosition,a=n.endPosition,o=n.coordLength;if(e.triangles)for(var s=i*o,u=a*o,f=e.positions.subarray(s,u),l=t[0],h=t.slice(1).map(function(v){return(v-l)/o}),d=Ed(f,h,o,r),p=0,m=d.length;p<m;++p)e.triangles.push(i+d[p])}function Sd(e,r){var t={};for(var n in e)t[n]={value:e[n],size:r};return t}function iI(e,r,t,n){var i={points:Pn(Pn({},e),{},{positions:{value:e.positions,size:n},globalFeatureIds:{value:e.globalFeatureIds,size:1},featureIds:{value:e.featureIds,size:1},numericProps:Sd(e.numericProps,1)}),lines:Pn(Pn({},r),{},{positions:{value:r.positions,size:n},pathIndices:{value:r.pathIndices,size:1},globalFeatureIds:{value:r.globalFeatureIds,size:1},featureIds:{value:r.featureIds,size:1},numericProps:Sd(r.numericProps,1)}),polygons:Pn(Pn({},t),{},{positions:{value:t.positions,size:n},polygonIndices:{value:t.polygonIndices,size:1},primitivePolygonIndices:{value:t.primitivePolygonIndices,size:1},globalFeatureIds:{value:t.globalFeatureIds,size:1},featureIds:{value:t.featureIds,size:1},numericProps:Sd(t.numericProps,1)})};return t.triangles&&(i.polygons.triangles={value:new Uint32Array(t.triangles),size:1}),i}function Md(e,r,t,n){for(var i in e.numericProps)if(i in r){var a=r[i];e.numericProps[i].fill(a,t,t+n)}}function wd(e,r){var t={};for(var n in e)r.includes(n)||(t[n]=e[n]);return t}function aI(e,r){return r===Array||!Number.isFinite(e)?Array:r===Float64Array||Math.fround(e)!==e?Float64Array:Float32Array}N();function ib(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),t.push.apply(t,n)}return t}function oI(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{};r%2?ib(Object(t),!0).forEach(function(n){c(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ib(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}function ob(e,r){var t=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=sI(e))||r&&e&&typeof e.length=="number"){t&&(e=t);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(f){throw f},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
189
189
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){t=t.call(e)},n:function(){var f=t.next();return a=f.done,f},e:function(f){o=!0,s=f},f:function(){try{!a&&t.return!=null&&t.return()}finally{if(o)throw s}}}}function sI(e,r){if(e){if(typeof e=="string")return ab(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);if(t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set")return Array.from(e);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return ab(e,r)}}function ab(e,r){(r==null||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function fu(e,r){var t=r?.globalFeatureId;return t!==void 0?uI(e,t):fI(e,r?.type)}function uI(e,r){var t=ub(e),n=ob(t),i;try{for(n.s();!(i=n.n()).done;){for(var a=i.value,o=0,s=a.featureIds.value[0],u=0;u<a.featureIds.value.length;u++){var f=a.featureIds.value[u];if(f!==s){if(r===a.globalFeatureIds.value[o])return su(a,o,u);o=u,s=f}}if(r===a.globalFeatureIds.value[o])return su(a,o,a.featureIds.value.length)}}catch(l){n.e(l)}finally{n.f()}throw new Error("featureId:".concat(r," not found"))}function fI(e,r){var t=ub(e,r);return lI(t)}function sb(e,r,t){switch(e.type){case"Point":return pI(e,r,t);case"LineString":return dI(e,r,t);case"Polygon":return fb(e,r,t);default:var n=e;throw new Error("Unsupported geometry type: ".concat(n?.type))}}function ub(e,r){var t=Boolean(e.points||e.lines||e.polygons);if(!t)return e.type=r||mI(e),[e];var n=[];return e.points&&(e.points.type="Point",n.push(e.points)),e.lines&&(e.lines.type="LineString",n.push(e.lines)),e.polygons&&(e.polygons.type="Polygon",n.push(e.polygons)),n}function lI(e){var r=[],t=ob(e),n;try{for(t.s();!(n=t.n()).done;){var i=n.value;if(i.featureIds.value.length!==0){for(var a=0,o=i.featureIds.value[0],s=0;s<i.featureIds.value.length;s++){var u=i.featureIds.value[s];u!==o&&(r.push(su(i,a,s)),a=s,o=u)}r.push(su(i,a,i.featureIds.value.length))}}}catch(f){t.e(f)}finally{t.f()}return r}function su(e,r,t){var n=sb(e,r,t),i=hI(e,r,t),a=cI(e,r,t);return oI({type:"Feature",geometry:n,properties:i},a)}function cI(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,t=arguments.length>2?arguments[2]:void 0;return e.fields&&e.fields[e.featureIds.value[r]]}function hI(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,t=arguments.length>2?arguments[2]:void 0,n=Object.assign({},e.properties[e.featureIds.value[r]]);for(var i in e.numericProps)n[i]=e.numericProps[i].value[r];return n}function fb(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:-1/0,t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1/0,n=e.positions,i=e.polygonIndices.value.filter(function(y){return y>=r&&y<=t}),a=e.primitivePolygonIndices.value.filter(function(y){return y>=r&&y<=t}),o=i.length>2;if(!o){for(var s=[],u=0;u<a.length-1;u++){var f=a[u],l=a[u+1],h=uu(n,f,l);s.push(h)}return{type:"Polygon",coordinates:s}}for(var d=[],p=0;p<i.length-1;p++){var m=i[p],v=i[p+1],g=fb(e,m,v).coordinates;d.push(g)}return{type:"MultiPolygon",coordinates:d}}function dI(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:-1/0,t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1/0,n=e.positions,i=e.pathIndices.value.filter(function(l){return l>=r&&l<=t}),a=i.length>2;if(!a){var o=uu(n,i[0],i[1]);return{type:"LineString",coordinates:o}}for(var s=[],u=0;u<i.length-1;u++){var f=uu(n,i[u],i[u+1]);s.push(f)}return{type:"MultiLineString",coordinates:s}}function pI(e,r,t){var n=e.positions,i=uu(n,r,t),a=i.length>1;return a?{type:"MultiPoint",coordinates:i}:{type:"Point",coordinates:i[0]}}function uu(e,r,t){r=r||0,t=t||e.value.length/e.size;for(var n=[],i=r;i<t;i++){for(var a=Array(),o=i*e.size;o<(i+1)*e.size;o++)a.push(Number(e.value[o]));n.push(a)}return n}function mI(e){return e.pathIndices?"LineString":e.polygonIndices?"Polygon":"Point"}var kd=X(vb());q();N();q();Y();N();q();Y();N();function gb(e){var r=e.length;if(r<=1)return[e];for(var t=[],n,i,a=0;a<r;a++){var o=RI(e[a]);o!==0&&(i===void 0&&(i=o<0),i===o<0?(n&&t.push(n),n=[e[a]]):n&&n.push(e[a]))}return n&&t.push(n),t}function RI(e){for(var r=0,t=0,n=e.length-1,i,a;t<e.length;n=t++)i=e[t],a=e[n],r+=(a[0]-i[0])*(i[1]+a[1]);return r}function yb(e,r,t){r&&t&&(e===1?r.id=t.readVarint():e===2?FI(t,r):e===3?r.type=t.readVarint():e===4&&(r._geometry=t.pos))}function FI(e,r){for(var t=e.readVarint()+e.pos;e.pos<t;){var n=r._keys[e.readVarint()],i=r._values[e.readVarint()];r.properties[n]=i}}var Ab=function(){function e(r,t,n,i,a){T(this,e),c(this,"properties",void 0),c(this,"extent",void 0),c(this,"type",void 0),c(this,"id",void 0),c(this,"_pbf",void 0),c(this,"_geometry",void 0),c(this,"_keys",void 0),c(this,"_values",void 0),this.properties={},this.extent=n,this.type=0,this.id=null,this._pbf=r,this._geometry=-1,this._keys=i,this._values=a,r.readFields(yb,this,t)}return w(e,[{key:"loadGeometry",value:function(){var t=this._pbf;t.pos=this._geometry;for(var n=t.readVarint()+t.pos,i=1,a=0,o=0,s=0,u=[],f;t.pos<n;){if(a<=0){var l=t.readVarint();i=l&7,a=l>>3}if(a--,i===1||i===2)o+=t.readSVarint(),s+=t.readSVarint(),i===1&&(f&&u.push(f),f=[]),f&&f.push([o,s]);else if(i===7)f&&f.push(f[0].slice());else throw new Error("unknown command ".concat(i))}return f&&u.push(f),u}},{key:"bbox",value:function(){var t=this._pbf;t.pos=this._geometry;for(var n=t.readVarint()+t.pos,i=1,a=0,o=0,s=0,u=1/0,f=-1/0,l=1/0,h=-1/0;t.pos<n;){if(a<=0){var d=t.readVarint();i=d&7,a=d>>3}if(a--,i===1||i===2)o+=t.readSVarint(),s+=t.readSVarint(),o<u&&(u=o),o>f&&(f=o),s<l&&(l=s),s>h&&(h=s);else if(i!==7)throw new Error("unknown command ".concat(i))}return[u,l,f,h]}},{key:"_toGeoJSON",value:function(t){var n=this.loadGeometry(),i=e.types[this.type],a,o;switch(this.type){case 1:var s=[];for(a=0;a<n.length;a++)s[a]=n[a][0];n=s,t(n,this);break;case 2:for(a=0;a<n.length;a++)t(n[a],this);break;case 3:for(n=gb(n),a=0;a<n.length;a++)for(o=0;o<n[a].length;o++)t(n[a][o],this);break}n.length===1?n=n[0]:i="Multi".concat(i);var u={type:"Feature",geometry:{type:i,coordinates:n},properties:this.properties};return this.id!==null&&(u.id=this.id),u}},{key:"toGeoJSON",value:function(t){if(typeof t=="function")return this._toGeoJSON(t);var n=t.x,i=t.y,a=t.z,o=this.extent*Math.pow(2,a),s=this.extent*n,u=this.extent*i;function f(l){for(var h=0;h<l.length;h++){var d=l[h];d[0]=(d[0]+s)*360/o-180;var p=180-(d[1]+u)*360/o;d[1]=360/Math.PI*Math.atan(Math.exp(p*Math.PI/180))-90}}return this._toGeoJSON(f)}}],[{key:"types",get:function(){return["Unknown","Point","LineString","Polygon"]}}]),e}();var _b=function(){function e(r,t){T(this,e),c(this,"version",void 0),c(this,"name",void 0),c(this,"extent",void 0),c(this,"length",void 0),c(this,"_pbf",void 0),c(this,"_keys",void 0),c(this,"_values",void 0),c(this,"_features",void 0),this.version=1,this.name="",this.extent=4096,this.length=0,this._pbf=r,this._keys=[],this._values=[],this._features=[],r.readFields(LI,this,t),this.length=this._features.length}return w(e,[{key:"feature",value:function(t){if(t<0||t>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[t];var n=this._pbf.readVarint()+this._pbf.pos;return new Ab(this._pbf,n,this.extent,this._keys,this._values)}}]),e}();function LI(e,r,t){r&&t&&(e===15?r.version=t.readVarint():e===1?r.name=t.readString():e===5?r.extent=t.readVarint():e===2?r._features.push(t.pos):e===3?r._keys.push(t.readString()):e===4&&r._values.push(kI(t)))}function kI(e){for(var r=null,t=e.readVarint()+e.pos;e.pos<t;){var n=e.readVarint()>>3;r=n===1?e.readString():n===2?e.readFloat():n===3?e.readDouble():n===4?e.readVarint64():n===5?e.readVarint():n===6?e.readSVarint():n===7?e.readBoolean():null}return r}var bb=function e(r,t){T(this,e),c(this,"layers",void 0),this.layers=r.readFields(DI,{},t)};function DI(e,r,t){if(e===3&&t){var n=new _b(t,t.readVarint()+t.pos);n.length&&r&&(r[n.name]=n)}}q();N();q();Y();N();N();q();Y();N();function Tb(e){var r=e.indices.length,t="Polygon";if(r<=1)return{type:t,data:e.data,areas:[[hr(e.data)]],indices:[e.indices]};for(var n=[],i=[],a=[],o=[],s,u=0,f,l=0,h;l<r;l++){h=e.indices[l]-u,f=e.indices[l+1]-u||e.data.length;var d=e.data.slice(h,f),p=hr(d);if(p===0){var m=e.data.slice(0,h),v=e.data.slice(f);e.data=m.concat(v),u+=f-h;continue}s===void 0&&(s=p<0),s===p<0?(o.length&&(n.push(a),i.push(o)),o=[h],a=[p]):(a.push(p),o.push(h))}return a&&n.push(a),o.length&&i.push(o),{type:t,areas:n,indices:i,data:e.data}}function xb(e,r,t,n){for(var i=0,a=e.length;i<a;i+=2){e[i]=(e[i]+r)*360/n-180;var o=180-(e[i+1]+t)*360/n;e[i+1]=360/Math.PI*Math.atan(Math.exp(o*Math.PI/180))-90}}function Eb(e,r,t){r&&t&&(e===1?r.id=t.readVarint():e===2?GI(t,r):e===3?r.type=t.readVarint():e===4&&(r._geometry=t.pos))}function GI(e,r){for(var t=e.readVarint()+e.pos;e.pos<t;){var n=r._keys[e.readVarint()],i=r._values[e.readVarint()];r.properties[n]=i}}function NI(e,r){var t=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=UI(e))||r&&e&&typeof e.length=="number"){t&&(e=t);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(f){throw f},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
190
190
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){t=t.call(e)},n:function(){var f=t.next();return a=f.done,f},e:function(f){o=!0,s=f},f:function(){try{!a&&t.return!=null&&t.return()}finally{if(o)throw s}}}}function UI(e,r){if(e){if(typeof e=="string")return Sb(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);if(t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set")return Array.from(e);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return Sb(e,r)}}function Sb(e,r){(r==null||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function wb(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),t.push.apply(t,n)}return t}function Cb(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{};r%2?wb(Object(t),!0).forEach(function(n){c(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):wb(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}var Bb,In,Id,hu,Rd,Fd,La;var Mb=function(){function e(r,t,n,i,a,o){T(this,e),c(this,"properties",void 0),c(this,"extent",void 0),c(this,"type",void 0),c(this,"id",void 0),c(this,"_pbf",void 0),c(this,"_geometry",void 0),c(this,"_keys",void 0),c(this,"_values",void 0),c(this,"_geometryInfo",void 0),this.properties={},this.extent=n,this.type=0,this.id=null,this._pbf=r,this._geometry=-1,this._keys=i,this._values=a,this._geometryInfo=o,r.readFields(Eb,this,t)}return w(e,[{key:"loadGeometry",value:function(){var t=this._pbf;t.pos=this._geometry,Bb=t.readVarint()+t.pos,In=1,hu=0,Rd=0,Fd=0,La=0;for(var n=[],i=[];t.pos<Bb;)if(hu<=0&&(Id=t.readVarint(),In=Id&7,hu=Id>>3),hu--,In===1||In===2)Rd+=t.readSVarint(),Fd+=t.readSVarint(),In===1&&n.push(La),i.push(Rd,Fd),La+=2;else if(In===7){if(La>0){var a=n[n.length-1];i.push(i[a],i[a+1]),La+=2}}else throw new Error("unknown command ".concat(In));return{data:i,indices:n}}},{key:"_toBinaryCoordinates",value:function(t){var n=this.loadGeometry(),i;t(n.data,this);var a=2;switch(this.type){case 1:this._geometryInfo.pointFeaturesCount++,this._geometryInfo.pointPositionsCount+=n.indices.length,i=Cb({type:"Point"},n);break;case 2:this._geometryInfo.lineFeaturesCount++,this._geometryInfo.linePathsCount+=n.indices.length,this._geometryInfo.linePositionsCount+=n.data.length/a,i=Cb({type:"LineString"},n);break;case 3:i=Tb(n),this._geometryInfo.polygonFeaturesCount++,this._geometryInfo.polygonObjectsCount+=i.indices.length;var o=NI(i.indices),s;try{for(o.s();!(s=o.n()).done;){var u=s.value;this._geometryInfo.polygonRingsCount+=u.length}}catch(l){o.e(l)}finally{o.f()}this._geometryInfo.polygonPositionsCount+=i.data.length/a;break;default:throw new Error("Invalid geometry type: ".concat(this.type))}var f={type:"Feature",geometry:i,properties:this.properties};return this.id!==null&&(f.id=this.id),f}},{key:"toBinaryCoordinates",value:function(t){if(typeof t=="function")return this._toBinaryCoordinates(t);var n=t.x,i=t.y,a=t.z,o=this.extent*Math.pow(2,a),s=this.extent*n,u=this.extent*i;return this._toBinaryCoordinates(function(f){return xb(f,s,u,o)})}}]),e}();var Ob=function(){function e(r,t){T(this,e),c(this,"version",void 0),c(this,"name",void 0),c(this,"extent",void 0),c(this,"length",void 0),c(this,"_pbf",void 0),c(this,"_keys",void 0),c(this,"_values",void 0),c(this,"_features",void 0),this.version=1,this.name="",this.extent=4096,this.length=0,this._pbf=r,this._keys=[],this._values=[],this._features=[],r.readFields(jI,this,t),this.length=this._features.length}return w(e,[{key:"feature",value:function(t,n){if(t<0||t>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[t];var i=this._pbf.readVarint()+this._pbf.pos;return new Mb(this._pbf,i,this.extent,this._keys,this._values,n)}}]),e}();function jI(e,r,t){r&&t&&(e===15?r.version=t.readVarint():e===1?r.name=t.readString():e===5?r.extent=t.readVarint():e===2?r._features.push(t.pos):e===3?r._keys.push(t.readString()):e===4&&r._values.push(HI(t)))}function HI(e){for(var r=null,t=e.readVarint()+e.pos;e.pos<t;){var n=e.readVarint()>>3;r=n===1?e.readString():n===2?e.readFloat():n===3?e.readDouble():n===4?e.readVarint64():n===5?e.readVarint():n===6?e.readSVarint():n===7?e.readBoolean():null}return r}var Pb=function e(r,t){T(this,e),c(this,"layers",void 0),this.layers=r.readFields(VI,{},t)};function VI(e,r,t){if(e===3&&t){var n=new Ob(t,t.readVarint()+t.pos);n.length&&r&&(r[n.name]=n)}}function du(e,r){var t,n,i=WI(r),a=(r==null||(t=r.gis)===null||t===void 0?void 0:t.format)||(r==null||(n=r.mvt)===null||n===void 0?void 0:n.shape);switch(a){case"columnar-table":return{shape:"columnar-table",data:Ld(e,i)};case"geojson-row-table":{var o={shape:"geojson-row-table",data:Ib(e,i)};return o}case"geojson":return Ib(e,i);case"binary-geometry":return Ld(e,i);case"binary":return Ld(e,i);default:throw new Error(a)}}function Ld(e,r){var t=zI(e,r),n=D(t,2),i=n[0],a=n[1],o=Bd(i,a);return o.byteLength=e.byteLength,o}function zI(e,r){var t=[],n={coordLength:2,pointPositionsCount:0,pointFeaturesCount:0,linePositionsCount:0,linePathsCount:0,lineFeaturesCount:0,polygonPositionsCount:0,polygonObjectsCount:0,polygonRingsCount:0,polygonFeaturesCount:0};if(e.byteLength<=0)return[t,n];var i=new Pb(new kd.default(e)),a=r&&Array.isArray(r.layers)?r.layers:Object.keys(i.layers);return a.forEach(function(o){var s=i.layers[o];if(s)for(var u=0;u<s.length;u++){var f=s.feature(u,n),l=XI(f,r,o);t.push(l)}}),[t,n]}function Ib(e,r){if(e.byteLength<=0)return[];var t=[],n=new bb(new kd.default(e)),i=Array.isArray(r.layers)?r.layers:Object.keys(n.layers);return i.forEach(function(a){var o=n.layers[a];if(o)for(var s=0;s<o.length;s++){var u=o.feature(s),f=JI(u,r,a);t.push(f)}}),t}function WI(e){var r;if(!(e!=null&&e.mvt))throw new Error("mvt options required");var t=((r=e.mvt)===null||r===void 0?void 0:r.coordinates)==="wgs84",n=e.mvt.tileIndex,i=n&&Number.isFinite(n.x)&&Number.isFinite(n.y)&&Number.isFinite(n.z);if(t&&!i)throw new Error("MVT Loader: WGS84 coordinates need tileIndex property");return e.mvt}function JI(e,r,t){var n=e.toGeoJSON(r.coordinates==="wgs84"?r.tileIndex:qI);return r.layerProperty&&(n.properties[r.layerProperty]=t),n}function XI(e,r,t){var n=e.toBinaryCoordinates(r.coordinates==="wgs84"?r.tileIndex:KI);return r.layerProperty&&n.properties&&(n.properties[r.layerProperty]=t),n}function qI(e,r){for(var t=r.extent,n=0;n<e.length;n++){var i=e[n];i[0]/=t,i[1]/=t}}function KI(e,r){for(var t=r.extent,n=0,i=e.length;n<i;++n)e[n]/=t}function Rb(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),t.push.apply(t,n)}return t}function Fb(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{};r%2?Rb(Object(t),!0).forEach(function(n){c(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Rb(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}var YI="3.4.13",ZI={mvt:{shape:"geojson",coordinates:"local",layerProperty:"layerName",layers:void 0,tileIndex:null}},pu={name:"Mapbox Vector Tile",id:"mvt",module:"mvt",version:YI,extensions:["mvt","pbf"],mimeTypes:["application/vnd.mapbox-vector-tile","application/x-protobuf"],worker:!0,category:"geometry",options:ZI},$I=Fb(Fb({},pu),{},{parse:function(){var e=I(Dd.default.mark(function t(n,i){return Dd.default.wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return o.abrupt("return",du(n,i));case 1:case"end":return o.stop()}},t)}));function r(t,n){return e.apply(this,arguments)}return r}(),parseSync:du,binary:!0});N();ue();function Lb(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),t.push.apply(t,n)}return t}function kb(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{};r%2?Lb(Object(t),!0).forEach(function(n){c(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Lb(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}var QI={Point:Db,MultiPoint:eR,LineString:Gb,MultiLineString:tR,Polygon:Nb,MultiPolygon:rR};function Db(e,r,t){var n=D(e,2),i=n[0],a=n[1],o=D(r,2),s=o[0],u=o[1],f=Ar(s[0],u[0],i),l=Ar(s[1],u[1],a);return t.unprojectFlat([f,l])}function Gd(e,r,t){return e.map(function(n){return Db(n,r,t)})}function eR(e,r,t){return Gd(e,r,t)}function Gb(e,r,t){return Gd(e,r,t)}function tR(e,r,t){return e.map(function(n){return Gb(n,r,t)})}function Nb(e,r,t){return e.map(function(n){return Gd(n,r,t)})}function rR(e,r,t){return e.map(function(n){return Nb(n,r,t)})}function Ub(e,r,t){var n=t.projectFlat([r.west,r.north]),i=t.projectFlat([r.east,r.south]),a=[n,i];return kb(kb({},e),{},{coordinates:QI[e.type](e.coordinates,a,t)})}function nR(e,r){var t=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=iR(e))||r&&e&&typeof e.length=="number"){t&&(e=t);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(f){throw f},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
191
191
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){t=t.call(e)},n:function(){var f=t.next();return a=f.done,f},e:function(f){o=!0,s=f},f:function(){try{!a&&t.return!=null&&t.return()}finally{if(o)throw s}}}}function iR(e,r){if(e){if(typeof e=="string")return jb(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);if(t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set")return Array.from(e);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return jb(e,r)}}function jb(e,r){(r==null||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}var aR=["points","lines","polygons"];function Nd(e,r,t,n){var i=nR(aR),a;try{for(i.s();!(a=i.n()).done;){var o=a.value,s=e[o]&&oR(e[o],r,t,n);if(s>=0)return s}}catch(u){i.e(u)}finally{i.f()}return-1}function oR(e,r,t,n){var i=e.featureIds.value;if(!i.length)return-1;var a=0,o=i[i.length-1]+1;if(n){var s=sR(e,n);if(s)a=s[0],o=s[1]+1;else return-1}var u=-1;if(r in e.numericProps){var f=e.numericProps[r].value.findIndex(function(l,h){return l===t&&i[h]>=a&&i[h]<o});return f>=0?e.globalFeatureIds.value[f]:-1}else r?u=Hb(e.properties,function(l){return l[r]===t},a,o):e.fields&&(u=Hb(e.fields,function(l){return l.id===t},a,o));return u>=0?uR(e,u):-1}function sR(e,r){if(!e.__layers){for(var t={},n=e.properties,i=0;i<n.length;i++){var a=n[i],o=a.layerName;o&&(t[o]?t[o][1]=i:t[o]=[i,i])}e.__layers=t}return e.__layers[r]}function uR(e,r){if(!e.__ids){for(var t=[],n=e.featureIds.value,i=e.globalFeatureIds.value,a=0;a<n.length;a++)t[n[a]]=i[a];e.__ids=t}return e.__ids[r]}function Hb(e,r,t,n){for(var i=t;i<n;i++)if(r(e[i],i))return i;return-1}function fR(e,r){var t=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=lR(e))||r&&e&&typeof e.length=="number"){t&&(e=t);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(f){throw f},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
192
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){t=t.call(e)},n:function(){var f=t.next();return a=f.done,f},e:function(f){o=!0,s=f},f:function(){try{!a&&t.return!=null&&t.return()}finally{if(o)throw s}}}}function lR(e,r){if(e){if(typeof e=="string")return Vb(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);if(t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set")return Array.from(e);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return Vb(e,r)}}function Vb(e,r){(r==null||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function cR(e){var r=hR();return function(){var n=L(e),i;if(r){var a=L(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return $(this,i)}}function hR(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function zb(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),t.push.apply(t,n)}return t}function jr(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{};r%2?zb(Object(t),!0).forEach(function(n){c(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):zb(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}var Ud=512,dR=jr(jr({},Vd.GeoJsonLayer.defaultProps),{},{data:Er,onDataLoad:{type:"function",value:null,optional:!0,compare:!1},uniqueIdProperty:"",highlightedFeatureId:null,loaders:[pu],binary:!0}),vu=function(e){H(t,e);var r=cR(t);function t(){return T(this,t),r.apply(this,arguments)}return w(t,[{key:"initializeState",value:function(){
|
|
192
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){t=t.call(e)},n:function(){var f=t.next();return a=f.done,f},e:function(f){o=!0,s=f},f:function(){try{!a&&t.return!=null&&t.return()}finally{if(o)throw s}}}}function lR(e,r){if(e){if(typeof e=="string")return Vb(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);if(t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set")return Array.from(e);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return Vb(e,r)}}function Vb(e,r){(r==null||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function cR(e){var r=hR();return function(){var n=L(e),i;if(r){var a=L(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return $(this,i)}}function hR(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function zb(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),t.push.apply(t,n)}return t}function jr(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{};r%2?zb(Object(t),!0).forEach(function(n){c(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):zb(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}var Ud=512,dR=jr(jr({},Vd.GeoJsonLayer.defaultProps),{},{data:Er,onDataLoad:{type:"function",value:null,optional:!0,compare:!1},uniqueIdProperty:"",highlightedFeatureId:null,loaders:[pu],binary:!0}),vu=function(e){H(t,e);var r=cR(t);function t(){return T(this,t),r.apply(this,arguments)}return w(t,[{key:"initializeState",value:function(){_e(L(t.prototype),"initializeState",this).call(this);var i=this.context.viewport.resolution!==void 0?!1:this.props.binary;this.setState({binary:i,data:null,tileJSON:null})}},{key:"isLoaded",get:function(){return this.state&&this.state.data&&this.state.tileset&&_e(L(t.prototype),"isLoaded",this)}},{key:"updateState",value:function(i){var a,o=i.props,s=i.oldProps,u=i.context,f=i.changeFlags;f.dataChanged&&this._updateTileData(),(a=this.state)!==null&&a!==void 0&&a.data&&(_e(L(t.prototype),"updateState",this).call(this,{props:o,oldProps:s,context:u,changeFlags:f}),this._setWGS84PropertyForTiles());var l=o.highlightColor;l!==s.highlightColor&&Array.isArray(l)&&this.setState({highlightColor:l})}},{key:"_updateTileData",value:function(){var n=I(Hd.default.mark(function a(){var o,s,u,f,l;return Hd.default.wrap(function(d){for(;;)switch(d.prev=d.next){case 0:if(o=this.props.data,s=null,!(typeof o=="string"&&!fl(o))){d.next=18;break}return u=this.props,f=u.onDataLoad,l=u.fetch,this.setState({data:null,tileJSON:null}),d.prev=5,d.next=8,l(o,{propName:"data",layer:this,loaders:[]});case 8:s=d.sent,d.next=15;break;case 11:d.prev=11,d.t0=d.catch(5),this.raiseError(d.t0,"loading TileJSON"),o=null;case 15:f&&f(s,{propName:"data",layer:this}),d.next=19;break;case 18:o.tilejson&&(s=o);case 19:s&&(o=s.tiles),this.setState({data:o,tileJSON:s});case 21:case"end":return d.stop()}},a,this,[[5,11]])}));function i(){return n.apply(this,arguments)}return i}()},{key:"_getTilesetOptions",value:function(){var i=_e(L(t.prototype),"_getTilesetOptions",this).call(this),a=this.state.tileJSON,o=this.props,s=o.minZoom,u=o.maxZoom;return a&&(Number.isFinite(a.minzoom)&&a.minzoom>s&&(i.minZoom=a.minzoom),Number.isFinite(a.maxzoom)&&(!Number.isFinite(u)||a.maxzoom<u)&&(i.maxZoom=a.maxzoom)),i}},{key:"renderLayers",value:function(){var i;return(i=this.state)!==null&&i!==void 0&&i.data?_e(L(t.prototype),"renderLayers",this).call(this):null}},{key:"getTileData",value:function(i){var a,o=this.state,s=o.data,u=o.binary,f=i.index,l=i.signal,h=jt(s,i);if(!h)return Promise.reject("Invalid URL");var d=this.getLoadOptions(),p=this.props.fetch;return d=jr(jr({},d),{},{mimeType:"application/x-protobuf",mvt:jr(jr({},(a=d)===null||a===void 0?void 0:a.mvt),{},{coordinates:this.context.viewport.resolution?"wgs84":"local",tileIndex:f}),gis:u?{format:"binary"}:{}}),p(h,{propName:"data",layer:this,loadOptions:d,signal:l})}},{key:"renderSubLayers",value:function(i){var a=i.tile.index,o=a.x,s=a.y,u=a.z,f=Math.pow(2,u),l=Ud/f,h=-l,d=Ud*o/f,p=Ud*(1-s/f),m=new se().scale([l,h,1]);i.autoHighlight=!1,this.context.viewport.resolution||(i.modelMatrix=m,i.coordinateOrigin=[d,p,0],i.coordinateSystem=mu.COORDINATE_SYSTEM.CARTESIAN,i.extensions=[].concat(K(i.extensions||[]),[new qb.ClipExtension]));var v=_e(L(t.prototype),"renderSubLayers",this).call(this,i);return this.state.binary&&!(v instanceof Vd.GeoJsonLayer)&&mu.log.warn("renderSubLayers() must return GeoJsonLayer when using binary:true")(),v}},{key:"_updateAutoHighlight",value:function(i){var a=this.props.uniqueIdProperty,o=this.state,s=o.hoveredFeatureId,u=o.hoveredFeatureLayerName,f=i.object,l,h;f&&(l=jd(f,a),h=Wb(f));var d=this.props.highlightColor;typeof d=="function"&&(d=d(i)),(s!==l||u!==h)&&this.setState({highlightColor:d,hoveredFeatureId:l,hoveredFeatureLayerName:h})}},{key:"getPickingInfo",value:function(i){var a=_e(L(t.prototype),"getPickingInfo",this).call(this,i),o=Boolean(this.context.viewport.resolution);if(this.state.binary&&a.index!==-1){var s=i.sourceLayer.props.data;a.object=fu(s,{globalFeatureId:a.index})}return a.object&&!o&&(a.object=Xb(a.object,a.tile.bbox,this.context.viewport)),a}},{key:"getSubLayerPropsByTile",value:function(i){return{highlightedObjectIndex:this.getHighlightedObjectIndex(i),highlightColor:this.state.highlightColor}}},{key:"getHighlightedObjectIndex",value:function(i){var a=this.state,o=a.hoveredFeatureId,s=a.hoveredFeatureLayerName,u=a.binary,f=this.props,l=f.uniqueIdProperty,h=f.highlightedFeatureId,d=i.content,p=Jb(h),m=Jb(o)||p;if(!m)return-1;var v=p?h:o;return Array.isArray(d)?d.findIndex(function(g){var y=jd(g,l)===v,A=p||Wb(g)===s;return y&&A}):d&&u?Nd(d,l,v,p?"":s):-1}},{key:"_pickObjects",value:function(i){var a=this.context,o=a.deck,s=a.viewport,u=s.width,f=s.height,l=s.x,h=s.y,d=[this.id];return o.pickObjects({x:l,y:h,width:u,height:f,layerIds:d,maxObjects:i})}},{key:"getRenderedFeatures",value:function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,a=this._pickObjects(i),o=new Set,s=[],u=fR(a),f;try{for(u.s();!(f=u.n()).done;){var l=f.value,h=jd(l.object,this.props.uniqueIdProperty);h===void 0?s.push(l.object):o.has(h)||(o.add(h),s.push(l.object))}}catch(d){u.e(d)}finally{u.f()}return s}},{key:"_setWGS84PropertyForTiles",value:function(){var i=this,a="dataInWGS84",o=this.state.tileset;o.selectedTiles.forEach(function(s){s.hasOwnProperty(a)||Object.defineProperty(s,a,{get:function(){if(!s.content)return null;if(i.state.binary&&Array.isArray(s.content)&&!s.content.length)return[];var f=s.bbox;if(s._contentWGS84===void 0&&ll(f)){var l=i.state.binary?fu(s.content):s.content;s._contentWGS84=l.map(function(h){return Xb(h,f,i.context.viewport)})}return s._contentWGS84}})})}}]),t}(er);c(vu,"layerName","MVTLayer");c(vu,"defaultProps",dR);function jd(e,r){if(e.properties&&r)return e.properties[r];if("id"in e)return e.id}function Wb(e){var r;return((r=e.properties)===null||r===void 0?void 0:r.layerName)||null}function Jb(e){return e!=null&&e!==""}function Xb(e,r,t){var n=jr(jr({},e),{},{geometry:{type:e.geometry.type}});return Object.defineProperty(n.geometry,"coordinates",{get:function(){var a=Ub(e.geometry,r,t);return a.coordinates}}),n}q();Y();N();ue();var Kb="0123456789bcdefghjkmnpqrstuvwxyz",Yb={};for(ka=0;ka<Kb.length;ka++)Yb[Kb.charAt(ka)]=ka;var ka,pR=-90,mR=90,vR=-180,gR=180;function yR(e){for(var r=!0,t=mR,n=pR,i=gR,a=vR,o,s=0,u=0,f=e.length;u<f;u++){var l=e[u].toLowerCase();s=Yb[l];for(var h=4;h>=0;h--){var d=s>>h&1;r?(o=(i+a)/2,d===1?a=o:i=o):(o=(t+n)/2,d===1?n=o:t=o),r=!r}}return[n,a,t,i]}function Zb(e){var r=yR(e),t=D(r,4),n=t[0],i=t[1],a=t[2],o=t[3];return[o,a,o,n,i,n,i,a,o,a]}function AR(e){var r=_R();return function(){var n=L(e),i;if(r){var a=L(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return $(this,i)}}function _R(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var bR={getGeohash:{type:"accessor",value:function(r){return r.geohash}}},gu=function(e){H(t,e);var r=AR(t);function t(){return T(this,t),r.apply(this,arguments)}return w(t,[{key:"indexToBounds",value:function(){var i=this.props,a=i.data,o=i.getGeohash;return{data:a,_normalize:!1,positionFormat:"XY",getPolygon:function(u,f){return Zb(o(u,f))}}}}]),t}(mt);c(gu,"layerName","GeohashLayer");c(gu,"defaultProps",bR);return nT(Da);})();
|
|
193
193
|
return __exports__;
|
|
194
194
|
});
|