Linux websever 5.15.0-153-generic #163-Ubuntu SMP Thu Aug 7 16:37:18 UTC 2025 x86_64
Apache/2.4.52 (Ubuntu)
: 192.168.3.70 | : 192.168.1.99
Cant Read [ /etc/named.conf ]
8.1.2-1ubuntu2.23
urlab
www.github.com/MadExploits
Terminal
AUTO ROOT
Adminer
Backdoor Destroyer
Linux Exploit
Lock Shell
Lock File
Create User
CREATE RDP
PHP Mailer
BACKCONNECT
UNLOCK SHELL
HASH IDENTIFIER
CPANEL RESET
CREATE WP USER
README
+ Create Folder
+ Create File
/
var /
www /
html /
orco /
_next /
static /
chunks /
[ HOME SHELL ]
Name
Size
Permission
Action
app
[ DIR ]
drwxr-xr-x
pages
[ DIR ]
drwxr-xr-x
117-df772cb1bb67ff77.js
120.84
KB
-rw-r--r--
23-848574c5fd7c3da1.js
120.49
KB
-rw-r--r--
23-cdbce0ac60ecaf88.js
120.58
KB
-rw-r--r--
472-f371936991cba0a1.js
8.67
KB
-rw-r--r--
535-ce7797088a49d58c.js
3.22
MB
-rw-r--r--
654-869d493a8dc063a8.js
8.67
KB
-rw-r--r--
665-7b2013afed495cba.js
3.19
MB
-rw-r--r--
665-84feb0f2839957ea.js
3.19
MB
-rw-r--r--
839-8ab668b334083b6e.js
14.08
KB
-rw-r--r--
930-6ed8c1c9fa726068.js
3.21
MB
-rw-r--r--
951-63fb0af2eae5f08f.js
14.08
KB
-rw-r--r--
fd9d1056-06f7001a4828dc0e.js
168.78
KB
-rw-r--r--
fd9d1056-22522fa00b21828a.js
168.78
KB
-rw-r--r--
framework-f66176bb897dc684.js
137.64
KB
-rw-r--r--
main-64392e1260a941ec.js
107.49
KB
-rw-r--r--
main-app-b34eb35b44b34922.js
462
B
-rw-r--r--
main-app-b6d7d7d311eba0b4.js
461
B
-rw-r--r--
main-b4f7ef6da868e719.js
108.37
KB
-rw-r--r--
main-c79ad7b61d1a5e48.js
107.39
KB
-rw-r--r--
polyfills-42372ed130431b0a.js
109.96
KB
-rw-r--r--
polyfills-78c92fac7aa8fdd8.js
89.24
KB
-rw-r--r--
webpack-3d7191502a57d04c.js
3.75
KB
-rw-r--r--
webpack-488770d83cf53ed1.js
3.75
KB
-rw-r--r--
webpack-f043d4c1c939d3ec.js
3.76
KB
-rw-r--r--
Delete
Unzip
Zip
${this.title}
Close
Code Editor : 665-7b2013afed495cba.js
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[665],{5804:function(e){"use strict";function t(e,t,n,r,o,a,s){for(var l=0;l<t;l++){for(var c=0;c<n;c++)r[c]=e[c*t+l];for(i(r,o,a,s,n),c=0;c<n;c++)e[c*t+l]=o[c]}for(c=0;c<n;c++){for(l=0;l<t;l++)r[l]=e[c*t+l];for(i(r,o,a,s,t),l=0;l<t;l++)e[c*t+l]=Math.sqrt(o[l])}}function i(e,t,i,n,r){i[0]=0,n[0]=-1e20,n[1]=1e20;for(var o=1,a=0;o<r;o++){for(var s=(e[o]+o*o-(e[i[a]]+i[a]*i[a]))/(2*o-2*i[a]);s<=n[a];)a--,s=(e[o]+o*o-(e[i[a]]+i[a]*i[a]))/(2*o-2*i[a]);i[++a]=o,n[a]=s,n[a+1]=1e20}for(o=0,a=0;o<r;o++){for(;n[a+1]<o;)a++;t[o]=(o-i[a])*(o-i[a])+e[i[a]]}}e.exports=function(e,i){i||(i={});var n,r,o,a,s,l,c,u,h,d,f,p=null==i.cutoff?.25:i.cutoff,m=null==i.radius?8:i.radius,_=i.channel||0;if(ArrayBuffer.isView(e)||Array.isArray(e)){if(!i.width||!i.height)throw Error("For raw data width and height should be provided by options");n=i.width,r=i.height,a=e,l=i.stride?i.stride:Math.floor(e.length/n/r)}else window.HTMLCanvasElement&&e instanceof window.HTMLCanvasElement?(c=(u=e).getContext("2d"),n=u.width,r=u.height,a=(h=c.getImageData(0,0,n,r)).data,l=4):window.CanvasRenderingContext2D&&e instanceof window.CanvasRenderingContext2D?(u=e.canvas,c=e,n=u.width,r=u.height,a=(h=c.getImageData(0,0,n,r)).data,l=4):window.ImageData&&e instanceof window.ImageData&&(h=e,n=e.width,r=e.height,a=h.data,l=4);if(o=Math.max(n,r),window.Uint8ClampedArray&&a instanceof window.Uint8ClampedArray||window.Uint8Array&&a instanceof window.Uint8Array)for(d=0,s=a,a=Array(n*r),f=Math.floor(s.length/l);d<f;d++)a[d]=s[d*l+_]/255;else if(1!==l)throw Error("Raw data can have only 1 value per pixel");var g=Array(n*r),Z=Array(n*r),y=Array(o),b=Array(o),v=Array(o+1),T=Array(o);for(d=0,f=n*r;d<f;d++){var E=a[d];g[d]=1===E?0:0===E?1e20:Math.pow(Math.max(0,.5-E),2),Z[d]=1===E?1e20:0===E?0:Math.pow(Math.max(0,E-.5),2)}t(g,n,r,y,b,T,v),t(Z,n,r,y,b,T,v);var x=window.Float32Array?new Float32Array(n*r):Array(n*r);for(d=0,f=n*r;d<f;d++)x[d]=Math.min(Math.max(1-((g[d]-Z[d])/m+p),0),1);return x}},1838:function(e){var t;t=function(){"use strict";let{entries:e,setPrototypeOf:t,isFrozen:i,getPrototypeOf:n,getOwnPropertyDescriptor:r}=Object,{freeze:o,seal:a,create:s}=Object,{apply:l,construct:c}="undefined"!=typeof Reflect&&Reflect;o||(o=function(e){return e}),a||(a=function(e){return e}),l||(l=function(e,t,i){return e.apply(t,i)}),c||(c=function(e,t){return new e(...t)});let u=T(Array.prototype.forEach),h=T(Array.prototype.pop),d=T(Array.prototype.push),f=T(String.prototype.toLowerCase),p=T(String.prototype.toString),m=T(String.prototype.match),_=T(String.prototype.replace),g=T(String.prototype.indexOf),Z=T(String.prototype.trim),y=T(Object.prototype.hasOwnProperty),b=T(RegExp.prototype.test),v=(W=TypeError,function(){for(var e=arguments.length,t=Array(e),i=0;i<e;i++)t[i]=arguments[i];return c(W,t)});function T(e){return function(t){for(var i=arguments.length,n=Array(i>1?i-1:0),r=1;r<i;r++)n[r-1]=arguments[r];return l(e,t,n)}}function E(e,n){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:f;t&&t(e,null);let o=n.length;for(;o--;){let t=n[o];if("string"==typeof t){let e=r(t);e!==t&&(i(n)||(n[o]=e),t=e)}e[t]=!0}return e}function x(t){let i=s(null);for(let[n,r]of e(t))y(t,n)&&(Array.isArray(r)?i[n]=function(e){for(let t=0;t<e.length;t++)y(e,t)||(e[t]=null);return e}(r):r&&"object"==typeof r&&r.constructor===Object?i[n]=x(r):i[n]=r);return i}function w(e,t){for(;null!==e;){let i=r(e,t);if(i){if(i.get)return T(i.get);if("function"==typeof i.value)return T(i.value)}e=n(e)}return function(){return null}}let S=o(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),C=o(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),A=o(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),I=o(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),O=o(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),D=o(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),P=o(["#text"]),R=o(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),N=o(["accent-height","accumulate","additive","alignment-baseline","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),L=o(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),M=o(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),F=a(/\{\{[\w\W]*|[\w\W]*\}\}/gm),z=a(/<%[\w\W]*|[\w\W]*%>/gm),B=a(/\${[\w\W]*}/gm),U=a(/^data-[\-\w.\u00B7-\uFFFF]/),k=a(/^aria-[\-\w]+$/),V=a(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),H=a(/^(?:\w+script|data):/i),G=a(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),j=a(/^html$/i);var W,q=Object.freeze({__proto__:null,MUSTACHE_EXPR:F,ERB_EXPR:z,TMPLIT_EXPR:B,DATA_ATTR:U,ARIA_ATTR:k,IS_ALLOWED_URI:V,IS_SCRIPT_OR_DATA:H,ATTR_WHITESPACE:G,DOCTYPE_NAME:j,CUSTOM_ELEMENT:a(/^[a-z][.\w]*(-[.\w]+)+$/i)});let Y={element:1,text:3,progressingInstruction:7,comment:8,document:9},X=function(e,t){if("object"!=typeof e||"function"!=typeof e.createPolicy)return null;let i=null,n="data-tt-policy-suffix";t&&t.hasAttribute(n)&&(i=t.getAttribute(n));let r="dompurify"+(i?"#"+i:"");try{return e.createPolicy(r,{createHTML:e=>e,createScriptURL:e=>e})}catch(e){return console.warn("TrustedTypes policy "+r+" could not be created."),null}};return function t(){let i,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"undefined"==typeof window?null:window,r=e=>t(e);if(r.version="3.1.5",r.removed=[],!n||!n.document||n.document.nodeType!==Y.document)return r.isSupported=!1,r;let{document:a}=n,l=a,c=l.currentScript,{DocumentFragment:T,HTMLTemplateElement:F,Node:z,Element:B,NodeFilter:U,NamedNodeMap:k=n.NamedNodeMap||n.MozNamedAttrMap,HTMLFormElement:H,DOMParser:G,trustedTypes:W}=n,$=B.prototype,K=w($,"cloneNode"),Q=w($,"nextSibling"),J=w($,"childNodes"),ee=w($,"parentNode");if("function"==typeof F){let e=a.createElement("template");e.content&&e.content.ownerDocument&&(a=e.content.ownerDocument)}let et="",{implementation:ei,createNodeIterator:en,createDocumentFragment:er,getElementsByTagName:eo}=a,{importNode:ea}=l,es={};r.isSupported="function"==typeof e&&"function"==typeof ee&&ei&&void 0!==ei.createHTMLDocument;let{MUSTACHE_EXPR:el,ERB_EXPR:ec,TMPLIT_EXPR:eu,DATA_ATTR:eh,ARIA_ATTR:ed,IS_SCRIPT_OR_DATA:ef,ATTR_WHITESPACE:ep,CUSTOM_ELEMENT:em}=q,{IS_ALLOWED_URI:e_}=q,eg=null,eZ=E({},[...S,...C,...A,...O,...P]),ey=null,eb=E({},[...R,...N,...L,...M]),ev=Object.seal(s(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),eT=null,eE=null,ex=!0,ew=!0,eS=!1,eC=!0,eA=!1,eI=!0,eO=!1,eD=!1,eP=!1,eR=!1,eN=!1,eL=!1,eM=!0,eF=!1,ez=!0,eB=!1,eU={},ek=null,eV=E({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]),eH=null,eG=E({},["audio","video","img","source","image","track"]),ej=null,eW=E({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),eq="http://www.w3.org/1998/Math/MathML",eY="http://www.w3.org/2000/svg",eX="http://www.w3.org/1999/xhtml",e$=eX,eK=!1,eQ=null,eJ=E({},[eq,eY,eX],p),e0=null,e1=["application/xhtml+xml","text/html"],e2=null,e3=null,e4=a.createElement("form"),e5=function(e){return e instanceof RegExp||e instanceof Function},e9=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!e3||e3!==e){if(e&&"object"==typeof e||(e={}),e=x(e),e2="application/xhtml+xml"===(e0=-1===e1.indexOf(e.PARSER_MEDIA_TYPE)?"text/html":e.PARSER_MEDIA_TYPE)?p:f,eg=y(e,"ALLOWED_TAGS")?E({},e.ALLOWED_TAGS,e2):eZ,ey=y(e,"ALLOWED_ATTR")?E({},e.ALLOWED_ATTR,e2):eb,eQ=y(e,"ALLOWED_NAMESPACES")?E({},e.ALLOWED_NAMESPACES,p):eJ,ej=y(e,"ADD_URI_SAFE_ATTR")?E(x(eW),e.ADD_URI_SAFE_ATTR,e2):eW,eH=y(e,"ADD_DATA_URI_TAGS")?E(x(eG),e.ADD_DATA_URI_TAGS,e2):eG,ek=y(e,"FORBID_CONTENTS")?E({},e.FORBID_CONTENTS,e2):eV,eT=y(e,"FORBID_TAGS")?E({},e.FORBID_TAGS,e2):{},eE=y(e,"FORBID_ATTR")?E({},e.FORBID_ATTR,e2):{},eU=!!y(e,"USE_PROFILES")&&e.USE_PROFILES,ex=!1!==e.ALLOW_ARIA_ATTR,ew=!1!==e.ALLOW_DATA_ATTR,eS=e.ALLOW_UNKNOWN_PROTOCOLS||!1,eC=!1!==e.ALLOW_SELF_CLOSE_IN_ATTR,eA=e.SAFE_FOR_TEMPLATES||!1,eI=!1!==e.SAFE_FOR_XML,eO=e.WHOLE_DOCUMENT||!1,eR=e.RETURN_DOM||!1,eN=e.RETURN_DOM_FRAGMENT||!1,eL=e.RETURN_TRUSTED_TYPE||!1,eP=e.FORCE_BODY||!1,eM=!1!==e.SANITIZE_DOM,eF=e.SANITIZE_NAMED_PROPS||!1,ez=!1!==e.KEEP_CONTENT,eB=e.IN_PLACE||!1,e_=e.ALLOWED_URI_REGEXP||V,e$=e.NAMESPACE||eX,ev=e.CUSTOM_ELEMENT_HANDLING||{},e.CUSTOM_ELEMENT_HANDLING&&e5(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(ev.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&&e5(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(ev.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(ev.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),eA&&(ew=!1),eN&&(eR=!0),eU&&(eg=E({},P),ey=[],!0===eU.html&&(E(eg,S),E(ey,R)),!0===eU.svg&&(E(eg,C),E(ey,N),E(ey,M)),!0===eU.svgFilters&&(E(eg,A),E(ey,N),E(ey,M)),!0===eU.mathMl&&(E(eg,O),E(ey,L),E(ey,M))),e.ADD_TAGS&&(eg===eZ&&(eg=x(eg)),E(eg,e.ADD_TAGS,e2)),e.ADD_ATTR&&(ey===eb&&(ey=x(ey)),E(ey,e.ADD_ATTR,e2)),e.ADD_URI_SAFE_ATTR&&E(ej,e.ADD_URI_SAFE_ATTR,e2),e.FORBID_CONTENTS&&(ek===eV&&(ek=x(ek)),E(ek,e.FORBID_CONTENTS,e2)),ez&&(eg["#text"]=!0),eO&&E(eg,["html","head","body"]),eg.table&&(E(eg,["tbody"]),delete eT.tbody),e.TRUSTED_TYPES_POLICY){if("function"!=typeof e.TRUSTED_TYPES_POLICY.createHTML)throw v('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if("function"!=typeof e.TRUSTED_TYPES_POLICY.createScriptURL)throw v('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');et=(i=e.TRUSTED_TYPES_POLICY).createHTML("")}else void 0===i&&(i=X(W,c)),null!==i&&"string"==typeof et&&(et=i.createHTML(""));o&&o(e),e3=e}},e8=E({},["mi","mo","mn","ms","mtext"]),e6=E({},["foreignobject","annotation-xml"]),e7=E({},["title","style","font","a","script"]),te=E({},[...C,...A,...I]),tt=E({},[...O,...D]),ti=function(e){let t=ee(e);t&&t.tagName||(t={namespaceURI:e$,tagName:"template"});let i=f(e.tagName),n=f(t.tagName);return!!eQ[e.namespaceURI]&&(e.namespaceURI===eY?t.namespaceURI===eX?"svg"===i:t.namespaceURI===eq?"svg"===i&&("annotation-xml"===n||e8[n]):!!te[i]:e.namespaceURI===eq?t.namespaceURI===eX?"math"===i:t.namespaceURI===eY?"math"===i&&e6[n]:!!tt[i]:e.namespaceURI===eX?(t.namespaceURI!==eY||!!e6[n])&&(t.namespaceURI!==eq||!!e8[n])&&!tt[i]&&(e7[i]||!te[i]):"application/xhtml+xml"===e0&&!!eQ[e.namespaceURI])},tn=function(e){d(r.removed,{element:e});try{e.parentNode.removeChild(e)}catch(t){e.remove()}},tr=function(e,t){try{d(r.removed,{attribute:t.getAttributeNode(e),from:t})}catch(e){d(r.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e&&!ey[e]){if(eR||eN)try{tn(t)}catch(e){}else try{t.setAttribute(e,"")}catch(e){}}},to=function(e){let t=null,n=null;if(eP)e="<remove></remove>"+e;else{let t=m(e,/^[\r\n\t ]+/);n=t&&t[0]}"application/xhtml+xml"===e0&&e$===eX&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");let r=i?i.createHTML(e):e;if(e$===eX)try{t=new G().parseFromString(r,e0)}catch(e){}if(!t||!t.documentElement){t=ei.createDocument(e$,"template",null);try{t.documentElement.innerHTML=eK?et:r}catch(e){}}let o=t.body||t.documentElement;return(e&&n&&o.insertBefore(a.createTextNode(n),o.childNodes[0]||null),e$===eX)?eo.call(t,eO?"html":"body")[0]:eO?t.documentElement:o},ta=function(e){return en.call(e.ownerDocument||e,e,U.SHOW_ELEMENT|U.SHOW_COMMENT|U.SHOW_TEXT|U.SHOW_PROCESSING_INSTRUCTION|U.SHOW_CDATA_SECTION,null)},ts=function(e){return e instanceof H&&("string"!=typeof e.nodeName||"string"!=typeof e.textContent||"function"!=typeof e.removeChild||!(e.attributes instanceof k)||"function"!=typeof e.removeAttribute||"function"!=typeof e.setAttribute||"string"!=typeof e.namespaceURI||"function"!=typeof e.insertBefore||"function"!=typeof e.hasChildNodes)},tl=function(e){return"function"==typeof z&&e instanceof z},tc=function(e,t,i){es[e]&&u(es[e],e=>{e.call(r,t,i,e3)})},tu=function(e){let t=null;if(tc("beforeSanitizeElements",e,null),ts(e))return tn(e),!0;let i=e2(e.nodeName);if(tc("uponSanitizeElement",e,{tagName:i,allowedTags:eg}),e.hasChildNodes()&&!tl(e.firstElementChild)&&b(/<[/\w]/g,e.innerHTML)&&b(/<[/\w]/g,e.textContent)||e.nodeType===Y.progressingInstruction||eI&&e.nodeType===Y.comment&&b(/<[/\w]/g,e.data))return tn(e),!0;if(!eg[i]||eT[i]){if(!eT[i]&&td(i)&&(ev.tagNameCheck instanceof RegExp&&b(ev.tagNameCheck,i)||ev.tagNameCheck instanceof Function&&ev.tagNameCheck(i)))return!1;if(ez&&!ek[i]){let t=ee(e)||e.parentNode,i=J(e)||e.childNodes;if(i&&t){let n=i.length;for(let r=n-1;r>=0;--r){let n=K(i[r],!0);n.__removalCount=(e.__removalCount||0)+1,t.insertBefore(n,Q(e))}}}return tn(e),!0}return e instanceof B&&!ti(e)||("noscript"===i||"noembed"===i||"noframes"===i)&&b(/<\/no(script|embed|frames)/i,e.innerHTML)?(tn(e),!0):(eA&&e.nodeType===Y.text&&(t=e.textContent,u([el,ec,eu],e=>{t=_(t,e," ")}),e.textContent!==t&&(d(r.removed,{element:e.cloneNode()}),e.textContent=t)),tc("afterSanitizeElements",e,null),!1)},th=function(e,t,i){if(eM&&("id"===t||"name"===t)&&(i in a||i in e4))return!1;if(ew&&!eE[t]&&b(eh,t));else if(ex&&b(ed,t));else if(!ey[t]||eE[t]){if(!(td(e)&&(ev.tagNameCheck instanceof RegExp&&b(ev.tagNameCheck,e)||ev.tagNameCheck instanceof Function&&ev.tagNameCheck(e))&&(ev.attributeNameCheck instanceof RegExp&&b(ev.attributeNameCheck,t)||ev.attributeNameCheck instanceof Function&&ev.attributeNameCheck(t))||"is"===t&&ev.allowCustomizedBuiltInElements&&(ev.tagNameCheck instanceof RegExp&&b(ev.tagNameCheck,i)||ev.tagNameCheck instanceof Function&&ev.tagNameCheck(i))))return!1}else if(ej[t]);else if(b(e_,_(i,ep,"")));else if(("src"===t||"xlink:href"===t||"href"===t)&&"script"!==e&&0===g(i,"data:")&&eH[e]);else if(eS&&!b(ef,_(i,ep,"")));else if(i)return!1;return!0},td=function(e){return"annotation-xml"!==e&&m(e,em)},tf=function(e){tc("beforeSanitizeAttributes",e,null);let{attributes:t}=e;if(!t)return;let n={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:ey},o=t.length;for(;o--;){let{name:a,namespaceURI:s,value:l}=t[o],c=e2(a),d="value"===a?l:Z(l);if(n.attrName=c,n.attrValue=d,n.keepAttr=!0,n.forceKeepAttr=void 0,tc("uponSanitizeAttribute",e,n),d=n.attrValue,n.forceKeepAttr||(tr(a,e),!n.keepAttr))continue;if(!eC&&b(/\/>/i,d)||eI&&b(/((--!?|])>)|<\/(style|title)/i,d)){tr(a,e);continue}eA&&u([el,ec,eu],e=>{d=_(d,e," ")});let f=e2(e.nodeName);if(th(f,c,d)){if(eF&&("id"===c||"name"===c)&&(tr(a,e),d="user-content-"+d),i&&"object"==typeof W&&"function"==typeof W.getAttributeType){if(s);else switch(W.getAttributeType(f,c)){case"TrustedHTML":d=i.createHTML(d);break;case"TrustedScriptURL":d=i.createScriptURL(d)}}try{s?e.setAttributeNS(s,a,d):e.setAttribute(a,d),ts(e)?tn(e):h(r.removed)}catch(e){}}}tc("afterSanitizeAttributes",e,null)},tp=function e(t){let i=null,n=ta(t);for(tc("beforeSanitizeShadowDOM",t,null);i=n.nextNode();)tc("uponSanitizeShadowNode",i,null),tu(i)||(i.content instanceof T&&e(i.content),tf(i));tc("afterSanitizeShadowDOM",t,null)};return r.sanitize=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=null,o=null,a=null,s=null;if((eK=!e)&&(e="<!-->"),"string"!=typeof e&&!tl(e)){if("function"==typeof e.toString){if("string"!=typeof(e=e.toString()))throw v("dirty is not a string, aborting")}else throw v("toString is not a function")}if(!r.isSupported)return e;if(eD||e9(t),r.removed=[],"string"==typeof e&&(eB=!1),eB){if(e.nodeName){let t=e2(e.nodeName);if(!eg[t]||eT[t])throw v("root node is forbidden and cannot be sanitized in-place")}}else if(e instanceof z)(o=(n=to("<!---->")).ownerDocument.importNode(e,!0)).nodeType===Y.element&&"BODY"===o.nodeName?n=o:"HTML"===o.nodeName?n=o:n.appendChild(o);else{if(!eR&&!eA&&!eO&&-1===e.indexOf("<"))return i&&eL?i.createHTML(e):e;if(!(n=to(e)))return eR?null:eL?et:""}n&&eP&&tn(n.firstChild);let c=ta(eB?e:n);for(;a=c.nextNode();)tu(a)||(a.content instanceof T&&tp(a.content),tf(a));if(eB)return e;if(eR){if(eN)for(s=er.call(n.ownerDocument);n.firstChild;)s.appendChild(n.firstChild);else s=n;return(ey.shadowroot||ey.shadowrootmode)&&(s=ea.call(l,s,!0)),s}let h=eO?n.outerHTML:n.innerHTML;return eO&&eg["!doctype"]&&n.ownerDocument&&n.ownerDocument.doctype&&n.ownerDocument.doctype.name&&b(j,n.ownerDocument.doctype.name)&&(h="<!DOCTYPE "+n.ownerDocument.doctype.name+">\n"+h),eA&&u([el,ec,eu],e=>{h=_(h,e," ")}),i&&eL?i.createHTML(h):h},r.setConfig=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e9(e),eD=!0},r.clearConfig=function(){e3=null,eD=!1},r.isValidAttribute=function(e,t,i){return e3||e9({}),th(e2(e),e2(t),i)},r.addHook=function(e,t){"function"==typeof t&&(es[e]=es[e]||[],d(es[e],t))},r.removeHook=function(e){if(es[e])return h(es[e])},r.removeHooks=function(e){es[e]&&(es[e]=[])},r.removeAllHooks=function(){es={}},r}()},e.exports=t()},5464:function(e){"use strict";function t(e,t,u){u=u||2;var h,p,_,g,Z,y,b,v=t&&t.length,T=v?t[0]*u:e.length,E=i(e,0,T,u,!0),x=[];if(!E||E.next===E.prev)return x;if(v&&(E=function(e,t,o,l){var c,u,h,p,m,_=[];for(c=0,u=t.length;c<u;c++)h=t[c]*l,p=c<u-1?t[c+1]*l:e.length,(m=i(e,h,p,l,!1))===m.next&&(m.steiner=!0),_.push(function(e){var t=e,i=e;do(t.x<i.x||t.x===i.x&&t.y<i.y)&&(i=t),t=t.next;while(t!==e);return i}(m));for(_.sort(r),c=0;c<_.length;c++)o=function(e,t){var i=function(e,t){var i,n,r,o=t,l=e.x,c=e.y,u=-1/0;do{if(c<=o.y&&c>=o.next.y&&o.next.y!==o.y){var h=o.x+(c-o.y)*(o.next.x-o.x)/(o.next.y-o.y);if(h<=l&&h>u&&(u=h,r=o.x<o.next.x?o:o.next,h===l))return r}o=o.next}while(o!==t);if(!r)return null;var f,p=r,m=r.x,_=r.y,g=1/0;o=r;do l>=o.x&&o.x>=m&&l!==o.x&&a(c<_?l:u,c,m,_,c<_?u:l,c,o.x,o.y)&&(f=Math.abs(c-o.y)/(l-o.x),d(o,e)&&(f<g||f===g&&(o.x>r.x||o.x===r.x&&(i=r,n=o,0>s(i.prev,i,n.prev)&&0>s(n.next,i,i.next))))&&(r=o,g=f)),o=o.next;while(o!==p);return r}(e,t);if(!i)return t;var r=f(i,e);return n(r,r.next),n(i,i.next)}(_[c],o);return o}(e,t,E,u)),e.length>80*u){h=_=e[0],p=g=e[1];for(var w=u;w<T;w+=u)Z=e[w],y=e[w+1],Z<h&&(h=Z),y<p&&(p=y),Z>_&&(_=Z),y>g&&(g=y);b=0!==(b=Math.max(_-h,g-p))?32767/b:0}return function e(t,i,r,u,h,p,_){if(t){!_&&p&&function(e,t,i,n){var r=e;do 0===r.z&&(r.z=o(r.x,r.y,t,i,n)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next;while(r!==e);r.prevZ.nextZ=null,r.prevZ=null,function(e){var t,i,n,r,o,a,s,l,c=1;do{for(i=e,e=null,o=null,a=0;i;){for(a++,n=i,s=0,t=0;t<c&&(s++,n=n.nextZ);t++);for(l=c;s>0||l>0&&n;)0!==s&&(0===l||!n||i.z<=n.z)?(r=i,i=i.nextZ,s--):(r=n,n=n.nextZ,l--),o?o.nextZ=r:e=r,r.prevZ=o,o=r;i=n}o.nextZ=null,c*=2}while(a>1)}(r)}(t,u,h,p);for(var g,Z,y=t;t.prev!==t.next;){if(g=t.prev,Z=t.next,p?function(e,t,i,n){var r=e.prev,l=e.next;if(s(r,e,l)>=0)return!1;for(var c=r.x,u=e.x,h=l.x,d=r.y,f=e.y,p=l.y,m=c<u?c<h?c:h:u<h?u:h,_=d<f?d<p?d:p:f<p?f:p,g=c>u?c>h?c:h:u>h?u:h,Z=d>f?d>p?d:p:f>p?f:p,y=o(m,_,t,i,n),b=o(g,Z,t,i,n),v=e.prevZ,T=e.nextZ;v&&v.z>=y&&T&&T.z<=b;){if(v.x>=m&&v.x<=g&&v.y>=_&&v.y<=Z&&v!==r&&v!==l&&a(c,d,u,f,h,p,v.x,v.y)&&s(v.prev,v,v.next)>=0||(v=v.prevZ,T.x>=m&&T.x<=g&&T.y>=_&&T.y<=Z&&T!==r&&T!==l&&a(c,d,u,f,h,p,T.x,T.y)&&s(T.prev,T,T.next)>=0))return!1;T=T.nextZ}for(;v&&v.z>=y;){if(v.x>=m&&v.x<=g&&v.y>=_&&v.y<=Z&&v!==r&&v!==l&&a(c,d,u,f,h,p,v.x,v.y)&&s(v.prev,v,v.next)>=0)return!1;v=v.prevZ}for(;T&&T.z<=b;){if(T.x>=m&&T.x<=g&&T.y>=_&&T.y<=Z&&T!==r&&T!==l&&a(c,d,u,f,h,p,T.x,T.y)&&s(T.prev,T,T.next)>=0)return!1;T=T.nextZ}return!0}(t,u,h,p):function(e){var t=e.prev,i=e.next;if(s(t,e,i)>=0)return!1;for(var n=t.x,r=e.x,o=i.x,l=t.y,c=e.y,u=i.y,h=n<r?n<o?n:o:r<o?r:o,d=l<c?l<u?l:u:c<u?c:u,f=n>r?n>o?n:o:r>o?r:o,p=l>c?l>u?l:u:c>u?c:u,m=i.next;m!==t;){if(m.x>=h&&m.x<=f&&m.y>=d&&m.y<=p&&a(n,l,r,c,o,u,m.x,m.y)&&s(m.prev,m,m.next)>=0)return!1;m=m.next}return!0}(t)){i.push(g.i/r|0),i.push(t.i/r|0),i.push(Z.i/r|0),m(t),t=Z.next,y=Z.next;continue}if((t=Z)===y){_?1===_?e(t=function(e,t,i){var r=e;do{var o=r.prev,a=r.next.next;!l(o,a)&&c(o,r,r.next,a)&&d(o,a)&&d(a,o)&&(t.push(o.i/i|0),t.push(r.i/i|0),t.push(a.i/i|0),m(r),m(r.next),r=e=a),r=r.next}while(r!==e);return n(r)}(n(t),i,r),i,r,u,h,p,2):2===_&&function(t,i,r,o,a,u){var h=t;do{for(var p,m,_=h.next.next;_!==h.prev;){if(h.i!==_.i&&(p=h,m=_,p.next.i!==m.i&&p.prev.i!==m.i&&!function(e,t){var i=e;do{if(i.i!==e.i&&i.next.i!==e.i&&i.i!==t.i&&i.next.i!==t.i&&c(i,i.next,e,t))return!0;i=i.next}while(i!==e);return!1}(p,m)&&(d(p,m)&&d(m,p)&&function(e,t){var i=e,n=!1,r=(e.x+t.x)/2,o=(e.y+t.y)/2;do i.y>o!=i.next.y>o&&i.next.y!==i.y&&r<(i.next.x-i.x)*(o-i.y)/(i.next.y-i.y)+i.x&&(n=!n),i=i.next;while(i!==e);return n}(p,m)&&(s(p.prev,p,m.prev)||s(p,m.prev,m))||l(p,m)&&s(p.prev,p,p.next)>0&&s(m.prev,m,m.next)>0))){var g=f(h,_);h=n(h,h.next),g=n(g,g.next),e(h,i,r,o,a,u,0),e(g,i,r,o,a,u,0);return}_=_.next}h=h.next}while(h!==t)}(t,i,r,u,h,p):e(n(t),i,r,u,h,p,1);break}}}}(E,x,u,h,p,b,0),x}function i(e,t,i,n,r){var o,a;if(r===g(e,t,i,n)>0)for(o=t;o<i;o+=n)a=p(o,e[o],e[o+1],a);else for(o=i-n;o>=t;o-=n)a=p(o,e[o],e[o+1],a);return a&&l(a,a.next)&&(m(a),a=a.next),a}function n(e,t){if(!e)return e;t||(t=e);var i,n=e;do if(i=!1,!n.steiner&&(l(n,n.next)||0===s(n.prev,n,n.next))){if(m(n),(n=t=n.prev)===n.next)break;i=!0}else n=n.next;while(i||n!==t);return t}function r(e,t){return e.x-t.x}function o(e,t,i,n,r){return(e=((e=((e=((e=((e=(e-i)*r|0)|e<<8)&16711935)|e<<4)&252645135)|e<<2)&858993459)|e<<1)&1431655765)|(t=((t=((t=((t=((t=(t-n)*r|0)|t<<8)&16711935)|t<<4)&252645135)|t<<2)&858993459)|t<<1)&1431655765)<<1}function a(e,t,i,n,r,o,a,s){return(r-a)*(t-s)>=(e-a)*(o-s)&&(e-a)*(n-s)>=(i-a)*(t-s)&&(i-a)*(o-s)>=(r-a)*(n-s)}function s(e,t,i){return(t.y-e.y)*(i.x-t.x)-(t.x-e.x)*(i.y-t.y)}function l(e,t){return e.x===t.x&&e.y===t.y}function c(e,t,i,n){var r=h(s(e,t,i)),o=h(s(e,t,n)),a=h(s(i,n,e)),l=h(s(i,n,t));return!!(r!==o&&a!==l||0===r&&u(e,i,t)||0===o&&u(e,n,t)||0===a&&u(i,e,n)||0===l&&u(i,t,n))}function u(e,t,i){return t.x<=Math.max(e.x,i.x)&&t.x>=Math.min(e.x,i.x)&&t.y<=Math.max(e.y,i.y)&&t.y>=Math.min(e.y,i.y)}function h(e){return e>0?1:e<0?-1:0}function d(e,t){return 0>s(e.prev,e,e.next)?s(e,t,e.next)>=0&&s(e,e.prev,t)>=0:0>s(e,t,e.prev)||0>s(e,e.next,t)}function f(e,t){var i=new _(e.i,e.x,e.y),n=new _(t.i,t.x,t.y),r=e.next,o=t.prev;return e.next=t,t.prev=e,i.next=r,r.prev=i,n.next=i,i.prev=n,o.next=n,n.prev=o,n}function p(e,t,i,n){var r=new _(e,t,i);return n?(r.next=n.next,r.prev=n,n.next.prev=r,n.next=r):(r.prev=r,r.next=r),r}function m(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function _(e,t,i){this.i=e,this.x=t,this.y=i,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function g(e,t,i,n){for(var r=0,o=t,a=i-n;o<i;o+=n)r+=(e[a]-e[o])*(e[o+1]+e[a+1]),a=o;return r}e.exports=t,e.exports.default=t,t.deviation=function(e,t,i,n){var r=t&&t.length,o=r?t[0]*i:e.length,a=Math.abs(g(e,0,o,i));if(r)for(var s=0,l=t.length;s<l;s++){var c=t[s]*i,u=s<l-1?t[s+1]*i:e.length;a-=Math.abs(g(e,c,u,i))}var h=0;for(s=0;s<n.length;s+=3){var d=n[s]*i,f=n[s+1]*i,p=n[s+2]*i;h+=Math.abs((e[d]-e[p])*(e[f+1]-e[d+1])-(e[d]-e[f])*(e[p+1]-e[d+1]))}return 0===a&&0===h?0:Math.abs((h-a)/a)},t.flatten=function(e){for(var t=e[0][0].length,i={vertices:[],holes:[],dimensions:t},n=0,r=0;r<e.length;r++){for(var o=0;o<e[r].length;o++)for(var a=0;a<t;a++)i.vertices.push(e[r][o][a]);r>0&&(n+=e[r-1].length,i.holes.push(n))}return i}},3730:function(e){e.exports&&(e.exports=function(){function e(e,t){void 0===t&&(t=0);var i=e.charCodeAt(t);if(55296<=i&&i<=56319&&t<e.length-1){var n=i,r=e.charCodeAt(t+1);return 56320<=r&&r<=57343?(n-55296)*1024+(r-56320)+65536:n}if(56320<=i&&i<=57343&&t>=1){var n=e.charCodeAt(t-1),r=i;return 55296<=n&&n<=56319?(n-55296)*1024+(r-56320)+65536:r}return i}function t(e){return 1536<=e&&e<=1541||1757==e||1807==e||2274==e||3406==e||69821==e||70082<=e&&e<=70083||72250==e||72326<=e&&e<=72329||73030==e?12:13==e?0:10==e?1:0<=e&&e<=9||11<=e&&e<=12||14<=e&&e<=31||127<=e&&e<=159||173==e||1564==e||6158==e||8203==e||8206<=e&&e<=8207||8232==e||8233==e||8234<=e&&e<=8238||8288<=e&&e<=8292||8293==e||8294<=e&&e<=8303||55296<=e&&e<=57343||65279==e||65520<=e&&e<=65528||65529<=e&&e<=65531||113824<=e&&e<=113827||119155<=e&&e<=119162||917504==e||917505==e||917506<=e&&e<=917535||917632<=e&&e<=917759||918e3<=e&&e<=921599?2:768<=e&&e<=879||1155<=e&&e<=1159||1160<=e&&e<=1161||1425<=e&&e<=1469||1471==e||1473<=e&&e<=1474||1476<=e&&e<=1477||1479==e||1552<=e&&e<=1562||1611<=e&&e<=1631||1648==e||1750<=e&&e<=1756||1759<=e&&e<=1764||1767<=e&&e<=1768||1770<=e&&e<=1773||1809==e||1840<=e&&e<=1866||1958<=e&&e<=1968||2027<=e&&e<=2035||2070<=e&&e<=2073||2075<=e&&e<=2083||2085<=e&&e<=2087||2089<=e&&e<=2093||2137<=e&&e<=2139||2260<=e&&e<=2273||2275<=e&&e<=2306||2362==e||2364==e||2369<=e&&e<=2376||2381==e||2385<=e&&e<=2391||2402<=e&&e<=2403||2433==e||2492==e||2494==e||2497<=e&&e<=2500||2509==e||2519==e||2530<=e&&e<=2531||2561<=e&&e<=2562||2620==e||2625<=e&&e<=2626||2631<=e&&e<=2632||2635<=e&&e<=2637||2641==e||2672<=e&&e<=2673||2677==e||2689<=e&&e<=2690||2748==e||2753<=e&&e<=2757||2759<=e&&e<=2760||2765==e||2786<=e&&e<=2787||2810<=e&&e<=2815||2817==e||2876==e||2878==e||2879==e||2881<=e&&e<=2884||2893==e||2902==e||2903==e||2914<=e&&e<=2915||2946==e||3006==e||3008==e||3021==e||3031==e||3072==e||3134<=e&&e<=3136||3142<=e&&e<=3144||3146<=e&&e<=3149||3157<=e&&e<=3158||3170<=e&&e<=3171||3201==e||3260==e||3263==e||3266==e||3270==e||3276<=e&&e<=3277||3285<=e&&e<=3286||3298<=e&&e<=3299||3328<=e&&e<=3329||3387<=e&&e<=3388||3390==e||3393<=e&&e<=3396||3405==e||3415==e||3426<=e&&e<=3427||3530==e||3535==e||3538<=e&&e<=3540||3542==e||3551==e||3633==e||3636<=e&&e<=3642||3655<=e&&e<=3662||3761==e||3764<=e&&e<=3769||3771<=e&&e<=3772||3784<=e&&e<=3789||3864<=e&&e<=3865||3893==e||3895==e||3897==e||3953<=e&&e<=3966||3968<=e&&e<=3972||3974<=e&&e<=3975||3981<=e&&e<=3991||3993<=e&&e<=4028||4038==e||4141<=e&&e<=4144||4146<=e&&e<=4151||4153<=e&&e<=4154||4157<=e&&e<=4158||4184<=e&&e<=4185||4190<=e&&e<=4192||4209<=e&&e<=4212||4226==e||4229<=e&&e<=4230||4237==e||4253==e||4957<=e&&e<=4959||5906<=e&&e<=5908||5938<=e&&e<=5940||5970<=e&&e<=5971||6002<=e&&e<=6003||6068<=e&&e<=6069||6071<=e&&e<=6077||6086==e||6089<=e&&e<=6099||6109==e||6155<=e&&e<=6157||6277<=e&&e<=6278||6313==e||6432<=e&&e<=6434||6439<=e&&e<=6440||6450==e||6457<=e&&e<=6459||6679<=e&&e<=6680||6683==e||6742==e||6744<=e&&e<=6750||6752==e||6754==e||6757<=e&&e<=6764||6771<=e&&e<=6780||6783==e||6832<=e&&e<=6845||6846==e||6912<=e&&e<=6915||6964==e||6966<=e&&e<=6970||6972==e||6978==e||7019<=e&&e<=7027||7040<=e&&e<=7041||7074<=e&&e<=7077||7080<=e&&e<=7081||7083<=e&&e<=7085||7142==e||7144<=e&&e<=7145||7149==e||7151<=e&&e<=7153||7212<=e&&e<=7219||7222<=e&&e<=7223||7376<=e&&e<=7378||7380<=e&&e<=7392||7394<=e&&e<=7400||7405==e||7412==e||7416<=e&&e<=7417||7616<=e&&e<=7673||7675<=e&&e<=7679||8204==e||8400<=e&&e<=8412||8413<=e&&e<=8416||8417==e||8418<=e&&e<=8420||8421<=e&&e<=8432||11503<=e&&e<=11505||11647==e||11744<=e&&e<=11775||12330<=e&&e<=12333||12334<=e&&e<=12335||12441<=e&&e<=12442||42607==e||42608<=e&&e<=42610||42612<=e&&e<=42621||42654<=e&&e<=42655||42736<=e&&e<=42737||43010==e||43014==e||43019==e||43045<=e&&e<=43046||43204<=e&&e<=43205||43232<=e&&e<=43249||43302<=e&&e<=43309||43335<=e&&e<=43345||43392<=e&&e<=43394||43443==e||43446<=e&&e<=43449||43452==e||43493==e||43561<=e&&e<=43566||43569<=e&&e<=43570||43573<=e&&e<=43574||43587==e||43596==e||43644==e||43696==e||43698<=e&&e<=43700||43703<=e&&e<=43704||43710<=e&&e<=43711||43713==e||43756<=e&&e<=43757||43766==e||44005==e||44008==e||44013==e||64286==e||65024<=e&&e<=65039||65056<=e&&e<=65071||65438<=e&&e<=65439||66045==e||66272==e||66422<=e&&e<=66426||68097<=e&&e<=68099||68101<=e&&e<=68102||68108<=e&&e<=68111||68152<=e&&e<=68154||68159==e||68325<=e&&e<=68326||69633==e||69688<=e&&e<=69702||69759<=e&&e<=69761||69811<=e&&e<=69814||69817<=e&&e<=69818||69888<=e&&e<=69890||69927<=e&&e<=69931||69933<=e&&e<=69940||70003==e||70016<=e&&e<=70017||70070<=e&&e<=70078||70090<=e&&e<=70092||70191<=e&&e<=70193||70196==e||70198<=e&&e<=70199||70206==e||70367==e||70371<=e&&e<=70378||70400<=e&&e<=70401||70460==e||70462==e||70464==e||70487==e||70502<=e&&e<=70508||70512<=e&&e<=70516||70712<=e&&e<=70719||70722<=e&&e<=70724||70726==e||70832==e||70835<=e&&e<=70840||70842==e||70845==e||70847<=e&&e<=70848||70850<=e&&e<=70851||71087==e||71090<=e&&e<=71093||71100<=e&&e<=71101||71103<=e&&e<=71104||71132<=e&&e<=71133||71219<=e&&e<=71226||71229==e||71231<=e&&e<=71232||71339==e||71341==e||71344<=e&&e<=71349||71351==e||71453<=e&&e<=71455||71458<=e&&e<=71461||71463<=e&&e<=71467||72193<=e&&e<=72198||72201<=e&&e<=72202||72243<=e&&e<=72248||72251<=e&&e<=72254||72263==e||72273<=e&&e<=72278||72281<=e&&e<=72283||72330<=e&&e<=72342||72344<=e&&e<=72345||72752<=e&&e<=72758||72760<=e&&e<=72765||72767==e||72850<=e&&e<=72871||72874<=e&&e<=72880||72882<=e&&e<=72883||72885<=e&&e<=72886||73009<=e&&e<=73014||73018==e||73020<=e&&e<=73021||73023<=e&&e<=73029||73031==e||92912<=e&&e<=92916||92976<=e&&e<=92982||94095<=e&&e<=94098||113821<=e&&e<=113822||119141==e||119143<=e&&e<=119145||119150<=e&&e<=119154||119163<=e&&e<=119170||119173<=e&&e<=119179||119210<=e&&e<=119213||119362<=e&&e<=119364||121344<=e&&e<=121398||121403<=e&&e<=121452||121461==e||121476==e||121499<=e&&e<=121503||121505<=e&&e<=121519||122880<=e&&e<=122886||122888<=e&&e<=122904||122907<=e&&e<=122913||122915<=e&&e<=122916||122918<=e&&e<=122922||125136<=e&&e<=125142||125252<=e&&e<=125258||917536<=e&&e<=917631||917760<=e&&e<=917999?3:127462<=e&&e<=127487?4:2307==e||2363==e||2366<=e&&e<=2368||2377<=e&&e<=2380||2382<=e&&e<=2383||2434<=e&&e<=2435||2495<=e&&e<=2496||2503<=e&&e<=2504||2507<=e&&e<=2508||2563==e||2622<=e&&e<=2624||2691==e||2750<=e&&e<=2752||2761==e||2763<=e&&e<=2764||2818<=e&&e<=2819||2880==e||2887<=e&&e<=2888||2891<=e&&e<=2892||3007==e||3009<=e&&e<=3010||3014<=e&&e<=3016||3018<=e&&e<=3020||3073<=e&&e<=3075||3137<=e&&e<=3140||3202<=e&&e<=3203||3262==e||3264<=e&&e<=3265||3267<=e&&e<=3268||3271<=e&&e<=3272||3274<=e&&e<=3275||3330<=e&&e<=3331||3391<=e&&e<=3392||3398<=e&&e<=3400||3402<=e&&e<=3404||3458<=e&&e<=3459||3536<=e&&e<=3537||3544<=e&&e<=3550||3570<=e&&e<=3571||3635==e||3763==e||3902<=e&&e<=3903||3967==e||4145==e||4155<=e&&e<=4156||4182<=e&&e<=4183||4228==e||6070==e||6078<=e&&e<=6085||6087<=e&&e<=6088||6435<=e&&e<=6438||6441<=e&&e<=6443||6448<=e&&e<=6449||6451<=e&&e<=6456||6681<=e&&e<=6682||6741==e||6743==e||6765<=e&&e<=6770||6916==e||6965==e||6971==e||6973<=e&&e<=6977||6979<=e&&e<=6980||7042==e||7073==e||7078<=e&&e<=7079||7082==e||7143==e||7146<=e&&e<=7148||7150==e||7154<=e&&e<=7155||7204<=e&&e<=7211||7220<=e&&e<=7221||7393==e||7410<=e&&e<=7411||7415==e||43043<=e&&e<=43044||43047==e||43136<=e&&e<=43137||43188<=e&&e<=43203||43346<=e&&e<=43347||43395==e||43444<=e&&e<=43445||43450<=e&&e<=43451||43453<=e&&e<=43456||43567<=e&&e<=43568||43571<=e&&e<=43572||43597==e||43755==e||43758<=e&&e<=43759||43765==e||44003<=e&&e<=44004||44006<=e&&e<=44007||44009<=e&&e<=44010||44012==e||69632==e||69634==e||69762==e||69808<=e&&e<=69810||69815<=e&&e<=69816||69932==e||70018==e||70067<=e&&e<=70069||70079<=e&&e<=70080||70188<=e&&e<=70190||70194<=e&&e<=70195||70197==e||70368<=e&&e<=70370||70402<=e&&e<=70403||70463==e||70465<=e&&e<=70468||70471<=e&&e<=70472||70475<=e&&e<=70477||70498<=e&&e<=70499||70709<=e&&e<=70711||70720<=e&&e<=70721||70725==e||70833<=e&&e<=70834||70841==e||70843<=e&&e<=70844||70846==e||70849==e||71088<=e&&e<=71089||71096<=e&&e<=71099||71102==e||71216<=e&&e<=71218||71227<=e&&e<=71228||71230==e||71340==e||71342<=e&&e<=71343||71350==e||71456<=e&&e<=71457||71462==e||72199<=e&&e<=72200||72249==e||72279<=e&&e<=72280||72343==e||72751==e||72766==e||72873==e||72881==e||72884==e||94033<=e&&e<=94078||119142==e||119149==e?5:4352<=e&&e<=4447||43360<=e&&e<=43388?6:4448<=e&&e<=4519||55216<=e&&e<=55238?7:4520<=e&&e<=4607||55243<=e&&e<=55291?8:44032==e||44060==e||44088==e||44116==e||44144==e||44172==e||44200==e||44228==e||44256==e||44284==e||44312==e||44340==e||44368==e||44396==e||44424==e||44452==e||44480==e||44508==e||44536==e||44564==e||44592==e||44620==e||44648==e||44676==e||44704==e||44732==e||44760==e||44788==e||44816==e||44844==e||44872==e||44900==e||44928==e||44956==e||44984==e||45012==e||45040==e||45068==e||45096==e||45124==e||45152==e||45180==e||45208==e||45236==e||45264==e||45292==e||45320==e||45348==e||45376==e||45404==e||45432==e||45460==e||45488==e||45516==e||45544==e||45572==e||45600==e||45628==e||45656==e||45684==e||45712==e||45740==e||45768==e||45796==e||45824==e||45852==e||45880==e||45908==e||45936==e||45964==e||45992==e||46020==e||46048==e||46076==e||46104==e||46132==e||46160==e||46188==e||46216==e||46244==e||46272==e||46300==e||46328==e||46356==e||46384==e||46412==e||46440==e||46468==e||46496==e||46524==e||46552==e||46580==e||46608==e||46636==e||46664==e||46692==e||46720==e||46748==e||46776==e||46804==e||46832==e||46860==e||46888==e||46916==e||46944==e||46972==e||47e3==e||47028==e||47056==e||47084==e||47112==e||47140==e||47168==e||47196==e||47224==e||47252==e||47280==e||47308==e||47336==e||47364==e||47392==e||47420==e||47448==e||47476==e||47504==e||47532==e||47560==e||47588==e||47616==e||47644==e||47672==e||47700==e||47728==e||47756==e||47784==e||47812==e||47840==e||47868==e||47896==e||47924==e||47952==e||47980==e||48008==e||48036==e||48064==e||48092==e||48120==e||48148==e||48176==e||48204==e||48232==e||48260==e||48288==e||48316==e||48344==e||48372==e||48400==e||48428==e||48456==e||48484==e||48512==e||48540==e||48568==e||48596==e||48624==e||48652==e||48680==e||48708==e||48736==e||48764==e||48792==e||48820==e||48848==e||48876==e||48904==e||48932==e||48960==e||48988==e||49016==e||49044==e||49072==e||49100==e||49128==e||49156==e||49184==e||49212==e||49240==e||49268==e||49296==e||49324==e||49352==e||49380==e||49408==e||49436==e||49464==e||49492==e||49520==e||49548==e||49576==e||49604==e||49632==e||49660==e||49688==e||49716==e||49744==e||49772==e||49800==e||49828==e||49856==e||49884==e||49912==e||49940==e||49968==e||49996==e||50024==e||50052==e||50080==e||50108==e||50136==e||50164==e||50192==e||50220==e||50248==e||50276==e||50304==e||50332==e||50360==e||50388==e||50416==e||50444==e||50472==e||50500==e||50528==e||50556==e||50584==e||50612==e||50640==e||50668==e||50696==e||50724==e||50752==e||50780==e||50808==e||50836==e||50864==e||50892==e||50920==e||50948==e||50976==e||51004==e||51032==e||51060==e||51088==e||51116==e||51144==e||51172==e||51200==e||51228==e||51256==e||51284==e||51312==e||51340==e||51368==e||51396==e||51424==e||51452==e||51480==e||51508==e||51536==e||51564==e||51592==e||51620==e||51648==e||51676==e||51704==e||51732==e||51760==e||51788==e||51816==e||51844==e||51872==e||51900==e||51928==e||51956==e||51984==e||52012==e||52040==e||52068==e||52096==e||52124==e||52152==e||52180==e||52208==e||52236==e||52264==e||52292==e||52320==e||52348==e||52376==e||52404==e||52432==e||52460==e||52488==e||52516==e||52544==e||52572==e||52600==e||52628==e||52656==e||52684==e||52712==e||52740==e||52768==e||52796==e||52824==e||52852==e||52880==e||52908==e||52936==e||52964==e||52992==e||53020==e||53048==e||53076==e||53104==e||53132==e||53160==e||53188==e||53216==e||53244==e||53272==e||53300==e||53328==e||53356==e||53384==e||53412==e||53440==e||53468==e||53496==e||53524==e||53552==e||53580==e||53608==e||53636==e||53664==e||53692==e||53720==e||53748==e||53776==e||53804==e||53832==e||53860==e||53888==e||53916==e||53944==e||53972==e||54e3==e||54028==e||54056==e||54084==e||54112==e||54140==e||54168==e||54196==e||54224==e||54252==e||54280==e||54308==e||54336==e||54364==e||54392==e||54420==e||54448==e||54476==e||54504==e||54532==e||54560==e||54588==e||54616==e||54644==e||54672==e||54700==e||54728==e||54756==e||54784==e||54812==e||54840==e||54868==e||54896==e||54924==e||54952==e||54980==e||55008==e||55036==e||55064==e||55092==e||55120==e||55148==e||55176==e?9:44033<=e&&e<=44059||44061<=e&&e<=44087||44089<=e&&e<=44115||44117<=e&&e<=44143||44145<=e&&e<=44171||44173<=e&&e<=44199||44201<=e&&e<=44227||44229<=e&&e<=44255||44257<=e&&e<=44283||44285<=e&&e<=44311||44313<=e&&e<=44339||44341<=e&&e<=44367||44369<=e&&e<=44395||44397<=e&&e<=44423||44425<=e&&e<=44451||44453<=e&&e<=44479||44481<=e&&e<=44507||44509<=e&&e<=44535||44537<=e&&e<=44563||44565<=e&&e<=44591||44593<=e&&e<=44619||44621<=e&&e<=44647||44649<=e&&e<=44675||44677<=e&&e<=44703||44705<=e&&e<=44731||44733<=e&&e<=44759||44761<=e&&e<=44787||44789<=e&&e<=44815||44817<=e&&e<=44843||44845<=e&&e<=44871||44873<=e&&e<=44899||44901<=e&&e<=44927||44929<=e&&e<=44955||44957<=e&&e<=44983||44985<=e&&e<=45011||45013<=e&&e<=45039||45041<=e&&e<=45067||45069<=e&&e<=45095||45097<=e&&e<=45123||45125<=e&&e<=45151||45153<=e&&e<=45179||45181<=e&&e<=45207||45209<=e&&e<=45235||45237<=e&&e<=45263||45265<=e&&e<=45291||45293<=e&&e<=45319||45321<=e&&e<=45347||45349<=e&&e<=45375||45377<=e&&e<=45403||45405<=e&&e<=45431||45433<=e&&e<=45459||45461<=e&&e<=45487||45489<=e&&e<=45515||45517<=e&&e<=45543||45545<=e&&e<=45571||45573<=e&&e<=45599||45601<=e&&e<=45627||45629<=e&&e<=45655||45657<=e&&e<=45683||45685<=e&&e<=45711||45713<=e&&e<=45739||45741<=e&&e<=45767||45769<=e&&e<=45795||45797<=e&&e<=45823||45825<=e&&e<=45851||45853<=e&&e<=45879||45881<=e&&e<=45907||45909<=e&&e<=45935||45937<=e&&e<=45963||45965<=e&&e<=45991||45993<=e&&e<=46019||46021<=e&&e<=46047||46049<=e&&e<=46075||46077<=e&&e<=46103||46105<=e&&e<=46131||46133<=e&&e<=46159||46161<=e&&e<=46187||46189<=e&&e<=46215||46217<=e&&e<=46243||46245<=e&&e<=46271||46273<=e&&e<=46299||46301<=e&&e<=46327||46329<=e&&e<=46355||46357<=e&&e<=46383||46385<=e&&e<=46411||46413<=e&&e<=46439||46441<=e&&e<=46467||46469<=e&&e<=46495||46497<=e&&e<=46523||46525<=e&&e<=46551||46553<=e&&e<=46579||46581<=e&&e<=46607||46609<=e&&e<=46635||46637<=e&&e<=46663||46665<=e&&e<=46691||46693<=e&&e<=46719||46721<=e&&e<=46747||46749<=e&&e<=46775||46777<=e&&e<=46803||46805<=e&&e<=46831||46833<=e&&e<=46859||46861<=e&&e<=46887||46889<=e&&e<=46915||46917<=e&&e<=46943||46945<=e&&e<=46971||46973<=e&&e<=46999||47001<=e&&e<=47027||47029<=e&&e<=47055||47057<=e&&e<=47083||47085<=e&&e<=47111||47113<=e&&e<=47139||47141<=e&&e<=47167||47169<=e&&e<=47195||47197<=e&&e<=47223||47225<=e&&e<=47251||47253<=e&&e<=47279||47281<=e&&e<=47307||47309<=e&&e<=47335||47337<=e&&e<=47363||47365<=e&&e<=47391||47393<=e&&e<=47419||47421<=e&&e<=47447||47449<=e&&e<=47475||47477<=e&&e<=47503||47505<=e&&e<=47531||47533<=e&&e<=47559||47561<=e&&e<=47587||47589<=e&&e<=47615||47617<=e&&e<=47643||47645<=e&&e<=47671||47673<=e&&e<=47699||47701<=e&&e<=47727||47729<=e&&e<=47755||47757<=e&&e<=47783||47785<=e&&e<=47811||47813<=e&&e<=47839||47841<=e&&e<=47867||47869<=e&&e<=47895||47897<=e&&e<=47923||47925<=e&&e<=47951||47953<=e&&e<=47979||47981<=e&&e<=48007||48009<=e&&e<=48035||48037<=e&&e<=48063||48065<=e&&e<=48091||48093<=e&&e<=48119||48121<=e&&e<=48147||48149<=e&&e<=48175||48177<=e&&e<=48203||48205<=e&&e<=48231||48233<=e&&e<=48259||48261<=e&&e<=48287||48289<=e&&e<=48315||48317<=e&&e<=48343||48345<=e&&e<=48371||48373<=e&&e<=48399||48401<=e&&e<=48427||48429<=e&&e<=48455||48457<=e&&e<=48483||48485<=e&&e<=48511||48513<=e&&e<=48539||48541<=e&&e<=48567||48569<=e&&e<=48595||48597<=e&&e<=48623||48625<=e&&e<=48651||48653<=e&&e<=48679||48681<=e&&e<=48707||48709<=e&&e<=48735||48737<=e&&e<=48763||48765<=e&&e<=48791||48793<=e&&e<=48819||48821<=e&&e<=48847||48849<=e&&e<=48875||48877<=e&&e<=48903||48905<=e&&e<=48931||48933<=e&&e<=48959||48961<=e&&e<=48987||48989<=e&&e<=49015||49017<=e&&e<=49043||49045<=e&&e<=49071||49073<=e&&e<=49099||49101<=e&&e<=49127||49129<=e&&e<=49155||49157<=e&&e<=49183||49185<=e&&e<=49211||49213<=e&&e<=49239||49241<=e&&e<=49267||49269<=e&&e<=49295||49297<=e&&e<=49323||49325<=e&&e<=49351||49353<=e&&e<=49379||49381<=e&&e<=49407||49409<=e&&e<=49435||49437<=e&&e<=49463||49465<=e&&e<=49491||49493<=e&&e<=49519||49521<=e&&e<=49547||49549<=e&&e<=49575||49577<=e&&e<=49603||49605<=e&&e<=49631||49633<=e&&e<=49659||49661<=e&&e<=49687||49689<=e&&e<=49715||49717<=e&&e<=49743||49745<=e&&e<=49771||49773<=e&&e<=49799||49801<=e&&e<=49827||49829<=e&&e<=49855||49857<=e&&e<=49883||49885<=e&&e<=49911||49913<=e&&e<=49939||49941<=e&&e<=49967||49969<=e&&e<=49995||49997<=e&&e<=50023||50025<=e&&e<=50051||50053<=e&&e<=50079||50081<=e&&e<=50107||50109<=e&&e<=50135||50137<=e&&e<=50163||50165<=e&&e<=50191||50193<=e&&e<=50219||50221<=e&&e<=50247||50249<=e&&e<=50275||50277<=e&&e<=50303||50305<=e&&e<=50331||50333<=e&&e<=50359||50361<=e&&e<=50387||50389<=e&&e<=50415||50417<=e&&e<=50443||50445<=e&&e<=50471||50473<=e&&e<=50499||50501<=e&&e<=50527||50529<=e&&e<=50555||50557<=e&&e<=50583||50585<=e&&e<=50611||50613<=e&&e<=50639||50641<=e&&e<=50667||50669<=e&&e<=50695||50697<=e&&e<=50723||50725<=e&&e<=50751||50753<=e&&e<=50779||50781<=e&&e<=50807||50809<=e&&e<=50835||50837<=e&&e<=50863||50865<=e&&e<=50891||50893<=e&&e<=50919||50921<=e&&e<=50947||50949<=e&&e<=50975||50977<=e&&e<=51003||51005<=e&&e<=51031||51033<=e&&e<=51059||51061<=e&&e<=51087||51089<=e&&e<=51115||51117<=e&&e<=51143||51145<=e&&e<=51171||51173<=e&&e<=51199||51201<=e&&e<=51227||51229<=e&&e<=51255||51257<=e&&e<=51283||51285<=e&&e<=51311||51313<=e&&e<=51339||51341<=e&&e<=51367||51369<=e&&e<=51395||51397<=e&&e<=51423||51425<=e&&e<=51451||51453<=e&&e<=51479||51481<=e&&e<=51507||51509<=e&&e<=51535||51537<=e&&e<=51563||51565<=e&&e<=51591||51593<=e&&e<=51619||51621<=e&&e<=51647||51649<=e&&e<=51675||51677<=e&&e<=51703||51705<=e&&e<=51731||51733<=e&&e<=51759||51761<=e&&e<=51787||51789<=e&&e<=51815||51817<=e&&e<=51843||51845<=e&&e<=51871||51873<=e&&e<=51899||51901<=e&&e<=51927||51929<=e&&e<=51955||51957<=e&&e<=51983||51985<=e&&e<=52011||52013<=e&&e<=52039||52041<=e&&e<=52067||52069<=e&&e<=52095||52097<=e&&e<=52123||52125<=e&&e<=52151||52153<=e&&e<=52179||52181<=e&&e<=52207||52209<=e&&e<=52235||52237<=e&&e<=52263||52265<=e&&e<=52291||52293<=e&&e<=52319||52321<=e&&e<=52347||52349<=e&&e<=52375||52377<=e&&e<=52403||52405<=e&&e<=52431||52433<=e&&e<=52459||52461<=e&&e<=52487||52489<=e&&e<=52515||52517<=e&&e<=52543||52545<=e&&e<=52571||52573<=e&&e<=52599||52601<=e&&e<=52627||52629<=e&&e<=52655||52657<=e&&e<=52683||52685<=e&&e<=52711||52713<=e&&e<=52739||52741<=e&&e<=52767||52769<=e&&e<=52795||52797<=e&&e<=52823||52825<=e&&e<=52851||52853<=e&&e<=52879||52881<=e&&e<=52907||52909<=e&&e<=52935||52937<=e&&e<=52963||52965<=e&&e<=52991||52993<=e&&e<=53019||53021<=e&&e<=53047||53049<=e&&e<=53075||53077<=e&&e<=53103||53105<=e&&e<=53131||53133<=e&&e<=53159||53161<=e&&e<=53187||53189<=e&&e<=53215||53217<=e&&e<=53243||53245<=e&&e<=53271||53273<=e&&e<=53299||53301<=e&&e<=53327||53329<=e&&e<=53355||53357<=e&&e<=53383||53385<=e&&e<=53411||53413<=e&&e<=53439||53441<=e&&e<=53467||53469<=e&&e<=53495||53497<=e&&e<=53523||53525<=e&&e<=53551||53553<=e&&e<=53579||53581<=e&&e<=53607||53609<=e&&e<=53635||53637<=e&&e<=53663||53665<=e&&e<=53691||53693<=e&&e<=53719||53721<=e&&e<=53747||53749<=e&&e<=53775||53777<=e&&e<=53803||53805<=e&&e<=53831||53833<=e&&e<=53859||53861<=e&&e<=53887||53889<=e&&e<=53915||53917<=e&&e<=53943||53945<=e&&e<=53971||53973<=e&&e<=53999||54001<=e&&e<=54027||54029<=e&&e<=54055||54057<=e&&e<=54083||54085<=e&&e<=54111||54113<=e&&e<=54139||54141<=e&&e<=54167||54169<=e&&e<=54195||54197<=e&&e<=54223||54225<=e&&e<=54251||54253<=e&&e<=54279||54281<=e&&e<=54307||54309<=e&&e<=54335||54337<=e&&e<=54363||54365<=e&&e<=54391||54393<=e&&e<=54419||54421<=e&&e<=54447||54449<=e&&e<=54475||54477<=e&&e<=54503||54505<=e&&e<=54531||54533<=e&&e<=54559||54561<=e&&e<=54587||54589<=e&&e<=54615||54617<=e&&e<=54643||54645<=e&&e<=54671||54673<=e&&e<=54699||54701<=e&&e<=54727||54729<=e&&e<=54755||54757<=e&&e<=54783||54785<=e&&e<=54811||54813<=e&&e<=54839||54841<=e&&e<=54867||54869<=e&&e<=54895||54897<=e&&e<=54923||54925<=e&&e<=54951||54953<=e&&e<=54979||54981<=e&&e<=55007||55009<=e&&e<=55035||55037<=e&&e<=55063||55065<=e&&e<=55091||55093<=e&&e<=55119||55121<=e&&e<=55147||55149<=e&&e<=55175||55177<=e&&e<=55203?10:9757==e||9977==e||9994<=e&&e<=9997||127877==e||127938<=e&&e<=127940||127943==e||127946<=e&&e<=127948||128066<=e&&e<=128067||128070<=e&&e<=128080||128110==e||128112<=e&&e<=128120||128124==e||128129<=e&&e<=128131||128133<=e&&e<=128135||128170==e||128372<=e&&e<=128373||128378==e||128400==e||128405<=e&&e<=128406||128581<=e&&e<=128583||128587<=e&&e<=128591||128675==e||128692<=e&&e<=128694||128704==e||128716==e||129304<=e&&e<=129308||129310<=e&&e<=129311||129318==e||129328<=e&&e<=129337||129341<=e&&e<=129342||129489<=e&&e<=129501?13:127995<=e&&e<=127999?14:8205==e?15:9792==e||9794==e||9877<=e&&e<=9878||9992==e||10084==e||127752==e||127806==e||127859==e||127891==e||127908==e||127912==e||127979==e||127981==e||128139==e||128187<=e&&e<=128188||128295==e||128300==e||128488==e||128640==e||128658==e?16:128102<=e&&e<=128105?17:11}return this.nextBreak=function(i,n){if(void 0===n&&(n=0),n<0)return 0;if(n>=i.length-1)return i.length;for(var r=t(e(i,n)),o=[],a=n+1;a<i.length;a++)if(s=a-1,!(55296<=i.charCodeAt(s)&&56319>=i.charCodeAt(s)&&56320<=i.charCodeAt(s+1)&&57343>=i.charCodeAt(s+1))){var s,l=t(e(i,a));if(function(e,t,i){var n=[e].concat(t).concat([i]),r=n[n.length-2],o=n.lastIndexOf(14);if(o>1&&n.slice(1,o).every(function(e){return 3==e})&&-1==[3,13,17].indexOf(e))return 2;var a=n.lastIndexOf(4);if(a>0&&n.slice(1,a).every(function(e){return 4==e})&&-1==[12,4].indexOf(r))return n.filter(function(e){return 4==e}).length%2==1?3:4;if(0==r&&1==i)return 0;if(2==r||0==r||1==r)return 14==i&&t.every(function(e){return 3==e})?2:1;if(2==i||0==i||1==i)return 1;if(6==r&&(6==i||7==i||9==i||10==i))return 0;if((9==r||7==r)&&(7==i||8==i))return 0;if((10==r||8==r)&&8==i)return 0;if(3==i||15==i)return 0;else if(5==i)return 0;else if(12==r)return 0;var s=-1!=n.indexOf(3)?n.lastIndexOf(3)-1:n.length-2;return -1!=[13,17].indexOf(n[s])&&n.slice(s+1,-1).every(function(e){return 3==e})&&14==i||15==r&&-1!=[16,17].indexOf(i)?0:-1!=t.indexOf(4)?2:4==r&&4==i?0:1}(r,o,l))return a;o.push(l)}return i.length},this.splitGraphemes=function(e){for(var t,i=[],n=0;(t=this.nextBreak(e,n))<e.length;)i.push(e.slice(n,t)),n=t;return n<e.length&&i.push(e.slice(n)),i},this.iterateGraphemes=function(e){var t=0,i={next:(function(){var i,n;return(n=this.nextBreak(e,t))<e.length?(i=e.slice(t,n),t=n,{value:i,done:!1}):t<e.length?(i=e.slice(t),t=e.length,{value:i,done:!1}):{value:void 0,done:!0}}).bind(this)};return"undefined"!=typeof Symbol&&Symbol.iterator&&(i[Symbol.iterator]=function(){return i}),i},this.countGraphemes=function(e){for(var t,i=0,n=0;(t=this.nextBreak(e,n))<e.length;)n=t,i++;return n<e.length&&i++,i},this})},5413:function(e){var t=function(e){void 0==e&&(e=new Date().getTime()),this.N=624,this.M=397,this.MATRIX_A=2567483615,this.UPPER_MASK=2147483648,this.LOWER_MASK=2147483647,this.mt=Array(this.N),this.mti=this.N+1,e.constructor==Array?this.init_by_array(e,e.length):this.init_seed(e)};t.prototype.init_seed=function(e){for(this.mt[0]=e>>>0,this.mti=1;this.mti<this.N;this.mti++){var e=this.mt[this.mti-1]^this.mt[this.mti-1]>>>30;this.mt[this.mti]=(((4294901760&e)>>>16)*1812433253<<16)+(65535&e)*1812433253+this.mti,this.mt[this.mti]>>>=0}},t.prototype.init_by_array=function(e,t){var i,n,r;for(this.init_seed(19650218),i=1,n=0,r=this.N>t?this.N:t;r;r--){var o=this.mt[i-1]^this.mt[i-1]>>>30;this.mt[i]=(this.mt[i]^(((4294901760&o)>>>16)*1664525<<16)+(65535&o)*1664525)+e[n]+n,this.mt[i]>>>=0,i++,n++,i>=this.N&&(this.mt[0]=this.mt[this.N-1],i=1),n>=t&&(n=0)}for(r=this.N-1;r;r--){var o=this.mt[i-1]^this.mt[i-1]>>>30;this.mt[i]=(this.mt[i]^(((4294901760&o)>>>16)*1566083941<<16)+(65535&o)*1566083941)-i,this.mt[i]>>>=0,++i>=this.N&&(this.mt[0]=this.mt[this.N-1],i=1)}this.mt[0]=2147483648},t.prototype.random_int=function(){var e,t,i=[0,this.MATRIX_A];if(this.mti>=this.N){for(this.mti==this.N+1&&this.init_seed(5489),t=0;t<this.N-this.M;t++)e=this.mt[t]&this.UPPER_MASK|this.mt[t+1]&this.LOWER_MASK,this.mt[t]=this.mt[t+this.M]^e>>>1^i[1&e];for(;t<this.N-1;t++)e=this.mt[t]&this.UPPER_MASK|this.mt[t+1]&this.LOWER_MASK,this.mt[t]=this.mt[t+(this.M-this.N)]^e>>>1^i[1&e];e=this.mt[this.N-1]&this.UPPER_MASK|this.mt[0]&this.LOWER_MASK,this.mt[this.N-1]=this.mt[this.M-1]^e>>>1^i[1&e],this.mti=0}return e=this.mt[this.mti++],e^=e>>>11,e^=e<<7&2636928640,e^=e<<15&4022730752,(e^=e>>>18)>>>0},t.prototype.random_int31=function(){return this.random_int()>>>1},t.prototype.random_incl=function(){return this.random_int()*(1/4294967295)},t.prototype.random=function(){return this.random_int()*(1/4294967296)},t.prototype.random_excl=function(){return(this.random_int()+.5)*(1/4294967296)},t.prototype.random_long=function(){return 1/9007199254740992*(67108864*(this.random_int()>>>5)+(this.random_int()>>>6))},e.exports=t},6648:function(e,t,i){"use strict";i.d(t,{default:function(){return r.a}});var n=i(5601),r=i.n(n)},8173:function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"Image",{enumerable:!0,get:function(){return y}});let n=i(9920),r=i(1452),o=i(7437),a=r._(i(2265)),s=n._(i(4887)),l=n._(i(8321)),c=i(497),u=i(7103),h=i(3938);i(2301);let d=i(291),f=n._(i(1241)),p={deviceSizes:[640,750,828,1080,1200,1920,2048,3840],imageSizes:[16,32,48,64,96,128,256,384],path:"/_next/image",loader:"default",dangerouslyAllowSVG:!1,unoptimized:!0};function m(e,t,i,n,r,o,a){let s=null==e?void 0:e.src;e&&e["data-loaded-src"]!==s&&(e["data-loaded-src"]=s,("decode"in e?e.decode():Promise.resolve()).catch(()=>{}).then(()=>{if(e.parentElement&&e.isConnected){if("empty"!==t&&r(!0),null==i?void 0:i.current){let t=new Event("load");Object.defineProperty(t,"target",{writable:!1,value:e});let n=!1,r=!1;i.current({...t,nativeEvent:t,currentTarget:e,target:e,isDefaultPrevented:()=>n,isPropagationStopped:()=>r,persist:()=>{},preventDefault:()=>{n=!0,t.preventDefault()},stopPropagation:()=>{r=!0,t.stopPropagation()}})}(null==n?void 0:n.current)&&n.current(e)}}))}function _(e){let[t,i]=a.version.split(".",2),n=parseInt(t,10),r=parseInt(i,10);return n>18||18===n&&r>=3?{fetchPriority:e}:{fetchpriority:e}}"undefined"==typeof window&&(globalThis.__NEXT_IMAGE_IMPORTED=!0);let g=(0,a.forwardRef)((e,t)=>{let{src:i,srcSet:n,sizes:r,height:s,width:l,decoding:c,className:u,style:h,fetchPriority:d,placeholder:f,loading:p,unoptimized:g,fill:Z,onLoadRef:y,onLoadingCompleteRef:b,setBlurComplete:v,setShowAltText:T,sizesInput:E,onLoad:x,onError:w,...S}=e;return(0,o.jsx)("img",{...S,..._(d),loading:p,width:l,height:s,decoding:c,"data-nimg":Z?"fill":"1",className:u,style:h,sizes:r,srcSet:n,src:i,ref:(0,a.useCallback)(e=>{t&&("function"==typeof t?t(e):"object"==typeof t&&(t.current=e)),e&&(w&&(e.src=e.src),e.complete&&m(e,f,y,b,v,g,E))},[i,f,y,b,v,w,g,E,t]),onLoad:e=>{m(e.currentTarget,f,y,b,v,g,E)},onError:e=>{T(!0),"empty"!==f&&v(!0),w&&w(e)}})});function Z(e){let{isAppRouter:t,imgAttributes:i}=e,n={as:"image",imageSrcSet:i.srcSet,imageSizes:i.sizes,crossOrigin:i.crossOrigin,referrerPolicy:i.referrerPolicy,..._(i.fetchPriority)};return t&&s.default.preload?(s.default.preload(i.src,n),null):(0,o.jsx)(l.default,{children:(0,o.jsx)("link",{rel:"preload",href:i.srcSet?void 0:i.src,...n},"__nimg-"+i.src+i.srcSet+i.sizes)})}let y=(0,a.forwardRef)((e,t)=>{let i=(0,a.useContext)(d.RouterContext),n=(0,a.useContext)(h.ImageConfigContext),r=(0,a.useMemo)(()=>{let e=p||n||u.imageConfigDefault,t=[...e.deviceSizes,...e.imageSizes].sort((e,t)=>e-t),i=e.deviceSizes.sort((e,t)=>e-t);return{...e,allSizes:t,deviceSizes:i}},[n]),{onLoad:s,onLoadingComplete:l}=e,m=(0,a.useRef)(s);(0,a.useEffect)(()=>{m.current=s},[s]);let _=(0,a.useRef)(l);(0,a.useEffect)(()=>{_.current=l},[l]);let[y,b]=(0,a.useState)(!1),[v,T]=(0,a.useState)(!1),{props:E,meta:x}=(0,c.getImgProps)(e,{defaultLoader:f.default,imgConf:r,blurComplete:y,showAltText:v});return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(g,{...E,unoptimized:x.unoptimized,placeholder:x.placeholder,fill:x.fill,onLoadRef:m,onLoadingCompleteRef:_,setBlurComplete:b,setShowAltText:T,sizesInput:e.sizes,ref:t}),x.priority?(0,o.jsx)(Z,{isAppRouter:!i,imgAttributes:E}):null]})});("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},6300:function(e){!function(){var t={675:function(e,t){"use strict";t.byteLength=function(e){var t=l(e),i=t[0],n=t[1];return(i+n)*3/4-n},t.toByteArray=function(e){var t,i,o=l(e),a=o[0],s=o[1],c=new r((a+s)*3/4-s),u=0,h=s>0?a-4:a;for(i=0;i<h;i+=4)t=n[e.charCodeAt(i)]<<18|n[e.charCodeAt(i+1)]<<12|n[e.charCodeAt(i+2)]<<6|n[e.charCodeAt(i+3)],c[u++]=t>>16&255,c[u++]=t>>8&255,c[u++]=255&t;return 2===s&&(t=n[e.charCodeAt(i)]<<2|n[e.charCodeAt(i+1)]>>4,c[u++]=255&t),1===s&&(t=n[e.charCodeAt(i)]<<10|n[e.charCodeAt(i+1)]<<4|n[e.charCodeAt(i+2)]>>2,c[u++]=t>>8&255,c[u++]=255&t),c},t.fromByteArray=function(e){for(var t,n=e.length,r=n%3,o=[],a=0,s=n-r;a<s;a+=16383)o.push(function(e,t,n){for(var r,o=[],a=t;a<n;a+=3)o.push(i[(r=(e[a]<<16&16711680)+(e[a+1]<<8&65280)+(255&e[a+2]))>>18&63]+i[r>>12&63]+i[r>>6&63]+i[63&r]);return o.join("")}(e,a,a+16383>s?s:a+16383));return 1===r?o.push(i[(t=e[n-1])>>2]+i[t<<4&63]+"=="):2===r&&o.push(i[(t=(e[n-2]<<8)+e[n-1])>>10]+i[t>>4&63]+i[t<<2&63]+"="),o.join("")};for(var i=[],n=[],r="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,s=o.length;a<s;++a)i[a]=o[a],n[o.charCodeAt(a)]=a;function l(e){var t=e.length;if(t%4>0)throw Error("Invalid string. Length must be a multiple of 4");var i=e.indexOf("=");-1===i&&(i=t);var n=i===t?0:4-i%4;return[i,n]}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},72:function(e,t,i){"use strict";/*! * The buffer module from node.js, for the browser. * * @author Feross Aboukhadijeh <https://feross.org> * @license MIT */var n=i(675),r=i(783),o="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;function a(e){if(e>2147483647)throw RangeError('The value "'+e+'" is invalid for option "size"');var t=new Uint8Array(e);return Object.setPrototypeOf(t,s.prototype),t}function s(e,t,i){if("number"==typeof e){if("string"==typeof t)throw TypeError('The "string" argument must be of type string. Received type number');return u(e)}return l(e,t,i)}function l(e,t,i){if("string"==typeof e)return function(e,t){if(("string"!=typeof t||""===t)&&(t="utf8"),!s.isEncoding(t))throw TypeError("Unknown encoding: "+t);var i=0|f(e,t),n=a(i),r=n.write(e,t);return r!==i&&(n=n.slice(0,r)),n}(e,t);if(ArrayBuffer.isView(e))return h(e);if(null==e)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(I(e,ArrayBuffer)||e&&I(e.buffer,ArrayBuffer)||"undefined"!=typeof SharedArrayBuffer&&(I(e,SharedArrayBuffer)||e&&I(e.buffer,SharedArrayBuffer)))return function(e,t,i){var n;if(t<0||e.byteLength<t)throw RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(i||0))throw RangeError('"length" is outside of buffer bounds');return Object.setPrototypeOf(n=void 0===t&&void 0===i?new Uint8Array(e):void 0===i?new Uint8Array(e,t):new Uint8Array(e,t,i),s.prototype),n}(e,t,i);if("number"==typeof e)throw TypeError('The "value" argument must not be of type number. Received type number');var n=e.valueOf&&e.valueOf();if(null!=n&&n!==e)return s.from(n,t,i);var r=function(e){if(s.isBuffer(e)){var t,i=0|d(e.length),n=a(i);return 0===n.length||e.copy(n,0,0,i),n}return void 0!==e.length?"number"!=typeof e.length||(t=e.length)!=t?a(0):h(e):"Buffer"===e.type&&Array.isArray(e.data)?h(e.data):void 0}(e);if(r)return r;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return s.from(e[Symbol.toPrimitive]("string"),t,i);throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function c(e){if("number"!=typeof e)throw TypeError('"size" argument must be of type number');if(e<0)throw RangeError('The value "'+e+'" is invalid for option "size"')}function u(e){return c(e),a(e<0?0:0|d(e))}function h(e){for(var t=e.length<0?0:0|d(e.length),i=a(t),n=0;n<t;n+=1)i[n]=255&e[n];return i}function d(e){if(e>=2147483647)throw RangeError("Attempt to allocate Buffer larger than maximum size: 0x7fffffff bytes");return 0|e}function f(e,t){if(s.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||I(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);var i=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===i)return 0;for(var r=!1;;)switch(t){case"ascii":case"latin1":case"binary":return i;case"utf8":case"utf-8":return w(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*i;case"hex":return i>>>1;case"base64":return C(e).length;default:if(r)return n?-1:w(e).length;t=(""+t).toLowerCase(),r=!0}}function p(e,t,i){var r,o,a=!1;if((void 0===t||t<0)&&(t=0),t>this.length||((void 0===i||i>this.length)&&(i=this.length),i<=0||(i>>>=0)<=(t>>>=0)))return"";for(e||(e="utf8");;)switch(e){case"hex":return function(e,t,i){var n=e.length;(!t||t<0)&&(t=0),(!i||i<0||i>n)&&(i=n);for(var r="",o=t;o<i;++o)r+=O[e[o]];return r}(this,t,i);case"utf8":case"utf-8":return Z(this,t,i);case"ascii":return function(e,t,i){var n="";i=Math.min(e.length,i);for(var r=t;r<i;++r)n+=String.fromCharCode(127&e[r]);return n}(this,t,i);case"latin1":case"binary":return function(e,t,i){var n="";i=Math.min(e.length,i);for(var r=t;r<i;++r)n+=String.fromCharCode(e[r]);return n}(this,t,i);case"base64":return r=t,o=i,0===r&&o===this.length?n.fromByteArray(this):n.fromByteArray(this.slice(r,o));case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return function(e,t,i){for(var n=e.slice(t,i),r="",o=0;o<n.length;o+=2)r+=String.fromCharCode(n[o]+256*n[o+1]);return r}(this,t,i);default:if(a)throw TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),a=!0}}function m(e,t,i){var n=e[t];e[t]=e[i],e[i]=n}function _(e,t,i,n,r){var o;if(0===e.length)return -1;if("string"==typeof i?(n=i,i=0):i>2147483647?i=2147483647:i<-2147483648&&(i=-2147483648),(o=i=+i)!=o&&(i=r?0:e.length-1),i<0&&(i=e.length+i),i>=e.length){if(r)return -1;i=e.length-1}else if(i<0){if(!r)return -1;i=0}if("string"==typeof t&&(t=s.from(t,n)),s.isBuffer(t))return 0===t.length?-1:g(e,t,i,n,r);if("number"==typeof t)return(t&=255,"function"==typeof Uint8Array.prototype.indexOf)?r?Uint8Array.prototype.indexOf.call(e,t,i):Uint8Array.prototype.lastIndexOf.call(e,t,i):g(e,[t],i,n,r);throw TypeError("val must be string, number or Buffer")}function g(e,t,i,n,r){var o,a=1,s=e.length,l=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return -1;a=2,s/=2,l/=2,i/=2}function c(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(r){var u=-1;for(o=i;o<s;o++)if(c(e,o)===c(t,-1===u?0:o-u)){if(-1===u&&(u=o),o-u+1===l)return u*a}else -1!==u&&(o-=o-u),u=-1}else for(i+l>s&&(i=s-l),o=i;o>=0;o--){for(var h=!0,d=0;d<l;d++)if(c(e,o+d)!==c(t,d)){h=!1;break}if(h)return o}return -1}function Z(e,t,i){i=Math.min(e.length,i);for(var n=[],r=t;r<i;){var o,a,s,l,c=e[r],u=null,h=c>239?4:c>223?3:c>191?2:1;if(r+h<=i)switch(h){case 1:c<128&&(u=c);break;case 2:(192&(o=e[r+1]))==128&&(l=(31&c)<<6|63&o)>127&&(u=l);break;case 3:o=e[r+1],a=e[r+2],(192&o)==128&&(192&a)==128&&(l=(15&c)<<12|(63&o)<<6|63&a)>2047&&(l<55296||l>57343)&&(u=l);break;case 4:o=e[r+1],a=e[r+2],s=e[r+3],(192&o)==128&&(192&a)==128&&(192&s)==128&&(l=(15&c)<<18|(63&o)<<12|(63&a)<<6|63&s)>65535&&l<1114112&&(u=l)}null===u?(u=65533,h=1):u>65535&&(u-=65536,n.push(u>>>10&1023|55296),u=56320|1023&u),n.push(u),r+=h}return function(e){var t=e.length;if(t<=4096)return String.fromCharCode.apply(String,e);for(var i="",n=0;n<t;)i+=String.fromCharCode.apply(String,e.slice(n,n+=4096));return i}(n)}function y(e,t,i){if(e%1!=0||e<0)throw RangeError("offset is not uint");if(e+t>i)throw RangeError("Trying to access beyond buffer length")}function b(e,t,i,n,r,o){if(!s.isBuffer(e))throw TypeError('"buffer" argument must be a Buffer instance');if(t>r||t<o)throw RangeError('"value" argument is out of bounds');if(i+n>e.length)throw RangeError("Index out of range")}function v(e,t,i,n,r,o){if(i+n>e.length||i<0)throw RangeError("Index out of range")}function T(e,t,i,n,o){return t=+t,i>>>=0,o||v(e,t,i,4,34028234663852886e22,-34028234663852886e22),r.write(e,t,i,n,23,4),i+4}function E(e,t,i,n,o){return t=+t,i>>>=0,o||v(e,t,i,8,17976931348623157e292,-17976931348623157e292),r.write(e,t,i,n,52,8),i+8}t.Buffer=s,t.SlowBuffer=function(e){return+e!=e&&(e=0),s.alloc(+e)},t.INSPECT_MAX_BYTES=50,t.kMaxLength=2147483647,s.TYPED_ARRAY_SUPPORT=function(){try{var e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}(),s.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(s.prototype,"parent",{enumerable:!0,get:function(){if(s.isBuffer(this))return this.buffer}}),Object.defineProperty(s.prototype,"offset",{enumerable:!0,get:function(){if(s.isBuffer(this))return this.byteOffset}}),s.poolSize=8192,s.from=function(e,t,i){return l(e,t,i)},Object.setPrototypeOf(s.prototype,Uint8Array.prototype),Object.setPrototypeOf(s,Uint8Array),s.alloc=function(e,t,i){return(c(e),e<=0)?a(e):void 0!==t?"string"==typeof i?a(e).fill(t,i):a(e).fill(t):a(e)},s.allocUnsafe=function(e){return u(e)},s.allocUnsafeSlow=function(e){return u(e)},s.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==s.prototype},s.compare=function(e,t){if(I(e,Uint8Array)&&(e=s.from(e,e.offset,e.byteLength)),I(t,Uint8Array)&&(t=s.from(t,t.offset,t.byteLength)),!s.isBuffer(e)||!s.isBuffer(t))throw TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;for(var i=e.length,n=t.length,r=0,o=Math.min(i,n);r<o;++r)if(e[r]!==t[r]){i=e[r],n=t[r];break}return i<n?-1:n<i?1:0},s.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},s.concat=function(e,t){if(!Array.isArray(e))throw TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return s.alloc(0);if(void 0===t)for(i=0,t=0;i<e.length;++i)t+=e[i].length;var i,n=s.allocUnsafe(t),r=0;for(i=0;i<e.length;++i){var o=e[i];if(I(o,Uint8Array)&&(o=s.from(o)),!s.isBuffer(o))throw TypeError('"list" argument must be an Array of Buffers');o.copy(n,r),r+=o.length}return n},s.byteLength=f,s.prototype._isBuffer=!0,s.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)m(this,t,t+1);return this},s.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)m(this,t,t+3),m(this,t+1,t+2);return this},s.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)m(this,t,t+7),m(this,t+1,t+6),m(this,t+2,t+5),m(this,t+3,t+4);return this},s.prototype.toString=function(){var e=this.length;return 0===e?"":0==arguments.length?Z(this,0,e):p.apply(this,arguments)},s.prototype.toLocaleString=s.prototype.toString,s.prototype.equals=function(e){if(!s.isBuffer(e))throw TypeError("Argument must be a Buffer");return this===e||0===s.compare(this,e)},s.prototype.inspect=function(){var e="",i=t.INSPECT_MAX_BYTES;return e=this.toString("hex",0,i).replace(/(.{2})/g,"$1 ").trim(),this.length>i&&(e+=" ... "),"<Buffer "+e+">"},o&&(s.prototype[o]=s.prototype.inspect),s.prototype.compare=function(e,t,i,n,r){if(I(e,Uint8Array)&&(e=s.from(e,e.offset,e.byteLength)),!s.isBuffer(e))throw TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===i&&(i=e?e.length:0),void 0===n&&(n=0),void 0===r&&(r=this.length),t<0||i>e.length||n<0||r>this.length)throw RangeError("out of range index");if(n>=r&&t>=i)return 0;if(n>=r)return -1;if(t>=i)return 1;if(t>>>=0,i>>>=0,n>>>=0,r>>>=0,this===e)return 0;for(var o=r-n,a=i-t,l=Math.min(o,a),c=this.slice(n,r),u=e.slice(t,i),h=0;h<l;++h)if(c[h]!==u[h]){o=c[h],a=u[h];break}return o<a?-1:a<o?1:0},s.prototype.includes=function(e,t,i){return -1!==this.indexOf(e,t,i)},s.prototype.indexOf=function(e,t,i){return _(this,e,t,i,!0)},s.prototype.lastIndexOf=function(e,t,i){return _(this,e,t,i,!1)},s.prototype.write=function(e,t,i,n){if(void 0===t)n="utf8",i=this.length,t=0;else if(void 0===i&&"string"==typeof t)n=t,i=this.length,t=0;else if(isFinite(t))t>>>=0,isFinite(i)?(i>>>=0,void 0===n&&(n="utf8")):(n=i,i=void 0);else throw Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var r,o,a,s,l,c,u,h,d,f,p,m,_=this.length-t;if((void 0===i||i>_)&&(i=_),e.length>0&&(i<0||t<0)||t>this.length)throw RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var g=!1;;)switch(n){case"hex":return function(e,t,i,n){i=Number(i)||0;var r=e.length-i;n?(n=Number(n))>r&&(n=r):n=r;var o=t.length;n>o/2&&(n=o/2);for(var a=0;a<n;++a){var s=parseInt(t.substr(2*a,2),16);if(s!=s)break;e[i+a]=s}return a}(this,e,t,i);case"utf8":case"utf-8":return l=t,c=i,A(w(e,this.length-l),this,l,c);case"ascii":return u=t,h=i,A(S(e),this,u,h);case"latin1":case"binary":return r=this,o=e,a=t,s=i,A(S(o),r,a,s);case"base64":return d=t,f=i,A(C(e),this,d,f);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return p=t,m=i,A(function(e,t){for(var i,n,r=[],o=0;o<e.length&&!((t-=2)<0);++o)n=(i=e.charCodeAt(o))>>8,r.push(i%256),r.push(n);return r}(e,this.length-p),this,p,m);default:if(g)throw TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),g=!0}},s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},s.prototype.slice=function(e,t){var i=this.length;e=~~e,t=void 0===t?i:~~t,e<0?(e+=i)<0&&(e=0):e>i&&(e=i),t<0?(t+=i)<0&&(t=0):t>i&&(t=i),t<e&&(t=e);var n=this.subarray(e,t);return Object.setPrototypeOf(n,s.prototype),n},s.prototype.readUIntLE=function(e,t,i){e>>>=0,t>>>=0,i||y(e,t,this.length);for(var n=this[e],r=1,o=0;++o<t&&(r*=256);)n+=this[e+o]*r;return n},s.prototype.readUIntBE=function(e,t,i){e>>>=0,t>>>=0,i||y(e,t,this.length);for(var n=this[e+--t],r=1;t>0&&(r*=256);)n+=this[e+--t]*r;return n},s.prototype.readUInt8=function(e,t){return e>>>=0,t||y(e,1,this.length),this[e]},s.prototype.readUInt16LE=function(e,t){return e>>>=0,t||y(e,2,this.length),this[e]|this[e+1]<<8},s.prototype.readUInt16BE=function(e,t){return e>>>=0,t||y(e,2,this.length),this[e]<<8|this[e+1]},s.prototype.readUInt32LE=function(e,t){return e>>>=0,t||y(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},s.prototype.readUInt32BE=function(e,t){return e>>>=0,t||y(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},s.prototype.readIntLE=function(e,t,i){e>>>=0,t>>>=0,i||y(e,t,this.length);for(var n=this[e],r=1,o=0;++o<t&&(r*=256);)n+=this[e+o]*r;return n>=(r*=128)&&(n-=Math.pow(2,8*t)),n},s.prototype.readIntBE=function(e,t,i){e>>>=0,t>>>=0,i||y(e,t,this.length);for(var n=t,r=1,o=this[e+--n];n>0&&(r*=256);)o+=this[e+--n]*r;return o>=(r*=128)&&(o-=Math.pow(2,8*t)),o},s.prototype.readInt8=function(e,t){return(e>>>=0,t||y(e,1,this.length),128&this[e])?-((255-this[e]+1)*1):this[e]},s.prototype.readInt16LE=function(e,t){e>>>=0,t||y(e,2,this.length);var i=this[e]|this[e+1]<<8;return 32768&i?4294901760|i:i},s.prototype.readInt16BE=function(e,t){e>>>=0,t||y(e,2,this.length);var i=this[e+1]|this[e]<<8;return 32768&i?4294901760|i:i},s.prototype.readInt32LE=function(e,t){return e>>>=0,t||y(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},s.prototype.readInt32BE=function(e,t){return e>>>=0,t||y(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},s.prototype.readFloatLE=function(e,t){return e>>>=0,t||y(e,4,this.length),r.read(this,e,!0,23,4)},s.prototype.readFloatBE=function(e,t){return e>>>=0,t||y(e,4,this.length),r.read(this,e,!1,23,4)},s.prototype.readDoubleLE=function(e,t){return e>>>=0,t||y(e,8,this.length),r.read(this,e,!0,52,8)},s.prototype.readDoubleBE=function(e,t){return e>>>=0,t||y(e,8,this.length),r.read(this,e,!1,52,8)},s.prototype.writeUIntLE=function(e,t,i,n){if(e=+e,t>>>=0,i>>>=0,!n){var r=Math.pow(2,8*i)-1;b(this,e,t,i,r,0)}var o=1,a=0;for(this[t]=255&e;++a<i&&(o*=256);)this[t+a]=e/o&255;return t+i},s.prototype.writeUIntBE=function(e,t,i,n){if(e=+e,t>>>=0,i>>>=0,!n){var r=Math.pow(2,8*i)-1;b(this,e,t,i,r,0)}var o=i-1,a=1;for(this[t+o]=255&e;--o>=0&&(a*=256);)this[t+o]=e/a&255;return t+i},s.prototype.writeUInt8=function(e,t,i){return e=+e,t>>>=0,i||b(this,e,t,1,255,0),this[t]=255&e,t+1},s.prototype.writeUInt16LE=function(e,t,i){return e=+e,t>>>=0,i||b(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},s.prototype.writeUInt16BE=function(e,t,i){return e=+e,t>>>=0,i||b(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},s.prototype.writeUInt32LE=function(e,t,i){return e=+e,t>>>=0,i||b(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},s.prototype.writeUInt32BE=function(e,t,i){return e=+e,t>>>=0,i||b(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},s.prototype.writeIntLE=function(e,t,i,n){if(e=+e,t>>>=0,!n){var r=Math.pow(2,8*i-1);b(this,e,t,i,r-1,-r)}var o=0,a=1,s=0;for(this[t]=255&e;++o<i&&(a*=256);)e<0&&0===s&&0!==this[t+o-1]&&(s=1),this[t+o]=(e/a>>0)-s&255;return t+i},s.prototype.writeIntBE=function(e,t,i,n){if(e=+e,t>>>=0,!n){var r=Math.pow(2,8*i-1);b(this,e,t,i,r-1,-r)}var o=i-1,a=1,s=0;for(this[t+o]=255&e;--o>=0&&(a*=256);)e<0&&0===s&&0!==this[t+o+1]&&(s=1),this[t+o]=(e/a>>0)-s&255;return t+i},s.prototype.writeInt8=function(e,t,i){return e=+e,t>>>=0,i||b(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},s.prototype.writeInt16LE=function(e,t,i){return e=+e,t>>>=0,i||b(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},s.prototype.writeInt16BE=function(e,t,i){return e=+e,t>>>=0,i||b(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},s.prototype.writeInt32LE=function(e,t,i){return e=+e,t>>>=0,i||b(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},s.prototype.writeInt32BE=function(e,t,i){return e=+e,t>>>=0,i||b(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},s.prototype.writeFloatLE=function(e,t,i){return T(this,e,t,!0,i)},s.prototype.writeFloatBE=function(e,t,i){return T(this,e,t,!1,i)},s.prototype.writeDoubleLE=function(e,t,i){return E(this,e,t,!0,i)},s.prototype.writeDoubleBE=function(e,t,i){return E(this,e,t,!1,i)},s.prototype.copy=function(e,t,i,n){if(!s.isBuffer(e))throw TypeError("argument should be a Buffer");if(i||(i=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<i&&(n=i),n===i||0===e.length||0===this.length)return 0;if(t<0)throw RangeError("targetStart out of bounds");if(i<0||i>=this.length)throw RangeError("Index out of range");if(n<0)throw RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-i&&(n=e.length-t+i);var r=n-i;if(this===e&&"function"==typeof Uint8Array.prototype.copyWithin)this.copyWithin(t,i,n);else if(this===e&&i<t&&t<n)for(var o=r-1;o>=0;--o)e[o+t]=this[o+i];else Uint8Array.prototype.set.call(e,this.subarray(i,n),t);return r},s.prototype.fill=function(e,t,i,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,i=this.length):"string"==typeof i&&(n=i,i=this.length),void 0!==n&&"string"!=typeof n)throw TypeError("encoding must be a string");if("string"==typeof n&&!s.isEncoding(n))throw TypeError("Unknown encoding: "+n);if(1===e.length){var r,o=e.charCodeAt(0);("utf8"===n&&o<128||"latin1"===n)&&(e=o)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<i)throw RangeError("Out of range index");if(i<=t)return this;if(t>>>=0,i=void 0===i?this.length:i>>>0,e||(e=0),"number"==typeof e)for(r=t;r<i;++r)this[r]=e;else{var a=s.isBuffer(e)?e:s.from(e,n),l=a.length;if(0===l)throw TypeError('The value "'+e+'" is invalid for argument "value"');for(r=0;r<i-t;++r)this[r+t]=a[r%l]}return this};var x=/[^+/0-9A-Za-z-_]/g;function w(e,t){t=t||1/0;for(var i,n=e.length,r=null,o=[],a=0;a<n;++a){if((i=e.charCodeAt(a))>55295&&i<57344){if(!r){if(i>56319||a+1===n){(t-=3)>-1&&o.push(239,191,189);continue}r=i;continue}if(i<56320){(t-=3)>-1&&o.push(239,191,189),r=i;continue}i=(r-55296<<10|i-56320)+65536}else r&&(t-=3)>-1&&o.push(239,191,189);if(r=null,i<128){if((t-=1)<0)break;o.push(i)}else if(i<2048){if((t-=2)<0)break;o.push(i>>6|192,63&i|128)}else if(i<65536){if((t-=3)<0)break;o.push(i>>12|224,i>>6&63|128,63&i|128)}else if(i<1114112){if((t-=4)<0)break;o.push(i>>18|240,i>>12&63|128,i>>6&63|128,63&i|128)}else throw Error("Invalid code point")}return o}function S(e){for(var t=[],i=0;i<e.length;++i)t.push(255&e.charCodeAt(i));return t}function C(e){return n.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(x,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function A(e,t,i,n){for(var r=0;r<n&&!(r+i>=t.length)&&!(r>=e.length);++r)t[r+i]=e[r];return r}function I(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}var O=function(){for(var e="0123456789abcdef",t=Array(256),i=0;i<16;++i)for(var n=16*i,r=0;r<16;++r)t[n+r]=e[i]+e[r];return t}()},783:function(e,t){/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */t.read=function(e,t,i,n,r){var o,a,s=8*r-n-1,l=(1<<s)-1,c=l>>1,u=-7,h=i?r-1:0,d=i?-1:1,f=e[t+h];for(h+=d,o=f&(1<<-u)-1,f>>=-u,u+=s;u>0;o=256*o+e[t+h],h+=d,u-=8);for(a=o&(1<<-u)-1,o>>=-u,u+=n;u>0;a=256*a+e[t+h],h+=d,u-=8);if(0===o)o=1-c;else{if(o===l)return a?NaN:1/0*(f?-1:1);a+=Math.pow(2,n),o-=c}return(f?-1:1)*a*Math.pow(2,o-n)},t.write=function(e,t,i,n,r,o){var a,s,l,c=8*o-r-1,u=(1<<c)-1,h=u>>1,d=23===r?5960464477539062e-23:0,f=n?0:o-1,p=n?1:-1,m=t<0||0===t&&1/t<0?1:0;for(isNaN(t=Math.abs(t))||t===1/0?(s=isNaN(t)?1:0,a=u):(a=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-a))<1&&(a--,l*=2),a+h>=1?t+=d/l:t+=d*Math.pow(2,1-h),t*l>=2&&(a++,l/=2),a+h>=u?(s=0,a=u):a+h>=1?(s=(t*l-1)*Math.pow(2,r),a+=h):(s=t*Math.pow(2,h-1)*Math.pow(2,r),a=0));r>=8;e[i+f]=255&s,f+=p,s/=256,r-=8);for(a=a<<r|s,c+=r;c>0;e[i+f]=255&a,f+=p,a/=256,c-=8);e[i+f-p]|=128*m}}},i={};function n(e){var r=i[e];if(void 0!==r)return r.exports;var o=i[e]={exports:{}},a=!0;try{t[e](o,o.exports,n),a=!1}finally{a&&delete i[e]}return o.exports}n.ab="//";var r=n(72);e.exports=r}()},2901:function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"AmpStateContext",{enumerable:!0,get:function(){return n}});let n=i(9920)._(i(2265)).default.createContext({})},687:function(e,t){"use strict";function i(e){let{ampFirst:t=!1,hybrid:i=!1,hasQuery:n=!1}=void 0===e?{}:e;return t||i&&n}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"isInAmpMode",{enumerable:!0,get:function(){return i}})},497:function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"getImgProps",{enumerable:!0,get:function(){return s}}),i(2301);let n=i(1564),r=i(7103);function o(e){return void 0!==e.default}function a(e){return void 0===e?e:"number"==typeof e?Number.isFinite(e)?e:NaN:"string"==typeof e&&/^[0-9]+$/.test(e)?parseInt(e,10):NaN}function s(e,t){var i;let s,l,c,{src:u,sizes:h,unoptimized:d=!1,priority:f=!1,loading:p,className:m,quality:_,width:g,height:Z,fill:y=!1,style:b,overrideSrc:v,onLoad:T,onLoadingComplete:E,placeholder:x="empty",blurDataURL:w,fetchPriority:S,layout:C,objectFit:A,objectPosition:I,lazyBoundary:O,lazyRoot:D,...P}=e,{imgConf:R,showAltText:N,blurComplete:L,defaultLoader:M}=t,F=R||r.imageConfigDefault;if("allSizes"in F)s=F;else{let e=[...F.deviceSizes,...F.imageSizes].sort((e,t)=>e-t),t=F.deviceSizes.sort((e,t)=>e-t);s={...F,allSizes:e,deviceSizes:t}}if(void 0===M)throw Error("images.loaderFile detected but the file is missing default export.\nRead more: https://nextjs.org/docs/messages/invalid-images-config");let z=P.loader||M;delete P.loader,delete P.srcSet;let B="__next_img_default"in z;if(B){if("custom"===s.loader)throw Error('Image with src "'+u+'" is missing "loader" prop.\nRead more: https://nextjs.org/docs/messages/next-image-missing-loader')}else{let e=z;z=t=>{let{config:i,...n}=t;return e(n)}}if(C){"fill"===C&&(y=!0);let e={intrinsic:{maxWidth:"100%",height:"auto"},responsive:{width:"100%",height:"auto"}}[C];e&&(b={...b,...e});let t={responsive:"100vw",fill:"100vw"}[C];t&&!h&&(h=t)}let U="",k=a(g),V=a(Z);if("object"==typeof(i=u)&&(o(i)||void 0!==i.src)){let e=o(u)?u.default:u;if(!e.src)throw Error("An object should only be passed to the image component src parameter if it comes from a static image import. It must include src. Received "+JSON.stringify(e));if(!e.height||!e.width)throw Error("An object should only be passed to the image component src parameter if it comes from a static image import. It must include height and width. Received "+JSON.stringify(e));if(l=e.blurWidth,c=e.blurHeight,w=w||e.blurDataURL,U=e.src,!y){if(k||V){if(k&&!V){let t=k/e.width;V=Math.round(e.height*t)}else if(!k&&V){let t=V/e.height;k=Math.round(e.width*t)}}else k=e.width,V=e.height}}let H=!f&&("lazy"===p||void 0===p);(!(u="string"==typeof u?u:U)||u.startsWith("data:")||u.startsWith("blob:"))&&(d=!0,H=!1),s.unoptimized&&(d=!0),B&&u.endsWith(".svg")&&!s.dangerouslyAllowSVG&&(d=!0),f&&(S="high");let G=a(_),j=Object.assign(y?{position:"absolute",height:"100%",width:"100%",left:0,top:0,right:0,bottom:0,objectFit:A,objectPosition:I}:{},N?{}:{color:"transparent"},b),W=L||"empty"===x?null:"blur"===x?'url("data:image/svg+xml;charset=utf-8,'+(0,n.getImageBlurSvg)({widthInt:k,heightInt:V,blurWidth:l,blurHeight:c,blurDataURL:w||"",objectFit:j.objectFit})+'")':'url("'+x+'")',q=W?{backgroundSize:j.objectFit||"cover",backgroundPosition:j.objectPosition||"50% 50%",backgroundRepeat:"no-repeat",backgroundImage:W}:{},Y=function(e){let{config:t,src:i,unoptimized:n,width:r,quality:o,sizes:a,loader:s}=e;if(n)return{src:i,srcSet:void 0,sizes:void 0};let{widths:l,kind:c}=function(e,t,i){let{deviceSizes:n,allSizes:r}=e;if(i){let e=/(^|\s)(1?\d?\d)vw/g,t=[];for(let n;n=e.exec(i);n)t.push(parseInt(n[2]));if(t.length){let e=.01*Math.min(...t);return{widths:r.filter(t=>t>=n[0]*e),kind:"w"}}return{widths:r,kind:"w"}}return"number"!=typeof t?{widths:n,kind:"w"}:{widths:[...new Set([t,2*t].map(e=>r.find(t=>t>=e)||r[r.length-1]))],kind:"x"}}(t,r,a),u=l.length-1;return{sizes:a||"w"!==c?a:"100vw",srcSet:l.map((e,n)=>s({config:t,src:i,quality:o,width:e})+" "+("w"===c?e:n+1)+c).join(", "),src:s({config:t,src:i,quality:o,width:l[u]})}}({config:s,src:u,unoptimized:d,width:k,quality:G,sizes:h,loader:z});return{props:{...P,loading:H?"lazy":p,fetchPriority:S,width:k,height:V,decoding:"async",className:m,style:{...j,...q},sizes:Y.sizes,srcSet:Y.srcSet,src:v||Y.src},meta:{unoptimized:d,priority:f,placeholder:x,fill:y}}}},8321:function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var i in t)Object.defineProperty(e,i,{enumerable:!0,get:t[i]})}(t,{default:function(){return m},defaultHead:function(){return h}});let n=i(9920),r=i(1452),o=i(7437),a=r._(i(2265)),s=n._(i(5960)),l=i(2901),c=i(6590),u=i(687);function h(e){void 0===e&&(e=!1);let t=[(0,o.jsx)("meta",{charSet:"utf-8"})];return e||t.push((0,o.jsx)("meta",{name:"viewport",content:"width=device-width"})),t}function d(e,t){return"string"==typeof t||"number"==typeof t?e:t.type===a.default.Fragment?e.concat(a.default.Children.toArray(t.props.children).reduce((e,t)=>"string"==typeof t||"number"==typeof t?e:e.concat(t),[])):e.concat(t)}i(2301);let f=["name","httpEquiv","charSet","itemProp"];function p(e,t){let{inAmpMode:i}=t;return e.reduce(d,[]).reverse().concat(h(i).reverse()).filter(function(){let e=new Set,t=new Set,i=new Set,n={};return r=>{let o=!0,a=!1;if(r.key&&"number"!=typeof r.key&&r.key.indexOf("$")>0){a=!0;let t=r.key.slice(r.key.indexOf("$")+1);e.has(t)?o=!1:e.add(t)}switch(r.type){case"title":case"base":t.has(r.type)?o=!1:t.add(r.type);break;case"meta":for(let e=0,t=f.length;e<t;e++){let t=f[e];if(r.props.hasOwnProperty(t)){if("charSet"===t)i.has(t)?o=!1:i.add(t);else{let e=r.props[t],i=n[t]||new Set;("name"!==t||!a)&&i.has(e)?o=!1:(i.add(e),n[t]=i)}}}}return o}}()).reverse().map((e,t)=>{let n=e.key||t;if(!i&&"link"===e.type&&e.props.href&&["https://fonts.googleapis.com/css","https://use.typekit.net/"].some(t=>e.props.href.startsWith(t))){let t={...e.props||{}};return t["data-href"]=t.href,t.href=void 0,t["data-optimized-fonts"]=!0,a.default.cloneElement(e,t)}return a.default.cloneElement(e,{key:n})})}let m=function(e){let{children:t}=e,i=(0,a.useContext)(l.AmpStateContext),n=(0,a.useContext)(c.HeadManagerContext);return(0,o.jsx)(s.default,{reduceComponentsToState:p,headManager:n,inAmpMode:(0,u.isInAmpMode)(i),children:t})};("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},1564:function(e,t){"use strict";function i(e){let{widthInt:t,heightInt:i,blurWidth:n,blurHeight:r,blurDataURL:o,objectFit:a}=e,s=n?40*n:t,l=r?40*r:i,c=s&&l?"viewBox='0 0 "+s+" "+l+"'":"";return"%3Csvg xmlns='http://www.w3.org/2000/svg' "+c+"%3E%3Cfilter id='b' color-interpolation-filters='sRGB'%3E%3CfeGaussianBlur stdDeviation='20'/%3E%3CfeColorMatrix values='1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 100 -1' result='s'/%3E%3CfeFlood x='0' y='0' width='100%25' height='100%25'/%3E%3CfeComposite operator='out' in='s'/%3E%3CfeComposite in2='SourceGraphic'/%3E%3CfeGaussianBlur stdDeviation='20'/%3E%3C/filter%3E%3Cimage width='100%25' height='100%25' x='0' y='0' preserveAspectRatio='"+(c?"none":"contain"===a?"xMidYMid":"cover"===a?"xMidYMid slice":"none")+"' style='filter: url(%23b);' href='"+o+"'/%3E%3C/svg%3E"}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"getImageBlurSvg",{enumerable:!0,get:function(){return i}})},3938:function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"ImageConfigContext",{enumerable:!0,get:function(){return o}});let n=i(9920)._(i(2265)),r=i(7103),o=n.default.createContext(r.imageConfigDefault)},7103:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var i in t)Object.defineProperty(e,i,{enumerable:!0,get:t[i]})}(t,{VALID_LOADERS:function(){return i},imageConfigDefault:function(){return n}});let i=["default","imgix","cloudinary","akamai","custom"],n={deviceSizes:[640,750,828,1080,1200,1920,2048,3840],imageSizes:[16,32,48,64,96,128,256,384],path:"/_next/image",loader:"default",loaderFile:"",domains:[],disableStaticImages:!1,minimumCacheTTL:60,formats:["image/webp"],dangerouslyAllowSVG:!1,contentSecurityPolicy:"script-src 'none'; frame-src 'none'; sandbox;",contentDispositionType:"inline",remotePatterns:[],unoptimized:!1}},5601:function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var i in t)Object.defineProperty(e,i,{enumerable:!0,get:t[i]})}(t,{default:function(){return l},getImageProps:function(){return s}});let n=i(9920),r=i(497),o=i(8173),a=n._(i(1241));function s(e){let{props:t}=(0,r.getImgProps)(e,{defaultLoader:a.default,imgConf:{deviceSizes:[640,750,828,1080,1200,1920,2048,3840],imageSizes:[16,32,48,64,96,128,256,384],path:"/_next/image",loader:"default",dangerouslyAllowSVG:!1,unoptimized:!0}});for(let[e,i]of Object.entries(t))void 0===i&&delete t[e];return{props:t}}let l=o.Image},1241:function(e,t){"use strict";function i(e){let{config:t,src:i,width:n,quality:r}=e;return t.path+"?url="+encodeURIComponent(i)+"&w="+n+"&q="+(r||75)}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return n}}),i.__next_img_default=!0;let n=i},291:function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"RouterContext",{enumerable:!0,get:function(){return n}});let n=i(9920)._(i(2265)).default.createContext(null)},5960:function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return s}});let n=i(2265),r="undefined"==typeof window,o=r?()=>{}:n.useLayoutEffect,a=r?()=>{}:n.useEffect;function s(e){let{headManager:t,reduceComponentsToState:i}=e;function s(){if(t&&t.mountedInstances){let r=n.Children.toArray(Array.from(t.mountedInstances).filter(Boolean));t.updateHead(i(r,e))}}if(r){var l;null==t||null==(l=t.mountedInstances)||l.add(e.children),s()}return o(()=>{var i;return null==t||null==(i=t.mountedInstances)||i.add(e.children),()=>{var i;null==t||null==(i=t.mountedInstances)||i.delete(e.children)}}),o(()=>(t&&(t._pendingUpdate=s),()=>{t&&(t._pendingUpdate=s)})),a(()=>(t&&t._pendingUpdate&&(t._pendingUpdate(),t._pendingUpdate=null),()=>{t&&t._pendingUpdate&&(t._pendingUpdate(),t._pendingUpdate=null)})),null}},8511:function(e){var t;t=function(){"use strict";function e(e,t,i){var n=e[t];e[t]=e[i],e[i]=n}function t(e,t){return e<t?-1:e>t?1:0}var i=function(e){void 0===e&&(e=9),this._maxEntries=Math.max(4,e),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function n(e,t){r(e,0,e.children.length,t,e)}function r(e,t,i,n,r){r||(r=d(null)),r.minX=1/0,r.minY=1/0,r.maxX=-1/0,r.maxY=-1/0;for(var a=t;a<i;a++){var s=e.children[a];o(r,e.leaf?n(s):s)}return r}function o(e,t){return e.minX=Math.min(e.minX,t.minX),e.minY=Math.min(e.minY,t.minY),e.maxX=Math.max(e.maxX,t.maxX),e.maxY=Math.max(e.maxY,t.maxY),e}function a(e,t){return e.minX-t.minX}function s(e,t){return e.minY-t.minY}function l(e){return(e.maxX-e.minX)*(e.maxY-e.minY)}function c(e){return e.maxX-e.minX+(e.maxY-e.minY)}function u(e,t){return e.minX<=t.minX&&e.minY<=t.minY&&t.maxX<=e.maxX&&t.maxY<=e.maxY}function h(e,t){return t.minX<=e.maxX&&t.minY<=e.maxY&&t.maxX>=e.minX&&t.maxY>=e.minY}function d(e){return{children:e,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function f(i,n,r,o,a){for(var s=[n,r];s.length;)if(!((r=s.pop())-(n=s.pop())<=o)){var l=n+Math.ceil((r-n)/o/2)*o;(function t(i,n,r,o,a){for(;o>r;){if(o-r>600){var s=o-r+1,l=n-r+1,c=Math.log(s),u=.5*Math.exp(2*c/3),h=.5*Math.sqrt(c*u*(s-u)/s)*(l-s/2<0?-1:1),d=Math.max(r,Math.floor(n-l*u/s+h)),f=Math.min(o,Math.floor(n+(s-l)*u/s+h));t(i,n,d,f,a)}var p=i[n],m=r,_=o;for(e(i,r,n),a(i[o],p)>0&&e(i,r,o);m<_;){for(e(i,m,_),m++,_--;0>a(i[m],p);)m++;for(;a(i[_],p)>0;)_--}0===a(i[r],p)?e(i,r,_):e(i,++_,o),_<=n&&(r=_+1),n<=_&&(o=_-1)}})(i,l,n||0,r||i.length-1,a||t),s.push(n,l,l,r)}}return i.prototype.all=function(){return this._all(this.data,[])},i.prototype.search=function(e){var t=this.data,i=[];if(!h(e,t))return i;for(var n=this.toBBox,r=[];t;){for(var o=0;o<t.children.length;o++){var a=t.children[o],s=t.leaf?n(a):a;h(e,s)&&(t.leaf?i.push(a):u(e,s)?this._all(a,i):r.push(a))}t=r.pop()}return i},i.prototype.collides=function(e){var t=this.data;if(!h(e,t))return!1;for(var i=[];t;){for(var n=0;n<t.children.length;n++){var r=t.children[n],o=t.leaf?this.toBBox(r):r;if(h(e,o)){if(t.leaf||u(e,o))return!0;i.push(r)}}t=i.pop()}return!1},i.prototype.load=function(e){if(!e||!e.length)return this;if(e.length<this._minEntries){for(var t=0;t<e.length;t++)this.insert(e[t]);return this}var i=this._build(e.slice(),0,e.length-1,0);if(this.data.children.length){if(this.data.height===i.height)this._splitRoot(this.data,i);else{if(this.data.height<i.height){var n=this.data;this.data=i,i=n}this._insert(i,this.data.height-i.height-1,!0)}}else this.data=i;return this},i.prototype.insert=function(e){return e&&this._insert(e,this.data.height-1),this},i.prototype.clear=function(){return this.data=d([]),this},i.prototype.remove=function(e,t){if(!e)return this;for(var i,n,r,o=this.data,a=this.toBBox(e),s=[],l=[];o||s.length;){if(o||(o=s.pop(),n=s[s.length-1],i=l.pop(),r=!0),o.leaf){var c=function(e,t,i){if(!i)return t.indexOf(e);for(var n=0;n<t.length;n++)if(i(e,t[n]))return n;return -1}(e,o.children,t);if(-1!==c)return o.children.splice(c,1),s.push(o),this._condense(s),this}r||o.leaf||!u(o,a)?n?(i++,o=n.children[i],r=!1):o=null:(s.push(o),l.push(i),i=0,n=o,o=o.children[0])}return this},i.prototype.toBBox=function(e){return e},i.prototype.compareMinX=function(e,t){return e.minX-t.minX},i.prototype.compareMinY=function(e,t){return e.minY-t.minY},i.prototype.toJSON=function(){return this.data},i.prototype.fromJSON=function(e){return this.data=e,this},i.prototype._all=function(e,t){for(var i=[];e;)e.leaf?t.push.apply(t,e.children):i.push.apply(i,e.children),e=i.pop();return t},i.prototype._build=function(e,t,i,r){var o,a=i-t+1,s=this._maxEntries;if(a<=s)return n(o=d(e.slice(t,i+1)),this.toBBox),o;r||(r=Math.ceil(Math.log(a)/Math.log(s)),s=Math.ceil(a/Math.pow(s,r-1))),(o=d([])).leaf=!1,o.height=r;var l=Math.ceil(a/s),c=l*Math.ceil(Math.sqrt(s));f(e,t,i,c,this.compareMinX);for(var u=t;u<=i;u+=c){var h=Math.min(u+c-1,i);f(e,u,h,l,this.compareMinY);for(var p=u;p<=h;p+=l){var m=Math.min(p+l-1,h);o.children.push(this._build(e,p,m,r-1))}}return n(o,this.toBBox),o},i.prototype._chooseSubtree=function(e,t,i,n){for(;n.push(t),!t.leaf&&n.length-1!==i;){for(var r=1/0,o=1/0,a=void 0,s=0;s<t.children.length;s++){var c=t.children[s],u=l(c),h=(Math.max(c.maxX,e.maxX)-Math.min(c.minX,e.minX))*(Math.max(c.maxY,e.maxY)-Math.min(c.minY,e.minY))-u;h<o?(o=h,r=u<r?u:r,a=c):h===o&&u<r&&(r=u,a=c)}t=a||t.children[0]}return t},i.prototype._insert=function(e,t,i){var n=i?e:this.toBBox(e),r=[],a=this._chooseSubtree(n,this.data,t,r);for(a.children.push(e),o(a,n);t>=0&&r[t].children.length>this._maxEntries;)this._split(r,t),t--;this._adjustParentBBoxes(n,r,t)},i.prototype._split=function(e,t){var i=e[t],r=i.children.length,o=this._minEntries;this._chooseSplitAxis(i,o,r);var a=this._chooseSplitIndex(i,o,r),s=d(i.children.splice(a,i.children.length-a));s.height=i.height,s.leaf=i.leaf,n(i,this.toBBox),n(s,this.toBBox),t?e[t-1].children.push(s):this._splitRoot(i,s)},i.prototype._splitRoot=function(e,t){this.data=d([e,t]),this.data.height=e.height+1,this.data.leaf=!1,n(this.data,this.toBBox)},i.prototype._chooseSplitIndex=function(e,t,i){for(var n,o,a,s,c=1/0,u=1/0,h=t;h<=i-t;h++){var d=r(e,0,h,this.toBBox),f=r(e,h,i,this.toBBox),p=(o=void 0,a=void 0,o=Math.max(d.minX,f.minX),a=Math.max(d.minY,f.minY),Math.max(0,Math.min(d.maxX,f.maxX)-o)*Math.max(0,Math.min(d.maxY,f.maxY)-a)),m=l(d)+l(f);p<c?(c=p,n=h,u=m<u?m:u):p===c&&m<u&&(u=m,n=h)}return n||i-t},i.prototype._chooseSplitAxis=function(e,t,i){var n=e.leaf?this.compareMinX:a,r=e.leaf?this.compareMinY:s;this._allDistMargin(e,t,i,n)<this._allDistMargin(e,t,i,r)&&e.children.sort(n)},i.prototype._allDistMargin=function(e,t,i,n){e.children.sort(n);for(var a=this.toBBox,s=r(e,0,t,a),l=r(e,i-t,i,a),u=c(s)+c(l),h=t;h<i-t;h++){var d=e.children[h];o(s,e.leaf?a(d):d),u+=c(s)}for(var f=i-t-1;f>=t;f--){var p=e.children[f];o(l,e.leaf?a(p):p),u+=c(l)}return u},i.prototype._adjustParentBBoxes=function(e,t,i){for(var n=i;n>=0;n--)o(t[n],e)},i.prototype._condense=function(e){for(var t=e.length-1,i=void 0;t>=0;t--)0===e[t].children.length?t>0?(i=e[t-1].children).splice(i.indexOf(e[t]),1):this.clear():n(e[t],this.toBBox)},i},e.exports=t()},2809:function(e,t,i){"use strict";i.d(t,{YX:function(){return m},ZP:function(){return p}});/*! * satellite-js v5.0.0 * (c) 2013 Shashwat Kandadai and UCSC * https://github.com/shashwatak/satellite-js * License: MIT */var n=Math.PI,r=2*n,o=n/180,a=60/Math.sqrt(650942.9922085947),s=6378.135*a/60,l=1/a,c=2/3;function u(e,t,i,n,r,o){var a=arguments.length>6&&void 0!==arguments[6]?arguments[6]:0;return 367*e-Math.floor(7*(e+Math.floor((t+9)/12))*.25)+Math.floor(275*t/9)+i+1721013.5+((a/6e4+o/60+r)/60+n)/24}function h(e,t,i,n,r,o,a){return e instanceof Date?u(e.getUTCFullYear(),e.getUTCMonth()+1,e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds()):u(e,t,i,n,r,o,a)}function d(e,t){var i,o,a,s,l,c,u,h,d,f,p,m,_,g,Z,y,b,v,T,E,x=e.e3,w=e.ee2,S=e.peo,C=e.pgho,A=e.pho,I=e.pinco,O=e.plo,D=e.se2,P=e.se3,R=e.sgh2,N=e.sgh3,L=e.sgh4,M=e.sh2,F=e.sh3,z=e.si2,B=e.si3,U=e.sl2,k=e.sl3,V=e.sl4,H=e.t,G=e.xgh2,j=e.xgh3,W=e.xgh4,q=e.xh2,Y=e.xh3,X=e.xi2,$=e.xi3,K=e.xl2,Q=e.xl3,J=e.xl4,ee=e.zmol,et=e.zmos,ei=t.init,en=t.opsmode,er=t.ep,eo=t.inclp,ea=t.nodep,es=t.argpp,el=t.mp;E=et+119459e-10*H,"y"===ei&&(E=et);var ec=D*(d=.5*(y=Math.sin(T=E+.0335*Math.sin(E)))*y-.25)+P*(f=-.5*y*Math.cos(T)),eu=z*d+B*f,eh=U*d+k*f+V*y,ed=R*d+N*f+L*y,ef=M*d+F*f;E=ee+15835218e-11*H,"y"===ei&&(E=ee);var ep=w*(d=.5*(y=Math.sin(T=E+.1098*Math.sin(E)))*y-.25)+x*(f=-.5*y*Math.cos(T)),em=X*d+$*f,e_=K*d+Q*f+J*y,eg=G*d+j*f+W*y,eZ=q*d+Y*f;return p=ec+ep,g=eu+em,Z=eh+e_,m=ed+eg,_=ef+eZ,"n"===ei&&(p-=S,g-=I,Z-=O,m-=C,_-=A,eo+=g,er+=p,s=Math.sin(eo),a=Math.cos(eo),eo>=.2?(_/=s,m-=a*_,es+=m,ea+=_,el+=Z):(c=Math.sin(ea),l=Math.cos(ea),i=s*c,o=s*l,u=_*l+g*a*c,h=-_*c+g*a*l,i+=u,o+=h,(ea%=r)<0&&"a"===en&&(ea+=r),b=el+es+a*ea+(Z+m-g*ea*s),v=ea,(ea=Math.atan2(i,o))<0&&"a"===en&&(ea+=r),Math.abs(v-ea)>n&&(ea<v?ea+=r:ea-=r),el+=Z,es=b-el-a*ea)),{ep:er,inclp:eo,nodep:ea,argpp:es,mp:el}}function f(e){var t=(e-2451545)/36525,i=-.0000062*t*t*t+.093104*t*t+3164400184.812866*t+67310.54841;return(i=i*o/240%r)<0&&(i+=r),i}function p(e,t){e.t=t,e.error=0;var i,o,l,u,h,f,p,m,_,g,Z,y,b,v,T,E,x,w,S,C,A,I,O,D,P,R,N=e.mo+e.mdot*e.t,L=e.argpo+e.argpdot*e.t,M=e.nodeo+e.nodedot*e.t;m=L,C=N;var F=e.t*e.t;if(I=M+e.nodecf*F,E=1-e.cc1*e.t,x=e.bstar*e.cc4*e.t,w=e.t2cof*F,1!==e.isimp){f=e.omgcof*e.t;var z=1+e.eta*Math.cos(N);C=N+(T=f+e.xmcof*(z*z*z-e.delmo)),m=L-T,y=(Z=F*e.t)*e.t,E=E-e.d2*F-e.d3*Z-e.d4*y,x+=e.bstar*e.cc5*(Math.sin(C)-e.sinmao),w=w+e.t3cof*Z+y*(e.t4cof+e.t*e.t5cof)}A=e.no;var B=e.ecco;if(S=e.inclo,"d"===e.method){b=e.t;var U=function(e){var t,i,n,o,a,s,l,c,u=e.irez,h=e.d2201,d=e.d2211,f=e.d3210,p=e.d3222,m=e.d4410,_=e.d4422,g=e.d5220,Z=e.d5232,y=e.d5421,b=e.d5433,v=e.dedt,T=e.del1,E=e.del2,x=e.del3,w=e.didt,S=e.dmdt,C=e.dnodt,A=e.domdt,I=e.argpo,O=e.argpdot,D=e.t,P=e.tc,R=e.gsto,N=e.xfact,L=e.xlamo,M=e.no,F=e.atime,z=e.em,B=e.argpm,U=e.inclm,k=e.xli,V=e.mm,H=e.xni,G=e.nodem,j=e.nm,W=0,q=0,Y=(R+.0043752690880113*P)%r;if(z+=v*D,U+=w*D,B+=A*D,G+=C*D,V+=S*D,0!==u){(0===F||D*F<=0||Math.abs(D)<Math.abs(F))&&(F=0,H=M,k=L),t=D>0?720:-720;for(var X=381;381===X;)2!==u?(l=T*Math.sin(k-.13130908)+E*Math.sin(2*(k-2.8843198))+x*Math.sin(3*(k-.37448087)),s=(T*Math.cos(k-.13130908)+2*E*Math.cos(2*(k-2.8843198))+3*x*Math.cos(3*(k-.37448087)))*(a=H+N)):(n=(c=I+O*F)+c,i=k+k,l=h*Math.sin(n+k-5.7686396)+d*Math.sin(k-5.7686396)+f*Math.sin(c+k-.95240898)+p*Math.sin(-c+k-.95240898)+m*Math.sin(n+i-1.8014998)+_*Math.sin(i-1.8014998)+g*Math.sin(c+k-1.050833)+Z*Math.sin(-c+k-1.050833)+y*Math.sin(c+i-4.4108898)+b*Math.sin(-c+i-4.4108898),s=(h*Math.cos(n+k-5.7686396)+d*Math.cos(k-5.7686396)+f*Math.cos(c+k-.95240898)+p*Math.cos(-c+k-.95240898)+g*Math.cos(c+k-1.050833)+Z*Math.cos(-c+k-1.050833)+2*(m*Math.cos(n+i-1.8014998)+_*Math.cos(i-1.8014998)+y*Math.cos(c+i-4.4108898)+b*Math.cos(-c+i-4.4108898)))*(a=H+N)),Math.abs(D-F)>=720?X=381:(q=D-F,X=0),381===X&&(k+=a*t+259200*l,H+=l*t+259200*s,F+=t);j=H+l*q+s*q*q*.5,o=k+a*q+l*q*q*.5,V=1!==u?o-2*G+2*Y:o-G-B+Y,W=j-M,j=M+W}return{atime:F,em:z,argpm:B,inclm:U,xli:k,mm:V,xni:H,nodem:G,dndt:W,nm:j}}({irez:e.irez,d2201:e.d2201,d2211:e.d2211,d3210:e.d3210,d3222:e.d3222,d4410:e.d4410,d4422:e.d4422,d5220:e.d5220,d5232:e.d5232,d5421:e.d5421,d5433:e.d5433,dedt:e.dedt,del1:e.del1,del2:e.del2,del3:e.del3,didt:e.didt,dmdt:e.dmdt,dnodt:e.dnodt,domdt:e.domdt,argpo:e.argpo,argpdot:e.argpdot,t:e.t,tc:b,gsto:e.gsto,xfact:e.xfact,xlamo:e.xlamo,no:e.no,atime:e.atime,em:B,argpm:m,inclm:S,xli:e.xli,mm:C,xni:e.xni,nodem:I,nm:A});B=U.em,m=U.argpm,S=U.inclm,C=U.mm,I=U.nodem,A=U.nm}if(A<=0)return e.error=2,[!1,!1];var k=Math.pow(a/A,c)*E*E;if(A=a/Math.pow(k,1.5),(B-=x)>=1||B<-.001)return e.error=1,[!1,!1];B<1e-6&&(B=1e-6),C+=e.no*w,D=C+m+I,I%=r,m%=r,D%=r,C=(D-m-I)%r;var V=Math.sin(S),H=Math.cos(S),G=B;if(O=S,_=m,R=I,P=C,u=V,l=H,"d"===e.method){var j={inclo:e.inclo,init:"n",ep:G,inclp:O,nodep:R,argpp:_,mp:P,opsmode:e.operationmode},W=d(e,j);if(G=W.ep,R=W.nodep,_=W.argpp,P=W.mp,(O=W.inclp)<0&&(O=-O,R+=n,_-=n),G<0||G>1)return e.error=3,[!1,!1]}"d"===e.method&&(u=Math.sin(O),l=Math.cos(O),e.aycof=.001172534860005764*u,Math.abs(l+1)>15e-13?e.xlcof=586267430002882e-18*u*(3+5*l)/(1+l):e.xlcof=586267430002882e-18*u*(3+5*l)/15e-13);var q=G*Math.cos(_);T=1/(k*(1-G*G));var Y=G*Math.sin(_)+T*e.aycof,X=(P+_+R+T*e.xlcof*q-R)%r;p=X,v=9999.9;for(var $=1;Math.abs(v)>=1e-12&&$<=10;)o=Math.sin(p),v=1-(i=Math.cos(p))*q-o*Y,Math.abs(v=(X-Y*i+q*o-p)/v)>=.95&&(v=v>0?.95:-.95),p+=v,$+=1;var K=q*i+Y*o,Q=q*o-Y*i,J=q*q+Y*Y,ee=k*(1-J);if(ee<0)return e.error=4,[!1,!1];var et=k*(1-K),ei=Math.sqrt(1-J),en=k/et*(o-Y-q*(T=Q/(1+ei))),er=k/et*(i-q+Y*T);g=Math.atan2(en,er);var eo=(er+er)*en,ea=1-2*en*en,es=541308e-9*(T=1/ee),el=es*T;"d"===e.method&&(h=l*l,e.con41=3*h-1,e.x1mth2=1-h,e.x7thm1=7*h-1);var ec=et*(1-1.5*el*ei*e.con41)+.5*es*e.x1mth2*ea;if(ec<1)return e.error=6,{position:!1,velocity:!1};g-=.25*el*e.x7thm1*eo;var eu=R+1.5*el*l*eo,eh=O+1.5*el*l*u*ea,ed=Math.sqrt(k)*Q/et-A*es*e.x1mth2*eo/a,ef=Math.sqrt(ee)/et+A*es*(e.x1mth2*ea+1.5*e.con41)/a,ep=Math.sin(g),em=Math.cos(g),e_=Math.sin(eu),eg=Math.cos(eu),eZ=Math.sin(eh),ey=Math.cos(eh),eb=-e_*ey,ev=eg*ey,eT=eb*ep+eg*em,eE=ev*ep+e_*em,ex=eZ*ep;return{position:{x:ec*eT*6378.135,y:ec*eE*6378.135,z:ec*ex*6378.135},velocity:{x:(ed*eT+ef*(eb*em-eg*ep))*s,y:(ed*eE+ef*(ev*em-e_*ep))*s,z:(ed*ex+eZ*em*ef)*s}}}function m(e,t){var i=0,s={};s.error=0,s.satnum=e.substring(2,7),s.epochyr=parseInt(e.substring(18,20),10),s.epochdays=parseFloat(e.substring(20,32)),s.ndot=parseFloat(e.substring(33,43)),s.nddot=parseFloat(".".concat(parseInt(e.substring(44,50),10),"E").concat(e.substring(50,52))),s.bstar=parseFloat("".concat(e.substring(53,54),".").concat(parseInt(e.substring(54,59),10),"E").concat(e.substring(59,61))),s.inclo=parseFloat(t.substring(8,16)),s.nodeo=parseFloat(t.substring(17,25)),s.ecco=parseFloat(".".concat(t.substring(26,33))),s.argpo=parseFloat(t.substring(34,42)),s.mo=parseFloat(t.substring(43,51)),s.no=parseFloat(t.substring(52,63)),s.no/=1440/(2*n),s.inclo*=o,s.nodeo*=o,s.argpo*=o,s.mo*=o;var u=function(e,t){for(var i=[31,e%4==0?29:28,31,30,31,30,31,31,30,31,30,31],n=Math.floor(t),r=1,o=0;n>o+i[r-1]&&r<12;)o+=i[r-1],r+=1;var a=r,s=n-o,l=(t-n)*24,c=Math.floor(l),u=Math.floor(l=(l-c)*60),h=(l-u)*60;return{mon:a,day:s,hr:c,minute:u,sec:h}}(i=s.epochyr<57?s.epochyr+2e3:s.epochyr+1900,s.epochdays),m=u.mon,_=u.day,g=u.hr,Z=u.minute,y=u.sec;return s.jdsatepoch=h(i,m,_,g,Z,y),!function(e,t){var i,o,s,u,m,_,g,Z,y,b,v,T,E,x,w,S,C,A,I,O,D,P,R,N,L,M,F,z,B,U,k,V,H,G,j,W,q,Y,X,$,K,Q,J,ee,et,ei,en,er,eo,ea,es,el,ec=t.opsmode,eu=t.satn,eh=t.epoch,ed=t.xbstar,ef=t.xecco,ep=t.xargpo,em=t.xinclo,e_=t.xmo,eg=t.xno,eZ=t.xnodeo;e.isimp=0,e.method="n",e.aycof=0,e.con41=0,e.cc1=0,e.cc4=0,e.cc5=0,e.d2=0,e.d3=0,e.d4=0,e.delmo=0,e.eta=0,e.argpdot=0,e.omgcof=0,e.sinmao=0,e.t=0,e.t2cof=0,e.t3cof=0,e.t4cof=0,e.t5cof=0,e.x1mth2=0,e.x7thm1=0,e.mdot=0,e.nodedot=0,e.xlcof=0,e.xmcof=0,e.nodecf=0,e.irez=0,e.d2201=0,e.d2211=0,e.d3210=0,e.d3222=0,e.d4410=0,e.d4422=0,e.d5220=0,e.d5232=0,e.d5421=0,e.d5433=0,e.dedt=0,e.del1=0,e.del2=0,e.del3=0,e.didt=0,e.dmdt=0,e.dnodt=0,e.domdt=0,e.e3=0,e.ee2=0,e.peo=0,e.pgho=0,e.pho=0,e.pinco=0,e.plo=0,e.se2=0,e.se3=0,e.sgh2=0,e.sgh3=0,e.sgh4=0,e.sh2=0,e.sh3=0,e.si2=0,e.si3=0,e.sl2=0,e.sl3=0,e.sl4=0,e.gsto=0,e.xfact=0,e.xgh2=0,e.xgh3=0,e.xgh4=0,e.xh2=0,e.xh3=0,e.xi2=0,e.xi3=0,e.xl2=0,e.xl3=0,e.xl4=0,e.xlamo=0,e.zmol=0,e.zmos=0,e.atime=0,e.xli=0,e.xni=0,e.bstar=ed,e.ecco=ef,e.argpo=ep,e.inclo=em,e.mo=e_,e.no=eg,e.nodeo=eZ,e.operationmode=ec,e.init="y",e.t=0;var ey=function(e){var t,i=e.ecco,n=e.epoch,o=e.inclo,s=e.opsmode,l=e.no,u=i*i,d=1-u,p=Math.sqrt(d),m=Math.cos(o),_=m*m,g=Math.pow(a/l,c),Z=8119620000000001e-19*(3*_-1)/(p*d),y=Z/(g*g),b=g*(1-y*y-y*(1/3+134*y*y/81)),v=Math.pow(a/(l/=1+(y=Z/(b*b))),c),T=v*d,E=1-5*_;if("a"===s){var x=n-7305,w=Math.floor(x+1e-8);(t=(1.7321343856509375+.017202791694070362*w+(.017202791694070362+r)*(x-w)+x*x*5075514194322695e-30)%r)<0&&(t+=r)}else t=function(){return(arguments.length<=0?void 0:arguments[0])instanceof Date||arguments.length>1?f(h.apply(void 0,arguments)):f.apply(void 0,arguments)}(n+2433281.5);return{no:l,method:"n",ainv:1/v,ao:v,con41:-E-_-_,con42:E,cosio:m,cosio2:_,eccsq:u,omeosq:d,posq:T*T,rp:v*(1-i),rteosq:p,sinio:Math.sin(o),gsto:t}}({satn:eu,ecco:e.ecco,epoch:eh,inclo:e.inclo,no:e.no,method:e.method,opsmode:e.operationmode}),eb=ey.ao,ev=ey.con42,eT=ey.cosio,eE=ey.cosio2,ex=ey.eccsq,ew=ey.omeosq,eS=ey.posq,eC=ey.rp,eA=ey.rteosq,eI=ey.sinio;if(e.no=ey.no,e.con41=ey.con41,e.gsto=ey.gsto,e.a=Math.pow(e.no*l,-2/3),e.alta=e.a*(1+e.ecco)-1,e.altp=e.a*(1-e.ecco)-1,e.error=0,ew>=0||e.no>=0){if(e.isimp=0,eC<1.034492841559484&&(e.isimp=1),N=1.0122292801892716,A=1880279159015271e-24,(w=(eC-1)*6378.135)<156){N=w-78,w<98&&(N=20);var eO=(120-N)/6378.135;A=eO*eO*eO*eO,N=N/6378.135+1}S=1/eS,Q=1/(eb-N),e.eta=eb*e.ecco*Q,T=e.eta*e.eta,v=e.ecco*e.eta,C=Math.abs(1-T),u=(g=(_=A*Math.pow(Q,4))/Math.pow(C,3.5))*e.no*(eb*(1+1.5*T+v*(4+T))+40598100000000003e-20*Q/C*e.con41*(8+3*T*(8+T))),e.cc1=e.bstar*u,m=0,e.ecco>1e-4&&(m=-(-2*_*Q*.002345069720011528)*e.no*eI/e.ecco),e.x1mth2=1-eE,e.cc4=2*e.no*g*eb*ew*(e.eta*(2+.5*T)+e.ecco*(.5+2*T)-.001082616*Q/(eb*C)*(-3*e.con41*(1-2*v+T*(1.5-.5*v))+.75*e.x1mth2*(2*T-v*(1+T))*Math.cos(2*e.argpo))),e.cc5=2*g*eb*ew*(1+2.75*(T+v)+v*T),Z=eE*eE,$=.5*(X=.0016239240000000001*S*e.no)*.001082616*S,K=7762359375e-16*S*S*e.no,e.mdot=e.no+.5*X*eA*e.con41+.0625*$*eA*(13-78*eE+137*Z),e.argpdot=-.5*X*ev+.0625*$*(7-114*eE+395*Z)+K*(3-36*eE+49*Z),ee=-X*eT,e.nodedot=ee+(.5*$*(4-19*eE)+2*K*(3-7*eE))*eT,J=e.argpdot+e.nodedot,e.omgcof=e.bstar*m*Math.cos(e.argpo),e.xmcof=0,e.ecco>1e-4&&(e.xmcof=-c*_*e.bstar/v),e.nodecf=3.5*ew*ee*e.cc1,e.t2cof=1.5*e.cc1,Math.abs(eT+1)>15e-13?e.xlcof=586267430002882e-18*eI*(3+5*eT)/(1+eT):e.xlcof=586267430002882e-18*eI*(3+5*eT)/15e-13,e.aycof=.001172534860005764*eI;var eD=1+e.eta*Math.cos(e.mo);if(e.delmo=eD*eD*eD,e.sinmao=Math.sin(e.mo),e.x7thm1=7*eE-1,2*n/e.no>=225){e.method="d",e.isimp=1,E=e.inclo;var eP=function(e){var t,i,n,o,a,s,l,c,u,h,d,f,p,m,_,g,Z,y,b,v,T,E,x,w,S,C,A,I,O,D,P,R,N,L,M,F,z,B,U,k,V,H,G,j,W,q,Y,X,$,K,Q,J,ee,et,ei,en,er,eo,ea,es,el,ec,eu,eh=e.epoch,ed=e.ep,ef=e.argpp,ep=e.tc,em=e.inclp,e_=e.nodep,eg=e.np,eZ=Math.sin(e_),ey=Math.cos(e_),eb=Math.sin(ef),ev=Math.cos(ef),eT=Math.sin(em),eE=Math.cos(em),ex=ed*ed,ew=1-ex,eS=Math.sqrt(ew),eC=eh+18261.5+ep/1440,eA=(4.523602-92422029e-11*eC)%r,eI=Math.sin(eA),eO=Math.cos(eA),eD=.91375164-.03568096*eO,eP=Math.sqrt(1-eD*eD),eR=.089683511*eI/eP,eN=Math.sqrt(1-eR*eR),eL=5.8351514+.001944368*eC,eM=.39785416*eI/eP,eF=Math.cos(eM=Math.atan2(eM,eN*eO+.91744867*eR*eI)+(eL-eA)),ez=Math.sin(eM);v=.1945905,T=-.98088458,w=.91744867,S=.39785416,E=ey,x=eZ,d=29864797e-13;for(var eB=1/eg,eU=0;eU<2;)eU+=1,t=v*E+T*w*x,n=-T*E+v*w*x,l=-v*x+T*w*E,c=T*S,u=T*x+v*w*E,h=v*S,i=eE*l+eT*c,o=eE*u+eT*h,a=-eT*l+eE*c,s=-eT*u+eE*h,f=t*ev+i*eb,p=n*ev+o*eb,m=-t*eb+i*ev,_=-n*eb+o*ev,g=a*eb,Z=s*eb,y=a*ev,b=s*ev,el=12*f*f-3*m*m,ec=24*f*p-6*m*_,eu=12*p*p-3*_*_,J=3*(t*t+i*i)+el*ex,ee=6*(t*n+i*o)+ec*ex,et=3*(n*n+o*o)+eu*ex,ei=-6*t*a+ex*(-24*f*y-6*m*g),en=-6*(t*s+n*a)+ex*(-24*(p*y+f*b)+-6*(m*Z+_*g)),er=-6*n*s+ex*(-24*p*b-6*_*Z),eo=6*i*a+ex*(24*f*g-6*m*y),ea=6*(o*a+i*s)+ex*(24*(p*g+f*Z)-6*(_*y+m*b)),es=6*o*s+ex*(24*p*Z-6*_*b),J=J+J+ew*el,ee=ee+ee+ew*ec,et=et+et+ew*eu,q=-.5*(Y=d*eB)/eS,W=-15*ed*(X=Y*eS),$=f*m+p*_,K=p*m+f*_,Q=p*_-f*m,1===eU&&(C=W,A=q,I=Y,O=X,D=$,P=K,R=Q,N=J,L=ee,M=et,F=ei,z=en,B=er,U=eo,k=ea,V=es,H=el,G=ec,j=eu,v=eF,T=ez,w=eD,S=eP,E=eN*ey+eR*eZ,x=eZ*eN-ey*eR,d=47968065e-14);var ek=2*A*z,eV=2*A*(B-F),eH=-2*I*L,eG=-2*I*(M-N),ej=-2*I*(-21-9*ex)*.01675,eW=2*W*K,eq=2*q*en,eY=2*q*(er-ei),eX=-2*Y*ee,e$=-2*Y*(et-J),eK=-2*Y*(-21-9*ex)*.0549,eQ=2*X*ec,eJ=2*X*(eu-el),e0=-18*X*.0549,e1=-2*q*ea,e2=-2*q*(es-eo);return{snodm:eZ,cnodm:ey,sinim:eT,cosim:eE,sinomm:eb,cosomm:ev,day:eC,e3:2*W*Q,ee2:eW,em:ed,emsq:ex,gam:eL,peo:0,pgho:0,pho:0,pinco:0,plo:0,rtemsq:eS,se2:2*C*P,se3:2*C*R,sgh2:2*O*G,sgh3:2*O*(j-H),sgh4:-18*O*.01675,sh2:-2*A*k,sh3:-2*A*(V-U),si2:ek,si3:eV,sl2:eH,sl3:eG,sl4:ej,s1:W,s2:q,s3:Y,s4:X,s5:$,s6:K,s7:Q,ss1:C,ss2:A,ss3:I,ss4:O,ss5:D,ss6:P,ss7:R,sz1:N,sz2:L,sz3:M,sz11:F,sz12:z,sz13:B,sz21:U,sz22:k,sz23:V,sz31:H,sz32:G,sz33:j,xgh2:eQ,xgh3:eJ,xgh4:e0,xh2:e1,xh3:e2,xi2:eq,xi3:eY,xl2:eX,xl3:e$,xl4:eK,nm:eg,z1:J,z2:ee,z3:et,z11:ei,z12:en,z13:er,z21:eo,z22:ea,z23:es,z31:el,z32:ec,z33:eu,zmol:(4.7199672+(.2299715*eC-eL))%r,zmos:(6.2565837+.017201977*eC)%r}}({epoch:eh,ep:e.ecco,argpp:e.argpo,tc:0,inclp:e.inclo,nodep:e.nodeo,np:e.no,e3:e.e3,ee2:e.ee2,peo:e.peo,pgho:e.pgho,pho:e.pho,pinco:e.pinco,plo:e.plo,se2:e.se2,se3:e.se3,sgh2:e.sgh2,sgh3:e.sgh3,sgh4:e.sgh4,sh2:e.sh2,sh3:e.sh3,si2:e.si2,si3:e.si3,sl2:e.sl2,sl3:e.sl3,sl4:e.sl4,xgh2:e.xgh2,xgh3:e.xgh3,xgh4:e.xgh4,xh2:e.xh2,xh3:e.xh3,xi2:e.xi2,xi3:e.xi3,xl2:e.xl2,xl3:e.xl3,xl4:e.xl4,zmol:e.zmol,zmos:e.zmos});e.e3=eP.e3,e.ee2=eP.ee2,e.peo=eP.peo,e.pgho=eP.pgho,e.pho=eP.pho,e.pinco=eP.pinco,e.plo=eP.plo,e.se2=eP.se2,e.se3=eP.se3,e.sgh2=eP.sgh2,e.sgh3=eP.sgh3,e.sgh4=eP.sgh4,e.sh2=eP.sh2,e.sh3=eP.sh3,e.si2=eP.si2,e.si3=eP.si3,e.sl2=eP.sl2,e.sl3=eP.sl3,e.sl4=eP.sl4,o=eP.sinim,i=eP.cosim,y=eP.em,b=eP.emsq,I=eP.s1,O=eP.s2,D=eP.s3,P=eP.s4,R=eP.s5,L=eP.ss1,M=eP.ss2,F=eP.ss3,z=eP.ss4,B=eP.ss5,U=eP.sz1,k=eP.sz3,V=eP.sz11,H=eP.sz13,G=eP.sz21,j=eP.sz23,W=eP.sz31,q=eP.sz33,e.xgh2=eP.xgh2,e.xgh3=eP.xgh3,e.xgh4=eP.xgh4,e.xh2=eP.xh2,e.xh3=eP.xh3,e.xi2=eP.xi2,e.xi3=eP.xi3,e.xl2=eP.xl2,e.xl3=eP.xl3,e.xl4=eP.xl4,e.zmol=eP.zmol,e.zmos=eP.zmos,x=eP.nm,et=eP.z1,ei=eP.z3,en=eP.z11,er=eP.z13,eo=eP.z21,ea=eP.z23,es=eP.z31,el=eP.z33;var eR={inclo:E,init:e.init,ep:e.ecco,inclp:e.inclo,nodep:e.nodeo,argpp:e.argpo,mp:e.mo,opsmode:e.operationmode},eN=d(e,eR);e.ecco=eN.ep,e.inclo=eN.inclp,e.nodeo=eN.nodep,e.argpo=eN.argpp,e.mo=eN.mp;var eL=function(e){var t,i,o,s,l,u,h,d,f,p,m,_,g,Z,y,b,v,T,E,x,w,S,C,A,I,O,D,P,R,N,L=e.cosim,M=e.argpo,F=e.s1,z=e.s2,B=e.s3,U=e.s4,k=e.s5,V=e.sinim,H=e.ss1,G=e.ss2,j=e.ss3,W=e.ss4,q=e.ss5,Y=e.sz1,X=e.sz3,$=e.sz11,K=e.sz13,Q=e.sz21,J=e.sz23,ee=e.sz31,et=e.sz33,ei=e.t,en=e.tc,er=e.gsto,eo=e.mo,ea=e.mdot,es=e.no,el=e.nodeo,ec=e.nodedot,eu=e.xpidot,eh=e.z1,ed=e.z3,ef=e.z11,ep=e.z13,em=e.z21,e_=e.z23,eg=e.z31,eZ=e.z33,ey=e.ecco,eb=e.eccsq,ev=e.emsq,eT=e.em,eE=e.argpm,ex=e.inclm,ew=e.mm,eS=e.nm,eC=e.nodem,eA=e.irez,eI=e.atime,eO=e.d2201,eD=e.d2211,eP=e.d3210,eR=e.d3222,eN=e.d4410,eL=e.d4422,eM=e.d5220,eF=e.d5232,ez=e.d5421,eB=e.d5433,eU=e.dedt,ek=e.didt,eV=e.dmdt,eH=e.dnodt,eG=e.domdt,ej=e.del1,eW=e.del2,eq=e.del3,eY=e.xfact,eX=e.xlamo,e$=e.xli,eK=e.xni;eA=0,eS<.0052359877&&eS>.0034906585&&(eA=1),eS>=.00826&&eS<=.00924&&eT>=.5&&(eA=2);var eQ=-.0000119459*j*(Y+X-14-6*ev),eJ=-.0000119459*G*(Q+J);(ex<.052359877||ex>n-.052359877)&&(eJ=0),0!==V&&(eJ/=V);var e0=119459e-10*W*(ee+et-6)-L*eJ;eU=119459e-10*H*q+15835218e-11*F*k,ek=119459e-10*G*($+K)+15835218e-11*z*(ef+ep),eV=eQ-15835218e-11*B*(eh+ed-14-6*ev);var e1=-.00015835218*z*(em+e_);(ex<.052359877||ex>n-.052359877)&&(e1=0),eG=e0+15835218e-11*U*(eg+eZ-6),eH=eJ,0!==V&&(eG-=L/V*e1,eH+=e1/V);var e2=(er+.0043752690880113*en)%r;if(eT+=eU*ei,ex+=ek*ei,eE+=eG*ei,eC+=eH*ei,ew+=eV*ei,0!==eA){if(P=Math.pow(eS/a,c),2===eA){R=L*L;var e3=eT,e4=ev;N=(eT=ey)*(ev=eb),Z=-.306-(eT-.64)*.44,eT<=.65?(y=3.616-13.247*eT+16.29*ev,v=-19.302+117.39*eT-228.419*ev+156.591*N,T=-18.9068+109.7927*eT-214.6334*ev+146.5816*N,E=-41.122+242.694*eT-471.094*ev+313.953*N,x=-146.407+841.88*eT-1629.014*ev+1083.435*N,w=-532.114+3017.977*eT-5740.032*ev+3708.276*N):(y=-72.099+331.819*eT-508.738*ev+266.724*N,v=-346.844+1582.851*eT-2415.925*ev+1246.113*N,T=-342.585+1554.908*eT-2366.899*ev+1215.972*N,E=-1052.797+4758.686*eT-7193.992*ev+3651.957*N,x=-3581.69+16178.11*eT-24462.77*ev+12422.52*N,w=eT>.715?-5149.66+29936.92*eT-54087.36*ev+31324.56*N:1464.74-4664.75*eT+3763.64*ev),eT<.7?(A=-919.2277+4988.61*eT-9064.77*ev+5542.21*N,S=-822.71072+4568.6173*eT-8491.4146*ev+5337.524*N,C=-853.666+4690.25*eT-8624.77*ev+5341.4*N):(A=-37995.78+161616.52*eT-229838.2*ev+109377.94*N,S=-51752.104+218913.95*eT-309468.16*ev+146349.42*N,C=-40023.88+170470.89*eT-242699.48*ev+115605.82*N),I=V*V,t=.75*(1+2*L+R),i=1.5*I,s=1.875*V*(1-2*L-3*R),l=-1.875*V*(1+2*L-3*R),h=35*I*t,d=39.375*I*I,f=9.84375*V*(I*(1-2*L-5*R)+.33333333*(-2+4*L+6*R)),p=V*(4.92187512*I*(-2-4*L+10*R)+6.56250012*(1+2*L-3*R)),m=29.53125*V*(2-8*L+R*(-12+8*L+10*R)),_=29.53125*V*(-2-8*L+R*(12+8*L-10*R)),eO=(O=17891679e-13*(D=eS*eS*3*(P*P)))*t*Z,eD=O*i*y,D*=P,eP=(O=37393792e-14*D)*s*v,eR=O*l*T,D*=P,eN=(O=2*D*73636953e-16)*h*E,eL=O*d*x,D*=P,eM=(O=11428639e-14*D)*f*w,eF=O*p*C,ez=(O=2*D*21765803e-16)*m*S,eB=O*_*A,eX=(eo+el+el-(e2+e2))%r,eY=ea+eV+2*(ec+eH-.0043752690880113)-es,eT=e3,ev=e4}1===eA&&(g=1+ev*(-2.5+.8125*ev),v=1+2*ev,b=1+ev*(-6+6.60937*ev),t=.75*(1+L)*(1+L),o=.9375*V*V*(1+3*L)-.75*(1+L),u=1+L,u*=1.875*u*u,eW=2*(ej=3*eS*eS*P*P)*t*g*17891679e-13,eq=3*ej*u*b*22123015e-14*P,ej=ej*o*v*21460748e-13*P,eX=(eo+el+M-e2)%r,eY=ea+eu+eV+eG+eH-(es+.0043752690880113)),e$=eX,eK=es,eI=0,eS=es+0}return{em:eT,argpm:eE,inclm:ex,mm:ew,nm:eS,nodem:eC,irez:eA,atime:eI,d2201:eO,d2211:eD,d3210:eP,d3222:eR,d4410:eN,d4422:eL,d5220:eM,d5232:eF,d5421:ez,d5433:eB,dedt:eU,didt:ek,dmdt:eV,dndt:0,dnodt:eH,domdt:eG,del1:ej,del2:eW,del3:eq,xfact:eY,xlamo:eX,xli:e$,xni:eK}}({cosim:i,emsq:b,argpo:e.argpo,s1:I,s2:O,s3:D,s4:P,s5:R,sinim:o,ss1:L,ss2:M,ss3:F,ss4:z,ss5:B,sz1:U,sz3:k,sz11:V,sz13:H,sz21:G,sz23:j,sz31:W,sz33:q,t:e.t,tc:0,gsto:e.gsto,mo:e.mo,mdot:e.mdot,no:e.no,nodeo:e.nodeo,nodedot:e.nodedot,xpidot:J,z1:et,z3:ei,z11:en,z13:er,z21:eo,z23:ea,z31:es,z33:el,ecco:e.ecco,eccsq:ex,em:y,argpm:0,inclm:E,mm:0,nm:x,nodem:0,irez:e.irez,atime:e.atime,d2201:e.d2201,d2211:e.d2211,d3210:e.d3210,d3222:e.d3222,d4410:e.d4410,d4422:e.d4422,d5220:e.d5220,d5232:e.d5232,d5421:e.d5421,d5433:e.d5433,dedt:e.dedt,didt:e.didt,dmdt:e.dmdt,dnodt:e.dnodt,domdt:e.domdt,del1:e.del1,del2:e.del2,del3:e.del3,xfact:e.xfact,xlamo:e.xlamo,xli:e.xli,xni:e.xni});e.irez=eL.irez,e.atime=eL.atime,e.d2201=eL.d2201,e.d2211=eL.d2211,e.d3210=eL.d3210,e.d3222=eL.d3222,e.d4410=eL.d4410,e.d4422=eL.d4422,e.d5220=eL.d5220,e.d5232=eL.d5232,e.d5421=eL.d5421,e.d5433=eL.d5433,e.dedt=eL.dedt,e.didt=eL.didt,e.dmdt=eL.dmdt,e.dnodt=eL.dnodt,e.domdt=eL.domdt,e.del1=eL.del1,e.del2=eL.del2,e.del3=eL.del3,e.xfact=eL.xfact,e.xlamo=eL.xlamo,e.xli=eL.xli,e.xni=eL.xni}1!==e.isimp&&(s=e.cc1*e.cc1,e.d2=4*eb*Q*s,Y=e.d2*Q*e.cc1/3,e.d3=(17*eb+N)*Y,e.d4=.5*Y*eb*Q*(221*eb+31*N)*e.cc1,e.t3cof=e.d2+2*s,e.t4cof=.25*(3*e.d3+e.cc1*(12*e.d2+10*s)),e.t5cof=.2*(3*e.d4+12*e.cc1*e.d3+6*e.d2*e.d2+15*s*(2*e.d2+s)))}p(e,0),e.init="n"}(s,{opsmode:"i",satn:s.satnum,epoch:s.jdsatepoch-2433281.5,xbstar:s.bstar,xecco:s.ecco,xargpo:s.argpo,xinclo:s.inclo,xmo:s.mo,xno:s.no,xnodeo:s.nodeo}),s}},9937:function(e,t,i){var n,r;r=function(e){"use strict";var t=e&&e.IPv6;return{best:function(e){var t,i,n=e.toLowerCase().split(":"),r=n.length,o=8;for(""===n[0]&&""===n[1]&&""===n[2]?(n.shift(),n.shift()):""===n[0]&&""===n[1]?n.shift():""===n[r-1]&&""===n[r-2]&&n.pop(),r=n.length,-1!==n[r-1].indexOf(".")&&(o=7),t=0;t<r&&""!==n[t];t++);if(t<o)for(n.splice(t,1,"0000");n.length<o;)n.splice(t,0,"0000");for(var a=0;a<o;a++){i=n[a].split("");for(var s=0;s<3;s++)if("0"===i[0]&&i.length>1)i.splice(0,1);else break;n[a]=i.join("")}var l=-1,c=0,u=0,h=-1,d=!1;for(a=0;a<o;a++)d?"0"===n[a]?u+=1:(d=!1,u>c&&(l=h,c=u)):"0"===n[a]&&(d=!0,h=a,u=1);u>c&&(l=h,c=u),c>1&&n.splice(l,c,""),r=n.length;var f="";for(""===n[0]&&(f=":"),a=0;a<r&&(f+=n[a],a!==r-1);a++)f+=":";return""===n[r-1]&&(f+=":"),f},noConflict:function(){return e.IPv6===this&&(e.IPv6=t),this}}},e.exports?e.exports=r():void 0===(n=r.call(t,i,t,e))||(e.exports=n)},9030:function(e,t,i){var n,r;r=function(e){"use strict";var t=e&&e.SecondLevelDomains,i={list:{ac:" com gov mil net org ",ae:" ac co gov mil name net org pro sch ",af:" com edu gov net org ",al:" com edu gov mil net org ",ao:" co ed gv it og pb ",ar:" com edu gob gov int mil net org tur ",at:" ac co gv or ",au:" asn com csiro edu gov id net org ",ba:" co com edu gov mil net org rs unbi unmo unsa untz unze ",bb:" biz co com edu gov info net org store tv ",bh:" biz cc com edu gov info net org ",bn:" com edu gov net org ",bo:" com edu gob gov int mil net org tv ",br:" adm adv agr am arq art ato b bio blog bmd cim cng cnt com coop ecn edu eng esp etc eti far flog fm fnd fot fst g12 ggf gov imb ind inf jor jus lel mat med mil mus net nom not ntr odo org ppg pro psc psi qsl rec slg srv tmp trd tur tv vet vlog wiki zlg ",bs:" com edu gov net org ",bz:" du et om ov rg ",ca:" ab bc mb nb nf nl ns nt nu on pe qc sk yk ",ck:" biz co edu gen gov info net org ",cn:" ac ah bj com cq edu fj gd gov gs gx gz ha hb he hi hl hn jl js jx ln mil net nm nx org qh sc sd sh sn sx tj tw xj xz yn zj ",co:" com edu gov mil net nom org ",cr:" ac c co ed fi go or sa ",cy:" ac biz com ekloges gov ltd name net org parliament press pro tm ",do:" art com edu gob gov mil net org sld web ",dz:" art asso com edu gov net org pol ",ec:" com edu fin gov info med mil net org pro ",eg:" com edu eun gov mil name net org sci ",er:" com edu gov ind mil net org rochest w ",es:" com edu gob nom org ",et:" biz com edu gov info name net org ",fj:" ac biz com info mil name net org pro ",fk:" ac co gov net nom org ",fr:" asso com f gouv nom prd presse tm ",gg:" co net org ",gh:" com edu gov mil org ",gn:" ac com gov net org ",gr:" com edu gov mil net org ",gt:" com edu gob ind mil net org ",gu:" com edu gov net org ",hk:" com edu gov idv net org ",hu:" 2000 agrar bolt casino city co erotica erotika film forum games hotel info ingatlan jogasz konyvelo lakas media news org priv reklam sex shop sport suli szex tm tozsde utazas video ",id:" ac co go mil net or sch web ",il:" ac co gov idf k12 muni net org ",in:" ac co edu ernet firm gen gov i ind mil net nic org res ",iq:" com edu gov i mil net org ",ir:" ac co dnssec gov i id net org sch ",it:" edu gov ",je:" co net org ",jo:" com edu gov mil name net org sch ",jp:" ac ad co ed go gr lg ne or ",ke:" ac co go info me mobi ne or sc ",kh:" com edu gov mil net org per ",ki:" biz com de edu gov info mob net org tel ",km:" asso com coop edu gouv k medecin mil nom notaires pharmaciens presse tm veterinaire ",kn:" edu gov net org ",kr:" ac busan chungbuk chungnam co daegu daejeon es gangwon go gwangju gyeongbuk gyeonggi gyeongnam hs incheon jeju jeonbuk jeonnam k kg mil ms ne or pe re sc seoul ulsan ",kw:" com edu gov net org ",ky:" com edu gov net org ",kz:" com edu gov mil net org ",lb:" com edu gov net org ",lk:" assn com edu gov grp hotel int ltd net ngo org sch soc web ",lr:" com edu gov net org ",lv:" asn com conf edu gov id mil net org ",ly:" com edu gov id med net org plc sch ",ma:" ac co gov m net org press ",mc:" asso tm ",me:" ac co edu gov its net org priv ",mg:" com edu gov mil nom org prd tm ",mk:" com edu gov inf name net org pro ",ml:" com edu gov net org presse ",mn:" edu gov org ",mo:" com edu gov net org ",mt:" com edu gov net org ",mv:" aero biz com coop edu gov info int mil museum name net org pro ",mw:" ac co com coop edu gov int museum net org ",mx:" com edu gob net org ",my:" com edu gov mil name net org sch ",nf:" arts com firm info net other per rec store web ",ng:" biz com edu gov mil mobi name net org sch ",ni:" ac co com edu gob mil net nom org ",np:" com edu gov mil net org ",nr:" biz com edu gov info net org ",om:" ac biz co com edu gov med mil museum net org pro sch ",pe:" com edu gob mil net nom org sld ",ph:" com edu gov i mil net ngo org ",pk:" biz com edu fam gob gok gon gop gos gov net org web ",pl:" art bialystok biz com edu gda gdansk gorzow gov info katowice krakow lodz lublin mil net ngo olsztyn org poznan pwr radom slupsk szczecin torun warszawa waw wroc wroclaw zgora ",pr:" ac biz com edu est gov info isla name net org pro prof ",ps:" com edu gov net org plo sec ",pw:" belau co ed go ne or ",ro:" arts com firm info nom nt org rec store tm www ",rs:" ac co edu gov in org ",sb:" com edu gov net org ",sc:" com edu gov net org ",sh:" co com edu gov net nom org ",sl:" com edu gov net org ",st:" co com consulado edu embaixada gov mil net org principe saotome store ",sv:" com edu gob org red ",sz:" ac co org ",tr:" av bbs bel biz com dr edu gen gov info k12 name net org pol tel tsk tv web ",tt:" aero biz cat co com coop edu gov info int jobs mil mobi museum name net org pro tel travel ",tw:" club com ebiz edu game gov idv mil net org ",mu:" ac co com gov net or org ",mz:" ac co edu gov org ",na:" co com ",nz:" ac co cri geek gen govt health iwi maori mil net org parliament school ",pa:" abo ac com edu gob ing med net nom org sld ",pt:" com edu gov int net nome org publ ",py:" com edu gov mil net org ",qa:" com edu gov mil net org ",re:" asso com nom ",ru:" ac adygeya altai amur arkhangelsk astrakhan bashkiria belgorod bir bryansk buryatia cbg chel chelyabinsk chita chukotka chuvashia com dagestan e-burg edu gov grozny int irkutsk ivanovo izhevsk jar joshkar-ola kalmykia kaluga kamchatka karelia kazan kchr kemerovo khabarovsk khakassia khv kirov koenig komi kostroma kranoyarsk kuban kurgan kursk lipetsk magadan mari mari-el marine mil mordovia mosreg msk murmansk nalchik net nnov nov novosibirsk nsk omsk orenburg org oryol penza perm pp pskov ptz rnd ryazan sakhalin samara saratov simbirsk smolensk spb stavropol stv surgut tambov tatarstan tom tomsk tsaritsyn tsk tula tuva tver tyumen udm udmurtia ulan-ude vladikavkaz vladimir vladivostok volgograd vologda voronezh vrn vyatka yakutia yamal yekaterinburg yuzhno-sakhalinsk ",rw:" ac co com edu gouv gov int mil net ",sa:" com edu gov med net org pub sch ",sd:" com edu gov info med net org tv ",se:" a ac b bd c d e f g h i k l m n o org p parti pp press r s t tm u w x y z ",sg:" com edu gov idn net org per ",sn:" art com edu gouv org perso univ ",sy:" com edu gov mil net news org ",th:" ac co go in mi net or ",tj:" ac biz co com edu go gov info int mil name net nic org test web ",tn:" agrinet com defense edunet ens fin gov ind info intl mincom nat net org perso rnrt rns rnu tourism ",tz:" ac co go ne or ",ua:" biz cherkassy chernigov chernovtsy ck cn co com crimea cv dn dnepropetrovsk donetsk dp edu gov if in ivano-frankivsk kh kharkov kherson khmelnitskiy kiev kirovograd km kr ks kv lg lugansk lutsk lviv me mk net nikolaev od odessa org pl poltava pp rovno rv sebastopol sumy te ternopil uzhgorod vinnica vn zaporizhzhe zhitomir zp zt ",ug:" ac co go ne or org sc ",uk:" ac bl british-library co cym gov govt icnet jet lea ltd me mil mod national-library-scotland nel net nhs nic nls org orgn parliament plc police sch scot soc ",us:" dni fed isa kids nsn ",uy:" com edu gub mil net org ",ve:" co com edu gob info mil net org web ",vi:" co com k12 net org ",vn:" ac biz com edu gov health info int name net org pro ",ye:" co com gov ltd me net org plc ",yu:" ac co edu gov org ",za:" ac agric alt bourse city co cybernet db edu gov grondar iaccess imt inca landesign law mil net ngo nis nom olivetti org pix school tm web ",zm:" ac co com edu gov net org sch ",com:"ar br cn de eu gb gr hu jpn kr no qc ru sa se uk us uy za ",net:"gb jp se uk ",org:"ae",de:"com "},has:function(e){var t=e.lastIndexOf(".");if(t<=0||t>=e.length-1)return!1;var n=e.lastIndexOf(".",t-1);if(n<=0||n>=t-1)return!1;var r=i.list[e.slice(t+1)];return!!r&&r.indexOf(" "+e.slice(n+1,t)+" ")>=0},is:function(e){var t=e.lastIndexOf(".");if(t<=0||t>=e.length-1||e.lastIndexOf(".",t-1)>=0)return!1;var n=i.list[e.slice(t+1)];return!!n&&n.indexOf(" "+e.slice(0,t)+" ")>=0},get:function(e){var t=e.lastIndexOf(".");if(t<=0||t>=e.length-1)return null;var n=e.lastIndexOf(".",t-1);if(n<=0||n>=t-1)return null;var r=i.list[e.slice(t+1)];return!r||0>r.indexOf(" "+e.slice(n+1,t)+" ")?null:e.slice(n+1)},noConflict:function(){return e.SecondLevelDomains===this&&(e.SecondLevelDomains=t),this}};return i},e.exports?e.exports=r():void 0===(n=r.call(t,i,t,e))||(e.exports=n)},4355:function(e,t,i){var n,r,o;o=function(e,t,i,n){"use strict";var r,o=n&&n.URI;function a(e,t){var i=arguments.length>=1,n=arguments.length>=2;if(!(this instanceof a))return i?n?new a(e,t):new a(e):new a;if(void 0===e){if(i)throw TypeError("undefined is not a valid argument for URI");"undefined"!=typeof location?e=location.href+"":e=""}if(null===e&&i)throw TypeError("null is not a valid argument for URI");return(this.href(e),void 0!==t)?this.absoluteTo(t):this}a.version="1.19.11";var s=a.prototype,l=Object.prototype.hasOwnProperty;function c(e){return e.replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1")}function u(e){return void 0===e?"Undefined":String(Object.prototype.toString.call(e)).slice(8,-1)}function h(e){return"Array"===u(e)}function d(e,t){var i,n,r={};if("RegExp"===u(t))r=null;else if(h(t))for(i=0,n=t.length;i<n;i++)r[t[i]]=!0;else r[t]=!0;for(i=0,n=e.length;i<n;i++)(r&&void 0!==r[e[i]]||!r&&t.test(e[i]))&&(e.splice(i,1),n--,i--);return e}function f(e,t){if(h(t)){for(i=0,n=t.length;i<n;i++)if(!f(e,t[i]))return!1;return!0}var i,n,r=u(t);for(i=0,n=e.length;i<n;i++)if("RegExp"===r){if("string"==typeof e[i]&&e[i].match(t))return!0}else if(e[i]===t)return!0;return!1}function p(e,t){if(!h(e)||!h(t)||e.length!==t.length)return!1;e.sort(),t.sort();for(var i=0,n=e.length;i<n;i++)if(e[i]!==t[i])return!1;return!0}function m(e){return e.replace(/^\/+|\/+$/g,"")}function _(e){return escape(e)}function g(e){return encodeURIComponent(e).replace(/[!'()*]/g,_).replace(/\*/g,"%2A")}a._parts=function(){return{protocol:null,username:null,password:null,hostname:null,urn:null,port:null,path:null,query:null,fragment:null,preventInvalidHostname:a.preventInvalidHostname,duplicateQueryParameters:a.duplicateQueryParameters,escapeQuerySpace:a.escapeQuerySpace}},a.preventInvalidHostname=!1,a.duplicateQueryParameters=!1,a.escapeQuerySpace=!0,a.protocol_expression=/^[a-z][a-z0-9.+-]*$/i,a.idn_expression=/[^a-z0-9\._-]/i,a.punycode_expression=/(xn--)/i,a.ip4_expression=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,a.ip6_expression=/^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*$/,a.find_uri_expression=/\b((?:[a-z][\w-]+:(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?«»“”‘’]))/ig,a.findUri={start:/\b(?:([a-z][a-z0-9.+-]*:\/\/)|www\.)/gi,end:/[\s\r\n]|$/,trim:/[`!()\[\]{};:'".,<>?«»“”„‘’]+$/,parens:/(\([^\)]*\)|\[[^\]]*\]|\{[^}]*\}|<[^>]*>)/g},a.leading_whitespace_expression=/^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/,a.ascii_tab_whitespace=/[\u0009\u000A\u000D]+/g,a.defaultPorts={http:"80",https:"443",ftp:"21",gopher:"70",ws:"80",wss:"443"},a.hostProtocols=["http","https"],a.invalid_hostname_characters=/[^a-zA-Z0-9\.\-:_]/,a.domAttributes={a:"href",blockquote:"cite",link:"href",base:"href",script:"src",form:"action",img:"src",area:"href",iframe:"src",embed:"src",source:"src",track:"src",input:"src",audio:"src",video:"src"},a.getDomAttribute=function(e){if(e&&e.nodeName){var t=e.nodeName.toLowerCase();if("input"!==t||"image"===e.type)return a.domAttributes[t]}},a.encode=g,a.decode=decodeURIComponent,a.iso8859=function(){a.encode=escape,a.decode=unescape},a.unicode=function(){a.encode=g,a.decode=decodeURIComponent},a.characters={pathname:{encode:{expression:/%(24|26|2B|2C|3B|3D|3A|40)/ig,map:{"%24":"$","%26":"&","%2B":"+","%2C":",","%3B":";","%3D":"=","%3A":":","%40":"@"}},decode:{expression:/[\/\?#]/g,map:{"/":"%2F","?":"%3F","#":"%23"}}},reserved:{encode:{expression:/%(21|23|24|26|27|28|29|2A|2B|2C|2F|3A|3B|3D|3F|40|5B|5D)/ig,map:{"%3A":":","%2F":"/","%3F":"?","%23":"#","%5B":"[","%5D":"]","%40":"@","%21":"!","%24":"$","%26":"&","%27":"'","%28":"(","%29":")","%2A":"*","%2B":"+","%2C":",","%3B":";","%3D":"="}}},urnpath:{encode:{expression:/%(21|24|27|28|29|2A|2B|2C|3B|3D|40)/ig,map:{"%21":"!","%24":"$","%27":"'","%28":"(","%29":")","%2A":"*","%2B":"+","%2C":",","%3B":";","%3D":"=","%40":"@"}},decode:{expression:/[\/\?#:]/g,map:{"/":"%2F","?":"%3F","#":"%23",":":"%3A"}}}},a.encodeQuery=function(e,t){var i=a.encode(e+"");return void 0===t&&(t=a.escapeQuerySpace),t?i.replace(/%20/g,"+"):i},a.decodeQuery=function(e,t){e+="",void 0===t&&(t=a.escapeQuerySpace);try{return a.decode(t?e.replace(/\+/g,"%20"):e)}catch(t){return e}};var Z={encode:"encode",decode:"decode"},y=function(e,t){return function(i){try{return a[t](i+"").replace(a.characters[e][t].expression,function(i){return a.characters[e][t].map[i]})}catch(e){return i}}};for(r in Z)a[r+"PathSegment"]=y("pathname",Z[r]),a[r+"UrnPathSegment"]=y("urnpath",Z[r]);var b=function(e,t,i){return function(n){r=i?function(e){return a[t](a[i](e))}:a[t];for(var r,o=(n+"").split(e),s=0,l=o.length;s<l;s++)o[s]=r(o[s]);return o.join(e)}};function v(e){return function(t,i){return void 0===t?this._parts[e]||"":(this._parts[e]=t||null,this.build(!i),this)}}function T(e,t){return function(i,n){return void 0===i?this._parts[e]||"":(null!==i&&(i+="").charAt(0)===t&&(i=i.substring(1)),this._parts[e]=i,this.build(!n),this)}}a.decodePath=b("/","decodePathSegment"),a.decodeUrnPath=b(":","decodeUrnPathSegment"),a.recodePath=b("/","encodePathSegment","decode"),a.recodeUrnPath=b(":","encodeUrnPathSegment","decode"),a.encodeReserved=y("reserved","encode"),a.parse=function(e,t){var i;return t||(t={preventInvalidHostname:a.preventInvalidHostname}),(i=(e=(e=e.replace(a.leading_whitespace_expression,"")).replace(a.ascii_tab_whitespace,"")).indexOf("#"))>-1&&(t.fragment=e.substring(i+1)||null,e=e.substring(0,i)),(i=e.indexOf("?"))>-1&&(t.query=e.substring(i+1)||null,e=e.substring(0,i)),"//"===(e=(e=e.replace(/^(https?|ftp|wss?)?:+[/\\]*/i,"$1://")).replace(/^[/\\]{2,}/i,"//")).substring(0,2)?(t.protocol=null,e=e.substring(2),e=a.parseAuthority(e,t)):(i=e.indexOf(":"))>-1&&(t.protocol=e.substring(0,i)||null,t.protocol&&!t.protocol.match(a.protocol_expression)?t.protocol=void 0:"//"===e.substring(i+1,i+3).replace(/\\/g,"/")?(e=e.substring(i+3),e=a.parseAuthority(e,t)):(e=e.substring(i+1),t.urn=!0)),t.path=e,t},a.parseHost=function(e,t){e||(e="");var i,n,r=(e=e.replace(/\\/g,"/")).indexOf("/");if(-1===r&&(r=e.length),"["===e.charAt(0))i=e.indexOf("]"),t.hostname=e.substring(1,i)||null,t.port=e.substring(i+2,r)||null,"/"===t.port&&(t.port=null);else{var o=e.indexOf(":"),s=e.indexOf("/"),l=e.indexOf(":",o+1);-1!==l&&(-1===s||l<s)?(t.hostname=e.substring(0,r)||null,t.port=null):(n=e.substring(0,r).split(":"),t.hostname=n[0]||null,t.port=n[1]||null)}return t.hostname&&"/"!==e.substring(r).charAt(0)&&(r++,e="/"+e),t.preventInvalidHostname&&a.ensureValidHostname(t.hostname,t.protocol),t.port&&a.ensureValidPort(t.port),e.substring(r)||"/"},a.parseAuthority=function(e,t){return e=a.parseUserinfo(e,t),a.parseHost(e,t)},a.parseUserinfo=function(e,t){var i,n=e;-1!==e.indexOf("\\")&&(e=e.replace(/\\/g,"/"));var r=e.indexOf("/"),o=e.lastIndexOf("@",r>-1?r:e.length-1);return o>-1&&(-1===r||o<r)?(i=e.substring(0,o).split(":"),t.username=i[0]?a.decode(i[0]):null,i.shift(),t.password=i[0]?a.decode(i.join(":")):null,e=n.substring(o+1)):(t.username=null,t.password=null),e},a.parseQuery=function(e,t){if(!e||!(e=e.replace(/&+/g,"&").replace(/^\?*&*|&+$/g,"")))return{};for(var i,n,r,o={},s=e.split("&"),c=s.length,u=0;u<c;u++)i=s[u].split("="),n=a.decodeQuery(i.shift(),t),r=i.length?a.decodeQuery(i.join("="),t):null,"__proto__"!==n&&(l.call(o,n)?(("string"==typeof o[n]||null===o[n])&&(o[n]=[o[n]]),o[n].push(r)):o[n]=r);return o},a.build=function(e){var t="",i=!1;return e.protocol&&(t+=e.protocol+":"),!e.urn&&(t||e.hostname)&&(t+="//",i=!0),t+=a.buildAuthority(e)||"","string"==typeof e.path&&("/"!==e.path.charAt(0)&&i&&(t+="/"),t+=e.path),"string"==typeof e.query&&e.query&&(t+="?"+e.query),"string"==typeof e.fragment&&e.fragment&&(t+="#"+e.fragment),t},a.buildHost=function(e){var t="";return e.hostname?(a.ip6_expression.test(e.hostname)?t+="["+e.hostname+"]":t+=e.hostname,e.port&&(t+=":"+e.port),t):""},a.buildAuthority=function(e){return a.buildUserinfo(e)+a.buildHost(e)},a.buildUserinfo=function(e){var t="";return e.username&&(t+=a.encode(e.username)),e.password&&(t+=":"+a.encode(e.password)),t&&(t+="@"),t},a.buildQuery=function(e,t,i){var n,r,o,s,c="";for(r in e)if("__proto__"!==r&&l.call(e,r)){if(h(e[r]))for(o=0,n={},s=e[r].length;o<s;o++)void 0!==e[r][o]&&void 0===n[e[r][o]+""]&&(c+="&"+a.buildQueryParameter(r,e[r][o],i),!0!==t&&(n[e[r][o]+""]=!0));else void 0!==e[r]&&(c+="&"+a.buildQueryParameter(r,e[r],i))}return c.substring(1)},a.buildQueryParameter=function(e,t,i){return a.encodeQuery(e,i)+(null!==t?"="+a.encodeQuery(t,i):"")},a.addQuery=function(e,t,i){if("object"==typeof t)for(var n in t)l.call(t,n)&&a.addQuery(e,n,t[n]);else if("string"==typeof t){if(void 0===e[t]){e[t]=i;return}"string"==typeof e[t]&&(e[t]=[e[t]]),h(i)||(i=[i]),e[t]=(e[t]||[]).concat(i)}else throw TypeError("URI.addQuery() accepts an object, string as the name parameter")},a.setQuery=function(e,t,i){if("object"==typeof t)for(var n in t)l.call(t,n)&&a.setQuery(e,n,t[n]);else if("string"==typeof t)e[t]=void 0===i?null:i;else throw TypeError("URI.setQuery() accepts an object, string as the name parameter")},a.removeQuery=function(e,t,i){var n,r,o;if(h(t))for(n=0,r=t.length;n<r;n++)e[t[n]]=void 0;else if("RegExp"===u(t))for(o in e)t.test(o)&&(e[o]=void 0);else if("object"==typeof t)for(o in t)l.call(t,o)&&a.removeQuery(e,o,t[o]);else if("string"==typeof t)void 0!==i?"RegExp"===u(i)?!h(e[t])&&i.test(e[t])?e[t]=void 0:e[t]=d(e[t],i):e[t]!==String(i)||h(i)&&1!==i.length?h(e[t])&&(e[t]=d(e[t],i)):e[t]=void 0:e[t]=void 0;else throw TypeError("URI.removeQuery() accepts an object, string, RegExp as the first parameter")},a.hasQuery=function(e,t,i,n){switch(u(t)){case"String":break;case"RegExp":for(var r in e)if(l.call(e,r)&&t.test(r)&&(void 0===i||a.hasQuery(e,r,i)))return!0;return!1;case"Object":for(var o in t)if(l.call(t,o)&&!a.hasQuery(e,o,t[o]))return!1;return!0;default:throw TypeError("URI.hasQuery() accepts a string, regular expression or object as the name parameter")}switch(u(i)){case"Undefined":return t in e;case"Boolean":return!!(h(e[t])?e[t].length:e[t])===i;case"Function":return!!i(e[t],t,e);case"Array":if(!h(e[t]))return!1;return(n?f:p)(e[t],i);case"RegExp":if(!h(e[t]))return!!(e[t]&&e[t].match(i));if(!n)return!1;return f(e[t],i);case"Number":i=String(i);case"String":if(!h(e[t]))return e[t]===i;if(!n)return!1;return f(e[t],i);default:throw TypeError("URI.hasQuery() accepts undefined, boolean, string, number, RegExp, Function as the value parameter")}},a.joinPaths=function(){for(var e=[],t=[],i=0,n=0;n<arguments.length;n++){var r=new a(arguments[n]);e.push(r);for(var o=r.segment(),s=0;s<o.length;s++)"string"==typeof o[s]&&t.push(o[s]),o[s]&&i++}if(!t.length||!i)return new a("");var l=new a("").segment(t);return(""===e[0].path()||"/"===e[0].path().slice(0,1))&&l.path("/"+l.path()),l.normalize()},a.commonPath=function(e,t){var i,n=Math.min(e.length,t.length);for(i=0;i<n;i++)if(e.charAt(i)!==t.charAt(i)){i--;break}return i<1?e.charAt(0)===t.charAt(0)&&"/"===e.charAt(0)?"/":"":(("/"!==e.charAt(i)||"/"!==t.charAt(i))&&(i=e.substring(0,i).lastIndexOf("/")),e.substring(0,i+1))},a.withinString=function(e,t,i){i||(i={});var n=i.start||a.findUri.start,r=i.end||a.findUri.end,o=i.trim||a.findUri.trim,s=i.parens||a.findUri.parens,l=/[a-z0-9-]=["']?$/i;for(n.lastIndex=0;;){var c=n.exec(e);if(!c)break;var u=c.index;if(i.ignoreHtml){var h=e.slice(Math.max(u-3,0),u);if(h&&l.test(h))continue}for(var d=u+e.slice(u).search(r),f=e.slice(u,d),p=-1;;){var m=s.exec(f);if(!m)break;p=Math.max(p,m.index+m[0].length)}if(!((f=p>-1?f.slice(0,p)+f.slice(p).replace(o,""):f.replace(o,"")).length<=c[0].length||i.ignore&&i.ignore.test(f))){d=u+f.length;var _=t(f,u,d,e);if(void 0===_){n.lastIndex=d;continue}_=String(_),e=e.slice(0,u)+_+e.slice(d),n.lastIndex=u+_.length}}return n.lastIndex=0,e},a.ensureValidHostname=function(t,i){var n=!!t,r=!1;if(i&&(r=f(a.hostProtocols,i)),r&&!n)throw TypeError("Hostname cannot be empty, if protocol is "+i);if(t&&t.match(a.invalid_hostname_characters)){if(!e)throw TypeError('Hostname "'+t+'" contains characters other than [A-Z0-9.-:_] and Punycode.js is not available');if(e.toASCII(t).match(a.invalid_hostname_characters))throw TypeError('Hostname "'+t+'" contains characters other than [A-Z0-9.-:_]')}},a.ensureValidPort=function(e){if(e){var t=Number(e);if(!/^[0-9]+$/.test(t)||!(t>0)||!(t<65536))throw TypeError('Port "'+e+'" is not a valid port')}},a.noConflict=function(e){if(e){var t={URI:this.noConflict()};return n.URITemplate&&"function"==typeof n.URITemplate.noConflict&&(t.URITemplate=n.URITemplate.noConflict()),n.IPv6&&"function"==typeof n.IPv6.noConflict&&(t.IPv6=n.IPv6.noConflict()),n.SecondLevelDomains&&"function"==typeof n.SecondLevelDomains.noConflict&&(t.SecondLevelDomains=n.SecondLevelDomains.noConflict()),t}return n.URI===this&&(n.URI=o),this},s.build=function(e){return!0===e?this._deferred_build=!0:(void 0===e||this._deferred_build)&&(this._string=a.build(this._parts),this._deferred_build=!1),this},s.clone=function(){return new a(this)},s.valueOf=s.toString=function(){return this.build(!1)._string},s.protocol=v("protocol"),s.username=v("username"),s.password=v("password"),s.hostname=v("hostname"),s.port=v("port"),s.query=T("query","?"),s.fragment=T("fragment","#"),s.search=function(e,t){var i=this.query(e,t);return"string"==typeof i&&i.length?"?"+i:i},s.hash=function(e,t){var i=this.fragment(e,t);return"string"==typeof i&&i.length?"#"+i:i},s.pathname=function(e,t){if(void 0!==e&&!0!==e)return this._parts.urn?this._parts.path=e?a.recodeUrnPath(e):"":this._parts.path=e?a.recodePath(e):"/",this.build(!t),this;var i=this._parts.path||(this._parts.hostname?"/":"");return e?(this._parts.urn?a.decodeUrnPath:a.decodePath)(i):i},s.path=s.pathname,s.href=function(e,t){if(void 0===e)return this.toString();this._string="",this._parts=a._parts();var i,n=e instanceof a,r="object"==typeof e&&(e.hostname||e.path||e.pathname);if(e.nodeName){var o=a.getDomAttribute(e);e=e[o]||"",r=!1}if(!n&&r&&void 0!==e.pathname&&(e=e.toString()),"string"==typeof e||e instanceof String)this._parts=a.parse(String(e),this._parts);else if(n||r){var s=n?e._parts:e;for(i in s)"query"!==i&&l.call(this._parts,i)&&(this._parts[i]=s[i]);s.query&&this.query(s.query,!1)}else throw TypeError("invalid input");return this.build(!t),this},s.is=function(e){var t=!1,n=!1,r=!1,o=!1,s=!1,l=!1,c=!1,u=!this._parts.urn;switch(this._parts.hostname&&(u=!1,n=a.ip4_expression.test(this._parts.hostname),r=a.ip6_expression.test(this._parts.hostname),s=(o=!(t=n||r))&&i&&i.has(this._parts.hostname),l=o&&a.idn_expression.test(this._parts.hostname),c=o&&a.punycode_expression.test(this._parts.hostname)),e.toLowerCase()){case"relative":return u;case"absolute":return!u;case"domain":case"name":return o;case"sld":return s;case"ip":return t;case"ip4":case"ipv4":case"inet4":return n;case"ip6":case"ipv6":case"inet6":return r;case"idn":return l;case"url":return!this._parts.urn;case"urn":return!!this._parts.urn;case"punycode":return c}return null};var E=s.protocol,x=s.port,w=s.hostname;s.protocol=function(e,t){if(e&&!(e=e.replace(/:(\/\/)?$/,"")).match(a.protocol_expression))throw TypeError('Protocol "'+e+"\" contains characters other than [A-Z0-9.+-] or doesn't start with [A-Z]");return E.call(this,e,t)},s.scheme=s.protocol,s.port=function(e,t){return this._parts.urn?void 0===e?"":this:(void 0!==e&&(0===e&&(e=null),e&&(":"===(e+="").charAt(0)&&(e=e.substring(1)),a.ensureValidPort(e))),x.call(this,e,t))},s.hostname=function(e,t){if(this._parts.urn)return void 0===e?"":this;if(void 0!==e){var i={preventInvalidHostname:this._parts.preventInvalidHostname};if("/"!==a.parseHost(e,i))throw TypeError('Hostname "'+e+'" contains characters other than [A-Z0-9.-]');e=i.hostname,this._parts.preventInvalidHostname&&a.ensureValidHostname(e,this._parts.protocol)}return w.call(this,e,t)},s.origin=function(e,t){if(this._parts.urn)return void 0===e?"":this;if(void 0===e){var i=this.protocol();return this.authority()?(i?i+"://":"")+this.authority():""}var n=a(e);return this.protocol(n.protocol()).authority(n.authority()).build(!t),this},s.host=function(e,t){if(this._parts.urn)return void 0===e?"":this;if(void 0===e)return this._parts.hostname?a.buildHost(this._parts):"";if("/"!==a.parseHost(e,this._parts))throw TypeError('Hostname "'+e+'" contains characters other than [A-Z0-9.-]');return this.build(!t),this},s.authority=function(e,t){if(this._parts.urn)return void 0===e?"":this;if(void 0===e)return this._parts.hostname?a.buildAuthority(this._parts):"";if("/"!==a.parseAuthority(e,this._parts))throw TypeError('Hostname "'+e+'" contains characters other than [A-Z0-9.-]');return this.build(!t),this},s.userinfo=function(e,t){if(this._parts.urn)return void 0===e?"":this;if(void 0!==e)return"@"!==e[e.length-1]&&(e+="@"),a.parseUserinfo(e,this._parts),this.build(!t),this;var i=a.buildUserinfo(this._parts);return i?i.substring(0,i.length-1):i},s.resource=function(e,t){var i;return void 0===e?this.path()+this.search()+this.hash():(i=a.parse(e),this._parts.path=i.path,this._parts.query=i.query,this._parts.fragment=i.fragment,this.build(!t),this)},s.subdomain=function(e,t){if(this._parts.urn)return void 0===e?"":this;if(void 0===e){if(!this._parts.hostname||this.is("IP"))return"";var i=this._parts.hostname.length-this.domain().length-1;return this._parts.hostname.substring(0,i)||""}var n=this._parts.hostname.length-this.domain().length,r=RegExp("^"+c(this._parts.hostname.substring(0,n)));if(e&&"."!==e.charAt(e.length-1)&&(e+="."),-1!==e.indexOf(":"))throw TypeError("Domains cannot contain colons");return e&&a.ensureValidHostname(e,this._parts.protocol),this._parts.hostname=this._parts.hostname.replace(r,e),this.build(!t),this},s.domain=function(e,t){if(this._parts.urn)return void 0===e?"":this;if("boolean"==typeof e&&(t=e,e=void 0),void 0===e){if(!this._parts.hostname||this.is("IP"))return"";var i=this._parts.hostname.match(/\./g);if(i&&i.length<2)return this._parts.hostname;var n=this._parts.hostname.length-this.tld(t).length-1;return n=this._parts.hostname.lastIndexOf(".",n-1)+1,this._parts.hostname.substring(n)||""}if(!e)throw TypeError("cannot set domain empty");if(-1!==e.indexOf(":"))throw TypeError("Domains cannot contain colons");if(a.ensureValidHostname(e,this._parts.protocol),!this._parts.hostname||this.is("IP"))this._parts.hostname=e;else{var r=RegExp(c(this.domain())+"$");this._parts.hostname=this._parts.hostname.replace(r,e)}return this.build(!t),this},s.tld=function(e,t){if(this._parts.urn)return void 0===e?"":this;if("boolean"==typeof e&&(t=e,e=void 0),void 0===e){if(!this._parts.hostname||this.is("IP"))return"";var n,r=this._parts.hostname.lastIndexOf("."),o=this._parts.hostname.substring(r+1);return!0!==t&&i&&i.list[o.toLowerCase()]&&i.get(this._parts.hostname)||o}if(e){if(e.match(/[^a-zA-Z0-9-]/)){if(i&&i.is(e))n=RegExp(c(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(n,e);else throw TypeError('TLD "'+e+'" contains characters other than [A-Z0-9]')}else if(!this._parts.hostname||this.is("IP"))throw ReferenceError("cannot set TLD on non-domain host");else n=RegExp(c(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(n,e)}else throw TypeError("cannot set TLD empty");return this.build(!t),this},s.directory=function(e,t){if(this._parts.urn)return void 0===e?"":this;if(void 0===e||!0===e){if(!this._parts.path&&!this._parts.hostname)return"";if("/"===this._parts.path)return"/";var i=this._parts.path.length-this.filename().length-1,n=this._parts.path.substring(0,i)||(this._parts.hostname?"/":"");return e?a.decodePath(n):n}var r=this._parts.path.length-this.filename().length,o=RegExp("^"+c(this._parts.path.substring(0,r)));return this.is("relative")||(e||(e="/"),"/"===e.charAt(0)||(e="/"+e)),e&&"/"!==e.charAt(e.length-1)&&(e+="/"),e=a.recodePath(e),this._parts.path=this._parts.path.replace(o,e),this.build(!t),this},s.filename=function(e,t){if(this._parts.urn)return void 0===e?"":this;if("string"!=typeof e){if(!this._parts.path||"/"===this._parts.path)return"";var i=this._parts.path.lastIndexOf("/"),n=this._parts.path.substring(i+1);return e?a.decodePathSegment(n):n}var r=!1;"/"===e.charAt(0)&&(e=e.substring(1)),e.match(/\.?\//)&&(r=!0);var o=RegExp(c(this.filename())+"$");return e=a.recodePath(e),this._parts.path=this._parts.path.replace(o,e),r?this.normalizePath(t):this.build(!t),this},s.suffix=function(e,t){if(this._parts.urn)return void 0===e?"":this;if(void 0===e||!0===e){if(!this._parts.path||"/"===this._parts.path)return"";var i,n,r=this.filename(),o=r.lastIndexOf(".");return -1===o?"":(i=r.substring(o+1),n=/^[a-z0-9%]+$/i.test(i)?i:"",e?a.decodePathSegment(n):n)}"."===e.charAt(0)&&(e=e.substring(1));var s,l=this.suffix();if(l)s=e?RegExp(c(l)+"$"):RegExp(c("."+l)+"$");else{if(!e)return this;this._parts.path+="."+a.recodePath(e)}return s&&(e=a.recodePath(e),this._parts.path=this._parts.path.replace(s,e)),this.build(!t),this},s.segment=function(e,t,i){var n=this._parts.urn?":":"/",r=this.path(),o="/"===r.substring(0,1),a=r.split(n);if(void 0!==e&&"number"!=typeof e&&(i=t,t=e,e=void 0),void 0!==e&&"number"!=typeof e)throw Error('Bad segment "'+e+'", must be 0-based integer');if(o&&a.shift(),e<0&&(e=Math.max(a.length+e,0)),void 0===t)return void 0===e?a:a[e];if(null===e||void 0===a[e]){if(h(t)){a=[];for(var s=0,l=t.length;s<l;s++)(t[s].length||a.length&&a[a.length-1].length)&&(a.length&&!a[a.length-1].length&&a.pop(),a.push(m(t[s])))}else(t||"string"==typeof t)&&(t=m(t),""===a[a.length-1]?a[a.length-1]=t:a.push(t))}else t?a[e]=m(t):a.splice(e,1);return o&&a.unshift(""),this.path(a.join(n),i)},s.segmentCoded=function(e,t,i){var n,r,o;if("number"!=typeof e&&(i=t,t=e,e=void 0),void 0===t){if(h(n=this.segment(e,t,i)))for(r=0,o=n.length;r<o;r++)n[r]=a.decode(n[r]);else n=void 0!==n?a.decode(n):void 0;return n}if(h(t))for(r=0,o=t.length;r<o;r++)t[r]=a.encode(t[r]);else t="string"==typeof t||t instanceof String?a.encode(t):t;return this.segment(e,t,i)};var S=s.query;return s.query=function(e,t){if(!0===e)return a.parseQuery(this._parts.query,this._parts.escapeQuerySpace);if("function"==typeof e){var i=a.parseQuery(this._parts.query,this._parts.escapeQuerySpace),n=e.call(this,i);return this._parts.query=a.buildQuery(n||i,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!t),this}return void 0!==e&&"string"!=typeof e?(this._parts.query=a.buildQuery(e,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!t),this):S.call(this,e,t)},s.setQuery=function(e,t,i){var n=a.parseQuery(this._parts.query,this._parts.escapeQuerySpace);if("string"==typeof e||e instanceof String)n[e]=void 0!==t?t:null;else if("object"==typeof e)for(var r in e)l.call(e,r)&&(n[r]=e[r]);else throw TypeError("URI.addQuery() accepts an object, string as the name parameter");return this._parts.query=a.buildQuery(n,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),"string"!=typeof e&&(i=t),this.build(!i),this},s.addQuery=function(e,t,i){var n=a.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return a.addQuery(n,e,void 0===t?null:t),this._parts.query=a.buildQuery(n,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),"string"!=typeof e&&(i=t),this.build(!i),this},s.removeQuery=function(e,t,i){var n=a.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return a.removeQuery(n,e,t),this._parts.query=a.buildQuery(n,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),"string"!=typeof e&&(i=t),this.build(!i),this},s.hasQuery=function(e,t,i){var n=a.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return a.hasQuery(n,e,t,i)},s.setSearch=s.setQuery,s.addSearch=s.addQuery,s.removeSearch=s.removeQuery,s.hasSearch=s.hasQuery,s.normalize=function(){return this._parts.urn?this.normalizeProtocol(!1).normalizePath(!1).normalizeQuery(!1).normalizeFragment(!1).build():this.normalizeProtocol(!1).normalizeHostname(!1).normalizePort(!1).normalizePath(!1).normalizeQuery(!1).normalizeFragment(!1).build()},s.normalizeProtocol=function(e){return"string"==typeof this._parts.protocol&&(this._parts.protocol=this._parts.protocol.toLowerCase(),this.build(!e)),this},s.normalizeHostname=function(i){return this._parts.hostname&&(this.is("IDN")&&e?this._parts.hostname=e.toASCII(this._parts.hostname):this.is("IPv6")&&t&&(this._parts.hostname=t.best(this._parts.hostname)),this._parts.hostname=this._parts.hostname.toLowerCase(),this.build(!i)),this},s.normalizePort=function(e){return"string"==typeof this._parts.protocol&&this._parts.port===a.defaultPorts[this._parts.protocol]&&(this._parts.port=null,this.build(!e)),this},s.normalizePath=function(e){var t,i,n,r=this._parts.path;if(!r)return this;if(this._parts.urn)return this._parts.path=a.recodeUrnPath(this._parts.path),this.build(!e),this;if("/"===this._parts.path)return this;r=a.recodePath(r);var o="";for("/"!==r.charAt(0)&&(t=!0,r="/"+r),("/.."===r.slice(-3)||"/."===r.slice(-2))&&(r+="/"),r=r.replace(/(\/(\.\/)+)|(\/\.$)/g,"/").replace(/\/{2,}/g,"/"),t&&(o=r.substring(1).match(/^(\.\.\/)+/)||"")&&(o=o[0]);-1!==(i=r.search(/\/\.\.(\/|$)/));){if(0===i){r=r.substring(3);continue}-1===(n=r.substring(0,i).lastIndexOf("/"))&&(n=i),r=r.substring(0,n)+r.substring(i+3)}return t&&this.is("relative")&&(r=o+r.substring(1)),this._parts.path=r,this.build(!e),this},s.normalizePathname=s.normalizePath,s.normalizeQuery=function(e){return"string"==typeof this._parts.query&&(this._parts.query.length?this.query(a.parseQuery(this._parts.query,this._parts.escapeQuerySpace)):this._parts.query=null,this.build(!e)),this},s.normalizeFragment=function(e){return this._parts.fragment||(this._parts.fragment=null,this.build(!e)),this},s.normalizeSearch=s.normalizeQuery,s.normalizeHash=s.normalizeFragment,s.iso8859=function(){var e=a.encode,t=a.decode;a.encode=escape,a.decode=decodeURIComponent;try{this.normalize()}finally{a.encode=e,a.decode=t}return this},s.unicode=function(){var e=a.encode,t=a.decode;a.encode=g,a.decode=unescape;try{this.normalize()}finally{a.encode=e,a.decode=t}return this},s.readable=function(){var t=this.clone();t.username("").password("").normalize();var i="";if(t._parts.protocol&&(i+=t._parts.protocol+"://"),t._parts.hostname&&(t.is("punycode")&&e?(i+=e.toUnicode(t._parts.hostname),t._parts.port&&(i+=":"+t._parts.port)):i+=t.host()),t._parts.hostname&&t._parts.path&&"/"!==t._parts.path.charAt(0)&&(i+="/"),i+=t.path(!0),t._parts.query){for(var n="",r=0,o=t._parts.query.split("&"),s=o.length;r<s;r++){var l=(o[r]||"").split("=");n+="&"+a.decodeQuery(l[0],this._parts.escapeQuerySpace).replace(/&/g,"%26"),void 0!==l[1]&&(n+="="+a.decodeQuery(l[1],this._parts.escapeQuerySpace).replace(/&/g,"%26"))}i+="?"+n.substring(1)}return i+a.decodeQuery(t.hash(),!0)},s.absoluteTo=function(e){var t,i,n,r=this.clone(),o=["protocol","username","password","hostname","port"];if(this._parts.urn)throw Error("URNs do not have any generally defined hierarchical components");if(e instanceof a||(e=new a(e)),r._parts.protocol||(r._parts.protocol=e._parts.protocol,this._parts.hostname))return r;for(i=0;n=o[i];i++)r._parts[n]=e._parts[n];return r._parts.path?(".."===r._parts.path.substring(-2)&&(r._parts.path+="/"),"/"!==r.path().charAt(0)&&(t=(t=e.directory())||(0===e.path().indexOf("/")?"/":""),r._parts.path=(t?t+"/":"")+r._parts.path,r.normalizePath())):(r._parts.path=e._parts.path,r._parts.query||(r._parts.query=e._parts.query)),r.build(),r},s.relativeTo=function(e){var t,i,n,r,o,s=this.clone().normalize();if(s._parts.urn)throw Error("URNs do not have any generally defined hierarchical components");if(e=new a(e).normalize(),t=s._parts,i=e._parts,r=s.path(),o=e.path(),"/"!==r.charAt(0))throw Error("URI is already relative");if("/"!==o.charAt(0))throw Error("Cannot calculate a URI relative to another relative URI");if(t.protocol===i.protocol&&(t.protocol=null),t.username!==i.username||t.password!==i.password||null!==t.protocol||null!==t.username||null!==t.password||t.hostname!==i.hostname||t.port!==i.port)return s.build();if(t.hostname=null,t.port=null,r===o)return t.path="",s.build();if(!(n=a.commonPath(r,o)))return s.build();var l=i.path.substring(n.length).replace(/[^\/]*$/,"").replace(/.*?\//g,"../");return t.path=l+t.path.substring(n.length)||"./",s.build()},s.equals=function(e){var t,i,n,r=this.clone(),o=new a(e),s={},c={},u={};if(r.normalize(),o.normalize(),r.toString()===o.toString())return!0;if(t=r.query(),i=o.query(),r.query(""),o.query(""),r.toString()!==o.toString()||t.length!==i.length)return!1;for(n in s=a.parseQuery(t,this._parts.escapeQuerySpace),c=a.parseQuery(i,this._parts.escapeQuerySpace),s)if(l.call(s,n)){if(h(s[n])){if(!p(s[n],c[n]))return!1}else if(s[n]!==c[n])return!1;u[n]=!0}for(n in c)if(l.call(c,n)&&!u[n])return!1;return!0},s.preventInvalidHostname=function(e){return this._parts.preventInvalidHostname=!!e,this},s.duplicateQueryParameters=function(e){return this._parts.duplicateQueryParameters=!!e,this},s.escapeQuerySpace=function(e){return this._parts.escapeQuerySpace=!!e,this},a},e.exports?e.exports=o(i(9960),i(9937),i(9030)):(n=[i(9960),i(9937),i(9030)],void 0===(r=o.apply(t,n))||(e.exports=r))},9960:function(e,t,i){var n;e=i.nmd(e),function(r){t&&t.nodeType,e&&e.nodeType;var o="object"==typeof i.g&&i.g;o.global===o||o.window===o||o.self;var a,s=/^xn--/,l=/[^\x20-\x7E]/,c=/[\x2E\u3002\uFF0E\uFF61]/g,u={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},h=Math.floor,d=String.fromCharCode;function f(e){throw RangeError(u[e])}function p(e,t){for(var i=e.length,n=[];i--;)n[i]=t(e[i]);return n}function m(e,t){var i=e.split("@"),n="";return i.length>1&&(n=i[0]+"@",e=i[1]),n+p((e=e.replace(c,".")).split("."),t).join(".")}function _(e){for(var t,i,n=[],r=0,o=e.length;r<o;)(t=e.charCodeAt(r++))>=55296&&t<=56319&&r<o?(64512&(i=e.charCodeAt(r++)))==56320?n.push(((1023&t)<<10)+(1023&i)+65536):(n.push(t),r--):n.push(t);return n}function g(e){return p(e,function(e){var t="";return e>65535&&(e-=65536,t+=d(e>>>10&1023|55296),e=56320|1023&e),t+=d(e)}).join("")}function Z(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function y(e,t,i){var n=0;for(e=i?h(e/700):e>>1,e+=h(e/t);e>455;n+=36)e=h(e/35);return h(n+36*e/(e+38))}function b(e){var t,i,n,r,o,a,s,l,c,u,d,p=[],m=e.length,_=0,Z=128,b=72;for((n=e.lastIndexOf("-"))<0&&(n=0),r=0;r<n;++r)e.charCodeAt(r)>=128&&f("not-basic"),p.push(e.charCodeAt(r));for(o=n>0?n+1:0;o<m;){for(a=_,s=1,l=36;o>=m&&f("invalid-input"),((c=(t=e.charCodeAt(o++))-48<10?t-22:t-65<26?t-65:t-97<26?t-97:36)>=36||c>h((2147483647-_)/s))&&f("overflow"),_+=c*s,!(c<(u=l<=b?1:l>=b+26?26:l-b));l+=36)s>h(2147483647/(d=36-u))&&f("overflow"),s*=d;b=y(_-a,i=p.length+1,0==a),h(_/i)>2147483647-Z&&f("overflow"),Z+=h(_/i),_%=i,p.splice(_++,0,Z)}return g(p)}function v(e){var t,i,n,r,o,a,s,l,c,u,p,m,g,b,v,T=[];for(a=0,m=(e=_(e)).length,t=128,i=0,o=72;a<m;++a)(p=e[a])<128&&T.push(d(p));for(n=r=T.length,r&&T.push("-");n<m;){for(s=2147483647,a=0;a<m;++a)(p=e[a])>=t&&p<s&&(s=p);for(s-t>h((2147483647-i)/(g=n+1))&&f("overflow"),i+=(s-t)*g,t=s,a=0;a<m;++a)if((p=e[a])<t&&++i>2147483647&&f("overflow"),p==t){for(l=i,c=36;!(l<(u=c<=o?1:c>=o+26?26:c-o));c+=36)v=l-u,b=36-u,T.push(d(Z(u+v%b,0))),l=h(v/b);T.push(d(Z(l,0))),o=y(i,g,n==r),i=0,++n}++i,++t}return T.join("")}a={version:"1.3.2",ucs2:{decode:_,encode:g},decode:b,encode:v,toASCII:function(e){return m(e,function(e){return l.test(e)?"xn--"+v(e):e})},toUnicode:function(e){return m(e,function(e){return s.test(e)?b(e.slice(4).toLowerCase()):e})}},void 0!==(n=(function(){return a}).call(t,i,t,e))&&(e.exports=n)}(0)},9588:function(){},3369:function(e,t,i){"use strict";var n=i(7643),r=i(2059),o=i(570),a=i(1486),s=i(2820),l=i(698),c=i(4572),u=i(9410),h=i(9824),d=i(1039),f=i(9589),p=i(8054),m=i(8358);let _=new a.Z,g=new a.Z,Z=new s.Z,y=new a.Z,b=new a.Z,v=new n.Z,T=new f.Z,E=[new s.Z,new s.Z,new s.Z,new s.Z],x=new o.Z,w={};function S(e){let t;s.Z.fromRadians(e.east,e.north,0,E[0]),s.Z.fromRadians(e.west,e.north,0,E[1]),s.Z.fromRadians(e.east,e.south,0,E[2]),s.Z.fromRadians(e.west,e.south,0,E[3]);let i=0,n=0,r=0,o=0,a=w._terrainHeightsMaxLevel;for(t=0;t<=a;++t){let e=!1;for(let i=0;i<4;++i){let n=E[i];if(T.positionToTileXY(n,t,x),0===i)r=x.x,o=x.y;else if(r!==x.x||o!==x.y){e=!0;break}}if(e)break;i=r,n=o}if(0!==t)return{x:i,y:n,level:t>a?a:t-1}}w.initialize=function(){let e=w._initPromise;return(0,u.Z)(e)||(e=m.Z.fetchJson((0,r.Z)("Assets/approximateTerrainHeights.json")).then(function(e){w._terrainHeights=e}),w._initPromise=e),e},w.getMinimumMaximumHeights=function(e,t){if(l.Z.defined("rectangle",e),!(0,u.Z)(w._terrainHeights))throw new h.Z("You must call ApproximateTerrainHeights.initialize and wait for the promise to resolve before using this function");t=(0,c.Z)(t,d.Z.WGS84);let i=S(e),n=w._defaultMinTerrainHeight,r=w._defaultMaxTerrainHeight;if((0,u.Z)(i)){let o=`${i.level}-${i.x}-${i.y}`,s=w._terrainHeights[o];(0,u.Z)(s)&&(n=s[0],r=s[1]),t.cartographicToCartesian(p.Z.northeast(e,Z),_),t.cartographicToCartesian(p.Z.southwest(e,Z),g),a.Z.midpoint(g,_,y);let l=t.scaleToGeodeticSurface(y,b);n=(0,u.Z)(l)?Math.min(n,-a.Z.distance(y,l)):w._defaultMinTerrainHeight}return{minimumTerrainHeight:n=Math.max(w._defaultMinTerrainHeight,n),maximumTerrainHeight:r}},w.getBoundingSphere=function(e,t){if(l.Z.defined("rectangle",e),!(0,u.Z)(w._terrainHeights))throw new h.Z("You must call ApproximateTerrainHeights.initialize and wait for the promise to resolve before using this function");t=(0,c.Z)(t,d.Z.WGS84);let i=S(e),r=w._defaultMaxTerrainHeight;if((0,u.Z)(i)){let e=`${i.level}-${i.x}-${i.y}`,t=w._terrainHeights[e];(0,u.Z)(t)&&(r=t[1])}let o=n.Z.fromRectangle3D(e,t,0);return n.Z.fromRectangle3D(e,t,r,v),n.Z.union(o,v,o)},w._terrainHeightsMaxLevel=6,w._defaultMaxTerrainHeight=9e3,w._defaultMinTerrainHeight=-1e5,w._terrainHeights=void 0,w._initPromise=void 0,Object.defineProperties(w,{initialized:{get:function(){return(0,u.Z)(w._terrainHeights)}}}),t.Z=w},7749:function(e,t){"use strict";t.Z=Object.freeze({NONE:0,GEODESIC:1,RHUMB:2})},4989:function(e,t,i){"use strict";var n=i(9410),r=i(9824);function o(){this._array=[],this._hash={}}Object.defineProperties(o.prototype,{length:{get:function(){return this._array.length}},values:{get:function(){return this._array}}}),o.prototype.contains=function(e){if("string"!=typeof e&&"number"!=typeof e)throw new r.Z("key is required to be a string or number.");return(0,n.Z)(this._hash[e])},o.prototype.set=function(e,t){if("string"!=typeof e&&"number"!=typeof e)throw new r.Z("key is required to be a string or number.");t!==this._hash[e]&&(this.remove(e),this._hash[e]=t,this._array.push(t))},o.prototype.get=function(e){if("string"!=typeof e&&"number"!=typeof e)throw new r.Z("key is required to be a string or number.");return this._hash[e]},o.prototype.remove=function(e){if((0,n.Z)(e)&&"string"!=typeof e&&"number"!=typeof e)throw new r.Z("key is required to be a string or number.");let t=this._hash[e],i=(0,n.Z)(t);if(i){let i=this._array;i.splice(i.indexOf(t),1),delete this._hash[e]}return i},o.prototype.removeAll=function(){let e=this._array;e.length>0&&(this._hash={},e.length=0)},t.Z=o},6936:function(e,t,i){"use strict";var n=i(570),r=i(1486),o=i(7559),a=i(698),s=i(9410),l=i(9824),c=i(2150),u=i(1705);let h=1/256,d={};d.octEncodeInRange=function(e,t,i){if(a.Z.defined("vector",e),a.Z.defined("result",i),Math.abs(r.Z.magnitudeSquared(e)-1)>c.Z.EPSILON6)throw new l.Z("vector must be normalized.");if(i.x=e.x/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),i.y=e.y/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),e.z<0){let e=i.x,t=i.y;i.x=(1-Math.abs(t))*c.Z.signNotZero(e),i.y=(1-Math.abs(e))*c.Z.signNotZero(t)}return i.x=c.Z.toSNorm(i.x,t),i.y=c.Z.toSNorm(i.y,t),i},d.octEncode=function(e,t){return d.octEncodeInRange(e,255,t)};let f=new n.Z,p=new Uint8Array(1);function m(e){return p[0]=e,p[0]}d.octEncodeToCartesian4=function(e,t){return d.octEncodeInRange(e,65535,f),t.x=m(f.x*h),t.y=m(f.x),t.z=m(f.y*h),t.w=m(f.y),t},d.octDecodeInRange=function(e,t,i,n){if(a.Z.defined("result",n),e<0||e>i||t<0||t>i)throw new l.Z(`x and y must be unsigned normalized integers between 0 and ${i}`);if(n.x=c.Z.fromSNorm(e,i),n.y=c.Z.fromSNorm(t,i),n.z=1-(Math.abs(n.x)+Math.abs(n.y)),n.z<0){let e=n.x;n.x=(1-Math.abs(n.y))*c.Z.signNotZero(e),n.y=(1-Math.abs(e))*c.Z.signNotZero(n.y)}return r.Z.normalize(n,n)},d.octDecode=function(e,t,i){return d.octDecodeInRange(e,t,255,i)},d.octDecodeFromCartesian4=function(e,t){a.Z.typeOf.object("encoded",e),a.Z.typeOf.object("result",t);let i=e.x,n=e.y,r=e.z,o=e.w;if(i<0||i>255||n<0||n>255||r<0||r>255||o<0||o>255)throw new l.Z("x, y, z, and w must be unsigned normalized integers between 0 and 255");return d.octDecodeInRange(256*i+n,256*r+o,65535,t)},d.octPackFloat=function(e){return a.Z.defined("encoded",e),256*e.x+e.y};let _=new n.Z;function g(e){return e>>1^-(1&e)}d.octEncodeFloat=function(e){return d.octEncode(e,_),d.octPackFloat(_)},d.octDecodeFloat=function(e,t){a.Z.defined("value",e);let i=e/256,n=Math.floor(i);return d.octDecode(n,(i-n)*256,t)},d.octPack=function(e,t,i,n){a.Z.defined("v1",e),a.Z.defined("v2",t),a.Z.defined("v3",i),a.Z.defined("result",n);let r=d.octEncodeFloat(e),o=d.octEncodeFloat(t),s=d.octEncode(i,_);return n.x=65536*s.x+r,n.y=65536*s.y+o,n},d.octUnpack=function(e,t,i,n){a.Z.defined("packed",e),a.Z.defined("v1",t),a.Z.defined("v2",i),a.Z.defined("v3",n);let r=e.x/65536,o=Math.floor(r),s=(r-o)*65536,l=Math.floor(r=e.y/65536),c=(r-l)*65536;d.octDecodeFloat(s,t),d.octDecodeFloat(c,i),d.octDecode(o,l,n)},d.compressTextureCoordinates=function(e){return a.Z.defined("textureCoordinates",e),4096*(4095*e.x|0)+(4095*e.y|0)},d.decompressTextureCoordinates=function(e,t){a.Z.defined("compressed",e),a.Z.defined("result",t);let i=Math.floor(e/4096);return t.x=i/4095,t.y=(e-4096*i)/4095,t},d.zigZagDeltaDecode=function(e,t,i){a.Z.defined("uBuffer",e),a.Z.defined("vBuffer",t),a.Z.typeOf.number.equals("uBuffer.length","vBuffer.length",e.length,t.length),(0,s.Z)(i)&&a.Z.typeOf.number.equals("uBuffer.length","heightBuffer.length",e.length,i.length);let n=e.length,r=0,o=0,l=0;for(let a=0;a<n;++a)r+=g(e[a]),o+=g(t[a]),e[a]=r,t[a]=o,(0,s.Z)(i)&&(l+=g(i[a]),i[a]=l)},d.dequantize=function(e,t,i,n){let r;a.Z.defined("typedArray",e),a.Z.defined("componentDatatype",t),a.Z.defined("type",i),a.Z.defined("count",n);let s=u.Z.getNumberOfComponents(i);switch(t){case o.Z.BYTE:r=127;break;case o.Z.UNSIGNED_BYTE:r=255;break;case o.Z.SHORT:r=32767;break;case o.Z.UNSIGNED_SHORT:r=65535;break;case o.Z.INT:r=2147483647;break;case o.Z.UNSIGNED_INT:r=4294967295;break;default:throw new l.Z(`Cannot dequantize component datatype: ${t}`)}let c=new Float32Array(n*s);for(let t=0;t<n;t++)for(let i=0;i<s;i++){let n=t*s+i;c[n]=Math.max(e[n]/r,-1)}return c},d.decodeRGB565=function(e,t){a.Z.defined("typedArray",e);let i=3*e.length;(0,s.Z)(t)&&a.Z.typeOf.number.equals("result.length","typedArray.length * 3",t.length,i);let n=e.length;(0,s.Z)(t)||(t=new Float32Array(3*n));let r=1/31,o=1/63;for(let i=0;i<n;i++){let n=e[i],a=n>>11,s=n>>5&63,l=31&n,c=3*i;t[c]=a*r,t[c+1]=s*o,t[c+2]=l*r}return t},t.Z=d},2741:function(e,t,i){"use strict";var n=i(1486),r=i(698),o=i(4572),a=i(9410),s=i(487);function l(e,t,i){this.minimum=n.Z.clone((0,o.Z)(e,n.Z.ZERO)),this.maximum=n.Z.clone((0,o.Z)(t,n.Z.ZERO)),i=(0,a.Z)(i)?n.Z.clone(i):n.Z.midpoint(this.minimum,this.maximum,new n.Z),this.center=i}l.fromCorners=function(e,t,i){return r.Z.defined("minimum",e),r.Z.defined("maximum",t),(0,a.Z)(i)||(i=new l),i.minimum=n.Z.clone(e,i.minimum),i.maximum=n.Z.clone(t,i.maximum),i.center=n.Z.midpoint(e,t,i.center),i},l.fromPoints=function(e,t){if((0,a.Z)(t)||(t=new l),!(0,a.Z)(e)||0===e.length)return t.minimum=n.Z.clone(n.Z.ZERO,t.minimum),t.maximum=n.Z.clone(n.Z.ZERO,t.maximum),t.center=n.Z.clone(n.Z.ZERO,t.center),t;let i=e[0].x,r=e[0].y,o=e[0].z,s=e[0].x,c=e[0].y,u=e[0].z,h=e.length;for(let t=1;t<h;t++){let n=e[t],a=n.x,l=n.y,h=n.z;i=Math.min(a,i),s=Math.max(a,s),r=Math.min(l,r),c=Math.max(l,c),o=Math.min(h,o),u=Math.max(h,u)}let d=t.minimum;d.x=i,d.y=r,d.z=o;let f=t.maximum;return f.x=s,f.y=c,f.z=u,t.center=n.Z.midpoint(d,f,t.center),t},l.clone=function(e,t){return(0,a.Z)(e)?(0,a.Z)(t)?(t.minimum=n.Z.clone(e.minimum,t.minimum),t.maximum=n.Z.clone(e.maximum,t.maximum),t.center=n.Z.clone(e.center,t.center),t):new l(e.minimum,e.maximum,e.center):void 0},l.equals=function(e,t){return e===t||(0,a.Z)(e)&&(0,a.Z)(t)&&n.Z.equals(e.center,t.center)&&n.Z.equals(e.minimum,t.minimum)&&n.Z.equals(e.maximum,t.maximum)};let c=new n.Z;l.intersectPlane=function(e,t){r.Z.defined("box",e),r.Z.defined("plane",t),c=n.Z.subtract(e.maximum,e.minimum,c);let i=n.Z.multiplyByScalar(c,.5,c),o=t.normal,a=i.x*Math.abs(o.x)+i.y*Math.abs(o.y)+i.z*Math.abs(o.z),l=n.Z.dot(e.center,o)+t.distance;return l-a>0?s.Z.INSIDE:l+a<0?s.Z.OUTSIDE:s.Z.INTERSECTING},l.prototype.clone=function(e){return l.clone(this,e)},l.prototype.intersectPlane=function(e){return l.intersectPlane(this,e)},l.prototype.equals=function(e){return l.equals(this,e)},t.Z=l},1373:function(e,t,i){"use strict";var n=i(570),r=i(2820),o=i(698),a=i(4572),s=i(9410),l=i(4754),c=i(487),u=i(8054);function h(e,t,i,n){this.x=(0,a.Z)(e,0),this.y=(0,a.Z)(t,0),this.width=(0,a.Z)(i,0),this.height=(0,a.Z)(n,0)}h.packedLength=4,h.pack=function(e,t,i){return o.Z.typeOf.object("value",e),o.Z.defined("array",t),i=(0,a.Z)(i,0),t[i++]=e.x,t[i++]=e.y,t[i++]=e.width,t[i]=e.height,t},h.unpack=function(e,t,i){return o.Z.defined("array",e),t=(0,a.Z)(t,0),(0,s.Z)(i)||(i=new h),i.x=e[t++],i.y=e[t++],i.width=e[t++],i.height=e[t],i},h.fromPoints=function(e,t){if((0,s.Z)(t)||(t=new h),!(0,s.Z)(e)||0===e.length)return t.x=0,t.y=0,t.width=0,t.height=0,t;let i=e.length,n=e[0].x,r=e[0].y,o=e[0].x,a=e[0].y;for(let t=1;t<i;t++){let i=e[t],s=i.x,l=i.y;n=Math.min(s,n),o=Math.max(s,o),r=Math.min(l,r),a=Math.max(l,a)}return t.x=n,t.y=r,t.width=o-n,t.height=a-r,t};let d=new l.Z,f=new r.Z,p=new r.Z;h.fromRectangle=function(e,t,i){if((0,s.Z)(i)||(i=new h),!(0,s.Z)(e))return i.x=0,i.y=0,i.width=0,i.height=0,i;let r=(t=(0,a.Z)(t,d)).project(u.Z.southwest(e,f)),o=t.project(u.Z.northeast(e,p));return n.Z.subtract(o,r,o),i.x=r.x,i.y=r.y,i.width=o.x,i.height=o.y,i},h.clone=function(e,t){return(0,s.Z)(e)?(0,s.Z)(t)?(t.x=e.x,t.y=e.y,t.width=e.width,t.height=e.height,t):new h(e.x,e.y,e.width,e.height):void 0},h.union=function(e,t,i){o.Z.typeOf.object("left",e),o.Z.typeOf.object("right",t),(0,s.Z)(i)||(i=new h);let n=Math.min(e.x,t.x),r=Math.min(e.y,t.y),a=Math.max(e.x+e.width,t.x+t.width),l=Math.max(e.y+e.height,t.y+t.height);return i.x=n,i.y=r,i.width=a-n,i.height=l-r,i},h.expand=function(e,t,i){o.Z.typeOf.object("rectangle",e),o.Z.typeOf.object("point",t),i=h.clone(e,i);let n=t.x-i.x,r=t.y-i.y;return n>i.width?i.width=n:n<0&&(i.width-=n,i.x=t.x),r>i.height?i.height=r:r<0&&(i.height-=r,i.y=t.y),i},h.intersect=function(e,t){o.Z.typeOf.object("left",e),o.Z.typeOf.object("right",t);let i=e.x,n=e.y,r=t.x,a=t.y;return i>r+t.width||i+e.width<r||n+e.height<a||n>a+t.height?c.Z.OUTSIDE:c.Z.INTERSECTING},h.equals=function(e,t){return e===t||(0,s.Z)(e)&&(0,s.Z)(t)&&e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height},h.prototype.clone=function(e){return h.clone(this,e)},h.prototype.intersect=function(e){return h.intersect(this,e)},h.prototype.equals=function(e){return h.equals(this,e)},t.Z=h},7643:function(e,t,i){"use strict";var n=i(1486),r=i(2820),o=i(698),a=i(4572),s=i(9410),l=i(1039),c=i(4754),u=i(487),h=i(2944),d=i(2150),f=i(3186),p=i(4749),m=i(8054);function _(e,t){this.center=n.Z.clone((0,a.Z)(e,n.Z.ZERO)),this.radius=(0,a.Z)(t,0)}let g=new n.Z,Z=new n.Z,y=new n.Z,b=new n.Z,v=new n.Z,T=new n.Z,E=new n.Z,x=new n.Z,w=new n.Z,S=new n.Z,C=new n.Z,A=new n.Z,I=4/3*d.Z.PI;_.fromPoints=function(e,t){let i;if((0,s.Z)(t)||(t=new _),!(0,s.Z)(e)||0===e.length)return t.center=n.Z.clone(n.Z.ZERO,t.center),t.radius=0,t;let r=n.Z.clone(e[0],E),o=n.Z.clone(r,g),a=n.Z.clone(r,Z),l=n.Z.clone(r,y),c=n.Z.clone(r,b),u=n.Z.clone(r,v),h=n.Z.clone(r,T),d=e.length;for(i=1;i<d;i++){n.Z.clone(e[i],r);let t=r.x,s=r.y,d=r.z;t<o.x&&n.Z.clone(r,o),t>c.x&&n.Z.clone(r,c),s<a.y&&n.Z.clone(r,a),s>u.y&&n.Z.clone(r,u),d<l.z&&n.Z.clone(r,l),d>h.z&&n.Z.clone(r,h)}let f=n.Z.magnitudeSquared(n.Z.subtract(c,o,x)),p=n.Z.magnitudeSquared(n.Z.subtract(u,a,x)),m=n.Z.magnitudeSquared(n.Z.subtract(h,l,x)),I=o,O=c,D=f;p>D&&(D=p,I=a,O=u),m>D&&(D=m,I=l,O=h),w.x=(I.x+O.x)*.5,w.y=(I.y+O.y)*.5,w.z=(I.z+O.z)*.5;let P=n.Z.magnitudeSquared(n.Z.subtract(O,w,x)),R=Math.sqrt(P);S.x=o.x,S.y=a.y,S.z=l.z,C.x=c.x,C.y=u.y,C.z=h.z;let N=n.Z.midpoint(S,C,A),L=0;for(i=0;i<d;i++){n.Z.clone(e[i],r);let t=n.Z.magnitude(n.Z.subtract(r,N,x));t>L&&(L=t);let o=n.Z.magnitudeSquared(n.Z.subtract(r,w,x));if(o>P){let e=Math.sqrt(o);P=(R=(R+e)*.5)*R;let t=e-R;w.x=(R*w.x+t*r.x)/e,w.y=(R*w.y+t*r.y)/e,w.z=(R*w.z+t*r.z)/e}}return R<L?(n.Z.clone(w,t.center),t.radius=R):(n.Z.clone(N,t.center),t.radius=L),t};let O=new c.Z,D=new n.Z,P=new n.Z,R=new r.Z,N=new r.Z;_.fromRectangle2D=function(e,t,i){return _.fromRectangleWithHeights2D(e,t,0,0,i)},_.fromRectangleWithHeights2D=function(e,t,i,r,o){if((0,s.Z)(o)||(o=new _),!(0,s.Z)(e))return o.center=n.Z.clone(n.Z.ZERO,o.center),o.radius=0,o;t=(0,a.Z)(t,O),m.Z.southwest(e,R),R.height=i,m.Z.northeast(e,N),N.height=r;let l=t.project(R,D),c=t.project(N,P),u=c.x-l.x,h=c.y-l.y,d=c.z-l.z;o.radius=.5*Math.sqrt(u*u+h*h+d*d);let f=o.center;return f.x=l.x+.5*u,f.y=l.y+.5*h,f.z=l.z+.5*d,o};let L=[];_.fromRectangle3D=function(e,t,i,r){if(t=(0,a.Z)(t,l.Z.WGS84),i=(0,a.Z)(i,0),(0,s.Z)(r)||(r=new _),!(0,s.Z)(e))return r.center=n.Z.clone(n.Z.ZERO,r.center),r.radius=0,r;let o=m.Z.subsample(e,t,i,L);return _.fromPoints(o,r)},_.fromVertices=function(e,t,i,r){let l;if((0,s.Z)(r)||(r=new _),!(0,s.Z)(e)||0===e.length)return r.center=n.Z.clone(n.Z.ZERO,r.center),r.radius=0,r;t=(0,a.Z)(t,n.Z.ZERO),i=(0,a.Z)(i,3),o.Z.typeOf.number.greaterThanOrEquals("stride",i,3),E.x=e[0]+t.x,E.y=e[1]+t.y,E.z=e[2]+t.z;let c=n.Z.clone(E,g),u=n.Z.clone(E,Z),h=n.Z.clone(E,y),d=n.Z.clone(E,b),f=n.Z.clone(E,v),p=n.Z.clone(E,T),m=e.length;for(l=0;l<m;l+=i){let i=e[l]+t.x,r=e[l+1]+t.y,o=e[l+2]+t.z;E.x=i,E.y=r,E.z=o,i<c.x&&n.Z.clone(E,c),i>d.x&&n.Z.clone(E,d),r<u.y&&n.Z.clone(E,u),r>f.y&&n.Z.clone(E,f),o<h.z&&n.Z.clone(E,h),o>p.z&&n.Z.clone(E,p)}let I=n.Z.magnitudeSquared(n.Z.subtract(d,c,x)),O=n.Z.magnitudeSquared(n.Z.subtract(f,u,x)),D=n.Z.magnitudeSquared(n.Z.subtract(p,h,x)),P=c,R=d,N=I;O>N&&(N=O,P=u,R=f),D>N&&(N=D,P=h,R=p),w.x=(P.x+R.x)*.5,w.y=(P.y+R.y)*.5,w.z=(P.z+R.z)*.5;let L=n.Z.magnitudeSquared(n.Z.subtract(R,w,x)),M=Math.sqrt(L);S.x=c.x,S.y=u.y,S.z=h.z,C.x=d.x,C.y=f.y,C.z=p.z;let F=n.Z.midpoint(S,C,A),z=0;for(l=0;l<m;l+=i){E.x=e[l]+t.x,E.y=e[l+1]+t.y,E.z=e[l+2]+t.z;let i=n.Z.magnitude(n.Z.subtract(E,F,x));i>z&&(z=i);let r=n.Z.magnitudeSquared(n.Z.subtract(E,w,x));if(r>L){let e=Math.sqrt(r);L=(M=(M+e)*.5)*M;let t=e-M;w.x=(M*w.x+t*E.x)/e,w.y=(M*w.y+t*E.y)/e,w.z=(M*w.z+t*E.z)/e}}return M<z?(n.Z.clone(w,r.center),r.radius=M):(n.Z.clone(F,r.center),r.radius=z),r},_.fromEncodedCartesianVertices=function(e,t,i){let r;if((0,s.Z)(i)||(i=new _),!(0,s.Z)(e)||!(0,s.Z)(t)||e.length!==t.length||0===e.length)return i.center=n.Z.clone(n.Z.ZERO,i.center),i.radius=0,i;E.x=e[0]+t[0],E.y=e[1]+t[1],E.z=e[2]+t[2];let o=n.Z.clone(E,g),a=n.Z.clone(E,Z),l=n.Z.clone(E,y),c=n.Z.clone(E,b),u=n.Z.clone(E,v),h=n.Z.clone(E,T),d=e.length;for(r=0;r<d;r+=3){let i=e[r]+t[r],s=e[r+1]+t[r+1],d=e[r+2]+t[r+2];E.x=i,E.y=s,E.z=d,i<o.x&&n.Z.clone(E,o),i>c.x&&n.Z.clone(E,c),s<a.y&&n.Z.clone(E,a),s>u.y&&n.Z.clone(E,u),d<l.z&&n.Z.clone(E,l),d>h.z&&n.Z.clone(E,h)}let f=n.Z.magnitudeSquared(n.Z.subtract(c,o,x)),p=n.Z.magnitudeSquared(n.Z.subtract(u,a,x)),m=n.Z.magnitudeSquared(n.Z.subtract(h,l,x)),I=o,O=c,D=f;p>D&&(D=p,I=a,O=u),m>D&&(D=m,I=l,O=h),w.x=(I.x+O.x)*.5,w.y=(I.y+O.y)*.5,w.z=(I.z+O.z)*.5;let P=n.Z.magnitudeSquared(n.Z.subtract(O,w,x)),R=Math.sqrt(P);S.x=o.x,S.y=a.y,S.z=l.z,C.x=c.x,C.y=u.y,C.z=h.z;let N=n.Z.midpoint(S,C,A),L=0;for(r=0;r<d;r+=3){E.x=e[r]+t[r],E.y=e[r+1]+t[r+1],E.z=e[r+2]+t[r+2];let i=n.Z.magnitude(n.Z.subtract(E,N,x));i>L&&(L=i);let o=n.Z.magnitudeSquared(n.Z.subtract(E,w,x));if(o>P){let e=Math.sqrt(o);P=(R=(R+e)*.5)*R;let t=e-R;w.x=(R*w.x+t*E.x)/e,w.y=(R*w.y+t*E.y)/e,w.z=(R*w.z+t*E.z)/e}}return R<L?(n.Z.clone(w,i.center),i.radius=R):(n.Z.clone(N,i.center),i.radius=L),i},_.fromCornerPoints=function(e,t,i){o.Z.typeOf.object("corner",e),o.Z.typeOf.object("oppositeCorner",t),(0,s.Z)(i)||(i=new _);let r=n.Z.midpoint(e,t,i.center);return i.radius=n.Z.distance(r,t),i},_.fromEllipsoid=function(e,t){return o.Z.typeOf.object("ellipsoid",e),(0,s.Z)(t)||(t=new _),n.Z.clone(n.Z.ZERO,t.center),t.radius=e.maximumRadius,t};let M=new n.Z;_.fromBoundingSpheres=function(e,t){let i;if((0,s.Z)(t)||(t=new _),!(0,s.Z)(e)||0===e.length)return t.center=n.Z.clone(n.Z.ZERO,t.center),t.radius=0,t;let r=e.length;if(1===r)return _.clone(e[0],t);if(2===r)return _.union(e[0],e[1],t);let o=[];for(i=0;i<r;i++)o.push(e[i].center);let a=(t=_.fromPoints(o,t)).center,l=t.radius;for(i=0;i<r;i++){let t=e[i];l=Math.max(l,n.Z.distance(a,t.center,M)+t.radius)}return t.radius=l,t};let F=new n.Z,z=new n.Z,B=new n.Z;_.fromOrientedBoundingBox=function(e,t){o.Z.defined("orientedBoundingBox",e),(0,s.Z)(t)||(t=new _);let i=e.halfAxes,r=f.Z.getColumn(i,0,F),a=f.Z.getColumn(i,1,z),l=f.Z.getColumn(i,2,B);return n.Z.add(r,a,r),n.Z.add(r,l,r),t.center=n.Z.clone(e.center,t.center),t.radius=n.Z.magnitude(r),t};let U=new n.Z,k=new n.Z;_.fromTransformation=function(e,t){o.Z.typeOf.object("transformation",e),(0,s.Z)(t)||(t=new _);let i=p.Z.getTranslation(e,U),r=p.Z.getScale(e,k),a=.5*n.Z.magnitude(r);return t.center=n.Z.clone(i,t.center),t.radius=a,t},_.clone=function(e,t){return(0,s.Z)(e)?(0,s.Z)(t)?(t.center=n.Z.clone(e.center,t.center),t.radius=e.radius,t):new _(e.center,e.radius):void 0},_.packedLength=4,_.pack=function(e,t,i){o.Z.typeOf.object("value",e),o.Z.defined("array",t),i=(0,a.Z)(i,0);let n=e.center;return t[i++]=n.x,t[i++]=n.y,t[i++]=n.z,t[i]=e.radius,t},_.unpack=function(e,t,i){o.Z.defined("array",e),t=(0,a.Z)(t,0),(0,s.Z)(i)||(i=new _);let n=i.center;return n.x=e[t++],n.y=e[t++],n.z=e[t++],i.radius=e[t],i};let V=new n.Z,H=new n.Z;_.union=function(e,t,i){o.Z.typeOf.object("left",e),o.Z.typeOf.object("right",t),(0,s.Z)(i)||(i=new _);let r=e.center,a=e.radius,l=t.center,c=t.radius,u=n.Z.subtract(l,r,V),h=n.Z.magnitude(u);if(a>=h+c)return e.clone(i),i;if(c>=h+a)return t.clone(i),i;let d=(a+h+c)*.5,f=n.Z.multiplyByScalar(u,(-a+d)/h,H);return n.Z.add(f,r,f),n.Z.clone(f,i.center),i.radius=d,i};let G=new n.Z;_.expand=function(e,t,i){o.Z.typeOf.object("sphere",e),o.Z.typeOf.object("point",t),i=_.clone(e,i);let r=n.Z.magnitude(n.Z.subtract(t,i.center,G));return r>i.radius&&(i.radius=r),i},_.intersectPlane=function(e,t){o.Z.typeOf.object("sphere",e),o.Z.typeOf.object("plane",t);let i=e.center,r=e.radius,a=t.normal,s=n.Z.dot(a,i)+t.distance;return s<-r?u.Z.OUTSIDE:s<r?u.Z.INTERSECTING:u.Z.INSIDE},_.transform=function(e,t,i){return o.Z.typeOf.object("sphere",e),o.Z.typeOf.object("transform",t),(0,s.Z)(i)||(i=new _),i.center=p.Z.multiplyByPoint(t,e.center,i.center),i.radius=p.Z.getMaximumScale(t)*e.radius,i};let j=new n.Z;_.distanceSquaredTo=function(e,t){o.Z.typeOf.object("sphere",e),o.Z.typeOf.object("cartesian",t);let i=n.Z.subtract(e.center,t,j),r=n.Z.magnitude(i)-e.radius;return r<=0?0:r*r},_.transformWithoutScale=function(e,t,i){return o.Z.typeOf.object("sphere",e),o.Z.typeOf.object("transform",t),(0,s.Z)(i)||(i=new _),i.center=p.Z.multiplyByPoint(t,e.center,i.center),i.radius=e.radius,i};let W=new n.Z;_.computePlaneDistances=function(e,t,i,r){o.Z.typeOf.object("sphere",e),o.Z.typeOf.object("position",t),o.Z.typeOf.object("direction",i),(0,s.Z)(r)||(r=new h.Z);let a=n.Z.subtract(e.center,t,W),l=n.Z.dot(i,a);return r.start=l-e.radius,r.stop=l+e.radius,r};let q=new n.Z,Y=new n.Z,X=new n.Z,$=new n.Z,K=new n.Z,Q=new r.Z,J=Array(8);for(let e=0;e<8;++e)J[e]=new n.Z;let ee=new c.Z;_.projectTo2D=function(e,t,i){let r;o.Z.typeOf.object("sphere",e);let s=(t=(0,a.Z)(t,ee)).ellipsoid,l=e.center,c=e.radius;r=n.Z.equals(l,n.Z.ZERO)?n.Z.clone(n.Z.UNIT_X,q):s.geodeticSurfaceNormal(l,q);let u=n.Z.cross(n.Z.UNIT_Z,r,Y);n.Z.normalize(u,u);let h=n.Z.cross(r,u,X);n.Z.normalize(h,h),n.Z.multiplyByScalar(r,c,r),n.Z.multiplyByScalar(h,c,h),n.Z.multiplyByScalar(u,c,u);let d=n.Z.negate(h,K),f=n.Z.negate(u,$),p=J[0];n.Z.add(r,h,p),n.Z.add(p,u,p),p=J[1],n.Z.add(r,h,p),n.Z.add(p,f,p),p=J[2],n.Z.add(r,d,p),n.Z.add(p,f,p),p=J[3],n.Z.add(r,d,p),n.Z.add(p,u,p),n.Z.negate(r,r),p=J[4],n.Z.add(r,h,p),n.Z.add(p,u,p),p=J[5],n.Z.add(r,h,p),n.Z.add(p,f,p),p=J[6],n.Z.add(r,d,p),n.Z.add(p,f,p),p=J[7],n.Z.add(r,d,p),n.Z.add(p,u,p);let m=J.length;for(let e=0;e<m;++e){let i=J[e];n.Z.add(l,i,i);let r=s.cartesianToCartographic(i,Q);t.project(r,i)}let g=(l=(i=_.fromPoints(J,i)).center).x,Z=l.y,y=l.z;return l.x=y,l.y=g,l.z=Z,i},_.isOccluded=function(e,t){return o.Z.typeOf.object("sphere",e),o.Z.typeOf.object("occluder",t),!t.isBoundingSphereVisible(e)},_.equals=function(e,t){return e===t||(0,s.Z)(e)&&(0,s.Z)(t)&&n.Z.equals(e.center,t.center)&&e.radius===t.radius},_.prototype.intersectPlane=function(e){return _.intersectPlane(this,e)},_.prototype.distanceSquaredTo=function(e){return _.distanceSquaredTo(this,e)},_.prototype.computePlaneDistances=function(e,t,i){return _.computePlaneDistances(this,e,t,i)},_.prototype.isOccluded=function(e){return _.isOccluded(this,e)},_.prototype.equals=function(e){return _.equals(this,e)},_.prototype.clone=function(e){return _.clone(this,e)},_.prototype.volume=function(){let e=this.radius;return I*e*e*e},t.Z=_},9439:function(e,t,i){"use strict";let n;var r=i(7643),o=i(1486),a=i(698),s=i(7559),l=i(4572),c=i(9410),u=i(9824),h=i(3086),d=i(2601),f=i(258),p=i(2246),m=i(5022),_=i(4915);let g=new o.Z;function Z(e){let t=(e=(0,l.Z)(e,l.Z.EMPTY_OBJECT)).minimum,i=e.maximum;if(a.Z.typeOf.object("min",t),a.Z.typeOf.object("max",i),(0,c.Z)(e.offsetAttribute)&&e.offsetAttribute===p.Z.TOP)throw new u.Z("GeometryOffsetAttribute.TOP is not a supported options.offsetAttribute for this geometry.");let n=(0,l.Z)(e.vertexFormat,_.Z.DEFAULT);this._minimum=o.Z.clone(t),this._maximum=o.Z.clone(i),this._vertexFormat=n,this._offsetAttribute=e.offsetAttribute,this._workerName="createBoxGeometry"}Z.fromDimensions=function(e){let t=(e=(0,l.Z)(e,l.Z.EMPTY_OBJECT)).dimensions;a.Z.typeOf.object("dimensions",t),a.Z.typeOf.number.greaterThanOrEquals("dimensions.x",t.x,0),a.Z.typeOf.number.greaterThanOrEquals("dimensions.y",t.y,0),a.Z.typeOf.number.greaterThanOrEquals("dimensions.z",t.z,0);let i=o.Z.multiplyByScalar(t,.5,new o.Z);return new Z({minimum:o.Z.negate(i,new o.Z),maximum:i,vertexFormat:e.vertexFormat,offsetAttribute:e.offsetAttribute})},Z.fromAxisAlignedBoundingBox=function(e){return a.Z.typeOf.object("boundingBox",e),new Z({minimum:e.minimum,maximum:e.maximum})},Z.packedLength=2*o.Z.packedLength+_.Z.packedLength+1,Z.pack=function(e,t,i){return a.Z.typeOf.object("value",e),a.Z.defined("array",t),i=(0,l.Z)(i,0),o.Z.pack(e._minimum,t,i),o.Z.pack(e._maximum,t,i+o.Z.packedLength),_.Z.pack(e._vertexFormat,t,i+2*o.Z.packedLength),t[i+2*o.Z.packedLength+_.Z.packedLength]=(0,l.Z)(e._offsetAttribute,-1),t};let y=new o.Z,b=new o.Z,v=new _.Z,T={minimum:y,maximum:b,vertexFormat:v,offsetAttribute:void 0};Z.unpack=function(e,t,i){a.Z.defined("array",e),t=(0,l.Z)(t,0);let n=o.Z.unpack(e,t,y),r=o.Z.unpack(e,t+o.Z.packedLength,b),s=_.Z.unpack(e,t+2*o.Z.packedLength,v),u=e[t+2*o.Z.packedLength+_.Z.packedLength];return(0,c.Z)(i)?(i._minimum=o.Z.clone(n,i._minimum),i._maximum=o.Z.clone(r,i._maximum),i._vertexFormat=_.Z.clone(s,i._vertexFormat),i._offsetAttribute=-1===u?void 0:u,i):(T.offsetAttribute=-1===u?void 0:u,new Z(T))},Z.createGeometry=function(e){let t,i;let n=e._minimum,a=e._maximum,l=e._vertexFormat;if(o.Z.equals(n,a))return;let u=new f.Z;if(l.position&&(l.st||l.normal||l.tangent||l.bitangent)){if(l.position&&((i=new Float64Array(72))[0]=n.x,i[1]=n.y,i[2]=a.z,i[3]=a.x,i[4]=n.y,i[5]=a.z,i[6]=a.x,i[7]=a.y,i[8]=a.z,i[9]=n.x,i[10]=a.y,i[11]=a.z,i[12]=n.x,i[13]=n.y,i[14]=n.z,i[15]=a.x,i[16]=n.y,i[17]=n.z,i[18]=a.x,i[19]=a.y,i[20]=n.z,i[21]=n.x,i[22]=a.y,i[23]=n.z,i[24]=a.x,i[25]=n.y,i[26]=n.z,i[27]=a.x,i[28]=a.y,i[29]=n.z,i[30]=a.x,i[31]=a.y,i[32]=a.z,i[33]=a.x,i[34]=n.y,i[35]=a.z,i[36]=n.x,i[37]=n.y,i[38]=n.z,i[39]=n.x,i[40]=a.y,i[41]=n.z,i[42]=n.x,i[43]=a.y,i[44]=a.z,i[45]=n.x,i[46]=n.y,i[47]=a.z,i[48]=n.x,i[49]=a.y,i[50]=n.z,i[51]=a.x,i[52]=a.y,i[53]=n.z,i[54]=a.x,i[55]=a.y,i[56]=a.z,i[57]=n.x,i[58]=a.y,i[59]=a.z,i[60]=n.x,i[61]=n.y,i[62]=n.z,i[63]=a.x,i[64]=n.y,i[65]=n.z,i[66]=a.x,i[67]=n.y,i[68]=a.z,i[69]=n.x,i[70]=n.y,i[71]=a.z,u.position=new d.Z({componentDatatype:s.Z.DOUBLE,componentsPerAttribute:3,values:i})),l.normal){let e=new Float32Array(72);e[0]=0,e[1]=0,e[2]=1,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=1,e[9]=0,e[10]=0,e[11]=1,e[12]=0,e[13]=0,e[14]=-1,e[15]=0,e[16]=0,e[17]=-1,e[18]=0,e[19]=0,e[20]=-1,e[21]=0,e[22]=0,e[23]=-1,e[24]=1,e[25]=0,e[26]=0,e[27]=1,e[28]=0,e[29]=0,e[30]=1,e[31]=0,e[32]=0,e[33]=1,e[34]=0,e[35]=0,e[36]=-1,e[37]=0,e[38]=0,e[39]=-1,e[40]=0,e[41]=0,e[42]=-1,e[43]=0,e[44]=0,e[45]=-1,e[46]=0,e[47]=0,e[48]=0,e[49]=1,e[50]=0,e[51]=0,e[52]=1,e[53]=0,e[54]=0,e[55]=1,e[56]=0,e[57]=0,e[58]=1,e[59]=0,e[60]=0,e[61]=-1,e[62]=0,e[63]=0,e[64]=-1,e[65]=0,e[66]=0,e[67]=-1,e[68]=0,e[69]=0,e[70]=-1,e[71]=0,u.normal=new d.Z({componentDatatype:s.Z.FLOAT,componentsPerAttribute:3,values:e})}if(l.st){let e=new Float32Array(48);e[0]=0,e[1]=0,e[2]=1,e[3]=0,e[4]=1,e[5]=1,e[6]=0,e[7]=1,e[8]=1,e[9]=0,e[10]=0,e[11]=0,e[12]=0,e[13]=1,e[14]=1,e[15]=1,e[16]=0,e[17]=0,e[18]=1,e[19]=0,e[20]=1,e[21]=1,e[22]=0,e[23]=1,e[24]=1,e[25]=0,e[26]=0,e[27]=0,e[28]=0,e[29]=1,e[30]=1,e[31]=1,e[32]=1,e[33]=0,e[34]=0,e[35]=0,e[36]=0,e[37]=1,e[38]=1,e[39]=1,e[40]=0,e[41]=0,e[42]=1,e[43]=0,e[44]=1,e[45]=1,e[46]=0,e[47]=1,u.st=new d.Z({componentDatatype:s.Z.FLOAT,componentsPerAttribute:2,values:e})}if(l.tangent){let e=new Float32Array(72);e[0]=1,e[1]=0,e[2]=0,e[3]=1,e[4]=0,e[5]=0,e[6]=1,e[7]=0,e[8]=0,e[9]=1,e[10]=0,e[11]=0,e[12]=-1,e[13]=0,e[14]=0,e[15]=-1,e[16]=0,e[17]=0,e[18]=-1,e[19]=0,e[20]=0,e[21]=-1,e[22]=0,e[23]=0,e[24]=0,e[25]=1,e[26]=0,e[27]=0,e[28]=1,e[29]=0,e[30]=0,e[31]=1,e[32]=0,e[33]=0,e[34]=1,e[35]=0,e[36]=0,e[37]=-1,e[38]=0,e[39]=0,e[40]=-1,e[41]=0,e[42]=0,e[43]=-1,e[44]=0,e[45]=0,e[46]=-1,e[47]=0,e[48]=-1,e[49]=0,e[50]=0,e[51]=-1,e[52]=0,e[53]=0,e[54]=-1,e[55]=0,e[56]=0,e[57]=-1,e[58]=0,e[59]=0,e[60]=1,e[61]=0,e[62]=0,e[63]=1,e[64]=0,e[65]=0,e[66]=1,e[67]=0,e[68]=0,e[69]=1,e[70]=0,e[71]=0,u.tangent=new d.Z({componentDatatype:s.Z.FLOAT,componentsPerAttribute:3,values:e})}if(l.bitangent){let e=new Float32Array(72);e[0]=0,e[1]=1,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=0,e[7]=1,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=1,e[14]=0,e[15]=0,e[16]=1,e[17]=0,e[18]=0,e[19]=1,e[20]=0,e[21]=0,e[22]=1,e[23]=0,e[24]=0,e[25]=0,e[26]=1,e[27]=0,e[28]=0,e[29]=1,e[30]=0,e[31]=0,e[32]=1,e[33]=0,e[34]=0,e[35]=1,e[36]=0,e[37]=0,e[38]=1,e[39]=0,e[40]=0,e[41]=1,e[42]=0,e[43]=0,e[44]=1,e[45]=0,e[46]=0,e[47]=1,e[48]=0,e[49]=0,e[50]=1,e[51]=0,e[52]=0,e[53]=1,e[54]=0,e[55]=0,e[56]=1,e[57]=0,e[58]=0,e[59]=1,e[60]=0,e[61]=0,e[62]=1,e[63]=0,e[64]=0,e[65]=1,e[66]=0,e[67]=0,e[68]=1,e[69]=0,e[70]=0,e[71]=1,u.bitangent=new d.Z({componentDatatype:s.Z.FLOAT,componentsPerAttribute:3,values:e})}(t=new Uint16Array(36))[0]=0,t[1]=1,t[2]=2,t[3]=0,t[4]=2,t[5]=3,t[6]=6,t[7]=5,t[8]=4,t[9]=7,t[10]=6,t[11]=4,t[12]=8,t[13]=9,t[14]=10,t[15]=8,t[16]=10,t[17]=11,t[18]=14,t[19]=13,t[20]=12,t[21]=15,t[22]=14,t[23]=12,t[24]=18,t[25]=17,t[26]=16,t[27]=19,t[28]=18,t[29]=16,t[30]=20,t[31]=21,t[32]=22,t[33]=20,t[34]=22,t[35]=23}else(i=new Float64Array(24))[0]=n.x,i[1]=n.y,i[2]=n.z,i[3]=a.x,i[4]=n.y,i[5]=n.z,i[6]=a.x,i[7]=a.y,i[8]=n.z,i[9]=n.x,i[10]=a.y,i[11]=n.z,i[12]=n.x,i[13]=n.y,i[14]=a.z,i[15]=a.x,i[16]=n.y,i[17]=a.z,i[18]=a.x,i[19]=a.y,i[20]=a.z,i[21]=n.x,i[22]=a.y,i[23]=a.z,u.position=new d.Z({componentDatatype:s.Z.DOUBLE,componentsPerAttribute:3,values:i}),(t=new Uint16Array(36))[0]=4,t[1]=5,t[2]=6,t[3]=4,t[4]=6,t[5]=7,t[6]=1,t[7]=0,t[8]=3,t[9]=1,t[10]=3,t[11]=2,t[12]=1,t[13]=6,t[14]=5,t[15]=1,t[16]=2,t[17]=6,t[18]=2,t[19]=3,t[20]=7,t[21]=2,t[22]=7,t[23]=6,t[24]=3,t[25]=0,t[26]=4,t[27]=3,t[28]=4,t[29]=7,t[30]=0,t[31]=1,t[32]=5,t[33]=0,t[34]=5,t[35]=4;let _=o.Z.subtract(a,n,g),Z=.5*o.Z.magnitude(_);if((0,c.Z)(e._offsetAttribute)){let t=i.length,n=e._offsetAttribute===p.Z.NONE?0:1,r=new Uint8Array(t/3).fill(n);u.applyOffset=new d.Z({componentDatatype:s.Z.UNSIGNED_BYTE,componentsPerAttribute:1,values:r})}return new h.Z({attributes:u,indices:t,primitiveType:m.Z.TRIANGLES,boundingSphere:new r.Z(o.Z.ZERO,Z),offsetAttribute:e._offsetAttribute})},Z.getUnitBox=function(){return(0,c.Z)(n)||(n=Z.createGeometry(Z.fromDimensions({dimensions:new o.Z(1,1,1),vertexFormat:_.Z.POSITION_ONLY}))),n},t.Z=Z},9054:function(e,t,i){"use strict";var n=i(7643),r=i(1486),o=i(698),a=i(7559),s=i(4572),l=i(9410),c=i(9824),u=i(3086),h=i(2601),d=i(258),f=i(2246),p=i(5022);let m=new r.Z;function _(e){let t=(e=(0,s.Z)(e,s.Z.EMPTY_OBJECT)).minimum,i=e.maximum;if(o.Z.typeOf.object("min",t),o.Z.typeOf.object("max",i),(0,l.Z)(e.offsetAttribute)&&e.offsetAttribute===f.Z.TOP)throw new c.Z("GeometryOffsetAttribute.TOP is not a supported options.offsetAttribute for this geometry.");this._min=r.Z.clone(t),this._max=r.Z.clone(i),this._offsetAttribute=e.offsetAttribute,this._workerName="createBoxOutlineGeometry"}_.fromDimensions=function(e){let t=(e=(0,s.Z)(e,s.Z.EMPTY_OBJECT)).dimensions;o.Z.typeOf.object("dimensions",t),o.Z.typeOf.number.greaterThanOrEquals("dimensions.x",t.x,0),o.Z.typeOf.number.greaterThanOrEquals("dimensions.y",t.y,0),o.Z.typeOf.number.greaterThanOrEquals("dimensions.z",t.z,0);let i=r.Z.multiplyByScalar(t,.5,new r.Z);return new _({minimum:r.Z.negate(i,new r.Z),maximum:i,offsetAttribute:e.offsetAttribute})},_.fromAxisAlignedBoundingBox=function(e){return o.Z.typeOf.object("boundindBox",e),new _({minimum:e.minimum,maximum:e.maximum})},_.packedLength=2*r.Z.packedLength+1,_.pack=function(e,t,i){return o.Z.typeOf.object("value",e),o.Z.defined("array",t),i=(0,s.Z)(i,0),r.Z.pack(e._min,t,i),r.Z.pack(e._max,t,i+r.Z.packedLength),t[i+2*r.Z.packedLength]=(0,s.Z)(e._offsetAttribute,-1),t};let g=new r.Z,Z=new r.Z,y={minimum:g,maximum:Z,offsetAttribute:void 0};_.unpack=function(e,t,i){o.Z.defined("array",e),t=(0,s.Z)(t,0);let n=r.Z.unpack(e,t,g),a=r.Z.unpack(e,t+r.Z.packedLength,Z),c=e[t+2*r.Z.packedLength];return(0,l.Z)(i)?(i._min=r.Z.clone(n,i._min),i._max=r.Z.clone(a,i._max),i._offsetAttribute=-1===c?void 0:c,i):(y.offsetAttribute=-1===c?void 0:c,new _(y))},_.createGeometry=function(e){let t=e._min,i=e._max;if(r.Z.equals(t,i))return;let o=new d.Z,s=new Uint16Array(24),c=new Float64Array(24);c[0]=t.x,c[1]=t.y,c[2]=t.z,c[3]=i.x,c[4]=t.y,c[5]=t.z,c[6]=i.x,c[7]=i.y,c[8]=t.z,c[9]=t.x,c[10]=i.y,c[11]=t.z,c[12]=t.x,c[13]=t.y,c[14]=i.z,c[15]=i.x,c[16]=t.y,c[17]=i.z,c[18]=i.x,c[19]=i.y,c[20]=i.z,c[21]=t.x,c[22]=i.y,c[23]=i.z,o.position=new h.Z({componentDatatype:a.Z.DOUBLE,componentsPerAttribute:3,values:c}),s[0]=4,s[1]=5,s[2]=5,s[3]=6,s[4]=6,s[5]=7,s[6]=7,s[7]=4,s[8]=0,s[9]=1,s[10]=1,s[11]=2,s[12]=2,s[13]=3,s[14]=3,s[15]=0,s[16]=0,s[17]=4,s[18]=1,s[19]=5,s[20]=2,s[21]=6,s[22]=3,s[23]=7;let _=r.Z.subtract(i,t,m),g=.5*r.Z.magnitude(_);if((0,l.Z)(e._offsetAttribute)){let t=c.length,i=e._offsetAttribute===f.Z.NONE?0:1,n=new Uint8Array(t/3).fill(i);o.applyOffset=new h.Z({componentDatatype:a.Z.UNSIGNED_BYTE,componentsPerAttribute:1,values:n})}return new u.Z({attributes:o,indices:s,primitiveType:p.Z.LINES,boundingSphere:new n.Z(r.Z.ZERO,g),offsetAttribute:e._offsetAttribute})},t.Z=_},570:function(e,t,i){"use strict";var n=i(698),r=i(4572),o=i(9410),a=i(9824),s=i(2150);function l(e,t){this.x=(0,r.Z)(e,0),this.y=(0,r.Z)(t,0)}l.fromElements=function(e,t,i){return(0,o.Z)(i)?(i.x=e,i.y=t,i):new l(e,t)},l.clone=function(e,t){return(0,o.Z)(e)?(0,o.Z)(t)?(t.x=e.x,t.y=e.y,t):new l(e.x,e.y):void 0},l.fromCartesian3=l.clone,l.fromCartesian4=l.clone,l.packedLength=2,l.pack=function(e,t,i){return n.Z.typeOf.object("value",e),n.Z.defined("array",t),i=(0,r.Z)(i,0),t[i++]=e.x,t[i]=e.y,t},l.unpack=function(e,t,i){return n.Z.defined("array",e),t=(0,r.Z)(t,0),(0,o.Z)(i)||(i=new l),i.x=e[t++],i.y=e[t],i},l.packArray=function(e,t){n.Z.defined("array",e);let i=e.length,r=2*i;if((0,o.Z)(t)){if(Array.isArray(t)||t.length===r)t.length!==r&&(t.length=r);else throw new a.Z("If result is a typed array, it must have exactly array.length * 2 elements")}else t=Array(r);for(let n=0;n<i;++n)l.pack(e[n],t,2*n);return t},l.unpackArray=function(e,t){if(n.Z.defined("array",e),n.Z.typeOf.number.greaterThanOrEquals("array.length",e.length,2),e.length%2!=0)throw new a.Z("array length must be a multiple of 2.");let i=e.length;(0,o.Z)(t)?t.length=i/2:t=Array(i/2);for(let n=0;n<i;n+=2){let i=n/2;t[i]=l.unpack(e,n,t[i])}return t},l.fromArray=l.unpack,l.maximumComponent=function(e){return n.Z.typeOf.object("cartesian",e),Math.max(e.x,e.y)},l.minimumComponent=function(e){return n.Z.typeOf.object("cartesian",e),Math.min(e.x,e.y)},l.minimumByComponent=function(e,t,i){return n.Z.typeOf.object("first",e),n.Z.typeOf.object("second",t),n.Z.typeOf.object("result",i),i.x=Math.min(e.x,t.x),i.y=Math.min(e.y,t.y),i},l.maximumByComponent=function(e,t,i){return n.Z.typeOf.object("first",e),n.Z.typeOf.object("second",t),n.Z.typeOf.object("result",i),i.x=Math.max(e.x,t.x),i.y=Math.max(e.y,t.y),i},l.clamp=function(e,t,i,r){n.Z.typeOf.object("value",e),n.Z.typeOf.object("min",t),n.Z.typeOf.object("max",i),n.Z.typeOf.object("result",r);let o=s.Z.clamp(e.x,t.x,i.x),a=s.Z.clamp(e.y,t.y,i.y);return r.x=o,r.y=a,r},l.magnitudeSquared=function(e){return n.Z.typeOf.object("cartesian",e),e.x*e.x+e.y*e.y},l.magnitude=function(e){return Math.sqrt(l.magnitudeSquared(e))};let c=new l;l.distance=function(e,t){return n.Z.typeOf.object("left",e),n.Z.typeOf.object("right",t),l.subtract(e,t,c),l.magnitude(c)},l.distanceSquared=function(e,t){return n.Z.typeOf.object("left",e),n.Z.typeOf.object("right",t),l.subtract(e,t,c),l.magnitudeSquared(c)},l.normalize=function(e,t){n.Z.typeOf.object("cartesian",e),n.Z.typeOf.object("result",t);let i=l.magnitude(e);if(t.x=e.x/i,t.y=e.y/i,isNaN(t.x)||isNaN(t.y))throw new a.Z("normalized result is not a number");return t},l.dot=function(e,t){return n.Z.typeOf.object("left",e),n.Z.typeOf.object("right",t),e.x*t.x+e.y*t.y},l.cross=function(e,t){return n.Z.typeOf.object("left",e),n.Z.typeOf.object("right",t),e.x*t.y-e.y*t.x},l.multiplyComponents=function(e,t,i){return n.Z.typeOf.object("left",e),n.Z.typeOf.object("right",t),n.Z.typeOf.object("result",i),i.x=e.x*t.x,i.y=e.y*t.y,i},l.divideComponents=function(e,t,i){return n.Z.typeOf.object("left",e),n.Z.typeOf.object("right",t),n.Z.typeOf.object("result",i),i.x=e.x/t.x,i.y=e.y/t.y,i},l.add=function(e,t,i){return n.Z.typeOf.object("left",e),n.Z.typeOf.object("right",t),n.Z.typeOf.object("result",i),i.x=e.x+t.x,i.y=e.y+t.y,i},l.subtract=function(e,t,i){return n.Z.typeOf.object("left",e),n.Z.typeOf.object("right",t),n.Z.typeOf.object("result",i),i.x=e.x-t.x,i.y=e.y-t.y,i},l.multiplyByScalar=function(e,t,i){return n.Z.typeOf.object("cartesian",e),n.Z.typeOf.number("scalar",t),n.Z.typeOf.object("result",i),i.x=e.x*t,i.y=e.y*t,i},l.divideByScalar=function(e,t,i){return n.Z.typeOf.object("cartesian",e),n.Z.typeOf.number("scalar",t),n.Z.typeOf.object("result",i),i.x=e.x/t,i.y=e.y/t,i},l.negate=function(e,t){return n.Z.typeOf.object("cartesian",e),n.Z.typeOf.object("result",t),t.x=-e.x,t.y=-e.y,t},l.abs=function(e,t){return n.Z.typeOf.object("cartesian",e),n.Z.typeOf.object("result",t),t.x=Math.abs(e.x),t.y=Math.abs(e.y),t};let u=new l;l.lerp=function(e,t,i,r){return n.Z.typeOf.object("start",e),n.Z.typeOf.object("end",t),n.Z.typeOf.number("t",i),n.Z.typeOf.object("result",r),l.multiplyByScalar(t,i,u),r=l.multiplyByScalar(e,1-i,r),l.add(u,r,r)};let h=new l,d=new l;l.angleBetween=function(e,t){return n.Z.typeOf.object("left",e),n.Z.typeOf.object("right",t),l.normalize(e,h),l.normalize(t,d),s.Z.acosClamped(l.dot(h,d))};let f=new l;l.mostOrthogonalAxis=function(e,t){n.Z.typeOf.object("cartesian",e),n.Z.typeOf.object("result",t);let i=l.normalize(e,f);return l.abs(i,i),t=i.x<=i.y?l.clone(l.UNIT_X,t):l.clone(l.UNIT_Y,t)},l.equals=function(e,t){return e===t||(0,o.Z)(e)&&(0,o.Z)(t)&&e.x===t.x&&e.y===t.y},l.equalsArray=function(e,t,i){return e.x===t[i]&&e.y===t[i+1]},l.equalsEpsilon=function(e,t,i,n){return e===t||(0,o.Z)(e)&&(0,o.Z)(t)&&s.Z.equalsEpsilon(e.x,t.x,i,n)&&s.Z.equalsEpsilon(e.y,t.y,i,n)},l.ZERO=Object.freeze(new l(0,0)),l.ONE=Object.freeze(new l(1,1)),l.UNIT_X=Object.freeze(new l(1,0)),l.UNIT_Y=Object.freeze(new l(0,1)),l.prototype.clone=function(e){return l.clone(this,e)},l.prototype.equals=function(e){return l.equals(this,e)},l.prototype.equalsEpsilon=function(e,t,i){return l.equalsEpsilon(this,e,t,i)},l.prototype.toString=function(){return`(${this.x}, ${this.y})`},t.Z=l},1486:function(e,t,i){"use strict";var n=i(698),r=i(4572),o=i(9410),a=i(9824),s=i(2150);function l(e,t,i){this.x=(0,r.Z)(e,0),this.y=(0,r.Z)(t,0),this.z=(0,r.Z)(i,0)}l.fromSpherical=function(e,t){n.Z.typeOf.object("spherical",e),(0,o.Z)(t)||(t=new l);let i=e.clock,a=e.cone,s=(0,r.Z)(e.magnitude,1),c=s*Math.sin(a);return t.x=c*Math.cos(i),t.y=c*Math.sin(i),t.z=s*Math.cos(a),t},l.fromElements=function(e,t,i,n){return(0,o.Z)(n)?(n.x=e,n.y=t,n.z=i,n):new l(e,t,i)},l.clone=function(e,t){return(0,o.Z)(e)?(0,o.Z)(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t):new l(e.x,e.y,e.z):void 0},l.fromCartesian4=l.clone,l.packedLength=3,l.pack=function(e,t,i){return n.Z.typeOf.object("value",e),n.Z.defined("array",t),i=(0,r.Z)(i,0),t[i++]=e.x,t[i++]=e.y,t[i]=e.z,t},l.unpack=function(e,t,i){return n.Z.defined("array",e),t=(0,r.Z)(t,0),(0,o.Z)(i)||(i=new l),i.x=e[t++],i.y=e[t++],i.z=e[t],i},l.packArray=function(e,t){n.Z.defined("array",e);let i=e.length,r=3*i;if((0,o.Z)(t)){if(Array.isArray(t)||t.length===r)t.length!==r&&(t.length=r);else throw new a.Z("If result is a typed array, it must have exactly array.length * 3 elements")}else t=Array(r);for(let n=0;n<i;++n)l.pack(e[n],t,3*n);return t},l.unpackArray=function(e,t){if(n.Z.defined("array",e),n.Z.typeOf.number.greaterThanOrEquals("array.length",e.length,3),e.length%3!=0)throw new a.Z("array length must be a multiple of 3.");let i=e.length;(0,o.Z)(t)?t.length=i/3:t=Array(i/3);for(let n=0;n<i;n+=3){let i=n/3;t[i]=l.unpack(e,n,t[i])}return t},l.fromArray=l.unpack,l.maximumComponent=function(e){return n.Z.typeOf.object("cartesian",e),Math.max(e.x,e.y,e.z)},l.minimumComponent=function(e){return n.Z.typeOf.object("cartesian",e),Math.min(e.x,e.y,e.z)},l.minimumByComponent=function(e,t,i){return n.Z.typeOf.object("first",e),n.Z.typeOf.object("second",t),n.Z.typeOf.object("result",i),i.x=Math.min(e.x,t.x),i.y=Math.min(e.y,t.y),i.z=Math.min(e.z,t.z),i},l.maximumByComponent=function(e,t,i){return n.Z.typeOf.object("first",e),n.Z.typeOf.object("second",t),n.Z.typeOf.object("result",i),i.x=Math.max(e.x,t.x),i.y=Math.max(e.y,t.y),i.z=Math.max(e.z,t.z),i},l.clamp=function(e,t,i,r){n.Z.typeOf.object("value",e),n.Z.typeOf.object("min",t),n.Z.typeOf.object("max",i),n.Z.typeOf.object("result",r);let o=s.Z.clamp(e.x,t.x,i.x),a=s.Z.clamp(e.y,t.y,i.y),l=s.Z.clamp(e.z,t.z,i.z);return r.x=o,r.y=a,r.z=l,r},l.magnitudeSquared=function(e){return n.Z.typeOf.object("cartesian",e),e.x*e.x+e.y*e.y+e.z*e.z},l.magnitude=function(e){return Math.sqrt(l.magnitudeSquared(e))};let c=new l;l.distance=function(e,t){return n.Z.typeOf.object("left",e),n.Z.typeOf.object("right",t),l.subtract(e,t,c),l.magnitude(c)},l.distanceSquared=function(e,t){return n.Z.typeOf.object("left",e),n.Z.typeOf.object("right",t),l.subtract(e,t,c),l.magnitudeSquared(c)},l.normalize=function(e,t){n.Z.typeOf.object("cartesian",e),n.Z.typeOf.object("result",t);let i=l.magnitude(e);if(t.x=e.x/i,t.y=e.y/i,t.z=e.z/i,isNaN(t.x)||isNaN(t.y)||isNaN(t.z))throw new a.Z("normalized result is not a number");return t},l.dot=function(e,t){return n.Z.typeOf.object("left",e),n.Z.typeOf.object("right",t),e.x*t.x+e.y*t.y+e.z*t.z},l.multiplyComponents=function(e,t,i){return n.Z.typeOf.object("left",e),n.Z.typeOf.object("right",t),n.Z.typeOf.object("result",i),i.x=e.x*t.x,i.y=e.y*t.y,i.z=e.z*t.z,i},l.divideComponents=function(e,t,i){return n.Z.typeOf.object("left",e),n.Z.typeOf.object("right",t),n.Z.typeOf.object("result",i),i.x=e.x/t.x,i.y=e.y/t.y,i.z=e.z/t.z,i},l.add=function(e,t,i){return n.Z.typeOf.object("left",e),n.Z.typeOf.object("right",t),n.Z.typeOf.object("result",i),i.x=e.x+t.x,i.y=e.y+t.y,i.z=e.z+t.z,i},l.subtract=function(e,t,i){return n.Z.typeOf.object("left",e),n.Z.typeOf.object("right",t),n.Z.typeOf.object("result",i),i.x=e.x-t.x,i.y=e.y-t.y,i.z=e.z-t.z,i},l.multiplyByScalar=function(e,t,i){return n.Z.typeOf.object("cartesian",e),n.Z.typeOf.number("scalar",t),n.Z.typeOf.object("result",i),i.x=e.x*t,i.y=e.y*t,i.z=e.z*t,i},l.divideByScalar=function(e,t,i){return n.Z.typeOf.object("cartesian",e),n.Z.typeOf.number("scalar",t),n.Z.typeOf.object("result",i),i.x=e.x/t,i.y=e.y/t,i.z=e.z/t,i},l.negate=function(e,t){return n.Z.typeOf.object("cartesian",e),n.Z.typeOf.object("result",t),t.x=-e.x,t.y=-e.y,t.z=-e.z,t},l.abs=function(e,t){return n.Z.typeOf.object("cartesian",e),n.Z.typeOf.object("result",t),t.x=Math.abs(e.x),t.y=Math.abs(e.y),t.z=Math.abs(e.z),t};let u=new l;l.lerp=function(e,t,i,r){return n.Z.typeOf.object("start",e),n.Z.typeOf.object("end",t),n.Z.typeOf.number("t",i),n.Z.typeOf.object("result",r),l.multiplyByScalar(t,i,u),r=l.multiplyByScalar(e,1-i,r),l.add(u,r,r)};let h=new l,d=new l;l.angleBetween=function(e,t){n.Z.typeOf.object("left",e),n.Z.typeOf.object("right",t),l.normalize(e,h),l.normalize(t,d);let i=l.dot(h,d);return Math.atan2(l.magnitude(l.cross(h,d,h)),i)};let f=new l;l.mostOrthogonalAxis=function(e,t){n.Z.typeOf.object("cartesian",e),n.Z.typeOf.object("result",t);let i=l.normalize(e,f);return l.abs(i,i),t=i.x<=i.y?i.x<=i.z?l.clone(l.UNIT_X,t):l.clone(l.UNIT_Z,t):i.y<=i.z?l.clone(l.UNIT_Y,t):l.clone(l.UNIT_Z,t)},l.projectVector=function(e,t,i){n.Z.defined("a",e),n.Z.defined("b",t),n.Z.defined("result",i);let r=l.dot(e,t)/l.dot(t,t);return l.multiplyByScalar(t,r,i)},l.equals=function(e,t){return e===t||(0,o.Z)(e)&&(0,o.Z)(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z},l.equalsArray=function(e,t,i){return e.x===t[i]&&e.y===t[i+1]&&e.z===t[i+2]},l.equalsEpsilon=function(e,t,i,n){return e===t||(0,o.Z)(e)&&(0,o.Z)(t)&&s.Z.equalsEpsilon(e.x,t.x,i,n)&&s.Z.equalsEpsilon(e.y,t.y,i,n)&&s.Z.equalsEpsilon(e.z,t.z,i,n)},l.cross=function(e,t,i){n.Z.typeOf.object("left",e),n.Z.typeOf.object("right",t),n.Z.typeOf.object("result",i);let r=e.x,o=e.y,a=e.z,s=t.x,l=t.y,c=t.z;return i.x=o*c-a*l,i.y=a*s-r*c,i.z=r*l-o*s,i},l.midpoint=function(e,t,i){return n.Z.typeOf.object("left",e),n.Z.typeOf.object("right",t),n.Z.typeOf.object("result",i),i.x=(e.x+t.x)*.5,i.y=(e.y+t.y)*.5,i.z=(e.z+t.z)*.5,i},l.fromDegrees=function(e,t,i,r,o){return n.Z.typeOf.number("longitude",e),n.Z.typeOf.number("latitude",t),e=s.Z.toRadians(e),t=s.Z.toRadians(t),l.fromRadians(e,t,i,r,o)};let p=new l,m=new l,_=new l(40680631590769,40680631590769,40408299984661.445);l.fromRadians=function(e,t,i,a,s){n.Z.typeOf.number("longitude",e),n.Z.typeOf.number("latitude",t),i=(0,r.Z)(i,0);let c=(0,o.Z)(a)?a.radiiSquared:_,u=Math.cos(t);p.x=u*Math.cos(e),p.y=u*Math.sin(e),p.z=Math.sin(t),p=l.normalize(p,p),l.multiplyComponents(c,p,m);let h=Math.sqrt(l.dot(p,m));return m=l.divideByScalar(m,h,m),p=l.multiplyByScalar(p,i,p),(0,o.Z)(s)||(s=new l),l.add(m,p,s)},l.fromDegreesArray=function(e,t,i){if(n.Z.defined("coordinates",e),e.length<2||e.length%2!=0)throw new a.Z("the number of coordinates must be a multiple of 2 and at least 2");let r=e.length;(0,o.Z)(i)?i.length=r/2:i=Array(r/2);for(let n=0;n<r;n+=2){let r=e[n],o=e[n+1],a=n/2;i[a]=l.fromDegrees(r,o,0,t,i[a])}return i},l.fromRadiansArray=function(e,t,i){if(n.Z.defined("coordinates",e),e.length<2||e.length%2!=0)throw new a.Z("the number of coordinates must be a multiple of 2 and at least 2");let r=e.length;(0,o.Z)(i)?i.length=r/2:i=Array(r/2);for(let n=0;n<r;n+=2){let r=e[n],o=e[n+1],a=n/2;i[a]=l.fromRadians(r,o,0,t,i[a])}return i},l.fromDegreesArrayHeights=function(e,t,i){if(n.Z.defined("coordinates",e),e.length<3||e.length%3!=0)throw new a.Z("the number of coordinates must be a multiple of 3 and at least 3");let r=e.length;(0,o.Z)(i)?i.length=r/3:i=Array(r/3);for(let n=0;n<r;n+=3){let r=e[n],o=e[n+1],a=e[n+2],s=n/3;i[s]=l.fromDegrees(r,o,a,t,i[s])}return i},l.fromRadiansArrayHeights=function(e,t,i){if(n.Z.defined("coordinates",e),e.length<3||e.length%3!=0)throw new a.Z("the number of coordinates must be a multiple of 3 and at least 3");let r=e.length;(0,o.Z)(i)?i.length=r/3:i=Array(r/3);for(let n=0;n<r;n+=3){let r=e[n],o=e[n+1],a=e[n+2],s=n/3;i[s]=l.fromRadians(r,o,a,t,i[s])}return i},l.ZERO=Object.freeze(new l(0,0,0)),l.ONE=Object.freeze(new l(1,1,1)),l.UNIT_X=Object.freeze(new l(1,0,0)),l.UNIT_Y=Object.freeze(new l(0,1,0)),l.UNIT_Z=Object.freeze(new l(0,0,1)),l.prototype.clone=function(e){return l.clone(this,e)},l.prototype.equals=function(e){return l.equals(this,e)},l.prototype.equalsEpsilon=function(e,t,i){return l.equalsEpsilon(this,e,t,i)},l.prototype.toString=function(){return`(${this.x}, ${this.y}, ${this.z})`},t.Z=l},3065:function(e,t,i){"use strict";var n=i(698),r=i(4572),o=i(9410),a=i(9824),s=i(2150);function l(e,t,i,n){this.x=(0,r.Z)(e,0),this.y=(0,r.Z)(t,0),this.z=(0,r.Z)(i,0),this.w=(0,r.Z)(n,0)}l.fromElements=function(e,t,i,n,r){return(0,o.Z)(r)?(r.x=e,r.y=t,r.z=i,r.w=n,r):new l(e,t,i,n)},l.fromColor=function(e,t){return(n.Z.typeOf.object("color",e),(0,o.Z)(t))?(t.x=e.red,t.y=e.green,t.z=e.blue,t.w=e.alpha,t):new l(e.red,e.green,e.blue,e.alpha)},l.clone=function(e,t){return(0,o.Z)(e)?(0,o.Z)(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new l(e.x,e.y,e.z,e.w):void 0},l.packedLength=4,l.pack=function(e,t,i){return n.Z.typeOf.object("value",e),n.Z.defined("array",t),i=(0,r.Z)(i,0),t[i++]=e.x,t[i++]=e.y,t[i++]=e.z,t[i]=e.w,t},l.unpack=function(e,t,i){return n.Z.defined("array",e),t=(0,r.Z)(t,0),(0,o.Z)(i)||(i=new l),i.x=e[t++],i.y=e[t++],i.z=e[t++],i.w=e[t],i},l.packArray=function(e,t){n.Z.defined("array",e);let i=e.length,r=4*i;if((0,o.Z)(t)){if(Array.isArray(t)||t.length===r)t.length!==r&&(t.length=r);else throw new a.Z("If result is a typed array, it must have exactly array.length * 4 elements")}else t=Array(r);for(let n=0;n<i;++n)l.pack(e[n],t,4*n);return t},l.unpackArray=function(e,t){if(n.Z.defined("array",e),n.Z.typeOf.number.greaterThanOrEquals("array.length",e.length,4),e.length%4!=0)throw new a.Z("array length must be a multiple of 4.");let i=e.length;(0,o.Z)(t)?t.length=i/4:t=Array(i/4);for(let n=0;n<i;n+=4){let i=n/4;t[i]=l.unpack(e,n,t[i])}return t},l.fromArray=l.unpack,l.maximumComponent=function(e){return n.Z.typeOf.object("cartesian",e),Math.max(e.x,e.y,e.z,e.w)},l.minimumComponent=function(e){return n.Z.typeOf.object("cartesian",e),Math.min(e.x,e.y,e.z,e.w)},l.minimumByComponent=function(e,t,i){return n.Z.typeOf.object("first",e),n.Z.typeOf.object("second",t),n.Z.typeOf.object("result",i),i.x=Math.min(e.x,t.x),i.y=Math.min(e.y,t.y),i.z=Math.min(e.z,t.z),i.w=Math.min(e.w,t.w),i},l.maximumByComponent=function(e,t,i){return n.Z.typeOf.object("first",e),n.Z.typeOf.object("second",t),n.Z.typeOf.object("result",i),i.x=Math.max(e.x,t.x),i.y=Math.max(e.y,t.y),i.z=Math.max(e.z,t.z),i.w=Math.max(e.w,t.w),i},l.clamp=function(e,t,i,r){n.Z.typeOf.object("value",e),n.Z.typeOf.object("min",t),n.Z.typeOf.object("max",i),n.Z.typeOf.object("result",r);let o=s.Z.clamp(e.x,t.x,i.x),a=s.Z.clamp(e.y,t.y,i.y),l=s.Z.clamp(e.z,t.z,i.z),c=s.Z.clamp(e.w,t.w,i.w);return r.x=o,r.y=a,r.z=l,r.w=c,r},l.magnitudeSquared=function(e){return n.Z.typeOf.object("cartesian",e),e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w},l.magnitude=function(e){return Math.sqrt(l.magnitudeSquared(e))};let c=new l;l.distance=function(e,t){return n.Z.typeOf.object("left",e),n.Z.typeOf.object("right",t),l.subtract(e,t,c),l.magnitude(c)},l.distanceSquared=function(e,t){return n.Z.typeOf.object("left",e),n.Z.typeOf.object("right",t),l.subtract(e,t,c),l.magnitudeSquared(c)},l.normalize=function(e,t){n.Z.typeOf.object("cartesian",e),n.Z.typeOf.object("result",t);let i=l.magnitude(e);if(t.x=e.x/i,t.y=e.y/i,t.z=e.z/i,t.w=e.w/i,isNaN(t.x)||isNaN(t.y)||isNaN(t.z)||isNaN(t.w))throw new a.Z("normalized result is not a number");return t},l.dot=function(e,t){return n.Z.typeOf.object("left",e),n.Z.typeOf.object("right",t),e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w},l.multiplyComponents=function(e,t,i){return n.Z.typeOf.object("left",e),n.Z.typeOf.object("right",t),n.Z.typeOf.object("result",i),i.x=e.x*t.x,i.y=e.y*t.y,i.z=e.z*t.z,i.w=e.w*t.w,i},l.divideComponents=function(e,t,i){return n.Z.typeOf.object("left",e),n.Z.typeOf.object("right",t),n.Z.typeOf.object("result",i),i.x=e.x/t.x,i.y=e.y/t.y,i.z=e.z/t.z,i.w=e.w/t.w,i},l.add=function(e,t,i){return n.Z.typeOf.object("left",e),n.Z.typeOf.object("right",t),n.Z.typeOf.object("result",i),i.x=e.x+t.x,i.y=e.y+t.y,i.z=e.z+t.z,i.w=e.w+t.w,i},l.subtract=function(e,t,i){return n.Z.typeOf.object("left",e),n.Z.typeOf.object("right",t),n.Z.typeOf.object("result",i),i.x=e.x-t.x,i.y=e.y-t.y,i.z=e.z-t.z,i.w=e.w-t.w,i},l.multiplyByScalar=function(e,t,i){return n.Z.typeOf.object("cartesian",e),n.Z.typeOf.number("scalar",t),n.Z.typeOf.object("result",i),i.x=e.x*t,i.y=e.y*t,i.z=e.z*t,i.w=e.w*t,i},l.divideByScalar=function(e,t,i){return n.Z.typeOf.object("cartesian",e),n.Z.typeOf.number("scalar",t),n.Z.typeOf.object("result",i),i.x=e.x/t,i.y=e.y/t,i.z=e.z/t,i.w=e.w/t,i},l.negate=function(e,t){return n.Z.typeOf.object("cartesian",e),n.Z.typeOf.object("result",t),t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t},l.abs=function(e,t){return n.Z.typeOf.object("cartesian",e),n.Z.typeOf.object("result",t),t.x=Math.abs(e.x),t.y=Math.abs(e.y),t.z=Math.abs(e.z),t.w=Math.abs(e.w),t};let u=new l;l.lerp=function(e,t,i,r){return n.Z.typeOf.object("start",e),n.Z.typeOf.object("end",t),n.Z.typeOf.number("t",i),n.Z.typeOf.object("result",r),l.multiplyByScalar(t,i,u),r=l.multiplyByScalar(e,1-i,r),l.add(u,r,r)};let h=new l;l.mostOrthogonalAxis=function(e,t){n.Z.typeOf.object("cartesian",e),n.Z.typeOf.object("result",t);let i=l.normalize(e,h);return l.abs(i,i),t=i.x<=i.y?i.x<=i.z?i.x<=i.w?l.clone(l.UNIT_X,t):l.clone(l.UNIT_W,t):i.z<=i.w?l.clone(l.UNIT_Z,t):l.clone(l.UNIT_W,t):i.y<=i.z?i.y<=i.w?l.clone(l.UNIT_Y,t):l.clone(l.UNIT_W,t):i.z<=i.w?l.clone(l.UNIT_Z,t):l.clone(l.UNIT_W,t)},l.equals=function(e,t){return e===t||(0,o.Z)(e)&&(0,o.Z)(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w},l.equalsArray=function(e,t,i){return e.x===t[i]&&e.y===t[i+1]&&e.z===t[i+2]&&e.w===t[i+3]},l.equalsEpsilon=function(e,t,i,n){return e===t||(0,o.Z)(e)&&(0,o.Z)(t)&&s.Z.equalsEpsilon(e.x,t.x,i,n)&&s.Z.equalsEpsilon(e.y,t.y,i,n)&&s.Z.equalsEpsilon(e.z,t.z,i,n)&&s.Z.equalsEpsilon(e.w,t.w,i,n)},l.ZERO=Object.freeze(new l(0,0,0,0)),l.ONE=Object.freeze(new l(1,1,1,1)),l.UNIT_X=Object.freeze(new l(1,0,0,0)),l.UNIT_Y=Object.freeze(new l(0,1,0,0)),l.UNIT_Z=Object.freeze(new l(0,0,1,0)),l.UNIT_W=Object.freeze(new l(0,0,0,1)),l.prototype.clone=function(e){return l.clone(this,e)},l.prototype.equals=function(e){return l.equals(this,e)},l.prototype.equalsEpsilon=function(e,t,i){return l.equalsEpsilon(this,e,t,i)},l.prototype.toString=function(){return`(${this.x}, ${this.y}, ${this.z}, ${this.w})`};let d=new Float32Array(1),f=new Uint8Array(d.buffer),p=68===new Uint8Array(new Uint32Array([287454020]).buffer)[0];l.packFloat=function(e,t){return n.Z.typeOf.number("value",e),(0,o.Z)(t)||(t=new l),d[0]=e,p?(t.x=f[0],t.y=f[1],t.z=f[2],t.w=f[3]):(t.x=f[3],t.y=f[2],t.z=f[1],t.w=f[0]),t},l.unpackFloat=function(e){return n.Z.typeOf.object("packedFloat",e),p?(f[0]=e.x,f[1]=e.y,f[2]=e.z,f[3]=e.w):(f[0]=e.w,f[1]=e.z,f[2]=e.y,f[3]=e.x),d[0]},t.Z=l},2820:function(e,t,i){"use strict";var n=i(1486),r=i(698),o=i(4572),a=i(9410),s=i(2150),l=i(4833);function c(e,t,i){this.longitude=(0,o.Z)(e,0),this.latitude=(0,o.Z)(t,0),this.height=(0,o.Z)(i,0)}c.fromRadians=function(e,t,i,n){return(r.Z.typeOf.number("longitude",e),r.Z.typeOf.number("latitude",t),i=(0,o.Z)(i,0),(0,a.Z)(n))?(n.longitude=e,n.latitude=t,n.height=i,n):new c(e,t,i)},c.fromDegrees=function(e,t,i,n){return r.Z.typeOf.number("longitude",e),r.Z.typeOf.number("latitude",t),e=s.Z.toRadians(e),t=s.Z.toRadians(t),c.fromRadians(e,t,i,n)};let u=new n.Z,h=new n.Z,d=new n.Z,f=new n.Z(1/6378137,1/6378137,1/6356752.314245179),p=new n.Z(1/40680631590769,1/40680631590769,24747391015697002e-30),m=s.Z.EPSILON1;c.fromCartesian=function(e,t,i){let r=(0,a.Z)(t)?t.oneOverRadii:f,o=(0,a.Z)(t)?t.oneOverRadiiSquared:p,_=(0,a.Z)(t)?t._centerToleranceSquared:m,g=(0,l.Z)(e,r,o,_,h);if(!(0,a.Z)(g))return;let Z=n.Z.multiplyComponents(g,o,u);Z=n.Z.normalize(Z,Z);let y=n.Z.subtract(e,g,d),b=Math.atan2(Z.y,Z.x),v=Math.asin(Z.z),T=s.Z.sign(n.Z.dot(y,e))*n.Z.magnitude(y);return(0,a.Z)(i)?(i.longitude=b,i.latitude=v,i.height=T,i):new c(b,v,T)},c.toCartesian=function(e,t,i){return r.Z.defined("cartographic",e),n.Z.fromRadians(e.longitude,e.latitude,e.height,t,i)},c.clone=function(e,t){return(0,a.Z)(e)?(0,a.Z)(t)?(t.longitude=e.longitude,t.latitude=e.latitude,t.height=e.height,t):new c(e.longitude,e.latitude,e.height):void 0},c.equals=function(e,t){return e===t||(0,a.Z)(e)&&(0,a.Z)(t)&&e.longitude===t.longitude&&e.latitude===t.latitude&&e.height===t.height},c.equalsEpsilon=function(e,t,i){return i=(0,o.Z)(i,0),e===t||(0,a.Z)(e)&&(0,a.Z)(t)&&Math.abs(e.longitude-t.longitude)<=i&&Math.abs(e.latitude-t.latitude)<=i&&Math.abs(e.height-t.height)<=i},c.ZERO=Object.freeze(new c(0,0,0)),c.prototype.clone=function(e){return c.clone(this,e)},c.prototype.equals=function(e){return c.equals(this,e)},c.prototype.equalsEpsilon=function(e,t){return c.equalsEpsilon(this,e,t)},c.prototype.toString=function(){return`(${this.longitude}, ${this.latitude}, ${this.height})`},t.Z=c},2677:function(e,t,i){"use strict";var n=i(4106),r=i(7832),o=i(4572),a=i(9410),s=i(9824),l=i(2198),c=i(2594),u=i(5951);function h(e){let t=(e=(0,o.Z)(e,o.Z.EMPTY_OBJECT)).currentTime,i=e.startTime,h=e.stopTime;if(t=(0,a.Z)(t)?u.Z.clone(t):(0,a.Z)(i)?u.Z.clone(i):(0,a.Z)(h)?u.Z.addDays(h,-1,new u.Z):u.Z.now(),i=(0,a.Z)(i)?u.Z.clone(i):u.Z.clone(t),h=(0,a.Z)(h)?u.Z.clone(h):u.Z.addDays(i,1,new u.Z),u.Z.greaterThan(i,h))throw new s.Z("startTime must come before stopTime.");this.startTime=i,this.stopTime=h,this.clockRange=(0,o.Z)(e.clockRange,n.Z.UNBOUNDED),this.canAnimate=(0,o.Z)(e.canAnimate,!0),this.onTick=new l.Z,this.onStop=new l.Z,this._currentTime=void 0,this._multiplier=void 0,this._clockStep=void 0,this._shouldAnimate=void 0,this._lastSystemTime=(0,c.Z)(),this.currentTime=t,this.multiplier=(0,o.Z)(e.multiplier,1),this.shouldAnimate=(0,o.Z)(e.shouldAnimate,!1),this.clockStep=(0,o.Z)(e.clockStep,r.Z.SYSTEM_CLOCK_MULTIPLIER)}Object.defineProperties(h.prototype,{currentTime:{get:function(){return this._currentTime},set:function(e){u.Z.equals(this._currentTime,e)||(this._clockStep===r.Z.SYSTEM_CLOCK&&(this._clockStep=r.Z.SYSTEM_CLOCK_MULTIPLIER),this._currentTime=e)}},multiplier:{get:function(){return this._multiplier},set:function(e){this._multiplier!==e&&(this._clockStep===r.Z.SYSTEM_CLOCK&&(this._clockStep=r.Z.SYSTEM_CLOCK_MULTIPLIER),this._multiplier=e)}},clockStep:{get:function(){return this._clockStep},set:function(e){e===r.Z.SYSTEM_CLOCK&&(this._multiplier=1,this._shouldAnimate=!0,this._currentTime=u.Z.now()),this._clockStep=e}},shouldAnimate:{get:function(){return this._shouldAnimate},set:function(e){this._shouldAnimate!==e&&(this._clockStep===r.Z.SYSTEM_CLOCK&&(this._clockStep=r.Z.SYSTEM_CLOCK_MULTIPLIER),this._shouldAnimate=e)}}}),h.prototype.tick=function(){let e=(0,c.Z)(),t=u.Z.clone(this._currentTime);if(this.canAnimate&&this._shouldAnimate){let i=this._clockStep;if(i===r.Z.SYSTEM_CLOCK)t=u.Z.now(t);else{let o=this._multiplier;if(i===r.Z.TICK_DEPENDENT)t=u.Z.addSeconds(t,o,t);else{let i=e-this._lastSystemTime;t=u.Z.addSeconds(t,i/1e3*o,t)}let a=this.clockRange,s=this.startTime,l=this.stopTime;if(a===n.Z.CLAMPED)u.Z.lessThan(t,s)?t=u.Z.clone(s,t):u.Z.greaterThan(t,l)&&(t=u.Z.clone(l,t),this.onStop.raiseEvent(this));else if(a===n.Z.LOOP_STOP)for(u.Z.lessThan(t,s)&&(t=u.Z.clone(s,t));u.Z.greaterThan(t,l);)t=u.Z.addSeconds(s,u.Z.secondsDifference(t,l),t),this.onStop.raiseEvent(this)}}return this._currentTime=t,this._lastSystemTime=e,this.onTick.raiseEvent(this),t},t.Z=h},4106:function(e,t){"use strict";t.Z=Object.freeze({UNBOUNDED:0,CLAMPED:1,LOOP_STOP:2})},7832:function(e,t){"use strict";t.Z=Object.freeze({TICK_DEPENDENT:0,SYSTEM_CLOCK_MULTIPLIER:1,SYSTEM_CLOCK:2})},8177:function(e,t,i){"use strict";let n,r,o;var a=i(698),s=i(4572),l=i(9410),c=i(894),u=i(2150);function h(e,t,i){return(i<0&&(i+=1),i>1&&(i-=1),6*i<1)?e+(t-e)*6*i:2*i<1?t:3*i<2?e+(t-e)*(2/3-i)*6:e}function d(e,t,i,n){this.red=(0,s.Z)(e,1),this.green=(0,s.Z)(t,1),this.blue=(0,s.Z)(i,1),this.alpha=(0,s.Z)(n,1)}d.fromCartesian4=function(e,t){return(a.Z.typeOf.object("cartesian",e),(0,l.Z)(t))?(t.red=e.x,t.green=e.y,t.blue=e.z,t.alpha=e.w,t):new d(e.x,e.y,e.z,e.w)},d.fromBytes=function(e,t,i,n,r){return(e=d.byteToFloat((0,s.Z)(e,255)),t=d.byteToFloat((0,s.Z)(t,255)),i=d.byteToFloat((0,s.Z)(i,255)),n=d.byteToFloat((0,s.Z)(n,255)),(0,l.Z)(r))?(r.red=e,r.green=t,r.blue=i,r.alpha=n,r):new d(e,t,i,n)},d.fromAlpha=function(e,t,i){return(a.Z.typeOf.object("color",e),a.Z.typeOf.number("alpha",t),(0,l.Z)(i))?(i.red=e.red,i.green=e.green,i.blue=e.blue,i.alpha=t,i):new d(e.red,e.green,e.blue,t)},c.Z.supportsTypedArrays()&&(r=new Uint32Array(n=new ArrayBuffer(4)),o=new Uint8Array(n)),d.fromRgba=function(e,t){return r[0]=e,d.fromBytes(o[0],o[1],o[2],o[3],t)},d.fromHsl=function(e,t,i,n,r){e=(0,s.Z)(e,0)%1,t=(0,s.Z)(t,0),i=(0,s.Z)(i,0),n=(0,s.Z)(n,1);let o=i,a=i,c=i;if(0!==t){let n;n=i<.5?i*(1+t):i+t-i*t;let r=2*i-n;o=h(r,n,e+1/3),a=h(r,n,e),c=h(r,n,e-1/3)}return(0,l.Z)(r)?(r.red=o,r.green=a,r.blue=c,r.alpha=n,r):new d(o,a,c,n)},d.fromRandom=function(e,t){let i=(e=(0,s.Z)(e,s.Z.EMPTY_OBJECT)).red;if(!(0,l.Z)(i)){let t=(0,s.Z)(e.minimumRed,0),n=(0,s.Z)(e.maximumRed,1);a.Z.typeOf.number.lessThanOrEquals("minimumRed",t,n),i=t+u.Z.nextRandomNumber()*(n-t)}let n=e.green;if(!(0,l.Z)(n)){let t=(0,s.Z)(e.minimumGreen,0),i=(0,s.Z)(e.maximumGreen,1);a.Z.typeOf.number.lessThanOrEquals("minimumGreen",t,i),n=t+u.Z.nextRandomNumber()*(i-t)}let r=e.blue;if(!(0,l.Z)(r)){let t=(0,s.Z)(e.minimumBlue,0),i=(0,s.Z)(e.maximumBlue,1);a.Z.typeOf.number.lessThanOrEquals("minimumBlue",t,i),r=t+u.Z.nextRandomNumber()*(i-t)}let o=e.alpha;if(!(0,l.Z)(o)){let t=(0,s.Z)(e.minimumAlpha,0),i=(0,s.Z)(e.maximumAlpha,1);a.Z.typeOf.number.lessThanOrEquals("minumumAlpha",t,i),o=t+u.Z.nextRandomNumber()*(i-t)}return(0,l.Z)(t)?(t.red=i,t.green=n,t.blue=r,t.alpha=o,t):new d(i,n,r,o)};let f=/^#([0-9a-f])([0-9a-f])([0-9a-f])([0-9a-f])?$/i,p=/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})?$/i,m=/^rgba?\s*\(\s*([0-9.]+%?)\s*[,\s]+\s*([0-9.]+%?)\s*[,\s]+\s*([0-9.]+%?)(?:\s*[,\s/]+\s*([0-9.]+))?\s*\)$/i,_=/^hsla?\s*\(\s*([0-9.]+)\s*[,\s]+\s*([0-9.]+%)\s*[,\s]+\s*([0-9.]+%)(?:\s*[,\s/]+\s*([0-9.]+))?\s*\)$/i;d.fromCssColorString=function(e,t){a.Z.typeOf.string("color",e),(0,l.Z)(t)||(t=new d);let i=d[(e=e.trim()).toUpperCase()];if((0,l.Z)(i))return d.clone(i,t),t;let n=f.exec(e);return null!==n?(t.red=parseInt(n[1],16)/15,t.green=parseInt(n[2],16)/15,t.blue=parseInt(n[3],16)/15,t.alpha=parseInt((0,s.Z)(n[4],"f"),16)/15,t):null!==(n=p.exec(e))?(t.red=parseInt(n[1],16)/255,t.green=parseInt(n[2],16)/255,t.blue=parseInt(n[3],16)/255,t.alpha=parseInt((0,s.Z)(n[4],"ff"),16)/255,t):null!==(n=m.exec(e))?(t.red=parseFloat(n[1])/("%"===n[1].substr(-1)?100:255),t.green=parseFloat(n[2])/("%"===n[2].substr(-1)?100:255),t.blue=parseFloat(n[3])/("%"===n[3].substr(-1)?100:255),t.alpha=parseFloat((0,s.Z)(n[4],"1.0")),t):null!==(n=_.exec(e))?d.fromHsl(parseFloat(n[1])/360,parseFloat(n[2])/100,parseFloat(n[3])/100,parseFloat((0,s.Z)(n[4],"1.0")),t):t=void 0},d.packedLength=4,d.pack=function(e,t,i){return a.Z.typeOf.object("value",e),a.Z.defined("array",t),i=(0,s.Z)(i,0),t[i++]=e.red,t[i++]=e.green,t[i++]=e.blue,t[i]=e.alpha,t},d.unpack=function(e,t,i){return a.Z.defined("array",e),t=(0,s.Z)(t,0),(0,l.Z)(i)||(i=new d),i.red=e[t++],i.green=e[t++],i.blue=e[t++],i.alpha=e[t],i},d.byteToFloat=function(e){return e/255},d.floatToByte=function(e){return 1===e?255:256*e|0},d.clone=function(e,t){return(0,l.Z)(e)?(0,l.Z)(t)?(t.red=e.red,t.green=e.green,t.blue=e.blue,t.alpha=e.alpha,t):new d(e.red,e.green,e.blue,e.alpha):void 0},d.equals=function(e,t){return e===t||(0,l.Z)(e)&&(0,l.Z)(t)&&e.red===t.red&&e.green===t.green&&e.blue===t.blue&&e.alpha===t.alpha},d.equalsArray=function(e,t,i){return e.red===t[i]&&e.green===t[i+1]&&e.blue===t[i+2]&&e.alpha===t[i+3]},d.prototype.clone=function(e){return d.clone(this,e)},d.prototype.equals=function(e){return d.equals(this,e)},d.prototype.equalsEpsilon=function(e,t){return this===e||(0,l.Z)(e)&&Math.abs(this.red-e.red)<=t&&Math.abs(this.green-e.green)<=t&&Math.abs(this.blue-e.blue)<=t&&Math.abs(this.alpha-e.alpha)<=t},d.prototype.toString=function(){return`(${this.red}, ${this.green}, ${this.blue}, ${this.alpha})`},d.prototype.toCssColorString=function(){let e=d.floatToByte(this.red),t=d.floatToByte(this.green),i=d.floatToByte(this.blue);return 1===this.alpha?`rgb(${e},${t},${i})`:`rgba(${e},${t},${i},${this.alpha})`},d.prototype.toCssHexString=function(){let e=d.floatToByte(this.red).toString(16);e.length<2&&(e=`0${e}`);let t=d.floatToByte(this.green).toString(16);t.length<2&&(t=`0${t}`);let i=d.floatToByte(this.blue).toString(16);if(i.length<2&&(i=`0${i}`),this.alpha<1){let n=d.floatToByte(this.alpha).toString(16);return n.length<2&&(n=`0${n}`),`#${e}${t}${i}${n}`}return`#${e}${t}${i}`},d.prototype.toBytes=function(e){let t=d.floatToByte(this.red),i=d.floatToByte(this.green),n=d.floatToByte(this.blue),r=d.floatToByte(this.alpha);return(0,l.Z)(e)?(e[0]=t,e[1]=i,e[2]=n,e[3]=r,e):[t,i,n,r]},d.prototype.toRgba=function(){return o[0]=d.floatToByte(this.red),o[1]=d.floatToByte(this.green),o[2]=d.floatToByte(this.blue),o[3]=d.floatToByte(this.alpha),r[0]},d.prototype.brighten=function(e,t){return a.Z.typeOf.number("magnitude",e),a.Z.typeOf.number.greaterThanOrEquals("magnitude",e,0),a.Z.typeOf.object("result",t),e=1-e,t.red=1-(1-this.red)*e,t.green=1-(1-this.green)*e,t.blue=1-(1-this.blue)*e,t.alpha=this.alpha,t},d.prototype.darken=function(e,t){return a.Z.typeOf.number("magnitude",e),a.Z.typeOf.number.greaterThanOrEquals("magnitude",e,0),a.Z.typeOf.object("result",t),e=1-e,t.red=this.red*e,t.green=this.green*e,t.blue=this.blue*e,t.alpha=this.alpha,t},d.prototype.withAlpha=function(e,t){return d.fromAlpha(this,e,t)},d.add=function(e,t,i){return a.Z.typeOf.object("left",e),a.Z.typeOf.object("right",t),a.Z.typeOf.object("result",i),i.red=e.red+t.red,i.green=e.green+t.green,i.blue=e.blue+t.blue,i.alpha=e.alpha+t.alpha,i},d.subtract=function(e,t,i){return a.Z.typeOf.object("left",e),a.Z.typeOf.object("right",t),a.Z.typeOf.object("result",i),i.red=e.red-t.red,i.green=e.green-t.green,i.blue=e.blue-t.blue,i.alpha=e.alpha-t.alpha,i},d.multiply=function(e,t,i){return a.Z.typeOf.object("left",e),a.Z.typeOf.object("right",t),a.Z.typeOf.object("result",i),i.red=e.red*t.red,i.green=e.green*t.green,i.blue=e.blue*t.blue,i.alpha=e.alpha*t.alpha,i},d.divide=function(e,t,i){return a.Z.typeOf.object("left",e),a.Z.typeOf.object("right",t),a.Z.typeOf.object("result",i),i.red=e.red/t.red,i.green=e.green/t.green,i.blue=e.blue/t.blue,i.alpha=e.alpha/t.alpha,i},d.mod=function(e,t,i){return a.Z.typeOf.object("left",e),a.Z.typeOf.object("right",t),a.Z.typeOf.object("result",i),i.red=e.red%t.red,i.green=e.green%t.green,i.blue=e.blue%t.blue,i.alpha=e.alpha%t.alpha,i},d.lerp=function(e,t,i,n){return a.Z.typeOf.object("start",e),a.Z.typeOf.object("end",t),a.Z.typeOf.number("t",i),a.Z.typeOf.object("result",n),n.red=u.Z.lerp(e.red,t.red,i),n.green=u.Z.lerp(e.green,t.green,i),n.blue=u.Z.lerp(e.blue,t.blue,i),n.alpha=u.Z.lerp(e.alpha,t.alpha,i),n},d.multiplyByScalar=function(e,t,i){return a.Z.typeOf.object("color",e),a.Z.typeOf.number("scalar",t),a.Z.typeOf.object("result",i),i.red=e.red*t,i.green=e.green*t,i.blue=e.blue*t,i.alpha=e.alpha*t,i},d.divideByScalar=function(e,t,i){return a.Z.typeOf.object("color",e),a.Z.typeOf.number("scalar",t),a.Z.typeOf.object("result",i),i.red=e.red/t,i.green=e.green/t,i.blue=e.blue/t,i.alpha=e.alpha/t,i},d.ALICEBLUE=Object.freeze(d.fromCssColorString("#F0F8FF")),d.ANTIQUEWHITE=Object.freeze(d.fromCssColorString("#FAEBD7")),d.AQUA=Object.freeze(d.fromCssColorString("#00FFFF")),d.AQUAMARINE=Object.freeze(d.fromCssColorString("#7FFFD4")),d.AZURE=Object.freeze(d.fromCssColorString("#F0FFFF")),d.BEIGE=Object.freeze(d.fromCssColorString("#F5F5DC")),d.BISQUE=Object.freeze(d.fromCssColorString("#FFE4C4")),d.BLACK=Object.freeze(d.fromCssColorString("#000000")),d.BLANCHEDALMOND=Object.freeze(d.fromCssColorString("#FFEBCD")),d.BLUE=Object.freeze(d.fromCssColorString("#0000FF")),d.BLUEVIOLET=Object.freeze(d.fromCssColorString("#8A2BE2")),d.BROWN=Object.freeze(d.fromCssColorString("#A52A2A")),d.BURLYWOOD=Object.freeze(d.fromCssColorString("#DEB887")),d.CADETBLUE=Object.freeze(d.fromCssColorString("#5F9EA0")),d.CHARTREUSE=Object.freeze(d.fromCssColorString("#7FFF00")),d.CHOCOLATE=Object.freeze(d.fromCssColorString("#D2691E")),d.CORAL=Object.freeze(d.fromCssColorString("#FF7F50")),d.CORNFLOWERBLUE=Object.freeze(d.fromCssColorString("#6495ED")),d.CORNSILK=Object.freeze(d.fromCssColorString("#FFF8DC")),d.CRIMSON=Object.freeze(d.fromCssColorString("#DC143C")),d.CYAN=Object.freeze(d.fromCssColorString("#00FFFF")),d.DARKBLUE=Object.freeze(d.fromCssColorString("#00008B")),d.DARKCYAN=Object.freeze(d.fromCssColorString("#008B8B")),d.DARKGOLDENROD=Object.freeze(d.fromCssColorString("#B8860B")),d.DARKGRAY=Object.freeze(d.fromCssColorString("#A9A9A9")),d.DARKGREEN=Object.freeze(d.fromCssColorString("#006400")),d.DARKGREY=d.DARKGRAY,d.DARKKHAKI=Object.freeze(d.fromCssColorString("#BDB76B")),d.DARKMAGENTA=Object.freeze(d.fromCssColorString("#8B008B")),d.DARKOLIVEGREEN=Object.freeze(d.fromCssColorString("#556B2F")),d.DARKORANGE=Object.freeze(d.fromCssColorString("#FF8C00")),d.DARKORCHID=Object.freeze(d.fromCssColorString("#9932CC")),d.DARKRED=Object.freeze(d.fromCssColorString("#8B0000")),d.DARKSALMON=Object.freeze(d.fromCssColorString("#E9967A")),d.DARKSEAGREEN=Object.freeze(d.fromCssColorString("#8FBC8F")),d.DARKSLATEBLUE=Object.freeze(d.fromCssColorString("#483D8B")),d.DARKSLATEGRAY=Object.freeze(d.fromCssColorString("#2F4F4F")),d.DARKSLATEGREY=d.DARKSLATEGRAY,d.DARKTURQUOISE=Object.freeze(d.fromCssColorString("#00CED1")),d.DARKVIOLET=Object.freeze(d.fromCssColorString("#9400D3")),d.DEEPPINK=Object.freeze(d.fromCssColorString("#FF1493")),d.DEEPSKYBLUE=Object.freeze(d.fromCssColorString("#00BFFF")),d.DIMGRAY=Object.freeze(d.fromCssColorString("#696969")),d.DIMGREY=d.DIMGRAY,d.DODGERBLUE=Object.freeze(d.fromCssColorString("#1E90FF")),d.FIREBRICK=Object.freeze(d.fromCssColorString("#B22222")),d.FLORALWHITE=Object.freeze(d.fromCssColorString("#FFFAF0")),d.FORESTGREEN=Object.freeze(d.fromCssColorString("#228B22")),d.FUCHSIA=Object.freeze(d.fromCssColorString("#FF00FF")),d.GAINSBORO=Object.freeze(d.fromCssColorString("#DCDCDC")),d.GHOSTWHITE=Object.freeze(d.fromCssColorString("#F8F8FF")),d.GOLD=Object.freeze(d.fromCssColorString("#FFD700")),d.GOLDENROD=Object.freeze(d.fromCssColorString("#DAA520")),d.GRAY=Object.freeze(d.fromCssColorString("#808080")),d.GREEN=Object.freeze(d.fromCssColorString("#008000")),d.GREENYELLOW=Object.freeze(d.fromCssColorString("#ADFF2F")),d.GREY=d.GRAY,d.HONEYDEW=Object.freeze(d.fromCssColorString("#F0FFF0")),d.HOTPINK=Object.freeze(d.fromCssColorString("#FF69B4")),d.INDIANRED=Object.freeze(d.fromCssColorString("#CD5C5C")),d.INDIGO=Object.freeze(d.fromCssColorString("#4B0082")),d.IVORY=Object.freeze(d.fromCssColorString("#FFFFF0")),d.KHAKI=Object.freeze(d.fromCssColorString("#F0E68C")),d.LAVENDER=Object.freeze(d.fromCssColorString("#E6E6FA")),d.LAVENDAR_BLUSH=Object.freeze(d.fromCssColorString("#FFF0F5")),d.LAWNGREEN=Object.freeze(d.fromCssColorString("#7CFC00")),d.LEMONCHIFFON=Object.freeze(d.fromCssColorString("#FFFACD")),d.LIGHTBLUE=Object.freeze(d.fromCssColorString("#ADD8E6")),d.LIGHTCORAL=Object.freeze(d.fromCssColorString("#F08080")),d.LIGHTCYAN=Object.freeze(d.fromCssColorString("#E0FFFF")),d.LIGHTGOLDENRODYELLOW=Object.freeze(d.fromCssColorString("#FAFAD2")),d.LIGHTGRAY=Object.freeze(d.fromCssColorString("#D3D3D3")),d.LIGHTGREEN=Object.freeze(d.fromCssColorString("#90EE90")),d.LIGHTGREY=d.LIGHTGRAY,d.LIGHTPINK=Object.freeze(d.fromCssColorString("#FFB6C1")),d.LIGHTSEAGREEN=Object.freeze(d.fromCssColorString("#20B2AA")),d.LIGHTSKYBLUE=Object.freeze(d.fromCssColorString("#87CEFA")),d.LIGHTSLATEGRAY=Object.freeze(d.fromCssColorString("#778899")),d.LIGHTSLATEGREY=d.LIGHTSLATEGRAY,d.LIGHTSTEELBLUE=Object.freeze(d.fromCssColorString("#B0C4DE")),d.LIGHTYELLOW=Object.freeze(d.fromCssColorString("#FFFFE0")),d.LIME=Object.freeze(d.fromCssColorString("#00FF00")),d.LIMEGREEN=Object.freeze(d.fromCssColorString("#32CD32")),d.LINEN=Object.freeze(d.fromCssColorString("#FAF0E6")),d.MAGENTA=Object.freeze(d.fromCssColorString("#FF00FF")),d.MAROON=Object.freeze(d.fromCssColorString("#800000")),d.MEDIUMAQUAMARINE=Object.freeze(d.fromCssColorString("#66CDAA")),d.MEDIUMBLUE=Object.freeze(d.fromCssColorString("#0000CD")),d.MEDIUMORCHID=Object.freeze(d.fromCssColorString("#BA55D3")),d.MEDIUMPURPLE=Object.freeze(d.fromCssColorString("#9370DB")),d.MEDIUMSEAGREEN=Object.freeze(d.fromCssColorString("#3CB371")),d.MEDIUMSLATEBLUE=Object.freeze(d.fromCssColorString("#7B68EE")),d.MEDIUMSPRINGGREEN=Object.freeze(d.fromCssColorString("#00FA9A")),d.MEDIUMTURQUOISE=Object.freeze(d.fromCssColorString("#48D1CC")),d.MEDIUMVIOLETRED=Object.freeze(d.fromCssColorString("#C71585")),d.MIDNIGHTBLUE=Object.freeze(d.fromCssColorString("#191970")),d.MINTCREAM=Object.freeze(d.fromCssColorString("#F5FFFA")),d.MISTYROSE=Object.freeze(d.fromCssColorString("#FFE4E1")),d.MOCCASIN=Object.freeze(d.fromCssColorString("#FFE4B5")),d.NAVAJOWHITE=Object.freeze(d.fromCssColorString("#FFDEAD")),d.NAVY=Object.freeze(d.fromCssColorString("#000080")),d.OLDLACE=Object.freeze(d.fromCssColorString("#FDF5E6")),d.OLIVE=Object.freeze(d.fromCssColorString("#808000")),d.OLIVEDRAB=Object.freeze(d.fromCssColorString("#6B8E23")),d.ORANGE=Object.freeze(d.fromCssColorString("#FFA500")),d.ORANGERED=Object.freeze(d.fromCssColorString("#FF4500")),d.ORCHID=Object.freeze(d.fromCssColorString("#DA70D6")),d.PALEGOLDENROD=Object.freeze(d.fromCssColorString("#EEE8AA")),d.PALEGREEN=Object.freeze(d.fromCssColorString("#98FB98")),d.PALETURQUOISE=Object.freeze(d.fromCssColorString("#AFEEEE")),d.PALEVIOLETRED=Object.freeze(d.fromCssColorString("#DB7093")),d.PAPAYAWHIP=Object.freeze(d.fromCssColorString("#FFEFD5")),d.PEACHPUFF=Object.freeze(d.fromCssColorString("#FFDAB9")),d.PERU=Object.freeze(d.fromCssColorString("#CD853F")),d.PINK=Object.freeze(d.fromCssColorString("#FFC0CB")),d.PLUM=Object.freeze(d.fromCssColorString("#DDA0DD")),d.POWDERBLUE=Object.freeze(d.fromCssColorString("#B0E0E6")),d.PURPLE=Object.freeze(d.fromCssColorString("#800080")),d.RED=Object.freeze(d.fromCssColorString("#FF0000")),d.ROSYBROWN=Object.freeze(d.fromCssColorString("#BC8F8F")),d.ROYALBLUE=Object.freeze(d.fromCssColorString("#4169E1")),d.SADDLEBROWN=Object.freeze(d.fromCssColorString("#8B4513")),d.SALMON=Object.freeze(d.fromCssColorString("#FA8072")),d.SANDYBROWN=Object.freeze(d.fromCssColorString("#F4A460")),d.SEAGREEN=Object.freeze(d.fromCssColorString("#2E8B57")),d.SEASHELL=Object.freeze(d.fromCssColorString("#FFF5EE")),d.SIENNA=Object.freeze(d.fromCssColorString("#A0522D")),d.SILVER=Object.freeze(d.fromCssColorString("#C0C0C0")),d.SKYBLUE=Object.freeze(d.fromCssColorString("#87CEEB")),d.SLATEBLUE=Object.freeze(d.fromCssColorString("#6A5ACD")),d.SLATEGRAY=Object.freeze(d.fromCssColorString("#708090")),d.SLATEGREY=d.SLATEGRAY,d.SNOW=Object.freeze(d.fromCssColorString("#FFFAFA")),d.SPRINGGREEN=Object.freeze(d.fromCssColorString("#00FF7F")),d.STEELBLUE=Object.freeze(d.fromCssColorString("#4682B4")),d.TAN=Object.freeze(d.fromCssColorString("#D2B48C")),d.TEAL=Object.freeze(d.fromCssColorString("#008080")),d.THISTLE=Object.freeze(d.fromCssColorString("#D8BFD8")),d.TOMATO=Object.freeze(d.fromCssColorString("#FF6347")),d.TURQUOISE=Object.freeze(d.fromCssColorString("#40E0D0")),d.VIOLET=Object.freeze(d.fromCssColorString("#EE82EE")),d.WHEAT=Object.freeze(d.fromCssColorString("#F5DEB3")),d.WHITE=Object.freeze(d.fromCssColorString("#FFFFFF")),d.WHITESMOKE=Object.freeze(d.fromCssColorString("#F5F5F5")),d.YELLOW=Object.freeze(d.fromCssColorString("#FFFF00")),d.YELLOWGREEN=Object.freeze(d.fromCssColorString("#9ACD32")),d.TRANSPARENT=Object.freeze(new d(0,0,0,0)),t.Z=d},4127:function(e,t,i){"use strict";var n=i(8177),r=i(7559),o=i(4572),a=i(9410),s=i(9824);function l(e,t,i,r){e=(0,o.Z)(e,1),t=(0,o.Z)(t,1),i=(0,o.Z)(i,1),r=(0,o.Z)(r,1),this.value=new Uint8Array([n.Z.floatToByte(e),n.Z.floatToByte(t),n.Z.floatToByte(i),n.Z.floatToByte(r)])}Object.defineProperties(l.prototype,{componentDatatype:{get:function(){return r.Z.UNSIGNED_BYTE}},componentsPerAttribute:{get:function(){return 4}},normalize:{get:function(){return!0}}}),l.fromColor=function(e){if(!(0,a.Z)(e))throw new s.Z("color is required.");return new l(e.red,e.green,e.blue,e.alpha)},l.toValue=function(e,t){if(!(0,a.Z)(e))throw new s.Z("color is required.");return(0,a.Z)(t)?e.toBytes(t):new Uint8Array(e.toBytes())},l.equals=function(e,t){return e===t||(0,a.Z)(e)&&(0,a.Z)(t)&&e.value[0]===t.value[0]&&e.value[1]===t.value[1]&&e.value[2]===t.value[2]&&e.value[3]===t.value[3]},t.Z=l},7559:function(e,t,i){"use strict";var n=i(4572),r=i(9410),o=i(9824),a=i(512);let s={BYTE:a.Z.BYTE,UNSIGNED_BYTE:a.Z.UNSIGNED_BYTE,SHORT:a.Z.SHORT,UNSIGNED_SHORT:a.Z.UNSIGNED_SHORT,INT:a.Z.INT,UNSIGNED_INT:a.Z.UNSIGNED_INT,FLOAT:a.Z.FLOAT,DOUBLE:a.Z.DOUBLE};s.getSizeInBytes=function(e){if(!(0,r.Z)(e))throw new o.Z("value is required.");switch(e){case s.BYTE:return Int8Array.BYTES_PER_ELEMENT;case s.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case s.SHORT:return Int16Array.BYTES_PER_ELEMENT;case s.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case s.INT:return Int32Array.BYTES_PER_ELEMENT;case s.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case s.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case s.DOUBLE:return Float64Array.BYTES_PER_ELEMENT;default:throw new o.Z("componentDatatype is not a valid value.")}},s.fromTypedArray=function(e){if(e instanceof Int8Array)return s.BYTE;if(e instanceof Uint8Array)return s.UNSIGNED_BYTE;if(e instanceof Int16Array)return s.SHORT;if(e instanceof Uint16Array)return s.UNSIGNED_SHORT;if(e instanceof Int32Array)return s.INT;if(e instanceof Uint32Array)return s.UNSIGNED_INT;if(e instanceof Float32Array)return s.FLOAT;if(e instanceof Float64Array)return s.DOUBLE;throw new o.Z("array must be an Int8Array, Uint8Array, Int16Array, Uint16Array, Int32Array, Uint32Array, Float32Array, or Float64Array.")},s.validate=function(e){return(0,r.Z)(e)&&(e===s.BYTE||e===s.UNSIGNED_BYTE||e===s.SHORT||e===s.UNSIGNED_SHORT||e===s.INT||e===s.UNSIGNED_INT||e===s.FLOAT||e===s.DOUBLE)},s.createTypedArray=function(e,t){if(!(0,r.Z)(e))throw new o.Z("componentDatatype is required.");if(!(0,r.Z)(t))throw new o.Z("valuesOrLength is required.");switch(e){case s.BYTE:return new Int8Array(t);case s.UNSIGNED_BYTE:return new Uint8Array(t);case s.SHORT:return new Int16Array(t);case s.UNSIGNED_SHORT:return new Uint16Array(t);case s.INT:return new Int32Array(t);case s.UNSIGNED_INT:return new Uint32Array(t);case s.FLOAT:return new Float32Array(t);case s.DOUBLE:return new Float64Array(t);default:throw new o.Z("componentDatatype is not a valid value.")}},s.createArrayBufferView=function(e,t,i,a){if(!(0,r.Z)(e))throw new o.Z("componentDatatype is required.");if(!(0,r.Z)(t))throw new o.Z("buffer is required.");switch(i=(0,n.Z)(i,0),a=(0,n.Z)(a,(t.byteLength-i)/s.getSizeInBytes(e)),e){case s.BYTE:return new Int8Array(t,i,a);case s.UNSIGNED_BYTE:return new Uint8Array(t,i,a);case s.SHORT:return new Int16Array(t,i,a);case s.UNSIGNED_SHORT:return new Uint16Array(t,i,a);case s.INT:return new Int32Array(t,i,a);case s.UNSIGNED_INT:return new Uint32Array(t,i,a);case s.FLOAT:return new Float32Array(t,i,a);case s.DOUBLE:return new Float64Array(t,i,a);default:throw new o.Z("componentDatatype is not a valid value.")}},s.fromName=function(e){switch(e){case"BYTE":return s.BYTE;case"UNSIGNED_BYTE":return s.UNSIGNED_BYTE;case"SHORT":return s.SHORT;case"UNSIGNED_SHORT":return s.UNSIGNED_SHORT;case"INT":return s.INT;case"UNSIGNED_INT":return s.UNSIGNED_INT;case"FLOAT":return s.FLOAT;case"DOUBLE":return s.DOUBLE;default:throw new o.Z("name is not a valid value.")}},t.Z=Object.freeze(s)},954:function(e,t,i){"use strict";var n=i(1838),r=i(698),o=i(4572),a=i(9410);let s=0,l={};function c(e,t){let i;r.Z.typeOf.string("html",e),(0,a.Z)(l[e])?i=l[e]:(i=s++,l[e]=i),t=(0,o.Z)(t,!1),this._id=i,this._html=e,this._showOnScreen=t,this._element=void 0}Object.defineProperties(c.prototype,{html:{get:function(){return this._html}},id:{get:function(){return this._id}},showOnScreen:{get:function(){return this._showOnScreen},set:function(e){this._showOnScreen=e}},element:{get:function(){if(!(0,a.Z)(this._element)){let e=n.sanitize(this._html),t=document.createElement("div");t._creditId=this._id,t.style.display="inline",t.innerHTML=e;let i=t.querySelectorAll("a");for(let e=0;e<i.length;e++)i[e].setAttribute("target","_blank");this._element=t}return this._element}}}),c.equals=function(e,t){return e===t||(0,a.Z)(e)&&(0,a.Z)(t)&&e._id===t._id&&e._showOnScreen===t._showOnScreen},c.prototype.equals=function(e){return c.equals(this,e)},c.prototype.isIon=function(){return -1!==this.html.indexOf("ion-credit.png")},c.getIonCredit=function(e){let t=(0,a.Z)(e.collapsible)&&!e.collapsible;return new c(e.html,t)},c.clone=function(e){if((0,a.Z)(e))return new c(e.html,e.showOnScreen)},t.Z=c},8615:function(e,t,i){"use strict";var n=i(1486),r=i(3065),o=i(4572),a=i(9410),s=i(9824),l=i(487),c=i(6222);function u(e){this.planes=(0,o.Z)(e,[])}let h=[new n.Z,new n.Z,new n.Z];n.Z.clone(n.Z.UNIT_X,h[0]),n.Z.clone(n.Z.UNIT_Y,h[1]),n.Z.clone(n.Z.UNIT_Z,h[2]);let d=new n.Z,f=new n.Z,p=new c.Z(new n.Z(1,0,0),0);u.fromBoundingSphere=function(e,t){if(!(0,a.Z)(e))throw new s.Z("boundingSphere is required.");(0,a.Z)(t)||(t=new u);let i=h.length,o=t.planes;o.length=2*i;let l=e.center,c=e.radius,p=0;for(let e=0;e<i;++e){let t=h[e],i=o[p],s=o[p+1];(0,a.Z)(i)||(i=o[p]=new r.Z),(0,a.Z)(s)||(s=o[p+1]=new r.Z),n.Z.multiplyByScalar(t,-c,d),n.Z.add(l,d,d),i.x=t.x,i.y=t.y,i.z=t.z,i.w=-n.Z.dot(t,d),n.Z.multiplyByScalar(t,c,d),n.Z.add(l,d,d),s.x=-t.x,s.y=-t.y,s.z=-t.z,s.w=-n.Z.dot(n.Z.negate(t,f),d),p+=2}return t},u.prototype.computeVisibility=function(e){if(!(0,a.Z)(e))throw new s.Z("boundingVolume is required.");let t=this.planes,i=!1;for(let n=0,r=t.length;n<r;++n){let r=e.intersectPlane(c.Z.fromCartesian4(t[n],p));if(r===l.Z.OUTSIDE)return l.Z.OUTSIDE;r===l.Z.INTERSECTING&&(i=!0)}return i?l.Z.INTERSECTING:l.Z.INSIDE},u.prototype.computeVisibilityWithPlaneMask=function(e,t){if(!(0,a.Z)(e))throw new s.Z("boundingVolume is required.");if(!(0,a.Z)(t))throw new s.Z("parentPlaneMask is required.");if(t===u.MASK_OUTSIDE||t===u.MASK_INSIDE)return t;let i=u.MASK_INSIDE,n=this.planes;for(let r=0,o=n.length;r<o;++r){let o=r<31?1<<r:0;if(r<31&&(t&o)==0)continue;let a=e.intersectPlane(c.Z.fromCartesian4(n[r],p));if(a===l.Z.OUTSIDE)return u.MASK_OUTSIDE;a===l.Z.INTERSECTING&&(i|=o)}return i},u.MASK_OUTSIDE=4294967295,u.MASK_INSIDE=0,u.MASK_INDETERMINATE=2147483647,t.Z=u},9569:function(e,t,i){"use strict";var n=i(4572),r=i(9410),o=i(9824);function a(e,t){e=(0,n.Z)(e,0),this._near=e,t=(0,n.Z)(t,Number.MAX_VALUE),this._far=t}Object.defineProperties(a.prototype,{near:{get:function(){return this._near},set:function(e){this._near=e}},far:{get:function(){return this._far},set:function(e){this._far=e}}}),a.packedLength=2,a.pack=function(e,t,i){if(!(0,r.Z)(e))throw new o.Z("value is required");if(!(0,r.Z)(t))throw new o.Z("array is required");return i=(0,n.Z)(i,0),t[i++]=e.near,t[i]=e.far,t},a.unpack=function(e,t,i){if(!(0,r.Z)(e))throw new o.Z("array is required");return t=(0,n.Z)(t,0),(0,r.Z)(i)||(i=new a),i.near=e[t++],i.far=e[t],i},a.equals=function(e,t){return e===t||(0,r.Z)(e)&&(0,r.Z)(t)&&e.near===t.near&&e.far===t.far},a.clone=function(e,t){if((0,r.Z)(e))return(0,r.Z)(t)||(t=new a),t.near=e.near,t.far=e.far,t},a.prototype.clone=function(e){return a.clone(this,e)},a.prototype.equals=function(e){return a.equals(this,e)},t.Z=a},1039:function(e,t,i){"use strict";var n=i(570),r=i(1486),o=i(2820),a=i(698),s=i(4572),l=i(9410),c=i(9824),u=i(2150),h=i(4833);function d(e,t,i,n){t=(0,s.Z)(t,0),i=(0,s.Z)(i,0),n=(0,s.Z)(n,0),a.Z.typeOf.number.greaterThanOrEquals("x",t,0),a.Z.typeOf.number.greaterThanOrEquals("y",i,0),a.Z.typeOf.number.greaterThanOrEquals("z",n,0),e._radii=new r.Z(t,i,n),e._radiiSquared=new r.Z(t*t,i*i,n*n),e._radiiToTheFourth=new r.Z(t*t*t*t,i*i*i*i,n*n*n*n),e._oneOverRadii=new r.Z(0===t?0:1/t,0===i?0:1/i,0===n?0:1/n),e._oneOverRadiiSquared=new r.Z(0===t?0:1/(t*t),0===i?0:1/(i*i),0===n?0:1/(n*n)),e._minimumRadius=Math.min(t,i,n),e._maximumRadius=Math.max(t,i,n),e._centerToleranceSquared=u.Z.EPSILON1,0!==e._radiiSquared.z&&(e._squaredXOverSquaredZ=e._radiiSquared.x/e._radiiSquared.z)}function f(e,t,i){this._radii=void 0,this._radiiSquared=void 0,this._radiiToTheFourth=void 0,this._oneOverRadii=void 0,this._oneOverRadiiSquared=void 0,this._minimumRadius=void 0,this._maximumRadius=void 0,this._centerToleranceSquared=void 0,this._squaredXOverSquaredZ=void 0,d(this,e,t,i)}Object.defineProperties(f.prototype,{radii:{get:function(){return this._radii}},radiiSquared:{get:function(){return this._radiiSquared}},radiiToTheFourth:{get:function(){return this._radiiToTheFourth}},oneOverRadii:{get:function(){return this._oneOverRadii}},oneOverRadiiSquared:{get:function(){return this._oneOverRadiiSquared}},minimumRadius:{get:function(){return this._minimumRadius}},maximumRadius:{get:function(){return this._maximumRadius}}}),f.clone=function(e,t){if(!(0,l.Z)(e))return;let i=e._radii;return(0,l.Z)(t)?(r.Z.clone(i,t._radii),r.Z.clone(e._radiiSquared,t._radiiSquared),r.Z.clone(e._radiiToTheFourth,t._radiiToTheFourth),r.Z.clone(e._oneOverRadii,t._oneOverRadii),r.Z.clone(e._oneOverRadiiSquared,t._oneOverRadiiSquared),t._minimumRadius=e._minimumRadius,t._maximumRadius=e._maximumRadius,t._centerToleranceSquared=e._centerToleranceSquared,t):new f(i.x,i.y,i.z)},f.fromCartesian3=function(e,t){return(0,l.Z)(t)||(t=new f),(0,l.Z)(e)&&d(t,e.x,e.y,e.z),t},f.WGS84=Object.freeze(new f(6378137,6378137,6356752.314245179)),f.UNIT_SPHERE=Object.freeze(new f(1,1,1)),f.MOON=Object.freeze(new f(u.Z.LUNAR_RADIUS,u.Z.LUNAR_RADIUS,u.Z.LUNAR_RADIUS)),f.prototype.clone=function(e){return f.clone(this,e)},f.packedLength=r.Z.packedLength,f.pack=function(e,t,i){return a.Z.typeOf.object("value",e),a.Z.defined("array",t),i=(0,s.Z)(i,0),r.Z.pack(e._radii,t,i),t},f.unpack=function(e,t,i){a.Z.defined("array",e),t=(0,s.Z)(t,0);let n=r.Z.unpack(e,t);return f.fromCartesian3(n,i)},f.prototype.geocentricSurfaceNormal=r.Z.normalize,f.prototype.geodeticSurfaceNormalCartographic=function(e,t){a.Z.typeOf.object("cartographic",e);let i=e.longitude,n=e.latitude,o=Math.cos(n);return(0,l.Z)(t)||(t=new r.Z),t.x=o*Math.cos(i),t.y=o*Math.sin(i),t.z=Math.sin(n),r.Z.normalize(t,t)},f.prototype.geodeticSurfaceNormal=function(e,t){if(a.Z.typeOf.object("cartesian",e),isNaN(e.x)||isNaN(e.y)||isNaN(e.z))throw new c.Z("cartesian has a NaN component");if(!r.Z.equalsEpsilon(e,r.Z.ZERO,u.Z.EPSILON14))return(0,l.Z)(t)||(t=new r.Z),t=r.Z.multiplyComponents(e,this._oneOverRadiiSquared,t),r.Z.normalize(t,t)};let p=new r.Z,m=new r.Z;f.prototype.cartographicToCartesian=function(e,t){this.geodeticSurfaceNormalCartographic(e,p),r.Z.multiplyComponents(this._radiiSquared,p,m);let i=Math.sqrt(r.Z.dot(p,m));return r.Z.divideByScalar(m,i,m),r.Z.multiplyByScalar(p,e.height,p),(0,l.Z)(t)||(t=new r.Z),r.Z.add(m,p,t)},f.prototype.cartographicArrayToCartesianArray=function(e,t){a.Z.defined("cartographics",e);let i=e.length;(0,l.Z)(t)?t.length=i:t=Array(i);for(let n=0;n<i;n++)t[n]=this.cartographicToCartesian(e[n],t[n]);return t};let _=new r.Z,g=new r.Z,Z=new r.Z;f.prototype.cartesianToCartographic=function(e,t){let i=this.scaleToGeodeticSurface(e,g);if(!(0,l.Z)(i))return;let n=this.geodeticSurfaceNormal(i,_),a=r.Z.subtract(e,i,Z),s=Math.atan2(n.y,n.x),c=Math.asin(n.z),h=u.Z.sign(r.Z.dot(a,e))*r.Z.magnitude(a);return(0,l.Z)(t)?(t.longitude=s,t.latitude=c,t.height=h,t):new o.Z(s,c,h)},f.prototype.cartesianArrayToCartographicArray=function(e,t){a.Z.defined("cartesians",e);let i=e.length;(0,l.Z)(t)?t.length=i:t=Array(i);for(let n=0;n<i;++n)t[n]=this.cartesianToCartographic(e[n],t[n]);return t},f.prototype.scaleToGeodeticSurface=function(e,t){return(0,h.Z)(e,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,t)},f.prototype.scaleToGeocentricSurface=function(e,t){a.Z.typeOf.object("cartesian",e),(0,l.Z)(t)||(t=new r.Z);let i=e.x,n=e.y,o=e.z,s=this._oneOverRadiiSquared,c=1/Math.sqrt(i*i*s.x+n*n*s.y+o*o*s.z);return r.Z.multiplyByScalar(e,c,t)},f.prototype.transformPositionToScaledSpace=function(e,t){return(0,l.Z)(t)||(t=new r.Z),r.Z.multiplyComponents(e,this._oneOverRadii,t)},f.prototype.transformPositionFromScaledSpace=function(e,t){return(0,l.Z)(t)||(t=new r.Z),r.Z.multiplyComponents(e,this._radii,t)},f.prototype.equals=function(e){return this===e||(0,l.Z)(e)&&r.Z.equals(this._radii,e._radii)},f.prototype.toString=function(){return this._radii.toString()},f.prototype.getSurfaceNormalIntersectionWithZAxis=function(e,t,i){if(a.Z.typeOf.object("position",e),!u.Z.equalsEpsilon(this._radii.x,this._radii.y,u.Z.EPSILON15))throw new c.Z("Ellipsoid must be an ellipsoid of revolution (radii.x == radii.y)");a.Z.typeOf.number.greaterThan("Ellipsoid.radii.z",this._radii.z,0),t=(0,s.Z)(t,0);let n=this._squaredXOverSquaredZ;if((0,l.Z)(i)||(i=new r.Z),i.x=0,i.y=0,i.z=e.z*(1-n),!(Math.abs(i.z)>=this._radii.z-t))return i};let y=new r.Z;f.prototype.getLocalCurvature=function(e,t){a.Z.typeOf.object("surfacePosition",e),(0,l.Z)(t)||(t=new n.Z);let i=this.getSurfaceNormalIntersectionWithZAxis(e,0,y),o=r.Z.distance(e,i),s=this.minimumRadius*o/this.maximumRadius**2;return n.Z.fromElements(1/o,1/(o*s**2),t)};let b=[.14887433898163,.43339539412925,.67940956829902,.86506336668898,.97390652851717,0],v=[.29552422471475,.26926671930999,.21908636251598,.14945134915058,.066671344308684,0];function T(e,t,i){a.Z.typeOf.number("a",e),a.Z.typeOf.number("b",t),a.Z.typeOf.func("func",i);let n=.5*(t+e),r=.5*(t-e),o=0;for(let e=0;e<5;e++){let t=r*b[e];o+=v[e]*(i(n+t)+i(n-t))}return o*r}f.prototype.surfaceArea=function(e){a.Z.typeOf.object("rectangle",e);let t=e.west,i=e.east,n=e.south,r=e.north;for(;i<t;)i+=u.Z.TWO_PI;let o=this._radiiSquared,s=o.x,l=o.y,c=o.z,h=s*l;return T(n,r,function(e){let n=Math.cos(e),r=Math.sin(e);return Math.cos(e)*T(t,i,function(e){let t=Math.cos(e),i=Math.sin(e);return Math.sqrt(h*r*r+c*(l*t*t+s*i*i)*n*n)})})},t.Z=f},421:function(e,t,i){"use strict";var n=i(1486),r=i(2820),o=i(698),a=i(4572),s=i(9410),l=i(1039),c=i(2150);function u(e,t,i,n,r,o,a){let s=e*i*(4+e*(4-3*i))/16;return(1-s)*e*t*(n+s*r*(a+s*o*(2*a*a-1)))}let h=new n.Z,d=new n.Z;function f(e,t,i,a){let s=n.Z.normalize(a.cartographicToCartesian(t,d),h),l=n.Z.normalize(a.cartographicToCartesian(i,d),d);o.Z.typeOf.number.greaterThanOrEquals("value",Math.abs(Math.abs(n.Z.angleBetween(s,l))-Math.PI),.0125),function(e,t,i,n,r,o,a){let s,l,h,d,f;let p=(t-i)/t,m=o-n,_=Math.atan((1-p)*Math.tan(r)),g=Math.atan((1-p)*Math.tan(a)),Z=Math.cos(_),y=Math.sin(_),b=Math.cos(g),v=Math.sin(g),T=Z*b,E=Z*v,x=y*v,w=y*b,S=m,C=c.Z.TWO_PI,A=Math.cos(S),I=Math.sin(S);do{let e;let t=E-w*(A=Math.cos(S));s=Math.atan2(h=Math.sqrt(b*b*(I=Math.sin(S))*I+t*t),l=x+T*A),0===h?(e=0,d=1):d=1-(e=T*I/h)*e,C=S,isFinite(f=l-2*x/d)||(f=0),S=m+u(p,e,d,s,h,l,f)}while(Math.abs(S-C)>c.Z.EPSILON12);let O=d*(t*t-i*i)/(i*i),D=O*(256+O*(O*(74-47*O)-128))/1024,P=f*f,R=i*(1+O*(4096+O*(O*(320-175*O)-768))/16384)*(s-D*h*(f+D*(l*(2*P-1)-D*f*(4*h*h-3)*(4*P-3)/6)/4)),N=Math.atan2(b*I,E-w*A),L=Math.atan2(Z*I,E*A-w);e._distance=R,e._startHeading=N,e._endHeading=L,e._uSquared=O}(e,a.maximumRadius,a.minimumRadius,t.longitude,t.latitude,i.longitude,i.latitude),e._start=r.Z.clone(t,e._start),e._end=r.Z.clone(i,e._end),e._start.height=0,e._end.height=0,function(e){let t=e._uSquared,i=e._ellipsoid.maximumRadius,n=e._ellipsoid.minimumRadius,r=(i-n)/i,o=Math.cos(e._startHeading),a=Math.sin(e._startHeading),s=(1-r)*Math.tan(e._start.latitude),l=1/Math.sqrt(1+s*s),c=l*s,u=Math.atan2(s,o),h=l*a,d=h*h,f=1-d,p=Math.sqrt(f),m=t/4,_=m*m,g=_*m,Z=_*_,y=1+m-3*_/4+5*g/4-175*Z/64,b=1-m+15*_/8-35*g/8,v=1-3*m+35*_/4,T=1-5*m,E=y*u-b*Math.sin(2*u)*m/2-v*Math.sin(4*u)*_/16-T*Math.sin(6*u)*g/48-5*Math.sin(8*u)*Z/512,x=e._constants;x.a=i,x.b=n,x.f=r,x.cosineHeading=o,x.sineHeading=a,x.tanU=s,x.cosineU=l,x.sineU=c,x.sigma=u,x.sineAlpha=h,x.sineSquaredAlpha=d,x.cosineSquaredAlpha=f,x.cosineAlpha=p,x.u2Over4=m,x.u4Over16=_,x.u6Over64=g,x.u8Over256=Z,x.a0=y,x.a1=b,x.a2=v,x.a3=T,x.distanceRatio=E}(e)}function p(e,t,i){let n=(0,a.Z)(i,l.Z.WGS84);this._ellipsoid=n,this._start=new r.Z,this._end=new r.Z,this._constants={},this._startHeading=void 0,this._endHeading=void 0,this._distance=void 0,this._uSquared=void 0,(0,s.Z)(e)&&(0,s.Z)(t)&&f(this,e,t,n)}Object.defineProperties(p.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},surfaceDistance:{get:function(){return o.Z.defined("distance",this._distance),this._distance}},start:{get:function(){return this._start}},end:{get:function(){return this._end}},startHeading:{get:function(){return o.Z.defined("distance",this._distance),this._startHeading}},endHeading:{get:function(){return o.Z.defined("distance",this._distance),this._endHeading}}}),p.prototype.setEndPoints=function(e,t){o.Z.defined("start",e),o.Z.defined("end",t),f(this,e,t,this._ellipsoid)},p.prototype.interpolateUsingFraction=function(e,t){return this.interpolateUsingSurfaceDistance(this._distance*e,t)},p.prototype.interpolateUsingSurfaceDistance=function(e,t){o.Z.defined("distance",this._distance);let i=this._constants,n=i.distanceRatio+e/i.b,a=Math.cos(2*n),l=Math.sin(2*n),c=Math.sin(4*n),h=n*n,d=i.u8Over256,f=i.u2Over4,p=i.u6Over64,m=i.u4Over16,_=n*h*2*d*a/3+n*(1-f+7*m/4-15*p/4+579*d/64-(m-15*p/4+187*d/16)*a-(5*p/4-115*d/16)*Math.cos(4*n)-29*d*Math.cos(6*n)/16)+(f/2-m+71*p/32-85*d/16)*l+(5*m/16-5*p/4+383*d/96)*c-h*((p-11*d/2)*l+5*d*c/2)+(29*p/96-29*d/16)*Math.sin(6*n)+539*d*Math.sin(8*n)/1536,g=Math.asin(Math.sin(_)*i.cosineAlpha),Z=Math.atan(i.a/i.b*Math.tan(g));_-=i.sigma;let y=Math.cos(2*i.sigma+_),b=Math.sin(_),v=Math.cos(_),T=i.cosineU*v,E=i.sineU*b,x=Math.atan2(b*i.sineHeading,T-E*i.cosineHeading)-u(i.f,i.sineAlpha,i.cosineSquaredAlpha,_,b,v,y);return(0,s.Z)(t)?(t.longitude=this._start.longitude+x,t.latitude=Z,t.height=0,t):new r.Z(this._start.longitude+x,Z,0)},t.Z=p},8385:function(e,t,i){"use strict";let n;var r=i(7643),o=i(570),a=i(1486),s=i(7559),l=i(4572),c=i(9410),u=i(9824),h=i(1039),d=i(3086),f=i(2601),p=i(258),m=i(2246),_=i(5837),g=i(2150),Z=i(5022),y=i(4915);let b=new a.Z,v=new a.Z,T=new a.Z,E=new a.Z,x=new a.Z,w=new a.Z(1,1,1),S=Math.cos,C=Math.sin;function A(e){e=(0,l.Z)(e,l.Z.EMPTY_OBJECT);let t=(0,l.Z)(e.radii,w),i=(0,l.Z)(e.innerRadii,t),n=(0,l.Z)(e.minimumClock,0),r=(0,l.Z)(e.maximumClock,g.Z.TWO_PI),o=(0,l.Z)(e.minimumCone,0),s=(0,l.Z)(e.maximumCone,g.Z.PI),c=Math.round((0,l.Z)(e.stackPartitions,64)),h=Math.round((0,l.Z)(e.slicePartitions,64)),d=(0,l.Z)(e.vertexFormat,y.Z.DEFAULT);if(h<3)throw new u.Z("options.slicePartitions cannot be less than three.");if(c<3)throw new u.Z("options.stackPartitions cannot be less than three.");this._radii=a.Z.clone(t),this._innerRadii=a.Z.clone(i),this._minimumClock=n,this._maximumClock=r,this._minimumCone=o,this._maximumCone=s,this._stackPartitions=c,this._slicePartitions=h,this._vertexFormat=y.Z.clone(d),this._offsetAttribute=e.offsetAttribute,this._workerName="createEllipsoidGeometry"}A.packedLength=2*a.Z.packedLength+y.Z.packedLength+7,A.pack=function(e,t,i){if(!(0,c.Z)(e))throw new u.Z("value is required");if(!(0,c.Z)(t))throw new u.Z("array is required");return i=(0,l.Z)(i,0),a.Z.pack(e._radii,t,i),i+=a.Z.packedLength,a.Z.pack(e._innerRadii,t,i),i+=a.Z.packedLength,y.Z.pack(e._vertexFormat,t,i),i+=y.Z.packedLength,t[i++]=e._minimumClock,t[i++]=e._maximumClock,t[i++]=e._minimumCone,t[i++]=e._maximumCone,t[i++]=e._stackPartitions,t[i++]=e._slicePartitions,t[i]=(0,l.Z)(e._offsetAttribute,-1),t};let I=new a.Z,O=new a.Z,D=new y.Z,P={radii:I,innerRadii:O,vertexFormat:D,minimumClock:void 0,maximumClock:void 0,minimumCone:void 0,maximumCone:void 0,stackPartitions:void 0,slicePartitions:void 0,offsetAttribute:void 0};A.unpack=function(e,t,i){if(!(0,c.Z)(e))throw new u.Z("array is required");t=(0,l.Z)(t,0);let n=a.Z.unpack(e,t,I);t+=a.Z.packedLength;let r=a.Z.unpack(e,t,O);t+=a.Z.packedLength;let o=y.Z.unpack(e,t,D);t+=y.Z.packedLength;let s=e[t++],h=e[t++],d=e[t++],f=e[t++],p=e[t++],m=e[t++],_=e[t];return(0,c.Z)(i)?(i._radii=a.Z.clone(n,i._radii),i._innerRadii=a.Z.clone(r,i._innerRadii),i._vertexFormat=y.Z.clone(o,i._vertexFormat),i._minimumClock=s,i._maximumClock=h,i._minimumCone=d,i._maximumCone=f,i._stackPartitions=p,i._slicePartitions=m,i._offsetAttribute=-1===_?void 0:_,i):(P.minimumClock=s,P.maximumClock=h,P.minimumCone=d,P.maximumCone=f,P.stackPartitions=p,P.slicePartitions=m,P.offsetAttribute=-1===_?void 0:_,new A(P))},A.createGeometry=function(e){let t,i,n,l,u,y,w;let A=e._radii;if(A.x<=0||A.y<=0||A.z<=0)return;let I=e._innerRadii;if(I.x<=0||I.y<=0||I.z<=0)return;let O=e._minimumClock,D=e._maximumClock,P=e._minimumCone,R=e._maximumCone,N=e._vertexFormat,L=e._slicePartitions+1,M=e._stackPartitions+1;L=Math.round(L*Math.abs(D-O)/g.Z.TWO_PI),M=Math.round(M*Math.abs(R-P)/g.Z.PI),L<2&&(L=2),M<2&&(M=2);let F=0,z=[P],B=[O];for(t=0;t<M;t++)z.push(P+t*(R-P)/(M-1));for(z.push(R),i=0;i<L;i++)B.push(O+i*(D-O)/(L-1));B.push(D);let U=z.length,k=B.length,V=0,H=1,G=I.x!==A.x||I.y!==A.y||I.z!==A.z,j=!1,W=!1,q=!1;G&&(H=2,P>0&&(j=!0,V+=L-1),R<Math.PI&&(W=!0,V+=L-1),(D-O)%g.Z.TWO_PI?(q=!0,V+=(M-1)*2+1):V+=1);let Y=k*U*H,X=new Float64Array(3*Y),$=Array(Y).fill(!1),K=Array(Y).fill(!1),Q=L*M*H,J=6*(Q+V+1-(L+M)*H),ee=_.Z.createTypedArray(Q,J),et=N.normal?new Float32Array(3*Y):void 0,ei=N.tangent?new Float32Array(3*Y):void 0,en=N.bitangent?new Float32Array(3*Y):void 0,er=N.st?new Float32Array(2*Y):void 0,eo=Array(U),ea=Array(U);for(t=0;t<U;t++)eo[t]=C(z[t]),ea[t]=S(z[t]);let es=Array(k),el=Array(k);for(i=0;i<k;i++)el[i]=S(B[i]),es[i]=C(B[i]);for(t=0;t<U;t++)for(i=0;i<k;i++)X[F++]=A.x*eo[t]*el[i],X[F++]=A.y*eo[t]*es[i],X[F++]=A.z*ea[t];let ec=Y/2;if(G)for(t=0;t<U;t++)for(i=0;i<k;i++)X[F++]=I.x*eo[t]*el[i],X[F++]=I.y*eo[t]*es[i],X[F++]=I.z*ea[t],$[ec]=!0,t>0&&t!==U-1&&0!==i&&i!==k-1&&(K[ec]=!0),ec++;for(t=1,F=0;t<U-2;t++)for(i=1,n=t*k,l=(t+1)*k;i<k-2;i++)ee[F++]=l+i,ee[F++]=l+i+1,ee[F++]=n+i+1,ee[F++]=l+i,ee[F++]=n+i+1,ee[F++]=n+i;if(G){let e=U*k;for(t=1;t<U-2;t++)for(i=1,n=e+t*k,l=e+(t+1)*k;i<k-2;i++)ee[F++]=l+i,ee[F++]=n+i,ee[F++]=n+i+1,ee[F++]=l+i,ee[F++]=n+i+1,ee[F++]=l+i+1}if(G){if(j)for(t=1,y=U*k;t<k-2;t++)ee[F++]=t,ee[F++]=t+1,ee[F++]=y+t+1,ee[F++]=t,ee[F++]=y+t+1,ee[F++]=y+t;if(W)for(t=1,u=U*k-k,y=U*k*H-k;t<k-2;t++)ee[F++]=u+t+1,ee[F++]=u+t,ee[F++]=y+t,ee[F++]=u+t+1,ee[F++]=y+t,ee[F++]=y+t+1}if(q){for(t=1;t<U-2;t++)y=k*U+k*t,u=k*t,ee[F++]=y,ee[F++]=u+k,ee[F++]=u,ee[F++]=y,ee[F++]=y+k,ee[F++]=u+k;for(t=1;t<U-2;t++)y=k*U+k*(t+1)-1,u=k*(t+1)-1,ee[F++]=u+k,ee[F++]=y,ee[F++]=u,ee[F++]=u+k,ee[F++]=y+k,ee[F++]=y}let eu=new p.Z;N.position&&(eu.position=new f.Z({componentDatatype:s.Z.DOUBLE,componentsPerAttribute:3,values:X}));let eh=0,ed=0,ef=0,ep=0,em=Y/2,e_=h.Z.fromCartesian3(A),eg=h.Z.fromCartesian3(I);if(N.st||N.normal||N.tangent||N.bitangent){for(t=0;t<Y;t++){w=$[t]?eg:e_;let e=a.Z.fromArray(X,3*t,b),i=w.geodeticSurfaceNormal(e,v);if(K[t]&&a.Z.negate(i,i),N.st){let e=o.Z.negate(i,x);er[eh++]=Math.atan2(e.y,e.x)/g.Z.TWO_PI+.5,er[eh++]=Math.asin(i.z)/Math.PI+.5}if(N.normal&&(et[ed++]=i.x,et[ed++]=i.y,et[ed++]=i.z),N.tangent||N.bitangent){let e;let n=0;if($[t]&&(n=em),e=!j&&t>=n&&t<n+2*k?a.Z.UNIT_X:a.Z.UNIT_Z,a.Z.cross(e,i,T),a.Z.normalize(T,T),N.tangent&&(ei[ef++]=T.x,ei[ef++]=T.y,ei[ef++]=T.z),N.bitangent){let e=a.Z.cross(i,T,E);a.Z.normalize(e,e),en[ep++]=e.x,en[ep++]=e.y,en[ep++]=e.z}}}N.st&&(eu.st=new f.Z({componentDatatype:s.Z.FLOAT,componentsPerAttribute:2,values:er})),N.normal&&(eu.normal=new f.Z({componentDatatype:s.Z.FLOAT,componentsPerAttribute:3,values:et})),N.tangent&&(eu.tangent=new f.Z({componentDatatype:s.Z.FLOAT,componentsPerAttribute:3,values:ei})),N.bitangent&&(eu.bitangent=new f.Z({componentDatatype:s.Z.FLOAT,componentsPerAttribute:3,values:en}))}if((0,c.Z)(e._offsetAttribute)){let t=X.length,i=e._offsetAttribute===m.Z.NONE?0:1,n=new Uint8Array(t/3).fill(i);eu.applyOffset=new f.Z({componentDatatype:s.Z.UNSIGNED_BYTE,componentsPerAttribute:1,values:n})}return new d.Z({attributes:eu,indices:ee,primitiveType:Z.Z.TRIANGLES,boundingSphere:r.Z.fromEllipsoid(e_),offsetAttribute:e._offsetAttribute})},A.getUnitEllipsoid=function(){return(0,c.Z)(n)||(n=A.createGeometry(new A({radii:new a.Z(1,1,1),vertexFormat:y.Z.POSITION_ONLY}))),n},t.Z=A},2501:function(e,t,i){"use strict";var n=i(7643),r=i(1486),o=i(7559),a=i(4572),s=i(9410),l=i(9824),c=i(1039),u=i(3086),h=i(2601),d=i(258),f=i(2246),p=i(5837),m=i(2150),_=i(5022);let g=new r.Z(1,1,1),Z=Math.cos,y=Math.sin;function b(e){e=(0,a.Z)(e,a.Z.EMPTY_OBJECT);let t=(0,a.Z)(e.radii,g),i=(0,a.Z)(e.innerRadii,t),n=(0,a.Z)(e.minimumClock,0),o=(0,a.Z)(e.maximumClock,m.Z.TWO_PI),c=(0,a.Z)(e.minimumCone,0),u=(0,a.Z)(e.maximumCone,m.Z.PI),h=Math.round((0,a.Z)(e.stackPartitions,10)),d=Math.round((0,a.Z)(e.slicePartitions,8)),p=Math.round((0,a.Z)(e.subdivisions,128));if(h<1)throw new l.Z("options.stackPartitions cannot be less than 1");if(d<0)throw new l.Z("options.slicePartitions cannot be less than 0");if(p<0)throw new l.Z("options.subdivisions must be greater than or equal to zero.");if((0,s.Z)(e.offsetAttribute)&&e.offsetAttribute===f.Z.TOP)throw new l.Z("GeometryOffsetAttribute.TOP is not a supported options.offsetAttribute for this geometry.");this._radii=r.Z.clone(t),this._innerRadii=r.Z.clone(i),this._minimumClock=n,this._maximumClock=o,this._minimumCone=c,this._maximumCone=u,this._stackPartitions=h,this._slicePartitions=d,this._subdivisions=p,this._offsetAttribute=e.offsetAttribute,this._workerName="createEllipsoidOutlineGeometry"}b.packedLength=2*r.Z.packedLength+8,b.pack=function(e,t,i){if(!(0,s.Z)(e))throw new l.Z("value is required");if(!(0,s.Z)(t))throw new l.Z("array is required");return i=(0,a.Z)(i,0),r.Z.pack(e._radii,t,i),i+=r.Z.packedLength,r.Z.pack(e._innerRadii,t,i),i+=r.Z.packedLength,t[i++]=e._minimumClock,t[i++]=e._maximumClock,t[i++]=e._minimumCone,t[i++]=e._maximumCone,t[i++]=e._stackPartitions,t[i++]=e._slicePartitions,t[i++]=e._subdivisions,t[i]=(0,a.Z)(e._offsetAttribute,-1),t};let v=new r.Z,T=new r.Z,E={radii:v,innerRadii:T,minimumClock:void 0,maximumClock:void 0,minimumCone:void 0,maximumCone:void 0,stackPartitions:void 0,slicePartitions:void 0,subdivisions:void 0,offsetAttribute:void 0};b.unpack=function(e,t,i){if(!(0,s.Z)(e))throw new l.Z("array is required");t=(0,a.Z)(t,0);let n=r.Z.unpack(e,t,v);t+=r.Z.packedLength;let o=r.Z.unpack(e,t,T);t+=r.Z.packedLength;let c=e[t++],u=e[t++],h=e[t++],d=e[t++],f=e[t++],p=e[t++],m=e[t++],_=e[t];return(0,s.Z)(i)?(i._radii=r.Z.clone(n,i._radii),i._innerRadii=r.Z.clone(o,i._innerRadii),i._minimumClock=c,i._maximumClock=u,i._minimumCone=h,i._maximumCone=d,i._stackPartitions=f,i._slicePartitions=p,i._subdivisions=m,i._offsetAttribute=-1===_?void 0:_,i):(E.minimumClock=c,E.maximumClock=u,E.minimumCone=h,E.maximumCone=d,E.stackPartitions=f,E.slicePartitions=p,E.subdivisions=m,E.offsetAttribute=-1===_?void 0:_,new b(E))},b.createGeometry=function(e){let t,i,r,a;let l=e._radii;if(l.x<=0||l.y<=0||l.z<=0)return;let g=e._innerRadii;if(g.x<=0||g.y<=0||g.z<=0)return;let b=e._minimumClock,v=e._maximumClock,T=e._minimumCone,E=e._maximumCone,x=e._subdivisions,w=c.Z.fromCartesian3(l),S=e._slicePartitions+1,C=e._stackPartitions+1;S=Math.round(S*Math.abs(v-b)/m.Z.TWO_PI),C=Math.round(C*Math.abs(E-T)/m.Z.PI),S<2&&(S=2),C<2&&(C=2);let A=0,I=1,O=g.x!==l.x||g.y!==l.y||g.z!==l.z,D=!1,P=!1;O&&(I=2,T>0&&(D=!0,A+=S),E<Math.PI&&(P=!0,A+=S));let R=x*I*(C+S),N=new Float64Array(3*R),L=2*(R+A-(S+C)*I),M=p.Z.createTypedArray(R,L),F=0,z=Array(C),B=Array(C);for(t=0;t<C;t++)a=T+t*(E-T)/(C-1),z[t]=y(a),B[t]=Z(a);let U=Array(x),k=Array(x);for(t=0;t<x;t++)r=b+t*(v-b)/(x-1),U[t]=y(r),k[t]=Z(r);for(t=0;t<C;t++)for(i=0;i<x;i++)N[F++]=l.x*z[t]*k[i],N[F++]=l.y*z[t]*U[i],N[F++]=l.z*B[t];if(O)for(t=0;t<C;t++)for(i=0;i<x;i++)N[F++]=g.x*z[t]*k[i],N[F++]=g.y*z[t]*U[i],N[F++]=g.z*B[t];for(t=0,z.length=x,B.length=x;t<x;t++)a=T+t*(E-T)/(x-1),z[t]=y(a),B[t]=Z(a);for(t=0,U.length=S,k.length=S;t<S;t++)r=b+t*(v-b)/(S-1),U[t]=y(r),k[t]=Z(r);for(t=0;t<x;t++)for(i=0;i<S;i++)N[F++]=l.x*z[t]*k[i],N[F++]=l.y*z[t]*U[i],N[F++]=l.z*B[t];if(O)for(t=0;t<x;t++)for(i=0;i<S;i++)N[F++]=g.x*z[t]*k[i],N[F++]=g.y*z[t]*U[i],N[F++]=g.z*B[t];for(t=0,F=0;t<C*I;t++){let e=t*x;for(i=0;i<x-1;i++)M[F++]=e+i,M[F++]=e+i+1}let V=C*x*I;for(t=0;t<S;t++)for(i=0;i<x-1;i++)M[F++]=V+t+i*S,M[F++]=V+t+(i+1)*S;if(O)for(t=0,V=C*x*I+S*x;t<S;t++)for(i=0;i<x-1;i++)M[F++]=V+t+i*S,M[F++]=V+t+(i+1)*S;if(O){let e=C*x*I,i=e+x*S;if(D)for(t=0;t<S;t++)M[F++]=e+t,M[F++]=i+t;if(P)for(e+=x*S-S,i+=x*S-S,t=0;t<S;t++)M[F++]=e+t,M[F++]=i+t}let H=new d.Z({position:new h.Z({componentDatatype:o.Z.DOUBLE,componentsPerAttribute:3,values:N})});if((0,s.Z)(e._offsetAttribute)){let t=N.length,i=e._offsetAttribute===f.Z.NONE?0:1,n=new Uint8Array(t/3).fill(i);H.applyOffset=new h.Z({componentDatatype:o.Z.UNSIGNED_BYTE,componentsPerAttribute:1,values:n})}return new u.Z({attributes:H,indices:M,primitiveType:_.Z.LINES,boundingSphere:n.Z.fromEllipsoid(w),offsetAttribute:e._offsetAttribute})},t.Z=b},2077:function(e,t,i){"use strict";var n=i(1486),r=i(2820),o=i(698),a=i(4572),s=i(9410),l=i(9824),c=i(1039),u=i(2150);function h(e,t,i){if(0===e)return t*i;let n=e*e,r=n*n,o=r*n,a=o*n,s=a*n,l=s*n;return t*((1-n/4-3*r/64-5*o/256-175*a/16384-441*s/65536-4851*l/1048576)*i-(3*n/8+3*r/32+45*o/1024+105*a/4096+2205*s/131072+6237*l/524288)*Math.sin(2*i)+(15*r/256+45*o/1024+525*a/16384+1575*s/65536+155925*l/8388608)*Math.sin(4*i)-(35*o/3072+175*a/12288+3675*s/262144+13475*l/1048576)*Math.sin(6*i)+(315*a/131072+2205*s/524288+43659*l/8388608)*Math.sin(8*i)-(693*s/1310720+6237*l/5242880)*Math.sin(10*i)+1001*l/8388608*Math.sin(12*i))}function d(e,t){if(0===e)return Math.log(Math.tan(.5*(u.Z.PI_OVER_TWO+t)));let i=e*Math.sin(t);return Math.log(Math.tan(.5*(u.Z.PI_OVER_TWO+t)))-e/2*Math.log((1+i)/(1-i))}let f=new n.Z,p=new n.Z;function m(e,t,i,a){let s=n.Z.normalize(a.cartographicToCartesian(t,p),f),l=n.Z.normalize(a.cartographicToCartesian(i,p),p);o.Z.typeOf.number.greaterThanOrEquals("value",Math.abs(Math.abs(n.Z.angleBetween(s,l))-Math.PI),.0125);let c=a.maximumRadius,m=a.minimumRadius,_=c*c;e._ellipticitySquared=(_-m*m)/_,e._ellipticity=Math.sqrt(e._ellipticitySquared),e._start=r.Z.clone(t,e._start),e._start.height=0,e._end=r.Z.clone(i,e._end),e._end.height=0,e._heading=function(e,t,i,n,r){let o=d(e._ellipticity,i),a=d(e._ellipticity,r);return Math.atan2(u.Z.negativePiToPi(n-t),a-o)}(e,t.longitude,t.latitude,i.longitude,i.latitude),e._distance=function(e,t,i,n,r,o,a){let s=e._heading,l=o-n,c=0;if(u.Z.equalsEpsilon(Math.abs(s),u.Z.PI_OVER_TWO,u.Z.EPSILON8)){if(t===i)c=t*Math.cos(r)*u.Z.negativePiToPi(l);else{let i=Math.sin(r);c=t*Math.cos(r)*u.Z.negativePiToPi(l)/Math.sqrt(1-e._ellipticitySquared*i*i)}}else{let i=h(e._ellipticity,t,r);c=(h(e._ellipticity,t,a)-i)/Math.cos(s)}return Math.abs(c)}(e,a.maximumRadius,a.minimumRadius,t.longitude,t.latitude,i.longitude,i.latitude)}function _(e,t,i,n,o,a){let l,c,f;if(0===i)return r.Z.clone(e,a);let p=o*o;if(Math.abs(u.Z.PI_OVER_TWO-Math.abs(t))>u.Z.EPSILON8){if(c=function(e,t,i){let n=e/i;if(0===t)return n;let r=n*n,o=r*n,a=o*n,s=t*t,l=s*s,c=l*s,u=c*s,h=u*s,d=h*s;return n+n*s/4+7*n*l/64+15*n*c/256+579*n*u/16384+1515*n*h/65536+16837*n*d/1048576+(3*n*l/16+45*n*c/256-n*(32*r-561)*u/4096-n*(232*r-1677)*h/16384+n*(399985-90560*r+512*a)*d/5242880)*Math.cos(2*n)+(21*n*c/256+483*n*u/4096-n*(224*r-1969)*h/16384-n*(33152*r-112599)*d/1048576)*Math.cos(4*n)+(151*n*u/4096+4681*n*h/65536+1479*n*d/16384-453*o*d/32768)*Math.cos(6*n)+(1097*n*h/65536+42783*n*d/1048576)*Math.cos(8*n)+8011*n*d/1048576*Math.cos(10*n)+(3*s/8+3*l/16+213*c/2048-3*r*c/64+255*u/4096-33*r*u/512+20861*h/524288-33*r*h/512+a*h/1024+28273*d/1048576-471*r*d/8192+9*a*d/4096)*Math.sin(2*n)+(21*l/256+21*c/256+533*u/8192-21*r*u/512+197*h/4096-315*r*h/4096+584039*d/16777216-12517*r*d/131072+7*a*d/2048)*Math.sin(4*n)+(151*c/6144+151*u/4096+5019*h/131072-453*r*h/16384+26965*d/786432-8607*r*d/131072)*Math.sin(6*n)+(1097*u/131072+1097*h/65536+225797*d/10485760-1097*r*d/65536)*Math.sin(8*n)+(8011*h/2621440+8011*d/1048576)*Math.sin(10*n)+293393*d/251658240*Math.sin(12*n)}(h(o,n,e.latitude)+i*Math.cos(t),o,n),Math.abs(t)<u.Z.EPSILON10)l=u.Z.negativePiToPi(e.longitude);else{let i=d(o,e.latitude);f=Math.tan(t)*(d(o,c)-i),l=u.Z.negativePiToPi(e.longitude+f)}}else{let r;if(c=e.latitude,0===o)r=n*Math.cos(e.latitude);else{let t=Math.sin(e.latitude);r=n*Math.cos(e.latitude)/Math.sqrt(1-p*t*t)}f=i/r,l=t>0?u.Z.negativePiToPi(e.longitude+f):u.Z.negativePiToPi(e.longitude-f)}return(0,s.Z)(a)?(a.longitude=l,a.latitude=c,a.height=0,a):new r.Z(l,c,0)}function g(e,t,i){let n=(0,a.Z)(i,c.Z.WGS84);this._ellipsoid=n,this._start=new r.Z,this._end=new r.Z,this._heading=void 0,this._distance=void 0,this._ellipticity=void 0,this._ellipticitySquared=void 0,(0,s.Z)(e)&&(0,s.Z)(t)&&m(this,e,t,n)}Object.defineProperties(g.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},surfaceDistance:{get:function(){return o.Z.defined("distance",this._distance),this._distance}},start:{get:function(){return this._start}},end:{get:function(){return this._end}},heading:{get:function(){return o.Z.defined("distance",this._distance),this._heading}}}),g.fromStartHeadingDistance=function(e,t,i,n,r){o.Z.defined("start",e),o.Z.defined("heading",t),o.Z.defined("distance",i),o.Z.typeOf.number.greaterThan("distance",i,0);let l=(0,a.Z)(n,c.Z.WGS84),h=l.maximumRadius,d=l.minimumRadius,f=h*h,p=_(e,t=u.Z.negativePiToPi(t),i,l.maximumRadius,Math.sqrt((f-d*d)/f));return!(0,s.Z)(r)||(0,s.Z)(n)&&!n.equals(r.ellipsoid)?new g(e,p,l):(r.setEndPoints(e,p),r)},g.prototype.setEndPoints=function(e,t){o.Z.defined("start",e),o.Z.defined("end",t),m(this,e,t,this._ellipsoid)},g.prototype.interpolateUsingFraction=function(e,t){return this.interpolateUsingSurfaceDistance(e*this._distance,t)},g.prototype.interpolateUsingSurfaceDistance=function(e,t){if(o.Z.typeOf.number("distance",e),!(0,s.Z)(this._distance)||0===this._distance)throw new l.Z("EllipsoidRhumbLine must have distinct start and end set.");return _(this._start,this._heading,e,this._ellipsoid.maximumRadius,this._ellipticity,t)},g.prototype.findIntersectionWithLongitude=function(e,t){let i;if(o.Z.typeOf.number("intersectionLongitude",e),!(0,s.Z)(this._distance)||0===this._distance)throw new l.Z("EllipsoidRhumbLine must have distinct start and end set.");let n=this._ellipticity,a=this._heading,c=Math.abs(a),h=this._start;if(e=u.Z.negativePiToPi(e),u.Z.equalsEpsilon(Math.abs(e),Math.PI,u.Z.EPSILON14)&&(e=u.Z.sign(h.longitude)*Math.PI),(0,s.Z)(t)||(t=new r.Z),Math.abs(u.Z.PI_OVER_TWO-c)<=u.Z.EPSILON8)return t.longitude=e,t.latitude=h.latitude,t.height=0,t;if(u.Z.equalsEpsilon(Math.abs(u.Z.PI_OVER_TWO-c),u.Z.PI_OVER_TWO,u.Z.EPSILON8)){if(u.Z.equalsEpsilon(e,h.longitude,u.Z.EPSILON12))return;return t.longitude=e,t.latitude=u.Z.PI_OVER_TWO*u.Z.sign(u.Z.PI_OVER_TWO-a),t.height=0,t}let d=h.latitude,f=n*Math.sin(d),p=Math.tan(.5*(u.Z.PI_OVER_TWO+d))*Math.exp((e-h.longitude)/Math.tan(a)),m=(1+f)/(1-f),_=h.latitude;do{let e=n*Math.sin(i=_);_=2*Math.atan(p*Math.pow((1+e)/(1-e)/m,n/2))-u.Z.PI_OVER_TWO}while(!u.Z.equalsEpsilon(_,i,u.Z.EPSILON12));return t.longitude=e,t.latitude=_,t.height=0,t},g.prototype.findIntersectionWithLatitude=function(e,t){if(o.Z.typeOf.number("intersectionLatitude",e),!(0,s.Z)(this._distance)||0===this._distance)throw new l.Z("EllipsoidRhumbLine must have distinct start and end set.");let i=this._ellipticity,n=this._heading,a=this._start;if(u.Z.equalsEpsilon(Math.abs(n),u.Z.PI_OVER_TWO,u.Z.EPSILON8))return;let c=d(i,a.latitude),h=d(i,e),f=u.Z.negativePiToPi(a.longitude+Math.tan(n)*(h-c));return(0,s.Z)(t)?(t.longitude=f,t.latitude=e,t.height=0,t):new r.Z(f,e,0)},t.Z=g},7809:function(e,t,i){"use strict";var n=i(2741),r=i(570),o=i(1486),a=i(3065),s=i(698),l=i(4572),c=i(9410),u=i(9824),h=i(1039),d=i(15),f=i(4749),p=i(6222),m=i(5352),_=i(7119);let g=new a.Z;function Z(e,t){if(s.Z.defined("origin",e),e=(t=(0,l.Z)(t,h.Z.WGS84)).scaleToGeodeticSurface(e),!(0,c.Z)(e))throw new u.Z("origin must not be at the center of the ellipsoid.");let i=_.Z.eastNorthUpToFixedFrame(e,t);this._ellipsoid=t,this._origin=e,this._xAxis=o.Z.fromCartesian4(f.Z.getColumn(i,0,g)),this._yAxis=o.Z.fromCartesian4(f.Z.getColumn(i,1,g));let n=o.Z.fromCartesian4(f.Z.getColumn(i,2,g));this._plane=p.Z.fromPointNormal(e,n)}Object.defineProperties(Z.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},origin:{get:function(){return this._origin}},plane:{get:function(){return this._plane}},xAxis:{get:function(){return this._xAxis}},yAxis:{get:function(){return this._yAxis}},zAxis:{get:function(){return this._plane.normal}}});let y=new n.Z;Z.fromPoints=function(e,t){return s.Z.defined("cartesians",e),new Z(n.Z.fromPoints(e,y).center,t)};let b=new m.Z,v=new o.Z;Z.prototype.projectPointOntoPlane=function(e,t){s.Z.defined("cartesian",e),b.origin=e,o.Z.normalize(e,b.direction);let i=d.Z.rayPlane(b,this._plane,v);if((0,c.Z)(i)||(o.Z.negate(b.direction,b.direction),i=d.Z.rayPlane(b,this._plane,v)),(0,c.Z)(i)){let e=o.Z.subtract(i,this._origin,i),n=o.Z.dot(this._xAxis,e),a=o.Z.dot(this._yAxis,e);return(0,c.Z)(t)?(t.x=n,t.y=a,t):new r.Z(n,a)}},Z.prototype.projectPointsOntoPlane=function(e,t){s.Z.defined("cartesians",e),(0,c.Z)(t)||(t=[]);let i=0,n=e.length;for(let r=0;r<n;r++){let n=this.projectPointOntoPlane(e[r],t[i]);(0,c.Z)(n)&&(t[i]=n,i++)}return t.length=i,t},Z.prototype.projectPointToNearestOnPlane=function(e,t){s.Z.defined("cartesian",e),(0,c.Z)(t)||(t=new r.Z),b.origin=e,o.Z.clone(this._plane.normal,b.direction);let i=d.Z.rayPlane(b,this._plane,v);(0,c.Z)(i)||(o.Z.negate(b.direction,b.direction),i=d.Z.rayPlane(b,this._plane,v));let n=o.Z.subtract(i,this._origin,i),a=o.Z.dot(this._xAxis,n),l=o.Z.dot(this._yAxis,n);return t.x=a,t.y=l,t},Z.prototype.projectPointsToNearestOnPlane=function(e,t){s.Z.defined("cartesians",e),(0,c.Z)(t)||(t=[]);let i=e.length;t.length=i;for(let n=0;n<i;n++)t[n]=this.projectPointToNearestOnPlane(e[n],t[n]);return t};let T=new o.Z;Z.prototype.projectPointOntoEllipsoid=function(e,t){s.Z.defined("cartesian",e),(0,c.Z)(t)||(t=new o.Z);let i=this._ellipsoid,n=this._origin,r=this._xAxis,a=this._yAxis;return o.Z.multiplyByScalar(r,e.x,T),t=o.Z.add(n,T,t),o.Z.multiplyByScalar(a,e.y,T),o.Z.add(t,T,t),i.scaleToGeocentricSurface(t,t),t},Z.prototype.projectPointsOntoEllipsoid=function(e,t){s.Z.defined("cartesians",e);let i=e.length;(0,c.Z)(t)?t.length=i:t=Array(i);for(let n=0;n<i;++n)t[n]=this.projectPointOntoEllipsoid(e[n],t[n]);return t},t.Z=Z},8757:function(e,t,i){"use strict";var n=i(7643),r=i(1486),o=i(698),a=i(4572),s=i(9410),l=i(1039),c=i(8054);function u(e,t){o.Z.typeOf.object("ellipsoid",e),this._ellipsoid=e,this._cameraPosition=new r.Z,this._cameraPositionInScaledSpace=new r.Z,this._distanceToLimbInScaledSpaceSquared=0,(0,s.Z)(t)&&(this.cameraPosition=t)}Object.defineProperties(u.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},cameraPosition:{get:function(){return this._cameraPosition},set:function(e){let t=this._ellipsoid.transformPositionToScaledSpace(e,this._cameraPositionInScaledSpace),i=r.Z.magnitudeSquared(t)-1;r.Z.clone(e,this._cameraPosition),this._cameraPositionInScaledSpace=t,this._distanceToLimbInScaledSpaceSquared=i}}});let h=new r.Z;u.prototype.isPointVisible=function(e){return b(this._ellipsoid.transformPositionToScaledSpace(e,h),this._cameraPositionInScaledSpace,this._distanceToLimbInScaledSpaceSquared)},u.prototype.isScaledSpacePointVisible=function(e){return b(e,this._cameraPositionInScaledSpace,this._distanceToLimbInScaledSpaceSquared)};let d=new r.Z;u.prototype.isScaledSpacePointVisiblePossiblyUnderEllipsoid=function(e,t){let i,n;let r=this._ellipsoid;return(0,s.Z)(t)&&t<0&&r.minimumRadius>-t?((n=d).x=this._cameraPosition.x/(r.radii.x+t),n.y=this._cameraPosition.y/(r.radii.y+t),n.z=this._cameraPosition.z/(r.radii.z+t),i=n.x*n.x+n.y*n.y+n.z*n.z-1):(n=this._cameraPositionInScaledSpace,i=this._distanceToLimbInScaledSpaceSquared),b(e,n,i)},u.prototype.computeHorizonCullingPoint=function(e,t,i){return g(this._ellipsoid,e,t,i)};let f=l.Z.clone(l.Z.UNIT_SPHERE);u.prototype.computeHorizonCullingPointPossiblyUnderEllipsoid=function(e,t,i,n){return g(_(this._ellipsoid,i,f),e,t,n)},u.prototype.computeHorizonCullingPointFromVertices=function(e,t,i,n,r){return y(this._ellipsoid,e,t,i,n,r)},u.prototype.computeHorizonCullingPointFromVerticesPossiblyUnderEllipsoid=function(e,t,i,n,r,o){return y(_(this._ellipsoid,r,f),e,t,i,n,o)};let p=[];u.prototype.computeHorizonCullingPointFromRectangle=function(e,t,i){o.Z.typeOf.object("rectangle",e);let a=c.Z.subsample(e,t,0,p),s=n.Z.fromPoints(a);if(!(r.Z.magnitude(s.center)<.1*t.minimumRadius))return this.computeHorizonCullingPoint(s.center,a,i)};let m=new r.Z;function _(e,t,i){if((0,s.Z)(t)&&t<0&&e.minimumRadius>-t){let n=r.Z.fromElements(e.radii.x+t,e.radii.y+t,e.radii.z+t,m);e=l.Z.fromCartesian3(n,i)}return e}function g(e,t,i,n){o.Z.typeOf.object("directionToPoint",t),o.Z.defined("positions",i),(0,s.Z)(n)||(n=new r.Z);let a=S(e,t),l=0;for(let t=0,n=i.length;t<n;++t){let n=E(e,i[t],a);if(n<0)return;l=Math.max(l,n)}return x(a,l,n)}let Z=new r.Z;function y(e,t,i,n,l,c){o.Z.typeOf.object("directionToPoint",t),o.Z.defined("vertices",i),o.Z.typeOf.number("stride",n),(0,s.Z)(c)||(c=new r.Z),n=(0,a.Z)(n,3),l=(0,a.Z)(l,r.Z.ZERO);let u=S(e,t),h=0;for(let t=0,r=i.length;t<r;t+=n){Z.x=i[t]+l.x,Z.y=i[t+1]+l.y,Z.z=i[t+2]+l.z;let n=E(e,Z,u);if(n<0)return;h=Math.max(h,n)}return x(u,h,c)}function b(e,t,i){let n=r.Z.subtract(e,t,h),o=-r.Z.dot(n,t);return!(i<0?o>0:o>i&&o*o/r.Z.magnitudeSquared(n)>i)}let v=new r.Z,T=new r.Z;function E(e,t,i){let n=e.transformPositionToScaledSpace(t,v),o=r.Z.magnitudeSquared(n),a=Math.sqrt(o),s=r.Z.divideByScalar(n,a,T);o=Math.max(1,o),a=Math.max(1,a);let l=r.Z.dot(s,i),c=r.Z.magnitude(r.Z.cross(s,i,s)),u=1/a,h=Math.sqrt(o-1)*u;return 1/(l*u-c*h)}function x(e,t,i){if(!(t<=0)&&t!==1/0&&t==t)return r.Z.multiplyByScalar(e,t,i)}let w=new r.Z;function S(e,t){return r.Z.equals(t,r.Z.ZERO)?t:(e.transformPositionToScaledSpace(t,w),r.Z.normalize(w,w))}t.Z=u},3149:function(e,t,i){"use strict";var n=i(1486),r=i(698),o=i(9410);function a(){this.high=n.Z.clone(n.Z.ZERO),this.low=n.Z.clone(n.Z.ZERO)}a.encode=function(e,t){let i;return r.Z.typeOf.number("value",e),(0,o.Z)(t)||(t={high:0,low:0}),e>=0?(i=65536*Math.floor(e/65536),t.high=i,t.low=e-i):(i=65536*Math.floor(-e/65536),t.high=-i,t.low=e+i),t};let s={high:0,low:0};a.fromCartesian=function(e,t){r.Z.typeOf.object("cartesian",e),(0,o.Z)(t)||(t=new a);let i=t.high,n=t.low;return a.encode(e.x,s),i.x=s.high,n.x=s.low,a.encode(e.y,s),i.y=s.high,n.y=s.low,a.encode(e.z,s),i.z=s.high,n.z=s.low,t};let l=new a;a.writeElements=function(e,t,i){r.Z.defined("cartesianArray",t),r.Z.typeOf.number("index",i),r.Z.typeOf.number.greaterThanOrEquals("index",i,0),a.fromCartesian(e,l);let n=l.high,o=l.low;t[i]=n.x,t[i+1]=n.y,t[i+2]=n.z,t[i+3]=o.x,t[i+4]=o.y,t[i+5]=o.z},t.Z=a},2198:function(e,t,i){"use strict";var n=i(698),r=i(9410);function o(){this._listeners=[],this._scopes=[],this._toRemove=[],this._insideRaiseEvent=!1}function a(e,t){return t-e}Object.defineProperties(o.prototype,{numberOfListeners:{get:function(){return this._listeners.length-this._toRemove.length}}}),o.prototype.addEventListener=function(e,t){n.Z.typeOf.func("listener",e),this._listeners.push(e),this._scopes.push(t);let i=this;return function(){i.removeEventListener(e,t)}},o.prototype.removeEventListener=function(e,t){n.Z.typeOf.func("listener",e);let i=this._listeners,r=this._scopes,o=-1;for(let n=0;n<i.length;n++)if(i[n]===e&&r[n]===t){o=n;break}return -1!==o&&(this._insideRaiseEvent?(this._toRemove.push(o),i[o]=void 0,r[o]=void 0):(i.splice(o,1),r.splice(o,1)),!0)},o.prototype.raiseEvent=function(){let e;this._insideRaiseEvent=!0;let t=this._listeners,i=this._scopes,n=t.length;for(e=0;e<n;e++){let n=t[e];(0,r.Z)(n)&&t[e].apply(i[e],arguments)}let o=this._toRemove;if((n=o.length)>0){for(o.sort(a),e=0;e<n;e++){let n=o[e];t.splice(n,1),i.splice(n,1)}o.length=0}this._insideRaiseEvent=!1},t.Z=o},691:function(e,t,i){"use strict";var n=i(9410),r=i(9824);function o(){this._removalFunctions=[]}o.prototype.add=function(e,t,i){if(!(0,n.Z)(e))throw new r.Z("event is required");let o=e.addEventListener(t,i);this._removalFunctions.push(o);let a=this;return function(){o();let e=a._removalFunctions;e.splice(e.indexOf(o),1)}},o.prototype.removeAll=function(){let e=this._removalFunctions;for(let t=0,i=e.length;t<i;++t)e[t]();e.length=0},t.Z=o},894:function(e,t,i){"use strict";let n,r,o,a,s,l,c,u,h,d,f,p,m,_,g,Z,y,b,v;i.d(t,{Z:function(){return B}});var T=i(698),E=i(4572),x=i(9410),w=i(9824);let S={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},C={};function A(e){let t=e.split(".");for(let e=0,i=t.length;e<i;++e)t[e]=parseInt(t[e],10);return t}function I(){if(!(0,x.Z)(o)&&(o=!1,!R())){let e=/ Chrome\/([\.0-9]+)/.exec(r.userAgent);null!==e&&(o=!0,a=A(e[1]))}return o}function O(){if(!(0,x.Z)(s)&&(s=!1,!I()&&!R()&&/ Safari\/[\.0-9]+/.test(r.userAgent))){let e=/ Version\/([\.0-9]+)/.exec(r.userAgent);null!==e&&(s=!0,l=A(e[1]))}return s}function D(){if(!(0,x.Z)(c)){c=!1;let e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(r.userAgent);null!==e&&(c=!0,(u=A(e[1])).isNightly=!!e[2])}return c}function P(){if(!(0,x.Z)(h)){let e;h=!1,"Microsoft Internet Explorer"===r.appName?null!==(e=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(r.userAgent))&&(h=!0,d=A(e[1])):"Netscape"===r.appName&&null!==(e=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(r.userAgent))&&(h=!0,d=A(e[1]))}return h}function R(){if(!(0,x.Z)(f)){f=!1;let e=/ Edg\/([\.0-9]+)/.exec(r.userAgent);null!==e&&(f=!0,p=A(e[1]))}return f}function N(){if(!(0,x.Z)(m)){m=!1;let e=/Firefox\/([\.0-9]+)/.exec(r.userAgent);null!==e&&(m=!0,_=A(e[1]))}return m}function L(){if(!(0,x.Z)(v)){let e=document.createElement("canvas");e.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");let t=e.style.imageRendering;(v=(0,x.Z)(t)&&""!==t)&&(b=t)}return v}function M(){if(!M.initialized)throw new w.Z("You must call FeatureDetection.supportsWebP.initialize and wait for the promise to resolve before calling FeatureDetection.supportsWebP");return M._result}Object.defineProperties(C,{element:{get:function(){if(C.supportsFullscreen())return document[S.fullscreenElement]}},changeEventName:{get:function(){if(C.supportsFullscreen())return S.fullscreenchange}},errorEventName:{get:function(){if(C.supportsFullscreen())return S.fullscreenerror}},enabled:{get:function(){if(C.supportsFullscreen())return document[S.fullscreenEnabled]}},fullscreen:{get:function(){if(C.supportsFullscreen())return null!==C.element}}}),C.supportsFullscreen=function(){let e;if((0,x.Z)(n))return n;n=!1;let t=document.body;if("function"==typeof t.requestFullscreen)return S.requestFullscreen="requestFullscreen",S.exitFullscreen="exitFullscreen",S.fullscreenEnabled="fullscreenEnabled",S.fullscreenElement="fullscreenElement",S.fullscreenchange="fullscreenchange",S.fullscreenerror="fullscreenerror",n=!0;let i=["webkit","moz","o","ms","khtml"];for(let r=0,o=i.length;r<o;++r){let o=i[r];"function"==typeof t[e=`${o}RequestFullscreen`]?(S.requestFullscreen=e,n=!0):"function"==typeof t[e=`${o}RequestFullScreen`]&&(S.requestFullscreen=e,n=!0),"function"==typeof document[e=`${o}ExitFullscreen`]?S.exitFullscreen=e:"function"==typeof document[e=`${o}CancelFullScreen`]&&(S.exitFullscreen=e),void 0!==document[e=`${o}FullscreenEnabled`]?S.fullscreenEnabled=e:void 0!==document[e=`${o}FullScreenEnabled`]&&(S.fullscreenEnabled=e),void 0!==document[e=`${o}FullscreenElement`]?S.fullscreenElement=e:void 0!==document[e=`${o}FullScreenElement`]&&(S.fullscreenElement=e),e=`${o}fullscreenchange`,void 0!==document[`on${e}`]&&("ms"===o&&(e="MSFullscreenChange"),S.fullscreenchange=e),e=`${o}fullscreenerror`,void 0!==document[`on${e}`]&&("ms"===o&&(e="MSFullscreenError"),S.fullscreenerror=e)}return n},C.requestFullscreen=function(e,t){C.supportsFullscreen()&&e[S.requestFullscreen]({vrDisplay:t})},C.exitFullscreen=function(){C.supportsFullscreen()&&document[S.exitFullscreen]()},C._names=S,"undefined"!=typeof navigator?r=navigator:r={},M._promise=void 0,M._result=void 0,M.initialize=function(){return(0,x.Z)(M._promise)||(M._promise=new Promise(e=>{let t=new Image;t.onload=function(){M._result=t.width>0&&t.height>0,e(M._result)},t.onerror=function(){M._result=!1,e(M._result)},t.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA"})),M._promise},Object.defineProperties(M,{initialized:{get:function(){return(0,x.Z)(M._result)}}});let F=[];"undefined"!=typeof ArrayBuffer&&(F.push(Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array),"undefined"!=typeof Uint8ClampedArray&&F.push(Uint8ClampedArray),"undefined"!=typeof Uint8ClampedArray&&F.push(Uint8ClampedArray),"undefined"!=typeof BigInt64Array&&F.push(BigInt64Array),"undefined"!=typeof BigUint64Array&&F.push(BigUint64Array));let z={isChrome:I,chromeVersion:function(){return I()&&a},isSafari:O,safariVersion:function(){return O()&&l},isWebkit:D,webkitVersion:function(){return D()&&u},isInternetExplorer:P,internetExplorerVersion:function(){return P()&&d},isEdge:R,edgeVersion:function(){return R()&&p},isFirefox:N,firefoxVersion:function(){return N()&&_},isWindows:function(){return(0,x.Z)(g)||(g=/Windows/i.test(r.appVersion)),g},isIPadOrIOS:function(){return(0,x.Z)(Z)||(Z="iPhone"===navigator.platform||"iPod"===navigator.platform||"iPad"===navigator.platform),Z},hardwareConcurrency:(0,E.Z)(r.hardwareConcurrency,3),supportsPointerEvents:function(){return(0,x.Z)(y)||(y=!N()&&"undefined"!=typeof PointerEvent&&(!(0,x.Z)(r.pointerEnabled)||r.pointerEnabled)),y},supportsImageRenderingPixelated:L,supportsWebP:M,imageRenderingValue:function(){return L()?b:void 0},typedArrayTypes:F};z.supportsBasis=function(e){return z.supportsWebAssembly()&&e.context.supportsBasis},z.supportsFullscreen=function(){return C.supportsFullscreen()},z.supportsTypedArrays=function(){return"undefined"!=typeof ArrayBuffer},z.supportsBigInt64Array=function(){return"undefined"!=typeof BigInt64Array},z.supportsBigUint64Array=function(){return"undefined"!=typeof BigUint64Array},z.supportsBigInt=function(){return"undefined"!=typeof BigInt},z.supportsWebWorkers=function(){return"undefined"!=typeof Worker},z.supportsWebAssembly=function(){return"undefined"!=typeof WebAssembly},z.supportsWebgl2=function(e){return T.Z.defined("scene",e),e.context.webgl2},z.supportsEsmWebWorkers=function(){return!N()||parseInt(_)>=114};var B=z},4754:function(e,t,i){"use strict";var n=i(1486),r=i(2820),o=i(4572),a=i(9410),s=i(9824),l=i(1039);function c(e){this._ellipsoid=(0,o.Z)(e,l.Z.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}Object.defineProperties(c.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),c.prototype.project=function(e,t){let i=this._semimajorAxis,r=e.longitude*i,o=e.latitude*i,s=e.height;return(0,a.Z)(t)?(t.x=r,t.y=o,t.z=s,t):new n.Z(r,o,s)},c.prototype.unproject=function(e,t){if(!(0,a.Z)(e))throw new s.Z("cartesian is required");let i=this._oneOverSemimajorAxis,n=e.x*i,o=e.y*i,l=e.z;return(0,a.Z)(t)?(t.longitude=n,t.latitude=o,t.height=l,t):new r.Z(n,o,l)},t.Z=c},9589:function(e,t,i){"use strict";var n=i(570),r=i(698),o=i(4572),a=i(9410),s=i(1039),l=i(4754),c=i(2150),u=i(8054);function h(e){e=(0,o.Z)(e,o.Z.EMPTY_OBJECT),this._ellipsoid=(0,o.Z)(e.ellipsoid,s.Z.WGS84),this._rectangle=(0,o.Z)(e.rectangle,u.Z.MAX_VALUE),this._projection=new l.Z(this._ellipsoid),this._numberOfLevelZeroTilesX=(0,o.Z)(e.numberOfLevelZeroTilesX,2),this._numberOfLevelZeroTilesY=(0,o.Z)(e.numberOfLevelZeroTilesY,1)}Object.defineProperties(h.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},rectangle:{get:function(){return this._rectangle}},projection:{get:function(){return this._projection}}}),h.prototype.getNumberOfXTilesAtLevel=function(e){return this._numberOfLevelZeroTilesX<<e},h.prototype.getNumberOfYTilesAtLevel=function(e){return this._numberOfLevelZeroTilesY<<e},h.prototype.rectangleToNativeRectangle=function(e,t){r.Z.defined("rectangle",e);let i=c.Z.toDegrees(e.west),n=c.Z.toDegrees(e.south),o=c.Z.toDegrees(e.east),s=c.Z.toDegrees(e.north);return(0,a.Z)(t)?(t.west=i,t.south=n,t.east=o,t.north=s,t):new u.Z(i,n,o,s)},h.prototype.tileXYToNativeRectangle=function(e,t,i,n){let r=this.tileXYToRectangle(e,t,i,n);return r.west=c.Z.toDegrees(r.west),r.south=c.Z.toDegrees(r.south),r.east=c.Z.toDegrees(r.east),r.north=c.Z.toDegrees(r.north),r},h.prototype.tileXYToRectangle=function(e,t,i,n){let r=this._rectangle,o=this.getNumberOfXTilesAtLevel(i),s=this.getNumberOfYTilesAtLevel(i),l=r.width/o,c=e*l+r.west,h=(e+1)*l+r.west,d=r.height/s,f=r.north-t*d,p=r.north-(t+1)*d;return(0,a.Z)(n)||(n=new u.Z(c,p,h,f)),n.west=c,n.south=p,n.east=h,n.north=f,n},h.prototype.positionToTileXY=function(e,t,i){let r=this._rectangle;if(!u.Z.contains(r,e))return;let o=this.getNumberOfXTilesAtLevel(t),s=this.getNumberOfYTilesAtLevel(t),l=r.width/o,h=r.height/s,d=e.longitude;r.east<r.west&&(d+=c.Z.TWO_PI);let f=(d-r.west)/l|0;f>=o&&(f=o-1);let p=(r.north-e.latitude)/h|0;return(p>=s&&(p=s-1),(0,a.Z)(i))?(i.x=f,i.y=p,i):new n.Z(f,p)},t.Z=h},3086:function(e,t,i){"use strict";var n=i(570),r=i(1486),o=i(2820),a=i(698),s=i(4572),l=i(9410),c=i(9824),u=i(357),h=i(3037),d=i(3186),f=i(4749),p=i(5022),m=i(3578),_=i(8054),g=i(7119);function Z(e){e=(0,s.Z)(e,s.Z.EMPTY_OBJECT),a.Z.typeOf.object("options.attributes",e.attributes),this.attributes=e.attributes,this.indices=e.indices,this.primitiveType=(0,s.Z)(e.primitiveType,p.Z.TRIANGLES),this.boundingSphere=e.boundingSphere,this.geometryType=(0,s.Z)(e.geometryType,u.Z.NONE),this.boundingSphereCV=e.boundingSphereCV,this.offsetAttribute=e.offsetAttribute}Z.computeNumberOfVertices=function(e){a.Z.typeOf.object("geometry",e);let t=-1;for(let i in e.attributes)if(e.attributes.hasOwnProperty(i)&&(0,l.Z)(e.attributes[i])&&(0,l.Z)(e.attributes[i].values)){let n=e.attributes[i],r=n.values.length/n.componentsPerAttribute;if(t!==r&&-1!==t)throw new c.Z("All attribute lists must have the same number of attributes.");t=r}return t};let y=new o.Z,b=new r.Z,v=new f.Z,T=[new o.Z,new o.Z,new o.Z],E=[new n.Z,new n.Z,new n.Z],x=[new n.Z,new n.Z,new n.Z],w=new r.Z,S=new m.Z,C=new f.Z,A=new h.Z;Z._textureCoordinateRotationPoints=function(e,t,i,a){let s;let l=_.Z.center(a,y),c=o.Z.toCartesian(l,i,b),u=g.Z.eastNorthUpToFixedFrame(c,i,v),p=f.Z.inverse(u,v);T[0].longitude=a.west,T[0].latitude=a.south,T[1].longitude=a.west,T[1].latitude=a.north,T[2].longitude=a.east,T[2].latitude=a.south;let Z=w;for(s=0;s<3;s++)o.Z.toCartesian(T[s],i,Z),Z=f.Z.multiplyByPointAsVector(p,Z,Z),E[s].x=Z.x,E[s].y=Z.y;let I=m.Z.fromAxisAngle(r.Z.UNIT_Z,-t,S),O=d.Z.fromQuaternion(I,C),D=e.length,P=Number.POSITIVE_INFINITY,R=Number.POSITIVE_INFINITY,N=Number.NEGATIVE_INFINITY,L=Number.NEGATIVE_INFINITY;for(s=0;s<D;s++)Z=f.Z.multiplyByPointAsVector(p,e[s],Z),P=Math.min(P,(Z=d.Z.multiplyByVector(O,Z,Z)).x),R=Math.min(R,Z.y),N=Math.max(N,Z.x),L=Math.max(L,Z.y);let M=h.Z.fromRotation(t,A);x[0].x=P,x[0].y=R,x[1].x=P,x[1].y=L,x[2].x=N,x[2].y=R;let F=E[0],z=E[2].x-F.x,B=E[1].y-F.y;for(s=0;s<3;s++){let e=x[s];h.Z.multiplyByVector(M,e,e),e.x=(e.x-F.x)/z,e.y=(e.y-F.y)/B}let U=x[0],k=x[1],V=x[2],H=Array(6);return n.Z.pack(U,H),n.Z.pack(k,H,2),n.Z.pack(V,H,4),H},t.Z=Z},2601:function(e,t,i){"use strict";var n=i(4572),r=i(9410),o=i(9824);t.Z=function(e){if(e=(0,n.Z)(e,n.Z.EMPTY_OBJECT),!(0,r.Z)(e.componentDatatype))throw new o.Z("options.componentDatatype is required.");if(!(0,r.Z)(e.componentsPerAttribute))throw new o.Z("options.componentsPerAttribute is required.");if(e.componentsPerAttribute<1||e.componentsPerAttribute>4)throw new o.Z("options.componentsPerAttribute must be between 1 and 4.");if(!(0,r.Z)(e.values))throw new o.Z("options.values is required.");this.componentDatatype=e.componentDatatype,this.componentsPerAttribute=e.componentsPerAttribute,this.normalize=(0,n.Z)(e.normalize,!1),this.values=e.values}},258:function(e,t,i){"use strict";var n=i(4572);t.Z=function(e){e=(0,n.Z)(e,n.Z.EMPTY_OBJECT),this.position=e.position,this.normal=e.normal,this.st=e.st,this.bitangent=e.bitangent,this.tangent=e.tangent,this.color=e.color}},7984:function(e,t,i){"use strict";var n=i(4572),r=i(9410),o=i(9824),a=i(4749);t.Z=function(e){if(e=(0,n.Z)(e,n.Z.EMPTY_OBJECT),!(0,r.Z)(e.geometry))throw new o.Z("options.geometry is required.");this.geometry=e.geometry,this.modelMatrix=a.Z.clone((0,n.Z)(e.modelMatrix,a.Z.IDENTITY)),this.id=e.id,this.pickPrimitive=e.pickPrimitive,this.attributes=(0,n.Z)(e.attributes,{}),this.westHemisphereGeometry=void 0,this.eastHemisphereGeometry=void 0}},2081:function(e,t,i){"use strict";var n=i(4572),r=i(9410),o=i(9824);t.Z=function(e){if(e=(0,n.Z)(e,n.Z.EMPTY_OBJECT),!(0,r.Z)(e.componentDatatype))throw new o.Z("options.componentDatatype is required.");if(!(0,r.Z)(e.componentsPerAttribute))throw new o.Z("options.componentsPerAttribute is required.");if(e.componentsPerAttribute<1||e.componentsPerAttribute>4)throw new o.Z("options.componentsPerAttribute must be between 1 and 4.");if(!(0,r.Z)(e.value))throw new o.Z("options.value is required.");this.componentDatatype=e.componentDatatype,this.componentsPerAttribute=e.componentsPerAttribute,this.normalize=(0,n.Z)(e.normalize,!1),this.value=e.value}},2246:function(e,t){"use strict";t.Z=Object.freeze({NONE:0,TOP:1,ALL:2})},2926:function(e,t,i){"use strict";i.d(t,{Z:function(){return eG}});var n=i(6936),r=i(570),o=i(1486),a=i(698),s=i(9410),l=i(2150);let c=new o.Z,u=new o.Z,h=new o.Z;var d=function(e,t,i,n,d){let f,p,m,_,g,Z,y,b;if(a.Z.defined("point",e),a.Z.defined("p0",t),a.Z.defined("p1",i),a.Z.defined("p2",n),(0,s.Z)(d)||(d=new o.Z),(0,s.Z)(t.z)){if(o.Z.equalsEpsilon(e,t,l.Z.EPSILON14))return o.Z.clone(o.Z.UNIT_X,d);if(o.Z.equalsEpsilon(e,i,l.Z.EPSILON14))return o.Z.clone(o.Z.UNIT_Y,d);if(o.Z.equalsEpsilon(e,n,l.Z.EPSILON14))return o.Z.clone(o.Z.UNIT_Z,d);f=o.Z.subtract(i,t,c),p=o.Z.subtract(n,t,u),m=o.Z.subtract(e,t,h),_=o.Z.dot(f,f),g=o.Z.dot(f,p),Z=o.Z.dot(f,m),y=o.Z.dot(p,p),b=o.Z.dot(p,m)}else{if(r.Z.equalsEpsilon(e,t,l.Z.EPSILON14))return o.Z.clone(o.Z.UNIT_X,d);if(r.Z.equalsEpsilon(e,i,l.Z.EPSILON14))return o.Z.clone(o.Z.UNIT_Y,d);if(r.Z.equalsEpsilon(e,n,l.Z.EPSILON14))return o.Z.clone(o.Z.UNIT_Z,d);f=r.Z.subtract(i,t,c),p=r.Z.subtract(n,t,u),m=r.Z.subtract(e,t,h),_=r.Z.dot(f,f),g=r.Z.dot(f,p),Z=r.Z.dot(f,m),y=r.Z.dot(p,p),b=r.Z.dot(p,m)}d.y=y*Z-g*b,d.z=_*b-g*Z;let v=_*y-g*g;if(0!==v)return d.y/=v,d.z/=v,d.x=1-d.y-d.z,d},f=i(7643),p=i(3065),m=i(2820),_=i(7559),g=i(4572),Z=i(9824),y=i(3149),b=i(4754),v=i(3086),T=i(2601),E=i(357),x=i(5837),w=i(487),S=i(15),C=i(3186),A=i(4749),I=i(6222),O=i(5022);let D={};D.calculateACMR=function(e){let t=(e=(0,g.Z)(e,g.Z.EMPTY_OBJECT)).indices,i=e.maximumIndex,n=(0,g.Z)(e.cacheSize,24);if(!(0,s.Z)(t))throw new Z.Z("indices is required.");let r=t.length;if(r<3||r%3!=0)throw new Z.Z("indices length must be a multiple of three.");if(i<=0)throw new Z.Z("maximumIndex must be greater than zero.");if(n<3)throw new Z.Z("cacheSize must be greater than two.");if(!(0,s.Z)(i)){i=0;let e=0,n=t[0];for(;e<r;)n>i&&(i=n),n=t[++e]}let o=[];for(let e=0;e<i+1;e++)o[e]=0;let a=n+1;for(let e=0;e<r;++e)a-o[t[e]]>n&&(o[t[e]]=a,++a);return(a-n+1)/(r/3)},D.tipsify=function(e){let t,i,n,r,o,a;let l=(e=(0,g.Z)(e,g.Z.EMPTY_OBJECT)).indices,c=e.maximumIndex,u=(0,g.Z)(e.cacheSize,24);if(!(0,s.Z)(l))throw new Z.Z("indices is required.");let h=l.length;if(h<3||h%3!=0)throw new Z.Z("indices length must be a multiple of three.");if(c<=0)throw new Z.Z("maximumIndex must be greater than zero.");if(u<3)throw new Z.Z("cacheSize must be greater than two.");let d=0,f=0,p=l[0];if((0,s.Z)(c))d=c+1;else{for(;f<h;)p>d&&(d=p),p=l[++f];if(-1===d)return 0;++d}let m=[];for(i=0;i<d;i++)m[i]={numLiveTriangles:0,timeStamp:0,vertexTriangles:[]};f=0;let _=0;for(;f<h;)m[l[f]].vertexTriangles.push(_),++m[l[f]].numLiveTriangles,m[l[f+1]].vertexTriangles.push(_),++m[l[f+1]].numLiveTriangles,m[l[f+2]].vertexTriangles.push(_),++m[l[f+2]].numLiveTriangles,++_,f+=3;let y=0,b=u+1;t=1;let v=[],T=[],E=0,x=[],w=h/3,S=[];for(i=0;i<w;i++)S[i]=!1;for(;-1!==y;){v=[],a=(r=m[y]).vertexTriangles.length;for(let e=0;e<a;++e)if(!S[_=r.vertexTriangles[e]]){S[_]=!0,f=_+_+_;for(let e=0;e<3;++e)o=l[f],v.push(o),T.push(o),x[E]=o,++E,n=m[o],--n.numLiveTriangles,b-n.timeStamp>u&&(n.timeStamp=b,++b),++f}y=function(e,i,n,r,o,a,s){let l,c=-1,u=-1,h=0;for(;h<n.length;){let e=n[h];r[e].numLiveTriangles&&(l=0,o-r[e].timeStamp+2*r[e].numLiveTriangles<=i&&(l=o-r[e].timeStamp),(l>u||-1===u)&&(u=l,c=e)),++h}return -1===c?function(e,i,n,r){for(;i.length>=1;){let t=i[i.length-1];if(i.splice(i.length-1,1),e[t].numLiveTriangles>0)return t}for(;t<r;){if(e[t].numLiveTriangles>0)return++t-1;++t}return -1}(r,a,0,s):c}(0,u,v,m,b,T,d)}return x};let P={};function R(e,t,i,n,r){e[t++]=i,e[t++]=n,e[t++]=n,e[t++]=r,e[t++]=r,e[t]=i}function N(e){let t={};for(let i in e)if(e.hasOwnProperty(i)&&(0,s.Z)(e[i])&&(0,s.Z)(e[i].values)){let n=e[i];t[i]=new T.Z({componentDatatype:n.componentDatatype,componentsPerAttribute:n.componentsPerAttribute,normalize:n.normalize,values:[]})}return t}P.toWireframe=function(e){if(!(0,s.Z)(e))throw new Z.Z("geometry is required.");let t=e.indices;if((0,s.Z)(t)){switch(e.primitiveType){case O.Z.TRIANGLES:e.indices=function(e){let t=e.length,i=x.Z.createTypedArray(t,t/3*6),n=0;for(let r=0;r<t;r+=3,n+=6)R(i,n,e[r],e[r+1],e[r+2]);return i}(t);break;case O.Z.TRIANGLE_STRIP:e.indices=function(e){let t=e.length;if(t>=3){let i=x.Z.createTypedArray(t,(t-2)*6);R(i,0,e[0],e[1],e[2]);let n=6;for(let r=3;r<t;++r,n+=6)R(i,n,e[r-1],e[r],e[r-2]);return i}return new Uint16Array}(t);break;case O.Z.TRIANGLE_FAN:e.indices=function(e){if(e.length>0){let t=e.length-1,i=x.Z.createTypedArray(t,(t-1)*6),n=e[0],r=0;for(let o=1;o<t;++o,r+=6)R(i,r,n,e[o],e[o+1]);return i}return new Uint16Array}(t);break;default:throw new Z.Z("geometry.primitiveType must be TRIANGLES, TRIANGLE_STRIP, or TRIANGLE_FAN.")}e.primitiveType=O.Z.LINES}return e},P.createLineSegmentsForVectors=function(e,t,i){let n;if(t=(0,g.Z)(t,"normal"),!(0,s.Z)(e))throw new Z.Z("geometry is required.");if(!(0,s.Z)(e.attributes.position))throw new Z.Z("geometry.attributes.position is required.");if(!(0,s.Z)(e.attributes[t]))throw new Z.Z(`geometry.attributes must have an attribute with the same name as the attributeName parameter, ${t}.`);i=(0,g.Z)(i,1e4);let r=e.attributes.position.values,o=e.attributes[t].values,a=r.length,l=new Float64Array(2*a),c=0;for(let e=0;e<a;e+=3)l[c++]=r[e],l[c++]=r[e+1],l[c++]=r[e+2],l[c++]=r[e]+o[e]*i,l[c++]=r[e+1]+o[e+1]*i,l[c++]=r[e+2]+o[e+2]*i;let u=e.boundingSphere;return(0,s.Z)(u)&&(n=new f.Z(u.center,u.radius+i)),new v.Z({attributes:{position:new T.Z({componentDatatype:_.Z.DOUBLE,componentsPerAttribute:3,values:l})},primitiveType:O.Z.LINES,boundingSphere:n})},P.createAttributeLocations=function(e){let t;if(!(0,s.Z)(e))throw new Z.Z("geometry is required.");let i=["position","positionHigh","positionLow","position3DHigh","position3DLow","position2DHigh","position2DLow","pickColor","normal","st","tangent","bitangent","extrudeDirection","compressedAttributes"],n=e.attributes,r={},o=0,a=i.length;for(t=0;t<a;++t){let e=i[t];(0,s.Z)(n[e])&&(r[e]=o++)}for(let e in n)n.hasOwnProperty(e)&&!(0,s.Z)(r[e])&&(r[e]=o++);return r},P.reorderForPreVertexCache=function(e){if(!(0,s.Z)(e))throw new Z.Z("geometry is required.");let t=v.Z.computeNumberOfVertices(e),i=e.indices;if((0,s.Z)(i)){let n;let r=new Int32Array(t);for(let e=0;e<t;e++)r[e]=-1;let o=i.length,a=x.Z.createTypedArray(t,o),l=0,c=0,u=0;for(;l<o;)-1!==(n=r[i[l]])?a[c]=n:(r[n=i[l]]=u,a[c]=u,++u),++l,++c;e.indices=a;let h=e.attributes;for(let e in h)if(h.hasOwnProperty(e)&&(0,s.Z)(h[e])&&(0,s.Z)(h[e].values)){let i=h[e],n=i.values,o=0,a=i.componentsPerAttribute,s=_.Z.createTypedArray(i.componentDatatype,u*a);for(;o<t;){let e=r[o];if(-1!==e)for(let t=0;t<a;t++)s[a*e+t]=n[a*o+t];++o}i.values=s}}return e},P.reorderForPostVertexCache=function(e,t){if(!(0,s.Z)(e))throw new Z.Z("geometry is required.");let i=e.indices;if(e.primitiveType===O.Z.TRIANGLES&&(0,s.Z)(i)){let n=i.length,r=0;for(let e=0;e<n;e++)i[e]>r&&(r=i[e]);e.indices=D.tipsify({indices:i,maximumIndex:r,cacheSize:t})}return e},P.fitToUnsignedShortIndices=function(e){if(!(0,s.Z)(e))throw new Z.Z("geometry is required.");if((0,s.Z)(e.indices)&&e.primitiveType!==O.Z.TRIANGLES&&e.primitiveType!==O.Z.LINES&&e.primitiveType!==O.Z.POINTS)throw new Z.Z("geometry.primitiveType must equal to PrimitiveType.TRIANGLES, PrimitiveType.LINES, or PrimitiveType.POINTS.");let t=[],i=v.Z.computeNumberOfVertices(e);if((0,s.Z)(e.indices)&&i>=l.Z.SIXTY_FOUR_KILOBYTES){let i,n=[],r=[],o=0,a=N(e.attributes),c=e.indices,u=c.length;e.primitiveType===O.Z.TRIANGLES?i=3:e.primitiveType===O.Z.LINES?i=2:e.primitiveType===O.Z.POINTS&&(i=1);for(let h=0;h<u;h+=i){for(let t=0;t<i;++t){let i=c[h+t],l=n[i];(0,s.Z)(l)||(l=o++,n[i]=l,function(e,t,i){for(let n in t)if(t.hasOwnProperty(n)&&(0,s.Z)(t[n])&&(0,s.Z)(t[n].values)){let r=t[n];for(let t=0;t<r.componentsPerAttribute;++t)e[n].values.push(r.values[i*r.componentsPerAttribute+t])}}(a,e.attributes,i)),r.push(l)}o+i>=l.Z.SIXTY_FOUR_KILOBYTES&&(t.push(new v.Z({attributes:a,indices:r,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV})),n=[],r=[],o=0,a=N(e.attributes))}0!==r.length&&t.push(new v.Z({attributes:a,indices:r,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV}))}else t.push(e);return t};let L=new o.Z,M=new m.Z;P.projectTo2D=function(e,t,i,n,r){if(!(0,s.Z)(e))throw new Z.Z("geometry is required.");if(!(0,s.Z)(t))throw new Z.Z("attributeName is required.");if(!(0,s.Z)(i))throw new Z.Z("attributeName3D is required.");if(!(0,s.Z)(n))throw new Z.Z("attributeName2D is required.");if(!(0,s.Z)(e.attributes[t]))throw new Z.Z(`geometry must have attribute matching the attributeName argument: ${t}.`);if(e.attributes[t].componentDatatype!==_.Z.DOUBLE)throw new Z.Z("The attribute componentDatatype must be ComponentDatatype.DOUBLE.");let a=e.attributes[t],l=(r=(0,s.Z)(r)?r:new b.Z).ellipsoid,c=a.values,u=new Float64Array(c.length),h=0;for(let e=0;e<c.length;e+=3){let t=o.Z.fromArray(c,e,L),i=l.cartesianToCartographic(t,M);if(!(0,s.Z)(i))throw new Z.Z(`Could not project point (${t.x}, ${t.y}, ${t.z}) to 2D.`);let n=r.project(i,L);u[h++]=n.x,u[h++]=n.y,u[h++]=n.z}return e.attributes[i]=a,e.attributes[n]=new T.Z({componentDatatype:_.Z.DOUBLE,componentsPerAttribute:3,values:u}),delete e.attributes[t],e};let F={high:0,low:0};P.encodeAttribute=function(e,t,i,n){if(!(0,s.Z)(e))throw new Z.Z("geometry is required.");if(!(0,s.Z)(t))throw new Z.Z("attributeName is required.");if(!(0,s.Z)(i))throw new Z.Z("attributeHighName is required.");if(!(0,s.Z)(n))throw new Z.Z("attributeLowName is required.");if(!(0,s.Z)(e.attributes[t]))throw new Z.Z(`geometry must have attribute matching the attributeName argument: ${t}.`);if(e.attributes[t].componentDatatype!==_.Z.DOUBLE)throw new Z.Z("The attribute componentDatatype must be ComponentDatatype.DOUBLE.");let r=e.attributes[t],o=r.values,a=o.length,l=new Float32Array(a),c=new Float32Array(a);for(let e=0;e<a;++e)y.Z.encode(o[e],F),l[e]=F.high,c[e]=F.low;let u=r.componentsPerAttribute;return e.attributes[i]=new T.Z({componentDatatype:_.Z.FLOAT,componentsPerAttribute:u,values:l}),e.attributes[n]=new T.Z({componentDatatype:_.Z.FLOAT,componentsPerAttribute:u,values:c}),delete e.attributes[t],e};let z=new o.Z;function B(e,t){if((0,s.Z)(t)){let i=t.values,n=i.length;for(let t=0;t<n;t+=3)o.Z.unpack(i,t,z),A.Z.multiplyByPoint(e,z,z),o.Z.pack(z,i,t)}}function U(e,t){if((0,s.Z)(t)){let i=t.values,n=i.length;for(let t=0;t<n;t+=3)o.Z.unpack(i,t,z),C.Z.multiplyByVector(e,z,z),z=o.Z.normalize(z,z),o.Z.pack(z,i,t)}}let k=new A.Z,V=new C.Z;P.transformToWorldCoordinates=function(e){if(!(0,s.Z)(e))throw new Z.Z("instance is required.");let t=e.modelMatrix;if(A.Z.equals(t,A.Z.IDENTITY))return e;let i=e.geometry.attributes;B(t,i.position),B(t,i.prevPosition),B(t,i.nextPosition),((0,s.Z)(i.normal)||(0,s.Z)(i.tangent)||(0,s.Z)(i.bitangent))&&(A.Z.inverse(t,k),A.Z.transpose(k,k),A.Z.getMatrix3(k,V),U(V,i.normal),U(V,i.tangent),U(V,i.bitangent));let n=e.geometry.boundingSphere;return(0,s.Z)(n)&&(e.geometry.boundingSphere=f.Z.transform(n,t,n)),e.modelMatrix=A.Z.clone(A.Z.IDENTITY),e};let H=new o.Z;function G(e,t){let i,n,r,a,l,c,u,h,d;let p=e.length,m=e[0].modelMatrix,g=(0,s.Z)(e[0][t].indices),y=e[0][t].primitiveType;for(n=1;n<p;++n){if(!A.Z.equals(e[n].modelMatrix,m))throw new Z.Z("All instances must have the same modelMatrix.");if((0,s.Z)(e[n][t].indices)!==g)throw new Z.Z("All instance geometries must have an indices or not have one.");if(e[n][t].primitiveType!==y)throw new Z.Z("All instance geometries must have the same primitiveType.")}let b=function(e,t){let i;let n=e.length,r={},o=e[0][t].attributes;for(i in o)if(o.hasOwnProperty(i)&&(0,s.Z)(o[i])&&(0,s.Z)(o[i].values)){let a=o[i],l=a.values.length,c=!0;for(let r=1;r<n;++r){let n=e[r][t].attributes[i];if(!(0,s.Z)(n)||a.componentDatatype!==n.componentDatatype||a.componentsPerAttribute!==n.componentsPerAttribute||a.normalize!==n.normalize){c=!1;break}l+=n.values.length}c&&(r[i]=new T.Z({componentDatatype:a.componentDatatype,componentsPerAttribute:a.componentsPerAttribute,normalize:a.normalize,values:_.Z.createTypedArray(a.componentDatatype,l)}))}return r}(e,t);for(i in b)if(b.hasOwnProperty(i))for(n=0,l=b[i].values,a=0;n<p;++n)for(r=0,u=(c=e[n][t].attributes[i].values).length;r<u;++r)l[a++]=c[r];if(g){let i=0;for(n=0;n<p;++n)i+=e[n][t].indices.length;let r=v.Z.computeNumberOfVertices(new v.Z({attributes:b,primitiveType:O.Z.POINTS})),o=x.Z.createTypedArray(r,i),s=0,l=0;for(n=0;n<p;++n){let i=e[n][t].indices,r=i.length;for(a=0;a<r;++a)o[s++]=l+i[a];l+=v.Z.computeNumberOfVertices(e[n][t])}h=o}let E=new o.Z,w=0;for(n=0;n<p;++n){if(d=e[n][t].boundingSphere,!(0,s.Z)(d)){E=void 0;break}o.Z.add(d.center,E,E)}if((0,s.Z)(E))for(o.Z.divideByScalar(E,p,E),n=0;n<p;++n){d=e[n][t].boundingSphere;let i=o.Z.magnitude(o.Z.subtract(d.center,E,H))+d.radius;i>w&&(w=i)}return new v.Z({attributes:b,indices:h,primitiveType:y,boundingSphere:(0,s.Z)(E)?new f.Z(E,w):void 0})}P.combineInstances=function(e){if(!(0,s.Z)(e)||e.length<1)throw new Z.Z("instances is required and must have length greater than zero.");let t=[],i=[],n=e.length;for(let r=0;r<n;++r){let n=e[r];(0,s.Z)(n.geometry)?t.push(n):(0,s.Z)(n.westHemisphereGeometry)&&(0,s.Z)(n.eastHemisphereGeometry)&&i.push(n)}let r=[];return t.length>0&&r.push(G(t,"geometry")),i.length>0&&(r.push(G(i,"westHemisphereGeometry")),r.push(G(i,"eastHemisphereGeometry"))),r};let j=new o.Z,W=new o.Z,q=new o.Z,Y=new o.Z;P.computeNormal=function(e){let t,i;if(!(0,s.Z)(e))throw new Z.Z("geometry is required.");if(!(0,s.Z)(e.attributes.position)||!(0,s.Z)(e.attributes.position.values))throw new Z.Z("geometry.attributes.position.values is required.");if(!(0,s.Z)(e.indices))throw new Z.Z("geometry.indices is required.");if(e.indices.length<2||e.indices.length%3!=0)throw new Z.Z("geometry.indices length must be greater than 0 and be a multiple of 3.");if(e.primitiveType!==O.Z.TRIANGLES)throw new Z.Z("geometry.primitiveType must be PrimitiveType.TRIANGLES.");let n=e.indices,r=e.attributes,a=r.position.values,c=r.position.values.length/3,u=n.length,h=Array(c),d=Array(u/3),f=Array(u);for(t=0;t<c;t++)h[t]={indexOffset:0,count:0,currentCount:0};let p=0;for(t=0;t<u;t+=3){let e=n[t],i=n[t+1],r=n[t+2],s=3*e,l=3*i,c=3*r;W.x=a[s],W.y=a[s+1],W.z=a[s+2],q.x=a[l],q.y=a[l+1],q.z=a[l+2],Y.x=a[c],Y.y=a[c+1],Y.z=a[c+2],h[e].count++,h[i].count++,h[r].count++,o.Z.subtract(q,W,q),o.Z.subtract(Y,W,Y),d[p]=o.Z.cross(q,Y,new o.Z),p++}let m=0;for(t=0;t<c;t++)h[t].indexOffset+=m,m+=h[t].count;for(t=0,p=0;t<u;t+=3){let e=(i=h[n[t]]).indexOffset+i.currentCount;f[e]=p,i.currentCount++,f[e=(i=h[n[t+1]]).indexOffset+i.currentCount]=p,i.currentCount++,f[e=(i=h[n[t+2]]).indexOffset+i.currentCount]=p,i.currentCount++,p++}let g=new Float32Array(3*c);for(t=0;t<c;t++){let e=3*t;if(i=h[t],o.Z.clone(o.Z.ZERO,j),i.count>0){for(p=0;p<i.count;p++)o.Z.add(j,d[f[i.indexOffset+p]],j);o.Z.equalsEpsilon(o.Z.ZERO,j,l.Z.EPSILON10)&&o.Z.clone(d[f[i.indexOffset]],j)}o.Z.equalsEpsilon(o.Z.ZERO,j,l.Z.EPSILON10)&&(j.z=1),o.Z.normalize(j,j),g[e]=j.x,g[e+1]=j.y,g[e+2]=j.z}return e.attributes.normal=new T.Z({componentDatatype:_.Z.FLOAT,componentsPerAttribute:3,values:g}),e};let X=new o.Z,$=new o.Z,K=new o.Z;P.computeTangentAndBitangent=function(e){let t,i,n,r;if(!(0,s.Z)(e))throw new Z.Z("geometry is required.");let a=e.attributes,l=e.indices;if(!(0,s.Z)(a.position)||!(0,s.Z)(a.position.values))throw new Z.Z("geometry.attributes.position.values is required.");if(!(0,s.Z)(a.normal)||!(0,s.Z)(a.normal.values))throw new Z.Z("geometry.attributes.normal.values is required.");if(!(0,s.Z)(a.st)||!(0,s.Z)(a.st.values))throw new Z.Z("geometry.attributes.st.values is required.");if(!(0,s.Z)(l))throw new Z.Z("geometry.indices is required.");if(l.length<2||l.length%3!=0)throw new Z.Z("geometry.indices length must be greater than 0 and be a multiple of 3.");if(e.primitiveType!==O.Z.TRIANGLES)throw new Z.Z("geometry.primitiveType must be PrimitiveType.TRIANGLES.");let c=e.attributes.position.values,u=e.attributes.normal.values,h=e.attributes.st.values,d=e.attributes.position.values.length/3,f=l.length,p=Array(3*d);for(t=0;t<p.length;t++)p[t]=0;for(t=0;t<f;t+=3){let e=l[t],o=l[t+1],a=l[t+2];i=3*e,n=3*o,r=3*a;let s=2*e,u=2*o,d=2*a,f=c[i],m=c[i+1],_=c[i+2],g=h[s],Z=h[s+1],y=h[u+1]-Z,b=h[d+1]-Z,v=1/((h[u]-g)*b-(h[d]-g)*y),T=(b*(c[n]-f)-y*(c[r]-f))*v,E=(b*(c[n+1]-m)-y*(c[r+1]-m))*v,x=(b*(c[n+2]-_)-y*(c[r+2]-_))*v;p[i]+=T,p[i+1]+=E,p[i+2]+=x,p[n]+=T,p[n+1]+=E,p[n+2]+=x,p[r]+=T,p[r+1]+=E,p[r+2]+=x}let m=new Float32Array(3*d),g=new Float32Array(3*d);for(t=0;t<d;t++){n=(i=3*t)+1,r=i+2;let e=o.Z.fromArray(u,i,X),a=o.Z.fromArray(p,i,K),s=o.Z.dot(e,a);o.Z.multiplyByScalar(e,s,$),o.Z.normalize(o.Z.subtract(a,$,a),a),m[i]=a.x,m[n]=a.y,m[r]=a.z,o.Z.normalize(o.Z.cross(e,a,a),a),g[i]=a.x,g[n]=a.y,g[r]=a.z}return e.attributes.tangent=new T.Z({componentDatatype:_.Z.FLOAT,componentsPerAttribute:3,values:m}),e.attributes.bitangent=new T.Z({componentDatatype:_.Z.FLOAT,componentsPerAttribute:3,values:g}),e};let Q=new r.Z,J=new o.Z,ee=new o.Z,et=new o.Z,ei=new r.Z;function en(e,t){Math.abs(e.y)<l.Z.EPSILON6&&(t?e.y=-l.Z.EPSILON6:e.y=l.Z.EPSILON6)}P.compressVertices=function(e){let t,i,a,l,c,u;if(!(0,s.Z)(e))throw new Z.Z("geometry is required.");let h=e.attributes.extrudeDirection;if((0,s.Z)(h)){let r=h.values,a=new Float32Array(2*(i=r.length/3)),s=0;for(t=0;t<i;++t){if(o.Z.fromArray(r,3*t,J),o.Z.equals(J,o.Z.ZERO)){s+=2;continue}ei=n.Z.octEncodeInRange(J,65535,ei),a[s++]=ei.x,a[s++]=ei.y}return e.attributes.compressedAttributes=new T.Z({componentDatatype:_.Z.FLOAT,componentsPerAttribute:2,values:a}),delete e.attributes.extrudeDirection,e}let d=e.attributes.normal,f=e.attributes.st,p=(0,s.Z)(d),m=(0,s.Z)(f);if(!p&&!m)return e;let g=e.attributes.tangent,y=e.attributes.bitangent,b=(0,s.Z)(g),v=(0,s.Z)(y);p&&(a=d.values),m&&(l=f.values),b&&(c=g.values),v&&(u=y.values);let E=i=(p?a.length:l.length)/(p?3:2),x=m&&p?2:1;x+=b||v?1:0;let w=new Float32Array(E*=x),S=0;for(t=0;t<i;++t){m&&(r.Z.fromArray(l,2*t,Q),w[S++]=n.Z.compressTextureCoordinates(Q));let e=3*t;p&&(0,s.Z)(c)&&(0,s.Z)(u)?(o.Z.fromArray(a,e,J),o.Z.fromArray(c,e,ee),o.Z.fromArray(u,e,et),n.Z.octPack(J,ee,et,Q),w[S++]=Q.x,w[S++]=Q.y):(p&&(o.Z.fromArray(a,e,J),w[S++]=n.Z.octEncodeFloat(J)),b&&(o.Z.fromArray(c,e,J),w[S++]=n.Z.octEncodeFloat(J)),v&&(o.Z.fromArray(u,e,J),w[S++]=n.Z.octEncodeFloat(J)))}return e.attributes.compressedAttributes=new T.Z({componentDatatype:_.Z.FLOAT,componentsPerAttribute:x,values:w}),p&&delete e.attributes.normal,m&&delete e.attributes.st,v&&delete e.attributes.bitangent,b&&delete e.attributes.tangent,e};let er=new o.Z;function eo(e,t,i,n){o.Z.add(e,o.Z.multiplyByScalar(o.Z.subtract(t,e,er),e.y/(e.y-t.y),er),i),o.Z.clone(i,n),en(i,!0),en(n,!1)}let ea=new o.Z,es=new o.Z,el=new o.Z,ec=new o.Z,eu={positions:Array(7),indices:Array(9)};function eh(e,t){let i=e.attributes;if(0===i.position.values.length)return;for(let e in i)if(i.hasOwnProperty(e)&&(0,s.Z)(i[e])&&(0,s.Z)(i[e].values)){let t=i[e];t.values=_.Z.createTypedArray(t.componentDatatype,t.values)}let n=v.Z.computeNumberOfVertices(e);return e.indices=x.Z.createTypedArray(n,e.indices),t&&(e.boundingSphere=f.Z.fromVertices(i.position.values)),e}function ed(e){let t=e.attributes,i={};for(let e in t)if(t.hasOwnProperty(e)&&(0,s.Z)(t[e])&&(0,s.Z)(t[e].values)){let n=t[e];i[e]=new T.Z({componentDatatype:n.componentDatatype,componentsPerAttribute:n.componentsPerAttribute,normalize:n.normalize,values:[]})}return new v.Z({attributes:i,indices:[],primitiveType:e.primitiveType})}function ef(e,t,i){let n=(0,s.Z)(e.geometry.boundingSphere);t=eh(t,n),i=eh(i,n),(0,s.Z)(i)&&!(0,s.Z)(t)?e.geometry=i:!(0,s.Z)(i)&&(0,s.Z)(t)?e.geometry=t:(e.westHemisphereGeometry=t,e.eastHemisphereGeometry=i,e.geometry=void 0)}function ep(e,t){let i=new e,n=new e,r=new e;return function(o,a,s,l,c,u,h,d){let f=e.fromArray(c,o*t,i),p=e.fromArray(c,a*t,n),m=e.fromArray(c,s*t,r);e.multiplyByScalar(f,l.x,f),e.multiplyByScalar(p,l.y,p),e.multiplyByScalar(m,l.z,m);let _=e.add(f,p,f);e.add(_,m,_),d&&e.normalize(_,_),e.pack(_,u,h*t)}}let em=ep(p.Z,4),e_=ep(o.Z,3),eg=ep(r.Z,2),eZ=function(e,t,i,n,r,o,a){let s=r[e]*n.x,c=r[t]*n.y,u=r[i]*n.z;o[a]=s+c+u>l.Z.EPSILON6?1:0},ey=new o.Z,eb=new o.Z,ev=new o.Z,eT=new o.Z;function eE(e,t,i,n,r,a,l,c,u,h,f,p,m,_,g,Z){if(!(0,s.Z)(a)&&!(0,s.Z)(l)&&!(0,s.Z)(c)&&!(0,s.Z)(u)&&!(0,s.Z)(h)&&0===_)return;let y=d(n,o.Z.fromArray(r,3*e,ey),o.Z.fromArray(r,3*t,eb),o.Z.fromArray(r,3*i,ev),eT);if((0,s.Z)(y)){if((0,s.Z)(a)&&e_(e,t,i,y,a,p.normal.values,Z,!0),(0,s.Z)(h)){let n;let r=o.Z.fromArray(h,3*e,ey),a=o.Z.fromArray(h,3*t,eb),s=o.Z.fromArray(h,3*i,ev);o.Z.multiplyByScalar(r,y.x,r),o.Z.multiplyByScalar(a,y.y,a),o.Z.multiplyByScalar(s,y.z,s),o.Z.equals(r,o.Z.ZERO)&&o.Z.equals(a,o.Z.ZERO)&&o.Z.equals(s,o.Z.ZERO)?((n=ey).x=0,n.y=0,n.z=0):(n=o.Z.add(r,a,r),o.Z.add(n,s,n),o.Z.normalize(n,n)),o.Z.pack(n,p.extrudeDirection.values,3*Z)}if((0,s.Z)(f)&&eZ(e,t,i,y,f,p.applyOffset.values,Z),(0,s.Z)(l)&&e_(e,t,i,y,l,p.tangent.values,Z,!0),(0,s.Z)(c)&&e_(e,t,i,y,c,p.bitangent.values,Z,!0),(0,s.Z)(u)&&eg(e,t,i,y,u,p.st.values,Z),_>0)for(let n=0;n<_;n++){let r=m[n];!function(e,t,i,n,r,o,a){let s=o.componentsPerAttribute,l=o.values,c=a.values;switch(s){case 4:em(e,t,i,n,l,c,r,!1);break;case 3:e_(e,t,i,n,l,c,r,!1);break;case 2:eg(e,t,i,n,l,c,r,!1);break;default:c[r]=l[e]*n.x+l[t]*n.y+l[i]*n.z}}(e,t,i,y,Z,g[r],p[r])}}}function ex(e,t,i,n,r,o){let a=e.position.values.length/3;if(-1!==r){let s=n[r],l=i[s];return -1===l?(i[s]=a,e.position.values.push(o.x,o.y,o.z),t.push(a),a):(t.push(l),l)}return e.position.values.push(o.x,o.y,o.z),t.push(a),a}let ew={position:!0,normal:!0,bitangent:!0,tangent:!0,st:!0,extrudeDirection:!0,applyOffset:!0};function eS(e){let t,i,n,r,a;let c=e.geometry,u=c.attributes,h=u.position.values,d=(0,s.Z)(u.normal)?u.normal.values:void 0,f=(0,s.Z)(u.bitangent)?u.bitangent.values:void 0,p=(0,s.Z)(u.tangent)?u.tangent.values:void 0,m=(0,s.Z)(u.st)?u.st.values:void 0,_=(0,s.Z)(u.extrudeDirection)?u.extrudeDirection.values:void 0,g=(0,s.Z)(u.applyOffset)?u.applyOffset.values:void 0,Z=c.indices,y=[];for(let e in u)u.hasOwnProperty(e)&&!ew[e]&&(0,s.Z)(u[e])&&y.push(e);let b=y.length,v=ed(c),T=ed(c),E=[];E.length=h.length/3;let x=[];for(a=0,x.length=h.length/3;a<E.length;++a)E[a]=-1,x[a]=-1;let w=Z.length;for(a=0;a<w;a+=3){let e=Z[a],c=Z[a+1],w=Z[a+2],S=o.Z.fromArray(h,3*e),C=o.Z.fromArray(h,3*c),A=o.Z.fromArray(h,3*w),I=function(e,t,i){let n;if(e.x>=0||t.x>=0||i.x>=0)return;!function(e,t,i){if(0!==e.y&&0!==t.y&&0!==i.y){en(e,e.y<0),en(t,t.y<0),en(i,i.y<0);return}let n=Math.abs(e.y),r=Math.abs(t.y),o=Math.abs(i.y),a=(n>r?n>o?l.Z.sign(e.y):l.Z.sign(i.y):r>o?l.Z.sign(t.y):l.Z.sign(i.y))<0;en(e,a),en(t,a),en(i,a)}(e,t,i);let r=e.y<0,o=t.y<0,a=i.y<0;n=0+(r?1:0)+(o?1:0)+(a?1:0);let s=eu.indices;1===n?(s[1]=3,s[2]=4,s[5]=6,s[7]=6,s[8]=5,r?(eo(e,t,ea,el),eo(e,i,es,ec),s[0]=0,s[3]=1,s[4]=2,s[6]=1):o?(eo(t,i,ea,el),eo(t,e,es,ec),s[0]=1,s[3]=2,s[4]=0,s[6]=2):a&&(eo(i,e,ea,el),eo(i,t,es,ec),s[0]=2,s[3]=0,s[4]=1,s[6]=0)):2!==n||(s[2]=4,s[4]=4,s[5]=3,s[7]=5,s[8]=6,r?o?a||(eo(i,e,ea,el),eo(i,t,es,ec),s[0]=0,s[1]=1,s[3]=0,s[6]=2):(eo(t,i,ea,el),eo(t,e,es,ec),s[0]=2,s[1]=0,s[3]=2,s[6]=1):(eo(e,t,ea,el),eo(e,i,es,ec),s[0]=1,s[1]=2,s[3]=1,s[6]=0));let c=eu.positions;return c[0]=e,c[1]=t,c[2]=i,c.length=3,(1===n||2===n)&&(c[3]=ea,c[4]=es,c[5]=el,c[6]=ec,c.length=7),eu}(S,C,A);if((0,s.Z)(I)&&I.positions.length>3){let o=I.positions,s=I.indices,l=s.length;for(let S=0;S<l;++S){let l=s[S],C=o[l];C.y<0?(t=T.attributes,i=T.indices,n=E):(t=v.attributes,i=v.indices,n=x),r=ex(t,i,n,Z,l<3?a+l:-1,C),eE(e,c,w,C,h,d,p,f,m,_,g,t,y,b,u,r)}}else(0,s.Z)(I)&&(S=I.positions[0],C=I.positions[1],A=I.positions[2]),S.y<0?(t=T.attributes,i=T.indices,n=E):(t=v.attributes,i=v.indices,n=x),r=ex(t,i,n,Z,a,S),eE(e,c,w,S,h,d,p,f,m,_,g,t,y,b,u,r),r=ex(t,i,n,Z,a+1,C),eE(e,c,w,C,h,d,p,f,m,_,g,t,y,b,u,r),r=ex(t,i,n,Z,a+2,A),eE(e,c,w,A,h,d,p,f,m,_,g,t,y,b,u,r)}ef(e,T,v)}let eC=I.Z.fromPointNormal(o.Z.ZERO,o.Z.UNIT_Y),eA=new o.Z,eI=new o.Z;function eO(e,t,i,n,r,a,c){if(!(0,s.Z)(c))return;let u=o.Z.fromArray(n,3*e,ey);o.Z.equalsEpsilon(u,i,l.Z.EPSILON10)?a.applyOffset.values[r]=c[e]:a.applyOffset.values[r]=c[t]}function eD(e){let t;let i=e.geometry,n=i.attributes,r=n.position.values,a=(0,s.Z)(n.applyOffset)?n.applyOffset.values:void 0,c=i.indices,u=ed(i),h=ed(i),d=c.length,f=[];f.length=r.length/3;let p=[];for(t=0,p.length=r.length/3;t<f.length;++t)f[t]=-1,p[t]=-1;for(t=0;t<d;t+=2){let e;let i=c[t],n=c[t+1],d=o.Z.fromArray(r,3*i,ey),m=o.Z.fromArray(r,3*n,eb);Math.abs(d.y)<l.Z.EPSILON6&&(d.y<0?d.y=-l.Z.EPSILON6:d.y=l.Z.EPSILON6),Math.abs(m.y)<l.Z.EPSILON6&&(m.y<0?m.y=-l.Z.EPSILON6:m.y=l.Z.EPSILON6);let _=u.attributes,g=u.indices,Z=p,y=h.attributes,b=h.indices,v=f,T=S.Z.lineSegmentPlane(d,m,eC,ev);if((0,s.Z)(T)){let s=o.Z.multiplyByScalar(o.Z.UNIT_Y,5*l.Z.EPSILON9,eA);d.y<0&&(o.Z.negate(s,s),_=h.attributes,g=h.indices,Z=f,y=u.attributes,b=u.indices,v=p);let E=o.Z.add(T,s,eI);e=ex(_,g,Z,c,t,d),eO(i,n,d,r,e,_,a),e=ex(_,g,Z,c,-1,E),eO(i,n,E,r,e,_,a),o.Z.negate(s,s),o.Z.add(T,s,E),e=ex(y,b,v,c,-1,E),eO(i,n,E,r,e,y,a),e=ex(y,b,v,c,t+1,m),eO(i,n,m,r,e,y,a)}else{let o,s,l;d.y<0?(o=h.attributes,s=h.indices,l=f):(o=u.attributes,s=u.indices,l=p),e=ex(o,s,l,c,t,d),eO(i,n,d,r,e,o,a),e=ex(o,s,l,c,t+1,m),eO(i,n,m,r,e,o,a)}}ef(e,h,u)}let eP=new r.Z,eR=new r.Z,eN=new o.Z,eL=new o.Z,eM=new o.Z,eF=new o.Z,ez=new o.Z,eB=new o.Z,eU=new p.Z;function ek(e){let t=e.attributes,i=t.position.values,n=t.prevPosition.values,r=t.nextPosition.values,a=i.length;for(let e=0;e<a;e+=3){let t=o.Z.unpack(i,e,eN);if(t.x>0)continue;let s=o.Z.unpack(n,e,eL);(t.y<0&&s.y>0||t.y>0&&s.y<0)&&(e-3>0?(n[e]=i[e-3],n[e+1]=i[e-2],n[e+2]=i[e-1]):o.Z.pack(t,n,e));let l=o.Z.unpack(r,e,eM);(t.y<0&&l.y>0||t.y>0&&l.y<0)&&(e+3<a?(r[e]=i[e+3],r[e+1]=i[e+4],r[e+2]=i[e+5]):o.Z.pack(t,r,e))}}let eV=5*l.Z.EPSILON9,eH=l.Z.EPSILON6;P.splitLongitude=function(e){if(!(0,s.Z)(e))throw new Z.Z("instance is required.");let t=e.geometry,i=t.boundingSphere;if((0,s.Z)(i)&&(i.center.x-i.radius>0||f.Z.intersectPlane(i,I.Z.ORIGIN_ZX_PLANE)!==w.Z.INTERSECTING))return e;if(t.geometryType!==E.Z.NONE)switch(t.geometryType){case E.Z.POLYLINES:!function(e){let t,i,n;let a=e.geometry,c=a.attributes,u=c.position.values,h=c.prevPosition.values,d=c.nextPosition.values,f=c.expandAndWidth.values,m=(0,s.Z)(c.st)?c.st.values:void 0,_=(0,s.Z)(c.color)?c.color.values:void 0,g=ed(a),Z=ed(a),y=!1,b=u.length/3;for(t=0;t<b;t+=4){let e=t,a=t+2,c=o.Z.fromArray(u,3*e,eN),b=o.Z.fromArray(u,3*a,eL);if(Math.abs(c.y)<eH)for(c.y=eH*(b.y<0?-1:1),u[3*t+1]=c.y,u[(t+1)*3+1]=c.y,i=3*e;i<3*e+12;i+=3)h[i]=u[3*t],h[i+1]=u[3*t+1],h[i+2]=u[3*t+2];if(Math.abs(b.y)<eH)for(b.y=eH*(c.y<0?-1:1),u[(t+2)*3+1]=b.y,u[(t+3)*3+1]=b.y,i=3*e;i<3*e+12;i+=3)d[i]=u[(t+2)*3],d[i+1]=u[(t+2)*3+1],d[i+2]=u[(t+2)*3+2];let v=g.attributes,T=g.indices,E=Z.attributes,x=Z.indices,w=S.Z.lineSegmentPlane(c,b,eC,eF);if((0,s.Z)(w)){y=!0;let u=o.Z.multiplyByScalar(o.Z.UNIT_Y,eV,ez);c.y<0&&(o.Z.negate(u,u),v=Z.attributes,T=Z.indices,E=g.attributes,x=g.indices);let S=o.Z.add(w,u,eB);v.position.values.push(c.x,c.y,c.z,c.x,c.y,c.z),v.position.values.push(S.x,S.y,S.z),v.position.values.push(S.x,S.y,S.z),v.prevPosition.values.push(h[3*e],h[3*e+1],h[3*e+2]),v.prevPosition.values.push(h[3*e+3],h[3*e+4],h[3*e+5]),v.prevPosition.values.push(c.x,c.y,c.z,c.x,c.y,c.z),v.nextPosition.values.push(S.x,S.y,S.z),v.nextPosition.values.push(S.x,S.y,S.z),v.nextPosition.values.push(S.x,S.y,S.z),v.nextPosition.values.push(S.x,S.y,S.z),o.Z.negate(u,u),o.Z.add(w,u,S),E.position.values.push(S.x,S.y,S.z),E.position.values.push(S.x,S.y,S.z),E.position.values.push(b.x,b.y,b.z,b.x,b.y,b.z),E.prevPosition.values.push(S.x,S.y,S.z),E.prevPosition.values.push(S.x,S.y,S.z),E.prevPosition.values.push(S.x,S.y,S.z),E.prevPosition.values.push(S.x,S.y,S.z),E.nextPosition.values.push(b.x,b.y,b.z,b.x,b.y,b.z),E.nextPosition.values.push(d[3*a],d[3*a+1],d[3*a+2]),E.nextPosition.values.push(d[3*a+3],d[3*a+4],d[3*a+5]);let C=Math.abs(r.Z.fromArray(f,2*e,eP).y);v.expandAndWidth.values.push(-1,C,1,C),v.expandAndWidth.values.push(-1,-C,1,-C),E.expandAndWidth.values.push(-1,C,1,C),E.expandAndWidth.values.push(-1,-C,1,-C);let A=o.Z.magnitudeSquared(o.Z.subtract(w,c,eM));if(A/=o.Z.magnitudeSquared(o.Z.subtract(b,c,eM)),(0,s.Z)(_)){let t=p.Z.fromArray(_,4*e,eU),n=p.Z.fromArray(_,4*a,eU),r=l.Z.lerp(t.x,n.x,A),o=l.Z.lerp(t.y,n.y,A),s=l.Z.lerp(t.z,n.z,A),c=l.Z.lerp(t.w,n.w,A);for(i=4*e;i<4*e+8;++i)v.color.values.push(_[i]);for(v.color.values.push(r,o,s,c),v.color.values.push(r,o,s,c),E.color.values.push(r,o,s,c),E.color.values.push(r,o,s,c),i=4*a;i<4*a+8;++i)E.color.values.push(_[i])}if((0,s.Z)(m)){let n=r.Z.fromArray(m,2*e,eP),o=r.Z.fromArray(m,(t+3)*2,eR),s=l.Z.lerp(n.x,o.x,A);for(i=2*e;i<2*e+4;++i)v.st.values.push(m[i]);for(v.st.values.push(s,n.y),v.st.values.push(s,o.y),E.st.values.push(s,n.y),E.st.values.push(s,o.y),i=2*a;i<2*a+4;++i)E.st.values.push(m[i])}n=v.position.values.length/3-4,T.push(n,n+2,n+1),T.push(n+1,n+2,n+3),n=E.position.values.length/3-4,x.push(n,n+2,n+1),x.push(n+1,n+2,n+3)}else{let e,r;for(c.y<0?(e=Z.attributes,r=Z.indices):(e=g.attributes,r=g.indices),e.position.values.push(c.x,c.y,c.z),e.position.values.push(c.x,c.y,c.z),e.position.values.push(b.x,b.y,b.z),e.position.values.push(b.x,b.y,b.z),i=3*t;i<3*t+12;++i)e.prevPosition.values.push(h[i]),e.nextPosition.values.push(d[i]);for(i=2*t;i<2*t+8;++i)e.expandAndWidth.values.push(f[i]),(0,s.Z)(m)&&e.st.values.push(m[i]);if((0,s.Z)(_))for(i=4*t;i<4*t+16;++i)e.color.values.push(_[i]);n=e.position.values.length/3-4,r.push(n,n+2,n+1),r.push(n+1,n+2,n+3)}}y&&(ek(Z),ek(g)),ef(e,Z,g)}(e);break;case E.Z.TRIANGLES:eS(e);break;case E.Z.LINES:eD(e)}else!function(e){switch(e.primitiveType){case O.Z.TRIANGLE_FAN:return function(e){let t=v.Z.computeNumberOfVertices(e);if(t<3)throw new Z.Z("The number of vertices must be at least three.");let i=x.Z.createTypedArray(t,(t-2)*3);i[0]=1,i[1]=0,i[2]=2;let n=3;for(let e=3;e<t;++e)i[n++]=e-1,i[n++]=0,i[n++]=e;e.indices=i,e.primitiveType=O.Z.TRIANGLES}(e);case O.Z.TRIANGLE_STRIP:return function(e){let t=v.Z.computeNumberOfVertices(e);if(t<3)throw new Z.Z("The number of vertices must be at least 3.");let i=x.Z.createTypedArray(t,(t-2)*3);i[0]=0,i[1]=1,i[2]=2,t>3&&(i[3]=0,i[4]=2,i[5]=3);let n=6;for(let e=3;e<t-1;e+=2)i[n++]=e,i[n++]=e-1,i[n++]=e+1,e+2<t&&(i[n++]=e,i[n++]=e+1,i[n++]=e+2);e.indices=i,e.primitiveType=O.Z.TRIANGLES}(e);case O.Z.TRIANGLES:return function(e){if((0,s.Z)(e.indices))return;let t=v.Z.computeNumberOfVertices(e);if(t<3)throw new Z.Z("The number of vertices must be at least three.");if(t%3!=0)throw new Z.Z("The number of vertices must be a multiple of three.");let i=x.Z.createTypedArray(t,t);for(let e=0;e<t;++e)i[e]=e;e.indices=i}(e);case O.Z.LINE_STRIP:return function(e){let t=v.Z.computeNumberOfVertices(e);if(t<2)throw new Z.Z("The number of vertices must be at least two.");let i=x.Z.createTypedArray(t,(t-1)*2);i[0]=0,i[1]=1;let n=2;for(let e=2;e<t;++e)i[n++]=e-1,i[n++]=e;e.indices=i,e.primitiveType=O.Z.LINES}(e);case O.Z.LINE_LOOP:return function(e){let t=v.Z.computeNumberOfVertices(e);if(t<2)throw new Z.Z("The number of vertices must be at least two.");let i=x.Z.createTypedArray(t,2*t);i[0]=0,i[1]=1;let n=2;for(let e=2;e<t;++e)i[n++]=e-1,i[n++]=e;i[n++]=t-1,i[n]=0,e.indices=i,e.primitiveType=O.Z.LINES}(e);case O.Z.LINES:return function(e){if((0,s.Z)(e.indices))return;let t=v.Z.computeNumberOfVertices(e);if(t<2)throw new Z.Z("The number of vertices must be at least two.");if(t%2!=0)throw new Z.Z("The number of vertices must be a multiple of 2.");let i=x.Z.createTypedArray(t,t);for(let e=0;e<t;++e)i[e]=e;e.indices=i}(e)}}(t),t.primitiveType===O.Z.TRIANGLES?eS(e):t.primitiveType===O.Z.LINES&&eD(e);return e};var eG=P},357:function(e,t){"use strict";t.Z=Object.freeze({NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3})},1362:function(e,t,i){"use strict";var n=i(3369),r=i(7749),o=i(3453),a=i(7643),s=i(1486),l=i(2820),c=i(698),u=i(7559),h=i(4572),d=i(9410),f=i(9824),p=i(1039),m=i(421),_=i(2077),g=i(3149),Z=i(4754),y=i(3086),b=i(2601),v=i(15),T=i(2150),E=i(3186),x=i(6222),w=i(3578),S=i(8054),C=i(9676);let A=[Z.Z,C.Z],I=A.length,O=Math.cos(T.Z.toRadians(30)),D=Math.cos(T.Z.toRadians(150));function P(e){let t=(e=(0,h.Z)(e,h.Z.EMPTY_OBJECT)).positions;if(!(0,d.Z)(t)||t.length<2)throw new f.Z("At least two positions are required.");if((0,d.Z)(e.arcType)&&e.arcType!==r.Z.GEODESIC&&e.arcType!==r.Z.RHUMB)throw new f.Z("Valid options for arcType are ArcType.GEODESIC and ArcType.RHUMB.");this.width=(0,h.Z)(e.width,1),this._positions=t,this.granularity=(0,h.Z)(e.granularity,9999),this.loop=(0,h.Z)(e.loop,!1),this.arcType=(0,h.Z)(e.arcType,r.Z.GEODESIC),this._ellipsoid=p.Z.WGS84,this._projectionIndex=0,this._workerName="createGroundPolylineGeometry",this._scene3DOnly=!1}Object.defineProperties(P.prototype,{packedLength:{get:function(){return 1+3*this._positions.length+1+1+1+p.Z.packedLength+1+1}}}),P.setProjectionAndEllipsoid=function(e,t){let i=0;for(let e=0;e<I;e++)if(t instanceof A[e]){i=e;break}e._projectionIndex=i,e._ellipsoid=t.ellipsoid};let R=new s.Z,N=new s.Z,L=new s.Z;function M(e,t,i,n,r){let o=H(n,e,0,R),a=H(n,e,i,N),l=H(n,t,0,L),c=G(a,o,N),u=G(l,o,L);return s.Z.cross(u,c,r),s.Z.normalize(r,r)}let F=new l.Z,z=new s.Z,B=new s.Z,U=new s.Z;function k(e,t,i,n,o,a,l,c,u,h,d){let f;if(0===o)return;a===r.Z.GEODESIC?f=new m.Z(e,t,l):a===r.Z.RHUMB&&(f=new _.Z(e,t,l));let p=f.surfaceDistance;if(p<o)return;let g=M(e,t,n,l,U),Z=Math.ceil(p/o),y=p/Z,b=y,v=Z-1,T=c.length;for(let e=0;e<v;e++){let e=f.interpolateUsingSurfaceDistance(b,F),t=H(l,e,i,z),r=H(l,e,n,B);s.Z.pack(g,c,T),s.Z.pack(t,u,T),s.Z.pack(r,h,T),d.push(e.latitude),d.push(e.longitude),T+=3,b+=y}}let V=new l.Z;function H(e,t,i,n){return l.Z.clone(t,V),V.height=i,l.Z.toCartesian(V,e,n)}function G(e,t,i){return s.Z.subtract(e,t,i),s.Z.normalize(i,i),i}function j(e,t,i,n){return n=G(e,t,n),n=s.Z.cross(n,i,n),n=s.Z.normalize(n,n),n=s.Z.cross(i,n,n)}P.pack=function(e,t,i){c.Z.typeOf.object("value",e),c.Z.defined("array",t);let n=(0,h.Z)(i,0),r=e._positions,o=r.length;t[n++]=o;for(let e=0;e<o;++e){let i=r[e];s.Z.pack(i,t,n),n+=3}return t[n++]=e.granularity,t[n++]=e.loop?1:0,t[n++]=e.arcType,p.Z.pack(e._ellipsoid,t,n),n+=p.Z.packedLength,t[n++]=e._projectionIndex,t[n++]=e._scene3DOnly?1:0,t},P.unpack=function(e,t,i){c.Z.defined("array",e);let n=(0,h.Z)(t,0),r=e[n++],o=Array(r);for(let t=0;t<r;t++)o[t]=s.Z.unpack(e,n),n+=3;let a=e[n++],l=1===e[n++],u=e[n++],f=p.Z.unpack(e,n);n+=p.Z.packedLength;let m=e[n++],_=1===e[n++];return(0,d.Z)(i)||(i=new P({positions:o})),i._positions=o,i.granularity=a,i.loop=l,i.arcType=u,i._ellipsoid=f,i._projectionIndex=m,i._scene3DOnly=_,i};let W=new s.Z,q=new s.Z,Y=new s.Z,X=new s.Z;function $(e,t,i,n,r){let o=G(i,t,X),a=j(e,t,o,W),l=j(n,t,o,q);if(T.Z.equalsEpsilon(s.Z.dot(a,l),-1,T.Z.EPSILON5))return r=s.Z.cross(o,a,r),r=s.Z.normalize(r,r);r=s.Z.add(l,a,r),r=s.Z.normalize(r,r);let c=s.Z.cross(o,r,Y);return 0>s.Z.dot(l,c)&&(r=s.Z.negate(r,r)),r}let K=x.Z.fromPointNormal(s.Z.ZERO,s.Z.UNIT_Y),Q=new s.Z,J=new s.Z,ee=new s.Z,et=new s.Z,ei=new s.Z,en=new s.Z,er=new l.Z,eo=new l.Z,ea=new l.Z;P.createGeometry=function(e){let t,i,c,h,f,p,m,Z,E;let x=!e._scene3DOnly,w=e.loop,C=e._ellipsoid,I=e.granularity,D=e.arcType,P=new A[e._projectionIndex](C),R=e._positions,N=R.length;2===N&&(w=!1);let L=new _.Z(void 0,void 0,C),F=[R[0]];for(i=0;i<N-1;i++)c=R[i],h=R[i+1],m=v.Z.lineSegmentPlane(c,h,K,en),!(0,d.Z)(m)||s.Z.equalsEpsilon(m,c,T.Z.EPSILON7)||s.Z.equalsEpsilon(m,h,T.Z.EPSILON7)||(e.arcType===r.Z.GEODESIC?F.push(s.Z.clone(m)):e.arcType!==r.Z.RHUMB||(E=C.cartesianToCartographic(m,er).longitude,f=C.cartesianToCartographic(c,er),p=C.cartesianToCartographic(h,eo),L.setEndPoints(f,p),Z=L.findIntersectionWithLongitude(E,ea),m=C.cartographicToCartesian(Z,en),!(0,d.Z)(m)||s.Z.equalsEpsilon(m,c,T.Z.EPSILON7)||s.Z.equalsEpsilon(m,h,T.Z.EPSILON7)||F.push(s.Z.clone(m)))),F.push(h);!w||(c=R[N-1],h=R[0],m=v.Z.lineSegmentPlane(c,h,K,en),!(0,d.Z)(m)||s.Z.equalsEpsilon(m,c,T.Z.EPSILON7)||s.Z.equalsEpsilon(m,h,T.Z.EPSILON7)||(e.arcType===r.Z.GEODESIC?F.push(s.Z.clone(m)):e.arcType!==r.Z.RHUMB||(E=C.cartesianToCartographic(m,er).longitude,f=C.cartesianToCartographic(c,er),p=C.cartesianToCartographic(h,eo),L.setEndPoints(f,p),Z=L.findIntersectionWithLongitude(E,ea),m=C.cartographicToCartesian(Z,en),!(0,d.Z)(m)||s.Z.equalsEpsilon(m,c,T.Z.EPSILON7)||s.Z.equalsEpsilon(m,h,T.Z.EPSILON7)||F.push(s.Z.clone(m)))));let z=F.length,B=Array(z);for(i=0;i<z;i++){let e=l.Z.fromCartesian(F[i],C);e.height=0,B[i]=e}if((z=(B=(0,o.Z)(B,l.Z.equalsEpsilon)).length)<2)return;let U=[],V=[],j=[],W=[],q=Q,Y=J,X=ee,es=et,el=ei,ec=B[0],eh=B[1];for(q=H(C,B[z-1],0,q),es=H(C,eh,0,es),Y=H(C,ec,0,Y),X=H(C,ec,1e3,X),el=w?$(q,Y,X,es,el):M(ec,eh,1e3,C,el),s.Z.pack(el,V,0),s.Z.pack(Y,j,0),s.Z.pack(X,W,0),U.push(ec.latitude),U.push(ec.longitude),k(ec,eh,0,1e3,I,D,C,V,j,W,U),i=1;i<z-1;++i){q=s.Z.clone(Y,q),Y=s.Z.clone(es,Y);let e=B[i];H(C,e,1e3,X),H(C,B[i+1],0,es),$(q,Y,X,es,el),t=V.length,s.Z.pack(el,V,t),s.Z.pack(Y,j,t),s.Z.pack(X,W,t),U.push(e.latitude),U.push(e.longitude),k(B[i],B[i+1],0,1e3,I,D,C,V,j,W,U)}let ed=B[z-1],ef=B[z-2];if(Y=H(C,ed,0,Y),X=H(C,ed,1e3,X),w){let e=B[0];el=$(q=H(C,ef,0,q),Y,X,es=H(C,e,0,es),el)}else el=M(ef,ed,1e3,C,el);if(t=V.length,s.Z.pack(el,V,t),s.Z.pack(Y,j,t),s.Z.pack(X,W,t),U.push(ed.latitude),U.push(ed.longitude),w){for(k(ed,ec,0,1e3,I,D,C,V,j,W,U),t=V.length,i=0;i<3;++i)V[t+i]=V[i],j[t+i]=j[i],W[t+i]=W[i];U.push(ec.latitude),U.push(ec.longitude)}return function(e,t,i,r,o,l,c){let h,d,f,p,m,_,Z;let v=t._ellipsoid,E=i.length/3-1,x=8*E,w=4*x,C=36*E,A=x>65535?new Uint32Array(C):new Uint16Array(C),I=new Float64Array(3*x),D=new Float32Array(w),P=new Float32Array(w),R=new Float32Array(w),N=new Float32Array(w),L=new Float32Array(w);c&&(f=new Float32Array(w),p=new Float32Array(w),m=new Float32Array(w),_=new Float32Array(2*x));let M=l.length/2,F=0;eb.height=0,ev.height=0;let z=eT,B=eE;if(c)for(h=1,d=0;h<M;h++)eb.latitude=l[d],eb.longitude=l[d+1],ev.latitude=l[d+2],ev.longitude=l[d+3],z=t.project(eb,z),B=t.project(ev,B),F+=s.Z.distance(z,B),d+=2;let U=r.length/3;B=s.Z.unpack(r,0,B);let k=0;for(h=1,d=3;h<U;h++)z=s.Z.clone(B,z),B=s.Z.unpack(r,d,B),k+=s.Z.distance(z,B),d+=3;d=3;let V=0,H=0,j=0,W=0,q=!1,Y=s.Z.unpack(i,0,ew),X=s.Z.unpack(r,0,eE),$=s.Z.unpack(o,0,eC);e&&eu($,s.Z.unpack(i,i.length-6,ex),Y,X)&&($=s.Z.negate($,$));let K=0,Q=0,J=0;for(h=0;h<E;h++){let e,a,u,h,y,b,E;let x=s.Z.clone(Y,ex),w=s.Z.clone(X,eT),C=s.Z.clone($,eS);if(q&&(C=s.Z.negate(C,C)),Y=s.Z.unpack(i,d,ew),X=s.Z.unpack(r,d,eE),q=eu($=s.Z.unpack(o,d,eC),x,Y,X),eb.latitude=l[V],eb.longitude=l[V+1],ev.latitude=l[V+2],ev.longitude=l[V+3],c){let i=function(e,t){let i=Math.abs(e.longitude),n=Math.abs(t.longitude);if(T.Z.equalsEpsilon(i,T.Z.PI,T.Z.EPSILON11)){let n=T.Z.sign(t.longitude);return e.longitude=n*(i-T.Z.EPSILON11),1}if(T.Z.equalsEpsilon(n,T.Z.PI,T.Z.EPSILON11)){let i=T.Z.sign(e.longitude);return t.longitude=i*(n-T.Z.EPSILON11),2}return 0}(eb,ev);e=t.project(eb,eN);let n=G(a=t.project(ev,eL),e,eW);n.y=Math.abs(n.y),u=eM,h=eF,0===i||s.Z.dot(n,s.Z.UNIT_Y)>O?(u=ep(t,eb,C,e,eM),h=ep(t,ev,$,a,eF)):1===i?(h=ep(t,ev,$,a,eF),u.x=0,u.y=T.Z.sign(eb.longitude-Math.abs(ev.longitude)),u.z=0):(u=ep(t,eb,C,e,eM),h.x=0,h.y=T.Z.sign(eb.longitude-ev.longitude),h.z=0)}let A=s.Z.distance(w,X),M=g.Z.fromCartesian(x,eG),z=s.Z.subtract(Y,x,ez),B=s.Z.normalize(z,ek),U=s.Z.subtract(w,x,eB);U=s.Z.normalize(U,U);let ee=s.Z.cross(B,U,ek);ee=s.Z.normalize(ee,ee);let et=s.Z.cross(U,C,eV);et=s.Z.normalize(et,et);let ei=s.Z.subtract(X,Y,eU);ei=s.Z.normalize(ei,ei);let en=s.Z.cross($,ei,eH);en=s.Z.normalize(en,en);let er=A/k,eo=K/k,ea=0,es=0,el=0;if(c){ea=s.Z.distance(e,a),y=g.Z.fromCartesian(e,ej),b=s.Z.subtract(a,e,eW);let t=(E=s.Z.normalize(b,eq)).x;E.x=E.y,E.y=-t,es=ea/F,el=Q/F}for(Z=0;Z<8;Z++){let e=W+4*Z,t=H+2*Z,i=e+3,n=Z<4?1:-1,r=2===Z||3===Z||6===Z||7===Z?1:-1;s.Z.pack(M.high,D,e),D[i]=z.x,s.Z.pack(M.low,P,e),P[i]=z.y,s.Z.pack(et,R,e),R[i]=z.z,s.Z.pack(en,N,e),N[i]=er*n,s.Z.pack(ee,L,e);let o=eo*r;0===o&&r<0&&(o=9),L[i]=o,c&&(f[e]=y.high.x,f[e+1]=y.high.y,f[e+2]=y.low.x,f[e+3]=y.low.y,m[e]=-u.y,m[e+1]=u.x,m[e+2]=h.y,m[e+3]=-h.x,p[e]=b.x,p[e+1]=b.y,p[e+2]=E.x,p[e+3]=E.y,_[t]=es*n,0==(o=el*r)&&r<0&&(o=9),_[t+1]=o)}let ec=S.Z.fromCartographicArray(eA,eI),eh=n.Z.getMinimumMaximumHeights(ec,v),ed=eh.minimumTerrainHeight,ef=eh.maximumTerrainHeight;J+=Math.abs(ed)+Math.abs(ef),eg(x,w,ed,ef,eP,eO),eg(Y,X,ed,ef,eR,eD);let em=s.Z.multiplyByScalar(ee,T.Z.EPSILON5,eY);s.Z.add(eP,em,eP),s.Z.add(eR,em,eR),s.Z.add(eO,em,eO),s.Z.add(eD,em,eD),ey(eP,eR),ey(eO,eD),s.Z.pack(eP,I,j),s.Z.pack(eR,I,j+3),s.Z.pack(eD,I,j+6),s.Z.pack(eO,I,j+9),em=s.Z.multiplyByScalar(ee,-2*T.Z.EPSILON5,eY),s.Z.add(eP,em,eP),s.Z.add(eR,em,eR),s.Z.add(eO,em,eO),s.Z.add(eD,em,eD),ey(eP,eR),ey(eO,eD),s.Z.pack(eP,I,j+12),s.Z.pack(eR,I,j+15),s.Z.pack(eD,I,j+18),s.Z.pack(eO,I,j+21),V+=2,d+=3,H+=16,j+=24,W+=32,K+=A,Q+=ea}d=0;let ee=0;for(h=0;h<E;h++){for(Z=0;Z<eK;Z++)A[d+Z]=e$[Z]+ee;ee+=8,d+=eK}a.Z.fromVertices(i,s.Z.ZERO,3,eX[0]),a.Z.fromVertices(r,s.Z.ZERO,3,eX[1]);let et=a.Z.fromBoundingSpheres(eX);et.radius+=J/(2*E);let ei={position:new b.Z({componentDatatype:u.Z.DOUBLE,componentsPerAttribute:3,normalize:!1,values:I}),startHiAndForwardOffsetX:eQ(D),startLoAndForwardOffsetY:eQ(P),startNormalAndForwardOffsetZ:eQ(R),endNormalAndTextureCoordinateNormalizationX:eQ(N),rightNormalAndTextureCoordinateNormalizationY:eQ(L)};return c&&(ei.startHiLo2D=eQ(f),ei.offsetAndRight2D=eQ(p),ei.startEndNormals2D=eQ(m),ei.texcoordNormalization2D=new b.Z({componentDatatype:u.Z.FLOAT,componentsPerAttribute:2,normalize:!1,values:_})),new y.Z({attributes:ei,indices:A,boundingSphere:et})}(w,P,j,W,V,U,x)};let es=new s.Z,el=new E.Z,ec=new w.Z;function eu(e,t,i,n){let r=G(i,t,es),o=s.Z.dot(r,e);if(o>O||o<D){let t=G(n,i,X),r=o<D?T.Z.PI_OVER_TWO:-T.Z.PI_OVER_TWO,a=w.Z.fromAxisAngle(t,r,ec),s=E.Z.fromQuaternion(a,el);return E.Z.multiplyByVector(s,e,e),!0}return!1}let eh=new l.Z,ed=new s.Z,ef=new s.Z;function ep(e,t,i,n,r){let o=l.Z.toCartesian(t,e._ellipsoid,ed),a=s.Z.add(o,i,ef),c=!1,u=e._ellipsoid,h=u.cartesianToCartographic(a,eh);Math.abs(t.longitude-h.longitude)>T.Z.PI_OVER_TWO&&(c=!0,a=s.Z.subtract(o,i,ef),h=u.cartesianToCartographic(a,eh)),h.height=0;let d=e.project(h,r);return(r=s.Z.subtract(d,n,r)).z=0,r=s.Z.normalize(r,r),c&&s.Z.negate(r,r),r}let em=new s.Z,e_=new s.Z;function eg(e,t,i,n,r,o){let a=s.Z.subtract(t,e,em);s.Z.normalize(a,a);let l=s.Z.multiplyByScalar(a,i-0,e_);s.Z.add(e,l,r),l=s.Z.multiplyByScalar(a,n-1e3,e_),s.Z.add(t,l,o)}let eZ=new s.Z;function ey(e,t){let i=x.Z.getPointDistance(K,e),n=x.Z.getPointDistance(K,t),r=eZ;T.Z.equalsEpsilon(i,0,T.Z.EPSILON2)?(r=G(t,e,r),s.Z.multiplyByScalar(r,T.Z.EPSILON2,r),s.Z.add(e,r,e)):T.Z.equalsEpsilon(n,0,T.Z.EPSILON2)&&(r=G(e,t,r),s.Z.multiplyByScalar(r,T.Z.EPSILON2,r),s.Z.add(t,r,t))}let eb=new l.Z,ev=new l.Z,eT=new s.Z,eE=new s.Z,ex=new s.Z,ew=new s.Z,eS=new s.Z,eC=new s.Z,eA=[eb,ev],eI=new S.Z,eO=new s.Z,eD=new s.Z,eP=new s.Z,eR=new s.Z,eN=new s.Z,eL=new s.Z,eM=new s.Z,eF=new s.Z,ez=new s.Z,eB=new s.Z,eU=new s.Z,ek=new s.Z,eV=new s.Z,eH=new s.Z,eG=new g.Z,ej=new g.Z,eW=new s.Z,eq=new s.Z,eY=new s.Z,eX=[new a.Z,new a.Z],e$=[0,2,1,0,3,2,0,7,3,0,4,7,0,5,4,0,1,5,5,7,4,5,6,7,5,2,6,5,1,2,3,6,2,3,7,6],eK=e$.length;function eQ(e){return new b.Z({componentDatatype:u.Z.FLOAT,componentsPerAttribute:4,normalize:!1,values:e})}P._projectNormal=ep,t.Z=P},8920:function(e,t,i){"use strict";var n=i(4572),r=i(9410);function o(e,t,i){this.heading=(0,n.Z)(e,0),this.pitch=(0,n.Z)(t,0),this.range=(0,n.Z)(i,0)}o.clone=function(e,t){if((0,r.Z)(e))return(0,r.Z)(t)||(t=new o),t.heading=e.heading,t.pitch=e.pitch,t.range=e.range,t},t.Z=o},9872:function(e,t,i){"use strict";var n=i(4572),r=i(9410),o=i(9824),a=i(2150);function s(e,t,i){this.heading=(0,n.Z)(e,0),this.pitch=(0,n.Z)(t,0),this.roll=(0,n.Z)(i,0)}s.fromQuaternion=function(e,t){if(!(0,r.Z)(e))throw new o.Z("quaternion is required");(0,r.Z)(t)||(t=new s);let i=2*(e.w*e.y-e.z*e.x),n=1-2*(e.x*e.x+e.y*e.y),l=2*(e.w*e.x+e.y*e.z),c=1-2*(e.y*e.y+e.z*e.z),u=2*(e.w*e.z+e.x*e.y);return t.heading=-Math.atan2(u,c),t.roll=Math.atan2(l,n),t.pitch=-a.Z.asinClamped(i),t},s.fromDegrees=function(e,t,i,n){if(!(0,r.Z)(e))throw new o.Z("heading is required");if(!(0,r.Z)(t))throw new o.Z("pitch is required");if(!(0,r.Z)(i))throw new o.Z("roll is required");return(0,r.Z)(n)||(n=new s),n.heading=e*a.Z.RADIANS_PER_DEGREE,n.pitch=t*a.Z.RADIANS_PER_DEGREE,n.roll=i*a.Z.RADIANS_PER_DEGREE,n},s.clone=function(e,t){return(0,r.Z)(e)?(0,r.Z)(t)?(t.heading=e.heading,t.pitch=e.pitch,t.roll=e.roll,t):new s(e.heading,e.pitch,e.roll):void 0},s.equals=function(e,t){return e===t||(0,r.Z)(e)&&(0,r.Z)(t)&&e.heading===t.heading&&e.pitch===t.pitch&&e.roll===t.roll},s.equalsEpsilon=function(e,t,i,n){return e===t||(0,r.Z)(e)&&(0,r.Z)(t)&&a.Z.equalsEpsilon(e.heading,t.heading,i,n)&&a.Z.equalsEpsilon(e.pitch,t.pitch,i,n)&&a.Z.equalsEpsilon(e.roll,t.roll,i,n)},s.prototype.clone=function(e){return s.clone(this,e)},s.prototype.equals=function(e){return s.equals(this,e)},s.prototype.equalsEpsilon=function(e,t,i){return s.equalsEpsilon(this,e,t,i)},s.prototype.toString=function(){return`(${this.heading}, ${this.pitch}, ${this.roll})`},t.Z=s},5837:function(e,t,i){"use strict";var n=i(9410),r=i(9824),o=i(2150),a=i(512);let s={UNSIGNED_BYTE:a.Z.UNSIGNED_BYTE,UNSIGNED_SHORT:a.Z.UNSIGNED_SHORT,UNSIGNED_INT:a.Z.UNSIGNED_INT};s.getSizeInBytes=function(e){switch(e){case s.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case s.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case s.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT}throw new r.Z("indexDatatype is required and must be a valid IndexDatatype constant.")},s.fromSizeInBytes=function(e){switch(e){case 2:return s.UNSIGNED_SHORT;case 4:return s.UNSIGNED_INT;case 1:return s.UNSIGNED_BYTE;default:throw new r.Z("Size in bytes cannot be mapped to an IndexDatatype")}},s.validate=function(e){return(0,n.Z)(e)&&(e===s.UNSIGNED_BYTE||e===s.UNSIGNED_SHORT||e===s.UNSIGNED_INT)},s.createTypedArray=function(e,t){if(!(0,n.Z)(e))throw new r.Z("numberOfVertices is required.");return e>=o.Z.SIXTY_FOUR_KILOBYTES?new Uint32Array(t):new Uint16Array(t)},s.createTypedArrayFromArrayBuffer=function(e,t,i,a){if(!(0,n.Z)(e))throw new r.Z("numberOfVertices is required.");if(!(0,n.Z)(t))throw new r.Z("sourceArray is required.");if(!(0,n.Z)(i))throw new r.Z("byteOffset is required.");return e>=o.Z.SIXTY_FOUR_KILOBYTES?new Uint32Array(t,i,a):new Uint16Array(t,i,a)},s.fromTypedArray=function(e){if(e instanceof Uint8Array)return s.UNSIGNED_BYTE;if(e instanceof Uint16Array)return s.UNSIGNED_SHORT;if(e instanceof Uint32Array)return s.UNSIGNED_INT;throw new r.Z("array must be a Uint8Array, Uint16Array, or Uint32Array.")},t.Z=Object.freeze(s)},487:function(e,t){"use strict";t.Z=Object.freeze({OUTSIDE:-1,INTERSECTING:0,INSIDE:1})},15:function(e,t,i){"use strict";i.d(t,{Z:function(){return W}});var n=i(1486),r=i(2820),o=i(4572),a=i(9410),s=i(9824),l=i(2944),c=i(2150),u=i(3186);let h={};function d(e,t,i){let n=e+t;return c.Z.sign(e)!==c.Z.sign(t)&&Math.abs(n/Math.max(Math.abs(e),Math.abs(t)))<i?0:n}h.computeDiscriminant=function(e,t,i){if("number"!=typeof e)throw new s.Z("a is a required number.");if("number"!=typeof t)throw new s.Z("b is a required number.");if("number"!=typeof i)throw new s.Z("c is a required number.");return t*t-4*e*i},h.computeRealRoots=function(e,t,i){let n;if("number"!=typeof e)throw new s.Z("a is a required number.");if("number"!=typeof t)throw new s.Z("b is a required number.");if("number"!=typeof i)throw new s.Z("c is a required number.");if(0===e)return 0===t?[]:[-i/t];if(0===t){if(0===i)return[0,0];let t=Math.abs(i),r=Math.abs(e);if(t<r&&t/r<c.Z.EPSILON14)return[0,0];if(t>r&&r/t<c.Z.EPSILON14||(n=-i/e)<0)return[];let o=Math.sqrt(n);return[-o,o]}if(0===i)return(n=-t/e)<0?[n,0]:[0,n];let r=d(t*t,-(4*e*i),c.Z.EPSILON14);if(r<0)return[];let o=-.5*d(t,c.Z.sign(t)*Math.sqrt(r),c.Z.EPSILON14);return t>0?[o/e,i/o]:[i/o,o/e]};let f={};function p(e,t,i,n){let r,o;let a=t/3,s=i/3,l=e*s,c=a*n,u=a*a,h=s*s,d=e*s-u,f=e*n-a*s,p=a*n-h,m=4*d*p-f*f;if(m<0){let t,i,_;u*c>=l*h?(t=e,i=d,_=-2*a*d+e*f):(t=n,i=p,_=-n*f+2*s*p);let g=-(_<0?-1:1)*Math.abs(t)*Math.sqrt(-m),Z=(o=-_+g)/2,y=Z<0?-Math.pow(-Z,1/3):Math.pow(Z,1/3),b=o===g?-y:-i/y;return(r=i<=0?y+b:-_/(y*y+b*b+i),u*c>=l*h)?[(r-a)/e]:[-n/(r+s)]}let _=Math.sqrt(m),g=Math.sqrt(3)/2,Z=Math.abs(Math.atan2(e*_,-(-2*a*d+e*f))/3),y=Math.cos(Z);o=(r=2*Math.sqrt(-d))*y;let b=r*(-y/2-g*Math.sin(Z)),v=o+b>2*a?o-a:b-a,T=v/e;Z=Math.abs(Math.atan2(n*_,-(-n*f+2*s*p))/3),o=(r=2*Math.sqrt(-p))*(y=Math.cos(Z));let E=-n,x=o+(b=r*(-y/2-g*Math.sin(Z)))<2*s?o+s:b+s,w=E/x,S=-v*x-e*E,C=(s*S-v*E*a)/(-a*S+e*x*s);return T<=C?T<=w?C<=w?[T,C,w]:[T,w,C]:[w,T,C]:T<=w?[C,T,w]:C<=w?[C,w,T]:[w,C,T]}f.computeDiscriminant=function(e,t,i,n){if("number"!=typeof e)throw new s.Z("a is a required number.");if("number"!=typeof t)throw new s.Z("b is a required number.");if("number"!=typeof i)throw new s.Z("c is a required number.");if("number"!=typeof n)throw new s.Z("d is a required number.");let r=t*t,o=i*i;return 18*e*t*i*n+r*o-e*e*27*(n*n)-4*(e*o*i+r*t*n)},f.computeRealRoots=function(e,t,i,n){let r,o;if("number"!=typeof e)throw new s.Z("a is a required number.");if("number"!=typeof t)throw new s.Z("b is a required number.");if("number"!=typeof i)throw new s.Z("c is a required number.");if("number"!=typeof n)throw new s.Z("d is a required number.");if(0===e)return h.computeRealRoots(t,i,n);if(0===t){if(0===i){if(0===n)return[0,0,0];let t=(o=-n/e)<0?-Math.pow(-o,1/3):Math.pow(o,1/3);return[t,t,t]}return 0===n?0===(r=h.computeRealRoots(e,0,i)).Length?[0]:[r[0],0,r[1]]:p(e,0,i,n)}return 0===i?0===n?(o=-t/e)<0?[o,0,0]:[0,0,o]:p(e,t,0,n):0===n?0===(r=h.computeRealRoots(e,t,i)).length?[0]:r[1]<=0?[r[0],r[1],0]:r[0]>=0?[0,r[0],r[1]]:[r[0],0,r[1]]:p(e,t,i,n)};let m={};m.computeDiscriminant=function(e,t,i,n,r){if("number"!=typeof e)throw new s.Z("a is a required number.");if("number"!=typeof t)throw new s.Z("b is a required number.");if("number"!=typeof i)throw new s.Z("c is a required number.");if("number"!=typeof n)throw new s.Z("d is a required number.");if("number"!=typeof r)throw new s.Z("e is a required number.");let o=e*e,a=t*t,l=a*t,c=i*i,u=c*i,h=n*n,d=h*n,f=r*r;return a*c*h-4*l*d-4*e*u*h+18*e*t*i*d-27*o*h*h+o*e*256*(f*r)+r*(18*l*i*n-4*a*u+16*e*c*c-80*e*t*c*n-6*e*a*h+144*o*i*h)+f*(144*e*a*i-27*a*a-128*o*c-192*o*t*n)},m.computeRealRoots=function(e,t,i,n,r){if("number"!=typeof e)throw new s.Z("a is a required number.");if("number"!=typeof t)throw new s.Z("b is a required number.");if("number"!=typeof i)throw new s.Z("c is a required number.");if("number"!=typeof n)throw new s.Z("d is a required number.");if("number"!=typeof r)throw new s.Z("e is a required number.");if(Math.abs(e)<c.Z.EPSILON15)return f.computeRealRoots(t,i,n,r);let o=t/e,a=i/e,l=n/e,u=r/e,d=o<0?1:0;switch(d+=a<0?d+1:d,d+=l<0?d+1:d,d+=u<0?d+1:d){case 0:case 3:case 4:case 6:case 7:case 9:case 10:case 12:case 13:case 14:case 15:return function(e,t,i,n){let r=e*e,o=t-3*r/8,a=i-t*e/2+r*e/8,s=n-i*e/4+t*r/16-3*r*r/256,l=f.computeRealRoots(1,2*o,o*o-4*s,-a*a);if(l.length>0){let t=-e/4,i=l[l.length-1];if(Math.abs(i)<c.Z.EPSILON14){let e=h.computeRealRoots(1,o,s);if(2===e.length){let i;let n=e[0],r=e[1];if(n>=0&&r>=0){let e=Math.sqrt(n),i=Math.sqrt(r);return[t-i,t-e,t+e,t+i]}if(n>=0&&r<0)return[t-(i=Math.sqrt(n)),t+i];if(n<0&&r>=0)return[t-(i=Math.sqrt(r)),t+i]}}else if(i>0){let e=Math.sqrt(i),n=h.computeRealRoots(1,e,(o+i-a/e)/2),r=h.computeRealRoots(1,-e,(o+i+a/e)/2);if(0!==n.length){if(n[0]+=t,n[1]+=t,0!==r.length){if(r[0]+=t,r[1]+=t,n[1]<=r[0])return[n[0],n[1],r[0],r[1]];if(r[1]<=n[0])return[r[0],r[1],n[0],n[1]];if(n[0]>=r[0]&&n[1]<=r[1])return[r[0],n[0],n[1],r[1]];if(r[0]>=n[0]&&r[1]<=n[1])return[n[0],r[0],r[1],n[1]];else if(n[0]>r[0]&&n[0]<r[1])return[r[0],n[0],r[1],n[1]];return[n[0],r[0],n[1],r[1]]}return n}if(0!==r.length)return r[0]+=t,r[1]+=t,r}}return[]}(o,a,l,u);case 1:case 2:case 5:case 8:case 11:return function(e,t,i,n){let r=e*e,o=f.computeRealRoots(1,-2*t,i*e+t*t-4*n,r*n-i*t*e+i*i);if(o.length>0){let a,s,l,u,d,f;let p=o[0],m=t-p,_=m*m,g=e/2,Z=m/2,y=_-4*n,b=r-4*p;if(p<0||y*(r+4*Math.abs(p))<b*(_+4*Math.abs(n))){let t=Math.sqrt(b);a=t/2,s=0===t?0:(e*Z-i)/t}else{let t=Math.sqrt(y);a=0===t?0:(e*Z-i)/t,s=t/2}0===g&&0===a?(l=0,u=0):c.Z.sign(g)===c.Z.sign(a)?u=p/(l=g+a):l=p/(u=g-a),0===Z&&0===s?(d=0,f=0):c.Z.sign(Z)===c.Z.sign(s)?f=n/(d=Z+s):d=n/(f=Z-s);let v=h.computeRealRoots(1,l,d),T=h.computeRealRoots(1,u,f);if(0!==v.length){if(0!==T.length){if(v[1]<=T[0])return[v[0],v[1],T[0],T[1]];if(T[1]<=v[0])return[T[0],T[1],v[0],v[1]];if(v[0]>=T[0]&&v[1]<=T[1])return[T[0],v[0],v[1],T[1]];if(T[0]>=v[0]&&T[1]<=v[1])return[v[0],T[0],T[1],v[1]];else if(v[0]>T[0]&&v[0]<T[1])return[T[0],v[0],T[1],v[1]];return[v[0],T[0],v[1],T[1]]}return v}if(0!==T.length)return T}return[]}(o,a,l,u);default:return}};var _=i(5352);let g={};g.rayPlane=function(e,t,i){if(!(0,a.Z)(e))throw new s.Z("ray is required.");if(!(0,a.Z)(t))throw new s.Z("plane is required.");(0,a.Z)(i)||(i=new n.Z);let r=e.origin,o=e.direction,l=t.normal,u=n.Z.dot(l,o);if(Math.abs(u)<c.Z.EPSILON15)return;let h=(-t.distance-n.Z.dot(l,r))/u;if(!(h<0))return i=n.Z.multiplyByScalar(o,h,i),n.Z.add(r,i,i)};let Z=new n.Z,y=new n.Z,b=new n.Z,v=new n.Z,T=new n.Z;g.rayTriangleParametric=function(e,t,i,r,l){let u,h,d,f,p;if(!(0,a.Z)(e))throw new s.Z("ray is required.");if(!(0,a.Z)(t))throw new s.Z("p0 is required.");if(!(0,a.Z)(i))throw new s.Z("p1 is required.");if(!(0,a.Z)(r))throw new s.Z("p2 is required.");l=(0,o.Z)(l,!1);let m=e.origin,_=e.direction,g=n.Z.subtract(i,t,Z),E=n.Z.subtract(r,t,y),x=n.Z.cross(_,E,b),w=n.Z.dot(g,x);if(l){if(w<c.Z.EPSILON6||(u=n.Z.subtract(m,t,v),(d=n.Z.dot(u,x))<0||d>w)||(h=n.Z.cross(u,g,T),(f=n.Z.dot(_,h))<0||d+f>w))return;p=n.Z.dot(E,h)/w}else{if(Math.abs(w)<c.Z.EPSILON6)return;let e=1/w;if(u=n.Z.subtract(m,t,v),(d=n.Z.dot(u,x)*e)<0||d>1||(h=n.Z.cross(u,g,T),(f=n.Z.dot(_,h)*e)<0||d+f>1))return;p=n.Z.dot(E,h)*e}return p},g.rayTriangle=function(e,t,i,r,o,s){let l=g.rayTriangleParametric(e,t,i,r,o);if((0,a.Z)(l)&&!(l<0))return(0,a.Z)(s)||(s=new n.Z),n.Z.multiplyByScalar(e.direction,l,s),n.Z.add(e.origin,s,s)};let E=new _.Z;g.lineSegmentTriangle=function(e,t,i,r,o,l,c){if(!(0,a.Z)(e))throw new s.Z("v0 is required.");if(!(0,a.Z)(t))throw new s.Z("v1 is required.");if(!(0,a.Z)(i))throw new s.Z("p0 is required.");if(!(0,a.Z)(r))throw new s.Z("p1 is required.");if(!(0,a.Z)(o))throw new s.Z("p2 is required.");n.Z.clone(e,E.origin),n.Z.subtract(t,e,E.direction),n.Z.normalize(E.direction,E.direction);let u=g.rayTriangleParametric(E,i,r,o,l);if(!(!(0,a.Z)(u)||u<0||u>n.Z.distance(e,t)))return(0,a.Z)(c)||(c=new n.Z),n.Z.multiplyByScalar(E.direction,u,c),n.Z.add(E.origin,c,c)};let x={root0:0,root1:0};function w(e,t,i){(0,a.Z)(i)||(i=new l.Z);let r=e.origin,o=e.direction,s=t.center,c=t.radius*t.radius,u=n.Z.subtract(r,s,b),h=function(e,t,i,n){let r=t*t-4*e*i;if(r<0)return;if(r>0){let i=1/(2*e),o=Math.sqrt(r),a=(-t+o)*i,s=(-t-o)*i;return a<s?(n.root0=a,n.root1=s):(n.root0=s,n.root1=a),n}let o=-t/(2*e);if(0!==o)return n.root0=n.root1=o,n}(n.Z.dot(o,o),2*n.Z.dot(o,u),n.Z.magnitudeSquared(u)-c,x);if((0,a.Z)(h))return i.start=h.root0,i.stop=h.root1,i}g.raySphere=function(e,t,i){if(!(0,a.Z)(e))throw new s.Z("ray is required.");if(!(0,a.Z)(t))throw new s.Z("sphere is required.");if(i=w(e,t,i),(0,a.Z)(i)&&!(i.stop<0))return i.start=Math.max(i.start,0),i};let S=new _.Z;g.lineSegmentSphere=function(e,t,i,r){if(!(0,a.Z)(e))throw new s.Z("p0 is required.");if(!(0,a.Z)(t))throw new s.Z("p1 is required.");if(!(0,a.Z)(i))throw new s.Z("sphere is required.");n.Z.clone(e,S.origin);let o=n.Z.subtract(t,e,S.direction),l=n.Z.magnitude(o);if(n.Z.normalize(o,o),r=w(S,i,r),(0,a.Z)(r)&&!(r.stop<0)&&!(r.start>l))return r.start=Math.max(r.start,0),r.stop=Math.min(r.stop,l),r};let C=new n.Z,A=new n.Z;function I(e,t,i){let n=e+t;return c.Z.sign(e)!==c.Z.sign(t)&&Math.abs(n/Math.max(Math.abs(e),Math.abs(t)))<i?0:n}g.rayEllipsoid=function(e,t){let i,r,o,c,u;if(!(0,a.Z)(e))throw new s.Z("ray is required.");if(!(0,a.Z)(t))throw new s.Z("ellipsoid is required.");let h=t.oneOverRadii,d=n.Z.multiplyComponents(h,e.origin,C),f=n.Z.multiplyComponents(h,e.direction,A),p=n.Z.magnitudeSquared(d),m=n.Z.dot(d,f);if(p>1){if(m>=0)return;let e=m*m;if(i=p-1,e<(o=(r=n.Z.magnitudeSquared(f))*i))return;if(e>o){c=m*m-o;let e=(u=-m+Math.sqrt(c))/r,t=i/u;return e<t?new l.Z(e,t):{start:t,stop:e}}let t=Math.sqrt(i/r);return new l.Z(t,t)}return p<1?(i=p-1,c=m*m-(o=(r=n.Z.magnitudeSquared(f))*i),u=-m+Math.sqrt(c),new l.Z(0,u/r)):m<0?(r=n.Z.magnitudeSquared(f),new l.Z(0,-m/r)):void 0},g.quadraticVectorExpression=function(e,t,i,r,o){let a;let s=r*r,l=o*o,d=(e[u.Z.COLUMN1ROW1]-e[u.Z.COLUMN2ROW2])*l,f=o*(r*I(e[u.Z.COLUMN1ROW0],e[u.Z.COLUMN0ROW1],c.Z.EPSILON15)+t.y),p=e[u.Z.COLUMN0ROW0]*s+e[u.Z.COLUMN2ROW2]*l+r*t.x+i,_=l*I(e[u.Z.COLUMN2ROW1],e[u.Z.COLUMN1ROW2],c.Z.EPSILON15),g=o*(r*I(e[u.Z.COLUMN2ROW0],e[u.Z.COLUMN0ROW2])+t.z),Z=[];if(0===g&&0===_){if(0===(a=h.computeRealRoots(d,f,p)).length)return Z;let e=a[0],t=Math.sqrt(Math.max(1-e*e,0));if(Z.push(new n.Z(r,o*e,-(o*t))),Z.push(new n.Z(r,o*e,o*t)),2===a.length){let e=a[1],t=Math.sqrt(Math.max(1-e*e,0));Z.push(new n.Z(r,o*e,-(o*t))),Z.push(new n.Z(r,o*e,o*t))}return Z}let y=g*g,b=_*_,v=g*_,T=d*d+b,E=2*(f*d+v),x=2*p*d+f*f-b+y,w=2*(p*f-v),S=p*p-y;if(0===T&&0===E&&0===x&&0===w)return Z;let C=(a=m.computeRealRoots(T,E,x,w,S)).length;if(0===C)return Z;for(let e=0;e<C;++e){let t=a[e],i=t*t,s=Math.sqrt(Math.max(1-i,0)),l=(c.Z.sign(d)===c.Z.sign(p)?I(d*i+p,f*t,c.Z.EPSILON12):c.Z.sign(p)===c.Z.sign(f*t)?I(d*i,f*t+p,c.Z.EPSILON12):I(d*i+f*t,p,c.Z.EPSILON12))*I(_*t,g,c.Z.EPSILON15);l<0?Z.push(new n.Z(r,o*t,o*s)):l>0?Z.push(new n.Z(r,o*t,-(o*s))):0!==s?(Z.push(new n.Z(r,o*t,-(o*s))),Z.push(new n.Z(r,o*t,o*s)),++e):Z.push(new n.Z(r,o*t,o*s))}return Z};let O=new n.Z,D=new n.Z,P=new n.Z,R=new n.Z,N=new n.Z,L=new u.Z,M=new u.Z,F=new u.Z,z=new u.Z,B=new u.Z,U=new u.Z,k=new u.Z,V=new n.Z,H=new n.Z,G=new r.Z;g.grazingAltitudeLocation=function(e,t){let i,r;if(!(0,a.Z)(e))throw new s.Z("ray is required.");if(!(0,a.Z)(t))throw new s.Z("ellipsoid is required.");let o=e.origin,l=e.direction;if(!n.Z.equals(o,n.Z.ZERO)){let e=t.geodeticSurfaceNormal(o,O);if(n.Z.dot(l,e)>=0)return o}let h=(0,a.Z)(this.rayEllipsoid(e,t)),d=t.transformPositionToScaledSpace(l,O),f=n.Z.normalize(d,d),p=n.Z.mostOrthogonalAxis(d,R),m=n.Z.normalize(n.Z.cross(p,f,D),D),_=n.Z.normalize(n.Z.cross(f,m,P),P);L[0]=f.x,L[1]=f.y,L[2]=f.z,L[3]=m.x,L[4]=m.y,L[5]=m.z,L[6]=_.x,L[7]=_.y,L[8]=_.z;let Z=u.Z.transpose(L,M),y=u.Z.fromScale(t.radii,F),b=u.Z.fromScale(t.oneOverRadii,z);B[0]=0,B[1]=-l.z,B[2]=l.y,B[3]=l.z,B[4]=0,B[5]=-l.x,B[6]=-l.y,B[7]=l.x,B[8]=0;let v=u.Z.multiply(u.Z.multiply(Z,b,U),B,U),T=u.Z.multiply(u.Z.multiply(v,y,k),L,k),E=u.Z.multiplyByVector(v,o,N),x=g.quadraticVectorExpression(T,n.Z.negate(E,O),0,0,1),w=x.length;if(w>0){let e=n.Z.clone(n.Z.ZERO,H),a=Number.NEGATIVE_INFINITY;for(let t=0;t<w;++t){i=u.Z.multiplyByVector(y,u.Z.multiplyByVector(L,x[t],V),V);let r=n.Z.normalize(n.Z.subtract(i,o,R),R),s=n.Z.dot(r,l);s>a&&(a=s,e=n.Z.clone(i,e))}let s=t.cartesianToCartographic(e,G);return a=c.Z.clamp(a,0,1),r=n.Z.magnitude(n.Z.subtract(e,o,R))*Math.sqrt(1-a*a),r=h?-r:r,s.height=r,t.cartographicToCartesian(s,new n.Z)}};let j=new n.Z;g.lineSegmentPlane=function(e,t,i,r){if(!(0,a.Z)(e))throw new s.Z("endPoint0 is required.");if(!(0,a.Z)(t))throw new s.Z("endPoint1 is required.");if(!(0,a.Z)(i))throw new s.Z("plane is required.");(0,a.Z)(r)||(r=new n.Z);let o=n.Z.subtract(t,e,j),l=i.normal,u=n.Z.dot(l,o);if(Math.abs(u)<c.Z.EPSILON6)return;let h=n.Z.dot(l,e),d=-(i.distance+h)/u;if(!(d<0)&&!(d>1))return n.Z.multiplyByScalar(o,d,r),n.Z.add(e,r,r),r},g.trianglePlaneIntersection=function(e,t,i,r){let o,l,c;if(!(0,a.Z)(e)||!(0,a.Z)(t)||!(0,a.Z)(i)||!(0,a.Z)(r))throw new s.Z("p0, p1, p2, and plane are required.");let u=r.normal,h=r.distance,d=n.Z.dot(u,e)+h<0,f=n.Z.dot(u,t)+h<0,p=n.Z.dot(u,i)+h<0;if((1==(c=0+(d?1:0)+(f?1:0)+(p?1:0))||2===c)&&(o=new n.Z,l=new n.Z),1===c){if(d)return g.lineSegmentPlane(e,t,r,o),g.lineSegmentPlane(e,i,r,l),{positions:[e,t,i,o,l],indices:[0,3,4,1,2,4,1,4,3]};if(f)return g.lineSegmentPlane(t,i,r,o),g.lineSegmentPlane(t,e,r,l),{positions:[e,t,i,o,l],indices:[1,3,4,2,0,4,2,4,3]};if(p)return g.lineSegmentPlane(i,e,r,o),g.lineSegmentPlane(i,t,r,l),{positions:[e,t,i,o,l],indices:[2,3,4,0,1,4,0,4,3]}}else if(2===c){if(!d)return g.lineSegmentPlane(t,e,r,o),g.lineSegmentPlane(i,e,r,l),{positions:[e,t,i,o,l],indices:[1,2,4,1,4,3,0,3,4]};if(!f)return g.lineSegmentPlane(i,t,r,o),g.lineSegmentPlane(e,t,r,l),{positions:[e,t,i,o,l],indices:[2,0,4,2,4,3,1,3,4]};if(!p)return g.lineSegmentPlane(e,i,r,o),g.lineSegmentPlane(t,i,r,l),{positions:[e,t,i,o,l],indices:[0,1,4,0,4,3,2,3,4]}}};var W=g},2944:function(e,t,i){"use strict";var n=i(4572);t.Z=function(e,t){this.start=(0,n.Z)(e,0),this.stop=(0,n.Z)(t,0)}},4249:function(e,t,i){"use strict";let n;var r=i(954),o=i(9410),a=i(8358);let s="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiI0YjhlOGM0Yy0xNzcwLTQwNWEtODk4Yy0xMGJkODg4MTA5ZGEiLCJpZCI6MjU5LCJpYXQiOjE3MTc0MzM4NjB9.VwBpSnRTNdg_G6uvU-JNsRNcSOCDMKW_j3Nl5E7wfwg",l={};l.defaultAccessToken=s,l.defaultServer=new a.Z({url:"https://api.cesium.com/"}),l.getDefaultTokenCredit=function(e){if(e===s)return(0,o.Z)(n)||(n=new r.Z('<b> This application is using Cesium\'s default ion access token. Please assign <i>Cesium.Ion.defaultAccessToken</i> with an access token from your ion account before making any Cesium API calls. You can sign up for a free ion account at <a href="https://cesium.com">https://cesium.com</a>.</b>',!0)),n},t.Z=l},3905:function(e,t,i){"use strict";var n=i(4355),r=i(698),o=i(954),a=i(4572),s=i(9410),l=i(4249),c=i(8358),u=i(87);function h(e,t){let i;r.Z.defined("endpoint",e),r.Z.defined("endpointResource",t);let o=e.externalType,a=(0,s.Z)(o);if(a){if("3DTILES"===o||"STK_TERRAIN_SERVER"===o)i={url:e.options.url};else throw new u.Z("Ion.createResource does not support external imagery assets; use IonImageryProvider instead.")}else i={url:e.url,retryAttempts:1,retryCallback:d};c.Z.call(this,i),this._ionEndpoint=e,this._ionEndpointDomain=a?void 0:new n(e.url).authority(),this._ionEndpointResource=t,this._ionRoot=void 0,this._pendingPromise=void 0,this._credits=void 0,this._isExternal=a}function d(e,t){let i=(0,a.Z)(e._ionRoot,e),n=i._ionEndpointResource,r="undefined"!=typeof Image;return(0,s.Z)(t)&&(401===t.statusCode||r&&t.target instanceof Image)?((0,s.Z)(i._pendingPromise)||(i._pendingPromise=n.fetchJson().then(function(e){return i._ionEndpoint=e,e}).finally(function(e){return i._pendingPromise=void 0,e})),i._pendingPromise.then(function(t){return e._ionEndpoint=t,!0})):Promise.resolve(!1)}(0,s.Z)(Object.create)&&(h.prototype=Object.create(c.Z.prototype),h.prototype.constructor=h),h.fromAssetId=function(e,t){let i=h._createEndpointResource(e,t);return i.fetchJson().then(function(e){return new h(e,i)})},Object.defineProperties(h.prototype,{credits:{get:function(){return(0,s.Z)(this._ionRoot)?this._ionRoot.credits:((0,s.Z)(this._credits)||(this._credits=h.getCreditsFromEndpoint(this._ionEndpoint,this._ionEndpointResource)),this._credits)}}}),h.getCreditsFromEndpoint=function(e,t){let i=e.attributions.map(o.Z.getIonCredit),n=l.Z.getDefaultTokenCredit(t.queryParameters.access_token);return(0,s.Z)(n)&&i.push(o.Z.clone(n)),i},h.prototype.clone=function(e){let t=(0,a.Z)(this._ionRoot,this);return(0,s.Z)(e)||(e=new h(t._ionEndpoint,t._ionEndpointResource)),(e=c.Z.prototype.clone.call(this,e))._ionRoot=t,e._isExternal=this._isExternal,e},h.prototype.fetchImage=function(e){if(!this._isExternal){let t=e;e={preferBlob:!0},(0,s.Z)(t)&&(e.flipY=t.flipY,e.preferImageBitmap=t.preferImageBitmap)}return c.Z.prototype.fetchImage.call(this,e)},h.prototype._makeRequest=function(e){return this._isExternal||new n(this.url).authority()!==this._ionEndpointDomain||((0,s.Z)(e.headers)||(e.headers={}),e.headers.Authorization=`Bearer ${this._ionEndpoint.accessToken}`,e.headers["X-Cesium-Client"]="CesiumJS","undefined"!=typeof CESIUM_VERSION&&(e.headers["X-Cesium-Client-Version"]=CESIUM_VERSION)),c.Z.prototype._makeRequest.call(this,e)},h._createEndpointResource=function(e,t){r.Z.defined("assetId",e),t=(0,a.Z)(t,a.Z.EMPTY_OBJECT);let i=(0,a.Z)(t.server,l.Z.defaultServer),n=(0,a.Z)(t.accessToken,l.Z.defaultAccessToken);i=c.Z.createIfNeeded(i);let o={url:`v1/assets/${e}/endpoint`};return(0,s.Z)(n)&&(o.queryParameters={access_token:n}),i.getDerivedResource(o)},t.Z=h},948:function(e,t){"use strict";t.Z=Object.freeze({SHIFT:0,CTRL:1,ALT:2})},2150:function(e,t,i){"use strict";var n=i(5413),r=i(698),o=i(4572),a=i(9410),s=i(9824);let l={};l.EPSILON1=.1,l.EPSILON2=.01,l.EPSILON3=.001,l.EPSILON4=1e-4,l.EPSILON5=1e-5,l.EPSILON6=1e-6,l.EPSILON7=1e-7,l.EPSILON8=1e-8,l.EPSILON9=1e-9,l.EPSILON10=1e-10,l.EPSILON11=1e-11,l.EPSILON12=1e-12,l.EPSILON13=1e-13,l.EPSILON14=1e-14,l.EPSILON15=1e-15,l.EPSILON16=1e-16,l.EPSILON17=1e-17,l.EPSILON18=1e-18,l.EPSILON19=1e-19,l.EPSILON20=1e-20,l.EPSILON21=1e-21,l.GRAVITATIONALPARAMETER=3986004418e5,l.SOLAR_RADIUS=6955e5,l.LUNAR_RADIUS=1737400,l.SIXTY_FOUR_KILOBYTES=65536,l.FOUR_GIGABYTES=4294967296,l.sign=(0,o.Z)(Math.sign,function(e){return 0==(e=+e)||e!=e?e:e>0?1:-1}),l.signNotZero=function(e){return e<0?-1:1},l.toSNorm=function(e,t){return t=(0,o.Z)(t,255),Math.round((.5*l.clamp(e,-1,1)+.5)*t)},l.fromSNorm=function(e,t){return t=(0,o.Z)(t,255),l.clamp(e,0,t)/t*2-1},l.normalize=function(e,t,i){return 0===(i=Math.max(i-t,0))?0:l.clamp((e-t)/i,0,1)},l.sinh=(0,o.Z)(Math.sinh,function(e){return(Math.exp(e)-Math.exp(-e))/2}),l.cosh=(0,o.Z)(Math.cosh,function(e){return(Math.exp(e)+Math.exp(-e))/2}),l.lerp=function(e,t,i){return(1-i)*e+i*t},l.PI=Math.PI,l.ONE_OVER_PI=1/Math.PI,l.PI_OVER_TWO=Math.PI/2,l.PI_OVER_THREE=Math.PI/3,l.PI_OVER_FOUR=Math.PI/4,l.PI_OVER_SIX=Math.PI/6,l.THREE_PI_OVER_TWO=3*Math.PI/2,l.TWO_PI=2*Math.PI,l.ONE_OVER_TWO_PI=1/(2*Math.PI),l.RADIANS_PER_DEGREE=Math.PI/180,l.DEGREES_PER_RADIAN=180/Math.PI,l.RADIANS_PER_ARCSECOND=l.RADIANS_PER_DEGREE/3600,l.toRadians=function(e){if(!(0,a.Z)(e))throw new s.Z("degrees is required.");return e*l.RADIANS_PER_DEGREE},l.toDegrees=function(e){if(!(0,a.Z)(e))throw new s.Z("radians is required.");return e*l.DEGREES_PER_RADIAN},l.convertLongitudeRange=function(e){if(!(0,a.Z)(e))throw new s.Z("angle is required.");let t=l.TWO_PI,i=e-Math.floor(e/t)*t;return i<-Math.PI?i+t:i>=Math.PI?i-t:i},l.clampToLatitudeRange=function(e){if(!(0,a.Z)(e))throw new s.Z("angle is required.");return l.clamp(e,-1*l.PI_OVER_TWO,l.PI_OVER_TWO)},l.negativePiToPi=function(e){if(!(0,a.Z)(e))throw new s.Z("angle is required.");return e>=-l.PI&&e<=l.PI?e:l.zeroToTwoPi(e+l.PI)-l.PI},l.zeroToTwoPi=function(e){if(!(0,a.Z)(e))throw new s.Z("angle is required.");if(e>=0&&e<=l.TWO_PI)return e;let t=l.mod(e,l.TWO_PI);return Math.abs(t)<l.EPSILON14&&Math.abs(e)>l.EPSILON14?l.TWO_PI:t},l.mod=function(e,t){if(!(0,a.Z)(e))throw new s.Z("m is required.");if(!(0,a.Z)(t))throw new s.Z("n is required.");if(0===t)throw new s.Z("divisor cannot be 0.");return l.sign(e)===l.sign(t)&&Math.abs(e)<Math.abs(t)?e:(e%t+t)%t},l.equalsEpsilon=function(e,t,i,n){if(!(0,a.Z)(e))throw new s.Z("left is required.");if(!(0,a.Z)(t))throw new s.Z("right is required.");i=(0,o.Z)(i,0);let r=Math.abs(e-t);return r<=(n=(0,o.Z)(n,i))||r<=i*Math.max(Math.abs(e),Math.abs(t))},l.lessThan=function(e,t,i){if(!(0,a.Z)(e))throw new s.Z("first is required.");if(!(0,a.Z)(t))throw new s.Z("second is required.");if(!(0,a.Z)(i))throw new s.Z("absoluteEpsilon is required.");return e-t<-i},l.lessThanOrEquals=function(e,t,i){if(!(0,a.Z)(e))throw new s.Z("first is required.");if(!(0,a.Z)(t))throw new s.Z("second is required.");if(!(0,a.Z)(i))throw new s.Z("absoluteEpsilon is required.");return e-t<i},l.greaterThan=function(e,t,i){if(!(0,a.Z)(e))throw new s.Z("first is required.");if(!(0,a.Z)(t))throw new s.Z("second is required.");if(!(0,a.Z)(i))throw new s.Z("absoluteEpsilon is required.");return e-t>i},l.greaterThanOrEquals=function(e,t,i){if(!(0,a.Z)(e))throw new s.Z("first is required.");if(!(0,a.Z)(t))throw new s.Z("second is required.");if(!(0,a.Z)(i))throw new s.Z("absoluteEpsilon is required.");return e-t>-i};let c=[1];l.factorial=function(e){if("number"!=typeof e||e<0)throw new s.Z("A number greater than or equal to 0 is required.");let t=c.length;if(e>=t){let i=c[t-1];for(let n=t;n<=e;n++){let e=i*n;c.push(e),i=e}}return c[e]},l.incrementWrap=function(e,t,i){if(i=(0,o.Z)(i,0),!(0,a.Z)(e))throw new s.Z("n is required.");if(t<=i)throw new s.Z("maximumValue must be greater than minimumValue.");return++e>t&&(e=i),e},l.isPowerOfTwo=function(e){if("number"!=typeof e||e<0||e>4294967295)throw new s.Z("A number between 0 and (2^32)-1 is required.");return 0!==e&&(e&e-1)==0},l.nextPowerOfTwo=function(e){if("number"!=typeof e||e<0||e>2147483648)throw new s.Z("A number between 0 and 2^31 is required.");return--e,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e},l.previousPowerOfTwo=function(e){if("number"!=typeof e||e<0||e>4294967295)throw new s.Z("A number between 0 and (2^32)-1 is required.");return e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,e|=e>>32,e=(e>>>0)-(e>>>1)},l.clamp=function(e,t,i){return r.Z.typeOf.number("value",e),r.Z.typeOf.number("min",t),r.Z.typeOf.number("max",i),e<t?t:e>i?i:e};let u=new n;l.setRandomNumberSeed=function(e){if(!(0,a.Z)(e))throw new s.Z("seed is required.");u=new n(e)},l.nextRandomNumber=function(){return u.random()},l.randomBetween=function(e,t){return l.nextRandomNumber()*(t-e)+e},l.acosClamped=function(e){if(!(0,a.Z)(e))throw new s.Z("value is required.");return Math.acos(l.clamp(e,-1,1))},l.asinClamped=function(e){if(!(0,a.Z)(e))throw new s.Z("value is required.");return Math.asin(l.clamp(e,-1,1))},l.chordLength=function(e,t){if(!(0,a.Z)(e))throw new s.Z("angle is required.");if(!(0,a.Z)(t))throw new s.Z("radius is required.");return 2*t*Math.sin(.5*e)},l.logBase=function(e,t){if(!(0,a.Z)(e))throw new s.Z("number is required.");if(!(0,a.Z)(t))throw new s.Z("base is required.");return Math.log(e)/Math.log(t)},l.cbrt=(0,o.Z)(Math.cbrt,function(e){let t=Math.pow(Math.abs(e),1/3);return e<0?-t:t}),l.log2=(0,o.Z)(Math.log2,function(e){return Math.log(e)*Math.LOG2E}),l.fog=function(e,t){let i=e*t;return 1-Math.exp(-(i*i))},l.fastApproximateAtan=function(e){return r.Z.typeOf.number("x",e),e*(-.1784*Math.abs(e)-.0663*e*e+1.0301)},l.fastApproximateAtan2=function(e,t){let i;r.Z.typeOf.number("x",e),r.Z.typeOf.number("y",t);let n=Math.abs(e),o=Math.max(n,i=Math.abs(t)),a=(i=Math.min(n,i))/o;if(isNaN(a))throw new s.Z("either x or y must be nonzero");return n=l.fastApproximateAtan(a),n=Math.abs(t)>Math.abs(e)?l.PI_OVER_TWO-n:n,n=e<0?l.PI-n:n,n=t<0?-n:n},t.Z=l},3037:function(e,t,i){"use strict";var n=i(570),r=i(698),o=i(4572),a=i(9410),s=i(9824);function l(e,t,i,n){this[0]=(0,o.Z)(e,0),this[1]=(0,o.Z)(i,0),this[2]=(0,o.Z)(t,0),this[3]=(0,o.Z)(n,0)}l.packedLength=4,l.pack=function(e,t,i){return r.Z.typeOf.object("value",e),r.Z.defined("array",t),i=(0,o.Z)(i,0),t[i++]=e[0],t[i++]=e[1],t[i++]=e[2],t[i++]=e[3],t},l.unpack=function(e,t,i){return r.Z.defined("array",e),t=(0,o.Z)(t,0),(0,a.Z)(i)||(i=new l),i[0]=e[t++],i[1]=e[t++],i[2]=e[t++],i[3]=e[t++],i},l.packArray=function(e,t){r.Z.defined("array",e);let i=e.length,n=4*i;if((0,a.Z)(t)){if(Array.isArray(t)||t.length===n)t.length!==n&&(t.length=n);else throw new s.Z("If result is a typed array, it must have exactly array.length * 4 elements")}else t=Array(n);for(let n=0;n<i;++n)l.pack(e[n],t,4*n);return t},l.unpackArray=function(e,t){if(r.Z.defined("array",e),r.Z.typeOf.number.greaterThanOrEquals("array.length",e.length,4),e.length%4!=0)throw new s.Z("array length must be a multiple of 4.");let i=e.length;(0,a.Z)(t)?t.length=i/4:t=Array(i/4);for(let n=0;n<i;n+=4){let i=n/4;t[i]=l.unpack(e,n,t[i])}return t},l.clone=function(e,t){return(0,a.Z)(e)?(0,a.Z)(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t):new l(e[0],e[2],e[1],e[3]):void 0},l.fromArray=l.unpack,l.fromColumnMajorArray=function(e,t){return r.Z.defined("values",e),l.clone(e,t)},l.fromRowMajorArray=function(e,t){return(r.Z.defined("values",e),(0,a.Z)(t))?(t[0]=e[0],t[1]=e[2],t[2]=e[1],t[3]=e[3],t):new l(e[0],e[1],e[2],e[3])},l.fromScale=function(e,t){return(r.Z.typeOf.object("scale",e),(0,a.Z)(t))?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=e.y,t):new l(e.x,0,0,e.y)},l.fromUniformScale=function(e,t){return(r.Z.typeOf.number("scale",e),(0,a.Z)(t))?(t[0]=e,t[1]=0,t[2]=0,t[3]=e,t):new l(e,0,0,e)},l.fromRotation=function(e,t){r.Z.typeOf.number("angle",e);let i=Math.cos(e),n=Math.sin(e);return(0,a.Z)(t)?(t[0]=i,t[1]=n,t[2]=-n,t[3]=i,t):new l(i,-n,n,i)},l.toArray=function(e,t){return(r.Z.typeOf.object("matrix",e),(0,a.Z)(t))?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t):[e[0],e[1],e[2],e[3]]},l.getElementIndex=function(e,t){return r.Z.typeOf.number.greaterThanOrEquals("row",t,0),r.Z.typeOf.number.lessThanOrEquals("row",t,1),r.Z.typeOf.number.greaterThanOrEquals("column",e,0),r.Z.typeOf.number.lessThanOrEquals("column",e,1),2*e+t},l.getColumn=function(e,t,i){r.Z.typeOf.object("matrix",e),r.Z.typeOf.number.greaterThanOrEquals("index",t,0),r.Z.typeOf.number.lessThanOrEquals("index",t,1),r.Z.typeOf.object("result",i);let n=2*t,o=e[n],a=e[n+1];return i.x=o,i.y=a,i},l.setColumn=function(e,t,i,n){r.Z.typeOf.object("matrix",e),r.Z.typeOf.number.greaterThanOrEquals("index",t,0),r.Z.typeOf.number.lessThanOrEquals("index",t,1),r.Z.typeOf.object("cartesian",i),r.Z.typeOf.object("result",n),n=l.clone(e,n);let o=2*t;return n[o]=i.x,n[o+1]=i.y,n},l.getRow=function(e,t,i){r.Z.typeOf.object("matrix",e),r.Z.typeOf.number.greaterThanOrEquals("index",t,0),r.Z.typeOf.number.lessThanOrEquals("index",t,1),r.Z.typeOf.object("result",i);let n=e[t],o=e[t+2];return i.x=n,i.y=o,i},l.setRow=function(e,t,i,n){return r.Z.typeOf.object("matrix",e),r.Z.typeOf.number.greaterThanOrEquals("index",t,0),r.Z.typeOf.number.lessThanOrEquals("index",t,1),r.Z.typeOf.object("cartesian",i),r.Z.typeOf.object("result",n),(n=l.clone(e,n))[t]=i.x,n[t+2]=i.y,n};let c=new n.Z;l.setScale=function(e,t,i){r.Z.typeOf.object("matrix",e),r.Z.typeOf.object("scale",t),r.Z.typeOf.object("result",i);let n=l.getScale(e,c),o=t.x/n.x,a=t.y/n.y;return i[0]=e[0]*o,i[1]=e[1]*o,i[2]=e[2]*a,i[3]=e[3]*a,i};let u=new n.Z;l.setUniformScale=function(e,t,i){r.Z.typeOf.object("matrix",e),r.Z.typeOf.number("scale",t),r.Z.typeOf.object("result",i);let n=l.getScale(e,u),o=t/n.x,a=t/n.y;return i[0]=e[0]*o,i[1]=e[1]*o,i[2]=e[2]*a,i[3]=e[3]*a,i};let h=new n.Z;l.getScale=function(e,t){return r.Z.typeOf.object("matrix",e),r.Z.typeOf.object("result",t),t.x=n.Z.magnitude(n.Z.fromElements(e[0],e[1],h)),t.y=n.Z.magnitude(n.Z.fromElements(e[2],e[3],h)),t};let d=new n.Z;l.getMaximumScale=function(e){return l.getScale(e,d),n.Z.maximumComponent(d)};let f=new n.Z;l.setRotation=function(e,t,i){r.Z.typeOf.object("matrix",e),r.Z.typeOf.object("result",i);let n=l.getScale(e,f);return i[0]=t[0]*n.x,i[1]=t[1]*n.x,i[2]=t[2]*n.y,i[3]=t[3]*n.y,i};let p=new n.Z;l.getRotation=function(e,t){r.Z.typeOf.object("matrix",e),r.Z.typeOf.object("result",t);let i=l.getScale(e,p);return t[0]=e[0]/i.x,t[1]=e[1]/i.x,t[2]=e[2]/i.y,t[3]=e[3]/i.y,t},l.multiply=function(e,t,i){r.Z.typeOf.object("left",e),r.Z.typeOf.object("right",t),r.Z.typeOf.object("result",i);let n=e[0]*t[0]+e[2]*t[1],o=e[0]*t[2]+e[2]*t[3],a=e[1]*t[0]+e[3]*t[1],s=e[1]*t[2]+e[3]*t[3];return i[0]=n,i[1]=a,i[2]=o,i[3]=s,i},l.add=function(e,t,i){return r.Z.typeOf.object("left",e),r.Z.typeOf.object("right",t),r.Z.typeOf.object("result",i),i[0]=e[0]+t[0],i[1]=e[1]+t[1],i[2]=e[2]+t[2],i[3]=e[3]+t[3],i},l.subtract=function(e,t,i){return r.Z.typeOf.object("left",e),r.Z.typeOf.object("right",t),r.Z.typeOf.object("result",i),i[0]=e[0]-t[0],i[1]=e[1]-t[1],i[2]=e[2]-t[2],i[3]=e[3]-t[3],i},l.multiplyByVector=function(e,t,i){r.Z.typeOf.object("matrix",e),r.Z.typeOf.object("cartesian",t),r.Z.typeOf.object("result",i);let n=e[0]*t.x+e[2]*t.y,o=e[1]*t.x+e[3]*t.y;return i.x=n,i.y=o,i},l.multiplyByScalar=function(e,t,i){return r.Z.typeOf.object("matrix",e),r.Z.typeOf.number("scalar",t),r.Z.typeOf.object("result",i),i[0]=e[0]*t,i[1]=e[1]*t,i[2]=e[2]*t,i[3]=e[3]*t,i},l.multiplyByScale=function(e,t,i){return r.Z.typeOf.object("matrix",e),r.Z.typeOf.object("scale",t),r.Z.typeOf.object("result",i),i[0]=e[0]*t.x,i[1]=e[1]*t.x,i[2]=e[2]*t.y,i[3]=e[3]*t.y,i},l.multiplyByUniformScale=function(e,t,i){return r.Z.typeOf.object("matrix",e),r.Z.typeOf.number("scale",t),r.Z.typeOf.object("result",i),i[0]=e[0]*t,i[1]=e[1]*t,i[2]=e[2]*t,i[3]=e[3]*t,i},l.negate=function(e,t){return r.Z.typeOf.object("matrix",e),r.Z.typeOf.object("result",t),t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t},l.transpose=function(e,t){r.Z.typeOf.object("matrix",e),r.Z.typeOf.object("result",t);let i=e[0],n=e[2],o=e[1],a=e[3];return t[0]=i,t[1]=n,t[2]=o,t[3]=a,t},l.abs=function(e,t){return r.Z.typeOf.object("matrix",e),r.Z.typeOf.object("result",t),t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t[3]=Math.abs(e[3]),t},l.equals=function(e,t){return e===t||(0,a.Z)(e)&&(0,a.Z)(t)&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]},l.equalsArray=function(e,t,i){return e[0]===t[i]&&e[1]===t[i+1]&&e[2]===t[i+2]&&e[3]===t[i+3]},l.equalsEpsilon=function(e,t,i){return i=(0,o.Z)(i,0),e===t||(0,a.Z)(e)&&(0,a.Z)(t)&&Math.abs(e[0]-t[0])<=i&&Math.abs(e[1]-t[1])<=i&&Math.abs(e[2]-t[2])<=i&&Math.abs(e[3]-t[3])<=i},l.IDENTITY=Object.freeze(new l(1,0,0,1)),l.ZERO=Object.freeze(new l(0,0,0,0)),l.COLUMN0ROW0=0,l.COLUMN0ROW1=1,l.COLUMN1ROW0=2,l.COLUMN1ROW1=3,Object.defineProperties(l.prototype,{length:{get:function(){return l.packedLength}}}),l.prototype.clone=function(e){return l.clone(this,e)},l.prototype.equals=function(e){return l.equals(this,e)},l.prototype.equalsEpsilon=function(e,t){return l.equalsEpsilon(this,e,t)},l.prototype.toString=function(){return`(${this[0]}, ${this[2]}) (${this[1]}, ${this[3]})`},t.Z=l},3186:function(e,t,i){"use strict";var n=i(1486),r=i(698),o=i(4572),a=i(9410),s=i(9824),l=i(2150);function c(e,t,i,n,r,a,s,l,c){this[0]=(0,o.Z)(e,0),this[1]=(0,o.Z)(n,0),this[2]=(0,o.Z)(s,0),this[3]=(0,o.Z)(t,0),this[4]=(0,o.Z)(r,0),this[5]=(0,o.Z)(l,0),this[6]=(0,o.Z)(i,0),this[7]=(0,o.Z)(a,0),this[8]=(0,o.Z)(c,0)}c.packedLength=9,c.pack=function(e,t,i){return r.Z.typeOf.object("value",e),r.Z.defined("array",t),i=(0,o.Z)(i,0),t[i++]=e[0],t[i++]=e[1],t[i++]=e[2],t[i++]=e[3],t[i++]=e[4],t[i++]=e[5],t[i++]=e[6],t[i++]=e[7],t[i++]=e[8],t},c.unpack=function(e,t,i){return r.Z.defined("array",e),t=(0,o.Z)(t,0),(0,a.Z)(i)||(i=new c),i[0]=e[t++],i[1]=e[t++],i[2]=e[t++],i[3]=e[t++],i[4]=e[t++],i[5]=e[t++],i[6]=e[t++],i[7]=e[t++],i[8]=e[t++],i},c.packArray=function(e,t){r.Z.defined("array",e);let i=e.length,n=9*i;if((0,a.Z)(t)){if(Array.isArray(t)||t.length===n)t.length!==n&&(t.length=n);else throw new s.Z("If result is a typed array, it must have exactly array.length * 9 elements")}else t=Array(n);for(let n=0;n<i;++n)c.pack(e[n],t,9*n);return t},c.unpackArray=function(e,t){if(r.Z.defined("array",e),r.Z.typeOf.number.greaterThanOrEquals("array.length",e.length,9),e.length%9!=0)throw new s.Z("array length must be a multiple of 9.");let i=e.length;(0,a.Z)(t)?t.length=i/9:t=Array(i/9);for(let n=0;n<i;n+=9){let i=n/9;t[i]=c.unpack(e,n,t[i])}return t},c.clone=function(e,t){return(0,a.Z)(e)?(0,a.Z)(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t):new c(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8]):void 0},c.fromArray=c.unpack,c.fromColumnMajorArray=function(e,t){return r.Z.defined("values",e),c.clone(e,t)},c.fromRowMajorArray=function(e,t){return(r.Z.defined("values",e),(0,a.Z)(t))?(t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],t):new c(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},c.fromQuaternion=function(e,t){r.Z.typeOf.object("quaternion",e);let i=e.x*e.x,n=e.x*e.y,o=e.x*e.z,s=e.x*e.w,l=e.y*e.y,u=e.y*e.z,h=e.y*e.w,d=e.z*e.z,f=e.z*e.w,p=e.w*e.w,m=i-l-d+p,_=2*(n-f),g=2*(o+h),Z=2*(n+f),y=-i+l-d+p,b=2*(u-s),v=2*(o-h),T=2*(u+s),E=-i-l+d+p;return(0,a.Z)(t)?(t[0]=m,t[1]=Z,t[2]=v,t[3]=_,t[4]=y,t[5]=T,t[6]=g,t[7]=b,t[8]=E,t):new c(m,_,g,Z,y,b,v,T,E)},c.fromHeadingPitchRoll=function(e,t){r.Z.typeOf.object("headingPitchRoll",e);let i=Math.cos(-e.pitch),n=Math.cos(-e.heading),o=Math.cos(e.roll),s=Math.sin(-e.pitch),l=Math.sin(-e.heading),u=Math.sin(e.roll),h=i*n,d=-o*l+u*s*n,f=u*l+o*s*n,p=i*l,m=o*n+u*s*l,_=-u*n+o*s*l,g=-s,Z=u*i,y=o*i;return(0,a.Z)(t)?(t[0]=h,t[1]=p,t[2]=g,t[3]=d,t[4]=m,t[5]=Z,t[6]=f,t[7]=_,t[8]=y,t):new c(h,d,f,p,m,_,g,Z,y)},c.fromScale=function(e,t){return(r.Z.typeOf.object("scale",e),(0,a.Z)(t))?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=0,t[4]=e.y,t[5]=0,t[6]=0,t[7]=0,t[8]=e.z,t):new c(e.x,0,0,0,e.y,0,0,0,e.z)},c.fromUniformScale=function(e,t){return(r.Z.typeOf.number("scale",e),(0,a.Z)(t))?(t[0]=e,t[1]=0,t[2]=0,t[3]=0,t[4]=e,t[5]=0,t[6]=0,t[7]=0,t[8]=e,t):new c(e,0,0,0,e,0,0,0,e)},c.fromCrossProduct=function(e,t){return(r.Z.typeOf.object("vector",e),(0,a.Z)(t))?(t[0]=0,t[1]=e.z,t[2]=-e.y,t[3]=-e.z,t[4]=0,t[5]=e.x,t[6]=e.y,t[7]=-e.x,t[8]=0,t):new c(0,-e.z,e.y,e.z,0,-e.x,-e.y,e.x,0)},c.fromRotationX=function(e,t){r.Z.typeOf.number("angle",e);let i=Math.cos(e),n=Math.sin(e);return(0,a.Z)(t)?(t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=i,t[5]=n,t[6]=0,t[7]=-n,t[8]=i,t):new c(1,0,0,0,i,-n,0,n,i)},c.fromRotationY=function(e,t){r.Z.typeOf.number("angle",e);let i=Math.cos(e),n=Math.sin(e);return(0,a.Z)(t)?(t[0]=i,t[1]=0,t[2]=-n,t[3]=0,t[4]=1,t[5]=0,t[6]=n,t[7]=0,t[8]=i,t):new c(i,0,n,0,1,0,-n,0,i)},c.fromRotationZ=function(e,t){r.Z.typeOf.number("angle",e);let i=Math.cos(e),n=Math.sin(e);return(0,a.Z)(t)?(t[0]=i,t[1]=n,t[2]=0,t[3]=-n,t[4]=i,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new c(i,-n,0,n,i,0,0,0,1)},c.toArray=function(e,t){return(r.Z.typeOf.object("matrix",e),(0,a.Z)(t))?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t):[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8]]},c.getElementIndex=function(e,t){return r.Z.typeOf.number.greaterThanOrEquals("row",t,0),r.Z.typeOf.number.lessThanOrEquals("row",t,2),r.Z.typeOf.number.greaterThanOrEquals("column",e,0),r.Z.typeOf.number.lessThanOrEquals("column",e,2),3*e+t},c.getColumn=function(e,t,i){r.Z.typeOf.object("matrix",e),r.Z.typeOf.number.greaterThanOrEquals("index",t,0),r.Z.typeOf.number.lessThanOrEquals("index",t,2),r.Z.typeOf.object("result",i);let n=3*t,o=e[n],a=e[n+1],s=e[n+2];return i.x=o,i.y=a,i.z=s,i},c.setColumn=function(e,t,i,n){r.Z.typeOf.object("matrix",e),r.Z.typeOf.number.greaterThanOrEquals("index",t,0),r.Z.typeOf.number.lessThanOrEquals("index",t,2),r.Z.typeOf.object("cartesian",i),r.Z.typeOf.object("result",n),n=c.clone(e,n);let o=3*t;return n[o]=i.x,n[o+1]=i.y,n[o+2]=i.z,n},c.getRow=function(e,t,i){r.Z.typeOf.object("matrix",e),r.Z.typeOf.number.greaterThanOrEquals("index",t,0),r.Z.typeOf.number.lessThanOrEquals("index",t,2),r.Z.typeOf.object("result",i);let n=e[t],o=e[t+3],a=e[t+6];return i.x=n,i.y=o,i.z=a,i},c.setRow=function(e,t,i,n){return r.Z.typeOf.object("matrix",e),r.Z.typeOf.number.greaterThanOrEquals("index",t,0),r.Z.typeOf.number.lessThanOrEquals("index",t,2),r.Z.typeOf.object("cartesian",i),r.Z.typeOf.object("result",n),(n=c.clone(e,n))[t]=i.x,n[t+3]=i.y,n[t+6]=i.z,n};let u=new n.Z;c.setScale=function(e,t,i){r.Z.typeOf.object("matrix",e),r.Z.typeOf.object("scale",t),r.Z.typeOf.object("result",i);let n=c.getScale(e,u),o=t.x/n.x,a=t.y/n.y,s=t.z/n.z;return i[0]=e[0]*o,i[1]=e[1]*o,i[2]=e[2]*o,i[3]=e[3]*a,i[4]=e[4]*a,i[5]=e[5]*a,i[6]=e[6]*s,i[7]=e[7]*s,i[8]=e[8]*s,i};let h=new n.Z;c.setUniformScale=function(e,t,i){r.Z.typeOf.object("matrix",e),r.Z.typeOf.number("scale",t),r.Z.typeOf.object("result",i);let n=c.getScale(e,h),o=t/n.x,a=t/n.y,s=t/n.z;return i[0]=e[0]*o,i[1]=e[1]*o,i[2]=e[2]*o,i[3]=e[3]*a,i[4]=e[4]*a,i[5]=e[5]*a,i[6]=e[6]*s,i[7]=e[7]*s,i[8]=e[8]*s,i};let d=new n.Z;c.getScale=function(e,t){return r.Z.typeOf.object("matrix",e),r.Z.typeOf.object("result",t),t.x=n.Z.magnitude(n.Z.fromElements(e[0],e[1],e[2],d)),t.y=n.Z.magnitude(n.Z.fromElements(e[3],e[4],e[5],d)),t.z=n.Z.magnitude(n.Z.fromElements(e[6],e[7],e[8],d)),t};let f=new n.Z;c.getMaximumScale=function(e){return c.getScale(e,f),n.Z.maximumComponent(f)};let p=new n.Z;c.setRotation=function(e,t,i){r.Z.typeOf.object("matrix",e),r.Z.typeOf.object("result",i);let n=c.getScale(e,p);return i[0]=t[0]*n.x,i[1]=t[1]*n.x,i[2]=t[2]*n.x,i[3]=t[3]*n.y,i[4]=t[4]*n.y,i[5]=t[5]*n.y,i[6]=t[6]*n.z,i[7]=t[7]*n.z,i[8]=t[8]*n.z,i};let m=new n.Z;c.getRotation=function(e,t){r.Z.typeOf.object("matrix",e),r.Z.typeOf.object("result",t);let i=c.getScale(e,m);return t[0]=e[0]/i.x,t[1]=e[1]/i.x,t[2]=e[2]/i.x,t[3]=e[3]/i.y,t[4]=e[4]/i.y,t[5]=e[5]/i.y,t[6]=e[6]/i.z,t[7]=e[7]/i.z,t[8]=e[8]/i.z,t},c.multiply=function(e,t,i){r.Z.typeOf.object("left",e),r.Z.typeOf.object("right",t),r.Z.typeOf.object("result",i);let n=e[0]*t[0]+e[3]*t[1]+e[6]*t[2],o=e[1]*t[0]+e[4]*t[1]+e[7]*t[2],a=e[2]*t[0]+e[5]*t[1]+e[8]*t[2],s=e[0]*t[3]+e[3]*t[4]+e[6]*t[5],l=e[1]*t[3]+e[4]*t[4]+e[7]*t[5],c=e[2]*t[3]+e[5]*t[4]+e[8]*t[5],u=e[0]*t[6]+e[3]*t[7]+e[6]*t[8],h=e[1]*t[6]+e[4]*t[7]+e[7]*t[8],d=e[2]*t[6]+e[5]*t[7]+e[8]*t[8];return i[0]=n,i[1]=o,i[2]=a,i[3]=s,i[4]=l,i[5]=c,i[6]=u,i[7]=h,i[8]=d,i},c.add=function(e,t,i){return r.Z.typeOf.object("left",e),r.Z.typeOf.object("right",t),r.Z.typeOf.object("result",i),i[0]=e[0]+t[0],i[1]=e[1]+t[1],i[2]=e[2]+t[2],i[3]=e[3]+t[3],i[4]=e[4]+t[4],i[5]=e[5]+t[5],i[6]=e[6]+t[6],i[7]=e[7]+t[7],i[8]=e[8]+t[8],i},c.subtract=function(e,t,i){return r.Z.typeOf.object("left",e),r.Z.typeOf.object("right",t),r.Z.typeOf.object("result",i),i[0]=e[0]-t[0],i[1]=e[1]-t[1],i[2]=e[2]-t[2],i[3]=e[3]-t[3],i[4]=e[4]-t[4],i[5]=e[5]-t[5],i[6]=e[6]-t[6],i[7]=e[7]-t[7],i[8]=e[8]-t[8],i},c.multiplyByVector=function(e,t,i){r.Z.typeOf.object("matrix",e),r.Z.typeOf.object("cartesian",t),r.Z.typeOf.object("result",i);let n=t.x,o=t.y,a=t.z,s=e[0]*n+e[3]*o+e[6]*a,l=e[1]*n+e[4]*o+e[7]*a,c=e[2]*n+e[5]*o+e[8]*a;return i.x=s,i.y=l,i.z=c,i},c.multiplyByScalar=function(e,t,i){return r.Z.typeOf.object("matrix",e),r.Z.typeOf.number("scalar",t),r.Z.typeOf.object("result",i),i[0]=e[0]*t,i[1]=e[1]*t,i[2]=e[2]*t,i[3]=e[3]*t,i[4]=e[4]*t,i[5]=e[5]*t,i[6]=e[6]*t,i[7]=e[7]*t,i[8]=e[8]*t,i},c.multiplyByScale=function(e,t,i){return r.Z.typeOf.object("matrix",e),r.Z.typeOf.object("scale",t),r.Z.typeOf.object("result",i),i[0]=e[0]*t.x,i[1]=e[1]*t.x,i[2]=e[2]*t.x,i[3]=e[3]*t.y,i[4]=e[4]*t.y,i[5]=e[5]*t.y,i[6]=e[6]*t.z,i[7]=e[7]*t.z,i[8]=e[8]*t.z,i},c.multiplyByUniformScale=function(e,t,i){return r.Z.typeOf.object("matrix",e),r.Z.typeOf.number("scale",t),r.Z.typeOf.object("result",i),i[0]=e[0]*t,i[1]=e[1]*t,i[2]=e[2]*t,i[3]=e[3]*t,i[4]=e[4]*t,i[5]=e[5]*t,i[6]=e[6]*t,i[7]=e[7]*t,i[8]=e[8]*t,i},c.negate=function(e,t){return r.Z.typeOf.object("matrix",e),r.Z.typeOf.object("result",t),t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t[4]=-e[4],t[5]=-e[5],t[6]=-e[6],t[7]=-e[7],t[8]=-e[8],t},c.transpose=function(e,t){r.Z.typeOf.object("matrix",e),r.Z.typeOf.object("result",t);let i=e[0],n=e[3],o=e[6],a=e[1],s=e[4],l=e[7],c=e[2],u=e[5],h=e[8];return t[0]=i,t[1]=n,t[2]=o,t[3]=a,t[4]=s,t[5]=l,t[6]=c,t[7]=u,t[8]=h,t};let _=[1,0,0],g=[2,2,1],Z=new c,y=new c;c.computeEigenDecomposition=function(e,t){r.Z.typeOf.object("matrix",e);let i=l.Z.EPSILON20,n=0,o=0;(0,a.Z)(t)||(t={});let s=t.unitary=c.clone(c.IDENTITY,t.unitary),u=t.diagonal=c.clone(e,t.diagonal),h=i*function(e){let t=0;for(let i=0;i<9;++i){let n=e[i];t+=n*n}return Math.sqrt(t)}(u);for(;o<10&&function(e){let t=0;for(let i=0;i<3;++i){let n=e[c.getElementIndex(g[i],_[i])];t+=2*n*n}return Math.sqrt(t)}(u)>h;)(function(e,t){let i=l.Z.EPSILON15,n=0,r=1;for(let t=0;t<3;++t){let i=Math.abs(e[c.getElementIndex(g[t],_[t])]);i>n&&(r=t,n=i)}let o=1,a=0,s=_[r],u=g[r];if(Math.abs(e[c.getElementIndex(u,s)])>i){let t;let i=(e[c.getElementIndex(u,u)]-e[c.getElementIndex(s,s)])/2/e[c.getElementIndex(u,s)];o=1/Math.sqrt(1+(t=i<0?-1/(-i+Math.sqrt(1+i*i)):1/(i+Math.sqrt(1+i*i)))*t),a=t*o}(t=c.clone(c.IDENTITY,t))[c.getElementIndex(s,s)]=t[c.getElementIndex(u,u)]=o,t[c.getElementIndex(u,s)]=a,t[c.getElementIndex(s,u)]=-a})(u,Z),c.transpose(Z,y),c.multiply(u,Z,u),c.multiply(y,u,u),c.multiply(s,Z,s),++n>2&&(++o,n=0);return t},c.abs=function(e,t){return r.Z.typeOf.object("matrix",e),r.Z.typeOf.object("result",t),t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t[3]=Math.abs(e[3]),t[4]=Math.abs(e[4]),t[5]=Math.abs(e[5]),t[6]=Math.abs(e[6]),t[7]=Math.abs(e[7]),t[8]=Math.abs(e[8]),t},c.determinant=function(e){r.Z.typeOf.object("matrix",e);let t=e[0],i=e[3],n=e[6],o=e[1],a=e[4],s=e[7],l=e[2],c=e[5],u=e[8];return t*(a*u-c*s)+o*(c*n-i*u)+l*(i*s-a*n)},c.inverse=function(e,t){r.Z.typeOf.object("matrix",e),r.Z.typeOf.object("result",t);let i=e[0],n=e[1],o=e[2],a=e[3],u=e[4],h=e[5],d=e[6],f=e[7],p=e[8],m=c.determinant(e);if(Math.abs(m)<=l.Z.EPSILON15)throw new s.Z("matrix is not invertible");return t[0]=u*p-f*h,t[1]=f*o-n*p,t[2]=n*h-u*o,t[3]=d*h-a*p,t[4]=i*p-d*o,t[5]=a*o-i*h,t[6]=a*f-d*u,t[7]=d*n-i*f,t[8]=i*u-a*n,c.multiplyByScalar(t,1/m,t)};let b=new c;c.inverseTranspose=function(e,t){return r.Z.typeOf.object("matrix",e),r.Z.typeOf.object("result",t),c.inverse(c.transpose(e,b),t)},c.equals=function(e,t){return e===t||(0,a.Z)(e)&&(0,a.Z)(t)&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]},c.equalsEpsilon=function(e,t,i){return i=(0,o.Z)(i,0),e===t||(0,a.Z)(e)&&(0,a.Z)(t)&&Math.abs(e[0]-t[0])<=i&&Math.abs(e[1]-t[1])<=i&&Math.abs(e[2]-t[2])<=i&&Math.abs(e[3]-t[3])<=i&&Math.abs(e[4]-t[4])<=i&&Math.abs(e[5]-t[5])<=i&&Math.abs(e[6]-t[6])<=i&&Math.abs(e[7]-t[7])<=i&&Math.abs(e[8]-t[8])<=i},c.IDENTITY=Object.freeze(new c(1,0,0,0,1,0,0,0,1)),c.ZERO=Object.freeze(new c(0,0,0,0,0,0,0,0,0)),c.COLUMN0ROW0=0,c.COLUMN0ROW1=1,c.COLUMN0ROW2=2,c.COLUMN1ROW0=3,c.COLUMN1ROW1=4,c.COLUMN1ROW2=5,c.COLUMN2ROW0=6,c.COLUMN2ROW1=7,c.COLUMN2ROW2=8,Object.defineProperties(c.prototype,{length:{get:function(){return c.packedLength}}}),c.prototype.clone=function(e){return c.clone(this,e)},c.prototype.equals=function(e){return c.equals(this,e)},c.equalsArray=function(e,t,i){return e[0]===t[i]&&e[1]===t[i+1]&&e[2]===t[i+2]&&e[3]===t[i+3]&&e[4]===t[i+4]&&e[5]===t[i+5]&&e[6]===t[i+6]&&e[7]===t[i+7]&&e[8]===t[i+8]},c.prototype.equalsEpsilon=function(e,t){return c.equalsEpsilon(this,e,t)},c.prototype.toString=function(){return`(${this[0]}, ${this[3]}, ${this[6]}) (${this[1]}, ${this[4]}, ${this[7]}) (${this[2]}, ${this[5]}, ${this[8]})`},t.Z=c},4749:function(e,t,i){"use strict";var n=i(1486),r=i(3065),o=i(698),a=i(4572),s=i(9410),l=i(9824),c=i(2150),u=i(3186),h=i(87);function d(e,t,i,n,r,o,s,l,c,u,h,d,f,p,m,_){this[0]=(0,a.Z)(e,0),this[1]=(0,a.Z)(r,0),this[2]=(0,a.Z)(c,0),this[3]=(0,a.Z)(f,0),this[4]=(0,a.Z)(t,0),this[5]=(0,a.Z)(o,0),this[6]=(0,a.Z)(u,0),this[7]=(0,a.Z)(p,0),this[8]=(0,a.Z)(i,0),this[9]=(0,a.Z)(s,0),this[10]=(0,a.Z)(h,0),this[11]=(0,a.Z)(m,0),this[12]=(0,a.Z)(n,0),this[13]=(0,a.Z)(l,0),this[14]=(0,a.Z)(d,0),this[15]=(0,a.Z)(_,0)}d.packedLength=16,d.pack=function(e,t,i){return o.Z.typeOf.object("value",e),o.Z.defined("array",t),i=(0,a.Z)(i,0),t[i++]=e[0],t[i++]=e[1],t[i++]=e[2],t[i++]=e[3],t[i++]=e[4],t[i++]=e[5],t[i++]=e[6],t[i++]=e[7],t[i++]=e[8],t[i++]=e[9],t[i++]=e[10],t[i++]=e[11],t[i++]=e[12],t[i++]=e[13],t[i++]=e[14],t[i]=e[15],t},d.unpack=function(e,t,i){return o.Z.defined("array",e),t=(0,a.Z)(t,0),(0,s.Z)(i)||(i=new d),i[0]=e[t++],i[1]=e[t++],i[2]=e[t++],i[3]=e[t++],i[4]=e[t++],i[5]=e[t++],i[6]=e[t++],i[7]=e[t++],i[8]=e[t++],i[9]=e[t++],i[10]=e[t++],i[11]=e[t++],i[12]=e[t++],i[13]=e[t++],i[14]=e[t++],i[15]=e[t],i},d.packArray=function(e,t){o.Z.defined("array",e);let i=e.length,n=16*i;if((0,s.Z)(t)){if(Array.isArray(t)||t.length===n)t.length!==n&&(t.length=n);else throw new l.Z("If result is a typed array, it must have exactly array.length * 16 elements")}else t=Array(n);for(let n=0;n<i;++n)d.pack(e[n],t,16*n);return t},d.unpackArray=function(e,t){if(o.Z.defined("array",e),o.Z.typeOf.number.greaterThanOrEquals("array.length",e.length,16),e.length%16!=0)throw new l.Z("array length must be a multiple of 16.");let i=e.length;(0,s.Z)(t)?t.length=i/16:t=Array(i/16);for(let n=0;n<i;n+=16){let i=n/16;t[i]=d.unpack(e,n,t[i])}return t},d.clone=function(e,t){return(0,s.Z)(e)?(0,s.Z)(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t):new d(e[0],e[4],e[8],e[12],e[1],e[5],e[9],e[13],e[2],e[6],e[10],e[14],e[3],e[7],e[11],e[15]):void 0},d.fromArray=d.unpack,d.fromColumnMajorArray=function(e,t){return o.Z.defined("values",e),d.clone(e,t)},d.fromRowMajorArray=function(e,t){return(o.Z.defined("values",e),(0,s.Z)(t))?(t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15],t):new d(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15])},d.fromRotationTranslation=function(e,t,i){return(o.Z.typeOf.object("rotation",e),t=(0,a.Z)(t,n.Z.ZERO),(0,s.Z)(i))?(i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=0,i[4]=e[3],i[5]=e[4],i[6]=e[5],i[7]=0,i[8]=e[6],i[9]=e[7],i[10]=e[8],i[11]=0,i[12]=t.x,i[13]=t.y,i[14]=t.z,i[15]=1,i):new d(e[0],e[3],e[6],t.x,e[1],e[4],e[7],t.y,e[2],e[5],e[8],t.z,0,0,0,1)},d.fromTranslationQuaternionRotationScale=function(e,t,i,n){o.Z.typeOf.object("translation",e),o.Z.typeOf.object("rotation",t),o.Z.typeOf.object("scale",i),(0,s.Z)(n)||(n=new d);let r=i.x,a=i.y,l=i.z,c=t.x*t.x,u=t.x*t.y,h=t.x*t.z,f=t.x*t.w,p=t.y*t.y,m=t.y*t.z,_=t.y*t.w,g=t.z*t.z,Z=t.z*t.w,y=t.w*t.w;return n[0]=(c-p-g+y)*r,n[1]=2*(u+Z)*r,n[2]=2*(h-_)*r,n[3]=0,n[4]=2*(u-Z)*a,n[5]=(-c+p-g+y)*a,n[6]=2*(m+f)*a,n[7]=0,n[8]=2*(h+_)*l,n[9]=2*(m-f)*l,n[10]=(-c-p+g+y)*l,n[11]=0,n[12]=e.x,n[13]=e.y,n[14]=e.z,n[15]=1,n},d.fromTranslationRotationScale=function(e,t){return o.Z.typeOf.object("translationRotationScale",e),d.fromTranslationQuaternionRotationScale(e.translation,e.rotation,e.scale,t)},d.fromTranslation=function(e,t){return o.Z.typeOf.object("translation",e),d.fromRotationTranslation(u.Z.IDENTITY,e,t)},d.fromScale=function(e,t){return(o.Z.typeOf.object("scale",e),(0,s.Z)(t))?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e.y,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e.z,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t):new d(e.x,0,0,0,0,e.y,0,0,0,0,e.z,0,0,0,0,1)},d.fromUniformScale=function(e,t){return(o.Z.typeOf.number("scale",e),(0,s.Z)(t))?(t[0]=e,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t):new d(e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1)},d.fromRotation=function(e,t){return o.Z.typeOf.object("rotation",e),(0,s.Z)(t)||(t=new d),t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=0,t[4]=e[3],t[5]=e[4],t[6]=e[5],t[7]=0,t[8]=e[6],t[9]=e[7],t[10]=e[8],t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t};let f=new n.Z,p=new n.Z,m=new n.Z;d.fromCamera=function(e,t){o.Z.typeOf.object("camera",e);let i=e.position,r=e.direction,a=e.up;o.Z.typeOf.object("camera.position",i),o.Z.typeOf.object("camera.direction",r),o.Z.typeOf.object("camera.up",a),n.Z.normalize(r,f),n.Z.normalize(n.Z.cross(f,a,p),p),n.Z.normalize(n.Z.cross(p,f,m),m);let l=p.x,c=p.y,u=p.z,h=f.x,_=f.y,g=f.z,Z=m.x,y=m.y,b=m.z,v=i.x,T=i.y,E=i.z,x=-(l*v)+-(c*T)+-(u*E),w=-(Z*v)+-(y*T)+-(b*E),S=h*v+_*T+g*E;return(0,s.Z)(t)?(t[0]=l,t[1]=Z,t[2]=-h,t[3]=0,t[4]=c,t[5]=y,t[6]=-_,t[7]=0,t[8]=u,t[9]=b,t[10]=-g,t[11]=0,t[12]=x,t[13]=w,t[14]=S,t[15]=1,t):new d(l,c,u,x,Z,y,b,w,-h,-_,-g,S,0,0,0,1)},d.computePerspectiveFieldOfView=function(e,t,i,n,r){o.Z.typeOf.number.greaterThan("fovY",e,0),o.Z.typeOf.number.lessThan("fovY",e,Math.PI),o.Z.typeOf.number.greaterThan("near",i,0),o.Z.typeOf.number.greaterThan("far",n,0),o.Z.typeOf.object("result",r);let a=1/Math.tan(.5*e);return r[0]=a/t,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=a,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=(n+i)/(i-n),r[11]=-1,r[12]=0,r[13]=0,r[14]=2*n*i/(i-n),r[15]=0,r},d.computeOrthographicOffCenter=function(e,t,i,n,r,a,s){o.Z.typeOf.number("left",e),o.Z.typeOf.number("right",t),o.Z.typeOf.number("bottom",i),o.Z.typeOf.number("top",n),o.Z.typeOf.number("near",r),o.Z.typeOf.number("far",a),o.Z.typeOf.object("result",s);let l=1/(t-e),c=1/(n-i),u=1/(a-r),h=-(t+e)*l,d=-(n+i)*c,f=-(a+r)*u;return l*=2,c*=2,u*=-2,s[0]=l,s[1]=0,s[2]=0,s[3]=0,s[4]=0,s[5]=c,s[6]=0,s[7]=0,s[8]=0,s[9]=0,s[10]=u,s[11]=0,s[12]=h,s[13]=d,s[14]=f,s[15]=1,s},d.computePerspectiveOffCenter=function(e,t,i,n,r,a,s){return o.Z.typeOf.number("left",e),o.Z.typeOf.number("right",t),o.Z.typeOf.number("bottom",i),o.Z.typeOf.number("top",n),o.Z.typeOf.number("near",r),o.Z.typeOf.number("far",a),o.Z.typeOf.object("result",s),s[0]=2*r/(t-e),s[1]=0,s[2]=0,s[3]=0,s[4]=0,s[5]=2*r/(n-i),s[6]=0,s[7]=0,s[8]=(t+e)/(t-e),s[9]=(n+i)/(n-i),s[10]=-(a+r)/(a-r),s[11]=-1,s[12]=0,s[13]=0,s[14]=-2*a*r/(a-r),s[15]=0,s},d.computeInfinitePerspectiveOffCenter=function(e,t,i,n,r,a){return o.Z.typeOf.number("left",e),o.Z.typeOf.number("right",t),o.Z.typeOf.number("bottom",i),o.Z.typeOf.number("top",n),o.Z.typeOf.number("near",r),o.Z.typeOf.object("result",a),a[0]=2*r/(t-e),a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=2*r/(n-i),a[6]=0,a[7]=0,a[8]=(t+e)/(t-e),a[9]=(n+i)/(n-i),a[10]=-1,a[11]=-1,a[12]=0,a[13]=0,a[14]=-2*r,a[15]=0,a},d.computeViewportTransformation=function(e,t,i,n){(0,s.Z)(n)||(n=new d),e=(0,a.Z)(e,a.Z.EMPTY_OBJECT);let r=(0,a.Z)(e.x,0),o=(0,a.Z)(e.y,0),l=(0,a.Z)(e.width,0),c=(0,a.Z)(e.height,0);t=(0,a.Z)(t,0);let u=.5*l,h=.5*c,f=((i=(0,a.Z)(i,1))-t)*.5,p=r+u,m=o+h,_=t+f;return n[0]=u,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=h,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=f,n[11]=0,n[12]=p,n[13]=m,n[14]=_,n[15]=1,n},d.computeView=function(e,t,i,r,a){return o.Z.typeOf.object("position",e),o.Z.typeOf.object("direction",t),o.Z.typeOf.object("up",i),o.Z.typeOf.object("right",r),o.Z.typeOf.object("result",a),a[0]=r.x,a[1]=i.x,a[2]=-t.x,a[3]=0,a[4]=r.y,a[5]=i.y,a[6]=-t.y,a[7]=0,a[8]=r.z,a[9]=i.z,a[10]=-t.z,a[11]=0,a[12]=-n.Z.dot(r,e),a[13]=-n.Z.dot(i,e),a[14]=n.Z.dot(t,e),a[15]=1,a},d.toArray=function(e,t){return(o.Z.typeOf.object("matrix",e),(0,s.Z)(t))?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t):[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15]]},d.getElementIndex=function(e,t){return o.Z.typeOf.number.greaterThanOrEquals("row",t,0),o.Z.typeOf.number.lessThanOrEquals("row",t,3),o.Z.typeOf.number.greaterThanOrEquals("column",e,0),o.Z.typeOf.number.lessThanOrEquals("column",e,3),4*e+t},d.getColumn=function(e,t,i){o.Z.typeOf.object("matrix",e),o.Z.typeOf.number.greaterThanOrEquals("index",t,0),o.Z.typeOf.number.lessThanOrEquals("index",t,3),o.Z.typeOf.object("result",i);let n=4*t,r=e[n],a=e[n+1],s=e[n+2],l=e[n+3];return i.x=r,i.y=a,i.z=s,i.w=l,i},d.setColumn=function(e,t,i,n){o.Z.typeOf.object("matrix",e),o.Z.typeOf.number.greaterThanOrEquals("index",t,0),o.Z.typeOf.number.lessThanOrEquals("index",t,3),o.Z.typeOf.object("cartesian",i),o.Z.typeOf.object("result",n),n=d.clone(e,n);let r=4*t;return n[r]=i.x,n[r+1]=i.y,n[r+2]=i.z,n[r+3]=i.w,n},d.getRow=function(e,t,i){o.Z.typeOf.object("matrix",e),o.Z.typeOf.number.greaterThanOrEquals("index",t,0),o.Z.typeOf.number.lessThanOrEquals("index",t,3),o.Z.typeOf.object("result",i);let n=e[t],r=e[t+4],a=e[t+8],s=e[t+12];return i.x=n,i.y=r,i.z=a,i.w=s,i},d.setRow=function(e,t,i,n){return o.Z.typeOf.object("matrix",e),o.Z.typeOf.number.greaterThanOrEquals("index",t,0),o.Z.typeOf.number.lessThanOrEquals("index",t,3),o.Z.typeOf.object("cartesian",i),o.Z.typeOf.object("result",n),(n=d.clone(e,n))[t]=i.x,n[t+4]=i.y,n[t+8]=i.z,n[t+12]=i.w,n},d.setTranslation=function(e,t,i){return o.Z.typeOf.object("matrix",e),o.Z.typeOf.object("translation",t),o.Z.typeOf.object("result",i),i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=e[3],i[4]=e[4],i[5]=e[5],i[6]=e[6],i[7]=e[7],i[8]=e[8],i[9]=e[9],i[10]=e[10],i[11]=e[11],i[12]=t.x,i[13]=t.y,i[14]=t.z,i[15]=e[15],i};let _=new n.Z;d.setScale=function(e,t,i){o.Z.typeOf.object("matrix",e),o.Z.typeOf.object("scale",t),o.Z.typeOf.object("result",i);let n=d.getScale(e,_),r=t.x/n.x,a=t.y/n.y,s=t.z/n.z;return i[0]=e[0]*r,i[1]=e[1]*r,i[2]=e[2]*r,i[3]=e[3],i[4]=e[4]*a,i[5]=e[5]*a,i[6]=e[6]*a,i[7]=e[7],i[8]=e[8]*s,i[9]=e[9]*s,i[10]=e[10]*s,i[11]=e[11],i[12]=e[12],i[13]=e[13],i[14]=e[14],i[15]=e[15],i};let g=new n.Z;d.setUniformScale=function(e,t,i){o.Z.typeOf.object("matrix",e),o.Z.typeOf.number("scale",t),o.Z.typeOf.object("result",i);let n=d.getScale(e,g),r=t/n.x,a=t/n.y,s=t/n.z;return i[0]=e[0]*r,i[1]=e[1]*r,i[2]=e[2]*r,i[3]=e[3],i[4]=e[4]*a,i[5]=e[5]*a,i[6]=e[6]*a,i[7]=e[7],i[8]=e[8]*s,i[9]=e[9]*s,i[10]=e[10]*s,i[11]=e[11],i[12]=e[12],i[13]=e[13],i[14]=e[14],i[15]=e[15],i};let Z=new n.Z;d.getScale=function(e,t){return o.Z.typeOf.object("matrix",e),o.Z.typeOf.object("result",t),t.x=n.Z.magnitude(n.Z.fromElements(e[0],e[1],e[2],Z)),t.y=n.Z.magnitude(n.Z.fromElements(e[4],e[5],e[6],Z)),t.z=n.Z.magnitude(n.Z.fromElements(e[8],e[9],e[10],Z)),t};let y=new n.Z;d.getMaximumScale=function(e){return d.getScale(e,y),n.Z.maximumComponent(y)};let b=new n.Z;d.setRotation=function(e,t,i){o.Z.typeOf.object("matrix",e),o.Z.typeOf.object("result",i);let n=d.getScale(e,b);return i[0]=t[0]*n.x,i[1]=t[1]*n.x,i[2]=t[2]*n.x,i[3]=e[3],i[4]=t[3]*n.y,i[5]=t[4]*n.y,i[6]=t[5]*n.y,i[7]=e[7],i[8]=t[6]*n.z,i[9]=t[7]*n.z,i[10]=t[8]*n.z,i[11]=e[11],i[12]=e[12],i[13]=e[13],i[14]=e[14],i[15]=e[15],i};let v=new n.Z;d.getRotation=function(e,t){o.Z.typeOf.object("matrix",e),o.Z.typeOf.object("result",t);let i=d.getScale(e,v);return t[0]=e[0]/i.x,t[1]=e[1]/i.x,t[2]=e[2]/i.x,t[3]=e[4]/i.y,t[4]=e[5]/i.y,t[5]=e[6]/i.y,t[6]=e[8]/i.z,t[7]=e[9]/i.z,t[8]=e[10]/i.z,t},d.multiply=function(e,t,i){o.Z.typeOf.object("left",e),o.Z.typeOf.object("right",t),o.Z.typeOf.object("result",i);let n=e[0],r=e[1],a=e[2],s=e[3],l=e[4],c=e[5],u=e[6],h=e[7],d=e[8],f=e[9],p=e[10],m=e[11],_=e[12],g=e[13],Z=e[14],y=e[15],b=t[0],v=t[1],T=t[2],E=t[3],x=t[4],w=t[5],S=t[6],C=t[7],A=t[8],I=t[9],O=t[10],D=t[11],P=t[12],R=t[13],N=t[14],L=t[15];return i[0]=n*b+l*v+d*T+_*E,i[1]=r*b+c*v+f*T+g*E,i[2]=a*b+u*v+p*T+Z*E,i[3]=s*b+h*v+m*T+y*E,i[4]=n*x+l*w+d*S+_*C,i[5]=r*x+c*w+f*S+g*C,i[6]=a*x+u*w+p*S+Z*C,i[7]=s*x+h*w+m*S+y*C,i[8]=n*A+l*I+d*O+_*D,i[9]=r*A+c*I+f*O+g*D,i[10]=a*A+u*I+p*O+Z*D,i[11]=s*A+h*I+m*O+y*D,i[12]=n*P+l*R+d*N+_*L,i[13]=r*P+c*R+f*N+g*L,i[14]=a*P+u*R+p*N+Z*L,i[15]=s*P+h*R+m*N+y*L,i},d.add=function(e,t,i){return o.Z.typeOf.object("left",e),o.Z.typeOf.object("right",t),o.Z.typeOf.object("result",i),i[0]=e[0]+t[0],i[1]=e[1]+t[1],i[2]=e[2]+t[2],i[3]=e[3]+t[3],i[4]=e[4]+t[4],i[5]=e[5]+t[5],i[6]=e[6]+t[6],i[7]=e[7]+t[7],i[8]=e[8]+t[8],i[9]=e[9]+t[9],i[10]=e[10]+t[10],i[11]=e[11]+t[11],i[12]=e[12]+t[12],i[13]=e[13]+t[13],i[14]=e[14]+t[14],i[15]=e[15]+t[15],i},d.subtract=function(e,t,i){return o.Z.typeOf.object("left",e),o.Z.typeOf.object("right",t),o.Z.typeOf.object("result",i),i[0]=e[0]-t[0],i[1]=e[1]-t[1],i[2]=e[2]-t[2],i[3]=e[3]-t[3],i[4]=e[4]-t[4],i[5]=e[5]-t[5],i[6]=e[6]-t[6],i[7]=e[7]-t[7],i[8]=e[8]-t[8],i[9]=e[9]-t[9],i[10]=e[10]-t[10],i[11]=e[11]-t[11],i[12]=e[12]-t[12],i[13]=e[13]-t[13],i[14]=e[14]-t[14],i[15]=e[15]-t[15],i},d.multiplyTransformation=function(e,t,i){o.Z.typeOf.object("left",e),o.Z.typeOf.object("right",t),o.Z.typeOf.object("result",i);let n=e[0],r=e[1],a=e[2],s=e[4],l=e[5],c=e[6],u=e[8],h=e[9],d=e[10],f=e[12],p=e[13],m=e[14],_=t[0],g=t[1],Z=t[2],y=t[4],b=t[5],v=t[6],T=t[8],E=t[9],x=t[10],w=t[12],S=t[13],C=t[14];return i[0]=n*_+s*g+u*Z,i[1]=r*_+l*g+h*Z,i[2]=a*_+c*g+d*Z,i[3]=0,i[4]=n*y+s*b+u*v,i[5]=r*y+l*b+h*v,i[6]=a*y+c*b+d*v,i[7]=0,i[8]=n*T+s*E+u*x,i[9]=r*T+l*E+h*x,i[10]=a*T+c*E+d*x,i[11]=0,i[12]=n*w+s*S+u*C+f,i[13]=r*w+l*S+h*C+p,i[14]=a*w+c*S+d*C+m,i[15]=1,i},d.multiplyByMatrix3=function(e,t,i){o.Z.typeOf.object("matrix",e),o.Z.typeOf.object("rotation",t),o.Z.typeOf.object("result",i);let n=e[0],r=e[1],a=e[2],s=e[4],l=e[5],c=e[6],u=e[8],h=e[9],d=e[10],f=t[0],p=t[1],m=t[2],_=t[3],g=t[4],Z=t[5],y=t[6],b=t[7],v=t[8];return i[0]=n*f+s*p+u*m,i[1]=r*f+l*p+h*m,i[2]=a*f+c*p+d*m,i[3]=0,i[4]=n*_+s*g+u*Z,i[5]=r*_+l*g+h*Z,i[6]=a*_+c*g+d*Z,i[7]=0,i[8]=n*y+s*b+u*v,i[9]=r*y+l*b+h*v,i[10]=a*y+c*b+d*v,i[11]=0,i[12]=e[12],i[13]=e[13],i[14]=e[14],i[15]=e[15],i},d.multiplyByTranslation=function(e,t,i){o.Z.typeOf.object("matrix",e),o.Z.typeOf.object("translation",t),o.Z.typeOf.object("result",i);let n=t.x,r=t.y,a=t.z,s=n*e[0]+r*e[4]+a*e[8]+e[12],l=n*e[1]+r*e[5]+a*e[9]+e[13],c=n*e[2]+r*e[6]+a*e[10]+e[14];return i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=e[3],i[4]=e[4],i[5]=e[5],i[6]=e[6],i[7]=e[7],i[8]=e[8],i[9]=e[9],i[10]=e[10],i[11]=e[11],i[12]=s,i[13]=l,i[14]=c,i[15]=e[15],i},d.multiplyByScale=function(e,t,i){o.Z.typeOf.object("matrix",e),o.Z.typeOf.object("scale",t),o.Z.typeOf.object("result",i);let n=t.x,r=t.y,a=t.z;return 1===n&&1===r&&1===a?d.clone(e,i):(i[0]=n*e[0],i[1]=n*e[1],i[2]=n*e[2],i[3]=e[3],i[4]=r*e[4],i[5]=r*e[5],i[6]=r*e[6],i[7]=e[7],i[8]=a*e[8],i[9]=a*e[9],i[10]=a*e[10],i[11]=e[11],i[12]=e[12],i[13]=e[13],i[14]=e[14],i[15]=e[15],i)},d.multiplyByUniformScale=function(e,t,i){return o.Z.typeOf.object("matrix",e),o.Z.typeOf.number("scale",t),o.Z.typeOf.object("result",i),i[0]=e[0]*t,i[1]=e[1]*t,i[2]=e[2]*t,i[3]=e[3],i[4]=e[4]*t,i[5]=e[5]*t,i[6]=e[6]*t,i[7]=e[7],i[8]=e[8]*t,i[9]=e[9]*t,i[10]=e[10]*t,i[11]=e[11],i[12]=e[12],i[13]=e[13],i[14]=e[14],i[15]=e[15],i},d.multiplyByVector=function(e,t,i){o.Z.typeOf.object("matrix",e),o.Z.typeOf.object("cartesian",t),o.Z.typeOf.object("result",i);let n=t.x,r=t.y,a=t.z,s=t.w,l=e[0]*n+e[4]*r+e[8]*a+e[12]*s,c=e[1]*n+e[5]*r+e[9]*a+e[13]*s,u=e[2]*n+e[6]*r+e[10]*a+e[14]*s,h=e[3]*n+e[7]*r+e[11]*a+e[15]*s;return i.x=l,i.y=c,i.z=u,i.w=h,i},d.multiplyByPointAsVector=function(e,t,i){o.Z.typeOf.object("matrix",e),o.Z.typeOf.object("cartesian",t),o.Z.typeOf.object("result",i);let n=t.x,r=t.y,a=t.z,s=e[0]*n+e[4]*r+e[8]*a,l=e[1]*n+e[5]*r+e[9]*a,c=e[2]*n+e[6]*r+e[10]*a;return i.x=s,i.y=l,i.z=c,i},d.multiplyByPoint=function(e,t,i){o.Z.typeOf.object("matrix",e),o.Z.typeOf.object("cartesian",t),o.Z.typeOf.object("result",i);let n=t.x,r=t.y,a=t.z,s=e[0]*n+e[4]*r+e[8]*a+e[12],l=e[1]*n+e[5]*r+e[9]*a+e[13],c=e[2]*n+e[6]*r+e[10]*a+e[14];return i.x=s,i.y=l,i.z=c,i},d.multiplyByScalar=function(e,t,i){return o.Z.typeOf.object("matrix",e),o.Z.typeOf.number("scalar",t),o.Z.typeOf.object("result",i),i[0]=e[0]*t,i[1]=e[1]*t,i[2]=e[2]*t,i[3]=e[3]*t,i[4]=e[4]*t,i[5]=e[5]*t,i[6]=e[6]*t,i[7]=e[7]*t,i[8]=e[8]*t,i[9]=e[9]*t,i[10]=e[10]*t,i[11]=e[11]*t,i[12]=e[12]*t,i[13]=e[13]*t,i[14]=e[14]*t,i[15]=e[15]*t,i},d.negate=function(e,t){return o.Z.typeOf.object("matrix",e),o.Z.typeOf.object("result",t),t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t[4]=-e[4],t[5]=-e[5],t[6]=-e[6],t[7]=-e[7],t[8]=-e[8],t[9]=-e[9],t[10]=-e[10],t[11]=-e[11],t[12]=-e[12],t[13]=-e[13],t[14]=-e[14],t[15]=-e[15],t},d.transpose=function(e,t){o.Z.typeOf.object("matrix",e),o.Z.typeOf.object("result",t);let i=e[1],n=e[2],r=e[3],a=e[6],s=e[7],l=e[11];return t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=i,t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=n,t[9]=a,t[10]=e[10],t[11]=e[14],t[12]=r,t[13]=s,t[14]=l,t[15]=e[15],t},d.abs=function(e,t){return o.Z.typeOf.object("matrix",e),o.Z.typeOf.object("result",t),t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t[3]=Math.abs(e[3]),t[4]=Math.abs(e[4]),t[5]=Math.abs(e[5]),t[6]=Math.abs(e[6]),t[7]=Math.abs(e[7]),t[8]=Math.abs(e[8]),t[9]=Math.abs(e[9]),t[10]=Math.abs(e[10]),t[11]=Math.abs(e[11]),t[12]=Math.abs(e[12]),t[13]=Math.abs(e[13]),t[14]=Math.abs(e[14]),t[15]=Math.abs(e[15]),t},d.equals=function(e,t){return e===t||(0,s.Z)(e)&&(0,s.Z)(t)&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[3]===t[3]&&e[7]===t[7]&&e[11]===t[11]&&e[15]===t[15]},d.equalsEpsilon=function(e,t,i){return i=(0,a.Z)(i,0),e===t||(0,s.Z)(e)&&(0,s.Z)(t)&&Math.abs(e[0]-t[0])<=i&&Math.abs(e[1]-t[1])<=i&&Math.abs(e[2]-t[2])<=i&&Math.abs(e[3]-t[3])<=i&&Math.abs(e[4]-t[4])<=i&&Math.abs(e[5]-t[5])<=i&&Math.abs(e[6]-t[6])<=i&&Math.abs(e[7]-t[7])<=i&&Math.abs(e[8]-t[8])<=i&&Math.abs(e[9]-t[9])<=i&&Math.abs(e[10]-t[10])<=i&&Math.abs(e[11]-t[11])<=i&&Math.abs(e[12]-t[12])<=i&&Math.abs(e[13]-t[13])<=i&&Math.abs(e[14]-t[14])<=i&&Math.abs(e[15]-t[15])<=i},d.getTranslation=function(e,t){return o.Z.typeOf.object("matrix",e),o.Z.typeOf.object("result",t),t.x=e[12],t.y=e[13],t.z=e[14],t},d.getMatrix3=function(e,t){return o.Z.typeOf.object("matrix",e),o.Z.typeOf.object("result",t),t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t};let T=new u.Z,E=new u.Z,x=new r.Z,w=new r.Z(0,0,0,1);d.inverse=function(e,t){o.Z.typeOf.object("matrix",e),o.Z.typeOf.object("result",t);let i=e[0],n=e[4],a=e[8],s=e[12],l=e[1],f=e[5],p=e[9],m=e[13],_=e[2],g=e[6],Z=e[10],y=e[14],b=e[3],v=e[7],S=e[11],C=e[15],A=Z*C,I=y*S,O=g*C,D=y*v,P=g*S,R=Z*v,N=_*C,L=y*b,M=_*S,F=Z*b,z=_*v,B=g*b,U=A*f+D*p+P*m-(I*f+O*p+R*m),k=I*l+N*p+F*m-(A*l+L*p+M*m),V=O*l+L*f+z*m-(D*l+N*f+B*m),H=R*l+M*f+B*p-(P*l+F*f+z*p),G=I*n+O*a+R*s-(A*n+D*a+P*s),j=A*i+L*a+M*s-(I*i+N*a+F*s),W=D*i+N*n+B*s-(O*i+L*n+z*s),q=P*i+F*n+z*a-(R*i+M*n+B*a);A=a*m,I=s*p,O=n*m,D=s*f,P=n*p,R=a*f,N=i*m,L=s*l,M=i*p;let Y=A*v+D*S+P*C-(I*v+O*S+R*C),X=I*b+N*S+(F=a*l)*C-(A*b+L*S+M*C),$=O*b+L*v+(z=i*f)*C-(D*b+N*v+(B=n*l)*C),K=R*b+M*v+B*S-(P*b+F*v+z*S),Q=O*Z+R*y+I*g-(P*y+A*g+D*Z),J=M*y+A*_+L*Z-(N*Z+F*y+I*_),ee=N*g+B*y+D*_-(z*y+O*_+L*g),et=z*Z+P*_+F*g-(M*g+B*Z+R*_),ei=i*U+n*k+a*V+s*H;if(Math.abs(ei)<c.Z.EPSILON21){if(u.Z.equalsEpsilon(d.getMatrix3(e,T),E,c.Z.EPSILON7)&&r.Z.equals(d.getRow(e,3,x),w))return t[0]=0,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=0,t[11]=0,t[12]=-e[12],t[13]=-e[13],t[14]=-e[14],t[15]=1,t;throw new h.Z("matrix is not invertible because its determinate is zero.")}return ei=1/ei,t[0]=U*ei,t[1]=k*ei,t[2]=V*ei,t[3]=H*ei,t[4]=G*ei,t[5]=j*ei,t[6]=W*ei,t[7]=q*ei,t[8]=Y*ei,t[9]=X*ei,t[10]=$*ei,t[11]=K*ei,t[12]=Q*ei,t[13]=J*ei,t[14]=ee*ei,t[15]=et*ei,t},d.inverseTransformation=function(e,t){o.Z.typeOf.object("matrix",e),o.Z.typeOf.object("result",t);let i=e[0],n=e[1],r=e[2],a=e[4],s=e[5],l=e[6],c=e[8],u=e[9],h=e[10],d=e[12],f=e[13],p=e[14],m=-i*d-n*f-r*p,_=-a*d-s*f-l*p,g=-c*d-u*f-h*p;return t[0]=i,t[1]=a,t[2]=c,t[3]=0,t[4]=n,t[5]=s,t[6]=u,t[7]=0,t[8]=r,t[9]=l,t[10]=h,t[11]=0,t[12]=m,t[13]=_,t[14]=g,t[15]=1,t};let S=new d;d.inverseTranspose=function(e,t){return o.Z.typeOf.object("matrix",e),o.Z.typeOf.object("result",t),d.inverse(d.transpose(e,S),t)},d.IDENTITY=Object.freeze(new d(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),d.ZERO=Object.freeze(new d(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)),d.COLUMN0ROW0=0,d.COLUMN0ROW1=1,d.COLUMN0ROW2=2,d.COLUMN0ROW3=3,d.COLUMN1ROW0=4,d.COLUMN1ROW1=5,d.COLUMN1ROW2=6,d.COLUMN1ROW3=7,d.COLUMN2ROW0=8,d.COLUMN2ROW1=9,d.COLUMN2ROW2=10,d.COLUMN2ROW3=11,d.COLUMN3ROW0=12,d.COLUMN3ROW1=13,d.COLUMN3ROW2=14,d.COLUMN3ROW3=15,Object.defineProperties(d.prototype,{length:{get:function(){return d.packedLength}}}),d.prototype.clone=function(e){return d.clone(this,e)},d.prototype.equals=function(e){return d.equals(this,e)},d.equalsArray=function(e,t,i){return e[0]===t[i]&&e[1]===t[i+1]&&e[2]===t[i+2]&&e[3]===t[i+3]&&e[4]===t[i+4]&&e[5]===t[i+5]&&e[6]===t[i+6]&&e[7]===t[i+7]&&e[8]===t[i+8]&&e[9]===t[i+9]&&e[10]===t[i+10]&&e[11]===t[i+11]&&e[12]===t[i+12]&&e[13]===t[i+13]&&e[14]===t[i+14]&&e[15]===t[i+15]},d.prototype.equalsEpsilon=function(e,t){return d.equalsEpsilon(this,e,t)},d.prototype.toString=function(){return`(${this[0]}, ${this[4]}, ${this[8]}, ${this[12]}) (${this[1]}, ${this[5]}, ${this[9]}, ${this[13]}) (${this[2]}, ${this[6]}, ${this[10]}, ${this[14]}) (${this[3]}, ${this[7]}, ${this[11]}, ${this[15]})`},t.Z=d},3336:function(e,t,i){"use strict";var n=i(4572),r=i(9410),o=i(9824);function a(e,t,i,r){this.near=(0,n.Z)(e,0),this.nearValue=(0,n.Z)(t,0),this.far=(0,n.Z)(i,1),this.farValue=(0,n.Z)(r,0)}a.clone=function(e,t){return(0,r.Z)(e)?(0,r.Z)(t)?(t.near=e.near,t.nearValue=e.nearValue,t.far=e.far,t.farValue=e.farValue,t):new a(e.near,e.nearValue,e.far,e.farValue):void 0},a.packedLength=4,a.pack=function(e,t,i){if(!(0,r.Z)(e))throw new o.Z("value is required");if(!(0,r.Z)(t))throw new o.Z("array is required");return i=(0,n.Z)(i,0),t[i++]=e.near,t[i++]=e.nearValue,t[i++]=e.far,t[i]=e.farValue,t},a.unpack=function(e,t,i){if(!(0,r.Z)(e))throw new o.Z("array is required");return t=(0,n.Z)(t,0),(0,r.Z)(i)||(i=new a),i.near=e[t++],i.nearValue=e[t++],i.far=e[t++],i.farValue=e[t],i},a.equals=function(e,t){return e===t||(0,r.Z)(e)&&(0,r.Z)(t)&&e.near===t.near&&e.nearValue===t.nearValue&&e.far===t.far&&e.farValue===t.farValue},a.prototype.clone=function(e){return a.clone(this,e)},a.prototype.equals=function(e){return a.equals(this,e)},t.Z=a},2660:function(e,t,i){"use strict";var n=i(698),r=i(7559),o=i(4572),a=i(9410);function s(e,t,i){e=(0,o.Z)(e,0),t=(0,o.Z)(t,0),i=(0,o.Z)(i,0),this.value=new Float32Array([e,t,i])}Object.defineProperties(s.prototype,{componentDatatype:{get:function(){return r.Z.FLOAT}},componentsPerAttribute:{get:function(){return 3}},normalize:{get:function(){return!1}}}),s.fromCartesian3=function(e){return n.Z.defined("offset",e),new s(e.x,e.y,e.z)},s.toValue=function(e,t){return n.Z.defined("offset",e),(0,a.Z)(t)||(t=new Float32Array([e.x,e.y,e.z])),t[0]=e.x,t[1]=e.y,t[2]=e.z,t},t.Z=s},7066:function(e,t,i){"use strict";var n=i(7643),r=i(570),o=i(1486),a=i(2820),s=i(698),l=i(4572),c=i(9410),u=i(9824),h=i(1039),d=i(7809),f=i(487),p=i(2944),m=i(2150),_=i(3186),g=i(4749),Z=i(6222),y=i(8054);function b(e,t){this.center=o.Z.clone((0,l.Z)(e,o.Z.ZERO)),this.halfAxes=_.Z.clone((0,l.Z)(t,_.Z.ZERO))}b.packedLength=o.Z.packedLength+_.Z.packedLength,b.pack=function(e,t,i){return s.Z.typeOf.object("value",e),s.Z.defined("array",t),i=(0,l.Z)(i,0),o.Z.pack(e.center,t,i),_.Z.pack(e.halfAxes,t,i+o.Z.packedLength),t},b.unpack=function(e,t,i){return s.Z.defined("array",e),t=(0,l.Z)(t,0),(0,c.Z)(i)||(i=new b),o.Z.unpack(e,t,i.center),_.Z.unpack(e,t+o.Z.packedLength,i.halfAxes),i};let v=new o.Z,T=new o.Z,E=new o.Z,x=new o.Z,w=new o.Z,S=new o.Z,C=new _.Z,A={unitary:new _.Z,diagonal:new _.Z};b.fromPoints=function(e,t){let i,n;if((0,c.Z)(t)||(t=new b),!(0,c.Z)(e)||0===e.length)return t.halfAxes=_.Z.ZERO,t.center=o.Z.ZERO,t;let r=e.length,a=o.Z.clone(e[0],v);for(i=1;i<r;i++)o.Z.add(a,e[i],a);let s=1/r;o.Z.multiplyByScalar(a,s,a);let l=0,u=0,h=0,d=0,f=0,p=0;for(i=0;i<r;i++)l+=(n=o.Z.subtract(e[i],a,T)).x*n.x,u+=n.x*n.y,h+=n.x*n.z,d+=n.y*n.y,f+=n.y*n.z,p+=n.z*n.z;l*=s,u*=s,h*=s,d*=s,f*=s,p*=s,C[0]=l,C[1]=u,C[2]=h,C[3]=u,C[4]=d,C[5]=f,C[6]=h,C[7]=f,C[8]=p;let m=_.Z.computeEigenDecomposition(C,A),g=_.Z.clone(m.unitary,t.halfAxes),Z=_.Z.getColumn(g,0,x),y=_.Z.getColumn(g,1,w),I=_.Z.getColumn(g,2,S),O=-Number.MAX_VALUE,D=-Number.MAX_VALUE,P=-Number.MAX_VALUE,R=Number.MAX_VALUE,N=Number.MAX_VALUE,L=Number.MAX_VALUE;for(i=0;i<r;i++)n=e[i],O=Math.max(o.Z.dot(Z,n),O),D=Math.max(o.Z.dot(y,n),D),P=Math.max(o.Z.dot(I,n),P),R=Math.min(o.Z.dot(Z,n),R),N=Math.min(o.Z.dot(y,n),N),L=Math.min(o.Z.dot(I,n),L);Z=o.Z.multiplyByScalar(Z,.5*(R+O),Z),y=o.Z.multiplyByScalar(y,.5*(N+D),y),I=o.Z.multiplyByScalar(I,.5*(L+P),I);let M=o.Z.add(Z,y,t.center);return o.Z.add(M,I,M),E.x=O-R,E.y=D-N,E.z=P-L,o.Z.multiplyByScalar(E,.5,E),_.Z.multiplyByScale(t.halfAxes,E,t.halfAxes),t};let I=new o.Z,O=new o.Z;function D(e,t,i,n,r,a,s,l,h,d,f){if(!(0,c.Z)(r)||!(0,c.Z)(a)||!(0,c.Z)(s)||!(0,c.Z)(l)||!(0,c.Z)(h)||!(0,c.Z)(d))throw new u.Z("all extents (minimum/maximum X/Y/Z) are required.");(0,c.Z)(f)||(f=new b);let p=f.halfAxes;_.Z.setColumn(p,0,t,p),_.Z.setColumn(p,1,i,p),_.Z.setColumn(p,2,n,p);let m=I;m.x=(r+a)/2,m.y=(s+l)/2,m.z=(h+d)/2,O.x=(a-r)/2,O.y=(l-s)/2,O.z=(d-h)/2;let g=f.center;return m=_.Z.multiplyByVector(p,m,m),o.Z.add(e,m,g),_.Z.multiplyByScale(p,O,p),f}let P=new a.Z,R=new o.Z,N=new a.Z,L=new a.Z,M=new a.Z,F=new a.Z,z=new a.Z,B=new o.Z,U=new o.Z,k=new o.Z,V=new o.Z,H=new o.Z,G=new r.Z,j=new r.Z,W=new r.Z,q=new r.Z,Y=new r.Z,X=new o.Z,$=new o.Z,K=new o.Z,Q=new o.Z,J=new r.Z,ee=new o.Z,et=new o.Z,ei=new o.Z,en=new Z.Z(o.Z.UNIT_X,0);b.fromRectangle=function(e,t,i,n,r){let s,f,p,_,g,b,v;if(!(0,c.Z)(e))throw new u.Z("rectangle is required");if(e.width<0||e.width>m.Z.TWO_PI)throw new u.Z("Rectangle width must be between 0 and 2 * pi");if(e.height<0||e.height>m.Z.PI)throw new u.Z("Rectangle height must be between 0 and pi");if((0,c.Z)(n)&&!m.Z.equalsEpsilon(n.radii.x,n.radii.y,m.Z.EPSILON15))throw new u.Z("Ellipsoid must be an ellipsoid of revolution (radii.x == radii.y)");if(t=(0,l.Z)(t,0),i=(0,l.Z)(i,0),n=(0,l.Z)(n,h.Z.WGS84),e.width<=m.Z.PI){let o=y.Z.center(e,P),l=n.cartographicToCartesian(o,R),c=new d.Z(l,n);v=c.plane;let u=o.longitude,h=e.south<0&&e.north>0?0:o.latitude,m=a.Z.fromRadians(u,e.north,i,N),T=a.Z.fromRadians(e.west,e.north,i,L),E=a.Z.fromRadians(e.west,h,i,M),x=a.Z.fromRadians(e.west,e.south,i,F),w=a.Z.fromRadians(u,e.south,i,z),S=n.cartographicToCartesian(m,B),C=n.cartographicToCartesian(T,U),A=n.cartographicToCartesian(E,k),I=n.cartographicToCartesian(x,V),O=n.cartographicToCartesian(w,H),X=c.projectPointToNearestOnPlane(S,G),$=c.projectPointToNearestOnPlane(C,j),K=c.projectPointToNearestOnPlane(A,W),Q=c.projectPointToNearestOnPlane(I,q),J=c.projectPointToNearestOnPlane(O,Y);return f=-(s=Math.min($.x,K.x,Q.x)),_=Math.max($.y,X.y),p=Math.min(Q.y,J.y),T.height=x.height=t,C=n.cartographicToCartesian(T,U),I=n.cartographicToCartesian(x,V),g=Math.min(Z.Z.getPointDistance(v,C),Z.Z.getPointDistance(v,I)),b=i,D(c.origin,c.xAxis,c.yAxis,c.zAxis,s,f,p,_,g,b,r)}let T=e.south>0,E=e.north<0,x=T?e.south:E?e.north:0,w=y.Z.center(e,P).longitude,S=o.Z.fromRadians(w,x,i,n,X);S.z=0;let C=Math.abs(S.x)<m.Z.EPSILON10&&Math.abs(S.y)<m.Z.EPSILON10?o.Z.UNIT_X:o.Z.normalize(S,$),A=o.Z.UNIT_Z,I=o.Z.cross(C,A,K);v=Z.Z.fromPointNormal(S,C,en);let O=o.Z.fromRadians(w+m.Z.PI_OVER_TWO,x,i,n,Q);s=-(f=o.Z.dot(Z.Z.projectPointOntoPlane(v,O,J),I)),_=o.Z.fromRadians(0,e.north,E?t:i,n,ee).z,p=o.Z.fromRadians(0,e.south,T?t:i,n,et).z;let er=o.Z.fromRadians(e.east,x,i,n,ei);return D(S,I,A,C,s,f,p,_,g=Z.Z.getPointDistance(v,er),b=0,r)},b.fromTransformation=function(e,t){return s.Z.typeOf.object("transformation",e),(0,c.Z)(t)||(t=new b),t.center=g.Z.getTranslation(e,t.center),t.halfAxes=g.Z.getMatrix3(e,t.halfAxes),t.halfAxes=_.Z.multiplyByScalar(t.halfAxes,.5,t.halfAxes),t},b.clone=function(e,t){return(0,c.Z)(e)?(0,c.Z)(t)?(o.Z.clone(e.center,t.center),_.Z.clone(e.halfAxes,t.halfAxes),t):new b(e.center,e.halfAxes):void 0},b.intersectPlane=function(e,t){if(!(0,c.Z)(e))throw new u.Z("box is required.");if(!(0,c.Z)(t))throw new u.Z("plane is required.");let i=e.center,n=t.normal,r=e.halfAxes,a=n.x,s=n.y,l=n.z,h=Math.abs(a*r[_.Z.COLUMN0ROW0]+s*r[_.Z.COLUMN0ROW1]+l*r[_.Z.COLUMN0ROW2])+Math.abs(a*r[_.Z.COLUMN1ROW0]+s*r[_.Z.COLUMN1ROW1]+l*r[_.Z.COLUMN1ROW2])+Math.abs(a*r[_.Z.COLUMN2ROW0]+s*r[_.Z.COLUMN2ROW1]+l*r[_.Z.COLUMN2ROW2]),d=o.Z.dot(n,i)+t.distance;return d<=-h?f.Z.OUTSIDE:d>=h?f.Z.INSIDE:f.Z.INTERSECTING};let er=new o.Z,eo=new o.Z,ea=new o.Z,es=new o.Z,el=new o.Z,ec=new o.Z;b.distanceSquaredTo=function(e,t){let i,n,r,a;if(!(0,c.Z)(e))throw new u.Z("box is required.");if(!(0,c.Z)(t))throw new u.Z("cartesian is required.");let s=o.Z.subtract(t,e.center,I),l=e.halfAxes,h=_.Z.getColumn(l,0,er),d=_.Z.getColumn(l,1,eo),f=_.Z.getColumn(l,2,ea),p=o.Z.magnitude(h),g=o.Z.magnitude(d),Z=o.Z.magnitude(f),y=!0,b=!0,v=!0;p>0?o.Z.divideByScalar(h,p,h):y=!1,g>0?o.Z.divideByScalar(d,g,d):b=!1,Z>0?o.Z.divideByScalar(f,Z,f):v=!1;let T=!y+!b+!v;if(1===T){let e=h;i=d,n=f,b?v||(e=f,n=h):(e=d,i=h),r=o.Z.cross(i,n,el),e===h?h=r:e===d?d=r:e===f&&(f=r)}else if(2===T){i=h,b?i=d:v&&(i=f);let e=o.Z.UNIT_Y;e.equalsEpsilon(i,m.Z.EPSILON3)&&(e=o.Z.UNIT_X),n=o.Z.cross(i,e,es),o.Z.normalize(n,n),r=o.Z.cross(i,n,el),o.Z.normalize(r,r),i===h?(d=n,f=r):i===d?(f=n,h=r):i===f&&(h=n,d=r)}else 3===T&&(h=o.Z.UNIT_X,d=o.Z.UNIT_Y,f=o.Z.UNIT_Z);ec.x=o.Z.dot(s,h),ec.y=o.Z.dot(s,d),ec.z=o.Z.dot(s,f);let E=0;return ec.x<-p?E+=(a=ec.x+p)*a:ec.x>p&&(E+=(a=ec.x-p)*a),ec.y<-g?E+=(a=ec.y+g)*a:ec.y>g&&(E+=(a=ec.y-g)*a),ec.z<-Z?E+=(a=ec.z+Z)*a:ec.z>Z&&(E+=(a=ec.z-Z)*a),E};let eu=new o.Z,eh=new o.Z;b.computePlaneDistances=function(e,t,i,n){if(!(0,c.Z)(e))throw new u.Z("box is required.");if(!(0,c.Z)(t))throw new u.Z("position is required.");if(!(0,c.Z)(i))throw new u.Z("direction is required.");(0,c.Z)(n)||(n=new p.Z);let r=Number.POSITIVE_INFINITY,a=Number.NEGATIVE_INFINITY,s=e.center,l=e.halfAxes,h=_.Z.getColumn(l,0,er),d=_.Z.getColumn(l,1,eo),f=_.Z.getColumn(l,2,ea),m=o.Z.add(h,d,eu);o.Z.add(m,f,m),o.Z.add(m,s,m);let g=o.Z.subtract(m,t,eh),Z=o.Z.dot(i,g);return r=Math.min(Z,r),a=Math.max(Z,a),o.Z.add(s,h,m),o.Z.add(m,d,m),o.Z.subtract(m,f,m),o.Z.subtract(m,t,g),r=Math.min(Z=o.Z.dot(i,g),r),a=Math.max(Z,a),o.Z.add(s,h,m),o.Z.subtract(m,d,m),o.Z.add(m,f,m),o.Z.subtract(m,t,g),r=Math.min(Z=o.Z.dot(i,g),r),a=Math.max(Z,a),o.Z.add(s,h,m),o.Z.subtract(m,d,m),o.Z.subtract(m,f,m),o.Z.subtract(m,t,g),r=Math.min(Z=o.Z.dot(i,g),r),a=Math.max(Z,a),o.Z.subtract(s,h,m),o.Z.add(m,d,m),o.Z.add(m,f,m),o.Z.subtract(m,t,g),r=Math.min(Z=o.Z.dot(i,g),r),a=Math.max(Z,a),o.Z.subtract(s,h,m),o.Z.add(m,d,m),o.Z.subtract(m,f,m),o.Z.subtract(m,t,g),r=Math.min(Z=o.Z.dot(i,g),r),a=Math.max(Z,a),o.Z.subtract(s,h,m),o.Z.subtract(m,d,m),o.Z.add(m,f,m),o.Z.subtract(m,t,g),r=Math.min(Z=o.Z.dot(i,g),r),a=Math.max(Z,a),o.Z.subtract(s,h,m),o.Z.subtract(m,d,m),o.Z.subtract(m,f,m),o.Z.subtract(m,t,g),r=Math.min(Z=o.Z.dot(i,g),r),a=Math.max(Z,a),n.start=r,n.stop=a,n};let ed=new o.Z,ef=new o.Z,ep=new o.Z;b.computeCorners=function(e,t){s.Z.typeOf.object("box",e),(0,c.Z)(t)||(t=[new o.Z,new o.Z,new o.Z,new o.Z,new o.Z,new o.Z,new o.Z,new o.Z]);let i=e.center,n=e.halfAxes,r=_.Z.getColumn(n,0,ed),a=_.Z.getColumn(n,1,ef),l=_.Z.getColumn(n,2,ep);return o.Z.clone(i,t[0]),o.Z.subtract(t[0],r,t[0]),o.Z.subtract(t[0],a,t[0]),o.Z.subtract(t[0],l,t[0]),o.Z.clone(i,t[1]),o.Z.subtract(t[1],r,t[1]),o.Z.subtract(t[1],a,t[1]),o.Z.add(t[1],l,t[1]),o.Z.clone(i,t[2]),o.Z.subtract(t[2],r,t[2]),o.Z.add(t[2],a,t[2]),o.Z.subtract(t[2],l,t[2]),o.Z.clone(i,t[3]),o.Z.subtract(t[3],r,t[3]),o.Z.add(t[3],a,t[3]),o.Z.add(t[3],l,t[3]),o.Z.clone(i,t[4]),o.Z.add(t[4],r,t[4]),o.Z.subtract(t[4],a,t[4]),o.Z.subtract(t[4],l,t[4]),o.Z.clone(i,t[5]),o.Z.add(t[5],r,t[5]),o.Z.subtract(t[5],a,t[5]),o.Z.add(t[5],l,t[5]),o.Z.clone(i,t[6]),o.Z.add(t[6],r,t[6]),o.Z.add(t[6],a,t[6]),o.Z.subtract(t[6],l,t[6]),o.Z.clone(i,t[7]),o.Z.add(t[7],r,t[7]),o.Z.add(t[7],a,t[7]),o.Z.add(t[7],l,t[7]),t};let em=new _.Z;b.computeTransformation=function(e,t){s.Z.typeOf.object("box",e),(0,c.Z)(t)||(t=new g.Z);let i=e.center,n=_.Z.multiplyByUniformScale(e.halfAxes,2,em);return g.Z.fromRotationTranslation(n,i,t)};let e_=new n.Z;b.isOccluded=function(e,t){if(!(0,c.Z)(e))throw new u.Z("box is required.");if(!(0,c.Z)(t))throw new u.Z("occluder is required.");let i=n.Z.fromOrientedBoundingBox(e,e_);return!t.isBoundingSphereVisible(i)},b.prototype.intersectPlane=function(e){return b.intersectPlane(this,e)},b.prototype.distanceSquaredTo=function(e){return b.distanceSquaredTo(this,e)},b.prototype.computePlaneDistances=function(e,t,i){return b.computePlaneDistances(this,e,t,i)},b.prototype.computeCorners=function(e){return b.computeCorners(this,e)},b.prototype.computeTransformation=function(e){return b.computeTransformation(this,e)},b.prototype.isOccluded=function(e){return b.isOccluded(this,e)},b.equals=function(e,t){return e===t||(0,c.Z)(e)&&(0,c.Z)(t)&&o.Z.equals(e.center,t.center)&&_.Z.equals(e.halfAxes,t.halfAxes)},b.prototype.clone=function(e){return b.clone(this,e)},b.prototype.equals=function(e){return b.equals(this,e)},t.Z=b},3321:function(e,t,i){"use strict";var n=i(698),r=i(4572),o=i(9410),a=i(9824),s=i(2150),l=i(7604);function c(e){e=(0,r.Z)(e,r.Z.EMPTY_OBJECT),this._offCenterFrustum=new l.Z,this.width=e.width,this._width=void 0,this.aspectRatio=e.aspectRatio,this._aspectRatio=void 0,this.near=(0,r.Z)(e.near,1),this._near=this.near,this.far=(0,r.Z)(e.far,5e8),this._far=this.far}function u(e){if(!(0,o.Z)(e.width)||!(0,o.Z)(e.aspectRatio)||!(0,o.Z)(e.near)||!(0,o.Z)(e.far))throw new a.Z("width, aspectRatio, near, or far parameters are not set.");let t=e._offCenterFrustum;if(e.width!==e._width||e.aspectRatio!==e._aspectRatio||e.near!==e._near||e.far!==e._far){if(e.aspectRatio<0)throw new a.Z("aspectRatio must be positive.");if(e.near<0||e.near>e.far)throw new a.Z("near must be greater than zero and less than far.");e._aspectRatio=e.aspectRatio,e._width=e.width,e._near=e.near,e._far=e.far;let i=1/e.aspectRatio;t.right=.5*e.width,t.left=-t.right,t.top=i*t.right,t.bottom=-t.top,t.near=e.near,t.far=e.far}}c.packedLength=4,c.pack=function(e,t,i){return n.Z.typeOf.object("value",e),n.Z.defined("array",t),i=(0,r.Z)(i,0),t[i++]=e.width,t[i++]=e.aspectRatio,t[i++]=e.near,t[i]=e.far,t},c.unpack=function(e,t,i){return n.Z.defined("array",e),t=(0,r.Z)(t,0),(0,o.Z)(i)||(i=new c),i.width=e[t++],i.aspectRatio=e[t++],i.near=e[t++],i.far=e[t],i},Object.defineProperties(c.prototype,{projectionMatrix:{get:function(){return u(this),this._offCenterFrustum.projectionMatrix}},offCenterFrustum:{get:function(){return u(this),this._offCenterFrustum}}}),c.prototype.computeCullingVolume=function(e,t,i){return u(this),this._offCenterFrustum.computeCullingVolume(e,t,i)},c.prototype.getPixelDimensions=function(e,t,i,n,r){return u(this),this._offCenterFrustum.getPixelDimensions(e,t,i,n,r)},c.prototype.clone=function(e){return(0,o.Z)(e)||(e=new c),e.aspectRatio=this.aspectRatio,e.width=this.width,e.near=this.near,e.far=this.far,e._aspectRatio=void 0,e._width=void 0,e._near=void 0,e._far=void 0,this._offCenterFrustum.clone(e._offCenterFrustum),e},c.prototype.equals=function(e){return!!(0,o.Z)(e)&&e instanceof c&&(u(this),u(e),this.width===e.width&&this.aspectRatio===e.aspectRatio&&this._offCenterFrustum.equals(e._offCenterFrustum))},c.prototype.equalsEpsilon=function(e,t,i){return!!(0,o.Z)(e)&&e instanceof c&&(u(this),u(e),s.Z.equalsEpsilon(this.width,e.width,t,i)&&s.Z.equalsEpsilon(this.aspectRatio,e.aspectRatio,t,i)&&this._offCenterFrustum.equalsEpsilon(e._offCenterFrustum,t,i))},t.Z=c},7604:function(e,t,i){"use strict";var n=i(1486),r=i(3065),o=i(8615),a=i(4572),s=i(9410),l=i(9824),c=i(2150),u=i(4749);function h(e){e=(0,a.Z)(e,a.Z.EMPTY_OBJECT),this.left=e.left,this._left=void 0,this.right=e.right,this._right=void 0,this.top=e.top,this._top=void 0,this.bottom=e.bottom,this._bottom=void 0,this.near=(0,a.Z)(e.near,1),this._near=this.near,this.far=(0,a.Z)(e.far,5e8),this._far=this.far,this._cullingVolume=new o.Z,this._orthographicMatrix=new u.Z}function d(e){if(!(0,s.Z)(e.right)||!(0,s.Z)(e.left)||!(0,s.Z)(e.top)||!(0,s.Z)(e.bottom)||!(0,s.Z)(e.near)||!(0,s.Z)(e.far))throw new l.Z("right, left, top, bottom, near, or far parameters are not set.");if(e.top!==e._top||e.bottom!==e._bottom||e.left!==e._left||e.right!==e._right||e.near!==e._near||e.far!==e._far){if(e.left>e.right)throw new l.Z("right must be greater than left.");if(e.bottom>e.top)throw new l.Z("top must be greater than bottom.");if(e.near<=0||e.near>e.far)throw new l.Z("near must be greater than zero and less than far.");e._left=e.left,e._right=e.right,e._top=e.top,e._bottom=e.bottom,e._near=e.near,e._far=e.far,e._orthographicMatrix=u.Z.computeOrthographicOffCenter(e.left,e.right,e.bottom,e.top,e.near,e.far,e._orthographicMatrix)}}Object.defineProperties(h.prototype,{projectionMatrix:{get:function(){return d(this),this._orthographicMatrix}}});let f=new n.Z,p=new n.Z,m=new n.Z,_=new n.Z;h.prototype.computeCullingVolume=function(e,t,i){if(!(0,s.Z)(e))throw new l.Z("position is required.");if(!(0,s.Z)(t))throw new l.Z("direction is required.");if(!(0,s.Z)(i))throw new l.Z("up is required.");let o=this._cullingVolume.planes,a=this.top,c=this.bottom,u=this.right,h=this.left,d=this.near,g=this.far,Z=n.Z.cross(t,i,f);n.Z.normalize(Z,Z),n.Z.multiplyByScalar(t,d,p),n.Z.add(e,p,p),n.Z.multiplyByScalar(Z,h,m),n.Z.add(p,m,m);let y=o[0];return(0,s.Z)(y)||(y=o[0]=new r.Z),y.x=Z.x,y.y=Z.y,y.z=Z.z,y.w=-n.Z.dot(Z,m),n.Z.multiplyByScalar(Z,u,m),n.Z.add(p,m,m),y=o[1],(0,s.Z)(y)||(y=o[1]=new r.Z),y.x=-Z.x,y.y=-Z.y,y.z=-Z.z,y.w=-n.Z.dot(n.Z.negate(Z,_),m),n.Z.multiplyByScalar(i,c,m),n.Z.add(p,m,m),y=o[2],(0,s.Z)(y)||(y=o[2]=new r.Z),y.x=i.x,y.y=i.y,y.z=i.z,y.w=-n.Z.dot(i,m),n.Z.multiplyByScalar(i,a,m),n.Z.add(p,m,m),y=o[3],(0,s.Z)(y)||(y=o[3]=new r.Z),y.x=-i.x,y.y=-i.y,y.z=-i.z,y.w=-n.Z.dot(n.Z.negate(i,_),m),y=o[4],(0,s.Z)(y)||(y=o[4]=new r.Z),y.x=t.x,y.y=t.y,y.z=t.z,y.w=-n.Z.dot(t,p),n.Z.multiplyByScalar(t,g,m),n.Z.add(e,m,m),y=o[5],(0,s.Z)(y)||(y=o[5]=new r.Z),y.x=-t.x,y.y=-t.y,y.z=-t.z,y.w=-n.Z.dot(n.Z.negate(t,_),m),this._cullingVolume},h.prototype.getPixelDimensions=function(e,t,i,n,r){if(d(this),!(0,s.Z)(e)||!(0,s.Z)(t))throw new l.Z("Both drawingBufferWidth and drawingBufferHeight are required.");if(e<=0)throw new l.Z("drawingBufferWidth must be greater than zero.");if(t<=0)throw new l.Z("drawingBufferHeight must be greater than zero.");if(!(0,s.Z)(i))throw new l.Z("distance is required.");if(!(0,s.Z)(n))throw new l.Z("pixelRatio is required.");if(n<=0)throw new l.Z("pixelRatio must be greater than zero.");if(!(0,s.Z)(r))throw new l.Z("A result object is required.");let o=this.right-this.left,a=n*(this.top-this.bottom)/t;return r.x=n*o/e,r.y=a,r},h.prototype.clone=function(e){return(0,s.Z)(e)||(e=new h),e.left=this.left,e.right=this.right,e.top=this.top,e.bottom=this.bottom,e.near=this.near,e.far=this.far,e._left=void 0,e._right=void 0,e._top=void 0,e._bottom=void 0,e._near=void 0,e._far=void 0,e},h.prototype.equals=function(e){return(0,s.Z)(e)&&e instanceof h&&this.right===e.right&&this.left===e.left&&this.top===e.top&&this.bottom===e.bottom&&this.near===e.near&&this.far===e.far},h.prototype.equalsEpsilon=function(e,t,i){return e===this||(0,s.Z)(e)&&e instanceof h&&c.Z.equalsEpsilon(this.right,e.right,t,i)&&c.Z.equalsEpsilon(this.left,e.left,t,i)&&c.Z.equalsEpsilon(this.top,e.top,t,i)&&c.Z.equalsEpsilon(this.bottom,e.bottom,t,i)&&c.Z.equalsEpsilon(this.near,e.near,t,i)&&c.Z.equalsEpsilon(this.far,e.far,t,i)},t.Z=h},6055:function(e,t,i){"use strict";var n=i(5463),r=i(512);let o={DEPTH_COMPONENT:r.Z.DEPTH_COMPONENT,DEPTH_STENCIL:r.Z.DEPTH_STENCIL,ALPHA:r.Z.ALPHA,RED:r.Z.RED,RG:r.Z.RG,RGB:r.Z.RGB,RGBA:r.Z.RGBA,LUMINANCE:r.Z.LUMINANCE,LUMINANCE_ALPHA:r.Z.LUMINANCE_ALPHA,RGB_DXT1:r.Z.COMPRESSED_RGB_S3TC_DXT1_EXT,RGBA_DXT1:r.Z.COMPRESSED_RGBA_S3TC_DXT1_EXT,RGBA_DXT3:r.Z.COMPRESSED_RGBA_S3TC_DXT3_EXT,RGBA_DXT5:r.Z.COMPRESSED_RGBA_S3TC_DXT5_EXT,RGB_PVRTC_4BPPV1:r.Z.COMPRESSED_RGB_PVRTC_4BPPV1_IMG,RGB_PVRTC_2BPPV1:r.Z.COMPRESSED_RGB_PVRTC_2BPPV1_IMG,RGBA_PVRTC_4BPPV1:r.Z.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG,RGBA_PVRTC_2BPPV1:r.Z.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG,RGBA_ASTC:r.Z.COMPRESSED_RGBA_ASTC_4x4_WEBGL,RGB_ETC1:r.Z.COMPRESSED_RGB_ETC1_WEBGL,RGB8_ETC2:r.Z.COMPRESSED_RGB8_ETC2,RGBA8_ETC2_EAC:r.Z.COMPRESSED_RGBA8_ETC2_EAC,RGBA_BC7:r.Z.COMPRESSED_RGBA_BPTC_UNORM};o.componentsLength=function(e){switch(e){case o.RGB:return 3;case o.RGBA:return 4;case o.LUMINANCE_ALPHA:case o.RG:return 2;case o.ALPHA:case o.RED:case o.LUMINANCE:default:return 1}},o.validate=function(e){return e===o.DEPTH_COMPONENT||e===o.DEPTH_STENCIL||e===o.ALPHA||e===o.RED||e===o.RG||e===o.RGB||e===o.RGBA||e===o.LUMINANCE||e===o.LUMINANCE_ALPHA||e===o.RGB_DXT1||e===o.RGBA_DXT1||e===o.RGBA_DXT3||e===o.RGBA_DXT5||e===o.RGB_PVRTC_4BPPV1||e===o.RGB_PVRTC_2BPPV1||e===o.RGBA_PVRTC_4BPPV1||e===o.RGBA_PVRTC_2BPPV1||e===o.RGBA_ASTC||e===o.RGB_ETC1||e===o.RGB8_ETC2||e===o.RGBA8_ETC2_EAC||e===o.RGBA_BC7},o.isColorFormat=function(e){return e===o.RED||e===o.ALPHA||e===o.RGB||e===o.RGBA||e===o.LUMINANCE||e===o.LUMINANCE_ALPHA},o.isDepthFormat=function(e){return e===o.DEPTH_COMPONENT||e===o.DEPTH_STENCIL},o.isCompressedFormat=function(e){return e===o.RGB_DXT1||e===o.RGBA_DXT1||e===o.RGBA_DXT3||e===o.RGBA_DXT5||e===o.RGB_PVRTC_4BPPV1||e===o.RGB_PVRTC_2BPPV1||e===o.RGBA_PVRTC_4BPPV1||e===o.RGBA_PVRTC_2BPPV1||e===o.RGBA_ASTC||e===o.RGB_ETC1||e===o.RGB8_ETC2||e===o.RGBA8_ETC2_EAC||e===o.RGBA_BC7},o.isDXTFormat=function(e){return e===o.RGB_DXT1||e===o.RGBA_DXT1||e===o.RGBA_DXT3||e===o.RGBA_DXT5},o.isPVRTCFormat=function(e){return e===o.RGB_PVRTC_4BPPV1||e===o.RGB_PVRTC_2BPPV1||e===o.RGBA_PVRTC_4BPPV1||e===o.RGBA_PVRTC_2BPPV1},o.isASTCFormat=function(e){return e===o.RGBA_ASTC},o.isETC1Format=function(e){return e===o.RGB_ETC1},o.isETC2Format=function(e){return e===o.RGB8_ETC2||e===o.RGBA8_ETC2_EAC},o.isBC7Format=function(e){return e===o.RGBA_BC7},o.compressedTextureSizeInBytes=function(e,t,i){switch(e){case o.RGB_DXT1:case o.RGBA_DXT1:case o.RGB_ETC1:case o.RGB8_ETC2:return Math.floor((t+3)/4)*Math.floor((i+3)/4)*8;case o.RGBA_DXT3:case o.RGBA_DXT5:case o.RGBA_ASTC:case o.RGBA8_ETC2_EAC:return Math.floor((t+3)/4)*Math.floor((i+3)/4)*16;case o.RGB_PVRTC_4BPPV1:case o.RGBA_PVRTC_4BPPV1:return Math.floor((Math.max(t,8)*Math.max(i,8)*4+7)/8);case o.RGB_PVRTC_2BPPV1:case o.RGBA_PVRTC_2BPPV1:return Math.floor((Math.max(t,16)*Math.max(i,8)*2+7)/8);case o.RGBA_BC7:return Math.ceil(t/4)*Math.ceil(i/4)*16;default:return 0}},o.textureSizeInBytes=function(e,t,i,r){let a=o.componentsLength(e);return n.Z.isPacked(t)&&(a=1),a*n.Z.sizeInBytes(t)*i*r},o.alignmentInBytes=function(e,t,i){let n=o.textureSizeInBytes(e,t,i,1)%4;return 0===n?4:2===n?2:1},o.createTypedArray=function(e,t,i,r){let a;let s=n.Z.sizeInBytes(t);return s===Uint8Array.BYTES_PER_ELEMENT?a=Uint8Array:s===Uint16Array.BYTES_PER_ELEMENT?a=Uint16Array:s===Float32Array.BYTES_PER_ELEMENT&&t===n.Z.FLOAT?a=Float32Array:a=Uint32Array,new a(o.componentsLength(e)*i*r)},o.flipY=function(e,t,i,n,r){if(1===r)return e;let a=o.createTypedArray(t,i,n,r),s=o.componentsLength(t),l=n*s;for(let t=0;t<r;++t){let i=t*n*s,o=(r-t-1)*n*s;for(let t=0;t<l;++t)a[o+t]=e[i+t]}return a},o.toInternalFormat=function(e,t,i){if(!i.webgl2)return e;if(e===o.DEPTH_STENCIL)return r.Z.DEPTH24_STENCIL8;if(e===o.DEPTH_COMPONENT){if(t===n.Z.UNSIGNED_SHORT)return r.Z.DEPTH_COMPONENT16;if(t===n.Z.UNSIGNED_INT)return r.Z.DEPTH_COMPONENT24}if(t===n.Z.FLOAT)switch(e){case o.RGBA:return r.Z.RGBA32F;case o.RGB:return r.Z.RGB32F;case o.RG:return r.Z.RG32F;case o.RED:return r.Z.R32F}if(t===n.Z.HALF_FLOAT)switch(e){case o.RGBA:return r.Z.RGBA16F;case o.RGB:return r.Z.RGB16F;case o.RG:return r.Z.RG16F;case o.RED:return r.Z.R16F}return e},t.Z=Object.freeze(o)},6222:function(e,t,i){"use strict";var n=i(1486),r=i(3065),o=i(698),a=i(9410),s=i(9824),l=i(2150),c=i(4749);function u(e,t){if(o.Z.typeOf.object("normal",e),!l.Z.equalsEpsilon(n.Z.magnitude(e),1,l.Z.EPSILON6))throw new s.Z("normal must be normalized.");o.Z.typeOf.number("distance",t),this.normal=n.Z.clone(e),this.distance=t}u.fromPointNormal=function(e,t,i){if(o.Z.typeOf.object("point",e),o.Z.typeOf.object("normal",t),!l.Z.equalsEpsilon(n.Z.magnitude(t),1,l.Z.EPSILON6))throw new s.Z("normal must be normalized.");let r=-n.Z.dot(t,e);return(0,a.Z)(i)?(n.Z.clone(t,i.normal),i.distance=r,i):new u(t,r)};let h=new n.Z;u.fromCartesian4=function(e,t){o.Z.typeOf.object("coefficients",e);let i=n.Z.fromCartesian4(e,h),r=e.w;if(!l.Z.equalsEpsilon(n.Z.magnitude(i),1,l.Z.EPSILON6))throw new s.Z("normal must be normalized.");return(0,a.Z)(t)?(n.Z.clone(i,t.normal),t.distance=r,t):new u(i,r)},u.getPointDistance=function(e,t){return o.Z.typeOf.object("plane",e),o.Z.typeOf.object("point",t),n.Z.dot(e.normal,t)+e.distance};let d=new n.Z;u.projectPointOntoPlane=function(e,t,i){o.Z.typeOf.object("plane",e),o.Z.typeOf.object("point",t),(0,a.Z)(i)||(i=new n.Z);let r=u.getPointDistance(e,t),s=n.Z.multiplyByScalar(e.normal,r,d);return n.Z.subtract(t,s,i)};let f=new c.Z,p=new r.Z,m=new n.Z;u.transform=function(e,t,i){o.Z.typeOf.object("plane",e),o.Z.typeOf.object("transform",t);let a=e.normal,s=e.distance,l=c.Z.inverseTranspose(t,f),h=r.Z.fromElements(a.x,a.y,a.z,s,p);h=c.Z.multiplyByVector(l,h,h);let d=n.Z.fromCartesian4(h,m);return h=r.Z.divideByScalar(h,n.Z.magnitude(d),h),u.fromCartesian4(h,i)},u.clone=function(e,t){return(o.Z.typeOf.object("plane",e),(0,a.Z)(t))?(n.Z.clone(e.normal,t.normal),t.distance=e.distance,t):new u(e.normal,e.distance)},u.equals=function(e,t){return o.Z.typeOf.object("left",e),o.Z.typeOf.object("right",t),e.distance===t.distance&&n.Z.equals(e.normal,t.normal)},u.ORIGIN_XY_PLANE=Object.freeze(new u(n.Z.UNIT_Z,0)),u.ORIGIN_YZ_PLANE=Object.freeze(new u(n.Z.UNIT_X,0)),u.ORIGIN_ZX_PLANE=Object.freeze(new u(n.Z.UNIT_Y,0)),t.Z=u},2966:function(e,t,i){"use strict";i.d(t,{Z:function(){return eg}});var n=i(7749),r=i(1373),o=i(7643),a=i(570),s=i(1486),l=i(2820),c=i(698),u=i(7559),h=i(4572),d=i(9410),f=i(9824),p=i(1039),m=i(7809),_=i(3086),g=i(2601),Z=i(7984),y=i(2246),b=i(2926),v=i(5837),T=i(2150),E=i(3186),x=i(4388),w=i(9330),S=i(3578),C=i(8054),A=i(15),I=i(5352);function O(e,t){this.position=e,(0,d.Z)(this.position)||(this.position=new a.Z),this.tangentPlane=t,(0,d.Z)(this.tangentPlane)||(this.tangentPlane=O.NORTH_POLE_TANGENT_PLANE)}Object.defineProperties(O.prototype,{ellipsoid:{get:function(){return this.tangentPlane.ellipsoid}},x:{get:function(){return this.position.x}},y:{get:function(){return this.position.y}},conformalLatitude:{get:function(){let e=a.Z.magnitude(this.position),t=2*this.ellipsoid.maximumRadius;return this.tangentPlane.plane.normal.z*(T.Z.PI_OVER_TWO-2*Math.atan2(e,t))}},longitude:{get:function(){let e=T.Z.PI_OVER_TWO+Math.atan2(this.y,this.x);return e>Math.PI&&(e-=T.Z.TWO_PI),e}}});let D=new l.Z,P=new s.Z;O.prototype.getLatitude=function(e){(0,d.Z)(e)||(e=p.Z.WGS84),D.latitude=this.conformalLatitude,D.longitude=this.longitude,D.height=0;let t=this.ellipsoid.cartographicToCartesian(D,P);return e.cartesianToCartographic(t,D),D.latitude};let R=new I.Z,N=new s.Z,L=new s.Z;O.fromCartesian=function(e,t){c.Z.defined("cartesian",e);let i=T.Z.signNotZero(e.z),n=O.NORTH_POLE_TANGENT_PLANE,r=O.SOUTH_POLE;i<0&&(n=O.SOUTH_POLE_TANGENT_PLANE,r=O.NORTH_POLE),R.origin=n.ellipsoid.scaleToGeocentricSurface(e,R.origin),R.direction=s.Z.subtract(R.origin,r,N),s.Z.normalize(R.direction,R.direction);let o=A.Z.rayPlane(R,n.plane,L),l=s.Z.subtract(o,r,o),u=s.Z.dot(n.xAxis,l),h=i*s.Z.dot(n.yAxis,l);return(0,d.Z)(t)?(t.position=new a.Z(u,h),t.tangentPlane=n,t):new O(new a.Z(u,h),n)},O.fromCartesianArray=function(e,t){c.Z.defined("cartesians",e);let i=e.length;(0,d.Z)(t)?t.length=i:t=Array(i);for(let n=0;n<i;n++)t[n]=O.fromCartesian(e[n],t[n]);return t},O.clone=function(e,t){return(0,d.Z)(e)?(0,d.Z)(t)?(t.position=e.position,t.tangentPlane=e.tangentPlane,t):new O(e.position,e.tangentPlane):void 0},O.HALF_UNIT_SPHERE=Object.freeze(new p.Z(.5,.5,.5)),O.NORTH_POLE=Object.freeze(new s.Z(0,0,.5)),O.SOUTH_POLE=Object.freeze(new s.Z(0,0,-.5)),O.NORTH_POLE_TANGENT_PLANE=Object.freeze(new m.Z(O.NORTH_POLE,O.HALF_UNIT_SPHERE)),O.SOUTH_POLE_TANGENT_PLANE=Object.freeze(new m.Z(O.SOUTH_POLE,O.HALF_UNIT_SPHERE));var M=i(4915),F=i(9661);let z=new l.Z,B=new l.Z,U=new r.Z,k=new s.Z,V=new s.Z,H=new s.Z,G=new s.Z,j=new s.Z,W=new s.Z,q=new s.Z,Y=new s.Z,X=new s.Z,$=new a.Z,K=new a.Z,Q=new s.Z,J=new S.Z,ee=new E.Z,et=new E.Z;function ei(e){let t=e.vertexFormat,i=e.geometry,n=e.shadowVolume,r=i.attributes.position.values,o=(0,d.Z)(i.attributes.st)?i.attributes.st.values:void 0,l=r.length,c=e.wall,h=e.top||c,f=e.bottom||c;if(t.st||t.normal||t.tangent||t.bitangent||n){let p;let m=e.boundingRectangle,_=e.rotationAxis,Z=e.projectTo2d,y=e.ellipsoid,b=e.stRotation,v=e.perPositionHeight;$.x=m.x,$.y=m.y;let x=t.st?new Float32Array(l/3*2):void 0;t.normal&&(p=v&&h&&!c?i.attributes.normal.values:new Float32Array(l));let w=t.tangent?new Float32Array(l):void 0,C=t.bitangent?new Float32Array(l):void 0,A=n?new Float32Array(l):void 0,I=0,O=0,D=V,P=H,R=G,N=!0,L=ee,M=et;if(0!==b){let e=S.Z.fromAxisAngle(_,b,J);L=E.Z.fromQuaternion(e,L),e=S.Z.fromAxisAngle(_,-b,J),M=E.Z.fromQuaternion(e,M)}else L=E.Z.clone(E.Z.IDENTITY,L),M=E.Z.clone(E.Z.IDENTITY,M);let F=0,U=0;h&&f&&(F=l/2,U=l/3,l/=2);for(let i=0;i<l;i+=3){let u=s.Z.fromArray(r,i,Q);if(t.st&&!(0,d.Z)(o)){let e=E.Z.multiplyByVector(L,u,k),t=Z([e=y.scaleToGeodeticSurface(e,e)],K)[0];a.Z.subtract(t,$,t);let i=T.Z.clamp(t.x/m.width,0,1),n=T.Z.clamp(t.y/m.height,0,1);f&&(x[I+U]=i,x[I+1+U]=n),h&&(x[I]=i,x[I+1]=n),I+=2}if(t.normal||t.tangent||t.bitangent||n){let o=O+1,a=O+2;if(c){if(i+3<l){let e=s.Z.fromArray(r,i+3,j);if(N){let t=s.Z.fromArray(r,i+l,W);v&&function(e,t,i,n){let r=n.cartesianToCartographic(e,z).height,o=n.cartesianToCartographic(t,B);o.height=r,n.cartographicToCartesian(o,t);let a=n.cartesianToCartographic(i,B);a.height=r-100,n.cartographicToCartesian(a,i)}(u,e,t,y),s.Z.subtract(e,u,e),s.Z.subtract(t,u,t),D=s.Z.normalize(s.Z.cross(t,e,D),D),N=!1}s.Z.equalsEpsilon(e,u,T.Z.EPSILON10)&&(N=!0)}(t.tangent||t.bitangent)&&(R=y.geodeticSurfaceNormal(u,R),t.tangent&&(P=s.Z.normalize(s.Z.cross(R,D,P),P)))}else D=y.geodeticSurfaceNormal(u,D),(t.tangent||t.bitangent)&&(v&&(q=s.Z.fromArray(p,O,q),Y=s.Z.cross(s.Z.UNIT_Z,q,Y),Y=s.Z.normalize(E.Z.multiplyByVector(M,Y,Y),Y),t.bitangent&&(X=s.Z.normalize(s.Z.cross(q,Y,X),X))),P=s.Z.cross(s.Z.UNIT_Z,D,P),P=s.Z.normalize(E.Z.multiplyByVector(M,P,P),P),t.bitangent&&(R=s.Z.normalize(s.Z.cross(D,P,R),R)));t.normal&&(e.wall?(p[O+F]=D.x,p[o+F]=D.y,p[a+F]=D.z):f&&(p[O+F]=-D.x,p[o+F]=-D.y,p[a+F]=-D.z),(h&&!v||c)&&(p[O]=D.x,p[o]=D.y,p[a]=D.z)),n&&(c&&(D=y.geodeticSurfaceNormal(u,D)),A[O+F]=-D.x,A[o+F]=-D.y,A[a+F]=-D.z),t.tangent&&(e.wall?(w[O+F]=P.x,w[o+F]=P.y,w[a+F]=P.z):f&&(w[O+F]=-P.x,w[o+F]=-P.y,w[a+F]=-P.z),h&&(v?(w[O]=Y.x,w[o]=Y.y,w[a]=Y.z):(w[O]=P.x,w[o]=P.y,w[a]=P.z))),t.bitangent&&(f&&(C[O+F]=R.x,C[o+F]=R.y,C[a+F]=R.z),h&&(v?(C[O]=X.x,C[o]=X.y,C[a]=X.z):(C[O]=R.x,C[o]=R.y,C[a]=R.z))),O+=3}}t.st&&!(0,d.Z)(o)&&(i.attributes.st=new g.Z({componentDatatype:u.Z.FLOAT,componentsPerAttribute:2,values:x})),t.normal&&(i.attributes.normal=new g.Z({componentDatatype:u.Z.FLOAT,componentsPerAttribute:3,values:p})),t.tangent&&(i.attributes.tangent=new g.Z({componentDatatype:u.Z.FLOAT,componentsPerAttribute:3,values:w})),t.bitangent&&(i.attributes.bitangent=new g.Z({componentDatatype:u.Z.FLOAT,componentsPerAttribute:3,values:C})),n&&(i.attributes.extrudeDirection=new g.Z({componentDatatype:u.Z.FLOAT,componentsPerAttribute:3,values:A}))}if(e.extrude&&(0,d.Z)(e.offsetAttribute)){let t=r.length/3,n=new Uint8Array(t);if(e.offsetAttribute===y.Z.TOP)h&&f||c?n=n.fill(1,0,t/2):h&&(n=n.fill(1));else{let t=e.offsetAttribute===y.Z.NONE?0:1;n=n.fill(t)}i.attributes.applyOffset=new g.Z({componentDatatype:u.Z.UNSIGNED_BYTE,componentsPerAttribute:1,values:n})}return i}let en=[];function er(e){if(c.Z.typeOf.object("options",e),c.Z.typeOf.object("options.polygonHierarchy",e.polygonHierarchy),(0,d.Z)(e.perPositionHeight)&&e.perPositionHeight&&(0,d.Z)(e.height))throw new f.Z("Cannot use both options.perPositionHeight and options.height");if((0,d.Z)(e.arcType)&&e.arcType!==n.Z.GEODESIC&&e.arcType!==n.Z.RHUMB)throw new f.Z("Invalid arcType. Valid options are ArcType.GEODESIC and ArcType.RHUMB.");let t=e.polygonHierarchy,i=(0,h.Z)(e.vertexFormat,M.Z.DEFAULT),r=(0,h.Z)(e.ellipsoid,p.Z.WGS84),o=(0,h.Z)(e.granularity,T.Z.RADIANS_PER_DEGREE),l=(0,h.Z)(e.stRotation,0),u=e.textureCoordinates,m=(0,h.Z)(e.perPositionHeight,!1),_=m&&(0,d.Z)(e.extrudedHeight),g=(0,h.Z)(e.height,0),Z=(0,h.Z)(e.extrudedHeight,g);if(!_){let e=Math.max(g,Z);Z=Math.min(g,Z),g=e}this._vertexFormat=M.Z.clone(i),this._ellipsoid=p.Z.clone(r),this._granularity=o,this._stRotation=l,this._height=g,this._extrudedHeight=Z,this._closeTop=(0,h.Z)(e.closeTop,!0),this._closeBottom=(0,h.Z)(e.closeBottom,!0),this._polygonHierarchy=t,this._perPositionHeight=m,this._perPositionHeightExtrude=_,this._shadowVolume=(0,h.Z)(e.shadowVolume,!1),this._workerName="createPolygonGeometry",this._offsetAttribute=e.offsetAttribute,this._arcType=(0,h.Z)(e.arcType,n.Z.GEODESIC),this._rectangle=void 0,this._textureCoordinateRotationPoints=void 0,this._textureCoordinates=u,this.packedLength=x.Z.computeHierarchyPackedLength(t,s.Z)+p.Z.packedLength+M.Z.packedLength+(u?x.Z.computeHierarchyPackedLength(u,a.Z):1)+12}er.fromPositions=function(e){return e=(0,h.Z)(e,h.Z.EMPTY_OBJECT),c.Z.defined("options.positions",e.positions),new er({polygonHierarchy:{positions:e.positions},height:e.height,extrudedHeight:e.extrudedHeight,vertexFormat:e.vertexFormat,stRotation:e.stRotation,ellipsoid:e.ellipsoid,granularity:e.granularity,perPositionHeight:e.perPositionHeight,closeTop:e.closeTop,closeBottom:e.closeBottom,offsetAttribute:e.offsetAttribute,arcType:e.arcType,textureCoordinates:e.textureCoordinates})},er.pack=function(e,t,i){return c.Z.typeOf.object("value",e),c.Z.defined("array",t),i=(0,h.Z)(i,0),i=x.Z.packPolygonHierarchy(e._polygonHierarchy,t,i,s.Z),p.Z.pack(e._ellipsoid,t,i),i+=p.Z.packedLength,M.Z.pack(e._vertexFormat,t,i),i+=M.Z.packedLength,t[i++]=e._height,t[i++]=e._extrudedHeight,t[i++]=e._granularity,t[i++]=e._stRotation,t[i++]=e._perPositionHeightExtrude?1:0,t[i++]=e._perPositionHeight?1:0,t[i++]=e._closeTop?1:0,t[i++]=e._closeBottom?1:0,t[i++]=e._shadowVolume?1:0,t[i++]=(0,h.Z)(e._offsetAttribute,-1),t[i++]=e._arcType,(0,d.Z)(e._textureCoordinates)?i=x.Z.packPolygonHierarchy(e._textureCoordinates,t,i,a.Z):t[i++]=-1,t[i++]=e.packedLength,t};let eo=p.Z.clone(p.Z.UNIT_SPHERE),ea=new M.Z,es={polygonHierarchy:{}};er.unpack=function(e,t,i){c.Z.defined("array",e),t=(0,h.Z)(t,0);let n=x.Z.unpackPolygonHierarchy(e,t,s.Z);t=n.startingIndex,delete n.startingIndex;let r=p.Z.unpack(e,t,eo);t+=p.Z.packedLength;let o=M.Z.unpack(e,t,ea);t+=M.Z.packedLength;let l=e[t++],u=e[t++],f=e[t++],m=e[t++],_=1===e[t++],g=1===e[t++],Z=1===e[t++],y=1===e[t++],b=1===e[t++],v=e[t++],T=e[t++],E=-1===e[t]?void 0:x.Z.unpackPolygonHierarchy(e,t,a.Z);(0,d.Z)(E)?(t=E.startingIndex,delete E.startingIndex):t++;let w=e[t++];return(0,d.Z)(i)||(i=new er(es)),i._polygonHierarchy=n,i._ellipsoid=p.Z.clone(r,i._ellipsoid),i._vertexFormat=M.Z.clone(o,i._vertexFormat),i._height=l,i._extrudedHeight=u,i._granularity=f,i._stRotation=m,i._perPositionHeightExtrude=_,i._perPositionHeight=g,i._closeTop=Z,i._closeBottom=y,i._shadowVolume=b,i._offsetAttribute=-1===v?void 0:v,i._arcType=T,i._textureCoordinates=E,i.packedLength=w,i};let el=new a.Z,ec=new a.Z,eu=new O;function eh(e,t,i,r,o,s){let l=e.longitude,c=l>=0?l:l+T.Z.TWO_PI;o.westOverIdl=Math.min(o.westOverIdl,c),o.eastOverIdl=Math.max(o.eastOverIdl,c),s.west=Math.min(s.west,l),s.east=Math.max(s.east,l);let u=e.getLatitude(i),h=u;if(s.south=Math.min(s.south,u),s.north=Math.max(s.north,u),r!==n.Z.RHUMB){let n=a.Z.subtract(t.position,e.position,el),r=a.Z.dot(t.position,n)/a.Z.dot(n,n);if(r>0&&r<1){let e=a.Z.add(t.position,a.Z.multiplyByScalar(n,-r,n),ec),o=O.clone(t,eu);o.position=e;let l=o.getLatitude(i);s.south=Math.min(s.south,l),s.north=Math.max(s.north,l),Math.abs(u)>Math.abs(l)&&(h=l)}}let d=Math.sign(t.x*e.y-e.x*t.y);0!==d&&(d*=a.Z.angleBetween(t.position,e.position)),h>=0&&(o.northAngle+=d),h<=0&&(o.southAngle+=d)}let ed=new O,ef=new O,ep={northAngle:0,southAngle:0,westOverIdl:0,eastOverIdl:0};er.computeRectangleFromPositions=function(e,t,i,n){if(c.Z.defined("positions",e),(0,d.Z)(n)||(n=new C.Z),e.length<3)return n;n.west=Number.POSITIVE_INFINITY,n.east=Number.NEGATIVE_INFINITY,n.south=Number.POSITIVE_INFINITY,n.north=Number.NEGATIVE_INFINITY,ep.northAngle=0,ep.southAngle=0,ep.westOverIdl=Number.POSITIVE_INFINITY,ep.eastOverIdl=Number.NEGATIVE_INFINITY;let r=e.length,o=O.fromCartesian(e[0],ef);for(let a=1;a<r;a++){let r=O.fromCartesian(e[a],ed);eh(r,o,t,i,ep,n),o=O.clone(r,o)}return eh(O.fromCartesian(e[0],ed),o,t,i,ep,n),n.east-n.west>ep.eastOverIdl-ep.westOverIdl&&(n.west=ep.westOverIdl,n.east=ep.eastOverIdl,n.east>T.Z.PI&&(n.east=n.east-T.Z.TWO_PI),n.west>T.Z.PI&&(n.west=n.west-T.Z.TWO_PI)),T.Z.equalsEpsilon(Math.abs(ep.northAngle),T.Z.TWO_PI,T.Z.EPSILON10)&&(n.north=T.Z.PI_OVER_TWO,n.east=T.Z.PI,n.west=-T.Z.PI),T.Z.equalsEpsilon(Math.abs(ep.southAngle),T.Z.TWO_PI,T.Z.EPSILON10)&&(n.south=-T.Z.PI_OVER_TWO,n.east=T.Z.PI,n.west=-T.Z.PI),n};let em=new O,e_=new l.Z;er.createGeometry=function(e){let t;let i=e._vertexFormat,n=e._ellipsoid,s=e._granularity,l=e._stRotation,c=e._polygonHierarchy,h=e._perPositionHeight,f=e._closeTop,p=e._closeBottom,E=e._arcType,S=e._textureCoordinates,C=(0,d.Z)(S),A=c.positions;if(A.length<3)return;let I=e.rectangle,D=x.Z.polygonsFromHierarchy(c,C,(e,t)=>{if(I.height>=T.Z.PI||I.width>=T.Z.PI){if(I.south<0&&I.north>0){(0,d.Z)(t)||(t=[]);for(let i=0;i<e.length;++i){let r=n.cartesianToCartographic(e[i],e_);t[i]=new a.Z(r.longitude/T.Z.PI,r.latitude/T.Z.PI_OVER_TWO)}return t.length=e.length,t}return O.fromCartesianArray(e,t)}return m.Z.fromPoints(A,n).projectPointsOntoPlane(e,t)},!h,n,(e,t)=>!h&&(I.height>=T.Z.PI_OVER_TWO||I.width>=2*T.Z.PI_OVER_THREE)?x.Z.splitPolygonsOnEquator(e,n,E,t):e),P=D.hierarchy,R=D.polygons,N=C?x.Z.polygonsFromHierarchy(S,!0,function(e){return e},!1,n).polygons:void 0;if(0===P.length)return;let L=P[0].outerRing,M=function(e,t,i,n){if(t.height>=T.Z.PI||t.width>=T.Z.PI)return r.Z.fromRectangle(t,void 0,U);let o=m.Z.fromPoints(e,i);return x.Z.computeBoundingRectangle(o.plane.normal,o.projectPointOntoPlane.bind(o),e,n,U)}(L,I,n,l),z=[],B=e._height,k=e._extrudedHeight,V=e._perPositionHeightExtrude||!T.Z.equalsEpsilon(B,k,0,T.Z.EPSILON2),H={perPositionHeight:h,vertexFormat:i,geometry:void 0,rotationAxis:(I.height>=T.Z.PI||I.width>=T.Z.PI?O.fromCartesian(L[0],em).tangentPlane:m.Z.fromPoints(L,n)).plane.normal,projectTo2d:function(e,t,i){if(e.height>=T.Z.PI||e.width>=T.Z.PI)return(t,n)=>{if(e.south<0&&e.north>0){let e=i.cartesianToCartographic(t,e_);return(0,d.Z)(n)||(n=new a.Z),n.x=e.longitude/T.Z.PI,n.y=e.latitude/T.Z.PI_OVER_TWO,n}return O.fromCartesian(t,n)};let n=m.Z.fromPoints(t,i);return(e,t)=>n.projectPointsOntoPlane(e,t)}(I,L,n),boundingRectangle:M,ellipsoid:n,stRotation:l,textureCoordinates:void 0,bottom:!1,top:!0,wall:!1,extrude:!1,arcType:E};if(V)for(t=0,H.extrude=!0,H.top=f,H.bottom=p,H.shadowVolume=e._shadowVolume,H.offsetAttribute=e._offsetAttribute;t<R.length;t++){let e;let r=function(e,t,i,n,r,o,a,s,l,c){let u;let h={walls:[]};if(a||s){let r,f;let p=x.Z.createGeometryFromPositions(e,t,i,n,o,l,c),m=p.attributes.position.values,_=p.indices;if(a&&s){let e=m.concat(m);r=e.length/3,(f=v.Z.createTypedArray(r,2*_.length)).set(_);let t=_.length,n=r/2;for(u=0;u<t;u+=3){let e=f[u]+n,i=f[u+1]+n,r=f[u+2]+n;f[u+t]=r,f[u+1+t]=i,f[u+2+t]=e}if(p.attributes.position.values=e,o&&l.normal){let t=p.attributes.normal.values;p.attributes.normal.values=new Float32Array(e.length),p.attributes.normal.values.set(t)}if(l.st&&(0,d.Z)(i)){let e=p.attributes.st.values;p.attributes.st.values=new Float32Array(2*r),p.attributes.st.values=e.concat(e)}p.indices=f}else if(s){for(u=0,r=m.length/3,f=v.Z.createTypedArray(r,_.length);u<_.length;u+=3)f[u]=_[u+2],f[u+1]=_[u+1],f[u+2]=_[u];p.indices=f}h.topAndBottom=new Z.Z({geometry:p})}let f=r.outerRing,p=m.Z.fromPoints(f,e),_=p.projectPointsOntoPlane(f,en),g=w.Z.computeWindingOrder2D(_);g===F.Z.CLOCKWISE&&(f=f.slice().reverse());let y=x.Z.computeWallGeometry(f,i,e,n,o,c);h.walls.push(new Z.Z({geometry:y}));let b=r.holes;for(u=0;u<b.length;u++){let t=b[u];_=p.projectPointsOntoPlane(t,en),(g=w.Z.computeWindingOrder2D(_))===F.Z.COUNTER_CLOCKWISE&&(t=t.slice().reverse()),y=x.Z.computeWallGeometry(t,i,e,n,o,c),h.walls.push(new Z.Z({geometry:y}))}return h}(n,R[t],C?N[t]:void 0,s,P[t],h,f,p,i,E);f&&p?(e=r.topAndBottom,H.geometry=x.Z.scaleToGeodeticHeightExtruded(e.geometry,B,k,n,h)):f?((e=r.topAndBottom).geometry.attributes.position.values=w.Z.scaleToGeodeticHeight(e.geometry.attributes.position.values,B,n,!h),H.geometry=e.geometry):p&&((e=r.topAndBottom).geometry.attributes.position.values=w.Z.scaleToGeodeticHeight(e.geometry.attributes.position.values,k,n,!0),H.geometry=e.geometry),(f||p)&&(H.wall=!1,e.geometry=ei(H),z.push(e));let o=r.walls;H.wall=!0;for(let e=0;e<o.length;e++){let t=o[e];H.geometry=x.Z.scaleToGeodeticHeightExtruded(t.geometry,B,k,n,h),t.geometry=ei(H),z.push(t)}}else for(t=0;t<R.length;t++){let r=new Z.Z({geometry:x.Z.createGeometryFromPositions(n,R[t],C?N[t]:void 0,s,h,i,E)});if(r.geometry.attributes.position.values=w.Z.scaleToGeodeticHeight(r.geometry.attributes.position.values,B,n,!h),H.geometry=r.geometry,r.geometry=ei(H),(0,d.Z)(e._offsetAttribute)){let t=r.geometry.attributes.position.values.length,i=e._offsetAttribute===y.Z.NONE?0:1,n=new Uint8Array(t/3).fill(i);r.geometry.attributes.applyOffset=new g.Z({componentDatatype:u.Z.UNSIGNED_BYTE,componentsPerAttribute:1,values:n})}z.push(r)}let G=b.Z.combineInstances(z)[0];G.attributes.position.values=new Float64Array(G.attributes.position.values),G.indices=v.Z.createTypedArray(G.attributes.position.values.length/3,G.indices);let j=G.attributes,W=o.Z.fromVertices(j.position.values);return i.position||delete j.position,new _.Z({attributes:j,indices:G.indices,primitiveType:G.primitiveType,boundingSphere:W,offsetAttribute:e._offsetAttribute})},er.createShadowVolume=function(e,t,i){let n=e._granularity,r=e._ellipsoid,o=t(n,r),a=i(n,r);return new er({polygonHierarchy:e._polygonHierarchy,ellipsoid:r,stRotation:e._stRotation,granularity:n,perPositionHeight:!1,extrudedHeight:o,height:a,vertexFormat:M.Z.POSITION_ONLY,shadowVolume:!0,arcType:e._arcType})},Object.defineProperties(er.prototype,{rectangle:{get:function(){if(!(0,d.Z)(this._rectangle)){let e=this._polygonHierarchy.positions;this._rectangle=er.computeRectangleFromPositions(e,this._ellipsoid,this._arcType)}return this._rectangle}},textureCoordinateRotationPoints:{get:function(){return(0,d.Z)(this._textureCoordinateRotationPoints)||(this._textureCoordinateRotationPoints=function(e){let t=-e._stRotation;if(0===t)return[0,0,0,1,1,0];let i=e._ellipsoid,n=e._polygonHierarchy.positions,r=e.rectangle;return _.Z._textureCoordinateRotationPoints(n,t,i,r)}(this)),this._textureCoordinateRotationPoints}}});var eg=er},4388:function(e,t,i){"use strict";var n=i(7749),r=i(3453),o=i(570),a=i(1486),s=i(2820),l=i(7559),c=i(4572),u=i(9410),h=i(1039),d=i(2077),f=i(3086),p=i(2601),m=i(258),_=i(2926),g=i(5837),Z=i(15),y=i(2150),b=i(3186),v=i(6222),T=i(9898),E=i(9330),x=i(5022),w=i(3578),S=i(2402),C=i(9661);let A={};A.computeHierarchyPackedLength=function(e,t){let i=0,n=[e];for(;n.length>0;){let e=n.pop();if(!(0,u.Z)(e))continue;i+=2;let r=e.positions,o=e.holes;if((0,u.Z)(r)&&r.length>0&&(i+=r.length*t.packedLength),(0,u.Z)(o)){let e=o.length;for(let t=0;t<e;++t)n.push(o[t])}}return i},A.packPolygonHierarchy=function(e,t,i,n){let r=[e];for(;r.length>0;){let e=r.pop();if(!(0,u.Z)(e))continue;let o=e.positions,a=e.holes;if(t[i++]=(0,u.Z)(o)?o.length:0,t[i++]=(0,u.Z)(a)?a.length:0,(0,u.Z)(o)){let e=o.length;for(let r=0;r<e;++r,i+=n.packedLength)n.pack(o[r],t,i)}if((0,u.Z)(a)){let e=a.length;for(let t=0;t<e;++t)r.push(a[t])}}return i},A.unpackPolygonHierarchy=function(e,t,i){let n=e[t++],r=e[t++],o=Array(n),a=r>0?Array(r):void 0;for(let r=0;r<n;++r,t+=i.packedLength)o[r]=i.unpack(e,t);for(let n=0;n<r;++n)a[n]=A.unpackPolygonHierarchy(e,t,i),t=a[n].startingIndex,delete a[n].startingIndex;return{positions:o,holes:a,startingIndex:t}};let I=new o.Z;function O(e,t,i,n){return o.Z.subtract(t,e,I),o.Z.multiplyByScalar(I,i/n,I),o.Z.add(e,I,I),[I.x,I.y]}let D=new a.Z;A.subdivideLineCount=function(e,t,i){let n=a.Z.distance(e,t);return Math.pow(2,Math.max(0,Math.ceil(y.Z.log2(n/i))))};let P=new s.Z,R=new s.Z,N=new s.Z,L=new a.Z,M=new d.Z;A.subdivideRhumbLineCount=function(e,t,i,n){let r=e.cartesianToCartographic(t,P),o=e.cartesianToCartographic(i,R),a=new d.Z(r,o,e).surfaceDistance/n;return Math.pow(2,Math.max(0,Math.ceil(y.Z.log2(a))))},A.subdivideTexcoordLine=function(e,t,i,n,r,a){let s=A.subdivideLineCount(i,n,r),l=o.Z.distance(e,t),c=l/s;a.length=2*s;let u=0;for(let i=0;i<s;i++){let n=O(e,t,i*c,l);a[u++]=n[0],a[u++]=n[1]}return a},A.subdivideLine=function(e,t,i,n){let r=A.subdivideLineCount(e,t,i),o=a.Z.distance(e,t),s=o/r;(0,u.Z)(n)||(n=[]);let l=n;l.length=3*r;let c=0;for(let i=0;i<r;i++){var h;let n=(h=i*s,a.Z.subtract(t,e,D),a.Z.multiplyByScalar(D,h/o,D),a.Z.add(e,D,D),[D.x,D.y,D.z]);l[c++]=n[0],l[c++]=n[1],l[c++]=n[2]}return l},A.subdivideTexcoordRhumbLine=function(e,t,i,n,r,a,s){let l=i.cartesianToCartographic(n,P),c=i.cartesianToCartographic(r,R);M.setEndPoints(l,c);let u=M.surfaceDistance/a,h=Math.pow(2,Math.max(0,Math.ceil(y.Z.log2(u)))),d=o.Z.distance(e,t),f=d/h;s.length=2*h;let p=0;for(let i=0;i<h;i++){let n=O(e,t,i*f,d);s[p++]=n[0],s[p++]=n[1]}return s},A.subdivideRhumbLine=function(e,t,i,n,r){let o=e.cartesianToCartographic(t,P),a=e.cartesianToCartographic(i,R),s=new d.Z(o,a,e),l=s.surfaceDistance/n,c=Math.pow(2,Math.max(0,Math.ceil(y.Z.log2(l)))),h=s.surfaceDistance/c;(0,u.Z)(r)||(r=[]);let f=r;f.length=3*c;let p=0;for(let t=0;t<c;t++){let i=s.interpolateUsingSurfaceDistance(t*h,N),n=e.cartographicToCartesian(i,L);f[p++]=n.x,f[p++]=n.y,f[p++]=n.z}return f};let F=new a.Z,z=new a.Z,B=new a.Z,U=new a.Z;A.scaleToGeodeticHeightExtruded=function(e,t,i,n,r){n=(0,c.Z)(n,h.Z.WGS84);let o=z,s=U;if((0,u.Z)(e)&&(0,u.Z)(e.attributes)&&(0,u.Z)(e.attributes.position)){let l=e.attributes.position.values,c=l.length/2;for(let e=0;e<c;e+=3)a.Z.fromArray(l,e,B),n.geodeticSurfaceNormal(B,F),s=n.scaleToGeodeticSurface(B,s),o=a.Z.multiplyByScalar(F,i,o),o=a.Z.add(s,o,o),l[e+c]=o.x,l[e+1+c]=o.y,l[e+2+c]=o.z,r&&(s=a.Z.clone(B,s)),o=a.Z.multiplyByScalar(F,t,o),o=a.Z.add(s,o,o),l[e]=o.x,l[e+1]=o.y,l[e+2]=o.z}return e},A.polygonOutlinesFromHierarchy=function(e,t,i){let n,o,s;let l=[],c=new S.Z;for(c.enqueue(e);0!==c.length;){let e=c.dequeue(),h=e.positions;if(t)for(n=0,s=h.length;n<s;n++)i.scaleToGeodeticSurface(h[n],h[n]);if((h=(0,r.Z)(h,a.Z.equalsEpsilon,!0)).length<3)continue;let d=e.holes?e.holes.length:0;for(n=0;n<d;n++){let h=e.holes[n],d=h.positions;if(t)for(o=0,s=d.length;o<s;++o)i.scaleToGeodeticSurface(d[o],d[o]);if((d=(0,r.Z)(d,a.Z.equalsEpsilon,!0)).length<3)continue;l.push(d);let f=0;for((0,u.Z)(h.holes)&&(f=h.holes.length),o=0;o<f;o++)c.enqueue(h.holes[o])}l.push(h)}return l};let k=new s.Z,V=new s.Z;A.splitPolygonsOnEquator=function(e,t,i,r){(0,u.Z)(r)||(r=[]),r.splice(0,0,...e),r.length=e.length;let o=0;for(;o<r.length;){let e=r[o],a=e.slice();if(e.length<3){r[o]=a,++o;continue}let s=function(e,t,i){let r=[],o,a,s,l,c,h=0;for(;h<e.length;){o=e[h],a=e[(h+1)%e.length],s=y.Z.sign(o.z),l=y.Z.sign(a.z);let d=e=>t.cartesianToCartographic(e,V).longitude;if(0===s)r.push({position:h,type:s,visited:!1,next:l,theta:d(o)});else if(0!==l){if(c=function(e,t,i,r){if(r===n.Z.RHUMB)return function(e,t,i){let n=i.cartesianToCartographic(e,P),r=i.cartesianToCartographic(t,R);if(Math.sign(n.latitude)===Math.sign(r.latitude))return;M.setEndPoints(n,r);let o=M.findIntersectionWithLatitude(0,k);if(!(0,u.Z)(o))return;let a=Math.min(n.longitude,r.longitude),s=Math.max(n.longitude,r.longitude);if(Math.abs(s-a)>y.Z.PI){let e=a;a=s,s=e}if(!(o.longitude<a)&&!(o.longitude>s))return i.cartographicToCartesian(o)}(e,t,i);let o=Z.Z.lineSegmentPlane(e,t,v.Z.ORIGIN_XY_PLANE);if((0,u.Z)(o))return i.scaleToGeodeticSurface(o,o)}(o,a,t,i),++h,!(0,u.Z)(c))continue;e.splice(h,0,c),r.push({position:h,type:s,visited:!1,next:l,theta:d(c)})}++h}return r}(a,t,i);if(a.length===e.length||s.length<=1){r[o]=a,++o;continue}s.sort((e,t)=>e.theta-t.theta);let l=a[0].z>=0;o=function e(t,i,n,r,o,a,s){let l=[],c=a,h=e=>t=>t.position===e,d=[];do{let e=n[c];l.push(e);let t=r.findIndex(h(c)),i=r[t];if(!(0,u.Z)(i)){++c;continue}let{visited:o,type:f,next:p}=i;if(i.visited=!0,0===f){if(0===p){let e=r[t-(s?1:-1)];if(e?.position===c+1)e.visited=!0;else{++c;continue}}if(!o&&s&&p>0||a===c&&!s&&p<0){++c;continue}}if(!(s?f>=0:f<=0)){++c;continue}o||d.push(c);let m=r[t+(s?1:-1)];if(!(0,u.Z)(m)){++c;continue}c=m.position}while(c<n.length&&c>=0&&c!==a&&l.length<n.length);for(let a of(t.splice(i,o,l),d))i=e(t,++i,n,r,0,a,!s);return i}(r,o,a,s,1,0,l)}return r},A.polygonsFromHierarchy=function(e,t,i,n,o,s){let l=[],c=[],h=new S.Z;h.enqueue(e);let d=(0,u.Z)(s);for(;0!==h.length;){let e,f,p;let m=h.dequeue(),_=m.positions,g=m.holes;if(n)for(e=0,f=_.length;e<f;e++)o.scaleToGeodeticSurface(_[e],_[e]);if(t||(_=(0,r.Z)(_,a.Z.equalsEpsilon,!0)),_.length<3)continue;let Z=i(_);if(!(0,u.Z)(Z))continue;let y=[],b=E.Z.computeWindingOrder2D(Z);if(b===C.Z.CLOCKWISE&&(Z.reverse(),_=_.slice().reverse()),d){d=!1;let e=[_];if((e=s(e,e)).length>1){for(let t of e)h.enqueue(new T.Z(t,g));continue}}let v=_.slice(),x=(0,u.Z)(g)?g.length:0,w=[];for(e=0;e<x;e++){let s=g[e],l=s.positions;if(n)for(p=0,f=l.length;p<f;++p)o.scaleToGeodeticSurface(l[p],l[p]);if(t||(l=(0,r.Z)(l,a.Z.equalsEpsilon,!0)),l.length<3)continue;let c=i(l);if(!(0,u.Z)(c))continue;(b=E.Z.computeWindingOrder2D(c))===C.Z.CLOCKWISE&&(c.reverse(),l=l.slice().reverse()),w.push(l),y.push(v.length),v=v.concat(l),Z=Z.concat(c);let d=0;for((0,u.Z)(s.holes)&&(d=s.holes.length),p=0;p<d;p++)h.enqueue(s.holes[p])}l.push({outerRing:_,holes:w}),c.push({positions:v,positions2D:Z,holes:y})}return{hierarchy:l,polygons:c}};let H=new o.Z,G=new a.Z,j=new w.Z,W=new b.Z;A.computeBoundingRectangle=function(e,t,i,n,r){let o=w.Z.fromAxisAngle(e,n,j),s=b.Z.fromQuaternion(o,W),l=Number.POSITIVE_INFINITY,c=Number.NEGATIVE_INFINITY,h=Number.POSITIVE_INFINITY,d=Number.NEGATIVE_INFINITY,f=i.length;for(let e=0;e<f;++e){let n=a.Z.clone(i[e],G);b.Z.multiplyByVector(s,n,n);let r=t(n,H);(0,u.Z)(r)&&(l=Math.min(l,r.x),c=Math.max(c,r.x),h=Math.min(h,r.y),d=Math.max(d,r.y))}return r.x=l,r.y=h,r.width=c-l,r.height=d-h,r},A.createGeometryFromPositions=function(e,t,i,r,a,s,c){let h=E.Z.triangulate(t.positions2D,t.holes);h.length<3&&(h=[0,1,2]);let d=t.positions,m=(0,u.Z)(i),g=m?i.positions:void 0;if(a){let e=d.length,t=Array(3*e),i=0;for(let n=0;n<e;n++){let e=d[n];t[i++]=e.x,t[i++]=e.y,t[i++]=e.z}let n={attributes:{position:new p.Z({componentDatatype:l.Z.DOUBLE,componentsPerAttribute:3,values:t})},indices:h,primitiveType:x.Z.TRIANGLES};m&&(n.attributes.st=new p.Z({componentDatatype:l.Z.FLOAT,componentsPerAttribute:2,values:o.Z.packArray(g)}));let r=new f.Z(n);return s.normal?_.Z.computeNormal(r):r}return c===n.Z.GEODESIC?E.Z.computeSubdivision(e,d,h,g,r):c===n.Z.RHUMB?E.Z.computeRhumbLineSubdivision(e,d,h,g,r):void 0};let q=[],Y=[],X=new a.Z,$=new a.Z;A.computeWallGeometry=function(e,t,i,r,o,s){let c,h,d,_,Z,b,v,T,E;let w=e.length,S=0,C=0,I=(0,u.Z)(t),O=I?t.positions:void 0;if(o)for(c=Array(2*(h=6*w)),I&&(T=Array(2*(E=4*w))),d=0;d<w;d++)_=e[d],Z=e[(d+1)%w],c[S]=c[S+h]=_.x,c[++S]=c[S+h]=_.y,c[++S]=c[S+h]=_.z,c[++S]=c[S+h]=Z.x,c[++S]=c[S+h]=Z.y,c[++S]=c[S+h]=Z.z,++S,I&&(b=O[d],v=O[(d+1)%w],T[C]=T[C+E]=b.x,T[++C]=T[C+E]=b.y,T[++C]=T[C+E]=v.x,T[++C]=T[C+E]=v.y,++C);else{let t=y.Z.chordLength(r,i.maximumRadius),o=0;if(s===n.Z.GEODESIC)for(d=0;d<w;d++)o+=A.subdivideLineCount(e[d],e[(d+1)%w],t);else if(s===n.Z.RHUMB)for(d=0;d<w;d++)o+=A.subdivideRhumbLineCount(i,e[d],e[(d+1)%w],t);for(c=Array(2*(h=(o+w)*3)),I&&(T=Array(2*(E=(o+w)*2))),d=0;d<w;d++){let r,o;_=e[d],Z=e[(d+1)%w],I&&(b=O[d],v=O[(d+1)%w]),s===n.Z.GEODESIC?(r=A.subdivideLine(_,Z,t,Y),I&&(o=A.subdivideTexcoordLine(b,v,_,Z,t,q))):s===n.Z.RHUMB&&(r=A.subdivideRhumbLine(i,_,Z,t,Y),I&&(o=A.subdivideTexcoordRhumbLine(b,v,i,_,Z,t,q)));let a=r.length;for(let e=0;e<a;++e,++S)c[S]=r[e],c[S+h]=r[e];if(c[S]=Z.x,c[S+h]=Z.x,c[++S]=Z.y,c[S+h]=Z.y,c[++S]=Z.z,c[S+h]=Z.z,++S,I){let e=o.length;for(let t=0;t<e;++t,++C)T[C]=o[t],T[C+E]=o[t];T[C]=v.x,T[C+E]=v.x,T[++C]=v.y,T[C+E]=v.y,++C}}}w=c.length;let D=g.Z.createTypedArray(w/3,w-6*e.length),P=0;for(w/=6,d=0;d<w;d++){let e=d,t=e+1,i=e+w,n=i+1;_=a.Z.fromArray(c,3*e,X),Z=a.Z.fromArray(c,3*t,$),a.Z.equalsEpsilon(_,Z,y.Z.EPSILON10,y.Z.EPSILON10)||(D[P++]=e,D[P++]=i,D[P++]=t,D[P++]=t,D[P++]=i,D[P++]=n)}let R={attributes:new m.Z({position:new p.Z({componentDatatype:l.Z.DOUBLE,componentsPerAttribute:3,values:c})}),indices:D,primitiveType:x.Z.TRIANGLES};return I&&(R.attributes.st=new p.Z({componentDatatype:l.Z.FLOAT,componentsPerAttribute:2,values:T})),new f.Z(R)},t.Z=A},9898:function(e,t,i){"use strict";var n=i(9410);t.Z=function(e,t){this.positions=(0,n.Z)(e)?e:[],this.holes=(0,n.Z)(t)?t:[]}},9330:function(e,t,i){"use strict";var n=i(5464),r=i(570),o=i(1486),a=i(2820),s=i(698),l=i(7559),c=i(4572),u=i(9410),h=i(1039),d=i(2077),f=i(3086),p=i(2601),m=i(2150),_=i(5022),g=i(9661);let Z=new o.Z,y=new o.Z,b={};b.computeArea2D=function(e){s.Z.defined("positions",e),s.Z.typeOf.number.greaterThanOrEquals("positions.length",e.length,3);let t=e.length,i=0;for(let n=t-1,r=0;r<t;n=r++){let t=e[n],o=e[r];i+=t.x*o.y-o.x*t.y}return .5*i},b.computeWindingOrder2D=function(e){return b.computeArea2D(e)>0?g.Z.COUNTER_CLOCKWISE:g.Z.CLOCKWISE},b.triangulate=function(e,t){return s.Z.defined("positions",e),n(r.Z.packArray(e),t,2)};let v=new o.Z,T=new o.Z,E=new o.Z,x=new o.Z,w=new o.Z,S=new o.Z,C=new o.Z,A=new r.Z,I=new r.Z,O=new r.Z,D=new r.Z;b.computeSubdivision=function(e,t,i,n,a){let h;a=(0,c.Z)(a,m.Z.RADIANS_PER_DEGREE);let d=(0,u.Z)(n);s.Z.typeOf.object("ellipsoid",e),s.Z.defined("positions",t),s.Z.defined("indices",i),s.Z.typeOf.number.greaterThanOrEquals("indices.length",i.length,3),s.Z.typeOf.number.equals("indices.length % 3","0",i.length%3,0),s.Z.typeOf.number.greaterThan("granularity",a,0);let g=i.slice(0),Z=t.length,y=Array(3*Z),b=Array(2*Z),P=0,R=0;for(h=0;h<Z;h++){let e=t[h];if(y[P++]=e.x,y[P++]=e.y,y[P++]=e.z,d){let e=n[h];b[R++]=e.x,b[R++]=e.y}}let N=[],L={},M=e.maximumRadius,F=m.Z.chordLength(a,M),z=F*F;for(;g.length>0;){let e,t,i,n,a,s;let l=g.pop(),c=g.pop(),f=g.pop(),p=o.Z.fromArray(y,3*f,v),m=o.Z.fromArray(y,3*c,T),_=o.Z.fromArray(y,3*l,E);d&&(e=r.Z.fromArray(b,2*f,A),t=r.Z.fromArray(b,2*c,I),i=r.Z.fromArray(b,2*l,O));let Z=o.Z.multiplyByScalar(o.Z.normalize(p,x),M,x),P=o.Z.multiplyByScalar(o.Z.normalize(m,w),M,w),R=o.Z.multiplyByScalar(o.Z.normalize(_,S),M,S),F=o.Z.magnitudeSquared(o.Z.subtract(Z,P,C)),B=o.Z.magnitudeSquared(o.Z.subtract(P,R,C)),U=o.Z.magnitudeSquared(o.Z.subtract(R,Z,C)),k=Math.max(F,B,U);k>z?F===k?(h=L[n=`${Math.min(f,c)} ${Math.max(f,c)}`],!(0,u.Z)(h)&&(a=o.Z.add(p,m,C),o.Z.multiplyByScalar(a,.5,a),y.push(a.x,a.y,a.z),h=y.length/3-1,L[n]=h,d&&(s=r.Z.add(e,t,D),r.Z.multiplyByScalar(s,.5,s),b.push(s.x,s.y))),g.push(f,h,l),g.push(h,c,l)):B===k?(h=L[n=`${Math.min(c,l)} ${Math.max(c,l)}`],!(0,u.Z)(h)&&(a=o.Z.add(m,_,C),o.Z.multiplyByScalar(a,.5,a),y.push(a.x,a.y,a.z),h=y.length/3-1,L[n]=h,d&&(s=r.Z.add(t,i,D),r.Z.multiplyByScalar(s,.5,s),b.push(s.x,s.y))),g.push(c,h,f),g.push(h,l,f)):U===k&&(h=L[n=`${Math.min(l,f)} ${Math.max(l,f)}`],!(0,u.Z)(h)&&(a=o.Z.add(_,p,C),o.Z.multiplyByScalar(a,.5,a),y.push(a.x,a.y,a.z),h=y.length/3-1,L[n]=h,d&&(s=r.Z.add(i,e,D),r.Z.multiplyByScalar(s,.5,s),b.push(s.x,s.y))),g.push(l,h,c),g.push(h,f,c)):(N.push(f),N.push(c),N.push(l))}let B={attributes:{position:new p.Z({componentDatatype:l.Z.DOUBLE,componentsPerAttribute:3,values:y})},indices:N,primitiveType:_.Z.TRIANGLES};return d&&(B.attributes.st=new p.Z({componentDatatype:l.Z.FLOAT,componentsPerAttribute:2,values:b})),new f.Z(B)};let P=new a.Z,R=new a.Z,N=new a.Z,L=new a.Z;b.computeRhumbLineSubdivision=function(e,t,i,n,a){let h;a=(0,c.Z)(a,m.Z.RADIANS_PER_DEGREE);let g=(0,u.Z)(n);s.Z.typeOf.object("ellipsoid",e),s.Z.defined("positions",t),s.Z.defined("indices",i),s.Z.typeOf.number.greaterThanOrEquals("indices.length",i.length,3),s.Z.typeOf.number.equals("indices.length % 3","0",i.length%3,0),s.Z.typeOf.number.greaterThan("granularity",a,0);let Z=i.slice(0),y=t.length,b=Array(3*y),x=Array(2*y),w=0,S=0;for(h=0;h<y;h++){let e=t[h];if(b[w++]=e.x,b[w++]=e.y,b[w++]=e.z,g){let e=n[h];x[S++]=e.x,x[S++]=e.y}}let M=[],F={},z=e.maximumRadius,B=m.Z.chordLength(a,z),U=new d.Z(void 0,void 0,e),k=new d.Z(void 0,void 0,e),V=new d.Z(void 0,void 0,e);for(;Z.length>0;){let t,i,n,a,s,l,c,d;let f=Z.pop(),p=Z.pop(),m=Z.pop(),_=o.Z.fromArray(b,3*m,v),y=o.Z.fromArray(b,3*p,T),w=o.Z.fromArray(b,3*f,E);g&&(t=r.Z.fromArray(x,2*m,A),i=r.Z.fromArray(x,2*p,I),n=r.Z.fromArray(x,2*f,O));let S=e.cartesianToCartographic(_,P),z=e.cartesianToCartographic(y,R),H=e.cartesianToCartographic(w,N);U.setEndPoints(S,z);let G=U.surfaceDistance;k.setEndPoints(z,H);let j=k.surfaceDistance;V.setEndPoints(H,S);let W=V.surfaceDistance,q=Math.max(G,j,W);q>B?G===q?(h=F[a=`${Math.min(m,p)} ${Math.max(m,p)}`],!(0,u.Z)(h)&&(s=U.interpolateUsingFraction(.5,L),l=(S.height+z.height)*.5,c=o.Z.fromRadians(s.longitude,s.latitude,l,e,C),b.push(c.x,c.y,c.z),h=b.length/3-1,F[a]=h,g&&(d=r.Z.add(t,i,D),r.Z.multiplyByScalar(d,.5,d),x.push(d.x,d.y))),Z.push(m,h,f),Z.push(h,p,f)):j===q?(h=F[a=`${Math.min(p,f)} ${Math.max(p,f)}`],!(0,u.Z)(h)&&(s=k.interpolateUsingFraction(.5,L),l=(z.height+H.height)*.5,c=o.Z.fromRadians(s.longitude,s.latitude,l,e,C),b.push(c.x,c.y,c.z),h=b.length/3-1,F[a]=h,g&&(d=r.Z.add(i,n,D),r.Z.multiplyByScalar(d,.5,d),x.push(d.x,d.y))),Z.push(p,h,m),Z.push(h,f,m)):W===q&&(h=F[a=`${Math.min(f,m)} ${Math.max(f,m)}`],!(0,u.Z)(h)&&(s=V.interpolateUsingFraction(.5,L),l=(H.height+S.height)*.5,c=o.Z.fromRadians(s.longitude,s.latitude,l,e,C),b.push(c.x,c.y,c.z),h=b.length/3-1,F[a]=h,g&&(d=r.Z.add(n,t,D),r.Z.multiplyByScalar(d,.5,d),x.push(d.x,d.y))),Z.push(f,h,p),Z.push(h,m,p)):(M.push(m),M.push(p),M.push(f))}let H={attributes:{position:new p.Z({componentDatatype:l.Z.DOUBLE,componentsPerAttribute:3,values:b})},indices:M,primitiveType:_.Z.TRIANGLES};return g&&(H.attributes.st=new p.Z({componentDatatype:l.Z.FLOAT,componentsPerAttribute:2,values:x})),new f.Z(H)},b.scaleToGeodeticHeight=function(e,t,i,n){i=(0,c.Z)(i,h.Z.WGS84);let r=Z,a=y;if(t=(0,c.Z)(t,0),n=(0,c.Z)(n,!0),(0,u.Z)(e)){let s=e.length;for(let l=0;l<s;l+=3)o.Z.fromArray(e,l,a),n&&(a=i.scaleToGeodeticSurface(a,a)),0!==t&&(r=i.geodeticSurfaceNormal(a,r),o.Z.multiplyByScalar(r,t,r),o.Z.add(a,r,a)),e[l]=a.x,e[l+1]=a.y,e[l+2]=a.z}return e},t.Z=b},6896:function(e,t,i){"use strict";var n=i(1486),r=i(2820),o=i(4572),a=i(9410),s=i(9824),l=i(1039),c=i(421),u=i(2077),h=i(15),d=i(2150),f=i(4749),p=i(6222);let m={};m.numberOfPoints=function(e,t,i){return Math.ceil(n.Z.distance(e,t)/i)},m.numberOfPointsRhumbLine=function(e,t,i){return Math.max(1,Math.ceil(Math.sqrt((Math.pow(e.longitude-t.longitude,2)+Math.pow(e.latitude-t.latitude,2))/(i*i))))};let _=new r.Z;m.extractHeights=function(e,t){let i=e.length,n=Array(i);for(let r=0;r<i;r++){let i=e[r];n[r]=t.cartesianToCartographic(i,_).height}return n};let g=new f.Z,Z=new n.Z,y=new n.Z,b=new p.Z(n.Z.UNIT_X,0),v=new n.Z,T=new p.Z(n.Z.UNIT_X,0),E=new n.Z,x=new n.Z,w=[];function S(e,t,i){let n;if(w.length=e,t===i){for(n=0;n<e;n++)w[n]=t;return w}let r=(i-t)/e;for(n=0;n<e;n++){let e=t+n*r;w[n]=e}return w}let C=new r.Z,A=new r.Z,I=new n.Z,O=new n.Z,D=new n.Z,P=new c.Z,R=new u.Z;m.wrapLongitude=function(e,t){let i=[],r=[];if((0,a.Z)(e)&&e.length>0){t=(0,o.Z)(t,f.Z.IDENTITY);let s=f.Z.inverseTransformation(t,g),l=f.Z.multiplyByPoint(s,n.Z.ZERO,Z),c=n.Z.normalize(f.Z.multiplyByPointAsVector(s,n.Z.UNIT_Y,y),y),u=p.Z.fromPointNormal(l,c,b),d=n.Z.normalize(f.Z.multiplyByPointAsVector(s,n.Z.UNIT_X,v),v),m=p.Z.fromPointNormal(l,d,T),_=1;i.push(n.Z.clone(e[0]));let w=i[0],S=e.length;for(let t=1;t<S;++t){let o=e[t];if(0>p.Z.getPointDistance(m,w)||0>p.Z.getPointDistance(m,o)){let e=h.Z.lineSegmentPlane(w,o,u,E);if((0,a.Z)(e)){let t=n.Z.multiplyByScalar(c,5e-9,x);0>p.Z.getPointDistance(u,w)&&n.Z.negate(t,t),i.push(n.Z.add(e,t,new n.Z)),r.push(_+1),n.Z.negate(t,t),i.push(n.Z.add(e,t,new n.Z)),_=1}}i.push(n.Z.clone(e[t])),_++,w=o}r.push(_)}return{positions:i,lengths:r}},m.generateArc=function(e){let t;(0,a.Z)(e)||(e={});let i=e.positions;if(!(0,a.Z)(i))throw new s.Z("options.positions is required.");let r=i.length,c=(0,o.Z)(e.ellipsoid,l.Z.WGS84),u=(0,o.Z)(e.height,0),h=Array.isArray(u);if(r<1)return[];if(1===r){let e=c.scaleToGeodeticSurface(i[0],O);if(0!==(u=h?u[0]:u)){let t=c.geodeticSurfaceNormal(e,I);n.Z.multiplyByScalar(t,u,t),n.Z.add(e,t,e)}return[e.x,e.y,e.z]}let f=e.minDistance;if(!(0,a.Z)(f)){let t=(0,o.Z)(e.granularity,d.Z.RADIANS_PER_DEGREE);f=d.Z.chordLength(t,c.maximumRadius)}let p=0;for(t=0;t<r-1;t++)p+=m.numberOfPoints(i[t],i[t+1],f);let _=(p+1)*3,g=Array(_),Z=0;for(t=0;t<r-1;t++){let e=i[t];Z=function(e,t,i,r,o,a,s,l){let c=r.scaleToGeodeticSurface(e,O),u=r.scaleToGeodeticSurface(t,D),h=m.numberOfPoints(e,t,i),d=r.cartesianToCartographic(c,C),f=r.cartesianToCartographic(u,A),p=S(h,o,a);P.setEndPoints(d,f);let _=P.surfaceDistance/h,g=l;d.height=o;let Z=r.cartographicToCartesian(d,I);n.Z.pack(Z,s,g),g+=3;for(let e=1;e<h;e++){let t=P.interpolateUsingSurfaceDistance(e*_,A);t.height=p[e],Z=r.cartographicToCartesian(t,I),n.Z.pack(Z,s,g),g+=3}return g}(e,i[t+1],f,c,h?u[t]:u,h?u[t+1]:u,g,Z)}w.length=0;let y=i[r-1],b=c.cartesianToCartographic(y,C);b.height=h?u[r-1]:u;let v=c.cartographicToCartesian(b,I);return n.Z.pack(v,g,_-3),g};let N=new r.Z,L=new r.Z;m.generateRhumbArc=function(e){let t,i;(0,a.Z)(e)||(e={});let c=e.positions;if(!(0,a.Z)(c))throw new s.Z("options.positions is required.");let h=c.length,f=(0,o.Z)(e.ellipsoid,l.Z.WGS84),p=(0,o.Z)(e.height,0),_=Array.isArray(p);if(h<1)return[];if(1===h){let e=f.scaleToGeodeticSurface(c[0],O);if(0!==(p=_?p[0]:p)){let t=f.geodeticSurfaceNormal(e,I);n.Z.multiplyByScalar(t,p,t),n.Z.add(e,t,e)}return[e.x,e.y,e.z]}let g=(0,o.Z)(e.granularity,d.Z.RADIANS_PER_DEGREE),Z=0,y=f.cartesianToCartographic(c[0],N);for(t=0;t<h-1;t++)i=f.cartesianToCartographic(c[t+1],L),Z+=m.numberOfPointsRhumbLine(y,i,g),y=r.Z.clone(i,N);let b=(Z+1)*3,v=Array(b),T=0;for(t=0;t<h-1;t++){let e=c[t];T=function(e,t,i,r,o,a,s,l){let c=r.cartesianToCartographic(e,C),h=r.cartesianToCartographic(t,A),d=m.numberOfPointsRhumbLine(c,h,i);c.height=0,h.height=0;let f=S(d,o,a);R.ellipsoid.equals(r)||(R=new u.Z(void 0,void 0,r)),R.setEndPoints(c,h);let p=R.surfaceDistance/d,_=l;c.height=o;let g=r.cartographicToCartesian(c,I);n.Z.pack(g,s,_),_+=3;for(let e=1;e<d;e++){let t=R.interpolateUsingSurfaceDistance(e*p,A);t.height=f[e],g=r.cartographicToCartesian(t,I),n.Z.pack(g,s,_),_+=3}return _}(e,c[t+1],g,f,_?p[t]:p,_?p[t+1]:p,v,T)}w.length=0;let E=c[h-1],x=f.cartesianToCartographic(E,C);x.height=_?p[h-1]:p;let D=f.cartographicToCartesian(x,I);return n.Z.pack(D,v,b-3),v},m.generateCartesianArc=function(e){let t=m.generateArc(e),i=t.length/3,r=Array(i);for(let e=0;e<i;e++)r[e]=n.Z.unpack(t,3*e);return r},m.generateCartesianRhumbArc=function(e){let t=m.generateRhumbArc(e),i=t.length/3,r=Array(i);for(let e=0;e<i;e++)r[e]=n.Z.unpack(t,3*e);return r},t.Z=m},5022:function(e,t,i){"use strict";var n=i(512);let r={POINTS:n.Z.POINTS,LINES:n.Z.LINES,LINE_LOOP:n.Z.LINE_LOOP,LINE_STRIP:n.Z.LINE_STRIP,TRIANGLES:n.Z.TRIANGLES,TRIANGLE_STRIP:n.Z.TRIANGLE_STRIP,TRIANGLE_FAN:n.Z.TRIANGLE_FAN};r.isLines=function(e){return e===r.LINES||e===r.LINE_LOOP||e===r.LINE_STRIP},r.isTriangles=function(e){return e===r.TRIANGLES||e===r.TRIANGLE_STRIP||e===r.TRIANGLE_FAN},r.validate=function(e){return e===r.POINTS||e===r.LINES||e===r.LINE_LOOP||e===r.LINE_STRIP||e===r.TRIANGLES||e===r.TRIANGLE_STRIP||e===r.TRIANGLE_FAN},t.Z=Object.freeze(r)},3578:function(e,t,i){"use strict";var n=i(1486),r=i(698),o=i(4572),a=i(9410),s=i(894),l=i(2150),c=i(3186);function u(e,t,i,n){this.x=(0,o.Z)(e,0),this.y=(0,o.Z)(t,0),this.z=(0,o.Z)(i,0),this.w=(0,o.Z)(n,0)}let h=new n.Z;u.fromAxisAngle=function(e,t,i){r.Z.typeOf.object("axis",e),r.Z.typeOf.number("angle",t);let o=t/2,s=Math.sin(o),l=(h=n.Z.normalize(e,h)).x*s,c=h.y*s,d=h.z*s,f=Math.cos(o);return(0,a.Z)(i)?(i.x=l,i.y=c,i.z=d,i.w=f,i):new u(l,c,d,f)};let d=[1,2,0],f=[,,,];u.fromRotationMatrix=function(e,t){let i,n,o,s,l;r.Z.typeOf.object("matrix",e);let h=e[c.Z.COLUMN0ROW0],p=e[c.Z.COLUMN1ROW1],m=e[c.Z.COLUMN2ROW2],_=h+p+m;if(_>0)l=.5*(i=Math.sqrt(_+1)),i=.5/i,n=(e[c.Z.COLUMN1ROW2]-e[c.Z.COLUMN2ROW1])*i,o=(e[c.Z.COLUMN2ROW0]-e[c.Z.COLUMN0ROW2])*i,s=(e[c.Z.COLUMN0ROW1]-e[c.Z.COLUMN1ROW0])*i;else{let t=0;p>h&&(t=1),m>h&&m>p&&(t=2);let r=d[t],a=d[r];i=Math.sqrt(e[c.Z.getElementIndex(t,t)]-e[c.Z.getElementIndex(r,r)]-e[c.Z.getElementIndex(a,a)]+1),f[t]=.5*i,i=.5/i,l=(e[c.Z.getElementIndex(a,r)]-e[c.Z.getElementIndex(r,a)])*i,f[r]=(e[c.Z.getElementIndex(r,t)]+e[c.Z.getElementIndex(t,r)])*i,f[a]=(e[c.Z.getElementIndex(a,t)]+e[c.Z.getElementIndex(t,a)])*i,n=-f[0],o=-f[1],s=-f[2]}return(0,a.Z)(t)?(t.x=n,t.y=o,t.z=s,t.w=l,t):new u(n,o,s,l)};let p=new u,m=new u,_=new u,g=new u;u.fromHeadingPitchRoll=function(e,t){return r.Z.typeOf.object("headingPitchRoll",e),g=u.fromAxisAngle(n.Z.UNIT_X,e.roll,p),_=u.fromAxisAngle(n.Z.UNIT_Y,-e.pitch,t),t=u.multiply(_,g,_),m=u.fromAxisAngle(n.Z.UNIT_Z,-e.heading,p),u.multiply(m,t,t)};let Z=new n.Z,y=new n.Z,b=new u,v=new u,T=new u;u.packedLength=4,u.pack=function(e,t,i){return r.Z.typeOf.object("value",e),r.Z.defined("array",t),i=(0,o.Z)(i,0),t[i++]=e.x,t[i++]=e.y,t[i++]=e.z,t[i]=e.w,t},u.unpack=function(e,t,i){return r.Z.defined("array",e),t=(0,o.Z)(t,0),(0,a.Z)(i)||(i=new u),i.x=e[t],i.y=e[t+1],i.z=e[t+2],i.w=e[t+3],i},u.packedInterpolationLength=3,u.convertPackedArrayForInterpolation=function(e,t,i,n){u.unpack(e,4*i,T),u.conjugate(T,T);for(let r=0,o=i-t+1;r<o;r++){let i=3*r;u.unpack(e,(t+r)*4,b),u.multiply(b,T,b),b.w<0&&u.negate(b,b),u.computeAxis(b,Z);let o=u.computeAngle(b);(0,a.Z)(n)||(n=[]),n[i]=Z.x*o,n[i+1]=Z.y*o,n[i+2]=Z.z*o}},u.unpackInterpolationResult=function(e,t,i,r,o){(0,a.Z)(o)||(o=new u),n.Z.fromArray(e,0,y);let s=n.Z.magnitude(y);return u.unpack(t,4*r,v),0===s?u.clone(u.IDENTITY,b):u.fromAxisAngle(y,s,b),u.multiply(b,v,o)},u.clone=function(e,t){return(0,a.Z)(e)?(0,a.Z)(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new u(e.x,e.y,e.z,e.w):void 0},u.conjugate=function(e,t){return r.Z.typeOf.object("quaternion",e),r.Z.typeOf.object("result",t),t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=e.w,t},u.magnitudeSquared=function(e){return r.Z.typeOf.object("quaternion",e),e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w},u.magnitude=function(e){return Math.sqrt(u.magnitudeSquared(e))},u.normalize=function(e,t){r.Z.typeOf.object("result",t);let i=1/u.magnitude(e),n=e.x*i,o=e.y*i,a=e.z*i,s=e.w*i;return t.x=n,t.y=o,t.z=a,t.w=s,t},u.inverse=function(e,t){r.Z.typeOf.object("result",t);let i=u.magnitudeSquared(e);return t=u.conjugate(e,t),u.multiplyByScalar(t,1/i,t)},u.add=function(e,t,i){return r.Z.typeOf.object("left",e),r.Z.typeOf.object("right",t),r.Z.typeOf.object("result",i),i.x=e.x+t.x,i.y=e.y+t.y,i.z=e.z+t.z,i.w=e.w+t.w,i},u.subtract=function(e,t,i){return r.Z.typeOf.object("left",e),r.Z.typeOf.object("right",t),r.Z.typeOf.object("result",i),i.x=e.x-t.x,i.y=e.y-t.y,i.z=e.z-t.z,i.w=e.w-t.w,i},u.negate=function(e,t){return r.Z.typeOf.object("quaternion",e),r.Z.typeOf.object("result",t),t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t},u.dot=function(e,t){return r.Z.typeOf.object("left",e),r.Z.typeOf.object("right",t),e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w},u.multiply=function(e,t,i){r.Z.typeOf.object("left",e),r.Z.typeOf.object("right",t),r.Z.typeOf.object("result",i);let n=e.x,o=e.y,a=e.z,s=e.w,l=t.x,c=t.y,u=t.z,h=t.w;return i.x=s*l+n*h+o*u-a*c,i.y=s*c-n*u+o*h+a*l,i.z=s*u+n*c-o*l+a*h,i.w=s*h-n*l-o*c-a*u,i},u.multiplyByScalar=function(e,t,i){return r.Z.typeOf.object("quaternion",e),r.Z.typeOf.number("scalar",t),r.Z.typeOf.object("result",i),i.x=e.x*t,i.y=e.y*t,i.z=e.z*t,i.w=e.w*t,i},u.divideByScalar=function(e,t,i){return r.Z.typeOf.object("quaternion",e),r.Z.typeOf.number("scalar",t),r.Z.typeOf.object("result",i),i.x=e.x/t,i.y=e.y/t,i.z=e.z/t,i.w=e.w/t,i},u.computeAxis=function(e,t){r.Z.typeOf.object("quaternion",e),r.Z.typeOf.object("result",t);let i=e.w;if(Math.abs(i-1)<l.Z.EPSILON6||Math.abs(i+1)<l.Z.EPSILON6)return t.x=1,t.y=t.z=0,t;let n=1/Math.sqrt(1-i*i);return t.x=e.x*n,t.y=e.y*n,t.z=e.z*n,t},u.computeAngle=function(e){return(r.Z.typeOf.object("quaternion",e),Math.abs(e.w-1)<l.Z.EPSILON6)?0:2*Math.acos(e.w)};let E=new u;u.lerp=function(e,t,i,n){return r.Z.typeOf.object("start",e),r.Z.typeOf.object("end",t),r.Z.typeOf.number("t",i),r.Z.typeOf.object("result",n),E=u.multiplyByScalar(t,i,E),n=u.multiplyByScalar(e,1-i,n),u.add(E,n,n)};let x=new u,w=new u,S=new u;u.slerp=function(e,t,i,n){r.Z.typeOf.object("start",e),r.Z.typeOf.object("end",t),r.Z.typeOf.number("t",i),r.Z.typeOf.object("result",n);let o=u.dot(e,t),a=t;if(o<0&&(o=-o,a=x=u.negate(t,x)),1-o<l.Z.EPSILON6)return u.lerp(e,a,i,n);let s=Math.acos(o);return w=u.multiplyByScalar(e,Math.sin((1-i)*s),w),S=u.multiplyByScalar(a,Math.sin(i*s),S),n=u.add(w,S,n),u.multiplyByScalar(n,1/Math.sin(s),n)},u.log=function(e,t){r.Z.typeOf.object("quaternion",e),r.Z.typeOf.object("result",t);let i=l.Z.acosClamped(e.w),o=0;return 0!==i&&(o=i/Math.sin(i)),n.Z.multiplyByScalar(e,o,t)},u.exp=function(e,t){r.Z.typeOf.object("cartesian",e),r.Z.typeOf.object("result",t);let i=n.Z.magnitude(e),o=0;return 0!==i&&(o=Math.sin(i)/i),t.x=e.x*o,t.y=e.y*o,t.z=e.z*o,t.w=Math.cos(i),t};let C=new n.Z,A=new n.Z,I=new u,O=new u;u.computeInnerQuadrangle=function(e,t,i,o){r.Z.typeOf.object("q0",e),r.Z.typeOf.object("q1",t),r.Z.typeOf.object("q2",i),r.Z.typeOf.object("result",o);let a=u.conjugate(t,I);u.multiply(a,i,O);let s=u.log(O,C);u.multiply(a,e,O);let l=u.log(O,A);return n.Z.add(s,l,s),n.Z.multiplyByScalar(s,.25,s),n.Z.negate(s,s),u.exp(s,I),u.multiply(t,I,o)},u.squad=function(e,t,i,n,o,a){r.Z.typeOf.object("q0",e),r.Z.typeOf.object("q1",t),r.Z.typeOf.object("s0",i),r.Z.typeOf.object("s1",n),r.Z.typeOf.number("t",o),r.Z.typeOf.object("result",a);let s=u.slerp(e,t,o,I),l=u.slerp(i,n,o,O);return u.slerp(s,l,2*o*(1-o),a)};let D=new u,P=s.Z.supportsTypedArrays()?new Float32Array(8):[],R=s.Z.supportsTypedArrays()?new Float32Array(8):[],N=s.Z.supportsTypedArrays()?new Float32Array(8):[],L=s.Z.supportsTypedArrays()?new Float32Array(8):[];for(let e=0;e<7;++e){let t=e+1,i=2*t+1;P[e]=1/(t*i),R[e]=t/i}P[7]=.013978731275862502,R[7]=15.208859628138402/17,u.fastSlerp=function(e,t,i,n){let o;r.Z.typeOf.object("start",e),r.Z.typeOf.object("end",t),r.Z.typeOf.number("t",i),r.Z.typeOf.object("result",n);let a=u.dot(e,t);a>=0?o=1:(o=-1,a=-a);let s=a-1,l=1-i,c=i*i,h=l*l;for(let e=7;e>=0;--e)N[e]=(P[e]*c-R[e])*s,L[e]=(P[e]*h-R[e])*s;let d=o*i*(1+N[0]*(1+N[1]*(1+N[2]*(1+N[3]*(1+N[4]*(1+N[5]*(1+N[6]*(1+N[7])))))))),f=l*(1+L[0]*(1+L[1]*(1+L[2]*(1+L[3]*(1+L[4]*(1+L[5]*(1+L[6]*(1+L[7])))))))),p=u.multiplyByScalar(e,f,D);return u.multiplyByScalar(t,d,n),u.add(p,n,n)},u.fastSquad=function(e,t,i,n,o,a){r.Z.typeOf.object("q0",e),r.Z.typeOf.object("q1",t),r.Z.typeOf.object("s0",i),r.Z.typeOf.object("s1",n),r.Z.typeOf.number("t",o),r.Z.typeOf.object("result",a);let s=u.fastSlerp(e,t,o,I),l=u.fastSlerp(i,n,o,O);return u.fastSlerp(s,l,2*o*(1-o),a)},u.equals=function(e,t){return e===t||(0,a.Z)(e)&&(0,a.Z)(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w},u.equalsEpsilon=function(e,t,i){return i=(0,o.Z)(i,0),e===t||(0,a.Z)(e)&&(0,a.Z)(t)&&Math.abs(e.x-t.x)<=i&&Math.abs(e.y-t.y)<=i&&Math.abs(e.z-t.z)<=i&&Math.abs(e.w-t.w)<=i},u.ZERO=Object.freeze(new u(0,0,0,0)),u.IDENTITY=Object.freeze(new u(0,0,0,1)),u.prototype.clone=function(e){return u.clone(this,e)},u.prototype.equals=function(e){return u.equals(this,e)},u.prototype.equalsEpsilon=function(e,t){return u.equalsEpsilon(this,e,t)},u.prototype.toString=function(){return`(${this.x}, ${this.y}, ${this.z}, ${this.w})`},t.Z=u},2402:function(e,t){"use strict";function i(){this._array=[],this._offset=0,this._length=0}Object.defineProperties(i.prototype,{length:{get:function(){return this._length}}}),i.prototype.enqueue=function(e){this._array.push(e),this._length++},i.prototype.dequeue=function(){if(0===this._length)return;let e=this._array,t=this._offset,i=e[t];return e[t]=void 0,++t>10&&2*t>e.length&&(this._array=e.slice(t),t=0),this._offset=t,this._length--,i},i.prototype.peek=function(){if(0!==this._length)return this._array[this._offset]},i.prototype.contains=function(e){return -1!==this._array.indexOf(e)},i.prototype.clear=function(){this._array.length=this._offset=this._length=0},i.prototype.sort=function(e){this._offset>0&&(this._array=this._array.slice(this._offset),this._offset=0),this._array.sort(e)},t.Z=i},5352:function(e,t,i){"use strict";var n=i(1486),r=i(698),o=i(4572),a=i(9410);function s(e,t){t=n.Z.clone((0,o.Z)(t,n.Z.ZERO)),n.Z.equals(t,n.Z.ZERO)||n.Z.normalize(t,t),this.origin=n.Z.clone((0,o.Z)(e,n.Z.ZERO)),this.direction=t}s.clone=function(e,t){return(0,a.Z)(e)?(0,a.Z)(t)?(t.origin=n.Z.clone(e.origin),t.direction=n.Z.clone(e.direction),t):new s(e.origin,e.direction):void 0},s.getPoint=function(e,t,i){return r.Z.typeOf.object("ray",e),r.Z.typeOf.number("t",t),(0,a.Z)(i)||(i=new n.Z),i=n.Z.multiplyByScalar(e.direction,t,i),n.Z.add(e.origin,i,i)},t.Z=s},8054:function(e,t,i){"use strict";var n=i(1486),r=i(2820),o=i(698),a=i(4572),s=i(9410),l=i(1039),c=i(2150),u=i(7119),h=i(4749);function d(e,t,i,n){this.west=(0,a.Z)(e,0),this.south=(0,a.Z)(t,0),this.east=(0,a.Z)(i,0),this.north=(0,a.Z)(n,0)}Object.defineProperties(d.prototype,{width:{get:function(){return d.computeWidth(this)}},height:{get:function(){return d.computeHeight(this)}}}),d.packedLength=4,d.pack=function(e,t,i){return o.Z.typeOf.object("value",e),o.Z.defined("array",t),i=(0,a.Z)(i,0),t[i++]=e.west,t[i++]=e.south,t[i++]=e.east,t[i]=e.north,t},d.unpack=function(e,t,i){return o.Z.defined("array",e),t=(0,a.Z)(t,0),(0,s.Z)(i)||(i=new d),i.west=e[t++],i.south=e[t++],i.east=e[t++],i.north=e[t],i},d.computeWidth=function(e){o.Z.typeOf.object("rectangle",e);let t=e.east,i=e.west;return t<i&&(t+=c.Z.TWO_PI),t-i},d.computeHeight=function(e){return o.Z.typeOf.object("rectangle",e),e.north-e.south},d.fromDegrees=function(e,t,i,n,r){return(e=c.Z.toRadians((0,a.Z)(e,0)),t=c.Z.toRadians((0,a.Z)(t,0)),i=c.Z.toRadians((0,a.Z)(i,0)),n=c.Z.toRadians((0,a.Z)(n,0)),(0,s.Z)(r))?(r.west=e,r.south=t,r.east=i,r.north=n,r):new d(e,t,i,n)},d.fromRadians=function(e,t,i,n,r){return(0,s.Z)(r)?(r.west=(0,a.Z)(e,0),r.south=(0,a.Z)(t,0),r.east=(0,a.Z)(i,0),r.north=(0,a.Z)(n,0),r):new d(e,t,i,n)},d.fromCartographicArray=function(e,t){o.Z.defined("cartographics",e);let i=Number.MAX_VALUE,n=-Number.MAX_VALUE,r=Number.MAX_VALUE,a=-Number.MAX_VALUE,l=Number.MAX_VALUE,u=-Number.MAX_VALUE;for(let t=0,o=e.length;t<o;t++){let o=e[t];i=Math.min(i,o.longitude),n=Math.max(n,o.longitude),l=Math.min(l,o.latitude),u=Math.max(u,o.latitude);let s=o.longitude>=0?o.longitude:o.longitude+c.Z.TWO_PI;r=Math.min(r,s),a=Math.max(a,s)}return(n-i>a-r&&(i=r,(n=a)>c.Z.PI&&(n-=c.Z.TWO_PI),i>c.Z.PI&&(i-=c.Z.TWO_PI)),(0,s.Z)(t))?(t.west=i,t.south=l,t.east=n,t.north=u,t):new d(i,l,n,u)},d.fromCartesianArray=function(e,t,i){o.Z.defined("cartesians",e),t=(0,a.Z)(t,l.Z.WGS84);let n=Number.MAX_VALUE,r=-Number.MAX_VALUE,u=Number.MAX_VALUE,h=-Number.MAX_VALUE,f=Number.MAX_VALUE,p=-Number.MAX_VALUE;for(let i=0,o=e.length;i<o;i++){let o=t.cartesianToCartographic(e[i]);n=Math.min(n,o.longitude),r=Math.max(r,o.longitude),f=Math.min(f,o.latitude),p=Math.max(p,o.latitude);let a=o.longitude>=0?o.longitude:o.longitude+c.Z.TWO_PI;u=Math.min(u,a),h=Math.max(h,a)}return(r-n>h-u&&(n=u,(r=h)>c.Z.PI&&(r-=c.Z.TWO_PI),n>c.Z.PI&&(n-=c.Z.TWO_PI)),(0,s.Z)(i))?(i.west=n,i.south=f,i.east=r,i.north=p,i):new d(n,f,r,p)};let f=new n.Z,p=new n.Z,m=new n.Z,_=new n.Z,g=new n.Z,Z=[,,,,,];for(let e=0;e<Z.length;++e)Z[e]=new n.Z;d.fromBoundingSphere=function(e,t,i){o.Z.typeOf.object("boundingSphere",e);let r=e.center,a=e.radius;if((0,s.Z)(t)||(t=l.Z.WGS84),(0,s.Z)(i)||(i=new d),n.Z.equals(r,n.Z.ZERO))return d.clone(d.MAX_VALUE,i),i;let c=u.Z.eastNorthUpToFixedFrame(r,t,f),y=h.Z.multiplyByPointAsVector(c,n.Z.UNIT_X,p);n.Z.normalize(y,y);let b=h.Z.multiplyByPointAsVector(c,n.Z.UNIT_Y,m);n.Z.normalize(b,b),n.Z.multiplyByScalar(b,a,b),n.Z.multiplyByScalar(y,a,y);let v=n.Z.negate(b,g),T=n.Z.negate(y,_),E=Z[0];return n.Z.add(r,b,E),E=Z[1],n.Z.add(r,T,E),E=Z[2],n.Z.add(r,v,E),E=Z[3],n.Z.add(r,y,E),Z[4]=r,d.fromCartesianArray(Z,t,i)},d.clone=function(e,t){return(0,s.Z)(e)?(0,s.Z)(t)?(t.west=e.west,t.south=e.south,t.east=e.east,t.north=e.north,t):new d(e.west,e.south,e.east,e.north):void 0},d.equalsEpsilon=function(e,t,i){return i=(0,a.Z)(i,0),e===t||(0,s.Z)(e)&&(0,s.Z)(t)&&Math.abs(e.west-t.west)<=i&&Math.abs(e.south-t.south)<=i&&Math.abs(e.east-t.east)<=i&&Math.abs(e.north-t.north)<=i},d.prototype.clone=function(e){return d.clone(this,e)},d.prototype.equals=function(e){return d.equals(this,e)},d.equals=function(e,t){return e===t||(0,s.Z)(e)&&(0,s.Z)(t)&&e.west===t.west&&e.south===t.south&&e.east===t.east&&e.north===t.north},d.prototype.equalsEpsilon=function(e,t){return d.equalsEpsilon(this,e,t)},d.validate=function(e){o.Z.typeOf.object("rectangle",e);let t=e.north;o.Z.typeOf.number.greaterThanOrEquals("north",t,-c.Z.PI_OVER_TWO),o.Z.typeOf.number.lessThanOrEquals("north",t,c.Z.PI_OVER_TWO);let i=e.south;o.Z.typeOf.number.greaterThanOrEquals("south",i,-c.Z.PI_OVER_TWO),o.Z.typeOf.number.lessThanOrEquals("south",i,c.Z.PI_OVER_TWO);let n=e.west;o.Z.typeOf.number.greaterThanOrEquals("west",n,-Math.PI),o.Z.typeOf.number.lessThanOrEquals("west",n,Math.PI);let r=e.east;o.Z.typeOf.number.greaterThanOrEquals("east",r,-Math.PI),o.Z.typeOf.number.lessThanOrEquals("east",r,Math.PI)},d.southwest=function(e,t){return(o.Z.typeOf.object("rectangle",e),(0,s.Z)(t))?(t.longitude=e.west,t.latitude=e.south,t.height=0,t):new r.Z(e.west,e.south)},d.northwest=function(e,t){return(o.Z.typeOf.object("rectangle",e),(0,s.Z)(t))?(t.longitude=e.west,t.latitude=e.north,t.height=0,t):new r.Z(e.west,e.north)},d.northeast=function(e,t){return(o.Z.typeOf.object("rectangle",e),(0,s.Z)(t))?(t.longitude=e.east,t.latitude=e.north,t.height=0,t):new r.Z(e.east,e.north)},d.southeast=function(e,t){return(o.Z.typeOf.object("rectangle",e),(0,s.Z)(t))?(t.longitude=e.east,t.latitude=e.south,t.height=0,t):new r.Z(e.east,e.south)},d.center=function(e,t){o.Z.typeOf.object("rectangle",e);let i=e.east,n=e.west;i<n&&(i+=c.Z.TWO_PI);let a=c.Z.negativePiToPi((n+i)*.5),l=(e.south+e.north)*.5;return(0,s.Z)(t)?(t.longitude=a,t.latitude=l,t.height=0,t):new r.Z(a,l)},d.intersection=function(e,t,i){o.Z.typeOf.object("rectangle",e),o.Z.typeOf.object("otherRectangle",t);let n=e.east,r=e.west,a=t.east,l=t.west;n<r&&a>0?n+=c.Z.TWO_PI:a<l&&n>0&&(a+=c.Z.TWO_PI),n<r&&l<0?l+=c.Z.TWO_PI:a<l&&r<0&&(r+=c.Z.TWO_PI);let u=c.Z.negativePiToPi(Math.max(r,l)),h=c.Z.negativePiToPi(Math.min(n,a));if((e.west<e.east||t.west<t.east)&&h<=u)return;let f=Math.max(e.south,t.south),p=Math.min(e.north,t.north);return f>=p?void 0:(0,s.Z)(i)?(i.west=u,i.south=f,i.east=h,i.north=p,i):new d(u,f,h,p)},d.simpleIntersection=function(e,t,i){o.Z.typeOf.object("rectangle",e),o.Z.typeOf.object("otherRectangle",t);let n=Math.max(e.west,t.west),r=Math.max(e.south,t.south),a=Math.min(e.east,t.east),l=Math.min(e.north,t.north);return r>=l||n>=a?void 0:(0,s.Z)(i)?(i.west=n,i.south=r,i.east=a,i.north=l,i):new d(n,r,a,l)},d.union=function(e,t,i){o.Z.typeOf.object("rectangle",e),o.Z.typeOf.object("otherRectangle",t),(0,s.Z)(i)||(i=new d);let n=e.east,r=e.west,a=t.east,l=t.west;n<r&&a>0?n+=c.Z.TWO_PI:a<l&&n>0&&(a+=c.Z.TWO_PI),n<r&&l<0?l+=c.Z.TWO_PI:a<l&&r<0&&(r+=c.Z.TWO_PI);let u=c.Z.negativePiToPi(Math.min(r,l)),h=c.Z.negativePiToPi(Math.max(n,a));return i.west=u,i.south=Math.min(e.south,t.south),i.east=h,i.north=Math.max(e.north,t.north),i},d.expand=function(e,t,i){return o.Z.typeOf.object("rectangle",e),o.Z.typeOf.object("cartographic",t),(0,s.Z)(i)||(i=new d),i.west=Math.min(e.west,t.longitude),i.south=Math.min(e.south,t.latitude),i.east=Math.max(e.east,t.longitude),i.north=Math.max(e.north,t.latitude),i},d.contains=function(e,t){o.Z.typeOf.object("rectangle",e),o.Z.typeOf.object("cartographic",t);let i=t.longitude,n=t.latitude,r=e.west,a=e.east;return a<r&&(a+=c.Z.TWO_PI,i<0&&(i+=c.Z.TWO_PI)),(i>r||c.Z.equalsEpsilon(i,r,c.Z.EPSILON14))&&(i<a||c.Z.equalsEpsilon(i,a,c.Z.EPSILON14))&&n>=e.south&&n<=e.north};let y=new r.Z;d.subsample=function(e,t,i,n){o.Z.typeOf.object("rectangle",e),t=(0,a.Z)(t,l.Z.WGS84),i=(0,a.Z)(i,0),(0,s.Z)(n)||(n=[]);let r=0,u=e.north,h=e.south,f=e.east,p=e.west;y.height=i,y.longitude=p,y.latitude=u,n[r]=t.cartographicToCartesian(y,n[r]),r++,y.longitude=f,n[r]=t.cartographicToCartesian(y,n[r]),r++,y.latitude=h,n[r]=t.cartographicToCartesian(y,n[r]),r++,y.longitude=p,n[r]=t.cartographicToCartesian(y,n[r]),r++,u<0?y.latitude=u:h>0?y.latitude=h:y.latitude=0;for(let i=1;i<8;++i)y.longitude=-Math.PI+i*c.Z.PI_OVER_TWO,d.contains(e,y)&&(n[r]=t.cartographicToCartesian(y,n[r]),r++);return 0===y.latitude&&(y.longitude=p,n[r]=t.cartographicToCartesian(y,n[r]),r++,y.longitude=f,n[r]=t.cartographicToCartesian(y,n[r]),r++),n.length=r,n},d.subsection=function(e,t,i,n,r,a){if(o.Z.typeOf.object("rectangle",e),o.Z.typeOf.number.greaterThanOrEquals("westLerp",t,0),o.Z.typeOf.number.lessThanOrEquals("westLerp",t,1),o.Z.typeOf.number.greaterThanOrEquals("southLerp",i,0),o.Z.typeOf.number.lessThanOrEquals("southLerp",i,1),o.Z.typeOf.number.greaterThanOrEquals("eastLerp",n,0),o.Z.typeOf.number.lessThanOrEquals("eastLerp",n,1),o.Z.typeOf.number.greaterThanOrEquals("northLerp",r,0),o.Z.typeOf.number.lessThanOrEquals("northLerp",r,1),o.Z.typeOf.number.lessThanOrEquals("westLerp",t,n),o.Z.typeOf.number.lessThanOrEquals("southLerp",i,r),(0,s.Z)(a)||(a=new d),e.west<=e.east){let i=e.east-e.west;a.west=e.west+t*i,a.east=e.west+n*i}else{let i=c.Z.TWO_PI+e.east-e.west;a.west=c.Z.negativePiToPi(e.west+t*i),a.east=c.Z.negativePiToPi(e.west+n*i)}let l=e.north-e.south;return a.south=e.south+i*l,a.north=e.south+r*l,1===t&&(a.west=e.east),1===n&&(a.east=e.east),1===i&&(a.south=e.north),1===r&&(a.north=e.north),a},d.MAX_VALUE=Object.freeze(new d(-Math.PI,-c.Z.PI_OVER_TWO,Math.PI,c.Z.PI_OVER_TWO)),t.Z=d},7939:function(e,t,i){"use strict";var n=i(1486),r=i(2820),o=i(9410),a=i(9824),s=i(4754),l=i(2150),c=i(3037),u=i(8054);let h=Math.cos,d=Math.sin,f=Math.sqrt,p={};p.computePosition=function(e,t,i,n,r,a,s){let l=t.radiiSquared,c=e.nwCorner,u=e.boundingRectangle,p=c.latitude-e.granYCos*n+r*e.granXSin,m=h(p),_=d(p),g=l.z*_,Z=c.longitude+n*e.granYSin+r*e.granXCos,y=m*h(Z),b=m*d(Z),v=l.x*y,T=l.y*b,E=f(v*y+T*b+g*_);if(a.x=v/E,a.y=T/E,a.z=g/E,i){let t=e.stNwCorner;(0,o.Z)(t)?(p=t.latitude-e.stGranYCos*n+r*e.stGranXSin,Z=t.longitude+n*e.stGranYSin+r*e.stGranXCos,s.x=(Z-e.stWest)*e.lonScalar,s.y=(p-e.stSouth)*e.latScalar):(s.x=(Z-u.west)*e.lonScalar,s.y=(p-u.south)*e.latScalar)}};let m=new c.Z,_=new n.Z,g=new r.Z,Z=new n.Z,y=new s.Z;function b(e,t,i,r,o,a,s){let l=Math.cos(t),u=r*l,h=i*l,d=Math.sin(t),f=r*d,p=i*d;_=y.project(e,_),_=n.Z.subtract(_,Z,_);let g=c.Z.fromRotation(t,m);_=c.Z.multiplyByVector(g,_,_),_=n.Z.add(_,Z,_),e=y.unproject(_,e),a-=1,s-=1;let b=e.latitude,v=b+a*p,T=b-u*s,E=b-u*s+a*p,x=e.longitude,w=x+a*h,S=x+s*f,C=x+s*f+a*h;return{north:Math.max(b,v,T,E),south:Math.min(b,v,T,E),east:Math.max(x,w,S,C),west:Math.min(x,w,S,C),granYCos:u,granYSin:f,granXCos:h,granXSin:p,nwCorner:e}}p.computeOptions=function(e,t,i,n,r,o,s){let c,h=e.east,d=e.west,f=e.north,p=e.south,m=!1,_=!1;f===l.Z.PI_OVER_TWO&&(m=!0),p===-l.Z.PI_OVER_TWO&&(_=!0);let v=f-p,T=Math.ceil((c=d>h?l.Z.TWO_PI-d+h:h-d)/t)+1,E=Math.ceil(v/t)+1,x=c/(T-1),w=v/(E-1),S=u.Z.northwest(e,o),C=u.Z.center(e,g);(0!==i||0!==n)&&(C.longitude<S.longitude&&(C.longitude+=l.Z.TWO_PI),Z=y.project(C,Z));let A=u.Z.clone(e,r),I={granYCos:w,granYSin:0,granXCos:x,granXSin:0,nwCorner:S,boundingRectangle:A,width:T,height:E,northCap:m,southCap:_};if(0!==i){let e=b(S,i,x,w,C,T,E);if(f=e.north,p=e.south,h=e.east,d=e.west,f<-l.Z.PI_OVER_TWO||f>l.Z.PI_OVER_TWO||p<-l.Z.PI_OVER_TWO||p>l.Z.PI_OVER_TWO)throw new a.Z("Rotated rectangle is invalid. It crosses over either the north or south pole.");I.granYCos=e.granYCos,I.granYSin=e.granYSin,I.granXCos=e.granXCos,I.granXSin=e.granXSin,A.north=f,A.south=p,A.east=h,A.west=d}if(0!==n){i-=n;let e=u.Z.northwest(A,s),t=b(e,i,x,w,C,T,E);I.stGranYCos=t.granYCos,I.stGranXCos=t.granXCos,I.stGranYSin=t.granYSin,I.stGranXSin=t.granXSin,I.stNwCorner=e,I.stWest=t.west,I.stSouth=t.south}return I},t.Z=p},7372:function(e,t,i){"use strict";var n=i(7643),r=i(1486),o=i(2820),a=i(7559),s=i(4572),l=i(9410),c=i(9824),u=i(1039),h=i(3086),d=i(2601),f=i(258),p=i(2246),m=i(5837),_=i(2150),g=i(9330),Z=i(5022),y=i(8054),b=i(7939);let v=new n.Z,T=new n.Z,E=new r.Z,x=new y.Z;function w(e,t){let i;let n=e._ellipsoid,r=t.height,o=t.width,s=t.northCap,l=t.southCap,c=r,u=2,p=0,_=4;s&&(u-=1,c-=1,p+=1,_-=2),l&&(u-=1,c-=1,p+=1,_-=2);let g=new Float64Array(3*(p+=u*o+2*c-_)),y=0,v=0;if(s)b.Z.computePosition(t,n,!1,v,0,E),g[y++]=E.x,g[y++]=E.y,g[y++]=E.z;else for(i=0;i<o;i++)b.Z.computePosition(t,n,!1,v,i,E),g[y++]=E.x,g[y++]=E.y,g[y++]=E.z;for(v=1,i=o-1;v<r;v++)b.Z.computePosition(t,n,!1,v,i,E),g[y++]=E.x,g[y++]=E.y,g[y++]=E.z;if(v=r-1,!l)for(i=o-2;i>=0;i--)b.Z.computePosition(t,n,!1,v,i,E),g[y++]=E.x,g[y++]=E.y,g[y++]=E.z;for(i=0,v=r-2;v>0;v--)b.Z.computePosition(t,n,!1,v,i,E),g[y++]=E.x,g[y++]=E.y,g[y++]=E.z;let T=g.length/3*2,x=m.Z.createTypedArray(g.length/3,T),w=0;for(let e=0;e<g.length/3-1;e++)x[w++]=e,x[w++]=e+1;x[w++]=g.length/3-1,x[w++]=0;let S=new h.Z({attributes:new f.Z,primitiveType:Z.Z.LINES});return S.attributes.position=new d.Z({componentDatatype:a.Z.DOUBLE,componentsPerAttribute:3,values:g}),S.indices=x,S}function S(e){let t=(e=(0,s.Z)(e,s.Z.EMPTY_OBJECT)).rectangle,i=(0,s.Z)(e.granularity,_.Z.RADIANS_PER_DEGREE),n=(0,s.Z)(e.ellipsoid,u.Z.WGS84),r=(0,s.Z)(e.rotation,0);if(!(0,l.Z)(t))throw new c.Z("rectangle is required.");if(y.Z.validate(t),t.north<t.south)throw new c.Z("options.rectangle.north must be greater than options.rectangle.south");let o=(0,s.Z)(e.height,0),a=(0,s.Z)(e.extrudedHeight,o);this._rectangle=y.Z.clone(t),this._granularity=i,this._ellipsoid=n,this._surfaceHeight=Math.max(o,a),this._rotation=r,this._extrudedHeight=Math.min(o,a),this._offsetAttribute=e.offsetAttribute,this._workerName="createRectangleOutlineGeometry"}S.packedLength=y.Z.packedLength+u.Z.packedLength+5,S.pack=function(e,t,i){if(!(0,l.Z)(e))throw new c.Z("value is required");if(!(0,l.Z)(t))throw new c.Z("array is required");return i=(0,s.Z)(i,0),y.Z.pack(e._rectangle,t,i),i+=y.Z.packedLength,u.Z.pack(e._ellipsoid,t,i),i+=u.Z.packedLength,t[i++]=e._granularity,t[i++]=e._surfaceHeight,t[i++]=e._rotation,t[i++]=e._extrudedHeight,t[i]=(0,s.Z)(e._offsetAttribute,-1),t};let C=new y.Z,A=u.Z.clone(u.Z.UNIT_SPHERE),I={rectangle:C,ellipsoid:A,granularity:void 0,height:void 0,rotation:void 0,extrudedHeight:void 0,offsetAttribute:void 0};S.unpack=function(e,t,i){if(!(0,l.Z)(e))throw new c.Z("array is required");t=(0,s.Z)(t,0);let n=y.Z.unpack(e,t,C);t+=y.Z.packedLength;let r=u.Z.unpack(e,t,A);t+=u.Z.packedLength;let o=e[t++],a=e[t++],h=e[t++],d=e[t++],f=e[t];return(0,l.Z)(i)?(i._rectangle=y.Z.clone(n,i._rectangle),i._ellipsoid=u.Z.clone(r,i._ellipsoid),i._surfaceHeight=a,i._rotation=h,i._extrudedHeight=d,i._offsetAttribute=-1===f?void 0:f,i):(I.granularity=o,I.height=a,I.rotation=h,I.extrudedHeight=d,I.offsetAttribute=-1===f?void 0:f,new S(I))};let O=new o.Z;S.createGeometry=function(e){let t,i,r;let o=e._rectangle,s=e._ellipsoid,c=b.Z.computeOptions(o,e._granularity,e._rotation,0,x,O);if(_.Z.equalsEpsilon(o.north,o.south,_.Z.EPSILON10)||_.Z.equalsEpsilon(o.east,o.west,_.Z.EPSILON10))return;let u=e._surfaceHeight,f=e._extrudedHeight;if(_.Z.equalsEpsilon(u,f,0,_.Z.EPSILON2)){if((t=w(e,c)).attributes.position.values=g.Z.scaleToGeodeticHeight(t.attributes.position.values,u,s,!1),(0,l.Z)(e._offsetAttribute)){let i=t.attributes.position.values.length;r=e._offsetAttribute===p.Z.NONE?0:1;let n=new Uint8Array(i/3).fill(r);t.attributes.applyOffset=new d.Z({componentDatatype:a.Z.UNSIGNED_BYTE,componentsPerAttribute:1,values:n})}i=n.Z.fromRectangle3D(o,s,u)}else{if(t=function(e,t){let i;let n=e._surfaceHeight,r=e._extrudedHeight,o=e._ellipsoid,a=w(e,t),s=t.height,l=t.width,c=g.Z.scaleToGeodeticHeight(a.attributes.position.values,n,o,!1),u=c.length,h=new Float64Array(2*u);h.set(c);let d=g.Z.scaleToGeodeticHeight(a.attributes.position.values,r,o);h.set(d,u),a.attributes.position.values=h;let f=t.northCap,p=t.southCap,_=4;f&&(_-=1),p&&(_-=1);let Z=(h.length/3+_)*2,y=m.Z.createTypedArray(h.length/3,Z);u=h.length/6;let b=0;for(let e=0;e<u-1;e++)y[b++]=e,y[b++]=e+1,y[b++]=e+u,y[b++]=e+u+1;if(y[b++]=u-1,y[b++]=0,y[b++]=u+u-1,y[b++]=u,y[b++]=0,y[b++]=u,f)i=s-1;else{let e=l-1;y[b++]=e,y[b++]=e+u,i=l+s-2}if(y[b++]=i,y[b++]=i+u,!p){let e=l+i-1;y[b++]=e,y[b]=e+u}return a.indices=y,a}(e,c),(0,l.Z)(e._offsetAttribute)){let i=t.attributes.position.values.length/3,n=new Uint8Array(i);e._offsetAttribute===p.Z.TOP?n=n.fill(1,0,i/2):(r=e._offsetAttribute===p.Z.NONE?0:1,n=n.fill(r)),t.attributes.applyOffset=new d.Z({componentDatatype:a.Z.UNSIGNED_BYTE,componentsPerAttribute:1,values:n})}let h=n.Z.fromRectangle3D(o,s,u,T),_=n.Z.fromRectangle3D(o,s,f,v);i=n.Z.union(h,_)}return new h.Z({attributes:t.attributes,indices:t.indices,primitiveType:Z.Z.LINES,boundingSphere:i,offsetAttribute:e._offsetAttribute})},t.Z=S},7897:function(e,t){"use strict";t.Z=Object.freeze({FIXED:0,INERTIAL:1})},8664:function(e,t,i){"use strict";var n=i(4572),r=i(9410),o=i(1731),a=i(4433);function s(e){e=(0,n.Z)(e,n.Z.EMPTY_OBJECT);let t=(0,n.Z)(e.throttleByServer,!1),i=(0,n.Z)(e.throttle,!1);this.url=e.url,this.requestFunction=e.requestFunction,this.cancelFunction=e.cancelFunction,this.priorityFunction=e.priorityFunction,this.priority=(0,n.Z)(e.priority,0),this.throttle=i,this.throttleByServer=t,this.type=(0,n.Z)(e.type,a.Z.OTHER),this.serverKey=e.serverKey,this.state=o.Z.UNISSUED,this.deferred=void 0,this.cancelled=!1}s.prototype.cancel=function(){this.cancelled=!0},s.prototype.clone=function(e){return(0,r.Z)(e)?(e.url=this.url,e.requestFunction=this.requestFunction,e.cancelFunction=this.cancelFunction,e.priorityFunction=this.priorityFunction,e.priority=this.priority,e.throttle=this.throttle,e.throttleByServer=this.throttleByServer,e.type=this.type,e.serverKey=this.serverKey,e.state=o.Z.UNISSUED,e.deferred=void 0,e.cancelled=!1,e):new s(this)},t.Z=s},5342:function(e,t,i){"use strict";i.d(t,{Z:function(){return a}});var n=i(9410),r=function(e){let t={};if(!e)return t;let i=e.split("\r\n");for(let e=0;e<i.length;++e){let n=i[e],r=n.indexOf(": ");if(r>0){let e=n.substring(0,r),i=n.substring(r+2);t[e]=i}}return t};function o(e,t,i){this.statusCode=e,this.response=t,this.responseHeaders=i,"string"==typeof this.responseHeaders&&(this.responseHeaders=r(this.responseHeaders))}o.prototype.toString=function(){let e="Request has failed.";return(0,n.Z)(this.statusCode)&&(e+=` Status Code: ${this.statusCode}`),e};var a=o},8041:function(e,t,i){"use strict";i.d(t,{Z:function(){return S}});var n=i(4355),r=i(698),o=i(4572),a=i(9695),s=i(9410),l=i(2198);function c(e){r.Z.typeOf.object("options",e),r.Z.defined("options.comparator",e.comparator),this._comparator=e.comparator,this._array=[],this._length=0,this._maximumLength=void 0}function u(e,t,i){let n=e[t];e[t]=e[i],e[i]=n}Object.defineProperties(c.prototype,{length:{get:function(){return this._length}},internalArray:{get:function(){return this._array}},maximumLength:{get:function(){return this._maximumLength},set:function(e){r.Z.typeOf.number.greaterThanOrEquals("maximumLength",e,0);let t=this._length;if(e<t){let i=this._array;for(let n=e;n<t;++n)i[n]=void 0;this._length=e,i.length=e}this._maximumLength=e}},comparator:{get:function(){return this._comparator}}}),c.prototype.reserve=function(e){e=(0,o.Z)(e,this._length),this._array.length=e},c.prototype.heapify=function(e){e=(0,o.Z)(e,0);let t=this._length,i=this._comparator,n=this._array,r=-1,a=!0;for(;a;){let o=2*(e+1),s=o-1;r=s<t&&0>i(n[s],n[e])?s:e,o<t&&0>i(n[o],n[r])&&(r=o),r!==e?(u(n,r,e),e=r):a=!1}},c.prototype.resort=function(){let e=this._length;for(let t=Math.ceil(e/2);t>=0;--t)this.heapify(t)},c.prototype.insert=function(e){let t;r.Z.defined("element",e);let i=this._array,n=this._comparator,o=this._maximumLength,a=this._length++;for(a<i.length?i[a]=e:i.push(e);0!==a;){let e=Math.floor((a-1)/2);if(0>n(i[a],i[e]))u(i,a,e),a=e;else break}return(0,s.Z)(o)&&this._length>o&&(t=i[o],this._length=o),t},c.prototype.pop=function(e){if(e=(0,o.Z)(e,0),0===this._length)return;r.Z.typeOf.number.lessThan("index",e,this._length);let t=this._array,i=t[e];return u(t,e,--this._length),this.heapify(e),t[this._length]=void 0,i};var h=i(9288),d=i(2963),f=i(1731);let p={numberOfAttemptedRequests:0,numberOfActiveRequests:0,numberOfCancelledRequests:0,numberOfCancelledActiveRequests:0,numberOfFailedRequests:0,numberOfActiveRequestsEver:0,lastNumberOfActiveRequests:0},m=20,_=new c({comparator:function(e,t){return e.priority-t.priority}});_.maximumLength=m,_.reserve(m);let g=[],Z={},y="undefined"!=typeof document?new n(document.location.href):new n,b=new l.Z;function v(){}function T(e){(0,s.Z)(e.priorityFunction)&&(e.priority=e.priorityFunction())}function E(e){return e.state===f.Z.UNISSUED&&(e.state=f.Z.ISSUED,e.deferred=(0,a.Z)()),e.deferred.promise}function x(e){let t=E(e);return e.state=f.Z.ACTIVE,g.push(e),++p.numberOfActiveRequests,++p.numberOfActiveRequestsEver,++Z[e.serverKey],e.requestFunction().then(function(t){if(e.state===f.Z.CANCELLED)return;let i=e.deferred;--p.numberOfActiveRequests,--Z[e.serverKey],b.raiseEvent(),e.state=f.Z.RECEIVED,e.deferred=void 0,i.resolve(t)}).catch(function(t){e.state!==f.Z.CANCELLED&&(++p.numberOfFailedRequests,--p.numberOfActiveRequests,--Z[e.serverKey],b.raiseEvent(t),e.state=f.Z.FAILED,e.deferred.reject(t))}),t}function w(e){let t=e.state===f.Z.ACTIVE;if(e.state=f.Z.CANCELLED,++p.numberOfCancelledRequests,(0,s.Z)(e.deferred)){let t=e.deferred;e.deferred=void 0,t.reject()}t&&(--p.numberOfActiveRequests,--Z[e.serverKey],++p.numberOfCancelledActiveRequests),(0,s.Z)(e.cancelFunction)&&e.cancelFunction()}v.maximumRequests=50,v.maximumRequestsPerServer=18,v.requestsByServer={},v.throttleRequests=!0,v.debugShowStatistics=!1,v.requestCompletedEvent=b,Object.defineProperties(v,{statistics:{get:function(){return p}},priorityHeapLength:{get:function(){return m},set:function(e){if(e<m)for(;_.length>e;)w(_.pop());m=e,_.maximumLength=e,_.reserve(e)}}}),v.serverHasOpenSlots=function(e,t){t=(0,o.Z)(t,1);let i=(0,o.Z)(v.requestsByServer[e],v.maximumRequestsPerServer);return Z[e]+t<=i},v.heapHasOpenSlots=function(e){return _.length+e<=m},v.update=function(){let e,t;let i=0,n=g.length;for(e=0;e<n;++e){if((t=g[e]).cancelled&&w(t),t.state!==f.Z.ACTIVE){++i;continue}i>0&&(g[e-i]=t)}g.length-=i;let r=_.internalArray,o=_.length;for(e=0;e<o;++e)T(r[e]);_.resort();let a=Math.max(v.maximumRequests-g.length,0),s=0;for(;s<a&&_.length>0;){if((t=_.pop()).cancelled||t.throttleByServer&&!v.serverHasOpenSlots(t.serverKey)){w(t);continue}x(t),++s}v.debugShowStatistics&&(0===p.numberOfActiveRequests&&p.lastNumberOfActiveRequests>0&&(p.numberOfAttemptedRequests>0&&(console.log(`Number of attempted requests: ${p.numberOfAttemptedRequests}`),p.numberOfAttemptedRequests=0),p.numberOfCancelledRequests>0&&(console.log(`Number of cancelled requests: ${p.numberOfCancelledRequests}`),p.numberOfCancelledRequests=0),p.numberOfCancelledActiveRequests>0&&(console.log(`Number of cancelled active requests: ${p.numberOfCancelledActiveRequests}`),p.numberOfCancelledActiveRequests=0),p.numberOfFailedRequests>0&&(console.log(`Number of failed requests: ${p.numberOfFailedRequests}`),p.numberOfFailedRequests=0)),p.lastNumberOfActiveRequests=p.numberOfActiveRequests)},v.getServerKey=function(e){r.Z.typeOf.string("url",e);let t=new n(e);""===t.scheme()&&(t=t.absoluteTo(y)).normalize();let i=t.authority();/:/.test(i)||(i=`${i}:${"https"===t.scheme()?"443":"80"}`);let o=Z[i];return(0,s.Z)(o)||(Z[i]=0),i},v.request=function(e){if(r.Z.typeOf.object("request",e),r.Z.typeOf.string("request.url",e.url),r.Z.typeOf.func("request.requestFunction",e.requestFunction),(0,d.Z)(e.url)||(0,h.Z)(e.url))return b.raiseEvent(),e.state=f.Z.RECEIVED,e.requestFunction();if(++p.numberOfAttemptedRequests,(0,s.Z)(e.serverKey)||(e.serverKey=v.getServerKey(e.url)),v.throttleRequests&&e.throttleByServer&&!v.serverHasOpenSlots(e.serverKey))return;if(!v.throttleRequests||!e.throttle)return x(e);if(g.length>=v.maximumRequests)return;T(e);let t=_.insert(e);if((0,s.Z)(t)){if(t===e)return;w(t)}return E(e)},v.clearForSpecs=function(){for(;_.length>0;)w(_.pop());let e=g.length;for(let t=0;t<e;++t)w(g[t]);g.length=0,Z={},p.numberOfAttemptedRequests=0,p.numberOfActiveRequests=0,p.numberOfCancelledRequests=0,p.numberOfCancelledActiveRequests=0,p.numberOfFailedRequests=0,p.numberOfActiveRequestsEver=0,p.lastNumberOfActiveRequests=0},v.numberOfActiveRequestsByServer=function(e){return Z[e]},v.requestHeap=_;var S=v},1731:function(e,t){"use strict";t.Z=Object.freeze({UNISSUED:0,ISSUED:1,ACTIVE:2,RECEIVED:3,CANCELLED:4,FAILED:5})},4433:function(e,t){"use strict";t.Z=Object.freeze({TERRAIN:0,IMAGERY:1,TILES3D:2,OTHER:3})},8358:function(e,t,i){"use strict";let n;i.d(t,{Z:function(){return U}});var r=i(4355),o=i(698),a=i(49),s=i(2115),l=i(4572),c=i(9695),u=i(9410),h=i(9824),d=i(375),f=function(e,t){if(!(0,u.Z)(e))throw new h.Z("uri is required.");let i="",n=e.lastIndexOf("/");return -1!==n&&(i=e.substring(0,n+1)),t&&(0!==(e=new r(e)).query().length&&(i+=`?${e.query()}`),0!==e.fragment().length&&(i+=`#${e.fragment()}`)),i},p=function(e){if(!(0,u.Z)(e))throw new h.Z("uri is required.");let t=new r(e);t.normalize();let i=t.path(),n=i.lastIndexOf("/");return -1!==n&&(i=i.substr(n+1)),i=-1===(n=i.lastIndexOf("."))?"":i.substr(n+1)},m=i(5497),_=i(9288),g=i(7230),Z=i(2963),y=function(e){let t=document.createElement("script");return t.async=!0,t.src=e,new Promise((e,i)=>{window.crossOriginIsolated&&t.setAttribute("crossorigin","anonymous");let n=document.getElementsByTagName("head")[0];t.onload=function(){t.onload=void 0,n.removeChild(t),e()},t.onerror=function(e){i(e)},n.appendChild(t)})},b=i(2150),v=function(e){if(!(0,u.Z)(e))throw new h.Z("obj is required.");let t="";for(let i in e)if(e.hasOwnProperty(i)){let n=e[i],r=`${encodeURIComponent(i)}=`;if(Array.isArray(n))for(let e=0,i=n.length;e<i;++e)t+=`${r+encodeURIComponent(n[e])}&`;else t+=`${r+encodeURIComponent(n)}&`}return t.slice(0,-1)},T=function(e){if(!(0,u.Z)(e))throw new h.Z("queryString is required.");let t={};if(""===e)return t;let i=e.replace(/\+/g,"%20").split(/[&;]/);for(let e=0,n=i.length;e<n;++e){let n=i[e].split("="),r=decodeURIComponent(n[0]),o=n[1];o=(0,u.Z)(o)?decodeURIComponent(o):"";let a=t[r];"string"==typeof a?t[r]=[a,o]:Array.isArray(a)?a.push(o):t[r]=o}return t},E=i(8664),x=i(5342),w=i(8041),S=i(1731),C=i(87);let A={},I={};A.add=function(e,t){if(!(0,u.Z)(e))throw new h.Z("host is required.");if(!(0,u.Z)(t)||t<=0)throw new h.Z("port is required to be greater than 0.");let i=`${e.toLowerCase()}:${t}`;(0,u.Z)(I[i])||(I[i]=!0)},A.remove=function(e,t){if(!(0,u.Z)(e))throw new h.Z("host is required.");if(!(0,u.Z)(t)||t<=0)throw new h.Z("port is required to be greater than 0.");let i=`${e.toLowerCase()}:${t}`;(0,u.Z)(I[i])&&delete I[i]},A.contains=function(e){if(!(0,u.Z)(e))throw new h.Z("url is required.");let t=function(e){let t=new r(e);t.normalize();let i=t.authority();if(0!==i.length){if(t.authority(i),-1!==i.indexOf("@")&&(i=i.split("@")[1]),-1===i.indexOf(":")){let e=t.scheme();if(0===e.length&&(e=(e=window.location.protocol).substring(0,e.length-1)),"http"===e)i+=":80";else{if("https"!==e)return;i+=":443"}}return i}}(e);return!!((0,u.Z)(t)&&(0,u.Z)(I[t]))},A.clear=function(){I={}};let O=function(){try{let e=new XMLHttpRequest;return e.open("GET","#",!0),e.responseType="blob","blob"===e.responseType}catch(e){return!1}}();function D(e){"string"==typeof(e=(0,l.Z)(e,l.Z.EMPTY_OBJECT))&&(e={url:e}),o.Z.typeOf.string("options.url",e.url),this._url=void 0,this._templateValues=P(e.templateValues,{}),this._queryParameters=P(e.queryParameters,{}),this.headers=P(e.headers,{}),this.request=(0,l.Z)(e.request,new E.Z),this.proxy=e.proxy,this.retryCallback=e.retryCallback,this.retryAttempts=(0,l.Z)(e.retryAttempts,0),this._retryCount=0,(0,l.Z)(e.parseUrl,!0)?this.parseUrl(e.url,!0,!0):this._url=e.url,this._credits=e.credits}function P(e,t){return(0,u.Z)(e)?(0,a.Z)(e):t}function R(e,t,i){if(!i)return(0,s.Z)(e,t);let n=(0,a.Z)(e,!0);for(let e in t)if(t.hasOwnProperty(e)){let i=n[e],r=t[e];(0,u.Z)(i)?(Array.isArray(i)||(i=n[e]=[i]),n[e]=i.concat(r)):n[e]=Array.isArray(r)?r.slice():r}return n}function N(e){let t=e.resource,i=e.flipY,n=e.skipColorSpaceConversion,r=e.preferImageBitmap,o=t.request;o.url=t.url,o.requestFunction=function(){let e=!1;t.isDataUri||t.isBlobUri||(e=t.isCrossOriginUrl);let a=(0,c.Z)();return D._Implementations.createImage(o,e,a,i,n,r),a.promise};let a=w.Z.request(o);if((0,u.Z)(a))return a.catch(function(e){return o.state!==S.Z.FAILED?Promise.reject(e):t.retryOnError(e).then(function(a){return a?(o.state=S.Z.UNISSUED,o.deferred=void 0,N({resource:t,flipY:i,skipColorSpaceConversion:n,preferImageBitmap:r})):Promise.reject(e)})})}function L(e){if(e.state===S.Z.ISSUED||e.state===S.Z.ACTIVE)throw new C.Z("The Resource is already being fetched.");e.state=S.Z.UNISSUED,e.deferred=void 0}D.createIfNeeded=function(e){return e instanceof D?e.getDerivedResource({request:e.request}):"string"!=typeof e?e:new D({url:e})},D.supportsImageBitmapOptions=function(){return(0,u.Z)(n)?n:"function"!=typeof createImageBitmap?n=Promise.resolve(!1):n=D.fetchBlob({url:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAABGdBTUEAAE4g3rEiDgAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAADElEQVQI12Ng6GAAAAEUAIngE3ZiAAAAAElFTkSuQmCC"}).then(function(e){return Promise.all([createImageBitmap(e,{imageOrientation:"flipY",premultiplyAlpha:"none",colorSpaceConversion:"none"}),createImageBitmap(e)])}).then(function(e){let t=(0,m.Z)(e[0]),i=(0,m.Z)(e[1]);return t[1]!==i[1]}).catch(function(){return!1})},Object.defineProperties(D,{isBlobSupported:{get:function(){return O}}}),Object.defineProperties(D.prototype,{queryParameters:{get:function(){return this._queryParameters}},templateValues:{get:function(){return this._templateValues}},url:{get:function(){return this.getUrlComponent(!0,!0)},set:function(e){this.parseUrl(e,!1,!1)}},extension:{get:function(){return p(this._url)}},isDataUri:{get:function(){return(0,Z.Z)(this._url)}},isBlobUri:{get:function(){return(0,_.Z)(this._url)}},isCrossOriginUrl:{get:function(){return(0,g.Z)(this._url)}},hasHeaders:{get:function(){return Object.keys(this.headers).length>0}},credits:{get:function(){return this._credits}}}),D.prototype.toString=function(){return this.getUrlComponent(!0,!0)},D.prototype.parseUrl=function(e,t,i,n){var o;let a=new r(e),s=0===(o=a.query()).length?{}:-1===o.indexOf("=")?{[o]:void 0}:T(o);this._queryParameters=t?R(s,this.queryParameters,i):s,a.search(""),a.fragment(""),(0,u.Z)(n)&&""===a.scheme()&&(a=a.absoluteTo((0,d.Z)(n))),this._url=a.toString()},D.prototype.getUrlComponent=function(e,t){if(this.isDataUri)return this._url;let i=this._url;e&&(i=`${i}${function(e){let t=Object.keys(e);return 0===t.length?"":1!==t.length||(0,u.Z)(e[t[0]])?`?${v(e)}`:`?${t[0]}`}(this.queryParameters)}`),i=i.replace(/%7B/g,"{").replace(/%7D/g,"}");let n=this._templateValues;return Object.keys(n).length>0&&(i=i.replace(/{(.*?)}/g,function(e,t){let i=n[t];return(0,u.Z)(i)?encodeURIComponent(i):e})),t&&(0,u.Z)(this.proxy)&&(i=this.proxy.getURL(i)),i},D.prototype.setQueryParameters=function(e,t){t?this._queryParameters=R(this._queryParameters,e,!1):this._queryParameters=R(e,this._queryParameters,!1)},D.prototype.appendQueryParameters=function(e){this._queryParameters=R(e,this._queryParameters,!0)},D.prototype.setTemplateValues=function(e,t){t?this._templateValues=(0,s.Z)(this._templateValues,e):this._templateValues=(0,s.Z)(e,this._templateValues)},D.prototype.getDerivedResource=function(e){let t=this.clone();if(t._retryCount=0,(0,u.Z)(e.url)){let i=(0,l.Z)(e.preserveQueryParameters,!1);t.parseUrl(e.url,!0,i,this._url)}return(0,u.Z)(e.queryParameters)&&(t._queryParameters=(0,s.Z)(e.queryParameters,t.queryParameters)),(0,u.Z)(e.templateValues)&&(t._templateValues=(0,s.Z)(e.templateValues,t.templateValues)),(0,u.Z)(e.headers)&&(t.headers=(0,s.Z)(e.headers,t.headers)),(0,u.Z)(e.proxy)&&(t.proxy=e.proxy),(0,u.Z)(e.request)&&(t.request=e.request),(0,u.Z)(e.retryCallback)&&(t.retryCallback=e.retryCallback),(0,u.Z)(e.retryAttempts)&&(t.retryAttempts=e.retryAttempts),t},D.prototype.retryOnError=function(e){let t=this.retryCallback;if("function"!=typeof t||this._retryCount>=this.retryAttempts)return Promise.resolve(!1);let i=this;return Promise.resolve(t(this,e)).then(function(e){return++i._retryCount,e})},D.prototype.clone=function(e){return(0,u.Z)(e)?(e._url=this._url,e._queryParameters=(0,a.Z)(this._queryParameters),e._templateValues=(0,a.Z)(this._templateValues),e.headers=(0,a.Z)(this.headers),e.proxy=this.proxy,e.retryCallback=this.retryCallback,e.retryAttempts=this.retryAttempts,e._retryCount=0,e.request=this.request.clone(),e):new D({url:this._url,queryParameters:this.queryParameters,templateValues:this.templateValues,headers:this.headers,proxy:this.proxy,retryCallback:this.retryCallback,retryAttempts:this.retryAttempts,request:this.request.clone(),parseUrl:!1,credits:(0,u.Z)(this.credits)?this.credits.slice():void 0})},D.prototype.getBaseUri=function(e){return f(this.getUrlComponent(e),e)},D.prototype.appendForwardSlash=function(){var e;this._url=((0===(e=this._url).length||"/"!==e[e.length-1])&&(e=`${e}/`),e)},D.prototype.fetchArrayBuffer=function(){return this.fetch({responseType:"arraybuffer"})},D.fetchArrayBuffer=function(e){return new D(e).fetchArrayBuffer()},D.prototype.fetchBlob=function(){return this.fetch({responseType:"blob"})},D.fetchBlob=function(e){return new D(e).fetchBlob()},D.prototype.fetchImage=function(e){let t,i,n;e=(0,l.Z)(e,l.Z.EMPTY_OBJECT);let r=(0,l.Z)(e.preferImageBitmap,!1),o=(0,l.Z)(e.preferBlob,!1),a=(0,l.Z)(e.flipY,!1),s=(0,l.Z)(e.skipColorSpaceConversion,!1);if(L(this.request),!O||this.isDataUri||this.isBlobUri||!this.hasHeaders&&!o)return N({resource:this,flipY:a,skipColorSpaceConversion:s,preferImageBitmap:r});let c=this.fetchBlob();if((0,u.Z)(c))return D.supportsImageBitmapOptions().then(function(e){return t=e&&r,c}).then(function(e){return(0,u.Z)(e)?(n=e,t)?D.createImageBitmapFromBlob(e,{flipY:a,premultiplyAlpha:!1,skipColorSpaceConversion:s}):N({resource:i=new D({url:window.URL.createObjectURL(e)}),flipY:a,skipColorSpaceConversion:s,preferImageBitmap:!1}):void 0}).then(function(e){return(0,u.Z)(e)?(e.blob=n,t||window.URL.revokeObjectURL(i.url),e):void 0}).catch(function(e){return(0,u.Z)(i)&&window.URL.revokeObjectURL(i.url),e.blob=n,Promise.reject(e)})},D.fetchImage=function(e){return new D(e).fetchImage({flipY:e.flipY,skipColorSpaceConversion:e.skipColorSpaceConversion,preferBlob:e.preferBlob,preferImageBitmap:e.preferImageBitmap})},D.prototype.fetchText=function(){return this.fetch({responseType:"text"})},D.fetchText=function(e){return new D(e).fetchText()},D.prototype.fetchJson=function(){let e=this.fetch({responseType:"text",headers:{Accept:"application/json,*/*;q=0.01"}});if((0,u.Z)(e))return e.then(function(e){if((0,u.Z)(e))return JSON.parse(e)})},D.fetchJson=function(e){return new D(e).fetchJson()},D.prototype.fetchXML=function(){return this.fetch({responseType:"document",overrideMimeType:"text/xml"})},D.fetchXML=function(e){return new D(e).fetchXML()},D.prototype.fetchJsonp=function(e){let t;e=(0,l.Z)(e,"callback"),L(this.request);do t=`loadJsonp${b.Z.nextRandomNumber().toString().substring(2,8)}`;while((0,u.Z)(window[t]));return function e(t,i,n){let r={};r[i]=n,t.setQueryParameters(r);let o=t.request,a=t.url;o.url=a,o.requestFunction=function(){let e=(0,c.Z)();return window[n]=function(t){e.resolve(t);try{delete window[n]}catch(e){window[n]=void 0}},D._Implementations.loadAndExecuteScript(a,n,e),e.promise};let s=w.Z.request(o);if((0,u.Z)(s))return s.catch(function(r){return o.state!==S.Z.FAILED?Promise.reject(r):t.retryOnError(r).then(function(a){return a?(o.state=S.Z.UNISSUED,o.deferred=void 0,e(t,i,n)):Promise.reject(r)})})}(this,e,t)},D.fetchJsonp=function(e){return new D(e).fetchJsonp(e.callbackParameterName)},D.prototype._makeRequest=function(e){let t=this;L(t.request);let i=t.request,n=t.url;i.url=n,i.requestFunction=function(){let r=e.responseType,o=(0,s.Z)(e.headers,t.headers),a=e.overrideMimeType,l=e.method,h=e.data,d=(0,c.Z)(),f=D._Implementations.loadWithXhr(n,r,l,h,o,d,a);return(0,u.Z)(f)&&(0,u.Z)(f.abort)&&(i.cancelFunction=function(){f.abort()}),d.promise};let r=w.Z.request(i);if((0,u.Z)(r))return r.then(function(e){return i.cancelFunction=void 0,e}).catch(function(n){return(i.cancelFunction=void 0,i.state!==S.Z.FAILED)?Promise.reject(n):t.retryOnError(n).then(function(r){return r?(i.state=S.Z.UNISSUED,i.deferred=void 0,t.fetch(e)):Promise.reject(n)})})};let M=/^data:(.*?)(;base64)?,(.*)$/;function F(e,t){let i=decodeURIComponent(t);return e?atob(i):i}function z(e,t){let i=F(e,t),n=new ArrayBuffer(i.length),r=new Uint8Array(n);for(let e=0;e<i.length;e++)r[e]=i.charCodeAt(e);return n}D.prototype.fetch=function(e){return(e=P(e,{})).method="GET",this._makeRequest(e)},D.fetch=function(e){return new D(e).fetch({responseType:e.responseType,overrideMimeType:e.overrideMimeType})},D.prototype.delete=function(e){return(e=P(e,{})).method="DELETE",this._makeRequest(e)},D.delete=function(e){return new D(e).delete({responseType:e.responseType,overrideMimeType:e.overrideMimeType,data:e.data})},D.prototype.head=function(e){return(e=P(e,{})).method="HEAD",this._makeRequest(e)},D.head=function(e){return new D(e).head({responseType:e.responseType,overrideMimeType:e.overrideMimeType})},D.prototype.options=function(e){return(e=P(e,{})).method="OPTIONS",this._makeRequest(e)},D.options=function(e){return new D(e).options({responseType:e.responseType,overrideMimeType:e.overrideMimeType})},D.prototype.post=function(e,t){return o.Z.defined("data",e),(t=P(t,{})).method="POST",t.data=e,this._makeRequest(t)},D.post=function(e){return new D(e).post(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})},D.prototype.put=function(e,t){return o.Z.defined("data",e),(t=P(t,{})).method="PUT",t.data=e,this._makeRequest(t)},D.put=function(e){return new D(e).put(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})},D.prototype.patch=function(e,t){return o.Z.defined("data",e),(t=P(t,{})).method="PATCH",t.data=e,this._makeRequest(t)},D.patch=function(e){return new D(e).patch(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})},D._Implementations={},D._Implementations.loadImageElement=function(e,t,i){let n=new Image;n.onload=function(){0===n.naturalWidth&&0===n.naturalHeight&&0===n.width&&0===n.height&&(n.width=300,n.height=150),i.resolve(n)},n.onerror=function(e){i.reject(e)},t&&(A.contains(e)?n.crossOrigin="use-credentials":n.crossOrigin=""),n.src=e},D._Implementations.createImage=function(e,t,i,n,r,o){let a=e.url;D.supportsImageBitmapOptions().then(function(s){if(!(s&&o)){D._Implementations.loadImageElement(a,t,i);return}let l=(0,c.Z)(),h=D._Implementations.loadWithXhr(a,"blob","GET",void 0,void 0,l,void 0,void 0,void 0);return(0,u.Z)(h)&&(0,u.Z)(h.abort)&&(e.cancelFunction=function(){h.abort()}),l.promise.then(function(e){if(!(0,u.Z)(e)){i.reject(new C.Z(`Successfully retrieved ${a} but it contained no content.`));return}return D.createImageBitmapFromBlob(e,{flipY:n,premultiplyAlpha:!1,skipColorSpaceConversion:r})}).then(function(e){i.resolve(e)})}).catch(function(e){i.reject(e)})},D.createImageBitmapFromBlob=function(e,t){return o.Z.defined("options",t),o.Z.typeOf.bool("options.flipY",t.flipY),o.Z.typeOf.bool("options.premultiplyAlpha",t.premultiplyAlpha),o.Z.typeOf.bool("options.skipColorSpaceConversion",t.skipColorSpaceConversion),createImageBitmap(e,{imageOrientation:t.flipY?"flipY":"none",premultiplyAlpha:t.premultiplyAlpha?"premultiply":"none",colorSpaceConversion:t.skipColorSpaceConversion?"none":"default"})};let B="undefined"==typeof XMLHttpRequest;D._Implementations.loadWithXhr=function(e,t,i,n,r,o,a){let s=M.exec(e);if(null!==s){o.resolve(function(e,t){t=(0,l.Z)(t,"");let i=e[1],n=!!e[2],r=e[3];switch(t){case"":case"text":return F(n,r);case"arraybuffer":return z(n,r);case"blob":return new Blob([z(n,r)],{type:i});case"document":return new DOMParser().parseFromString(F(n,r),i);case"json":return JSON.parse(F(n,r));default:throw new h.Z(`Unhandled responseType: ${t}`)}}(s,t));return}if(B){!function(e,t,i,n,r,o,a){fetch(e,{method:i,headers:r}).then(async e=>{if(!e.ok){let t={};e.headers.forEach((e,i)=>{t[i]=e}),o.reject(new x.Z(e.status,e,t));return}switch(t){case"text":o.resolve(e.text());break;case"json":o.resolve(e.json());break;default:o.resolve(new Uint8Array(await e.arrayBuffer()).buffer)}}).catch(()=>{o.reject(new x.Z)})}(e,t,i,0,r,o,0);return}let c=new XMLHttpRequest;if(A.contains(e)&&(c.withCredentials=!0),c.open(i,e,!0),(0,u.Z)(a)&&(0,u.Z)(c.overrideMimeType)&&c.overrideMimeType(a),(0,u.Z)(r))for(let e in r)r.hasOwnProperty(e)&&c.setRequestHeader(e,r[e]);(0,u.Z)(t)&&(c.responseType=t);let d=!1;return"string"==typeof e&&(d=0===e.indexOf("file://")||"undefined"!=typeof window&&"file://"===window.location.origin),c.onload=function(){if((c.status<200||c.status>=300)&&!(d&&0===c.status)){o.reject(new x.Z(c.status,c.response,c.getAllResponseHeaders()));return}let e=c.response,n=c.responseType;if("HEAD"===i||"OPTIONS"===i){let e=c.getAllResponseHeaders().trim().split(/[\r\n]+/),t={};e.forEach(function(e){let i=e.split(": ");t[i.shift()]=i.join(": ")}),o.resolve(t);return}if(204===c.status)o.resolve(void 0);else if((0,u.Z)(e)&&(!(0,u.Z)(t)||n===t))o.resolve(e);else if("json"===t&&"string"==typeof e)try{o.resolve(JSON.parse(e))}catch(e){o.reject(e)}else(""===n||"document"===n)&&(0,u.Z)(c.responseXML)&&c.responseXML.hasChildNodes()?o.resolve(c.responseXML):(""===n||"text"===n)&&(0,u.Z)(c.responseText)?o.resolve(c.responseText):o.reject(new C.Z("Invalid XMLHttpRequest response type."))},c.onerror=function(e){o.reject(new x.Z)},c.send(n),c},D._Implementations.loadAndExecuteScript=function(e,t,i){return y(e,t).catch(function(e){i.reject(e)})},D._DefaultImplementations={},D._DefaultImplementations.createImage=D._Implementations.createImage,D._DefaultImplementations.loadWithXhr=D._Implementations.loadWithXhr,D._DefaultImplementations.loadAndExecuteScript=D._Implementations.loadAndExecuteScript,D.DEFAULT=Object.freeze(new D({url:"undefined"==typeof document?"":document.location.href.split("?")[0]}));var U=D},87:function(e,t,i){"use strict";var n=i(9410);function r(e){let t;this.name="RuntimeError",this.message=e;try{throw Error()}catch(e){t=e.stack}this.stack=t}(0,n.Z)(Object.create)&&(r.prototype=Object.create(Error.prototype),r.prototype.constructor=r),r.prototype.toString=function(){let e=`${this.name}: ${this.message}`;return(0,n.Z)(this.stack)&&(e+=` ${this.stack.toString()}`),e},t.Z=r},55:function(e,t,i){"use strict";var n=i(4989),r=i(570),o=i(4572),a=i(9410),s=i(7998),l=i(9824),c=i(894),u=i(2594),h=i(948),d=i(7022);function f(e,t,i){let n=e._element;if(n===document)return i.x=t.clientX,i.y=t.clientY,i;let r=n.getBoundingClientRect();return i.x=t.clientX-r.left,i.y=t.clientY-r.top,i}function p(e,t){let i=e;return(0,a.Z)(t)&&(i+=`+${t}`),i}function m(e){return e.shiftKey?h.Z.SHIFT:e.ctrlKey?h.Z.CTRL:e.altKey?h.Z.ALT:void 0}let _={LEFT:0,MIDDLE:1,RIGHT:2};function g(e,t,i,n){function r(t){n(e,t)}c.Z.isInternetExplorer()?i.addEventListener(t,r,!1):i.addEventListener(t,r,{capture:!1,passive:!1}),e._removalFunctions.push(function(){i.removeEventListener(t,r,!1)})}let Z={position:new r.Z};function y(e){e._lastSeenTouchEvent=(0,u.Z)()}function b(e){return(0,u.Z)()-e._lastSeenTouchEvent>q.mouseEmulationIgnoreMilliseconds}function v(e,t,i){let n=e.x-t.x,r=e.y-t.y;return Math.sqrt(n*n+r*r)<i}function T(e,t){let i;if(!b(e))return;let n=t.button;if(e._buttonDown[n]=!0,n===_.LEFT)i=d.Z.LEFT_DOWN;else if(n===_.MIDDLE)i=d.Z.MIDDLE_DOWN;else{if(n!==_.RIGHT)return;i=d.Z.RIGHT_DOWN}let o=f(e,t,e._primaryPosition);r.Z.clone(o,e._primaryStartPosition),r.Z.clone(o,e._primaryPreviousPosition);let s=m(t),l=e.getInputAction(i,s);(0,a.Z)(l)&&(r.Z.clone(o,Z.position),l(Z),t.preventDefault())}let E={position:new r.Z},x={position:new r.Z};function w(e,t,i,n){let o=m(n),s=e.getInputAction(t,o),l=e.getInputAction(i,o);if((0,a.Z)(s)||(0,a.Z)(l)){let t=f(e,n,e._primaryPosition);(0,a.Z)(s)&&(r.Z.clone(t,E.position),s(E)),(0,a.Z)(l)&&v(e._primaryStartPosition,t,e._clickPixelTolerance)&&(r.Z.clone(t,x.position),l(x))}}function S(e,t){if(!b(e))return;let i=t.button;(i===_.LEFT||i===_.MIDDLE||i===_.RIGHT)&&(e._buttonDown[_.LEFT]&&(w(e,d.Z.LEFT_UP,d.Z.LEFT_CLICK,t),e._buttonDown[_.LEFT]=!1),e._buttonDown[_.MIDDLE]&&(w(e,d.Z.MIDDLE_UP,d.Z.MIDDLE_CLICK,t),e._buttonDown[_.MIDDLE]=!1),e._buttonDown[_.RIGHT]&&(w(e,d.Z.RIGHT_UP,d.Z.RIGHT_CLICK,t),e._buttonDown[_.RIGHT]=!1))}let C={startPosition:new r.Z,endPosition:new r.Z};function A(e,t){if(!b(e))return;let i=m(t),n=f(e,t,e._primaryPosition),o=e._primaryPreviousPosition,s=e.getInputAction(d.Z.MOUSE_MOVE,i);(0,a.Z)(s)&&(r.Z.clone(o,C.startPosition),r.Z.clone(n,C.endPosition),s(C)),r.Z.clone(n,o),(e._buttonDown[_.LEFT]||e._buttonDown[_.MIDDLE]||e._buttonDown[_.RIGHT])&&t.preventDefault()}let I={position:new r.Z};function O(e,t){let i;if(t.button!==_.LEFT)return;i=d.Z.LEFT_DOUBLE_CLICK;let n=m(t),r=e.getInputAction(i,n);(0,a.Z)(r)&&(f(e,t,I.position),r(I))}function D(e,t){let i;if((0,a.Z)(t.deltaY)){let e=t.deltaMode;i=e===t.DOM_DELTA_PIXEL?-t.deltaY:e===t.DOM_DELTA_LINE?-(40*t.deltaY):-(120*t.deltaY)}else i=t.detail>0?-120*t.detail:t.wheelDelta;if(!(0,a.Z)(i))return;let n=m(t),r=e.getInputAction(d.Z.WHEEL,n);(0,a.Z)(r)&&(r(i),t.preventDefault())}function P(e,t){let i,n,o;y(e);let a=t.changedTouches,s=a.length,l=e._positions;for(i=0;i<s;++i)o=(n=a[i]).identifier,l.set(o,f(e,n,new r.Z));B(e,t);let c=e._previousPositions;for(i=0;i<s;++i)o=(n=a[i]).identifier,c.set(o,r.Z.clone(l.get(o)))}function R(e,t){let i,n;y(e);let r=t.changedTouches,o=r.length,a=e._positions;for(i=0;i<o;++i)n=r[i].identifier,a.remove(n);B(e,t);let s=e._previousPositions;for(i=0;i<o;++i)n=r[i].identifier,s.remove(n)}let N={position:new r.Z},L={position1:new r.Z,position2:new r.Z},M={position:new r.Z},F={position:new r.Z},z={position:new r.Z};function B(e,t){let i,n;let o=m(t),s=e._positions,l=s.length,c=e._isPinching;if(1!==l&&e._buttonDown[_.LEFT]&&(e._buttonDown[_.LEFT]=!1,(0,a.Z)(e._touchHoldTimer)&&(clearTimeout(e._touchHoldTimer),e._touchHoldTimer=void 0),i=e.getInputAction(d.Z.LEFT_UP,o),(0,a.Z)(i)&&(r.Z.clone(e._primaryPosition,M.position),i(M)),0===l&&!e._isTouchHolding&&(n=e.getInputAction(d.Z.LEFT_CLICK,o),(0,a.Z)(n))&&v(e._primaryStartPosition,e._previousPositions.values[0],e._clickPixelTolerance)&&(r.Z.clone(e._primaryPosition,F.position),n(F)),e._isTouchHolding=!1),0===l&&c&&(e._isPinching=!1,i=e.getInputAction(d.Z.PINCH_END,o),(0,a.Z)(i)&&i()),1===l&&!c){let l=s.values[0];r.Z.clone(l,e._primaryPosition),r.Z.clone(l,e._primaryStartPosition),r.Z.clone(l,e._primaryPreviousPosition),e._buttonDown[_.LEFT]=!0,i=e.getInputAction(d.Z.LEFT_DOWN,o),(0,a.Z)(i)&&(r.Z.clone(l,N.position),i(N)),e._touchHoldTimer=setTimeout(function(){!e.isDestroyed()&&(e._touchHoldTimer=void 0,e._isTouchHolding=!0,n=e.getInputAction(d.Z.RIGHT_CLICK,o),(0,a.Z)(n))&&v(e._primaryStartPosition,e._previousPositions.values[0],e._holdPixelTolerance)&&(r.Z.clone(e._primaryPosition,z.position),n(z))},q.touchHoldDelayMilliseconds),t.preventDefault()}2===l&&!c&&(e._isPinching=!0,i=e.getInputAction(d.Z.PINCH_START,o),(0,a.Z)(i)&&(r.Z.clone(s.values[0],L.position1),r.Z.clone(s.values[1],L.position2),i(L),t.preventDefault()))}function U(e,t){let i,n,o;y(e);let s=t.changedTouches,l=s.length,c=e._positions;for(i=0;i<l;++i){o=(n=s[i]).identifier;let t=c.get(o);(0,a.Z)(t)&&f(e,n,t)}H(e,t);let u=e._previousPositions;for(i=0;i<l;++i)o=(n=s[i]).identifier,r.Z.clone(c.get(o),u.get(o))}let k={startPosition:new r.Z,endPosition:new r.Z},V={distance:{startPosition:new r.Z,endPosition:new r.Z},angleAndHeight:{startPosition:new r.Z,endPosition:new r.Z}};function H(e,t){let i;let n=m(t),o=e._positions,s=e._previousPositions,l=o.length;if(1===l&&e._buttonDown[_.LEFT]){let s=o.values[0];r.Z.clone(s,e._primaryPosition);let l=e._primaryPreviousPosition;i=e.getInputAction(d.Z.MOUSE_MOVE,n),(0,a.Z)(i)&&(r.Z.clone(l,k.startPosition),r.Z.clone(s,k.endPosition),i(k)),r.Z.clone(s,l),t.preventDefault()}else if(2===l&&e._isPinching&&(i=e.getInputAction(d.Z.PINCH_MOVE,n),(0,a.Z)(i))){let e=o.values[0],t=o.values[1],n=s.values[0],a=s.values[1],l=t.x-e.x,c=t.y-e.y,u=a.x-n.x,h=a.y-n.y,d=(t.y+e.y)*.125,f=(a.y+n.y)*.125;r.Z.fromElements(0,.25*Math.sqrt(u*u+h*h),V.distance.startPosition),r.Z.fromElements(0,.25*Math.sqrt(l*l+c*c),V.distance.endPosition),r.Z.fromElements(Math.atan2(h,u),f,V.angleAndHeight.startPosition),r.Z.fromElements(Math.atan2(c,l),d,V.angleAndHeight.endPosition),i(V)}}function G(e,t){if(t.target.setPointerCapture(t.pointerId),"touch"===t.pointerType){let i=e._positions,n=t.pointerId;i.set(n,f(e,t,new r.Z)),B(e,t),e._previousPositions.set(n,r.Z.clone(i.get(n)))}else T(e,t)}function j(e,t){if("touch"===t.pointerType){let i=e._positions,n=t.pointerId;i.remove(n),B(e,t),e._previousPositions.remove(n)}else S(e,t)}function W(e,t){if("touch"===t.pointerType){let i=e._positions,n=t.pointerId,o=i.get(n);if(!(0,a.Z)(o))return;f(e,t,o),H(e,t);let s=e._previousPositions;r.Z.clone(i.get(n),s.get(n))}else A(e,t)}function q(e){this._inputEvents={},this._buttonDown={LEFT:!1,MIDDLE:!1,RIGHT:!1},this._isPinching=!1,this._isTouchHolding=!1,this._lastSeenTouchEvent=-q.mouseEmulationIgnoreMilliseconds,this._primaryStartPosition=new r.Z,this._primaryPosition=new r.Z,this._primaryPreviousPosition=new r.Z,this._positions=new n.Z,this._previousPositions=new n.Z,this._removalFunctions=[],this._touchHoldTimer=void 0,this._clickPixelTolerance=5,this._holdPixelTolerance=25,this._element=(0,o.Z)(e,document),function(e){let t;let i=e._element,n=(0,a.Z)(i.disableRootEvents)?i:document;c.Z.supportsPointerEvents()?(g(e,"pointerdown",i,G),g(e,"pointerup",i,j),g(e,"pointermove",i,W),g(e,"pointercancel",i,j)):(g(e,"mousedown",i,T),g(e,"mouseup",n,S),g(e,"mousemove",n,A),g(e,"touchstart",i,P),g(e,"touchend",n,R),g(e,"touchmove",n,U),g(e,"touchcancel",n,R)),g(e,"dblclick",i,O),"onwheel"in i?t="wheel":void 0!==document.onmousewheel?t="mousewheel":t="DOMMouseScroll",g(e,t,i,D)}(this)}q.prototype.setInputAction=function(e,t,i){if(!(0,a.Z)(e))throw new l.Z("action is required.");if(!(0,a.Z)(t))throw new l.Z("type is required.");let n=p(t,i);this._inputEvents[n]=e},q.prototype.getInputAction=function(e,t){if(!(0,a.Z)(e))throw new l.Z("type is required.");let i=p(e,t);return this._inputEvents[i]},q.prototype.removeInputAction=function(e,t){if(!(0,a.Z)(e))throw new l.Z("type is required.");let i=p(e,t);delete this._inputEvents[i]},q.prototype.isDestroyed=function(){return!1},q.prototype.destroy=function(){return function(e){let t=e._removalFunctions;for(let e=0;e<t.length;++e)t[e]()}(this),(0,s.Z)(this)},q.mouseEmulationIgnoreMilliseconds=800,q.touchHoldDelayMilliseconds=1500,t.Z=q},7022:function(e,t){"use strict";t.Z=Object.freeze({LEFT_DOWN:0,LEFT_UP:1,LEFT_CLICK:2,LEFT_DOUBLE_CLICK:3,RIGHT_DOWN:5,RIGHT_UP:6,RIGHT_CLICK:7,MIDDLE_DOWN:10,MIDDLE_UP:11,MIDDLE_CLICK:12,MOUSE_MOVE:15,WHEEL:16,PINCH_START:17,PINCH_END:18,PINCH_MOVE:19})},4186:function(e,t,i){"use strict";var n=i(7559),r=i(4572),o=i(9410),a=i(9824);function s(e){e=(0,r.Z)(e,!0),this.value=s.toValue(e)}Object.defineProperties(s.prototype,{componentDatatype:{get:function(){return n.Z.UNSIGNED_BYTE}},componentsPerAttribute:{get:function(){return 1}},normalize:{get:function(){return!1}}}),s.toValue=function(e,t){if(!(0,o.Z)(e))throw new a.Z("show is required.");return(0,o.Z)(t)?(t[0]=e,t):new Uint8Array([e])},t.Z=s},3358:function(e,t,i){"use strict";var n=i(1486),r=i(698),o=i(4572),a=i(9410),s=i(2501);function l(e){let t=(0,o.Z)(e.radius,1),i={radii:new n.Z(t,t,t),stackPartitions:e.stackPartitions,slicePartitions:e.slicePartitions,subdivisions:e.subdivisions};this._ellipsoidGeometry=new s.Z(i),this._workerName="createSphereOutlineGeometry"}l.packedLength=s.Z.packedLength,l.pack=function(e,t,i){return r.Z.typeOf.object("value",e),s.Z.pack(e._ellipsoidGeometry,t,i)};let c=new s.Z,u={radius:void 0,radii:new n.Z,stackPartitions:void 0,slicePartitions:void 0,subdivisions:void 0};l.unpack=function(e,t,i){let r=s.Z.unpack(e,t,c);return(u.stackPartitions=r._stackPartitions,u.slicePartitions=r._slicePartitions,u.subdivisions=r._subdivisions,(0,a.Z)(i))?(n.Z.clone(r._radii,u.radii),i._ellipsoidGeometry=new s.Z(u),i):(u.radius=r._radii.x,new l(u))},l.createGeometry=function(e){return s.Z.createGeometry(e._ellipsoidGeometry)},t.Z=l},1250:function(e,t,i){"use strict";var n=i(4355),r=i(2059),o=i(4572),a=i(9410),s=i(7998),l=i(9824),c=i(2198),u=i(894),h=i(7230),d=i(8358),f=i(87);function p(){if(!(0,a.Z)(y._canTransferArrayBuffer)){let e=g("transferTypedArrayTest");e.postMessage=(0,o.Z)(e.webkitPostMessage,e.postMessage);let t=new Int8Array([99]);try{e.postMessage({array:t},[t.buffer])}catch(e){return y._canTransferArrayBuffer=!1,y._canTransferArrayBuffer}y._canTransferArrayBuffer=new Promise(t=>{e.onmessage=function(i){let n=i.data.array,r=(0,a.Z)(n)&&99===n[0];t(r),e.terminate(),y._canTransferArrayBuffer=r}})}return y._canTransferArrayBuffer}let m=new c.Z;function _(e){let t;try{t=new Blob([e],{type:"application/javascript"})}catch(n){let i=new(window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder||window.MSBlobBuilder);i.append(e),t=i.getBlob("application/javascript")}return(window.URL||window.webkitURL).createObjectURL(t)}function g(e){let t,i;let o=new n(e),a=0!==o.scheme().length&&0===o.fragment().length,s=e.replace(/\.js$/,""),l={};if((0,h.Z)(e))i=e;else if(!a){let e=(0,r.Z)(`${y._workerModulePrefix}/${s}.js`);(0,h.Z)(e)&&(i=e)}if(i)return t=_(`import "${i}";`),l.type="module",new Worker(t,l);if(!a&&"undefined"!=typeof CESIUM_WORKERS){let e=` importScripts("${_(CESIUM_WORKERS)}"); CesiumWorkers["${s}"](); `;return new Worker(t=_(e),l)}if(t=e,a||(t=(0,r.Z)(`${y._workerModulePrefix+s}.js`)),!u.Z.supportsEsmWebWorkers())throw new f.Z("This browser is not supported. Please update your browser to continue.");return l.type="module",new Worker(t,l)}async function Z(e,t){let i={modulePath:void 0,wasmBinaryFile:void 0,wasmBinary:void 0};if(!u.Z.supportsWebAssembly()){if(!(0,a.Z)(t.fallbackModulePath))throw new f.Z(`This browser does not support Web Assembly, and no backup module was provided for ${e._workerPath}`);return i.modulePath=(0,r.Z)(t.fallbackModulePath),i}i.wasmBinaryFile=(0,r.Z)(t.wasmBinaryFile);let n=await d.Z.fetchArrayBuffer({url:i.wasmBinaryFile});return i.wasmBinary=n,i}function y(e,t){this._workerPath=e,this._maximumActiveTasks=(0,o.Z)(t,Number.POSITIVE_INFINITY),this._activeTasks=0,this._nextID=0,this._webAssemblyPromise=void 0}let b=(e,t,i,n)=>{let r=({data:o})=>{if(o.id===t){if((0,a.Z)(o.error)){let e=o.error;"RuntimeError"===e.name?(e=new f.Z(o.error.message)).stack=o.error.stack:"DeveloperError"===e.name?(e=new l.Z(o.error.message)).stack=o.error.stack:"Error"===e.name&&((e=Error(o.error.message)).stack=o.error.stack),m.raiseEvent(e),n(e)}else m.raiseEvent(),i(o.result);e.removeEventListener("message",r)}};return r},v=[];async function T(e,t,i){let n=await Promise.resolve(p());(0,a.Z)(i)?n||(i.length=0):i=v;let o=e._nextID++,s=new Promise((t,i)=>{e._worker.addEventListener("message",b(e._worker,o,t,i))});return e._worker.postMessage({id:o,baseUrl:r.Z.getCesiumBaseUrl().url,parameters:t,canTransferArrayBuffer:n},i),s}async function E(e,t,i){++e._activeTasks;try{let n=await T(e,t,i);return--e._activeTasks,n}catch(t){throw--e._activeTasks,t}}y.prototype.scheduleTask=function(e,t){if((0,a.Z)(this._worker)||(this._worker=g(this._workerPath)),!(this._activeTasks>=this._maximumActiveTasks))return E(this,e,t)},y.prototype.initWebAssemblyModule=async function(e){if((0,a.Z)(this._webAssemblyPromise))return this._webAssemblyPromise;let t=async()=>{let t;let i=this._worker=g(this._workerPath),n=await Z(this,e),r=await Promise.resolve(p()),o=n.wasmBinary;(0,a.Z)(o)&&r&&(t=[o]);let s=new Promise((e,t)=>{i.onmessage=function({data:i}){(0,a.Z)(i)?e(i.result):t(new f.Z("Could not configure wasm module"))}});return i.postMessage({canTransferArrayBuffer:r,parameters:{webAssemblyConfig:n}},t),s};return this._webAssemblyPromise=t(),this._webAssemblyPromise},y.prototype.isDestroyed=function(){return!1},y.prototype.destroy=function(){return(0,a.Z)(this._worker)&&this._worker.terminate(),(0,s.Z)(this)},y.taskCompletedEvent=m,y._defaultWorkerModulePrefix="Workers/",y._workerModulePrefix=y._defaultWorkerModulePrefix,y._canTransferArrayBuffer=void 0,t.Z=y},7119:function(e,t,i){"use strict";i.d(t,{Z:function(){return eZ}});var n=i(570),r=i(1486),o=i(3065),a=i(2820),s=i(698),l=i(4572),c=i(9410),u=i(9824),h=i(8328),d=function(e,t,i,n,r){this.xPoleWander=e,this.yPoleWander=t,this.xPoleOffset=i,this.yPoleOffset=n,this.ut1MinusUtc=r},f=i(5951),p=i(6255),m=i(8358),_=i(87),g=i(3323),Z=i(9311);function y(e){e=(0,l.Z)(e,l.Z.EMPTY_OBJECT),this._dates=void 0,this._samples=void 0,this._dateColumn=-1,this._xPoleWanderRadiansColumn=-1,this._yPoleWanderRadiansColumn=-1,this._ut1MinusUtcSecondsColumn=-1,this._xCelestialPoleOffsetRadiansColumn=-1,this._yCelestialPoleOffsetRadiansColumn=-1,this._taiMinusUtcSecondsColumn=-1,this._columnCount=0,this._lastIndex=-1,this._addNewLeapSeconds=(0,l.Z)(e.addNewLeapSeconds,!0),(0,c.Z)(e.data)?v(this,e.data):v(this,{columnNames:["dateIso8601","modifiedJulianDateUtc","xPoleWanderRadians","yPoleWanderRadians","ut1MinusUtcSeconds","lengthOfDayCorrectionSeconds","xCelestialPoleOffsetRadians","yCelestialPoleOffsetRadians","taiMinusUtcSeconds"],samples:[]})}function b(e,t){return f.Z.compare(e.julianDate,t)}function v(e,t){let i;if(!(0,c.Z)(t.columnNames))throw new _.Z("Error in loaded EOP data: The columnNames property is required.");if(!(0,c.Z)(t.samples))throw new _.Z("Error in loaded EOP data: The samples property is required.");let n=t.columnNames.indexOf("modifiedJulianDateUtc"),r=t.columnNames.indexOf("xPoleWanderRadians"),o=t.columnNames.indexOf("yPoleWanderRadians"),a=t.columnNames.indexOf("ut1MinusUtcSeconds"),s=t.columnNames.indexOf("xCelestialPoleOffsetRadians"),l=t.columnNames.indexOf("yCelestialPoleOffsetRadians"),u=t.columnNames.indexOf("taiMinusUtcSeconds");if(n<0||r<0||o<0||a<0||s<0||l<0||u<0)throw new _.Z("Error in loaded EOP data: The columnNames property must include modifiedJulianDateUtc, xPoleWanderRadians, yPoleWanderRadians, ut1MinusUtcSeconds, xCelestialPoleOffsetRadians, yCelestialPoleOffsetRadians, and taiMinusUtcSeconds columns");let d=e._samples=t.samples,m=e._dates=[];e._dateColumn=n,e._xPoleWanderRadiansColumn=r,e._yPoleWanderRadiansColumn=o,e._ut1MinusUtcSecondsColumn=a,e._xCelestialPoleOffsetRadiansColumn=s,e._yCelestialPoleOffsetRadiansColumn=l,e._taiMinusUtcSecondsColumn=u,e._columnCount=t.columnNames.length,e._lastIndex=void 0;let y=e._addNewLeapSeconds;for(let t=0,r=d.length;t<r;t+=e._columnCount){let e=d[t+n],r=d[t+u],o=e+g.Z.MODIFIED_JULIAN_DATE_DIFFERENCE,a=new f.Z(o,r,Z.Z.TAI);if(m.push(a),y){if(r!==i&&(0,c.Z)(i)){let e=f.Z.leapSeconds,t=(0,h.Z)(e,a,b);if(t<0){let i=new p.Z(a,r);e.splice(~t,0,i)}}i=r}}}function T(e,t,i,n,r){let o=i*n;r.xPoleWander=t[o+e._xPoleWanderRadiansColumn],r.yPoleWander=t[o+e._yPoleWanderRadiansColumn],r.xPoleOffset=t[o+e._xCelestialPoleOffsetRadiansColumn],r.yPoleOffset=t[o+e._yCelestialPoleOffsetRadiansColumn],r.ut1MinusUtc=t[o+e._ut1MinusUtcSecondsColumn]}function E(e,t,i,n,r,o,a){var s,l,c,u,h;let d=e._columnCount;if(o>t.length-1)return a.xPoleWander=0,a.yPoleWander=0,a.xPoleOffset=0,a.yPoleOffset=0,a.ut1MinusUtc=0,a;let p=t[r],m=t[o];if(p.equals(m)||n.equals(p))return T(e,i,r,d,a),a;if(n.equals(m))return T(e,i,o,d,a),a;let _=f.Z.secondsDifference(n,p)/f.Z.secondsDifference(m,p),g=r*d,Z=o*d,y=i[g+e._ut1MinusUtcSecondsColumn],b=i[Z+e._ut1MinusUtcSecondsColumn],v=b-y;if(v>.5||v<-.5){let t=i[g+e._taiMinusUtcSecondsColumn],r=i[Z+e._taiMinusUtcSecondsColumn];t!==r&&(m.equals(n)?y=b:b-=r-t)}return a.xPoleWander=(s=i[g+e._xPoleWanderRadiansColumn])+_*(i[Z+e._xPoleWanderRadiansColumn]-s),a.yPoleWander=(l=i[g+e._yPoleWanderRadiansColumn])+_*(i[Z+e._yPoleWanderRadiansColumn]-l),a.xPoleOffset=(c=i[g+e._xCelestialPoleOffsetRadiansColumn])+_*(i[Z+e._xCelestialPoleOffsetRadiansColumn]-c),a.yPoleOffset=(u=i[g+e._yCelestialPoleOffsetRadiansColumn])+_*(i[Z+e._yCelestialPoleOffsetRadiansColumn]-u),a.ut1MinusUtc=(h=y)+_*(b-h),a}y.fromUrl=async function(e,t){let i;s.Z.defined("url",e),t=(0,l.Z)(t,l.Z.EMPTY_OBJECT);let n=m.Z.createIfNeeded(e);try{i=await n.fetchJson()}catch(e){throw new _.Z(`An error occurred while retrieving the EOP data from the URL ${n.url}.`)}return new y({addNewLeapSeconds:t.addNewLeapSeconds,data:i})},y.NONE=Object.freeze({compute:function(e,t){return(0,c.Z)(t)?(t.xPoleWander=0,t.yPoleWander=0,t.xPoleOffset=0,t.yPoleOffset=0,t.ut1MinusUtc=0):t=new d(0,0,0,0,0),t}}),y.prototype.compute=function(e,t){if(!(0,c.Z)(this._samples))return;if((0,c.Z)(t)||(t=new d(0,0,0,0,0)),0===this._samples.length)return t.xPoleWander=0,t.yPoleWander=0,t.xPoleOffset=0,t.yPoleOffset=0,t.ut1MinusUtc=0,t;let i=this._dates,n=this._lastIndex,r=0,o=0;if((0,c.Z)(n)){let a=i[n],s=i[n+1],l=f.Z.lessThanOrEquals(a,e),u=!(0,c.Z)(s),h=u||f.Z.greaterThanOrEquals(s,e);if(l&&h)return r=n,!u&&s.equals(e)&&++r,o=r+1,E(this,i,this._samples,e,r,o,t),t}let a=(0,h.Z)(i,e,f.Z.compare,this._dateColumn);return a>=0?(a<i.length-1&&i[a+1].equals(e)&&++a,r=a,o=a):(r=(o=~a)-1)<0&&(r=0),this._lastIndex=r,E(this,i,this._samples,e,r,o,t),t};var x=i(1039),w=i(9872),S=i(2059),C=function(e,t,i){this.x=e,this.y=t,this.s=i};function A(e){e=(0,l.Z)(e,l.Z.EMPTY_OBJECT),this._xysFileUrlTemplate=m.Z.createIfNeeded(e.xysFileUrlTemplate),this._interpolationOrder=(0,l.Z)(e.interpolationOrder,9),this._sampleZeroJulianEphemerisDate=(0,l.Z)(e.sampleZeroJulianEphemerisDate,2442396.5),this._sampleZeroDateTT=new f.Z(this._sampleZeroJulianEphemerisDate,0,Z.Z.TAI),this._stepSizeDays=(0,l.Z)(e.stepSizeDays,1),this._samplesPerXysFile=(0,l.Z)(e.samplesPerXysFile,1e3),this._totalSamples=(0,l.Z)(e.totalSamples,27426),this._samples=Array(3*this._totalSamples),this._chunkDownloadsInProgress=[];let t=this._interpolationOrder,i=this._denominators=Array(t+1),n=this._xTable=Array(t+1),r=Math.pow(this._stepSizeDays,t);for(let e=0;e<=t;++e){i[e]=r,n[e]=e*this._stepSizeDays;for(let n=0;n<=t;++n)n!==e&&(i[e]*=e-n);i[e]=1/i[e]}this._work=Array(t+1),this._coef=Array(t+1)}let I=new f.Z(0,0,Z.Z.TAI);function O(e,t,i){return I.dayNumber=t,I.secondsOfDay=i,f.Z.daysDifference(I,e._sampleZeroDateTT)}function D(e,t){if(e._chunkDownloadsInProgress[t])return e._chunkDownloadsInProgress[t];let i=e._xysFileUrlTemplate,n=((0,c.Z)(i)?i.getDerivedResource({templateValues:{0:t}}):new m.Z({url:(0,S.Z)(`Assets/IAU2006_XYS/IAU2006_XYS_${t}.json`)})).fetchJson().then(function(i){e._chunkDownloadsInProgress[t]=!1;let n=e._samples,r=i.samples,o=t*e._samplesPerXysFile*3;for(let e=0,t=r.length;e<t;++e)n[o+e]=r[e]});return e._chunkDownloadsInProgress[t]=n,n}A.prototype.preload=function(e,t,i,n){let r=O(this,e,t),o=O(this,i,n),a=r/this._stepSizeDays-this._interpolationOrder/2|0;a<0&&(a=0);let s=o/this._stepSizeDays-this._interpolationOrder/2|0+this._interpolationOrder;s>=this._totalSamples&&(s=this._totalSamples-1);let l=a/this._samplesPerXysFile|0,c=s/this._samplesPerXysFile|0,u=[];for(let e=l;e<=c;++e)u.push(D(this,e));return Promise.all(u)},A.prototype.computeXysRadians=function(e,t,i){let n,r;let o=O(this,e,t);if(o<0)return;let a=o/this._stepSizeDays|0;if(a>=this._totalSamples)return;let s=this._interpolationOrder,l=a-(s/2|0);l<0&&(l=0);let u=l+s;u>=this._totalSamples&&(l=(u=this._totalSamples-1)-s)<0&&(l=0);let h=!1,d=this._samples;if((0,c.Z)(d[3*l])||(D(this,l/this._samplesPerXysFile|0),h=!0),(0,c.Z)(d[3*u])||(D(this,u/this._samplesPerXysFile|0),h=!0),h)return;(0,c.Z)(i)?(i.x=0,i.y=0,i.s=0):i=new C(0,0,0);let f=o-l*this._stepSizeDays,p=this._work,m=this._denominators,_=this._coef,g=this._xTable;for(n=0;n<=s;++n)p[n]=f-g[n];for(n=0;n<=s;++n){for(r=0,_[n]=1;r<=s;++r)r!==n&&(_[n]*=p[r]);_[n]*=m[n];let e=(l+n)*3;i.x+=_[n]*d[e++],i.y+=_[n]*d[e++],i.s+=_[n]*d[e]}return i};var P=i(2150),R=i(3186),N=i(4749),L=i(3578);let M={},F={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"}},z={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},B={},U={east:new r.Z,north:new r.Z,up:new r.Z,west:new r.Z,south:new r.Z,down:new r.Z},k=new r.Z,V=new r.Z,H=new r.Z;M.localFrameToFixedFrameGenerator=function(e,t){let i;if(!F.hasOwnProperty(e)||!F[e].hasOwnProperty(t))throw new u.Z("firstAxis and secondAxis must be east, north, up, west, south or down.");let n=F[e][t],o=e+t;return(0,c.Z)(B[o])?i=B[o]:(i=function(i,o,a){if(!(0,c.Z)(i))throw new u.Z("origin is required.");if(isNaN(i.x)||isNaN(i.y)||isNaN(i.z))throw new u.Z("origin has a NaN component");if((0,c.Z)(a)||(a=new N.Z),r.Z.equalsEpsilon(i,r.Z.ZERO,P.Z.EPSILON14))r.Z.unpack(z[e],0,k),r.Z.unpack(z[t],0,V),r.Z.unpack(z[n],0,H);else if(P.Z.equalsEpsilon(i.x,0,P.Z.EPSILON14)&&P.Z.equalsEpsilon(i.y,0,P.Z.EPSILON14)){let o=P.Z.sign(i.z);r.Z.unpack(z[e],0,k),"east"!==e&&"west"!==e&&r.Z.multiplyByScalar(k,o,k),r.Z.unpack(z[t],0,V),"east"!==t&&"west"!==t&&r.Z.multiplyByScalar(V,o,V),r.Z.unpack(z[n],0,H),"east"!==n&&"west"!==n&&r.Z.multiplyByScalar(H,o,H)}else{(o=(0,l.Z)(o,x.Z.WGS84)).geodeticSurfaceNormal(i,U.up);let a=U.up,s=U.east;s.x=-i.y,s.y=i.x,s.z=0,r.Z.normalize(s,U.east),r.Z.cross(a,s,U.north),r.Z.multiplyByScalar(U.up,-1,U.down),r.Z.multiplyByScalar(U.east,-1,U.west),r.Z.multiplyByScalar(U.north,-1,U.south),k=U[e],V=U[t],H=U[n]}return a[0]=k.x,a[1]=k.y,a[2]=k.z,a[3]=0,a[4]=V.x,a[5]=V.y,a[6]=V.z,a[7]=0,a[8]=H.x,a[9]=H.y,a[10]=H.z,a[11]=0,a[12]=i.x,a[13]=i.y,a[14]=i.z,a[15]=1,a},B[o]=i),i},M.eastNorthUpToFixedFrame=M.localFrameToFixedFrameGenerator("east","north"),M.northEastDownToFixedFrame=M.localFrameToFixedFrameGenerator("north","east"),M.northUpEastToFixedFrame=M.localFrameToFixedFrameGenerator("north","up"),M.northWestUpToFixedFrame=M.localFrameToFixedFrameGenerator("north","west");let G=new L.Z,j=new r.Z(1,1,1),W=new N.Z;M.headingPitchRollToFixedFrame=function(e,t,i,n,o){s.Z.typeOf.object("HeadingPitchRoll",t),n=(0,l.Z)(n,M.eastNorthUpToFixedFrame);let a=L.Z.fromHeadingPitchRoll(t,G),c=N.Z.fromTranslationQuaternionRotationScale(r.Z.ZERO,a,j,W);return o=n(e,i,o),N.Z.multiply(o,c,o)};let q=new N.Z,Y=new R.Z;M.headingPitchRollQuaternion=function(e,t,i,n,r){s.Z.typeOf.object("HeadingPitchRoll",t);let o=M.headingPitchRollToFixedFrame(e,t,i,n,q),a=N.Z.getMatrix3(o,Y);return L.Z.fromRotationMatrix(a,r)};let X=new r.Z(1,1,1),$=new r.Z,K=new N.Z,Q=new N.Z,J=new R.Z,ee=new L.Z;M.fixedFrameToHeadingPitchRoll=function(e,t,i,n){s.Z.defined("transform",e),t=(0,l.Z)(t,x.Z.WGS84),i=(0,l.Z)(i,M.eastNorthUpToFixedFrame),(0,c.Z)(n)||(n=new w.Z);let o=N.Z.getTranslation(e,$);if(r.Z.equals(o,r.Z.ZERO))return n.heading=0,n.pitch=0,n.roll=0,n;let a=N.Z.inverseTransformation(i(o,t,K),K),u=N.Z.setScale(e,X,Q);u=N.Z.setTranslation(u,r.Z.ZERO,u),a=N.Z.multiply(a,u,a);let h=L.Z.fromRotationMatrix(N.Z.getMatrix3(a,J),ee);return h=L.Z.normalize(h,h),w.Z.fromQuaternion(h,n)};let et=P.Z.TWO_PI/86400,ei=new f.Z;M.computeTemeToPseudoFixedMatrix=function(e,t){let i;if(!(0,c.Z)(e))throw new u.Z("date is required.");let n=(ei=f.Z.addSeconds(e,-f.Z.computeTaiMinusUtc(e),ei)).dayNumber,r=ei.secondsOfDay,o=n-2451545,a=(24110.54841+(i=r>=43200?(o+.5)/g.Z.DAYS_PER_JULIAN_CENTURY:(o-.5)/g.Z.DAYS_PER_JULIAN_CENTURY)*(8640184.812866+i*(.093104+-.0000062*i)))*et%P.Z.TWO_PI+(r+.5*g.Z.SECONDS_PER_DAY)%g.Z.SECONDS_PER_DAY*(72921158553e-15+11772758384668e-32*(n-2451545.5)),s=Math.cos(a),l=Math.sin(a);return(0,c.Z)(t)?(t[0]=s,t[1]=-l,t[2]=0,t[3]=l,t[4]=s,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new R.Z(s,l,0,-l,s,0,0,0,1)},M.iau2006XysData=new A,M.earthOrientationParameters=y.NONE,M.preloadIcrfFixed=function(e){let t=e.start.dayNumber,i=e.start.secondsOfDay+32.184,n=e.stop.dayNumber,r=e.stop.secondsOfDay+32.184;return M.iau2006XysData.preload(t,i,n,r)},M.computeIcrfToFixedMatrix=function(e,t){if(!(0,c.Z)(e))throw new u.Z("date is required.");(0,c.Z)(t)||(t=new R.Z);let i=M.computeFixedToIcrfMatrix(e,t);if((0,c.Z)(i))return R.Z.transpose(i,t)};let en=new C(0,0,0),er=new d(0,0,0,0,0,0),eo=new R.Z,ea=new R.Z;M.computeFixedToIcrfMatrix=function(e,t){if(!(0,c.Z)(e))throw new u.Z("date is required.");(0,c.Z)(t)||(t=new R.Z);let i=M.earthOrientationParameters.compute(e,er);if(!(0,c.Z)(i))return;let n=e.dayNumber,r=e.secondsOfDay+32.184,o=M.iau2006XysData.computeXysRadians(n,r,en);if(!(0,c.Z)(o))return;let a=o.x+i.xPoleOffset,s=o.y+i.yPoleOffset,l=1/(1+Math.sqrt(1-a*a-s*s));eo[0]=1-l*a*a,eo[3]=-l*a*s,eo[6]=a,eo[1]=-l*a*s,eo[4]=1-l*s*s,eo[7]=s,eo[2]=-a,eo[5]=-s,eo[8]=1-l*(a*a+s*s);let h=R.Z.fromRotationZ(-o.s,ea),d=R.Z.multiply(eo,h,eo),p=e.dayNumber,m=(e.secondsOfDay-f.Z.computeTaiMinusUtc(e)+i.ut1MinusUtc)/g.Z.SECONDS_PER_DAY,_=.779057273264+m+.00273781191135448*(p-2451545+m);_=_%1*P.Z.TWO_PI;let Z=R.Z.fromRotationZ(_,ea),y=R.Z.multiply(d,Z,eo),b=Math.cos(i.xPoleWander),v=Math.cos(i.yPoleWander),T=Math.sin(i.xPoleWander),E=Math.sin(i.yPoleWander),x=n-2451545+r/g.Z.SECONDS_PER_DAY,w=-.000047*(x/=36525)*P.Z.RADIANS_PER_DEGREE/3600,S=Math.cos(w),C=Math.sin(w);return ea[0]=b*S,ea[1]=b*C,ea[2]=T,ea[3]=-v*C+E*T*S,ea[4]=v*S+E*T*C,ea[5]=-E*b,ea[6]=-E*C-v*T*S,ea[7]=E*S-v*T*C,ea[8]=v*b,R.Z.multiply(y,ea,t)};let es=new o.Z;M.pointToWindowCoordinates=function(e,t,i,n){return(n=M.pointToGLWindowCoordinates(e,t,i,n)).y=2*t[5]-n.y,n},M.pointToGLWindowCoordinates=function(e,t,i,r){if(!(0,c.Z)(e))throw new u.Z("modelViewProjectionMatrix is required.");if(!(0,c.Z)(t))throw new u.Z("viewportTransformation is required.");if(!(0,c.Z)(i))throw new u.Z("point is required.");return(0,c.Z)(r)||(r=new n.Z),N.Z.multiplyByVector(e,o.Z.fromElements(i.x,i.y,i.z,1,es),es),o.Z.multiplyByScalar(es,1/es.w,es),N.Z.multiplyByVector(t,es,es),n.Z.fromCartesian4(es,r)};let el=new r.Z,ec=new r.Z,eu=new r.Z;M.rotationMatrixFromPositionVelocity=function(e,t,i,n){if(!(0,c.Z)(e))throw new u.Z("position is required.");if(!(0,c.Z)(t))throw new u.Z("velocity is required.");let o=(0,l.Z)(i,x.Z.WGS84).geodeticSurfaceNormal(e,el),a=r.Z.cross(t,o,ec);r.Z.equalsEpsilon(a,r.Z.ZERO,P.Z.EPSILON6)&&(a=r.Z.clone(r.Z.UNIT_X,a));let s=r.Z.cross(a,t,eu);return r.Z.normalize(s,s),r.Z.cross(t,s,a),r.Z.negate(a,a),r.Z.normalize(a,a),(0,c.Z)(n)||(n=new R.Z),n[0]=t.x,n[1]=t.y,n[2]=t.z,n[3]=a.x,n[4]=a.y,n[5]=a.z,n[6]=s.x,n[7]=s.y,n[8]=s.z,n};let eh=new N.Z(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1),ed=new a.Z,ef=new r.Z,ep=new r.Z,em=new R.Z,e_=new N.Z,eg=new N.Z;M.basisTo2D=function(e,t,i){let n;if(!(0,c.Z)(e))throw new u.Z("projection is required.");if(!(0,c.Z)(t))throw new u.Z("matrix is required.");if(!(0,c.Z)(i))throw new u.Z("result is required.");let o=N.Z.getTranslation(t,ep),a=e.ellipsoid;if(r.Z.equals(o,r.Z.ZERO))n=r.Z.clone(r.Z.ZERO,ef);else{let t=a.cartesianToCartographic(o,ed);n=e.project(t,ef),r.Z.fromElements(n.z,n.x,n.y,n)}let s=M.eastNorthUpToFixedFrame(o,a,e_),l=N.Z.inverseTransformation(s,eg),h=N.Z.getMatrix3(t,em),d=N.Z.multiplyByMatrix3(l,h,i);return N.Z.multiply(eh,d,i),N.Z.setTranslation(i,n,i),i},M.wgs84To2DModelMatrix=function(e,t,i){if(!(0,c.Z)(e))throw new u.Z("projection is required.");if(!(0,c.Z)(t))throw new u.Z("center is required.");if(!(0,c.Z)(i))throw new u.Z("result is required.");let n=e.ellipsoid,o=M.eastNorthUpToFixedFrame(t,n,e_),a=N.Z.inverseTransformation(o,eg),s=n.cartesianToCartographic(t,ed),l=e.project(s,ef);r.Z.fromElements(l.z,l.x,l.y,l);let h=N.Z.fromTranslation(l,e_);return N.Z.multiply(eh,a,i),N.Z.multiply(h,i,i),i};var eZ=M},8564:function(e,t,i){"use strict";var n=i(1486),r=i(4572),o=i(9410),a=i(3578);let s=new n.Z(1,1,1),l=n.Z.ZERO,c=a.Z.IDENTITY;function u(e,t,i){this.translation=n.Z.clone((0,r.Z)(e,l)),this.rotation=a.Z.clone((0,r.Z)(t,c)),this.scale=n.Z.clone((0,r.Z)(i,s))}u.prototype.equals=function(e){return this===e||(0,o.Z)(e)&&n.Z.equals(this.translation,e.translation)&&a.Z.equals(this.rotation,e.rotation)&&n.Z.equals(this.scale,e.scale)},t.Z=u},4915:function(e,t,i){"use strict";var n=i(4572),r=i(9410),o=i(9824);function a(e){e=(0,n.Z)(e,n.Z.EMPTY_OBJECT),this.position=(0,n.Z)(e.position,!1),this.normal=(0,n.Z)(e.normal,!1),this.st=(0,n.Z)(e.st,!1),this.bitangent=(0,n.Z)(e.bitangent,!1),this.tangent=(0,n.Z)(e.tangent,!1),this.color=(0,n.Z)(e.color,!1)}a.POSITION_ONLY=Object.freeze(new a({position:!0})),a.POSITION_AND_NORMAL=Object.freeze(new a({position:!0,normal:!0})),a.POSITION_NORMAL_AND_ST=Object.freeze(new a({position:!0,normal:!0,st:!0})),a.POSITION_AND_ST=Object.freeze(new a({position:!0,st:!0})),a.POSITION_AND_COLOR=Object.freeze(new a({position:!0,color:!0})),a.ALL=Object.freeze(new a({position:!0,normal:!0,st:!0,tangent:!0,bitangent:!0})),a.DEFAULT=a.POSITION_NORMAL_AND_ST,a.packedLength=6,a.pack=function(e,t,i){if(!(0,r.Z)(e))throw new o.Z("value is required");if(!(0,r.Z)(t))throw new o.Z("array is required");return i=(0,n.Z)(i,0),t[i++]=e.position?1:0,t[i++]=e.normal?1:0,t[i++]=e.st?1:0,t[i++]=e.tangent?1:0,t[i++]=e.bitangent?1:0,t[i]=e.color?1:0,t},a.unpack=function(e,t,i){if(!(0,r.Z)(e))throw new o.Z("array is required");return t=(0,n.Z)(t,0),(0,r.Z)(i)||(i=new a),i.position=1===e[t++],i.normal=1===e[t++],i.st=1===e[t++],i.tangent=1===e[t++],i.bitangent=1===e[t++],i.color=1===e[t],i},a.clone=function(e,t){if((0,r.Z)(e))return(0,r.Z)(t)||(t=new a),t.position=e.position,t.normal=e.normal,t.st=e.st,t.tangent=e.tangent,t.bitangent=e.bitangent,t.color=e.color,t},t.Z=a},7330:function(e,t,i){"use strict";var n=i(1486),r=i(2820),o=i(9824),a=i(9410);let s={};s.getHeight=function(e,t,i){if(!Number.isFinite(t))throw new o.Z("scale must be a finite number.");if(!Number.isFinite(i))throw new o.Z("relativeHeight must be a finite number.");return(e-i)*t+i};let l=new r.Z;s.getPosition=function(e,t,i,r,o){let c=t.cartesianToCartographic(e,l);if(!(0,a.Z)(c))return n.Z.clone(e,o);let u=s.getHeight(c.height,i,r);return n.Z.fromRadians(c.longitude,c.latitude,u,t,o)},t.Z=s},512:function(e,t){"use strict";t.Z=Object.freeze({DEPTH_BUFFER_BIT:256,STENCIL_BUFFER_BIT:1024,COLOR_BUFFER_BIT:16384,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,ZERO:0,ONE:1,SRC_COLOR:768,ONE_MINUS_SRC_COLOR:769,SRC_ALPHA:770,ONE_MINUS_SRC_ALPHA:771,DST_ALPHA:772,ONE_MINUS_DST_ALPHA:773,DST_COLOR:774,ONE_MINUS_DST_COLOR:775,SRC_ALPHA_SATURATE:776,FUNC_ADD:32774,BLEND_EQUATION:32777,BLEND_EQUATION_RGB:32777,BLEND_EQUATION_ALPHA:34877,FUNC_SUBTRACT:32778,FUNC_REVERSE_SUBTRACT:32779,BLEND_DST_RGB:32968,BLEND_SRC_RGB:32969,BLEND_DST_ALPHA:32970,BLEND_SRC_ALPHA:32971,CONSTANT_COLOR:32769,ONE_MINUS_CONSTANT_COLOR:32770,CONSTANT_ALPHA:32771,ONE_MINUS_CONSTANT_ALPHA:32772,BLEND_COLOR:32773,ARRAY_BUFFER:34962,ELEMENT_ARRAY_BUFFER:34963,ARRAY_BUFFER_BINDING:34964,ELEMENT_ARRAY_BUFFER_BINDING:34965,STREAM_DRAW:35040,STATIC_DRAW:35044,DYNAMIC_DRAW:35048,BUFFER_SIZE:34660,BUFFER_USAGE:34661,CURRENT_VERTEX_ATTRIB:34342,FRONT:1028,BACK:1029,FRONT_AND_BACK:1032,CULL_FACE:2884,BLEND:3042,DITHER:3024,STENCIL_TEST:2960,DEPTH_TEST:2929,SCISSOR_TEST:3089,POLYGON_OFFSET_FILL:32823,SAMPLE_ALPHA_TO_COVERAGE:32926,SAMPLE_COVERAGE:32928,NO_ERROR:0,INVALID_ENUM:1280,INVALID_VALUE:1281,INVALID_OPERATION:1282,OUT_OF_MEMORY:1285,CW:2304,CCW:2305,LINE_WIDTH:2849,ALIASED_POINT_SIZE_RANGE:33901,ALIASED_LINE_WIDTH_RANGE:33902,CULL_FACE_MODE:2885,FRONT_FACE:2886,DEPTH_RANGE:2928,DEPTH_WRITEMASK:2930,DEPTH_CLEAR_VALUE:2931,DEPTH_FUNC:2932,STENCIL_CLEAR_VALUE:2961,STENCIL_FUNC:2962,STENCIL_FAIL:2964,STENCIL_PASS_DEPTH_FAIL:2965,STENCIL_PASS_DEPTH_PASS:2966,STENCIL_REF:2967,STENCIL_VALUE_MASK:2963,STENCIL_WRITEMASK:2968,STENCIL_BACK_FUNC:34816,STENCIL_BACK_FAIL:34817,STENCIL_BACK_PASS_DEPTH_FAIL:34818,STENCIL_BACK_PASS_DEPTH_PASS:34819,STENCIL_BACK_REF:36003,STENCIL_BACK_VALUE_MASK:36004,STENCIL_BACK_WRITEMASK:36005,VIEWPORT:2978,SCISSOR_BOX:3088,COLOR_CLEAR_VALUE:3106,COLOR_WRITEMASK:3107,UNPACK_ALIGNMENT:3317,PACK_ALIGNMENT:3333,MAX_TEXTURE_SIZE:3379,MAX_VIEWPORT_DIMS:3386,SUBPIXEL_BITS:3408,RED_BITS:3410,GREEN_BITS:3411,BLUE_BITS:3412,ALPHA_BITS:3413,DEPTH_BITS:3414,STENCIL_BITS:3415,POLYGON_OFFSET_UNITS:10752,POLYGON_OFFSET_FACTOR:32824,TEXTURE_BINDING_2D:32873,SAMPLE_BUFFERS:32936,SAMPLES:32937,SAMPLE_COVERAGE_VALUE:32938,SAMPLE_COVERAGE_INVERT:32939,COMPRESSED_TEXTURE_FORMATS:34467,DONT_CARE:4352,FASTEST:4353,NICEST:4354,GENERATE_MIPMAP_HINT:33170,BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,DEPTH_COMPONENT:6402,ALPHA:6406,RGB:6407,RGBA:6408,LUMINANCE:6409,LUMINANCE_ALPHA:6410,UNSIGNED_SHORT_4_4_4_4:32819,UNSIGNED_SHORT_5_5_5_1:32820,UNSIGNED_SHORT_5_6_5:33635,FRAGMENT_SHADER:35632,VERTEX_SHADER:35633,MAX_VERTEX_ATTRIBS:34921,MAX_VERTEX_UNIFORM_VECTORS:36347,MAX_VARYING_VECTORS:36348,MAX_COMBINED_TEXTURE_IMAGE_UNITS:35661,MAX_VERTEX_TEXTURE_IMAGE_UNITS:35660,MAX_TEXTURE_IMAGE_UNITS:34930,MAX_FRAGMENT_UNIFORM_VECTORS:36349,SHADER_TYPE:35663,DELETE_STATUS:35712,LINK_STATUS:35714,VALIDATE_STATUS:35715,ATTACHED_SHADERS:35717,ACTIVE_UNIFORMS:35718,ACTIVE_ATTRIBUTES:35721,SHADING_LANGUAGE_VERSION:35724,CURRENT_PROGRAM:35725,NEVER:512,LESS:513,EQUAL:514,LEQUAL:515,GREATER:516,NOTEQUAL:517,GEQUAL:518,ALWAYS:519,KEEP:7680,REPLACE:7681,INCR:7682,DECR:7683,INVERT:5386,INCR_WRAP:34055,DECR_WRAP:34056,VENDOR:7936,RENDERER:7937,VERSION:7938,NEAREST:9728,LINEAR:9729,NEAREST_MIPMAP_NEAREST:9984,LINEAR_MIPMAP_NEAREST:9985,NEAREST_MIPMAP_LINEAR:9986,LINEAR_MIPMAP_LINEAR:9987,TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,TEXTURE_2D:3553,TEXTURE:5890,TEXTURE_CUBE_MAP:34067,TEXTURE_BINDING_CUBE_MAP:34068,TEXTURE_CUBE_MAP_POSITIVE_X:34069,TEXTURE_CUBE_MAP_NEGATIVE_X:34070,TEXTURE_CUBE_MAP_POSITIVE_Y:34071,TEXTURE_CUBE_MAP_NEGATIVE_Y:34072,TEXTURE_CUBE_MAP_POSITIVE_Z:34073,TEXTURE_CUBE_MAP_NEGATIVE_Z:34074,MAX_CUBE_MAP_TEXTURE_SIZE:34076,TEXTURE0:33984,TEXTURE1:33985,TEXTURE2:33986,TEXTURE3:33987,TEXTURE4:33988,TEXTURE5:33989,TEXTURE6:33990,TEXTURE7:33991,TEXTURE8:33992,TEXTURE9:33993,TEXTURE10:33994,TEXTURE11:33995,TEXTURE12:33996,TEXTURE13:33997,TEXTURE14:33998,TEXTURE15:33999,TEXTURE16:34e3,TEXTURE17:34001,TEXTURE18:34002,TEXTURE19:34003,TEXTURE20:34004,TEXTURE21:34005,TEXTURE22:34006,TEXTURE23:34007,TEXTURE24:34008,TEXTURE25:34009,TEXTURE26:34010,TEXTURE27:34011,TEXTURE28:34012,TEXTURE29:34013,TEXTURE30:34014,TEXTURE31:34015,ACTIVE_TEXTURE:34016,REPEAT:10497,CLAMP_TO_EDGE:33071,MIRRORED_REPEAT:33648,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,INT_VEC2:35667,INT_VEC3:35668,INT_VEC4:35669,BOOL:35670,BOOL_VEC2:35671,BOOL_VEC3:35672,BOOL_VEC4:35673,FLOAT_MAT2:35674,FLOAT_MAT3:35675,FLOAT_MAT4:35676,SAMPLER_2D:35678,SAMPLER_CUBE:35680,VERTEX_ATTRIB_ARRAY_ENABLED:34338,VERTEX_ATTRIB_ARRAY_SIZE:34339,VERTEX_ATTRIB_ARRAY_STRIDE:34340,VERTEX_ATTRIB_ARRAY_TYPE:34341,VERTEX_ATTRIB_ARRAY_NORMALIZED:34922,VERTEX_ATTRIB_ARRAY_POINTER:34373,VERTEX_ATTRIB_ARRAY_BUFFER_BINDING:34975,IMPLEMENTATION_COLOR_READ_TYPE:35738,IMPLEMENTATION_COLOR_READ_FORMAT:35739,COMPILE_STATUS:35713,LOW_FLOAT:36336,MEDIUM_FLOAT:36337,HIGH_FLOAT:36338,LOW_INT:36339,MEDIUM_INT:36340,HIGH_INT:36341,FRAMEBUFFER:36160,RENDERBUFFER:36161,RGBA4:32854,RGB5_A1:32855,RGB565:36194,DEPTH_COMPONENT16:33189,STENCIL_INDEX:6401,STENCIL_INDEX8:36168,DEPTH_STENCIL:34041,RENDERBUFFER_WIDTH:36162,RENDERBUFFER_HEIGHT:36163,RENDERBUFFER_INTERNAL_FORMAT:36164,RENDERBUFFER_RED_SIZE:36176,RENDERBUFFER_GREEN_SIZE:36177,RENDERBUFFER_BLUE_SIZE:36178,RENDERBUFFER_ALPHA_SIZE:36179,RENDERBUFFER_DEPTH_SIZE:36180,RENDERBUFFER_STENCIL_SIZE:36181,FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE:36048,FRAMEBUFFER_ATTACHMENT_OBJECT_NAME:36049,FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL:36050,FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE:36051,COLOR_ATTACHMENT0:36064,DEPTH_ATTACHMENT:36096,STENCIL_ATTACHMENT:36128,DEPTH_STENCIL_ATTACHMENT:33306,NONE:0,FRAMEBUFFER_COMPLETE:36053,FRAMEBUFFER_INCOMPLETE_ATTACHMENT:36054,FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:36055,FRAMEBUFFER_INCOMPLETE_DIMENSIONS:36057,FRAMEBUFFER_UNSUPPORTED:36061,FRAMEBUFFER_BINDING:36006,RENDERBUFFER_BINDING:36007,MAX_RENDERBUFFER_SIZE:34024,INVALID_FRAMEBUFFER_OPERATION:1286,UNPACK_FLIP_Y_WEBGL:37440,UNPACK_PREMULTIPLY_ALPHA_WEBGL:37441,CONTEXT_LOST_WEBGL:37442,UNPACK_COLORSPACE_CONVERSION_WEBGL:37443,BROWSER_DEFAULT_WEBGL:37444,COMPRESSED_RGB_S3TC_DXT1_EXT:33776,COMPRESSED_RGBA_S3TC_DXT1_EXT:33777,COMPRESSED_RGBA_S3TC_DXT3_EXT:33778,COMPRESSED_RGBA_S3TC_DXT5_EXT:33779,COMPRESSED_RGB_PVRTC_4BPPV1_IMG:35840,COMPRESSED_RGB_PVRTC_2BPPV1_IMG:35841,COMPRESSED_RGBA_PVRTC_4BPPV1_IMG:35842,COMPRESSED_RGBA_PVRTC_2BPPV1_IMG:35843,COMPRESSED_RGBA_ASTC_4x4_WEBGL:37808,COMPRESSED_RGB_ETC1_WEBGL:36196,COMPRESSED_RGBA_BPTC_UNORM:36492,HALF_FLOAT_OES:36193,DOUBLE:5130,READ_BUFFER:3074,UNPACK_ROW_LENGTH:3314,UNPACK_SKIP_ROWS:3315,UNPACK_SKIP_PIXELS:3316,PACK_ROW_LENGTH:3330,PACK_SKIP_ROWS:3331,PACK_SKIP_PIXELS:3332,COLOR:6144,DEPTH:6145,STENCIL:6146,RED:6403,RGB8:32849,RGBA8:32856,RGB10_A2:32857,TEXTURE_BINDING_3D:32874,UNPACK_SKIP_IMAGES:32877,UNPACK_IMAGE_HEIGHT:32878,TEXTURE_3D:32879,TEXTURE_WRAP_R:32882,MAX_3D_TEXTURE_SIZE:32883,UNSIGNED_INT_2_10_10_10_REV:33640,MAX_ELEMENTS_VERTICES:33e3,MAX_ELEMENTS_INDICES:33001,TEXTURE_MIN_LOD:33082,TEXTURE_MAX_LOD:33083,TEXTURE_BASE_LEVEL:33084,TEXTURE_MAX_LEVEL:33085,MIN:32775,MAX:32776,DEPTH_COMPONENT24:33190,MAX_TEXTURE_LOD_BIAS:34045,TEXTURE_COMPARE_MODE:34892,TEXTURE_COMPARE_FUNC:34893,CURRENT_QUERY:34917,QUERY_RESULT:34918,QUERY_RESULT_AVAILABLE:34919,STREAM_READ:35041,STREAM_COPY:35042,STATIC_READ:35045,STATIC_COPY:35046,DYNAMIC_READ:35049,DYNAMIC_COPY:35050,MAX_DRAW_BUFFERS:34852,DRAW_BUFFER0:34853,DRAW_BUFFER1:34854,DRAW_BUFFER2:34855,DRAW_BUFFER3:34856,DRAW_BUFFER4:34857,DRAW_BUFFER5:34858,DRAW_BUFFER6:34859,DRAW_BUFFER7:34860,DRAW_BUFFER8:34861,DRAW_BUFFER9:34862,DRAW_BUFFER10:34863,DRAW_BUFFER11:34864,DRAW_BUFFER12:34865,DRAW_BUFFER13:34866,DRAW_BUFFER14:34867,DRAW_BUFFER15:34868,MAX_FRAGMENT_UNIFORM_COMPONENTS:35657,MAX_VERTEX_UNIFORM_COMPONENTS:35658,SAMPLER_3D:35679,SAMPLER_2D_SHADOW:35682,FRAGMENT_SHADER_DERIVATIVE_HINT:35723,PIXEL_PACK_BUFFER:35051,PIXEL_UNPACK_BUFFER:35052,PIXEL_PACK_BUFFER_BINDING:35053,PIXEL_UNPACK_BUFFER_BINDING:35055,FLOAT_MAT2x3:35685,FLOAT_MAT2x4:35686,FLOAT_MAT3x2:35687,FLOAT_MAT3x4:35688,FLOAT_MAT4x2:35689,FLOAT_MAT4x3:35690,SRGB:35904,SRGB8:35905,SRGB8_ALPHA8:35907,COMPARE_REF_TO_TEXTURE:34894,RGBA32F:34836,RGB32F:34837,RGBA16F:34842,RGB16F:34843,VERTEX_ATTRIB_ARRAY_INTEGER:35069,MAX_ARRAY_TEXTURE_LAYERS:35071,MIN_PROGRAM_TEXEL_OFFSET:35076,MAX_PROGRAM_TEXEL_OFFSET:35077,MAX_VARYING_COMPONENTS:35659,TEXTURE_2D_ARRAY:35866,TEXTURE_BINDING_2D_ARRAY:35869,R11F_G11F_B10F:35898,UNSIGNED_INT_10F_11F_11F_REV:35899,RGB9_E5:35901,UNSIGNED_INT_5_9_9_9_REV:35902,TRANSFORM_FEEDBACK_BUFFER_MODE:35967,MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS:35968,TRANSFORM_FEEDBACK_VARYINGS:35971,TRANSFORM_FEEDBACK_BUFFER_START:35972,TRANSFORM_FEEDBACK_BUFFER_SIZE:35973,TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN:35976,RASTERIZER_DISCARD:35977,MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS:35978,MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS:35979,INTERLEAVED_ATTRIBS:35980,SEPARATE_ATTRIBS:35981,TRANSFORM_FEEDBACK_BUFFER:35982,TRANSFORM_FEEDBACK_BUFFER_BINDING:35983,RGBA32UI:36208,RGB32UI:36209,RGBA16UI:36214,RGB16UI:36215,RGBA8UI:36220,RGB8UI:36221,RGBA32I:36226,RGB32I:36227,RGBA16I:36232,RGB16I:36233,RGBA8I:36238,RGB8I:36239,RED_INTEGER:36244,RGB_INTEGER:36248,RGBA_INTEGER:36249,SAMPLER_2D_ARRAY:36289,SAMPLER_2D_ARRAY_SHADOW:36292,SAMPLER_CUBE_SHADOW:36293,UNSIGNED_INT_VEC2:36294,UNSIGNED_INT_VEC3:36295,UNSIGNED_INT_VEC4:36296,INT_SAMPLER_2D:36298,INT_SAMPLER_3D:36299,INT_SAMPLER_CUBE:36300,INT_SAMPLER_2D_ARRAY:36303,UNSIGNED_INT_SAMPLER_2D:36306,UNSIGNED_INT_SAMPLER_3D:36307,UNSIGNED_INT_SAMPLER_CUBE:36308,UNSIGNED_INT_SAMPLER_2D_ARRAY:36311,DEPTH_COMPONENT32F:36012,DEPTH32F_STENCIL8:36013,FLOAT_32_UNSIGNED_INT_24_8_REV:36269,FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING:33296,FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE:33297,FRAMEBUFFER_ATTACHMENT_RED_SIZE:33298,FRAMEBUFFER_ATTACHMENT_GREEN_SIZE:33299,FRAMEBUFFER_ATTACHMENT_BLUE_SIZE:33300,FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE:33301,FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE:33302,FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE:33303,FRAMEBUFFER_DEFAULT:33304,UNSIGNED_INT_24_8:34042,DEPTH24_STENCIL8:35056,UNSIGNED_NORMALIZED:35863,DRAW_FRAMEBUFFER_BINDING:36006,READ_FRAMEBUFFER:36008,DRAW_FRAMEBUFFER:36009,READ_FRAMEBUFFER_BINDING:36010,RENDERBUFFER_SAMPLES:36011,FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER:36052,MAX_COLOR_ATTACHMENTS:36063,COLOR_ATTACHMENT1:36065,COLOR_ATTACHMENT2:36066,COLOR_ATTACHMENT3:36067,COLOR_ATTACHMENT4:36068,COLOR_ATTACHMENT5:36069,COLOR_ATTACHMENT6:36070,COLOR_ATTACHMENT7:36071,COLOR_ATTACHMENT8:36072,COLOR_ATTACHMENT9:36073,COLOR_ATTACHMENT10:36074,COLOR_ATTACHMENT11:36075,COLOR_ATTACHMENT12:36076,COLOR_ATTACHMENT13:36077,COLOR_ATTACHMENT14:36078,COLOR_ATTACHMENT15:36079,FRAMEBUFFER_INCOMPLETE_MULTISAMPLE:36182,MAX_SAMPLES:36183,HALF_FLOAT:5131,RG:33319,RG_INTEGER:33320,R8:33321,RG8:33323,R16F:33325,R32F:33326,RG16F:33327,RG32F:33328,R8I:33329,R8UI:33330,R16I:33331,R16UI:33332,R32I:33333,R32UI:33334,RG8I:33335,RG8UI:33336,RG16I:33337,RG16UI:33338,RG32I:33339,RG32UI:33340,VERTEX_ARRAY_BINDING:34229,R8_SNORM:36756,RG8_SNORM:36757,RGB8_SNORM:36758,RGBA8_SNORM:36759,SIGNED_NORMALIZED:36764,COPY_READ_BUFFER:36662,COPY_WRITE_BUFFER:36663,COPY_READ_BUFFER_BINDING:36662,COPY_WRITE_BUFFER_BINDING:36663,UNIFORM_BUFFER:35345,UNIFORM_BUFFER_BINDING:35368,UNIFORM_BUFFER_START:35369,UNIFORM_BUFFER_SIZE:35370,MAX_VERTEX_UNIFORM_BLOCKS:35371,MAX_FRAGMENT_UNIFORM_BLOCKS:35373,MAX_COMBINED_UNIFORM_BLOCKS:35374,MAX_UNIFORM_BUFFER_BINDINGS:35375,MAX_UNIFORM_BLOCK_SIZE:35376,MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS:35377,MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS:35379,UNIFORM_BUFFER_OFFSET_ALIGNMENT:35380,ACTIVE_UNIFORM_BLOCKS:35382,UNIFORM_TYPE:35383,UNIFORM_SIZE:35384,UNIFORM_BLOCK_INDEX:35386,UNIFORM_OFFSET:35387,UNIFORM_ARRAY_STRIDE:35388,UNIFORM_MATRIX_STRIDE:35389,UNIFORM_IS_ROW_MAJOR:35390,UNIFORM_BLOCK_BINDING:35391,UNIFORM_BLOCK_DATA_SIZE:35392,UNIFORM_BLOCK_ACTIVE_UNIFORMS:35394,UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES:35395,UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER:35396,UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER:35398,INVALID_INDEX:4294967295,MAX_VERTEX_OUTPUT_COMPONENTS:37154,MAX_FRAGMENT_INPUT_COMPONENTS:37157,MAX_SERVER_WAIT_TIMEOUT:37137,OBJECT_TYPE:37138,SYNC_CONDITION:37139,SYNC_STATUS:37140,SYNC_FLAGS:37141,SYNC_FENCE:37142,SYNC_GPU_COMMANDS_COMPLETE:37143,UNSIGNALED:37144,SIGNALED:37145,ALREADY_SIGNALED:37146,TIMEOUT_EXPIRED:37147,CONDITION_SATISFIED:37148,WAIT_FAILED:37149,SYNC_FLUSH_COMMANDS_BIT:1,VERTEX_ATTRIB_ARRAY_DIVISOR:35070,ANY_SAMPLES_PASSED:35887,ANY_SAMPLES_PASSED_CONSERVATIVE:36202,SAMPLER_BINDING:35097,RGB10_A2UI:36975,INT_2_10_10_10_REV:36255,TRANSFORM_FEEDBACK:36386,TRANSFORM_FEEDBACK_PAUSED:36387,TRANSFORM_FEEDBACK_ACTIVE:36388,TRANSFORM_FEEDBACK_BINDING:36389,COMPRESSED_R11_EAC:37488,COMPRESSED_SIGNED_R11_EAC:37489,COMPRESSED_RG11_EAC:37490,COMPRESSED_SIGNED_RG11_EAC:37491,COMPRESSED_RGB8_ETC2:37492,COMPRESSED_SRGB8_ETC2:37493,COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:37494,COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:37495,COMPRESSED_RGBA8_ETC2_EAC:37496,COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:37497,TEXTURE_IMMUTABLE_FORMAT:37167,MAX_ELEMENT_INDEX:36203,TEXTURE_IMMUTABLE_LEVELS:33503,MAX_TEXTURE_MAX_ANISOTROPY_EXT:34047})},9676:function(e,t,i){"use strict";var n=i(1486),r=i(2820),o=i(4572),a=i(9410),s=i(9824),l=i(1039),c=i(2150);function u(e){this._ellipsoid=(0,o.Z)(e,l.Z.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}Object.defineProperties(u.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),u.mercatorAngleToGeodeticLatitude=function(e){return c.Z.PI_OVER_TWO-2*Math.atan(Math.exp(-e))},u.geodeticLatitudeToMercatorAngle=function(e){e>u.MaximumLatitude?e=u.MaximumLatitude:e<-u.MaximumLatitude&&(e=-u.MaximumLatitude);let t=Math.sin(e);return .5*Math.log((1+t)/(1-t))},u.MaximumLatitude=u.mercatorAngleToGeodeticLatitude(Math.PI),u.prototype.project=function(e,t){let i=this._semimajorAxis,r=e.longitude*i,o=u.geodeticLatitudeToMercatorAngle(e.latitude)*i,s=e.height;return(0,a.Z)(t)?(t.x=r,t.y=o,t.z=s,t):new n.Z(r,o,s)},u.prototype.unproject=function(e,t){if(!(0,a.Z)(e))throw new s.Z("cartesian is required");let i=this._oneOverSemimajorAxis,n=e.x*i,o=u.mercatorAngleToGeodeticLatitude(e.y*i),l=e.z;return(0,a.Z)(t)?(t.longitude=n,t.latitude=o,t.height=l,t):new r.Z(n,o,l)},t.Z=u},9661:function(e,t,i){"use strict";var n=i(512);let r={CLOCKWISE:n.Z.CW,COUNTER_CLOCKWISE:n.Z.CCW};r.validate=function(e){return e===r.CLOCKWISE||e===r.COUNTER_CLOCKWISE},t.Z=Object.freeze(r)},3453:function(e,t,i){"use strict";var n=i(698),r=i(4572),o=i(9410);let a=i(2150).Z.EPSILON10;t.Z=function(e,t,i,s){let l,c,u;if(n.Z.defined("equalsEpsilon",t),!(0,o.Z)(e))return;i=(0,r.Z)(i,!1);let h=(0,o.Z)(s),d=e.length;if(d<2)return e;let f=e[0],p=0,m=-1;for(l=1;l<d;++l)t(f,c=e[l],a)?((0,o.Z)(u)||(u=e.slice(0,l),p=l-1,m=0),h&&s.push(l)):((0,o.Z)(u)&&(u.push(c),p=l,h&&(m=s.length)),f=c);return i&&t(e[0],e[d-1],a)&&(h&&((0,o.Z)(u)?s.splice(m,0,p):s.push(d-1)),(0,o.Z)(u)?u.length-=1:u=e.slice(0,-1)),(0,o.Z)(u)?u:e}},2059:function(e,t,i){"use strict";let n,r,o;var a=i(9410),s=i(9824),l=i(375),c=i(8358);let u=/((?:.*\/)|^)Cesium\.js(?:\?|\#|$)/;function h(e){return"undefined"==typeof document?e:((0,a.Z)(n)||(n=document.createElement("a")),n.href=e,n.href)}function d(){let e;if((0,a.Z)(r))return r;if("undefined"!=typeof CESIUM_BASE_URL?e=CESIUM_BASE_URL:(0,a.Z)("file:///home/ayush23027/ssl/orco_website/node_modules/@cesium/engine/Source/Core/buildModuleUrl.js")?e=(0,l.Z)(".","file:///home/ayush23027/ssl/orco_website/node_modules/@cesium/engine/Source/Core/buildModuleUrl.js"):"object"==typeof define&&(0,a.Z)(define.amd)&&!define.amd.toUrlUndefined&&(0,a.Z)(require.toUrl)?e=(0,l.Z)("..",m("Core/buildModuleUrl.js")):e=function(){let e=document.getElementsByTagName("script");for(let t=0,i=e.length;t<i;++t){let i=e[t].getAttribute("src"),n=u.exec(i);if(null!==n)return n[1]}}(),!(0,a.Z)(e))throw new s.Z("Unable to determine Cesium base URL automatically, try defining a global variable called CESIUM_BASE_URL.");return(r=new c.Z({url:h(e)})).appendForwardSlash(),r}function f(e){return h(require.toUrl(`../${e}`))}function p(e){return d().getDerivedResource({url:e}).url}function m(e){return(0,a.Z)(o)||("object"==typeof define&&(0,a.Z)(define.amd)&&!define.amd.toUrlUndefined&&(0,a.Z)(require.toUrl)?o=f:o=p),o(e)}m._cesiumScriptRegex=u,m._buildModuleUrlFromBaseUrl=p,m._clearBaseResource=function(){r=void 0},m.setBaseUrl=function(e){r=c.Z.DEFAULT.getDerivedResource({url:e})},m.getCesiumBaseUrl=d,t.Z=m},49:function(e,t,i){"use strict";var n=i(4572);t.Z=function e(t,i){if(null===t||"object"!=typeof t)return t;i=(0,n.Z)(i,!1);let r=new t.constructor;for(let n in t)if(t.hasOwnProperty(n)){let o=t[n];i&&(o=e(o,i)),r[n]=o}return r}},2115:function(e,t,i){"use strict";var n=i(4572),r=i(9410);t.Z=function e(t,i,o){let a,s,l;o=(0,n.Z)(o,!1);let c={},u=(0,r.Z)(t),h=(0,r.Z)(i);if(u)for(a in t)t.hasOwnProperty(a)&&(s=t[a],h&&o&&"object"==typeof s&&i.hasOwnProperty(a)&&"object"==typeof(l=i[a])?c[a]=e(s,l,o):c[a]=s);if(h)for(a in i)i.hasOwnProperty(a)&&!c.hasOwnProperty(a)&&(l=i[a],c[a]=l);return c}},530:function(e,t){"use strict";t.Z=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){let t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)})}},9695:function(e,t){"use strict";t.Z=function(){let e,t;let i=new Promise(function(i,n){e=i,t=n});return{resolve:e,reject:t,promise:i}}},3580:function(e,t,i){"use strict";var n=i(9410),r=i(9824),o=i(5776);t.Z=function(e,t){if(!(0,n.Z)(e)||!(0,n.Z)(t))throw new r.Z("identifier and message are required.");(0,o.Z)(e,t)}},7998:function(e,t,i){"use strict";var n=i(4572),r=i(9824);function o(){return!0}t.Z=function(e,t){function i(){throw new r.Z(t)}for(let r in t=(0,n.Z)(t,"This object was destroyed, i.e., destroy() was called."),e)"function"==typeof e[r]&&(e[r]=i);e.isDestroyed=o}},375:function(e,t,i){"use strict";var n=i(4355),r=i(4572),o=i(9410),a=i(9824);function s(e,t){let i;return"undefined"!=typeof document&&(i=document),s._implementation(e,t,i)}s._implementation=function(e,t,i){if(!(0,o.Z)(e))throw new a.Z("relative uri is required.");if(!(0,o.Z)(t)){if(void 0===i)return e;t=(0,r.Z)(i.baseURI,i.location.href)}let s=new n(e);return""!==s.scheme()?s.toString():s.absoluteTo(t).toString()},t.Z=s},5497:function(e,t,i){"use strict";var n=i(9410);let r={};t.Z=function(e,t,i){(0,n.Z)(t)||(t=e.width),(0,n.Z)(i)||(i=e.height);let o=r[t];(0,n.Z)(o)||(o={},r[t]=o);let a=o[i];if(!(0,n.Z)(a)){let e=document.createElement("canvas");e.width=t,e.height=i,(a=e.getContext("2d",{willReadFrequently:!0})).globalCompositeOperation="copy",o[i]=a}return a.drawImage(e,0,0,t,i),a.getImageData(0,0,t,i).data}},2594:function(e,t){"use strict";let i;"undefined"!=typeof performance&&"function"==typeof performance.now&&isFinite(performance.now())?i=function(){return performance.now()}:i=function(){return Date.now()},t.Z=i},9288:function(e,t,i){"use strict";var n=i(698);let r=/^blob:/i;t.Z=function(e){return n.Z.typeOf.string("uri",e),r.test(e)}},7230:function(e,t,i){"use strict";let n;var r=i(9410);t.Z=function(e){(0,r.Z)(n)||(n=document.createElement("a")),n.href=window.location.href;let t=n.host,i=n.protocol;return n.href=e,n.href=n.href,i!==n.protocol||t!==n.host}},2963:function(e,t,i){"use strict";var n=i(698);let r=/^data:/i;t.Z=function(e){return n.Z.typeOf.string("uri",e),r.test(e)}},4705:function(e,t,i){"use strict";let n;i.d(t,{Z:function(){return d}});var r=i(698),o=i(8358),a=i(9410);function s(e,t,i,n,r){this._format=e,this._datatype=t,this._width=i,this._height=n,this._buffer=r}Object.defineProperties(s.prototype,{internalFormat:{get:function(){return this._format}},pixelDatatype:{get:function(){return this._datatype}},width:{get:function(){return this._width}},height:{get:function(){return this._height}},bufferView:{get:function(){return this._buffer}}}),s.clone=function(e){if((0,a.Z)(e))return new s(e._format,e._datatype,e._width,e._height,e._buffer)},s.prototype.clone=function(){return s.clone(this)};var l=i(87),c=i(1250);function u(){}function h(e){return r.Z.defined("resourceOrUrlOrBuffer",e),(e instanceof ArrayBuffer||ArrayBuffer.isView(e)?Promise.resolve(e):o.Z.createIfNeeded(e).fetchArrayBuffer()).then(function(e){return u.transcode(e,n)})}u._transcodeTaskProcessor=new c.Z("transcodeKTX2",Number.POSITIVE_INFINITY),u._readyPromise=void 0,u.transcode=function(e,t){return r.Z.defined("supportedTargetFormats",t),(0,a.Z)(u._readyPromise)||function(){let e=u._transcodeTaskProcessor.initWebAssemblyModule({wasmBinaryFile:"ThirdParty/basis_transcoder.wasm"}).then(function(e){if(e)return u._transcodeTaskProcessor;throw new l.Z("KTX2 transcoder could not be initialized.")});u._readyPromise=e}(),u._readyPromise.then(function(i){let n;return e instanceof ArrayBuffer?(n={supportedTargetFormats:t,ktx2Buffer:new Uint8Array(e)},i.scheduleTask(n,[e])):(n={supportedTargetFormats:t,ktx2Buffer:e},i.scheduleTask(n,[e.buffer]))}).then(function(e){let t;let i=e.length,n=Object.keys(e[0]),r=n.length;for(t=0;t<i;t++){let i=e[t];for(let e=0;e<r;e++){let t=i[n[e]];i[n[e]]=new s(t.internalFormat,t.datatype,t.width,t.height,t.levelBuffer)}}if(1===r){for(t=0;t<i;++t)e[t]=e[t][n[0]];1===i&&(e=e[0])}return e}).catch(function(e){throw e})},h.setKTX2SupportedFormats=function(e,t,i,r,o,a){n={s3tc:e,pvrtc:t,astc:i,etc:r,etc1:o,bc7:a}};var d=h},5776:function(e,t,i){"use strict";var n=i(4572),r=i(9410),o=i(9824);let a={};function s(e,t){if(!(0,r.Z)(e))throw new o.Z("identifier is required.");(0,r.Z)(a[e])||(a[e]=!0,console.warn((0,n.Z)(t,e)))}s.geometryOutlines="Entity geometry outlines are unsupported on terrain. Outlines will be disabled. To enable outlines, disable geometry terrain clamping by explicitly setting height to 0.",s.geometryZIndex="Entity geometry with zIndex are unsupported when height or extrudedHeight are defined. zIndex will be ignored",s.geometryHeightReference="Entity corridor, ellipse, polygon or rectangle with heightReference must also have a defined height. heightReference will be ignored",s.geometryExtrudedHeightReference="Entity corridor, ellipse, polygon or rectangle with extrudedHeightReference must also have a defined extrudedHeight. extrudedHeightReference will be ignored",t.Z=s},5695:function(e,t,i){"use strict";var n=i(2150);t.Z=function(e){let t=document.createElement("canvas");return t.width=n.Z.nextPowerOfTwo(e.width),t.height=n.Z.nextPowerOfTwo(e.height),t.getContext("2d").drawImage(e,0,0,e.width,e.height,0,0,t.width,t.height),t}},4833:function(e,t,i){"use strict";var n=i(1486),r=i(9410),o=i(9824),a=i(2150);let s=new n.Z,l=new n.Z;t.Z=function(e,t,i,c,u){let h,d,f,p,m,_,g,Z,y,b;if(!(0,r.Z)(e))throw new o.Z("cartesian is required.");if(!(0,r.Z)(t))throw new o.Z("oneOverRadii is required.");if(!(0,r.Z)(i))throw new o.Z("oneOverRadiiSquared is required.");if(!(0,r.Z)(c))throw new o.Z("centerToleranceSquared is required.");let v=e.x,T=e.y,E=e.z,x=t.x,w=t.y,S=t.z,C=v*v*x*x,A=T*T*w*w,I=E*E*S*S,O=C+A+I,D=Math.sqrt(1/O),P=n.Z.multiplyByScalar(e,D,s);if(O<c)return isFinite(D)?n.Z.clone(P,u):void 0;let R=i.x,N=i.y,L=i.z;l.x=P.x*R*2,l.y=P.y*N*2,l.z=P.z*L*2;let M=(1-D)*n.Z.magnitude(e)/(.5*n.Z.magnitude(l)),F=0;do M-=F,d=1/(1+M*R),f=1/(1+M*N),p=1/(1+M*L),m=d*d,_=f*f,g=p*p,Z=m*d,y=_*f,b=g*p,F=(h=C*m+A*_+I*g-1)/(-2*(C*Z*R+A*y*N+I*b*L));while(Math.abs(h)>a.Z.EPSILON12);return(0,r.Z)(u)?(u.x=v*d,u.y=T*f,u.z=E*p,u):new n.Z(v*d,T*f,E*p)}},7138:function(e,t,i){"use strict";var n=i(8177),r=i(9410),o=i(2198),a=i(8424),s=i(7570);function l(e){this._definitionChanged=new o.Z,this._color=void 0,this._colorSubscription=void 0,this.color=e}Object.defineProperties(l.prototype,{isConstant:{get:function(){return s.Z.isConstant(this._color)}},definitionChanged:{get:function(){return this._definitionChanged}},color:(0,a.Z)("color")}),l.prototype.getType=function(e){return"Color"},l.prototype.getValue=function(e,t){return(0,r.Z)(t)||(t={}),t.color=s.Z.getValueOrClonedDefault(this._color,e,n.Z.WHITE,t.color),t},l.prototype.equals=function(e){return this===e||e instanceof l&&s.Z.equals(this._color,e._color)},t.Z=l},1949:function(e,t,i){"use strict";var n=i(1486),r=i(4572),o=i(9410),a=i(9824),s=i(2198),l=i(7897),c=i(9214);function u(e,t){this._definitionChanged=new s.Z,this._value=n.Z.clone(e),this._referenceFrame=(0,r.Z)(t,l.Z.FIXED)}Object.defineProperties(u.prototype,{isConstant:{get:function(){return!(0,o.Z)(this._value)||this._referenceFrame===l.Z.FIXED}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return this._referenceFrame}}}),u.prototype.getValue=function(e,t){return this.getValueInReferenceFrame(e,l.Z.FIXED,t)},u.prototype.setValue=function(e,t){let i=!1;n.Z.equals(this._value,e)||(i=!0,this._value=n.Z.clone(e)),(0,o.Z)(t)&&this._referenceFrame!==t&&(i=!0,this._referenceFrame=t),i&&this._definitionChanged.raiseEvent(this)},u.prototype.getValueInReferenceFrame=function(e,t,i){if(!(0,o.Z)(e))throw new a.Z("time is required.");if(!(0,o.Z)(t))throw new a.Z("referenceFrame is required.");return c.Z.convertToReferenceFrame(e,this._value,this._referenceFrame,t,i)},u.prototype.equals=function(e){return this===e||e instanceof u&&n.Z.equals(this._value,e._value)&&this._referenceFrame===e._referenceFrame},t.Z=u},109:function(e,t,i){"use strict";var n=i(9410),r=i(2198);function o(e){this._value=void 0,this._hasClone=!1,this._hasEquals=!1,this._definitionChanged=new r.Z,this.setValue(e)}Object.defineProperties(o.prototype,{isConstant:{value:!0},definitionChanged:{get:function(){return this._definitionChanged}}}),o.prototype.getValue=function(e,t){return this._hasClone?this._value.clone(t):this._value},o.prototype.setValue=function(e){let t=this._value;if(t!==e){let i=(0,n.Z)(e),r=i&&"function"==typeof e.clone,o=i&&"function"==typeof e.equals;o&&e.equals(t)||(this._hasClone=r,this._hasEquals=o,this._value=r?e.clone(this._value):e,this._definitionChanged.raiseEvent(this))}},o.prototype.equals=function(e){return this===e||e instanceof o&&(!this._hasEquals&&this._value===e._value||this._hasEquals&&this._value.equals(e._value))},o.prototype.valueOf=function(){return this._value},o.prototype.toString=function(){return String(this._value)},t.Z=o},5117:function(e,t,i){"use strict";var n=i(4572),r=i(9410),o=i(7998),a=i(9824),s=i(2198),l=i(2150);function c(){this._dataSources=[],this._dataSourceAdded=new s.Z,this._dataSourceRemoved=new s.Z,this._dataSourceMoved=new s.Z}function u(e,t){if(!(0,r.Z)(t))throw new a.Z("dataSource is required.");let i=e.indexOf(t);if(-1===i)throw new a.Z("dataSource is not in this collection.");return i}function h(e,t,i){let n=e._dataSources,r=n.length-1;if((t=l.Z.clamp(t,0,r))===(i=l.Z.clamp(i,0,r)))return;let o=n[t];n[t]=n[i],n[i]=o,e.dataSourceMoved.raiseEvent(o,i,t)}Object.defineProperties(c.prototype,{length:{get:function(){return this._dataSources.length}},dataSourceAdded:{get:function(){return this._dataSourceAdded}},dataSourceRemoved:{get:function(){return this._dataSourceRemoved}},dataSourceMoved:{get:function(){return this._dataSourceMoved}}}),c.prototype.add=function(e){if(!(0,r.Z)(e))throw new a.Z("dataSource is required.");let t=this,i=this._dataSources;return Promise.resolve(e).then(function(e){return i===t._dataSources&&(t._dataSources.push(e),t._dataSourceAdded.raiseEvent(t,e)),e})},c.prototype.remove=function(e,t){t=(0,n.Z)(t,!1);let i=this._dataSources.indexOf(e);return -1!==i&&(this._dataSources.splice(i,1),this._dataSourceRemoved.raiseEvent(this,e),t&&"function"==typeof e.destroy&&e.destroy(),!0)},c.prototype.removeAll=function(e){e=(0,n.Z)(e,!1);let t=this._dataSources;for(let i=0,n=t.length;i<n;++i){let n=t[i];this._dataSourceRemoved.raiseEvent(this,n),e&&"function"==typeof n.destroy&&n.destroy()}this._dataSources=[]},c.prototype.contains=function(e){return -1!==this.indexOf(e)},c.prototype.indexOf=function(e){return this._dataSources.indexOf(e)},c.prototype.get=function(e){if(!(0,r.Z)(e))throw new a.Z("index is required.");return this._dataSources[e]},c.prototype.getByName=function(e){if(!(0,r.Z)(e))throw new a.Z("name is required.");return this._dataSources.filter(function(t){return t.name===e})},c.prototype.raise=function(e){let t=u(this._dataSources,e);h(this,t,t+1)},c.prototype.lower=function(e){let t=u(this._dataSources,e);h(this,t,t-1)},c.prototype.raiseToTop=function(e){let t=u(this._dataSources,e);t!==this._dataSources.length-1&&(this._dataSources.splice(t,1),this._dataSources.push(e),this.dataSourceMoved.raiseEvent(e,this._dataSources.length-1,t))},c.prototype.lowerToBottom=function(e){let t=u(this._dataSources,e);0!==t&&(this._dataSources.splice(t,1),this._dataSources.splice(0,0,e),this.dataSourceMoved.raiseEvent(e,0,t))},c.prototype.isDestroyed=function(){return!1},c.prototype.destroy=function(){return this.removeAll(!0),(0,o.Z)(this)},t.Z=c},9828:function(e,t,i){"use strict";let n,r,o,a,s,l;i.d(t,{Z:function(){return wB}});var c,u,h,d=i(3369),f=i(7643),p=i(698),m=i(4572),_=i(9410),g=i(7998),Z=i(691),y=i(6900),b=i(3650),v=i(6547);function T(){this._length=0,this._collections={},this._collectionsArray=[],this.show=!0}Object.defineProperties(T.prototype,{length:{get:function(){return this._length}}}),T.prototype.add=function(e,t){p.Z.defined("primitive",e),(0,_.Z)(t)&&p.Z.typeOf.number("zIndex",t),t=(0,m.Z)(t,0);let i=this._collections[t];if(!(0,_.Z)(i)){(i=new v.Z({destroyPrimitives:!1}))._zIndex=t,this._collections[t]=i;let e=this._collectionsArray,n=0;for(;n<e.length&&e[n]._zIndex<t;)n++;e.splice(n,0,i)}return i.add(e),this._length++,e._zIndex=t,e},T.prototype.set=function(e,t){return p.Z.defined("primitive",e),p.Z.typeOf.number("zIndex",t),t===e._zIndex||(this.remove(e,!0),this.add(e,t)),e},T.prototype.remove=function(e,t){if(this.contains(e)){let i;let n=e._zIndex,r=this._collections[n];return(i=t?r.remove(e):r.removeAndDestroy(e))&&this._length--,0===r.length&&(this._collectionsArray.splice(this._collectionsArray.indexOf(r),1),this._collections[n]=void 0,r.destroy()),i}return!1},T.prototype.removeAll=function(){let e=this._collectionsArray;for(let t=0;t<e.length;t++){let i=e[t];i.destroyPrimitives=!0,i.destroy()}this._collections={},this._collectionsArray=[],this._length=0},T.prototype.contains=function(e){if(!(0,_.Z)(e))return!1;let t=this._collections[e._zIndex];return(0,_.Z)(t)&&t.contains(e)},T.prototype.update=function(e){if(!this.show)return;let t=this._collectionsArray;for(let i=0;i<t.length;i++)t[i].update(e)},T.prototype.isDestroyed=function(){return!1},T.prototype.destroy=function(){return this.removeAll(),(0,g.Z)(this)};var E=i(4989),x=i(1373),w=i(570),S=i(1486),C=i(8177),A=i(9824),I=i(9569),O=i(3336),D=i(9386),P=Object.freeze({CENTER:0,LEFT:1,RIGHT:-1}),R=Object.freeze({CENTER:0,BOTTOM:1,BASELINE:2,TOP:-1}),N=Object.freeze({DONE:0,PENDING:1,FAILED:2}),L=i(7570);let M=C.Z.WHITE,F=S.Z.ZERO,z=D.ZP.NONE,B=w.Z.ZERO,U=S.Z.ZERO,k=P.CENTER,V=R.CENTER,H=new S.Z,G=new C.Z,j=new S.Z,W=new w.Z,q=new O.Z,Y=new O.Z,X=new O.Z,$=new x.Z,K=new I.Z;function Q(e){this.entity=e,this.billboard=void 0,this.textureValue=void 0}function J(e,t){if(!(0,_.Z)(e))throw new A.Z("entityCluster is required.");if(!(0,_.Z)(t))throw new A.Z("entityCollection is required.");t.collectionChanged.addEventListener(J.prototype._onCollectionChanged,this),this._cluster=e,this._entityCollection=t,this._items=new E.Z,this._onCollectionChanged(t,t.values,[],[])}function ee(e,t,i){(0,_.Z)(e)&&(e.billboard=void 0,i.removeBillboard(t))}J.prototype.update=function(e){if(!(0,_.Z)(e))throw new A.Z("time is required.");let t=this._items.values,i=this._cluster;for(let n=0,r=t.length;n<r;n++){let r,o;let a=t[n],s=a.entity,l=s._billboard,c=a.billboard,u=s.isShowing&&s.isAvailable(e)&&L.Z.getValueOrDefault(l._show,e,!0);if(u&&(o=L.Z.getValueOrUndefined(s._position,e,H),r=L.Z.getValueOrUndefined(l._image,e),u=(0,_.Z)(o)&&(0,_.Z)(r)),!u){ee(a,s,i);continue}L.Z.isConstant(s._position)||(i._clusterDirty=!0),(0,_.Z)(c)||((c=i.getBillboard(s)).id=s,c.image=void 0,a.billboard=c),c.show=u,(0,_.Z)(c.image)&&a.textureValue===r||(c.image=r,a.textureValue=r),c.position=o,c.color=L.Z.getValueOrDefault(l._color,e,M,G),c.eyeOffset=L.Z.getValueOrDefault(l._eyeOffset,e,F,j),c.heightReference=L.Z.getValueOrDefault(l._heightReference,e,z),c.pixelOffset=L.Z.getValueOrDefault(l._pixelOffset,e,B,W),c.scale=L.Z.getValueOrDefault(l._scale,e,1),c.rotation=L.Z.getValueOrDefault(l._rotation,e,0),c.alignedAxis=L.Z.getValueOrDefault(l._alignedAxis,e,U),c.horizontalOrigin=L.Z.getValueOrDefault(l._horizontalOrigin,e,k),c.verticalOrigin=L.Z.getValueOrDefault(l._verticalOrigin,e,V),c.width=L.Z.getValueOrUndefined(l._width,e),c.height=L.Z.getValueOrUndefined(l._height,e),c.scaleByDistance=L.Z.getValueOrUndefined(l._scaleByDistance,e,q),c.translucencyByDistance=L.Z.getValueOrUndefined(l._translucencyByDistance,e,Y),c.pixelOffsetScaleByDistance=L.Z.getValueOrUndefined(l._pixelOffsetScaleByDistance,e,X),c.sizeInMeters=L.Z.getValueOrDefault(l._sizeInMeters,e,!1),c.distanceDisplayCondition=L.Z.getValueOrUndefined(l._distanceDisplayCondition,e,K),c.disableDepthTestDistance=L.Z.getValueOrUndefined(l._disableDepthTestDistance,e);let h=L.Z.getValueOrUndefined(l._imageSubRegion,e,$);(0,_.Z)(h)&&c.setImageSubRegion(c._imageId,h)}return!0},J.prototype.getBoundingSphere=function(e,t){if(!(0,_.Z)(e))throw new A.Z("entity is required.");if(!(0,_.Z)(t))throw new A.Z("result is required.");let i=this._items.get(e.id);if(!(0,_.Z)(i)||!(0,_.Z)(i.billboard))return N.FAILED;let n=i.billboard;if(n.heightReference===D.ZP.NONE)t.center=S.Z.clone(n.position,t.center);else{if(!(0,_.Z)(n._clampedPosition))return N.PENDING;t.center=S.Z.clone(n._clampedPosition,t.center)}return t.radius=0,N.DONE},J.prototype.isDestroyed=function(){return!1},J.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(J.prototype._onCollectionChanged,this);let e=this._entityCollection.values;for(let t=0;t<e.length;t++)this._cluster.removeBillboard(e[t]);return(0,g.Z)(this)},J.prototype._onCollectionChanged=function(e,t,i,n){let r,o;let a=this._items,s=this._cluster;for(r=t.length-1;r>-1;r--)o=t[r],(0,_.Z)(o._billboard)&&(0,_.Z)(o._position)&&a.set(o.id,new Q(o));for(r=n.length-1;r>-1;r--)o=n[r],(0,_.Z)(o._billboard)&&(0,_.Z)(o._position)?a.contains(o.id)||a.set(o.id,new Q(o)):(ee(a.get(o.id),o,s),a.remove(o.id));for(r=i.length-1;r>-1;r--)o=i[r],ee(a.get(o.id),o,s),a.remove(o.id)};var et=i(2198);function ei(){A.Z.throwInstantiationError()}Object.defineProperties(ei.prototype,{name:{get:A.Z.throwInstantiationError},clock:{get:A.Z.throwInstantiationError},entities:{get:A.Z.throwInstantiationError},isLoading:{get:A.Z.throwInstantiationError},changedEvent:{get:A.Z.throwInstantiationError},errorEvent:{get:A.Z.throwInstantiationError},loadingEvent:{get:A.Z.throwInstantiationError},show:{get:A.Z.throwInstantiationError},clustering:{get:A.Z.throwInstantiationError}}),ei.prototype.update=function(e){A.Z.throwInstantiationError()},ei.setLoading=function(e,t){e._isLoading!==t&&(t?e._entityCollection.suspendEvents():e._entityCollection.resumeEvents(),e._isLoading=t,e._loading.raiseEvent(e,t))};var en=i(8757),er=i(4749),eo=i(3065),ea=i(2820),es=i(530),el=i(1039),ec=i(8358),eu=i(8593),eh=i(4364);function ed(e,t){if(e=(0,m.Z)(e,m.Z.EMPTY_OBJECT),(0,_.Z)(e.disableDepthTestDistance)&&e.disableDepthTestDistance<0)throw new A.Z("disableDepthTestDistance must be greater than or equal to 0.0.");let i=e.translucencyByDistance,n=e.pixelOffsetScaleByDistance,r=e.scaleByDistance,o=e.distanceDisplayCondition;if((0,_.Z)(i)){if(i.far<=i.near)throw new A.Z("translucencyByDistance.far must be greater than translucencyByDistance.near.");i=O.Z.clone(i)}if((0,_.Z)(n)){if(n.far<=n.near)throw new A.Z("pixelOffsetScaleByDistance.far must be greater than pixelOffsetScaleByDistance.near.");n=O.Z.clone(n)}if((0,_.Z)(r)){if(r.far<=r.near)throw new A.Z("scaleByDistance.far must be greater than scaleByDistance.near.");r=O.Z.clone(r)}if((0,_.Z)(o)){if(o.far<=o.near)throw new A.Z("distanceDisplayCondition.far must be greater than distanceDisplayCondition.near.");o=I.Z.clone(o)}this._show=(0,m.Z)(e.show,!0),this._position=S.Z.clone((0,m.Z)(e.position,S.Z.ZERO)),this._actualPosition=S.Z.clone(this._position),this._pixelOffset=w.Z.clone((0,m.Z)(e.pixelOffset,w.Z.ZERO)),this._translate=new w.Z(0,0),this._eyeOffset=S.Z.clone((0,m.Z)(e.eyeOffset,S.Z.ZERO)),this._heightReference=(0,m.Z)(e.heightReference,D.ZP.NONE),this._verticalOrigin=(0,m.Z)(e.verticalOrigin,R.CENTER),this._horizontalOrigin=(0,m.Z)(e.horizontalOrigin,P.CENTER),this._scale=(0,m.Z)(e.scale,1),this._color=C.Z.clone((0,m.Z)(e.color,C.Z.WHITE)),this._rotation=(0,m.Z)(e.rotation,0),this._alignedAxis=S.Z.clone((0,m.Z)(e.alignedAxis,S.Z.ZERO)),this._width=e.width,this._height=e.height,this._scaleByDistance=r,this._translucencyByDistance=i,this._pixelOffsetScaleByDistance=n,this._sizeInMeters=(0,m.Z)(e.sizeInMeters,!1),this._distanceDisplayCondition=o,this._disableDepthTestDistance=e.disableDepthTestDistance,this._id=e.id,this._collection=(0,m.Z)(e.collection,t),this._pickId=void 0,this._pickPrimitive=(0,m.Z)(e._pickPrimitive,this),this._billboardCollection=t,this._dirty=!1,this._index=-1,this._batchIndex=void 0,this._imageIndex=-1,this._imageIndexPromise=void 0,this._imageId=void 0,this._image=void 0,this._imageSubRegion=void 0,this._imageWidth=void 0,this._imageHeight=void 0,this._labelDimensions=void 0,this._labelHorizontalOrigin=void 0,this._labelTranslate=void 0;let a=e.image,s=e.imageId;(0,_.Z)(a)&&((0,_.Z)(s)||(s="string"==typeof a?a:(0,_.Z)(a.src)?a.src:(0,es.Z)()),this._imageId=s,this._image=a),(0,_.Z)(e.imageSubRegion)&&(this._imageId=s,this._imageSubRegion=e.imageSubRegion),(0,_.Z)(this._billboardCollection._textureAtlas)&&this._loadImage(),this._actualClampedPosition=void 0,this._removeCallbackFunc=void 0,this._mode=eu.Z.SCENE3D,this._clusterShow=!0,this._outlineColor=C.Z.clone((0,m.Z)(e.outlineColor,C.Z.BLACK)),this._outlineWidth=(0,m.Z)(e.outlineWidth,0),this._updateClamping()}let ef=ed.SHOW_INDEX=0,ep=ed.POSITION_INDEX=1,em=ed.PIXEL_OFFSET_INDEX=2,e_=ed.EYE_OFFSET_INDEX=3,eg=ed.HORIZONTAL_ORIGIN_INDEX=4,eZ=ed.VERTICAL_ORIGIN_INDEX=5,ey=ed.SCALE_INDEX=6,eb=ed.IMAGE_INDEX_INDEX=7,ev=ed.COLOR_INDEX=8,eT=ed.ROTATION_INDEX=9,eE=ed.ALIGNED_AXIS_INDEX=10,ex=ed.SCALE_BY_DISTANCE_INDEX=11,ew=ed.TRANSLUCENCY_BY_DISTANCE_INDEX=12,eS=ed.PIXEL_OFFSET_SCALE_BY_DISTANCE_INDEX=13,eC=ed.DISTANCE_DISPLAY_CONDITION=14,eA=ed.DISABLE_DEPTH_DISTANCE=15;ed.TEXTURE_COORDINATE_BOUNDS=16;let eI=ed.SDF_INDEX=17;function eO(e,t){let i=e._billboardCollection;(0,_.Z)(i)&&(i._updateBillboard(e,t),e._dirty=!0)}ed.NUMBER_OF_PROPERTIES=18,Object.defineProperties(ed.prototype,{show:{get:function(){return this._show},set:function(e){p.Z.typeOf.bool("value",e),this._show!==e&&(this._show=e,eO(this,ef))}},position:{get:function(){return this._position},set:function(e){p.Z.typeOf.object("value",e);let t=this._position;S.Z.equals(t,e)||(S.Z.clone(e,t),S.Z.clone(e,this._actualPosition),this._updateClamping(),eO(this,ep))}},heightReference:{get:function(){return this._heightReference},set:function(e){p.Z.typeOf.number("value",e),e!==this._heightReference&&(this._heightReference=e,this._updateClamping(),eO(this,ep))}},pixelOffset:{get:function(){return this._pixelOffset},set:function(e){p.Z.typeOf.object("value",e);let t=this._pixelOffset;w.Z.equals(t,e)||(w.Z.clone(e,t),eO(this,em))}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){if((0,_.Z)(e)&&(p.Z.typeOf.object("value",e),e.far<=e.near))throw new A.Z("far distance must be greater than near distance.");let t=this._scaleByDistance;O.Z.equals(t,e)||(this._scaleByDistance=O.Z.clone(e,t),eO(this,ex))}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){if((0,_.Z)(e)&&(p.Z.typeOf.object("value",e),e.far<=e.near))throw new A.Z("far distance must be greater than near distance.");let t=this._translucencyByDistance;O.Z.equals(t,e)||(this._translucencyByDistance=O.Z.clone(e,t),eO(this,ew))}},pixelOffsetScaleByDistance:{get:function(){return this._pixelOffsetScaleByDistance},set:function(e){if((0,_.Z)(e)&&(p.Z.typeOf.object("value",e),e.far<=e.near))throw new A.Z("far distance must be greater than near distance.");let t=this._pixelOffsetScaleByDistance;O.Z.equals(t,e)||(this._pixelOffsetScaleByDistance=O.Z.clone(e,t),eO(this,eS))}},eyeOffset:{get:function(){return this._eyeOffset},set:function(e){p.Z.typeOf.object("value",e);let t=this._eyeOffset;S.Z.equals(t,e)||(S.Z.clone(e,t),eO(this,e_))}},horizontalOrigin:{get:function(){return this._horizontalOrigin},set:function(e){p.Z.typeOf.number("value",e),this._horizontalOrigin!==e&&(this._horizontalOrigin=e,eO(this,eg))}},verticalOrigin:{get:function(){return this._verticalOrigin},set:function(e){p.Z.typeOf.number("value",e),this._verticalOrigin!==e&&(this._verticalOrigin=e,eO(this,eZ))}},scale:{get:function(){return this._scale},set:function(e){p.Z.typeOf.number("value",e),this._scale!==e&&(this._scale=e,eO(this,ey))}},color:{get:function(){return this._color},set:function(e){p.Z.typeOf.object("value",e);let t=this._color;C.Z.equals(t,e)||(C.Z.clone(e,t),eO(this,ev))}},rotation:{get:function(){return this._rotation},set:function(e){p.Z.typeOf.number("value",e),this._rotation!==e&&(this._rotation=e,eO(this,eT))}},alignedAxis:{get:function(){return this._alignedAxis},set:function(e){p.Z.typeOf.object("value",e);let t=this._alignedAxis;S.Z.equals(t,e)||(S.Z.clone(e,t),eO(this,eE))}},width:{get:function(){return(0,m.Z)(this._width,this._imageWidth)},set:function(e){(0,_.Z)(e)&&p.Z.typeOf.number("value",e),this._width!==e&&(this._width=e,eO(this,eb))}},height:{get:function(){return(0,m.Z)(this._height,this._imageHeight)},set:function(e){(0,_.Z)(e)&&p.Z.typeOf.number("value",e),this._height!==e&&(this._height=e,eO(this,eb))}},sizeInMeters:{get:function(){return this._sizeInMeters},set:function(e){p.Z.typeOf.bool("value",e),this._sizeInMeters!==e&&(this._sizeInMeters=e,eO(this,ev))}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){if(!I.Z.equals(e,this._distanceDisplayCondition)){if((0,_.Z)(e)&&(p.Z.typeOf.object("value",e),e.far<=e.near))throw new A.Z("far distance must be greater than near distance.");this._distanceDisplayCondition=I.Z.clone(e,this._distanceDisplayCondition),eO(this,eC)}}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){if((0,_.Z)(e)&&(p.Z.typeOf.number("value",e),e<0))throw new A.Z("disableDepthTestDistance must be greater than or equal to 0.0.");this._disableDepthTestDistance!==e&&(this._disableDepthTestDistance=e,eO(this,eA))}},id:{get:function(){return this._id},set:function(e){this._id=e,(0,_.Z)(this._pickId)&&(this._pickId.object.id=e)}},pickPrimitive:{get:function(){return this._pickPrimitive},set:function(e){this._pickPrimitive=e,(0,_.Z)(this._pickId)&&(this._pickId.object.primitive=e)}},pickId:{get:function(){return this._pickId}},image:{get:function(){return this._imageId},set:function(e){(0,_.Z)(e)?"string"==typeof e?this.setImage(e,e):e instanceof ec.Z?this.setImage(e.url,e):(0,_.Z)(e.src)?this.setImage(e.src,e):this.setImage((0,es.Z)(),e):(this._imageIndex=-1,this._imageSubRegion=void 0,this._imageId=void 0,this._image=void 0,this._imageIndexPromise=void 0,eO(this,eb))}},ready:{get:function(){return -1!==this._imageIndex}},_clampedPosition:{get:function(){return this._actualClampedPosition},set:function(e){this._actualClampedPosition=S.Z.clone(e,this._actualClampedPosition),eO(this,ep)}},clusterShow:{get:function(){return this._clusterShow},set:function(e){this._clusterShow!==e&&(this._clusterShow=e,eO(this,ef))}},outlineColor:{get:function(){return this._outlineColor},set:function(e){if(!(0,_.Z)(e))throw new A.Z("value is required.");let t=this._outlineColor;C.Z.equals(t,e)||(C.Z.clone(e,t),eO(this,eI))}},outlineWidth:{get:function(){return this._outlineWidth},set:function(e){this._outlineWidth!==e&&(this._outlineWidth=e,eO(this,eI))}}}),ed.prototype.getPickId=function(e){return(0,_.Z)(this._pickId)||(this._pickId=e.createPickId({primitive:this._pickPrimitive,collection:this._collection,id:this._id})),this._pickId},ed.prototype._updateClamping=function(){ed._updateClamping(this._billboardCollection,this)};let eD=new ea.Z;ed._updateClamping=function(e,t){let i=e._scene;if(!(0,_.Z)(i)){if(t._heightReference!==D.ZP.NONE)throw new A.Z("Height reference is not supported without a scene.");return}let n=i.globe,r=(0,m.Z)(n?.ellipsoid,el.Z.WGS84),o=i.frameState.mode,a=o!==t._mode;if(t._mode=o,(t._heightReference===D.ZP.NONE||a)&&(0,_.Z)(t._removeCallbackFunc)&&(t._removeCallbackFunc(),t._removeCallbackFunc=void 0,t._clampedPosition=void 0),t._heightReference===D.ZP.NONE||!(0,_.Z)(t._position))return;(0,_.Z)(t._removeCallbackFunc)&&t._removeCallbackFunc();let s=r.cartesianToCartographic(t._position);if(!(0,_.Z)(s)){t._actualClampedPosition=void 0;return}function l(e){let i=r.cartographicToCartesian(e,t._clampedPosition);(0,D.lJ)(t._heightReference)&&(t._mode===eu.Z.SCENE3D?(e.height+=s.height,r.cartographicToCartesian(e,i)):i.x+=s.height),t._clampedPosition=i}t._removeCallbackFunc=i.updateHeight(s,l,t._heightReference),ea.Z.clone(s,eD);let c=i.getHeight(s,t._heightReference);(0,_.Z)(c)&&(eD.height=c),l(eD)},ed.prototype._loadImage=function(){let e;let t=this._billboardCollection._textureAtlas,i=this._imageId,n=this._image,r=this._imageSubRegion,o=this;function a(e){if(o._imageId!==i||o._image!==n||!x.Z.equals(o._imageSubRegion,r))return;let a=t.textureCoordinates[e];o._imageWidth=t.texture.width*a.width,o._imageHeight=t.texture.height*a.height,o._imageIndex=e,o._ready=!0,o._image=void 0,o._imageIndexPromise=void 0,eO(o,eb);let s=o._billboardCollection._scene;(0,_.Z)(s)&&s.frameState.afterRender.push(()=>!0)}if((0,_.Z)(n)&&(e=t.addImage(i,n)),(0,_.Z)(r)&&(e=t.addSubRegion(i,r)),this._imageIndexPromise=e,!(0,_.Z)(e))return;let s=t.getImageIndex(i);if((0,_.Z)(s)&&!(0,_.Z)(r)){a(s);return}e.then(a).catch(function(e){console.error(`Error loading image for billboard: ${e}`),o._imageIndexPromise=void 0})},ed.prototype.setImage=function(e,t){if(!(0,_.Z)(e))throw new A.Z("id is required.");if(!(0,_.Z)(t))throw new A.Z("image is required.");this._imageId!==e&&(this._imageIndex=-1,this._imageSubRegion=void 0,this._imageId=e,this._image=t,(0,_.Z)(this._billboardCollection._textureAtlas)&&this._loadImage())},ed.prototype.setImageSubRegion=function(e,t){if(!(0,_.Z)(e))throw new A.Z("id is required.");if(!(0,_.Z)(t))throw new A.Z("subRegion is required.");!(this._imageId===e&&x.Z.equals(this._imageSubRegion,t))&&(this._imageIndex=-1,this._imageId=e,this._imageSubRegion=x.Z.clone(t),(0,_.Z)(this._billboardCollection._textureAtlas)&&this._loadImage())},ed.prototype._setTranslate=function(e){if(!(0,_.Z)(e))throw new A.Z("value is required.");let t=this._translate;w.Z.equals(t,e)||(w.Z.clone(e,t),eO(this,em))},ed.prototype._getActualPosition=function(){return(0,_.Z)(this._clampedPosition)?this._clampedPosition:this._actualPosition},ed.prototype._setActualPosition=function(e){(0,_.Z)(this._clampedPosition)||S.Z.clone(e,this._actualPosition),eO(this,ep)};let eP=new eo.Z;ed._computeActualPosition=function(e,t,i,n){return(0,_.Z)(e._clampedPosition)?(i.mode!==e._mode&&e._updateClamping(),e._clampedPosition):i.mode===eu.Z.SCENE3D?t:(er.Z.multiplyByPoint(n,t,eP),eh.Z.computeActualWgs84Position(i,eP))};let eR=new S.Z;ed._computeScreenSpacePosition=function(e,t,i,n,r,o){let a=er.Z.multiplyByPoint(e,t,eR),s=eh.Z.wgs84WithEyeOffsetToWindowCoordinates(r,a,i,o);if((0,_.Z)(s))return w.Z.add(s,n,s),s};let eN=new w.Z(0,0);ed.prototype.computeScreenSpacePosition=function(e,t){let i=this._billboardCollection;if((0,_.Z)(t)||(t=new w.Z),!(0,_.Z)(i))throw new A.Z("Billboard must be in a collection. Was it removed?");if(!(0,_.Z)(e))throw new A.Z("scene is required.");w.Z.clone(this._pixelOffset,eN),w.Z.add(eN,this._translate,eN);let n=i.modelMatrix,r=this._position;if((0,_.Z)(this._clampedPosition)&&(r=this._clampedPosition,e.mode!==eu.Z.SCENE3D)){let t=e.mapProjection,i=t.ellipsoid,o=t.unproject(r,eD);r=i.cartographicToCartesian(o,eR),n=er.Z.IDENTITY}return ed._computeScreenSpacePosition(n,r,this._eyeOffset,eN,e,t)},ed.getScreenSpaceBoundingBox=function(e,t,i){let n=e.width,r=e.height,o=e.scale;n*=o,r*=o;let a=t.x;e.horizontalOrigin===P.RIGHT?a-=n:e.horizontalOrigin===P.CENTER&&(a-=.5*n);let s=t.y;return e.verticalOrigin===R.BOTTOM||e.verticalOrigin===R.BASELINE?s-=r:e.verticalOrigin===R.CENTER&&(s-=.5*r),(0,_.Z)(i)||(i=new x.Z),i.x=a,i.y=s,i.width=n,i.height=r,i},ed.prototype.equals=function(e){return this===e||(0,_.Z)(e)&&this._id===e._id&&S.Z.equals(this._position,e._position)&&this._imageId===e._imageId&&this._show===e._show&&this._scale===e._scale&&this._verticalOrigin===e._verticalOrigin&&this._horizontalOrigin===e._horizontalOrigin&&this._heightReference===e._heightReference&&x.Z.equals(this._imageSubRegion,e._imageSubRegion)&&C.Z.equals(this._color,e._color)&&w.Z.equals(this._pixelOffset,e._pixelOffset)&&w.Z.equals(this._translate,e._translate)&&S.Z.equals(this._eyeOffset,e._eyeOffset)&&O.Z.equals(this._scaleByDistance,e._scaleByDistance)&&O.Z.equals(this._translucencyByDistance,e._translucencyByDistance)&&O.Z.equals(this._pixelOffsetScaleByDistance,e._pixelOffsetScaleByDistance)&&I.Z.equals(this._distanceDisplayCondition,e._distanceDisplayCondition)&&this._disableDepthTestDistance===e._disableDepthTestDistance},ed.prototype._destroy=function(){(0,_.Z)(this._customData)&&(this._billboardCollection._scene.globe._surface.removeTileCustomData(this._customData),this._customData=void 0),(0,_.Z)(this._removeCallbackFunc)&&(this._removeCallbackFunc(),this._removeCallbackFunc=void 0),this.image=void 0,this._pickId=this._pickId&&this._pickId.destroy(),this._billboardCollection=void 0};var eL=i(6936),eM=i(7559),eF=i(3149),ez=i(5837),eB=i(2150),eU=i(512),ek=i(9780),eV=i(2598),eH=i(4318),eG=i(356),ej=i(7363),eW=i(480),eq=i(9698),eY=i(8516),eX=i(6450);function e$(e,t,i,n){let r,o;if(p.Z.defined("context",e),!t||0===t.length)throw new A.Z("At least one attribute is required.");let a=e$._verifyAttributes(t);i=(0,m.Z)(i,0);let s=[],l={},c=a.length;for(let e=0;e<c;++e){let t=a[e];if(t.vertexBuffer){s.push(t);continue}r=l[o=t.usage],(0,_.Z)(r)||(r=l[o]=[]),r.push(t)}function u(e,t){return eM.Z.getSizeInBytes(t.componentDatatype)-eM.Z.getSizeInBytes(e.componentDatatype)}for(o in this._allBuffers=[],l)if(l.hasOwnProperty(o)){(r=l[o]).sort(u);let e=e$._vertexSizeInBytes(r),t={vertexSizeInBytes:e,vertexBuffer:void 0,usage:r[0].usage,needsCommit:!1,arrayBuffer:void 0,arrayViews:e$._createArrayViews(r,e)};this._allBuffers.push(t)}this._size=0,this._instanced=(0,m.Z)(n,!1),this._precreated=s,this._context=e,this.writers=void 0,this.va=void 0,this.resize(i)}e$._verifyAttributes=function(e){let t=[];for(let i=0;i<e.length;++i){let n=e[i],r={index:(0,m.Z)(n.index,i),enabled:(0,m.Z)(n.enabled,!0),componentsPerAttribute:n.componentsPerAttribute,componentDatatype:(0,m.Z)(n.componentDatatype,eM.Z.FLOAT),normalize:(0,m.Z)(n.normalize,!1),vertexBuffer:n.vertexBuffer,usage:(0,m.Z)(n.usage,eV.Z.STATIC_DRAW)};if(t.push(r),1!==r.componentsPerAttribute&&2!==r.componentsPerAttribute&&3!==r.componentsPerAttribute&&4!==r.componentsPerAttribute)throw new A.Z("attribute.componentsPerAttribute must be in the range [1, 4].");let o=r.componentDatatype;if(!eM.Z.validate(o))throw new A.Z("Attribute must have a valid componentDatatype or not specify it.");if(!eV.Z.validate(r.usage))throw new A.Z("Attribute must have a valid usage or not specify it.")}let i=Array(t.length);for(let e=0;e<t.length;++e){let n=t[e].index;if(i[n])throw new A.Z(`Index ${n} is used by more than one attribute.`);i[n]=!0}return t},e$._vertexSizeInBytes=function(e){let t=0,i=e.length;for(let n=0;n<i;++n){let i=e[n];t+=i.componentsPerAttribute*eM.Z.getSizeInBytes(i.componentDatatype)}let n=i>0?eM.Z.getSizeInBytes(e[0].componentDatatype):0,r=n>0?t%n:0;return t+(0===r?0:n-r)},e$._createArrayViews=function(e,t){let i=[],n=0,r=e.length;for(let o=0;o<r;++o){let r=e[o],a=r.componentDatatype;i.push({index:r.index,enabled:r.enabled,componentsPerAttribute:r.componentsPerAttribute,componentDatatype:a,normalize:r.normalize,offsetInBytes:n,vertexSizeInComponentType:t/eM.Z.getSizeInBytes(a),view:void 0}),n+=r.componentsPerAttribute*eM.Z.getSizeInBytes(a)}return i},e$.prototype.resize=function(e){this._size=e;let t=this._allBuffers;this.writers=[];for(let e=0,i=t.length;e<i;++e){let i=t[e];e$._resize(i,this._size),e$._appendWriters(this.writers,i)}eQ(this)},e$._resize=function(e,t){if(e.vertexSizeInBytes>0){let i=new ArrayBuffer(t*e.vertexSizeInBytes);if((0,_.Z)(e.arrayBuffer)){let t=new Uint8Array(i),n=new Uint8Array(e.arrayBuffer),r=n.length;for(let e=0;e<r;++e)t[e]=n[e]}let n=e.arrayViews,r=n.length;for(let e=0;e<r;++e){let t=n[e];t.view=eM.Z.createArrayBufferView(t.componentDatatype,i,t.offsetInBytes)}e.arrayBuffer=i}};let eK=[function(e,t,i){return function(n,r){t[n*i]=r,e.needsCommit=!0}},function(e,t,i){return function(n,r,o){let a=n*i;t[a]=r,t[a+1]=o,e.needsCommit=!0}},function(e,t,i){return function(n,r,o,a){let s=n*i;t[s]=r,t[s+1]=o,t[s+2]=a,e.needsCommit=!0}},function(e,t,i){return function(n,r,o,a,s){let l=n*i;t[l]=r,t[l+1]=o,t[l+2]=a,t[l+3]=s,e.needsCommit=!0}}];function eQ(e){let t=e.va;if(!(0,_.Z)(t))return;let i=t.length;for(let e=0;e<i;++e)t[e].va.destroy();e.va=void 0}e$._appendWriters=function(e,t){let i=t.arrayViews,n=i.length;for(let r=0;r<n;++r){let n=i[r];e[n.index]=eK[n.componentsPerAttribute-1](t,n.view,n.vertexSizeInComponentType)}},e$.prototype.commit=function(e){let t,i,n,r=!1,o=this._allBuffers;for(i=0,n=o.length;i<n;++i)r=function(e,t){if(t.needsCommit&&t.vertexSizeInBytes>0){t.needsCommit=!1;let i=t.vertexBuffer,n=e._size*t.vertexSizeInBytes,r=(0,_.Z)(i);if(!r||i.sizeInBytes<n)return r&&i.destroy(),t.vertexBuffer=ek.Z.createVertexBuffer({context:e._context,typedArray:t.arrayBuffer,usage:t.usage}),t.vertexBuffer.vertexArrayDestroyable=!1,!0;t.vertexBuffer.copyFromArrayView(t.arrayBuffer)}return!1}(this,t=o[i])||r;if(r||!(0,_.Z)(this.va)){eQ(this);let r=this.va=[],a=eB.Z.SIXTY_FOUR_KILOBYTES-4,s=(0,_.Z)(e)&&!this._instanced?Math.ceil(this._size/a):1;for(let l=0;l<s;++l){let c=[];for(i=0,n=o.length;i<n;++i){let e=(t=o[i]).vertexSizeInBytes*a*l;e$._appendAttributes(c,t,e,this._instanced)}c=c.concat(this._precreated),r.push({va:new eX.Z({context:this._context,attributes:c,indexBuffer:e}),indicesCount:1.5*(l!==s-1?a:this._size%a)})}}},e$._appendAttributes=function(e,t,i,n){let r=t.arrayViews,o=r.length;for(let a=0;a<o;++a){let o=r[a];e.push({index:o.index,enabled:o.enabled,componentsPerAttribute:o.componentsPerAttribute,componentDatatype:o.componentDatatype,normalize:o.normalize,vertexBuffer:t.vertexBuffer,offsetInBytes:i+o.offsetInBytes,strideInBytes:t.vertexSizeInBytes,instanceDivisor:n?1:0})}},e$.prototype.subCommit=function(e,t){if(e<0||e>=this._size)throw new A.Z("offsetInVertices must be greater than or equal to zero and less than the vertex array size.");if(e+t>this._size)throw new A.Z("offsetInVertices + lengthInVertices cannot exceed the vertex array size.");let i=this._allBuffers;for(let n=0,r=i.length;n<r;++n)(function(e,t,i){if(e.needsCommit&&e.vertexSizeInBytes>0){let n=e.vertexSizeInBytes*t,r=e.vertexSizeInBytes*i;e.vertexBuffer.copyFromArrayView(new Uint8Array(e.arrayBuffer,n,r),n)}})(i[n],e,t)},e$.prototype.endSubCommits=function(){let e=this._allBuffers;for(let t=0,i=e.length;t<i;++t)e[t].needsCommit=!1},e$.prototype.isDestroyed=function(){return!1},e$.prototype.destroy=function(){let e=this._allBuffers;for(let t=0,i=e.length;t<i;++t){let i=e[t];i.vertexBuffer=i.vertexBuffer&&i.vertexBuffer.destroy()}return eQ(this),(0,g.Z)(this)};var eJ=i(1205),e0=Object.freeze({OPAQUE:0,TRANSLUCENT:1,OPAQUE_AND_TRANSLUCENT:2}),e1=Object.freeze({FONT_SIZE:48,PADDING:10,RADIUS:8,CUTOFF:.25}),e2=i(6055),e3=i(87),e4=i(1680),e5=i(4909);function e9(e,t,i,n,r){this.bottomLeft=(0,m.Z)(e,w.Z.ZERO),this.topRight=(0,m.Z)(t,w.Z.ZERO),this.childNode1=i,this.childNode2=n,this.imageIndex=r}let e8=new w.Z(16,16);function e6(e){e=(0,m.Z)(e,m.Z.EMPTY_OBJECT);let t=(0,m.Z)(e.borderWidthInPixels,1),i=(0,m.Z)(e.initialSize,e8);if(!(0,_.Z)(e.context))throw new A.Z("context is required.");if(t<0)throw new A.Z("borderWidthInPixels must be greater than or equal to zero.");if(i.x<1||i.y<1)throw new A.Z("initialSize must be greater than zero.");this._context=e.context,this._pixelFormat=(0,m.Z)(e.pixelFormat,e2.Z.RGBA),this._borderWidthInPixels=t,this._textureCoordinates=[],this._guid=(0,es.Z)(),this._idHash={},this._indexHash={},this._initialSize=i,this._root=void 0}function e7(e,t){if(!(0,_.Z)(e)||e.isDestroyed())return -1;let i=e.numberOfImages;return!function e(t,i,n){let r=function e(t,i,n){if((0,_.Z)(i)){if(!(0,_.Z)(i.childNode1)&&!(0,_.Z)(i.childNode2)){if((0,_.Z)(i.imageIndex))return;let r=i.topRight.x-i.bottomLeft.x,o=i.topRight.y-i.bottomLeft.y,a=r-n.width,s=o-n.height;if(a<0||s<0)return;if(0===a&&0===s)return i;if(a>s){i.childNode1=new e9(new w.Z(i.bottomLeft.x,i.bottomLeft.y),new w.Z(i.bottomLeft.x+n.width,i.topRight.y));let e=i.bottomLeft.x+n.width+t._borderWidthInPixels;e<i.topRight.x&&(i.childNode2=new e9(new w.Z(e,i.bottomLeft.y),new w.Z(i.topRight.x,i.topRight.y)))}else{i.childNode1=new e9(new w.Z(i.bottomLeft.x,i.bottomLeft.y),new w.Z(i.topRight.x,i.bottomLeft.y+n.height));let e=i.bottomLeft.y+n.height+t._borderWidthInPixels;e<i.topRight.y&&(i.childNode2=new e9(new w.Z(i.bottomLeft.x,e),new w.Z(i.topRight.x,i.topRight.y)))}return e(t,i.childNode1,n)}return e(t,i.childNode1,n)||e(t,i.childNode2,n)}}(t,t._root,i);if((0,_.Z)(r)){r.imageIndex=n;let e=t._texture.width,o=t._texture.height,a=r.topRight.x-r.bottomLeft.x,s=r.topRight.y-r.bottomLeft.y,l=r.bottomLeft.x/e,c=r.bottomLeft.y/o;t._textureCoordinates[n]=new x.Z(l,c,a/e,s/o),t._texture.copyFrom({source:i,xOffset:r.bottomLeft.x,yOffset:r.bottomLeft.y})}else(function(e,t){let i=e._context,n=e.numberOfImages,r=e._borderWidthInPixels;if(n>0){let n=e._texture.width,o=e._texture.height,a=2*(n+t.width+r),s=2*(o+t.height+r),l=n/a,c=o/s,u=new e9(new w.Z(n+r,r),new w.Z(a,o)),h=new e9(new w.Z,new w.Z(a,o),e._root,u),d=new e9(new w.Z(r,o+r),new w.Z(a,s)),f=new e9(new w.Z,new w.Z(a,s),h,d);for(let t=0;t<e._textureCoordinates.length;t++){let i=e._textureCoordinates[t];(0,_.Z)(i)&&(i.x*=l,i.y*=c,i.width*=l,i.height*=c)}let p=new e5.Z({context:e._context,width:a,height:s,pixelFormat:e._pixelFormat}),m=new e4.Z({context:i,colorTextures:[e._texture],destroyAttachments:!1});m._bind(),p.copyFromFramebuffer(0,0,0,0,a,s),m._unBind(),m.destroy(),e._texture=e._texture&&e._texture.destroy(),e._texture=p,e._root=f}else{let i=2*(t.width+2*r),n=2*(t.height+2*r);i<e._initialSize.x&&(i=e._initialSize.x),n<e._initialSize.y&&(n=e._initialSize.y),e._texture=e._texture&&e._texture.destroy(),e._texture=new e5.Z({context:e._context,width:i,height:n,pixelFormat:e._pixelFormat}),e._root=new e9(new w.Z(r,r),new w.Z(i,n))}})(t,i),e(t,i,n);t._guid=(0,es.Z)()}(e,t,i),i}Object.defineProperties(e6.prototype,{borderWidthInPixels:{get:function(){return this._borderWidthInPixels}},textureCoordinates:{get:function(){return this._textureCoordinates}},texture:{get:function(){return(0,_.Z)(this._texture)||(this._texture=new e5.Z({context:this._context,width:this._initialSize.x,height:this._initialSize.y,pixelFormat:this._pixelFormat})),this._texture}},numberOfImages:{get:function(){return this._textureCoordinates.length}},guid:{get:function(){return this._guid}}}),e6.prototype.getImageIndex=function(e){if(!(0,_.Z)(e))throw new A.Z("id is required.");return this._indexHash[e]},e6.prototype.addImageSync=function(e,t){if(!(0,_.Z)(e))throw new A.Z("id is required.");if(!(0,_.Z)(t))throw new A.Z("image is required.");let i=this._indexHash[e];return(0,_.Z)(i)||(i=e7(this,t),this._idHash[e]=Promise.resolve(i),this._indexHash[e]=i),i},e6.prototype.addImage=function(e,t){if(!(0,_.Z)(e))throw new A.Z("id is required.");if(!(0,_.Z)(t))throw new A.Z("image is required.");let i=this._idHash[e];if((0,_.Z)(i))return i;if("function"==typeof t){if(t=t(e),!(0,_.Z)(t))throw new A.Z("image is required.")}else("string"==typeof t||t instanceof ec.Z)&&(t=ec.Z.createIfNeeded(t).fetchImage());let n=this;return i=Promise.resolve(t).then(function(t){let i=e7(n,t);return n._indexHash[e]=i,i}),this._idHash[e]=i,i},e6.prototype.addSubRegion=function(e,t){if(!(0,_.Z)(e))throw new A.Z("id is required.");if(!(0,_.Z)(t))throw new A.Z("subRegion is required.");let i=this._idHash[e];if(!(0,_.Z)(i))throw new e3.Z(`image with id "${e}" not found in the atlas.`);let n=this;return Promise.resolve(i).then(function(i){if(-1===i)return -1;let r=n._texture.width,o=n._texture.height,a=n._textureCoordinates[i],s=a.x+t.x/r,l=a.y+t.y/o,c=t.width/r,u=t.height/o,h=n._textureCoordinates.push(new x.Z(s,l,c,u))-1;return n._indexHash[e]=h,n._guid=(0,es.Z)(),h})},e6.prototype.isDestroyed=function(){return!1},e6.prototype.destroy=function(){return this._texture=this._texture&&this._texture.destroy(),(0,g.Z)(this)};let te=ed.SHOW_INDEX,tt=ed.POSITION_INDEX,ti=ed.PIXEL_OFFSET_INDEX,tn=ed.EYE_OFFSET_INDEX,tr=ed.HORIZONTAL_ORIGIN_INDEX,to=ed.VERTICAL_ORIGIN_INDEX,ta=ed.SCALE_INDEX,ts=ed.IMAGE_INDEX_INDEX,tl=ed.COLOR_INDEX,tc=ed.ROTATION_INDEX,tu=ed.ALIGNED_AXIS_INDEX,th=ed.SCALE_BY_DISTANCE_INDEX,td=ed.TRANSLUCENCY_BY_DISTANCE_INDEX,tf=ed.PIXEL_OFFSET_SCALE_BY_DISTANCE_INDEX,tp=ed.DISTANCE_DISPLAY_CONDITION,tm=ed.DISABLE_DEPTH_DISTANCE,t_=ed.TEXTURE_COORDINATE_BOUNDS,tg=ed.SDF_INDEX,tZ=ed.NUMBER_OF_PROPERTIES,ty={positionHighAndScale:0,positionLowAndRotation:1,compressedAttribute0:2,compressedAttribute1:3,compressedAttribute2:4,eyeOffset:5,scaleByDistance:6,pixelOffsetScaleByDistance:7,compressedAttribute3:8,textureCoordinateBoundsOrLabelTranslate:9,a_batchId:10,sdf:11},tb={direction:0,positionHighAndScale:1,positionLowAndRotation:2,compressedAttribute0:3,compressedAttribute1:4,compressedAttribute2:5,eyeOffset:6,scaleByDistance:7,pixelOffsetScaleByDistance:8,compressedAttribute3:9,textureCoordinateBoundsOrLabelTranslate:10,a_batchId:11,sdf:12};function tv(e){e=(0,m.Z)(e,m.Z.EMPTY_OBJECT),this._scene=e.scene,this._batchTable=e.batchTable,this._textureAtlas=void 0,this._textureAtlasGUID=void 0,this._destroyTextureAtlas=!0,this._sp=void 0,this._spTranslucent=void 0,this._rsOpaque=void 0,this._rsTranslucent=void 0,this._vaf=void 0,this._billboards=[],this._billboardsToUpdate=[],this._billboardsToUpdateIndex=0,this._billboardsRemoved=!1,this._createVertexArray=!1,this._shaderRotation=!1,this._compiledShaderRotation=!1,this._shaderAlignedAxis=!1,this._compiledShaderAlignedAxis=!1,this._shaderScaleByDistance=!1,this._compiledShaderScaleByDistance=!1,this._shaderTranslucencyByDistance=!1,this._compiledShaderTranslucencyByDistance=!1,this._shaderPixelOffsetScaleByDistance=!1,this._compiledShaderPixelOffsetScaleByDistance=!1,this._shaderDistanceDisplayCondition=!1,this._compiledShaderDistanceDisplayCondition=!1,this._shaderDisableDepthDistance=!1,this._compiledShaderDisableDepthDistance=!1,this._shaderClampToGround=!1,this._compiledShaderClampToGround=!1,this._propertiesChanged=new Uint32Array(tZ),this._maxSize=0,this._maxEyeOffset=0,this._maxScale=1,this._maxPixelOffset=0,this._allHorizontalCenter=!0,this._allVerticalCenter=!0,this._allSizedInMeters=!0,this._baseVolume=new f.Z,this._baseVolumeWC=new f.Z,this._baseVolume2D=new f.Z,this._boundingVolume=new f.Z,this._boundingVolumeDirty=!1,this._colorCommands=[],this.show=(0,m.Z)(e.show,!0),this.modelMatrix=er.Z.clone((0,m.Z)(e.modelMatrix,er.Z.IDENTITY)),this._modelMatrix=er.Z.clone(er.Z.IDENTITY),this.debugShowBoundingVolume=(0,m.Z)(e.debugShowBoundingVolume,!1),this.debugShowTextureAtlas=(0,m.Z)(e.debugShowTextureAtlas,!1),this.blendOption=(0,m.Z)(e.blendOption,e0.OPAQUE_AND_TRANSLUCENT),this._blendOption=void 0,this._mode=eu.Z.SCENE3D,this._buffersUsage=[eV.Z.STATIC_DRAW,eV.Z.STATIC_DRAW,eV.Z.STATIC_DRAW,eV.Z.STATIC_DRAW,eV.Z.STATIC_DRAW,eV.Z.STATIC_DRAW,eV.Z.STATIC_DRAW,eV.Z.STATIC_DRAW,eV.Z.STATIC_DRAW,eV.Z.STATIC_DRAW,eV.Z.STATIC_DRAW,eV.Z.STATIC_DRAW,eV.Z.STATIC_DRAW,eV.Z.STATIC_DRAW,eV.Z.STATIC_DRAW,eV.Z.STATIC_DRAW],this._highlightColor=C.Z.clone(C.Z.WHITE);let t=this;this._uniforms={u_atlas:function(){return t._textureAtlas.texture},u_highlightColor:function(){return t._highlightColor}};let i=this._scene;(0,_.Z)(i)&&(0,_.Z)(i.terrainProviderChanged)&&(this._removeCallbackFunc=i.terrainProviderChanged.addEventListener(function(){let e=this._billboards,t=e.length;for(let i=0;i<t;++i)(0,_.Z)(e[i])&&e[i]._updateClamping()},this))}function tT(e){let t=e.length;for(let i=0;i<t;++i)e[i]&&e[i]._destroy()}function tE(e){if(e._billboardsRemoved){e._billboardsRemoved=!1;let t=[],i=e._billboards,n=i.length;for(let e=0,r=0;e<n;++e){let n=i[e];(0,_.Z)(n)&&(n._index=r++,t.push(n))}e._billboards=t}}function tx(e){let t=e.cache.billboardCollection_indexBufferBatched;if((0,_.Z)(t))return t;let i=new Uint16Array(98298);for(let e=0,t=0;e<98298;e+=6,t+=4)i[e]=t,i[e+1]=t+1,i[e+2]=t+2,i[e+3]=t+0,i[e+4]=t+2,i[e+5]=t+3;return(t=ek.Z.createIndexBuffer({context:e,typedArray:i,usage:eV.Z.STATIC_DRAW,indexDatatype:ez.Z.UNSIGNED_SHORT})).vertexArrayDestroyable=!1,e.cache.billboardCollection_indexBufferBatched=t,t}function tw(e){let t=e.cache.billboardCollection_indexBufferInstanced;return(0,_.Z)(t)||((t=ek.Z.createIndexBuffer({context:e,typedArray:new Uint16Array([0,1,2,0,2,3]),usage:eV.Z.STATIC_DRAW,indexDatatype:ez.Z.UNSIGNED_SHORT})).vertexArrayDestroyable=!1,e.cache.billboardCollection_indexBufferInstanced=t),t}Object.defineProperties(tv.prototype,{length:{get:function(){return tE(this),this._billboards.length}},textureAtlas:{get:function(){return this._textureAtlas},set:function(e){this._textureAtlas!==e&&(this._textureAtlas=this._destroyTextureAtlas&&this._textureAtlas&&this._textureAtlas.destroy(),this._textureAtlas=e,this._createVertexArray=!0)}},destroyTextureAtlas:{get:function(){return this._destroyTextureAtlas},set:function(e){this._destroyTextureAtlas=e}}}),tv.prototype.add=function(e){let t=new ed(e,this);return t._index=this._billboards.length,this._billboards.push(t),this._createVertexArray=!0,t},tv.prototype.remove=function(e){return!!this.contains(e)&&(this._billboards[e._index]=void 0,this._billboardsRemoved=!0,this._createVertexArray=!0,e._destroy(),!0)},tv.prototype.removeAll=function(){tT(this._billboards),this._billboards=[],this._billboardsToUpdate=[],this._billboardsToUpdateIndex=0,this._billboardsRemoved=!1,this._createVertexArray=!0},tv.prototype._updateBillboard=function(e,t){e._dirty||(this._billboardsToUpdate[this._billboardsToUpdateIndex++]=e),++this._propertiesChanged[t]},tv.prototype.contains=function(e){return(0,_.Z)(e)&&e._billboardCollection===this},tv.prototype.get=function(e){return p.Z.typeOf.number("index",e),tE(this),this._billboards[e]},tv.prototype.computeNewBuffersUsage=function(){let e=this._buffersUsage,t=!1,i=this._propertiesChanged;for(let n=0;n<tZ;++n){let r=0===i[n]?eV.Z.STATIC_DRAW:eV.Z.STREAM_DRAW;t=t||e[n]!==r,e[n]=r}return t};let tS=new eF.Z;function tC(e,t,i,r,o){let a;let s=r[n.positionHighAndScale],l=r[n.positionLowAndRotation],c=o._getActualPosition();e._mode===eu.Z.SCENE3D&&(f.Z.expand(e._baseVolume,c,e._baseVolume),e._boundingVolumeDirty=!0),eF.Z.fromCartesian(c,tS);let u=o.scale,h=o.rotation;0!==h&&(e._shaderRotation=!0),e._maxScale=Math.max(e._maxScale,u);let d=tS.high,p=tS.low;e._instanced?(s(a=o._index,d.x,d.y,d.z,u),l(a,p.x,p.y,p.z,h)):(s((a=4*o._index)+0,d.x,d.y,d.z,u),s(a+1,d.x,d.y,d.z,u),s(a+2,d.x,d.y,d.z,u),s(a+3,d.x,d.y,d.z,u),l(a+0,p.x,p.y,p.z,h),l(a+1,p.x,p.y,p.z,h),l(a+2,p.x,p.y,p.z,h),l(a+3,p.x,p.y,p.z,h))}let tA=new w.Z,tI=1/256;function tO(e,t,i,r,o){let a;let s=r[n.compressedAttribute0],l=o.pixelOffset,c=l.x,u=l.y,h=o._translate,d=h.x,f=h.y;e._maxPixelOffset=Math.max(e._maxPixelOffset,Math.abs(c+d),Math.abs(-u+f));let p=o.horizontalOrigin,m=o._verticalOrigin,g=o.show&&o.clusterShow;0===o.color.alpha&&(g=!1),m===R.BASELINE&&(m=R.BOTTOM),e._allHorizontalCenter=e._allHorizontalCenter&&p===P.CENTER,e._allVerticalCenter=e._allVerticalCenter&&m===R.CENTER;let Z=0,y=0,b=0,v=0,T=o._imageIndex;if(-1!==T){let e=i[T];if(!(0,_.Z)(e))throw new A.Z(`Invalid billboard image index: ${T}`);Z=e.x,y=e.y,b=e.width,v=e.height}let E=Z+b,x=y+v,w=128*Math.floor(eB.Z.clamp(c,-32768,32768)+32768);w+=(p+1)*32+(m+1)*8+(g?1:0)*4;let S=256*Math.floor(eB.Z.clamp(u,-32768,32768)+32768),C=256*Math.floor(eB.Z.clamp(d,-32768,32768)+32768),I=(eB.Z.clamp(f,-32768,32768)+32768)*tI,O=Math.floor(I);S+=O,C+=Math.floor((I-O)*256),tA.x=Z,tA.y=y;let D=eL.Z.compressTextureCoordinates(tA);tA.x=E;let N=eL.Z.compressTextureCoordinates(tA);tA.y=x;let L=eL.Z.compressTextureCoordinates(tA);tA.x=Z;let M=eL.Z.compressTextureCoordinates(tA);e._instanced?s(a=o._index,w,S,C,D):(s((a=4*o._index)+0,w+0,S,C,D),s(a+1,w+2,S,C,N),s(a+2,w+3,S,C,L),s(a+3,w+1,S,C,M))}function tD(e,t,i,r,o){let a;let s=r[n.compressedAttribute1],l=o.alignedAxis;S.Z.equals(l,S.Z.ZERO)||(e._shaderAlignedAxis=!0);let c=0,u=1,h=1,d=1,f=o.translucencyByDistance;(0,_.Z)(f)&&(c=f.near,u=f.nearValue,h=f.far,d=f.farValue,(1!==u||1!==d)&&(e._shaderTranslucencyByDistance=!0));let p=0,g=o._imageIndex;if(-1!==g){let e=i[g];if(!(0,_.Z)(e))throw new A.Z(`Invalid billboard image index: ${g}`);p=e.width}let Z=e._textureAtlas.texture.width,y=Math.round((0,m.Z)(o.width,Z*p));e._maxSize=Math.max(e._maxSize,y);let b=eB.Z.clamp(y,0,65536),v=0;Math.abs(S.Z.magnitudeSquared(l)-1)<eB.Z.EPSILON6&&(v=eL.Z.octEncodeFloat(l)),b=256*b+(u=1===(u=eB.Z.clamp(u,0,1))?255:255*u|0),v=256*v+(d=1===(d=eB.Z.clamp(d,0,1))?255:255*d|0),e._instanced?s(a=o._index,b,v,c,h):(s((a=4*o._index)+0,b,v,c,h),s(a+1,b,v,c,h),s(a+2,b,v,c,h),s(a+3,b,v,c,h))}function tP(e,t,i,r,o){let a;let s=r[n.compressedAttribute2],l=o.color,c=(0,_.Z)(e._batchTable)?C.Z.WHITE:o.getPickId(t.context).color,u=o.sizeInMeters?1:0,h=Math.abs(S.Z.magnitudeSquared(o.alignedAxis)-1)<eB.Z.EPSILON6?1:0;e._allSizedInMeters=e._allSizedInMeters&&1===u;let d=0,f=o._imageIndex;if(-1!==f){let e=i[f];if(!(0,_.Z)(e))throw new A.Z(`Invalid billboard image index: ${f}`);d=e.height}let p=e._textureAtlas.texture.dimensions,g=Math.round((0,m.Z)(o.height,p.y*d));e._maxSize=Math.max(e._maxSize,g);let Z=(0,m.Z)(o._labelHorizontalOrigin,-2),y=4*g+(Z+=2),b=C.Z.floatToByte(l.red),v=C.Z.floatToByte(l.green),T=C.Z.floatToByte(l.blue),E=65536*b+256*v+T,x=65536*(b=C.Z.floatToByte(c.red))+256*(v=C.Z.floatToByte(c.green))+(T=C.Z.floatToByte(c.blue)),w=65536*C.Z.floatToByte(l.alpha)+256*C.Z.floatToByte(c.alpha);w+=2*u+h,e._instanced?s(a=o._index,E,x,w,y):(s((a=4*o._index)+0,E,x,w,y),s(a+1,E,x,w,y),s(a+2,E,x,w,y),s(a+3,E,x,w,y))}function tR(e,t,i,r,o){let a;let s=r[n.eyeOffset],l=o.eyeOffset,c=l.z;if(o._heightReference!==D.ZP.NONE&&(c*=1.005),e._maxEyeOffset=Math.max(e._maxEyeOffset,Math.abs(l.x),Math.abs(l.y),Math.abs(c)),e._instanced){let e=0,t=0,n=o._imageIndex;if(-1!==n){let r=i[n];if(!(0,_.Z)(r))throw new A.Z(`Invalid billboard image index: ${n}`);e=r.width,t=r.height}tA.x=e,tA.y=t;let r=eL.Z.compressTextureCoordinates(tA);s(a=o._index,l.x,l.y,c,r)}else s((a=4*o._index)+0,l.x,l.y,c,0),s(a+1,l.x,l.y,c,0),s(a+2,l.x,l.y,c,0),s(a+3,l.x,l.y,c,0)}function tN(e,t,i,r,o){let a;let s=r[n.scaleByDistance],l=0,c=1,u=1,h=1,d=o.scaleByDistance;(0,_.Z)(d)&&(l=d.near,c=d.nearValue,u=d.far,h=d.farValue,(1!==c||1!==h)&&(e._shaderScaleByDistance=!0)),e._instanced?s(a=o._index,l,c,u,h):(s((a=4*o._index)+0,l,c,u,h),s(a+1,l,c,u,h),s(a+2,l,c,u,h),s(a+3,l,c,u,h))}function tL(e,t,i,r,o){let a;let s=r[n.pixelOffsetScaleByDistance],l=0,c=1,u=1,h=1,d=o.pixelOffsetScaleByDistance;(0,_.Z)(d)&&(l=d.near,c=d.nearValue,u=d.far,h=d.farValue,(1!==c||1!==h)&&(e._shaderPixelOffsetScaleByDistance=!0)),e._instanced?s(a=o._index,l,c,u,h):(s((a=4*o._index)+0,l,c,u,h),s(a+1,l,c,u,h),s(a+2,l,c,u,h),s(a+3,l,c,u,h))}function tM(e,t,i,r,o){let a,s,l;let c=r[n.compressedAttribute3],u=0,h=Number.MAX_VALUE,d=o.distanceDisplayCondition;(0,_.Z)(d)&&(u=d.near,h=d.far,u*=u,h*=h,e._shaderDistanceDisplayCondition=!0);let f=o.disableDepthTestDistance,p=(0,D.c1)(o.heightReference)&&t.context.depthTexture;if((0,_.Z)(f)||(f=p?5e3:0),f*=f,(p||f>0)&&(e._shaderDisableDepthDistance=!0,f===Number.POSITIVE_INFINITY&&(f=-1)),(0,_.Z)(o._labelDimensions))l=o._labelDimensions.x,s=o._labelDimensions.y;else{let t=0,n=0,r=o._imageIndex;if(-1!==r){let e=i[r];if(!(0,_.Z)(e))throw new A.Z(`Invalid billboard image index: ${r}`);t=e.height,n=e.width}s=Math.round((0,m.Z)(o.height,e._textureAtlas.texture.dimensions.y*t));let a=e._textureAtlas.texture.width;l=Math.round((0,m.Z)(o.width,a*n))}let g=4096*Math.floor(eB.Z.clamp(l,0,4096))+Math.floor(eB.Z.clamp(s,0,4096));e._instanced?c(a=o._index,u,h,f,g):(c((a=4*o._index)+0,u,h,f,g),c(a+1,u,h,f,g),c(a+2,u,h,f,g),c(a+3,u,h,f,g))}function tF(e,t,i,r,o){let a;if((0,D.c1)(o.heightReference)){let i=e._scene,n=t.context,r=t.globeTranslucencyState.translucent,o=(0,_.Z)(i.globe)&&i.globe.depthTestAgainstTerrain;e._shaderClampToGround=n.depthTexture&&!r&&o}let s=r[n.textureCoordinateBoundsOrLabelTranslate];if(eH.Z.maximumVertexTextureImageUnits>0){let t=0,i=0;(0,_.Z)(o._labelTranslate)&&(t=o._labelTranslate.x,i=o._labelTranslate.y),e._instanced?s(a=o._index,t,i,0,0):(s((a=4*o._index)+0,t,i,0,0),s(a+1,t,i,0,0),s(a+2,t,i,0,0),s(a+3,t,i,0,0));return}let l=0,c=0,u=0,h=0,d=o._imageIndex;if(-1!==d){let e=i[d];if(!(0,_.Z)(e))throw new A.Z(`Invalid billboard image index: ${d}`);l=e.x,c=e.y,u=e.width,h=e.height}let f=l+u,p=c+h;e._instanced?s(a=o._index,l,c,f,p):(s((a=4*o._index)+0,l,c,f,p),s(a+1,l,c,f,p),s(a+2,l,c,f,p),s(a+3,l,c,f,p))}function tz(e,t,i,r,o){let a;if(!e._sdf)return;let s=r[n.sdf],l=o.outlineColor,c=o.outlineWidth,u=65536*C.Z.floatToByte(l.red)+256*C.Z.floatToByte(l.green)+C.Z.floatToByte(l.blue),h=c/e1.RADIUS,d=65536*C.Z.floatToByte(l.alpha)+256*C.Z.floatToByte(h);e._instanced?s(a=o._index,u,d):(s((a=4*o._index)+0,u+0,d),s(a+1,u+2,d),s(a+2,u+3,d),s(a+3,u+1,d))}function tB(e,t,i,n,r,o){let a;n.mode===eu.Z.SCENE3D?(a=e._baseVolume,e._boundingVolumeDirty=!0):a=e._baseVolume2D;let s=[];for(let e=0;e<i;++e){let i=t[e],l=i.position,c=ed._computeActualPosition(i,l,n,r);(0,_.Z)(c)&&(i._setActualPosition(c),o?s.push(c):f.Z.expand(a,c,a))}o&&f.Z.fromPoints(s,a)}let tU=[];tv.prototype.update=function(e){let t,i,o,a,s,l,c;if(tE(this),!this.show)return;let u=this._billboards,h=u.length,d=e.context;this._instanced=d.instancedArrays,n=this._instanced?tb:ty,r=this._instanced?tw:tx;let p=this._textureAtlas;if(!(0,_.Z)(p)){p=this._textureAtlas=new e6({context:d});for(let e=0;e<h;++e)u[e]._loadImage()}let m=p.textureCoordinates;if(0===m.length)return;(function(e,t){let i=t.mode,n=e._billboards,r=e._billboardsToUpdate,o=e._modelMatrix;e._createVertexArray||e._mode!==i||i!==eu.Z.SCENE3D&&!er.Z.equals(o,e.modelMatrix)?(e._mode=i,er.Z.clone(e.modelMatrix,o),e._createVertexArray=!0,(i===eu.Z.SCENE3D||i===eu.Z.SCENE2D||i===eu.Z.COLUMBUS_VIEW)&&tB(e,n,n.length,t,o,!0)):i===eu.Z.MORPHING?tB(e,n,n.length,t,o,!0):(i===eu.Z.SCENE2D||i===eu.Z.COLUMBUS_VIEW)&&tB(e,r,e._billboardsToUpdateIndex,t,o,!1)})(this,e),h=(u=this._billboards).length;let g=this._billboardsToUpdate,Z=this._billboardsToUpdateIndex,y=this._propertiesChanged,b=p.guid,v=this._createVertexArray||this._textureAtlasGUID!==b;this._textureAtlasGUID=b;let T=e.passes,E=T.pick;if(v||!E&&this.computeNewBuffersUsage()){this._createVertexArray=!1;for(let e=0;e<tZ;++e)y[e]=0;if(this._vaf=this._vaf&&this._vaf.destroy(),h>0){this._vaf=function(e,t,i,r,o,a){let s=[{index:n.positionHighAndScale,componentsPerAttribute:4,componentDatatype:eM.Z.FLOAT,usage:i[tt]},{index:n.positionLowAndRotation,componentsPerAttribute:4,componentDatatype:eM.Z.FLOAT,usage:i[tt]},{index:n.compressedAttribute0,componentsPerAttribute:4,componentDatatype:eM.Z.FLOAT,usage:i[ti]},{index:n.compressedAttribute1,componentsPerAttribute:4,componentDatatype:eM.Z.FLOAT,usage:i[td]},{index:n.compressedAttribute2,componentsPerAttribute:4,componentDatatype:eM.Z.FLOAT,usage:i[tl]},{index:n.eyeOffset,componentsPerAttribute:4,componentDatatype:eM.Z.FLOAT,usage:i[tn]},{index:n.scaleByDistance,componentsPerAttribute:4,componentDatatype:eM.Z.FLOAT,usage:i[th]},{index:n.pixelOffsetScaleByDistance,componentsPerAttribute:4,componentDatatype:eM.Z.FLOAT,usage:i[tf]},{index:n.compressedAttribute3,componentsPerAttribute:4,componentDatatype:eM.Z.FLOAT,usage:i[tp]},{index:n.textureCoordinateBoundsOrLabelTranslate,componentsPerAttribute:4,componentDatatype:eM.Z.FLOAT,usage:i[t_]}];if(r){let t;s.push({index:n.direction,componentsPerAttribute:2,componentDatatype:eM.Z.FLOAT,vertexBuffer:(t=e.cache.billboardCollection_vertexBufferInstanced,(0,_.Z)(t)||((t=ek.Z.createVertexBuffer({context:e,typedArray:new Float32Array([0,0,1,0,1,1,0,1]),usage:eV.Z.STATIC_DRAW})).vertexArrayDestroyable=!1,e.cache.billboardCollection_vertexBufferInstanced=t),t)})}return(0,_.Z)(o)&&s.push({index:n.a_batchId,componentsPerAttribute:1,componentDatatype:eM.Z.FLOAT,bufferUsage:eV.Z.STATIC_DRAW}),a&&s.push({index:n.sdf,componentsPerAttribute:2,componentDatatype:eM.Z.FLOAT,usage:i[tg]}),new e$(e,s,r?t:4*t,r)}(d,h,this._buffersUsage,this._instanced,this._batchTable,this._sdf),t=this._vaf.writers;for(let i=0;i<h;++i){var x;let r=this._billboards[i];r._dirty=!1,tC(this,e,m,x=t,r),tO(this,e,m,x,r),tD(this,e,m,x,r),tP(this,e,m,x,r),tR(this,e,m,x,r),tN(this,e,m,x,r),tL(this,e,m,x,r),tM(this,e,m,x,r),tF(this,e,m,x,r),function(e,t,i,r,o){let a;if(!(0,_.Z)(e._batchTable))return;let s=r[n.a_batchId],l=o._batchIndex;e._instanced?s(a=o._index,l):(s((a=4*o._index)+0,l),s(a+1,l),s(a+2,l),s(a+3,l))}(this,0,0,x,r),tz(this,e,m,x,r)}this._vaf.commit(r(d))}this._billboardsToUpdateIndex=0}else if(Z>0){tU.length=0,(y[tt]||y[tc]||y[ta])&&tU.push(tC),(y[ts]||y[ti]||y[tr]||y[to]||y[te])&&(tU.push(tO),this._instanced&&tU.push(tR)),(y[ts]||y[tu]||y[td])&&(tU.push(tD),tU.push(tP)),(y[ts]||y[tl])&&tU.push(tP),y[tn]&&tU.push(tR),y[th]&&tU.push(tN),y[tf]&&tU.push(tL),(y[tp]||y[tm]||y[ts]||y[tt])&&tU.push(tM),(y[ts]||y[tt])&&tU.push(tF),y[tg]&&tU.push(tz);let i=tU.length;if(t=this._vaf.writers,Z/h>.1){for(let n=0;n<Z;++n){let r=g[n];r._dirty=!1;for(let n=0;n<i;++n)tU[n](this,e,m,t,r)}this._vaf.commit(r(d))}else{for(let n=0;n<Z;++n){let r=g[n];r._dirty=!1;for(let n=0;n<i;++n)tU[n](this,e,m,t,r);this._instanced?this._vaf.subCommit(r._index,1):this._vaf.subCommit(4*r._index,4)}this._vaf.endSubCommits()}this._billboardsToUpdateIndex=0}if(Z>1.5*h&&(g.length=h),!(0,_.Z)(this._vaf)||!(0,_.Z)(this._vaf.va))return;this._boundingVolumeDirty&&(this._boundingVolumeDirty=!1,f.Z.transform(this._baseVolume,this.modelMatrix,this._baseVolumeWC));let w=er.Z.IDENTITY;e.mode===eu.Z.SCENE3D?(w=this.modelMatrix,i=f.Z.clone(this._baseVolumeWC,this._boundingVolume)):i=f.Z.clone(this._baseVolume2D,this._boundingVolume),function(e,t,i){let n=1;e._allSizedInMeters&&0===e._maxPixelOffset||(n=t.camera.getPixelSize(i,t.context.drawingBufferWidth,t.context.drawingBufferHeight));let r=n*e._maxScale*e._maxSize*2;e._allHorizontalCenter&&e._allVerticalCenter&&(r*=.5);let o=n*e._maxPixelOffset+e._maxEyeOffset;i.radius+=r+o}(this,e,i);let S=this._blendOption!==this.blendOption;if(this._blendOption=this.blendOption,S){this._blendOption===e0.OPAQUE||this._blendOption===e0.OPAQUE_AND_TRANSLUCENT?this._rsOpaque=eW.Z.fromCache({depthTest:{enabled:!0,func:eU.Z.LESS},depthMask:!0}):this._rsOpaque=void 0;let e=this._blendOption===e0.TRANSLUCENT;this._blendOption===e0.TRANSLUCENT||this._blendOption===e0.OPAQUE_AND_TRANSLUCENT?this._rsTranslucent=eW.Z.fromCache({depthTest:{enabled:!0,func:e?eU.Z.LEQUAL:eU.Z.LESS},depthMask:e,blending:eJ.Z.ALPHA_BLEND}):this._rsTranslucent=void 0}this._shaderDisableDepthDistance=this._shaderDisableDepthDistance||0!==e.minimumDisableDepthTestDistance;let C=eH.Z.maximumVertexTextureImageUnits>0;if(S||this._shaderRotation!==this._compiledShaderRotation||this._shaderAlignedAxis!==this._compiledShaderAlignedAxis||this._shaderScaleByDistance!==this._compiledShaderScaleByDistance||this._shaderTranslucencyByDistance!==this._compiledShaderTranslucencyByDistance||this._shaderPixelOffsetScaleByDistance!==this._compiledShaderPixelOffsetScaleByDistance||this._shaderDistanceDisplayCondition!==this._compiledShaderDistanceDisplayCondition||this._shaderDisableDepthDistance!==this._compiledShaderDisableDepthDistance||this._shaderClampToGround!==this._compiledShaderClampToGround||this._sdf!==this._compiledSDF){o="#ifdef INSTANCED\nin vec2 direction;\n#endif\nin vec4 positionHighAndScale;\nin vec4 positionLowAndRotation;\nin vec4 compressedAttribute0; // pixel offset, translate, horizontal origin, vertical origin, show, direction, texture coordinates (texture offset)\nin vec4 compressedAttribute1; // aligned axis, translucency by distance, image width\nin vec4 compressedAttribute2; // label horizontal origin, image height, color, pick color, size in meters, valid aligned axis, 13 bits free\nin vec4 eyeOffset; // eye offset in meters, 4 bytes free (texture range)\nin vec4 scaleByDistance; // near, nearScale, far, farScale\nin vec4 pixelOffsetScaleByDistance; // near, nearScale, far, farScale\nin vec4 compressedAttribute3; // distance display condition near, far, disableDepthTestDistance, dimensions\nin vec2 sdf; // sdf outline color (rgb) and width (w)\n#if defined(VERTEX_DEPTH_CHECK) || defined(FRAGMENT_DEPTH_CHECK)\nin vec4 textureCoordinateBoundsOrLabelTranslate; // the min and max x and y values for the texture coordinates\n#endif\n#ifdef VECTOR_TILE\nin float a_batchId;\n#endif\n\nout vec2 v_textureCoordinates;\n#ifdef FRAGMENT_DEPTH_CHECK\nout vec4 v_textureCoordinateBounds;\nout vec4 v_originTextureCoordinateAndTranslate;\nout vec4 v_compressed; // x: eyeDepth, y: applyTranslate & enableDepthCheck, z: dimensions, w: imageSize\nout mat2 v_rotationMatrix;\n#endif\n\nout vec4 v_pickColor;\nout vec4 v_color;\n#ifdef SDF\nout vec4 v_outlineColor;\nout float v_outlineWidth;\n#endif\n\nconst float UPPER_BOUND = 32768.0;\n\nconst float SHIFT_LEFT16 = 65536.0;\nconst float SHIFT_LEFT12 = 4096.0;\nconst float SHIFT_LEFT8 = 256.0;\nconst float SHIFT_LEFT7 = 128.0;\nconst float SHIFT_LEFT5 = 32.0;\nconst float SHIFT_LEFT3 = 8.0;\nconst float SHIFT_LEFT2 = 4.0;\nconst float SHIFT_LEFT1 = 2.0;\n\nconst float SHIFT_RIGHT12 = 1.0 / 4096.0;\nconst float SHIFT_RIGHT8 = 1.0 / 256.0;\nconst float SHIFT_RIGHT7 = 1.0 / 128.0;\nconst float SHIFT_RIGHT5 = 1.0 / 32.0;\nconst float SHIFT_RIGHT3 = 1.0 / 8.0;\nconst float SHIFT_RIGHT2 = 1.0 / 4.0;\nconst float SHIFT_RIGHT1 = 1.0 / 2.0;\n\nvec4 addScreenSpaceOffset(vec4 positionEC, vec2 imageSize, float scale, vec2 direction, vec2 origin, vec2 translate, vec2 pixelOffset, vec3 alignedAxis, bool validAlignedAxis, float rotation, bool sizeInMeters, out mat2 rotationMatrix, out float mpp)\n{\n // Note the halfSize cannot be computed in JavaScript because it is sent via\n // compressed vertex attributes that coerce it to an integer.\n vec2 halfSize = imageSize * scale * 0.5;\n halfSize *= ((direction * 2.0) - 1.0);\n\n vec2 originTranslate = origin * abs(halfSize);\n\n#if defined(ROTATION) || defined(ALIGNED_AXIS)\n if (validAlignedAxis || rotation != 0.0)\n {\n float angle = rotation;\n if (validAlignedAxis)\n {\n vec4 projectedAlignedAxis = czm_modelView3D * vec4(alignedAxis, 0.0);\n angle += sign(-projectedAlignedAxis.x) * acos(sign(projectedAlignedAxis.y) * (projectedAlignedAxis.y * projectedAlignedAxis.y) /\n (projectedAlignedAxis.x * projectedAlignedAxis.x + projectedAlignedAxis.y * projectedAlignedAxis.y));\n }\n\n float cosTheta = cos(angle);\n float sinTheta = sin(angle);\n rotationMatrix = mat2(cosTheta, sinTheta, -sinTheta, cosTheta);\n halfSize = rotationMatrix * halfSize;\n }\n else\n {\n rotationMatrix = mat2(1.0, 0.0, 0.0, 1.0);\n }\n#endif\n\n mpp = czm_metersPerPixel(positionEC);\n positionEC.xy += (originTranslate + halfSize) * czm_branchFreeTernary(sizeInMeters, 1.0, mpp);\n positionEC.xy += (translate + pixelOffset) * mpp;\n\n return positionEC;\n}\n\n#ifdef VERTEX_DEPTH_CHECK\nfloat getGlobeDepth(vec4 positionEC)\n{\n vec4 posWC = czm_eyeToWindowCoordinates(positionEC);\n\n float globeDepth = czm_unpackDepth(texture(czm_globeDepthTexture, posWC.xy / czm_viewport.zw));\n\n if (globeDepth == 0.0)\n {\n return 0.0; // not on the globe\n }\n\n vec4 eyeCoordinate = czm_windowToEyeCoordinates(posWC.xy, globeDepth);\n return eyeCoordinate.z / eyeCoordinate.w;\n}\n#endif\nvoid main()\n{\n // Modifying this shader may also require modifications to Billboard._computeScreenSpacePosition\n\n // unpack attributes\n vec3 positionHigh = positionHighAndScale.xyz;\n vec3 positionLow = positionLowAndRotation.xyz;\n float scale = positionHighAndScale.w;\n\n#if defined(ROTATION) || defined(ALIGNED_AXIS)\n float rotation = positionLowAndRotation.w;\n#else\n float rotation = 0.0;\n#endif\n\n float compressed = compressedAttribute0.x;\n\n vec2 pixelOffset;\n pixelOffset.x = floor(compressed * SHIFT_RIGHT7);\n compressed -= pixelOffset.x * SHIFT_LEFT7;\n pixelOffset.x -= UPPER_BOUND;\n\n vec2 origin;\n origin.x = floor(compressed * SHIFT_RIGHT5);\n compressed -= origin.x * SHIFT_LEFT5;\n\n origin.y = floor(compressed * SHIFT_RIGHT3);\n compressed -= origin.y * SHIFT_LEFT3;\n\n#ifdef FRAGMENT_DEPTH_CHECK\n vec2 depthOrigin = origin.xy;\n#endif\n origin -= vec2(1.0);\n\n float show = floor(compressed * SHIFT_RIGHT2);\n compressed -= show * SHIFT_LEFT2;\n\n#ifdef INSTANCED\n vec2 textureCoordinatesBottomLeft = czm_decompressTextureCoordinates(compressedAttribute0.w);\n vec2 textureCoordinatesRange = czm_decompressTextureCoordinates(eyeOffset.w);\n vec2 textureCoordinates = textureCoordinatesBottomLeft + direction * textureCoordinatesRange;\n#else\n vec2 direction;\n direction.x = floor(compressed * SHIFT_RIGHT1);\n direction.y = compressed - direction.x * SHIFT_LEFT1;\n\n vec2 textureCoordinates = czm_decompressTextureCoordinates(compressedAttribute0.w);\n#endif\n\n float temp = compressedAttribute0.y * SHIFT_RIGHT8;\n pixelOffset.y = -(floor(temp) - UPPER_BOUND);\n\n vec2 translate;\n translate.y = (temp - floor(temp)) * SHIFT_LEFT16;\n\n temp = compressedAttribute0.z * SHIFT_RIGHT8;\n translate.x = floor(temp) - UPPER_BOUND;\n\n translate.y += (temp - floor(temp)) * SHIFT_LEFT8;\n translate.y -= UPPER_BOUND;\n\n temp = compressedAttribute1.x * SHIFT_RIGHT8;\n float temp2 = floor(compressedAttribute2.w * SHIFT_RIGHT2);\n\n vec2 imageSize = vec2(floor(temp), temp2);\n\n#ifdef FRAGMENT_DEPTH_CHECK\n float labelHorizontalOrigin = floor(compressedAttribute2.w - (temp2 * SHIFT_LEFT2));\n float applyTranslate = 0.0;\n if (labelHorizontalOrigin != 0.0) // is a billboard, so set apply translate to false\n {\n applyTranslate = 1.0;\n labelHorizontalOrigin -= 2.0;\n depthOrigin.x = labelHorizontalOrigin + 1.0;\n }\n\n depthOrigin = vec2(1.0) - (depthOrigin * 0.5);\n#endif\n\n#ifdef EYE_DISTANCE_TRANSLUCENCY\n vec4 translucencyByDistance;\n translucencyByDistance.x = compressedAttribute1.z;\n translucencyByDistance.z = compressedAttribute1.w;\n\n translucencyByDistance.y = ((temp - floor(temp)) * SHIFT_LEFT8) / 255.0;\n\n temp = compressedAttribute1.y * SHIFT_RIGHT8;\n translucencyByDistance.w = ((temp - floor(temp)) * SHIFT_LEFT8) / 255.0;\n#endif\n\n#if defined(VERTEX_DEPTH_CHECK) || defined(FRAGMENT_DEPTH_CHECK)\n temp = compressedAttribute3.w;\n temp = temp * SHIFT_RIGHT12;\n\n vec2 dimensions;\n dimensions.y = (temp - floor(temp)) * SHIFT_LEFT12;\n dimensions.x = floor(temp);\n#endif\n\n#ifdef ALIGNED_AXIS\n vec3 alignedAxis = czm_octDecode(floor(compressedAttribute1.y * SHIFT_RIGHT8));\n temp = compressedAttribute2.z * SHIFT_RIGHT5;\n bool validAlignedAxis = (temp - floor(temp)) * SHIFT_LEFT1 > 0.0;\n#else\n vec3 alignedAxis = vec3(0.0);\n bool validAlignedAxis = false;\n#endif\n\n vec4 pickColor;\n vec4 color;\n\n temp = compressedAttribute2.y;\n temp = temp * SHIFT_RIGHT8;\n pickColor.b = (temp - floor(temp)) * SHIFT_LEFT8;\n temp = floor(temp) * SHIFT_RIGHT8;\n pickColor.g = (temp - floor(temp)) * SHIFT_LEFT8;\n pickColor.r = floor(temp);\n\n temp = compressedAttribute2.x;\n temp = temp * SHIFT_RIGHT8;\n color.b = (temp - floor(temp)) * SHIFT_LEFT8;\n temp = floor(temp) * SHIFT_RIGHT8;\n color.g = (temp - floor(temp)) * SHIFT_LEFT8;\n color.r = floor(temp);\n\n temp = compressedAttribute2.z * SHIFT_RIGHT8;\n bool sizeInMeters = floor((temp - floor(temp)) * SHIFT_LEFT7) > 0.0;\n temp = floor(temp) * SHIFT_RIGHT8;\n\n pickColor.a = (temp - floor(temp)) * SHIFT_LEFT8;\n pickColor /= 255.0;\n\n color.a = floor(temp);\n color /= 255.0;\n\n ///////////////////////////////////////////////////////////////////////////\n\n vec4 p = czm_translateRelativeToEye(positionHigh, positionLow);\n vec4 positionEC = czm_modelViewRelativeToEye * p;\n\n#if defined(FRAGMENT_DEPTH_CHECK) || defined(VERTEX_DEPTH_CHECK)\n float eyeDepth = positionEC.z;\n#endif\n\n positionEC = czm_eyeOffset(positionEC, eyeOffset.xyz);\n positionEC.xyz *= show;\n\n ///////////////////////////////////////////////////////////////////////////\n\n#if defined(EYE_DISTANCE_SCALING) || defined(EYE_DISTANCE_TRANSLUCENCY) || defined(EYE_DISTANCE_PIXEL_OFFSET) || defined(DISTANCE_DISPLAY_CONDITION) || defined(DISABLE_DEPTH_DISTANCE)\n float lengthSq;\n if (czm_sceneMode == czm_sceneMode2D)\n {\n // 2D camera distance is a special case\n // treat all billboards as flattened to the z=0.0 plane\n lengthSq = czm_eyeHeight2D.y;\n }\n else\n {\n lengthSq = dot(positionEC.xyz, positionEC.xyz);\n }\n#endif\n\n#ifdef EYE_DISTANCE_SCALING\n float distanceScale = czm_nearFarScalar(scaleByDistance, lengthSq);\n scale *= distanceScale;\n translate *= distanceScale;\n // push vertex behind near plane for clipping\n if (scale == 0.0)\n {\n positionEC.xyz = vec3(0.0);\n }\n#endif\n\n float translucency = 1.0;\n#ifdef EYE_DISTANCE_TRANSLUCENCY\n translucency = czm_nearFarScalar(translucencyByDistance, lengthSq);\n // push vertex behind near plane for clipping\n if (translucency == 0.0)\n {\n positionEC.xyz = vec3(0.0);\n }\n#endif\n\n#ifdef EYE_DISTANCE_PIXEL_OFFSET\n float pixelOffsetScale = czm_nearFarScalar(pixelOffsetScaleByDistance, lengthSq);\n pixelOffset *= pixelOffsetScale;\n#endif\n\n#ifdef DISTANCE_DISPLAY_CONDITION\n float nearSq = compressedAttribute3.x;\n float farSq = compressedAttribute3.y;\n if (lengthSq < nearSq || lengthSq > farSq)\n {\n positionEC.xyz = vec3(0.0);\n }\n#endif\n\n mat2 rotationMatrix;\n float mpp;\n\n#ifdef DISABLE_DEPTH_DISTANCE\n float disableDepthTestDistance = compressedAttribute3.z;\n#endif\n\n#ifdef VERTEX_DEPTH_CHECK\nif (lengthSq < disableDepthTestDistance) {\n float depthsilon = 10.0;\n\n vec2 labelTranslate = textureCoordinateBoundsOrLabelTranslate.xy;\n vec4 pEC1 = addScreenSpaceOffset(positionEC, dimensions, scale, vec2(0.0), origin, labelTranslate, pixelOffset, alignedAxis, validAlignedAxis, rotation, sizeInMeters, rotationMatrix, mpp);\n float globeDepth1 = getGlobeDepth(pEC1);\n\n if (globeDepth1 != 0.0 && pEC1.z + depthsilon < globeDepth1)\n {\n vec4 pEC2 = addScreenSpaceOffset(positionEC, dimensions, scale, vec2(0.0, 1.0), origin, labelTranslate, pixelOffset, alignedAxis, validAlignedAxis, rotation, sizeInMeters, rotationMatrix, mpp);\n float globeDepth2 = getGlobeDepth(pEC2);\n\n if (globeDepth2 != 0.0 && pEC2.z + depthsilon < globeDepth2)\n {\n vec4 pEC3 = addScreenSpaceOffset(positionEC, dimensions, scale, vec2(1.0), origin, labelTranslate, pixelOffset, alignedAxis, validAlignedAxis, rotation, sizeInMeters, rotationMatrix, mpp);\n float globeDepth3 = getGlobeDepth(pEC3);\n if (globeDepth3 != 0.0 && pEC3.z + depthsilon < globeDepth3)\n {\n positionEC.xyz = vec3(0.0);\n }\n }\n }\n}\n#endif\n\n positionEC = addScreenSpaceOffset(positionEC, imageSize, scale, direction, origin, translate, pixelOffset, alignedAxis, validAlignedAxis, rotation, sizeInMeters, rotationMatrix, mpp);\n gl_Position = czm_projection * positionEC;\n v_textureCoordinates = textureCoordinates;\n\n#ifdef LOG_DEPTH\n czm_vertexLogDepth();\n#endif\n\n#ifdef DISABLE_DEPTH_DISTANCE\n if (disableDepthTestDistance == 0.0 && czm_minimumDisableDepthTestDistance != 0.0)\n {\n disableDepthTestDistance = czm_minimumDisableDepthTestDistance;\n }\n\n if (disableDepthTestDistance != 0.0)\n {\n // Don't try to \"multiply both sides\" by w. Greater/less-than comparisons won't work for negative values of w.\n float zclip = gl_Position.z / gl_Position.w;\n bool clipped = (zclip < -1.0 || zclip > 1.0);\n if (!clipped && (disableDepthTestDistance < 0.0 || (lengthSq > 0.0 && lengthSq < disableDepthTestDistance)))\n {\n // Position z on the near plane.\n gl_Position.z = -gl_Position.w;\n#ifdef LOG_DEPTH\n v_depthFromNearPlusOne = 1.0;\n#endif\n }\n }\n#endif\n\n#ifdef FRAGMENT_DEPTH_CHECK\n if (sizeInMeters) {\n translate /= mpp;\n dimensions /= mpp;\n imageSize /= mpp;\n }\n\n#if defined(ROTATION) || defined(ALIGNED_AXIS)\n v_rotationMatrix = rotationMatrix;\n#else\n v_rotationMatrix = mat2(1.0, 0.0, 0.0, 1.0);\n#endif\n\n float enableDepthCheck = 0.0;\n if (lengthSq < disableDepthTestDistance)\n {\n enableDepthCheck = 1.0;\n }\n\n float dw = floor(clamp(dimensions.x, 0.0, SHIFT_LEFT12));\n float dh = floor(clamp(dimensions.y, 0.0, SHIFT_LEFT12));\n\n float iw = floor(clamp(imageSize.x, 0.0, SHIFT_LEFT12));\n float ih = floor(clamp(imageSize.y, 0.0, SHIFT_LEFT12));\n\n v_compressed.x = eyeDepth;\n v_compressed.y = applyTranslate * SHIFT_LEFT1 + enableDepthCheck;\n v_compressed.z = dw * SHIFT_LEFT12 + dh;\n v_compressed.w = iw * SHIFT_LEFT12 + ih;\n v_originTextureCoordinateAndTranslate.xy = depthOrigin;\n v_originTextureCoordinateAndTranslate.zw = translate;\n v_textureCoordinateBounds = textureCoordinateBoundsOrLabelTranslate;\n\n#endif\n\n#ifdef SDF\n vec4 outlineColor;\n float outlineWidth;\n\n temp = sdf.x;\n temp = temp * SHIFT_RIGHT8;\n outlineColor.b = (temp - floor(temp)) * SHIFT_LEFT8;\n temp = floor(temp) * SHIFT_RIGHT8;\n outlineColor.g = (temp - floor(temp)) * SHIFT_LEFT8;\n outlineColor.r = floor(temp);\n\n temp = sdf.y;\n temp = temp * SHIFT_RIGHT8;\n float temp3 = (temp - floor(temp)) * SHIFT_LEFT8;\n temp = floor(temp) * SHIFT_RIGHT8;\n outlineWidth = (temp - floor(temp)) * SHIFT_LEFT8;\n outlineColor.a = floor(temp);\n outlineColor /= 255.0;\n\n v_outlineWidth = outlineWidth / 255.0;\n v_outlineColor = outlineColor;\n v_outlineColor.a *= translucency;\n#endif\n\n v_pickColor = pickColor;\n\n v_color = color;\n v_color.a *= translucency;\n\n}\n",a='uniform sampler2D u_atlas;\n\n#ifdef VECTOR_TILE\nuniform vec4 u_highlightColor;\n#endif\n\nin vec2 v_textureCoordinates;\nin vec4 v_pickColor;\nin vec4 v_color;\n\n#ifdef SDF\nin vec4 v_outlineColor;\nin float v_outlineWidth;\n#endif\n\n#ifdef FRAGMENT_DEPTH_CHECK\nin vec4 v_textureCoordinateBounds; // the min and max x and y values for the texture coordinates\nin vec4 v_originTextureCoordinateAndTranslate; // texture coordinate at the origin, billboard translate (used for label glyphs)\nin vec4 v_compressed; // x: eyeDepth, y: applyTranslate & enableDepthCheck, z: dimensions, w: imageSize\nin mat2 v_rotationMatrix;\n\nconst float SHIFT_LEFT12 = 4096.0;\nconst float SHIFT_LEFT1 = 2.0;\n\nconst float SHIFT_RIGHT12 = 1.0 / 4096.0;\nconst float SHIFT_RIGHT1 = 1.0 / 2.0;\n\nfloat getGlobeDepth(vec2 adjustedST, vec2 depthLookupST, bool applyTranslate, vec2 dimensions, vec2 imageSize)\n{\n vec2 lookupVector = imageSize * (depthLookupST - adjustedST);\n lookupVector = v_rotationMatrix * lookupVector;\n vec2 labelOffset = (dimensions - imageSize) * (depthLookupST - vec2(0.0, v_originTextureCoordinateAndTranslate.y)); // aligns label glyph with bounding rectangle. Will be zero for billboards because dimensions and imageSize will be equal\n\n vec2 translation = v_originTextureCoordinateAndTranslate.zw;\n\n if (applyTranslate)\n {\n // this is only needed for labels where the horizontal origin is not LEFT\n // it moves the label back to where the "origin" should be since all label glyphs are set to HorizontalOrigin.LEFT\n translation += (dimensions * v_originTextureCoordinateAndTranslate.xy * vec2(1.0, 0.0));\n }\n\n vec2 st = ((lookupVector - translation + labelOffset) + gl_FragCoord.xy) / czm_viewport.zw;\n float logDepthOrDepth = czm_unpackDepth(texture(czm_globeDepthTexture, st));\n\n if (logDepthOrDepth == 0.0)\n {\n return 0.0; // not on the globe\n }\n\n vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, logDepthOrDepth);\n return eyeCoordinate.z / eyeCoordinate.w;\n}\n#endif\n\n\n#ifdef SDF\n\n// Get the distance from the edge of a glyph at a given position sampling an SDF texture.\nfloat getDistance(vec2 position)\n{\n return texture(u_atlas, position).r;\n}\n\n// Samples the sdf texture at the given position and produces a color based on the fill color and the outline.\nvec4 getSDFColor(vec2 position, float outlineWidth, vec4 outlineColor, float smoothing)\n{\n float distance = getDistance(position);\n\n if (outlineWidth > 0.0)\n {\n // Don\'t get the outline edge exceed the SDF_EDGE\n float outlineEdge = clamp(SDF_EDGE - outlineWidth, 0.0, SDF_EDGE);\n float outlineFactor = smoothstep(SDF_EDGE - smoothing, SDF_EDGE + smoothing, distance);\n vec4 sdfColor = mix(outlineColor, v_color, outlineFactor);\n float alpha = smoothstep(outlineEdge - smoothing, outlineEdge + smoothing, distance);\n return vec4(sdfColor.rgb, sdfColor.a * alpha);\n }\n else\n {\n float alpha = smoothstep(SDF_EDGE - smoothing, SDF_EDGE + smoothing, distance);\n return vec4(v_color.rgb, v_color.a * alpha);\n }\n}\n#endif\n\nvoid main()\n{\n vec4 color = texture(u_atlas, v_textureCoordinates);\n\n#ifdef SDF\n float outlineWidth = v_outlineWidth;\n vec4 outlineColor = v_outlineColor;\n\n // Get the current distance\n float distance = getDistance(v_textureCoordinates);\n\n#if (__VERSION__ == 300 || defined(GL_OES_standard_derivatives))\n float smoothing = fwidth(distance);\n // Get an offset that is approximately half the distance to the neighbor pixels\n // 0.354 is approximately half of 1/sqrt(2)\n vec2 sampleOffset = 0.354 * vec2(dFdx(v_textureCoordinates) + dFdy(v_textureCoordinates));\n\n // Sample the center point\n vec4 center = getSDFColor(v_textureCoordinates, outlineWidth, outlineColor, smoothing);\n\n // Sample the 4 neighbors\n vec4 color1 = getSDFColor(v_textureCoordinates + vec2(sampleOffset.x, sampleOffset.y), outlineWidth, outlineColor, smoothing);\n vec4 color2 = getSDFColor(v_textureCoordinates + vec2(-sampleOffset.x, sampleOffset.y), outlineWidth, outlineColor, smoothing);\n vec4 color3 = getSDFColor(v_textureCoordinates + vec2(-sampleOffset.x, -sampleOffset.y), outlineWidth, outlineColor, smoothing);\n vec4 color4 = getSDFColor(v_textureCoordinates + vec2(sampleOffset.x, -sampleOffset.y), outlineWidth, outlineColor, smoothing);\n\n // Equally weight the center sample and the 4 neighboring samples\n color = (center + color1 + color2 + color3 + color4)/5.0;\n#else\n // If no derivatives available (IE 10?), just do a single sample\n float smoothing = 1.0/32.0;\n color = getSDFColor(v_textureCoordinates, outlineWidth, outlineColor, smoothing);\n#endif\n\n color = czm_gammaCorrect(color);\n#else\n color = czm_gammaCorrect(color);\n color *= czm_gammaCorrect(v_color);\n#endif\n\n// Fully transparent parts of the billboard are not pickable.\n#if !defined(OPAQUE) && !defined(TRANSLUCENT)\n if (color.a < 0.005) // matches 0/255 and 1/255\n {\n discard;\n }\n#else\n// The billboard is rendered twice. The opaque pass discards translucent fragments\n// and the translucent pass discards opaque fragments.\n#ifdef OPAQUE\n if (color.a < 0.995) // matches < 254/255\n {\n discard;\n }\n#else\n if (color.a >= 0.995) // matches 254/255 and 255/255\n {\n discard;\n }\n#endif\n#endif\n\n#ifdef VECTOR_TILE\n color *= u_highlightColor;\n#endif\n out_FragColor = color;\n\n#ifdef LOG_DEPTH\n czm_writeLogDepth();\n#endif\n\n#ifdef FRAGMENT_DEPTH_CHECK\n float temp = v_compressed.y;\n\n temp = temp * SHIFT_RIGHT1;\n\n float temp2 = (temp - floor(temp)) * SHIFT_LEFT1;\n bool enableDepthTest = temp2 != 0.0;\n bool applyTranslate = floor(temp) != 0.0;\n\n if (enableDepthTest) {\n temp = v_compressed.z;\n temp = temp * SHIFT_RIGHT12;\n\n vec2 dimensions;\n dimensions.y = (temp - floor(temp)) * SHIFT_LEFT12;\n dimensions.x = floor(temp);\n\n temp = v_compressed.w;\n temp = temp * SHIFT_RIGHT12;\n\n vec2 imageSize;\n imageSize.y = (temp - floor(temp)) * SHIFT_LEFT12;\n imageSize.x = floor(temp);\n\n vec2 adjustedST = v_textureCoordinates - v_textureCoordinateBounds.xy;\n adjustedST = adjustedST / vec2(v_textureCoordinateBounds.z - v_textureCoordinateBounds.x, v_textureCoordinateBounds.w - v_textureCoordinateBounds.y);\n\n float epsilonEyeDepth = v_compressed.x + czm_epsilon1;\n float globeDepth1 = getGlobeDepth(adjustedST, v_originTextureCoordinateAndTranslate.xy, applyTranslate, dimensions, imageSize);\n\n // negative values go into the screen\n if (globeDepth1 != 0.0 && globeDepth1 > epsilonEyeDepth)\n {\n float globeDepth2 = getGlobeDepth(adjustedST, vec2(0.0, 1.0), applyTranslate, dimensions, imageSize); // top left corner\n if (globeDepth2 != 0.0 && globeDepth2 > epsilonEyeDepth)\n {\n float globeDepth3 = getGlobeDepth(adjustedST, vec2(1.0, 1.0), applyTranslate, dimensions, imageSize); // top right corner\n if (globeDepth3 != 0.0 && globeDepth3 > epsilonEyeDepth)\n {\n discard;\n }\n }\n }\n }\n#endif\n\n}\n',c=[],(0,_.Z)(this._batchTable)&&(c.push("VECTOR_TILE"),o=this._batchTable.getVertexShaderCallback(!1,"a_batchId",void 0)(o),a=this._batchTable.getFragmentShaderCallback(!1,void 0)(a)),s=new eY.Z({defines:c,sources:[o]}),this._instanced&&s.defines.push("INSTANCED"),this._shaderRotation&&s.defines.push("ROTATION"),this._shaderAlignedAxis&&s.defines.push("ALIGNED_AXIS"),this._shaderScaleByDistance&&s.defines.push("EYE_DISTANCE_SCALING"),this._shaderTranslucencyByDistance&&s.defines.push("EYE_DISTANCE_TRANSLUCENCY"),this._shaderPixelOffsetScaleByDistance&&s.defines.push("EYE_DISTANCE_PIXEL_OFFSET"),this._shaderDistanceDisplayCondition&&s.defines.push("DISTANCE_DISPLAY_CONDITION"),this._shaderDisableDepthDistance&&s.defines.push("DISABLE_DEPTH_DISTANCE"),this._shaderClampToGround&&(C?s.defines.push("VERTEX_DEPTH_CHECK"):s.defines.push("FRAGMENT_DEPTH_CHECK"));let e=1-e1.CUTOFF;this._sdf&&s.defines.push("SDF");let t=(0,_.Z)(this._batchTable)?"VECTOR_TILE":"";this._blendOption===e0.OPAQUE_AND_TRANSLUCENT&&(l=new eY.Z({defines:["OPAQUE",t],sources:[a]}),this._shaderClampToGround&&(C?l.defines.push("VERTEX_DEPTH_CHECK"):l.defines.push("FRAGMENT_DEPTH_CHECK")),this._sdf&&(l.defines.push("SDF"),l.defines.push(`SDF_EDGE ${e}`)),this._sp=eq.Z.replaceCache({context:d,shaderProgram:this._sp,vertexShaderSource:s,fragmentShaderSource:l,attributeLocations:n}),l=new eY.Z({defines:["TRANSLUCENT",t],sources:[a]}),this._shaderClampToGround&&(C?l.defines.push("VERTEX_DEPTH_CHECK"):l.defines.push("FRAGMENT_DEPTH_CHECK")),this._sdf&&(l.defines.push("SDF"),l.defines.push(`SDF_EDGE ${e}`)),this._spTranslucent=eq.Z.replaceCache({context:d,shaderProgram:this._spTranslucent,vertexShaderSource:s,fragmentShaderSource:l,attributeLocations:n})),this._blendOption===e0.OPAQUE&&(l=new eY.Z({defines:[t],sources:[a]}),this._shaderClampToGround&&(C?l.defines.push("VERTEX_DEPTH_CHECK"):l.defines.push("FRAGMENT_DEPTH_CHECK")),this._sdf&&(l.defines.push("SDF"),l.defines.push(`SDF_EDGE ${e}`)),this._sp=eq.Z.replaceCache({context:d,shaderProgram:this._sp,vertexShaderSource:s,fragmentShaderSource:l,attributeLocations:n})),this._blendOption===e0.TRANSLUCENT&&(l=new eY.Z({defines:[t],sources:[a]}),this._shaderClampToGround&&(C?l.defines.push("VERTEX_DEPTH_CHECK"):l.defines.push("FRAGMENT_DEPTH_CHECK")),this._sdf&&(l.defines.push("SDF"),l.defines.push(`SDF_EDGE ${e}`)),this._spTranslucent=eq.Z.replaceCache({context:d,shaderProgram:this._spTranslucent,vertexShaderSource:s,fragmentShaderSource:l,attributeLocations:n})),this._compiledShaderRotation=this._shaderRotation,this._compiledShaderAlignedAxis=this._shaderAlignedAxis,this._compiledShaderScaleByDistance=this._shaderScaleByDistance,this._compiledShaderTranslucencyByDistance=this._shaderTranslucencyByDistance,this._compiledShaderPixelOffsetScaleByDistance=this._shaderPixelOffsetScaleByDistance,this._compiledShaderDistanceDisplayCondition=this._shaderDistanceDisplayCondition,this._compiledShaderDisableDepthDistance=this._shaderDisableDepthDistance,this._compiledShaderClampToGround=this._shaderClampToGround,this._compiledSDF=this._sdf}let A=e.commandList;if(T.render||T.pick){let t;let n=this._colorCommands,r=this._blendOption===e0.OPAQUE,o=this._blendOption===e0.OPAQUE_AND_TRANSLUCENT,a=this._vaf.va,s=a.length,l=this._uniforms;(0,_.Z)(this._batchTable)?(l=this._batchTable.getUniformMapCallback()(l),t=this._batchTable.getPickId()):t="v_pickColor",n.length=s;let c=o?2*s:s;for(let e=0;e<c;++e){let s=n[e];(0,_.Z)(s)||(s=n[e]=new eG.Z);let c=r||o&&e%2==0;s.pass=c||!o?ej.Z.OPAQUE:ej.Z.TRANSLUCENT,s.owner=this;let u=o?Math.floor(e/2):e;s.boundingVolume=i,s.modelMatrix=w,s.count=a[u].indicesCount,s.shaderProgram=c?this._sp:this._spTranslucent,s.uniformMap=l,s.vertexArray=a[u].va,s.renderState=c?this._rsOpaque:this._rsTranslucent,s.debugShowBoundingVolume=this.debugShowBoundingVolume,s.pickId=t,this._instanced&&(s.count=6,s.instanceCount=h),A.push(s)}this.debugShowTextureAtlas&&((0,_.Z)(this.debugCommand)||(this.debugCommand=function(e,t){let i=t.createViewportQuadCommand("uniform sampler2D billboard_texture; \nin vec2 v_textureCoordinates; \nvoid main() \n{ \n out_FragColor = texture(billboard_texture, v_textureCoordinates); \n} \n",{uniformMap:{billboard_texture:function(){return e._textureAtlas.texture}}});return i.pass=ej.Z.OVERLAY,i}(this,e.context)),A.push(this.debugCommand))}},tv.prototype.isDestroyed=function(){return!1},tv.prototype.destroy=function(){return(0,_.Z)(this._removeCallbackFunc)&&(this._removeCallbackFunc(),this._removeCallbackFunc=void 0),this._textureAtlas=this._destroyTextureAtlas&&this._textureAtlas&&this._textureAtlas.destroy(),this._sp=this._sp&&this._sp.destroy(),this._spTranslucent=this._spTranslucent&&this._spTranslucent.destroy(),this._vaf=this._vaf&&this._vaf.destroy(),tT(this._billboards),(0,g.Z)(this)};var tk=Object.freeze({FILL:0,OUTLINE:1,FILL_AND_OUTLINE:2});let tV={},tH=0,tG=new C.Z(.165,.165,.165,.8),tj=new w.Z(7,5),tW=Object.freeze({LTR:0,RTL:1,WEAK:2,BRACKETS:3});function tq(e){e._rebindAllGlyphs||e._repositionAllGlyphs||e._labelCollection._labelsToUpdate.push(e),e._rebindAllGlyphs=!0}function tY(e){e._rebindAllGlyphs||e._repositionAllGlyphs||e._labelCollection._labelsToUpdate.push(e),e._repositionAllGlyphs=!0}function tX(e,t){return document.defaultView.getComputedStyle(e,null).getPropertyValue(t)}function t$(e){let t=tV[e._font];if(!(0,_.Z)(t)){let i=document.createElement("div");i.style.position="absolute",i.style.opacity=0,i.style.font=e._font,document.body.appendChild(i);let n=parseFloat(tX(i,"line-height"));isNaN(n)&&(n=void 0),t={family:tX(i,"font-family"),size:tX(i,"font-size").replace("px",""),style:tX(i,"font-style"),weight:tX(i,"font-weight"),lineHeight:n},document.body.removeChild(i),tH<256&&(tV[e._font]=t,tH++)}e._fontFamily=t.family,e._fontSize=t.size,e._fontStyle=t.style,e._fontWeight=t.weight,e._lineHeight=t.lineHeight}function tK(e,t){if(e=(0,m.Z)(e,m.Z.EMPTY_OBJECT),(0,_.Z)(e.disableDepthTestDistance)&&e.disableDepthTestDistance<0)throw new A.Z("disableDepthTestDistance must be greater than 0.0.");let i=e.translucencyByDistance,n=e.pixelOffsetScaleByDistance,r=e.scaleByDistance,o=e.distanceDisplayCondition;if((0,_.Z)(i)){if(i.far<=i.near)throw new A.Z("translucencyByDistance.far must be greater than translucencyByDistance.near.");i=O.Z.clone(i)}if((0,_.Z)(n)){if(n.far<=n.near)throw new A.Z("pixelOffsetScaleByDistance.far must be greater than pixelOffsetScaleByDistance.near.");n=O.Z.clone(n)}if((0,_.Z)(r)){if(r.far<=r.near)throw new A.Z("scaleByDistance.far must be greater than scaleByDistance.near.");r=O.Z.clone(r)}if((0,_.Z)(o)){if(o.far<=o.near)throw new A.Z("distanceDisplayCondition.far must be greater than distanceDisplayCondition.near.");o=I.Z.clone(o)}this._renderedText=void 0,this._text=void 0,this._show=(0,m.Z)(e.show,!0),this._font=(0,m.Z)(e.font,"30px sans-serif"),this._fillColor=C.Z.clone((0,m.Z)(e.fillColor,C.Z.WHITE)),this._outlineColor=C.Z.clone((0,m.Z)(e.outlineColor,C.Z.BLACK)),this._outlineWidth=(0,m.Z)(e.outlineWidth,1),this._showBackground=(0,m.Z)(e.showBackground,!1),this._backgroundColor=C.Z.clone((0,m.Z)(e.backgroundColor,tG)),this._backgroundPadding=w.Z.clone((0,m.Z)(e.backgroundPadding,tj)),this._style=(0,m.Z)(e.style,tk.FILL),this._verticalOrigin=(0,m.Z)(e.verticalOrigin,R.BASELINE),this._horizontalOrigin=(0,m.Z)(e.horizontalOrigin,P.LEFT),this._pixelOffset=w.Z.clone((0,m.Z)(e.pixelOffset,w.Z.ZERO)),this._eyeOffset=S.Z.clone((0,m.Z)(e.eyeOffset,S.Z.ZERO)),this._position=S.Z.clone((0,m.Z)(e.position,S.Z.ZERO)),this._scale=(0,m.Z)(e.scale,1),this._id=e.id,this._translucencyByDistance=i,this._pixelOffsetScaleByDistance=n,this._scaleByDistance=r,this._heightReference=(0,m.Z)(e.heightReference,D.ZP.NONE),this._distanceDisplayCondition=o,this._disableDepthTestDistance=e.disableDepthTestDistance,this._labelCollection=t,this._glyphs=[],this._backgroundBillboard=void 0,this._batchIndex=void 0,this._rebindAllGlyphs=!0,this._repositionAllGlyphs=!0,this._actualClampedPosition=void 0,this._removeCallbackFunc=void 0,this._mode=void 0,this._clusterShow=!0,this.text=(0,m.Z)(e.text,""),this._relativeSize=1,t$(this),this._updateClamping()}function tQ(e,t,i){return e.slice(0,t)+i+e.slice(t)}Object.defineProperties(tK.prototype,{show:{get:function(){return this._show},set:function(e){if(!(0,_.Z)(e))throw new A.Z("value is required.");if(this._show!==e){this._show=e;let t=this._glyphs;for(let i=0,n=t.length;i<n;i++){let n=t[i].billboard;(0,_.Z)(n)&&(n.show=e)}let i=this._backgroundBillboard;(0,_.Z)(i)&&(i.show=e)}}},position:{get:function(){return this._position},set:function(e){if(!(0,_.Z)(e))throw new A.Z("value is required.");let t=this._position;if(!S.Z.equals(t,e)){S.Z.clone(e,t);let i=this._glyphs;for(let t=0,n=i.length;t<n;t++){let n=i[t].billboard;(0,_.Z)(n)&&(n.position=e)}let n=this._backgroundBillboard;(0,_.Z)(n)&&(n.position=e),this._updateClamping()}}},heightReference:{get:function(){return this._heightReference},set:function(e){if(!(0,_.Z)(e))throw new A.Z("value is required.");if(e!==this._heightReference){this._heightReference=e;let t=this._glyphs;for(let i=0,n=t.length;i<n;i++){let n=t[i].billboard;(0,_.Z)(n)&&(n.heightReference=e)}let i=this._backgroundBillboard;(0,_.Z)(i)&&(i.heightReference=e),tY(this),this._updateClamping()}}},text:{get:function(){return this._text},set:function(e){if(!(0,_.Z)(e))throw new A.Z("value is required.");if(this._text!==e){this._text=e;let t=e.replace(/\u00ad/g,"");this._renderedText=tK.enableRightToLeftDetection?function(e){let t=e.split("\n"),i="";for(let e=0;e<t.length;e++){let n=t[e],r=tJ.test(n.charAt(0)),o=function(e,t){let i=/[a-zA-Z0-9]/,n=/[()[\]{}<>]/,r=[],o="",a=tW.LTR,s="",l=e.length;for(let c=0;c<l;++c){let l=e.charAt(c);s=t.test(l)?tW.RTL:i.test(l)?tW.LTR:n.test(l)?tW.BRACKETS:tW.WEAK,0===c&&(a=s),a===s&&s!==tW.BRACKETS?o+=l:(""!==o&&r.push({Type:a,Word:o}),a=s,o=l)}return r.push({Type:s,Word:o}),r}(n,tJ),a=0,s="";for(let e=0;e<o.length;++e){let t=o[e],i=t.Type===tW.BRACKETS?function(e){switch(e){case"(":return")";case")":return"(";case"[":return"]";case"]":return"[";case"{":return"}";case"}":return"{";case"<":return">";case">":return"<"}}(t.Word):t.Word.split("").reverse().join("");r?t.Type===tW.RTL?(s=i+s,a=0):t.Type===tW.LTR?(s=tQ(s,a,t.Word),a+=t.Word.length):(t.Type===tW.WEAK||t.Type===tW.BRACKETS)&&(t.Type===tW.WEAK&&o[e-1].Type===tW.BRACKETS?s=i+s:o[e-1].Type===tW.RTL?(s=i+s,a=0):o.length>e+1?o[e+1].Type===tW.RTL?(s=i+s,a=0):(s=tQ(s,a,t.Word),a+=t.Word.length):s=tQ(s,0,i)):t.Type===tW.RTL?s=tQ(s,a,i):t.Type===tW.LTR?(s+=t.Word,a=s.length):(t.Type===tW.WEAK||t.Type===tW.BRACKETS)&&(e>0&&o[e-1].Type===tW.RTL?o.length>e+1?o[e+1].Type===tW.RTL?s=tQ(s,a,i):(s+=t.Word,a=s.length):s+=t.Word:(s+=t.Word,a=s.length))}i+=s,e<t.length-1&&(i+="\n")}return i}(t):t,tq(this)}}},font:{get:function(){return this._font},set:function(e){if(!(0,_.Z)(e))throw new A.Z("value is required.");this._font!==e&&(this._font=e,tq(this),t$(this))}},fillColor:{get:function(){return this._fillColor},set:function(e){if(!(0,_.Z)(e))throw new A.Z("value is required.");let t=this._fillColor;C.Z.equals(t,e)||(C.Z.clone(e,t),tq(this))}},outlineColor:{get:function(){return this._outlineColor},set:function(e){if(!(0,_.Z)(e))throw new A.Z("value is required.");let t=this._outlineColor;C.Z.equals(t,e)||(C.Z.clone(e,t),tq(this))}},outlineWidth:{get:function(){return this._outlineWidth},set:function(e){if(!(0,_.Z)(e))throw new A.Z("value is required.");this._outlineWidth!==e&&(this._outlineWidth=e,tq(this))}},showBackground:{get:function(){return this._showBackground},set:function(e){if(!(0,_.Z)(e))throw new A.Z("value is required.");this._showBackground!==e&&(this._showBackground=e,tq(this))}},backgroundColor:{get:function(){return this._backgroundColor},set:function(e){if(!(0,_.Z)(e))throw new A.Z("value is required.");let t=this._backgroundColor;if(!C.Z.equals(t,e)){C.Z.clone(e,t);let i=this._backgroundBillboard;(0,_.Z)(i)&&(i.color=t)}}},backgroundPadding:{get:function(){return this._backgroundPadding},set:function(e){if(!(0,_.Z)(e))throw new A.Z("value is required.");let t=this._backgroundPadding;w.Z.equals(t,e)||(w.Z.clone(e,t),tY(this))}},style:{get:function(){return this._style},set:function(e){if(!(0,_.Z)(e))throw new A.Z("value is required.");this._style!==e&&(this._style=e,tq(this))}},pixelOffset:{get:function(){return this._pixelOffset},set:function(e){if(!(0,_.Z)(e))throw new A.Z("value is required.");let t=this._pixelOffset;if(!w.Z.equals(t,e)){w.Z.clone(e,t);let i=this._glyphs;for(let t=0,n=i.length;t<n;t++){let n=i[t];(0,_.Z)(n.billboard)&&(n.billboard.pixelOffset=e)}let n=this._backgroundBillboard;(0,_.Z)(n)&&(n.pixelOffset=e)}}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){if((0,_.Z)(e)&&e.far<=e.near)throw new A.Z("far distance must be greater than near distance.");let t=this._translucencyByDistance;if(!O.Z.equals(t,e)){this._translucencyByDistance=O.Z.clone(e,t);let i=this._glyphs;for(let t=0,n=i.length;t<n;t++){let n=i[t];(0,_.Z)(n.billboard)&&(n.billboard.translucencyByDistance=e)}let n=this._backgroundBillboard;(0,_.Z)(n)&&(n.translucencyByDistance=e)}}},pixelOffsetScaleByDistance:{get:function(){return this._pixelOffsetScaleByDistance},set:function(e){if((0,_.Z)(e)&&e.far<=e.near)throw new A.Z("far distance must be greater than near distance.");let t=this._pixelOffsetScaleByDistance;if(!O.Z.equals(t,e)){this._pixelOffsetScaleByDistance=O.Z.clone(e,t);let i=this._glyphs;for(let t=0,n=i.length;t<n;t++){let n=i[t];(0,_.Z)(n.billboard)&&(n.billboard.pixelOffsetScaleByDistance=e)}let n=this._backgroundBillboard;(0,_.Z)(n)&&(n.pixelOffsetScaleByDistance=e)}}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){if((0,_.Z)(e)&&e.far<=e.near)throw new A.Z("far distance must be greater than near distance.");let t=this._scaleByDistance;if(!O.Z.equals(t,e)){this._scaleByDistance=O.Z.clone(e,t);let i=this._glyphs;for(let t=0,n=i.length;t<n;t++){let n=i[t];(0,_.Z)(n.billboard)&&(n.billboard.scaleByDistance=e)}let n=this._backgroundBillboard;(0,_.Z)(n)&&(n.scaleByDistance=e)}}},eyeOffset:{get:function(){return this._eyeOffset},set:function(e){if(!(0,_.Z)(e))throw new A.Z("value is required.");let t=this._eyeOffset;if(!S.Z.equals(t,e)){S.Z.clone(e,t);let i=this._glyphs;for(let t=0,n=i.length;t<n;t++){let n=i[t];(0,_.Z)(n.billboard)&&(n.billboard.eyeOffset=e)}let n=this._backgroundBillboard;(0,_.Z)(n)&&(n.eyeOffset=e)}}},horizontalOrigin:{get:function(){return this._horizontalOrigin},set:function(e){if(!(0,_.Z)(e))throw new A.Z("value is required.");this._horizontalOrigin!==e&&(this._horizontalOrigin=e,tY(this))}},verticalOrigin:{get:function(){return this._verticalOrigin},set:function(e){if(!(0,_.Z)(e))throw new A.Z("value is required.");if(this._verticalOrigin!==e){this._verticalOrigin=e;let t=this._glyphs;for(let i=0,n=t.length;i<n;i++){let n=t[i];(0,_.Z)(n.billboard)&&(n.billboard.verticalOrigin=e)}let i=this._backgroundBillboard;(0,_.Z)(i)&&(i.verticalOrigin=e),tY(this)}}},scale:{get:function(){return this._scale},set:function(e){if(!(0,_.Z)(e))throw new A.Z("value is required.");if(this._scale!==e){this._scale=e;let t=this._glyphs;for(let i=0,n=t.length;i<n;i++){let n=t[i];(0,_.Z)(n.billboard)&&(n.billboard.scale=e*this._relativeSize)}let i=this._backgroundBillboard;(0,_.Z)(i)&&(i.scale=e*this._relativeSize),tY(this)}}},totalScale:{get:function(){return this._scale*this._relativeSize}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){if((0,_.Z)(e)&&e.far<=e.near)throw new A.Z("far must be greater than near");if(!I.Z.equals(e,this._distanceDisplayCondition)){this._distanceDisplayCondition=I.Z.clone(e,this._distanceDisplayCondition);let t=this._glyphs;for(let i=0,n=t.length;i<n;i++){let n=t[i];(0,_.Z)(n.billboard)&&(n.billboard.distanceDisplayCondition=e)}let i=this._backgroundBillboard;(0,_.Z)(i)&&(i.distanceDisplayCondition=e)}}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){if(this._disableDepthTestDistance!==e){if((0,_.Z)(e)&&e<0)throw new A.Z("disableDepthTestDistance must be greater than 0.0.");this._disableDepthTestDistance=e;let t=this._glyphs;for(let i=0,n=t.length;i<n;i++){let n=t[i];(0,_.Z)(n.billboard)&&(n.billboard.disableDepthTestDistance=e)}let i=this._backgroundBillboard;(0,_.Z)(i)&&(i.disableDepthTestDistance=e)}}},id:{get:function(){return this._id},set:function(e){if(this._id!==e){this._id=e;let t=this._glyphs;for(let i=0,n=t.length;i<n;i++){let n=t[i];(0,_.Z)(n.billboard)&&(n.billboard.id=e)}let i=this._backgroundBillboard;(0,_.Z)(i)&&(i.id=e)}}},pickId:{get:function(){if(0!==this._glyphs.length&&(0,_.Z)(this._glyphs[0].billboard))return this._glyphs[0].billboard.pickId}},_clampedPosition:{get:function(){return this._actualClampedPosition},set:function(e){this._actualClampedPosition=S.Z.clone(e,this._actualClampedPosition);let t=this._glyphs;for(let i=0,n=t.length;i<n;i++){let n=t[i];(0,_.Z)(n.billboard)&&(n.billboard._clampedPosition=e)}let i=this._backgroundBillboard;(0,_.Z)(i)&&(i._clampedPosition=e)}},clusterShow:{get:function(){return this._clusterShow},set:function(e){if(this._clusterShow!==e){this._clusterShow=e;let t=this._glyphs;for(let i=0,n=t.length;i<n;i++){let n=t[i];(0,_.Z)(n.billboard)&&(n.billboard.clusterShow=e)}let i=this._backgroundBillboard;(0,_.Z)(i)&&(i.clusterShow=e)}}}}),tK.prototype._updateClamping=function(){ed._updateClamping(this._labelCollection,this)},tK.prototype.computeScreenSpacePosition=function(e,t){if(!(0,_.Z)(e))throw new A.Z("scene is required.");(0,_.Z)(t)||(t=new w.Z);let i=this._labelCollection.modelMatrix,n=(0,_.Z)(this._actualClampedPosition)?this._actualClampedPosition:this._position;return ed._computeScreenSpacePosition(i,n,this._eyeOffset,this._pixelOffset,e,t)},tK.getScreenSpaceBoundingBox=function(e,t,i){let n=0,r=0,o=0,a=0,s=e.totalScale,l=e._backgroundBillboard;if((0,_.Z)(l))n=t.x+l._translate.x,r=t.y-l._translate.y,o=l.width*s,a=l.height*s,e.verticalOrigin===R.BOTTOM||e.verticalOrigin===R.BASELINE?r-=a:e.verticalOrigin===R.CENTER&&(r-=.5*a);else{n=Number.POSITIVE_INFINITY,r=Number.POSITIVE_INFINITY;let i=0,l=0,c=e._glyphs,u=c.length;for(let o=0;o<u;++o){let a=c[o],u=a.billboard;if(!(0,_.Z)(u))continue;let h=t.x+u._translate.x,d=t.y-u._translate.y,f=a.dimensions.width*s,p=a.dimensions.height*s;e.verticalOrigin===R.BOTTOM||e.verticalOrigin===R.BASELINE?d-=p:e.verticalOrigin===R.CENTER&&(d-=.5*p),e._verticalOrigin===R.TOP?d+=e1.PADDING*s:(e._verticalOrigin===R.BOTTOM||e._verticalOrigin===R.BASELINE)&&(d-=e1.PADDING*s),n=Math.min(n,h),r=Math.min(r,d),i=Math.max(i,h+f),l=Math.max(l,d+p)}o=i-n,a=l-r}return(0,_.Z)(i)||(i=new x.Z),i.x=n,i.y=r,i.width=o,i.height=a,i},tK.prototype.equals=function(e){return this===e||(0,_.Z)(e)&&this._show===e._show&&this._scale===e._scale&&this._outlineWidth===e._outlineWidth&&this._showBackground===e._showBackground&&this._style===e._style&&this._verticalOrigin===e._verticalOrigin&&this._horizontalOrigin===e._horizontalOrigin&&this._heightReference===e._heightReference&&this._renderedText===e._renderedText&&this._font===e._font&&S.Z.equals(this._position,e._position)&&C.Z.equals(this._fillColor,e._fillColor)&&C.Z.equals(this._outlineColor,e._outlineColor)&&C.Z.equals(this._backgroundColor,e._backgroundColor)&&w.Z.equals(this._backgroundPadding,e._backgroundPadding)&&w.Z.equals(this._pixelOffset,e._pixelOffset)&&S.Z.equals(this._eyeOffset,e._eyeOffset)&&O.Z.equals(this._translucencyByDistance,e._translucencyByDistance)&&O.Z.equals(this._pixelOffsetScaleByDistance,e._pixelOffsetScaleByDistance)&&O.Z.equals(this._scaleByDistance,e._scaleByDistance)&&I.Z.equals(this._distanceDisplayCondition,e._distanceDisplayCondition)&&this._disableDepthTestDistance===e._disableDepthTestDistance&&this._id===e._id},tK.prototype.isDestroyed=function(){return!1},tK.enableRightToLeftDetection=!1;let tJ=RegExp(`[\u05D0-\u05EA\u0600-\u06FF\u0750-\u077F\u08A0-\u08FF]`);var t0=function(e,t){if(!(0,_.Z)(e))throw new A.Z("text is required.");if(""===e)return;t=(0,m.Z)(t,m.Z.EMPTY_OBJECT);let i=(0,m.Z)(t.font,"10px sans-serif"),n=(0,m.Z)(t.stroke,!1),r=(0,m.Z)(t.fill,!0),a=(0,m.Z)(t.strokeWidth,1),s=(0,m.Z)(t.backgroundColor,C.Z.TRANSPARENT),l=(0,m.Z)(t.padding,0),c=2*l,u=document.createElement("canvas");u.width=1,u.height=1,u.style.font=i;let h=u.getContext("2d",{willReadFrequently:!0});!(0,_.Z)(o)&&((0,_.Z)(h.imageSmoothingEnabled)?o="imageSmoothingEnabled":(0,_.Z)(h.mozImageSmoothingEnabled)?o="mozImageSmoothingEnabled":(0,_.Z)(h.webkitImageSmoothingEnabled)?o="webkitImageSmoothingEnabled":(0,_.Z)(h.msImageSmoothingEnabled)&&(o="msImageSmoothingEnabled")),h.font=i,h.lineJoin="round",h.lineWidth=a,h[o]=!1,u.style.visibility="hidden",document.body.appendChild(u);let d=function(e,t,i,n,r){let o=e.measureText(t);if(/\S/.test(t)){let a,s,l,c;let u=document.defaultView.getComputedStyle(e.canvas).getPropertyValue("font-size").replace("px",""),h=document.createElement("canvas"),d=o.width+100|0,f=3*u,p=f/2;h.width=d,h.height=f;let m=h.getContext("2d");m.font=i,m.fillStyle="white",m.fillRect(0,0,h.width+1,h.height+1),n&&(m.strokeStyle="black",m.lineWidth=e.lineWidth,m.strokeText(t,50,p)),r&&(m.fillStyle="black",m.fillText(t,50,p));let _=m.getImageData(0,0,d,f).data,g=_.length,Z=4*d;for(a=0;a<g;++a)if(255!==_[a]){l=a/Z|0;break}for(a=g-1;a>=0;--a)if(255!==_[a]){c=a/Z|0;break}let y=-1;for(a=0;a<d&&-1===y;++a)for(s=0;s<f;++s){let e=4*a+s*Z;if(255!==_[e]||255!==_[e+1]||255!==_[e+2]||255!==_[e+3]){y=a;break}}return{width:o.width,height:c-l,ascent:p-l,descent:c-p,minx:y-50}}return{width:o.width,height:0,ascent:0,descent:0,minx:0}}(h,e,i,n,r);u.dimensions=d,document.body.removeChild(u),u.style.visibility="";let f=-d.minx,p=Math.ceil(d.width)+f+c,g=d.height+c,Z=g-d.ascent+l,y=g-Z+c;if(u.width=p,u.height=g,h.font=i,h.lineJoin="round",h.lineWidth=a,h[o]=!1,s!==C.Z.TRANSPARENT&&(h.fillStyle=s.toCssColorString(),h.fillRect(0,0,u.width,u.height)),n){let i=(0,m.Z)(t.strokeColor,C.Z.BLACK);h.strokeStyle=i.toCssColorString(),h.strokeText(e,f+l,y)}if(r){let i=(0,m.Z)(t.fillColor,C.Z.WHITE);h.fillStyle=i.toCssColorString(),h.fillText(e,f+l,y)}return u},t1=i(5804),t2=i(3730);function t3(){this.textureInfo=void 0,this.dimensions=void 0,this.billboard=void 0}function t4(e,t,i){this.labelCollection=e,this.index=t,this.dimensions=i}let t5="ID_WHITE_PIXEL",t9=new w.Z(4,4),t8=new x.Z(1,1,1,1),t6={};function t7(e,t){t.textureInfo=void 0,t.dimensions=void 0;let i=t.billboard;(0,_.Z)(i)&&(i.show=!1,i.image=void 0,(0,_.Z)(i._removeCallbackFunc)&&(i._removeCallbackFunc(),i._removeCallbackFunc=void 0),e._spareBillboards.push(i),t.billboard=void 0)}let ie=new t2;function it(e,t,i){return t===P.CENTER?-e/2:t===P.RIGHT?-(e+i.x):i.x}let ii=new w.Z,ir=new w.Z;function io(e,t){let i=t._glyphs;for(let t=0,n=i.length;t<n;++t)t7(e,i[t]);(0,_.Z)(t._backgroundBillboard)&&(e._backgroundBillboardCollection.remove(t._backgroundBillboard),t._backgroundBillboard=void 0),t._labelCollection=void 0,(0,_.Z)(t._removeCallbackFunc)&&t._removeCallbackFunc(),(0,g.Z)(t)}function ia(e){e=(0,m.Z)(e,m.Z.EMPTY_OBJECT),this._scene=e.scene,this._batchTable=e.batchTable,this._textureAtlas=void 0,this._backgroundTextureAtlas=void 0,this._backgroundBillboardCollection=new tv({scene:this._scene}),this._backgroundBillboardCollection.destroyTextureAtlas=!1,this._billboardCollection=new tv({scene:this._scene,batchTable:this._batchTable}),this._billboardCollection.destroyTextureAtlas=!1,this._billboardCollection._sdf=!0,this._spareBillboards=[],this._glyphTextureCache={},this._labels=[],this._labelsToUpdate=[],this._totalGlyphCount=0,this._highlightColor=C.Z.clone(C.Z.WHITE),this.show=(0,m.Z)(e.show,!0),this.modelMatrix=er.Z.clone((0,m.Z)(e.modelMatrix,er.Z.IDENTITY)),this.debugShowBoundingVolume=(0,m.Z)(e.debugShowBoundingVolume,!1),this.blendOption=(0,m.Z)(e.blendOption,e0.OPAQUE_AND_TRANSLUCENT)}function is(e,t){if(e=(0,m.Z)(e,m.Z.EMPTY_OBJECT),(0,_.Z)(e.disableDepthTestDistance)&&e.disableDepthTestDistance<0)throw new A.Z("disableDepthTestDistance must be greater than or equal to 0.0.");let i=e.translucencyByDistance,n=e.scaleByDistance,r=e.distanceDisplayCondition;if((0,_.Z)(i)){if(i.far<=i.near)throw new A.Z("translucencyByDistance.far must be greater than translucencyByDistance.near.");i=O.Z.clone(i)}if((0,_.Z)(n)){if(n.far<=n.near)throw new A.Z("scaleByDistance.far must be greater than scaleByDistance.near.");n=O.Z.clone(n)}if((0,_.Z)(r)){if(r.far<=r.near)throw new A.Z("distanceDisplayCondition.far must be greater than distanceDisplayCondition.near.");r=I.Z.clone(r)}this._show=(0,m.Z)(e.show,!0),this._position=S.Z.clone((0,m.Z)(e.position,S.Z.ZERO)),this._actualPosition=S.Z.clone(this._position),this._color=C.Z.clone((0,m.Z)(e.color,C.Z.WHITE)),this._outlineColor=C.Z.clone((0,m.Z)(e.outlineColor,C.Z.TRANSPARENT)),this._outlineWidth=(0,m.Z)(e.outlineWidth,0),this._pixelSize=(0,m.Z)(e.pixelSize,10),this._scaleByDistance=n,this._translucencyByDistance=i,this._distanceDisplayCondition=r,this._disableDepthTestDistance=(0,m.Z)(e.disableDepthTestDistance,0),this._id=e.id,this._collection=(0,m.Z)(e.collection,t),this._clusterShow=!0,this._pickId=void 0,this._pointPrimitiveCollection=t,this._dirty=!1,this._index=-1}Object.defineProperties(ia.prototype,{length:{get:function(){return this._labels.length}}}),ia.prototype.add=function(e){let t=new tK(e,this);return this._labels.push(t),this._labelsToUpdate.push(t),t},ia.prototype.remove=function(e){if((0,_.Z)(e)&&e._labelCollection===this){let t=this._labels.indexOf(e);if(-1!==t)return this._labels.splice(t,1),io(this,e),!0}return!1},ia.prototype.removeAll=function(){let e=this._labels;for(let t=0,i=e.length;t<i;++t)io(this,e[t]);e.length=0},ia.prototype.contains=function(e){return(0,_.Z)(e)&&e._labelCollection===this},ia.prototype.get=function(e){if(!(0,_.Z)(e))throw new A.Z("index is required.");return this._labels[e]},ia.prototype.update=function(e){if(!this.show)return;let t=this._billboardCollection,i=this._backgroundBillboardCollection;t.modelMatrix=this.modelMatrix,t.debugShowBoundingVolume=this.debugShowBoundingVolume,i.modelMatrix=this.modelMatrix,i.debugShowBoundingVolume=this.debugShowBoundingVolume;let n=e.context;(0,_.Z)(this._textureAtlas)||(this._textureAtlas=new e6({context:n}),t.textureAtlas=this._textureAtlas),(0,_.Z)(this._backgroundTextureAtlas)||(this._backgroundTextureAtlas=new e6({context:n,initialSize:t9}),i.textureAtlas=this._backgroundTextureAtlas,function(e){let t=document.createElement("canvas");t.width=t9.x,t.height=t9.y;let i=t.getContext("2d");i.fillStyle="#fff",i.fillRect(0,0,t.width,t.height),e.addImage(t5,t)}(this._backgroundTextureAtlas));let r=this._labelsToUpdate.length;for(let e=0;e<r;++e){let t=this._labelsToUpdate[e];if(t.isDestroyed())continue;let i=t._glyphs.length;t._rebindAllGlyphs&&(function(e,t){let i,n,r;let o=t._renderedText,a=ie.splitGraphemes(o),s=a.length,l=t._glyphs,c=l.length;if(t._relativeSize=t._fontSize/e1.FONT_SIZE,s<c)for(n=s;n<c;++n)t7(e,l[n]);l.length=s;let u=t.show&&t._showBackground&&o.split("\n").join("").length>0,h=t._backgroundBillboard,d=e._backgroundBillboardCollection;u?((0,_.Z)(h)||(h=d.add({collection:e,image:t5,imageSubRegion:t8}),t._backgroundBillboard=h),h.color=t._backgroundColor,h.show=t._show,h.position=t._position,h.eyeOffset=t._eyeOffset,h.pixelOffset=t._pixelOffset,h.horizontalOrigin=P.LEFT,h.verticalOrigin=t._verticalOrigin,h.heightReference=t._heightReference,h.scale=t.totalScale,h.pickPrimitive=t,h.id=t._id,h.translucencyByDistance=t._translucencyByDistance,h.pixelOffsetScaleByDistance=t._pixelOffsetScaleByDistance,h.scaleByDistance=t._scaleByDistance,h.distanceDisplayCondition=t._distanceDisplayCondition,h.disableDepthTestDistance=t._disableDepthTestDistance,h.clusterShow=t.clusterShow):(0,_.Z)(h)&&(d.remove(h),t._backgroundBillboard=h=void 0);let f=e._glyphTextureCache;for(r=0;r<s;++r){let n=a[r],o=t._verticalOrigin,s=JSON.stringify([n,t._fontFamily,t._fontStyle,t._fontWeight,+o]),c=f[s];if(!(0,_.Z)(c)){var p,m,g,Z;let i=`${t._fontStyle} ${t._fontWeight} ${e1.FONT_SIZE}px ${t._fontFamily}`,r=(p=C.Z.WHITE,m=C.Z.WHITE,g=tk.FILL,t6.font=i,t6.fillColor=p,t6.strokeColor=m,t6.strokeWidth=0,t6.padding=e1.PADDING,o===R.CENTER?t6.textBaseline="middle":o===R.TOP?t6.textBaseline="top":t6.textBaseline="bottom",t6.fill=g===tk.FILL||g===tk.FILL_AND_OUTLINE,t6.stroke=g===tk.OUTLINE||g===tk.FILL_AND_OUTLINE,t6.backgroundColor=C.Z.BLACK,t0(n,t6));if(c=new t4(e,-1,r.dimensions),f[s]=c,r.width>0&&r.height>0){let t=t1(r,{cutoff:e1.CUTOFF,radius:e1.RADIUS}),i=r.getContext("2d"),o=r.width,a=r.height,l=i.getImageData(0,0,o,a);for(let e=0;e<o;e++)for(let i=0;i<a;i++){let n=i*o+e,r=255*t[n],a=4*n;l.data[a+0]=r,l.data[a+1]=r,l.data[a+2]=r,l.data[a+3]=r}i.putImageData(l,0,0)," "!==n&&(Z=e._textureAtlas,c.index=Z.addImageSync(s,r))}}if(i=l[r],(0,_.Z)(i)?-1===c.index?t7(e,i):(0,_.Z)(i.textureInfo)&&(i.textureInfo=void 0):(i=new t3,l[r]=i),i.textureInfo=c,i.dimensions=c.dimensions,-1!==c.index){let n=i.billboard,r=e._spareBillboards;(0,_.Z)(n)||(r.length>0?n=r.pop():((n=e._billboardCollection.add({collection:e}))._labelDimensions=new w.Z,n._labelTranslate=new w.Z),i.billboard=n),n.show=t._show,n.position=t._position,n.eyeOffset=t._eyeOffset,n.pixelOffset=t._pixelOffset,n.horizontalOrigin=P.LEFT,n.verticalOrigin=t._verticalOrigin,n.heightReference=t._heightReference,n.scale=t.totalScale,n.pickPrimitive=t,n.id=t._id,n.image=s,n.translucencyByDistance=t._translucencyByDistance,n.pixelOffsetScaleByDistance=t._pixelOffsetScaleByDistance,n.scaleByDistance=t._scaleByDistance,n.distanceDisplayCondition=t._distanceDisplayCondition,n.disableDepthTestDistance=t._disableDepthTestDistance,n._batchIndex=t._batchIndex,n.outlineColor=t.outlineColor,t.style===tk.FILL_AND_OUTLINE?(n.color=t._fillColor,n.outlineWidth=t.outlineWidth):t.style===tk.FILL?(n.color=t._fillColor,n.outlineWidth=0):t.style===tk.OUTLINE&&(n.color=C.Z.TRANSPARENT,n.outlineWidth=t.outlineWidth)}}t._repositionAllGlyphs=!0}(this,t),t._rebindAllGlyphs=!1),t._repositionAllGlyphs&&(function(e){let t,i,n;let r=e._glyphs,o=e._renderedText,a=0,s=0,l=[],c=Number.NEGATIVE_INFINITY,u=0,h=1,d=r.length,f=e._backgroundBillboard,p=w.Z.clone((0,_.Z)(f)?e._backgroundPadding:w.Z.ZERO,ir);for(p.x/=e._relativeSize,p.y/=e._relativeSize,n=0;n<d;++n)"\n"===o.charAt(n)?(l.push(a),++h,a=0):(u=Math.max(u,(i=(t=r[n]).dimensions).height-i.descent),c=Math.max(c,i.descent),a+=i.width-i.minx,n<d-1&&(a+=r[n+1].dimensions.minx),s=Math.max(s,a));l.push(a);let m=u+c,g=e.totalScale,Z=e._horizontalOrigin,y=e._verticalOrigin,b=0,v=l[0],T=it(v,Z,p),E=((0,_.Z)(e._lineHeight)?e._lineHeight:1.2*e._fontSize)/e._relativeSize,x=E*(h-1),S=s,C=m+x;(0,_.Z)(f)&&(S+=2*p.x,C+=2*p.y,f._labelHorizontalOrigin=Z),ii.x=T*g,ii.y=0;let A=!0,I=0;for(n=0;n<d;++n)if("\n"===o.charAt(n))++b,I+=E,T=it(v=l[b],Z,p),ii.x=T*g,A=!0;else if(i=(t=r[n]).dimensions,y===R.TOP?(ii.y=i.height-u-p.y,ii.y+=e1.PADDING):y===R.CENTER?ii.y=(x+i.height-u)/2:(y===R.BASELINE?ii.y=x:ii.y=x+c+p.y,ii.y-=e1.PADDING),ii.y=(ii.y-i.descent-I)*g,A&&(ii.x-=e1.PADDING*g,A=!1),(0,_.Z)(t.billboard)&&(t.billboard._setTranslate(ii),t.billboard._labelDimensions.x=S,t.billboard._labelDimensions.y=C,t.billboard._labelHorizontalOrigin=Z),n<d-1){let e=r[n+1];ii.x+=(i.width-i.minx+e.dimensions.minx)*g}if((0,_.Z)(f)&&o.split("\n").join("").length>0&&(T=Z===P.CENTER?-s/2-p.x:Z===P.RIGHT?-(s+2*p.x):0,ii.x=T*g,y===R.TOP?ii.y=m-u-c:y===R.CENTER?ii.y=(m-u)/2-c:y===R.BASELINE?ii.y=-p.y-c:ii.y=0,ii.y=ii.y*g,f.width=S,f.height=C,f._setTranslate(ii),f._labelTranslate=w.Z.clone(ii,f._labelTranslate)),(0,D.c1)(e.heightReference))for(n=0;n<d;++n){let e=(t=r[n]).billboard;(0,_.Z)(e)&&(e._labelTranslate=w.Z.clone(ii,e._labelTranslate))}}(t),t._repositionAllGlyphs=!1);let n=t._glyphs.length-i;this._totalGlyphCount+=n}let o=i.length>0?e0.TRANSLUCENT:this.blendOption;t.blendOption=o,i.blendOption=o,t._highlightColor=this._highlightColor,i._highlightColor=this._highlightColor,this._labelsToUpdate.length=0,i.update(e),t.update(e)},ia.prototype.isDestroyed=function(){return!1},ia.prototype.destroy=function(){return this.removeAll(),this._billboardCollection=this._billboardCollection.destroy(),this._textureAtlas=this._textureAtlas&&this._textureAtlas.destroy(),this._backgroundBillboardCollection=this._backgroundBillboardCollection.destroy(),this._backgroundTextureAtlas=this._backgroundTextureAtlas&&this._backgroundTextureAtlas.destroy(),(0,g.Z)(this)};let il=is.SHOW_INDEX=0,ic=is.POSITION_INDEX=1,iu=is.COLOR_INDEX=2,ih=is.OUTLINE_COLOR_INDEX=3,id=is.OUTLINE_WIDTH_INDEX=4,ip=is.PIXEL_SIZE_INDEX=5,im=is.SCALE_BY_DISTANCE_INDEX=6,i_=is.TRANSLUCENCY_BY_DISTANCE_INDEX=7,ig=is.DISTANCE_DISPLAY_CONDITION_INDEX=8,iZ=is.DISABLE_DEPTH_DISTANCE_INDEX=9;function iy(e,t){let i=e._pointPrimitiveCollection;(0,_.Z)(i)&&(i._updatePointPrimitive(e,t),e._dirty=!0)}is.NUMBER_OF_PROPERTIES=10,Object.defineProperties(is.prototype,{show:{get:function(){return this._show},set:function(e){if(!(0,_.Z)(e))throw new A.Z("value is required.");this._show!==e&&(this._show=e,iy(this,il))}},position:{get:function(){return this._position},set:function(e){if(!(0,_.Z)(e))throw new A.Z("value is required.");let t=this._position;S.Z.equals(t,e)||(S.Z.clone(e,t),S.Z.clone(e,this._actualPosition),iy(this,ic))}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){if((0,_.Z)(e)&&e.far<=e.near)throw new A.Z("far distance must be greater than near distance.");let t=this._scaleByDistance;O.Z.equals(t,e)||(this._scaleByDistance=O.Z.clone(e,t),iy(this,im))}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){if((0,_.Z)(e)&&e.far<=e.near)throw new A.Z("far distance must be greater than near distance.");let t=this._translucencyByDistance;O.Z.equals(t,e)||(this._translucencyByDistance=O.Z.clone(e,t),iy(this,i_))}},pixelSize:{get:function(){return this._pixelSize},set:function(e){if(!(0,_.Z)(e))throw new A.Z("value is required.");this._pixelSize!==e&&(this._pixelSize=e,iy(this,ip))}},color:{get:function(){return this._color},set:function(e){if(!(0,_.Z)(e))throw new A.Z("value is required.");let t=this._color;C.Z.equals(t,e)||(C.Z.clone(e,t),iy(this,iu))}},outlineColor:{get:function(){return this._outlineColor},set:function(e){if(!(0,_.Z)(e))throw new A.Z("value is required.");let t=this._outlineColor;C.Z.equals(t,e)||(C.Z.clone(e,t),iy(this,ih))}},outlineWidth:{get:function(){return this._outlineWidth},set:function(e){if(!(0,_.Z)(e))throw new A.Z("value is required.");this._outlineWidth!==e&&(this._outlineWidth=e,iy(this,id))}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){if((0,_.Z)(e)&&e.far<=e.near)throw new A.Z("far must be greater than near");I.Z.equals(this._distanceDisplayCondition,e)||(this._distanceDisplayCondition=I.Z.clone(e,this._distanceDisplayCondition),iy(this,ig))}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){if(this._disableDepthTestDistance!==e){if(!(0,_.Z)(e)||e<0)throw new A.Z("disableDepthTestDistance must be greater than or equal to 0.0.");this._disableDepthTestDistance=e,iy(this,iZ)}}},id:{get:function(){return this._id},set:function(e){this._id=e,(0,_.Z)(this._pickId)&&(this._pickId.object.id=e)}},pickId:{get:function(){return this._pickId}},clusterShow:{get:function(){return this._clusterShow},set:function(e){this._clusterShow!==e&&(this._clusterShow=e,iy(this,il))}}}),is.prototype.getPickId=function(e){return(0,_.Z)(this._pickId)||(this._pickId=e.createPickId({primitive:this,collection:this._collection,id:this._id})),this._pickId},is.prototype._getActualPosition=function(){return this._actualPosition},is.prototype._setActualPosition=function(e){S.Z.clone(e,this._actualPosition),iy(this,ic)};let ib=new eo.Z;is._computeActualPosition=function(e,t,i){return t.mode===eu.Z.SCENE3D?e:(er.Z.multiplyByPoint(i,e,ib),eh.Z.computeActualWgs84Position(t,ib))};let iv=new eo.Z;is._computeScreenSpacePosition=function(e,t,i,n){let r=er.Z.multiplyByVector(e,eo.Z.fromElements(t.x,t.y,t.z,1,iv),iv);return eh.Z.wgs84ToWindowCoordinates(i,r,n)},is.prototype.computeScreenSpacePosition=function(e,t){let i=this._pointPrimitiveCollection;if((0,_.Z)(t)||(t=new w.Z),!(0,_.Z)(i))throw new A.Z("PointPrimitive must be in a collection.");if(!(0,_.Z)(e))throw new A.Z("scene is required.");let n=i.modelMatrix,r=is._computeScreenSpacePosition(n,this._actualPosition,e,t);if((0,_.Z)(r))return r.y=e.canvas.clientHeight-r.y,r},is.getScreenSpaceBoundingBox=function(e,t,i){let n=e.pixelSize,r=.5*n,o=t.x-r,a=t.y-r;return(0,_.Z)(i)||(i=new x.Z),i.x=o,i.y=a,i.width=n,i.height=n,i},is.prototype.equals=function(e){return this===e||(0,_.Z)(e)&&this._id===e._id&&S.Z.equals(this._position,e._position)&&C.Z.equals(this._color,e._color)&&this._pixelSize===e._pixelSize&&this._outlineWidth===e._outlineWidth&&this._show===e._show&&C.Z.equals(this._outlineColor,e._outlineColor)&&O.Z.equals(this._scaleByDistance,e._scaleByDistance)&&O.Z.equals(this._translucencyByDistance,e._translucencyByDistance)&&I.Z.equals(this._distanceDisplayCondition,e._distanceDisplayCondition)&&this._disableDepthTestDistance===e._disableDepthTestDistance},is.prototype._destroy=function(){this._pickId=this._pickId&&this._pickId.destroy(),this._pointPrimitiveCollection=void 0};var iT=i(5022),iE="in vec4 v_color;\nin vec4 v_outlineColor;\nin float v_innerPercent;\nin float v_pixelDistance;\nin vec4 v_pickColor;\n\nvoid main()\n{\n // The distance in UV space from this fragment to the center of the point, at most 0.5.\n float distanceToCenter = length(gl_PointCoord - vec2(0.5));\n // The max distance stops one pixel shy of the edge to leave space for anti-aliasing.\n float maxDistance = max(0.0, 0.5 - v_pixelDistance);\n float wholeAlpha = 1.0 - smoothstep(maxDistance, 0.5, distanceToCenter);\n float innerAlpha = 1.0 - smoothstep(maxDistance * v_innerPercent, 0.5 * v_innerPercent, distanceToCenter);\n\n vec4 color = mix(v_outlineColor, v_color, innerAlpha);\n color.a *= wholeAlpha;\n\n// Fully transparent parts of the billboard are not pickable.\n#if !defined(OPAQUE) && !defined(TRANSLUCENT)\n if (color.a < 0.005) // matches 0/255 and 1/255\n {\n discard;\n }\n#else\n// The billboard is rendered twice. The opaque pass discards translucent fragments\n// and the translucent pass discards opaque fragments.\n#ifdef OPAQUE\n if (color.a < 0.995) // matches < 254/255\n {\n discard;\n }\n#else\n if (color.a >= 0.995) // matches 254/255 and 255/255\n {\n discard;\n }\n#endif\n#endif\n\n out_FragColor = czm_gammaCorrect(color);\n czm_writeLogDepth();\n}\n";let ix=is.SHOW_INDEX,iw=is.POSITION_INDEX,iS=is.COLOR_INDEX,iC=is.OUTLINE_COLOR_INDEX,iA=is.OUTLINE_WIDTH_INDEX,iI=is.PIXEL_SIZE_INDEX,iO=is.SCALE_BY_DISTANCE_INDEX,iD=is.TRANSLUCENCY_BY_DISTANCE_INDEX,iP=is.DISTANCE_DISPLAY_CONDITION_INDEX,iR=is.DISABLE_DEPTH_DISTANCE_INDEX,iN=is.NUMBER_OF_PROPERTIES,iL={positionHighAndSize:0,positionLowAndOutline:1,compressedAttribute0:2,compressedAttribute1:3,scaleByDistance:4,distanceDisplayConditionAndDisableDepth:5};function iM(e){e=(0,m.Z)(e,m.Z.EMPTY_OBJECT),this._sp=void 0,this._spTranslucent=void 0,this._rsOpaque=void 0,this._rsTranslucent=void 0,this._vaf=void 0,this._pointPrimitives=[],this._pointPrimitivesToUpdate=[],this._pointPrimitivesToUpdateIndex=0,this._pointPrimitivesRemoved=!1,this._createVertexArray=!1,this._shaderScaleByDistance=!1,this._compiledShaderScaleByDistance=!1,this._shaderTranslucencyByDistance=!1,this._compiledShaderTranslucencyByDistance=!1,this._shaderDistanceDisplayCondition=!1,this._compiledShaderDistanceDisplayCondition=!1,this._shaderDisableDepthDistance=!1,this._compiledShaderDisableDepthDistance=!1,this._propertiesChanged=new Uint32Array(iN),this._maxPixelSize=1,this._baseVolume=new f.Z,this._baseVolumeWC=new f.Z,this._baseVolume2D=new f.Z,this._boundingVolume=new f.Z,this._boundingVolumeDirty=!1,this._colorCommands=[],this.show=(0,m.Z)(e.show,!0),this.modelMatrix=er.Z.clone((0,m.Z)(e.modelMatrix,er.Z.IDENTITY)),this._modelMatrix=er.Z.clone(er.Z.IDENTITY),this.debugShowBoundingVolume=(0,m.Z)(e.debugShowBoundingVolume,!1),this.blendOption=(0,m.Z)(e.blendOption,e0.OPAQUE_AND_TRANSLUCENT),this._blendOption=void 0,this._mode=eu.Z.SCENE3D,this._maxTotalPointSize=1,this._buffersUsage=[eV.Z.STATIC_DRAW,eV.Z.STATIC_DRAW,eV.Z.STATIC_DRAW,eV.Z.STATIC_DRAW,eV.Z.STATIC_DRAW,eV.Z.STATIC_DRAW,eV.Z.STATIC_DRAW,eV.Z.STATIC_DRAW,eV.Z.STATIC_DRAW];let t=this;this._uniforms={u_maxTotalPointSize:function(){return t._maxTotalPointSize}}}function iF(e){let t=e.length;for(let i=0;i<t;++i)e[i]&&e[i]._destroy()}function iz(e){if(e._pointPrimitivesRemoved){e._pointPrimitivesRemoved=!1;let t=[],i=e._pointPrimitives,n=i.length;for(let e=0,r=0;e<n;++e){let n=i[e];n&&(n._index=r++,t.push(n))}e._pointPrimitives=t}}Object.defineProperties(iM.prototype,{length:{get:function(){return iz(this),this._pointPrimitives.length}}}),iM.prototype.add=function(e){let t=new is(e,this);return t._index=this._pointPrimitives.length,this._pointPrimitives.push(t),this._createVertexArray=!0,t},iM.prototype.remove=function(e){return!!this.contains(e)&&(this._pointPrimitives[e._index]=null,this._pointPrimitivesRemoved=!0,this._createVertexArray=!0,e._destroy(),!0)},iM.prototype.removeAll=function(){iF(this._pointPrimitives),this._pointPrimitives=[],this._pointPrimitivesToUpdate=[],this._pointPrimitivesToUpdateIndex=0,this._pointPrimitivesRemoved=!1,this._createVertexArray=!0},iM.prototype._updatePointPrimitive=function(e,t){e._dirty||(this._pointPrimitivesToUpdate[this._pointPrimitivesToUpdateIndex++]=e),++this._propertiesChanged[t]},iM.prototype.contains=function(e){return(0,_.Z)(e)&&e._pointPrimitiveCollection===this},iM.prototype.get=function(e){if(!(0,_.Z)(e))throw new A.Z("index is required.");return iz(this),this._pointPrimitives[e]},iM.prototype.computeNewBuffersUsage=function(){let e=this._buffersUsage,t=!1,i=this._propertiesChanged;for(let n=0;n<iN;++n){let r=0===i[n]?eV.Z.STATIC_DRAW:eV.Z.STREAM_DRAW;t=t||e[n]!==r,e[n]=r}return t};let iB=new eF.Z;function iU(e,t,i,n){let r=n._index,o=n._getActualPosition();e._mode===eu.Z.SCENE3D&&(f.Z.expand(e._baseVolume,o,e._baseVolume),e._boundingVolumeDirty=!0),eF.Z.fromCartesian(o,iB);let a=n.pixelSize,s=n.outlineWidth;e._maxPixelSize=Math.max(e._maxPixelSize,a+s);let l=i[iL.positionHighAndSize],c=iB.high;l(r,c.x,c.y,c.z,a);let u=i[iL.positionLowAndOutline],h=iB.low;u(r,h.x,h.y,h.z,s)}function ik(e,t,i,n){let r=n._index,o=n.color,a=n.getPickId(t).color,s=n.outlineColor,l=C.Z.floatToByte(o.red),c=C.Z.floatToByte(o.green),u=C.Z.floatToByte(o.blue),h=65536*l+256*c+u,d=65536*(l=C.Z.floatToByte(s.red))+256*(c=C.Z.floatToByte(s.green))+(u=C.Z.floatToByte(s.blue)),f=65536*(l=C.Z.floatToByte(a.red))+256*(c=C.Z.floatToByte(a.green))+(u=C.Z.floatToByte(a.blue)),p=65536*C.Z.floatToByte(o.alpha)+256*C.Z.floatToByte(s.alpha)+C.Z.floatToByte(a.alpha);(0,i[iL.compressedAttribute0])(r,h,d,f,p)}function iV(e,t,i,n){let r=n._index,o=0,a=1,s=1,l=1,c=n.translucencyByDistance;(0,_.Z)(c)&&(o=c.near,a=c.nearValue,s=c.far,l=c.farValue,(1!==a||1!==l)&&(e._shaderTranslucencyByDistance=!0));let u=n.show&&n.clusterShow;0===n.color.alpha&&0===n.outlineColor.alpha&&(u=!1);let h=(u?1:0)*256+(a=1===(a=eB.Z.clamp(a,0,1))?255:255*a|0),d=l=1===(l=eB.Z.clamp(l,0,1))?255:255*l|0;(0,i[iL.compressedAttribute1])(r,h,d,o,s)}function iH(e,t,i,n){let r=n._index,o=i[iL.scaleByDistance],a=0,s=1,l=1,c=1,u=n.scaleByDistance;(0,_.Z)(u)&&(a=u.near,s=u.nearValue,l=u.far,c=u.farValue,(1!==s||1!==c)&&(e._shaderScaleByDistance=!0)),o(r,a,s,l,c)}function iG(e,t,i,n){let r=n._index,o=i[iL.distanceDisplayConditionAndDisableDepth],a=0,s=Number.MAX_VALUE,l=n.distanceDisplayCondition;(0,_.Z)(l)&&(a=l.near,s=l.far,a*=a,s*=s,e._shaderDistanceDisplayCondition=!0);let c=n.disableDepthTestDistance;(c*=c)>0&&(e._shaderDisableDepthDistance=!0,c===Number.POSITIVE_INFINITY&&(c=-1)),o(r,a,s,c)}function ij(e,t,i,n,r,o){let a;n.mode===eu.Z.SCENE3D?(a=e._baseVolume,e._boundingVolumeDirty=!0):a=e._baseVolume2D;let s=[];for(let e=0;e<i;++e){let i=t[e],l=i.position,c=is._computeActualPosition(l,n,r);(0,_.Z)(c)&&(i._setActualPosition(c),o?s.push(c):f.Z.expand(a,c,a))}o&&f.Z.fromPoints(s,a)}let iW=[];iM.prototype.update=function(e){let t,i,n,r,o,a,s,l;if(iz(this),!this.show)return;this._maxTotalPointSize=eH.Z.maximumAliasedPointSize,function(e,t){let i=t.mode,n=e._pointPrimitives,r=e._pointPrimitivesToUpdate,o=e._modelMatrix;e._createVertexArray||e._mode!==i||i!==eu.Z.SCENE3D&&!er.Z.equals(o,e.modelMatrix)?(e._mode=i,er.Z.clone(e.modelMatrix,o),e._createVertexArray=!0,(i===eu.Z.SCENE3D||i===eu.Z.SCENE2D||i===eu.Z.COLUMBUS_VIEW)&&ij(e,n,n.length,t,o,!0)):i===eu.Z.MORPHING?ij(e,n,n.length,t,o,!0):(i===eu.Z.SCENE2D||i===eu.Z.COLUMBUS_VIEW)&&ij(e,r,e._pointPrimitivesToUpdateIndex,t,o,!1)}(this,e);let c=this._pointPrimitives.length,u=this._pointPrimitivesToUpdate,h=this._pointPrimitivesToUpdateIndex,d=this._propertiesChanged,p=this._createVertexArray,m=e.context,g=e.passes,Z=g.pick;if(p||!Z&&this.computeNewBuffersUsage()){this._createVertexArray=!1;for(let e=0;e<iN;++e)d[e]=0;if(this._vaf=this._vaf&&this._vaf.destroy(),c>0){var y,b;this._vaf=(y=this._buffersUsage,new e$(m,[{index:iL.positionHighAndSize,componentsPerAttribute:4,componentDatatype:eM.Z.FLOAT,usage:y[iw]},{index:iL.positionLowAndShow,componentsPerAttribute:4,componentDatatype:eM.Z.FLOAT,usage:y[iw]},{index:iL.compressedAttribute0,componentsPerAttribute:4,componentDatatype:eM.Z.FLOAT,usage:y[iS]},{index:iL.compressedAttribute1,componentsPerAttribute:4,componentDatatype:eM.Z.FLOAT,usage:y[iD]},{index:iL.scaleByDistance,componentsPerAttribute:4,componentDatatype:eM.Z.FLOAT,usage:y[iO]},{index:iL.distanceDisplayConditionAndDisableDepth,componentsPerAttribute:3,componentDatatype:eM.Z.FLOAT,usage:y[iP]}],c)),t=this._vaf.writers;for(let e=0;e<c;++e){let i=this._pointPrimitives[e];i._dirty=!1,iU(this,m,b=t,i),ik(this,m,b,i),iV(this,m,b,i),iH(this,m,b,i),iG(this,m,b,i)}this._vaf.commit()}this._pointPrimitivesToUpdateIndex=0}else if(h>0){iW.length=0,(d[iw]||d[iA]||d[iI])&&iW.push(iU),(d[iS]||d[iC])&&iW.push(ik),(d[ix]||d[iD])&&iW.push(iV),d[iO]&&iW.push(iH),(d[iP]||d[iR])&&iW.push(iG);let e=iW.length;if(t=this._vaf.writers,h/c>.1){for(let i=0;i<h;++i){let n=u[i];n._dirty=!1;for(let i=0;i<e;++i)iW[i](this,m,t,n)}this._vaf.commit()}else{for(let i=0;i<h;++i){let n=u[i];n._dirty=!1;for(let i=0;i<e;++i)iW[i](this,m,t,n);this._vaf.subCommit(n._index,1)}this._vaf.endSubCommits()}this._pointPrimitivesToUpdateIndex=0}if(h>1.5*c&&(u.length=c),!(0,_.Z)(this._vaf)||!(0,_.Z)(this._vaf.va))return;this._boundingVolumeDirty&&(this._boundingVolumeDirty=!1,f.Z.transform(this._baseVolume,this.modelMatrix,this._baseVolumeWC));let v=er.Z.IDENTITY;e.mode===eu.Z.SCENE3D?(v=this.modelMatrix,i=f.Z.clone(this._baseVolumeWC,this._boundingVolume)):i=f.Z.clone(this._baseVolume2D,this._boundingVolume),function(e,t,i){let n=t.camera.getPixelSize(i,t.context.drawingBufferWidth,t.context.drawingBufferHeight)*e._maxPixelSize;i.radius+=n}(this,e,i);let T=this._blendOption!==this.blendOption;this._blendOption=this.blendOption,T&&(this._blendOption===e0.OPAQUE||this._blendOption===e0.OPAQUE_AND_TRANSLUCENT?this._rsOpaque=eW.Z.fromCache({depthTest:{enabled:!0,func:eU.Z.LEQUAL},depthMask:!0}):this._rsOpaque=void 0,this._blendOption===e0.TRANSLUCENT||this._blendOption===e0.OPAQUE_AND_TRANSLUCENT?this._rsTranslucent=eW.Z.fromCache({depthTest:{enabled:!0,func:eU.Z.LEQUAL},depthMask:!1,blending:eJ.Z.ALPHA_BLEND}):this._rsTranslucent=void 0),this._shaderDisableDepthDistance=this._shaderDisableDepthDistance||0!==e.minimumDisableDepthTestDistance,(T||this._shaderScaleByDistance&&!this._compiledShaderScaleByDistance||this._shaderTranslucencyByDistance&&!this._compiledShaderTranslucencyByDistance||this._shaderDistanceDisplayCondition&&!this._compiledShaderDistanceDisplayCondition||this._shaderDisableDepthDistance!==this._compiledShaderDisableDepthDistance)&&(n=new eY.Z({sources:['uniform float u_maxTotalPointSize;\n\nin vec4 positionHighAndSize;\nin vec4 positionLowAndOutline;\nin vec4 compressedAttribute0; // color, outlineColor, pick color\nin vec4 compressedAttribute1; // show, translucency by distance, some free space\nin vec4 scaleByDistance; // near, nearScale, far, farScale\nin vec3 distanceDisplayConditionAndDisableDepth; // near, far, disableDepthTestDistance\n\nout vec4 v_color;\nout vec4 v_outlineColor;\nout float v_innerPercent;\nout float v_pixelDistance;\nout vec4 v_pickColor;\n\nconst float SHIFT_LEFT8 = 256.0;\nconst float SHIFT_RIGHT8 = 1.0 / 256.0;\n\nvoid main()\n{\n // Modifying this shader may also require modifications to PointPrimitive._computeScreenSpacePosition\n\n // unpack attributes\n vec3 positionHigh = positionHighAndSize.xyz;\n vec3 positionLow = positionLowAndOutline.xyz;\n float outlineWidthBothSides = 2.0 * positionLowAndOutline.w;\n float totalSize = positionHighAndSize.w + outlineWidthBothSides;\n float outlinePercent = outlineWidthBothSides / totalSize;\n // Scale in response to browser-zoom.\n totalSize *= czm_pixelRatio;\n\n float temp = compressedAttribute1.x * SHIFT_RIGHT8;\n float show = floor(temp);\n\n#ifdef EYE_DISTANCE_TRANSLUCENCY\n vec4 translucencyByDistance;\n translucencyByDistance.x = compressedAttribute1.z;\n translucencyByDistance.z = compressedAttribute1.w;\n\n translucencyByDistance.y = ((temp - floor(temp)) * SHIFT_LEFT8) / 255.0;\n\n temp = compressedAttribute1.y * SHIFT_RIGHT8;\n translucencyByDistance.w = ((temp - floor(temp)) * SHIFT_LEFT8) / 255.0;\n#endif\n\n ///////////////////////////////////////////////////////////////////////////\n\n vec4 color;\n vec4 outlineColor;\n vec4 pickColor;\n\n // compressedAttribute0.z => pickColor.rgb\n\n temp = compressedAttribute0.z * SHIFT_RIGHT8;\n pickColor.b = (temp - floor(temp)) * SHIFT_LEFT8;\n temp = floor(temp) * SHIFT_RIGHT8;\n pickColor.g = (temp - floor(temp)) * SHIFT_LEFT8;\n pickColor.r = floor(temp);\n\n // compressedAttribute0.x => color.rgb\n\n temp = compressedAttribute0.x * SHIFT_RIGHT8;\n color.b = (temp - floor(temp)) * SHIFT_LEFT8;\n temp = floor(temp) * SHIFT_RIGHT8;\n color.g = (temp - floor(temp)) * SHIFT_LEFT8;\n color.r = floor(temp);\n\n // compressedAttribute0.y => outlineColor.rgb\n\n temp = compressedAttribute0.y * SHIFT_RIGHT8;\n outlineColor.b = (temp - floor(temp)) * SHIFT_LEFT8;\n temp = floor(temp) * SHIFT_RIGHT8;\n outlineColor.g = (temp - floor(temp)) * SHIFT_LEFT8;\n outlineColor.r = floor(temp);\n\n // compressedAttribute0.w => color.a, outlineColor.a, pickColor.a\n\n temp = compressedAttribute0.w * SHIFT_RIGHT8;\n pickColor.a = (temp - floor(temp)) * SHIFT_LEFT8;\n pickColor = pickColor / 255.0;\n\n temp = floor(temp) * SHIFT_RIGHT8;\n outlineColor.a = (temp - floor(temp)) * SHIFT_LEFT8;\n outlineColor /= 255.0;\n color.a = floor(temp);\n color /= 255.0;\n\n ///////////////////////////////////////////////////////////////////////////\n\n vec4 p = czm_translateRelativeToEye(positionHigh, positionLow);\n vec4 positionEC = czm_modelViewRelativeToEye * p;\n\n ///////////////////////////////////////////////////////////////////////////\n\n#if defined(EYE_DISTANCE_SCALING) || defined(EYE_DISTANCE_TRANSLUCENCY) || defined(DISTANCE_DISPLAY_CONDITION) || defined(DISABLE_DEPTH_DISTANCE)\n float lengthSq;\n if (czm_sceneMode == czm_sceneMode2D)\n {\n // 2D camera distance is a special case\n // treat all billboards as flattened to the z=0.0 plane\n lengthSq = czm_eyeHeight2D.y;\n }\n else\n {\n lengthSq = dot(positionEC.xyz, positionEC.xyz);\n }\n#endif\n\n#ifdef EYE_DISTANCE_SCALING\n totalSize *= czm_nearFarScalar(scaleByDistance, lengthSq);\n#endif\n if (totalSize > 0.0) {\n // Add padding for anti-aliasing on both sides.\n totalSize += 3.0;\n }\n\n // Clamp to max point size.\n totalSize = min(totalSize, u_maxTotalPointSize);\n // If size is too small, push vertex behind near plane for clipping.\n // Note that context.minimumAliasedPointSize "will be at most 1.0".\n if (totalSize < 1.0)\n {\n positionEC.xyz = vec3(0.0);\n totalSize = 1.0;\n }\n\n float translucency = 1.0;\n#ifdef EYE_DISTANCE_TRANSLUCENCY\n translucency = czm_nearFarScalar(translucencyByDistance, lengthSq);\n // push vertex behind near plane for clipping\n if (translucency < 0.004)\n {\n positionEC.xyz = vec3(0.0);\n }\n#endif\n\n#ifdef DISTANCE_DISPLAY_CONDITION\n float nearSq = distanceDisplayConditionAndDisableDepth.x;\n float farSq = distanceDisplayConditionAndDisableDepth.y;\n if (lengthSq < nearSq || lengthSq > farSq) {\n // push vertex behind camera to force it to be clipped\n positionEC.xyz = vec3(0.0, 0.0, 1.0);\n }\n#endif\n\n gl_Position = czm_projection * positionEC;\n czm_vertexLogDepth();\n\n#ifdef DISABLE_DEPTH_DISTANCE\n float disableDepthTestDistance = distanceDisplayConditionAndDisableDepth.z;\n if (disableDepthTestDistance == 0.0 && czm_minimumDisableDepthTestDistance != 0.0)\n {\n disableDepthTestDistance = czm_minimumDisableDepthTestDistance;\n }\n\n if (disableDepthTestDistance != 0.0)\n {\n // Don\'t try to "multiply both sides" by w. Greater/less-than comparisons won\'t work for negative values of w.\n float zclip = gl_Position.z / gl_Position.w;\n bool clipped = (zclip < -1.0 || zclip > 1.0);\n if (!clipped && (disableDepthTestDistance < 0.0 || (lengthSq > 0.0 && lengthSq < disableDepthTestDistance)))\n {\n // Position z on the near plane.\n gl_Position.z = -gl_Position.w;\n#ifdef LOG_DEPTH\n czm_vertexLogDepth(vec4(czm_currentFrustum.x));\n#endif\n }\n }\n#endif\n\n v_color = color;\n v_color.a *= translucency * show;\n v_outlineColor = outlineColor;\n v_outlineColor.a *= translucency * show;\n\n v_innerPercent = 1.0 - outlinePercent;\n v_pixelDistance = 2.0 / totalSize;\n gl_PointSize = totalSize * show;\n gl_Position *= show;\n\n v_pickColor = pickColor;\n}\n']}),this._shaderScaleByDistance&&n.defines.push("EYE_DISTANCE_SCALING"),this._shaderTranslucencyByDistance&&n.defines.push("EYE_DISTANCE_TRANSLUCENCY"),this._shaderDistanceDisplayCondition&&n.defines.push("DISTANCE_DISPLAY_CONDITION"),this._shaderDisableDepthDistance&&n.defines.push("DISABLE_DEPTH_DISTANCE"),this._blendOption===e0.OPAQUE_AND_TRANSLUCENT&&(r=new eY.Z({defines:["OPAQUE"],sources:[iE]}),this._sp=eq.Z.replaceCache({context:m,shaderProgram:this._sp,vertexShaderSource:n,fragmentShaderSource:r,attributeLocations:iL}),r=new eY.Z({defines:["TRANSLUCENT"],sources:[iE]}),this._spTranslucent=eq.Z.replaceCache({context:m,shaderProgram:this._spTranslucent,vertexShaderSource:n,fragmentShaderSource:r,attributeLocations:iL})),this._blendOption===e0.OPAQUE&&(r=new eY.Z({sources:[iE]}),this._sp=eq.Z.replaceCache({context:m,shaderProgram:this._sp,vertexShaderSource:n,fragmentShaderSource:r,attributeLocations:iL})),this._blendOption===e0.TRANSLUCENT&&(r=new eY.Z({sources:[iE]}),this._spTranslucent=eq.Z.replaceCache({context:m,shaderProgram:this._spTranslucent,vertexShaderSource:n,fragmentShaderSource:r,attributeLocations:iL})),this._compiledShaderScaleByDistance=this._shaderScaleByDistance,this._compiledShaderTranslucencyByDistance=this._shaderTranslucencyByDistance,this._compiledShaderDistanceDisplayCondition=this._shaderDistanceDisplayCondition,this._compiledShaderDisableDepthDistance=this._shaderDisableDepthDistance);let E=e.commandList;if(g.render||Z){let e=this._colorCommands,t=this._blendOption===e0.OPAQUE,n=this._blendOption===e0.OPAQUE_AND_TRANSLUCENT;a=(o=this._vaf.va).length,e.length=a;let r=n?2*a:a;for(l=0;l<r;++l){let r=t||n&&l%2==0;s=e[l],(0,_.Z)(s)||(s=e[l]=new eG.Z),s.primitiveType=iT.Z.POINTS,s.pass=r||!n?ej.Z.OPAQUE:ej.Z.TRANSLUCENT,s.owner=this;let a=n?Math.floor(l/2):l;s.boundingVolume=i,s.modelMatrix=v,s.shaderProgram=r?this._sp:this._spTranslucent,s.uniformMap=this._uniforms,s.vertexArray=o[a].va,s.renderState=r?this._rsOpaque:this._rsTranslucent,s.debugShowBoundingVolume=this.debugShowBoundingVolume,s.pickId="v_pickColor",E.push(s)}}},iM.prototype.isDestroyed=function(){return!1},iM.prototype.destroy=function(){return this._sp=this._sp&&this._sp.destroy(),this._spTranslucent=this._spTranslucent&&this._spTranslucent.destroy(),this._spPick=this._spPick&&this._spPick.destroy(),this._vaf=this._vaf&&this._vaf.destroy(),iF(this._pointPrimitives),(0,g.Z)(this)};let iq=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array];class iY{static from(e){if(!(e instanceof ArrayBuffer))throw Error("Data must be an instance of ArrayBuffer.");let[t,i]=new Uint8Array(e,0,2);if(219!==t)throw Error("Data does not appear to be in a KDBush format.");let n=i>>4;if(1!==n)throw Error(`Got v${n} data when expected v1.`);let r=iq[15&i];if(!r)throw Error("Unrecognized array type.");let[o]=new Uint16Array(e,2,1),[a]=new Uint32Array(e,4,1);return new iY(a,o,r,e)}constructor(e,t=64,i=Float64Array,n){if(isNaN(e)||e<0)throw Error(`Unpexpected numItems value: ${e}.`);this.numItems=+e,this.nodeSize=Math.min(Math.max(+t,2),65535),this.ArrayType=i,this.IndexArrayType=e<65536?Uint16Array:Uint32Array;let r=iq.indexOf(this.ArrayType),o=2*e*this.ArrayType.BYTES_PER_ELEMENT,a=e*this.IndexArrayType.BYTES_PER_ELEMENT,s=(8-a%8)%8;if(r<0)throw Error(`Unexpected typed array class: ${i}.`);n&&n instanceof ArrayBuffer?(this.data=n,this.ids=new this.IndexArrayType(this.data,8,e),this.coords=new this.ArrayType(this.data,8+a+s,2*e),this._pos=2*e,this._finished=!0):(this.data=new ArrayBuffer(8+o+a+s),this.ids=new this.IndexArrayType(this.data,8,e),this.coords=new this.ArrayType(this.data,8+a+s,2*e),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,16+r]),new Uint16Array(this.data,2,1)[0]=t,new Uint32Array(this.data,4,1)[0]=e)}add(e,t){let i=this._pos>>1;return this.ids[i]=i,this.coords[this._pos++]=e,this.coords[this._pos++]=t,i}finish(){let e=this._pos>>1;if(e!==this.numItems)throw Error(`Added ${e} items when expected ${this.numItems}.`);return function e(t,i,n,r,o,a){if(o-r<=n)return;let s=r+o>>1;(function e(t,i,n,r,o,a){for(;o>r;){if(o-r>600){let s=o-r+1,l=n-r+1,c=Math.log(s),u=.5*Math.exp(2*c/3),h=.5*Math.sqrt(c*u*(s-u)/s)*(l-s/2<0?-1:1),d=Math.max(r,Math.floor(n-l*u/s+h)),f=Math.min(o,Math.floor(n+(s-l)*u/s+h));e(t,i,n,d,f,a)}let s=i[2*n+a],l=r,c=o;for(iX(t,i,r,n),i[2*o+a]>s&&iX(t,i,r,o);l<c;){for(iX(t,i,l,c),l++,c--;i[2*l+a]<s;)l++;for(;i[2*c+a]>s;)c--}i[2*r+a]===s?iX(t,i,r,c):iX(t,i,++c,o),c<=n&&(r=c+1),n<=c&&(o=c-1)}})(t,i,s,r,o,a),e(t,i,n,r,s-1,1-a),e(t,i,n,s+1,o,1-a)}(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(e,t,i,n){if(!this._finished)throw Error("Data not yet indexed - call index.finish().");let{ids:r,coords:o,nodeSize:a}=this,s=[0,r.length-1,0],l=[];for(;s.length;){let c=s.pop()||0,u=s.pop()||0,h=s.pop()||0;if(u-h<=a){for(let a=h;a<=u;a++){let s=o[2*a],c=o[2*a+1];s>=e&&s<=i&&c>=t&&c<=n&&l.push(r[a])}continue}let d=h+u>>1,f=o[2*d],p=o[2*d+1];f>=e&&f<=i&&p>=t&&p<=n&&l.push(r[d]),(0===c?e<=f:t<=p)&&(s.push(h),s.push(d-1),s.push(1-c)),(0===c?i>=f:n>=p)&&(s.push(d+1),s.push(u),s.push(1-c))}return l}within(e,t,i){if(!this._finished)throw Error("Data not yet indexed - call index.finish().");let{ids:n,coords:r,nodeSize:o}=this,a=[0,n.length-1,0],s=[],l=i*i;for(;a.length;){let c=a.pop()||0,u=a.pop()||0,h=a.pop()||0;if(u-h<=o){for(let i=h;i<=u;i++)iK(r[2*i],r[2*i+1],e,t)<=l&&s.push(n[i]);continue}let d=h+u>>1,f=r[2*d],p=r[2*d+1];iK(f,p,e,t)<=l&&s.push(n[d]),(0===c?e-i<=f:t-i<=p)&&(a.push(h),a.push(d-1),a.push(1-c)),(0===c?e+i>=f:t+i>=p)&&(a.push(d+1),a.push(u),a.push(1-c))}return s}}function iX(e,t,i,n){i$(e,i,n),i$(t,2*i,2*n),i$(t,2*i+1,2*n+1)}function i$(e,t,i){let n=e[t];e[t]=e[i],e[i]=n}function iK(e,t,i,n){let r=e-i,o=t-n;return r*r+o*o}function iQ(e){e=(0,m.Z)(e,m.Z.EMPTY_OBJECT),this._enabled=(0,m.Z)(e.enabled,!1),this._pixelRange=(0,m.Z)(e.pixelRange,80),this._minimumClusterSize=(0,m.Z)(e.minimumClusterSize,2),this._clusterBillboards=(0,m.Z)(e.clusterBillboards,!0),this._clusterLabels=(0,m.Z)(e.clusterLabels,!0),this._clusterPoints=(0,m.Z)(e.clusterPoints,!0),this._labelCollection=void 0,this._billboardCollection=void 0,this._pointCollection=void 0,this._clusterBillboardCollection=void 0,this._clusterLabelCollection=void 0,this._clusterPointCollection=void 0,this._collectionIndicesByEntity={},this._unusedLabelIndices=[],this._unusedBillboardIndices=[],this._unusedPointIndices=[],this._previousClusters=[],this._previousHeight=void 0,this._enabledDirty=!1,this._clusterDirty=!1,this._cluster=void 0,this._removeEventListener=void 0,this._clusterEvent=new et.Z,this.show=(0,m.Z)(e.show,!0)}function iJ(e,t){e.x-=t,e.y-=t,e.width+=2*t,e.height+=2*t}let i0=new x.Z;function i1(e,t,i,n,r){if((0,_.Z)(e._labelCollection)&&n._clusterLabels?r=tK.getScreenSpaceBoundingBox(e,t,r):(0,_.Z)(e._billboardCollection)&&n._clusterBillboards?r=ed.getScreenSpaceBoundingBox(e,t,r):(0,_.Z)(e._pointPrimitiveCollection)&&n._clusterPoints&&(r=is.getScreenSpaceBoundingBox(e,t,r)),iJ(r,i),n._clusterLabels&&!(0,_.Z)(e._labelCollection)&&(0,_.Z)(e.id)&&i3(n,e.id.id)&&(0,_.Z)(e.id._label)){let o=n._collectionIndicesByEntity[e.id.id].labelIndex,a=n._labelCollection.get(o),s=tK.getScreenSpaceBoundingBox(a,t,i0);iJ(s,i),r=x.Z.union(r,s,r)}return r}function i2(e,t,i,n){let r={billboard:n._clusterBillboardCollection.add(),label:n._clusterLabelCollection.add(),point:n._clusterPointCollection.add()};r.billboard.show=!1,r.point.show=!1,r.label.show=!0,r.label.text=t.toLocaleString(),r.label.id=i,r.billboard.position=r.label.position=r.point.position=e,n._clusterEvent.raiseEvent(i,r)}function i3(e,t){return(0,_.Z)(e)&&(0,_.Z)(e._collectionIndicesByEntity[t])&&(0,_.Z)(e._collectionIndicesByEntity[t].labelIndex)}function i4(e,t,i,n,r){if(!(0,_.Z)(e))return;let o=e.length;for(let a=0;a<o;++a){let o=e.get(a);if(o.clusterShow=!1,!o.show||r._scene.mode===eu.Z.SCENE3D&&!n.isPointVisible(o.position))continue;let s=r._clusterLabels&&(0,_.Z)(o._labelCollection),l=r._clusterBillboards&&(0,_.Z)(o.id._billboard),c=r._clusterPoints&&(0,_.Z)(o.id._point);if(s&&(c||l))continue;let u=o.computeScreenSpacePosition(i);(0,_.Z)(u)&&t.push({index:a,collection:e,clustered:!1,coord:u})}}let i5=new x.Z,i9=new x.Z,i8=new x.Z;function i6(e,t,i,n){return function(r){let o,a,s=this[e];(0,_.Z)(this._collectionIndicesByEntity)||(this._collectionIndicesByEntity={});let l=this._collectionIndicesByEntity[r.id];if((0,_.Z)(l)||(l=this._collectionIndicesByEntity[r.id]={billboardIndex:void 0,labelIndex:void 0,pointIndex:void 0}),(0,_.Z)(s)&&(0,_.Z)(l[n]))return s.get(l[n]);(0,_.Z)(s)||(s=this[e]=new t({scene:this._scene}));let c=this[i];c.length>0?(o=c.shift(),a=s.get(o)):(a=s.add(),o=s.length-1),l[n]=o;let u=this;return Promise.resolve().then(function(){u._clusterDirty=!0}),a}}function i7(e,t){let i=e._collectionIndicesByEntity[t];(0,_.Z)(i.billboardIndex)||(0,_.Z)(i.labelIndex)||(0,_.Z)(i.pointIndex)||delete e._collectionIndicesByEntity[t]}function ne(e){if(!(0,_.Z)(e))return;let t=e.length;for(let i=0;i<t;++i)e.get(i).clusterShow=!0}iQ.prototype._initialize=function(e){var t;this._scene=e;let i=(t=this,function(e){let i,n,r,o,a,s,l,c,u,h,d;if((0,_.Z)(e)&&e<.05||!t.enabled)return;let f=t._scene,p=t._labelCollection,m=t._billboardCollection,g=t._pointCollection;if(!(0,_.Z)(p)&&!(0,_.Z)(m)&&!(0,_.Z)(g)||!t._clusterBillboards&&!t._clusterLabels&&!t._clusterPoints)return;let Z=t._clusterLabelCollection,y=t._clusterBillboardCollection,b=t._clusterPointCollection;(0,_.Z)(Z)?Z.removeAll():Z=t._clusterLabelCollection=new ia({scene:f}),(0,_.Z)(y)?y.removeAll():y=t._clusterBillboardCollection=new tv({scene:f}),(0,_.Z)(b)?b.removeAll():b=t._clusterPointCollection=new iM;let v=t._pixelRange,T=t._minimumClusterSize,E=t._previousClusters,C=[],A=t._previousHeight,I=f.camera.positionCartographic.height,O=f.mapProjection.ellipsoid,D=f.camera.positionWC,P=new en.Z(O,D),R=[];if(t._clusterLabels&&i4(p,R,f,P,t),t._clusterBillboards&&i4(m,R,f,P,t),t._clusterPoints&&i4(g,R,f,P,t),R.length>0){let e=new iY(R.length,64,Uint32Array);for(let t=0;t<R.length;++t)e.add(R[t].coord.x,R[t].coord.y);if(e.finish(),I<A)for(i=0,r=E.length;i<r;++i){let r=E[i];if(!P.isPointVisible(r.position))continue;let o=ed._computeScreenSpacePosition(er.Z.IDENTITY,r.position,S.Z.ZERO,w.Z.ZERO,f);if(!(0,_.Z)(o))continue;let p=1-I/A,m=r.width=r.width*p,g=r.height=r.height*p;m=Math.max(m,r.minimumWidth),g=Math.max(g,r.minimumHeight);let Z=o.x-.5*m,y=o.y-.5*g,b=o.x+m,v=o.y+g;for(n=0,s=(a=e.range(Z,y,b,v)).length,u=0,c=[];n<s;++n)(l=R[a[n]]).clustered||(++u,h=l.collection,d=l.index,c.push(h.get(d).id));if(u>=T)for(i2(r.position,u,c,t),C.push(r),n=0;n<s;++n)R[a[n]].clustered=!0}for(i=0,r=R.length;i<r;++i){let r=R[i];if(r.clustered)continue;r.clustered=!0,h=r.collection,d=r.index;let f=h.get(d);o=i1(f,r.coord,v,t,i5);let p=x.Z.clone(o,i9);s=(a=e.range(o.x,o.y,o.x+o.width,o.y+o.height)).length;let m=S.Z.clone(f.position);for(n=0,u=1,c=[f.id];n<s;++n)if(!(l=R[a[n]]).clustered){let e=l.collection.get(l.index),i=i1(e,l.coord,v,t,i8);S.Z.add(e.position,m,m),x.Z.union(p,i,p),++u,c.push(e.id)}if(u>=T){let e=S.Z.multiplyByScalar(m,1/u,m);for(i2(e,u,c,t),C.push({position:e,width:p.width,height:p.height,minimumWidth:o.width,minimumHeight:o.height}),n=0;n<s;++n)R[a[n]].clustered=!0}else!function(e,t){if(e.clusterShow=!0,!(0,_.Z)(e._labelCollection)&&(0,_.Z)(e.id)&&i3(t,e.id.id)&&(0,_.Z)(e.id._label)){let i=t._collectionIndicesByEntity[e.id.id].labelIndex;t._labelCollection.get(i).clusterShow=!0}}(f,t)}}0===Z.length&&(Z.destroy(),t._clusterLabelCollection=void 0),0===y.length&&(y.destroy(),t._clusterBillboardCollection=void 0),0===b.length&&(b.destroy(),t._clusterPointCollection=void 0),t._previousClusters=C,t._previousHeight=I});this._cluster=i,this._removeEventListener=e.camera.changed.addEventListener(i)},Object.defineProperties(iQ.prototype,{enabled:{get:function(){return this._enabled},set:function(e){this._enabledDirty=e!==this._enabled,this._enabled=e}},pixelRange:{get:function(){return this._pixelRange},set:function(e){this._clusterDirty=this._clusterDirty||e!==this._pixelRange,this._pixelRange=e}},minimumClusterSize:{get:function(){return this._minimumClusterSize},set:function(e){this._clusterDirty=this._clusterDirty||e!==this._minimumClusterSize,this._minimumClusterSize=e}},clusterEvent:{get:function(){return this._clusterEvent}},clusterBillboards:{get:function(){return this._clusterBillboards},set:function(e){this._clusterDirty=this._clusterDirty||e!==this._clusterBillboards,this._clusterBillboards=e}},clusterLabels:{get:function(){return this._clusterLabels},set:function(e){this._clusterDirty=this._clusterDirty||e!==this._clusterLabels,this._clusterLabels=e}},clusterPoints:{get:function(){return this._clusterPoints},set:function(e){this._clusterDirty=this._clusterDirty||e!==this._clusterPoints,this._clusterPoints=e}}}),iQ.prototype.getLabel=i6("_labelCollection",ia,"_unusedLabelIndices","labelIndex"),iQ.prototype.removeLabel=function(e){let t=this._collectionIndicesByEntity&&this._collectionIndicesByEntity[e.id];if(!(0,_.Z)(this._labelCollection)||!(0,_.Z)(t)||!(0,_.Z)(t.labelIndex))return;let i=t.labelIndex;t.labelIndex=void 0,i7(this,e.id);let n=this._labelCollection.get(i);n.show=!1,n.text="",n.id=void 0,this._unusedLabelIndices.push(i),this._clusterDirty=!0},iQ.prototype.getBillboard=i6("_billboardCollection",tv,"_unusedBillboardIndices","billboardIndex"),iQ.prototype.removeBillboard=function(e){let t=this._collectionIndicesByEntity&&this._collectionIndicesByEntity[e.id];if(!(0,_.Z)(this._billboardCollection)||!(0,_.Z)(t)||!(0,_.Z)(t.billboardIndex))return;let i=t.billboardIndex;t.billboardIndex=void 0,i7(this,e.id);let n=this._billboardCollection.get(i);n.id=void 0,n.show=!1,n.image=void 0,this._unusedBillboardIndices.push(i),this._clusterDirty=!0},iQ.prototype.getPoint=i6("_pointCollection",iM,"_unusedPointIndices","pointIndex"),iQ.prototype.removePoint=function(e){let t=this._collectionIndicesByEntity&&this._collectionIndicesByEntity[e.id];if(!(0,_.Z)(this._pointCollection)||!(0,_.Z)(t)||!(0,_.Z)(t.pointIndex))return;let i=t.pointIndex;t.pointIndex=void 0,i7(this,e.id);let n=this._pointCollection.get(i);n.show=!1,n.id=void 0,this._unusedPointIndices.push(i),this._clusterDirty=!0},iQ.prototype.update=function(e){let t;if(this.show)(0,_.Z)(this._labelCollection)&&this._labelCollection.length>0&&0===this._labelCollection.get(0)._glyphs.length&&(t=e.commandList,e.commandList=[],this._labelCollection.update(e),e.commandList=t),(0,_.Z)(this._billboardCollection)&&this._billboardCollection.length>0&&!(0,_.Z)(this._billboardCollection.get(0).width)&&(t=e.commandList,e.commandList=[],this._billboardCollection.update(e),e.commandList=t),this._enabledDirty&&(this._enabledDirty=!1,this.enabled||((0,_.Z)(this._clusterLabelCollection)&&this._clusterLabelCollection.destroy(),(0,_.Z)(this._clusterBillboardCollection)&&this._clusterBillboardCollection.destroy(),(0,_.Z)(this._clusterPointCollection)&&this._clusterPointCollection.destroy(),this._clusterLabelCollection=void 0,this._clusterBillboardCollection=void 0,this._clusterPointCollection=void 0,ne(this._labelCollection),ne(this._billboardCollection),ne(this._pointCollection)),this._clusterDirty=!0),this._clusterDirty&&(this._clusterDirty=!1,this._cluster()),(0,_.Z)(this._clusterLabelCollection)&&this._clusterLabelCollection.update(e),(0,_.Z)(this._clusterBillboardCollection)&&this._clusterBillboardCollection.update(e),(0,_.Z)(this._clusterPointCollection)&&this._clusterPointCollection.update(e),(0,_.Z)(this._labelCollection)&&this._labelCollection.update(e),(0,_.Z)(this._billboardCollection)&&this._billboardCollection.update(e),(0,_.Z)(this._pointCollection)&&this._pointCollection.update(e)},iQ.prototype.destroy=function(){this._labelCollection=this._labelCollection&&this._labelCollection.destroy(),this._billboardCollection=this._billboardCollection&&this._billboardCollection.destroy(),this._pointCollection=this._pointCollection&&this._pointCollection.destroy(),this._clusterLabelCollection=this._clusterLabelCollection&&this._clusterLabelCollection.destroy(),this._clusterBillboardCollection=this._clusterBillboardCollection&&this._clusterBillboardCollection.destroy(),this._clusterPointCollection=this._clusterPointCollection&&this._clusterPointCollection.destroy(),(0,_.Z)(this._removeEventListener)&&(this._removeEventListener(),this._removeEventListener=void 0),this._labelCollection=void 0,this._billboardCollection=void 0,this._pointCollection=void 0,this._clusterBillboardCollection=void 0,this._clusterLabelCollection=void 0,this._clusterPointCollection=void 0,this._collectionIndicesByEntity=void 0,this._unusedLabelIndices=[],this._unusedBillboardIndices=[],this._unusedPointIndices=[],this._previousClusters=[],this._previousHeight=void 0,this._enabledDirty=!1,this._pixelRangeDirty=!1,this._minimumClusterSizeDirty=!1};var nt=i(5951);function ni(e){e=(0,m.Z)(e,m.Z.EMPTY_OBJECT),this.start=(0,_.Z)(e.start)?nt.Z.clone(e.start):new nt.Z,this.stop=(0,_.Z)(e.stop)?nt.Z.clone(e.stop):new nt.Z,this.data=e.data,this.isStartIncluded=(0,m.Z)(e.isStartIncluded,!0),this.isStopIncluded=(0,m.Z)(e.isStopIncluded,!0)}Object.defineProperties(ni.prototype,{isEmpty:{get:function(){let e=nt.Z.compare(this.stop,this.start);return e<0||0===e&&(!this.isStartIncluded||!this.isStopIncluded)}}});let nn={start:void 0,stop:void 0,isStartIncluded:void 0,isStopIncluded:void 0,data:void 0};ni.fromIso8601=function(e,t){p.Z.typeOf.object("options",e),p.Z.typeOf.string("options.iso8601",e.iso8601);let i=e.iso8601.split("/");if(2!==i.length)throw new A.Z("options.iso8601 is an invalid ISO 8601 interval.");let n=nt.Z.fromIso8601(i[0]),r=nt.Z.fromIso8601(i[1]),o=(0,m.Z)(e.isStartIncluded,!0),a=(0,m.Z)(e.isStopIncluded,!0),s=e.data;return(0,_.Z)(t)?(t.start=n,t.stop=r,t.isStartIncluded=o,t.isStopIncluded=a,t.data=s,t):(nn.start=n,nn.stop=r,nn.isStartIncluded=o,nn.isStopIncluded=a,nn.data=s,new ni(nn))},ni.toIso8601=function(e,t){return p.Z.typeOf.object("timeInterval",e),`${nt.Z.toIso8601(e.start,t)}/${nt.Z.toIso8601(e.stop,t)}`},ni.clone=function(e,t){return(0,_.Z)(e)?(0,_.Z)(t)?(t.start=e.start,t.stop=e.stop,t.isStartIncluded=e.isStartIncluded,t.isStopIncluded=e.isStopIncluded,t.data=e.data,t):new ni(e):void 0},ni.equals=function(e,t,i){return e===t||(0,_.Z)(e)&&(0,_.Z)(t)&&(e.isEmpty&&t.isEmpty||e.isStartIncluded===t.isStartIncluded&&e.isStopIncluded===t.isStopIncluded&&nt.Z.equals(e.start,t.start)&&nt.Z.equals(e.stop,t.stop)&&(e.data===t.data||(0,_.Z)(i)&&i(e.data,t.data)))},ni.equalsEpsilon=function(e,t,i,n){return i=(0,m.Z)(i,0),e===t||(0,_.Z)(e)&&(0,_.Z)(t)&&(e.isEmpty&&t.isEmpty||e.isStartIncluded===t.isStartIncluded&&e.isStopIncluded===t.isStopIncluded&&nt.Z.equalsEpsilon(e.start,t.start,i)&&nt.Z.equalsEpsilon(e.stop,t.stop,i)&&(e.data===t.data||(0,_.Z)(n)&&n(e.data,t.data)))},ni.intersect=function(e,t,i,n){if(p.Z.typeOf.object("left",e),!(0,_.Z)(t))return ni.clone(ni.EMPTY,i);let r=e.start,o=e.stop,a=t.start,s=t.stop,l=nt.Z.greaterThanOrEquals(a,r)&&nt.Z.greaterThanOrEquals(o,a),c=!l&&nt.Z.lessThanOrEquals(a,r)&&nt.Z.lessThanOrEquals(r,s);if(!l&&!c)return ni.clone(ni.EMPTY,i);let u=e.isStartIncluded,h=e.isStopIncluded,d=t.isStartIncluded,f=t.isStopIncluded,m=nt.Z.lessThan(o,s);return(0,_.Z)(i)||(i=new ni),i.start=l?a:r,i.isStartIncluded=u&&d||!nt.Z.equals(a,r)&&(l&&d||c&&u),i.stop=m?o:s,i.isStopIncluded=m?h:h&&f||!nt.Z.equals(s,o)&&f,i.data=(0,_.Z)(n)?n(e.data,t.data):e.data,i},ni.contains=function(e,t){if(p.Z.typeOf.object("timeInterval",e),p.Z.typeOf.object("julianDate",t),e.isEmpty)return!1;let i=nt.Z.compare(e.start,t);if(0===i)return e.isStartIncluded;let n=nt.Z.compare(t,e.stop);return 0===n?e.isStopIncluded:i<0&&n<0},ni.prototype.clone=function(e){return ni.clone(this,e)},ni.prototype.equals=function(e,t){return ni.equals(this,e,t)},ni.prototype.equalsEpsilon=function(e,t,i){return ni.equalsEpsilon(this,e,t,i)},ni.prototype.toString=function(){return ni.toIso8601(this)},ni.EMPTY=Object.freeze(new ni({start:new nt.Z,stop:new nt.Z,isStartIncluded:!1,isStopIncluded:!1}));let nr=Object.freeze(nt.Z.fromIso8601("0000-01-01T00:00:00Z")),no=Object.freeze(nt.Z.fromIso8601("9999-12-31T24:00:00Z"));Object.freeze(new ni({start:nr,stop:no}));var na={MINIMUM_VALUE:nr,MAXIMUM_VALUE:no},ns=i(3602);let nl={id:void 0};function nc(e){if(e._firing){e._refire=!0;return}if(0===e._suspendCount){let t=e._addedEntities,i=e._removedEntities,n=e._changedEntities;if(0!==n.length||0!==t.length||0!==i.length){e._firing=!0;do{e._refire=!1;let r=t.values.slice(0),o=i.values.slice(0),a=n.values.slice(0);t.removeAll(),i.removeAll(),n.removeAll(),e._collectionChanged.raiseEvent(e,r,o,a)}while(e._refire);e._firing=!1}}}function nu(e){this._owner=e,this._entities=new E.Z,this._addedEntities=new E.Z,this._removedEntities=new E.Z,this._changedEntities=new E.Z,this._suspendCount=0,this._collectionChanged=new et.Z,this._id=(0,es.Z)(),this._show=!0,this._firing=!1,this._refire=!1}function nh(e){this._name=e,this._clock=void 0,this._changed=new et.Z,this._error=new et.Z,this._isLoading=!1,this._loading=new et.Z,this._entityCollection=new nu(this),this._entityCluster=new iQ}nu.prototype.suspendEvents=function(){this._suspendCount++},nu.prototype.resumeEvents=function(){if(0===this._suspendCount)throw new A.Z("resumeEvents can not be called before suspendEvents.");this._suspendCount--,nc(this)},Object.defineProperties(nu.prototype,{collectionChanged:{get:function(){return this._collectionChanged}},id:{get:function(){return this._id}},values:{get:function(){return this._entities.values}},show:{get:function(){return this._show},set:function(e){let t;if(!(0,_.Z)(e))throw new A.Z("value is required.");if(e===this._show)return;this.suspendEvents();let i=[],n=this._entities.values,r=n.length;for(t=0;t<r;t++)i.push(n[t].isShowing);for(t=0,this._show=e;t<r;t++){let e=i[t],r=n[t];e!==r.isShowing&&r.definitionChanged.raiseEvent(r,"isShowing",r.isShowing,e)}this.resumeEvents()}},owner:{get:function(){return this._owner}}}),nu.prototype.computeAvailability=function(){let e=na.MAXIMUM_VALUE,t=na.MINIMUM_VALUE,i=this._entities.values;for(let n=0,r=i.length;n<r;n++){let r=i[n].availability;if((0,_.Z)(r)){let i=r.start,n=r.stop;nt.Z.lessThan(i,e)&&!i.equals(na.MINIMUM_VALUE)&&(e=i),nt.Z.greaterThan(n,t)&&!n.equals(na.MAXIMUM_VALUE)&&(t=n)}}return na.MAXIMUM_VALUE.equals(e)&&(e=na.MINIMUM_VALUE),na.MINIMUM_VALUE.equals(t)&&(t=na.MAXIMUM_VALUE),new ni({start:e,stop:t})},nu.prototype.add=function(e){if(!(0,_.Z)(e))throw new A.Z("entity is required.");e instanceof ns.Z||(e=new ns.Z(e));let t=e.id,i=this._entities;if(i.contains(t))throw new A.Z(`An entity with id ${t} already exists in this collection.`);return e.entityCollection=this,i.set(t,e),this._removedEntities.remove(t)||this._addedEntities.set(t,e),e.definitionChanged.addEventListener(nu.prototype._onEntityDefinitionChanged,this),nc(this),e},nu.prototype.remove=function(e){return!!(0,_.Z)(e)&&this.removeById(e.id)},nu.prototype.contains=function(e){if(!(0,_.Z)(e))throw new A.Z("entity is required");return this._entities.get(e.id)===e},nu.prototype.removeById=function(e){if(!(0,_.Z)(e))return!1;let t=this._entities.get(e);return!!this._entities.remove(e)&&(this._addedEntities.remove(e)||(this._removedEntities.set(e,t),this._changedEntities.remove(e)),this._entities.remove(e),t.definitionChanged.removeEventListener(nu.prototype._onEntityDefinitionChanged,this),nc(this),!0)},nu.prototype.removeAll=function(){let e=this._entities,t=e.length,i=e.values,n=this._addedEntities,r=this._removedEntities;for(let e=0;e<t;e++){let t=i[e],o=t.id,a=n.get(o);(0,_.Z)(a)||(t.definitionChanged.removeEventListener(nu.prototype._onEntityDefinitionChanged,this),r.set(o,t))}e.removeAll(),n.removeAll(),this._changedEntities.removeAll(),nc(this)},nu.prototype.getById=function(e){if(!(0,_.Z)(e))throw new A.Z("id is required.");return this._entities.get(e)},nu.prototype.getOrCreateEntity=function(e){if(!(0,_.Z)(e))throw new A.Z("id is required.");let t=this._entities.get(e);return(0,_.Z)(t)||(nl.id=e,t=new ns.Z(nl),this.add(t)),t},nu.prototype._onEntityDefinitionChanged=function(e){let t=e.id;this._addedEntities.contains(t)||this._changedEntities.set(t,e),nc(this)},Object.defineProperties(nh.prototype,{name:{get:function(){return this._name},set:function(e){this._name!==e&&(this._name=e,this._changed.raiseEvent(this))}},clock:{get:function(){return this._clock},set:function(e){this._clock!==e&&(this._clock=e,this._changed.raiseEvent(this))}},entities:{get:function(){return this._entityCollection}},isLoading:{get:function(){return this._isLoading},set:function(e){ei.setLoading(this,e)}},changedEvent:{get:function(){return this._changed}},errorEvent:{get:function(){return this._error}},loadingEvent:{get:function(){return this._loading}},show:{get:function(){return this._entityCollection.show},set:function(e){this._entityCollection.show=e}},clustering:{get:function(){return this._entityCluster},set:function(e){if(!(0,_.Z)(e))throw new A.Z("value must be defined.");this._entityCluster=e}}}),nh.prototype.update=function(e){return!0};var nd=i(5012),nf=i(4915),np=i(7761),nm=i(3547);function n_(e){e=(0,m.Z)(e,m.Z.EMPTY_OBJECT);let t=(0,m.Z)(e.translucent,!0),i=(0,m.Z)(e.closed,!1),n=(0,m.Z)(e.materialSupport,n_.MaterialSupport.TEXTURED);this.material=(0,_.Z)(e.material)?e.material:nm.Z.fromType(nm.Z.ColorType),this.translucent=t,this._vertexShaderSource=(0,m.Z)(e.vertexShaderSource,n.vertexShaderSource),this._fragmentShaderSource=(0,m.Z)(e.fragmentShaderSource,n.fragmentShaderSource),this._renderState=np.Z.getDefaultRenderState(t,i,e.renderState),this._closed=i,this._materialSupport=n,this._vertexFormat=n.vertexFormat,this._flat=(0,m.Z)(e.flat,!1),this._faceForward=(0,m.Z)(e.faceForward,!i)}Object.defineProperties(n_.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},materialSupport:{get:function(){return this._materialSupport}},vertexFormat:{get:function(){return this._vertexFormat}},flat:{get:function(){return this._flat}},faceForward:{get:function(){return this._faceForward}}}),n_.prototype.getFragmentShaderSource=np.Z.prototype.getFragmentShaderSource,n_.prototype.isTranslucent=np.Z.prototype.isTranslucent,n_.prototype.getRenderState=np.Z.prototype.getRenderState,n_.MaterialSupport={BASIC:Object.freeze({vertexFormat:nf.Z.POSITION_AND_NORMAL,vertexShaderSource:"in vec3 position3DHigh;\nin vec3 position3DLow;\nin vec3 normal;\nin float batchId;\n\nout vec3 v_positionEC;\nout vec3 v_normalEC;\n\nvoid main()\n{\n vec4 p = czm_computePosition();\n\n v_positionEC = (czm_modelViewRelativeToEye * p).xyz; // position in eye coordinates\n v_normalEC = czm_normal * normal; // normal in eye coordinates\n\n gl_Position = czm_modelViewProjectionRelativeToEye * p;\n}\n",fragmentShaderSource:"in vec3 v_positionEC;\nin vec3 v_normalEC;\n\nvoid main()\n{\n vec3 positionToEyeEC = -v_positionEC;\n\n vec3 normalEC = normalize(v_normalEC);\n#ifdef FACE_FORWARD\n normalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC);\n#endif\n\n czm_materialInput materialInput;\n materialInput.normalEC = normalEC;\n materialInput.positionToEyeEC = positionToEyeEC;\n czm_material material = czm_getMaterial(materialInput);\n\n#ifdef FLAT\n out_FragColor = vec4(material.diffuse + material.emission, material.alpha);\n#else\n out_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC);\n#endif\n}\n"}),TEXTURED:Object.freeze({vertexFormat:nf.Z.POSITION_NORMAL_AND_ST,vertexShaderSource:"in vec3 position3DHigh;\nin vec3 position3DLow;\nin vec3 normal;\nin vec2 st;\nin float batchId;\n\nout vec3 v_positionEC;\nout vec3 v_normalEC;\nout vec2 v_st;\n\nvoid main()\n{\n vec4 p = czm_computePosition();\n\n v_positionEC = (czm_modelViewRelativeToEye * p).xyz; // position in eye coordinates\n v_normalEC = czm_normal * normal; // normal in eye coordinates\n v_st = st;\n\n gl_Position = czm_modelViewProjectionRelativeToEye * p;\n}\n",fragmentShaderSource:"in vec3 v_positionEC;\nin vec3 v_normalEC;\nin vec2 v_st;\n\nvoid main()\n{\n vec3 positionToEyeEC = -v_positionEC;\n\n vec3 normalEC = normalize(v_normalEC);\n#ifdef FACE_FORWARD\n normalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC);\n#endif\n\n czm_materialInput materialInput;\n materialInput.normalEC = normalEC;\n materialInput.positionToEyeEC = positionToEyeEC;\n materialInput.st = v_st;\n czm_material material = czm_getMaterial(materialInput);\n\n#ifdef FLAT\n out_FragColor = vec4(material.diffuse + material.emission, material.alpha);\n#else\n out_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC);\n#endif\n}\n"}),ALL:Object.freeze({vertexFormat:nf.Z.ALL,vertexShaderSource:"in vec3 position3DHigh;\nin vec3 position3DLow;\nin vec3 normal;\nin vec3 tangent;\nin vec3 bitangent;\nin vec2 st;\nin float batchId;\n\nout vec3 v_positionEC;\nout vec3 v_normalEC;\nout vec3 v_tangentEC;\nout vec3 v_bitangentEC;\nout vec2 v_st;\n\nvoid main()\n{\n vec4 p = czm_computePosition();\n\n v_positionEC = (czm_modelViewRelativeToEye * p).xyz; // position in eye coordinates\n v_normalEC = czm_normal * normal; // normal in eye coordinates\n v_tangentEC = czm_normal * tangent; // tangent in eye coordinates\n v_bitangentEC = czm_normal * bitangent; // bitangent in eye coordinates\n v_st = st;\n\n gl_Position = czm_modelViewProjectionRelativeToEye * p;\n}\n",fragmentShaderSource:"in vec3 v_positionEC;\nin vec3 v_normalEC;\nin vec3 v_tangentEC;\nin vec3 v_bitangentEC;\nin vec2 v_st;\n\nvoid main()\n{\n vec3 positionToEyeEC = -v_positionEC;\n mat3 tangentToEyeMatrix = czm_tangentToEyeSpaceMatrix(v_normalEC, v_tangentEC, v_bitangentEC);\n\n vec3 normalEC = normalize(v_normalEC);\n#ifdef FACE_FORWARD\n normalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC);\n#endif\n\n czm_materialInput materialInput;\n materialInput.normalEC = normalEC;\n materialInput.tangentToEyeMatrix = tangentToEyeMatrix;\n materialInput.positionToEyeEC = positionToEyeEC;\n materialInput.st = v_st;\n czm_material material = czm_getMaterial(materialInput);\n\n#ifdef FLAT\n out_FragColor = vec4(material.diffuse + material.emission, material.alpha);\n#else\n out_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC);\n#endif\n}\n"})};var ng=i(9250),nZ=i(1082),ny=i(7138);function nb(e,t){this._primitives=e,this._orderedGroundPrimitives=t,this._dynamicUpdaters=new E.Z}nb.prototype.add=function(e,t){this._dynamicUpdaters.set(t.id,t.createDynamicUpdater(this._primitives,this._orderedGroundPrimitives))},nb.prototype.remove=function(e){let t=e.id,i=this._dynamicUpdaters.get(t);(0,_.Z)(i)&&(this._dynamicUpdaters.remove(t),i.destroy())},nb.prototype.update=function(e){let t=this._dynamicUpdaters.values;for(let i=0,n=t.length;i<n;i++)t[i].update(e);return!0},nb.prototype.removeAllPrimitives=function(){let e=this._dynamicUpdaters.values;for(let t=0,i=e.length;t<i;t++)e[t].destroy();this._dynamicUpdaters.removeAll()},nb.prototype.getBoundingSphere=function(e,t){return(e=this._dynamicUpdaters.get(e.id),(0,_.Z)(e)&&(0,_.Z)(e.getBoundingSphere))?e.getBoundingSphere(t):N.FAILED};var nv=i(9439),nT=i(9054),nE=i(4127);function nx(e,t){if(e=(0,m.Z)(e,0),(t=(0,m.Z)(t,Number.MAX_VALUE))<=e)throw new A.Z("far distance must be greater than near distance.");this.value=new Float32Array([e,t])}Object.defineProperties(nx.prototype,{componentDatatype:{get:function(){return eM.Z.FLOAT}},componentsPerAttribute:{get:function(){return 2}},normalize:{get:function(){return!1}}}),nx.fromDistanceDisplayCondition=function(e){if(!(0,_.Z)(e))throw new A.Z("distanceDisplayCondition is required.");if(e.far<=e.near)throw new A.Z("distanceDisplayCondition.far distance must be greater than distanceDisplayCondition.near distance.");return new nx(e.near,e.far)},nx.toValue=function(e,t){if(!(0,_.Z)(e))throw new A.Z("distanceDisplayCondition is required.");return(0,_.Z)(t)?(t[0]=e.near,t[1]=e.far,t):new Float32Array([e.near,e.far])};var nw=i(7984),nS=i(2246),nC=i(2660),nA=i(4186),nI=i(5899);function nO(){A.Z.throwInstantiationError()}function nD(e,t,i){p.Z.defined("geometryUpdater",e),p.Z.defined("primitives",t),p.Z.defined("orderedGroundPrimitives",i),this._primitives=t,this._orderedGroundPrimitives=i,this._primitive=void 0,this._outlinePrimitive=void 0,this._geometryUpdater=e,this._options=e._options,this._entity=e._entity,this._material=void 0}Object.defineProperties(nO.prototype,{isConstant:{get:A.Z.throwInstantiationError},definitionChanged:{get:A.Z.throwInstantiationError}}),nO.prototype.getType=A.Z.throwInstantiationError,nO.prototype.getValue=A.Z.throwInstantiationError,nO.prototype.equals=A.Z.throwInstantiationError,nO.getValue=function(e,t,i){let n;return(0,_.Z)(t)&&(n=t.getType(e),(0,_.Z)(n))?((0,_.Z)(i)&&i.type===n||(i=nm.Z.fromType(n)),t.getValue(e,i.uniforms)):((0,_.Z)(i)&&i.type===nm.Z.ColorType||(i=nm.Z.fromType(nm.Z.ColorType)),C.Z.clone(C.Z.WHITE,i.uniforms.color)),i},nD.prototype._isHidden=function(e,t,i){return!e.isShowing||!e.isAvailable(i)||!L.Z.getValueOrDefault(t.show,i,!0)},nD.prototype._setOptions=A.Z.throwInstantiationError,nD.prototype.update=function(e){p.Z.defined("time",e);let t=this._geometryUpdater,i=t._onTerrain,n=this._primitives,r=this._orderedGroundPrimitives;i?r.remove(this._primitive):(n.removeAndDestroy(this._primitive),n.removeAndDestroy(this._outlinePrimitive),this._outlinePrimitive=void 0),this._primitive=void 0;let o=this._entity,a=o[this._geometryUpdater._geometryPropertyName];if(this._setOptions(o,a,e),this._isHidden(o,a,e))return;let s=this._geometryUpdater.shadowsProperty.getValue(e),l=this._options;if(!(0,_.Z)(a.fill)||a.fill.getValue(e)){let o;let a=t.fillMaterialProperty,c=a instanceof ny.Z,u=t._getIsClosed(l);if(c)o=new ng.Z({closed:u,flat:i&&!t._supportsMaterialsforEntitiesOnTerrain});else{let t=nO.getValue(e,a,this._material);this._material=t,o=new n_({material:t,translucent:t.isTranslucent(),closed:u})}if(i)l.vertexFormat=ng.Z.VERTEX_FORMAT,this._primitive=r.add(new b.Z({geometryInstances:this._geometryUpdater.createFillGeometryInstance(e),appearance:o,asynchronous:!1,shadows:s,classificationType:this._geometryUpdater.classificationTypeProperty.getValue(e)}),L.Z.getValueOrUndefined(this._geometryUpdater.zIndex,e));else{l.vertexFormat=o.vertexFormat;let t=this._geometryUpdater.createFillGeometryInstance(e);c&&(o.translucent=255!==t.attributes.color.value[3]),this._primitive=n.add(new nI.Z({geometryInstances:t,appearance:o,asynchronous:!1,shadows:s}))}}if(!i&&(0,_.Z)(a.outline)&&a.outline.getValue(e)){let i=this._geometryUpdater.createOutlineGeometryInstance(e),r=L.Z.getValueOrDefault(a.outlineWidth,e,1);this._outlinePrimitive=n.add(new nI.Z({geometryInstances:i,appearance:new ng.Z({flat:!0,translucent:255!==i.attributes.color.value[3],renderState:{lineWidth:t._scene.clampLineWidth(r)}}),asynchronous:!1,shadows:s}))}},nD.prototype.getBoundingSphere=function(e){let t;if(!(0,_.Z)(e))throw new A.Z("result is required.");let i=this._entity,n=this._primitive,r=this._outlinePrimitive;return(0,_.Z)(n)&&n.show&&n.ready&&(t=n.getGeometryInstanceAttributes(i),(0,_.Z)(t)&&(0,_.Z)(t.boundingSphere))||(0,_.Z)(r)&&r.show&&r.ready&&(t=r.getGeometryInstanceAttributes(i),(0,_.Z)(t)&&(0,_.Z)(t.boundingSphere))?(f.Z.clone(t.boundingSphere,e),N.DONE):(0,_.Z)(n)&&!n.ready||(0,_.Z)(r)&&!r.ready?N.PENDING:N.FAILED},nD.prototype.isDestroyed=function(){return!1},nD.prototype.destroy=function(){let e=this._primitives,t=this._orderedGroundPrimitives;this._geometryUpdater._onTerrain?t.remove(this._primitive):e.removeAndDestroy(this._primitive),e.removeAndDestroy(this._outlinePrimitive),(0,g.Z)(this)};var nP=i(5776),nR=i(109);let nN=new ny.Z(C.Z.WHITE),nL=new nR.Z(!0),nM=new nR.Z(!0),nF=new nR.Z(!1),nz=new nR.Z(C.Z.BLACK),nB=new nR.Z(nZ.Z.DISABLED),nU=new nR.Z(new I.Z),nk=new nR.Z(nd.Z.BOTH);function nV(e){p.Z.defined("options.entity",e.entity),p.Z.defined("options.scene",e.scene),p.Z.defined("options.geometryOptions",e.geometryOptions),p.Z.defined("options.geometryPropertyName",e.geometryPropertyName),p.Z.defined("options.observedPropertyNames",e.observedPropertyNames);let t=e.entity,i=e.geometryPropertyName;this._entity=t,this._scene=e.scene,this._fillEnabled=!1,this._isClosed=!1,this._onTerrain=!1,this._dynamic=!1,this._outlineEnabled=!1,this._geometryChanged=new et.Z,this._showProperty=void 0,this._materialProperty=void 0,this._showOutlineProperty=void 0,this._outlineColorProperty=void 0,this._outlineWidth=1,this._shadowsProperty=void 0,this._distanceDisplayConditionProperty=void 0,this._classificationTypeProperty=void 0,this._options=e.geometryOptions,this._geometryPropertyName=i,this._id=`${i}-${t.id}`,this._observedPropertyNames=e.observedPropertyNames,this._supportsMaterialsforEntitiesOnTerrain=ns.Z.supportsMaterialsforEntitiesOnTerrain(e.scene)}function nH(e,t){this._callback=void 0,this._isConstant=void 0,this._definitionChanged=new et.Z,this.setCallback(e,t)}Object.defineProperties(nV.prototype,{id:{get:function(){return this._id}},entity:{get:function(){return this._entity}},fillEnabled:{get:function(){return this._fillEnabled}},hasConstantFill:{get:function(){return!this._fillEnabled||!(0,_.Z)(this._entity.availability)&&L.Z.isConstant(this._showProperty)&&L.Z.isConstant(this._fillProperty)}},fillMaterialProperty:{get:function(){return this._materialProperty}},outlineEnabled:{get:function(){return this._outlineEnabled}},hasConstantOutline:{get:function(){return!this._outlineEnabled||!(0,_.Z)(this._entity.availability)&&L.Z.isConstant(this._showProperty)&&L.Z.isConstant(this._showOutlineProperty)}},outlineColorProperty:{get:function(){return this._outlineColorProperty}},outlineWidth:{get:function(){return this._outlineWidth}},shadowsProperty:{get:function(){return this._shadowsProperty}},distanceDisplayConditionProperty:{get:function(){return this._distanceDisplayConditionProperty}},classificationTypeProperty:{get:function(){return this._classificationTypeProperty}},isDynamic:{get:function(){return this._dynamic}},isClosed:{get:function(){return this._isClosed}},onTerrain:{get:function(){return this._onTerrain}},geometryChanged:{get:function(){return this._geometryChanged}}}),nV.prototype.isOutlineVisible=function(e){let t=this._entity,i=this._outlineEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e);return(0,m.Z)(i,!1)},nV.prototype.isFilled=function(e){let t=this._entity,i=this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e);return(0,m.Z)(i,!1)},nV.prototype.createFillGeometryInstance=A.Z.throwInstantiationError,nV.prototype.createOutlineGeometryInstance=A.Z.throwInstantiationError,nV.prototype.isDestroyed=function(){return!1},nV.prototype.destroy=function(){(0,g.Z)(this)},nV.prototype._isHidden=function(e,t){let i=t.show;return(0,_.Z)(i)&&i.isConstant&&!i.getValue(na.MINIMUM_VALUE)},nV.prototype._isOnTerrain=function(e,t){return!1},nV.prototype._getIsClosed=function(e){return!0},nV.prototype._isDynamic=A.Z.throwInstantiationError,nV.prototype._setStaticOptions=A.Z.throwInstantiationError,nV.prototype._onEntityPropertyChanged=function(e,t,i,n){if(-1===this._observedPropertyNames.indexOf(t))return;let r=this._entity[this._geometryPropertyName];if(!(0,_.Z)(r)){(this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this));return}let o=r.fill,a=!(0,_.Z)(o)||!o.isConstant||o.getValue(na.MINIMUM_VALUE),s=r.outline,l=(0,_.Z)(s);if(l&&s.isConstant&&(l=s.getValue(na.MINIMUM_VALUE)),!a&&!l){(this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this));return}let c=r.show;if(this._isHidden(e,r)){(this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this));return}this._materialProperty=(0,m.Z)(r.material,nN),this._fillProperty=(0,m.Z)(o,nM),this._showProperty=(0,m.Z)(c,nL),this._showOutlineProperty=(0,m.Z)(r.outline,nF),this._outlineColorProperty=l?(0,m.Z)(r.outlineColor,nz):void 0,this._shadowsProperty=(0,m.Z)(r.shadows,nB),this._distanceDisplayConditionProperty=(0,m.Z)(r.distanceDisplayCondition,nU),this._classificationTypeProperty=(0,m.Z)(r.classificationType,nk),this._fillEnabled=a;let u=this._isOnTerrain(e,r)&&(this._supportsMaterialsforEntitiesOnTerrain||this._materialProperty instanceof ny.Z);if(l&&u&&((0,nP.Z)(nP.Z.geometryOutlines),l=!1),this._onTerrain=u,this._outlineEnabled=l,this._isDynamic(e,r))this._dynamic||(this._dynamic=!0,this._geometryChanged.raiseEvent(this));else{this._setStaticOptions(e,r),this._isClosed=this._getIsClosed(this._options);let t=r.outlineWidth;this._outlineWidth=(0,_.Z)(t)?t.getValue(na.MINIMUM_VALUE):1,this._dynamic=!1,this._geometryChanged.raiseEvent(this)}},nV.prototype.createDynamicUpdater=function(e,t){if(p.Z.defined("primitives",e),p.Z.defined("groundPrimitives",t),!this._dynamic)throw new A.Z("This instance does not represent dynamic geometry.");return new this.constructor.DynamicGeometryUpdater(this,e,t)},Object.defineProperties(nH.prototype,{isConstant:{get:function(){return this._isConstant}},definitionChanged:{get:function(){return this._definitionChanged}}}),nH.prototype.getValue=function(e,t){return this._callback(e,t)},nH.prototype.setCallback=function(e,t){if(!(0,_.Z)(e))throw new A.Z("callback is required.");if(!(0,_.Z)(t))throw new A.Z("isConstant is required.");let i=this._callback!==e||this._isConstant!==t;this._callback=e,this._isConstant=t,i&&this._definitionChanged.raiseEvent(this)},nH.prototype.equals=function(e){return this===e||e instanceof nH&&this._callback===e._callback&&this._isConstant===e._isConstant};let nG=new S.Z;function nj(e,t,i,n){p.Z.defined("scene",e),p.Z.defined("positionProperty",t),this._scene=e,this._heightReference=i,this._extrudedHeightReference=n,this._positionProperty=t,this._position=new S.Z,this._cartographicPosition=new ea.Z,this._normal=new S.Z,this._definitionChanged=new et.Z,this._terrainHeight=0,this._removeCallbackFunc=void 0,this._removeEventListener=void 0,this._removeModeListener=void 0;let r=this;if((0,_.Z)(e.globe)&&(this._removeEventListener=e.terrainProviderChanged.addEventListener(function(){r._updateClamping()}),this._removeModeListener=e.morphComplete.addEventListener(function(){r._updateClamping()})),t.isConstant){let i=t.getValue(na.MINIMUM_VALUE,nG);if(!(0,_.Z)(i)||S.Z.equals(i,S.Z.ZERO)||!(0,_.Z)(e.globe))return;this._position=S.Z.clone(i,this._position),this._updateClamping(),this._normal=e.globe.ellipsoid.geodeticSurfaceNormal(i,this._normal)}}Object.defineProperties(nj.prototype,{isConstant:{get:function(){return!1}},definitionChanged:{get:function(){return this._definitionChanged}}}),nj.prototype._updateClamping=function(){(0,_.Z)(this._removeCallbackFunc)&&this._removeCallbackFunc();let e=this._scene,t=e.globe,i=this._position;if(S.Z.equals(i,S.Z.ZERO)){this._terrainHeight=0;return}let n=t.ellipsoid.cartesianToCartographic(i,this._cartographicPosition),r=e.getHeight(n,this._heightReference);(0,_.Z)(r)?this._terrainHeight=r:this._terrainHeight=0,this._removeCallbackFunc=e.updateHeight(n,e=>{this._terrainHeight=e.height,this.definitionChanged.raiseEvent()},this._heightReference)},nj.prototype.getValue=function(e,t){let i=L.Z.getValueOrDefault(this._heightReference,e,D.ZP.NONE),n=L.Z.getValueOrDefault(this._extrudedHeightReference,e,D.ZP.NONE);if(i===D.ZP.NONE&&!(0,D.lJ)(n))return this._position=S.Z.clone(S.Z.ZERO,this._position),S.Z.clone(S.Z.ZERO,t);if(this._positionProperty.isConstant)return S.Z.multiplyByScalar(this._normal,this._terrainHeight,t);let r=this._scene,o=this._positionProperty.getValue(e,nG);if(!(0,_.Z)(o)||S.Z.equals(o,S.Z.ZERO)||!(0,_.Z)(r.globe))return S.Z.clone(S.Z.ZERO,t);if(S.Z.equalsEpsilon(this._position,o,eB.Z.EPSILON10))return S.Z.multiplyByScalar(this._normal,this._terrainHeight,t);this._position=S.Z.clone(o,this._position),this._updateClamping();let a=r.globe.ellipsoid.geodeticSurfaceNormal(o,this._normal);return S.Z.multiplyByScalar(a,this._terrainHeight,t)},nj.prototype.isDestroyed=function(){return!1},nj.prototype.destroy=function(){return(0,_.Z)(this._removeEventListener)&&this._removeEventListener(),(0,_.Z)(this._removeModeListener)&&this._removeModeListener(),(0,_.Z)(this._removeCallbackFunc)&&this._removeCallbackFunc(),(0,g.Z)(this)};var nW=function(e,t,i,n){if(nV.prototype._onEntityPropertyChanged.call(this,e,t,i,n),-1===this._observedPropertyNames.indexOf(t))return;let r=this._entity[this._geometryPropertyName];if(!(0,_.Z)(r))return;(0,_.Z)(this._terrainOffsetProperty)&&(this._terrainOffsetProperty.destroy(),this._terrainOffsetProperty=void 0);let o=r.heightReference;if((0,_.Z)(o)){let e=new nH(this._computeCenter.bind(this),!this._dynamic);this._terrainOffsetProperty=new nj(this._scene,e,o)}};let nq=S.Z.ZERO,nY=new S.Z,nX=new S.Z,n$=new C.Z;function nK(e){this.id=e,this.vertexFormat=void 0,this.dimensions=void 0,this.offsetAttribute=void 0}function nQ(e,t){nV.call(this,{entity:e,scene:t,geometryOptions:new nK(e),geometryPropertyName:"box",observedPropertyNames:["availability","position","orientation","box"]}),this._onEntityPropertyChanged(e,"box",e.box,void 0)}function nJ(e,t,i){nD.call(this,e,t,i)}(0,_.Z)(Object.create)&&(nQ.prototype=Object.create(nV.prototype),nQ.prototype.constructor=nQ),Object.defineProperties(nQ.prototype,{terrainOffsetProperty:{get:function(){return this._terrainOffsetProperty}}}),nQ.prototype.createFillGeometryInstance=function(e){if(p.Z.defined("time",e),!this._fillEnabled)throw new A.Z("This instance does not represent a filled geometry.");let t=this._entity,i=t.isAvailable(e),n=new nA.Z(i&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),r=this._distanceDisplayConditionProperty.getValue(e),o={show:n,distanceDisplayCondition:nx.fromDistanceDisplayCondition(r),color:void 0,offset:void 0};if(this._materialProperty instanceof ny.Z){let t;(0,_.Z)(this._materialProperty.color)&&(this._materialProperty.color.isConstant||i)&&(t=this._materialProperty.color.getValue(e,n$)),(0,_.Z)(t)||(t=C.Z.WHITE),o.color=nE.Z.fromColor(t)}return(0,_.Z)(this._options.offsetAttribute)&&(o.offset=nC.Z.fromCartesian3(L.Z.getValueOrDefault(this._terrainOffsetProperty,e,nq,nY))),new nw.Z({id:t,geometry:nv.Z.fromDimensions(this._options),modelMatrix:t.computeModelMatrixForHeightReference(e,t.box.heightReference,.5*this._options.dimensions.z,this._scene.mapProjection.ellipsoid),attributes:o})},nQ.prototype.createOutlineGeometryInstance=function(e){if(p.Z.defined("time",e),!this._outlineEnabled)throw new A.Z("This instance does not represent an outlined geometry.");let t=this._entity,i=t.isAvailable(e),n=L.Z.getValueOrDefault(this._outlineColorProperty,e,C.Z.BLACK,n$),r=this._distanceDisplayConditionProperty.getValue(e),o={show:new nA.Z(i&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:nE.Z.fromColor(n),distanceDisplayCondition:nx.fromDistanceDisplayCondition(r),offset:void 0};return(0,_.Z)(this._options.offsetAttribute)&&(o.offset=nC.Z.fromCartesian3(L.Z.getValueOrDefault(this._terrainOffsetProperty,e,nq,nY))),new nw.Z({id:t,geometry:nT.Z.fromDimensions(this._options),modelMatrix:t.computeModelMatrixForHeightReference(e,t.box.heightReference,.5*this._options.dimensions.z,this._scene.mapProjection.ellipsoid),attributes:o})},nQ.prototype._computeCenter=function(e,t){return L.Z.getValueOrUndefined(this._entity.position,e,t)},nQ.prototype._isHidden=function(e,t){return!(0,_.Z)(t.dimensions)||!(0,_.Z)(e.position)||nV.prototype._isHidden.call(this,e,t)},nQ.prototype._isDynamic=function(e,t){return!e.position.isConstant||!L.Z.isConstant(e.orientation)||!t.dimensions.isConstant||!L.Z.isConstant(t.outlineWidth)},nQ.prototype._setStaticOptions=function(e,t){let i=L.Z.getValueOrDefault(t.heightReference,na.MINIMUM_VALUE,D.ZP.NONE),n=this._options;n.vertexFormat=this._materialProperty instanceof ny.Z?ng.Z.VERTEX_FORMAT:n_.MaterialSupport.TEXTURED.vertexFormat,n.dimensions=t.dimensions.getValue(na.MINIMUM_VALUE,n.dimensions),n.offsetAttribute=i!==D.ZP.NONE?nS.Z.ALL:void 0},nQ.prototype._onEntityPropertyChanged=nW,nQ.DynamicGeometryUpdater=nJ,(0,_.Z)(Object.create)&&(nJ.prototype=Object.create(nD.prototype),nJ.prototype.constructor=nJ),nJ.prototype._isHidden=function(e,t,i){let n=L.Z.getValueOrUndefined(e.position,i,nX),r=this._options.dimensions;return!(0,_.Z)(n)||!(0,_.Z)(r)||nD.prototype._isHidden.call(this,e,t,i)},nJ.prototype._setOptions=function(e,t,i){let n=L.Z.getValueOrDefault(t.heightReference,i,D.ZP.NONE),r=this._options;r.dimensions=L.Z.getValueOrUndefined(t.dimensions,i,r.dimensions),r.offsetAttribute=n!==D.ZP.NONE?nS.Z.ALL:void 0};var n0=i(3453),n1=Object.freeze({ROUNDED:0,MITERED:1,BEVELED:2}),n2=i(3186),n3=i(6896),n4=i(7809),n5=i(3578),n9=i(7119);let n8=[new S.Z,new S.Z],n6=new S.Z,n7=new S.Z,re=new S.Z,rt=new S.Z,ri=new S.Z,rn=new S.Z,rr=new S.Z,ro=new S.Z,ra=new S.Z,rs=new S.Z,rl=new S.Z,rc={},ru=new ea.Z;function rh(e,t,i,n){let r;let o=e[0],a=e[1],s=Math.ceil(S.Z.angleBetween(o,a)/n),l=Array(s);if(t===i){for(r=0;r<s;r++)l[r]=t;return l.push(i),l}let c=(i-t)/s;for(r=1;r<s;r++){let e=t+r*c;l[r]=e}return l[0]=t,l.push(i),l}let rd=new S.Z,rf=new S.Z,rp=new S.Z(-1,0,0),rm=new er.Z,r_=new er.Z,rg=new n2.Z,rZ=n2.Z.IDENTITY.clone(),ry=new S.Z,rb=new eo.Z,rv=new S.Z;function rT(e,t,i,n,r,o,a,s){let l=ry,c=rb;rm=n9.Z.eastNorthUpToFixedFrame(e,r,rm),l=er.Z.multiplyByPointAsVector(rm,rp,l);let u=function(e,t,i,n){let r=new n4.Z(i,n),o=r.projectPointOntoPlane(S.Z.add(i,e,rd),rd),a=r.projectPointOntoPlane(S.Z.add(i,t,rf),rf),s=w.Z.angleBetween(o,a);return a.x*o.y-a.y*o.x>=0?-s:s}(l=S.Z.normalize(l,l),t,e,r);rg=n2.Z.fromRotationZ(u,rg),rv.z=o,rm=er.Z.multiplyTransformation(rm,er.Z.fromRotationTranslation(rg,rv,r_),rm),rZ[0]=a;for(let e=0;e<s;e++)for(let e=0;e<i.length;e+=3)c=S.Z.fromArray(i,e,c),c=n2.Z.multiplyByVector(rZ,c,c),c=er.Z.multiplyByPoint(rm,c,c),n.push(c.x,c.y,c.z);return n}let rE=new S.Z;function rx(e,t,i,n,r,o,a){for(let s=0;s<e.length;s+=3)n=rT(S.Z.fromArray(e,s,rE),t,i,n,r,o[s/3],a,1);return n}function rw(e,t){let i=e.length,n=Array(3*i),r=0,o=t.x+t.width/2,a=t.y+t.height/2;for(let t=0;t<i;t++)n[r++]=e[t].x-o,n[r++]=0,n[r++]=e[t].y-a;return n}let rS=new n5.Z,rC=new S.Z,rA=new n2.Z;function rI(e,t,i,n,r,o,a,s,l,c){let u,h;let d=S.Z.angleBetween(S.Z.subtract(t,e,rs),S.Z.subtract(i,e,rl)),f=n===n1.BEVELED?0:Math.ceil(d/eB.Z.toRadians(5));if(u=r?n2.Z.fromQuaternion(n5.Z.fromAxisAngle(S.Z.negate(e,rs),d/(f+1),rS),rA):n2.Z.fromQuaternion(n5.Z.fromAxisAngle(e,d/(f+1),rS),rA),t=S.Z.clone(t,rC),f>0){let i=c?2:1;for(let n=0;n<f;n++)t=n2.Z.multiplyByVector(u,t,t),h=S.Z.subtract(t,e,rs),h=S.Z.normalize(h,h),r||(h=S.Z.negate(h,h)),a=rT(o.scaleToGeodeticSurface(t,rl),h,s,a,o,l,1,i)}else h=S.Z.subtract(t,e,rs),h=S.Z.normalize(h,h),r||(h=S.Z.negate(h,h)),a=rT(o.scaleToGeodeticSurface(t,rl),h,s,a,o,l,1,1),i=S.Z.clone(i,rC),h=S.Z.subtract(i,e,rs),h=S.Z.normalize(h,h),r||(h=S.Z.negate(h,h)),a=rT(o.scaleToGeodeticSurface(i,rl),h,s,a,o,l,1,1);return a}rc.removeDuplicatesFromShape=function(e){let t=e.length,i=[];for(let n=t-1,r=0;r<t;n=r++){let t=e[n],o=e[r];w.Z.equals(t,o)||i.push(o)}return i},rc.angleIsGreaterThanPi=function(e,t,i,n){let r=new n4.Z(i,n),o=r.projectPointOntoPlane(S.Z.add(i,e,rd),rd),a=r.projectPointOntoPlane(S.Z.add(i,t,rf),rf);return a.x*o.y-a.y*o.x>=0};let rO=new S.Z,rD=new S.Z;rc.computePositions=function(e,t,i,n,r){let o;let a=n._ellipsoid,s=function(e,t){let i=Array(e.length);for(let n=0;n<e.length;n++){let r=e[n];ru=t.cartesianToCartographic(r,ru),i[n]=ru.height,e[n]=t.scaleToGeodeticSurface(r,r)}return i}(e,a),l=n._granularity,c=n._cornerType,u=r?function(e,t){let i=e.length,n=Array(6*i),r=0,o=t.x+t.width/2,a=t.y+t.height/2,s=e[0];n[r++]=s.x-o,n[r++]=0,n[r++]=s.y-a;for(let t=1;t<i;t++){let i=(s=e[t]).x-o,l=s.y-a;n[r++]=i,n[r++]=0,n[r++]=l,n[r++]=i,n[r++]=0,n[r++]=l}return s=e[0],n[r++]=s.x-o,n[r++]=0,n[r++]=s.y-a,n}(t,i):rw(t,i),h=r?rw(t,i):void 0,d=i.height/2,f=i.width/2,p=e.length,m=[],_=r?[]:void 0,g=n6,Z=n7,y=re,b=rt,v=ri,T=rn,E=rr,x=ro,w=ra,C=e[0],A=e[1];b=a.geodeticSurfaceNormal(C,b),g=S.Z.subtract(A,C,g),g=S.Z.normalize(g,g),x=S.Z.cross(b,g,x),x=S.Z.normalize(x,x);let I=s[0],O=s[1];r&&(_=rT(C,x,h,_,a,I+d,1,1)),w=S.Z.clone(C,w),C=A,Z=S.Z.negate(g,Z);for(let t=1;t<p-1;t++){let i=r?2:1;if(A=e[t+1],C.equals(A)){(0,nP.Z)("Positions are too close and are considered equivalent with rounding error.");continue}g=S.Z.subtract(A,C,g),g=S.Z.normalize(g,g),y=S.Z.add(g,Z,y),y=S.Z.normalize(y,y),b=a.geodeticSurfaceNormal(C,b);let n=S.Z.multiplyByScalar(b,S.Z.dot(g,b),rO);S.Z.subtract(g,n,n),S.Z.normalize(n,n);let h=S.Z.multiplyByScalar(b,S.Z.dot(Z,b),rD);if(S.Z.subtract(Z,h,h),S.Z.normalize(h,h),eB.Z.equalsEpsilon(Math.abs(S.Z.dot(n,h)),1,eB.Z.EPSILON7))m=rT(w,x,u,m,a,I+d,1,1),w=C;else{y=S.Z.cross(y,b,y),y=S.Z.cross(b,y,y),y=S.Z.normalize(y,y);let e=1/Math.max(.25,S.Z.magnitude(S.Z.cross(y,Z,rs))),t=rc.angleIsGreaterThanPi(g,Z,C,a);t?(v=S.Z.add(C,S.Z.multiplyByScalar(y,e*f,y),v),T=S.Z.add(v,S.Z.multiplyByScalar(x,f,T),T),n8[0]=S.Z.clone(w,n8[0]),n8[1]=S.Z.clone(T,n8[1]),o=rh(n8,I+d,O+d,l),m=rx(n3.Z.generateArc({positions:n8,granularity:l,ellipsoid:a}),x,u,m,a,o,1),x=S.Z.cross(b,g,x),x=S.Z.normalize(x,x),E=S.Z.add(v,S.Z.multiplyByScalar(x,f,E),E),c===n1.ROUNDED||c===n1.BEVELED?rI(v,T,E,c,t,a,m,u,O+d,r):m=rT(C,y=S.Z.negate(y,y),u,m,a,O+d,e,i)):(v=S.Z.add(C,S.Z.multiplyByScalar(y,e*f,y),v),T=S.Z.add(v,S.Z.multiplyByScalar(x,-f,T),T),n8[0]=S.Z.clone(w,n8[0]),n8[1]=S.Z.clone(T,n8[1]),o=rh(n8,I+d,O+d,l),m=rx(n3.Z.generateArc({positions:n8,granularity:l,ellipsoid:a}),x,u,m,a,o,1),x=S.Z.cross(b,g,x),x=S.Z.normalize(x,x),E=S.Z.add(v,S.Z.multiplyByScalar(x,-f,E),E),c===n1.ROUNDED||c===n1.BEVELED?rI(v,T,E,c,t,a,m,u,O+d,r):m=rT(C,y,u,m,a,O+d,e,i)),w=S.Z.clone(E,w),Z=S.Z.negate(g,Z)}I=O,O=s[t+1],C=A}n8[0]=S.Z.clone(w,n8[0]),n8[1]=S.Z.clone(C,n8[1]),o=rh(n8,I+d,O+d,l),m=rx(n3.Z.generateArc({positions:n8,granularity:l,ellipsoid:a}),x,u,m,a,o,1),r&&(_=rT(C,x,h,_,a,O+d,1,1)),p=m.length;let D=new Float64Array(r?p+_.length:p);return D.set(m),r&&D.set(_,p),D};let rP={},rR=new S.Z,rN=new S.Z,rL=new S.Z,rM=new S.Z,rF=[new S.Z,new S.Z],rz=new S.Z,rB=new S.Z,rU=new S.Z,rk=new S.Z,rV=new S.Z,rH=new S.Z,rG=new S.Z,rj=new S.Z,rW=new S.Z,rq=new S.Z,rY=new n5.Z,rX=new n2.Z;function r$(e,t,i,n,r){let o;let a=S.Z.angleBetween(S.Z.subtract(t,e,rR),S.Z.subtract(i,e,rN)),s=n===n1.BEVELED?1:Math.ceil(a/eB.Z.toRadians(5))+1,l=3*s,c=Array(l);c[l-3]=i.x,c[l-2]=i.y,c[l-1]=i.z,o=r?n2.Z.fromQuaternion(n5.Z.fromAxisAngle(S.Z.negate(e,rR),a/s,rY),rX):n2.Z.fromQuaternion(n5.Z.fromAxisAngle(e,a/s,rY),rX);let u=0;t=S.Z.clone(t,rR);for(let e=0;e<s;e++)t=n2.Z.multiplyByVector(o,t,t),c[u++]=t.x,c[u++]=t.y,c[u++]=t.z;return c}function rK(e,t,i,n){let r=rR;return n||(t=S.Z.negate(t,t)),[(r=S.Z.add(e,t,r)).x,r.y,r.z,i.x,i.y,i.z]}function rQ(e,t,i,n){let r=Array(e.length),o=Array(e.length),a=S.Z.multiplyByScalar(t,i,rR),s=S.Z.negate(a,rN),l=0,c=e.length-1;for(let t=0;t<e.length;t+=3){let i=S.Z.fromArray(e,t,rL),n=S.Z.add(i,s,rM);r[l++]=n.x,r[l++]=n.y,r[l++]=n.z;let u=S.Z.add(i,a,rM);o[c--]=u.z,o[c--]=u.y,o[c--]=u.x}return n.push(r,o),n}rP.addAttribute=function(e,t,i,n){let r=t.x,o=t.y,a=t.z;(0,_.Z)(i)&&(e[i]=r,e[i+1]=o,e[i+2]=a),(0,_.Z)(n)&&(e[n]=a,e[n-1]=o,e[n-2]=r)};let rJ=new S.Z,r0=new S.Z;rP.computePositions=function(e){let t,i;let n=e.granularity,r=e.positions,o=e.ellipsoid,a=e.width/2,s=e.cornerType,l=e.saveAttributes,c=rz,u=rB,h=rU,d=rk,f=rV,p=rH,m=rG,_=rj,g=rW,Z=rq,y=[],b=l?[]:void 0,v=l?[]:void 0,T=r[0],E=r[1];u=S.Z.normalize(S.Z.subtract(E,T,u),u),c=o.geodeticSurfaceNormal(T,c),d=S.Z.normalize(S.Z.cross(c,u,d),d),l&&(b.push(d.x,d.y,d.z),v.push(c.x,c.y,c.z)),m=S.Z.clone(T,m),T=E,h=S.Z.negate(u,h);let x=[],w=r.length;for(t=1;t<w-1;t++){c=o.geodeticSurfaceNormal(T,c),E=r[t+1],u=S.Z.normalize(S.Z.subtract(E,T,u),u),f=S.Z.normalize(S.Z.add(u,h,f),f);let e=S.Z.multiplyByScalar(c,S.Z.dot(u,c),rJ);S.Z.subtract(u,e,e),S.Z.normalize(e,e);let i=S.Z.multiplyByScalar(c,S.Z.dot(h,c),r0);if(S.Z.subtract(h,i,i),S.Z.normalize(i,i),!eB.Z.equalsEpsilon(Math.abs(S.Z.dot(e,i)),1,eB.Z.EPSILON7)){f=S.Z.cross(f,c,f),f=S.Z.cross(c,f,f),f=S.Z.normalize(f,f);let e=a/Math.max(.25,S.Z.magnitude(S.Z.cross(f,h,rR))),t=rc.angleIsGreaterThanPi(u,h,T,o);f=S.Z.multiplyByScalar(f,e,f),t?(_=S.Z.add(T,f,_),Z=S.Z.add(_,S.Z.multiplyByScalar(d,a,Z),Z),g=S.Z.add(_,S.Z.multiplyByScalar(d,2*a,g),g),rF[0]=S.Z.clone(m,rF[0]),rF[1]=S.Z.clone(Z,rF[1]),y=rQ(n3.Z.generateArc({positions:rF,granularity:n,ellipsoid:o}),d,a,y),l&&(b.push(d.x,d.y,d.z),v.push(c.x,c.y,c.z)),p=S.Z.clone(g,p),d=S.Z.normalize(S.Z.cross(c,u,d),d),g=S.Z.add(_,S.Z.multiplyByScalar(d,2*a,g),g),m=S.Z.add(_,S.Z.multiplyByScalar(d,a,m),m),s===n1.ROUNDED||s===n1.BEVELED?x.push({leftPositions:r$(_,p,g,s,t)}):x.push({leftPositions:rK(T,S.Z.negate(f,f),g,t)})):(g=S.Z.add(T,f,g),Z=S.Z.add(g,S.Z.negate(S.Z.multiplyByScalar(d,a,Z),Z),Z),_=S.Z.add(g,S.Z.negate(S.Z.multiplyByScalar(d,2*a,_),_),_),rF[0]=S.Z.clone(m,rF[0]),rF[1]=S.Z.clone(Z,rF[1]),y=rQ(n3.Z.generateArc({positions:rF,granularity:n,ellipsoid:o}),d,a,y),l&&(b.push(d.x,d.y,d.z),v.push(c.x,c.y,c.z)),p=S.Z.clone(_,p),d=S.Z.normalize(S.Z.cross(c,u,d),d),_=S.Z.add(g,S.Z.negate(S.Z.multiplyByScalar(d,2*a,_),_),_),m=S.Z.add(g,S.Z.negate(S.Z.multiplyByScalar(d,a,m),m),m),s===n1.ROUNDED||s===n1.BEVELED?x.push({rightPositions:r$(g,p,_,s,t)}):x.push({rightPositions:rK(T,f,_,t)})),h=S.Z.negate(u,h)}T=E}return c=o.geodeticSurfaceNormal(T,c),rF[0]=S.Z.clone(m,rF[0]),rF[1]=S.Z.clone(T,rF[1]),y=rQ(n3.Z.generateArc({positions:rF,granularity:n,ellipsoid:o}),d,a,y),l&&(b.push(d.x,d.y,d.z),v.push(c.x,c.y,c.z)),s===n1.ROUNDED&&(i=function(e){let t=rz,i=rB,n=rU,r=e[1];i=S.Z.fromArray(e[1],r.length-3,i),n=S.Z.fromArray(e[0],0,n);let o=r$(t=S.Z.midpoint(i,n,t),i,n,n1.ROUNDED,!1),a=e.length-1,s=e[a-1];return r=e[a],i=S.Z.fromArray(s,s.length-3,i),n=S.Z.fromArray(r,0,n),[o,r$(t=S.Z.midpoint(i,n,t),i,n,n1.ROUNDED,!1)]}(y)),{positions:y,corners:x,lefts:b,normals:v,endPositions:i}};var r1=i(3086),r2=i(2601),r3=i(258),r4=i(9330),r5=i(8054);let r9=new S.Z,r8=new S.Z,r6=new S.Z,r7=new S.Z,oe=new S.Z,ot=new S.Z,oi=new S.Z,on=new S.Z;function or(e,t){for(let i=0;i<e.length;i++)e[i]=t.scaleToGeodeticSurface(e[i],e[i]);return e}function oo(e,t,i,n,r,o){let a=e.normals,s=e.tangents,l=e.bitangents,c=S.Z.normalize(S.Z.cross(i,t,oi),oi);o.normal&&rP.addAttribute(a,t,n,r),o.tangent&&rP.addAttribute(s,c,n,r),o.bitangent&&rP.addAttribute(l,i,n,r)}function oa(e,t,i){let n,r,o,a,s,l,c,u,h,d,f,p;let m=e.positions,g=e.corners,Z=e.endPositions,y=e.lefts,b=e.normals,v=new r3.Z,T=0,E=0,x=0;for(r=0;r<m.length;r+=2)T+=o=m[r].length-3,x+=2*o,E+=m[r+1].length-3;for(T+=3,E+=3,r=0;r<g.length;r++){n=g[r];let e=g[r].leftPositions;(0,_.Z)(e)?T+=o=e.length:E+=o=g[r].rightPositions.length,x+=o}let w=(0,_.Z)(Z);w&&(T+=a=Z[0].length-3,E+=a,a/=3,x+=6*a);let C=T+E,A=new Float64Array(C),I={normals:t.normal?new Float32Array(C):void 0,tangents:t.tangent?new Float32Array(C):void 0,bitangents:t.bitangent?new Float32Array(C):void 0},O=0,D=C-1,P=r9,R=r8,N=a/2,L=ez.Z.createTypedArray(C/3,x),M=0;if(w){d=r6,h=r7;let e=Z[0];for(r=0,P=S.Z.fromArray(b,0,P),R=S.Z.fromArray(y,0,R);r<N;r++)d=S.Z.fromArray(e,(N-1-r)*3,d),h=S.Z.fromArray(e,(N+r)*3,h),rP.addAttribute(A,h,O),rP.addAttribute(A,d,void 0,D),oo(I,P,R,O,D,t),u=(l=O/3)+1,c=(s=(D-2)/3)-1,L[M++]=s,L[M++]=l,L[M++]=c,L[M++]=c,L[M++]=l,L[M++]=u,O+=3,D-=3}let F=0,z=0,B=m[F++],U=m[F++];for(A.set(B,O),A.set(U,D-U.length+1),R=S.Z.fromArray(y,z,R),o=U.length-3,r=0;r<o;r+=3)f=i.geodeticSurfaceNormal(S.Z.fromArray(B,r,oi),oi),p=i.geodeticSurfaceNormal(S.Z.fromArray(U,o-r,on),on),oo(I,P=S.Z.normalize(S.Z.add(f,p,P),P),R,O,D,t),u=(l=O/3)+1,c=(s=(D-2)/3)-1,L[M++]=s,L[M++]=l,L[M++]=c,L[M++]=c,L[M++]=l,L[M++]=u,O+=3,D-=3;for(f=i.geodeticSurfaceNormal(S.Z.fromArray(B,o,oi),oi),p=i.geodeticSurfaceNormal(S.Z.fromArray(U,o,on),on),P=S.Z.normalize(S.Z.add(f,p,P),P),z+=3,r=0;r<g.length;r++){let e,a,h;let d=(n=g[r]).leftPositions,Z=n.rightPositions,v=ot,T=r6,E=r7;if(P=S.Z.fromArray(b,z,P),(0,_.Z)(d)){for(oo(I,P,R,void 0,D,t),D-=3,a=u,h=c,e=0;e<d.length/3;e++)v=S.Z.fromArray(d,3*e,v),L[M++]=a,L[M++]=h-e-1,L[M++]=h-e,rP.addAttribute(A,v,void 0,D),T=S.Z.fromArray(A,(h-e-1)*3,T),E=S.Z.fromArray(A,3*a,E),oo(I,P,R=S.Z.normalize(S.Z.subtract(T,E,R),R),void 0,D,t),D-=3;v=S.Z.fromArray(A,3*a,v),T=S.Z.subtract(S.Z.fromArray(A,3*h,T),v,T),E=S.Z.subtract(S.Z.fromArray(A,(h-e)*3,E),v,E),oo(I,P,R=S.Z.normalize(S.Z.add(T,E,R),R),O,void 0,t),O+=3}else{for(oo(I,P,R,O,void 0,t),O+=3,a=c,h=u,e=0;e<Z.length/3;e++)v=S.Z.fromArray(Z,3*e,v),L[M++]=a,L[M++]=h+e,L[M++]=h+e+1,rP.addAttribute(A,v,O),T=S.Z.fromArray(A,3*a,T),E=S.Z.fromArray(A,(h+e)*3,E),oo(I,P,R=S.Z.normalize(S.Z.subtract(T,E,R),R),O,void 0,t),O+=3;v=S.Z.fromArray(A,3*a,v),T=S.Z.subtract(S.Z.fromArray(A,(h+e)*3,T),v,T),E=S.Z.subtract(S.Z.fromArray(A,3*h,E),v,E),oo(I,P,R=S.Z.normalize(S.Z.negate(S.Z.add(E,T,R),R),R),void 0,D,t),D-=3}for(B=m[F++],U=m[F++],B.splice(0,3),U.splice(U.length-3,3),A.set(B,O),A.set(U,D-U.length+1),o=U.length-3,z+=3,R=S.Z.fromArray(y,z,R),e=0;e<U.length;e+=3)f=i.geodeticSurfaceNormal(S.Z.fromArray(B,e,oi),oi),p=i.geodeticSurfaceNormal(S.Z.fromArray(U,o-e,on),on),oo(I,P=S.Z.normalize(S.Z.add(f,p,P),P),R,O,D,t),l=(u=O/3)-1,s=(c=(D-2)/3)+1,L[M++]=s,L[M++]=l,L[M++]=c,L[M++]=c,L[M++]=l,L[M++]=u,O+=3,D-=3;O-=3,D+=3}if(oo(I,P=S.Z.fromArray(b,b.length-3,P),R,O,D,t),w){O+=3,D-=3,d=r6,h=r7;let e=Z[1];for(r=0;r<N;r++)d=S.Z.fromArray(e,(a-r-1)*3,d),h=S.Z.fromArray(e,3*r,h),rP.addAttribute(A,d,void 0,D),rP.addAttribute(A,h,O),oo(I,P,R,O,D,t),l=(u=O/3)-1,s=(c=(D-2)/3)+1,L[M++]=s,L[M++]=l,L[M++]=c,L[M++]=c,L[M++]=l,L[M++]=u,O+=3,D-=3}if(v.position=new r2.Z({componentDatatype:eM.Z.DOUBLE,componentsPerAttribute:3,values:A}),t.st){let e,t;let i=new Float32Array(C/3*2),n=0;if(w){let o;T/=3,E/=3;let s=Math.PI/(a+1);t=1/(T-a+1),e=1/(E-a+1);let l=a/2;for(r=l+1;r<a+1;r++)o=eB.Z.PI_OVER_TWO+s*r,i[n++]=e*(1+Math.cos(o)),i[n++]=.5*(1+Math.sin(o));for(r=1;r<E-a+1;r++)i[n++]=r*e,i[n++]=0;for(r=a;r>l;r--)o=eB.Z.PI_OVER_TWO-r*s,i[n++]=1-e*(1+Math.cos(o)),i[n++]=.5*(1+Math.sin(o));for(r=l;r>0;r--)o=eB.Z.PI_OVER_TWO-s*r,i[n++]=1-t*(1+Math.cos(o)),i[n++]=.5*(1+Math.sin(o));for(r=T-a;r>0;r--)i[n++]=r*t,i[n++]=1;for(r=1;r<l+1;r++)o=eB.Z.PI_OVER_TWO+s*r,i[n++]=t*(1+Math.cos(o)),i[n++]=.5*(1+Math.sin(o))}else{for(T/=3,E/=3,t=1/(T-1),e=1/(E-1),r=0;r<E;r++)i[n++]=r*e,i[n++]=0;for(r=T;r>0;r--)i[n++]=(r-1)*t,i[n++]=1}v.st=new r2.Z({componentDatatype:eM.Z.FLOAT,componentsPerAttribute:2,values:i})}return t.normal&&(v.normal=new r2.Z({componentDatatype:eM.Z.FLOAT,componentsPerAttribute:3,values:I.normals})),t.tangent&&(v.tangent=new r2.Z({componentDatatype:eM.Z.FLOAT,componentsPerAttribute:3,values:I.tangents})),t.bitangent&&(v.bitangent=new r2.Z({componentDatatype:eM.Z.FLOAT,componentsPerAttribute:3,values:I.bitangents})),{attributes:v,indices:L}}function os(e,t,i){i[t++]=e[0],i[t++]=e[1],i[t++]=e[2];for(let n=3;n<e.length;n+=3){let r=e[n],o=e[n+1],a=e[n+2];i[t++]=r,i[t++]=o,i[t++]=a,i[t++]=r,i[t++]=o,i[t++]=a}return i[t++]=e[0],i[t++]=e[1],i[t++]=e[2],i}let ol=new S.Z,oc=new S.Z,ou=new ea.Z;function oh(e,t,i,n,r,o){let a=S.Z.subtract(t,e,ol);S.Z.normalize(a,a);let s=i.geodeticSurfaceNormal(e,oc),l=S.Z.cross(a,s,ol);S.Z.multiplyByScalar(l,n,l);let c=r.latitude,u=r.longitude,h=o.latitude,d=o.longitude;S.Z.add(e,l,oc),i.cartesianToCartographic(oc,ou);let f=ou.latitude,p=ou.longitude;c=Math.min(c,f),u=Math.min(u,p),h=Math.max(h,f),d=Math.max(d,p),S.Z.subtract(e,l,oc),i.cartesianToCartographic(oc,ou),f=ou.latitude,p=ou.longitude,c=Math.min(c,f),u=Math.min(u,p),h=Math.max(h,f),d=Math.max(d,p),r.latitude=c,r.longitude=u,o.latitude=h,o.longitude=d}let od=new S.Z,of=new S.Z,op=new ea.Z,om=new ea.Z;function o_(e,t,i,n,r){let o,a;e=or(e,t);let s=(0,n0.Z)(e,S.Z.equalsEpsilon),l=s.length;if(l<2||i<=0)return new r5.Z;let c=.5*i;if(op.latitude=Number.POSITIVE_INFINITY,op.longitude=Number.POSITIVE_INFINITY,om.latitude=Number.NEGATIVE_INFINITY,om.longitude=Number.NEGATIVE_INFINITY,n===n1.ROUNDED){let e=s[0];S.Z.subtract(e,s[1],od),S.Z.normalize(od,od),S.Z.multiplyByScalar(od,c,od),S.Z.add(e,od,of),t.cartesianToCartographic(of,ou),o=ou.latitude,a=ou.longitude,op.latitude=Math.min(op.latitude,o),op.longitude=Math.min(op.longitude,a),om.latitude=Math.max(om.latitude,o),om.longitude=Math.max(om.longitude,a)}for(let e=0;e<l-1;++e)oh(s[e],s[e+1],t,c,op,om);let u=s[l-1];S.Z.subtract(u,s[l-2],od),S.Z.normalize(od,od),S.Z.multiplyByScalar(od,c,od),S.Z.add(u,od,of),oh(u,of,t,c,op,om),n===n1.ROUNDED&&(t.cartesianToCartographic(of,ou),o=ou.latitude,a=ou.longitude,op.latitude=Math.min(op.latitude,o),op.longitude=Math.min(op.longitude,a),om.latitude=Math.max(om.latitude,o),om.longitude=Math.max(om.longitude,a));let h=(0,_.Z)(r)?r:new r5.Z;return h.north=om.latitude,h.south=op.latitude,h.east=om.longitude,h.west=op.longitude,h}function og(e){let t=(e=(0,m.Z)(e,m.Z.EMPTY_OBJECT)).positions,i=e.width;p.Z.defined("options.positions",t),p.Z.defined("options.width",i);let n=(0,m.Z)(e.height,0),r=(0,m.Z)(e.extrudedHeight,n);this._positions=t,this._ellipsoid=el.Z.clone((0,m.Z)(e.ellipsoid,el.Z.WGS84)),this._vertexFormat=nf.Z.clone((0,m.Z)(e.vertexFormat,nf.Z.DEFAULT)),this._width=i,this._height=Math.max(n,r),this._extrudedHeight=Math.min(n,r),this._cornerType=(0,m.Z)(e.cornerType,n1.ROUNDED),this._granularity=(0,m.Z)(e.granularity,eB.Z.RADIANS_PER_DEGREE),this._shadowVolume=(0,m.Z)(e.shadowVolume,!1),this._workerName="createCorridorGeometry",this._offsetAttribute=e.offsetAttribute,this._rectangle=void 0,this.packedLength=1+t.length*S.Z.packedLength+el.Z.packedLength+nf.Z.packedLength+7}og.pack=function(e,t,i){p.Z.defined("value",e),p.Z.defined("array",t),i=(0,m.Z)(i,0);let n=e._positions,r=n.length;t[i++]=r;for(let e=0;e<r;++e,i+=S.Z.packedLength)S.Z.pack(n[e],t,i);return el.Z.pack(e._ellipsoid,t,i),i+=el.Z.packedLength,nf.Z.pack(e._vertexFormat,t,i),i+=nf.Z.packedLength,t[i++]=e._width,t[i++]=e._height,t[i++]=e._extrudedHeight,t[i++]=e._cornerType,t[i++]=e._granularity,t[i++]=e._shadowVolume?1:0,t[i]=(0,m.Z)(e._offsetAttribute,-1),t};let oZ=el.Z.clone(el.Z.UNIT_SPHERE),oy=new nf.Z,ob={positions:void 0,ellipsoid:oZ,vertexFormat:oy,width:void 0,height:void 0,extrudedHeight:void 0,cornerType:void 0,granularity:void 0,shadowVolume:void 0,offsetAttribute:void 0};og.unpack=function(e,t,i){p.Z.defined("array",e),t=(0,m.Z)(t,0);let n=e[t++],r=Array(n);for(let i=0;i<n;++i,t+=S.Z.packedLength)r[i]=S.Z.unpack(e,t);let o=el.Z.unpack(e,t,oZ);t+=el.Z.packedLength;let a=nf.Z.unpack(e,t,oy);t+=nf.Z.packedLength;let s=e[t++],l=e[t++],c=e[t++],u=e[t++],h=e[t++],d=1===e[t++],f=e[t];return(0,_.Z)(i)?(i._positions=r,i._ellipsoid=el.Z.clone(o,i._ellipsoid),i._vertexFormat=nf.Z.clone(a,i._vertexFormat),i._width=s,i._height=l,i._extrudedHeight=c,i._cornerType=u,i._granularity=h,i._shadowVolume=d,i._offsetAttribute=-1===f?void 0:f,i):(ob.positions=r,ob.width=s,ob.height=l,ob.extrudedHeight=c,ob.cornerType=u,ob.granularity=h,ob.shadowVolume=d,ob.offsetAttribute=-1===f?void 0:f,new og(ob))},og.computeRectangle=function(e,t){let i=(e=(0,m.Z)(e,m.Z.EMPTY_OBJECT)).positions,n=e.width;return p.Z.defined("options.positions",i),p.Z.defined("options.width",n),o_(i,(0,m.Z)(e.ellipsoid,el.Z.WGS84),n,(0,m.Z)(e.cornerType,n1.ROUNDED),t)},og.createGeometry=function(e){let t,i=e._positions,n=e._width,r=e._ellipsoid;i=or(i,r);let o=(0,n0.Z)(i,S.Z.equalsEpsilon);if(o.length<2||n<=0)return;let a=e._height,s=e._extrudedHeight,l=!eB.Z.equalsEpsilon(a,s,0,eB.Z.EPSILON2),c=e._vertexFormat,u={ellipsoid:r,positions:o,width:n,cornerType:e._cornerType,granularity:e._granularity,saveAttributes:!0};if(l)u.height=a,u.extrudedHeight=s,u.shadowVolume=e._shadowVolume,u.offsetAttribute=e._offsetAttribute,t=function(e,t){let i,n,r,o,a;let s=new nf.Z({position:t.position,normal:t.normal||t.bitangent||e.shadowVolume,tangent:t.tangent,bitangent:t.normal||t.bitangent,st:t.st}),l=e.ellipsoid,c=oa(rP.computePositions(e),s,l),u=e.height,h=e.extrudedHeight,d=c.attributes,f=c.indices,p=d.position.values,m=p.length,g=new Float64Array(6*m),Z=new Float64Array(m);Z.set(p);let y=new Float64Array(4*m);y=os(p=r4.Z.scaleToGeodeticHeight(p,u,l),0,y),y=os(Z=r4.Z.scaleToGeodeticHeight(Z,h,l),2*m,y),g.set(p),g.set(Z,m),g.set(y,2*m),d.position.values=g,d=function(e,t){let i,n,r;if(!t.normal&&!t.tangent&&!t.bitangent&&!t.st)return e;let o=e.position.values;(t.normal||t.bitangent)&&(i=e.normal.values,n=e.bitangent.values);let a=e.position.values.length/18,s=3*a,l=2*a,c=2*s;if(t.normal||t.bitangent||t.tangent){let a=t.normal?new Float32Array(6*s):void 0,l=t.tangent?new Float32Array(6*s):void 0,u=t.bitangent?new Float32Array(6*s):void 0,h=r9,d=r8,f=r6,p=r7,m=oe,_=ot,g=c;for(r=0;r<s;r+=3){let e=g+c;h=S.Z.fromArray(o,r,h),d=S.Z.fromArray(o,r+s,d),f=S.Z.fromArray(o,(r+3)%s,f),d=S.Z.subtract(d,h,d),f=S.Z.subtract(f,h,f),p=S.Z.normalize(S.Z.cross(d,f,p),p),t.normal&&(rP.addAttribute(a,p,e),rP.addAttribute(a,p,e+3),rP.addAttribute(a,p,g),rP.addAttribute(a,p,g+3)),(t.tangent||t.bitangent)&&(_=S.Z.fromArray(i,r,_),t.bitangent&&(rP.addAttribute(u,_,e),rP.addAttribute(u,_,e+3),rP.addAttribute(u,_,g),rP.addAttribute(u,_,g+3)),t.tangent&&(m=S.Z.normalize(S.Z.cross(_,p,m),m),rP.addAttribute(l,m,e),rP.addAttribute(l,m,e+3),rP.addAttribute(l,m,g),rP.addAttribute(l,m,g+3))),g+=6}if(t.normal){for(a.set(i),r=0;r<s;r+=3)a[r+s]=-i[r],a[r+s+1]=-i[r+1],a[r+s+2]=-i[r+2];e.normal.values=a}else e.normal=void 0;if(t.bitangent?(u.set(n),u.set(n,s),e.bitangent.values=u):e.bitangent=void 0,t.tangent){let t=e.tangent.values;l.set(t),l.set(t,s),e.tangent.values=l}}if(t.st){let t=e.st.values,i=new Float32Array(6*l);i.set(t),i.set(t,l);let n=2*l;for(let e=0;e<2;e++){for(r=2,i[n++]=t[0],i[n++]=t[1];r<l;r+=2){let e=t[r],o=t[r+1];i[n++]=e,i[n++]=o,i[n++]=e,i[n++]=o}i[n++]=t[0],i[n++]=t[1]}e.st.values=i}return e}(d,t);let b=m/3;if(e.shadowVolume){let e=d.normal.values,n=new Float32Array(6*(m=e.length));for(i=0;i<m;i++)e[i]=-e[i];n.set(e,m),n=os(e,4*m,n),d.extrudeDirection=new r2.Z({componentDatatype:eM.Z.FLOAT,componentsPerAttribute:3,values:n}),t.normal||(d.normal=void 0)}if((0,_.Z)(e.offsetAttribute)){let t=new Uint8Array(6*b);if(e.offsetAttribute===nS.Z.TOP)t=t.fill(1,0,b).fill(1,2*b,4*b);else{let i=e.offsetAttribute===nS.Z.NONE?0:1;t=t.fill(i)}d.applyOffset=new r2.Z({componentDatatype:eM.Z.UNSIGNED_BYTE,componentsPerAttribute:1,values:t})}let v=f.length,T=b+b,E=ez.Z.createTypedArray(g.length/3,2*v+3*T);E.set(f);let x=v;for(i=0;i<v;i+=3){let e=f[i],t=f[i+1],n=f[i+2];E[x++]=n+b,E[x++]=t+b,E[x++]=e+b}for(i=0;i<T;i+=2)r=(n=i+T)+T,o=n+1,a=r+1,E[x++]=n,E[x++]=r,E[x++]=o,E[x++]=o,E[x++]=r,E[x++]=a;return{attributes:d,indices:E}}(u,c);else if((t=oa(rP.computePositions(u),c,r)).attributes.position.values=r4.Z.scaleToGeodeticHeight(t.attributes.position.values,a,r),(0,_.Z)(e._offsetAttribute)){let i=e._offsetAttribute===nS.Z.NONE?0:1,n=new Uint8Array(t.attributes.position.values.length/3).fill(i);t.attributes.applyOffset=new r2.Z({componentDatatype:eM.Z.UNSIGNED_BYTE,componentsPerAttribute:1,values:n})}let h=t.attributes,d=f.Z.fromVertices(h.position.values,void 0,3);return c.position||(t.attributes.position.values=void 0),new r1.Z({attributes:h,indices:t.indices,primitiveType:iT.Z.TRIANGLES,boundingSphere:d,offsetAttribute:e._offsetAttribute})},og.createShadowVolume=function(e,t,i){let n=e._granularity,r=e._ellipsoid,o=t(n,r),a=i(n,r);return new og({positions:e._positions,width:e._width,cornerType:e._cornerType,ellipsoid:r,granularity:n,extrudedHeight:o,height:a,vertexFormat:nf.Z.POSITION_ONLY,shadowVolume:!0})},Object.defineProperties(og.prototype,{rectangle:{get:function(){return(0,_.Z)(this._rectangle)||(this._rectangle=o_(this._positions,this._ellipsoid,this._width,this._cornerType)),this._rectangle}},textureCoordinateRotationPoints:{get:function(){return[0,0,0,1,1,0]}}});let ov=new S.Z,oT=new S.Z,oE=new S.Z;function ox(e,t){let i,n,r,o,a,s,l,c,u,h;let d=[],f=e.positions,p=e.corners,m=e.endPositions,g=new r3.Z,Z=0,y=0,b=0;for(n=0;n<f.length;n+=2)Z+=r=f[n].length-3,b+=r/3*4,y+=f[n+1].length-3;for(Z+=3,y+=3,n=0;n<p.length;n++){i=p[n];let e=p[n].leftPositions;(0,_.Z)(e)?Z+=r=e.length:y+=r=p[n].rightPositions.length,b+=r/3*2}let v=(0,_.Z)(m);v&&(Z+=o=m[0].length-3,y+=o,o/=3,b+=4*o);let T=Z+y,E=new Float64Array(T),x=0,w=T-1,C=o/2,A=ez.Z.createTypedArray(T/3,b+4),I=0;if(A[I++]=x/3,A[I++]=(w-2)/3,v){d.push(x/3),h=ov,u=oT;let e=m[0];for(n=0;n<C;n++)h=S.Z.fromArray(e,(C-1-n)*3,h),u=S.Z.fromArray(e,(C+n)*3,u),rP.addAttribute(E,u,x),rP.addAttribute(E,h,void 0,w),c=(s=x/3)+1,l=(a=(w-2)/3)-1,A[I++]=a,A[I++]=l,A[I++]=s,A[I++]=c,x+=3,w-=3}let O=0,D=f[O++],P=f[O++];for(E.set(D,x),E.set(P,w-P.length+1),r=P.length-3,d.push(x/3,(w-2)/3),n=0;n<r;n+=3)c=(s=x/3)+1,l=(a=(w-2)/3)-1,A[I++]=a,A[I++]=l,A[I++]=s,A[I++]=c,x+=3,w-=3;for(n=0;n<p.length;n++){let e,o;let u=(i=p[n]).leftPositions,h=i.rightPositions,m=oE;if((0,_.Z)(u)){for(w-=3,o=l,d.push(c),e=0;e<u.length/3;e++)m=S.Z.fromArray(u,3*e,m),A[I++]=o-e-1,A[I++]=o-e,rP.addAttribute(E,m,void 0,w),w-=3;d.push(o-Math.floor(u.length/6)),t===n1.BEVELED&&d.push((w-2)/3+1),x+=3}else{for(x+=3,o=c,d.push(l),e=0;e<h.length/3;e++)m=S.Z.fromArray(h,3*e,m),A[I++]=o+e,A[I++]=o+e+1,rP.addAttribute(E,m,x),x+=3;d.push(o+Math.floor(h.length/6)),t===n1.BEVELED&&d.push(x/3-1),w-=3}for(D=f[O++],P=f[O++],D.splice(0,3),P.splice(P.length-3,3),E.set(D,x),E.set(P,w-P.length+1),r=P.length-3,e=0;e<P.length;e+=3)s=(c=x/3)-1,a=(l=(w-2)/3)+1,A[I++]=a,A[I++]=l,A[I++]=s,A[I++]=c,x+=3,w-=3;x-=3,w+=3,d.push(x/3,(w-2)/3)}if(v){x+=3,w-=3,h=ov,u=oT;let e=m[1];for(n=0;n<C;n++)h=S.Z.fromArray(e,(o-n-1)*3,h),u=S.Z.fromArray(e,3*n,u),rP.addAttribute(E,h,void 0,w),rP.addAttribute(E,u,x),s=(c=x/3)-1,a=(l=(w-2)/3)+1,A[I++]=a,A[I++]=l,A[I++]=s,A[I++]=c,x+=3,w-=3;d.push(x/3)}else d.push(x/3,(w-2)/3);return A[I++]=x/3,A[I++]=(w-2)/3,g.position=new r2.Z({componentDatatype:eM.Z.DOUBLE,componentsPerAttribute:3,values:E}),{attributes:g,indices:A,wallIndices:d}}function ow(e){let t=(e=(0,m.Z)(e,m.Z.EMPTY_OBJECT)).positions,i=e.width;p.Z.typeOf.object("options.positions",t),p.Z.typeOf.number("options.width",i);let n=(0,m.Z)(e.height,0),r=(0,m.Z)(e.extrudedHeight,n);this._positions=t,this._ellipsoid=el.Z.clone((0,m.Z)(e.ellipsoid,el.Z.WGS84)),this._width=i,this._height=Math.max(n,r),this._extrudedHeight=Math.min(n,r),this._cornerType=(0,m.Z)(e.cornerType,n1.ROUNDED),this._granularity=(0,m.Z)(e.granularity,eB.Z.RADIANS_PER_DEGREE),this._offsetAttribute=e.offsetAttribute,this._workerName="createCorridorOutlineGeometry",this.packedLength=1+t.length*S.Z.packedLength+el.Z.packedLength+6}ow.pack=function(e,t,i){p.Z.typeOf.object("value",e),p.Z.typeOf.object("array",t),i=(0,m.Z)(i,0);let n=e._positions,r=n.length;t[i++]=r;for(let e=0;e<r;++e,i+=S.Z.packedLength)S.Z.pack(n[e],t,i);return el.Z.pack(e._ellipsoid,t,i),i+=el.Z.packedLength,t[i++]=e._width,t[i++]=e._height,t[i++]=e._extrudedHeight,t[i++]=e._cornerType,t[i++]=e._granularity,t[i]=(0,m.Z)(e._offsetAttribute,-1),t};let oS=el.Z.clone(el.Z.UNIT_SPHERE),oC={positions:void 0,ellipsoid:oS,width:void 0,height:void 0,extrudedHeight:void 0,cornerType:void 0,granularity:void 0,offsetAttribute:void 0};ow.unpack=function(e,t,i){p.Z.typeOf.object("array",e),t=(0,m.Z)(t,0);let n=e[t++],r=Array(n);for(let i=0;i<n;++i,t+=S.Z.packedLength)r[i]=S.Z.unpack(e,t);let o=el.Z.unpack(e,t,oS);t+=el.Z.packedLength;let a=e[t++],s=e[t++],l=e[t++],c=e[t++],u=e[t++],h=e[t];return(0,_.Z)(i)?(i._positions=r,i._ellipsoid=el.Z.clone(o,i._ellipsoid),i._width=a,i._height=s,i._extrudedHeight=l,i._cornerType=c,i._granularity=u,i._offsetAttribute=-1===h?void 0:h,i):(oC.positions=r,oC.width=a,oC.height=s,oC.extrudedHeight=l,oC.cornerType=c,oC.granularity=u,oC.offsetAttribute=-1===h?void 0:h,new ow(oC))},ow.createGeometry=function(e){let t,i=e._positions,n=e._width,r=e._ellipsoid;i=function(e,t){for(let i=0;i<e.length;i++)e[i]=t.scaleToGeodeticSurface(e[i],e[i]);return e}(i,r);let o=(0,n0.Z)(i,S.Z.equalsEpsilon);if(o.length<2||n<=0)return;let a=e._height,s=e._extrudedHeight,l=!eB.Z.equalsEpsilon(a,s,0,eB.Z.EPSILON2),c={ellipsoid:r,positions:o,width:n,cornerType:e._cornerType,granularity:e._granularity,saveAttributes:!1};if(l)c.height=a,c.extrudedHeight=s,c.offsetAttribute=e._offsetAttribute,t=function(e){let t,i,n;let r=e.ellipsoid,o=ox(rP.computePositions(e),e.cornerType),a=o.wallIndices,s=e.height,l=e.extrudedHeight,c=o.attributes,u=o.indices,h=c.position.values,d=h.length,f=new Float64Array(d);f.set(h);let p=new Float64Array(2*d);if(h=r4.Z.scaleToGeodeticHeight(h,s,r),f=r4.Z.scaleToGeodeticHeight(f,l,r),p.set(h),p.set(f,d),c.position.values=p,d/=3,(0,_.Z)(e.offsetAttribute)){let t=new Uint8Array(2*d);if(e.offsetAttribute===nS.Z.TOP)t=t.fill(1,0,d);else{let i=e.offsetAttribute===nS.Z.NONE?0:1;t=t.fill(i)}c.applyOffset=new r2.Z({componentDatatype:eM.Z.UNSIGNED_BYTE,componentsPerAttribute:1,values:t})}let m=u.length,g=ez.Z.createTypedArray(p.length/3,(m+a.length)*2);g.set(u);let Z=m;for(t=0;t<m;t+=2){let e=u[t],i=u[t+1];g[Z++]=e+d,g[Z++]=i+d}for(t=0;t<a.length;t++)n=(i=a[t])+d,g[Z++]=i,g[Z++]=n;return{attributes:c,indices:g}}(c);else if((t=ox(rP.computePositions(c),c.cornerType)).attributes.position.values=r4.Z.scaleToGeodeticHeight(t.attributes.position.values,a,r),(0,_.Z)(e._offsetAttribute)){let i=t.attributes.position.values.length,n=e._offsetAttribute===nS.Z.NONE?0:1,r=new Uint8Array(i/3).fill(n);t.attributes.applyOffset=new r2.Z({componentDatatype:eM.Z.UNSIGNED_BYTE,componentsPerAttribute:1,values:r})}let u=t.attributes,h=f.Z.fromVertices(u.position.values,void 0,3);return new r1.Z({attributes:u,indices:t.indices,primitiveType:iT.Z.LINES,boundingSphere:h,offsetAttribute:e._offsetAttribute})};let oA=new nR.Z(0);function oI(e){nV.call(this,e),this._zIndex=0,this._terrainOffsetProperty=void 0}(0,_.Z)(Object.create)&&(oI.prototype=Object.create(nV.prototype),oI.prototype.constructor=oI),Object.defineProperties(oI.prototype,{zIndex:{get:function(){return this._zIndex}},terrainOffsetProperty:{get:function(){return this._terrainOffsetProperty}}}),oI.prototype._isOnTerrain=function(e,t){return this._fillEnabled&&!(0,_.Z)(t.height)&&!(0,_.Z)(t.extrudedHeight)&&b.Z.isSupported(this._scene)},oI.prototype._getIsClosed=function(e){let t=e.height,i=e.extrudedHeight;return 0===t||(0,_.Z)(i)&&i!==t},oI.prototype._computeCenter=A.Z.throwInstantiationError,oI.prototype._onEntityPropertyChanged=function(e,t,i,n){if(nV.prototype._onEntityPropertyChanged.call(this,e,t,i,n),-1===this._observedPropertyNames.indexOf(t))return;let r=this._entity[this._geometryPropertyName];if(!(0,_.Z)(r))return;(0,_.Z)(r.zIndex)&&((0,_.Z)(r.height)||(0,_.Z)(r.extrudedHeight))&&(0,nP.Z)(nP.Z.geometryZIndex),this._zIndex=(0,m.Z)(r.zIndex,oA),(0,_.Z)(this._terrainOffsetProperty)&&(this._terrainOffsetProperty.destroy(),this._terrainOffsetProperty=void 0);let o=r.heightReference,a=r.extrudedHeightReference;if((0,_.Z)(o)||(0,_.Z)(a)){let e=new nH(this._computeCenter.bind(this),!this._dynamic);this._terrainOffsetProperty=new nj(this._scene,e,o,a)}},oI.prototype.destroy=function(){(0,_.Z)(this._terrainOffsetProperty)&&(this._terrainOffsetProperty.destroy(),this._terrainOffsetProperty=void 0),nV.prototype.destroy.call(this)},oI.getGeometryHeight=function(e,t){if(p.Z.defined("heightReference",t),!(0,_.Z)(e)){t!==D.ZP.NONE&&(0,nP.Z)(nP.Z.geometryHeightReference);return}return(0,D.c1)(t)?0:e},oI.getGeometryExtrudedHeight=function(e,t){if(p.Z.defined("extrudedHeightReference",t),!(0,_.Z)(e)){t!==D.ZP.NONE&&(0,nP.Z)(nP.Z.geometryExtrudedHeightReference);return}return(0,D.c1)(t)?oI.CLAMP_TO_GROUND:e},oI.CLAMP_TO_GROUND="clamp",oI.computeGeometryOffsetAttribute=function(e,t,i,n){(0,_.Z)(e)&&(0,_.Z)(t)||(t=D.ZP.NONE),(0,_.Z)(i)&&(0,_.Z)(n)||(n=D.ZP.NONE);let r=0;return(t!==D.ZP.NONE&&r++,n===D.ZP.RELATIVE_TO_GROUND&&r++,2===r)?nS.Z.ALL:1===r?nS.Z.TOP:void 0};let oO=new C.Z,oD=S.Z.ZERO,oP=new S.Z,oR=new r5.Z;function oN(e){this.id=e,this.vertexFormat=void 0,this.positions=void 0,this.width=void 0,this.cornerType=void 0,this.height=void 0,this.extrudedHeight=void 0,this.granularity=void 0,this.offsetAttribute=void 0}function oL(e,t){oI.call(this,{entity:e,scene:t,geometryOptions:new oN(e),geometryPropertyName:"corridor",observedPropertyNames:["availability","corridor"]}),this._onEntityPropertyChanged(e,"corridor",e.corridor,void 0)}function oM(e,t,i){nD.call(this,e,t,i)}(0,_.Z)(Object.create)&&(oL.prototype=Object.create(oI.prototype),oL.prototype.constructor=oL),oL.prototype.createFillGeometryInstance=function(e){if(p.Z.defined("time",e),!this._fillEnabled)throw new A.Z("This instance does not represent a filled geometry.");let t=this._entity,i=t.isAvailable(e),n={show:new nA.Z(i&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),distanceDisplayCondition:nx.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0,color:void 0};if(this._materialProperty instanceof ny.Z){let t;(0,_.Z)(this._materialProperty.color)&&(this._materialProperty.color.isConstant||i)&&(t=this._materialProperty.color.getValue(e,oO)),(0,_.Z)(t)||(t=C.Z.WHITE),n.color=nE.Z.fromColor(t)}return(0,_.Z)(this._options.offsetAttribute)&&(n.offset=nC.Z.fromCartesian3(L.Z.getValueOrDefault(this._terrainOffsetProperty,e,oD,oP))),new nw.Z({id:t,geometry:new og(this._options),attributes:n})},oL.prototype.createOutlineGeometryInstance=function(e){if(p.Z.defined("time",e),!this._outlineEnabled)throw new A.Z("This instance does not represent an outlined geometry.");let t=this._entity,i=t.isAvailable(e),n=L.Z.getValueOrDefault(this._outlineColorProperty,e,C.Z.BLACK,oO),r={show:new nA.Z(i&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:nE.Z.fromColor(n),distanceDisplayCondition:nx.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0};return(0,_.Z)(this._options.offsetAttribute)&&(r.offset=nC.Z.fromCartesian3(L.Z.getValueOrDefault(this._terrainOffsetProperty,e,oD,oP))),new nw.Z({id:t,geometry:new ow(this._options),attributes:r})},oL.prototype._computeCenter=function(e,t){let i=L.Z.getValueOrUndefined(this._entity.corridor.positions,e);if((0,_.Z)(i)&&0!==i.length)return S.Z.clone(i[Math.floor(i.length/2)],t)},oL.prototype._isHidden=function(e,t){return!(0,_.Z)(t.positions)||!(0,_.Z)(t.width)||nV.prototype._isHidden.call(this,e,t)},oL.prototype._isDynamic=function(e,t){return!t.positions.isConstant||!L.Z.isConstant(t.height)||!L.Z.isConstant(t.extrudedHeight)||!L.Z.isConstant(t.granularity)||!L.Z.isConstant(t.width)||!L.Z.isConstant(t.outlineWidth)||!L.Z.isConstant(t.cornerType)||!L.Z.isConstant(t.zIndex)||this._onTerrain&&!L.Z.isConstant(this._materialProperty)&&!(this._materialProperty instanceof ny.Z)},oL.prototype._setStaticOptions=function(e,t){let i=L.Z.getValueOrUndefined(t.height,na.MINIMUM_VALUE),n=L.Z.getValueOrDefault(t.heightReference,na.MINIMUM_VALUE,D.ZP.NONE),r=L.Z.getValueOrUndefined(t.extrudedHeight,na.MINIMUM_VALUE),o=L.Z.getValueOrDefault(t.extrudedHeightReference,na.MINIMUM_VALUE,D.ZP.NONE);(0,_.Z)(r)&&!(0,_.Z)(i)&&(i=0);let a=this._options;a.vertexFormat=this._materialProperty instanceof ny.Z?ng.Z.VERTEX_FORMAT:n_.MaterialSupport.TEXTURED.vertexFormat,a.positions=t.positions.getValue(na.MINIMUM_VALUE,a.positions),a.width=t.width.getValue(na.MINIMUM_VALUE),a.granularity=L.Z.getValueOrUndefined(t.granularity,na.MINIMUM_VALUE),a.cornerType=L.Z.getValueOrUndefined(t.cornerType,na.MINIMUM_VALUE),a.offsetAttribute=oI.computeGeometryOffsetAttribute(i,n,r,o),a.height=oI.getGeometryHeight(i,n),(r=oI.getGeometryExtrudedHeight(r,o))===oI.CLAMP_TO_GROUND&&(r=d.Z.getMinimumMaximumHeights(og.computeRectangle(a,oR)).minimumTerrainHeight),a.extrudedHeight=r},oL.DynamicGeometryUpdater=oM,(0,_.Z)(Object.create)&&(oM.prototype=Object.create(nD.prototype),oM.prototype.constructor=oM),oM.prototype._isHidden=function(e,t,i){let n=this._options;return!(0,_.Z)(n.positions)||!(0,_.Z)(n.width)||nD.prototype._isHidden.call(this,e,t,i)},oM.prototype._setOptions=function(e,t,i){let n=this._options,r=L.Z.getValueOrUndefined(t.height,i),o=L.Z.getValueOrDefault(t.heightReference,i,D.ZP.NONE),a=L.Z.getValueOrUndefined(t.extrudedHeight,i),s=L.Z.getValueOrDefault(t.extrudedHeightReference,i,D.ZP.NONE);(0,_.Z)(a)&&!(0,_.Z)(r)&&(r=0),n.positions=L.Z.getValueOrUndefined(t.positions,i),n.width=L.Z.getValueOrUndefined(t.width,i),n.granularity=L.Z.getValueOrUndefined(t.granularity,i),n.cornerType=L.Z.getValueOrUndefined(t.cornerType,i),n.offsetAttribute=oI.computeGeometryOffsetAttribute(r,o,a,s),n.height=oI.getGeometryHeight(r,o),(a=oI.getGeometryExtrudedHeight(a,s))===oI.CLAMP_TO_GROUND&&(a=d.Z.getMinimumMaximumHeights(og.computeRectangle(n,oR)).minimumTerrainHeight),n.extrudedHeight=a};let oF={};oF.computePositions=function(e,t,i,n,r){let o;let a=.5*e,s=-a,l=n+n,c=new Float64Array(3*(r?2*l:l)),u=0,h=0,d=r?3*l:0,f=r?(l+n)*3:3*n;for(o=0;o<n;o++){let e=o/n*eB.Z.TWO_PI,l=Math.cos(e),p=Math.sin(e),m=l*i,_=p*i,g=l*t,Z=p*t;c[h+d]=m,c[h+d+1]=_,c[h+d+2]=s,c[h+f]=g,c[h+f+1]=Z,c[h+f+2]=a,h+=3,r&&(c[u++]=m,c[u++]=_,c[u++]=s,c[u++]=g,c[u++]=Z,c[u++]=a)}return c};let oz=new w.Z,oB=new S.Z,oU=new S.Z,ok=new S.Z,oV=new S.Z;function oH(e){let t=(e=(0,m.Z)(e,m.Z.EMPTY_OBJECT)).length,i=e.topRadius,n=e.bottomRadius,r=(0,m.Z)(e.vertexFormat,nf.Z.DEFAULT),o=(0,m.Z)(e.slices,128);if(!(0,_.Z)(t))throw new A.Z("options.length must be defined.");if(!(0,_.Z)(i))throw new A.Z("options.topRadius must be defined.");if(!(0,_.Z)(n))throw new A.Z("options.bottomRadius must be defined.");if(o<3)throw new A.Z("options.slices must be greater than or equal to 3.");if((0,_.Z)(e.offsetAttribute)&&e.offsetAttribute===nS.Z.TOP)throw new A.Z("GeometryOffsetAttribute.TOP is not a supported options.offsetAttribute for this geometry.");this._length=t,this._topRadius=i,this._bottomRadius=n,this._vertexFormat=nf.Z.clone(r),this._slices=o,this._offsetAttribute=e.offsetAttribute,this._workerName="createCylinderGeometry"}oH.packedLength=nf.Z.packedLength+5,oH.pack=function(e,t,i){if(!(0,_.Z)(e))throw new A.Z("value is required");if(!(0,_.Z)(t))throw new A.Z("array is required");return i=(0,m.Z)(i,0),nf.Z.pack(e._vertexFormat,t,i),i+=nf.Z.packedLength,t[i++]=e._length,t[i++]=e._topRadius,t[i++]=e._bottomRadius,t[i++]=e._slices,t[i]=(0,m.Z)(e._offsetAttribute,-1),t};let oG=new nf.Z,oj={vertexFormat:oG,length:void 0,topRadius:void 0,bottomRadius:void 0,slices:void 0,offsetAttribute:void 0};oH.unpack=function(e,t,i){if(!(0,_.Z)(e))throw new A.Z("array is required");t=(0,m.Z)(t,0);let n=nf.Z.unpack(e,t,oG);t+=nf.Z.packedLength;let r=e[t++],o=e[t++],a=e[t++],s=e[t++],l=e[t];return(0,_.Z)(i)?(i._vertexFormat=nf.Z.clone(n,i._vertexFormat),i._length=r,i._topRadius=o,i._bottomRadius=a,i._slices=s,i._offsetAttribute=-1===l?void 0:l,i):(oj.length=r,oj.topRadius=o,oj.bottomRadius=a,oj.slices=s,oj.offsetAttribute=-1===l?void 0:l,new oH(oj))},oH.createGeometry=function(e){let t,i=e._length,n=e._topRadius,r=e._bottomRadius,o=e._vertexFormat,a=e._slices;if(i<=0||n<0||r<0||0===n&&0===r)return;let s=a+a,l=a+s,c=s+s,u=oF.computePositions(i,n,r,a,!0),h=o.st?new Float32Array(2*c):void 0,d=o.normal?new Float32Array(3*c):void 0,p=o.tangent?new Float32Array(3*c):void 0,m=o.bitangent?new Float32Array(3*c):void 0,g=o.normal||o.tangent||o.bitangent;if(g){let e=o.tangent||o.bitangent,s=0,l=0,c=0,u=Math.atan2(r-n,i);oB.z=Math.sin(u);let h=Math.cos(u),f=ok,_=oU;for(t=0;t<a;t++){let i=t/a*eB.Z.TWO_PI,n=h*Math.cos(i),r=h*Math.sin(i);g&&(oB.x=n,oB.y=r,e&&(f=S.Z.normalize(S.Z.cross(S.Z.UNIT_Z,oB,f),f)),o.normal&&(d[s++]=oB.x,d[s++]=oB.y,d[s++]=oB.z,d[s++]=oB.x,d[s++]=oB.y,d[s++]=oB.z),o.tangent&&(p[l++]=f.x,p[l++]=f.y,p[l++]=f.z,p[l++]=f.x,p[l++]=f.y,p[l++]=f.z),o.bitangent&&(_=S.Z.normalize(S.Z.cross(oB,f,_),_),m[c++]=_.x,m[c++]=_.y,m[c++]=_.z,m[c++]=_.x,m[c++]=_.y,m[c++]=_.z))}for(t=0;t<a;t++)o.normal&&(d[s++]=0,d[s++]=0,d[s++]=-1),o.tangent&&(p[l++]=1,p[l++]=0,p[l++]=0),o.bitangent&&(m[c++]=0,m[c++]=-1,m[c++]=0);for(t=0;t<a;t++)o.normal&&(d[s++]=0,d[s++]=0,d[s++]=1),o.tangent&&(p[l++]=1,p[l++]=0,p[l++]=0),o.bitangent&&(m[c++]=0,m[c++]=1,m[c++]=0)}let Z=ez.Z.createTypedArray(c,12*a-12),y=0,b=0;for(t=0;t<a-1;t++)Z[y++]=b,Z[y++]=b+2,Z[y++]=b+3,Z[y++]=b,Z[y++]=b+3,Z[y++]=b+1,b+=2;for(t=1,Z[y++]=s-2,Z[y++]=0,Z[y++]=1,Z[y++]=s-2,Z[y++]=1,Z[y++]=s-1;t<a-1;t++)Z[y++]=s+t+1,Z[y++]=s+t,Z[y++]=s;for(t=1;t<a-1;t++)Z[y++]=l,Z[y++]=l+t,Z[y++]=l+t+1;let v=0;if(o.st){let e=Math.max(n,r);for(t=0;t<c;t++){let i=S.Z.fromArray(u,3*t,oV);h[v++]=(i.x+e)/(2*e),h[v++]=(i.y+e)/(2*e)}}let T=new r3.Z;o.position&&(T.position=new r2.Z({componentDatatype:eM.Z.DOUBLE,componentsPerAttribute:3,values:u})),o.normal&&(T.normal=new r2.Z({componentDatatype:eM.Z.FLOAT,componentsPerAttribute:3,values:d})),o.tangent&&(T.tangent=new r2.Z({componentDatatype:eM.Z.FLOAT,componentsPerAttribute:3,values:p})),o.bitangent&&(T.bitangent=new r2.Z({componentDatatype:eM.Z.FLOAT,componentsPerAttribute:3,values:m})),o.st&&(T.st=new r2.Z({componentDatatype:eM.Z.FLOAT,componentsPerAttribute:2,values:h})),oz.x=.5*i,oz.y=Math.max(r,n);let E=new f.Z(S.Z.ZERO,w.Z.magnitude(oz));if((0,_.Z)(e._offsetAttribute)){i=u.length;let t=e._offsetAttribute===nS.Z.NONE?0:1,n=new Uint8Array(i/3).fill(t);T.applyOffset=new r2.Z({componentDatatype:eM.Z.UNSIGNED_BYTE,componentsPerAttribute:1,values:n})}return new r1.Z({attributes:T,indices:Z,primitiveType:iT.Z.TRIANGLES,boundingSphere:E,offsetAttribute:e._offsetAttribute})},oH.getUnitCylinder=function(){return(0,_.Z)(a)||(a=oH.createGeometry(new oH({topRadius:1,bottomRadius:1,length:1,vertexFormat:nf.Z.POSITION_ONLY}))),a};let oW=new w.Z;function oq(e){let t=(e=(0,m.Z)(e,m.Z.EMPTY_OBJECT)).length,i=e.topRadius,n=e.bottomRadius,r=(0,m.Z)(e.slices,128),o=Math.max((0,m.Z)(e.numberOfVerticalLines,16),0);if(p.Z.typeOf.number("options.positions",t),p.Z.typeOf.number("options.topRadius",i),p.Z.typeOf.number("options.bottomRadius",n),p.Z.typeOf.number.greaterThanOrEquals("options.slices",r,3),(0,_.Z)(e.offsetAttribute)&&e.offsetAttribute===nS.Z.TOP)throw new A.Z("GeometryOffsetAttribute.TOP is not a supported options.offsetAttribute for this geometry.");this._length=t,this._topRadius=i,this._bottomRadius=n,this._slices=r,this._numberOfVerticalLines=o,this._offsetAttribute=e.offsetAttribute,this._workerName="createCylinderOutlineGeometry"}oq.packedLength=6,oq.pack=function(e,t,i){return p.Z.typeOf.object("value",e),p.Z.defined("array",t),i=(0,m.Z)(i,0),t[i++]=e._length,t[i++]=e._topRadius,t[i++]=e._bottomRadius,t[i++]=e._slices,t[i++]=e._numberOfVerticalLines,t[i]=(0,m.Z)(e._offsetAttribute,-1),t};let oY={length:void 0,topRadius:void 0,bottomRadius:void 0,slices:void 0,numberOfVerticalLines:void 0,offsetAttribute:void 0};oq.unpack=function(e,t,i){p.Z.defined("array",e),t=(0,m.Z)(t,0);let n=e[t++],r=e[t++],o=e[t++],a=e[t++],s=e[t++],l=e[t];return(0,_.Z)(i)?(i._length=n,i._topRadius=r,i._bottomRadius=o,i._slices=a,i._numberOfVerticalLines=s,i._offsetAttribute=-1===l?void 0:l,i):(oY.length=n,oY.topRadius=r,oY.bottomRadius=o,oY.slices=a,oY.numberOfVerticalLines=s,oY.offsetAttribute=-1===l?void 0:l,new oq(oY))},oq.createGeometry=function(e){let t,i,n=e._length,r=e._topRadius,o=e._bottomRadius,a=e._slices,s=e._numberOfVerticalLines;if(n<=0||r<0||o<0||0===r&&0===o)return;let l=oF.computePositions(n,r,o,a,!1),c=2*a;if(s>0){let e=Math.min(s,a);t=Math.round(a/e),c+=e}let u=ez.Z.createTypedArray(2*a,2*c),h=0;for(i=0;i<a-1;i++)u[h++]=i,u[h++]=i+1,u[h++]=i+a,u[h++]=i+1+a;if(u[h++]=a-1,u[h++]=0,u[h++]=a+a-1,u[h++]=a,s>0)for(i=0;i<a;i+=t)u[h++]=i,u[h++]=i+a;let d=new r3.Z;d.position=new r2.Z({componentDatatype:eM.Z.DOUBLE,componentsPerAttribute:3,values:l}),oW.x=.5*n,oW.y=Math.max(o,r);let p=new f.Z(S.Z.ZERO,w.Z.magnitude(oW));if((0,_.Z)(e._offsetAttribute)){n=l.length;let t=e._offsetAttribute===nS.Z.NONE?0:1,i=new Uint8Array(n/3).fill(t);d.applyOffset=new r2.Z({componentDatatype:eM.Z.UNSIGNED_BYTE,componentsPerAttribute:1,values:i})}return new r1.Z({attributes:d,indices:u,primitiveType:iT.Z.LINES,boundingSphere:p,offsetAttribute:e._offsetAttribute})};let oX=S.Z.ZERO,o$=new S.Z,oK=new S.Z,oQ=new C.Z;function oJ(e){this.id=e,this.vertexFormat=void 0,this.length=void 0,this.topRadius=void 0,this.bottomRadius=void 0,this.slices=void 0,this.numberOfVerticalLines=void 0,this.offsetAttribute=void 0}function o0(e,t){nV.call(this,{entity:e,scene:t,geometryOptions:new oJ(e),geometryPropertyName:"cylinder",observedPropertyNames:["availability","position","orientation","cylinder"]}),this._onEntityPropertyChanged(e,"cylinder",e.cylinder,void 0)}function o1(e,t,i){nD.call(this,e,t,i)}(0,_.Z)(Object.create)&&(o0.prototype=Object.create(nV.prototype),o0.prototype.constructor=o0),Object.defineProperties(o0.prototype,{terrainOffsetProperty:{get:function(){return this._terrainOffsetProperty}}}),o0.prototype.createFillGeometryInstance=function(e){if(p.Z.defined("time",e),!this._fillEnabled)throw new A.Z("This instance does not represent a filled geometry.");let t=this._entity,i=t.isAvailable(e),n=new nA.Z(i&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),r=this._distanceDisplayConditionProperty.getValue(e),o={show:n,distanceDisplayCondition:nx.fromDistanceDisplayCondition(r),color:void 0,offset:void 0};if(this._materialProperty instanceof ny.Z){let t;(0,_.Z)(this._materialProperty.color)&&(this._materialProperty.color.isConstant||i)&&(t=this._materialProperty.color.getValue(e,oQ)),(0,_.Z)(t)||(t=C.Z.WHITE),o.color=nE.Z.fromColor(t)}return(0,_.Z)(this._options.offsetAttribute)&&(o.offset=nC.Z.fromCartesian3(L.Z.getValueOrDefault(this._terrainOffsetProperty,e,oX,o$))),new nw.Z({id:t,geometry:new oH(this._options),modelMatrix:t.computeModelMatrixForHeightReference(e,t.cylinder.heightReference,.5*this._options.length,this._scene.mapProjection.ellipsoid),attributes:o})},o0.prototype.createOutlineGeometryInstance=function(e){if(p.Z.defined("time",e),!this._outlineEnabled)throw new A.Z("This instance does not represent an outlined geometry.");let t=this._entity,i=t.isAvailable(e),n=L.Z.getValueOrDefault(this._outlineColorProperty,e,C.Z.BLACK,oQ),r=this._distanceDisplayConditionProperty.getValue(e),o={show:new nA.Z(i&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:nE.Z.fromColor(n),distanceDisplayCondition:nx.fromDistanceDisplayCondition(r),offset:void 0};return(0,_.Z)(this._options.offsetAttribute)&&(o.offset=nC.Z.fromCartesian3(L.Z.getValueOrDefault(this._terrainOffsetProperty,e,oX,o$))),new nw.Z({id:t,geometry:new oq(this._options),modelMatrix:t.computeModelMatrixForHeightReference(e,t.cylinder.heightReference,.5*this._options.length,this._scene.mapProjection.ellipsoid),attributes:o})},o0.prototype._computeCenter=function(e,t){return L.Z.getValueOrUndefined(this._entity.position,e,t)},o0.prototype._isHidden=function(e,t){return!(0,_.Z)(e.position)||!(0,_.Z)(t.length)||!(0,_.Z)(t.topRadius)||!(0,_.Z)(t.bottomRadius)||nV.prototype._isHidden.call(this,e,t)},o0.prototype._isDynamic=function(e,t){return!e.position.isConstant||!L.Z.isConstant(e.orientation)||!t.length.isConstant||!t.topRadius.isConstant||!t.bottomRadius.isConstant||!L.Z.isConstant(t.slices)||!L.Z.isConstant(t.outlineWidth)||!L.Z.isConstant(t.numberOfVerticalLines)},o0.prototype._setStaticOptions=function(e,t){let i=L.Z.getValueOrDefault(t.heightReference,na.MINIMUM_VALUE,D.ZP.NONE),n=this._options;n.vertexFormat=this._materialProperty instanceof ny.Z?ng.Z.VERTEX_FORMAT:n_.MaterialSupport.TEXTURED.vertexFormat,n.length=t.length.getValue(na.MINIMUM_VALUE),n.topRadius=t.topRadius.getValue(na.MINIMUM_VALUE),n.bottomRadius=t.bottomRadius.getValue(na.MINIMUM_VALUE),n.slices=L.Z.getValueOrUndefined(t.slices,na.MINIMUM_VALUE),n.numberOfVerticalLines=L.Z.getValueOrUndefined(t.numberOfVerticalLines,na.MINIMUM_VALUE),n.offsetAttribute=i!==D.ZP.NONE?nS.Z.ALL:void 0},o0.prototype._onEntityPropertyChanged=nW,o0.DynamicGeometryUpdater=o1,(0,_.Z)(Object.create)&&(o1.prototype=Object.create(nD.prototype),o1.prototype.constructor=o1),o1.prototype._isHidden=function(e,t,i){let n=this._options,r=L.Z.getValueOrUndefined(e.position,i,oK);return!(0,_.Z)(r)||!(0,_.Z)(n.length)||!(0,_.Z)(n.topRadius)||!(0,_.Z)(n.bottomRadius)||nD.prototype._isHidden.call(this,e,t,i)},o1.prototype._setOptions=function(e,t,i){let n=L.Z.getValueOrDefault(t.heightReference,i,D.ZP.NONE),r=this._options;r.length=L.Z.getValueOrUndefined(t.length,i),r.topRadius=L.Z.getValueOrUndefined(t.topRadius,i),r.bottomRadius=L.Z.getValueOrUndefined(t.bottomRadius,i),r.slices=L.Z.getValueOrUndefined(t.slices,i),r.numberOfVerticalLines=L.Z.getValueOrUndefined(t.numberOfVerticalLines,i),r.offsetAttribute=n!==D.ZP.NONE?nS.Z.ALL:void 0};let o2={},o3=new S.Z,o4=new S.Z,o5=new n5.Z,o9=new n2.Z;function o8(e,t,i,n,r,o,a,s,l,c){let u=e+t;S.Z.multiplyByScalar(n,Math.cos(u),o3),S.Z.multiplyByScalar(i,Math.sin(u),o4),S.Z.add(o3,o4,o3);let h=Math.cos(e);h*=h;let d=Math.sin(e);d*=d;let f=o/Math.sqrt(a*h+r*d);return n5.Z.fromAxisAngle(o3,f/s,o5),n2.Z.fromQuaternion(o5,o9),n2.Z.multiplyByVector(o9,l,c),S.Z.normalize(c,c),S.Z.multiplyByScalar(c,s,c),c}let o6=new S.Z,o7=new S.Z,ae=new S.Z,at=new S.Z;o2.raisePositionsToHeight=function(e,t,i){let n=t.ellipsoid,r=t.height,o=t.extrudedHeight,a=new Float64Array(3*(i?e.length/3*2:e.length/3)),s=e.length,l=i?s:0;for(let t=0;t<s;t+=3){let s=t+1,c=t+2,u=S.Z.fromArray(e,t,o6);n.scaleToGeodeticSurface(u,u);let h=S.Z.clone(u,o7),d=n.geodeticSurfaceNormal(u,at),f=S.Z.multiplyByScalar(d,r,ae);S.Z.add(u,f,u),i&&(S.Z.multiplyByScalar(d,o,f),S.Z.add(h,f,h),a[t+l]=h.x,a[s+l]=h.y,a[c+l]=h.z),a[t]=u.x,a[s]=u.y,a[c]=u.z}return a};let ai=new S.Z,an=new S.Z,ar=new S.Z;o2.computeEllipsePositions=function(e,t,i){let n,r,o,a,s;let l=e.semiMinorAxis,c=e.semiMajorAxis,u=e.rotation,h=e.center,d=8*e.granularity,f=l*l,p=c*c,m=c*l,_=S.Z.magnitude(h),g=S.Z.normalize(h,ai),Z=S.Z.cross(S.Z.UNIT_Z,h,an);Z=S.Z.normalize(Z,Z);let y=S.Z.cross(g,Z,ar),b=1+Math.ceil(eB.Z.PI_OVER_TWO/d),v=eB.Z.PI_OVER_TWO/(b-1),T=eB.Z.PI_OVER_TWO-b*v;T<0&&(b-=Math.ceil(Math.abs(T)/v));let E=b*(b+2)*2,x=t?Array(3*E):void 0,w=0,C=o6,A=o7,I=12*b,O=I-1,D=0,P=i?Array(I):void 0;for(C=o8(T=eB.Z.PI_OVER_TWO,u,y,Z,f,m,p,_,g,C),t&&(x[w++]=C.x,x[w++]=C.y,x[w++]=C.z),i&&(P[O--]=C.z,P[O--]=C.y,P[O--]=C.x),T=eB.Z.PI_OVER_TWO-v,n=1;n<b+1;++n){if(C=o8(T,u,y,Z,f,m,p,_,g,C),A=o8(Math.PI-T,u,y,Z,f,m,p,_,g,A),t){for(r=1,x[w++]=C.x,x[w++]=C.y,x[w++]=C.z,o=2*n+2;r<o-1;++r)a=r/(o-1),s=S.Z.lerp(C,A,a,ae),x[w++]=s.x,x[w++]=s.y,x[w++]=s.z;x[w++]=A.x,x[w++]=A.y,x[w++]=A.z}i&&(P[O--]=C.z,P[O--]=C.y,P[O--]=C.x,P[D++]=A.x,P[D++]=A.y,P[D++]=A.z),T=eB.Z.PI_OVER_TWO-(n+1)*v}for(n=b;n>1;--n){if(C=o8(-(T=eB.Z.PI_OVER_TWO-(n-1)*v),u,y,Z,f,m,p,_,g,C),A=o8(T+Math.PI,u,y,Z,f,m,p,_,g,A),t){for(r=1,x[w++]=C.x,x[w++]=C.y,x[w++]=C.z,o=2*(n-1)+2;r<o-1;++r)a=r/(o-1),s=S.Z.lerp(C,A,a,ae),x[w++]=s.x,x[w++]=s.y,x[w++]=s.z;x[w++]=A.x,x[w++]=A.y,x[w++]=A.z}i&&(P[O--]=C.z,P[O--]=C.y,P[O--]=C.x,P[D++]=A.x,P[D++]=A.y,P[D++]=A.z)}C=o8(-(T=eB.Z.PI_OVER_TWO),u,y,Z,f,m,p,_,g,C);let R={};return t&&(x[w++]=C.x,x[w++]=C.y,x[w++]=C.z,R.positions=x,R.numPts=b),i&&(P[O--]=C.z,P[O--]=C.y,P[O--]=C.x,R.outerPositions=P),R};var ao=i(4754),aa=i(2926);let as=new S.Z,al=new S.Z,ac=new S.Z,au=new S.Z,ah=new w.Z,ad=new n2.Z,af=new n2.Z,ap=new n5.Z,am=new S.Z,a_=new S.Z,ag=new S.Z,aZ=new ea.Z,ay=new S.Z,ab=new w.Z,av=new w.Z;function aT(e,t,i){let n=t.vertexFormat,r=t.center,o=t.semiMajorAxis,a=t.semiMinorAxis,s=t.ellipsoid,l=t.stRotation,c=i?e.length/3*2:e.length/3,u=t.shadowVolume,h=n.st?new Float32Array(2*c):void 0,d=n.normal?new Float32Array(3*c):void 0,f=n.tangent?new Float32Array(3*c):void 0,p=n.bitangent?new Float32Array(3*c):void 0,m=u?new Float32Array(3*c):void 0,g=0,Z=am,y=a_,b=ag,v=new ao.Z(s),T=v.project(s.cartesianToCartographic(r,aZ),ay),E=s.scaleToGeodeticSurface(r,as);s.geodeticSurfaceNormal(E,E);let x=ad,C=af;if(0!==l){let e=n5.Z.fromAxisAngle(E,l,ap);x=n2.Z.fromQuaternion(e,x),e=n5.Z.fromAxisAngle(E,-l,ap),C=n2.Z.fromQuaternion(e,C)}else x=n2.Z.clone(n2.Z.IDENTITY,x),C=n2.Z.clone(n2.Z.IDENTITY,C);let A=w.Z.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,ab),I=w.Z.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,av),O=e.length,D=i?O:0,P=D/3*2;for(let t=0;t<O;t+=3){let r=t+1,l=t+2,c=S.Z.fromArray(e,t,as);if(n.st){let e=n2.Z.multiplyByVector(x,c,al),t=v.project(s.cartesianToCartographic(e,aZ),ac);S.Z.subtract(t,T,t),ah.x=(t.x+o)/(2*o),ah.y=(t.y+a)/(2*a),A.x=Math.min(ah.x,A.x),A.y=Math.min(ah.y,A.y),I.x=Math.max(ah.x,I.x),I.y=Math.max(ah.y,I.y),i&&(h[g+P]=ah.x,h[g+1+P]=ah.y),h[g++]=ah.x,h[g++]=ah.y}(n.normal||n.tangent||n.bitangent||u)&&(Z=s.geodeticSurfaceNormal(c,Z),u&&(m[t+D]=-Z.x,m[r+D]=-Z.y,m[l+D]=-Z.z),(n.normal||n.tangent||n.bitangent)&&((n.tangent||n.bitangent)&&(y=S.Z.normalize(S.Z.cross(S.Z.UNIT_Z,Z,y),y),n2.Z.multiplyByVector(C,y,y)),n.normal&&(d[t]=Z.x,d[r]=Z.y,d[l]=Z.z,i&&(d[t+D]=-Z.x,d[r+D]=-Z.y,d[l+D]=-Z.z)),n.tangent&&(f[t]=y.x,f[r]=y.y,f[l]=y.z,i&&(f[t+D]=-y.x,f[r+D]=-y.y,f[l+D]=-y.z)),n.bitangent&&(b=S.Z.normalize(S.Z.cross(Z,y,b),b),p[t]=b.x,p[r]=b.y,p[l]=b.z,i&&(p[t+D]=b.x,p[r+D]=b.y,p[l+D]=b.z))))}if(n.st){O=h.length;for(let e=0;e<O;e+=2)h[e]=(h[e]-A.x)/(I.x-A.x),h[e+1]=(h[e+1]-A.y)/(I.y-A.y)}let R=new r3.Z;if(n.position){let n=o2.raisePositionsToHeight(e,t,i);R.position=new r2.Z({componentDatatype:eM.Z.DOUBLE,componentsPerAttribute:3,values:n})}if(n.st&&(R.st=new r2.Z({componentDatatype:eM.Z.FLOAT,componentsPerAttribute:2,values:h})),n.normal&&(R.normal=new r2.Z({componentDatatype:eM.Z.FLOAT,componentsPerAttribute:3,values:d})),n.tangent&&(R.tangent=new r2.Z({componentDatatype:eM.Z.FLOAT,componentsPerAttribute:3,values:f})),n.bitangent&&(R.bitangent=new r2.Z({componentDatatype:eM.Z.FLOAT,componentsPerAttribute:3,values:p})),u&&(R.extrudeDirection=new r2.Z({componentDatatype:eM.Z.FLOAT,componentsPerAttribute:3,values:m})),i&&(0,_.Z)(t.offsetAttribute)){let e=new Uint8Array(c);if(t.offsetAttribute===nS.Z.TOP)e=e.fill(1,0,c/2);else{let i=t.offsetAttribute===nS.Z.NONE?0:1;e=e.fill(i)}R.applyOffset=new r2.Z({componentDatatype:eM.Z.UNSIGNED_BYTE,componentsPerAttribute:1,values:e})}return R}function aE(e){let t,i,n,r,o;let a=Array(e*(e+1)*12-6),s=0;for(r=0,t=0,n=1;r<3;r++)a[s++]=n++,a[s++]=t,a[s++]=n;for(r=2;r<e+1;++r){for(o=0,n=r*(r+1)-1,t=(r-1)*r-1,a[s++]=n++,a[s++]=t,a[s++]=n,i=2*r;o<i-1;++o)a[s++]=n,a[s++]=t++,a[s++]=t,a[s++]=n++,a[s++]=t,a[s++]=n;a[s++]=n++,a[s++]=t,a[s++]=n}for(i=2*e,++n,++t,r=0;r<i-1;++r)a[s++]=n,a[s++]=t++,a[s++]=t,a[s++]=n++,a[s++]=t,a[s++]=n;for(a[s++]=n,a[s++]=t++,a[s++]=t,a[s++]=n++,a[s++]=t++,a[s++]=t,++t,r=e-1;r>1;--r){for(o=0,a[s++]=t++,a[s++]=t,a[s++]=n,i=2*r;o<i-1;++o)a[s++]=n,a[s++]=t++,a[s++]=t,a[s++]=n++,a[s++]=t,a[s++]=n;a[s++]=t++,a[s++]=t++,a[s++]=n++}for(r=0;r<3;r++)a[s++]=t++,a[s++]=t,a[s++]=n;return a}let ax=new S.Z,aw=new f.Z,aS=new f.Z;function aC(e,t,i,n,r,o,a){let s=o2.computeEllipsePositions({center:e,semiMajorAxis:t,semiMinorAxis:i,rotation:n,granularity:r},!1,!0).outerPositions,l=s.length/3,c=Array(l);for(let e=0;e<l;++e)c[e]=S.Z.fromArray(s,3*e);let u=r5.Z.fromCartesianArray(c,o,a);return u.width>eB.Z.PI&&(u.north=u.north>0?eB.Z.PI_OVER_TWO-eB.Z.EPSILON7:u.north,u.south=u.south<0?eB.Z.EPSILON7-eB.Z.PI_OVER_TWO:u.south,u.east=eB.Z.PI,u.west=-eB.Z.PI),u}function aA(e){let t=(e=(0,m.Z)(e,m.Z.EMPTY_OBJECT)).center,i=(0,m.Z)(e.ellipsoid,el.Z.WGS84),n=e.semiMajorAxis,r=e.semiMinorAxis,o=(0,m.Z)(e.granularity,eB.Z.RADIANS_PER_DEGREE),a=(0,m.Z)(e.vertexFormat,nf.Z.DEFAULT);if(p.Z.defined("options.center",t),p.Z.typeOf.number("options.semiMajorAxis",n),p.Z.typeOf.number("options.semiMinorAxis",r),n<r)throw new A.Z("semiMajorAxis must be greater than or equal to the semiMinorAxis.");if(o<=0)throw new A.Z("granularity must be greater than zero.");let s=(0,m.Z)(e.height,0),l=(0,m.Z)(e.extrudedHeight,s);this._center=S.Z.clone(t),this._semiMajorAxis=n,this._semiMinorAxis=r,this._ellipsoid=el.Z.clone(i),this._rotation=(0,m.Z)(e.rotation,0),this._stRotation=(0,m.Z)(e.stRotation,0),this._height=Math.max(l,s),this._granularity=o,this._vertexFormat=nf.Z.clone(a),this._extrudedHeight=Math.min(l,s),this._shadowVolume=(0,m.Z)(e.shadowVolume,!1),this._workerName="createEllipseGeometry",this._offsetAttribute=e.offsetAttribute,this._rectangle=void 0,this._textureCoordinateRotationPoints=void 0}aA.packedLength=S.Z.packedLength+el.Z.packedLength+nf.Z.packedLength+9,aA.pack=function(e,t,i){return p.Z.defined("value",e),p.Z.defined("array",t),i=(0,m.Z)(i,0),S.Z.pack(e._center,t,i),i+=S.Z.packedLength,el.Z.pack(e._ellipsoid,t,i),i+=el.Z.packedLength,nf.Z.pack(e._vertexFormat,t,i),i+=nf.Z.packedLength,t[i++]=e._semiMajorAxis,t[i++]=e._semiMinorAxis,t[i++]=e._rotation,t[i++]=e._stRotation,t[i++]=e._height,t[i++]=e._granularity,t[i++]=e._extrudedHeight,t[i++]=e._shadowVolume?1:0,t[i]=(0,m.Z)(e._offsetAttribute,-1),t};let aI=new S.Z,aO=new el.Z,aD=new nf.Z,aP={center:aI,ellipsoid:aO,vertexFormat:aD,semiMajorAxis:void 0,semiMinorAxis:void 0,rotation:void 0,stRotation:void 0,height:void 0,granularity:void 0,extrudedHeight:void 0,shadowVolume:void 0,offsetAttribute:void 0};aA.unpack=function(e,t,i){p.Z.defined("array",e),t=(0,m.Z)(t,0);let n=S.Z.unpack(e,t,aI);t+=S.Z.packedLength;let r=el.Z.unpack(e,t,aO);t+=el.Z.packedLength;let o=nf.Z.unpack(e,t,aD);t+=nf.Z.packedLength;let a=e[t++],s=e[t++],l=e[t++],c=e[t++],u=e[t++],h=e[t++],d=e[t++],f=1===e[t++],g=e[t];return(0,_.Z)(i)?(i._center=S.Z.clone(n,i._center),i._ellipsoid=el.Z.clone(r,i._ellipsoid),i._vertexFormat=nf.Z.clone(o,i._vertexFormat),i._semiMajorAxis=a,i._semiMinorAxis=s,i._rotation=l,i._stRotation=c,i._height=u,i._granularity=h,i._extrudedHeight=d,i._shadowVolume=f,i._offsetAttribute=-1===g?void 0:g,i):(aP.height=u,aP.extrudedHeight=d,aP.granularity=h,aP.stRotation=c,aP.rotation=l,aP.semiMajorAxis=a,aP.semiMinorAxis=s,aP.shadowVolume=f,aP.offsetAttribute=-1===g?void 0:g,new aA(aP))},aA.computeRectangle=function(e,t){let i=(e=(0,m.Z)(e,m.Z.EMPTY_OBJECT)).center,n=(0,m.Z)(e.ellipsoid,el.Z.WGS84),r=e.semiMajorAxis,o=e.semiMinorAxis,a=(0,m.Z)(e.granularity,eB.Z.RADIANS_PER_DEGREE),s=(0,m.Z)(e.rotation,0);if(p.Z.defined("options.center",i),p.Z.typeOf.number("options.semiMajorAxis",r),p.Z.typeOf.number("options.semiMinorAxis",o),r<o)throw new A.Z("semiMajorAxis must be greater than or equal to the semiMinorAxis.");if(a<=0)throw new A.Z("granularity must be greater than zero.");return aC(i,r,o,s,a,n,t)},aA.createGeometry=function(e){let t;if(e._semiMajorAxis<=0||e._semiMinorAxis<=0)return;let i=e._height,n=e._extrudedHeight,r=!eB.Z.equalsEpsilon(i,n,0,eB.Z.EPSILON2);e._center=e._ellipsoid.scaleToGeodeticSurface(e._center,e._center);let o={center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:e._ellipsoid,rotation:e._rotation,height:i,granularity:e._granularity,vertexFormat:e._vertexFormat,stRotation:e._stRotation};if(r)o.extrudedHeight=n,o.shadowVolume=e._shadowVolume,o.offsetAttribute=e._offsetAttribute,t=function(e){let t=e.center,i=e.ellipsoid,n=e.semiMajorAxis,r=S.Z.multiplyByScalar(i.geodeticSurfaceNormal(t,as),e.height,as);aw.center=S.Z.add(t,r,aw.center),aw.radius=n,r=S.Z.multiplyByScalar(i.geodeticSurfaceNormal(t,r),e.extrudedHeight,r),aS.center=S.Z.add(t,r,aS.center),aS.radius=n;let o=o2.computeEllipsePositions(e,!0,!0),a=o.positions,s=o.numPts,l=o.outerPositions,c=f.Z.union(aw,aS),u=aT(a,e,!0),h=aE(s),d=h.length;h.length=2*d;let p=a.length/3;for(let e=0;e<d;e+=3)h[e+d]=h[e+2]+p,h[e+1+d]=h[e+1]+p,h[e+2+d]=h[e]+p;let m=ez.Z.createTypedArray(2*p/3,h),g=new r1.Z({attributes:u,indices:m,primitiveType:iT.Z.TRIANGLES}),Z=function(e,t){let i=t.vertexFormat,n=t.center,r=t.semiMajorAxis,o=t.semiMinorAxis,a=t.ellipsoid,s=t.height,l=t.extrudedHeight,c=t.stRotation,u=e.length/3*2,h=new Float64Array(3*u),d=i.st?new Float32Array(2*u):void 0,f=i.normal?new Float32Array(3*u):void 0,p=i.tangent?new Float32Array(3*u):void 0,m=i.bitangent?new Float32Array(3*u):void 0,g=t.shadowVolume,Z=g?new Float32Array(3*u):void 0,y=0,b=am,v=a_,T=ag,E=new ao.Z(a),x=E.project(a.cartesianToCartographic(n,aZ),ay),C=a.scaleToGeodeticSurface(n,as);a.geodeticSurfaceNormal(C,C);let A=n5.Z.fromAxisAngle(C,c,ap),I=n2.Z.fromQuaternion(A,ad),O=w.Z.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,ab),D=w.Z.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,av),P=e.length,R=P/3*2;for(let t=0;t<P;t+=3){let n;let c=t+1,u=t+2,_=S.Z.fromArray(e,t,as);if(i.st){let e=n2.Z.multiplyByVector(I,_,al),t=E.project(a.cartesianToCartographic(e,aZ),ac);S.Z.subtract(t,x,t),ah.x=(t.x+r)/(2*r),ah.y=(t.y+o)/(2*o),O.x=Math.min(ah.x,O.x),O.y=Math.min(ah.y,O.y),D.x=Math.max(ah.x,D.x),D.y=Math.max(ah.y,D.y),d[y+R]=ah.x,d[y+1+R]=ah.y,d[y++]=ah.x,d[y++]=ah.y}_=a.scaleToGeodeticSurface(_,_),n=S.Z.clone(_,al),b=a.geodeticSurfaceNormal(_,b),g&&(Z[t+P]=-b.x,Z[c+P]=-b.y,Z[u+P]=-b.z);let w=S.Z.multiplyByScalar(b,s,au);if(_=S.Z.add(_,w,_),w=S.Z.multiplyByScalar(b,l,w),n=S.Z.add(n,w,n),i.position&&(h[t+P]=n.x,h[c+P]=n.y,h[u+P]=n.z,h[t]=_.x,h[c]=_.y,h[u]=_.z),i.normal||i.tangent||i.bitangent){T=S.Z.clone(b,T);let r=S.Z.fromArray(e,(t+3)%P,au);S.Z.subtract(r,_,r);let o=S.Z.subtract(n,_,ac);b=S.Z.normalize(S.Z.cross(o,r,b),b),i.normal&&(f[t]=b.x,f[c]=b.y,f[u]=b.z,f[t+P]=b.x,f[c+P]=b.y,f[u+P]=b.z),i.tangent&&(v=S.Z.normalize(S.Z.cross(T,b,v),v),p[t]=v.x,p[c]=v.y,p[u]=v.z,p[t+P]=v.x,p[t+1+P]=v.y,p[t+2+P]=v.z),i.bitangent&&(m[t]=T.x,m[c]=T.y,m[u]=T.z,m[t+P]=T.x,m[c+P]=T.y,m[u+P]=T.z)}}if(i.st){P=d.length;for(let e=0;e<P;e+=2)d[e]=(d[e]-O.x)/(D.x-O.x),d[e+1]=(d[e+1]-O.y)/(D.y-O.y)}let N=new r3.Z;if(i.position&&(N.position=new r2.Z({componentDatatype:eM.Z.DOUBLE,componentsPerAttribute:3,values:h})),i.st&&(N.st=new r2.Z({componentDatatype:eM.Z.FLOAT,componentsPerAttribute:2,values:d})),i.normal&&(N.normal=new r2.Z({componentDatatype:eM.Z.FLOAT,componentsPerAttribute:3,values:f})),i.tangent&&(N.tangent=new r2.Z({componentDatatype:eM.Z.FLOAT,componentsPerAttribute:3,values:p})),i.bitangent&&(N.bitangent=new r2.Z({componentDatatype:eM.Z.FLOAT,componentsPerAttribute:3,values:m})),g&&(N.extrudeDirection=new r2.Z({componentDatatype:eM.Z.FLOAT,componentsPerAttribute:3,values:Z})),(0,_.Z)(t.offsetAttribute)){let e=new Uint8Array(u);if(t.offsetAttribute===nS.Z.TOP)e=e.fill(1,0,u/2);else{let i=t.offsetAttribute===nS.Z.NONE?0:1;e=e.fill(i)}N.applyOffset=new r2.Z({componentDatatype:eM.Z.UNSIGNED_BYTE,componentsPerAttribute:1,values:e})}return N}(l,e);h=function(e){let t=e.length/3,i=ez.Z.createTypedArray(t,6*t),n=0;for(let e=0;e<t;e++){let r=e,o=e+t,a=(r+1)%t,s=a+t;i[n++]=r,i[n++]=o,i[n++]=a,i[n++]=a,i[n++]=o,i[n++]=s}return i}(l);let y=ez.Z.createTypedArray(2*l.length/3,h),b=new r1.Z({attributes:Z,indices:y,primitiveType:iT.Z.TRIANGLES}),v=aa.Z.combineInstances([new nw.Z({geometry:g}),new nw.Z({geometry:b})]);return{boundingSphere:c,attributes:v[0].attributes,indices:v[0].indices}}(o);else if(t=function(e){let t=e.center;ax=S.Z.multiplyByScalar(e.ellipsoid.geodeticSurfaceNormal(t,ax),e.height,ax),ax=S.Z.add(t,ax,ax);let i=new f.Z(ax,e.semiMajorAxis),n=o2.computeEllipsePositions(e,!0,!1),r=n.positions,o=n.numPts,a=aT(r,e,!1),s=aE(o);return{boundingSphere:i,attributes:a,indices:s=ez.Z.createTypedArray(r.length/3,s)}}(o),(0,_.Z)(e._offsetAttribute)){let i=t.attributes.position.values.length,n=e._offsetAttribute===nS.Z.NONE?0:1,r=new Uint8Array(i/3).fill(n);t.attributes.applyOffset=new r2.Z({componentDatatype:eM.Z.UNSIGNED_BYTE,componentsPerAttribute:1,values:r})}return new r1.Z({attributes:t.attributes,indices:t.indices,primitiveType:iT.Z.TRIANGLES,boundingSphere:t.boundingSphere,offsetAttribute:e._offsetAttribute})},aA.createShadowVolume=function(e,t,i){let n=e._granularity,r=e._ellipsoid,o=t(n,r),a=i(n,r);return new aA({center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:r,rotation:e._rotation,stRotation:e._stRotation,granularity:n,extrudedHeight:o,height:a,vertexFormat:nf.Z.POSITION_ONLY,shadowVolume:!0})},Object.defineProperties(aA.prototype,{rectangle:{get:function(){return(0,_.Z)(this._rectangle)||(this._rectangle=aC(this._center,this._semiMajorAxis,this._semiMinorAxis,this._rotation,this._granularity,this._ellipsoid)),this._rectangle}},textureCoordinateRotationPoints:{get:function(){return(0,_.Z)(this._textureCoordinateRotationPoints)||(this._textureCoordinateRotationPoints=function(e){let t=-e._stRotation;if(0===t)return[0,0,0,1,1,0];let i=o2.computeEllipsePositions({center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,rotation:e._rotation,granularity:e._granularity},!1,!0).outerPositions,n=i.length/3,r=Array(n);for(let e=0;e<n;++e)r[e]=S.Z.fromArray(i,3*e);let o=e._ellipsoid,a=e.rectangle;return r1.Z._textureCoordinateRotationPoints(r,t,o,a)}(this)),this._textureCoordinateRotationPoints}}});let aR=new S.Z,aN=new S.Z,aL=new f.Z,aM=new f.Z;function aF(e){let t=(e=(0,m.Z)(e,m.Z.EMPTY_OBJECT)).center,i=(0,m.Z)(e.ellipsoid,el.Z.WGS84),n=e.semiMajorAxis,r=e.semiMinorAxis,o=(0,m.Z)(e.granularity,eB.Z.RADIANS_PER_DEGREE);if(!(0,_.Z)(t))throw new A.Z("center is required.");if(!(0,_.Z)(n))throw new A.Z("semiMajorAxis is required.");if(!(0,_.Z)(r))throw new A.Z("semiMinorAxis is required.");if(n<r)throw new A.Z("semiMajorAxis must be greater than or equal to the semiMinorAxis.");if(o<=0)throw new A.Z("granularity must be greater than zero.");let a=(0,m.Z)(e.height,0),s=(0,m.Z)(e.extrudedHeight,a);this._center=S.Z.clone(t),this._semiMajorAxis=n,this._semiMinorAxis=r,this._ellipsoid=el.Z.clone(i),this._rotation=(0,m.Z)(e.rotation,0),this._height=Math.max(s,a),this._granularity=o,this._extrudedHeight=Math.min(s,a),this._numberOfVerticalLines=Math.max((0,m.Z)(e.numberOfVerticalLines,16),0),this._offsetAttribute=e.offsetAttribute,this._workerName="createEllipseOutlineGeometry"}aF.packedLength=S.Z.packedLength+el.Z.packedLength+8,aF.pack=function(e,t,i){if(!(0,_.Z)(e))throw new A.Z("value is required");if(!(0,_.Z)(t))throw new A.Z("array is required");return i=(0,m.Z)(i,0),S.Z.pack(e._center,t,i),i+=S.Z.packedLength,el.Z.pack(e._ellipsoid,t,i),i+=el.Z.packedLength,t[i++]=e._semiMajorAxis,t[i++]=e._semiMinorAxis,t[i++]=e._rotation,t[i++]=e._height,t[i++]=e._granularity,t[i++]=e._extrudedHeight,t[i++]=e._numberOfVerticalLines,t[i]=(0,m.Z)(e._offsetAttribute,-1),t};let az=new S.Z,aB=new el.Z,aU={center:az,ellipsoid:aB,semiMajorAxis:void 0,semiMinorAxis:void 0,rotation:void 0,height:void 0,granularity:void 0,extrudedHeight:void 0,numberOfVerticalLines:void 0,offsetAttribute:void 0};aF.unpack=function(e,t,i){if(!(0,_.Z)(e))throw new A.Z("array is required");t=(0,m.Z)(t,0);let n=S.Z.unpack(e,t,az);t+=S.Z.packedLength;let r=el.Z.unpack(e,t,aB);t+=el.Z.packedLength;let o=e[t++],a=e[t++],s=e[t++],l=e[t++],c=e[t++],u=e[t++],h=e[t++],d=e[t];return(0,_.Z)(i)?(i._center=S.Z.clone(n,i._center),i._ellipsoid=el.Z.clone(r,i._ellipsoid),i._semiMajorAxis=o,i._semiMinorAxis=a,i._rotation=s,i._height=l,i._granularity=c,i._extrudedHeight=u,i._numberOfVerticalLines=h,i._offsetAttribute=-1===d?void 0:d,i):(aU.height=l,aU.extrudedHeight=u,aU.granularity=c,aU.rotation=s,aU.semiMajorAxis=o,aU.semiMinorAxis=a,aU.numberOfVerticalLines=h,aU.offsetAttribute=-1===d?void 0:d,new aF(aU))},aF.createGeometry=function(e){let t;if(e._semiMajorAxis<=0||e._semiMinorAxis<=0)return;let i=e._height,n=e._extrudedHeight,r=!eB.Z.equalsEpsilon(i,n,0,eB.Z.EPSILON2);e._center=e._ellipsoid.scaleToGeodeticSurface(e._center,e._center);let o={center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:e._ellipsoid,rotation:e._rotation,height:i,granularity:e._granularity,numberOfVerticalLines:e._numberOfVerticalLines};if(r)o.extrudedHeight=n,o.offsetAttribute=e._offsetAttribute,t=function(e){let t,i;let n=e.center,r=e.ellipsoid,o=e.semiMajorAxis,a=S.Z.multiplyByScalar(r.geodeticSurfaceNormal(n,aR),e.height,aR);aL.center=S.Z.add(n,a,aL.center),aL.radius=o,a=S.Z.multiplyByScalar(r.geodeticSurfaceNormal(n,a),e.extrudedHeight,a),aM.center=S.Z.add(n,a,aM.center),aM.radius=o;let s=o2.computeEllipsePositions(e,!1,!0).outerPositions,l=new r3.Z({position:new r2.Z({componentDatatype:eM.Z.DOUBLE,componentsPerAttribute:3,values:o2.raisePositionsToHeight(s,e,!0)})});s=l.position.values;let c=f.Z.union(aL,aM),u=s.length/3;if((0,_.Z)(e.offsetAttribute)){let t=new Uint8Array(u);if(e.offsetAttribute===nS.Z.TOP)t=t.fill(1,0,u/2);else{let i=e.offsetAttribute===nS.Z.NONE?0:1;t=t.fill(i)}l.applyOffset=new r2.Z({componentDatatype:eM.Z.UNSIGNED_BYTE,componentsPerAttribute:1,values:t})}let h=(0,m.Z)(e.numberOfVerticalLines,16);h=eB.Z.clamp(h,0,u/2);let d=ez.Z.createTypedArray(u,2*u+2*h);u/=2;let p=0;for(t=0;t<u;++t)d[p++]=t,d[p++]=(t+1)%u,d[p++]=t+u,d[p++]=(t+1)%u+u;if(h>0){let e=Math.min(h,u),n=Math.min((i=Math.round(u/e))*h,u);for(t=0;t<n;t+=i)d[p++]=t,d[p++]=t+u}return{boundingSphere:c,attributes:l,indices:d}}(o);else if(t=function(e){let t=e.center;aN=S.Z.multiplyByScalar(e.ellipsoid.geodeticSurfaceNormal(t,aN),e.height,aN),aN=S.Z.add(t,aN,aN);let i=new f.Z(aN,e.semiMajorAxis),n=o2.computeEllipsePositions(e,!1,!0).outerPositions,r=new r3.Z({position:new r2.Z({componentDatatype:eM.Z.DOUBLE,componentsPerAttribute:3,values:o2.raisePositionsToHeight(n,e,!1)})}),o=n.length/3,a=ez.Z.createTypedArray(o,2*o),s=0;for(let e=0;e<o;++e)a[s++]=e,a[s++]=(e+1)%o;return{boundingSphere:i,attributes:r,indices:a}}(o),(0,_.Z)(e._offsetAttribute)){let i=t.attributes.position.values.length,n=e._offsetAttribute===nS.Z.NONE?0:1,r=new Uint8Array(i/3).fill(n);t.attributes.applyOffset=new r2.Z({componentDatatype:eM.Z.UNSIGNED_BYTE,componentsPerAttribute:1,values:r})}return new r1.Z({attributes:t.attributes,indices:t.indices,primitiveType:iT.Z.LINES,boundingSphere:t.boundingSphere,offsetAttribute:e._offsetAttribute})};let ak=new C.Z,aV=S.Z.ZERO,aH=new S.Z,aG=new r5.Z;function aj(e){this.id=e,this.vertexFormat=void 0,this.center=void 0,this.semiMajorAxis=void 0,this.semiMinorAxis=void 0,this.rotation=void 0,this.height=void 0,this.extrudedHeight=void 0,this.granularity=void 0,this.stRotation=void 0,this.numberOfVerticalLines=void 0,this.offsetAttribute=void 0}function aW(e,t){oI.call(this,{entity:e,scene:t,geometryOptions:new aj(e),geometryPropertyName:"ellipse",observedPropertyNames:["availability","position","ellipse"]}),this._onEntityPropertyChanged(e,"ellipse",e.ellipse,void 0)}function aq(e,t,i){nD.call(this,e,t,i)}(0,_.Z)(Object.create)&&(aW.prototype=Object.create(oI.prototype),aW.prototype.constructor=aW),aW.prototype.createFillGeometryInstance=function(e){if(p.Z.defined("time",e),!this._fillEnabled)throw new A.Z("This instance does not represent a filled geometry.");let t=this._entity,i=t.isAvailable(e),n={show:new nA.Z(i&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),distanceDisplayCondition:nx.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0,color:void 0};if(this._materialProperty instanceof ny.Z){let t;(0,_.Z)(this._materialProperty.color)&&(this._materialProperty.color.isConstant||i)&&(t=this._materialProperty.color.getValue(e,ak)),(0,_.Z)(t)||(t=C.Z.WHITE),n.color=nE.Z.fromColor(t)}return(0,_.Z)(this._options.offsetAttribute)&&(n.offset=nC.Z.fromCartesian3(L.Z.getValueOrDefault(this._terrainOffsetProperty,e,aV,aH))),new nw.Z({id:t,geometry:new aA(this._options),attributes:n})},aW.prototype.createOutlineGeometryInstance=function(e){if(p.Z.defined("time",e),!this._outlineEnabled)throw new A.Z("This instance does not represent an outlined geometry.");let t=this._entity,i=t.isAvailable(e),n=L.Z.getValueOrDefault(this._outlineColorProperty,e,C.Z.BLACK,ak),r=this._distanceDisplayConditionProperty.getValue(e),o={show:new nA.Z(i&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:nE.Z.fromColor(n),distanceDisplayCondition:nx.fromDistanceDisplayCondition(r),offset:void 0};return(0,_.Z)(this._options.offsetAttribute)&&(o.offset=nC.Z.fromCartesian3(L.Z.getValueOrDefault(this._terrainOffsetProperty,e,aV,aH))),new nw.Z({id:t,geometry:new aF(this._options),attributes:o})},aW.prototype._computeCenter=function(e,t){return L.Z.getValueOrUndefined(this._entity.position,e,t)},aW.prototype._isHidden=function(e,t){let i=e.position;return!(0,_.Z)(i)||!(0,_.Z)(t.semiMajorAxis)||!(0,_.Z)(t.semiMinorAxis)||nV.prototype._isHidden.call(this,e,t)},aW.prototype._isDynamic=function(e,t){return!e.position.isConstant||!t.semiMajorAxis.isConstant||!t.semiMinorAxis.isConstant||!L.Z.isConstant(t.rotation)||!L.Z.isConstant(t.height)||!L.Z.isConstant(t.extrudedHeight)||!L.Z.isConstant(t.granularity)||!L.Z.isConstant(t.stRotation)||!L.Z.isConstant(t.outlineWidth)||!L.Z.isConstant(t.numberOfVerticalLines)||!L.Z.isConstant(t.zIndex)||this._onTerrain&&!L.Z.isConstant(this._materialProperty)&&!(this._materialProperty instanceof ny.Z)},aW.prototype._setStaticOptions=function(e,t){let i=L.Z.getValueOrUndefined(t.height,na.MINIMUM_VALUE),n=L.Z.getValueOrDefault(t.heightReference,na.MINIMUM_VALUE,D.ZP.NONE),r=L.Z.getValueOrUndefined(t.extrudedHeight,na.MINIMUM_VALUE),o=L.Z.getValueOrDefault(t.extrudedHeightReference,na.MINIMUM_VALUE,D.ZP.NONE);(0,_.Z)(r)&&!(0,_.Z)(i)&&(i=0);let a=this._options;a.vertexFormat=this._materialProperty instanceof ny.Z?ng.Z.VERTEX_FORMAT:n_.MaterialSupport.TEXTURED.vertexFormat,a.center=e.position.getValue(na.MINIMUM_VALUE,a.center),a.semiMajorAxis=t.semiMajorAxis.getValue(na.MINIMUM_VALUE,a.semiMajorAxis),a.semiMinorAxis=t.semiMinorAxis.getValue(na.MINIMUM_VALUE,a.semiMinorAxis),a.rotation=L.Z.getValueOrUndefined(t.rotation,na.MINIMUM_VALUE),a.granularity=L.Z.getValueOrUndefined(t.granularity,na.MINIMUM_VALUE),a.stRotation=L.Z.getValueOrUndefined(t.stRotation,na.MINIMUM_VALUE),a.numberOfVerticalLines=L.Z.getValueOrUndefined(t.numberOfVerticalLines,na.MINIMUM_VALUE),a.offsetAttribute=oI.computeGeometryOffsetAttribute(i,n,r,o),a.height=oI.getGeometryHeight(i,n),(r=oI.getGeometryExtrudedHeight(r,o))===oI.CLAMP_TO_GROUND&&(r=d.Z.getMinimumMaximumHeights(aA.computeRectangle(a,aG)).minimumTerrainHeight),a.extrudedHeight=r},aW.DynamicGeometryUpdater=aq,(0,_.Z)(Object.create)&&(aq.prototype=Object.create(nD.prototype),aq.prototype.constructor=aq),aq.prototype._isHidden=function(e,t,i){let n=this._options;return!(0,_.Z)(n.center)||!(0,_.Z)(n.semiMajorAxis)||!(0,_.Z)(n.semiMinorAxis)||nD.prototype._isHidden.call(this,e,t,i)},aq.prototype._setOptions=function(e,t,i){let n=this._options,r=L.Z.getValueOrUndefined(t.height,i),o=L.Z.getValueOrDefault(t.heightReference,i,D.ZP.NONE),a=L.Z.getValueOrUndefined(t.extrudedHeight,i),s=L.Z.getValueOrDefault(t.extrudedHeightReference,i,D.ZP.NONE);(0,_.Z)(a)&&!(0,_.Z)(r)&&(r=0),n.center=L.Z.getValueOrUndefined(e.position,i,n.center),n.semiMajorAxis=L.Z.getValueOrUndefined(t.semiMajorAxis,i),n.semiMinorAxis=L.Z.getValueOrUndefined(t.semiMinorAxis,i),n.rotation=L.Z.getValueOrUndefined(t.rotation,i),n.granularity=L.Z.getValueOrUndefined(t.granularity,i),n.stRotation=L.Z.getValueOrUndefined(t.stRotation,i),n.numberOfVerticalLines=L.Z.getValueOrUndefined(t.numberOfVerticalLines,i),n.offsetAttribute=oI.computeGeometryOffsetAttribute(r,o,a,s),n.height=oI.getGeometryHeight(r,o),(a=oI.getGeometryExtrudedHeight(a,s))===oI.CLAMP_TO_GROUND&&(a=d.Z.getMinimumMaximumHeights(aA.computeRectangle(n,aG)).minimumTerrainHeight),n.extrudedHeight=a};var aY=i(8385),aX=i(2501);let a$=new ny.Z(C.Z.WHITE),aK=S.Z.ZERO,aQ=new S.Z,aJ=new S.Z,a0=new S.Z,a1=new C.Z,a2=new S.Z(1,1,1);function a3(e){this.id=e,this.vertexFormat=void 0,this.radii=void 0,this.innerRadii=void 0,this.minimumClock=void 0,this.maximumClock=void 0,this.minimumCone=void 0,this.maximumCone=void 0,this.stackPartitions=void 0,this.slicePartitions=void 0,this.subdivisions=void 0,this.offsetAttribute=void 0}function a4(e,t){nV.call(this,{entity:e,scene:t,geometryOptions:new a3(e),geometryPropertyName:"ellipsoid",observedPropertyNames:["availability","position","orientation","ellipsoid"]}),this._onEntityPropertyChanged(e,"ellipsoid",e.ellipsoid,void 0)}function a5(e,t,i){nD.call(this,e,t,i),this._scene=e._scene,this._modelMatrix=new er.Z,this._attributes=void 0,this._outlineAttributes=void 0,this._lastSceneMode=void 0,this._lastShow=void 0,this._lastOutlineShow=void 0,this._lastOutlineWidth=void 0,this._lastOutlineColor=void 0,this._lastOffset=new S.Z,this._material={}}function a9(e){e=(0,m.Z)(e,m.Z.EMPTY_OBJECT);let t=(0,m.Z)(e.vertexFormat,nf.Z.DEFAULT);this._vertexFormat=t,this._workerName="createPlaneGeometry"}(0,_.Z)(Object.create)&&(a4.prototype=Object.create(nV.prototype),a4.prototype.constructor=a4),Object.defineProperties(a4.prototype,{terrainOffsetProperty:{get:function(){return this._terrainOffsetProperty}}}),a4.prototype.createFillGeometryInstance=function(e,t,i){let n;p.Z.defined("time",e);let r=this._entity,o=r.isAvailable(e),a=new nA.Z(o&&r.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),s=this._distanceDisplayConditionProperty.getValue(e),l={show:a,distanceDisplayCondition:nx.fromDistanceDisplayCondition(s),color:void 0,offset:void 0};if(this._materialProperty instanceof ny.Z){let t;(0,_.Z)(this._materialProperty.color)&&(this._materialProperty.color.isConstant||o)&&(t=this._materialProperty.color.getValue(e,a1)),(0,_.Z)(t)||(t=C.Z.WHITE),n=nE.Z.fromColor(t),l.color=n}return(0,_.Z)(this._options.offsetAttribute)&&(l.offset=nC.Z.fromCartesian3(L.Z.getValueOrDefault(this._terrainOffsetProperty,e,aK,aQ))),new nw.Z({id:r,geometry:new aY.Z(this._options),modelMatrix:t?void 0:r.computeModelMatrixForHeightReference(e,r.ellipsoid.heightReference,.5*this._options.radii.z,this._scene.mapProjection.ellipsoid,i),attributes:l})},a4.prototype.createOutlineGeometryInstance=function(e,t,i){p.Z.defined("time",e);let n=this._entity,r=n.isAvailable(e),o=L.Z.getValueOrDefault(this._outlineColorProperty,e,C.Z.BLACK,a1),a=this._distanceDisplayConditionProperty.getValue(e),s={show:new nA.Z(r&&n.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:nE.Z.fromColor(o),distanceDisplayCondition:nx.fromDistanceDisplayCondition(a),offset:void 0};return(0,_.Z)(this._options.offsetAttribute)&&(s.offset=nC.Z.fromCartesian3(L.Z.getValueOrDefault(this._terrainOffsetProperty,e,aK,aQ))),new nw.Z({id:n,geometry:new aX.Z(this._options),modelMatrix:t?void 0:n.computeModelMatrixForHeightReference(e,n.ellipsoid.heightReference,.5*this._options.radii.z,this._scene.mapProjection.ellipsoid,i),attributes:s})},a4.prototype._computeCenter=function(e,t){return L.Z.getValueOrUndefined(this._entity.position,e,t)},a4.prototype._isHidden=function(e,t){return!(0,_.Z)(e.position)||!(0,_.Z)(t.radii)||nV.prototype._isHidden.call(this,e,t)},a4.prototype._isDynamic=function(e,t){return!e.position.isConstant||!L.Z.isConstant(e.orientation)||!t.radii.isConstant||!L.Z.isConstant(t.innerRadii)||!L.Z.isConstant(t.stackPartitions)||!L.Z.isConstant(t.slicePartitions)||!L.Z.isConstant(t.outlineWidth)||!L.Z.isConstant(t.minimumClock)||!L.Z.isConstant(t.maximumClock)||!L.Z.isConstant(t.minimumCone)||!L.Z.isConstant(t.maximumCone)||!L.Z.isConstant(t.subdivisions)},a4.prototype._setStaticOptions=function(e,t){let i=L.Z.getValueOrDefault(t.heightReference,na.MINIMUM_VALUE,D.ZP.NONE),n=this._options;n.vertexFormat=this._materialProperty instanceof ny.Z?ng.Z.VERTEX_FORMAT:n_.MaterialSupport.TEXTURED.vertexFormat,n.radii=t.radii.getValue(na.MINIMUM_VALUE,n.radii),n.innerRadii=L.Z.getValueOrUndefined(t.innerRadii,n.radii),n.minimumClock=L.Z.getValueOrUndefined(t.minimumClock,na.MINIMUM_VALUE),n.maximumClock=L.Z.getValueOrUndefined(t.maximumClock,na.MINIMUM_VALUE),n.minimumCone=L.Z.getValueOrUndefined(t.minimumCone,na.MINIMUM_VALUE),n.maximumCone=L.Z.getValueOrUndefined(t.maximumCone,na.MINIMUM_VALUE),n.stackPartitions=L.Z.getValueOrUndefined(t.stackPartitions,na.MINIMUM_VALUE),n.slicePartitions=L.Z.getValueOrUndefined(t.slicePartitions,na.MINIMUM_VALUE),n.subdivisions=L.Z.getValueOrUndefined(t.subdivisions,na.MINIMUM_VALUE),n.offsetAttribute=i!==D.ZP.NONE?nS.Z.ALL:void 0},a4.prototype._onEntityPropertyChanged=nW,a4.DynamicGeometryUpdater=a5,(0,_.Z)(Object.create)&&(a5.prototype=Object.create(nD.prototype),a5.prototype.constructor=a5),a5.prototype.update=function(e){p.Z.defined("time",e);let t=this._entity,i=t.ellipsoid;if(!t.isShowing||!t.isAvailable(e)||!L.Z.getValueOrDefault(i.show,e,!0)){(0,_.Z)(this._primitive)&&(this._primitive.show=!1),(0,_.Z)(this._outlinePrimitive)&&(this._outlinePrimitive.show=!1);return}let n=L.Z.getValueOrUndefined(i.radii,e,aJ),r=(0,_.Z)(n)?t.computeModelMatrixForHeightReference(e,i.heightReference,.5*n.z,this._scene.mapProjection.ellipsoid,this._modelMatrix):void 0;if(!(0,_.Z)(r)||!(0,_.Z)(n)){(0,_.Z)(this._primitive)&&(this._primitive.show=!1),(0,_.Z)(this._outlinePrimitive)&&(this._outlinePrimitive.show=!1);return}let o=L.Z.getValueOrDefault(i.fill,e,!0),a=L.Z.getValueOrDefault(i.outline,e,!1),s=L.Z.getValueOrClonedDefault(i.outlineColor,e,C.Z.BLACK,a1),l=nO.getValue(e,(0,m.Z)(i.material,a$),this._material),c=L.Z.getValueOrUndefined(i.innerRadii,e,a0),u=L.Z.getValueOrUndefined(i.minimumClock,e),h=L.Z.getValueOrUndefined(i.maximumClock,e),d=L.Z.getValueOrUndefined(i.minimumCone,e),f=L.Z.getValueOrUndefined(i.maximumCone,e),g=L.Z.getValueOrUndefined(i.stackPartitions,e),Z=L.Z.getValueOrUndefined(i.slicePartitions,e),y=L.Z.getValueOrUndefined(i.subdivisions,e),b=L.Z.getValueOrDefault(i.outlineWidth,e,1),v=L.Z.getValueOrDefault(i.heightReference,e,D.ZP.NONE),T=v!==D.ZP.NONE?nS.Z.ALL:void 0,E=this._scene.mode,x=E===eu.Z.SCENE3D&&v===D.ZP.NONE,w=this._options,A=this._geometryUpdater.shadowsProperty.getValue(e),O=this._geometryUpdater.distanceDisplayConditionProperty.getValue(e),P=L.Z.getValueOrDefault(this._geometryUpdater.terrainOffsetProperty,e,aK,aQ);if(!x||this._lastSceneMode!==E||!(0,_.Z)(this._primitive)||w.stackPartitions!==g||w.slicePartitions!==Z||(0,_.Z)(c)&&!S.Z.equals(w.innerRadii!==c)||w.minimumClock!==u||w.maximumClock!==h||w.minimumCone!==d||w.maximumCone!==f||w.subdivisions!==y||this._lastOutlineWidth!==b||w.offsetAttribute!==T){let t=this._primitives;t.removeAndDestroy(this._primitive),t.removeAndDestroy(this._outlinePrimitive),this._primitive=void 0,this._outlinePrimitive=void 0,this._lastSceneMode=E,this._lastOutlineWidth=b,w.stackPartitions=g,w.slicePartitions=Z,w.subdivisions=y,w.offsetAttribute=T,w.radii=S.Z.clone(x?a2:n,w.radii),(0,_.Z)(c)?x?w.innerRadii=S.Z.fromElements(c.x/n.x,c.y/n.y,c.z/n.z,w.innerRadii):w.innerRadii=S.Z.clone(c,w.innerRadii):w.innerRadii=void 0,w.minimumClock=u,w.maximumClock=h,w.minimumCone=d,w.maximumCone=f;let i=new n_({material:l,translucent:l.isTranslucent(),closed:!0});w.vertexFormat=i.vertexFormat;let r=this._geometryUpdater.createFillGeometryInstance(e,x,this._modelMatrix);this._primitive=t.add(new nI.Z({geometryInstances:r,appearance:i,asynchronous:!1,shadows:A}));let p=this._geometryUpdater.createOutlineGeometryInstance(e,x,this._modelMatrix);this._outlinePrimitive=t.add(new nI.Z({geometryInstances:p,appearance:new ng.Z({flat:!0,translucent:255!==p.attributes.color.value[3],renderState:{lineWidth:this._geometryUpdater._scene.clampLineWidth(b)}}),asynchronous:!1,shadows:A})),this._lastShow=o,this._lastOutlineShow=a,this._lastOutlineColor=C.Z.clone(s,this._lastOutlineColor),this._lastDistanceDisplayCondition=O,this._lastOffset=S.Z.clone(P,this._lastOffset)}else if(this._primitive.ready){let e=this._primitive,i=this._outlinePrimitive;e.show=!0,i.show=!0,e.appearance.material=l;let n=this._attributes;(0,_.Z)(n)||(n=e.getGeometryInstanceAttributes(t),this._attributes=n),o!==this._lastShow&&(n.show=nA.Z.toValue(o,n.show),this._lastShow=o);let r=this._outlineAttributes;(0,_.Z)(r)||(r=i.getGeometryInstanceAttributes(t),this._outlineAttributes=r),a!==this._lastOutlineShow&&(r.show=nA.Z.toValue(a,r.show),this._lastOutlineShow=a),C.Z.equals(s,this._lastOutlineColor)||(r.color=nE.Z.toValue(s,r.color),C.Z.clone(s,this._lastOutlineColor)),I.Z.equals(O,this._lastDistanceDisplayCondition)||(n.distanceDisplayCondition=nx.toValue(O,n.distanceDisplayCondition),r.distanceDisplayCondition=nx.toValue(O,r.distanceDisplayCondition),I.Z.clone(O,this._lastDistanceDisplayCondition)),S.Z.equals(P,this._lastOffset)||(n.offset=nC.Z.toValue(P,n.offset),r.offset=nC.Z.toValue(P,n.offset),S.Z.clone(P,this._lastOffset))}x&&(n.x=Math.max(n.x,.001),n.y=Math.max(n.y,.001),n.z=Math.max(n.z,.001),r=er.Z.multiplyByScale(r,n,r),this._primitive.modelMatrix=r,this._outlinePrimitive.modelMatrix=r)},a9.packedLength=nf.Z.packedLength,a9.pack=function(e,t,i){return p.Z.typeOf.object("value",e),p.Z.defined("array",t),i=(0,m.Z)(i,0),nf.Z.pack(e._vertexFormat,t,i),t};let a8=new nf.Z,a6={vertexFormat:a8};a9.unpack=function(e,t,i){p.Z.defined("array",e),t=(0,m.Z)(t,0);let n=nf.Z.unpack(e,t,a8);return(0,_.Z)(i)?(i._vertexFormat=nf.Z.clone(n,i._vertexFormat),i):new a9(a6)};let a7=new S.Z(-.5,-.5,0),se=new S.Z(.5,.5,0);function st(){this._workerName="createPlaneOutlineGeometry"}a9.createGeometry=function(e){let t,i;let n=e._vertexFormat,r=new r3.Z;if(n.position){if((i=new Float64Array(12))[0]=a7.x,i[1]=a7.y,i[2]=0,i[3]=se.x,i[4]=a7.y,i[5]=0,i[6]=se.x,i[7]=se.y,i[8]=0,i[9]=a7.x,i[10]=se.y,i[11]=0,r.position=new r2.Z({componentDatatype:eM.Z.DOUBLE,componentsPerAttribute:3,values:i}),n.normal){let e=new Float32Array(12);e[0]=0,e[1]=0,e[2]=1,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=1,e[9]=0,e[10]=0,e[11]=1,r.normal=new r2.Z({componentDatatype:eM.Z.FLOAT,componentsPerAttribute:3,values:e})}if(n.st){let e=new Float32Array(8);e[0]=0,e[1]=0,e[2]=1,e[3]=0,e[4]=1,e[5]=1,e[6]=0,e[7]=1,r.st=new r2.Z({componentDatatype:eM.Z.FLOAT,componentsPerAttribute:2,values:e})}if(n.tangent){let e=new Float32Array(12);e[0]=1,e[1]=0,e[2]=0,e[3]=1,e[4]=0,e[5]=0,e[6]=1,e[7]=0,e[8]=0,e[9]=1,e[10]=0,e[11]=0,r.tangent=new r2.Z({componentDatatype:eM.Z.FLOAT,componentsPerAttribute:3,values:e})}if(n.bitangent){let e=new Float32Array(12);e[0]=0,e[1]=1,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=0,e[7]=1,e[8]=0,e[9]=0,e[10]=1,e[11]=0,r.bitangent=new r2.Z({componentDatatype:eM.Z.FLOAT,componentsPerAttribute:3,values:e})}(t=new Uint16Array(6))[0]=0,t[1]=1,t[2]=2,t[3]=0,t[4]=2,t[5]=3}return new r1.Z({attributes:r,indices:t,primitiveType:iT.Z.TRIANGLES,boundingSphere:new f.Z(S.Z.ZERO,Math.sqrt(2))})},st.packedLength=0,st.pack=function(e,t){return p.Z.defined("value",e),p.Z.defined("array",t),t},st.unpack=function(e,t,i){return(p.Z.defined("array",e),(0,_.Z)(i))?i:new st};let si=new S.Z(-.5,-.5,0),sn=new S.Z(.5,.5,0);st.createGeometry=function(){let e=new r3.Z,t=new Uint16Array(8),i=new Float64Array(12);return i[0]=si.x,i[1]=si.y,i[2]=si.z,i[3]=sn.x,i[4]=si.y,i[5]=si.z,i[6]=sn.x,i[7]=sn.y,i[8]=si.z,i[9]=si.x,i[10]=sn.y,i[11]=si.z,e.position=new r2.Z({componentDatatype:eM.Z.DOUBLE,componentsPerAttribute:3,values:i}),t[0]=0,t[1]=1,t[2]=1,t[3]=2,t[4]=2,t[5]=3,t[6]=3,t[7]=0,new r1.Z({attributes:e,indices:t,primitiveType:iT.Z.LINES,boundingSphere:new f.Z(S.Z.ZERO,Math.sqrt(2))})};let sr=new S.Z,so=new C.Z;function sa(e){this.id=e,this.vertexFormat=void 0,this.plane=void 0,this.dimensions=void 0}function ss(e,t){nV.call(this,{entity:e,scene:t,geometryOptions:new sa(e),geometryPropertyName:"plane",observedPropertyNames:["availability","position","orientation","plane"]}),this._onEntityPropertyChanged(e,"plane",e.plane,void 0)}function sl(e,t,i){nD.call(this,e,t,i)}(0,_.Z)(Object.create)&&(ss.prototype=Object.create(nV.prototype),ss.prototype.constructor=ss),ss.prototype.createFillGeometryInstance=function(e){let t;if(p.Z.defined("time",e),!this._fillEnabled)throw new A.Z("This instance does not represent a filled geometry.");let i=this._entity,n=i.isAvailable(e),r=new nA.Z(n&&i.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),o=this._distanceDisplayConditionProperty.getValue(e),a=nx.fromDistanceDisplayCondition(o);if(this._materialProperty instanceof ny.Z){let i;(0,_.Z)(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(i=this._materialProperty.color.getValue(e,so)),(0,_.Z)(i)||(i=C.Z.WHITE),t={show:r,distanceDisplayCondition:a,color:nE.Z.fromColor(i)}}else t={show:r,distanceDisplayCondition:a};let s=i.plane,l=this._options,c=i.computeModelMatrix(e),u=L.Z.getValueOrDefault(s.plane,e,l.plane),h=L.Z.getValueOrUndefined(s.dimensions,e,l.dimensions);return l.plane=u,l.dimensions=h,c=s_(u,h,c,c),new nw.Z({id:i,geometry:new a9(this._options),modelMatrix:c,attributes:t})},ss.prototype.createOutlineGeometryInstance=function(e){if(p.Z.defined("time",e),!this._outlineEnabled)throw new A.Z("This instance does not represent an outlined geometry.");let t=this._entity,i=t.isAvailable(e),n=L.Z.getValueOrDefault(this._outlineColorProperty,e,C.Z.BLACK,so),r=this._distanceDisplayConditionProperty.getValue(e),o=t.plane,a=this._options,s=t.computeModelMatrix(e),l=L.Z.getValueOrDefault(o.plane,e,a.plane),c=L.Z.getValueOrUndefined(o.dimensions,e,a.dimensions);return a.plane=l,a.dimensions=c,s=s_(l,c,s,s),new nw.Z({id:t,geometry:new st,modelMatrix:s,attributes:{show:new nA.Z(i&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:nE.Z.fromColor(n),distanceDisplayCondition:nx.fromDistanceDisplayCondition(r)}})},ss.prototype._isHidden=function(e,t){return!(0,_.Z)(t.plane)||!(0,_.Z)(t.dimensions)||!(0,_.Z)(e.position)||nV.prototype._isHidden.call(this,e,t)},ss.prototype._getIsClosed=function(e){return!1},ss.prototype._isDynamic=function(e,t){return!e.position.isConstant||!L.Z.isConstant(e.orientation)||!t.plane.isConstant||!t.dimensions.isConstant||!L.Z.isConstant(t.outlineWidth)},ss.prototype._setStaticOptions=function(e,t){let i=this._materialProperty instanceof ny.Z,n=this._options;n.vertexFormat=i?ng.Z.VERTEX_FORMAT:n_.MaterialSupport.TEXTURED.vertexFormat,n.plane=t.plane.getValue(na.MINIMUM_VALUE,n.plane),n.dimensions=t.dimensions.getValue(na.MINIMUM_VALUE,n.dimensions)},ss.DynamicGeometryUpdater=sl,(0,_.Z)(Object.create)&&(sl.prototype=Object.create(nD.prototype),sl.prototype.constructor=sl),sl.prototype._isHidden=function(e,t,i){let n=this._options,r=L.Z.getValueOrUndefined(e.position,i,sr);return!(0,_.Z)(r)||!(0,_.Z)(n.plane)||!(0,_.Z)(n.dimensions)||nD.prototype._isHidden.call(this,e,t,i)},sl.prototype._setOptions=function(e,t,i){let n=this._options;n.plane=L.Z.getValueOrDefault(t.plane,i,n.plane),n.dimensions=L.Z.getValueOrUndefined(t.dimensions,i,n.dimensions)};let sc=new S.Z,su=new S.Z,sh=new S.Z,sd=new S.Z,sf=new n2.Z,sp=new n2.Z,sm=new er.Z;function s_(e,t,i,n){let r=e.normal,o=e.distance,a=S.Z.multiplyByScalar(r,-o,sh),s=S.Z.clone(S.Z.UNIT_Z,su);eB.Z.equalsEpsilon(Math.abs(S.Z.dot(s,r)),1,eB.Z.EPSILON8)&&(s=S.Z.clone(S.Z.UNIT_Y,s));let l=S.Z.cross(s,r,sc);s=S.Z.cross(r,l,s),S.Z.normalize(l,l),S.Z.normalize(s,s),n2.Z.setColumn(sf,0,l,sf),n2.Z.setColumn(sf,1,s,sf),n2.Z.setColumn(sf,2,r,sf);let c=S.Z.fromElements(t.x,t.y,1,sd),u=n2.Z.multiplyByScale(sf,c,sp),h=er.Z.fromRotationTranslation(u,a,sm);return er.Z.multiplyTransformation(i,h,n)}ss.createPrimitiveMatrix=s_;var sg=i(7749),sZ=i(7066);let sy={},sb=new S.Z,sv=new S.Z,sT=new S.Z,sE=new S.Z,sx=new sZ.Z;function sw(e,t,i,n,r){let o=S.Z.subtract(e,t,sb),a=S.Z.dot(i,o),s=S.Z.dot(n,o);return w.Z.fromElements(a,s,r)}sy.validOutline=function(e){p.Z.defined("positions",e);let t=sZ.Z.fromPoints(e,sx).halfAxes,i=n2.Z.getColumn(t,0,sv),n=n2.Z.getColumn(t,1,sT),r=n2.Z.getColumn(t,2,sE),o=S.Z.magnitude(i),a=S.Z.magnitude(n),s=S.Z.magnitude(r);return!(0===o&&(0===a||0===s)||0===a&&0===s)},sy.computeProjectTo2DArguments=function(e,t,i,n){let r,o;p.Z.defined("positions",e),p.Z.defined("centerResult",t),p.Z.defined("planeAxis1Result",i),p.Z.defined("planeAxis2Result",n);let a=sZ.Z.fromPoints(e,sx),s=a.halfAxes,l=n2.Z.getColumn(s,0,sv),c=n2.Z.getColumn(s,1,sT),u=n2.Z.getColumn(s,2,sE),h=S.Z.magnitude(l),d=S.Z.magnitude(c),f=S.Z.magnitude(u),m=Math.min(h,d,f);return(0!==h||0!==d&&0!==f)&&(0!==d||0!==f)&&((m===d||m===f)&&(r=l),m===h?r=c:m===f&&(o=c),(m===h||m===d)&&(o=u),S.Z.normalize(r,i),S.Z.normalize(o,n),S.Z.clone(a.center,t),!0)},sy.createProjectPointsTo2DFunction=function(e,t,i){return function(n){let r=Array(n.length);for(let o=0;o<n.length;o++)r[o]=sw(n[o],e,t,i);return r}},sy.createProjectPointTo2DFunction=function(e,t,i){return function(n,r){return sw(n,e,t,i,r)}};var sS=i(4388);let sC=new S.Z,sA=new x.Z,sI=new w.Z,sO=new w.Z,sD=new S.Z,sP=new S.Z,sR=new S.Z,sN=new S.Z,sL=new S.Z,sM=new S.Z,sF=new n5.Z,sz=new n2.Z,sB=new n2.Z,sU=new S.Z;function sk(e){let t=(e=(0,m.Z)(e,m.Z.EMPTY_OBJECT)).polygonHierarchy,i=e.textureCoordinates;p.Z.defined("options.polygonHierarchy",t);let n=(0,m.Z)(e.vertexFormat,nf.Z.DEFAULT);this._vertexFormat=nf.Z.clone(n),this._polygonHierarchy=t,this._stRotation=(0,m.Z)(e.stRotation,0),this._ellipsoid=el.Z.clone((0,m.Z)(e.ellipsoid,el.Z.WGS84)),this._workerName="createCoplanarPolygonGeometry",this._textureCoordinates=i,this.packedLength=sS.Z.computeHierarchyPackedLength(t,S.Z)+nf.Z.packedLength+el.Z.packedLength+((0,_.Z)(i)?sS.Z.computeHierarchyPackedLength(i,w.Z):1)+2}sk.fromPositions=function(e){return e=(0,m.Z)(e,m.Z.EMPTY_OBJECT),p.Z.defined("options.positions",e.positions),new sk({polygonHierarchy:{positions:e.positions},vertexFormat:e.vertexFormat,stRotation:e.stRotation,ellipsoid:e.ellipsoid,textureCoordinates:e.textureCoordinates})},sk.pack=function(e,t,i){return p.Z.typeOf.object("value",e),p.Z.defined("array",t),i=(0,m.Z)(i,0),i=sS.Z.packPolygonHierarchy(e._polygonHierarchy,t,i,S.Z),el.Z.pack(e._ellipsoid,t,i),i+=el.Z.packedLength,nf.Z.pack(e._vertexFormat,t,i),i+=nf.Z.packedLength,t[i++]=e._stRotation,(0,_.Z)(e._textureCoordinates)?i=sS.Z.packPolygonHierarchy(e._textureCoordinates,t,i,w.Z):t[i++]=-1,t[i++]=e.packedLength,t};let sV=el.Z.clone(el.Z.UNIT_SPHERE),sH=new nf.Z,sG={polygonHierarchy:{}};function sj(e){let t=(e=(0,m.Z)(e,m.Z.EMPTY_OBJECT)).polygonHierarchy;p.Z.defined("options.polygonHierarchy",t),this._polygonHierarchy=t,this._workerName="createCoplanarPolygonOutlineGeometry",this.packedLength=sS.Z.computeHierarchyPackedLength(t,S.Z)+1}sk.unpack=function(e,t,i){p.Z.defined("array",e),t=(0,m.Z)(t,0);let n=sS.Z.unpackPolygonHierarchy(e,t,S.Z);t=n.startingIndex,delete n.startingIndex;let r=el.Z.unpack(e,t,sV);t+=el.Z.packedLength;let o=nf.Z.unpack(e,t,sH);t+=nf.Z.packedLength;let a=e[t++],s=-1===e[t]?void 0:sS.Z.unpackPolygonHierarchy(e,t,w.Z);(0,_.Z)(s)?(t=s.startingIndex,delete s.startingIndex):t++;let l=e[t++];return(0,_.Z)(i)||(i=new sk(sG)),i._polygonHierarchy=n,i._ellipsoid=el.Z.clone(r,i._ellipsoid),i._vertexFormat=nf.Z.clone(o,i._vertexFormat),i._stRotation=a,i._textureCoordinates=s,i.packedLength=l,i},sk.createGeometry=function(e){let t=e._vertexFormat,i=e._polygonHierarchy,n=e._stRotation,r=e._textureCoordinates,o=(0,_.Z)(r),a=i.positions;if((a=(0,n0.Z)(a,S.Z.equalsEpsilon,!0)).length<3)return;let s=sD,l=sP,c=sR,u=sL;if(!sy.computeProjectTo2DArguments(a,sN,u,sM))return;if(s=S.Z.cross(u,sM,s),s=S.Z.normalize(s,s),!S.Z.equalsEpsilon(sN,S.Z.ZERO,eB.Z.EPSILON6)){let t=e._ellipsoid.geodeticSurfaceNormal(sN,sU);0>S.Z.dot(s,t)&&(s=S.Z.negate(s,s),u=S.Z.negate(u,u))}let h=sy.createProjectPointsTo2DFunction(sN,u,sM),d=sy.createProjectPointTo2DFunction(sN,u,sM);t.tangent&&(l=S.Z.clone(u,l)),t.bitangent&&(c=S.Z.clone(sM,c));let p=sS.Z.polygonsFromHierarchy(i,o,h,!1),m=p.hierarchy,g=p.polygons,Z=o?sS.Z.polygonsFromHierarchy(r,!0,function(e){return e},!1).polygons:void 0;if(0===m.length)return;a=m[0].outerRing;let y=f.Z.fromPoints(a),b=sS.Z.computeBoundingRectangle(s,d,a,n,sA),v=[];for(let e=0;e<g.length;e++){let i=new nw.Z({geometry:function(e,t,i,n,r,o,a,s,l){let c=e.positions,u=r4.Z.triangulate(e.positions2D,e.holes);u.length<3&&(u=[0,1,2]);let h=ez.Z.createTypedArray(c.length,u.length);h.set(u);let d=sz;if(0!==n){let e=n5.Z.fromAxisAngle(a,n,sF);if(d=n2.Z.fromQuaternion(e,d),t.tangent||t.bitangent){e=n5.Z.fromAxisAngle(a,-n,sF);let i=n2.Z.fromQuaternion(e,sB);s=S.Z.normalize(n2.Z.multiplyByVector(i,s,s),s),t.bitangent&&(l=S.Z.normalize(S.Z.cross(a,s,l),l))}}else d=n2.Z.clone(n2.Z.IDENTITY,d);t.st&&(sO.x=i.x,sO.y=i.y);let f=c.length,p=3*f,m=new Float64Array(p),g=t.normal?new Float32Array(p):void 0,Z=t.tangent?new Float32Array(p):void 0,y=t.bitangent?new Float32Array(p):void 0,b=t.st?new Float32Array(2*f):void 0,v=0,T=0,E=0,x=0,C=0;for(let e=0;e<f;e++){let n=c[e];if(m[v++]=n.x,m[v++]=n.y,m[v++]=n.z,t.st){if((0,_.Z)(r)&&r.positions.length===f)b[C++]=r.positions[e].x,b[C++]=r.positions[e].y;else{let e=o(n2.Z.multiplyByVector(d,n,sC),sI);w.Z.subtract(e,sO,e);let t=eB.Z.clamp(e.x/i.width,0,1),r=eB.Z.clamp(e.y/i.height,0,1);b[C++]=t,b[C++]=r}}t.normal&&(g[T++]=a.x,g[T++]=a.y,g[T++]=a.z),t.tangent&&(Z[x++]=s.x,Z[x++]=s.y,Z[x++]=s.z),t.bitangent&&(y[E++]=l.x,y[E++]=l.y,y[E++]=l.z)}let A=new r3.Z;return t.position&&(A.position=new r2.Z({componentDatatype:eM.Z.DOUBLE,componentsPerAttribute:3,values:m})),t.normal&&(A.normal=new r2.Z({componentDatatype:eM.Z.FLOAT,componentsPerAttribute:3,values:g})),t.tangent&&(A.tangent=new r2.Z({componentDatatype:eM.Z.FLOAT,componentsPerAttribute:3,values:Z})),t.bitangent&&(A.bitangent=new r2.Z({componentDatatype:eM.Z.FLOAT,componentsPerAttribute:3,values:y})),t.st&&(A.st=new r2.Z({componentDatatype:eM.Z.FLOAT,componentsPerAttribute:2,values:b})),new r1.Z({attributes:A,indices:h,primitiveType:iT.Z.TRIANGLES})}(g[e],t,b,n,o?Z[e]:void 0,d,s,l,c)});v.push(i)}let T=aa.Z.combineInstances(v)[0];T.attributes.position.values=new Float64Array(T.attributes.position.values),T.indices=ez.Z.createTypedArray(T.attributes.position.values.length/3,T.indices);let E=T.attributes;return t.position||delete E.position,new r1.Z({attributes:E,indices:T.indices,primitiveType:T.primitiveType,boundingSphere:y})},sj.fromPositions=function(e){return e=(0,m.Z)(e,m.Z.EMPTY_OBJECT),p.Z.defined("options.positions",e.positions),new sj({polygonHierarchy:{positions:e.positions}})},sj.pack=function(e,t,i){return p.Z.typeOf.object("value",e),p.Z.defined("array",t),i=(0,m.Z)(i,0),i=sS.Z.packPolygonHierarchy(e._polygonHierarchy,t,i,S.Z),t[i]=e.packedLength,t};let sW={polygonHierarchy:{}};sj.unpack=function(e,t,i){p.Z.defined("array",e),t=(0,m.Z)(t,0);let n=sS.Z.unpackPolygonHierarchy(e,t,S.Z);t=n.startingIndex,delete n.startingIndex;let r=e[t];return(0,_.Z)(i)||(i=new sj(sW)),i._polygonHierarchy=n,i.packedLength=r,i},sj.createGeometry=function(e){let t=e._polygonHierarchy,i=t.positions;if((i=(0,n0.Z)(i,S.Z.equalsEpsilon,!0)).length<3||!sy.validOutline(i))return;let n=sS.Z.polygonOutlinesFromHierarchy(t,!1);if(0===n.length)return;let r=[];for(let e=0;e<n.length;e++){let t=new nw.Z({geometry:function(e){let t=e.length,i=new Float64Array(3*t),n=ez.Z.createTypedArray(t,2*t),r=0,o=0;for(let a=0;a<t;a++){let s=e[a];i[r++]=s.x,i[r++]=s.y,i[r++]=s.z,n[o++]=a,n[o++]=(a+1)%t}let a=new r3.Z({position:new r2.Z({componentDatatype:eM.Z.DOUBLE,componentsPerAttribute:3,values:i})});return new r1.Z({attributes:a,indices:n,primitiveType:iT.Z.LINES})}(n[e])});r.push(t)}let o=aa.Z.combineInstances(r)[0],a=f.Z.fromPoints(t.positions);return new r1.Z({attributes:o.attributes,indices:o.indices,primitiveType:o.primitiveType,boundingSphere:a})};var sq=i(2966),sY=i(9661);let sX=[],s$=[];function sK(e){if(p.Z.typeOf.object("options",e),p.Z.typeOf.object("options.polygonHierarchy",e.polygonHierarchy),e.perPositionHeight&&(0,_.Z)(e.height))throw new A.Z("Cannot use both options.perPositionHeight and options.height");if((0,_.Z)(e.arcType)&&e.arcType!==sg.Z.GEODESIC&&e.arcType!==sg.Z.RHUMB)throw new A.Z("Invalid arcType. Valid options are ArcType.GEODESIC and ArcType.RHUMB.");let t=e.polygonHierarchy,i=(0,m.Z)(e.ellipsoid,el.Z.WGS84),n=(0,m.Z)(e.granularity,eB.Z.RADIANS_PER_DEGREE),r=(0,m.Z)(e.perPositionHeight,!1),o=r&&(0,_.Z)(e.extrudedHeight),a=(0,m.Z)(e.arcType,sg.Z.GEODESIC),s=(0,m.Z)(e.height,0),l=(0,m.Z)(e.extrudedHeight,s);if(!o){let e=Math.max(s,l);l=Math.min(s,l),s=e}this._ellipsoid=el.Z.clone(i),this._granularity=n,this._height=s,this._extrudedHeight=l,this._arcType=a,this._polygonHierarchy=t,this._perPositionHeight=r,this._perPositionHeightExtrude=o,this._offsetAttribute=e.offsetAttribute,this._workerName="createPolygonOutlineGeometry",this.packedLength=sS.Z.computeHierarchyPackedLength(t,S.Z)+el.Z.packedLength+8}sK.pack=function(e,t,i){return p.Z.typeOf.object("value",e),p.Z.defined("array",t),i=(0,m.Z)(i,0),i=sS.Z.packPolygonHierarchy(e._polygonHierarchy,t,i,S.Z),el.Z.pack(e._ellipsoid,t,i),i+=el.Z.packedLength,t[i++]=e._height,t[i++]=e._extrudedHeight,t[i++]=e._granularity,t[i++]=e._perPositionHeightExtrude?1:0,t[i++]=e._perPositionHeight?1:0,t[i++]=e._arcType,t[i++]=(0,m.Z)(e._offsetAttribute,-1),t[i]=e.packedLength,t};let sQ=el.Z.clone(el.Z.UNIT_SPHERE),sJ={polygonHierarchy:{}};sK.unpack=function(e,t,i){p.Z.defined("array",e),t=(0,m.Z)(t,0);let n=sS.Z.unpackPolygonHierarchy(e,t,S.Z);t=n.startingIndex,delete n.startingIndex;let r=el.Z.unpack(e,t,sQ);t+=el.Z.packedLength;let o=e[t++],a=e[t++],s=e[t++],l=1===e[t++],c=1===e[t++],u=e[t++],h=e[t++],d=e[t];return(0,_.Z)(i)||(i=new sK(sJ)),i._polygonHierarchy=n,i._ellipsoid=el.Z.clone(r,i._ellipsoid),i._height=o,i._extrudedHeight=a,i._granularity=s,i._perPositionHeight=c,i._perPositionHeightExtrude=l,i._arcType=u,i._offsetAttribute=-1===h?void 0:h,i.packedLength=d,i},sK.fromPositions=function(e){return e=(0,m.Z)(e,m.Z.EMPTY_OBJECT),p.Z.defined("options.positions",e.positions),new sK({polygonHierarchy:{positions:e.positions},height:e.height,extrudedHeight:e.extrudedHeight,ellipsoid:e.ellipsoid,granularity:e.granularity,perPositionHeight:e.perPositionHeight,arcType:e.arcType,offsetAttribute:e.offsetAttribute})},sK.createGeometry=function(e){let t,i,n;let r=e._ellipsoid,o=e._granularity,a=e._polygonHierarchy,s=e._perPositionHeight,l=e._arcType,c=sS.Z.polygonOutlinesFromHierarchy(a,!s,r);if(0===c.length)return;let u=[],h=eB.Z.chordLength(o,r.maximumRadius),d=e._height,p=e._extrudedHeight;if(e._perPositionHeightExtrude||!eB.Z.equalsEpsilon(d,p,0,eB.Z.EPSILON2))for(n=0;n<c.length;n++){if((t=function(e,t,i,n,r){let o,a;let s=n4.Z.fromPoints(t,e).projectPointsOntoPlane(t,sX);r4.Z.computeWindingOrder2D(s)===sY.Z.CLOCKWISE&&(s.reverse(),t=t.slice().reverse());let l=t.length,c=Array(l),u=0;if(n)for(a=0,o=new Float64Array(12*l);a<l;++a){c[a]=u/3;let e=t[a],i=t[(a+1)%l];o[u++]=e.x,o[u++]=e.y,o[u++]=e.z,o[u++]=i.x,o[u++]=i.y,o[u++]=i.z}else{let n=0;if(r===sg.Z.GEODESIC)for(a=0;a<l;a++)n+=sS.Z.subdivideLineCount(t[a],t[(a+1)%l],i);else if(r===sg.Z.RHUMB)for(a=0;a<l;a++)n+=sS.Z.subdivideRhumbLineCount(e,t[a],t[(a+1)%l],i);for(a=0,o=new Float64Array(6*n);a<l;++a){let n;c[a]=u/3,r===sg.Z.GEODESIC?n=sS.Z.subdivideLine(t[a],t[(a+1)%l],i,s$):r===sg.Z.RHUMB&&(n=sS.Z.subdivideRhumbLine(e,t[a],t[(a+1)%l],i,s$));let s=n.length;for(let e=0;e<s;++e)o[u++]=n[e]}}l=o.length/6;let h=c.length,d=(2*l+h)*2,f=ez.Z.createTypedArray(l+h,d);for(a=0,u=0;a<l;++a)f[u++]=a,f[u++]=(a+1)%l,f[u++]=a+l,f[u++]=(a+1)%l+l;for(a=0;a<h;a++){let e=c[a];f[u++]=e,f[u++]=e+l}return new nw.Z({geometry:new r1.Z({attributes:new r3.Z({position:new r2.Z({componentDatatype:eM.Z.DOUBLE,componentsPerAttribute:3,values:o})}),indices:f,primitiveType:iT.Z.LINES})})}(r,c[n],h,s,l)).geometry=sS.Z.scaleToGeodeticHeightExtruded(t.geometry,d,p,r,s),(0,_.Z)(e._offsetAttribute)){let n=t.geometry.attributes.position.values.length/3,r=new Uint8Array(n);e._offsetAttribute===nS.Z.TOP?r=r.fill(1,0,n/2):(i=e._offsetAttribute===nS.Z.NONE?0:1,r=r.fill(i)),t.geometry.attributes.applyOffset=new r2.Z({componentDatatype:eM.Z.UNSIGNED_BYTE,componentsPerAttribute:1,values:r})}u.push(t)}else for(n=0;n<c.length;n++){if((t=function(e,t,i,n,r){let o,a;let s=n4.Z.fromPoints(t,e).projectPointsOntoPlane(t,sX);r4.Z.computeWindingOrder2D(s)===sY.Z.CLOCKWISE&&(s.reverse(),t=t.slice().reverse());let l=t.length,c=0;if(n)for(a=0,o=new Float64Array(6*l);a<l;a++){let e=t[a],i=t[(a+1)%l];o[c++]=e.x,o[c++]=e.y,o[c++]=e.z,o[c++]=i.x,o[c++]=i.y,o[c++]=i.z}else{let n=0;if(r===sg.Z.GEODESIC)for(a=0;a<l;a++)n+=sS.Z.subdivideLineCount(t[a],t[(a+1)%l],i);else if(r===sg.Z.RHUMB)for(a=0;a<l;a++)n+=sS.Z.subdivideRhumbLineCount(e,t[a],t[(a+1)%l],i);for(a=0,o=new Float64Array(3*n);a<l;a++){let n;r===sg.Z.GEODESIC?n=sS.Z.subdivideLine(t[a],t[(a+1)%l],i,s$):r===sg.Z.RHUMB&&(n=sS.Z.subdivideRhumbLine(e,t[a],t[(a+1)%l],i,s$));let s=n.length;for(let e=0;e<s;++e)o[c++]=n[e]}}let u=2*(l=o.length/3),h=ez.Z.createTypedArray(l,u);for(a=0,c=0;a<l-1;a++)h[c++]=a,h[c++]=a+1;return h[c++]=l-1,h[c++]=0,new nw.Z({geometry:new r1.Z({attributes:new r3.Z({position:new r2.Z({componentDatatype:eM.Z.DOUBLE,componentsPerAttribute:3,values:o})}),indices:h,primitiveType:iT.Z.LINES})})}(r,c[n],h,s,l)).geometry.attributes.position.values=r4.Z.scaleToGeodeticHeight(t.geometry.attributes.position.values,d,r,!s),(0,_.Z)(e._offsetAttribute)){let n=t.geometry.attributes.position.values.length;i=e._offsetAttribute===nS.Z.NONE?0:1;let r=new Uint8Array(n/3).fill(i);t.geometry.attributes.applyOffset=new r2.Z({componentDatatype:eM.Z.UNSIGNED_BYTE,componentsPerAttribute:1,values:r})}u.push(t)}let m=aa.Z.combineInstances(u)[0],g=f.Z.fromVertices(m.attributes.position.values);return new r1.Z({attributes:m.attributes,indices:m.indices,primitiveType:m.primitiveType,boundingSphere:g,offsetAttribute:e._offsetAttribute})};let s0="Entity polygons cannot have both height and perPositionHeight. height will be ignored",s1="heightReference is not supported for entity polygons with perPositionHeight. heightReference will be ignored",s2=new C.Z,s3=S.Z.ZERO,s4=new S.Z,s5=new r5.Z,s9=[],s8=new w.Z;function s6(e){this.id=e,this.vertexFormat=void 0,this.polygonHierarchy=void 0,this.perPositionHeight=void 0,this.closeTop=void 0,this.closeBottom=void 0,this.height=void 0,this.extrudedHeight=void 0,this.granularity=void 0,this.stRotation=void 0,this.offsetAttribute=void 0,this.arcType=void 0,this.textureCoordinates=void 0}function s7(e,t){oI.call(this,{entity:e,scene:t,geometryOptions:new s6(e),geometryPropertyName:"polygon",observedPropertyNames:["availability","polygon"]}),this._onEntityPropertyChanged(e,"polygon",e.polygon,void 0)}function le(e,t,i){nD.call(this,e,t,i)}function lt(e){let t=(e=(0,m.Z)(e,m.Z.EMPTY_OBJECT)).polylinePositions,i=e.shapePositions;if(!(0,_.Z)(t))throw new A.Z("options.polylinePositions is required.");if(!(0,_.Z)(i))throw new A.Z("options.shapePositions is required.");this._positions=t,this._shape=i,this._ellipsoid=el.Z.clone((0,m.Z)(e.ellipsoid,el.Z.WGS84)),this._cornerType=(0,m.Z)(e.cornerType,n1.ROUNDED),this._vertexFormat=nf.Z.clone((0,m.Z)(e.vertexFormat,nf.Z.DEFAULT)),this._granularity=(0,m.Z)(e.granularity,eB.Z.RADIANS_PER_DEGREE),this._workerName="createPolylineVolumeGeometry";let n=1+t.length*S.Z.packedLength;n+=1+i.length*w.Z.packedLength,this.packedLength=n+el.Z.packedLength+nf.Z.packedLength+2}(0,_.Z)(Object.create)&&(s7.prototype=Object.create(oI.prototype),s7.prototype.constructor=s7),s7.prototype.createFillGeometryInstance=function(e){let t;if(p.Z.defined("time",e),!this._fillEnabled)throw new A.Z("This instance does not represent a filled geometry.");let i=this._entity,n=i.isAvailable(e),r=this._options,o={show:new nA.Z(n&&i.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),distanceDisplayCondition:nx.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0,color:void 0};if(this._materialProperty instanceof ny.Z){let t;(0,_.Z)(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(t=this._materialProperty.color.getValue(e,s2)),(0,_.Z)(t)||(t=C.Z.WHITE),o.color=nE.Z.fromColor(t)}return(0,_.Z)(r.offsetAttribute)&&(o.offset=nC.Z.fromCartesian3(L.Z.getValueOrDefault(this._terrainOffsetProperty,e,s3,s4))),t=r.perPositionHeight&&!(0,_.Z)(r.extrudedHeight)?new sk(r):new sq.Z(r),new nw.Z({id:i,geometry:t,attributes:o})},s7.prototype.createOutlineGeometryInstance=function(e){let t;if(p.Z.defined("time",e),!this._outlineEnabled)throw new A.Z("This instance does not represent an outlined geometry.");let i=this._entity,n=i.isAvailable(e),r=this._options,o=L.Z.getValueOrDefault(this._outlineColorProperty,e,C.Z.BLACK,s2),a=this._distanceDisplayConditionProperty.getValue(e),s={show:new nA.Z(n&&i.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:nE.Z.fromColor(o),distanceDisplayCondition:nx.fromDistanceDisplayCondition(a),offset:void 0};return(0,_.Z)(r.offsetAttribute)&&(s.offset=nC.Z.fromCartesian3(L.Z.getValueOrDefault(this._terrainOffsetProperty,e,s3,s4))),t=r.perPositionHeight&&!(0,_.Z)(r.extrudedHeight)?new sj(r):new sK(r),new nw.Z({id:i,geometry:t,attributes:s})},s7.prototype._computeCenter=function(e,t){let i=L.Z.getValueOrUndefined(this._entity.polygon.hierarchy,e);if(!(0,_.Z)(i))return;let n=i.positions;if(0===n.length)return;let r=this._scene.mapProjection.ellipsoid,o=n4.Z.fromPoints(n,r),a=o.projectPointsOntoPlane(n,s9),s=a.length,l=0,c=s-1,u=new w.Z;for(let e=0;e<s;c=e++){let t=a[e],i=a[c],n=t.x*i.y-i.x*t.y,r=w.Z.add(t,i,s8);r=w.Z.multiplyByScalar(r,n,r),u=w.Z.add(u,r,u),l+=n}let h=1/(3*l);return u=w.Z.multiplyByScalar(u,h,u),o.projectPointOntoEllipsoid(u,t)},s7.prototype._isHidden=function(e,t){return!(0,_.Z)(t.hierarchy)||nV.prototype._isHidden.call(this,e,t)},s7.prototype._isOnTerrain=function(e,t){let i=oI.prototype._isOnTerrain.call(this,e,t),n=t.perPositionHeight,r=(0,_.Z)(n)&&(!n.isConstant||n.getValue(na.MINIMUM_VALUE));return i&&!r},s7.prototype._isDynamic=function(e,t){return!t.hierarchy.isConstant||!L.Z.isConstant(t.height)||!L.Z.isConstant(t.extrudedHeight)||!L.Z.isConstant(t.granularity)||!L.Z.isConstant(t.stRotation)||!L.Z.isConstant(t.textureCoordinates)||!L.Z.isConstant(t.outlineWidth)||!L.Z.isConstant(t.perPositionHeight)||!L.Z.isConstant(t.closeTop)||!L.Z.isConstant(t.closeBottom)||!L.Z.isConstant(t.zIndex)||!L.Z.isConstant(t.arcType)||this._onTerrain&&!L.Z.isConstant(this._materialProperty)&&!(this._materialProperty instanceof ny.Z)},s7.prototype._setStaticOptions=function(e,t){let i;let n=this._materialProperty instanceof ny.Z,r=this._options;r.vertexFormat=n?ng.Z.VERTEX_FORMAT:n_.MaterialSupport.TEXTURED.vertexFormat;let o=t.hierarchy.getValue(na.MINIMUM_VALUE),a=L.Z.getValueOrUndefined(t.height,na.MINIMUM_VALUE),s=L.Z.getValueOrDefault(t.heightReference,na.MINIMUM_VALUE,D.ZP.NONE),l=L.Z.getValueOrUndefined(t.extrudedHeight,na.MINIMUM_VALUE),c=L.Z.getValueOrDefault(t.extrudedHeightReference,na.MINIMUM_VALUE,D.ZP.NONE),u=L.Z.getValueOrDefault(t.perPositionHeight,na.MINIMUM_VALUE,!1);if(a=oI.getGeometryHeight(a,s),u?((0,_.Z)(a)&&(a=void 0,(0,nP.Z)(s0)),s!==D.ZP.NONE&&u&&(a=void 0,(0,nP.Z)(s1))):((0,_.Z)(l)&&!(0,_.Z)(a)&&(a=0),i=oI.computeGeometryOffsetAttribute(a,s,l,c)),r.polygonHierarchy=o,r.granularity=L.Z.getValueOrUndefined(t.granularity,na.MINIMUM_VALUE),r.stRotation=L.Z.getValueOrUndefined(t.stRotation,na.MINIMUM_VALUE),r.perPositionHeight=u,r.closeTop=L.Z.getValueOrDefault(t.closeTop,na.MINIMUM_VALUE,!0),r.closeBottom=L.Z.getValueOrDefault(t.closeBottom,na.MINIMUM_VALUE,!0),r.offsetAttribute=i,r.height=a,r.arcType=L.Z.getValueOrDefault(t.arcType,na.MINIMUM_VALUE,sg.Z.GEODESIC),r.textureCoordinates=L.Z.getValueOrUndefined(t.textureCoordinates,na.MINIMUM_VALUE),(l=oI.getGeometryExtrudedHeight(l,c))===oI.CLAMP_TO_GROUND){let e=sq.Z.computeRectangleFromPositions(r.polygonHierarchy.positions,r.ellipsoid,r.arcType,s5);l=d.Z.getMinimumMaximumHeights(e).minimumTerrainHeight}r.extrudedHeight=l},s7.prototype._getIsClosed=function(e){let t=e.height,i=e.extrudedHeight,n=(0,_.Z)(i)&&i!==t;return!e.perPositionHeight&&(!n&&0===t||n&&e.closeTop&&e.closeBottom)},s7.DynamicGeometryUpdater=le,(0,_.Z)(Object.create)&&(le.prototype=Object.create(nD.prototype),le.prototype.constructor=le),le.prototype._isHidden=function(e,t,i){return!(0,_.Z)(this._options.polygonHierarchy)||nD.prototype._isHidden.call(this,e,t,i)},le.prototype._setOptions=function(e,t,i){let n;let r=this._options;r.polygonHierarchy=L.Z.getValueOrUndefined(t.hierarchy,i);let o=L.Z.getValueOrUndefined(t.height,i),a=L.Z.getValueOrDefault(t.heightReference,i,D.ZP.NONE),s=L.Z.getValueOrDefault(t.extrudedHeightReference,i,D.ZP.NONE),l=L.Z.getValueOrUndefined(t.extrudedHeight,i),c=L.Z.getValueOrUndefined(t.perPositionHeight,i);if(o=oI.getGeometryHeight(o,s),c?((0,_.Z)(o)&&(o=void 0,(0,nP.Z)(s0)),a!==D.ZP.NONE&&c&&(o=void 0,(0,nP.Z)(s1))):((0,_.Z)(l)&&!(0,_.Z)(o)&&(o=0),n=oI.computeGeometryOffsetAttribute(o,a,l,s)),r.granularity=L.Z.getValueOrUndefined(t.granularity,i),r.stRotation=L.Z.getValueOrUndefined(t.stRotation,i),r.textureCoordinates=L.Z.getValueOrUndefined(t.textureCoordinates,i),r.perPositionHeight=L.Z.getValueOrUndefined(t.perPositionHeight,i),r.closeTop=L.Z.getValueOrDefault(t.closeTop,i,!0),r.closeBottom=L.Z.getValueOrDefault(t.closeBottom,i,!0),r.offsetAttribute=n,r.height=o,r.arcType=L.Z.getValueOrDefault(t.arcType,i,sg.Z.GEODESIC),(l=oI.getGeometryExtrudedHeight(l,s))===oI.CLAMP_TO_GROUND){let e=sq.Z.computeRectangleFromPositions(r.polygonHierarchy.positions,r.ellipsoid,r.arcType,s5);l=d.Z.getMinimumMaximumHeights(e).minimumTerrainHeight}r.extrudedHeight=l},lt.pack=function(e,t,i){let n;if(!(0,_.Z)(e))throw new A.Z("value is required");if(!(0,_.Z)(t))throw new A.Z("array is required");i=(0,m.Z)(i,0);let r=e._positions,o=r.length;for(n=0,t[i++]=o;n<o;++n,i+=S.Z.packedLength)S.Z.pack(r[n],t,i);let a=e._shape;for(n=0,o=a.length,t[i++]=o;n<o;++n,i+=w.Z.packedLength)w.Z.pack(a[n],t,i);return el.Z.pack(e._ellipsoid,t,i),i+=el.Z.packedLength,nf.Z.pack(e._vertexFormat,t,i),i+=nf.Z.packedLength,t[i++]=e._cornerType,t[i]=e._granularity,t};let li=el.Z.clone(el.Z.UNIT_SPHERE),ln=new nf.Z,lr={polylinePositions:void 0,shapePositions:void 0,ellipsoid:li,vertexFormat:ln,cornerType:void 0,granularity:void 0};lt.unpack=function(e,t,i){let n;if(!(0,_.Z)(e))throw new A.Z("array is required");t=(0,m.Z)(t,0);let r=e[t++],o=Array(r);for(n=0;n<r;++n,t+=S.Z.packedLength)o[n]=S.Z.unpack(e,t);let a=Array(r=e[t++]);for(n=0;n<r;++n,t+=w.Z.packedLength)a[n]=w.Z.unpack(e,t);let s=el.Z.unpack(e,t,li);t+=el.Z.packedLength;let l=nf.Z.unpack(e,t,ln);t+=nf.Z.packedLength;let c=e[t++],u=e[t];return(0,_.Z)(i)?(i._positions=o,i._shape=a,i._ellipsoid=el.Z.clone(s,i._ellipsoid),i._vertexFormat=nf.Z.clone(l,i._vertexFormat),i._cornerType=c,i._granularity=u,i):(lr.polylinePositions=o,lr.shapePositions=a,lr.cornerType=c,lr.granularity=u,new lt(lr))};let lo=new x.Z;function la(e){let t=(e=(0,m.Z)(e,m.Z.EMPTY_OBJECT)).polylinePositions,i=e.shapePositions;if(!(0,_.Z)(t))throw new A.Z("options.polylinePositions is required.");if(!(0,_.Z)(i))throw new A.Z("options.shapePositions is required.");this._positions=t,this._shape=i,this._ellipsoid=el.Z.clone((0,m.Z)(e.ellipsoid,el.Z.WGS84)),this._cornerType=(0,m.Z)(e.cornerType,n1.ROUNDED),this._granularity=(0,m.Z)(e.granularity,eB.Z.RADIANS_PER_DEGREE),this._workerName="createPolylineVolumeOutlineGeometry";let n=1+t.length*S.Z.packedLength;n+=1+i.length*w.Z.packedLength,this.packedLength=n+el.Z.packedLength+2}lt.createGeometry=function(e){let t=e._positions,i=(0,n0.Z)(t,S.Z.equalsEpsilon),n=e._shape;if(n=rc.removeDuplicatesFromShape(n),i.length<2||n.length<3)return;r4.Z.computeWindingOrder2D(n)===sY.Z.CLOCKWISE&&n.reverse();let r=x.Z.fromPoints(n,lo);return function(e,t,i,n){let r,o,a,s,l,c;let u=new r3.Z;n.position&&(u.position=new r2.Z({componentDatatype:eM.Z.DOUBLE,componentsPerAttribute:3,values:e}));let h=t.length,d=e.length/3,p=(d-2*h)/(2*h),m=r4.Z.triangulate(t),_=(p-1)*h*6+2*m.length,g=ez.Z.createTypedArray(d,_),Z=2*h,y=0;for(r=0;r<p-1;r++){for(o=0;o<h-1;o++)c=(a=2*o+r*h*2)+Z,l=(s=a+1)+Z,g[y++]=s,g[y++]=a,g[y++]=l,g[y++]=l,g[y++]=a,g[y++]=c;l=(s=(a=2*h-2+r*h*2)+1)+Z,c=a+Z,g[y++]=s,g[y++]=a,g[y++]=l,g[y++]=l,g[y++]=a,g[y++]=c}if(n.st||n.tangent||n.bitangent){let e,n;let a=new Float32Array(2*d),s=1/(p-1),l=1/i.height,c=i.height/2,f=0;for(r=0;r<p;r++){for(o=1,e=r*s,n=l*(t[0].y+c),a[f++]=e,a[f++]=n;o<h;o++)n=l*(t[o].y+c),a[f++]=e,a[f++]=n,a[f++]=e,a[f++]=n;n=l*(t[0].y+c),a[f++]=e,a[f++]=n}for(o=0;o<h;o++)e=0,n=l*(t[o].y+c),a[f++]=e,a[f++]=n;for(o=0;o<h;o++)e=(p-1)*s,n=l*(t[o].y+c),a[f++]=e,a[f++]=n;u.st=new r2.Z({componentDatatype:eM.Z.FLOAT,componentsPerAttribute:2,values:new Float32Array(a)})}let b=d-2*h;for(r=0;r<m.length;r+=3){let e=m[r]+b,t=m[r+1]+b,i=m[r+2]+b;g[y++]=e,g[y++]=t,g[y++]=i,g[y++]=i+h,g[y++]=t+h,g[y++]=e+h}let v=new r1.Z({attributes:u,indices:g,boundingSphere:f.Z.fromVertices(e),primitiveType:iT.Z.TRIANGLES});if(n.normal&&(v=aa.Z.computeNormal(v)),n.tangent||n.bitangent){try{v=aa.Z.computeTangentAndBitangent(v)}catch(e){(0,nP.Z)("polyline-volume-tangent-bitangent","Unable to compute tangents and bitangents for polyline volume geometry")}n.tangent||(v.attributes.tangent=void 0),n.bitangent||(v.attributes.bitangent=void 0),n.st||(v.attributes.st=void 0)}return v}(rc.computePositions(i,n,r,e,!0),n,r,e._vertexFormat)},la.pack=function(e,t,i){let n;if(!(0,_.Z)(e))throw new A.Z("value is required");if(!(0,_.Z)(t))throw new A.Z("array is required");i=(0,m.Z)(i,0);let r=e._positions,o=r.length;for(n=0,t[i++]=o;n<o;++n,i+=S.Z.packedLength)S.Z.pack(r[n],t,i);let a=e._shape;for(n=0,o=a.length,t[i++]=o;n<o;++n,i+=w.Z.packedLength)w.Z.pack(a[n],t,i);return el.Z.pack(e._ellipsoid,t,i),i+=el.Z.packedLength,t[i++]=e._cornerType,t[i]=e._granularity,t};let ls=el.Z.clone(el.Z.UNIT_SPHERE),ll={polylinePositions:void 0,shapePositions:void 0,ellipsoid:ls,height:void 0,cornerType:void 0,granularity:void 0};la.unpack=function(e,t,i){let n;if(!(0,_.Z)(e))throw new A.Z("array is required");t=(0,m.Z)(t,0);let r=e[t++],o=Array(r);for(n=0;n<r;++n,t+=S.Z.packedLength)o[n]=S.Z.unpack(e,t);let a=Array(r=e[t++]);for(n=0;n<r;++n,t+=w.Z.packedLength)a[n]=w.Z.unpack(e,t);let s=el.Z.unpack(e,t,ls);t+=el.Z.packedLength;let l=e[t++],c=e[t];return(0,_.Z)(i)?(i._positions=o,i._shape=a,i._ellipsoid=el.Z.clone(s,i._ellipsoid),i._cornerType=l,i._granularity=c,i):(ll.polylinePositions=o,ll.shapePositions=a,ll.cornerType=l,ll.granularity=c,new la(ll))};let lc=new x.Z;la.createGeometry=function(e){let t=e._positions,i=(0,n0.Z)(t,S.Z.equalsEpsilon),n=e._shape;if(n=rc.removeDuplicatesFromShape(n),i.length<2||n.length<3)return;r4.Z.computeWindingOrder2D(n)===sY.Z.CLOCKWISE&&n.reverse();let r=x.Z.fromPoints(n,lc);return function(e,t){let i,n;let r=new r3.Z;r.position=new r2.Z({componentDatatype:eM.Z.DOUBLE,componentsPerAttribute:3,values:e});let o=t.length,a=r.position.values.length/3,s=e.length/3/o,l=ez.Z.createTypedArray(a,2*o*(s+1)),c=0,u=(i=0)*o;for(n=0;n<o-1;n++)l[c++]=n+u,l[c++]=n+u+1;for(n=0,l[c++]=o-1+u,l[c++]=u,u=(i=s-1)*o;n<o-1;n++)l[c++]=n+u,l[c++]=n+u+1;for(i=0,l[c++]=o-1+u,l[c++]=u;i<s-1;i++){let e=o*i,t=e+o;for(n=0;n<o;n++)l[c++]=n+e,l[c++]=n+t}return new r1.Z({attributes:r,indices:ez.Z.createTypedArray(a,l),boundingSphere:f.Z.fromVertices(e),primitiveType:iT.Z.LINES})}(rc.computePositions(i,n,r,e,!1),n)};let lu=new C.Z;function lh(e){this.id=e,this.vertexFormat=void 0,this.polylinePositions=void 0,this.shapePositions=void 0,this.cornerType=void 0,this.granularity=void 0}function ld(e,t){nV.call(this,{entity:e,scene:t,geometryOptions:new lh(e),geometryPropertyName:"polylineVolume",observedPropertyNames:["availability","polylineVolume"]}),this._onEntityPropertyChanged(e,"polylineVolume",e.polylineVolume,void 0)}function lf(e,t,i){nD.call(this,e,t,i)}(0,_.Z)(Object.create)&&(ld.prototype=Object.create(nV.prototype),ld.prototype.constructor=ld),ld.prototype.createFillGeometryInstance=function(e){let t;if(p.Z.defined("time",e),!this._fillEnabled)throw new A.Z("This instance does not represent a filled geometry.");let i=this._entity,n=i.isAvailable(e),r=new nA.Z(n&&i.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),o=this._distanceDisplayConditionProperty.getValue(e),a=nx.fromDistanceDisplayCondition(o);if(this._materialProperty instanceof ny.Z){let i;(0,_.Z)(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(i=this._materialProperty.color.getValue(e,lu)),(0,_.Z)(i)||(i=C.Z.WHITE),t={show:r,distanceDisplayCondition:a,color:nE.Z.fromColor(i)}}else t={show:r,distanceDisplayCondition:a};return new nw.Z({id:i,geometry:new lt(this._options),attributes:t})},ld.prototype.createOutlineGeometryInstance=function(e){if(p.Z.defined("time",e),!this._outlineEnabled)throw new A.Z("This instance does not represent an outlined geometry.");let t=this._entity,i=t.isAvailable(e),n=L.Z.getValueOrDefault(this._outlineColorProperty,e,C.Z.BLACK,lu),r=this._distanceDisplayConditionProperty.getValue(e);return new nw.Z({id:t,geometry:new la(this._options),attributes:{show:new nA.Z(i&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:nE.Z.fromColor(n),distanceDisplayCondition:nx.fromDistanceDisplayCondition(r)}})},ld.prototype._isHidden=function(e,t){return!(0,_.Z)(t.positions)||!(0,_.Z)(t.shape)||nV.prototype._isHidden.call(this,e,t)},ld.prototype._isDynamic=function(e,t){return!t.positions.isConstant||!t.shape.isConstant||!L.Z.isConstant(t.granularity)||!L.Z.isConstant(t.outlineWidth)||!L.Z.isConstant(t.cornerType)},ld.prototype._setStaticOptions=function(e,t){let i=t.granularity,n=t.cornerType,r=this._options,o=this._materialProperty instanceof ny.Z;r.vertexFormat=o?ng.Z.VERTEX_FORMAT:n_.MaterialSupport.TEXTURED.vertexFormat,r.polylinePositions=t.positions.getValue(na.MINIMUM_VALUE,r.polylinePositions),r.shapePositions=t.shape.getValue(na.MINIMUM_VALUE,r.shape),r.granularity=(0,_.Z)(i)?i.getValue(na.MINIMUM_VALUE):void 0,r.cornerType=(0,_.Z)(n)?n.getValue(na.MINIMUM_VALUE):void 0},ld.DynamicGeometryUpdater=lf,(0,_.Z)(Object.create)&&(lf.prototype=Object.create(nD.prototype),lf.prototype.constructor=lf),lf.prototype._isHidden=function(e,t,i){let n=this._options;return!(0,_.Z)(n.polylinePositions)||!(0,_.Z)(n.shapePositions)||nD.prototype._isHidden.call(this,e,t,i)},lf.prototype._setOptions=function(e,t,i){let n=this._options;n.polylinePositions=L.Z.getValueOrUndefined(t.positions,i,n.polylinePositions),n.shapePositions=L.Z.getValueOrUndefined(t.shape,i),n.granularity=L.Z.getValueOrUndefined(t.granularity,i),n.cornerType=L.Z.getValueOrUndefined(t.cornerType,i)};var lp=i(3037),lm=i(7939);let l_=new S.Z,lg=new S.Z,lZ=new S.Z,ly=new S.Z,lb=new r5.Z,lv=new w.Z,lT=new f.Z,lE=new f.Z;function lx(e,t){let i=new r1.Z({attributes:new r3.Z,primitiveType:iT.Z.TRIANGLES});return i.attributes.position=new r2.Z({componentDatatype:eM.Z.DOUBLE,componentsPerAttribute:3,values:t.positions}),e.normal&&(i.attributes.normal=new r2.Z({componentDatatype:eM.Z.FLOAT,componentsPerAttribute:3,values:t.normals})),e.tangent&&(i.attributes.tangent=new r2.Z({componentDatatype:eM.Z.FLOAT,componentsPerAttribute:3,values:t.tangents})),e.bitangent&&(i.attributes.bitangent=new r2.Z({componentDatatype:eM.Z.FLOAT,componentsPerAttribute:3,values:t.bitangents})),i}let lw=new S.Z,lS=new S.Z;function lC(e,t){let i;let n=e._vertexFormat,r=e._ellipsoid,o=t.height,a=t.width,s=t.northCap,l=t.southCap,c=0,u=o,h=o,d=0;s&&(c=1,h-=1,d+=1),l&&(u-=1,h-=1,d+=1),d+=a*h;let f=n.position?new Float64Array(3*d):void 0,p=n.st?new Float32Array(2*d):void 0,m=0,_=0,g=Number.MAX_VALUE,Z=Number.MAX_VALUE,y=-Number.MAX_VALUE,b=-Number.MAX_VALUE;for(let e=c;e<u;++e)for(let i=0;i<a;++i)lm.Z.computePosition(t,r,n.st,e,i,l_,lv),f[m++]=l_.x,f[m++]=l_.y,f[m++]=l_.z,n.st&&(p[_++]=lv.x,p[_++]=lv.y,g=Math.min(g,lv.x),Z=Math.min(Z,lv.y),y=Math.max(y,lv.x),b=Math.max(b,lv.y));if(s&&(lm.Z.computePosition(t,r,n.st,0,0,l_,lv),f[m++]=l_.x,f[m++]=l_.y,f[m++]=l_.z,n.st&&(p[_++]=lv.x,p[_++]=lv.y,g=lv.x,Z=lv.y,y=lv.x,b=lv.y)),l&&(lm.Z.computePosition(t,r,n.st,o-1,0,l_,lv),f[m++]=l_.x,f[m++]=l_.y,f[m]=l_.z,n.st&&(p[_++]=lv.x,p[_]=lv.y,g=Math.min(g,lv.x),Z=Math.min(Z,lv.y),y=Math.max(y,lv.x),b=Math.max(b,lv.y))),n.st&&(g<0||Z<0||y>1||b>1))for(let e=0;e<p.length;e+=2)p[e]=(p[e]-g)/(y-g),p[e+1]=(p[e+1]-Z)/(b-Z);let v=function(e,t,i,n){let r=e.length,o=t.normal?new Float32Array(r):void 0,a=t.tangent?new Float32Array(r):void 0,s=t.bitangent?new Float32Array(r):void 0,l=0,c=lg;if(t.normal||t.tangent||t.bitangent)for(let u=0;u<r;u+=3){let r=S.Z.fromArray(e,u,l_),h=l+1,d=l+2;c=i.geodeticSurfaceNormal(r,c),(t.tangent||t.bitangent)&&(S.Z.cross(S.Z.UNIT_Z,c,lZ),n2.Z.multiplyByVector(n,lZ,lZ),S.Z.normalize(lZ,lZ),t.bitangent&&S.Z.normalize(S.Z.cross(c,lZ,ly),ly)),t.normal&&(o[l]=c.x,o[h]=c.y,o[d]=c.z),t.tangent&&(a[l]=lZ.x,a[h]=lZ.y,a[d]=lZ.z),t.bitangent&&(s[l]=ly.x,s[h]=ly.y,s[d]=ly.z),l+=3}return lx(t,{positions:e,normals:o,tangents:a,bitangents:s})}(f,n,r,t.tangentRotationMatrix),T=6*(a-1)*(h-1);s&&(T+=3*(a-1)),l&&(T+=3*(a-1));let E=ez.Z.createTypedArray(d,T),x=0,w=0;for(i=0;i<h-1;++i){for(let e=0;e<a-1;++e){let e=x,t=e+a,i=t+1,n=e+1;E[w++]=e,E[w++]=t,E[w++]=n,E[w++]=n,E[w++]=t,E[w++]=i,++x}++x}if(s||l){let e,t,n=d-1,r=d-1;if(s&&l&&(n=d-2),x=0,s)for(i=0;i<a-1;i++)t=(e=x)+1,E[w++]=n,E[w++]=e,E[w++]=t,++x;if(l)for(i=0,x=(h-1)*a;i<a-1;i++)t=(e=x)+1,E[w++]=e,E[w++]=r,E[w++]=t,++x}return v.indices=E,n.st&&(v.attributes.st=new r2.Z({componentDatatype:eM.Z.FLOAT,componentsPerAttribute:2,values:p})),v}function lA(e,t,i,n,r){return e[t++]=n[i],e[t++]=n[i+1],e[t++]=n[i+2],e[t++]=r[i],e[t++]=r[i+1],e[t]=r[i+2],e}function lI(e,t,i,n){return e[t++]=n[i],e[t++]=n[i+1],e[t++]=n[i],e[t]=n[i+1],e}let lO=new nf.Z,lD=[new S.Z,new S.Z,new S.Z,new S.Z],lP=new ea.Z,lR=new ea.Z;function lN(e,t,i,n,r){if(0===i)return r5.Z.clone(e,r);let o=lm.Z.computeOptions(e,t,i,0,lb,lP),a=o.height,s=o.width;return lm.Z.computePosition(o,n,!1,0,0,lD[0]),lm.Z.computePosition(o,n,!1,0,s-1,lD[1]),lm.Z.computePosition(o,n,!1,a-1,0,lD[2]),lm.Z.computePosition(o,n,!1,a-1,s-1,lD[3]),r5.Z.fromCartesianArray(lD,n,r)}function lL(e){let t=(e=(0,m.Z)(e,m.Z.EMPTY_OBJECT)).rectangle;if(p.Z.typeOf.object("rectangle",t),r5.Z.validate(t),t.north<t.south)throw new A.Z("options.rectangle.north must be greater than or equal to options.rectangle.south");let i=(0,m.Z)(e.height,0),n=(0,m.Z)(e.extrudedHeight,i);this._rectangle=r5.Z.clone(t),this._granularity=(0,m.Z)(e.granularity,eB.Z.RADIANS_PER_DEGREE),this._ellipsoid=el.Z.clone((0,m.Z)(e.ellipsoid,el.Z.WGS84)),this._surfaceHeight=Math.max(i,n),this._rotation=(0,m.Z)(e.rotation,0),this._stRotation=(0,m.Z)(e.stRotation,0),this._vertexFormat=nf.Z.clone((0,m.Z)(e.vertexFormat,nf.Z.DEFAULT)),this._extrudedHeight=Math.min(i,n),this._shadowVolume=(0,m.Z)(e.shadowVolume,!1),this._workerName="createRectangleGeometry",this._offsetAttribute=e.offsetAttribute,this._rotatedRectangle=void 0,this._textureCoordinateRotationPoints=void 0}lL.packedLength=r5.Z.packedLength+el.Z.packedLength+nf.Z.packedLength+7,lL.pack=function(e,t,i){return p.Z.typeOf.object("value",e),p.Z.defined("array",t),i=(0,m.Z)(i,0),r5.Z.pack(e._rectangle,t,i),i+=r5.Z.packedLength,el.Z.pack(e._ellipsoid,t,i),i+=el.Z.packedLength,nf.Z.pack(e._vertexFormat,t,i),i+=nf.Z.packedLength,t[i++]=e._granularity,t[i++]=e._surfaceHeight,t[i++]=e._rotation,t[i++]=e._stRotation,t[i++]=e._extrudedHeight,t[i++]=e._shadowVolume?1:0,t[i]=(0,m.Z)(e._offsetAttribute,-1),t};let lM=new r5.Z,lF=el.Z.clone(el.Z.UNIT_SPHERE),lz={rectangle:lM,ellipsoid:lF,vertexFormat:lO,granularity:void 0,height:void 0,rotation:void 0,stRotation:void 0,extrudedHeight:void 0,shadowVolume:void 0,offsetAttribute:void 0};lL.unpack=function(e,t,i){p.Z.defined("array",e),t=(0,m.Z)(t,0);let n=r5.Z.unpack(e,t,lM);t+=r5.Z.packedLength;let r=el.Z.unpack(e,t,lF);t+=el.Z.packedLength;let o=nf.Z.unpack(e,t,lO);t+=nf.Z.packedLength;let a=e[t++],s=e[t++],l=e[t++],c=e[t++],u=e[t++],h=1===e[t++],d=e[t];return(0,_.Z)(i)?(i._rectangle=r5.Z.clone(n,i._rectangle),i._ellipsoid=el.Z.clone(r,i._ellipsoid),i._vertexFormat=nf.Z.clone(o,i._vertexFormat),i._granularity=a,i._surfaceHeight=s,i._rotation=l,i._stRotation=c,i._extrudedHeight=u,i._shadowVolume=h,i._offsetAttribute=-1===d?void 0:d,i):(lz.granularity=a,lz.height=s,lz.rotation=l,lz.stRotation=c,lz.extrudedHeight=u,lz.shadowVolume=h,lz.offsetAttribute=-1===d?void 0:d,new lL(lz))},lL.computeRectangle=function(e,t){let i=(e=(0,m.Z)(e,m.Z.EMPTY_OBJECT)).rectangle;if(p.Z.typeOf.object("rectangle",i),r5.Z.validate(i),i.north<i.south)throw new A.Z("options.rectangle.north must be greater than or equal to options.rectangle.south");let n=(0,m.Z)(e.granularity,eB.Z.RADIANS_PER_DEGREE),r=(0,m.Z)(e.ellipsoid,el.Z.WGS84);return lN(i,n,(0,m.Z)(e.rotation,0),r,t)};let lB=new n2.Z,lU=new n5.Z,lk=new ea.Z;lL.createGeometry=function(e){let t,i;if(eB.Z.equalsEpsilon(e._rectangle.north,e._rectangle.south,eB.Z.EPSILON10)||eB.Z.equalsEpsilon(e._rectangle.east,e._rectangle.west,eB.Z.EPSILON10))return;let n=e._rectangle,r=e._ellipsoid,o=e._rotation,a=e._stRotation,s=e._vertexFormat,l=lm.Z.computeOptions(n,e._granularity,o,a,lb,lP,lR);if(0!==a||0!==o){let e=r5.Z.center(n,lk),t=r.geodeticSurfaceNormalCartographic(e,lw);n5.Z.fromAxisAngle(t,-a,lU),n2.Z.fromQuaternion(lU,lB)}else n2.Z.clone(n2.Z.IDENTITY,lB);let c=e._surfaceHeight,u=e._extrudedHeight,h=!eB.Z.equalsEpsilon(c,u,0,eB.Z.EPSILON2);if(l.lonScalar=1/e._rectangle.width,l.latScalar=1/e._rectangle.height,l.tangentRotationMatrix=lB,n=e._rectangle,h){t=function(e,t){let i,n,r,o,a,s,l,c,u;let h=e._shadowVolume,d=e._offsetAttribute,f=e._vertexFormat,p=e._extrudedHeight,m=e._surfaceHeight,g=e._ellipsoid,Z=t.height,y=t.width;if(h){let t=nf.Z.clone(f,lO);t.normal=!0,e._vertexFormat=t}let b=lC(e,t);h&&(e._vertexFormat=f);let v=r4.Z.scaleToGeodeticHeight(b.attributes.position.values,m,g,!1),T=(v=new Float64Array(v)).length,E=2*T,x=new Float64Array(E);x.set(v);let w=r4.Z.scaleToGeodeticHeight(b.attributes.position.values,p,g);x.set(w,T),b.attributes.position.values=x;let C=f.normal?new Float32Array(E):void 0,A=f.tangent?new Float32Array(E):void 0,I=f.bitangent?new Float32Array(E):void 0,O=f.st?new Float32Array(E/3*2):void 0;if(f.normal){for(r=b.attributes.normal.values,C.set(r),i=0;i<T;i++)r[i]=-r[i];C.set(r,T),b.attributes.normal.values=C}if(h){r=b.attributes.normal.values,f.normal||(b.attributes.normal=void 0);let e=new Float32Array(E);for(i=0;i<T;i++)r[i]=-r[i];e.set(r,T),b.attributes.extrudeDirection=new r2.Z({componentDatatype:eM.Z.FLOAT,componentsPerAttribute:3,values:e})}let D=(0,_.Z)(d);if(D){let e=T/3*2,t=new Uint8Array(e);d===nS.Z.TOP?t=t.fill(1,0,e/2):(o=d===nS.Z.NONE?0:1,t=t.fill(o)),b.attributes.applyOffset=new r2.Z({componentDatatype:eM.Z.UNSIGNED_BYTE,componentsPerAttribute:1,values:t})}if(f.tangent){let e=b.attributes.tangent.values;for(A.set(e),i=0;i<T;i++)e[i]=-e[i];A.set(e,T),b.attributes.tangent.values=A}if(f.bitangent){let e=b.attributes.bitangent.values;I.set(e),I.set(e,T),b.attributes.bitangent.values=I}f.st&&(n=b.attributes.st.values,O.set(n),O.set(n,T/3*2),b.attributes.st.values=O);let P=b.indices,R=P.length,N=T/3,L=ez.Z.createTypedArray(E/3,2*R);for(L.set(P),i=0;i<R;i+=3)L[i+R]=P[i+2]+N,L[i+1+R]=P[i+1]+N,L[i+2+R]=P[i]+N;b.indices=L;let M=t.northCap,F=t.southCap,z=Z,B=2,U=0,k=4,V=4;M&&(B-=1,z-=1,U+=1,k-=2,V-=1),F&&(B-=1,z-=1,U+=1,k-=2,V-=1);let H=((U+=B*y+2*z-k)+V)*2,G=new Float64Array(3*H),j=h?new Float32Array(3*H):void 0,W=D?new Uint8Array(H):void 0,q=f.st?new Float32Array(2*H):void 0,Y=d===nS.Z.TOP;D&&!Y&&(o=d===nS.Z.ALL?1:0,W=W.fill(o));let X=0,$=0,K=0,Q=0,J=y*z;for(i=0;i<J;i+=y)G=lA(G,X,a=3*i,v,w),X+=6,f.st&&(q=lI(q,$,2*i,n),$+=4),h&&(K+=3,j[K++]=r[a],j[K++]=r[a+1],j[K++]=r[a+2]),Y&&(W[Q++]=1,Q+=1);if(F){let e=M?J+1:J;for(i=0,a=3*e;i<2;i++)G=lA(G,X,a,v,w),X+=6,f.st&&(q=lI(q,$,2*e,n),$+=4),h&&(K+=3,j[K++]=r[a],j[K++]=r[a+1],j[K++]=r[a+2]),Y&&(W[Q++]=1,Q+=1)}else for(i=J-y;i<J;i++)G=lA(G,X,a=3*i,v,w),X+=6,f.st&&(q=lI(q,$,2*i,n),$+=4),h&&(K+=3,j[K++]=r[a],j[K++]=r[a+1],j[K++]=r[a+2]),Y&&(W[Q++]=1,Q+=1);for(i=J-1;i>0;i-=y)G=lA(G,X,a=3*i,v,w),X+=6,f.st&&(q=lI(q,$,2*i,n),$+=4),h&&(K+=3,j[K++]=r[a],j[K++]=r[a+1],j[K++]=r[a+2]),Y&&(W[Q++]=1,Q+=1);if(M)for(i=0,a=3*J;i<2;i++)G=lA(G,X,a,v,w),X+=6,f.st&&(q=lI(q,$,2*J,n),$+=4),h&&(K+=3,j[K++]=r[a],j[K++]=r[a+1],j[K++]=r[a+2]),Y&&(W[Q++]=1,Q+=1);else for(i=y-1;i>=0;i--)G=lA(G,X,a=3*i,v,w),X+=6,f.st&&(q=lI(q,$,2*i,n),$+=4),h&&(K+=3,j[K++]=r[a],j[K++]=r[a+1],j[K++]=r[a+2]),Y&&(W[Q++]=1,Q+=1);let ee=function(e,t,i){let n=e.length,r=t.normal?new Float32Array(n):void 0,o=t.tangent?new Float32Array(n):void 0,a=t.bitangent?new Float32Array(n):void 0,s=0,l=0,c=0,u=!0,h=ly,d=lZ,f=lg;if(t.normal||t.tangent||t.bitangent)for(let p=0;p<n;p+=6){let m=S.Z.fromArray(e,p,l_),_=S.Z.fromArray(e,(p+6)%n,lw);if(u){let t=S.Z.fromArray(e,(p+3)%n,lS);S.Z.subtract(_,m,_),S.Z.subtract(t,m,t),f=S.Z.normalize(S.Z.cross(t,_,f),f),u=!1}S.Z.equalsEpsilon(_,m,eB.Z.EPSILON10)&&(u=!0),(t.tangent||t.bitangent)&&(h=i.geodeticSurfaceNormal(m,h),t.tangent&&(d=S.Z.normalize(S.Z.cross(h,f,d),d))),t.normal&&(r[s++]=f.x,r[s++]=f.y,r[s++]=f.z,r[s++]=f.x,r[s++]=f.y,r[s++]=f.z),t.tangent&&(o[l++]=d.x,o[l++]=d.y,o[l++]=d.z,o[l++]=d.x,o[l++]=d.y,o[l++]=d.z),t.bitangent&&(a[c++]=h.x,a[c++]=h.y,a[c++]=h.z,a[c++]=h.x,a[c++]=h.y,a[c++]=h.z)}return lx(t,{positions:e,normals:r,tangents:o,bitangents:a})}(G,f,g);f.st&&(ee.attributes.st=new r2.Z({componentDatatype:eM.Z.FLOAT,componentsPerAttribute:2,values:q})),h&&(ee.attributes.extrudeDirection=new r2.Z({componentDatatype:eM.Z.FLOAT,componentsPerAttribute:3,values:j})),D&&(ee.attributes.applyOffset=new r2.Z({componentDatatype:eM.Z.UNSIGNED_BYTE,componentsPerAttribute:1,values:W}));let et=ez.Z.createTypedArray(H,6*U);T=G.length/3;let ei=0;for(i=0;i<T-1;i+=2){u=((s=i)+2)%T;let e=S.Z.fromArray(G,3*s,lw),t=S.Z.fromArray(G,3*u,lS);S.Z.equalsEpsilon(e,t,eB.Z.EPSILON10)||(c=((l=(s+1)%T)+2)%T,et[ei++]=s,et[ei++]=l,et[ei++]=u,et[ei++]=u,et[ei++]=l,et[ei++]=c)}return ee.indices=et,(ee=aa.Z.combineInstances([new nw.Z({geometry:b}),new nw.Z({geometry:ee})]))[0]}(e,l);let o=f.Z.fromRectangle3D(n,r,c,lE),a=f.Z.fromRectangle3D(n,r,u,lT);i=f.Z.union(o,a)}else{if((t=lC(e,l)).attributes.position.values=r4.Z.scaleToGeodeticHeight(t.attributes.position.values,c,r,!1),(0,_.Z)(e._offsetAttribute)){let i=t.attributes.position.values.length,n=e._offsetAttribute===nS.Z.NONE?0:1,r=new Uint8Array(i/3).fill(n);t.attributes.applyOffset=new r2.Z({componentDatatype:eM.Z.UNSIGNED_BYTE,componentsPerAttribute:1,values:r})}i=f.Z.fromRectangle3D(n,r,c)}return s.position||delete t.attributes.position,new r1.Z({attributes:t.attributes,indices:t.indices,primitiveType:t.primitiveType,boundingSphere:i,offsetAttribute:e._offsetAttribute})},lL.createShadowVolume=function(e,t,i){let n=e._granularity,r=e._ellipsoid,o=t(n,r),a=i(n,r);return new lL({rectangle:e._rectangle,rotation:e._rotation,ellipsoid:r,stRotation:e._stRotation,granularity:n,extrudedHeight:a,height:o,vertexFormat:nf.Z.POSITION_ONLY,shadowVolume:!0})};let lV=new r5.Z,lH=[new w.Z,new w.Z,new w.Z],lG=new lp.Z,lj=new ea.Z;Object.defineProperties(lL.prototype,{rectangle:{get:function(){return(0,_.Z)(this._rotatedRectangle)||(this._rotatedRectangle=lN(this._rectangle,this._granularity,this._rotation,this._ellipsoid)),this._rotatedRectangle}},textureCoordinateRotationPoints:{get:function(){return(0,_.Z)(this._textureCoordinateRotationPoints)||(this._textureCoordinateRotationPoints=function(e){if(0===e._stRotation)return[0,0,0,1,1,0];let t=r5.Z.clone(e._rectangle,lV),i=e._granularity,n=e._ellipsoid,r=lN(t,i,e._rotation-e._stRotation,n,lV);lH[0].x=r.west,lH[0].y=r.south,lH[1].x=r.west,lH[1].y=r.north,lH[2].x=r.east,lH[2].y=r.south;let o=e.rectangle,a=lp.Z.fromRotation(e._stRotation,lG),s=r5.Z.center(o,lj);for(let e=0;e<3;++e){let t=lH[e];t.x-=s.longitude,t.y-=s.latitude,lp.Z.multiplyByVector(a,t,t),t.x+=s.longitude,t.y+=s.latitude,t.x=(t.x-o.west)/o.width,t.y=(t.y-o.south)/o.height}let l=lH[0],c=lH[1],u=lH[2],h=Array(6);return w.Z.pack(l,h),w.Z.pack(c,h,2),w.Z.pack(u,h,4),h}(this)),this._textureCoordinateRotationPoints}}});var lW=i(7372);let lq=new C.Z,lY=S.Z.ZERO,lX=new S.Z,l$=new r5.Z,lK=new r5.Z,lQ=new ea.Z;function lJ(e){this.id=e,this.vertexFormat=void 0,this.rectangle=void 0,this.height=void 0,this.extrudedHeight=void 0,this.granularity=void 0,this.stRotation=void 0,this.rotation=void 0,this.offsetAttribute=void 0}function l0(e,t){oI.call(this,{entity:e,scene:t,geometryOptions:new lJ(e),geometryPropertyName:"rectangle",observedPropertyNames:["availability","rectangle"]}),this._onEntityPropertyChanged(e,"rectangle",e.rectangle,void 0)}function l1(e,t,i){nD.call(this,e,t,i)}(0,_.Z)(Object.create)&&(l0.prototype=Object.create(oI.prototype),l0.prototype.constructor=l0),l0.prototype.createFillGeometryInstance=function(e){if(p.Z.defined("time",e),!this._fillEnabled)throw new A.Z("This instance does not represent a filled geometry.");let t=this._entity,i=t.isAvailable(e),n={show:new nA.Z(i&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),distanceDisplayCondition:nx.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0,color:void 0};if(this._materialProperty instanceof ny.Z){let t;(0,_.Z)(this._materialProperty.color)&&(this._materialProperty.color.isConstant||i)&&(t=this._materialProperty.color.getValue(e,lq)),(0,_.Z)(t)||(t=C.Z.WHITE),n.color=nE.Z.fromColor(t)}return(0,_.Z)(this._options.offsetAttribute)&&(n.offset=nC.Z.fromCartesian3(L.Z.getValueOrDefault(this._terrainOffsetProperty,e,lY,lX))),new nw.Z({id:t,geometry:new lL(this._options),attributes:n})},l0.prototype.createOutlineGeometryInstance=function(e){if(p.Z.defined("time",e),!this._outlineEnabled)throw new A.Z("This instance does not represent an outlined geometry.");let t=this._entity,i=t.isAvailable(e),n=L.Z.getValueOrDefault(this._outlineColorProperty,e,C.Z.BLACK,lq),r=this._distanceDisplayConditionProperty.getValue(e),o={show:new nA.Z(i&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:nE.Z.fromColor(n),distanceDisplayCondition:nx.fromDistanceDisplayCondition(r),offset:void 0};return(0,_.Z)(this._options.offsetAttribute)&&(o.offset=nC.Z.fromCartesian3(L.Z.getValueOrDefault(this._terrainOffsetProperty,e,lY,lX))),new nw.Z({id:t,geometry:new lW.Z(this._options),attributes:o})},l0.prototype._computeCenter=function(e,t){let i=L.Z.getValueOrUndefined(this._entity.rectangle.coordinates,e,lK);if(!(0,_.Z)(i))return;let n=r5.Z.center(i,lQ);return ea.Z.toCartesian(n,el.Z.WGS84,t)},l0.prototype._isHidden=function(e,t){return!(0,_.Z)(t.coordinates)||nV.prototype._isHidden.call(this,e,t)},l0.prototype._isDynamic=function(e,t){return!t.coordinates.isConstant||!L.Z.isConstant(t.height)||!L.Z.isConstant(t.extrudedHeight)||!L.Z.isConstant(t.granularity)||!L.Z.isConstant(t.stRotation)||!L.Z.isConstant(t.rotation)||!L.Z.isConstant(t.outlineWidth)||!L.Z.isConstant(t.zIndex)||this._onTerrain&&!L.Z.isConstant(this._materialProperty)&&!(this._materialProperty instanceof ny.Z)},l0.prototype._setStaticOptions=function(e,t){let i=this._materialProperty instanceof ny.Z,n=L.Z.getValueOrUndefined(t.height,na.MINIMUM_VALUE),r=L.Z.getValueOrDefault(t.heightReference,na.MINIMUM_VALUE,D.ZP.NONE),o=L.Z.getValueOrUndefined(t.extrudedHeight,na.MINIMUM_VALUE),a=L.Z.getValueOrDefault(t.extrudedHeightReference,na.MINIMUM_VALUE,D.ZP.NONE);(0,_.Z)(o)&&!(0,_.Z)(n)&&(n=0);let s=this._options;s.vertexFormat=i?ng.Z.VERTEX_FORMAT:n_.MaterialSupport.TEXTURED.vertexFormat,s.rectangle=t.coordinates.getValue(na.MINIMUM_VALUE,s.rectangle),s.granularity=L.Z.getValueOrUndefined(t.granularity,na.MINIMUM_VALUE),s.stRotation=L.Z.getValueOrUndefined(t.stRotation,na.MINIMUM_VALUE),s.rotation=L.Z.getValueOrUndefined(t.rotation,na.MINIMUM_VALUE),s.offsetAttribute=oI.computeGeometryOffsetAttribute(n,r,o,a),s.height=oI.getGeometryHeight(n,r),(o=oI.getGeometryExtrudedHeight(o,a))===oI.CLAMP_TO_GROUND&&(o=d.Z.getMinimumMaximumHeights(lL.computeRectangle(s,l$)).minimumTerrainHeight),s.extrudedHeight=o},l0.DynamicGeometryUpdater=l1,(0,_.Z)(Object.create)&&(l1.prototype=Object.create(nD.prototype),l1.prototype.constructor=l1),l1.prototype._isHidden=function(e,t,i){return!(0,_.Z)(this._options.rectangle)||nD.prototype._isHidden.call(this,e,t,i)},l1.prototype._setOptions=function(e,t,i){let n=this._options,r=L.Z.getValueOrUndefined(t.height,i),o=L.Z.getValueOrDefault(t.heightReference,i,D.ZP.NONE),a=L.Z.getValueOrUndefined(t.extrudedHeight,i),s=L.Z.getValueOrDefault(t.extrudedHeightReference,i,D.ZP.NONE);(0,_.Z)(a)&&!(0,_.Z)(r)&&(r=0),n.rectangle=L.Z.getValueOrUndefined(t.coordinates,i,n.rectangle),n.granularity=L.Z.getValueOrUndefined(t.granularity,i),n.stRotation=L.Z.getValueOrUndefined(t.stRotation,i),n.rotation=L.Z.getValueOrUndefined(t.rotation,i),n.offsetAttribute=oI.computeGeometryOffsetAttribute(r,o,a,s),n.height=oI.getGeometryHeight(r,o),(a=oI.getGeometryExtrudedHeight(a,s))===oI.CLAMP_TO_GROUND&&(a=d.Z.getMinimumMaximumHeights(lL.computeRectangle(n,l$)).minimumTerrainHeight),n.extrudedHeight=a};let l2={},l3=new ea.Z,l4=new ea.Z,l5=[,,],l9=[,,],l8={positions:void 0,height:void 0,granularity:void 0,ellipsoid:void 0};l2.computePositions=function(e,t,i,n,r,o){let a,s;let l=function(e,t,i,n){let r=(t=(0,n0.Z)(t,S.Z.equalsEpsilon)).length;if(r<2)return;let o=(0,_.Z)(n),a=(0,_.Z)(i),s=Array(r),l=Array(r),c=Array(r),u=t[0];s[0]=u;let h=e.cartesianToCartographic(u,l3);a&&(h.height=i[0]),l[0]=h.height,o?c[0]=n[0]:c[0]=0;let d=l[0]===c[0],f=1;for(let u=1;u<r;++u){let r=t[u],p=e.cartesianToCartographic(r,l4);(a&&(p.height=i[u]),d=d&&0===p.height,eB.Z.equalsEpsilon(h.latitude,p.latitude,eB.Z.EPSILON10)&&eB.Z.equalsEpsilon(h.longitude,p.longitude,eB.Z.EPSILON10))?h.height<p.height&&(l[f-1]=p.height):(s[f]=r,l[f]=p.height,o?c[f]=n[u]:c[f]=0,d=d&&l[f]===c[f],ea.Z.clone(p,h),++f)}if(!d&&!(f<2))return s.length=f,l.length=f,c.length=f,{positions:s,topHeights:l,bottomHeights:c}}(e,t,i,n);if(!(0,_.Z)(l))return;t=l.positions,i=l.topHeights,n=l.bottomHeights;let c=t.length,u=eB.Z.chordLength(r,e.maximumRadius);if(l8.minDistance=u,l8.ellipsoid=e,o){let e,r=0;for(e=0;e<c-1;e++)r+=n3.Z.numberOfPoints(t[e],t[e+1],u)+1;a=new Float64Array(3*r),s=new Float64Array(3*r),l8.positions=l5,l8.height=l9;let o=0;for(e=0;e<c-1;e++){l5[0]=t[e],l5[1]=t[e+1],l9[0]=i[e],l9[1]=i[e+1];let r=n3.Z.generateArc(l8);a.set(r,o),l9[0]=n[e],l9[1]=n[e+1],s.set(n3.Z.generateArc(l8),o),o+=r.length}}else l8.positions=t,l8.height=i,a=new Float64Array(n3.Z.generateArc(l8)),l8.height=n,s=new Float64Array(n3.Z.generateArc(l8));return{bottomPositions:s,topPositions:a,numCorners:c-2}};let l6=new S.Z,l7=new S.Z,ce=new S.Z,ct=new S.Z,ci=new S.Z,cn=new S.Z,cr=new S.Z;function co(e){let t=(e=(0,m.Z)(e,m.Z.EMPTY_OBJECT)).positions,i=e.maximumHeights,n=e.minimumHeights;if(!(0,_.Z)(t))throw new A.Z("options.positions is required.");if((0,_.Z)(i)&&i.length!==t.length)throw new A.Z("options.positions and options.maximumHeights must have the same length.");if((0,_.Z)(n)&&n.length!==t.length)throw new A.Z("options.positions and options.minimumHeights must have the same length.");let r=(0,m.Z)(e.vertexFormat,nf.Z.DEFAULT),o=(0,m.Z)(e.granularity,eB.Z.RADIANS_PER_DEGREE),a=(0,m.Z)(e.ellipsoid,el.Z.WGS84);this._positions=t,this._minimumHeights=n,this._maximumHeights=i,this._vertexFormat=nf.Z.clone(r),this._granularity=o,this._ellipsoid=el.Z.clone(a),this._workerName="createWallGeometry";let s=1+t.length*S.Z.packedLength+2;(0,_.Z)(n)&&(s+=n.length),(0,_.Z)(i)&&(s+=i.length),this.packedLength=s+el.Z.packedLength+nf.Z.packedLength+1}co.pack=function(e,t,i){let n;if(!(0,_.Z)(e))throw new A.Z("value is required");if(!(0,_.Z)(t))throw new A.Z("array is required");i=(0,m.Z)(i,0);let r=e._positions,o=r.length;for(n=0,t[i++]=o;n<o;++n,i+=S.Z.packedLength)S.Z.pack(r[n],t,i);let a=e._minimumHeights;if(o=(0,_.Z)(a)?a.length:0,t[i++]=o,(0,_.Z)(a))for(n=0;n<o;++n)t[i++]=a[n];let s=e._maximumHeights;if(o=(0,_.Z)(s)?s.length:0,t[i++]=o,(0,_.Z)(s))for(n=0;n<o;++n)t[i++]=s[n];return el.Z.pack(e._ellipsoid,t,i),i+=el.Z.packedLength,nf.Z.pack(e._vertexFormat,t,i),t[i+=nf.Z.packedLength]=e._granularity,t};let ca=el.Z.clone(el.Z.UNIT_SPHERE),cs=new nf.Z,cl={positions:void 0,minimumHeights:void 0,maximumHeights:void 0,ellipsoid:ca,vertexFormat:cs,granularity:void 0};co.unpack=function(e,t,i){let n,r,o;if(!(0,_.Z)(e))throw new A.Z("array is required");t=(0,m.Z)(t,0);let a=e[t++],s=Array(a);for(n=0;n<a;++n,t+=S.Z.packedLength)s[n]=S.Z.unpack(e,t);if((a=e[t++])>0)for(n=0,r=Array(a);n<a;++n)r[n]=e[t++];if((a=e[t++])>0)for(n=0,o=Array(a);n<a;++n)o[n]=e[t++];let l=el.Z.unpack(e,t,ca);t+=el.Z.packedLength;let c=nf.Z.unpack(e,t,cs),u=e[t+=nf.Z.packedLength];return(0,_.Z)(i)?(i._positions=s,i._minimumHeights=r,i._maximumHeights=o,i._ellipsoid=el.Z.clone(l,i._ellipsoid),i._vertexFormat=nf.Z.clone(c,i._vertexFormat),i._granularity=u,i):(cl.positions=s,cl.minimumHeights=r,cl.maximumHeights=o,cl.granularity=u,new co(cl))},co.fromConstantHeights=function(e){let t,i;let n=(e=(0,m.Z)(e,m.Z.EMPTY_OBJECT)).positions;if(!(0,_.Z)(n))throw new A.Z("options.positions is required.");let r=e.minimumHeight,o=e.maximumHeight,a=(0,_.Z)(r),s=(0,_.Z)(o);if(a||s){let e=n.length;t=a?Array(e):void 0,i=s?Array(e):void 0;for(let n=0;n<e;++n)a&&(t[n]=r),s&&(i[n]=o)}return new co({positions:n,maximumHeights:i,minimumHeights:t,ellipsoid:e.ellipsoid,vertexFormat:e.vertexFormat})},co.createGeometry=function(e){let t;let i=e._positions,n=e._minimumHeights,r=e._maximumHeights,o=e._vertexFormat,a=e._granularity,s=e._ellipsoid,l=l2.computePositions(s,i,r,n,a,!0);if(!(0,_.Z)(l))return;let c=l.bottomPositions,u=l.topPositions,h=l.numCorners,d=u.length,p=2*d,m=o.position?new Float64Array(p):void 0,g=o.normal?new Float32Array(p):void 0,Z=o.tangent?new Float32Array(p):void 0,y=o.bitangent?new Float32Array(p):void 0,b=o.st?new Float32Array(p/3*2):void 0,v=0,T=0,E=0,x=0,w=0,C=cr,A=cn,I=ci,O=!0,D=0,P=1/((d/=3)-h-1);for(t=0;t<d;++t){let e=3*t,i=S.Z.fromArray(u,e,l6),n=S.Z.fromArray(c,e,l7);if(o.position&&(m[v++]=n.x,m[v++]=n.y,m[v++]=n.z,m[v++]=i.x,m[v++]=i.y,m[v++]=i.z),o.st&&(b[w++]=D,b[w++]=0,b[w++]=D,b[w++]=1),o.normal||o.tangent||o.bitangent){let n=S.Z.clone(S.Z.ZERO,ct),r=S.Z.subtract(i,s.geodeticSurfaceNormal(i,l7),l7);if(t+1<d&&(n=S.Z.fromArray(u,e+3,ct)),O){let e=S.Z.subtract(n,i,ce),t=S.Z.subtract(r,i,l6);C=S.Z.normalize(S.Z.cross(t,e,C),C),O=!1}S.Z.equalsEpsilon(i,n,eB.Z.EPSILON10)?O=!0:(D+=P,o.tangent&&(A=S.Z.normalize(S.Z.subtract(n,i,A),A)),o.bitangent&&(I=S.Z.normalize(S.Z.cross(C,A,I),I))),o.normal&&(g[T++]=C.x,g[T++]=C.y,g[T++]=C.z,g[T++]=C.x,g[T++]=C.y,g[T++]=C.z),o.tangent&&(Z[x++]=A.x,Z[x++]=A.y,Z[x++]=A.z,Z[x++]=A.x,Z[x++]=A.y,Z[x++]=A.z),o.bitangent&&(y[E++]=I.x,y[E++]=I.y,y[E++]=I.z,y[E++]=I.x,y[E++]=I.y,y[E++]=I.z)}}let R=new r3.Z;o.position&&(R.position=new r2.Z({componentDatatype:eM.Z.DOUBLE,componentsPerAttribute:3,values:m})),o.normal&&(R.normal=new r2.Z({componentDatatype:eM.Z.FLOAT,componentsPerAttribute:3,values:g})),o.tangent&&(R.tangent=new r2.Z({componentDatatype:eM.Z.FLOAT,componentsPerAttribute:3,values:Z})),o.bitangent&&(R.bitangent=new r2.Z({componentDatatype:eM.Z.FLOAT,componentsPerAttribute:3,values:y})),o.st&&(R.st=new r2.Z({componentDatatype:eM.Z.FLOAT,componentsPerAttribute:2,values:b}));let N=p/3;p-=6*(h+1);let L=ez.Z.createTypedArray(N,p),M=0;for(t=0;t<N-2;t+=2){let e=t,i=t+2,n=S.Z.fromArray(m,3*e,l6),r=S.Z.fromArray(m,3*i,l7);if(S.Z.equalsEpsilon(n,r,eB.Z.EPSILON10))continue;let o=t+1,a=t+3;L[M++]=o,L[M++]=e,L[M++]=a,L[M++]=a,L[M++]=e,L[M++]=i}return new r1.Z({attributes:R,indices:L,primitiveType:iT.Z.TRIANGLES,boundingSphere:new f.Z.fromVertices(m)})};let cc=new S.Z,cu=new S.Z;function ch(e){let t=(e=(0,m.Z)(e,m.Z.EMPTY_OBJECT)).positions,i=e.maximumHeights,n=e.minimumHeights;if(!(0,_.Z)(t))throw new A.Z("options.positions is required.");if((0,_.Z)(i)&&i.length!==t.length)throw new A.Z("options.positions and options.maximumHeights must have the same length.");if((0,_.Z)(n)&&n.length!==t.length)throw new A.Z("options.positions and options.minimumHeights must have the same length.");let r=(0,m.Z)(e.granularity,eB.Z.RADIANS_PER_DEGREE),o=(0,m.Z)(e.ellipsoid,el.Z.WGS84);this._positions=t,this._minimumHeights=n,this._maximumHeights=i,this._granularity=r,this._ellipsoid=el.Z.clone(o),this._workerName="createWallOutlineGeometry";let a=1+t.length*S.Z.packedLength+2;(0,_.Z)(n)&&(a+=n.length),(0,_.Z)(i)&&(a+=i.length),this.packedLength=a+el.Z.packedLength+1}ch.pack=function(e,t,i){let n;if(!(0,_.Z)(e))throw new A.Z("value is required");if(!(0,_.Z)(t))throw new A.Z("array is required");i=(0,m.Z)(i,0);let r=e._positions,o=r.length;for(n=0,t[i++]=o;n<o;++n,i+=S.Z.packedLength)S.Z.pack(r[n],t,i);let a=e._minimumHeights;if(o=(0,_.Z)(a)?a.length:0,t[i++]=o,(0,_.Z)(a))for(n=0;n<o;++n)t[i++]=a[n];let s=e._maximumHeights;if(o=(0,_.Z)(s)?s.length:0,t[i++]=o,(0,_.Z)(s))for(n=0;n<o;++n)t[i++]=s[n];return el.Z.pack(e._ellipsoid,t,i),t[i+=el.Z.packedLength]=e._granularity,t};let cd=el.Z.clone(el.Z.UNIT_SPHERE),cf={positions:void 0,minimumHeights:void 0,maximumHeights:void 0,ellipsoid:cd,granularity:void 0};ch.unpack=function(e,t,i){let n,r,o;if(!(0,_.Z)(e))throw new A.Z("array is required");t=(0,m.Z)(t,0);let a=e[t++],s=Array(a);for(n=0;n<a;++n,t+=S.Z.packedLength)s[n]=S.Z.unpack(e,t);if((a=e[t++])>0)for(n=0,r=Array(a);n<a;++n)r[n]=e[t++];if((a=e[t++])>0)for(n=0,o=Array(a);n<a;++n)o[n]=e[t++];let l=el.Z.unpack(e,t,cd),c=e[t+=el.Z.packedLength];return(0,_.Z)(i)?(i._positions=s,i._minimumHeights=r,i._maximumHeights=o,i._ellipsoid=el.Z.clone(l,i._ellipsoid),i._granularity=c,i):(cf.positions=s,cf.minimumHeights=r,cf.maximumHeights=o,cf.granularity=c,new ch(cf))},ch.fromConstantHeights=function(e){let t,i;let n=(e=(0,m.Z)(e,m.Z.EMPTY_OBJECT)).positions;if(!(0,_.Z)(n))throw new A.Z("options.positions is required.");let r=e.minimumHeight,o=e.maximumHeight,a=(0,_.Z)(r),s=(0,_.Z)(o);if(a||s){let e=n.length;t=a?Array(e):void 0,i=s?Array(e):void 0;for(let n=0;n<e;++n)a&&(t[n]=r),s&&(i[n]=o)}return new ch({positions:n,maximumHeights:i,minimumHeights:t,ellipsoid:e.ellipsoid})},ch.createGeometry=function(e){let t;let i=e._positions,n=e._minimumHeights,r=e._maximumHeights,o=e._granularity,a=e._ellipsoid,s=l2.computePositions(a,i,r,n,o,!1);if(!(0,_.Z)(s))return;let l=s.bottomPositions,c=s.topPositions,u=c.length,h=2*u,d=new Float64Array(h),p=0;for(u/=3,t=0;t<u;++t){let e=3*t,i=S.Z.fromArray(c,e,cc),n=S.Z.fromArray(l,e,cu);d[p++]=n.x,d[p++]=n.y,d[p++]=n.z,d[p++]=i.x,d[p++]=i.y,d[p++]=i.z}let m=new r3.Z({position:new r2.Z({componentDatatype:eM.Z.DOUBLE,componentsPerAttribute:3,values:d})}),g=h/3;h=2*g-4+g;let Z=ez.Z.createTypedArray(g,h),y=0;for(t=0;t<g-2;t+=2){let e=t,i=t+2,n=S.Z.fromArray(d,3*e,cc),r=S.Z.fromArray(d,3*i,cu);if(S.Z.equalsEpsilon(n,r,eB.Z.EPSILON10))continue;let o=t+1,a=t+3;Z[y++]=o,Z[y++]=e,Z[y++]=o,Z[y++]=a,Z[y++]=e,Z[y++]=i}return Z[y++]=g-2,Z[y++]=g-1,new r1.Z({attributes:m,indices:Z,primitiveType:iT.Z.LINES,boundingSphere:new f.Z.fromVertices(d)})};let cp=new C.Z;function cm(e){this.id=e,this.vertexFormat=void 0,this.positions=void 0,this.minimumHeights=void 0,this.maximumHeights=void 0,this.granularity=void 0}function c_(e,t){nV.call(this,{entity:e,scene:t,geometryOptions:new cm(e),geometryPropertyName:"wall",observedPropertyNames:["availability","wall"]}),this._onEntityPropertyChanged(e,"wall",e.wall,void 0)}function cg(e,t,i){nD.call(this,e,t,i)}(0,_.Z)(Object.create)&&(c_.prototype=Object.create(nV.prototype),c_.prototype.constructor=c_),c_.prototype.createFillGeometryInstance=function(e){let t;if(p.Z.defined("time",e),!this._fillEnabled)throw new A.Z("This instance does not represent a filled geometry.");let i=this._entity,n=i.isAvailable(e),r=new nA.Z(n&&i.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),o=this._distanceDisplayConditionProperty.getValue(e),a=nx.fromDistanceDisplayCondition(o);if(this._materialProperty instanceof ny.Z){let i;(0,_.Z)(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(i=this._materialProperty.color.getValue(e,cp)),(0,_.Z)(i)||(i=C.Z.WHITE),t={show:r,distanceDisplayCondition:a,color:nE.Z.fromColor(i)}}else t={show:r,distanceDisplayCondition:a};return new nw.Z({id:i,geometry:new co(this._options),attributes:t})},c_.prototype.createOutlineGeometryInstance=function(e){if(p.Z.defined("time",e),!this._outlineEnabled)throw new A.Z("This instance does not represent an outlined geometry.");let t=this._entity,i=t.isAvailable(e),n=L.Z.getValueOrDefault(this._outlineColorProperty,e,C.Z.BLACK,cp),r=this._distanceDisplayConditionProperty.getValue(e);return new nw.Z({id:t,geometry:new ch(this._options),attributes:{show:new nA.Z(i&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:nE.Z.fromColor(n),distanceDisplayCondition:nx.fromDistanceDisplayCondition(r)}})},c_.prototype._isHidden=function(e,t){return!(0,_.Z)(t.positions)||nV.prototype._isHidden.call(this,e,t)},c_.prototype._getIsClosed=function(e){return!1},c_.prototype._isDynamic=function(e,t){return!t.positions.isConstant||!L.Z.isConstant(t.minimumHeights)||!L.Z.isConstant(t.maximumHeights)||!L.Z.isConstant(t.outlineWidth)||!L.Z.isConstant(t.granularity)},c_.prototype._setStaticOptions=function(e,t){let i=t.minimumHeights,n=t.maximumHeights,r=t.granularity,o=this._materialProperty instanceof ny.Z,a=this._options;a.vertexFormat=o?ng.Z.VERTEX_FORMAT:n_.MaterialSupport.TEXTURED.vertexFormat,a.positions=t.positions.getValue(na.MINIMUM_VALUE,a.positions),a.minimumHeights=(0,_.Z)(i)?i.getValue(na.MINIMUM_VALUE,a.minimumHeights):void 0,a.maximumHeights=(0,_.Z)(n)?n.getValue(na.MINIMUM_VALUE,a.maximumHeights):void 0,a.granularity=(0,_.Z)(r)?r.getValue(na.MINIMUM_VALUE):void 0},c_.DynamicGeometryUpdater=cg,(0,_.Z)(Object.create)&&(cg.prototype=Object.create(nD.prototype),cg.prototype.constructor=cg),cg.prototype._isHidden=function(e,t,i){return!(0,_.Z)(this._options.positions)||nD.prototype._isHidden.call(this,e,t,i)},cg.prototype._setOptions=function(e,t,i){let n=this._options;n.positions=L.Z.getValueOrUndefined(t.positions,i,n.positions),n.minimumHeights=L.Z.getValueOrUndefined(t.minimumHeights,i,n.minimumHeights),n.maximumHeights=L.Z.getValueOrUndefined(t.maximumHeights,i,n.maximumHeights),n.granularity=L.Z.getValueOrUndefined(t.granularity,i)};let cZ=[nQ,o0,oL,aW,a4,ss,s7,ld,l0,c_];function cy(e,t){this.entity=e,this.scene=t;let i=Array(cZ.length),n=new et.Z,r=new Z.Z;for(let o=0;o<i.length;o++){let a=new cZ[o](e,t);r.add(a.geometryChanged,e=>{n.raiseEvent(e)}),i[o]=a}this.updaters=i,this.geometryChanged=n,this.eventHelper=r,this._removeEntitySubscription=e.definitionChanged.addEventListener(cy.prototype._onEntityPropertyChanged,this)}cy.prototype._onEntityPropertyChanged=function(e,t,i,n){let r=this.updaters;for(let o=0;o<r.length;o++)r[o]._onEntityPropertyChanged(e,t,i,n)},cy.prototype.forEach=function(e){let t=this.updaters;for(let i=0;i<t.length;i++)e(t[i])},cy.prototype.destroy=function(){this.eventHelper.removeAll();let e=this.updaters;for(let t=0;t<e.length;t++)e[t].destroy();this._removeEntitySubscription(),(0,g.Z)(this)},cy.registerUpdater=function(e){cZ.includes(e)||cZ.push(e)},cy.unregisterUpdater=function(e){if(cZ.includes(e)){let t=cZ.indexOf(e);cZ.splice(t,1)}};let cb=new C.Z,cv=new I.Z,cT=new I.Z,cE=S.Z.ZERO,cx=new S.Z;function cw(e,t,i,n,r,o,a){let s;this.translucent=t,this.appearanceType=i,this.depthFailAppearanceType=n,this.depthFailMaterialProperty=r,this.depthFailMaterial=void 0,this.closed=o,this.shadows=a,this.primitives=e,this.createPrimitive=!1,this.waitingOnCreate=!1,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new E.Z,this.updaters=new E.Z,this.updatersWithAttributes=new E.Z,this.attributes=new E.Z,this.subscriptions=new E.Z,this.showsUpdated=new E.Z,this.itemsToRemove=[],this.invalidated=!1,(0,_.Z)(r)&&(s=r.definitionChanged.addEventListener(cw.prototype.onMaterialChanged,this)),this.removeMaterialSubscription=s}function cS(e,t,i,n,r){this._solidItems=[],this._translucentItems=[],this._primitives=e,this._appearanceType=t,this._depthFailAppearanceType=i,this._closed=n,this._shadows=r}function cC(e,t){let i=e.length;for(let n=i-1;n>=0;n--){let i=e[n];if(i.remove(t))return 0===i.updaters.length&&(e.splice(n,1),i.destroy()),!0}return!1}function cA(e,t,i){let n=!1,r=t.length;for(let o=0;o<r;++o){let r=t[o],a=r.itemsToRemove,s=a.length;if(s>0)for(o=0;o<s;o++){let t=a[o];r.remove(t),e.add(i,t),n=!0}}return n}function cI(e,t,i,n){let r,o=t.length;for(r=o-1;r>=0;r--){let n=t[r];if(n.invalidated){t.splice(r,1);let o=n.updaters.values,a=o.length;for(let t=0;t<a;t++)e.add(i,o[t]);n.destroy()}}for(r=0,o=t.length;r<o;++r)n=t[r].update(i)&&n;return n}function cO(e,t,i){let n=e.length;for(let r=0;r<n;r++){let n=e[r];if(n.contains(t))return n.getBoundingSphere(t,i)}return N.FAILED}function cD(e){let t=e.length;for(let i=0;i<t;i++)e[i].destroy();e.length=0}cw.prototype.onMaterialChanged=function(){this.invalidated=!0},cw.prototype.isMaterial=function(e){let t=this.depthFailMaterialProperty,i=e.depthFailMaterialProperty;return i===t||!!(0,_.Z)(t)&&t.equals(i)},cw.prototype.add=function(e,t){let i=e.id;if(this.createPrimitive=!0,this.geometry.set(i,t),this.updaters.set(i,e),e.hasConstantFill&&e.fillMaterialProperty.isConstant&&L.Z.isConstant(e.distanceDisplayConditionProperty)&&L.Z.isConstant(e.terrainOffsetProperty)){let t=this;this.subscriptions.set(i,e.entity.definitionChanged.addEventListener(function(i,n,r,o){"isShowing"===n&&t.showsUpdated.set(e.id,e)}))}else this.updatersWithAttributes.set(i,e)},cw.prototype.remove=function(e){let t=e.id;if(this.createPrimitive=this.geometry.remove(t)||this.createPrimitive,this.updaters.remove(t)){this.updatersWithAttributes.remove(t);let e=this.subscriptions.get(t);return(0,_.Z)(e)&&(e(),this.subscriptions.remove(t),this.showsUpdated.remove(t)),!0}return!1},cw.prototype.update=function(e){let t,i=!0,n=0,r=this.primitive,o=this.primitives;if(this.createPrimitive){let t=this.geometry.values;if(t.length>0){let n;(0,_.Z)(r)&&((0,_.Z)(this.oldPrimitive)?o.remove(r):this.oldPrimitive=r),(0,_.Z)(this.depthFailAppearanceType)&&((0,_.Z)(this.depthFailMaterialProperty)&&(this.depthFailMaterial=nO.getValue(e,this.depthFailMaterialProperty,this.depthFailMaterial)),n=new this.depthFailAppearanceType({material:this.depthFailMaterial,translucent:this.translucent,closed:this.closed})),r=new nI.Z({show:!1,asynchronous:!0,geometryInstances:t.slice(),appearance:new this.appearanceType({translucent:this.translucent,closed:this.closed}),depthFailAppearance:n,shadows:this.shadows}),o.add(r),i=!1}else{(0,_.Z)(r)&&(o.remove(r),r=void 0);let e=this.oldPrimitive;(0,_.Z)(e)&&(o.remove(e),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=r,this.createPrimitive=!1,this.waitingOnCreate=!0}else if((0,_.Z)(r)&&r.ready){r.show=!0,(0,_.Z)(this.oldPrimitive)&&(o.remove(this.oldPrimitive),this.oldPrimitive=void 0),!(0,_.Z)(this.depthFailAppearanceType)||this.depthFailMaterialProperty instanceof ny.Z||(this.depthFailMaterial=nO.getValue(e,this.depthFailMaterialProperty,this.depthFailMaterial),this.primitive.depthFailAppearance.material=this.depthFailMaterial);let i=this.updatersWithAttributes.values,a=i.length,s=this.waitingOnCreate;for(t=0;t<a;t++){let o=i[t],a=this.geometry.get(o.id),l=this.attributes.get(a.id.id);if((0,_.Z)(l)||(l=r.getGeometryInstanceAttributes(a.id),this.attributes.set(a.id.id,l)),!o.fillMaterialProperty.isConstant||s){let t=o.fillMaterialProperty.color,i=L.Z.getValueOrDefault(t,e,C.Z.WHITE,cb);C.Z.equals(l._lastColor,i)||(l._lastColor=C.Z.clone(i,l._lastColor),l.color=nE.Z.toValue(i,l.color),(!this.translucent||255!==l.color[3])&&(this.translucent||255===l.color[3])||(this.itemsToRemove[n++]=o))}if((0,_.Z)(this.depthFailAppearanceType)&&o.depthFailMaterialProperty instanceof ny.Z&&(!o.depthFailMaterialProperty.isConstant||s)){let t=o.depthFailMaterialProperty.color,i=L.Z.getValueOrDefault(t,e,C.Z.WHITE,cb);C.Z.equals(l._lastDepthFailColor,i)||(l._lastDepthFailColor=C.Z.clone(i,l._lastDepthFailColor),l.depthFailColor=nE.Z.toValue(i,l.depthFailColor))}let c=o.entity.isShowing&&(o.hasConstantFill||o.isFilled(e));c!==(1===l.show[0])&&(l.show=nA.Z.toValue(c,l.show));let u=o.distanceDisplayConditionProperty;if(!L.Z.isConstant(u)){let t=L.Z.getValueOrDefault(u,e,cT,cv);I.Z.equals(t,l._lastDistanceDisplayCondition)||(l._lastDistanceDisplayCondition=I.Z.clone(t,l._lastDistanceDisplayCondition),l.distanceDisplayCondition=nx.toValue(t,l.distanceDisplayCondition))}let h=o.terrainOffsetProperty;if(!L.Z.isConstant(h)){let t=L.Z.getValueOrDefault(h,e,cE,cx);S.Z.equals(t,l._lastOffset)||(l._lastOffset=S.Z.clone(t,l._lastOffset),l.offset=nC.Z.toValue(t,l.offset))}}this.updateShows(r),this.waitingOnCreate=!1}else(0,_.Z)(r)&&!r.ready&&(i=!1);return this.itemsToRemove.length=n,i},cw.prototype.updateShows=function(e){let t=this.showsUpdated.values,i=t.length;for(let n=0;n<i;n++){let i=t[n],r=this.geometry.get(i.id),o=this.attributes.get(r.id.id);(0,_.Z)(o)||(o=e.getGeometryInstanceAttributes(r.id),this.attributes.set(r.id.id,o));let a=i.entity.isShowing;a!==(1===o.show[0])&&(o.show=nA.Z.toValue(a,o.show),r.attributes.show.value[0]=o.show[0])}this.showsUpdated.removeAll()},cw.prototype.contains=function(e){return this.updaters.contains(e.id)},cw.prototype.getBoundingSphere=function(e,t){let i=this.primitive;if(!i.ready)return N.PENDING;let n=i.getGeometryInstanceAttributes(e.entity);return!(0,_.Z)(n)||!(0,_.Z)(n.boundingSphere)||(0,_.Z)(n.show)&&0===n.show[0]?N.FAILED:(n.boundingSphere.clone(t),N.DONE)},cw.prototype.destroy=function(){let e=this.primitive,t=this.primitives;(0,_.Z)(e)&&t.remove(e);let i=this.oldPrimitive;(0,_.Z)(i)&&t.remove(i),(0,_.Z)(this.removeMaterialSubscription)&&this.removeMaterialSubscription()},cS.prototype.add=function(e,t){let i,n;let r=t.createFillGeometryInstance(e);255===r.attributes.color.value[3]?(i=this._solidItems,n=!1):(i=this._translucentItems,n=!0);let o=i.length;for(let e=0;e<o;e++){let n=i[e];if(n.isMaterial(t)){n.add(t,r);return}}let a=new cw(this._primitives,n,this._appearanceType,this._depthFailAppearanceType,t.depthFailMaterialProperty,this._closed,this._shadows);a.add(t,r),i.push(a)},cS.prototype.remove=function(e){cC(this._solidItems,e)||cC(this._translucentItems,e)},cS.prototype.update=function(e){let t=cI(this,this._solidItems,e,!0);t=cI(this,this._translucentItems,e,t)&&t;let i=cA(this,this._solidItems,e),n=cA(this,this._translucentItems,e);return(i||n)&&(t=cI(this,this._solidItems,e,t)&&t,t=cI(this,this._translucentItems,e,t)&&t),t},cS.prototype.getBoundingSphere=function(e,t){let i=cO(this._solidItems,e,t);return i===N.FAILED?cO(this._translucentItems,e,t):i},cS.prototype.removeAllPrimitives=function(){cD(this._solidItems),cD(this._translucentItems)};let cP=new I.Z,cR=new I.Z,cN=S.Z.ZERO,cL=new S.Z;function cM(e,t,i,n,r,o,a){this.primitives=e,this.appearanceType=t,this.materialProperty=i,this.depthFailAppearanceType=n,this.depthFailMaterialProperty=r,this.closed=o,this.shadows=a,this.updaters=new E.Z,this.createPrimitive=!0,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new E.Z,this.material=void 0,this.depthFailMaterial=void 0,this.updatersWithAttributes=new E.Z,this.attributes=new E.Z,this.invalidated=!1,this.removeMaterialSubscription=i.definitionChanged.addEventListener(cM.prototype.onMaterialChanged,this),this.subscriptions=new E.Z,this.showsUpdated=new E.Z}cM.prototype.onMaterialChanged=function(){this.invalidated=!0},cM.prototype.isMaterial=function(e){let t=this.materialProperty,i=e.fillMaterialProperty,n=this.depthFailMaterialProperty,r=e.depthFailMaterialProperty;if(i===t&&r===n)return!0;let o=(0,_.Z)(t)&&t.equals(i);return(!(0,_.Z)(n)&&!(0,_.Z)(r)||(0,_.Z)(n)&&n.equals(r))&&o},cM.prototype.add=function(e,t){let i=t.id;if(this.updaters.set(i,t),this.geometry.set(i,t.createFillGeometryInstance(e)),t.hasConstantFill&&t.fillMaterialProperty.isConstant&&L.Z.isConstant(t.distanceDisplayConditionProperty)&&L.Z.isConstant(t.terrainOffsetProperty)){let e=this;this.subscriptions.set(i,t.entity.definitionChanged.addEventListener(function(i,n,r,o){"isShowing"===n&&e.showsUpdated.set(t.id,t)}))}else this.updatersWithAttributes.set(i,t);this.createPrimitive=!0},cM.prototype.remove=function(e){let t=e.id;if(this.createPrimitive=this.geometry.remove(t)||this.createPrimitive,this.updaters.remove(t)){this.updatersWithAttributes.remove(t);let e=this.subscriptions.get(t);return(0,_.Z)(e)&&(e(),this.subscriptions.remove(t),this.showsUpdated.remove(t)),!0}return!1};let cF=new C.Z;function cz(e,t,i,n,r){this._items=[],this._primitives=e,this._appearanceType=t,this._depthFailAppearanceType=i,this._closed=n,this._shadows=r}cM.prototype.update=function(e){let t,i=!0,n=this.primitive,r=this.primitives,o=this.geometry.values;if(this.createPrimitive){if(o.length>0){let t;(0,_.Z)(n)&&((0,_.Z)(this.oldPrimitive)?r.remove(n):this.oldPrimitive=n),this.material=nO.getValue(e,this.materialProperty,this.material),(0,_.Z)(this.depthFailMaterialProperty)&&(this.depthFailMaterial=nO.getValue(e,this.depthFailMaterialProperty,this.depthFailMaterial),t=new this.depthFailAppearanceType({material:this.depthFailMaterial,translucent:this.depthFailMaterial.isTranslucent(),closed:this.closed})),n=new nI.Z({show:!1,asynchronous:!0,geometryInstances:o.slice(),appearance:new this.appearanceType({material:this.material,translucent:this.material.isTranslucent(),closed:this.closed}),depthFailAppearance:t,shadows:this.shadows}),r.add(n),i=!1}else{(0,_.Z)(n)&&(r.remove(n),n=void 0);let e=this.oldPrimitive;(0,_.Z)(e)&&(r.remove(e),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=n,this.createPrimitive=!1}else if((0,_.Z)(n)&&n.ready){n.show=!0,(0,_.Z)(this.oldPrimitive)&&(r.remove(this.oldPrimitive),this.oldPrimitive=void 0),this.material=nO.getValue(e,this.materialProperty,this.material),this.primitive.appearance.material=this.material,!(0,_.Z)(this.depthFailAppearanceType)||this.depthFailMaterialProperty instanceof ny.Z||(this.depthFailMaterial=nO.getValue(e,this.depthFailMaterialProperty,this.depthFailMaterial),this.primitive.depthFailAppearance.material=this.depthFailMaterial);let i=this.updatersWithAttributes.values,o=i.length;for(t=0;t<o;t++){let r=i[t],o=r.entity,a=this.geometry.get(r.id),s=this.attributes.get(a.id.id);if((0,_.Z)(s)||(s=n.getGeometryInstanceAttributes(a.id),this.attributes.set(a.id.id,s)),(0,_.Z)(this.depthFailAppearanceType)&&this.depthFailMaterialProperty instanceof ny.Z&&!r.depthFailMaterialProperty.isConstant){let t=r.depthFailMaterialProperty.color,i=L.Z.getValueOrDefault(t,e,C.Z.WHITE,cF);C.Z.equals(s._lastDepthFailColor,i)||(s._lastDepthFailColor=C.Z.clone(i,s._lastDepthFailColor),s.depthFailColor=nE.Z.toValue(i,s.depthFailColor))}let l=o.isShowing&&(r.hasConstantFill||r.isFilled(e));l!==(1===s.show[0])&&(s.show=nA.Z.toValue(l,s.show));let c=r.distanceDisplayConditionProperty;if(!L.Z.isConstant(c)){let t=L.Z.getValueOrDefault(c,e,cR,cP);I.Z.equals(t,s._lastDistanceDisplayCondition)||(s._lastDistanceDisplayCondition=I.Z.clone(t,s._lastDistanceDisplayCondition),s.distanceDisplayCondition=nx.toValue(t,s.distanceDisplayCondition))}let u=r.terrainOffsetProperty;if(!L.Z.isConstant(u)){let t=L.Z.getValueOrDefault(u,e,cN,cL);S.Z.equals(t,s._lastOffset)||(s._lastOffset=S.Z.clone(t,s._lastOffset),s.offset=nC.Z.toValue(t,s.offset))}}this.updateShows(n)}else(0,_.Z)(n)&&!n.ready&&(i=!1);return i},cM.prototype.updateShows=function(e){let t=this.showsUpdated.values,i=t.length;for(let n=0;n<i;n++){let i=t[n],r=i.entity,o=this.geometry.get(i.id),a=this.attributes.get(o.id.id);(0,_.Z)(a)||(a=e.getGeometryInstanceAttributes(o.id),this.attributes.set(o.id.id,a));let s=r.isShowing;s!==(1===a.show[0])&&(a.show=nA.Z.toValue(s,a.show),o.attributes.show.value[0]=a.show[0])}this.showsUpdated.removeAll()},cM.prototype.contains=function(e){return this.updaters.contains(e.id)},cM.prototype.getBoundingSphere=function(e,t){let i=this.primitive;if(!i.ready)return N.PENDING;let n=i.getGeometryInstanceAttributes(e.entity);return!(0,_.Z)(n)||!(0,_.Z)(n.boundingSphere)||(0,_.Z)(n.show)&&0===n.show[0]?N.FAILED:(n.boundingSphere.clone(t),N.DONE)},cM.prototype.destroy=function(){let e=this.primitive,t=this.primitives;(0,_.Z)(e)&&t.remove(e);let i=this.oldPrimitive;(0,_.Z)(i)&&t.remove(i),this.removeMaterialSubscription()},cz.prototype.add=function(e,t){let i=this._items,n=i.length;for(let r=0;r<n;r++){let n=i[r];if(n.isMaterial(t)){n.add(e,t);return}}let r=new cM(this._primitives,this._appearanceType,t.fillMaterialProperty,this._depthFailAppearanceType,t.depthFailMaterialProperty,this._closed,this._shadows);r.add(e,t),i.push(r)},cz.prototype.remove=function(e){let t=this._items,i=t.length;for(let n=i-1;n>=0;n--){let i=t[n];if(i.remove(e)){0===i.updaters.length&&(t.splice(n,1),i.destroy());break}}},cz.prototype.update=function(e){let t;let i=this._items;for(t=i.length-1;t>=0;t--){let n=i[t];if(n.invalidated){i.splice(t,1);let r=n.updaters.values,o=r.length;for(let t=0;t<o;t++)this.add(e,r[t]);n.destroy()}}let n=!0;for(t=0;t<i.length;t++)n=i[t].update(e)&&n;return n},cz.prototype.getBoundingSphere=function(e,t){let i=this._items,n=i.length;for(let r=0;r<n;r++){let n=i[r];if(n.contains(e))return n.getBoundingSphere(e,t)}return N.FAILED},cz.prototype.removeAllPrimitives=function(){let e=this._items,t=e.length;for(let i=0;i<t;i++)e[i].destroy();this._items.length=0};var cB=i(8511);function cU(){this._tree=new cB}function ck(){this.minX=0,this.minY=0,this.maxX=0,this.maxY=0,this.id=""}function cV(e,t){return e.id===t.id}ck.fromRectangleAndId=function(e,t,i){return i.minX=t.west,i.minY=t.south,i.maxX=t.east,i.maxY=t.north,i.id=e,i},cU.prototype.insert=function(e,t){p.Z.typeOf.string("id",e),p.Z.typeOf.object("rectangle",t);let i=ck.fromRectangleAndId(e,t,new ck);this._tree.insert(i)};let cH=new ck;cU.prototype.remove=function(e,t){p.Z.typeOf.string("id",e),p.Z.typeOf.object("rectangle",t);let i=ck.fromRectangleAndId(e,t,cH);this._tree.remove(i,cV)};let cG=new ck;cU.prototype.collides=function(e){p.Z.typeOf.object("rectangle",e);let t=ck.fromRectangleAndId("",e,cG);return this._tree.collides(t)};let cj=new C.Z,cW=new I.Z,cq=new I.Z;function cY(e,t,i,n){this.primitives=e,this.zIndex=n,this.classificationType=t,this.color=i,this.createPrimitive=!1,this.waitingOnCreate=!1,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new E.Z,this.updaters=new E.Z,this.updatersWithAttributes=new E.Z,this.attributes=new E.Z,this.subscriptions=new E.Z,this.showsUpdated=new E.Z,this.itemsToRemove=[],this.isDirty=!1,this.rectangleCollisionCheck=new cU}function cX(e,t){this._batches=[],this._primitives=e,this._classificationType=t}cY.prototype.overlapping=function(e){return this.rectangleCollisionCheck.collides(e)},cY.prototype.add=function(e,t){let i=e.id;if(this.createPrimitive=!0,this.geometry.set(i,t),this.updaters.set(i,e),this.rectangleCollisionCheck.insert(i,t.geometry.rectangle),e.hasConstantFill&&e.fillMaterialProperty.isConstant&&L.Z.isConstant(e.distanceDisplayConditionProperty)){let t=this;this.subscriptions.set(i,e.entity.definitionChanged.addEventListener(function(i,n,r,o){"isShowing"===n&&t.showsUpdated.set(e.id,e)}))}else this.updatersWithAttributes.set(i,e)},cY.prototype.remove=function(e){let t=e.id,i=this.geometry.get(t);if(this.createPrimitive=this.geometry.remove(t)||this.createPrimitive,this.updaters.remove(t)){this.rectangleCollisionCheck.remove(t,i.geometry.rectangle),this.updatersWithAttributes.remove(t);let e=this.subscriptions.get(t);return(0,_.Z)(e)&&(e(),this.subscriptions.remove(t),this.showsUpdated.remove(t)),!0}return!1},cY.prototype.update=function(e){let t,i=!0,n=this.primitive,r=this.primitives;if(this.createPrimitive){let e=this.geometry.values;if(e.length>0)(0,_.Z)(n)&&((0,_.Z)(this.oldPrimitive)?r.remove(n):this.oldPrimitive=n),n=new b.Z({show:!1,asynchronous:!0,geometryInstances:e.slice(),classificationType:this.classificationType}),r.add(n,this.zIndex),i=!1;else{(0,_.Z)(n)&&(r.remove(n),n=void 0);let e=this.oldPrimitive;(0,_.Z)(e)&&(r.remove(e),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=n,this.createPrimitive=!1,this.waitingOnCreate=!0}else if((0,_.Z)(n)&&n.ready){n.show=!0,(0,_.Z)(this.oldPrimitive)&&(r.remove(this.oldPrimitive),this.oldPrimitive=void 0);let i=this.updatersWithAttributes.values,o=i.length,a=this.waitingOnCreate;for(t=0;t<o;t++){let r=i[t],o=this.geometry.get(r.id),s=this.attributes.get(o.id.id);if((0,_.Z)(s)||(s=n.getGeometryInstanceAttributes(o.id),this.attributes.set(o.id.id,s)),!r.fillMaterialProperty.isConstant||a){let t=r.fillMaterialProperty.color,i=L.Z.getValueOrDefault(t,e,C.Z.WHITE,cj);C.Z.equals(s._lastColor,i)||(s._lastColor=C.Z.clone(i,s._lastColor),s.color=nE.Z.toValue(i,s.color))}let l=r.entity.isShowing&&(r.hasConstantFill||r.isFilled(e));l!==(1===s.show[0])&&(s.show=nA.Z.toValue(l,s.show));let c=r.distanceDisplayConditionProperty;if(!L.Z.isConstant(c)){let t=L.Z.getValueOrDefault(c,e,cq,cW);I.Z.equals(t,s._lastDistanceDisplayCondition)||(s._lastDistanceDisplayCondition=I.Z.clone(t,s._lastDistanceDisplayCondition),s.distanceDisplayCondition=nx.toValue(t,s.distanceDisplayCondition))}}this.updateShows(n),this.waitingOnCreate=!1}else(0,_.Z)(n)&&!n.ready&&(i=!1);return this.itemsToRemove.length=0,i},cY.prototype.updateShows=function(e){let t=this.showsUpdated.values,i=t.length;for(let n=0;n<i;n++){let i=t[n],r=this.geometry.get(i.id),o=this.attributes.get(r.id.id);(0,_.Z)(o)||(o=e.getGeometryInstanceAttributes(r.id),this.attributes.set(r.id.id,o));let a=i.entity.isShowing;a!==(1===o.show[0])&&(o.show=nA.Z.toValue(a,o.show),r.attributes.show.value[0]=o.show[0])}this.showsUpdated.removeAll()},cY.prototype.contains=function(e){return this.updaters.contains(e.id)},cY.prototype.getBoundingSphere=function(e,t){let i=this.primitive;if(!i.ready)return N.PENDING;let n=i.getBoundingSphere(e.entity);return(0,_.Z)(n)?(n.clone(t),N.DONE):N.FAILED},cY.prototype.removeAllPrimitives=function(){let e=this.primitives,t=this.primitive;(0,_.Z)(t)&&(e.remove(t),this.primitive=void 0,this.geometry.removeAll(),this.updaters.removeAll());let i=this.oldPrimitive;(0,_.Z)(i)&&(e.remove(i),this.oldPrimitive=void 0)},cX.prototype.add=function(e,t){let i;let n=t.createFillGeometryInstance(e),r=this._batches,o=L.Z.getValueOrDefault(t.zIndex,0),a=r.length;for(let e=0;e<a;++e){let t=r[e];if(t.zIndex===o&&!t.overlapping(n.geometry.rectangle)){i=t;break}}return(0,_.Z)(i)||(i=new cY(this._primitives,this._classificationType,n.attributes.color.value,o),r.push(i)),i.add(t,n),i},cX.prototype.remove=function(e){let t=this._batches,i=t.length;for(let n=0;n<i;++n)if(t[n].remove(e))return},cX.prototype.update=function(e){let t,i;let n=!0,r=this._batches,o=r.length;for(t=0;t<o;++t)n=r[t].update(e)&&n;for(t=0;t<o;++t){let n=r[t],o=n.itemsToRemove,a=o.length;for(let t=0;t<a;t++){i=o[t],n.remove(i);let r=this.add(e,i);n.isDirty=!0,r.isDirty=!0}}for(t=o-1;t>=0;--t){let i=r[t];i.isDirty&&(n=r[t].update(e)&&n,i.isDirty=!1),0===i.geometry.length&&r.splice(t,1)}return n},cX.prototype.getBoundingSphere=function(e,t){let i=this._batches,n=i.length;for(let r=0;r<n;++r){let n=i[r];if(n.contains(e))return n.getBoundingSphere(e,t)}return N.FAILED},cX.prototype.removeAllPrimitives=function(){let e=this._batches,t=e.length;for(let i=0;i<t;++i)e[i].removeAllPrimitives()};var c$=i(3812);let cK=new I.Z,cQ=new I.Z;function cJ(e,t,i,n,r,o){this.primitives=e,this.classificationType=t,this.appearanceType=i,this.materialProperty=n,this.updaters=new E.Z,this.createPrimitive=!0,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new E.Z,this.material=void 0,this.updatersWithAttributes=new E.Z,this.attributes=new E.Z,this.invalidated=!1,this.removeMaterialSubscription=n.definitionChanged.addEventListener(cJ.prototype.onMaterialChanged,this),this.subscriptions=new E.Z,this.showsUpdated=new E.Z,this.usingSphericalTextureCoordinates=r,this.zIndex=o,this.rectangleCollisionCheck=new cU}function c0(e,t,i){this._items=[],this._primitives=e,this._classificationType=t,this._appearanceType=i}cJ.prototype.onMaterialChanged=function(){this.invalidated=!0},cJ.prototype.overlapping=function(e){return this.rectangleCollisionCheck.collides(e)},cJ.prototype.isMaterial=function(e){let t=this.materialProperty,i=e.fillMaterialProperty;return i===t||i instanceof ny.Z&&t instanceof ny.Z||(0,_.Z)(t)&&t.equals(i)},cJ.prototype.add=function(e,t,i){let n=t.id;if(this.updaters.set(n,t),this.geometry.set(n,i),this.rectangleCollisionCheck.insert(n,i.geometry.rectangle),t.hasConstantFill&&t.fillMaterialProperty.isConstant&&L.Z.isConstant(t.distanceDisplayConditionProperty)){let e=this;this.subscriptions.set(n,t.entity.definitionChanged.addEventListener(function(i,n,r,o){"isShowing"===n&&e.showsUpdated.set(t.id,t)}))}else this.updatersWithAttributes.set(n,t);this.createPrimitive=!0},cJ.prototype.remove=function(e){let t=e.id,i=this.geometry.get(t);if(this.createPrimitive=this.geometry.remove(t)||this.createPrimitive,this.updaters.remove(t)){this.rectangleCollisionCheck.remove(t,i.geometry.rectangle),this.updatersWithAttributes.remove(t);let e=this.subscriptions.get(t);return(0,_.Z)(e)&&(e(),this.subscriptions.remove(t)),!0}return!1},cJ.prototype.update=function(e){let t,i=!0,n=this.primitive,r=this.primitives,o=this.geometry.values;if(this.createPrimitive){if(o.length>0)(0,_.Z)(n)&&((0,_.Z)(this.oldPrimitive)?r.remove(n):this.oldPrimitive=n),this.material=nO.getValue(e,this.materialProperty,this.material),n=new b.Z({show:!1,asynchronous:!0,geometryInstances:o.slice(),appearance:new this.appearanceType({material:this.material}),classificationType:this.classificationType}),r.add(n,this.zIndex),i=!1;else{(0,_.Z)(n)&&(r.remove(n),n=void 0);let e=this.oldPrimitive;(0,_.Z)(e)&&(r.remove(e),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=n,this.createPrimitive=!1}else if((0,_.Z)(n)&&n.ready){n.show=!0,(0,_.Z)(this.oldPrimitive)&&(r.remove(this.oldPrimitive),this.oldPrimitive=void 0),this.material=nO.getValue(e,this.materialProperty,this.material),this.primitive.appearance.material=this.material;let i=this.updatersWithAttributes.values,o=i.length;for(t=0;t<o;t++){let r=i[t],o=r.entity,a=this.geometry.get(r.id),s=this.attributes.get(a.id.id);(0,_.Z)(s)||(s=n.getGeometryInstanceAttributes(a.id),this.attributes.set(a.id.id,s));let l=o.isShowing&&(r.hasConstantFill||r.isFilled(e));l!==(1===s.show[0])&&(s.show=nA.Z.toValue(l,s.show));let c=r.distanceDisplayConditionProperty;if(!L.Z.isConstant(c)){let t=L.Z.getValueOrDefault(c,e,cQ,cK);I.Z.equals(t,s._lastDistanceDisplayCondition)||(s._lastDistanceDisplayCondition=I.Z.clone(t,s._lastDistanceDisplayCondition),s.distanceDisplayCondition=nx.toValue(t,s.distanceDisplayCondition))}}this.updateShows(n)}else(0,_.Z)(n)&&!n.ready&&(i=!1);return i},cJ.prototype.updateShows=function(e){let t=this.showsUpdated.values,i=t.length;for(let n=0;n<i;n++){let i=t[n],r=i.entity,o=this.geometry.get(i.id),a=this.attributes.get(o.id.id);(0,_.Z)(a)||(a=e.getGeometryInstanceAttributes(o.id),this.attributes.set(o.id.id,a));let s=r.isShowing;s!==(1===a.show[0])&&(a.show=nA.Z.toValue(s,a.show),o.attributes.show.value[0]=a.show[0])}this.showsUpdated.removeAll()},cJ.prototype.contains=function(e){return this.updaters.contains(e.id)},cJ.prototype.getBoundingSphere=function(e,t){let i=this.primitive;if(!i.ready)return N.PENDING;let n=i.getGeometryInstanceAttributes(e.entity);return!(0,_.Z)(n)||!(0,_.Z)(n.boundingSphere)||(0,_.Z)(n.show)&&0===n.show[0]?N.FAILED:(n.boundingSphere.clone(t),N.DONE)},cJ.prototype.destroy=function(){let e=this.primitive,t=this.primitives;(0,_.Z)(e)&&t.remove(e);let i=this.oldPrimitive;(0,_.Z)(i)&&t.remove(i),this.removeMaterialSubscription()},c0.prototype.add=function(e,t){let i=this._items,n=i.length,r=t.createFillGeometryInstance(e),o=c$.Z.shouldUseSphericalCoordinates(r.geometry.rectangle),a=L.Z.getValueOrDefault(t.zIndex,0);for(let s=0;s<n;++s){let n=i[s];if(n.isMaterial(t)&&n.usingSphericalTextureCoordinates===o&&n.zIndex===a&&!n.overlapping(r.geometry.rectangle)){n.add(e,t,r);return}}let s=new cJ(this._primitives,this._classificationType,this._appearanceType,t.fillMaterialProperty,o,a);s.add(e,t,r),i.push(s)},c0.prototype.remove=function(e){let t=this._items,i=t.length;for(let n=i-1;n>=0;n--){let i=t[n];if(i.remove(e)){0===i.updaters.length&&(t.splice(n,1),i.destroy());break}}},c0.prototype.update=function(e){let t;let i=this._items;for(t=i.length-1;t>=0;t--){let n=i[t];if(n.invalidated){i.splice(t,1);let r=n.updaters.values,o=r.length;for(let t=0;t<o;t++)this.add(e,r[t]);n.destroy()}}let n=!0;for(t=0;t<i.length;t++)n=i[t].update(e)&&n;return n},c0.prototype.getBoundingSphere=function(e,t){let i=this._items,n=i.length;for(let r=0;r<n;r++){let n=i[r];if(n.contains(e))return n.getBoundingSphere(e,t)}return N.FAILED},c0.prototype.removeAllPrimitives=function(){let e=this._items,t=e.length;for(let i=0;i<t;i++)e[i].destroy();this._items.length=0};let c1=new C.Z,c2=new I.Z,c3=new I.Z,c4=S.Z.ZERO,c5=new S.Z;function c9(e,t,i,n){this.translucent=t,this.width=i,this.shadows=n,this.primitives=e,this.createPrimitive=!1,this.waitingOnCreate=!1,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new E.Z,this.updaters=new E.Z,this.updatersWithAttributes=new E.Z,this.attributes=new E.Z,this.itemsToRemove=[],this.subscriptions=new E.Z,this.showsUpdated=new E.Z}function c8(e,t,i){this._primitives=e,this._scene=t,this._shadows=i,this._solidBatches=new E.Z,this._translucentBatches=new E.Z}c9.prototype.add=function(e,t){let i=e.id;if(this.createPrimitive=!0,this.geometry.set(i,t),this.updaters.set(i,e),e.hasConstantOutline&&e.outlineColorProperty.isConstant&&L.Z.isConstant(e.distanceDisplayConditionProperty)&&L.Z.isConstant(e.terrainOffsetProperty)){let t=this;this.subscriptions.set(i,e.entity.definitionChanged.addEventListener(function(i,n,r,o){"isShowing"===n&&t.showsUpdated.set(e.id,e)}))}else this.updatersWithAttributes.set(i,e)},c9.prototype.remove=function(e){let t=e.id;if(this.createPrimitive=this.geometry.remove(t)||this.createPrimitive,this.updaters.remove(t)){this.updatersWithAttributes.remove(t);let e=this.subscriptions.get(t);return(0,_.Z)(e)&&(e(),this.subscriptions.remove(t),this.showsUpdated.remove(t)),!0}return!1},c9.prototype.update=function(e){let t,i=!0,n=0,r=this.primitive,o=this.primitives;if(this.createPrimitive){let e=this.geometry.values;if(e.length>0)(0,_.Z)(r)&&((0,_.Z)(this.oldPrimitive)?o.remove(r):this.oldPrimitive=r),r=new nI.Z({show:!1,asynchronous:!0,geometryInstances:e.slice(),appearance:new ng.Z({flat:!0,translucent:this.translucent,renderState:{lineWidth:this.width}}),shadows:this.shadows}),o.add(r),i=!1;else{(0,_.Z)(r)&&(o.remove(r),r=void 0);let e=this.oldPrimitive;(0,_.Z)(e)&&(o.remove(e),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=r,this.createPrimitive=!1,this.waitingOnCreate=!0}else if((0,_.Z)(r)&&r.ready){r.show=!0,(0,_.Z)(this.oldPrimitive)&&(o.remove(this.oldPrimitive),this.oldPrimitive=void 0);let i=this.updatersWithAttributes.values,a=i.length,s=this.waitingOnCreate;for(t=0;t<a;t++){let o=i[t],a=this.geometry.get(o.id),l=this.attributes.get(a.id.id);if((0,_.Z)(l)||(l=r.getGeometryInstanceAttributes(a.id),this.attributes.set(a.id.id,l)),!o.outlineColorProperty.isConstant||s){let t=o.outlineColorProperty,i=L.Z.getValueOrDefault(t,e,C.Z.WHITE,c1);C.Z.equals(l._lastColor,i)||(l._lastColor=C.Z.clone(i,l._lastColor),l.color=nE.Z.toValue(i,l.color),(!this.translucent||255!==l.color[3])&&(this.translucent||255===l.color[3])||(this.itemsToRemove[n++]=o))}let c=o.entity.isShowing&&(o.hasConstantOutline||o.isOutlineVisible(e));c!==(1===l.show[0])&&(l.show=nA.Z.toValue(c,l.show));let u=o.distanceDisplayConditionProperty;if(!L.Z.isConstant(u)){let t=L.Z.getValueOrDefault(u,e,c3,c2);I.Z.equals(t,l._lastDistanceDisplayCondition)||(l._lastDistanceDisplayCondition=I.Z.clone(t,l._lastDistanceDisplayCondition),l.distanceDisplayCondition=nx.toValue(t,l.distanceDisplayCondition))}let h=o.terrainOffsetProperty;if(!L.Z.isConstant(h)){let t=L.Z.getValueOrDefault(h,e,c4,c5);S.Z.equals(t,l._lastOffset)||(l._lastOffset=S.Z.clone(t,l._lastOffset),l.offset=nC.Z.toValue(t,l.offset))}}this.updateShows(r),this.waitingOnCreate=!1}else(0,_.Z)(r)&&!r.ready&&(i=!1);return this.itemsToRemove.length=n,i},c9.prototype.updateShows=function(e){let t=this.showsUpdated.values,i=t.length;for(let n=0;n<i;n++){let i=t[n],r=this.geometry.get(i.id),o=this.attributes.get(r.id.id);(0,_.Z)(o)||(o=e.getGeometryInstanceAttributes(r.id),this.attributes.set(r.id.id,o));let a=i.entity.isShowing;a!==(1===o.show[0])&&(o.show=nA.Z.toValue(a,o.show),r.attributes.show.value[0]=o.show[0])}this.showsUpdated.removeAll()},c9.prototype.contains=function(e){return this.updaters.contains(e.id)},c9.prototype.getBoundingSphere=function(e,t){let i=this.primitive;if(!i.ready)return N.PENDING;let n=i.getGeometryInstanceAttributes(e.entity);return!(0,_.Z)(n)||!(0,_.Z)(n.boundingSphere)||(0,_.Z)(n.show)&&0===n.show[0]?N.FAILED:(n.boundingSphere.clone(t),N.DONE)},c9.prototype.removeAllPrimitives=function(){let e=this.primitives,t=this.primitive;(0,_.Z)(t)&&(e.remove(t),this.primitive=void 0,this.geometry.removeAll(),this.updaters.removeAll());let i=this.oldPrimitive;(0,_.Z)(i)&&(e.remove(i),this.oldPrimitive=void 0)},c8.prototype.add=function(e,t){let i,n;let r=t.createOutlineGeometryInstance(e),o=this._scene.clampLineWidth(t.outlineWidth);255===r.attributes.color.value[3]?(n=(i=this._solidBatches).get(o),(0,_.Z)(n)||(n=new c9(this._primitives,!1,o,this._shadows),i.set(o,n))):(n=(i=this._translucentBatches).get(o),(0,_.Z)(n)||(n=new c9(this._primitives,!0,o,this._shadows),i.set(o,n))),n.add(t,r)},c8.prototype.remove=function(e){let t;let i=this._solidBatches.values,n=i.length;for(t=0;t<n;t++)if(i[t].remove(e))return;let r=this._translucentBatches.values,o=r.length;for(t=0;t<o;t++)if(r[t].remove(e))return},c8.prototype.update=function(e){let t,i,n,r,o;let a=this._solidBatches.values,s=a.length,l=this._translucentBatches.values,c=l.length,u=!0,h=!1;do{for(i=0,h=!1;i<s;i++){u=(r=a[i]).update(e);let s=(o=r.itemsToRemove).length;if(s>0)for(t=0,h=!0;t<s;t++)n=o[t],r.remove(n),this.add(e,n)}for(i=0;i<c;i++){u=(r=l[i]).update(e);let a=(o=r.itemsToRemove).length;if(a>0)for(t=0,h=!0;t<a;t++)n=o[t],r.remove(n),this.add(e,n)}}while(h);return u},c8.prototype.getBoundingSphere=function(e,t){let i;let n=this._solidBatches.values,r=n.length;for(i=0;i<r;i++){let r=n[i];if(r.contains(e))return r.getBoundingSphere(e,t)}let o=this._translucentBatches.values,a=o.length;for(i=0;i<a;i++){let n=o[i];if(n.contains(e))return n.getBoundingSphere(e,t)}return N.FAILED},c8.prototype.removeAllPrimitives=function(){let e;let t=this._solidBatches.values,i=t.length;for(e=0;e<i;e++)t[e].removeAllPrimitives();let n=this._translucentBatches.values,r=n.length;for(e=0;e<r;e++)n[e].removeAllPrimitives()};let c6=[];function c7(e,t,i,n){let r;p.Z.defined("scene",e),p.Z.defined("entityCollection",t),i=(0,m.Z)(i,e.primitives),n=(0,m.Z)(n,e.groundPrimitives),this._scene=e,this._primitives=i,this._groundPrimitives=n,this._entityCollection=void 0,this._addedObjects=new E.Z,this._removedObjects=new E.Z,this._changedObjects=new E.Z;let o=nZ.Z.NUMBER_OF_SHADOW_MODES;this._outlineBatches=Array(2*o),this._closedColorBatches=Array(2*o),this._closedMaterialBatches=Array(2*o),this._openColorBatches=Array(2*o),this._openMaterialBatches=Array(2*o);let a=ns.Z.supportsMaterialsforEntitiesOnTerrain(e);for(r=0,this._supportsMaterialsforEntitiesOnTerrain=a;r<o;++r)this._outlineBatches[r]=new c8(i,e,r,!1),this._outlineBatches[o+r]=new c8(i,e,r,!0),this._closedColorBatches[r]=new cS(i,ng.Z,void 0,!0,r,!0),this._closedColorBatches[o+r]=new cS(i,ng.Z,void 0,!0,r,!1),this._closedMaterialBatches[r]=new cz(i,n_,void 0,!0,r,!0),this._closedMaterialBatches[o+r]=new cz(i,n_,void 0,!0,r,!1),this._openColorBatches[r]=new cS(i,ng.Z,void 0,!1,r,!0),this._openColorBatches[o+r]=new cS(i,ng.Z,void 0,!1,r,!1),this._openMaterialBatches[r]=new cz(i,n_,void 0,!1,r,!0),this._openMaterialBatches[o+r]=new cz(i,n_,void 0,!1,r,!1);let s=nd.Z.NUMBER_OF_CLASSIFICATION_TYPES,l=Array(s),c=[];if(a)for(r=0;r<s;++r)c.push(new c0(n,r,n_)),l[r]=new cX(n,r);else for(r=0;r<s;++r)l[r]=new cX(n,r);this._groundColorBatches=l,this._groundMaterialBatches=c,this._dynamicBatch=new nb(i,n),this._batches=this._outlineBatches.concat(this._closedColorBatches,this._closedMaterialBatches,this._openColorBatches,this._openMaterialBatches,this._groundColorBatches,this._groundMaterialBatches,this._dynamicBatch),this._subscriptions=new E.Z,this._updaterSets=new E.Z,this._entityCollection=t,t.collectionChanged.addEventListener(c7.prototype._onCollectionChanged,this),this._onCollectionChanged(t,t.values,c6)}c7.registerUpdater=function(e){cy.registerUpdater(e)},c7.unregisterUpdater=function(e){cy.unregisterUpdater(e)},c7.prototype.update=function(e){let t,i,n,r;p.Z.defined("time",e);let o=this._addedObjects,a=o.values,s=this._removedObjects,l=s.values,c=this._changedObjects,u=c.values,h=this;for(t=u.length-1;t>-1;t--)n=(i=u[t]).id,(r=this._updaterSets.get(n)).entity===i?r.forEach(function(t){h._removeUpdater(t),h._insertUpdaterIntoBatch(e,t)}):(l.push(i),a.push(i));for(t=l.length-1;t>-1;t--)n=(i=l[t]).id,(r=this._updaterSets.get(n)).forEach(this._removeUpdater.bind(this)),r.destroy(),this._updaterSets.remove(n),this._subscriptions.get(n)(),this._subscriptions.remove(n);for(t=a.length-1;t>-1;t--)n=(i=a[t]).id,r=new cy(i,this._scene),this._updaterSets.set(n,r),r.forEach(function(t){h._insertUpdaterIntoBatch(e,t)}),this._subscriptions.set(n,r.geometryChanged.addEventListener(c7._onGeometryChanged,this));o.removeAll(),s.removeAll(),c.removeAll();let d=!0,f=this._batches,m=f.length;for(t=0;t<m;t++)d=f[t].update(e)&&d;return d};let ue=[],ut=new f.Z;c7.prototype.getBoundingSphere=function(e,t){p.Z.defined("entity",e),p.Z.defined("result",t);let i=0,n=N.DONE,r=this._batches,o=r.length,a=e.id,s=this._updaterSets.get(a).updaters;for(let e=0;e<s.length;e++){let t=s[e];for(let e=0;e<o;e++){if((n=r[e].getBoundingSphere(t,ut))===N.PENDING)return N.PENDING;n===N.DONE&&(ue[i]=f.Z.clone(ut,ue[i]),i++)}}return 0===i?N.FAILED:(ue.length=i,f.Z.fromBoundingSpheres(ue,t),N.DONE)},c7.prototype.isDestroyed=function(){return!1},c7.prototype.destroy=function(){let e;this._entityCollection.collectionChanged.removeEventListener(c7.prototype._onCollectionChanged,this),this._addedObjects.removeAll(),this._removedObjects.removeAll();let t=this._batches,i=t.length;for(e=0;e<i;e++)t[e].removeAllPrimitives();let n=this._subscriptions.values;for(e=0,i=n.length;e<i;e++)n[e]();this._subscriptions.removeAll();let r=this._updaterSets.values;for(e=0,i=r.length;e<i;e++)r[e].destroy();return this._updaterSets.removeAll(),(0,g.Z)(this)},c7.prototype._removeUpdater=function(e){let t=this._batches,i=t.length;for(let n=0;n<i;n++)t[n].remove(e)},c7.prototype._insertUpdaterIntoBatch=function(e,t){let i;if(t.isDynamic){this._dynamicBatch.add(e,t);return}(t.outlineEnabled||t.fillEnabled)&&(i=t.shadowsProperty.getValue(e));let n=nZ.Z.NUMBER_OF_SHADOW_MODES;if(t.outlineEnabled&&((0,_.Z)(t.terrainOffsetProperty)?this._outlineBatches[n+i].add(e,t):this._outlineBatches[i].add(e,t)),t.fillEnabled){if(t.onTerrain){let i=t.classificationTypeProperty.getValue(e);t.fillMaterialProperty instanceof ny.Z?this._groundColorBatches[i].add(e,t):this._groundMaterialBatches[i].add(e,t)}else t.isClosed?t.fillMaterialProperty instanceof ny.Z?(0,_.Z)(t.terrainOffsetProperty)?this._closedColorBatches[n+i].add(e,t):this._closedColorBatches[i].add(e,t):(0,_.Z)(t.terrainOffsetProperty)?this._closedMaterialBatches[n+i].add(e,t):this._closedMaterialBatches[i].add(e,t):t.fillMaterialProperty instanceof ny.Z?(0,_.Z)(t.terrainOffsetProperty)?this._openColorBatches[n+i].add(e,t):this._openColorBatches[i].add(e,t):(0,_.Z)(t.terrainOffsetProperty)?this._openMaterialBatches[n+i].add(e,t):this._openMaterialBatches[i].add(e,t)}},c7._onGeometryChanged=function(e){let t=this._removedObjects,i=this._changedObjects,n=e.entity,r=n.id;(0,_.Z)(t.get(r))||(0,_.Z)(i.get(r))||i.set(r,n)},c7.prototype._onCollectionChanged=function(e,t,i){let n,r,o;let a=this._addedObjects,s=this._removedObjects,l=this._changedObjects;for(n=i.length-1;n>-1;n--)r=(o=i[n]).id,a.remove(r)||(s.set(r,o),l.remove(r));for(n=t.length-1;n>-1;n--)r=(o=t[n]).id,s.remove(r)?l.set(r,o):a.set(r,o)};let ui=tk.FILL,un=C.Z.WHITE,ur=C.Z.BLACK,uo=new C.Z(.165,.165,.165,.8),ua=new w.Z(7,5),us=w.Z.ZERO,ul=S.Z.ZERO,uc=D.ZP.NONE,uu=P.CENTER,uh=R.CENTER,ud=new S.Z,uf=new C.Z,up=new C.Z,um=new C.Z,u_=new w.Z,ug=new S.Z,uZ=new w.Z,uy=new O.Z,ub=new O.Z,uv=new O.Z,uT=new I.Z;function uE(e){this.entity=e,this.label=void 0,this.index=void 0}function ux(e,t){if(!(0,_.Z)(e))throw new A.Z("entityCluster is required.");if(!(0,_.Z)(t))throw new A.Z("entityCollection is required.");t.collectionChanged.addEventListener(ux.prototype._onCollectionChanged,this),this._cluster=e,this._entityCollection=t,this._items=new E.Z,this._onCollectionChanged(t,t.values,[],[])}function uw(e,t,i){(0,_.Z)(e)&&(e.label=void 0,i.removeLabel(t))}ux.prototype.update=function(e){if(!(0,_.Z)(e))throw new A.Z("time is required.");let t=this._items.values,i=this._cluster;for(let n=0,r=t.length;n<r;n++){let r,o;let a=t[n],s=a.entity,l=s._label,c=a.label,u=s.isShowing&&s.isAvailable(e)&&L.Z.getValueOrDefault(l._show,e,!0);if(u&&(o=L.Z.getValueOrUndefined(s._position,e,ud),r=L.Z.getValueOrUndefined(l._text,e),u=(0,_.Z)(o)&&(0,_.Z)(r)),!u){uw(a,s,i);continue}L.Z.isConstant(s._position)||(i._clusterDirty=!0);let h=!1,d=L.Z.getValueOrDefault(l._heightReference,e,uc);(0,_.Z)(c)||((c=i.getLabel(s)).id=s,a.label=c,h=S.Z.equals(c.position,o)&&c.heightReference===d),c.show=!0,c.position=o,c.text=r,c.scale=L.Z.getValueOrDefault(l._scale,e,1),c.font=L.Z.getValueOrDefault(l._font,e,"30px sans-serif"),c.style=L.Z.getValueOrDefault(l._style,e,ui),c.fillColor=L.Z.getValueOrDefault(l._fillColor,e,un,uf),c.outlineColor=L.Z.getValueOrDefault(l._outlineColor,e,ur,up),c.outlineWidth=L.Z.getValueOrDefault(l._outlineWidth,e,1),c.showBackground=L.Z.getValueOrDefault(l._showBackground,e,!1),c.backgroundColor=L.Z.getValueOrDefault(l._backgroundColor,e,uo,um),c.backgroundPadding=L.Z.getValueOrDefault(l._backgroundPadding,e,ua,u_),c.pixelOffset=L.Z.getValueOrDefault(l._pixelOffset,e,us,uZ),c.eyeOffset=L.Z.getValueOrDefault(l._eyeOffset,e,ul,ug),c.heightReference=d,c.horizontalOrigin=L.Z.getValueOrDefault(l._horizontalOrigin,e,uu),c.verticalOrigin=L.Z.getValueOrDefault(l._verticalOrigin,e,uh),c.translucencyByDistance=L.Z.getValueOrUndefined(l._translucencyByDistance,e,uy),c.pixelOffsetScaleByDistance=L.Z.getValueOrUndefined(l._pixelOffsetScaleByDistance,e,ub),c.scaleByDistance=L.Z.getValueOrUndefined(l._scaleByDistance,e,uv),c.distanceDisplayCondition=L.Z.getValueOrUndefined(l._distanceDisplayCondition,e,uT),c.disableDepthTestDistance=L.Z.getValueOrUndefined(l._disableDepthTestDistance,e),h&&c._updateClamping()}return!0},ux.prototype.getBoundingSphere=function(e,t){if(!(0,_.Z)(e))throw new A.Z("entity is required.");if(!(0,_.Z)(t))throw new A.Z("result is required.");let i=this._items.get(e.id);if(!(0,_.Z)(i)||!(0,_.Z)(i.label))return N.FAILED;let n=i.label;return t.center=S.Z.clone((0,m.Z)(n._clampedPosition,n.position),t.center),t.radius=0,N.DONE},ux.prototype.isDestroyed=function(){return!1},ux.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(ux.prototype._onCollectionChanged,this);let e=this._entityCollection.values;for(let t=0;t<e.length;t++)this._cluster.removeLabel(e[t]);return(0,g.Z)(this)},ux.prototype._onCollectionChanged=function(e,t,i,n){let r,o;let a=this._items,s=this._cluster;for(r=t.length-1;r>-1;r--)o=t[r],(0,_.Z)(o._label)&&(0,_.Z)(o._position)&&a.set(o.id,new uE(o));for(r=n.length-1;r>-1;r--)o=n[r],(0,_.Z)(o._label)&&(0,_.Z)(o._position)?a.contains(o.id)||a.set(o.id,new uE(o)):(uw(a.get(o.id),o,s),a.remove(o.id));for(r=i.length-1;r>-1;r--)o=i[r],uw(a.get(o.id),o,s),a.remove(o.id)};let uS={HIGHLIGHT:0,REPLACE:1,MIX:2};uS.getColorBlend=function(e,t){return e===uS.HIGHLIGHT?0:e===uS.REPLACE?1:e===uS.MIX?eB.Z.clamp(t,eB.Z.EPSILON4,1):void 0};var uC=Object.freeze(uS),uA=i(954),uI=i(2835),uO=i(2923),uD=Object.freeze({XTRANSLATE:"xTranslate",YTRANSLATE:"yTranslate",ZTRANSLATE:"zTranslate",XROTATE:"xRotate",YROTATE:"yRotate",ZROTATE:"zRotate",XSCALE:"xScale",YSCALE:"yScale",ZSCALE:"zScale",UNIFORMSCALE:"uniformScale"}),uP=i(894),uR=Object.freeze({STEP:0,LINEAR:1,CUBICSPLINE:2}),uN=i(5483),uL=function(e){switch(e){case"SCALAR":return 1;case"VEC2":return 2;case"VEC3":return 3;case"VEC4":case"MAT2":return 4;case"MAT3":return 9;case"MAT4":return 16}},uM=function(e,t){let i=t.bufferView;if((0,_.Z)(i)){let t=e.bufferViews[i];if((0,_.Z)(t.byteStride)&&t.byteStride>0)return t.byteStride}return eM.Z.getSizeInBytes(t.componentType)*uL(t.type)},uF=function(e){switch(e){case eM.Z.BYTE:return function(e,t,i,n,r){for(let o=0;o<i;++o)r[o]=e.getInt8(t+o*n)};case eM.Z.UNSIGNED_BYTE:return function(e,t,i,n,r){for(let o=0;o<i;++o)r[o]=e.getUint8(t+o*n)};case eM.Z.SHORT:return function(e,t,i,n,r){for(let o=0;o<i;++o)r[o]=e.getInt16(t+o*n,!0)};case eM.Z.UNSIGNED_SHORT:return function(e,t,i,n,r){for(let o=0;o<i;++o)r[o]=e.getUint16(t+o*n,!0)};case eM.Z.INT:return function(e,t,i,n,r){for(let o=0;o<i;++o)r[o]=e.getInt32(t+o*n,!0)};case eM.Z.UNSIGNED_INT:return function(e,t,i,n,r){for(let o=0;o<i;++o)r[o]=e.getUint32(t+o*n,!0)};case eM.Z.FLOAT:return function(e,t,i,n,r){for(let o=0;o<i;++o)r[o]=e.getFloat32(t+o*n,!0)};case eM.Z.DOUBLE:return function(e,t,i,n,r){for(let o=0;o<i;++o)r[o]=e.getFloat64(t+o*n,!0)}}},uz=i(49);function uB(){}Object.defineProperties(uB.prototype,{class:{get:function(){A.Z.throwInstantiationError()}}}),uB.prototype.hasProperty=function(e){A.Z.throwInstantiationError()},uB.prototype.hasPropertyBySemantic=function(e){A.Z.throwInstantiationError()},uB.prototype.getPropertyIds=function(e){A.Z.throwInstantiationError()},uB.prototype.getProperty=function(e){A.Z.throwInstantiationError()},uB.prototype.setProperty=function(e,t){A.Z.throwInstantiationError()},uB.prototype.getPropertyBySemantic=function(e){A.Z.throwInstantiationError()},uB.prototype.setPropertyBySemantic=function(e,t){A.Z.throwInstantiationError()},uB.hasProperty=function(e,t,i){if(p.Z.typeOf.string("propertyId",e),p.Z.typeOf.object("properties",t),p.Z.typeOf.object("classDefinition",i),(0,_.Z)(t[e]))return!0;let n=i.properties;if(!(0,_.Z)(n))return!1;let r=n[e];return!!((0,_.Z)(r)&&(0,_.Z)(r.default))},uB.hasPropertyBySemantic=function(e,t,i){p.Z.typeOf.string("semantic",e),p.Z.typeOf.object("properties",t),p.Z.typeOf.object("classDefinition",i);let n=i.propertiesBySemantic;if(!(0,_.Z)(n))return!1;let r=n[e];return(0,_.Z)(r)},uB.getPropertyIds=function(e,t,i){for(let n in p.Z.typeOf.object("properties",e),p.Z.typeOf.object("classDefinition",t),(i=(0,_.Z)(i)?i:[]).length=0,e)e.hasOwnProperty(n)&&(0,_.Z)(e[n])&&i.push(n);let n=t.properties;if((0,_.Z)(n))for(let t in n)n.hasOwnProperty(t)&&!(0,_.Z)(e[t])&&(0,_.Z)(n[t].default)&&i.push(t);return i},uB.getProperty=function(e,t,i){if(p.Z.typeOf.string("propertyId",e),p.Z.typeOf.object("properties",t),p.Z.typeOf.object("classDefinition",i),!(0,_.Z)(i.properties[e]))throw new A.Z(`Class definition missing property ${e}`);let n=i.properties[e],r=t[e];return(Array.isArray(r)&&(r=r.slice()),r=n.handleNoData(r),!(0,_.Z)(r)&&(0,_.Z)(n.default))?(r=(0,uz.Z)(n.default,!0),n.unpackVectorAndMatrixTypes(r,!0)):(0,_.Z)(r)?(r=n.normalize(r),r=n.applyValueTransform(r),n.unpackVectorAndMatrixTypes(r,!0)):void 0},uB.setProperty=function(e,t,i,n){let r;if(p.Z.typeOf.string("propertyId",e),p.Z.defined("value",t),p.Z.typeOf.object("properties",i),p.Z.typeOf.object("classDefinition",n),!(0,_.Z)(i[e]))return!1;Array.isArray(t)&&(t=t.slice());let o=n.properties;return(0,_.Z)(o)&&(r=o[e]),(0,_.Z)(r)&&(t=r.packVectorAndMatrixTypes(t,!0),t=r.unapplyValueTransform(t),t=r.unnormalize(t)),i[e]=t,!0},uB.getPropertyBySemantic=function(e,t,i){p.Z.typeOf.string("semantic",e),p.Z.typeOf.object("properties",t),p.Z.typeOf.object("classDefinition",i);let n=i.propertiesBySemantic;if(!(0,_.Z)(n))return;let r=n[e];if((0,_.Z)(r))return uB.getProperty(r.id,t,i)},uB.setPropertyBySemantic=function(e,t,i,n){p.Z.typeOf.string("semantic",e),p.Z.defined("value",t),p.Z.typeOf.object("properties",i),p.Z.typeOf.object("classDefinition",n);let r=n.propertiesBySemantic;if(!(0,_.Z)(r))return!1;let o=n.propertiesBySemantic[e];return!!(0,_.Z)(o)&&uB.setProperty(o.id,t,i,n)};let uU={};function uk(e){p.Z.typeOf.number.greaterThan("options.count",e.count,0),p.Z.typeOf.object("options.properties",e.properties),this._count=e.count,this._properties=(0,uz.Z)(e.properties,!0)}function uV(e){e=(0,m.Z)(e,m.Z.EMPTY_OBJECT),p.Z.typeOf.number("options.count",e.count),this._name=e.name,this._id=e.id,this._count=e.count,this._extras=e.extras,this._extensions=e.extensions,this._metadataTable=e.metadataTable,this._jsonMetadataTable=e.jsonMetadataTable,this._batchTableHierarchy=e.batchTableHierarchy}uk.prototype.hasProperty=function(e){return uB.hasProperty(e,this._properties,uU)},uk.prototype.getPropertyIds=function(e){return uB.getPropertyIds(this._properties,uU,e)},uk.prototype.getProperty=function(e,t){if(p.Z.typeOf.number("index",e),p.Z.typeOf.string("propertyId",t),e<0||e>=this._count)throw new A.Z(`index must be in the range [0, ${this._count})`);let i=this._properties[t];if((0,_.Z)(i))return(0,uz.Z)(i[e],!0)},uk.prototype.setProperty=function(e,t,i){if(p.Z.typeOf.number("index",e),p.Z.typeOf.string("propertyId",t),e<0||e>=this._count)throw new A.Z(`index must be in the range [0, ${this._count})`);let n=this._properties[t];(0,_.Z)(n)||(n=Array(this._count),this._properties[t]=n),n[e]=(0,uz.Z)(i,!0)},Object.defineProperties(uV.prototype,{name:{get:function(){return this._name}},id:{get:function(){return this._id}},count:{get:function(){return this._count}},class:{get:function(){if((0,_.Z)(this._metadataTable))return this._metadataTable.class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}},byteLength:{get:function(){let e=0;return(0,_.Z)(this._metadataTable)&&(e+=this._metadataTable.byteLength),(0,_.Z)(this._batchTableHierarchy)&&(e+=this._batchTableHierarchy.byteLength),e}}}),uV.prototype.hasProperty=function(e,t){return p.Z.typeOf.number("index",e),p.Z.typeOf.string("propertyId",t),!!((0,_.Z)(this._metadataTable)&&this._metadataTable.hasProperty(t)||(0,_.Z)(this._batchTableHierarchy)&&this._batchTableHierarchy.hasProperty(e,t)||(0,_.Z)(this._jsonMetadataTable)&&this._jsonMetadataTable.hasProperty(t))},uV.prototype.hasPropertyBySemantic=function(e,t){return p.Z.typeOf.number("index",e),p.Z.typeOf.string("semantic",t),!!(0,_.Z)(this._metadataTable)&&this._metadataTable.hasPropertyBySemantic(t)},uV.prototype.propertyExists=function(e){return p.Z.typeOf.string("propertyId",e),!!((0,_.Z)(this._metadataTable)&&this._metadataTable.hasProperty(e)||(0,_.Z)(this._batchTableHierarchy)&&this._batchTableHierarchy.propertyExists(e)||(0,_.Z)(this._jsonMetadataTable)&&this._jsonMetadataTable.hasProperty(e))},uV.prototype.propertyExistsBySemantic=function(e){return p.Z.typeOf.string("semantic",e),!!(0,_.Z)(this._metadataTable)&&this._metadataTable.hasPropertyBySemantic(e)};let uH=[];function uG(e,t){if(!(0,_.Z)(e)||e<0||e>=t)throw new A.Z(`featureId is required and must be between zero and featuresLength - 1 (${t}`-NaN)}uV.prototype.getPropertyIds=function(e,t){return(t=(0,_.Z)(t)?t:[]).length=0,(0,_.Z)(this._metadataTable)&&t.push.apply(t,this._metadataTable.getPropertyIds(uH)),(0,_.Z)(this._batchTableHierarchy)&&t.push.apply(t,this._batchTableHierarchy.getPropertyIds(e,uH)),(0,_.Z)(this._jsonMetadataTable)&&t.push.apply(t,this._jsonMetadataTable.getPropertyIds(uH)),t},uV.prototype.getProperty=function(e,t){let i;if((0,_.Z)(this._metadataTable)&&(i=this._metadataTable.getProperty(e,t),(0,_.Z)(i))||(0,_.Z)(this._batchTableHierarchy)&&(i=this._batchTableHierarchy.getProperty(e,t),(0,_.Z)(i))||(0,_.Z)(this._jsonMetadataTable)&&(i=this._jsonMetadataTable.getProperty(e,t),(0,_.Z)(i)))return i},uV.prototype.setProperty=function(e,t,i){(0,_.Z)(this._metadataTable)&&this._metadataTable.setProperty(e,t,i)||(0,_.Z)(this._batchTableHierarchy)&&this._batchTableHierarchy.setProperty(e,t,i)||((0,_.Z)(this._jsonMetadataTable)||(this._jsonMetadataTable=new uk({count:this._count,properties:{}})),this._jsonMetadataTable.setProperty(e,t,i))},uV.prototype.getPropertyBySemantic=function(e,t){if((0,_.Z)(this._metadataTable))return this._metadataTable.getPropertyBySemantic(e,t)},uV.prototype.setPropertyBySemantic=function(e,t,i){return!!(0,_.Z)(this._metadataTable)&&this._metadataTable.setPropertyBySemantic(e,t,i)},uV.prototype.getPropertyTypedArray=function(e){if(p.Z.typeOf.string("propertyId",e),(0,_.Z)(this._metadataTable))return this._metadataTable.getPropertyTypedArray(e)},uV.prototype.getPropertyTypedArrayBySemantic=function(e){if(p.Z.typeOf.string("semantic",e),(0,_.Z)(this._metadataTable))return this._metadataTable.getPropertyTypedArrayBySemantic(e)},uV.prototype.isClass=function(e,t){uG(e,this.count),p.Z.typeOf.string("className",t);let i=this._batchTableHierarchy;return!!(0,_.Z)(i)&&i.isClass(e,t)},uV.prototype.isExactClass=function(e,t){return uG(e,this.count),p.Z.typeOf.string("className",t),this.getExactClassName(e)===t},uV.prototype.getExactClassName=function(e){uG(e,this.count);let t=this._batchTableHierarchy;if((0,_.Z)(t))return t.getClassName(e)};var uj=i(5874),uW=i(9138),uq=i(9053),uY=Object.freeze({OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"});let uX={};function u$(){this.credits=[]}function uK(){this.baseColorTexture=void 0,this.metallicRoughnessTexture=void 0,this.baseColorFactor=eo.Z.clone(uK.DEFAULT_BASE_COLOR_FACTOR),this.metallicFactor=uK.DEFAULT_METALLIC_FACTOR,this.roughnessFactor=uK.DEFAULT_ROUGHNESS_FACTOR}function uQ(){this.diffuseTexture=void 0,this.specularGlossinessTexture=void 0,this.diffuseFactor=eo.Z.clone(uQ.DEFAULT_DIFFUSE_FACTOR),this.specularFactor=S.Z.clone(uQ.DEFAULT_SPECULAR_FACTOR),this.glossinessFactor=uQ.DEFAULT_GLOSSINESS_FACTOR}function uJ(){this.specularFactor=uJ.DEFAULT_SPECULAR_FACTOR,this.specularTexture=void 0,this.specularColorFactor=S.Z.clone(uJ.DEFAULT_SPECULAR_COLOR_FACTOR),this.specularColorTexture=void 0}function u0(){this.anisotropyStrength=u0.DEFAULT_ANISOTROPY_STRENGTH,this.anisotropyRotation=u0.DEFAULT_ANISOTROPY_ROTATION,this.anisotropyTexture=void 0}function u1(){this.clearcoatFactor=u1.DEFAULT_CLEARCOAT_FACTOR,this.clearcoatTexture=void 0,this.clearcoatRoughnessFactor=u1.DEFAULT_CLEARCOAT_ROUGHNESS_FACTOR,this.clearcoatRoughnessTexture=void 0,this.clearcoatNormalTexture=void 0}function u2(){this.metallicRoughness=new uK,this.specularGlossiness=void 0,this.specular=void 0,this.anisotropy=void 0,this.clearcoat=void 0,this.emissiveTexture=void 0,this.normalTexture=void 0,this.occlusionTexture=void 0,this.emissiveFactor=S.Z.clone(u2.DEFAULT_EMISSIVE_FACTOR),this.alphaMode=uY.OPAQUE,this.alphaCutoff=.5,this.doubleSided=!1,this.unlit=!1}uK.DEFAULT_BASE_COLOR_FACTOR=eo.Z.ONE,uK.DEFAULT_METALLIC_FACTOR=1,uK.DEFAULT_ROUGHNESS_FACTOR=1,uQ.DEFAULT_DIFFUSE_FACTOR=eo.Z.ONE,uQ.DEFAULT_SPECULAR_FACTOR=S.Z.ONE,uQ.DEFAULT_GLOSSINESS_FACTOR=1,uJ.DEFAULT_SPECULAR_FACTOR=1,uJ.DEFAULT_SPECULAR_COLOR_FACTOR=S.Z.ONE,u0.DEFAULT_ANISOTROPY_STRENGTH=0,u0.DEFAULT_ANISOTROPY_ROTATION=0,u1.DEFAULT_CLEARCOAT_FACTOR=0,u1.DEFAULT_CLEARCOAT_ROUGHNESS_FACTOR=0,u2.DEFAULT_EMISSIVE_FACTOR=S.Z.ZERO,uX.Quantization=function(){this.octEncoded=!1,this.octEncodedZXY=!1,this.normalizationRange=void 0,this.quantizedVolumeOffset=void 0,this.quantizedVolumeDimensions=void 0,this.quantizedVolumeStepSize=void 0,this.componentDatatype=void 0,this.type=void 0},uX.Attribute=function(){this.name=void 0,this.semantic=void 0,this.setIndex=void 0,this.componentDatatype=void 0,this.type=void 0,this.normalized=!1,this.count=void 0,this.min=void 0,this.max=void 0,this.constant=void 0,this.quantization=void 0,this.typedArray=void 0,this.buffer=void 0,this.byteOffset=0,this.byteStride=void 0},uX.Indices=function(){this.indexDatatype=void 0,this.count=void 0,this.buffer=void 0,this.typedArray=void 0},uX.FeatureIdAttribute=function(){this.featureCount=void 0,this.nullFeatureId=void 0,this.propertyTableId=void 0,this.setIndex=void 0,this.label=void 0,this.positionalLabel=void 0},uX.FeatureIdTexture=function(){this.featureCount=void 0,this.nullFeatureId=void 0,this.propertyTableId=void 0,this.textureReader=void 0,this.label=void 0,this.positionalLabel=void 0},uX.FeatureIdImplicitRange=function(){this.featureCount=void 0,this.nullFeatureId=void 0,this.propertyTableId=void 0,this.offset=0,this.repeat=void 0,this.label=void 0,this.positionalLabel=void 0},uX.MorphTarget=function(){this.attributes=[]},uX.Primitive=function(){this.attributes=[],this.morphTargets=[],this.indices=void 0,this.material=void 0,this.primitiveType=void 0,this.featureIds=[],this.propertyTextureIds=[],this.propertyAttributeIds=[],this.outlineCoordinates=void 0},uX.Instances=function(){this.attributes=[],this.featureIds=[],this.transformInWorldSpace=!1},uX.Skin=function(){this.index=void 0,this.joints=[],this.inverseBindMatrices=[]},uX.Node=function(){this.name=void 0,this.index=void 0,this.children=[],this.primitives=[],this.instances=void 0,this.skin=void 0,this.matrix=void 0,this.translation=void 0,this.rotation=void 0,this.scale=void 0,this.morphWeights=[],this.articulationName=void 0},uX.Scene=function(){this.nodes=[]},uX.AnimatedPropertyType=Object.freeze({TRANSLATION:"translation",ROTATION:"rotation",SCALE:"scale",WEIGHTS:"weights"}),uX.AnimationSampler=function(){this.input=[],this.interpolation=void 0,this.output=[]},uX.AnimationTarget=function(){this.node=void 0,this.path=void 0},uX.AnimationChannel=function(){this.sampler=void 0,this.target=void 0},uX.Animation=function(){this.name=void 0,this.samplers=[],this.channels=[]},uX.ArticulationStage=function(){this.name=void 0,this.type=void 0,this.minimumValue=void 0,this.maximumValue=void 0,this.initialValue=void 0},uX.Articulation=function(){this.name=void 0,this.stages=[]},uX.Asset=u$,uX.Components=function(){this.asset=new u$,this.scene=void 0,this.nodes=[],this.skins=[],this.animations=[],this.articulations=[],this.structuralMetadata=void 0,this.upAxis=void 0,this.forwardAxis=void 0,this.transform=er.Z.clone(er.Z.IDENTITY)},uX.TextureReader=function(){this.texture=void 0,this.index=void 0,this.texCoord=0,this.transform=n2.Z.clone(n2.Z.IDENTITY),this.channels=void 0},uX.MetallicRoughness=uK,uX.SpecularGlossiness=uQ,uX.Specular=uJ,uX.Anisotropy=u0,uX.Clearcoat=u1,uX.Material=u2;let u3={};u3.getImageIdFromTexture=function(e){let{gltf:t,textureId:i,supportedImageFormats:n}=e=(0,m.Z)(e,m.Z.EMPTY_OBJECT);p.Z.typeOf.object("options.gltf",t),p.Z.typeOf.number("options.textureId",i),p.Z.typeOf.object("options.supportedImageFormats",n);let r=t.textures[i],o=r.extensions;if((0,_.Z)(o)){if(n.webp&&(0,_.Z)(o.EXT_texture_webp))return o.EXT_texture_webp.source;if(n.basis&&(0,_.Z)(o.KHR_texture_basisu))return o.KHR_texture_basisu.source}return r.source},u3.createSampler=function(e){let{gltf:t,textureInfo:i,compressedTextureNoMipmap:n=!1}=e=(0,m.Z)(e,m.Z.EMPTY_OBJECT);p.Z.typeOf.object("options.gltf",t),p.Z.typeOf.object("options.textureInfo",i);let r=uq.Z.REPEAT,o=uq.Z.REPEAT,a=uW.Z.LINEAR,s=uj.Z.LINEAR,l=i.index,c=t.textures[l].sampler;if((0,_.Z)(c)){let e=t.samplers[c];r=(0,m.Z)(e.wrapS,r),o=(0,m.Z)(e.wrapT,o),a=(0,m.Z)(e.minFilter,a),s=(0,m.Z)(e.magFilter,s)}return n&&a!==uW.Z.LINEAR&&a!==uW.Z.NEAREST&&(a=a===uW.Z.NEAREST_MIPMAP_NEAREST||a===uW.Z.NEAREST_MIPMAP_LINEAR?uW.Z.NEAREST:uW.Z.LINEAR),new uN.Z({wrapS:r,wrapT:o,minificationFilter:a,magnificationFilter:s})};let u4=new w.Z(1,1);u3.createModelTextureReader=function(e){let t;let{textureInfo:i,channels:n,texture:r}=e=(0,m.Z)(e,m.Z.EMPTY_OBJECT);p.Z.typeOf.object("options.textureInfo",i);let o=(0,m.Z)(i.texCoord,0),a=(0,m.Z)(i.extensions,m.Z.EMPTY_OBJECT).KHR_texture_transform;if((0,_.Z)(a)){o=(0,m.Z)(a.texCoord,o);let e=(0,_.Z)(a.offset)?w.Z.unpack(a.offset):w.Z.ZERO,i=(0,m.Z)(a.rotation,0),n=(0,_.Z)(a.scale)?w.Z.unpack(a.scale):u4;i=-i,t=new n2.Z(Math.cos(i)*n.x,-Math.sin(i)*n.y,e.x,Math.sin(i)*n.x,Math.cos(i)*n.y,e.y,0,0,1)}let s=new uX.TextureReader;return s.index=i.index,s.texture=r,s.texCoord=o,s.transform=t,s.channels=n,s};var u5=i(9337),u9=i(9508);function u8(e){let t=(e=(0,m.Z)(e,m.Z.EMPTY_OBJECT)).property,i=e.classProperty,n=e.textures;p.Z.typeOf.object("options.property",t),p.Z.typeOf.object("options.classProperty",i),p.Z.typeOf.object("options.textures",n);let r=(0,_.Z)(t.channels)?t.channels:[0],o=u3.createModelTextureReader({textureInfo:t,channels:r.map(function(e){return"rgba".charAt(e)}).join(""),texture:n[t.index]});this._min=t.min,this._max=t.max;let a=t.offset,s=t.scale,l=i.hasValueTransform||(0,_.Z)(a)||(0,_.Z)(s);a=(0,m.Z)(a,i.offset),s=(0,m.Z)(s,i.scale),a=i.unpackVectorAndMatrixTypes(a),s=i.unpackVectorAndMatrixTypes(s),this._offset=a,this._scale=s,this._hasValueTransform=l,this._textureReader=o,this._classProperty=i,this._extras=t.extras,this._extensions=t.extensions}Object.defineProperties(u8.prototype,{textureReader:{get:function(){return this._textureReader}},hasValueTransform:{get:function(){return this._hasValueTransform}},offset:{get:function(){return this._offset}},scale:{get:function(){return this._scale}},classProperty:{get:function(){return this._classProperty}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}}),u8.prototype.isGpuCompatible=function(){let e=this._classProperty,t=e.type,i=e.componentType;return e.isArray?!e.isVariableLengthArray&&e.arrayLength<=4&&t===u5.Z.SCALAR&&i===u9.Z.UINT8:(!!u5.Z.isVectorType(t)||t===u5.Z.SCALAR)&&i===u9.Z.UINT8};let u6=[void 0,"float","vec2","vec3","vec4"],u7=[void 0,"int","ivec2","ivec3","ivec4"];function he(e){let t=(e=(0,m.Z)(e,m.Z.EMPTY_OBJECT)).propertyTexture,i=e.class,n=e.textures;p.Z.typeOf.object("options.propertyTexture",t),p.Z.typeOf.object("options.class",i),p.Z.typeOf.object("options.textures",n);let r=t.extensions,o=t.extras,a={};if((0,_.Z)(t.properties))for(let e in t.properties)t.properties.hasOwnProperty(e)&&(a[e]=new u8({property:t.properties[e],classProperty:i.properties[e],textures:n}));this._name=e.name,this._id=e.id,this._class=i,this._properties=a,this._extras=o,this._extensions=r}function ht(e){let t=(e=(0,m.Z)(e,m.Z.EMPTY_OBJECT)).property,i=e.classProperty;p.Z.typeOf.object("options.property",t),p.Z.typeOf.object("options.classProperty",i),this._attribute=t.attribute,this._classProperty=i,this._min=t.min,this._max=t.max;let n=t.offset,r=t.scale,o=i.hasValueTransform||(0,_.Z)(n)||(0,_.Z)(r);n=(0,m.Z)(n,i.offset),r=(0,m.Z)(r,i.scale),n=i.unpackVectorAndMatrixTypes(n),r=i.unpackVectorAndMatrixTypes(r),this._offset=n,this._scale=r,this._hasValueTransform=o,this._extras=t.extras,this._extensions=t.extensions}function hi(e){let t=(e=(0,m.Z)(e,m.Z.EMPTY_OBJECT)).propertyAttribute,i=e.class;p.Z.typeOf.object("options.propertyAttribute",t),p.Z.typeOf.object("options.class",i);let n={};if((0,_.Z)(t.properties))for(let e in t.properties)t.properties.hasOwnProperty(e)&&(n[e]=new ht({property:t.properties[e],classProperty:i.properties[e]}));this._name=e.name,this._id=e.id,this._class=i,this._properties=n,this._extras=t.extras,this._extensions=t.extensions}function hn(e){e=(0,m.Z)(e,m.Z.EMPTY_OBJECT),p.Z.typeOf.object("options.schema",e.schema),this._schema=e.schema;let t=e.propertyTables;this._propertyTableCount=(0,_.Z)(t)?t.length:0,this._propertyTables=t,this._propertyTextures=e.propertyTextures,this._propertyAttributes=e.propertyAttributes,this._statistics=e.statistics,this._extras=e.extras,this._extensions=e.extensions}function hr(e,t,i){if(!(0,_.Z)(e))throw new A.Z("uint8Array is required.");if(t<0)throw new A.Z("byteOffset cannot be negative.");if(i<0)throw new A.Z("byteLength cannot be negative.");if(t+i>e.byteLength)throw new A.Z("sub-region exceeds array bounds.");return t=(0,m.Z)(t,0),i=(0,m.Z)(i,e.byteLength-t),e=e.subarray(t,t+i),hr.decode(e)}function ho(e){let t=(e=(0,m.Z)(e,m.Z.EMPTY_OBJECT)).id,i=e.type;p.Z.typeOf.string("options.id",t),p.Z.typeOf.string("options.type",i);let n=e.componentType,r=e.enumType,o=(0,_.Z)(n)&&u9.Z.isIntegerType(n)&&(0,m.Z)(e.normalized,!1);this._id=t,this._name=e.name,this._description=e.description,this._semantic=e.semantic,this._isLegacyExtension=e.isLegacyExtension,this._type=i,this._componentType=n,this._enumType=r,this._valueType=(0,_.Z)(r)?r.valueType:n,this._isArray=(0,m.Z)(e.isArray,!1),this._isVariableLengthArray=(0,m.Z)(e.isVariableLengthArray,!1),this._arrayLength=e.arrayLength,this._min=(0,uz.Z)(e.min,!0),this._max=(0,uz.Z)(e.max,!0),this._normalized=o;let a=(0,uz.Z)(e.offset,!0),s=(0,uz.Z)(e.scale,!0),l=(0,_.Z)(a)||(0,_.Z)(s);(0,_.Z)(a)||(a=this.expandConstant(0,!0)),(0,_.Z)(s)||(s=this.expandConstant(1,!0)),this._offset=a,this._scale=s,this._hasValueTransform=l,this._noData=(0,uz.Z)(e.noData,!0),this._default=(0,uz.Z)(e.default,!0),this._required=(0,m.Z)(e.required,!0),this._extras=(0,uz.Z)(e.extras,!0),this._extensions=(0,uz.Z)(e.extensions,!0)}function ha(e,t){let i=e._type,n=e._componentType,r=e._enumType,o=e._normalized;return u5.Z.isVectorType(i)?u9.Z.isVectorCompatible(n)?i!==u5.Z.VEC2||t instanceof w.Z?i!==u5.Z.VEC3||t instanceof S.Z?i!==u5.Z.VEC4||t instanceof eo.Z?void 0:`vector value ${t} must be a Cartesian4`:`vector value ${t} must be a Cartesian3`:`vector value ${t} must be a Cartesian2`:`componentType ${n} is incompatible with vector type ${i}`:u5.Z.isMatrixType(i)?u9.Z.isVectorCompatible(n)?i!==u5.Z.MAT2||t instanceof lp.Z?i!==u5.Z.MAT3||t instanceof n2.Z?i!==u5.Z.MAT4||t instanceof er.Z?void 0:`matrix value ${t} must be a Matrix4`:`matrix value ${t} must be a Matrix3`:`matrix value ${t} must be a Matrix2`:`componentType ${n} is incompatible with matrix type ${i}`:i===u5.Z.STRING?function(e){if("string"!=typeof e)return hs(e,u5.Z.STRING)}(t):i===u5.Z.BOOLEAN?function(e){if("boolean"!=typeof e)return hs(e,u5.Z.BOOLEAN)}(t):i===u5.Z.ENUM?function(e,t){if((0,_.Z)(t))return"string"==typeof e&&(0,_.Z)(t.valuesByName[e])?void 0:`value ${e} is not a valid enum name for ${t.id}`}(t,r):function(e,t,i){let n=typeof e;switch(t){case u9.Z.INT8:case u9.Z.UINT8:case u9.Z.INT16:case u9.Z.UINT16:case u9.Z.INT32:case u9.Z.UINT32:case u9.Z.FLOAT32:case u9.Z.FLOAT64:if("number"!==n)return hs(e,t);if(!isFinite(e))return hu(e,t);return hc(e,t,i);case u9.Z.INT64:case u9.Z.UINT64:if("number"!==n&&"bigint"!==n)return hs(e,t);if("number"===n&&!isFinite(e))return hu(e,t);return hc(e,t,i)}}(t,n,o)}function hs(e,t){return`value ${e} does not match type ${t}`}function hl(e,t,i){let n=`value ${e} is out of range for type ${t}`;return i&&(n+=" (normalized)"),n}function hc(e,t,i){return i?e<(u9.Z.isUnsignedIntegerType(t)?0:-1)||e>1?hl(e,t,i):void 0:e<u9.Z.getMinimum(t)||e>u9.Z.getMaximum(t)?hl(e,t,i):void 0}function hu(e,t){return`value ${e} of type ${t} must be finite`}function hh(e,t,i){if(!Array.isArray(e))return i(e,t);for(let n=0;n<e.length;n++)e[n]=hh(e[n],t,i);return e}function hd(e){let t,i,n,r,o;let a=(e=(0,m.Z)(e,m.Z.EMPTY_OBJECT)).count,s=e.property,l=e.classProperty,c=e.bufferViews;p.Z.typeOf.number.greaterThan("options.count",a,0),p.Z.typeOf.object("options.property",s),p.Z.typeOf.object("options.classProperty",l),p.Z.typeOf.object("options.bufferViews",c);let u=l.type,h=l.isArray,d=l.isVariableLengthArray,f=l.valueType,g=l.enumType,Z=u===u5.Z.STRING,y=u===u5.Z.BOOLEAN,b=0;if(d){let e=(0,m.Z)(s.arrayOffsetType,s.offsetType);e=(0,m.Z)(u9.Z[e],u9.Z.UINT32),b+=(t=new hZ(c[(0,m.Z)(s.arrayOffsets,s.arrayOffsetBufferView)],e,a+1)).typedArray.byteLength}let v=u5.Z.getComponentCount(u),T=v*(d?t.get(a)-t.get(0):h?a*l.arrayLength:a);if(Z){let e=(0,m.Z)(s.stringOffsetType,s.offsetType);e=(0,m.Z)(u9.Z[e],u9.Z.UINT32),b+=(i=new hZ(c[(0,m.Z)(s.stringOffsets,s.stringOffsetBufferView)],e,T+1)).typedArray.byteLength}(Z||y)&&(f=u9.Z.UINT8),n=Z?i.get(T)-i.get(0):y?Math.ceil(T/8):T;let E=new hZ(c[(0,m.Z)(s.values,s.bufferView)],f,n);b+=E.typedArray.byteLength;let x=s.offset,w=s.scale,S=l.hasValueTransform||(0,_.Z)(x)||(0,_.Z)(w);x=(0,m.Z)(x,l.offset),w=(0,m.Z)(w,l.scale),x=hf(x),w=hf(w);let C=this;Z?r=function(e){return function(e,t,i){let n=i.get(e),r=i.get(e+1)-n;return hr(t.typedArray,n,r)}(e,C._values,C._stringOffsets)}:y?(r=function(e){return(C._values.typedArray[e>>3]>>e%8&1)==1},o=function(e,t){(function(e,t,i){let n=e>>3,r=e%8;i?t.typedArray[n]|=1<<r:t.typedArray[n]&=~(1<<r)})(e,C._values,t)}):(0,_.Z)(g)?(r=function(e){let t=C._values.get(e);return g.namesByValue[t]},o=function(e,t){let i=g.valuesByName[t];C._values.set(e,i)}):(r=function(e){return C._values.get(e)},o=function(e,t){C._values.set(e,t)}),this._arrayOffsets=t,this._stringOffsets=i,this._values=E,this._classProperty=l,this._count=a,this._vectorComponentCount=v,this._min=s.min,this._max=s.max,this._offset=x,this._scale=w,this._hasValueTransform=S,this._getValue=r,this._setValue=o,this._unpackedValues=void 0,this._extras=s.extras,this._extensions=s.extensions,this._byteLength=b}function hf(e){if(!Array.isArray(e))return e;let t=[];for(let i=0;i<e.length;i++){let n=e[i];Array.isArray(n)?t.push.apply(t,n):t.push(n)}return t}function hp(e,t){let i=e._count;if(!(0,_.Z)(t)||t<0||t>=i)throw new A.Z(`index is required and between zero and count - 1. Actual value: ${i-1}`)}function hm(e,t,i){let n,r;if(t.isVariableLengthArray){n=e._arrayOffsets.get(i),r=e._arrayOffsets.get(i+1)-n;let o=u5.Z.getComponentCount(t.type);n*=o,r*=o}else{let o=(0,m.Z)(t.arrayLength,1)*e._vectorComponentCount;n=i*o,r=o}let o=Array(r);for(let t=0;t<r;t++)o[t]=e._getValue(n+t);return o}function h_(e){if((0,_.Z)(e._unpackedValues))return!1;let t=e._classProperty,i=t.type,n=t.valueType;return!(i!==u5.Z.STRING&&(n!==u9.Z.INT64||uP.Z.supportsBigInt64Array())&&(n!==u9.Z.UINT64||uP.Z.supportsBigUint64Array()))}function hg(e){e._unpackedValues=function(e){let t=e._count,i=Array(t),n=e._classProperty,r=n.isArray,o=n.type,a=u5.Z.getComponentCount(o);if(!r&&1===a){for(let n=0;n<t;++n)i[n]=e._getValue(n);return i}for(let r=0;r<t;r++)i[r]=hm(e,n,r);return i}(e),e._arrayOffsets=void 0,e._stringOffsets=void 0,e._values=void 0}function hZ(e,t,i){let n,r,o;let a=this;if(t===u9.Z.INT64)uP.Z.supportsBigInt()?uP.Z.supportsBigInt64Array()?(n=new BigInt64Array(e.buffer,e.byteOffset,i),o=function(e,t){a.typedArray[e]=BigInt(t)}):(n=new Uint8Array(e.buffer,e.byteOffset,8*i),r=function(e){return function(e,t){let i=t.dataView,n=8*e,r=BigInt(0),o=(128&i.getUint8(n+7))>0,a=!0;for(let e=0;e<8;++e){let t=i.getUint8(n+e);o&&(a?0!==t&&(t=255&~(t-1),a=!1):t=255&~t),r+=BigInt(t)*(BigInt(1)<<BigInt(8*e))}return o&&(r=-r),r}(e,a)}):((0,nP.Z)("INT64 type is not fully supported on this platform. Values greater than 2^53 - 1 or less than -(2^53 - 1) may lose precision when read."),n=new Uint8Array(e.buffer,e.byteOffset,8*i),r=function(e){return function(e,t){let i=t.dataView,n=8*e,r=0,o=(128&i.getUint8(n+7))>0,a=!0;for(let e=0;e<8;++e){let t=i.getUint8(n+e);o&&(a?0!==t&&(t=255&~(t-1),a=!1):t=255&~t),r+=t*Math.pow(256,e)}return o&&(r=-r),r}(e,a)});else if(t===u9.Z.UINT64)uP.Z.supportsBigInt()?uP.Z.supportsBigUint64Array()?(n=new BigUint64Array(e.buffer,e.byteOffset,i),o=function(e,t){a.typedArray[e]=BigInt(t)}):(n=new Uint8Array(e.buffer,e.byteOffset,8*i),r=function(e){return function(e,t){let i=t.dataView,n=8*e,r=BigInt(i.getUint32(n,!0)),o=BigInt(i.getUint32(n+4,!0));return r+BigInt(4294967296)*o}(e,a)}):((0,nP.Z)("UINT64 type is not fully supported on this platform. Values greater than 2^53 - 1 may lose precision when read."),n=new Uint8Array(e.buffer,e.byteOffset,8*i),r=function(e){return function(e,t){let i=t.dataView,n=8*e;return i.getUint32(n,!0)+4294967296*i.getUint32(n+4,!0)}(e,a)});else{let r=function(e){switch(e){case u9.Z.INT8:return eM.Z.BYTE;case u9.Z.UINT8:return eM.Z.UNSIGNED_BYTE;case u9.Z.INT16:return eM.Z.SHORT;case u9.Z.UINT16:return eM.Z.UNSIGNED_SHORT;case u9.Z.INT32:return eM.Z.INT;case u9.Z.UINT32:return eM.Z.UNSIGNED_INT;case u9.Z.FLOAT32:return eM.Z.FLOAT;case u9.Z.FLOAT64:return eM.Z.DOUBLE}}(t);n=eM.Z.createArrayBufferView(r,e.buffer,e.byteOffset,i),o=function(e,t){a.typedArray[e]=t}}(0,_.Z)(r)||(r=function(e){return a.typedArray[e]}),this.typedArray=n,this.dataView=new DataView(n.buffer,n.byteOffset),this.get=r,this.set=o,this._componentType=t}function hy(e){let t=(e=(0,m.Z)(e,m.Z.EMPTY_OBJECT)).count,i=e.class;p.Z.typeOf.number.greaterThan("options.count",t,0),p.Z.typeOf.object("options.class",i);let n=0,r={};if((0,_.Z)(e.properties)){for(let o in e.properties)if(e.properties.hasOwnProperty(o)){let a=new hd({count:t,property:e.properties[o],classProperty:i.properties[o],bufferViews:e.bufferViews});r[o]=a,n+=a.byteLength}}this._count=t,this._class=i,this._properties=r,this._byteLength=n}u8.prototype.getGlslType=function(){let e=this._classProperty,t=u5.Z.getComponentCount(e.type);return(e.isArray&&(t=e.arrayLength),e.normalized)?u6[t]:u7[t]},u8.prototype.unpackInShader=function(e){if(this._classProperty.normalized)return e;let t=this.getGlslType();return`${t}(255.0 * ${e})`},Object.defineProperties(he.prototype,{name:{get:function(){return this._name}},id:{get:function(){return this._id}},class:{get:function(){return this._class}},properties:{get:function(){return this._properties}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}}),he.prototype.getProperty=function(e){return p.Z.typeOf.string("propertyId",e),this._properties[e]},Object.defineProperties(ht.prototype,{attribute:{get:function(){return this._attribute}},hasValueTransform:{get:function(){return this._hasValueTransform}},offset:{get:function(){return this._offset}},scale:{get:function(){return this._scale}},classProperty:{get:function(){return this._classProperty}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}}),Object.defineProperties(hi.prototype,{name:{get:function(){return this._name}},id:{get:function(){return this._id}},class:{get:function(){return this._class}},properties:{get:function(){return this._properties}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}}),hi.prototype.getProperty=function(e){return p.Z.typeOf.string("propertyId",e),this._properties[e]},Object.defineProperties(hn.prototype,{schema:{get:function(){return this._schema}},statistics:{get:function(){return this._statistics}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}},propertyTableCount:{get:function(){return this._propertyTableCount}},propertyTables:{get:function(){return this._propertyTables}},propertyTextures:{get:function(){return this._propertyTextures}},propertyAttributes:{get:function(){return this._propertyAttributes}},propertyTablesByteLength:{get:function(){if(!(0,_.Z)(this._propertyTables))return 0;let e=0,t=this._propertyTables.length;for(let i=0;i<t;i++)e+=this._propertyTables[i].byteLength;return e}}}),hn.prototype.getPropertyTable=function(e){return p.Z.typeOf.number("propertyTableId",e),this._propertyTables[e]},hn.prototype.getPropertyTexture=function(e){return p.Z.typeOf.number("propertyTextureId",e),this._propertyTextures[e]},hn.prototype.getPropertyAttribute=function(e){return p.Z.typeOf.number("propertyAttributeId",e),this._propertyAttributes[e]},hr.decodeWithTextDecoder=function(e){return new TextDecoder("utf-8").decode(e)},hr.decodeWithFromCharCode=function(e){let t="",i=function(e){let t=0,i=0,n=0,r=128,o=191,a=[],s=e.length;for(let u=0;u<s;++u){var l,c;let s=e[u];if(0===n){if(0<=s&&s<=127){a.push(s);continue}if(194<=s&&s<=223){n=1,t=31&s;continue}if(224<=s&&s<=239){224===s&&(r=160),237===s&&(o=159),n=2,t=15&s;continue}if(240<=s&&s<=244){240===s&&(r=144),244===s&&(o=143),n=3,t=7&s;continue}throw new e3.Z("String decoding failed.")}if(l=r,c=o,!(l<=s)||!(s<=c)){t=n=i=0,r=128,o=191,--u;continue}r=128,o=191,t=t<<6|63&s,++i===n&&(a.push(t),t=n=i=0)}return a}(e),n=i.length;for(let e=0;e<n;++e){let n=i[e];n<=65535?t+=String.fromCharCode(n):(n-=65536,t+=String.fromCharCode((n>>10)+55296,(1023&n)+56320))}return t},"undefined"!=typeof TextDecoder?hr.decode=hr.decodeWithTextDecoder:hr.decode=hr.decodeWithFromCharCode,ho.fromJson=function(e){let t;let i=(e=(0,m.Z)(e,m.Z.EMPTY_OBJECT)).id,n=e.property;p.Z.typeOf.string("options.id",i),p.Z.typeOf.object("options.property",n),p.Z.typeOf.string("options.property.type",n.type);let r=function(e){if("ARRAY"===e.type)return!0;let t=e.type;return!(t===u5.Z.SCALAR||u5.Z.isMatrixType(t)||u5.Z.isVectorType(t))&&(!!(0,_.Z)(u9.Z[t])||!((0,_.Z)(e.noData)||(0,_.Z)(e.scale)||(0,_.Z)(e.offset)||(0,_.Z)(e.required)||(0,_.Z)(e.count)||(0,_.Z)(e.array)||(0,_.Z)(e.optional))&&void 0)}(n),o=function(e,t){let i,n,r,o;let a=e.type,s=e.componentType,l="ARRAY"===a;if(l?(i=!0,n=e.componentCount,r=!(0,_.Z)(n)):e.array?(i=!0,n=e.count,r=!(0,_.Z)(e.count)):(i=!1,n=void 0,r=!1),(0,_.Z)(e.enumType)&&(o=t[e.enumType]),a===u5.Z.ENUM)return{type:a,componentType:void 0,enumType:o,valueType:o.valueType,isArray:i,isVariableLengthArray:r,arrayLength:n};if(l&&s===u5.Z.ENUM)return{type:s,componentType:void 0,enumType:o,valueType:o.valueType,isArray:i,isVariableLengthArray:r,arrayLength:n};if(a===u5.Z.SCALAR||u5.Z.isMatrixType(a)||u5.Z.isVectorType(a))return{type:a,componentType:s,enumType:void 0,valueType:s,isArray:i,isVariableLengthArray:r,arrayLength:n};if(a===u5.Z.BOOLEAN||a===u5.Z.STRING)return{type:a,componentType:void 0,enumType:void 0,valueType:void 0,isArray:i,isVariableLengthArray:r,arrayLength:n};if(l&&(s===u5.Z.BOOLEAN||s===u5.Z.STRING))return{type:s,componentType:void 0,enumType:void 0,valueType:void 0,isArray:i,isVariableLengthArray:r,arrayLength:n};if((0,_.Z)(s)&&(0,_.Z)(u9.Z[s]))return{type:u5.Z.SCALAR,componentType:s,enumType:void 0,valueType:s,isArray:i,isVariableLengthArray:r,arrayLength:n};if((0,_.Z)(u9.Z[a]))return{type:u5.Z.SCALAR,componentType:a,enumType:void 0,valueType:a,isArray:i,isVariableLengthArray:r,arrayLength:n};throw new A.Z(`unknown metadata type {type: ${a}, componentType: ${s})`)}(n,e.enums);return t=!!(0,_.Z)(r)&&(r?!(0,_.Z)(n.optional)||!n.optional:(0,m.Z)(n.required,!1)),new ho({id:i,type:o.type,componentType:o.componentType,enumType:o.enumType,isArray:o.isArray,isVariableLengthArray:o.isVariableLengthArray,arrayLength:o.arrayLength,normalized:n.normalized,min:n.min,max:n.max,offset:n.offset,scale:n.scale,noData:n.noData,default:n.default,required:t,name:n.name,description:n.description,semantic:n.semantic,extras:n.extras,extensions:n.extensions,isLegacyExtension:r})},Object.defineProperties(ho.prototype,{id:{get:function(){return this._id}},name:{get:function(){return this._name}},description:{get:function(){return this._description}},type:{get:function(){return this._type}},enumType:{get:function(){return this._enumType}},componentType:{get:function(){return this._componentType}},valueType:{get:function(){return this._valueType}},isArray:{get:function(){return this._isArray}},isVariableLengthArray:{get:function(){return this._isVariableLengthArray}},arrayLength:{get:function(){return this._arrayLength}},normalized:{get:function(){return this._normalized}},max:{get:function(){return this._max}},min:{get:function(){return this._min}},noData:{get:function(){return this._noData}},default:{get:function(){return this._default}},required:{get:function(){return this._required}},semantic:{get:function(){return this._semantic}},hasValueTransform:{get:function(){return this._hasValueTransform}},offset:{get:function(){return this._offset}},scale:{get:function(){return this._scale}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}}),ho.prototype.normalize=function(e){return this._normalized?hh(e,this._valueType,u9.Z.normalize):e},ho.prototype.unnormalize=function(e){return this._normalized?hh(e,this._valueType,u9.Z.unnormalize):e},ho.prototype.applyValueTransform=function(e){return!this._hasValueTransform||this._isVariableLengthArray?e:ho.valueTransformInPlace(e,this._offset,this._scale,u9.Z.applyValueTransform)},ho.prototype.unapplyValueTransform=function(e){return!this._hasValueTransform||this._isVariableLengthArray?e:ho.valueTransformInPlace(e,this._offset,this._scale,u9.Z.unapplyValueTransform)},ho.prototype.expandConstant=function(e,t){t=(0,m.Z)(t,!1);let i=this._isArray,n=this._arrayLength,r=u5.Z.getComponentCount(this._type),o=i&&r>1;if(!i&&1===r)return e;if(!i)return Array(r).fill(e);if(!o)return Array(n).fill(e);if(!t)return Array(this._arrayLength*r).fill(e);let a=Array(r).fill(e);return Array(this._arrayLength).fill(a)},ho.prototype.handleNoData=function(e){let t=this._noData;if(!(0,_.Z)(t)||!function e(t,i){if(!Array.isArray(t))return t===i;if(!Array.isArray(i)||t.length!==i.length)return!1;for(let n=0;n<t.length;n++)if(!e(t[n],i[n]))return!1;return!0}(e,t))return e},ho.prototype.unpackVectorAndMatrixTypes=function(e,t){t=(0,m.Z)(t,!1);let i=u5.Z.getMathType(this._type),n=this._isArray,r=u5.Z.getComponentCount(this._type);return(0,_.Z)(i)?t&&n&&r>1?e.map(function(e){return i.unpack(e)}):n?i.unpackArray(e):i.unpack(e):e},ho.prototype.packVectorAndMatrixTypes=function(e,t){t=(0,m.Z)(t,!1);let i=u5.Z.getMathType(this._type),n=this._isArray,r=u5.Z.getComponentCount(this._type);return(0,_.Z)(i)?t&&n&&r>1?e.map(function(e){return i.pack(e,[])}):n?i.packArray(e,[]):i.pack(e,[]):e},ho.prototype.validate=function(e){return!(0,_.Z)(e)&&(0,_.Z)(this._default)?void 0:this._required&&!(0,_.Z)(e)?"required property must have a value":this._isArray?function(e,t){if(!Array.isArray(t))return`value ${t} must be an array`;let i=t.length;if(!e._isVariableLengthArray&&i!==e._arrayLength)return"Array length does not match property.arrayLength";for(let n=0;n<i;n++){let i=ha(e,t[n]);if((0,_.Z)(i))return i}}(this,e):ha(this,e)},ho.valueTransformInPlace=function(e,t,i,n){if(!Array.isArray(e))return n(e,t,i);for(let r=0;r<e.length;r++)e[r]=ho.valueTransformInPlace(e[r],t[r],i[r],n);return e},Object.defineProperties(hd.prototype,{hasValueTransform:{get:function(){return this._hasValueTransform}},offset:{get:function(){return this._offset}},scale:{get:function(){return this._scale}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}},byteLength:{get:function(){return this._byteLength}}}),hd.prototype.get=function(e){hp(this,e);let t=function(e,t){h_(e)&&hg(e);let i=e._classProperty,n=i.isArray,r=i.type,o=u5.Z.getComponentCount(r);if((0,_.Z)(e._unpackedValues)){let i=e._unpackedValues[t];return n?(0,uz.Z)(i,!0):i}return n||1!==o?hm(e,i,t):e._getValue(t)}(this,e);return t=this._classProperty.handleNoData(t),t=(0,_.Z)(t)?function(e,t){let i=e._classProperty.isVariableLengthArray;return!e._hasValueTransform||i?t:ho.valueTransformInPlace(t,e._offset,e._scale,u9.Z.applyValueTransform)}(this,t=this._classProperty.normalize(t)):this._classProperty.default,this._classProperty.unpackVectorAndMatrixTypes(t)},hd.prototype.set=function(e,t){let i=this._classProperty;p.Z.defined("value",t),hp(this,e);let n=i.validate(t);if((0,_.Z)(n))throw new A.Z(n);t=function(e,t){let i=e._classProperty.isVariableLengthArray;return!e._hasValueTransform||i?t:ho.valueTransformInPlace(t,e._offset,e._scale,u9.Z.unapplyValueTransform)}(this,t=i.packVectorAndMatrixTypes(t)),function(e,t,i){let n,r;(function(e,t,i){if(h_(e))return!0;let n=e._arrayOffsets;return!!(0,_.Z)(n)&&n.get(t+1)-n.get(t)!==i.length})(e,t,i)&&hg(e);let o=e._classProperty,a=o.isArray,s=o.type,l=u5.Z.getComponentCount(s);if((0,_.Z)(e._unpackedValues)){o.isArray&&(i=(0,uz.Z)(i,!0)),e._unpackedValues[t]=i;return}if(!a&&1===l){e._setValue(t,i);return}if(o.isVariableLengthArray)n=e._arrayOffsets.get(t),r=e._arrayOffsets.get(t+1)-n;else{let i=(0,m.Z)(o.arrayLength,1)*e._vectorComponentCount;n=t*i,r=i}for(let t=0;t<r;++t)e._setValue(n+t,i[t])}(this,e,t=i.unnormalize(t))},hd.prototype.getTypedArray=function(){if((0,_.Z)(this._values))return this._values.typedArray},Object.defineProperties(hy.prototype,{count:{get:function(){return this._count}},class:{get:function(){return this._class}},byteLength:{get:function(){return this._byteLength}}}),hy.prototype.hasProperty=function(e){return uB.hasProperty(e,this._properties,this._class)},hy.prototype.hasPropertyBySemantic=function(e){return uB.hasPropertyBySemantic(e,this._properties,this._class)},hy.prototype.getPropertyIds=function(e){return uB.getPropertyIds(this._properties,this._class,e)},hy.prototype.getProperty=function(e,t){p.Z.typeOf.string("propertyId",t);let i=this._properties[t];return(0,_.Z)(i)?i.get(e):function(e,t){let i=e.properties;if(!(0,_.Z)(i))return;let n=i[t];if((0,_.Z)(n)&&(0,_.Z)(n.default)){let e=n.default;return n.isArray&&(e=(0,uz.Z)(e,!0)),e=n.normalize(e),n.unpackVectorAndMatrixTypes(e)}}(this._class,t)},hy.prototype.setProperty=function(e,t,i){p.Z.typeOf.string("propertyId",t);let n=this._properties[t];return!!(0,_.Z)(n)&&(n.set(e,i),!0)},hy.prototype.getPropertyBySemantic=function(e,t){let i;p.Z.typeOf.string("semantic",t);let n=this._class.propertiesBySemantic;if((0,_.Z)(n)&&(i=n[t]),(0,_.Z)(i))return this.getProperty(e,i.id)},hy.prototype.setPropertyBySemantic=function(e,t,i){let n;p.Z.typeOf.string("semantic",t);let r=this._class.propertiesBySemantic;return(0,_.Z)(r)&&(n=r[t]),!!(0,_.Z)(n)&&this.setProperty(e,n.id,i)},hy.prototype.getPropertyTypedArray=function(e){p.Z.typeOf.string("propertyId",e);let t=this._properties[e];if((0,_.Z)(t))return t.getTypedArray()},hy.prototype.getPropertyTypedArrayBySemantic=function(e){let t;p.Z.typeOf.string("semantic",e);let i=this._class.propertiesBySemantic;if((0,_.Z)(i)&&(t=i[e]),(0,_.Z)(t))return this.getPropertyTypedArray(t.id)};var hb=function(e){let t=(e=(0,m.Z)(e,m.Z.EMPTY_OBJECT)).extension,i=e.schema;p.Z.typeOf.object("options.extension",t),p.Z.typeOf.object("options.schema",i);let n=[];if((0,_.Z)(t.propertyTables))for(let r=0;r<t.propertyTables.length;r++){let o=t.propertyTables[r],a=i.classes[o.class],s=new hy({count:o.count,properties:o.properties,class:a,bufferViews:e.bufferViews});n.push(new uV({id:r,name:o.name,count:o.count,metadataTable:s,extras:o.extras,extensions:o.extensions}))}let r=[];if((0,_.Z)(t.propertyTextures))for(let n=0;n<t.propertyTextures.length;n++){let o=t.propertyTextures[n];r.push(new he({id:n,name:o.name,propertyTexture:o,class:i.classes[o.class],textures:e.textures}))}let o=[];if((0,_.Z)(t.propertyAttributes))for(let e=0;e<t.propertyAttributes.length;e++){let n=t.propertyAttributes[e];o.push(new hi({id:e,name:n.name,class:i.classes[n.class],propertyAttribute:n}))}return new hn({schema:i,propertyTables:n,propertyTextures:r,propertyAttributes:o,statistics:t.statistics,extras:t.extras,extensions:t.extensions})},hv=i(2115),hT=function(e){let t,i;let n=(e=(0,m.Z)(e,m.Z.EMPTY_OBJECT)).extension,r=e.schema;p.Z.typeOf.object("options.extension",n),p.Z.typeOf.object("options.schema",r);let o=[];if((0,_.Z)(n.featureTables))for(t=0,i=Object.keys(n.featureTables).sort();t<i.length;t++){let a=i[t],s=n.featureTables[a],l=r.classes[s.class],c=new hy({count:s.count,properties:s.properties,class:l,bufferViews:e.bufferViews});o.push(new uV({id:a,count:s.count,metadataTable:c,extras:s.extras,extensions:s.extensions}))}let a=[];if((0,_.Z)(n.featureTextures))for(t=0,i=Object.keys(n.featureTextures).sort();t<i.length;t++){let o=i[t],s=n.featureTextures[o];a.push(new he({id:o,propertyTexture:function(e){let t={class:e.class,properties:{}},i=e.properties;for(let e in i)if(i.hasOwnProperty(e)){let n=i[e],r={channels:function(e){let t=e.length,i=Array(t);for(let n=0;n<t;n++)i[n]="rgba".indexOf(e[n]);return i}(n.channels),extras:n.extras,extensions:n.extensions};t.properties[e]=(0,hv.Z)(n.texture,r,!0)}return t}(s),class:r.classes[s.class],textures:e.textures}))}return new hn({schema:r,propertyTables:o,propertyTextures:a,statistics:n.statistics,extras:n.extras,extensions:n.extensions})};function hE(){}Object.defineProperties(hE.prototype,{cacheKey:{get:function(){A.Z.throwInstantiationError()}}}),hE.prototype.load=function(){A.Z.throwInstantiationError()},hE.prototype.unload=function(){},hE.prototype.process=function(e){return!1},hE.prototype.getError=function(e,t){p.Z.typeOf.string("errorMessage",e),(0,_.Z)(t)&&(0,_.Z)(t.message)&&(e+=` ${t.message}`);let i=new e3.Z(e);return(0,_.Z)(t)&&(i.stack=`Original stack: ${t.stack} Handler stack: ${i.stack}`),i},hE.prototype.isDestroyed=function(){return!1},hE.prototype.destroy=function(){return this.unload(),(0,g.Z)(this)};var hx=Object.freeze({UNLOADED:0,LOADING:1,LOADED:2,PROCESSING:3,READY:4,FAILED:5});function hw(e){let t=(e=(0,m.Z)(e,m.Z.EMPTY_OBJECT)).typedArray,i=e.resource,n=e.cacheKey;if((0,_.Z)(t)===(0,_.Z)(i))throw new A.Z("One of options.typedArray and options.resource must be defined.");this._typedArray=t,this._resource=i,this._cacheKey=n,this._state=hx.UNLOADED,this._promise=void 0}async function hS(e){let t=e._resource;e._state=hx.LOADING;try{let i=await hw._fetchArrayBuffer(t);if(e.isDestroyed())return;return e._typedArray=new Uint8Array(i),e._state=hx.READY,e}catch(n){if(e.isDestroyed())return;e._state=hx.FAILED;let i=`Failed to load external buffer: ${t.url}`;throw e.getError(i,n)}}(0,_.Z)(Object.create)&&(hw.prototype=Object.create(hE.prototype),hw.prototype.constructor=hw),Object.defineProperties(hw.prototype,{cacheKey:{get:function(){return this._cacheKey}},typedArray:{get:function(){return this._typedArray}}}),hw.prototype.load=async function(){return(0,_.Z)(this._promise)||((0,_.Z)(this._typedArray)?this._promise=Promise.resolve(this):this._promise=hS(this)),this._promise},hw._fetchArrayBuffer=function(e){return e.fetchArrayBuffer()},hw.prototype.unload=function(){this._typedArray=void 0};var hC=function(e,t){return(0,_.Z)(e)&&(0,_.Z)(e.extensions)&&(0,_.Z)(e.extensions[t])};u=new Uint8Array([32,0,65,2,1,106,34,33,3,128,11,4,13,64,6,253,10,7,15,116,127,5,8,12,40,16,19,54,20,9,27,255,113,17,42,67,24,23,146,148,18,14,22,45,70,69,56,114,101,21,25,63,75,136,108,28,118,29,73,115]),"object"==typeof WebAssembly&&WebAssembly.instantiate(function(e){for(var t=new Uint8Array(e.length),i=0;i<e.length;++i){var n=e.charCodeAt(i);t[i]=n>96?n-97:n>64?n-39:n+4}for(var r=0,i=0;i<e.length;++i)t[r++]=t[i]<60?u[t[i]]:(t[i]-60)*64+t[++i];return t.buffer.slice(0,r)}("b9H79TebbbeJq9Geueu9Geub9Gbb9Gvuuuuueu9Gduueu9Gluuuueu9Gvuuuuub9Gouuuuuub9Gluuuub9GiuuueuiKLdilevlevlooroowwvwbDDbelve9Weiiviebeoweuec:W;kekr;RiOo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9FW9U9J9V9KW9wWVtW949c919M9MWVbe8F9TW79O9V9Wt9FW9U9J9V9KW9wWVtW949c919M9MWV9c9V919U9KbdE9TW79O9V9Wt9FW9U9J9V9KW9wWVtW949wWV79P9V9UbiY9TW79O9V9Wt9FW9U9J9V9KW69U9KW949c919M9MWVbl8E9TW79O9V9Wt9FW9U9J9V9KW69U9KW949c919M9MWV9c9V919U9Kbv8A9TW79O9V9Wt9FW9U9J9V9KW69U9KW949wWV79P9V9UboE9TW79O9V9Wt9FW9U9J9V9KW69U9KW949tWG91W9U9JWbra9TW79O9V9Wt9FW9U9J9V9KW69U9KW949tWG91W9U9JW9c9V919U9KbwL9TW79O9V9Wt9FW9U9J9V9KWS9P2tWV9p9JtbDK9TW79O9V9Wt9FW9U9J9V9KWS9P2tWV9r919HtbqL9TW79O9V9Wt9FW9U9J9V9KWS9P2tWVT949WbkE9TW79O9V9Wt9F9V9Wt9P9T9P96W9wWVtW94J9H9J9OWbPa9TW79O9V9Wt9F9V9Wt9P9T9P96W9wWVtW94J9H9J9OW9ttV9P9Wbsa9TW79O9V9Wt9F9V9Wt9P9T9P96W9wWVtW94SWt9J9O9sW9T9H9WbzK9TW79O9V9Wt9F79W9Ht9P9H29t9VVt9sW9T9H9WbHl79IV9RbODwebcekdQXq:g9sLdbk;3keYu8Jjjjjbcjo9Rgv8Kjjjjbcbhodnalcefae0mbabcbRb:S:kjjbc:GeV86bbavcjdfcbcjdzNjjjb8AdnaiTmbavcjdfadalz:tjjjb8Akabaefhrabcefhwavalfcbcbcjdal9RalcFe0EzNjjjb8Aavavcjdfalz:tjjjbhDcj;abal9UhodndndndndnalTmbaoc;WFbGgecjdaecjd6Ehqcbhkdninakai9pmiaDcjlfcbcjdzNjjjb8Aaqaiak9Rakaqfai6Egxcsfgecl4cifcd4hmadakal2fhPdndndndndnaec9WGgsTmbcbhzcehHaPhOawhAxekdnaxTmbcbhAcehHaPhCinaDaAfRbbhXaDcjlfheaChoaxhQinaeaoRbbgLaX9RgXcetaX;acr4786bbaoalfhoaecefheaLhXaQcufgQmbkaraw9Ram6miawcbamzNjjjbgeTmiaCcefhCaeamfhwaAcefgAal6hHaAal9hmbxvkkaraw9Ram6mvawcbamzNjjjb8AceheinawgXamfhwalaegoSmldnaraw9Ram6mbaocefheawcbamzNjjjb8AaXmekkaoal6hHxekindnaxTmbaDazfRbbhXaDcjlfheaOhoaxhQinaeaoRbbgLaX9RgXcetaX;acr4786bbaoalfhoaecefheaLhXaQcufgQmbkkaraA9Ram6mearaAcbamzNjjjbgKamfgw9RcK6mdcbhYaDcjlfhAinaDcjlfaYfh8AcwhCczhLcehQindndnaQce9hmbcuhoa8ARbbmecbhodninaogecsSmeaecefhoaAaefcefRbbTmbkkcucbaecs6EhoxekaQcetc;:FFFeGhocuaQtcu7cFeGhXcbheinaoaXaAaefRbb9nfhoaecefgecz9hmbkkaoaLaoaL6geEhLaQaCaeEhCaQcetgQcw6mbkdndndndnaCcufPdiebkaKaYco4fgeaeRbbcdciaCclSEaYci4coGtV86bbaCcw9hmeawa8A8Pbb83bbawcwfa8Acwf8Pbb83bbawczfhwxdkaKaYco4fgeaeRbbceaYci4coGtV86bbkdncwaC9TgEmbinawcb86bbawcefhwxbkkcuaCtcu7h8Acbh3aAh5ina5heaEhQcbhoinaeRbbgLa8AcFeGgXaLaX6EaoaCtVhoaecefheaQcufgQmbkawao86bba5aEfh5awcefhwa3aEfg3cz6mbkcbheindnaAaefRbbgoaX6mbawao86bbawcefhwkaecefgecz9hmbkkdnaYczfgYas9pmbaAczfhAaraw9RcL0mekkaYas6meawTmeaOcefhOazcefgzal6hHawhAazalSmixbkkcbhwaHceGTmexikcbhwaHceGmdkaDaPaxcufal2falz:tjjjb8AaxakfhkawmbkcbhoxokcbhoxvkaiTmekcbhoaraw9Ralcaalca0E6mialc8F9nmexdkcbhoaecufca6mdkawcbcaal9RgezNjjjbaefhwkawaDcjdfalz:tjjjbalfab9Rhokavcjof8Kjjjjbaok9heeuaecaaeca0Eabcj;abae9Uc;WFbGgdcjdadcjd6Egdfcufad9Uae2adcl4cifcd4adV2fcefkmbcbabBd:S:kjjbk;rse3u8Jjjjjbc;ae9Rgl8Kjjjjbcbhvdnaici9UgocHfae0mbabcbyd:C:kjjbgrc;GeV86bbalc;abfcFecjezNjjjb8AalcUfgw9cu83ibalc8WfgD9cu83ibalcyfgq9cu83ibalcafgk9cu83ibalcKfgx9cu83ibalczfgm9cu83ibal9cu83iwal9cu83ibabaefc9WfhPabcefgsaofhednaiTmbcmcsarcb9kgzEhHcbhOcbhAcbhCcbhXcbhQindnaeaP9nmbcbhvxikaQcufhvadaCcdtfgoydbhLaocwfydbhKaoclfydbhYcbh8Adndninalc;abfavcsGcitfgoydlhEdndndnaoydbgoaL9hmbaEaYSmekdnaoaY9hmbaEaK9hmba8Acefh8AxekaoaK9hmeaEaL9hmea8Acdfh8Aka8Ac870mdaXcufhvada8AciGcx2goc:y1jjbfydbaCfcdtfydbhEadaocN1jjbfydbaCfcdtfydbhKadaoc:q1jjbfydbaCfcdtfydbhLcbhodnindnalavcsGcdtfydbaE9hmbaohYxdkcuhYavcufhvaocefgocz9hmbkkaEaOSgvaYce9iaYaH9oVgoGh3dndndndndncbcsavEaYaoEgvcs9hmbarce9imbaEaEaAaEcefaASgvEgAcefSmecmcsavEhvkasava8Acdtc;WeGV86bbavcs9hmeaEaA9Rgvcetavc8F917hvinaeavcFb0crtavcFbGV86bbaecefheavcje6hoavcr4hvaoTmbkaEhAxdkcPhvasa8AcdtcPV86bbaEhAkavTmbavaH9imekalaXcdtfaEBdbaXcefcsGhXkaOa3fhOalc;abfaQcitfgvaKBdlavaEBdbalc;abfaQcefcsGgvcitfgoaEBdlaoaLBdbavcefhoxikavcufhva8Aclfg8Ac;ab9hmbkkdnadceaKaOScetaYaOSEcx2gvc:q1jjbfydbaCfcdtfydbgLTadavcN1jjbfydbaCfcdtfydbg8AceSGadavc:y1jjbfydbaCfcdtfydbgYcdSGaOcb9hGazGg5ce9hmbaw9cu83ibaD9cu83ibaq9cu83ibak9cu83ibax9cu83ibam9cu83ibal9cu83iwal9cu83ibcbhOkcbhEaXcufgvhodnindnalaocsGcdtfydba8A9hmbaEhKxdkcuhKaocufhoaEcefgEcz9hmbkkcbhodnindnalavcsGcdtfydbaY9hmbaohExdkcuhEavcufhvaocefgocz9hmbkkaOaLaOSg8Efh3dndnaKcm0mbaKcefhKxekcbcsa8Aa3SgvEhKa3avfh3kdndnaEcm0mbaEcefhExekcbcsaYa3SgvEhEa3avfh3kc9:cua8EEh8FaEaKcltVhocbhvdndndninavcj1jjbfRbbaocFeGSmeavcefgvcz9hmbxdkka5aLaO9havcm0VVmbasavc;WeV86bbxekasa8F86bbaeao86bbaecefhekdna8EmbaLaA9Rgvcetavc8F917hvinaeavcFb0gocrtavcFbGV86bbavcr4hvaecefheaombkaLhAkdnaKcs9hmba8AaA9Rgvcetavc8F917hvinaeavcFb0gocrtavcFbGV86bbavcr4hvaecefheaombka8AhAkdnaEcs9hmbaYaA9Rgvcetavc8F917hvinaeavcFb0gocrtavcFbGV86bbavcr4hvaecefheaombkaYhAkalaXcdtfaLBdbaXcefcsGhvdndnaKPzbeeeeeeeeeeeeeebekalavcdtfa8ABdbaXcdfcsGhvkdndnaEPzbeeeeeeeeeeeeeebekalavcdtfaYBdbavcefcsGhvkalc;abfaQcitfgoaLBdlaoa8ABdbalc;abfaQcefcsGcitfgoa8ABdlaoaYBdbalc;abfaQcdfcsGcitfgoaYBdlaoaLBdbaQcifhoavhXa3hOkascefhsaocsGhQaCcifgCai6mbkkcbhvaeaP0mbcbhvinaeavfavcj1jjbfRbb86bbavcefgvcz9hmbkaeab9Ravfhvkalc;aef8KjjjjbavkZeeucbhddninadcefgdc8F0meceadtae6mbkkadcrfcFeGcr9Uci2cdfabci9U2cHfkmbcbabBd:C:kjjbk:ydewu8Jjjjjbcz9Rhlcbhvdnaicvfae0mbcbhvabcbRb:C:kjjbc;qeV86bbal9cb83iwabcefhoabaefc98fhrdnaiTmbcbhwcbhDindnaoar6mbcbskadaDcdtfydbgqalcwfawaqav9Rgvavc8F91gv7av9Rc507gwcdtfgkydb9Rgvc8E91c9:Gavcdt7awVhvinaoavcFb0gecrtavcFbGV86bbavcr4hvaocefhoaembkakaqBdbaqhvaDcefgDai9hmbkkcbhvaoar0mbaocbBbbaoab9RclfhvkavkBeeucbhddninadcefgdc8F0meceadtae6mbkkadcwfcFeGcr9Uab2cvfk:dvli99dui99ludnaeTmbcuadcetcuftcu7:Yhvdndncuaicuftcu7:YgoJbbbZMgr:lJbbb9p9DTmbar:Ohwxekcjjjj94hwkcbhicbhDinalclfIdbgrJbbbbJbbjZalIdbgq:lar:lMalcwfIdbgk:lMgr:varJbbbb9BEgrNhxaqarNhralcxfIdbhqdndnakJbbbb9GTmbaxhkxekJbbjZar:l:tgkak:maxJbbbb9GEhkJbbjZax:l:tgxax:marJbbbb9GEhrkdndnaqJbbj:;aqJbbj:;9GEgxJbbjZaxJbbjZ9FEavNJbbbZJbbb:;aqJbbbb9GEMgq:lJbbb9p9DTmbaq:Ohmxekcjjjj94hmkdndnakJbbj:;akJbbj:;9GEgqJbbjZaqJbbjZ9FEaoNJbbbZJbbb:;akJbbbb9GEMgq:lJbbb9p9DTmbaq:OhPxekcjjjj94hPkdndnarJbbj:;arJbbj:;9GEgqJbbjZaqJbbjZ9FEaoNJbbbZJbbb:;arJbbbb9GEMgr:lJbbb9p9DTmbar:Ohsxekcjjjj94hskdndnadcl9hmbabaifgzas86bbazcifam86bbazcdfaw86bbazcefaP86bbxekabaDfgzas87ebazcofam87ebazclfaw87ebazcdfaP87ebkalczfhlaiclfhiaDcwfhDaecufgembkkk;klld99eud99eudnaeTmbdndncuaicuftcu7:YgvJbbbZMgo:lJbbb9p9DTmbao:Ohixekcjjjj94hikaic;8FiGhrinabcofcicdalclfIdb:lalIdb:l9EgialcwfIdb:lalaicdtfIdb:l9EEgialcxfIdb:lalaicdtfIdb:l9EEgiarV87ebdndnalaicefciGcdtfIdbJ;Zl:1ZNJbbj:;JbbjZalaicdtfIdbJbbbb9DEgoNgwJbbj:;awJbbj:;9GEgDJbbjZaDJbbjZ9FEavNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohqxekcjjjj94hqkabaq87ebdndnaoalaicdfciGcdtfIdbJ;Zl:1ZNNgwJbbj:;awJbbj:;9GEgDJbbjZaDJbbjZ9FEavNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohqxekcjjjj94hqkabcdfaq87ebdndnaoalaicufciGcdtfIdbJ;Zl:1ZNNgoJbbj:;aoJbbj:;9GEgwJbbjZawJbbjZ9FEavNJbbbZJbbb:;aoJbbbb9GEMgo:lJbbb9p9DTmbao:Ohixekcjjjj94hikabclfai87ebabcwfhbalczfhlaecufgembkkk:Hvdxue998Jjjjjbcjd9Rgo8Kjjjjbadcd4hrdndndndnavcd9hmbadcl6mearcearce0EhwaohDinaDc:CuBdbaDclfhDawcufgwmbkaeTmiadcl6mdarcearce0EhqarcdthkalhxcbhminaohDaxhwaqhPinaDaDydbgsawydbgzcL4cFeGc:cufcbazEgzasaz9kEBdbawclfhwaDclfhDaPcufgPmbkaxakfhxamcefgmae9hmbkkaeTmdxekaeTmekavcb9hadcl6gqVhHarcearce0Ehkarcdthrceai9Rhmcbhdindndndnavce9hmbaqmdc:CuhwalhDakhPinawaDydbgscL4cFeGc:cufcbasEgsawas9kEhwaDclfhDaPcufgPmbxdkkc:CuhwaHmbaohDalhPakhsinaDaPydbgzcL4cFeGgxc8Aaxc8A9kEc:cufcbazEBdbaPclfhPaDclfhDascufgsmbkkaqmbcbhDakhsinawhPdnavceSmbaoaDfydbhPkdndnalaDfIdbgOcjjj;8iamaPfgPcLt9R::NJbbbZJbbb:;aOJbbbb9GEMgO:lJbbb9p9DTmbaO:Ohzxekcjjjj94hzkabaDfazcFFFrGaPcKtVBdbaDclfhDascufgsmbkkabarfhbalarfhladcefgdae9hmbkkaocjdf8KjjjjbkFkdCui998Jjjjjbc:Gd9Rgv8Kjjjjbavc:4efcbc;KbzNjjjb8AcbhodnadTmbcbhoaiTmbdnabae9hmbavcuadcdtgoadcFFFFi0Ecbyd:K:kjjbHjjjjbbgeBd:4eavceBd:ydaeabaoz:tjjjb8Akavc:OefcwfcbBdbav9cb83i:Oeavc:Oefaeadaiavc:4efz:njjjbcuaicdtgraicFFFFi0Egwcbyd:K:kjjbHjjjjbbhoavc:4efavyd:ydgDcdtfaoBdbavaDcefgqBd:ydaoavyd:Oegkarz:tjjjbhxavc:4efaqcdtfadci9Ugmcbyd:K:kjjbHjjjjbbgoBdbavaDcdfgrBd:ydaocbamzNjjjbhPavc:4efarcdtfawcbyd:K:kjjbHjjjjbbgsBdbavaDcifgqBd:ydaxhoashrinaralIdbalaoydbgwcwawcw6Ecdtfc;ebfIdbMUdbaoclfhoarclfhraicufgimbkavc:4efaqcdtfcuamcdtadcFFFF970Ecbyd:K:kjjbHjjjjbbgqBdbavaDclfBd:yddnadci6mbamceamce0EhiaehoaqhrinarasaoydbcdtfIdbasaoclfydbcdtfIdbMasaocwfydbcdtfIdbMUdbaocxfhoarclfhraicufgimbkkavc;qbfhzavhoavyd:SehHavyd:WehOcbhwcbhrcbhAcehCinaohXcihQaearci2gLcdtfgocwfydbhdaoydbhDabaAcx2fgiclfaoclfydbgKBdbaiaDBdbaicwfadBdbaParfce86bbazadBdwazaKBdlazaDBdbaqarcdtfcbBdbdnawTmbcihQaXhiinazaQcdtfaiydbgoBdbaQaoaD9haoaK9hGaoad9hGfhQaiclfhiawcufgwmbkkaAcefhAaxaDcdtfgoaoydbcufBdbaxaKcdtfgoaoydbcufBdbaxadcdtfgoaoydbcufBdbcbhwinaOaHaeawaLfcdtfydbcdtgifydbcdtfgKhoakaifgDydbgdhidnadTmbdninaoydbarSmeaoclfhoaicufgiTmdxbkkaoadcdtaKfc98fydbBdbaDaDydbcufBdbkawcefgwci9hmbkdndndnaQTmbcuhrJbbbbhYcbhDavyd:SehKavyd:WehLindndnakazaDcdtfydbcdtgofydbgimbaDcefhDxekaDcs0hwasaofgdIdbh8AadalcbaDcefgDawEcdtfIdbalaxaofydbgwcwawcw6Ecdtfc;ebfIdbMgEUdbaEa8A:thEaicdthiaLaKaofydbcdtfhoinaqaoydbgwcdtfgdaEadIdbMg8AUdba8AaYaYa8A9DgdEhYawaradEhraoclfhoaic98fgimbkkaDaQ9hmbkarcu9hmekaCam9pmeindnaPaCfRbbmbaChrxdkamaCcefgC9hmbxdkkaQczaQcz6EhwazhoaXhzarcu9hmekkavyd:ydhokaocdtavc:4effc98fhrdninaoTmearydbcbyd:G:kjjbH:bjjjbbarc98fhraocufhoxbkkavc:Gdf8Kjjjjbk;UlevucuaicdtgvaicFFFFi0Egocbyd:K:kjjbHjjjjbbhralalyd9GgwcdtfarBdbalawcefBd9GabarBdbaocbyd:K:kjjbHjjjjbbhralalyd9GgocdtfarBdbalaocefBd9GabarBdlcuadcdtadcFFFFi0Ecbyd:K:kjjbHjjjjbbhralalyd9GgocdtfarBdbalaocefBd9GabarBdwabydbcbavzNjjjb8Aadci9UhwdnadTmbabydbhoaehladhrinaoalydbcdtfgvavydbcefBdbalclfhlarcufgrmbkkdnaiTmbabydbhlabydlhrcbhvaihoinaravBdbarclfhralydbavfhvalclfhlaocufgombkkdnadci6mbawceawce0EhDabydlhrabydwhvcbhlinaecwfydbhoaeclfydbhdaraeydbcdtfgwawydbgwcefBdbavawcdtfalBdbaradcdtfgdadydbgdcefBdbavadcdtfalBdbaraocdtfgoaoydbgocefBdbavaocdtfalBdbaecxfheaDalcefgl9hmbkkdnaiTmbabydlheabydbhlinaeaeydbalydb9RBdbalclfhlaeclfheaicufgimbkkkQbabaeadaic:01jjbz:mjjjbkQbabaeadaic:C:jjjbz:mjjjbk9DeeuabcFeaicdtzNjjjbhlcbhbdnadTmbindnalaeydbcdtfgiydbcu9hmbaiabBdbabcefhbkaeclfheadcufgdmbkkabk;:kivuo99lu8Jjjjjbcj;Hb9Rgl8Kjjjjbcbhvalc1;Gbfcbc;KbzNjjjb8AalcuadcdtadcFFFFi0Egocbyd:K:kjjbHjjjjbbgrBd19GalceBd;O9Galcwfcbyd:m:kjjbBdbalcb8Pd:e:kjjb83ibalc;W;Gbfcwfcbyd:y:kjjbBdbalcb8Pd:q:kjjb83i;W9Gaicd4hwdndnadmbJFFuFhDJFFuuhqJFFuuhkJFFuFhxJFFuuhmJFFuFhPxekawcdthsaehzincbhiinalaifgHazaifIdbgDaHIdbgxaxaD9EEUdbalc;W;GbfaifgHaDaHIdbgxaxaD9DEUdbaiclfgicx9hmbkazasfhzavcefgvad9hmbkalIdwhqalId;49GhDalIdlhkalId;09GhxalIdbhmalId;W9GhPkdndnadTmbJbbbbJbbjZaPam:tJbbbb:xgPaxak:tgxaxaP9DEgxaDaq:tgDaDax9DEgD:vaDJbbbb9BEhDawcdthsarhHadhzindndnaDaeIdbam:tNJb;au9eNJbbbZMgx:lJbbb9p9DTmbax:Ohixekcjjjj94hikaicztaicwtcj;GiGVaicsGVc:p;G:dKGcH2c;d;H:WKGcv2c;j:KM;jbGhvdndnaDaeclfIdbak:tNJb;au9eNJbbbZMgx:lJbbb9p9DTmbax:Ohixekcjjjj94hikaicztaicwtcj;GiGVaicsGVc:p;G:dKGcH2c;d;H:WKGcq2cM;j:KMeGavVhvdndnaDaecwfIdbaq:tNJb;au9eNJbbbZMgx:lJbbb9p9DTmbax:Ohixekcjjjj94hikaHavaicztaicwtcj;GiGVaicsGVc:p;G:dKGcH2c;d;H:WKGcC2c:KM;j:KdGVBdbaeasfheaHclfhHazcufgzmbkalcbcj;GbzNjjjbhiarhHadheinaiaHydbgzcFrGcx2fgvavydbcefBdbaiazcq4cFrGcx2fgvavydlcefBdlaiazcC4cFrGcx2fgzazydwcefBdwaHclfhHaecufgembxdkkalcbcj;GbzNjjjb8AkcbhHcbhzcbhecbhvinalaHfgiydbhsaiazBdbaicwfgwydbhOawavBdbaiclfgiydbhwaiaeBdbasazfhzaOavfhvawaefheaHcxfgHcj;Gb9hmbkcbhialaocbyd:K:kjjbHjjjjbbgzBd:m9GdnadTmbabhHinaHaiBdbaHclfhHadaicefgi9hmbkadTmbabhiadhHinalaraiydbgecdtfydbcFrGcx2fgvavydbgvcefBdbazavcdtfaeBdbaiclfhiaHcufgHmbkazhiadhHinalaraiydbgecdtfydbcq4cFrGcx2fgvavydlgvcefBdlabavcdtfaeBdbaiclfhiaHcufgHmbkabhiadhHinalaraiydbgecdtfydbcC4cFrGcx2fgvavydwgvcefBdwazavcdtfaeBdbaiclfhiaHcufgHmbkadTmbcbhiinabazydbcdtfaiBdbazclfhzadaicefgi9hmbkkclhidninaic98Smealc1;Gbfaifydbcbyd:G:kjjbH:bjjjbbaic98fhixbkkalcj;Hbf8Kjjjjbk9teiucbcbyd:O:kjjbgeabcifc98GfgbBd:O:kjjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;LeeeudndnaeabVciGTmbabhixekdndnadcz9pmbabhixekabhiinaiaeydbBdbaiclfaeclfydbBdbaicwfaecwfydbBdbaicxfaecxfydbBdbaeczfheaiczfhiadc9Wfgdcs0mbkkadcl6mbinaiaeydbBdbaeclfheaiclfhiadc98fgdci0mbkkdnadTmbinaiaeRbb86bbaicefhiaecefheadcufgdmbkkabk;aeedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdbaicxfalBdbaicwfalBdbaiclfalBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabk9teiucbcbyd:O:kjjbgeabcrfc94GfgbBd:O:kjjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik9:eiuZbhedndncbyd:O:kjjbgdaecztgi9nmbcuheadai9RcFFifcz4nbcuSmekadhekcbabae9Rcifc98Gcbyd:O:kjjbfgdBd:O:kjjbdnadZbcztge9nmbadae9RcFFifcz4nb8Akkk:6ddbcjwk:Cdb4:h9w9N94:P:gW:j9O:ye9Pbbbbbbebbbdbbbebbbdbbbbbbbdbbbbbbbebbbbbbb:l29hZ;69:9kZ;N;76Z;rg97Z;z;o9xZ8J;B85Z;:;u9yZ;b;k9HZ:2;Z9DZ9e:l9mZ59A8KZ:r;T3Z:A:zYZ79OHZ;j4::8::Y:D9V8:bbbb9s:49:Z8R:hBZ9M9M;M8:L;z;o8:;8:PG89q;x:J878R:hQ8::M:B;e87bbbbbbjZbbjZbbjZ:E;V;N8::Y:DsZ9i;H;68:xd;R8:;h0838:;W:NoZbbbb:WV9O8:uf888:9i;H;68:9c9G;L89;n;m9m89;D8Ko8:bbbbf:8tZ9m836ZS:2AZL;zPZZ818EZ9e:lxZ;U98F8:819E;68:FFuuFFuuFFuuFFuFFFuFFFuFbc:Cqkzebbbebbbdbbb8WWbb"),{}).then(function(e){(c=e.instance).exports.__wasm_call_ctors(),c.exports.meshopt_encodeVertexVersion(0),c.exports.meshopt_encodeIndexVersion(1)});var hA=function(){var e,t=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,3,2,0,0,5,3,1,0,1,12,1,0,10,22,2,12,0,65,0,65,0,65,0,252,10,0,0,11,7,0,65,0,253,15,26,11]),i=new Uint8Array([32,0,65,2,1,106,34,33,3,128,11,4,13,64,6,253,10,7,15,116,127,5,8,12,40,16,19,54,20,9,27,255,113,17,42,67,24,23,146,148,18,14,22,45,70,69,56,114,101,21,25,63,75,136,108,28,118,29,73,115]);if("object"!=typeof WebAssembly)return{supported:!1};var n=WebAssembly.validate(t)?"b9H79TebbbeKl9Gbb9Gvuuuuueu9Giuuub9Geueuikqbbebeedddilve9Weeeviebeoweuec:q;Aekr;leDo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9KW9J9V9KW9wWVtW949c919M9MWVbdY9TW79O9V9Wt9F9KW9J9V9KW69U9KW949c919M9MWVblE9TW79O9V9Wt9F9KW9J9V9KW69U9KW949tWG91W9U9JWbvL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9p9JtboK9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9r919HtbrL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVT949Wbwl79IV9RbDq;b9tqlbzik9:evu8Jjjjjbcz9Rhbcbheincbhdcbhiinabcwfadfaicjuaead4ceGglE86bbaialfhiadcefgdcw9hmbkaec:q:yjjbfai86bbaecitc:q1jjbfab8Piw83ibaecefgecjd9hmbkk;e8JlHud97euo978Jjjjjbcj;kb9Rgv8Kjjjjbc9:hodnadcefal0mbcuhoaiRbbc:Ge9hmbavaialfgrad9Rad;8qbbcj;abad9UhoaicefhldnadTmbaoc;WFbGgocjdaocjd6EhwcbhDinaDae9pmeawaeaD9RaDawfae6Egqcsfgoc9WGgkci2hxakcethmaocl4cifcd4hPabaDad2fhscbhzdnincbhHalhOcbhAdninaraO9RaP6miavcj;cbfaAak2fhCaOaPfhlcbhidnakc;ab6mbaral9Rc;Gb6mbcbhoinaCaofhidndndndndnaOaoco4fRbbgXciGPlbedibkaipxbbbbbbbbbbbbbbbbpklbxikaialpbblalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklbalclfaYpQbfaKc:q:yjjbfRbbfhlxdkaialpbbwalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklbalcwfaYpQbfaKc:q:yjjbfRbbfhlxekaialpbbbpklbalczfhlkdndndndndnaXcd4ciGPlbedibkaipxbbbbbbbbbbbbbbbbpklzxikaialpbblalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklzalclfaYpQbfaKc:q:yjjbfRbbfhlxdkaialpbbwalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklzalcwfaYpQbfaKc:q:yjjbfRbbfhlxekaialpbbbpklzalczfhlkdndndndndnaXcl4ciGPlbedibkaipxbbbbbbbbbbbbbbbbpklaxikaialpbblalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklaalclfaYpQbfaKc:q:yjjbfRbbfhlxdkaialpbbwalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklaalcwfaYpQbfaKc:q:yjjbfRbbfhlxekaialpbbbpklaalczfhlkdndndndndnaXco4Plbedibkaipxbbbbbbbbbbbbbbbbpkl8WxikaialpbblalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibaXc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spkl8WalclfaYpQbfaXc:q:yjjbfRbbfhlxdkaialpbbwalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibaXc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spkl8WalcwfaYpQbfaXc:q:yjjbfRbbfhlxekaialpbbbpkl8Walczfhlkaoc;abfhiaocjefak0meaihoaral9Rc;Fb0mbkkdndnaiak9pmbaici4hoinaral9RcK6mdaCaifhXdndndndndnaOaico4fRbbaocoG4ciGPlbedibkaXpxbbbbbbbbbbbbbbbbpklbxikaXalpbblalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklbalclfaYpQbfaKc:q:yjjbfRbbfhlxdkaXalpbbwalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklbalcwfaYpQbfaKc:q:yjjbfRbbfhlxekaXalpbbbpklbalczfhlkaocdfhoaiczfgiak6mbkkalTmbaAcd0hHalhOaAcefgAclSmdxekkcbhlaHceGTmdkdnakTmbavcjdfazfhiavazfpbdbhYcbhXinaiavcj;cbfaXfgopblbgLcep9TaLpxeeeeeeeeeeeeeeeegQp9op9Hp9rgLaoakfpblbg8Acep9Ta8AaQp9op9Hp9rg8ApmbzeHdOiAlCvXoQrLgEaoamfpblbg3cep9Ta3aQp9op9Hp9rg3aoaxfpblbg5cep9Ta5aQp9op9Hp9rg5pmbzeHdOiAlCvXoQrLg8EpmbezHdiOAlvCXorQLgQaQpmbedibedibedibediaYp9UgYp9AdbbaiadfgoaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaoadfgoaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaoadfgoaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaoadfgoaYaEa8EpmwDKYqk8AExm35Ps8E8FgQaQpmbedibedibedibedip9UgYp9AdbbaoadfgoaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaoadfgoaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaoadfgoaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaoadfgoaYaLa8ApmwKDYq8AkEx3m5P8Es8FgLa3a5pmwKDYq8AkEx3m5P8Es8Fg8ApmbezHdiOAlvCXorQLgQaQpmbedibedibedibedip9UgYp9AdbbaoadfgoaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaoadfgoaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaoadfgoaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaoadfgoaYaLa8ApmwDKYqk8AExm35Ps8E8FgQaQpmbedibedibedibedip9UgYp9AdbbaoadfgoaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaoadfgoaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaoadfgoaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaoadfhiaXczfgXak6mbkkazclfgzad6mbkasavcjdfaqad2;8qbbavavcjdfaqcufad2fad;8qbbaqaDfhDc9:hoalmexikkc9:hoxekcbc99aral9Radcaadca0ESEhokavcj;kbf8Kjjjjbaokwbz:bjjjbk;tzeHu8Jjjjjbc;ae9Rgv8Kjjjjbc9:hodnaeci9UgrcHfal0mbcuhoaiRbbgwc;WeGc;Ge9hmbawcsGgDce0mbavc;abfcFecje;8kbavcUf9cu83ibavc8Wf9cu83ibavcyf9cu83ibavcaf9cu83ibavcKf9cu83ibavczf9cu83ibav9cu83iwav9cu83ibaialfc9WfhqaicefgwarfhodnaeTmbcmcsaDceSEhkcbhxcbhmcbhrcbhicbhlindnaoaq9nmbc9:hoxikdndnawRbbgDc;Ve0mbavc;abfalaDcu7gPcl4fcsGcitfgsydlhzasydbhHdnaDcsGgDak9pmbavaiaPfcsGcdtfydbaxaDEhsaDThDdndnadcd9hmbabarcetfgPaH87ebaPcdfaz87ebaPclfas87ebxekabarcdtfgPaHBdbaPclfazBdbaPcwfasBdbkaxaDfhxavc;abfalcitfgPasBdbaPazBdlavaicdtfasBdbavc;abfalcefcsGglcitfgPaHBdbaPasBdlaiaDfhialcefhlxdkdndnaDcsSmbamaDfaDc987fcefhmxekaocefhDao8SbbgscFeGhPdndnascu9mmbaDhoxekaocvfhoaPcFbGhPcrhsdninaD8SbbgOcFbGastaPVhPaOcu9kmeaDcefhDascrfgsc8J9hmbxdkkaDcefhokaPce4cbaPceG9R7amfhmkdndnadcd9hmbabarcetfgDaH87ebaDcdfaz87ebaDclfam87ebxekabarcdtfgDaHBdbaDclfazBdbaDcwfamBdbkavc;abfalcitfgDamBdbaDazBdlavaicdtfamBdbavc;abfalcefcsGglcitfgDaHBdbaDamBdlaicefhialcefhlxekdnaDcpe0mbaxcefgOavaiaqaDcsGfRbbgscl49RcsGcdtfydbascz6gPEhDavaias9RcsGcdtfydbaOaPfgzascsGgOEhsaOThOdndnadcd9hmbabarcetfgHax87ebaHcdfaD87ebaHclfas87ebxekabarcdtfgHaxBdbaHclfaDBdbaHcwfasBdbkavaicdtfaxBdbavc;abfalcitfgHaDBdbaHaxBdlavaicefgicsGcdtfaDBdbavc;abfalcefcsGcitfgHasBdbaHaDBdlavaiaPfcsGgicdtfasBdbavc;abfalcdfcsGglcitfgDaxBdbaDasBdlalcefhlaiaOfhiazaOfhxxekaxcbaoRbbgHEgAaDc;:eSgDfhzaHcsGhCaHcl4hXdndnaHcs0mbazcefhOxekazhOavaiaX9RcsGcdtfydbhzkdndnaCmbaOcefhxxekaOhxavaiaH9RcsGcdtfydbhOkdndnaDTmbaocefhDxekaocdfhDao8SbegPcFeGhsdnaPcu9kmbaocofhAascFbGhscrhodninaD8SbbgPcFbGaotasVhsaPcu9kmeaDcefhDaocrfgoc8J9hmbkaAhDxekaDcefhDkasce4cbasceG9R7amfgmhAkdndnaXcsSmbaDhsxekaDcefhsaD8SbbgocFeGhPdnaocu9kmbaDcvfhzaPcFbGhPcrhodninas8SbbgDcFbGaotaPVhPaDcu9kmeascefhsaocrfgoc8J9hmbkazhsxekascefhskaPce4cbaPceG9R7amfgmhzkdndnaCcsSmbashoxekascefhoas8SbbgDcFeGhPdnaDcu9kmbascvfhOaPcFbGhPcrhDdninao8SbbgscFbGaDtaPVhPascu9kmeaocefhoaDcrfgDc8J9hmbkaOhoxekaocefhokaPce4cbaPceG9R7amfgmhOkdndnadcd9hmbabarcetfgDaA87ebaDcdfaz87ebaDclfaO87ebxekabarcdtfgDaABdbaDclfazBdbaDcwfaOBdbkavc;abfalcitfgDazBdbaDaABdlavaicdtfaABdbavc;abfalcefcsGcitfgDaOBdbaDazBdlavaicefgicsGcdtfazBdbavc;abfalcdfcsGcitfgDaABdbaDaOBdlavaiaHcz6aXcsSVfgicsGcdtfaOBdbaiaCTaCcsSVfhialcifhlkawcefhwalcsGhlaicsGhiarcifgrae6mbkkcbc99aoaqSEhokavc;aef8Kjjjjbaok:flevu8Jjjjjbcz9Rhvc9:hodnaecvfal0mbcuhoaiRbbc;:eGc;qe9hmbav9cb83iwaicefhraialfc98fhwdnaeTmbdnadcdSmbcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcdtfaic8Etc8F91aicd47avcwfaiceGcdtVgoydbfglBdbaoalBdbaDcefgDae9hmbxdkkcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcetfaic8Etc8F91aicd47avcwfaiceGcdtVgoydbfgl87ebaoalBdbaDcefgDae9hmbkkcbc99arawSEhokaok:wPliuo97eue978Jjjjjbca9Rhiaec98Ghldndnadcl9hmbdnalTmbcbhvabhdinadadpbbbgocKp:RecKp:Sep;6egraocwp:RecKp:Sep;6earp;Geaoczp:RecKp:Sep;6egwp;Gep;Kep;LegDpxbbbbbbbbbbbbbbbbp:2egqarpxbbbjbbbjbbbjbbbjgkp9op9rp;Kegrpxbb;:9cbb;:9cbb;:9cbb;:9cararp;MeaDaDp;Meawaqawakp9op9rp;Kegrarp;Mep;Kep;Kep;Jep;Negwp;Mepxbbn0bbn0bbn0bbn0gqp;KepxFbbbFbbbFbbbFbbbp9oaopxbbbFbbbFbbbFbbbFp9op9qarawp;Meaqp;Kecwp:RepxbFbbbFbbbFbbbFbbp9op9qaDawp;Meaqp;Keczp:RepxbbFbbbFbbbFbbbFbp9op9qpkbbadczfhdavclfgval6mbkkalae9pmeaipxbbbbbbbbbbbbbbbbgqpklbaiabalcdtfgdaeciGglcdtgv;8qbbdnalTmbaiaipblbgocKp:RecKp:Sep;6egraocwp:RecKp:Sep;6earp;Geaoczp:RecKp:Sep;6egwp;Gep;Kep;LegDaqp:2egqarpxbbbjbbbjbbbjbbbjgkp9op9rp;Kegrpxbb;:9cbb;:9cbb;:9cbb;:9cararp;MeaDaDp;Meawaqawakp9op9rp;Kegrarp;Mep;Kep;Kep;Jep;Negwp;Mepxbbn0bbn0bbn0bbn0gqp;KepxFbbbFbbbFbbbFbbbp9oaopxbbbFbbbFbbbFbbbFp9op9qarawp;Meaqp;Kecwp:RepxbFbbbFbbbFbbbFbbp9op9qaDawp;Meaqp;Keczp:RepxbbFbbbFbbbFbbbFbp9op9qpklbkadaiav;8qbbskdnalTmbcbhvabhdinadczfgxaxpbbbgopxbbbbbbFFbbbbbbFFgkp9oadpbbbgDaopmlvorxmPsCXQL358E8FpxFubbFubbFubbFubbp9op;6eaDaopmbediwDqkzHOAKY8AEgoczp:Sep;6egrp;Geaoczp:Reczp:Sep;6egwp;Gep;Kep;Legopxb;:FSb;:FSb;:FSb;:FSawaopxbbbbbbbbbbbbbbbbp:2egqawpxbbbjbbbjbbbjbbbjgmp9op9rp;Kegwawp;Meaoaop;Mearaqaramp9op9rp;Kegoaop;Mep;Kep;Kep;Jep;Negrp;Mepxbbn0bbn0bbn0bbn0gqp;Keczp:Reawarp;Meaqp;KepxFFbbFFbbFFbbFFbbp9op9qgwaoarp;Meaqp;KepxFFbbFFbbFFbbFFbbp9ogopmwDKYqk8AExm35Ps8E8Fp9qpkbbadaDakp9oawaopmbezHdiOAlvCXorQLp9qpkbbadcafhdavclfgval6mbkkalae9pmbaiaeciGgvcitgdfcbcaad9R;8kbaiabalcitfglad;8qbbdnavTmbaiaipblzgopxbbbbbbFFbbbbbbFFgkp9oaipblbgDaopmlvorxmPsCXQL358E8FpxFubbFubbFubbFubbp9op;6eaDaopmbediwDqkzHOAKY8AEgoczp:Sep;6egrp;Geaoczp:Reczp:Sep;6egwp;Gep;Kep;Legopxb;:FSb;:FSb;:FSb;:FSawaopxbbbbbbbbbbbbbbbbp:2egqawpxbbbjbbbjbbbjbbbjgmp9op9rp;Kegwawp;Meaoaop;Mearaqaramp9op9rp;Kegoaop;Mep;Kep;Kep;Jep;Negrp;Mepxbbn0bbn0bbn0bbn0gqp;Keczp:Reawarp;Meaqp;KepxFFbbFFbbFFbbFFbbp9op9qgwaoarp;Meaqp;KepxFFbbFFbbFFbbFFbbp9ogopmwDKYqk8AExm35Ps8E8Fp9qpklzaiaDakp9oawaopmbezHdiOAlvCXorQLp9qpklbkalaiad;8qbbkk;4wllue97euv978Jjjjjbc8W9Rhidnaec98GglTmbcbhvabhoinaiaopbbbgraoczfgwpbbbgDpmlvorxmPsCXQL358E8Fgqczp:Segkclp:RepklbaopxbbjZbbjZbbjZbbjZpx;Zl81Z;Zl81Z;Zl81Z;Zl81Zakpxibbbibbbibbbibbbp9qp;6ep;NegkaraDpmbediwDqkzHOAKY8AEgrczp:Reczp:Sep;6ep;MegDaDp;Meakarczp:Sep;6ep;Megxaxp;Meakaqczp:Reczp:Sep;6ep;Megqaqp;Mep;Kep;Kep;Lepxbbbbbbbbbbbbbbbbp:4ep;Jepxb;:FSb;:FSb;:FSb;:FSgkp;Mepxbbn0bbn0bbn0bbn0grp;KepxFFbbFFbbFFbbFFbbgmp9oaxakp;Mearp;Keczp:Rep9qgxaqakp;Mearp;Keczp:ReaDakp;Mearp;Keamp9op9qgkpmbezHdiOAlvCXorQLgrp5baipblbpEb:T:j83ibaocwfarp5eaipblbpEe:T:j83ibawaxakpmwDKYqk8AExm35Ps8E8Fgkp5baipblbpEd:T:j83ibaocKfakp5eaipblbpEi:T:j83ibaocafhoavclfgval6mbkkdnalae9pmbaiaeciGgvcitgofcbcaao9R;8kbaiabalcitfgwao;8qbbdnavTmbaiaipblbgraipblzgDpmlvorxmPsCXQL358E8Fgqczp:Segkclp:RepklaaipxbbjZbbjZbbjZbbjZpx;Zl81Z;Zl81Z;Zl81Z;Zl81Zakpxibbbibbbibbbibbbp9qp;6ep;NegkaraDpmbediwDqkzHOAKY8AEgrczp:Reczp:Sep;6ep;MegDaDp;Meakarczp:Sep;6ep;Megxaxp;Meakaqczp:Reczp:Sep;6ep;Megqaqp;Mep;Kep;Kep;Lepxbbbbbbbbbbbbbbbbp:4ep;Jepxb;:FSb;:FSb;:FSb;:FSgkp;Mepxbbn0bbn0bbn0bbn0grp;KepxFFbbFFbbFFbbFFbbgmp9oaxakp;Mearp;Keczp:Rep9qgxaqakp;Mearp;Keczp:ReaDakp;Mearp;Keamp9op9qgkpmbezHdiOAlvCXorQLgrp5baipblapEb:T:j83ibaiarp5eaipblapEe:T:j83iwaiaxakpmwDKYqk8AExm35Ps8E8Fgkp5baipblapEd:T:j83izaiakp5eaipblapEi:T:j83iKkawaiao;8qbbkk:Pddiue978Jjjjjbc;ab9Rhidnadcd4ae2glc98GgvTmbcbheabhdinadadpbbbgocwp:Recwp:Sep;6eaocep:SepxbbjFbbjFbbjFbbjFp9opxbbjZbbjZbbjZbbjZp:Uep;Mepkbbadczfhdaeclfgeav6mbkkdnaval9pmbaialciGgecdtgdVcbc;abad9R;8kbaiabavcdtfgvad;8qbbdnaeTmbaiaipblbgocwp:Recwp:Sep;6eaocep:SepxbbjFbbjFbbjFbbjFp9opxbbjZbbjZbbjZbbjZp:Uep;Mepklbkavaiad;8qbbkk9teiucbcbydj1jjbgeabcifc98GfgbBdj1jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaikkkebcjwklz9Tbb":"b9H79Tebbbe8Fv9Gbb9Gvuuuuueu9Giuuub9Geueu9Giuuueuikqbeeedddillviebeoweuec:q;iekr;leDo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9KW9J9V9KW9wWVtW949c919M9MWVbeY9TW79O9V9Wt9F9KW9J9V9KW69U9KW949c919M9MWVbdE9TW79O9V9Wt9F9KW9J9V9KW69U9KW949tWG91W9U9JWbiL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9p9JtblK9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9r919HtbvL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVT949Wbol79IV9Rbrq;d8Yqdbk:yzeHu8Jjjjjbcj;eb9Rgv8Kjjjjbc9:hodnadcefal0mbcuhoaiRbbc:Ge9hmbavaialfgrad9Radz1jjjbhwcj;abad9UhlaicefhodnadTmbalc;WFbGglcjdalcjd6EhDcbhqinaqae9pmeaDaeaq9RaqaDfae6Egkcsfglcl4cifcd4hxdndndndnalc9WGgmTmbcbhPcehsawcjdfhzaohHinaraH9Rax6midnaraHaxfgo9RcK6mbczhlcbhOinalgic9WfgAawcj;cbffhldndndndndnaHaAco4fRbbaOcoG4ciGPlbedibkal9cb83ibalcwf9cb83ibxikalaoRblaoRbbgAco4gCaCciSgCE86bbawcj;cbfaifglcGfaoclfaCfgCRbbaAcl4ciGgXaXciSgXE86bbalcVfaCaXfgCRbbaAcd4ciGgXaXciSgXE86bbalc7faCaXfgCRbbaAciGgAaAciSgAE86bbalctfaCaAfgCRbbaoRbegAco4gXaXciSgXE86bbalc91faCaXfgCRbbaAcl4ciGgXaXciSgXE86bbalc4faCaXfgCRbbaAcd4ciGgXaXciSgXE86bbalc93faCaXfgCRbbaAciGgAaAciSgAE86bbalc94faCaAfgCRbbaoRbdgAco4gXaXciSgXE86bbalc95faCaXfgCRbbaAcl4ciGgXaXciSgXE86bbalc96faCaXfgCRbbaAcd4ciGgXaXciSgXE86bbalc97faCaXfgCRbbaAciGgAaAciSgAE86bbalc98faCaAfgARbbaoRbigoco4gCaCciSgCE86bbalc99faAaCfgARbbaocl4ciGgCaCciSgCE86bbalc9:faAaCfgARbbaocd4ciGgCaCciSgCE86bbalcufaAaCfglRbbaociGgoaociSgoE86bbalaofhoxdkalaoRbwaoRbbgAcl4gCaCcsSgCE86bbawcj;cbfaifglcGfaocwfaCfgCRbbaAcsGgAaAcsSgAE86bbalcVfaCaAfgARbbaoRbegCcl4gXaXcsSgXE86bbalc7faAaXfgARbbaCcsGgCaCcsSgCE86bbalctfaAaCfgARbbaoRbdgCcl4gXaXcsSgXE86bbalc91faAaXfgARbbaCcsGgCaCcsSgCE86bbalc4faAaCfgARbbaoRbigCcl4gXaXcsSgXE86bbalc93faAaXfgARbbaCcsGgCaCcsSgCE86bbalc94faAaCfgARbbaoRblgCcl4gXaXcsSgXE86bbalc95faAaXfgARbbaCcsGgCaCcsSgCE86bbalc96faAaCfgARbbaoRbvgCcl4gXaXcsSgXE86bbalc97faAaXfgARbbaCcsGgCaCcsSgCE86bbalc98faAaCfgARbbaoRbogCcl4gXaXcsSgXE86bbalc99faAaXfgARbbaCcsGgCaCcsSgCE86bbalc9:faAaCfgARbbaoRbrgocl4gCaCcsSgCE86bbalcufaAaCfglRbbaocsGgoaocsSgoE86bbalaofhoxekalao8Pbb83bbalcwfaocwf8Pbb83bbaoczfhokdnaiam9pmbaOcdfhOaiczfhlarao9RcL0mekkaiam6miaoTmidnakTmbawaPfRbbhOawcj;cbfhlazhiakhAinaialRbbgHce4cbaHceG9R7aOfgO86bbaiadfhialcefhlaAcufgAmbkkazcefhzaPcefgPad6hsaohHaPad9hmexvkkcbhoasceGmdxikaoaxad2fhXdnakTmbcbhmcehsawcjdfhCinarao9Rax6miaoTmdaoaxfhoawamfRbbhOawcj;cbfhlaChiakhAinaialRbbgHce4cbaHceG9R7aOfgO86bbaiadfhialcefhlaAcufgAmbkaCcefhCamcefgmad6hsamad9hmbkaXhoxikcbhlcehsinarao9Rax6mdaoTmeaoaxfhoalcefglad6hsadal9hmbkaXhoxdkcbhoasceGTmekc9:hoxikabaqad2fawcjdfakad2z1jjjb8Aawawcjdfakcufad2fadz1jjjb8Aakaqfhqaombkc9:hoxekcbc99arao9Radcaadca0ESEhokavcj;ebf8Kjjjjbaok;xzeHu8Jjjjjbc;ae9Rgv8Kjjjjbc9:hodnaeci9UgrcHfal0mbcuhoaiRbbgwc;WeGc;Ge9hmbawcsGgDce0mbavc;abfcFecjez:jjjjb8AavcUf9cu83ibavc8Wf9cu83ibavcyf9cu83ibavcaf9cu83ibavcKf9cu83ibavczf9cu83ibav9cu83iwav9cu83ibaialfc9WfhqaicefgwarfhodnaeTmbcmcsaDceSEhkcbhxcbhmcbhrcbhicbhlindnaoaq9nmbc9:hoxikdndnawRbbgDc;Ve0mbavc;abfalaDcu7gPcl4fcsGcitfgsydlhzasydbhHdnaDcsGgDak9pmbavaiaPfcsGcdtfydbaxaDEhsaDThDdndnadcd9hmbabarcetfgPaH87ebaPcdfaz87ebaPclfas87ebxekabarcdtfgPaHBdbaPclfazBdbaPcwfasBdbkaxaDfhxavc;abfalcitfgPasBdbaPazBdlavaicdtfasBdbavc;abfalcefcsGglcitfgPaHBdbaPasBdlaiaDfhialcefhlxdkdndnaDcsSmbamaDfaDc987fcefhmxekaocefhDao8SbbgscFeGhPdndnascu9mmbaDhoxekaocvfhoaPcFbGhPcrhsdninaD8SbbgOcFbGastaPVhPaOcu9kmeaDcefhDascrfgsc8J9hmbxdkkaDcefhokaPce4cbaPceG9R7amfhmkdndnadcd9hmbabarcetfgDaH87ebaDcdfaz87ebaDclfam87ebxekabarcdtfgDaHBdbaDclfazBdbaDcwfamBdbkavc;abfalcitfgDamBdbaDazBdlavaicdtfamBdbavc;abfalcefcsGglcitfgDaHBdbaDamBdlaicefhialcefhlxekdnaDcpe0mbaxcefgOavaiaqaDcsGfRbbgscl49RcsGcdtfydbascz6gPEhDavaias9RcsGcdtfydbaOaPfgzascsGgOEhsaOThOdndnadcd9hmbabarcetfgHax87ebaHcdfaD87ebaHclfas87ebxekabarcdtfgHaxBdbaHclfaDBdbaHcwfasBdbkavaicdtfaxBdbavc;abfalcitfgHaDBdbaHaxBdlavaicefgicsGcdtfaDBdbavc;abfalcefcsGcitfgHasBdbaHaDBdlavaiaPfcsGgicdtfasBdbavc;abfalcdfcsGglcitfgDaxBdbaDasBdlalcefhlaiaOfhiazaOfhxxekaxcbaoRbbgHEgAaDc;:eSgDfhzaHcsGhCaHcl4hXdndnaHcs0mbazcefhOxekazhOavaiaX9RcsGcdtfydbhzkdndnaCmbaOcefhxxekaOhxavaiaH9RcsGcdtfydbhOkdndnaDTmbaocefhDxekaocdfhDao8SbegPcFeGhsdnaPcu9kmbaocofhAascFbGhscrhodninaD8SbbgPcFbGaotasVhsaPcu9kmeaDcefhDaocrfgoc8J9hmbkaAhDxekaDcefhDkasce4cbasceG9R7amfgmhAkdndnaXcsSmbaDhsxekaDcefhsaD8SbbgocFeGhPdnaocu9kmbaDcvfhzaPcFbGhPcrhodninas8SbbgDcFbGaotaPVhPaDcu9kmeascefhsaocrfgoc8J9hmbkazhsxekascefhskaPce4cbaPceG9R7amfgmhzkdndnaCcsSmbashoxekascefhoas8SbbgDcFeGhPdnaDcu9kmbascvfhOaPcFbGhPcrhDdninao8SbbgscFbGaDtaPVhPascu9kmeaocefhoaDcrfgDc8J9hmbkaOhoxekaocefhokaPce4cbaPceG9R7amfgmhOkdndnadcd9hmbabarcetfgDaA87ebaDcdfaz87ebaDclfaO87ebxekabarcdtfgDaABdbaDclfazBdbaDcwfaOBdbkavc;abfalcitfgDazBdbaDaABdlavaicdtfaABdbavc;abfalcefcsGcitfgDaOBdbaDazBdlavaicefgicsGcdtfazBdbavc;abfalcdfcsGcitfgDaABdbaDaOBdlavaiaHcz6aXcsSVfgicsGcdtfaOBdbaiaCTaCcsSVfhialcifhlkawcefhwalcsGhlaicsGhiarcifgrae6mbkkcbc99aoaqSEhokavc;aef8Kjjjjbaok:flevu8Jjjjjbcz9Rhvc9:hodnaecvfal0mbcuhoaiRbbc;:eGc;qe9hmbav9cb83iwaicefhraialfc98fhwdnaeTmbdnadcdSmbcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcdtfaic8Etc8F91aicd47avcwfaiceGcdtVgoydbfglBdbaoalBdbaDcefgDae9hmbxdkkcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcetfaic8Etc8F91aicd47avcwfaiceGcdtVgoydbfgl87ebaoalBdbaDcefgDae9hmbkkcbc99arawSEhokaok:Lvoeue99dud99eud99dndnadcl9hmbaeTmeindndnabcdfgd8Sbb:Yab8Sbbgi:Ygl:l:tabcefgv8Sbbgo:Ygr:l:tgwJbb;:9cawawNJbbbbawawJbbbb9GgDEgq:mgkaqaicb9iEalMgwawNakaqaocb9iEarMgqaqNMM:r:vglNJbbbZJbbb:;aDEMgr:lJbbb9p9DTmbar:Ohixekcjjjj94hikadai86bbdndnaqalNJbbbZJbbb:;aqJbbbb9GEMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkavad86bbdndnawalNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohdxekcjjjj94hdkabad86bbabclfhbaecufgembxdkkaeTmbindndnabclfgd8Ueb:Yab8Uebgi:Ygl:l:tabcdfgv8Uebgo:Ygr:l:tgwJb;:FSawawNJbbbbawawJbbbb9GgDEgq:mgkaqaicb9iEalMgwawNakaqaocb9iEarMgqaqNMM:r:vglNJbbbZJbbb:;aDEMgr:lJbbb9p9DTmbar:Ohixekcjjjj94hikadai87ebdndnaqalNJbbbZJbbb:;aqJbbbb9GEMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkavad87ebdndnawalNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohdxekcjjjj94hdkabad87ebabcwfhbaecufgembkkk;siliui99iue99dnaeTmbcbhiabhlindndnJ;Zl81Zalcof8UebgvciV:Y:vgoal8Ueb:YNgrJb;:FSNJbbbZJbbb:;arJbbbb9GEMgw:lJbbb9p9DTmbaw:OhDxekcjjjj94hDkalclf8Uebhqalcdf8UebhkabaiavcefciGfcetfaD87ebdndnaoak:YNgwJb;:FSNJbbbZJbbb:;awJbbbb9GEMgx:lJbbb9p9DTmbax:Ohkxekcjjjj94hkkabaiavcdfciGfcetfak87ebdndnaoaq:YNgoJb;:FSNJbbbZJbbb:;aoJbbbb9GEMgx:lJbbb9p9DTmbax:Ohqxekcjjjj94hqkabaiavcufciGfcetfaq87ebdndnJbbjZararN:tawawN:taoaoN:tgrJbbbbarJbbbb9GE:rJb;:FSNJbbbZMgr:lJbbb9p9DTmbar:Ohqxekcjjjj94hqkabaiavciGfcetfaq87ebalcwfhlaiclfhiaecufgembkkk9mbdnadcd4ae2gdTmbinababydbgecwtcw91:Yaece91cjjj98Gcjjj;8if::NUdbabclfhbadcufgdmbkkk9teiucbcbydj1jjbgeabcifc98GfgbBdj1jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;LeeeudndnaeabVciGTmbabhixekdndnadcz9pmbabhixekabhiinaiaeydbBdbaiclfaeclfydbBdbaicwfaecwfydbBdbaicxfaecxfydbBdbaeczfheaiczfhiadc9Wfgdcs0mbkkadcl6mbinaiaeydbBdbaeclfheaiclfhiadc98fgdci0mbkkdnadTmbinaiaeRbb86bbaicefhiaecefheadcufgdmbkkabk;aeedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdbaicxfalBdbaicwfalBdbaiclfalBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabkkkebcjwklz9Kbb",r=WebAssembly.instantiate(o(n),{}).then(function(t){(e=t.instance).exports.__wasm_call_ctors()});function o(e){for(var t=new Uint8Array(e.length),n=0;n<e.length;++n){var r=e.charCodeAt(n);t[n]=r>96?r-97:r>64?r-39:r+4}for(var o=0,n=0;n<e.length;++n)t[o++]=t[n]<60?i[t[n]]:(t[n]-60)*64+t[++n];return t.buffer.slice(0,o)}function a(e,t,i,n,r,o,a){var s=e.exports.sbrk,l=n+3&-4,c=s(l*r),u=s(o.length),h=new Uint8Array(e.exports.memory.buffer);h.set(o,u);var d=t(c,n,r,u,o.length);if(0==d&&a&&a(c,l,r),i.set(h.subarray(c,c+n*r)),s(c-s(0)),0!=d)throw Error("Malformed buffer data: "+d)}var s={NONE:"",OCTAHEDRAL:"meshopt_decodeFilterOct",QUATERNION:"meshopt_decodeFilterQuat",EXPONENTIAL:"meshopt_decodeFilterExp"},l={ATTRIBUTES:"meshopt_decodeVertexBuffer",TRIANGLES:"meshopt_decodeIndexBuffer",INDICES:"meshopt_decodeIndexSequence"},c=[],u=0;function h(e){var t=e.data;if(!t.id)return self.close();self.ready.then(function(e){try{var i=new Uint8Array(t.count*t.size);a(e,e.exports[t.mode],i,t.count,t.size,t.source,e.exports[t.filter]),self.postMessage({id:t.id,count:t.count,action:"resolve",value:i},[i.buffer])}catch(e){self.postMessage({id:t.id,count:t.count,action:"reject",value:e})}})}return{ready:r,supported:!0,useWorkers:function(e){!function(e){for(var t=new Blob(["self.ready = WebAssembly.instantiate(new Uint8Array(["+new Uint8Array(o(n))+"]), {}).then(function(result) { result.instance.exports.__wasm_call_ctors(); return result.instance; });self.onmessage = "+h.name+";"+a.toString()+h.toString()],{type:"text/javascript"}),i=URL.createObjectURL(t),r=c.length;r<e;++r)c[r]=function(e){var t={object:new Worker(e),pending:0,requests:{}};return t.object.onmessage=function(e){var i=e.data;t.pending-=i.count,t.requests[i.id][i.action](i.value),delete t.requests[i.id]},t}(i);for(var r=e;r<c.length;++r)c[r].object.postMessage({});c.length=e,URL.revokeObjectURL(i)}(e)},decodeVertexBuffer:function(t,i,n,r,o){a(e,e.exports.meshopt_decodeVertexBuffer,t,i,n,r,e.exports[s[o]])},decodeIndexBuffer:function(t,i,n,r){a(e,e.exports.meshopt_decodeIndexBuffer,t,i,n,r)},decodeIndexSequence:function(t,i,n,r){a(e,e.exports.meshopt_decodeIndexSequence,t,i,n,r)},decodeGltfBuffer:function(t,i,n,r,o,c){a(e,e.exports[l[o]],t,i,n,r,e.exports[s[c]])},decodeGltfBufferAsync:function(t,i,n,o,h){return c.length>0?function(e,t,i,n,r){for(var o=c[0],a=1;a<c.length;++a)c[a].pending<o.pending&&(o=c[a]);return new Promise(function(a,s){var l=new Uint8Array(i),c=++u;o.pending+=e,o.requests[c]={resolve:a,reject:s},o.object.postMessage({id:c,count:e,size:t,source:l,mode:n,filter:r},[l.buffer])})}(t,i,n,l[o],s[h]):r.then(function(){var r=new Uint8Array(t*i);return a(e,e.exports[l[o]],r,t,i,n,e.exports[s[h]]),r})}}}();function hI(e){let t,i,n,r;let o=(e=(0,m.Z)(e,m.Z.EMPTY_OBJECT)).resourceCache,a=e.gltf,s=e.bufferViewId,l=e.gltfResource,c=e.baseResource,u=e.cacheKey;p.Z.typeOf.func("options.resourceCache",o),p.Z.typeOf.object("options.gltf",a),p.Z.typeOf.number("options.bufferViewId",s),p.Z.typeOf.object("options.gltfResource",l),p.Z.typeOf.object("options.baseResource",c);let h=a.bufferViews[s],d=h.buffer,f=h.byteOffset,_=h.byteLength,g=!1;if(hC(h,"EXT_meshopt_compression")){let e=h.extensions.EXT_meshopt_compression;d=e.buffer,f=(0,m.Z)(e.byteOffset,0),_=e.byteLength,g=!0,t=e.byteStride,i=e.count,n=e.mode,r=(0,m.Z)(e.filter,"NONE")}let Z=a.buffers[d];this._hasMeshopt=g,this._meshoptByteStride=t,this._meshoptCount=i,this._meshoptMode=n,this._meshoptFilter=r,this._resourceCache=o,this._gltfResource=l,this._baseResource=c,this._buffer=Z,this._bufferId=d,this._byteOffset=f,this._byteLength=_,this._cacheKey=u,this._bufferLoader=void 0,this._typedArray=void 0,this._state=hx.UNLOADED,this._promise=void 0}async function hO(e){try{let t=function(e){let t=e._resourceCache,i=e._buffer;if((0,_.Z)(i.uri)){let n=e._baseResource.getDerivedResource({url:i.uri});return t.getExternalBufferLoader({resource:n})}return t.getEmbeddedBufferLoader({parentResource:e._gltfResource,bufferId:e._bufferId})}(e);if(e._bufferLoader=t,await t.load(),e.isDestroyed())return;let i=t.typedArray,n=new Uint8Array(i.buffer,i.byteOffset+e._byteOffset,e._byteLength);if(e.unload(),e._typedArray=n,e._hasMeshopt){let t=e._meshoptCount,i=e._meshoptByteStride,n=new Uint8Array(t*i);hA.decodeGltfBuffer(n,t,i,e._typedArray,e._meshoptMode,e._meshoptFilter),e._typedArray=n}return e._state=hx.READY,e}catch(t){if(e.isDestroyed())return;throw e.unload(),e._state=hx.FAILED,e.getError("Failed to load buffer view",t)}}h=new Uint8Array([32,0,65,2,1,106,34,33,3,128,11,4,13,64,6,253,10,7,15,116,127,5,8,12,40,16,19,54,20,9,27,255,113,17,42,67,24,23,146,148,18,14,22,45,70,69,56,114,101,21,25,63,75,136,108,28,118,29,73,115]),"object"==typeof WebAssembly&&WebAssembly.instantiate(function(e){for(var t=new Uint8Array(e.length),i=0;i<e.length;++i){var n=e.charCodeAt(i);t[i]=n>96?n-97:n>64?n-39:n+4}for(var r=0,i=0;i<e.length;++i)t[r++]=t[i]<60?h[t[i]]:(t[i]-60)*64+t[++i];return t.buffer.slice(0,r)}("b9H79Tebbbe9Ek9Geueu9Geub9Gbb9GPuuuuuuuuuuu99uueu9Gvuuuuub9Gluuuub9Gquuuuuuu99uueu9Gwuuuuuu99ueu9Giuuue999Gluuuueu9GiuuueuizsdilvoirwDbqqbeqlve9Weiiviebeoweuec:G;jekr:Tewo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bbz9TW79O9V9Wt9F79P9T9W29P9M95bl8E9TW79O9V9Wt9F79P9T9W29P9M959x9Pt9OcttV9P9I91tW7bvQ9TW79O9V9Wt9F79P9T9W29P9M959q9V9P9Ut7boX9TW79O9V9Wt9F79P9T9W29P9M959t9J9H2Wbra9TW79O9V9Wt9F9V9Wt9P9T9P96W9wWVtW94SWt9J9O9sW9T9H9Wbwl79IV9RbDDwebcekdxmq::9Usdbk;i6iKuY99Ou8Jjjjjbc;W;ab9RgP8KjjjjbaPcwfcbc;Kbz:ljjjb8AaPcualcefgscdtascFFFFi0Ecbyd1:jjjbHjjjjbbgzBdwaPceBd9OaPazBdbaPcuadcitadcFFFFe0Ecbyd1:jjjbHjjjjbbgHBdxaPcdBd9OaPaHBdlaPaeadalcbz:cjjjbaPcualcdtgOalcFFFFi0EgAcbyd1:jjjbHjjjjbbgCBdzaPciBd9OaPaAcbyd1:jjjbHjjjjbbgXBdCaPclBd9Oalcd4alfhQcehLinaLgscethLasaQ6mbkcbhKaPcuascdtgLascFFFFi0Ecbyd1:jjjbHjjjjbbgQBdKaPcvBd9OaQcFeaLz:ljjjbhYdnalTmbavcd4h8AascufhEinaiaKa8A2cdtfg3ydlgscH4as7c:F:b:DD2a3ydbgscH4as7c;D;O:B8J27a3ydwgscH4as7c:3F;N8N27hQcbhsdndninaYaQaEGgQcdtfg5ydbgLcuSmeaiaLa8A2cdtfa3cxz:ojjjbTmdascefgsaQfhQasaE9nmbxdkka5aKBdbaKhLkaCaKcdtfaLBdbaKcefgKal9hmbkcbhsaXhLinaLasBdbaLclfhLalascefgs9hmbkcbhsaChLaXhQindnasaLydbgESmbaQaXaEcdtfgEydbBdbaEasBdbkaLclfhLaQclfhQalascefgs9hmbkkcbh8EaYcbyd:m:jjjbH:bjjjbbaPclBd9OaPalcbyd1:jjjbHjjjjbbgEBdKaPcvBd9OaPaAcbyd1:jjjbHjjjjbbgsBd3aPcoBd9OaPaAcbyd1:jjjbHjjjjbbgLBdaaPcrBd9OascFeaOz:ljjjbh8FaLcFeaOz:ljjjbhadnalTmbaHcwfhhindnaza8EgQcefg8Ecdtfydbg3azaQcdtgsfydbgLSmba3aL9RhOaHaLcitfhgaaasfh8Ja8FasfhKcbh8Aindndnaga8Acitfydbg5aQ9hmbaKaQBdba8JaQBdbxekdnaza5cdtg8KfgsclfydbgLasydbgsSmbaHascitg3fydbaQSmeaLas9Rh8Lascu7aLfhYaha3fhLcbhsinaYasSmeascefhsaLydbh3aLcwfhLa3aQ9hmbkasa8L6mekaaa8KfgsaQa5asydbcuSEBdbaKa5aQaKydbcuSEBdbka8Acefg8AaO9hmbkka8Eal9hmbkaChLaXhQaah3a8Fh8AcbhsindndnasaLydbg59hmbdnasaQydbg59hmba8Aydbh5dna3ydbgYcu9hmba5cu9hmbaEasfcb86bbxikaEasfhKdnasaYSmbasa5SmbaKce86bbxikaKcl86bbxdkdnasaXa5cdtgYfydb9hmbdna3ydbgKcuSmbasaKSmba8AydbgOcuSmbasaOSmbaaaYfydbggcuSmbaga5Smba8FaYfydbgYcuSmbaYa5SmbdnaCaKcdtfydbaCaYcdtfydb9hmbaCaOcdtfydbaCagcdtfydb9hmbaEasfcd86bbxlkaEasfcl86bbxikaEasfcl86bbxdkaEasfcl86bbxekaEasfaEa5fRbb86bbkaLclfhLaQclfhQa3clfh3a8Aclfh8Aalascefgs9hmbkaxceGTmbaEhsalhLindnasRbbce9hmbascl86bbkascefhsaLcufgLmbkkcualcx2alc;v:Q;v:Qe0Ecbyd1:jjjbHjjjjbbh8JaPcwfaPyd9Ogscdtfa8JBdbaPascefgOBd9Oa8Jaialavz:djjjbdndnaDmbcbhvxekcbh5aPcwfaOcdtfcuaDal2gLcdtaLcFFFFi0Ecbyd1:jjjbHjjjjbbgvBdbaPascdfgOBd9OalTmbarcd4cdthYaDcdthKavh8AinaohsawhLa8AhQaDh3inaQasIdbaLIdbNUdbasclfhsaLclfhLaQclfhQa3cufg3mbkaoaYfhoa8AaKfh8Aa5cefg5al9hmbkkaPcwfaOcdtfcualc8S2gsalc;D;O;f8U0EgQcbyd1:jjjbHjjjjbbgLBdbaPaOcefg3Bd9OaLcbasz:ljjjbh8EdndndnaDTmbaPcwfa3cdtfaQcbyd1:jjjbHjjjjbbgoBdbaPaOcdfgLBd9Oaocbasz:ljjjb8AaPcwfaLcdtfcuaDal2gscltgLascFFFFb0Ecbyd1:jjjbHjjjjbbgwBdbaPaOcifBd9OawcbaLz:ljjjb8AadmexdkcbhocbhwadTmekcbh8AaehLindna8JaLclfydbg5cx2fgsIdba8JaLydbgYcx2fgQIdbg8M:tg8Na8JaLcwfydbgKcx2fg3IdlaQIdlgy:tg8PNa3Idba8M:tgIasIdlay:tg8RN:tg8Sa8SNa8Ra3IdwaQIdwgR:tg8UNa8PasIdwaR:tg8RN:tg8Pa8PNa8RaINa8Ua8NN:tg8Na8NNMM:rgIJbbbb9ETmba8SaI:vh8Sa8NaI:vh8Na8PaI:vh8Pka8EaCaYcdtfydbc8S2fgsa8PaI:rgIa8PNNg8RasIdbMUdbasa8NaIa8NNg8VNg8UasIdlMUdlasa8SaIa8SNg8WNg8XasIdwMUdwasa8Va8PNg8VasIdxMUdxasa8Wa8PNg8YasIdzMUdzasa8Wa8NNg8WasIdCMUdCasa8PaIa8SaRNa8Pa8MNaya8NNMM:mgyNg8MNg8PasIdKMUdKasa8Na8MNg8NasId3MUd3asa8Sa8MNg8SasIdaMUdaasa8MayNg8MasId8KMUd8KasaIasIdyMUdya8EaCa5cdtfydbc8S2fgsa8RasIdbMUdbasa8UasIdlMUdlasa8XasIdwMUdwasa8VasIdxMUdxasa8YasIdzMUdzasa8WasIdCMUdCasa8PasIdKMUdKasa8NasId3MUd3asa8SasIdaMUdaasa8MasId8KMUd8KasaIasIdyMUdya8EaCaKcdtfydbc8S2fgsa8RasIdbMUdbasa8UasIdlMUdlasa8XasIdwMUdwasa8VasIdxMUdxasa8YasIdzMUdzasa8WasIdCMUdCasa8PasIdKMUdKasa8NasId3MUd3asa8SasIdaMUdaasa8MasId8KMUd8KasaIasIdyMUdyaLcxfhLa8Acifg8Aad6mbkcbh5aehYincbhLinaEaeaLc:G1jjbfydba5fcdtfydbgQfRbbhsdndnaEaYaLfydbg3fRbbg8Ac99fcFeGcpe0mbasceSmbascd9hmekdna8AcufcFeGce0mba8Fa3cdtfydbaQ9hmekdnascufcFeGce0mbaaaQcdtfydba39hmekdna8Acv2asfc:W1jjbfRbbTmbaCaQcdtfydbaCa3cdtfydb0mekJbbacJbbjZasceSEhIa8AceShOa8JaeaLc:K1jjbfydba5fcdtfydbcx2fhsdna8JaQcx2fg8AIdwa8Ja3cx2fgKIdwgy:tg8Pa8PNa8AIdbaKIdbgR:tg8Na8NNa8AIdlaKIdlg8R:tg8Sa8SNMM:rg8MJbbbb9ETmba8Pa8M:vh8Pa8Sa8M:vh8Sa8Na8M:vh8NkJbbacaIaOEh8WdnasIdway:tgIa8PaIa8PNasIdbaR:tg8Xa8NNa8SasIdla8R:tg8VNMMg8UN:tgIaINa8Xa8Na8UN:tg8Pa8PNa8Va8Sa8UN:tg8Na8NNMM:rg8SJbbbb9ETmbaIa8S:vhIa8Na8S:vh8Na8Pa8S:vh8Pka8EaCa3cdtfydbc8S2fgsa8Pa8Wa8MNg8Sa8PNNg8UasIdbMUdbasa8Na8Sa8NNg8WNg8XasIdlMUdlasaIa8SaINg8MNg8VasIdwMUdwasa8Wa8PNg8WasIdxMUdxasa8Ma8PNg8YasIdzMUdzasa8Ma8NNg8ZasIdCMUdCasa8Pa8SaIayNa8PaRNa8Ra8NNMM:mgyNg8MNg8PasIdKMUdKasa8Na8MNg8NasId3MUd3asaIa8MNgIasIdaMUdaasa8MayNg8MasId8KMUd8Kasa8SasIdyMUdya8EaCaQcdtfydbc8S2fgsa8UasIdbMUdbasa8XasIdlMUdlasa8VasIdwMUdwasa8WasIdxMUdxasa8YasIdzMUdzasa8ZasIdCMUdCasa8PasIdKMUdKasa8NasId3MUd3asaIasIdaMUdaasa8MasId8KMUd8Kasa8SasIdyMUdykaLclfgLcx9hmbkaYcxfhYa5cifg5ad6mbkaDTmbcbhYinJbbbbhRa8JaeaYcdtfgsclfydbgKcx2fgLIdwa8JasydbgOcx2fgQIdwg8V:tg8Na8NNaLIdbaQIdbg8Y:tgIaINaLIdlaQIdlg8Z:tg8Sa8SNMMg8Wa8Jascwfydbggcx2fgsIdwa8V:tg8MNa8Na8Na8MNaIasIdba8Y:tgyNa8SasIdla8Z:tg8RNMMg8PN:tJbbbbJbbjZa8Wa8Ma8MNayayNa8Ra8RNMMg8XNa8Pa8PN:tg8U:va8UJbbbb9BEg8UNh80a8Xa8NNa8Ma8PN:ta8UNh81a8Wa8RNa8Sa8PN:ta8UNhBa8Xa8SNa8Ra8PN:ta8UNh83a8WayNaIa8PN:ta8UNhUa8XaINaya8PN:ta8UNh85aIa8RNaya8SN:tg8Pa8PNa8Sa8MNa8Ra8NN:tg8Pa8PNa8NayNa8MaIN:tg8Pa8PNMM:r:rh8PavaOaD2cdtfhLavagaD2cdtfhQavaKaD2cdtfh3a8V:mh86a8Z:mh87a8Y:mh88cbh8AaDh5Jbbbbh8RJbbbbh8UJbbbbh8WJbbbbh8XJbbbbh8VJbbbbh8YJbbbbh8ZJbbbbh89Jbbbbh8:inaPc;Wbfa8Afgscwfa8Pa81a3IdbaLIdbg8M:tg8SNa80aQIdba8M:tgyNMg8NNUdbasclfa8Pa83a8SNaBayNMgINUdbasa8Pa85a8SNaUayNMg8SNUdbascxfa8Pa86a8NNa87aINa8Ma88a8SNMMMg8MNUdba8Pa8NaINNa8XMh8Xa8Pa8Na8SNNa8VMh8Va8PaIa8SNNa8YMh8Ya8Pa8Ma8MNNaRMhRa8Pa8Na8MNNa8RMh8Ra8PaIa8MNNa8UMh8Ua8Pa8Sa8MNNa8WMh8Wa8Pa8Na8NNNa8ZMh8Za8PaIaINNa89Mh89a8Pa8Sa8SNNa8:Mh8:aLclfhLa3clfh3aQclfhQa8Aczfh8Aa5cufg5mbkaoaCaOcdtfydbgLc8S2fgsa8:asIdbMUdbasa89asIdlMUdlasa8ZasIdwMUdwasa8YasIdxMUdxasa8VasIdzMUdzasa8XasIdCMUdCasa8WasIdKMUdKasa8UasId3MUd3asa8RasIdaMUdaasaRasId8KMUd8Kasa8PasIdyMUdyaoaCaKcdtfydbgKc8S2fgsa8:asIdbMUdbasa89asIdlMUdlasa8ZasIdwMUdwasa8YasIdxMUdxasa8VasIdzMUdzasa8XasIdCMUdCasa8WasIdKMUdKasa8UasId3MUd3asa8RasIdaMUdaasaRasId8KMUd8Kasa8PasIdyMUdyaoaCagcdtfydbgOc8S2fgsa8:asIdbMUdbasa89asIdlMUdlasa8ZasIdwMUdwasa8YasIdxMUdxasa8VasIdzMUdzasa8XasIdCMUdCasa8WasIdKMUdKasa8UasId3MUd3asa8RasIdaMUdaasaRasId8KMUd8Kasa8PasIdyMUdyawaLaD2cltfh5cbhLaDh3ina5aLfgsaPc;WbfaLfgQIdbasIdbMUdbasclfg8AaQclfIdba8AIdbMUdbascwfg8AaQcwfIdba8AIdbMUdbascxfgsaQcxfIdbasIdbMUdbaLczfhLa3cufg3mbkawaKaD2cltfh5cbhLaDh3ina5aLfgsaPc;WbfaLfgQIdbasIdbMUdbasclfg8AaQclfIdba8AIdbMUdbascwfg8AaQcwfIdba8AIdbMUdbascxfgsaQcxfIdbasIdbMUdbaLczfhLa3cufg3mbkawaOaD2cltfh5cbhLaDh3ina5aLfgsaPc;WbfaLfgQIdbasIdbMUdbasclfg8AaQclfIdba8AIdbMUdbascwfg8AaQcwfIdba8AIdbMUdbascxfgsaQcxfIdbasIdbMUdbaLczfhLa3cufg3mbkaYcifgYad6mbkkdnabaeSmbabaeadcdtz:kjjjb8AkaPydbhZcbhsdnalTmbaZclfhsaZydbh3aEhLalh8AcbhQincbasydbg5a39RaLRbbcpeGEaQfhQaLcefhLasclfhsa5h3a8Acufg8AmbkaQce4hskcuadas9Rcifgrcx2arc;v:Q;v:Qe0Ecbyd1:jjjbHjjjjbbh8LaPcwfaPyd9Ogscdtfa8LBdbaPascefgLBd9OaPcwfaLcdtfcuarcdtarcFFFFi0Ecbyd1:jjjbHjjjjbbgxBdbaPascdfgLBd9OaPcwfaLcdtfaAcbyd1:jjjbHjjjjbbgHBdbaPascifgLBd9OaPcwfaLcdtfalcbyd1:jjjbHjjjjbbgnBdbaPasclfBd9OJbbbbh8Ydnadaq9nmbdnarci6mbakakNh8VaDclthca8Lcwfh9cJbbbbh8YinaPabadghalaCz:cjjjbabhOcbhzcbhKincbhsindnaCaOasfydbgQcdtgYfydbg8AaCabasc;m1jjbfydbaKfcdtfydbgLcdtfydbg5SmbaEaLfRbbgecv2aEaQfRbbg3fc;G1jjbfRbbg8Ka3cv2aefggc;G1jjbfRbbgiVcFeGTmbdnagc:W1jjbfRbbTmba5a8A0mekdna3ae9hmba3cufcFeGce0mba8FaYfydbaL9hmeka8Lazcx2fg3aLaQaicFeGg8AEBdla3aQaLa8AEBdba3a8Aa8KGcb9hBdwazcefhzkasclfgscx9hmbkdnaKcifgKah9pmbaOcxfhOazcifar9nmekkdnazmbahhdxikcbheinJbbbbJbbjZa8EaCa8Laecx2fg3ydlg8Aa3ydbg5a3ydwgLEgKcdtfydbg8Kc8S2gifgsIdyg8P:va8PJbbbb9BEasIdwa8Ja5a8AaLEgYcx2fgLIdwg8SNasIdzaLIdbg8MNasIdaMg8Pa8PMMa8SNasIdlaLIdlgyNasIdCa8SNasId3Mg8Pa8PMMayNasIdba8MNasIdxayNasIdKMg8Pa8PMMa8MNasId8KMMM:lNh8WJbbbbJbbjZa8EaCa5cdtfydbgdc8S2gQfgsIdyg8P:va8PJbbbb9BEasIdwa8Ja8Acx2fgLIdwgINasIdzaLIdbgRNasIdaMg8Pa8PMMaINasIdlaLIdlg8RNasIdCaINasId3Mg8Pa8PMMa8RNasIdbaRNasIdxa8RNasIdKMg8Pa8PMMaRNasId8KMMM:lNh8Xa3cwfhOa3clfhgdnaDTmbaoaQfgQIdwaINaQIdzaRNaQIdaMg8Pa8PMMaINaQIdla8RNaQIdCaINaQId3Mg8Pa8PMMa8RNaQIdbaRNaQIdxa8RNaQIdKMg8Pa8PMMaRNaQId8KMMMh8Nava8AaD2cdtfhLawadaD2cltfhsaQIdyh8UaDhQinaLIdbg8PJbbb;aNascxfIdbaIascwfIdbNaRasIdbNa8RasclfIdbNMMMNa8Pa8PNa8UNa8NMMh8NaLclfhLasczfhsaQcufgQmbkaoaifgQIdwa8SNaQIdza8MNaQIdaMg8Pa8PMMa8SNaQIdlayNaQIdCa8SNaQId3Mg8Pa8PMMayNaQIdba8MNaQIdxayNaQIdKMg8Pa8PMMa8MNaQId8KMMMhIavaYaD2cdtfhLawa8KaD2cltfhsaQIdyhRaDhQinaLIdbg8PJbbb;aNascxfIdba8SascwfIdbNa8MasIdbNayasclfIdbNMMMNa8Pa8PNaRNaIMMhIaLclfhLasczfhsaQcufgQmbka8WaI:lMh8Wa8Xa8N:lMh8Xkaga8AaYa8Xa8W9FgsEBdba3a5aKasEBdbaOa8Xa8WasEUdbaecefgeaz9hmbkaPc;Wbfcbcj;abz:ljjjb8Aa9chsazhLinaPc;WbfasydbcO4c;8ZGfgQaQydbcefBdbascxfhsaLcufgLmbkcbhscbhLinaPc;WbfasfgQydbh3aQaLBdba3aLfhLasclfgscj;ab9hmbkcbhsa9chLinaPc;WbfaLydbcO4c;8ZGfgQaQydbgQcefBdbaxaQcdtfasBdbaLcxfhLazascefgs9hmbkahaq9RgQci9UhJdnalTmbcbhsaHhLinaLasBdbaLclfhLalascefgs9hmbkkcbh9eancbalz:ljjjbhTaQcO9UhSaJce4h9haPydlh9icbhicbhgdnina8Laxagcdtfydbcx2fgOIdwg8Na8V9EmeaiaJ9pmeJFFuuh8Pdna9haz9pmba8Laxa9hcdtfydbcx2fIdwJbb;aZNh8Pkdna8Na8P9ETmbaiaS0mdkdnaTaCaOydlg6cdtg9kfydbg3fg0RbbaTaCaOydbgKcdtg9mfydbg9nfg9oRbbVmbdnaZa9ncdtfgsclfydbgLasydbgsSmbaLas9Rh5a9iascitfhsa8Ja3cx2fgYcwfhdaYclfhAa8Ja9ncx2fg8Kcwfh9pa8Kclfh9qcbhLcehednindnaHasydbcdtfydbgQa3SmbaHasclfydbcdtfydbg8Aa3SmbaQa8ASmba8Ja8Acx2fg8AIdba8JaQcx2fgQIdbgI:tg8Pa9qIdbaQIdlg8S:tg8MNa8KIdbaI:tgya8AIdla8S:tg8NN:ta8PaAIdba8S:tgRNaYIdbaI:tg8Ra8NN:tNa8Na9pIdbaQIdwg8S:tg8UNa8Ma8AIdwa8S:tgIN:ta8NadIdba8S:tg8SNaRaIN:tNaIayNa8Ua8PN:taIa8RNa8Sa8PN:tNMMJbbbb9FmdkascwfhsaLcefgLa56hea5aL9hmbkkaeceGTmba9hcefh9hxeka8Ea3c8S2gQfgsa8Ea9nc8S2g8AfgLIdbasIdbMUdbasaLIdlasIdlMUdlasaLIdwasIdwMUdwasaLIdxasIdxMUdxasaLIdzasIdzMUdzasaLIdCasIdCMUdCasaLIdKasIdKMUdKasaLId3asId3MUd3asaLIdaasIdaMUdaasaLId8KasId8KMUd8KasaLIdyasIdyMUdydnaDTmbaoaQfgsaoa8AfgLIdbasIdbMUdbasaLIdlasIdlMUdlasaLIdwasIdwMUdwasaLIdxasIdxMUdxasaLIdzasIdzMUdzasaLIdCasIdCMUdCasaLIdKasIdKMUdKasaLId3asId3MUd3asaLIdaasIdaMUdaasaLId8KasId8KMUd8KasaLIdyasIdyMUdyaca9n2heaca32hYawhLaDh8AinaLaYfgsaLaefgQIdbasIdbMUdbasclfg5aQclfIdba5IdbMUdbascwfg5aQcwfIdba5IdbMUdbascxfgsaQcxfIdbasIdbMUdbaLczfhLa8Acufg8AmbkkaOcwfhLdndndndnaEaKfgQRbbc9:fPdebdkaKhsinaHascdtgsfa3BdbaXasfydbgsaK9hmbxikkaXa9kfydbhsaXa9mfydbhKaHa9mfa6Bdbash6kaHaKcdtfa6Bdbka9oce86bba0ce86bbaLIdbg8Pa8Ya8Ya8P9DEh8Ya9ecefh9ececdaQRbbceSEaifhikagcefggaz9hmbkkdna9embahhdxikdnalTmbcbhLa8FhsindnasydbgQcuSmbdnaLaHaQcdtg3fydbgQ9hmba8Fa3fydbhQkasaQBdbkasclfhsalaLcefgL9hmbkcbhLaahsindnasydbgQcuSmbdnaLaHaQcdtg3fydbgQ9hmbaaa3fydbhQkasaQBdbkasclfhsalaLcefgL9hmbkkcbhdabhscbh8AindnaHasydbcdtfydbgLaHasclfydbcdtfydbgQSmbaLaHascwfydbcdtfydbg3SmbaQa3Smbabadcdtfg5aLBdba5clfaQBdba5cwfa3Bdbadcifhdkascxfhsa8Acifg8Aah6mbkadaq9nmdxbkkaPabadalaCz:cjjjbkdnamTmbama8Y:rUdbkaPyd9OgscdtaPcwffc98fhCdninasTmeaCydbcbyd:m:jjjbH:bjjjbbaCc98fhCascufhsxbkkaPc;W;abf8Kjjjjbadk;:ieouabydlhvabydbclfcbaicdtz:ljjjbhoadci9UhrdnadTmbdnalTmbaehwadhDinaoalawydbcdtfydbcdtfgqaqydbcefBdbawclfhwaDcufgDmbxdkkaehwadhDinaoawydbcdtfgqaqydbcefBdbawclfhwaDcufgDmbkkdnaiTmbcbhDaohwinawydbhqawaDBdbawclfhwaqaDfhDaicufgimbkkdnadci6mbarcearce0EhdinaecwfydbhwaeclfydbhDaeydbhidnalTmbalawcdtfydbhwalaDcdtfydbhDalaicdtfydbhikavaoaicdtfgqydbcitfaDBdbavaqydbcitfawBdlaqaqydbcefBdbavaoaDcdtfgqydbcitfawBdbavaqydbcitfaiBdlaqaqydbcefBdbavaoawcdtfgwydbcitfaiBdbavawydbcitfaDBdlawawydbcefBdbaecxfheadcufgdmbkkabydbcbBdbk:Zldouv998Jjjjjbca9Rglczfcwfcbyd11jjbBdbalcb8Pdj1jjb83izalcwfcbydN1jjbBdbalcb8Pd:m1jjb83ibdnadTmbaicd4hvdnabTmbavcdthocbhraehwinabarcx2fgiaearav2cdtfgDIdbUdbaiaDIdlUdlaiaDIdwUdwcbhiinalczfaifgDawaifIdbgqaDIdbgkakaq9EEUdbalaifgDaqaDIdbgkakaq9DEUdbaiclfgicx9hmbkawaofhwarcefgrad9hmbxdkkavcdthrcbhwincbhiinalczfaifgDaeaifIdbgqaDIdbgkakaq9EEUdbalaifgDaqaDIdbgkakaq9DEUdbaiclfgicx9hmbkaearfheawcefgwad9hmbkkdnabTmbadTmbJbbbbJbbjZalIdbalIdzgk:tJbbbb:xgqalIdlalIdCgx:tgmamaq9DEgqalIdwalIdKgm:tgPaPaq9DEgq:vaqJbbbb9BEhqinabaqabIdbak:tNUdbabclfgiaqaiIdbax:tNUdbabcwfgiaqaiIdbam:tNUdbabcxfhbadcufgdmbkkk8KbabaeadaialavcbcbcbcbaoarawaDz:bjjjbk8KbabaeadaialavaoarawaDaqakaxamz:bjjjbk;lOowud99wue99iul998Jjjjjbc;Wb9Rgw8KjjjjbdndnarmbcbhDxekawcwfcbc;Kbz:ljjjb8Aawcuadcx2adc;v:Q;v:Qe0Ecbyd1:jjjbHjjjjbbgqBdwawceBd9Oaqaeadaiz:djjjbawcuadcdtadcFFFFi0Egkcbyd1:jjjbHjjjjbbgxBdxawcdBd9Oadcd4adfhmceheinaegicetheaiam6mbkcbhmawcuaicdtgPaicFFFFi0Ecbyd1:jjjbHjjjjbbgsBdzawciBd9Odndnar:Zgz:rJbbbZMgH:lJbbb9p9DTmbaH:Ohexekcjjjj94hekaicufhOc:bwhAcbhCcbhXadhQinaChLaeaAgKcufaeaK9iEamgDcefaeaD9kEhYdndnadTmbaYcuf:YhHaqhiaxheadhmindndnaiIdbaHNJbbbZMg8A:lJbbb9p9DTmba8A:OhAxekcjjjj94hAkaAcCthAdndnaiclfIdbaHNJbbbZMg8A:lJbbb9p9DTmba8A:OhCxekcjjjj94hCkaCcqtaAVhAdndnaicwfIdbaHNJbbbZMg8A:lJbbb9p9DTmba8A:OhCxekcjjjj94hCkaeaAaCVBdbaicxfhiaeclfheamcufgmmbkascFeaPz:ljjjbhEcbh3cbh5indnaEaxa5cdtfydbgAcm4aA7c:v;t;h;Ev2gics4ai7aOGgmcdtfgCydbgecuSmbaeaASmbcehiinaEamaifaOGgmcdtfgCydbgecuSmeaicefhiaeaA9hmbkkaCaABdba3aecuSfh3a5cefg5ad9hmbxdkkascFeaPz:ljjjb8Acbh3kaDaYa3ar0giEhmaLa3aiEhCdna3arSmbaYaKaiEgAam9Rcd9imbdndnaXcl0mbdnaQ:ZgHaL:Zg8A:taY:Yg8EaD:Y:tg8Fa8EaK:Y:tgaa3:Zghaz:tNNNaHaz:taaNa8Aah:tNa8Aaz:ta8FNahaH:tNM:va8EMJbbbZMgH:lJbbb9p9DTmbaH:Ohexdkcjjjj94hexekamaAfcd9Theka3aQaiEhQaXcefgXcs9hmekkdndnaCmbcihicbhDxekcbhiawakcbyd1:jjjbHjjjjbbg5BdCawclBd9OdndnadTmbamcuf:YhHaqhiaxheadhmindndnaiIdbaHNJbbbZMg8A:lJbbb9p9DTmba8A:OhAxekcjjjj94hAkaAcCthAdndnaiclfIdbaHNJbbbZMg8A:lJbbb9p9DTmba8A:OhCxekcjjjj94hCkaCcqtaAVhAdndnaicwfIdbaHNJbbbZMg8A:lJbbb9p9DTmba8A:OhCxekcjjjj94hCkaeaAaCVBdbaicxfhiaeclfheamcufgmmbkascFeaPz:ljjjbhEcbhDcbh3inaxa3cdtgYfydbgAcm4aA7c:v;t;h;Ev2gics4ai7hecbhidndninaEaeaOGgmcdtfgCydbgecuSmednaxaecdtgCfydbaASmbaicefgiamfheaiaO9nmekka5aCfydbhixekaCa3BdbaDhiaDcefhDka5aYfaiBdba3cefg3ad9hmbkcuaDc32giaDc;j:KM;jb0EhexekascFeaPz:ljjjb8AcbhDcbhekawaecbyd1:jjjbHjjjjbbgeBdKawcvBd9Oaecbaiz:ljjjbhOavcd4hxdnadTmbaxcdth3a5hmalhAaqheadhEinaOamydbc32fgiaeIdbaiIdbMUdbaiaeclfIdbaiIdlMUdlaiaecwfIdbaiIdwMUdwaiaAc;81jjbalEgCIdbaiIdxMUdxaiaCIdlaiIdzMUdzaiaCIdwaiIdCMUdCaiaiIdKJbbjZMUdKamclfhmaAa3fhAaecxfheaEcufgEmbkkdnaDTmbaOcxfhiaDheinaictfgmamIdbJbbbbJbbjZaicxfIdbgH:vaHJbbbb9BEgHNUdbaic94fgmaHamIdbNUdbaic98fgmaHamIdbNUdbaiaHaiIdbNUdbaiclfgmaHamIdbNUdbaicwfgmaHamIdbNUdbaic3fhiaecufgembkkcbhAawcuaDcdtgYaDcFFFFi0Egicbyd1:jjjbHjjjjbbgeBd3awcoBd9Oawaicbyd1:jjjbHjjjjbbgEBdaaecFeaYz:ljjjbh3dnadTmbaoaoNh8Aaxcdthxalheina8Aaec;81jjbalEgmIdwaOa5ydbgCc32fgiIdC:tgHaHNamIdbaiIdx:tgHaHNamIdlaiIdz:tgHaHNMMNaqcwfIdbaiIdw:tgHaHNaqIdbaiIdb:tgHaHNaqclfIdbaiIdl:tgHaHNMMMhHdndna3aCcdtgifgmydbcuSmbaEaifIdbaH9ETmekamaABdbaEaifaHUdbka5clfh5aeaxfheaqcxfhqadaAcefgA9hmbkkaba3aYz:kjjjb8AcrhikaicdthiinaiTmeaic98fgiawcwffydbcbyd:m:jjjbH:bjjjbbxbkkawc;Wbf8KjjjjbaDk:Qdidui99ducbhi8Jjjjjbca9Rglczfcwfcbyd11jjbBdbalcb8Pdj1jjb83izalcwfcbydN1jjbBdbalcb8Pd:m1jjb83ibdndnaembJbbjFhvJbbjFhoJbbjFhrxekadcd4cdthwincbhdinalczfadfgDabadfIdbgoaDIdbgrarao9EEUdbaladfgDaoaDIdbgrarao9DEUdbadclfgdcx9hmbkabawfhbaicefgiae9hmbkalIdwalIdK:thralIdlalIdC:thoalIdbalIdz:thvkavJbbbb:xgvaoaoav9DEgoararao9DEk9DeeuabcFeaicdtz:ljjjbhlcbhbdnadTmbindnalaeydbcdtfgiydbcu9hmbaiabBdbabcefhbkaeclfheadcufgdmbkkabk9teiucbcbyd:q:jjjbgeabcifc98GfgbBd:q:jjjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;LeeeudndnaeabVciGTmbabhixekdndnadcz9pmbabhixekabhiinaiaeydbBdbaiclfaeclfydbBdbaicwfaecwfydbBdbaicxfaecxfydbBdbaeczfheaiczfhiadc9Wfgdcs0mbkkadcl6mbinaiaeydbBdbaeclfheaiclfhiadc98fgdci0mbkkdnadTmbinaiaeRbb86bbaicefhiaecefheadcufgdmbkkabk;aeedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdbaicxfalBdbaicwfalBdbaiclfalBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabk9teiucbcbyd:q:jjjbgeabcrfc94GfgbBd:q:jjjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik9:eiuZbhedndncbyd:q:jjjbgdaecztgi9nmbcuheadai9RcFFifcz4nbcuSmekadhekcbabae9Rcifc98Gcbyd:q:jjjbfgdBd:q:jjjbdnadZbcztge9nmbadae9RcFFifcz4nb8Akk6eiucbhidnadTmbdninabRbbglaeRbbgv9hmeaecefheabcefhbadcufgdmbxdkkalav9Rhikaikk:Iedbcjwk1eFFuuFFuuFFuuFFuFFFuFFFuFbbbbbbbbebbbdbbbbbbbebbbeeebeebebbeeebebbbbbebebbbbbebbbdbbbbbbbbbbbbbbbeeeeebebbbbbebbbbbeebbbbbbbbbbbbbbbbbbbbbc1Dkxebbbdbbb:G9Kbb"),{}).then(function(e){(0,e.instance).exports.__wasm_call_ctors()}),(0,_.Z)(Object.create)&&(hI.prototype=Object.create(hE.prototype),hI.prototype.constructor=hI),Object.defineProperties(hI.prototype,{cacheKey:{get:function(){return this._cacheKey}},typedArray:{get:function(){return this._typedArray}}}),hI.prototype.load=async function(){return(0,_.Z)(this._promise)||(this._state=hx.LOADING,this._promise=hO(this)),this._promise},hI.prototype.unload=function(){(0,_.Z)(this._bufferLoader)&&!this._bufferLoader.isDestroyed()&&this._resourceCache.unload(this._bufferLoader),this._bufferLoader=void 0,this._typedArray=void 0};var hD=i(1250);function hP(){}function hR(e){let t=(e=(0,m.Z)(e,m.Z.EMPTY_OBJECT)).resourceCache,i=e.gltf,n=e.draco,r=e.gltfResource,o=e.baseResource,a=e.cacheKey;p.Z.typeOf.func("options.resourceCache",t),p.Z.typeOf.object("options.gltf",i),p.Z.typeOf.object("options.draco",n),p.Z.typeOf.object("options.gltfResource",r),p.Z.typeOf.object("options.baseResource",o),this._resourceCache=t,this._gltfResource=r,this._baseResource=o,this._gltf=i,this._draco=n,this._cacheKey=a,this._bufferViewLoader=void 0,this._bufferViewTypedArray=void 0,this._decodePromise=void 0,this._decodedData=void 0,this._state=hx.UNLOADED,this._promise=void 0,this._dracoError=void 0}async function hN(e){let t=e._resourceCache;try{let i=t.getBufferViewLoader({gltf:e._gltf,bufferViewId:e._draco.bufferView,gltfResource:e._gltfResource,baseResource:e._baseResource});if(e._bufferViewLoader=i,await i.load(),e.isDestroyed())return;return e._bufferViewTypedArray=i.typedArray,e._state=hx.PROCESSING,e}catch(t){if(e.isDestroyed())return;hL(e,t)}}function hL(e,t){throw e.unload(),e._state=hx.FAILED,e.getError("Failed to load Draco",t)}async function hM(e,t){try{let i=await t;if(e.isDestroyed())return;return e.unload(),e._decodedData={indices:i.indexArray,vertexAttributes:i.attributeData},e._state=hx.READY,e._baseResource}catch(t){if(e.isDestroyed())return;e._dracoError=t}}hP._maxDecodingConcurrency=Math.max(uP.Z.hardwareConcurrency-1,1),hP._decoderTaskProcessor=void 0,hP._taskProcessorReady=!1,hP._error=void 0,hP._getDecoderTaskProcessor=function(){if(!(0,_.Z)(hP._decoderTaskProcessor)){let e=new hD.Z("decodeDraco",hP._maxDecodingConcurrency);e.initWebAssemblyModule({wasmBinaryFile:"ThirdParty/draco_decoder.wasm"}).then(function(e){e?hP._taskProcessorReady=!0:hP._error=new e3.Z("Draco decoder could not be initialized.")}).catch(e=>{hP._error=e}),hP._decoderTaskProcessor=e}return hP._decoderTaskProcessor},hP.decodePointCloud=function(e){let t=hP._getDecoderTaskProcessor();if((0,_.Z)(hP._error))throw hP._error;if(hP._taskProcessorReady)return t.scheduleTask(e,[e.buffer.buffer])},hP.decodeBufferView=function(e){let t=hP._getDecoderTaskProcessor();if((0,_.Z)(hP._error))throw hP._error;if(hP._taskProcessorReady)return t.scheduleTask(e,[e.array.buffer])},(0,_.Z)(Object.create)&&(hR.prototype=Object.create(hE.prototype),hR.prototype.constructor=hR),Object.defineProperties(hR.prototype,{cacheKey:{get:function(){return this._cacheKey}},decodedData:{get:function(){return this._decodedData}}}),hR.prototype.load=async function(){return(0,_.Z)(this._promise)||(this._state=hx.LOADING,this._promise=hN(this)),this._promise},hR.prototype.process=function(e){if(p.Z.typeOf.object("frameState",e),this._state===hx.READY)return!0;if(this._state!==hx.PROCESSING||((0,_.Z)(this._dracoError)&&hL(this,this._dracoError),!(0,_.Z)(this._bufferViewTypedArray)||(0,_.Z)(this._decodePromise)))return!1;let t=this._draco,i=this._gltf.bufferViews[t.bufferView],n=t.attributes,r={array:new Uint8Array(this._bufferViewTypedArray),bufferView:i,compressedAttributes:n,dequantizeInShader:!0},o=hP.decodeBufferView(r);if(!(0,_.Z)(o))return!1;this._decodePromise=hM(this,o)},hR.prototype.unload=function(){(0,_.Z)(this._bufferViewLoader)&&this._resourceCache.unload(this._bufferViewLoader),this._bufferViewLoader=void 0,this._bufferViewTypedArray=void 0,this._decodedData=void 0,this._gltf=void 0};var hF=i(4705);function hz(e){let t=(e=(0,m.Z)(e,m.Z.EMPTY_OBJECT)).resourceCache,i=e.gltf,n=e.imageId,r=e.gltfResource,o=e.baseResource,a=e.cacheKey;p.Z.typeOf.func("options.resourceCache",t),p.Z.typeOf.object("options.gltf",i),p.Z.typeOf.number("options.imageId",n),p.Z.typeOf.object("options.gltfResource",r),p.Z.typeOf.object("options.baseResource",o);let s=i.images[n],l=s.bufferView,c=s.uri;this._resourceCache=t,this._gltfResource=r,this._baseResource=o,this._gltf=i,this._bufferViewId=l,this._uri=c,this._cacheKey=a,this._bufferViewLoader=void 0,this._image=void 0,this._mipLevels=void 0,this._state=hx.UNLOADED,this._promise=void 0}function hB(e){let t;return Array.isArray(e)&&(t=e.slice(1,e.length).map(function(e){return e.bufferView}),e=e[0]),{image:e,mipLevels:t}}async function hU(e){e._state=hx.LOADING;let t=e._resourceCache;try{let i=t.getBufferViewLoader({gltf:e._gltf,bufferViewId:e._bufferViewId,gltfResource:e._gltfResource,baseResource:e._baseResource});if(e._bufferViewLoader=i,await i.load(),e.isDestroyed())return;let n=i.typedArray,r=await hH(n);if(e.isDestroyed())return;let o=hB(r);return e.unload(),e._image=o.image,e._mipLevels=o.mipLevels,e._state=hx.READY,e}catch(t){if(e.isDestroyed())return;return hV(e,t,"Failed to load embedded image")}}async function hk(e){e._state=hx.LOADING;let t=e._baseResource,i=e._uri,n=t.getDerivedResource({url:i});try{let t=await function(e){let t=e.getUrlComponent(!1,!0);return hG.test(t)?(0,hF.Z)(e):e.fetchImage({skipColorSpaceConversion:!0,preferImageBitmap:!0})}(n);if(e.isDestroyed())return;let i=hB(t);return e.unload(),e._image=i.image,e._mipLevels=i.mipLevels,e._state=hx.READY,e}catch(t){if(e.isDestroyed())return;return hV(e,t,`Failed to load image: ${i}`)}}function hV(e,t,i){return e.unload(),e._state=hx.FAILED,Promise.reject(e.getError(i,t))}async function hH(e){let t=function(e){let t=e.subarray(0,2),i=e.subarray(0,4),n=e.subarray(8,12);if(255===t[0]&&216===t[1])return"image/jpeg";if(137===t[0]&&80===t[1])return"image/png";if(171===t[0]&&75===t[1])return"image/ktx2";if(82===i[0]&&73===i[1]&&70===i[2]&&70===i[3]&&87===n[0]&&69===n[1]&&66===n[2]&&80===n[3])return"image/webp";throw new e3.Z("Image format is not recognized")}(e);if("image/ktx2"===t){let t=new Uint8Array(e);return(0,hF.Z)(t)}return hz._loadImageFromTypedArray({uint8Array:e,format:t,flipY:!1,skipColorSpaceConversion:!0})}(0,_.Z)(Object.create)&&(hz.prototype=Object.create(hE.prototype),hz.prototype.constructor=hz),Object.defineProperties(hz.prototype,{cacheKey:{get:function(){return this._cacheKey}},image:{get:function(){return this._image}},mipLevels:{get:function(){return this._mipLevels}}}),hz.prototype.load=function(){return(0,_.Z)(this._promise)||((0,_.Z)(this._bufferViewId)?this._promise=hU(this):this._promise=hk(this)),this._promise};let hG=/(^data:image\/ktx2)|(\.ktx2$)/i;hz.prototype.unload=function(){(0,_.Z)(this._bufferViewLoader)&&!this._bufferViewLoader.isDestroyed()&&this._resourceCache.unload(this._bufferViewLoader),this._bufferViewLoader=void 0,this._uri=void 0,this._image=void 0,this._mipLevels=void 0,this._gltf=void 0},hz._loadImageFromTypedArray=function(e){let t;let i=e.uint8Array,n=e.format,r=e.request,o=(0,m.Z)(e.flipY,!1),a=(0,m.Z)(e.skipColorSpaceConversion,!1);p.Z.typeOf.object("uint8Array",i),p.Z.typeOf.string("format",n);let s=new Blob([i],{type:n});return ec.Z.supportsImageBitmapOptions().then(function(e){return e?Promise.resolve(ec.Z.createImageBitmapFromBlob(s,{flipY:o,premultiplyAlpha:!1,skipColorSpaceConversion:a})):(t=window.URL.createObjectURL(s),new ec.Z({url:t,request:r}).fetchImage({flipY:o,skipColorSpaceConversion:a}))}).then(function(e){return(0,_.Z)(t)&&window.URL.revokeObjectURL(t),e}).catch(function(e){return(0,_.Z)(t)&&window.URL.revokeObjectURL(t),Promise.reject(e)})};var hj=i(3580),hW=i(3447);function hq(e){let t=(e=(0,m.Z)(e,m.Z.EMPTY_OBJECT)).resourceCache,i=e.gltf,n=e.accessorId,r=e.gltfResource,o=e.baseResource,a=e.draco,s=e.cacheKey,l=(0,m.Z)(e.asynchronous,!0),c=(0,m.Z)(e.loadBuffer,!1),u=(0,m.Z)(e.loadTypedArray,!1);if(p.Z.typeOf.func("options.resourceCache",t),p.Z.typeOf.object("options.gltf",i),p.Z.typeOf.number("options.accessorId",n),p.Z.typeOf.object("options.gltfResource",r),p.Z.typeOf.object("options.baseResource",o),!c&&!u)throw new A.Z("At least one of loadBuffer and loadTypedArray must be true.");let h=i.accessors[n].componentType;this._resourceCache=t,this._gltfResource=r,this._baseResource=o,this._gltf=i,this._accessorId=n,this._indexDatatype=h,this._draco=a,this._cacheKey=s,this._asynchronous=l,this._loadBuffer=c,this._loadTypedArray=u,this._bufferViewLoader=void 0,this._dracoLoader=void 0,this._typedArray=void 0,this._buffer=void 0,this._state=hx.UNLOADED,this._promise=void 0}(0,_.Z)(Object.create)&&(hq.prototype=Object.create(hE.prototype),hq.prototype.constructor=hq),Object.defineProperties(hq.prototype,{cacheKey:{get:function(){return this._cacheKey}},buffer:{get:function(){return this._buffer}},typedArray:{get:function(){return this._typedArray}},indexDatatype:{get:function(){return this._indexDatatype}}});let hY=new hQ;async function hX(e){e._state=hx.LOADING;let t=e._resourceCache;try{let i=t.getDracoLoader({gltf:e._gltf,draco:e._draco,gltfResource:e._gltfResource,baseResource:e._baseResource});if(e._dracoLoader=i,await i.load(),e.isDestroyed())return;return e._state=hx.LOADED,e}catch(t){if(e.isDestroyed())return;hK(e,t)}}async function h$(e){let t=e._gltf,i=e._accessorId,n=t.accessors[i].bufferView;e._state=hx.LOADING;let r=e._resourceCache;try{let i=r.getBufferViewLoader({gltf:t,bufferViewId:n,gltfResource:e._gltfResource,baseResource:e._baseResource});if(e._bufferViewLoader=i,await i.load(),e.isDestroyed())return;let o=i.typedArray;return e._typedArray=function(e,t){let i;let n=e._gltf,r=e._accessorId,o=n.accessors[r],a=o.count,s=o.componentType,l=ez.Z.getSizeInBytes(s),c=t.buffer,u=t.byteOffset+o.byteOffset;if(u%l!=0){let e=new Uint8Array(c,u,a*l);c=new Uint8Array(e).buffer,u=0,(0,hj.Z)("index-buffer-unaligned",`The index array is not aligned to a ${l}-byte boundary.`)}return s===ez.Z.UNSIGNED_BYTE?i=new Uint8Array(c,u,a):s===ez.Z.UNSIGNED_SHORT?i=new Uint16Array(c,u,a):s===ez.Z.UNSIGNED_INT&&(i=new Uint32Array(c,u,a)),i}(e,o),e._state=hx.PROCESSING,e}catch(t){if(e.isDestroyed())return;hK(e,t)}}function hK(e,t){throw e.unload(),e._state=hx.FAILED,e.getError("Failed to load index buffer",t)}function hQ(){this.typedArray=void 0,this.indexDatatype=void 0,this.context=void 0,this.buffer=void 0}function hJ(e,t,i){let n=ek.Z.createIndexBuffer({typedArray:e,context:i,usage:eV.Z.STATIC_DRAW,indexDatatype:t});return n.vertexArrayDestroyable=!1,n}hq.prototype.load=async function(){return(0,_.Z)(this._promise)||((0,_.Z)(this._draco)?this._promise=hX(this):this._promise=h$(this)),this._promise},hQ.prototype.set=function(e,t,i){this.typedArray=e,this.indexDatatype=t,this.context=i},hQ.prototype.execute=function(){this.buffer=hJ(this.typedArray,this.indexDatatype,this.context)},hq.prototype.process=function(e){let t;if(p.Z.typeOf.object("frameState",e),this._state===hx.READY)return!0;if(this._state!==hx.LOADED&&this._state!==hx.PROCESSING)return!1;let i=this._typedArray,n=this._indexDatatype;if((0,_.Z)(this._dracoLoader))try{this._dracoLoader.process(e)&&(i=this._dracoLoader.decodedData.indices.typedArray,this._typedArray=i,n=eM.Z.fromTypedArray(i),this._indexDatatype=n)}catch(e){hK(this,e)}if(!(0,_.Z)(i))return!1;if(this._loadBuffer&&this._asynchronous){if(hY.set(i,n,e.context),!e.jobScheduler.execute(hY,hW.Z.BUFFER))return!1;t=hY.buffer}else this._loadBuffer&&(t=hJ(i,n,e.context));return this.unload(),this._buffer=t,this._typedArray=this._loadTypedArray?i:void 0,this._state=hx.READY,this._resourceCache.statistics.addGeometryLoader(this),!0},hq.prototype.unload=function(){(0,_.Z)(this._buffer)&&this._buffer.destroy();let e=this._resourceCache;(0,_.Z)(this._bufferViewLoader)&&!this._bufferViewLoader.isDestroyed()&&e.unload(this._bufferViewLoader),(0,_.Z)(this._dracoLoader)&&e.unload(this._dracoLoader),this._bufferViewLoader=void 0,this._dracoLoader=void 0,this._typedArray=void 0,this._buffer=void 0,this._gltf=void 0};var h0=function(e,t,i){return JSON.parse(hr(e,t,i))},h1=function(e,t){return hr(e,t=(0,m.Z)(t,0),Math.min(4,e.length))},h2=i(2963),h3=function(e,t,i){if(i=(0,m.Z)(i,!1)){let i=e.indexOf(t);if(i>-1)return i}return e.push(t),e.length-1},h4=function(e,t){return(0,_.Z)(e.extensionsUsed)&&e.extensionsUsed.indexOf(t)>=0};function h5(){}function h9(e){(0,_.Z)(e)&&(e.texCoord=(0,m.Z)(e.texCoord,0))}h5.objectLegacy=function(e,t){if((0,_.Z)(e)){for(let i in e)if(Object.prototype.hasOwnProperty.call(e,i)){let n=t(e[i],i);if((0,_.Z)(n))return n}}},h5.object=function(e,t){if((0,_.Z)(e)){let i=e.length;for(let n=0;n<i;n++){let i=t(e[n],n);if((0,_.Z)(i))return i}}},h5.topLevel=function(e,t,i){let n=e[t];return(0,_.Z)(n)&&!Array.isArray(n)?h5.objectLegacy(n,i):h5.object(n,i)},h5.accessor=function(e,t){return h5.topLevel(e,"accessors",t)},h5.accessorWithSemantic=function(e,t,i){let n={};return h5.mesh(e,function(e){return h5.meshPrimitive(e,function(e){let r=h5.meshPrimitiveAttribute(e,function(e,r){if(0===r.indexOf(t)&&!(0,_.Z)(n[e])){n[e]=!0;let t=i(e);if((0,_.Z)(t))return t}});return(0,_.Z)(r)?r:h5.meshPrimitiveTarget(e,function(e){return h5.meshPrimitiveTargetAttribute(e,function(e,r){if(0===r.indexOf(t)&&!(0,_.Z)(n[e])){n[e]=!0;let t=i(e);if((0,_.Z)(t))return t}})})})})},h5.accessorContainingVertexAttributeData=function(e,t){let i={};return h5.mesh(e,function(e){return h5.meshPrimitive(e,function(e){let n=h5.meshPrimitiveAttribute(e,function(e){if(!(0,_.Z)(i[e])){i[e]=!0;let n=t(e);if((0,_.Z)(n))return n}});return(0,_.Z)(n)?n:h5.meshPrimitiveTarget(e,function(e){return h5.meshPrimitiveTargetAttribute(e,function(e){if(!(0,_.Z)(i[e])){i[e]=!0;let n=t(e);if((0,_.Z)(n))return n}})})})})},h5.accessorContainingIndexData=function(e,t){let i={};return h5.mesh(e,function(e){return h5.meshPrimitive(e,function(e){let n=e.indices;if((0,_.Z)(n)&&!(0,_.Z)(i[n])){i[n]=!0;let e=t(n);if((0,_.Z)(e))return e}})})},h5.animation=function(e,t){return h5.topLevel(e,"animations",t)},h5.animationChannel=function(e,t){let i=e.channels;return h5.object(i,t)},h5.animationSampler=function(e,t){let i=e.samplers;return h5.object(i,t)},h5.buffer=function(e,t){return h5.topLevel(e,"buffers",t)},h5.bufferView=function(e,t){return h5.topLevel(e,"bufferViews",t)},h5.camera=function(e,t){return h5.topLevel(e,"cameras",t)},h5.image=function(e,t){return h5.topLevel(e,"images",t)},h5.material=function(e,t){return h5.topLevel(e,"materials",t)},h5.materialValue=function(e,t){let i=e.values;for(let n in(0,_.Z)(e.extensions)&&(0,_.Z)(e.extensions.KHR_techniques_webgl)&&(i=e.extensions.KHR_techniques_webgl.values),i)if(Object.prototype.hasOwnProperty.call(i,n)){let e=t(i[n],n);if((0,_.Z)(e))return e}},h5.mesh=function(e,t){return h5.topLevel(e,"meshes",t)},h5.meshPrimitive=function(e,t){let i=e.primitives;if((0,_.Z)(i)){let e=i.length;for(let n=0;n<e;n++){let e=t(i[n],n);if((0,_.Z)(e))return e}}},h5.meshPrimitiveAttribute=function(e,t){let i=e.attributes;for(let e in i)if(Object.prototype.hasOwnProperty.call(i,e)){let n=t(i[e],e);if((0,_.Z)(n))return n}},h5.meshPrimitiveTarget=function(e,t){let i=e.targets;if((0,_.Z)(i)){let e=i.length;for(let n=0;n<e;++n){let e=t(i[n],n);if((0,_.Z)(e))return e}}},h5.meshPrimitiveTargetAttribute=function(e,t){for(let i in e)if(Object.prototype.hasOwnProperty.call(e,i)){let n=t(e[i],i);if((0,_.Z)(n))return n}},h5.node=function(e,t){return h5.topLevel(e,"nodes",t)},h5.nodeInTree=function(e,t,i){let n=e.nodes;if((0,_.Z)(n)){let r=t.length;for(let o=0;o<r;o++){let r=t[o],a=n[r];if((0,_.Z)(a)){let t=i(a,r);if((0,_.Z)(t))return t;let n=a.children;if((0,_.Z)(n)&&(t=h5.nodeInTree(e,n,i),(0,_.Z)(t)))return t}}}},h5.nodeInScene=function(e,t,i){let n=t.nodes;if((0,_.Z)(n))return h5.nodeInTree(e,n,i)},h5.program=function(e,t){return h4(e,"KHR_techniques_webgl")?h5.object(e.extensions.KHR_techniques_webgl.programs,t):h5.topLevel(e,"programs",t)},h5.sampler=function(e,t){return h5.topLevel(e,"samplers",t)},h5.scene=function(e,t){return h5.topLevel(e,"scenes",t)},h5.shader=function(e,t){return h4(e,"KHR_techniques_webgl")?h5.object(e.extensions.KHR_techniques_webgl.shaders,t):h5.topLevel(e,"shaders",t)},h5.skin=function(e,t){return h5.topLevel(e,"skins",t)},h5.skinJoint=function(e,t){let i=e.joints;if((0,_.Z)(i)){let e=i.length;for(let n=0;n<e;n++){let e=t(i[n]);if((0,_.Z)(e))return e}}},h5.techniqueAttribute=function(e,t){let i=e.attributes;for(let e in i)if(Object.prototype.hasOwnProperty.call(i,e)){let n=t(i[e],e);if((0,_.Z)(n))return n}},h5.techniqueUniform=function(e,t){let i=e.uniforms;for(let e in i)if(Object.prototype.hasOwnProperty.call(i,e)){let n=t(i[e],e);if((0,_.Z)(n))return n}},h5.techniqueParameter=function(e,t){let i=e.parameters;for(let e in i)if(Object.prototype.hasOwnProperty.call(i,e)){let n=t(i[e],e);if((0,_.Z)(n))return n}},h5.technique=function(e,t){return h4(e,"KHR_techniques_webgl")?h5.object(e.extensions.KHR_techniques_webgl.techniques,t):h5.topLevel(e,"techniques",t)},h5.texture=function(e,t){return h5.topLevel(e,"textures",t)};var h8=function(e){h5.accessor(e,function(e){(0,_.Z)(e.bufferView)&&(e.byteOffset=(0,m.Z)(e.byteOffset,0))}),h5.bufferView(e,function(e){(0,_.Z)(e.buffer)&&(e.byteOffset=(0,m.Z)(e.byteOffset,0))}),h5.mesh(e,function(t){h5.meshPrimitive(t,function(t){t.mode=(0,m.Z)(t.mode,eU.Z.TRIANGLES),(0,_.Z)(t.material)||((0,_.Z)(e.materials)||(e.materials=[]),t.material=h3(e.materials,{name:"default"}))})}),h5.accessorContainingVertexAttributeData(e,function(t){let i=e.accessors[t],n=i.bufferView;if(i.normalized=(0,m.Z)(i.normalized,!1),(0,_.Z)(n)){let t=e.bufferViews[n];t.byteStride=uM(e,i),t.target=eU.Z.ARRAY_BUFFER}}),h5.accessorContainingIndexData(e,function(t){let i=e.accessors[t].bufferView;(0,_.Z)(i)&&(e.bufferViews[i].target=eU.Z.ELEMENT_ARRAY_BUFFER)}),h5.material(e,function(e){let t=(0,m.Z)(e.extensions,m.Z.EMPTY_OBJECT),i=t.KHR_materials_common;if((0,_.Z)(i)){let e=i.technique,t=(0,_.Z)(i.values)?i.values:{};i.values=t,t.ambient=(0,_.Z)(t.ambient)?t.ambient:[0,0,0,1],t.emission=(0,_.Z)(t.emission)?t.emission:[0,0,0,1],t.transparency=(0,m.Z)(t.transparency,1),"CONSTANT"!==e&&(t.diffuse=(0,_.Z)(t.diffuse)?t.diffuse:[0,0,0,1],"LAMBERT"!==e&&(t.specular=(0,_.Z)(t.specular)?t.specular:[0,0,0,1],t.shininess=(0,m.Z)(t.shininess,0))),i.transparent=(0,m.Z)(i.transparent,!1),i.doubleSided=(0,m.Z)(i.doubleSided,!1);return}e.emissiveFactor=(0,m.Z)(e.emissiveFactor,[0,0,0]),e.alphaMode=(0,m.Z)(e.alphaMode,"OPAQUE"),e.doubleSided=(0,m.Z)(e.doubleSided,!1),"MASK"===e.alphaMode&&(e.alphaCutoff=(0,m.Z)(e.alphaCutoff,.5));let n=t.KHR_techniques_webgl;(0,_.Z)(n)&&h5.materialValue(e,function(e){(0,_.Z)(e.index)&&h9(e)}),h9(e.emissiveTexture),h9(e.normalTexture),h9(e.occlusionTexture);let r=e.pbrMetallicRoughness;(0,_.Z)(r)&&(r.baseColorFactor=(0,m.Z)(r.baseColorFactor,[1,1,1,1]),r.metallicFactor=(0,m.Z)(r.metallicFactor,1),r.roughnessFactor=(0,m.Z)(r.roughnessFactor,1),h9(r.baseColorTexture),h9(r.metallicRoughnessTexture));let o=t.KHR_materials_pbrSpecularGlossiness;(0,_.Z)(o)&&(o.diffuseFactor=(0,m.Z)(o.diffuseFactor,[1,1,1,1]),o.specularFactor=(0,m.Z)(o.specularFactor,[1,1,1]),o.glossinessFactor=(0,m.Z)(o.glossinessFactor,1),h9(o.specularGlossinessTexture))}),h5.animation(e,function(e){h5.animationSampler(e,function(e){e.interpolation=(0,m.Z)(e.interpolation,"LINEAR")})});let t=function(e){let t={};return h5.animation(e,function(e){h5.animationChannel(e,function(e){let i=e.target,n=i.node,r=i.path;("translation"===r||"rotation"===r||"scale"===r)&&(t[n]=!0)})}),t}(e);return h5.node(e,function(e,i){(0,_.Z)(t[i])||(0,_.Z)(e.translation)||(0,_.Z)(e.rotation)||(0,_.Z)(e.scale)?(e.translation=(0,m.Z)(e.translation,[0,0,0]),e.rotation=(0,m.Z)(e.rotation,[0,0,0,1]),e.scale=(0,m.Z)(e.scale,[1,1,1])):e.matrix=(0,m.Z)(e.matrix,[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])}),h5.sampler(e,function(e){e.wrapS=(0,m.Z)(e.wrapS,eU.Z.REPEAT),e.wrapT=(0,m.Z)(e.wrapT,eU.Z.REPEAT)}),(0,_.Z)(e.scenes)&&!(0,_.Z)(e.scene)&&(e.scene=0),e};function h6(e){e.extras=(0,_.Z)(e.extras)?e.extras:{},e.extras._pipeline=(0,_.Z)(e.extras._pipeline)?e.extras._pipeline:{}}var h7=function(e){return h5.shader(e,function(e){h6(e)}),h5.buffer(e,function(e){h6(e)}),h5.image(e,function(e){h6(e)}),h6(e),e},de=function(e,t){let i=e.extensionsRequired;if((0,_.Z)(i)){let n=i.indexOf(t);n>=0&&i.splice(n,1),0===i.length&&delete e.extensionsRequired}},dt=function(e,t){let i=e.extensionsUsed;if((0,_.Z)(i)){let n=i.indexOf(t);n>=0&&i.splice(n,1),de(e,t),0===i.length&&delete e.extensionsUsed}};function di(e,t,i){let n=new DataView(e.buffer),r=Array(i);for(let o=0;o<i;++o)r[o]=n.getUint32(e.byteOffset+t+4*o,!0);return r}var dn=function(e){if("glTF"!==h1(e))throw new e3.Z("File is not valid binary glTF");let t=di(e,0,5),i=t[1];if(1!==i&&2!==i)throw new e3.Z("Binary glTF version is not 1 or 2");return 1===i?function(e,t){let i=t[2],n=t[3];if(0!==t[4])throw new e3.Z("Binary glTF scene format is not JSON");let r=JSON.parse(hr(e,20,n));h7(r);let o=e.subarray(20+n,i),a=r.buffers;if((0,_.Z)(a)&&Object.keys(a).length>0){let e=(0,m.Z)(a.binary_glTF,a.KHR_binary_glTF);(0,_.Z)(e)&&(e.extras._pipeline.source=o,delete e.uri)}return dt(r,"KHR_binary_glTF"),r}(e,t):function(e,t){let i,n;let r=t[2],o=12;for(;o<r;){let t=di(e,o,2),r=t[0],a=t[1];o+=8;let s=e.subarray(o,o+r);o+=r,1313821514===a?h7(i=JSON.parse(hr(s))):5130562===a&&(n=s)}if((0,_.Z)(i)&&(0,_.Z)(n)){let e=i.buffers;(0,_.Z)(e)&&e.length>0&&(e[0].extras._pipeline.source=n)}return i}(e,t)};function dr(e){(0,_.Z)(e.extras)&&((0,_.Z)(e.extras._pipeline)&&delete e.extras._pipeline,0===Object.keys(e.extras).length&&delete e.extras)}var da=function(e,t){let i=e.extensionsUsed;(0,_.Z)(i)||(i=[],e.extensionsUsed=i),h3(i,t,!0)},ds=function(e,t){let i=e.bufferViews,n=e.buffers,r=t.bufferView,o=uL(t.type);if(!(0,_.Z)(t.bufferView))return{min:Array(o).fill(0),max:Array(o).fill(0)};let a=Array(o).fill(Number.POSITIVE_INFINITY),s=Array(o).fill(Number.NEGATIVE_INFINITY),l=i[r],c=n[l.buffer].extras._pipeline.source,u=t.count,h=uM(e,t),d=t.byteOffset+l.byteOffset+c.byteOffset,f=t.componentType,p=eM.Z.getSizeInBytes(f),m=new DataView(c.buffer),g=Array(o),Z=uF(f);for(let e=0;e<u;e++){Z(m,d,o,p,g);for(let e=0;e<o;e++){let t=g[e];a[e]=Math.min(a[e],t),s[e]=Math.max(s[e],t)}d+=h}return{min:a,max:s}};let dl=[eU.Z.FUNC_ADD,eU.Z.FUNC_ADD],dc=[eU.Z.ONE,eU.Z.ZERO,eU.Z.ONE,eU.Z.ZERO];function du(e,t){let i=e.enable;return!!(0,_.Z)(i)&&i.indexOf(t)>-1}let dh=[eU.Z.ZERO,eU.Z.ONE,eU.Z.SRC_COLOR,eU.Z.ONE_MINUS_SRC_COLOR,eU.Z.SRC_ALPHA,eU.Z.ONE_MINUS_SRC_ALPHA,eU.Z.DST_ALPHA,eU.Z.ONE_MINUS_DST_ALPHA,eU.Z.DST_COLOR,eU.Z.ONE_MINUS_DST_COLOR];var dd=function(e){let t={},i={},n=e.techniques;return(0,_.Z)(n)&&(h5.technique(e,function(e,n){let r=e.states;if((0,_.Z)(r)){let o=i[n]={};if(du(r,eU.Z.BLEND)){o.alphaMode="BLEND";let e=r.functions;(0,_.Z)(e)&&((0,_.Z)(e.blendEquationSeparate)||(0,_.Z)(e.blendFuncSeparate))&&(t[n]={blendEquation:(0,m.Z)(e.blendEquationSeparate,dl),blendFactors:function(e,t){if(!(0,_.Z)(e))return t;for(let i=0;i<4;i++)if(-1===dh.indexOf(e[i]))return t;return e}(e.blendFuncSeparate,dc)})}du(r,eU.Z.CULL_FACE)||(o.doubleSided=!0),delete e.states}}),Object.keys(t).length>0&&((0,_.Z)(e.extensions)||(e.extensions={}),da(e,"KHR_blend")),h5.material(e,function(e){if((0,_.Z)(e.technique)){let n=i[e.technique];h5.objectLegacy(n,function(t,i){e[i]=t});let r=t[e.technique];(0,_.Z)(r)&&((0,_.Z)(e.extensions)||(e.extensions={}),e.extensions.KHR_blend=r)}})),e},df=function(e,t){let i=e.extensionsRequired;(0,_.Z)(i)||(i=[],e.extensionsRequired=i),h3(i,t,!0),da(e,t)},dp=function(e){let t=e.techniques,i={},n={},r={};if((0,_.Z)(t)){let t={programs:[],shaders:[],techniques:[]},o=e.glExtensionsUsed;delete e.glExtensionsUsed,h5.technique(e,function(a,s){let l;let c={name:a.name,program:void 0,attributes:{},uniforms:{}};if(h5.techniqueAttribute(a,function(e,t){l=a.parameters[e],c.attributes[t]={semantic:l.semantic}}),h5.techniqueUniform(a,function(e,t){l=a.parameters[e],c.uniforms[t]={count:l.count,node:l.node,type:l.type,semantic:l.semantic,value:l.value},(0,_.Z)(i[s])||(i[s]={}),i[s][e]=t}),(0,_.Z)(r[a.program]))c.program=r[a.program];else{let i=e.programs[a.program],n={name:i.name,fragmentShader:void 0,vertexShader:void 0,glExtensions:o},s=e.shaders[i.fragmentShader];n.fragmentShader=h3(t.shaders,s,!0);let l=e.shaders[i.vertexShader];n.vertexShader=h3(t.shaders,l,!0),c.program=h3(t.programs,n),r[a.program]=c.program}n[s]=h3(t.techniques,c)}),t.techniques.length>0&&((0,_.Z)(e.extensions)||(e.extensions={}),e.extensions.KHR_techniques_webgl=t,da(e,"KHR_techniques_webgl"),df(e,"KHR_techniques_webgl"))}return h5.material(e,function(e){if((0,_.Z)(e.technique)){let t={technique:n[e.technique]};h5.objectLegacy(e.values,function(n,r){(0,_.Z)(t.values)||(t.values={});let o=i[e.technique][r];(0,_.Z)(o)&&(t.values[o]=n)}),(0,_.Z)(e.extensions)||(e.extensions={}),e.extensions.KHR_techniques_webgl=t}delete e.technique,delete e.values}),delete e.techniques,delete e.programs,delete e.shaders,e},dm=function(e,t){p.Z.typeOf.object("material",e),p.Z.defined("handler",t);let i=e.pbrMetallicRoughness;if((0,_.Z)(i)){if((0,_.Z)(i.baseColorTexture)){let e=i.baseColorTexture,n=t(e.index,e);if((0,_.Z)(n))return n}if((0,_.Z)(i.metallicRoughnessTexture)){let e=i.metallicRoughnessTexture,n=t(e.index,e);if((0,_.Z)(n))return n}}let{extensions:n}=e;if((0,_.Z)(n)){let e=n.KHR_materials_pbrSpecularGlossiness;if((0,_.Z)(e)){if((0,_.Z)(e.diffuseTexture)){let i=e.diffuseTexture,n=t(i.index,i);if((0,_.Z)(n))return n}if((0,_.Z)(e.specularGlossinessTexture)){let i=e.specularGlossinessTexture,n=t(i.index,i);if((0,_.Z)(n))return n}}let i=n.KHR_materials_specular;if((0,_.Z)(i)){let{specularTexture:e,specularColorTexture:n}=i;if((0,_.Z)(e)){let i=t(e.index,e);if((0,_.Z)(i))return i}if((0,_.Z)(n)){let e=t(n.index,n);if((0,_.Z)(e))return e}}let r=n.KHR_materials_common;if((0,_.Z)(r)&&(0,_.Z)(r.values)){let{diffuse:e,ambient:i,emission:n,specular:o}=r.values;if((0,_.Z)(e)&&(0,_.Z)(e.index)){let i=t(e.index,e);if((0,_.Z)(i))return i}if((0,_.Z)(i)&&(0,_.Z)(i.index)){let e=t(i.index,i);if((0,_.Z)(e))return e}if((0,_.Z)(n)&&(0,_.Z)(n.index)){let e=t(n.index,n);if((0,_.Z)(e))return e}if((0,_.Z)(o)&&(0,_.Z)(o.index)){let e=t(o.index,o);if((0,_.Z)(e))return e}}}let r=h5.materialValue(e,function(e){if((0,_.Z)(e.index)){let i=t(e.index,e);if((0,_.Z)(i))return i}});if((0,_.Z)(r))return r;if((0,_.Z)(e.emissiveTexture)){let i=e.emissiveTexture,n=t(i.index,i);if((0,_.Z)(n))return n}if((0,_.Z)(e.normalTexture)){let i=e.normalTexture,n=t(i.index,i);if((0,_.Z)(n))return n}if((0,_.Z)(e.occlusionTexture)){let i=e.occlusionTexture,n=t(i.index,i);if((0,_.Z)(n))return n}};let d_=["mesh","node","material","accessor","bufferView","buffer","texture","sampler","image"],dg={accessor:"accessors",buffer:"buffers",bufferView:"bufferViews",image:"images",node:"nodes",material:"materials",mesh:"meshes",sampler:"samplers",texture:"textures"};function dZ(){}function dy(){}dZ.accessor=function(e,t){e.accessors.splice(t,1),h5.mesh(e,function(e){h5.meshPrimitive(e,function(e){h5.meshPrimitiveAttribute(e,function(i,n){i>t&&e.attributes[n]--}),h5.meshPrimitiveTarget(e,function(e){h5.meshPrimitiveTargetAttribute(e,function(i,n){i>t&&e[n]--})});let i=e.indices;(0,_.Z)(i)&&i>t&&e.indices--;let n=e.extensions;(0,_.Z)(n)&&(0,_.Z)(n.CESIUM_primitive_outline)&&n.CESIUM_primitive_outline.indices>t&&--n.CESIUM_primitive_outline.indices})}),h5.skin(e,function(e){(0,_.Z)(e.inverseBindMatrices)&&e.inverseBindMatrices>t&&e.inverseBindMatrices--}),h5.animation(e,function(e){h5.animationSampler(e,function(e){(0,_.Z)(e.input)&&e.input>t&&e.input--,(0,_.Z)(e.output)&&e.output>t&&e.output--})})},dZ.buffer=function(e,t){e.buffers.splice(t,1),h5.bufferView(e,function(e){(0,_.Z)(e.buffer)&&e.buffer>t&&e.buffer--,(0,_.Z)(e.extensions)&&(0,_.Z)(e.extensions.EXT_meshopt_compression)&&e.extensions.EXT_meshopt_compression.buffer--})},dZ.bufferView=function(e,t){if(e.bufferViews.splice(t,1),h5.accessor(e,function(e){(0,_.Z)(e.bufferView)&&e.bufferView>t&&e.bufferView--}),h5.shader(e,function(e){(0,_.Z)(e.bufferView)&&e.bufferView>t&&e.bufferView--}),h5.image(e,function(e){(0,_.Z)(e.bufferView)&&e.bufferView>t&&e.bufferView--}),h4(e,"KHR_draco_mesh_compression")&&h5.mesh(e,function(e){h5.meshPrimitive(e,function(e){(0,_.Z)(e.extensions)&&(0,_.Z)(e.extensions.KHR_draco_mesh_compression)&&e.extensions.KHR_draco_mesh_compression.bufferView>t&&e.extensions.KHR_draco_mesh_compression.bufferView--})}),h4(e,"EXT_feature_metadata")){let i=e.extensions.EXT_feature_metadata.featureTables;for(let e in i)if(i.hasOwnProperty(e)){let n=i[e].properties;if((0,_.Z)(n)){for(let e in n)if(n.hasOwnProperty(e)){let i=n[e];(0,_.Z)(i.bufferView)&&i.bufferView>t&&i.bufferView--,(0,_.Z)(i.arrayOffsetBufferView)&&i.arrayOffsetBufferView>t&&i.arrayOffsetBufferView--,(0,_.Z)(i.stringOffsetBufferView)&&i.stringOffsetBufferView>t&&i.stringOffsetBufferView--}}}}if(h4(e,"EXT_structural_metadata")){let i=e.extensions.EXT_structural_metadata.propertyTables;if((0,_.Z)(i)){let e=i.length;for(let n=0;n<e;++n){let e=i[n].properties;for(let i in e)if(e.hasOwnProperty(i)){let n=e[i];(0,_.Z)(n.values)&&n.values>t&&n.values--,(0,_.Z)(n.arrayOffsets)&&n.arrayOffsets>t&&n.arrayOffsets--,(0,_.Z)(n.stringOffsets)&&n.stringOffsets>t&&n.stringOffsets--}}}}},dZ.image=function(e,t){e.images.splice(t,1),h5.texture(e,function(e){(0,_.Z)(e.source)&&e.source>t&&--e.source;let i=e.extensions;(0,_.Z)(i)&&(0,_.Z)(i.EXT_texture_webp)&&i.EXT_texture_webp.source>t?--e.extensions.EXT_texture_webp.source:(0,_.Z)(i)&&(0,_.Z)(i.KHR_texture_basisu)&&i.KHR_texture_basisu.source>t&&--e.extensions.KHR_texture_basisu.source})},dZ.mesh=function(e,t){e.meshes.splice(t,1),h5.node(e,function(e){(0,_.Z)(e.mesh)&&(e.mesh>t?e.mesh--:e.mesh===t&&delete e.mesh)})},dZ.node=function(e,t){e.nodes.splice(t,1),h5.skin(e,function(e){(0,_.Z)(e.skeleton)&&e.skeleton>t&&e.skeleton--,e.joints=e.joints.map(function(e){return e>t?e-1:e})}),h5.animation(e,function(e){h5.animationChannel(e,function(e){(0,_.Z)(e.target)&&(0,_.Z)(e.target.node)&&e.target.node>t&&e.target.node--})}),h5.technique(e,function(e){h5.techniqueUniform(e,function(e){(0,_.Z)(e.node)&&e.node>t&&e.node--})}),h5.node(e,function(e){(0,_.Z)(e.children)&&(e.children=e.children.filter(function(e){return e!==t}).map(function(e){return e>t?e-1:e}))}),h5.scene(e,function(e){e.nodes=e.nodes.filter(function(e){return e!==t}).map(function(e){return e>t?e-1:e})})},dZ.material=function(e,t){e.materials.splice(t,1),h5.mesh(e,function(e){h5.meshPrimitive(e,function(e){(0,_.Z)(e.material)&&e.material>t&&e.material--})})},dZ.sampler=function(e,t){e.samplers.splice(t,1),h5.texture(e,function(e){(0,_.Z)(e.sampler)&&e.sampler>t&&--e.sampler})},dZ.texture=function(e,t){if(e.textures.splice(t,1),h5.material(e,function(e){dm(e,function(e,i){i.index>t&&--i.index})}),h4(e,"EXT_feature_metadata")){h5.mesh(e,function(e){h5.meshPrimitive(e,function(e){let i=e.extensions;if((0,_.Z)(i)&&(0,_.Z)(i.EXT_feature_metadata)){let e=i.EXT_feature_metadata.featureIdTextures;if((0,_.Z)(e)){let i=e.length;for(let n=0;n<i;++n){let i=e[n].featureIds.texture;i.index>t&&--i.index}}}})});let i=e.extensions.EXT_feature_metadata.featureTextures;for(let e in i)if(i.hasOwnProperty(e)){let n=i[e].properties;if((0,_.Z)(n)){for(let e in n)if(n.hasOwnProperty(e)){let i=n[e].texture;i.index>t&&--i.index}}}}if(h4(e,"EXT_mesh_features")&&h5.mesh(e,function(e){h5.meshPrimitive(e,function(e){let i=e.extensions;if((0,_.Z)(i)&&(0,_.Z)(i.EXT_mesh_features)){let e=i.EXT_mesh_features.featureIds;if((0,_.Z)(e)){let i=e.length;for(let n=0;n<i;++n){let i=e[n];(0,_.Z)(i.texture)&&i.texture.index>t&&--i.texture.index}}}})}),h4(e,"EXT_structural_metadata")){let i=e.extensions.EXT_structural_metadata.propertyTextures;if((0,_.Z)(i)){let e=i.length;for(let n=0;n<e;++n){let e=i[n].properties;for(let i in e)if(e.hasOwnProperty(i)){let n=e[i];n.index>t&&--n.index}}}}},dy.accessor=function(e){let t={};return h5.mesh(e,function(e){h5.meshPrimitive(e,function(e){h5.meshPrimitiveAttribute(e,function(e){t[e]=!0}),h5.meshPrimitiveTarget(e,function(e){h5.meshPrimitiveTargetAttribute(e,function(e){t[e]=!0})});let i=e.indices;(0,_.Z)(i)&&(t[i]=!0)})}),h5.skin(e,function(e){(0,_.Z)(e.inverseBindMatrices)&&(t[e.inverseBindMatrices]=!0)}),h5.animation(e,function(e){h5.animationSampler(e,function(e){(0,_.Z)(e.input)&&(t[e.input]=!0),(0,_.Z)(e.output)&&(t[e.output]=!0)})}),h4(e,"EXT_mesh_gpu_instancing")&&h5.node(e,function(e){(0,_.Z)(e.extensions)&&(0,_.Z)(e.extensions.EXT_mesh_gpu_instancing)&&Object.keys(e.extensions.EXT_mesh_gpu_instancing.attributes).forEach(function(i){t[e.extensions.EXT_mesh_gpu_instancing.attributes[i]]=!0})}),h4(e,"CESIUM_primitive_outline")&&h5.mesh(e,function(e){h5.meshPrimitive(e,function(e){let i=e.extensions;if((0,_.Z)(i)&&(0,_.Z)(i.CESIUM_primitive_outline)){let e=i.CESIUM_primitive_outline.indices;(0,_.Z)(e)&&(t[e]=!0)}})}),t},dy.buffer=function(e){let t={};return h5.bufferView(e,function(e){(0,_.Z)(e.buffer)&&(t[e.buffer]=!0),(0,_.Z)(e.extensions)&&(0,_.Z)(e.extensions.EXT_meshopt_compression)&&(t[e.extensions.EXT_meshopt_compression.buffer]=!0)}),t},dy.bufferView=function(e){let t={};if(h5.accessor(e,function(e){(0,_.Z)(e.bufferView)&&(t[e.bufferView]=!0)}),h5.shader(e,function(e){(0,_.Z)(e.bufferView)&&(t[e.bufferView]=!0)}),h5.image(e,function(e){(0,_.Z)(e.bufferView)&&(t[e.bufferView]=!0)}),h4(e,"KHR_draco_mesh_compression")&&h5.mesh(e,function(e){h5.meshPrimitive(e,function(e){(0,_.Z)(e.extensions)&&(0,_.Z)(e.extensions.KHR_draco_mesh_compression)&&(t[e.extensions.KHR_draco_mesh_compression.bufferView]=!0)})}),h4(e,"EXT_feature_metadata")){let i=e.extensions.EXT_feature_metadata.featureTables;for(let e in i)if(i.hasOwnProperty(e)){let n=i[e].properties;if((0,_.Z)(n)){for(let e in n)if(n.hasOwnProperty(e)){let i=n[e];(0,_.Z)(i.bufferView)&&(t[i.bufferView]=!0),(0,_.Z)(i.arrayOffsetBufferView)&&(t[i.arrayOffsetBufferView]=!0),(0,_.Z)(i.stringOffsetBufferView)&&(t[i.stringOffsetBufferView]=!0)}}}}if(h4(e,"EXT_structural_metadata")){let i=e.extensions.EXT_structural_metadata.propertyTables;if((0,_.Z)(i)){let e=i.length;for(let n=0;n<e;++n){let e=i[n].properties;for(let i in e)if(e.hasOwnProperty(i)){let n=e[i];(0,_.Z)(n.values)&&(t[n.values]=!0),(0,_.Z)(n.arrayOffsets)&&(t[n.arrayOffsets]=!0),(0,_.Z)(n.stringOffsets)&&(t[n.stringOffsets]=!0)}}}}return t},dy.image=function(e){let t={};return h5.texture(e,function(e){(0,_.Z)(e.source)&&(t[e.source]=!0),(0,_.Z)(e.extensions)&&(0,_.Z)(e.extensions.EXT_texture_webp)?t[e.extensions.EXT_texture_webp.source]=!0:(0,_.Z)(e.extensions)&&(0,_.Z)(e.extensions.KHR_texture_basisu)&&(t[e.extensions.KHR_texture_basisu.source]=!0)}),t},dy.mesh=function(e){let t={};return h5.node(e,function(i){if((0,_.Z)(i.mesh&&(0,_.Z)(e.meshes))){let n=e.meshes[i.mesh];(0,_.Z)(n)&&(0,_.Z)(n.primitives)&&n.primitives.length>0&&(t[i.mesh]=!0)}}),t},dy.node=function(e){let t={};return h5.skin(e,function(e){(0,_.Z)(e.skeleton)&&(t[e.skeleton]=!0),h5.skinJoint(e,function(e){t[e]=!0})}),h5.animation(e,function(e){h5.animationChannel(e,function(e){(0,_.Z)(e.target)&&(0,_.Z)(e.target.node)&&(t[e.target.node]=!0)})}),h5.technique(e,function(e){h5.techniqueUniform(e,function(e){(0,_.Z)(e.node)&&(t[e.node]=!0)})}),h5.node(e,function(i,n){!function e(t,i,n){let r=t.nodes[i];return!((0,_.Z)(r.mesh)||(0,_.Z)(r.camera)||(0,_.Z)(r.skin)||(0,_.Z)(r.weights)||(0,_.Z)(r.extras)||(0,_.Z)(r.extensions)&&0!==Object.keys(r.extensions).length||(0,_.Z)(n[i]))&&(!(0,_.Z)(r.children)||0===r.children.filter(function(i){return!e(t,i,n)}).length)}(e,n,t)&&(t[n]=!0)}),t},dy.material=function(e){let t={};return h5.mesh(e,function(e){h5.meshPrimitive(e,function(e){(0,_.Z)(e.material)&&(t[e.material]=!0)})}),t},dy.texture=function(e){let t={};if(h5.material(e,function(e){dm(e,function(e){t[e]=!0})}),h4(e,"EXT_feature_metadata")){h5.mesh(e,function(e){h5.meshPrimitive(e,function(e){let i=e.extensions;if((0,_.Z)(i)&&(0,_.Z)(i.EXT_feature_metadata)){let e=i.EXT_feature_metadata.featureIdTextures;if((0,_.Z)(e)){let i=e.length;for(let n=0;n<i;++n)t[e[n].featureIds.texture.index]=!0}}})});let i=e.extensions.EXT_feature_metadata.featureTextures;for(let e in i)if(i.hasOwnProperty(e)){let n=i[e].properties;if((0,_.Z)(n))for(let e in n)n.hasOwnProperty(e)&&(t[n[e].texture.index]=!0)}}if(h4(e,"EXT_mesh_features")&&h5.mesh(e,function(e){h5.meshPrimitive(e,function(e){let i=e.extensions;if((0,_.Z)(i)&&(0,_.Z)(i.EXT_mesh_features)){let e=i.EXT_mesh_features.featureIds;if((0,_.Z)(e)){let i=e.length;for(let n=0;n<i;++n){let i=e[n];(0,_.Z)(i.texture)&&(t[i.texture.index]=!0)}}}})}),h4(e,"EXT_structural_metadata")){let i=e.extensions.EXT_structural_metadata.propertyTextures;if((0,_.Z)(i)){let e=i.length;for(let n=0;n<e;++n){let e=i[n].properties;for(let i in e)e.hasOwnProperty(i)&&(t[e[i].index]=!0)}}}return t},dy.sampler=function(e){let t={};return h5.texture(e,function(e){(0,_.Z)(e.sampler)&&(t[e.sampler]=!0)}),t};var db=function(e,t){let i={byteLength:t.length,extras:{_pipeline:{source:t}}},n={buffer:h3(e.buffers,i),byteOffset:0,byteLength:t.length};return h3(e.bufferViews,n)},dv=function(e,t){let i=uM(e,t),n=eM.Z.getSizeInBytes(t.componentType),r=uL(t.type),o=t.count,a=Array(r*o);if(!(0,_.Z)(t.bufferView))return a.fill(0);let s=e.bufferViews[t.bufferView],l=e.buffers[s.buffer].extras._pipeline.source,c=t.byteOffset+s.byteOffset+l.byteOffset,u=new DataView(l.buffer),h=Array(r),d=uF(t.componentType);for(let e=0;e<o;++e){d(u,c,r,n,h);for(let t=0;t<r;++t)a[e*r+t]=h[t];c+=i}return a};function dT(e,t,i){let n=new Uint8Array(eM.Z.createTypedArray(i,dv(e,t)).buffer);t.bufferView=db(e,n),t.componentType=i,t.byteOffset=0}var dE=function(e){let t;return h5.accessorWithSemantic(e,"JOINTS_0",function(i){let n=e.accessors[i];(t=n.componentType)===eU.Z.BYTE?dT(e,n,eM.Z.UNSIGNED_BYTE):t!==eU.Z.UNSIGNED_BYTE&&t!==eU.Z.UNSIGNED_SHORT&&dT(e,n,eM.Z.UNSIGNED_SHORT)}),h5.accessorWithSemantic(e,"WEIGHTS_0",function(i){let n=e.accessors[i];(t=n.componentType)===eU.Z.BYTE?dT(e,n,eM.Z.UNSIGNED_BYTE):t===eU.Z.SHORT&&dT(e,n,eM.Z.UNSIGNED_SHORT)}),e},dx=function(e,t){return dt(e,t),"CESIUM_RTC"===t&&h5.technique(e,function(e){h5.techniqueUniform(e,function(e){"CESIUM_RTC_MODELVIEW"===e.semantic&&(e.semantic="MODELVIEW")})}),function e(t,i){if(Array.isArray(t)){let n=t.length;for(let r=0;r<n;++r)e(t[r],i)}else if(null!==t&&"object"==typeof t&&t.constructor===Object){let n;let r=t.extensions;for(let o in(0,_.Z)(r)&&(n=r[i],(0,_.Z)(n)&&(delete r[i],0===Object.keys(r).length&&delete t.extensions)),t)Object.prototype.hasOwnProperty.call(t,o)&&e(t[o],i);return n}}(e,t)};let dw={.8:function(e){(0,_.Z)(e.asset)||(e.asset={});let t=e.asset;if(t.version="1.0","string"==typeof t.profile){let e=t.profile.split(" ");t.profile={api:e[0],version:e[1]}}else t.profile={};if((0,_.Z)(e.version)&&delete e.version,dS(e),!function(e){let t=e.meshes;for(let e in t)if(Object.prototype.hasOwnProperty.call(t,e)){let i=t[e].primitives;if((0,_.Z)(i)){let e=i.length;for(let t=0;t<e;++t){let e=i[t],n=(0,m.Z)(e.primitive,eU.Z.TRIANGLES);e.mode=(0,m.Z)(e.mode,n),delete e.primitive}}}}(e),!function(e){let t=e.nodes,i=new S.Z,n=new n5.Z;for(let e in t)if(Object.prototype.hasOwnProperty.call(t,e)){let r=t[e];if((0,_.Z)(r.rotation)){let e=r.rotation;S.Z.fromArray(e,0,i),n5.Z.fromAxisAngle(i,e[3],n),r.rotation=[n.x,n.y,n.z,n.w]}let o=r.instanceSkin;(0,_.Z)(o)&&(r.skeletons=o.skeletons,r.skin=o.skin,r.meshes=o.meshes,delete r.instanceSkin)}}(e),!function(e){let t=e.animations,i=e.accessors,n=e.bufferViews,r=e.buffers,o={},a=new S.Z,s=new n5.Z;for(let e in t)if(Object.prototype.hasOwnProperty.call(t,e)){let l=t[e],c=l.channels,u=l.parameters,h=l.samplers;if((0,_.Z)(c)){let e=c.length;for(let t=0;t<e;++t){let e=c[t];if("rotation"===e.target.path){let t=u[h[e.sampler].output];if((0,_.Z)(o[t]))continue;o[t]=!0;let l=i[t],c=n[l.bufferView],d=r[c.buffer].extras._pipeline.source,f=d.byteOffset+c.byteOffset+l.byteOffset,p=l.componentType,m=l.count,g=uL(l.type),Z=l.count*g,y=eM.Z.createArrayBufferView(p,d.buffer,f,Z);for(let e=0;e<m;e++){let t=e*g;S.Z.unpack(y,t,a);let i=y[t+3];n5.Z.fromAxisAngle(a,i,s),n5.Z.pack(s,y,t)}}}}}}(e),!function(e){let t=e.techniques;for(let e in t)if(Object.prototype.hasOwnProperty.call(t,e)){let i=t[e],n=i.passes;if((0,_.Z)(n)){let e=(0,m.Z)(i.pass,"defaultPass");if(Object.prototype.hasOwnProperty.call(n,e)){let t=n[e],r=t.instanceProgram;i.attributes=(0,m.Z)(i.attributes,r.attributes),i.program=(0,m.Z)(i.program,r.program),i.uniforms=(0,m.Z)(i.uniforms,r.uniforms),i.states=(0,m.Z)(i.states,t.states)}delete i.passes,delete i.pass}}}(e),(0,_.Z)(e.allExtensions)&&(e.extensionsUsed=e.allExtensions,delete e.allExtensions),(0,_.Z)(e.lights)){let t=(0,m.Z)(e.extensions,{});e.extensions=t;let i=(0,m.Z)(t.KHR_materials_common,{});t.KHR_materials_common=i,i.lights=e.lights,delete e.lights,da(e,"KHR_materials_common")}},"1.0":function(e){e.asset=(0,m.Z)(e.asset,{}),e.asset.version="2.0",dS(e),function(e){let t=e.animations;for(let e in t)if(Object.prototype.hasOwnProperty.call(t,e)){let i=t[e],n=i.parameters;if((0,_.Z)(n)){let e=i.samplers;for(let t in e)if(Object.prototype.hasOwnProperty.call(e,t)){let i=e[t];i.input=n[i.input],i.output=n[i.output]}delete i.parameters}}}(e),h5.node(e,function(t,i){dP(t)&&function e(t,i){h5.scene(t,function(e){let t=e.nodes;if((0,_.Z)(t)){let e=t.length;for(let n=e;n>=0;--n)if(t[n]===i){t.splice(n,1);return}}}),h5.node(t,function(n,r){if((0,_.Z)(n.children)){let o=n.children.indexOf(i);o>-1&&(n.children.splice(o,1),dP(n)&&e(t,r))}}),delete t.nodes[i]}(e,i)}),function(e){let t,i;let n={accessors:{},animations:{},buffers:{},bufferViews:{},cameras:{},images:{},materials:{},meshes:{},nodes:{},programs:{},samplers:{},scenes:{},shaders:{},skins:{},textures:{},techniques:{}},r={},o=e.nodes;for(let e in o)Object.prototype.hasOwnProperty.call(o,e)&&(i=o[e].jointName,(0,_.Z)(i)&&(r[i]=e));for(let t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&(0,_.Z)(n[t])){let i={},r=e[t];e[t]=dC(r,i),n[t]=i}for(i in r)Object.prototype.hasOwnProperty.call(r,i)&&(r[i]=n.nodes[r[i]]);(0,_.Z)(e.scene)&&(e.scene=n.scenes[e.scene]),h5.bufferView(e,function(e){(0,_.Z)(e.buffer)&&(e.buffer=n.buffers[e.buffer])}),h5.accessor(e,function(e){(0,_.Z)(e.bufferView)&&(e.bufferView=n.bufferViews[e.bufferView])}),h5.shader(e,function(e){let t=e.extensions;if((0,_.Z)(t)){let i=t.KHR_binary_glTF;(0,_.Z)(i)&&(e.bufferView=n.bufferViews[i.bufferView],delete t.KHR_binary_glTF),0===Object.keys(t).length&&delete e.extensions}}),h5.program(e,function(e){(0,_.Z)(e.vertexShader)&&(e.vertexShader=n.shaders[e.vertexShader]),(0,_.Z)(e.fragmentShader)&&(e.fragmentShader=n.shaders[e.fragmentShader])}),h5.technique(e,function(e){(0,_.Z)(e.program)&&(e.program=n.programs[e.program]),h5.techniqueParameter(e,function(e){(0,_.Z)(e.node)&&(e.node=n.nodes[e.node]);let t=e.value;"string"==typeof t&&(e.value={index:n.textures[t]})})}),h5.mesh(e,function(e){h5.meshPrimitive(e,function(e){(0,_.Z)(e.indices)&&(e.indices=n.accessors[e.indices]),h5.meshPrimitiveAttribute(e,function(t,i){e.attributes[i]=n.accessors[t]}),(0,_.Z)(e.material)&&(e.material=n.materials[e.material])})}),h5.node(e,function(i){let r=i.children;if((0,_.Z)(r)){let e=r.length;for(t=0;t<e;++t)r[t]=n.nodes[r[t]]}if((0,_.Z)(i.meshes)){let o=i.meshes,a=o.length;if(a>0)for(t=1,i.mesh=n.meshes[o[0]];t<a;++t){let a={mesh:n.meshes[o[t]]},s=h3(e.nodes,a);(0,_.Z)(r)||(r=[],i.children=r),r.push(s)}delete i.meshes}if((0,_.Z)(i.camera)&&(i.camera=n.cameras[i.camera]),(0,_.Z)(i.skin)&&(i.skin=n.skins[i.skin]),(0,_.Z)(i.skeletons)){let t=i.skeletons;t.length>0&&(0,_.Z)(i.skin)&&(e.skins[i.skin].skeleton=n.nodes[t[0]]),delete i.skeletons}(0,_.Z)(i.jointName)&&delete i.jointName}),h5.skin(e,function(e){(0,_.Z)(e.inverseBindMatrices)&&(e.inverseBindMatrices=n.accessors[e.inverseBindMatrices]);let i=e.jointNames;if((0,_.Z)(i)){let n=[],o=i.length;for(t=0;t<o;++t)n[t]=r[i[t]];e.joints=n,delete e.jointNames}}),h5.scene(e,function(e){let i=e.nodes;if((0,_.Z)(i)){let e=i.length;for(t=0;t<e;++t)i[t]=n.nodes[i[t]]}}),h5.animation(e,function(e){let t={};e.samplers=dC(e.samplers,t),h5.animationSampler(e,function(e){e.input=n.accessors[e.input],e.output=n.accessors[e.output]}),h5.animationChannel(e,function(e){e.sampler=t[e.sampler];let i=e.target;(0,_.Z)(i)&&(i.node=n.nodes[i.id],delete i.id)})}),h5.material(e,function(e){(0,_.Z)(e.technique)&&(e.technique=n.techniques[e.technique]),h5.materialValue(e,function(t,i){"string"==typeof t&&(e.values[i]={index:n.textures[t]})});let t=e.extensions;if((0,_.Z)(t)){let e=t.KHR_materials_common;(0,_.Z)(e)&&(0,_.Z)(e.values)&&h5.materialValue(e,function(t,i){"string"==typeof t&&(e.values[i]={index:n.textures[t]})})}}),h5.image(e,function(e){let t=e.extensions;if((0,_.Z)(t)){let i=t.KHR_binary_glTF;(0,_.Z)(i)&&(e.bufferView=n.bufferViews[i.bufferView],e.mimeType=i.mimeType,delete t.KHR_binary_glTF),0===Object.keys(t).length&&delete e.extensions}}),h5.texture(e,function(e){(0,_.Z)(e.sampler)&&(e.sampler=n.samplers[e.sampler]),(0,_.Z)(e.source)&&(e.source=n.images[e.source])})}(e),h5.animation(e,function(e){h5.animationSampler(e,function(e){delete e.name})}),function(e){let t=e.asset;delete t.profile,delete t.premultipliedAlpha}(e),function(e){let t=e.extensionsUsed;if(e.extensionsRequired=(0,m.Z)(e.extensionsRequired,[]),(0,_.Z)(t)){let i=t.length;for(let n=0;n<i;++n){let i=t[n];(0,_.Z)(dA[i])&&e.extensionsRequired.push(i)}}}(e),h5.buffer(e,function(e){(0,_.Z)(e.byteLength)||(e.byteLength=e.extras._pipeline.source.length)}),h5.accessor(e,function(t){let i=t.bufferView;if((0,_.Z)(i)){let n=e.bufferViews[i],r=dD(e,t),o=t.byteOffset+t.count*r;n.byteLength=Math.max((0,m.Z)(n.byteLength,0),o)}}),function(e){var t;let i,n,r;let o=e.bufferViews,a={};h5.accessorContainingVertexAttributeData(e,function(t){let i=e.accessors[t];(0,_.Z)(i.bufferView)&&(a[i.bufferView]=!0)});let s={};for(let t in h5.accessor(e,function(e){(0,_.Z)(e.bufferView)&&(s[e.bufferView]=(0,m.Z)(s[e.bufferView],[]),s[e.bufferView].push(e))}),s)if(Object.prototype.hasOwnProperty.call(s,t)){r=o[t];let l=s[t];l.sort(function(e,t){return e.byteOffset-t.byteOffset});let c=0,u=0,h=l.length;for(i=0;i<h;++i){let s=l[i],d=dD(e,s),f=s.byteOffset,p=s.count*d;delete s.byteStride;let m=i<h-1;if(d!==(m?dD(e,l[i+1]):void 0)){let e=(0,uz.Z)(r,!0);a[t]&&(e.byteStride=d),e.byteOffset+=c,e.byteLength=f+p-c;let h=h3(o,e);for(n=u;n<=i;++n)(s=l[n]).bufferView=h,s.byteOffset=s.byteOffset-c;c=m?l[i+1].byteOffset:void 0,u=i+1}}}t=["accessor","bufferView","buffer"],t=(0,m.Z)(t,d_),d_.forEach(function(i){t.indexOf(i)>-1&&function(e,t){let i=e[dg[t]];if((0,_.Z)(i)){let n=0,r=dy[t](e),o=i.length;for(let i=0;i<o;++i)!r[i]&&(dZ[t](e,i-n),n++)}}(e,i)})}(e),h5.accessorWithSemantic(e,"POSITION",function(t){let i=e.accessors[t];if(!(0,_.Z)(i.min)||!(0,_.Z)(i.max)){let t=ds(e,i);i.min=t.min,i.max=t.max}}),h5.animation(e,function(t){h5.animationSampler(t,function(t){let i=e.accessors[t.input];if(!(0,_.Z)(i.min)||!(0,_.Z)(i.max)){let t=ds(e,i);i.min=t.min,i.max=t.max}})}),h5.accessor(e,function(t){if((0,_.Z)(t.min)||(0,_.Z)(t.max)){let i=ds(e,t);(0,_.Z)(t.min)&&(t.min=i.min),(0,_.Z)(t.max)&&(t.max=i.max)}}),h5.buffer(e,function(e){delete e.type}),h5.texture(e,function(e){delete e.format,delete e.internalFormat,delete e.target,delete e.type}),h5.mesh(e,function(e){h5.meshPrimitive(e,function(e){h5.meshPrimitiveAttribute(e,function(t,i){"TEXCOORD"===i?e.attributes.TEXCOORD_0=t:"COLOR"===i&&(e.attributes.COLOR_0=t)}),delete e.attributes.TEXCOORD,delete e.attributes.COLOR})}),h5.technique(e,function(e){h5.techniqueParameter(e,function(e){let t=e.semantic;(0,_.Z)(t)&&("TEXCOORD"===t?e.semantic="TEXCOORD_0":"COLOR"===t&&(e.semantic="COLOR_0"))})}),function(e){let t={};h5.mesh(e,function(e){h5.meshPrimitive(e,function(e){for(let i in h5.meshPrimitiveAttribute(e,function(e,i){if("_"!==i.charAt(0)){let e;let n=i.search(/_[0-9]+/g),r=i,o="_0";n>=0&&(r=i.substring(0,n),o=i.substring(n));let a=dO[r];(0,_.Z)(a)?(e=a+o,t[i]=e):(0,_.Z)(dI[r])||(e=`_${i}`,t[i]=e)}}),t)if(Object.prototype.hasOwnProperty.call(t,i)){let n=t[i],r=e.attributes[i];(0,_.Z)(r)&&(delete e.attributes[i],e.attributes[n]=r)}})}),h5.technique(e,function(e){h5.techniqueParameter(e,function(e){let i=t[e.semantic];(0,_.Z)(i)&&(e.semantic=i)})})}(e),dE(e),h5.camera(e,function(e){let t=e.perspective;if((0,_.Z)(t)){let e=t.aspectRatio;(0,_.Z)(e)&&0===e&&delete t.aspectRatio;let i=t.yfov;(0,_.Z)(i)&&0===i&&(t.yfov=1)}}),dd(e),dp(e),function(e){for(let t in e)if(Object.prototype.hasOwnProperty.call(e,t)){let i=e[t];Array.isArray(i)&&0===i.length&&delete e[t]}h5.node(e,function(e){(0,_.Z)(e.children)&&0===e.children.length&&delete e.children})}(e)},"2.0":void 0};function dS(e){let t=e.materials;for(let e in t)if(Object.prototype.hasOwnProperty.call(t,e)){let i=t[e],n=i.instanceTechnique;(0,_.Z)(n)&&(i.technique=n.technique,i.values=n.values,delete i.instanceTechnique)}}function dC(e,t){let i=[];for(let n in e)if(Object.prototype.hasOwnProperty.call(e,n)){let r=e[n];t[n]=i.length,i.push(r),(0,_.Z)(r.name)||(r.name=n)}return i}let dA={CESIUM_RTC:!0,KHR_materials_common:!0,WEB3D_quantized_attributes:!0},dI={POSITION:!0,NORMAL:!0,TANGENT:!0},dO={COLOR:"COLOR",JOINT:"JOINTS",JOINTS:"JOINTS",TEXCOORD:"TEXCOORD",WEIGHT:"WEIGHTS",WEIGHTS:"WEIGHTS"};function dD(e,t){return(0,_.Z)(t.byteStride)&&0!==t.byteStride?t.byteStride:uM(e,t)}function dP(e){return(!(0,_.Z)(e.children)||0===e.children.length)&&(!(0,_.Z)(e.meshes)||0===e.meshes.length)&&!(0,_.Z)(e.camera)&&!(0,_.Z)(e.skin)&&!(0,_.Z)(e.skeletons)&&!(0,_.Z)(e.jointName)&&(!(0,_.Z)(e.translation)||S.Z.fromArray(e.translation).equals(S.Z.ZERO))&&(!(0,_.Z)(e.scale)||S.Z.fromArray(e.scale).equals(new S.Z(1,1,1)))&&(!(0,_.Z)(e.rotation)||eo.Z.fromArray(e.rotation).equals(new eo.Z(0,0,0,1)))&&(!(0,_.Z)(e.matrix)||er.Z.fromColumnMajorArray(e.matrix).equals(er.Z.IDENTITY))&&!(0,_.Z)(e.extensions)&&!(0,_.Z)(e.extras)}let dR=["u_tex","u_diffuse","u_emission","u_diffuse_tex"],dN=["u_diffuse","u_diffuse_mat"];function dL(e){e.pbrMetallicRoughness=(0,_.Z)(e.pbrMetallicRoughness)?e.pbrMetallicRoughness:{},e.pbrMetallicRoughness.roughnessFactor=1,e.pbrMetallicRoughness.metallicFactor=0}function dM(e){return(0,_.Z)(e.index)}function dF(e){return Array.isArray(e)&&4===e.length}function dz(e){let t=[,,,,];t[3]=e[3];for(let i=0;i<3;i++){let n=e[i];n<=.04045?t[i]=.07739938080495357*e[i]:t[i]=Math.pow((n+.055)*.9478672985781991,2.4)}return t}function dB(e,t){(0,_.Z)(t)&&(dF(t)?e.pbrMetallicRoughness.baseColorFactor=dz(t):dM(t)&&(e.pbrMetallicRoughness.baseColorTexture=t))}function dU(e,t){(0,_.Z)(t)&&(dF(t)?e.emissiveFactor=t.slice(0,3):dM(t)&&(e.emissiveTexture=t))}var dk=function(e,t){let i=(t=(0,m.Z)(t,m.Z.EMPTY_OBJECT)).targetVersion,n=e.version;e.asset=(0,m.Z)(e.asset,{version:"1.0"}),e.asset.version=(0,m.Z)(e.asset.version,"1.0"),n=(0,m.Z)(n,e.asset.version).toString(),Object.prototype.hasOwnProperty.call(dw,n)||((0,_.Z)(n)&&(n=n.substring(0,3)),Object.prototype.hasOwnProperty.call(dw,n)||(n="1.0"));let r=dw[n];for(;(0,_.Z)(r)&&n!==i;)r(e,t),r=dw[n=e.asset.version];return t.keepLegacyExtensions||(function(e,t){t=(0,m.Z)(t,m.Z.EMPTY_OBJECT);let i=(0,m.Z)(t.baseColorTextureNames,dR),n=(0,m.Z)(t.baseColorFactorNames,dN);h5.material(e,function(e){h5.materialValue(e,function(t,r){-1!==i.indexOf(r)&&dM(t)?(dL(e),e.pbrMetallicRoughness.baseColorTexture=t):-1!==n.indexOf(r)&&dF(t)&&(dL(e),e.pbrMetallicRoughness.baseColorFactor=dz(t))})}),dx(e,"KHR_techniques_webgl"),dx(e,"KHR_blend")}(e,t),h5.material(e,function(t){let i=(0,m.Z)(t.extensions,m.Z.EMPTY_OBJECT).KHR_materials_common;if(!(0,_.Z)(i))return;let n=(0,m.Z)(i.values,{}),r=n.ambient,o=n.diffuse,a=n.emission,s=n.transparency,l=i.doubleSided,c=i.transparent;dL(t),"CONSTANT"===i.technique?(da(e,"KHR_materials_unlit"),t.extensions=(0,_.Z)(t.extensions)?t.extensions:{},t.extensions.KHR_materials_unlit={},dB(t,a),dB(t,r)):(dB(t,o),dU(t,r),dU(t,a)),(0,_.Z)(l)&&(t.doubleSided=l),(0,_.Z)(s)&&((0,_.Z)(t.pbrMetallicRoughness.baseColorFactor)?t.pbrMetallicRoughness.baseColorFactor[3]*=s:t.pbrMetallicRoughness.baseColorFactor=[1,1,1,s]),(0,_.Z)(c)&&(t.alphaMode=c?"BLEND":"OPAQUE")}),dx(e,"KHR_materials_common")),e},dV=i(996),dH=i(1705);let dG={POSITION:"POSITION",NORMAL:"NORMAL",TANGENT:"TANGENT",TEXCOORD:"TEXCOORD",COLOR:"COLOR",JOINTS:"JOINTS",WEIGHTS:"WEIGHTS",FEATURE_ID:"_FEATURE_ID"};dG.hasSetIndex=function(e){switch(p.Z.typeOf.string("semantic",e),e){case dG.POSITION:case dG.NORMAL:case dG.TANGENT:return!1;case dG.TEXCOORD:case dG.COLOR:case dG.JOINTS:case dG.WEIGHTS:case dG.FEATURE_ID:return!0;default:throw new A.Z("semantic is not a valid value.")}},dG.fromGltfSemantic=function(e){p.Z.typeOf.string("gltfSemantic",e);let t=e,i=/^(\w+)_\d+$/.exec(e);switch(null!==i&&(t=i[1]),t){case"POSITION":return dG.POSITION;case"NORMAL":return dG.NORMAL;case"TANGENT":return dG.TANGENT;case"TEXCOORD":return dG.TEXCOORD;case"COLOR":return dG.COLOR;case"JOINTS":return dG.JOINTS;case"WEIGHTS":return dG.WEIGHTS;case"_FEATURE_ID":return dG.FEATURE_ID}},dG.fromPntsSemantic=function(e){switch(p.Z.typeOf.string("pntsSemantic",e),e){case"POSITION":case"POSITION_QUANTIZED":return dG.POSITION;case"RGBA":case"RGB":case"RGB565":return dG.COLOR;case"NORMAL":case"NORMAL_OCT16P":return dG.NORMAL;case"BATCH_ID":return dG.FEATURE_ID;default:throw new A.Z("pntsSemantic is not a valid value.")}},dG.getGlslType=function(e){switch(p.Z.typeOf.string("semantic",e),e){case dG.POSITION:case dG.NORMAL:case dG.TANGENT:return"vec3";case dG.TEXCOORD:return"vec2";case dG.COLOR:return"vec4";case dG.JOINTS:return"ivec4";case dG.WEIGHTS:return"vec4";case dG.FEATURE_ID:return"int";default:throw new A.Z("semantic is not a valid value.")}},dG.getVariableName=function(e,t){p.Z.typeOf.string("semantic",e);let i=function(e){switch(e){case dG.POSITION:return"positionMC";case dG.NORMAL:return"normalMC";case dG.TANGENT:return"tangentMC";case dG.TEXCOORD:return"texCoord";case dG.COLOR:return"color";case dG.JOINTS:return"joints";case dG.WEIGHTS:return"weights";case dG.FEATURE_ID:return"featureId";default:throw new A.Z("semantic is not a valid value.")}}(e);return(0,_.Z)(t)&&(i+=`_${t}`),i};var dj=Object.freeze(dG),dW=i(7048);function dq(){}dq.getError=function(e,t,i){let n=`Failed to load ${e}: ${t}`;(0,_.Z)(i)&&(0,_.Z)(i.message)&&(n+=` ${i.message}`);let r=new e3.Z(n);return(0,_.Z)(i)&&(r.stack=`Original stack: ${i.stack} Handler stack: ${r.stack}`),r},dq.getNodeTransform=function(e){return(0,_.Z)(e.matrix)?e.matrix:er.Z.fromTranslationQuaternionRotationScale((0,_.Z)(e.translation)?e.translation:S.Z.ZERO,(0,_.Z)(e.rotation)?e.rotation:n5.Z.IDENTITY,(0,_.Z)(e.scale)?e.scale:S.Z.ONE)},dq.getAttributeBySemantic=function(e,t,i){let n=e.attributes,r=n.length;for(let e=0;e<r;++e){let r=n[e],o=!(0,_.Z)(i)||r.setIndex===i;if(r.semantic===t&&o)return r}},dq.getAttributeByName=function(e,t){let i=e.attributes,n=i.length;for(let e=0;e<n;++e){let n=i[e];if(n.name===t)return n}},dq.getFeatureIdsByLabel=function(e,t){for(let i=0;i<e.length;i++){let n=e[i];if(n.positionalLabel===t||n.label===t)return n}},dq.hasQuantizedAttributes=function(e){if(!(0,_.Z)(e))return!1;for(let t=0;t<e.length;t++){let i=e[t];if((0,_.Z)(i.quantization))return!0}return!1},dq.getAttributeInfo=function(e){let t,i;let n=e.semantic,r=e.setIndex,o=!1;(0,_.Z)(n)?(t=dj.getVariableName(n,r),o=!0):t=(t=(t=e.name).replace(/^_/,"")).toLowerCase();let a=/^color_\d+$/.test(t),s=e.type,l=dH.Z.getGlslType(s);a&&(l="vec4");let c=(0,_.Z)(e.quantization);return c&&(i=a?"vec4":dH.Z.getGlslType(e.quantization.type)),{attribute:e,isQuantized:c,variableName:t,hasSemantic:o,glslType:l,quantizedGlslType:i}};let dY=new S.Z,dX=new S.Z;dq.getPositionMinMax=function(e,t,i){let n=dq.getAttributeBySemantic(e,"POSITION"),r=n.max,o=n.min;return(0,_.Z)(i)&&(0,_.Z)(t)&&(o=S.Z.add(o,t,dX),r=S.Z.add(r,i,dY)),{min:o,max:r}},dq.getAxisCorrectionMatrix=function(e,t,i){return i=er.Z.clone(er.Z.IDENTITY,i),e===dV.Z.Y?i=er.Z.clone(dV.Z.Y_UP_TO_Z_UP,i):e===dV.Z.X&&(i=er.Z.clone(dV.Z.X_UP_TO_Z_UP,i)),t===dV.Z.Z&&(i=er.Z.multiplyTransformation(i,dV.Z.Z_UP_TO_X_UP,i)),i};let d$=new n2.Z;function dK(e){let t=(e=(0,m.Z)(e,m.Z.EMPTY_OBJECT)).resourceCache,i=e.gltfResource,n=e.baseResource,r=e.typedArray,o=e.gltfJson,a=e.cacheKey;p.Z.typeOf.func("options.resourceCache",t),p.Z.typeOf.object("options.gltfResource",i),p.Z.typeOf.object("options.baseResource",n),this._resourceCache=t,this._gltfResource=i,this._baseResource=n,this._typedArray=r,this._gltfJson=o,this._cacheKey=a,this._gltf=void 0,this._bufferLoaders=[],this._state=hx.UNLOADED,this._promise=void 0}async function dQ(e){let t;try{let i=await e._fetchGltf();if(e.isDestroyed())return;t=new Uint8Array(i)}catch(t){if(e.isDestroyed())return;dJ(e,t)}return d2(e,t)}function dJ(e,t){e.unload(),e._state=hx.FAILED;let i=`Failed to load glTF: ${e._gltfResource.url}`;throw e.getError(i,t)}async function d0(e,t){if((0,_.Z)(t.asset)&&"2.0"===t.asset.version&&!h4(t,"KHR_techniques_webgl")&&!h4(t,"KHR_materials_common"))return Promise.resolve();let i=[];h5.buffer(t,function(t){if(!(0,_.Z)(t.extras._pipeline.source)&&(0,_.Z)(t.uri)){let n=e._baseResource.getDerivedResource({url:t.uri}),r=e._resourceCache.getExternalBufferLoader({resource:n});e._bufferLoaders.push(r),i.push(r.load().then(function(){r.isDestroyed()||(t.extras._pipeline.source=r.typedArray)}))}}),await Promise.all(i),dk(t)}async function d1(e,t){try{h7(t),await function(e){let t=[];return h5.buffer(e,function(e){let i=e.uri;!(0,_.Z)(e.extras._pipeline.source)&&(0,_.Z)(i)&&(0,h2.Z)(i)&&(delete e.uri,t.push(ec.Z.fetchArrayBuffer(i).then(function(t){e.extras._pipeline.source=new Uint8Array(t)})))}),Promise.all(t)}(t),await d0(e,t),h8(t),await function(e,t){let i=[];return h5.buffer(t,function(t,n){let r=t.extras._pipeline.source;if((0,_.Z)(r)&&!(0,_.Z)(t.uri)){let t=e._resourceCache.getEmbeddedBufferLoader({parentResource:e._gltfResource,bufferId:n,typedArray:r});e._bufferLoaders.push(t),i.push(t.load())}}),Promise.all(i)}(e,t),h5.shader(t,function(e){dr(e)}),h5.buffer(t,function(e){dr(e)}),h5.image(t,function(e){dr(e)}),dr(t);let i=t.asset.version;if("1.0"!==i&&"2.0"!==i)throw new e3.Z(`Unsupported glTF version: ${i}`);let n=t.extensionsRequired;return(0,_.Z)(n)&&dq.checkSupportedExtensions(n),e._gltf=t,e._state=hx.READY,e}catch(t){if(e.isDestroyed())return;dJ(e,t)}}async function d2(e,t){let i;try{i="glTF"===h1(t)?dn(t):h0(t)}catch(t){if(e.isDestroyed())return;dJ(e,t)}return d1(e,i)}dq.getCullFace=function(e,t){if(!iT.Z.isTriangles(t))return dW.Z.BACK;let i=er.Z.getMatrix3(e,d$);return 0>n2.Z.determinant(i)?dW.Z.FRONT:dW.Z.BACK},dq.sanitizeGlslIdentifier=function(e){let t=e.replaceAll(/[^A-Za-z0-9]+/g,"_");return t=t.replace(/^gl_/,""),/^\d/.test(t)&&(t=`_${t}`),t},dq.supportedExtensions={AGI_articulations:!0,CESIUM_primitive_outline:!0,CESIUM_RTC:!0,EXT_feature_metadata:!0,EXT_instance_features:!0,EXT_mesh_features:!0,EXT_mesh_gpu_instancing:!0,EXT_meshopt_compression:!0,EXT_structural_metadata:!0,EXT_texture_webp:!0,KHR_blend:!0,KHR_draco_mesh_compression:!0,KHR_techniques_webgl:!0,KHR_materials_common:!0,KHR_materials_pbrSpecularGlossiness:!0,KHR_materials_specular:!0,KHR_materials_anisotropy:!0,KHR_materials_clearcoat:!0,KHR_materials_unlit:!0,KHR_mesh_quantization:!0,KHR_texture_basisu:!0,KHR_texture_transform:!0,WEB3D_quantized_attributes:!0},dq.checkSupportedExtensions=function(e){let t=e.length;for(let i=0;i<t;i++){let t=e[i];if(!dq.supportedExtensions[t])throw new e3.Z(`Unsupported glTF Extension: ${t}`)}},(0,_.Z)(Object.create)&&(dK.prototype=Object.create(hE.prototype),dK.prototype.constructor=dK),Object.defineProperties(dK.prototype,{cacheKey:{get:function(){return this._cacheKey}},gltf:{get:function(){return this._gltf}}}),dK.prototype.load=async function(){return(0,_.Z)(this._promise)||((this._state=hx.LOADING,(0,_.Z)(this._gltfJson))?this._promise=d1(this,this._gltfJson):(0,_.Z)(this._typedArray)?this._promise=d2(this,this._typedArray):this._promise=dQ(this)),this._promise},dK.prototype.unload=function(){let e=this._bufferLoaders,t=e.length;for(let i=0;i<t;++i)e[i]=!e[i].isDestroyed()&&this._resourceCache.unload(e[i]);this._bufferLoaders.length=0,this._gltf=void 0},dK.prototype._fetchGltf=function(){return this._gltfResource.fetchArrayBuffer()};var d3=i(5695);function d4(e){let t=(e=(0,m.Z)(e,m.Z.EMPTY_OBJECT)).resourceCache,i=e.gltf,n=e.textureInfo,r=e.gltfResource,o=e.baseResource,a=e.supportedImageFormats,s=e.cacheKey,l=(0,m.Z)(e.asynchronous,!0);p.Z.typeOf.func("options.resourceCache",t),p.Z.typeOf.object("options.gltf",i),p.Z.typeOf.object("options.textureInfo",n),p.Z.typeOf.object("options.gltfResource",r),p.Z.typeOf.object("options.baseResource",o),p.Z.typeOf.object("options.supportedImageFormats",a);let c=n.index,u=u3.getImageIdFromTexture({gltf:i,textureId:c,supportedImageFormats:a});this._resourceCache=t,this._gltf=i,this._textureInfo=n,this._imageId=u,this._gltfResource=r,this._baseResource=o,this._cacheKey=s,this._asynchronous=l,this._imageLoader=void 0,this._image=void 0,this._mipLevels=void 0,this._texture=void 0,this._state=hx.UNLOADED,this._promise=void 0}(0,_.Z)(Object.create)&&(d4.prototype=Object.create(hE.prototype),d4.prototype.constructor=d4),Object.defineProperties(d4.prototype,{cacheKey:{get:function(){return this._cacheKey}},texture:{get:function(){return this._texture}}});let d5=new d8;async function d9(e){let t=e._resourceCache;try{let i=t.getImageLoader({gltf:e._gltf,imageId:e._imageId,gltfResource:e._gltfResource,baseResource:e._baseResource});if(e._imageLoader=i,await i.load(),e.isDestroyed())return;return e._image=i.image,e._mipLevels=i.mipLevels,e._state=hx.LOADED,e}catch(t){if(e.isDestroyed())return;throw e.unload(),e._state=hx.FAILED,e.getError("Failed to load texture",t)}}function d8(){this.gltf=void 0,this.textureInfo=void 0,this.image=void 0,this.context=void 0,this.texture=void 0}function d6(e,t,i,n,r){let o;let a=i.internalFormat,s=!1;e2.Z.isCompressedFormat(a)&&!(0,_.Z)(n)&&(s=!0);let l=u3.createSampler({gltf:e,textureInfo:t,compressedTextureNoMipmap:s}),c=l.minificationFilter,u=l.wrapS,h=l.wrapT,d=c===uW.Z.NEAREST_MIPMAP_NEAREST||c===uW.Z.NEAREST_MIPMAP_LINEAR||c===uW.Z.LINEAR_MIPMAP_NEAREST||c===uW.Z.LINEAR_MIPMAP_LINEAR,f=!(0,_.Z)(a)&&d,p=f||u===uq.Z.REPEAT||u===uq.Z.MIRRORED_REPEAT||h===uq.Z.REPEAT||h===uq.Z.MIRRORED_REPEAT,m=!eB.Z.isPowerOfTwo(i.width)||!eB.Z.isPowerOfTwo(i.height);return(0,_.Z)(a)?(!r.webgl2&&e2.Z.isCompressedFormat(a)&&m&&p&&console.warn("Compressed texture uses REPEAT or MIRRORED_REPEAT texture wrap mode and dimensions are not powers of two. The texture may be rendered incorrectly."),o=e5.Z.create({context:r,source:{arrayBufferView:i.bufferView,mipLevels:n},width:i.width,height:i.height,pixelFormat:i.internalFormat,sampler:l})):(p&&m&&(i=(0,d3.Z)(i)),o=e5.Z.create({context:r,source:i,sampler:l,flipY:!1,skipColorSpaceConversion:!0})),f&&o.generateMipmap(),o}function d7(e){let t=(e=(0,m.Z)(e,m.Z.EMPTY_OBJECT)).resourceCache,i=e.gltf,n=e.gltfResource,r=e.baseResource,o=e.bufferViewId,a=e.draco,s=e.attributeSemantic,l=e.accessorId,c=e.cacheKey,u=(0,m.Z)(e.asynchronous,!0),h=(0,m.Z)(e.loadBuffer,!1),d=(0,m.Z)(e.loadTypedArray,!1);if(p.Z.typeOf.func("options.resourceCache",t),p.Z.typeOf.object("options.gltf",i),p.Z.typeOf.object("options.gltfResource",n),p.Z.typeOf.object("options.baseResource",r),!h&&!d)throw new A.Z("At least one of loadBuffer and loadTypedArray must be true.");let f=(0,_.Z)(o),g=fe(a,s),Z=(0,_.Z)(s),y=(0,_.Z)(l);if(f===g)throw new A.Z("One of options.bufferViewId and options.draco must be defined.");if(g&&!Z)throw new A.Z("When options.draco is defined options.attributeSemantic must also be defined.");if(g&&!y)throw new A.Z("When options.draco is defined options.accessorId must also be defined.");g&&(p.Z.typeOf.object("options.draco",a),p.Z.typeOf.string("options.attributeSemantic",s),p.Z.typeOf.number("options.accessorId",l)),this._resourceCache=t,this._gltfResource=n,this._baseResource=r,this._gltf=i,this._bufferViewId=o,this._draco=a,this._attributeSemantic=s,this._accessorId=l,this._cacheKey=c,this._asynchronous=u,this._loadBuffer=h,this._loadTypedArray=d,this._bufferViewLoader=void 0,this._dracoLoader=void 0,this._quantization=void 0,this._typedArray=void 0,this._buffer=void 0,this._state=hx.UNLOADED,this._promise=void 0}function fe(e,t){return(0,_.Z)(e)&&(0,_.Z)(e.attributes)&&(0,_.Z)(e.attributes[t])}async function ft(e){e._state=hx.LOADING;let t=e._resourceCache;try{let i=t.getDracoLoader({gltf:e._gltf,draco:e._draco,gltfResource:e._gltfResource,baseResource:e._baseResource});if(e._dracoLoader=i,await i.load(),e.isDestroyed())return;return e._state=hx.LOADED,e}catch{if(e.isDestroyed())return;fn(e)}}async function fi(e){e._state=hx.LOADING;let t=e._resourceCache;try{let i=t.getBufferViewLoader({gltf:e._gltf,bufferViewId:e._bufferViewId,gltfResource:e._gltfResource,baseResource:e._baseResource});if(e._bufferViewLoader=i,await i.load(),e.isDestroyed())return;return e._typedArray=i.typedArray,e._state=hx.PROCESSING,e}catch(t){if(e.isDestroyed())return;fn(e,t)}}function fn(e,t){throw e.unload(),e._state=hx.FAILED,e.getError("Failed to load vertex buffer",t)}function fr(){this.typedArray=void 0,this.context=void 0,this.buffer=void 0}function fo(e,t){let i=ek.Z.createVertexBuffer({typedArray:e,context:t,usage:eV.Z.STATIC_DRAW});return i.vertexArrayDestroyable=!1,i}d4.prototype.load=async function(){return(0,_.Z)(this._promise)||(this._state=hx.LOADING,this._promise=d9(this)),this._promise},d8.prototype.set=function(e,t,i,n,r){this.gltf=e,this.textureInfo=t,this.image=i,this.mipLevels=n,this.context=r},d8.prototype.execute=function(){this.texture=d6(this.gltf,this.textureInfo,this.image,this.mipLevels,this.context)},d4.prototype.process=function(e){let t;if(p.Z.typeOf.object("frameState",e),this._state===hx.READY)return!0;if(this._state!==hx.LOADED&&this._state!==hx.PROCESSING||(0,_.Z)(this._texture)||!(0,_.Z)(this._image))return!1;if(this._state=hx.PROCESSING,this._asynchronous){if(d5.set(this._gltf,this._textureInfo,this._image,this._mipLevels,e.context),!e.jobScheduler.execute(d5,hW.Z.TEXTURE))return;t=d5.texture}else t=d6(this._gltf,this._textureInfo,this._image,this._mipLevels,e.context);return this.unload(),this._texture=t,this._state=hx.READY,this._resourceCache.statistics.addTextureLoader(this),!0},d4.prototype.unload=function(){(0,_.Z)(this._texture)&&this._texture.destroy(),(0,_.Z)(this._imageLoader)&&!this._imageLoader.isDestroyed()&&this._resourceCache.unload(this._imageLoader),this._imageLoader=void 0,this._image=void 0,this._mipLevels=void 0,this._texture=void 0,this._gltf=void 0},(0,_.Z)(Object.create)&&(d7.prototype=Object.create(hE.prototype),d7.prototype.constructor=d7),Object.defineProperties(d7.prototype,{cacheKey:{get:function(){return this._cacheKey}},buffer:{get:function(){return this._buffer}},typedArray:{get:function(){return this._typedArray}},quantization:{get:function(){return this._quantization}}}),d7.prototype.load=async function(){return(0,_.Z)(this._promise)||(fe(this._draco,this._attributeSemantic)?this._promise=ft(this):this._promise=fi(this)),this._promise},fr.prototype.set=function(e,t){this.typedArray=e,this.context=t},fr.prototype.execute=function(){this.buffer=fo(this.typedArray,this.context)};let fa=new fr;function fs(e){let t=(e=(0,m.Z)(e,m.Z.EMPTY_OBJECT)).id;p.Z.typeOf.string("options.id",t);let i=(0,m.Z)(e.properties,{}),n={};for(let e in i)if(i.hasOwnProperty(e)){let t=i[e];(0,_.Z)(t.semantic)&&(n[t.semantic]=t)}this._id=t,this._name=e.name,this._description=e.description,this._properties=i,this._propertiesBySemantic=n,this._extras=(0,uz.Z)(e.extras,!0),this._extensions=(0,uz.Z)(e.extensions,!0)}function fl(e){let t=(e=(0,m.Z)(e,m.Z.EMPTY_OBJECT)).value,i=e.name;p.Z.typeOf.number("options.value",t),p.Z.typeOf.string("options.name",i),this._value=t,this._name=i,this._description=e.description,this._extras=(0,uz.Z)(e.extras,!0),this._extensions=(0,uz.Z)(e.extensions,!0)}function fc(e){let t=(e=(0,m.Z)(e,m.Z.EMPTY_OBJECT)).id,i=e.values;p.Z.typeOf.string("options.id",t),p.Z.defined("options.values",i);let n={},r={},o=i.length;for(let e=0;e<o;++e){let t=i[e];n[t.value]=t.name,r[t.name]=t.value}let a=(0,m.Z)(e.valueType,u9.Z.UINT16);this._values=i,this._namesByValue=n,this._valuesByName=r,this._valueType=a,this._id=t,this._name=e.name,this._description=e.description,this._extras=(0,uz.Z)(e.extras,!0),this._extensions=(0,uz.Z)(e.extensions,!0)}function fu(e){e=(0,m.Z)(e,m.Z.EMPTY_OBJECT);let t=(0,m.Z)(e.classes,{}),i=(0,m.Z)(e.enums,{});this._classes=t,this._enums=i,this._id=e.id,this._name=e.name,this._description=e.description,this._version=e.version,this._extras=(0,uz.Z)(e.extras,!0),this._extensions=(0,uz.Z)(e.extensions,!0)}function fh(e){let t=(e=(0,m.Z)(e,m.Z.EMPTY_OBJECT)).schema,i=e.resource,n=e.cacheKey;if((0,_.Z)(t)===(0,_.Z)(i))throw new A.Z("One of options.schema and options.resource must be defined.");this._schema=(0,_.Z)(t)?fu.fromJson(t):void 0,this._resource=i,this._cacheKey=n,this._state=hx.UNLOADED,this._promise=void 0}async function fd(e){let t=e._resource;e._state=hx.LOADING;try{let i=await t.fetchJson();if(e.isDestroyed())return;return e._schema=fu.fromJson(i),e._state=hx.READY,e}catch(n){if(e.isDestroyed())return;e._state=hx.FAILED;let i=`Failed to load schema: ${t.url}`;throw e.getError(i,n)}}d7.prototype.process=function(e){let t;if(p.Z.typeOf.object("frameState",e),this._state===hx.READY)return!0;if(this._state!==hx.LOADED&&this._state!==hx.PROCESSING)return!1;if((0,_.Z)(this._dracoLoader)){try{if(!this._dracoLoader.process(e))return!1}catch(e){fn(this,e)}!function(e){e._state=hx.PROCESSING;let t=e._dracoLoader.decodedData.vertexAttributes[e._attributeSemantic],i=e._accessorId,n=e._gltf.accessors[i].type,r=t.array,o=t.data.quantization;(0,_.Z)(o)&&(e._quantization=function(e,t,i,n){let r=(1<<e.quantizationBits)-1,o=1/r,a=new uX.Quantization;if(a.componentDatatype=t,a.octEncoded=e.octEncoded,a.octEncodedZXY=!0,a.type=n,a.octEncoded)a.type=dH.Z.VEC2,a.normalizationRange=r;else{let t=dH.Z.getMathType(n);if(t===Number){let t=e.range;a.quantizedVolumeOffset=e.minValues[0],a.quantizedVolumeDimensions=t,a.normalizationRange=r,a.quantizedVolumeStepSize=t*o}else{a.quantizedVolumeOffset=t.unpack(e.minValues),a.normalizationRange=t.unpack(Array(i).fill(r));let n=Array(i).fill(e.range);a.quantizedVolumeDimensions=t.unpack(n);let s=n.map(function(e){return e*o});a.quantizedVolumeStepSize=t.unpack(s)}}return a}(o,t.data.componentDatatype,t.data.componentsPerAttribute,n)),e._typedArray=new Uint8Array(r.buffer,r.byteOffset,r.byteLength)}(this)}let i=this._typedArray;if(this._loadBuffer&&this._asynchronous){if(fa.set(i,e.context),!e.jobScheduler.execute(fa,hW.Z.BUFFER))return!1;t=fa.buffer}else this._loadBuffer&&(t=fo(i,e.context));return this.unload(),this._buffer=t,this._typedArray=this._loadTypedArray?i:void 0,this._state=hx.READY,this._resourceCache.statistics.addGeometryLoader(this),!0},d7.prototype.unload=function(){(0,_.Z)(this._buffer)&&this._buffer.destroy();let e=this._resourceCache;(0,_.Z)(this._bufferViewLoader)&&!this._bufferViewLoader.isDestroyed()&&e.unload(this._bufferViewLoader),(0,_.Z)(this._dracoLoader)&&e.unload(this._dracoLoader),this._bufferViewLoader=void 0,this._dracoLoader=void 0,this._typedArray=void 0,this._buffer=void 0,this._gltf=void 0},fs.fromJson=function(e){let t=(e=(0,m.Z)(e,m.Z.EMPTY_OBJECT)).id,i=e.class;p.Z.typeOf.string("options.id",t),p.Z.typeOf.object("options.class",i);let n={};for(let t in i.properties)if(i.properties.hasOwnProperty(t)){let r=ho.fromJson({id:t,property:i.properties[t],enums:e.enums});n[t]=r}return new fs({id:t,name:i.name,description:i.description,properties:n,extras:i.extras,extensions:i.extensions})},Object.defineProperties(fs.prototype,{properties:{get:function(){return this._properties}},propertiesBySemantic:{get:function(){return this._propertiesBySemantic}},id:{get:function(){return this._id}},name:{get:function(){return this._name}},description:{get:function(){return this._description}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}}),fs.BATCH_TABLE_CLASS_NAME="_batchTable",fl.fromJson=function(e){return p.Z.typeOf.object("value",e),new fl({value:e.value,name:e.name,description:e.description,extras:e.extras,extensions:e.extensions})},Object.defineProperties(fl.prototype,{value:{get:function(){return this._value}},name:{get:function(){return this._name}},description:{get:function(){return this._description}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}}),fc.fromJson=function(e){let t=(e=(0,m.Z)(e,m.Z.EMPTY_OBJECT)).id,i=e.enum;return p.Z.typeOf.string("options.id",t),p.Z.typeOf.object("options.enum",i),new fc({id:t,values:i.values.map(function(e){return fl.fromJson(e)}),valueType:u9.Z[i.valueType],name:i.name,description:i.description,extras:i.extras,extensions:i.extensions})},Object.defineProperties(fc.prototype,{values:{get:function(){return this._values}},namesByValue:{get:function(){return this._namesByValue}},valuesByName:{get:function(){return this._valuesByName}},valueType:{get:function(){return this._valueType}},id:{get:function(){return this._id}},name:{get:function(){return this._name}},description:{get:function(){return this._description}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}}),fu.fromJson=function(e){p.Z.typeOf.object("schema",e);let t={};if((0,_.Z)(e.enums))for(let i in e.enums)e.enums.hasOwnProperty(i)&&(t[i]=fc.fromJson({id:i,enum:e.enums[i]}));let i={};if((0,_.Z)(e.classes))for(let n in e.classes)e.classes.hasOwnProperty(n)&&(i[n]=fs.fromJson({id:n,class:e.classes[n],enums:t}));return new fu({id:e.id,name:e.name,description:e.description,version:e.version,classes:i,enums:t,extras:e.extras,extensions:e.extensions})},Object.defineProperties(fu.prototype,{classes:{get:function(){return this._classes}},enums:{get:function(){return this._enums}},id:{get:function(){return this._id}},name:{get:function(){return this._name}},description:{get:function(){return this._description}},version:{get:function(){return this._version}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}}),(0,_.Z)(Object.create)&&(fh.prototype=Object.create(hE.prototype),fh.prototype.constructor=fh),Object.defineProperties(fh.prototype,{cacheKey:{get:function(){return this._cacheKey}},schema:{get:function(){return this._schema}}}),fh.prototype.load=async function(){return(0,_.Z)(this._promise)||((0,_.Z)(this._schema)?this._promise=Promise.resolve(this):this._promise=fd(this)),this._promise},fh.prototype.unload=function(){this._schema=void 0};var ff=i(375);let fp={};function fm(e){return(0,ff.Z)(e.url)}function f_(e){let{byteOffset:t,byteLength:i}=e;if(hC(e,"EXT_meshopt_compression")){let n=e.extensions.EXT_meshopt_compression;t=(0,m.Z)(n.byteOffset,0),i=n.byteLength}return`${t}-${t+i}`}function fg(e,t){let i=fm(e);return`${i}-buffer-id-${t}`}function fZ(e,t,i,n){return(0,_.Z)(e.uri)?fm(n.getDerivedResource({url:e.uri})):fg(i,t)}function fy(e,t,i,n){let r=t.bufferView,o=e.bufferViews[r],a=o.buffer,s=fZ(e.buffers[a],a,i,n),l=f_(o);return`${s}-range-${l}`}function fb(e,t,i,n){let r=e.images[t],o=r.bufferView,a=r.uri;if((0,_.Z)(a))return fm(n.getDerivedResource({url:a}));let s=e.bufferViews[o],l=s.buffer,c=fZ(e.buffers[l],l,i,n),u=f_(s);return`${c}-range-${u}`}function fv(){this.geometryByteLength=0,this.texturesByteLength=0,this._geometrySizes={},this._textureSizes={}}function fT(){}function fE(e){this.referenceCount=1,this.resourceLoader=e,this._statisticsPromise=void 0}function fx(e){let{gltf:t,extension:i,extensionLegacy:n,gltfResource:r,baseResource:o,supportedImageFormats:a,frameState:s,cacheKey:l,asynchronous:c=!0}=e=(0,m.Z)(e,m.Z.EMPTY_OBJECT);if(p.Z.typeOf.object("options.gltf",t),p.Z.typeOf.object("options.gltfResource",r),p.Z.typeOf.object("options.baseResource",o),p.Z.typeOf.object("options.supportedImageFormats",a),p.Z.typeOf.object("options.frameState",s),!(0,_.Z)(e.extension)&&!(0,_.Z)(e.extensionLegacy))throw new A.Z("One of options.extension or options.extensionLegacy must be specified");this._gltfResource=r,this._baseResource=o,this._gltf=t,this._extension=i,this._extensionLegacy=n,this._supportedImageFormats=a,this._frameState=s,this._cacheKey=l,this._asynchronous=c,this._bufferViewLoaders=[],this._bufferViewIds=[],this._textureLoaders=[],this._textureIds=[],this._schemaLoader=void 0,this._structuralMetadata=void 0,this._state=hx.UNLOADED,this._promise=void 0}async function fw(e){try{let t=fS(e),i=function(e){let t;t=(0,_.Z)(e._extension)?function(e){let t={},i=e.propertyTextures;if((0,_.Z)(i))for(let e=0;e<i.length;e++){let n=i[e].properties;(0,_.Z)(n)&&function(e,t){for(let i in e)if(e.hasOwnProperty(i)){let n=e[i];t[n.index]=n}}(n,t)}return t}(e._extension):function(e){let t={},i=e.featureTextures;if((0,_.Z)(i)){for(let e in i)if(i.hasOwnProperty(e)){let n=i[e].properties;(0,_.Z)(n)&&function(e,t){for(let i in e)if(e.hasOwnProperty(i)){let n=e[i].texture;t[n.index]=n}}(n,t)}}return t}(e._extensionLegacy);let i=e._gltf,n=e._gltfResource,r=e._baseResource,o=e._supportedImageFormats,a=e._frameState,s=e._asynchronous,l=[];for(let c in t)if(t.hasOwnProperty(c)){let u=fT.getTextureLoader({gltf:i,textureInfo:t[c],gltfResource:n,baseResource:r,supportedImageFormats:o,frameState:a,asynchronous:s});e._textureLoaders.push(u),e._textureIds.push(c),l.push(u.load())}return Promise.all(l)}(e),n=fC(e);if(await Promise.all([t,i,n]),e.isDestroyed())return;return e._gltf=void 0,e._state=hx.LOADED,e}catch(t){if(e.isDestroyed())return;throw e.unload(),e._state=hx.FAILED,e.getError("Failed to load structural metadata",t)}}async function fS(e){let t;t=(0,_.Z)(e._extension)?function(e){let t=e.propertyTables,i={};if((0,_.Z)(t))for(let e=0;e<t.length;e++)!function(e,t){for(let i in e)if(e.hasOwnProperty(i)){let n=e[i],r=n.values,o=n.arrayOffsets,a=n.stringOffsets;(0,_.Z)(r)&&(t[r]=!0),(0,_.Z)(o)&&(t[o]=!0),(0,_.Z)(a)&&(t[a]=!0)}}(t[e].properties,i);return i}(e._extension):function(e){let t=e.featureTables,i={};if((0,_.Z)(t)){for(let e in t)if(t.hasOwnProperty(e)){let n=t[e].properties;(0,_.Z)(n)&&function(e,t){for(let i in e)if(e.hasOwnProperty(i)){let n=e[i],r=n.bufferView,o=n.arrayOffsetBufferView,a=n.stringOffsetBufferView;(0,_.Z)(r)&&(t[r]=!0),(0,_.Z)(o)&&(t[o]=!0),(0,_.Z)(a)&&(t[a]=!0)}}(n,i)}}return i}(e._extensionLegacy);let i=[];for(let n in t)if(t.hasOwnProperty(n)){let t=fT.getBufferViewLoader({gltf:e._gltf,bufferViewId:parseInt(n),gltfResource:e._gltfResource,baseResource:e._baseResource});e._bufferViewLoaders.push(t),e._bufferViewIds.push(n),i.push(t.load())}return Promise.all(i)}async function fC(e){let t;let i=(0,m.Z)(e._extension,e._extensionLegacy);if((0,_.Z)(i.schemaUri)){let n=e._baseResource.getDerivedResource({url:i.schemaUri});t=fT.getSchemaLoader({resource:n})}else t=fT.getSchemaLoader({schema:i.schema});if(e._schemaLoader=t,await t.load(),!t.isDestroyed())return t.schema}function fA(e){let t=e._bufferViewLoaders,i=t.length;for(let e=0;e<i;++e)fT.unload(t[e]);e._bufferViewLoaders.length=0,e._bufferViewIds.length=0}fp.getSchemaCacheKey=function(e){let{schema:t,resource:i}=e;if((0,_.Z)(t)===(0,_.Z)(i))throw new A.Z("One of options.schema and options.resource must be defined.");return(0,_.Z)(t)?`embedded-schema:${JSON.stringify(t)}`:`external-schema:${fm(i)}`},fp.getExternalBufferCacheKey=function(e){let{resource:t}=e=(0,m.Z)(e,m.Z.EMPTY_OBJECT);return p.Z.typeOf.object("options.resource",t),`external-buffer:${fm(t)}`},fp.getEmbeddedBufferCacheKey=function(e){let{parentResource:t,bufferId:i}=e=(0,m.Z)(e,m.Z.EMPTY_OBJECT);return p.Z.typeOf.object("options.parentResource",t),p.Z.typeOf.number("options.bufferId",i),`embedded-buffer:${fg(t,i)}`},fp.getGltfCacheKey=function(e){let{gltfResource:t}=e=(0,m.Z)(e,m.Z.EMPTY_OBJECT);return p.Z.typeOf.object("options.gltfResource",t),`gltf:${fm(t)}`},fp.getBufferViewCacheKey=function(e){let{gltf:t,bufferViewId:i,gltfResource:n,baseResource:r}=e=(0,m.Z)(e,m.Z.EMPTY_OBJECT);p.Z.typeOf.object("options.gltf",t),p.Z.typeOf.number("options.bufferViewId",i),p.Z.typeOf.object("options.gltfResource",n),p.Z.typeOf.object("options.baseResource",r);let o=t.bufferViews[i],a=o.buffer,s=t.buffers[a];hC(o,"EXT_meshopt_compression")&&(a=o.extensions.EXT_meshopt_compression.buffer);let l=fZ(s,a,n,r),c=f_(o);return`buffer-view:${l}-range-${c}`},fp.getDracoCacheKey=function(e){let{gltf:t,draco:i,gltfResource:n,baseResource:r}=e=(0,m.Z)(e,m.Z.EMPTY_OBJECT);return p.Z.typeOf.object("options.gltf",t),p.Z.typeOf.object("options.draco",i),p.Z.typeOf.object("options.gltfResource",n),p.Z.typeOf.object("options.baseResource",r),`draco:${fy(t,i,n,r)}`},fp.getVertexBufferCacheKey=function(e){let{gltf:t,gltfResource:i,baseResource:n,frameState:r,bufferViewId:o,draco:a,attributeSemantic:s,dequantize:l=!1,loadBuffer:c=!1,loadTypedArray:u=!1}=e=(0,m.Z)(e,m.Z.EMPTY_OBJECT);p.Z.typeOf.object("options.gltf",t),p.Z.typeOf.object("options.gltfResource",i),p.Z.typeOf.object("options.baseResource",n),p.Z.typeOf.object("options.frameState",r);let h=(0,_.Z)(o),d=(0,_.Z)(a)&&(0,_.Z)(a.attributes)&&(0,_.Z)(a.attributes[s]),f=(0,_.Z)(s);if(h===d)throw new A.Z("One of options.bufferViewId and options.draco must be defined.");if(d&&!f)throw new A.Z("When options.draco is defined options.attributeSemantic must also be defined.");if(d&&(p.Z.typeOf.object("options.draco",a),p.Z.typeOf.string("options.attributeSemantic",s)),!c&&!u)throw new A.Z("At least one of loadBuffer and loadTypedArray must be true.");let g="";if(l&&(g+="-dequantize"),c&&(g+=`-buffer-context-${r.context.id}`),u&&(g+="-typed-array"),(0,_.Z)(a)){let e=fy(t,a,i,n);return`vertex-buffer:${e}-draco-${s}${g}`}let Z=t.bufferViews[o],y=Z.buffer,b=fZ(t.buffers[y],y,i,n),v=f_(Z);return`vertex-buffer:${b}-range-${v}${g}`},fp.getIndexBufferCacheKey=function(e){let{gltf:t,accessorId:i,gltfResource:n,baseResource:r,frameState:o,draco:a,loadBuffer:s=!1,loadTypedArray:l=!1}=e=(0,m.Z)(e,m.Z.EMPTY_OBJECT);if(p.Z.typeOf.object("options.gltf",t),p.Z.typeOf.number("options.accessorId",i),p.Z.typeOf.object("options.gltfResource",n),p.Z.typeOf.object("options.baseResource",r),p.Z.typeOf.object("options.frameState",o),!s&&!l)throw new A.Z("At least one of loadBuffer and loadTypedArray must be true.");let c="";if(s&&(c+=`-buffer-context-${o.context.id}`),l&&(c+="-typed-array"),(0,_.Z)(a)){let e=fy(t,a,n,r);return`index-buffer:${e}-draco${c}`}let u=t.accessors[i],h=u.bufferView,d=t.bufferViews[h],f=d.buffer,g=fZ(t.buffers[f],f,n,r),Z=function(e,t){let i=t.byteOffset+e.byteOffset,{componentType:n,type:r,count:o}=e;return`${i}-${n}-${r}-${o}`}(u,d);return`index-buffer:${g}-accessor-${Z}${c}`},fp.getImageCacheKey=function(e){let{gltf:t,imageId:i,gltfResource:n,baseResource:r}=e=(0,m.Z)(e,m.Z.EMPTY_OBJECT);p.Z.typeOf.object("options.gltf",t),p.Z.typeOf.number("options.imageId",i),p.Z.typeOf.object("options.gltfResource",n),p.Z.typeOf.object("options.baseResource",r);let o=fb(t,i,n,r);return`image:${o}`},fp.getTextureCacheKey=function(e){let{gltf:t,textureInfo:i,gltfResource:n,baseResource:r,supportedImageFormats:o,frameState:a}=e=(0,m.Z)(e,m.Z.EMPTY_OBJECT);p.Z.typeOf.object("options.gltf",t),p.Z.typeOf.object("options.textureInfo",i),p.Z.typeOf.object("options.gltfResource",n),p.Z.typeOf.object("options.baseResource",r),p.Z.typeOf.object("options.supportedImageFormats",o),p.Z.typeOf.object("options.frameState",a);let s=i.index,l=u3.getImageIdFromTexture({gltf:t,textureId:s,supportedImageFormats:o}),c=fb(t,l,n,r),u=function(e,t){let i=u3.createSampler({gltf:e,textureInfo:t});return`${i.wrapS}-${i.wrapT}-${i.minificationFilter}-${i.magnificationFilter}`}(t,i);return`texture:${c}-sampler-${u}-context-${a.context.id}`},fv.prototype.clear=function(){this.geometryByteLength=0,this.texturesByteLength=0,this._geometrySizes={},this._textureSizes={}},fv.prototype.addGeometryLoader=function(e){p.Z.typeOf.object("loader",e);let t=e.cacheKey;if(this._geometrySizes.hasOwnProperty(t))return;this._geometrySizes[t]=0;let i=e.buffer,n=e.typedArray,r=0;(0,_.Z)(i)&&(r+=i.sizeInBytes),(0,_.Z)(n)&&(r+=n.byteLength),this.geometryByteLength+=r,this._geometrySizes[t]=r},fv.prototype.addTextureLoader=function(e){p.Z.typeOf.object("loader",e);let t=e.cacheKey;if(this._textureSizes.hasOwnProperty(t))return;this._textureSizes[t]=0;let i=e.texture.sizeInBytes;this.texturesByteLength+=e.texture.sizeInBytes,this._textureSizes[t]=i},fv.prototype.removeLoader=function(e){p.Z.typeOf.object("loader",e);let t=e.cacheKey,i=this._geometrySizes[t];delete this._geometrySizes[t],(0,_.Z)(i)&&(this.geometryByteLength-=i);let n=this._textureSizes[t];delete this._textureSizes[t],(0,_.Z)(n)&&(this.texturesByteLength-=n)},fT.cacheEntries={},fT.statistics=new fv,fT.get=function(e){p.Z.typeOf.string("cacheKey",e);let t=fT.cacheEntries[e];if((0,_.Z)(t))return++t.referenceCount,t.resourceLoader},fT.add=function(e){p.Z.typeOf.object("resourceLoader",e);let t=e.cacheKey;if(p.Z.typeOf.string("options.resourceLoader.cacheKey",t),(0,_.Z)(fT.cacheEntries[t]))throw new A.Z(`Resource with this cacheKey is already in the cache: ${t}`);return fT.cacheEntries[t]=new fE(e),e},fT.unload=function(e){p.Z.typeOf.object("resourceLoader",e);let t=e.cacheKey,i=fT.cacheEntries[t];if(!(0,_.Z)(i))throw new A.Z(`Resource is not in the cache: ${t}`);--i.referenceCount,0===i.referenceCount&&(fT.statistics.removeLoader(e),e.destroy(),delete fT.cacheEntries[t])},fT.getSchemaLoader=function(e){let{schema:t,resource:i}=e=(0,m.Z)(e,m.Z.EMPTY_OBJECT);if((0,_.Z)(t)===(0,_.Z)(i))throw new A.Z("One of options.schema and options.resource must be defined.");let n=fp.getSchemaCacheKey({schema:t,resource:i}),r=fT.get(n);return(0,_.Z)(r)?r:(r=new fh({schema:t,resource:i,cacheKey:n}),fT.add(r))},fT.getEmbeddedBufferLoader=function(e){let{parentResource:t,bufferId:i,typedArray:n}=e=(0,m.Z)(e,m.Z.EMPTY_OBJECT);p.Z.typeOf.object("options.parentResource",t),p.Z.typeOf.number("options.bufferId",i);let r=fp.getEmbeddedBufferCacheKey({parentResource:t,bufferId:i}),o=fT.get(r);return(0,_.Z)(o)?o:(p.Z.typeOf.object("options.typedArray",n),o=new hw({typedArray:n,cacheKey:r}),fT.add(o))},fT.getExternalBufferLoader=function(e){let{resource:t}=e=(0,m.Z)(e,m.Z.EMPTY_OBJECT);p.Z.typeOf.object("options.resource",t);let i=fp.getExternalBufferCacheKey({resource:t}),n=fT.get(i);return(0,_.Z)(n)?n:(n=new hw({resource:t,cacheKey:i}),fT.add(n))},fT.getGltfJsonLoader=function(e){let{gltfResource:t,baseResource:i,typedArray:n,gltfJson:r}=e=(0,m.Z)(e,m.Z.EMPTY_OBJECT);p.Z.typeOf.object("options.gltfResource",t),p.Z.typeOf.object("options.baseResource",i);let o=fp.getGltfCacheKey({gltfResource:t}),a=fT.get(o);return(0,_.Z)(a)?a:(a=new dK({resourceCache:fT,gltfResource:t,baseResource:i,typedArray:n,gltfJson:r,cacheKey:o}),fT.add(a))},fT.getBufferViewLoader=function(e){let{gltf:t,bufferViewId:i,gltfResource:n,baseResource:r}=e=(0,m.Z)(e,m.Z.EMPTY_OBJECT);p.Z.typeOf.object("options.gltf",t),p.Z.typeOf.number("options.bufferViewId",i),p.Z.typeOf.object("options.gltfResource",n),p.Z.typeOf.object("options.baseResource",r);let o=fp.getBufferViewCacheKey({gltf:t,bufferViewId:i,gltfResource:n,baseResource:r}),a=fT.get(o);return(0,_.Z)(a)?a:(a=new hI({resourceCache:fT,gltf:t,bufferViewId:i,gltfResource:n,baseResource:r,cacheKey:o}),fT.add(a))},fT.getDracoLoader=function(e){let{gltf:t,draco:i,gltfResource:n,baseResource:r}=e=(0,m.Z)(e,m.Z.EMPTY_OBJECT);p.Z.typeOf.object("options.gltf",t),p.Z.typeOf.object("options.draco",i),p.Z.typeOf.object("options.gltfResource",n),p.Z.typeOf.object("options.baseResource",r);let o=fp.getDracoCacheKey({gltf:t,draco:i,gltfResource:n,baseResource:r}),a=fT.get(o);return(0,_.Z)(a)?a:(a=new hR({resourceCache:fT,gltf:t,draco:i,gltfResource:n,baseResource:r,cacheKey:o}),fT.add(a))},fT.getVertexBufferLoader=function(e){let{gltf:t,gltfResource:i,baseResource:n,frameState:r,bufferViewId:o,draco:a,attributeSemantic:s,accessorId:l,asynchronous:c=!0,dequantize:u=!1,loadBuffer:h=!1,loadTypedArray:d=!1}=e=(0,m.Z)(e,m.Z.EMPTY_OBJECT);if(p.Z.typeOf.object("options.gltf",t),p.Z.typeOf.object("options.gltfResource",i),p.Z.typeOf.object("options.baseResource",n),p.Z.typeOf.object("options.frameState",r),!h&&!d)throw new A.Z("At least one of loadBuffer and loadTypedArray must be true.");let f=(0,_.Z)(o),g=(0,_.Z)(a)&&(0,_.Z)(a.attributes)&&(0,_.Z)(a.attributes[s]),Z=(0,_.Z)(s),y=(0,_.Z)(l);if(f===g)throw new A.Z("One of options.bufferViewId and options.draco must be defined.");if(g&&!Z)throw new A.Z("When options.draco is defined options.attributeSemantic must also be defined.");if(g&&!y)throw new A.Z("When options.draco is defined options.haAccessorId must also be defined.");g&&(p.Z.typeOf.object("options.draco",a),p.Z.typeOf.string("options.attributeSemantic",s),p.Z.typeOf.number("options.accessorId",l));let b=fp.getVertexBufferCacheKey({gltf:t,gltfResource:i,baseResource:n,frameState:r,bufferViewId:o,draco:a,attributeSemantic:s,dequantize:u,loadBuffer:h,loadTypedArray:d}),v=fT.get(b);return(0,_.Z)(v)?v:(v=new d7({resourceCache:fT,gltf:t,gltfResource:i,baseResource:n,bufferViewId:o,draco:a,attributeSemantic:s,accessorId:l,cacheKey:b,asynchronous:c,dequantize:u,loadBuffer:h,loadTypedArray:d}),fT.add(v))},fT.getIndexBufferLoader=function(e){let{gltf:t,accessorId:i,gltfResource:n,baseResource:r,frameState:o,draco:a,asynchronous:s=!0,loadBuffer:l=!1,loadTypedArray:c=!1}=e=(0,m.Z)(e,m.Z.EMPTY_OBJECT);if(p.Z.typeOf.object("options.gltf",t),p.Z.typeOf.number("options.accessorId",i),p.Z.typeOf.object("options.gltfResource",n),p.Z.typeOf.object("options.baseResource",r),p.Z.typeOf.object("options.frameState",o),!l&&!c)throw new A.Z("At least one of loadBuffer and loadTypedArray must be true.");let u=fp.getIndexBufferCacheKey({gltf:t,accessorId:i,gltfResource:n,baseResource:r,frameState:o,draco:a,loadBuffer:l,loadTypedArray:c}),h=fT.get(u);return(0,_.Z)(h)?h:(h=new hq({resourceCache:fT,gltf:t,accessorId:i,gltfResource:n,baseResource:r,draco:a,cacheKey:u,asynchronous:s,loadBuffer:l,loadTypedArray:c}),fT.add(h))},fT.getImageLoader=function(e){let{gltf:t,imageId:i,gltfResource:n,baseResource:r}=e=(0,m.Z)(e,m.Z.EMPTY_OBJECT);p.Z.typeOf.object("options.gltf",t),p.Z.typeOf.number("options.imageId",i),p.Z.typeOf.object("options.gltfResource",n),p.Z.typeOf.object("options.baseResource",r);let o=fp.getImageCacheKey({gltf:t,imageId:i,gltfResource:n,baseResource:r}),a=fT.get(o);return(0,_.Z)(a)?a:(a=new hz({resourceCache:fT,gltf:t,imageId:i,gltfResource:n,baseResource:r,cacheKey:o}),fT.add(a))},fT.getTextureLoader=function(e){let{gltf:t,textureInfo:i,gltfResource:n,baseResource:r,supportedImageFormats:o,frameState:a,asynchronous:s=!0}=e=(0,m.Z)(e,m.Z.EMPTY_OBJECT);p.Z.typeOf.object("options.gltf",t),p.Z.typeOf.object("options.textureInfo",i),p.Z.typeOf.object("options.gltfResource",n),p.Z.typeOf.object("options.baseResource",r),p.Z.typeOf.object("options.supportedImageFormats",o),p.Z.typeOf.object("options.frameState",a);let l=fp.getTextureCacheKey({gltf:t,textureInfo:i,gltfResource:n,baseResource:r,supportedImageFormats:o,frameState:a}),c=fT.get(l);return(0,_.Z)(c)?c:(c=new d4({resourceCache:fT,gltf:t,textureInfo:i,gltfResource:n,baseResource:r,supportedImageFormats:o,cacheKey:l,asynchronous:s}),fT.add(c))},fT.clearForSpecs=function(){let e;let t=[d7,hq,hR,d4,hz,hI,hw,fh,dK],i=fT.cacheEntries,n=[];for(e in i)i.hasOwnProperty(e)&&n.push(i[e]);n.sort(function(e,i){return t.indexOf(e.resourceLoader.constructor)-t.indexOf(i.resourceLoader.constructor)});let r=n.length;for(let t=0;t<r;++t){let r=n[t];e=r.resourceLoader.cacheKey,(0,_.Z)(i[e])&&(r.resourceLoader.destroy(),delete i[e])}fT.statistics.clear()},(0,_.Z)(Object.create)&&(fx.prototype=Object.create(hE.prototype),fx.prototype.constructor=fx),Object.defineProperties(fx.prototype,{cacheKey:{get:function(){return this._cacheKey}},structuralMetadata:{get:function(){return this._structuralMetadata}}}),fx.prototype.load=function(){return(0,_.Z)(this._promise)||(this._state=hx.LOADING,this._promise=fw(this)),this._promise},fx.prototype.process=function(e){if(p.Z.typeOf.object("frameState",e),this._state===hx.READY)return!0;if(this._state!==hx.LOADED)return!1;let t=this._textureLoaders,i=t.length,n=!0;for(let r=0;r<i;++r){let i=t[r].process(e);n=n&&i}if(!n)return!1;let r=this._schemaLoader.schema,o={};for(let e=0;e<this._bufferViewIds.length;++e){let t=this._bufferViewIds[e],i=this._bufferViewLoaders[e];if(!i.isDestroyed()){let e=new Uint8Array(i.typedArray);o[t]=e}}let a={};for(let e=0;e<this._textureIds.length;++e){let i=this._textureIds[e],n=t[e];n.isDestroyed()||(a[i]=n.texture)}return(0,_.Z)(this._extension)?this._structuralMetadata=hb({extension:this._extension,schema:r,bufferViews:o,textures:a}):this._structuralMetadata=hT({extension:this._extensionLegacy,schema:r,bufferViews:o,textures:a}),fA(this),this._state=hx.READY,!0},fx.prototype.unload=function(){fA(this),function(e){let t=e._textureLoaders,i=t.length;for(let e=0;e<i;++e)fT.unload(t[e]);e._textureLoaders.length=0,e._textureIds.length=0}(this),(0,_.Z)(this._schemaLoader)&&fT.unload(this._schemaLoader),this._schemaLoader=void 0,this._structuralMetadata=void 0};let fI={TRANSLATION:"TRANSLATION",ROTATION:"ROTATION",SCALE:"SCALE",FEATURE_ID:"_FEATURE_ID"};fI.fromGltfSemantic=function(e){p.Z.typeOf.string("gltfSemantic",e);let t=e,i=/^(\w+)_\d+$/.exec(e);switch(null!==i&&(t=i[1]),t){case"TRANSLATION":return fI.TRANSLATION;case"ROTATION":return fI.ROTATION;case"SCALE":return fI.SCALE;case"_FEATURE_ID":return fI.FEATURE_ID}};var fO=Object.freeze(fI);function fD(e){let t=(e=(0,m.Z)(e,m.Z.EMPTY_OBJECT)).triangleIndices,i=e.outlineIndices,n=e.originalVertexCount;p.Z.typeOf.object("options.triangleIndices",t),p.Z.typeOf.object("options.outlineIndices",i),p.Z.typeOf.number("options.originalVertexCount",n),this._triangleIndices=t,this._originalVertexCount=n,this._edges=new fM(i,n),this._outlineCoordinatesTypedArray=void 0,this._extraVertices=[],function(e){let t=e._triangleIndices,i=e._edges,n=[],r=e._extraVertices,o=e._originalVertexCount,a={};for(let e=0;e<t.length;e+=3){let s=t[e],l=t[e+1],c=t[e+2],u=i.hasEdge(s,l),h=i.hasEdge(l,c),d=i.hasEdge(c,s),f=fP(n,s,l,c,u,h,d);for(;(0,_.Z)(f);){let i=a[f];if(!(0,_.Z)(i)){i=o+r.length;let e=f;for(;e>=o;)e=r[e-o];r.push(e),a[f]=i}i>65534&&(t instanceof Uint16Array||t instanceof Uint8Array)?t=new Uint32Array(t):i>255&&t instanceof Uint8Array&&(t=new Uint16Array(t)),f===s?(s=i,t[e]=i):f===l?(l=i,t[e+1]=i):(c=i,t[e+2]=i),f=fP(n,s,l,c,u,h,d)}}e._triangleIndices=t,e._outlineCoordinatesTypedArray=new Float32Array(n)}(this)}function fP(e,t,i,n,r,o,a){let s,l,c;let u=a?1:0,h=r?1:0,d=fR(e,t,u,h,0);if(0===d)return t;let f=r?1:0,p=o?1:0,m=fR(e,i,0,f,p);if(0===m)return i;let _=a?1:0,g=o?1:0,Z=fR(e,n,_,0,g);if(0===Z)return n;let y=d&m&Z;if(1&y)s=0,l=1,c=2;else if(2&y)s=0,c=1,l=2;else if(4&y)l=0,s=1,c=2;else if(8&y)l=0,c=1,s=2;else if(16&y)c=0,s=1,l=2;else if(32&y)c=0,l=1,s=2;else{let e=fN(d),r=fN(m),o=fN(Z);return e<r&&e<o?t:r<o?i:n}let b=3*t;e[b+s]=u,e[b+l]=h,e[b+c]=0;let v=3*i;e[v+s]=0,e[v+l]=f,e[v+c]=p;let T=3*n;e[T+s]=_,e[T+l]=0,e[T+c]=g}function fR(e,t,i,n,r){let o=3*t,a=e[o],s=e[o+1],l=e[o+2];return(0,_.Z)(a)?(a===i&&s===n&&l===r)<<0|(a===i&&s===r&&l===n)<<1|(a===n&&s===i&&l===r)<<2|(a===n&&s===r&&l===i)<<3|(a===r&&s===i&&l===n)<<4|(a===r&&s===n&&l===i)<<5:63}function fN(e){return(1&e)+(e>>1&1)+(e>>2&1)+(e>>3&1)+(e>>4&1)+(e>>5&1)}function fL(e){let t=new Uint8Array(e);return t[e-1]=192,8===e?t[e-1]=96:4===e?t[e-1]=48:2===e?t[e-1]=24:1===e&&(t[e-1]=12),t}function fM(e,t){this._originalVertexCount=t,this._edges=new Set;for(let t=0;t<e.length;t+=2){let i=e[t],n=e[t+1],r=Math.min(i,n),o=Math.max(i,n),a=r*this._originalVertexCount+o;this._edges.add(a)}}function fF(e){p.Z.typeOf.object("attribute",e),this.attribute=e,this.loadBuffer=!1,this.loadTypedArray=!1}function fz(e){p.Z.typeOf.object("primitive",e),this.primitive=e,this.attributePlans=[],this.indicesPlan=void 0,this.needsOutlines=!1,this.outlineIndices=void 0}Object.defineProperties(fD.prototype,{updatedTriangleIndices:{get:function(){return this._triangleIndices}},outlineCoordinates:{get:function(){return this._outlineCoordinatesTypedArray}}}),fD.prototype.updateAttribute=function(e){let t=this._extraVertices,i=e.length,n=i/this._originalVertexCount,r=t.length,o=new e.constructor(e.length+r*n);o.set(e);for(let e=0;e<r;e++){let r=t[e]*n,a=i+e*n;for(let e=0;e<n;e++)o[a+e]=o[r+e]}return o},fD.createTexture=function(e){let t=e.cache.modelOutliningCache;if((0,_.Z)(t)||(t=e.cache.modelOutliningCache={}),(0,_.Z)(t.outlineTexture))return t.outlineTexture;let i=Math.min(4096,eH.Z.maximumTextureSize),n=i,r=fL(n),o=[];for(;n>1;)n>>=1,o.push(fL(n));let a=new e5.Z({context:e,source:{arrayBufferView:r,mipLevels:o},width:i,height:1,pixelFormat:e2.Z.LUMINANCE,sampler:new uN.Z({wrapS:uq.Z.CLAMP_TO_EDGE,wrapT:uq.Z.CLAMP_TO_EDGE,minificationFilter:uW.Z.LINEAR_MIPMAP_LINEAR,magnificationFilter:uj.Z.LINEAR})});return t.outlineTexture=a,a},fM.prototype.hasEdge=function(e,t){let i=Math.min(e,t)*this._originalVertexCount+Math.max(e,t);return this._edges.has(i)},fz.prototype.postProcess=function(e){this.needsOutlines&&(function(e){let t=e.primitive,i=t.indices,n=t.attributes[0].count,r=new fD({triangleIndices:i.typedArray,outlineIndices:e.outlineIndices,originalVertexCount:n});i.typedArray=r.updatedTriangleIndices,i.indexDatatype=ez.Z.fromTypedArray(i.typedArray);let o=new fF(function(e){let t=new uX.Attribute;return t.name="_OUTLINE_COORDINATES",t.typedArray=e,t.componentDatatype=eM.Z.FLOAT,t.type=dH.Z.VEC3,t.normalized=!1,t.count=e.length/3,t}(r.outlineCoordinates));o.loadBuffer=!0,o.loadTypedArray=!1,e.attributePlans.push(o),t.outlineCoordinates=o.attribute;let a=e.attributePlans,s=e.attributePlans.length;for(let e=0;e<s;e++){let t=a[e].attribute;t.typedArray=r.updateAttribute(t.typedArray)}}(this),function(e,t){let i=e.length;for(let n=0;n<i;n++){let i=e[n],r=i.attribute,o=r.typedArray;if(i.loadBuffer){let e=ek.Z.createVertexBuffer({typedArray:o,context:t,usage:eV.Z.STATIC_DRAW});e.vertexArrayDestroyable=!1,r.buffer=e}i.loadTypedArray||(r.typedArray=void 0)}}(this.attributePlans,e),(0,_.Z)(this.indicesPlan)&&function(e,t){let i=e.indices;if(e.loadBuffer){let e=ek.Z.createIndexBuffer({typedArray:i.typedArray,context:t,usage:eV.Z.STATIC_DRAW,indexDatatype:i.indexDatatype});i.buffer=e,e.vertexArrayDestroyable=!1}e.loadTypedArray||(i.typedArray=void 0)}(this.indicesPlan,e))},fz.AttributeLoadPlan=fF,fz.IndicesLoadPlan=function(e){p.Z.typeOf.object("indices",e),this.indices=e,this.loadBuffer=!1,this.loadTypedArray=!1};var fB=function(e){e=(0,m.Z)(e,m.Z.EMPTY_OBJECT),this.webp=(0,m.Z)(e.webp,!1),this.basis=(0,m.Z)(e.basis,!1)};let{Attribute:fU,Indices:fk,FeatureIdAttribute:fV,FeatureIdTexture:fH,FeatureIdImplicitRange:fG,MorphTarget:fj,Primitive:fW,Instances:fq,Skin:fY,Node:fX,AnimatedPropertyType:f$,AnimationSampler:fK,AnimationTarget:fQ,AnimationChannel:fJ,Animation:f0,ArticulationStage:f1,Articulation:f2,Asset:f3,Scene:f4,Components:f5,MetallicRoughness:f9,SpecularGlossiness:f8,Specular:f6,Anisotropy:f7,Clearcoat:pe,Material:pt}=uX,pi={NOT_LOADED:0,LOADING:1,LOADED:2,PROCESSING:3,POST_PROCESSING:4,PROCESSED:5,READY:6,FAILED:7,UNLOADED:8};function pn(e){let{gltfResource:t,typedArray:i,releaseGltfJson:n=!1,asynchronous:r=!0,incrementallyLoadTextures:o=!0,upAxis:a=dV.Z.Y,forwardAxis:s=dV.Z.Z,loadAttributesAsTypedArray:l=!1,loadAttributesFor2D:c=!1,enablePick:u=!1,loadIndicesForWireframe:h=!1,loadPrimitiveOutline:d=!0,loadForClassification:f=!1,renameBatchIdSemantic:_=!1}=e=(0,m.Z)(e,m.Z.EMPTY_OBJECT);p.Z.typeOf.object("options.gltfResource",t);let{baseResource:g=t.clone()}=e;this._gltfJson=e.gltfJson,this._gltfResource=t,this._baseResource=g,this._typedArray=i,this._releaseGltfJson=n,this._asynchronous=r,this._incrementallyLoadTextures=o,this._upAxis=a,this._forwardAxis=s,this._loadAttributesAsTypedArray=l,this._loadAttributesFor2D=c,this._enablePick=u,this._loadIndicesForWireframe=h,this._loadPrimitiveOutline=d,this._loadForClassification=f,this._renameBatchIdSemantic=_,this._sortedPropertyTableIds=void 0,this._sortedFeatureTextureIds=void 0,this._gltfJsonLoader=void 0,this._state=pi.NOT_LOADED,this._textureState=pi.NOT_LOADED,this._promise=void 0,this._processError=void 0,this._textureErrors=[],this._primitiveLoadPlans=[],this._loaderPromises=[],this._textureLoaders=[],this._texturesPromises=[],this._textureCallbacks=[],this._bufferViewLoaders=[],this._geometryLoaders=[],this._geometryCallbacks=[],this._structuralMetadataLoader=void 0,this._loadResourcesPromise=void 0,this._resourcesLoaded=!1,this._texturesLoaded=!1,this._supportedImageFormats=void 0,this._postProcessBuffers=[],this._components=void 0}async function pr(e){e._state=pi.LOADING,e._textureState=pi.LOADING;try{let t=fT.getGltfJsonLoader({gltfResource:e._gltfResource,baseResource:e._baseResource,typedArray:e._typedArray,gltfJson:e._gltfJson});if(e._gltfJsonLoader=t,await t.load(),e.isDestroyed()||e.isUnloaded()||t.isDestroyed())return;return e._state=pi.LOADED,e._textureState=pi.LOADED,e}catch(t){if(e.isDestroyed())return;e._state=pi.FAILED,e._textureState=pi.FAILED,pa(e,t)}}async function po(e,t){uP.Z.supportsWebP.initialized||await uP.Z.supportsWebP.initialize(),e._supportedImageFormats=new fB({webp:uP.Z.supportsWebP(),basis:t.context.supportsBasis});let i=function(e,t){let i=e.gltfJson,n=(0,m.Z)(i.extensions,m.Z.EMPTY_OBJECT),r=n.EXT_structural_metadata,o=n.EXT_feature_metadata,a=n.CESIUM_RTC;if((0,_.Z)(o)){let t=o.featureTables,i=o.featureTextures,n=(0,_.Z)(t)?t:[],r=(0,_.Z)(i)?i:[];e._sortedPropertyTableIds=Object.keys(n).sort(),e._sortedFeatureTextureIds=Object.keys(r).sort()}let s=function(e,t){let i=e.gltfJson.nodes;if(!(0,_.Z)(i))return[];let n=i.map(function(i,n){let r=function(e,t,i){let n=new fX;n.name=t.name,n.matrix=pu(er.Z,t.matrix),n.translation=pu(S.Z,t.translation),n.rotation=pu(n5.Z,t.rotation),n.scale=pu(S.Z,t.scale);let r=(0,m.Z)(t.extensions,m.Z.EMPTY_OBJECT),o=r.EXT_mesh_gpu_instancing,a=r.AGI_articulations;if((0,_.Z)(o)){if(e._loadForClassification)throw new e3.Z("Models with the EXT_mesh_gpu_instancing extension cannot be used for classification.");n.instances=function(e,t,i){let n=t.EXT_mesh_gpu_instancing,r=new fq,o=n.attributes;if((0,_.Z)(o))for(let t in o){if(!o.hasOwnProperty(t))continue;let n=o[t];r.attributes.push(function(e,t,i,n,r){let o=e.gltfJson.accessors,a=(0,_.Z)(i.ROTATION),s=(0,_.Z)(i.TRANSLATION)&&(0,_.Z)(o[i.TRANSLATION].min)&&(0,_.Z)(o[i.TRANSLATION].max),l=pp(e,fO,n),c=l.modelSemantic,u=c===fO.TRANSLATION||c===fO.ROTATION||c===fO.SCALE,h=c===fO.TRANSLATION,d=e._loadAttributesAsTypedArray||a&&u||!r.context.instancedArrays,f=e._enablePick&&!r.context.webgl2,p=e._loadAttributesFor2D&&!r.scene3DOnly;return pm(e,t,l,void 0,!d,d||h&&(!s||p||f),r)}(e,n,o,t,i))}let a=(0,m.Z)(n.extensions,m.Z.EMPTY_OBJECT),s=t.EXT_instance_features,l=a.EXT_feature_metadata;return(0,_.Z)(s)?function(e,t){let i=t.featureIds;for(let t=0;t<i.length;t++){let n;let r=i[t],o=`instanceFeatureId_${t}`;n=(0,_.Z)(r.attribute)?pZ(r,o):pb(r,o),e.featureIds.push(n)}}(r,s):(0,_.Z)(l)&&function(e,t,i,n){let r=e.extensions.EXT_feature_metadata.featureTables,o=i.featureIdAttributes;if((0,_.Z)(o))for(let e=0;e<o.length;++e){let i;let a=o[e],s=a.featureTable,l=n.indexOf(s),c=r[s].count,u=`instanceFeatureId_${e}`;i=(0,_.Z)(a.featureIds.attribute)?py(a,l,c,u):pv(a,l,c,u),t.featureIds.push(i)}}(e.gltfJson,r,l,e._sortedPropertyTableIds),r}(e,r,i)}(0,_.Z)(a)&&(n.articulationName=a.articulationName);let s=t.mesh;if((0,_.Z)(s)){let r=e.gltfJson.meshes[s],o=r.primitives;for(let t=0;t<o.length;++t)n.primitives.push(function(e,t,i,n){let r=new fW,o=new fz(r);e._primitiveLoadPlans.push(o);let a=t.material;(0,_.Z)(a)&&(r.material=function(e,t,i){let n=new pt,r=(0,m.Z)(t.extensions,m.Z.EMPTY_OBJECT),o=r.KHR_materials_pbrSpecularGlossiness,a=r.KHR_materials_specular,s=r.KHR_materials_anisotropy,l=r.KHR_materials_clearcoat,c=t.pbrMetallicRoughness;return n.unlit=(0,_.Z)(r.KHR_materials_unlit),(0,_.Z)(o)?n.specularGlossiness=function(e,t,i){let{diffuseTexture:n,specularGlossinessTexture:r,diffuseFactor:o,specularFactor:a,glossinessFactor:s}=t,l=new f8;return(0,_.Z)(n)&&(l.diffuseTexture=pg(e,n,i)),(0,_.Z)(r)&&(l.specularGlossinessTexture=pg(e,r,i)),l.diffuseFactor=pu(eo.Z,o),l.specularFactor=pu(S.Z,a),l.glossinessFactor=s,l}(e,o,i):((0,_.Z)(c)&&(n.metallicRoughness=function(e,t,i){let{baseColorTexture:n,metallicRoughnessTexture:r,baseColorFactor:o,metallicFactor:a,roughnessFactor:s}=t,l=new f9;return(0,_.Z)(n)&&(l.baseColorTexture=pg(e,n,i)),(0,_.Z)(r)&&(l.metallicRoughnessTexture=pg(e,r,i)),l.baseColorFactor=pu(eo.Z,o),l.metallicFactor=a,l.roughnessFactor=s,l}(e,c,i)),(0,_.Z)(a)&&!n.unlit&&(n.specular=function(e,t,i){let{specularFactor:n,specularTexture:r,specularColorFactor:o,specularColorTexture:a}=t,s=new f6;return(0,_.Z)(r)&&(s.specularTexture=pg(e,r,i)),(0,_.Z)(a)&&(s.specularColorTexture=pg(e,a,i)),s.specularFactor=n,s.specularColorFactor=pu(S.Z,o),s}(e,a,i)),(0,_.Z)(s)&&!n.unlit&&(n.anisotropy=function(e,t,i){let{anisotropyStrength:n=f7.DEFAULT_ANISOTROPY_STRENGTH,anisotropyRotation:r=f7.DEFAULT_ANISOTROPY_ROTATION,anisotropyTexture:o}=t,a=new f7;return(0,_.Z)(o)&&(a.anisotropyTexture=pg(e,o,i)),a.anisotropyStrength=n,a.anisotropyRotation=r,a}(e,s,i)),(0,_.Z)(l)&&!n.unlit&&(n.clearcoat=function(e,t,i){let{clearcoatFactor:n=pe.DEFAULT_CLEARCOAT_FACTOR,clearcoatTexture:r,clearcoatRoughnessFactor:o=pe.DEFAULT_CLEARCOAT_ROUGHNESS_FACTOR,clearcoatRoughnessTexture:a,clearcoatNormalTexture:s}=t,l=new pe;return(0,_.Z)(r)&&(l.clearcoatTexture=pg(e,r,i)),(0,_.Z)(a)&&(l.clearcoatRoughnessTexture=pg(e,a,i)),(0,_.Z)(s)&&(l.clearcoatNormalTexture=pg(e,s,i)),l.clearcoatFactor=n,l.clearcoatRoughnessFactor=o,l}(e,l,i))),(0,_.Z)(t.emissiveTexture)&&(n.emissiveTexture=pg(e,t.emissiveTexture,i)),(0,_.Z)(t.normalTexture)&&!e._loadForClassification&&(n.normalTexture=pg(e,t.normalTexture,i)),(0,_.Z)(t.occlusionTexture)&&(n.occlusionTexture=pg(e,t.occlusionTexture,i)),n.emissiveFactor=pu(S.Z,t.emissiveFactor),n.alphaMode=t.alphaMode,n.alphaCutoff=t.alphaCutoff,n.doubleSided=t.doubleSided,n}(e,e.gltfJson.materials[a],n));let s=(0,m.Z)(t.extensions,m.Z.EMPTY_OBJECT),l=!1,c=s.CESIUM_primitive_outline;e._loadPrimitiveOutline&&(0,_.Z)(c)&&(l=!0,o.needsOutlines=!0,o.outlineIndices=function(e,t){let i=t.indices,n=e.gltfJson.accessors[i];return pc(e,n,!1)}(e,c,o));let u=e._loadForClassification,h=s.KHR_draco_mesh_compression,d=!1,f=t.attributes;if((0,_.Z)(f))for(let t in f){if(!f.hasOwnProperty(t))continue;let a=f[t],s=pp(e,dj,t),c=s.modelSemantic;if(u&&!function(e){let t=e===dj.POSITION,i=e===dj.FEATURE_ID,n=e===dj.TEXCOORD;return t||i||n}(c))continue;c===dj.FEATURE_ID&&(d=!0);let p=p_(e,a,s,h,i,l,n);o.attributePlans.push(p),r.attributes.push(p.attribute)}let p=t.targets;if((0,_.Z)(p)&&!u)for(let t=0;t<p.length;++t)r.morphTargets.push(function(e,t,i,n,r){let o=new fj,a=void 0;for(let s in t){if(!t.hasOwnProperty(s))continue;let l=t[s],c=pp(e,dj,s),u=p_(e,l,c,a,!1,i,r);o.attributes.push(u.attribute),n.attributePlans.push(u)}return o}(e,p[t],l,o,n));let g=t.indices;if((0,_.Z)(g)){let t=function(e,t,i,n,r,o){var a,s;let l=e.gltfJson.accessors[t],c=l.bufferView;if(!(0,_.Z)(i)&&!(0,_.Z)(c))return;let u=new fk;u.count=l.count;let h=e._loadAttributesAsTypedArray,d=(e._loadIndicesForWireframe||e._enablePick)&&!o.context.webgl2,f=e._loadForClassification&&n,p=!h,m=h||d||f,g=(a=!r&&p,s=!!r||m,fT.getIndexBufferLoader({gltf:e.gltfJson,accessorId:t,gltfResource:e._gltfResource,baseResource:e._baseResource,frameState:o,draco:i,asynchronous:e._asynchronous,loadBuffer:a,loadTypedArray:s})),Z=e._geometryLoaders.length;e._geometryLoaders.push(g);let y=g.load();e._loaderPromises.push(y),e._geometryCallbacks[Z]=()=>{u.indexDatatype=g.indexDatatype,u.buffer=g.buffer,u.typedArray=g.typedArray};let b=new fz.IndicesLoadPlan(u);return b.loadBuffer=p,b.loadTypedArray=m,b}(e,g,h,d,l,n);(0,_.Z)(t)&&(o.indicesPlan=t,r.indices=t.indices)}let Z=s.EXT_structural_metadata,y=s.EXT_mesh_features,b=s.EXT_feature_metadata,v=(0,_.Z)(b);(0,_.Z)(y)?function(e,t,i,n){let r;r=(0,_.Z)(i)&&(0,_.Z)(i.featureIds)?i.featureIds:[];for(let i=0;i<r.length;i++){let o;let a=r[i],s=`featureId_${i}`;o=(0,_.Z)(a.texture)?function(e,t,i,n){let r=new fH;r.featureCount=t.featureCount,r.nullFeatureId=t.nullFeatureId,r.propertyTableId=t.propertyTable,r.label=t.label,r.positionalLabel=n;let o=t.texture;r.textureReader=pg(e,o,i,uN.Z.NEAREST);let a=((0,_.Z)(o.channels)?o.channels:[0]).map(function(e){return"rgba".charAt(e)}).join("");return r.textureReader.channels=a,r}(e,a,n,s):(0,_.Z)(a.attribute)?pZ(a,s):pb(a,s),t.featureIds.push(o)}}(e,r,y,n):v&&function(e,t,i,n){let{featureTables:r}=e.gltfJson.extensions.EXT_feature_metadata,o=0,a=i.featureIdAttributes;if((0,_.Z)(a))for(let i=0;i<a.length;++i){let n;let s=a[i],l=s.featureTable,c=e._sortedPropertyTableIds.indexOf(l),u=r[l].count,h=`featureId_${o}`;o++,n=(0,_.Z)(s.featureIds.attribute)?py(s,c,u,h):pv(s,c,u,h),t.featureIds.push(n)}let s=i.featureIdTextures;if((0,_.Z)(s))for(let i=0;i<s.length;++i){let a=s[i],l=a.featureTable,c=e._sortedPropertyTableIds.indexOf(l),u=r[l].count,h=`featureId_${o}`;o++;let d=function(e,t,i,n,r,o){let a=new fH,s=t.featureIds,l=s.texture;return a.featureCount=r,a.propertyTableId=i,a.textureReader=pg(e,l,n,uN.Z.NEAREST),a.textureReader.channels=s.channels,a.positionalLabel=o,a}(e,a,c,n,u,h);t.featureIds.push(d)}}(e,r,b,n),(0,_.Z)(Z)?!!(0,_.Z)(Z)&&((0,_.Z)(Z.propertyTextures)&&(r.propertyTextureIds=Z.propertyTextures),(0,_.Z)(Z.propertyAttributes)&&(r.propertyAttributeIds=Z.propertyAttributes)):v&&function(e,t,i){(0,_.Z)(i.featureTextures)&&(t.propertyTextureIds=i.featureTextures.map(function(t){return e._sortedFeatureTextureIds.indexOf(t)}))}(e,r,b);let T=t.mode;if(u&&T!==iT.Z.TRIANGLES)throw new e3.Z("Only triangle meshes can be used for classification.");return r.primitiveType=T,r}(e,o[t],(0,_.Z)(n.instances),i));let a=(0,m.Z)(t.weights,r.weights),l=n.primitives[0].morphTargets;n.morphWeights=(0,_.Z)(a)?a.slice():Array(l.length).fill(0)}return n}(e,i,t);return r.index=n,r});for(let e=0;e<n.length;++e){let t=i[e].children;if((0,_.Z)(t))for(let i=0;i<t.length;++i)n[e].children.push(n[t[i]])}return n}(e,t),l=function(e,t){let i=e.gltfJson.skins;if(e._loadForClassification||!(0,_.Z)(i))return[];let n=i.map(function(i,n){let r=function(e,t,i){let n=new fY,r=t.joints;n.joints=r.map(e=>i[e]);let o=t.inverseBindMatrices;if((0,_.Z)(o)){let t=e.gltfJson.accessors[o];n.inverseBindMatrices=pc(e,t)}else n.inverseBindMatrices=Array(r.length).fill(er.Z.IDENTITY);return n}(e,i,t);return r.index=n,r}),r=e.gltfJson.nodes;for(let e=0;e<t.length;++e){let i=r[e].skin;(0,_.Z)(i)&&(t[e].skin=n[i])}return n}(e,s),c=function(e,t){let i=e.gltfJson.animations;return e._loadForClassification||!(0,_.Z)(i)?[]:i.map(function(i,n){let r=function(e,t,i){let n=new f0;n.name=t.name;let r=t.samplers.map(function(t,i){let n=function(e,t){let i=new fK,n=e.gltfJson.accessors,r=n[t.input];i.input=pc(e,r);let o=t.interpolation;i.interpolation=(0,m.Z)(uR[o],uR.LINEAR);let a=n[t.output];return i.output=pc(e,a,!0),i}(e,t);return n.index=i,n}),o=t.channels.map(function(e){return function(e,t,i){let n=new fJ,r=e.sampler;return n.sampler=t[r],n.target=function(e,t){let i=new fQ,n=e.node;if(!(0,_.Z)(n))return;i.node=t[n];let r=e.path.toUpperCase();return i.path=f$[r],i}(e.target,i),n}(e,r,i)});return n.samplers=r,n.channels=o,n}(e,i,t);return r.index=n,r})}(e,s),u=function(e){let t=(0,m.Z)(e.extensions,m.Z.EMPTY_OBJECT),i=t.AGI_articulations?.articulations;return(0,_.Z)(i)?i.map(px):[]}(i),h=function(e,t){let i;let n=new f4,r=((0,_.Z)(e.scenes)&&(0,_.Z)(e.scene)&&(i=e.scenes[e.scene].nodes),i=(0,m.Z)(i,e.nodes),i=(0,_.Z)(i)?i:[]);return n.nodes=r.map(function(e){return t[e]}),n}(i,s),d=new f5,f=new f3,p=i.asset.copyright;if((0,_.Z)(p)){let e=p.split(";").map(function(e){return new uA.Z(e.trim())});f.credits=e}if(d.asset=f,d.scene=h,d.nodes=s,d.skins=l,d.animations=c,d.articulations=u,d.upAxis=e._upAxis,d.forwardAxis=e._forwardAxis,(0,_.Z)(a)){let e=S.Z.fromArray(a.center,0,pw);d.transform=er.Z.fromTranslation(e,d.transform)}if(e._components=d,(0,_.Z)(r)||(0,_.Z)(o)){let i=pT(e,r,o,t);e._loaderPromises.push(i)}let g=[];return g.push.apply(g,e._loaderPromises),e._incrementallyLoadTextures||g.push.apply(g,e._texturesPromises),Promise.all(g)}(e,t);return e._state=pi.PROCESSING,e._textureState=pi.PROCESSING,(0,_.Z)(e._gltfJsonLoader)&&e._releaseGltfJson&&(fT.unload(e._gltfJsonLoader),e._gltfJsonLoader=void 0),i}function pa(e,t){throw e.unload(),e.getError("Failed to load glTF",t)}function ps(e,t,i){let n=t.byteOffset,r=uM(e,t),o=t.count,a=uL(t.type),s=t.componentType,l=eM.Z.getSizeInBytes(s),c=l*a,u=o*a;if(r===c)return i=new Uint8Array(i),eM.Z.createArrayBufferView(s,i.buffer,i.byteOffset+n,u);let h=eM.Z.createTypedArray(s,u),d=new DataView(i.buffer),f=Array(a),p=uF(t.componentType);n=i.byteOffset+n;for(let e=0;e<o;++e){p(d,n,a,l,f);for(let t=0;t<a;++t)h[e*a+t]=f[t];n+=r}return h}async function pl(e,t,i,n,r){let{gltfJson:o}=e;if(await t.load(),e.isDestroyed())return;let a=ps(o,i,t.typedArray);!function(e,t,i,n){let r=e.type,o=e.count;if(r===dH.Z.SCALAR)for(let e=0;e<o;e++)i[e]=t[e];else if(r===dH.Z.VEC4&&n)for(let e=0;e<o;e++)i[e]=n5.Z.unpack(t,4*e);else{let e=dH.Z.getMathType(r),n=dH.Z.getNumberOfComponents(r);for(let r=0;r<o;r++)i[r]=e.unpack(t,r*n)}}(i,a,r,n=(0,m.Z)(n,!1))}function pc(e,t,i){let n=Array(t.count),r=t.bufferView;if((0,_.Z)(r)){let o=function(e,t){let i=fT.getBufferViewLoader({gltf:e.gltfJson,bufferViewId:t,gltfResource:e._gltfResource,baseResource:e._baseResource});return e._bufferViewLoaders.push(i),i}(e,r),a=pl(e,o,t,i,n);return e._loaderPromises.push(a),n}return function(e,t){let i=e.type;if(i===dH.Z.SCALAR)return t.fill(0);let n=dH.Z.getMathType(i);return t.fill(n.clone(n.ZERO))}(t,n)}function pu(e,t){return(0,_.Z)(t)?e===Number?t[0]:e.unpack(t):void 0}(0,_.Z)(Object.create)&&(pn.prototype=Object.create(hE.prototype),pn.prototype.constructor=pn),Object.defineProperties(pn.prototype,{cacheKey:{get:function(){}},components:{get:function(){return this._components}},gltfJson:{get:function(){return(0,_.Z)(this._gltfJsonLoader)?this._gltfJsonLoader.gltf:this._gltfJson}},incrementallyLoadTextures:{get:function(){return this._incrementallyLoadTextures}},texturesLoaded:{get:function(){return this._texturesLoaded}}}),pn.prototype.load=async function(){return(0,_.Z)(this._promise)||(this._promise=pr(this)),this._promise},pn.prototype._process=function(e){return this._state===pi.READY||(this._state===pi.PROCESSING&&function(e,t){let i=!0,n=e._geometryLoaders;for(let r=0;r<n.length;++r){let o=n[r].process(t);o&&(0,_.Z)(e._geometryCallbacks[r])&&(e._geometryCallbacks[r](),e._geometryCallbacks[r]=void 0),i=i&&o}let r=e._structuralMetadataLoader;if((0,_.Z)(r)){let n=r.process(t);n&&(e._components.structuralMetadata=r.structuralMetadata),i=i&&n}i&&(e._state=pi.POST_PROCESSING)}(this,e),this._resourcesLoaded&&this._state===pi.POST_PROCESSING&&(function(e,t){let i=e._primitiveLoadPlans;for(let n=0;n<i.length;n++){let r=i[n];r.postProcess(t),r.needsOutlines&&function(e,t){let i=e._postProcessBuffers,n=t.primitive,r=n.outlineCoordinates;(0,_.Z)(r)&&i.push(r.buffer);let o=n.attributes;for(let e=0;e<o.length;e++){let t=o[e];(0,_.Z)(t.buffer)&&i.push(t.buffer)}let a=n.indices;(0,_.Z)(a)&&(0,_.Z)(a.buffer)&&i.push(a.buffer)}(e,r)}}(this,e.context),this._state=pi.PROCESSED),!!this._resourcesLoaded&&this._state===pi.PROCESSED&&(pS(this),this._typedArray=void 0,this._state=pi.READY,!0))},pn.prototype._processTextures=function(e){if(this._textureState===pi.READY)return!0;if(this._textureState!==pi.PROCESSING)return!1;let t=!0,i=this._textureLoaders;for(let n=0;n<i.length;++n){let r=i[n].process(e);r&&(0,_.Z)(this._textureCallbacks[n])&&(this._textureCallbacks[n](),this._textureCallbacks[n]=void 0),t=t&&r}return!!t&&(this._textureState=pi.READY,this._texturesLoaded=!0,!0)},pn.prototype.process=function(e){if(p.Z.typeOf.object("frameState",e),this._state!==pi.LOADED||(0,_.Z)(this._loadResourcesPromise)||(this._loadResourcesPromise=po(this,e).then(()=>{this._resourcesLoaded=!0}).catch(e=>{this._processError=e})),(0,_.Z)(this._processError)){this._state=pi.FAILED;let e=this._processError;this._processError=void 0,pa(this,e)}let t=this._textureErrors.pop();if((0,_.Z)(t)){let e=this.getError("Failed to load glTF texture",t);throw e.name="TextureError",e}if(this._state===pi.FAILED)return!1;let i=!1;try{i=this._process(e)}catch(e){this._state=pi.FAILED,pa(this,e)}let n=!1;try{n=this._processTextures(e)}catch(e){this._textureState=pi.FAILED,pa(this,e)}return this._incrementallyLoadTextures?i:i&&n};let ph={VEC2:new w.Z(-1,-1),VEC3:new S.Z(-1,-1,-1),VEC4:new eo.Z(-1,-1,-1,-1)};function pd(e){let t=/^\w+_(\d+)$/.exec(e);if(null!==t)return parseInt(t[1])}let pf={gltfSemantic:void 0,renamedSemantic:void 0,modelSemantic:void 0};function pp(e,t,i){let n=i;e._renameBatchIdSemantic&&("_BATCHID"===i||"BATCHID"===i)&&(n="_FEATURE_ID_0");let r=t.fromGltfSemantic(n);return pf.gltfSemantic=i,pf.renamedSemantic=n,pf.modelSemantic=r,pf}function pm(e,t,i,n,r,o,a){let s=e.gltfJson,l=s.accessors[t],c=l.bufferView,u=i.gltfSemantic,h=i.renamedSemantic,d=i.modelSemantic,f=(0,_.Z)(d)?pd(h):void 0,p=function(e,t,i,n,r){let o=e.accessors[t],a=dH.Z.getMathType(o.type),s=(0,m.Z)(o.normalized,!1),l=new fU;l.name=i,l.semantic=n,l.setIndex=r,l.constant=a===Number?0:new a,l.componentDatatype=o.componentType,l.normalized=s,l.count=o.count,l.type=o.type,l.min=pu(a,o.min),l.max=pu(a,o.max),l.byteOffset=o.byteOffset,l.byteStride=uM(e,o),hC(o,"WEB3D_quantized_attributes")&&function(e,t,i){let n=e.decodeMatrix,r=pu(i,e.decodedMin),o=pu(i,e.decodedMax);(0,_.Z)(r)&&(0,_.Z)(o)&&(t.min=r,t.max=o);let a=new uX.Quantization;a.componentDatatype=t.componentDatatype,a.type=t.type,4===n.length?(a.quantizedVolumeOffset=n[2],a.quantizedVolumeStepSize=n[0]):9===n.length?(a.quantizedVolumeOffset=new w.Z(n[6],n[7]),a.quantizedVolumeStepSize=new w.Z(n[0],n[4])):16===n.length?(a.quantizedVolumeOffset=new S.Z(n[12],n[13],n[14]),a.quantizedVolumeStepSize=new S.Z(n[0],n[5],n[10])):25===n.length&&(a.quantizedVolumeOffset=new eo.Z(n[20],n[21],n[22],n[23]),a.quantizedVolumeStepSize=new eo.Z(n[0],n[6],n[12],n[18])),t.quantization=a}(o.extensions.WEB3D_quantized_attributes,l,a);let c=l.semantic===dj.POSITION||l.semantic===dj.NORMAL||l.semantic===dj.TANGENT||l.semantic===dj.TEXCOORD;return e.extensionsRequired?.includes("KHR_mesh_quantization")&&s&&c&&function(e,t){let i=function(e){switch(e){case eM.Z.BYTE:return 127;case eM.Z.UNSIGNED_BYTE:return 255;case eM.Z.SHORT:return 32767;case eM.Z.UNSIGNED_SHORT:return 65535;default:return 1}}(e.componentDatatype),n=ph[e.type],r=e.min;(0,_.Z)(r)&&(r=t.divideByScalar(r,i,r),r=t.maximumByComponent(r,n,r));let o=e.max;(0,_.Z)(o)&&(o=t.divideByScalar(o,i,o),o=t.maximumByComponent(o,n,o)),e.min=r,e.max=o}(l,a),l}(s,t,u,d,f);if(!(0,_.Z)(n)&&!(0,_.Z)(c))return p;let g=function(e,t,i,n,r,o,a){let s=e.gltfJson,l=s.accessors[t].bufferView;return fT.getVertexBufferLoader({gltf:s,gltfResource:e._gltfResource,baseResource:e._baseResource,frameState:a,bufferViewId:l,draco:n,attributeSemantic:i,accessorId:t,asynchronous:e._asynchronous,loadBuffer:r,loadTypedArray:o})}(e,t,u,n,r,o,a),Z=e._geometryLoaders.length;e._geometryLoaders.push(g);let y=g.load();return e._loaderPromises.push(y),e._geometryCallbacks[Z]=()=>{(0,_.Z)(n)&&(0,_.Z)(n.attributes)&&(0,_.Z)(n.attributes[u])?function(e,t,i,n){if(e.byteOffset=0,e.byteStride=void 0,e.quantization=t.quantization,i&&(e.buffer=t.buffer),n){let i=(0,_.Z)(t.quantization)?t.quantization.componentDatatype:e.componentDatatype;e.typedArray=eM.Z.createArrayBufferView(i,t.typedArray.buffer)}}(p,g,r,o):function(e,t,i,n,r,o){if(r&&(i.buffer=n.buffer),o){let o=n.typedArray;i.typedArray=ps(e,t,o),r||(i.byteOffset=0,i.byteStride=void 0)}}(s,l,p,g,r,o)},p}function p_(e,t,i,n,r,o,a){let s=i.modelSemantic,l=s===dj.POSITION,c=s===dj.FEATURE_ID,u=l&&!r&&e._loadAttributesFor2D&&!a.scene3DOnly,h=l&&e._enablePick&&!a.context.webgl2,d=e._loadForClassification&&c,f=e._loadAttributesAsTypedArray,p=!f,m=f||u||h||d,_=pm(e,t,i,n,!o&&p,!!o||m,a),g=new fz.AttributeLoadPlan(_);return g.loadBuffer=p,g.loadTypedArray=m,g}function pg(e,t,i,n){let r=e.gltfJson,o=u3.getImageIdFromTexture({gltf:r,textureId:t.index,supportedImageFormats:e._supportedImageFormats});if(!(0,_.Z)(o))return;let a=fT.getTextureLoader({gltf:r,textureInfo:t,gltfResource:e._gltfResource,baseResource:e._baseResource,supportedImageFormats:e._supportedImageFormats,frameState:i,asynchronous:e._asynchronous}),s=u3.createModelTextureReader({textureInfo:t}),l=e._textureLoaders.length;e._textureLoaders.push(a);let c=a.load().catch(t=>{if(!e.isDestroyed()){if(!e._incrementallyLoadTextures)throw t;e._textureState=pi.FAILED,e._textureErrors.push(t)}});return e._texturesPromises.push(c),e._textureCallbacks[l]=()=>{s.texture=a.texture,(0,_.Z)(n)&&(s.texture.sampler=n)},s}function pZ(e,t){let i=new fV;return i.featureCount=e.featureCount,i.nullFeatureId=e.nullFeatureId,i.propertyTableId=e.propertyTable,i.setIndex=e.attribute,i.label=e.label,i.positionalLabel=t,i}function py(e,t,i,n){let r=new fV,o=e.featureIds;return r.featureCount=i,r.propertyTableId=t,r.setIndex=pd(o.attribute),r.positionalLabel=n,r}function pb(e,t){let i=new fG;return i.propertyTableId=e.propertyTable,i.featureCount=e.featureCount,i.nullFeatureId=e.nullFeatureId,i.label=e.label,i.positionalLabel=t,i.offset=0,i.repeat=1,i}function pv(e,t,i,n){let r=new fG,o=e.featureIds;r.propertyTableId=t,r.featureCount=i,r.offset=(0,m.Z)(o.constant,0);let a=(0,m.Z)(o.divisor,0);return r.repeat=0===a?void 0:a,r.positionalLabel=n,r}async function pT(e,t,i,n){let r=new fx({gltf:e.gltfJson,extension:t,extensionLegacy:i,gltfResource:e._gltfResource,baseResource:e._baseResource,supportedImageFormats:e._supportedImageFormats,frameState:n,asynchronous:e._asynchronous});return e._structuralMetadataLoader=r,r.load()}function pE(e){let t=new f1;t.name=e.name;let i=e.type.toUpperCase();return t.type=uD[i],t.minimumValue=e.minimumValue,t.maximumValue=e.maximumValue,t.initialValue=e.initialValue,t}function px(e){let t=new f2;return t.name=e.name,t.stages=e.stages.map(pE),t}let pw=new S.Z;function pS(e){let t=e._bufferViewLoaders;for(let e=0;e<t.length;++e)t[e]=!t[e].isDestroyed()&&fT.unload(t[e]);e._bufferViewLoaders.length=0}pn.prototype.isUnloaded=function(){return this._state===pi.UNLOADED},pn.prototype.unload=function(){(0,_.Z)(this._gltfJsonLoader)&&!this._gltfJsonLoader.isDestroyed()&&fT.unload(this._gltfJsonLoader),this._gltfJsonLoader=void 0,function(e){let t=e._textureLoaders;for(let e=0;e<t.length;++e)t[e]=!t[e].isDestroyed()&&fT.unload(t[e]);e._textureLoaders.length=0}(this),pS(this),function(e){let t=e._geometryLoaders;for(let e=0;e<t.length;++e)t[e]=!t[e].isDestroyed()&&fT.unload(t[e]);e._geometryLoaders.length=0}(this),function(e){let t=e._postProcessBuffers;for(let e=0;e<t.length;e++){let i=t[e];i.isDestroyed()||i.destroy()}t.length=0}(this),(0,_.Z)(this._structuralMetadataLoader)&&!this._structuralMetadataLoader.isDestroyed()&&(this._structuralMetadataLoader.destroy(),this._structuralMetadataLoader=void 0),this._components=void 0,this._typedArray=void 0,this._state=pi.UNLOADED};var pC=i(5986);function pA(e){e=(0,m.Z)(e,m.Z.EMPTY_OBJECT);let t=(0,_.Z)(e.imageBasedLightingFactor)?w.Z.clone(e.imageBasedLightingFactor):new w.Z(1,1);p.Z.typeOf.object("options.imageBasedLightingFactor",t),p.Z.typeOf.number.greaterThanOrEquals("options.imageBasedLightingFactor.x",t.x,0),p.Z.typeOf.number.lessThanOrEquals("options.imageBasedLightingFactor.x",t.x,1),p.Z.typeOf.number.greaterThanOrEquals("options.imageBasedLightingFactor.y",t.y,0),p.Z.typeOf.number.lessThanOrEquals("options.imageBasedLightingFactor.y",t.y,1),this._imageBasedLightingFactor=t;let i=(0,m.Z)(e.luminanceAtZenith,.2);p.Z.typeOf.number("options.luminanceAtZenith",i),this._luminanceAtZenith=i;let n=e.sphericalHarmonicCoefficients;if((0,_.Z)(n)&&(!Array.isArray(n)||9!==n.length))throw new A.Z("options.sphericalHarmonicCoefficients must be an array of 9 Cartesian3 values.");this._sphericalHarmonicCoefficients=n,this._specularEnvironmentMaps=e.specularEnvironmentMaps,this._specularEnvironmentMapAtlas=void 0,this._specularEnvironmentMapAtlasDirty=!0,this._specularEnvironmentMapLoaded=!1,this._previousSpecularEnvironmentMapLoaded=!1,this._useDefaultSpecularMaps=!1,this._useDefaultSphericalHarmonics=!1,this._shouldRegenerateShaders=!1,this._previousFrameNumber=void 0,this._previousImageBasedLightingFactor=w.Z.clone(t),this._previousLuminanceAtZenith=i,this._previousSphericalHarmonicCoefficients=n,this._removeErrorListener=void 0}Object.defineProperties(pA.prototype,{imageBasedLightingFactor:{get:function(){return this._imageBasedLightingFactor},set:function(e){p.Z.typeOf.object("imageBasedLightingFactor",e),p.Z.typeOf.number.greaterThanOrEquals("imageBasedLightingFactor.x",e.x,0),p.Z.typeOf.number.lessThanOrEquals("imageBasedLightingFactor.x",e.x,1),p.Z.typeOf.number.greaterThanOrEquals("imageBasedLightingFactor.y",e.y,0),p.Z.typeOf.number.lessThanOrEquals("imageBasedLightingFactor.y",e.y,1),this._previousImageBasedLightingFactor=w.Z.clone(this._imageBasedLightingFactor,this._previousImageBasedLightingFactor),this._imageBasedLightingFactor=w.Z.clone(e,this._imageBasedLightingFactor)}},luminanceAtZenith:{get:function(){return this._luminanceAtZenith},set:function(e){this._previousLuminanceAtZenith=this._luminanceAtZenith,this._luminanceAtZenith=e}},sphericalHarmonicCoefficients:{get:function(){return this._sphericalHarmonicCoefficients},set:function(e){if((0,_.Z)(e)&&(!Array.isArray(e)||9!==e.length))throw new A.Z("sphericalHarmonicCoefficients must be an array of 9 Cartesian3 values.");this._previousSphericalHarmonicCoefficients=this._sphericalHarmonicCoefficients,this._sphericalHarmonicCoefficients=e}},specularEnvironmentMaps:{get:function(){return this._specularEnvironmentMaps},set:function(e){e!==this._specularEnvironmentMaps&&(this._specularEnvironmentMapAtlasDirty=this._specularEnvironmentMapAtlasDirty||e!==this._specularEnvironmentMaps,this._specularEnvironmentMapLoaded=!1),this._specularEnvironmentMaps=e}},enabled:{get:function(){return this._imageBasedLightingFactor.x>0||this._imageBasedLightingFactor.y>0}},shouldRegenerateShaders:{get:function(){return this._shouldRegenerateShaders}},useDefaultSphericalHarmonics:{get:function(){return this._useDefaultSphericalHarmonics}},useSphericalHarmonicCoefficients:{get:function(){return(0,_.Z)(this._sphericalHarmonicCoefficients)||this._useDefaultSphericalHarmonics}},specularEnvironmentMapAtlas:{get:function(){return this._specularEnvironmentMapAtlas}},useDefaultSpecularMaps:{get:function(){return this._useDefaultSpecularMaps}},useSpecularEnvironmentMaps:{get:function(){return(0,_.Z)(this._specularEnvironmentMapAtlas)&&this._specularEnvironmentMapAtlas.ready||this._useDefaultSpecularMaps}}}),pA.prototype.update=function(e){if(e.frameNumber===this._previousFrameNumber)return;this._previousFrameNumber=e.frameNumber;let t=e.context;e.brdfLutGenerator.update(e),this._shouldRegenerateShaders=!1;let i=this._imageBasedLightingFactor,n=this._previousImageBasedLightingFactor;w.Z.equals(i,n)||(this._shouldRegenerateShaders=i.x>0&&0===n.x||0===i.x&&n.x>0,this._shouldRegenerateShaders=this._shouldRegenerateShaders||i.y>0&&0===n.y||0===i.y&&n.y>0,this._previousImageBasedLightingFactor=w.Z.clone(this._imageBasedLightingFactor,this._previousImageBasedLightingFactor)),this._luminanceAtZenith!==this._previousLuminanceAtZenith&&(this._shouldRegenerateShaders=this._shouldRegenerateShaders||(0,_.Z)(this._luminanceAtZenith)!==(0,_.Z)(this._previousLuminanceAtZenith),this._previousLuminanceAtZenith=this._luminanceAtZenith),this._previousSphericalHarmonicCoefficients!==this._sphericalHarmonicCoefficients&&(this._shouldRegenerateShaders=this._shouldRegenerateShaders||(0,_.Z)(this._previousSphericalHarmonicCoefficients)!==(0,_.Z)(this._sphericalHarmonicCoefficients),this._previousSphericalHarmonicCoefficients=this._sphericalHarmonicCoefficients),this._shouldRegenerateShaders=this._shouldRegenerateShaders||this._previousSpecularEnvironmentMapLoaded!==this._specularEnvironmentMapLoaded,this._previousSpecularEnvironmentMapLoaded=this._specularEnvironmentMapLoaded,this._specularEnvironmentMapAtlasDirty&&(function(e,t){if(pC.Z.isSupported(t)){if(e._specularEnvironmentMapAtlas=e._specularEnvironmentMapAtlas&&e._specularEnvironmentMapAtlas.destroy(),(0,_.Z)(e._specularEnvironmentMaps)){let t=new pC.Z(e._specularEnvironmentMaps);e._specularEnvironmentMapAtlas=t,e._removeErrorListener=t.errorEvent.addEventListener(e=>{console.error(`Error loading specularEnvironmentMaps: ${e}`)})}e._shouldRegenerateShaders=!0}}(this,t),this._specularEnvironmentMapAtlasDirty=!1),(0,_.Z)(this._specularEnvironmentMapAtlas)&&(this._specularEnvironmentMapAtlas.update(e),this._specularEnvironmentMapAtlas.ready&&(this._specularEnvironmentMapLoaded=!0));let r=!(0,_.Z)(this._specularEnvironmentMapAtlas)&&(0,_.Z)(e.specularEnvironmentMaps)&&!this._useDefaultSpecularMaps,o=!(0,_.Z)(e.specularEnvironmentMaps)&&this._useDefaultSpecularMaps,a=!(0,_.Z)(this._sphericalHarmonicCoefficients)&&(0,_.Z)(e.sphericalHarmonicCoefficients)&&!this._useDefaultSphericalHarmonics,s=!(0,_.Z)(e.sphericalHarmonicCoefficients)&&this._useDefaultSphericalHarmonics;this._shouldRegenerateShaders=this._shouldRegenerateShaders||r||o||a||s,this._useDefaultSpecularMaps=!(0,_.Z)(this._specularEnvironmentMapAtlas)&&(0,_.Z)(e.specularEnvironmentMaps),this._useDefaultSphericalHarmonics=!(0,_.Z)(this._sphericalHarmonicCoefficients)&&(0,_.Z)(e.sphericalHarmonicCoefficients)},pA.prototype.isDestroyed=function(){return!1},pA.prototype.destroy=function(){return this._specularEnvironmentMapAtlas=this._specularEnvironmentMapAtlas&&this._specularEnvironmentMapAtlas.destroy(),this._removeErrorListener=this._removeErrorListener&&this._removeErrorListener(),(0,g.Z)(this)};var pI=i(7992),pO=i(2763),pD=i(2537);function pP(){this._framebuffer=new pO.Z({colorAttachmentsLength:2,depth:!0,supportsDepthTexture:!0}),this._drawCommand=void 0,this._clearCommand=void 0,this._strength=1,this._radius=1}Object.defineProperties(pP.prototype,{framebuffer:{get:function(){return this._framebuffer.framebuffer}},colorGBuffer:{get:function(){return this._framebuffer.getColorTexture(0)}},depthGBuffer:{get:function(){return this._framebuffer.getColorTexture(1)}}});let pR=new w.Z;function pN(e){return e.drawBuffers&&e.fragmentDepth}function pL(e){let t=(0,m.Z)(e,{});this.attenuation=(0,m.Z)(t.attenuation,!1),this.geometricErrorScale=(0,m.Z)(t.geometricErrorScale,1),this.maximumAttenuation=t.maximumAttenuation,this.baseResolution=t.baseResolution,this.eyeDomeLighting=(0,m.Z)(t.eyeDomeLighting,!0),this.eyeDomeLightingStrength=(0,m.Z)(t.eyeDomeLightingStrength,1),this.eyeDomeLightingRadius=(0,m.Z)(t.eyeDomeLightingRadius,1),this.backFaceCulling=(0,m.Z)(t.backFaceCulling,!1),this.normalShading=(0,m.Z)(t.normalShading,!0)}pP.isSupported=pN,pP.prototype.update=function(e,t,i,n){let r;if(!pN(e.context))return;this._strength=i.eyeDomeLightingStrength,this._radius=i.eyeDomeLightingRadius*e.pixelRatio,function(e,t){let i=t.drawingBufferWidth,n=t.drawingBufferHeight;e._framebuffer.update(t,i,n),function(e,t){let i=new eY.Z({defines:["LOG_DEPTH_WRITE"],sources:["uniform sampler2D u_pointCloud_colorGBuffer;\nuniform sampler2D u_pointCloud_depthGBuffer;\nuniform vec2 u_distanceAndEdlStrength;\nin vec2 v_textureCoordinates;\n\nvec2 neighborContribution(float log2Depth, vec2 offset)\n{\n float dist = u_distanceAndEdlStrength.x;\n vec2 texCoordOrig = v_textureCoordinates + offset * dist;\n vec2 texCoord0 = v_textureCoordinates + offset * floor(dist);\n vec2 texCoord1 = v_textureCoordinates + offset * ceil(dist);\n\n float depthOrLogDepth0 = czm_unpackDepth(texture(u_pointCloud_depthGBuffer, texCoord0));\n float depthOrLogDepth1 = czm_unpackDepth(texture(u_pointCloud_depthGBuffer, texCoord1));\n\n // ignore depth values that are the clear depth\n if (depthOrLogDepth0 == 0.0 || depthOrLogDepth1 == 0.0) {\n return vec2(0.0);\n }\n\n // interpolate the two adjacent depth values\n float depthMix = mix(depthOrLogDepth0, depthOrLogDepth1, fract(dist));\n vec4 eyeCoordinate = czm_windowToEyeCoordinates(texCoordOrig, depthMix);\n return vec2(max(0.0, log2Depth - log2(-eyeCoordinate.z / eyeCoordinate.w)), 1.0);\n}\n\nvoid main()\n{\n float depthOrLogDepth = czm_unpackDepth(texture(u_pointCloud_depthGBuffer, v_textureCoordinates));\n\n vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, depthOrLogDepth);\n eyeCoordinate /= eyeCoordinate.w;\n\n float log2Depth = log2(-eyeCoordinate.z);\n\n if (depthOrLogDepth == 0.0) // 0.0 is the clear value for the gbuffer\n {\n discard;\n }\n\n vec4 color = texture(u_pointCloud_colorGBuffer, v_textureCoordinates);\n\n // sample from neighbors left, right, down, up\n vec2 texelSize = 1.0 / czm_viewport.zw;\n\n vec2 responseAndCount = vec2(0.0);\n\n responseAndCount += neighborContribution(log2Depth, vec2(-texelSize.x, 0.0));\n responseAndCount += neighborContribution(log2Depth, vec2(+texelSize.x, 0.0));\n responseAndCount += neighborContribution(log2Depth, vec2(0.0, -texelSize.y));\n responseAndCount += neighborContribution(log2Depth, vec2(0.0, +texelSize.y));\n\n float response = responseAndCount.x / responseAndCount.y;\n float strength = u_distanceAndEdlStrength.y;\n float shade = exp(-response * 300.0 * strength);\n color.rgb *= shade;\n out_FragColor = vec4(color);\n\n // Input and output depth are the same.\n gl_FragDepth = depthOrLogDepth;\n}\n"]}),n=eW.Z.fromCache({blending:eJ.Z.ALPHA_BLEND,depthMask:!0,depthTest:{enabled:!0},stencilTest:pD.Z.setCesium3DTileBit(),stencilMask:pD.Z.CESIUM_3D_TILE_MASK});e._drawCommand=t.createViewportQuadCommand(i,{uniformMap:{u_pointCloud_colorGBuffer:function(){return e.colorGBuffer},u_pointCloud_depthGBuffer:function(){return e.depthGBuffer},u_distanceAndEdlStrength:function(){return pR.x=e._radius,pR.y=e._strength,pR}},renderState:n,pass:ej.Z.CESIUM_3D_TILE,owner:e}),e._clearCommand=new pI.Z({framebuffer:e.framebuffer,color:new C.Z(0,0,0,0),depth:1,renderState:eW.Z.fromCache(),pass:ej.Z.CESIUM_3D_TILE,owner:e})}(e,t)}(this,e.context);let o=e.commandList,a=o.length;for(r=t;r<a;++r){let t,i;let n=o[r];if(n.primitiveType!==iT.Z.POINTS||n.pass===ej.Z.TRANSLUCENT)continue;let a=n.derivedCommands.pointCloudProcessor;(0,_.Z)(a)&&(t=a.command,i=a.originalShaderProgram),(!(0,_.Z)(t)||n.dirty||i!==n.shaderProgram||t.framebuffer!==this.framebuffer)&&((t=eG.Z.shallowClone(n,t)).framebuffer=this.framebuffer,t.shaderProgram=function(e,t){let i=e.shaderCache.getDerivedShaderProgram(t,"EC");if(!(0,_.Z)(i)){let n=t._attributeLocations,r=t.fragmentShaderSource.clone();r.sources.splice(0,0,`layout (location = 0) out vec4 out_FragData_0; layout (location = 1) out vec4 out_FragData_1;`),r.sources=r.sources.map(function(e){return e=(e=eY.Z.replaceMain(e,"czm_point_cloud_post_process_main")).replaceAll(/out_FragColor/g,"out_FragData_0")}),r.sources.push("void main() \n{ \n czm_point_cloud_post_process_main(); \n#ifdef LOG_DEPTH\n czm_writeLogDepth();\n out_FragData_1 = czm_packDepth(gl_FragDepth); \n#else\n out_FragData_1 = czm_packDepth(gl_FragCoord.z);\n#endif\n}"),i=e.shaderCache.createDerivedShaderProgram(t,"EC",{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:r,attributeLocations:n})}return i}(e.context,n.shaderProgram),t.castShadows=!1,t.receiveShadows=!1,(0,_.Z)(a)||(a={command:t,originalShaderProgram:n.shaderProgram},n.derivedCommands.pointCloudProcessor=a),a.originalShaderProgram=n.shaderProgram),o[r]=t}let s=this._clearCommand,l=this._drawCommand;l.boundingVolume=n,o.push(l),o.push(s)},pP.prototype.isDestroyed=function(){return!1},pP.prototype.destroy=function(){return this._framebuffer.destroy(),this._drawCommand=void 0,this._clearCommand=void 0,(0,g.Z)(this)},pL.isSupported=function(e){return pP.isSupported(e.context)};var pM=i(7417);let pF={};pF._deprecationWarning=hj.Z;let pz=Uint32Array.BYTES_PER_ELEMENT;function pB(e,t){this.json=e,this.buffer=t,this._cachedTypedArrays={},this.featuresLength=0}function pU(e,t,i,n,r,o){let a=e._cachedTypedArrays,s=a[t];return(0,_.Z)(s)||(s=eM.Z.createArrayBufferView(i,e.buffer.buffer,e.buffer.byteOffset+o,r*n),a[t]=s),s}pF.parse=function(e,t){let i,n,r,o,a;let s=(0,m.Z)(t,0);p.Z.defined("arrayBuffer",e),t=s;let l=new Uint8Array(e),c=new DataView(e);t+=pz;let u=c.getUint32(t,!0);if(1!==u)throw new e3.Z(`Only Batched 3D Model version 1 is supported. Version ${u} is not.`);t+=pz;let h=c.getUint32(t,!0);t+=pz;let d=c.getUint32(t,!0);t+=pz;let f=c.getUint32(t,!0);t+=pz;let _=c.getUint32(t,!0);t+=pz;let g=c.getUint32(t,!0);t+=pz,_>=570425344?(t-=2*pz,i=d,_=f,g=0,d=0,f=0,pF._deprecationWarning("b3dm-legacy-header","This b3dm header is using the legacy format [batchLength] [batchTableByteLength]. The new format is [featureTableJsonByteLength] [featureTableBinaryByteLength] [batchTableJsonByteLength] [batchTableBinaryByteLength] from https://github.com/CesiumGS/3d-tiles/tree/main/specification/TileFormats/Batched3DModel.")):g>=570425344&&(t-=pz,i=_,_=d,g=f,d=0,f=0,pF._deprecationWarning("b3dm-legacy-header","This b3dm header is using the legacy format [batchTableJsonByteLength] [batchTableBinaryByteLength] [batchLength]. The new format is [featureTableJsonByteLength] [featureTableBinaryByteLength] [batchTableJsonByteLength] [batchTableBinaryByteLength] from https://github.com/CesiumGS/3d-tiles/tree/main/specification/TileFormats/Batched3DModel.")),0===d?n={BATCH_LENGTH:(0,m.Z)(i,0)}:(n=h0(l,t,d),t+=d);let Z=new Uint8Array(e,t,f);t+=f,_>0&&(r=h0(l,t,_),t+=_,g>0&&(o=new Uint8Array(e,t,g),o=new Uint8Array(o),t+=g));let y=s+h-t;if(0===y)throw new e3.Z("glTF byte length must be greater than 0.");return t%4==0?a=new Uint8Array(e,t,y):(pF._deprecationWarning("b3dm-glb-unaligned","The embedded glb is not aligned to a 4-byte boundary."),a=new Uint8Array(l.subarray(t,t+y))),{batchLength:i,featureTableJson:n,featureTableBinary:Z,batchTableJson:r,batchTableBinary:o,gltf:a}},pB.prototype.getGlobalProperty=function(e,t,i){let n=this.json[e];return(0,_.Z)(n)?(0,_.Z)(n.byteOffset)?pU(this,e,t=(0,m.Z)(t,eM.Z.UNSIGNED_INT),i=(0,m.Z)(i,1),1,n.byteOffset):n:void 0},pB.prototype.hasProperty=function(e){return(0,_.Z)(this.json[e])},pB.prototype.getPropertyArray=function(e,t,i){let n=this.json[e];return(0,_.Z)(n)?(0,_.Z)(n.byteOffset)?((0,_.Z)(n.componentType)&&(t=eM.Z.fromName(n.componentType)),pU(this,e,t,i,this.featuresLength,n.byteOffset)):function(e,t,i,n){let r=e._cachedTypedArrays,o=r[t];return(0,_.Z)(o)||(o=eM.Z.createTypedArray(i,n),r[t]=o),o}(this,e,t,n):void 0},pB.prototype.getProperty=function(e,t,i,n,r){let o=this.json[e];if(!(0,_.Z)(o))return;let a=this.getPropertyArray(e,t,i);if(1===i)return a[n];for(let e=0;e<i;++e)r[e]=a[i*n+e];return r};let pk={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},pV={SCALAR:void 0,VEC2:w.Z,VEC3:S.Z,VEC4:eo.Z,MAT2:lp.Z,MAT3:n2.Z,MAT4:er.Z};var pH=function(e){let t;let i=e.componentType;t="string"==typeof i?eM.Z.fromName(i):i;let n=pk[e.type];return{componentsPerAttribute:n,classType:pV[e.type],createArrayBufferView:function(e,i,r){return eM.Z.createArrayBufferView(t,e,i,n*r)}}};function pG(e){this._classes=void 0,this._classIds=void 0,this._classIndexes=void 0,this._parentCounts=void 0,this._parentIndexes=void 0,this._parentIds=void 0,this._byteLength=0,p.Z.typeOf.object("options.extension",e.extension),function(e,t,i){let n,r,o;let a=t.instancesLength,s=t.classes,l=t.classIds,c=t.parentCounts,u=t.parentIds,h=a,d=0;if((0,_.Z)(l.byteOffset)&&(l.componentType=(0,m.Z)(l.componentType,eM.Z.UNSIGNED_SHORT),l.type=dH.Z.SCALAR,d+=(l=pH(l).createArrayBufferView(i.buffer,i.byteOffset+l.byteOffset,a)).byteLength),(0,_.Z)(c)){for((0,_.Z)(c.byteOffset)&&(c.componentType=(0,m.Z)(c.componentType,eM.Z.UNSIGNED_SHORT),c.type=dH.Z.SCALAR,d+=(c=pH(c).createArrayBufferView(i.buffer,i.byteOffset+c.byteOffset,a)).byteLength),o=new Uint16Array(a),h=0,n=0;n<a;++n)o[n]=h,h+=c[n];d+=o.byteLength}(0,_.Z)(u)&&(0,_.Z)(u.byteOffset)&&(u.componentType=(0,m.Z)(u.componentType,eM.Z.UNSIGNED_SHORT),u.type=dH.Z.SCALAR,d+=(u=pH(u).createArrayBufferView(i.buffer,i.byteOffset+u.byteOffset,h)).byteLength);let f=s.length;for(n=0;n<f;++n){let e=s[n].length,t=s[n].instances,r=function(e,t,i){let n;for(let r in t)if(t.hasOwnProperty(r)){let o=t[r],a=o.byteOffset;if((0,_.Z)(a)){let t=o.componentType,s=o.type;if(!(0,_.Z)(t))throw new e3.Z("componentType is required.");if(!(0,_.Z)(s))throw new e3.Z("type is required.");if(!(0,_.Z)(i))throw new e3.Z(`Property ${r} requires a batch table binary.`);let l=pH(o),c=l.componentsPerAttribute,u=l.classType,h=l.createArrayBufferView(i.buffer,i.byteOffset+a,e);(0,_.Z)(n)||(n={}),n[r]={typedArray:h,componentCount:c,type:u}}}return n}(e,t,i);d+=function(e){let t=0;for(let i in e)e.hasOwnProperty(i)&&(t+=e[i].typedArray.byteLength);return t}(r),s[n].instances=(0,hv.Z)(r,t)}let p=Array(f).fill(0),g=new Uint16Array(a);for(n=0;n<a;++n)r=l[n],g[n]=p[r],++p[r];d+=g.byteLength,e._classes=s,e._classIds=l,e._classIndexes=g,e._parentCounts=c,e._parentIndexes=o,e._parentIds=u,e._byteLength=d}(this,e.extension,e.binaryBody),function(e){pj.length=0;let t=e._classIds.length;for(let i=0;i<t;++i)(function e(t,i,n){let r=t._parentCounts,o=t._parentIds,a=t._parentIndexes,s=t._classIds.length;if(!(0,_.Z)(o))return;if(i>=s)throw new A.Z(`Parent index ${i} exceeds the total number of instances: ${s}`);if(n.indexOf(i)>-1)throw new A.Z("Circular dependency detected in the batch table hierarchy.");n.push(i);let l=(0,_.Z)(r)?r[i]:1,c=(0,_.Z)(r)?a[i]:i;for(let r=0;r<l;++r){let a=o[c+r];a!==i&&e(t,a,n)}n.pop(i)})(e,i,pj)}(this)}Object.defineProperties(pG.prototype,{byteLength:{get:function(){return this._byteLength}}});let pj=[],pW=[],pq=[],pY=0;function pX(e,t,i){let n=e._parentCounts,r=e._parentIds;return(0,_.Z)(r)?(0,_.Z)(n)?function(e,t,i){let n=e._classIds,r=e._parentCounts,o=e._parentIds,a=e._parentIndexes,s=n.length;pW.length=Math.max(pW.length,s);let l=++pY;for(pq.length=0,pq.push(t);pq.length>0;){if(pW[t=pq.pop()]===l)continue;pW[t]=l;let n=i(e,t);if((0,_.Z)(n))return n;let s=r[t],c=a[t];for(let e=0;e<s;++e){let i=o[c+e];i!==t&&pq.push(i)}}}(e,t,i):function(e,t,i){let n=!0;for(;n;){let r=i(e,t);if((0,_.Z)(r))return r;let o=e._parentIds[t];n=o!==t,t=o}}(e,t,i):i(e,t)}function p$(e){let t,i,n,r,o;p.Z.typeOf.number("options.count",e.count),p.Z.typeOf.object("options.batchTable",e.batchTable);let a=e.count,s=e.batchTable,l=e.binaryBody,c=(0,m.Z)(e.parseAsPropertyAttributes,!1),u=e.customAttributeOutput;if(c&&!(0,_.Z)(u))throw new A.Z("customAttributeOutput is required when parsing batch table as property attributes");let h=function(e){let t,i;let n=e.HIERARCHY,r=e.extras,o=e.extensions;(0,_.Z)(n)?(p$._deprecationWarning("batchTableHierarchyExtension","The batch table HIERARCHY property has been moved to an extension. Use extensions.3DTILES_batch_table_hierarchy instead."),t=n):(0,_.Z)(o)&&(t=o["3DTILES_batch_table_hierarchy"]);let a={};for(let t in e){if(!e.hasOwnProperty(t)||"HIERARCHY"===t||"extensions"===t||"extras"===t)continue;let n=e[t];Array.isArray(n)?(i=(0,_.Z)(i)?i:{})[t]=n:a[t]=n}return{binaryProperties:a,jsonProperties:i,hierarchy:t,extras:r,extensions:o}}(s);(0,_.Z)(h.jsonProperties)&&(t=new uk({count:a,properties:h.jsonProperties})),(0,_.Z)(h.hierarchy)&&(i=new pG({extension:h.hierarchy,binaryBody:l}));let d=fs.BATCH_TABLE_CLASS_NAME,f=h.binaryProperties;if(c){let e=function(e,t,i,n,r){let o={},a={},s=0;for(let t in i){if(!i.hasOwnProperty(t))continue;let l=i[t];if(!(0,_.Z)(n)&&!(0,_.Z)(l.typedArray))throw new e3.Z(`Property ${t} requires a batch table binary.`);let c=dq.sanitizeGlslIdentifier(t);(""===c||o.hasOwnProperty(c))&&(c=`property_${s}`,s++);let u=pK(l);u.name=t,o[c]=u;let h=c.toUpperCase();h.startsWith("_")||(h=`_${h}`);let d=l.typedArray;(0,_.Z)(d)||(d=pH(l).createArrayBufferView(n.buffer,n.byteOffset+l.byteOffset,e));let f=new uX.Attribute;f.name=h,f.count=e,f.type=l.type;let p=eM.Z.fromTypedArray(d);(p===eM.Z.INT||p===eM.Z.UNSIGNED_INT||p===eM.Z.DOUBLE)&&(p$._oneTimeWarning("Cast pnts property to floats",`Point cloud property "${h}" will be cast to a float array because INT, UNSIGNED_INT, and DOUBLE are not valid WebGL vertex attribute types. Some precision may be lost.`),d=new Float32Array(d)),f.componentDatatype=eM.Z.fromTypedArray(d),f.typedArray=d,r.push(f),a[c]={attribute:h}}let l={classes:{}};l.classes[t]={properties:o};let c=fu.fromJson(l);return{class:t,propertyAttributeJson:{properties:a},transcodedSchema:c,transcodedClass:c.classes[t]}}(a,d,f,l,u);o=e.transcodedSchema,r=[new hi({propertyAttribute:e.propertyAttributeJson,class:e.transcodedClass})]}else{let e=function(e,t,i,n){let r={},o={},a={},s=0;for(let t in i){if(!i.hasOwnProperty(t))continue;if(!(0,_.Z)(n))throw new e3.Z(`Property ${t} requires a batch table binary.`);let l=i[t],c=pH(l);o[t]={bufferView:s},r[t]=pK(l),a[s]=c.createArrayBufferView(n.buffer,n.byteOffset+l.byteOffset,e),s++}let l={classes:{}};l.classes[t]={properties:r};let c=fu.fromJson(l);return{featureTableJson:{class:t,count:e,properties:o},bufferViewsTypedArrays:a,transcodedSchema:c,transcodedClass:c.classes[t]}}(a,d,f,l);o=e.transcodedSchema;let t=e.featureTableJson;n=new hy({count:t.count,properties:t.properties,class:e.transcodedClass,bufferViews:e.bufferViewsTypedArrays}),r=[]}let g=[];if((0,_.Z)(n)||(0,_.Z)(t)||(0,_.Z)(i)){let e=new uV({id:0,name:"Batch Table",count:a,metadataTable:n,jsonMetadataTable:t,batchTableHierarchy:i});g.push(e)}return new hn({schema:o,propertyTables:g,propertyAttributes:r,extensions:h.extensions,extras:h.extras})}function pK(e){let t=function(e){switch(e){case"BYTE":return"INT8";case"UNSIGNED_BYTE":return"UINT8";case"SHORT":return"INT16";case"UNSIGNED_SHORT":return"UINT16";case"INT":return"INT32";case"UNSIGNED_INT":return"UINT32";case"FLOAT":return"FLOAT32";case"DOUBLE":return"FLOAT64"}}(e.componentType);return{type:e.type,componentType:t}}pG.prototype.hasProperty=function(e,t){let i=pX(this,e,function(e,i){let n=e._classIds[i],r=e._classes[n].instances;if((0,_.Z)(r[t]))return!0});return(0,_.Z)(i)},pG.prototype.propertyExists=function(e){let t=this._classes,i=t.length;for(let n=0;n<i;++n){let i=t[n].instances;if((0,_.Z)(i[e]))return!0}return!1},pG.prototype.getPropertyIds=function(e,t){return(t=(0,_.Z)(t)?t:[]).length=0,pX(this,e,function(e,i){let n=e._classIds[i],r=e._classes[n].instances;for(let e in r)r.hasOwnProperty(e)&&-1===t.indexOf(e)&&t.push(e)}),t},pG.prototype.getProperty=function(e,t){return pX(this,e,function(e,i){let n=e._classIds[i],r=e._classes[n],o=e._classIndexes[i],a=r.instances[t];if((0,_.Z)(a))return(0,_.Z)(a.typedArray)?function(e,t){let i=e.typedArray,n=e.componentCount;return 1===n?i[t]:e.type.unpack(i,t*n)}(a,o):(0,uz.Z)(a[o],!0)})},pG.prototype.setProperty=function(e,t,i){let n=pX(this,e,function(n,r){let o=n._classIds[r],a=n._classes[o],s=n._classIndexes[r],l=a.instances[t];if((0,_.Z)(l)){if(r!==e)throw new A.Z(`Inherited property "${t}" is read-only.`);return(0,_.Z)(l.typedArray)?function(e,t,i){let n=e.typedArray,r=e.componentCount;1===r?n[t]=i:e.type.pack(i,n,t*r)}(l,s,i):l[s]=(0,uz.Z)(i,!0),!0}});return(0,_.Z)(n)},pG.prototype.isClass=function(e,t){let i=pX(this,e,function(e,i){let n=e._classIds[i];if(e._classes[n].name===t)return!0});return(0,_.Z)(i)},pG.prototype.getClassName=function(e){let t=this._classIds[e];return this._classes[t].name},p$._deprecationWarning=hj.Z,p$._oneTimeWarning=nP.Z;let pQ=uX.FeatureIdAttribute;function pJ(e){let t=(e=(0,m.Z)(e,m.Z.EMPTY_OBJECT)).b3dmResource,i=e.baseResource,n=e.arrayBuffer,r=(0,m.Z)(e.byteOffset,0),o=(0,m.Z)(e.releaseGltfJson,!1),a=(0,m.Z)(e.asynchronous,!0),s=(0,m.Z)(e.incrementallyLoadTextures,!0),l=(0,m.Z)(e.upAxis,dV.Z.Y),c=(0,m.Z)(e.forwardAxis,dV.Z.X),u=(0,m.Z)(e.loadAttributesAsTypedArray,!1),h=(0,m.Z)(e.loadAttributesFor2D,!1),d=(0,m.Z)(e.enablePick,!1),f=(0,m.Z)(e.loadIndicesForWireframe,!1),g=(0,m.Z)(e.loadPrimitiveOutline,!0),Z=(0,m.Z)(e.loadForClassification,!1);p.Z.typeOf.object("options.b3dmResource",t),p.Z.typeOf.object("options.arrayBuffer",n),i=(0,_.Z)(i)?i:t.clone(),this._b3dmResource=t,this._baseResource=i,this._arrayBuffer=n,this._byteOffset=r,this._releaseGltfJson=o,this._asynchronous=a,this._incrementallyLoadTextures=s,this._upAxis=l,this._forwardAxis=c,this._loadAttributesAsTypedArray=u,this._loadAttributesFor2D=h,this._enablePick=d,this._loadIndicesForWireframe=f,this._loadPrimitiveOutline=g,this._loadForClassification=Z,this._state=0,this._promise=void 0,this._gltfLoader=void 0,this._batchLength=0,this._propertyTable=void 0,this._batchTable=void 0,this._components=void 0,this._transform=er.Z.IDENTITY}function p0(e){e=(0,m.Z)(e,m.Z.EMPTY_OBJECT),p.Z.typeOf.object("options.geoJson",e.geoJson),this._geoJson=e.geoJson,this._components=void 0}function p1(){this.lines=void 0,this.points=void 0,this.properties=void 0}function p2(){this.features=[]}function p3(e){let t=e[0],i=e[1],n=(0,m.Z)(e[2],0);return new S.Z(t,i,n)}function p4(e){let t=e.length,i=Array(t);for(let n=0;n<t;n++)i[n]=p3(e[n]);return[i]}function p5(e){let t=e.length,i=Array(t);for(let n=0;n<t;n++)i[n]=p4(e[n])[0];return i}(0,_.Z)(Object.create)&&(pJ.prototype=Object.create(hE.prototype),pJ.prototype.constructor=pJ),Object.defineProperties(pJ.prototype,{texturesLoaded:{get:function(){return this._gltfLoader?.texturesLoaded}},cacheKey:{get:function(){}},components:{get:function(){return this._components}}}),pJ.prototype.load=function(){if((0,_.Z)(this._promise))return this._promise;let e=pF.parse(this._arrayBuffer,this._byteOffset),t=e.batchLength,i=e.featureTableJson,n=e.featureTableBinary,r=e.batchTableJson,o=e.batchTableBinary,a=new pB(i,n);t=a.getGlobalProperty("BATCH_LENGTH"),this._batchLength=t;let s=a.getGlobalProperty("RTC_CENTER",eM.Z.FLOAT,3);(0,_.Z)(s)&&(this._transform=er.Z.fromTranslation(S.Z.fromArray(s))),this._batchTable={json:r,binary:o};let l=new pn({typedArray:e.gltf,upAxis:this._upAxis,forwardAxis:this._forwardAxis,gltfResource:this._b3dmResource,baseResource:this._baseResource,releaseGltfJson:this._releaseGltfJson,incrementallyLoadTextures:this._incrementallyLoadTextures,loadAttributesAsTypedArray:this._loadAttributesAsTypedArray,loadAttributesFor2D:this._loadAttributesFor2D,enablePick:this._enablePick,loadIndicesForWireframe:this._loadIndicesForWireframe,loadPrimitiveOutline:this._loadPrimitiveOutline,loadForClassification:this._loadForClassification,renameBatchIdSemantic:!0});this._gltfLoader=l,this._state=1;let c=this;return this._promise=l.load().then(function(){if(!c.isDestroyed())return c._state=2,c}).catch(function(e){if(!c.isDestroyed()){var t;return t=e,c.unload(),c._state=4,Promise.reject(t=c.getError("Failed to load b3dm",t))}}),this._promise},pJ.prototype.process=function(e){if(p.Z.typeOf.object("frameState",e),3===this._state)return!0;if(2!==this._state||!this._gltfLoader.process(e))return!1;let t=this._gltfLoader.components;return t.transform=er.Z.multiplyTransformation(this._transform,t.transform,t.transform),function(e,t){let i;let n=e._batchTable,r=e._batchLength;if(0===r)return;i=(0,_.Z)(n.json)?p$({count:r,batchTable:n.json,binaryBody:n.binary}):new hn({schema:{},propertyTables:[new uV({name:fs.BATCH_TABLE_CLASS_NAME,count:r})]});let o=t.scene.nodes,a=o.length;for(let e=0;e<a;e++)(function e(t){let i=t.children.length;for(let n=0;n<i;n++)e(t.children[n]);let n=t.primitives.length;for(let e=0;e<n;e++){let i=t.primitives[e],n=dq.getAttributeBySemantic(i,dj.FEATURE_ID);if((0,_.Z)(n)){n.setIndex=0;let e=new pQ;e.propertyTableId=0,e.setIndex=0,e.positionalLabel="featureId_0",i.featureIds.push(e)}}})(o[e]);t.structuralMetadata=i}(this,t),this._components=t,this._arrayBuffer=void 0,this._state=3,!0},pJ.prototype.unload=function(){(0,_.Z)(this._gltfLoader)&&!this._gltfLoader.isDestroyed()&&this._gltfLoader.unload(),this._components=void 0,this._arrayBuffer=void 0},(0,_.Z)(Object.create)&&(p0.prototype=Object.create(hE.prototype),p0.prototype.constructor=p0),Object.defineProperties(p0.prototype,{cacheKey:{get:function(){}},components:{get:function(){return this._components}}}),p0.prototype.load=function(){return Promise.resolve(this)},p0.prototype.process=function(e){return p.Z.typeOf.object("frameState",e),!!(0,_.Z)(this._components)||(this._components=function(e,t){let i=new p2,n=p7[e.type];(0,_.Z)(n)&&n(e,i);let r=i.features,o=r.length;if(0===o)throw new e3.Z("GeoJSON must have at least one feature");let a={};for(let e=0;e<o;e++){let t=r[e],i=(0,m.Z)(t.properties,m.Z.EMPTY_OBJECT);for(let e in i)i.hasOwnProperty(e)&&!(0,_.Z)(a[e])&&(a[e]=Array(o))}for(let e=0;e<o;e++){let t=r[e];for(let i in a)if(a.hasOwnProperty(i)){let n=(0,m.Z)(t.properties[i],"");a[i][e]=n}}let s=new uk({count:o,properties:a}),l=new uV({id:0,count:o,jsonMetadataTable:s}),c=new hn({schema:fu.fromJson({}),propertyTables:[l]}),u=new S.Z(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),h=new S.Z(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY),d=!1,f=!1;for(let e=0;e<o;e++){let t=r[e];if((0,_.Z)(t.lines)){d=!0;let e=t.lines.length;for(let i=0;i<e;i++){let e=t.lines[i],n=e.length;for(let t=0;t<n;t++)S.Z.minimumByComponent(u,e[t],u),S.Z.maximumByComponent(h,e[t],h)}}if((0,_.Z)(t.points)){f=!0;let e=t.points.length;for(let i=0;i<e;i++){let e=t.points[i];S.Z.minimumByComponent(u,e,u),S.Z.maximumByComponent(h,e,h)}}}let p=S.Z.midpoint(u,h,new S.Z),g=S.Z.fromDegrees(p.x,p.y,p.z,el.Z.WGS84,new S.Z),Z=n9.Z.eastNorthUpToFixedFrame(g,el.Z.WGS84,new er.Z),y=er.Z.inverseTransformation(Z,new er.Z),b=[];d&&b.push(function(e,t,i){let n=0,r=0,o=e.length;for(let t=0;t<o;t++){let i=e[t];if((0,_.Z)(i.lines)){let e=i.lines.length;for(let t=0;t<e;t++){let e=i.lines[t];n+=e.length,r+=(e.length-1)*2}}}let a=new Float32Array(3*n),s=new Float32Array(n),l=ez.Z.createTypedArray(n,r),c=ez.Z.fromTypedArray(l),u=new S.Z(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),h=new S.Z(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY),d=0,f=0;for(let i=0;i<o;i++){let n=e[i];if(!(0,_.Z)(n.lines))continue;let r=n.lines.length;for(let e=0;e<r;e++){let r=n.lines[e],o=r.length;for(let e=0;e<o;e++){let n=r[e],c=S.Z.fromDegrees(n.x,n.y,n.z,el.Z.WGS84,me),p=er.Z.multiplyByPoint(t,c,me);S.Z.minimumByComponent(u,p,u),S.Z.maximumByComponent(h,p,h),S.Z.pack(p,a,3*d),s[d]=i,e<o-1&&(l[2*f]=d,l[2*f+1]=d+1,f++),d++}}}let p=ek.Z.createVertexBuffer({typedArray:a,context:i.context,usage:eV.Z.STATIC_DRAW});p.vertexArrayDestroyable=!1;let m=ek.Z.createVertexBuffer({typedArray:s,context:i.context,usage:eV.Z.STATIC_DRAW});m.vertexArrayDestroyable=!1;let g=ek.Z.createIndexBuffer({typedArray:l,context:i.context,usage:eV.Z.STATIC_DRAW,indexDatatype:c});g.vertexArrayDestroyable=!1;let Z=new uX.Attribute;Z.semantic=dj.POSITION,Z.componentDatatype=eM.Z.FLOAT,Z.type=dH.Z.VEC3,Z.count=n,Z.min=u,Z.max=h,Z.buffer=p;let y=new uX.Attribute;y.semantic=dj.FEATURE_ID,y.setIndex=0,y.componentDatatype=eM.Z.FLOAT,y.type=dH.Z.SCALAR,y.count=n,y.buffer=m;let b=[Z,y],v=new uX.Material;v.unlit=!0;let T=new uX.Indices;T.indexDatatype=c,T.count=l.length,T.buffer=g;let E=new uX.FeatureIdAttribute;E.featureCount=o,E.propertyTableId=0,E.setIndex=0,E.positionalLabel="featureId_0";let x=[E],w=new uX.Primitive;return w.attributes=b,w.indices=T,w.featureIds=x,w.primitiveType=iT.Z.LINES,w.material=v,w}(r,y,t)),f&&b.push(function(e,t,i){let n=0,r=e.length;for(let t=0;t<r;t++){let i=e[t];(0,_.Z)(i.points)&&(n+=i.points.length)}let o=new Float32Array(3*n),a=new Float32Array(n),s=new S.Z(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),l=new S.Z(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY),c=0;for(let i=0;i<r;i++){let n=e[i];if(!(0,_.Z)(n.points))continue;let r=n.points.length;for(let e=0;e<r;e++){let r=n.points[e],u=S.Z.fromDegrees(r.x,r.y,r.z,el.Z.WGS84,me),h=er.Z.multiplyByPoint(t,u,me);S.Z.minimumByComponent(s,h,s),S.Z.maximumByComponent(l,h,l),S.Z.pack(h,o,3*c),a[c]=i,c++}}let u=ek.Z.createVertexBuffer({typedArray:o,context:i.context,usage:eV.Z.STATIC_DRAW});u.vertexArrayDestroyable=!1;let h=ek.Z.createVertexBuffer({typedArray:a,context:i.context,usage:eV.Z.STATIC_DRAW});h.vertexArrayDestroyable=!1;let d=new uX.Attribute;d.semantic=dj.POSITION,d.componentDatatype=eM.Z.FLOAT,d.type=dH.Z.VEC3,d.count=n,d.min=s,d.max=l,d.buffer=u;let f=new uX.Attribute;f.semantic=dj.FEATURE_ID,f.setIndex=0,f.componentDatatype=eM.Z.FLOAT,f.type=dH.Z.SCALAR,f.count=n,f.buffer=h;let p=[d,f],m=new uX.Material;m.unlit=!0;let g=new uX.FeatureIdAttribute;g.featureCount=r,g.propertyTableId=0,g.setIndex=0,g.positionalLabel="featureId_0";let Z=[g],y=new uX.Primitive;return y.attributes=p,y.featureIds=Z,y.primitiveType=iT.Z.POINTS,y.material=m,y}(r,y,t));let v=new uX.Node;v.index=0,v.primitives=b;let T=[v],E=new uX.Scene;E.nodes=T;let x=new uX.Components;return x.scene=E,x.nodes=T,x.transform=Z,x.structuralMetadata=c,x}(this._geoJson,e),this._geoJson=void 0,!0)};let p9={LineString:p4,MultiLineString:function(e){let t=e.length,i=Array(t);for(let n=0;n<t;n++)i[n]=p4(e[n])[0];return i},MultiPolygon:function(e){let t=e.length,i=[];for(let n=0;n<t;n++)Array.prototype.push.apply(i,p5(e[n]));return i},Polygon:p5,MultiPoint:function(e){let t=e.length,i=Array(t);for(let n=0;n<t;n++)i[n]=p3(e[n]);return i},Point:function(e){return[p3(e)]}},p8={LineString:iT.Z.LINES,MultiLineString:iT.Z.LINES,MultiPolygon:iT.Z.LINES,Polygon:iT.Z.LINES,MultiPoint:iT.Z.POINTS,Point:iT.Z.POINTS};function p6(e,t){if(!(0,_.Z)(e.geometry))return;let i=e.geometry.type,n=p9[i],r=p8[i],o=e.geometry.coordinates;if(!(0,_.Z)(n)||!(0,_.Z)(o))return;let a=new p1;r===iT.Z.LINES?a.lines=n(o):r===iT.Z.POINTS&&(a.points=n(o)),a.properties=e.properties,t.features.push(a)}let p7={FeatureCollection:function(e,t){let i=e.features,n=i.length;for(let e=0;e<n;e++)p6(i[e],t)},Feature:p6},me=new S.Z;p0.prototype.unload=function(){this._components=void 0};let mt={};mt._deprecationWarning=hj.Z;let mi=Uint32Array.BYTES_PER_ELEMENT;mt.parse=function(e,t){let i,n,r;p.Z.defined("arrayBuffer",e);let o=(0,m.Z)(t,0);t=o;let a=new Uint8Array(e),s=new DataView(e);t+=mi;let l=s.getUint32(t,!0);if(1!==l)throw new e3.Z(`Only Instanced 3D Model version 1 is supported. Version ${l} is not.`);t+=mi;let c=s.getUint32(t,!0);t+=mi;let u=s.getUint32(t,!0);if(0===u)throw new e3.Z("featureTableJsonByteLength is zero, the feature table must be defined.");t+=mi;let h=s.getUint32(t,!0);t+=mi;let d=s.getUint32(t,!0);t+=mi;let f=s.getUint32(t,!0);t+=mi;let _=s.getUint32(t,!0);if(1!==_&&0!==_)throw new e3.Z(`Only glTF format 0 (uri) or 1 (embedded) are supported. Format ${_} is not.`);let g=h0(a,t+=mi,u),Z=new Uint8Array(e,t+=u,h);t+=h,d>0&&(i=h0(a,t,d),t+=d,f>0&&(n=new Uint8Array(e,t,f),n=new Uint8Array(n),t+=f));let y=o+c-t;if(0===y)throw new e3.Z("glTF byte length must be greater than 0.");return t%4==0?r=new Uint8Array(e,t,y):(mt._deprecationWarning("i3dm-glb-unaligned","The embedded glb is not aligned to a 4-byte boundary."),r=new Uint8Array(a.subarray(t,t+y))),{gltfFormat:_,featureTableJson:g,featureTableBinary:Z,batchTableJson:i,batchTableBinary:n,gltf:r}};let mn=uX.Attribute,mr=uX.FeatureIdAttribute,mo=uX.Instances;function ma(e){let t=(e=(0,m.Z)(e,m.Z.EMPTY_OBJECT)).i3dmResource,i=e.arrayBuffer,n=e.baseResource,r=(0,m.Z)(e.byteOffset,0),o=(0,m.Z)(e.releaseGltfJson,!1),a=(0,m.Z)(e.asynchronous,!0),s=(0,m.Z)(e.incrementallyLoadTextures,!0),l=(0,m.Z)(e.upAxis,dV.Z.Y),c=(0,m.Z)(e.forwardAxis,dV.Z.X),u=(0,m.Z)(e.loadAttributesAsTypedArray,!1),h=(0,m.Z)(e.loadIndicesForWireframe,!1),d=(0,m.Z)(e.loadPrimitiveOutline,!0),f=(0,m.Z)(e.enablePick,!1);p.Z.typeOf.object("options.i3dmResource",t),p.Z.typeOf.object("options.arrayBuffer",i),n=(0,_.Z)(n)?n:t.clone(),this._i3dmResource=t,this._baseResource=n,this._arrayBuffer=i,this._byteOffset=r,this._releaseGltfJson=o,this._asynchronous=a,this._incrementallyLoadTextures=s,this._upAxis=l,this._forwardAxis=c,this._loadAttributesAsTypedArray=u,this._loadIndicesForWireframe=h,this._loadPrimitiveOutline=d,this._enablePick=f,this._state=0,this._promise=void 0,this._gltfLoader=void 0,this._buffers=[],this._components=void 0,this._transform=er.Z.IDENTITY,this._batchTable=void 0,this._featureTable=void 0,this._instancesLength=0}(0,_.Z)(Object.create)&&(ma.prototype=Object.create(hE.prototype),ma.prototype.constructor=ma),Object.defineProperties(ma.prototype,{texturesLoaded:{get:function(){return this._gltfLoader?.texturesLoaded}},cacheKey:{get:function(){}},components:{get:function(){return this._components}}}),ma.prototype.load=function(){if((0,_.Z)(this._promise))return this._promise;let e=mt.parse(this._arrayBuffer,this._byteOffset),t=e.featureTableJson,i=e.featureTableBinary,n=e.batchTableJson,r=e.batchTableBinary,o=e.gltfFormat,a=new pB(t,i);this._featureTable=a;let s=a.getGlobalProperty("INSTANCES_LENGTH");if(a.featuresLength=s,!(0,_.Z)(s))throw new e3.Z("Feature table global property: INSTANCES_LENGTH must be defined");this._instancesLength=s;let l=a.getGlobalProperty("RTC_CENTER",eM.Z.FLOAT,3);(0,_.Z)(l)&&(this._transform=er.Z.fromTranslation(S.Z.fromArray(l))),this._batchTable={json:n,binary:r};let c={upAxis:this._upAxis,forwardAxis:this._forwardAxis,releaseGltfJson:this._releaseGltfJson,incrementallyLoadTextures:this._incrementallyLoadTextures,loadAttributesAsTypedArray:this._loadAttributesAsTypedArray,enablePick:this._enablePick,loadIndicesForWireframe:this._loadIndicesForWireframe,loadPrimitiveOutline:this._loadPrimitiveOutline};if(0===o){let t=hr(e.gltf);t=t.replace(/[\s\0]+$/,"");let i=this._baseResource.getDerivedResource({url:t});c.gltfResource=i,c.baseResource=i}else c.gltfResource=this._i3dmResource,c.typedArray=e.gltf;let u=new pn(c);return this._gltfLoader=u,this._state=1,this._promise=u.load().then(()=>{if(!this.isDestroyed())return this._state=2,this}).catch(e=>{if(!this.isDestroyed())throw this.unload(),this._state=5,this.getError("Failed to load i3dm",e)}),this._promise},ma.prototype.process=function(e){if(p.Z.typeOf.object("frameState",e),4===this._state)return!0;let t=this._gltfLoader,i=!1;if(2===this._state&&(i=t.process(e)),!i)return!1;let n=t.components;return n.transform=er.Z.multiplyTransformation(this._transform,n.transform,n.transform),function(e,t,i){let n,r,o;let a=e._featureTable,s=e._instancesLength;if(0===s)return;let l=a.getGlobalProperty("RTC_CENTER",eM.Z.FLOAT,3),c=a.getGlobalProperty("EAST_NORTH_UP"),u=a.hasProperty("NORMAL_UP")||a.hasProperty("NORMAL_UP_OCT32P")||c,h=a.hasProperty("SCALE")||a.hasProperty("SCALE_NON_UNIFORM"),d=function(e,t){if(e.hasProperty("POSITION"))return e.getPropertyArray("POSITION",eM.Z.FLOAT,3);if(e.hasProperty("POSITION_QUANTIZED")){let t=e.getPropertyArray("POSITION_QUANTIZED",eM.Z.UNSIGNED_SHORT,3),i=e.getGlobalProperty("QUANTIZED_VOLUME_OFFSET",eM.Z.FLOAT,3);if(!(0,_.Z)(i))throw new e3.Z("Global property: QUANTIZED_VOLUME_OFFSET must be defined for quantized positions.");let n=e.getGlobalProperty("QUANTIZED_VOLUME_SCALE",eM.Z.FLOAT,3);if(!(0,_.Z)(n))throw new e3.Z("Global property: QUANTIZED_VOLUME_SCALE must be defined for quantized positions.");let r=new Float32Array(t.length);for(let e=0;e<t.length/3;e++)for(let o=0;o<3;o++){let a=3*e+o;r[a]=t[a]/65535*n[o]+i[o]}return r}throw new e3.Z("Either POSITION or POSITION_QUANTIZED must be defined for each instance.")}(a,0);u&&(r=new Float32Array(4*s)),h&&(o=new Float32Array(3*s));let p=new Float32Array(s),m=S.Z.unpackArray(d),g=new S.Z,Z=new S.Z,y=new S.Z,b=new S.Z,v=new n2.Z,T=new n5.Z,E=[,,,,],x=new S.Z,w=[,,,],C=new er.Z;if(!(0,_.Z)(l)||S.Z.equals(S.Z.unpack(l),S.Z.ZERO)){let e=f.Z.fromPoints(m);for(n=0;n<m.length;n++)S.Z.subtract(m[n],e.center,ms),d[3*n+0]=ms.x,d[3*n+1]=ms.y,d[3*n+2]=ms.z;let i=er.Z.fromTranslation(e.center,mc);t.transform=er.Z.multiplyTransformation(i,t.transform,t.transform)}for(n=0;n<s;n++){g=S.Z.clone(m[n]),(0,_.Z)(l)&&S.Z.add(g,S.Z.unpack(l),g),u&&(function(e,t,i,n,r,o,a,s,l,c){let u=e.getProperty("NORMAL_UP",eM.Z.FLOAT,3,i,ml),h=e.getProperty("NORMAL_RIGHT",eM.Z.FLOAT,3,i,mu),d=!1;if((0,_.Z)(u)){if(!(0,_.Z)(h))throw new e3.Z("To define a custom orientation, both NORMAL_UP and NORMAL_RIGHT must be defined.");S.Z.unpack(u,0,o),S.Z.unpack(h,0,a),d=!0}else{let n=e.getProperty("NORMAL_UP_OCT32P",eM.Z.UNSIGNED_SHORT,2,i,ml),s=e.getProperty("NORMAL_RIGHT_OCT32P",eM.Z.UNSIGNED_SHORT,2,i,mu);if((0,_.Z)(n)){if(!(0,_.Z)(s))throw new e3.Z("To define a custom orientation with oct-encoded vectors, both NORMAL_UP_OCT32P and NORMAL_RIGHT_OCT32P must be defined.");eL.Z.octDecodeInRange(n[0],n[1],65535,o),eL.Z.octDecodeInRange(s[0],s[1],65535,a),d=!0}else t?(n9.Z.eastNorthUpToFixedFrame(r,el.Z.WGS84,c),er.Z.getMatrix3(c,l)):n2.Z.clone(n2.Z.IDENTITY,l)}d&&(S.Z.cross(a,o,s),S.Z.normalize(s,s),n2.Z.setColumn(l,0,a,l),n2.Z.setColumn(l,1,o,l),n2.Z.setColumn(l,2,s,l)),n5.Z.fromRotationMatrix(l,n)}(a,c,n,T,g,y,Z,b,v,C),n5.Z.pack(T,E,0),r[4*n+0]=E[0],r[4*n+1]=E[1],r[4*n+2]=E[2],r[4*n+3]=E[3]),h&&(function(e,t,i){i=S.Z.fromElements(1,1,1,i);let n=e.getProperty("SCALE",eM.Z.FLOAT,1,t);(0,_.Z)(n)&&S.Z.multiplyByScalar(i,n,i);let r=e.getProperty("SCALE_NON_UNIFORM",eM.Z.FLOAT,3,t,ml);(0,_.Z)(r)&&(i.x*=r[0],i.y*=r[1],i.z*=r[2])}(a,n,x),S.Z.pack(x,w,0),o[3*n+0]=w[0],o[3*n+1]=w[1],o[3*n+2]=w[2]);let e=a.getProperty("BATCH_ID",eM.Z.UNSIGNED_SHORT,1,n);(0,_.Z)(e)||(e=n),p[n]=e}let A=new mo;A.transformInWorldSpace=!0;let I=e._buffers,O=new mn;if(O.name="Instance Translation",O.semantic=fO.TRANSLATION,O.componentDatatype=eM.Z.FLOAT,O.type=dH.Z.VEC3,O.count=s,O.typedArray=d,!u){let e=ek.Z.createVertexBuffer({context:i.context,typedArray:d,usage:eV.Z.STATIC_DRAW});e.vertexArrayDestroyable=!1,I.push(e),O.buffer=e}if(A.attributes.push(O),u){let e=new mn;e.name="Instance Rotation",e.semantic=fO.ROTATION,e.componentDatatype=eM.Z.FLOAT,e.type=dH.Z.VEC4,e.count=s,e.typedArray=r,A.attributes.push(e)}if(h){let e=new mn;if(e.name="Instance Scale",e.semantic=fO.SCALE,e.componentDatatype=eM.Z.FLOAT,e.type=dH.Z.VEC3,e.count=s,u)e.typedArray=o;else{let t=ek.Z.createVertexBuffer({context:i.context,typedArray:o,usage:eV.Z.STATIC_DRAW});t.vertexArrayDestroyable=!1,I.push(t),e.buffer=t}A.attributes.push(e)}let D=new mn;D.name="Instance Feature ID",D.setIndex=0,D.semantic=fO.FEATURE_ID,D.componentDatatype=eM.Z.FLOAT,D.type=dH.Z.SCALAR,D.count=s;let P=ek.Z.createVertexBuffer({context:i.context,typedArray:p,usage:eV.Z.STATIC_DRAW});P.vertexArrayDestroyable=!1,I.push(P),D.buffer=P,A.attributes.push(D);let R=new mr;R.propertyTableId=0,R.setIndex=0,R.positionalLabel="instanceFeatureId_0",A.featureIds.push(R);let N=t.nodes,L=N.length,M=!1;for(n=0;n<L;n++){let e=N[n];e.primitives.length>0&&(e.instances=M?function(e){let t=new mo;t.transformInWorldSpace=e.transformInWorldSpace;let i=e.attributes,n=i.length;for(let e=0;e<n;e++){let n=(0,uz.Z)(i[e],!1);t.attributes.push(n)}return t.featureIds=e.featureIds,t}(A):A,M=!0)}}(this,n,e),function(e,t){let i;let n=e._batchTable,r=e._instancesLength;0!==r&&(i=(0,_.Z)(n.json)?p$({count:r,batchTable:n.json,binaryBody:n.binary}):new hn({schema:{},propertyTables:[new uV({name:fs.BATCH_TABLE_CLASS_NAME,count:r})]}),t.structuralMetadata=i)}(this,n),this._components=n,this._arrayBuffer=void 0,this._state=4,!0};let ms=new S.Z,ml=[,,,,],mc=new er.Z,mu=[,,,,];ma.prototype.isUnloaded=function(){return 6===this._state},ma.prototype.unload=function(){(0,_.Z)(this._gltfLoader)&&!this._gltfLoader.isDestroyed()&&this._gltfLoader.unload(),function(e){let t=e._buffers,i=t.length;for(let e=0;e<i;e++){let i=t[e];i.isDestroyed()||i.destroy()}t.length=0}(this),this._components=void 0,this._arrayBuffer=void 0,this._state=6};var mh=Object.freeze({NONE:0,REPEAT:1,MIRRORED_REPEAT:2}),md=Object.freeze({STOPPED:0,ANIMATING:1});function mf(){this.times=void 0,this.points=void 0,A.Z.throwInstantiationError()}function mp(e){this._value=e,this._valueType=mf.getPointType(e)}function mm(e){let t=(e=(0,m.Z)(e,m.Z.EMPTY_OBJECT)).points,i=e.times;if(!(0,_.Z)(t)||!(0,_.Z)(i))throw new A.Z("points and times are required.");if(t.length<2)throw new A.Z("points.length must be greater than or equal to 2.");if(i.length!==t.length)throw new A.Z("times.length must be equal to points.length.");this._times=i,this._points=t,this._pointType=mf.getPointType(t[0]),this._lastTimeIndex=0}mf.getPointType=function(e){if("number"==typeof e)return Number;if(e instanceof S.Z)return S.Z;if(e instanceof n5.Z)return n5.Z;throw new A.Z("point must be a Cartesian3, Quaternion, or number.")},mf.prototype.evaluate=A.Z.throwInstantiationError,mf.prototype.findTimeInterval=function(e,t){let i;let n=this.times,r=n.length;if(p.Z.typeOf.number("time",e),e<n[0]||e>n[r-1])throw new A.Z("time is out of range.");if(e>=n[t=(0,m.Z)(t,0)]){if(t+1<r&&e<n[t+1])return t;if(t+2<r&&e<n[t+2])return t+1}else if(t-1>=0&&e>=n[t-1])return t-1;if(e>n[t])for(i=t;i<r-1&&(!(e>=n[i])||!(e<n[i+1]));++i);else for(i=t-1;i>=0&&(!(e>=n[i])||!(e<n[i+1]));--i);return i===r-1&&(i=r-2),i},mf.prototype.wrapTime=function(e){let t;p.Z.typeOf.number("time",e);let i=this.times,n=i[i.length-1],r=i[0],o=n-r;return e<r&&(t=Math.floor((r-e)/o)+1,e+=t*o),e>n&&(t=Math.floor((e-n)/o)+1,e-=t*o),e},mf.prototype.clampTime=function(e){p.Z.typeOf.number("time",e);let t=this.times;return eB.Z.clamp(e,t[0],t[t.length-1])},Object.defineProperties(mp.prototype,{value:{get:function(){return this._value}}}),mp.prototype.findTimeInterval=function(e){throw new A.Z("findTimeInterval cannot be called on a ConstantSpline.")},mp.prototype.wrapTime=function(e){return p.Z.typeOf.number("time",e),0},mp.prototype.clampTime=function(e){return p.Z.typeOf.number("time",e),0},mp.prototype.evaluate=function(e,t){p.Z.typeOf.number("time",e);let i=this._value,n=this._valueType;return n===Number?i:n.clone(i,t)},Object.defineProperties(mm.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}}}),mm.prototype.findTimeInterval=mf.prototype.findTimeInterval,mm.prototype.wrapTime=mf.prototype.wrapTime,mm.prototype.clampTime=mf.prototype.clampTime,mm.prototype.evaluate=function(e,t){let i=this.points,n=this.times,r=this._lastTimeIndex=this.findTimeInterval(e,this._lastTimeIndex),o=(e-n[r])/(n[r+1]-n[r]);return this._pointType===Number?(1-o)*i[r]+o*i[r+1]:((0,_.Z)(t)||(t=new S.Z),S.Z.lerp(i[r],i[r+1],o,t))};let m_={};m_.solve=function(e,t,i,n){let r,o;if(!(0,_.Z)(e)||!(e instanceof Array))throw new A.Z("The array lower is required.");if(!(0,_.Z)(t)||!(t instanceof Array))throw new A.Z("The array diagonal is required.");if(!(0,_.Z)(i)||!(i instanceof Array))throw new A.Z("The array upper is required.");if(!(0,_.Z)(n)||!(n instanceof Array))throw new A.Z("The array right is required.");if(t.length!==n.length)throw new A.Z("diagonal and right must have the same lengths.");if(e.length!==i.length)throw new A.Z("lower and upper must have the same lengths.");if(e.length!==t.length-1)throw new A.Z("lower and upper must be one less than the length of diagonal.");let a=Array(i.length),s=Array(n.length),l=Array(n.length);for(r=0;r<s.length;r++)s[r]=new S.Z,l[r]=new S.Z;for(r=1,a[0]=i[0]/t[0],s[0]=S.Z.multiplyByScalar(n[0],1/t[0],s[0]);r<a.length;++r)o=1/(t[r]-a[r-1]*e[r-1]),a[r]=i[r]*o,s[r]=S.Z.subtract(n[r],S.Z.multiplyByScalar(s[r-1],e[r-1],s[r]),s[r]),s[r]=S.Z.multiplyByScalar(s[r],o,s[r]);for(o=1/(t[r]-a[r-1]*e[r-1]),s[r]=S.Z.subtract(n[r],S.Z.multiplyByScalar(s[r-1],e[r-1],s[r]),s[r]),s[r]=S.Z.multiplyByScalar(s[r],o,s[r]),l[l.length-1]=s[s.length-1],r=l.length-2;r>=0;--r)l[r]=S.Z.subtract(s[r],S.Z.multiplyByScalar(l[r+1],a[r],l[r]),l[r]);return l};let mg=[],mZ=[],my=[],mb=[];function mv(e){let t=(e=(0,m.Z)(e,m.Z.EMPTY_OBJECT)).points,i=e.times,n=e.inTangents,r=e.outTangents;if(!(0,_.Z)(t)||!(0,_.Z)(i)||!(0,_.Z)(n)||!(0,_.Z)(r))throw new A.Z("times, points, inTangents, and outTangents are required.");if(t.length<2)throw new A.Z("points.length must be greater than or equal to 2.");if(i.length!==t.length)throw new A.Z("times.length must be equal to points.length.");if(n.length!==r.length||n.length!==t.length-1)throw new A.Z("inTangents and outTangents must have a length equal to points.length - 1.");if(this._times=i,this._points=t,this._pointType=mf.getPointType(t[0]),this._pointType!==mf.getPointType(n[0])||this._pointType!==mf.getPointType(r[0]))throw new A.Z("inTangents and outTangents must be of the same type as points.");this._inTangents=n,this._outTangents=r,this._lastTimeIndex=0}Object.defineProperties(mv.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}},inTangents:{get:function(){return this._inTangents}},outTangents:{get:function(){return this._outTangents}}}),mv.createC1=function(e){let t=(e=(0,m.Z)(e,m.Z.EMPTY_OBJECT)).times,i=e.points,n=e.tangents;if(!(0,_.Z)(i)||!(0,_.Z)(t)||!(0,_.Z)(n))throw new A.Z("points, times and tangents are required.");if(i.length<2)throw new A.Z("points.length must be greater than or equal to 2.");if(t.length!==i.length||t.length!==n.length)throw new A.Z("times, points and tangents must have the same length.");let r=n.slice(0,n.length-1);return new mv({times:t,points:i,inTangents:n.slice(1,n.length),outTangents:r})},mv.createNaturalCubic=function(e){let t=(e=(0,m.Z)(e,m.Z.EMPTY_OBJECT)).times,i=e.points;if(!(0,_.Z)(i)||!(0,_.Z)(t))throw new A.Z("points and times are required.");if(i.length<2)throw new A.Z("points.length must be greater than or equal to 2.");if(t.length!==i.length)throw new A.Z("times.length must be equal to points.length.");if(i.length<3)return new mm({points:i,times:t});let n=function(e){let t;mg.length=my.length=e.length-1,mZ.length=mb.length=e.length,mg[0]=my[0]=1,mZ[0]=2;let i=mb[0];for((0,_.Z)(i)||(i=mb[0]=new S.Z),S.Z.subtract(e[1],e[0],i),S.Z.multiplyByScalar(i,3,i),t=1;t<mg.length;++t)mg[t]=my[t]=1,mZ[t]=4,i=mb[t],(0,_.Z)(i)||(i=mb[t]=new S.Z),S.Z.subtract(e[t+1],e[t-1],i),S.Z.multiplyByScalar(i,3,i);return mZ[t]=2,i=mb[t],(0,_.Z)(i)||(i=mb[t]=new S.Z),S.Z.subtract(e[t],e[t-1],i),S.Z.multiplyByScalar(i,3,i),m_.solve(mg,mZ,my,mb)}(i),r=n.slice(0,n.length-1);return new mv({times:t,points:i,inTangents:n.slice(1,n.length),outTangents:r})},mv.createClampedCubic=function(e){let t=(e=(0,m.Z)(e,m.Z.EMPTY_OBJECT)).times,i=e.points,n=e.firstTangent,r=e.lastTangent;if(!(0,_.Z)(i)||!(0,_.Z)(t)||!(0,_.Z)(n)||!(0,_.Z)(r))throw new A.Z("points, times, firstTangent and lastTangent are required.");if(i.length<2)throw new A.Z("points.length must be greater than or equal to 2.");if(t.length!==i.length)throw new A.Z("times.length must be equal to points.length.");let o=mf.getPointType(i[0]);if(o!==mf.getPointType(n)||o!==mf.getPointType(r))throw new A.Z("firstTangent and lastTangent must be of the same type as points.");if(i.length<3)return new mm({points:i,times:t});let a=function(e,t,i){let n;mg.length=my.length=e.length-1,mZ.length=mb.length=e.length,mg[0]=mZ[0]=1,my[0]=0;let r=mb[0];for((0,_.Z)(r)||(r=mb[0]=new S.Z),S.Z.clone(t,r),n=1;n<mg.length-1;++n)mg[n]=my[n]=1,mZ[n]=4,r=mb[n],(0,_.Z)(r)||(r=mb[n]=new S.Z),S.Z.subtract(e[n+1],e[n-1],r),S.Z.multiplyByScalar(r,3,r);return mg[n]=0,my[n]=1,mZ[n]=4,r=mb[n],(0,_.Z)(r)||(r=mb[n]=new S.Z),S.Z.subtract(e[n+1],e[n-1],r),S.Z.multiplyByScalar(r,3,r),mZ[n+1]=1,r=mb[n+1],(0,_.Z)(r)||(r=mb[n+1]=new S.Z),S.Z.clone(i,r),m_.solve(mg,mZ,my,mb)}(i,n,r),s=a.slice(0,a.length-1);return new mv({times:t,points:i,inTangents:a.slice(1,a.length),outTangents:s})},mv.hermiteCoefficientMatrix=new er.Z(2,-3,0,1,-2,3,0,0,1,-2,1,0,1,-1,0,0),mv.prototype.findTimeInterval=mf.prototype.findTimeInterval;let mT=new eo.Z,mE=new S.Z;function mx(e){let t=(e=(0,m.Z)(e,m.Z.EMPTY_OBJECT)).points,i=e.times;if(!(0,_.Z)(t)||!(0,_.Z)(i))throw new A.Z("points and times are required.");if(t.length<2)throw new A.Z("points.length must be greater than or equal to 2.");if(i.length!==t.length)throw new A.Z("times.length must be equal to points.length.");this._times=i,this._points=t,this._pointType=mf.getPointType(t[0]),this._lastTimeIndex=0}function mw(e){let t=(e=(0,m.Z)(e,m.Z.EMPTY_OBJECT)).points,i=e.times;if(!(0,_.Z)(t)||!(0,_.Z)(i))throw new A.Z("points and times are required.");if(t.length<2)throw new A.Z("points.length must be greater than or equal to 2.");if(i.length!==t.length)throw new A.Z("times.length must be equal to points.length.");this._times=i,this._points=t,this._evaluateFunction=function(e){let t=e.points,i=e.times;return function(n,r){(0,_.Z)(r)||(r=new n5.Z);let o=e._lastTimeIndex=e.findTimeInterval(n,e._lastTimeIndex),a=(n-i[o])/(i[o+1]-i[o]),s=t[o],l=t[o+1];return n5.Z.fastSlerp(s,l,a,r)}}(this),this._lastTimeIndex=0}mv.prototype.wrapTime=mf.prototype.wrapTime,mv.prototype.clampTime=mf.prototype.clampTime,mv.prototype.evaluate=function(e,t){let i=this.points,n=this.times,r=this.inTangents,o=this.outTangents;this._lastTimeIndex=this.findTimeInterval(e,this._lastTimeIndex);let a=this._lastTimeIndex,s=n[a+1]-n[a],l=(e-n[a])/s;mT.z=l,mT.y=l*l,mT.x=mT.y*l,mT.w=1;let c=er.Z.multiplyByVector(mv.hermiteCoefficientMatrix,mT,mT);c.z*=s,c.w*=s;let u=this._pointType;return u===Number?i[a]*c.x+i[a+1]*c.y+o[a]*c.z+r[a]*c.w:((0,_.Z)(t)||(t=new u),t=u.multiplyByScalar(i[a],c.x,t),u.multiplyByScalar(i[a+1],c.y,mE),u.add(t,mE,t),u.multiplyByScalar(o[a],c.z,mE),u.add(t,mE,t),u.multiplyByScalar(r[a],c.w,mE),u.add(t,mE,t))},Object.defineProperties(mx.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}}}),mx.prototype.findTimeInterval=mf.prototype.findTimeInterval,mx.prototype.wrapTime=mf.prototype.wrapTime,mx.prototype.clampTime=mf.prototype.clampTime,mx.prototype.evaluate=function(e,t){let i=this.points;this._lastTimeIndex=this.findTimeInterval(e,this._lastTimeIndex);let n=this._lastTimeIndex,r=this._pointType;return r===Number?i[n]:((0,_.Z)(t)||(t=new r),r.clone(i[n],t))},Object.defineProperties(mw.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}}}),mw.prototype.findTimeInterval=mf.prototype.findTimeInterval,mw.prototype.wrapTime=mf.prototype.wrapTime,mw.prototype.clampTime=mf.prototype.clampTime,mw.prototype.evaluate=function(e,t){return this._evaluateFunction(e,t)};let mS=uX.AnimatedPropertyType;function mC(e){let t=(e=(0,m.Z)(e,m.Z.EMPTY_OBJECT)).channel,i=e.runtimeAnimation,n=e.runtimeNode;p.Z.typeOf.object("options.channel",t),p.Z.typeOf.object("options.runtimeAnimation",i),p.Z.typeOf.object("options.runtimeNode",n),this._channel=t,this._runtimeAnimation=i,this._runtimeNode=n,this._splines=[],this._path=void 0,function(e){let t=e._channel,i=t.sampler,n=i.input,r=i.output,o=i.interpolation,a=t.target.path,s=e._runtimeNode,l=function(e,t,i,n,r){let o=[];if(n===mS.WEIGHTS){let a,s;let l=t.length/r;for(a=0;a<r;a++){let c=Array(l),u=a;if(i===uR.CUBICSPLINE)for(s=0;s<l;s+=3)c[s]=t[u],c[s+1]=t[u+r],c[s+2]=t[u+2*r],u+=3*r;else for(s=0;s<l;s++)c[s]=t[u],u+=r;o.push(mA(e,c,i,n))}}else o.push(mA(e,t,i,n));return o}(n,r,o,a,(0,_.Z)(s.morphWeights)?s.morphWeights.length:1);e._splines=l,e._path=a}(this)}function mA(e,t,i,n){if(1===e.length&&1===t.length)return new mp(t[0]);switch(i){case uR.STEP:return new mx({times:e,points:t});case uR.CUBICSPLINE:return function(e,t){let i=[],n=[],r=[],o=t.length;for(let e=0;e<o;e+=3)n.push(t[e]),i.push(t[e+1]),r.push(t[e+2]);return n.splice(0,1),r.length=r.length-1,new mv({times:e,points:i,inTangents:n,outTangents:r})}(e,t);case uR.LINEAR:if(n===mS.ROTATION)return new mw({times:e,points:t});return new mm({times:e,points:t})}}Object.defineProperties(mC.prototype,{channel:{get:function(){return this._channel}},runtimeAnimation:{get:function(){return this._runtimeAnimation}},runtimeNode:{get:function(){return this._runtimeNode}},splines:{get:function(){return this._splines}}});let mI=new S.Z,mO=new n5.Z;function mD(e,t,i){this._animation=t,this._name=t.name,this._runtimeChannels=void 0,this._startTime=nt.Z.clone(i.startTime),this._delay=(0,m.Z)(i.delay,0),this._stopTime=nt.Z.clone(i.stopTime),this.removeOnStop=(0,m.Z)(i.removeOnStop,!1),this._multiplier=(0,m.Z)(i.multiplier,1),this._reverse=(0,m.Z)(i.reverse,!1),this._loop=(0,m.Z)(i.loop,mh.NONE),this._animationTime=i.animationTime,this._prevAnimationDelta=void 0,this.start=new et.Z,this.update=new et.Z,this.stop=new et.Z,this._state=md.STOPPED,this._computedStartTime=void 0,this._duration=void 0;let n=this;this._raiseStartEvent=function(){n.start.raiseEvent(e,n)},this._updateEventTime=0,this._raiseUpdateEvent=function(){n.update.raiseEvent(e,n,n._updateEventTime)},this._raiseStopEvent=function(){n.stop.raiseEvent(e,n)},this._model=e,this._localStartTime=void 0,this._localStopTime=void 0,function(e){let t=Number.MAX_VALUE,i=-Number.MAX_VALUE,n=e._model.sceneGraph,r=e._animation.channels,o=r.length,a=[];for(let s=0;s<o;s++){let o=r[s],l=o.target;if(!(0,_.Z)(l))continue;let c=l.node.index,u=new mC({channel:o,runtimeAnimation:e,runtimeNode:n._runtimeNodes[c]}),h=o.sampler.input;t=Math.min(t,h[0]),i=Math.max(i,h[h.length-1]),a.push(u)}e._runtimeChannels=a,e._localStartTime=t,e._localStopTime=i}(this)}function mP(e){this.animationAdded=new et.Z,this.animationRemoved=new et.Z,this.animateWhilePaused=!1,this._model=e,this._runtimeAnimations=[],this._previousTime=void 0}function mR(e,t,i){let n=e._model,r=new mD(n,t,i);return e._runtimeAnimations.push(r),e.animationAdded.raiseEvent(n,r),r}mC.prototype.animate=function(e){let t=this._splines,i=this._path,n=this._runtimeAnimation.model,r=this._runtimeNode;if(i===mS.WEIGHTS){let i=r.morphWeights,o=i.length;for(let r=0;r<o;r++){let o=t[r],a=n.clampAnimations?o.clampTime(e):o.wrapTime(e);i[r]=o.evaluate(a)}}else{if(r.userAnimated)return;let o=t[0],a=n.clampAnimations?o.clampTime(e):o.wrapTime(e);i===mS.TRANSLATION||i===mS.SCALE?r[i]=o.evaluate(a,mI):i===mS.ROTATION&&(r[i]=o.evaluate(a,mO))}},Object.defineProperties(mD.prototype,{animation:{get:function(){return this._animation}},name:{get:function(){return this._name}},runtimeChannels:{get:function(){return this._runtimeChannels}},model:{get:function(){return this._model}},localStartTime:{get:function(){return this._localStartTime}},localStopTime:{get:function(){return this._localStopTime}},startTime:{get:function(){return this._startTime}},delay:{get:function(){return this._delay}},stopTime:{get:function(){return this._stopTime}},multiplier:{get:function(){return this._multiplier}},reverse:{get:function(){return this._reverse}},loop:{get:function(){return this._loop}},animationTime:{get:function(){return this._animationTime}}}),mD.prototype.animate=function(e){let t=this._runtimeChannels,i=t.length;for(let n=0;n<i;n++)t[n].animate(e)},Object.defineProperties(mP.prototype,{length:{get:function(){return this._runtimeAnimations.length}},model:{get:function(){return this._model}}}),mP.prototype.add=function(e){e=(0,m.Z)(e,m.Z.EMPTY_OBJECT);let t=this._model;if(!t.ready)throw new A.Z("Animations are not loaded. Wait for Model.ready to be true.");let i=t.sceneGraph.components.animations;if(!(0,_.Z)(e.name)&&!(0,_.Z)(e.index))throw new A.Z("Either options.name or options.index must be defined.");if((0,_.Z)(e.multiplier)&&e.multiplier<=0)throw new A.Z("options.multiplier must be greater than zero.");if((0,_.Z)(e.index)&&(e.index>=i.length||e.index<0))throw new A.Z("options.index must be a valid animation index.");let n=e.index;if((0,_.Z)(n))return mR(this,i[n],e);let r=i.length;for(let t=0;t<r;++t)if(i[t].name===e.name){n=t;break}if(!(0,_.Z)(n))throw new A.Z("options.name must be a valid animation name.");return mR(this,i[n],e)},mP.prototype.addAll=function(e){e=(0,m.Z)(e,m.Z.EMPTY_OBJECT);let t=this._model;if(!t.ready)throw new A.Z("Animations are not loaded. Wait for Model.ready to be true.");if((0,_.Z)(e.multiplier)&&e.multiplier<=0)throw new A.Z("options.multiplier must be greater than zero.");let i=t.sceneGraph.components.animations,n=[],r=i.length;for(let t=0;t<r;++t){let r=mR(this,i[t],e);n.push(r)}return n},mP.prototype.remove=function(e){if(!(0,_.Z)(e))return!1;let t=this._runtimeAnimations,i=t.indexOf(e);return -1!==i&&(t.splice(i,1),this.animationRemoved.raiseEvent(this._model,e),!0)},mP.prototype.removeAll=function(){let e=this._model,t=this._runtimeAnimations,i=t.length;this._runtimeAnimations.length=0;for(let n=0;n<i;++n)this.animationRemoved.raiseEvent(e,t[n])},mP.prototype.contains=function(e){return!!(0,_.Z)(e)&&-1!==this._runtimeAnimations.indexOf(e)},mP.prototype.get=function(e){if(!(0,_.Z)(e))throw new A.Z("index is required.");if(e>=this._runtimeAnimations.length||e<0)throw new A.Z("index must be valid within the range of the collection");return this._runtimeAnimations[e]};let mN=[];mP.prototype.update=function(e){let t=this._runtimeAnimations,i=t.length;if(0===i)return this._previousTime=void 0,!1;if(!this.animateWhilePaused&&nt.Z.equals(e.time,this._previousTime))return!1;this._previousTime=nt.Z.clone(e.time,this._previousTime);let n=!1,r=e.time,o=this._model;for(let o=0;o<i;++o){let i=t[o];(0,_.Z)(i._computedStartTime)||(i._computedStartTime=nt.Z.addSeconds((0,m.Z)(i.startTime,r),i.delay,new nt.Z)),(0,_.Z)(i._duration)||(i._duration=i.localStopTime*(1/i.multiplier));let a=i._computedStartTime,s=i._duration,l=i.stopTime,c=nt.Z.lessThanOrEquals(a,r),u=(0,_.Z)(l)&&nt.Z.greaterThan(r,l),h=0;if(0!==s){let e=nt.Z.secondsDifference(u?l:r,a);h=(0,_.Z)(i._animationTime)?i._animationTime(s,e):e/s}let d=i.loop===mh.REPEAT||i.loop===mh.MIRRORED_REPEAT,f=(c||d&&!(0,_.Z)(i.startTime))&&(h<=1||d)&&!u;if((h!==i._prevAnimationDelta||f===(i._state===md.STOPPED))&&(i._prevAnimationDelta=h,f||i._state===md.ANIMATING)){if(f&&i._state===md.STOPPED&&(i._state=md.ANIMATING,i.start.numberOfListeners>0&&e.afterRender.push(i._raiseStartEvent)),i.loop===mh.REPEAT)h-=Math.floor(h);else if(i.loop===mh.MIRRORED_REPEAT){let e=Math.floor(h),t=h-e;h=e%2==1?1-t:t}i.reverse&&(h=1-h);let t=h*s*i.multiplier;t=eB.Z.clamp(t,i.localStartTime,i.localStopTime),i.animate(t),i.update.numberOfListeners>0&&(i._updateEventTime=t,e.afterRender.push(i._raiseUpdateEvent)),n=!0,!f&&(i._state=md.STOPPED,i.stop.numberOfListeners>0&&e.afterRender.push(i._raiseStopEvent),i.removeOnStop&&mN.push(i))}}i=mN.length;for(let n=0;n<i;++n){let i=mN[n];t.splice(t.indexOf(i),1),e.afterRender.push(function(e,t,i){return function(){e.animationRemoved.raiseEvent(t,i)}}(this,o,i))}return mN.length=0,n};var mL=i(5463);function mM(e){let t,i;p.Z.typeOf.number("options.featuresLength",e.featuresLength),p.Z.typeOf.object("options.owner",e.owner),this._id=(0,es.Z)();let n=e.featuresLength;if(this._showAlphaProperties=void 0,this._batchValues=void 0,this._batchValuesDirty=!1,this._batchTexture=void 0,this._defaultTexture=void 0,this._pickTexture=void 0,this._pickIds=[],n>0){let e=Math.min(n,eH.Z.maximumTextureSize),r=Math.ceil(n/eH.Z.maximumTextureSize),o=1/e,a=1/r;t=new w.Z(e,r),i=new eo.Z(o,.5*o,a,.5*a)}this._translucentFeaturesLength=0,this._featuresLength=n,this._textureDimensions=t,this._textureStep=i,this._owner=e.owner,this._statistics=e.statistics,this._colorChangedCallback=e.colorChangedCallback}function mF(e){let t=e._textureDimensions;return t.x*t.y*4}function mz(e){if(!(0,_.Z)(e._batchValues)){let t=new Uint8Array(mF(e)).fill(255);e._batchValues=t}return e._batchValues}function mB(e){if(!(0,_.Z)(e._showAlphaProperties)){let t=new Uint8Array(2*e._featuresLength).fill(255);e._showAlphaProperties=t}return e._showAlphaProperties}function mU(e,t){if(!(0,_.Z)(e)||e<0||e>=t)throw new A.Z(`batchId is required and between zero and featuresLength - 1 (${t}`-NaN)}Object.defineProperties(mM.prototype,{translucentFeaturesLength:{get:function(){return this._translucentFeaturesLength}},byteLength:{get:function(){let e=0;return(0,_.Z)(this._pickTexture)&&(e+=this._pickTexture.sizeInBytes),(0,_.Z)(this._batchTexture)&&(e+=this._batchTexture.sizeInBytes),e}},textureDimensions:{get:function(){return this._textureDimensions}},textureStep:{get:function(){return this._textureStep}},batchTexture:{get:function(){return this._batchTexture}},defaultTexture:{get:function(){return this._defaultTexture}},pickTexture:{get:function(){return this._pickTexture}}}),mM.DEFAULT_COLOR_VALUE=C.Z.WHITE,mM.DEFAULT_SHOW_VALUE=!0,mM.prototype.setShow=function(e,t){if(mU(e,this._featuresLength),p.Z.typeOf.bool("show",t),t&&!(0,_.Z)(this._showAlphaProperties))return;let i=mB(this),n=2*e,r=t?255:0;i[n]!==r&&(i[n]=r,mz(this)[4*e+3]=t?i[n+1]:0,this._batchValuesDirty=!0)},mM.prototype.setAllShow=function(e){p.Z.typeOf.bool("show",e);let t=this._featuresLength;for(let i=0;i<t;++i)this.setShow(i,e)},mM.prototype.getShow=function(e){if(mU(e,this._featuresLength),!(0,_.Z)(this._showAlphaProperties))return!0;let t=2*e;return 255===this._showAlphaProperties[t]};let mk=[,,,,];function mV(e,t,i){let n=e._textureDimensions;return new e5.Z({context:t,pixelFormat:e2.Z.RGBA,pixelDatatype:mL.Z.UNSIGNED_BYTE,source:{width:n.x,height:n.y,arrayBufferView:i},flipY:!1,sampler:uN.Z.NEAREST})}mM.prototype.setColor=function(e,t){if(mU(e,this._featuresLength),p.Z.typeOf.object("color",t),C.Z.equals(t,mM.DEFAULT_COLOR_VALUE)&&!(0,_.Z)(this._batchValues))return;let i=t.toBytes(mk),n=i[3],r=mz(this),o=4*e,a=mB(this),s=2*e;if(r[o]!==i[0]||r[o+1]!==i[1]||r[o+2]!==i[2]||a[s+1]!==n){r[o]=i[0],r[o+1]=i[1],r[o+2]=i[2];let l=255!==a[s+1],c=0!==a[s];r[o+3]=c?n:0,a[s+1]=n;let u=255!==n;u&&!l?++this._translucentFeaturesLength:!u&&l&&--this._translucentFeaturesLength,this._batchValuesDirty=!0,(0,_.Z)(this._colorChangedCallback)&&this._colorChangedCallback(e,t)}},mM.prototype.setAllColor=function(e){p.Z.typeOf.object("color",e);let t=this._featuresLength;for(let i=0;i<t;++i)this.setColor(i,e)},mM.prototype.getColor=function(e,t){if(mU(e,this._featuresLength),p.Z.typeOf.object("result",t),!(0,_.Z)(this._batchValues))return C.Z.clone(mM.DEFAULT_COLOR_VALUE,t);let i=this._batchValues,n=4*e,r=this._showAlphaProperties,o=2*e;return C.Z.fromBytes(i[n],i[n+1],i[n+2],r[o+1],t)},mM.prototype.getPickColor=function(e){return mU(e,this._featuresLength),this._pickIds[e]},mM.prototype.update=function(e,t){let i=t.context;this._defaultTexture=i.defaultTexture;let n=t.passes;(n.pick||n.postProcess)&&function(e,t){let i=e._featuresLength;if(!(0,_.Z)(e._pickTexture)&&i>0){let n=e._pickIds,r=new Uint8Array(mF(e)),o=e._owner,a=e._statistics;for(let e=0;e<i;++e){let i=t.createPickId(o.getFeature(e));n.push(i);let a=i.color,s=4*e;r[s]=C.Z.floatToByte(a.red),r[s+1]=C.Z.floatToByte(a.green),r[s+2]=C.Z.floatToByte(a.blue),r[s+3]=C.Z.floatToByte(a.alpha)}e._pickTexture=mV(e,t,r),(0,_.Z)(a)&&(a.batchTableByteLength+=e._pickTexture.sizeInBytes)}}(this,i),this._batchValuesDirty&&(this._batchValuesDirty=!1,!(0,_.Z)(this._batchTexture)&&(this._batchTexture=mV(this,i,this._batchValues),(0,_.Z)(this._statistics)&&(this._statistics.batchTableByteLength+=this._batchTexture.sizeInBytes)),function(e){let t=e._textureDimensions;e._batchTexture.copyFrom({source:{width:t.x,height:t.y,arrayBufferView:e._batchValues}})}(this))},mM.prototype.isDestroyed=function(){return!1},mM.prototype.destroy=function(){this._batchTexture=this._batchTexture&&this._batchTexture.destroy(),this._pickTexture=this._pickTexture&&this._pickTexture.destroy();let e=this._pickIds,t=e.length;for(let i=0;i<t;++i)e[i].destroy();return(0,g.Z)(this)};var mH=i(9344);function mG(e){this._model=e.model,this._featureTable=e.featureTable,this._featureId=e.featureId,this._color=void 0}Object.defineProperties(mG.prototype,{show:{get:function(){return this._featureTable.getShow(this._featureId)},set:function(e){this._featureTable.setShow(this._featureId,e)}},color:{get:function(){return(0,_.Z)(this._color)||(this._color=new C.Z),this._featureTable.getColor(this._featureId,this._color)},set:function(e){this._featureTable.setColor(this._featureId,e)}},primitive:{get:function(){return this._model}},featureTable:{get:function(){return this._featureTable}},featureId:{get:function(){return this._featureId}}}),mG.prototype.hasProperty=function(e){return this._featureTable.hasProperty(this._featureId,e)},mG.prototype.getProperty=function(e){return this._featureTable.getProperty(this._featureId,e)},mG.prototype.getPropertyInherited=function(e){return this._featureTable.hasPropertyBySemantic(this._featureId,e)?this._featureTable.getPropertyBySemantic(this._featureId,e):this._featureTable.getProperty(this._featureId,e)},mG.prototype.getPropertyIds=function(e){return this._featureTable.getPropertyIds(e)},mG.prototype.setProperty=function(e,t){return this._featureTable.setProperty(this._featureId,e,t)};let mj={ALL_OPAQUE:0,ALL_TRANSLUCENT:1,OPAQUE_AND_TRANSLUCENT:2};mj.getStyleCommandsNeeded=function(e,t){return 0===t?mj.ALL_OPAQUE:t===e?mj.ALL_TRANSLUCENT:mj.OPAQUE_AND_TRANSLUCENT};var mW=Object.freeze(mj);let mq={GLTF:"GLTF",TILE_GLTF:"TILE_GLTF",TILE_B3DM:"B3DM",TILE_I3DM:"I3DM",TILE_PNTS:"PNTS",TILE_GEOJSON:"TILE_GEOJSON"};mq.is3DTiles=function(e){switch(p.Z.typeOf.string("modelType",e),e){case mq.TILE_GLTF:case mq.TILE_B3DM:case mq.TILE_I3DM:case mq.TILE_PNTS:case mq.TILE_GEOJSON:return!0;case mq.GLTF:return!1;default:throw new A.Z("modelType is not a valid value.")}};var mY=Object.freeze(mq);function mX(e){let t=e.model,i=e.propertyTable;p.Z.typeOf.object("propertyTable",i),p.Z.typeOf.object("model",t),this._propertyTable=i,this._model=t,this._features=void 0,this._featuresLength=0,this._batchTexture=void 0,this._styleCommandsNeededDirty=!1,this._styleCommandsNeeded=mW.ALL_OPAQUE,function(e){let t;let i=e._model,n=mY.is3DTiles(i.type),r=e._propertyTable.count;if(0===r)return;let o=Array(r);if(n){let e=i.content;for(t=0;t<r;t++)o[t]=new mH.Z(e,t)}else for(t=0;t<r;t++)o[t]=new mG({model:i,featureId:t,featureTable:e});e._features=o,e._featuresLength=r,e._batchTexture=new mM({featuresLength:r,owner:e,statistics:n?i.content.tileset.statistics:void 0})}(this)}Object.defineProperties(mX.prototype,{batchTexture:{get:function(){return this._batchTexture}},featuresLength:{get:function(){return this._featuresLength}},batchTextureByteLength:{get:function(){return(0,_.Z)(this._batchTexture)?this._batchTexture.byteLength:0}},styleCommandsNeededDirty:{get:function(){return this._styleCommandsNeededDirty}}}),mX.prototype.update=function(e){this._styleCommandsNeededDirty=!1,this._batchTexture.update(void 0,e);let t=mW.getStyleCommandsNeeded(this._featuresLength,this._batchTexture.translucentFeaturesLength);this._styleCommandsNeeded!==t&&(this._styleCommandsNeededDirty=!0,this._styleCommandsNeeded=t)},mX.prototype.setShow=function(e,t){this._batchTexture.setShow(e,t)},mX.prototype.setAllShow=function(e){this._batchTexture.setAllShow(e)},mX.prototype.getShow=function(e){return this._batchTexture.getShow(e)},mX.prototype.setColor=function(e,t){this._batchTexture.setColor(e,t)},mX.prototype.setAllColor=function(e){this._batchTexture.setAllColor(e)},mX.prototype.getColor=function(e,t){return this._batchTexture.getColor(e,t)},mX.prototype.getPickColor=function(e){return this._batchTexture.getPickColor(e)},mX.prototype.getFeature=function(e){return this._features[e]},mX.prototype.hasProperty=function(e,t){return this._propertyTable.hasProperty(e,t)},mX.prototype.hasPropertyBySemantic=function(e,t){return this._propertyTable.hasPropertyBySemantic(e,t)},mX.prototype.getProperty=function(e,t){return this._propertyTable.getProperty(e,t)},mX.prototype.getPropertyBySemantic=function(e,t){return this._propertyTable.getPropertyBySemantic(e,t)},mX.prototype.getPropertyIds=function(e){return this._propertyTable.getPropertyIds(e)},mX.prototype.setProperty=function(e,t,i){return this._propertyTable.setProperty(e,t,i)},mX.prototype.isClass=function(e,t){return this._propertyTable.isClass(e,t)},mX.prototype.isExactClass=function(e,t){return this._propertyTable.isExactClass(e,t)},mX.prototype.getExactClassName=function(e){return this._propertyTable.getExactClassName(e)};let m$=new C.Z;mX.prototype.applyStyle=function(e){if(!(0,_.Z)(e)){this.setAllColor(mM.DEFAULT_COLOR_VALUE),this.setAllShow(mM.DEFAULT_SHOW_VALUE);return}for(let t=0;t<this._featuresLength;t++){let i=this.getFeature(t),n=(0,_.Z)(e.color)?(0,m.Z)(e.color.evaluateColor(i,m$),mM.DEFAULT_COLOR_VALUE):mM.DEFAULT_COLOR_VALUE,r=(0,_.Z)(e.show)?(0,m.Z)(e.show.evaluate(i),mM.DEFAULT_SHOW_VALUE):mM.DEFAULT_SHOW_VALUE;this.setColor(t,n),this.setShow(t,r)}},mX.prototype.isDestroyed=function(){return!1},mX.prototype.destroy=function(e){this._batchTexture=this._batchTexture&&this._batchTexture.destroy(),(0,g.Z)(this)};var mK=i(5292),mQ=i(8557),mJ=i(1022);function m0(e){let t=(e=(0,m.Z)(e,m.Z.EMPTY_OBJECT)).command,i=e.primitiveRenderResources;p.Z.typeOf.object("options.command",t),p.Z.typeOf.object("options.primitiveRenderResources",i);let n=i.model;this._command=t,this._model=n,this._runtimePrimitive=i.runtimePrimitive,this._modelMatrix=t.modelMatrix,this._boundingVolume=t.boundingVolume,this._cullFace=t.renderState.cull.face;let r=n.classificationType;this._classificationType=r,this._classifiesTerrain=r!==nd.Z.CESIUM_3D_TILE,this._classifies3DTiles=r!==nd.Z.TERRAIN,this._useDebugWireframe=n._enableDebugWireframe&&n.debugWireframe,this._pickId=i.pickId,this._commandListTerrain=[],this._commandList3DTiles=[],this._commandListIgnoreShow=[],this._commandListDebugWireframe=[],this._commandListTerrainPicking=[],this._commandList3DTilesPicking=[],function(e){let t=e._command;if(e._useDebugWireframe){t.pass=ej.Z.OPAQUE,m3.length=0,m3.push(t),e._commandListDebugWireframe=m4(e,m3,e._commandListDebugWireframe);let i=e._commandListDebugWireframe,n=i.length;for(let e=0;e<n;e++){let t=i[e];t.count*=2,t.offset*=2}return}let i=e.model.allowPicking;if(e._classifiesTerrain){let n=ej.Z.TERRAIN_CLASSIFICATION,r=m5(t,n),o=m9(t,n);m3.length=0,m3.push(r,o),e._commandListTerrain=m4(e,m3,e._commandListTerrain),i&&(e._commandListTerrainPicking=m6(e,m3,e._commandListTerrainPicking))}if(e._classifies3DTiles){let n=ej.Z.CESIUM_3D_TILE_CLASSIFICATION,r=m5(t,n),o=m9(t,n);m3.length=0,m3.push(r,o),e._commandList3DTiles=m4(e,m3,e._commandList3DTiles),i&&(e._commandList3DTilesPicking=m6(e,m3,e._commandList3DTilesPicking))}}(this)}let m1={stencilTest:{enabled:!0,frontFunction:mQ.Z.NOT_EQUAL,frontOperation:{fail:mJ.Z.ZERO,zFail:mJ.Z.ZERO,zPass:mJ.Z.ZERO},backFunction:mQ.Z.NOT_EQUAL,backOperation:{fail:mJ.Z.ZERO,zFail:mJ.Z.ZERO,zPass:mJ.Z.ZERO},reference:0,mask:pD.Z.CLASSIFICATION_MASK},stencilMask:pD.Z.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1,blending:eJ.Z.PRE_MULTIPLIED_ALPHA_BLEND},m2={stencilTest:{enabled:!0,frontFunction:mQ.Z.NOT_EQUAL,frontOperation:{fail:mJ.Z.ZERO,zFail:mJ.Z.ZERO,zPass:mJ.Z.ZERO},backFunction:mQ.Z.NOT_EQUAL,backOperation:{fail:mJ.Z.ZERO,zFail:mJ.Z.ZERO,zPass:mJ.Z.ZERO},reference:0,mask:pD.Z.CLASSIFICATION_MASK},stencilMask:pD.Z.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1},m3=[];function m4(e,t,i){let n=e._runtimePrimitive,r=n.batchLengths,o=n.batchOffsets,a=r.length,s=t.length;for(let e=0;e<a;e++){let n=r[e],a=o[e];for(let e=0;e<s;e++){let r=t[e],o=eG.Z.shallowClone(r);o.count=n,o.offset=a,i.push(o)}}return i}function m5(e,t){var i;let n=eG.Z.shallowClone(e);n.cull=!1,n.pass=t;let r={colorMask:{red:!1,green:!1,blue:!1,alpha:!1},stencilTest:{enabled:!0,frontFunction:i=t===ej.Z.TERRAIN_CLASSIFICATION?mQ.Z.ALWAYS:mQ.Z.EQUAL,frontOperation:{fail:mJ.Z.KEEP,zFail:mJ.Z.DECREMENT_WRAP,zPass:mJ.Z.KEEP},backFunction:i,backOperation:{fail:mJ.Z.KEEP,zFail:mJ.Z.INCREMENT_WRAP,zPass:mJ.Z.KEEP},reference:pD.Z.CESIUM_3D_TILE_MASK,mask:pD.Z.CESIUM_3D_TILE_MASK},stencilMask:pD.Z.CLASSIFICATION_MASK,depthTest:{enabled:!0,func:mK.Z.LESS_OR_EQUAL},depthMask:!1};return n.renderState=eW.Z.fromCache(r),n}function m9(e,t){let i=eG.Z.shallowClone(e);return i.cull=!1,i.pass=t,i.renderState=eW.Z.fromCache(m1),i}let m8=[];function m6(e,t,i){let n=eW.Z.fromCache(m2),r=t[0],o=t[1],a=eG.Z.shallowClone(r);a.cull=!0,a.pickOnly=!0;let s=eG.Z.shallowClone(o);return s.cull=!0,s.pickOnly=!0,s.renderState=n,s.pickId=e._pickId,m8.length=0,m8.push(a,s),m4(e,m8,i)}function m7(e){let t=(e=(0,m.Z)(e,m.Z.EMPTY_OBJECT)).command,i=e.primitiveRenderResources;p.Z.typeOf.object("options.command",t),p.Z.typeOf.object("options.primitiveRenderResources",i);let n=i.model;this._model=n;let r=i.runtimePrimitive;this._runtimePrimitive=r;let o=t.pass===ej.Z.TRANSLUCENT,a=r.primitive.material.doubleSided,s=i.hasSilhouette,l=i.hasSkipLevelOfDetail&&!o;this._command=t,this._modelMatrix=er.Z.clone(t.modelMatrix),this._boundingVolume=f.Z.clone(t.boundingVolume),this._modelMatrix2D=new er.Z,this._boundingVolume2D=new f.Z,this._modelMatrix2DDirty=!1,this._backFaceCulling=t.renderState.cull.enabled,this._cullFace=t.renderState.cull.face,this._shadows=n.shadows,this._debugShowBoundingVolume=t.debugShowBoundingVolume,this._usesBackFaceCulling=!a&&!o,this._needsTranslucentCommand=!o&&!s,this._needsSkipLevelOfDetailCommands=l,this._needsSilhouetteCommands=s,this._originalCommand=void 0,this._translucentCommand=void 0,this._skipLodBackfaceCommand=void 0,this._skipLodStencilCommand=void 0,this._silhouetteModelCommand=void 0,this._silhouetteColorCommand=void 0,this._derivedCommands=[],this._has2DCommands=!1,function(e){let t=e._command;t.modelMatrix=e._modelMatrix,t.boundingVolume=e._boundingVolume;let i=e._model,n=e._usesBackFaceCulling,r=e._derivedCommands;e._originalCommand=new _e({command:t,updateShadows:!0,updateBackFaceCulling:n,updateCullFace:n,updateDebugShowBoundingVolume:!0,is2D:!1}),r.push(e._originalCommand),e._needsTranslucentCommand&&(e._translucentCommand=new _e({command:function(e){let t=eG.Z.shallowClone(e);t.pass=ej.Z.TRANSLUCENT;let i=(0,uz.Z)(e.renderState,!0);return i.cull.enabled=!1,i.depthMask=!1,i.blending=eJ.Z.ALPHA_BLEND,t.renderState=eW.Z.fromCache(i),t}(t),updateShadows:!0,updateBackFaceCulling:!1,updateCullFace:!1,updateDebugShowBoundingVolume:!0}),r.push(e._translucentCommand)),e._needsSkipLevelOfDetailCommands&&(e._skipLodBackfaceCommand=new _e({command:function(e){let t=eG.Z.shallowClone(e),i=(0,uz.Z)(e.renderState,!0);i.cull.enabled=!0,i.cull.face=dW.Z.FRONT,i.colorMask={red:!1,green:!1,blue:!1,alpha:!1},i.polygonOffset={enabled:!0,factor:5,units:5};let n=(0,uz.Z)(t.uniformMap),r=new w.Z(5,5);return n.u_polygonOffset=function(){return r},t.renderState=eW.Z.fromCache(i),t.uniformMap=n,t.castShadows=!1,t.receiveShadows=!1,t}(t),updateShadows:!1,updateBackFaceCulling:!1,updateCullFace:n,updateDebugShowBoundingVolume:!1}),e._skipLodStencilCommand=new _e({command:function(e){let t=eG.Z.shallowClone(e),i=(0,uz.Z)(e.renderState,!0),{stencilTest:n}=i;return n.enabled=!0,n.mask=pD.Z.SKIP_LOD_MASK,n.reference=pD.Z.CESIUM_3D_TILE_MASK,n.frontFunction=mQ.Z.GREATER_OR_EQUAL,n.frontOperation.zPass=mJ.Z.REPLACE,n.backFunction=mQ.Z.GREATER_OR_EQUAL,n.backOperation.zPass=mJ.Z.REPLACE,i.stencilMask=pD.Z.CESIUM_3D_TILE_MASK|pD.Z.SKIP_LOD_MASK,t.renderState=eW.Z.fromCache(i),t}(t,i),updateShadows:!0,updateBackFaceCulling:n,updateCullFace:n,updateDebugShowBoundingVolume:!0}),r.push(e._skipLodBackfaceCommand),r.push(e._skipLodStencilCommand)),e._needsSilhouetteCommands&&(e._silhouetteModelCommand=new _e({command:function(e,t){let i=t._silhouetteId%255,n=eG.Z.shallowClone(e),r=(0,uz.Z)(e.renderState,!0);return r.stencilTest={enabled:!0,frontFunction:eU.Z.ALWAYS,backFunction:eU.Z.ALWAYS,reference:i,mask:-1,frontOperation:{fail:eU.Z.KEEP,zFail:eU.Z.KEEP,zPass:eU.Z.REPLACE},backOperation:{fail:eU.Z.KEEP,zFail:eU.Z.KEEP,zPass:eU.Z.REPLACE}},t.isInvisible()&&(r.colorMask={red:!1,green:!1,blue:!1,alpha:!1}),n.renderState=eW.Z.fromCache(r),n}(t,i),updateShadows:!0,updateBackFaceCulling:n,updateCullFace:n,updateDebugShowBoundingVolume:!0}),e._silhouetteColorCommand=new _e({command:function(e,t){let i=t._silhouetteId%255,n=eG.Z.shallowClone(e),r=(0,uz.Z)(e.renderState,!0);r.cull.enabled=!1,(e.pass===ej.Z.TRANSLUCENT||t.silhouetteColor.alpha<1)&&(n.pass=ej.Z.TRANSLUCENT,r.depthMask=!1,r.blending=eJ.Z.ALPHA_BLEND),r.stencilTest={enabled:!0,frontFunction:eU.Z.NOTEQUAL,backFunction:eU.Z.NOTEQUAL,reference:i,mask:-1,frontOperation:{fail:eU.Z.KEEP,zFail:eU.Z.KEEP,zPass:eU.Z.KEEP},backOperation:{fail:eU.Z.KEEP,zFail:eU.Z.KEEP,zPass:eU.Z.KEEP}};let o=(0,uz.Z)(e.uniformMap);return o.model_silhouettePass=function(){return!0},n.renderState=eW.Z.fromCache(r),n.uniformMap=o,n.castShadows=!1,n.receiveShadows=!1,n}(t,i),updateShadows:!1,updateBackFaceCulling:!1,updateCullFace:!1,updateDebugShowBoundingVolume:!1}),r.push(e._silhouetteModelCommand),r.push(e._silhouetteColorCommand))}(this)}function _e(e){this.command=e.command,this.updateShadows=e.updateShadows,this.updateBackFaceCulling=e.updateBackFaceCulling,this.updateCullFace=e.updateCullFace,this.updateDebugShowBoundingVolume=e.updateDebugShowBoundingVolume,this.is2D=(0,m.Z)(e.is2D,!1),this.derivedCommand2D=void 0}function _t(e,t,i){e.push(t.command),i&&e.push(t.derivedCommand2D.command)}function _i(e,t){if(t.mode!==eu.Z.SCENE2D||e.model._projectTo2D)return!1;let i=e.model.sceneGraph._boundingSphere2D,n=i.center.y-i.radius,r=i.center.y+i.radius,o=t.mapProjection.ellipsoid.maximumRadius*eB.Z.PI;return n<o&&r>o||n<-o&&r>-o}function _n(e,t){if(!(0,_.Z)(t))return;let i=_e.clone(t),n=eG.Z.shallowClone(t.command);return n.modelMatrix=e._modelMatrix2D,n.boundingVolume=e._boundingVolume2D,i.command=n,i.updateShadows=!1,i.is2D=!0,t.derivedCommand2D=i,e._derivedCommands.push(i),i}Object.defineProperties(m0.prototype,{command:{get:function(){return this._command}},runtimePrimitive:{get:function(){return this._runtimePrimitive}},batchLengths:{get:function(){return this._runtimePrimitive.batchLengths}},batchOffsets:{get:function(){return this._runtimePrimitive.batchOffsets}},model:{get:function(){return this._model}},classificationType:{get:function(){return this._classificationType}},modelMatrix:{get:function(){return this._modelMatrix},set:function(e){this._modelMatrix=er.Z.clone(e,this._modelMatrix);let t=this._runtimePrimitive.boundingSphere;this._boundingVolume=f.Z.transform(t,this._modelMatrix,this._boundingVolume)}},boundingVolume:{get:function(){return this._boundingVolume}},cullFace:{get:function(){return this._cullFace},set:function(e){this._cullFace=e}}}),m0.prototype.pushCommands=function(e,t){let i=e.passes;if(i.render){if(this._useDebugWireframe){t.push.apply(t,this._commandListDebugWireframe);return}if(this._classifiesTerrain&&t.push.apply(t,this._commandListTerrain),this._classifies3DTiles&&t.push.apply(t,this._commandList3DTiles),e.invertClassification&&this._classifies3DTiles){if(0===this._commandListIgnoreShow.length){let e=ej.Z.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW,t=m5(this._command,e);m3.length=0,m3.push(t),this._commandListIgnoreShow=m4(this,m3,this._commandListIgnoreShow)}t.push.apply(t,this._commandListIgnoreShow)}}return i.pick&&(this._classifiesTerrain&&t.push.apply(t,this._commandListTerrainPicking),this._classifies3DTiles&&t.push.apply(t,this._commandList3DTilesPicking)),t},_e.clone=function(e){return new _e({command:e.command,updateShadows:e.updateShadows,updateBackFaceCulling:e.updateBackFaceCulling,updateCullFace:e.updateCullFace,updateDebugShowBoundingVolume:e.updateDebugShowBoundingVolume,is2D:e.is2D,derivedCommand2D:e.derivedCommand2D})},Object.defineProperties(m7.prototype,{command:{get:function(){return this._command}},runtimePrimitive:{get:function(){return this._runtimePrimitive}},model:{get:function(){return this._model}},primitiveType:{get:function(){return this._command.primitiveType}},modelMatrix:{get:function(){return this._modelMatrix},set:function(e){this._modelMatrix=er.Z.clone(e,this._modelMatrix),this._modelMatrix2DDirty=!0,this._boundingVolume=f.Z.transform(this.runtimePrimitive.boundingSphere,this._modelMatrix,this._boundingVolume)}},boundingVolume:{get:function(){return this._boundingVolume}},shadows:{get:function(){return this._shadows},set:function(e){this._shadows=e,function(e){let t=e.shadows,i=nZ.Z.castShadows(t),n=nZ.Z.receiveShadows(t),r=e._derivedCommands;for(let e=0;e<r.length;++e){let t=r[e];if(t.updateShadows){let e=t.command;e.castShadows=i,e.receiveShadows=n}}}(this)}},backFaceCulling:{get:function(){return this._backFaceCulling},set:function(e){this._backFaceCulling!==e&&(this._backFaceCulling=e,function(e){let t=e.backFaceCulling,i=e._derivedCommands;for(let e=0;e<i.length;++e){let n=i[e];if(n.updateBackFaceCulling){let e=n.command,i=(0,uz.Z)(e.renderState,!0);i.cull.enabled=t,e.renderState=eW.Z.fromCache(i)}}}(this))}},cullFace:{get:function(){return this._cullFace},set:function(e){this._cullFace!==e&&(this._cullFace=e,function(e){let t=e.cullFace,i=e._derivedCommands;for(let e=0;e<i.length;++e){let n=i[e];if(n.updateCullFace){let e=n.command,i=(0,uz.Z)(e.renderState,!0);i.cull.face=t,e.renderState=eW.Z.fromCache(i)}}}(this))}},debugShowBoundingVolume:{get:function(){return this._debugShowBoundingVolume},set:function(e){this._debugShowBoundingVolume!==e&&(this._debugShowBoundingVolume=e,function(e){let t=e.debugShowBoundingVolume,i=e._derivedCommands;for(let e=0;e<i.length;++e){let n=i[e];n.updateDebugShowBoundingVolume&&(n.command.debugShowBoundingVolume=t)}}(this))}}}),m7.prototype.pushCommands=function(e,t){let i=_i(this,e);i&&!this._has2DCommands&&(_n(this,this._originalCommand),_n(this,this._translucentCommand),_n(this,this._skipLodBackfaceCommand),_n(this,this._skipLodStencilCommand),_n(this,this._silhouetteModelCommand),_n(this,this._silhouetteColorCommand),this._has2DCommands=!0,this._modelMatrix2DDirty=!0),this._modelMatrix2DDirty&&(function(e,t){let i=e._modelMatrix;e._modelMatrix2D=er.Z.clone(i,e._modelMatrix2D),e._modelMatrix2D[13]-=2*eB.Z.sign(i[13])*eB.Z.PI*t.mapProjection.ellipsoid.maximumRadius,e._boundingVolume2D=f.Z.transform(e.runtimePrimitive.boundingSphere,e._modelMatrix2D,e._boundingVolume2D)}(this,e),this._modelMatrix2DDirty=!1);let n=this.model.styleCommandsNeeded;if(!(this._needsTranslucentCommand&&(0,_.Z)(n))||(n!==mW.ALL_OPAQUE&&_t(t,this._translucentCommand,i),n!==mW.ALL_TRANSLUCENT)){if(this._needsSkipLevelOfDetailCommands){let{tileset:e,tile:n}=this._model.content;if(e.hasMixedContent){n._finalResolution||_t(e._backfaceCommands,this._skipLodBackfaceCommand,i),function(e,t,i){let n=e._skipLodStencilCommand,r=n.command,o=t._selectionDepth;if(o!==(r.renderState.stencilTest.reference&pD.Z.SKIP_LOD_MASK)>>>pD.Z.SKIP_LOD_BIT_SHIFT){let e=pD.Z.CESIUM_3D_TILE_MASK|o<<pD.Z.SKIP_LOD_BIT_SHIFT,t=(0,uz.Z)(r.renderState,!0);t.stencilTest.reference=e,r.renderState=eW.Z.fromCache(t),i&&(n.derivedCommand2D.renderState=t)}}(this,n,i),_t(t,this._skipLodStencilCommand,i);return}}if(this._needsSilhouetteCommands){_t(t,this._silhouetteModelCommand,i);return}return _t(t,this._originalCommand,i),t}},m7.prototype.pushSilhouetteCommands=function(e,t){let i=_i(this,e);return _t(t,this._silhouetteColorCommand,i),t};var _r=function(e,t){let i,n;let r=e.shaderBuilder;r.addVertexLines("precision highp float;\n\nczm_modelVertexOutput defaultVertexOutput(vec3 positionMC) {\n czm_modelVertexOutput vsOutput;\n vsOutput.positionMC = positionMC;\n vsOutput.pointSize = 1.0;\n return vsOutput;\n}\n\nvoid main()\n{\n // Initialize the attributes struct with all\n // attributes except quantized ones.\n ProcessedAttributes attributes;\n initializeAttributes(attributes);\n\n // Dequantize the quantized ones and add them to the\n // attributes struct.\n #ifdef USE_DEQUANTIZATION\n dequantizationStage(attributes);\n #endif\n\n #ifdef HAS_MORPH_TARGETS\n morphTargetsStage(attributes);\n #endif\n\n #ifdef HAS_SKINNING\n skinningStage(attributes);\n #endif\n\n #ifdef HAS_PRIMITIVE_OUTLINE\n primitiveOutlineStage();\n #endif\n\n // Compute the bitangent according to the formula in the glTF spec.\n // Normal and tangents can be affected by morphing and skinning, so\n // the bitangent should not be computed until their values are finalized.\n #ifdef HAS_BITANGENTS\n attributes.bitangentMC = normalize(cross(attributes.normalMC, attributes.tangentMC) * attributes.tangentSignMC);\n #endif\n\n FeatureIds featureIds;\n featureIdStage(featureIds, attributes);\n\n #ifdef HAS_SELECTED_FEATURE_ID\n SelectedFeature feature;\n selectedFeatureIdStage(feature, featureIds);\n // Handle any show properties that come from the style.\n cpuStylingStage(attributes.positionMC, feature);\n #endif\n\n #if defined(USE_2D_POSITIONS) || defined(USE_2D_INSTANCING)\n // The scene mode 2D pipeline stage and instancing stage add a different\n // model view matrix to accurately project the model to 2D. However, the\n // output positions and normals should be transformed by the 3D matrices\n // to keep the data the same for the fragment shader.\n mat4 modelView = czm_modelView3D;\n mat3 normal = czm_normal3D;\n #else\n // These are used for individual model projection because they will\n // automatically change based on the scene mode.\n mat4 modelView = czm_modelView;\n mat3 normal = czm_normal;\n #endif\n\n // Update the position for this instance in place\n #ifdef HAS_INSTANCING\n\n // The legacy instance stage is used when rendering i3dm models that\n // encode instances transforms in world space, as opposed to glTF models\n // that use EXT_mesh_gpu_instancing, where instance transforms are encoded\n // in object space.\n #ifdef USE_LEGACY_INSTANCING\n mat4 instanceModelView;\n mat3 instanceModelViewInverseTranspose;\n\n legacyInstancingStage(attributes, instanceModelView, instanceModelViewInverseTranspose);\n\n modelView = instanceModelView;\n normal = instanceModelViewInverseTranspose;\n #else\n instancingStage(attributes);\n #endif\n\n #ifdef USE_PICKING\n v_pickColor = a_pickColor;\n #endif\n\n #endif\n\n Metadata metadata;\n MetadataClass metadataClass;\n MetadataStatistics metadataStatistics;\n metadataStage(metadata, metadataClass, metadataStatistics, attributes);\n\n #ifdef HAS_VERTICAL_EXAGGERATION\n verticalExaggerationStage(attributes);\n #endif\n\n #ifdef HAS_CUSTOM_VERTEX_SHADER\n czm_modelVertexOutput vsOutput = defaultVertexOutput(attributes.positionMC);\n customShaderStage(vsOutput, attributes, featureIds, metadata, metadataClass, metadataStatistics);\n #endif\n\n // Compute the final position in each coordinate system needed.\n // This returns the value that will be assigned to gl_Position.\n vec4 positionClip = geometryStage(attributes, modelView, normal);\n\n // This must go after the geometry stage as it needs v_positionWC\n #ifdef HAS_ATMOSPHERE\n atmosphereStage(attributes);\n #endif\n\n #ifdef ENABLE_CLIPPING_POLYGONS\n modelClippingPolygonsStage(attributes);\n #endif\n\n #ifdef HAS_SILHOUETTE\n silhouetteStage(attributes, positionClip);\n #endif\n\n #ifdef HAS_POINT_CLOUD_SHOW_STYLE\n float show = pointCloudShowStylingStage(attributes, metadata);\n #else\n float show = 1.0;\n #endif\n\n #ifdef HAS_POINT_CLOUD_BACK_FACE_CULLING\n show *= pointCloudBackFaceCullingStage();\n #endif\n\n #ifdef HAS_POINT_CLOUD_COLOR_STYLE\n v_pointCloudColor = pointCloudColorStylingStage(attributes, metadata);\n #endif\n\n #ifdef PRIMITIVE_TYPE_POINTS\n #ifdef HAS_CUSTOM_VERTEX_SHADER\n gl_PointSize = vsOutput.pointSize;\n #elif defined(HAS_POINT_CLOUD_POINT_SIZE_STYLE) || defined(HAS_POINT_CLOUD_ATTENUATION)\n gl_PointSize = pointCloudPointSizeStylingStage(attributes, metadata);\n #else\n gl_PointSize = 1.0;\n #endif\n\n gl_PointSize *= show;\n #endif\n\n gl_Position = show * positionClip;\n}\n"),r.addFragmentLines("\nprecision highp float;\nczm_modelMaterial defaultModelMaterial()\n{\n czm_modelMaterial material;\n material.diffuse = vec3(0.0);\n material.specular = vec3(1.0);\n material.roughness = 1.0;\n material.occlusion = 1.0;\n material.normalEC = vec3(0.0, 0.0, 1.0);\n material.emissive = vec3(0.0);\n material.alpha = 1.0;\n return material;\n}\n\nvec4 handleAlpha(vec3 color, float alpha)\n{\n #ifdef ALPHA_MODE_MASK\n if (alpha < u_alphaCutoff) {\n discard;\n }\n #endif\n\n return vec4(color, alpha);\n}\n\nSelectedFeature selectedFeature;\n\nvoid main()\n{\n #ifdef HAS_MODEL_SPLITTER\n modelSplitterStage();\n #endif\n\n czm_modelMaterial material = defaultModelMaterial();\n\n ProcessedAttributes attributes;\n geometryStage(attributes);\n\n FeatureIds featureIds;\n featureIdStage(featureIds, attributes);\n\n Metadata metadata;\n MetadataClass metadataClass;\n MetadataStatistics metadataStatistics;\n metadataStage(metadata, metadataClass, metadataStatistics, attributes);\n\n #ifdef HAS_SELECTED_FEATURE_ID\n selectedFeatureIdStage(selectedFeature, featureIds);\n #endif\n\n #ifndef CUSTOM_SHADER_REPLACE_MATERIAL\n materialStage(material, attributes, selectedFeature);\n #endif\n\n #ifdef HAS_CUSTOM_FRAGMENT_SHADER\n customShaderStage(material, attributes, featureIds, metadata, metadataClass, metadataStatistics);\n #endif\n\n lightingStage(material, attributes);\n\n #ifdef HAS_SELECTED_FEATURE_ID\n cpuStylingStage(material, selectedFeature);\n #endif\n\n #ifdef HAS_MODEL_COLOR\n modelColorStage(material);\n #endif\n\n #ifdef HAS_PRIMITIVE_OUTLINE\n primitiveOutlineStage(material);\n #endif\n\n vec4 color = handleAlpha(material.diffuse, material.alpha);\n\n #ifdef HAS_CLIPPING_PLANES\n modelClippingPlanesStage(color);\n #endif\n\n #ifdef ENABLE_CLIPPING_POLYGONS\n modelClippingPolygonsStage();\n #endif\n\n #if defined(HAS_SILHOUETTE) && defined(HAS_NORMALS)\n silhouetteStage(color);\n #endif\n\n #ifdef HAS_ATMOSPHERE\n atmosphereStage(color, attributes);\n #endif\n\n out_FragColor = color;\n}\n");let o=function(e){let t=e.wireframeIndexBuffer;if((0,_.Z)(t))return t;let i=e.indices;if((0,_.Z)(i)){if(!(0,_.Z)(i.buffer))throw new A.Z("Indices must be provided as a Buffer");return i.buffer}}(e),a=new eX.Z({context:t.context,indexBuffer:o,attributes:e.attributes}),s=e.model;s._pipelineResources.push(a);let l=r.buildShaderProgram(t.context);s._pipelineResources.push(l);let c=e.alphaOptions.pass,u=s.sceneGraph,h=t.mode===eu.Z.SCENE3D;if(h||t.scene3DOnly||!s._projectTo2D){let t=h?u._computedModelMatrix:u._computedModelMatrix2D;i=er.Z.multiplyTransformation(t,e.runtimeNode.computedTransform,new er.Z),n=f.Z.transform(e.boundingSphere,i,e.boundingSphere)}else i=er.Z.multiplyTransformation(u._computedModelMatrix,e.runtimeNode.computedTransform,new er.Z),n=e.runtimePrimitive.boundingSphere2D;let d=(0,uz.Z)(eW.Z.fromCache(e.renderStateOptions),!0);d.cull.face=dq.getCullFace(i,e.primitiveType),d=eW.Z.fromCache(d);let p=(0,_.Z)(s.classificationType),m=!p&&nZ.Z.castShadows(s.shadows),g=!p&&nZ.Z.receiveShadows(s.shadows),Z=p?void 0:e.pickId,y=new eG.Z({boundingVolume:n,modelMatrix:i,uniformMap:e.uniformMap,renderState:d,vertexArray:a,shaderProgram:l,cull:s.cull,pass:c,count:e.count,owner:s,pickId:Z,instanceCount:e.instanceCount,primitiveType:e.primitiveType,debugShowBoundingVolume:s.debugShowBoundingVolume,castShadows:m,receiveShadows:g});return p?new m0({primitiveRenderResources:e,command:y}):new m7({primitiveRenderResources:e,command:y})},_o=i(8066);let _a={name:"TilesetPipelineStage"};_a.process=function(e,t,i){t.hasSkipLevelOfDetail(i)&&(e.shaderBuilder.addDefine("POLYGON_OFFSET",void 0,_o.Z.FRAGMENT),e.uniformMap=(0,hv.Z)({u_polygonOffset:function(){return w.Z.ZERO}},e.uniformMap),e.hasSkipLevelOfDetail=!0);let n=e.renderStateOptions;n.stencilTest=pD.Z.setCesium3DTileBit(),n.stencilMask=pD.Z.CESIUM_3D_TILE_MASK};let _s={name:"AtmospherePipelineStage"};_s.process=function(e,t,i){let n=e.shaderBuilder;n.addDefine("HAS_ATMOSPHERE",void 0,_o.Z.BOTH),n.addDefine("COMPUTE_POSITION_WC_ATMOSPHERE",void 0,_o.Z.BOTH),n.addVarying("vec3","v_atmosphereRayleighColor"),n.addVarying("vec3","v_atmosphereMieColor"),n.addVarying("float","v_atmosphereOpacity"),n.addVertexLines(["void atmosphereStage(ProcessedAttributes attributes) {\n vec3 lightDirection = czm_getDynamicAtmosphereLightDirection(v_positionWC, czm_atmosphereDynamicLighting);\n\n czm_computeGroundAtmosphereScattering(\n // This assumes the geometry stage came before this.\n v_positionWC,\n lightDirection,\n v_atmosphereRayleighColor,\n v_atmosphereMieColor,\n v_atmosphereOpacity\n );\n}\n"]),n.addFragmentLines(["// robust iterative solution without trig functions\n// https://github.com/0xfaded/ellipse_demo/issues/1\n// https://stackoverflow.com/questions/22959698/distance-from-given-point-to-given-ellipse\n//\n// This version uses only a single iteration for best performance. For fog\n// rendering, the difference is negligible.\nvec2 nearestPointOnEllipseFast(vec2 pos, vec2 radii) {\n vec2 p = abs(pos);\n vec2 inverseRadii = 1.0 / radii;\n vec2 evoluteScale = (radii.x * radii.x - radii.y * radii.y) * vec2(1.0, -1.0) * inverseRadii;\n\n // We describe the ellipse parametrically: v = radii * vec2(cos(t), sin(t))\n // but store the cos and sin of t in a vec2 for efficiency.\n // Initial guess: t = cos(pi/4)\n vec2 tTrigs = vec2(0.70710678118);\n vec2 v = radii * tTrigs;\n\n // Find the evolute of the ellipse (center of curvature) at v.\n vec2 evolute = evoluteScale * tTrigs * tTrigs * tTrigs;\n // Find the (approximate) intersection of p - evolute with the ellipsoid.\n vec2 q = normalize(p - evolute) * length(v - evolute);\n // Update the estimate of t.\n tTrigs = (q + evolute) * inverseRadii;\n tTrigs = normalize(clamp(tTrigs, 0.0, 1.0));\n v = radii * tTrigs;\n\n return v * sign(pos);\n}\n\nvec3 computeEllipsoidPositionWC(vec3 positionMC) {\n // Get the world-space position and project onto a meridian plane of\n // the ellipsoid\n vec3 positionWC = (czm_model * vec4(positionMC, 1.0)).xyz;\n\n vec2 positionEllipse = vec2(length(positionWC.xy), positionWC.z);\n vec2 nearestPoint = nearestPointOnEllipseFast(positionEllipse, czm_ellipsoidRadii.xz);\n\n // Reconstruct a 3D point in world space\n return vec3(nearestPoint.x * normalize(positionWC.xy), nearestPoint.y);\n}\n\nvoid applyFog(inout vec4 color, vec4 groundAtmosphereColor, vec3 lightDirection, float distanceToCamera) {\n\n vec3 fogColor = groundAtmosphereColor.rgb;\n\n // If there is dynamic lighting, apply that to the fog.\n const float NONE = 0.0;\n if (czm_atmosphereDynamicLighting != NONE) {\n float darken = clamp(dot(normalize(czm_viewerPositionWC), lightDirection), czm_fogMinimumBrightness, 1.0);\n fogColor *= darken;\n }\n\n // Tonemap if HDR rendering is disabled\n #ifndef HDR\n fogColor.rgb = czm_acesTonemapping(fogColor.rgb);\n fogColor.rgb = czm_inverseGamma(fogColor.rgb);\n #endif\n\n // Matches the constant in GlobeFS.glsl. This makes the fog falloff\n // more gradual.\n const float fogModifier = 0.15;\n vec3 withFog = czm_fog(distanceToCamera, color.rgb, fogColor, fogModifier);\n color = vec4(withFog, color.a);\n}\n\nvoid atmosphereStage(inout vec4 color, in ProcessedAttributes attributes) {\n vec3 rayleighColor;\n vec3 mieColor;\n float opacity;\n\n vec3 positionWC;\n vec3 lightDirection;\n\n // When the camera is in space, compute the position per-fragment for\n // more accurate ground atmosphere. All other cases will use\n //\n // The if condition will be added in https://github.com/CesiumGS/cesium/issues/11717\n if (false) {\n positionWC = computeEllipsoidPositionWC(attributes.positionMC);\n lightDirection = czm_getDynamicAtmosphereLightDirection(positionWC, czm_atmosphereDynamicLighting);\n\n // The fog color is derived from the ground atmosphere color\n czm_computeGroundAtmosphereScattering(\n positionWC,\n lightDirection,\n rayleighColor,\n mieColor,\n opacity\n );\n } else {\n positionWC = attributes.positionWC;\n lightDirection = czm_getDynamicAtmosphereLightDirection(positionWC, czm_atmosphereDynamicLighting);\n rayleighColor = v_atmosphereRayleighColor;\n mieColor = v_atmosphereMieColor;\n opacity = v_atmosphereOpacity;\n }\n\n //color correct rayleigh and mie colors\n const bool ignoreBlackPixels = true;\n rayleighColor = czm_applyHSBShift(rayleighColor, czm_atmosphereHsbShift, ignoreBlackPixels);\n mieColor = czm_applyHSBShift(mieColor, czm_atmosphereHsbShift, ignoreBlackPixels);\n\n vec4 groundAtmosphereColor = czm_computeAtmosphereColor(positionWC, lightDirection, rayleighColor, mieColor, opacity);\n\n if (u_isInFog) {\n float distanceToCamera = length(attributes.positionEC);\n applyFog(color, groundAtmosphereColor, lightDirection, distanceToCamera);\n } else {\n // Ground atmosphere\n }\n}\n"]),n.addUniform("bool","u_isInFog",_o.Z.FRAGMENT),e.uniformMap.u_isInFog=function(){let e=S.Z.distance(i.camera.positionWC,t.boundingSphere.center);return eB.Z.fog(e,i.fog.density)>eB.Z.EPSILON3}};let _l={name:"ImageBasedLightingPipelineStage"};_l.process=function(e,t,i){let n=t.imageBasedLighting,r=e.shaderBuilder;r.addDefine("USE_IBL_LIGHTING",void 0,_o.Z.FRAGMENT),r.addUniform("vec2","model_iblFactor",_o.Z.FRAGMENT),pC.Z.isSupported(i.context)&&((n.useSphericalHarmonics||n.useSpecularEnvironmentMaps||n.enabled)&&r.addUniform("mat3","model_iblReferenceFrameMatrix",_o.Z.FRAGMENT),(0,_.Z)(n.sphericalHarmonicCoefficients)?(r.addDefine("DIFFUSE_IBL",void 0,_o.Z.FRAGMENT),r.addDefine("CUSTOM_SPHERICAL_HARMONICS",void 0,_o.Z.FRAGMENT),r.addUniform("vec3","model_sphericalHarmonicCoefficients[9]",_o.Z.FRAGMENT)):n.useDefaultSphericalHarmonics&&r.addDefine("DIFFUSE_IBL",void 0,_o.Z.FRAGMENT),(0,_.Z)(n.specularEnvironmentMapAtlas)&&n.specularEnvironmentMapAtlas.ready?(r.addDefine("SPECULAR_IBL",void 0,_o.Z.FRAGMENT),r.addDefine("CUSTOM_SPECULAR_IBL",void 0,_o.Z.FRAGMENT),r.addUniform("sampler2D","model_specularEnvironmentMaps",_o.Z.FRAGMENT),r.addUniform("vec2","model_specularEnvironmentMapsSize",_o.Z.FRAGMENT),r.addUniform("float","model_specularEnvironmentMapsMaximumLOD",_o.Z.FRAGMENT)):t.useDefaultSpecularMaps&&r.addDefine("SPECULAR_IBL",void 0,_o.Z.FRAGMENT)),(0,_.Z)(n.luminanceAtZenith)&&(r.addDefine("USE_SUN_LUMINANCE",void 0,_o.Z.FRAGMENT),r.addUniform("float","model_luminanceAtZenith",_o.Z.FRAGMENT)),r.addFragmentLines('/**\n * Compute some metrics for a procedural sky lighting model\n *\n * @param {vec3} positionWC The position of the fragment in world coordinates.\n * @param {vec3} reflectionWC A unit vector in the direction of the reflection, in world coordinates.\n * @return {vec3} The dot products of the horizon and reflection directions with the nadir, and an atmosphere boundary distance.\n */\nvec3 getProceduralSkyMetrics(vec3 positionWC, vec3 reflectionWC)\n{\n // Figure out if the reflection vector hits the ellipsoid\n float horizonDotNadir = 1.0 - min(1.0, czm_ellipsoidRadii.x / length(positionWC));\n float reflectionDotNadir = dot(reflectionWC, normalize(positionWC));\n float atmosphereHeight = 0.05;\n float smoothstepHeight = smoothstep(0.0, atmosphereHeight, horizonDotNadir);\n return vec3(horizonDotNadir, reflectionDotNadir, smoothstepHeight);\n}\n\n/**\n * Compute the diffuse irradiance for a procedural sky lighting model\n *\n * @param {vec3} skyMetrics The dot products of the horizon and reflection directions with the nadir, and an atmosphere boundary distance.\n * @return {vec3} The computed diffuse irradiance\n */\nvec3 getProceduralDiffuseIrradiance(vec3 skyMetrics)\n{\n vec3 blueSkyDiffuseColor = vec3(0.7, 0.85, 0.9); \n float diffuseIrradianceFromEarth = (1.0 - skyMetrics.x) * (skyMetrics.y * 0.25 + 0.75) * skyMetrics.z; \n float diffuseIrradianceFromSky = (1.0 - skyMetrics.z) * (1.0 - (skyMetrics.y * 0.25 + 0.25));\n return blueSkyDiffuseColor * clamp(diffuseIrradianceFromEarth + diffuseIrradianceFromSky, 0.0, 1.0);\n}\n\n/**\n * Compute the specular irradiance for a procedural sky lighting model\n *\n * @param {vec3} skyMetrics The dot products of the horizon and reflection directions with the nadir, and an atmosphere boundary distance.\n * @return {vec3} The computed specular irradiance\n */\nvec3 getProceduralSpecularIrradiance(vec3 reflectionWC, vec3 skyMetrics, float roughness)\n{\n // Flipping the X vector is a cheap way to get the inverse of czm_temeToPseudoFixed, since that\'s a rotation about Z.\n reflectionWC.x = -reflectionWC.x;\n reflectionWC = -normalize(czm_temeToPseudoFixed * reflectionWC);\n reflectionWC.x = -reflectionWC.x;\n\n float inverseRoughness = 1.04 - roughness;\n inverseRoughness *= inverseRoughness;\n vec3 sceneSkyBox = czm_textureCube(czm_environmentMap, reflectionWC).rgb * inverseRoughness;\n\n // Compute colors at different angles relative to the horizon\n vec3 belowHorizonColor = mix(vec3(0.1, 0.15, 0.25), vec3(0.4, 0.7, 0.9), skyMetrics.z);\n vec3 nadirColor = belowHorizonColor * 0.5;\n vec3 aboveHorizonColor = mix(vec3(0.9, 1.0, 1.2), belowHorizonColor, roughness * 0.5);\n vec3 blueSkyColor = mix(vec3(0.18, 0.26, 0.48), aboveHorizonColor, skyMetrics.y * inverseRoughness * 0.5 + 0.75);\n vec3 zenithColor = mix(blueSkyColor, sceneSkyBox, skyMetrics.z);\n\n // Compute blend zones\n float blendRegionSize = 0.1 * ((1.0 - inverseRoughness) * 8.0 + 1.1 - skyMetrics.x);\n float blendRegionOffset = roughness * -1.0;\n float farAboveHorizon = clamp(skyMetrics.x - blendRegionSize * 0.5 + blendRegionOffset, 1.0e-10 - blendRegionSize, 0.99999);\n float aroundHorizon = clamp(skyMetrics.x + blendRegionSize * 0.5, 1.0e-10 - blendRegionSize, 0.99999);\n float farBelowHorizon = clamp(skyMetrics.x + blendRegionSize * 1.5, 1.0e-10 - blendRegionSize, 0.99999);\n\n // Blend colors\n float notDistantRough = (1.0 - skyMetrics.x * roughness * 0.8);\n vec3 specularIrradiance = mix(zenithColor, aboveHorizonColor, smoothstep(farAboveHorizon, aroundHorizon, skyMetrics.y) * notDistantRough);\n specularIrradiance = mix(specularIrradiance, belowHorizonColor, smoothstep(aroundHorizon, farBelowHorizon, skyMetrics.y) * inverseRoughness);\n specularIrradiance = mix(specularIrradiance, nadirColor, smoothstep(farBelowHorizon, 1.0, skyMetrics.y) * inverseRoughness);\n\n return specularIrradiance;\n}\n\n#ifdef USE_SUN_LUMINANCE\nfloat clampedDot(vec3 x, vec3 y)\n{\n return clamp(dot(x, y), 0.001, 1.0);\n}\n/**\n * Sun luminance following the "CIE Clear Sky Model"\n * See page 40 of https://3dvar.com/Green2003Spherical.pdf\n *\n * @param {vec3} positionWC The position of the fragment in world coordinates.\n * @param {vec3} normalEC The surface normal in eye coordinates.\n * @param {vec3} lightDirectionEC Unit vector pointing to the light source in eye coordinates.\n * @return {float} The computed sun luminance.\n */\nfloat getSunLuminance(vec3 positionWC, vec3 normalEC, vec3 lightDirectionEC)\n{\n vec3 normalWC = normalize(czm_inverseViewRotation * normalEC);\n vec3 lightDirectionWC = normalize(czm_inverseViewRotation * lightDirectionEC);\n vec3 vWC = -normalize(positionWC);\n\n // Angle between sun and zenith.\n float LdotZenith = clampedDot(lightDirectionWC, vWC);\n float S = acos(LdotZenith);\n // Angle between zenith and current pixel\n float NdotZenith = clampedDot(normalWC, vWC);\n // Angle between sun and current pixel\n float NdotL = clampedDot(normalEC, lightDirectionEC);\n float gamma = acos(NdotL);\n\n float numerator = ((0.91 + 10.0 * exp(-3.0 * gamma) + 0.45 * NdotL * NdotL) * (1.0 - exp(-0.32 / NdotZenith)));\n float denominator = (0.91 + 10.0 * exp(-3.0 * S) + 0.45 * LdotZenith * LdotZenith) * (1.0 - exp(-0.32));\n return model_luminanceAtZenith * (numerator / denominator);\n}\n#endif\n\n/**\n * Compute the light contribution from a procedural sky model\n *\n * @param {vec3} positionEC The position of the fragment in eye coordinates.\n * @param {vec3} normalEC The surface normal in eye coordinates.\n * @param {vec3} lightDirectionEC Unit vector pointing to the light source in eye coordinates.\n * @param {czm_modelMaterial} The material properties.\n * @return {vec3} The computed HDR color\n */\n vec3 proceduralIBL(\n vec3 positionEC,\n vec3 normalEC,\n vec3 lightDirectionEC,\n czm_modelMaterial material\n) {\n vec3 viewDirectionEC = -normalize(positionEC);\n vec3 positionWC = vec3(czm_inverseView * vec4(positionEC, 1.0));\n vec3 reflectionWC = normalize(czm_inverseViewRotation * normalize(reflect(viewDirectionEC, normalEC)));\n vec3 skyMetrics = getProceduralSkyMetrics(positionWC, reflectionWC);\n\n float roughness = material.roughness;\n vec3 f0 = material.specular;\n\n vec3 specularIrradiance = getProceduralSpecularIrradiance(reflectionWC, skyMetrics, roughness);\n float NdotV = abs(dot(normalEC, viewDirectionEC)) + 0.001;\n vec2 brdfLut = texture(czm_brdfLut, vec2(NdotV, roughness)).rg;\n vec3 specularColor = czm_srgbToLinear(f0 * brdfLut.x + brdfLut.y);\n vec3 specularContribution = specularIrradiance * specularColor * model_iblFactor.y;\n #ifdef USE_SPECULAR\n specularContribution *= material.specularWeight;\n #endif\n\n vec3 diffuseIrradiance = getProceduralDiffuseIrradiance(skyMetrics);\n vec3 diffuseColor = material.diffuse;\n vec3 diffuseContribution = diffuseIrradiance * diffuseColor * model_iblFactor.x;\n\n vec3 iblColor = specularContribution + diffuseContribution;\n\n #ifdef USE_SUN_LUMINANCE\n iblColor *= getSunLuminance(positionWC, normalEC, lightDirectionEC);\n #endif\n\n return iblColor;\n}\n\n#ifdef DIFFUSE_IBL\nvec3 computeDiffuseIBL(vec3 cubeDir)\n{\n #ifdef CUSTOM_SPHERICAL_HARMONICS\n return czm_sphericalHarmonics(cubeDir, model_sphericalHarmonicCoefficients); \n #else\n return czm_sphericalHarmonics(cubeDir, czm_sphericalHarmonicCoefficients); \n #endif\n}\n#endif\n\n#ifdef SPECULAR_IBL\nvec3 sampleSpecularEnvironment(vec3 cubeDir, float roughness)\n{\n #ifdef CUSTOM_SPECULAR_IBL\n float maxLod = model_specularEnvironmentMapsMaximumLOD;\n float lod = roughness * maxLod;\n return czm_sampleOctahedralProjection(model_specularEnvironmentMaps, model_specularEnvironmentMapsSize, cubeDir, lod, maxLod);\n #else\n float maxLod = czm_specularEnvironmentMapsMaximumLOD;\n float lod = roughness * maxLod;\n return czm_sampleOctahedralProjection(czm_specularEnvironmentMaps, czm_specularEnvironmentMapSize, cubeDir, lod, maxLod);\n #endif\n}\nvec3 computeSpecularIBL(vec3 cubeDir, float NdotV, float VdotH, vec3 f0, float roughness)\n{\n float reflectance = czm_maximumComponent(f0);\n vec3 f90 = vec3(clamp(reflectance * 25.0, 0.0, 1.0));\n vec3 F = fresnelSchlick2(f0, f90, VdotH);\n\n vec2 brdfLut = texture(czm_brdfLut, vec2(NdotV, roughness)).rg;\n vec3 specularSample = sampleSpecularEnvironment(cubeDir, roughness);\n\n return specularSample * (F * brdfLut.x + brdfLut.y);\n}\n#endif\n\n#if defined(DIFFUSE_IBL) || defined(SPECULAR_IBL)\n/**\n * Compute the light contributions from environment maps and spherical harmonic coefficients\n *\n * @param {vec3} viewDirectionEC Unit vector pointing from the fragment to the eye position\n * @param {vec3} normalEC The surface normal in eye coordinates\n * @param {vec3} lightDirectionEC Unit vector pointing to the light source in eye coordinates.\n * @param {czm_modelMaterial} The material properties.\n * @return {vec3} The computed HDR color\n */\nvec3 textureIBL(\n vec3 viewDirectionEC,\n vec3 normalEC,\n vec3 lightDirectionEC,\n czm_modelMaterial material\n) {\n // Find the direction in which to sample the environment map\n vec3 cubeDir = normalize(model_iblReferenceFrameMatrix * normalize(reflect(-viewDirectionEC, normalEC)));\n\n #ifdef DIFFUSE_IBL\n vec3 diffuseContribution = computeDiffuseIBL(cubeDir) * material.diffuse;\n #else\n vec3 diffuseContribution = vec3(0.0); \n #endif\n\n float roughness = material.roughness;\n\n #ifdef USE_ANISOTROPY\n // Update environment map sampling direction to account for anisotropic distortion of specular reflection\n vec3 anisotropyDirection = material.anisotropicB;\n vec3 anisotropicTangent = cross(anisotropyDirection, viewDirectionEC);\n vec3 anisotropicNormal = cross(anisotropicTangent, anisotropyDirection);\n float bendFactor = 1.0 - material.anisotropyStrength * (1.0 - roughness);\n float bendFactorPow4 = bendFactor * bendFactor * bendFactor * bendFactor;\n vec3 bentNormal = normalize(mix(anisotropicNormal, normalEC, bendFactorPow4));\n cubeDir = normalize(model_iblReferenceFrameMatrix * normalize(reflect(-viewDirectionEC, bentNormal)));\n #endif\n\n #ifdef SPECULAR_IBL\n float NdotV = abs(dot(normalEC, viewDirectionEC)) + 0.001;\n vec3 halfwayDirectionEC = normalize(viewDirectionEC + lightDirectionEC);\n float VdotH = clamp(dot(viewDirectionEC, halfwayDirectionEC), 0.0, 1.0);\n vec3 f0 = material.specular;\n vec3 specularContribution = computeSpecularIBL(cubeDir, NdotV, VdotH, f0, roughness);\n #else\n vec3 specularContribution = vec3(0.0); \n #endif\n\n #ifdef USE_SPECULAR\n specularContribution *= material.specularWeight;\n #endif\n\n return diffuseContribution + specularContribution;\n}\n#endif\n'),e.uniformMap=(0,hv.Z)({model_iblFactor:function(){return n.imageBasedLightingFactor},model_iblReferenceFrameMatrix:function(){return t._iblReferenceFrameMatrix},model_luminanceAtZenith:function(){return n.luminanceAtZenith},model_sphericalHarmonicCoefficients:function(){return n.sphericalHarmonicCoefficients},model_specularEnvironmentMaps:function(){return n.specularEnvironmentMapAtlas.texture},model_specularEnvironmentMapsSize:function(){return n.specularEnvironmentMapAtlas.texture.dimensions},model_specularEnvironmentMapsMaximumLOD:function(){return n.specularEnvironmentMapAtlas.maximumMipmapLevel}},e.uniformMap)};let _c=eB.Z.EPSILON16;function _u(e){let t=(e=(0,m.Z)(e,m.Z.EMPTY_OBJECT)).stage,i=e.runtimeArticulation;p.Z.typeOf.object("options.stage",t),p.Z.typeOf.object("options.runtimeArticulation",i),this._stage=t,this._runtimeArticulation=i,this._name=t.name,this._type=t.type,this._minimumValue=t.minimumValue,this._maximumValue=t.maximumValue,this._currentValue=t.initialValue}Object.defineProperties(_u.prototype,{stage:{get:function(){return this._stage}},runtimeArticulation:{get:function(){return this._runtimeArticulation}},name:{get:function(){return this._name}},type:{get:function(){return this._type}},minimumValue:{get:function(){return this._minimumValue}},maximumValue:{get:function(){return this._maximumValue}},currentValue:{get:function(){return this._currentValue},set:function(e){p.Z.typeOf.number("value",e),e=eB.Z.clamp(e,this.minimumValue,this.maximumValue),eB.Z.equalsEpsilon(this._currentValue,e,_c)||(this._currentValue=e,this.runtimeArticulation._dirty=!0)}}});let _h=new S.Z,_d=new n2.Z;function _f(e){let t=(e=(0,m.Z)(e,m.Z.EMPTY_OBJECT)).articulation,i=e.sceneGraph;p.Z.typeOf.object("options.articulation",t),p.Z.typeOf.object("options.sceneGraph",i),this._articulation=t,this._sceneGraph=i,this._name=t.name,this._runtimeStages=[],this._runtimeStagesByName={},this._runtimeNodes=[],this._dirty=!0,function(e){let t=e.articulation.stages,i=t.length,n=e._runtimeStages,r=e._runtimeStagesByName;for(let o=0;o<i;o++){let i=t[o],a=new _u({stage:i,runtimeArticulation:e});n.push(a),r[i.name]=a}}(this)}_u.prototype.applyStageToMatrix=function(e){let t;p.Z.typeOf.object("result",e);let i=this.type,n=this.currentValue;switch(i){case uD.XROTATE:t=n2.Z.fromRotationX(eB.Z.toRadians(n),_d),e=er.Z.multiplyByMatrix3(e,t,e);break;case uD.YROTATE:t=n2.Z.fromRotationY(eB.Z.toRadians(n),_d),e=er.Z.multiplyByMatrix3(e,t,e);break;case uD.ZROTATE:t=n2.Z.fromRotationZ(eB.Z.toRadians(n),_d),e=er.Z.multiplyByMatrix3(e,t,e);break;case uD.XTRANSLATE:_h.x=n,_h.y=0,_h.z=0,e=er.Z.multiplyByTranslation(e,_h,e);break;case uD.YTRANSLATE:_h.x=0,_h.y=n,_h.z=0,e=er.Z.multiplyByTranslation(e,_h,e);break;case uD.ZTRANSLATE:_h.x=0,_h.y=0,_h.z=n,e=er.Z.multiplyByTranslation(e,_h,e);break;case uD.XSCALE:_h.x=n,_h.y=1,_h.z=1,e=er.Z.multiplyByScale(e,_h,e);break;case uD.YSCALE:_h.x=1,_h.y=n,_h.z=1,e=er.Z.multiplyByScale(e,_h,e);break;case uD.ZSCALE:_h.x=1,_h.y=1,_h.z=n,e=er.Z.multiplyByScale(e,_h,e);break;case uD.UNIFORMSCALE:e=er.Z.multiplyByUniformScale(e,n,e)}return e},Object.defineProperties(_f.prototype,{articulation:{get:function(){return this._articulation}},sceneGraph:{get:function(){return this._sceneGraph}},name:{get:function(){return this._name}},runtimeStages:{get:function(){return this._runtimeStages}},runtimeNodes:{get:function(){return this._runtimeNodes}}}),_f.prototype.setArticulationStage=function(e,t){let i=this._runtimeStagesByName[e];(0,_.Z)(i)&&(i.currentValue=t)};let _p=new er.Z,_m=new er.Z;_f.prototype.apply=function(){let e;if(!this._dirty)return;this._dirty=!1;let t=er.Z.clone(er.Z.IDENTITY,_p),i=this._runtimeStages,n=i.length;for(e=0;e<n;e++)t=i[e].applyStageToMatrix(t);let r=this._runtimeNodes,o=r.length;for(e=0;e<o;e++){let i=r[e],n=er.Z.multiplyTransformation(i.originalTransform,t,_m);i.transform=n}};let __={name:"ModelColorPipelineStage",COLOR_UNIFORM_NAME:"model_color",COLOR_BLEND_UNIFORM_NAME:"model_colorBlend"};__.process=function(e,t,i){let n=e.shaderBuilder;n.addDefine("HAS_MODEL_COLOR",void 0,_o.Z.FRAGMENT),n.addFragmentLines("void modelColorStage(inout czm_modelMaterial material)\n{\n material.diffuse = mix(material.diffuse, model_color.rgb, model_colorBlend);\n float highlight = ceil(model_colorBlend);\n material.diffuse *= mix(model_color.rgb, vec3(1.0), highlight);\n material.alpha *= model_color.a;\n}\n");let r={},o=t.color;0!==o.alpha||t.hasSilhouette(i)||(e.renderStateOptions.colorMask={red:!1,green:!1,blue:!1,alpha:!1}),o.alpha<1&&(e.alphaOptions.pass=ej.Z.TRANSLUCENT),n.addUniform("vec4",__.COLOR_UNIFORM_NAME,_o.Z.FRAGMENT),r[__.COLOR_UNIFORM_NAME]=function(){return t.color},n.addUniform("float",__.COLOR_BLEND_UNIFORM_NAME,_o.Z.FRAGMENT),r[__.COLOR_BLEND_UNIFORM_NAME]=function(){return uC.getColorBlend(t.colorBlendMode,t.colorBlendAmount)},e.uniformMap=(0,hv.Z)(r,e.uniformMap)};let _g={name:"ModelClippingPlanesPipelineStage"},_Z=new w.Z;_g.process=function(e,t,i){let n=t.clippingPlanes,r=i.context,o=e.shaderBuilder;o.addDefine("HAS_CLIPPING_PLANES",void 0,_o.Z.FRAGMENT),o.addDefine("CLIPPING_PLANES_LENGTH",n.length,_o.Z.FRAGMENT),n.unionClippingRegions&&o.addDefine("UNION_CLIPPING_REGIONS",void 0,_o.Z.FRAGMENT),uI.Z.useFloatTexture(r)&&o.addDefine("USE_CLIPPING_PLANES_FLOAT_TEXTURE",void 0,_o.Z.FRAGMENT);let a=uI.Z.getTextureResolution(n,r,_Z);o.addDefine("CLIPPING_PLANES_TEXTURE_WIDTH",a.x,_o.Z.FRAGMENT),o.addDefine("CLIPPING_PLANES_TEXTURE_HEIGHT",a.y,_o.Z.FRAGMENT),o.addUniform("sampler2D","model_clippingPlanes",_o.Z.FRAGMENT),o.addUniform("vec4","model_clippingPlanesEdgeStyle",_o.Z.FRAGMENT),o.addUniform("mat4","model_clippingPlanesMatrix",_o.Z.FRAGMENT),o.addFragmentLines("#ifdef USE_CLIPPING_PLANES_FLOAT_TEXTURE\nvec4 getClippingPlane(\n highp sampler2D packedClippingPlanes,\n int clippingPlaneNumber,\n mat4 transform\n) {\n int pixY = clippingPlaneNumber / CLIPPING_PLANES_TEXTURE_WIDTH;\n int pixX = clippingPlaneNumber - (pixY * CLIPPING_PLANES_TEXTURE_WIDTH);\n float pixelWidth = 1.0 / float(CLIPPING_PLANES_TEXTURE_WIDTH);\n float pixelHeight = 1.0 / float(CLIPPING_PLANES_TEXTURE_HEIGHT);\n float u = (float(pixX) + 0.5) * pixelWidth; // sample from center of pixel\n float v = (float(pixY) + 0.5) * pixelHeight;\n vec4 plane = texture(packedClippingPlanes, vec2(u, v));\n return czm_transformPlane(plane, transform);\n}\n#else\n// Handle uint8 clipping texture instead\nvec4 getClippingPlane(\n highp sampler2D packedClippingPlanes,\n int clippingPlaneNumber,\n mat4 transform\n) {\n int clippingPlaneStartIndex = clippingPlaneNumber * 2; // clipping planes are two pixels each\n int pixY = clippingPlaneStartIndex / CLIPPING_PLANES_TEXTURE_WIDTH;\n int pixX = clippingPlaneStartIndex - (pixY * CLIPPING_PLANES_TEXTURE_WIDTH);\n float pixelWidth = 1.0 / float(CLIPPING_PLANES_TEXTURE_WIDTH);\n float pixelHeight = 1.0 / float(CLIPPING_PLANES_TEXTURE_HEIGHT);\n float u = (float(pixX) + 0.5) * pixelWidth; // sample from center of pixel\n float v = (float(pixY) + 0.5) * pixelHeight;\n vec4 oct32 = texture(packedClippingPlanes, vec2(u, v)) * 255.0;\n vec2 oct = vec2(oct32.x * 256.0 + oct32.y, oct32.z * 256.0 + oct32.w);\n vec4 plane;\n plane.xyz = czm_octDecode(oct, 65535.0);\n plane.w = czm_unpackFloat(texture(packedClippingPlanes, vec2(u + pixelWidth, v)));\n return czm_transformPlane(plane, transform);\n}\n#endif\n\nfloat clip(vec4 fragCoord, sampler2D clippingPlanes, mat4 clippingPlanesMatrix) {\n vec4 position = czm_windowToEyeCoordinates(fragCoord);\n vec3 clipNormal = vec3(0.0);\n vec3 clipPosition = vec3(0.0);\n float pixelWidth = czm_metersPerPixel(position);\n \n #ifdef UNION_CLIPPING_REGIONS\n float clipAmount; // For union planes, we want to get the min distance. So we set the initial value to the first plane distance in the loop below.\n #else\n float clipAmount = 0.0;\n bool clipped = true;\n #endif\n\n for (int i = 0; i < CLIPPING_PLANES_LENGTH; ++i) {\n vec4 clippingPlane = getClippingPlane(clippingPlanes, i, clippingPlanesMatrix);\n clipNormal = clippingPlane.xyz;\n clipPosition = -clippingPlane.w * clipNormal;\n float amount = dot(clipNormal, (position.xyz - clipPosition)) / pixelWidth;\n \n #ifdef UNION_CLIPPING_REGIONS\n clipAmount = czm_branchFreeTernary(i == 0, amount, min(amount, clipAmount));\n if (amount <= 0.0) {\n discard;\n }\n #else\n clipAmount = max(amount, clipAmount);\n clipped = clipped && (amount <= 0.0);\n #endif\n }\n\n #ifndef UNION_CLIPPING_REGIONS\n if (clipped) {\n discard;\n }\n #endif\n \n return clipAmount;\n}\n\nvoid modelClippingPlanesStage(inout vec4 color)\n{\n float clipDistance = clip(gl_FragCoord, model_clippingPlanes, model_clippingPlanesMatrix);\n vec4 clippingPlanesEdgeColor = vec4(1.0);\n clippingPlanesEdgeColor.rgb = model_clippingPlanesEdgeStyle.rgb;\n float clippingPlanesEdgeWidth = model_clippingPlanesEdgeStyle.a;\n \n if (clipDistance > 0.0 && clipDistance < clippingPlanesEdgeWidth) {\n color = clippingPlanesEdgeColor;\n }\n}\n"),e.uniformMap=(0,hv.Z)({model_clippingPlanes:function(){return n.texture},model_clippingPlanesEdgeStyle:function(){let e=C.Z.clone(n.edgeColor);return e.alpha=n.edgeWidth,e},model_clippingPlanesMatrix:function(){return t._clippingPlanesMatrix}},e.uniformMap)};let _y={name:"ModelClippingPolygonsPipelineStage"};function _b(e,t){p.Z.typeOf.object("model",e),p.Z.typeOf.object("runtimeNode",t),this._model=e,this._runtimeNode=t}_y.process=function(e,t,i){let n=t.clippingPolygons,r=e.shaderBuilder;r.addDefine("ENABLE_CLIPPING_POLYGONS",void 0,_o.Z.BOTH),n.inverse&&r.addDefine("CLIPPING_INVERSE",void 0,_o.Z.FRAGMENT),r.addDefine("CLIPPING_POLYGON_REGIONS_LENGTH",n.extentsCount,_o.Z.BOTH),r.addUniform("sampler2D","model_clippingDistance",_o.Z.FRAGMENT),r.addUniform("sampler2D","model_clippingExtents",_o.Z.VERTEX),r.addVarying("vec2","v_clippingPosition"),r.addVarying("int","v_regionIndex","flat"),r.addVertexLines("void modelClippingPolygonsStage(ProcessedAttributes attributes)\n{\n vec2 sphericalLatLong = czm_approximateSphericalCoordinates(v_positionWC);\n sphericalLatLong.y = czm_branchFreeTernary(sphericalLatLong.y < czm_pi, sphericalLatLong.y, sphericalLatLong.y - czm_twoPi);\n\n vec2 minDistance = vec2(czm_infinity);\n v_regionIndex = -1;\n v_clippingPosition = vec2(czm_infinity);\n\n for (int regionIndex = 0; regionIndex < CLIPPING_POLYGON_REGIONS_LENGTH; regionIndex++) {\n vec4 extents = czm_unpackClippingExtents(model_clippingExtents, regionIndex);\n vec2 rectUv = (sphericalLatLong.yx - extents.yx) * extents.wz;\n\n vec2 clamped = clamp(rectUv, vec2(0.0), vec2(1.0));\n vec2 distance = abs(rectUv - clamped) * extents.wz;\n \n if (minDistance.x > distance.x || minDistance.y > distance.y) {\n minDistance = distance;\n v_clippingPosition = rectUv;\n }\n\n float threshold = 0.01;\n if (rectUv.x > threshold && rectUv.y > threshold && rectUv.x < 1.0 - threshold && rectUv.y < 1.0 - threshold) {\n v_regionIndex = regionIndex;\n }\n }\n}\n"),r.addFragmentLines("void modelClippingPolygonsStage()\n{\n vec2 clippingPosition = v_clippingPosition;\n int regionIndex = v_regionIndex;\n czm_clipPolygons(model_clippingDistance, CLIPPING_POLYGON_REGIONS_LENGTH, clippingPosition, regionIndex);\n}\n"),e.uniformMap=(0,hv.Z)({model_clippingDistance:function(){return n.clippingTexture},model_clippingExtents:function(){return n.extentsTexture}},e.uniformMap)},Object.defineProperties(_b.prototype,{name:{get:function(){return this._runtimeNode._name}},id:{get:function(){return this._runtimeNode._id}},show:{get:function(){return this._runtimeNode.show},set:function(e){this._runtimeNode.show=e}},matrix:{get:function(){return this._runtimeNode.transform},set:function(e){(0,_.Z)(e)?(this._runtimeNode.transform=e,this._runtimeNode.userAnimated=!0,this._model._userAnimationDirty=!0):(this._runtimeNode.transform=this.originalMatrix,this._runtimeNode.userAnimated=!1)}},originalMatrix:{get:function(){return this._runtimeNode.originalTransform}}});var _v=i(8564);let _T=new er.Z,_E=new er.Z,_x=new er.Z,_w={name:"InstancingPipelineStage",_getInstanceTransformsAsMatrices:_U,_transformsToTypedArray:_M};_w.process=function(e,t,i){let n=t.instances,r=n.attributes[0].count,o=e.shaderBuilder;o.addDefine("HAS_INSTANCING"),o.addVertexLines("mat4 getInstancingTransform()\n{\n mat4 instancingTransform;\n\n #ifdef HAS_INSTANCE_MATRICES\n instancingTransform = mat4(\n a_instancingTransformRow0.x, a_instancingTransformRow1.x, a_instancingTransformRow2.x, 0.0, // Column 1\n a_instancingTransformRow0.y, a_instancingTransformRow1.y, a_instancingTransformRow2.y, 0.0, // Column 2\n a_instancingTransformRow0.z, a_instancingTransformRow1.z, a_instancingTransformRow2.z, 0.0, // Column 3\n a_instancingTransformRow0.w, a_instancingTransformRow1.w, a_instancingTransformRow2.w, 1.0 // Column 4\n );\n #else\n vec3 translation = vec3(0.0, 0.0, 0.0);\n vec3 scale = vec3(1.0, 1.0, 1.0);\n \n #ifdef HAS_INSTANCE_TRANSLATION\n translation = a_instanceTranslation;\n #endif\n #ifdef HAS_INSTANCE_SCALE\n scale = a_instanceScale;\n #endif\n\n instancingTransform = mat4(\n scale.x, 0.0, 0.0, 0.0,\n 0.0, scale.y, 0.0, 0.0,\n 0.0, 0.0, scale.z, 0.0,\n translation.x, translation.y, translation.z, 1.0\n ); \n #endif\n\n return instancingTransform;\n}\n\n#ifdef USE_2D_INSTANCING\nmat4 getInstancingTransform2D()\n{\n mat4 instancingTransform2D;\n\n #ifdef HAS_INSTANCE_MATRICES\n instancingTransform2D = mat4(\n a_instancingTransform2DRow0.x, a_instancingTransform2DRow1.x, a_instancingTransform2DRow2.x, 0.0, // Column 1\n a_instancingTransform2DRow0.y, a_instancingTransform2DRow1.y, a_instancingTransform2DRow2.y, 0.0, // Column 2\n a_instancingTransform2DRow0.z, a_instancingTransform2DRow1.z, a_instancingTransform2DRow2.z, 0.0, // Column 3\n a_instancingTransform2DRow0.w, a_instancingTransform2DRow1.w, a_instancingTransform2DRow2.w, 1.0 // Column 4\n );\n #else\n vec3 translation2D = vec3(0.0, 0.0, 0.0);\n vec3 scale = vec3(1.0, 1.0, 1.0);\n \n #ifdef HAS_INSTANCE_TRANSLATION\n translation2D = a_instanceTranslation2D;\n #endif\n #ifdef HAS_INSTANCE_SCALE\n scale = a_instanceScale;\n #endif\n\n instancingTransform2D = mat4(\n scale.x, 0.0, 0.0, 0.0,\n 0.0, scale.y, 0.0, 0.0,\n 0.0, 0.0, scale.z, 0.0,\n translation2D.x, translation2D.y, translation2D.z, 1.0\n ); \n #endif\n\n return instancingTransform2D;\n}\n#endif\n");let a=e.model,s=a.sceneGraph,l=e.runtimeNode,c=i.mode!==eu.Z.SCENE3D&&!i.scene3DOnly&&a._projectTo2D,u=a._enablePick&&!i.context.webgl2,h=[];(function(e,t,i,n,r,o){let a=dq.getAttributeBySemantic(i,fO.ROTATION);(0,_.Z)(a)?function(e,t,i,n,r,o){let a;let s=e.shaderBuilder,l=t.attributes[0].count,c=e.model,u=e.runtimeNode;s.addDefine("HAS_INSTANCE_MATRICES");let h=u.instancingTransformsBuffer;if(!(0,_.Z)(h)){let i=_M(a=_U(t,l,e));h=_k(i,n),c._modelResources.push(h),o&&(u.transformsTypedArray=i),u.instancingTransformsBuffer=h}if(_V(e,h,i,"Transform"),!r)return;let d=(0,uz.Z)(n);d.mode=eu.Z.COLUMBUS_VIEW,_L(e,d);let f=u.instancingTransformsBuffer2D;(0,_.Z)(f)||(f=_k(_M(function(e,t,i,n){_A(t,_I,_O);let r=t.runtimeNode.instancingReferencePoint2D,o=e.length;for(let t=0;t<o;t++){let o=function(e,t,i,n,r){let o=er.Z.multiplyTransformation(t,e,_S);return o=er.Z.multiplyTransformation(o,i,_S),r=n9.Z.basisTo2D(n.mapProjection,o,r)}(e[t],_I,_O,i,_D),a=er.Z.getTranslation(o,_P),s=S.Z.subtract(a,r,a);n[t]=er.Z.setTranslation(o,s,n[t])}return n}(a,e,d,a)),n),c._modelResources.push(f),u.instancingTransformsBuffer2D=f),_V(e,f,i,"Transform2D")}(e,i,n,t,r,o):function(e,t,i,n,r,o){let a;let s=e.shaderBuilder,l=e.runtimeNode,c=dq.getAttributeBySemantic(t,fO.TRANSLATION),u=dq.getAttributeBySemantic(t,fO.SCALE);if((0,_.Z)(u)&&(s.addDefine("HAS_INSTANCE_SCALE"),_H(e,u.buffer,u.byteOffset,u.byteStride,i,"Scale")),!(0,_.Z)(c))return;let h=c.typedArray;if((0,_.Z)(h)?a=function(e,t,i){let n=Array(t),r=e.typedArray,o=new S.Z(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),a=new S.Z(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE);for(let e=0;e<t;e++){let t=new S.Z(r[3*e],r[3*e+1],r[3*e+2]);n[e]=t,S.Z.minimumByComponent(o,t,o),S.Z.maximumByComponent(a,t,a)}let s=i.runtimeNode;return s.instancingTranslationMin=o,s.instancingTranslationMax=a,e.typedArray=void 0,n}(c,c.count,e):(0,_.Z)(l.instancingTranslationMin)||(l.instancingTranslationMin=c.min,l.instancingTranslationMax=c.max),s.addDefine("HAS_INSTANCE_TRANSLATION"),_H(e,c.buffer,c.byteOffset,c.byteStride,i,"Translation"),!r)return;let d=(0,uz.Z)(n);d.mode=eu.Z.COLUMBUS_VIEW,_L(e,d);let f=l.instancingTranslationBuffer2D;if(!(0,_.Z)(f)){let t=function(e){let t=e.length,i=new Float32Array(3*t);for(let n=0;n<t;n++){let t=e[n],r=3*n;i[r+0]=t[0],i[r+1]=t[4],i[r+2]=t[8]}return i}(function(e,t,i,n){_A(t,_I,_O);let r=t.runtimeNode.instancingReferencePoint2D,o=e.length;for(let t=0;t<o;t++){let o=e[t],a=function(e,t,i,n,r){let o=er.Z.fromTranslation(e,_S),a=er.Z.multiplyTransformation(t,o,_S);a=er.Z.multiplyTransformation(a,i,_S);let s=er.Z.getTranslation(a,_C);return r=eh.Z.computeActualWgs84Position(n,s,r)}(o,_I,_O,i,o);n[t]=S.Z.subtract(a,r,n[t])}return n}(a,e,d,a));f=_k(t,n),e.model._modelResources.push(f),l.instancingTranslationBuffer2D=f}r&&_H(e,f,0,void 0,i,"Translation2D")}(e,i,n,t,r)})(e,i,n,h,c,u),function(e,t,i,n){let r=i.attributes,o=e.shaderBuilder;for(let t=0;t<r.length;t++){let i=r[t];i.semantic===fO.FEATURE_ID&&(i.setIndex>=e.featureIdVertexAttributeSetIndex&&(e.featureIdVertexAttributeSetIndex=i.setIndex+1),n.push({index:e.attributeIndex++,vertexBuffer:i.buffer,componentsPerAttribute:dH.Z.getNumberOfComponents(i.type),componentDatatype:i.componentDatatype,normalize:!1,offsetInBytes:i.byteOffset,strideInBytes:i.byteStride,instanceDivisor:1}),o.addAttribute("float",`a_instanceFeatureId_${i.setIndex}`))}}(e,0,n,h);let d={};if(n.transformInWorldSpace?(o.addDefine("USE_LEGACY_INSTANCING",void 0,_o.Z.VERTEX),o.addUniform("mat4","u_instance_modifiedModelView",_o.Z.VERTEX),o.addUniform("mat4","u_instance_nodeTransform",_o.Z.VERTEX),d.u_instance_modifiedModelView=function(){let e=er.Z.multiplyTransformation(a.modelMatrix,s.components.transform,_T);return c?er.Z.multiplyTransformation(i.context.uniformState.view3D,e,_T):(i.mode!==eu.Z.SCENE3D&&(e=n9.Z.basisTo2D(i.mapProjection,e,_T)),er.Z.multiplyTransformation(i.context.uniformState.view,e,_T))},d.u_instance_nodeTransform=function(){return er.Z.multiplyTransformation(s.axisCorrectionMatrix,l.computedTransform,_E)},o.addVertexLines("void legacyInstancingStage(\n inout ProcessedAttributes attributes,\n out mat4 instanceModelView,\n out mat3 instanceModelViewInverseTranspose)\n{\n vec3 positionMC = attributes.positionMC;\n\n mat4 instancingTransform = getInstancingTransform();\n \n mat4 instanceModel = instancingTransform * u_instance_nodeTransform;\n instanceModelView = u_instance_modifiedModelView;\n instanceModelViewInverseTranspose = mat3(u_instance_modifiedModelView * instanceModel);\n\n attributes.positionMC = (instanceModel * vec4(positionMC, 1.0)).xyz;\n \n #ifdef USE_2D_INSTANCING\n mat4 instancingTransform2D = getInstancingTransform2D();\n attributes.position2D = (instancingTransform2D * vec4(positionMC, 1.0)).xyz;\n #endif\n}\n")):o.addVertexLines("void instancingStage(inout ProcessedAttributes attributes) \n{\n vec3 positionMC = attributes.positionMC;\n \n mat4 instancingTransform = getInstancingTransform();\n \n attributes.positionMC = (instancingTransform * vec4(positionMC, 1.0)).xyz;\n\n #ifdef HAS_NORMALS\n vec3 normalMC = attributes.normalMC;\n attributes.normalMC = (instancingTransform * vec4(normalMC, 0.0)).xyz;\n #endif\n\n #ifdef USE_2D_INSTANCING\n mat4 instancingTransform2D = getInstancingTransform2D();\n attributes.position2D = (instancingTransform2D * vec4(positionMC, 1.0)).xyz;\n #endif\n}\n"),c){o.addDefine("USE_2D_INSTANCING",void 0,_o.Z.VERTEX),o.addUniform("mat4","u_modelView2D",_o.Z.VERTEX);let e=i.context,t=er.Z.fromTranslation(l.instancingReferencePoint2D,new er.Z);d.u_modelView2D=function(){return er.Z.multiplyTransformation(e.uniformState.view,t,_x)}}e.uniformMap=(0,hv.Z)(d,e.uniformMap),e.instanceCount=r,e.attributes.push.apply(e.attributes,h)};let _S=new er.Z,_C=new S.Z;function _A(e,t,i){let n=e.model,r=n.sceneGraph;e.runtimeNode.node.instances.transformInWorldSpace?(t=er.Z.multiplyTransformation(n.modelMatrix,r.components.transform,t),i=er.Z.multiplyTransformation(r.axisCorrectionMatrix,e.runtimeNode.computedTransform,i)):(t=er.Z.clone(r.computedModelMatrix,t),t=er.Z.multiplyTransformation(t,e.runtimeNode.computedTransform,t),i=er.Z.clone(er.Z.IDENTITY,i))}let _I=new er.Z,_O=new er.Z,_D=new er.Z,_P=new S.Z,_R=new S.Z,_N=new S.Z;function _L(e,t){let i=e.runtimeNode,n=e.model.sceneGraph.computedModelMatrix,r=er.Z.multiplyByPoint(n,i.instancingTranslationMin,_R),o=eh.Z.computeActualWgs84Position(t,r,r),a=er.Z.multiplyByPoint(n,i.instancingTranslationMax,_N),s=eh.Z.computeActualWgs84Position(t,a,a);i.instancingReferencePoint2D=S.Z.lerp(o,s,.5,new S.Z)}function _M(e){let t=e.length,i=new Float32Array(12*t);for(let n=0;n<t;n++){let t=e[n],r=12*n;i[r+0]=t[0],i[r+1]=t[4],i[r+2]=t[8],i[r+3]=t[12],i[r+4]=t[1],i[r+5]=t[5],i[r+6]=t[9],i[r+7]=t[13],i[r+8]=t[2],i[r+9]=t[6],i[r+10]=t[10],i[r+11]=t[14]}return i}let _F=new S.Z,_z=new n5.Z,_B=new S.Z;function _U(e,t,i){let n;let r=Array(t),o=dq.getAttributeBySemantic(e,fO.TRANSLATION),a=dq.getAttributeBySemantic(e,fO.ROTATION),s=dq.getAttributeBySemantic(e,fO.SCALE),l=new S.Z(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE),c=new S.Z(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),u=(0,_.Z)(o),h=(0,_.Z)(a),d=(0,_.Z)(s),f=u?o.typedArray:new Float32Array(3*t),p=h?a.typedArray:new Float32Array(4*t);h&&a.normalized&&(p=eL.Z.dequantize(p,a.componentDatatype,a.type,t)),d?n=s.typedArray:(n=new Float32Array(3*t)).fill(1);for(let e=0;e<t;e++){let t=new S.Z(f[3*e],f[3*e+1],f[3*e+2],_F);S.Z.maximumByComponent(l,t,l),S.Z.minimumByComponent(c,t,c);let i=new n5.Z(p[4*e],p[4*e+1],p[4*e+2],h?p[4*e+3]:1,_z),o=new S.Z(n[3*e],n[3*e+1],n[3*e+2],_B),a=er.Z.fromTranslationQuaternionRotationScale(t,i,o,new er.Z);r[e]=a}let m=i.runtimeNode;return m.instancingTranslationMin=c,m.instancingTranslationMax=l,u&&(o.typedArray=void 0),h&&(a.typedArray=void 0),d&&(s.typedArray=void 0),r}function _k(e,t){let i=ek.Z.createVertexBuffer({context:t.context,typedArray:e,usage:eV.Z.STATIC_DRAW});return i.vertexArrayDestroyable=!1,i}function _V(e,t,i,n){let r=eM.Z.getSizeInBytes(eM.Z.FLOAT),o=12*r,a=[{index:e.attributeIndex++,vertexBuffer:t,componentsPerAttribute:4,componentDatatype:eM.Z.FLOAT,normalize:!1,offsetInBytes:0,strideInBytes:o,instanceDivisor:1},{index:e.attributeIndex++,vertexBuffer:t,componentsPerAttribute:4,componentDatatype:eM.Z.FLOAT,normalize:!1,offsetInBytes:4*r,strideInBytes:o,instanceDivisor:1},{index:e.attributeIndex++,vertexBuffer:t,componentsPerAttribute:4,componentDatatype:eM.Z.FLOAT,normalize:!1,offsetInBytes:8*r,strideInBytes:o,instanceDivisor:1}],s=e.shaderBuilder;s.addAttribute("vec4",`a_instancing${n}Row0`),s.addAttribute("vec4",`a_instancing${n}Row1`),s.addAttribute("vec4",`a_instancing${n}Row2`),i.push.apply(i,a)}function _H(e,t,i,n,r,o){r.push({index:e.attributeIndex++,vertexBuffer:t,componentsPerAttribute:3,componentDatatype:eM.Z.FLOAT,normalize:!1,offsetInBytes:i,strideInBytes:n,instanceDivisor:1}),e.shaderBuilder.addAttribute("vec3",`a_instance${o}`)}let _G={};_G.name="ModelMatrixUpdateStage",_G.update=function(e,t,i){let n=i.mode!==eu.Z.SCENE3D;if((!n||!t._model._projectTo2D)&&e._transformDirty){let i=n?t._computedModelMatrix2D:t._computedModelMatrix;(function e(t,i,n,r){let o;r=er.Z.multiplyTransformation(r,t.transform,new er.Z),t.updateComputedTransform();let a=t.runtimePrimitives.length;for(o=0;o<a;o++){let e=t.runtimePrimitives[o].drawCommand;e.modelMatrix=er.Z.multiplyTransformation(n,r,e.modelMatrix),e.cullFace=dq.getCullFace(e.modelMatrix,e.primitiveType)}let s=t.children.length;for(o=0;o<s;o++){let a=i._runtimeNodes[t.children[o]];a._transformToRoot=er.Z.clone(r,a._transformToRoot),e(a,i,n,r),a._transformDirty=!1}})(e,t,i,e.transformToRoot),e._transformDirty=!1}};let _j={name:"NodeStatisticsPipelineStage",_countInstancingAttributes:_W,_countGeneratedBuffers:_q};function _W(e,t){if(!(0,_.Z)(t))return;let i=t.attributes,n=i.length;for(let t=0;t<n;t++){let n=i[t];(0,_.Z)(n.buffer)&&e.addBuffer(n.buffer,!1)}}function _q(e,t){(0,_.Z)(t.instancingTransformsBuffer)&&e.addBuffer(t.instancingTransformsBuffer,!1),(0,_.Z)(t.instancingTransformsBuffer2D)&&e.addBuffer(t.instancingTransformsBuffer2D,!1),(0,_.Z)(t.instancingTranslationBuffer2D)&&e.addBuffer(t.instancingTranslationBuffer2D,!1)}function _Y(e){let t=(e=(0,m.Z)(e,m.Z.EMPTY_OBJECT)).node,i=e.transform,n=e.transformToRoot,r=e.sceneGraph,o=e.children;p.Z.typeOf.object("options.node",t),p.Z.typeOf.object("options.transform",i),p.Z.typeOf.object("options.transformToRoot",n),p.Z.typeOf.object("options.sceneGraph",r),p.Z.typeOf.object("options.children",o),this._node=t,this._name=t.name,this._id=t.index,this._sceneGraph=r,this._children=o,this._originalTransform=er.Z.clone(i,this._originalTransform),this._transform=er.Z.clone(i,this._transform),this._transformToRoot=er.Z.clone(n,this._transformToRoot),this._computedTransform=new er.Z,this._transformDirty=!1,this._transformParameters=void 0,this._morphWeights=[],this._runtimeSkin=void 0,this._computedJointMatrices=[],this.show=!0,this.userAnimated=!1,this.pipelineStages=[],this.runtimePrimitives=[],this.updateStages=[],this.instancingTranslationMin=void 0,this.instancingTranslationMax=void 0,this.instancingTransformsBuffer=void 0,this.instancingTransformsBuffer2D=void 0,this.instancingTranslationBuffer2D=void 0,this.instancingReferencePoint2D=void 0,function(e){let t=e.transform,i=e.transformToRoot,n=e._computedTransform;e._computedTransform=er.Z.multiply(i,t,n);let r=e.node;(0,_.Z)(r.matrix)||(e._transformParameters=new _v.Z(r.translation,r.rotation,r.scale)),(0,_.Z)(r.morphWeights)&&(e._morphWeights=r.morphWeights.slice());let o=r.articulationName;if((0,_.Z)(o)){let t=e.sceneGraph._runtimeArticulations[o];(0,_.Z)(t)&&t.runtimeNodes.push(e)}}(this)}function _X(e,t){e._transformDirty=!0,e._transform=er.Z.fromTranslationRotationScale(t,e._transform)}_j.process=function(e,t,i){let n=e.model.statistics,r=t.instances,o=e.runtimeNode;_W(n,r),_q(n,o)},Object.defineProperties(_Y.prototype,{node:{get:function(){return this._node}},sceneGraph:{get:function(){return this._sceneGraph}},children:{get:function(){return this._children}},transform:{get:function(){return this._transform},set:function(e){this._transformDirty=!0,this._transform=er.Z.clone(e,this._transform)}},transformToRoot:{get:function(){return this._transformToRoot}},computedTransform:{get:function(){return this._computedTransform}},originalTransform:{get:function(){return this._originalTransform}},translation:{get:function(){return(0,_.Z)(this._transformParameters)?this._transformParameters.translation:void 0},set:function(e){let t=this._transformParameters;if(!(0,_.Z)(t))throw new A.Z("The translation of a node cannot be set if it was defined using a matrix in the model.");let i=t.translation;S.Z.equals(i,e)||(t.translation=S.Z.clone(e,t.translation),_X(this,t))}},rotation:{get:function(){return(0,_.Z)(this._transformParameters)?this._transformParameters.rotation:void 0},set:function(e){let t=this._transformParameters;if(!(0,_.Z)(t))throw new A.Z("The rotation of a node cannot be set if it was defined using a matrix in the model.");let i=t.rotation;n5.Z.equals(i,e)||(t.rotation=n5.Z.clone(e,t.rotation),_X(this,t))}},scale:{get:function(){return(0,_.Z)(this._transformParameters)?this._transformParameters.scale:void 0},set:function(e){let t=this._transformParameters;if(!(0,_.Z)(t))throw new A.Z("The scale of a node cannot be set if it was defined using a matrix in the model.");let i=t.scale;S.Z.equals(i,e)||(t.scale=S.Z.clone(e,t.scale),_X(this,t))}},morphWeights:{get:function(){return this._morphWeights},set:function(e){let t=e.length;if(this._morphWeights.length!==t)throw new A.Z("value must have the same length as the original weights array.");for(let i=0;i<t;i++)this._morphWeights[i]=e[i]}},runtimeSkin:{get:function(){return this._runtimeSkin}},computedJointMatrices:{get:function(){return this._computedJointMatrices}}}),_Y.prototype.getChild=function(e){if(p.Z.typeOf.number("index",e),e<0||e>=this.children.length)throw new A.Z("index must be greater than or equal to 0 and less than the number of children.");return this.sceneGraph._runtimeNodes[this.children[e]]},_Y.prototype.configurePipeline=function(){let e=this.node,t=this.pipelineStages;t.length=0;let i=this.updateStages;i.length=0,(0,_.Z)(e.instances)&&t.push(_w),t.push(_j),i.push(_G)},_Y.prototype.updateComputedTransform=function(){this._computedTransform=er.Z.multiply(this._transformToRoot,this._transform,this._computedTransform)},_Y.prototype.updateJointMatrices=function(){let e=this._runtimeSkin;if(!(0,_.Z)(e))return;e.updateJointMatrices();let t=this._computedJointMatrices,i=e.jointMatrices,n=i.length;for(let e=0;e<n;e++){(0,_.Z)(t[e])||(t[e]=new er.Z);let n=er.Z.multiplyTransformation(this.transformToRoot,this.transform,t[e]),r=er.Z.inverseTransformation(n,t[e]);t[e]=er.Z.multiplyTransformation(r,i[e],t[e])}};let _$={name:"AlphaPipelineStage"};_$.process=function(e,t,i){let n=e.alphaOptions,r=e.model;n.pass=(0,m.Z)(n.pass,r.opaquePass);let o=e.renderStateOptions;n.pass===ej.Z.TRANSLUCENT&&(o.cull.enabled=!1,o.depthMask=!1,o.blending=eJ.Z.ALPHA_BLEND);let a=e.shaderBuilder,s=e.uniformMap;(0,_.Z)(n.alphaCutoff)&&(a.addDefine("ALPHA_MODE_MASK",void 0,_o.Z.FRAGMENT),a.addUniform("float","u_alphaCutoff",_o.Z.FRAGMENT),s.u_alphaCutoff=function(){return n.alphaCutoff})};let _K={name:"BatchTexturePipelineStage"};_K.process=function(e,t,i){let n=e.shaderBuilder,r={},o=e.model,a=o.featureTables[o.featureTableId],s=a.featuresLength;n.addUniform("int","model_featuresLength"),r.model_featuresLength=function(){return s};let l=a.batchTexture;n.addUniform("sampler2D","model_batchTexture"),r.model_batchTexture=function(){return(0,m.Z)(l.batchTexture,l.defaultTexture)},n.addUniform("vec4","model_textureStep"),r.model_textureStep=function(){return l.textureStep},l.textureDimensions.y>1&&(n.addDefine("MULTILINE_BATCH_TEXTURE"),n.addUniform("vec2","model_textureDimensions"),r.model_textureDimensions=function(){return l.textureDimensions}),e.uniformMap=(0,hv.Z)(r,e.uniformMap)};let _Q={name:"ClassificationPipelineStage"};_Q.process=function(e,t,i){e.shaderBuilder.addDefine("HAS_CLASSIFICATION",void 0,_o.Z.BOTH);let n=e.runtimePrimitive;(0,_.Z)(n.batchLengths)||function(e,t){let i;let n=dq.getAttributeBySemantic(e,dj.POSITION);if(!(0,_.Z)(n))throw new e3.Z("Primitives must have a position attribute to be used for classification.");let r=e.indices,o=(0,_.Z)(r);o&&(i=r.typedArray,r.typedArray=void 0);let a=o?r.count:n.count,s=dq.getAttributeBySemantic(e,dj.FEATURE_ID,0);if(!(0,_.Z)(s)){t.batchLengths=[a],t.batchOffsets=[0];return}let l=s.typedArray;s.typedArray=void 0;let c=[],u=[0],h=l[o?i[0]:0],d=0;for(let e=1;e<a;e++){let t=l[o?i[e]:e];if(t!==h){let i=e-d,n=e;c.push(i),u.push(n),d=n,h=t}}let f=a-d;c.push(f),t.batchLengths=c,t.batchOffsets=u}(t,n)};let _J={name:"CPUStylingPipelineStage"};_J.process=function(e,t,i){let n=e.model,r=e.shaderBuilder;r.addVertexLines("void filterByPassType(inout vec3 positionMC, vec4 featureColor)\n{\n bool styleTranslucent = (featureColor.a != 1.0);\n // Only render translucent features in the translucent pass (if the style or the original command has translucency).\n if (czm_pass == czm_passTranslucent && !styleTranslucent && !model_commandTranslucent)\n {\n // If the model has a translucent silhouette, it needs to render during the silhouette color command,\n // (i.e. the command where model_silhouettePass = true), even if the model isn't translucent.\n #ifdef HAS_SILHOUETTE\n positionMC *= float(model_silhouettePass);\n #else\n positionMC *= 0.0;\n #endif\n }\n // If the current pass is not the translucent pass and the style is not translucent, don't render the feature.\n else if (czm_pass != czm_passTranslucent && styleTranslucent)\n {\n positionMC *= 0.0;\n }\n}\n\nvoid cpuStylingStage(inout vec3 positionMC, inout SelectedFeature feature)\n{\n float show = ceil(feature.color.a);\n positionMC *= show;\n\n #if defined(HAS_SELECTED_FEATURE_ID_ATTRIBUTE) && !defined(HAS_CLASSIFICATION)\n filterByPassType(positionMC, feature.color);\n #endif\n}\n"),r.addFragmentLines("void filterByPassType(vec4 featureColor)\n{\n bool styleTranslucent = (featureColor.a != 1.0);\n // Only render translucent features in the translucent pass (if the style or the original command has translucency).\n if (czm_pass == czm_passTranslucent && !styleTranslucent && !model_commandTranslucent)\n { \n // If the model has a translucent silhouette, it needs to render during the silhouette color command,\n // (i.e. the command where model_silhouettePass = true), even if the model isn't translucent.\n #ifdef HAS_SILHOUETTE\n if(!model_silhouettePass) {\n discard;\n }\n #else\n discard;\n #endif\n }\n // If the current pass is not the translucent pass and the style is not translucent, don't render the feature.\n else if (czm_pass != czm_passTranslucent && styleTranslucent)\n {\n discard;\n }\n}\n\nvoid cpuStylingStage(inout czm_modelMaterial material, SelectedFeature feature)\n{\n vec4 featureColor = feature.color;\n if (featureColor.a == 0.0)\n {\n discard;\n }\n\n // If a feature ID vertex attribute is used, the pass type filter is applied in the vertex shader.\n // So, we only apply in in the fragment shader if the feature ID texture is used.\n #if defined(HAS_SELECTED_FEATURE_ID_TEXTURE) && !defined(HAS_CLASSIFICATION)\n filterByPassType(featureColor);\n #endif\n\n featureColor = czm_gammaCorrect(featureColor);\n\n // Classification models compute the diffuse differently.\n #ifdef HAS_CLASSIFICATION\n material.diffuse = featureColor.rgb * featureColor.a;\n #else\n float highlight = ceil(model_colorBlend);\n material.diffuse *= mix(featureColor.rgb, vec3(1.0), highlight);\n #endif\n \n material.alpha *= featureColor.a;\n}\n"),r.addDefine("USE_CPU_STYLING",void 0,_o.Z.BOTH),(0,_.Z)(n.color)||(r.addUniform("float",__.COLOR_BLEND_UNIFORM_NAME,_o.Z.FRAGMENT),e.uniformMap[__.COLOR_BLEND_UNIFORM_NAME]=function(){return uC.getColorBlend(n.colorBlendMode,n.colorBlendAmount)}),r.addUniform("bool","model_commandTranslucent",_o.Z.BOTH),e.uniformMap.model_commandTranslucent=function(){return e.alphaOptions.pass===ej.Z.TRANSLUCENT}};var _0=i(6176);let _1={name:"FeatureIdPipelineStage",STRUCT_ID_FEATURE_IDS_VS:"FeatureIdsVS",STRUCT_ID_FEATURE_IDS_FS:"FeatureIdsFS",STRUCT_NAME_FEATURE_IDS:"FeatureIds",FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS:"initializeFeatureIdsVS",FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS:"initializeFeatureIdsFS",FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_VS:"initializeFeatureIdAliasesVS",FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_FS:"initializeFeatureIdAliasesFS",FUNCTION_SIGNATURE_INITIALIZE_FEATURE_IDS:"void initializeFeatureIds(out FeatureIds featureIds, ProcessedAttributes attributes)",FUNCTION_SIGNATURE_INITIALIZE_FEATURE_ID_ALIASES:"void initializeFeatureIdAliases(inout FeatureIds featureIds)",FUNCTION_ID_SET_FEATURE_ID_VARYINGS:"setFeatureIdVaryings",FUNCTION_SIGNATURE_SET_FEATURE_ID_VARYINGS:"void setFeatureIdVaryings()"};function _2(e,t,i,n,r,o){!function(e,t,i,n,r){let o,a;let s=e.model;if((0,_.Z)(t.repeat)){let e=function(e,t){let i=e.offset,n=e.repeat,r=new Float32Array(t);for(let e=0;e<t;e++)r[e]=i+Math.floor(e/n);return r}(t,i);(o=ek.Z.createVertexBuffer({context:r.context,typedArray:e,usage:eV.Z.STATIC_DRAW})).vertexArrayDestroyable=!1,s._pipelineResources.push(o),s.statistics.addBuffer(o,!1)}else a=[t.offset];let l={index:e.attributeIndex++,instanceDivisor:n,value:a,vertexBuffer:o,normalize:!1,componentsPerAttribute:1,componentDatatype:eM.Z.FLOAT,strideInBytes:eM.Z.getSizeInBytes(eM.Z.FLOAT),offsetInBytes:0};e.attributes.push(l)}(e,t,n,r,o);let a=e.shaderBuilder,s=`a_implicit_${i}`;a.addAttribute("float",s);let l=`v_implicit_${i}`;a.addVarying("float",l),a.addStructField(_1.STRUCT_ID_FEATURE_IDS_VS,"int",i),a.addStructField(_1.STRUCT_ID_FEATURE_IDS_FS,"int",i),a.addFunctionLines(_1.FUNCTION_ID_SET_FEATURE_ID_VARYINGS,[`${l} = ${s};`]),a.addFunctionLines(_1.FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS,[`featureIds.${i} = int(czm_round(${s}));`]),a.addFunctionLines(_1.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,[`featureIds.${i} = int(czm_round(${l}));`])}function _3(e,t,i,n){let r=e.shaderBuilder,o=_o.Z.includesVertexShader(n);o&&r.addStructField(_1.STRUCT_ID_FEATURE_IDS_VS,"int",i),r.addStructField(_1.STRUCT_ID_FEATURE_IDS_FS,"int",i);let a=[`featureIds.${i} = featureIds.${t};`];o&&r.addFunctionLines(_1.FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_VS,a),r.addFunctionLines(_1.FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_FS,a)}_1.process=function(e,t,i){let n=e.shaderBuilder;n.addStruct(_1.STRUCT_ID_FEATURE_IDS_VS,_1.STRUCT_NAME_FEATURE_IDS,_o.Z.VERTEX),n.addStruct(_1.STRUCT_ID_FEATURE_IDS_FS,_1.STRUCT_NAME_FEATURE_IDS,_o.Z.FRAGMENT),n.addFunction(_1.FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS,_1.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_IDS,_o.Z.VERTEX),n.addFunction(_1.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,_1.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_IDS,_o.Z.FRAGMENT),n.addFunction(_1.FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_VS,_1.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_ID_ALIASES,_o.Z.VERTEX),n.addFunction(_1.FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_FS,_1.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_ID_ALIASES,_o.Z.FRAGMENT),n.addFunction(_1.FUNCTION_ID_SET_FEATURE_ID_VARYINGS,_1.FUNCTION_SIGNATURE_SET_FEATURE_ID_VARYINGS,_o.Z.VERTEX);let r=e.runtimeNode.node.instances;(0,_.Z)(r)&&function(e,t,i){let n=t.featureIds,r=t.attributes[0].count;for(let t=0;t<n.length;t++){let o=n[t],a=o.positionalLabel;o instanceof uX.FeatureIdAttribute?function(e,t,i){let n=e.shaderBuilder;n.addStructField(_1.STRUCT_ID_FEATURE_IDS_VS,"int",i),n.addStructField(_1.STRUCT_ID_FEATURE_IDS_FS,"int",i);let r=t.setIndex,o=i.replace(/_\d+$/,"_"),a=`a_${o}${r}`,s=`v_${o}${r}`,l=`featureIds.${i} = int(czm_round(${a}));`,c=`featureIds.${i} = int(czm_round(${s}));`;n.addFunctionLines(_1.FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS,[l]),n.addFunctionLines(_1.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,[c]),n.addVarying("float",s),n.addFunctionLines(_1.FUNCTION_ID_SET_FEATURE_ID_VARYINGS,[`${s} = ${a};`])}(e,o,a):_2(e,o,a,r,1,i);let s=o.label;(0,_.Z)(s)&&_3(e,a,s,_o.Z.BOTH)}}(e,r,i),function(e,t,i){let n=t.featureIds,r=dq.getAttributeBySemantic(t,dj.POSITION).count;for(let t=0;t<n.length;t++){let o=n[t],a=o.positionalLabel,s=_o.Z.BOTH;o instanceof uX.FeatureIdAttribute?function(e,t,i){let n=e.shaderBuilder;n.addStructField(_1.STRUCT_ID_FEATURE_IDS_VS,"int",i),n.addStructField(_1.STRUCT_ID_FEATURE_IDS_FS,"int",i);let r=t.setIndex,o=i.replace(/_\d+$/,"_"),a=[`featureIds.${i} = int(czm_round(attributes.${o}${r}));`];n.addFunctionLines(_1.FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS,a),n.addFunctionLines(_1.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,a)}(e,o,a):o instanceof uX.FeatureIdImplicitRange?_2(e,o,a,r,void 0,i):(function(e,t,i,n,r){let o=`u_featureIdTexture_${n}`,a=e.uniformMap,s=t.textureReader;a[o]=function(){return(0,m.Z)(s.texture,r.context.defaultTexture)};let l=s.channels,c=e.shaderBuilder;c.addStructField(_1.STRUCT_ID_FEATURE_IDS_FS,"int",i),c.addUniform("sampler2D",o,_o.Z.FRAGMENT);let u=s.texCoord,h=`v_texCoord_${u}`,d=h,f=s.transform;if((0,_.Z)(f)&&!n2.Z.equals(f,n2.Z.IDENTITY)){let e=`${o}Transform`;c.addUniform("mat3",e,_o.Z.FRAGMENT),a[e]=function(){return f},d=`vec2(${e} * vec3(${h}, 1.0))`}let p=`texture(${o}, ${d}).${l}`,g=`featureIds.${i} = czm_unpackUint(${p});`;c.addFunctionLines(_1.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,[g])}(e,o,a,t,i),s=_o.Z.FRAGMENT);let l=o.label;(0,_.Z)(l)&&_3(e,a,l,s)}}(e,t,i),n.addVertexLines("void featureIdStage(out FeatureIds featureIds, ProcessedAttributes attributes) \n{\n initializeFeatureIds(featureIds, attributes);\n initializeFeatureIdAliases(featureIds);\n setFeatureIdVaryings();\n}\n"),n.addFragmentLines("void featureIdStage(out FeatureIds featureIds, ProcessedAttributes attributes) {\n initializeFeatureIds(featureIds, attributes);\n initializeFeatureIdAliases(featureIds);\n}\n")};let _4={name:"MetadataPipelineStage",STRUCT_ID_METADATA_VS:"MetadataVS",STRUCT_ID_METADATA_FS:"MetadataFS",STRUCT_NAME_METADATA:"Metadata",STRUCT_ID_METADATA_CLASS_VS:"MetadataClassVS",STRUCT_ID_METADATA_CLASS_FS:"MetadataClassFS",STRUCT_NAME_METADATA_CLASS:"MetadataClass",STRUCT_ID_METADATA_STATISTICS_VS:"MetadataStatisticsVS",STRUCT_ID_METADATA_STATISTICS_FS:"MetadataStatisticsFS",STRUCT_NAME_METADATA_STATISTICS:"MetadataStatistics",FUNCTION_ID_INITIALIZE_METADATA_VS:"initializeMetadataVS",FUNCTION_ID_INITIALIZE_METADATA_FS:"initializeMetadataFS",FUNCTION_SIGNATURE_INITIALIZE_METADATA:"void initializeMetadata(out Metadata metadata, out MetadataClass metadataClass, out MetadataStatistics metadataStatistics, ProcessedAttributes attributes)",FUNCTION_ID_SET_METADATA_VARYINGS:"setMetadataVaryings",FUNCTION_SIGNATURE_SET_METADATA_VARYINGS:"void setMetadataVaryings()",METADATA_CLASS_FIELDS:[{specName:"noData",shaderName:"noData"},{specName:"default",shaderName:"defaultValue"},{specName:"min",shaderName:"minValue"},{specName:"max",shaderName:"maxValue"}],METADATA_STATISTICS_FIELDS:[{specName:"min",shaderName:"minValue"},{specName:"max",shaderName:"maxValue"},{specName:"mean",shaderName:"mean",type:"float"},{specName:"median",shaderName:"median"},{specName:"standardDeviation",shaderName:"standardDeviation",type:"float"},{specName:"variance",shaderName:"variance",type:"float"},{specName:"sum",shaderName:"sum"}]};_4.process=function(e,t,i){var n,r,o,a;let{shaderBuilder:s,model:l}=e,{structuralMetadata:c={},content:u}=l,h=u?.tileset.metadataExtension?.statistics,d=(n=c.propertyAttributes,(0,_.Z)(n)?n.flatMap(e=>(function(e,t,i){let{getAttributeByName:n,getAttributeInfo:r,sanitizeGlslIdentifier:o}=dq,a=e.class.id,s=i?.classes[a],l=Object.entries(e.properties),c=Array(l.length);for(let e=0;e<l.length;e++){let[i,a]=l[e],{glslType:u,variableName:h}=r(n(t,a.attribute));c[e]={metadataVariable:o(i),property:a,type:a.classProperty.type,glslType:u,variableName:h,propertyStatistics:s?.properties[i],shaderDestination:_o.Z.BOTH}}return c})(e,t,h)):[]),f=(r=c.propertyTextures,(0,_.Z)(r)?r.flatMap(e=>(function(e,t){let{sanitizeGlslIdentifier:i}=dq,n=e.class.id,r=t?.classes[n],o=Object.entries(e.properties).filter(([e,t])=>t.isGpuCompatible()),a=Array(o.length);for(let e=0;e<o.length;e++){let[t,n]=o[e];a[e]={metadataVariable:i(t),property:n,type:n.classProperty.type,glslType:n.getGlslType(),propertyStatistics:r?.properties[t],shaderDestination:_o.Z.FRAGMENT}}return a})(e,h)):[]);(function(e,t){let i=new Set,n=new Set;for(let e=0;e<t.length;e++){let{type:r,glslType:o,propertyStatistics:a}=t[e];i.add(o),(0,_.Z)(a)&&r!==u5.Z.ENUM&&n.add(o)}let r=_4.METADATA_CLASS_FIELDS;for(let e of i)a(`${e}MetadataClass`,e,r);let o=_4.METADATA_STATISTICS_FIELDS;for(let e of n)a(`${e}MetadataStatistics`,e,o);function a(t,i,n){e.addStruct(t,t,_o.Z.BOTH);for(let r=0;r<n.length;r++){let{shaderName:o}=n[r],a="float"===n[r].type?function(e){let t=_5[e];return(0,_.Z)(t)?t:e}(i):i;e.addStructField(t,a,o)}}})(s,d.concat(f)),s.addStruct(_4.STRUCT_ID_METADATA_VS,_4.STRUCT_NAME_METADATA,_o.Z.VERTEX),s.addStruct(_4.STRUCT_ID_METADATA_FS,_4.STRUCT_NAME_METADATA,_o.Z.FRAGMENT),s.addStruct(_4.STRUCT_ID_METADATA_CLASS_VS,_4.STRUCT_NAME_METADATA_CLASS,_o.Z.VERTEX),s.addStruct(_4.STRUCT_ID_METADATA_CLASS_FS,_4.STRUCT_NAME_METADATA_CLASS,_o.Z.FRAGMENT),s.addStruct(_4.STRUCT_ID_METADATA_STATISTICS_VS,_4.STRUCT_NAME_METADATA_STATISTICS,_o.Z.VERTEX),s.addStruct(_4.STRUCT_ID_METADATA_STATISTICS_FS,_4.STRUCT_NAME_METADATA_STATISTICS,_o.Z.FRAGMENT),s.addFunction(_4.FUNCTION_ID_INITIALIZE_METADATA_VS,_4.FUNCTION_SIGNATURE_INITIALIZE_METADATA,_o.Z.VERTEX),s.addFunction(_4.FUNCTION_ID_INITIALIZE_METADATA_FS,_4.FUNCTION_SIGNATURE_INITIALIZE_METADATA,_o.Z.FRAGMENT),s.addFunction(_4.FUNCTION_ID_SET_METADATA_VARYINGS,_4.FUNCTION_SIGNATURE_SET_METADATA_VARYINGS,_o.Z.VERTEX),s.addVertexLines("void metadataStage(\n out Metadata metadata,\n out MetadataClass metadataClass,\n out MetadataStatistics metadataStatistics,\n ProcessedAttributes attributes\n )\n{\n initializeMetadata(metadata, metadataClass, metadataStatistics, attributes);\n setMetadataVaryings();\n}\n"),s.addFragmentLines("void metadataStage(\n out Metadata metadata,\n out MetadataClass metadataClass,\n out MetadataStatistics metadataStatistics,\n ProcessedAttributes attributes\n )\n{\n initializeMetadata(metadata, metadataClass, metadataStatistics, attributes);\n}\n");for(let t=0;t<d.length;t++)(function(e,t){let{shaderBuilder:i}=e,{metadataVariable:n,property:r,glslType:o}=t,a=_7({valueExpression:`attributes.${t.variableName}`,renderResources:e,glslType:o,metadataVariable:n,shaderDestination:_o.Z.BOTH,property:r});i.addStructField(_4.STRUCT_ID_METADATA_VS,o,n),i.addStructField(_4.STRUCT_ID_METADATA_FS,o,n);let s=`metadata.${n} = ${a};`;i.addFunctionLines(_4.FUNCTION_ID_INITIALIZE_METADATA_VS,[s]),i.addFunctionLines(_4.FUNCTION_ID_INITIALIZE_METADATA_FS,[s])})(e,o=d[t]),_9(e.shaderBuilder,o),_8(e.shaderBuilder,o);for(let t=0;t<f.length;t++)(function(e,t){let{shaderBuilder:i,uniformMap:n}=e,{metadataVariable:r,glslType:o,property:a}=t,{texCoord:s,channels:l,index:c,texture:u,transform:h}=a.textureReader,d=`u_propertyTexture_${c}`;n.hasOwnProperty(d)||(i.addUniform("sampler2D",d,_o.Z.FRAGMENT),n[d]=()=>u),i.addStructField(_4.STRUCT_ID_METADATA_FS,o,r);let f=`attributes.texCoord_${s}`,p=f;if((0,_.Z)(h)&&!n2.Z.equals(h,n2.Z.IDENTITY)){let e=`${d}Transform`;i.addUniform("mat3",e,_o.Z.FRAGMENT),n[e]=function(){return h},p=`vec2(${e} * vec3(${f}, 1.0))`}let m=`texture(${d}, ${p}).${l}`,g=_7({valueExpression:a.unpackInShader(m),renderResources:e,glslType:o,metadataVariable:r,shaderDestination:_o.Z.FRAGMENT,property:a}),Z=`metadata.${r} = ${g};`;i.addFunctionLines(_4.FUNCTION_ID_INITIALIZE_METADATA_FS,[Z])})(e,a=f[t]),_9(e.shaderBuilder,a),_8(e.shaderBuilder,a)};let _5={int:"float",ivec2:"vec2",ivec3:"vec3",ivec4:"vec4"};function _9(e,t){let{classProperty:i}=t.property,{metadataVariable:n,glslType:r,shaderDestination:o}=t,a=_6(_4.METADATA_CLASS_FIELDS,i,`metadataClass.${n}`,r),s=`${r}MetadataClass`;e.addStructField(_4.STRUCT_ID_METADATA_CLASS_FS,s,n),e.addFunctionLines(_4.FUNCTION_ID_INITIALIZE_METADATA_FS,a),_o.Z.includesVertexShader(o)&&(e.addStructField(_4.STRUCT_ID_METADATA_CLASS_VS,s,n),e.addFunctionLines(_4.FUNCTION_ID_INITIALIZE_METADATA_VS,a))}function _8(e,t){let{propertyStatistics:i}=t;if(!(0,_.Z)(i))return;let{metadataVariable:n,type:r,glslType:o}=t;if(r===u5.Z.ENUM)return;let a=_6(_4.METADATA_STATISTICS_FIELDS,i,`metadataStatistics.${n}`,o),s=`${o}MetadataStatistics`;e.addStructField(_4.STRUCT_ID_METADATA_STATISTICS_FS,s,n),e.addFunctionLines(_4.FUNCTION_ID_INITIALIZE_METADATA_FS,a),_o.Z.includesVertexShader(t.shaderDestination)&&(e.addStructField(_4.STRUCT_ID_METADATA_STATISTICS_VS,s,n),e.addFunctionLines(_4.FUNCTION_ID_INITIALIZE_METADATA_VS,a))}function _6(e,t,i,n){return(0,_.Z)(t)?e.map(function(e){let r=t[e.specName];if((0,_.Z)(r))return`${i}.${e.shaderName} = ${n}(${r});`}).filter(_.Z):[]}function _7(e){let{valueExpression:t,property:i}=e;if(!i.hasValueTransform)return t;let n=e.metadataVariable,r=`u_${n}_offset`,o=`u_${n}_scale`,{shaderBuilder:a,uniformMap:s}=e.renderResources,{glslType:l,shaderDestination:c}=e;a.addUniform(l,r,c),a.addUniform(l,o,c);let{offset:u,scale:h}=i;return s[r]=()=>u,s[o]=()=>h,`czm_valueTransform(${r}, ${o}, ${t})`}var ge=i(7972);let gt={name:"CustomShaderPipelineStage",STRUCT_ID_ATTRIBUTES_VS:"AttributesVS",STRUCT_ID_ATTRIBUTES_FS:"AttributesFS",STRUCT_NAME_ATTRIBUTES:"Attributes",STRUCT_ID_VERTEX_INPUT:"VertexInput",STRUCT_NAME_VERTEX_INPUT:"VertexInput",STRUCT_ID_FRAGMENT_INPUT:"FragmentInput",STRUCT_NAME_FRAGMENT_INPUT:"FragmentInput",FUNCTION_ID_INITIALIZE_INPUT_STRUCT_VS:"initializeInputStructVS",FUNCTION_SIGNATURE_INITIALIZE_INPUT_STRUCT_VS:"void initializeInputStruct(out VertexInput vsInput, ProcessedAttributes attributes)",FUNCTION_ID_INITIALIZE_INPUT_STRUCT_FS:"initializeInputStructFS",FUNCTION_SIGNATURE_INITIALIZE_INPUT_STRUCT_FS:"void initializeInputStruct(out FragmentInput fsInput, ProcessedAttributes attributes)",_oneTimeWarning:nP.Z};gt.process=function(e,t,i){let{shaderBuilder:n,model:r,alphaOptions:o}=e,{customShader:a}=r,{lightingModel:s,translucencyMode:l}=a;(0,_.Z)(s)&&(e.lightingOptions.lightingModel=s),l===ge.Z.TRANSLUCENT?o.pass=ej.Z.TRANSLUCENT:l===ge.Z.OPAQUE&&(o.pass=void 0);let c=function(e,t){let i=function(e){let t={};for(let i=0;i<e.length;i++){let n=dq.getAttributeInfo(e[i]);t[n.variableName]=n}return t}(t.attributes),n=function(e,t){let i;if(!(0,_.Z)(e.vertexShaderText))return{enabled:!1};let n=e.usedVariablesVertex.attributeSet,r=ga(t,n,!1),o=gs(t,n,!1),a=[],s=[];for(let e in r){if(!r.hasOwnProperty(e))continue;let t=[r[e].glslType,e];a.push(t),i=`vsInput.attributes.${e} = attributes.${e};`,s.push(i)}for(let e=0;e<o.length;e++){let t=o[e],n=gr(t);if(!(0,_.Z)(n))return gt._oneTimeWarning("CustomShaderPipelineStage.incompatiblePrimitiveVS",`Primitive is missing attribute ${t}, disabling custom vertex shader`),{enabled:!1};a.push(n.attributeField),i=`vsInput.attributes.${t} = ${n.value};`,s.push(i)}return{enabled:!0,attributeFields:a,initializationLines:s}}(e,i),r=function(e,t){let i;if(!(0,_.Z)(e.fragmentShaderText))return{enabled:!1};let n=e.usedVariablesFragment.attributeSet,r=ga(t,n,!0),o=gs(t,n,!0),a=[],s=[];for(let e in r){if(!r.hasOwnProperty(e))continue;let t=[r[e].glslType,e];a.push(t),i=`fsInput.attributes.${e} = attributes.${e};`,s.push(i)}for(let e=0;e<o.length;e++){let t=o[e],n=gr(t);if(!(0,_.Z)(n))return gt._oneTimeWarning("CustomShaderPipelineStage.incompatiblePrimitiveFS",`Primitive is missing attribute ${t}, disabling custom fragment shader.`),{enabled:!1};a.push(n.attributeField),i=`fsInput.attributes.${t} = ${n.value};`,s.push(i)}let l=function(e){let t=[],i=[],n=e.usedVariablesFragment.attributeSet;return n.hasOwnProperty("positionWC")&&(t.push(["vec3","positionWC"]),i.push("fsInput.attributes.positionWC = attributes.positionWC;")),n.hasOwnProperty("positionEC")&&(t.push(["vec3","positionEC"]),i.push("fsInput.attributes.positionEC = attributes.positionEC;")),{attributeFields:t,initializationLines:i}}(e);return{enabled:!0,attributeFields:a.concat(l.attributeFields),initializationLines:l.initializationLines.concat(s)}}(e,i),o=e.usedVariablesFragment.attributeSet.hasOwnProperty("positionWC")&&r.enabled;return{vertexLines:n,fragmentLines:r,customShaderEnabled:n.enabled||r.enabled,shouldComputePositionWC:o}}(a,t);if(!c.customShaderEnabled)return;if(function(e,t,i){let{vertexLines:n,fragmentLines:r}=i;n.enabled&&(function(e,t){let i=gt.STRUCT_ID_ATTRIBUTES_VS;e.addStruct(i,gt.STRUCT_NAME_ATTRIBUTES,_o.Z.VERTEX);let{attributeFields:n,initializationLines:r}=t;for(let t=0;t<n.length;t++){let[r,o]=n[t];e.addStructField(i,r,o)}i=gt.STRUCT_ID_VERTEX_INPUT,e.addStruct(i,gt.STRUCT_NAME_VERTEX_INPUT,_o.Z.VERTEX),e.addStructField(i,gt.STRUCT_NAME_ATTRIBUTES,"attributes"),e.addStructField(i,_1.STRUCT_NAME_FEATURE_IDS,"featureIds"),e.addStructField(i,_4.STRUCT_NAME_METADATA,"metadata"),e.addStructField(i,_4.STRUCT_NAME_METADATA_CLASS,"metadataClass"),e.addStructField(i,_4.STRUCT_NAME_METADATA_STATISTICS,"metadataStatistics");let o=gt.FUNCTION_ID_INITIALIZE_INPUT_STRUCT_VS;e.addFunction(o,gt.FUNCTION_SIGNATURE_INITIALIZE_INPUT_STRUCT_VS,_o.Z.VERTEX),e.addFunctionLines(o,r)}(e,n),gl.length=0,gl.push("#line 0",t.vertexShaderText,"void customShaderStage(\n inout czm_modelVertexOutput vsOutput, \n inout ProcessedAttributes attributes, \n FeatureIds featureIds,\n Metadata metadata,\n MetadataClass metadataClass,\n MetadataStatistics metadataStatistics\n) {\n // VertexInput and initializeInputStruct() are dynamically generated in JS, \n // see CustomShaderPipelineStage.js\n VertexInput vsInput;\n initializeInputStruct(vsInput, attributes);\n vsInput.featureIds = featureIds;\n vsInput.metadata = metadata;\n vsInput.metadataClass = metadataClass;\n vsInput.metadataStatistics = metadataStatistics;\n vertexMain(vsInput, vsOutput);\n attributes.positionMC = vsOutput.positionMC;\n}\n"),e.addVertexLines(gl)),r.enabled&&(function(e,t){let i=gt.STRUCT_ID_ATTRIBUTES_FS;e.addStruct(i,gt.STRUCT_NAME_ATTRIBUTES,_o.Z.FRAGMENT);let{attributeFields:n,initializationLines:r}=t;for(let t=0;t<n.length;t++){let[r,o]=n[t];e.addStructField(i,r,o)}i=gt.STRUCT_ID_FRAGMENT_INPUT,e.addStruct(i,gt.STRUCT_NAME_FRAGMENT_INPUT,_o.Z.FRAGMENT),e.addStructField(i,gt.STRUCT_NAME_ATTRIBUTES,"attributes"),e.addStructField(i,_1.STRUCT_NAME_FEATURE_IDS,"featureIds"),e.addStructField(i,_4.STRUCT_NAME_METADATA,"metadata"),e.addStructField(i,_4.STRUCT_NAME_METADATA_CLASS,"metadataClass"),e.addStructField(i,_4.STRUCT_NAME_METADATA_STATISTICS,"metadataStatistics");let o=gt.FUNCTION_ID_INITIALIZE_INPUT_STRUCT_FS;e.addFunction(o,gt.FUNCTION_SIGNATURE_INITIALIZE_INPUT_STRUCT_FS,_o.Z.FRAGMENT),e.addFunctionLines(o,r)}(e,r),gl.length=0,gl.push("#line 0",t.fragmentShaderText,"void customShaderStage(\n inout czm_modelMaterial material,\n ProcessedAttributes attributes,\n FeatureIds featureIds,\n Metadata metadata,\n MetadataClass metadataClass,\n MetadataStatistics metadataStatistics\n) {\n // FragmentInput and initializeInputStruct() are dynamically generated in JS, \n // see CustomShaderPipelineStage.js\n FragmentInput fsInput;\n initializeInputStruct(fsInput, attributes);\n fsInput.featureIds = featureIds;\n fsInput.metadata = metadata;\n fsInput.metadataClass = metadataClass;\n fsInput.metadataStatistics = metadataStatistics;\n fragmentMain(fsInput, material);\n}\n"),e.addFragmentLines(gl))}(n,a,c),c.shouldComputePositionWC&&n.addDefine("COMPUTE_POSITION_WC_CUSTOM_SHADER",void 0,_o.Z.BOTH),(0,_.Z)(a.vertexShaderText)&&n.addDefine("HAS_CUSTOM_VERTEX_SHADER",void 0,_o.Z.VERTEX),(0,_.Z)(a.fragmentShaderText)){n.addDefine("HAS_CUSTOM_FRAGMENT_SHADER",void 0,_o.Z.FRAGMENT);let e=_0.Z.getDefineName(a.mode);n.addDefine(e,void 0,_o.Z.FRAGMENT)}let u=a.uniforms;for(let e in u)if(u.hasOwnProperty(e)){let t=u[e];n.addUniform(t.type,e)}let h=a.varyings;for(let e in h)if(h.hasOwnProperty(e)){let t=h[e];n.addVarying(t,e)}e.uniformMap=(0,hv.Z)(e.uniformMap,a.uniformMap)};let gi={position:"vec3",normal:"vec3",tangent:"vec3",bitangent:"vec3",texCoord:"vec2",color:"vec4",joints:"ivec4",weights:"vec4"},gn={position:"vec3(0.0)",normal:"vec3(0.0, 0.0, 1.0)",tangent:"vec3(1.0, 0.0, 0.0)",bitangent:"vec3(0.0, 1.0, 0.0)",texCoord:"vec2(0.0)",color:"vec4(1.0)",joints:"ivec4(0)",weights:"vec4(0.0)"};function gr(e){let t=e.replace(/_[0-9]+$/,""),i=gi[t=t.replace(/(MC|EC)$/,"")],n=gn[t];if((0,_.Z)(i))return{attributeField:[i,e],value:n}}let go={positionWC:!0,positionEC:!0};function ga(e,t,i){let n={};for(let r in e){if(!e.hasOwnProperty(r))continue;let o=e[r],a=r;i&&"normalMC"===r?a="normalEC":i&&"tangentMC"===r&&(a="tangentEC",o.glslType="vec3"),t.hasOwnProperty(a)&&(n[a]=o)}return n}function gs(e,t,i){let n=[];for(let r in t){if(!t.hasOwnProperty(r)||go.hasOwnProperty(r))continue;let o=r;i&&"normalEC"===r?o="normalMC":i&&"tangentEC"===r&&(o="tangentMC"),e.hasOwnProperty(o)||n.push(r)}return n}let gl=[],gc={name:"DequantizationPipelineStage",FUNCTION_ID_DEQUANTIZATION_STAGE_VS:"dequantizationStage",FUNCTION_SIGNATURE_DEQUANTIZATION_STAGE_VS:"void dequantizationStage(inout ProcessedAttributes attributes)"};function gu(e,t){return e instanceof eo.Z?e:new eo.Z(e.x,e.y,e.z,t)}gc.process=function(e,t,i){let n=e.shaderBuilder,r=e.model,o=(0,_.Z)(r.classificationType);n.addDefine("USE_DEQUANTIZATION",void 0,_o.Z.VERTEX),n.addFunction(gc.FUNCTION_ID_DEQUANTIZATION_STAGE_VS,gc.FUNCTION_SIGNATURE_DEQUANTIZATION_STAGE_VS,_o.Z.VERTEX);let a=t.attributes;for(let t=0;t<a.length;t++){let i=a[t],r=i.quantization;if(!(0,_.Z)(r))continue;let s=i.semantic===dj.POSITION,l=i.semantic===dj.TEXCOORD;if(o&&!s&&!l)continue;let c=dq.getAttributeInfo(i);(function(e,t){let i;let n=t.variableName,r=t.attribute.quantization;i=r.octEncoded?function(e,t){let i=`attributes.${e}`,n=`a_quantized_${e}`,r=`model_normalizationRange_${e}`,o=t.octEncodedZXY?".zxy":".xyz";return`${i} = czm_octDecode(${n}, ${r})${o};`}(n,r):function(e){let t=`attributes.${e}`,i=`a_quantized_${e}`,n=`model_quantizedVolumeOffset_${e}`,r=`model_quantizedVolumeStepSize_${e}`;return`${t} = ${n} + ${i} * ${r};`}(n),e.addFunctionLines(gc.FUNCTION_ID_DEQUANTIZATION_STAGE_VS,[i])})(n,c),function(e,t){let i=e.shaderBuilder,n=e.uniformMap,r=t.variableName,o=t.attribute.quantization;if(o.octEncoded){let e=`model_normalizationRange_${r}`;i.addUniform("float",e,_o.Z.VERTEX),n[e]=function(){return o.normalizationRange}}else{let e=`model_quantizedVolumeOffset_${r}`,a=`model_quantizedVolumeStepSize_${r}`,s=t.glslType;i.addUniform(s,e,_o.Z.VERTEX),i.addUniform(s,a,_o.Z.VERTEX);let l=o.quantizedVolumeOffset,c=o.quantizedVolumeStepSize;/^color_\d+$/.test(r)&&(l=gu(l,0),c=gu(c,1)),n[e]=function(){return l},n[a]=function(){return c}}}(e,c)}};var gh="vec2 computeSt(float featureId)\n{\n float stepX = model_textureStep.x;\n float centerX = model_textureStep.y;\n\n #ifdef MULTILINE_BATCH_TEXTURE\n float stepY = model_textureStep.z;\n float centerY = model_textureStep.w;\n\n float xId = mod(featureId, model_textureDimensions.x); \n float yId = floor(featureId / model_textureDimensions.x);\n \n return vec2(centerX + (xId * stepX), centerY + (yId * stepY));\n #else\n return vec2(centerX + (featureId * stepX), 0.5);\n #endif\n}\n\nvoid selectedFeatureIdStage(out SelectedFeature feature, FeatureIds featureIds)\n{ \n int featureId = featureIds.SELECTED_FEATURE_ID;\n\n\n if (featureId < model_featuresLength)\n {\n vec2 featureSt = computeSt(float(featureId));\n\n feature.id = featureId;\n feature.st = featureSt;\n feature.color = texture(model_batchTexture, featureSt);\n }\n // Floating point comparisons can be unreliable in GLSL, so we\n // increment the feature ID to make sure it's always greater\n // then the model_featuresLength - a condition we check for in the\n // pick ID, to avoid sampling the pick texture if the feature ID is\n // greater than the number of features.\n else\n {\n feature.id = model_featuresLength + 1;\n feature.st = vec2(0.0);\n feature.color = vec4(1.0);\n }\n\n #ifdef HAS_NULL_FEATURE_ID\n if (featureId == model_nullFeatureId) {\n feature.id = featureId;\n feature.st = vec2(0.0);\n feature.color = vec4(1.0);\n }\n #endif\n}\n";let gd={name:"SelectedFeatureIdPipelineStage",STRUCT_ID_SELECTED_FEATURE:"SelectedFeature",STRUCT_NAME_SELECTED_FEATURE:"SelectedFeature",FUNCTION_ID_FEATURE_VARYINGS_VS:"updateFeatureStructVS",FUNCTION_ID_FEATURE_VARYINGS_FS:"updateFeatureStructFS",FUNCTION_SIGNATURE_UPDATE_FEATURE:"void updateFeatureStruct(inout SelectedFeature feature)"};gd.process=function(e,t,i){var n,r;let o,a;let s=e.shaderBuilder;e.hasPropertyTable=!0;let l=(n=e.model,r=e.runtimeNode.node,(0,_.Z)(r.instances)&&(a=dq.getFeatureIdsByLabel(r.instances.featureIds,n.instanceFeatureIdLabel),(0,_.Z)(a))||(a=dq.getFeatureIdsByLabel(t.featureIds,n.featureIdLabel)),o=(0,m.Z)(a.label,a.positionalLabel),{featureIds:a,variableName:o,shaderDestination:a instanceof uX.FeatureIdTexture?_o.Z.FRAGMENT:_o.Z.BOTH,featureIdDefine:a instanceof uX.FeatureIdTexture?"HAS_SELECTED_FEATURE_ID_TEXTURE":"HAS_SELECTED_FEATURE_ID_ATTRIBUTE"}),c=l.shaderDestination;s.addDefine("HAS_SELECTED_FEATURE_ID",void 0,c),s.addDefine("SELECTED_FEATURE_ID",l.variableName,c),s.addDefine(l.featureIdDefine,void 0,c),s.addStructField(gd.STRUCT_ID_SELECTED_FEATURE,"int","id"),s.addStructField(gd.STRUCT_ID_SELECTED_FEATURE,"vec2","st"),s.addStructField(gd.STRUCT_ID_SELECTED_FEATURE,"vec4","color");let u=l.featureIds.nullFeatureId,h=e.uniformMap;(0,_.Z)(u)&&(s.addDefine("HAS_NULL_FEATURE_ID",void 0,c),s.addUniform("int","model_nullFeatureId",c),h.model_nullFeatureId=function(){return u}),l.shaderDestination===_o.Z.BOTH&&s.addVertexLines(gh),s.addFragmentLines(gh)};let gf={name:"GeometryPipelineStage",STRUCT_ID_PROCESSED_ATTRIBUTES_VS:"ProcessedAttributesVS",STRUCT_ID_PROCESSED_ATTRIBUTES_FS:"ProcessedAttributesFS",STRUCT_NAME_PROCESSED_ATTRIBUTES:"ProcessedAttributes",FUNCTION_ID_INITIALIZE_ATTRIBUTES:"initializeAttributes",FUNCTION_SIGNATURE_INITIALIZE_ATTRIBUTES:"void initializeAttributes(out ProcessedAttributes attributes)",FUNCTION_ID_SET_DYNAMIC_VARYINGS_VS:"setDynamicVaryingsVS",FUNCTION_ID_SET_DYNAMIC_VARYINGS_FS:"setDynamicVaryingsFS",FUNCTION_SIGNATURE_SET_DYNAMIC_VARYINGS:"void setDynamicVaryings(inout ProcessedAttributes attributes)"};gf.process=function(e,t,i){let{shaderBuilder:n,model:r}=e;n.addStruct(gf.STRUCT_ID_PROCESSED_ATTRIBUTES_VS,"ProcessedAttributes",_o.Z.VERTEX),n.addStruct(gf.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,"ProcessedAttributes",_o.Z.FRAGMENT),n.addStruct(gd.STRUCT_ID_SELECTED_FEATURE,gd.STRUCT_NAME_SELECTED_FEATURE,_o.Z.BOTH),n.addFunction(gf.FUNCTION_ID_INITIALIZE_ATTRIBUTES,gf.FUNCTION_SIGNATURE_INITIALIZE_ATTRIBUTES,_o.Z.VERTEX),n.addVarying("vec3","v_positionWC"),n.addVarying("vec3","v_positionEC"),n.addStructField(gf.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,"vec3","positionWC"),n.addStructField(gf.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,"vec3","positionEC"),n.addFunction(gf.FUNCTION_ID_SET_DYNAMIC_VARYINGS_VS,gf.FUNCTION_SIGNATURE_SET_DYNAMIC_VARYINGS,_o.Z.VERTEX),n.addFunction(gf.FUNCTION_ID_SET_DYNAMIC_VARYINGS_FS,gf.FUNCTION_SIGNATURE_SET_DYNAMIC_VARYINGS,_o.Z.FRAGMENT),r.type===mY.TILE_PNTS&&n.addDefine("HAS_SRGB_COLOR",void 0,_o.Z.FRAGMENT);let o=i.mode!==eu.Z.SCENE3D&&!i.scene3DOnly&&r._projectTo2D,a=(0,_.Z)(e.runtimeNode.node.instances),s=o&&!a,l=t.attributes.length;for(let i=0;i<l;i++){let n;let r=t.attributes[i],l=dH.Z.getAttributeLocationCount(r.type);if(!(0,_.Z)(r.buffer)&&!(0,_.Z)(r.constant))throw new A.Z("Attributes must be provided as a Buffer or constant value");let c=r.semantic===dj.POSITION;l>1?(n=e.attributeIndex,e.attributeIndex+=l):n=c&&!s?0:e.attributeIndex++,function(e,t,i,n,r,o){let a=e.shaderBuilder,s=dq.getAttributeInfo(t),l=r&&!o;n>1?function(e,t,i,n){let{quantization:r,normalized:o}=t,{type:a,componentDatatype:s}=(0,_.Z)(r)?r:t,l=dH.Z.getNumberOfComponents(a)/n,c=l*eM.Z.getSizeInBytes(s),u=t.byteStride;for(let r=0;r<n;r++){let n=t.byteOffset+r*c,a={index:i+r,vertexBuffer:t.buffer,componentsPerAttribute:l,componentDatatype:s,offsetInBytes:n,strideInBytes:u,normalize:o};e.attributes.push(a)}}(e,t,i,n):function(e,t,i,n){let{quantization:r,semantic:o,setIndex:a}=t,{type:s,componentDatatype:l}=(0,_.Z)(r)?r:t;o===dj.FEATURE_ID&&a>=e.featureIdVertexAttributeSetIndex&&(e.featureIdVertexAttributeSetIndex=a+1);let c=o===dj.POSITION,u=dH.Z.getNumberOfComponents(s),h={index:c?0:i,value:(0,_.Z)(t.buffer)?void 0:t.constant,vertexBuffer:t.buffer,count:t.count,componentsPerAttribute:u,componentDatatype:l,offsetInBytes:t.byteOffset,strideInBytes:t.byteStride,normalize:t.normalized};if(e.attributes.push(h),!c||!n)return;let d={index:i,vertexBuffer:e.runtimePrimitive.positionBuffer2D,count:t.count,componentsPerAttribute:u,componentDatatype:eM.Z.FLOAT,offsetInBytes:0,strideInBytes:void 0,normalize:t.normalized};e.attributes.push(d)}(e,t,i,l),function(e,t,i){let n,r;let o=t.attribute.semantic,a=t.variableName;t.isQuantized?(n=`a_quantized_${a}`,r=t.quantizedGlslType):(n=`a_${a}`,r=t.glslType);let s=o===dj.POSITION;s?e.setPositionAttribute(r,n):e.addAttribute(r,n),s&&i&&e.addAttribute("vec3","a_position2D")}(a,s,l),function(e,t){let i;let n=t.variableName,r=`v_${n}`;"normalMC"===n?(r="v_normalEC",i=t.glslType):"tangentMC"===n?(i="vec3",r="v_tangentEC"):i=t.glslType,e.addVarying(i,r)}(a,s),(0,_.Z)(t.semantic)&&function(e,t){let{semantic:i,setIndex:n}=t;switch(i){case dj.NORMAL:e.addDefine("HAS_NORMALS");break;case dj.TANGENT:e.addDefine("HAS_TANGENTS");break;case dj.FEATURE_ID:e.addDefine(`HAS${i}_${n}`);break;case dj.TEXCOORD:case dj.COLOR:e.addDefine(`HAS_${i}_${n}`)}}(a,t),function(e,t,i){let n=gf.STRUCT_ID_PROCESSED_ATTRIBUTES_VS,r=gf.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,{variableName:o,glslType:a}=t;"tangentMC"===o?(e.addStructField(n,"vec3","tangentMC"),e.addStructField(n,"float","tangentSignMC"),e.addStructField(r,"vec3","tangentEC")):"normalMC"===o?(e.addStructField(n,"vec3","normalMC"),e.addStructField(r,"vec3","normalEC")):(e.addStructField(n,a,o),e.addStructField(r,a,o)),"positionMC"===o&&i&&e.addStructField(n,"vec3","position2D")}(a,s,r),function(e,t,i){let n=gf.FUNCTION_ID_INITIALIZE_ATTRIBUTES,r=t.variableName;if("positionMC"===r&&i&&e.addFunctionLines(n,["attributes.position2D = a_position2D;"]),t.isQuantized)return;let o=[];"tangentMC"===r?(o.push("attributes.tangentMC = a_tangentMC.xyz;"),o.push("attributes.tangentSignMC = a_tangentMC.w;")):o.push(`attributes.${r} = a_${r};`),e.addFunctionLines(n,o)}(a,s,l),function(e,t){let{semantic:i,setIndex:n}=t.attribute;if((0,_.Z)(i)&&!(0,_.Z)(n))return;let r=gf.FUNCTION_ID_SET_DYNAMIC_VARYINGS_VS,o=t.variableName,a=`v_${o} = attributes.${o};`;e.addFunctionLines(r,[a]),r=gf.FUNCTION_ID_SET_DYNAMIC_VARYINGS_FS,a=`attributes.${o} = v_${o};`,e.addFunctionLines(r,[a])}(a,s)}(e,r,n,l,o,a)}(function(e,t){let i=!1,n=!1;for(let e=0;e<t.length;e++){let r=t[e];r.semantic===dj.NORMAL?i=!0:r.semantic===dj.TANGENT&&(n=!0)}i&&n&&(e.addDefine("HAS_BITANGENTS"),e.addVarying("vec3","v_bitangentEC"),e.addStructField(gf.STRUCT_ID_PROCESSED_ATTRIBUTES_VS,"vec3","bitangentMC"),e.addStructField(gf.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,"vec3","bitangentEC"))})(n,t.attributes),t.primitiveType===iT.Z.POINTS&&n.addDefine("PRIMITIVE_TYPE_POINTS"),n.addVertexLines("vec4 geometryStage(inout ProcessedAttributes attributes, mat4 modelView, mat3 normal)\n{\n vec4 computedPosition;\n\n // Compute positions in different coordinate systems\n vec3 positionMC = attributes.positionMC;\n v_positionMC = positionMC;\n v_positionEC = (modelView * vec4(positionMC, 1.0)).xyz;\n\n #if defined(USE_2D_POSITIONS) || defined(USE_2D_INSTANCING)\n vec3 position2D = attributes.position2D;\n vec3 positionEC = (u_modelView2D * vec4(position2D, 1.0)).xyz;\n computedPosition = czm_projection * vec4(positionEC, 1.0);\n #else\n computedPosition = czm_projection * vec4(v_positionEC, 1.0);\n #endif\n\n // Sometimes the custom shader and/or style needs this\n #if defined(COMPUTE_POSITION_WC_CUSTOM_SHADER) || defined(COMPUTE_POSITION_WC_STYLE) || defined(COMPUTE_POSITION_WC_ATMOSPHERE) || defined(ENABLE_CLIPPING_POLYGONS)\n // Note that this is a 32-bit position which may result in jitter on small\n // scales.\n v_positionWC = (czm_model * vec4(positionMC, 1.0)).xyz;\n #endif\n\n #ifdef HAS_NORMALS\n v_normalEC = normalize(normal * attributes.normalMC);\n #endif\n\n #ifdef HAS_TANGENTS\n v_tangentEC = normalize(normal * attributes.tangentMC);\n #endif\n\n #ifdef HAS_BITANGENTS\n v_bitangentEC = normalize(normal * attributes.bitangentMC);\n #endif\n\n // All other varyings need to be dynamically generated in\n // GeometryPipelineStage\n setDynamicVaryings(attributes);\n\n return computedPosition;\n}\n"),n.addFragmentLines("void geometryStage(out ProcessedAttributes attributes)\n{\n attributes.positionMC = v_positionMC;\n attributes.positionEC = v_positionEC;\n\n #if defined(COMPUTE_POSITION_WC_CUSTOM_SHADER) || defined(COMPUTE_POSITION_WC_STYLE) || defined(COMPUTE_POSITION_WC_ATMOSPHERE)\n attributes.positionWC = v_positionWC;\n #endif\n\n #ifdef HAS_NORMALS\n // renormalize after interpolation\n attributes.normalEC = normalize(v_normalEC);\n #endif\n\n #ifdef HAS_TANGENTS\n attributes.tangentEC = normalize(v_tangentEC);\n #endif\n\n #ifdef HAS_BITANGENTS\n attributes.bitangentEC = normalize(v_bitangentEC);\n #endif\n\n // Everything else is dynamically generated in GeometryPipelineStage\n setDynamicVaryings(attributes);\n}\n")};var gp=Object.freeze({UNLIT:0,PBR:1});let gm={name:"LightingPipelineStage"};gm.process=function(e,t){let{model:i,lightingOptions:n,shaderBuilder:r}=e;(0,_.Z)(i.lightColor)&&(r.addDefine("USE_CUSTOM_LIGHT_COLOR",void 0,_o.Z.FRAGMENT),r.addUniform("vec3","model_lightColorHdr",_o.Z.FRAGMENT),e.uniformMap.model_lightColorHdr=function(){return i.lightColor});let{lightingModel:o}=n;o===gp.PBR?r.addDefine("LIGHTING_PBR",void 0,_o.Z.FRAGMENT):r.addDefine("LIGHTING_UNLIT",void 0,_o.Z.FRAGMENT),r.addFragmentLines("#ifdef USE_IBL_LIGHTING\nvec3 computeIBL(vec3 position, vec3 normal, vec3 lightDirection, vec3 lightColorHdr, czm_modelMaterial material)\n{\n #if defined(DIFFUSE_IBL) || defined(SPECULAR_IBL)\n // Environment maps were provided, use them for IBL\n vec3 viewDirection = -normalize(position);\n vec3 iblColor = textureIBL(viewDirection, normal, lightDirection, material);\n #else\n // Use procedural IBL if there are no environment maps\n vec3 imageBasedLighting = proceduralIBL(position, normal, lightDirection, material);\n float maximumComponent = czm_maximumComponent(lightColorHdr);\n vec3 clampedLightColor = lightColorHdr / max(maximumComponent, 1.0);\n vec3 iblColor = clampedLightColor * imageBasedLighting;\n #endif\n return iblColor * material.occlusion;\n}\n#endif\n\n#ifdef USE_CLEARCOAT\nvec3 addClearcoatReflection(vec3 baseLayerColor, vec3 position, vec3 lightDirection, vec3 lightColorHdr, czm_modelMaterial material)\n{\n vec3 viewDirection = -normalize(position);\n vec3 halfwayDirection = normalize(viewDirection + lightDirection);\n vec3 normal = material.clearcoatNormal;\n float NdotL = clamp(dot(normal, lightDirection), 0.001, 1.0);\n\n // clearcoatF0 = vec3(pow((ior - 1.0) / (ior + 1.0), 2.0)), but without KHR_materials_ior, ior is a constant 1.5.\n vec3 f0 = vec3(0.04);\n vec3 f90 = vec3(1.0);\n // Note: clearcoat Fresnel computed with dot(n, v) instead of dot(v, h).\n // This is to make it energy conserving with a simple layering function.\n float NdotV = clamp(dot(normal, viewDirection), 0.0, 1.0);\n vec3 F = fresnelSchlick2(f0, f90, NdotV);\n\n // compute specular reflection from direct lighting\n float roughness = material.clearcoatRoughness;\n float directStrength = computeDirectSpecularStrength(normal, lightDirection, viewDirection, halfwayDirection, roughness);\n vec3 directReflection = F * directStrength * NdotL;\n vec3 color = lightColorHdr * directReflection;\n\n #ifdef SPECULAR_IBL\n // Find the direction in which to sample the environment map\n vec3 cubeDir = normalize(model_iblReferenceFrameMatrix * normalize(reflect(-viewDirection, normal)));\n vec3 iblColor = computeSpecularIBL(cubeDir, NdotV, NdotV, f0, roughness);\n color += iblColor * material.occlusion;\n #elif defined(USE_IBL_LIGHTING)\n vec3 positionWC = vec3(czm_inverseView * vec4(position, 1.0));\n vec3 reflectionWC = normalize(czm_inverseViewRotation * normalize(reflect(viewDirection, normal)));\n vec3 skyMetrics = getProceduralSkyMetrics(positionWC, reflectionWC);\n\n vec3 specularIrradiance = getProceduralSpecularIrradiance(reflectionWC, skyMetrics, roughness);\n vec2 brdfLut = texture(czm_brdfLut, vec2(NdotV, roughness)).rg;\n vec3 specularColor = czm_srgbToLinear(f0 * brdfLut.x + brdfLut.y);\n vec3 iblColor = specularIrradiance * specularColor * model_iblFactor.y;\n #ifdef USE_SUN_LUMINANCE\n iblColor *= getSunLuminance(positionWC, normal, lightDirection);\n #endif\n float maximumComponent = czm_maximumComponent(lightColorHdr);\n vec3 clampedLightColor = lightColorHdr / max(maximumComponent, 1.0);\n color += clampedLightColor* iblColor * material.occlusion;\n #endif\n\n float clearcoatFactor = material.clearcoatFactor;\n vec3 clearcoatColor = color * clearcoatFactor;\n\n // Dim base layer based on transmission loss through clearcoat\n return baseLayerColor * (1.0 - clearcoatFactor * F) + clearcoatColor;\n}\n#endif\n\n#if defined(LIGHTING_PBR) && defined(HAS_NORMALS)\nvec3 computePbrLighting(in czm_modelMaterial material, in vec3 position)\n{\n #ifdef USE_CUSTOM_LIGHT_COLOR\n vec3 lightColorHdr = model_lightColorHdr;\n #else\n vec3 lightColorHdr = czm_lightColorHdr;\n #endif\n\n vec3 viewDirection = -normalize(position);\n vec3 normal = material.normalEC;\n vec3 lightDirection = normalize(czm_lightDirectionEC);\n\n vec3 directLighting = czm_pbrLighting(viewDirection, normal, lightDirection, material);\n vec3 directColor = lightColorHdr * directLighting;\n\n // Accumulate colors from base layer\n vec3 color = directColor + material.emissive;\n #ifdef USE_IBL_LIGHTING\n color += computeIBL(position, normal, lightDirection, lightColorHdr, material);\n #endif\n\n #ifdef USE_CLEARCOAT\n color = addClearcoatReflection(color, position, lightDirection, lightColorHdr, material);\n #endif\n\n return color;\n}\n#endif\n\n/**\n * Compute the material color under the current lighting conditions.\n * All other material properties are passed through so further stages\n * have access to them.\n *\n * @param {czm_modelMaterial} material The material properties from {@MaterialStageFS}\n * @param {ProcessedAttributes} attributes\n */\nvoid lightingStage(inout czm_modelMaterial material, ProcessedAttributes attributes)\n{\n #ifdef LIGHTING_PBR\n #ifdef HAS_NORMALS\n vec3 color = computePbrLighting(material, attributes.positionEC);\n #else\n vec3 color = material.diffuse * material.occlusion + material.emissive;\n #endif\n // In HDR mode, the frame buffer is in linear color space. The\n // post-processing stages (see PostProcessStageCollection) will handle\n // tonemapping. However, if HDR is not enabled, we must tonemap else large\n // values may be clamped to 1.0\n #ifndef HDR\n color = czm_acesTonemapping(color);\n #endif\n #else // unlit\n vec3 color = material.diffuse;\n #endif\n\n #ifdef HAS_POINT_CLOUD_COLOR_STYLE\n // The colors resulting from point cloud styles are adjusted differently.\n color = czm_gammaCorrect(color);\n #elif !defined(HDR)\n // If HDR is not enabled, the frame buffer stores sRGB colors rather than\n // linear colors so the linear value must be converted.\n color = czm_linearToSrgb(color);\n #endif\n\n material.diffuse = color;\n}\n")};let{Material:g_,MetallicRoughness:gg,SpecularGlossiness:gZ,Specular:gy,Clearcoat:gb}=uX,gv={name:"MaterialPipelineStage",_processTexture:gE,_processTextureTransform:gT};function gT(e,t,i,n,r){let o=`HAS_${r}_TEXTURE_TRANSFORM`;e.addDefine(o,void 0,_o.Z.FRAGMENT);let a=`${n}Transform`;e.addUniform("mat3",a,_o.Z.FRAGMENT),t[a]=function(){return i.transform}}function gE(e,t,i,n,r,o){e.addUniform("sampler2D",n,_o.Z.FRAGMENT),t[n]=function(){return(0,m.Z)(i.texture,o)};let a=`HAS_${r}_TEXTURE`;e.addDefine(a,void 0,_o.Z.FRAGMENT);let s=i.texCoord,l=`v_texCoord_${s}`,c=`TEXCOORD_${r}`;e.addDefine(c,l,_o.Z.FRAGMENT);let u=i.transform;(0,_.Z)(u)&&!n2.Z.equals(u,n2.Z.IDENTITY)&&gT(e,t,i,n,r)}gv.process=function(e,t,i){let n=t.material,{model:r,uniformMap:o,shaderBuilder:a}=e,s=(0,_.Z)(r.classificationType),{defaultTexture:l,defaultNormalTexture:c,defaultEmissiveTexture:u}=i.context;(function(e,t,i,n,r,o,a){let{emissiveFactor:s,emissiveTexture:l,normalTexture:c,occlusionTexture:u}=e;(0,_.Z)(s)&&!S.Z.equals(s,g_.DEFAULT_EMISSIVE_FACTOR)&&(i.addUniform("vec3","u_emissiveFactor",_o.Z.FRAGMENT),t.u_emissiveFactor=function(){return e.emissiveFactor},i.addDefine("HAS_EMISSIVE_FACTOR",void 0,_o.Z.FRAGMENT),(0,_.Z)(l)&&!a&&gE(i,t,l,"u_emissiveTexture","EMISSIVE",o)),(0,_.Z)(c)&&!a&&gE(i,t,c,"u_normalTexture","NORMAL",r),(0,_.Z)(u)&&!a&&gE(i,t,u,"u_occlusionTexture","OCCLUSION",n)})(n,o,a,l,c,u,s),(0,_.Z)(n.specularGlossiness)?function(e,t,i,n,r){let{diffuseTexture:o,diffuseFactor:a,specularGlossinessTexture:s,specularFactor:l,glossinessFactor:c}=e;i.addDefine("USE_SPECULAR_GLOSSINESS",void 0,_o.Z.FRAGMENT),(0,_.Z)(o)&&!r&&gE(i,t,o,"u_diffuseTexture","DIFFUSE",n),(0,_.Z)(a)&&!eo.Z.equals(a,gZ.DEFAULT_DIFFUSE_FACTOR)&&(i.addUniform("vec4","u_diffuseFactor",_o.Z.FRAGMENT),t.u_diffuseFactor=function(){return e.diffuseFactor},i.addDefine("HAS_DIFFUSE_FACTOR",void 0,_o.Z.FRAGMENT)),(0,_.Z)(s)&&!r&&gE(i,t,s,"u_specularGlossinessTexture","SPECULAR_GLOSSINESS",n),(0,_.Z)(l)&&!S.Z.equals(l,gZ.DEFAULT_SPECULAR_FACTOR)&&(i.addUniform("vec3","u_legacySpecularFactor",_o.Z.FRAGMENT),t.u_legacySpecularFactor=function(){return e.specularFactor},i.addDefine("HAS_LEGACY_SPECULAR_FACTOR",void 0,_o.Z.FRAGMENT)),(0,_.Z)(c)&&c!==gZ.DEFAULT_GLOSSINESS_FACTOR&&(i.addUniform("float","u_glossinessFactor",_o.Z.FRAGMENT),t.u_glossinessFactor=function(){return e.glossinessFactor},i.addDefine("HAS_GLOSSINESS_FACTOR",void 0,_o.Z.FRAGMENT))}(n.specularGlossiness,o,a,l,s):((0,_.Z)(n.specular)&&dq.supportedExtensions.KHR_materials_specular&&function(e,t,i,n,r){let{specularTexture:o,specularFactor:a,specularColorTexture:s,specularColorFactor:l}=e;i.addDefine("USE_SPECULAR",void 0,_o.Z.FRAGMENT),(0,_.Z)(o)&&!r&&gE(i,t,o,"u_specularTexture","SPECULAR",n),(0,_.Z)(a)&&a!==gy.DEFAULT_SPECULAR_FACTOR&&(i.addUniform("float","u_specularFactor",_o.Z.FRAGMENT),t.u_specularFactor=function(){return e.specularFactor},i.addDefine("HAS_SPECULAR_FACTOR",void 0,_o.Z.FRAGMENT)),(0,_.Z)(s)&&!r&&gE(i,t,s,"u_specularColorTexture","SPECULAR_COLOR",n),(0,_.Z)(l)&&!S.Z.equals(l,gy.DEFAULT_SPECULAR_COLOR_FACTOR)&&(i.addUniform("vec3","u_specularColorFactor",_o.Z.FRAGMENT),t.u_specularColorFactor=function(){return e.specularColorFactor},i.addDefine("HAS_SPECULAR_COLOR_FACTOR",void 0,_o.Z.FRAGMENT))}(n.specular,o,a,l,s),(0,_.Z)(n.anisotropy)&&dq.supportedExtensions.KHR_materials_anisotropy&&function(e,t,i,n,r){let{anisotropyStrength:o,anisotropyRotation:a,anisotropyTexture:s}=e;i.addDefine("USE_ANISOTROPY",void 0,_o.Z.FRAGMENT),(0,_.Z)(s)&&!r&&gE(i,t,s,"u_anisotropyTexture","ANISOTROPY",n);let l=Math.cos(a),c=Math.sin(a);i.addUniform("vec3","u_anisotropy",_o.Z.FRAGMENT),t.u_anisotropy=function(){return S.Z.fromElements(l,c,o,gx)}}(n.anisotropy,o,a,l,s),(0,_.Z)(n.clearcoat)&&dq.supportedExtensions.KHR_materials_clearcoat&&function(e,t,i,n,r){let{clearcoatFactor:o,clearcoatTexture:a,clearcoatRoughnessFactor:s,clearcoatRoughnessTexture:l,clearcoatNormalTexture:c}=e;i.addDefine("USE_CLEARCOAT",void 0,_o.Z.FRAGMENT),(0,_.Z)(o)&&o!==gb.DEFAULT_CLEARCOAT_FACTOR&&(i.addUniform("float","u_clearcoatFactor",_o.Z.FRAGMENT),t.u_clearcoatFactor=function(){return e.clearcoatFactor},i.addDefine("HAS_CLEARCOAT_FACTOR",void 0,_o.Z.FRAGMENT)),(0,_.Z)(a)&&!r&&gE(i,t,a,"u_clearcoatTexture","CLEARCOAT",n),(0,_.Z)(s)&&o!==gb.DEFAULT_CLEARCOAT_ROUGHNESS_FACTOR&&(i.addUniform("float","u_clearcoatRoughnessFactor",_o.Z.FRAGMENT),t.u_clearcoatRoughnessFactor=function(){return e.clearcoatRoughnessFactor},i.addDefine("HAS_CLEARCOAT_ROUGHNESS_FACTOR",void 0,_o.Z.FRAGMENT)),(0,_.Z)(l)&&!r&&gE(i,t,l,"u_clearcoatRoughnessTexture","CLEARCOAT_ROUGHNESS",n),(0,_.Z)(c)&&!r&&gE(i,t,c,"u_clearcoatNormalTexture","CLEARCOAT_NORMAL",n)}(n.clearcoat,o,a,l,s),function(e,t,i,n,r){i.addDefine("USE_METALLIC_ROUGHNESS",void 0,_o.Z.FRAGMENT);let o=e.baseColorTexture;(0,_.Z)(o)&&!r&&gE(i,t,o,"u_baseColorTexture","BASE_COLOR",n);let a=e.baseColorFactor;(0,_.Z)(a)&&!eo.Z.equals(a,gg.DEFAULT_BASE_COLOR_FACTOR)&&(i.addUniform("vec4","u_baseColorFactor",_o.Z.FRAGMENT),t.u_baseColorFactor=function(){return e.baseColorFactor},i.addDefine("HAS_BASE_COLOR_FACTOR",void 0,_o.Z.FRAGMENT));let s=e.metallicRoughnessTexture;(0,_.Z)(s)&&!r&&gE(i,t,s,"u_metallicRoughnessTexture","METALLIC_ROUGHNESS",n);let l=e.metallicFactor;(0,_.Z)(l)&&l!==gg.DEFAULT_METALLIC_FACTOR&&(i.addUniform("float","u_metallicFactor",_o.Z.FRAGMENT),t.u_metallicFactor=function(){return e.metallicFactor},i.addDefine("HAS_METALLIC_FACTOR",void 0,_o.Z.FRAGMENT));let c=e.roughnessFactor;(0,_.Z)(c)&&c!==gg.DEFAULT_ROUGHNESS_FACTOR&&(i.addUniform("float","u_roughnessFactor",_o.Z.FRAGMENT),t.u_roughnessFactor=function(){return e.roughnessFactor},i.addDefine("HAS_ROUGHNESS_FACTOR",void 0,_o.Z.FRAGMENT))}(n.metallicRoughness,o,a,l,s));let h=dq.getAttributeBySemantic(t,dj.NORMAL),d=e.lightingOptions;n.unlit||!h||s?d.lightingModel=gp.UNLIT:d.lightingModel=gp.PBR;let f=r.backFaceCulling&&!n.doubleSided;e.renderStateOptions.cull.enabled=f;let p=e.alphaOptions;n.alphaMode===uY.BLEND?p.pass=ej.Z.TRANSLUCENT:n.alphaMode===uY.MASK&&(p.alphaCutoff=n.alphaCutoff),a.addFragmentLines("// If the style color is white, it implies the feature has not been styled.\nbool isDefaultStyleColor(vec3 color)\n{\n return all(greaterThan(color, vec3(1.0 - czm_epsilon3)));\n}\n\nvec3 blend(vec3 sourceColor, vec3 styleColor, float styleColorBlend)\n{\n vec3 blendColor = mix(sourceColor, styleColor, styleColorBlend);\n vec3 color = isDefaultStyleColor(styleColor.rgb) ? sourceColor : blendColor;\n return color;\n}\n\nvec2 computeTextureTransform(vec2 texCoord, mat3 textureTransform)\n{\n return vec2(textureTransform * vec3(texCoord, 1.0));\n}\n\n#ifdef HAS_NORMAL_TEXTURE\nvec2 getNormalTexCoords()\n{\n vec2 texCoord = TEXCOORD_NORMAL;\n #ifdef HAS_NORMAL_TEXTURE_TRANSFORM\n texCoord = vec2(u_normalTextureTransform * vec3(texCoord, 1.0));\n #endif\n return texCoord;\n}\n#endif\n\n#if defined(HAS_NORMAL_TEXTURE) || defined(HAS_CLEARCOAT_NORMAL_TEXTURE)\nvec3 computeTangent(in vec3 position, in vec2 normalTexCoords)\n{\n vec2 tex_dx = dFdx(normalTexCoords);\n vec2 tex_dy = dFdy(normalTexCoords);\n float determinant = tex_dx.x * tex_dy.y - tex_dy.x * tex_dx.y;\n vec3 tangent = tex_dy.t * dFdx(position) - tex_dx.t * dFdy(position);\n return tangent / determinant;\n}\n#endif\n\n#ifdef USE_ANISOTROPY\nstruct NormalInfo {\n vec3 tangent;\n vec3 bitangent;\n vec3 normal;\n vec3 geometryNormal;\n};\n\nNormalInfo getNormalInfo(ProcessedAttributes attributes)\n{\n vec3 geometryNormal = attributes.normalEC;\n #ifdef HAS_NORMAL_TEXTURE\n vec2 normalTexCoords = getNormalTexCoords();\n #endif\n\n #ifdef HAS_BITANGENTS\n vec3 tangent = attributes.tangentEC;\n vec3 bitangent = attributes.bitangentEC;\n #else // Assume HAS_NORMAL_TEXTURE\n vec3 tangent = computeTangent(attributes.positionEC, normalTexCoords);\n tangent = normalize(tangent - geometryNormal * dot(geometryNormal, tangent));\n vec3 bitangent = normalize(cross(geometryNormal, tangent));\n #endif\n\n #ifdef HAS_NORMAL_TEXTURE\n mat3 tbn = mat3(tangent, bitangent, geometryNormal);\n vec3 normalSample = texture(u_normalTexture, normalTexCoords).rgb;\n vec3 normal = normalize(tbn * (2.0 * normalSample - 1.0));\n #else\n vec3 normal = geometryNormal;\n #endif\n\n #ifdef HAS_DOUBLE_SIDED_MATERIAL\n if (czm_backFacing()) {\n tangent *= -1.0;\n bitangent *= -1.0;\n normal *= -1.0;\n geometryNormal *= -1.0;\n }\n #endif\n\n NormalInfo normalInfo;\n normalInfo.tangent = tangent;\n normalInfo.bitangent = bitangent;\n normalInfo.normal = normal;\n normalInfo.geometryNormal = geometryNormal;\n\n return normalInfo;\n}\n#endif\n\n#if defined(HAS_NORMAL_TEXTURE) && !defined(HAS_WIREFRAME)\nvec3 getNormalFromTexture(ProcessedAttributes attributes, vec3 geometryNormal)\n{\n vec2 normalTexCoords = getNormalTexCoords();\n\n // If HAS_BITANGENTS is set, then HAS_TANGENTS is also set\n #ifdef HAS_BITANGENTS\n vec3 t = attributes.tangentEC;\n vec3 b = attributes.bitangentEC;\n #else\n vec3 t = computeTangent(attributes.positionEC, normalTexCoords);\n t = normalize(t - geometryNormal * dot(geometryNormal, t));\n vec3 b = normalize(cross(geometryNormal, t));\n #endif\n\n mat3 tbn = mat3(t, b, geometryNormal);\n vec3 n = texture(u_normalTexture, normalTexCoords).rgb;\n vec3 textureNormal = normalize(tbn * (2.0 * n - 1.0));\n\n return textureNormal;\n}\n#endif\n\n#ifdef HAS_CLEARCOAT_NORMAL_TEXTURE\nvec3 getClearcoatNormalFromTexture(ProcessedAttributes attributes, vec3 geometryNormal)\n{\n vec2 normalTexCoords = TEXCOORD_CLEARCOAT_NORMAL;\n #ifdef HAS_CLEARCOAT_NORMAL_TEXTURE_TRANSFORM\n normalTexCoords = vec2(u_clearcoatNormalTextureTransform * vec3(normalTexCoords, 1.0));\n #endif\n\n // If HAS_BITANGENTS is set, then HAS_TANGENTS is also set\n #ifdef HAS_BITANGENTS\n vec3 t = attributes.tangentEC;\n vec3 b = attributes.bitangentEC;\n #else\n vec3 t = computeTangent(attributes.positionEC, normalTexCoords);\n t = normalize(t - geometryNormal * dot(geometryNormal, t));\n vec3 b = normalize(cross(geometryNormal, t));\n #endif\n\n mat3 tbn = mat3(t, b, geometryNormal);\n vec3 n = texture(u_clearcoatNormalTexture, normalTexCoords).rgb;\n vec3 textureNormal = normalize(tbn * (2.0 * n - 1.0));\n\n return textureNormal;\n}\n#endif\n\n#ifdef HAS_NORMALS\nvec3 computeNormal(ProcessedAttributes attributes)\n{\n // Geometry normal. This is already normalized \n vec3 normal = attributes.normalEC;\n\n #if defined(HAS_NORMAL_TEXTURE) && !defined(HAS_WIREFRAME)\n normal = getNormalFromTexture(attributes, normal);\n #endif\n\n #ifdef HAS_DOUBLE_SIDED_MATERIAL\n if (czm_backFacing()) {\n normal = -normal;\n }\n #endif\n\n return normal;\n}\n#endif\n\n#ifdef HAS_BASE_COLOR_TEXTURE\nvec4 getBaseColorFromTexture()\n{\n vec2 baseColorTexCoords = TEXCOORD_BASE_COLOR;\n #ifdef HAS_BASE_COLOR_TEXTURE_TRANSFORM\n baseColorTexCoords = computeTextureTransform(baseColorTexCoords, u_baseColorTextureTransform);\n #endif\n\n vec4 baseColorWithAlpha = czm_srgbToLinear(texture(u_baseColorTexture, baseColorTexCoords));\n\n #ifdef HAS_BASE_COLOR_FACTOR\n baseColorWithAlpha *= u_baseColorFactor;\n #endif\n\n return baseColorWithAlpha;\n}\n#endif\n\n#ifdef HAS_EMISSIVE_TEXTURE\nvec3 getEmissiveFromTexture()\n{\n vec2 emissiveTexCoords = TEXCOORD_EMISSIVE;\n #ifdef HAS_EMISSIVE_TEXTURE_TRANSFORM\n emissiveTexCoords = computeTextureTransform(emissiveTexCoords, u_emissiveTextureTransform);\n #endif\n\n vec3 emissive = czm_srgbToLinear(texture(u_emissiveTexture, emissiveTexCoords).rgb);\n #ifdef HAS_EMISSIVE_FACTOR\n emissive *= u_emissiveFactor;\n #endif\n\n return emissive;\n}\n#endif\n\n#if defined(LIGHTING_PBR) && defined(USE_SPECULAR_GLOSSINESS)\nvoid setSpecularGlossiness(inout czm_modelMaterial material)\n{\n #ifdef HAS_SPECULAR_GLOSSINESS_TEXTURE\n vec2 specularGlossinessTexCoords = TEXCOORD_SPECULAR_GLOSSINESS;\n #ifdef HAS_SPECULAR_GLOSSINESS_TEXTURE_TRANSFORM\n specularGlossinessTexCoords = computeTextureTransform(specularGlossinessTexCoords, u_specularGlossinessTextureTransform);\n #endif\n\n vec4 specularGlossiness = czm_srgbToLinear(texture(u_specularGlossinessTexture, specularGlossinessTexCoords));\n vec3 specular = specularGlossiness.rgb;\n float glossiness = specularGlossiness.a;\n #ifdef HAS_LEGACY_SPECULAR_FACTOR\n specular *= u_legacySpecularFactor;\n #endif\n\n #ifdef HAS_GLOSSINESS_FACTOR\n glossiness *= u_glossinessFactor;\n #endif\n #else\n #ifdef HAS_LEGACY_SPECULAR_FACTOR\n vec3 specular = clamp(u_legacySpecularFactor, vec3(0.0), vec3(1.0));\n #else\n vec3 specular = vec3(1.0);\n #endif\n\n #ifdef HAS_GLOSSINESS_FACTOR\n float glossiness = clamp(u_glossinessFactor, 0.0, 1.0);\n #else\n float glossiness = 1.0;\n #endif\n #endif\n\n #ifdef HAS_DIFFUSE_TEXTURE\n vec2 diffuseTexCoords = TEXCOORD_DIFFUSE;\n #ifdef HAS_DIFFUSE_TEXTURE_TRANSFORM\n diffuseTexCoords = computeTextureTransform(diffuseTexCoords, u_diffuseTextureTransform);\n #endif\n\n vec4 diffuse = czm_srgbToLinear(texture(u_diffuseTexture, diffuseTexCoords));\n #ifdef HAS_DIFFUSE_FACTOR\n diffuse *= u_diffuseFactor;\n #endif\n #elif defined(HAS_DIFFUSE_FACTOR)\n vec4 diffuse = clamp(u_diffuseFactor, vec4(0.0), vec4(1.0));\n #else\n vec4 diffuse = vec4(1.0);\n #endif\n\n material.diffuse = diffuse.rgb * (1.0 - czm_maximumComponent(specular));\n // the specular glossiness extension's alpha overrides anything set\n // by the base material.\n material.alpha = diffuse.a;\n\n material.specular = specular;\n\n // glossiness is the opposite of roughness, but easier for artists to use.\n float roughness = 1.0 - glossiness;\n material.roughness = roughness * roughness;\n}\n#elif defined(LIGHTING_PBR)\nfloat setMetallicRoughness(inout czm_modelMaterial material)\n{\n #ifdef HAS_METALLIC_ROUGHNESS_TEXTURE\n vec2 metallicRoughnessTexCoords = TEXCOORD_METALLIC_ROUGHNESS;\n #ifdef HAS_METALLIC_ROUGHNESS_TEXTURE_TRANSFORM\n metallicRoughnessTexCoords = computeTextureTransform(metallicRoughnessTexCoords, u_metallicRoughnessTextureTransform);\n #endif\n\n vec3 metallicRoughness = texture(u_metallicRoughnessTexture, metallicRoughnessTexCoords).rgb;\n float metalness = clamp(metallicRoughness.b, 0.0, 1.0);\n float roughness = clamp(metallicRoughness.g, 0.04, 1.0);\n #ifdef HAS_METALLIC_FACTOR\n metalness = clamp(metalness * u_metallicFactor, 0.0, 1.0);\n #endif\n\n #ifdef HAS_ROUGHNESS_FACTOR\n roughness = clamp(roughness * u_roughnessFactor, 0.0, 1.0);\n #endif\n #else\n #ifdef HAS_METALLIC_FACTOR\n float metalness = clamp(u_metallicFactor, 0.0, 1.0);\n #else\n float metalness = 1.0;\n #endif\n\n #ifdef HAS_ROUGHNESS_FACTOR\n float roughness = clamp(u_roughnessFactor, 0.04, 1.0);\n #else\n float roughness = 1.0;\n #endif\n #endif\n\n // dielectrics use f0 = 0.04, metals use albedo as f0\n const vec3 REFLECTANCE_DIELECTRIC = vec3(0.04);\n vec3 f0 = mix(REFLECTANCE_DIELECTRIC, material.diffuse, metalness);\n\n material.specular = f0;\n\n // diffuse only applies to dielectrics.\n material.diffuse = material.diffuse * (1.0 - f0) * (1.0 - metalness);\n\n // roughness is authored as perceptual roughness\n // square it to get material roughness\n material.roughness = roughness * roughness;\n\n return metalness;\n}\n#ifdef USE_SPECULAR\nvoid setSpecular(inout czm_modelMaterial material, in float metalness)\n{\n #ifdef HAS_SPECULAR_TEXTURE\n vec2 specularTexCoords = TEXCOORD_SPECULAR;\n #ifdef HAS_SPECULAR_TEXTURE_TRANSFORM\n specularTexCoords = computeTextureTransform(specularTexCoords, u_specularTextureTransform);\n #endif\n float specularWeight = texture(u_specularTexture, specularTexCoords).a;\n #ifdef HAS_SPECULAR_FACTOR\n specularWeight *= u_specularFactor;\n #endif\n #else\n #ifdef HAS_SPECULAR_FACTOR\n float specularWeight = u_specularFactor;\n #else\n float specularWeight = 1.0;\n #endif\n #endif\n\n #ifdef HAS_SPECULAR_COLOR_TEXTURE\n vec2 specularColorTexCoords = TEXCOORD_SPECULAR_COLOR;\n #ifdef HAS_SPECULAR_COLOR_TEXTURE_TRANSFORM\n specularColorTexCoords = computeTextureTransform(specularColorTexCoords, u_specularColorTextureTransform);\n #endif\n vec3 specularColorSample = texture(u_specularColorTexture, specularColorTexCoords).rgb;\n vec3 specularColorFactor = czm_srgbToLinear(specularColorSample);\n #ifdef HAS_SPECULAR_COLOR_FACTOR\n specularColorFactor *= u_specularColorFactor;\n #endif\n #else\n #ifdef HAS_SPECULAR_COLOR_FACTOR\n vec3 specularColorFactor = u_specularColorFactor;\n #else\n vec3 specularColorFactor = vec3(1.0);\n #endif\n #endif\n material.specularWeight = specularWeight;\n vec3 f0 = material.specular;\n vec3 dielectricSpecularF0 = min(f0 * specularColorFactor, vec3(1.0));\n material.specular = mix(dielectricSpecularF0, material.diffuse, metalness);\n}\n#endif\n#ifdef USE_ANISOTROPY\nvoid setAnisotropy(inout czm_modelMaterial material, in NormalInfo normalInfo)\n{\n mat2 rotation = mat2(u_anisotropy.xy, -u_anisotropy.y, u_anisotropy.x);\n float anisotropyStrength = u_anisotropy.z;\n\n vec2 direction = vec2(1.0, 0.0);\n #ifdef HAS_ANISOTROPY_TEXTURE\n vec2 anisotropyTexCoords = TEXCOORD_ANISOTROPY;\n #ifdef HAS_ANISOTROPY_TEXTURE_TRANSFORM\n anisotropyTexCoords = computeTextureTransform(anisotropyTexCoords, u_anisotropyTextureTransform);\n #endif\n vec3 anisotropySample = texture(u_anisotropyTexture, anisotropyTexCoords).rgb;\n direction = anisotropySample.rg * 2.0 - vec2(1.0);\n anisotropyStrength *= anisotropySample.b;\n #endif\n\n direction = rotation * direction;\n mat3 tbn = mat3(normalInfo.tangent, normalInfo.bitangent, normalInfo.normal);\n vec3 anisotropicT = tbn * normalize(vec3(direction, 0.0));\n vec3 anisotropicB = cross(normalInfo.geometryNormal, anisotropicT);\n\n material.anisotropicT = anisotropicT;\n material.anisotropicB = anisotropicB;\n material.anisotropyStrength = anisotropyStrength;\n}\n#endif\n#ifdef USE_CLEARCOAT\nvoid setClearcoat(inout czm_modelMaterial material, in ProcessedAttributes attributes)\n{\n #ifdef HAS_CLEARCOAT_TEXTURE\n vec2 clearcoatTexCoords = TEXCOORD_CLEARCOAT;\n #ifdef HAS_CLEARCOAT_TEXTURE_TRANSFORM\n clearcoatTexCoords = computeTextureTransform(clearcoatTexCoords, u_clearcoatTextureTransform);\n #endif\n float clearcoatFactor = texture(u_clearcoatTexture, clearcoatTexCoords).r;\n #ifdef HAS_CLEARCOAT_FACTOR\n clearcoatFactor *= u_clearcoatFactor;\n #endif\n #else\n #ifdef HAS_CLEARCOAT_FACTOR\n float clearcoatFactor = u_clearcoatFactor;\n #else\n // PERFORMANCE_IDEA: this case should turn the whole extension off\n float clearcoatFactor = 0.0;\n #endif\n #endif\n\n #ifdef HAS_CLEARCOAT_ROUGHNESS_TEXTURE\n vec2 clearcoatRoughnessTexCoords = TEXCOORD_CLEARCOAT_ROUGHNESS;\n #ifdef HAS_CLEARCOAT_ROUGHNESS_TEXTURE_TRANSFORM\n clearcoatRoughnessTexCoords = computeTextureTransform(clearcoatRoughnessTexCoords, u_clearcoatRoughnessTextureTransform);\n #endif\n float clearcoatRoughness = texture(u_clearcoatRoughnessTexture, clearcoatRoughnessTexCoords).g;\n #ifdef HAS_CLEARCOAT_ROUGHNESS_FACTOR\n clearcoatRoughness *= u_clearcoatRoughnessFactor;\n #endif\n #else\n #ifdef HAS_CLEARCOAT_ROUGHNESS_FACTOR\n float clearcoatRoughness = u_clearcoatRoughnessFactor;\n #else\n float clearcoatRoughness = 0.0;\n #endif\n #endif\n\n material.clearcoatFactor = clearcoatFactor;\n // roughness is authored as perceptual roughness\n // square it to get material roughness\n material.clearcoatRoughness = clearcoatRoughness * clearcoatRoughness;\n #ifdef HAS_CLEARCOAT_NORMAL_TEXTURE\n material.clearcoatNormal = getClearcoatNormalFromTexture(attributes, attributes.normalEC);\n #else\n material.clearcoatNormal = attributes.normalEC;\n #endif\n}\n#endif\n#endif\n\nvoid materialStage(inout czm_modelMaterial material, ProcessedAttributes attributes, SelectedFeature feature)\n{\n #ifdef USE_ANISOTROPY\n NormalInfo normalInfo = getNormalInfo(attributes);\n material.normalEC = normalInfo.normal;\n #elif defined(HAS_NORMALS)\n material.normalEC = computeNormal(attributes);\n #endif\n\n vec4 baseColorWithAlpha = vec4(1.0);\n // Regardless of whether we use PBR, set a base color\n #ifdef HAS_BASE_COLOR_TEXTURE\n baseColorWithAlpha = getBaseColorFromTexture();\n #elif defined(HAS_BASE_COLOR_FACTOR)\n baseColorWithAlpha = u_baseColorFactor;\n #endif\n\n #ifdef HAS_POINT_CLOUD_COLOR_STYLE\n baseColorWithAlpha = v_pointCloudColor;\n #elif defined(HAS_COLOR_0)\n vec4 color = attributes.color_0;\n // .pnts files store colors in the sRGB color space\n #ifdef HAS_SRGB_COLOR\n color = czm_srgbToLinear(color);\n #endif\n baseColorWithAlpha *= color;\n #endif\n\n material.diffuse = baseColorWithAlpha.rgb;\n material.alpha = baseColorWithAlpha.a;\n\n #ifdef USE_CPU_STYLING\n material.diffuse = blend(material.diffuse, feature.color.rgb, model_colorBlend);\n #endif\n\n #ifdef HAS_OCCLUSION_TEXTURE\n vec2 occlusionTexCoords = TEXCOORD_OCCLUSION;\n #ifdef HAS_OCCLUSION_TEXTURE_TRANSFORM\n occlusionTexCoords = computeTextureTransform(occlusionTexCoords, u_occlusionTextureTransform);\n #endif\n material.occlusion = texture(u_occlusionTexture, occlusionTexCoords).r;\n #endif\n\n #ifdef HAS_EMISSIVE_TEXTURE\n material.emissive = getEmissiveFromTexture();\n #elif defined(HAS_EMISSIVE_FACTOR)\n material.emissive = u_emissiveFactor;\n #endif\n\n #if defined(LIGHTING_PBR) && defined(USE_SPECULAR_GLOSSINESS)\n setSpecularGlossiness(material);\n #elif defined(LIGHTING_PBR)\n float metalness = setMetallicRoughness(material);\n #ifdef USE_SPECULAR\n setSpecular(material, metalness);\n #endif\n #ifdef USE_ANISOTROPY\n setAnisotropy(material, normalInfo);\n #endif\n #ifdef USE_CLEARCOAT\n setClearcoat(material, attributes);\n #endif\n #endif\n}\n"),n.doubleSided&&a.addDefine("HAS_DOUBLE_SIDED_MATERIAL",void 0,_o.Z.BOTH)};let gx=new S.Z,gw={name:"MorphTargetsPipelineStage",FUNCTION_ID_GET_MORPHED_POSITION:"getMorphedPosition",FUNCTION_SIGNATURE_GET_MORPHED_POSITION:"vec3 getMorphedPosition(in vec3 position)",FUNCTION_ID_GET_MORPHED_NORMAL:"getMorphedNormal",FUNCTION_SIGNATURE_GET_MORPHED_NORMAL:"vec3 getMorphedNormal(in vec3 normal)",FUNCTION_ID_GET_MORPHED_TANGENT:"getMorphedTangent",FUNCTION_SIGNATURE_GET_MORPHED_TANGENT:"vec3 getMorphedTangent(in vec3 tangent)"};gw.process=function(e,t){let i=e.shaderBuilder;i.addDefine("HAS_MORPH_TARGETS",void 0,_o.Z.VERTEX),i.addFunction(gw.FUNCTION_ID_GET_MORPHED_POSITION,gw.FUNCTION_SIGNATURE_GET_MORPHED_POSITION,_o.Z.VERTEX),i.addFunctionLines(gw.FUNCTION_ID_GET_MORPHED_POSITION,["vec3 morphedPosition = position;"]),i.addFunction(gw.FUNCTION_ID_GET_MORPHED_NORMAL,gw.FUNCTION_SIGNATURE_GET_MORPHED_NORMAL,_o.Z.VERTEX),i.addFunctionLines(gw.FUNCTION_ID_GET_MORPHED_NORMAL,["vec3 morphedNormal = normal;"]),i.addFunction(gw.FUNCTION_ID_GET_MORPHED_TANGENT,gw.FUNCTION_SIGNATURE_GET_MORPHED_TANGENT,_o.Z.VERTEX),i.addFunctionLines(gw.FUNCTION_ID_GET_MORPHED_TANGENT,["vec3 morphedTangent = tangent;"]);let n=t.morphTargets.length;for(let i=0;i<n;i++){let n=t.morphTargets[i].attributes,r=n.length;for(let t=0;t<r;t++){let r=n[t],o=r.semantic;(o===dj.POSITION||o===dj.NORMAL||o===dj.TANGENT)&&(function(e,t,i,n){let r=e.shaderBuilder;(function(e,t,i){let n={index:i,value:(0,_.Z)(t.buffer)?void 0:t.constant,vertexBuffer:t.buffer,componentsPerAttribute:dH.Z.getNumberOfComponents(t.type),componentDatatype:t.componentDatatype,offsetInBytes:t.byteOffset,strideInBytes:t.byteStride,normalize:t.normalized};e.attributes.push(n)})(e,t,i),function(e,t,i){let n=t.attributeString,r=`a_target${n}_${i}`,o=`morphed${n} += u_morphWeights[${i}] * a_target${n}_${i};`;e.addAttribute("vec3",r),e.addFunctionLines(t.functionId,[o])}(r,function(e,t){switch(e.semantic){case dj.POSITION:t.attributeString="Position",t.functionId=gw.FUNCTION_ID_GET_MORPHED_POSITION;break;case dj.NORMAL:t.attributeString="Normal",t.functionId=gw.FUNCTION_ID_GET_MORPHED_NORMAL;break;case dj.TANGENT:t.attributeString="Tangent",t.functionId=gw.FUNCTION_ID_GET_MORPHED_TANGENT}return t}(t,gS),n)}(e,r,e.attributeIndex,i),e.attributeIndex++)}}i.addFunctionLines(gw.FUNCTION_ID_GET_MORPHED_POSITION,["return morphedPosition;"]),i.addFunctionLines(gw.FUNCTION_ID_GET_MORPHED_NORMAL,["return morphedNormal;"]),i.addFunctionLines(gw.FUNCTION_ID_GET_MORPHED_TANGENT,["return morphedTangent;"]);let r=e.runtimeNode.morphWeights.length;i.addUniform("float",`u_morphWeights[${r}]`,_o.Z.VERTEX),i.addVertexLines("void morphTargetsStage(inout ProcessedAttributes attributes) \n{\n vec3 positionMC = attributes.positionMC;\n attributes.positionMC = getMorphedPosition(positionMC);\n\n #ifdef HAS_NORMALS\n vec3 normalMC = attributes.normalMC;\n attributes.normalMC = getMorphedNormal(normalMC);\n #endif\n\n #ifdef HAS_TANGENTS\n vec3 tangentMC = attributes.tangentMC;\n attributes.tangentMC = getMorphedTangent(tangentMC);\n #endif\n}"),e.uniformMap=(0,hv.Z)({u_morphWeights:function(){return e.runtimeNode.morphWeights}},e.uniformMap)};let gS={attributeString:void 0,functionId:void 0},gC={name:"PickingPipelineStage"};function gA(e,t){let i;let n=e.model;if((0,_.Z)(n.pickObject))return n.pickObject;let r={model:n,node:e.runtimeNode,primitive:e.runtimePrimitive};if(mY.is3DTiles(n.type)){let e=n.content;i={content:e,primitive:e.tileset,detail:r}}else i={primitive:n,detail:r};return i.id=n.id,(0,_.Z)(t)&&(i.instanceId=t),i}gC.process=function(e,t,i){let n=i.context,r=e.runtimeNode,o=e.shaderBuilder,a=e.model,s=r.node.instances;if(e.hasPropertyTable)!function(e,t,i){let n;let r=e.model,o=r.featureIdLabel,a=r.instanceFeatureIdLabel;n=(0,_.Z)(r.featureTableId)?r.featureTableId:(0,_.Z)(i)?dq.getFeatureIdsByLabel(i.featureIds,a).propertyTableId:dq.getFeatureIdsByLabel(t.featureIds,o).propertyTableId;let s=r.featureTables[n];e.shaderBuilder.addUniform("sampler2D","model_pickTexture",_o.Z.FRAGMENT);let l=s.batchTexture;e.uniformMap.model_pickTexture=function(){return(0,m.Z)(l.pickTexture,l.defaultTexture)},e.pickId="((selectedFeature.id < int(model_featuresLength)) ? texture(model_pickTexture, selectedFeature.st) : vec4(0.0))"}(e,t,s,n);else if((0,_.Z)(s))!function(e,t){let i=e.instanceCount,n=Array(i),r=new Uint8Array(4*i),o=e.model,a=o._pipelineResources;for(let o=0;o<i;o++){let i=gA(e,o),s=t.createPickId(i);a.push(s),n[o]=s;let l=s.color;r[4*o+0]=C.Z.floatToByte(l.red),r[4*o+1]=C.Z.floatToByte(l.green),r[4*o+2]=C.Z.floatToByte(l.blue),r[4*o+3]=C.Z.floatToByte(l.alpha)}o._pickIds=n;let s=ek.Z.createVertexBuffer({context:t,typedArray:r,usage:eV.Z.STATIC_DRAW});s.vertexArrayDestroyable=!1,o.statistics.addBuffer(s,!1),a.push(s);let l={index:e.attributeIndex++,vertexBuffer:s,componentsPerAttribute:4,componentDatatype:eM.Z.UNSIGNED_BYTE,normalize:!0,offsetInBytes:0,strideInBytes:0,instanceDivisor:1};e.attributes.push(l);let c=e.shaderBuilder;c.addDefine("USE_PICKING",void 0,_o.Z.BOTH),c.addAttribute("vec4","a_pickColor"),c.addVarying("vec4","v_pickColor"),e.pickId="v_pickColor"}(e,n);else{let t=gA(e),i=n.createPickId(t);a._pipelineResources.push(i),a._pickIds.push(i),o.addUniform("vec4","czm_pickColor",_o.Z.FRAGMENT),e.uniformMap.czm_pickColor=function(){return i.color},e.pickId="czm_pickColor"}};var gI=Object.freeze({ADD:0,REPLACE:1}),gO=i(3321);let gD=new eo.Z,gP={name:"PointCloudStylingPipelineStage"};gP.process=function(e,t,i){let n,r,o;let a=e.shaderBuilder,s=e.model,l=s.style,c=s.structuralMetadata,u=(0,_.Z)(c)?c.propertyAttributes:void 0,h=(0,_.Z)(s.featureTableId)&&s.featureTables[s.featureTableId].featuresLength>0,d=!(0,_.Z)(u)&&h;if((0,_.Z)(l)&&!d){let i=function(e,t){let i={translucent:!1};return gN.colorStyleFunction=e.getColorShaderFunction(`getColorFromStyle(${gM})`,t,i),gN.showStyleFunction=e.getShowShaderFunction(`getShowFromStyle(${gM})`,t,i),gN.pointSizeStyleFunction=e.getPointSizeShaderFunction(`getPointSizeFromStyle(${gM})`,t,i),gN.styleTranslucent=(0,_.Z)(gN.colorStyleFunction)&&i.translucent,gN}(l,function(e){let t=(0,uz.Z)(gL);if(!(0,_.Z)(e))return t;for(let i=0;i<e.length;i++){let n=e[i].properties;for(let e in n)n.hasOwnProperty(e)&&(t[e]=`metadata.${e}`)}return t}(u));!function(e,t){let i=t.colorStyleFunction;(0,_.Z)(i)&&(e.addDefine("HAS_POINT_CLOUD_COLOR_STYLE",void 0,_o.Z.BOTH),e.addVertexLines(i),e.addVarying("vec4","v_pointCloudColor"));let n=t.showStyleFunction;(0,_.Z)(n)&&(e.addDefine("HAS_POINT_CLOUD_SHOW_STYLE",void 0,_o.Z.VERTEX),e.addVertexLines(n));let r=t.pointSizeStyleFunction;(0,_.Z)(r)&&(e.addDefine("HAS_POINT_CLOUD_POINT_SIZE_STYLE",void 0,_o.Z.VERTEX),e.addVertexLines(r))}(a,i);let n=(function(e){let t=e.colorStyleFunction,i=e.showStyleFunction,n=e.pointSizeStyleFunction,r=[];return(0,_.Z)(t)&&gF(t,r),(0,_.Z)(i)&&gF(i,r),(0,_.Z)(n)&&gF(n,r),r})(i).indexOf("normalMC")>=0,r=dq.getAttributeBySemantic(t,dj.NORMAL);if(n&&!r)throw new e3.Z("Style references the NORMAL semantic but the point cloud does not have normals");a.addDefine("COMPUTE_POSITION_WC_STYLE",void 0,_o.Z.VERTEX),i.styleTranslucent&&(e.alphaOptions.pass=ej.Z.TRANSLUCENT)}let f=s.pointCloudShading;f.attenuation&&a.addDefine("HAS_POINT_CLOUD_ATTENUATION",void 0,_o.Z.VERTEX),f.backFaceCulling&&a.addDefine("HAS_POINT_CLOUD_BACK_FACE_CULLING",void 0,_o.Z.VERTEX),mY.is3DTiles(s.type)&&(r=!0,o=(n=s.content).tile.refine===gI.ADD),a.addUniform("vec4","model_pointCloudParameters",_o.Z.VERTEX),a.addVertexLines("float getPointSizeFromAttenuation(vec3 positionEC) {\n // Variables are packed into a single vector to minimize gl.uniformXXX() calls\n float pointSize = model_pointCloudParameters.x;\n float geometricError = model_pointCloudParameters.y;\n float depthMultiplier = model_pointCloudParameters.z;\n\n float depth = -positionEC.z;\n return min((geometricError / depth) * depthMultiplier, pointSize);\n}\n\n#ifdef HAS_POINT_CLOUD_SHOW_STYLE\nfloat pointCloudShowStylingStage(in ProcessedAttributes attributes, in Metadata metadata) {\n float tiles3d_tileset_time = model_pointCloudParameters.w;\n return float(getShowFromStyle(attributes, metadata, tiles3d_tileset_time));\n}\n#endif\n\n#ifdef HAS_POINT_CLOUD_COLOR_STYLE\nvec4 pointCloudColorStylingStage(in ProcessedAttributes attributes, in Metadata metadata) {\n float tiles3d_tileset_time = model_pointCloudParameters.w;\n return getColorFromStyle(attributes, metadata, tiles3d_tileset_time);\n}\n#endif\n\n#ifdef HAS_POINT_CLOUD_POINT_SIZE_STYLE\nfloat pointCloudPointSizeStylingStage(in ProcessedAttributes attributes, in Metadata metadata) {\n float tiles3d_tileset_time = model_pointCloudParameters.w;\n return float(getPointSizeFromStyle(attributes, metadata, tiles3d_tileset_time));\n}\n#elif defined(HAS_POINT_CLOUD_ATTENUATION)\nfloat pointCloudPointSizeStylingStage(in ProcessedAttributes attributes, in Metadata metadata) {\n return getPointSizeFromAttenuation(v_positionEC);\n}\n#endif\n\n#ifdef HAS_POINT_CLOUD_BACK_FACE_CULLING\nfloat pointCloudBackFaceCullingStage() {\n #if defined(HAS_NORMALS) && !defined(HAS_DOUBLE_SIDED_MATERIAL)\n // This needs to be computed in eye coordinates so we can't use attributes.normalMC\n return step(-v_normalEC.z, 0.0);\n #else\n return 1.0;\n #endif\n}\n#endif"),e.uniformMap.model_pointCloudParameters=function(){let a;let s=1;r&&(s=o?5:n.tileset.memoryAdjustedScreenSpaceError),gD.x=(0,m.Z)(f.maximumAttenuation,s),gD.x*=i.pixelRatio;let l=function(e,t,i,n){if((0,_.Z)(n)){let e=n.tile.geometricError;if(e>0)return e}if((0,_.Z)(i.baseResolution))return i.baseResolution;let r=dq.getAttributeBySemantic(t,dj.POSITION),o=r.count,a=e.runtimeNode.transform,s=S.Z.subtract(r.max,r.min,gR),l=(s=er.Z.multiplyByPointAsVector(a,s,gR)).x*s.y*s.z;return eB.Z.cbrt(l/o)}(e,t,f,n);gD.y=l*f.geometricErrorScale;let c=i.context,u=i.camera.frustum;return a=i.mode===eu.Z.SCENE2D||u instanceof gO.Z?Number.POSITIVE_INFINITY:c.drawingBufferHeight/i.camera.frustum.sseDenominator,gD.z=a,r&&(gD.w=n.tileset.timeSinceLoad),gD}};let gR=new S.Z,gN={colorStyleFunction:void 0,showStyleFunction:void 0,pointSizeStyleFunction:void 0,styleTranslucent:!1},gL={POSITION:"attributes.positionMC",POSITION_ABSOLUTE:"v_positionWC",COLOR:"attributes.color_0",NORMAL:"attributes.normalMC"},gM="ProcessedAttributes attributes, Metadata metadata, float tiles3d_tileset_time";function gF(e,t){let i=/attributes\.(\w+)/g,n=i.exec(e);for(;null!==n;){let r=n[1];-1===t.indexOf(r)&&t.push(r),n=i.exec(e)}}let gz={name:"PrimitiveOutlinePipelineStage"};gz.process=function(e,t,i){let n=e.shaderBuilder,r=e.uniformMap;n.addDefine("HAS_PRIMITIVE_OUTLINE",void 0,_o.Z.BOTH),n.addAttribute("vec3","a_outlineCoordinates"),n.addVarying("vec3","v_outlineCoordinates");let o=t.outlineCoordinates,a={index:e.attributeIndex++,vertexBuffer:o.buffer,componentsPerAttribute:dH.Z.getNumberOfComponents(o.type),componentDatatype:o.componentDatatype,offsetInBytes:o.byteOffset,strideInBytes:o.byteStride,normalize:o.normalized};e.attributes.push(a),n.addUniform("sampler2D","model_outlineTexture",_o.Z.FRAGMENT);let s=fD.createTexture(i.context);r.model_outlineTexture=function(){return s};let l=e.model;n.addUniform("vec4","model_outlineColor",_o.Z.FRAGMENT),r.model_outlineColor=function(){return l.outlineColor},n.addUniform("bool","model_showOutline",_o.Z.FRAGMENT),r.model_showOutline=function(){return l.showOutline},n.addVertexLines("void primitiveOutlineStage() {\n v_outlineCoordinates = a_outlineCoordinates;\n}\n"),n.addFragmentLines("void primitiveOutlineStage(inout czm_modelMaterial material) {\n if (!model_showOutline) {\n return;\n }\n\n float outlineX = \n texture(model_outlineTexture, vec2(v_outlineCoordinates.x, 0.5)).r;\n float outlineY = \n texture(model_outlineTexture, vec2(v_outlineCoordinates.y, 0.5)).r;\n float outlineZ = \n texture(model_outlineTexture, vec2(v_outlineCoordinates.z, 0.5)).r;\n float outlineness = max(outlineX, max(outlineY, outlineZ));\n\n material.diffuse = mix(material.diffuse, model_outlineColor.rgb, model_outlineColor.a * outlineness);\n}\n\n")};let gB={name:"PrimitiveStatisticsPipelineStage",_countGeometry:gU,_count2DPositions:gk,_countMorphTargetAttributes:gV,_countMaterialTextures:gH,_countFeatureIdTextures:gG,_countBinaryMetadata:gj};function gU(e,t){let i=(0,_.Z)(t.indices)?t.indices.count:dq.getAttributeBySemantic(t,"POSITION").count,n=t.primitiveType;n===iT.Z.POINTS?e.pointsLength+=i:iT.Z.isTriangles(n)&&(e.trianglesLength+=function(e,t){switch(e){case iT.Z.TRIANGLES:return t/3;case iT.Z.TRIANGLE_STRIP:case iT.Z.TRIANGLE_FAN:return Math.max(t-2,0);default:return 0}}(n,i));let r=t.attributes,o=r.length;for(let t=0;t<o;t++){let i=r[t];if((0,_.Z)(i.buffer)){let t=(0,_.Z)(i.typedArray);e.addBuffer(i.buffer,t)}}let a=t.outlineCoordinates;(0,_.Z)(a)&&(0,_.Z)(a.buffer)&&e.addBuffer(a.buffer,!1);let s=t.indices;if((0,_.Z)(s)&&(0,_.Z)(s.buffer)){let t=(0,_.Z)(s.typedArray);e.addBuffer(s.buffer,t)}}function gk(e,t){let i=t.positionBuffer2D;(0,_.Z)(i)&&e.addBuffer(i,!0)}function gV(e,t){let i=t.morphTargets;if(!(0,_.Z)(i))return;let n=i.length;for(let t=0;t<n;t++){let n=i[t].attributes,r=n.length;for(let t=0;t<r;t++){let i=n[t];(0,_.Z)(i.buffer)&&e.addBuffer(i.buffer,!1)}}}function gH(e,t){let i=function(e){let t=e.metallicRoughness,i=[e.emissiveTexture,e.normalTexture,e.occlusionTexture,t.baseColorTexture,t.metallicRoughnessTexture],n=e.specularGlossiness;return(0,_.Z)(n)&&(i.push(n.diffuseTexture),i.push(n.specularGlossinessTexture)),i}(t),n=i.length;for(let t=0;t<n;t++){let n=i[t];(0,_.Z)(n)&&(0,_.Z)(n.texture)&&e.addTexture(n.texture)}}function gG(e,t){let i=t.length;for(let n=0;n<i;n++){let i=t[n];if(i instanceof uX.FeatureIdTexture){let t=i.textureReader;(0,_.Z)(t.texture)&&e.addTexture(t.texture)}}}function gj(e,t){let i=t.structuralMetadata;(0,_.Z)(i)&&(function(e,t){let i=t.propertyTextures;if(!(0,_.Z)(i))return;let n=i.length;for(let t=0;t<n;t++){let n=i[t].properties;for(let t in n)if(n.hasOwnProperty(t)){let i=n[t].textureReader;(0,_.Z)(i.texture)&&e.addTexture(i.texture)}}}(e,i),e.propertyTablesByteLength+=i.propertyTablesByteLength);let n=t.featureTables;if(!(0,_.Z)(n))return;let r=n.length;for(let t=0;t<r;t++){let i=n[t];e.addBatchTexture(i.batchTexture)}}gB.process=function(e,t,i){let n=e.model,r=n.statistics;gU(r,t),gk(r,e.runtimePrimitive),gV(r,t),gH(r,t.material),gG(r,t.featureIds),gj(r,n)};let gW=new er.Z,gq=new er.Z,gY={name:"SceneMode2DPipelineStage"};gY.process=function(e,t,i){let n=dq.getAttributeBySemantic(t,dj.POSITION),r=e.shaderBuilder,o=e.model,a=o.sceneGraph.computedModelMatrix,s=e.runtimeNode.computedTransform,l=er.Z.multiplyTransformation(a,s,gW),c=function(e,t,i){let n=er.Z.multiplyByPoint(t,e.positionMin,gX),r=eh.Z.computeActualWgs84Position(i,n,n),o=er.Z.multiplyByPoint(t,e.positionMax,g$),a=eh.Z.computeActualWgs84Position(i,o,o);return f.Z.fromCornerPoints(r,a,new f.Z)}(e,l,i),u=e.runtimePrimitive;u.boundingSphere2D=c;let h=e.runtimeNode.node.instances;if((0,_.Z)(h))return;if((0,_.Z)(n.typedArray)){let e=function(e,t,i,n){let r=(0,uz.Z)(n);r.mode=eu.Z.COLUMBUS_VIEW;let o=function(e,t,i,n){let r;r=(0,_.Z)(e.quantization)?function(e,t){let i=e.length,n=new Float32Array(i),r=t.quantizedVolumeOffset,o=t.quantizedVolumeStepSize;for(let t=0;t<i;t+=3){let i=S.Z.fromArray(e,t,gK),a=S.Z.multiplyComponents(i,o,i),s=S.Z.add(a,r,a);n[t]=s.x,n[t+1]=s.y,n[t+2]=s.z}return n}(e.typedArray,e.quantization):e.typedArray.slice();let o=e.byteOffset/Float32Array.BYTES_PER_ELEMENT,a=r.length,s=(0,_.Z)(e.byteStride)?e.byteStride/Float32Array.BYTES_PER_ELEMENT:3;for(let e=o;e<a;e+=s){let o=S.Z.fromArray(r,e,gK);if(isNaN(o.x)||isNaN(o.y)||isNaN(o.z))continue;let a=er.Z.multiplyByPoint(t,o,o),s=eh.Z.computeActualWgs84Position(n,a,a),l=S.Z.subtract(s,i,s);r[e]=l.x,r[e+1]=l.y,r[e+2]=l.z}return r}(e,t,i.center,r),a=ek.Z.createVertexBuffer({context:n.context,typedArray:o,usage:eV.Z.STATIC_DRAW});return a.vertexArrayDestroyable=!1,a}(n,l,c,i);u.positionBuffer2D=e,o._modelResources.push(e),n.typedArray=void 0}r.addDefine("USE_2D_POSITIONS",void 0,_o.Z.VERTEX),r.addUniform("mat4","u_modelView2D",_o.Z.VERTEX);let d=er.Z.fromTranslation(c.center,new er.Z),p=i.context;e.uniformMap=(0,hv.Z)({u_modelView2D:function(){return er.Z.multiplyTransformation(p.uniformState.view,d,gq)}},e.uniformMap)};let gX=new S.Z,g$=new S.Z,gK=new S.Z,gQ={name:"SkinningPipelineStage",FUNCTION_ID_GET_SKINNING_MATRIX:"getSkinningMatrix",FUNCTION_SIGNATURE_GET_SKINNING_MATRIX:"mat4 getSkinningMatrix()"};gQ.process=function(e,t){let i=e.shaderBuilder;i.addDefine("HAS_SKINNING",void 0,_o.Z.VERTEX),function(e,t){let i,n;e.addFunction(gQ.FUNCTION_ID_GET_SKINNING_MATRIX,gQ.FUNCTION_SIGNATURE_GET_SKINNING_MATRIX,_o.Z.VERTEX),e.addFunctionLines(gQ.FUNCTION_ID_GET_SKINNING_MATRIX,["mat4 skinnedMatrix = mat4(0);"]);let r=["x","y","z","w"],o=function(e){let t=-1,i=e.attributes,n=i.length;for(let e=0;e<n;e++){let n=i[e];(n.semantic===dj.JOINTS||n.semantic===dj.WEIGHTS)&&(t=Math.max(t,n.setIndex))}return t}(t);for(i=0;i<=o;i++)for(n=0;n<=3;n++){let t=r[n],o=`skinnedMatrix += a_weights_${i}.${t} * u_jointMatrices[int(a_joints_${i}.${t})];`;e.addFunctionLines(gQ.FUNCTION_ID_GET_SKINNING_MATRIX,[o])}e.addFunctionLines(gQ.FUNCTION_ID_GET_SKINNING_MATRIX,["return skinnedMatrix;"])}(i,t);let n=e.runtimeNode,r=n.computedJointMatrices;i.addUniform("mat4",`u_jointMatrices[${r.length}]`,_o.Z.VERTEX),i.addVertexLines("void skinningStage(inout ProcessedAttributes attributes) \n{\n mat4 skinningMatrix = getSkinningMatrix();\n mat3 skinningMatrixMat3 = mat3(skinningMatrix);\n\n vec4 positionMC = vec4(attributes.positionMC, 1.0);\n attributes.positionMC = vec3(skinningMatrix * positionMC);\n\n #ifdef HAS_NORMALS\n vec3 normalMC = attributes.normalMC;\n attributes.normalMC = skinningMatrixMat3 * normalMC;\n #endif\n\n #ifdef HAS_TANGENTS\n vec3 tangentMC = attributes.tangentMC;\n attributes.tangentMC = skinningMatrixMat3 * tangentMC;\n #endif\n}"),e.uniformMap=(0,hv.Z)({u_jointMatrices:function(){return n.computedJointMatrices}},e.uniformMap)};let gJ={name:"VerticalExaggerationPipelineStage"},g0=new w.Z;gJ.process=function(e,t,i){let{shaderBuilder:n,uniformMap:r}=e;n.addVertexLines("void verticalExaggerationStage(\n inout ProcessedAttributes attributes\n) {\n // Compute the distance from the camera to the local center of curvature.\n vec4 vertexPositionENU = czm_modelToEnu * vec4(attributes.positionMC, 1.0);\n vec2 vertexAzimuth = normalize(vertexPositionENU.xy);\n // Curvature = 1 / radius of curvature.\n float azimuthalCurvature = dot(vertexAzimuth * vertexAzimuth, czm_eyeEllipsoidCurvature);\n float eyeToCenter = 1.0 / azimuthalCurvature + czm_eyeHeight;\n\n // Compute the approximate ellipsoid normal at the vertex position.\n // Uses a circular approximation for the Earth curvature along the geodesic.\n vec3 vertexPositionEC = (czm_modelView * vec4(attributes.positionMC, 1.0)).xyz;\n vec3 centerToVertex = eyeToCenter * czm_eyeEllipsoidNormalEC + vertexPositionEC;\n vec3 vertexNormal = normalize(centerToVertex);\n\n // Estimate the (sine of the) angle between the camera direction and the vertex normal\n float verticalDistance = dot(vertexPositionEC, czm_eyeEllipsoidNormalEC);\n float horizontalDistance = length(vertexPositionEC - verticalDistance * czm_eyeEllipsoidNormalEC);\n float sinTheta = horizontalDistance / (eyeToCenter + verticalDistance);\n bool isSmallAngle = clamp(sinTheta, 0.0, 0.05) == sinTheta;\n\n // Approximate the change in height above the ellipsoid, from camera to vertex position.\n float exactVersine = 1.0 - dot(czm_eyeEllipsoidNormalEC, vertexNormal);\n float smallAngleVersine = 0.5 * sinTheta * sinTheta;\n float versine = isSmallAngle ? smallAngleVersine : exactVersine;\n float dHeight = dot(vertexPositionEC, vertexNormal) - eyeToCenter * versine;\n float vertexHeight = czm_eyeHeight + dHeight;\n\n // Transform the approximate vertex normal to model coordinates.\n vec3 vertexNormalMC = (czm_inverseModelView * vec4(vertexNormal, 0.0)).xyz;\n vertexNormalMC = normalize(vertexNormalMC);\n\n // Compute the exaggeration and apply it along the approximate vertex normal.\n float stretch = u_verticalExaggerationAndRelativeHeight.x;\n float shift = u_verticalExaggerationAndRelativeHeight.y;\n float exaggeration = (vertexHeight - shift) * (stretch - 1.0);\n attributes.positionMC += exaggeration * vertexNormalMC;\n}\n"),n.addDefine("HAS_VERTICAL_EXAGGERATION",void 0,_o.Z.VERTEX),n.addUniform("vec2","u_verticalExaggerationAndRelativeHeight",_o.Z.VERTEX),r.u_verticalExaggerationAndRelativeHeight=function(){return w.Z.fromElements(i.verticalExaggeration,i.verticalExaggerationRelativeHeight,g0)}};let g1={};g1.createWireframeIndices=function(e,t,i){let n=(0,_.Z)(i);return e===iT.Z.TRIANGLES?n?function(e,t){let i=t.length,n=ez.Z.createTypedArray(e,2*i),r=0;for(let e=0;e<i;e+=3){let i=t[e],o=t[e+1],a=t[e+2];n[r++]=i,n[r++]=o,n[r++]=o,n[r++]=a,n[r++]=a,n[r++]=i}return n}(t,i):function(e){let t=ez.Z.createTypedArray(e,2*e),i=0;for(let n=0;n<e;n+=3)t[i++]=n,t[i++]=n+1,t[i++]=n+1,t[i++]=n+2,t[i++]=n+2,t[i++]=n;return t}(t):e===iT.Z.TRIANGLE_STRIP?n?function(e,t){let i=t.length-2,n=ez.Z.createTypedArray(e,2+4*i),r=0;n[r++]=t[0],n[r++]=t[1];for(let e=0;e<i;e++){let i=t[e],o=t[e+1],a=t[e+2];n[r++]=o,n[r++]=a,n[r++]=a,n[r++]=i}return n}(t,i):function(e){let t=e-2,i=ez.Z.createTypedArray(e,2+4*t),n=0;i[n++]=0,i[n++]=1;for(let e=0;e<t;e++)i[n++]=e+1,i[n++]=e+2,i[n++]=e+2,i[n++]=e;return i}(t):e===iT.Z.TRIANGLE_FAN?n?function(e,t){let i=t.length-2,n=ez.Z.createTypedArray(e,2+4*i),r=0,o=t[0];n[r++]=o,n[r++]=t[1];for(let e=0;e<i;e++){let i=t[e+1],a=t[e+2];n[r++]=i,n[r++]=a,n[r++]=a,n[r++]=o}return n}(t,i):function(e){let t=e-2,i=ez.Z.createTypedArray(e,2+4*t),n=0;i[n++]=0,i[n++]=1;for(let e=0;e<t;e++)i[n++]=e+1,i[n++]=e+2,i[n++]=e+2,i[n++]=0;return i}(t):void 0},g1.getWireframeIndicesCount=function(e,t){return e===iT.Z.TRIANGLES?2*t:e===iT.Z.TRIANGLE_STRIP||e===iT.Z.TRIANGLE_FAN?2+4*(t-2):t};let g2={name:"WireframePipelineStage"};function g3(e){let t=(e=(0,m.Z)(e,m.Z.EMPTY_OBJECT)).primitive,i=e.node,n=e.model;p.Z.typeOf.object("options.primitive",t),p.Z.typeOf.object("options.node",i),p.Z.typeOf.object("options.model",n),this.primitive=t,this.node=i,this.model=n,this.pipelineStages=[],this.drawCommand=void 0,this.boundingSphere=void 0,this.boundingSphere2D=void 0,this.positionBuffer2D=void 0,this.batchLengths=void 0,this.batchOffsets=void 0,this.updateStages=[]}function g4(e){e=(0,m.Z)(e,m.Z.EMPTY_OBJECT),p.Z.typeOf.object("options.skin",e.skin),p.Z.typeOf.object("options.sceneGraph",e.sceneGraph),this._sceneGraph=e.sceneGraph;let t=e.skin;this._skin=t,this._inverseBindMatrices=void 0,this._joints=[],this._jointMatrices=[],function(e){let t=e.skin,i=t.inverseBindMatrices;e._inverseBindMatrices=i;let n=t.joints,r=n.length,o=e.sceneGraph._runtimeNodes,a=e.joints,s=e._jointMatrices;for(let e=0;e<r;e++){let t=o[n[e].index];a.push(t);let r=g5(t,i[e],new er.Z);s.push(r)}}(this)}function g5(e,t,i){let n=er.Z.multiplyTransformation(e.transformToRoot,e.transform,i);return i=er.Z.multiplyTransformation(n,t,i)}g2.process=function(e,t,i){e.shaderBuilder.addDefine("HAS_WIREFRAME",void 0,_o.Z.FRAGMENT);let n=e.model,r=function(e,t,i){let n;let r=dq.getAttributeBySemantic(e,dj.POSITION).count,o=i.context.webgl2;if((0,_.Z)(t)){let e=t.buffer,i=t.count;(0,_.Z)(e)&&o?(n=e.sizeInBytes===i?new Uint8Array(i):ez.Z.createTypedArray(r,i),e.getBufferData(n)):n=t.typedArray}let a=e.primitiveType,s=g1.createWireframeIndices(a,r,n),l=ez.Z.fromSizeInBytes(s.BYTES_PER_ELEMENT);return ek.Z.createIndexBuffer({context:i.context,typedArray:s,usage:eV.Z.STATIC_DRAW,indexDatatype:l})}(t,e.indices,i);n._pipelineResources.push(r),e.wireframeIndexBuffer=r,n.statistics.addBuffer(r,!1);let o=e.primitiveType,a=e.count;e.primitiveType=iT.Z.LINES,e.count=g1.getWireframeIndicesCount(o,a)},g3.prototype.configurePipeline=function(e){let t;let i=this.pipelineStages;i.length=0;let n=this.primitive,r=this.node,o=this.model,a=o.customShader,s=o.style,l=e.context.webgl2,c=e.mode!==eu.Z.SCENE3D&&!e.scene3DOnly&&o._projectTo2D,u=1!==e.verticalExaggeration,h=(0,_.Z)(n.morphTargets)&&n.morphTargets.length>0,d=(0,_.Z)(r.skin),f=(0,_.Z)(a),p=!(f&&(0,_.Z)(a.fragmentShaderText))||a.mode!==_0.Z.REPLACE_MATERIAL,m=dq.hasQuantizedAttributes(n.attributes),g=o.debugWireframe&&iT.Z.isTriangles(n.primitiveType)&&(o._enableDebugWireframe||l),Z=o.pointCloudShading,y=(0,_.Z)(Z)&&Z.attenuation,b=(0,_.Z)(Z)&&Z.backFaceCulling,v=n.primitiveType===iT.Z.POINTS&&((0,_.Z)(s)||y||b),T=o._enableShowOutline&&(0,_.Z)(n.outlineCoordinates),E=(0,_.Z)(r.instances)&&(t=dq.getFeatureIdsByLabel(r.instances.featureIds,o.instanceFeatureIdLabel),(0,_.Z)(t))?{hasFeatureIds:!0,hasPropertyTable:(0,_.Z)(t.propertyTableId)}:(t=dq.getFeatureIdsByLabel(n.featureIds,o.featureIdLabel),(0,_.Z)(t))?{hasFeatureIds:!0,hasPropertyTable:(0,_.Z)(t.propertyTableId)}:{hasFeatureIds:!1,hasPropertyTable:!1},x=(0,_.Z)(o.classificationType);c&&i.push(gY),i.push(gf),g&&i.push(g2),x&&i.push(_Q),h&&i.push(gw),d&&i.push(gQ),v&&i.push(gP),m&&i.push(gc),p&&i.push(gv),i.push(_1),i.push(_4),E.hasPropertyTable&&(i.push(gd),i.push(_K),i.push(_J)),u&&i.push(gJ),f&&i.push(gt),i.push(gm),o.allowPicking&&i.push(gC),T&&i.push(gz),i.push(_$),i.push(gB)},Object.defineProperties(g4.prototype,{skin:{get:function(){return this._skin}},sceneGraph:{get:function(){return this._sceneGraph}},inverseBindMatrices:{get:function(){return this._inverseBindMatrices}},joints:{get:function(){return this._joints}},jointMatrices:{get:function(){return this._jointMatrices}}}),g4.prototype.updateJointMatrices=function(){let e=this._jointMatrices,t=e.length;for(let i=0;i<t;i++){let t=this.joints[i],n=this.inverseBindMatrices[i];e[i]=g5(t,n,e[i])}};var g9=function(){this.pass=void 0,this.alphaCutoff=void 0},g8=i(5767),g6=function(e){p.Z.typeOf.object("model",e),this.shaderBuilder=new g8.Z,this.model=e,this.uniformMap={},this.alphaOptions=new g9,this.renderStateOptions=eW.Z.getState(eW.Z.fromCache({depthTest:{enabled:!0,func:mK.Z.LESS_OR_EQUAL}})),this.hasSilhouette=!1,this.hasSkipLevelOfDetail=!1};let g7={name:"ModelSilhouettePipelineStage"};g7.silhouettesLength=0,g7.process=function(e,t,i){(0,_.Z)(t._silhouetteId)||(t._silhouetteId=++g7.silhouettesLength);let n=e.shaderBuilder;n.addDefine("HAS_SILHOUETTE",void 0,_o.Z.BOTH),n.addVertexLines("void silhouetteStage(in ProcessedAttributes attributes, inout vec4 positionClip) {\n #ifdef HAS_NORMALS\n if(model_silhouettePass) {\n vec3 normal = normalize(czm_normal3D * attributes.normalMC);\n normal.x *= czm_projection[0][0];\n normal.y *= czm_projection[1][1];\n positionClip.xy += normal.xy * positionClip.w * model_silhouetteSize * czm_pixelRatio / czm_viewport.z;\n }\n #endif\n}\n"),n.addFragmentLines("void silhouetteStage(inout vec4 color) {\n if(model_silhouettePass) {\n color = czm_gammaCorrect(model_silhouetteColor);\n }\n}"),n.addUniform("vec4","model_silhouetteColor",_o.Z.FRAGMENT),n.addUniform("float","model_silhouetteSize",_o.Z.VERTEX),n.addUniform("bool","model_silhouettePass",_o.Z.BOTH),e.uniformMap=(0,hv.Z)({model_silhouetteColor:function(){return t.silhouetteColor},model_silhouetteSize:function(){return t.silhouetteSize},model_silhouettePass:function(){return!1}},e.uniformMap),e.hasSilhouette=!0};let Ze={name:"ModelSplitterPipelineStage",SPLIT_DIRECTION_UNIFORM_NAME:"model_splitDirection"};Ze.process=function(e,t,i){let n=e.shaderBuilder;n.addDefine("HAS_MODEL_SPLITTER",void 0,_o.Z.FRAGMENT),n.addFragmentLines("void modelSplitterStage()\n{\n // Don't split when rendering the shadow map, because it is rendered from\n // the perspective of a totally different camera.\n#ifndef SHADOW_MAP\n if (model_splitDirection < 0.0 && gl_FragCoord.x > czm_splitPosition) discard;\n if (model_splitDirection > 0.0 && gl_FragCoord.x < czm_splitPosition) discard;\n#endif\n}\n");let r={};n.addUniform("float",Ze.SPLIT_DIRECTION_UNIFORM_NAME,_o.Z.FRAGMENT),r[Ze.SPLIT_DIRECTION_UNIFORM_NAME]=function(){return t.splitDirection},e.uniformMap=(0,hv.Z)(r,e.uniformMap)};var Zt=function(e,t){p.Z.typeOf.object("modelRenderResources",e),p.Z.typeOf.object("runtimeNode",t),this.model=e.model,this.shaderBuilder=e.shaderBuilder.clone(),this.uniformMap=(0,uz.Z)(e.uniformMap),this.alphaOptions=(0,uz.Z)(e.alphaOptions),this.renderStateOptions=(0,uz.Z)(e.renderStateOptions,!0),this.hasSilhouette=e.hasSilhouette,this.hasSkipLevelOfDetail=e.hasSkipLevelOfDetail,this.runtimeNode=t,this.attributes=[],this.attributeIndex=1,this.featureIdVertexAttributeSetIndex=0,this.instanceCount=0},Zi=function(e){e=(0,m.Z)(e,m.Z.EMPTY_OBJECT),this.lightingModel=(0,m.Z)(e.lightingModel,gp.UNLIT)},Zn=function(e,t){p.Z.typeOf.object("nodeRenderResources",e),p.Z.typeOf.object("runtimePrimitive",t),this.model=e.model,this.runtimeNode=e.runtimeNode,this.attributes=e.attributes.slice(),this.attributeIndex=e.attributeIndex,this.featureIdVertexAttributeSetIndex=e.featureIdVertexAttributeSetIndex,this.uniformMap=(0,uz.Z)(e.uniformMap),this.alphaOptions=(0,uz.Z)(e.alphaOptions),this.renderStateOptions=(0,uz.Z)(e.renderStateOptions,!0),this.hasSilhouette=e.hasSilhouette,this.hasSkipLevelOfDetail=e.hasSkipLevelOfDetail,this.shaderBuilder=e.shaderBuilder.clone(),this.instanceCount=e.instanceCount,this.runtimePrimitive=t;let i=t.primitive;this.count=(0,_.Z)(i.indices)?i.indices.count:dq.getAttributeBySemantic(i,"POSITION").count,this.hasPropertyTable=!1,this.indices=i.indices,this.wireframeIndexBuffer=void 0,this.primitiveType=i.primitiveType;let n=dq.getPositionMinMax(i,this.runtimeNode.instancingTranslationMin,this.runtimeNode.instancingTranslationMax);this.positionMin=S.Z.clone(n.min,new S.Z),this.positionMax=S.Z.clone(n.max,new S.Z),this.boundingSphere=f.Z.fromCornerPoints(this.positionMin,this.positionMax,new f.Z),this.lightingOptions=new Zi,this.pickId=void 0};function Zr(e){let t=(e=(0,m.Z)(e,m.Z.EMPTY_OBJECT)).modelComponents;p.Z.typeOf.object("options.model",e.model),p.Z.typeOf.object("options.modelComponents",t),this._model=e.model,this._components=t,this._pipelineStages=[],this._updateStages=[],this._runtimeNodes=[],this._rootNodes=[],this._skinnedNodes=[],this._runtimeSkins=[],this.modelPipelineStages=[],this._boundingSphere=void 0,this._boundingSphere2D=void 0,this._computedModelMatrix=er.Z.clone(er.Z.IDENTITY),this._computedModelMatrix2D=er.Z.clone(er.Z.IDENTITY),this._axisCorrectionMatrix=dq.getAxisCorrectionMatrix(t.upAxis,t.forwardAxis,new er.Z),this._runtimeArticulations={},function(e){let t=e._components,i=t.scene,n=e._model.modelMatrix;Zo(e,n);let r=t.articulations,o=r.length,a=e._runtimeArticulations;for(let t=0;t<o;t++){let i=new _f({articulation:r[t],sceneGraph:e});a[i.name]=i}let s=t.nodes,l=s.length;e._runtimeNodes=Array(l);let c=i.nodes.length,u=er.Z.IDENTITY;for(let t=0;t<c;t++){let n=function e(t,i,n){let r=[],o=dq.getNodeTransform(i),a=i.children.length;for(let s=0;s<a;s++){let a=e(t,i.children[s],er.Z.multiplyTransformation(n,o,new er.Z));r.push(a)}let s=new _Y({node:i,transform:o,transformToRoot:n,children:r,sceneGraph:t}),l=i.primitives.length;for(let e=0;e<l;e++)s.runtimePrimitives.push(new g3({primitive:i.primitives[e],node:i,model:t._model}));let c=i.index;t._runtimeNodes[c]=s,(0,_.Z)(i.skin)&&t._skinnedNodes.push(c);let u=i.name;if((0,_.Z)(u)){let e=t._model,i=new _b(e,s);e._nodesByName[u]=i}return c}(e,i.nodes[t],u);e._rootNodes.push(n)}let h=t.skins,d=e._runtimeSkins,f=h.length;for(let t=0;t<f;t++){let i=h[t];d.push(new g4({skin:i,sceneGraph:e}))}let p=e._skinnedNodes,m=p.length;for(let t=0;t<m;t++){let i=p[t],n=e._runtimeNodes[i],r=s[i].skin.index;n._runtimeSkin=d[r],n.updateJointMatrices()}e.applyArticulations()}(this)}function Zo(e,t){let i=e._components,n=e._model;e._computedModelMatrix=er.Z.multiplyTransformation(t,i.transform,e._computedModelMatrix),e._computedModelMatrix=er.Z.multiplyTransformation(e._computedModelMatrix,e._axisCorrectionMatrix,e._computedModelMatrix),e._computedModelMatrix=er.Z.multiplyByUniformScale(e._computedModelMatrix,n.computedScale,e._computedModelMatrix)}Object.defineProperties(Zr.prototype,{components:{get:function(){return this._components}},computedModelMatrix:{get:function(){return this._computedModelMatrix}},axisCorrectionMatrix:{get:function(){return this._axisCorrectionMatrix}},boundingSphere:{get:function(){return this._boundingSphere}}});let Za=new S.Z,Zs=new S.Z,Zl=new S.Z,Zc=new S.Z,Zu=new S.Z;function Zh(e,t,i,n){let r=e._rootNodes,o=r.length;for(let a=0;a<o;a++){let o=r[a],s=e._runtimeNodes[o];!function e(t,i,n,r,o){if(n&&!i.show)return;let a=i.children.length;for(let s=0;s<a;s++)e(t,i.getChild(s),n,r,o);let s=i.runtimePrimitives,l=s.length;for(let e=0;e<l;e++)r(s[e],o)}(e,s,t,i,n)}}Zr.prototype.buildDrawCommands=function(e){let t,i,n;let r=this._model,o=new g6(r);r.statistics.clear(),this.configurePipeline(e);let a=this.modelPipelineStages;for(t=0;t<a.length;t++)a[t].process(o,r,e);let s=S.Z.fromElements(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,Zs),l=S.Z.fromElements(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,Zl);for(t=0;t<this._runtimeNodes.length;t++){let r=this._runtimeNodes[t];if(!(0,_.Z)(r))continue;r.configurePipeline();let a=r.pipelineStages,c=new Zt(o,r);for(i=0;i<a.length;i++)a[i].process(c,r.node,e);let u=r.computedTransform;for(i=0;i<r.runtimePrimitives.length;i++){let t=r.runtimePrimitives[i];t.configurePipeline(e);let o=t.pipelineStages,a=new Zn(c,t);for(n=0;n<o.length;n++)o[n].process(a,t.primitive,e);t.boundingSphere=f.Z.clone(a.boundingSphere,new f.Z);let h=er.Z.multiplyByPoint(u,a.positionMin,Zc),d=er.Z.multiplyByPoint(u,a.positionMax,Zu);S.Z.minimumByComponent(s,h,s),S.Z.maximumByComponent(l,d,l);let p=_r(a,e);t.drawCommand=p}}this._boundingSphere=f.Z.fromCornerPoints(s,l,new f.Z),this._boundingSphere=f.Z.transformWithoutScale(this._boundingSphere,this._axisCorrectionMatrix,this._boundingSphere),this._boundingSphere=f.Z.transform(this._boundingSphere,this._components.transform,this._boundingSphere),r._boundingSphere=f.Z.transform(this._boundingSphere,r.modelMatrix,r._boundingSphere),r._initialRadius=r._boundingSphere.radius,r._boundingSphere.radius*=r._clampedScale},Zr.prototype.configurePipeline=function(e){let t=this.modelPipelineStages;t.length=0;let i=this._model,n=e.fog.enabled&&e.fog.renderable;(0,_.Z)(i.color)&&t.push(__),!(0,_.Z)(i.classificationType)&&(i.imageBasedLighting.enabled&&t.push(_l),i.isClippingEnabled()&&t.push(_g),i.isClippingPolygonsEnabled()&&t.push(_y),i.hasSilhouette(e)&&t.push(g7),(0,_.Z)(i.splitDirection)&&i.splitDirection!==pM.Z.NONE&&t.push(Ze),mY.is3DTiles(i.type)&&t.push(_a),n&&t.push(_s))},Zr.prototype.update=function(e,t){let i,n,r;for(i=0;i<this._runtimeNodes.length;i++){let o=this._runtimeNodes[i];if(!(0,_.Z)(o))continue;for(n=0;n<o.updateStages.length;n++)o.updateStages[n].update(o,this,e);let a=e.mode!==eu.Z.SCENE3D&&this._model._projectTo2D;for(t&&!a&&this.updateJointMatrices(),n=0;n<o.runtimePrimitives.length;n++){let e=o.runtimePrimitives[n];for(r=0;r<e.updateStages.length;r++)e.updateStages[r].update(e,this)}}},Zr.prototype.updateModelMatrix=function(e,t){Zo(this,e),t.mode!==eu.Z.SCENE3D&&function(e,t){let i=e._computedModelMatrix,n=er.Z.getTranslation(i,Za);if(S.Z.equals(n,S.Z.ZERO)){let n=e.boundingSphere.center,r=n9.Z.wgs84To2DModelMatrix(t.mapProjection,n,e._computedModelMatrix2D);e._computedModelMatrix2D=er.Z.multiply(r,i,e._computedModelMatrix2D)}else e._computedModelMatrix2D=n9.Z.basisTo2D(t.mapProjection,i,e._computedModelMatrix2D);e._boundingSphere2D=f.Z.transform(e._boundingSphere,e._computedModelMatrix2D,e._boundingSphere2D)}(this,t);let i=this._rootNodes;for(let e=0;e<i.length;e++)this._runtimeNodes[i[e]]._transformDirty=!0},Zr.prototype.updateJointMatrices=function(){let e=this._skinnedNodes,t=e.length;for(let i=0;i<t;i++){let t=e[i];this._runtimeNodes[t].updateJointMatrices()}};let Zd={backFaceCulling:void 0};function Zf(e,t){e.drawCommand.backFaceCulling=t.backFaceCulling}Zr.prototype.updateBackFaceCulling=function(e){Zd.backFaceCulling=e,Zh(this,!1,Zf,Zd)};let Zp={shadowMode:void 0};function Zm(e,t){e.drawCommand.shadows=t.shadowMode}Zr.prototype.updateShadows=function(e){Zp.shadowMode=e,Zh(this,!1,Zm,Zp)};let Z_={debugShowBoundingVolume:void 0};function Zg(e,t){e.drawCommand.debugShowBoundingVolume=t.debugShowBoundingVolume}Zr.prototype.updateShowBoundingVolume=function(e){Z_.debugShowBoundingVolume=e,Zh(this,!1,Zg,Z_)};let ZZ=[],Zy={frameState:void 0,hasSilhouette:void 0};function Zb(e,t){let i=t.frameState,n=t.hasSilhouette,r=i.passes,o=e.drawCommand;o.pushCommands(i,i.commandList),n&&!r.pick&&o.pushSilhouetteCommands(i,ZZ)}function Zv(){this.pointsLength=0,this.trianglesLength=0,this.geometryByteLength=0,this.texturesByteLength=0,this.propertyTablesByteLength=0,this._bufferIdSet={},this._textureIdSet={},this._batchTextureIdMap=new E.Z}Zr.prototype.pushDrawCommands=function(e){ZZ.length=0,Zy.hasSilhouette=this._model.hasSilhouette(e),Zy.frameState=e,Zh(this,!0,Zb,Zy),e.commandList.push.apply(e.commandList,ZZ)},Zr.prototype.setArticulationStage=function(e,t){let i=e.split(" ");if(2!==i.length)return;let n=i[0],r=i[1],o=this._runtimeArticulations[n];(0,_.Z)(o)&&o.setArticulationStage(r,t)},Zr.prototype.applyArticulations=function(){let e=this._runtimeArticulations;for(let t in e)e.hasOwnProperty(t)&&e[t].apply()},Object.defineProperties(Zv.prototype,{batchTexturesByteLength:{get:function(){let e=this._batchTextureIdMap.length,t=this._batchTextureIdMap.values,i=0;for(let n=0;n<e;n++)i+=t[n].byteLength;return i}}}),Zv.prototype.clear=function(){this.pointsLength=0,this.trianglesLength=0,this.geometryByteLength=0,this.texturesByteLength=0,this.propertyTablesByteLength=0,this._bufferIdSet={},this._textureIdSet={},this._batchTextureIdMap.removeAll()},Zv.prototype.addBuffer=function(e,t){if(p.Z.typeOf.object("buffer",e),p.Z.typeOf.bool("hasCpuCopy",t),!this._bufferIdSet.hasOwnProperty(e._id)){let i=t?2:1;this.geometryByteLength+=e.sizeInBytes*i}this._bufferIdSet[e._id]=!0},Zv.prototype.addTexture=function(e){p.Z.typeOf.object("texture",e),this._textureIdSet.hasOwnProperty(e._id)||(this.texturesByteLength+=e.sizeInBytes),this._textureIdSet[e._id]=!0},Zv.prototype.addBatchTexture=function(e){p.Z.typeOf.object("batchTexture",e),this._batchTextureIdMap.contains(e._id)||this._batchTextureIdMap.set(e._id,e)};var ZT=i(5413);let ZE={},Zx=Uint32Array.BYTES_PER_ELEMENT;ZE.parse=function(e,t){let i,n;t=(0,m.Z)(t,0),p.Z.defined("arrayBuffer",e);let r=new Uint8Array(e),o=new DataView(e);t+=Zx;let a=o.getUint32(t,!0);if(1!==a)throw new e3.Z(`Only Point Cloud tile version 1 is supported. Version ${a} is not.`);t+=Zx+Zx;let s=o.getUint32(t,!0);if(0===s)throw new e3.Z("Feature table must have a byte length greater than zero");t+=Zx;let l=o.getUint32(t,!0);t+=Zx;let c=o.getUint32(t,!0);t+=Zx;let u=o.getUint32(t,!0),h=h0(r,t+=Zx,s),d=new Uint8Array(e,t+=s,l);t+=l,c>0&&(i=h0(r,t,c),t+=c,u>0&&(n=new Uint8Array(e,t,u),t+=u));let f=new pB(h,d),g=f.getGlobalProperty("POINTS_LENGTH");if(f.featuresLength=g,!(0,_.Z)(g))throw new e3.Z("Feature table global property: POINTS_LENGTH must be defined");let Z=f.getGlobalProperty("RTC_CENTER",eM.Z.FLOAT,3);(0,_.Z)(Z)&&(Z=S.Z.unpack(Z));let y=function(e,t){let i,n,r,o,a,s,l,c,u;let h=e.json,d=(0,_.Z)(h.extensions)?h.extensions["3DTILES_draco_point_compression"]:void 0,f=(0,_.Z)(t)&&(0,_.Z)(t.extensions)?t.extensions["3DTILES_draco_point_compression"]:void 0;if((0,_.Z)(f)&&(r=f.properties),(0,_.Z)(d)){n=d.properties;let t=d.byteOffset,r=d.byteLength;if(!(0,_.Z)(n)||!(0,_.Z)(t)||!(0,_.Z)(r))throw new e3.Z("Draco properties, byteOffset, and byteLength must be defined");i=e.buffer.slice(t,t+r),o=(0,_.Z)(n.POSITION),a=(0,_.Z)(n.RGB)||(0,_.Z)(n.RGBA),s=(0,_.Z)(n.NORMAL),l=(0,_.Z)(n.BATCH_ID),c=(0,_.Z)(n.RGBA)}return(0,_.Z)(i)&&(u={buffer:i,featureTableProperties:n,batchTableProperties:r,properties:(0,hv.Z)(n,r),dequantizeInShader:!0}),{draco:u,hasPositions:o,hasColors:a,isTranslucent:c,hasNormals:s,hasBatchIds:l}}(f,i);if(y.rtcCenter=Z,y.pointsLength=g,!y.hasPositions){let e=function(e){let t;let i=e.json;if((0,_.Z)(i.POSITION))return t=e.getPropertyArray("POSITION",eM.Z.FLOAT,3),{name:dj.POSITION,semantic:dj.POSITION,typedArray:t,isQuantized:!1,componentDatatype:eM.Z.FLOAT,type:dH.Z.VEC3};if((0,_.Z)(i.POSITION_QUANTIZED)){t=e.getPropertyArray("POSITION_QUANTIZED",eM.Z.UNSIGNED_SHORT,3);let i=e.getGlobalProperty("QUANTIZED_VOLUME_SCALE",eM.Z.FLOAT,3);if(!(0,_.Z)(i))throw new e3.Z("Global property: QUANTIZED_VOLUME_SCALE must be defined for quantized positions.");let n=e.getGlobalProperty("QUANTIZED_VOLUME_OFFSET",eM.Z.FLOAT,3);if(!(0,_.Z)(n))throw new e3.Z("Global property: QUANTIZED_VOLUME_OFFSET must be defined for quantized positions.");return{name:dj.POSITION,semantic:dj.POSITION,typedArray:t,isQuantized:!0,componentDatatype:eM.Z.FLOAT,type:dH.Z.VEC3,quantizedRange:65535,quantizedVolumeOffset:S.Z.unpack(n),quantizedVolumeScale:S.Z.unpack(i),quantizedComponentDatatype:eM.Z.UNSIGNED_SHORT,quantizedType:dH.Z.VEC3}}}(f);y.positions=e,y.hasPositions=y.hasPositions||(0,_.Z)(e)}if(!y.hasPositions)throw new e3.Z("Either POSITION or POSITION_QUANTIZED must be defined.");if(!y.hasNormals){let e=function(e){let t;let i=e.json;return(0,_.Z)(i.NORMAL)?(t=e.getPropertyArray("NORMAL",eM.Z.FLOAT,3),{name:dj.NORMAL,semantic:dj.NORMAL,typedArray:t,octEncoded:!1,octEncodedZXY:!1,componentDatatype:eM.Z.FLOAT,type:dH.Z.VEC3}):(0,_.Z)(i.NORMAL_OCT16P)?(t=e.getPropertyArray("NORMAL_OCT16P",eM.Z.UNSIGNED_BYTE,2),{name:dj.NORMAL,semantic:dj.NORMAL,typedArray:t,octEncoded:!0,octEncodedZXY:!1,quantizedRange:255,quantizedType:dH.Z.VEC2,quantizedComponentDatatype:eM.Z.UNSIGNED_BYTE,componentDatatype:eM.Z.FLOAT,type:dH.Z.VEC3}):void 0}(f);y.normals=e,y.hasNormals=y.hasNormals||(0,_.Z)(e)}if(!y.hasColors){let e=function(e){let t;let i=e.json;if((0,_.Z)(i.RGBA))return t=e.getPropertyArray("RGBA",eM.Z.UNSIGNED_BYTE,4),{name:dj.COLOR,semantic:dj.COLOR,setIndex:0,typedArray:t,componentDatatype:eM.Z.UNSIGNED_BYTE,type:dH.Z.VEC4,normalized:!0,isRGB565:!1,isTranslucent:!0};if((0,_.Z)(i.RGB))return t=e.getPropertyArray("RGB",eM.Z.UNSIGNED_BYTE,3),{name:"COLOR",semantic:dj.COLOR,setIndex:0,typedArray:t,componentDatatype:eM.Z.UNSIGNED_BYTE,type:dH.Z.VEC3,normalized:!0,isRGB565:!1,isTranslucent:!1};if((0,_.Z)(i.RGB565))return t=e.getPropertyArray("RGB565",eM.Z.UNSIGNED_SHORT,1),{name:"COLOR",semantic:dj.COLOR,setIndex:0,typedArray:t,componentDatatype:eM.Z.FLOAT,type:dH.Z.VEC3,normalized:!1,isRGB565:!0,isTranslucent:!1};if((0,_.Z)(i.CONSTANT_RGBA)){let t=e.getGlobalProperty("CONSTANT_RGBA",eM.Z.UNSIGNED_BYTE,4),i=t[3],n=C.Z.fromBytes(t[0],t[1],t[2],i),r=i<255;return{name:dj.COLOR,semantic:dj.COLOR,setIndex:0,constantColor:n,componentDatatype:eM.Z.FLOAT,type:dH.Z.VEC4,isQuantized:!1,isTranslucent:r}}}(f);y.colors=e,y.hasColors=y.hasColors||(0,_.Z)(e),y.hasConstantColor=(0,_.Z)(y.constantColor),y.isTranslucent=(0,_.Z)(e)&&e.isTranslucent}if(!y.hasBatchIds){let e=function(e){let t=e.json;if((0,_.Z)(t.BATCH_ID)){let t=e.getPropertyArray("BATCH_ID",eM.Z.UNSIGNED_SHORT,1);return{name:dj.FEATURE_ID,semantic:dj.FEATURE_ID,setIndex:0,typedArray:t,componentDatatype:eM.Z.fromTypedArray(t),type:dH.Z.SCALAR}}}(f);y.batchIds=e,y.hasBatchIds=y.hasBatchIds||(0,_.Z)(e)}if(y.hasBatchIds){let e=f.getGlobalProperty("BATCH_LENGTH");if(!(0,_.Z)(e))throw new e3.Z("Global property: BATCH_LENGTH must be defined when BATCH_ID is defined.");y.batchLength=e}return(0,_.Z)(n)&&(n=new Uint8Array(n),y.batchTableJson=i,y.batchTableBinary=n),y};let Zw=uX.Components,ZS=uX.Scene,ZC=uX.Node,ZA=uX.Primitive,ZI=uX.Attribute,ZO=uX.Quantization,ZD=uX.FeatureIdAttribute,ZP=uX.Material,ZR=uX.MetallicRoughness;function ZN(e){let t=(e=(0,m.Z)(e,m.Z.EMPTY_OBJECT)).arrayBuffer,i=(0,m.Z)(e.byteOffset,0);p.Z.typeOf.object("options.arrayBuffer",t),this._arrayBuffer=t,this._byteOffset=i,this._loadAttributesFor2D=(0,m.Z)(e.loadAttributesFor2D,!1),this._parsedContent=void 0,this._decodePromise=void 0,this._decodedAttributes=void 0,this._promise=void 0,this._error=void 0,this._state=hx.UNLOADED,this._buffers=[],this._components=void 0,this._transform=er.Z.IDENTITY}function ZL(e,t,i){let n,r=t.typedArray;if(t.octEncoded&&((n=new ZO).octEncoded=t.octEncoded,n.octEncodedZXY=t.octEncodedZXY,n.normalizationRange=t.quantizedRange,n.type=t.quantizedType,n.componentDatatype=t.quantizedComponentDatatype),t.isQuantized){n=new ZO;let e=t.quantizedRange;n.normalizationRange=e,n.quantizedVolumeOffset=S.Z.ZERO;let i=t.quantizedVolumeScale;n.quantizedVolumeDimensions=i,n.quantizedVolumeStepSize=S.Z.divideByScalar(i,e,new S.Z),n.componentDatatype=t.quantizedComponentDatatype,n.type=t.quantizedType}let o=new ZI;if(o.name=t.name,o.semantic=t.semantic,o.setIndex=t.setIndex,o.componentDatatype=t.componentDatatype,o.type=t.type,o.normalized=(0,m.Z)(t.normalized,!1),o.min=t.min,o.max=t.max,o.quantization=n,t.isRGB565&&(r=eL.Z.decodeRGB565(r)),(0,_.Z)(t.constantColor))o.constant=C.Z.pack(t.constantColor,[,,,,]);else{let t=ek.Z.createVertexBuffer({typedArray:r,context:i,usage:eV.Z.STATIC_DRAW});t.vertexArrayDestroyable=!1,e._buffers.push(t),o.buffer=t}let a=e._loadAttributesFor2D;return o.semantic===dj.POSITION&&a&&(o.typedArray=r),o}(0,_.Z)(Object.create)&&(ZN.prototype=Object.create(hE.prototype),ZN.prototype.constructor=ZN),Object.defineProperties(ZN.prototype,{cacheKey:{get:function(){}},components:{get:function(){return this._components}},transform:{get:function(){return this._transform}}}),ZN.prototype.load=function(){if((0,_.Z)(this._promise))return this._promise;this._parsedContent=ZE.parse(this._arrayBuffer,this._byteOffset),this._state=hx.PROCESSING,this._promise=Promise.resolve(this)},ZN.prototype.process=function(e){if((0,_.Z)(this._error)){let e=this._error;throw this._error=void 0,e}if(this._state===hx.READY)return!0;if(this._state===hx.PROCESSING){if((0,_.Z)(this._decodePromise))return!1;this._decodePromise=function(e,t){let i;let n=e._parsedContent.draco;if(i=(0,_.Z)(n)?hP.decodePointCloud(n,t):Promise.resolve(),(0,_.Z)(i))return e._decodePromise=i,i.then(function(i){if(!e.isDestroyed())return(0,_.Z)(i)&&function(e,t,i){let n;e._state=hx.READY;let r=e._parsedContent;if((0,_.Z)(i.POSITION)){if(n={name:"POSITION",semantic:dj.POSITION,typedArray:i.POSITION.array,componentDatatype:eM.Z.FLOAT,type:dH.Z.VEC3,isQuantized:!1},(0,_.Z)(i.POSITION.data.quantization)){let e=i.POSITION.data.quantization,t=e.range,r=S.Z.fromElements(t,t,t),o=S.Z.unpack(e.minValues),a=(1<<e.quantizationBits)-1;n.isQuantized=!0,n.quantizedRange=a,n.quantizedVolumeOffset=o,n.quantizedVolumeScale=r,n.quantizedComponentDatatype=a<=255?eM.Z.UNSIGNED_BYTE:eM.Z.UNSIGNED_SHORT,n.quantizedType=dH.Z.VEC3}r.positions=n}if((0,_.Z)(i.NORMAL)){if(n={name:"NORMAL",semantic:dj.NORMAL,typedArray:i.NORMAL.array,componentDatatype:eM.Z.FLOAT,type:dH.Z.VEC3,isQuantized:!1,octEncoded:!1,octEncodedZXY:!1},(0,_.Z)(i.NORMAL.data.quantization)){let e=(1<<i.NORMAL.data.quantization.quantizationBits)-1;n.quantizedRange=e,n.octEncoded=!0,n.octEncodedZXY=!0,n.quantizedComponentDatatype=eM.Z.UNSIGNED_BYTE,n.quantizedType=dH.Z.VEC2}r.normals=n}if((0,_.Z)(i.RGBA)?r.colors={name:"COLOR",semantic:dj.COLOR,setIndex:0,typedArray:i.RGBA.array,componentDatatype:eM.Z.UNSIGNED_BYTE,type:dH.Z.VEC4,normalized:!0,isTranslucent:!0}:(0,_.Z)(i.RGB)&&(r.colors={name:"COLOR",semantic:dj.COLOR,setIndex:0,typedArray:i.RGB.array,componentDatatype:eM.Z.UNSIGNED_BYTE,type:dH.Z.VEC3,normalized:!0,isTranslucent:!1}),(0,_.Z)(i.BATCH_ID)){let e=i.BATCH_ID.array;r.batchIds={name:"_FEATURE_ID",semantic:dj.FEATURE_ID,setIndex:0,typedArray:e,componentDatatype:eM.Z.fromTypedArray(e),type:dH.Z.SCALAR}}let o=r.batchTableJson,a=t.batchTableProperties;for(let e in a)if(a.hasOwnProperty(e)){let t=i[e];(0,_.Z)(o)||(o={}),r.hasDracoBatchTable=!0;let n=t.data;o[e]={byteOffset:n.byteOffset,type:function(e){switch(e){case 1:return"SCALAR";case 2:return"VEC2";case 3:return"VEC3";case 4:return"VEC4";default:throw new A.Z("componentsPerAttribute must be a number from 1-4")}}(n.componentsPerAttribute),componentType:function(e){switch(e){case eU.Z.BYTE:return"BYTE";case eU.Z.UNSIGNED_BYTE:return"UNSIGNED_BYTE";case eU.Z.SHORT:return"SHORT";case eU.Z.UNSIGNED_SHORT:return"UNSIGNED_SHORT";case eU.Z.INT:return"INT";case eU.Z.UNSIGNED_INT:return"UNSIGNED_INT";case eU.Z.DOUBLE:return"DOUBLE";case eU.Z.FLOAT:return"FLOAT";default:throw new A.Z("value is not a valid WebGL constant")}}(n.componentDatatype),typedArray:t.array}}r.batchTableJson=o}(e,n,i),function(e,t){let i=e._parsedContent,n=new ZR;n.metallicFactor=0,n.roughnessFactor=.9;let r=new ZP;r.metallicRoughness=n;let o=i.colors;(0,_.Z)(o)&&o.isTranslucent&&(r.alphaMode=uY.BLEND);let a=!(0,_.Z)(i.normals);r.unlit=a;let c=new ZA;if(c.attributes=function(e,t,i){let n;let r=[],o=t.positions;return(0,_.Z)(o)&&(function(e){let t,i,n;let r=e.typedArray,o=r.length/3,a=Math.min(o,20),c=function(e){if(!(0,_.Z)(l)){s=new ZT(0),l=Array(20);for(let e=0;e<20;++e)l[e]=s.random()}return l}(0),u=Number.MAX_VALUE,h=-Number.MAX_VALUE,d=S.Z.fromElements(u,u,u,ZM),f=S.Z.fromElements(h,h,h,ZF);if(e.isQuantized)d=S.Z.ZERO,f=e.quantizedVolumeScale;else for(t=0;t<a;++t)i=Math.floor(c[t]*o),n=S.Z.unpack(r,3*i,Zz),S.Z.minimumByComponent(d,n,d),S.Z.maximumByComponent(f,n,f);e.min=S.Z.clone(d),e.max=S.Z.clone(f)}(o),(n=ZL(e,o,i)).count=t.pointsLength,r.push(n)),(0,_.Z)(t.normals)&&r.push(n=ZL(e,t.normals,i)),r.push(n=(0,_.Z)(t.colors)?ZL(e,t.colors,i):ZL(e,ZB,i)),(0,_.Z)(t.batchIds)&&r.push(n=ZL(e,t.batchIds,i)),r}(e,i,t),c.primitiveType=iT.Z.POINTS,c.material=r,(0,_.Z)(i.batchIds)){let e=new ZD;e.propertyTableId=0,e.setIndex=0,e.positionalLabel="featureId_0",c.featureIds.push(e)}let u=new ZC;u.index=0,u.primitives=[c];let h=new ZS;h.nodes=[u],h.upAxis=dV.Z.Z,h.forwardAxis=dV.Z.X;let d=new Zw;d.scene=h,d.nodes=[u];let f=[];d.structuralMetadata=function(e,t){let i=e.batchLength,n=e.pointsLength,r=e.batchTableBinary,o=!(0,_.Z)(e.batchIds);return(0,_.Z)(r)||e.hasDracoBatchTable?p$({count:(0,m.Z)(i,n),batchTable:e.batchTableJson,binaryBody:r,parseAsPropertyAttributes:o,customAttributeOutput:t}):new hn({schema:{},propertyTables:[]})}(i,f),f.length>0&&function(e,t,i,n){let r=t.attributes,o=i.length;for(let t=0;t<o;t++){let o=i[t],a=ek.Z.createVertexBuffer({typedArray:o.typedArray,context:n,usage:eV.Z.STATIC_DRAW});a.vertexArrayDestroyable=!1,e._buffers.push(a),o.buffer=a,o.typedArray=void 0,r.push(o)}t.propertyAttributeIds=[0]}(e,c,f,t),(0,_.Z)(i.rtcCenter)&&(d.transform=er.Z.multiplyByTranslation(d.transform,i.rtcCenter,d.transform));let p=i.positions;(0,_.Z)(p)&&p.isQuantized&&(d.transform=er.Z.multiplyByTranslation(d.transform,p.quantizedVolumeOffset,d.transform)),e._components=d,e._parsedContent=void 0,e._arrayBuffer=void 0}(e,t),e._state=hx.READY,e}).catch(function(t){e.unload(),e._state=hx.FAILED,e._error=e.getError("Failed to load Draco pnts",t)})}(this,e.context)}return!1};let ZM=new S.Z,ZF=new S.Z,Zz=new S.Z,ZB={name:dj.COLOR,semantic:dj.COLOR,setIndex:0,constantColor:C.Z.DARKGRAY,componentDatatype:eM.Z.FLOAT,type:dH.Z.VEC4,isQuantized:!1,isTranslucent:!1};ZN.prototype.unload=function(){let e=this._buffers;for(let t=0;t<e.length;t++)e[t].destroy();e.length=0,this._components=void 0,this._parsedContent=void 0,this._arrayBuffer=void 0};var ZU=i(15),Zk=i(5352),ZV=i(7330);let ZH=new S.Z,ZG=new S.Z,Zj=new S.Z,ZW=new er.Z,Zq=new er.Z,ZY=new er.Z,ZX=new ea.Z,Z$=new f.Z;function ZK(e,t,i,n,r,o,a,s,l,c){let u=i+t*n;if(c.x=e[u],c.y=e[u+1],c.z=e[u+2],(0,_.Z)(r)){if(r.octEncoded){if(c=eL.Z.octDecodeInRange(c,r.normalizationRange,c),r.octEncodedZXY){let e=c.x;c.x=c.z,c.z=c.y,c.y=e}}else c=S.Z.multiplyComponents(c,r.quantizedVolumeStepSize,c),c=S.Z.add(c,r.quantizedVolumeOffset,c)}return c=er.Z.multiplyByPoint(o,c,c),1!==a&&ZV.Z.getPosition(c,l,a,s,c),c}function ZQ(e){e=(0,m.Z)(e,m.Z.EMPTY_OBJECT),p.Z.typeOf.object("options.loader",e.loader),p.Z.typeOf.object("options.resource",e.resource),this._loader=e.loader,this._resource=e.resource,this.type=(0,m.Z)(e.type,mY.GLTF),this.modelMatrix=er.Z.clone((0,m.Z)(e.modelMatrix,er.Z.IDENTITY)),this._modelMatrix=er.Z.clone(this.modelMatrix),this._scale=(0,m.Z)(e.scale,1),this._minimumPixelSize=(0,m.Z)(e.minimumPixelSize,0),this._maximumScale=e.maximumScale,this._clampedScale=(0,_.Z)(this._maximumScale)?Math.min(this._scale,this._maximumScale):this._scale,this._computedScale=this._clampedScale,this._updateModelMatrix=!1,this.referenceMatrix=void 0,this._iblReferenceFrameMatrix=n2.Z.clone(n2.Z.IDENTITY),this._resourcesLoaded=!1,this._drawCommandsBuilt=!1,this._ready=!1,this._customShader=e.customShader,this._content=e.content,this._texturesLoaded=!1,this._defaultTexture=void 0,this._activeAnimations=new mP(this),this._clampAnimations=(0,m.Z)(e.clampAnimations,!0),this._userAnimationDirty=!1,this._id=e.id,this._idDirty=!1,this._color=C.Z.clone(e.color),this._colorBlendMode=(0,m.Z)(e.colorBlendMode,uC.HIGHLIGHT),this._colorBlendAmount=(0,m.Z)(e.colorBlendAmount,.5);let t=(0,m.Z)(e.silhouetteColor,C.Z.RED);this._silhouetteColor=C.Z.clone(t),this._silhouetteSize=(0,m.Z)(e.silhouetteSize,0),this._silhouetteDirty=!1,this._silhouetteId=void 0,this._cull=(0,m.Z)(e.cull,!0),this._opaquePass=(0,m.Z)(e.opaquePass,ej.Z.OPAQUE),this._allowPicking=(0,m.Z)(e.allowPicking,!0),this._show=(0,m.Z)(e.show,!0),this._style=void 0,this._styleDirty=!1,this._styleCommandsNeeded=void 0;let i=(0,m.Z)(e.featureIdLabel,"featureId_0");"number"==typeof i&&(i=`featureId_${i}`),this._featureIdLabel=i;let n=(0,m.Z)(e.instanceFeatureIdLabel,"instanceFeatureId_0");"number"==typeof n&&(n=`instanceFeatureId_${n}`),this._instanceFeatureIdLabel=n,this._featureTables=[],this._featureTableId=void 0,this._featureTableIdDirty=!0,this._pipelineResources=[],this._modelResources=[],this._pickIds=[],this._boundingSphere=new f.Z,this._initialRadius=void 0,this._heightReference=(0,m.Z)(e.heightReference,D.ZP.NONE),this._heightDirty=this._heightReference!==D.ZP.NONE,this._removeUpdateHeightCallback=void 0,this._verticalExaggerationOn=!1,this._clampedModelMatrix=void 0;let r=e.scene;(0,_.Z)(r)&&(0,_.Z)(r.terrainProviderChanged)&&(this._terrainProviderChangedCallback=r.terrainProviderChanged.addEventListener(()=>{this._heightDirty=!0})),this._scene=r,this._distanceDisplayCondition=e.distanceDisplayCondition;let o=new pL(e.pointCloudShading);this._pointCloudShading=o,this._attenuation=o.attenuation,this._pointCloudBackFaceCulling=o.backFaceCulling;let a=e.clippingPlanes;(0,_.Z)(a)&&void 0===a.owner?uI.Z.setOwner(a,this,"_clippingPlanes"):this._clippingPlanes=a,this._clippingPlanesState=0,this._clippingPlanesMatrix=er.Z.clone(er.Z.IDENTITY);let s=e.clippingPolygons;(0,_.Z)(s)&&void 0===s.owner?uO.Z.setOwner(s,this,"_clippingPolygons"):this._clippingPolygons=s,this._clippingPolygonsState=0,this._lightColor=S.Z.clone(e.lightColor),this._imageBasedLighting=(0,_.Z)(e.imageBasedLighting)?e.imageBasedLighting:new pA,this._shouldDestroyImageBasedLighting=!(0,_.Z)(e.imageBasedLighting),this._backFaceCulling=(0,m.Z)(e.backFaceCulling,!0),this._backFaceCullingDirty=!1,this._shadows=(0,m.Z)(e.shadows,nZ.Z.ENABLED),this._shadowsDirty=!1,this._debugShowBoundingVolumeDirty=!1,this._debugShowBoundingVolume=(0,m.Z)(e.debugShowBoundingVolume,!1),this._enableDebugWireframe=(0,m.Z)(e.enableDebugWireframe,!1),this._enableShowOutline=(0,m.Z)(e.enableShowOutline,!0),this._debugWireframe=(0,m.Z)(e.debugWireframe,!1),!0===this._debugWireframe&&!1===this._enableDebugWireframe&&this.type===mY.GLTF&&(0,nP.Z)("model-debug-wireframe-ignored","enableDebugWireframe must be set to true in Model.fromGltf, otherwise debugWireframe will be ignored.");let l=e.credit;"string"==typeof l&&(l=new uA.Z(l)),this._credits=[],this._credit=l,this._resourceCredits=[],this._gltfCredits=[],this._showCreditsOnScreen=(0,m.Z)(e.showCreditsOnScreen,!1),this._showCreditsOnScreenDirty=!0,this._splitDirection=(0,m.Z)(e.splitDirection,pM.Z.NONE),this._enableShowOutline=(0,m.Z)(e.enableShowOutline,!0),this.showOutline=(0,m.Z)(e.showOutline,!0),this.outlineColor=(0,m.Z)(e.outlineColor,C.Z.BLACK),this._classificationType=e.classificationType,this._statistics=new Zv,this._sceneMode=void 0,this._projectTo2D=(0,m.Z)(e.projectTo2D,!1),this._enablePick=(0,m.Z)(e.enablePick,!1),this._fogRenderable=void 0,this._skipLevelOfDetail=!1,this._ignoreCommands=(0,m.Z)(e.ignoreCommands,!1),this._errorEvent=new et.Z,this._readyEvent=new et.Z,this._texturesReadyEvent=new et.Z,this._sceneGraph=void 0,this._nodesByName={},this.pickObject=e.pickObject}function ZJ(e,t){if(e._errorEvent.numberOfListeners>0){e._errorEvent.raiseEvent(t);return}console.log(t)}function Z0(e,t){if(!(0,_.Z)(e)&&!(0,_.Z)(t))return!1;if((0,_.Z)(e)!==(0,_.Z)(t))return!0;let i=e.alpha,n=t.alpha;return Math.floor(i)!==Math.floor(n)||Math.ceil(i)!==Math.ceil(n)}Object.defineProperties(ZQ.prototype,{ready:{get:function(){return this._ready}},errorEvent:{get:function(){return this._errorEvent}},readyEvent:{get:function(){return this._readyEvent}},incrementallyLoadTextures:{get:function(){return(0,m.Z)(this._loader.incrementallyLoadTextures,!1)}},texturesReadyEvent:{get:function(){return this._texturesReadyEvent}},loader:{get:function(){return this._loader}},statistics:{get:function(){return this._statistics}},activeAnimations:{get:function(){return this._activeAnimations}},clampAnimations:{get:function(){return this._clampAnimations},set:function(e){this._clampAnimations=e}},cull:{get:function(){return this._cull}},opaquePass:{get:function(){return this._opaquePass}},pointCloudShading:{get:function(){return this._pointCloudShading},set:function(e){p.Z.defined("pointCloudShading",e),e!==this._pointCloudShading&&this.resetDrawCommands(),this._pointCloudShading=e}},customShader:{get:function(){return this._customShader},set:function(e){e!==this._customShader&&this.resetDrawCommands(),this._customShader=e}},sceneGraph:{get:function(){return this._sceneGraph}},content:{get:function(){return this._content}},heightReference:{get:function(){return this._heightReference},set:function(e){e!==this._heightReference&&(this._heightDirty=!0),this._heightReference=e}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){if((0,_.Z)(e)&&e.far<=e.near)throw new A.Z("far must be greater than near");this._distanceDisplayCondition=I.Z.clone(e,this._distanceDisplayCondition)}},structuralMetadata:{get:function(){return this._sceneGraph.components.structuralMetadata}},featureTableId:{get:function(){return this._featureTableId},set:function(e){this._featureTableId=e}},featureTables:{get:function(){return this._featureTables},set:function(e){this._featureTables=e}},id:{get:function(){return this._id},set:function(e){e!==this._id&&(this._idDirty=!0),this._id=e}},allowPicking:{get:function(){return this._allowPicking}},style:{get:function(){return this._style},set:function(e){this._style=e,this._styleDirty=!0}},color:{get:function(){return this._color},set:function(e){Z0(e,this._color)&&this.resetDrawCommands(),this._color=C.Z.clone(e,this._color)}},colorBlendMode:{get:function(){return this._colorBlendMode},set:function(e){this._colorBlendMode=e}},colorBlendAmount:{get:function(){return this._colorBlendAmount},set:function(e){this._colorBlendAmount=e}},silhouetteColor:{get:function(){return this._silhouetteColor},set:function(e){if(!C.Z.equals(e,this._silhouetteColor)){let t=Z0(e,this._silhouetteColor);this._silhouetteDirty=this._silhouetteDirty||t}this._silhouetteColor=C.Z.clone(e,this._silhouetteColor)}},silhouetteSize:{get:function(){return this._silhouetteSize},set:function(e){if(e!==this._silhouetteSize){let t=this._silhouetteSize,i=e>0&&0===t||0===e&&t>0;this._silhouetteDirty=this._silhouetteDirty||i,this._backFaceCullingDirty=this._backFaceCullingDirty||i}this._silhouetteSize=e}},boundingSphere:{get:function(){if(!this._ready)throw new A.Z("The model is not loaded. Use Model.readyEvent or wait for Model.ready to be true.");return Z8(this,(0,_.Z)(this._clampedModelMatrix)?this._clampedModelMatrix:this.modelMatrix),this._boundingSphere}},debugShowBoundingVolume:{get:function(){return this._debugShowBoundingVolume},set:function(e){this._debugShowBoundingVolume!==e&&(this._debugShowBoundingVolumeDirty=!0),this._debugShowBoundingVolume=e}},debugWireframe:{get:function(){return this._debugWireframe},set:function(e){this._debugWireframe!==e&&this.resetDrawCommands(),this._debugWireframe=e,!0===this._debugWireframe&&!1===this._enableDebugWireframe&&this.type===mY.GLTF&&(0,nP.Z)("model-debug-wireframe-ignored","enableDebugWireframe must be set to true in Model.fromGltfAsync, otherwise debugWireframe will be ignored.")}},show:{get:function(){return this._show},set:function(e){this._show=e}},featureIdLabel:{get:function(){return this._featureIdLabel},set:function(e){"number"==typeof e&&(e=`featureId_${e}`),p.Z.typeOf.string("value",e),e!==this._featureIdLabel&&(this._featureTableIdDirty=!0),this._featureIdLabel=e}},instanceFeatureIdLabel:{get:function(){return this._instanceFeatureIdLabel},set:function(e){"number"==typeof e&&(e=`instanceFeatureId_${e}`),p.Z.typeOf.string("value",e),e!==this._instanceFeatureIdLabel&&(this._featureTableIdDirty=!0),this._instanceFeatureIdLabel=e}},clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){e!==this._clippingPlanes&&(uI.Z.setOwner(e,this,"_clippingPlanes"),this.resetDrawCommands())}},clippingPolygons:{get:function(){return this._clippingPolygons},set:function(e){e!==this._clippingPolygons&&(uO.Z.setOwner(e,this,"_clippingPolygons"),this.resetDrawCommands())}},lightColor:{get:function(){return this._lightColor},set:function(e){(0,_.Z)(e)!==(0,_.Z)(this._lightColor)&&this.resetDrawCommands(),this._lightColor=S.Z.clone(e,this._lightColor)}},imageBasedLighting:{get:function(){return this._imageBasedLighting},set:function(e){p.Z.typeOf.object("imageBasedLighting",this._imageBasedLighting),e!==this._imageBasedLighting&&(this._shouldDestroyImageBasedLighting&&!this._imageBasedLighting.isDestroyed()&&this._imageBasedLighting.destroy(),this._imageBasedLighting=e,this._shouldDestroyImageBasedLighting=!1,this.resetDrawCommands())}},backFaceCulling:{get:function(){return this._backFaceCulling},set:function(e){e!==this._backFaceCulling&&(this._backFaceCullingDirty=!0),this._backFaceCulling=e}},scale:{get:function(){return this._scale},set:function(e){e!==this._scale&&(this._updateModelMatrix=!0),this._scale=e}},computedScale:{get:function(){return this._computedScale}},minimumPixelSize:{get:function(){return this._minimumPixelSize},set:function(e){e!==this._minimumPixelSize&&(this._updateModelMatrix=!0),this._minimumPixelSize=e}},maximumScale:{get:function(){return this._maximumScale},set:function(e){e!==this._maximumScale&&(this._updateModelMatrix=!0),this._maximumScale=e}},shadows:{get:function(){return this._shadows},set:function(e){e!==this._shadows&&(this._shadowsDirty=!0),this._shadows=e}},credit:{get:function(){return this._credit}},showCreditsOnScreen:{get:function(){return this._showCreditsOnScreen},set:function(e){this._showCreditsOnScreen!==e&&(this._showCreditsOnScreenDirty=!0),this._showCreditsOnScreen=e}},splitDirection:{get:function(){return this._splitDirection},set:function(e){this._splitDirection!==e&&this.resetDrawCommands(),this._splitDirection=e}},classificationType:{get:function(){return this._classificationType}},pickIds:{get:function(){return this._pickIds}},styleCommandsNeeded:{get:function(){return this._styleCommandsNeeded}}}),ZQ.prototype.getNode=function(e){if(!this._ready)throw new A.Z("The model is not loaded. Use Model.readyEvent or wait for Model.ready to be true.");return p.Z.typeOf.string("name",e),this._nodesByName[e]},ZQ.prototype.setArticulationStage=function(e,t){if(p.Z.typeOf.number("value",t),!this._ready)throw new A.Z("The model is not loaded. Use Model.readyEvent or wait for Model.ready to be true.");this._sceneGraph.setArticulationStage(e,t)},ZQ.prototype.applyArticulations=function(){if(!this._ready)throw new A.Z("The model is not loaded. Use Model.readyEvent or wait for Model.ready to be true.");this._sceneGraph.applyArticulations()},ZQ.prototype.makeStyleDirty=function(){this._styleDirty=!0},ZQ.prototype.resetDrawCommands=function(){this._drawCommandsBuilt=!1};let Z1=new er.Z,Z2=new n2.Z,Z3=new er.Z;function Z4(e){let t=e.featureTables[e.featureTableId];e._styleCommandsNeeded=mW.getStyleCommandsNeeded(t.featuresLength,t.batchTexture.translucentFeaturesLength)}ZQ.prototype.update=function(e){let t=!1;try{t=!!this._resourcesLoaded&&(!this._loader.incrementallyLoadTextures||!!this._texturesLoaded)||(e.afterRender.push(()=>!0),this._loader.process(e))}catch(e){this._loader.incrementallyLoadTextures||"TextureError"!==e.name?ZJ(this,dq.getError("model",this._resource,e)):ZJ(this,e)}if((0,_.Z)(this._customShader)&&this._customShader.update(e),this._imageBasedLighting.update(e),this._imageBasedLighting.shouldRegenerateShaders&&this.resetDrawCommands(),!this._resourcesLoaded&&t){this._resourcesLoaded=!0;let e=this._loader.components;if(!(0,_.Z)(e)){if(this._loader.isUnloaded())return;let e=dq.getError("model",this._resource,new e3.Z("Failed to load model."));ZJ(e),this._rejectLoad=this._rejectLoad&&this._rejectLoad(e)}let t=e.structuralMetadata;(0,_.Z)(t)&&t.propertyTableCount>0&&function(e,t){let i=e._featureTables,n=t.propertyTables,r=n.length;for(let t=0;t<r;t++){let r=new mX({model:e,propertyTable:n[t]});i.push(r)}}(this,t);let i=new Zr({model:this,modelComponents:e});this._sceneGraph=i,this._gltfCredits=i.components.asset.credits}if(this._resourcesLoaded&&e.mode!==eu.Z.MORPHING){let t,i;if(function(e){if(!e._featureTableIdDirty)return;e._featureTableIdDirty=!1;let t=e._sceneGraph.components,i=t.structuralMetadata;(0,_.Z)(i)&&i.propertyTableCount>0&&(e.featureTableId=function(e,t){let i,n,r,o;let a=t._featureIdLabel,s=t._instanceFeatureIdLabel;for(i=0;i<e.nodes.length;i++)if(o=e.nodes[i],(0,_.Z)(o.instances)&&(r=dq.getFeatureIdsByLabel(o.instances.featureIds,s),(0,_.Z)(r)&&(0,_.Z)(r.propertyTableId)))return r.propertyTableId;for(i=0;i<e.nodes.length;i++)for(n=0,o=e.nodes[i];n<o.primitives.length;n++){let e=o.primitives[n],t=dq.getFeatureIdsByLabel(e.featureIds,a);if((0,_.Z)(t))return t.propertyTableId}if(1===t._featureTables.length)return 0}(t,e),e._styleDirty=!0,e.resetDrawCommands())}(this),this._styleDirty&&(this.applyStyle(this._style),this._styleDirty=!1),function(e,t){let i=e._featureTables,n=i.length,r=!1;for(let e=0;e<n;e++)i[e].update(t),i[e].styleCommandsNeededDirty&&(r=!0);r&&Z4(e)}(this,e),function(e){let t=e.pointCloudShading;t.attenuation!==e._attenuation&&(e.resetDrawCommands(),e._attenuation=t.attenuation),t.backFaceCulling!==e._pointCloudBackFaceCulling&&(e.resetDrawCommands(),e._pointCloudBackFaceCulling=t.backFaceCulling)}(this),this._silhouetteDirty&&(yn(e)&&this.resetDrawCommands(),this._silhouetteDirty=!1),function(e,t){let i=e.hasSkipLevelOfDetail(t);i!==e._skipLevelOfDetail&&(e.resetDrawCommands(),e._skipLevelOfDetail=i)}(this,e),t=0,this.isClippingEnabled()&&(this._clippingPlanes.owner===this&&this._clippingPlanes.update(e),t=this._clippingPlanes.clippingPlanesState),t!==this._clippingPlanesState&&(this.resetDrawCommands(),this._clippingPlanesState=t),i=0,this.isClippingPolygonsEnabled()&&(this._clippingPolygons.owner===this&&(this._clippingPolygons.update(e),this._clippingPolygons.queueCommands(e)),i=this._clippingPolygons.clippingPolygonsState),i!==this._clippingPolygonsState&&(this.resetDrawCommands(),this._clippingPolygonsState=i),e.mode!==this._sceneMode&&(this._projectTo2D?this.resetDrawCommands():this._updateModelMatrix=!0,this._sceneMode=e.mode),function(e,t){let i=t.fog.enabled&&t.fog.renderable;i!==e._fogRenderable&&(e.resetDrawCommands(),e._fogRenderable=i)}(this,e),function(e,t){let i=1!==t.verticalExaggeration;e._verticalExaggerationOn!==i&&(e.resetDrawCommands(),e._verticalExaggerationOn=i)}(this,e),this._defaultTexture=e.context.defaultTexture,this._drawCommandsBuilt||(this.destroyPipelineResources(),this._sceneGraph.buildDrawCommands(e),this._drawCommandsBuilt=!0),function(e,t){if(!er.Z.equals(e.modelMatrix,e._modelMatrix)){if(t.mode!==eu.Z.SCENE3D&&e._projectTo2D)throw new A.Z("Model.modelMatrix cannot be changed in 2D or Columbus View if projectTo2D is true.");e._updateModelMatrix=!0,e._modelMatrix=er.Z.clone(e.modelMatrix,e._modelMatrix)}}(this,e),function(e){if(!e._updateModelMatrix&&!e._heightDirty&&0===e._minimumPixelSize)return;(0,_.Z)(e._removeUpdateHeightCallback)&&(e._removeUpdateHeightCallback(),e._removeUpdateHeightCallback=void 0);let t=e._scene;if(!(0,_.Z)(t)||e.heightReference===D.ZP.NONE){if(e.heightReference!==D.ZP.NONE)throw new A.Z("Height reference is not supported without a scene.");e._clampedModelMatrix=void 0;return}let i=t.globe,n=(0,m.Z)(i?.ellipsoid,el.Z.WGS84),r=e.modelMatrix;Z5.x=r[12],Z5.y=r[13],Z5.z=r[14];let o=n.cartesianToCartographic(Z5);(0,_.Z)(e._clampedModelMatrix)||(e._clampedModelMatrix=er.Z.clone(r,new er.Z)),e._removeUpdateHeightCallback=t.updateHeight(o,yt(e,n,o),e.heightReference);let a=t.getHeight(o,e.heightReference);if((0,_.Z)(a)){let t=yt(e,n,o);ea.Z.clone(o,Z9),Z9.height=a,t(Z9)}e._heightDirty=!1,e._updateModelMatrix=!0}(this),function(e,t){if(!e._updateModelMatrix&&0===e._minimumPixelSize)return;let i=(0,_.Z)(e._clampedModelMatrix)?e._clampedModelMatrix:e.modelMatrix;Z8(e,i),function(e,t,i){let n=e.scale;if(0!==e.minimumPixelSize&&!e._projectTo2D){let r=i.context,o=Math.max(r.drawingBufferWidth,r.drawingBufferHeight);er.Z.getTranslation(t,Z5),e._sceneMode!==eu.Z.SCENE3D&&eh.Z.computeActualWgs84Position(i,Z5,Z5);let a=e._boundingSphere.radius,s=(Z7.center=Z5,Z7.radius=a,i.camera.getPixelSize(Z7,i.context.drawingBufferWidth,i.context.drawingBufferHeight));Math.min(2*a*(1/s),o)<e.minimumPixelSize&&(n=e.minimumPixelSize*s/(2*e._initialRadius))}e._computedScale=(0,_.Z)(e.maximumScale)?Math.min(e.maximumScale,n):n}(e,i,t)}(this,e),function(e,t){let i=(0,_.Z)(e._clampedModelMatrix)?e._clampedModelMatrix:e.modelMatrix,n=(0,m.Z)(e.referenceMatrix,i),r=t.context,o=e._imageBasedLighting;if(o.useSphericalHarmonicCoefficients||o.useSpecularEnvironmentMaps){let t=Z2,i=Z1;i=er.Z.multiply(r.uniformState.view3D,n,i),t=er.Z.getRotation(i,t),t=n2.Z.transpose(t,t),e._iblReferenceFrameMatrix=n2.Z.multiply(Z6,t,e._iblReferenceFrameMatrix)}if(e.isClippingEnabled()){let t=Z3;t=er.Z.multiply(r.uniformState.view3D,n,t),t=er.Z.multiply(t,e._clippingPlanes.modelMatrix,t),e._clippingPlanesMatrix=er.Z.inverseTranspose(t,e._clippingPlanesMatrix)}}(this,e),!this._ready){e.afterRender.push(()=>{this._ready=!0,this._readyEvent.raiseEvent(this)});return}this._loader.incrementallyLoadTextures&&!this._texturesLoaded&&this._loader.texturesLoaded&&(this.resetDrawCommands(),this._texturesLoaded=!0,this._texturesReadyEvent.raiseEvent(this)),function(e){if(!e._idDirty)return;e._idDirty=!1;let t=e._id,i=e._pickIds,n=i.length;for(let e=0;e<n;++e)i[e].object.id=t}(this),function(e,t){let i=e._sceneGraph;if(e._updateModelMatrix||0!==e._minimumPixelSize){let n=(0,_.Z)(e._clampedModelMatrix)?e._clampedModelMatrix:e.modelMatrix;i.updateModelMatrix(n,t),e._updateModelMatrix=!1}e._backFaceCullingDirty&&(i.updateBackFaceCulling(e._backFaceCulling),e._backFaceCullingDirty=!1),e._shadowsDirty&&(i.updateShadows(e._shadows),e._shadowsDirty=!1),e._debugShowBoundingVolumeDirty&&(i.updateShowBoundingVolume(e._debugShowBoundingVolume),e._debugShowBoundingVolumeDirty=!1);let n=!1;(0,_.Z)(e.classificationType)||(n=e._userAnimationDirty||e._activeAnimations.update(t)),i.update(t,n),e._userAnimationDirty=!1}(this,e),function(e){if(!e._showCreditsOnScreenDirty)return;e._showCreditsOnScreenDirty=!1,e._credits.length=0;let t=e._showCreditsOnScreen;if((0,_.Z)(e._credit)){let i=uA.Z.clone(e._credit);i.showOnScreen=i.showOnScreen||t,e._credits.push(i)}let i=e._resourceCredits,n=i.length;for(let r=0;r<n;r++){let n=uA.Z.clone(i[r]);n.showOnScreen=n.showOnScreen||t,e._credits.push(n)}let r=e._gltfCredits,o=r.length;for(let i=0;i<o;i++){let n=uA.Z.clone(r[i]);n.showOnScreen=n.showOnScreen||t,e._credits.push(n)}}(this),function(e,t){let i=function(e,t){let i;let n=e.distanceDisplayCondition;if(!(0,_.Z)(n))return!0;let r=n.near*n.near,o=n.far*n.far;if(t.mode===eu.Z.SCENE2D){let e=.5*(t.camera.frustum.right-t.camera.frustum.left);i=e*e}else{let n=er.Z.getTranslation(e.modelMatrix,yi);eh.Z.computeActualWgs84Position(t,n,n),i=S.Z.distanceSquared(n,t.camera.positionWC)}return i>=r&&i<=o}(e,t),n=e.isInvisible(),r=e.hasSilhouette(t),o=e._show&&0!==e._computedScale&&i&&(!n||r),a=t.passes,s=a.render||a.pick&&e.allowPicking;o&&!e._ignoreCommands&&s&&(function(e,t){let i=t.creditDisplay,n=e._credits,r=n.length;for(let e=0;e<r;e++)i.addCreditToNextFrame(n[e])}(e,t),e._sceneGraph.pushDrawCommands(t))}(this,e)}};let Z5=new S.Z,Z9=new ea.Z;function Z8(e,t){e._clampedScale=(0,_.Z)(e._maximumScale)?Math.min(e._scale,e._maximumScale):e._scale,e._boundingSphere.center=S.Z.multiplyByScalar(e._sceneGraph.boundingSphere.center,e._clampedScale,e._boundingSphere.center),e._boundingSphere.radius=e._initialRadius*e._clampedScale,e._boundingSphere=f.Z.transform(e._boundingSphere,t,e._boundingSphere)}let Z6=new n2.Z(-1,0,0,0,0,1,0,-1,0),Z7=new f.Z,ye=new S.Z;function yt(e,t,i){return function(n){(0,D.lJ)(e.heightReference)&&(n.height+=i.height),t.cartographicToCartesian(n,ye);let r=e._clampedModelMatrix;er.Z.clone(e.modelMatrix,r),r[12]=ye.x,r[13]=ye.y,r[14]=ye.z,e._heightDirty=!0}}let yi=new S.Z;function yn(e){return e.context.stencilBuffer}ZQ.prototype.isTranslucent=function(){let e=this.color;return(0,_.Z)(e)&&e.alpha>0&&e.alpha<1},ZQ.prototype.isInvisible=function(){let e=this.color;return(0,_.Z)(e)&&0===e.alpha},ZQ.prototype.hasSilhouette=function(e){return yn(e)&&this._silhouetteSize>0&&this._silhouetteColor.alpha>0&&!(0,_.Z)(this._classificationType)},ZQ.prototype.hasSkipLevelOfDetail=function(e){if(!mY.is3DTiles(this.type))return!1;let t=e.context.stencilBuffer,i=this._content.tileset;return t&&i.isSkippingLevelOfDetail},ZQ.prototype.isClippingEnabled=function(){let e=this._clippingPlanes;return(0,_.Z)(e)&&e.enabled&&0!==e.length},ZQ.prototype.pick=function(e,t,i,n,r){return function(e,t,i,n,r,o,a){if(p.Z.typeOf.object("model",e),p.Z.typeOf.object("ray",t),p.Z.typeOf.object("frameState",i),!e._ready||i.mode===eu.Z.MORPHING)return;let s=Number.MAX_VALUE,l=e.sceneGraph,c=l._runtimeNodes;for(let a=0;a<c.length;a++){let u=c[a],h=u.node,d=er.Z.clone(u.computedTransform,ZW),p=er.Z.clone(l.computedModelMatrix,Zq),g=h.instances;(0,_.Z)(g)&&g.transformInWorldSpace&&(p=er.Z.multiplyTransformation(e.modelMatrix,l.components.transform,p),d=er.Z.multiplyTransformation(l.axisCorrectionMatrix,u.computedTransform,d));let Z=er.Z.multiplyTransformation(p,d,ZY);i.mode!==eu.Z.SCENE3D&&(Z=n9.Z.basisTo2D(i.mapProjection,Z,Z));let y=[];if((0,_.Z)(g)){let e=g.attributes[0].count,t=g.attributes[0].componentDatatype,n=u.transformsTypedArray;if(!(0,_.Z)(n)){let r=u.instancingTransformsBuffer;(0,_.Z)(r)&&i.context.webgl2&&(n=eM.Z.createTypedArray(t,12*e),r.getBufferData(n))}if((0,_.Z)(n))for(let t=0;t<e;t++){let e=12*t,i=new er.Z(n[e],n[e+1],n[e+2],n[e+3],n[e+4],n[e+5],n[e+6],n[e+7],n[e+8],n[e+9],n[e+10],n[e+11],0,0,0,1);g.transformInWorldSpace?(er.Z.multiplyTransformation(i,d,i),er.Z.multiplyTransformation(p,i,i)):er.Z.multiplyTransformation(i,Z,i),y.push(i)}}0===y.length&&y.push(Z);let b=u.runtimePrimitives.length;for(let a=0;a<b;a++){let l=u.runtimePrimitives[a],c=l.primitive;if((0,_.Z)(l.boundingSphere)&&!(0,_.Z)(g)){let e=f.Z.transform(l.boundingSphere,Z,Z$),i=ZU.Z.raySphere(t,e);if(!(0,_.Z)(i))continue}let h=dq.getAttributeBySemantic(c,dj.POSITION),d=h.byteOffset,p=h.byteStride,b=h.count;if(!(0,_.Z)(c.indices))continue;let v=c.indices.typedArray;if(!(0,_.Z)(v)){let e=c.indices.buffer,t=c.indices.count,n=c.indices.indexDatatype;(0,_.Z)(e)&&i.context.webgl2&&(n===ez.Z.UNSIGNED_BYTE?v=new Uint8Array(t):n===ez.Z.UNSIGNED_SHORT?v=new Uint16Array(t):n===ez.Z.UNSIGNED_INT&&(v=new Uint32Array(t)),e.getBufferData(v))}let T=h.typedArray,E=h.componentDatatype,x=h.type,w=h.quantization;(0,_.Z)(w)&&(E=h.quantization.componentDatatype,x=h.quantization.type);let S=dH.Z.getNumberOfComponents(x),C=eM.Z.getSizeInBytes(E),A=!(0,_.Z)(T)&&(0,_.Z)(p)&&p!==S*C,I=S,O=0;A&&(I=p/C,O=d/C);let D=b*I;if(!(0,_.Z)(T)){let e=h.buffer;(0,_.Z)(e)&&i.context.webgl2&&(T=eM.Z.createTypedArray(E,D),e.getBufferData(T,A?0:d,0,D)),w&&h.normalized&&(T=eL.Z.dequantize(T,E,x,b))}if(!(0,_.Z)(v)||!(0,_.Z)(T))return;o=(0,m.Z)(o,el.Z.WGS84),n=(0,m.Z)(n,1),r=(0,m.Z)(r,0);let P=v.length;for(let i=0;i<P;i+=3){let a=v[i],l=v[i+1],c=v[i+2];for(let i of y){let u=ZK(T,a,O,I,w,i,n,r,o,ZH),h=ZK(T,l,O,I,w,i,n,r,o,ZG),d=ZK(T,c,O,I,w,i,n,r,o,Zj),f=ZU.Z.rayTriangleParametric(t,u,h,d,(0,m.Z)(e.backFaceCulling,!0));(0,_.Z)(f)&&f<s&&f>=0&&(s=f)}}}}if(s!==Number.MAX_VALUE){if(a=Zk.Z.getPoint(t,s,a),i.mode!==eu.Z.SCENE3D){S.Z.fromElements(a.y,a.z,a.x,a);let e=i.mapProjection,t=e.ellipsoid,n=e.unproject(a,ZX);t.cartographicToCartesian(n,a)}return a}}(this,e,t,i,n,r)},ZQ.prototype.isClippingPolygonsEnabled=function(){let e=this._clippingPolygons;return(0,_.Z)(e)&&e.enabled&&0!==e.length},ZQ.prototype.isDestroyed=function(){return!1},ZQ.prototype.destroy=function(){let e=this._loader;(0,_.Z)(e)&&e.destroy();let t=this._featureTables;if((0,_.Z)(t)){let e=t.length;for(let i=0;i<e;i++)t[i].destroy()}this.destroyPipelineResources(),this.destroyModelResources(),(0,_.Z)(this._removeUpdateHeightCallback)&&(this._removeUpdateHeightCallback(),this._removeUpdateHeightCallback=void 0),(0,_.Z)(this._terrainProviderChangedCallback)&&(this._terrainProviderChangedCallback(),this._terrainProviderChangedCallback=void 0);let i=this._clippingPlanes;(0,_.Z)(i)&&!i.isDestroyed()&&i.owner===this&&i.destroy(),this._clippingPlanes=void 0;let n=this._clippingPolygons;(0,_.Z)(n)&&!n.isDestroyed()&&n.owner===this&&n.destroy(),this._clippingPolygons=void 0,this._shouldDestroyImageBasedLighting&&!this._imageBasedLighting.isDestroyed()&&this._imageBasedLighting.destroy(),this._imageBasedLighting=void 0,(0,g.Z)(this)},ZQ.prototype.destroyPipelineResources=function(){let e=this._pipelineResources;for(let t=0;t<e.length;t++)e[t].destroy();this._pipelineResources.length=0,this._pickIds.length=0},ZQ.prototype.destroyModelResources=function(){let e=this._modelResources;for(let t=0;t<e.length;t++)e[t].destroy();this._modelResources.length=0},ZQ.fromGltfAsync=async function(e){if(e=(0,m.Z)(e,m.Z.EMPTY_OBJECT),!(0,_.Z)(e.url)&&!(0,_.Z)(e.gltf))throw new A.Z("options.url is required.");let t=(0,m.Z)(e.url,e.gltf),i={releaseGltfJson:e.releaseGltfJson,asynchronous:e.asynchronous,incrementallyLoadTextures:e.incrementallyLoadTextures,upAxis:e.upAxis,forwardAxis:e.forwardAxis,loadAttributesFor2D:e.projectTo2D,enablePick:e.enablePick,loadIndicesForWireframe:e.enableDebugWireframe,loadPrimitiveOutline:e.enableShowOutline,loadForClassification:(0,_.Z)(e.classificationType)},n=(0,m.Z)(e.basePath,""),r=ec.Z.createIfNeeded(n);(0,_.Z)(t.asset)?(i.gltfJson=t,i.baseResource=r,i.gltfResource=r):t instanceof Uint8Array?(i.typedArray=t,i.baseResource=r,i.gltfResource=r):i.gltfResource=ec.Z.createIfNeeded(t);let o=new pn(i),a=(0,_.Z)(e.content)?mY.TILE_GLTF:mY.GLTF,s=i.gltfResource,l=yo(o,a,e);l.resource=s;try{await o.load()}catch(e){throw o.destroy(),dq.getError("model",s,e)}let c=e.gltfCallback;(0,_.Z)(c)&&(p.Z.typeOf.func("options.gltfCallback",c),c(o.gltfJson));let u=new ZQ(l),h=u._resource.credits;if((0,_.Z)(h)){let e=h.length;for(let t=0;t<e;t++)u._resourceCredits.push(uA.Z.clone(h[t]))}return u},ZQ.fromB3dm=async function(e){let t=new pJ({b3dmResource:e.resource,arrayBuffer:e.arrayBuffer,byteOffset:e.byteOffset,releaseGltfJson:e.releaseGltfJson,asynchronous:e.asynchronous,incrementallyLoadTextures:e.incrementallyLoadTextures,upAxis:e.upAxis,forwardAxis:e.forwardAxis,loadAttributesFor2D:e.projectTo2D,enablePick:e.enablePick,loadIndicesForWireframe:e.enableDebugWireframe,loadPrimitiveOutline:e.enableShowOutline,loadForClassification:(0,_.Z)(e.classificationType)});try{await t.load();let i=yo(t,mY.TILE_B3DM,e);return new ZQ(i)}catch(e){throw t.destroy(),e}},ZQ.fromPnts=async function(e){let t=new ZN({arrayBuffer:e.arrayBuffer,byteOffset:e.byteOffset,loadAttributesFor2D:e.projectTo2D});try{await t.load();let i=yo(t,mY.TILE_PNTS,e);return new ZQ(i)}catch(e){throw t.destroy(),e}},ZQ.fromI3dm=async function(e){let t=new ma({i3dmResource:e.resource,arrayBuffer:e.arrayBuffer,byteOffset:e.byteOffset,releaseGltfJson:e.releaseGltfJson,asynchronous:e.asynchronous,incrementallyLoadTextures:e.incrementallyLoadTextures,upAxis:e.upAxis,forwardAxis:e.forwardAxis,loadAttributesFor2D:e.projectTo2D,enablePick:e.enablePick,loadIndicesForWireframe:e.enableDebugWireframe,loadPrimitiveOutline:e.enableShowOutline});try{await t.load();let i=yo(t,mY.TILE_I3DM,e);return new ZQ(i)}catch(e){throw t.destroy(),e}},ZQ.fromGeoJson=async function(e){return new ZQ(yo(new p0({geoJson:e.geoJson}),mY.TILE_GEOJSON,e))};let yr=new C.Z;function yo(e,t,i){return{loader:e,type:t,resource:i.resource,show:i.show,modelMatrix:i.modelMatrix,scale:i.scale,minimumPixelSize:i.minimumPixelSize,maximumScale:i.maximumScale,id:i.id,allowPicking:i.allowPicking,clampAnimations:i.clampAnimations,shadows:i.shadows,debugShowBoundingVolume:i.debugShowBoundingVolume,enableDebugWireframe:i.enableDebugWireframe,debugWireframe:i.debugWireframe,cull:i.cull,opaquePass:i.opaquePass,customShader:i.customShader,content:i.content,heightReference:i.heightReference,scene:i.scene,distanceDisplayCondition:i.distanceDisplayCondition,color:i.color,colorBlendAmount:i.colorBlendAmount,colorBlendMode:i.colorBlendMode,silhouetteColor:i.silhouetteColor,silhouetteSize:i.silhouetteSize,enableShowOutline:i.enableShowOutline,showOutline:i.showOutline,outlineColor:i.outlineColor,clippingPlanes:i.clippingPlanes,clippingPolygons:i.clippingPolygons,lightColor:i.lightColor,imageBasedLighting:i.imageBasedLighting,backFaceCulling:i.backFaceCulling,credit:i.credit,showCreditsOnScreen:i.showCreditsOnScreen,splitDirection:i.splitDirection,projectTo2D:i.projectTo2D,enablePick:i.enablePick,featureIdLabel:i.featureIdLabel,instanceFeatureIdLabel:i.instanceFeatureIdLabel,pointCloudShading:i.pointCloudShading,classificationType:i.classificationType,pickObject:i.pickObject}}ZQ.prototype.applyColorAndShow=function(e){let t=C.Z.clone(this._color,yr),i=(0,_.Z)(e)&&(0,_.Z)(e.color),n=(0,_.Z)(e)&&(0,_.Z)(e.show);this._color=i?e.color.evaluateColor(void 0,this._color):C.Z.clone(C.Z.WHITE,this._color),this._show=!n||e.show.evaluate(void 0),Z0(t,this._color)&&this.resetDrawCommands()},ZQ.prototype.applyStyle=function(e){let t=this.type===mY.TILE_PNTS,i=(0,_.Z)(this.featureTableId)&&this.featureTables[this.featureTableId].featuresLength>0,n=(0,_.Z)(this.structuralMetadata)?this.structuralMetadata.propertyAttributes:void 0,r=(0,_.Z)(n)&&(0,_.Z)(n[0]);if(t&&(!i||r)){this.resetDrawCommands();return}i?(this.featureTables[this.featureTableId].applyStyle(e),Z4(this,e)):(this.applyColorAndShow(e),this._styleCommandsNeeded=void 0)};let ya=nZ.Z.ENABLED,ys=D.ZP.NONE,yl=C.Z.RED,yc=C.Z.WHITE,yu=uC.HIGHLIGHT,yh=new w.Z(1,1),yd=new er.Z,yf=new er.Z,yp=new C.Z,ym=[,,,,],y_=new S.Z;function yg(e,t){p.Z.typeOf.object("scene",e),p.Z.typeOf.object("entityCollection",t),t.collectionChanged.addEventListener(yg.prototype._onCollectionChanged,this),this._scene=e,this._primitives=e.primitives,this._entityCollection=t,this._modelHash={},this._entitiesToVisualize=new E.Z,this._onCollectionChanged(t,t.values,[],[])}async function yZ(e,t,i,n){let r=e._primitives,o=e._modelHash;try{let a=await ZQ.fromGltfAsync({url:i,incrementallyLoadTextures:n,scene:e._scene});if(e.isDestroyed()||!(0,_.Z)(o[t.id]))return;a.id=t,r.add(a),o[t.id].modelPrimitive=a,a.errorEvent.addEventListener(e=>{(0,_.Z)(o[t.id])&&(console.log(e),"TextureError"!==e.name&&a.incrementallyLoadTextures&&(o[t.id].loadFailed=!0))})}catch(i){if(e.isDestroyed()||!(0,_.Z)(o[t.id]))return;console.log(i),o[t.id].loadFailed=!0}}yg.prototype.update=function(e){if(!(0,_.Z)(e))throw new A.Z("time is required.");let t=this._entitiesToVisualize.values,i=this._modelHash,n=this._primitives;for(let r=0,o=t.length;r<o;r++){let o,a;let s=t[r],l=s._model,c=i[s.id],u=s.isShowing&&s.isAvailable(e)&&L.Z.getValueOrDefault(l._show,e,!0);if(u&&(a=s.computeModelMatrix(e,yd),o=ec.Z.createIfNeeded(L.Z.getValueOrUndefined(l._uri,e)),u=(0,_.Z)(a)&&(0,_.Z)(o)),!u){(0,_.Z)(c)&&c.modelPrimitive&&(c.modelPrimitive.show=!1);continue}(0,_.Z)(c)&&o.url===c.url||((0,_.Z)(c?.modelPrimitive)&&(n.removeAndDestroy(c.modelPrimitive),delete i[s.id]),c={modelPrimitive:void 0,url:o.url,animationsRunning:!1,nodeTransformationsScratch:{},articulationsScratch:{},loadFailed:!1,modelUpdated:!1},i[s.id]=c,yZ(this,s,o,L.Z.getValueOrDefault(l._incrementallyLoadTextures,e,!0)));let h=c.modelPrimitive;if(!(0,_.Z)(h))continue;h.show=!0,h.scale=L.Z.getValueOrDefault(l._scale,e,1),h.minimumPixelSize=L.Z.getValueOrDefault(l._minimumPixelSize,e,0),h.maximumScale=L.Z.getValueOrUndefined(l._maximumScale,e),h.modelMatrix=er.Z.clone(a,h.modelMatrix),h.shadows=L.Z.getValueOrDefault(l._shadows,e,ya),h.heightReference=L.Z.getValueOrDefault(l._heightReference,e,ys),h.distanceDisplayCondition=L.Z.getValueOrUndefined(l._distanceDisplayCondition,e),h.silhouetteColor=L.Z.getValueOrDefault(l._silhouetteColor,e,yl,yp),h.silhouetteSize=L.Z.getValueOrDefault(l._silhouetteSize,e,0),h.color=L.Z.getValueOrDefault(l._color,e,yc,yp),h.colorBlendMode=L.Z.getValueOrDefault(l._colorBlendMode,e,yu),h.colorBlendAmount=L.Z.getValueOrDefault(l._colorBlendAmount,e,.5),h.clippingPlanes=L.Z.getValueOrUndefined(l._clippingPlanes,e),h.clampAnimations=L.Z.getValueOrDefault(l._clampAnimations,e,!0),h.imageBasedLighting.imageBasedLightingFactor=L.Z.getValueOrDefault(l._imageBasedLightingFactor,e,yh);let d=L.Z.getValueOrUndefined(l._lightColor,e);if((0,_.Z)(d)&&(C.Z.pack(d,ym,0),d=S.Z.unpack(ym,0,y_)),h.lightColor=d,h.customShader=L.Z.getValueOrUndefined(l._customShader,e),i[s.id].modelUpdated=!0,h.ready){let t=L.Z.getValueOrDefault(l._runAnimations,e,!0);c.animationsRunning!==t&&(t?h.activeAnimations.addAll({loop:mh.REPEAT}):h.activeAnimations.removeAll(),c.animationsRunning=t);let i=L.Z.getValueOrUndefined(l._nodeTransformations,e,c.nodeTransformationsScratch);if((0,_.Z)(i)){let e=Object.keys(i);for(let t=0,n=e.length;t<n;++t){let n=e[t],r=i[n];if(!(0,_.Z)(r))continue;let o=h.getNode(n);if(!(0,_.Z)(o))continue;let a=er.Z.fromTranslationRotationScale(r,yf);o.matrix=er.Z.multiply(o.originalMatrix,a,a)}}let n=!1,r=L.Z.getValueOrUndefined(l._articulations,e,c.articulationsScratch);if((0,_.Z)(r)){let e=Object.keys(r);for(let t=0,i=e.length;t<i;++t){let i=e[t],o=r[i];(0,_.Z)(o)&&(n=!0,h.setArticulationStage(i,o))}}n&&h.applyArticulations()}}return!0},yg.prototype.isDestroyed=function(){return!1},yg.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(yg.prototype._onCollectionChanged,this);let e=this._entitiesToVisualize.values,t=this._modelHash,i=this._primitives;for(let n=e.length-1;n>-1;n--)yv(this,e[n],t,i);return(0,g.Z)(this)};let yy=new S.Z,yb=new ea.Z;function yv(e,t,i,n){let r=i[t.id];(0,_.Z)(r)&&(n.removeAndDestroy(r.modelPrimitive),delete i[t.id])}yg.prototype.getBoundingSphere=function(e,t){if(!(0,_.Z)(e))throw new A.Z("entity is required.");if(!(0,_.Z)(t))throw new A.Z("result is required.");let i=this._modelHash[e.id];if(!(0,_.Z)(i)||i.loadFailed)return N.FAILED;let n=i.modelPrimitive;if(!(0,_.Z)(n)||!n.show||!n.ready||!i.modelUpdated)return N.PENDING;let r=this._scene,o=r.globe,a=(0,m.Z)(o?.ellipsoid,el.Z.WGS84);if(n.heightReference!==D.ZP.NONE){let e=n.modelMatrix;yy.x=e[12],yy.y=e[13],yy.z=e[14];let i=a.cartesianToCartographic(yy,yb),o=r.getHeight(i,n.heightReference);return(0,_.Z)(o)&&((0,D.c1)(n.heightReference)?i.height=o:i.height+=o),f.Z.clone(n.boundingSphere,t),t.center=a.cartographicToCartesian(i),N.DONE}return f.Z.clone(n.boundingSphere,t),N.DONE},yg.prototype._onCollectionChanged=function(e,t,i,n){let r,o;let a=this._entitiesToVisualize,s=this._modelHash,l=this._primitives;for(r=t.length-1;r>-1;r--)o=t[r],(0,_.Z)(o._model)&&(0,_.Z)(o._position)&&a.set(o.id,o);for(r=n.length-1;r>-1;r--)o=n[r],(0,_.Z)(o._model)&&(0,_.Z)(o._position)?(function(e,t){let i=t[e.id];(0,_.Z)(i)&&(i.nodeTransformationsScratch={},i.articulationsScratch={})}(o,s),a.set(o.id,o)):(yv(this,o,s,l),a.remove(o.id));for(r=i.length-1;r>-1;r--)yv(this,o=i[r],s,l),a.remove(o.id)};var yT=i(2944),yE=i(3905);function yx(e){e=(0,m.Z)(e,0),this._array=Array(e),this._length=e}Object.defineProperties(yx.prototype,{length:{get:function(){return this._length},set:function(e){p.Z.typeOf.number.greaterThanOrEquals("length",e,0);let t=this._array,i=this._length;if(e<i)for(let n=e;n<i;++n)t[n]=void 0;else e>t.length&&(t.length=e);this._length=e}},values:{get:function(){return this._array}}}),yx.prototype.get=function(e){return p.Z.typeOf.number.lessThan("index",e,this._array.length),this._array[e]},yx.prototype.set=function(e,t){p.Z.typeOf.number("index",e),e>=this._length&&(this.length=e+1),this._array[e]=t},yx.prototype.peek=function(){return this._array[this._length-1]},yx.prototype.push=function(e){let t=this.length++;this._array[t]=e},yx.prototype.pop=function(){if(0===this._length)return;let e=this._array[this._length-1];return--this.length,e},yx.prototype.reserve=function(e){p.Z.typeOf.number.greaterThanOrEquals("length",e,0),e>this._array.length&&(this._array.length=e)},yx.prototype.resize=function(e){p.Z.typeOf.number.greaterThanOrEquals("length",e,0),this.length=e},yx.prototype.trim=function(e){e=(0,m.Z)(e,this._length),this._array.length=e};var yw=i(8615),yS=i(487),yC=i(8664),yA=i(8041),yI=i(1731),yO=i(4433);function yD(e){e=(0,m.Z)(e,m.Z.EMPTY_OBJECT),p.Z.typeOf.object("options.metadata",e.metadata),this._metadata=e.metadata}function yP(e,t,i,n){this._tileset=e,this._tile=t,this._resource=i,(0,_.Z)(n)||(n=[]),this._contents=n,this._metadata=void 0,this._group=void 0,this._ready=!1}Object.defineProperties(yD.prototype,{metadata:{get:function(){return this._metadata}}}),Object.defineProperties(yP.prototype,{featurePropertiesDirty:{get:function(){let e=this._contents,t=e.length;for(let i=0;i<t;++i)if(e[i].featurePropertiesDirty)return!0;return!1},set:function(e){let t=this._contents,i=t.length;for(let n=0;n<i;++n)t[n].featurePropertiesDirty=e}},featuresLength:{get:function(){return 0}},pointsLength:{get:function(){return 0}},trianglesLength:{get:function(){return 0}},geometryByteLength:{get:function(){return 0}},texturesByteLength:{get:function(){return 0}},batchTableByteLength:{get:function(){return 0}},innerContents:{get:function(){return this._contents}},ready:{get:function(){return this._ready}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){return this._resource.getUrlComponent(!0)}},metadata:{get:function(){return this._metadata},set:function(e){this._metadata=e;let t=this._contents,i=t.length;for(let n=0;n<i;++n)t[n].metadata=e}},batchTable:{get:function(){}},group:{get:function(){return this._group},set:function(e){this._group=e;let t=this._contents,i=t.length;for(let n=0;n<i;++n)t[n].group=e}}});let yR=Uint32Array.BYTES_PER_ELEMENT;yP.fromTileType=async function(e,t,i,n,r,o){r=(0,m.Z)(r,0);let a=new Uint8Array(n),s=new DataView(n);r+=yR;let l=s.getUint32(r,!0);if(1!==l)throw new e3.Z(`Only Composite Tile version 1 is supported. Version ${l} is not.`);r+=yR+yR;let c=s.getUint32(r,!0);r+=yR;let u=i.queryParameters.compositeIndex;u=(0,_.Z)(u)?`${u}_`:"";let h=[];h.length=c;for(let l=0;l<c;++l){let c=h1(a,r),d=s.getUint32(r+2*yR,!0),f=o[c],p=`${u}${l}`,m=i.getDerivedResource({queryParameters:{compositeIndex:p}});if((0,_.Z)(f))h[l]=Promise.resolve(f(e,t,m,n,r));else throw new e3.Z(`Unknown tile content type, ${c}, inside Composite tile`);r+=d}return new yP(e,t,i,await Promise.all(h))},yP.prototype.hasProperty=function(e,t){return!1},yP.prototype.getFeature=function(e){},yP.prototype.applyDebugSettings=function(e,t){let i=this._contents,n=i.length;for(let r=0;r<n;++r)i[r].applyDebugSettings(e,t)},yP.prototype.applyStyle=function(e){let t=this._contents,i=t.length;for(let n=0;n<i;++n)t[n].applyStyle(e)},yP.prototype.update=function(e,t){let i=this._contents,n=i.length,r=!0;for(let o=0;o<n;++o)i[o].update(e,t),r=r&&i[o].ready;!this._ready&&r&&(this._ready=!0)},yP.prototype.pick=function(e,t,i){let n;if(!this._ready)return;let r=Number.POSITIVE_INFINITY,o=this._contents,a=o.length;for(let s=0;s<a;++s){let a=o[s].pick(e,t,i);if(!(0,_.Z)(a))continue;let l=S.Z.distance(e.origin,a);l<r&&(n=a,r=l)}if((0,_.Z)(n))return i},yP.prototype.isDestroyed=function(){return!1},yP.prototype.destroy=function(){let e=this._contents,t=e.length;for(let i=0;i<t;++i)e[i].destroy();return(0,g.Z)(this)};var yN=Object.freeze({HIGHLIGHT:0,REPLACE:1,MIX:2});let yL=mM.DEFAULT_COLOR_VALUE,yM=mM.DEFAULT_SHOW_VALUE;function yF(e,t,i,n,r){let o;this.featuresLength=t,(0,_.Z)(i)&&(o=i.extensions),this._extensions=(0,m.Z)(o,{});let a=function(e){let t={};if(!(0,_.Z)(e))return t;for(let i in e)e.hasOwnProperty(i)&&"HIERARCHY"!==i&&"extensions"!==i&&"extras"!==i&&(t[i]=(0,uz.Z)(e[i],!0));return t}(i);this._properties=a,this._batchTableHierarchy=function(e,t,i){if(!(0,_.Z)(t))return;let n=e._extensions["3DTILES_batch_table_hierarchy"],r=t.HIERARCHY;if((0,_.Z)(r)&&(yF._deprecationWarning("batchTableHierarchyExtension","The batch table HIERARCHY property has been moved to an extension. Use extensions.3DTILES_batch_table_hierarchy instead."),e._extensions["3DTILES_batch_table_hierarchy"]=r,n=r),(0,_.Z)(n))return new pG({extension:n,binaryBody:i})}(this,i,n);let s=yz(t,a,n);this._binaryPropertiesByteLength=function(e){if(!(0,_.Z)(e))return 0;let t=0;for(let i in e)e.hasOwnProperty(i)&&(t+=e[i].typedArray.byteLength);return t}(s),this._batchTableBinaryProperties=s,this._content=e,this._batchTexture=new mM({featuresLength:t,colorChangedCallback:r,owner:e,statistics:e.tileset.statistics})}function yz(e,t,i){let n;for(let r in t)if(t.hasOwnProperty(r)){let o=t[r],a=o.byteOffset;if((0,_.Z)(a)){let t=o.componentType,s=o.type;if(!(0,_.Z)(t))throw new e3.Z("componentType is required.");if(!(0,_.Z)(s))throw new e3.Z("type is required.");if(!(0,_.Z)(i))throw new e3.Z(`Property ${r} requires a batch table binary.`);let l=pH(o),c=l.componentsPerAttribute,u=l.classType,h=l.createArrayBufferView(i.buffer,i.byteOffset+a,e);(0,_.Z)(n)||(n={}),n[r]={typedArray:h,componentCount:c,type:u}}}return n}yF._deprecationWarning=hj.Z,Object.defineProperties(yF.prototype,{batchTableByteLength:{get:function(){let e=this._binaryPropertiesByteLength;return(0,_.Z)(this._batchTableHierarchy)&&(e+=this._batchTableHierarchy.byteLength),e+=this._batchTexture.byteLength}}}),yF.getBinaryProperties=function(e,t,i){return yz(e,t,i)},yF.prototype.setShow=function(e,t){this._batchTexture.setShow(e,t)},yF.prototype.setAllShow=function(e){this._batchTexture.setAllShow(e)},yF.prototype.getShow=function(e){return this._batchTexture.getShow(e)},yF.prototype.setColor=function(e,t){this._batchTexture.setColor(e,t)},yF.prototype.setAllColor=function(e){this._batchTexture.setAllColor(e)},yF.prototype.getColor=function(e,t){return this._batchTexture.getColor(e,t)},yF.prototype.getPickColor=function(e){return this._batchTexture.getPickColor(e)};let yB=new C.Z;function yU(e,t){if(!(0,_.Z)(e)||e<0||e>=t)throw new A.Z(`batchId is required and must be between zero and featuresLength - 1 (${t}`-NaN)}function yk(e,t){return(e=eY.Z.replaceMain(e,"tile_main"),t)?`${e}uniform float tile_colorBlend; void tile_color(vec4 tile_featureColor) { tile_main(); tile_featureColor = czm_gammaCorrect(tile_featureColor); out_FragColor.a *= tile_featureColor.a; float highlight = ceil(tile_colorBlend); out_FragColor.rgb *= mix(tile_featureColor.rgb, vec3(1.0), highlight); } `:`${e}void tile_color(vec4 tile_featureColor) { tile_main(); } `}function yV(e,t,i){let n;if(!(0,_.Z)(t))return yk(e,i);let r=RegExp(`(uniform|attribute|in)\\s+(vec[34]|sampler2D)\\s+${t};`),o=e.match(r);if(!(0,_.Z)(o))return yk(e,i);let a=o[0],s=o[2];if(e=(e=eY.Z.replaceMain(e,"tile_main")).replace(a,""),"vec3"===s||"vec4"===s){let i="vec3"===s?`vec4(${t}, 1.0)`:t;r=RegExp(t,"g"),e=e.replace(r,"vec3"===s?"tile_diffuse.xyz":"tile_diffuse"),n=` vec4 source = ${i}; tile_diffuse = tile_diffuse_final(source, tile_featureColor); tile_main(); `}else"sampler2D"===s&&(e=function(e,t){let i;let n=`texture(${t}`,r=0,o=e.indexOf(n,r);for(;o>-1;){let t=0;for(let n=o;n<e.length;++n){let r=e.charAt(n);if("("===r)++t;else if(")"===r&&0==--t){i=n+1;break}}let a=e.slice(o,i),s=`tile_diffuse_final(${a}, tile_diffuse)`;e=e.slice(0,o)+s+e.slice(i),r=o+s.length,o=e.indexOf(n,r)}return e}(e,t),n=" tile_diffuse = tile_featureColor; \n tile_main(); \n");return e=`uniform float tile_colorBlend; vec4 tile_diffuse = vec4(1.0); bool isWhite(vec3 color) { return all(greaterThan(color, vec3(1.0 - czm_epsilon3))); } vec4 tile_diffuse_final(vec4 sourceDiffuse, vec4 tileDiffuse) { vec4 blendDiffuse = mix(sourceDiffuse, tileDiffuse, tile_colorBlend); vec4 diffuse = isWhite(tileDiffuse.rgb) ? sourceDiffuse : blendDiffuse; return vec4(diffuse.rgb, sourceDiffuse.a); } ${a} ${e} void tile_color(vec4 tile_featureColor) { ${n}`,i&&(e+=" tile_featureColor = czm_gammaCorrect(tile_featureColor); \n out_FragColor.a *= tile_featureColor.a; \n float highlight = ceil(tile_colorBlend); \n out_FragColor.rgb *= mix(tile_featureColor.rgb, vec3(1.0), highlight); \n"),e+="} \n"}yF.prototype.applyStyle=function(e){if(!(0,_.Z)(e)){this.setAllColor(yL),this.setAllShow(yM);return}let t=this._content,i=this.featuresLength;for(let n=0;n<i;++n){let i=t.getFeature(n),r=(0,_.Z)(e.color)?(0,m.Z)(e.color.evaluateColor(i,yB),yL):yL,o=(0,_.Z)(e.show)?(0,m.Z)(e.show.evaluate(i),yM):yM;this.setColor(n,r),this.setShow(n,o)}},yF.prototype.isClass=function(e,t){yU(e,this.featuresLength),p.Z.typeOf.string("className",t);let i=this._batchTableHierarchy;return!!(0,_.Z)(i)&&i.isClass(e,t)},yF.prototype.isExactClass=function(e,t){return p.Z.typeOf.string("className",t),this.getExactClassName(e)===t},yF.prototype.getExactClassName=function(e){yU(e,this.featuresLength);let t=this._batchTableHierarchy;if((0,_.Z)(t))return t.getClassName(e)},yF.prototype.hasProperty=function(e,t){return yU(e,this.featuresLength),p.Z.typeOf.string("name",t),(0,_.Z)(this._properties[t])||(0,_.Z)(this._batchTableHierarchy)&&this._batchTableHierarchy.hasProperty(e,t)},yF.prototype.hasPropertyBySemantic=function(){return!1},yF.prototype.getPropertyIds=function(e,t){yU(e,this.featuresLength),(t=(0,_.Z)(t)?t:[]).length=0;let i=Object.keys(this._properties);return t.push.apply(t,i),(0,_.Z)(this._batchTableHierarchy)&&t.push.apply(t,this._batchTableHierarchy.getPropertyIds(e,i)),t},yF.prototype.getPropertyBySemantic=function(e,t){},yF.prototype.getProperty=function(e,t){if(yU(e,this.featuresLength),p.Z.typeOf.string("name",t),(0,_.Z)(this._batchTableBinaryProperties)){let i=this._batchTableBinaryProperties[t];if((0,_.Z)(i))return function(e,t){let i=e.typedArray,n=e.componentCount;return 1===n?i[t]:e.type.unpack(i,t*n)}(i,e)}let i=this._properties[t];if((0,_.Z)(i))return(0,uz.Z)(i[e],!0);if((0,_.Z)(this._batchTableHierarchy)){let i=this._batchTableHierarchy.getProperty(e,t);if((0,_.Z)(i))return i}},yF.prototype.setProperty=function(e,t,i){let n=this.featuresLength;if(yU(e,n),p.Z.typeOf.string("name",t),(0,_.Z)(this._batchTableBinaryProperties)){let n=this._batchTableBinaryProperties[t];if((0,_.Z)(n)){!function(e,t,i){let n=e.typedArray,r=e.componentCount;1===r?n[t]=i:e.type.pack(i,n,t*r)}(n,e,i);return}}if((0,_.Z)(this._batchTableHierarchy)&&this._batchTableHierarchy.setProperty(e,t,i))return;let r=this._properties[t];(0,_.Z)(r)||(this._properties[t]=Array(n),r=this._properties[t]),r[e]=(0,uz.Z)(i,!0)},yF.prototype.getVertexShaderCallback=function(e,t,i){if(0===this.featuresLength)return;let n=this;return function(r){let o;let a=yV(r,i,!1);return eH.Z.maximumVertexTextureImageUnits>0?(o="",e&&(o+="uniform bool tile_translucentCommand; \n"),o+=`uniform sampler2D tile_batchTexture; out vec4 tile_featureColor; out vec2 tile_featureSt; void main() { vec2 st = computeSt(${t}); vec4 featureProperties = texture(tile_batchTexture, st); tile_color(featureProperties); float show = ceil(featureProperties.a); gl_Position *= show; `,e&&(o+=" bool isStyleTranslucent = (featureProperties.a != 1.0); \n if (czm_pass == czm_passTranslucent) \n { \n if (!isStyleTranslucent && !tile_translucentCommand) \n { \n gl_Position *= 0.0; \n } \n } \n else \n { \n if (isStyleTranslucent) \n { \n gl_Position *= 0.0; \n } \n } \n"),o+=" tile_featureColor = featureProperties; \n tile_featureSt = st; \n}"):o=`out vec2 tile_featureSt; void main() { tile_color(vec4(1.0)); tile_featureSt = computeSt(${t}); }`,`${a} ${1===n._batchTexture.textureDimensions.y?"uniform vec4 tile_textureStep; \nvec2 computeSt(float batchId) \n{ \n float stepX = tile_textureStep.x; \n float centerX = tile_textureStep.y; \n return vec2(centerX + (batchId * stepX), 0.5); \n} \n":"uniform vec4 tile_textureStep; \nuniform vec2 tile_textureDimensions; \nvec2 computeSt(float batchId) \n{ \n float stepX = tile_textureStep.x; \n float centerX = tile_textureStep.y; \n float stepY = tile_textureStep.z; \n float centerY = tile_textureStep.w; \n float xId = mod(batchId, tile_textureDimensions.x); \n float yId = floor(batchId / tile_textureDimensions.x); \n return vec2(centerX + (xId * stepX), centerY + (yId * stepY)); \n} \n"}${o}`}},yF.prototype.getFragmentShaderCallback=function(e,t,i){if(0!==this.featuresLength)return function(n){return n=yV(n,t,!0),eH.Z.maximumVertexTextureImageUnits>0?(n+="uniform sampler2D tile_pickTexture; \nin vec2 tile_featureSt; \nin vec4 tile_featureColor; \nvoid main() \n{ \n tile_color(tile_featureColor); \n",i&&(n+=" out_FragColor.rgb *= out_FragColor.a; \n"),n+="}"):(e&&(n+="uniform bool tile_translucentCommand; \n"),n+="uniform sampler2D tile_pickTexture; \nuniform sampler2D tile_batchTexture; \nin vec2 tile_featureSt; \nvoid main() \n{ \n vec4 featureProperties = texture(tile_batchTexture, tile_featureSt); \n if (featureProperties.a == 0.0) { \n discard; \n } \n",e&&(n+=" bool isStyleTranslucent = (featureProperties.a != 1.0); \n if (czm_pass == czm_passTranslucent) \n { \n if (!isStyleTranslucent && !tile_translucentCommand) \n { \n discard; \n } \n } \n else \n { \n if (isStyleTranslucent) \n { \n discard; \n } \n } \n"),n+=" tile_color(featureProperties); \n",i&&(n+=" out_FragColor.rgb *= out_FragColor.a; \n"),n+="} \n"),n}},yF.prototype.getClassificationFragmentShaderCallback=function(){if(0!==this.featuresLength)return function(e){return e=eY.Z.replaceMain(e,"tile_main"),eH.Z.maximumVertexTextureImageUnits>0?e+="uniform sampler2D tile_pickTexture;\nin vec2 tile_featureSt; \nin vec4 tile_featureColor; \nvoid main() \n{ \n tile_main(); \n out_FragColor = tile_featureColor; \n out_FragColor.rgb *= out_FragColor.a; \n}":e+="uniform sampler2D tile_batchTexture; \nuniform sampler2D tile_pickTexture;\nin vec2 tile_featureSt; \nvoid main() \n{ \n tile_main(); \n vec4 featureProperties = texture(tile_batchTexture, tile_featureSt); \n if (featureProperties.a == 0.0) { \n discard; \n } \n out_FragColor = featureProperties; \n out_FragColor.rgb *= out_FragColor.a; \n} \n",e}},yF.prototype.getUniformMapCallback=function(){if(0===this.featuresLength)return;let e=this;return function(t){return(0,hv.Z)(t,{tile_batchTexture:function(){return(0,m.Z)(e._batchTexture.batchTexture,e._batchTexture.defaultTexture)},tile_textureDimensions:function(){return e._batchTexture.textureDimensions},tile_textureStep:function(){return e._batchTexture.textureStep},tile_colorBlend:function(){return function(e){let t=e._content.tileset,i=t.colorBlendMode,n=t.colorBlendAmount;if(i===yN.HIGHLIGHT)return 0;if(i===yN.REPLACE)return 1;if(i===yN.MIX)return eB.Z.clamp(n,eB.Z.EPSILON4,1);throw new A.Z(`Invalid color blend mode "${i}".`)}(e)},tile_pickTexture:function(){return e._batchTexture.pickTexture}})}},yF.prototype.getPickId=function(){return"texture(tile_pickTexture, tile_featureSt)"};let yH={ALL_OPAQUE:0,ALL_TRANSLUCENT:1,OPAQUE_AND_TRANSLUCENT:2};yF.prototype.addDerivedCommands=function(e,t){let i=e.commandList,n=i.length,r=this._content._tile,o=r._finalResolution,a=r.tileset,s=a.isSkippingLevelOfDetail&&a.hasMixedContent&&e.context.stencilBuffer,l=function(e){let t=e._batchTexture.translucentFeaturesLength;return 0===t?yH.ALL_OPAQUE:t===e.featuresLength?yH.ALL_TRANSLUCENT:yH.OPAQUE_AND_TRANSLUCENT}(this);for(let c=t;c<n;++c){let t=i[c];if(t.pass===ej.Z.COMPUTE)continue;let n=t.derivedCommands.tileset;(!(0,_.Z)(n)||t.dirty)&&(n={},t.derivedCommands.tileset=n,n.originalCommand=function(e){let t=eG.Z.shallowClone(e),i=t.pass===ej.Z.TRANSLUCENT;return t.uniformMap=(0,_.Z)(t.uniformMap)?t.uniformMap:{},t.uniformMap.tile_translucentCommand=function(){return i},t}(t),t.dirty=!1);let u=n.originalCommand;l===yH.ALL_OPAQUE||t.pass===ej.Z.TRANSLUCENT||(0,_.Z)(n.translucent)||(n.translucent=function(e){let t=eG.Z.shallowClone(e);return t.pass=ej.Z.TRANSLUCENT,t.renderState=function(e){let t=(0,uz.Z)(e,!0);return t.cull.enabled=!1,t.depthTest.enabled=!0,t.depthMask=!1,t.blending=eJ.Z.ALPHA_BLEND,t.stencilTest=pD.Z.setCesium3DTileBit(),t.stencilMask=pD.Z.CESIUM_3D_TILE_MASK,eW.Z.fromCache(t)}(e.renderState),t}(u)),l!==yH.ALL_TRANSLUCENT&&t.pass!==ej.Z.TRANSLUCENT&&((0,_.Z)(n.opaque)||(n.opaque=function(e){let t=eG.Z.shallowClone(e);return t.renderState=function(e){let t=(0,uz.Z)(e,!0);return t.stencilTest=pD.Z.setCesium3DTileBit(),t.stencilMask=pD.Z.CESIUM_3D_TILE_MASK,eW.Z.fromCache(t)}(e.renderState),t}(u)),s&&(o||((0,_.Z)(n.zback)||(n.zback=function(e,t){let i=eG.Z.shallowClone(t),n=(0,uz.Z)(i.renderState,!0);n.cull.enabled=!0,n.cull.face=dW.Z.FRONT,n.colorMask={red:!1,green:!1,blue:!1,alpha:!1},n.polygonOffset={enabled:!0,factor:5,units:5},n.stencilTest=pD.Z.setCesium3DTileBit(),n.stencilMask=pD.Z.CESIUM_3D_TILE_MASK,i.renderState=eW.Z.fromCache(n),i.castShadows=!1,i.receiveShadows=!1,i.uniformMap=(0,uz.Z)(t.uniformMap);let r=new w.Z(5,5);return i.uniformMap.u_polygonOffset=function(){return r},i.shaderProgram=function(e,t){let i=e.shaderCache.getDerivedShaderProgram(t,"zBackfaceLogDepth");if(!(0,_.Z)(i)){let n=t.fragmentShaderSource.clone();n.defines=(0,_.Z)(n.defines)?n.defines.slice(0):[],n.defines.push("POLYGON_OFFSET"),i=e.shaderCache.createDerivedShaderProgram(t,"zBackfaceLogDepth",{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:n,attributeLocations:t._attributeLocations})}return i}(e,t.shaderProgram),i}(e.context,u)),a._backfaceCommands.push(n.zback)),(0,_.Z)(n.stencil)&&r._selectionDepth===(n.stencil.renderState.stencilTest.reference&pD.Z.SKIP_LOD_MASK)>>>pD.Z.SKIP_LOD_BIT_SHIFT||(t.renderState.depthMask?n.stencil=function(e,t){let i=eG.Z.shallowClone(e),n=(0,uz.Z)(i.renderState,!0);return n.stencilTest.enabled=!0,n.stencilTest.mask=pD.Z.SKIP_LOD_MASK,n.stencilTest.reference=pD.Z.CESIUM_3D_TILE_MASK|t<<pD.Z.SKIP_LOD_BIT_SHIFT,n.stencilTest.frontFunction=mQ.Z.GREATER_OR_EQUAL,n.stencilTest.frontOperation.zPass=mJ.Z.REPLACE,n.stencilTest.backFunction=mQ.Z.GREATER_OR_EQUAL,n.stencilTest.backOperation.zPass=mJ.Z.REPLACE,n.stencilMask=pD.Z.CESIUM_3D_TILE_MASK|pD.Z.SKIP_LOD_MASK,i.renderState=eW.Z.fromCache(n),i}(u,r._selectionDepth):n.stencil=n.opaque)));let h=s?n.stencil:n.opaque,d=n.translucent;t.pass!==ej.Z.TRANSLUCENT?(l===yH.ALL_OPAQUE&&(i[c]=h),l===yH.ALL_TRANSLUCENT&&(i[c]=d),l===yH.OPAQUE_AND_TRANSLUCENT&&(i[c]=h,i.push(d))):i[c]=u}},yF.prototype.update=function(e,t){this._batchTexture.update(e,t)},yF.prototype.isDestroyed=function(){return!1},yF.prototype.destroy=function(){return this._batchTexture=this._batchTexture&&this._batchTexture.destroy(),(0,g.Z)(this)};var yG=function(e){this.offset=e.offset,this.count=e.count,this.color=e.color,this.batchIds=e.batchIds},yj=i(9762),yW="in vec3 position;\nin float a_batchId;\n\nuniform mat4 u_modifiedModelViewProjection;\n\nvoid main()\n{\n gl_Position = czm_depthClamp(u_modifiedModelViewProjection * vec4(position, 1.0));\n}\n";class yq{add(e,t,i){if("string"!=typeof arguments[0])for(let e in arguments[0])this.add(e,arguments[0][e],arguments[1]);else(Array.isArray(e)?e:[e]).forEach(function(e){this[e]=this[e]||[],t&&this[e][i?"unshift":"push"](t)},this)}run(e,t){this[e]=this[e]||[],this[e].forEach(function(e){e.call(t&&t.context?t.context:t,t)})}}class yY{constructor(e){this.jsep=e,this.registered={}}register(...e){e.forEach(e=>{if("object"!=typeof e||!e.name||!e.init)throw Error("Invalid JSEP plugin format");this.registered[e.name]||(e.init(this.jsep),this.registered[e.name]=e)})}}class yX{static get version(){return"1.3.8"}static toString(){return"JavaScript Expression Parser (JSEP) v"+yX.version}static addUnaryOp(e){return yX.max_unop_len=Math.max(e.length,yX.max_unop_len),yX.unary_ops[e]=1,yX}static addBinaryOp(e,t,i){return yX.max_binop_len=Math.max(e.length,yX.max_binop_len),yX.binary_ops[e]=t,i?yX.right_associative.add(e):yX.right_associative.delete(e),yX}static addIdentifierChar(e){return yX.additional_identifier_chars.add(e),yX}static addLiteral(e,t){return yX.literals[e]=t,yX}static removeUnaryOp(e){return delete yX.unary_ops[e],e.length===yX.max_unop_len&&(yX.max_unop_len=yX.getMaxKeyLen(yX.unary_ops)),yX}static removeAllUnaryOps(){return yX.unary_ops={},yX.max_unop_len=0,yX}static removeIdentifierChar(e){return yX.additional_identifier_chars.delete(e),yX}static removeBinaryOp(e){return delete yX.binary_ops[e],e.length===yX.max_binop_len&&(yX.max_binop_len=yX.getMaxKeyLen(yX.binary_ops)),yX.right_associative.delete(e),yX}static removeAllBinaryOps(){return yX.binary_ops={},yX.max_binop_len=0,yX}static removeLiteral(e){return delete yX.literals[e],yX}static removeAllLiterals(){return yX.literals={},yX}get char(){return this.expr.charAt(this.index)}get code(){return this.expr.charCodeAt(this.index)}constructor(e){this.expr=e,this.index=0}static parse(e){return new yX(e).parse()}static getMaxKeyLen(e){return Math.max(0,...Object.keys(e).map(e=>e.length))}static isDecimalDigit(e){return e>=48&&e<=57}static binaryPrecedence(e){return yX.binary_ops[e]||0}static isIdentifierStart(e){return e>=65&&e<=90||e>=97&&e<=122||e>=128&&!yX.binary_ops[String.fromCharCode(e)]||yX.additional_identifier_chars.has(String.fromCharCode(e))}static isIdentifierPart(e){return yX.isIdentifierStart(e)||yX.isDecimalDigit(e)}throwError(e){let t=Error(e+" at character "+this.index);throw t.index=this.index,t.description=e,t}runHook(e,t){if(yX.hooks[e]){let i={context:this,node:t};return yX.hooks.run(e,i),i.node}return t}searchHook(e){if(yX.hooks[e]){let t={context:this};return yX.hooks[e].find(function(e){return e.call(t.context,t),t.node}),t.node}}gobbleSpaces(){let e=this.code;for(;e===yX.SPACE_CODE||e===yX.TAB_CODE||e===yX.LF_CODE||e===yX.CR_CODE;)e=this.expr.charCodeAt(++this.index);this.runHook("gobble-spaces")}parse(){this.runHook("before-all");let e=this.gobbleExpressions(),t=1===e.length?e[0]:{type:yX.COMPOUND,body:e};return this.runHook("after-all",t)}gobbleExpressions(e){let t=[],i,n;for(;this.index<this.expr.length;)if((i=this.code)===yX.SEMCOL_CODE||i===yX.COMMA_CODE)this.index++;else if(n=this.gobbleExpression())t.push(n);else if(this.index<this.expr.length){if(i===e)break;this.throwError('Unexpected "'+this.char+'"')}return t}gobbleExpression(){let e=this.searchHook("gobble-expression")||this.gobbleBinaryExpression();return this.gobbleSpaces(),this.runHook("after-expression",e)}gobbleBinaryOp(){this.gobbleSpaces();let e=this.expr.substr(this.index,yX.max_binop_len),t=e.length;for(;t>0;){if(yX.binary_ops.hasOwnProperty(e)&&(!yX.isIdentifierStart(this.code)||this.index+e.length<this.expr.length&&!yX.isIdentifierPart(this.expr.charCodeAt(this.index+e.length))))return this.index+=t,e;e=e.substr(0,--t)}return!1}gobbleBinaryExpression(){let e,t,i,n,r,o,a,s,l;if(!(o=this.gobbleToken())||!(t=this.gobbleBinaryOp()))return o;for(r={value:t,prec:yX.binaryPrecedence(t),right_a:yX.right_associative.has(t)},(a=this.gobbleToken())||this.throwError("Expected expression after "+t),n=[o,r,a];t=this.gobbleBinaryOp();){if(0===(i=yX.binaryPrecedence(t))){this.index-=t.length;break}r={value:t,prec:i,right_a:yX.right_associative.has(t)},l=t;let s=e=>r.right_a&&e.right_a?i>e.prec:i<=e.prec;for(;n.length>2&&s(n[n.length-2]);)a=n.pop(),t=n.pop().value,o=n.pop(),e={type:yX.BINARY_EXP,operator:t,left:o,right:a},n.push(e);(e=this.gobbleToken())||this.throwError("Expected expression after "+l),n.push(r,e)}for(s=n.length-1,e=n[s];s>1;)e={type:yX.BINARY_EXP,operator:n[s-1].value,left:n[s-2],right:e},s-=2;return e}gobbleToken(){let e,t,i,n;if(this.gobbleSpaces(),n=this.searchHook("gobble-token"))return this.runHook("after-token",n);if(e=this.code,yX.isDecimalDigit(e)||e===yX.PERIOD_CODE)return this.gobbleNumericLiteral();if(e===yX.SQUOTE_CODE||e===yX.DQUOTE_CODE)n=this.gobbleStringLiteral();else if(e===yX.OBRACK_CODE)n=this.gobbleArray();else{for(i=(t=this.expr.substr(this.index,yX.max_unop_len)).length;i>0;){if(yX.unary_ops.hasOwnProperty(t)&&(!yX.isIdentifierStart(this.code)||this.index+t.length<this.expr.length&&!yX.isIdentifierPart(this.expr.charCodeAt(this.index+t.length)))){this.index+=i;let e=this.gobbleToken();return e||this.throwError("missing unaryOp argument"),this.runHook("after-token",{type:yX.UNARY_EXP,operator:t,argument:e,prefix:!0})}t=t.substr(0,--i)}yX.isIdentifierStart(e)?(n=this.gobbleIdentifier(),yX.literals.hasOwnProperty(n.name)?n={type:yX.LITERAL,value:yX.literals[n.name],raw:n.name}:n.name===yX.this_str&&(n={type:yX.THIS_EXP})):e===yX.OPAREN_CODE&&(n=this.gobbleGroup())}return n?(n=this.gobbleTokenProperty(n),this.runHook("after-token",n)):this.runHook("after-token",!1)}gobbleTokenProperty(e){this.gobbleSpaces();let t=this.code;for(;t===yX.PERIOD_CODE||t===yX.OBRACK_CODE||t===yX.OPAREN_CODE||t===yX.QUMARK_CODE;){let i;if(t===yX.QUMARK_CODE){if(this.expr.charCodeAt(this.index+1)!==yX.PERIOD_CODE)break;i=!0,this.index+=2,this.gobbleSpaces(),t=this.code}this.index++,t===yX.OBRACK_CODE?(e={type:yX.MEMBER_EXP,computed:!0,object:e,property:this.gobbleExpression()},this.gobbleSpaces(),(t=this.code)!==yX.CBRACK_CODE&&this.throwError("Unclosed ["),this.index++):t===yX.OPAREN_CODE?e={type:yX.CALL_EXP,arguments:this.gobbleArguments(yX.CPAREN_CODE),callee:e}:(t===yX.PERIOD_CODE||i)&&(i&&this.index--,this.gobbleSpaces(),e={type:yX.MEMBER_EXP,computed:!1,object:e,property:this.gobbleIdentifier()}),i&&(e.optional=!0),this.gobbleSpaces(),t=this.code}return e}gobbleNumericLiteral(){let e="",t,i;for(;yX.isDecimalDigit(this.code);)e+=this.expr.charAt(this.index++);if(this.code===yX.PERIOD_CODE)for(e+=this.expr.charAt(this.index++);yX.isDecimalDigit(this.code);)e+=this.expr.charAt(this.index++);if("e"===(t=this.char)||"E"===t){for(e+=this.expr.charAt(this.index++),("+"===(t=this.char)||"-"===t)&&(e+=this.expr.charAt(this.index++));yX.isDecimalDigit(this.code);)e+=this.expr.charAt(this.index++);yX.isDecimalDigit(this.expr.charCodeAt(this.index-1))||this.throwError("Expected exponent ("+e+this.char+")")}return i=this.code,yX.isIdentifierStart(i)?this.throwError("Variable names cannot start with a number ("+e+this.char+")"):(i===yX.PERIOD_CODE||1===e.length&&e.charCodeAt(0)===yX.PERIOD_CODE)&&this.throwError("Unexpected period"),{type:yX.LITERAL,value:parseFloat(e),raw:e}}gobbleStringLiteral(){let e="",t=this.index,i=this.expr.charAt(this.index++),n=!1;for(;this.index<this.expr.length;){let t=this.expr.charAt(this.index++);if(t===i){n=!0;break}if("\\"===t)switch(t=this.expr.charAt(this.index++)){case"n":e+="\n";break;case"r":e+="\r";break;case"t":e+=" ";break;case"b":e+="\b";break;case"f":e+="\f";break;case"v":e+="\v";break;default:e+=t}else e+=t}return n||this.throwError('Unclosed quote after "'+e+'"'),{type:yX.LITERAL,value:e,raw:this.expr.substring(t,this.index)}}gobbleIdentifier(){let e=this.code,t=this.index;for(yX.isIdentifierStart(e)?this.index++:this.throwError("Unexpected "+this.char);this.index<this.expr.length;)if(e=this.code,yX.isIdentifierPart(e))this.index++;else break;return{type:yX.IDENTIFIER,name:this.expr.slice(t,this.index)}}gobbleArguments(e){let t=[],i=!1,n=0;for(;this.index<this.expr.length;){this.gobbleSpaces();let r=this.code;if(r===e){i=!0,this.index++,e===yX.CPAREN_CODE&&n&&n>=t.length&&this.throwError("Unexpected token "+String.fromCharCode(e));break}if(r===yX.COMMA_CODE){if(this.index++,++n!==t.length){if(e===yX.CPAREN_CODE)this.throwError("Unexpected token ,");else if(e===yX.CBRACK_CODE)for(let e=t.length;e<n;e++)t.push(null)}}else if(t.length!==n&&0!==n)this.throwError("Expected comma");else{let e=this.gobbleExpression();e&&e.type!==yX.COMPOUND||this.throwError("Expected comma"),t.push(e)}}return i||this.throwError("Expected "+String.fromCharCode(e)),t}gobbleGroup(){this.index++;let e=this.gobbleExpressions(yX.CPAREN_CODE);if(this.code===yX.CPAREN_CODE)return(this.index++,1===e.length)?e[0]:!!e.length&&{type:yX.SEQUENCE_EXP,expressions:e};this.throwError("Unclosed (")}gobbleArray(){return this.index++,{type:yX.ARRAY_EXP,elements:this.gobbleArguments(yX.CBRACK_CODE)}}}Object.assign(yX,{hooks:new yq,plugins:new yY(yX),COMPOUND:"Compound",SEQUENCE_EXP:"SequenceExpression",IDENTIFIER:"Identifier",MEMBER_EXP:"MemberExpression",LITERAL:"Literal",THIS_EXP:"ThisExpression",CALL_EXP:"CallExpression",UNARY_EXP:"UnaryExpression",BINARY_EXP:"BinaryExpression",ARRAY_EXP:"ArrayExpression",TAB_CODE:9,LF_CODE:10,CR_CODE:13,SPACE_CODE:32,PERIOD_CODE:46,COMMA_CODE:44,SQUOTE_CODE:39,DQUOTE_CODE:34,OPAREN_CODE:40,CPAREN_CODE:41,OBRACK_CODE:91,CBRACK_CODE:93,QUMARK_CODE:63,SEMCOL_CODE:59,COLON_CODE:58,unary_ops:{"-":1,"!":1,"~":1,"+":1},binary_ops:{"||":1,"&&":2,"|":3,"^":4,"&":5,"==":6,"!=":6,"===":6,"!==":6,"<":7,">":7,"<=":7,">=":7,"<<":8,">>":8,">>>":8,"+":9,"-":9,"*":10,"/":10,"%":10},right_associative:new Set,additional_identifier_chars:new Set(["$","_"]),literals:{true:!0,false:!1,null:null},this_str:"this"}),yX.max_unop_len=yX.getMaxKeyLen(yX.unary_ops),yX.max_binop_len=yX.getMaxKeyLen(yX.binary_ops);let y$=e=>new yX(e).parse();Object.getOwnPropertyNames(yX).forEach(e=>{void 0===y$[e]&&"prototype"!==e&&(y$[e]=yX[e])}),y$.Jsep=yX,y$.plugins.register({name:"ternary",init(e){e.hooks.add("after-expression",function(t){if(t.node&&this.code===e.QUMARK_CODE){this.index++;let i=t.node,n=this.gobbleExpression();if(n||this.throwError("Expected expression"),this.gobbleSpaces(),this.code===e.COLON_CODE){this.index++;let r=this.gobbleExpression();if(r||this.throwError("Expected expression"),t.node={type:"ConditionalExpression",test:i,consequent:n,alternate:r},i.operator&&e.binary_ops[i.operator]<=.9){let n=i;for(;n.right.operator&&e.binary_ops[n.right.operator]<=.9;)n=n.right;t.node.test=n.right,n.right=t.node,t.node=i}}else this.throwError("Expected :")}})}});var yK=Object.freeze({VARIABLE:0,UNARY:1,BINARY:2,TERNARY:3,CONDITIONAL:4,MEMBER:5,FUNCTION_CALL:6,ARRAY:7,REGEX:8,VARIABLE_IN_STRING:9,LITERAL_NULL:10,LITERAL_BOOLEAN:11,LITERAL_NUMBER:12,LITERAL_STRING:13,LITERAL_COLOR:14,LITERAL_VECTOR:15,LITERAL_REGEX:16,LITERAL_UNDEFINED:17,BUILTIN_VARIABLE:18});function yQ(e,t){let i;p.Z.typeOf.string("expression",e),this._expression=e,e=function(e){let t=e,i="",n=t.indexOf("${");for(;n>=0;){let e;let r=t.indexOf("'"),o=t.indexOf('"');if(r>=0&&r<n)e=t.indexOf("'",r+1),i+=t.substr(0,e+1),n=(t=t.substr(e+1)).indexOf("${");else if(o>=0&&o<n)e=t.indexOf('"',o+1),i+=t.substr(0,e+1),n=(t=t.substr(e+1)).indexOf("${");else{i+=t.substr(0,n);let e=t.indexOf("}");if(e<0)throw new e3.Z("Unmatched {.");i+=`czm_${t.substr(n+2,e-(n+2))}`,n=(t=t.substr(e+1)).indexOf("${")}}return i+t}((e=function(e,t){if(!(0,_.Z)(t))return e;for(let i in t)if(t.hasOwnProperty(i)){let n=RegExp(`\\$\\{${i}\\}`,"g"),r=`(${t[i]})`;(0,_.Z)(r)&&(e=e.replace(n,r))}return e}(e,t)).replace(y3,"@#%")),y$.addBinaryOp("=~",0),y$.addBinaryOp("!~",0);try{i=y$(e)}catch(e){throw new e3.Z(e)}this._runtimeAst=function e(t,i){let n,r,o,a;if("Literal"===i.type)n=function(e){let t=typeof e.value;return null===e.value?new bi(yK.LITERAL_NULL,null):"boolean"===t?new bi(yK.LITERAL_BOOLEAN,e.value):"number"===t?new bi(yK.LITERAL_NUMBER,e.value):"string"===t?e.value.indexOf("${")>=0?new bi(yK.VARIABLE_IN_STRING,e.value):new bi(yK.LITERAL_STRING,bn(e.value)):void 0}(i);else if("CallExpression"===i.type)n=function(t,i){let n,r,o,a;let s=i.arguments,l=s.length;if("MemberExpression"===i.callee.type){n=i.callee.property.name;let c=i.callee.object;if("test"===n||"exec"===n){if(!(0,_.Z)(c.callee)||"regExp"!==c.callee.name)throw new e3.Z(`${n} is not a function.`);return 0===l?"test"===n?new bi(yK.LITERAL_BOOLEAN,!1):new bi(yK.LITERAL_NULL,null):(o=e(t,c),a=e(t,s[0]),new bi(yK.FUNCTION_CALL,n,o,a))}if("toString"===n)return r=e(t,c),new bi(yK.FUNCTION_CALL,n,r);throw new e3.Z(`Unexpected function call "${n}".`)}if("color"===(n=i.callee.name)){if(0===l)return new bi(yK.LITERAL_COLOR,n);if(r=e(t,s[0]),(0,_.Z)(s[1])){let i=e(t,s[1]);return new bi(yK.LITERAL_COLOR,n,[r,i])}return new bi(yK.LITERAL_COLOR,n,[r])}if("rgb"===n||"hsl"===n){if(l<3)throw new e3.Z(`${n} requires three arguments.`);return r=[e(t,s[0]),e(t,s[1]),e(t,s[2])],new bi(yK.LITERAL_COLOR,n,r)}if("rgba"===n||"hsla"===n){if(l<4)throw new e3.Z(`${n} requires four arguments.`);return r=[e(t,s[0]),e(t,s[1]),e(t,s[2]),e(t,s[3])],new bi(yK.LITERAL_COLOR,n,r)}if("vec2"===n||"vec3"===n||"vec4"===n){r=Array(l);for(let i=0;i<l;++i)r[i]=e(t,s[i]);return new bi(yK.LITERAL_VECTOR,n,r)}if("isNaN"===n||"isFinite"===n)return 0===l?"isNaN"===n?new bi(yK.LITERAL_BOOLEAN,!0):new bi(yK.LITERAL_BOOLEAN,!1):(r=e(t,s[0]),new bi(yK.UNARY,n,r));if("isExactClass"===n||"isClass"===n){if(l<1||l>1)throw new e3.Z(`${n} requires exactly one argument.`);return r=e(t,s[0]),new bi(yK.UNARY,n,r)}if("getExactClassName"===n){if(l>0)throw new e3.Z(`${n} does not take any argument.`);return new bi(yK.UNARY,n)}else if((0,_.Z)(y9[n])){if(1!==l)throw new e3.Z(`${n} requires exactly one argument.`);return r=e(t,s[0]),new bi(yK.UNARY,n,r)}else if((0,_.Z)(y8[n])){if(2!==l)throw new e3.Z(`${n} requires exactly two arguments.`);return o=e(t,s[0]),a=e(t,s[1]),new bi(yK.BINARY,n,o,a)}else if((0,_.Z)(y6[n])){if(3!==l)throw new e3.Z(`${n} requires exactly three arguments.`);o=e(t,s[0]),a=e(t,s[1]);let i=e(t,s[2]);return new bi(yK.TERNARY,n,o,a,i)}else if("Boolean"===n)return 0===l?new bi(yK.LITERAL_BOOLEAN,!1):(r=e(t,s[0]),new bi(yK.UNARY,n,r));else if("Number"===n)return 0===l?new bi(yK.LITERAL_NUMBER,0):(r=e(t,s[0]),new bi(yK.UNARY,n,r));else if("String"===n)return 0===l?new bi(yK.LITERAL_STRING,""):(r=e(t,s[0]),new bi(yK.UNARY,n,r));else if("regExp"===n)return function(t,i){let n;let r=i.arguments;if(0===r.length)return new bi(yK.LITERAL_REGEX,RegExp());let o=e(t,r[0]);if(r.length>1){let i=e(t,r[1]);if(br(o)&&br(i)){try{n=new RegExp(bn(String(o._value)),i._value)}catch(e){throw new e3.Z(e)}return new bi(yK.LITERAL_REGEX,n)}return new bi(yK.REGEX,o,i)}if(br(o)){try{n=new RegExp(bn(String(o._value)))}catch(e){throw new e3.Z(e)}return new bi(yK.LITERAL_REGEX,n)}return new bi(yK.REGEX,o)}(t,i);throw new e3.Z(`Unexpected function call "${n}".`)}(t,i);else if("Identifier"===i.type)n=function(e){if("czm_"===e.name.substr(0,4)){let t=e.name.substr(4);return"tiles3d_"===t.substr(0,8)?new bi(yK.BUILTIN_VARIABLE,t):new bi(yK.VARIABLE,t)}if("NaN"===e.name)return new bi(yK.LITERAL_NUMBER,NaN);if("Infinity"===e.name)return new bi(yK.LITERAL_NUMBER,1/0);if("undefined"===e.name)return new bi(yK.LITERAL_UNDEFINED,void 0);throw new e3.Z(`${e.name} is not defined.`)}(i);else if("UnaryExpression"===i.type){r=i.operator;let o=e(t,i.argument);if(y0.indexOf(r)>-1)n=new bi(yK.UNARY,r,o);else throw new e3.Z(`Unexpected operator "${r}".`)}else if("BinaryExpression"===i.type){if(r=i.operator,o=e(t,i.left),a=e(t,i.right),y1.indexOf(r)>-1)n=new bi(yK.BINARY,r,o,a);else throw new e3.Z(`Unexpected operator "${r}".`)}else if("LogicalExpression"===i.type)r=i.operator,o=e(t,i.left),a=e(t,i.right),y1.indexOf(r)>-1&&(n=new bi(yK.BINARY,r,o,a));else if("ConditionalExpression"===i.type){let r=e(t,i.test);o=e(t,i.consequent),a=e(t,i.alternate),n=new bi(yK.CONDITIONAL,"?",o,a,r)}else if("MemberExpression"===i.type)n=function(t,i){let n;if("Math"===i.object.name)return function(e){let t=e.property.name;return"PI"===t?new bi(yK.LITERAL_NUMBER,Math.PI):"E"===t?new bi(yK.LITERAL_NUMBER,Math.E):void 0}(i);if("Number"===i.object.name)return function(e){if("POSITIVE_INFINITY"===e.property.name)return new bi(yK.LITERAL_NUMBER,Number.POSITIVE_INFINITY)}(i);let r=e(t,i.object);return i.computed?(n=e(t,i.property),new bi(yK.MEMBER,"brackets",r,n)):(n=new bi(yK.LITERAL_STRING,i.property.name),new bi(yK.MEMBER,"dot",r,n))}(t,i);else if("ArrayExpression"===i.type){let r=[];for(let n=0;n<i.elements.length;n++)r[n]=e(t,i.elements[n]);n=new bi(yK.ARRAY,r)}else if("Compound"===i.type)throw new e3.Z("Provide exactly one expression.");else throw new e3.Z("Cannot parse expression.");return n}(this,i)}Object.defineProperties(yQ.prototype,{expression:{get:function(){return this._expression}}});let yJ={arrayIndex:0,arrayArray:[[]],cartesian2Index:0,cartesian3Index:0,cartesian4Index:0,cartesian2Array:[new w.Z],cartesian3Array:[new S.Z],cartesian4Array:[new eo.Z],reset:function(){this.arrayIndex=0,this.cartesian2Index=0,this.cartesian3Index=0,this.cartesian4Index=0},getArray:function(){this.arrayIndex>=this.arrayArray.length&&this.arrayArray.push([]);let e=this.arrayArray[this.arrayIndex++];return e.length=0,e},getCartesian2:function(){return this.cartesian2Index>=this.cartesian2Array.length&&this.cartesian2Array.push(new w.Z),this.cartesian2Array[this.cartesian2Index++]},getCartesian3:function(){return this.cartesian3Index>=this.cartesian3Array.length&&this.cartesian3Array.push(new S.Z),this.cartesian3Array[this.cartesian3Index++]},getCartesian4:function(){return this.cartesian4Index>=this.cartesian4Array.length&&this.cartesian4Array.push(new eo.Z),this.cartesian4Array[this.cartesian4Index++]}};yQ.prototype.evaluate=function(e,t){yJ.reset();let i=this._runtimeAst.evaluate(e);return t instanceof C.Z&&i instanceof eo.Z?C.Z.fromCartesian4(i,t):i instanceof w.Z||i instanceof S.Z||i instanceof eo.Z?i.clone(t):i},yQ.prototype.evaluateColor=function(e,t){yJ.reset();let i=this._runtimeAst.evaluate(e);return C.Z.fromCartesian4(i,t)},yQ.prototype.getShaderFunction=function(e,t,i,n){let r=this.getShaderExpression(t,i);return`${n} ${e} { return ${r}; } `},yQ.prototype.getShaderExpression=function(e,t){return this._runtimeAst.getShaderExpression(e,t)},yQ.prototype.getVariables=function(){let e=[];return this._runtimeAst.getVariables(e),e=e.filter(function(e,t,i){return i.indexOf(e)===t})};let y0=["!","-","+"],y1=["+","-","*","/","%","===","!==",">",">=","<","<=","&&","||","!~","=~"],y2=/\${(.*?)}/g,y3=/\\/g,y4=/@#%/g,y5=new C.Z,y9={abs:y7(Math.abs),sqrt:y7(Math.sqrt),cos:y7(Math.cos),sin:y7(Math.sin),tan:y7(Math.tan),acos:y7(Math.acos),asin:y7(Math.asin),atan:y7(Math.atan),radians:y7(eB.Z.toRadians),degrees:y7(eB.Z.toDegrees),sign:y7(eB.Z.sign),floor:y7(Math.floor),ceil:y7(Math.ceil),round:y7(Math.round),exp:y7(Math.exp),exp2:y7(function(e){return Math.pow(2,e)}),log:y7(Math.log),log2:y7(function(e){return eB.Z.log2(e)}),fract:y7(function(e){return e-Math.floor(e)}),length:function(e,t){if("number"==typeof t)return Math.abs(t);if(t instanceof w.Z)return w.Z.magnitude(t);if(t instanceof S.Z)return S.Z.magnitude(t);if(t instanceof eo.Z)return eo.Z.magnitude(t);throw new e3.Z(`Function "${e}" requires a vector or number argument. Argument is ${t}.`)},normalize:function(e,t){if("number"==typeof t)return 1;if(t instanceof w.Z)return w.Z.normalize(t,yJ.getCartesian2());if(t instanceof S.Z)return S.Z.normalize(t,yJ.getCartesian3());if(t instanceof eo.Z)return eo.Z.normalize(t,yJ.getCartesian4());throw new e3.Z(`Function "${e}" requires a vector or number argument. Argument is ${t}.`)}},y8={atan2:be(Math.atan2,!1),pow:be(Math.pow,!1),min:be(Math.min,!0),max:be(Math.max,!0),distance:function(e,t,i){if("number"==typeof t&&"number"==typeof i)return Math.abs(t-i);if(t instanceof w.Z&&i instanceof w.Z)return w.Z.distance(t,i);if(t instanceof S.Z&&i instanceof S.Z)return S.Z.distance(t,i);if(t instanceof eo.Z&&i instanceof eo.Z)return eo.Z.distance(t,i);throw new e3.Z(`Function "${e}" requires vector or number arguments of matching types. Arguments are ${t} and ${i}.`)},dot:function(e,t,i){if("number"==typeof t&&"number"==typeof i)return t*i;if(t instanceof w.Z&&i instanceof w.Z)return w.Z.dot(t,i);if(t instanceof S.Z&&i instanceof S.Z)return S.Z.dot(t,i);if(t instanceof eo.Z&&i instanceof eo.Z)return eo.Z.dot(t,i);throw new e3.Z(`Function "${e}" requires vector or number arguments of matching types. Arguments are ${t} and ${i}.`)},cross:function(e,t,i){if(t instanceof S.Z&&i instanceof S.Z)return S.Z.cross(t,i,yJ.getCartesian3());throw new e3.Z(`Function "${e}" requires vec3 arguments. Arguments are ${t} and ${i}.`)}},y6={clamp:bt(eB.Z.clamp,!0),mix:bt(eB.Z.lerp,!0)};function y7(e){return function(t,i){if("number"==typeof i)return e(i);if(i instanceof w.Z)return w.Z.fromElements(e(i.x),e(i.y),yJ.getCartesian2());if(i instanceof S.Z)return S.Z.fromElements(e(i.x),e(i.y),e(i.z),yJ.getCartesian3());if(i instanceof eo.Z)return eo.Z.fromElements(e(i.x),e(i.y),e(i.z),e(i.w),yJ.getCartesian4());throw new e3.Z(`Function "${t}" requires a vector or number argument. Argument is ${i}.`)}}function be(e,t){return function(i,n,r){if(t&&"number"==typeof r){if("number"==typeof n)return e(n,r);if(n instanceof w.Z)return w.Z.fromElements(e(n.x,r),e(n.y,r),yJ.getCartesian2());if(n instanceof S.Z)return S.Z.fromElements(e(n.x,r),e(n.y,r),e(n.z,r),yJ.getCartesian3());if(n instanceof eo.Z)return eo.Z.fromElements(e(n.x,r),e(n.y,r),e(n.z,r),e(n.w,r),yJ.getCartesian4())}if("number"==typeof n&&"number"==typeof r)return e(n,r);if(n instanceof w.Z&&r instanceof w.Z)return w.Z.fromElements(e(n.x,r.x),e(n.y,r.y),yJ.getCartesian2());if(n instanceof S.Z&&r instanceof S.Z)return S.Z.fromElements(e(n.x,r.x),e(n.y,r.y),e(n.z,r.z),yJ.getCartesian3());if(n instanceof eo.Z&&r instanceof eo.Z)return eo.Z.fromElements(e(n.x,r.x),e(n.y,r.y),e(n.z,r.z),e(n.w,r.w),yJ.getCartesian4());throw new e3.Z(`Function "${i}" requires vector or number arguments of matching types. Arguments are ${n} and ${r}.`)}}function bt(e,t){return function(i,n,r,o){if(t&&"number"==typeof o){if("number"==typeof n&&"number"==typeof r)return e(n,r,o);if(n instanceof w.Z&&r instanceof w.Z)return w.Z.fromElements(e(n.x,r.x,o),e(n.y,r.y,o),yJ.getCartesian2());if(n instanceof S.Z&&r instanceof S.Z)return S.Z.fromElements(e(n.x,r.x,o),e(n.y,r.y,o),e(n.z,r.z,o),yJ.getCartesian3());if(n instanceof eo.Z&&r instanceof eo.Z)return eo.Z.fromElements(e(n.x,r.x,o),e(n.y,r.y,o),e(n.z,r.z,o),e(n.w,r.w,o),yJ.getCartesian4())}if("number"==typeof n&&"number"==typeof r&&"number"==typeof o)return e(n,r,o);if(n instanceof w.Z&&r instanceof w.Z&&o instanceof w.Z)return w.Z.fromElements(e(n.x,r.x,o.x),e(n.y,r.y,o.y),yJ.getCartesian2());if(n instanceof S.Z&&r instanceof S.Z&&o instanceof S.Z)return S.Z.fromElements(e(n.x,r.x,o.x),e(n.y,r.y,o.y),e(n.z,r.z,o.z),yJ.getCartesian3());if(n instanceof eo.Z&&r instanceof eo.Z&&o instanceof eo.Z)return eo.Z.fromElements(e(n.x,r.x,o.x),e(n.y,r.y,o.y),e(n.z,r.z,o.z),e(n.w,r.w,o.w),yJ.getCartesian4());throw new e3.Z(`Function "${i}" requires vector or number arguments of matching types. Arguments are ${n}, ${r}, and ${o}.`)}}function bi(e,t,i,n,r){this._type=e,this._value=t,this._left=i,this._right=n,this._test=r,this.evaluate=void 0,this._type===yK.CONDITIONAL?this.evaluate=this._evaluateConditional:this._type===yK.FUNCTION_CALL?"test"===this._value?this.evaluate=this._evaluateRegExpTest:"exec"===this._value?this.evaluate=this._evaluateRegExpExec:"toString"===this._value&&(this.evaluate=this._evaluateToString):this._type===yK.UNARY?"!"===this._value?this.evaluate=this._evaluateNot:"-"===this._value?this.evaluate=this._evaluateNegative:"+"===this._value?this.evaluate=this._evaluatePositive:"isNaN"===this._value?this.evaluate=this._evaluateNaN:"isFinite"===this._value?this.evaluate=this._evaluateIsFinite:"isExactClass"===this._value?this.evaluate=this._evaluateIsExactClass:"isClass"===this._value?this.evaluate=this._evaluateIsClass:"getExactClassName"===this._value?this.evaluate=this._evaluateGetExactClassName:"Boolean"===this._value?this.evaluate=this._evaluateBooleanConversion:"Number"===this._value?this.evaluate=this._evaluateNumberConversion:"String"===this._value?this.evaluate=this._evaluateStringConversion:(0,_.Z)(y9[this._value])&&(this.evaluate=function(e){let t=y9[e];return function(i){return t(e,this._left.evaluate(i))}}(this._value)):this._type===yK.BINARY?"+"===this._value?this.evaluate=this._evaluatePlus:"-"===this._value?this.evaluate=this._evaluateMinus:"*"===this._value?this.evaluate=this._evaluateTimes:"/"===this._value?this.evaluate=this._evaluateDivide:"%"===this._value?this.evaluate=this._evaluateMod:"==="===this._value?this.evaluate=this._evaluateEqualsStrict:"!=="===this._value?this.evaluate=this._evaluateNotEqualsStrict:"<"===this._value?this.evaluate=this._evaluateLessThan:"<="===this._value?this.evaluate=this._evaluateLessThanOrEquals:">"===this._value?this.evaluate=this._evaluateGreaterThan:">="===this._value?this.evaluate=this._evaluateGreaterThanOrEquals:"&&"===this._value?this.evaluate=this._evaluateAnd:"||"===this._value?this.evaluate=this._evaluateOr:"=~"===this._value?this.evaluate=this._evaluateRegExpMatch:"!~"===this._value?this.evaluate=this._evaluateRegExpNotMatch:(0,_.Z)(y8[this._value])&&(this.evaluate=function(e){let t=y8[e];return function(i){return t(e,this._left.evaluate(i),this._right.evaluate(i))}}(this._value)):this._type===yK.TERNARY?this.evaluate=function(e){let t=y6[e];return function(i){return t(e,this._left.evaluate(i),this._right.evaluate(i),this._test.evaluate(i))}}(this._value):this._type===yK.MEMBER?"brackets"===this._value?this.evaluate=this._evaluateMemberBrackets:this.evaluate=this._evaluateMemberDot:this._type===yK.ARRAY?this.evaluate=this._evaluateArray:this._type===yK.VARIABLE?this.evaluate=this._evaluateVariable:this._type===yK.VARIABLE_IN_STRING?this.evaluate=this._evaluateVariableString:this._type===yK.LITERAL_COLOR?this.evaluate=this._evaluateLiteralColor:this._type===yK.LITERAL_VECTOR?this.evaluate=this._evaluateLiteralVector:this._type===yK.LITERAL_STRING?this.evaluate=this._evaluateLiteralString:this._type===yK.REGEX?this.evaluate=this._evaluateRegExp:this._type===yK.BUILTIN_VARIABLE?"tiles3d_tileset_time"===this._value&&(this.evaluate=bo):this.evaluate=this._evaluateLiteral}function bn(e){return e.replace(y4,"\\")}function br(e){return e._type>=yK.LITERAL_NULL}function bo(e){return(0,_.Z)(e)?e.content.tileset.timeSinceLoad:0}function ba(e,t){if((0,_.Z)(e))return e.getPropertyInherited(t)}function bs(e){return"feature"===e._value}function bl(e){let t=e._left,i=t.length;for(let e=0;e<i;++e)if(t[e]._type!==yK.LITERAL_NUMBER)return;let n=t[0]._value,r=t[1]._value,o=t[2]._value,a=4===i?t[3]._value:1;return C.Z.fromHsl(n,r,o,a,y5)}function bc(e){let t=e._left,i=t.length;for(let e=0;e<i;++e)if(t[e]._type!==yK.LITERAL_NUMBER)return;return y5.red=t[0]._value/255,y5.green=t[1]._value/255,y5.blue=t[2]._value/255,y5.alpha=4===i?t[3]._value:1,y5}function bu(e){return e%1==0?e.toFixed(1):e.toString()}function bh(e){let t=bu(e.red),i=bu(e.green),n=bu(e.blue),r=bu(e.alpha);return`vec4(${t}, ${i}, ${n}, ${r})`}function bd(e,t,i,n){let r=e.length,o=Array(r);for(let a=0;a<r;++a)o[a]=e[a].getShaderExpression(t,i,n);return o}function bf(e,t){return(0,_.Z)(t[e])?t[e]:yQ.NULL_SENTINEL}function bp(e){e=(0,m.Z)(e,m.Z.EMPTY_OBJECT),this._batchTable=e.batchTable,this._batchIds=e.batchIds,this._positions=e.positions,this._vertexBatchIds=e.vertexBatchIds,this._indices=e.indices,this._indexCounts=e.indexCounts,this._indexOffsets=e.indexOffsets,this._batchedIndices=e.batchedIndices,this._boundingVolume=e.boundingVolume,this._boundingVolumes=e.boundingVolumes,this._center=(0,m.Z)(e.center,S.Z.ZERO),this._va=void 0,this._sp=void 0,this._spStencil=void 0,this._spPick=void 0,this._uniformMap=void 0,this._vaSwap=void 0,this._rsStencilDepthPass=void 0,this._rsStencilDepthPass3DTiles=void 0,this._rsColorPass=void 0,this._rsPickPass=void 0,this._rsWireframe=void 0,this._commands=[],this._commandsIgnoreShow=[],this._pickCommands=[],this._constantColor=C.Z.clone(C.Z.WHITE),this._highlightColor=this._constantColor,this._batchDirty=!0,this._pickCommandsDirty=!0,this._framesSinceLastRebatch=0,this._updatingAllCommands=!1,this._trianglesLength=this._indices.length/3,this._geometryByteLength=this._indices.byteLength+this._positions.byteLength+this._vertexBatchIds.byteLength,this.debugWireframe=!1,this._debugWireframe=this.debugWireframe,this._wireframeDirty=!1,this.forceRebatch=!1,this.classificationType=(0,m.Z)(e.classificationType,nd.Z.BOTH),this._vertexShaderSource=e._vertexShaderSource,this._fragmentShaderSource=e._fragmentShaderSource,this._attributeLocations=e._attributeLocations,this._uniformMap=e._uniformMap,this._pickId=e._pickId,this._modelMatrix=e._modelMatrix,this._boundingSphere=e._boundingSphere,this._batchIdLookUp={};let t=this._batchIds.length;for(let e=0;e<t;++e){let t=this._batchIds[e];this._batchIdLookUp[t]=e}}bi.prototype._evaluateLiteral=function(){return this._value},bi.prototype._evaluateLiteralColor=function(e){let t=this._left;if("color"===this._value)(0,_.Z)(t)?t.length>1?(C.Z.fromCssColorString(t[0].evaluate(e),y5),y5.alpha=t[1].evaluate(e)):C.Z.fromCssColorString(t[0].evaluate(e),y5):C.Z.fromBytes(255,255,255,255,y5);else if("rgb"===this._value)C.Z.fromBytes(t[0].evaluate(e),t[1].evaluate(e),t[2].evaluate(e),255,y5);else if("rgba"===this._value){let i=255*t[3].evaluate(e);C.Z.fromBytes(t[0].evaluate(e),t[1].evaluate(e),t[2].evaluate(e),i,y5)}else"hsl"===this._value?C.Z.fromHsl(t[0].evaluate(e),t[1].evaluate(e),t[2].evaluate(e),1,y5):"hsla"===this._value&&C.Z.fromHsl(t[0].evaluate(e),t[1].evaluate(e),t[2].evaluate(e),t[3].evaluate(e),y5);return eo.Z.fromColor(y5,yJ.getCartesian4())},bi.prototype._evaluateLiteralVector=function(e){let t=yJ.getArray(),i=this._value,n=this._left,r=n.length;for(let o=0;o<r;++o){let r=n[o].evaluate(e);if("number"==typeof r)t.push(r);else if(r instanceof w.Z)t.push(r.x,r.y);else if(r instanceof S.Z)t.push(r.x,r.y,r.z);else if(r instanceof eo.Z)t.push(r.x,r.y,r.z,r.w);else throw new e3.Z(`${i} argument must be a vector or number. Argument is ${r}.`)}let o=t.length,a=parseInt(i.charAt(3));if(0===o)throw new e3.Z(`Invalid ${i} constructor. No valid arguments.`);if(o<a&&o>1)throw new e3.Z(`Invalid ${i} constructor. Not enough arguments.`);if(o>a&&r>1)throw new e3.Z(`Invalid ${i} constructor. Too many arguments.`);if(1===o){let e=t[0];t.push(e,e,e)}return"vec2"===i?w.Z.fromArray(t,0,yJ.getCartesian2()):"vec3"===i?S.Z.fromArray(t,0,yJ.getCartesian3()):"vec4"===i?eo.Z.fromArray(t,0,yJ.getCartesian4()):void 0},bi.prototype._evaluateLiteralString=function(){return this._value},bi.prototype._evaluateVariableString=function(e){let t=this._value,i=y2.exec(t);for(;null!==i;){let n=i[0],r=ba(e,i[1]);(0,_.Z)(r)||(r=""),t=t.replace(n,r),i=y2.exec(t)}return t},bi.prototype._evaluateVariable=function(e){return ba(e,this._value)},bi.prototype._evaluateMemberDot=function(e){if(bs(this._left))return ba(e,this._right.evaluate(e));let t=this._left.evaluate(e);if(!(0,_.Z)(t))return;let i=this._right.evaluate(e);if(t instanceof w.Z||t instanceof S.Z||t instanceof eo.Z){if("r"===i)return t.x;if("g"===i)return t.y;if("b"===i)return t.z;if("a"===i)return t.w}return t[i]},bi.prototype._evaluateMemberBrackets=function(e){if(bs(this._left))return ba(e,this._right.evaluate(e));let t=this._left.evaluate(e);if(!(0,_.Z)(t))return;let i=this._right.evaluate(e);if(t instanceof w.Z||t instanceof S.Z||t instanceof eo.Z){if(0===i||"r"===i)return t.x;if(1===i||"g"===i)return t.y;if(2===i||"b"===i)return t.z;if(3===i||"a"===i)return t.w}return t[i]},bi.prototype._evaluateArray=function(e){let t=[];for(let i=0;i<this._value.length;i++)t[i]=this._value[i].evaluate(e);return t},bi.prototype._evaluateNot=function(e){let t=this._left.evaluate(e);if("boolean"!=typeof t)throw new e3.Z(`Operator "!" requires a boolean argument. Argument is ${t}.`);return!t},bi.prototype._evaluateNegative=function(e){let t=this._left.evaluate(e);if(t instanceof w.Z)return w.Z.negate(t,yJ.getCartesian2());if(t instanceof S.Z)return S.Z.negate(t,yJ.getCartesian3());if(t instanceof eo.Z)return eo.Z.negate(t,yJ.getCartesian4());if("number"==typeof t)return-t;throw new e3.Z(`Operator "-" requires a vector or number argument. Argument is ${t}.`)},bi.prototype._evaluatePositive=function(e){let t=this._left.evaluate(e);if(!(t instanceof w.Z||t instanceof S.Z||t instanceof eo.Z||"number"==typeof t))throw new e3.Z(`Operator "+" requires a vector or number argument. Argument is ${t}.`);return t},bi.prototype._evaluateLessThan=function(e){let t=this._left.evaluate(e),i=this._right.evaluate(e);if("number"!=typeof t||"number"!=typeof i)throw new e3.Z(`Operator "<" requires number arguments. Arguments are ${t} and ${i}.`);return t<i},bi.prototype._evaluateLessThanOrEquals=function(e){let t=this._left.evaluate(e),i=this._right.evaluate(e);if("number"!=typeof t||"number"!=typeof i)throw new e3.Z(`Operator "<=" requires number arguments. Arguments are ${t} and ${i}.`);return t<=i},bi.prototype._evaluateGreaterThan=function(e){let t=this._left.evaluate(e),i=this._right.evaluate(e);if("number"!=typeof t||"number"!=typeof i)throw new e3.Z(`Operator ">" requires number arguments. Arguments are ${t} and ${i}.`);return t>i},bi.prototype._evaluateGreaterThanOrEquals=function(e){let t=this._left.evaluate(e),i=this._right.evaluate(e);if("number"!=typeof t||"number"!=typeof i)throw new e3.Z(`Operator ">=" requires number arguments. Arguments are ${t} and ${i}.`);return t>=i},bi.prototype._evaluateOr=function(e){let t=this._left.evaluate(e);if("boolean"!=typeof t)throw new e3.Z(`Operator "||" requires boolean arguments. First argument is ${t}.`);if(t)return!0;let i=this._right.evaluate(e);if("boolean"!=typeof i)throw new e3.Z(`Operator "||" requires boolean arguments. Second argument is ${i}.`);return t||i},bi.prototype._evaluateAnd=function(e){let t=this._left.evaluate(e);if("boolean"!=typeof t)throw new e3.Z(`Operator "&&" requires boolean arguments. First argument is ${t}.`);if(!t)return!1;let i=this._right.evaluate(e);if("boolean"!=typeof i)throw new e3.Z(`Operator "&&" requires boolean arguments. Second argument is ${i}.`);return t&&i},bi.prototype._evaluatePlus=function(e){let t=this._left.evaluate(e),i=this._right.evaluate(e);if(i instanceof w.Z&&t instanceof w.Z)return w.Z.add(t,i,yJ.getCartesian2());if(i instanceof S.Z&&t instanceof S.Z)return S.Z.add(t,i,yJ.getCartesian3());if(i instanceof eo.Z&&t instanceof eo.Z)return eo.Z.add(t,i,yJ.getCartesian4());if("string"==typeof t||"string"==typeof i||"number"==typeof t&&"number"==typeof i)return t+i;throw new e3.Z(`Operator "+" requires vector or number arguments of matching types, or at least one string argument. Arguments are ${t} and ${i}.`)},bi.prototype._evaluateMinus=function(e){let t=this._left.evaluate(e),i=this._right.evaluate(e);if(i instanceof w.Z&&t instanceof w.Z)return w.Z.subtract(t,i,yJ.getCartesian2());if(i instanceof S.Z&&t instanceof S.Z)return S.Z.subtract(t,i,yJ.getCartesian3());if(i instanceof eo.Z&&t instanceof eo.Z)return eo.Z.subtract(t,i,yJ.getCartesian4());if("number"==typeof t&&"number"==typeof i)return t-i;throw new e3.Z(`Operator "-" requires vector or number arguments of matching types. Arguments are ${t} and ${i}.`)},bi.prototype._evaluateTimes=function(e){let t=this._left.evaluate(e),i=this._right.evaluate(e);if(i instanceof w.Z&&t instanceof w.Z)return w.Z.multiplyComponents(t,i,yJ.getCartesian2());if(i instanceof w.Z&&"number"==typeof t)return w.Z.multiplyByScalar(i,t,yJ.getCartesian2());if(t instanceof w.Z&&"number"==typeof i)return w.Z.multiplyByScalar(t,i,yJ.getCartesian2());if(i instanceof S.Z&&t instanceof S.Z)return S.Z.multiplyComponents(t,i,yJ.getCartesian3());if(i instanceof S.Z&&"number"==typeof t)return S.Z.multiplyByScalar(i,t,yJ.getCartesian3());if(t instanceof S.Z&&"number"==typeof i)return S.Z.multiplyByScalar(t,i,yJ.getCartesian3());if(i instanceof eo.Z&&t instanceof eo.Z)return eo.Z.multiplyComponents(t,i,yJ.getCartesian4());else if(i instanceof eo.Z&&"number"==typeof t)return eo.Z.multiplyByScalar(i,t,yJ.getCartesian4());else if(t instanceof eo.Z&&"number"==typeof i)return eo.Z.multiplyByScalar(t,i,yJ.getCartesian4());else if("number"==typeof t&&"number"==typeof i)return t*i;throw new e3.Z(`Operator "*" requires vector or number arguments. If both arguments are vectors they must be matching types. Arguments are ${t} and ${i}.`)},bi.prototype._evaluateDivide=function(e){let t=this._left.evaluate(e),i=this._right.evaluate(e);if(i instanceof w.Z&&t instanceof w.Z)return w.Z.divideComponents(t,i,yJ.getCartesian2());if(t instanceof w.Z&&"number"==typeof i)return w.Z.divideByScalar(t,i,yJ.getCartesian2());if(i instanceof S.Z&&t instanceof S.Z)return S.Z.divideComponents(t,i,yJ.getCartesian3());if(t instanceof S.Z&&"number"==typeof i)return S.Z.divideByScalar(t,i,yJ.getCartesian3());if(i instanceof eo.Z&&t instanceof eo.Z)return eo.Z.divideComponents(t,i,yJ.getCartesian4());if(t instanceof eo.Z&&"number"==typeof i)return eo.Z.divideByScalar(t,i,yJ.getCartesian4());if("number"==typeof t&&"number"==typeof i)return t/i;throw new e3.Z(`Operator "/" requires vector or number arguments of matching types, or a number as the second argument. Arguments are ${t} and ${i}.`)},bi.prototype._evaluateMod=function(e){let t=this._left.evaluate(e),i=this._right.evaluate(e);if(i instanceof w.Z&&t instanceof w.Z)return w.Z.fromElements(t.x%i.x,t.y%i.y,yJ.getCartesian2());if(i instanceof S.Z&&t instanceof S.Z)return S.Z.fromElements(t.x%i.x,t.y%i.y,t.z%i.z,yJ.getCartesian3());if(i instanceof eo.Z&&t instanceof eo.Z)return eo.Z.fromElements(t.x%i.x,t.y%i.y,t.z%i.z,t.w%i.w,yJ.getCartesian4());if("number"==typeof t&&"number"==typeof i)return t%i;throw new e3.Z(`Operator "%" requires vector or number arguments of matching types. Arguments are ${t} and ${i}.`)},bi.prototype._evaluateEqualsStrict=function(e){let t=this._left.evaluate(e),i=this._right.evaluate(e);return i instanceof w.Z&&t instanceof w.Z||i instanceof S.Z&&t instanceof S.Z||i instanceof eo.Z&&t instanceof eo.Z?t.equals(i):t===i},bi.prototype._evaluateNotEqualsStrict=function(e){let t=this._left.evaluate(e),i=this._right.evaluate(e);return i instanceof w.Z&&t instanceof w.Z||i instanceof S.Z&&t instanceof S.Z||i instanceof eo.Z&&t instanceof eo.Z?!t.equals(i):t!==i},bi.prototype._evaluateConditional=function(e){let t=this._test.evaluate(e);if("boolean"!=typeof t)throw new e3.Z(`Conditional argument of conditional expression must be a boolean. Argument is ${t}.`);return t?this._left.evaluate(e):this._right.evaluate(e)},bi.prototype._evaluateNaN=function(e){return isNaN(this._left.evaluate(e))},bi.prototype._evaluateIsFinite=function(e){return isFinite(this._left.evaluate(e))},bi.prototype._evaluateIsExactClass=function(e){return!!(0,_.Z)(e)&&e.isExactClass(this._left.evaluate(e))},bi.prototype._evaluateIsClass=function(e){return!!(0,_.Z)(e)&&e.isClass(this._left.evaluate(e))},bi.prototype._evaluateGetExactClassName=function(e){if((0,_.Z)(e))return e.getExactClassName()},bi.prototype._evaluateBooleanConversion=function(e){return!!this._left.evaluate(e)},bi.prototype._evaluateNumberConversion=function(e){return Number(this._left.evaluate(e))},bi.prototype._evaluateStringConversion=function(e){return String(this._left.evaluate(e))},bi.prototype._evaluateRegExp=function(e){let t;let i=this._value.evaluate(e),n="";(0,_.Z)(this._left)&&(n=this._left.evaluate(e));try{t=new RegExp(i,n)}catch(e){throw new e3.Z(e)}return t},bi.prototype._evaluateRegExpTest=function(e){let t=this._left.evaluate(e),i=this._right.evaluate(e);if(!(t instanceof RegExp&&"string"==typeof i))throw new e3.Z(`RegExp.test requires the first argument to be a RegExp and the second argument to be a string. Arguments are ${t} and ${i}.`);return t.test(i)},bi.prototype._evaluateRegExpMatch=function(e){let t=this._left.evaluate(e),i=this._right.evaluate(e);if(t instanceof RegExp&&"string"==typeof i)return t.test(i);if(i instanceof RegExp&&"string"==typeof t)return i.test(t);throw new e3.Z(`Operator "=~" requires one RegExp argument and one string argument. Arguments are ${t} and ${i}.`)},bi.prototype._evaluateRegExpNotMatch=function(e){let t=this._left.evaluate(e),i=this._right.evaluate(e);if(t instanceof RegExp&&"string"==typeof i)return!t.test(i);if(i instanceof RegExp&&"string"==typeof t)return!i.test(t);throw new e3.Z(`Operator "!~" requires one RegExp argument and one string argument. Arguments are ${t} and ${i}.`)},bi.prototype._evaluateRegExpExec=function(e){let t=this._left.evaluate(e),i=this._right.evaluate(e);if(!(t instanceof RegExp&&"string"==typeof i))throw new e3.Z(`RegExp.exec requires the first argument to be a RegExp and the second argument to be a string. Arguments are ${t} and ${i}.`);let n=t.exec(i);return(0,_.Z)(n)?n[1]:null},bi.prototype._evaluateToString=function(e){let t=this._left.evaluate(e);if(t instanceof RegExp||t instanceof w.Z||t instanceof S.Z||t instanceof eo.Z)return String(t);throw new e3.Z(`Unexpected function call "${this._value}".`)},yQ.NULL_SENTINEL="czm_infinity",bi.prototype.getShaderExpression=function(e,t,i){let n,r,o,a,s,l,c;let u=this._type,h=this._value;switch((0,_.Z)(this._left)&&(r=Array.isArray(this._left)?bd(this._left,e,t,this):this._left.getShaderExpression(e,t,this)),(0,_.Z)(this._right)&&(o=this._right.getShaderExpression(e,t,this)),(0,_.Z)(this._test)&&(a=this._test.getShaderExpression(e,t,this)),Array.isArray(this._value)&&(h=bd(this._value,e,t,this)),u){case yK.VARIABLE:if(bs(this))return;return bf(h,e);case yK.UNARY:if("Boolean"===h)return`bool(${r})`;if("Number"===h)return`float(${r})`;if("round"===h)return`floor(${r} + 0.5)`;if((0,_.Z)(y9[h]))return`${h}(${r})`;else if("isNaN"===h)return`(${r} != ${r})`;else if("isFinite"===h)return`(abs(${r}) < czm_infinity)`;else if("String"===h||"isExactClass"===h||"isClass"===h||"getExactClassName"===h)throw new e3.Z(`Error generating style shader: "${h}" is not supported.`);return h+r;case yK.BINARY:if("%"===h)return`mod(${r}, ${o})`;if("==="===h)return`(${r} == ${o})`;if("!=="===h)return`(${r} != ${o})`;if("atan2"===h)return`atan(${r}, ${o})`;else if((0,_.Z)(y8[h]))return`${h}(${r}, ${o})`;return`(${r} ${h} ${o})`;case yK.TERNARY:if((0,_.Z)(y6[h]))return`${h}(${r}, ${o}, ${a})`;break;case yK.CONDITIONAL:return`(${a} ? ${r} : ${o})`;case yK.MEMBER:if(bs(this._left))return bf(o,e);if("r"===o||"x"===o||"0.0"===o)return`${r}[0]`;if("g"===o||"y"===o||"1.0"===o)return`${r}[1]`;if("b"===o||"z"===o||"2.0"===o)return`${r}[2]`;if("a"===o||"w"===o||"3.0"===o)return`${r}[3]`;return`${r}[int(${o})]`;case yK.FUNCTION_CALL:throw new e3.Z(`Error generating style shader: "${h}" is not supported.`);case yK.ARRAY:if(4===h.length)return`vec4(${h[0]}, ${h[1]}, ${h[2]}, ${h[3]})`;if(3===h.length)return`vec3(${h[0]}, ${h[1]}, ${h[2]})`;if(2===h.length)return`vec2(${h[0]}, ${h[1]})`;throw new e3.Z("Error generating style shader: Invalid array length. Array length should be 2, 3, or 4.");case yK.REGEX:throw new e3.Z("Error generating style shader: Regular expressions are not supported.");case yK.VARIABLE_IN_STRING:throw new e3.Z("Error generating style shader: Converting a variable to a string is not supported.");case yK.LITERAL_NULL:return yQ.NULL_SENTINEL;case yK.LITERAL_BOOLEAN:return h?"true":"false";case yK.LITERAL_NUMBER:return bu(h);case yK.LITERAL_STRING:if((0,_.Z)(i)&&i._type===yK.MEMBER&&("r"===h||"g"===h||"b"===h||"a"===h||"x"===h||"y"===h||"z"===h||"w"===h||bs(i._left)))return h;if(n=C.Z.fromCssColorString(h,y5),(0,_.Z)(n))return function(e){let t=bu(e.red),i=bu(e.green),n=bu(e.blue);return`vec3(${t}, ${i}, ${n})`}(n);throw new e3.Z("Error generating style shader: String literals are not supported.");case yK.LITERAL_COLOR:if(s=r,"color"===h){if(!(0,_.Z)(s))return"vec4(1.0)";if(s.length>1){let e=s[0],i=s[1];return"1.0"!==i&&(t.translucent=!0),`vec4(${e}, ${i})`}return`vec4(${s[0]}, 1.0)`}if("rgb"===h){if(n=bc(this),(0,_.Z)(n))return bh(n);return`vec4(${s[0]} / 255.0, ${s[1]} / 255.0, ${s[2]} / 255.0, 1.0)`}if("rgba"===h){if("1.0"!==s[3]&&(t.translucent=!0),n=bc(this),(0,_.Z)(n))return bh(n);return`vec4(${s[0]} / 255.0, ${s[1]} / 255.0, ${s[2]} / 255.0, ${s[3]})`}if("hsl"===h){if(n=bl(this),(0,_.Z)(n))return bh(n);return`vec4(czm_HSLToRGB(vec3(${s[0]}, ${s[1]}, ${s[2]})), 1.0)`}else if("hsla"===h){if(n=bl(this),(0,_.Z)(n))return 1!==n.alpha&&(t.translucent=!0),bh(n);return"1.0"!==s[3]&&(t.translucent=!0),`vec4(czm_HSLToRGB(vec3(${s[0]}, ${s[1]}, ${s[2]})), ${s[3]})`}break;case yK.LITERAL_VECTOR:if(!(0,_.Z)(r))throw new A.Z("left should always be defined for type ExpressionNodeType.LITERAL_VECTOR");l=r.length,c=`${h}(`;for(let e=0;e<l;++e)c+=r[e],e<l-1&&(c+=", ");return c+")";case yK.LITERAL_REGEX:throw new e3.Z("Error generating style shader: Regular expressions are not supported.");case yK.LITERAL_UNDEFINED:return yQ.NULL_SENTINEL;case yK.BUILTIN_VARIABLE:if("tiles3d_tileset_time"===h)return h}},bi.prototype.getVariables=function(e,t){let i,n,r,o;let a=this._type,s=this._value;if((0,_.Z)(this._left)){if(Array.isArray(this._left))for(r=0,n=(i=this._left).length;r<n;++r)i[r].getVariables(e,this);else this._left.getVariables(e,this)}if((0,_.Z)(this._right)&&this._right.getVariables(e,this),(0,_.Z)(this._test)&&this._test.getVariables(e,this),Array.isArray(this._value))for(r=0,n=(i=this._value).length;r<n;++r)i[r].getVariables(e,this);switch(a){case yK.VARIABLE:bs(this)||e.push(s);break;case yK.VARIABLE_IN_STRING:for(o=y2.exec(s);null!==o;)e.push(o[1]),o=y2.exec(s);break;case yK.LITERAL_STRING:(0,_.Z)(t)&&t._type===yK.MEMBER&&bs(t._left)&&e.push(s)}},Object.defineProperties(bp.prototype,{trianglesLength:{get:function(){return this._trianglesLength}},geometryByteLength:{get:function(){return this._geometryByteLength}}});let bm={position:0,a_batchId:1};function b_(e){let t=e?mQ.Z.EQUAL:mQ.Z.ALWAYS;return{colorMask:{red:!1,green:!1,blue:!1,alpha:!1},stencilTest:{enabled:!0,frontFunction:t,frontOperation:{fail:mJ.Z.KEEP,zFail:mJ.Z.DECREMENT_WRAP,zPass:mJ.Z.KEEP},backFunction:t,backOperation:{fail:mJ.Z.KEEP,zFail:mJ.Z.INCREMENT_WRAP,zPass:mJ.Z.KEEP},reference:pD.Z.CESIUM_3D_TILE_MASK,mask:pD.Z.CESIUM_3D_TILE_MASK},stencilMask:pD.Z.CLASSIFICATION_MASK,depthTest:{enabled:!0,func:mK.Z.LESS_OR_EQUAL},depthMask:!1}}let bg={stencilTest:{enabled:!0,frontFunction:mQ.Z.NOT_EQUAL,frontOperation:{fail:mJ.Z.ZERO,zFail:mJ.Z.ZERO,zPass:mJ.Z.ZERO},backFunction:mQ.Z.NOT_EQUAL,backOperation:{fail:mJ.Z.ZERO,zFail:mJ.Z.ZERO,zPass:mJ.Z.ZERO},reference:0,mask:pD.Z.CLASSIFICATION_MASK},stencilMask:pD.Z.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1,blending:eJ.Z.PRE_MULTIPLIED_ALPHA_BLEND},bZ={stencilTest:{enabled:!0,frontFunction:mQ.Z.NOT_EQUAL,frontOperation:{fail:mJ.Z.ZERO,zFail:mJ.Z.ZERO,zPass:mJ.Z.ZERO},backFunction:mQ.Z.NOT_EQUAL,backOperation:{fail:mJ.Z.ZERO,zFail:mJ.Z.ZERO,zPass:mJ.Z.ZERO},reference:0,mask:pD.Z.CLASSIFICATION_MASK},stencilMask:pD.Z.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1},by=new er.Z,bb=new S.Z;function bv(e,t,i,n,r,o,a){let s=e.constructor.BYTES_PER_ELEMENT,l=o.length;for(let c=0;c<l;++c){let l=a[o[c]],u=n[l],h=r[l],d=new e.constructor(e.buffer,s*u,h);t.set(d,i),n[l]=i,i+=h}return i}function bT(e,t,i,n,r,o,a){let s=e.bytesPerIndex,l=o.length;for(let c=0;c<l;++c){let l=a[o[c]],u=n[l],h=r[l];t.copyFromBuffer(e,u*s,i*s,h*s),n[l]=i,i+=h}return i}function bE(e,t){return t.color.toRgba()-e.color.toRgba()}bp.prototype.createFeatures=function(e,t){let i=this._batchIds,n=i.length;for(let r=0;r<n;++r){let n=i[r];t[n]=new mH.Z(e,n)}},bp.prototype.applyDebugSettings=function(e,t){this._highlightColor=e?t:this._constantColor};let bx=new C.Z,bw=C.Z.WHITE,bS=/\$/;function bC(e,t,i,n){let r,o;let a=e.classificationType,s=a!==nd.Z.CESIUM_3D_TILE,l=a!==nd.Z.TERRAIN,c=t.commandList,u=i.length;for(o=0;o<u;++o)s&&((r=i[o]).pass=ej.Z.TERRAIN_CLASSIFICATION,c.push(r)),l&&((r=i[o].derivedCommands.tileset).pass=ej.Z.CESIUM_3D_TILE_CLASSIFICATION,c.push(r));if(t.invertClassification&&(0,_.Z)(n))for(o=0,u=n.length;o<u;++o)c.push(n[o])}function bA(e){this._boxes=e.boxes,this._boxBatchIds=e.boxBatchIds,this._cylinders=e.cylinders,this._cylinderBatchIds=e.cylinderBatchIds,this._ellipsoids=e.ellipsoids,this._ellipsoidBatchIds=e.ellipsoidBatchIds,this._spheres=e.spheres,this._sphereBatchIds=e.sphereBatchIds,this._modelMatrix=e.modelMatrix,this._batchTable=e.batchTable,this._boundingVolume=e.boundingVolume,this._center=e.center,(0,_.Z)(this._center)||((0,_.Z)(this._boundingVolume)?this._center=S.Z.clone(this._boundingVolume.center):this._center=S.Z.clone(S.Z.ZERO)),this._boundingVolumes=void 0,this._batchedIndices=void 0,this._indices=void 0,this._indexOffsets=void 0,this._indexCounts=void 0,this._positions=void 0,this._vertexBatchIds=void 0,this._batchIds=void 0,this._batchTableColors=void 0,this._packedBuffer=void 0,this._ready=!1,this._promise=void 0,this._error=void 0,this._verticesPromise=void 0,this._primitive=void 0,this.debugWireframe=!1,this.forceRebatch=!1,this.classificationType=nd.Z.BOTH}bp.prototype.applyStyle=function(e,t){let i;if(!(0,_.Z)(e)){!function(e,t){let i;e._updatingAllCommands=!0;let n=e._batchIds,r=n.length;for(i=0;i<r;++i){let e=t[n[i]];e.show=!0,e.color=C.Z.WHITE}let o=e._batchedIndices;for(i=0,r=o.length;i<r;++i)o[i].color=C.Z.clone(C.Z.WHITE);e._updatingAllCommands=!1,e._batchDirty=!0}(this,t);return}let n=e.color,r=n instanceof yQ&&!bS.test(n.expression);this._updatingAllCommands=r;let o=this._batchIds,a=o.length;for(i=0;i<a;++i){let n=t[o[i]];n.color=(0,_.Z)(e.color)?e.color.evaluateColor(n,bx):bw,n.show=!(0,_.Z)(e.show)||e.show.evaluate(n)}if(r){let e=this._batchedIndices;for(i=0,a=e.length;i<a;++i)e[i].color=C.Z.clone(C.Z.WHITE);this._updatingAllCommands=!1,this._batchDirty=!0}},bp.prototype.updateCommands=function(e,t){let i;if(this._updatingAllCommands)return;let n=this._batchIdLookUp,r=n[e];if(!(0,_.Z)(r))return;let o=this._indexOffsets,a=this._indexCounts,s=o[r],l=a[r],c=this._batchedIndices,u=c.length;for(i=0;i<u;++i){let e=c[i].offset,t=c[i].count;if(s>=e&&s<e+t)break}c.push(new yG({color:C.Z.clone(t),offset:s,count:l,batchIds:[e]}));let h=[],d=[],f=c[i].batchIds,p=f.length;for(let t=0;t<p;++t){let i=f[t];i!==e&&(o[n[i]]<s?h.push(i):d.push(i))}0!==d.length&&c.push(new yG({color:C.Z.clone(c[i].color),offset:s+l,count:c[i].offset+c[i].count-(s+l),batchIds:d})),0!==h.length?(c[i].count=s-c[i].offset,c[i].batchIds=h):c.splice(i,1),this._batchDirty=!0},bp.prototype.update=function(e){var t;let i=e.context;(function(e,t){if((0,_.Z)(e._va))return;let i=ek.Z.createVertexBuffer({context:t,typedArray:e._positions,usage:eV.Z.STATIC_DRAW}),n=ek.Z.createVertexBuffer({context:t,typedArray:e._vertexBatchIds,usage:eV.Z.STATIC_DRAW}),r=ek.Z.createIndexBuffer({context:t,typedArray:e._indices,usage:eV.Z.DYNAMIC_DRAW,indexDatatype:2===e._indices.BYTES_PER_ELEMENT?ez.Z.UNSIGNED_SHORT:ez.Z.UNSIGNED_INT}),o=[{index:0,vertexBuffer:i,componentDatatype:eM.Z.fromTypedArray(e._positions),componentsPerAttribute:3},{index:1,vertexBuffer:n,componentDatatype:eM.Z.fromTypedArray(e._vertexBatchIds),componentsPerAttribute:1}];e._va=new eX.Z({context:t,attributes:o,indexBuffer:r}),t.webgl2&&(e._vaSwap=new eX.Z({context:t,attributes:o,indexBuffer:ek.Z.createIndexBuffer({context:t,sizeInBytes:r.sizeInBytes,usage:eV.Z.DYNAMIC_DRAW,indexDatatype:r.indexDatatype})})),e._batchedPositions=void 0,e._transferrableBatchIds=void 0,e._vertexBatchIds=void 0})(this,i),function(e,t){if((0,_.Z)(e._sp))return;let i=e._batchTable,n=(0,m.Z)(e._attributeLocations,bm),r=e._pickId,o=e._vertexShaderSource,a=e._fragmentShaderSource;if((0,_.Z)(o)){e._sp=eq.Z.fromCache({context:t,vertexShaderSource:o,fragmentShaderSource:a,attributeLocations:n}),e._spStencil=e._sp,a=eY.Z.replaceMain(a,"czm_non_pick_main"),a=`${a}void main() { czm_non_pick_main(); out_FragColor = ${r}; } `,e._spPick=eq.Z.fromCache({context:t,vertexShaderSource:o,fragmentShaderSource:a,attributeLocations:n});return}let s=i.getVertexShaderCallback(!1,"a_batchId",void 0)(yW),l=i.getFragmentShaderCallback(!1,void 0,!0)(yj.Z);r=i.getPickId();let c=new eY.Z({sources:[s]}),u=new eY.Z({defines:["VECTOR_TILE"],sources:[l]});e._sp=eq.Z.fromCache({context:t,vertexShaderSource:c,fragmentShaderSource:u,attributeLocations:n}),c=new eY.Z({sources:[yW]}),u=new eY.Z({defines:["VECTOR_TILE"],sources:[yj.Z]}),e._spStencil=eq.Z.fromCache({context:t,vertexShaderSource:c,fragmentShaderSource:u,attributeLocations:n}),l=eY.Z.replaceMain(l,"czm_non_pick_main"),l=`${l} void main() { czm_non_pick_main(); out_FragColor = ${r}; } `;let h=new eY.Z({sources:[s]}),d=new eY.Z({defines:["VECTOR_TILE"],sources:[l]});e._spPick=eq.Z.fromCache({context:t,vertexShaderSource:h,fragmentShaderSource:d,attributeLocations:n})}(this,i),(0,_.Z)(this._rsStencilDepthPass)||(this._rsStencilDepthPass=eW.Z.fromCache(b_(!1)),this._rsStencilDepthPass3DTiles=eW.Z.fromCache(b_(!0)),this._rsColorPass=eW.Z.fromCache(bg),this._rsPickPass=eW.Z.fromCache(bZ)),t=this,(0,_.Z)(t._uniformMap)||(t._uniformMap=t._batchTable.getUniformMapCallback()({u_modifiedModelViewProjection:function(){let e=i.uniformState.view,n=i.uniformState.projection;return er.Z.clone(e,by),er.Z.multiplyByPoint(by,t._center,bb),er.Z.setTranslation(by,bb,by),er.Z.multiply(n,by,by),by},u_highlightColor:function(){return t._highlightColor}}));let n=e.passes;n.render&&(function(e,t){let i=function(e,t){if(!e._batchDirty)return!1;let i=e._batchedIndices,n=i.length,r=!1,o={};for(let e=0;e<n;++e){let t=i[e].color.toRgba();if((0,_.Z)(o[t])){r=!0;break}o[t]=!0}if(!r)return e._batchDirty=!1,!1;if(r&&!e.forceRebatch&&e._framesSinceLastRebatch<120){++e._framesSinceLastRebatch;return}return i.sort(bE),t.webgl2?function(e,t){let i=e._indexOffsets,n=e._indexCounts,r=e._batchIdLookUp,o=t.pop(),a=[o],s=e._va.indexBuffer,l=e._vaSwap.indexBuffer,c=bT(s,l,0,i,n,o.batchIds,r);for(o.offset=0,o.count=c;t.length>0;){let e=t.pop();if(C.Z.equals(e.color,o.color))c=bT(s,l,c,i,n,e.batchIds,r),o.batchIds=o.batchIds.concat(e.batchIds),o.count=c-o.offset;else{let t=c;c=bT(s,l,c,i,n,e.batchIds,r),e.offset=t,e.count=c-t,a.push(e),o=e}}let u=e._va;e._va=e._vaSwap,e._vaSwap=u,e._batchedIndices=a}(e,i):function(e,t){let i=e._indices,n=e._indexOffsets,r=e._indexCounts,o=e._batchIdLookUp,a=new i.constructor(i.length),s=t.pop(),l=[s],c=bv(i,a,0,n,r,s.batchIds,o);for(s.offset=0,s.count=c;t.length>0;){let e=t.pop();if(C.Z.equals(e.color,s.color))c=bv(i,a,c,n,r,e.batchIds,o),s.batchIds=s.batchIds.concat(e.batchIds),s.count=c-s.offset;else{let t=c;c=bv(i,a,c,n,r,e.batchIds,o),e.offset=t,e.count=c-t,l.push(e),s=e}}e._va.indexBuffer.copyFromArrayView(a),e._indices=a,e._batchedIndices=l}(e,i),e._framesSinceLastRebatch=0,e._batchDirty=!1,e._pickCommandsDirty=!0,e._wireframeDirty=!0,!0}(e,t),n=e._commands,r=e._batchedIndices,o=r.length,a=2*o;if((0,_.Z)(n)&&!i&&n.length===a)return;n.length=a;let s=e._va,l=e._sp,c=(0,m.Z)(e._modelMatrix,er.Z.IDENTITY),u=e._uniformMap,h=e._boundingVolume;for(let t=0;t<o;++t){let i=r[t].offset,o=r[t].count,a=n[2*t];(0,_.Z)(a)||(a=n[2*t]=new eG.Z({owner:e})),a.vertexArray=s,a.modelMatrix=c,a.offset=i,a.count=o,a.renderState=e._rsStencilDepthPass,a.shaderProgram=l,a.uniformMap=u,a.boundingVolume=h,a.cull=!1,a.pass=ej.Z.TERRAIN_CLASSIFICATION;let d=eG.Z.shallowClone(a,a.derivedCommands.tileset);d.renderState=e._rsStencilDepthPass3DTiles,d.pass=ej.Z.CESIUM_3D_TILE_CLASSIFICATION,a.derivedCommands.tileset=d;let f=n[2*t+1];(0,_.Z)(f)||(f=n[2*t+1]=new eG.Z({owner:e})),f.vertexArray=s,f.modelMatrix=c,f.offset=i,f.count=o,f.renderState=e._rsColorPass,f.shaderProgram=l,f.uniformMap=u,f.boundingVolume=h,f.cull=!1,f.pass=ej.Z.TERRAIN_CLASSIFICATION;let p=eG.Z.shallowClone(f,f.derivedCommands.tileset);p.pass=ej.Z.CESIUM_3D_TILE_CLASSIFICATION,f.derivedCommands.tileset=p}e._commandsDirty=!0}(this,i),function(e,t){if(e.classificationType===nd.Z.TERRAIN||!t.invertClassification||(0,_.Z)(e._commandsIgnoreShow)&&!e._commandsDirty)return;let i=e._commands,n=e._commandsIgnoreShow,r=e._spStencil,o=i.length,a=n.length=o/2,s=0;for(let e=0;e<a;++e){let t=n[e]=eG.Z.shallowClone(i[s],n[e]);t.shaderProgram=r,t.pass=ej.Z.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW,s+=2}e._commandsDirty=!1}(this,e),function(e){let t,i,n=e.debugWireframe===e._debugWireframe;if(n=n&&!(e.debugWireframe&&e._wireframeDirty))return;(0,_.Z)(e._rsWireframe)||(e._rsWireframe=eW.Z.fromCache({})),e.debugWireframe?(t=e._rsWireframe,i=iT.Z.LINES):(t=e._rsColorPass,i=iT.Z.TRIANGLES);let r=e._commands,o=r.length;for(let e=0;e<o;e+=2){let n=r[e+1];n.renderState=t,n.primitiveType=i}e._debugWireframe=e.debugWireframe,e._wireframeDirty=!1}(this),this._debugWireframe?function(e,t){let i=e.commandList,n=t.length;for(let e=0;e<n;e+=2){let n=t[e+1];n.pass=ej.Z.OPAQUE,i.push(n)}}(e,this._commands):bC(this,e,this._commands,this._commandsIgnoreShow)),n.pick&&(function(e){if(!e._pickCommandsDirty)return;let t=e._indexOffsets.length,i=e._pickCommands;i.length=2*t;let n=e._va,r=e._spStencil,o=e._spPick,a=(0,m.Z)(e._modelMatrix,er.Z.IDENTITY),s=e._uniformMap;for(let l=0;l<t;++l){let t=e._indexOffsets[l],c=e._indexCounts[l],u=(0,_.Z)(e._boundingVolumes)?e._boundingVolumes[l]:e.boundingVolume,h=i[2*l];(0,_.Z)(h)||(h=i[2*l]=new eG.Z({owner:e,pickOnly:!0})),h.vertexArray=n,h.modelMatrix=a,h.offset=t,h.count=c,h.renderState=e._rsStencilDepthPass,h.shaderProgram=r,h.uniformMap=s,h.boundingVolume=u,h.pass=ej.Z.TERRAIN_CLASSIFICATION;let d=eG.Z.shallowClone(h,h.derivedCommands.tileset);d.renderState=e._rsStencilDepthPass3DTiles,d.pass=ej.Z.CESIUM_3D_TILE_CLASSIFICATION,h.derivedCommands.tileset=d;let f=i[2*l+1];(0,_.Z)(f)||(f=i[2*l+1]=new eG.Z({owner:e,pickOnly:!0})),f.vertexArray=n,f.modelMatrix=a,f.offset=t,f.count=c,f.renderState=e._rsPickPass,f.shaderProgram=o,f.uniformMap=s,f.boundingVolume=u,f.pass=ej.Z.TERRAIN_CLASSIFICATION;let p=eG.Z.shallowClone(f,f.derivedCommands.tileset);p.pass=ej.Z.CESIUM_3D_TILE_CLASSIFICATION,f.derivedCommands.tileset=p}e._pickCommandsDirty=!1}(this),bC(this,e,this._pickCommands))},bp.prototype.isDestroyed=function(){return!1},bp.prototype.destroy=function(){return this._va=this._va&&this._va.destroy(),this._sp=this._sp&&this._sp.destroy(),this._spPick=this._spPick&&this._spPick.destroy(),this._vaSwap=this._vaSwap&&this._vaSwap.destroy(),(0,g.Z)(this)},Object.defineProperties(bA.prototype,{trianglesLength:{get:function(){return(0,_.Z)(this._primitive)?this._primitive.trianglesLength:0}},geometryByteLength:{get:function(){return(0,_.Z)(this._primitive)?this._primitive.geometryByteLength:0}},ready:{get:function(){return this._ready}}}),bA.packedBoxLength=er.Z.packedLength+S.Z.packedLength,bA.packedCylinderLength=er.Z.packedLength+2,bA.packedEllipsoidLength=er.Z.packedLength+S.Z.packedLength,bA.packedSphereLength=S.Z.packedLength+1;let bI=new hD.Z("createVectorTileGeometries",5),bO=new C.Z;function bD(e,t,i,n,r){this._tileset=e,this._tile=t,this._resource=i,this._geometries=void 0,this._metadata=void 0,this._batchTable=void 0,this._features=void 0,this.featurePropertiesDirty=!1,this._group=void 0,this._ready=!1,function(e,t,i){let n,r,o;i=(0,m.Z)(i,0);let a=new Uint8Array(t),s=new DataView(t);i+=bP;let l=s.getUint32(i,!0);if(1!==l)throw new e3.Z(`Only Geometry tile version 1 is supported. Version ${l} is not.`);i+=bP;let c=s.getUint32(i,!0);if(i+=bP,0===c){e._ready=!0;return}let u=s.getUint32(i,!0);if(i+=bP,0===u)throw new e3.Z("Feature table must have a byte length greater than zero");let h=s.getUint32(i,!0);i+=bP;let d=s.getUint32(i,!0);i+=bP;let f=s.getUint32(i,!0),p=h0(a,i+=bP,u),g=new Uint8Array(t,i+=u,h);i+=h,d>0&&(n=h0(a,i,d),i+=d,f>0&&(r=new Uint8Array(t,i,f),r=new Uint8Array(r)));let Z=(0,m.Z)(p.BOXES_LENGTH,0),y=(0,m.Z)(p.CYLINDERS_LENGTH,0),b=(0,m.Z)(p.ELLIPSOIDS_LENGTH,0),v=(0,m.Z)(p.SPHERES_LENGTH,0),T=Z+y+b+v,E=new yF(e,T,n,r,function(t,i){(0,_.Z)(e._geometries)&&e._geometries.updateCommands(t,i)});if(e._batchTable=E,0===T)return;let x=e.tile.computedTransform;(0,_.Z)(p.RTC_CENTER)&&(o=S.Z.unpack(p.RTC_CENTER),er.Z.multiplyByPoint(x,o,o));let w=function(e,t){let i,n,r,o,a;let s=(0,m.Z)(e.BOXES_LENGTH,0),l=(0,m.Z)(e.CYLINDERS_LENGTH,0),c=(0,m.Z)(e.ELLIPSOIDS_LENGTH,0),u=(0,m.Z)(e.SPHERES_LENGTH,0);if(s>0&&(0,_.Z)(e.BOX_BATCH_IDS)){let n=t.byteOffset+e.BOX_BATCH_IDS.byteOffset;i=new Uint16Array(t.buffer,n,s)}if(l>0&&(0,_.Z)(e.CYLINDER_BATCH_IDS)){let i=t.byteOffset+e.CYLINDER_BATCH_IDS.byteOffset;n=new Uint16Array(t.buffer,i,l)}if(c>0&&(0,_.Z)(e.ELLIPSOID_BATCH_IDS)){let i=t.byteOffset+e.ELLIPSOID_BATCH_IDS.byteOffset;r=new Uint16Array(t.buffer,i,c)}if(u>0&&(0,_.Z)(e.SPHERE_BATCH_IDS)){let i=t.byteOffset+e.SPHERE_BATCH_IDS.byteOffset;o=new Uint16Array(t.buffer,i,u)}let h=(0,_.Z)(i)||(0,_.Z)(n)||(0,_.Z)(r)||(0,_.Z)(o),d=s>0&&!(0,_.Z)(i)||l>0&&!(0,_.Z)(n)||c>0&&!(0,_.Z)(r)||u>0&&!(0,_.Z)(o);if(h&&d)throw new e3.Z("If one group of batch ids is defined, then all batch ids must be defined");if(!(0,_.Z)(i)&&!(0,_.Z)(n)&&!(0,_.Z)(r)&&!(0,_.Z)(o)){let e=0;if(!(0,_.Z)(i)&&s>0)for(a=0,i=new Uint16Array(s);a<s;++a)i[a]=e++;if(!(0,_.Z)(n)&&l>0)for(a=0,n=new Uint16Array(l);a<l;++a)n[a]=e++;if(!(0,_.Z)(r)&&c>0)for(a=0,r=new Uint16Array(c);a<c;++a)r[a]=e++;if(!(0,_.Z)(o)&&u>0)for(a=0,o=new Uint16Array(u);a<u;++a)o[a]=e++}return{boxes:i,cylinders:n,ellipsoids:r,spheres:o}}(p,g);if(Z>0||y>0||b>0||v>0){let t,i,n,r;if(Z>0){let e=g.byteOffset+p.BOXES.byteOffset;t=new Float32Array(g.buffer,e,bA.packedBoxLength*Z)}if(y>0){let e=g.byteOffset+p.CYLINDERS.byteOffset;i=new Float32Array(g.buffer,e,bA.packedCylinderLength*y)}if(b>0){let e=g.byteOffset+p.ELLIPSOIDS.byteOffset;n=new Float32Array(g.buffer,e,bA.packedEllipsoidLength*b)}if(v>0){let e=g.byteOffset+p.SPHERES.byteOffset;r=new Float32Array(g.buffer,e,bA.packedSphereLength*v)}return e._geometries=new bA({boxes:t,boxBatchIds:w.boxes,cylinders:i,cylinderBatchIds:w.cylinders,ellipsoids:n,ellipsoidBatchIds:w.ellipsoids,spheres:r,sphereBatchIds:w.spheres,center:o,modelMatrix:x,batchTable:E,boundingVolume:e.tile.boundingVolume.boundingVolume})}Promise.resolve(e)}(this,n,r)}bA.prototype.createFeatures=function(e,t){this._primitive.createFeatures(e,t)},bA.prototype.applyDebugSettings=function(e,t){this._primitive.applyDebugSettings(e,t)},bA.prototype.applyStyle=function(e,t){this._primitive.applyStyle(e,t)},bA.prototype.updateCommands=function(e,t){this._primitive.updateCommands(e,t)},bA.prototype.update=function(e){if(!this._ready){if((0,_.Z)(this._promise)||(this._promise=function(e){if(!(0,_.Z)(e._primitive)&&!(0,_.Z)(e._verticesPromise)){let t=e._boxes,i=e._boxBatchIds,n=e._cylinders,r=e._cylinderBatchIds,o=e._ellipsoids,a=e._ellipsoidBatchIds,s=e._spheres,l=e._sphereBatchIds,c=e._batchTableColors,u=e._packedBuffer;if(!(0,_.Z)(c)){let h=0;(0,_.Z)(e._boxes)&&(t=e._boxes=t.slice(),h+=(i=e._boxBatchIds=i.slice()).length),(0,_.Z)(e._cylinders)&&(n=e._cylinders=n.slice(),h+=(r=e._cylinderBatchIds=r.slice()).length),(0,_.Z)(e._ellipsoids)&&(o=e._ellipsoids=o.slice(),h+=(a=e._ellipsoidBatchIds=a.slice()).length),(0,_.Z)(e._spheres)&&(s=e._sphere=s.slice(),h+=(l=e._sphereBatchIds=l.slice()).length),c=e._batchTableColors=new Uint32Array(h);let d=e._batchTable;for(let e=0;e<h;++e){let t=d.getColor(e,bO);c[e]=t.toRgba()}u=e._packedBuffer=function(e){let t=new Float64Array(er.Z.packedLength+S.Z.packedLength),i=0;return S.Z.pack(e._center,t,i),i+=S.Z.packedLength,er.Z.pack(e._modelMatrix,t,i),t}(e)}let h=[];(0,_.Z)(t)&&h.push(t.buffer,i.buffer),(0,_.Z)(n)&&h.push(n.buffer,r.buffer),(0,_.Z)(o)&&h.push(o.buffer,a.buffer),(0,_.Z)(s)&&h.push(s.buffer,l.buffer),h.push(c.buffer,u.buffer);let d={boxes:(0,_.Z)(t)?t.buffer:void 0,boxBatchIds:(0,_.Z)(t)?i.buffer:void 0,cylinders:(0,_.Z)(n)?n.buffer:void 0,cylinderBatchIds:(0,_.Z)(n)?r.buffer:void 0,ellipsoids:(0,_.Z)(o)?o.buffer:void 0,ellipsoidBatchIds:(0,_.Z)(o)?a.buffer:void 0,spheres:(0,_.Z)(s)?s.buffer:void 0,sphereBatchIds:(0,_.Z)(s)?l.buffer:void 0,batchTableColors:c.buffer,packedBuffer:u.buffer},p=e._verticesPromise=bI.scheduleTask(d,h);if((0,_.Z)(p))return p.then(function(t){if(!e.isDestroyed())2===function(e,t){let i=0,n=t[i++],r=t[i++],o=e._boundingVolumes=Array(r);for(let e=0;e<r;++e)o[e]=f.Z.unpack(t,i),i+=f.Z.packedLength;let a=t[i++],s=e._batchedIndices=Array(a);for(let e=0;e<a;++e){let n=C.Z.unpack(t,i);i+=C.Z.packedLength;let r=t[i++],o=t[i++],a=t[i++],l=Array(a);for(let e=0;e<a;++e)l[e]=t[i++];s[e]=new yG({color:n,offset:r,count:o,batchIds:l})}return n}(e,new Float64Array(t.packedBuffer))?e._indices=new Uint16Array(t.indices):e._indices=new Uint32Array(t.indices),e._indexOffsets=new Uint32Array(t.indexOffsets),e._indexCounts=new Uint32Array(t.indexCounts),e._positions=new Float32Array(t.positions),e._vertexBatchIds=new Uint16Array(t.vertexBatchIds),e._batchIds=new Uint16Array(t.batchIds),(0,_.Z)(e._primitive)||(e._primitive=new bp({batchTable:e._batchTable,positions:e._positions,batchIds:e._batchIds,vertexBatchIds:e._vertexBatchIds,indices:e._indices,indexOffsets:e._indexOffsets,indexCounts:e._indexCounts,batchedIndices:e._batchedIndices,boundingVolume:e._boundingVolume,boundingVolumes:e._boundingVolumes,center:e._center,pickObject:(0,m.Z)(e._pickObject,e)}),e._boxes=void 0,e._boxBatchIds=void 0,e._cylinders=void 0,e._cylinderBatchIds=void 0,e._ellipsoids=void 0,e._ellipsoidBatchIds=void 0,e._spheres=void 0,e._sphereBatchIds=void 0,e._center=void 0,e._modelMatrix=void 0,e._batchTable=void 0,e._boundingVolume=void 0,e._boundingVolumes=void 0,e._batchedIndices=void 0,e._indices=void 0,e._indexOffsets=void 0,e._indexCounts=void 0,e._positions=void 0,e._vertexBatchIds=void 0,e._batchIds=void 0,e._batchTableColors=void 0,e._packedBuffer=void 0,e._verticesPromise=void 0),e._ready=!0}).catch(t=>{e.isDestroyed()||(e._error=t)})}}(this)),(0,_.Z)(this._error)){let e=this._error;throw this._error=void 0,e}return}this._primitive.debugWireframe=this.debugWireframe,this._primitive.forceRebatch=this.forceRebatch,this._primitive.classificationType=this.classificationType,this._primitive.update(e)},bA.prototype.isDestroyed=function(){return!1},bA.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),(0,g.Z)(this)},Object.defineProperties(bD.prototype,{featuresLength:{get:function(){return(0,_.Z)(this._batchTable)?this._batchTable.featuresLength:0}},pointsLength:{get:function(){return 0}},trianglesLength:{get:function(){return(0,_.Z)(this._geometries)?this._geometries.trianglesLength:0}},geometryByteLength:{get:function(){return(0,_.Z)(this._geometries)?this._geometries.geometryByteLength:0}},texturesByteLength:{get:function(){return 0}},batchTableByteLength:{get:function(){return(0,_.Z)(this._batchTable)?this._batchTable.batchTableByteLength:0}},innerContents:{get:function(){}},ready:{get:function(){return this._ready}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){return this._resource.getUrlComponent(!0)}},metadata:{get:function(){return this._metadata},set:function(e){this._metadata=e}},batchTable:{get:function(){return this._batchTable}},group:{get:function(){return this._group},set:function(e){this._group=e}}});let bP=Uint32Array.BYTES_PER_ELEMENT;function bR(e){let t=e.featuresLength;if(!(0,_.Z)(e._features)&&t>0){let i=Array(t);(0,_.Z)(e._geometries)&&e._geometries.createFeatures(e,i),e._features=i}}bD.prototype.hasProperty=function(e,t){return this._batchTable.hasProperty(e,t)},bD.prototype.getFeature=function(e){let t=this.featuresLength;if(!(0,_.Z)(e)||e<0||e>=t)throw new A.Z(`batchId is required and between zero and featuresLength - 1 (${t-1}).`);return bR(this),this._features[e]},bD.prototype.applyDebugSettings=function(e,t){(0,_.Z)(this._geometries)&&this._geometries.applyDebugSettings(e,t)},bD.prototype.applyStyle=function(e){bR(this),(0,_.Z)(this._geometries)&&this._geometries.applyStyle(e,this._features)},bD.prototype.update=function(e,t){(0,_.Z)(this._geometries)&&(this._geometries.classificationType=this._tileset.classificationType,this._geometries.debugWireframe=this._tileset.debugWireframe,this._geometries.update(t)),(0,_.Z)(this._batchTable)&&this._geometries.ready&&(this._batchTable.update(e,t),this._ready=!0)},bD.prototype.pick=function(e,t,i){},bD.prototype.isDestroyed=function(){return!1},bD.prototype.destroy=function(){return this._geometries=this._geometries&&this._geometries.destroy(),this._batchTable=this._batchTable&&this._batchTable.destroy(),(0,g.Z)(this)};let bN={};function bL(e,t,i,n){if(0!==n)return;1===i&&(t.x=e-1-t.x,t.y=e-1-t.y);let r=t.x;t.x=t.y,t.y=r}bN.encode2D=function(e,t,i){let n=Math.pow(2,e);if(p.Z.typeOf.number("level",e),p.Z.typeOf.number("x",t),p.Z.typeOf.number("y",i),e<1)throw new A.Z("Hilbert level cannot be less than 1.");if(t<0||t>=n||i<0||i>=n)throw new A.Z("Invalid coordinates for given level.");let r={x:t,y:i},o,a,s,l=BigInt(0);for(s=n/2;s>0;s/=2)l+=BigInt((3*(o=(r.x&s)>0?1:0)^(a=(r.y&s)>0?1:0))*s*s),bL(n,r,o,a);return l},bN.decode2D=function(e,t){let i,n,r,o;if(p.Z.typeOf.number("level",e),p.Z.typeOf.bigint("index",t),e<1)throw new A.Z("Hilbert level cannot be less than 1.");if(t<BigInt(0)||t>=BigInt(Math.pow(4,e)))throw new A.Z("Hilbert index exceeds valid maximum for given level.");let a=Math.pow(2,e),s={x:0,y:0};for(r=1,o=t;r<a;r*=2)i=1&Number(o/BigInt(2)),n=1&Number(o^BigInt(i)),bL(r,s,i,n),s.x+=r*i,s.y+=r*n,o/=BigInt(4);return[s.x,s.y]};let bM=[],bF=[],bz=[[0,1,3,2],[0,2,3,1],[3,2,0,1],[3,1,0,2]];function bB(e){if(!uP.Z.supportsBigInt())throw new e3.Z("S2 required BigInt support");if(!(0,_.Z)(e))throw new A.Z("cell ID is required.");if(!bB.isValidId(e))throw new A.Z("cell ID is invalid.");this._cellId=e,this._level=bB.getLevel(e)}function bU(e){0===bM.length&&(bj(0,0,0,0,0,0),bj(0,0,0,1,0,1),bj(0,0,0,2,0,2),bj(0,0,0,3,0,3));let t=Number(e>>BigInt(61)),i=1&t,n=0,r=0;for(let t=7;t>=0;t--){let o=(1<<2*(7===t?2:4))-1;i+=Number(e>>BigInt(2*t*4+1)&BigInt(o))<<2,i=bF[i];let a=4*t;n+=i>>6<<a,r+=(i>>2&15)<<a,i&=3}return[t,n,r]}function bk(e,t,i){switch(e){case 0:return new S.Z(1,t,i);case 1:return new S.Z(-t,1,i);case 2:return new S.Z(-t,-i,1);case 3:return new S.Z(-1,-i,-t);case 4:return new S.Z(i,-1,-t);default:return new S.Z(i,t,-1)}}function bV(e){return e>=.5?1/3*(4*e*e-1):1/3*(1-4*(1-e)*(1-e))}function bH(e){return 4656612873077393e-25*e}function bG(e){return 9313225746154785e-25*e}function bj(e,t,i,n,r,o){if(4===e){let e=(t<<4)+i;bM[(e<<2)+n]=(r<<2)+o,bF[(r<<2)+n]=(e<<2)+o}else{e++,t<<=1,i<<=1,r<<=2;let a=bz[o];bj(e,t+(a[0]>>1),i+(1&a[0]),n,r,1^o),bj(e,t+(a[1]>>1),i+(1&a[1]),n,r+1,0^o),bj(e,t+(a[2]>>1),i+(1&a[2]),n,r+2,0^o),bj(e,t+(a[3]>>1),i+(1&a[3]),n,r+3,3^o)}}function bW(e){return e&~e+BigInt(1)}bB.fromToken=function(e){if(p.Z.typeOf.string("token",e),!bB.isValidToken(e))throw new A.Z("token is invalid.");return new bB(bB.getIdFromToken(e))},bB.isValidId=function(e){return p.Z.typeOf.bigint("cellId",e),!(e<=0||e>>BigInt(61)>5)&&!!(e&~e+BigInt(1)&BigInt("0x1555555555555555"))},bB.isValidToken=function(e){return p.Z.typeOf.string("token",e),!!/^[0-9a-fA-F]{1,16}$/.test(e)&&bB.isValidId(bB.getIdFromToken(e))},bB.getIdFromToken=function(e){return p.Z.typeOf.string("token",e),BigInt("0x"+e+"0".repeat(16-e.length))},bB.getTokenFromId=function(e){p.Z.typeOf.bigint("cellId",e);let t=Math.floor(bq[(-e&e)%BigInt(67)]/4),i=e.toString(16).replace(/0*$/,"");return Array(17-t-i.length).join("0")+i},bB.getLevel=function(e){if(p.Z.typeOf.bigint("cellId",e),!bB.isValidId(e))throw new A.Z;let t=0;for(;e!==BigInt(0)&&!(e&BigInt(1));)t++,e>>=BigInt(1);return 30-(t>>1)},bB.prototype.getChild=function(e){if(p.Z.typeOf.number("index",e),e<0||e>3)throw new A.Z("child index must be in the range [0-3].");if(30===this._level)throw new A.Z("cannot get child of leaf cell.");let t=bW(this._cellId)>>BigInt(2);return new bB(this._cellId+BigInt(2*e+1-4)*t)},bB.prototype.getParent=function(){if(0===this._level)throw new A.Z("cannot get parent of root cell.");let e=bW(this._cellId)<<BigInt(2);return new bB(this._cellId&~e+BigInt(1)|e)},bB.prototype.getParentAtLevel=function(e){if(0===this._level||e<0||this._level<e)throw new A.Z("cannot get parent at invalid level.");let t=BigInt(1)<<BigInt(2*(30-e));return new bB(this._cellId&-t|t)},bB.prototype.getCenter=function(e){e=(0,m.Z)(e,el.Z.WGS84);let t=function(e,t){let i=function(e,t){let i=bU(e),n=i[0],r=i[1],o=i[2],a=30===t,s=!a&&(BigInt(r)^e>>BigInt(2))&BigInt(1),l=a?1:s?2:0;return[n,(r<<1)+l,(o<<1)+l]}(e,t);return function(e,t,i){let n=bH(t),r=bH(i);return bk(e,bV(n),bV(r))}(i[0],i[1],i[2])}(this._cellId,this._level);t=S.Z.normalize(t,t);let i=new ea.Z.fromCartesian(t,el.Z.UNIT_SPHERE);return ea.Z.toCartesian(i,e,new S.Z)},bB.prototype.getVertex=function(e,t){if(p.Z.typeOf.number("index",e),e<0||e>3)throw new A.Z("vertex index must be in the range [0-3].");t=(0,m.Z)(t,el.Z.WGS84);let i=function(e,t,i){let n=bU(e,t),r=function(e,t){let i=[[],[]],n=1<<30-t>>>0;for(let t=0;t<2;++t){let r=e[t]&-n,o=r+n;i[t][0]=bV(bG(r)),i[t][1]=bV(bG(o))}return i}([n[1],n[2]],t),o=i>>1&1;return bk(n[0],r[0][o^1&i],r[1][o])}(this._cellId,this._level,e);i=S.Z.normalize(i,i);let n=new ea.Z.fromCartesian(i,el.Z.UNIT_SPHERE);return ea.Z.toCartesian(n,t,new S.Z)},bB.fromFacePositionLevel=function(e,t,i){if(p.Z.typeOf.bigint("position",t),e<0||e>5)throw new A.Z("Invalid S2 Face (must be within 0-5)");if(i<0||i>30)throw new A.Z("Invalid level (must be within 0-30)");if(t<0||t>=Math.pow(4,i))throw new A.Z("Invalid Hilbert position for level");let n=(e<4?"0":"")+(e<2?"0":"")+e.toString(2),r=t.toString(2),o=Array(2*i-r.length+1).join("0"),a=Array(61-2*i).join("0");return new bB(BigInt(`0b${n}${o}${r}1${a}`))};let bq=[64,0,1,39,2,15,40,23,3,12,16,59,41,19,24,54,4,64,13,10,17,62,60,28,42,30,20,51,25,44,55,47,5,32,65,38,14,22,11,58,18,53,63,9,61,27,29,50,43,46,31,37,21,57,52,8,26,49,45,36,56,7,48,35,6,34,33,0];function bY(e){let t=e.lengthBits,i=e.availableCount;p.Z.typeOf.number("options.lengthBits",t);let n=e.constant,r=e.bitstream;if((0,_.Z)(n))i=t;else{let n=Math.ceil(t/8);if(r.length!==n)throw new e3.Z(`Availability bitstream must be exactly ${n} bytes long to store ${t} bits. Actual bitstream was ${r.length} bytes long.`);let o=(0,m.Z)(e.computeAvailableCountEnabled,!1);!(0,_.Z)(i)&&o&&(i=function(e,t){let i=0;for(let n=0;n<t;n++){let t=n>>3,r=n%8;i+=e[t]>>r&1}return i}(r,t))}this._lengthBits=t,this._availableCount=i,this._constant=n,this._bitstream=r}function bX(e){let t=(e=(0,m.Z)(e,m.Z.EMPTY_OBJECT)).metadataTable,i=e.class,n=e.entityId,r=e.propertyTableJson;p.Z.typeOf.object("options.metadataTable",t),p.Z.typeOf.object("options.class",i),p.Z.typeOf.number("options.entityId",n),p.Z.typeOf.object("options.propertyTableJson",r),this._class=i,this._metadataTable=t,this._entityId=n,this._extensions=r.extensions,this._extras=r.extras}Object.defineProperties(bY.prototype,{lengthBits:{get:function(){return this._lengthBits}},availableCount:{get:function(){return this._availableCount}}}),bY.prototype.getBit=function(e){if(e<0||e>=this._lengthBits)throw new A.Z("Bit index out of bounds.");return(0,_.Z)(this._constant)?this._constant:(this._bitstream[e>>3]>>e%8&1)==1},Object.defineProperties(bX.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}}),bX.prototype.hasProperty=function(e){return this._metadataTable.hasProperty(e)},bX.prototype.hasPropertyBySemantic=function(e){return this._metadataTable.hasPropertyBySemantic(e)},bX.prototype.getPropertyIds=function(e){return this._metadataTable.getPropertyIds(e)},bX.prototype.getProperty=function(e){return this._metadataTable.getProperty(this._entityId,e)},bX.prototype.setProperty=function(e,t){return this._metadataTable.setProperty(this._entityId,e,t)},bX.prototype.getPropertyBySemantic=function(e){return this._metadataTable.getPropertyBySemantic(this._entityId,e)},bX.prototype.setPropertyBySemantic=function(e,t){return this._metadataTable.setPropertyBySemantic(this._entityId,e,t)};let b$={QUADTREE:"QUADTREE",OCTREE:"OCTREE"};b$.getBranchingFactor=function(e){switch(e){case b$.OCTREE:return 8;case b$.QUADTREE:return 4;default:throw new A.Z("subdivisionScheme is not a valid value.")}};var bK=Object.freeze(b$);function bQ(e){let t=(e=(0,m.Z)(e,m.Z.EMPTY_OBJECT)).subtreeMetadata,i=e.class;p.Z.typeOf.object("options.subtreeMetadata",t),p.Z.typeOf.object("options.class",i);let n=(0,_.Z)(t.properties)?t.properties:{};this._class=i,this._properties=n,this._extras=t.extras,this._extensions=t.extensions}function bJ(e,t,i){p.Z.typeOf.object("resource",e),p.Z.typeOf.object("implicitTileset",t),p.Z.typeOf.object("implicitCoordinates",i),this._resource=e,this._subtreeJson=void 0,this._bufferLoader=void 0,this._tileAvailability=void 0,this._contentAvailabilityBitstreams=[],this._childSubtreeAvailability=void 0,this._implicitCoordinates=i,this._subtreeLevels=t.subtreeLevels,this._subdivisionScheme=t.subdivisionScheme,this._branchingFactor=t.branchingFactor,this._metadata=void 0,this._tileMetadataTable=void 0,this._tilePropertyTableJson=void 0,this._contentMetadataTables=[],this._contentPropertyTableJsons=[],this._tileJumpBuffer=void 0,this._contentJumpBuffers=[],this._ready=!1}function b0(e,t){let i;let n=e.properties;for(let e in n)if(n.hasOwnProperty(e)){let r=n[e];(i=t[(0,m.Z)(r.values,r.bufferView)]).isActive=!0,i.bufferHeader.isActive=!0;let o=(0,m.Z)(r.stringOffsets,r.stringOffsetBufferView);(0,_.Z)(o)&&((i=t[o]).isActive=!0,i.bufferHeader.isActive=!0);let a=(0,m.Z)(r.arrayOffsets,r.arrayOffsetBufferView);(0,_.Z)(a)&&((i=t[a]).isActive=!0,i.bufferHeader.isActive=!0)}}async function b1(e,t){let i=e._resource.getDerivedResource({url:t.uri}),n=fT.getExternalBufferLoader({resource:i});e._bufferLoader=n;try{await n.load()}catch(e){if(n.isDestroyed())return;throw e}return n.typedArray}function b2(e,t,i,n){let r;return(0,_.Z)(e.constant)?new bY({constant:!!e.constant,lengthBits:i,availableCount:e.availableCount}):((0,_.Z)(e.bitstream)?r=t[e.bitstream]:(0,_.Z)(e.bufferView)&&(r=t[e.bufferView]),new bY({bitstream:r,lengthBits:i,availableCount:e.availableCount,computeAvailableCountEnabled:n}))}function b3(e){let t,i=0,n=e.lengthBits,r=e.availableCount;t=r<256?new Uint8Array(n):r<65536?new Uint16Array(n):new Uint32Array(n);for(let n=0;n<e.lengthBits;n++)e.getBit(n)&&(t[n]=i,i++);return t}Object.defineProperties(bQ.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}}),bQ.prototype.hasProperty=function(e){return uB.hasProperty(e,this._properties,this._class)},bQ.prototype.hasPropertyBySemantic=function(e){return uB.hasPropertyBySemantic(e,this._properties,this._class)},bQ.prototype.getPropertyIds=function(e){return uB.getPropertyIds(this._properties,this._class,e)},bQ.prototype.getProperty=function(e){return uB.getProperty(e,this._properties,this._class)},bQ.prototype.setProperty=function(e,t){return uB.setProperty(e,t,this._properties,this._class)},bQ.prototype.getPropertyBySemantic=function(e){return uB.getPropertyBySemantic(e,this._properties,this._class)},bQ.prototype.setPropertyBySemantic=function(e,t){return uB.setPropertyBySemantic(e,t,this._properties,this._class)},Object.defineProperties(bJ.prototype,{ready:{get:function(){return this._ready}},metadata:{get:function(){return this._metadata}},tileMetadataTable:{get:function(){return this._tileMetadataTable}},tilePropertyTableJson:{get:function(){return this._tilePropertyTableJson}},contentMetadataTables:{get:function(){return this._contentMetadataTables}},contentPropertyTableJsons:{get:function(){return this._contentPropertyTableJsons}},implicitCoordinates:{get:function(){return this._implicitCoordinates}}}),bJ.prototype.tileIsAvailableAtIndex=function(e){return this._tileAvailability.getBit(e)},bJ.prototype.tileIsAvailableAtCoordinates=function(e){let t=this.getTileIndex(e);return this.tileIsAvailableAtIndex(t)},bJ.prototype.contentIsAvailableAtIndex=function(e,t){if((t=(0,m.Z)(t,0))<0||t>=this._contentAvailabilityBitstreams.length)throw new A.Z("contentIndex out of bounds.");return this._contentAvailabilityBitstreams[t].getBit(e)},bJ.prototype.contentIsAvailableAtCoordinates=function(e,t){let i=this.getTileIndex(e);return this.contentIsAvailableAtIndex(i,t)},bJ.prototype.childSubtreeIsAvailableAtIndex=function(e){return this._childSubtreeAvailability.getBit(e)},bJ.prototype.childSubtreeIsAvailableAtCoordinates=function(e){let t=this.getChildSubtreeIndex(e);return this.childSubtreeIsAvailableAtIndex(t)},bJ.prototype.getLevelOffset=function(e){let t=this._branchingFactor;return(Math.pow(t,e)-1)/(t-1)},bJ.prototype.getParentMortonIndex=function(e){let t=2;return this._subdivisionScheme===bK.OCTREE&&(t=3),e>>t},bJ.fromSubtreeJson=async function(e,t,i,n,r){let o,a,s;if(p.Z.typeOf.object("resource",e),(0,_.Z)(t)===(0,_.Z)(i))throw new A.Z("One of json and subtreeView must be defined.");p.Z.typeOf.object("implicitTileset",n),p.Z.typeOf.object("implicitCoordinates",r);let l=new bJ(e,n,r),c=(o=(0,_.Z)(t)?{json:t,binary:void 0}:function(e){let t=new DataView(e.buffer,e.byteOffset),i=8,n=t.getUint32(i,!0);i+=8;let r=t.getUint32(i,!0),o=h0(e,i+=8,n);return i+=n,{json:o,binary:e.subarray(i,i+r)}}(i)).json;if(l._subtreeJson=c,hC(c,"3DTILES_metadata"))a=c.extensions["3DTILES_metadata"];else if((0,_.Z)(c.tileMetadata)){let e=c.tileMetadata;a=c.propertyTables[e]}let u=[];if((0,_.Z)(c.contentMetadata)){let e=c.contentMetadata.length;for(let t=0;t<e;t++){let e=c.contentMetadata[t];u.push(c.propertyTables[e])}}let h=n.metadataSchema,d=c.subtreeMetadata;if((0,_.Z)(d)){let e=d.class;s=new bQ({subtreeMetadata:d,class:h.classes[e]})}l._metadata=s,l._tilePropertyTableJson=a,l._contentPropertyTableJsons=u,c.contentAvailabilityHeaders=[],hC(c,"3DTILES_multiple_contents")?c.contentAvailabilityHeaders=c.extensions["3DTILES_multiple_contents"].contentAvailability:Array.isArray(c.contentAvailability)?c.contentAvailabilityHeaders=c.contentAvailability:c.contentAvailabilityHeaders.push((0,m.Z)(c.contentAvailability,{constant:0}));let f=function(e){e=(0,_.Z)(e)?e:[];for(let t=0;t<e.length;t++){let i=e[t];i.isExternal=(0,_.Z)(i.uri),i.isActive=!1}return e}(c.buffers),g=function(e,t){e=(0,_.Z)(e)?e:[];for(let i=0;i<e.length;i++){let n=e[i],r=t[n.buffer];n.bufferHeader=r,n.isActive=!1}return e}(c.bufferViews,f);(function(e,t){let i;let n=e.tileAvailability;(0,_.Z)(n.bitstream)?i=t[n.bitstream]:(0,_.Z)(n.bufferView)&&(i=t[n.bufferView]),(0,_.Z)(i)&&(i.isActive=!0,i.bufferHeader.isActive=!0);let r=e.contentAvailabilityHeaders;for(let e=0;e<r.length;e++)i=void 0,(0,_.Z)(r[e].bitstream)?i=t[r[e].bitstream]:(0,_.Z)(r[e].bufferView)&&(i=t[r[e].bufferView]),(0,_.Z)(i)&&(i.isActive=!0,i.bufferHeader.isActive=!0);i=void 0;let o=e.childSubtreeAvailability;(0,_.Z)(o.bitstream)?i=t[o.bitstream]:(0,_.Z)(o.bufferView)&&(i=t[o.bufferView]),(0,_.Z)(i)&&(i.isActive=!0,i.bufferHeader.isActive=!0)})(c,g),(0,_.Z)(a)&&b0(a,g);for(let e=0;e<u.length;e++)b0(u[e],g);let Z=function(e,t){let i={};for(let n=0;n<e.length;n++){let r=e[n];if(!r.isActive)continue;let o=r.byteOffset,a=o+r.byteLength,s=t[r.buffer].subarray(o,a);i[n]=s}return i}(g,await function(e,t,i){let n=[];for(let r=0;r<t.length;r++){let o=t[r];if(o.isActive){if(o.isExternal){let t=b1(e,o);n.push(t)}else n.push(Promise.resolve(i))}else n.push(Promise.resolve(void 0))}return Promise.all(n).then(function(e){let t={};for(let i=0;i<e.length;i++){let n=e[i];(0,_.Z)(n)&&(t[i]=n)}return t})}(l,f,o.binary));return function(e,t,i,n){let r=i.branchingFactor,o=i.subtreeLevels,a=(Math.pow(r,o)-1)/(r-1),s=Math.pow(r,o),l=hC(t,"3DTILES_metadata"),c=(0,_.Z)(e._tilePropertyTableJson),u=l||c;e._tileAvailability=b2(t.tileAvailability,n,a,u);let h=e._contentPropertyTableJsons.length>0;u=u||h;for(let i=0;i<t.contentAvailabilityHeaders.length;i++){let r=b2(t.contentAvailabilityHeaders[i],n,a,u);e._contentAvailabilityBitstreams.push(r)}e._childSubtreeAvailability=b2(t.childSubtreeAvailability,n,s)}(l,c,n,Z),(0,_.Z)(a)&&(function(e,t,i){let n=e._tilePropertyTableJson,r=e._tileAvailability.availableCount,o=t.metadataSchema,a=n.class,s=o.classes[a];e._tileMetadataTable=new hy({class:s,count:r,properties:n.properties,bufferViews:i})}(l,n,Z),function(e){let t=b3(e._tileAvailability);e._tileJumpBuffer=t}(l)),function(e,t,i){let n=e._contentPropertyTableJsons,r=e._contentAvailabilityBitstreams,o=t.metadataSchema,a=e._contentMetadataTables;for(let e=0;e<n.length;e++){let t=n[e],s=r[e].availableCount,l=t.class,c=new hy({class:o.classes[l],count:s,properties:t.properties,bufferViews:i});a.push(c)}}(l,n,Z),function(e){let t=e._contentJumpBuffers,i=e._contentAvailabilityBitstreams;for(let e=0;e<i.length;e++){let n=b3(i[e]);t.push(n)}}(l),l._ready=!0,l},bJ.prototype.getTileIndex=function(e){let t=e.level-this._implicitCoordinates.level;if(t<0||this._subtreeLevels<=t)throw new e3.Z("level is out of bounds for this subtree");return e.getSubtreeCoordinates().getOffsetCoordinates(e).tileIndex},bJ.prototype.getChildSubtreeIndex=function(e){if(e.level-this._implicitCoordinates.level!==this._implicitCoordinates.subtreeLevels)throw new e3.Z("level is out of bounds for this subtree");return e.getParentSubtreeCoordinates().getOffsetCoordinates(e).mortonIndex},bJ.prototype.getTileMetadataView=function(e){let t=function(e,t){if(!(0,_.Z)(e._tileMetadataTable))return;let i=e.getTileIndex(t);if(e._tileAvailability.getBit(i))return e._tileJumpBuffer[i]}(this,e);if(!(0,_.Z)(t))return;let i=this._tileMetadataTable;return new bX({class:i.class,metadataTable:i,entityId:t,propertyTableJson:this._tilePropertyTableJson})},bJ.prototype.getContentMetadataView=function(e,t){let i=function(e,t,i){let n=e._contentMetadataTables;if(!(0,_.Z)(n))return;let r=n[i];if(!(0,_.Z)(r))return;let o=e._contentAvailabilityBitstreams[i],a=e.getTileIndex(t);if(o.getBit(a))return e._contentJumpBuffers[i][a]}(this,e,t);if(!(0,_.Z)(i))return;let n=this._contentMetadataTables[t],r=this._contentPropertyTableJsons[t];return new bX({class:n.class,metadataTable:n,entityId:i,contentIndex:t,propertyTableJson:r})},bJ.prototype.isDestroyed=function(){return!1},bJ.prototype.destroy=function(){return(0,_.Z)(this._bufferLoader)&&fT.unload(this._bufferLoader),(0,g.Z)(this)};var b4=Object.freeze({ID:"ID",NAME:"NAME",DESCRIPTION:"DESCRIPTION",TILESET_TILE_COUNT:"TILESET_TILE_COUNT",TILE_BOUNDING_BOX:"TILE_BOUNDING_BOX",TILE_BOUNDING_REGION:"TILE_BOUNDING_REGION",TILE_BOUNDING_SPHERE:"TILE_BOUNDING_SPHERE",TILE_MINIMUM_HEIGHT:"TILE_MINIMUM_HEIGHT",TILE_MAXIMUM_HEIGHT:"TILE_MAXIMUM_HEIGHT",TILE_HORIZON_OCCLUSION_POINT:"TILE_HORIZON_OCCLUSION_POINT",TILE_GEOMETRIC_ERROR:"TILE_GEOMETRIC_ERROR",CONTENT_BOUNDING_BOX:"CONTENT_BOUNDING_BOX",CONTENT_BOUNDING_REGION:"CONTENT_BOUNDING_REGION",CONTENT_BOUNDING_SPHERE:"CONTENT_BOUNDING_SPHERE",CONTENT_MINIMUM_HEIGHT:"CONTENT_MINIMUM_HEIGHT",CONTENT_MAXIMUM_HEIGHT:"CONTENT_MAXIMUM_HEIGHT",CONTENT_HORIZON_OCCLUSION_POINT:"CONTENT_HORIZON_OCCLUSION_POINT"});let b5={};function b9(e,t,i){p.Z.defined("tile.implicitTileset",t.implicitTileset),p.Z.defined("tile.implicitCoordinates",t.implicitCoordinates);let n=t.implicitTileset,r=t.implicitCoordinates;this._implicitTileset=n,this._implicitCoordinates=r,this._implicitSubtree=void 0,this._tileset=e,this._tile=t,this._resource=i,this._metadata=void 0,this.featurePropertiesDirty=!1,this._group=void 0;let o=r.getTemplateValues(),a=n.subtreeUriTemplate.getDerivedResource({templateValues:o});this._url=a.getUrlComponent(!0),this._ready=!1}function b8(e,t,i){let n=b4.TILE_GEOMETRIC_ERROR;return(0,_.Z)(e)&&e.hasPropertyBySemantic(n)?e.getPropertyBySemantic(n):t.geometricError/Math.pow(2,i.level)}function b6(e,t,i,n,r,o){var a;let s,l,c,u,h;let d=e._implicitTileset;if(s=(0,m.Z)(o,!1)?i.implicitCoordinates:i.implicitCoordinates.getChildCoordinates(n),(0,_.Z)(t.tilePropertyTableJson)){l=t.getTileMetadataView(s);let e=b5.parseAllBoundingVolumeSemantics(l);c=e.tile,u=e.content}let f=t.contentPropertyTableJsons.length,p=!1;for(let e=0;e<f;e++)if(t.contentIsAvailableAtCoordinates(s,e)){p=!0;break}let g=(a=c,ve(h=!(0,_.Z)(a)||!(0,_.Z)(a.boundingVolume)||!b7(a.boundingVolume,a)&&b7(d.boundingVolume,a)?vt(d,s,n,(0,m.Z)(o,!1),i):a.boundingVolume,a),h),Z=[];for(let e=0;e<d.contentCount;e++){if(!t.contentIsAvailableAtIndex(r,e))continue;let i={uri:d.contentUriTemplates[e].getDerivedResource({templateValues:s.getTemplateValues()}).url},n=function(e,t){let i;return(0,_.Z)(t)&&(i=t.boundingVolume),b7(i,t)?ve(i,t):b7(e,t)&&ve(i=(0,uz.Z)(e,!0),t),i}(g,u);(0,_.Z)(n)&&(i.boundingVolume=n),Z.push((0,hv.Z)(i,d.contentHeaders[e]))}let y={boundingVolume:g,geometricError:b8(l,d,s),refine:d.refine,contents:Z},b=(0,uz.Z)(d.tileHeader,!0);delete b.boundingVolume,delete b.transform,delete b.metadata;let v=(0,hv.Z)(y,b,!0),T=vu(e,d.baseResource,v,i);return T.implicitCoordinates=s,T.implicitSubtree=t,T.metadata=l,T.hasImplicitContentMetadata=p,T}function b7(e,t){return(0,_.Z)(e)&&(0,_.Z)(t)&&((0,_.Z)(t.minimumHeight)||(0,_.Z)(t.maximumHeight))&&(hC(e,"3DTILES_bounding_volume_S2")||(0,_.Z)(e.region))}function ve(e,t){if((0,_.Z)(t)){var i,n,r,o,a,s;hC(e,"3DTILES_bounding_volume_S2")?(i=e.extensions["3DTILES_bounding_volume_S2"],n=t.minimumHeight,r=t.maximumHeight,(0,_.Z)(n)&&(i.minimumHeight=n),(0,_.Z)(r)&&(i.maximumHeight=r)):(0,_.Z)(e.region)&&(o=e.region,a=t.minimumHeight,s=t.maximumHeight,(0,_.Z)(a)&&(o[4]=a),(0,_.Z)(s)&&(o[5]=s))}}function vt(e,t,i,n,r){let o=e.boundingVolume;return hC(o,"3DTILES_bounding_volume_S2")?vi(n,r,i,t.level,t.x,t.y,t.z):(0,_.Z)(o.region)?{region:vc(o.region,t.level,t.x,t.y,t.z)}:{box:vs(o.box,t.level,t.x,t.y,t.z)}}function vi(e,t,i,n,r,o,a){let s,l;p.Z.typeOf.bool("parentIsPlaceholderTile",e),p.Z.typeOf.object("parentTile",t),p.Z.typeOf.number("childIndex",i),p.Z.typeOf.number("level",n),p.Z.typeOf.number("x",r),p.Z.typeOf.number("y",o),(0,_.Z)(a)&&p.Z.typeOf.number("z",a);let c=t._boundingVolume;if(e)return{extensions:{"3DTILES_bounding_volume_S2":{token:bB.getTokenFromId(c.s2Cell._cellId),minimumHeight:c.minimumHeight,maximumHeight:c.maximumHeight}}};let u=Number(t._boundingVolume.s2Cell._cellId>>BigInt(61)),h=u%2==0?bN.encode2D(n,r,o):bN.encode2D(n,o,r),d=bB.fromFacePositionLevel(u,BigInt(h),n);if((0,_.Z)(a)){let e=(c.maximumHeight+c.minimumHeight)/2;s=i<4?c.minimumHeight:e,l=i<4?e:c.maximumHeight}else s=c.minimumHeight,l=c.maximumHeight;return{extensions:{"3DTILES_bounding_volume_S2":{token:bB.getTokenFromId(d._cellId),minimumHeight:s,maximumHeight:l}}}}b5.parseAllBoundingVolumeSemantics=function(e){return p.Z.typeOf.object("tileMetadata",e),{tile:{boundingVolume:b5.parseBoundingVolumeSemantic("TILE",e),minimumHeight:b5._parseMinimumHeight("TILE",e),maximumHeight:b5._parseMaximumHeight("TILE",e)},content:{boundingVolume:b5.parseBoundingVolumeSemantic("CONTENT",e),minimumHeight:b5._parseMinimumHeight("CONTENT",e),maximumHeight:b5._parseMaximumHeight("CONTENT",e)}}},b5.parseBoundingVolumeSemantic=function(e,t){if(p.Z.typeOf.string("prefix",e),"TILE"!==e&&"CONTENT"!==e)throw new A.Z("prefix must be either 'TILE' or 'CONTENT'");p.Z.typeOf.object("tileMetadata",t);let i=`${e}_BOUNDING_BOX`,n=t.getPropertyBySemantic(i);if((0,_.Z)(n))return{box:n};let r=`${e}_BOUNDING_REGION`,o=t.getPropertyBySemantic(r);if((0,_.Z)(o))return{region:o};let a=`${e}_BOUNDING_SPHERE`,s=t.getPropertyBySemantic(a);if((0,_.Z)(s))return{sphere:s}},b5._parseMinimumHeight=function(e,t){if(p.Z.typeOf.string("prefix",e),"TILE"!==e&&"CONTENT"!==e)throw new A.Z("prefix must be either 'TILE' or 'CONTENT'");p.Z.typeOf.object("tileMetadata",t);let i=`${e}_MINIMUM_HEIGHT`;return t.getPropertyBySemantic(i)},b5._parseMaximumHeight=function(e,t){if(p.Z.typeOf.string("prefix",e),"TILE"!==e&&"CONTENT"!==e)throw new A.Z("prefix must be either 'TILE' or 'CONTENT'");p.Z.typeOf.object("tileMetadata",t);let i=`${e}_MAXIMUM_HEIGHT`;return t.getPropertyBySemantic(i)},Object.defineProperties(b9.prototype,{featuresLength:{get:function(){return 0}},pointsLength:{get:function(){return 0}},trianglesLength:{get:function(){return 0}},geometryByteLength:{get:function(){return 0}},texturesByteLength:{get:function(){return 0}},batchTableByteLength:{get:function(){return 0}},innerContents:{get:function(){}},ready:{get:function(){return this._ready}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){return this._url}},metadata:{get:function(){},set:function(){throw new A.Z("Implicit3DTileContent cannot have metadata")}},batchTable:{get:function(){}},group:{get:function(){return this._group},set:function(e){this._group=e}}}),b9.fromSubtreeJson=async function(e,t,i,n,r,o){let a;if(p.Z.defined("tile.implicitTileset",t.implicitTileset),p.Z.defined("tile.implicitCoordinates",t.implicitCoordinates),(0,_.Z)(n)===(0,_.Z)(r))throw new A.Z("One of json and arrayBuffer must be defined.");o=(0,m.Z)(o,0),(0,_.Z)(r)&&(a=new Uint8Array(r,o));let s=t.implicitTileset,l=t.implicitCoordinates,c=await bJ.fromSubtreeJson(i,n,a,s,l),u=new b9(e,t,i);return u._implicitSubtree=c,function(e,t){let i=e._tile,n=e._implicitCoordinates.childIndex,r=function(e,t,i,n){let r=b6(e,t,i,n,0,!0),o=e._tileset.statistics,a=[r],s=[],l=e._implicitTileset;for(let i=1;i<l.subtreeLevels;i++){let n=t.getLevelOffset(i),r=l.branchingFactor*a.length;for(let i=0;i<r;i++){let r=n+i;if(!t.tileIsAvailableAtIndex(r)){s.push(void 0);continue}let c=a[t.getParentMortonIndex(i)],u=b6(e,t,c,i%l.branchingFactor,r);c.children.push(u),o.numberOfTilesTotal++,s.push(u)}a=s,s=[]}return{rootTile:r,bottomRow:a}}(e,t,i,n),o=e._tileset.statistics;i.children.push(r.rootTile),o.numberOfTilesTotal++;let a=function(e,t,i){let n=[],r=e._implicitTileset.branchingFactor;for(let e=0;e<i.length;e++){let o=i[e];if((0,_.Z)(o))for(let i=0;i<r;i++){let a=e*r+i;t.childSubtreeIsAvailableAtIndex(a)&&n.push({tile:o,childIndex:i})}}return n}(e,t,r.bottomRow);for(let t=0;t<a.length;t++){let i=a[t],n=i.tile,r=function(e,t,i){let n=e._implicitTileset,r=t.implicitCoordinates.getChildCoordinates(i),o=vt(n,r,i,!1,t),a=b8(void 0,n,r),s=n.subtreeUriTemplate.getDerivedResource({templateValues:r.getTemplateValues()}).url,l={boundingVolume:o,geometricError:a,refine:n.refine,contents:[{uri:s}]},c=vu(e,n.baseResource,l,t);return c.implicitTileset=n,c.implicitCoordinates=r,c}(e,n,i.childIndex);n.children.push(r),o.numberOfTilesTotal++}}(u,c),u._ready=!0,u};let vn=new S.Z,vr=new S.Z,vo=new S.Z,va=new n2.Z;function vs(e,t,i,n,r){if(p.Z.typeOf.object("rootBox",e),p.Z.typeOf.number("level",t),p.Z.typeOf.number("x",i),p.Z.typeOf.number("y",n),(0,_.Z)(r)&&p.Z.typeOf.number("z",r),0===t)return e;let o=S.Z.unpack(e,0,vr),a=n2.Z.unpack(e,3,va),s=Math.pow(2,-t),l=0,c=S.Z.fromElements(s,s,1,vn);(0,_.Z)(r)&&(l=-1+(2*r+1)*s,c.z=s);let u=S.Z.fromElements(-1+(2*i+1)*s,-1+(2*n+1)*s,l,vo);u=n2.Z.multiplyByVector(a,u,vo),u=S.Z.add(u,o,vo);let h=n2.Z.clone(a);h=n2.Z.multiplyByScale(h,c,h);let d=Array(12);return S.Z.pack(u,d),n2.Z.pack(h,d,3),d}let vl=new r5.Z;function vc(e,t,i,n,r){if(p.Z.typeOf.object("rootRegion",e),p.Z.typeOf.number("level",t),p.Z.typeOf.number("x",i),p.Z.typeOf.number("y",n),(0,_.Z)(r)&&p.Z.typeOf.number("z",r),0===t)return e.slice();let o=r5.Z.unpack(e,0,vl),a=e[4],s=e[5],l=Math.pow(2,-t),c=l*o.width,u=eB.Z.negativePiToPi(o.west+i*c),h=eB.Z.negativePiToPi(u+c),d=l*o.height,f=eB.Z.negativePiToPi(o.south+n*d),m=eB.Z.negativePiToPi(f+d),g=a,Z=s;if((0,_.Z)(r)){let e=l*(s-a);g+=r*e,Z=g+e}return[u,f,h,m,g,Z]}function vu(e,t,i,n){return new e._tile.constructor(e._tileset,t,i,n)}function vh(e,t,i){this._tileset=e,this._tile=t,this._resource=i,this._model=void 0,this._metadata=void 0,this._group=void 0,this._ready=!1}function vd(e,t,i,n){let r={cull:!1,releaseGltfJson:!0,opaquePass:ej.Z.CESIUM_3D_TILE,modelMatrix:t.computedTransform,upAxis:e._modelUpAxis,forwardAxis:e._modelForwardAxis,incrementallyLoadTextures:!1,customShader:e.customShader,content:i,colorBlendMode:e.colorBlendMode,colorBlendAmount:e.colorBlendAmount,lightColor:e.lightColor,imageBasedLighting:e.imageBasedLighting,featureIdLabel:e.featureIdLabel,instanceFeatureIdLabel:e.instanceFeatureIdLabel,pointCloudShading:e.pointCloudShading,clippingPlanes:e.clippingPlanes,backFaceCulling:e.backFaceCulling,shadows:e.shadows,showCreditsOnScreen:e.showCreditsOnScreen,splitDirection:e.splitDirection,enableDebugWireframe:e._enableDebugWireframe,debugWireframe:e.debugWireframe,projectTo2D:e._projectTo2D,enablePick:e._enablePick,enableShowOutline:e._enableShowOutline,showOutline:e.showOutline,outlineColor:e.outlineColor};return(0,hv.Z)(n,r)}function vf(e,t,i){this._tileset=e,this._tile=t,this._resource=i,this.featurePropertiesDirty=!1,this._metadata=void 0,this._group=void 0,this._ready=!1}b9.prototype.hasProperty=function(e,t){return!1},b9.prototype.getFeature=function(e){},b9.prototype.applyDebugSettings=function(e,t){},b9.prototype.applyStyle=function(e){},b9.prototype.update=function(e,t){},b9.prototype.pick=function(e,t,i){},b9.prototype.isDestroyed=function(){return!1},b9.prototype.destroy=function(){return this._implicitSubtree=this._implicitSubtree&&this._implicitSubtree.destroy(),(0,g.Z)(this)},b9._deriveBoundingBox=vs,b9._deriveBoundingRegion=vc,b9._deriveBoundingVolumeS2=vi,Object.defineProperties(vh.prototype,{featuresLength:{get:function(){let e=this._model,t=e.featureTables,i=e.featureTableId;return(0,_.Z)(t)&&(0,_.Z)(t[i])?t[i].featuresLength:0}},pointsLength:{get:function(){return this._model.statistics.pointsLength}},trianglesLength:{get:function(){return this._model.statistics.trianglesLength}},geometryByteLength:{get:function(){return this._model.statistics.geometryByteLength}},texturesByteLength:{get:function(){return this._model.statistics.texturesByteLength}},batchTableByteLength:{get:function(){let e=this._model.statistics;return e.propertyTablesByteLength+e.batchTexturesByteLength}},innerContents:{get:function(){}},ready:{get:function(){return this._ready}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){return this._resource.getUrlComponent(!0)}},batchTable:{get:function(){let e=this._model,t=e.featureTables,i=e.featureTableId;if((0,_.Z)(t)&&(0,_.Z)(t[i]))return t[i]}},metadata:{get:function(){return this._metadata},set:function(e){this._metadata=e}},group:{get:function(){return this._group},set:function(e){this._group=e}}}),vh.prototype.getFeature=function(e){let t=this._model,i=t.featureTableId;if(!(0,_.Z)(i))throw new A.Z("No feature ID set is selected. Make sure Cesium3DTileset.featureIdLabel or Cesium3DTileset.instanceFeatureIdLabel is defined");let n=t.featureTables[i];if(!(0,_.Z)(n))throw new A.Z("No feature table found for the selected feature ID set");let r=n.featuresLength;if(!(0,_.Z)(e)||e<0||e>=r)throw new A.Z(`featureId is required and must be between 0 and featuresLength - 1 (${r-1}).`);return n.getFeature(e)},vh.prototype.hasProperty=function(e,t){let i=this._model,n=i.featureTableId;return!!(0,_.Z)(n)&&i.featureTables[n].hasProperty(e,t)},vh.prototype.applyDebugSettings=function(e,t){t=e?t:C.Z.WHITE,0===this.featuresLength?this._model.color=t:(0,_.Z)(this.batchTable)&&this.batchTable.setAllColor(t)},vh.prototype.applyStyle=function(e){this._model.style=e},vh.prototype.update=function(e,t){let i=this._model,n=this._tile;i.colorBlendAmount=e.colorBlendAmount,i.colorBlendMode=e.colorBlendMode,i.modelMatrix=n.computedTransform,i.customShader=e.customShader,i.featureIdLabel=e.featureIdLabel,i.instanceFeatureIdLabel=e.instanceFeatureIdLabel,i.lightColor=e.lightColor,i.imageBasedLighting=e.imageBasedLighting,i.backFaceCulling=e.backFaceCulling,i.shadows=e.shadows,i.showCreditsOnScreen=e.showCreditsOnScreen,i.splitDirection=e.splitDirection,i.debugWireframe=e.debugWireframe,i.showOutline=e.showOutline,i.outlineColor=e.outlineColor,i.pointCloudShading=e.pointCloudShading;let r=e.clippingPlanes;i.referenceMatrix=e.clippingPlanesOriginMatrix,(0,_.Z)(r)&&n.clippingPlanesDirty&&(i._clippingPlanes=r.enabled&&n._isClipped?r:void 0),(0,_.Z)(r)&&(0,_.Z)(i._clippingPlanes)&&i._clippingPlanes!==r&&(i._clippingPlanes=r,i._clippingPlanesState=0);let o=e.clippingPolygons;(0,_.Z)(o)&&n.clippingPolygonsDirty&&(i._clippingPolygons=o.enabled&&n._isClippedByPolygon?o:void 0),(0,_.Z)(o)&&(0,_.Z)(i._clippingPolygons)&&i._clippingPolygons!==o&&(i._clippingPolygons=o,i._clippingPolygonsState=0),i.update(t),!this._ready&&i.ready&&(i.activeAnimations.addAll({loop:mh.REPEAT}),this._ready=!0)},vh.prototype.isDestroyed=function(){return!1},vh.prototype.destroy=function(){return this._model=this._model&&this._model.destroy(),(0,g.Z)(this)},vh.fromGltf=async function(e,t,i,n){let r=new vh(e,t,i),o=vd(e,t,r,{gltf:n,basePath:i}),a=e.vectorClassificationOnly?void 0:e.classificationType;o.classificationType=a;let s=await ZQ.fromGltfAsync(o);return r._model=s,r},vh.fromB3dm=async function(e,t,i,n,r){let o=new vh(e,t,i),a=vd(e,t,o,{arrayBuffer:n,byteOffset:r,resource:i}),s=e.vectorClassificationOnly?void 0:e.classificationType;a.classificationType=s;let l=await ZQ.fromB3dm(a);return o._model=l,o},vh.fromI3dm=async function(e,t,i,n,r){let o=new vh(e,t,i),a=vd(e,t,o,{arrayBuffer:n,byteOffset:r,resource:i}),s=await ZQ.fromI3dm(a);return o._model=s,o},vh.fromPnts=async function(e,t,i,n,r){let o=new vh(e,t,i),a=vd(e,t,o,{arrayBuffer:n,byteOffset:r,resource:i}),s=await ZQ.fromPnts(a);return o._model=s,o},vh.fromGeoJson=async function(e,t,i,n){let r=new vh(e,t,i),o=vd(e,t,r,{geoJson:n,resource:i}),a=await ZQ.fromGeoJson(o);return r._model=a,r},vh.prototype.pick=function(e,t,i){if(!(0,_.Z)(this._model)||!this._ready)return;let n=t.verticalExaggeration,r=t.verticalExaggerationRelativeHeight;return this._model.pick(e,t,n,r,el.Z.WGS84,i)},Object.defineProperties(vf.prototype,{featuresLength:{get:function(){return 0}},pointsLength:{get:function(){return 0}},trianglesLength:{get:function(){return 0}},geometryByteLength:{get:function(){return 0}},texturesByteLength:{get:function(){return 0}},batchTableByteLength:{get:function(){return 0}},innerContents:{get:function(){}},ready:{get:function(){return this._ready}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){return this._resource.getUrlComponent(!0)}},batchTable:{get:function(){}},metadata:{get:function(){return this._metadata},set:function(e){this._metadata=e}},group:{get:function(){return this._group},set:function(e){this._group=e}}}),vf.fromJson=function(e,t,i,n){let r=new vf(e,t,i);return r._tileset.loadTileset(r._resource,n,r._tile),r._ready=!0,r},vf.prototype.hasProperty=function(e,t){return!1},vf.prototype.getFeature=function(e){},vf.prototype.applyDebugSettings=function(e,t){},vf.prototype.applyStyle=function(e){},vf.prototype.update=function(e,t){},vf.prototype.pick=function(e,t,i){},vf.prototype.isDestroyed=function(){return!1},vf.prototype.destroy=function(){return(0,g.Z)(this)};var vp=function(e,t,i,n,r){return function(){let o=document.createElement("canvas"),a=r+2*n;o.height=o.width=a;let s=o.getContext("2d");return s.clearRect(0,0,a,a),0!==n&&(s.beginPath(),s.arc(a/2,a/2,a/2,0,2*Math.PI,!0),s.closePath(),s.fillStyle=i,s.fill(),e<1&&(s.save(),s.globalCompositeOperation="destination-out",s.beginPath(),s.arc(a/2,a/2,r/2,0,2*Math.PI,!0),s.closePath(),s.fillStyle="black",s.fill(),s.restore())),s.beginPath(),s.arc(a/2,a/2,r/2,0,2*Math.PI,!0),s.closePath(),s.fillStyle=t,s.fill(),o}};function vm(e,t,i,n,r){this._content=e,this._billboard=i,this._label=n,this._polyline=r,this._batchId=t,this._billboardImage=void 0,this._billboardColor=void 0,this._billboardOutlineColor=void 0,this._billboardOutlineWidth=void 0,this._billboardSize=void 0,this._pointSize=void 0,this._color=void 0,this._pointSize=void 0,this._pointOutlineColor=void 0,this._pointOutlineWidth=void 0,this._heightOffset=void 0,this._pickIds=[,,,],vg(this)}let v_=new ea.Z;function vg(e){let t=e._billboard;if((0,_.Z)(e._billboardImage)&&e._billboardImage!==t.image){t.image=e._billboardImage;return}if((0,_.Z)(e._billboardImage))return;let i=(0,m.Z)(e._color,vm.defaultColor),n=(0,m.Z)(e._pointOutlineColor,vm.defaultPointOutlineColor),r=(0,m.Z)(e._pointOutlineWidth,vm.defaultPointOutlineWidth),o=(0,m.Z)(e._pointSize,vm.defaultPointSize),a=e._billboardColor,s=e._billboardOutlineColor,l=e._billboardOutlineWidth,c=e._billboardSize;if(C.Z.equals(i,a)&&C.Z.equals(n,s)&&r===l&&o===c)return;e._billboardColor=C.Z.clone(i,e._billboardColor),e._billboardOutlineColor=C.Z.clone(n,e._billboardOutlineColor),e._billboardOutlineWidth=r,e._billboardSize=o;let u=i.alpha,h=i.toCssColorString(),d=n.toCssColorString(),f=JSON.stringify([h,o,d,r]);t.setImage(f,vp(u,h,d,r,o))}Object.defineProperties(vm.prototype,{show:{get:function(){return this._label.show},set:function(e){this._label.show=e,this._billboard.show=e,this._polyline.show=e}},color:{get:function(){return this._color},set:function(e){this._color=C.Z.clone(e,this._color),vg(this)}},pointSize:{get:function(){return this._pointSize},set:function(e){this._pointSize=e,vg(this)}},pointOutlineColor:{get:function(){return this._pointOutlineColor},set:function(e){this._pointOutlineColor=C.Z.clone(e,this._pointOutlineColor),vg(this)}},pointOutlineWidth:{get:function(){return this._pointOutlineWidth},set:function(e){this._pointOutlineWidth=e,vg(this)}},labelColor:{get:function(){return this._label.fillColor},set:function(e){this._label.fillColor=e,this._polyline.show=this._label.show&&e.alpha>0}},labelOutlineColor:{get:function(){return this._label.outlineColor},set:function(e){this._label.outlineColor=e}},labelOutlineWidth:{get:function(){return this._label.outlineWidth},set:function(e){this._label.outlineWidth=e}},font:{get:function(){return this._label.font},set:function(e){this._label.font=e}},labelStyle:{get:function(){return this._label.style},set:function(e){this._label.style=e}},labelText:{get:function(){return this._label.text},set:function(e){(0,_.Z)(e)||(e=""),this._label.text=e}},backgroundColor:{get:function(){return this._label.backgroundColor},set:function(e){this._label.backgroundColor=e}},backgroundPadding:{get:function(){return this._label.backgroundPadding},set:function(e){this._label.backgroundPadding=e}},backgroundEnabled:{get:function(){return this._label.showBackground},set:function(e){this._label.showBackground=e}},scaleByDistance:{get:function(){return this._label.scaleByDistance},set:function(e){this._label.scaleByDistance=e,this._billboard.scaleByDistance=e}},translucencyByDistance:{get:function(){return this._label.translucencyByDistance},set:function(e){this._label.translucencyByDistance=e,this._billboard.translucencyByDistance=e}},distanceDisplayCondition:{get:function(){return this._label.distanceDisplayCondition},set:function(e){this._label.distanceDisplayCondition=e,this._polyline.distanceDisplayCondition=e,this._billboard.distanceDisplayCondition=e}},heightOffset:{get:function(){return this._heightOffset},set:function(e){let t=(0,m.Z)(this._heightOffset,0),i=this._content.tileset.ellipsoid,n=i.cartesianToCartographic(this._billboard.position,v_);n.height=n.height-t+e;let r=i.cartographicToCartesian(n);this._billboard.position=r,this._label.position=this._billboard.position,this._polyline.positions=[this._polyline.positions[0],r],this._heightOffset=e}},anchorLineEnabled:{get:function(){return this._polyline.show},set:function(e){this._polyline.show=e}},anchorLineColor:{get:function(){return this._polyline.material.uniforms.color},set:function(e){this._polyline.material.uniforms.color=C.Z.clone(e,this._polyline.material.uniforms.color)}},image:{get:function(){return this._billboardImage},set:function(e){let t=this._billboardImage!==e;this._billboardImage=e,t&&vg(this)}},disableDepthTestDistance:{get:function(){return this._label.disableDepthTestDistance},set:function(e){this._label.disableDepthTestDistance=e,this._billboard.disableDepthTestDistance=e}},horizontalOrigin:{get:function(){return this._billboard.horizontalOrigin},set:function(e){this._billboard.horizontalOrigin=e}},verticalOrigin:{get:function(){return this._billboard.verticalOrigin},set:function(e){this._billboard.verticalOrigin=e}},labelHorizontalOrigin:{get:function(){return this._label.horizontalOrigin},set:function(e){this._label.horizontalOrigin=e}},labelVerticalOrigin:{get:function(){return this._label.verticalOrigin},set:function(e){this._label.verticalOrigin=e}},content:{get:function(){return this._content}},tileset:{get:function(){return this._content.tileset}},primitive:{get:function(){return this._content.tileset}},pickIds:{get:function(){let e=this._pickIds;return e[0]=this._billboard.pickId,e[1]=this._label.pickId,e[2]=this._polyline.pickId,e}}}),vm.defaultColor=C.Z.WHITE,vm.defaultPointOutlineColor=C.Z.BLACK,vm.defaultPointOutlineWidth=0,vm.defaultPointSize=8,vm.prototype.hasProperty=function(e){return this._content.batchTable.hasProperty(this._batchId,e)},vm.prototype.getPropertyIds=function(e){return this._content.batchTable.getPropertyIds(this._batchId,e)},vm.prototype.getProperty=function(e){return this._content.batchTable.getProperty(this._batchId,e)},vm.prototype.getPropertyInherited=function(e){return mH.Z.getPropertyInherited(this._content,this._batchId,e)},vm.prototype.setProperty=function(e,t){this._content.batchTable.setProperty(this._batchId,e,t),this._content.featurePropertiesDirty=!0},vm.prototype.isExactClass=function(e){return this._content.batchTable.isExactClass(this._batchId,e)},vm.prototype.isClass=function(e){return this._content.batchTable.isClass(this._batchId,e)},vm.prototype.getExactClassName=function(){return this._content.batchTable.getExactClassName(this._batchId)};var vZ=i(2494);function vy(e){this._positions=e.positions,this._batchTable=e.batchTable,this._batchIds=e.batchIds,this._rectangle=e.rectangle,this._minHeight=e.minimumHeight,this._maxHeight=e.maximumHeight,this._billboardCollection=new tv({batchTable:e.batchTable}),this._labelCollection=new ia({batchTable:e.batchTable}),this._polylineCollection=new vZ.Z,this._polylineCollection._useHighlightColor=!0,this._packedBuffer=void 0,this._ready=!1,this._promise=void 0,this._error=void 0}Object.defineProperties(vy.prototype,{ready:{get:function(){return this._ready}},pointsLength:{get:function(){return this._billboardCollection.length}},texturesByteLength:{get:function(){return this._billboardCollection.textureAtlas.texture.sizeInBytes+this._labelCollection._textureAtlas.texture.sizeInBytes}}});let vb=new hD.Z("createVectorTilePoints",5),vv=new S.Z;vy.prototype.createFeatures=function(e,t){let i=this._billboardCollection,n=this._labelCollection,r=this._polylineCollection,o=this._batchIds,a=o.length;for(let s=0;s<a;++s){let a=o[s],l=i.get(s),c=n.get(s),u=r.get(s);t[a]=new vm(e,a,l,c,u)}},vy.prototype.applyDebugSettings=function(e,t){e?(C.Z.clone(t,this._billboardCollection._highlightColor),C.Z.clone(t,this._labelCollection._highlightColor),C.Z.clone(t,this._polylineCollection._highlightColor)):(C.Z.clone(C.Z.WHITE,this._billboardCollection._highlightColor),C.Z.clone(C.Z.WHITE,this._labelCollection._highlightColor),C.Z.clone(C.Z.WHITE,this._polylineCollection._highlightColor))};let vT=new C.Z,vE=new C.Z,vx=new C.Z,vw=new C.Z,vS=new C.Z,vC=new C.Z,vA=new O.Z,vI=new O.Z,vO=new I.Z;function vD(e){this._batchTable=e.batchTable,this._batchIds=e.batchIds,this._positions=e.positions,this._counts=e.counts,this._indices=e.indices,this._indexCounts=e.indexCounts,this._indexOffsets=void 0,this._batchTableColors=void 0,this._packedBuffer=void 0,this._batchedPositions=void 0,this._transferrableBatchIds=void 0,this._vertexBatchIds=void 0,this._ellipsoid=(0,m.Z)(e.ellipsoid,el.Z.WGS84),this._minimumHeight=e.minimumHeight,this._maximumHeight=e.maximumHeight,this._polygonMinimumHeights=e.polygonMinimumHeights,this._polygonMaximumHeights=e.polygonMaximumHeights,this._center=(0,m.Z)(e.center,S.Z.ZERO),this._rectangle=e.rectangle,this._center=void 0,this._boundingVolume=e.boundingVolume,this._boundingVolumes=void 0,this._batchedIndices=void 0,this._ready=!1,this._promise=void 0,this._error=void 0,this._primitive=void 0,this.debugWireframe=!1,this.forceRebatch=!1,this.classificationType=nd.Z.BOTH}vy.prototype.applyStyle=function(e,t){if(!(0,_.Z)(e)){!function(e,t){let i=e._batchIds,n=i.length;for(let e=0;e<n;++e){let n=t[i[e]];n.show=!0,n.pointSize=vm.defaultPointSize,n.color=vm.defaultColor,n.pointOutlineColor=vm.defaultPointOutlineColor,n.pointOutlineWidth=vm.defaultPointOutlineWidth,n.labelColor=C.Z.WHITE,n.labelOutlineColor=C.Z.WHITE,n.labelOutlineWidth=1,n.font="30px sans-serif",n.labelStyle=tk.FILL,n.labelText=void 0,n.backgroundColor=new C.Z(.165,.165,.165,.8),n.backgroundPadding=new w.Z(7,5),n.backgroundEnabled=!1,n.scaleByDistance=void 0,n.translucencyByDistance=void 0,n.distanceDisplayCondition=void 0,n.heightOffset=0,n.anchorLineEnabled=!1,n.anchorLineColor=C.Z.WHITE,n.image=void 0,n.disableDepthTestDistance=0,n.horizontalOrigin=P.CENTER,n.verticalOrigin=R.CENTER,n.labelHorizontalOrigin=P.RIGHT,n.labelVerticalOrigin=R.BASELINE}}(this,t);return}let i=this._batchIds,n=i.length;for(let r=0;r<n;++r){let n=t[i[r]];if((0,_.Z)(e.show)&&(n.show=e.show.evaluate(n)),(0,_.Z)(e.pointSize)&&(n.pointSize=e.pointSize.evaluate(n)),(0,_.Z)(e.color)&&(n.color=e.color.evaluateColor(n,vT)),(0,_.Z)(e.pointOutlineColor)&&(n.pointOutlineColor=e.pointOutlineColor.evaluateColor(n,vE)),(0,_.Z)(e.pointOutlineWidth)&&(n.pointOutlineWidth=e.pointOutlineWidth.evaluate(n)),(0,_.Z)(e.labelColor)&&(n.labelColor=e.labelColor.evaluateColor(n,vx)),(0,_.Z)(e.labelOutlineColor)&&(n.labelOutlineColor=e.labelOutlineColor.evaluateColor(n,vw)),(0,_.Z)(e.labelOutlineWidth)&&(n.labelOutlineWidth=e.labelOutlineWidth.evaluate(n)),(0,_.Z)(e.font)&&(n.font=e.font.evaluate(n)),(0,_.Z)(e.labelStyle)&&(n.labelStyle=e.labelStyle.evaluate(n)),(0,_.Z)(e.labelText)?n.labelText=e.labelText.evaluate(n):n.labelText=void 0,(0,_.Z)(e.backgroundColor)&&(n.backgroundColor=e.backgroundColor.evaluateColor(n,vS)),(0,_.Z)(e.backgroundPadding)&&(n.backgroundPadding=e.backgroundPadding.evaluate(n)),(0,_.Z)(e.backgroundEnabled)&&(n.backgroundEnabled=e.backgroundEnabled.evaluate(n)),(0,_.Z)(e.scaleByDistance)){let t=e.scaleByDistance.evaluate(n);(0,_.Z)(t)?(vA.near=t.x,vA.nearValue=t.y,vA.far=t.z,vA.farValue=t.w,n.scaleByDistance=vA):n.scaleByDistance=void 0}else n.scaleByDistance=void 0;if((0,_.Z)(e.translucencyByDistance)){let t=e.translucencyByDistance.evaluate(n);(0,_.Z)(t)?(vI.near=t.x,vI.nearValue=t.y,vI.far=t.z,vI.farValue=t.w,n.translucencyByDistance=vI):n.translucencyByDistance=void 0}else n.translucencyByDistance=void 0;if((0,_.Z)(e.distanceDisplayCondition)){let t=e.distanceDisplayCondition.evaluate(n);(0,_.Z)(t)?(vO.near=t.x,vO.far=t.y,n.distanceDisplayCondition=vO):n.distanceDisplayCondition=void 0}else n.distanceDisplayCondition=void 0;(0,_.Z)(e.heightOffset)&&(n.heightOffset=e.heightOffset.evaluate(n)),(0,_.Z)(e.anchorLineEnabled)&&(n.anchorLineEnabled=e.anchorLineEnabled.evaluate(n)),(0,_.Z)(e.anchorLineColor)&&(n.anchorLineColor=e.anchorLineColor.evaluateColor(n,vC)),(0,_.Z)(e.image)?n.image=e.image.evaluate(n):n.image=void 0,(0,_.Z)(e.disableDepthTestDistance)&&(n.disableDepthTestDistance=e.disableDepthTestDistance.evaluate(n)),(0,_.Z)(e.horizontalOrigin)&&(n.horizontalOrigin=e.horizontalOrigin.evaluate(n)),(0,_.Z)(e.verticalOrigin)&&(n.verticalOrigin=e.verticalOrigin.evaluate(n)),(0,_.Z)(e.labelHorizontalOrigin)&&(n.labelHorizontalOrigin=e.labelHorizontalOrigin.evaluate(n)),(0,_.Z)(e.labelVerticalOrigin)&&(n.labelVerticalOrigin=e.labelVerticalOrigin.evaluate(n))}},vy.prototype.update=function(e){if(!this._ready){if((0,_.Z)(this._promise)||(this._promise=function(e,t){let i=e._positions,n=e._packedBuffer;(0,_.Z)(n)||(i=e._positions=i.slice(),e._batchIds=e._batchIds.slice(),n=e._packedBuffer=function(e,t){let i=e._rectangle,n=e._minHeight,r=e._maxHeight,o=new Float64Array(2+r5.Z.packedLength+el.Z.packedLength),a=0;return o[a++]=n,o[a++]=r,r5.Z.pack(i,o,a),a+=r5.Z.packedLength,el.Z.pack(t,o,a),o}(e,t));let r=[i.buffer,n.buffer],o={positions:i.buffer,packedBuffer:n.buffer},a=vb.scheduleTask(o,r);if((0,_.Z)(a))return a.then(t=>{if(e.isDestroyed())return;e._positions=new Float64Array(t.positions);let n=e._billboardCollection,r=e._labelCollection,o=e._polylineCollection;i=e._positions;let a=e._batchIds,s=i.length/3;for(let e=0;e<s;++e){let t=a[e],s=S.Z.unpack(i,3*e,vv),l=n.add();l.position=s,l._batchIndex=t;let c=r.add();c.text=" ",c.position=s,c._batchIndex=t,o.add().positions=[S.Z.clone(s),S.Z.clone(s)]}e._positions=void 0,e._packedBuffer=void 0,e._ready=!0}).catch(t=>{e.isDestroyed()||(e._error=t)})}(this,e.mapProjection.ellipsoid)),(0,_.Z)(this._error)){let e=this._error;throw this._error=void 0,e}return}this._polylineCollection.update(e),this._billboardCollection.update(e),this._labelCollection.update(e)},vy.prototype.isDestroyed=function(){return!1},vy.prototype.destroy=function(){return this._billboardCollection=this._billboardCollection&&this._billboardCollection.destroy(),this._labelCollection=this._labelCollection&&this._labelCollection.destroy(),this._polylineCollection=this._polylineCollection&&this._polylineCollection.destroy(),(0,g.Z)(this)},Object.defineProperties(vD.prototype,{trianglesLength:{get:function(){return(0,_.Z)(this._primitive)?this._primitive.trianglesLength:0}},geometryByteLength:{get:function(){return(0,_.Z)(this._primitive)?this._primitive.geometryByteLength:0}},ready:{get:function(){return this._ready}}});let vP=new hD.Z("createVectorTilePolygons",5),vR=new C.Z;vD.prototype.createFeatures=function(e,t){this._primitive.createFeatures(e,t)},vD.prototype.applyDebugSettings=function(e,t){this._primitive.applyDebugSettings(e,t)},vD.prototype.applyStyle=function(e,t){this._primitive.applyStyle(e,t)},vD.prototype.updateCommands=function(e,t){this._primitive.updateCommands(e,t)},vD.prototype.update=function(e){if(!this._ready){if((0,_.Z)(this._promise)||(this._promise=function(e){if((0,_.Z)(e._primitive))return;let t=e._positions,i=e._counts,n=e._indexCounts,r=e._indices,o=e._transferrableBatchIds,a=e._batchTableColors,s=e._packedBuffer;if(!(0,_.Z)(a)){t=e._positions=e._positions.slice(),i=e._counts=e._counts.slice(),n=e._indexCounts=e._indexCounts.slice(),r=e._indices=e._indices.slice(),e._center=e._ellipsoid.cartographicToCartesian(r5.Z.center(e._rectangle)),o=e._transferrableBatchIds=new Uint32Array(e._batchIds),a=e._batchTableColors=new Uint32Array(o.length);let l=e._batchTable,c=a.length;for(let e=0;e<c;++e){let t=l.getColor(e,vR);a[e]=t.toRgba()}s=e._packedBuffer=function(e){let t=new Float64Array(3+S.Z.packedLength+el.Z.packedLength+r5.Z.packedLength),i=0;return t[i++]=e._indices.BYTES_PER_ELEMENT,t[i++]=e._minimumHeight,t[i++]=e._maximumHeight,S.Z.pack(e._center,t,i),i+=S.Z.packedLength,el.Z.pack(e._ellipsoid,t,i),i+=el.Z.packedLength,r5.Z.pack(e._rectangle,t,i),t}(e)}let l=[t.buffer,i.buffer,n.buffer,r.buffer,o.buffer,a.buffer,s.buffer],c={packedBuffer:s.buffer,positions:t.buffer,counts:i.buffer,indexCounts:n.buffer,indices:r.buffer,batchIds:o.buffer,batchTableColors:a.buffer},u=e._polygonMinimumHeights,h=e._polygonMaximumHeights;(0,_.Z)(u)&&(0,_.Z)(h)&&(u=u.slice(),h=h.slice(),l.push(u.buffer,h.buffer),c.minimumHeights=u,c.maximumHeights=h);let d=vP.scheduleTask(c,l);if((0,_.Z)(d))return d.then(t=>{if(e.isDestroyed())return;e._positions=void 0,e._counts=void 0,e._polygonMinimumHeights=void 0,e._polygonMaximumHeights=void 0;let i=new Float64Array(t.packedBuffer),n=i[0];(function(e,t){let i=1,n=t[i++],r=e._boundingVolumes=Array(n);for(let e=0;e<n;++e)r[e]=sZ.Z.unpack(t,i),i+=sZ.Z.packedLength;let o=t[i++],a=e._batchedIndices=Array(o);for(let e=0;e<o;++e){let n=C.Z.unpack(t,i);i+=C.Z.packedLength;let r=t[i++],o=t[i++],s=t[i++],l=Array(s);for(let e=0;e<s;++e)l[e]=t[i++];a[e]=new yG({color:n,offset:r,count:o,batchIds:l})}})(e,i),e._indices=2===ez.Z.getSizeInBytes(n)?new Uint16Array(t.indices):new Uint32Array(t.indices),e._indexOffsets=new Uint32Array(t.indexOffsets),e._indexCounts=new Uint32Array(t.indexCounts),e._batchedPositions=new Float32Array(t.positions),e._vertexBatchIds=new Uint16Array(t.batchIds),(0,_.Z)(e._primitive)||(e._primitive=new bp({batchTable:e._batchTable,positions:e._batchedPositions,batchIds:e._batchIds,vertexBatchIds:e._vertexBatchIds,indices:e._indices,indexOffsets:e._indexOffsets,indexCounts:e._indexCounts,batchedIndices:e._batchedIndices,boundingVolume:e._boundingVolume,boundingVolumes:e._boundingVolumes,center:e._center}),e._batchTable=void 0,e._batchIds=void 0,e._positions=void 0,e._counts=void 0,e._indices=void 0,e._indexCounts=void 0,e._indexOffsets=void 0,e._batchTableColors=void 0,e._packedBuffer=void 0,e._batchedPositions=void 0,e._transferrableBatchIds=void 0,e._vertexBatchIds=void 0,e._ellipsoid=void 0,e._minimumHeight=void 0,e._maximumHeight=void 0,e._polygonMinimumHeights=void 0,e._polygonMaximumHeights=void 0,e._center=void 0,e._rectangle=void 0,e._boundingVolume=void 0,e._boundingVolumes=void 0,e._batchedIndices=void 0),e._ready=!0}).catch(t=>{e.isDestroyed()||(e._error=t)})}(this)),(0,_.Z)(this._error)){let e=this._error;throw this._error=void 0,e}return}this._primitive.debugWireframe=this.debugWireframe,this._primitive.forceRebatch=this.forceRebatch,this._primitive.classificationType=this.classificationType,this._primitive.update(e)},vD.prototype.isDestroyed=function(){return!1},vD.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),(0,g.Z)(this)};var vN=i(8898);function vL(e){this._positions=e.positions,this._widths=e.widths,this._counts=e.counts,this._batchIds=e.batchIds,this._ellipsoid=(0,m.Z)(e.ellipsoid,el.Z.WGS84),this._minimumHeight=e.minimumHeight,this._maximumHeight=e.maximumHeight,this._center=e.center,this._rectangle=e.rectangle,this._boundingVolume=e.boundingVolume,this._batchTable=e.batchTable,this._va=void 0,this._sp=void 0,this._rs=void 0,this._uniformMap=void 0,this._command=void 0,this._transferrableBatchIds=void 0,this._packedBuffer=void 0,this._keepDecodedPositions=e.keepDecodedPositions,this._decodedPositions=void 0,this._decodedPositionOffsets=void 0,this._currentPositions=void 0,this._previousPositions=void 0,this._nextPositions=void 0,this._expandAndWidth=void 0,this._vertexBatchIds=void 0,this._indices=void 0,this._constantColor=C.Z.clone(C.Z.WHITE),this._highlightColor=this._constantColor,this._trianglesLength=0,this._geometryByteLength=0,this._ready=!1,this._promise=void 0,this._error=void 0}Object.defineProperties(vL.prototype,{trianglesLength:{get:function(){return this._trianglesLength}},geometryByteLength:{get:function(){return this._geometryByteLength}},ready:{get:function(){return this._ready}}});let vM=new hD.Z("createVectorTilePolylines",5),vF={previousPosition:0,currentPosition:1,nextPosition:2,expandAndWidth:3,a_batchId:4},vz=new er.Z,vB=new S.Z;vL.getPolylinePositions=function(e,t){let i,n;let r=e._batchIds,o=e._decodedPositions,a=e._decodedPositionOffsets;if(!(0,_.Z)(r)||!(0,_.Z)(o))return;let s=r.length,l=0,c=0;for(i=0;i<s;++i)r[i]===t&&(l+=a[i+1]-a[i]);if(0===l)return;let u=new Float64Array(3*l);for(i=0;i<s;++i)if(r[i]===t){let e=a[i],t=a[i+1]-e;for(n=0;n<t;++n){let t=(e+n)*3;u[c++]=o[t],u[c++]=o[t+1],u[c++]=o[t+2]}}return u},vL.prototype.getPositions=function(e){return vL.getPolylinePositions(this,e)},vL.prototype.createFeatures=function(e,t){let i=this._batchIds,n=i.length;for(let r=0;r<n;++r){let n=i[r];t[n]=new mH.Z(e,n)}},vL.prototype.applyDebugSettings=function(e,t){this._highlightColor=e?t:this._constantColor};let vU=new C.Z,vk=C.Z.WHITE;function vV(e){this._positions=e.positions,this._widths=e.widths,this._counts=e.counts,this._batchIds=e.batchIds,this._ellipsoid=(0,m.Z)(e.ellipsoid,el.Z.WGS84),this._minimumHeight=e.minimumHeight,this._maximumHeight=e.maximumHeight,this._center=e.center,this._rectangle=e.rectangle,this._batchTable=e.batchTable,this._va=void 0,this._sp=void 0,this._rs=void 0,this._uniformMap=void 0,this._command=void 0,this._transferrableBatchIds=void 0,this._packedBuffer=void 0,this._minimumMaximumVectorHeights=new w.Z(d.Z._defaultMinTerrainHeight,d.Z._defaultMaxTerrainHeight),this._boundingVolume=sZ.Z.fromRectangle(e.rectangle,d.Z._defaultMinTerrainHeight,d.Z._defaultMaxTerrainHeight,this._ellipsoid),this._classificationType=e.classificationType,this._keepDecodedPositions=e.keepDecodedPositions,this._decodedPositions=void 0,this._decodedPositionOffsets=void 0,this._startEllipsoidNormals=void 0,this._endEllipsoidNormals=void 0,this._startPositionAndHeights=void 0,this._startFaceNormalAndVertexCornerIds=void 0,this._endPositionAndHeights=void 0,this._endFaceNormalAndHalfWidths=void 0,this._vertexBatchIds=void 0,this._indices=void 0,this._constantColor=C.Z.clone(C.Z.WHITE),this._highlightColor=this._constantColor,this._trianglesLength=0,this._geometryByteLength=0,this._ready=!1,this._promise=void 0,this._error=void 0}vL.prototype.applyStyle=function(e,t){if(!(0,_.Z)(e)){!function(e,t){let i=e._batchIds,n=i.length;for(let e=0;e<n;++e){let n=t[i[e]];n.show=!0,n.color=C.Z.WHITE}}(this,t);return}let i=this._batchIds,n=i.length;for(let r=0;r<n;++r){let n=t[i[r]];n.color=(0,_.Z)(e.color)?e.color.evaluateColor(n,vU):vk,n.show=!(0,_.Z)(e.show)||e.show.evaluate(n)}},vL.prototype.update=function(e){var t;let i=e.context;if(!this._ready){if((0,_.Z)(this._promise)||(this._promise=function(e,t){if((0,_.Z)(e._va))return;let i=e._positions,n=e._widths,r=e._counts,o=e._transferrableBatchIds,a=e._packedBuffer;(0,_.Z)(a)||(i=e._positions=i.slice(),n=e._widths=n.slice(),r=e._counts=r.slice(),o=e._transferrableBatchIds=e._batchIds.slice(),a=e._packedBuffer=function(e){let t=e._rectangle,i=e._minimumHeight,n=e._maximumHeight,r=e._ellipsoid,o=e._center,a=new Float64Array(2+r5.Z.packedLength+el.Z.packedLength+S.Z.packedLength),s=0;return a[s++]=i,a[s++]=n,r5.Z.pack(t,a,s),s+=r5.Z.packedLength,el.Z.pack(r,a,s),s+=el.Z.packedLength,S.Z.pack(o,a,s),a}(e));let s=[i.buffer,n.buffer,r.buffer,o.buffer,a.buffer],l={positions:i.buffer,widths:n.buffer,counts:r.buffer,batchIds:o.buffer,packedBuffer:a.buffer,keepDecodedPositions:e._keepDecodedPositions},c=vM.scheduleTask(l,s);if((0,_.Z)(c))return c.then(function(i){if(e.isDestroyed())return;e._keepDecodedPositions&&(e._decodedPositions=new Float64Array(i.decodedPositions),e._decodedPositionOffsets=new Uint32Array(i.decodedPositionOffsets)),e._currentPositions=new Float32Array(i.currentPositions),e._previousPositions=new Float32Array(i.previousPositions),e._nextPositions=new Float32Array(i.nextPositions),e._expandAndWidth=new Float32Array(i.expandAndWidth),e._vertexBatchIds=new Uint16Array(i.batchIds);let n=i.indexDatatype;e._indices=n===ez.Z.UNSIGNED_SHORT?new Uint16Array(i.indices):new Uint32Array(i.indices),function(e,t){if(!(0,_.Z)(e._va)){let i=e._currentPositions,n=e._previousPositions,r=e._nextPositions,o=e._expandAndWidth,a=e._vertexBatchIds,s=e._indices,l=n.byteLength+i.byteLength+r.byteLength;l+=o.byteLength+a.byteLength+s.byteLength,e._trianglesLength=s.length/3,e._geometryByteLength=l;let c=ek.Z.createVertexBuffer({context:t,typedArray:n,usage:eV.Z.STATIC_DRAW}),u=ek.Z.createVertexBuffer({context:t,typedArray:i,usage:eV.Z.STATIC_DRAW}),h=ek.Z.createVertexBuffer({context:t,typedArray:r,usage:eV.Z.STATIC_DRAW}),d=ek.Z.createVertexBuffer({context:t,typedArray:o,usage:eV.Z.STATIC_DRAW}),f=ek.Z.createVertexBuffer({context:t,typedArray:a,usage:eV.Z.STATIC_DRAW}),p=ek.Z.createIndexBuffer({context:t,typedArray:s,usage:eV.Z.STATIC_DRAW,indexDatatype:2===s.BYTES_PER_ELEMENT?ez.Z.UNSIGNED_SHORT:ez.Z.UNSIGNED_INT}),m=[{index:vF.previousPosition,vertexBuffer:c,componentDatatype:eM.Z.FLOAT,componentsPerAttribute:3},{index:vF.currentPosition,vertexBuffer:u,componentDatatype:eM.Z.FLOAT,componentsPerAttribute:3},{index:vF.nextPosition,vertexBuffer:h,componentDatatype:eM.Z.FLOAT,componentsPerAttribute:3},{index:vF.expandAndWidth,vertexBuffer:d,componentDatatype:eM.Z.FLOAT,componentsPerAttribute:2},{index:vF.a_batchId,vertexBuffer:f,componentDatatype:eM.Z.UNSIGNED_SHORT,componentsPerAttribute:1}];e._va=new eX.Z({context:t,attributes:m,indexBuffer:p}),e._positions=void 0,e._widths=void 0,e._counts=void 0,e._ellipsoid=void 0,e._minimumHeight=void 0,e._maximumHeight=void 0,e._rectangle=void 0,e._transferrableBatchIds=void 0,e._packedBuffer=void 0,e._currentPositions=void 0,e._previousPositions=void 0,e._nextPositions=void 0,e._expandAndWidth=void 0,e._vertexBatchIds=void 0,e._indices=void 0}}(e,t),e._ready=!0}).catch(t=>{e.isDestroyed()||(e._error=t)})}(this,i)),(0,_.Z)(this._error)){let e=this._error;throw this._error=void 0,e}return}t=this,(0,_.Z)(t._uniformMap)||(t._uniformMap={u_modifiedModelView:function(){let e=i.uniformState.view;return er.Z.clone(e,vz),er.Z.multiplyByPoint(vz,t._center,vB),er.Z.setTranslation(vz,vB,vz),vz},u_highlightColor:function(){return t._highlightColor}}),function(e,t){if((0,_.Z)(e._sp))return;let i=e._batchTable,n=i.getVertexShaderCallback(!1,"a_batchId",void 0)("in vec4 currentPosition;\nin vec4 previousPosition;\nin vec4 nextPosition;\nin vec2 expandAndWidth;\nin float a_batchId;\n\nuniform mat4 u_modifiedModelView;\n\nvoid main()\n{\n float expandDir = expandAndWidth.x;\n float width = abs(expandAndWidth.y) + 0.5;\n bool usePrev = expandAndWidth.y < 0.0;\n\n vec4 p = u_modifiedModelView * currentPosition;\n vec4 prev = u_modifiedModelView * previousPosition;\n vec4 next = u_modifiedModelView * nextPosition;\n\n float angle;\n vec4 positionWC = getPolylineWindowCoordinatesEC(p, prev, next, expandDir, width, usePrev, angle);\n gl_Position = czm_viewportOrthographic * positionWC;\n}\n"),r=i.getFragmentShaderCallback(!1,void 0,!1)("uniform vec4 u_highlightColor; \nvoid main()\n{\n out_FragColor = u_highlightColor;\n}\n"),o=new eY.Z({defines:["VECTOR_TILE",uP.Z.isInternetExplorer()?"":"CLIP_POLYLINE"],sources:[vN.Z,n]}),a=new eY.Z({defines:["VECTOR_TILE"],sources:[r]});e._sp=eq.Z.fromCache({context:t,vertexShaderSource:o,fragmentShaderSource:a,attributeLocations:vF})}(this,i),(0,_.Z)(this._rs)||(this._rs=eW.Z.fromCache({blending:eJ.Z.ALPHA_BLEND,depthMask:!1,depthTest:{enabled:!0},polygonOffset:{enabled:!0,factor:-5,units:-5}}));let n=e.passes;(n.render||n.pick)&&function(e,t){if(!(0,_.Z)(e._command)){let t=e._batchTable.getUniformMapCallback()(e._uniformMap);e._command=new eG.Z({owner:e,vertexArray:e._va,renderState:e._rs,shaderProgram:e._sp,uniformMap:t,boundingVolume:e._boundingVolume,pass:ej.Z.TRANSLUCENT,pickId:e._batchTable.getPickId()})}t.commandList.push(e._command)}(this,e)},vL.prototype.isDestroyed=function(){return!1},vL.prototype.destroy=function(){return this._va=this._va&&this._va.destroy(),this._sp=this._sp&&this._sp.destroy(),(0,g.Z)(this)},Object.defineProperties(vV.prototype,{trianglesLength:{get:function(){return this._trianglesLength}},geometryByteLength:{get:function(){return this._geometryByteLength}},ready:{get:function(){return this._ready}}});let vH=new hD.Z("createVectorTileClampedPolylines"),vG={startEllipsoidNormal:0,endEllipsoidNormal:1,startPositionAndHeight:2,endPositionAndHeight:3,startFaceNormalAndVertexCorner:4,endFaceNormalAndHalfWidth:5,a_batchId:6},vj=new er.Z,vW=new S.Z;function vq(e){return eW.Z.fromCache({cull:{enabled:!0,face:dW.Z.FRONT},blending:eJ.Z.PRE_MULTIPLIED_ALPHA_BLEND,depthMask:!1,stencilTest:{enabled:e,frontFunction:mQ.Z.EQUAL,frontOperation:{fail:mJ.Z.KEEP,zFail:mJ.Z.KEEP,zPass:mJ.Z.KEEP},backFunction:mQ.Z.EQUAL,backOperation:{fail:mJ.Z.KEEP,zFail:mJ.Z.KEEP,zPass:mJ.Z.KEEP},reference:pD.Z.CESIUM_3D_TILE_MASK,mask:pD.Z.CESIUM_3D_TILE_MASK}})}vV.prototype.getPositions=function(e){return vL.getPolylinePositions(this,e)},vV.prototype.createFeatures=function(e,t){let i=this._batchIds,n=i.length;for(let r=0;r<n;++r){let n=i[r];t[n]=new mH.Z(e,n)}},vV.prototype.applyDebugSettings=function(e,t){this._highlightColor=e?t:this._constantColor};let vY=new C.Z,vX=C.Z.WHITE;vV.prototype.applyStyle=function(e,t){if(!(0,_.Z)(e)){!function(e,t){let i=e._batchIds,n=i.length;for(let e=0;e<n;++e){let n=t[i[e]];n.show=!0,n.color=C.Z.WHITE}}(this,t);return}let i=this._batchIds,n=i.length;for(let r=0;r<n;++r){let n=t[i[r]];n.color=(0,_.Z)(e.color)?e.color.evaluateColor(n,vY):vX,n.show=!(0,_.Z)(e.show)||e.show.evaluate(n)}},vV.prototype.update=function(e){var t,i;let n=e.context;if(!this._ready){if(!(0,_.Z)(this._promise)&&(this._promise=(t=this,d.Z.initialize().then(function(){!function(e,t,i){let n=d.Z.getMinimumMaximumHeights(t,i),r=n.minimumTerrainHeight,o=n.maximumTerrainHeight,a=e._minimumMaximumVectorHeights;a.x=r,a.y=o;let s=e._boundingVolume,l=e._rectangle;sZ.Z.fromRectangle(l,r,o,i,s)}(t,t._rectangle,t._ellipsoid)}).catch(e=>{t.isDestroyed()||(t._error=e)})).then(function(e,t){if((0,_.Z)(e._va))return;let i=e._positions,n=e._widths,r=e._counts,o=e._transferrableBatchIds,a=e._packedBuffer;(0,_.Z)(a)||(i=e._positions=i.slice(),n=e._widths=n.slice(),r=e._counts=r.slice(),o=e._transferrableBatchIds=e._batchIds.slice(),a=e._packedBuffer=function(e){let t=e._rectangle,i=e._minimumHeight,n=e._maximumHeight,r=e._ellipsoid,o=e._center,a=new Float64Array(2+r5.Z.packedLength+el.Z.packedLength+S.Z.packedLength),s=0;return a[s++]=i,a[s++]=n,r5.Z.pack(t,a,s),s+=r5.Z.packedLength,el.Z.pack(r,a,s),s+=el.Z.packedLength,S.Z.pack(o,a,s),a}(e));let s=[i.buffer,n.buffer,r.buffer,o.buffer,a.buffer],l={positions:i.buffer,widths:n.buffer,counts:r.buffer,batchIds:o.buffer,packedBuffer:a.buffer,keepDecodedPositions:e._keepDecodedPositions},c=vH.scheduleTask(l,s);if((0,_.Z)(c))return c.then(function(i){if(e.isDestroyed())return;e._keepDecodedPositions&&(e._decodedPositions=new Float64Array(i.decodedPositions),e._decodedPositionOffsets=new Uint32Array(i.decodedPositionOffsets)),e._startEllipsoidNormals=new Float32Array(i.startEllipsoidNormals),e._endEllipsoidNormals=new Float32Array(i.endEllipsoidNormals),e._startPositionAndHeights=new Float32Array(i.startPositionAndHeights),e._startFaceNormalAndVertexCornerIds=new Float32Array(i.startFaceNormalAndVertexCornerIds),e._endPositionAndHeights=new Float32Array(i.endPositionAndHeights),e._endFaceNormalAndHalfWidths=new Float32Array(i.endFaceNormalAndHalfWidths),e._vertexBatchIds=new Uint16Array(i.vertexBatchIds);let n=i.indexDatatype;e._indices=n===ez.Z.UNSIGNED_SHORT?new Uint16Array(i.indices):new Uint32Array(i.indices),function(e,t){if(!(0,_.Z)(e._va)){let i=e._startEllipsoidNormals,n=e._endEllipsoidNormals,r=e._startPositionAndHeights,o=e._endPositionAndHeights,a=e._startFaceNormalAndVertexCornerIds,s=e._endFaceNormalAndHalfWidths,l=e._vertexBatchIds,c=e._indices,u=i.byteLength+n.byteLength;u+=r.byteLength+o.byteLength+(a.byteLength+s.byteLength)+(l.byteLength+c.byteLength),e._trianglesLength=c.length/3,e._geometryByteLength=u;let h=ek.Z.createVertexBuffer({context:t,typedArray:i,usage:eV.Z.STATIC_DRAW}),d=ek.Z.createVertexBuffer({context:t,typedArray:n,usage:eV.Z.STATIC_DRAW}),f=ek.Z.createVertexBuffer({context:t,typedArray:r,usage:eV.Z.STATIC_DRAW}),p=ek.Z.createVertexBuffer({context:t,typedArray:o,usage:eV.Z.STATIC_DRAW}),m=ek.Z.createVertexBuffer({context:t,typedArray:a,usage:eV.Z.STATIC_DRAW}),_=ek.Z.createVertexBuffer({context:t,typedArray:s,usage:eV.Z.STATIC_DRAW}),g=ek.Z.createVertexBuffer({context:t,typedArray:l,usage:eV.Z.STATIC_DRAW}),Z=ek.Z.createIndexBuffer({context:t,typedArray:c,usage:eV.Z.STATIC_DRAW,indexDatatype:2===c.BYTES_PER_ELEMENT?ez.Z.UNSIGNED_SHORT:ez.Z.UNSIGNED_INT}),y=[{index:vG.startEllipsoidNormal,vertexBuffer:h,componentDatatype:eM.Z.FLOAT,componentsPerAttribute:3},{index:vG.endEllipsoidNormal,vertexBuffer:d,componentDatatype:eM.Z.FLOAT,componentsPerAttribute:3},{index:vG.startPositionAndHeight,vertexBuffer:f,componentDatatype:eM.Z.FLOAT,componentsPerAttribute:4},{index:vG.endPositionAndHeight,vertexBuffer:p,componentDatatype:eM.Z.FLOAT,componentsPerAttribute:4},{index:vG.startFaceNormalAndVertexCorner,vertexBuffer:m,componentDatatype:eM.Z.FLOAT,componentsPerAttribute:4},{index:vG.endFaceNormalAndHalfWidth,vertexBuffer:_,componentDatatype:eM.Z.FLOAT,componentsPerAttribute:4},{index:vG.a_batchId,vertexBuffer:g,componentDatatype:eM.Z.UNSIGNED_SHORT,componentsPerAttribute:1}];e._va=new eX.Z({context:t,attributes:y,indexBuffer:Z}),e._positions=void 0,e._widths=void 0,e._counts=void 0,e._ellipsoid=void 0,e._minimumHeight=void 0,e._maximumHeight=void 0,e._rectangle=void 0,e._transferrableBatchIds=void 0,e._packedBuffer=void 0,e._startEllipsoidNormals=void 0,e._endEllipsoidNormals=void 0,e._startPositionAndHeights=void 0,e._startFaceNormalAndVertexCornerIds=void 0,e._endPositionAndHeights=void 0,e._endFaceNormalAndHalfWidths=void 0,e._vertexBatchIds=void 0,e._indices=void 0}}(e,t),e._ready=!0}).catch(t=>{e.isDestroyed()||(e._error=t)})}(this,n))),(0,_.Z)(this._error)){let e=this._error;throw this._error=void 0,e}return}i=this,(0,_.Z)(i._uniformMap)||(i._uniformMap={u_modifiedModelView:function(){let e=n.uniformState.view;return er.Z.clone(e,vj),er.Z.multiplyByPoint(vj,i._center,vW),er.Z.setTranslation(vj,vW,vj),vj},u_highlightColor:function(){return i._highlightColor},u_minimumMaximumVectorHeights:function(){return i._minimumMaximumVectorHeights}}),function(e,t){if((0,_.Z)(e._sp))return;let i=e._batchTable,n=i.getVertexShaderCallback(!1,"a_batchId",void 0)('in vec3 startEllipsoidNormal;\nin vec3 endEllipsoidNormal;\nin vec4 startPositionAndHeight;\nin vec4 endPositionAndHeight;\nin vec4 startFaceNormalAndVertexCorner;\nin vec4 endFaceNormalAndHalfWidth;\nin float a_batchId;\n\nuniform mat4 u_modifiedModelView;\nuniform vec2 u_minimumMaximumVectorHeights;\n\nout vec4 v_startPlaneEC;\nout vec4 v_endPlaneEC;\nout vec4 v_rightPlaneEC;\nout float v_halfWidth;\nout vec3 v_volumeUpEC;\n\nvoid main()\n{\n // vertex corner IDs\n // 3-----------7\n // /| left /|\n // / | 1 / |\n // 2-----------6 5 end\n // | / | /\n // start |/ right |/\n // 0-----------4\n //\n float isEnd = floor(startFaceNormalAndVertexCorner.w * 0.251); // 0 for front, 1 for end\n float isTop = floor(startFaceNormalAndVertexCorner.w * mix(0.51, 0.19, isEnd)); // 0 for bottom, 1 for top\n\n vec3 forward = endPositionAndHeight.xyz - startPositionAndHeight.xyz;\n vec3 right = normalize(cross(forward, startEllipsoidNormal));\n\n vec4 position = vec4(startPositionAndHeight.xyz, 1.0);\n position.xyz += forward * isEnd;\n\n v_volumeUpEC = czm_normal * normalize(cross(right, forward));\n\n // Push for volume height\n float offset;\n vec3 ellipsoidNormal = mix(startEllipsoidNormal, endEllipsoidNormal, isEnd);\n\n // offset height to create volume\n offset = mix(startPositionAndHeight.w, endPositionAndHeight.w, isEnd);\n offset = mix(u_minimumMaximumVectorHeights.y, u_minimumMaximumVectorHeights.x, isTop) - offset;\n position.xyz += offset * ellipsoidNormal;\n\n // move from RTC to EC\n position = u_modifiedModelView * position;\n right = czm_normal * right;\n\n // Push for width in a direction that is in the start or end plane and in a plane with right\n // N = normalEC ("right-facing" direction for push)\n // R = right\n // p = angle between N and R\n // w = distance to push along R if R == N\n // d = distance to push along N\n //\n // N R\n // { p| } * cos(p) = dot(N, R) = w / d\n // d | |w * d = w / dot(N, R)\n // { | }\n // o---------- polyline segment ---->\n //\n vec3 scratchNormal = mix(-startFaceNormalAndVertexCorner.xyz, endFaceNormalAndHalfWidth.xyz, isEnd);\n scratchNormal = cross(scratchNormal, mix(startEllipsoidNormal, endEllipsoidNormal, isEnd));\n vec3 miterPushNormal = czm_normal * normalize(scratchNormal);\n\n offset = 2.0 * endFaceNormalAndHalfWidth.w * max(0.0, czm_metersPerPixel(position)); // offset = widthEC\n offset = offset / dot(miterPushNormal, right);\n position.xyz += miterPushNormal * (offset * sign(0.5 - mod(startFaceNormalAndVertexCorner.w, 2.0)));\n\n gl_Position = czm_depthClamp(czm_projection * position);\n\n position = u_modifiedModelView * vec4(startPositionAndHeight.xyz, 1.0);\n vec3 startNormalEC = czm_normal * startFaceNormalAndVertexCorner.xyz;\n v_startPlaneEC = vec4(startNormalEC, -dot(startNormalEC, position.xyz));\n v_rightPlaneEC = vec4(right, -dot(right, position.xyz));\n\n position = u_modifiedModelView * vec4(endPositionAndHeight.xyz, 1.0);\n vec3 endNormalEC = czm_normal * endFaceNormalAndHalfWidth.xyz;\n v_endPlaneEC = vec4(endNormalEC, -dot(endNormalEC, position.xyz));\n v_halfWidth = endFaceNormalAndHalfWidth.w;\n}\n'),r=i.getFragmentShaderCallback(!1,void 0,!0)("in vec4 v_startPlaneEC;\nin vec4 v_endPlaneEC;\nin vec4 v_rightPlaneEC;\nin float v_halfWidth;\nin vec3 v_volumeUpEC;\n\nuniform vec4 u_highlightColor;\nvoid main()\n{\n float logDepthOrDepth = czm_branchFreeTernary(czm_sceneMode == czm_sceneMode2D, gl_FragCoord.z, czm_unpackDepth(texture(czm_globeDepthTexture, gl_FragCoord.xy / czm_viewport.zw)));\n\n // Discard for sky\n if (logDepthOrDepth == 0.0) {\n#ifdef DEBUG_SHOW_VOLUME\n out_FragColor = vec4(0.0, 0.0, 1.0, 0.5);\n return;\n#else // DEBUG_SHOW_VOLUME\n discard;\n#endif // DEBUG_SHOW_VOLUME\n }\n\n vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, logDepthOrDepth);\n eyeCoordinate /= eyeCoordinate.w;\n\n float halfMaxWidth = v_halfWidth * czm_metersPerPixel(eyeCoordinate);\n\n // Expand halfMaxWidth if direction to camera is almost perpendicular with the volume's up direction\n halfMaxWidth += halfMaxWidth * (1.0 - dot(-normalize(eyeCoordinate.xyz), v_volumeUpEC));\n\n // Check distance of the eye coordinate against the right-facing plane\n float widthwiseDistance = czm_planeDistance(v_rightPlaneEC, eyeCoordinate.xyz);\n\n // Check eye coordinate against the mitering planes\n float distanceFromStart = czm_planeDistance(v_startPlaneEC, eyeCoordinate.xyz);\n float distanceFromEnd = czm_planeDistance(v_endPlaneEC, eyeCoordinate.xyz);\n\n if (abs(widthwiseDistance) > halfMaxWidth || distanceFromStart < 0.0 || distanceFromEnd < 0.0) {\n#ifdef DEBUG_SHOW_VOLUME\n out_FragColor = vec4(logDepthOrDepth, 0.0, 0.0, 0.5);\n return;\n#else // DEBUG_SHOW_VOLUME\n discard;\n#endif // DEBUG_SHOW_VOLUME\n }\n out_FragColor = u_highlightColor;\n\n czm_writeDepthClamp();\n}\n"),o=new eY.Z({defines:["VECTOR_TILE",uP.Z.isInternetExplorer()?"":"CLIP_POLYLINE"],sources:[vN.Z,n]}),a=new eY.Z({defines:["VECTOR_TILE"],sources:[r]});e._sp=eq.Z.fromCache({context:t,vertexShaderSource:o,fragmentShaderSource:a,attributeLocations:vG})}(this,n),(0,_.Z)(this._rs)||(this._rs=vq(!1),this._rs3DTiles=vq(!0));let r=e.passes;(r.render||r.pick)&&function(e,t){let i=e._command;if(!(0,_.Z)(e._command)){let t=e._batchTable.getUniformMapCallback()(e._uniformMap);i=e._command=new eG.Z({owner:e,vertexArray:e._va,renderState:e._rs,shaderProgram:e._sp,uniformMap:t,boundingVolume:e._boundingVolume,pass:ej.Z.TERRAIN_CLASSIFICATION,pickId:e._batchTable.getPickId()});let n=eG.Z.shallowClone(i,i.derivedCommands.tileset);n.renderState=e._rs3DTiles,n.pass=ej.Z.CESIUM_3D_TILE_CLASSIFICATION,i.derivedCommands.tileset=n}let n=e._classificationType;(n===nd.Z.TERRAIN||n===nd.Z.BOTH)&&t.commandList.push(i),(n===nd.Z.CESIUM_3D_TILE||n===nd.Z.BOTH)&&t.commandList.push(i.derivedCommands.tileset)}(this,e)},vV.prototype.isDestroyed=function(){return!1},vV.prototype.destroy=function(){return this._va=this._va&&this._va.destroy(),this._sp=this._sp&&this._sp.destroy(),(0,g.Z)(this)};let v$=new ea.Z,vK=new S.Z;var vQ=function(e,t,i,n,r){let o=e.length/3,a=e.subarray(0,o),s=e.subarray(o,2*o),l=e.subarray(2*o,3*o);eL.Z.zigZagDeltaDecode(a,s,l);let c=new Float64Array(e.length);for(let e=0;e<o;++e){let o=a[e],u=s[e],h=l[e],d=eB.Z.lerp(t.west,t.east,o/32767),f=eB.Z.lerp(t.south,t.north,u/32767),p=eB.Z.lerp(i,n,h/32767),m=ea.Z.fromRadians(d,f,p,v$),_=r.cartographicToCartesian(m,vK);S.Z.pack(_,c,3*e)}return c};function vJ(e,t,i,n,r){this._tileset=e,this._tile=t,this._resource=i,this._polygons=void 0,this._polylines=void 0,this._points=void 0,this._metadata=void 0,this._batchTable=void 0,this._features=void 0,this.featurePropertiesDirty=!1,this._group=void 0,this._ready=!1,function(e,t,i){let n,r;i=(0,m.Z)(i,0);let o=new Uint8Array(t),a=new DataView(t);i+=v0;let s=a.getUint32(i,!0);if(1!==s)throw new e3.Z(`Only Vector tile version 1 is supported. Version ${s} is not.`);i+=v0;let l=a.getUint32(i,!0);if(i+=v0,0===l){e._ready=!0;return}let c=a.getUint32(i,!0);if(i+=v0,0===c)throw new e3.Z("Feature table must have a byte length greater than zero");let u=a.getUint32(i,!0);i+=v0;let h=a.getUint32(i,!0);i+=v0;let d=a.getUint32(i,!0);i+=v0;let f=a.getUint32(i,!0);i+=v0;let p=a.getUint32(i,!0);i+=v0;let g=a.getUint32(i,!0);i+=v0;let Z=a.getUint32(i,!0),y=h0(o,i+=v0,c),b=new Uint8Array(t,i+=c,u);i+=u,h>0&&(n=h0(o,i,h),i+=h,d>0&&(r=new Uint8Array(t,i,d),r=new Uint8Array(r),i+=d));let v=(0,m.Z)(y.POLYGONS_LENGTH,0),T=(0,m.Z)(y.POLYLINES_LENGTH,0),E=(0,m.Z)(y.POINTS_LENGTH,0),x=v+T+E,w=new yF(e,x,n,r,function(t,i){(0,_.Z)(e._polygons)&&e._polygons.updateCommands(t,i)});if(e._batchTable=w,0===x)return;let C=new pB(y,b),A=C.getGlobalProperty("REGION");if(!(0,_.Z)(A))throw new e3.Z("Feature table global property: REGION must be defined");let I=r5.Z.unpack(A),O=A[4],D=A[5],P=e._tile.computedTransform,R=C.getGlobalProperty("RTC_CENTER",eM.Z.FLOAT,3);(0,_.Z)(R)?(R=S.Z.unpack(R),er.Z.multiplyByPoint(P,R,R)):((R=r5.Z.center(I)).height=eB.Z.lerp(O,D,.5),R=el.Z.WGS84.cartographicToCartesian(R));let N=function(e,t){let i,n,r,o;let a=(0,m.Z)(e.POLYGONS_LENGTH,0),s=(0,m.Z)(e.POLYLINES_LENGTH,0),l=(0,m.Z)(e.POINTS_LENGTH,0);if(a>0&&(0,_.Z)(e.POLYGON_BATCH_IDS)){let n=t.byteOffset+e.POLYGON_BATCH_IDS.byteOffset;i=new Uint16Array(t.buffer,n,a)}if(s>0&&(0,_.Z)(e.POLYLINE_BATCH_IDS)){let i=t.byteOffset+e.POLYLINE_BATCH_IDS.byteOffset;n=new Uint16Array(t.buffer,i,s)}if(l>0&&(0,_.Z)(e.POINT_BATCH_IDS)){let i=t.byteOffset+e.POINT_BATCH_IDS.byteOffset;r=new Uint16Array(t.buffer,i,l)}let c=(0,_.Z)(i)||(0,_.Z)(n)||(0,_.Z)(r),u=a>0&&!(0,_.Z)(i)||s>0&&!(0,_.Z)(n)||l>0&&!(0,_.Z)(r);if(c&&u)throw new e3.Z("If one group of batch ids is defined, then all batch ids must be defined");if(!(0,_.Z)(i)&&!(0,_.Z)(n)&&!(0,_.Z)(r)){let e=0;if(!(0,_.Z)(i)&&a>0)for(o=0,i=new Uint16Array(a);o<a;++o)i[o]=e++;if(!(0,_.Z)(n)&&s>0)for(o=0,n=new Uint16Array(s);o<s;++o)n[o]=e++;if(!(0,_.Z)(r)&&l>0)for(o=0,r=new Uint16Array(l);o<l;++o)r[o]=e++}return{polygons:i,polylines:n,points:r}}(y,b);if(i+=(4-i%4)%4,v>0){let n,r;C.featuresLength=v;let o=(0,m.Z)(C.getPropertyArray("POLYGON_COUNTS",eM.Z.UNSIGNED_INT,1),C.getPropertyArray("POLYGON_COUNT",eM.Z.UNSIGNED_INT,1));if(!(0,_.Z)(o))throw new e3.Z("Feature table property: POLYGON_COUNTS must be defined when POLYGONS_LENGTH is greater than 0");let a=(0,m.Z)(C.getPropertyArray("POLYGON_INDEX_COUNTS",eM.Z.UNSIGNED_INT,1),C.getPropertyArray("POLYGON_INDEX_COUNT",eM.Z.UNSIGNED_INT,1));if(!(0,_.Z)(a))throw new e3.Z("Feature table property: POLYGON_INDEX_COUNTS must be defined when POLYGONS_LENGTH is greater than 0");let s=o.reduce(function(e,t){return e+2*t},0),l=new Uint32Array(t,i,a.reduce(function(e,t){return e+t},0)),c=new Uint16Array(t,i+=f,s);i+=p,(0,_.Z)(y.POLYGON_MINIMUM_HEIGHTS)&&(0,_.Z)(y.POLYGON_MAXIMUM_HEIGHTS)&&(n=C.getPropertyArray("POLYGON_MINIMUM_HEIGHTS",eM.Z.FLOAT,1),r=C.getPropertyArray("POLYGON_MAXIMUM_HEIGHTS",eM.Z.FLOAT,1)),e._polygons=new vD({positions:c,counts:o,indexCounts:a,indices:l,minimumHeight:O,maximumHeight:D,polygonMinimumHeights:n,polygonMaximumHeights:r,center:R,rectangle:I,boundingVolume:e.tile.boundingVolume.boundingVolume,batchTable:w,batchIds:N.polygons,modelMatrix:P})}if(T>0){C.featuresLength=T;let n=(0,m.Z)(C.getPropertyArray("POLYLINE_COUNTS",eM.Z.UNSIGNED_INT,1),C.getPropertyArray("POLYLINE_COUNT",eM.Z.UNSIGNED_INT,1));if(!(0,_.Z)(n))throw new e3.Z("Feature table property: POLYLINE_COUNTS must be defined when POLYLINES_LENGTH is greater than 0");let r=C.getPropertyArray("POLYLINE_WIDTHS",eM.Z.UNSIGNED_SHORT,1);if(!(0,_.Z)(r)){r=new Uint16Array(T);for(let e=0;e<T;++e)r[e]=2}let o=new Uint16Array(t,i,n.reduce(function(e,t){return e+3*t},0));i+=g;let a=e._tileset,s=a.examineVectorLinesFunction;(0,_.Z)(s)&&function(e,t,i,n,r,o){let a=t.length,s=0;for(let l=0;l<a;l++){let a=3*t[l],c=e.slice(s,s+a);s+=a,o(c,i[l],r,n)}}(vQ(new Uint16Array(o),I,O,D,el.Z.WGS84),n,N.polylines,w,e.url,s);let l=v1;(0,_.Z)(a.classificationType)&&(l=v2),e._polylines=l({positions:o,widths:r,counts:n,batchIds:N.polylines,minimumHeight:O,maximumHeight:D,center:R,rectangle:I,boundingVolume:e.tile.boundingVolume.boundingVolume,batchTable:w,classificationType:a.classificationType,keepDecodedPositions:a.vectorKeepDecodedPositions})}if(E>0){let n=new Uint16Array(t,i,3*E);i+=Z,e._points=new vy({positions:n,batchIds:N.points,minimumHeight:O,maximumHeight:D,rectangle:I,batchTable:w})}}(this,n,r)}Object.defineProperties(vJ.prototype,{featuresLength:{get:function(){return(0,_.Z)(this._batchTable)?this._batchTable.featuresLength:0}},pointsLength:{get:function(){return(0,_.Z)(this._points)?this._points.pointsLength:0}},trianglesLength:{get:function(){let e=0;return(0,_.Z)(this._polygons)&&(e+=this._polygons.trianglesLength),(0,_.Z)(this._polylines)&&(e+=this._polylines.trianglesLength),e}},geometryByteLength:{get:function(){let e=0;return(0,_.Z)(this._polygons)&&(e+=this._polygons.geometryByteLength),(0,_.Z)(this._polylines)&&(e+=this._polylines.geometryByteLength),e}},texturesByteLength:{get:function(){return(0,_.Z)(this._points)?this._points.texturesByteLength:0}},batchTableByteLength:{get:function(){return(0,_.Z)(this._batchTable)?this._batchTable.batchTableByteLength:0}},innerContents:{get:function(){}},ready:{get:function(){return this._ready}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){return this._resource.getUrlComponent(!0)}},metadata:{get:function(){return this._metadata},set:function(e){this._metadata=e}},batchTable:{get:function(){return this._batchTable}},group:{get:function(){return this._group},set:function(e){this._group=e}}});let v0=Uint32Array.BYTES_PER_ELEMENT;function v1(e){return new vL(e)}function v2(e){return new vV(e)}function v3(e){let t=e.featuresLength;if(!(0,_.Z)(e._features)&&t>0){let i=Array(t);(0,_.Z)(e._polygons)&&e._polygons.createFeatures(e,i),(0,_.Z)(e._polylines)&&e._polylines.createFeatures(e,i),(0,_.Z)(e._points)&&e._points.createFeatures(e,i),e._features=i}}vJ.prototype.hasProperty=function(e,t){return this._batchTable.hasProperty(e,t)},vJ.prototype.getFeature=function(e){let t=this.featuresLength;if(!(0,_.Z)(e)||e<0||e>=t)throw new A.Z(`batchId is required and between zero and featuresLength - 1 (${t-1}).`);return(0,_.Z)(this._features)||v3(this),this._features[e]},vJ.prototype.applyDebugSettings=function(e,t){(0,_.Z)(this._polygons)&&this._polygons.applyDebugSettings(e,t),(0,_.Z)(this._polylines)&&this._polylines.applyDebugSettings(e,t),(0,_.Z)(this._points)&&this._points.applyDebugSettings(e,t)},vJ.prototype.applyStyle=function(e){(0,_.Z)(this._features)||v3(this),(0,_.Z)(this._polygons)&&this._polygons.applyStyle(e,this._features),(0,_.Z)(this._polylines)&&this._polylines.applyStyle(e,this._features),(0,_.Z)(this._points)&&this._points.applyStyle(e,this._features)},vJ.prototype.update=function(e,t){let i=!0;(0,_.Z)(this._polygons)&&(this._polygons.classificationType=this._tileset.classificationType,this._polygons.debugWireframe=this._tileset.debugWireframe,this._polygons.update(t),i=i&&this._polygons.ready),(0,_.Z)(this._polylines)&&(this._polylines.update(t),i=i&&this._polylines.ready),(0,_.Z)(this._points)&&(this._points.update(t),i=i&&this._points.ready),(0,_.Z)(this._batchTable)&&i&&((0,_.Z)(this._features)||v3(this),this._batchTable.update(e,t),this._ready=!0)},vJ.prototype.pick=function(e,t,i){},vJ.prototype.getPolylinePositions=function(e){let t=this._polylines;if((0,_.Z)(t))return t.getPositions(e)},vJ.prototype.isDestroyed=function(){return!1},vJ.prototype.destroy=function(){return this._polygons=this._polygons&&this._polygons.destroy(),this._polylines=this._polylines&&this._polylines.destroy(),this._points=this._points&&this._points.destroy(),this._batchTable=this._batchTable&&this._batchTable.destroy(),(0,g.Z)(this)};let v4={b3dm:function(e,t,i,n,r){return vh.fromB3dm(e,t,i,n,r)},pnts:function(e,t,i,n,r){return vh.fromPnts(e,t,i,n,r)},i3dm:function(e,t,i,n,r){return vh.fromI3dm(e,t,i,n,r)},cmpt:function(e,t,i,n,r){return yP.fromTileType(e,t,i,n,r,v4)},externalTileset:function(e,t,i,n){return vf.fromJson(e,t,i,n)},geom:function(e,t,i,n,r){return new bD(e,t,i,n,r)},vctr:function(e,t,i,n,r){return new vJ(e,t,i,n,r)},subt:function(e,t,i,n,r){return b9.fromSubtreeJson(e,t,i,void 0,n,r)},subtreeJson:function(e,t,i,n){return b9.fromSubtreeJson(e,t,i,n)},glb:function(e,t,i,n,r){if(n.byteLength<12)throw new e3.Z("Invalid glb content");let o=new DataView(n,r).getUint32(8,!0),a=new Uint8Array(n,r,o);return vh.fromGltf(e,t,i,a)},gltf:function(e,t,i,n){return vh.fromGltf(e,t,i,n)},geoJson:function(e,t,i,n){return vh.fromGeoJson(e,t,i,n)}};var v5=Object.freeze({UNLOADED:0,LOADING:1,PROCESSING:2,READY:3,EXPIRED:4,FAILED:5});let v9={BATCHED_3D_MODEL:"b3dm",INSTANCED_3D_MODEL:"i3dm",COMPOSITE:"cmpt",POINT_CLOUD:"pnts",VECTOR:"vctr",GEOMETRY:"geom",GLTF:"gltf",GLTF_BINARY:"glb",IMPLICIT_SUBTREE:"subt",IMPLICIT_SUBTREE_JSON:"subtreeJson",EXTERNAL_TILESET:"externalTileset",MULTIPLE_CONTENT:"multipleContent",GEOJSON:"geoJson",VOXEL_BINARY:"voxl",VOXEL_JSON:"voxelJson"};v9.isBinaryFormat=function(e){switch(e){case v9.BATCHED_3D_MODEL:case v9.INSTANCED_3D_MODEL:case v9.COMPOSITE:case v9.POINT_CLOUD:case v9.VECTOR:case v9.GEOMETRY:case v9.IMPLICIT_SUBTREE:case v9.VOXEL_BINARY:case v9.GLTF_BINARY:return!0;default:return!1}};var v8=Object.freeze(v9),v6=Object.freeze({NOT_COMPUTED:-1,USE_OPTIMIZATION:1,SKIP_OPTIMIZATION:0}),v7=i(493);function Te(e,t){this._tileset=e,this._tile=t,this.featurePropertiesDirty=!1}function Tt(e){let t=(e=(0,m.Z)(e,m.Z.EMPTY_OBJECT)).content,i=e.class;p.Z.typeOf.object("options.content",t),p.Z.typeOf.object("options.class",i),this._class=i,this._properties=t.properties,this._extensions=t.extensions,this._extras=t.extras}function Ti(e,t){let i=hC(t,"3DTILES_metadata")?t.extensions["3DTILES_metadata"]:t.metadata;if(!(0,_.Z)(i))return;if(!(0,_.Z)(e.schema)){Ti._oneTimeWarning("findContentMetadata-missing-root-schema","Could not find a metadata schema for content metadata. For tilesets that contain external tilesets, make sure the schema is added to the root tileset.json.");return}let n=(0,m.Z)(e.schema.classes,m.Z.EMPTY_OBJECT);if((0,_.Z)(i.class)){let e=n[i.class];return new Tt({content:i,class:e})}}Object.defineProperties(Te.prototype,{featuresLength:{get:function(){return 0}},pointsLength:{get:function(){return 0}},trianglesLength:{get:function(){return 0}},geometryByteLength:{get:function(){return 0}},texturesByteLength:{get:function(){return 0}},batchTableByteLength:{get:function(){return 0}},innerContents:{get:function(){}},ready:{get:function(){return!0}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){}},metadata:{get:function(){},set:function(e){throw new A.Z("Empty3DTileContent cannot have content metadata")}},batchTable:{get:function(){}},group:{get:function(){},set:function(e){throw new A.Z("Empty3DTileContent cannot have group metadata")}}}),Te.prototype.hasProperty=function(e,t){return!1},Te.prototype.getFeature=function(e){},Te.prototype.applyDebugSettings=function(e,t){},Te.prototype.applyStyle=function(e){},Te.prototype.update=function(e,t){},Te.prototype.pick=function(e,t,i){},Te.prototype.isDestroyed=function(){return!1},Te.prototype.destroy=function(){return(0,g.Z)(this)},Object.defineProperties(Tt.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}}),Tt.prototype.hasProperty=function(e){return uB.hasProperty(e,this._properties,this._class)},Tt.prototype.hasPropertyBySemantic=function(e){return uB.hasPropertyBySemantic(e,this._properties,this._class)},Tt.prototype.getPropertyIds=function(e){return uB.getPropertyIds(this._properties,this._class,e)},Tt.prototype.getProperty=function(e){return uB.getProperty(e,this._properties,this._class)},Tt.prototype.setProperty=function(e,t){return uB.setProperty(e,t,this._properties,this._class)},Tt.prototype.getPropertyBySemantic=function(e){return uB.getPropertyBySemantic(e,this._properties,this._class)},Tt.prototype.setPropertyBySemantic=function(e,t){return uB.setPropertyBySemantic(e,t,this._properties,this._class)},Ti._oneTimeWarning=nP.Z;var Tn=function(e,t){let i=e.metadataExtension;if(!(0,_.Z)(i))return;let n=i.groups,r=hC(t,"3DTILES_metadata")?t.extensions["3DTILES_metadata"].group:t.group;if("number"==typeof r)return n[r];let o=i.groupIds.findIndex(function(e){return e===r});return o>=0?n[o]:void 0};function Tr(e){let t=(e=(0,m.Z)(e,m.Z.EMPTY_OBJECT)).tile,i=e.class;p.Z.typeOf.object("options.tile",t),p.Z.typeOf.object("options.class",i),this._class=i,this._properties=t.properties,this._extensions=t.extensions,this._extras=t.extras}function To(e,t){let i=hC(t,"3DTILES_metadata")?t.extensions["3DTILES_metadata"]:t.metadata;if(!(0,_.Z)(i))return;if(!(0,_.Z)(e.schema)){To._oneTimeWarning("findTileMetadata-missing-root-schema","Could not find a metadata schema for tile metadata. For tilesets that contain external tilesets, make sure the schema is added to the root tileset.json.");return}let n=(0,m.Z)(e.schema.classes,m.Z.EMPTY_OBJECT);if((0,_.Z)(i.class)){let e=n[i.class];return new Tr({tile:i,class:e})}}Object.defineProperties(Tr.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}}),Tr.prototype.hasProperty=function(e){return uB.hasProperty(e,this._properties,this._class)},Tr.prototype.hasPropertyBySemantic=function(e){return uB.hasPropertyBySemantic(e,this._properties,this._class)},Tr.prototype.getPropertyIds=function(e){return uB.getPropertyIds(this._properties,this._class,e)},Tr.prototype.getProperty=function(e){return uB.getProperty(e,this._properties,this._class)},Tr.prototype.setProperty=function(e,t){return uB.setProperty(e,t,this._properties,this._class)},Tr.prototype.getPropertyBySemantic=function(e){return uB.getPropertyBySemantic(e,this._properties,this._class)},Tr.prototype.setPropertyBySemantic=function(e,t){return uB.setPropertyBySemantic(e,t,this._properties,this._class)},To._oneTimeWarning=nP.Z;var Ta=function(e){let t=new Uint8Array(e),i=h1(t);if("glTF"===i&&(i="glb"),v8.isBinaryFormat(i))return{contentType:i,binaryPayload:t};let n=function(e){let t;try{t=h0(e)}catch(e){throw new e3.Z("Invalid tile content.")}return t}(t);if((0,_.Z)(n.root))return{contentType:v8.EXTERNAL_TILESET,jsonPayload:n};if((0,_.Z)(n.asset))return{contentType:v8.GLTF,jsonPayload:n};if((0,_.Z)(n.tileAvailability))return{contentType:v8.IMPLICIT_SUBTREE_JSON,jsonPayload:n};if((0,_.Z)(n.type))return{contentType:v8.GEOJSON,jsonPayload:n};if((0,_.Z)(n.voxelTable))return{contentType:v8.VOXEL_JSON,jsonPayload:n};throw new e3.Z("Invalid tile content.")};function Ts(e,t,i,n){this._tileset=e,this._tile=t,this._tilesetResource=i,this._contents=[],this._contentsCreated=!1;let r=(0,_.Z)(n.contents)?n.contents:n.content;this._innerContentHeaders=r,this._requestsInFlight=0,this._cancelCount=0;let o=this._innerContentHeaders.length;this._arrayFetchPromises=Array(o),this._requests=Array(o),this._ready=!1,this._innerContentResources=Array(o),this._serverKeys=Array(o);for(let e=0;e<o;e++){let t=i.getDerivedResource({url:r[e].uri}),n=yA.Z.getServerKey(t.getUrlComponent());this._innerContentResources[e]=t,this._serverKeys[e]=n}}function Tl(e,t){e._requestsInFlight+=t,e.tileset.statistics.numberOfPendingRequests+=t}function Tc(e,t){e._cancelCount++,e._tile._contentState=t;let i=e.tileset.statistics;i.numberOfPendingRequests-=e._requestsInFlight,i.numberOfAttemptedRequests+=e._requestsInFlight,e._requestsInFlight=0;let n=e._innerContentHeaders.length;e._arrayFetchPromises=Array(n)}async function Tu(e){let t=e._cancelCount,i=await Promise.all(e._arrayFetchPromises);if(t<e._cancelCount)return;let n=i.map((t,i)=>Th(e,t,i)),r=await Promise.all(n);return e._contentsCreated=!0,e._contents=r.filter(_.Z),r}async function Th(e,t,i){if((0,_.Z)(t))try{let n;let r=Ta(t);if(r.contentType===v8.EXTERNAL_TILESET)throw new e3.Z("External tilesets are disallowed inside multiple contents");e._disableSkipLevelOfDetail=e._disableSkipLevelOfDetail||r.contentType===v8.GEOMETRY||r.contentType===v8.VECTOR;let o=e._tileset,a=e._innerContentResources[i],s=e._tile,l=v4[r.contentType];n=(0,_.Z)(r.binaryPayload)?await Promise.resolve(l(o,s,a,r.binaryPayload.buffer,0)):await Promise.resolve(l(o,s,a,r.jsonPayload));let c=e._innerContentHeaders[i];if(s.hasImplicitContentMetadata){let e=s.implicitSubtree,t=s.implicitCoordinates;n.metadata=e.getContentMetadataView(t,i)}else s.hasImplicitContent||(n.metadata=Ti(o,c));let u=Tn(o,c);return(0,_.Z)(u)&&(n.group=new yD({metadata:u})),n}catch(t){Td(e,i,t)}}function Td(e,t,i){let n=e._tileset,r=e._innerContentResources[t].url,o=(0,_.Z)(i.message)?i.message:i.toString();n.tileFailed.numberOfListeners>0?n.tileFailed.raiseEvent({url:r,message:o}):(console.log(`A content failed to load: ${r}`),console.log(`Error: ${o}`))}Object.defineProperties(Ts.prototype,{featurePropertiesDirty:{get:function(){let e=this._contents,t=e.length;for(let i=0;i<t;++i)if(e[i].featurePropertiesDirty)return!0;return!1},set:function(e){let t=this._contents,i=t.length;for(let n=0;n<i;++n)t[n].featurePropertiesDirty=e}},featuresLength:{get:function(){return 0}},pointsLength:{get:function(){return 0}},trianglesLength:{get:function(){return 0}},geometryByteLength:{get:function(){return 0}},texturesByteLength:{get:function(){return 0}},batchTableByteLength:{get:function(){return 0}},innerContents:{get:function(){return this._contents}},ready:{get:function(){return!!this._contentsCreated&&this._ready}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){}},metadata:{get:function(){},set:function(){throw new A.Z("Multiple3DTileContent cannot have metadata")}},batchTable:{get:function(){}},group:{get:function(){},set:function(){throw new A.Z("Multiple3DTileContent cannot have group metadata")}},innerContentUrls:{get:function(){return this._innerContentHeaders.map(function(e){return e.uri})}}}),Ts.prototype.requestInnerContents=function(){if(!function(e){let t={};for(let i=0;i<e.length;i++){let n=e[i];(0,_.Z)(t[n])?t[n]++:t[n]=1}for(let e in t)if(t.hasOwnProperty(e)&&!yA.Z.serverHasOpenSlots(e,t[e]))return!1;return yA.Z.heapHasOpenSlots(e.length)}(this._serverKeys)){this.tileset.statistics.numberOfAttemptedRequests+=this._serverKeys.length;return}let e=this._innerContentHeaders;Tl(this,e.length);let t=this._cancelCount;for(let i=0;i<e.length;i++)this._arrayFetchPromises[i]=function(e,t,i,n){let r=e._innerContentResources[t].clone(),o=e.tile,a=e._serverKeys[t],s=new yC.Z({throttle:!0,throttleByServer:!0,type:yO.Z.TILES3D,priorityFunction:function(){return o._priority},serverKey:a});r.request=s,e._requests[t]=s;let l=r.fetchArrayBuffer();if((0,_.Z)(l))return l.then(function(t){if(!(i<e._cancelCount)){if(r.request.cancelled||r.request.state===yI.Z.CANCELLED){Tc(e,n);return}return Tl(e,-1),t}}).catch(function(o){if(!(i<e._cancelCount)){if(r.request.cancelled||r.request.state===yI.Z.CANCELLED){Tc(e,n);return}Tl(e,-1),Td(e,t,o)}})}(this,i,t,this._tile._contentState);return Tu(this)},Ts.prototype.cancelRequests=function(){for(let e=0;e<this._requests.length;e++){let t=this._requests[e];(0,_.Z)(t)&&t.cancel()}},Ts.prototype.hasProperty=function(e,t){return!1},Ts.prototype.getFeature=function(e){},Ts.prototype.applyDebugSettings=function(e,t){let i=this._contents,n=i.length;for(let r=0;r<n;++r)i[r].applyDebugSettings(e,t)},Ts.prototype.applyStyle=function(e){let t=this._contents,i=t.length;for(let n=0;n<i;++n)t[n].applyStyle(e)},Ts.prototype.update=function(e,t){let i=this._contents,n=i.length,r=!0;for(let o=0;o<n;++o)i[o].update(e,t),r=r&&i[o].ready;!this._ready&&r&&(this._ready=!0)},Ts.prototype.pick=function(e,t,i){let n;if(!this._ready)return;let r=Number.POSITIVE_INFINITY,o=this._contents,a=o.length;for(let s=0;s<a;++s){let a=o[s].pick(e,t,i);if(!(0,_.Z)(a))continue;let l=S.Z.distance(e.origin,a);l<r&&(n=a,r=l)}if((0,_.Z)(n))return i},Ts.prototype.isDestroyed=function(){return!1},Ts.prototype.destroy=function(){let e=this._contents,t=e.length;for(let i=0;i<t;++i)e[i].destroy();return(0,g.Z)(this)};var Tf=i(6171),Tp=i(6222);let Tm=new ea.Z;function T_(e){let t;p.Z.typeOf.object("options",e),p.Z.typeOf.string("options.token",e.token);let i=bB.fromToken(e.token),n=(0,m.Z)(e.minimumHeight,0),r=(0,m.Z)(e.maximumHeight,0),o=(0,m.Z)(e.ellipsoid,el.Z.WGS84);this.s2Cell=i,this.minimumHeight=n,this.maximumHeight=r,this.ellipsoid=o;let a=function(e,t,i,n){let r,o,a;let s=Array(6),l=e.getCenter(),c=n.geodeticSurfaceNormal(l,Tg),u=n.cartesianToCartographic(l,TZ);u.height=i;let h=n.cartographicToCartesian(u,Ty),d=Tp.Z.fromPointNormal(h,c);s[0]=d;let f=0,p=[];for(r=0;r<4;r++){o=e.getVertex(r),p[r]=o,(a=n.cartesianToCartographic(o,Tb)).height=t;let i=Tp.Z.getPointDistance(d,n.cartographicToCartesian(a,Tv));i<f&&(f=i)}let m=Tp.Z.clone(d);for(r=0,m.normal=S.Z.negate(m.normal,m.normal),m.distance=-1*m.distance+f,s[1]=m;r<4;r++){o=p[r];let e=p[(r+1)%4],t=n.geodeticSurfaceNormal(o,TT),i=S.Z.subtract(e,o,Tx),a=S.Z.cross(i,t,TE);a=S.Z.normalize(a,a),s[2+r]=Tp.Z.fromPointNormal(o,a)}return s}(i,n,r,o);this._boundingPlanes=a;let s=function(e){let t=Array(8);for(let i=0;i<4;i++)t[i]=TB(e[0],e[2+(i+3)%4],e[2+i%4]),t[i+4]=TB(e[1],e[2+(i+3)%4],e[2+i%4]);return t}(a);for(t=0,this._vertices=s,this._edgeNormals=Array(6),this._edgeNormals[0]=TV(a[0],s.slice(0,4));t<4;t++)this._edgeNormals[0][t]=S.Z.negate(this._edgeNormals[0][t],this._edgeNormals[0][t]);for(t=0,this._edgeNormals[1]=TV(a[1],s.slice(4,8));t<4;t++)this._edgeNormals[2+t]=TV(a[2+t],[s[t%4],s[(t+1)%4],s[4+(t+1)%4],s[4+t]]);for(t=0,this._planeVertices=[this._vertices.slice(0,4),this._vertices.slice(4,8)];t<4;t++)this._planeVertices.push([this._vertices[t%4],this._vertices[(t+1)%4],this._vertices[4+(t+1)%4],this._vertices[4+t]]);let l=i.getCenter();(Tm=o.cartesianToCartographic(l,Tm)).height=(r+n)/2,this.center=o.cartographicToCartesian(Tm,l),this._boundingSphere=f.Z.fromPoints(s)}let Tg=new S.Z,TZ=new ea.Z,Ty=new S.Z,Tb=new ea.Z,Tv=new S.Z,TT=new S.Z,TE=new S.Z,Tx=new S.Z,Tw=new S.Z,TS=new S.Z,TC=new S.Z,TA=new S.Z,TI=new S.Z,TO=new S.Z,TD=new S.Z,TP=new S.Z,TR=new S.Z,TN=new S.Z,TL=new S.Z,TM=new S.Z,TF=new S.Z,Tz=new n2.Z;function TB(e,t,i){Tw=e.normal,TS=t.normal,TC=i.normal,TA=S.Z.multiplyByScalar(e.normal,-e.distance,TA),TI=S.Z.multiplyByScalar(t.normal,-t.distance,TI),TO=S.Z.multiplyByScalar(i.normal,-i.distance,TO),TN=S.Z.multiplyByScalar(S.Z.cross(TS,TC,TD),S.Z.dot(TA,Tw),TN),TL=S.Z.multiplyByScalar(S.Z.cross(TC,Tw,TP),S.Z.dot(TI,TS),TL),TM=S.Z.multiplyByScalar(S.Z.cross(Tw,TS,TR),S.Z.dot(TO,TC),TM),Tz[0]=Tw.x,Tz[1]=TS.x,Tz[2]=TC.x,Tz[3]=Tw.y,Tz[4]=TS.y,Tz[5]=TC.y,Tz[6]=Tw.z,Tz[7]=TS.z,Tz[8]=TC.z;let n=n2.Z.determinant(Tz);return TF=S.Z.add(TN,TL,TF),TF=S.Z.add(TF,TM,TF),new S.Z(TF.x/n,TF.y/n,TF.z/n)}let TU=new S.Z,Tk=new S.Z;function TV(e,t){let i=[];for(let n=0;n<4;n++)TU=S.Z.subtract(t[(n+1)%4],t[n],TU),Tk=S.Z.cross(e.normal,TU,Tk),Tk=S.Z.normalize(Tk,Tk),i[n]=S.Z.clone(Tk);return i}Object.defineProperties(T_.prototype,{boundingVolume:{get:function(){return this}},boundingSphere:{get:function(){return this._boundingSphere}}});let TH=new S.Z;T_.prototype.distanceToCamera=function(e){let t,i,n,r,o;p.Z.defined("frameState",e);let a=e.camera.positionWC,s=[],l=[];for(Tp.Z.getPointDistance(this._boundingPlanes[0],a)>0?(s.push(0),l.push(this._planeVertices[0]),t=this._edgeNormals[0]):Tp.Z.getPointDistance(this._boundingPlanes[1],a)>0&&(s.push(1),l.push(this._planeVertices[1]),t=this._edgeNormals[1]),i=0;i<4;i++)n=2+i,Tp.Z.getPointDistance(this._boundingPlanes[n],a)>0&&(s.push(n),l.push(this._planeVertices[n]),t=this._edgeNormals[n]);if(0===s.length)return 0;if(1===s.length)return o=this._boundingPlanes[s[0]],r=TY(Tp.Z.projectPointOntoPlane(o,a,TH),l[0],o,t),S.Z.distance(r,a);if(2===s.length){let e;if(0===s[0]){let e=[this._vertices[4*s[0]+(s[1]-2)],this._vertices[4*s[0]+(s[1]-2+1)%4]];return r=TW(a,e[0],e[1]),S.Z.distance(r,a)}let t=Number.MAX_VALUE;for(i=0;i<2;i++)o=this._boundingPlanes[s[i]],r=TY(Tp.Z.projectPointOntoPlane(o,a,TH),l[i],o,this._edgeNormals[s[i]]),(e=S.Z.distanceSquared(r,a))<t&&(t=e);return Math.sqrt(t)}if(s.length>3)return r=TY(Tp.Z.projectPointOntoPlane(this._boundingPlanes[1],a,TH),this._planeVertices[1],this._boundingPlanes[1],this._edgeNormals[1]),S.Z.distance(r,a);let c=2===s[1]&&5===s[2]?0:1;return 0===s[0]?S.Z.distance(a,this._vertices[(s[1]-2+c)%4]):S.Z.distance(a,this._vertices[4+(s[1]-2+c)%4])};let TG=new S.Z,Tj=new S.Z;function TW(e,t,i){let n=S.Z.subtract(i,t,TG),r=S.Z.subtract(e,t,Tj),o=S.Z.dot(n,r);if(o<=0)return t;let a=S.Z.dot(n,n);return o>=a?i:(o/=a,new S.Z((1-o)*t.x+o*i.x,(1-o)*t.y+o*i.y,(1-o)*t.z+o*i.z))}let Tq=new Tp.Z(S.Z.UNIT_X,0);function TY(e,t,i,n){let r,o,a,s=Number.MAX_VALUE;for(let i=0;i<t.length;i++){let l=Tp.Z.fromPointNormal(t[i],n[i],Tq);!(0>Tp.Z.getPointDistance(l,e))&&(a=TW(e,t[i],t[(i+1)%4]),(r=S.Z.distance(e,a))<s&&(s=r,o=a))}return(0,_.Z)(o)?o:e}T_.prototype.intersectPlane=function(e){p.Z.defined("plane",e);let t=0,i=0;for(let n=0;n<this._vertices.length;n++)S.Z.dot(e.normal,this._vertices[n])+e.distance<0?i++:t++;return t===this._vertices.length?yS.Z.INSIDE:i===this._vertices.length?yS.Z.OUTSIDE:yS.Z.INTERSECTING},T_.prototype.createDebugVolume=function(e){p.Z.defined("color",e);let t=new er.Z.clone(er.Z.IDENTITY),i=new sj({polygonHierarchy:{positions:this._planeVertices[0]}}),n=sj.createGeometry(i),r=new nw.Z({geometry:n,id:"outline",modelMatrix:t,attributes:{color:nE.Z.fromColor(e)}}),o=new sj({polygonHierarchy:{positions:this._planeVertices[1]}}),a=sj.createGeometry(o),s=new nw.Z({geometry:a,id:"outline",modelMatrix:t,attributes:{color:nE.Z.fromColor(e)}}),l=[];for(let i=0;i<4;i++){let n=new sj({polygonHierarchy:{positions:this._planeVertices[2+i]}}),r=sj.createGeometry(n);l[i]=new nw.Z({geometry:r,id:"outline",modelMatrix:t,attributes:{color:nE.Z.fromColor(e)}})}return new nI.Z({geometryInstances:[l[0],l[1],l[2],l[3],s,r],appearance:new ng.Z({translucent:!1,flat:!0}),asynchronous:!1})};var TX=i(3358);function T$(e,t){0===t&&(t=eB.Z.EPSILON7),this._boundingSphere=new f.Z(e,t)}Object.defineProperties(T$.prototype,{center:{get:function(){return this._boundingSphere.center}},radius:{get:function(){return this._boundingSphere.radius}},boundingVolume:{get:function(){return this._boundingSphere}},boundingSphere:{get:function(){return this._boundingSphere}}}),T$.prototype.distanceToCamera=function(e){p.Z.defined("frameState",e);let t=this._boundingSphere;return Math.max(0,S.Z.distance(t.center,e.camera.positionWC)-t.radius)},T$.prototype.intersectPlane=function(e){return p.Z.defined("plane",e),f.Z.intersectPlane(this._boundingSphere,e)},T$.prototype.update=function(e,t){S.Z.clone(e,this._boundingSphere.center),this._boundingSphere.radius=t},T$.prototype.createDebugVolume=function(e){p.Z.defined("color",e);let t=new TX.Z({radius:this.radius}),i=er.Z.fromTranslation(this.center,new er.Z.clone(er.Z.IDENTITY)),n=new nw.Z({geometry:t,id:"outline",modelMatrix:i,attributes:{color:nE.Z.fromColor(e)}});return new nI.Z({geometryInstances:n,appearance:new ng.Z({translucent:!1,flat:!0}),asynchronous:!1})};let TK=new S.Z,TQ=new S.Z,TJ=new S.Z,T0=new S.Z;function T1(e,t,i){i=S.Z.cross(e,t,i);let n=S.Z.magnitude(i);return S.Z.multiplyByScalar(i,eB.Z.EPSILON7/n,i)}function T2(e,t){let i=S.Z.normalize(e,T0);return T1(e,S.Z.equalsEpsilon(i,S.Z.UNIT_X,eB.Z.EPSILON6)?S.Z.UNIT_Y:S.Z.UNIT_X,t)}function T3(e){let t=n2.Z.getColumn(e,0,TK),i=n2.Z.getColumn(e,1,TQ),n=n2.Z.getColumn(e,2,TJ),r=S.Z.equals(t,S.Z.ZERO),o=S.Z.equals(i,S.Z.ZERO),a=S.Z.equals(n,S.Z.ZERO);return(r||o||a)&&(r&&o&&a?(e[0]=eB.Z.EPSILON7,e[4]=eB.Z.EPSILON7,e[8]=eB.Z.EPSILON7):(!r||o||a?r||!o||a?r||o||!a?r?o?a||(t=T2(n,t),i=T1(n,t,i)):(t=T2(i,t),n=T1(i,t,n)):n=T1(i=T2(t,i),t,n):n=T1(i,t,n):i=T1(t,n,i):t=T1(i,n,t),n2.Z.setColumn(e,0,t,e),n2.Z.setColumn(e,1,i,e),n2.Z.setColumn(e,2,n,e))),e}function T4(e,t){t=T3(t),this._orientedBoundingBox=new sZ.Z(e,t),this._boundingSphere=f.Z.fromOrientedBoundingBox(this._orientedBoundingBox)}function T5(e,t,i,n){let r,o,a,s,l,c,u,h,d;this._tileset=e,this._header=i;let f=(0,_.Z)(i.contents),p=f&&i.contents.length>1||hC(i,"3DTILES_multiple_contents"),m=f&&!p?i.contents[0]:i.content;this._contentHeader=m,this.transform=(0,_.Z)(i.transform)?er.Z.unpack(i.transform):er.Z.clone(er.Z.IDENTITY);let g=(0,_.Z)(n)?n.computedTransform:e.modelMatrix,Z=er.Z.multiply(g,this.transform,new er.Z),y=(0,_.Z)(n)?n._initialTransform:er.Z.IDENTITY;this._initialTransform=er.Z.multiply(y,this.transform,new er.Z),this.computedTransform=Z,this.metadata=To(e,i),this._verticalExaggeration=1,this._verticalExaggerationRelativeHeight=0,this._boundingVolume=this.createBoundingVolume(i.boundingVolume,Z),this._boundingVolume2D=void 0,(0,_.Z)(m)&&(0,_.Z)(m.boundingVolume)&&(r=this.createBoundingVolume(m.boundingVolume,Z)),this._contentBoundingVolume=r,this._contentBoundingVolume2D=void 0,(0,_.Z)(i.viewerRequestVolume)&&(o=this.createBoundingVolume(i.viewerRequestVolume,Z)),this._viewerRequestVolume=o,this.geometricError=i.geometricError,this._geometricError=i.geometricError,(0,_.Z)(this._geometricError)||(this._geometricError=(0,_.Z)(n)?n._geometricError:e._geometricError,T5._deprecationWarning("geometricErrorUndefined","Required property geometricError is undefined for this tile. Using parent's geometric error instead.")),this.updateGeometricErrorScale(),(0,_.Z)(i.refine)?(("replace"===i.refine||"add"===i.refine)&&T5._deprecationWarning("lowercase-refine",`This tile uses a lowercase refine "${i.refine}". Instead use "${i.refine.toUpperCase()}".`),a="REPLACE"===i.refine.toUpperCase()?gI.REPLACE:gI.ADD):a=(0,_.Z)(n)?n.refine:gI.REPLACE,this.refine=a,this.children=[],this.parent=n;let b=!1;if(t=ec.Z.createIfNeeded(t),p)l=v5.UNLOADED,c=t.clone();else if((0,_.Z)(m)){let i=m.uri;(0,_.Z)(m.url)&&(T5._deprecationWarning("contentUrl",'This tileset JSON uses the "content.url" property which has been deprecated. Use "content.uri" instead.'),i=m.url),""===i?(T5._deprecationWarning("contentUriEmpty","content.uri property is an empty string, which creates a circular dependency, making this tileset invalid. Omit the content property instead"),s=new Te(e,this),b=!0,l=v5.READY):(l=v5.UNLOADED,c=t.getDerivedResource({url:i}),u=yA.Z.getServerKey(c.getUrlComponent()))}else s=new Te(e,this),b=!0,l=v5.READY;this._content=s,this._contentResource=c,this._contentState=l,this._expiredContent=void 0,this._serverKey=u,this.hasEmptyContent=b,this.hasTilesetContent=!1,this.hasImplicitContent=!1,this.hasImplicitContentMetadata=!1,this.hasMultipleContents=p,this.cacheNode=void 0;let v=i.expire;(0,_.Z)(v)&&(h=v.duration,(0,_.Z)(v.date)&&(d=nt.Z.fromIso8601(v.date))),this.expireDuration=h,this.expireDate=d,this.lastStyleTime=0,this._optimChildrenWithinParent=v6.NOT_COMPUTED,this.clippingPlanesDirty=!1,this.clippingPolygonsDirty=!1,this.priorityDeferred=!1,this.implicitTileset=void 0,this.implicitCoordinates=void 0,this.implicitSubtree=void 0,this._distanceToCamera=0,this._centerZDepth=0,this._screenSpaceError=0,this._screenSpaceErrorProgressiveResolution=0,this._visibilityPlaneMask=0,this._visible=!1,this._inRequestVolume=!1,this._finalResolution=!0,this._depth=0,this._stackLength=0,this._selectionDepth=0,this._updatedVisibilityFrame=0,this._touchedFrame=0,this._visitedFrame=0,this._selectedFrame=0,this._wasSelectedLastFrame=!1,this._requestedFrame=0,this._ancestorWithContent=void 0,this._ancestorWithContentAvailable=void 0,this._refines=!1,this._shouldSelect=!1,this._isClipped=!0,this._isClippedByPolygon=!1,this._clippingPlanesState=0,this._clippingPolygonsState=0,this._debugBoundingVolume=void 0,this._debugContentBoundingVolume=void 0,this._debugViewerRequestVolume=void 0,this._debugColor=C.Z.fromRandom({alpha:1}),this._debugColorizeTiles=!1,this._priority=0,this._priorityHolder=this,this._priorityProgressiveResolution=!1,this._priorityProgressiveResolutionScreenSpaceErrorLeaf=!1,this._priorityReverseScreenSpaceError=0,this._foveatedFactor=0,this._wasMinPriorityChild=!1,this._loadTimestamp=new nt.Z,this._commandsLength=0,this._color=void 0,this._colorDirty=!1,this._request=void 0}Object.defineProperties(T4.prototype,{boundingVolume:{get:function(){return this._orientedBoundingBox}},boundingSphere:{get:function(){return this._boundingSphere}}}),T4.prototype.distanceToCamera=function(e){return p.Z.defined("frameState",e),Math.sqrt(this._orientedBoundingBox.distanceSquaredTo(e.camera.positionWC))},T4.prototype.intersectPlane=function(e){return p.Z.defined("plane",e),this._orientedBoundingBox.intersectPlane(e)},T4.prototype.update=function(e,t){S.Z.clone(e,this._orientedBoundingBox.center),t=T3(t),n2.Z.clone(t,this._orientedBoundingBox.halfAxes),f.Z.fromOrientedBoundingBox(this._orientedBoundingBox,this._boundingSphere)},T4.prototype.createDebugVolume=function(e){p.Z.defined("color",e);let t=new nT.Z({minimum:new S.Z(-1,-1,-1),maximum:new S.Z(1,1,1)}),i=er.Z.fromRotationTranslation(this.boundingVolume.halfAxes,this.boundingVolume.center),n=new nw.Z({geometry:t,id:"outline",modelMatrix:i,attributes:{color:nE.Z.fromColor(e)}});return new nI.Z({geometryInstances:n,appearance:new ng.Z({translucent:!1,flat:!0}),asynchronous:!1})},T5._deprecationWarning=hj.Z,Object.defineProperties(T5.prototype,{tileset:{get:function(){return this._tileset}},content:{get:function(){return this._content}},boundingVolume:{get:function(){return this._boundingVolume}},contentBoundingVolume:{get:function(){return(0,m.Z)(this._contentBoundingVolume,this._boundingVolume)}},boundingSphere:{get:function(){return this._boundingVolume.boundingSphere}},isVisible:{get:function(){return this._visible&&this._inRequestVolume}},extras:{get:function(){return this._header.extras}},color:{get:function(){return(0,_.Z)(this._color)||(this._color=new C.Z),C.Z.clone(this._color)},set:function(e){this._color=C.Z.clone(e,this._color),this._colorDirty=!0}},hasRenderableContent:{get:function(){return!this.hasEmptyContent&&!this.hasTilesetContent&&!this.hasImplicitContent}},contentAvailable:{get:function(){return this.contentReady&&this.hasRenderableContent||(0,_.Z)(this._expiredContent)&&!this.contentFailed}},contentReady:{get:function(){return this._contentState===v5.READY}},contentUnloaded:{get:function(){return this._contentState===v5.UNLOADED}},hasUnloadedRenderableContent:{get:function(){return this.hasRenderableContent&&this.contentUnloaded}},contentExpired:{get:function(){return this._contentState===v5.EXPIRED}},contentFailed:{get:function(){return this._contentState===v5.FAILED}},commandsLength:{get:function(){return this._commandsLength}}});let T9=new S.Z,T8=new nt.Z;async function T6(e,t,i,n,r){let o;let a=e._contentState;e._contentState=v5.LOADING,++t.statistics.numberOfPendingRequests;try{o=await r}catch(n){if(--t.statistics.numberOfPendingRequests,e.isDestroyed())return;if(i.cancelled||i.state===yI.Z.CANCELLED){e._contentState=a,++t.statistics.numberOfAttemptedRequests;return}throw e._contentState=v5.FAILED,n}if(e.isDestroyed()){--t.statistics.numberOfPendingRequests;return}if(i.cancelled||i.state===yI.Z.CANCELLED){e._contentState=a,--t.statistics.numberOfPendingRequests,++t.statistics.numberOfAttemptedRequests;return}try{let i=await T7(e,o);if(--t.statistics.numberOfPendingRequests,e.isDestroyed())return;return n&&(e.expireDate=void 0),e._content=i,e._contentState=v5.PROCESSING,i}catch(i){if(--t.statistics.numberOfPendingRequests,e.isDestroyed())return;throw e._contentState=v5.FAILED,i}}async function T7(e,t){let i;let n=Ta(t),r=e._tileset;r._disableSkipLevelOfDetail=r._disableSkipLevelOfDetail||n.contentType===v8.GEOMETRY||n.contentType===v8.VECTOR,(n.contentType===v8.IMPLICIT_SUBTREE||n.contentType===v8.IMPLICIT_SUBTREE_JSON)&&(e.hasImplicitContent=!0),n.contentType===v8.EXTERNAL_TILESET&&(e.hasTilesetContent=!0);let o=v4[n.contentType];if(e.isDestroyed())return;i=(0,_.Z)(n.binaryPayload)?await Promise.resolve(o(r,e,e._contentResource,n.binaryPayload.buffer,0)):await Promise.resolve(o(r,e,e._contentResource,n.jsonPayload));let a=e._contentHeader;if(e.hasImplicitContentMetadata){let t=e.implicitSubtree,n=e.implicitCoordinates;i.metadata=t.getContentMetadataView(n,0)}else e.hasImplicitContent||(i.metadata=Ti(r,a));let s=Tn(r,a);return(0,_.Z)(s)&&(i.group=new yD({metadata:s})),i}T5.prototype.getScreenSpaceError=function(e,t,i){let n;let r=this._tileset,o=(0,m.Z)(i,1),a=(0,_.Z)(this.parent)?this.parent.geometricError:r._scaledGeometricError,s=t?a:this.geometricError;if(0===s)return 0;let{camera:l,context:c}=e,u=l.frustum,h=c.drawingBufferWidth,d=c.drawingBufferHeight*o;if(e.mode===eu.Z.SCENE2D||u instanceof gO.Z){let e=u.offCenterFrustum;(0,_.Z)(e)&&(u=e),n=s/(Math.max(u.top-u.bottom,u.right-u.left)/Math.max(h,d))}else{let e=Math.max(this._distanceToCamera,eB.Z.EPSILON7);if(n=s*d/(e*u.sseDenominator),r.dynamicScreenSpaceError){let t=r._dynamicScreenSpaceErrorComputedDensity,i=r.dynamicScreenSpaceErrorFactor;n-=eB.Z.fog(e,t)*i}}return n/e.pixelRatio},T5.prototype.updateVisibility=function(e){let{parent:t,tileset:i}=this;if(this._updatedVisibilityFrame===i._updatedVisibilityFrame)return;let n=(0,_.Z)(t)?t.computedTransform:i.modelMatrix,r=(0,_.Z)(t)?t._visibilityPlaneMask:yw.Z.MASK_INDETERMINATE;this.updateTransform(n,e),this._distanceToCamera=this.distanceToTile(e),this._centerZDepth=this.distanceToTileCenter(e),this._screenSpaceError=this.getScreenSpaceError(e,!1),this._screenSpaceErrorProgressiveResolution=this.getScreenSpaceError(e,!1,i.progressiveResolutionHeightFraction),this._visibilityPlaneMask=this.visibility(e,r),this._visible=this._visibilityPlaneMask!==yw.Z.MASK_OUTSIDE,this._inRequestVolume=this.insideViewerRequestVolume(e),this._priorityReverseScreenSpaceError=function(e,t){let i=t.parent,n=(0,_.Z)(i)&&(!e.isSkippingLevelOfDetail||0===t._screenSpaceError||i.hasTilesetContent||i.hasImplicitContent)?i._screenSpaceError:t._screenSpaceError;return e.root._screenSpaceError-n}(i,this),this._priorityProgressiveResolution=function(e,t){if(e.progressiveResolutionHeightFraction<=0||e.progressiveResolutionHeightFraction>.5)return!1;let i=e.memoryAdjustedScreenSpaceError,n=t._screenSpaceErrorProgressiveResolution>i;t._priorityProgressiveResolutionScreenSpaceErrorLeaf=!1;let r=t.parent,o=t._screenSpaceErrorProgressiveResolution<=i,a=(0,_.Z)(r)&&r._screenSpaceErrorProgressiveResolution>i;return o&&a&&(t._priorityProgressiveResolutionScreenSpaceErrorLeaf=!0,n=!0),n}(i,this),this.priorityDeferred=function(e,t){let{tileset:i,boundingSphere:n}=e,{radius:r,center:o}=n,{camera:a}=t,s=S.Z.multiplyByScalar(a.directionWC,e._centerZDepth,T9),l=S.Z.add(a.positionWC,s,T9),c=S.Z.subtract(l,o,T9);if(S.Z.magnitude(c)>r){let t=S.Z.normalize(c,T9),i=S.Z.multiplyByScalar(t,r,T9),n=S.Z.add(o,i,T9),s=S.Z.subtract(n,a.positionWC,T9),l=S.Z.normalize(s,T9);e._foveatedFactor=1-Math.abs(S.Z.dot(a.directionWC,l))}else e._foveatedFactor=0;let u=e.refine===gI.REPLACE,h=i.isSkippingLevelOfDetail;if(u&&!h||!i.foveatedScreenSpaceError||1===i.foveatedConeSize||e._priorityProgressiveResolution&&u&&h||i._pass===v7.Z.PRELOAD_FLIGHT||i._pass===v7.Z.PRELOAD)return!1;let d=1-Math.cos(.5*a.frustum.fov),f=i.foveatedConeSize*d;if(e._foveatedFactor<=f)return!1;let p=eB.Z.clamp((e._foveatedFactor-f)/(d-f),0,1),m=i.foveatedInterpolationCallback(i.foveatedMinimumScreenSpaceErrorRelaxation,i.memoryAdjustedScreenSpaceError,p),g=0===e._screenSpaceError&&(0,_.Z)(e.parent)?.5*e.parent._screenSpaceError:e._screenSpaceError;return i.memoryAdjustedScreenSpaceError-m<=g}(this,e),this._updatedVisibilityFrame=i._updatedVisibilityFrame},T5.prototype.updateExpiration=function(){if((0,_.Z)(this.expireDate)&&this.contentReady&&!this.hasEmptyContent&&!this.hasMultipleContents){let e=nt.Z.now(T8);nt.Z.lessThan(this.expireDate,e)&&(this._contentState=v5.EXPIRED,this._expiredContent=this._content)}},T5.prototype.requestContent=function(){return this.hasEmptyContent?void 0:this.hasMultipleContents?function(e){let t=e._content,i=e._tileset;if(!(0,_.Z)(t)){let n=hC(e._header,"3DTILES_multiple_contents")?e._header.extensions["3DTILES_multiple_contents"]:e._header;t=new Ts(i,e,e._contentResource.clone(),n),e._content=t}let n=t.requestInnerContents();if((0,_.Z)(n))return e._contentState=v5.LOADING,n.then(i=>{if(!e.isDestroyed()&&(0,_.Z)(i))return e._contentState=v5.PROCESSING,t}).catch(t=>{if(!e.isDestroyed())throw e._contentState=v5.FAILED,t})}(this):function(e){let t=e._contentResource.clone(),i=e.contentExpired;i&&t.setQueryParameters({expired:e.expireDate.toString()});let n=new yC.Z({throttle:!0,throttleByServer:!0,type:yO.Z.TILES3D,priorityFunction:function(){return e._priority},serverKey:e._serverKey});e._request=n,t.request=n;let r=e._tileset,o=t.fetchArrayBuffer();if(!(0,_.Z)(o)){++r.statistics.numberOfAttemptedRequests;return}return T6(e,r,n,i,o)}(this)},T5.prototype.cancelRequests=function(){this.hasMultipleContents?this._content.cancelRequests():this._request.cancel()},T5.prototype.unloadContent=function(){this.hasRenderableContent&&(this._content=this._content&&this._content.destroy(),this._contentState=v5.UNLOADED,this.lastStyleTime=0,this.clippingPlanesDirty=0===this._clippingPlanesState,this._clippingPlanesState=0,this.clippingPolygonsDirty=0===this._clippingPolygonsState,this._clippingPolygonsState=0,this._debugColorizeTiles=!1,this._debugBoundingVolume=this._debugBoundingVolume&&this._debugBoundingVolume.destroy(),this._debugContentBoundingVolume=this._debugContentBoundingVolume&&this._debugContentBoundingVolume.destroy(),this._debugViewerRequestVolume=this._debugViewerRequestVolume&&this._debugViewerRequestVolume.destroy())};let Ee=new f.Z;function Et(e,t){if(t.mode!==eu.Z.SCENE3D&&!(0,_.Z)(e._boundingVolume2D)){let i=e._boundingVolume.boundingSphere,n=f.Z.projectTo2D(i,t.mapProjection,Ee);e._boundingVolume2D=new T$(n.center,n.radius)}return t.mode!==eu.Z.SCENE3D?e._boundingVolume2D:e._boundingVolume}T5.prototype.visibility=function(e,t){let i=e.cullingVolume,n=Et(this,e),r=this._tileset,o=r.clippingPlanes;if((0,_.Z)(o)&&o.enabled){let e=o.computeIntersectionWithBoundingVolume(n,r.clippingPlanesOriginMatrix);if(this._isClipped=e!==yS.Z.INSIDE,e===yS.Z.OUTSIDE)return yw.Z.MASK_OUTSIDE}let a=r.clippingPolygons;if((0,_.Z)(a)&&a.enabled){let e=a.computeIntersectionWithBoundingVolume(n);this._isClippedByPolygon=e!==yS.Z.OUTSIDE}return i.computeVisibilityWithPlaneMask(n,t)},T5.prototype.contentVisibility=function(e){if(!(0,_.Z)(this._contentBoundingVolume)||this._visibilityPlaneMask===yw.Z.MASK_INSIDE)return yS.Z.INSIDE;let t=e.cullingVolume,i=function(e,t){if(t.mode!==eu.Z.SCENE3D&&!(0,_.Z)(e._contentBoundingVolume2D)){let i=e._contentBoundingVolume.boundingSphere,n=f.Z.projectTo2D(i,t.mapProjection,Ee);e._contentBoundingVolume2D=new T$(n.center,n.radius)}return t.mode!==eu.Z.SCENE3D?e._contentBoundingVolume2D:e._contentBoundingVolume}(this,e),n=this._tileset,r=n.clippingPlanes;if((0,_.Z)(r)&&r.enabled){let e=r.computeIntersectionWithBoundingVolume(i,n.clippingPlanesOriginMatrix);if(this._isClipped=e!==yS.Z.INSIDE,e===yS.Z.OUTSIDE)return yS.Z.OUTSIDE}let o=n.clippingPolygons;if((0,_.Z)(o)&&o.enabled){let e=o.computeIntersectionWithBoundingVolume(i);if(this._isClippedByPolygon=e!==yS.Z.OUTSIDE,e===yS.Z.INSIDE)return yS.Z.OUTSIDE}return t.computeVisibility(i)},T5.prototype.distanceToTile=function(e){return Et(this,e).distanceToCamera(e)};let Ei=new S.Z;T5.prototype.distanceToTileCenter=function(e){let t=Et(this,e).boundingVolume,i=S.Z.subtract(t.center,e.camera.positionWC,Ei);return S.Z.dot(e.camera.directionWC,i)},T5.prototype.insideViewerRequestVolume=function(e){let t=this._viewerRequestVolume;return!(0,_.Z)(t)||0===t.distanceToCamera(e)};let En=new n2.Z,Er=new S.Z,Eo=new n2.Z,Ea=new S.Z,Es=new r5.Z,El=new sZ.Z,Ec=new er.Z;T5.prototype.createBoundingVolume=function(e,t,i){let n;let r=this.metadata;if((0,_.Z)(r)&&(n=b5.parseBoundingVolumeSemantic("TILE",r)),(0,_.Z)(n)&&(e=n),!(0,_.Z)(e))throw new e3.Z("boundingVolume must be defined");if(hC(e,"3DTILES_bounding_volume_S2"))return new T_(e.extensions["3DTILES_bounding_volume_S2"]);let{box:o,region:a,sphere:s}=e;if((0,_.Z)(o)){let e=function(e,t,i){let n=S.Z.fromElements(e[0],e[1],e[2],Ea),r=n2.Z.fromArray(e,3,Eo);n=er.Z.multiplyByPoint(t,n,n);let o=er.Z.getMatrix3(t,En);return(r=n2.Z.multiply(o,r,r),(0,_.Z)(i))?(i.update(n,r),i):new T4(n,r)}(o,t,i);return 1!==this._verticalExaggeration&&Eh(e,this._verticalExaggeration,this._verticalExaggerationRelativeHeight),e}if((0,_.Z)(a)){let e=function(e,t,i,n){if(!er.Z.equalsEpsilon(t,i,eB.Z.EPSILON8))return function(e,t,i,n){let r=r5.Z.unpack(e,0,Es),o=e[4],a=e[5],s=sZ.Z.fromRectangle(r,o,a,el.Z.WGS84,El),l=s.center,c=s.halfAxes;t=er.Z.multiplyTransformation(t,er.Z.inverseTransformation(i,Ec),Ec),l=er.Z.multiplyByPoint(t,l,l);let u=er.Z.getMatrix3(t,En);return(c=n2.Z.multiply(u,c,c),(0,_.Z)(n)&&n instanceof T4)?(n.update(l,c),n):new T4(l,c)}(e,t,i,n);let r=r5.Z.unpack(e,0,Es);return(0,_.Z)(n)?(n.rectangle=r5.Z.clone(r,n.rectangle),n.minimumHeight=e[4],n.maximumHeight=e[5],n.computeBoundingVolumes(el.Z.WGS84),n):new Tf.Z({rectangle:r,minimumHeight:e[4],maximumHeight:e[5]})}(a,t,this._initialTransform,i);return 1===this._verticalExaggeration||(e instanceof T4?Eh(e,this._verticalExaggeration,this._verticalExaggerationRelativeHeight):(e.minimumHeight=ZV.Z.getHeight(e.minimumHeight,this._verticalExaggeration,this._verticalExaggerationRelativeHeight),e.maximumHeight=ZV.Z.getHeight(e.maximumHeight,this._verticalExaggeration,this._verticalExaggerationRelativeHeight),e.computeBoundingVolumes(el.Z.WGS84))),e}if((0,_.Z)(s)){let e=function(e,t,i){let n=S.Z.fromElements(e[0],e[1],e[2],Ea),r=e[3];n=er.Z.multiplyByPoint(t,n,n);let o=er.Z.getScale(t,Er);return(r*=S.Z.maximumComponent(o),(0,_.Z)(i))?(i.update(n,r),i):new T$(n,r)}(s,t,i);if(1!==this._verticalExaggeration){let t=ZV.Z.getPosition(e.center,el.Z.WGS84,this._verticalExaggeration,this._verticalExaggerationRelativeHeight,Ea),i=e.radius*this._verticalExaggeration;e.update(t,i)}return e}throw new e3.Z("boundingVolume must contain a sphere, region, or box")};let Eu=S.Z.unpackArray(Array(24).fill(0));function Eh(e,t,i){let n=e.boundingVolume.computeCorners(Eu).map(e=>ZV.Z.getPosition(e,el.Z.WGS84,t,i,e)),r=sZ.Z.fromPoints(n,El);e.update(r.center,r.halfAxes)}T5.prototype.updateTransform=function(e,t){e=(0,m.Z)(e,er.Z.IDENTITY);let i=er.Z.multiplyTransformation(e,this.transform,Ec),n=!er.Z.equals(i,this.computedTransform),r=(0,_.Z)(t)&&(this._verticalExaggeration!==t.verticalExaggeration||this._verticalExaggerationRelativeHeight!==t.verticalExaggerationRelativeHeight);if(!n&&!r)return;n&&er.Z.clone(i,this.computedTransform),r&&(this._verticalExaggeration=t.verticalExaggeration,this._verticalExaggerationRelativeHeight=t.verticalExaggerationRelativeHeight);let o=this._header,a=this._contentHeader;this._boundingVolume=this.createBoundingVolume(o.boundingVolume,this.computedTransform,this._boundingVolume),(0,_.Z)(this._contentBoundingVolume)&&(this._contentBoundingVolume=this.createBoundingVolume(a.boundingVolume,this.computedTransform,this._contentBoundingVolume)),(0,_.Z)(this._viewerRequestVolume)&&(this._viewerRequestVolume=this.createBoundingVolume(o.viewerRequestVolume,this.computedTransform,this._viewerRequestVolume)),this.updateGeometricErrorScale(),this._debugBoundingVolume=this._debugBoundingVolume&&this._debugBoundingVolume.destroy(),this._debugContentBoundingVolume=this._debugContentBoundingVolume&&this._debugContentBoundingVolume.destroy(),this._debugViewerRequestVolume=this._debugViewerRequestVolume&&this._debugViewerRequestVolume.destroy()},T5.prototype.updateGeometricErrorScale=function(){let e=er.Z.getScale(this.computedTransform,Er),t=S.Z.maximumComponent(e);if(this.geometricError=this._geometricError*t,!(0,_.Z)(this.parent)){let e=this._tileset;e._scaledGeometricError=e._geometricError*t}},T5.prototype.update=function(e,t,i){let{commandList:n}=t,r=n.length;(function(e,t){let i=t.clippingPlanes,n=0;(0,_.Z)(i)&&e._isClipped&&i.enabled&&(n=i.clippingPlanesState),n!==e._clippingPlanesState&&(e._clippingPlanesState=n,e.clippingPlanesDirty=!0)})(this,e),function(e,t){let i=t.clippingPolygons,n=0;(0,_.Z)(i)&&e._isClippedByPolygon&&i.enabled&&(n=i.clippingPolygonsState),n!==e._clippingPolygonsState&&(e._clippingPolygonsState=n,e.clippingPolygonsDirty=!0)}(this,e),function(e,t,i,n){if(!n.isRender)return;let r=(0,_.Z)(e._contentHeader)&&(0,_.Z)(e._contentHeader.boundingVolume),o=t.debugShowBoundingVolume||t.debugShowContentBoundingVolume&&!r;if(o){let t;t=e._finalResolution?e.hasRenderableContent?C.Z.WHITE:C.Z.DARKGRAY:C.Z.YELLOW,(0,_.Z)(e._debugBoundingVolume)||(e._debugBoundingVolume=e._boundingVolume.createDebugVolume(t)),e._debugBoundingVolume.update(i);let n=e._debugBoundingVolume.getGeometryInstanceAttributes("outline");n.color=nE.Z.toValue(t,n.color)}else!o&&(0,_.Z)(e._debugBoundingVolume)&&(e._debugBoundingVolume=e._debugBoundingVolume.destroy());t.debugShowContentBoundingVolume&&r?((0,_.Z)(e._debugContentBoundingVolume)||(e._debugContentBoundingVolume=e._contentBoundingVolume.createDebugVolume(C.Z.BLUE)),e._debugContentBoundingVolume.update(i)):!t.debugShowContentBoundingVolume&&(0,_.Z)(e._debugContentBoundingVolume)&&(e._debugContentBoundingVolume=e._debugContentBoundingVolume.destroy()),t.debugShowViewerRequestVolume&&(0,_.Z)(e._viewerRequestVolume)?((0,_.Z)(e._debugViewerRequestVolume)||(e._debugViewerRequestVolume=e._viewerRequestVolume.createDebugVolume(C.Z.YELLOW)),e._debugViewerRequestVolume.update(i)):!t.debugShowViewerRequestVolume&&(0,_.Z)(e._debugViewerRequestVolume)&&(e._debugViewerRequestVolume=e._debugViewerRequestVolume.destroy());let a=t.debugColorizeTiles&&!e._debugColorizeTiles||(0,_.Z)(t._heatmap.tilePropertyName),s=!t.debugColorizeTiles&&e._debugColorizeTiles;a?(t._heatmap.colorize(e,i),e._debugColorizeTiles=!0,e.color=e._debugColor):s&&(e._debugColorizeTiles=!1,e.color=C.Z.WHITE),e._colorDirty&&(e._colorDirty=!1,e._content.applyDebugSettings(!0,e._color)),s&&t.makeStyleDirty()}(this,e,t,i),function(e,t,i){let n=e._expiredContent;if(!e.hasMultipleContents&&(0,_.Z)(n)){if(!e.contentReady){try{n.update(t,i)}catch(e){}return}e._expiredContent.destroy(),e._expiredContent=void 0}if((0,_.Z)(e.content))try{e.content.update(t,i)}catch(t){throw e._contentState=v5.FAILED,t}}(this,e,t);let o=n.length;this._commandsLength=o-r;for(let e=r;e<o;++e){let t=n[e],i=t.pass===ej.Z.TRANSLUCENT;t.depthForTranslucentClassification=i}this.clippingPlanesDirty=!1,this.clippingPolygonsDirty=!1};let Ed=[];function Ef(e,t,i){return parseInt(e*Math.pow(10,t))*Math.pow(10,i)}function Ep(e,t,i){return Math.max(eB.Z.normalize(e,t,i)-eB.Z.EPSILON7,0)}function Em(e){let t=(e=(0,m.Z)(e,m.Z.EMPTY_OBJECT)).id,i=e.group,n=e.class;p.Z.typeOf.object("options.group",i),p.Z.typeOf.object("options.class",n);let r=(0,_.Z)(i.properties)?i.properties:{};this._class=n,this._properties=r,this._id=t,this._extras=i.extras,this._extensions=i.extensions}function E_(e){let t=(e=(0,m.Z)(e,m.Z.EMPTY_OBJECT)).tileset,i=e.class;p.Z.typeOf.object("options.tileset",t),p.Z.typeOf.object("options.class",i);let n=(0,_.Z)(t.properties)?t.properties:{};this._class=i,this._properties=n,this._extras=t.extras,this._extensions=t.extensions}function Eg(e){let t;let i=(e=(0,m.Z)(e,m.Z.EMPTY_OBJECT)).metadataJson,n=e.schema;p.Z.typeOf.object("options.metadataJson",i),p.Z.typeOf.object("options.schema",n);let r=(0,m.Z)(i.metadata,i.tileset);(0,_.Z)(r)&&(t=new E_({tileset:r,class:n.classes[r.class]}));let o=[],a=[],s=i.groups;if(Array.isArray(s)){let e=s.length;for(let t=0;t<e;t++){let e=s[t];a.push(new Em({group:e,class:n.classes[e.class]}))}}else if((0,_.Z)(s)){let e=(o=Object.keys(s).sort()).length;for(let t=0;t<e;t++){let e=o[t];if(s.hasOwnProperty(e)){let t=s[e];a.push(new Em({id:e,group:s[e],class:n.classes[t.class]}))}}}this._schema=n,this._groups=a,this._groupIds=o,this._tileset=t,this._statistics=i.statistics,this._extras=i.extras,this._extensions=i.extensions}T5.prototype.process=function(e,t){this.contentExpired||this.contentReady||!this._content.ready||(function(e){if(!(0,_.Z)(e.expireDuration))return;let t=nt.Z.now(T8);nt.Z.addSeconds(t,e.expireDuration,t),(0,_.Z)(e.expireDate)?nt.Z.lessThan(e.expireDate,t)&&nt.Z.clone(t,e.expireDate):e.expireDate=nt.Z.clone(t)}(this),this._selectedFrame=0,this.lastStyleTime=0,nt.Z.now(this._loadTimestamp),this._contentState=v5.READY,this.hasTilesetContent||this.hasImplicitContent||(e._statistics.incrementLoadCounts(this.content),++e._statistics.numberOfTilesWithContentReady,++e._statistics.numberOfLoadedTilesTotal,e._cache.add(this)));let i=t.commandList;t.commandList=Ed;try{this._content.update(e,t)}catch(e){throw this._contentState=v5.FAILED,e}Ed.length=0,t.commandList=i},T5.prototype.updatePriority=function(){let e=this.tileset,t=e.preferLeaves,i=e._minimumPriority,n=e._maximumPriority,r=Ep(this._depth,i.depth,n.depth);r=t?1-r:r;let o=Ef(e.isSkippingLevelOfDetail||this.refine!==gI.REPLACE?Ep(this._priorityReverseScreenSpaceError,i.reverseScreenSpaceError,n.reverseScreenSpaceError):Ep(this._priorityHolder._distanceToCamera,i.distance,n.distance),4,0),a=this._priorityProgressiveResolution?0:1e8,s=Ef(Ep(this._priorityHolder._foveatedFactor,i.foveatedFactor,n.foveatedFactor),4,4),l=this.priorityDeferred?1e9:0,c=e._pass===v7.Z.PRELOAD_FLIGHT?0:Math.pow(10,10);this._priority=r+o+a+s+l+c},T5.prototype.isDestroyed=function(){return!1},T5.prototype.destroy=function(){return this._content=this._content&&this._content.destroy(),this._expiredContent=this._expiredContent&&!this._expiredContent.isDestroyed()&&this._expiredContent.destroy(),this._debugBoundingVolume=this._debugBoundingVolume&&this._debugBoundingVolume.destroy(),this._debugContentBoundingVolume=this._debugContentBoundingVolume&&this._debugContentBoundingVolume.destroy(),this._debugViewerRequestVolume=this._debugViewerRequestVolume&&this._debugViewerRequestVolume.destroy(),(0,g.Z)(this)},Object.defineProperties(Em.prototype,{class:{get:function(){return this._class}},id:{get:function(){return this._id}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}}),Em.prototype.hasProperty=function(e){return uB.hasProperty(e,this._properties,this._class)},Em.prototype.hasPropertyBySemantic=function(e){return uB.hasPropertyBySemantic(e,this._properties,this._class)},Em.prototype.getPropertyIds=function(e){return uB.getPropertyIds(this._properties,this._class,e)},Em.prototype.getProperty=function(e){return uB.getProperty(e,this._properties,this._class)},Em.prototype.setProperty=function(e,t){return uB.setProperty(e,t,this._properties,this._class)},Em.prototype.getPropertyBySemantic=function(e){return uB.getPropertyBySemantic(e,this._properties,this._class)},Em.prototype.setPropertyBySemantic=function(e,t){return uB.setPropertyBySemantic(e,t,this._properties,this._class)},Object.defineProperties(E_.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}}),E_.prototype.hasProperty=function(e){return uB.hasProperty(e,this._properties,this._class)},E_.prototype.hasPropertyBySemantic=function(e){return uB.hasPropertyBySemantic(e,this._properties,this._class)},E_.prototype.getPropertyIds=function(e){return uB.getPropertyIds(this._properties,this._class,e)},E_.prototype.getProperty=function(e){return uB.getProperty(e,this._properties,this._class)},E_.prototype.setProperty=function(e,t){return uB.setProperty(e,t,this._properties,this._class)},E_.prototype.getPropertyBySemantic=function(e){return uB.getPropertyBySemantic(e,this._properties,this._class)},E_.prototype.setPropertyBySemantic=function(e,t){return uB.setPropertyBySemantic(e,t,this._properties,this._class)},Object.defineProperties(Eg.prototype,{schema:{get:function(){return this._schema}},groups:{get:function(){return this._groups}},groupIds:{get:function(){return this._groupIds}},tileset:{get:function(){return this._tileset}},statistics:{get:function(){return this._statistics}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});let EZ={},Ey=new S.Z;function Eb(){this.head=void 0,this.tail=void 0,this._length=0}function Ev(e,t,i){this.item=e,this.previous=t,this.next=i}function ET(e,t){(0,_.Z)(t.previous)&&(0,_.Z)(t.next)?(t.previous.next=t.next,t.next.previous=t.previous):(0,_.Z)(t.previous)?(t.previous.next=void 0,e.tail=t.previous):(0,_.Z)(t.next)?(t.next.previous=void 0,e.head=t.next):(e.head=void 0,e.tail=void 0),t.next=void 0,t.previous=void 0}function EE(){this._list=new Eb,this._sentinel=this._list.add(),this._trimTiles=!1}function Ex(e){this.tilePropertyName=e,this._minimum=Number.MAX_VALUE,this._maximum=-Number.MAX_VALUE,this._previousMinimum=Number.MAX_VALUE,this._previousMaximum=-Number.MAX_VALUE,this._referenceMinimum={},this._referenceMaximum={}}function Ew(e,t){return"_loadTimestamp"===t?nt.Z.toDate(e).getTime():e}EZ.checkChildrenWithinParent=function(e){p.Z.typeOf.object("tile",e);let t=e.children,i=t.length,n=e.boundingVolume;if(n instanceof T4||n instanceof Tf.Z){let r=n._orientedBoundingBox;e._optimChildrenWithinParent=v6.USE_OPTIMIZATION;for(let n=0;n<i;++n){let i=t[n].boundingVolume;if(!(i instanceof T4||i instanceof Tf.Z)){e._optimChildrenWithinParent=v6.SKIP_OPTIMIZATION;break}let o=i._orientedBoundingBox,a=S.Z.subtract(o.center,r.center,Ey),s=S.Z.magnitude(a);if(S.Z.divideByScalar(a,s,a),Math.abs(r.halfAxes[0]*a.x)+Math.abs(r.halfAxes[1]*a.y)+Math.abs(r.halfAxes[2]*a.z)+Math.abs(r.halfAxes[3]*a.x)+Math.abs(r.halfAxes[4]*a.y)+Math.abs(r.halfAxes[5]*a.z)+Math.abs(r.halfAxes[6]*a.x)+Math.abs(r.halfAxes[7]*a.y)+Math.abs(r.halfAxes[8]*a.z)<=Math.abs(o.halfAxes[0]*a.x)+Math.abs(o.halfAxes[1]*a.y)+Math.abs(o.halfAxes[2]*a.z)+Math.abs(o.halfAxes[3]*a.x)+Math.abs(o.halfAxes[4]*a.y)+Math.abs(o.halfAxes[5]*a.z)+Math.abs(o.halfAxes[6]*a.x)+Math.abs(o.halfAxes[7]*a.y)+Math.abs(o.halfAxes[8]*a.z)+s){e._optimChildrenWithinParent=v6.SKIP_OPTIMIZATION;break}}}return e._optimChildrenWithinParent===v6.USE_OPTIMIZATION},Object.defineProperties(Eb.prototype,{length:{get:function(){return this._length}}}),Eb.prototype.add=function(e){let t=new Ev(e,this.tail,void 0);return(0,_.Z)(this.tail)?this.tail.next=t:this.head=t,this.tail=t,++this._length,t},Eb.prototype.remove=function(e){(0,_.Z)(e)&&(ET(this,e),--this._length)},Eb.prototype.splice=function(e,t){if(e===t)return;ET(this,t);let i=e.next;e.next=t,this.tail===e?this.tail=t:i.previous=t,t.next=i,t.previous=e},EE.prototype.reset=function(){this._list.splice(this._list.tail,this._sentinel)},EE.prototype.touch=function(e){let t=e.cacheNode;(0,_.Z)(t)&&this._list.splice(this._sentinel,t)},EE.prototype.add=function(e){(0,_.Z)(e.cacheNode)||(e.cacheNode=this._list.add(e))},EE.prototype.unloadTile=function(e,t,i){let n=t.cacheNode;(0,_.Z)(n)&&(this._list.remove(n),t.cacheNode=void 0,i(e,t))},EE.prototype.unloadTiles=function(e,t){let i=this._trimTiles;this._trimTiles=!1;let n=this._list,r=this._sentinel,o=n.head;for(;o!==r&&(e.totalMemoryUsageInBytes>e.cacheBytes||i);){let i=o.item;o=o.next,this.unloadTile(e,i,t)}},EE.prototype.trim=function(){this._trimTiles=!0},Ex.prototype.setReferenceMinimumMaximum=function(e,t,i){this._referenceMinimum[i]=Ew(e,i),this._referenceMaximum[i]=Ew(t,i)};let ES=[new C.Z(.1,.1,.1,1),new C.Z(.153,.278,.878,1),new C.Z(.827,.231,.49,1),new C.Z(.827,.188,.22,1),new C.Z(1,.592,.259,1),new C.Z(1,.843,0,1)];function EC(){this.selected=0,this.visited=0,this.numberOfCommands=0,this.numberOfAttemptedRequests=0,this.numberOfPendingRequests=0,this.numberOfTilesProcessing=0,this.numberOfTilesWithContentReady=0,this.numberOfTilesTotal=0,this.numberOfLoadedTilesTotal=0,this.numberOfFeaturesSelected=0,this.numberOfFeaturesLoaded=0,this.numberOfPointsSelected=0,this.numberOfPointsLoaded=0,this.numberOfTrianglesSelected=0,this.numberOfTilesStyled=0,this.numberOfFeaturesStyled=0,this.numberOfTilesCulledWithChildrenUnion=0,this.geometryByteLength=0,this.texturesByteLength=0,this.batchTableByteLength=0}function EA(e,t,i,n){let r=t.innerContents,o=t.pointsLength,a=t.trianglesLength,s=t.featuresLength,l=t.geometryByteLength,c=t.texturesByteLength,u=t.batchTableByteLength;if(n?(e.numberOfFeaturesLoaded+=i?-s:s,e.numberOfPointsLoaded+=i?-o:o,e.geometryByteLength+=i?-l:l,e.texturesByteLength+=i?-c:c,e.batchTableByteLength+=i?-u:u):(e.numberOfFeaturesSelected+=i?-s:s,e.numberOfPointsSelected+=i?-o:o,e.numberOfTrianglesSelected+=i?-a:a),(0,_.Z)(r)){let t=r.length;for(let o=0;o<t;++o)EA(e,r[o],i,n)}}function EI(){this._style=void 0,this._styleDirty=!1,this._lastStyleTime=0}Ex.prototype.colorize=function(e,t){let i=this.tilePropertyName;if(!(0,_.Z)(i)||!e.contentAvailable||e._selectedFrame!==t.frameNumber)return;let n=function(e,t){let i=e.tilePropertyName;if((0,_.Z)(i)){let n=Ew(t[i],i);return(0,_.Z)(n)?(e._maximum=Math.max(n,e._maximum),e._minimum=Math.min(n,e._minimum)):e.tilePropertyName=void 0,n}}(this,e),r=this._previousMinimum,o=this._previousMaximum;if(r===Number.MAX_VALUE||o===-Number.MAX_VALUE)return;let a=o-r+eB.Z.EPSILON7,s=eB.Z.clamp(n-r,0,a)/a*(ES.length-1),l=Math.floor(s),c=s-l,u=ES[l],h=ES[Math.ceil(s)],d=C.Z.clone(C.Z.WHITE);d.red=eB.Z.lerp(u.red,h.red,c),d.green=eB.Z.lerp(u.green,h.green,c),d.blue=eB.Z.lerp(u.blue,h.blue,c),e._debugColor=d},Ex.prototype.resetMinimumMaximum=function(){let e=this.tilePropertyName;if((0,_.Z)(e)){let t=this._referenceMinimum[e],i=this._referenceMaximum[e],n=(0,_.Z)(t)&&(0,_.Z)(i);this._previousMinimum=n?t:this._minimum,this._previousMaximum=n?i:this._maximum,this._minimum=Number.MAX_VALUE,this._maximum=-Number.MAX_VALUE}},EC.prototype.clear=function(){this.selected=0,this.visited=0,this.numberOfCommands=0,this.numberOfAttemptedRequests=0,this.numberOfFeaturesSelected=0,this.numberOfPointsSelected=0,this.numberOfTrianglesSelected=0,this.numberOfTilesStyled=0,this.numberOfFeaturesStyled=0,this.numberOfTilesCulledWithChildrenUnion=0},EC.prototype.incrementSelectionCounts=function(e){EA(this,e,!1,!1)},EC.prototype.incrementLoadCounts=function(e){EA(this,e,!1,!0)},EC.prototype.decrementLoadCounts=function(e){EA(this,e,!0,!0)},EC.clone=function(e,t){t.selected=e.selected,t.visited=e.visited,t.numberOfCommands=e.numberOfCommands,t.selected=e.selected,t.numberOfAttemptedRequests=e.numberOfAttemptedRequests,t.numberOfPendingRequests=e.numberOfPendingRequests,t.numberOfTilesProcessing=e.numberOfTilesProcessing,t.numberOfTilesWithContentReady=e.numberOfTilesWithContentReady,t.numberOfTilesTotal=e.numberOfTilesTotal,t.numberOfFeaturesSelected=e.numberOfFeaturesSelected,t.numberOfFeaturesLoaded=e.numberOfFeaturesLoaded,t.numberOfPointsSelected=e.numberOfPointsSelected,t.numberOfPointsLoaded=e.numberOfPointsLoaded,t.numberOfTrianglesSelected=e.numberOfTrianglesSelected,t.numberOfTilesStyled=e.numberOfTilesStyled,t.numberOfFeaturesStyled=e.numberOfFeaturesStyled,t.numberOfTilesCulledWithChildrenUnion=e.numberOfTilesCulledWithChildrenUnion,t.geometryByteLength=e.geometryByteLength,t.texturesByteLength=e.texturesByteLength,t.batchTableByteLength=e.batchTableByteLength},Object.defineProperties(EI.prototype,{style:{get:function(){return this._style},set:function(e){e!==this._style&&(this._style=e,this._styleDirty=!0)}}}),EI.prototype.makeDirty=function(){this._styleDirty=!0},EI.prototype.resetDirty=function(){this._styleDirty=!1},EI.prototype.applyStyle=function(e){if(!(0,_.Z)(e.root)||(0,_.Z)(this._style)&&!this._style._ready)return;let t=this._styleDirty;t&&++this._lastStyleTime;let i=this._lastStyleTime,n=e._statistics,r=t?e._selectedTiles:e._selectedTilesToStyle,o=r.length;for(let e=0;e<o;++e){let t=r[e];if(t.lastStyleTime!==i){let e=t.content;t.lastStyleTime=i,e.applyStyle(this._style),n.numberOfFeaturesStyled+=e.featuresLength,++n.numberOfTilesStyled}}};var EO=function(e,t,i){let n=hC(t,"3DTILES_implicit_tiling")?t.extensions["3DTILES_implicit_tiling"]:t.implicitTiling;p.Z.typeOf.object("implicitTiling",n),this.baseResource=e,this.geometricError=t.geometricError,this.metadataSchema=i;let r=t.boundingVolume;if(!(0,_.Z)(r.box)&&!(0,_.Z)(r.region)&&!hC(r,"3DTILES_bounding_volume_S2")&&!hC(r,"3DTILES_bounding_volume_cylinder"))throw new e3.Z("Only box, region, 3DTILES_bounding_volume_S2, and 3DTILES_bounding_volume_cylinder are supported for implicit tiling");this.boundingVolume=r,this.refine=t.refine,this.subtreeUriTemplate=new ec.Z({url:n.subtrees.uri}),this.contentUriTemplates=[],this.contentHeaders=[];let o=function(e){if(hC(e,"3DTILES_multiple_contents")){let t=e.extensions["3DTILES_multiple_contents"];return(0,_.Z)(t.contents)?t.contents:t.content}return(0,_.Z)(e.contents)?e.contents:(0,_.Z)(e.content)?[e.content]:[]}(t);for(let e=0;e<o.length;e++){let t=o[e];this.contentHeaders.push((0,uz.Z)(t,!0));let i=new ec.Z({url:t.uri});this.contentUriTemplates.push(i)}this.contentCount=this.contentHeaders.length,this.tileHeader=function(e){let t=(0,uz.Z)(e,!0);return(0,_.Z)(t.extensions)&&(delete t.extensions["3DTILES_implicit_tiling"],delete t.extensions["3DTILES_multiple_contents"],0===Object.keys(t.extensions).length&&delete t.extensions),delete t.implicitTiling,delete t.contents,delete t.content,t}(t),this.subdivisionScheme=bK[n.subdivisionScheme],this.branchingFactor=bK.getBranchingFactor(this.subdivisionScheme),this.subtreeLevels=n.subtreeLevels,(0,_.Z)(n.availableLevels)?this.availableLevels=n.availableLevels:this.availableLevels=n.maximumLevel+1};let ED={};function EP(e){return e=((e=((e=((e=(e^e<<8)&16711935)^e<<4)&252645135)^e<<2)&858993459)^e<<1)&1431655765}function ER(e){return e=((e=((e=((e=(e^e<<16)&50331903)^e<<8)&50393103)^e<<4)&51130563)^e<<2)&153391689}function EN(e){return e&=1431655765,e=((e=((e=((e=(e^e>>1)&858993459)^e>>2)&252645135)^e>>4)&16711935)^e>>8)&65535}function EL(e){return e&=153391689,e=((e=((e=((e=(e^e>>2)&51130563)^e>>4)&50393103)^e>>8)&4278190335)^e>>16)&1023}function EM(e){if(p.Z.typeOf.string("options.subdivisionScheme",e.subdivisionScheme),p.Z.typeOf.number("options.subtreeLevels",e.subtreeLevels),p.Z.typeOf.number("options.level",e.level),p.Z.typeOf.number("options.x",e.x),p.Z.typeOf.number("options.y",e.y),e.subdivisionScheme===bK.OCTREE&&p.Z.typeOf.number("options.z",e.z),e.level<0)throw new A.Z("level must be non-negative");if(e.x<0)throw new A.Z("x must be non-negative");if(e.y<0)throw new A.Z("y must be non-negative");if(e.subdivisionScheme===bK.OCTREE&&e.z<0)throw new A.Z("z must be non-negative");let t=1<<e.level;if(e.x>=t)throw new A.Z("x is out of range");if(e.y>=t)throw new A.Z("y is out of range");if(e.subdivisionScheme===bK.OCTREE&&e.z>=t)throw new A.Z("z is out of range");this.subdivisionScheme=e.subdivisionScheme,this.subtreeLevels=e.subtreeLevels,this.level=e.level,this.x=e.x,this.y=e.y,this.z=void 0,e.subdivisionScheme===bK.OCTREE&&(this.z=e.z)}function EF(e,t){if(e.subdivisionScheme!==t.subdivisionScheme)throw new A.Z("coordinates must have same subdivisionScheme");if(e.subtreeLevels!==t.subtreeLevels)throw new A.Z("coordinates must have same subtreeLevels")}ED.encode2D=function(e,t){if(p.Z.typeOf.number("x",e),p.Z.typeOf.number("y",t),e<0||e>65535||t<0||t>65535)throw new A.Z("inputs must be 16-bit unsigned integers");return(EP(e)|EP(t)<<1)>>>0},ED.decode2D=function(e,t){if(p.Z.typeOf.number("mortonIndex",e),e<0||e>4294967295)throw new A.Z("input must be a 32-bit unsigned integer");return(0,_.Z)(t)||(t=[,,]),t[0]=EN(e),t[1]=EN(e>>1),t},ED.encode3D=function(e,t,i){if(p.Z.typeOf.number("x",e),p.Z.typeOf.number("y",t),p.Z.typeOf.number("z",i),e<0||e>1023||t<0||t>1023||i<0||i>1023)throw new A.Z("inputs must be 10-bit unsigned integers");return ER(e)|ER(t)<<1|ER(i)<<2},ED.decode3D=function(e,t){if(p.Z.typeOf.number("mortonIndex",e),e<0||e>1073741823)throw new A.Z("input must be a 30-bit unsigned integer");return(0,_.Z)(t)||(t=[,,,]),t[0]=EL(e),t[1]=EL(e>>1),t[2]=EL(e>>2),t},Object.defineProperties(EM.prototype,{childIndex:{get:function(){let e;return e=0|1&this.x|(1&this.y)<<1,this.subdivisionScheme===bK.OCTREE&&(e|=(1&this.z)<<2),e}},mortonIndex:{get:function(){return this.subdivisionScheme===bK.OCTREE?ED.encode3D(this.x,this.y,this.z):ED.encode2D(this.x,this.y)}},tileIndex:{get:function(){return(this.subdivisionScheme===bK.OCTREE?((1<<3*this.level)-1)/7:((1<<2*this.level)-1)/3)+this.mortonIndex}}}),EM.prototype.getDescendantCoordinates=function(e){p.Z.typeOf.object("offsetCoordinates",e),EF(this,e);let t=this.level+e.level,i=(this.x<<e.level)+e.x,n=(this.y<<e.level)+e.y;if(this.subdivisionScheme===bK.OCTREE){let r=(this.z<<e.level)+e.z;return new EM({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:i,y:n,z:r})}return new EM({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:i,y:n})},EM.prototype.getAncestorCoordinates=function(e){if(p.Z.typeOf.number("offsetLevels",e),e<0)throw new A.Z("offsetLevels must be non-negative");if(e>this.level)throw new A.Z("ancestor cannot be above the tileset root");let t=1<<e,i=this.level-e,n=Math.floor(this.x/t),r=Math.floor(this.y/t);if(this.subdivisionScheme===bK.OCTREE){let e=Math.floor(this.z/t);return new EM({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:i,x:n,y:r,z:e})}return new EM({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:i,x:n,y:r})},EM.prototype.getOffsetCoordinates=function(e){if(p.Z.typeOf.object("descendantCoordinates",e),!this.isEqual(e)&&!this.isAncestor(e))throw new A.Z("this is not an ancestor of descendant");EF(this,e);let t=e.level-this.level,i=1<<t,n=e.x%i,r=e.y%i;if(this.subdivisionScheme===bK.OCTREE){let o=e.z%i;return new EM({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:n,y:r,z:o})}return new EM({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:n,y:r})},EM.prototype.getChildCoordinates=function(e){p.Z.typeOf.number("childIndex",e);let t=bK.getBranchingFactor(this.subdivisionScheme);if(e<0||t<=e)throw new A.Z(`childIndex must be at least 0 and less than ${t}`);let i=this.level+1,n=2*this.x+e%2,r=2*this.y+Math.floor(e/2)%2;if(this.subdivisionScheme===bK.OCTREE){let t=2*this.z+Math.floor(e/4)%2;return new EM({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:i,x:n,y:r,z:t})}return new EM({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:i,x:n,y:r})},EM.prototype.getSubtreeCoordinates=function(){return this.getAncestorCoordinates(this.level%this.subtreeLevels)},EM.prototype.getParentSubtreeCoordinates=function(){return this.getAncestorCoordinates(this.level%this.subtreeLevels+this.subtreeLevels)},EM.prototype.isAncestor=function(e){p.Z.typeOf.object("descendantCoordinates",e),EF(this,e);let t=e.level-this.level;if(t<=0)return!1;let i=e.x>>t,n=e.y>>t,r=this.x===i,o=this.y===n;if(this.subdivisionScheme===bK.OCTREE){let i=e.z>>t,n=this.z===i;return r&&o&&n}return r&&o},EM.prototype.isEqual=function(e){return p.Z.typeOf.object("otherCoordinates",e),this.subdivisionScheme===e.subdivisionScheme&&this.subtreeLevels===e.subtreeLevels&&this.level===e.level&&this.x===e.x&&this.y===e.y&&(this.subdivisionScheme!==bK.OCTREE||this.z===e.z)},EM.prototype.isImplicitTilesetRoot=function(){return 0===this.level},EM.prototype.isSubtreeRoot=function(){return this.level%this.subtreeLevels==0},EM.prototype.isBottomOfSubtree=function(){return this.level%this.subtreeLevels==this.subtreeLevels-1},EM.prototype.getTemplateValues=function(){let e={level:this.level,x:this.x,y:this.y};return this.subdivisionScheme===bK.OCTREE&&(e.z=this.z),e};let Ez=[0,0,0];function EB(){}function EU(){}EM.fromMortonIndex=function(e,t,i,n){let r;return new EM(e===bK.OCTREE?{subdivisionScheme:e,subtreeLevels:t,level:i,x:(r=ED.decode3D(n,Ez))[0],y:r[1],z:r[2]}:{subdivisionScheme:e,subtreeLevels:t,level:i,x:(r=ED.decode2D(n,Ez))[0],y:r[1]})},EM.fromTileIndex=function(e,t,i){let n,r,o;return r=e===bK.OCTREE?((1<<3*(n=Math.floor(eB.Z.log2(7*i+1)/3)))-1)/7:((1<<2*(n=Math.floor(eB.Z.log2(3*i+1)/2)))-1)/3,o=i-r,EM.fromMortonIndex(e,t,n,o)},EB.selectTiles=function(e,t){A.Z.throwInstantiationError()},EB.sortChildrenByDistanceToCamera=function(e,t){return 0===t._distanceToCamera&&0===e._distanceToCamera?t._centerZDepth-e._centerZDepth:t._distanceToCamera-e._distanceToCamera},EB.canTraverse=function(e){return 0!==e.children.length&&(e.hasTilesetContent||e.hasImplicitContent?!e.contentExpired:e._screenSpaceError>e.tileset.memoryAdjustedScreenSpaceError)},EB.selectTile=function(e,t){if(e.contentVisibility(t)===yS.Z.OUTSIDE)return;e._wasSelectedLastFrame=!0;let{content:i,tileset:n}=e;i.featurePropertiesDirty?(i.featurePropertiesDirty=!1,e.lastStyleTime=0,n._selectedTilesToStyle.push(e)):e._selectedFrame<t.frameNumber-1&&(n._selectedTilesToStyle.push(e),e._wasSelectedLastFrame=!1),e._selectedFrame=t.frameNumber,n._selectedTiles.push(e)},EB.visitTile=function(e,t){++e.tileset._statistics.visited,e._visitedFrame=t.frameNumber},EB.touchTile=function(e,t){e._touchedFrame!==t.frameNumber&&(e.tileset._cache.touch(e),e._touchedFrame=t.frameNumber)},EB.loadTile=function(e,t){let{tileset:i}=e;if(e._requestedFrame===t.frameNumber||!e.hasUnloadedRenderableContent&&!e.contentExpired||!function(e,t){let{tileset:i}=e;if(!i._cullRequestsWhileMoving)return!0;let{positionWCDeltaMagnitude:n,positionWCDeltaMagnitudeLastFrame:r}=t.camera,o=Math.max(2*e.boundingSphere.radius,1);return i.cullRequestsWhileMovingMultiplier*(0!==n?n:r)/o<1}(e,t))return;let n=t.camera.timeSinceMoved<i.foveatedTimeDelay;e.priorityDeferred&&n||(e._requestedFrame=t.frameNumber,i._requestedTiles.push(e))},EB.updateTile=function(e,t){(function e(t,i){if(t.updateVisibility(i),!t.isVisible)return;let n=t.children.length>0;if((t.hasTilesetContent||t.hasImplicitContent)&&n){let n=t.children[0];e(n,i),t._visible=n._visible;return}if(function(e,t){let{parent:i,tileset:n}=e;return!!(0,_.Z)(i)&&!i.hasTilesetContent&&!i.hasImplicitContent&&i.refine===gI.ADD&&e.getScreenSpaceError(t,!0)<=n.memoryAdjustedScreenSpaceError}(t,i)){t._visible=!1;return}let r=t.refine===gI.REPLACE,o=t._optimChildrenWithinParent===v6.USE_OPTIMIZATION;if(r&&o&&n&&!function(e,t){let i=!1,n=e.children;for(let e=0;e<n.length;++e){let r=n[e];r.updateVisibility(t),i=i||r.isVisible}return i}(t,i)){++t.tileset._statistics.numberOfTilesCulledWithChildrenUnion,t._visible=!1;return}})(e,t),e.updateExpiration(),e._wasMinPriorityChild=!1,e._priorityHolder=e,function(e){let t=e.tileset._minimumPriority,i=e.tileset._maximumPriority,n=e._priorityHolder;i.distance=Math.max(n._distanceToCamera,i.distance),t.distance=Math.min(n._distanceToCamera,t.distance),i.depth=Math.max(e._depth,i.depth),t.depth=Math.min(e._depth,t.depth),i.foveatedFactor=Math.max(n._foveatedFactor,i.foveatedFactor),t.foveatedFactor=Math.min(n._foveatedFactor,t.foveatedFactor),i.reverseScreenSpaceError=Math.max(e._priorityReverseScreenSpaceError,i.reverseScreenSpaceError),t.reverseScreenSpaceError=Math.min(e._priorityReverseScreenSpaceError,t.reverseScreenSpaceError)}(e),e._shouldSelect=!1,e._finalResolution=!0};let Ek={stack:new yx,stackMaximumLength:0};function EV(){}EU.selectTiles=function(e,t){e._selectedTiles.length=0,e._requestedTiles.length=0,e.hasMixedContent=!1;let i=!0,n=e.root;if(n.updateVisibility(t),!n.isVisible)return i;let{touchTile:r,visitTile:o}=EB,a=Ek.stack;for(a.push(n);a.length>0;){Ek.stackMaximumLength=Math.max(Ek.stackMaximumLength,a.length);let n=a.pop(),s=n.refine===gI.ADD,l=n.refine===gI.REPLACE,c=0!==n.children.length&&(n.hasTilesetContent||n.hasImplicitContent?!n.contentExpired:(n.hasEmptyContent,!0));c&&function(e,t,i){let{children:n}=e;for(let e=0;e<n.length;++e){let r=n[e];r.updateVisibility(i),r.isVisible&&t.push(r)}}(n,a,t),(s||l&&!c)&&((n.hasUnloadedRenderableContent||n.contentExpired)&&(n._priority=0,e._requestedTiles.push(n)),r(n,t),n.contentAvailable&&n.contentVisibility(t)!==yS.Z.OUTSIDE&&n.tileset._selectedTiles.push(n),n.hasRenderableContent&&!n.contentAvailable&&(i=!1)),o(n,t)}return Ek.stack.trim(Ek.stackMaximumLength),i};let EH={stack:new yx,stackMaximumLength:0},EG={stack:new yx,stackMaximumLength:0};function Ej(e,t){e.contentAvailable&&EB.selectTile(e,t)}function EW(){}EV.selectTiles=function(e,t){if(e._requestedTiles.length=0,e.debugFreezeFrame)return;e._selectedTiles.length=0,e._selectedTilesToStyle.length=0,e._emptyTiles.length=0,e.hasMixedContent=!1;let i=e.root;if(EB.updateTile(i,t),!i.isVisible||i.getScreenSpaceError(t,!0)<=e.memoryAdjustedScreenSpaceError)return;(function(e,t){let{tileset:i}=e,{canTraverse:n,loadTile:r,visitTile:o,touchTile:a}=EB,s=EH.stack;for(s.push(e);s.length>0;){EH.stackMaximumLength=Math.max(EH.stackMaximumLength,s.length);let e=s.pop(),l=e.parent,c=!(0,_.Z)(l)||l._refines;e._refines=!!n(e)&&function(e,t,i){let n=e.refine===gI.REPLACE,{tileset:r,children:o}=e,{updateTile:a,loadTile:s,touchTile:l}=EB;for(let e=0;e<o.length;++e)a(o[e],i);o.sort(EB.sortChildrenByDistanceToCamera);let c=n&&e.hasRenderableContent,u=!0,h=!1,d=-1,f=Number.MAX_VALUE;for(let e=0;e<o.length;++e){let n=o[e];if(n.isVisible?(t.push(n),n._foveatedFactor<f&&(d=e,f=n._foveatedFactor),h=!0):(c||r.loadSiblings)&&(n._foveatedFactor<f&&(d=e,f=n._foveatedFactor),s(n,i),l(n,i)),c){let e;e=!!n._inRequestVolume&&(n.hasRenderableContent?n.contentAvailable:function(e,t){let{canTraverse:i,updateTile:n,loadTile:r,touchTile:o}=EB,a=!0,s=EG.stack;for(s.push(e);s.length>0;){EG.stackMaximumLength=Math.max(EG.stackMaximumLength,s.length);let e=s.pop(),l=e.children,c=l.length,u=!e.hasRenderableContent&&i(e);if(u||e.contentAvailable||(a=!1),n(e,t),e.isVisible||(r(e,t),o(e,t)),u)for(let e=0;e<c;++e){let t=l[e];s.push(t)}}return e.hasEmptyContent||a}(n,i)),u=u&&e}}if(h||(u=!1),-1!==d&&n){let t=o[d];t._wasMinPriorityChild=!0;let i=(e._wasMinPriorityChild||e===r.root)&&f<=e._priorityHolder._foveatedFactor?e._priorityHolder:e;i._foveatedFactor=Math.min(t._foveatedFactor,i._foveatedFactor),i._distanceToCamera=Math.min(t._distanceToCamera,i._distanceToCamera);for(let e=0;e<o.length;++e)o[e]._priorityHolder=i}return u}(e,s,t)&&c;let u=!e._refines&&c;e.hasRenderableContent?e.refine===gI.ADD?(Ej(e,t),r(e,t)):e.refine===gI.REPLACE&&(r(e,t),u&&Ej(e,t)):(i._emptyTiles.push(e),r(e,t),u&&Ej(e,t)),o(e,t),a(e,t)}})(i,t),EH.stack.trim(EH.stackMaximumLength),EG.stack.trim(EG.stackMaximumLength);let n=e._requestedTiles;for(let e=0;e<n.length;++e)n[e].updatePriority()};let Eq={stack:new yx,stackMaximumLength:0},EY={stack:new yx,stackMaximumLength:0},EX={stack:new yx,stackMaximumLength:0,ancestorStack:new yx,ancestorStackMaximumLength:0};function E$(e,t){let i=e.contentAvailable?e:e._ancestorWithContentAvailable;(0,_.Z)(i)?i._shouldSelect=!0:function(e,t){let{updateTile:i,touchTile:n,selectTile:r}=EB,o=EY.stack;for(o.push(e);o.length>0;){EY.stackMaximumLength=Math.max(EY.stackMaximumLength,o.length);let a=o.pop().children;for(let s=0;s<a.length;++s){let l=a[s];l.isVisible&&(l.contentAvailable?(i(l,t),n(l,t),r(l,t)):l._depth-e._depth<2&&o.push(l))}}}(e,t)}function EK(e){e=(0,m.Z)(e,m.Z.EMPTY_OBJECT),this._url=void 0,this._basePath=void 0,this._root=void 0,this._resource=void 0,this._asset=void 0,this._properties=void 0,this._geometricError=void 0,this._scaledGeometricError=void 0,this._extensionsUsed=void 0,this._extensions=void 0,this._modelUpAxis=void 0,this._modelForwardAxis=void 0,this._cache=new EE,this._processingQueue=[],this._selectedTiles=[],this._emptyTiles=[],this._requestedTiles=[],this._selectedTilesToStyle=[],this._loadTimestamp=void 0,this._timeSinceLoad=0,this._updatedVisibilityFrame=0,this._updatedModelMatrixFrame=0,this._modelMatrixChanged=!1,this._previousModelMatrix=void 0,this._extras=void 0,this._credits=void 0,this._showCreditsOnScreen=(0,m.Z)(e.showCreditsOnScreen,!1),this._cullWithChildrenBounds=(0,m.Z)(e.cullWithChildrenBounds,!0),this._allTilesAdditive=!0,this._hasMixedContent=!1,this._stencilClearCommand=void 0,this._backfaceCommands=new yx,this._maximumScreenSpaceError=(0,m.Z)(e.maximumScreenSpaceError,16),this._memoryAdjustedScreenSpaceError=this._maximumScreenSpaceError,this._cacheBytes=(0,m.Z)(e.cacheBytes,536870912),p.Z.typeOf.number.greaterThanOrEquals("cacheBytes",this._cacheBytes,0);let t=(0,m.Z)(e.maximumCacheOverflowBytes,536870912);p.Z.typeOf.number.greaterThanOrEquals("maximumCacheOverflowBytes",t,0),this._maximumCacheOverflowBytes=t,this._styleEngine=new EI,this._styleApplied=!1,this._modelMatrix=(0,_.Z)(e.modelMatrix)?er.Z.clone(e.modelMatrix):er.Z.clone(er.Z.IDENTITY),this._addHeightCallbacks=[],this._statistics=new EC,this._statisticsLast=new EC,this._statisticsPerPass=Array(v7.Z.NUMBER_OF_PASSES);for(let e=0;e<v7.Z.NUMBER_OF_PASSES;++e)this._statisticsPerPass[e]=new EC;this._requestedTilesInFlight=[],this._maximumPriority={foveatedFactor:-Number.MAX_VALUE,depth:-Number.MAX_VALUE,distance:-Number.MAX_VALUE,reverseScreenSpaceError:-Number.MAX_VALUE},this._minimumPriority={foveatedFactor:Number.MAX_VALUE,depth:Number.MAX_VALUE,distance:Number.MAX_VALUE,reverseScreenSpaceError:Number.MAX_VALUE},this._heatmap=new Ex(e.debugHeatmapTilePropertyName),this.cullRequestsWhileMoving=(0,m.Z)(e.cullRequestsWhileMoving,!0),this._cullRequestsWhileMoving=!1,this.cullRequestsWhileMovingMultiplier=(0,m.Z)(e.cullRequestsWhileMovingMultiplier,60),this.progressiveResolutionHeightFraction=eB.Z.clamp((0,m.Z)(e.progressiveResolutionHeightFraction,.3),0,.5),this.preferLeaves=(0,m.Z)(e.preferLeaves,!1),this._tilesLoaded=!1,this._initialTilesLoaded=!1,this._tileDebugLabels=void 0,this._classificationType=e.classificationType,this._ellipsoid=(0,m.Z)(e.ellipsoid,el.Z.WGS84),this._initialClippingPlanesOriginMatrix=er.Z.IDENTITY,this._clippingPlanesOriginMatrix=void 0,this._clippingPlanesOriginMatrixDirty=!0,this._vectorClassificationOnly=(0,m.Z)(e.vectorClassificationOnly,!1),this._vectorKeepDecodedPositions=(0,m.Z)(e.vectorKeepDecodedPositions,!1),this.preloadWhenHidden=(0,m.Z)(e.preloadWhenHidden,!1),this.preloadFlightDestinations=(0,m.Z)(e.preloadFlightDestinations,!0),this._pass=void 0,this.dynamicScreenSpaceError=(0,m.Z)(e.dynamicScreenSpaceError,!0),this.foveatedScreenSpaceError=(0,m.Z)(e.foveatedScreenSpaceError,!0),this._foveatedConeSize=(0,m.Z)(e.foveatedConeSize,.1),this._foveatedMinimumScreenSpaceErrorRelaxation=(0,m.Z)(e.foveatedMinimumScreenSpaceErrorRelaxation,0),this.foveatedInterpolationCallback=(0,m.Z)(e.foveatedInterpolationCallback,eB.Z.lerp),this.foveatedTimeDelay=(0,m.Z)(e.foveatedTimeDelay,.2),this.dynamicScreenSpaceErrorDensity=(0,m.Z)(e.dynamicScreenSpaceErrorDensity,2e-4),this.dynamicScreenSpaceErrorFactor=(0,m.Z)(e.dynamicScreenSpaceErrorFactor,24),this.dynamicScreenSpaceErrorHeightFalloff=(0,m.Z)(e.dynamicScreenSpaceErrorHeightFalloff,.25),this._dynamicScreenSpaceErrorComputedDensity=0,this.shadows=(0,m.Z)(e.shadows,nZ.Z.ENABLED),this.show=(0,m.Z)(e.show,!0),this.colorBlendMode=yN.HIGHLIGHT,this.colorBlendAmount=.5,this._pointCloudShading=new pL(e.pointCloudShading),this._pointCloudEyeDomeLighting=new pP,this.loadProgress=new et.Z,this.allTilesLoaded=new et.Z,this.initialTilesLoaded=new et.Z,this.tileLoad=new et.Z,this.tileUnload=new et.Z,this.tileFailed=new et.Z,this.tileVisible=new et.Z,this.skipLevelOfDetail=(0,m.Z)(e.skipLevelOfDetail,!1),this._disableSkipLevelOfDetail=!1,this.baseScreenSpaceError=(0,m.Z)(e.baseScreenSpaceError,1024),this.skipScreenSpaceErrorFactor=(0,m.Z)(e.skipScreenSpaceErrorFactor,16),this.skipLevels=(0,m.Z)(e.skipLevels,1),this.immediatelyLoadDesiredLevelOfDetail=(0,m.Z)(e.immediatelyLoadDesiredLevelOfDetail,!1),this.loadSiblings=(0,m.Z)(e.loadSiblings,!1),this._clippingPlanes=void 0,(0,_.Z)(e.clippingPlanes)&&uI.Z.setOwner(e.clippingPlanes,this,"_clippingPlanes"),this._clippingPolygons=void 0,(0,_.Z)(e.clippingPolygons)&&uO.Z.setOwner(e.clippingPolygons,this,"_clippingPolygons"),(0,_.Z)(e.imageBasedLighting)?(this._imageBasedLighting=e.imageBasedLighting,this._shouldDestroyImageBasedLighting=!1):(this._imageBasedLighting=new pA,this._shouldDestroyImageBasedLighting=!0),this.lightColor=e.lightColor,this.backFaceCulling=(0,m.Z)(e.backFaceCulling,!0),this._enableShowOutline=(0,m.Z)(e.enableShowOutline,!0),this.showOutline=(0,m.Z)(e.showOutline,!0),this.outlineColor=(0,m.Z)(e.outlineColor,C.Z.BLACK),this.splitDirection=(0,m.Z)(e.splitDirection,pM.Z.NONE),this.enableCollision=(0,m.Z)(e.enableCollision,!1),this._projectTo2D=(0,m.Z)(e.projectTo2D,!1),this._enablePick=(0,m.Z)(e.enablePick,!1),this.debugFreezeFrame=(0,m.Z)(e.debugFreezeFrame,!1),this.debugColorizeTiles=(0,m.Z)(e.debugColorizeTiles,!1),this._enableDebugWireframe=(0,m.Z)(e.enableDebugWireframe,!1),this.debugWireframe=(0,m.Z)(e.debugWireframe,!1),!0===this.debugWireframe&&!1===this._enableDebugWireframe&&(0,nP.Z)("tileset-debug-wireframe-ignored","enableDebugWireframe must be set to true in the Cesium3DTileset constructor, otherwise debugWireframe will be ignored."),this.debugShowBoundingVolume=(0,m.Z)(e.debugShowBoundingVolume,!1),this.debugShowContentBoundingVolume=(0,m.Z)(e.debugShowContentBoundingVolume,!1),this.debugShowViewerRequestVolume=(0,m.Z)(e.debugShowViewerRequestVolume,!1),this._tileDebugLabels=void 0,this.debugPickedTileLabelOnly=!1,this.debugPickedTile=void 0,this.debugPickPosition=void 0,this.debugShowGeometricError=(0,m.Z)(e.debugShowGeometricError,!1),this.debugShowRenderingStatistics=(0,m.Z)(e.debugShowRenderingStatistics,!1),this.debugShowMemoryUsage=(0,m.Z)(e.debugShowMemoryUsage,!1),this.debugShowUrl=(0,m.Z)(e.debugShowUrl,!1),this.examineVectorLinesFunction=void 0,this._metadataExtension=void 0,this._customShader=e.customShader;let i=(0,m.Z)(e.featureIdLabel,"featureId_0");"number"==typeof i&&(i=`featureId_${i}`),this._featureIdLabel=i;let n=(0,m.Z)(e.instanceFeatureIdLabel,"instanceFeatureId_0");"number"==typeof n&&(n=`instanceFeatureId_${n}`),this._instanceFeatureIdLabel=n}function EQ(e,t,i,n){if(!((0,_.Z)(i.implicitTiling)||hC(i,"3DTILES_implicit_tiling")))return new T5(e,t,i,n);let r=new EO(t,i,e.schema),o=new EM({subdivisionScheme:r.subdivisionScheme,subtreeLevels:r.subtreeLevels,level:0,x:0,y:0,z:0}),a=r.subtreeUriTemplate.getDerivedResource({templateValues:o.getTemplateValues()}).url,s=(0,uz.Z)(i,!0);s.contents=[{uri:a}],delete s.content,delete s.extensions;let l=new T5(e,t,s,n);return l.implicitTileset=r,l.implicitCoordinates=o,l}async function EJ(e,t){let i;let n=hC(t,"3DTILES_metadata")?t.extensions["3DTILES_metadata"]:t;if((0,_.Z)(n.schemaUri))e=e.getDerivedResource({url:n.schemaUri}),i=fT.getSchemaLoader({resource:e});else{if(!(0,_.Z)(n.schema))return;i=fT.getSchemaLoader({schema:n.schema})}await i.load();let r=new Eg({schema:i.schema,metadataJson:n});return fT.unload(i),r}EW.selectTiles=function(e,t){if(e._requestedTiles.length=0,e.debugFreezeFrame)return;e._selectedTiles.length=0,e._selectedTilesToStyle.length=0,e._emptyTiles.length=0,e.hasMixedContent=!1;let i=e.root;if(EB.updateTile(i,t),!i.isVisible||i.getScreenSpaceError(t,!0)<=e.memoryAdjustedScreenSpaceError)return;(function(e,t){let{tileset:i}=e,n=i.immediatelyLoadDesiredLevelOfDetail?Number.MAX_VALUE:Math.max(i.baseScreenSpaceError,i.memoryAdjustedScreenSpaceError),{canTraverse:r,loadTile:o,visitTile:a,touchTile:s}=EB,l=Eq.stack;for(l.push(e);l.length>0;){Eq.stackMaximumLength=Math.max(Eq.stackMaximumLength,l.length);let e=l.pop();!function(e,t){e._ancestorWithContent=void 0,e._ancestorWithContentAvailable=void 0;let{parent:i}=e;if(!(0,_.Z)(i))return;let n=!i.hasUnloadedRenderableContent||i._requestedFrame===t.frameNumber;e._ancestorWithContent=n?i:i._ancestorWithContent,e._ancestorWithContentAvailable=i.contentAvailable?i:i._ancestorWithContentAvailable}(e,t);let c=e.parent,u=!(0,_.Z)(c)||c._refines;e._refines=!!r(e)&&function(e,t,i){let{tileset:n,children:r}=e,{updateTile:o,loadTile:a,touchTile:s}=EB;for(let e=0;e<r.length;++e)o(r[e],i);r.sort(EB.sortChildrenByDistanceToCamera);let l=!1;for(let e=0;e<r.length;++e){let o=r[e];o.isVisible?(t.push(o),l=!0):n.loadSiblings&&(a(o,i),s(o,i))}return l}(e,l,t)&&u;let h=!e._refines&&u;e.hasRenderableContent?e.refine===gI.ADD?(E$(e,t),o(e,t)):e.refine===gI.REPLACE&&(function(e,t){let{tileset:i}=e;return!i.immediatelyLoadDesiredLevelOfDetail&&(!(0,_.Z)(e._ancestorWithContent)||(0===e._screenSpaceError?e.parent._screenSpaceError>t:e._screenSpaceError>t))}(e,n)?(o(e,t),h&&E$(e,t)):h?(E$(e,t),o(e,t)):function(e,t){let i=t._ancestorWithContent;return!e.immediatelyLoadDesiredLevelOfDetail&&(t._priorityProgressiveResolutionScreenSpaceErrorLeaf||(0,_.Z)(i)&&t._screenSpaceError<i._screenSpaceError/e.skipScreenSpaceErrorFactor&&t._depth>i._depth+e.skipLevels)}(i,e)&&o(e,t)):(i._emptyTiles.push(e),o(e,t),h&&E$(e,t)),a(e,t),s(e,t)}})(i,t),function(e,t){let i;let{selectTile:n,canTraverse:r}=EB,{stack:o,ancestorStack:a}=EX;for(o.push(e);o.length>0||a.length>0;){if(EX.stackMaximumLength=Math.max(EX.stackMaximumLength,o.length),EX.ancestorStackMaximumLength=Math.max(EX.ancestorStackMaximumLength,a.length),a.length>0){let e=a.peek();if(e._stackLength===o.length){a.pop(),e!==i&&(e._finalResolution=!1),n(e,t);continue}}let e=o.pop();if(!(0,_.Z)(e))continue;let s=r(e);if(e._shouldSelect){if(e.refine===gI.ADD)n(e,t);else{if(e._selectionDepth=a.length,e._selectionDepth>0&&(e.tileset.hasMixedContent=!0),i=e,!s){n(e,t);continue}a.push(e),e._stackLength=o.length}}if(s){let t=e.children;for(let e=0;e<t.length;++e){let i=t[e];i.isVisible&&o.push(i)}}}}(i,t),Eq.stack.trim(Eq.stackMaximumLength),EY.stack.trim(EY.stackMaximumLength),EX.stack.trim(EX.stackMaximumLength),EX.ancestorStack.trim(EX.ancestorStackMaximumLength);let n=e._requestedTiles;for(let e=0;e<n.length;++e)n[e].updatePriority()},Object.defineProperties(EK.prototype,{isCesium3DTileset:{get:function(){return!0}},asset:{get:function(){return this._asset}},extensions:{get:function(){return this._extensions}},clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){uI.Z.setOwner(e,this,"_clippingPlanes")}},clippingPolygons:{get:function(){return this._clippingPolygons},set:function(e){uO.Z.setOwner(e,this,"_clippingPolygons")}},properties:{get:function(){return this._properties}},tilesLoaded:{get:function(){return this._tilesLoaded}},resource:{get:function(){return this._resource}},basePath:{get:function(){return(0,hj.Z)("Cesium3DTileset.basePath","Cesium3DTileset.basePath has been deprecated. All tiles are relative to the url of the tileset JSON file that contains them. Use the url property instead."),this._basePath}},style:{get:function(){return this._styleEngine.style},set:function(e){this._styleEngine.style=e}},customShader:{get:function(){return this._customShader},set:function(e){this._customShader=e}},hasMixedContent:{get:function(){return this._hasMixedContent},set:function(e){p.Z.typeOf.bool("value",e),this._hasMixedContent=e}},isSkippingLevelOfDetail:{get:function(){return this.skipLevelOfDetail&&!(0,_.Z)(this._classificationType)&&!this._disableSkipLevelOfDetail&&!this._allTilesAdditive}},metadataExtension:{get:function(){return this._metadataExtension}},metadata:{get:function(){if((0,_.Z)(this._metadataExtension))return this._metadataExtension.tileset}},schema:{get:function(){if((0,_.Z)(this._metadataExtension))return this._metadataExtension.schema}},maximumScreenSpaceError:{get:function(){return this._maximumScreenSpaceError},set:function(e){p.Z.typeOf.number.greaterThanOrEquals("maximumScreenSpaceError",e,0),this._maximumScreenSpaceError=e,this._memoryAdjustedScreenSpaceError=e}},cacheBytes:{get:function(){return this._cacheBytes},set:function(e){p.Z.typeOf.number.greaterThanOrEquals("value",e,0),this._cacheBytes=e}},maximumCacheOverflowBytes:{get:function(){return this._maximumCacheOverflowBytes},set:function(e){p.Z.typeOf.number.greaterThanOrEquals("value",e,0),this._maximumCacheOverflowBytes=e}},memoryAdjustedScreenSpaceError:{get:function(){return this._memoryAdjustedScreenSpaceError}},pointCloudShading:{get:function(){return this._pointCloudShading},set:function(e){p.Z.defined("pointCloudShading",e),this._pointCloudShading=e}},root:{get:function(){return this._root}},boundingSphere:{get:function(){return this._root.updateTransform(this._modelMatrix),this._root.boundingSphere}},modelMatrix:{get:function(){return this._modelMatrix},set:function(e){this._modelMatrix=er.Z.clone(e,this._modelMatrix)}},timeSinceLoad:{get:function(){return this._timeSinceLoad}},totalMemoryUsageInBytes:{get:function(){let e=this._statistics;return e.texturesByteLength+e.geometryByteLength+e.batchTableByteLength}},clippingPlanesOriginMatrix:{get:function(){return(0,_.Z)(this._clippingPlanesOriginMatrix)?(this._clippingPlanesOriginMatrixDirty&&(er.Z.multiply(this.root.computedTransform,this._initialClippingPlanesOriginMatrix,this._clippingPlanesOriginMatrix),this._clippingPlanesOriginMatrixDirty=!1),this._clippingPlanesOriginMatrix):er.Z.IDENTITY}},styleEngine:{get:function(){return this._styleEngine}},statistics:{get:function(){return this._statistics}},classificationType:{get:function(){return this._classificationType}},ellipsoid:{get:function(){return this._ellipsoid}},foveatedConeSize:{get:function(){return this._foveatedConeSize},set:function(e){p.Z.typeOf.number.greaterThanOrEquals("foveatedConeSize",e,0),p.Z.typeOf.number.lessThanOrEquals("foveatedConeSize",e,1),this._foveatedConeSize=e}},foveatedMinimumScreenSpaceErrorRelaxation:{get:function(){return this._foveatedMinimumScreenSpaceErrorRelaxation},set:function(e){p.Z.typeOf.number.greaterThanOrEquals("foveatedMinimumScreenSpaceErrorRelaxation",e,0),p.Z.typeOf.number.lessThanOrEquals("foveatedMinimumScreenSpaceErrorRelaxation",e,this.maximumScreenSpaceError),this._foveatedMinimumScreenSpaceErrorRelaxation=e}},extras:{get:function(){return this._extras}},imageBasedLighting:{get:function(){return this._imageBasedLighting},set:function(e){p.Z.typeOf.object("imageBasedLighting",this._imageBasedLighting),e!==this._imageBasedLighting&&(this._shouldDestroyImageBasedLighting&&!this._imageBasedLighting.isDestroyed()&&this._imageBasedLighting.destroy(),this._imageBasedLighting=e,this._shouldDestroyImageBasedLighting=!1)}},vectorClassificationOnly:{get:function(){return this._vectorClassificationOnly}},vectorKeepDecodedPositions:{get:function(){return this._vectorKeepDecodedPositions}},showCreditsOnScreen:{get:function(){return this._showCreditsOnScreen},set:function(e){this._showCreditsOnScreen=e,xc(this)}},featureIdLabel:{get:function(){return this._featureIdLabel},set:function(e){"number"==typeof e&&(e=`featureId_${e}`),p.Z.typeOf.string("value",e),this._featureIdLabel=e}},instanceFeatureIdLabel:{get:function(){return this._instanceFeatureIdLabel},set:function(e){"number"==typeof e&&(e=`instanceFeatureId_${e}`),p.Z.typeOf.string("value",e),this._instanceFeatureIdLabel=e}}}),EK.fromIonAssetId=async function(e,t){p.Z.defined("assetId",e);let i=await yE.Z.fromAssetId(e);return EK.fromUrl(i,t)},EK.fromUrl=async function(e,t){let i;p.Z.defined("url",e),t=(0,m.Z)(t,m.Z.EMPTY_OBJECT);let n=ec.Z.createIfNeeded(e);"json"===n.extension?i=n.getBaseUri(!0):n.isDataUri&&(i="");let r=await EK.loadJson(n),o=await EJ(n,r),a=new EK(t);a._resource=n,a._url=n.url,a._basePath=i,a._metadataExtension=o,a._geometricError=r.geometricError,a._scaledGeometricError=r.geometricError;let s=r.asset;a._asset=s,a._extras=r.extras,xc(a);let l=(0,_.Z)(r.asset.gltfUpAxis)?dV.Z.fromName(r.asset.gltfUpAxis):dV.Z.Y,c=(0,m.Z)(t.modelUpAxis,l),u=(0,m.Z)(t.modelForwardAxis,dV.Z.X);a._properties=r.properties,a._extensionsUsed=r.extensionsUsed,a._extensions=r.extensions,a._modelUpAxis=c,a._modelForwardAxis=u,a._root=a.loadTileset(n,r);let h=a._root.createBoundingVolume(r.root.boundingVolume,er.Z.IDENTITY).boundingSphere.center,f=a._ellipsoid.cartesianToCartographic(h);return(0,_.Z)(f)&&f.height>d.Z._defaultMinTerrainHeight&&(a._initialClippingPlanesOriginMatrix=n9.Z.eastNorthUpToFixedFrame(h)),a._clippingPlanesOriginMatrix=er.Z.clone(a._initialClippingPlanesOriginMatrix),a},EK.loadJson=function(e){return ec.Z.createIfNeeded(e).fetchJson()},EK.prototype.makeStyleDirty=function(){this._styleEngine.makeDirty()},EK.prototype.loadTileset=function(e,t,i){let n=t.asset;if(!(0,_.Z)(n))throw new e3.Z("Tileset must have an asset property.");if("0.0"!==n.version&&"1.0"!==n.version&&"1.1"!==n.version)throw new e3.Z("The tileset must be 3D Tiles version 0.0, 1.0, or 1.1");(0,_.Z)(t.extensionsRequired)&&EK.checkSupportedExtensions(t.extensionsRequired);let r=this._statistics,o=n.tilesetVersion;(0,_.Z)(o)&&(this._basePath+=`?v=${o}`,(e=e.clone()).setQueryParameters({v:o}));let a=EQ(this,e,t.root,i);(0,_.Z)(i)&&(i.children.push(a),a._depth=i._depth+1);let s=[];for(s.push(a);s.length>0;){let t=s.pop();++r.numberOfTilesTotal,this._allTilesAdditive=this._allTilesAdditive&&t.refine===gI.ADD;let i=t._header.children;if((0,_.Z)(i))for(let n=0;n<i.length;++n){let r=EQ(this,e,i[n],t);t.children.push(r),r._depth=t._depth+1,s.push(r)}this._cullWithChildrenBounds&&EZ.checkChildrenWithinParent(t)}return a};let E0=new S.Z,E1=new ea.Z,E2=new er.Z,E3=new S.Z,E4=new S.Z,E5=new S.Z,E9=new S.Z;function E8(e,t){return e._priority-t._priority}function E6(e,t,i){let n;if(t.isDestroyed())return;i.isDestroyed()||(n=i._contentResource.url);let r=(0,_.Z)(e.message)?e.message:e.toString();t.tileFailed.numberOfListeners>0?t.tileFailed.raiseEvent({url:n,message:r}):(console.log(`A 3D tile failed to load: ${n}`),console.log(`Error: ${r}`))}EK.prototype.postPassesUpdate=function(e){(0,_.Z)(this._root)&&(function(e,t){let i=e._requestedTilesInFlight,n=0;for(let e=0;e<i.length;++e){let r=i[e],o=t.frameNumber-r._touchedFrame>=1;if(r._contentState!==v5.LOADING){++n;continue}if(o){r.cancelRequests(),++n;continue}n>0&&(i[e-n]=r)}i.length-=n}(this,e),function(e,t){let i=e._statistics,n=e._statisticsLast,r=i.numberOfPendingRequests,o=i.numberOfTilesProcessing,a=n.numberOfPendingRequests,s=n.numberOfTilesProcessing;EC.clone(i,n);let l=r!==a||o!==s;l&&t.afterRender.push(function(){return e.loadProgress.raiseEvent(r,o),!0}),e._tilesLoaded=0===i.numberOfPendingRequests&&0===i.numberOfTilesProcessing&&0===i.numberOfAttemptedRequests,l&&e._tilesLoaded&&(t.afterRender.push(function(){return e.allTilesLoaded.raiseEvent(),!0}),e._initialTilesLoaded||(e._initialTilesLoaded=!0,t.afterRender.push(function(){return e.initialTilesLoaded.raiseEvent(),!0})))}(this,e),this._cache.unloadTiles(this,xl),this._styleApplied&&this._styleEngine.resetDirty(),this._styleApplied=!1)},EK.prototype.prePassesUpdate=function(e){if(!(0,_.Z)(this._root))return;(function(e,t){!function(e){let t=e._processingQueue,i=0;for(let e=0;e<t.length;++e){let n=t[e];if(n.isDestroyed()||n._contentState!==v5.PROCESSING){++i;continue}i>0&&(t[e-i]=n)}t.length-=i}(e);let i=e._processingQueue,{cacheBytes:n,maximumCacheOverflowBytes:r,statistics:o}=e,a=n+r,s=!1;for(let n=0;n<i.length;++n){if(e.totalMemoryUsageInBytes>a){s=!0;break}let r=i[n];try{r.process(e,t),r.contentReady&&(--o.numberOfTilesProcessing,e.tileLoad.raiseEvent(r))}catch(t){--o.numberOfTilesProcessing,E6(t,e,r)}}e.totalMemoryUsageInBytes<n?e._memoryAdjustedScreenSpaceError=Math.max(e.memoryAdjustedScreenSpaceError/1.02,e.maximumScreenSpaceError):s&&i.length>0&&function(e){(0,nP.Z)("increase-screenSpaceError",`The tiles needed to meet maximumScreenSpaceError would use more memory than allocated for this tileset. The tileset will be rendered with a larger screen space error (see memoryAdjustedScreenSpaceError). Consider using larger values for cacheBytes and maximumCacheOverflowBytes.`),e._memoryAdjustedScreenSpaceError*=1.02;let t=e._processingQueue;for(let e=0;e<t.length;++e)t[e].updatePriority();t.sort(E8)}(e)})(this,e);let t=this._clippingPlanes;this._clippingPlanesOriginMatrixDirty=!0,(0,_.Z)(t)&&t.enabled&&t.update(e);let i=this._clippingPolygons;(0,_.Z)(i)&&i.enabled&&i.update(e),(0,_.Z)(this._loadTimestamp)||(this._loadTimestamp=nt.Z.clone(e.time)),this._timeSinceLoad=Math.max(1e3*nt.Z.secondsDifference(e.time,this._loadTimestamp),0),this.dynamicScreenSpaceError&&function(e,t){let i,n,r,o,a;let s=t.camera,l=e._root,c=l.contentBoundingVolume;if(c instanceof Tf.Z)i=S.Z.normalize(s.positionWC,E0),n=s.directionWC,r=s.positionCartographic.height,o=c.minimumHeight,a=c.maximumHeight;else{let e=er.Z.inverseTransformation(l.computedTransform,E2),u=t.mapProjection.ellipsoid,h=c.boundingVolume,d=er.Z.multiplyByPoint(e,h.center,E3);if(S.Z.magnitude(d)>u.minimumRadius){let e=ea.Z.fromCartesian(d,u,E1);i=S.Z.normalize(s.positionWC,E0),n=s.directionWC,r=s.positionCartographic.height,o=0,a=2*e.height}else{let t=er.Z.multiplyByPoint(e,s.positionWC,E4);if(i=S.Z.UNIT_Z,n=er.Z.multiplyByPointAsVector(e,s.directionWC,E5),n=S.Z.normalize(n,n),r=t.z,c instanceof T4){let e=n2.Z.getColumn(h.halfAxes,2,E9),t=S.Z.magnitude(e);o=d.z-t,a=d.z+t}else if(c instanceof T$){let e=h.radius;o=d.z-e,a=d.z+e}}}let u=o+(a-o)*e.dynamicScreenSpaceErrorHeightFalloff,h=a,d=eB.Z.clamp((r-u)/(h-u),0,1),f=1-Math.abs(S.Z.dot(n,i));f*=1-d,e._dynamicScreenSpaceErrorComputedDensity=e.dynamicScreenSpaceErrorDensity*f}(this,e),e.newFrame&&this._cache.reset()};let E7=new ea.Z,xe=new ea.Z,xt=new S.Z,xi=new S.Z,xn={maximumFractionDigits:3};function xr(e){let t=e/1048576;return t<1?t.toLocaleString(void 0,xn):Math.round(t).toLocaleString()}function xo(e){let{halfAxes:t,radius:i,center:n}=e.boundingVolume.boundingVolume,r=S.Z.clone(n,xi);if((0,_.Z)(t))r.x+=.75*(t[0]+t[3]+t[6]),r.y+=.75*(t[1]+t[4]+t[7]),r.z+=.75*(t[2]+t[5]+t[8]);else if((0,_.Z)(i)){let e=S.Z.normalize(n,xi);e=S.Z.multiplyByScalar(e,.75*i,xi),r=S.Z.add(e,n,xi)}return r}function xa(e,t,i){let n="",r=0;if(t.debugShowGeometricError&&(n+=` Geometric error: ${e.geometricError}`,r++),t.debugShowRenderingStatistics&&(n+=` Commands: ${e.commandsLength}`,r++,e.content.pointsLength>0&&(n+=` Points: ${e.content.pointsLength}`,r++),e.content.trianglesLength>0&&(n+=` Triangles: ${e.content.trianglesLength}`,r++),n+=` Features: ${e.content.featuresLength}`,r++),t.debugShowMemoryUsage&&(n+=` Texture Memory: ${xr(e.content.texturesByteLength)} Geometry Memory: ${xr(e.content.geometryByteLength)}`,r+=2),t.debugShowUrl){if(e.hasMultipleContents){n+="\nUrls:";let t=e.content.innerContentUrls;for(let e=0;e<t.length;e++)n+=` - ${t[e]}`;r+=t.length}else n+=` Url: ${e._contentHeader.uri}`,r++}let o={text:n.substring(1),position:i,font:`${19-r}px sans-serif`,showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY};return t._tileDebugLabels.add(o)}let xs=[];function xl(e,t){e.tileUnload.raiseEvent(t),e._statistics.decrementLoadCounts(t.content),--e._statistics.numberOfTilesWithContentReady,t.unloadContent()}function xc(e){let t=e._credits;(0,_.Z)(t)||(t=[]),t.length=0,(0,_.Z)(e.resource.credits)&&e.resource.credits.forEach(e=>{t.push(uA.Z.clone(e))});let i=e.asset.extras;if((0,_.Z)(i)&&(0,_.Z)(i.cesium)&&(0,_.Z)(i.cesium.credits)){let e=i.cesium.credits;for(let i=0;i<e.length;++i){let n=e[i];t.push(new uA.Z(n.html))}}t.forEach(t=>t.showOnScreen=t.showOnScreen||e._showCreditsOnScreen),e._credits=t}EK.prototype.trimLoadedTiles=function(){this._cache.trim()},EK.prototype.getTraversal=function(e){let{pass:t}=e;return t===v7.Z.MOST_DETAILED_PRELOAD||t===v7.Z.MOST_DETAILED_PICK?EU:this.isSkippingLevelOfDetail?EW:EV},EK.prototype.update=function(e){this.updateForPass(e,e.tilesetPassState)},EK.prototype.updateForPass=function(e,t){p.Z.typeOf.object("frameState",e),p.Z.typeOf.object("tilesetPassState",t);let i=t.pass;if(i===v7.Z.PRELOAD&&(!this.preloadWhenHidden||this.show)||i===v7.Z.PRELOAD_FLIGHT&&(!this.preloadFlightDestinations||!this.show&&!this.preloadWhenHidden)||i===v7.Z.REQUEST_RENDER_MODE_DEFER_CHECK&&(!this._cullRequestsWhileMoving&&this.foveatedTimeDelay<=0||!this.show))return;let n=e.commandList,r=e.camera,o=e.cullingVolume;t.ready=!1;let a=v7.Z.getPassOptions(i),s=a.ignoreCommands,l=(0,m.Z)(t.commandList,n),c=l.length;e.commandList=l,e.camera=(0,m.Z)(t.camera,r),e.cullingVolume=(0,m.Z)(t.cullingVolume,o);let u=this._clippingPolygons;(0,_.Z)(u)&&u.enabled&&u.queueCommands(e);let h=this._statisticsPerPass[i];(this.show||s)&&(this._pass=i,t.ready=function(e,t,i,n){if(t.mode===eu.Z.MORPHING||!(0,_.Z)(e._root))return!1;let r=e._statistics;r.clear(),++e._updatedVisibilityFrame,e._heatmap.resetMinimumMaximum(),e._minimumPriority.depth=Number.MAX_VALUE,e._maximumPriority.depth=-Number.MAX_VALUE,e._minimumPriority.foveatedFactor=Number.MAX_VALUE,e._maximumPriority.foveatedFactor=-Number.MAX_VALUE,e._minimumPriority.distance=Number.MAX_VALUE,e._maximumPriority.distance=-Number.MAX_VALUE,e._minimumPriority.reverseScreenSpaceError=Number.MAX_VALUE,e._maximumPriority.reverseScreenSpaceError=-Number.MAX_VALUE,!(t.frameNumber===e._updatedModelMatrixFrame&&(0,_.Z)(e._previousModelMatrix))&&(e._updatedModelMatrixFrame=t.frameNumber,e._modelMatrixChanged=!er.Z.equals(e.modelMatrix,e._previousModelMatrix),e._modelMatrixChanged&&(e._previousModelMatrix=er.Z.clone(e.modelMatrix,e._previousModelMatrix))),e._cullRequestsWhileMoving=e.cullRequestsWhileMoving&&!e._modelMatrixChanged;let o=e.getTraversal(n).selectTiles(e,t);if(n.requestTiles&&function(e){let t=e._requestedTiles;t.sort(E8);for(let i=0;i<t.length;++i)!function(e,t){if(t.hasEmptyContent)return;let{statistics:i}=e,n=t.contentExpired,r=t.requestContent();(0,_.Z)(r)&&(r.then(n=>{!(!(0,_.Z)(n)||t.isDestroyed()||e.isDestroyed())&&(e._processingQueue.push(t),++i.numberOfTilesProcessing)}).catch(i=>{E6(i,e,t)}),n&&(t.hasTilesetContent||t.hasImplicitContent?function(e,t){let i=t;for(xs.push(t);xs.length>0;){var n;let r=(t=xs.pop()).children;for(let e=0;e<r.length;++e)xs.push(r[e]);t!==i&&(n=t,e._cache.unloadTile(e,n,xl),n.destroy(),--e._statistics.numberOfTilesTotal)}i.children=[]}(e,t):(i.decrementLoadCounts(t.content),--i.numberOfTilesWithContentReady)),e._requestedTilesInFlight.push(t))}(e,t[i])}(e),function(e,t,i){e._styleEngine.applyStyle(e),e._styleApplied=!0;let{commandList:n,context:r}=t,o=n.length,a=e._selectedTiles,s=e.isSkippingLevelOfDetail&&e._hasMixedContent&&r.stencilBuffer&&a.length>0;e._backfaceCommands.length=0,s&&((0,_.Z)(e._stencilClearCommand)||(e._stencilClearCommand=new pI.Z({stencil:0,pass:ej.Z.CESIUM_3D_TILE,renderState:eW.Z.fromCache({stencilMask:pD.Z.SKIP_LOD_MASK})})),n.push(e._stencilClearCommand));let{statistics:l,tileVisible:c}=e,u=i.isRender,h=n.length;for(let n=0;n<a.length;++n){let r=a[n];u&&c.raiseEvent(r),function(e,t,i){if(!e.enableCollision||!e.show)return;let n=e._addHeightCallbacks,r=t.boundingSphere;for(let e of n){if(e.invoked||t._wasSelectedLastFrame)continue;let n=e.ellipsoid,o=ea.Z.clone(e.positionCartographic,E7),a=ea.Z.fromCartesian(r.center,n,xe);(0,_.Z)(a)&&(o.height=a.height);let s=ea.Z.toCartesian(o,n,xt);S.Z.distance(s,r.center)<=r.radius&&i.afterRender.push(()=>{(0,_.Z)(e.callback)&&e.callback(o),e.invoked=!1})}}(e,r,t),r.update(e,t,i),l.incrementSelectionCounts(r.content),++l.selected}let d=e._emptyTiles;for(let n=0;n<d.length;++n)d[n].update(e,t,i);let f=n.length-h;if(e._backfaceCommands.trim(),s){let t=e._backfaceCommands.values,i=t.length;n.length+=i;for(let e=f-1;e>=0;--e)n[h+i+e]=n[h+e];for(let e=0;e<i;++e)n[h+e]=t[e]}f=n.length-o,l.numberOfCommands=f,u&&(e.pointCloudShading.attenuation&&e.pointCloudShading.eyeDomeLighting&&f>0&&e._pointCloudEyeDomeLighting.update(t,o,e.pointCloudShading,e.boundingSphere),e.debugShowGeometricError||e.debugShowRenderingStatistics||e.debugShowMemoryUsage||e.debugShowUrl?((0,_.Z)(e._tileDebugLabels)||(e._tileDebugLabels=new ia),function(e,t){let i=e._selectedTiles,n=i.length,r=e._emptyTiles,o=r.length;if(e._tileDebugLabels.removeAll(),e.debugPickedTileLabelOnly){if((0,_.Z)(e.debugPickedTile)){let t=(0,_.Z)(e.debugPickPosition)?e.debugPickPosition:xo(e.debugPickedTile);xa(e.debugPickedTile,e,t).pixelOffset=new w.Z(15,-15)}}else{for(let t=0;t<n;++t){let n=i[t];xa(n,e,xo(n))}for(let t=0;t<o;++t){let i=r[t];(i.hasTilesetContent||i.hasImplicitContent)&&xa(i,e,xo(i))}}e._tileDebugLabels.update(t)}(e,t)):e._tileDebugLabels=e._tileDebugLabels&&e._tileDebugLabels.destroy())}(e,t,n),EC.clone(r,i),n.isRender){let i=e._credits;if((0,_.Z)(i)&&0!==r.selected)for(let e=0;e<i.length;++e){let n=i[e];t.creditDisplay.addCreditToNextFrame(n)}}return o}(this,e,h,a)),s&&(l.length=c),e.commandList=n,e.camera=r,e.cullingVolume=o},EK.prototype.hasExtension=function(e){return!!(0,_.Z)(this._extensionsUsed)&&this._extensionsUsed.indexOf(e)>-1},EK.prototype.isDestroyed=function(){return!1},EK.prototype.destroy=function(){if(this._tileDebugLabels=this._tileDebugLabels&&this._tileDebugLabels.destroy(),this._clippingPlanes=this._clippingPlanes&&this._clippingPlanes.destroy(),this._clippingPolygons=this._clippingPolygons&&this._clippingPolygons.destroy(),(0,_.Z)(this._root))for(xs.push(this._root);xs.length>0;){let e=xs.pop();e.destroy();let t=e.children;for(let e=0;e<t.length;++e)xs.push(t[e])}return this._root=void 0,this._shouldDestroyImageBasedLighting&&!this._imageBasedLighting.isDestroyed()&&this._imageBasedLighting.destroy(),this._imageBasedLighting=void 0,(0,g.Z)(this)},EK.supportedExtensions={"3DTILES_metadata":!0,"3DTILES_implicit_tiling":!0,"3DTILES_content_gltf":!0,"3DTILES_multiple_contents":!0,"3DTILES_bounding_volume_S2":!0,"3DTILES_batch_table_hierarchy":!0,"3DTILES_draco_point_compression":!0,MAXAR_content_geojson:!0},EK.checkSupportedExtensions=function(e){for(let t=0;t<e.length;t++)if(!EK.supportedExtensions[e[t]])throw new e3.Z(`Unsupported 3D Tiles Extension: ${e[t]}`)};let xu=new Zk.Z,xh=new S.Z,xd=new ea.Z;EK.prototype.getHeight=function(e,t){p.Z.typeOf.object("cartographic",e),p.Z.typeOf.object("scene",t);let i=t.globe?.ellipsoid;(0,_.Z)(i)||(i=el.Z.WGS84);let n=i.cartographicToCartesian(e,xu.direction);S.Z.normalize(xu.direction,xu.direction),xu.direction=S.Z.normalize(n,xu.direction),xu.direction=S.Z.negate(n,xu.direction),xu.origin=S.Z.multiplyByScalar(xu.direction,-2*i.maximumRadius,xu.origin);let r=this.pick(xu,t.frameState,xh);if((0,_.Z)(r))return i.cartesianToCartographic(r,xd)?.height},EK.prototype.updateHeight=function(e,t,i){let n={positionCartographic:e,ellipsoid:i=(0,m.Z)(i,el.Z.WGS84),callback:t,invoked:!1};return this._addHeightCallbacks.push(n),()=>{let e=this._addHeightCallbacks,t=e.length;for(let i=0;i<t;++i)if(e[i]===n){e.splice(i,1);break}n.callback&&(n.callback=void 0)}};let xf=new yT.Z,xp=new S.Z;EK.prototype.pick=function(e,t,i){if(!t.context.webgl2&&!this._enablePick)return;let n=this._selectedTiles,r=n.length,o=[];for(let t=0;t<r;++t){let i=n[t],r=ZU.Z.raySphere(e,i.contentBoundingVolume.boundingSphere,xf);(0,_.Z)(r)&&(0,_.Z)(i.content)&&o.push(i)}let a=o.length;o.sort((t,i)=>f.Z.distanceSquaredTo(t.contentBoundingVolume.boundingSphere,e.origin)-f.Z.distanceSquaredTo(i.contentBoundingVolume.boundingSphere,e.origin));for(let n=0;n<a;++n){let r=o[n].content.pick(e,t,xp);if((0,_.Z)(r))return S.Z.clone(r,i)}};let xm=new er.Z;function x_(e,t){if(!(0,_.Z)(e))throw new A.Z("scene is required.");if(!(0,_.Z)(t))throw new A.Z("entityCollection is required.");t.collectionChanged.addEventListener(x_.prototype._onCollectionChanged,this),this._scene=e,this._primitives=e.primitives,this._entityCollection=t,this._tilesetHash={},this._entitiesToVisualize=new E.Z,this._onCollectionChanged(t,t.values,[],[])}function xg(e,t,i,n){let r=i[t.id];(0,_.Z)(r)&&((0,_.Z)(r.tilesetPrimitive)&&n.removeAndDestroy(r.tilesetPrimitive),delete i[t.id])}async function xZ(e,t,i,n){t[i.id]={url:e.url,loadFail:!1};try{let r=await EK.fromUrl(e);if(r.id=i,n.add(r),!(0,_.Z)(t[i.id]))return;t[i.id].tilesetPrimitive=r}catch(e){console.error(e),t[i.id].loadFail=!0}}x_.prototype.update=function(e){if(!(0,_.Z)(e))throw new A.Z("time is required.");let t=this._entitiesToVisualize.values,i=this._tilesetHash,n=this._primitives;for(let r=0,o=t.length;r<o;r++){let o,a;let s=t[r],l=s._tileset,c=i[s.id],u=s.isShowing&&s.isAvailable(e)&&L.Z.getValueOrDefault(l._show,e,!0);u&&(a=s.computeModelMatrix(e,xm),o=ec.Z.createIfNeeded(L.Z.getValueOrUndefined(l._uri,e)));let h=(0,_.Z)(c)?c.tilesetPrimitive:void 0;if(!u){(0,_.Z)(h)&&(h.show=!1);continue}(0,_.Z)(c)&&o.url===c.url||((0,_.Z)(h)&&n.removeAndDestroy(h),delete i[s.id],xZ(o,i,s,n)),(0,_.Z)(h)&&(h.show=!0,(0,_.Z)(a)&&(h.modelMatrix=a),h.maximumScreenSpaceError=L.Z.getValueOrDefault(l.maximumScreenSpaceError,e,h.maximumScreenSpaceError))}return!0},x_.prototype.isDestroyed=function(){return!1},x_.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(x_.prototype._onCollectionChanged,this);let e=this._entitiesToVisualize.values,t=this._tilesetHash,i=this._primitives;for(let n=e.length-1;n>-1;n--)xg(this,e[n],t,i);return(0,g.Z)(this)},x_.prototype.getBoundingSphere=function(e,t){if(!(0,_.Z)(e))throw new A.Z("entity is required.");if(!(0,_.Z)(t))throw new A.Z("result is required.");let i=this._tilesetHash[e.id];if(!(0,_.Z)(i)||i.loadFail)return N.FAILED;let n=i.tilesetPrimitive;return(0,_.Z)(n)?n.show?(f.Z.clone(n.boundingSphere,t),N.DONE):N.FAILED:N.PENDING},x_.prototype._onCollectionChanged=function(e,t,i,n){let r,o;let a=this._entitiesToVisualize,s=this._tilesetHash,l=this._primitives;for(r=t.length-1;r>-1;r--)o=t[r],(0,_.Z)(o._tileset)&&a.set(o.id,o);for(r=n.length-1;r>-1;r--)o=n[r],(0,_.Z)(o._tileset)?a.set(o.id,o):(xg(this,o,s,l),a.remove(o.id));for(r=i.length-1;r>-1;r--)xg(this,o=i[r],s,l),a.remove(o.id)};var xy=i(7897),xb=i(8328),xv=i(4462),xT=i(3803);function xE(e,t){return nt.Z.compare(e.start,t.start)}function xx(e){if(this._intervals=[],this._changedEvent=new et.Z,(0,_.Z)(e)){let t=e.length;for(let i=0;i<t;i++)this.addInterval(e[i])}}Object.defineProperties(xx.prototype,{changedEvent:{get:function(){return this._changedEvent}},start:{get:function(){let e=this._intervals;return 0===e.length?void 0:e[0].start}},isStartIncluded:{get:function(){let e=this._intervals;return 0!==e.length&&e[0].isStartIncluded}},stop:{get:function(){let e=this._intervals,t=e.length;return 0===t?void 0:e[t-1].stop}},isStopIncluded:{get:function(){let e=this._intervals,t=e.length;return 0!==t&&e[t-1].isStopIncluded}},length:{get:function(){return this._intervals.length}},isEmpty:{get:function(){return 0===this._intervals.length}}}),xx.prototype.equals=function(e,t){if(this===e)return!0;if(!(e instanceof xx))return!1;let i=this._intervals,n=e._intervals,r=i.length;if(r!==n.length)return!1;for(let e=0;e<r;e++)if(!ni.equals(i[e],n[e],t))return!1;return!0},xx.prototype.get=function(e){if(!(0,_.Z)(e))throw new A.Z("index is required.");return this._intervals[e]},xx.prototype.removeAll=function(){this._intervals.length>0&&(this._intervals.length=0,this._changedEvent.raiseEvent(this))},xx.prototype.findIntervalContainingDate=function(e){let t=this.indexOf(e);return t>=0?this._intervals[t]:void 0},xx.prototype.findDataForIntervalContainingDate=function(e){let t=this.indexOf(e);return t>=0?this._intervals[t].data:void 0},xx.prototype.contains=function(e){return this.indexOf(e)>=0};let xw=new ni;xx.prototype.indexOf=function(e){if(!(0,_.Z)(e))throw new A.Z("date is required");let t=this._intervals;xw.start=e,xw.stop=e;let i=(0,xb.Z)(t,xw,xE);return i>=0?t[i].isStartIncluded?i:i>0&&t[i-1].stop.equals(e)&&t[i-1].isStopIncluded?i-1:~i:(i=~i)>0&&i-1<t.length&&ni.contains(t[i-1],e)?i-1:~i},xx.prototype.findInterval=function(e){let t=(e=(0,m.Z)(e,m.Z.EMPTY_OBJECT)).start,i=e.stop,n=e.isStartIncluded,r=e.isStopIncluded,o=this._intervals;for(let e=0,a=o.length;e<a;e++){let a=o[e];if((!(0,_.Z)(t)||a.start.equals(t))&&(!(0,_.Z)(i)||a.stop.equals(i))&&(!(0,_.Z)(n)||a.isStartIncluded===n)&&(!(0,_.Z)(r)||a.isStopIncluded===r))return o[e]}},xx.prototype.addInterval=function(e,t){let i;if(!(0,_.Z)(e))throw new A.Z("interval is required");if(e.isEmpty)return;let n=this._intervals;if(0===n.length||nt.Z.greaterThan(e.start,n[n.length-1].stop)){n.push(e),this._changedEvent.raiseEvent(this);return}let r=(0,xb.Z)(n,e,xE);for(r<0?r=~r:r>0&&e.isStartIncluded&&n[r-1].isStartIncluded&&n[r-1].start.equals(e.start)?--r:r<n.length&&!e.isStartIncluded&&n[r].isStartIncluded&&n[r].start.equals(e.start)&&++r,r>0&&((i=nt.Z.compare(n[r-1].stop,e.start))>0||0===i&&(n[r-1].isStopIncluded||e.isStartIncluded))&&(((0,_.Z)(t)?t(n[r-1].data,e.data):n[r-1].data===e.data)?(e=new ni(nt.Z.greaterThan(e.stop,n[r-1].stop)?{start:n[r-1].start,stop:e.stop,isStartIncluded:n[r-1].isStartIncluded,isStopIncluded:e.isStopIncluded,data:e.data}:{start:n[r-1].start,stop:n[r-1].stop,isStartIncluded:n[r-1].isStartIncluded,isStopIncluded:n[r-1].isStopIncluded||e.stop.equals(n[r-1].stop)&&e.isStopIncluded,data:e.data}),n.splice(r-1,1),--r):(((i=nt.Z.compare(n[r-1].stop,e.stop))>0||0===i&&n[r-1].isStopIncluded&&!e.isStopIncluded)&&n.splice(r,0,new ni({start:e.stop,stop:n[r-1].stop,isStartIncluded:!e.isStopIncluded,isStopIncluded:n[r-1].isStopIncluded,data:n[r-1].data})),n[r-1]=new ni({start:n[r-1].start,stop:e.start,isStartIncluded:n[r-1].isStartIncluded,isStopIncluded:!e.isStartIncluded,data:n[r-1].data})));r<n.length;)if((i=nt.Z.compare(e.stop,n[r].start))>0||0===i&&(e.isStopIncluded||n[r].isStartIncluded)){if((0,_.Z)(t)?t(n[r].data,e.data):n[r].data===e.data)e=new ni({start:e.start,stop:nt.Z.greaterThan(n[r].stop,e.stop)?n[r].stop:e.stop,isStartIncluded:e.isStartIncluded,isStopIncluded:nt.Z.greaterThan(n[r].stop,e.stop)?n[r].isStopIncluded:e.isStopIncluded,data:e.data}),n.splice(r,1);else if(n[r]=new ni({start:e.stop,stop:n[r].stop,isStartIncluded:!e.isStopIncluded,isStopIncluded:n[r].isStopIncluded,data:n[r].data}),n[r].isEmpty)n.splice(r,1);else break}else break;n.splice(r,0,e),this._changedEvent.raiseEvent(this)},xx.prototype.removeInterval=function(e){if(!(0,_.Z)(e))throw new A.Z("interval is required");if(e.isEmpty)return!1;let t=this._intervals,i=(0,xb.Z)(t,e,xE);i<0&&(i=~i);let n=!1;for(i>0&&(nt.Z.greaterThan(t[i-1].stop,e.start)||t[i-1].stop.equals(e.start)&&t[i-1].isStopIncluded&&e.isStartIncluded)&&(n=!0,(nt.Z.greaterThan(t[i-1].stop,e.stop)||t[i-1].isStopIncluded&&!e.isStopIncluded&&t[i-1].stop.equals(e.stop))&&t.splice(i,0,new ni({start:e.stop,stop:t[i-1].stop,isStartIncluded:!e.isStopIncluded,isStopIncluded:t[i-1].isStopIncluded,data:t[i-1].data})),t[i-1]=new ni({start:t[i-1].start,stop:e.start,isStartIncluded:t[i-1].isStartIncluded,isStopIncluded:!e.isStartIncluded,data:t[i-1].data})),i<t.length&&!e.isStartIncluded&&t[i].isStartIncluded&&e.start.equals(t[i].start)&&(n=!0,t.splice(i,0,new ni({start:t[i].start,stop:t[i].start,isStartIncluded:!0,isStopIncluded:!0,data:t[i].data})),++i);i<t.length&&nt.Z.greaterThan(e.stop,t[i].stop);)n=!0,t.splice(i,1);return i<t.length&&e.stop.equals(t[i].stop)&&(n=!0,!e.isStopIncluded&&t[i].isStopIncluded?i+1<t.length&&t[i+1].start.equals(e.stop)&&t[i].data===t[i+1].data?(t.splice(i,1),t[i]=new ni({start:t[i].start,stop:t[i].stop,isStartIncluded:!0,isStopIncluded:t[i].isStopIncluded,data:t[i].data})):t[i]=new ni({start:e.stop,stop:e.stop,isStartIncluded:!0,isStopIncluded:!0,data:t[i].data}):t.splice(i,1)),i<t.length&&(nt.Z.greaterThan(e.stop,t[i].start)||e.stop.equals(t[i].start)&&e.isStopIncluded&&t[i].isStartIncluded)&&(n=!0,t[i]=new ni({start:e.stop,stop:t[i].stop,isStartIncluded:!e.isStopIncluded,isStopIncluded:t[i].isStopIncluded,data:t[i].data})),n&&this._changedEvent.raiseEvent(this),n},xx.prototype.intersect=function(e,t,i){if(!(0,_.Z)(e))throw new A.Z("other is required.");let n=new xx,r=0,o=0,a=this._intervals,s=e._intervals;for(;r<a.length&&o<s.length;){let e=a[r],l=s[o];if(nt.Z.lessThan(e.stop,l.start))++r;else if(nt.Z.lessThan(l.stop,e.start))++o;else{if((0,_.Z)(i)||(0,_.Z)(t)&&t(e.data,l.data)||!(0,_.Z)(t)&&l.data===e.data){let r=ni.intersect(e,l,new ni,i);r.isEmpty||n.addInterval(r,t)}nt.Z.lessThan(e.stop,l.stop)||e.stop.equals(l.stop)&&!e.isStopIncluded&&l.isStopIncluded?++r:++o}}return n},xx.fromJulianDateArray=function(e,t){let i;if(!(0,_.Z)(e))throw new A.Z("options is required.");if(!(0,_.Z)(e.julianDates))throw new A.Z("options.iso8601Array is required.");(0,_.Z)(t)||(t=new xx);let n=e.julianDates,r=n.length,o=e.dataCallback,a=(0,m.Z)(e.isStartIncluded,!0),s=(0,m.Z)(e.isStopIncluded,!0),l=(0,m.Z)(e.leadingInterval,!1),c=(0,m.Z)(e.trailingInterval,!1),u=0;l&&(++u,(i=new ni({start:na.MINIMUM_VALUE,stop:n[0],isStartIncluded:!0,isStopIncluded:!a})).data=(0,_.Z)(o)?o(i,t.length):t.length,t.addInterval(i));for(let e=0;e<r-1;++e){let l=n[e],c=n[e+1];(i=new ni({start:l,stop:c,isStartIncluded:t.length!==u||a,isStopIncluded:e===r-2&&s})).data=(0,_.Z)(o)?o(i,t.length):t.length,t.addInterval(i),l=c}return c&&((i=new ni({start:n[r-1],stop:na.MAXIMUM_VALUE,isStartIncluded:!s,isStopIncluded:!0})).data=(0,_.Z)(o)?o(i,t.length):t.length,t.addInterval(i)),t};let xS=new xv.Z,xC=[0,31,28,31,30,31,30,31,31,30,31,30,31];function xA(e,t,i){(0,_.Z)(i)||(i=new nt.Z),nt.Z.toGregorianDate(e,xS);let n=xS.millisecond+t.millisecond,r=xS.second+t.second,o=xS.minute+t.minute,a=xS.hour+t.hour,s=xS.day+t.day,l=xS.month+t.month,c=xS.year+t.year;for(n>=1e3&&(r+=Math.floor(n/1e3),n%=1e3),r>=60&&(o+=Math.floor(r/60),r%=60),o>=60&&(a+=Math.floor(o/60),o%=60),a>=24&&(s+=Math.floor(a/24),a%=24),xC[2]=(0,xT.Z)(c)?29:28;s>xC[l]||l>=13;)s>xC[l]&&(s-=xC[l],++l),l>=13&&(c+=Math.floor(--l/12),l%=12,++l),xC[2]=(0,xT.Z)(c)?29:28;return xS.millisecond=n,xS.second=r,xS.minute=o,xS.hour=a,xS.day=s,xS.month=l,xS.year=c,nt.Z.fromGregorianDate(xS,i)}let xI=new nt.Z,xO=/P(?:([\d.,]+)Y)?(?:([\d.,]+)M)?(?:([\d.,]+)W)?(?:([\d.,]+)D)?(?:T(?:([\d.,]+)H)?(?:([\d.,]+)M)?(?:([\d.,]+)S)?)?/;function xD(e,t){if(!(0,_.Z)(e)||0===e.length)return!1;if(t.year=0,t.month=0,t.day=0,t.hour=0,t.minute=0,t.second=0,t.millisecond=0,"P"===e[0]){let i=e.match(xO);if(!(0,_.Z)(i))return!1;if((0,_.Z)(i[1])&&(t.year=Number(i[1].replace(",","."))),(0,_.Z)(i[2])&&(t.month=Number(i[2].replace(",","."))),(0,_.Z)(i[3])&&(t.day=7*Number(i[3].replace(",","."))),(0,_.Z)(i[4])&&(t.day+=Number(i[4].replace(",","."))),(0,_.Z)(i[5])&&(t.hour=Number(i[5].replace(",","."))),(0,_.Z)(i[6])&&(t.minute=Number(i[6].replace(",","."))),(0,_.Z)(i[7])){let e=Number(i[7].replace(",","."));t.second=Math.floor(e),t.millisecond=e%1*1e3}}else"Z"!==e[e.length-1]&&(e+="Z"),nt.Z.toGregorianDate(nt.Z.fromIso8601(e,xI),t);return t.year||t.month||t.day||t.hour||t.minute||t.second||t.millisecond}let xP=new xv.Z;function xR(){this._eventHelper=new Z.Z,this._definitionChanged=new et.Z,this._intervals=new xx,this._intervals.changedEvent.addEventListener(xR.prototype._intervalsChanged,this)}function xN(e){this._referenceFrame=(0,m.Z)(e,xy.Z.FIXED),this._definitionChanged=new et.Z,this._composite=new xR,this._composite.definitionChanged.addEventListener(xN.prototype._raiseDefinitionChanged,this)}xx.fromIso8601=function(e,t){if(!(0,_.Z)(e))throw new A.Z("options is required.");if(!(0,_.Z)(e.iso8601))throw new A.Z("options.iso8601 is required.");let i=e.iso8601.split("/"),n=nt.Z.fromIso8601(i[0]),r=nt.Z.fromIso8601(i[1]),o=[];if(xD(i[2],xP)){let e=nt.Z.clone(n);for(o.push(e);0>nt.Z.compare(e,r);)e=xA(e,xP),0>=nt.Z.compare(r,e)&&nt.Z.clone(r,e),o.push(e)}else o.push(n,r);return xx.fromJulianDateArray({julianDates:o,isStartIncluded:e.isStartIncluded,isStopIncluded:e.isStopIncluded,leadingInterval:e.leadingInterval,trailingInterval:e.trailingInterval,dataCallback:e.dataCallback},t)},xx.fromIso8601DateArray=function(e,t){if(!(0,_.Z)(e))throw new A.Z("options is required.");if(!(0,_.Z)(e.iso8601Dates))throw new A.Z("options.iso8601Dates is required.");return xx.fromJulianDateArray({julianDates:e.iso8601Dates.map(function(e){return nt.Z.fromIso8601(e)}),isStartIncluded:e.isStartIncluded,isStopIncluded:e.isStopIncluded,leadingInterval:e.leadingInterval,trailingInterval:e.trailingInterval,dataCallback:e.dataCallback},t)},xx.fromIso8601DurationArray=function(e,t){let i,n;if(!(0,_.Z)(e))throw new A.Z("options is required.");if(!(0,_.Z)(e.epoch))throw new A.Z("options.epoch is required.");if(!(0,_.Z)(e.iso8601Durations))throw new A.Z("options.iso8601Durations is required.");let r=e.epoch,o=e.iso8601Durations,a=(0,m.Z)(e.relativeToPrevious,!1),s=[],l=o.length;for(let e=0;e<l;++e)(xD(o[e],xP)||0===e)&&(i=a&&(0,_.Z)(n)?xA(n,xP):xA(r,xP),s.push(i),n=i);return xx.fromJulianDateArray({julianDates:s,isStartIncluded:e.isStartIncluded,isStopIncluded:e.isStopIncluded,leadingInterval:e.leadingInterval,trailingInterval:e.trailingInterval,dataCallback:e.dataCallback},t)},Object.defineProperties(xR.prototype,{isConstant:{get:function(){return this._intervals.isEmpty}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._intervals}}}),xR.prototype.getValue=function(e,t){if(!(0,_.Z)(e))throw new A.Z("time is required");let i=this._intervals.findDataForIntervalContainingDate(e);if((0,_.Z)(i))return i.getValue(e,t)},xR.prototype.equals=function(e){return this===e||e instanceof xR&&this._intervals.equals(e._intervals,L.Z.equals)},xR.prototype._intervalsChanged=function(){(function(e,t,i,n){function r(){i.raiseEvent(e)}let o=[];t.removeAll();let a=n.length;for(let e=0;e<a;e++){let i=n.get(e);(0,_.Z)(i.data)&&-1===o.indexOf(i.data)&&t.add(i.data.definitionChanged,r)}})(this,this._eventHelper,this._definitionChanged,this._intervals),this._definitionChanged.raiseEvent(this)},Object.defineProperties(xN.prototype,{isConstant:{get:function(){return this._composite.isConstant}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._composite.intervals}},referenceFrame:{get:function(){return this._referenceFrame},set:function(e){this._referenceFrame=e}}}),xN.prototype.getValue=function(e,t){return this.getValueInReferenceFrame(e,xy.Z.FIXED,t)},xN.prototype.getValueInReferenceFrame=function(e,t,i){if(!(0,_.Z)(e))throw new A.Z("time is required.");if(!(0,_.Z)(t))throw new A.Z("referenceFrame is required.");let n=this._composite._intervals.findDataForIntervalContainingDate(e);if((0,_.Z)(n))return n.getValueInReferenceFrame(e,t,i)},xN.prototype.equals=function(e){return this===e||e instanceof xN&&this._referenceFrame===e._referenceFrame&&this._composite.equals(e._composite,L.Z.equals)},xN.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var xL=i(1949);function xM(e){let t=e._targetProperty;if(!(0,_.Z)(t)){let i=e._targetEntity;if(!(0,_.Z)(i)){if(i=e._targetCollection.getById(e._targetId),!(0,_.Z)(i)){e._targetEntity=e._targetProperty=void 0;return}i.definitionChanged.addEventListener(xF.prototype._onTargetEntityDefinitionChanged,e),e._targetEntity=i}let n=e._targetPropertyNames;t=e._targetEntity;for(let e=0,i=n.length;e<i&&(0,_.Z)(t);++e)t=t[n[e]];e._targetProperty=t}return t}function xF(e,t,i){if(!(0,_.Z)(e))throw new A.Z("targetCollection is required.");if(!(0,_.Z)(t)||""===t)throw new A.Z("targetId is required.");if(!(0,_.Z)(i)||0===i.length)throw new A.Z("targetPropertyNames is required.");for(let e=0;e<i.length;e++){let t=i[e];if(!(0,_.Z)(t)||""===t)throw new A.Z("reference contains invalid properties.")}this._targetCollection=e,this._targetId=t,this._targetPropertyNames=i,this._targetProperty=void 0,this._targetEntity=void 0,this._definitionChanged=new et.Z,e.collectionChanged.addEventListener(xF.prototype._onCollectionChanged,this)}Object.defineProperties(xF.prototype,{isConstant:{get:function(){return L.Z.isConstant(xM(this))}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){let e=xM(this);return(0,_.Z)(e)?e.referenceFrame:void 0}},targetId:{get:function(){return this._targetId}},targetCollection:{get:function(){return this._targetCollection}},targetPropertyNames:{get:function(){return this._targetPropertyNames}},resolvedProperty:{get:function(){return xM(this)}}}),xF.fromString=function(e,t){let i;if(!(0,_.Z)(e))throw new A.Z("targetCollection is required.");if(!(0,_.Z)(t))throw new A.Z("referenceString is required.");let n=[],r=!0,o=!1,a="";for(let e=0;e<t.length;++e){let s=t.charAt(e);o?(a+=s,o=!1):"\\"===s?o=!0:r&&"#"===s?(i=a,r=!1,a=""):r||"."!==s?a+=s:(n.push(a),a="")}return n.push(a),new xF(e,i,n)},xF.prototype.getValue=function(e,t){let i=xM(this);return(0,_.Z)(i)?i.getValue(e,t):void 0},xF.prototype.getValueInReferenceFrame=function(e,t,i){let n=xM(this);return(0,_.Z)(n)?n.getValueInReferenceFrame(e,t,i):void 0},xF.prototype.getType=function(e){let t=xM(this);return(0,_.Z)(t)?t.getType(e):void 0},xF.prototype.equals=function(e){if(this===e)return!0;let t=this._targetPropertyNames,i=e._targetPropertyNames;if(this._targetCollection!==e._targetCollection||this._targetId!==e._targetId||t.length!==i.length)return!1;let n=this._targetPropertyNames.length;for(let e=0;e<n;e++)if(t[e]!==i[e])return!1;return!0},xF.prototype._onTargetEntityDefinitionChanged=function(e,t,i,n){(0,_.Z)(this._targetProperty)&&this._targetPropertyNames[0]===t&&(this._targetProperty=void 0,this._definitionChanged.raiseEvent(this))},xF.prototype._onCollectionChanged=function(e,t,i){let n=this._targetEntity;(0,_.Z)(n)&&-1!==i.indexOf(n)?(n.definitionChanged.removeEventListener(xF.prototype._onTargetEntityDefinitionChanged,this),this._targetEntity=this._targetProperty=void 0):!(0,_.Z)(n)&&(n=xM(this),(0,_.Z)(n)&&this._definitionChanged.raiseEvent(this))};var xz=i(4729);function xB(e){this._definitionChanged=new et.Z,this._value=void 0,this._removeSubscription=void 0,this.setValue(e)}Object.defineProperties(xB.prototype,{isConstant:{get:function(){return L.Z.isConstant(this._value)}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return(0,_.Z)(this._value)?this._value.referenceFrame:xy.Z.FIXED}}}),xB.prototype.getValue=function(e,t){return this.getValueInReferenceFrame(e,xy.Z.FIXED,t)},xB.prototype.setValue=function(e){this._value!==e&&(this._value=e,(0,_.Z)(this._removeSubscription)&&(this._removeSubscription(),this._removeSubscription=void 0),(0,_.Z)(e)&&(this._removeSubscription=e.definitionChanged.addEventListener(this._raiseDefinitionChanged,this)),this._definitionChanged.raiseEvent(this))},xB.prototype.getValueInReferenceFrame=function(e,t,i){if(!(0,_.Z)(e))throw new A.Z("time is required.");if(!(0,_.Z)(t))throw new A.Z("referenceFrame is required.");if((0,_.Z)(this._value))return i=this._value.getValueInReferenceFrame(e,t,i),(0,_.Z)(i)?el.Z.WGS84.scaleToGeodeticSurface(i,i):void 0},xB.prototype.equals=function(e){return this===e||e instanceof xB&&this._value===e._value},xB.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var xU=i(9214);function xk(e){this._definitionChanged=new et.Z,this._intervals=new xx,this._intervals.changedEvent.addEventListener(xk.prototype._intervalsChanged,this),this._referenceFrame=(0,m.Z)(e,xy.Z.FIXED)}Object.defineProperties(xk.prototype,{isConstant:{get:function(){return this._intervals.isEmpty}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._intervals}},referenceFrame:{get:function(){return this._referenceFrame}}}),xk.prototype.getValue=function(e,t){return this.getValueInReferenceFrame(e,xy.Z.FIXED,t)},xk.prototype.getValueInReferenceFrame=function(e,t,i){if(!(0,_.Z)(e))throw new A.Z("time is required.");if(!(0,_.Z)(t))throw new A.Z("referenceFrame is required.");let n=this._intervals.findDataForIntervalContainingDate(e);if((0,_.Z)(n))return xU.Z.convertToReferenceFrame(e,n,this._referenceFrame,t,i)},xk.prototype.equals=function(e){return this===e||e instanceof xk&&this._intervals.equals(e._intervals,L.Z.equals)&&this._referenceFrame===e._referenceFrame},xk.prototype._intervalsChanged=function(){this._definitionChanged.raiseEvent(this)};let xV=new ni,xH=new ni,xG=new ni;function xj(e){this.entity=e,this.polyline=void 0,this.index=void 0,this.updater=void 0}function xW(e,t,i,n,r,o,a){(0,_.Z)(a)||(a=[]);let s=function e(t,i,n,r,o,a,s,l){for(;t instanceof xF;)t=t.resolvedProperty;if(t instanceof xz.Z){let e=t._property._times;s=function(e,t,i,n,r,o,a,s,l){let c,u,h,d,f=s;c=e.getValueInReferenceFrame(t,o,l[f]),(0,_.Z)(c)&&(l[f++]=c);let p=!(0,_.Z)(r)||nt.Z.lessThanOrEquals(r,t)||nt.Z.greaterThanOrEquals(r,i),m=0,g=n.length,Z=n[m],y=!1;for(;m<g;){if(!p&&nt.Z.greaterThanOrEquals(Z,r)&&(c=e.getValueInReferenceFrame(r,o,l[f]),(0,_.Z)(c)&&(l[f++]=c),p=!0),nt.Z.greaterThan(Z,t)&&nt.Z.lessThan(Z,i)&&!Z.equals(r)&&(c=e.getValueInReferenceFrame(Z,o,l[f]),(0,_.Z)(c)&&(l[f++]=c)),m<g-1){if(a>0&&!y){let e=n[m+1],t=nt.Z.secondsDifference(e,Z);(y=t>a)&&(u=Math.ceil(t/a),h=0,d=t/Math.max(u,2),u=Math.max(u-1,1))}if(y&&h<u){Z=nt.Z.addSeconds(Z,d,new nt.Z),h++;continue}}y=!1,Z=n[++m]}return c=e.getValueInReferenceFrame(i,o,l[f]),(0,_.Z)(c)&&(l[f++]=c),f}(t,i,n,e,r,o,a,s,l)}else s=t instanceof xN?function(t,i,n,r,o,a,s,l){xH.start=i,xH.stop=n;let c=s,u=t.intervals;for(let t=0;t<u.length;t++){let s=u.get(t);if(!ni.intersect(s,xH,xV).isEmpty){let t=s.start,u=s.stop,h=i;nt.Z.greaterThan(t,h)&&(h=t);let d=n;nt.Z.lessThan(u,d)&&(d=u),c=e(s.data,h,d,r,o,a,c,l)}}return c}(t,i,n,r,o,a,s,l):t instanceof xk?function(e,t,i,n,r,o,a,s){xG.start=t,xG.stop=i;let l=a,c=e.intervals;for(let t=0;t<c.length;t++){let i=c.get(t);if(!ni.intersect(i,xG,xV).isEmpty){let t=i.start;i.isStartIncluded||(t=i.isStopIncluded?i.stop:nt.Z.addSeconds(i.start,nt.Z.secondsDifference(i.stop,i.start)/2,new nt.Z));let n=e.getValueInReferenceFrame(t,r,s[l]);(0,_.Z)(n)&&(s[l]=n,l++)}}return l}(t,i,n,0,o,0,s,l):t instanceof xL.Z||t instanceof xB&&L.Z.isConstant(t)?function(e,t,i,n,r,o,a,s){let l=e.getValueInReferenceFrame(t,r,s[a]);return(0,_.Z)(l)&&(s[a++]=l),a}(t,i,0,0,o,0,s,l):function(e,t,i,n,r,o,a,s){let l;let c=0,u=a,h=t,d=Math.max(o,60),f=!(0,_.Z)(n)||nt.Z.lessThanOrEquals(n,t)||nt.Z.greaterThanOrEquals(n,i);for(;nt.Z.lessThan(h,i);)!f&&nt.Z.greaterThanOrEquals(h,n)&&(f=!0,l=e.getValueInReferenceFrame(n,r,s[u]),(0,_.Z)(l)&&(s[u]=l,u++)),l=e.getValueInReferenceFrame(h,r,s[u]),(0,_.Z)(l)&&(s[u]=l,u++),c++,h=nt.Z.addSeconds(t,d*c,new nt.Z);return l=e.getValueInReferenceFrame(i,r,s[u]),(0,_.Z)(l)&&(s[u]=l,u++),u}(t,i,n,r,o,a,s,l);return s}(e,t,i,n,r,o,0,a);return a.length=s,a}let xq=new n2.Z;function xY(e,t){this._unusedIndexes=[],this._polylineCollection=new vZ.Z,this._scene=e,this._referenceFrame=t,e.primitives.add(this._polylineCollection)}function xX(e,t){if(!(0,_.Z)(e))throw new A.Z("scene is required.");if(!(0,_.Z)(t))throw new A.Z("entityCollection is required.");t.collectionChanged.addEventListener(xX.prototype._onCollectionChanged,this),this._scene=e,this._updaters={},this._entityCollection=t,this._items=new E.Z,this._onCollectionChanged(t,t.values,[],[])}xY.prototype.update=function(e){if(this._referenceFrame===xy.Z.INERTIAL){let t=n9.Z.computeIcrfToFixedMatrix(e,xq);(0,_.Z)(t)||(t=n9.Z.computeTemeToPseudoFixedMatrix(e,xq)),er.Z.fromRotationTranslation(t,S.Z.ZERO,this._polylineCollection.modelMatrix)}},xY.prototype.updateObject=function(e,t){let i,n;let r=t.entity,o=r._path,a=r._position,s=o._show,l=t.polyline,c=r.isShowing&&r.isAvailable(e)&&(!(0,_.Z)(s)||s.getValue(e));if(c){let t=L.Z.getValueOrUndefined(o._leadTime,e),a=L.Z.getValueOrUndefined(o._trailTime,e),s=r._availability,l=(0,_.Z)(s),u=(0,_.Z)(t),h=(0,_.Z)(a);if(c=l||u&&h){if(h&&(i=nt.Z.addSeconds(e,-a,new nt.Z)),u&&(n=nt.Z.addSeconds(e,t,new nt.Z)),l){let e=s.start,t=s.stop;(!h||nt.Z.greaterThan(e,i))&&(i=e),(!u||nt.Z.lessThan(t,n))&&(n=t)}c=nt.Z.lessThan(i,n)}}if(!c){(0,_.Z)(l)&&(this._unusedIndexes.push(t.index),t.polyline=void 0,l.show=!1,t.index=void 0);return}if(!(0,_.Z)(l)){let e=this._unusedIndexes;if(e.length>0){let i=e.pop();l=this._polylineCollection.get(i),t.index=i}else t.index=this._polylineCollection.length,l=this._polylineCollection.add();l.id=r,t.polyline=l}let u=L.Z.getValueOrDefault(o._resolution,e,60);l.show=!0,l.positions=xW(a,i,n,e,this._referenceFrame,u,l.positions.slice()),l.material=nO.getValue(e,o._material,l.material),l.width=L.Z.getValueOrDefault(o._width,e,1),l.distanceDisplayCondition=L.Z.getValueOrUndefined(o._distanceDisplayCondition,e,l.distanceDisplayCondition)},xY.prototype.removeObject=function(e){let t=e.polyline;(0,_.Z)(t)&&(this._unusedIndexes.push(e.index),e.polyline=void 0,t.show=!1,t.id=void 0,e.index=void 0)},xY.prototype.destroy=function(){return this._scene.primitives.remove(this._polylineCollection),(0,g.Z)(this)},xX.prototype.update=function(e){if(!(0,_.Z)(e))throw new A.Z("time is required.");let t=this._updaters;for(let i in t)t.hasOwnProperty(i)&&t[i].update(e);let i=this._items.values;if(0===i.length&&(0,_.Z)(this._updaters)&&Object.keys(this._updaters).length>0){for(let e in t)t.hasOwnProperty(e)&&t[e].destroy();this._updaters={}}for(let t=0,n=i.length;t<n;t++){let n=i[t],r=n.entity._position,o=n.updater,a=xy.Z.FIXED;this._scene.mode===eu.Z.SCENE3D&&(a=r.referenceFrame);let s=this._updaters[a];if(o===s&&(0,_.Z)(s)){s.updateObject(e,n);continue}(0,_.Z)(o)&&o.removeObject(n),(0,_.Z)(s)||((s=new xY(this._scene,a)).update(e),this._updaters[a]=s),n.updater=s,(0,_.Z)(s)&&s.updateObject(e,n)}return!0},xX.prototype.isDestroyed=function(){return!1},xX.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(xX.prototype._onCollectionChanged,this);let e=this._updaters;for(let t in e)e.hasOwnProperty(t)&&e[t].destroy();return(0,g.Z)(this)},xX.prototype._onCollectionChanged=function(e,t,i,n){let r,o,a;let s=this._items;for(r=t.length-1;r>-1;r--)o=t[r],(0,_.Z)(o._path)&&(0,_.Z)(o._position)&&s.set(o.id,new xj(o));for(r=n.length-1;r>-1;r--)o=n[r],(0,_.Z)(o._path)&&(0,_.Z)(o._position)?s.contains(o.id)||s.set(o.id,new xj(o)):(a=s.get(o.id),(0,_.Z)(a)&&((0,_.Z)(a.updater)&&a.updater.removeObject(a),s.remove(o.id)));for(r=i.length-1;r>-1;r--)o=i[r],a=s.get(o.id),(0,_.Z)(a)&&((0,_.Z)(a.updater)&&a.updater.removeObject(a),s.remove(o.id))},xX._subSample=xW;let x$=C.Z.WHITE,xK=C.Z.BLACK,xQ=new C.Z,xJ=new S.Z,x0=new C.Z,x1=new O.Z,x2=new O.Z,x3=new I.Z;function x4(e){this.entity=e,this.pointPrimitive=void 0,this.billboard=void 0,this.color=void 0,this.outlineColor=void 0,this.pixelSize=void 0,this.outlineWidth=void 0}function x5(e,t){if(!(0,_.Z)(e))throw new A.Z("entityCluster is required.");if(!(0,_.Z)(t))throw new A.Z("entityCollection is required.");t.collectionChanged.addEventListener(x5.prototype._onCollectionChanged,this),this._cluster=e,this._entityCollection=t,this._items=new E.Z,this._onCollectionChanged(t,t.values,[],[])}function x9(e,t,i){if((0,_.Z)(e)){let n=e.pointPrimitive;if((0,_.Z)(n)){e.pointPrimitive=void 0,i.removePoint(t);return}let r=e.billboard;(0,_.Z)(r)&&(e.billboard=void 0,i.removeBillboard(t))}}x5.prototype.update=function(e){if(!(0,_.Z)(e))throw new A.Z("time is required.");let t=this._items.values,i=this._cluster;for(let n=0,r=t.length;n<r;n++){let r;let o=t[n],a=o.entity,s=a._point,l=o.pointPrimitive,c=o.billboard,u=L.Z.getValueOrDefault(s._heightReference,e,D.ZP.NONE),h=a.isShowing&&a.isAvailable(e)&&L.Z.getValueOrDefault(s._show,e,!0);if(h&&(r=L.Z.getValueOrUndefined(a._position,e,xJ),h=(0,_.Z)(r)),!h){x9(o,a,i);continue}L.Z.isConstant(a._position)||(i._clusterDirty=!0);let d=!1,f=!1;if(u===D.ZP.NONE||(0,_.Z)(c)?u!==D.ZP.NONE||(0,_.Z)(l)||((0,_.Z)(c)&&(x9(o,a,i),c=void 0),(l=i.getPoint(a)).id=a,o.pointPrimitive=l):((0,_.Z)(l)&&(x9(o,a,i),l=void 0),(c=i.getBillboard(a)).id=a,c.image=void 0,o.billboard=c,d=!0,f=S.Z.equals(c.position,r)&&c.heightReference===u),(0,_.Z)(l))l.show=!0,l.position=r,l.scaleByDistance=L.Z.getValueOrUndefined(s._scaleByDistance,e,x1),l.translucencyByDistance=L.Z.getValueOrUndefined(s._translucencyByDistance,e,x2),l.color=L.Z.getValueOrDefault(s._color,e,x$,xQ),l.outlineColor=L.Z.getValueOrDefault(s._outlineColor,e,xK,x0),l.outlineWidth=L.Z.getValueOrDefault(s._outlineWidth,e,0),l.pixelSize=L.Z.getValueOrDefault(s._pixelSize,e,1),l.distanceDisplayCondition=L.Z.getValueOrUndefined(s._distanceDisplayCondition,e,x3),l.disableDepthTestDistance=L.Z.getValueOrDefault(s._disableDepthTestDistance,e,0);else if((0,_.Z)(c)){c.show=!0,c.position=r,c.scaleByDistance=L.Z.getValueOrUndefined(s._scaleByDistance,e,x1),c.translucencyByDistance=L.Z.getValueOrUndefined(s._translucencyByDistance,e,x2),c.distanceDisplayCondition=L.Z.getValueOrUndefined(s._distanceDisplayCondition,e,x3),c.disableDepthTestDistance=L.Z.getValueOrDefault(s._disableDepthTestDistance,e,0),c.heightReference=u;let t=L.Z.getValueOrDefault(s._color,e,x$,xQ),i=L.Z.getValueOrDefault(s._outlineColor,e,xK,x0),n=Math.round(L.Z.getValueOrDefault(s._outlineWidth,e,0)),a=Math.max(1,Math.round(L.Z.getValueOrDefault(s._pixelSize,e,1)));if(n>0?(c.scale=1,d=d||n!==o.outlineWidth||a!==o.pixelSize||!C.Z.equals(t,o.color)||!C.Z.equals(i,o.outlineColor)):(c.scale=a/50,a=50,d=d||n!==o.outlineWidth||!C.Z.equals(t,o.color)||!C.Z.equals(i,o.outlineColor)),d){o.color=C.Z.clone(t,o.color),o.outlineColor=C.Z.clone(i,o.outlineColor),o.pixelSize=a,o.outlineWidth=n;let e=t.alpha,r=t.toCssColorString(),s=i.toCssColorString(),l=JSON.stringify([r,a,s,n]);c.setImage(l,vp(e,r,s,n,a))}f&&c._updateClamping()}}return!0},x5.prototype.getBoundingSphere=function(e,t){if(!(0,_.Z)(e))throw new A.Z("entity is required.");if(!(0,_.Z)(t))throw new A.Z("result is required.");let i=this._items.get(e.id);if(!(0,_.Z)(i)||!((0,_.Z)(i.pointPrimitive)||(0,_.Z)(i.billboard)))return N.FAILED;if((0,_.Z)(i.pointPrimitive))t.center=S.Z.clone(i.pointPrimitive.position,t.center);else{let e=i.billboard;if(!(0,_.Z)(e._clampedPosition))return N.PENDING;t.center=S.Z.clone(e._clampedPosition,t.center)}return t.radius=0,N.DONE},x5.prototype.isDestroyed=function(){return!1},x5.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(x5.prototype._onCollectionChanged,this);let e=this._entityCollection.values;for(let t=0;t<e.length;t++)this._cluster.removePoint(e[t]);return(0,g.Z)(this)},x5.prototype._onCollectionChanged=function(e,t,i,n){let r,o;let a=this._items,s=this._cluster;for(r=t.length-1;r>-1;r--)o=t[r],(0,_.Z)(o._point)&&(0,_.Z)(o._position)&&a.set(o.id,new x4(o));for(r=n.length-1;r>-1;r--)o=n[r],(0,_.Z)(o._point)&&(0,_.Z)(o._position)?a.contains(o.id)||a.set(o.id,new x4(o)):(x9(a.get(o.id),o,s),a.remove(o.id));for(r=i.length-1;r>-1;r--)o=i[r],x9(a.get(o.id),o,s),a.remove(o.id)};var x8=i(4955),x6=i(2307),x7=i(1362),we=i(357);let wt=[];function wi(e){let t=(e=(0,m.Z)(e,m.Z.EMPTY_OBJECT)).positions,i=e.colors,n=(0,m.Z)(e.width,1),r=(0,m.Z)(e.colorsPerVertex,!1);if(!(0,_.Z)(t)||t.length<2)throw new A.Z("At least two positions are required.");if("number"!=typeof n)throw new A.Z("width must be a number");if((0,_.Z)(i)&&(r&&i.length<t.length||!r&&i.length<t.length-1))throw new A.Z("colors has an invalid length.");this._positions=t,this._colors=i,this._width=n,this._colorsPerVertex=r,this._vertexFormat=nf.Z.clone((0,m.Z)(e.vertexFormat,nf.Z.DEFAULT)),this._arcType=(0,m.Z)(e.arcType,sg.Z.GEODESIC),this._granularity=(0,m.Z)(e.granularity,eB.Z.RADIANS_PER_DEGREE),this._ellipsoid=el.Z.clone((0,m.Z)(e.ellipsoid,el.Z.WGS84)),this._workerName="createPolylineGeometry";let o=1+t.length*S.Z.packedLength;o+=(0,_.Z)(i)?1+i.length*C.Z.packedLength:1,this.packedLength=o+el.Z.packedLength+nf.Z.packedLength+4}wi.pack=function(e,t,i){let n;if(!(0,_.Z)(e))throw new A.Z("value is required");if(!(0,_.Z)(t))throw new A.Z("array is required");i=(0,m.Z)(i,0);let r=e._positions,o=r.length;for(n=0,t[i++]=o;n<o;++n,i+=S.Z.packedLength)S.Z.pack(r[n],t,i);let a=e._colors;for(n=0,o=(0,_.Z)(a)?a.length:0,t[i++]=o;n<o;++n,i+=C.Z.packedLength)C.Z.pack(a[n],t,i);return el.Z.pack(e._ellipsoid,t,i),i+=el.Z.packedLength,nf.Z.pack(e._vertexFormat,t,i),i+=nf.Z.packedLength,t[i++]=e._width,t[i++]=e._colorsPerVertex?1:0,t[i++]=e._arcType,t[i]=e._granularity,t};let wn=el.Z.clone(el.Z.UNIT_SPHERE),wr=new nf.Z,wo={positions:void 0,colors:void 0,ellipsoid:wn,vertexFormat:wr,width:void 0,colorsPerVertex:void 0,arcType:void 0,granularity:void 0};wi.unpack=function(e,t,i){let n;if(!(0,_.Z)(e))throw new A.Z("array is required");t=(0,m.Z)(t,0);let r=e[t++],o=Array(r);for(n=0;n<r;++n,t+=S.Z.packedLength)o[n]=S.Z.unpack(e,t);let a=(r=e[t++])>0?Array(r):void 0;for(n=0;n<r;++n,t+=C.Z.packedLength)a[n]=C.Z.unpack(e,t);let s=el.Z.unpack(e,t,wn);t+=el.Z.packedLength;let l=nf.Z.unpack(e,t,wr);t+=nf.Z.packedLength;let c=e[t++],u=1===e[t++],h=e[t++],d=e[t];return(0,_.Z)(i)?(i._positions=o,i._colors=a,i._ellipsoid=el.Z.clone(s,i._ellipsoid),i._vertexFormat=nf.Z.clone(l,i._vertexFormat),i._width=c,i._colorsPerVertex=u,i._arcType=h,i._granularity=d,i):(wo.positions=o,wo.colors=a,wo.width=c,wo.colorsPerVertex=u,wo.arcType=h,wo.granularity=d,new wi(wo))};let wa=new S.Z,ws=new S.Z,wl=new S.Z,wc=new S.Z;wi.createGeometry=function(e){let t,i,n,r;let o=e._width,a=e._vertexFormat,s=e._colors,l=e._colorsPerVertex,c=e._arcType,u=e._granularity,h=e._ellipsoid,d=[],p=(0,n0.Z)(e._positions,S.Z.equalsEpsilon,!1,d);if((0,_.Z)(s)&&d.length>0){let e=0,t=d[0];s=s.filter(function(i,n){return!(l?n===t||0===n&&1===t:n+1===t)||(t=d[++e],!1)})}let m=p.length;if(m<2||o<=0)return;if(c===sg.Z.GEODESIC||c===sg.Z.RHUMB){let e,n;c===sg.Z.GEODESIC?(e=eB.Z.chordLength(u,h.maximumRadius),n=n3.Z.numberOfPoints):(e=u,n=n3.Z.numberOfPointsRhumbLine);let r=n3.Z.extractHeights(p,h);if((0,_.Z)(s)){let r=1;for(t=0;t<m-1;++t)r+=n(p[t],p[t+1],e);let o=Array(r),a=0;for(t=0;t<m-1;++t){let c=p[t],u=p[t+1],h=s[t],d=n(c,u,e);if(l&&t<r){let e=function(e,t,i,n,r){let o;wt.length=r;let a=i.red,s=i.green,l=i.blue,c=i.alpha,u=n.red,h=n.green,d=n.blue,f=n.alpha;if(C.Z.equals(i,n)){for(o=0;o<r;o++)wt[o]=C.Z.clone(i);return wt}let p=(u-a)/r,m=(h-s)/r,_=(d-l)/r,g=(f-c)/r;for(o=0;o<r;o++)wt[o]=new C.Z(a+o*p,s+o*m,l+o*_,c+o*g);return wt}(0,0,h,s[t+1],d),n=e.length;for(i=0;i<n;++i)o[a++]=e[i]}else for(i=0;i<d;++i)o[a++]=C.Z.clone(h)}o[a]=C.Z.clone(s[s.length-1]),s=o,wt.length=0}p=c===sg.Z.GEODESIC?n3.Z.generateCartesianArc({positions:p,minDistance:e,ellipsoid:h,height:r}):n3.Z.generateCartesianRhumbArc({positions:p,granularity:e,ellipsoid:h,height:r})}let g=4*(m=p.length)-4,Z=new Float64Array(3*g),y=new Float64Array(3*g),b=new Float64Array(3*g),v=new Float32Array(2*g),T=a.st?new Float32Array(2*g):void 0,E=(0,_.Z)(s)?new Uint8Array(4*g):void 0,x=0,w=0,A=0,I=0;for(i=0;i<m;++i){let e,t;0===i?(r=wa,S.Z.subtract(p[0],p[1],r),S.Z.add(p[0],r,r)):r=p[i-1],S.Z.clone(r,wl),S.Z.clone(p[i],ws),i===m-1?(r=wa,S.Z.subtract(p[m-1],p[m-2],r),S.Z.add(p[m-1],r,r)):r=p[i+1],S.Z.clone(r,wc),(0,_.Z)(E)&&(e=0===i||l?s[i]:s[i-1],i!==m-1&&(t=s[i]));let c=0===i?2:0,u=i===m-1?2:4;for(n=c;n<u;++n){S.Z.pack(ws,Z,x),S.Z.pack(wl,y,x),S.Z.pack(wc,b,x),x+=3;let r=n-2<0?-1:1;if(v[w++]=n%2*2-1,v[w++]=r*o,a.st&&(T[A++]=i/(m-1),T[A++]=Math.max(v[w-2],0)),(0,_.Z)(E)){let i=n<2?e:t;E[I++]=C.Z.floatToByte(i.red),E[I++]=C.Z.floatToByte(i.green),E[I++]=C.Z.floatToByte(i.blue),E[I++]=C.Z.floatToByte(i.alpha)}}}let O=new r3.Z;O.position=new r2.Z({componentDatatype:eM.Z.DOUBLE,componentsPerAttribute:3,values:Z}),O.prevPosition=new r2.Z({componentDatatype:eM.Z.DOUBLE,componentsPerAttribute:3,values:y}),O.nextPosition=new r2.Z({componentDatatype:eM.Z.DOUBLE,componentsPerAttribute:3,values:b}),O.expandAndWidth=new r2.Z({componentDatatype:eM.Z.FLOAT,componentsPerAttribute:2,values:v}),a.st&&(O.st=new r2.Z({componentDatatype:eM.Z.FLOAT,componentsPerAttribute:2,values:T})),(0,_.Z)(E)&&(O.color=new r2.Z({componentDatatype:eM.Z.UNSIGNED_BYTE,componentsPerAttribute:4,values:E,normalize:!0}));let D=ez.Z.createTypedArray(g,6*m-6),P=0,R=0,N=m-1;for(i=0;i<N;++i)D[R++]=P,D[R++]=P+2,D[R++]=P+1,D[R++]=P+1,D[R++]=P+2,D[R++]=P+3,P+=4;return new r1.Z({attributes:O,indices:D,primitiveType:iT.Z.TRIANGLES,boundingSphere:f.Z.fromPoints(p),geometryType:we.Z.POLYLINES})};let wu=new nR.Z(0),wh={},wd=new C.Z,wf=new ny.Z(C.Z.WHITE),wp=new nR.Z(!0),wm=new nR.Z(nZ.Z.DISABLED),w_=new nR.Z(new I.Z),wg=new nR.Z(nd.Z.BOTH);function wZ(){this.vertexFormat=void 0,this.positions=void 0,this.width=void 0,this.arcType=void 0,this.granularity=void 0}function wy(){this.positions=void 0,this.width=void 0,this.arcType=void 0,this.granularity=void 0}function wb(e,t){if(!(0,_.Z)(e))throw new A.Z("entity is required");if(!(0,_.Z)(t))throw new A.Z("scene is required");this._entity=e,this._scene=t,this._entitySubscription=e.definitionChanged.addEventListener(wb.prototype._onEntityPropertyChanged,this),this._fillEnabled=!1,this._dynamic=!1,this._geometryChanged=new et.Z,this._showProperty=void 0,this._materialProperty=void 0,this._shadowsProperty=void 0,this._distanceDisplayConditionProperty=void 0,this._classificationTypeProperty=void 0,this._depthFailMaterialProperty=void 0,this._geometryOptions=new wZ,this._groundGeometryOptions=new wy,this._id=`polyline-${e.id}`,this._clampToGround=!1,this._supportsPolylinesOnTerrain=ns.Z.supportsPolylinesOnTerrain(t),this._zIndex=0,this._onEntityPropertyChanged(e,"polyline",e.polyline,void 0)}Object.defineProperties(wb.prototype,{id:{get:function(){return this._id}},entity:{get:function(){return this._entity}},fillEnabled:{get:function(){return this._fillEnabled}},hasConstantFill:{get:function(){return!this._fillEnabled||!(0,_.Z)(this._entity.availability)&&L.Z.isConstant(this._showProperty)}},fillMaterialProperty:{get:function(){return this._materialProperty}},depthFailMaterialProperty:{get:function(){return this._depthFailMaterialProperty}},outlineEnabled:{value:!1},hasConstantOutline:{value:!0},outlineColorProperty:{value:void 0},shadowsProperty:{get:function(){return this._shadowsProperty}},distanceDisplayConditionProperty:{get:function(){return this._distanceDisplayConditionProperty}},classificationTypeProperty:{get:function(){return this._classificationTypeProperty}},isDynamic:{get:function(){return this._dynamic}},isClosed:{value:!1},geometryChanged:{get:function(){return this._geometryChanged}},arcType:{get:function(){return this._arcType}},clampToGround:{get:function(){return this._clampToGround&&this._supportsPolylinesOnTerrain}},zIndex:{get:function(){return this._zIndex}}}),wb.prototype.isOutlineVisible=function(e){return!1},wb.prototype.isFilled=function(e){let t=this._entity,i=this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e);return(0,m.Z)(i,!1)},wb.prototype.createFillGeometryInstance=function(e){let t;if(!(0,_.Z)(e))throw new A.Z("time is required.");if(!this._fillEnabled)throw new A.Z("This instance does not represent a filled geometry.");let i=this._entity,n=i.isAvailable(e),r=new nA.Z(n&&i.isShowing&&this._showProperty.getValue(e)),o=this._distanceDisplayConditionProperty.getValue(e),a={show:r,distanceDisplayCondition:nx.fromDistanceDisplayCondition(o)};return(this._materialProperty instanceof ny.Z&&((0,_.Z)(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(t=this._materialProperty.color.getValue(e,wd)),(0,_.Z)(t)||(t=C.Z.WHITE),a.color=nE.Z.fromColor(t)),this.clampToGround)?new nw.Z({id:i,geometry:new x7.Z(this._groundGeometryOptions),attributes:a}):((0,_.Z)(this._depthFailMaterialProperty)&&this._depthFailMaterialProperty instanceof ny.Z&&((0,_.Z)(this._depthFailMaterialProperty.color)&&(this._depthFailMaterialProperty.color.isConstant||n)&&(t=this._depthFailMaterialProperty.color.getValue(e,wd)),(0,_.Z)(t)||(t=C.Z.WHITE),a.depthFailColor=nE.Z.fromColor(t)),new nw.Z({id:i,geometry:new wi(this._geometryOptions),attributes:a}))},wb.prototype.createOutlineGeometryInstance=function(e){throw new A.Z("This instance does not represent an outlined geometry.")},wb.prototype.isDestroyed=function(){return!1},wb.prototype.destroy=function(){this._entitySubscription(),(0,g.Z)(this)},wb.prototype._onEntityPropertyChanged=function(e,t,i,n){if(!("availability"===t||"polyline"===t))return;let r=this._entity.polyline;if(!(0,_.Z)(r)){this._fillEnabled&&(this._fillEnabled=!1,this._geometryChanged.raiseEvent(this));return}let o=r.positions,a=r.show;if((0,_.Z)(a)&&a.isConstant&&!a.getValue(na.MINIMUM_VALUE)||!(0,_.Z)(o)){this._fillEnabled&&(this._fillEnabled=!1,this._geometryChanged.raiseEvent(this));return}let s=r.zIndex,l=(0,m.Z)(r.material,wf),c=l instanceof ny.Z;this._materialProperty=l,this._depthFailMaterialProperty=r.depthFailMaterial,this._showProperty=(0,m.Z)(a,wp),this._shadowsProperty=(0,m.Z)(r.shadows,wm),this._distanceDisplayConditionProperty=(0,m.Z)(r.distanceDisplayCondition,w_),this._classificationTypeProperty=(0,m.Z)(r.classificationType,wg),this._fillEnabled=!0,this._zIndex=(0,m.Z)(s,wu);let u=r.width,h=r.arcType,d=r.clampToGround,f=r.granularity;if(o.isConstant&&L.Z.isConstant(u)&&L.Z.isConstant(h)&&L.Z.isConstant(f)&&L.Z.isConstant(d)&&L.Z.isConstant(s)){let e;let t=this._geometryOptions,i=o.getValue(na.MINIMUM_VALUE,t.positions);if(!(0,_.Z)(i)||i.length<2){this._fillEnabled&&(this._fillEnabled=!1,this._geometryChanged.raiseEvent(this));return}e=c&&(!(0,_.Z)(this._depthFailMaterialProperty)||this._depthFailMaterialProperty instanceof ny.Z)?x8.Z.VERTEX_FORMAT:x6.Z.VERTEX_FORMAT,t.vertexFormat=e,t.positions=i,t.width=(0,_.Z)(u)?u.getValue(na.MINIMUM_VALUE):void 0,t.arcType=(0,_.Z)(h)?h.getValue(na.MINIMUM_VALUE):void 0,t.granularity=(0,_.Z)(f)?f.getValue(na.MINIMUM_VALUE):void 0;let n=this._groundGeometryOptions;n.positions=i,n.width=t.width,n.arcType=t.arcType,n.granularity=t.granularity,this._clampToGround=!!(0,_.Z)(d)&&d.getValue(na.MINIMUM_VALUE),!this._clampToGround&&(0,_.Z)(s)&&(0,nP.Z)("Entity polylines must have clampToGround: true when using zIndex. zIndex will be ignored."),this._dynamic=!1,this._geometryChanged.raiseEvent(this)}else this._dynamic||(this._dynamic=!0,this._geometryChanged.raiseEvent(this))},wb.prototype.createDynamicUpdater=function(e,t){if(p.Z.defined("primitives",e),p.Z.defined("groundPrimitives",t),!this._dynamic)throw new A.Z("This instance does not represent dynamic geometry.");return new wT(e,t,this)};let wv={positions:void 0,granularity:void 0,height:void 0,ellipsoid:void 0};function wT(e,t,i){this._line=void 0,this._primitives=e,this._groundPrimitives=t,this._groundPolylinePrimitive=void 0,this._material=void 0,this._geometryUpdater=i,this._positions=[]}function wE(e){if((0,_.Z)(e._line))return e._line;let t=e._primitives,i=e._geometryUpdater._scene.id+t._guid,n=wh[i];!(0,_.Z)(n)||n.isDestroyed()?(n=new vZ.Z,wh[i]=n,t.add(n)):t.contains(n)||t.add(n);let r=n.add();return r.id=e._geometryUpdater._entity,e._line=r,r}wT.prototype.update=function(e){let t=this._geometryUpdater,i=t._entity,n=i.polyline,r=n.positions,o=L.Z.getValueOrUndefined(r,e,this._positions);t._clampToGround=L.Z.getValueOrDefault(n._clampToGround,e,!1),t._groundGeometryOptions.positions=o,t._groundGeometryOptions.width=L.Z.getValueOrDefault(n._width,e,1),t._groundGeometryOptions.arcType=L.Z.getValueOrDefault(n._arcType,e,sg.Z.GEODESIC),t._groundGeometryOptions.granularity=L.Z.getValueOrDefault(n._granularity,e,9999);let a=this._groundPrimitives;if((0,_.Z)(this._groundPolylinePrimitive)&&(a.remove(this._groundPolylinePrimitive),this._groundPolylinePrimitive=void 0),t.clampToGround){let r;if(!i.isShowing||!i.isAvailable(e)||!L.Z.getValueOrDefault(n._show,e,!0)||!(0,_.Z)(o)||o.length<2)return;let s=t.fillMaterialProperty;if(s instanceof ny.Z)r=new x8.Z;else{let t=nO.getValue(e,s,this._material);r=new x6.Z({material:t,translucent:t.isTranslucent()}),this._material=t}this._groundPolylinePrimitive=a.add(new y.Z({geometryInstances:t.createFillGeometryInstance(e),appearance:r,classificationType:t.classificationTypeProperty.getValue(e),asynchronous:!1}),L.Z.getValueOrUndefined(t.zIndex,e)),(0,_.Z)(this._line)&&(this._line.show=!1);return}let s=wE(this);if(!i.isShowing||!i.isAvailable(e)||!L.Z.getValueOrDefault(n._show,e,!0)||!(0,_.Z)(o)||o.length<2){s.show=!1;return}let l=sg.Z.GEODESIC;l=L.Z.getValueOrDefault(n._arcType,e,l);let c=t._scene.globe;l!==sg.Z.NONE&&(0,_.Z)(c)&&(wv.ellipsoid=c.ellipsoid,wv.positions=o,wv.granularity=L.Z.getValueOrUndefined(n._granularity,e),wv.height=n3.Z.extractHeights(o,c.ellipsoid),o=l===sg.Z.GEODESIC?n3.Z.generateCartesianArc(wv):n3.Z.generateCartesianRhumbArc(wv)),s.show=!0,s.positions=o.slice(),s.material=nO.getValue(e,t.fillMaterialProperty,s.material),s.width=L.Z.getValueOrDefault(n._width,e,1),s.distanceDisplayCondition=L.Z.getValueOrUndefined(n._distanceDisplayCondition,e,s.distanceDisplayCondition)},wT.prototype.getBoundingSphere=function(e){if(p.Z.defined("result",e),this._geometryUpdater.clampToGround){let t=this._groundPolylinePrimitive;if((0,_.Z)(t)&&t.show&&t.ready){let i=t.getGeometryInstanceAttributes(this._geometryUpdater._entity);if((0,_.Z)(i)&&(0,_.Z)(i.boundingSphere))return f.Z.clone(i.boundingSphere,e),N.DONE}return(0,_.Z)(t)&&!t.ready?N.PENDING:N.DONE}{let t=wE(this);if(t.show&&t.positions.length>0)return f.Z.fromPoints(t.positions,e),N.DONE}return N.FAILED},wT.prototype.isDestroyed=function(){return!1},wT.prototype.destroy=function(){let e=this._geometryUpdater._scene.id+this._primitives._guid,t=wh[e];(0,_.Z)(t)&&(t.remove(this._line),0===t.length&&(this._primitives.removeAndDestroy(t),delete wh[e])),(0,_.Z)(this._groundPolylinePrimitive)&&this._groundPrimitives.remove(this._groundPolylinePrimitive),(0,g.Z)(this)};let wx=new C.Z,ww=new I.Z,wS=new I.Z;function wC(e,t,i,n,r){let o;o=i instanceof ny.Z?x8.Z:x6.Z,this.orderedGroundPrimitives=e,this.classificationType=t,this.appearanceType=o,this.materialProperty=i,this.updaters=new E.Z,this.createPrimitive=!0,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new E.Z,this.material=void 0,this.updatersWithAttributes=new E.Z,this.attributes=new E.Z,this.invalidated=!1,this.removeMaterialSubscription=i.definitionChanged.addEventListener(wC.prototype.onMaterialChanged,this),this.subscriptions=new E.Z,this.showsUpdated=new E.Z,this.zIndex=n,this._asynchronous=r}function wA(e,t,i){this._items=[],this._orderedGroundPrimitives=e,this._classificationType=t,this._asynchronous=(0,m.Z)(i,!0)}wC.prototype.onMaterialChanged=function(){this.invalidated=!0},wC.prototype.isMaterial=function(e){let t=this.materialProperty,i=e.fillMaterialProperty;return i===t||i instanceof ny.Z&&t instanceof ny.Z||(0,_.Z)(t)&&t.equals(i)},wC.prototype.add=function(e,t,i){let n=t.id;if(this.updaters.set(n,t),this.geometry.set(n,i),t.hasConstantFill&&t.fillMaterialProperty.isConstant&&L.Z.isConstant(t.distanceDisplayConditionProperty)){let e=this;this.subscriptions.set(n,t.entity.definitionChanged.addEventListener(function(i,n,r,o){"isShowing"===n&&e.showsUpdated.set(t.id,t)}))}else this.updatersWithAttributes.set(n,t);this.createPrimitive=!0},wC.prototype.remove=function(e){let t=e.id;if(this.createPrimitive=this.geometry.remove(t)||this.createPrimitive,this.updaters.remove(t)){this.updatersWithAttributes.remove(t);let e=this.subscriptions.get(t);return(0,_.Z)(e)&&(e(),this.subscriptions.remove(t)),!0}return!1},wC.prototype.update=function(e){let t,i=!0,n=this.primitive,r=this.orderedGroundPrimitives,o=this.geometry.values;if(this.createPrimitive){if(o.length>0)(0,_.Z)(n)&&((0,_.Z)(this.oldPrimitive)?r.remove(n):this.oldPrimitive=n),n=new y.Z({show:!1,asynchronous:this._asynchronous,geometryInstances:o.slice(),appearance:new this.appearanceType,classificationType:this.classificationType}),this.appearanceType===x6.Z&&(this.material=nO.getValue(e,this.materialProperty,this.material),n.appearance.material=this.material),r.add(n,this.zIndex),i=!1;else{(0,_.Z)(n)&&(r.remove(n),n=void 0);let e=this.oldPrimitive;(0,_.Z)(e)&&(r.remove(e),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=n,this.createPrimitive=!1}else if((0,_.Z)(n)&&n.ready){n.show=!0,(0,_.Z)(this.oldPrimitive)&&(r.remove(this.oldPrimitive),this.oldPrimitive=void 0),this.appearanceType===x6.Z&&(this.material=nO.getValue(e,this.materialProperty,this.material),this.primitive.appearance.material=this.material);let i=this.updatersWithAttributes.values,o=i.length;for(t=0;t<o;t++){let r=i[t],o=r.entity,a=this.geometry.get(r.id),s=this.attributes.get(a.id.id);if((0,_.Z)(s)||(s=n.getGeometryInstanceAttributes(a.id),this.attributes.set(a.id.id,s)),!r.fillMaterialProperty.isConstant){let t=r.fillMaterialProperty.color,i=L.Z.getValueOrDefault(t,e,C.Z.WHITE,wx);C.Z.equals(s._lastColor,i)||(s._lastColor=C.Z.clone(i,s._lastColor),s.color=nE.Z.toValue(i,s.color))}let l=o.isShowing&&(r.hasConstantFill||r.isFilled(e));l!==(1===s.show[0])&&(s.show=nA.Z.toValue(l,s.show));let c=r.distanceDisplayConditionProperty;if(!L.Z.isConstant(c)){let t=L.Z.getValueOrDefault(c,e,wS,ww);I.Z.equals(t,s._lastDistanceDisplayCondition)||(s._lastDistanceDisplayCondition=I.Z.clone(t,s._lastDistanceDisplayCondition),s.distanceDisplayCondition=nx.toValue(t,s.distanceDisplayCondition))}}this.updateShows(n)}else(0,_.Z)(n)&&!n.ready&&(i=!1);return i},wC.prototype.updateShows=function(e){let t=this.showsUpdated.values,i=t.length;for(let n=0;n<i;n++){let i=t[n],r=i.entity,o=this.geometry.get(i.id),a=this.attributes.get(o.id.id);(0,_.Z)(a)||(a=e.getGeometryInstanceAttributes(o.id),this.attributes.set(o.id.id,a));let s=r.isShowing;s!==(1===a.show[0])&&(a.show=nA.Z.toValue(s,a.show),o.attributes.show.value[0]=a.show[0])}this.showsUpdated.removeAll()},wC.prototype.contains=function(e){return this.updaters.contains(e.id)},wC.prototype.getBoundingSphere=function(e,t){let i=this.primitive;if(!i.ready)return N.PENDING;let n=i.getGeometryInstanceAttributes(e.entity);return!(0,_.Z)(n)||!(0,_.Z)(n.boundingSphere)||(0,_.Z)(n.show)&&0===n.show[0]?N.FAILED:(n.boundingSphere.clone(t),N.DONE)},wC.prototype.destroy=function(){let e=this.primitive,t=this.orderedGroundPrimitives;(0,_.Z)(e)&&t.remove(e);let i=this.oldPrimitive;(0,_.Z)(i)&&t.remove(i),this.removeMaterialSubscription()},wA.prototype.add=function(e,t){let i=this._items,n=i.length,r=t.createFillGeometryInstance(e),o=L.Z.getValueOrDefault(t.zIndex,0);for(let a=0;a<n;++a){let n=i[a];if(n.isMaterial(t)&&n.zIndex===o){n.add(e,t,r);return}}let a=new wC(this._orderedGroundPrimitives,this._classificationType,t.fillMaterialProperty,o,this._asynchronous);a.add(e,t,r),i.push(a)},wA.prototype.remove=function(e){let t=this._items,i=t.length;for(let n=i-1;n>=0;n--){let i=t[n];if(i.remove(e)){0===i.updaters.length&&(t.splice(n,1),i.destroy());break}}},wA.prototype.update=function(e){let t;let i=this._items;for(t=i.length-1;t>=0;t--){let n=i[t];if(n.invalidated){i.splice(t,1);let r=n.updaters.values,o=r.length;for(let t=0;t<o;t++)this.add(e,r[t]);n.destroy()}}let n=!0;for(t=0;t<i.length;t++)n=i[t].update(e)&&n;return n},wA.prototype.getBoundingSphere=function(e,t){let i=this._items,n=i.length;for(let r=0;r<n;r++){let n=i[r];if(n.contains(e))return n.getBoundingSphere(e,t)}return N.FAILED},wA.prototype.removeAllPrimitives=function(){let e=this._items,t=e.length;for(let i=0;i<t;i++)e[i].destroy();this._items.length=0};let wI=[];function wO(e,t){let i=e._batches,n=i.length;for(let e=0;e<n;e++)i[e].remove(t)}function wD(e,t,i){let n,r;if(i.isDynamic){e._dynamicBatch.add(t,i);return}if(i.clampToGround&&i.fillEnabled){let n=i.classificationTypeProperty.getValue(t);e._groundBatches[n].add(t,i);return}i.fillEnabled&&(n=i.shadowsProperty.getValue(t));let o=0;(0,_.Z)(i.depthFailMaterialProperty)&&(o=i.depthFailMaterialProperty instanceof ny.Z?1:2),(0,_.Z)(n)&&(r=n+o*nZ.Z.NUMBER_OF_SHADOW_MODES),i.fillEnabled&&(i.fillMaterialProperty instanceof ny.Z?e._colorBatches[r].add(t,i):e._materialBatches[r].add(t,i))}function wP(e,t,i,n){let r;p.Z.defined("scene",e),p.Z.defined("entityCollection",t),n=(0,m.Z)(n,e.groundPrimitives),i=(0,m.Z)(i,e.primitives),this._scene=e,this._primitives=i,this._entityCollection=void 0,this._addedObjects=new E.Z,this._removedObjects=new E.Z,this._changedObjects=new E.Z;let o=nZ.Z.NUMBER_OF_SHADOW_MODES;for(r=0,this._colorBatches=Array(3*o),this._materialBatches=Array(3*o);r<o;++r)this._colorBatches[r]=new cS(i,x8.Z,void 0,!1,r),this._materialBatches[r]=new cz(i,x6.Z,void 0,!1,r),this._colorBatches[r+o]=new cS(i,x8.Z,x8.Z,!1,r),this._materialBatches[r+o]=new cz(i,x6.Z,x8.Z,!1,r),this._colorBatches[r+2*o]=new cS(i,x8.Z,x6.Z,!1,r),this._materialBatches[r+2*o]=new cz(i,x6.Z,x6.Z,!1,r);this._dynamicBatch=new nb(i,n);let a=nd.Z.NUMBER_OF_CLASSIFICATION_TYPES;for(r=0,this._groundBatches=Array(a);r<a;++r)this._groundBatches[r]=new wA(n,r);this._batches=this._colorBatches.concat(this._materialBatches,this._dynamicBatch,this._groundBatches),this._subscriptions=new E.Z,this._updaters=new E.Z,this._entityCollection=t,t.collectionChanged.addEventListener(wP.prototype._onCollectionChanged,this),this._onCollectionChanged(t,t.values,wI)}wP.prototype.update=function(e){let t,i,n,r;p.Z.defined("time",e);let o=this._addedObjects,a=o.values,s=this._removedObjects,l=s.values,c=this._changedObjects,u=c.values;for(t=u.length-1;t>-1;t--)n=(i=u[t]).id,(r=this._updaters.get(n)).entity===i?(wO(this,r),wD(this,e,r)):(l.push(i),a.push(i));for(t=l.length-1;t>-1;t--)n=(i=l[t]).id,wO(this,r=this._updaters.get(n)),r.destroy(),this._updaters.remove(n),this._subscriptions.get(n)(),this._subscriptions.remove(n);for(t=a.length-1;t>-1;t--)n=(i=a[t]).id,r=new wb(i,this._scene),this._updaters.set(n,r),wD(this,e,r),this._subscriptions.set(n,r.geometryChanged.addEventListener(wP._onGeometryChanged,this));o.removeAll(),s.removeAll(),c.removeAll();let h=!0,d=this._batches,f=d.length;for(t=0;t<f;t++)h=d[t].update(e)&&h;return h};let wR=[],wN=new f.Z;function wL(e){let t,i;p.Z.typeOf.object("options",e),p.Z.typeOf.object("options.scene",e.scene),p.Z.typeOf.object("options.dataSourceCollection",e.dataSourceCollection),b.Z.initializeTerrainHeights(),y.Z.initializeTerrainHeights();let n=e.scene,r=e.dataSourceCollection;this._eventHelper=new Z.Z,this._eventHelper.add(r.dataSourceAdded,this._onDataSourceAdded,this),this._eventHelper.add(r.dataSourceRemoved,this._onDataSourceRemoved,this),this._eventHelper.add(r.dataSourceMoved,this._onDataSourceMoved,this),this._eventHelper.add(n.postRender,this._postRender,this),this._dataSourceCollection=r,this._scene=n,this._visualizersCallback=(0,m.Z)(e.visualizersCallback,wL.defaultVisualizersCallback);let o=!1,a=new v.Z,s=new v.Z;r.length>0&&(n.primitives.add(a),n.groundPrimitives.add(s),o=!0),this._primitives=a,this._groundPrimitives=s;for(let e=0,t=r.length;e<t;e++)this._onDataSourceAdded(r,r.get(e));let l=new nh;if(this._onDataSourceAdded(void 0,l),this._defaultDataSource=l,!o){let e=this,o=function(){n.primitives.add(a),n.groundPrimitives.add(s),t(),i(),e._removeDefaultDataSourceListener=void 0,e._removeDataSourceCollectionListener=void 0};t=l.entities.collectionChanged.addEventListener(o),i=r.dataSourceAdded.addEventListener(o)}this._removeDefaultDataSourceListener=t,this._removeDataSourceCollectionListener=i,this._ready=!1}wP.prototype.getBoundingSphere=function(e,t){p.Z.defined("entity",e),p.Z.defined("result",t);let i=0,n=N.DONE,r=this._batches,o=r.length,a=this._updaters.get(e.id);for(let e=0;e<o;e++){if((n=r[e].getBoundingSphere(a,wN))===N.PENDING)return N.PENDING;n===N.DONE&&(wR[i]=f.Z.clone(wN,wR[i]),i++)}return 0===i?N.FAILED:(wR.length=i,f.Z.fromBoundingSpheres(wR,t),N.DONE)},wP.prototype.isDestroyed=function(){return!1},wP.prototype.destroy=function(){let e;this._entityCollection.collectionChanged.removeEventListener(wP.prototype._onCollectionChanged,this),this._addedObjects.removeAll(),this._removedObjects.removeAll();let t=this._batches,i=t.length;for(e=0;e<i;e++)t[e].removeAllPrimitives();let n=this._subscriptions.values;for(e=0,i=n.length;e<i;e++)n[e]();return this._subscriptions.removeAll(),(0,g.Z)(this)},wP._onGeometryChanged=function(e){let t=this._removedObjects,i=this._changedObjects,n=e.entity,r=n.id;(0,_.Z)(t.get(r))||(0,_.Z)(i.get(r))||i.set(r,n)},wP.prototype._onCollectionChanged=function(e,t,i){let n,r,o;let a=this._addedObjects,s=this._removedObjects,l=this._changedObjects;for(n=i.length-1;n>-1;n--)r=(o=i[n]).id,a.remove(r)||(s.set(r,o),l.remove(r));for(n=t.length-1;n>-1;n--)r=(o=t[n]).id,s.remove(r)?l.set(r,o):a.set(r,o)};let wM=[];wL.registerVisualizer=function(e){wM.includes(e)||wM.push(e)},wL.unregisterVisualizer=function(e){if(wM.includes(e)){let t=wM.indexOf(e);wM.splice(t,1)}},wL.defaultVisualizersCallback=function(e,t,i){let n=i.entities;return[new J(t,n),new c7(e,n,i._primitives,i._groundPrimitives),new ux(t,n),new yg(e,n),new x_(e,n),new x5(t,n),new xX(e,n),new wP(e,n,i._primitives,i._groundPrimitives),...wM.map(t=>new t(e,n))]},Object.defineProperties(wL.prototype,{scene:{get:function(){return this._scene}},dataSources:{get:function(){return this._dataSourceCollection}},defaultDataSource:{get:function(){return this._defaultDataSource}},ready:{get:function(){return this._ready}}}),wL.prototype.isDestroyed=function(){return!1},wL.prototype.destroy=function(){this._eventHelper.removeAll();let e=this._dataSourceCollection;for(let t=0,i=e.length;t<i;++t)this._onDataSourceRemoved(this._dataSourceCollection,e.get(t));return this._onDataSourceRemoved(void 0,this._defaultDataSource),(0,_.Z)(this._removeDefaultDataSourceListener)?(this._removeDefaultDataSourceListener(),this._removeDataSourceCollectionListener()):(this._scene.primitives.remove(this._primitives),this._scene.groundPrimitives.remove(this._groundPrimitives)),(0,g.Z)(this)},wL.prototype.update=function(e){let t,i,n,r;if(p.Z.defined("time",e),!d.Z.initialized)return this._ready=!1,!1;let o=!0,a=this._dataSourceCollection,s=a.length;for(t=0;t<s;t++){let s=a.get(t);for((0,_.Z)(s.update)&&(o=s.update(e)&&o),r=(n=s._visualizers).length,i=0;i<r;i++)o=n[i].update(e)&&o}for(i=0,r=(n=this._defaultDataSource._visualizers).length;i<r;i++)o=n[i].update(e)&&o;return!this._ready&&o&&this._scene.requestRender(),this._ready=o,o},wL.prototype._postRender=function(){let e=this._scene.frameState,t=this._dataSourceCollection,i=t.length;for(let n=0;n<i;n++){let i=t.get(n),r=i.credit;(0,_.Z)(r)&&e.creditDisplay.addCreditToNextFrame(r);let o=i._resourceCredits;if((0,_.Z)(o)){let t=o.length;for(let i=0;i<t;i++)e.creditDisplay.addCreditToNextFrame(o[i])}}};let wF=[],wz=new f.Z;wL.prototype.getBoundingSphere=function(e,t,i){let n,r;if(p.Z.defined("entity",e),p.Z.typeOf.bool("allowPartial",t),p.Z.defined("result",i),!this._ready)return N.PENDING;let o=this._defaultDataSource;if(!o.entities.contains(e)){o=void 0;let t=this._dataSourceCollection;for(n=0,r=t.length;n<r;n++){let i=t.get(n);if(i.entities.contains(e)){o=i;break}}}if(!(0,_.Z)(o))return N.FAILED;let a=0,s=N.DONE,l=o._visualizers,c=l.length;for(n=0;n<c;n++){let i=l[n];if((0,_.Z)(i.getBoundingSphere)){if(s=l[n].getBoundingSphere(e,wz),!t&&s===N.PENDING)return N.PENDING;s===N.DONE&&(wF[a]=f.Z.clone(wz,wF[a]),a++)}}return 0===a?N.FAILED:(wF.length=a,f.Z.fromBoundingSpheres(wF,i),N.DONE)},wL.prototype._onDataSourceAdded=function(e,t){let i=this._scene,n=this._primitives,r=this._groundPrimitives,o=n.add(new v.Z),a=r.add(new T);t._primitives=o,t._groundPrimitives=a;let s=t.clustering;s._initialize(i),o.add(s),t._visualizers=this._visualizersCallback(i,s,t)},wL.prototype._onDataSourceRemoved=function(e,t){let i=this._primitives,n=this._groundPrimitives,r=t._primitives,o=t._groundPrimitives,a=t.clustering;r.remove(a);let s=t._visualizers,l=s.length;for(let e=0;e<l;e++)s[e].destroy();i.remove(r),n.remove(o),t._visualizers=void 0},wL.prototype._onDataSourceMoved=function(e,t,i){let n=this._primitives,r=this._groundPrimitives,o=e._primitives,a=e._groundPrimitives;t===i+1?(n.raise(o),r.raise(a)):t===i-1?(n.lower(o),r.lower(a)):0===t?(n.lowerToBottom(o),r.lowerToBottom(a),n.raise(o),r.raise(a)):(n.raiseToTop(o),r.raiseToTop(a))};var wB=wL},3602:function(e,t,i){"use strict";i.d(t,{Z:function(){return eo}});var n,r=i(1486),o=i(2820),a=i(698),s=i(530),l=i(4572),c=i(9410),u=i(9824),h=i(2198),d=i(2150),f=i(3186),p=i(4749),m=i(3578),_=i(7119),g=i(6900),Z=i(3650),y=i(9386),b=i(8424);function v(e){this._definitionChanged=new h.Z,this._show=void 0,this._showSubscription=void 0,this._image=void 0,this._imageSubscription=void 0,this._scale=void 0,this._scaleSubscription=void 0,this._pixelOffset=void 0,this._pixelOffsetSubscription=void 0,this._eyeOffset=void 0,this._eyeOffsetSubscription=void 0,this._horizontalOrigin=void 0,this._horizontalOriginSubscription=void 0,this._verticalOrigin=void 0,this._verticalOriginSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._color=void 0,this._colorSubscription=void 0,this._rotation=void 0,this._rotationSubscription=void 0,this._alignedAxis=void 0,this._alignedAxisSubscription=void 0,this._sizeInMeters=void 0,this._sizeInMetersSubscription=void 0,this._width=void 0,this._widthSubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._scaleByDistance=void 0,this._scaleByDistanceSubscription=void 0,this._translucencyByDistance=void 0,this._translucencyByDistanceSubscription=void 0,this._pixelOffsetScaleByDistance=void 0,this._pixelOffsetScaleByDistanceSubscription=void 0,this._imageSubRegion=void 0,this._imageSubRegionSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._disableDepthTestDistance=void 0,this._disableDepthTestDistanceSubscription=void 0,this.merge((0,l.Z)(e,l.Z.EMPTY_OBJECT))}Object.defineProperties(v.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:(0,b.Z)("show"),image:(0,b.Z)("image"),scale:(0,b.Z)("scale"),pixelOffset:(0,b.Z)("pixelOffset"),eyeOffset:(0,b.Z)("eyeOffset"),horizontalOrigin:(0,b.Z)("horizontalOrigin"),verticalOrigin:(0,b.Z)("verticalOrigin"),heightReference:(0,b.Z)("heightReference"),color:(0,b.Z)("color"),rotation:(0,b.Z)("rotation"),alignedAxis:(0,b.Z)("alignedAxis"),sizeInMeters:(0,b.Z)("sizeInMeters"),width:(0,b.Z)("width"),height:(0,b.Z)("height"),scaleByDistance:(0,b.Z)("scaleByDistance"),translucencyByDistance:(0,b.Z)("translucencyByDistance"),pixelOffsetScaleByDistance:(0,b.Z)("pixelOffsetScaleByDistance"),imageSubRegion:(0,b.Z)("imageSubRegion"),distanceDisplayCondition:(0,b.Z)("distanceDisplayCondition"),disableDepthTestDistance:(0,b.Z)("disableDepthTestDistance")}),v.prototype.clone=function(e){return(0,c.Z)(e)?(e.show=this._show,e.image=this._image,e.scale=this._scale,e.pixelOffset=this._pixelOffset,e.eyeOffset=this._eyeOffset,e.horizontalOrigin=this._horizontalOrigin,e.verticalOrigin=this._verticalOrigin,e.heightReference=this._heightReference,e.color=this._color,e.rotation=this._rotation,e.alignedAxis=this._alignedAxis,e.sizeInMeters=this._sizeInMeters,e.width=this._width,e.height=this._height,e.scaleByDistance=this._scaleByDistance,e.translucencyByDistance=this._translucencyByDistance,e.pixelOffsetScaleByDistance=this._pixelOffsetScaleByDistance,e.imageSubRegion=this._imageSubRegion,e.distanceDisplayCondition=this._distanceDisplayCondition,e.disableDepthTestDistance=this._disableDepthTestDistance,e):new v(this)},v.prototype.merge=function(e){if(!(0,c.Z)(e))throw new u.Z("source is required.");this.show=(0,l.Z)(this._show,e.show),this.image=(0,l.Z)(this._image,e.image),this.scale=(0,l.Z)(this._scale,e.scale),this.pixelOffset=(0,l.Z)(this._pixelOffset,e.pixelOffset),this.eyeOffset=(0,l.Z)(this._eyeOffset,e.eyeOffset),this.horizontalOrigin=(0,l.Z)(this._horizontalOrigin,e.horizontalOrigin),this.verticalOrigin=(0,l.Z)(this._verticalOrigin,e.verticalOrigin),this.heightReference=(0,l.Z)(this._heightReference,e.heightReference),this.color=(0,l.Z)(this._color,e.color),this.rotation=(0,l.Z)(this._rotation,e.rotation),this.alignedAxis=(0,l.Z)(this._alignedAxis,e.alignedAxis),this.sizeInMeters=(0,l.Z)(this._sizeInMeters,e.sizeInMeters),this.width=(0,l.Z)(this._width,e.width),this.height=(0,l.Z)(this._height,e.height),this.scaleByDistance=(0,l.Z)(this._scaleByDistance,e.scaleByDistance),this.translucencyByDistance=(0,l.Z)(this._translucencyByDistance,e.translucencyByDistance),this.pixelOffsetScaleByDistance=(0,l.Z)(this._pixelOffsetScaleByDistance,e.pixelOffsetScaleByDistance),this.imageSubRegion=(0,l.Z)(this._imageSubRegion,e.imageSubRegion),this.distanceDisplayCondition=(0,l.Z)(this._distanceDisplayCondition,e.distanceDisplayCondition),this.disableDepthTestDistance=(0,l.Z)(this._disableDepthTestDistance,e.disableDepthTestDistance)};var T=i(6729);function E(e){this._definitionChanged=new h.Z,this._show=void 0,this._showSubscription=void 0,this._dimensions=void 0,this._dimensionsSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this.merge((0,l.Z)(e,l.Z.EMPTY_OBJECT))}Object.defineProperties(E.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:(0,b.Z)("show"),dimensions:(0,b.Z)("dimensions"),heightReference:(0,b.Z)("heightReference"),fill:(0,b.Z)("fill"),material:(0,T.Z)("material"),outline:(0,b.Z)("outline"),outlineColor:(0,b.Z)("outlineColor"),outlineWidth:(0,b.Z)("outlineWidth"),shadows:(0,b.Z)("shadows"),distanceDisplayCondition:(0,b.Z)("distanceDisplayCondition")}),E.prototype.clone=function(e){return(0,c.Z)(e)?(e.show=this.show,e.dimensions=this.dimensions,e.heightReference=this.heightReference,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new E(this)},E.prototype.merge=function(e){if(!(0,c.Z)(e))throw new u.Z("source is required.");this.show=(0,l.Z)(this.show,e.show),this.dimensions=(0,l.Z)(this.dimensions,e.dimensions),this.heightReference=(0,l.Z)(this.heightReference,e.heightReference),this.fill=(0,l.Z)(this.fill,e.fill),this.material=(0,l.Z)(this.material,e.material),this.outline=(0,l.Z)(this.outline,e.outline),this.outlineColor=(0,l.Z)(this.outlineColor,e.outlineColor),this.outlineWidth=(0,l.Z)(this.outlineWidth,e.outlineWidth),this.shadows=(0,l.Z)(this.shadows,e.shadows),this.distanceDisplayCondition=(0,l.Z)(this.distanceDisplayCondition,e.distanceDisplayCondition)};var x=i(1949);function w(e){this._definitionChanged=new h.Z,this._show=void 0,this._showSubscription=void 0,this._positions=void 0,this._positionsSubscription=void 0,this._width=void 0,this._widthSubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._extrudedHeight=void 0,this._extrudedHeightSubscription=void 0,this._extrudedHeightReference=void 0,this._extrudedHeightReferenceSubscription=void 0,this._cornerType=void 0,this._cornerTypeSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._classificationType=void 0,this._classificationTypeSubscription=void 0,this._zIndex=void 0,this._zIndexSubscription=void 0,this.merge((0,l.Z)(e,l.Z.EMPTY_OBJECT))}function S(e){return e}Object.defineProperties(w.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:(0,b.Z)("show"),positions:(0,b.Z)("positions"),width:(0,b.Z)("width"),height:(0,b.Z)("height"),heightReference:(0,b.Z)("heightReference"),extrudedHeight:(0,b.Z)("extrudedHeight"),extrudedHeightReference:(0,b.Z)("extrudedHeightReference"),cornerType:(0,b.Z)("cornerType"),granularity:(0,b.Z)("granularity"),fill:(0,b.Z)("fill"),material:(0,T.Z)("material"),outline:(0,b.Z)("outline"),outlineColor:(0,b.Z)("outlineColor"),outlineWidth:(0,b.Z)("outlineWidth"),shadows:(0,b.Z)("shadows"),distanceDisplayCondition:(0,b.Z)("distanceDisplayCondition"),classificationType:(0,b.Z)("classificationType"),zIndex:(0,b.Z)("zIndex")}),w.prototype.clone=function(e){return(0,c.Z)(e)?(e.show=this.show,e.positions=this.positions,e.width=this.width,e.height=this.height,e.heightReference=this.heightReference,e.extrudedHeight=this.extrudedHeight,e.extrudedHeightReference=this.extrudedHeightReference,e.cornerType=this.cornerType,e.granularity=this.granularity,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e.classificationType=this.classificationType,e.zIndex=this.zIndex,e):new w(this)},w.prototype.merge=function(e){if(!(0,c.Z)(e))throw new u.Z("source is required.");this.show=(0,l.Z)(this.show,e.show),this.positions=(0,l.Z)(this.positions,e.positions),this.width=(0,l.Z)(this.width,e.width),this.height=(0,l.Z)(this.height,e.height),this.heightReference=(0,l.Z)(this.heightReference,e.heightReference),this.extrudedHeight=(0,l.Z)(this.extrudedHeight,e.extrudedHeight),this.extrudedHeightReference=(0,l.Z)(this.extrudedHeightReference,e.extrudedHeightReference),this.cornerType=(0,l.Z)(this.cornerType,e.cornerType),this.granularity=(0,l.Z)(this.granularity,e.granularity),this.fill=(0,l.Z)(this.fill,e.fill),this.material=(0,l.Z)(this.material,e.material),this.outline=(0,l.Z)(this.outline,e.outline),this.outlineColor=(0,l.Z)(this.outlineColor,e.outlineColor),this.outlineWidth=(0,l.Z)(this.outlineWidth,e.outlineWidth),this.shadows=(0,l.Z)(this.shadows,e.shadows),this.distanceDisplayCondition=(0,l.Z)(this.distanceDisplayCondition,e.distanceDisplayCondition),this.classificationType=(0,l.Z)(this.classificationType,e.classificationType),this.zIndex=(0,l.Z)(this.zIndex,e.zIndex)};var C=function(e,t){return(0,b.Z)(e,t,S)};function A(e){this._definitionChanged=new h.Z,this._show=void 0,this._showSubscription=void 0,this._length=void 0,this._lengthSubscription=void 0,this._topRadius=void 0,this._topRadiusSubscription=void 0,this._bottomRadius=void 0,this._bottomRadiusSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._numberOfVerticalLines=void 0,this._numberOfVerticalLinesSubscription=void 0,this._slices=void 0,this._slicesSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this.merge((0,l.Z)(e,l.Z.EMPTY_OBJECT))}function I(e){this._definitionChanged=new h.Z,this._show=void 0,this._showSubscription=void 0,this._semiMajorAxis=void 0,this._semiMajorAxisSubscription=void 0,this._semiMinorAxis=void 0,this._semiMinorAxisSubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._extrudedHeight=void 0,this._extrudedHeightSubscription=void 0,this._extrudedHeightReference=void 0,this._extrudedHeightReferenceSubscription=void 0,this._rotation=void 0,this._rotationSubscription=void 0,this._stRotation=void 0,this._stRotationSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._numberOfVerticalLines=void 0,this._numberOfVerticalLinesSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._classificationType=void 0,this._classificationTypeSubscription=void 0,this._zIndex=void 0,this._zIndexSubscription=void 0,this.merge((0,l.Z)(e,l.Z.EMPTY_OBJECT))}function O(e){this._definitionChanged=new h.Z,this._show=void 0,this._showSubscription=void 0,this._radii=void 0,this._radiiSubscription=void 0,this._innerRadii=void 0,this._innerRadiiSubscription=void 0,this._minimumClock=void 0,this._minimumClockSubscription=void 0,this._maximumClock=void 0,this._maximumClockSubscription=void 0,this._minimumCone=void 0,this._minimumConeSubscription=void 0,this._maximumCone=void 0,this._maximumConeSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._stackPartitions=void 0,this._stackPartitionsSubscription=void 0,this._slicePartitions=void 0,this._slicePartitionsSubscription=void 0,this._subdivisions=void 0,this._subdivisionsSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this.merge((0,l.Z)(e,l.Z.EMPTY_OBJECT))}function D(e){this._definitionChanged=new h.Z,this._show=void 0,this._showSubscription=void 0,this._text=void 0,this._textSubscription=void 0,this._font=void 0,this._fontSubscription=void 0,this._style=void 0,this._styleSubscription=void 0,this._scale=void 0,this._scaleSubscription=void 0,this._showBackground=void 0,this._showBackgroundSubscription=void 0,this._backgroundColor=void 0,this._backgroundColorSubscription=void 0,this._backgroundPadding=void 0,this._backgroundPaddingSubscription=void 0,this._pixelOffset=void 0,this._pixelOffsetSubscription=void 0,this._eyeOffset=void 0,this._eyeOffsetSubscription=void 0,this._horizontalOrigin=void 0,this._horizontalOriginSubscription=void 0,this._verticalOrigin=void 0,this._verticalOriginSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._fillColor=void 0,this._fillColorSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._translucencyByDistance=void 0,this._translucencyByDistanceSubscription=void 0,this._pixelOffsetScaleByDistance=void 0,this._pixelOffsetScaleByDistanceSubscription=void 0,this._scaleByDistance=void 0,this._scaleByDistanceSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._disableDepthTestDistance=void 0,this._disableDepthTestDistanceSubscription=void 0,this.merge((0,l.Z)(e,l.Z.EMPTY_OBJECT))}Object.defineProperties(A.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:(0,b.Z)("show"),length:(0,b.Z)("length"),topRadius:(0,b.Z)("topRadius"),bottomRadius:(0,b.Z)("bottomRadius"),heightReference:(0,b.Z)("heightReference"),fill:(0,b.Z)("fill"),material:(0,T.Z)("material"),outline:(0,b.Z)("outline"),outlineColor:(0,b.Z)("outlineColor"),outlineWidth:(0,b.Z)("outlineWidth"),numberOfVerticalLines:(0,b.Z)("numberOfVerticalLines"),slices:(0,b.Z)("slices"),shadows:(0,b.Z)("shadows"),distanceDisplayCondition:(0,b.Z)("distanceDisplayCondition")}),A.prototype.clone=function(e){return(0,c.Z)(e)?(e.show=this.show,e.length=this.length,e.topRadius=this.topRadius,e.bottomRadius=this.bottomRadius,e.heightReference=this.heightReference,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.numberOfVerticalLines=this.numberOfVerticalLines,e.slices=this.slices,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new A(this)},A.prototype.merge=function(e){if(!(0,c.Z)(e))throw new u.Z("source is required.");this.show=(0,l.Z)(this.show,e.show),this.length=(0,l.Z)(this.length,e.length),this.topRadius=(0,l.Z)(this.topRadius,e.topRadius),this.bottomRadius=(0,l.Z)(this.bottomRadius,e.bottomRadius),this.heightReference=(0,l.Z)(this.heightReference,e.heightReference),this.fill=(0,l.Z)(this.fill,e.fill),this.material=(0,l.Z)(this.material,e.material),this.outline=(0,l.Z)(this.outline,e.outline),this.outlineColor=(0,l.Z)(this.outlineColor,e.outlineColor),this.outlineWidth=(0,l.Z)(this.outlineWidth,e.outlineWidth),this.numberOfVerticalLines=(0,l.Z)(this.numberOfVerticalLines,e.numberOfVerticalLines),this.slices=(0,l.Z)(this.slices,e.slices),this.shadows=(0,l.Z)(this.shadows,e.shadows),this.distanceDisplayCondition=(0,l.Z)(this.distanceDisplayCondition,e.distanceDisplayCondition)},Object.defineProperties(I.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:(0,b.Z)("show"),semiMajorAxis:(0,b.Z)("semiMajorAxis"),semiMinorAxis:(0,b.Z)("semiMinorAxis"),height:(0,b.Z)("height"),heightReference:(0,b.Z)("heightReference"),extrudedHeight:(0,b.Z)("extrudedHeight"),extrudedHeightReference:(0,b.Z)("extrudedHeightReference"),rotation:(0,b.Z)("rotation"),stRotation:(0,b.Z)("stRotation"),granularity:(0,b.Z)("granularity"),fill:(0,b.Z)("fill"),material:(0,T.Z)("material"),outline:(0,b.Z)("outline"),outlineColor:(0,b.Z)("outlineColor"),outlineWidth:(0,b.Z)("outlineWidth"),numberOfVerticalLines:(0,b.Z)("numberOfVerticalLines"),shadows:(0,b.Z)("shadows"),distanceDisplayCondition:(0,b.Z)("distanceDisplayCondition"),classificationType:(0,b.Z)("classificationType"),zIndex:(0,b.Z)("zIndex")}),I.prototype.clone=function(e){return(0,c.Z)(e)?(e.show=this.show,e.semiMajorAxis=this.semiMajorAxis,e.semiMinorAxis=this.semiMinorAxis,e.height=this.height,e.heightReference=this.heightReference,e.extrudedHeight=this.extrudedHeight,e.extrudedHeightReference=this.extrudedHeightReference,e.rotation=this.rotation,e.stRotation=this.stRotation,e.granularity=this.granularity,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.numberOfVerticalLines=this.numberOfVerticalLines,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e.classificationType=this.classificationType,e.zIndex=this.zIndex,e):new I(this)},I.prototype.merge=function(e){if(!(0,c.Z)(e))throw new u.Z("source is required.");this.show=(0,l.Z)(this.show,e.show),this.semiMajorAxis=(0,l.Z)(this.semiMajorAxis,e.semiMajorAxis),this.semiMinorAxis=(0,l.Z)(this.semiMinorAxis,e.semiMinorAxis),this.height=(0,l.Z)(this.height,e.height),this.heightReference=(0,l.Z)(this.heightReference,e.heightReference),this.extrudedHeight=(0,l.Z)(this.extrudedHeight,e.extrudedHeight),this.extrudedHeightReference=(0,l.Z)(this.extrudedHeightReference,e.extrudedHeightReference),this.rotation=(0,l.Z)(this.rotation,e.rotation),this.stRotation=(0,l.Z)(this.stRotation,e.stRotation),this.granularity=(0,l.Z)(this.granularity,e.granularity),this.fill=(0,l.Z)(this.fill,e.fill),this.material=(0,l.Z)(this.material,e.material),this.outline=(0,l.Z)(this.outline,e.outline),this.outlineColor=(0,l.Z)(this.outlineColor,e.outlineColor),this.outlineWidth=(0,l.Z)(this.outlineWidth,e.outlineWidth),this.numberOfVerticalLines=(0,l.Z)(this.numberOfVerticalLines,e.numberOfVerticalLines),this.shadows=(0,l.Z)(this.shadows,e.shadows),this.distanceDisplayCondition=(0,l.Z)(this.distanceDisplayCondition,e.distanceDisplayCondition),this.classificationType=(0,l.Z)(this.classificationType,e.classificationType),this.zIndex=(0,l.Z)(this.zIndex,e.zIndex)},Object.defineProperties(O.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:(0,b.Z)("show"),radii:(0,b.Z)("radii"),innerRadii:(0,b.Z)("innerRadii"),minimumClock:(0,b.Z)("minimumClock"),maximumClock:(0,b.Z)("maximumClock"),minimumCone:(0,b.Z)("minimumCone"),maximumCone:(0,b.Z)("maximumCone"),heightReference:(0,b.Z)("heightReference"),fill:(0,b.Z)("fill"),material:(0,T.Z)("material"),outline:(0,b.Z)("outline"),outlineColor:(0,b.Z)("outlineColor"),outlineWidth:(0,b.Z)("outlineWidth"),stackPartitions:(0,b.Z)("stackPartitions"),slicePartitions:(0,b.Z)("slicePartitions"),subdivisions:(0,b.Z)("subdivisions"),shadows:(0,b.Z)("shadows"),distanceDisplayCondition:(0,b.Z)("distanceDisplayCondition")}),O.prototype.clone=function(e){return(0,c.Z)(e)?(e.show=this.show,e.radii=this.radii,e.innerRadii=this.innerRadii,e.minimumClock=this.minimumClock,e.maximumClock=this.maximumClock,e.minimumCone=this.minimumCone,e.maximumCone=this.maximumCone,e.heightReference=this.heightReference,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.stackPartitions=this.stackPartitions,e.slicePartitions=this.slicePartitions,e.subdivisions=this.subdivisions,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new O(this)},O.prototype.merge=function(e){if(!(0,c.Z)(e))throw new u.Z("source is required.");this.show=(0,l.Z)(this.show,e.show),this.radii=(0,l.Z)(this.radii,e.radii),this.innerRadii=(0,l.Z)(this.innerRadii,e.innerRadii),this.minimumClock=(0,l.Z)(this.minimumClock,e.minimumClock),this.maximumClock=(0,l.Z)(this.maximumClock,e.maximumClock),this.minimumCone=(0,l.Z)(this.minimumCone,e.minimumCone),this.maximumCone=(0,l.Z)(this.maximumCone,e.maximumCone),this.heightReference=(0,l.Z)(this.heightReference,e.heightReference),this.fill=(0,l.Z)(this.fill,e.fill),this.material=(0,l.Z)(this.material,e.material),this.outline=(0,l.Z)(this.outline,e.outline),this.outlineColor=(0,l.Z)(this.outlineColor,e.outlineColor),this.outlineWidth=(0,l.Z)(this.outlineWidth,e.outlineWidth),this.stackPartitions=(0,l.Z)(this.stackPartitions,e.stackPartitions),this.slicePartitions=(0,l.Z)(this.slicePartitions,e.slicePartitions),this.subdivisions=(0,l.Z)(this.subdivisions,e.subdivisions),this.shadows=(0,l.Z)(this.shadows,e.shadows),this.distanceDisplayCondition=(0,l.Z)(this.distanceDisplayCondition,e.distanceDisplayCondition)},Object.defineProperties(D.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:(0,b.Z)("show"),text:(0,b.Z)("text"),font:(0,b.Z)("font"),style:(0,b.Z)("style"),scale:(0,b.Z)("scale"),showBackground:(0,b.Z)("showBackground"),backgroundColor:(0,b.Z)("backgroundColor"),backgroundPadding:(0,b.Z)("backgroundPadding"),pixelOffset:(0,b.Z)("pixelOffset"),eyeOffset:(0,b.Z)("eyeOffset"),horizontalOrigin:(0,b.Z)("horizontalOrigin"),verticalOrigin:(0,b.Z)("verticalOrigin"),heightReference:(0,b.Z)("heightReference"),fillColor:(0,b.Z)("fillColor"),outlineColor:(0,b.Z)("outlineColor"),outlineWidth:(0,b.Z)("outlineWidth"),translucencyByDistance:(0,b.Z)("translucencyByDistance"),pixelOffsetScaleByDistance:(0,b.Z)("pixelOffsetScaleByDistance"),scaleByDistance:(0,b.Z)("scaleByDistance"),distanceDisplayCondition:(0,b.Z)("distanceDisplayCondition"),disableDepthTestDistance:(0,b.Z)("disableDepthTestDistance")}),D.prototype.clone=function(e){return(0,c.Z)(e)?(e.show=this.show,e.text=this.text,e.font=this.font,e.style=this.style,e.scale=this.scale,e.showBackground=this.showBackground,e.backgroundColor=this.backgroundColor,e.backgroundPadding=this.backgroundPadding,e.pixelOffset=this.pixelOffset,e.eyeOffset=this.eyeOffset,e.horizontalOrigin=this.horizontalOrigin,e.verticalOrigin=this.verticalOrigin,e.heightReference=this.heightReference,e.fillColor=this.fillColor,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.translucencyByDistance=this.translucencyByDistance,e.pixelOffsetScaleByDistance=this.pixelOffsetScaleByDistance,e.scaleByDistance=this.scaleByDistance,e.distanceDisplayCondition=this.distanceDisplayCondition,e.disableDepthTestDistance=this.disableDepthTestDistance,e):new D(this)},D.prototype.merge=function(e){if(!(0,c.Z)(e))throw new u.Z("source is required.");this.show=(0,l.Z)(this.show,e.show),this.text=(0,l.Z)(this.text,e.text),this.font=(0,l.Z)(this.font,e.font),this.style=(0,l.Z)(this.style,e.style),this.scale=(0,l.Z)(this.scale,e.scale),this.showBackground=(0,l.Z)(this.showBackground,e.showBackground),this.backgroundColor=(0,l.Z)(this.backgroundColor,e.backgroundColor),this.backgroundPadding=(0,l.Z)(this.backgroundPadding,e.backgroundPadding),this.pixelOffset=(0,l.Z)(this.pixelOffset,e.pixelOffset),this.eyeOffset=(0,l.Z)(this.eyeOffset,e.eyeOffset),this.horizontalOrigin=(0,l.Z)(this.horizontalOrigin,e.horizontalOrigin),this.verticalOrigin=(0,l.Z)(this.verticalOrigin,e.verticalOrigin),this.heightReference=(0,l.Z)(this.heightReference,e.heightReference),this.fillColor=(0,l.Z)(this.fillColor,e.fillColor),this.outlineColor=(0,l.Z)(this.outlineColor,e.outlineColor),this.outlineWidth=(0,l.Z)(this.outlineWidth,e.outlineWidth),this.translucencyByDistance=(0,l.Z)(this.translucencyByDistance,e.translucencyByDistance),this.pixelOffsetScaleByDistance=(0,l.Z)(this.pixelOffsetScaleByDistance,e.pixelOffsetScaleByDistance),this.scaleByDistance=(0,l.Z)(this.scaleByDistance,e.scaleByDistance),this.distanceDisplayCondition=(0,l.Z)(this.distanceDisplayCondition,e.distanceDisplayCondition),this.disableDepthTestDistance=(0,l.Z)(this.disableDepthTestDistance,e.disableDepthTestDistance)};var P=i(8564),R=i(7570);let N=new P.Z;function L(e){e=(0,l.Z)(e,l.Z.EMPTY_OBJECT),this._definitionChanged=new h.Z,this._translation=void 0,this._translationSubscription=void 0,this._rotation=void 0,this._rotationSubscription=void 0,this._scale=void 0,this._scaleSubscription=void 0,this.translation=e.translation,this.rotation=e.rotation,this.scale=e.scale}Object.defineProperties(L.prototype,{isConstant:{get:function(){return R.Z.isConstant(this._translation)&&R.Z.isConstant(this._rotation)&&R.Z.isConstant(this._scale)}},definitionChanged:{get:function(){return this._definitionChanged}},translation:(0,b.Z)("translation"),rotation:(0,b.Z)("rotation"),scale:(0,b.Z)("scale")}),L.prototype.getValue=function(e,t){return(0,c.Z)(t)||(t=new P.Z),t.translation=R.Z.getValueOrClonedDefault(this._translation,e,N.translation,t.translation),t.rotation=R.Z.getValueOrClonedDefault(this._rotation,e,N.rotation,t.rotation),t.scale=R.Z.getValueOrClonedDefault(this._scale,e,N.scale,t.scale),t},L.prototype.equals=function(e){return this===e||e instanceof L&&R.Z.equals(this._translation,e._translation)&&R.Z.equals(this._rotation,e._rotation)&&R.Z.equals(this._scale,e._scale)};var M=i(109);function F(e,t){this._propertyNames=[],this._definitionChanged=new h.Z,(0,c.Z)(e)&&this.merge(e,t)}function z(e){return new M.Z(e)}function B(e){return new L(e)}function U(e){this._definitionChanged=new h.Z,this._show=void 0,this._showSubscription=void 0,this._uri=void 0,this._uriSubscription=void 0,this._scale=void 0,this._scaleSubscription=void 0,this._minimumPixelSize=void 0,this._minimumPixelSizeSubscription=void 0,this._maximumScale=void 0,this._maximumScaleSubscription=void 0,this._incrementallyLoadTextures=void 0,this._incrementallyLoadTexturesSubscription=void 0,this._runAnimations=void 0,this._runAnimationsSubscription=void 0,this._clampAnimations=void 0,this._clampAnimationsSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._silhouetteColor=void 0,this._silhouetteColorSubscription=void 0,this._silhouetteSize=void 0,this._silhouetteSizeSubscription=void 0,this._color=void 0,this._colorSubscription=void 0,this._colorBlendMode=void 0,this._colorBlendModeSubscription=void 0,this._colorBlendAmount=void 0,this._colorBlendAmountSubscription=void 0,this._imageBasedLightingFactor=void 0,this._imageBasedLightingFactorSubscription=void 0,this._lightColor=void 0,this._lightColorSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._nodeTransformations=void 0,this._nodeTransformationsSubscription=void 0,this._articulations=void 0,this._articulationsSubscription=void 0,this._clippingPlanes=void 0,this._clippingPlanesSubscription=void 0,this._customShader=void 0,this._customShaderSubscription=void 0,this.merge((0,l.Z)(e,l.Z.EMPTY_OBJECT))}function k(e){this._definitionChanged=new h.Z,this._show=void 0,this._showSubscription=void 0,this._uri=void 0,this._uriSubscription=void 0,this._maximumScreenSpaceError=void 0,this._maximumScreenSpaceErrorSubscription=void 0,this.merge((0,l.Z)(e,l.Z.EMPTY_OBJECT))}function V(e){this._definitionChanged=new h.Z,this._show=void 0,this._showSubscription=void 0,this._leadTime=void 0,this._leadTimeSubscription=void 0,this._trailTime=void 0,this._trailTimeSubscription=void 0,this._width=void 0,this._widthSubscription=void 0,this._resolution=void 0,this._resolutionSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this.merge((0,l.Z)(e,l.Z.EMPTY_OBJECT))}function H(e){this._definitionChanged=new h.Z,this._show=void 0,this._showSubscription=void 0,this._plane=void 0,this._planeSubscription=void 0,this._dimensions=void 0,this._dimensionsSubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this.merge((0,l.Z)(e,l.Z.EMPTY_OBJECT))}function G(e){this._definitionChanged=new h.Z,this._show=void 0,this._showSubscription=void 0,this._pixelSize=void 0,this._pixelSizeSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._color=void 0,this._colorSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._scaleByDistance=void 0,this._scaleByDistanceSubscription=void 0,this._translucencyByDistance=void 0,this._translucencyByDistanceSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._disableDepthTestDistance=void 0,this._disableDepthTestDistanceSubscription=void 0,this.merge((0,l.Z)(e,l.Z.EMPTY_OBJECT))}Object.defineProperties(F.prototype,{propertyNames:{get:function(){return this._propertyNames}},isConstant:{get:function(){let e=this._propertyNames;for(let t=0,i=e.length;t<i;t++)if(!R.Z.isConstant(this[e[t]]))return!1;return!0}},definitionChanged:{get:function(){return this._definitionChanged}}}),F.prototype.hasProperty=function(e){return -1!==this._propertyNames.indexOf(e)},F.prototype.addProperty=function(e,t,i){let n=this._propertyNames;if(!(0,c.Z)(e))throw new u.Z("propertyName is required.");if(-1!==n.indexOf(e))throw new u.Z(`${e} is already a registered property.`);n.push(e),Object.defineProperty(this,e,(0,b.Z)(e,!0,(0,l.Z)(i,z))),(0,c.Z)(t)&&(this[e]=t),this._definitionChanged.raiseEvent(this)},F.prototype.removeProperty=function(e){let t=this._propertyNames.indexOf(e);if(!(0,c.Z)(e))throw new u.Z("propertyName is required.");if(-1===t)throw new u.Z(`${e} is not a registered property.`);this._propertyNames.splice(t,1),delete this[e],this._definitionChanged.raiseEvent(this)},F.prototype.getValue=function(e,t){if(!(0,c.Z)(e))throw new u.Z("time is required.");(0,c.Z)(t)||(t={});let i=this._propertyNames;for(let n=0,r=i.length;n<r;n++){let r=i[n];t[r]=R.Z.getValueOrUndefined(this[r],e,t[r])}return t},F.prototype.merge=function(e,t){if(!(0,c.Z)(e))throw new u.Z("source is required.");let i=this._propertyNames,n=(0,c.Z)(e._propertyNames)?e._propertyNames:Object.keys(e);for(let r=0,o=n.length;r<o;r++){let o=n[r],a=this[o],s=e[o];void 0===a&&-1===i.indexOf(o)&&this.addProperty(o,void 0,t),void 0!==s&&(void 0!==a?(0,c.Z)(a)&&(0,c.Z)(a.merge)&&a.merge(s):(0,c.Z)(s)&&(0,c.Z)(s.merge)&&(0,c.Z)(s.clone)?this[o]=s.clone():this[o]=s)}},F.prototype.equals=function(e){return this===e||e instanceof F&&function(e,t){let i=e._propertyNames,n=t._propertyNames,r=i.length;if(r!==n.length)return!1;for(let o=0;o<r;++o){let r=i[o];if(-1===n.indexOf(r)||!R.Z.equals(e[r],t[r]))return!1}return!0}(this,e)},Object.defineProperties(U.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:(0,b.Z)("show"),uri:(0,b.Z)("uri"),scale:(0,b.Z)("scale"),minimumPixelSize:(0,b.Z)("minimumPixelSize"),maximumScale:(0,b.Z)("maximumScale"),incrementallyLoadTextures:(0,b.Z)("incrementallyLoadTextures"),runAnimations:(0,b.Z)("runAnimations"),clampAnimations:(0,b.Z)("clampAnimations"),shadows:(0,b.Z)("shadows"),heightReference:(0,b.Z)("heightReference"),silhouetteColor:(0,b.Z)("silhouetteColor"),silhouetteSize:(0,b.Z)("silhouetteSize"),color:(0,b.Z)("color"),colorBlendMode:(0,b.Z)("colorBlendMode"),colorBlendAmount:(0,b.Z)("colorBlendAmount"),imageBasedLightingFactor:(0,b.Z)("imageBasedLightingFactor"),lightColor:(0,b.Z)("lightColor"),distanceDisplayCondition:(0,b.Z)("distanceDisplayCondition"),nodeTransformations:(0,b.Z)("nodeTransformations",void 0,function(e){return new F(e,B)}),articulations:(0,b.Z)("articulations",void 0,function(e){return new F(e)}),clippingPlanes:(0,b.Z)("clippingPlanes"),customShader:(0,b.Z)("customShader")}),U.prototype.clone=function(e){return(0,c.Z)(e)?(e.show=this.show,e.uri=this.uri,e.scale=this.scale,e.minimumPixelSize=this.minimumPixelSize,e.maximumScale=this.maximumScale,e.incrementallyLoadTextures=this.incrementallyLoadTextures,e.runAnimations=this.runAnimations,e.clampAnimations=this.clampAnimations,e.heightReference=this._heightReference,e.silhouetteColor=this.silhouetteColor,e.silhouetteSize=this.silhouetteSize,e.color=this.color,e.colorBlendMode=this.colorBlendMode,e.colorBlendAmount=this.colorBlendAmount,e.imageBasedLightingFactor=this.imageBasedLightingFactor,e.lightColor=this.lightColor,e.distanceDisplayCondition=this.distanceDisplayCondition,e.nodeTransformations=this.nodeTransformations,e.articulations=this.articulations,e.clippingPlanes=this.clippingPlanes,e.customShader=this.customShader,e):new U(this)},U.prototype.merge=function(e){if(!(0,c.Z)(e))throw new u.Z("source is required.");this.show=(0,l.Z)(this.show,e.show),this.uri=(0,l.Z)(this.uri,e.uri),this.scale=(0,l.Z)(this.scale,e.scale),this.minimumPixelSize=(0,l.Z)(this.minimumPixelSize,e.minimumPixelSize),this.maximumScale=(0,l.Z)(this.maximumScale,e.maximumScale),this.incrementallyLoadTextures=(0,l.Z)(this.incrementallyLoadTextures,e.incrementallyLoadTextures),this.runAnimations=(0,l.Z)(this.runAnimations,e.runAnimations),this.clampAnimations=(0,l.Z)(this.clampAnimations,e.clampAnimations),this.shadows=(0,l.Z)(this.shadows,e.shadows),this.heightReference=(0,l.Z)(this.heightReference,e.heightReference),this.silhouetteColor=(0,l.Z)(this.silhouetteColor,e.silhouetteColor),this.silhouetteSize=(0,l.Z)(this.silhouetteSize,e.silhouetteSize),this.color=(0,l.Z)(this.color,e.color),this.colorBlendMode=(0,l.Z)(this.colorBlendMode,e.colorBlendMode),this.colorBlendAmount=(0,l.Z)(this.colorBlendAmount,e.colorBlendAmount),this.imageBasedLightingFactor=(0,l.Z)(this.imageBasedLightingFactor,e.imageBasedLightingFactor),this.lightColor=(0,l.Z)(this.lightColor,e.lightColor),this.distanceDisplayCondition=(0,l.Z)(this.distanceDisplayCondition,e.distanceDisplayCondition),this.clippingPlanes=(0,l.Z)(this.clippingPlanes,e.clippingPlanes),this.customShader=(0,l.Z)(this.customShader,e.customShader);let t=e.nodeTransformations;if((0,c.Z)(t)){let e=this.nodeTransformations;(0,c.Z)(e)?e.merge(t):this.nodeTransformations=new F(t,B)}let i=e.articulations;if((0,c.Z)(i)){let e=this.articulations;(0,c.Z)(e)?e.merge(i):this.articulations=new F(i)}},Object.defineProperties(k.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:(0,b.Z)("show"),uri:(0,b.Z)("uri"),maximumScreenSpaceError:(0,b.Z)("maximumScreenSpaceError")}),k.prototype.clone=function(e){return(0,c.Z)(e)?(e.show=this.show,e.uri=this.uri,e.maximumScreenSpaceError=this.maximumScreenSpaceError,e):new k(this)},k.prototype.merge=function(e){if(!(0,c.Z)(e))throw new u.Z("source is required.");this.show=(0,l.Z)(this.show,e.show),this.uri=(0,l.Z)(this.uri,e.uri),this.maximumScreenSpaceError=(0,l.Z)(this.maximumScreenSpaceError,e.maximumScreenSpaceError)},Object.defineProperties(V.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:(0,b.Z)("show"),leadTime:(0,b.Z)("leadTime"),trailTime:(0,b.Z)("trailTime"),width:(0,b.Z)("width"),resolution:(0,b.Z)("resolution"),material:(0,T.Z)("material"),distanceDisplayCondition:(0,b.Z)("distanceDisplayCondition")}),V.prototype.clone=function(e){return(0,c.Z)(e)?(e.show=this.show,e.leadTime=this.leadTime,e.trailTime=this.trailTime,e.width=this.width,e.resolution=this.resolution,e.material=this.material,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new V(this)},V.prototype.merge=function(e){if(!(0,c.Z)(e))throw new u.Z("source is required.");this.show=(0,l.Z)(this.show,e.show),this.leadTime=(0,l.Z)(this.leadTime,e.leadTime),this.trailTime=(0,l.Z)(this.trailTime,e.trailTime),this.width=(0,l.Z)(this.width,e.width),this.resolution=(0,l.Z)(this.resolution,e.resolution),this.material=(0,l.Z)(this.material,e.material),this.distanceDisplayCondition=(0,l.Z)(this.distanceDisplayCondition,e.distanceDisplayCondition)},Object.defineProperties(H.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:(0,b.Z)("show"),plane:(0,b.Z)("plane"),dimensions:(0,b.Z)("dimensions"),fill:(0,b.Z)("fill"),material:(0,T.Z)("material"),outline:(0,b.Z)("outline"),outlineColor:(0,b.Z)("outlineColor"),outlineWidth:(0,b.Z)("outlineWidth"),shadows:(0,b.Z)("shadows"),distanceDisplayCondition:(0,b.Z)("distanceDisplayCondition")}),H.prototype.clone=function(e){return(0,c.Z)(e)?(e.show=this.show,e.plane=this.plane,e.dimensions=this.dimensions,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new H(this)},H.prototype.merge=function(e){if(!(0,c.Z)(e))throw new u.Z("source is required.");this.show=(0,l.Z)(this.show,e.show),this.plane=(0,l.Z)(this.plane,e.plane),this.dimensions=(0,l.Z)(this.dimensions,e.dimensions),this.fill=(0,l.Z)(this.fill,e.fill),this.material=(0,l.Z)(this.material,e.material),this.outline=(0,l.Z)(this.outline,e.outline),this.outlineColor=(0,l.Z)(this.outlineColor,e.outlineColor),this.outlineWidth=(0,l.Z)(this.outlineWidth,e.outlineWidth),this.shadows=(0,l.Z)(this.shadows,e.shadows),this.distanceDisplayCondition=(0,l.Z)(this.distanceDisplayCondition,e.distanceDisplayCondition)},Object.defineProperties(G.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:(0,b.Z)("show"),pixelSize:(0,b.Z)("pixelSize"),heightReference:(0,b.Z)("heightReference"),color:(0,b.Z)("color"),outlineColor:(0,b.Z)("outlineColor"),outlineWidth:(0,b.Z)("outlineWidth"),scaleByDistance:(0,b.Z)("scaleByDistance"),translucencyByDistance:(0,b.Z)("translucencyByDistance"),distanceDisplayCondition:(0,b.Z)("distanceDisplayCondition"),disableDepthTestDistance:(0,b.Z)("disableDepthTestDistance")}),G.prototype.clone=function(e){return(0,c.Z)(e)?(e.show=this.show,e.pixelSize=this.pixelSize,e.heightReference=this.heightReference,e.color=this.color,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.scaleByDistance=this.scaleByDistance,e.translucencyByDistance=this._translucencyByDistance,e.distanceDisplayCondition=this.distanceDisplayCondition,e.disableDepthTestDistance=this.disableDepthTestDistance,e):new G(this)},G.prototype.merge=function(e){if(!(0,c.Z)(e))throw new u.Z("source is required.");this.show=(0,l.Z)(this.show,e.show),this.pixelSize=(0,l.Z)(this.pixelSize,e.pixelSize),this.heightReference=(0,l.Z)(this.heightReference,e.heightReference),this.color=(0,l.Z)(this.color,e.color),this.outlineColor=(0,l.Z)(this.outlineColor,e.outlineColor),this.outlineWidth=(0,l.Z)(this.outlineWidth,e.outlineWidth),this.scaleByDistance=(0,l.Z)(this.scaleByDistance,e.scaleByDistance),this.translucencyByDistance=(0,l.Z)(this._translucencyByDistance,e.translucencyByDistance),this.distanceDisplayCondition=(0,l.Z)(this.distanceDisplayCondition,e.distanceDisplayCondition),this.disableDepthTestDistance=(0,l.Z)(this.disableDepthTestDistance,e.disableDepthTestDistance)};var j=i(9898);function W(e){this._definitionChanged=new h.Z,this._show=void 0,this._showSubscription=void 0,this._hierarchy=void 0,this._hierarchySubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._extrudedHeight=void 0,this._extrudedHeightSubscription=void 0,this._extrudedHeightReference=void 0,this._extrudedHeightReferenceSubscription=void 0,this._stRotation=void 0,this._stRotationSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._perPositionHeight=void 0,this._perPositionHeightSubscription=void 0,this._closeTop=void 0,this._closeTopSubscription=void 0,this._closeBottom=void 0,this._closeBottomSubscription=void 0,this._arcType=void 0,this._arcTypeSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._classificationType=void 0,this._classificationTypeSubscription=void 0,this._zIndex=void 0,this._zIndexSubscription=void 0,this._textureCoordinates=void 0,this._textureCoordinatesSubscription=void 0,this.merge((0,l.Z)(e,l.Z.EMPTY_OBJECT))}Object.defineProperties(W.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:(0,b.Z)("show"),hierarchy:(0,b.Z)("hierarchy",void 0,function(e){return Array.isArray(e)&&(e=new j.Z(e)),new M.Z(e)}),height:(0,b.Z)("height"),heightReference:(0,b.Z)("heightReference"),extrudedHeight:(0,b.Z)("extrudedHeight"),extrudedHeightReference:(0,b.Z)("extrudedHeightReference"),stRotation:(0,b.Z)("stRotation"),granularity:(0,b.Z)("granularity"),fill:(0,b.Z)("fill"),material:(0,T.Z)("material"),outline:(0,b.Z)("outline"),outlineColor:(0,b.Z)("outlineColor"),outlineWidth:(0,b.Z)("outlineWidth"),perPositionHeight:(0,b.Z)("perPositionHeight"),closeTop:(0,b.Z)("closeTop"),closeBottom:(0,b.Z)("closeBottom"),arcType:(0,b.Z)("arcType"),shadows:(0,b.Z)("shadows"),distanceDisplayCondition:(0,b.Z)("distanceDisplayCondition"),classificationType:(0,b.Z)("classificationType"),zIndex:(0,b.Z)("zIndex"),textureCoordinates:(0,b.Z)("textureCoordinates")}),W.prototype.clone=function(e){return(0,c.Z)(e)?(e.show=this.show,e.hierarchy=this.hierarchy,e.height=this.height,e.heightReference=this.heightReference,e.extrudedHeight=this.extrudedHeight,e.extrudedHeightReference=this.extrudedHeightReference,e.stRotation=this.stRotation,e.granularity=this.granularity,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.perPositionHeight=this.perPositionHeight,e.closeTop=this.closeTop,e.closeBottom=this.closeBottom,e.arcType=this.arcType,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e.classificationType=this.classificationType,e.zIndex=this.zIndex,e.textureCoordinates=this.textureCoordinates,e):new W(this)},W.prototype.merge=function(e){if(!(0,c.Z)(e))throw new u.Z("source is required.");this.show=(0,l.Z)(this.show,e.show),this.hierarchy=(0,l.Z)(this.hierarchy,e.hierarchy),this.height=(0,l.Z)(this.height,e.height),this.heightReference=(0,l.Z)(this.heightReference,e.heightReference),this.extrudedHeight=(0,l.Z)(this.extrudedHeight,e.extrudedHeight),this.extrudedHeightReference=(0,l.Z)(this.extrudedHeightReference,e.extrudedHeightReference),this.stRotation=(0,l.Z)(this.stRotation,e.stRotation),this.granularity=(0,l.Z)(this.granularity,e.granularity),this.fill=(0,l.Z)(this.fill,e.fill),this.material=(0,l.Z)(this.material,e.material),this.outline=(0,l.Z)(this.outline,e.outline),this.outlineColor=(0,l.Z)(this.outlineColor,e.outlineColor),this.outlineWidth=(0,l.Z)(this.outlineWidth,e.outlineWidth),this.perPositionHeight=(0,l.Z)(this.perPositionHeight,e.perPositionHeight),this.closeTop=(0,l.Z)(this.closeTop,e.closeTop),this.closeBottom=(0,l.Z)(this.closeBottom,e.closeBottom),this.arcType=(0,l.Z)(this.arcType,e.arcType),this.shadows=(0,l.Z)(this.shadows,e.shadows),this.distanceDisplayCondition=(0,l.Z)(this.distanceDisplayCondition,e.distanceDisplayCondition),this.classificationType=(0,l.Z)(this.classificationType,e.classificationType),this.zIndex=(0,l.Z)(this.zIndex,e.zIndex),this.textureCoordinates=(0,l.Z)(this.textureCoordinates,e.textureCoordinates)};var q=i(6826);function Y(e){this._definitionChanged=new h.Z,this._show=void 0,this._showSubscription=void 0,this._positions=void 0,this._positionsSubscription=void 0,this._shape=void 0,this._shapeSubscription=void 0,this._cornerType=void 0,this._cornerTypeSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubsription=void 0,this.merge((0,l.Z)(e,l.Z.EMPTY_OBJECT))}function X(e){this._definitionChanged=new h.Z,this._show=void 0,this._showSubscription=void 0,this._coordinates=void 0,this._coordinatesSubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._extrudedHeight=void 0,this._extrudedHeightSubscription=void 0,this._extrudedHeightReference=void 0,this._extrudedHeightReferenceSubscription=void 0,this._rotation=void 0,this._rotationSubscription=void 0,this._stRotation=void 0,this._stRotationSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distancedisplayConditionSubscription=void 0,this._classificationType=void 0,this._classificationTypeSubscription=void 0,this._zIndex=void 0,this._zIndexSubscription=void 0,this.merge((0,l.Z)(e,l.Z.EMPTY_OBJECT))}function $(e){this._definitionChanged=new h.Z,this._show=void 0,this._showSubscription=void 0,this._positions=void 0,this._positionsSubscription=void 0,this._minimumHeights=void 0,this._minimumHeightsSubscription=void 0,this._maximumHeights=void 0,this._maximumHeightsSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this.merge((0,l.Z)(e,l.Z.EMPTY_OBJECT))}Object.defineProperties(Y.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:(0,b.Z)("show"),positions:(0,b.Z)("positions"),shape:(0,b.Z)("shape"),cornerType:(0,b.Z)("cornerType"),granularity:(0,b.Z)("granularity"),fill:(0,b.Z)("fill"),material:(0,T.Z)("material"),outline:(0,b.Z)("outline"),outlineColor:(0,b.Z)("outlineColor"),outlineWidth:(0,b.Z)("outlineWidth"),shadows:(0,b.Z)("shadows"),distanceDisplayCondition:(0,b.Z)("distanceDisplayCondition")}),Y.prototype.clone=function(e){return(0,c.Z)(e)?(e.show=this.show,e.positions=this.positions,e.shape=this.shape,e.cornerType=this.cornerType,e.granularity=this.granularity,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new Y(this)},Y.prototype.merge=function(e){if(!(0,c.Z)(e))throw new u.Z("source is required.");this.show=(0,l.Z)(this.show,e.show),this.positions=(0,l.Z)(this.positions,e.positions),this.shape=(0,l.Z)(this.shape,e.shape),this.cornerType=(0,l.Z)(this.cornerType,e.cornerType),this.granularity=(0,l.Z)(this.granularity,e.granularity),this.fill=(0,l.Z)(this.fill,e.fill),this.material=(0,l.Z)(this.material,e.material),this.outline=(0,l.Z)(this.outline,e.outline),this.outlineColor=(0,l.Z)(this.outlineColor,e.outlineColor),this.outlineWidth=(0,l.Z)(this.outlineWidth,e.outlineWidth),this.shadows=(0,l.Z)(this.shadows,e.shadows),this.distanceDisplayCondition=(0,l.Z)(this.distanceDisplayCondition,e.distanceDisplayCondition)},Object.defineProperties(X.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:(0,b.Z)("show"),coordinates:(0,b.Z)("coordinates"),height:(0,b.Z)("height"),heightReference:(0,b.Z)("heightReference"),extrudedHeight:(0,b.Z)("extrudedHeight"),extrudedHeightReference:(0,b.Z)("extrudedHeightReference"),rotation:(0,b.Z)("rotation"),stRotation:(0,b.Z)("stRotation"),granularity:(0,b.Z)("granularity"),fill:(0,b.Z)("fill"),material:(0,T.Z)("material"),outline:(0,b.Z)("outline"),outlineColor:(0,b.Z)("outlineColor"),outlineWidth:(0,b.Z)("outlineWidth"),shadows:(0,b.Z)("shadows"),distanceDisplayCondition:(0,b.Z)("distanceDisplayCondition"),classificationType:(0,b.Z)("classificationType"),zIndex:(0,b.Z)("zIndex")}),X.prototype.clone=function(e){return(0,c.Z)(e)?(e.show=this.show,e.coordinates=this.coordinates,e.height=this.height,e.heightReference=this.heightReference,e.extrudedHeight=this.extrudedHeight,e.extrudedHeightReference=this.extrudedHeightReference,e.rotation=this.rotation,e.stRotation=this.stRotation,e.granularity=this.granularity,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e.classificationType=this.classificationType,e.zIndex=this.zIndex,e):new X(this)},X.prototype.merge=function(e){if(!(0,c.Z)(e))throw new u.Z("source is required.");this.show=(0,l.Z)(this.show,e.show),this.coordinates=(0,l.Z)(this.coordinates,e.coordinates),this.height=(0,l.Z)(this.height,e.height),this.heightReference=(0,l.Z)(this.heightReference,e.heightReference),this.extrudedHeight=(0,l.Z)(this.extrudedHeight,e.extrudedHeight),this.extrudedHeightReference=(0,l.Z)(this.extrudedHeightReference,e.extrudedHeightReference),this.rotation=(0,l.Z)(this.rotation,e.rotation),this.stRotation=(0,l.Z)(this.stRotation,e.stRotation),this.granularity=(0,l.Z)(this.granularity,e.granularity),this.fill=(0,l.Z)(this.fill,e.fill),this.material=(0,l.Z)(this.material,e.material),this.outline=(0,l.Z)(this.outline,e.outline),this.outlineColor=(0,l.Z)(this.outlineColor,e.outlineColor),this.outlineWidth=(0,l.Z)(this.outlineWidth,e.outlineWidth),this.shadows=(0,l.Z)(this.shadows,e.shadows),this.distanceDisplayCondition=(0,l.Z)(this.distanceDisplayCondition,e.distanceDisplayCondition),this.classificationType=(0,l.Z)(this.classificationType,e.classificationType),this.zIndex=(0,l.Z)(this.zIndex,e.zIndex)},Object.defineProperties($.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:(0,b.Z)("show"),positions:(0,b.Z)("positions"),minimumHeights:(0,b.Z)("minimumHeights"),maximumHeights:(0,b.Z)("maximumHeights"),granularity:(0,b.Z)("granularity"),fill:(0,b.Z)("fill"),material:(0,T.Z)("material"),outline:(0,b.Z)("outline"),outlineColor:(0,b.Z)("outlineColor"),outlineWidth:(0,b.Z)("outlineWidth"),shadows:(0,b.Z)("shadows"),distanceDisplayCondition:(0,b.Z)("distanceDisplayCondition")}),$.prototype.clone=function(e){return(0,c.Z)(e)?(e.show=this.show,e.positions=this.positions,e.minimumHeights=this.minimumHeights,e.maximumHeights=this.maximumHeights,e.granularity=this.granularity,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new $(this)},$.prototype.merge=function(e){if(!(0,c.Z)(e))throw new u.Z("source is required.");this.show=(0,l.Z)(this.show,e.show),this.positions=(0,l.Z)(this.positions,e.positions),this.minimumHeights=(0,l.Z)(this.minimumHeights,e.minimumHeights),this.maximumHeights=(0,l.Z)(this.maximumHeights,e.maximumHeights),this.granularity=(0,l.Z)(this.granularity,e.granularity),this.fill=(0,l.Z)(this.fill,e.fill),this.material=(0,l.Z)(this.material,e.material),this.outline=(0,l.Z)(this.outline,e.outline),this.outlineColor=(0,l.Z)(this.outlineColor,e.outlineColor),this.outlineWidth=(0,l.Z)(this.outlineWidth,e.outlineWidth),this.shadows=(0,l.Z)(this.shadows,e.shadows),this.distanceDisplayCondition=(0,l.Z)(this.distanceDisplayCondition,e.distanceDisplayCondition)};let K=new o.Z,Q=[];function J(e,t){return(0,b.Z)(e,void 0,function(e){return e instanceof t?e:new t(e)})}function ee(e){let t=(e=(0,l.Z)(e,l.Z.EMPTY_OBJECT)).id;(0,c.Z)(t)||(t=(0,s.Z)()),this._availability=void 0,this._id=t,this._definitionChanged=new h.Z,this._name=e.name,this._show=(0,l.Z)(e.show,!0),this._parent=void 0,this._propertyNames=["billboard","box","corridor","cylinder","description","ellipse","ellipsoid","label","model","tileset","orientation","path","plane","point","polygon","polyline","polylineVolume","position","properties","rectangle","viewFrom","wall",...Q],this._billboard=void 0,this._billboardSubscription=void 0,this._box=void 0,this._boxSubscription=void 0,this._corridor=void 0,this._corridorSubscription=void 0,this._cylinder=void 0,this._cylinderSubscription=void 0,this._description=void 0,this._descriptionSubscription=void 0,this._ellipse=void 0,this._ellipseSubscription=void 0,this._ellipsoid=void 0,this._ellipsoidSubscription=void 0,this._label=void 0,this._labelSubscription=void 0,this._model=void 0,this._modelSubscription=void 0,this._tileset=void 0,this._tilesetSubscription=void 0,this._orientation=void 0,this._orientationSubscription=void 0,this._path=void 0,this._pathSubscription=void 0,this._plane=void 0,this._planeSubscription=void 0,this._point=void 0,this._pointSubscription=void 0,this._polygon=void 0,this._polygonSubscription=void 0,this._polyline=void 0,this._polylineSubscription=void 0,this._polylineVolume=void 0,this._polylineVolumeSubscription=void 0,this._position=void 0,this._positionSubscription=void 0,this._properties=void 0,this._propertiesSubscription=void 0,this._rectangle=void 0,this._rectangleSubscription=void 0,this._viewFrom=void 0,this._viewFromSubscription=void 0,this._wall=void 0,this._wallSubscription=void 0,this._children=[],this.entityCollection=void 0,this.parent=e.parent,this.merge(e)}function et(e,t,i){let n=t.length;for(let e=0;e<n;e++){let n=t[e],r=n._show;(!i&&r)!==(i&&r)&&et(n,n._children,i)}e._definitionChanged.raiseEvent(e,"isShowing",i,!i)}Object.defineProperties(ee.prototype,{availability:C("availability"),id:{get:function(){return this._id}},definitionChanged:{get:function(){return this._definitionChanged}},name:C("name"),show:{get:function(){return this._show},set:function(e){if(!(0,c.Z)(e))throw new u.Z("value is required.");if(e===this._show)return;let t=this.isShowing;this._show=e;let i=this.isShowing;t!==i&&et(this,this._children,i),this._definitionChanged.raiseEvent(this,"show",e,!e)}},isShowing:{get:function(){return this._show&&(!(0,c.Z)(this.entityCollection)||this.entityCollection.show)&&(!(0,c.Z)(this._parent)||this._parent.isShowing)}},parent:{get:function(){return this._parent},set:function(e){let t=this._parent;if(t===e)return;let i=this.isShowing;if((0,c.Z)(t)){let e=t._children.indexOf(this);t._children.splice(e,1)}this._parent=e,(0,c.Z)(e)&&e._children.push(this);let n=this.isShowing;i!==n&&et(this,this._children,n),this._definitionChanged.raiseEvent(this,"parent",e,t)}},propertyNames:{get:function(){return this._propertyNames}},billboard:J("billboard",v),box:J("box",E),corridor:J("corridor",w),cylinder:J("cylinder",A),description:(0,b.Z)("description"),ellipse:J("ellipse",I),ellipsoid:J("ellipsoid",O),label:J("label",D),model:J("model",U),tileset:J("tileset",k),orientation:(0,b.Z)("orientation"),path:J("path",V),plane:J("plane",H),point:J("point",G),polygon:J("polygon",W),polyline:J("polyline",q.Z),polylineVolume:J("polylineVolume",Y),properties:J("properties",F),position:(n="position",(0,b.Z)(n,void 0,function(e){return new x.Z(e)})),rectangle:J("rectangle",X),viewFrom:(0,b.Z)("viewFrom"),wall:J("wall",$)}),ee.registerEntityType=function(e,t){Object.defineProperties(ee.prototype,{[e]:J(e,t)}),Q.includes(e)||Q.push(e)},ee.prototype.isAvailable=function(e){if(!(0,c.Z)(e))throw new u.Z("time is required.");let t=this._availability;return!(0,c.Z)(t)||t.contains(e)},ee.prototype.addProperty=function(e){let t=this._propertyNames;if(!(0,c.Z)(e))throw new u.Z("propertyName is required.");if(-1!==t.indexOf(e))throw new u.Z(`${e} is already a registered property.`);if(e in this)throw new u.Z(`${e} is a reserved property name.`);t.push(e),Object.defineProperty(this,e,C(e,!0))},ee.prototype.removeProperty=function(e){let t=this._propertyNames.indexOf(e);if(!(0,c.Z)(e))throw new u.Z("propertyName is required.");if(-1===t)throw new u.Z(`${e} is not a registered property.`);this._propertyNames.splice(t,1),delete this[e]},ee.prototype.merge=function(e){if(!(0,c.Z)(e))throw new u.Z("source is required.");this.name=(0,l.Z)(this.name,e.name),this.availability=(0,l.Z)(this.availability,e.availability);let t=this._propertyNames,i=(0,c.Z)(e._propertyNames)?e._propertyNames:Object.keys(e),n=i.length;for(let r=0;r<n;r++){let n=i[r];if("parent"===n||"name"===n||"availability"===n||"children"===n)continue;let o=this[n],a=e[n];(0,c.Z)(o)||-1!==t.indexOf(n)||this.addProperty(n),(0,c.Z)(a)&&((0,c.Z)(o)?(0,c.Z)(o.merge)&&o.merge(a):(0,c.Z)(a.merge)&&(0,c.Z)(a.clone)?this[n]=a.clone():this[n]=a)}};let ei=new f.Z,en=new r.Z,er=new m.Z;ee.prototype.computeModelMatrix=function(e,t){a.Z.typeOf.object("time",e);let i=R.Z.getValueOrUndefined(this._position,e,en);if(!(0,c.Z)(i))return;let n=R.Z.getValueOrUndefined(this._orientation,e,er);return t=(0,c.Z)(n)?p.Z.fromRotationTranslation(f.Z.fromQuaternion(n,ei),i,t):_.Z.eastNorthUpToFixedFrame(i,void 0,t)},ee.prototype.computeModelMatrixForHeightReference=function(e,t,i,n,o){a.Z.typeOf.object("time",e);let s=R.Z.getValueOrDefault(t,e,y.ZP.NONE),l=R.Z.getValueOrUndefined(this._position,e,en);if(s===y.ZP.NONE||!(0,c.Z)(l)||r.Z.equalsEpsilon(l,r.Z.ZERO,d.Z.EPSILON8))return this.computeModelMatrix(e,o);let u=n.cartesianToCartographic(l,K);(0,y.c1)(s)?u.height=i:u.height+=i,l=n.cartographicToCartesian(u,l);let h=R.Z.getValueOrUndefined(this._orientation,e,er);return o=(0,c.Z)(h)?p.Z.fromRotationTranslation(f.Z.fromQuaternion(h,ei),l,o):_.Z.eastNorthUpToFixedFrame(l,void 0,o)},ee.supportsMaterialsforEntitiesOnTerrain=function(e){return Z.Z.supportsMaterials(e)},ee.supportsPolylinesOnTerrain=function(e){return g.Z.isSupported(e)};var eo=ee},3128:function(e,t,i){"use strict";var n=i(1486),r=i(698),o=i(4572),a=i(9410),s=i(1039),l=i(8920),c=i(5951),u=i(2150),h=i(3186),d=i(4749),f=i(7119),p=i(8593);let m=new h.Z,_=new h.Z,g=new h.Z,Z=new d.Z,y=new n.Z,b=new n.Z,v=new n.Z,T=new n.Z,E=new n.Z,x=new n.Z,w=new c.Z;function S(e,t,i){r.Z.defined("entity",e),r.Z.defined("scene",t),this.entity=e,this.scene=t,this.ellipsoid=(0,o.Z)(i,s.Z.WGS84),this.boundingSphere=void 0,this._lastEntity=void 0,this._mode=void 0,this._lastCartesian=new n.Z,this._defaultOffset3D=void 0,this._offset3D=new n.Z}Object.defineProperties(S,{defaultOffset3D:{get:function(){return this._defaultOffset3D},set:function(e){this._defaultOffset3D=n.Z.clone(e,new n.Z)}}}),S.defaultOffset3D=new n.Z(-14e3,3500,3500);let C=new l.Z,A=new n.Z;S.prototype.update=function(e,t){r.Z.defined("time",e);let i=this.scene,o=this.ellipsoid,s=i.mode;if(s===p.Z.MORPHING)return;let l=this.entity,d=l.position;if(!(0,a.Z)(d))return;let I=l!==this._lastEntity,O=s!==this._mode,D=i.camera,P=I||O,R=!0;if(I){let i=l.viewFrom,r=(0,a.Z)(i);if(!r&&(0,a.Z)(t)){C.pitch=-u.Z.PI_OVER_FOUR,C.range=0;let i=d.getValue(e,A);if((0,a.Z)(i)){let e=2-1/Math.max(1,n.Z.magnitude(i)/o.maximumRadius);C.pitch*=e}D.viewBoundingSphere(t,C),this.boundingSphere=t,P=!1,R=!1}else r&&(0,a.Z)(i.getValue(e,this._offset3D))||n.Z.clone(S._defaultOffset3D,this._offset3D)}else O||this._mode===p.Z.SCENE2D||n.Z.clone(D.position,this._offset3D);this._lastEntity=l,this._mode=s,function(e,t,i,r,o,s,l){let d=e.scene.mode,S=o.getValue(s,e._lastCartesian);if((0,a.Z)(S)){let i,C,A,I,O,D,P=!1,R=!1;if(d===p.Z.SCENE3D){c.Z.addSeconds(s,.001,w);let e=o.getValue(w,y);if((0,a.Z)(e)||(c.Z.addSeconds(s,-.001,w),e=o.getValue(w,y),R=!0),(0,a.Z)(e)){let t,r=f.Z.computeFixedToIcrfMatrix(s,m),o=f.Z.computeFixedToIcrfMatrix(w,_);(0,a.Z)(r)&&(0,a.Z)(o)?t=h.Z.transpose(r,g):(t=f.Z.computeTemeToPseudoFixedMatrix(s,g),r=h.Z.transpose(t,m),o=f.Z.computeTemeToPseudoFixedMatrix(w,_),h.Z.transpose(o,o));let c=h.Z.multiplyByVector(r,S,E),d=h.Z.multiplyByVector(o,e,x);n.Z.subtract(c,d,T);let p=1e3*n.Z.magnitude(T),Z=u.Z.GRAVITATIONALPARAMETER,I=-Z/(p*p-2*Z/n.Z.magnitude(c));I<0||I>1.25*l.maximumRadius?(i=b,n.Z.normalize(S,i),n.Z.negate(i,i),A=n.Z.clone(n.Z.UNIT_Z,v),C=n.Z.cross(A,i,y),n.Z.magnitude(C)>u.Z.EPSILON7&&(n.Z.normalize(i,i),n.Z.normalize(C,C),A=n.Z.cross(i,C,v),n.Z.normalize(A,A),P=!0)):n.Z.equalsEpsilon(S,e,u.Z.EPSILON7)||(A=b,n.Z.normalize(c,A),n.Z.normalize(d,d),C=n.Z.cross(A,d,v),R&&(C=n.Z.multiplyByScalar(C,-1,C)),n.Z.equalsEpsilon(C,n.Z.ZERO,u.Z.EPSILON7)||(i=n.Z.cross(C,A,y),h.Z.multiplyByVector(t,i,i),h.Z.multiplyByVector(t,C,C),h.Z.multiplyByVector(t,A,A),n.Z.normalize(i,i),n.Z.normalize(C,C),n.Z.normalize(A,A),P=!0))}}(0,a.Z)(e.boundingSphere)&&(S=e.boundingSphere.center),r&&(I=n.Z.clone(t.position,T),O=n.Z.clone(t.direction,E),D=n.Z.clone(t.up,x)),P?(Z[0]=i.x,Z[1]=i.y,Z[2]=i.z,Z[3]=0,Z[4]=C.x,Z[5]=C.y,Z[6]=C.z,Z[7]=0,Z[8]=A.x,Z[9]=A.y,Z[10]=A.z,Z[11]=0,Z[12]=S.x,Z[13]=S.y,Z[14]=S.z,Z[15]=0):f.Z.eastNorthUpToFixedFrame(S,l,Z),t._setTransform(Z),r&&(n.Z.clone(I,t.position),n.Z.clone(O,t.direction),n.Z.clone(D,t.up),n.Z.cross(O,D,t.right))}if(i){let i=d===p.Z.SCENE2D||n.Z.equals(e._offset3D,n.Z.ZERO)?void 0:e._offset3D;t.lookAtTransform(t.transform,i)}}(this,D,P,R,d,e,o)},t.Z=S},6826:function(e,t,i){"use strict";var n=i(4572),r=i(9410),o=i(9824),a=i(2198),s=i(6729),l=i(8424);function c(e){this._definitionChanged=new a.Z,this._show=void 0,this._showSubscription=void 0,this._positions=void 0,this._positionsSubscription=void 0,this._width=void 0,this._widthSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._depthFailMaterial=void 0,this._depthFailMaterialSubscription=void 0,this._arcType=void 0,this._arcTypeSubscription=void 0,this._clampToGround=void 0,this._clampToGroundSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._classificationType=void 0,this._classificationTypeSubscription=void 0,this._zIndex=void 0,this._zIndexSubscription=void 0,this.merge((0,n.Z)(e,n.Z.EMPTY_OBJECT))}Object.defineProperties(c.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:(0,l.Z)("show"),positions:(0,l.Z)("positions"),width:(0,l.Z)("width"),granularity:(0,l.Z)("granularity"),material:(0,s.Z)("material"),depthFailMaterial:(0,s.Z)("depthFailMaterial"),arcType:(0,l.Z)("arcType"),clampToGround:(0,l.Z)("clampToGround"),shadows:(0,l.Z)("shadows"),distanceDisplayCondition:(0,l.Z)("distanceDisplayCondition"),classificationType:(0,l.Z)("classificationType"),zIndex:(0,l.Z)("zIndex")}),c.prototype.clone=function(e){return(0,r.Z)(e)?(e.show=this.show,e.positions=this.positions,e.width=this.width,e.granularity=this.granularity,e.material=this.material,e.depthFailMaterial=this.depthFailMaterial,e.arcType=this.arcType,e.clampToGround=this.clampToGround,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e.classificationType=this.classificationType,e.zIndex=this.zIndex,e):new c(this)},c.prototype.merge=function(e){if(!(0,r.Z)(e))throw new o.Z("source is required.");this.show=(0,n.Z)(this.show,e.show),this.positions=(0,n.Z)(this.positions,e.positions),this.width=(0,n.Z)(this.width,e.width),this.granularity=(0,n.Z)(this.granularity,e.granularity),this.material=(0,n.Z)(this.material,e.material),this.depthFailMaterial=(0,n.Z)(this.depthFailMaterial,e.depthFailMaterial),this.arcType=(0,n.Z)(this.arcType,e.arcType),this.clampToGround=(0,n.Z)(this.clampToGround,e.clampToGround),this.shadows=(0,n.Z)(this.shadows,e.shadows),this.distanceDisplayCondition=(0,n.Z)(this.distanceDisplayCondition,e.distanceDisplayCondition),this.classificationType=(0,n.Z)(this.classificationType,e.classificationType),this.zIndex=(0,n.Z)(this.zIndex,e.zIndex)},t.Z=c},9214:function(e,t,i){"use strict";var n=i(1486),r=i(9410),o=i(9824),a=i(3186),s=i(7897),l=i(7119);function c(){o.Z.throwInstantiationError()}Object.defineProperties(c.prototype,{isConstant:{get:o.Z.throwInstantiationError},definitionChanged:{get:o.Z.throwInstantiationError},referenceFrame:{get:o.Z.throwInstantiationError}}),c.prototype.getValue=o.Z.throwInstantiationError,c.prototype.getValueInReferenceFrame=o.Z.throwInstantiationError,c.prototype.equals=o.Z.throwInstantiationError;let u=new a.Z;c.convertToReferenceFrame=function(e,t,i,o,c){if(!(0,r.Z)(t))return t;if((0,r.Z)(c)||(c=new n.Z),i===o)return n.Z.clone(t,c);let h=l.Z.computeIcrfToFixedMatrix(e,u);return((0,r.Z)(h)||(h=l.Z.computeTemeToPseudoFixedMatrix(e,u)),i===s.Z.INERTIAL)?a.Z.multiplyByVector(h,t,c):i===s.Z.FIXED?a.Z.multiplyByVector(a.Z.transpose(h,u),t,c):void 0},t.Z=c},7915:function(e,t,i){"use strict";var n=i(4572),r=i(9410),o=i(9824),a=i(2198),s=i(691),l=i(7897),c=i(7570);function u(e,t){this._value=void 0,this._definitionChanged=new a.Z,this._eventHelper=new s.Z,this._referenceFrame=(0,n.Z)(t,l.Z.FIXED),this.setValue(e)}Object.defineProperties(u.prototype,{isConstant:{get:function(){let e=this._value;if(!(0,r.Z)(e))return!0;let t=e.length;for(let i=0;i<t;i++)if(!c.Z.isConstant(e[i]))return!1;return!0}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return this._referenceFrame}}}),u.prototype.getValue=function(e,t){return this.getValueInReferenceFrame(e,l.Z.FIXED,t)},u.prototype.getValueInReferenceFrame=function(e,t,i){if(!(0,r.Z)(e))throw new o.Z("time is required.");if(!(0,r.Z)(t))throw new o.Z("referenceFrame is required.");let n=this._value;if(!(0,r.Z)(n))return;let a=n.length;(0,r.Z)(i)||(i=Array(a));let s=0,l=0;for(;s<a;){let o=n[s].getValueInReferenceFrame(e,t,i[s]);(0,r.Z)(o)&&(i[l]=o,l++),s++}return i.length=l,i},u.prototype.setValue=function(e){let t=this._eventHelper;if(t.removeAll(),(0,r.Z)(e)){this._value=e.slice();let i=e.length;for(let n=0;n<i;n++){let i=e[n];(0,r.Z)(i)&&t.add(i.definitionChanged,u.prototype._raiseDefinitionChanged,this)}}else this._value=void 0;this._definitionChanged.raiseEvent(this)},u.prototype.equals=function(e){return this===e||e instanceof u&&this._referenceFrame===e._referenceFrame&&c.Z.arrayEquals(this._value,e._value)},u.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)},t.Z=u},7570:function(e,t,i){"use strict";var n=i(4572),r=i(9410),o=i(9824);function a(){o.Z.throwInstantiationError()}Object.defineProperties(a.prototype,{isConstant:{get:o.Z.throwInstantiationError},definitionChanged:{get:o.Z.throwInstantiationError}}),a.prototype.getValue=o.Z.throwInstantiationError,a.prototype.equals=o.Z.throwInstantiationError,a.equals=function(e,t){return e===t||(0,r.Z)(e)&&e.equals(t)},a.arrayEquals=function(e,t){if(e===t)return!0;if(!(0,r.Z)(e)||!(0,r.Z)(t)||e.length!==t.length)return!1;let i=e.length;for(let n=0;n<i;n++)if(!a.equals(e[n],t[n]))return!1;return!0},a.isConstant=function(e){return!(0,r.Z)(e)||e.isConstant},a.getValueOrUndefined=function(e,t,i){return(0,r.Z)(e)?e.getValue(t,i):void 0},a.getValueOrDefault=function(e,t,i,o){return(0,r.Z)(e)?(0,n.Z)(e.getValue(t,o),i):i},a.getValueOrClonedDefault=function(e,t,i,n){let o;return(0,r.Z)(e)&&(o=e.getValue(t,n)),(0,r.Z)(o)||(o=i.clone(o)),o},t.Z=a},4729:function(e,t,i){"use strict";i.d(t,{Z:function(){return w}});var n=i(1486),r=i(698),o=i(4572),a=i(9410),s=i(9824),l=i(2198),c=i(7897),u=i(9214),h=i(7570),d=i(8328),f=Object.freeze({NONE:0,HOLD:1,EXTRAPOLATE:2}),p=i(5951);let m={type:"Linear"};m.getRequiredDataPoints=function(e){return 2},m.interpolateOrderZero=function(e,t,i,n,r){let o,l,c;if(2!==t.length)throw new s.Z("The xTable provided to the linear interpolator must have exactly two elements.");if(n<=0)throw new s.Z("There must be at least 1 dependent variable for each independent variable.");(0,a.Z)(r)||(r=Array(n));let u=t[0],h=t[1];if(u===h)throw new s.Z("Divide by zero error: xTable[0] and xTable[1] are equal");for(o=0;o<n;o++)l=i[o],c=i[o+n],r[o]=((c-l)*e+h*l-u*c)/(h-u);return r};let _={packedLength:1,pack:function(e,t,i){t[i=(0,o.Z)(i,0)]=e},unpack:function(e,t,i){return e[t=(0,o.Z)(t,0)]}};function g(e,t,i){let n;let r=e.length,o=i.length,a=r+o;if(e.length=a,r!==t){let i=r-1;for(n=a-1;n>=t;n--)e[n]=e[i--]}for(n=0;n<o;n++)e[t++]=i[n]}function Z(e,t){return e instanceof p.Z?e:"string"==typeof e?p.Z.fromIso8601(e):p.Z.addSeconds(t,e,new p.Z)}let y=[],b=[];function v(e,t,i,n,r){let o,s,l,c,u,h,f=0;for(;f<n.length;){u=Z(n[f],e);let m=0,_=0;if((l=(0,d.Z)(t,u,p.Z.compare))<0){for(c=(l=~l)*r,s=void 0,h=t[l];f<n.length&&(u=Z(n[f],e),!((0,a.Z)(s)&&p.Z.compare(s,u)>=0||(0,a.Z)(h)&&p.Z.compare(u,h)>=0));){for(y[m++]=u,f+=1,o=0;o<r;o++)b[_++]=n[f],f+=1;s=u}m>0&&(b.length=_,g(i,c,b),y.length=m,g(t,l,y))}else{for(o=0;o<r;o++)f++,i[l*r+o]=n[f];f++}}}function T(e,t){let i;r.Z.defined("type",e);let n=e;n===Number&&(n=_);let s=n.packedLength,c=(0,o.Z)(n.packedInterpolationLength,s),u=0;if((0,a.Z)(t)){let e=t.length;i=Array(e);for(let n=0;n<e;n++){let e=t[n];e===Number&&(e=_);let r=e.packedLength;s+=r,c+=(0,o.Z)(e.packedInterpolationLength,r),i[n]=e}u=e}this._type=e,this._innerType=n,this._interpolationDegree=1,this._interpolationAlgorithm=m,this._numberOfPoints=0,this._times=[],this._values=[],this._xTable=[],this._yTable=[],this._packedLength=s,this._packedInterpolationLength=c,this._updateTableLength=!0,this._interpolationResult=Array(c),this._definitionChanged=new l.Z,this._derivativeTypes=t,this._innerDerivativeTypes=i,this._inputOrder=u,this._forwardExtrapolationType=f.NONE,this._forwardExtrapolationDuration=0,this._backwardExtrapolationType=f.NONE,this._backwardExtrapolationDuration=0}function E(e,t,i){let n=e._packedLength;e._times.splice(t,i),e._values.splice(t*n,i*n),e._updateTableLength=!0,e._definitionChanged.raiseEvent(e)}function x(e,t){let i;if((t=(0,o.Z)(t,0))>0){i=Array(t);for(let e=0;e<t;e++)i[e]=n.Z}this._numberOfDerivatives=t,this._property=new T(n.Z,i),this._definitionChanged=new l.Z,this._referenceFrame=(0,o.Z)(e,c.Z.FIXED),this._property._definitionChanged.addEventListener(function(){this._definitionChanged.raiseEvent(this)},this)}Object.defineProperties(T.prototype,{isConstant:{get:function(){return 0===this._values.length}},definitionChanged:{get:function(){return this._definitionChanged}},type:{get:function(){return this._type}},derivativeTypes:{get:function(){return this._derivativeTypes}},interpolationDegree:{get:function(){return this._interpolationDegree}},interpolationAlgorithm:{get:function(){return this._interpolationAlgorithm}},forwardExtrapolationType:{get:function(){return this._forwardExtrapolationType},set:function(e){this._forwardExtrapolationType!==e&&(this._forwardExtrapolationType=e,this._definitionChanged.raiseEvent(this))}},forwardExtrapolationDuration:{get:function(){return this._forwardExtrapolationDuration},set:function(e){this._forwardExtrapolationDuration!==e&&(this._forwardExtrapolationDuration=e,this._definitionChanged.raiseEvent(this))}},backwardExtrapolationType:{get:function(){return this._backwardExtrapolationType},set:function(e){this._backwardExtrapolationType!==e&&(this._backwardExtrapolationType=e,this._definitionChanged.raiseEvent(this))}},backwardExtrapolationDuration:{get:function(){return this._backwardExtrapolationDuration},set:function(e){this._backwardExtrapolationDuration!==e&&(this._backwardExtrapolationDuration=e,this._definitionChanged.raiseEvent(this))}}}),T.prototype.getValue=function(e,t){let i;r.Z.defined("time",e);let n=this._times,o=n.length;if(0===o)return;let s=this._innerType,l=this._values,c=(0,d.Z)(n,e,p.Z.compare);if(c<0){let r;if(0==(c=~c)){let r=n[c];if(i=this._backwardExtrapolationDuration,this._backwardExtrapolationType===f.NONE||0!==i&&p.Z.secondsDifference(r,e)>i)return;if(this._backwardExtrapolationType===f.HOLD)return s.unpack(l,0,t)}if(c>=o){let r=n[c=o-1];if(i=this._forwardExtrapolationDuration,this._forwardExtrapolationType===f.NONE||0!==i&&p.Z.secondsDifference(e,r)>i)return;if(this._forwardExtrapolationType===f.HOLD)return c=o-1,s.unpack(l,c*s.packedLength,t)}let u=this._xTable,h=this._yTable,d=this._interpolationAlgorithm,m=this._packedInterpolationLength,_=this._inputOrder;if(this._updateTableLength){this._updateTableLength=!1;let e=Math.min(d.getRequiredDataPoints(this._interpolationDegree,_),o);e!==this._numberOfPoints&&(this._numberOfPoints=e,u.length=e,h.length=e*m)}let g=this._numberOfPoints-1;if(g<1)return;let Z=0,y=o-1;if(y-0+1>=g+1){let e=c-(g/2|0)-1;e<Z&&(e=Z);let t=e+g;t>y&&(e=(t=y)-g)<Z&&(e=Z),Z=e,y=t}let b=y-Z+1;for(let e=0;e<b;++e)u[e]=p.Z.secondsDifference(n[Z+e],n[y]);if((0,a.Z)(s.convertPackedArrayForInterpolation))s.convertPackedArrayForInterpolation(l,Z,y,h);else{let e=0,t=this._packedLength,i=Z*t,n=(y+1)*t;for(;i<n;)h[e]=l[i],i++,e++}let v=p.Z.secondsDifference(e,n[y]);if(0!==_&&(0,a.Z)(d.interpolate)){let e=Math.floor(m/(_+1));r=d.interpolate(v,u,h,e,_,_,this._interpolationResult)}else r=d.interpolateOrderZero(v,u,h,m,this._interpolationResult);return(0,a.Z)(s.unpackInterpolationResult)?s.unpackInterpolationResult(r,l,Z,y,t):s.unpack(r,0,t)}return s.unpack(l,c*this._packedLength,t)},T.prototype.setInterpolationOptions=function(e){if(!(0,a.Z)(e))return;let t=!1,i=e.interpolationAlgorithm,n=e.interpolationDegree;(0,a.Z)(i)&&this._interpolationAlgorithm!==i&&(this._interpolationAlgorithm=i,t=!0),(0,a.Z)(n)&&this._interpolationDegree!==n&&(this._interpolationDegree=n,t=!0),t&&(this._updateTableLength=!0,this._definitionChanged.raiseEvent(this))},T.prototype.addSample=function(e,t,i){let n=this._innerDerivativeTypes,o=(0,a.Z)(n);r.Z.defined("time",e),r.Z.defined("value",t),o&&r.Z.defined("derivatives",i);let s=this._innerType,l=[];if(l.push(e),s.pack(t,l,l.length),o){let e=n.length;for(let t=0;t<e;t++)n[t].pack(i[t],l,l.length)}v(void 0,this._times,this._values,l,this._packedLength),this._updateTableLength=!0,this._definitionChanged.raiseEvent(this)},T.prototype.addSamples=function(e,t,i){let n=this._innerDerivativeTypes,o=(0,a.Z)(n);if(r.Z.defined("times",e),r.Z.defined("values",t),e.length!==t.length)throw new s.Z("times and values must be the same length.");if(o&&(!(0,a.Z)(i)||i.length!==e.length))throw new s.Z("times and derivativeValues must be the same length.");let l=this._innerType,c=e.length,u=[];for(let r=0;r<c;r++)if(u.push(e[r]),l.pack(t[r],u,u.length),o){let e=i[r],t=n.length;for(let i=0;i<t;i++)n[i].pack(e[i],u,u.length)}v(void 0,this._times,this._values,u,this._packedLength),this._updateTableLength=!0,this._definitionChanged.raiseEvent(this)},T.prototype.addSamplesPackedArray=function(e,t){r.Z.defined("packedSamples",e),v(t,this._times,this._values,e,this._packedLength),this._updateTableLength=!0,this._definitionChanged.raiseEvent(this)},T.prototype.removeSample=function(e){r.Z.defined("time",e);let t=(0,d.Z)(this._times,e,p.Z.compare);return!(t<0)&&(E(this,t,1),!0)},T.prototype.removeSamples=function(e){r.Z.defined("timeInterval",e);let t=this._times,i=(0,d.Z)(t,e.start,p.Z.compare);i<0?i=~i:!e.isStartIncluded&&++i;let n=(0,d.Z)(t,e.stop,p.Z.compare);n<0?n=~n:e.isStopIncluded&&++n,E(this,i,n-i)},T.prototype.equals=function(e){let t,i;if(this===e)return!0;if(!(0,a.Z)(e)||this._type!==e._type||this._interpolationDegree!==e._interpolationDegree||this._interpolationAlgorithm!==e._interpolationAlgorithm)return!1;let n=this._derivativeTypes,r=(0,a.Z)(n),o=e._derivativeTypes;if(r!==(0,a.Z)(o))return!1;if(r){if((i=n.length)!==o.length)return!1;for(t=0;t<i;t++)if(n[t]!==o[t])return!1}let s=this._times,l=e._times;if((i=s.length)!==l.length)return!1;for(t=0;t<i;t++)if(!p.Z.equals(s[t],l[t]))return!1;let c=this._values,u=e._values;for(t=0,i=c.length;t<i;t++)if(c[t]!==u[t])return!1;return!0},T._mergeNewSamples=v,Object.defineProperties(x.prototype,{isConstant:{get:function(){return this._property.isConstant}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return this._referenceFrame}},interpolationDegree:{get:function(){return this._property.interpolationDegree}},interpolationAlgorithm:{get:function(){return this._property.interpolationAlgorithm}},numberOfDerivatives:{get:function(){return this._numberOfDerivatives}},forwardExtrapolationType:{get:function(){return this._property.forwardExtrapolationType},set:function(e){this._property.forwardExtrapolationType=e}},forwardExtrapolationDuration:{get:function(){return this._property.forwardExtrapolationDuration},set:function(e){this._property.forwardExtrapolationDuration=e}},backwardExtrapolationType:{get:function(){return this._property.backwardExtrapolationType},set:function(e){this._property.backwardExtrapolationType=e}},backwardExtrapolationDuration:{get:function(){return this._property.backwardExtrapolationDuration},set:function(e){this._property.backwardExtrapolationDuration=e}}}),x.prototype.getValue=function(e,t){return this.getValueInReferenceFrame(e,c.Z.FIXED,t)},x.prototype.getValueInReferenceFrame=function(e,t,i){if(r.Z.defined("time",e),r.Z.defined("referenceFrame",t),i=this._property.getValue(e,i),(0,a.Z)(i))return u.Z.convertToReferenceFrame(e,i,this._referenceFrame,t,i)},x.prototype.setInterpolationOptions=function(e){this._property.setInterpolationOptions(e)},x.prototype.addSample=function(e,t,i){let n=this._numberOfDerivatives;if(n>0&&(!(0,a.Z)(i)||i.length!==n))throw new s.Z("derivatives length must be equal to the number of derivatives.");this._property.addSample(e,t,i)},x.prototype.addSamples=function(e,t,i){this._property.addSamples(e,t,i)},x.prototype.addSamplesPackedArray=function(e,t){this._property.addSamplesPackedArray(e,t)},x.prototype.removeSample=function(e){return this._property.removeSample(e)},x.prototype.removeSamples=function(e){this._property.removeSamples(e)},x.prototype.equals=function(e){return this===e||e instanceof x&&h.Z.equals(this._property,e._property)&&this._referenceFrame===e._referenceFrame};var w=x},6729:function(e,t,i){"use strict";i.d(t,{Z:function(){return g}});var n=i(8177),r=i(9824),o=i(8358),a=i(7138),s=i(8424),l=i(570),c=i(4572),u=i(9410),h=i(2198),d=i(7570);let f=new l.Z(1,1),p=n.Z.WHITE;function m(e){e=(0,c.Z)(e,c.Z.EMPTY_OBJECT),this._definitionChanged=new h.Z,this._image=void 0,this._imageSubscription=void 0,this._repeat=void 0,this._repeatSubscription=void 0,this._color=void 0,this._colorSubscription=void 0,this._transparent=void 0,this._transparentSubscription=void 0,this.image=e.image,this.repeat=e.repeat,this.color=e.color,this.transparent=e.transparent}function _(e){if(e instanceof n.Z)return new a.Z(e);if("string"==typeof e||e instanceof o.Z||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement){let t=new m;return t.image=e,t}throw new r.Z(`Unable to infer material type: ${e}`)}Object.defineProperties(m.prototype,{isConstant:{get:function(){return d.Z.isConstant(this._image)&&d.Z.isConstant(this._repeat)}},definitionChanged:{get:function(){return this._definitionChanged}},image:(0,s.Z)("image"),repeat:(0,s.Z)("repeat"),color:(0,s.Z)("color"),transparent:(0,s.Z)("transparent")}),m.prototype.getType=function(e){return"Image"},m.prototype.getValue=function(e,t){return(0,u.Z)(t)||(t={}),t.image=d.Z.getValueOrUndefined(this._image,e),t.repeat=d.Z.getValueOrClonedDefault(this._repeat,e,f,t.repeat),t.color=d.Z.getValueOrClonedDefault(this._color,e,p,t.color),d.Z.getValueOrDefault(this._transparent,e,!1)&&(t.color.alpha=Math.min(.99,t.color.alpha)),t},m.prototype.equals=function(e){return this===e||e instanceof m&&d.Z.equals(this._image,e._image)&&d.Z.equals(this._repeat,e._repeat)&&d.Z.equals(this._color,e._color)&&d.Z.equals(this._transparent,e._transparent)};var g=function(e,t){return(0,s.Z)(e,t,_)}},8424:function(e,t,i){"use strict";var n=i(4572),r=i(9410),o=i(109);function a(e){return new o.Z(e)}t.Z=function(e,t,i){var o,s,l,c;return o=`_${e.toString()}`,s=`_${e.toString()}Subscription`,l=(0,n.Z)(t,!1),c=(0,n.Z)(i,a),{configurable:l,get:function(){return this[o]},set:function(t){let i=this[o],n=this[s];(0,r.Z)(n)&&(n(),this[s]=void 0),void 0!==t&&(!(0,r.Z)(t)||!(0,r.Z)(t.getValue))&&(0,r.Z)(c)&&(t=c(t)),i!==t&&(this[o]=t,this._definitionChanged.raiseEvent(this,e,t,i)),(0,r.Z)(t)&&(0,r.Z)(t.definitionChanged)&&(this[s]=t.definitionChanged.addEventListener(function(){this._definitionChanged.raiseEvent(this,e,t,t)},this))}}}},5430:function(e,t,i){"use strict";var n=i(1486),r=i(4749),o=i(512);let a=new n.Z;function s(e){this._size=e.size,this._datatype=e.datatype,this.getValue=e.getValue}let l={};l[o.Z.FLOAT]="float",l[o.Z.FLOAT_VEC2]="vec2",l[o.Z.FLOAT_VEC3]="vec3",l[o.Z.FLOAT_VEC4]="vec4",l[o.Z.INT]="int",l[o.Z.INT_VEC2]="ivec2",l[o.Z.INT_VEC3]="ivec3",l[o.Z.INT_VEC4]="ivec4",l[o.Z.BOOL]="bool",l[o.Z.BOOL_VEC2]="bvec2",l[o.Z.BOOL_VEC3]="bvec3",l[o.Z.BOOL_VEC4]="bvec4",l[o.Z.FLOAT_MAT2]="mat2",l[o.Z.FLOAT_MAT3]="mat3",l[o.Z.FLOAT_MAT4]="mat4",l[o.Z.SAMPLER_2D]="sampler2D",l[o.Z.SAMPLER_CUBE]="samplerCube",s.prototype.getDeclaration=function(e){let t=`uniform ${l[this._datatype]} ${e}`,i=this._size;return 1===i?t+=";":t+=`[${i.toString()}];`,t};let c={czm_viewport:new s({size:1,datatype:o.Z.FLOAT_VEC4,getValue:function(e){return e.viewportCartesian4}}),czm_viewportOrthographic:new s({size:1,datatype:o.Z.FLOAT_MAT4,getValue:function(e){return e.viewportOrthographic}}),czm_viewportTransformation:new s({size:1,datatype:o.Z.FLOAT_MAT4,getValue:function(e){return e.viewportTransformation}}),czm_globeDepthTexture:new s({size:1,datatype:o.Z.SAMPLER_2D,getValue:function(e){return e.globeDepthTexture}}),czm_model:new s({size:1,datatype:o.Z.FLOAT_MAT4,getValue:function(e){return e.model}}),czm_inverseModel:new s({size:1,datatype:o.Z.FLOAT_MAT4,getValue:function(e){return e.inverseModel}}),czm_view:new s({size:1,datatype:o.Z.FLOAT_MAT4,getValue:function(e){return e.view}}),czm_view3D:new s({size:1,datatype:o.Z.FLOAT_MAT4,getValue:function(e){return e.view3D}}),czm_viewRotation:new s({size:1,datatype:o.Z.FLOAT_MAT3,getValue:function(e){return e.viewRotation}}),czm_viewRotation3D:new s({size:1,datatype:o.Z.FLOAT_MAT3,getValue:function(e){return e.viewRotation3D}}),czm_inverseView:new s({size:1,datatype:o.Z.FLOAT_MAT4,getValue:function(e){return e.inverseView}}),czm_inverseView3D:new s({size:1,datatype:o.Z.FLOAT_MAT4,getValue:function(e){return e.inverseView3D}}),czm_inverseViewRotation:new s({size:1,datatype:o.Z.FLOAT_MAT3,getValue:function(e){return e.inverseViewRotation}}),czm_inverseViewRotation3D:new s({size:1,datatype:o.Z.FLOAT_MAT3,getValue:function(e){return e.inverseViewRotation3D}}),czm_projection:new s({size:1,datatype:o.Z.FLOAT_MAT4,getValue:function(e){return e.projection}}),czm_inverseProjection:new s({size:1,datatype:o.Z.FLOAT_MAT4,getValue:function(e){return e.inverseProjection}}),czm_infiniteProjection:new s({size:1,datatype:o.Z.FLOAT_MAT4,getValue:function(e){return e.infiniteProjection}}),czm_modelView:new s({size:1,datatype:o.Z.FLOAT_MAT4,getValue:function(e){return e.modelView}}),czm_modelView3D:new s({size:1,datatype:o.Z.FLOAT_MAT4,getValue:function(e){return e.modelView3D}}),czm_modelViewRelativeToEye:new s({size:1,datatype:o.Z.FLOAT_MAT4,getValue:function(e){return e.modelViewRelativeToEye}}),czm_inverseModelView:new s({size:1,datatype:o.Z.FLOAT_MAT4,getValue:function(e){return e.inverseModelView}}),czm_inverseModelView3D:new s({size:1,datatype:o.Z.FLOAT_MAT4,getValue:function(e){return e.inverseModelView3D}}),czm_viewProjection:new s({size:1,datatype:o.Z.FLOAT_MAT4,getValue:function(e){return e.viewProjection}}),czm_inverseViewProjection:new s({size:1,datatype:o.Z.FLOAT_MAT4,getValue:function(e){return e.inverseViewProjection}}),czm_modelViewProjection:new s({size:1,datatype:o.Z.FLOAT_MAT4,getValue:function(e){return e.modelViewProjection}}),czm_inverseModelViewProjection:new s({size:1,datatype:o.Z.FLOAT_MAT4,getValue:function(e){return e.inverseModelViewProjection}}),czm_modelViewProjectionRelativeToEye:new s({size:1,datatype:o.Z.FLOAT_MAT4,getValue:function(e){return e.modelViewProjectionRelativeToEye}}),czm_modelViewInfiniteProjection:new s({size:1,datatype:o.Z.FLOAT_MAT4,getValue:function(e){return e.modelViewInfiniteProjection}}),czm_orthographicIn3D:new s({size:1,datatype:o.Z.FLOAT,getValue:function(e){return e.orthographicIn3D?1:0}}),czm_normal:new s({size:1,datatype:o.Z.FLOAT_MAT3,getValue:function(e){return e.normal}}),czm_normal3D:new s({size:1,datatype:o.Z.FLOAT_MAT3,getValue:function(e){return e.normal3D}}),czm_inverseNormal:new s({size:1,datatype:o.Z.FLOAT_MAT3,getValue:function(e){return e.inverseNormal}}),czm_inverseNormal3D:new s({size:1,datatype:o.Z.FLOAT_MAT3,getValue:function(e){return e.inverseNormal3D}}),czm_eyeHeight:new s({size:1,datatype:o.Z.FLOAT,getValue:function(e){return e.eyeHeight}}),czm_eyeHeight2D:new s({size:1,datatype:o.Z.FLOAT_VEC2,getValue:function(e){return e.eyeHeight2D}}),czm_eyeEllipsoidNormalEC:new s({size:1,datatype:o.Z.FLOAT_VEC3,getValue:function(e){return e.eyeEllipsoidNormalEC}}),czm_eyeEllipsoidCurvature:new s({size:1,datatype:o.Z.FLOAT_VEC2,getValue:function(e){return e.eyeEllipsoidCurvature}}),czm_modelToEnu:new s({size:1,datatype:o.Z.FLOAT_MAT4,getValue:function(e){return e.modelToEnu}}),czm_enuToModel:new s({size:1,datatype:o.Z.FLOAT_MAT4,getValue:function(e){return e.enuToModel}}),czm_entireFrustum:new s({size:1,datatype:o.Z.FLOAT_VEC2,getValue:function(e){return e.entireFrustum}}),czm_currentFrustum:new s({size:1,datatype:o.Z.FLOAT_VEC2,getValue:function(e){return e.currentFrustum}}),czm_frustumPlanes:new s({size:1,datatype:o.Z.FLOAT_VEC4,getValue:function(e){return e.frustumPlanes}}),czm_farDepthFromNearPlusOne:new s({size:1,datatype:o.Z.FLOAT,getValue:function(e){return e.farDepthFromNearPlusOne}}),czm_log2FarDepthFromNearPlusOne:new s({size:1,datatype:o.Z.FLOAT,getValue:function(e){return e.log2FarDepthFromNearPlusOne}}),czm_oneOverLog2FarDepthFromNearPlusOne:new s({size:1,datatype:o.Z.FLOAT,getValue:function(e){return e.oneOverLog2FarDepthFromNearPlusOne}}),czm_sunPositionWC:new s({size:1,datatype:o.Z.FLOAT_VEC3,getValue:function(e){return e.sunPositionWC}}),czm_sunPositionColumbusView:new s({size:1,datatype:o.Z.FLOAT_VEC3,getValue:function(e){return e.sunPositionColumbusView}}),czm_sunDirectionEC:new s({size:1,datatype:o.Z.FLOAT_VEC3,getValue:function(e){return e.sunDirectionEC}}),czm_sunDirectionWC:new s({size:1,datatype:o.Z.FLOAT_VEC3,getValue:function(e){return e.sunDirectionWC}}),czm_moonDirectionEC:new s({size:1,datatype:o.Z.FLOAT_VEC3,getValue:function(e){return e.moonDirectionEC}}),czm_lightDirectionEC:new s({size:1,datatype:o.Z.FLOAT_VEC3,getValue:function(e){return e.lightDirectionEC}}),czm_lightDirectionWC:new s({size:1,datatype:o.Z.FLOAT_VEC3,getValue:function(e){return e.lightDirectionWC}}),czm_lightColor:new s({size:1,datatype:o.Z.FLOAT_VEC3,getValue:function(e){return e.lightColor}}),czm_lightColorHdr:new s({size:1,datatype:o.Z.FLOAT_VEC3,getValue:function(e){return e.lightColorHdr}}),czm_encodedCameraPositionMCHigh:new s({size:1,datatype:o.Z.FLOAT_VEC3,getValue:function(e){return e.encodedCameraPositionMCHigh}}),czm_encodedCameraPositionMCLow:new s({size:1,datatype:o.Z.FLOAT_VEC3,getValue:function(e){return e.encodedCameraPositionMCLow}}),czm_viewerPositionWC:new s({size:1,datatype:o.Z.FLOAT_VEC3,getValue:function(e){return r.Z.getTranslation(e.inverseView,a)}}),czm_frameNumber:new s({size:1,datatype:o.Z.FLOAT,getValue:function(e){return e.frameState.frameNumber}}),czm_morphTime:new s({size:1,datatype:o.Z.FLOAT,getValue:function(e){return e.frameState.morphTime}}),czm_sceneMode:new s({size:1,datatype:o.Z.FLOAT,getValue:function(e){return e.frameState.mode}}),czm_pass:new s({size:1,datatype:o.Z.FLOAT,getValue:function(e){return e.pass}}),czm_backgroundColor:new s({size:1,datatype:o.Z.FLOAT_VEC4,getValue:function(e){return e.backgroundColor}}),czm_brdfLut:new s({size:1,datatype:o.Z.SAMPLER_2D,getValue:function(e){return e.brdfLut}}),czm_environmentMap:new s({size:1,datatype:o.Z.SAMPLER_CUBE,getValue:function(e){return e.environmentMap}}),czm_specularEnvironmentMaps:new s({size:1,datatype:o.Z.SAMPLER_2D,getValue:function(e){return e.specularEnvironmentMaps}}),czm_specularEnvironmentMapSize:new s({size:1,datatype:o.Z.FLOAT_VEC2,getValue:function(e){return e.specularEnvironmentMapsDimensions}}),czm_specularEnvironmentMapsMaximumLOD:new s({size:1,datatype:o.Z.FLOAT,getValue:function(e){return e.specularEnvironmentMapsMaximumLOD}}),czm_sphericalHarmonicCoefficients:new s({size:9,datatype:o.Z.FLOAT_VEC3,getValue:function(e){return e.sphericalHarmonicCoefficients}}),czm_temeToPseudoFixed:new s({size:1,datatype:o.Z.FLOAT_MAT3,getValue:function(e){return e.temeToPseudoFixedMatrix}}),czm_pixelRatio:new s({size:1,datatype:o.Z.FLOAT,getValue:function(e){return e.pixelRatio}}),czm_fogDensity:new s({size:1,datatype:o.Z.FLOAT,getValue:function(e){return e.fogDensity}}),czm_fogMinimumBrightness:new s({size:1,datatype:o.Z.FLOAT,getValue:function(e){return e.fogMinimumBrightness}}),czm_atmosphereHsbShift:new s({size:1,datatype:o.Z.FLOAT_VEC3,getValue:function(e){return e.atmosphereHsbShift}}),czm_atmosphereLightIntensity:new s({size:1,datatype:o.Z.FLOAT,getValue:function(e){return e.atmosphereLightIntensity}}),czm_atmosphereRayleighCoefficient:new s({size:1,datatype:o.Z.FLOAT_VEC3,getValue:function(e){return e.atmosphereRayleighCoefficient}}),czm_atmosphereRayleighScaleHeight:new s({size:1,datatype:o.Z.FLOAT,getValue:function(e){return e.atmosphereRayleighScaleHeight}}),czm_atmosphereMieCoefficient:new s({size:1,datatype:o.Z.FLOAT_VEC3,getValue:function(e){return e.atmosphereMieCoefficient}}),czm_atmosphereMieScaleHeight:new s({size:1,datatype:o.Z.FLOAT,getValue:function(e){return e.atmosphereMieScaleHeight}}),czm_atmosphereMieAnisotropy:new s({size:1,datatype:o.Z.FLOAT,getValue:function(e){return e.atmosphereMieAnisotropy}}),czm_atmosphereDynamicLighting:new s({size:1,datatype:o.Z.FLOAT,getValue:function(e){return e.atmosphereDynamicLighting}}),czm_splitPosition:new s({size:1,datatype:o.Z.FLOAT,getValue:function(e){return e.splitPosition}}),czm_geometricToleranceOverMeter:new s({size:1,datatype:o.Z.FLOAT,getValue:function(e){return e.geometricToleranceOverMeter}}),czm_minimumDisableDepthTestDistance:new s({size:1,datatype:o.Z.FLOAT,getValue:function(e){return e.minimumDisableDepthTestDistance}}),czm_invertClassificationColor:new s({size:1,datatype:o.Z.FLOAT_VEC4,getValue:function(e){return e.invertClassificationColor}}),czm_gamma:new s({size:1,datatype:o.Z.FLOAT,getValue:function(e){return e.gamma}}),czm_ellipsoidRadii:new s({size:1,datatype:o.Z.FLOAT_VEC3,getValue:function(e){return e.ellipsoid.radii}}),czm_ellipsoidInverseRadii:new s({size:1,datatype:o.Z.FLOAT_VEC3,getValue:function(e){return e.ellipsoid.oneOverRadii}})};t.Z=c},9780:function(e,t,i){"use strict";var n=i(698),r=i(530),o=i(4572),a=i(9410),s=i(7998),l=i(9824),c=i(5837),u=i(512),h=i(2598);function d(e){if(e=(0,o.Z)(e,o.Z.EMPTY_OBJECT),n.Z.defined("options.context",e.context),!(0,a.Z)(e.typedArray)&&!(0,a.Z)(e.sizeInBytes))throw new l.Z("Either options.sizeInBytes or options.typedArray is required.");if((0,a.Z)(e.typedArray)&&(0,a.Z)(e.sizeInBytes))throw new l.Z("Cannot pass in both options.sizeInBytes and options.typedArray.");if((0,a.Z)(e.typedArray)&&(n.Z.typeOf.object("options.typedArray",e.typedArray),n.Z.typeOf.number("options.typedArray.byteLength",e.typedArray.byteLength)),!h.Z.validate(e.usage))throw new l.Z("usage is invalid.");let t=e.context._gl,i=e.bufferTarget,s=e.typedArray,c=e.sizeInBytes,u=e.usage,d=(0,a.Z)(s);d&&(c=s.byteLength),n.Z.typeOf.number.greaterThan("sizeInBytes",c,0);let f=t.createBuffer();t.bindBuffer(i,f),t.bufferData(i,d?s:c,u),t.bindBuffer(i,null),this._id=(0,r.Z)(),this._gl=t,this._webgl2=e.context._webgl2,this._bufferTarget=i,this._sizeInBytes=c,this._usage=u,this._buffer=f,this.vertexArrayDestroyable=!0}d.createVertexBuffer=function(e){return n.Z.defined("options.context",e.context),new d({context:e.context,bufferTarget:u.Z.ARRAY_BUFFER,typedArray:e.typedArray,sizeInBytes:e.sizeInBytes,usage:e.usage})},d.createIndexBuffer=function(e){if(n.Z.defined("options.context",e.context),!c.Z.validate(e.indexDatatype))throw new l.Z("Invalid indexDatatype.");if(e.indexDatatype===c.Z.UNSIGNED_INT&&!e.context.elementIndexUint)throw new l.Z("IndexDatatype.UNSIGNED_INT requires OES_element_index_uint, which is not supported on this system. Check context.elementIndexUint.");let t=e.context,i=e.indexDatatype,r=c.Z.getSizeInBytes(i),o=new d({context:t,bufferTarget:u.Z.ELEMENT_ARRAY_BUFFER,typedArray:e.typedArray,sizeInBytes:e.sizeInBytes,usage:e.usage}),a=o.sizeInBytes/r;return Object.defineProperties(o,{indexDatatype:{get:function(){return i}},bytesPerIndex:{get:function(){return r}},numberOfIndices:{get:function(){return a}}}),o},Object.defineProperties(d.prototype,{sizeInBytes:{get:function(){return this._sizeInBytes}},usage:{get:function(){return this._usage}}}),d.prototype._getBuffer=function(){return this._buffer},d.prototype.copyFromArrayView=function(e,t){t=(0,o.Z)(t,0),n.Z.defined("arrayView",e),n.Z.typeOf.number.lessThanOrEquals("offsetInBytes + arrayView.byteLength",t+e.byteLength,this._sizeInBytes);let i=this._gl,r=this._bufferTarget;i.bindBuffer(r,this._buffer),i.bufferSubData(r,t,e),i.bindBuffer(r,null)},d.prototype.copyFromBuffer=function(e,t,i,n){if(!this._webgl2)throw new l.Z("A WebGL 2 context is required.");if(!(0,a.Z)(e))throw new l.Z("readBuffer must be defined.");if(!(0,a.Z)(n)||n<=0)throw new l.Z("sizeInBytes must be defined and be greater than zero.");if(!(0,a.Z)(t)||t<0||t+n>e._sizeInBytes)throw new l.Z("readOffset must be greater than or equal to zero and readOffset + sizeInBytes must be less than of equal to readBuffer.sizeInBytes.");if(!(0,a.Z)(i)||i<0||i+n>this._sizeInBytes)throw new l.Z("writeOffset must be greater than or equal to zero and writeOffset + sizeInBytes must be less than of equal to this.sizeInBytes.");if(this._buffer===e._buffer&&(i>=t&&i<t+n||t>i&&t<i+n))throw new l.Z("When readBuffer is equal to this, the ranges [readOffset + sizeInBytes) and [writeOffset, writeOffset + sizeInBytes) must not overlap.");if(this._bufferTarget===u.Z.ELEMENT_ARRAY_BUFFER&&e._bufferTarget!==u.Z.ELEMENT_ARRAY_BUFFER||this._bufferTarget!==u.Z.ELEMENT_ARRAY_BUFFER&&e._bufferTarget===u.Z.ELEMENT_ARRAY_BUFFER)throw new l.Z("Can not copy an index buffer into another buffer type.");let r=u.Z.COPY_READ_BUFFER,o=u.Z.COPY_WRITE_BUFFER,s=this._gl;s.bindBuffer(o,this._buffer),s.bindBuffer(r,e._buffer),s.copyBufferSubData(r,o,t,i,n),s.bindBuffer(o,null),s.bindBuffer(r,null)},d.prototype.getBufferData=function(e,t,i,n){let r,s;if(t=(0,o.Z)(t,0),i=(0,o.Z)(i,0),!this._webgl2)throw new l.Z("A WebGL 2 context is required.");if(!(0,a.Z)(e))throw new l.Z("arrayView is required.");let c=e.byteLength;if((0,a.Z)(n)?(r=n,(0,a.Z)(c)?s=1:(c=e.length,s=e.BYTES_PER_ELEMENT)):(0,a.Z)(c)?(r=c-i,s=1):(r=(c=e.length)-i,s=e.BYTES_PER_ELEMENT),i<0||i>c)throw new l.Z("destinationOffset must be greater than zero and less than the arrayView length.");if(i+r>c)throw new l.Z("destinationOffset + length must be less than or equal to the arrayViewLength.");if(t<0||t>this._sizeInBytes)throw new l.Z("sourceOffset must be greater than zero and less than the buffers size.");if(t+r*s>this._sizeInBytes)throw new l.Z("sourceOffset + length must be less than the buffers size.");let h=this._gl,d=u.Z.COPY_READ_BUFFER;h.bindBuffer(d,this._buffer),h.getBufferSubData(d,t,e,i,n),h.bindBuffer(d,null)},d.prototype.isDestroyed=function(){return!1},d.prototype.destroy=function(){return this._gl.deleteBuffer(this._buffer),(0,s.Z)(this)},t.Z=d},2598:function(e,t,i){"use strict";var n=i(512);let r={STREAM_DRAW:n.Z.STREAM_DRAW,STATIC_DRAW:n.Z.STATIC_DRAW,DYNAMIC_DRAW:n.Z.DYNAMIC_DRAW,validate:function(e){return e===r.STREAM_DRAW||e===r.STATIC_DRAW||e===r.DYNAMIC_DRAW}};t.Z=Object.freeze(r)},7992:function(e,t,i){"use strict";var n=i(8177),r=i(4572);function o(e){e=(0,r.Z)(e,r.Z.EMPTY_OBJECT),this.color=e.color,this.depth=e.depth,this.stencil=e.stencil,this.renderState=e.renderState,this.framebuffer=e.framebuffer,this.owner=e.owner,this.pass=e.pass}o.ALL=Object.freeze(new o({color:new n.Z(0,0,0,0),depth:1,stencil:0})),o.prototype.execute=function(e,t){e.clear(this,t)},t.Z=o},1295:function(e,t,i){"use strict";var n=i(4572),r=i(7363);function o(e){e=(0,n.Z)(e,n.Z.EMPTY_OBJECT),this.vertexArray=e.vertexArray,this.fragmentShaderSource=e.fragmentShaderSource,this.shaderProgram=e.shaderProgram,this.uniformMap=e.uniformMap,this.outputTexture=e.outputTexture,this.preExecute=e.preExecute,this.postExecute=e.postExecute,this.canceled=e.canceled,this.persists=(0,n.Z)(e.persists,!1),this.pass=r.Z.COMPUTE,this.owner=e.owner}o.prototype.execute=function(e){e.execute(this)},t.Z=o},4318:function(e,t){"use strict";let i={_maximumCombinedTextureImageUnits:0,_maximumCubeMapSize:0,_maximumFragmentUniformVectors:0,_maximumTextureImageUnits:0,_maximumRenderbufferSize:0,_maximumTextureSize:0,_maximumVaryingVectors:0,_maximumVertexAttributes:0,_maximumVertexTextureImageUnits:0,_maximumVertexUniformVectors:0,_minimumAliasedLineWidth:0,_maximumAliasedLineWidth:0,_minimumAliasedPointSize:0,_maximumAliasedPointSize:0,_maximumViewportWidth:0,_maximumViewportHeight:0,_maximumTextureFilterAnisotropy:0,_maximumDrawBuffers:0,_maximumColorAttachments:0,_maximumSamples:0,_highpFloatSupported:!1,_highpIntSupported:!1};Object.defineProperties(i,{maximumCombinedTextureImageUnits:{get:function(){return i._maximumCombinedTextureImageUnits}},maximumCubeMapSize:{get:function(){return i._maximumCubeMapSize}},maximumFragmentUniformVectors:{get:function(){return i._maximumFragmentUniformVectors}},maximumTextureImageUnits:{get:function(){return i._maximumTextureImageUnits}},maximumRenderbufferSize:{get:function(){return i._maximumRenderbufferSize}},maximumTextureSize:{get:function(){return i._maximumTextureSize}},maximumVaryingVectors:{get:function(){return i._maximumVaryingVectors}},maximumVertexAttributes:{get:function(){return i._maximumVertexAttributes}},maximumVertexTextureImageUnits:{get:function(){return i._maximumVertexTextureImageUnits}},maximumVertexUniformVectors:{get:function(){return i._maximumVertexUniformVectors}},minimumAliasedLineWidth:{get:function(){return i._minimumAliasedLineWidth}},maximumAliasedLineWidth:{get:function(){return i._maximumAliasedLineWidth}},minimumAliasedPointSize:{get:function(){return i._minimumAliasedPointSize}},maximumAliasedPointSize:{get:function(){return i._maximumAliasedPointSize}},maximumViewportWidth:{get:function(){return i._maximumViewportWidth}},maximumViewportHeight:{get:function(){return i._maximumViewportHeight}},maximumTextureFilterAnisotropy:{get:function(){return i._maximumTextureFilterAnisotropy}},maximumDrawBuffers:{get:function(){return i._maximumDrawBuffers}},maximumColorAttachments:{get:function(){return i._maximumColorAttachments}},maximumSamples:{get:function(){return i._maximumSamples}},highpFloatSupported:{get:function(){return i._highpFloatSupported}},highpIntSupported:{get:function(){return i._highpIntSupported}}}),t.Z=i},9441:function(e,t,i){"use strict";i.d(t,{Z:function(){return Z}});var n=i(698),r=i(4572),o=i(9410),a=i(7998),s=i(9824),l=i(2150),c=i(6055),u=i(4318),h=i(5463);function d(e,t,i,n,r,o,a,s,l,c,u){this._context=e,this._texture=t,this._textureTarget=i,this._targetFace=n,this._pixelDatatype=a,this._internalFormat=r,this._pixelFormat=o,this._size=s,this._preMultiplyAlpha=l,this._flipY=c,this._initialized=u}Object.defineProperties(d.prototype,{pixelFormat:{get:function(){return this._pixelFormat}},pixelDatatype:{get:function(){return this._pixelDatatype}},_target:{get:function(){return this._targetFace}}}),d.prototype.copyFrom=function(e){n.Z.defined("options",e);let t=(0,r.Z)(e.xOffset,0),i=(0,r.Z)(e.yOffset,0);if(n.Z.defined("options.source",e.source),n.Z.typeOf.number.greaterThanOrEquals("xOffset",t,0),n.Z.typeOf.number.greaterThanOrEquals("yOffset",i,0),t+e.source.width>this._size)throw new s.Z("xOffset + options.source.width must be less than or equal to width.");if(i+e.source.height>this._size)throw new s.Z("yOffset + options.source.height must be less than or equal to height.");let a=e.source,l=this._context._gl,u=this._textureTarget,d=this._targetFace;l.activeTexture(l.TEXTURE0),l.bindTexture(u,this._texture);let f=a.width,p=a.height,m=a.arrayBufferView,_=this._size,g=this._pixelFormat,Z=this._internalFormat,y=this._pixelDatatype,b=this._preMultiplyAlpha,v=this._flipY,T=(0,r.Z)(e.skipColorSpaceConversion,!1),E=4;(0,o.Z)(m)&&(E=c.Z.alignmentInBytes(g,y,f)),l.pixelStorei(l.UNPACK_ALIGNMENT,E),T?l.pixelStorei(l.UNPACK_COLORSPACE_CONVERSION_WEBGL,l.NONE):l.pixelStorei(l.UNPACK_COLORSPACE_CONVERSION_WEBGL,l.BROWSER_DEFAULT_WEBGL);let x=!1;if(!this._initialized){if(0===t&&0===i&&f===_&&p===_)(0,o.Z)(m)?(l.pixelStorei(l.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),l.pixelStorei(l.UNPACK_FLIP_Y_WEBGL,!1),v&&(m=c.Z.flipY(m,g,y,_,_)),l.texImage2D(d,0,Z,_,_,0,g,h.Z.toWebGLConstant(y,this._context),m)):(l.pixelStorei(l.UNPACK_PREMULTIPLY_ALPHA_WEBGL,b),l.pixelStorei(l.UNPACK_FLIP_Y_WEBGL,v),l.texImage2D(d,0,Z,g,h.Z.toWebGLConstant(y,this._context),a)),x=!0;else{l.pixelStorei(l.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),l.pixelStorei(l.UNPACK_FLIP_Y_WEBGL,!1);let e=c.Z.createTypedArray(g,y,_,_);l.texImage2D(d,0,Z,_,_,0,g,h.Z.toWebGLConstant(y,this._context),e)}this._initialized=!0}x||((0,o.Z)(m)?(l.pixelStorei(l.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),l.pixelStorei(l.UNPACK_FLIP_Y_WEBGL,!1),v&&(m=c.Z.flipY(m,g,y,f,p)),l.texSubImage2D(d,0,t,i,f,p,g,h.Z.toWebGLConstant(y,this._context),m)):(l.pixelStorei(l.UNPACK_PREMULTIPLY_ALPHA_WEBGL,b),l.pixelStorei(l.UNPACK_FLIP_Y_WEBGL,v),l.texSubImage2D(d,0,t,i,g,h.Z.toWebGLConstant(y,this._context),a))),l.bindTexture(u,null)},d.prototype.copyFromFramebuffer=function(e,t,i,o,a,l){if(e=(0,r.Z)(e,0),t=(0,r.Z)(t,0),i=(0,r.Z)(i,0),o=(0,r.Z)(o,0),a=(0,r.Z)(a,this._size),l=(0,r.Z)(l,this._size),n.Z.typeOf.number.greaterThanOrEquals("xOffset",e,0),n.Z.typeOf.number.greaterThanOrEquals("yOffset",t,0),n.Z.typeOf.number.greaterThanOrEquals("framebufferXOffset",i,0),n.Z.typeOf.number.greaterThanOrEquals("framebufferYOffset",o,0),e+a>this._size)throw new s.Z("xOffset + source.width must be less than or equal to width.");if(t+l>this._size)throw new s.Z("yOffset + source.height must be less than or equal to height.");if(this._pixelDatatype===h.Z.FLOAT)throw new s.Z("Cannot call copyFromFramebuffer when the texture pixel data type is FLOAT.");if(this._pixelDatatype===h.Z.HALF_FLOAT)throw new s.Z("Cannot call copyFromFramebuffer when the texture pixel data type is HALF_FLOAT.");let c=this._context._gl,u=this._textureTarget;c.activeTexture(c.TEXTURE0),c.bindTexture(u,this._texture),c.copyTexSubImage2D(this._targetFace,0,e,t,i,o,a,l),c.bindTexture(u,null),this._initialized=!0};var f=i(4169),p=i(5483),m=i(5874),_=i(9138);function g(e){let t,i;e=(0,r.Z)(e,r.Z.EMPTY_OBJECT),n.Z.defined("options.context",e.context);let a=e.context,l=e.source;if((0,o.Z)(l)){let e=[l.positiveX,l.negativeX,l.positiveY,l.negativeY,l.positiveZ,l.negativeZ];if(!e[0]||!e[1]||!e[2]||!e[3]||!e[4]||!e[5])throw new s.Z("options.source requires positiveX, negativeX, positiveY, negativeY, positiveZ, and negativeZ faces.");t=e[0].width,i=e[0].height;for(let n=1;n<6;++n)if(Number(e[n].width)!==t||Number(e[n].height)!==i)throw new s.Z("Each face in options.source must have the same width and height.")}else t=e.width,i=e.height;let f=t,m=(0,r.Z)(e.pixelDatatype,h.Z.UNSIGNED_BYTE),_=(0,r.Z)(e.pixelFormat,c.Z.RGBA),g=c.Z.toInternalFormat(_,m,a);if(!(0,o.Z)(t)||!(0,o.Z)(i))throw new s.Z("options requires a source field to create an initialized cube map or width and height fields to create a blank cube map.");if(t!==i)throw new s.Z("Width must equal height.");if(f<=0)throw new s.Z("Width and height must be greater than zero.");if(f>u.Z.maximumCubeMapSize)throw new s.Z(`Width and height must be less than or equal to the maximum cube map size (${u.Z.maximumCubeMapSize}). Check maximumCubeMapSize.`);if(!c.Z.validate(_))throw new s.Z("Invalid options.pixelFormat.");if(c.Z.isDepthFormat(_))throw new s.Z("options.pixelFormat cannot be DEPTH_COMPONENT or DEPTH_STENCIL.");if(!h.Z.validate(m))throw new s.Z("Invalid options.pixelDatatype.");if(m===h.Z.FLOAT&&!a.floatingPointTexture)throw new s.Z("When options.pixelDatatype is FLOAT, this WebGL implementation must support the OES_texture_float extension.");if(m===h.Z.HALF_FLOAT&&!a.halfFloatingPointTexture)throw new s.Z("When options.pixelDatatype is HALF_FLOAT, this WebGL implementation must support the OES_texture_half_float extension.");let Z=6*c.Z.textureSizeInBytes(_,m,f,f),y=e.preMultiplyAlpha||_===c.Z.RGB||_===c.Z.LUMINANCE,b=(0,r.Z)(e.flipY,!0),v=(0,r.Z)(e.skipColorSpaceConversion,!1),T=a._gl,E=T.TEXTURE_CUBE_MAP,x=T.createTexture();function w(e,i,n,r,s){let l=i.arrayBufferView;(0,o.Z)(l)||(l=i.bufferView);let u=4;(0,o.Z)(l)&&(u=c.Z.alignmentInBytes(_,m,t)),T.pixelStorei(T.UNPACK_ALIGNMENT,u),s?T.pixelStorei(T.UNPACK_COLORSPACE_CONVERSION_WEBGL,T.NONE):T.pixelStorei(T.UNPACK_COLORSPACE_CONVERSION_WEBGL,T.BROWSER_DEFAULT_WEBGL),(0,o.Z)(l)?(T.pixelStorei(T.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),T.pixelStorei(T.UNPACK_FLIP_Y_WEBGL,!1),r&&(l=c.Z.flipY(l,_,m,f,f)),T.texImage2D(e,0,g,f,f,0,_,h.Z.toWebGLConstant(m,a),l)):(T.pixelStorei(T.UNPACK_PREMULTIPLY_ALPHA_WEBGL,n),T.pixelStorei(T.UNPACK_FLIP_Y_WEBGL,r),T.texImage2D(e,0,g,_,h.Z.toWebGLConstant(m,a),i))}T.activeTexture(T.TEXTURE0),T.bindTexture(E,x),(0,o.Z)(l)?(w(T.TEXTURE_CUBE_MAP_POSITIVE_X,l.positiveX,y,b,v),w(T.TEXTURE_CUBE_MAP_NEGATIVE_X,l.negativeX,y,b,v),w(T.TEXTURE_CUBE_MAP_POSITIVE_Y,l.positiveY,y,b,v),w(T.TEXTURE_CUBE_MAP_NEGATIVE_Y,l.negativeY,y,b,v),w(T.TEXTURE_CUBE_MAP_POSITIVE_Z,l.positiveZ,y,b,v),w(T.TEXTURE_CUBE_MAP_NEGATIVE_Z,l.negativeZ,y,b,v)):(T.texImage2D(T.TEXTURE_CUBE_MAP_POSITIVE_X,0,g,f,f,0,_,h.Z.toWebGLConstant(m,a),null),T.texImage2D(T.TEXTURE_CUBE_MAP_NEGATIVE_X,0,g,f,f,0,_,h.Z.toWebGLConstant(m,a),null),T.texImage2D(T.TEXTURE_CUBE_MAP_POSITIVE_Y,0,g,f,f,0,_,h.Z.toWebGLConstant(m,a),null),T.texImage2D(T.TEXTURE_CUBE_MAP_NEGATIVE_Y,0,g,f,f,0,_,h.Z.toWebGLConstant(m,a),null),T.texImage2D(T.TEXTURE_CUBE_MAP_POSITIVE_Z,0,g,f,f,0,_,h.Z.toWebGLConstant(m,a),null),T.texImage2D(T.TEXTURE_CUBE_MAP_NEGATIVE_Z,0,g,f,f,0,_,h.Z.toWebGLConstant(m,a),null)),T.bindTexture(E,null),this._context=a,this._textureFilterAnisotropic=a._textureFilterAnisotropic,this._textureTarget=E,this._texture=x,this._pixelFormat=_,this._pixelDatatype=m,this._size=f,this._hasMipmap=!1,this._sizeInBytes=Z,this._preMultiplyAlpha=y,this._flipY=b,this._sampler=void 0;let S=(0,o.Z)(l);this._positiveX=new d(a,x,E,T.TEXTURE_CUBE_MAP_POSITIVE_X,g,_,m,f,y,b,S),this._negativeX=new d(a,x,E,T.TEXTURE_CUBE_MAP_NEGATIVE_X,g,_,m,f,y,b,S),this._positiveY=new d(a,x,E,T.TEXTURE_CUBE_MAP_POSITIVE_Y,g,_,m,f,y,b,S),this._negativeY=new d(a,x,E,T.TEXTURE_CUBE_MAP_NEGATIVE_Y,g,_,m,f,y,b,S),this._positiveZ=new d(a,x,E,T.TEXTURE_CUBE_MAP_POSITIVE_Z,g,_,m,f,y,b,S),this._negativeZ=new d(a,x,E,T.TEXTURE_CUBE_MAP_NEGATIVE_Z,g,_,m,f,y,b,S),this.sampler=(0,o.Z)(e.sampler)?e.sampler:new p.Z}Object.defineProperties(g.prototype,{positiveX:{get:function(){return this._positiveX}},negativeX:{get:function(){return this._negativeX}},positiveY:{get:function(){return this._positiveY}},negativeY:{get:function(){return this._negativeY}},positiveZ:{get:function(){return this._positiveZ}},negativeZ:{get:function(){return this._negativeZ}},sampler:{get:function(){return this._sampler},set:function(e){let t=e.minificationFilter,i=e.magnificationFilter,n=t===_.Z.NEAREST_MIPMAP_NEAREST||t===_.Z.NEAREST_MIPMAP_LINEAR||t===_.Z.LINEAR_MIPMAP_NEAREST||t===_.Z.LINEAR_MIPMAP_LINEAR,r=this._context,a=this._pixelDatatype;(a!==h.Z.FLOAT||r.textureFloatLinear)&&(a!==h.Z.HALF_FLOAT||r.textureHalfFloatLinear)||(t=n?_.Z.NEAREST_MIPMAP_NEAREST:_.Z.NEAREST,i=m.Z.NEAREST);let s=r._gl,l=this._textureTarget;s.activeTexture(s.TEXTURE0),s.bindTexture(l,this._texture),s.texParameteri(l,s.TEXTURE_MIN_FILTER,t),s.texParameteri(l,s.TEXTURE_MAG_FILTER,i),s.texParameteri(l,s.TEXTURE_WRAP_S,e.wrapS),s.texParameteri(l,s.TEXTURE_WRAP_T,e.wrapT),(0,o.Z)(this._textureFilterAnisotropic)&&s.texParameteri(l,this._textureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,e.maximumAnisotropy),s.bindTexture(l,null),this._sampler=e}},pixelFormat:{get:function(){return this._pixelFormat}},pixelDatatype:{get:function(){return this._pixelDatatype}},width:{get:function(){return this._size}},height:{get:function(){return this._size}},sizeInBytes:{get:function(){return this._hasMipmap?Math.floor(4*this._sizeInBytes/3):this._sizeInBytes}},preMultiplyAlpha:{get:function(){return this._preMultiplyAlpha}},flipY:{get:function(){return this._flipY}},_target:{get:function(){return this._textureTarget}}}),g.prototype.generateMipmap=function(e){if(e=(0,r.Z)(e,f.Z.DONT_CARE),this._size>1&&!l.Z.isPowerOfTwo(this._size))throw new s.Z("width and height must be a power of two to call generateMipmap().");if(!f.Z.validate(e))throw new s.Z("hint is invalid.");this._hasMipmap=!0;let t=this._context._gl,i=this._textureTarget;t.hint(t.GENERATE_MIPMAP_HINT,e),t.activeTexture(t.TEXTURE0),t.bindTexture(i,this._texture),t.generateMipmap(i),t.bindTexture(i,null)},g.prototype.isDestroyed=function(){return!1},g.prototype.destroy=function(){return this._context._gl.deleteTexture(this._texture),this._positiveX=(0,a.Z)(this._positiveX),this._negativeX=(0,a.Z)(this._negativeX),this._positiveY=(0,a.Z)(this._positiveY),this._negativeY=(0,a.Z)(this._negativeY),this._positiveZ=(0,a.Z)(this._positiveZ),this._negativeZ=(0,a.Z)(this._negativeZ),(0,a.Z)(this)};var Z=g},356:function(e,t,i){"use strict";var n=i(4572),r=i(9410),o=i(5022);let a={CULL:1,OCCLUDE:2,EXECUTE_IN_CLOSEST_FRUSTUM:4,DEBUG_SHOW_BOUNDING_VOLUME:8,CAST_SHADOWS:16,RECEIVE_SHADOWS:32,PICK_ONLY:64,DEPTH_FOR_TRANSLUCENT_CLASSIFICATION:128};function s(e){e=(0,n.Z)(e,n.Z.EMPTY_OBJECT),this._boundingVolume=e.boundingVolume,this._orientedBoundingBox=e.orientedBoundingBox,this._modelMatrix=e.modelMatrix,this._primitiveType=(0,n.Z)(e.primitiveType,o.Z.TRIANGLES),this._vertexArray=e.vertexArray,this._count=e.count,this._offset=(0,n.Z)(e.offset,0),this._instanceCount=(0,n.Z)(e.instanceCount,0),this._shaderProgram=e.shaderProgram,this._uniformMap=e.uniformMap,this._renderState=e.renderState,this._framebuffer=e.framebuffer,this._pass=e.pass,this._owner=e.owner,this._debugOverlappingFrustums=0,this._pickId=e.pickId,this._flags=0,this.cull=(0,n.Z)(e.cull,!0),this.occlude=(0,n.Z)(e.occlude,!0),this.executeInClosestFrustum=(0,n.Z)(e.executeInClosestFrustum,!1),this.debugShowBoundingVolume=(0,n.Z)(e.debugShowBoundingVolume,!1),this.castShadows=(0,n.Z)(e.castShadows,!1),this.receiveShadows=(0,n.Z)(e.receiveShadows,!1),this.pickOnly=(0,n.Z)(e.pickOnly,!1),this.depthForTranslucentClassification=(0,n.Z)(e.depthForTranslucentClassification,!1),this.dirty=!0,this.lastDirtyTime=0,this.derivedCommands={}}function l(e,t){return(e._flags&t)===t}function c(e,t,i){i?e._flags|=t:e._flags&=~t}Object.defineProperties(s.prototype,{boundingVolume:{get:function(){return this._boundingVolume},set:function(e){this._boundingVolume!==e&&(this._boundingVolume=e,this.dirty=!0)}},orientedBoundingBox:{get:function(){return this._orientedBoundingBox},set:function(e){this._orientedBoundingBox!==e&&(this._orientedBoundingBox=e,this.dirty=!0)}},cull:{get:function(){return l(this,a.CULL)},set:function(e){l(this,a.CULL)!==e&&(c(this,a.CULL,e),this.dirty=!0)}},occlude:{get:function(){return l(this,a.OCCLUDE)},set:function(e){l(this,a.OCCLUDE)!==e&&(c(this,a.OCCLUDE,e),this.dirty=!0)}},modelMatrix:{get:function(){return this._modelMatrix},set:function(e){this._modelMatrix!==e&&(this._modelMatrix=e,this.dirty=!0)}},primitiveType:{get:function(){return this._primitiveType},set:function(e){this._primitiveType!==e&&(this._primitiveType=e,this.dirty=!0)}},vertexArray:{get:function(){return this._vertexArray},set:function(e){this._vertexArray!==e&&(this._vertexArray=e,this.dirty=!0)}},count:{get:function(){return this._count},set:function(e){this._count!==e&&(this._count=e,this.dirty=!0)}},offset:{get:function(){return this._offset},set:function(e){this._offset!==e&&(this._offset=e,this.dirty=!0)}},instanceCount:{get:function(){return this._instanceCount},set:function(e){this._instanceCount!==e&&(this._instanceCount=e,this.dirty=!0)}},shaderProgram:{get:function(){return this._shaderProgram},set:function(e){this._shaderProgram!==e&&(this._shaderProgram=e,this.dirty=!0)}},castShadows:{get:function(){return l(this,a.CAST_SHADOWS)},set:function(e){l(this,a.CAST_SHADOWS)!==e&&(c(this,a.CAST_SHADOWS,e),this.dirty=!0)}},receiveShadows:{get:function(){return l(this,a.RECEIVE_SHADOWS)},set:function(e){l(this,a.RECEIVE_SHADOWS)!==e&&(c(this,a.RECEIVE_SHADOWS,e),this.dirty=!0)}},uniformMap:{get:function(){return this._uniformMap},set:function(e){this._uniformMap!==e&&(this._uniformMap=e,this.dirty=!0)}},renderState:{get:function(){return this._renderState},set:function(e){this._renderState!==e&&(this._renderState=e,this.dirty=!0)}},framebuffer:{get:function(){return this._framebuffer},set:function(e){this._framebuffer!==e&&(this._framebuffer=e,this.dirty=!0)}},pass:{get:function(){return this._pass},set:function(e){this._pass!==e&&(this._pass=e,this.dirty=!0)}},executeInClosestFrustum:{get:function(){return l(this,a.EXECUTE_IN_CLOSEST_FRUSTUM)},set:function(e){l(this,a.EXECUTE_IN_CLOSEST_FRUSTUM)!==e&&(c(this,a.EXECUTE_IN_CLOSEST_FRUSTUM,e),this.dirty=!0)}},owner:{get:function(){return this._owner},set:function(e){this._owner!==e&&(this._owner=e,this.dirty=!0)}},debugShowBoundingVolume:{get:function(){return l(this,a.DEBUG_SHOW_BOUNDING_VOLUME)},set:function(e){l(this,a.DEBUG_SHOW_BOUNDING_VOLUME)!==e&&(c(this,a.DEBUG_SHOW_BOUNDING_VOLUME,e),this.dirty=!0)}},debugOverlappingFrustums:{get:function(){return this._debugOverlappingFrustums},set:function(e){this._debugOverlappingFrustums!==e&&(this._debugOverlappingFrustums=e,this.dirty=!0)}},pickId:{get:function(){return this._pickId},set:function(e){this._pickId!==e&&(this._pickId=e,this.dirty=!0)}},pickOnly:{get:function(){return l(this,a.PICK_ONLY)},set:function(e){l(this,a.PICK_ONLY)!==e&&(c(this,a.PICK_ONLY,e),this.dirty=!0)}},depthForTranslucentClassification:{get:function(){return l(this,a.DEPTH_FOR_TRANSLUCENT_CLASSIFICATION)},set:function(e){l(this,a.DEPTH_FOR_TRANSLUCENT_CLASSIFICATION)!==e&&(c(this,a.DEPTH_FOR_TRANSLUCENT_CLASSIFICATION,e),this.dirty=!0)}}}),s.shallowClone=function(e,t){if((0,r.Z)(e))return(0,r.Z)(t)||(t=new s),t._boundingVolume=e._boundingVolume,t._orientedBoundingBox=e._orientedBoundingBox,t._modelMatrix=e._modelMatrix,t._primitiveType=e._primitiveType,t._vertexArray=e._vertexArray,t._count=e._count,t._offset=e._offset,t._instanceCount=e._instanceCount,t._shaderProgram=e._shaderProgram,t._uniformMap=e._uniformMap,t._renderState=e._renderState,t._framebuffer=e._framebuffer,t._pass=e._pass,t._owner=e._owner,t._debugOverlappingFrustums=e._debugOverlappingFrustums,t._pickId=e._pickId,t._flags=e._flags,t.dirty=!0,t.lastDirtyTime=0,t},s.prototype.execute=function(e,t){e.draw(this,t)},t.Z=s},1680:function(e,t,i){"use strict";var n=i(698),r=i(4572),o=i(9410),a=i(7998),s=i(9824),l=i(6055),c=i(4318),u=i(5463);function h(e,t,i){let n=e._gl;n.framebufferTexture2D(n.FRAMEBUFFER,t,i._target,i._texture,0)}function d(e,t,i){let n=e._gl;n.framebufferRenderbuffer(n.FRAMEBUFFER,t,n.RENDERBUFFER,i._getRenderbuffer())}function f(e){let t,i,a,f,p;let m=(e=(0,r.Z)(e,r.Z.EMPTY_OBJECT)).context;n.Z.defined("options.context",m);let _=m._gl,g=c.Z.maximumColorAttachments;if(this._gl=_,this._framebuffer=_.createFramebuffer(),this._colorTextures=[],this._colorRenderbuffers=[],this._activeColorAttachments=[],this._depthTexture=void 0,this._depthRenderbuffer=void 0,this._stencilRenderbuffer=void 0,this._depthStencilTexture=void 0,this._depthStencilRenderbuffer=void 0,this.destroyAttachments=(0,r.Z)(e.destroyAttachments,!0),(0,o.Z)(e.colorTextures)&&(0,o.Z)(e.colorRenderbuffers))throw new s.Z("Cannot have both color texture and color renderbuffer attachments.");if((0,o.Z)(e.depthTexture)&&(0,o.Z)(e.depthRenderbuffer))throw new s.Z("Cannot have both a depth texture and depth renderbuffer attachment.");if((0,o.Z)(e.depthStencilTexture)&&(0,o.Z)(e.depthStencilRenderbuffer))throw new s.Z("Cannot have both a depth-stencil texture and depth-stencil renderbuffer attachment.");let Z=(0,o.Z)(e.depthTexture)||(0,o.Z)(e.depthRenderbuffer),y=(0,o.Z)(e.depthStencilTexture)||(0,o.Z)(e.depthStencilRenderbuffer);if(Z&&y)throw new s.Z("Cannot have both a depth and depth-stencil attachment.");if((0,o.Z)(e.stencilRenderbuffer)&&y)throw new s.Z("Cannot have both a stencil and depth-stencil attachment.");if(Z&&(0,o.Z)(e.stencilRenderbuffer))throw new s.Z("Cannot have both a depth and stencil attachment.");if(this._bind(),(0,o.Z)(e.colorTextures)){let i=e.colorTextures;if((f=this._colorTextures.length=this._activeColorAttachments.length=i.length)>g)throw new s.Z("The number of color attachments exceeds the number supported.");for(a=0;a<f;++a){if(t=i[a],!l.Z.isColorFormat(t.pixelFormat))throw new s.Z("The color-texture pixel-format must be a color format.");if(t.pixelDatatype===u.Z.FLOAT&&!m.colorBufferFloat)throw new s.Z("The color texture pixel datatype is FLOAT and the WebGL implementation does not support the EXT_color_buffer_float or WEBGL_color_buffer_float extensions. See Context.colorBufferFloat.");if(t.pixelDatatype===u.Z.HALF_FLOAT&&!m.colorBufferHalfFloat)throw new s.Z("The color texture pixel datatype is HALF_FLOAT and the WebGL implementation does not support the EXT_color_buffer_half_float extension. See Context.colorBufferHalfFloat.");h(this,p=this._gl.COLOR_ATTACHMENT0+a,t),this._activeColorAttachments[a]=p,this._colorTextures[a]=t}}if((0,o.Z)(e.colorRenderbuffers)){let t=e.colorRenderbuffers;if((f=this._colorRenderbuffers.length=this._activeColorAttachments.length=t.length)>g)throw new s.Z("The number of color attachments exceeds the number supported.");for(a=0;a<f;++a)i=t[a],d(this,p=this._gl.COLOR_ATTACHMENT0+a,i),this._activeColorAttachments[a]=p,this._colorRenderbuffers[a]=i}if((0,o.Z)(e.depthTexture)){if((t=e.depthTexture).pixelFormat!==l.Z.DEPTH_COMPONENT)throw new s.Z("The depth-texture pixel-format must be DEPTH_COMPONENT.");h(this,this._gl.DEPTH_ATTACHMENT,t),this._depthTexture=t}if((0,o.Z)(e.depthRenderbuffer)&&(i=e.depthRenderbuffer,d(this,this._gl.DEPTH_ATTACHMENT,i),this._depthRenderbuffer=i),(0,o.Z)(e.stencilRenderbuffer)&&(i=e.stencilRenderbuffer,d(this,this._gl.STENCIL_ATTACHMENT,i),this._stencilRenderbuffer=i),(0,o.Z)(e.depthStencilTexture)){if((t=e.depthStencilTexture).pixelFormat!==l.Z.DEPTH_STENCIL)throw new s.Z("The depth-stencil pixel-format must be DEPTH_STENCIL.");h(this,this._gl.DEPTH_STENCIL_ATTACHMENT,t),this._depthStencilTexture=t}(0,o.Z)(e.depthStencilRenderbuffer)&&(i=e.depthStencilRenderbuffer,d(this,this._gl.DEPTH_STENCIL_ATTACHMENT,i),this._depthStencilRenderbuffer=i),this._unBind()}Object.defineProperties(f.prototype,{status:{get:function(){this._bind();let e=this._gl.checkFramebufferStatus(this._gl.FRAMEBUFFER);return this._unBind(),e}},numberOfColorAttachments:{get:function(){return this._activeColorAttachments.length}},depthTexture:{get:function(){return this._depthTexture}},depthRenderbuffer:{get:function(){return this._depthRenderbuffer}},stencilRenderbuffer:{get:function(){return this._stencilRenderbuffer}},depthStencilTexture:{get:function(){return this._depthStencilTexture}},depthStencilRenderbuffer:{get:function(){return this._depthStencilRenderbuffer}},hasDepthAttachment:{get:function(){return!!(this.depthTexture||this.depthRenderbuffer||this.depthStencilTexture||this.depthStencilRenderbuffer)}}}),f.prototype._bind=function(){let e=this._gl;e.bindFramebuffer(e.FRAMEBUFFER,this._framebuffer)},f.prototype._unBind=function(){let e=this._gl;e.bindFramebuffer(e.FRAMEBUFFER,null)},f.prototype.bindDraw=function(){let e=this._gl;e.bindFramebuffer(e.DRAW_FRAMEBUFFER,this._framebuffer)},f.prototype.bindRead=function(){let e=this._gl;e.bindFramebuffer(e.READ_FRAMEBUFFER,this._framebuffer)},f.prototype._getActiveColorAttachments=function(){return this._activeColorAttachments},f.prototype.getColorTexture=function(e){if(!(0,o.Z)(e)||e<0||e>=this._colorTextures.length)throw new s.Z("index is required, must be greater than or equal to zero and must be less than the number of color attachments.");return this._colorTextures[e]},f.prototype.getColorRenderbuffer=function(e){if(!(0,o.Z)(e)||e<0||e>=this._colorRenderbuffers.length)throw new s.Z("index is required, must be greater than or equal to zero and must be less than the number of color attachments.");return this._colorRenderbuffers[e]},f.prototype.isDestroyed=function(){return!1},f.prototype.destroy=function(){if(this.destroyAttachments){let e=0,t=this._colorTextures,i=t.length;for(;e<i;++e){let i=t[e];(0,o.Z)(i)&&i.destroy()}let n=this._colorRenderbuffers;for(e=0,i=n.length;e<i;++e){let t=n[e];(0,o.Z)(t)&&t.destroy()}this._depthTexture=this._depthTexture&&this._depthTexture.destroy(),this._depthRenderbuffer=this._depthRenderbuffer&&this._depthRenderbuffer.destroy(),this._stencilRenderbuffer=this._stencilRenderbuffer&&this._stencilRenderbuffer.destroy(),this._depthStencilTexture=this._depthStencilTexture&&this._depthStencilTexture.destroy(),this._depthStencilRenderbuffer=this._depthStencilRenderbuffer&&this._depthStencilRenderbuffer.destroy()}return this._gl.deleteFramebuffer(this._framebuffer),(0,a.Z)(this)},t.Z=f},2763:function(e,t,i){"use strict";i.d(t,{Z:function(){return g}});var n=i(1680),r=i(698),o=i(4572),a=i(9410),s=i(7998),l=i(9824);function c(e){let t=(e=(0,o.Z)(e,o.Z.EMPTY_OBJECT)).context,i=e.width,s=e.height;r.Z.defined("options.context",t),r.Z.defined("options.width",i),r.Z.defined("options.height",s),this._width=i,this._height=s;let c=e.colorRenderbuffers,u=e.colorTextures;if((0,a.Z)(c)!==(0,a.Z)(u))throw new l.Z("Both color renderbuffer and texture attachments must be provided.");let h=e.depthStencilRenderbuffer,d=e.depthStencilTexture;if((0,a.Z)(h)!==(0,a.Z)(d))throw new l.Z("Both depth-stencil renderbuffer and texture attachments must be provided.");this._renderFramebuffer=new n.Z({context:t,colorRenderbuffers:c,depthStencilRenderbuffer:h,destroyAttachments:e.destroyAttachments}),this._colorFramebuffer=new n.Z({context:t,colorTextures:u,depthStencilTexture:d,destroyAttachments:e.destroyAttachments})}c.prototype.getRenderFramebuffer=function(){return this._renderFramebuffer},c.prototype.getColorFramebuffer=function(){return this._colorFramebuffer},c.prototype.blitFramebuffers=function(e,t){this._renderFramebuffer.bindRead(),this._colorFramebuffer.bindDraw();let i=e._gl,n=0;this._colorFramebuffer._colorTextures.length>0&&(n|=i.COLOR_BUFFER_BIT),(0,a.Z)(this._colorFramebuffer.depthStencilTexture)&&(n|=i.DEPTH_BUFFER_BIT|(t?i.STENCIL_BUFFER_BIT:0)),i.blitFramebuffer(0,0,this._width,this._height,0,0,this._width,this._height,n,i.NEAREST),i.bindFramebuffer(i.READ_FRAMEBUFFER,null),i.bindFramebuffer(i.DRAW_FRAMEBUFFER,null)},c.prototype.isDestroyed=function(){return!1},c.prototype.destroy=function(){return this._renderFramebuffer.destroy(),this._colorFramebuffer.destroy(),(0,s.Z)(this)};var u=i(5463),h=i(7975),d=i(1419),f=i(5483),p=i(4909),m=i(6055);function _(e){if(e=(0,o.Z)(e,o.Z.EMPTY_OBJECT),this._numSamples=(0,o.Z)(e.numSamples,1),this._colorAttachmentsLength=(0,o.Z)(e.colorAttachmentsLength,1),this._color=(0,o.Z)(e.color,!0),this._depth=(0,o.Z)(e.depth,!1),this._depthStencil=(0,o.Z)(e.depthStencil,!1),this._supportsDepthTexture=(0,o.Z)(e.supportsDepthTexture,!1),!this._color&&!this._depth&&!this._depthStencil)throw new l.Z("Must enable at least one type of framebuffer attachment.");if(this._depth&&this._depthStencil)throw new l.Z("Cannot have both a depth and depth-stencil attachment.");this._createColorAttachments=(0,o.Z)(e.createColorAttachments,!0),this._createDepthAttachments=(0,o.Z)(e.createDepthAttachments,!0),this._pixelDatatype=e.pixelDatatype,this._pixelFormat=e.pixelFormat,this._width=void 0,this._height=void 0,this._framebuffer=void 0,this._multisampleFramebuffer=void 0,this._colorTextures=void 0,this._color&&(this._colorTextures=Array(this._colorAttachmentsLength),this._colorRenderbuffers=Array(this._colorAttachmentsLength)),this._colorRenderbuffer=void 0,this._depthStencilRenderbuffer=void 0,this._depthStencilTexture=void 0,this._depthRenderbuffer=void 0,this._depthTexture=void 0,this._attachmentsDirty=!1}Object.defineProperties(_.prototype,{framebuffer:{get:function(){return this._numSamples>1?this._multisampleFramebuffer.getRenderFramebuffer():this._framebuffer}},numSamples:{get:function(){return this._numSamples}},status:{get:function(){return this.framebuffer.status}}}),_.prototype.isDirty=function(e,t,i,n,r){i=(0,o.Z)(i,1);let s=this._width!==e||this._height!==t,l=this._numSamples!==i,c=(0,a.Z)(n)&&this._pixelDatatype!==n||(0,a.Z)(r)&&this._pixelFormat!==r,u=1===i?(0,a.Z)(this._framebuffer):(0,a.Z)(this._multisampleFramebuffer);return this._attachmentsDirty||s||l||c||!u||this._color&&!(0,a.Z)(this._colorTextures[0])},_.prototype.update=function(e,t,i,r,s,_){if(!(0,a.Z)(t)||!(0,a.Z)(i))throw new l.Z("width and height must be defined.");if(r=e.msaa?(0,o.Z)(r,1):1,s=(0,o.Z)(s,this._color?(0,o.Z)(this._pixelDatatype,u.Z.UNSIGNED_BYTE):void 0),_=(0,o.Z)(_,this._color?(0,o.Z)(this._pixelFormat,m.Z.RGBA):void 0),this.isDirty(t,i,r,s,_)){if(this.destroy(),this._width=t,this._height=i,this._numSamples=r,this._pixelDatatype=s,this._pixelFormat=_,this._attachmentsDirty=!1,this._color&&this._createColorAttachments){for(let n=0;n<this._colorAttachmentsLength;++n)if(this._colorTextures[n]=new p.Z({context:e,width:t,height:i,pixelFormat:_,pixelDatatype:s,sampler:f.Z.NEAREST}),this._numSamples>1){let r=d.Z.getColorFormat(s);this._colorRenderbuffers[n]=new h.Z({context:e,width:t,height:i,format:r,numSamples:this._numSamples})}}this._depthStencil&&this._createDepthAttachments&&(this._supportsDepthTexture&&e.depthTexture?(this._depthStencilTexture=new p.Z({context:e,width:t,height:i,pixelFormat:m.Z.DEPTH_STENCIL,pixelDatatype:u.Z.UNSIGNED_INT_24_8,sampler:f.Z.NEAREST}),this._numSamples>1&&(this._depthStencilRenderbuffer=new h.Z({context:e,width:t,height:i,format:d.Z.DEPTH24_STENCIL8,numSamples:this._numSamples}))):this._depthStencilRenderbuffer=new h.Z({context:e,width:t,height:i,format:d.Z.DEPTH_STENCIL})),this._depth&&this._createDepthAttachments&&(this._supportsDepthTexture&&e.depthTexture?this._depthTexture=new p.Z({context:e,width:t,height:i,pixelFormat:m.Z.DEPTH_COMPONENT,pixelDatatype:u.Z.UNSIGNED_INT,sampler:f.Z.NEAREST}):this._depthRenderbuffer=new h.Z({context:e,width:t,height:i,format:d.Z.DEPTH_COMPONENT16})),this._numSamples>1?this._multisampleFramebuffer=new c({context:e,width:this._width,height:this._height,colorTextures:this._colorTextures,colorRenderbuffers:this._colorRenderbuffers,depthStencilTexture:this._depthStencilTexture,depthStencilRenderbuffer:this._depthStencilRenderbuffer,destroyAttachments:!1}):this._framebuffer=new n.Z({context:e,colorTextures:this._colorTextures,depthTexture:this._depthTexture,depthRenderbuffer:this._depthRenderbuffer,depthStencilTexture:this._depthStencilTexture,depthStencilRenderbuffer:this._depthStencilRenderbuffer,destroyAttachments:!1})}},_.prototype.getColorTexture=function(e){if((e=(0,o.Z)(e,0))>=this._colorAttachmentsLength)throw new l.Z("index must be smaller than total number of color attachments.");return this._colorTextures[e]},_.prototype.setColorTexture=function(e,t){if(t=(0,o.Z)(t,0),this._createColorAttachments)throw new l.Z("createColorAttachments must be false if setColorTexture is called.");if(t>=this._colorAttachmentsLength)throw new l.Z("index must be smaller than total number of color attachments.");this._attachmentsDirty=e!==this._colorTextures[t],this._colorTextures[t]=e},_.prototype.getColorRenderbuffer=function(e){if((e=(0,o.Z)(e,0))>=this._colorAttachmentsLength)throw new l.Z("index must be smaller than total number of color attachments.");return this._colorRenderbuffers[e]},_.prototype.setColorRenderbuffer=function(e,t){if(t=(0,o.Z)(t,0),this._createColorAttachments)throw new l.Z("createColorAttachments must be false if setColorRenderbuffer is called.");if(t>=this._colorAttachmentsLength)throw new l.Z("index must be smaller than total number of color attachments.");this._attachmentsDirty=e!==this._colorRenderbuffers[t],this._colorRenderbuffers[t]=e},_.prototype.getDepthRenderbuffer=function(){return this._depthRenderbuffer},_.prototype.setDepthRenderbuffer=function(e){if(this._createDepthAttachments)throw new l.Z("createDepthAttachments must be false if setDepthRenderbuffer is called.");this._attachmentsDirty=e!==this._depthRenderbuffer,this._depthRenderbuffer=e},_.prototype.getDepthTexture=function(){return this._depthTexture},_.prototype.setDepthTexture=function(e){if(this._createDepthAttachments)throw new l.Z("createDepthAttachments must be false if setDepthTexture is called.");this._attachmentsDirty=e!==this._depthTexture,this._depthTexture=e},_.prototype.getDepthStencilRenderbuffer=function(){return this._depthStencilRenderbuffer},_.prototype.setDepthStencilRenderbuffer=function(e){if(this._createDepthAttachments)throw new l.Z("createDepthAttachments must be false if setDepthStencilRenderbuffer is called.");this._attachmentsDirty=e!==this._depthStencilRenderbuffer,this._depthStencilRenderbuffer=e},_.prototype.getDepthStencilTexture=function(){return this._depthStencilTexture},_.prototype.setDepthStencilTexture=function(e){if(this._createDepthAttachments)throw new l.Z("createDepthAttachments must be false if setDepthStencilTexture is called.");this._attachmentsDirty=e!==this._depthStencilTexture,this._depthStencilTexture=e},_.prototype.prepareTextures=function(e,t){this._numSamples>1&&this._multisampleFramebuffer.blitFramebuffers(e,t)},_.prototype.clear=function(e,t,i){let n=t.framebuffer;t.framebuffer=this.framebuffer,t.execute(e,i),t.framebuffer=n},_.prototype.destroyFramebuffer=function(){this._framebuffer=this._framebuffer&&this._framebuffer.destroy(),this._multisampleFramebuffer=this._multisampleFramebuffer&&this._multisampleFramebuffer.destroy()},_.prototype.destroy=function(){if(this._color){let e;let t=this._colorTextures.length;for(e=0;e<t;++e){let t=this._colorTextures[e];this._createColorAttachments&&(0,a.Z)(t)&&!t.isDestroyed()&&(this._colorTextures[e].destroy(),this._colorTextures[e]=void 0),(0,a.Z)(t)&&t.isDestroyed()&&(this._colorTextures[e]=void 0);let i=this._colorRenderbuffers[e];this._createColorAttachments&&(0,a.Z)(i)&&!i.isDestroyed()&&(this._colorRenderbuffers[e].destroy(),this._colorRenderbuffers[e]=void 0),(0,a.Z)(i)&&i.isDestroyed()&&(this._colorRenderbuffers[e]=void 0)}}this._depthStencil&&(this._createDepthAttachments&&(this._depthStencilTexture=this._depthStencilTexture&&this._depthStencilTexture.destroy(),this._depthStencilRenderbuffer=this._depthStencilRenderbuffer&&this._depthStencilRenderbuffer.destroy()),(0,a.Z)(this._depthStencilTexture)&&this._depthStencilTexture.isDestroyed()&&(this._depthStencilTexture=void 0),(0,a.Z)(this._depthStencilRenderbuffer)&&this._depthStencilRenderbuffer.isDestroyed()&&(this._depthStencilRenderbuffer=void 0)),this._depth&&(this._createDepthAttachments&&(this._depthTexture=this._depthTexture&&this._depthTexture.destroy(),this._depthRenderbuffer=this._depthRenderbuffer&&this._depthRenderbuffer.destroy()),(0,a.Z)(this._depthTexture)&&this._depthTexture.isDestroyed()&&(this._depthTexture=void 0),(0,a.Z)(this._depthRenderbuffer)&&this._depthRenderbuffer.isDestroyed()&&(this._depthRenderbuffer=void 0)),this.destroyFramebuffer()};var g=_},4169:function(e,t,i){"use strict";var n=i(512);let r={DONT_CARE:n.Z.DONT_CARE,FASTEST:n.Z.FASTEST,NICEST:n.Z.NICEST,validate:function(e){return e===r.DONT_CARE||e===r.FASTEST||e===r.NICEST}};t.Z=Object.freeze(r)},7363:function(e,t){"use strict";t.Z=Object.freeze({ENVIRONMENT:0,COMPUTE:1,GLOBE:2,TERRAIN_CLASSIFICATION:3,CESIUM_3D_TILE:4,CESIUM_3D_TILE_CLASSIFICATION:5,CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW:6,OPAQUE:7,TRANSLUCENT:8,VOXELS:9,OVERLAY:10,NUMBER_OF_PASSES:11})},5463:function(e,t,i){"use strict";var n=i(512);let r={UNSIGNED_BYTE:n.Z.UNSIGNED_BYTE,UNSIGNED_SHORT:n.Z.UNSIGNED_SHORT,UNSIGNED_INT:n.Z.UNSIGNED_INT,FLOAT:n.Z.FLOAT,HALF_FLOAT:n.Z.HALF_FLOAT_OES,UNSIGNED_INT_24_8:n.Z.UNSIGNED_INT_24_8,UNSIGNED_SHORT_4_4_4_4:n.Z.UNSIGNED_SHORT_4_4_4_4,UNSIGNED_SHORT_5_5_5_1:n.Z.UNSIGNED_SHORT_5_5_5_1,UNSIGNED_SHORT_5_6_5:n.Z.UNSIGNED_SHORT_5_6_5};r.toWebGLConstant=function(e,t){switch(e){case r.UNSIGNED_BYTE:return n.Z.UNSIGNED_BYTE;case r.UNSIGNED_SHORT:return n.Z.UNSIGNED_SHORT;case r.UNSIGNED_INT:return n.Z.UNSIGNED_INT;case r.FLOAT:return n.Z.FLOAT;case r.HALF_FLOAT:return t.webgl2?n.Z.HALF_FLOAT:n.Z.HALF_FLOAT_OES;case r.UNSIGNED_INT_24_8:return n.Z.UNSIGNED_INT_24_8;case r.UNSIGNED_SHORT_4_4_4_4:return n.Z.UNSIGNED_SHORT_4_4_4_4;case r.UNSIGNED_SHORT_5_5_5_1:return n.Z.UNSIGNED_SHORT_5_5_5_1;case r.UNSIGNED_SHORT_5_6_5:return r.UNSIGNED_SHORT_5_6_5}},r.isPacked=function(e){return e===r.UNSIGNED_INT_24_8||e===r.UNSIGNED_SHORT_4_4_4_4||e===r.UNSIGNED_SHORT_5_5_5_1||e===r.UNSIGNED_SHORT_5_6_5},r.sizeInBytes=function(e){switch(e){case r.UNSIGNED_BYTE:return 1;case r.UNSIGNED_SHORT:case r.UNSIGNED_SHORT_4_4_4_4:case r.UNSIGNED_SHORT_5_5_5_1:case r.UNSIGNED_SHORT_5_6_5:case r.HALF_FLOAT:return 2;case r.UNSIGNED_INT:case r.FLOAT:case r.UNSIGNED_INT_24_8:return 4}},r.validate=function(e){return e===r.UNSIGNED_BYTE||e===r.UNSIGNED_SHORT||e===r.UNSIGNED_INT||e===r.FLOAT||e===r.HALF_FLOAT||e===r.UNSIGNED_INT_24_8||e===r.UNSIGNED_SHORT_4_4_4_4||e===r.UNSIGNED_SHORT_5_5_5_1||e===r.UNSIGNED_SHORT_5_6_5},t.Z=Object.freeze(r)},480:function(e,t,i){"use strict";i.d(t,{Z:function(){return L}});var n=i(1373),r=i(8177),o=i(4572),a=i(9410),s=i(9824),l=i(512),c=i(9661),u=i(4318),h=function e(t){let i;if("object"!=typeof t||null===t)return t;let n=Object.keys(t);for(let r=0;r<n.length;r++)i=n[r],t.hasOwnProperty(i)&&"_applyFunctions"!==i&&(t[i]=e(t[i]));return Object.freeze(t)};function d(e){return e===l.Z.FUNC_ADD||e===l.Z.FUNC_SUBTRACT||e===l.Z.FUNC_REVERSE_SUBTRACT||e===l.Z.MIN||e===l.Z.MAX}function f(e){return e===l.Z.ZERO||e===l.Z.ONE||e===l.Z.SRC_COLOR||e===l.Z.ONE_MINUS_SRC_COLOR||e===l.Z.DST_COLOR||e===l.Z.ONE_MINUS_DST_COLOR||e===l.Z.SRC_ALPHA||e===l.Z.ONE_MINUS_SRC_ALPHA||e===l.Z.DST_ALPHA||e===l.Z.ONE_MINUS_DST_ALPHA||e===l.Z.CONSTANT_COLOR||e===l.Z.ONE_MINUS_CONSTANT_COLOR||e===l.Z.CONSTANT_ALPHA||e===l.Z.ONE_MINUS_CONSTANT_ALPHA||e===l.Z.SRC_ALPHA_SATURATE}function p(e){return e===l.Z.NEVER||e===l.Z.LESS||e===l.Z.EQUAL||e===l.Z.LEQUAL||e===l.Z.GREATER||e===l.Z.NOTEQUAL||e===l.Z.GEQUAL||e===l.Z.ALWAYS}function m(e){return e===l.Z.ZERO||e===l.Z.KEEP||e===l.Z.REPLACE||e===l.Z.INCR||e===l.Z.DECR||e===l.Z.INVERT||e===l.Z.INCR_WRAP||e===l.Z.DECR_WRAP}function _(e){var t,i;let h=(0,o.Z)(e,o.Z.EMPTY_OBJECT),_=(0,o.Z)(h.cull,o.Z.EMPTY_OBJECT),g=(0,o.Z)(h.polygonOffset,o.Z.EMPTY_OBJECT),Z=(0,o.Z)(h.scissorTest,o.Z.EMPTY_OBJECT),y=(0,o.Z)(Z.rectangle,o.Z.EMPTY_OBJECT),b=(0,o.Z)(h.depthRange,o.Z.EMPTY_OBJECT),v=(0,o.Z)(h.depthTest,o.Z.EMPTY_OBJECT),T=(0,o.Z)(h.colorMask,o.Z.EMPTY_OBJECT),E=(0,o.Z)(h.blending,o.Z.EMPTY_OBJECT),x=(0,o.Z)(E.color,o.Z.EMPTY_OBJECT),w=(0,o.Z)(h.stencilTest,o.Z.EMPTY_OBJECT),S=(0,o.Z)(w.frontOperation,o.Z.EMPTY_OBJECT),C=(0,o.Z)(w.backOperation,o.Z.EMPTY_OBJECT),A=(0,o.Z)(h.sampleCoverage,o.Z.EMPTY_OBJECT),I=h.viewport;if(this.frontFace=(0,o.Z)(h.frontFace,c.Z.COUNTER_CLOCKWISE),this.cull={enabled:(0,o.Z)(_.enabled,!1),face:(0,o.Z)(_.face,l.Z.BACK)},this.lineWidth=(0,o.Z)(h.lineWidth,1),this.polygonOffset={enabled:(0,o.Z)(g.enabled,!1),factor:(0,o.Z)(g.factor,0),units:(0,o.Z)(g.units,0)},this.scissorTest={enabled:(0,o.Z)(Z.enabled,!1),rectangle:n.Z.clone(y)},this.depthRange={near:(0,o.Z)(b.near,0),far:(0,o.Z)(b.far,1)},this.depthTest={enabled:(0,o.Z)(v.enabled,!1),func:(0,o.Z)(v.func,l.Z.LESS)},this.colorMask={red:(0,o.Z)(T.red,!0),green:(0,o.Z)(T.green,!0),blue:(0,o.Z)(T.blue,!0),alpha:(0,o.Z)(T.alpha,!0)},this.depthMask=(0,o.Z)(h.depthMask,!0),this.stencilMask=(0,o.Z)(h.stencilMask,-1),this.blending={enabled:(0,o.Z)(E.enabled,!1),color:new r.Z((0,o.Z)(x.red,0),(0,o.Z)(x.green,0),(0,o.Z)(x.blue,0),(0,o.Z)(x.alpha,0)),equationRgb:(0,o.Z)(E.equationRgb,l.Z.FUNC_ADD),equationAlpha:(0,o.Z)(E.equationAlpha,l.Z.FUNC_ADD),functionSourceRgb:(0,o.Z)(E.functionSourceRgb,l.Z.ONE),functionSourceAlpha:(0,o.Z)(E.functionSourceAlpha,l.Z.ONE),functionDestinationRgb:(0,o.Z)(E.functionDestinationRgb,l.Z.ZERO),functionDestinationAlpha:(0,o.Z)(E.functionDestinationAlpha,l.Z.ZERO)},this.stencilTest={enabled:(0,o.Z)(w.enabled,!1),frontFunction:(0,o.Z)(w.frontFunction,l.Z.ALWAYS),backFunction:(0,o.Z)(w.backFunction,l.Z.ALWAYS),reference:(0,o.Z)(w.reference,0),mask:(0,o.Z)(w.mask,-1),frontOperation:{fail:(0,o.Z)(S.fail,l.Z.KEEP),zFail:(0,o.Z)(S.zFail,l.Z.KEEP),zPass:(0,o.Z)(S.zPass,l.Z.KEEP)},backOperation:{fail:(0,o.Z)(C.fail,l.Z.KEEP),zFail:(0,o.Z)(C.zFail,l.Z.KEEP),zPass:(0,o.Z)(C.zPass,l.Z.KEEP)}},this.sampleCoverage={enabled:(0,o.Z)(A.enabled,!1),value:(0,o.Z)(A.value,1),invert:(0,o.Z)(A.invert,!1)},this.viewport=(0,a.Z)(I)?new n.Z(I.x,I.y,I.width,I.height):void 0,this.lineWidth<u.Z.minimumAliasedLineWidth||this.lineWidth>u.Z.maximumAliasedLineWidth)throw new s.Z("renderState.lineWidth is out of range. Check minimumAliasedLineWidth and maximumAliasedLineWidth.");if(!c.Z.validate(this.frontFace))throw new s.Z("Invalid renderState.frontFace.");if(!((t=this.cull.face)===l.Z.FRONT||t===l.Z.BACK||t===l.Z.FRONT_AND_BACK))throw new s.Z("Invalid renderState.cull.face.");if(this.scissorTest.rectangle.width<0||this.scissorTest.rectangle.height<0)throw new s.Z("renderState.scissorTest.rectangle.width and renderState.scissorTest.rectangle.height must be greater than or equal to zero.");if(this.depthRange.near>this.depthRange.far)throw new s.Z("renderState.depthRange.near can not be greater than renderState.depthRange.far.");if(this.depthRange.near<0)throw new s.Z("renderState.depthRange.near must be greater than or equal to zero.");if(this.depthRange.far>1)throw new s.Z("renderState.depthRange.far must be less than or equal to one.");if(!((i=this.depthTest.func)===l.Z.NEVER||i===l.Z.LESS||i===l.Z.EQUAL||i===l.Z.LEQUAL||i===l.Z.GREATER||i===l.Z.NOTEQUAL||i===l.Z.GEQUAL||i===l.Z.ALWAYS))throw new s.Z("Invalid renderState.depthTest.func.");if(this.blending.color.red<0||this.blending.color.red>1||this.blending.color.green<0||this.blending.color.green>1||this.blending.color.blue<0||this.blending.color.blue>1||this.blending.color.alpha<0||this.blending.color.alpha>1)throw new s.Z("renderState.blending.color components must be greater than or equal to zero and less than or equal to one.");if(!d(this.blending.equationRgb))throw new s.Z("Invalid renderState.blending.equationRgb.");if(!d(this.blending.equationAlpha))throw new s.Z("Invalid renderState.blending.equationAlpha.");if(!f(this.blending.functionSourceRgb))throw new s.Z("Invalid renderState.blending.functionSourceRgb.");if(!f(this.blending.functionSourceAlpha))throw new s.Z("Invalid renderState.blending.functionSourceAlpha.");if(!f(this.blending.functionDestinationRgb))throw new s.Z("Invalid renderState.blending.functionDestinationRgb.");if(!f(this.blending.functionDestinationAlpha))throw new s.Z("Invalid renderState.blending.functionDestinationAlpha.");if(!p(this.stencilTest.frontFunction))throw new s.Z("Invalid renderState.stencilTest.frontFunction.");if(!p(this.stencilTest.backFunction))throw new s.Z("Invalid renderState.stencilTest.backFunction.");if(!m(this.stencilTest.frontOperation.fail))throw new s.Z("Invalid renderState.stencilTest.frontOperation.fail.");if(!m(this.stencilTest.frontOperation.zFail))throw new s.Z("Invalid renderState.stencilTest.frontOperation.zFail.");if(!m(this.stencilTest.frontOperation.zPass))throw new s.Z("Invalid renderState.stencilTest.frontOperation.zPass.");if(!m(this.stencilTest.backOperation.fail))throw new s.Z("Invalid renderState.stencilTest.backOperation.fail.");if(!m(this.stencilTest.backOperation.zFail))throw new s.Z("Invalid renderState.stencilTest.backOperation.zFail.");if(!m(this.stencilTest.backOperation.zPass))throw new s.Z("Invalid renderState.stencilTest.backOperation.zPass.");if((0,a.Z)(this.viewport)){if(this.viewport.width<0)throw new s.Z("renderState.viewport.width must be greater than or equal to zero.");if(this.viewport.height<0)throw new s.Z("renderState.viewport.height must be greater than or equal to zero.");if(this.viewport.width>u.Z.maximumViewportWidth)throw new s.Z(`renderState.viewport.width must be less than or equal to the maximum viewport width (${u.Z.maximumViewportWidth.toString()}). Check maximumViewportWidth.`);if(this.viewport.height>u.Z.maximumViewportHeight)throw new s.Z(`renderState.viewport.height must be less than or equal to the maximum viewport height (${u.Z.maximumViewportHeight.toString()}). Check maximumViewportHeight.`)}this.id=0,this._applyFunctions=[]}let g=0,Z={};function y(e,t,i){i?e.enable(t):e.disable(t)}function b(e,t){e.frontFace(t.frontFace)}function v(e,t){let i=t.cull,n=i.enabled;y(e,e.CULL_FACE,n),n&&e.cullFace(i.face)}function T(e,t){e.lineWidth(t.lineWidth)}function E(e,t){let i=t.polygonOffset,n=i.enabled;y(e,e.POLYGON_OFFSET_FILL,n),n&&e.polygonOffset(i.factor,i.units)}function x(e,t,i){let n=t.scissorTest,r=(0,a.Z)(i.scissorTest)?i.scissorTest.enabled:n.enabled;if(y(e,e.SCISSOR_TEST,r),r){let t=(0,a.Z)(i.scissorTest)?i.scissorTest.rectangle:n.rectangle;e.scissor(t.x,t.y,t.width,t.height)}}function w(e,t){let i=t.depthRange;e.depthRange(i.near,i.far)}function S(e,t){let i=t.depthTest,n=i.enabled;y(e,e.DEPTH_TEST,n),n&&e.depthFunc(i.func)}function C(e,t){let i=t.colorMask;e.colorMask(i.red,i.green,i.blue,i.alpha)}function A(e,t){e.depthMask(t.depthMask)}function I(e,t){e.stencilMask(t.stencilMask)}function O(e,t,i){let n=t.blending,r=(0,a.Z)(i.blendingEnabled)?i.blendingEnabled:n.enabled;y(e,e.BLEND,r),r&&(function(e,t){e.blendColor(t.red,t.green,t.blue,t.alpha)}(e,n.color),e.blendEquationSeparate(n.equationRgb,n.equationAlpha),e.blendFuncSeparate(n.functionSourceRgb,n.functionDestinationRgb,n.functionSourceAlpha,n.functionDestinationAlpha))}function D(e,t){let i=t.stencilTest,n=i.enabled;if(y(e,e.STENCIL_TEST,n),n){let t=i.frontFunction,n=i.backFunction,r=i.reference,o=i.mask;e.stencilFunc(t,r,o),e.stencilFuncSeparate(e.BACK,n,r,o),e.stencilFuncSeparate(e.FRONT,t,r,o);let a=i.frontOperation,s=a.fail,l=a.zFail,c=a.zPass;e.stencilOpSeparate(e.FRONT,s,l,c);let u=i.backOperation,h=u.fail,d=u.zFail,f=u.zPass;e.stencilOpSeparate(e.BACK,h,d,f)}}function P(e,t){let i=t.sampleCoverage,n=i.enabled;y(e,e.SAMPLE_COVERAGE,n),n&&e.sampleCoverage(i.value,i.invert)}_.fromCache=function(e){let t=JSON.stringify(e),i=Z[t];if((0,a.Z)(i))return++i.referenceCount,i.state;let n=new _(e),r=JSON.stringify(n);return i=Z[r],(0,a.Z)(i)||(n.id=g++,i={referenceCount:0,state:n=h(n)},Z[r]=i),++i.referenceCount,Z[t]={referenceCount:1,state:i.state},i.state},_.removeFromCache=function(e){let t=JSON.stringify(new _(e)),i=Z[t],n=JSON.stringify(e),r=Z[n];(0,a.Z)(r)&&(--r.referenceCount,0===r.referenceCount&&(delete Z[n],(0,a.Z)(i)&&--i.referenceCount)),(0,a.Z)(i)&&0===i.referenceCount&&delete Z[t]},_.getCache=function(){return Z},_.clearCache=function(){Z={}};let R=new n.Z;function N(e,t,i){let n=(0,o.Z)(t.viewport,i.viewport);(0,a.Z)(n)||((n=R).width=i.context.drawingBufferWidth,n.height=i.context.drawingBufferHeight),i.context.uniformState.viewport=n,e.viewport(n.x,n.y,n.width,n.height)}_.apply=function(e,t,i){b(e,t),v(e,t),T(e,t),E(e,t),w(e,t),S(e,t),C(e,t),A(e,t),I(e,t),D(e,t),P(e,t),x(e,t,i),O(e,t,i),N(e,t,i)},_.partialApply=function(e,t,i,n,r,o){if(t!==i){let n=i._applyFunctions[t.id];(0,a.Z)(n)||(n=function(e,t){let i=[];return e.frontFace!==t.frontFace&&i.push(b),(e.cull.enabled!==t.cull.enabled||e.cull.face!==t.cull.face)&&i.push(v),e.lineWidth!==t.lineWidth&&i.push(T),(e.polygonOffset.enabled!==t.polygonOffset.enabled||e.polygonOffset.factor!==t.polygonOffset.factor||e.polygonOffset.units!==t.polygonOffset.units)&&i.push(E),(e.depthRange.near!==t.depthRange.near||e.depthRange.far!==t.depthRange.far)&&i.push(w),(e.depthTest.enabled!==t.depthTest.enabled||e.depthTest.func!==t.depthTest.func)&&i.push(S),(e.colorMask.red!==t.colorMask.red||e.colorMask.green!==t.colorMask.green||e.colorMask.blue!==t.colorMask.blue||e.colorMask.alpha!==t.colorMask.alpha)&&i.push(C),e.depthMask!==t.depthMask&&i.push(A),e.stencilMask!==t.stencilMask&&i.push(I),(e.stencilTest.enabled!==t.stencilTest.enabled||e.stencilTest.frontFunction!==t.stencilTest.frontFunction||e.stencilTest.backFunction!==t.stencilTest.backFunction||e.stencilTest.reference!==t.stencilTest.reference||e.stencilTest.mask!==t.stencilTest.mask||e.stencilTest.frontOperation.fail!==t.stencilTest.frontOperation.fail||e.stencilTest.frontOperation.zFail!==t.stencilTest.frontOperation.zFail||e.stencilTest.backOperation.fail!==t.stencilTest.backOperation.fail||e.stencilTest.backOperation.zFail!==t.stencilTest.backOperation.zFail||e.stencilTest.backOperation.zPass!==t.stencilTest.backOperation.zPass)&&i.push(D),(e.sampleCoverage.enabled!==t.sampleCoverage.enabled||e.sampleCoverage.value!==t.sampleCoverage.value||e.sampleCoverage.invert!==t.sampleCoverage.invert)&&i.push(P),i}(t,i),i._applyFunctions[t.id]=n);let r=n.length;for(let t=0;t<r;++t)n[t](e,i)}(((0,a.Z)(n.scissorTest)?n.scissorTest:t.scissorTest)!==((0,a.Z)(r.scissorTest)?r.scissorTest:i.scissorTest)||o)&&x(e,i,r);let s=(0,a.Z)(n.blendingEnabled)?n.blendingEnabled:t.blending.enabled,l=(0,a.Z)(r.blendingEnabled)?r.blendingEnabled:i.blending.enabled;(s!==l||l&&t.blending!==i.blending)&&O(e,i,r),(t!==i||n!==r||n.context!==r.context)&&N(e,i,r)},_.getState=function(e){if(!(0,a.Z)(e))throw new s.Z("renderState is required.");return{frontFace:e.frontFace,cull:{enabled:e.cull.enabled,face:e.cull.face},lineWidth:e.lineWidth,polygonOffset:{enabled:e.polygonOffset.enabled,factor:e.polygonOffset.factor,units:e.polygonOffset.units},scissorTest:{enabled:e.scissorTest.enabled,rectangle:n.Z.clone(e.scissorTest.rectangle)},depthRange:{near:e.depthRange.near,far:e.depthRange.far},depthTest:{enabled:e.depthTest.enabled,func:e.depthTest.func},colorMask:{red:e.colorMask.red,green:e.colorMask.green,blue:e.colorMask.blue,alpha:e.colorMask.alpha},depthMask:e.depthMask,stencilMask:e.stencilMask,blending:{enabled:e.blending.enabled,color:r.Z.clone(e.blending.color),equationRgb:e.blending.equationRgb,equationAlpha:e.blending.equationAlpha,functionSourceRgb:e.blending.functionSourceRgb,functionSourceAlpha:e.blending.functionSourceAlpha,functionDestinationRgb:e.blending.functionDestinationRgb,functionDestinationAlpha:e.blending.functionDestinationAlpha},stencilTest:{enabled:e.stencilTest.enabled,frontFunction:e.stencilTest.frontFunction,backFunction:e.stencilTest.backFunction,reference:e.stencilTest.reference,mask:e.stencilTest.mask,frontOperation:{fail:e.stencilTest.frontOperation.fail,zFail:e.stencilTest.frontOperation.zFail,zPass:e.stencilTest.frontOperation.zPass},backOperation:{fail:e.stencilTest.backOperation.fail,zFail:e.stencilTest.backOperation.zFail,zPass:e.stencilTest.backOperation.zPass}},sampleCoverage:{enabled:e.sampleCoverage.enabled,value:e.sampleCoverage.value,invert:e.sampleCoverage.invert},viewport:(0,a.Z)(e.viewport)?n.Z.clone(e.viewport):void 0}};var L=_},7975:function(e,t,i){"use strict";var n=i(698),r=i(4572),o=i(9410),a=i(7998),s=i(9824),l=i(4318),c=i(1419);function u(e){e=(0,r.Z)(e,r.Z.EMPTY_OBJECT),n.Z.defined("options.context",e.context);let t=e.context._gl,i=l.Z.maximumRenderbufferSize,a=(0,r.Z)(e.format,c.Z.RGBA4),u=(0,o.Z)(e.width)?e.width:t.drawingBufferWidth,h=(0,o.Z)(e.height)?e.height:t.drawingBufferHeight,d=(0,r.Z)(e.numSamples,1);if(!c.Z.validate(a))throw new s.Z("Invalid format.");if(n.Z.typeOf.number.greaterThan("width",u,0),u>i)throw new s.Z(`Width must be less than or equal to the maximum renderbuffer size (${i}). Check maximumRenderbufferSize.`);if(n.Z.typeOf.number.greaterThan("height",h,0),h>i)throw new s.Z(`Height must be less than or equal to the maximum renderbuffer size (${i}). Check maximumRenderbufferSize.`);this._gl=t,this._format=a,this._width=u,this._height=h,this._renderbuffer=this._gl.createRenderbuffer(),t.bindRenderbuffer(t.RENDERBUFFER,this._renderbuffer),d>1?t.renderbufferStorageMultisample(t.RENDERBUFFER,d,a,u,h):t.renderbufferStorage(t.RENDERBUFFER,a,u,h),t.bindRenderbuffer(t.RENDERBUFFER,null)}Object.defineProperties(u.prototype,{format:{get:function(){return this._format}},width:{get:function(){return this._width}},height:{get:function(){return this._height}}}),u.prototype._getRenderbuffer=function(){return this._renderbuffer},u.prototype.isDestroyed=function(){return!1},u.prototype.destroy=function(){return this._gl.deleteRenderbuffer(this._renderbuffer),(0,a.Z)(this)},t.Z=u},1419:function(e,t,i){"use strict";var n=i(512);let r={RGBA4:n.Z.RGBA4,RGBA8:n.Z.RGBA8,RGBA16F:n.Z.RGBA16F,RGBA32F:n.Z.RGBA32F,RGB5_A1:n.Z.RGB5_A1,RGB565:n.Z.RGB565,DEPTH_COMPONENT16:n.Z.DEPTH_COMPONENT16,STENCIL_INDEX8:n.Z.STENCIL_INDEX8,DEPTH_STENCIL:n.Z.DEPTH_STENCIL,DEPTH24_STENCIL8:n.Z.DEPTH24_STENCIL8,validate:function(e){return e===r.RGBA4||e===r.RGBA8||e===r.RGBA16F||e===r.RGBA32F||e===r.RGB5_A1||e===r.RGB565||e===r.DEPTH_COMPONENT16||e===r.STENCIL_INDEX8||e===r.DEPTH_STENCIL||e===r.DEPTH24_STENCIL8},getColorFormat:function(e){return e===n.Z.FLOAT?r.RGBA32F:e===n.Z.HALF_FLOAT_OES?r.RGBA16F:r.RGBA8}};t.Z=Object.freeze(r)},5483:function(e,t,i){"use strict";var n=i(698),r=i(4572),o=i(9410),a=i(9824),s=i(5874),l=i(9138),c=i(9053);function u(e){e=(0,r.Z)(e,r.Z.EMPTY_OBJECT);let t=(0,r.Z)(e.wrapS,c.Z.CLAMP_TO_EDGE),i=(0,r.Z)(e.wrapT,c.Z.CLAMP_TO_EDGE),u=(0,r.Z)(e.minificationFilter,l.Z.LINEAR),h=(0,r.Z)(e.magnificationFilter,s.Z.LINEAR),d=(0,o.Z)(e.maximumAnisotropy)?e.maximumAnisotropy:1;if(!c.Z.validate(t))throw new a.Z("Invalid sampler.wrapS.");if(!c.Z.validate(i))throw new a.Z("Invalid sampler.wrapT.");if(!l.Z.validate(u))throw new a.Z("Invalid sampler.minificationFilter.");if(!s.Z.validate(h))throw new a.Z("Invalid sampler.magnificationFilter.");n.Z.typeOf.number.greaterThanOrEquals("maximumAnisotropy",d,1),this._wrapS=t,this._wrapT=i,this._minificationFilter=u,this._magnificationFilter=h,this._maximumAnisotropy=d}Object.defineProperties(u.prototype,{wrapS:{get:function(){return this._wrapS}},wrapT:{get:function(){return this._wrapT}},minificationFilter:{get:function(){return this._minificationFilter}},magnificationFilter:{get:function(){return this._magnificationFilter}},maximumAnisotropy:{get:function(){return this._maximumAnisotropy}}}),u.equals=function(e,t){return e===t||(0,o.Z)(e)&&(0,o.Z)(t)&&e._wrapS===t._wrapS&&e._wrapT===t._wrapT&&e._minificationFilter===t._minificationFilter&&e._magnificationFilter===t._magnificationFilter&&e._maximumAnisotropy===t._maximumAnisotropy},u.NEAREST=Object.freeze(new u({wrapS:c.Z.CLAMP_TO_EDGE,wrapT:c.Z.CLAMP_TO_EDGE,minificationFilter:l.Z.NEAREST,magnificationFilter:s.Z.NEAREST})),t.Z=u},5767:function(e,t,i){"use strict";i.d(t,{Z:function(){return p}});var n=i(698),r=i(49),o=i(9410),a=i(4572),s=i(9824),l=i(8066),c=i(9698),u=i(8516);function h(e){this.name=e,this.fields=[]}function d(e){this.signature=e,this.body=[]}function f(){this._positionAttributeLine=void 0,this._nextAttributeLocation=1,this._attributeLocations={},this._attributeLines=[],this._structs={},this._functions={},this._vertexShaderParts={defineLines:[],uniformLines:[],shaderLines:[],varyingLines:[],structIds:[],functionIds:[]},this._fragmentShaderParts={defineLines:[],uniformLines:[],shaderLines:[],varyingLines:[],structIds:[],functionIds:[]}}h.prototype.addField=function(e,t){let i=` ${e} ${t};`;this.fields.push(i)},h.prototype.generateGlslLines=function(){let e=this.fields;return 0===e.length&&(e=[" float _empty;"]),[].concat(`struct ${this.name}`,"{",e,"};")},d.prototype.addLines=function(e){if("string"!=typeof e&&!Array.isArray(e))throw new s.Z(`Expected lines to be a string or an array of strings, actual value was ${e}`);let t=this.body;if(Array.isArray(e)){let i=e.length;for(let n=0;n<i;n++)t.push(` ${e[n]}`)}else t.push(` ${e}`)},d.prototype.generateGlslLines=function(){return[].concat(this.signature,"{",this.body,"}")},Object.defineProperties(f.prototype,{attributeLocations:{get:function(){return this._attributeLocations}}}),f.prototype.addDefine=function(e,t,i){n.Z.typeOf.string("identifier",e),i=(0,a.Z)(i,l.Z.BOTH);let r=e;(0,o.Z)(t)&&(r+=` ${t.toString()}`),l.Z.includesVertexShader(i)&&this._vertexShaderParts.defineLines.push(r),l.Z.includesFragmentShader(i)&&this._fragmentShaderParts.defineLines.push(r)},f.prototype.addStruct=function(e,t,i){n.Z.typeOf.string("structId",e),n.Z.typeOf.string("structName",t),n.Z.typeOf.number("destination",i),this._structs[e]=new h(t),l.Z.includesVertexShader(i)&&this._vertexShaderParts.structIds.push(e),l.Z.includesFragmentShader(i)&&this._fragmentShaderParts.structIds.push(e)},f.prototype.addStructField=function(e,t,i){n.Z.typeOf.string("structId",e),n.Z.typeOf.string("type",t),n.Z.typeOf.string("identifier",i),this._structs[e].addField(t,i)},f.prototype.addFunction=function(e,t,i){n.Z.typeOf.string("functionName",e),n.Z.typeOf.string("signature",t),n.Z.typeOf.number("destination",i),this._functions[e]=new d(t),l.Z.includesVertexShader(i)&&this._vertexShaderParts.functionIds.push(e),l.Z.includesFragmentShader(i)&&this._fragmentShaderParts.functionIds.push(e)},f.prototype.addFunctionLines=function(e,t){if(n.Z.typeOf.string("functionName",e),"string"!=typeof t&&!Array.isArray(t))throw new s.Z(`Expected lines to be a string or an array of strings, actual value was ${t}`);this._functions[e].addLines(t)},f.prototype.addUniform=function(e,t,i){n.Z.typeOf.string("type",e),n.Z.typeOf.string("identifier",t),i=(0,a.Z)(i,l.Z.BOTH);let r=`uniform ${e} ${t};`;l.Z.includesVertexShader(i)&&this._vertexShaderParts.uniformLines.push(r),l.Z.includesFragmentShader(i)&&this._fragmentShaderParts.uniformLines.push(r)},f.prototype.setPositionAttribute=function(e,t){if(n.Z.typeOf.string("type",e),n.Z.typeOf.string("identifier",t),(0,o.Z)(this._positionAttributeLine))throw new s.Z("setPositionAttribute() must be called exactly once for the attribute used for gl_Position. For other attributes, use addAttribute()");return this._positionAttributeLine=`in ${e} ${t};`,this._attributeLocations[t]=0,0},f.prototype.addAttribute=function(e,t){n.Z.typeOf.string("type",e),n.Z.typeOf.string("identifier",t);let i=`in ${e} ${t};`;this._attributeLines.push(i);let r=this._nextAttributeLocation;return this._attributeLocations[t]=r,this._nextAttributeLocation+=function(e){switch(e){case"mat2":return 2;case"mat3":return 3;case"mat4":return 4;default:return 1}}(e),r},f.prototype.addVarying=function(e,t,i){n.Z.typeOf.string("type",e),n.Z.typeOf.string("identifier",t),i=(0,o.Z)(i)?`${i} `:"";let r=`${e} ${t};`;this._vertexShaderParts.varyingLines.push(`${i}out ${r}`),this._fragmentShaderParts.varyingLines.push(`${i}in ${r}`)},f.prototype.addVertexLines=function(e){if("string"!=typeof e&&!Array.isArray(e))throw new s.Z(`Expected lines to be a string or an array of strings, actual value was ${e}`);let t=this._vertexShaderParts.shaderLines;Array.isArray(e)?t.push.apply(t,e):t.push(e)},f.prototype.addFragmentLines=function(e){if("string"!=typeof e&&!Array.isArray(e))throw new s.Z(`Expected lines to be a string or an array of strings, actual value was ${e}`);let t=this._fragmentShaderParts.shaderLines;Array.isArray(e)?t.push.apply(t,e):t.push(e)},f.prototype.buildShaderProgram=function(e){n.Z.typeOf.object("context",e);let t=(0,o.Z)(this._positionAttributeLine)?[this._positionAttributeLine]:[],i=function(e){let t,i,n;let r=[],o=[],a=e._vertexShaderParts.structIds;for(t=0;t<a.length;t++)i=a[t],n=(0,e._structs[i]).generateGlslLines(),r.push.apply(r,n);for(t=0,a=e._fragmentShaderParts.structIds;t<a.length;t++)i=a[t],n=(0,e._structs[i]).generateGlslLines(),o.push.apply(o,n);return{vertexLines:r,fragmentLines:o}}(this),r=function(e){let t,i,n;let r=[],o=[],a=e._vertexShaderParts.functionIds;for(t=0;t<a.length;t++)i=a[t],n=(0,e._functions[i]).generateGlslLines(),r.push.apply(r,n);for(t=0,a=e._fragmentShaderParts.functionIds;t<a.length;t++)i=a[t],n=(0,e._functions[i]).generateGlslLines(),o.push.apply(o,n);return{vertexLines:r,fragmentLines:o}}(this),a=t.concat(this._attributeLines,this._vertexShaderParts.uniformLines,this._vertexShaderParts.varyingLines,i.vertexLines,r.vertexLines,this._vertexShaderParts.shaderLines).join("\n"),s=new u.Z({defines:this._vertexShaderParts.defineLines,sources:[a]}),l=this._fragmentShaderParts.uniformLines.concat(this._fragmentShaderParts.varyingLines,i.fragmentLines,r.fragmentLines,this._fragmentShaderParts.shaderLines).join("\n"),h=new u.Z({defines:this._fragmentShaderParts.defineLines,sources:[l]});return c.Z.fromCache({context:e,vertexShaderSource:s,fragmentShaderSource:h,attributeLocations:this._attributeLocations})},f.prototype.clone=function(){return(0,r.Z)(this,!0)};var p=f},8066:function(e,t,i){"use strict";var n=i(698);let r={VERTEX:0,FRAGMENT:1,BOTH:2};r.includesVertexShader=function(e){return n.Z.typeOf.number("destination",e),e===r.VERTEX||e===r.BOTH},r.includesFragmentShader=function(e){return n.Z.typeOf.number("destination",e),e===r.FRAGMENT||e===r.BOTH},t.Z=Object.freeze(r)},9698:function(e,t,i){"use strict";i.d(t,{Z:function(){return Q}});var n=i(698),r=i(4572),o=i(9410),a=i(7998),s=i(9824),l=i(87),c=i(5430),u=i(4318),h=i(570),d=i(1486),f=i(3065),p=i(8177),m=i(3037),_=i(3186),g=i(4749);function Z(e,t,i,n){this.name=i,this.value=void 0,this._value=0,this._gl=e,this._location=n}function y(e,t,i,n){this.name=i,this.value=void 0,this._value=new h.Z,this._gl=e,this._location=n}function b(e,t,i,n){this.name=i,this.value=void 0,this._value=void 0,this._gl=e,this._location=n}function v(e,t,i,n){this.name=i,this.value=void 0,this._value=void 0,this._gl=e,this._location=n}function T(e,t,i,n){this.name=i,this.value=void 0,this._gl=e,this._location=n,this.textureUnitIndex=void 0}function E(e,t,i,n){this.name=i,this.value=void 0,this._value=0,this._gl=e,this._location=n}function x(e,t,i,n){this.name=i,this.value=void 0,this._value=new h.Z,this._gl=e,this._location=n}function w(e,t,i,n){this.name=i,this.value=void 0,this._value=new d.Z,this._gl=e,this._location=n}function S(e,t,i,n){this.name=i,this.value=void 0,this._value=new f.Z,this._gl=e,this._location=n}Z.prototype.set=function(){this.value!==this._value&&(this._value=this.value,this._gl.uniform1f(this._location,this.value))},y.prototype.set=function(){let e=this.value;h.Z.equals(e,this._value)||(h.Z.clone(e,this._value),this._gl.uniform2f(this._location,e.x,e.y))},b.prototype.set=function(){let e=this.value;if((0,o.Z)(e.red))p.Z.equals(e,this._value)||(this._value=p.Z.clone(e,this._value),this._gl.uniform3f(this._location,e.red,e.green,e.blue));else if((0,o.Z)(e.x))d.Z.equals(e,this._value)||(this._value=d.Z.clone(e,this._value),this._gl.uniform3f(this._location,e.x,e.y,e.z));else throw new s.Z(`Invalid vec3 value for uniform "${this.name}".`)},v.prototype.set=function(){let e=this.value;if((0,o.Z)(e.red))p.Z.equals(e,this._value)||(this._value=p.Z.clone(e,this._value),this._gl.uniform4f(this._location,e.red,e.green,e.blue,e.alpha));else if((0,o.Z)(e.x))f.Z.equals(e,this._value)||(this._value=f.Z.clone(e,this._value),this._gl.uniform4f(this._location,e.x,e.y,e.z,e.w));else throw new s.Z(`Invalid vec4 value for uniform "${this.name}".`)},T.prototype.set=function(){let e=this._gl;e.activeTexture(e.TEXTURE0+this.textureUnitIndex);let t=this.value;e.bindTexture(t._target,t._texture)},T.prototype._setSampler=function(e){return this.textureUnitIndex=e,this._gl.uniform1i(this._location,e),e+1},E.prototype.set=function(){this.value!==this._value&&(this._value=this.value,this._gl.uniform1i(this._location,this.value))},x.prototype.set=function(){let e=this.value;h.Z.equals(e,this._value)||(h.Z.clone(e,this._value),this._gl.uniform2i(this._location,e.x,e.y))},w.prototype.set=function(){let e=this.value;d.Z.equals(e,this._value)||(d.Z.clone(e,this._value),this._gl.uniform3i(this._location,e.x,e.y,e.z))},S.prototype.set=function(){let e=this.value;f.Z.equals(e,this._value)||(f.Z.clone(e,this._value),this._gl.uniform4i(this._location,e.x,e.y,e.z,e.w))};let C=new Float32Array(4);function A(e,t,i,n){this.name=i,this.value=void 0,this._value=new m.Z,this._gl=e,this._location=n}A.prototype.set=function(){if(!m.Z.equalsArray(this.value,this._value,0)){m.Z.clone(this.value,this._value);let e=m.Z.toArray(this.value,C);this._gl.uniformMatrix2fv(this._location,!1,e)}};let I=new Float32Array(9);function O(e,t,i,n){this.name=i,this.value=void 0,this._value=new _.Z,this._gl=e,this._location=n}O.prototype.set=function(){if(!_.Z.equalsArray(this.value,this._value,0)){_.Z.clone(this.value,this._value);let e=_.Z.toArray(this.value,I);this._gl.uniformMatrix3fv(this._location,!1,e)}};let D=new Float32Array(16);function P(e,t,i,n){this.name=i,this.value=void 0,this._value=new g.Z,this._gl=e,this._location=n}P.prototype.set=function(){if(!g.Z.equalsArray(this.value,this._value,0)){g.Z.clone(this.value,this._value);let e=g.Z.toArray(this.value,D);this._gl.uniformMatrix4fv(this._location,!1,e)}};var R=function(e,t,i,n){switch(t.type){case e.FLOAT:return new Z(e,t,i,n);case e.FLOAT_VEC2:return new y(e,t,i,n);case e.FLOAT_VEC3:return new b(e,t,i,n);case e.FLOAT_VEC4:return new v(e,t,i,n);case e.SAMPLER_2D:case e.SAMPLER_CUBE:return new T(e,t,i,n);case e.INT:case e.BOOL:return new E(e,t,i,n);case e.INT_VEC2:case e.BOOL_VEC2:return new x(e,t,i,n);case e.INT_VEC3:case e.BOOL_VEC3:return new w(e,t,i,n);case e.INT_VEC4:case e.BOOL_VEC4:return new S(e,t,i,n);case e.FLOAT_MAT2:return new A(e,t,i,n);case e.FLOAT_MAT3:return new O(e,t,i,n);case e.FLOAT_MAT4:return new P(e,t,i,n);default:throw new l.Z(`Unrecognized uniform type: ${t.type} for uniform "${i}".`)}};function N(e,t,i,n){let r=n.length;this.name=i,this.value=Array(r),this._value=new Float32Array(r),this._gl=e,this._location=n[0]}function L(e,t,i,n){let r=n.length;this.name=i,this.value=Array(r),this._value=new Float32Array(2*r),this._gl=e,this._location=n[0]}function M(e,t,i,n){let r=n.length;this.name=i,this.value=Array(r),this._value=new Float32Array(3*r),this._gl=e,this._location=n[0]}function F(e,t,i,n){let r=n.length;this.name=i,this.value=Array(r),this._value=new Float32Array(4*r),this._gl=e,this._location=n[0]}function z(e,t,i,n){let r=n.length;this.name=i,this.value=Array(r),this._value=new Float32Array(r),this._gl=e,this._locations=n,this.textureUnitIndex=void 0}function B(e,t,i,n){let r=n.length;this.name=i,this.value=Array(r),this._value=new Int32Array(r),this._gl=e,this._location=n[0]}function U(e,t,i,n){let r=n.length;this.name=i,this.value=Array(r),this._value=new Int32Array(2*r),this._gl=e,this._location=n[0]}function k(e,t,i,n){let r=n.length;this.name=i,this.value=Array(r),this._value=new Int32Array(3*r),this._gl=e,this._location=n[0]}function V(e,t,i,n){let r=n.length;this.name=i,this.value=Array(r),this._value=new Int32Array(4*r),this._gl=e,this._location=n[0]}function H(e,t,i,n){let r=n.length;this.name=i,this.value=Array(r),this._value=new Float32Array(4*r),this._gl=e,this._location=n[0]}function G(e,t,i,n){let r=n.length;this.name=i,this.value=Array(r),this._value=new Float32Array(9*r),this._gl=e,this._location=n[0]}function j(e,t,i,n){let r=n.length;this.name=i,this.value=Array(r),this._value=new Float32Array(16*r),this._gl=e,this._location=n[0]}N.prototype.set=function(){let e=this.value,t=e.length,i=this._value,n=!1;for(let r=0;r<t;++r){let t=e[r];t!==i[r]&&(i[r]=t,n=!0)}n&&this._gl.uniform1fv(this._location,i)},L.prototype.set=function(){let e=this.value,t=e.length,i=this._value,n=!1,r=0;for(let o=0;o<t;++o){let t=e[o];h.Z.equalsArray(t,i,r)||(h.Z.pack(t,i,r),n=!0),r+=2}n&&this._gl.uniform2fv(this._location,i)},M.prototype.set=function(){let e=this.value,t=e.length,i=this._value,n=!1,r=0;for(let a=0;a<t;++a){let t=e[a];if((0,o.Z)(t.red))(t.red!==i[r]||t.green!==i[r+1]||t.blue!==i[r+2])&&(i[r]=t.red,i[r+1]=t.green,i[r+2]=t.blue,n=!0);else if((0,o.Z)(t.x))d.Z.equalsArray(t,i,r)||(d.Z.pack(t,i,r),n=!0);else throw new s.Z("Invalid vec3 value.");r+=3}n&&this._gl.uniform3fv(this._location,i)},F.prototype.set=function(){let e=this.value,t=e.length,i=this._value,n=!1,r=0;for(let a=0;a<t;++a){let t=e[a];if((0,o.Z)(t.red))p.Z.equalsArray(t,i,r)||(p.Z.pack(t,i,r),n=!0);else if((0,o.Z)(t.x))f.Z.equalsArray(t,i,r)||(f.Z.pack(t,i,r),n=!0);else throw new s.Z("Invalid vec4 value.");r+=4}n&&this._gl.uniform4fv(this._location,i)},z.prototype.set=function(){let e=this._gl,t=e.TEXTURE0+this.textureUnitIndex,i=this.value,n=i.length;for(let r=0;r<n;++r){let n=i[r];e.activeTexture(t+r),e.bindTexture(n._target,n._texture)}},z.prototype._setSampler=function(e){this.textureUnitIndex=e;let t=this._locations,i=t.length;for(let n=0;n<i;++n){let i=e+n;this._gl.uniform1i(t[n],i)}return e+i},B.prototype.set=function(){let e=this.value,t=e.length,i=this._value,n=!1;for(let r=0;r<t;++r){let t=e[r];t!==i[r]&&(i[r]=t,n=!0)}n&&this._gl.uniform1iv(this._location,i)},U.prototype.set=function(){let e=this.value,t=e.length,i=this._value,n=!1,r=0;for(let o=0;o<t;++o){let t=e[o];h.Z.equalsArray(t,i,r)||(h.Z.pack(t,i,r),n=!0),r+=2}n&&this._gl.uniform2iv(this._location,i)},k.prototype.set=function(){let e=this.value,t=e.length,i=this._value,n=!1,r=0;for(let o=0;o<t;++o){let t=e[o];d.Z.equalsArray(t,i,r)||(d.Z.pack(t,i,r),n=!0),r+=3}n&&this._gl.uniform3iv(this._location,i)},V.prototype.set=function(){let e=this.value,t=e.length,i=this._value,n=!1,r=0;for(let o=0;o<t;++o){let t=e[o];f.Z.equalsArray(t,i,r)||(f.Z.pack(t,i,r),n=!0),r+=4}n&&this._gl.uniform4iv(this._location,i)},H.prototype.set=function(){let e=this.value,t=e.length,i=this._value,n=!1,r=0;for(let o=0;o<t;++o){let t=e[o];m.Z.equalsArray(t,i,r)||(m.Z.pack(t,i,r),n=!0),r+=4}n&&this._gl.uniformMatrix2fv(this._location,!1,i)},G.prototype.set=function(){let e=this.value,t=e.length,i=this._value,n=!1,r=0;for(let o=0;o<t;++o){let t=e[o];_.Z.equalsArray(t,i,r)||(_.Z.pack(t,i,r),n=!0),r+=9}n&&this._gl.uniformMatrix3fv(this._location,!1,i)},j.prototype.set=function(){let e=this.value,t=e.length,i=this._value,n=!1,r=0;for(let o=0;o<t;++o){let t=e[o];g.Z.equalsArray(t,i,r)||(g.Z.pack(t,i,r),n=!0),r+=16}n&&this._gl.uniformMatrix4fv(this._location,!1,i)};var W=function(e,t,i,n){switch(t.type){case e.FLOAT:return new N(e,t,i,n);case e.FLOAT_VEC2:return new L(e,t,i,n);case e.FLOAT_VEC3:return new M(e,t,i,n);case e.FLOAT_VEC4:return new F(e,t,i,n);case e.SAMPLER_2D:case e.SAMPLER_CUBE:return new z(e,t,i,n);case e.INT:case e.BOOL:return new B(e,t,i,n);case e.INT_VEC2:case e.BOOL_VEC2:return new U(e,t,i,n);case e.INT_VEC3:case e.BOOL_VEC3:return new k(e,t,i,n);case e.INT_VEC4:case e.BOOL_VEC4:return new V(e,t,i,n);case e.FLOAT_MAT2:return new H(e,t,i,n);case e.FLOAT_MAT3:return new G(e,t,i,n);case e.FLOAT_MAT4:return new j(e,t,i,n);default:throw new l.Z(`Unrecognized uniform type: ${t.type} for uniform "${i}".`)}};let q=0;function Y(e){let t=e.vertexShaderText,i=e.fragmentShaderText;"undefined"!=typeof spector&&(t=t.replace(/^#line/gm,"//#line"),i=i.replace(/^#line/gm,"//#line"));let n=function(e,t){let i={};if(!u.Z.highpFloatSupported||!u.Z.highpIntSupported){let n,r,o,a;let s=X(e),l=X(t),c=s.length,u=l.length;for(n=0;n<c;n++)for(r=0;r<u;r++)if(s[n]===l[r]){o=s[n],a=`czm_mediump_${o}`;let e=RegExp(`${o}\\b`,"g");t=t.replace(e,a),i[a]=o}}return{fragmentShaderText:t,duplicateUniformNames:i}}(t,i);this._gl=e.gl,this._logShaderCompilation=e.logShaderCompilation,this._debugShaders=e.debugShaders,this._attributeLocations=e.attributeLocations,this._program=void 0,this._numberOfVertexAttributes=void 0,this._vertexAttributes=void 0,this._uniformsByName=void 0,this._uniforms=void 0,this._automaticUniforms=void 0,this._manualUniforms=void 0,this._duplicateUniformNames=n.duplicateUniformNames,this._cachedShader=void 0,this.maximumTextureUnitIndex=void 0,this._vertexShaderSource=e.vertexShaderSource,this._vertexShaderText=e.vertexShaderText,this._fragmentShaderSource=e.fragmentShaderSource,this._fragmentShaderText=n.fragmentShaderText,this.id=q++}function X(e){let t=[],i=e.match(/uniform.*?(?![^{]*})(?=[=\[;])/g);if((0,o.Z)(i)){let e=i.length;for(let n=0;n<e;n++){let e=i[n].trim(),r=e.slice(e.lastIndexOf(" ")+1);t.push(r)}}return t}Y.fromCache=function(e){return e=(0,r.Z)(e,r.Z.EMPTY_OBJECT),n.Z.defined("options.context",e.context),e.context.shaderCache.getShaderProgram(e)},Y.replaceCache=function(e){return e=(0,r.Z)(e,r.Z.EMPTY_OBJECT),n.Z.defined("options.context",e.context),e.context.shaderCache.replaceShaderProgram(e)},Object.defineProperties(Y.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},vertexAttributes:{get:function(){return K(this),this._vertexAttributes}},numberOfVertexAttributes:{get:function(){return K(this),this._numberOfVertexAttributes}},allUniforms:{get:function(){return K(this),this._uniformsByName}}});let $="[Cesium WebGL] ";function K(e){(0,o.Z)(e._program)||function e(t){let i=t._program,n=t._gl,r=function(e,t){let i,n;let r=t._vertexShaderText,a=t._fragmentShaderText,s=e.createShader(e.VERTEX_SHADER);e.shaderSource(s,r),e.compileShader(s);let c=e.createShader(e.FRAGMENT_SHADER);e.shaderSource(c,a),e.compileShader(c);let u=e.createProgram();e.attachShader(u,s),e.attachShader(u,c);let h=t._attributeLocations;if((0,o.Z)(h))for(let t in h)h.hasOwnProperty(t)&&e.bindAttribLocation(u,h[t],t);if(e.linkProgram(u),e.getProgramParameter(u,e.LINK_STATUS))return t._logShaderCompilation&&(i=e.getShaderInfoLog(s),(0,o.Z)(i)&&i.length>0&&console.log(`${$}Vertex shader compile log: ${i}`),i=e.getShaderInfoLog(c),(0,o.Z)(i)&&i.length>0&&console.log(`${$}Fragment shader compile log: ${i}`),i=e.getProgramInfoLog(u),(0,o.Z)(i)&&i.length>0&&console.log(`${$}Shader program link log: ${i}`)),e.deleteShader(s),e.deleteShader(c),u;let d=t._debugShaders;throw e.getShaderParameter(c,e.COMPILE_STATUS)?e.getShaderParameter(s,e.COMPILE_STATUS)?(i=e.getProgramInfoLog(u),console.error(`${$}Shader program link log: ${i}`),f(s,"vertex"),f(c,"fragment"),n=`Program failed to link. Link log: ${i}`):(i=e.getShaderInfoLog(s),console.error(`${$}Vertex shader compile log: ${i}`),console.error(`${$} Vertex shader source: ${r}`),n=`Vertex shader failed to compile. Compile log: ${i}`):(i=e.getShaderInfoLog(c),console.error(`${$}Fragment shader compile log: ${i}`),console.error(`${$} Fragment shader source: ${a}`),n=`Fragment shader failed to compile. Compile log: ${i}`),e.deleteShader(s),e.deleteShader(c),e.deleteProgram(u),new l.Z(n);function f(e,t){if(!(0,o.Z)(d))return;let i=d.getTranslatedShaderSource(e);if(""===i){console.error(`${$}${t} shader translation failed.`);return}console.error(`${$}Translated ${t} shaderSource: ${i}`)}}(n,t,t._debugShaders),a=n.getProgramParameter(r,n.ACTIVE_ATTRIBUTES),s=function(e,t){let i={},n=[],r=[],a=e.getProgramParameter(t,e.ACTIVE_UNIFORMS);for(let s=0;s<a;++s){let a=e.getActiveUniform(t,s),l=-1!==a.name.indexOf("[0]",a.name.length-3)?a.name.slice(0,a.name.length-3):a.name;if(0!==l.indexOf("gl_")){if(0>a.name.indexOf("[")){let o=e.getUniformLocation(t,l);if(null!==o){let t=R(e,a,l,o);i[l]=t,n.push(t),t._setSampler&&r.push(t)}}else{let s,c,u,h;let d=l.indexOf("[");if(d>=0){if(s=i[l.slice(0,d)],!(0,o.Z)(s))continue;(c=s._locations).length<=1&&(u=s.value,null!==(h=e.getUniformLocation(t,l))&&(c.push(h),u.push(e.getUniform(t,h))))}else{c=[];for(let i=0;i<a.size;++i)null!==(h=e.getUniformLocation(t,`${l}[${i}]`))&&c.push(h);s=W(e,a,l,c),i[l]=s,n.push(s),s._setSampler&&r.push(s)}}}}return{uniformsByName:i,uniforms:n,samplerUniforms:r}}(n,r),u=function(e,t){let i=[],n=[];for(let r in t)if(t.hasOwnProperty(r)){let a=t[r],s=r,l=e._duplicateUniformNames[s];(0,o.Z)(l)&&(a.name=l,s=l);let u=c.Z[s];(0,o.Z)(u)?i.push({uniform:a,automaticUniform:u}):n.push(a)}return{automaticUniforms:i,manualUniforms:n}}(t,s.uniformsByName);t._program=r,t._numberOfVertexAttributes=a,t._vertexAttributes=function(e,t,i){let n={};for(let r=0;r<i;++r){let i=e.getActiveAttrib(t,r),o=e.getAttribLocation(t,i.name);n[i.name]={name:i.name,type:i.type,index:o}}return n}(n,r,a),t._uniformsByName=s.uniformsByName,t._uniforms=s.uniforms,t._automaticUniforms=u.automaticUniforms,t._manualUniforms=u.manualUniforms,t.maximumTextureUnitIndex=function(e,t,i){e.useProgram(t);let n=0,r=i.length;for(let e=0;e<r;++e)n=i[e]._setSampler(n);return e.useProgram(null),n}(n,r,s.samplerUniforms),i&&t._gl.deleteProgram(i),"undefined"!=typeof spector&&(t._program.__SPECTOR_rebuildProgram=function(i,n,r,o){let a=t._vertexShaderText,s=t._fragmentShaderText,l=/ ! = /g;t._vertexShaderText=i.replace(l," != "),t._fragmentShaderText=n.replace(l," != ");try{e(t),r(t._program)}catch(i){t._vertexShaderText=a,t._fragmentShaderText=s;let e=/(?:Compile|Link) error: ([^]*)/.exec(i.message);o(e?e[1]:i.message)}})}(e)}Y.prototype._bind=function(){K(this),this._gl.useProgram(this._program)},Y.prototype._setUniforms=function(e,t,i){let n,r;if((0,o.Z)(e)){let t=this._manualUniforms;for(r=0,n=t.length;r<n;++r){let i=t[r];i.value=e[i.name]()}}let a=this._automaticUniforms;for(r=0,n=a.length;r<n;++r){let e=a[r];e.uniform.value=e.automaticUniform.getValue(t)}let l=this._uniforms;for(r=0,n=l.length;r<n;++r)l[r].set();if(i){let e=this._gl,t=this._program;if(e.validateProgram(t),!e.getProgramParameter(t,e.VALIDATE_STATUS))throw new s.Z(`Program validation failed. Program info log: ${e.getProgramInfoLog(t)}`)}},Y.prototype.isDestroyed=function(){return!1},Y.prototype.destroy=function(){this._cachedShader.cache.releaseShaderProgram(this)},Y.prototype.finalDestroy=function(){return this._gl.deleteProgram(this._program),(0,a.Z)(this)};var Q=Y},8516:function(e,t,i){"use strict";i.d(t,{Z:function(){return g}});var n=i(4572),r=i(9410),o=i(9824),a={czm_degreesPerRadian:"/**\n * A built-in GLSL floating-point constant for converting radians to degrees.\n *\n * @alias czm_degreesPerRadian\n * @glslConstant\n *\n * @see CesiumMath.DEGREES_PER_RADIAN\n *\n * @example\n * // GLSL declaration\n * const float czm_degreesPerRadian = ...;\n *\n * // Example\n * float deg = czm_degreesPerRadian * rad;\n */\nconst float czm_degreesPerRadian = 57.29577951308232;\n",czm_depthRange:"/**\n * A built-in GLSL vec2 constant for defining the depth range.\n * This is a workaround to a bug where IE11 does not implement gl_DepthRange.\n *\n * @alias czm_depthRange\n * @glslConstant\n *\n * @example\n * // GLSL declaration\n * float depthRangeNear = czm_depthRange.near;\n * float depthRangeFar = czm_depthRange.far;\n *\n */\nconst czm_depthRangeStruct czm_depthRange = czm_depthRangeStruct(0.0, 1.0);\n",czm_epsilon1:"/**\n * 0.1\n *\n * @name czm_epsilon1\n * @glslConstant\n */\nconst float czm_epsilon1 = 0.1;\n",czm_epsilon2:"/**\n * 0.01\n *\n * @name czm_epsilon2\n * @glslConstant\n */\nconst float czm_epsilon2 = 0.01;\n",czm_epsilon3:"/**\n * 0.001\n *\n * @name czm_epsilon3\n * @glslConstant\n */\nconst float czm_epsilon3 = 0.001;\n",czm_epsilon4:"/**\n * 0.0001\n *\n * @name czm_epsilon4\n * @glslConstant\n */\nconst float czm_epsilon4 = 0.0001;\n",czm_epsilon5:"/**\n * 0.00001\n *\n * @name czm_epsilon5\n * @glslConstant\n */\nconst float czm_epsilon5 = 0.00001;\n",czm_epsilon6:"/**\n * 0.000001\n *\n * @name czm_epsilon6\n * @glslConstant\n */\nconst float czm_epsilon6 = 0.000001;\n",czm_epsilon7:"/**\n * 0.0000001\n *\n * @name czm_epsilon7\n * @glslConstant\n */\nconst float czm_epsilon7 = 0.0000001;\n",czm_infinity:"/**\n * DOC_TBA\n *\n * @name czm_infinity\n * @glslConstant\n */\nconst float czm_infinity = 5906376272000.0; // Distance from the Sun to Pluto in meters. TODO: What is best given lowp, mediump, and highp?\n",czm_oneOverPi:"/**\n * A built-in GLSL floating-point constant for <code>1/pi</code>.\n *\n * @alias czm_oneOverPi\n * @glslConstant\n *\n * @see CesiumMath.ONE_OVER_PI\n *\n * @example\n * // GLSL declaration\n * const float czm_oneOverPi = ...;\n *\n * // Example\n * float pi = 1.0 / czm_oneOverPi;\n */\nconst float czm_oneOverPi = 0.3183098861837907;\n",czm_oneOverTwoPi:"/**\n * A built-in GLSL floating-point constant for <code>1/2pi</code>.\n *\n * @alias czm_oneOverTwoPi\n * @glslConstant\n *\n * @see CesiumMath.ONE_OVER_TWO_PI\n *\n * @example\n * // GLSL declaration\n * const float czm_oneOverTwoPi = ...;\n *\n * // Example\n * float pi = 2.0 * czm_oneOverTwoPi;\n */\nconst float czm_oneOverTwoPi = 0.15915494309189535;\n",czm_passCesium3DTile:"/**\n * The automatic GLSL constant for {@link Pass#CESIUM_3D_TILE}\n *\n * @name czm_passCesium3DTile\n * @glslConstant\n *\n * @see czm_pass\n */\nconst float czm_passCesium3DTile = 4.0;\n",czm_passCesium3DTileClassification:"/**\n * The automatic GLSL constant for {@link Pass#CESIUM_3D_TILE_CLASSIFICATION}\n *\n * @name czm_passCesium3DTileClassification\n * @glslConstant\n *\n * @see czm_pass\n */\nconst float czm_passCesium3DTileClassification = 5.0;\n",czm_passCesium3DTileClassificationIgnoreShow:"/**\n * The automatic GLSL constant for {@link Pass#CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW}\n *\n * @name czm_passCesium3DTileClassificationIgnoreShow\n * @glslConstant\n *\n * @see czm_pass\n */\nconst float czm_passCesium3DTileClassificationIgnoreShow = 6.0;\n",czm_passClassification:"/**\n * The automatic GLSL constant for {@link Pass#CLASSIFICATION}\n *\n * @name czm_passClassification\n * @glslConstant\n *\n * @see czm_pass\n */\nconst float czm_passClassification = 7.0;\n",czm_passCompute:"/**\n * The automatic GLSL constant for {@link Pass#COMPUTE}\n *\n * @name czm_passCompute\n * @glslConstant\n *\n * @see czm_pass\n */\nconst float czm_passCompute = 1.0;\n",czm_passEnvironment:"/**\n * The automatic GLSL constant for {@link Pass#ENVIRONMENT}\n *\n * @name czm_passEnvironment\n * @glslConstant\n *\n * @see czm_pass\n */\nconst float czm_passEnvironment = 0.0;\n",czm_passGlobe:"/**\n * The automatic GLSL constant for {@link Pass#GLOBE}\n *\n * @name czm_passGlobe\n * @glslConstant\n *\n * @see czm_pass\n */\nconst float czm_passGlobe = 2.0;\n",czm_passOpaque:"/**\n * The automatic GLSL constant for {@link Pass#OPAQUE}\n *\n * @name czm_passOpaque\n * @glslConstant\n *\n * @see czm_pass\n */\nconst float czm_passOpaque = 7.0;\n",czm_passOverlay:"/**\n * The automatic GLSL constant for {@link Pass#OVERLAY}\n *\n * @name czm_passOverlay\n * @glslConstant\n *\n * @see czm_pass\n */\nconst float czm_passOverlay = 10.0;\n",czm_passTerrainClassification:"/**\n * The automatic GLSL constant for {@link Pass#TERRAIN_CLASSIFICATION}\n *\n * @name czm_passTerrainClassification\n * @glslConstant\n *\n * @see czm_pass\n */\nconst float czm_passTerrainClassification = 3.0;\n",czm_passTranslucent:"/**\n * The automatic GLSL constant for {@link Pass#TRANSLUCENT}\n *\n * @name czm_passTranslucent\n * @glslConstant\n *\n * @see czm_pass\n */\nconst float czm_passTranslucent = 8.0;\n",czm_passVoxels:"/**\n * The automatic GLSL constant for {@link Pass#VOXELS}\n *\n * @name czm_passVoxels\n * @glslConstant\n *\n * @see czm_pass\n */\nconst float czm_passVoxels = 9.0;\n",czm_pi:"/**\n * A built-in GLSL floating-point constant for <code>Math.PI</code>.\n *\n * @alias czm_pi\n * @glslConstant\n *\n * @see CesiumMath.PI\n *\n * @example\n * // GLSL declaration\n * const float czm_pi = ...;\n *\n * // Example\n * float twoPi = 2.0 * czm_pi;\n */\nconst float czm_pi = 3.141592653589793;\n",czm_piOverFour:"/**\n * A built-in GLSL floating-point constant for <code>pi/4</code>.\n *\n * @alias czm_piOverFour\n * @glslConstant\n *\n * @see CesiumMath.PI_OVER_FOUR\n *\n * @example\n * // GLSL declaration\n * const float czm_piOverFour = ...;\n *\n * // Example\n * float pi = 4.0 * czm_piOverFour;\n */\nconst float czm_piOverFour = 0.7853981633974483;\n",czm_piOverSix:"/**\n * A built-in GLSL floating-point constant for <code>pi/6</code>.\n *\n * @alias czm_piOverSix\n * @glslConstant\n *\n * @see CesiumMath.PI_OVER_SIX\n *\n * @example\n * // GLSL declaration\n * const float czm_piOverSix = ...;\n *\n * // Example\n * float pi = 6.0 * czm_piOverSix;\n */\nconst float czm_piOverSix = 0.5235987755982988;\n",czm_piOverThree:"/**\n * A built-in GLSL floating-point constant for <code>pi/3</code>.\n *\n * @alias czm_piOverThree\n * @glslConstant\n *\n * @see CesiumMath.PI_OVER_THREE\n *\n * @example\n * // GLSL declaration\n * const float czm_piOverThree = ...;\n *\n * // Example\n * float pi = 3.0 * czm_piOverThree;\n */\nconst float czm_piOverThree = 1.0471975511965976;\n",czm_piOverTwo:"/**\n * A built-in GLSL floating-point constant for <code>pi/2</code>.\n *\n * @alias czm_piOverTwo\n * @glslConstant\n *\n * @see CesiumMath.PI_OVER_TWO\n *\n * @example\n * // GLSL declaration\n * const float czm_piOverTwo = ...;\n *\n * // Example\n * float pi = 2.0 * czm_piOverTwo;\n */\nconst float czm_piOverTwo = 1.5707963267948966;\n",czm_radiansPerDegree:"/**\n * A built-in GLSL floating-point constant for converting degrees to radians.\n *\n * @alias czm_radiansPerDegree\n * @glslConstant\n *\n * @see CesiumMath.RADIANS_PER_DEGREE\n *\n * @example\n * // GLSL declaration\n * const float czm_radiansPerDegree = ...;\n *\n * // Example\n * float rad = czm_radiansPerDegree * deg;\n */\nconst float czm_radiansPerDegree = 0.017453292519943295;\n",czm_sceneMode2D:"/**\n * The constant identifier for the 2D {@link SceneMode}\n *\n * @name czm_sceneMode2D\n * @glslConstant\n * @see czm_sceneMode\n * @see czm_sceneModeColumbusView\n * @see czm_sceneMode3D\n * @see czm_sceneModeMorphing\n */\nconst float czm_sceneMode2D = 2.0;\n",czm_sceneMode3D:"/**\n * The constant identifier for the 3D {@link SceneMode}\n *\n * @name czm_sceneMode3D\n * @glslConstant\n * @see czm_sceneMode\n * @see czm_sceneMode2D\n * @see czm_sceneModeColumbusView\n * @see czm_sceneModeMorphing\n */\nconst float czm_sceneMode3D = 3.0;\n",czm_sceneModeColumbusView:"/**\n * The constant identifier for the Columbus View {@link SceneMode}\n *\n * @name czm_sceneModeColumbusView\n * @glslConstant\n * @see czm_sceneMode\n * @see czm_sceneMode2D\n * @see czm_sceneMode3D\n * @see czm_sceneModeMorphing\n */\nconst float czm_sceneModeColumbusView = 1.0;\n",czm_sceneModeMorphing:"/**\n * The constant identifier for the Morphing {@link SceneMode}\n *\n * @name czm_sceneModeMorphing\n * @glslConstant\n * @see czm_sceneMode\n * @see czm_sceneMode2D\n * @see czm_sceneModeColumbusView\n * @see czm_sceneMode3D\n */\nconst float czm_sceneModeMorphing = 0.0;\n",czm_solarRadius:"/**\n * A built-in GLSL floating-point constant for one solar radius.\n *\n * @alias czm_solarRadius\n * @glslConstant\n *\n * @see CesiumMath.SOLAR_RADIUS\n *\n * @example\n * // GLSL declaration\n * const float czm_solarRadius = ...;\n */\nconst float czm_solarRadius = 695500000.0;\n",czm_threePiOver2:"/**\n * A built-in GLSL floating-point constant for <code>3pi/2</code>.\n *\n * @alias czm_threePiOver2\n * @glslConstant\n *\n * @see CesiumMath.THREE_PI_OVER_TWO\n *\n * @example\n * // GLSL declaration\n * const float czm_threePiOver2 = ...;\n *\n * // Example\n * float pi = (2.0 / 3.0) * czm_threePiOver2;\n */\nconst float czm_threePiOver2 = 4.71238898038469;\n",czm_twoPi:"/**\n * A built-in GLSL floating-point constant for <code>2pi</code>.\n *\n * @alias czm_twoPi\n * @glslConstant\n *\n * @see CesiumMath.TWO_PI\n *\n * @example\n * // GLSL declaration\n * const float czm_twoPi = ...;\n *\n * // Example\n * float pi = czm_twoPi / 2.0;\n */\nconst float czm_twoPi = 6.283185307179586;\n",czm_webMercatorMaxLatitude:"/**\n * The maximum latitude, in radians, both North and South, supported by a Web Mercator\n * (EPSG:3857) projection. Technically, the Mercator projection is defined\n * for any latitude up to (but not including) 90 degrees, but it makes sense\n * to cut it off sooner because it grows exponentially with increasing latitude.\n * The logic behind this particular cutoff value, which is the one used by\n * Google Maps, Bing Maps, and Esri, is that it makes the projection\n * square. That is, the rectangle is equal in the X and Y directions.\n *\n * The constant value is computed as follows:\n * czm_pi * 0.5 - (2.0 * atan(exp(-czm_pi)))\n *\n * @name czm_webMercatorMaxLatitude\n * @glslConstant\n */\nconst float czm_webMercatorMaxLatitude = 1.4844222297453324;\n",czm_depthRangeStruct:"/**\n * @name czm_depthRangeStruct\n * @glslStruct\n */\nstruct czm_depthRangeStruct\n{\n float near;\n float far;\n};\n",czm_material:"/**\n * Holds material information that can be used for lighting. Returned by all czm_getMaterial functions.\n *\n * @name czm_material\n * @glslStruct\n *\n * @property {vec3} diffuse Incoming light that scatters evenly in all directions.\n * @property {float} specular Intensity of incoming light reflecting in a single direction.\n * @property {float} shininess The sharpness of the specular reflection. Higher values create a smaller, more focused specular highlight.\n * @property {vec3} normal Surface's normal in eye coordinates. It is used for effects such as normal mapping. The default is the surface's unmodified normal.\n * @property {vec3} emission Light emitted by the material equally in all directions. The default is vec3(0.0), which emits no light.\n * @property {float} alpha Alpha of this material. 0.0 is completely transparent; 1.0 is completely opaque.\n */\nstruct czm_material\n{\n vec3 diffuse;\n float specular;\n float shininess;\n vec3 normal;\n vec3 emission;\n float alpha;\n};\n",czm_materialInput:"/**\n * Used as input to every material's czm_getMaterial function.\n *\n * @name czm_materialInput\n * @glslStruct\n *\n * @property {float} s 1D texture coordinates.\n * @property {vec2} st 2D texture coordinates.\n * @property {vec3} str 3D texture coordinates.\n * @property {vec3} normalEC Unperturbed surface normal in eye coordinates.\n * @property {mat3} tangentToEyeMatrix Matrix for converting a tangent space normal to eye space.\n * @property {vec3} positionToEyeEC Vector from the fragment to the eye in eye coordinates. The magnitude is the distance in meters from the fragment to the eye.\n * @property {float} height The height of the terrain in meters above or below the WGS84 ellipsoid. Only available for globe materials.\n * @property {float} slope The slope of the terrain in radians. 0 is flat; pi/2 is vertical. Only available for globe materials.\n * @property {float} aspect The aspect of the terrain in radians. 0 is East, pi/2 is North, pi is West, 3pi/2 is South. Only available for globe materials.\n */\nstruct czm_materialInput\n{\n float s;\n vec2 st;\n vec3 str;\n vec3 normalEC;\n mat3 tangentToEyeMatrix;\n vec3 positionToEyeEC;\n float height;\n float slope;\n float aspect;\n};\n",czm_modelMaterial:"/**\n * Struct for representing a material for a {@link Model}. The model\n * rendering pipeline will pass this struct between material, custom shaders,\n * and lighting stages. This is not to be confused with {@link czm_material}\n * which is used by the older Fabric materials system, although they are similar.\n * <p>\n * All color values (diffuse, specular, emissive) are in linear color space.\n * </p>\n *\n * @name czm_modelMaterial\n * @glslStruct\n *\n * @property {vec3} diffuse Incoming light that scatters evenly in all directions.\n * @property {float} alpha Alpha of this material. 0.0 is completely transparent; 1.0 is completely opaque.\n * @property {vec3} specular Color of reflected light at normal incidence in PBR materials. This is sometimes referred to as f0 in the literature.\n * @property {float} roughness A number from 0.0 to 1.0 representing how rough the surface is. Values near 0.0 produce glossy surfaces, while values near 1.0 produce rough surfaces.\n * @property {vec3} normalEC Surface's normal in eye coordinates. It is used for effects such as normal mapping. The default is the surface's unmodified normal.\n * @property {float} occlusion Ambient occlusion recieved at this point on the material. 1.0 means fully lit, 0.0 means fully occluded.\n * @property {vec3} emissive Light emitted by the material equally in all directions. The default is vec3(0.0), which emits no light.\n */\nstruct czm_modelMaterial {\n vec3 diffuse;\n float alpha;\n vec3 specular;\n float roughness;\n vec3 normalEC;\n float occlusion;\n vec3 emissive;\n#ifdef USE_SPECULAR\n float specularWeight;\n#endif\n#ifdef USE_ANISOTROPY\n vec3 anisotropicT;\n vec3 anisotropicB;\n float anisotropyStrength;\n#endif\n#ifdef USE_CLEARCOAT\n float clearcoatFactor;\n float clearcoatRoughness;\n vec3 clearcoatNormal;\n // Add clearcoatF0 when KHR_materials_ior is implemented\n#endif\n};\n",czm_modelVertexOutput:"/**\n * Struct for representing the output of a custom vertex shader.\n * \n * @name czm_modelVertexOutput\n * @glslStruct\n *\n * @see {@link CustomShader}\n * @see {@link Model}\n *\n * @property {vec3} positionMC The position of the vertex in model coordinates\n * @property {float} pointSize A custom value for gl_PointSize. This is only used for point primitives. \n */\nstruct czm_modelVertexOutput {\n vec3 positionMC;\n float pointSize;\n};\n",czm_ray:"/**\n * DOC_TBA\n *\n * @name czm_ray\n * @glslStruct\n */\nstruct czm_ray\n{\n vec3 origin;\n vec3 direction;\n};\n",czm_raySegment:"/**\n * DOC_TBA\n *\n * @name czm_raySegment\n * @glslStruct\n */\nstruct czm_raySegment\n{\n float start;\n float stop;\n};\n\n/**\n * DOC_TBA\n *\n * @name czm_emptyRaySegment\n * @glslConstant \n */\nconst czm_raySegment czm_emptyRaySegment = czm_raySegment(-czm_infinity, -czm_infinity);\n\n/**\n * DOC_TBA\n *\n * @name czm_fullRaySegment\n * @glslConstant \n */\nconst czm_raySegment czm_fullRaySegment = czm_raySegment(0.0, czm_infinity);\n",czm_shadowParameters:"struct czm_shadowParameters\n{\n#ifdef USE_CUBE_MAP_SHADOW\n vec3 texCoords;\n#else\n vec2 texCoords;\n#endif\n\n float depthBias;\n float depth;\n float nDotL;\n vec2 texelStepSize;\n float normalShadingSmooth;\n float darkness;\n};\n",czm_HSBToRGB:"/**\n * Converts an HSB color (hue, saturation, brightness) to RGB\n * HSB <-> RGB conversion with minimal branching: {@link http://lolengine.net/blog/2013/07/27/rgb-to-hsv-in-glsl}\n *\n * @name czm_HSBToRGB\n * @glslFunction\n * \n * @param {vec3} hsb The color in HSB.\n *\n * @returns {vec3} The color in RGB.\n *\n * @example\n * vec3 hsb = czm_RGBToHSB(rgb);\n * hsb.z *= 0.1;\n * rgb = czm_HSBToRGB(hsb);\n */\n\nconst vec4 K_HSB2RGB = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);\n\nvec3 czm_HSBToRGB(vec3 hsb)\n{\n vec3 p = abs(fract(hsb.xxx + K_HSB2RGB.xyz) * 6.0 - K_HSB2RGB.www);\n return hsb.z * mix(K_HSB2RGB.xxx, clamp(p - K_HSB2RGB.xxx, 0.0, 1.0), hsb.y);\n}\n",czm_HSLToRGB:"/**\n * Converts an HSL color (hue, saturation, lightness) to RGB\n * HSL <-> RGB conversion: {@link http://www.chilliant.com/rgb2hsv.html}\n *\n * @name czm_HSLToRGB\n * @glslFunction\n * \n * @param {vec3} rgb The color in HSL.\n *\n * @returns {vec3} The color in RGB.\n *\n * @example\n * vec3 hsl = czm_RGBToHSL(rgb);\n * hsl.z *= 0.1;\n * rgb = czm_HSLToRGB(hsl);\n */\n\nvec3 hueToRGB(float hue)\n{\n float r = abs(hue * 6.0 - 3.0) - 1.0;\n float g = 2.0 - abs(hue * 6.0 - 2.0);\n float b = 2.0 - abs(hue * 6.0 - 4.0);\n return clamp(vec3(r, g, b), 0.0, 1.0);\n}\n\nvec3 czm_HSLToRGB(vec3 hsl)\n{\n vec3 rgb = hueToRGB(hsl.x);\n float c = (1.0 - abs(2.0 * hsl.z - 1.0)) * hsl.y;\n return (rgb - 0.5) * c + hsl.z;\n}\n",czm_RGBToHSB:"/**\n * Converts an RGB color to HSB (hue, saturation, brightness)\n * HSB <-> RGB conversion with minimal branching: {@link http://lolengine.net/blog/2013/07/27/rgb-to-hsv-in-glsl}\n *\n * @name czm_RGBToHSB\n * @glslFunction\n * \n * @param {vec3} rgb The color in RGB.\n *\n * @returns {vec3} The color in HSB.\n *\n * @example\n * vec3 hsb = czm_RGBToHSB(rgb);\n * hsb.z *= 0.1;\n * rgb = czm_HSBToRGB(hsb);\n */\n\nconst vec4 K_RGB2HSB = vec4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0);\n\nvec3 czm_RGBToHSB(vec3 rgb)\n{\n vec4 p = mix(vec4(rgb.bg, K_RGB2HSB.wz), vec4(rgb.gb, K_RGB2HSB.xy), step(rgb.b, rgb.g));\n vec4 q = mix(vec4(p.xyw, rgb.r), vec4(rgb.r, p.yzx), step(p.x, rgb.r));\n\n float d = q.x - min(q.w, q.y);\n return vec3(abs(q.z + (q.w - q.y) / (6.0 * d + czm_epsilon7)), d / (q.x + czm_epsilon7), q.x);\n}\n",czm_RGBToHSL:"/**\n * Converts an RGB color to HSL (hue, saturation, lightness)\n * HSL <-> RGB conversion: {@link http://www.chilliant.com/rgb2hsv.html}\n *\n * @name czm_RGBToHSL\n * @glslFunction\n * \n * @param {vec3} rgb The color in RGB.\n *\n * @returns {vec3} The color in HSL.\n *\n * @example\n * vec3 hsl = czm_RGBToHSL(rgb);\n * hsl.z *= 0.1;\n * rgb = czm_HSLToRGB(hsl);\n */\n \nvec3 RGBtoHCV(vec3 rgb)\n{\n // Based on work by Sam Hocevar and Emil Persson\n vec4 p = (rgb.g < rgb.b) ? vec4(rgb.bg, -1.0, 2.0 / 3.0) : vec4(rgb.gb, 0.0, -1.0 / 3.0);\n vec4 q = (rgb.r < p.x) ? vec4(p.xyw, rgb.r) : vec4(rgb.r, p.yzx);\n float c = q.x - min(q.w, q.y);\n float h = abs((q.w - q.y) / (6.0 * c + czm_epsilon7) + q.z);\n return vec3(h, c, q.x);\n}\n\nvec3 czm_RGBToHSL(vec3 rgb)\n{\n vec3 hcv = RGBtoHCV(rgb);\n float l = hcv.z - hcv.y * 0.5;\n float s = hcv.y / (1.0 - abs(l * 2.0 - 1.0) + czm_epsilon7);\n return vec3(hcv.x, s, l);\n}\n",czm_RGBToXYZ:"/**\n * Converts an RGB color to CIE Yxy.\n * <p>The conversion is described in\n * {@link http://content.gpwiki.org/index.php/D3DBook:High-Dynamic_Range_Rendering#Luminance_Transform|Luminance Transform}\n * </p>\n * \n * @name czm_RGBToXYZ\n * @glslFunction\n * \n * @param {vec3} rgb The color in RGB.\n *\n * @returns {vec3} The color in CIE Yxy.\n *\n * @example\n * vec3 xyz = czm_RGBToXYZ(rgb);\n * xyz.x = max(xyz.x - luminanceThreshold, 0.0);\n * rgb = czm_XYZToRGB(xyz);\n */\nvec3 czm_RGBToXYZ(vec3 rgb)\n{\n const mat3 RGB2XYZ = mat3(0.4124, 0.2126, 0.0193,\n 0.3576, 0.7152, 0.1192,\n 0.1805, 0.0722, 0.9505);\n vec3 xyz = RGB2XYZ * rgb;\n vec3 Yxy;\n Yxy.r = xyz.g;\n float temp = dot(vec3(1.0), xyz);\n Yxy.gb = xyz.rg / temp;\n return Yxy;\n}\n",czm_XYZToRGB:"/**\n * Converts a CIE Yxy color to RGB.\n * <p>The conversion is described in\n * {@link http://content.gpwiki.org/index.php/D3DBook:High-Dynamic_Range_Rendering#Luminance_Transform|Luminance Transform}\n * </p>\n * \n * @name czm_XYZToRGB\n * @glslFunction\n * \n * @param {vec3} Yxy The color in CIE Yxy.\n *\n * @returns {vec3} The color in RGB.\n *\n * @example\n * vec3 xyz = czm_RGBToXYZ(rgb);\n * xyz.x = max(xyz.x - luminanceThreshold, 0.0);\n * rgb = czm_XYZToRGB(xyz);\n */\nvec3 czm_XYZToRGB(vec3 Yxy)\n{\n const mat3 XYZ2RGB = mat3( 3.2405, -0.9693, 0.0556,\n -1.5371, 1.8760, -0.2040,\n -0.4985, 0.0416, 1.0572);\n vec3 xyz;\n xyz.r = Yxy.r * Yxy.g / Yxy.b;\n xyz.g = Yxy.r;\n xyz.b = Yxy.r * (1.0 - Yxy.g - Yxy.b) / Yxy.b;\n \n return XYZ2RGB * xyz;\n}\n",czm_acesTonemapping:"// See:\n// https://knarkowicz.wordpress.com/2016/01/06/aces-filmic-tone-mapping-curve/\n\nvec3 czm_acesTonemapping(vec3 color) {\n float g = 0.985;\n float a = 0.065;\n float b = 0.0001;\n float c = 0.433;\n float d = 0.238;\n\n color = (color * (color + a) - b) / (color * (g * color + c) + d);\n\n color = clamp(color, 0.0, 1.0);\n\n return color;\n}\n",czm_alphaWeight:"/**\n * @private\n */\nfloat czm_alphaWeight(float a)\n{\n float z = (gl_FragCoord.z - czm_viewportTransformation[3][2]) / czm_viewportTransformation[2][2];\n\n // See Weighted Blended Order-Independent Transparency for examples of different weighting functions:\n // http://jcgt.org/published/0002/02/09/\n return pow(a + 0.01, 4.0) + max(1e-2, min(3.0 * 1e3, 0.003 / (1e-5 + pow(abs(z) / 200.0, 4.0))));\n}\n",czm_antialias:"/**\n * Procedural anti-aliasing by blurring two colors that meet at a sharp edge.\n *\n * @name czm_antialias\n * @glslFunction\n *\n * @param {vec4} color1 The color on one side of the edge.\n * @param {vec4} color2 The color on the other side of the edge.\n * @param {vec4} currentcolor The current color, either <code>color1</code> or <code>color2</code>.\n * @param {float} dist The distance to the edge in texture coordinates.\n * @param {float} [fuzzFactor=0.1] Controls the blurriness between the two colors.\n * @returns {vec4} The anti-aliased color.\n *\n * @example\n * // GLSL declarations\n * vec4 czm_antialias(vec4 color1, vec4 color2, vec4 currentColor, float dist, float fuzzFactor);\n * vec4 czm_antialias(vec4 color1, vec4 color2, vec4 currentColor, float dist);\n *\n * // get the color for a material that has a sharp edge at the line y = 0.5 in texture space\n * float dist = abs(textureCoordinates.t - 0.5);\n * vec4 currentColor = mix(bottomColor, topColor, step(0.5, textureCoordinates.t));\n * vec4 color = czm_antialias(bottomColor, topColor, currentColor, dist, 0.1);\n */\nvec4 czm_antialias(vec4 color1, vec4 color2, vec4 currentColor, float dist, float fuzzFactor)\n{\n float val1 = clamp(dist / fuzzFactor, 0.0, 1.0);\n float val2 = clamp((dist - 0.5) / fuzzFactor, 0.0, 1.0);\n val1 = val1 * (1.0 - val2);\n val1 = val1 * val1 * (3.0 - (2.0 * val1));\n val1 = pow(val1, 0.5); //makes the transition nicer\n \n vec4 midColor = (color1 + color2) * 0.5;\n return mix(midColor, currentColor, val1);\n}\n\nvec4 czm_antialias(vec4 color1, vec4 color2, vec4 currentColor, float dist)\n{\n return czm_antialias(color1, color2, currentColor, dist, 0.1);\n}\n",czm_applyHSBShift:"/**\n * Apply a HSB color shift to an RGB color.\n *\n * @param {vec3} rgb The color in RGB space.\n * @param {vec3} hsbShift The amount to shift each component. The xyz components correspond to hue, saturation, and brightness. Shifting the hue by +/- 1.0 corresponds to shifting the hue by a full cycle. Saturation and brightness are clamped between 0 and 1 after the adjustment\n * @param {bool} ignoreBlackPixels If true, black pixels will be unchanged. This is necessary in some shaders such as atmosphere-related effects.\n *\n * @return {vec3} The RGB color after shifting in HSB space and clamping saturation and brightness to a valid range.\n */\nvec3 czm_applyHSBShift(vec3 rgb, vec3 hsbShift, bool ignoreBlackPixels) {\n // Convert rgb color to hsb\n vec3 hsb = czm_RGBToHSB(rgb);\n\n // Perform hsb shift\n // Hue cycles around so no clamp is needed.\n hsb.x += hsbShift.x; // hue\n hsb.y = clamp(hsb.y + hsbShift.y, 0.0, 1.0); // saturation\n\n // brightness\n //\n // Some shaders such as atmosphere-related effects need to leave black\n // pixels unchanged\n if (ignoreBlackPixels) {\n hsb.z = hsb.z > czm_epsilon7 ? hsb.z + hsbShift.z : 0.0;\n } else {\n hsb.z = hsb.z + hsbShift.z;\n }\n hsb.z = clamp(hsb.z, 0.0, 1.0);\n\n // Convert shifted hsb back to rgb\n return czm_HSBToRGB(hsb);\n}\n",czm_approximateSphericalCoordinates:"/**\n * Approximately computes spherical coordinates given a normal.\n * Uses approximate inverse trigonometry for speed and consistency,\n * since inverse trigonometry can differ from vendor-to-vendor and when compared with the CPU.\n *\n * @name czm_approximateSphericalCoordinates\n * @glslFunction\n *\n * @param {vec3} normal arbitrary-length normal.\n *\n * @returns {vec2} Approximate latitude and longitude spherical coordinates.\n */\nvec2 czm_approximateSphericalCoordinates(vec3 normal) {\n // Project into plane with vertical for latitude\n float latitudeApproximation = czm_fastApproximateAtan(sqrt(normal.x * normal.x + normal.y * normal.y), normal.z);\n float longitudeApproximation = czm_fastApproximateAtan(normal.x, normal.y);\n return vec2(latitudeApproximation, longitudeApproximation);\n}\n",czm_approximateTanh:"/**\n * Compute a rational approximation to tanh(x)\n *\n * @param {float} x A real number input\n * @returns {float} An approximation for tanh(x)\n*/\nfloat czm_approximateTanh(float x) {\n float x2 = x * x;\n return max(-1.0, min(1.0, x * (27.0 + x2) / (27.0 + 9.0 * x2)));\n}\n",czm_backFacing:"/**\n * Determines if the fragment is back facing\n *\n * @name czm_backFacing\n * @glslFunction \n * \n * @returns {bool} <code>true</code> if the fragment is back facing; otherwise, <code>false</code>.\n */\nbool czm_backFacing()\n{\n // !gl_FrontFacing doesn't work as expected on Mac/Intel so use the more verbose form instead. See https://github.com/CesiumGS/cesium/pull/8494.\n return gl_FrontFacing == false;\n}\n",czm_branchFreeTernary:"/**\n * Branchless ternary operator to be used when it's inexpensive to explicitly\n * evaluate both possibilities for a float expression.\n *\n * @name czm_branchFreeTernary\n * @glslFunction\n *\n * @param {bool} comparison A comparison statement\n * @param {float} a Value to return if the comparison is true.\n * @param {float} b Value to return if the comparison is false.\n *\n * @returns {float} equivalent of comparison ? a : b\n */\nfloat czm_branchFreeTernary(bool comparison, float a, float b) {\n float useA = float(comparison);\n return a * useA + b * (1.0 - useA);\n}\n\n/**\n * Branchless ternary operator to be used when it's inexpensive to explicitly\n * evaluate both possibilities for a vec2 expression.\n *\n * @name czm_branchFreeTernary\n * @glslFunction\n *\n * @param {bool} comparison A comparison statement\n * @param {vec2} a Value to return if the comparison is true.\n * @param {vec2} b Value to return if the comparison is false.\n *\n * @returns {vec2} equivalent of comparison ? a : b\n */\nvec2 czm_branchFreeTernary(bool comparison, vec2 a, vec2 b) {\n float useA = float(comparison);\n return a * useA + b * (1.0 - useA);\n}\n\n/**\n * Branchless ternary operator to be used when it's inexpensive to explicitly\n * evaluate both possibilities for a vec3 expression.\n *\n * @name czm_branchFreeTernary\n * @glslFunction\n *\n * @param {bool} comparison A comparison statement\n * @param {vec3} a Value to return if the comparison is true.\n * @param {vec3} b Value to return if the comparison is false.\n *\n * @returns {vec3} equivalent of comparison ? a : b\n */\nvec3 czm_branchFreeTernary(bool comparison, vec3 a, vec3 b) {\n float useA = float(comparison);\n return a * useA + b * (1.0 - useA);\n}\n\n/**\n * Branchless ternary operator to be used when it's inexpensive to explicitly\n * evaluate both possibilities for a vec4 expression.\n *\n * @name czm_branchFreeTernary\n * @glslFunction\n *\n * @param {bool} comparison A comparison statement\n * @param {vec3} a Value to return if the comparison is true.\n * @param {vec3} b Value to return if the comparison is false.\n *\n * @returns {vec3} equivalent of comparison ? a : b\n */\nvec4 czm_branchFreeTernary(bool comparison, vec4 a, vec4 b) {\n float useA = float(comparison);\n return a * useA + b * (1.0 - useA);\n}\n",czm_cascadeColor:"\nvec4 czm_cascadeColor(vec4 weights)\n{\n return vec4(1.0, 0.0, 0.0, 1.0) * weights.x +\n vec4(0.0, 1.0, 0.0, 1.0) * weights.y +\n vec4(0.0, 0.0, 1.0, 1.0) * weights.z +\n vec4(1.0, 0.0, 1.0, 1.0) * weights.w;\n}\n",czm_cascadeDistance:"\nuniform vec4 shadowMap_cascadeDistances;\n\nfloat czm_cascadeDistance(vec4 weights)\n{\n return dot(shadowMap_cascadeDistances, weights);\n}\n",czm_cascadeMatrix:"\nuniform mat4 shadowMap_cascadeMatrices[4];\n\nmat4 czm_cascadeMatrix(vec4 weights)\n{\n return shadowMap_cascadeMatrices[0] * weights.x +\n shadowMap_cascadeMatrices[1] * weights.y +\n shadowMap_cascadeMatrices[2] * weights.z +\n shadowMap_cascadeMatrices[3] * weights.w;\n}\n",czm_cascadeWeights:"\nuniform vec4 shadowMap_cascadeSplits[2];\n\nvec4 czm_cascadeWeights(float depthEye)\n{\n // One component is set to 1.0 and all others set to 0.0.\n vec4 near = step(shadowMap_cascadeSplits[0], vec4(depthEye));\n vec4 far = step(depthEye, shadowMap_cascadeSplits[1]);\n return near * far;\n}\n",czm_clipPolygons:"float getSignedDistance(vec2 uv, highp sampler2D clippingDistance) {\n float signedDistance = texture(clippingDistance, uv).r;\n return (signedDistance - 0.5) * 2.0;\n}\n\nvoid czm_clipPolygons(highp sampler2D clippingDistance, int extentsLength, vec2 clippingPosition, int regionIndex) {\n // Position is completely outside of polygons bounds\n vec2 rectUv = clippingPosition;\n if (regionIndex < 0 || rectUv.x <= 0.0 || rectUv.y <= 0.0 || rectUv.x >= 1.0 || rectUv.y >= 1.0) {\n #ifdef CLIPPING_INVERSE \n discard;\n #endif\n return;\n }\n\n vec2 clippingDistanceTextureDimensions = vec2(textureSize(clippingDistance, 0));\n vec2 sampleOffset = max(1.0 / clippingDistanceTextureDimensions, vec2(0.005));\n float dimension = float(extentsLength);\n if (extentsLength > 2) {\n dimension = ceil(log2(float(extentsLength)));\n }\n\n vec2 textureOffset = vec2(mod(float(regionIndex), dimension), floor(float(regionIndex) / dimension)) / dimension;\n vec2 uv = textureOffset + rectUv / dimension;\n\n float signedDistance = getSignedDistance(uv, clippingDistance);\n\n #ifdef CLIPPING_INVERSE\n if (signedDistance > 0.0) {\n discard;\n }\n #else\n if (signedDistance < 0.0) {\n discard;\n }\n #endif\n}\n",czm_columbusViewMorph:"/**\n * DOC_TBA\n *\n * @name czm_columbusViewMorph\n * @glslFunction\n */\nvec4 czm_columbusViewMorph(vec4 position2D, vec4 position3D, float time)\n{\n // Just linear for now.\n vec3 p = mix(position2D.xyz, position3D.xyz, time);\n return vec4(p, 1.0);\n}\n",czm_computeAtmosphereColor:"/**\n * Compute the atmosphere color, applying Rayleigh and Mie scattering. This\n * builtin uses automatic uniforms so the atmophere settings are synced with the\n * state of the Scene, even in other contexts like Model.\n *\n * @name czm_computeAtmosphereColor\n * @glslFunction\n *\n * @param {vec3} positionWC Position of the fragment in world coords (low precision)\n * @param {vec3} lightDirection Light direction from the sun or other light source.\n * @param {vec3} rayleighColor The Rayleigh scattering color computed by a scattering function\n * @param {vec3} mieColor The Mie scattering color computed by a scattering function\n * @param {float} opacity The opacity computed by a scattering function.\n */\nvec4 czm_computeAtmosphereColor(\n vec3 positionWC,\n vec3 lightDirection,\n vec3 rayleighColor,\n vec3 mieColor,\n float opacity\n) {\n // Setup the primary ray: from the camera position to the vertex position.\n vec3 cameraToPositionWC = positionWC - czm_viewerPositionWC;\n vec3 cameraToPositionWCDirection = normalize(cameraToPositionWC);\n\n float cosAngle = dot(cameraToPositionWCDirection, lightDirection);\n float cosAngleSq = cosAngle * cosAngle;\n\n float G = czm_atmosphereMieAnisotropy;\n float GSq = G * G;\n\n // The Rayleigh phase function.\n float rayleighPhase = 3.0 / (50.2654824574) * (1.0 + cosAngleSq);\n // The Mie phase function.\n float miePhase = 3.0 / (25.1327412287) * ((1.0 - GSq) * (cosAngleSq + 1.0)) / (pow(1.0 + GSq - 2.0 * cosAngle * G, 1.5) * (2.0 + GSq));\n\n // The final color is generated by combining the effects of the Rayleigh and Mie scattering.\n vec3 rayleigh = rayleighPhase * rayleighColor;\n vec3 mie = miePhase * mieColor;\n\n vec3 color = (rayleigh + mie) * czm_atmosphereLightIntensity;\n\n return vec4(color, opacity);\n}\n",czm_computeGroundAtmosphereScattering:"/**\n * Compute atmosphere scattering for the ground atmosphere and fog. This method\n * uses automatic uniforms so it is always synced with the scene settings.\n *\n * @name czm_computeGroundAtmosphereScattering\n * @glslfunction\n *\n * @param {vec3} positionWC The position of the fragment in world coordinates.\n * @param {vec3} lightDirection The direction of the light to calculate the scattering from.\n * @param {vec3} rayleighColor The variable the Rayleigh scattering will be written to.\n * @param {vec3} mieColor The variable the Mie scattering will be written to.\n * @param {float} opacity The variable the transmittance will be written to.\n */\nvoid czm_computeGroundAtmosphereScattering(vec3 positionWC, vec3 lightDirection, out vec3 rayleighColor, out vec3 mieColor, out float opacity) {\n vec3 cameraToPositionWC = positionWC - czm_viewerPositionWC;\n vec3 cameraToPositionWCDirection = normalize(cameraToPositionWC);\n czm_ray primaryRay = czm_ray(czm_viewerPositionWC, cameraToPositionWCDirection);\n\n float atmosphereInnerRadius = length(positionWC);\n\n czm_computeScattering(\n primaryRay,\n length(cameraToPositionWC),\n lightDirection,\n atmosphereInnerRadius,\n rayleighColor,\n mieColor,\n opacity\n );\n}\n",czm_computePosition:"/**\n * Returns a position in model coordinates relative to eye taking into\n * account the current scene mode: 3D, 2D, or Columbus view.\n * <p>\n * This uses standard position attributes, <code>position3DHigh</code>, \n * <code>position3DLow</code>, <code>position2DHigh</code>, and <code>position2DLow</code>, \n * and should be used when writing a vertex shader for an {@link Appearance}.\n * </p>\n *\n * @name czm_computePosition\n * @glslFunction\n *\n * @returns {vec4} The position relative to eye.\n *\n * @example\n * vec4 p = czm_computePosition();\n * v_positionEC = (czm_modelViewRelativeToEye * p).xyz;\n * gl_Position = czm_modelViewProjectionRelativeToEye * p;\n *\n * @see czm_translateRelativeToEye\n */\nvec4 czm_computePosition();\n",czm_computeScattering:"/**\n * This function computes the colors contributed by Rayliegh and Mie scattering on a given ray, as well as\n * the transmittance value for the ray. This function uses automatic uniforms\n * so the atmosphere settings are always synced with the current scene.\n *\n * @name czm_computeScattering\n * @glslfunction\n *\n * @param {czm_ray} primaryRay The ray from the camera to the position.\n * @param {float} primaryRayLength The length of the primary ray.\n * @param {vec3} lightDirection The direction of the light to calculate the scattering from.\n * @param {vec3} rayleighColor The variable the Rayleigh scattering will be written to.\n * @param {vec3} mieColor The variable the Mie scattering will be written to.\n * @param {float} opacity The variable the transmittance will be written to.\n */\nvoid czm_computeScattering(\n czm_ray primaryRay,\n float primaryRayLength,\n vec3 lightDirection,\n float atmosphereInnerRadius,\n out vec3 rayleighColor,\n out vec3 mieColor,\n out float opacity\n) {\n const float ATMOSPHERE_THICKNESS = 111e3; // The thickness of the atmosphere in meters.\n const int PRIMARY_STEPS_MAX = 16; // Maximum number of times the ray from the camera to the world position (primary ray) is sampled.\n const int LIGHT_STEPS_MAX = 4; // Maximum number of times the light is sampled from the light source's intersection with the atmosphere to a sample position on the primary ray.\n\n // Initialize the default scattering amounts to 0.\n rayleighColor = vec3(0.0);\n mieColor = vec3(0.0);\n opacity = 0.0;\n\n float atmosphereOuterRadius = atmosphereInnerRadius + ATMOSPHERE_THICKNESS;\n\n vec3 origin = vec3(0.0);\n\n // Calculate intersection from the camera to the outer ring of the atmosphere.\n czm_raySegment primaryRayAtmosphereIntersect = czm_raySphereIntersectionInterval(primaryRay, origin, atmosphereOuterRadius);\n\n // Return empty colors if no intersection with the atmosphere geometry.\n if (primaryRayAtmosphereIntersect == czm_emptyRaySegment) {\n rayleighColor = vec3(1.0, 0.0, 1.0);\n return;\n }\n\n // To deal with smaller values of PRIMARY_STEPS (e.g. 4)\n // we implement a split strategy: sky or horizon.\n // For performance reasons, instead of a if/else branch\n // a soft choice is implemented through a weight 0.0 <= w_stop_gt_lprl <= 1.0\n float x = 1e-7 * primaryRayAtmosphereIntersect.stop / length(primaryRayLength);\n // Value close to 0.0: close to the horizon\n // Value close to 1.0: above in the sky\n float w_stop_gt_lprl = 0.5 * (1.0 + czm_approximateTanh(x));\n\n // The ray should start from the first intersection with the outer atmopshere, or from the camera position, if it is inside the atmosphere.\n float start_0 = primaryRayAtmosphereIntersect.start;\n primaryRayAtmosphereIntersect.start = max(primaryRayAtmosphereIntersect.start, 0.0);\n // The ray should end at the exit from the atmosphere or at the distance to the vertex, whichever is smaller.\n primaryRayAtmosphereIntersect.stop = min(primaryRayAtmosphereIntersect.stop, length(primaryRayLength));\n\n // For the number of ray steps, distinguish inside or outside atmosphere (outer space)\n // (1) from outer space we have to use more ray steps to get a realistic rendering\n // (2) within atmosphere we need fewer steps for faster rendering\n float x_o_a = start_0 - ATMOSPHERE_THICKNESS; // ATMOSPHERE_THICKNESS used as an ad-hoc constant, no precise meaning here, only the order of magnitude matters\n float w_inside_atmosphere = 1.0 - 0.5 * (1.0 + czm_approximateTanh(x_o_a));\n int PRIMARY_STEPS = PRIMARY_STEPS_MAX - int(w_inside_atmosphere * 12.0); // Number of times the ray from the camera to the world position (primary ray) is sampled.\n int LIGHT_STEPS = LIGHT_STEPS_MAX - int(w_inside_atmosphere * 2.0); // Number of times the light is sampled from the light source's intersection with the atmosphere to a sample position on the primary ray.\n\n // Setup for sampling positions along the ray - starting from the intersection with the outer ring of the atmosphere.\n float rayPositionLength = primaryRayAtmosphereIntersect.start;\n // (1) Outside the atmosphere: constant rayStepLength\n // (2) Inside atmosphere: variable rayStepLength to compensate the rough rendering of the smaller number of ray steps\n float totalRayLength = primaryRayAtmosphereIntersect.stop - rayPositionLength;\n float rayStepLengthIncrease = w_inside_atmosphere * ((1.0 - w_stop_gt_lprl) * totalRayLength / (float(PRIMARY_STEPS * (PRIMARY_STEPS + 1)) / 2.0));\n float rayStepLength = max(1.0 - w_inside_atmosphere, w_stop_gt_lprl) * totalRayLength / max(7.0 * w_inside_atmosphere, float(PRIMARY_STEPS));\n\n vec3 rayleighAccumulation = vec3(0.0);\n vec3 mieAccumulation = vec3(0.0);\n vec2 opticalDepth = vec2(0.0);\n vec2 heightScale = vec2(czm_atmosphereRayleighScaleHeight, czm_atmosphereMieScaleHeight);\n\n // Sample positions on the primary ray.\n for (int i = 0; i < PRIMARY_STEPS_MAX; ++i) {\n\n // The loop should be: for (int i = 0; i < PRIMARY_STEPS; ++i) {...} but WebGL1 cannot\n // loop with non-constant condition, so it has to break early instead\n if (i >= PRIMARY_STEPS) {\n break;\n }\n\n // Calculate sample position along viewpoint ray.\n vec3 samplePosition = primaryRay.origin + primaryRay.direction * (rayPositionLength + rayStepLength);\n\n // Calculate height of sample position above ellipsoid.\n float sampleHeight = length(samplePosition) - atmosphereInnerRadius;\n\n // Calculate and accumulate density of particles at the sample position.\n vec2 sampleDensity = exp(-sampleHeight / heightScale) * rayStepLength;\n opticalDepth += sampleDensity;\n\n // Generate ray from the sample position segment to the light source, up to the outer ring of the atmosphere.\n czm_ray lightRay = czm_ray(samplePosition, lightDirection);\n czm_raySegment lightRayAtmosphereIntersect = czm_raySphereIntersectionInterval(lightRay, origin, atmosphereOuterRadius);\n\n float lightStepLength = lightRayAtmosphereIntersect.stop / float(LIGHT_STEPS);\n float lightPositionLength = 0.0;\n\n vec2 lightOpticalDepth = vec2(0.0);\n\n // Sample positions along the light ray, to accumulate incidence of light on the latest sample segment.\n for (int j = 0; j < LIGHT_STEPS_MAX; ++j) {\n\n // The loop should be: for (int j = 0; i < LIGHT_STEPS; ++j) {...} but WebGL1 cannot\n // loop with non-constant condition, so it has to break early instead\n if (j >= LIGHT_STEPS) {\n break;\n }\n\n // Calculate sample position along light ray.\n vec3 lightPosition = samplePosition + lightDirection * (lightPositionLength + lightStepLength * 0.5);\n\n // Calculate height of the light sample position above ellipsoid.\n float lightHeight = length(lightPosition) - atmosphereInnerRadius;\n\n // Calculate density of photons at the light sample position.\n lightOpticalDepth += exp(-lightHeight / heightScale) * lightStepLength;\n\n // Increment distance on light ray.\n lightPositionLength += lightStepLength;\n }\n\n // Compute attenuation via the primary ray and the light ray.\n vec3 attenuation = exp(-((czm_atmosphereMieCoefficient * (opticalDepth.y + lightOpticalDepth.y)) + (czm_atmosphereRayleighCoefficient * (opticalDepth.x + lightOpticalDepth.x))));\n\n // Accumulate the scattering.\n rayleighAccumulation += sampleDensity.x * attenuation;\n mieAccumulation += sampleDensity.y * attenuation;\n\n // Increment distance on primary ray.\n rayPositionLength += (rayStepLength += rayStepLengthIncrease);\n }\n\n // Compute the scattering amount.\n rayleighColor = czm_atmosphereRayleighCoefficient * rayleighAccumulation;\n mieColor = czm_atmosphereMieCoefficient * mieAccumulation;\n\n // Compute the transmittance i.e. how much light is passing through the atmosphere.\n opacity = length(exp(-((czm_atmosphereMieCoefficient * opticalDepth.y) + (czm_atmosphereRayleighCoefficient * opticalDepth.x))));\n}\n",czm_cosineAndSine:"/**\n * @private\n */\nvec2 cordic(float angle)\n{\n// Scale the vector by the appropriate factor for the 24 iterations to follow.\n vec2 vector = vec2(6.0725293500888267e-1, 0.0);\n// Iteration 1\n float sense = (angle < 0.0) ? -1.0 : 1.0;\n // float factor = sense * 1.0; // 2^-0\n mat2 rotation = mat2(1.0, sense, -sense, 1.0);\n vector = rotation * vector;\n angle -= sense * 7.8539816339744828e-1; // atan(2^-0)\n// Iteration 2\n sense = (angle < 0.0) ? -1.0 : 1.0;\n float factor = sense * 5.0e-1; // 2^-1\n rotation[0][1] = factor;\n rotation[1][0] = -factor;\n vector = rotation * vector;\n angle -= sense * 4.6364760900080609e-1; // atan(2^-1)\n// Iteration 3\n sense = (angle < 0.0) ? -1.0 : 1.0;\n factor = sense * 2.5e-1; // 2^-2\n rotation[0][1] = factor;\n rotation[1][0] = -factor;\n vector = rotation * vector;\n angle -= sense * 2.4497866312686414e-1; // atan(2^-2)\n// Iteration 4\n sense = (angle < 0.0) ? -1.0 : 1.0;\n factor = sense * 1.25e-1; // 2^-3\n rotation[0][1] = factor;\n rotation[1][0] = -factor;\n vector = rotation * vector;\n angle -= sense * 1.2435499454676144e-1; // atan(2^-3)\n// Iteration 5\n sense = (angle < 0.0) ? -1.0 : 1.0;\n factor = sense * 6.25e-2; // 2^-4\n rotation[0][1] = factor;\n rotation[1][0] = -factor;\n vector = rotation * vector;\n angle -= sense * 6.2418809995957350e-2; // atan(2^-4)\n// Iteration 6\n sense = (angle < 0.0) ? -1.0 : 1.0;\n factor = sense * 3.125e-2; // 2^-5\n rotation[0][1] = factor;\n rotation[1][0] = -factor;\n vector = rotation * vector;\n angle -= sense * 3.1239833430268277e-2; // atan(2^-5)\n// Iteration 7\n sense = (angle < 0.0) ? -1.0 : 1.0;\n factor = sense * 1.5625e-2; // 2^-6\n rotation[0][1] = factor;\n rotation[1][0] = -factor;\n vector = rotation * vector;\n angle -= sense * 1.5623728620476831e-2; // atan(2^-6)\n// Iteration 8\n sense = (angle < 0.0) ? -1.0 : 1.0;\n factor = sense * 7.8125e-3; // 2^-7\n rotation[0][1] = factor;\n rotation[1][0] = -factor;\n vector = rotation * vector;\n angle -= sense * 7.8123410601011111e-3; // atan(2^-7)\n// Iteration 9\n sense = (angle < 0.0) ? -1.0 : 1.0;\n factor = sense * 3.90625e-3; // 2^-8\n rotation[0][1] = factor;\n rotation[1][0] = -factor;\n vector = rotation * vector;\n angle -= sense * 3.9062301319669718e-3; // atan(2^-8)\n// Iteration 10\n sense = (angle < 0.0) ? -1.0 : 1.0;\n factor = sense * 1.953125e-3; // 2^-9\n rotation[0][1] = factor;\n rotation[1][0] = -factor;\n vector = rotation * vector;\n angle -= sense * 1.9531225164788188e-3; // atan(2^-9)\n// Iteration 11\n sense = (angle < 0.0) ? -1.0 : 1.0;\n factor = sense * 9.765625e-4; // 2^-10\n rotation[0][1] = factor;\n rotation[1][0] = -factor;\n vector = rotation * vector;\n angle -= sense * 9.7656218955931946e-4; // atan(2^-10)\n// Iteration 12\n sense = (angle < 0.0) ? -1.0 : 1.0;\n factor = sense * 4.8828125e-4; // 2^-11\n rotation[0][1] = factor;\n rotation[1][0] = -factor;\n vector = rotation * vector;\n angle -= sense * 4.8828121119489829e-4; // atan(2^-11)\n// Iteration 13\n sense = (angle < 0.0) ? -1.0 : 1.0;\n factor = sense * 2.44140625e-4; // 2^-12\n rotation[0][1] = factor;\n rotation[1][0] = -factor;\n vector = rotation * vector;\n angle -= sense * 2.4414062014936177e-4; // atan(2^-12)\n// Iteration 14\n sense = (angle < 0.0) ? -1.0 : 1.0;\n factor = sense * 1.220703125e-4; // 2^-13\n rotation[0][1] = factor;\n rotation[1][0] = -factor;\n vector = rotation * vector;\n angle -= sense * 1.2207031189367021e-4; // atan(2^-13)\n// Iteration 15\n sense = (angle < 0.0) ? -1.0 : 1.0;\n factor = sense * 6.103515625e-5; // 2^-14\n rotation[0][1] = factor;\n rotation[1][0] = -factor;\n vector = rotation * vector;\n angle -= sense * 6.1035156174208773e-5; // atan(2^-14)\n// Iteration 16\n sense = (angle < 0.0) ? -1.0 : 1.0;\n factor = sense * 3.0517578125e-5; // 2^-15\n rotation[0][1] = factor;\n rotation[1][0] = -factor;\n vector = rotation * vector;\n angle -= sense * 3.0517578115526096e-5; // atan(2^-15)\n// Iteration 17\n sense = (angle < 0.0) ? -1.0 : 1.0;\n factor = sense * 1.52587890625e-5; // 2^-16\n rotation[0][1] = factor;\n rotation[1][0] = -factor;\n vector = rotation * vector;\n angle -= sense * 1.5258789061315762e-5; // atan(2^-16)\n// Iteration 18\n sense = (angle < 0.0) ? -1.0 : 1.0;\n factor = sense * 7.62939453125e-6; // 2^-17\n rotation[0][1] = factor;\n rotation[1][0] = -factor;\n vector = rotation * vector;\n angle -= sense * 7.6293945311019700e-6; // atan(2^-17)\n// Iteration 19\n sense = (angle < 0.0) ? -1.0 : 1.0;\n factor = sense * 3.814697265625e-6; // 2^-18\n rotation[0][1] = factor;\n rotation[1][0] = -factor;\n vector = rotation * vector;\n angle -= sense * 3.8146972656064961e-6; // atan(2^-18)\n// Iteration 20\n sense = (angle < 0.0) ? -1.0 : 1.0;\n factor = sense * 1.9073486328125e-6; // 2^-19\n rotation[0][1] = factor;\n rotation[1][0] = -factor;\n vector = rotation * vector;\n angle -= sense * 1.9073486328101870e-6; // atan(2^-19)\n// Iteration 21\n sense = (angle < 0.0) ? -1.0 : 1.0;\n factor = sense * 9.5367431640625e-7; // 2^-20\n rotation[0][1] = factor;\n rotation[1][0] = -factor;\n vector = rotation * vector;\n angle -= sense * 9.5367431640596084e-7; // atan(2^-20)\n// Iteration 22\n sense = (angle < 0.0) ? -1.0 : 1.0;\n factor = sense * 4.76837158203125e-7; // 2^-21\n rotation[0][1] = factor;\n rotation[1][0] = -factor;\n vector = rotation * vector;\n angle -= sense * 4.7683715820308884e-7; // atan(2^-21)\n// Iteration 23\n sense = (angle < 0.0) ? -1.0 : 1.0;\n factor = sense * 2.384185791015625e-7; // 2^-22\n rotation[0][1] = factor;\n rotation[1][0] = -factor;\n vector = rotation * vector;\n angle -= sense * 2.3841857910155797e-7; // atan(2^-22)\n// Iteration 24\n sense = (angle < 0.0) ? -1.0 : 1.0;\n factor = sense * 1.1920928955078125e-7; // 2^-23\n rotation[0][1] = factor;\n rotation[1][0] = -factor;\n vector = rotation * vector;\n// angle -= sense * 1.1920928955078068e-7; // atan(2^-23)\n\n return vector;\n}\n\n/**\n * Computes the cosine and sine of the provided angle using the CORDIC algorithm.\n *\n * @name czm_cosineAndSine\n * @glslFunction\n *\n * @param {float} angle The angle in radians.\n *\n * @returns {vec2} The resulting cosine of the angle (as the x coordinate) and sine of the angle (as the y coordinate).\n *\n * @example\n * vec2 v = czm_cosineAndSine(czm_piOverSix);\n * float cosine = v.x;\n * float sine = v.y;\n */\nvec2 czm_cosineAndSine(float angle)\n{\n if (angle < -czm_piOverTwo || angle > czm_piOverTwo)\n {\n if (angle < 0.0)\n {\n return -cordic(angle + czm_pi);\n }\n else\n {\n return -cordic(angle - czm_pi);\n }\n }\n else\n {\n return cordic(angle);\n }\n}\n",czm_decompressTextureCoordinates:"/**\n * Decompresses texture coordinates that were packed into a single float.\n *\n * @name czm_decompressTextureCoordinates\n * @glslFunction\n *\n * @param {float} encoded The compressed texture coordinates.\n * @returns {vec2} The decompressed texture coordinates.\n */\n vec2 czm_decompressTextureCoordinates(float encoded)\n {\n float temp = encoded / 4096.0;\n float xZeroTo4095 = floor(temp);\n float stx = xZeroTo4095 / 4095.0;\n float sty = (encoded - xZeroTo4095 * 4096.0) / 4095.0;\n return vec2(stx, sty);\n }\n",czm_depthClamp:"// emulated noperspective\n#if (__VERSION__ == 300 || defined(GL_EXT_frag_depth)) && !defined(LOG_DEPTH)\nout float v_WindowZ;\n#endif\n\n/**\n * Emulates GL_DEPTH_CLAMP, which is not available in WebGL 1 or 2.\n * GL_DEPTH_CLAMP clamps geometry that is outside the near and far planes, \n * capping the shadow volume. More information here: \n * https://www.khronos.org/registry/OpenGL/extensions/ARB/ARB_depth_clamp.txt.\n *\n * When GL_EXT_frag_depth is available we emulate GL_DEPTH_CLAMP by ensuring \n * no geometry gets clipped by setting the clip space z value to 0.0 and then\n * sending the unaltered screen space z value (using emulated noperspective\n * interpolation) to the frag shader where it is clamped to [0,1] and then\n * written with gl_FragDepth (see czm_writeDepthClamp). This technique is based on:\n * https://stackoverflow.com/questions/5960757/how-to-emulate-gl-depth-clamp-nv.\n *\n * When GL_EXT_frag_depth is not available, which is the case on some mobile \n * devices, we must attempt to fix this only in the vertex shader. \n * The approach is to clamp the z value to the far plane, which closes the \n * shadow volume but also distorts the geometry, so there can still be artifacts\n * on frustum seams.\n *\n * @name czm_depthClamp\n * @glslFunction\n *\n * @param {vec4} coords The vertex in clip coordinates.\n * @returns {vec4} The modified vertex.\n *\n * @example\n * gl_Position = czm_depthClamp(czm_modelViewProjection * vec4(position, 1.0));\n *\n * @see czm_writeDepthClamp\n */\nvec4 czm_depthClamp(vec4 coords)\n{\n#ifndef LOG_DEPTH\n#if __VERSION__ == 300 || defined(GL_EXT_frag_depth)\n v_WindowZ = (0.5 * (coords.z / coords.w) + 0.5) * coords.w;\n coords.z = 0.0;\n#else\n coords.z = min(coords.z, coords.w);\n#endif\n#endif\n return coords;\n}\n",czm_eastNorthUpToEyeCoordinates:"/**\n * Computes a 3x3 rotation matrix that transforms vectors from an ellipsoid's east-north-up coordinate system \n * to eye coordinates. In east-north-up coordinates, x points east, y points north, and z points along the \n * surface normal. East-north-up can be used as an ellipsoid's tangent space for operations such as bump mapping.\n * <br /><br />\n * The ellipsoid is assumed to be centered at the model coordinate's origin.\n *\n * @name czm_eastNorthUpToEyeCoordinates\n * @glslFunction\n *\n * @param {vec3} positionMC The position on the ellipsoid in model coordinates.\n * @param {vec3} normalEC The normalized ellipsoid surface normal, at <code>positionMC</code>, in eye coordinates.\n *\n * @returns {mat3} A 3x3 rotation matrix that transforms vectors from the east-north-up coordinate system to eye coordinates.\n *\n * @example\n * // Transform a vector defined in the east-north-up coordinate \n * // system, (0, 0, 1) which is the surface normal, to eye \n * // coordinates.\n * mat3 m = czm_eastNorthUpToEyeCoordinates(positionMC, normalEC);\n * vec3 normalEC = m * vec3(0.0, 0.0, 1.0);\n */\nmat3 czm_eastNorthUpToEyeCoordinates(vec3 positionMC, vec3 normalEC)\n{\n vec3 tangentMC = normalize(vec3(-positionMC.y, positionMC.x, 0.0)); // normalized surface tangent in model coordinates\n vec3 tangentEC = normalize(czm_normal3D * tangentMC); // normalized surface tangent in eye coordinates\n vec3 bitangentEC = normalize(cross(normalEC, tangentEC)); // normalized surface bitangent in eye coordinates\n\n return mat3(\n tangentEC.x, tangentEC.y, tangentEC.z,\n bitangentEC.x, bitangentEC.y, bitangentEC.z,\n normalEC.x, normalEC.y, normalEC.z);\n}\n",czm_ellipsoidContainsPoint:"/**\n * DOC_TBA\n *\n * @name czm_ellipsoidContainsPoint\n * @glslFunction\n *\n */\nbool czm_ellipsoidContainsPoint(vec3 ellipsoid_inverseRadii, vec3 point)\n{\n vec3 scaled = ellipsoid_inverseRadii * (czm_inverseModelView * vec4(point, 1.0)).xyz;\n return (dot(scaled, scaled) <= 1.0);\n}\n",czm_ellipsoidWgs84TextureCoordinates:"/**\n * DOC_TBA\n *\n * @name czm_ellipsoidWgs84TextureCoordinates\n * @glslFunction\n */\nvec2 czm_ellipsoidWgs84TextureCoordinates(vec3 normal)\n{\n return vec2(atan(normal.y, normal.x) * czm_oneOverTwoPi + 0.5, asin(normal.z) * czm_oneOverPi + 0.5);\n}\n",czm_equalsEpsilon:"/**\n * Compares <code>left</code> and <code>right</code> componentwise. Returns <code>true</code>\n * if they are within <code>epsilon</code> and <code>false</code> otherwise. The inputs\n * <code>left</code> and <code>right</code> can be <code>float</code>s, <code>vec2</code>s,\n * <code>vec3</code>s, or <code>vec4</code>s.\n *\n * @name czm_equalsEpsilon\n * @glslFunction\n *\n * @param {} left The first vector.\n * @param {} right The second vector.\n * @param {float} epsilon The epsilon to use for equality testing.\n * @returns {bool} <code>true</code> if the components are within <code>epsilon</code> and <code>false</code> otherwise.\n *\n * @example\n * // GLSL declarations\n * bool czm_equalsEpsilon(float left, float right, float epsilon);\n * bool czm_equalsEpsilon(vec2 left, vec2 right, float epsilon);\n * bool czm_equalsEpsilon(vec3 left, vec3 right, float epsilon);\n * bool czm_equalsEpsilon(vec4 left, vec4 right, float epsilon);\n */\nbool czm_equalsEpsilon(vec4 left, vec4 right, float epsilon) {\n return all(lessThanEqual(abs(left - right), vec4(epsilon)));\n}\n\nbool czm_equalsEpsilon(vec3 left, vec3 right, float epsilon) {\n return all(lessThanEqual(abs(left - right), vec3(epsilon)));\n}\n\nbool czm_equalsEpsilon(vec2 left, vec2 right, float epsilon) {\n return all(lessThanEqual(abs(left - right), vec2(epsilon)));\n}\n\nbool czm_equalsEpsilon(float left, float right, float epsilon) {\n return (abs(left - right) <= epsilon);\n}\n",czm_eyeOffset:"/**\n * DOC_TBA\n *\n * @name czm_eyeOffset\n * @glslFunction\n *\n * @param {vec4} positionEC DOC_TBA.\n * @param {vec3} eyeOffset DOC_TBA.\n *\n * @returns {vec4} DOC_TBA.\n */\nvec4 czm_eyeOffset(vec4 positionEC, vec3 eyeOffset)\n{\n // This equation is approximate in x and y.\n vec4 p = positionEC;\n vec4 zEyeOffset = normalize(p) * eyeOffset.z;\n p.xy += eyeOffset.xy + zEyeOffset.xy;\n p.z += zEyeOffset.z;\n return p;\n}\n",czm_eyeToWindowCoordinates:"/**\n * Transforms a position from eye to window coordinates. The transformation\n * from eye to clip coordinates is done using {@link czm_projection}.\n * The transform from normalized device coordinates to window coordinates is\n * done using {@link czm_viewportTransformation}, which assumes a depth range\n * of <code>near = 0</code> and <code>far = 1</code>.\n * <br /><br />\n * This transform is useful when there is a need to manipulate window coordinates\n * in a vertex shader as done by {@link BillboardCollection}.\n *\n * @name czm_eyeToWindowCoordinates\n * @glslFunction\n *\n * @param {vec4} position The position in eye coordinates to transform.\n *\n * @returns {vec4} The transformed position in window coordinates.\n *\n * @see czm_modelToWindowCoordinates\n * @see czm_projection\n * @see czm_viewportTransformation\n * @see BillboardCollection\n *\n * @example\n * vec4 positionWC = czm_eyeToWindowCoordinates(positionEC);\n */\nvec4 czm_eyeToWindowCoordinates(vec4 positionEC)\n{\n vec4 q = czm_projection * positionEC; // clip coordinates\n q.xyz /= q.w; // normalized device coordinates\n q.xyz = (czm_viewportTransformation * vec4(q.xyz, 1.0)).xyz; // window coordinates\n return q;\n}\n",czm_fastApproximateAtan:"/**\n * Approxiamtes atan over the range [0, 1]. Safe to flip output for negative input.\n *\n * Based on Michal Drobot's approximation from ShaderFastLibs, which in turn is based on\n * \"Efficient approximations for the arctangent function,\" Rajan, S. Sichun Wang Inkol, R. Joyal, A., May 2006.\n * Adapted from ShaderFastLibs under MIT License.\n *\n * Chosen for the following characteristics over range [0, 1]:\n * - basically no error at 0 and 1, important for getting around range limit (naive atan2 via atan requires infinite range atan)\n * - no visible artifacts from first-derivative discontinuities, unlike latitude via range-reduced sqrt asin approximations (at equator)\n *\n * The original code is x * (-0.1784 * abs(x) - 0.0663 * x * x + 1.0301);\n * Removed the abs() in here because it isn't needed, the input range is guaranteed as [0, 1] by how we're approximating atan2.\n *\n * @name czm_fastApproximateAtan\n * @glslFunction\n *\n * @param {float} x Value between 0 and 1 inclusive.\n *\n * @returns {float} Approximation of atan(x)\n */\nfloat czm_fastApproximateAtan(float x) {\n return x * (-0.1784 * x - 0.0663 * x * x + 1.0301);\n}\n\n/**\n * Approximation of atan2.\n *\n * Range reduction math based on nvidia's cg reference implementation for atan2: http://developer.download.nvidia.com/cg/atan2.html\n * However, we replaced their atan curve with Michael Drobot's (see above).\n *\n * @name czm_fastApproximateAtan\n * @glslFunction\n *\n * @param {float} x Value between -1 and 1 inclusive.\n * @param {float} y Value between -1 and 1 inclusive.\n *\n * @returns {float} Approximation of atan2(x, y)\n */\nfloat czm_fastApproximateAtan(float x, float y) {\n // atan approximations are usually only reliable over [-1, 1], or, in our case, [0, 1] due to modifications.\n // So range-reduce using abs and by flipping whether x or y is on top.\n float t = abs(x); // t used as swap and atan result.\n float opposite = abs(y);\n float adjacent = max(t, opposite);\n opposite = min(t, opposite);\n\n t = czm_fastApproximateAtan(opposite / adjacent);\n\n // Undo range reduction\n t = czm_branchFreeTernary(abs(y) > abs(x), czm_piOverTwo - t, t);\n t = czm_branchFreeTernary(x < 0.0, czm_pi - t, t);\n t = czm_branchFreeTernary(y < 0.0, -t, t);\n return t;\n}\n",czm_fog:"/**\n * Gets the color with fog at a distance from the camera.\n *\n * @name czm_fog\n * @glslFunction\n *\n * @param {float} distanceToCamera The distance to the camera in meters.\n * @param {vec3} color The original color.\n * @param {vec3} fogColor The color of the fog.\n *\n * @returns {vec3} The color adjusted for fog at the distance from the camera.\n */\nvec3 czm_fog(float distanceToCamera, vec3 color, vec3 fogColor)\n{\n float scalar = distanceToCamera * czm_fogDensity;\n float fog = 1.0 - exp(-(scalar * scalar));\n return mix(color, fogColor, fog);\n}\n\n/**\n * Gets the color with fog at a distance from the camera.\n *\n * @name czm_fog\n * @glslFunction\n *\n * @param {float} distanceToCamera The distance to the camera in meters.\n * @param {vec3} color The original color.\n * @param {vec3} fogColor The color of the fog.\n * @param {float} fogModifierConstant A constant to modify the appearance of fog.\n *\n * @returns {vec3} The color adjusted for fog at the distance from the camera.\n */\nvec3 czm_fog(float distanceToCamera, vec3 color, vec3 fogColor, float fogModifierConstant)\n{\n float scalar = distanceToCamera * czm_fogDensity;\n float fog = 1.0 - exp(-((fogModifierConstant * scalar + fogModifierConstant) * (scalar * (1.0 + fogModifierConstant))));\n return mix(color, fogColor, fog);\n}\n",czm_gammaCorrect:"/**\n * Converts a color from RGB space to linear space.\n *\n * @name czm_gammaCorrect\n * @glslFunction\n *\n * @param {vec3} color The color in RGB space.\n * @returns {vec3} The color in linear space.\n */\nvec3 czm_gammaCorrect(vec3 color) {\n#ifdef HDR\n color = pow(color, vec3(czm_gamma));\n#endif\n return color;\n}\n\nvec4 czm_gammaCorrect(vec4 color) {\n#ifdef HDR\n color.rgb = pow(color.rgb, vec3(czm_gamma));\n#endif\n return color;\n}\n",czm_geodeticSurfaceNormal:"/**\n * DOC_TBA\n *\n * @name czm_geodeticSurfaceNormal\n * @glslFunction\n *\n * @param {vec3} positionOnEllipsoid DOC_TBA\n * @param {vec3} ellipsoidCenter DOC_TBA\n * @param {vec3} oneOverEllipsoidRadiiSquared DOC_TBA\n * \n * @returns {vec3} DOC_TBA.\n */\nvec3 czm_geodeticSurfaceNormal(vec3 positionOnEllipsoid, vec3 ellipsoidCenter, vec3 oneOverEllipsoidRadiiSquared)\n{\n return normalize((positionOnEllipsoid - ellipsoidCenter) * oneOverEllipsoidRadiiSquared);\n}\n",czm_getDefaultMaterial:"/**\n * An czm_material with default values. Every material's czm_getMaterial\n * should use this default material as a base for the material it returns.\n * The default normal value is given by materialInput.normalEC.\n *\n * @name czm_getDefaultMaterial\n * @glslFunction\n *\n * @param {czm_materialInput} input The input used to construct the default material.\n *\n * @returns {czm_material} The default material.\n *\n * @see czm_materialInput\n * @see czm_material\n * @see czm_getMaterial\n */\nczm_material czm_getDefaultMaterial(czm_materialInput materialInput)\n{\n czm_material material;\n material.diffuse = vec3(0.0);\n material.specular = 0.0;\n material.shininess = 1.0;\n material.normal = materialInput.normalEC;\n material.emission = vec3(0.0);\n material.alpha = 1.0;\n return material;\n}\n",czm_getDynamicAtmosphereLightDirection:"/**\n * Select which direction vector to use for dynamic atmosphere lighting based on an enum value\n *\n * @name czm_getDynamicAtmosphereLightDirection\n * @glslfunction\n * @see DynamicAtmosphereLightingType.js\n *\n * @param {vec3} positionWC the position of the vertex/fragment in world coordinates. This is normalized and returned when dynamic lighting is turned off.\n * @param {float} lightEnum The enum value for selecting between light sources.\n * @return {vec3} The normalized light direction vector. Depending on the enum value, it is either positionWC, czm_lightDirectionWC or czm_sunDirectionWC\n */\nvec3 czm_getDynamicAtmosphereLightDirection(vec3 positionWC, float lightEnum) {\n const float NONE = 0.0;\n const float SCENE_LIGHT = 1.0;\n const float SUNLIGHT = 2.0;\n\n vec3 lightDirection =\n positionWC * float(lightEnum == NONE) +\n czm_lightDirectionWC * float(lightEnum == SCENE_LIGHT) +\n czm_sunDirectionWC * float(lightEnum == SUNLIGHT);\n return normalize(lightDirection);\n}\n",czm_getLambertDiffuse:"/**\n * Calculates the intensity of diffusely reflected light.\n *\n * @name czm_getLambertDiffuse\n * @glslFunction\n *\n * @param {vec3} lightDirectionEC Unit vector pointing to the light source in eye coordinates.\n * @param {vec3} normalEC The surface normal in eye coordinates.\n *\n * @returns {float} The intensity of the diffuse reflection.\n *\n * @see czm_phong\n *\n * @example\n * float diffuseIntensity = czm_getLambertDiffuse(lightDirectionEC, normalEC);\n * float specularIntensity = czm_getSpecular(lightDirectionEC, toEyeEC, normalEC, 200);\n * vec3 color = (diffuseColor * diffuseIntensity) + (specularColor * specularIntensity);\n */\nfloat czm_getLambertDiffuse(vec3 lightDirectionEC, vec3 normalEC)\n{\n return max(dot(lightDirectionEC, normalEC), 0.0);\n}\n",czm_getSpecular:"/**\n * Calculates the specular intensity of reflected light.\n *\n * @name czm_getSpecular\n * @glslFunction\n *\n * @param {vec3} lightDirectionEC Unit vector pointing to the light source in eye coordinates.\n * @param {vec3} toEyeEC Unit vector pointing to the eye position in eye coordinates.\n * @param {vec3} normalEC The surface normal in eye coordinates.\n * @param {float} shininess The sharpness of the specular reflection. Higher values create a smaller, more focused specular highlight.\n *\n * @returns {float} The intensity of the specular highlight.\n *\n * @see czm_phong\n *\n * @example\n * float diffuseIntensity = czm_getLambertDiffuse(lightDirectionEC, normalEC);\n * float specularIntensity = czm_getSpecular(lightDirectionEC, toEyeEC, normalEC, 200);\n * vec3 color = (diffuseColor * diffuseIntensity) + (specularColor * specularIntensity);\n */\nfloat czm_getSpecular(vec3 lightDirectionEC, vec3 toEyeEC, vec3 normalEC, float shininess)\n{\n vec3 toReflectedLight = reflect(-lightDirectionEC, normalEC);\n float specular = max(dot(toReflectedLight, toEyeEC), 0.0);\n\n // pow has undefined behavior if both parameters <= 0.\n // Prevent this by making sure shininess is at least czm_epsilon2.\n return pow(specular, max(shininess, czm_epsilon2));\n}\n",czm_getWaterNoise:"/**\n * @private\n */\nvec4 czm_getWaterNoise(sampler2D normalMap, vec2 uv, float time, float angleInRadians)\n{\n float cosAngle = cos(angleInRadians);\n float sinAngle = sin(angleInRadians);\n\n // time dependent sampling directions\n vec2 s0 = vec2(1.0/17.0, 0.0);\n vec2 s1 = vec2(-1.0/29.0, 0.0);\n vec2 s2 = vec2(1.0/101.0, 1.0/59.0);\n vec2 s3 = vec2(-1.0/109.0, -1.0/57.0);\n\n // rotate sampling direction by specified angle\n s0 = vec2((cosAngle * s0.x) - (sinAngle * s0.y), (sinAngle * s0.x) + (cosAngle * s0.y));\n s1 = vec2((cosAngle * s1.x) - (sinAngle * s1.y), (sinAngle * s1.x) + (cosAngle * s1.y));\n s2 = vec2((cosAngle * s2.x) - (sinAngle * s2.y), (sinAngle * s2.x) + (cosAngle * s2.y));\n s3 = vec2((cosAngle * s3.x) - (sinAngle * s3.y), (sinAngle * s3.x) + (cosAngle * s3.y));\n\n vec2 uv0 = (uv/103.0) + (time * s0);\n vec2 uv1 = uv/107.0 + (time * s1) + vec2(0.23);\n vec2 uv2 = uv/vec2(897.0, 983.0) + (time * s2) + vec2(0.51);\n vec2 uv3 = uv/vec2(991.0, 877.0) + (time * s3) + vec2(0.71);\n\n uv0 = fract(uv0);\n uv1 = fract(uv1);\n uv2 = fract(uv2);\n uv3 = fract(uv3);\n vec4 noise = (texture(normalMap, uv0)) +\n (texture(normalMap, uv1)) +\n (texture(normalMap, uv2)) +\n (texture(normalMap, uv3));\n\n // average and scale to between -1 and 1\n return ((noise / 4.0) - 0.5) * 2.0;\n}\n",czm_hue:"/**\n * Adjusts the hue of a color.\n * \n * @name czm_hue\n * @glslFunction\n * \n * @param {vec3} rgb The color.\n * @param {float} adjustment The amount to adjust the hue of the color in radians.\n *\n * @returns {float} The color with the hue adjusted.\n *\n * @example\n * vec3 adjustHue = czm_hue(color, czm_pi); // The same as czm_hue(color, -czm_pi)\n */\nvec3 czm_hue(vec3 rgb, float adjustment)\n{\n const mat3 toYIQ = mat3(0.299, 0.587, 0.114,\n 0.595716, -0.274453, -0.321263,\n 0.211456, -0.522591, 0.311135);\n const mat3 toRGB = mat3(1.0, 0.9563, 0.6210,\n 1.0, -0.2721, -0.6474,\n 1.0, -1.107, 1.7046);\n \n vec3 yiq = toYIQ * rgb;\n float hue = atan(yiq.z, yiq.y) + adjustment;\n float chroma = sqrt(yiq.z * yiq.z + yiq.y * yiq.y);\n \n vec3 color = vec3(yiq.x, chroma * cos(hue), chroma * sin(hue));\n return toRGB * color;\n}\n",czm_inverseGamma:"/**\n * Converts a color in linear space to RGB space.\n *\n * @name czm_inverseGamma\n * @glslFunction\n *\n * @param {vec3} color The color in linear space.\n * @returns {vec3} The color in RGB space.\n */\nvec3 czm_inverseGamma(vec3 color) {\n return pow(color, vec3(1.0 / czm_gamma));\n}\n",czm_isEmpty:"/**\n * Determines if a time interval is empty.\n *\n * @name czm_isEmpty\n * @glslFunction \n * \n * @param {czm_raySegment} interval The interval to test.\n * \n * @returns {bool} <code>true</code> if the time interval is empty; otherwise, <code>false</code>.\n *\n * @example\n * bool b0 = czm_isEmpty(czm_emptyRaySegment); // true\n * bool b1 = czm_isEmpty(czm_raySegment(0.0, 1.0)); // false\n * bool b2 = czm_isEmpty(czm_raySegment(1.0, 1.0)); // false, contains 1.0.\n */\nbool czm_isEmpty(czm_raySegment interval)\n{\n return (interval.stop < 0.0);\n}\n",czm_isFull:"/**\n * Determines if a time interval is empty.\n *\n * @name czm_isFull\n * @glslFunction \n * \n * @param {czm_raySegment} interval The interval to test.\n * \n * @returns {bool} <code>true</code> if the time interval is empty; otherwise, <code>false</code>.\n *\n * @example\n * bool b0 = czm_isEmpty(czm_emptyRaySegment); // true\n * bool b1 = czm_isEmpty(czm_raySegment(0.0, 1.0)); // false\n * bool b2 = czm_isEmpty(czm_raySegment(1.0, 1.0)); // false, contains 1.0.\n */\nbool czm_isFull(czm_raySegment interval)\n{\n return (interval.start == 0.0 && interval.stop == czm_infinity);\n}\n",czm_latitudeToWebMercatorFraction:"/**\n * Computes the fraction of a Web Wercator rectangle at which a given geodetic latitude is located.\n *\n * @name czm_latitudeToWebMercatorFraction\n * @glslFunction\n *\n * @param {float} latitude The geodetic latitude, in radians.\n * @param {float} southMercatorY The Web Mercator coordinate of the southern boundary of the rectangle.\n * @param {float} oneOverMercatorHeight The total height of the rectangle in Web Mercator coordinates.\n *\n * @returns {float} The fraction of the rectangle at which the latitude occurs. If the latitude is the southern\n * boundary of the rectangle, the return value will be zero. If it is the northern boundary, the return\n * value will be 1.0. Latitudes in between are mapped according to the Web Mercator projection.\n */ \nfloat czm_latitudeToWebMercatorFraction(float latitude, float southMercatorY, float oneOverMercatorHeight)\n{\n float sinLatitude = sin(latitude);\n float mercatorY = 0.5 * log((1.0 + sinLatitude) / (1.0 - sinLatitude));\n \n return (mercatorY - southMercatorY) * oneOverMercatorHeight;\n}\n",czm_lineDistance:"/**\n * Computes distance from an point in 2D to a line in 2D.\n *\n * @name czm_lineDistance\n * @glslFunction\n *\n * param {vec2} point1 A point along the line.\n * param {vec2} point2 A point along the line.\n * param {vec2} point A point that may or may not be on the line.\n * returns {float} The distance from the point to the line.\n */\nfloat czm_lineDistance(vec2 point1, vec2 point2, vec2 point) {\n return abs((point2.y - point1.y) * point.x - (point2.x - point1.x) * point.y + point2.x * point1.y - point2.y * point1.x) / distance(point2, point1);\n}\n",czm_linearToSrgb:"/**\n * Converts a linear RGB color to an sRGB color.\n *\n * @param {vec3|vec4} linearIn The color in linear color space.\n * @returns {vec3|vec4} The color in sRGB color space. The vector type matches the input.\n */\nvec3 czm_linearToSrgb(vec3 linearIn) \n{\n return pow(linearIn, vec3(1.0/2.2));\n}\n\nvec4 czm_linearToSrgb(vec4 linearIn) \n{\n vec3 srgbOut = pow(linearIn.rgb, vec3(1.0/2.2));\n return vec4(srgbOut, linearIn.a);\n}\n",czm_luminance:"/**\n * Computes the luminance of a color. \n *\n * @name czm_luminance\n * @glslFunction\n *\n * @param {vec3} rgb The color.\n * \n * @returns {float} The luminance.\n *\n * @example\n * float light = czm_luminance(vec3(0.0)); // 0.0\n * float dark = czm_luminance(vec3(1.0)); // ~1.0 \n */\nfloat czm_luminance(vec3 rgb)\n{\n // Algorithm from Chapter 10 of Graphics Shaders.\n const vec3 W = vec3(0.2125, 0.7154, 0.0721);\n return dot(rgb, W);\n}\n",czm_maximumComponent:"/**\n * Find the maximum component of a vector.\n *\n * @name czm_maximumComponent\n * @glslFunction\n *\n * @param {vec2|vec3|vec4} v The input vector.\n * @returns {float} The value of the largest component.\n */\nfloat czm_maximumComponent(vec2 v)\n{\n return max(v.x, v.y);\n}\nfloat czm_maximumComponent(vec3 v)\n{\n return max(max(v.x, v.y), v.z);\n}\nfloat czm_maximumComponent(vec4 v)\n{\n return max(max(max(v.x, v.y), v.z), v.w);\n}\n",czm_metersPerPixel:"/**\n * Computes the size of a pixel in meters at a distance from the eye.\n * <p>\n * Use this version when passing in a custom pixel ratio. For example, passing in 1.0 will return meters per native device pixel.\n * </p>\n * @name czm_metersPerPixel\n * @glslFunction\n *\n * @param {vec3} positionEC The position to get the meters per pixel in eye coordinates.\n * @param {float} pixelRatio The scaling factor from pixel space to coordinate space\n *\n * @returns {float} The meters per pixel at positionEC.\n */\nfloat czm_metersPerPixel(vec4 positionEC, float pixelRatio)\n{\n float width = czm_viewport.z;\n float height = czm_viewport.w;\n float pixelWidth;\n float pixelHeight;\n\n float top = czm_frustumPlanes.x;\n float bottom = czm_frustumPlanes.y;\n float left = czm_frustumPlanes.z;\n float right = czm_frustumPlanes.w;\n\n if (czm_sceneMode == czm_sceneMode2D || czm_orthographicIn3D == 1.0)\n {\n float frustumWidth = right - left;\n float frustumHeight = top - bottom;\n pixelWidth = frustumWidth / width;\n pixelHeight = frustumHeight / height;\n }\n else\n {\n float distanceToPixel = -positionEC.z;\n float inverseNear = 1.0 / czm_currentFrustum.x;\n float tanTheta = top * inverseNear;\n pixelHeight = 2.0 * distanceToPixel * tanTheta / height;\n tanTheta = right * inverseNear;\n pixelWidth = 2.0 * distanceToPixel * tanTheta / width;\n }\n\n return max(pixelWidth, pixelHeight) * pixelRatio;\n}\n\n/**\n * Computes the size of a pixel in meters at a distance from the eye.\n * <p>\n * Use this version when scaling by pixel ratio.\n * </p>\n * @name czm_metersPerPixel\n * @glslFunction\n *\n * @param {vec3} positionEC The position to get the meters per pixel in eye coordinates.\n *\n * @returns {float} The meters per pixel at positionEC.\n */\nfloat czm_metersPerPixel(vec4 positionEC)\n{\n return czm_metersPerPixel(positionEC, czm_pixelRatio);\n}\n",czm_modelToWindowCoordinates:"/**\n * Transforms a position from model to window coordinates. The transformation\n * from model to clip coordinates is done using {@link czm_modelViewProjection}.\n * The transform from normalized device coordinates to window coordinates is\n * done using {@link czm_viewportTransformation}, which assumes a depth range\n * of <code>near = 0</code> and <code>far = 1</code>.\n * <br /><br />\n * This transform is useful when there is a need to manipulate window coordinates\n * in a vertex shader as done by {@link BillboardCollection}.\n * <br /><br />\n * This function should not be confused with {@link czm_viewportOrthographic},\n * which is an orthographic projection matrix that transforms from window \n * coordinates to clip coordinates.\n *\n * @name czm_modelToWindowCoordinates\n * @glslFunction\n *\n * @param {vec4} position The position in model coordinates to transform.\n *\n * @returns {vec4} The transformed position in window coordinates.\n *\n * @see czm_eyeToWindowCoordinates\n * @see czm_modelViewProjection\n * @see czm_viewportTransformation\n * @see czm_viewportOrthographic\n * @see BillboardCollection\n *\n * @example\n * vec4 positionWC = czm_modelToWindowCoordinates(positionMC);\n */\nvec4 czm_modelToWindowCoordinates(vec4 position)\n{\n vec4 q = czm_modelViewProjection * position; // clip coordinates\n q.xyz /= q.w; // normalized device coordinates\n q.xyz = (czm_viewportTransformation * vec4(q.xyz, 1.0)).xyz; // window coordinates\n return q;\n}\n",czm_multiplyWithColorBalance:"/**\n * DOC_TBA\n *\n * @name czm_multiplyWithColorBalance\n * @glslFunction\n */\nvec3 czm_multiplyWithColorBalance(vec3 left, vec3 right)\n{\n // Algorithm from Chapter 10 of Graphics Shaders.\n const vec3 W = vec3(0.2125, 0.7154, 0.0721);\n \n vec3 target = left * right;\n float leftLuminance = dot(left, W);\n float rightLuminance = dot(right, W);\n float targetLuminance = dot(target, W);\n \n return ((leftLuminance + rightLuminance) / (2.0 * targetLuminance)) * target;\n}\n",czm_nearFarScalar:"/**\n * Computes a value that scales with distance. The scaling is clamped at the near and\n * far distances, and does not extrapolate. This function works with the\n * {@link NearFarScalar} JavaScript class.\n *\n * @name czm_nearFarScalar\n * @glslFunction\n *\n * @param {vec4} nearFarScalar A vector with 4 components: Near distance (x), Near value (y), Far distance (z), Far value (w).\n * @param {float} cameraDistSq The square of the current distance from the camera.\n *\n * @returns {float} The value at this distance.\n */\nfloat czm_nearFarScalar(vec4 nearFarScalar, float cameraDistSq)\n{\n float valueAtMin = nearFarScalar.y;\n float valueAtMax = nearFarScalar.w;\n float nearDistanceSq = nearFarScalar.x * nearFarScalar.x;\n float farDistanceSq = nearFarScalar.z * nearFarScalar.z;\n\n float t = (cameraDistSq - nearDistanceSq) / (farDistanceSq - nearDistanceSq);\n\n t = pow(clamp(t, 0.0, 1.0), 0.2);\n\n return mix(valueAtMin, valueAtMax, t);\n}\n",czm_octDecode:" /**\n * Decodes a unit-length vector in 'oct' encoding to a normalized 3-component Cartesian vector.\n * The 'oct' encoding is described in \"A Survey of Efficient Representations of Independent Unit Vectors\",\n * Cigolle et al 2014: http://jcgt.org/published/0003/02/01/\n *\n * @name czm_octDecode\n * @param {vec2} encoded The oct-encoded, unit-length vector\n * @param {float} range The maximum value of the SNORM range. The encoded vector is stored in log2(rangeMax+1) bits.\n * @returns {vec3} The decoded and normalized vector\n */\n vec3 czm_octDecode(vec2 encoded, float range)\n {\n if (encoded.x == 0.0 && encoded.y == 0.0) {\n return vec3(0.0, 0.0, 0.0);\n }\n\n encoded = encoded / range * 2.0 - 1.0;\n vec3 v = vec3(encoded.x, encoded.y, 1.0 - abs(encoded.x) - abs(encoded.y));\n if (v.z < 0.0)\n {\n v.xy = (1.0 - abs(v.yx)) * czm_signNotZero(v.xy);\n }\n\n return normalize(v);\n }\n\n/**\n * Decodes a unit-length vector in 'oct' encoding to a normalized 3-component Cartesian vector.\n * The 'oct' encoding is described in \"A Survey of Efficient Representations of Independent Unit Vectors\",\n * Cigolle et al 2014: http://jcgt.org/published/0003/02/01/\n *\n * @name czm_octDecode\n * @param {vec2} encoded The oct-encoded, unit-length vector\n * @returns {vec3} The decoded and normalized vector\n */\n vec3 czm_octDecode(vec2 encoded)\n {\n return czm_octDecode(encoded, 255.0);\n }\n\n /**\n * Decodes a unit-length vector in 'oct' encoding packed into a floating-point number to a normalized 3-component Cartesian vector.\n * The 'oct' encoding is described in \"A Survey of Efficient Representations of Independent Unit Vectors\",\n * Cigolle et al 2014: http://jcgt.org/published/0003/02/01/\n *\n * @name czm_octDecode\n * @param {float} encoded The oct-encoded, unit-length vector\n * @returns {vec3} The decoded and normalized vector\n */\n vec3 czm_octDecode(float encoded)\n {\n float temp = encoded / 256.0;\n float x = floor(temp);\n float y = (temp - x) * 256.0;\n return czm_octDecode(vec2(x, y));\n }\n\n/**\n * Decodes three unit-length vectors in 'oct' encoding packed into two floating-point numbers to normalized 3-component Cartesian vectors.\n * The 'oct' encoding is described in \"A Survey of Efficient Representations of Independent Unit Vectors\",\n * Cigolle et al 2014: http://jcgt.org/published/0003/02/01/\n *\n * @name czm_octDecode\n * @param {vec2} encoded The packed oct-encoded, unit-length vectors.\n * @param {vec3} vector1 One decoded and normalized vector.\n * @param {vec3} vector2 One decoded and normalized vector.\n * @param {vec3} vector3 One decoded and normalized vector.\n */\n void czm_octDecode(vec2 encoded, out vec3 vector1, out vec3 vector2, out vec3 vector3)\n {\n float temp = encoded.x / 65536.0;\n float x = floor(temp);\n float encodedFloat1 = (temp - x) * 65536.0;\n\n temp = encoded.y / 65536.0;\n float y = floor(temp);\n float encodedFloat2 = (temp - y) * 65536.0;\n\n vector1 = czm_octDecode(encodedFloat1);\n vector2 = czm_octDecode(encodedFloat2);\n vector3 = czm_octDecode(vec2(x, y));\n }\n\n",czm_packDepth:"/**\n * Packs a depth value into a vec3 that can be represented by unsigned bytes.\n *\n * @name czm_packDepth\n * @glslFunction\n *\n * @param {float} depth The floating-point depth.\n * @returns {vec3} The packed depth.\n */\nvec4 czm_packDepth(float depth)\n{\n // See Aras Pranckevičius' post Encoding Floats to RGBA\n // http://aras-p.info/blog/2009/07/30/encoding-floats-to-rgba-the-final/\n vec4 enc = vec4(1.0, 255.0, 65025.0, 16581375.0) * depth;\n enc = fract(enc);\n enc -= enc.yzww * vec4(1.0 / 255.0, 1.0 / 255.0, 1.0 / 255.0, 0.0);\n return enc;\n}\n",czm_pbrLighting:"vec3 lambertianDiffuse(vec3 diffuseColor)\n{\n return diffuseColor / czm_pi;\n}\n\nvec3 fresnelSchlick2(vec3 f0, vec3 f90, float VdotH)\n{\n float versine = 1.0 - VdotH;\n // pow(versine, 5.0) is slow. See https://stackoverflow.com/a/68793086/10082269\n float versineSquared = versine * versine;\n return f0 + (f90 - f0) * versineSquared * versineSquared * versine;\n}\n\n#ifdef USE_ANISOTROPY\n/**\n * @param {float} roughness Material roughness (along the anisotropy bitangent)\n * @param {float} tangentialRoughness Anisotropic roughness (along the anisotropy tangent)\n * @param {vec3} lightDirection The direction from the fragment to the light source, transformed to tangent-bitangent-normal coordinates\n * @param {vec3} viewDirection The direction from the fragment to the camera, transformed to tangent-bitangent-normal coordinates\n */\nfloat smithVisibilityGGX_anisotropic(float roughness, float tangentialRoughness, vec3 lightDirection, vec3 viewDirection)\n{\n vec3 roughnessScale = vec3(tangentialRoughness, roughness, 1.0);\n float GGXV = lightDirection.z * length(roughnessScale * viewDirection);\n float GGXL = viewDirection.z * length(roughnessScale * lightDirection);\n float v = 0.5 / (GGXV + GGXL);\n return clamp(v, 0.0, 1.0);\n}\n\n/**\n * @param {float} roughness Material roughness (along the anisotropy bitangent)\n * @param {float} tangentialRoughness Anisotropic roughness (along the anisotropy tangent)\n * @param {vec3} halfwayDirection The unit vector halfway between light and view directions, transformed to tangent-bitangent-normal coordinates\n */\nfloat GGX_anisotropic(float roughness, float tangentialRoughness, vec3 halfwayDirection)\n{\n float roughnessSquared = roughness * tangentialRoughness;\n vec3 f = halfwayDirection * vec3(roughness, tangentialRoughness, roughnessSquared);\n float w2 = roughnessSquared / dot(f, f);\n return roughnessSquared * w2 * w2 / czm_pi;\n}\n#endif\n\nfloat smithVisibilityG1(float NdotV, float roughness)\n{\n // this is the k value for direct lighting.\n // for image based lighting it will be roughness^2 / 2\n float k = (roughness + 1.0) * (roughness + 1.0) / 8.0;\n return NdotV / (NdotV * (1.0 - k) + k);\n}\n\n/**\n * Estimate the geometric self-shadowing of the microfacets in a surface,\n * using the Schlick GGX approximation of a Smith visibility function.\n *\n * @param {float} roughness The roughness of the material.\n * @param {float} NdotL The cosine of the angle between the surface normal and the direction to the light source.\n * @param {float} NdotV The cosine of the angle between the surface normal and the direction to the camera.\n */\nfloat smithVisibilityGGX(float roughness, float NdotL, float NdotV)\n{\n // Avoid divide-by-zero errors\n NdotL = clamp(NdotL, 0.001, 1.0);\n NdotV += 0.001;\n return (\n smithVisibilityG1(NdotL, roughness) *\n smithVisibilityG1(NdotV, roughness)\n ) / (4.0 * NdotL * NdotV);\n}\n\n/**\n * Estimate the fraction of the microfacets in a surface that are aligned with \n * the halfway vector, which is aligned halfway between the directions from\n * the fragment to the camera and from the fragment to the light source.\n *\n * @param {float} roughness The roughness of the material.\n * @param {float} NdotH The cosine of the angle between the surface normal and the halfway vector.\n * @return {float} The fraction of microfacets aligned to the halfway vector.\n */\nfloat GGX(float roughness, float NdotH)\n{\n float roughnessSquared = roughness * roughness;\n float f = (NdotH * roughnessSquared - NdotH) * NdotH + 1.0;\n return roughnessSquared / (czm_pi * f * f);\n}\n\n/**\n * Compute the strength of the specular reflection due to direct lighting.\n *\n * @param {vec3} normal The surface normal.\n * @param {vec3} lightDirection The unit vector pointing from the fragment to the light source.\n * @param {vec3} viewDirection The unit vector pointing from the fragment to the camera.\n * @param {vec3} halfwayDirection The unit vector pointing from the fragment to halfway between the light source and the camera.\n * @param {float} roughness The roughness of the material.\n * @return {float} The strength of the specular reflection.\n */\nfloat computeDirectSpecularStrength(vec3 normal, vec3 lightDirection, vec3 viewDirection, vec3 halfwayDirection, float roughness)\n{\n float NdotL = dot(normal, lightDirection);\n float NdotV = abs(dot(normal, viewDirection));\n float G = smithVisibilityGGX(roughness, NdotL, NdotV);\n float NdotH = clamp(dot(normal, halfwayDirection), 0.0, 1.0);\n float D = GGX(roughness, NdotH);\n return G * D;\n}\n\n/**\n * Compute the diffuse and specular contributions using physically based\n * rendering. This function only handles direct lighting.\n * <p>\n * This function only handles the lighting calculations. Metallic/roughness\n * and specular/glossy must be handled separately. See {@MaterialStageFS}\n * </p>\n *\n * @name czm_pbrLighting\n * @glslFunction\n *\n * @param {vec3} viewDirectionEC Unit vector pointing from the fragment to the eye position\n * @param {vec3} normalEC The surface normal in eye coordinates\n * @param {vec3} lightDirectionEC Unit vector pointing to the light source in eye coordinates.\n * @param {czm_modelMaterial} The material properties.\n * @return {vec3} The computed HDR color\n */\nvec3 czm_pbrLighting(vec3 viewDirectionEC, vec3 normalEC, vec3 lightDirectionEC, czm_modelMaterial material)\n{\n vec3 halfwayDirectionEC = normalize(viewDirectionEC + lightDirectionEC);\n float VdotH = clamp(dot(viewDirectionEC, halfwayDirectionEC), 0.0, 1.0);\n float NdotL = clamp(dot(normalEC, lightDirectionEC), 0.001, 1.0);\n\n vec3 f0 = material.specular;\n float reflectance = czm_maximumComponent(f0);\n // Typical dielectrics will have reflectance 0.04, so f90 will be 1.0.\n // In this case, at grazing angle, all incident energy is reflected.\n vec3 f90 = vec3(clamp(reflectance * 25.0, 0.0, 1.0));\n vec3 F = fresnelSchlick2(f0, f90, VdotH);\n\n #if defined(USE_SPECULAR)\n F *= material.specularWeight;\n #endif\n\n float alpha = material.roughness;\n #ifdef USE_ANISOTROPY\n mat3 tbn = mat3(material.anisotropicT, material.anisotropicB, normalEC);\n vec3 lightDirection = lightDirectionEC * tbn;\n vec3 viewDirection = viewDirectionEC * tbn;\n vec3 halfwayDirection = halfwayDirectionEC * tbn;\n float anisotropyStrength = material.anisotropyStrength;\n float tangentialRoughness = mix(alpha, 1.0, anisotropyStrength * anisotropyStrength);\n float G = smithVisibilityGGX_anisotropic(alpha, tangentialRoughness, lightDirection, viewDirection);\n float D = GGX_anisotropic(alpha, tangentialRoughness, halfwayDirection);\n vec3 specularContribution = F * G * D;\n #else\n float specularStrength = computeDirectSpecularStrength(normalEC, lightDirectionEC, viewDirectionEC, halfwayDirectionEC, alpha);\n vec3 specularContribution = F * specularStrength;\n #endif\n\n vec3 diffuseColor = material.diffuse;\n // F here represents the specular contribution\n vec3 diffuseContribution = (1.0 - F) * lambertianDiffuse(diffuseColor);\n\n // Lo = (diffuse + specular) * Li * NdotL\n return (diffuseContribution + specularContribution) * NdotL;\n}\n",czm_phong:"float czm_private_getLambertDiffuseOfMaterial(vec3 lightDirectionEC, czm_material material)\n{\n return czm_getLambertDiffuse(lightDirectionEC, material.normal);\n}\n\nfloat czm_private_getSpecularOfMaterial(vec3 lightDirectionEC, vec3 toEyeEC, czm_material material)\n{\n return czm_getSpecular(lightDirectionEC, toEyeEC, material.normal, material.shininess);\n}\n\n/**\n * Computes a color using the Phong lighting model.\n *\n * @name czm_phong\n * @glslFunction\n *\n * @param {vec3} toEye A normalized vector from the fragment to the eye in eye coordinates.\n * @param {czm_material} material The fragment's material.\n *\n * @returns {vec4} The computed color.\n *\n * @example\n * vec3 positionToEyeEC = // ...\n * czm_material material = // ...\n * vec3 lightDirectionEC = // ...\n * out_FragColor = czm_phong(normalize(positionToEyeEC), material, lightDirectionEC);\n *\n * @see czm_getMaterial\n */\nvec4 czm_phong(vec3 toEye, czm_material material, vec3 lightDirectionEC)\n{\n // Diffuse from directional light sources at eye (for top-down)\n float diffuse = czm_private_getLambertDiffuseOfMaterial(vec3(0.0, 0.0, 1.0), material);\n if (czm_sceneMode == czm_sceneMode3D) {\n // (and horizon views in 3D)\n diffuse += czm_private_getLambertDiffuseOfMaterial(vec3(0.0, 1.0, 0.0), material);\n }\n\n float specular = czm_private_getSpecularOfMaterial(lightDirectionEC, toEye, material);\n\n // Temporary workaround for adding ambient.\n vec3 materialDiffuse = material.diffuse * 0.5;\n\n vec3 ambient = materialDiffuse;\n vec3 color = ambient + material.emission;\n color += materialDiffuse * diffuse * czm_lightColor;\n color += material.specular * specular * czm_lightColor;\n\n return vec4(color, material.alpha);\n}\n\nvec4 czm_private_phong(vec3 toEye, czm_material material, vec3 lightDirectionEC)\n{\n float diffuse = czm_private_getLambertDiffuseOfMaterial(lightDirectionEC, material);\n float specular = czm_private_getSpecularOfMaterial(lightDirectionEC, toEye, material);\n\n vec3 ambient = vec3(0.0);\n vec3 color = ambient + material.emission;\n color += material.diffuse * diffuse * czm_lightColor;\n color += material.specular * specular * czm_lightColor;\n\n return vec4(color, material.alpha);\n}\n",czm_planeDistance:"/**\n * Computes distance from a point to a plane.\n *\n * @name czm_planeDistance\n * @glslFunction\n *\n * param {vec4} plane A Plane in Hessian Normal Form. See Plane.js\n * param {vec3} point A point in the same space as the plane.\n * returns {float} The distance from the point to the plane.\n */\nfloat czm_planeDistance(vec4 plane, vec3 point) {\n return (dot(plane.xyz, point) + plane.w);\n}\n\n/**\n * Computes distance from a point to a plane.\n *\n * @name czm_planeDistance\n * @glslFunction\n *\n * param {vec3} planeNormal Normal for a plane in Hessian Normal Form. See Plane.js\n * param {float} planeDistance Distance for a plane in Hessian Normal form. See Plane.js\n * param {vec3} point A point in the same space as the plane.\n * returns {float} The distance from the point to the plane.\n */\nfloat czm_planeDistance(vec3 planeNormal, float planeDistance, vec3 point) {\n return (dot(planeNormal, point) + planeDistance);\n}\n",czm_pointAlongRay:"/**\n * Computes the point along a ray at the given time. <code>time</code> can be positive, negative, or zero.\n *\n * @name czm_pointAlongRay\n * @glslFunction\n *\n * @param {czm_ray} ray The ray to compute the point along.\n * @param {float} time The time along the ray.\n * \n * @returns {vec3} The point along the ray at the given time.\n * \n * @example\n * czm_ray ray = czm_ray(vec3(0.0), vec3(1.0, 0.0, 0.0)); // origin, direction\n * vec3 v = czm_pointAlongRay(ray, 2.0); // (2.0, 0.0, 0.0)\n */\nvec3 czm_pointAlongRay(czm_ray ray, float time)\n{\n return ray.origin + (time * ray.direction);\n}\n",czm_rayEllipsoidIntersectionInterval:"/**\n * DOC_TBA\n *\n * @name czm_rayEllipsoidIntersectionInterval\n * @glslFunction\n */\nczm_raySegment czm_rayEllipsoidIntersectionInterval(czm_ray ray, vec3 ellipsoid_center, vec3 ellipsoid_inverseRadii)\n{\n // ray and ellipsoid center in eye coordinates. radii in model coordinates.\n vec3 q = ellipsoid_inverseRadii * (czm_inverseModelView * vec4(ray.origin, 1.0)).xyz;\n vec3 w = ellipsoid_inverseRadii * (czm_inverseModelView * vec4(ray.direction, 0.0)).xyz;\n\n q = q - ellipsoid_inverseRadii * (czm_inverseModelView * vec4(ellipsoid_center, 1.0)).xyz;\n\n float q2 = dot(q, q);\n float qw = dot(q, w);\n\n if (q2 > 1.0) // Outside ellipsoid.\n {\n if (qw >= 0.0) // Looking outward or tangent (0 intersections).\n {\n return czm_emptyRaySegment;\n }\n else // qw < 0.0.\n {\n float qw2 = qw * qw;\n float difference = q2 - 1.0; // Positively valued.\n float w2 = dot(w, w);\n float product = w2 * difference;\n\n if (qw2 < product) // Imaginary roots (0 intersections).\n {\n return czm_emptyRaySegment;\n }\n else if (qw2 > product) // Distinct roots (2 intersections).\n {\n float discriminant = qw * qw - product;\n float temp = -qw + sqrt(discriminant); // Avoid cancellation.\n float root0 = temp / w2;\n float root1 = difference / temp;\n if (root0 < root1)\n {\n czm_raySegment i = czm_raySegment(root0, root1);\n return i;\n }\n else\n {\n czm_raySegment i = czm_raySegment(root1, root0);\n return i;\n }\n }\n else // qw2 == product. Repeated roots (2 intersections).\n {\n float root = sqrt(difference / w2);\n czm_raySegment i = czm_raySegment(root, root);\n return i;\n }\n }\n }\n else if (q2 < 1.0) // Inside ellipsoid (2 intersections).\n {\n float difference = q2 - 1.0; // Negatively valued.\n float w2 = dot(w, w);\n float product = w2 * difference; // Negatively valued.\n float discriminant = qw * qw - product;\n float temp = -qw + sqrt(discriminant); // Positively valued.\n czm_raySegment i = czm_raySegment(0.0, temp / w2);\n return i;\n }\n else // q2 == 1.0. On ellipsoid.\n {\n if (qw < 0.0) // Looking inward.\n {\n float w2 = dot(w, w);\n czm_raySegment i = czm_raySegment(0.0, -qw / w2);\n return i;\n }\n else // qw >= 0.0. Looking outward or tangent.\n {\n return czm_emptyRaySegment;\n }\n }\n}\n",czm_raySphereIntersectionInterval:"/**\n * Compute the intersection interval of a ray with a sphere.\n *\n * @name czm_raySphereIntersectionInterval\n * @glslFunction\n *\n * @param {czm_ray} ray The ray.\n * @param {vec3} center The center of the sphere.\n * @param {float} radius The radius of the sphere.\n * @return {czm_raySegment} The intersection interval of the ray with the sphere.\n */\nczm_raySegment czm_raySphereIntersectionInterval(czm_ray ray, vec3 center, float radius)\n{\n vec3 o = ray.origin;\n vec3 d = ray.direction;\n\n vec3 oc = o - center;\n\n float a = dot(d, d);\n float b = 2.0 * dot(d, oc);\n float c = dot(oc, oc) - (radius * radius);\n\n float det = (b * b) - (4.0 * a * c);\n\n if (det < 0.0) {\n return czm_emptyRaySegment;\n }\n\n float sqrtDet = sqrt(det);\n\n float t0 = (-b - sqrtDet) / (2.0 * a);\n float t1 = (-b + sqrtDet) / (2.0 * a);\n\n czm_raySegment result = czm_raySegment(t0, t1);\n return result;\n}\n",czm_readDepth:"float czm_readDepth(sampler2D depthTexture, vec2 texCoords)\n{\n return czm_reverseLogDepth(texture(depthTexture, texCoords).r);\n}\n",czm_readNonPerspective:"/**\n * Reads a value previously transformed with {@link czm_writeNonPerspective}\n * by dividing it by `w`, the value used in the perspective divide.\n * This function is intended to be called in a fragment shader to access a\n * `varying` that should not be subject to perspective interpolation.\n * For example, screen-space texture coordinates. The value should have been\n * previously written in the vertex shader with a call to\n * {@link czm_writeNonPerspective}.\n *\n * @name czm_readNonPerspective\n * @glslFunction\n *\n * @param {float|vec2|vec3|vec4} value The non-perspective value to be read.\n * @param {float} oneOverW One over the perspective divide value, `w`. Usually this is simply `gl_FragCoord.w`.\n * @returns {float|vec2|vec3|vec4} The usable value.\n */\nfloat czm_readNonPerspective(float value, float oneOverW) {\n return value * oneOverW;\n}\n\nvec2 czm_readNonPerspective(vec2 value, float oneOverW) {\n return value * oneOverW;\n}\n\nvec3 czm_readNonPerspective(vec3 value, float oneOverW) {\n return value * oneOverW;\n}\n\nvec4 czm_readNonPerspective(vec4 value, float oneOverW) {\n return value * oneOverW;\n}\n",czm_reverseLogDepth:"float czm_reverseLogDepth(float logZ)\n{\n#ifdef LOG_DEPTH\n float near = czm_currentFrustum.x;\n float far = czm_currentFrustum.y;\n float log2Depth = logZ * czm_log2FarDepthFromNearPlusOne;\n float depthFromNear = pow(2.0, log2Depth) - 1.0;\n return far * (1.0 - near / (depthFromNear + near)) / (far - near);\n#endif\n return logZ;\n}\n",czm_round:"/**\n * Round a floating point value. This function exists because round() doesn't\n * exist in GLSL 1.00. \n *\n * @param {float|vec2|vec3|vec4} value The value to round\n * @param {float|vec2|vec3|vec3} The rounded value. The type matches the input.\n */\nfloat czm_round(float value) {\n return floor(value + 0.5);\n}\n\nvec2 czm_round(vec2 value) {\n return floor(value + 0.5);\n}\n\nvec3 czm_round(vec3 value) {\n return floor(value + 0.5);\n}\n\nvec4 czm_round(vec4 value) {\n return floor(value + 0.5);\n}\n",czm_sampleOctahedralProjection:"/**\n * Samples the 4 neighboring pixels and return the weighted average.\n *\n * @private\n */\nvec3 czm_sampleOctahedralProjectionWithFiltering(sampler2D projectedMap, vec2 textureSize, vec3 direction, float lod)\n{\n direction /= dot(vec3(1.0), abs(direction));\n vec2 rev = abs(direction.zx) - vec2(1.0);\n vec2 neg = vec2(direction.x < 0.0 ? rev.x : -rev.x,\n direction.z < 0.0 ? rev.y : -rev.y);\n vec2 uv = direction.y < 0.0 ? neg : direction.xz;\n vec2 coord = 0.5 * uv + vec2(0.5);\n vec2 pixel = 1.0 / textureSize;\n\n if (lod > 0.0)\n {\n // Each subseqeuent mip level is half the size\n float scale = 1.0 / pow(2.0, lod);\n float offset = ((textureSize.y + 1.0) / textureSize.x);\n\n coord.x *= offset;\n coord *= scale;\n\n coord.x += offset + pixel.x;\n coord.y += (1.0 - (1.0 / pow(2.0, lod - 1.0))) + pixel.y * (lod - 1.0) * 2.0;\n }\n else\n {\n coord.x *= (textureSize.y / textureSize.x);\n }\n\n // Do bilinear filtering\n #ifndef OES_texture_float_linear\n vec3 color1 = texture(projectedMap, coord + vec2(0.0, pixel.y)).rgb;\n vec3 color2 = texture(projectedMap, coord + vec2(pixel.x, 0.0)).rgb;\n vec3 color3 = texture(projectedMap, coord + pixel).rgb;\n vec3 color4 = texture(projectedMap, coord).rgb;\n\n vec2 texturePosition = coord * textureSize;\n\n float fu = fract(texturePosition.x);\n float fv = fract(texturePosition.y);\n\n vec3 average1 = mix(color4, color2, fu);\n vec3 average2 = mix(color1, color3, fu);\n\n vec3 color = mix(average1, average2, fv);\n #else\n vec3 color = texture(projectedMap, coord).rgb;\n #endif\n\n return color;\n}\n\n\n/**\n * Samples from a cube map that has been projected using an octahedral projection from the given direction.\n *\n * @name czm_sampleOctahedralProjection\n * @glslFunction\n *\n * @param {sampler2D} projectedMap The texture with the octahedral projected cube map.\n * @param {vec2} textureSize The width and height dimensions in pixels of the projected map.\n * @param {vec3} direction The normalized direction used to sample the cube map.\n * @param {float} lod The level of detail to sample.\n * @param {float} maxLod The maximum level of detail.\n * @returns {vec3} The color of the cube map at the direction.\n */\nvec3 czm_sampleOctahedralProjection(sampler2D projectedMap, vec2 textureSize, vec3 direction, float lod, float maxLod) {\n float currentLod = floor(lod + 0.5);\n float nextLod = min(currentLod + 1.0, maxLod);\n\n vec3 colorCurrentLod = czm_sampleOctahedralProjectionWithFiltering(projectedMap, textureSize, direction, currentLod);\n vec3 colorNextLod = czm_sampleOctahedralProjectionWithFiltering(projectedMap, textureSize, direction, nextLod);\n\n return mix(colorNextLod, colorCurrentLod, nextLod - lod);\n}\n",czm_saturation:"/**\n * Adjusts the saturation of a color.\n * \n * @name czm_saturation\n * @glslFunction\n * \n * @param {vec3} rgb The color.\n * @param {float} adjustment The amount to adjust the saturation of the color.\n *\n * @returns {float} The color with the saturation adjusted.\n *\n * @example\n * vec3 greyScale = czm_saturation(color, 0.0);\n * vec3 doubleSaturation = czm_saturation(color, 2.0);\n */\nvec3 czm_saturation(vec3 rgb, float adjustment)\n{\n // Algorithm from Chapter 16 of OpenGL Shading Language\n const vec3 W = vec3(0.2125, 0.7154, 0.0721);\n vec3 intensity = vec3(dot(rgb, W));\n return mix(intensity, rgb, adjustment);\n}\n",czm_shadowDepthCompare:"\nfloat czm_sampleShadowMap(highp samplerCube shadowMap, vec3 d)\n{\n return czm_unpackDepth(czm_textureCube(shadowMap, d));\n}\n\nfloat czm_sampleShadowMap(highp sampler2D shadowMap, vec2 uv)\n{\n#ifdef USE_SHADOW_DEPTH_TEXTURE\n return texture(shadowMap, uv).r;\n#else\n return czm_unpackDepth(texture(shadowMap, uv));\n#endif\n}\n\nfloat czm_shadowDepthCompare(samplerCube shadowMap, vec3 uv, float depth)\n{\n return step(depth, czm_sampleShadowMap(shadowMap, uv));\n}\n\nfloat czm_shadowDepthCompare(sampler2D shadowMap, vec2 uv, float depth)\n{\n return step(depth, czm_sampleShadowMap(shadowMap, uv));\n}\n",czm_shadowVisibility:"\nfloat czm_private_shadowVisibility(float visibility, float nDotL, float normalShadingSmooth, float darkness)\n{\n#ifdef USE_NORMAL_SHADING\n#ifdef USE_NORMAL_SHADING_SMOOTH\n float strength = clamp(nDotL / normalShadingSmooth, 0.0, 1.0);\n#else\n float strength = step(0.0, nDotL);\n#endif\n visibility *= strength;\n#endif\n\n visibility = max(visibility, darkness);\n return visibility;\n}\n\n#ifdef USE_CUBE_MAP_SHADOW\nfloat czm_shadowVisibility(samplerCube shadowMap, czm_shadowParameters shadowParameters)\n{\n float depthBias = shadowParameters.depthBias;\n float depth = shadowParameters.depth;\n float nDotL = shadowParameters.nDotL;\n float normalShadingSmooth = shadowParameters.normalShadingSmooth;\n float darkness = shadowParameters.darkness;\n vec3 uvw = shadowParameters.texCoords;\n\n depth -= depthBias;\n float visibility = czm_shadowDepthCompare(shadowMap, uvw, depth);\n return czm_private_shadowVisibility(visibility, nDotL, normalShadingSmooth, darkness);\n}\n#else\nfloat czm_shadowVisibility(sampler2D shadowMap, czm_shadowParameters shadowParameters)\n{\n float depthBias = shadowParameters.depthBias;\n float depth = shadowParameters.depth;\n float nDotL = shadowParameters.nDotL;\n float normalShadingSmooth = shadowParameters.normalShadingSmooth;\n float darkness = shadowParameters.darkness;\n vec2 uv = shadowParameters.texCoords;\n\n depth -= depthBias;\n#ifdef USE_SOFT_SHADOWS\n vec2 texelStepSize = shadowParameters.texelStepSize;\n float radius = 1.0;\n float dx0 = -texelStepSize.x * radius;\n float dy0 = -texelStepSize.y * radius;\n float dx1 = texelStepSize.x * radius;\n float dy1 = texelStepSize.y * radius;\n float visibility = (\n czm_shadowDepthCompare(shadowMap, uv, depth) +\n czm_shadowDepthCompare(shadowMap, uv + vec2(dx0, dy0), depth) +\n czm_shadowDepthCompare(shadowMap, uv + vec2(0.0, dy0), depth) +\n czm_shadowDepthCompare(shadowMap, uv + vec2(dx1, dy0), depth) +\n czm_shadowDepthCompare(shadowMap, uv + vec2(dx0, 0.0), depth) +\n czm_shadowDepthCompare(shadowMap, uv + vec2(dx1, 0.0), depth) +\n czm_shadowDepthCompare(shadowMap, uv + vec2(dx0, dy1), depth) +\n czm_shadowDepthCompare(shadowMap, uv + vec2(0.0, dy1), depth) +\n czm_shadowDepthCompare(shadowMap, uv + vec2(dx1, dy1), depth)\n ) * (1.0 / 9.0);\n#else\n float visibility = czm_shadowDepthCompare(shadowMap, uv, depth);\n#endif\n\n return czm_private_shadowVisibility(visibility, nDotL, normalShadingSmooth, darkness);\n}\n#endif\n",czm_signNotZero:"/**\n * Returns 1.0 if the given value is positive or zero, and -1.0 if it is negative. This is similar to the GLSL\n * built-in function <code>sign</code> except that returns 1.0 instead of 0.0 when the input value is 0.0.\n * \n * @name czm_signNotZero\n * @glslFunction\n *\n * @param {} value The value for which to determine the sign.\n * @returns {} 1.0 if the value is positive or zero, -1.0 if the value is negative.\n */\nfloat czm_signNotZero(float value)\n{\n return value >= 0.0 ? 1.0 : -1.0;\n}\n\nvec2 czm_signNotZero(vec2 value)\n{\n return vec2(czm_signNotZero(value.x), czm_signNotZero(value.y));\n}\n\nvec3 czm_signNotZero(vec3 value)\n{\n return vec3(czm_signNotZero(value.x), czm_signNotZero(value.y), czm_signNotZero(value.z));\n}\n\nvec4 czm_signNotZero(vec4 value)\n{\n return vec4(czm_signNotZero(value.x), czm_signNotZero(value.y), czm_signNotZero(value.z), czm_signNotZero(value.w));\n}\n",czm_sphericalHarmonics:"/**\n * Computes a color from the third order spherical harmonic coefficients and a normalized direction vector.\n * <p>\n * The order of the coefficients is [L00, L1_1, L10, L11, L2_2, L2_1, L20, L21, L22].\n * </p>\n *\n * @name czm_sphericalHarmonics\n * @glslFunction\n *\n * @param {vec3} normal The normalized direction.\n * @param {vec3[9]} coefficients The third order spherical harmonic coefficients.\n * @returns {vec3} The color at the direction.\n *\n * @see https://graphics.stanford.edu/papers/envmap/envmap.pdf\n */\nvec3 czm_sphericalHarmonics(vec3 normal, vec3 coefficients[9])\n{\n vec3 L00 = coefficients[0];\n vec3 L1_1 = coefficients[1];\n vec3 L10 = coefficients[2];\n vec3 L11 = coefficients[3];\n vec3 L2_2 = coefficients[4];\n vec3 L2_1 = coefficients[5];\n vec3 L20 = coefficients[6];\n vec3 L21 = coefficients[7];\n vec3 L22 = coefficients[8];\n\n float x = normal.x;\n float y = normal.y;\n float z = normal.z;\n\n return\n L00\n + L1_1 * y\n + L10 * z\n + L11 * x\n + L2_2 * (y * x)\n + L2_1 * (y * z)\n + L20 * (3.0 * z * z - 1.0)\n + L21 * (z * x)\n + L22 * (x * x - y * y);\n}\n",czm_srgbToLinear:"/**\n * Converts an sRGB color to a linear RGB color.\n *\n * @param {vec3|vec4} srgbIn The color in sRGB space\n * @returns {vec3|vec4} The color in linear color space. The vector type matches the input.\n */\nvec3 czm_srgbToLinear(vec3 srgbIn)\n{\n return pow(srgbIn, vec3(2.2));\n}\n\nvec4 czm_srgbToLinear(vec4 srgbIn) \n{\n vec3 linearOut = pow(srgbIn.rgb, vec3(2.2));\n return vec4(linearOut, srgbIn.a);\n}\n",czm_tangentToEyeSpaceMatrix:"/**\n * Creates a matrix that transforms vectors from tangent space to eye space.\n *\n * @name czm_tangentToEyeSpaceMatrix\n * @glslFunction\n *\n * @param {vec3} normalEC The normal vector in eye coordinates.\n * @param {vec3} tangentEC The tangent vector in eye coordinates.\n * @param {vec3} bitangentEC The bitangent vector in eye coordinates.\n *\n * @returns {mat3} The matrix that transforms from tangent space to eye space.\n *\n * @example\n * mat3 tangentToEye = czm_tangentToEyeSpaceMatrix(normalEC, tangentEC, bitangentEC);\n * vec3 normal = tangentToEye * texture(normalMap, st).xyz;\n */\nmat3 czm_tangentToEyeSpaceMatrix(vec3 normalEC, vec3 tangentEC, vec3 bitangentEC)\n{\n vec3 normal = normalize(normalEC);\n vec3 tangent = normalize(tangentEC);\n vec3 bitangent = normalize(bitangentEC);\n return mat3(tangent.x , tangent.y , tangent.z,\n bitangent.x, bitangent.y, bitangent.z,\n normal.x , normal.y , normal.z);\n}\n",czm_textureCube:"/**\n * A wrapper around the texture (WebGL2) / textureCube (WebGL1)\n * function to allow for WebGL 1 support.\n * \n * @name czm_textureCube\n * @glslFunction\n *\n * @param {samplerCube} sampler The sampler.\n * @param {vec3} p The coordinates to sample the texture at.\n */\nvec4 czm_textureCube(samplerCube sampler, vec3 p) {\n#if __VERSION__ == 300\n return texture(sampler, p);\n#else \n return textureCube(sampler, p);\n#endif\n}",czm_transformPlane:"/**\n * Transforms a plane.\n * \n * @name czm_transformPlane\n * @glslFunction\n *\n * @param {vec4} plane The plane in Hessian Normal Form.\n * @param {mat4} transform The inverse-transpose of a transformation matrix.\n */\nvec4 czm_transformPlane(vec4 plane, mat4 transform) {\n vec4 transformedPlane = transform * plane;\n // Convert the transformed plane to Hessian Normal Form\n float normalMagnitude = length(transformedPlane.xyz);\n return transformedPlane / normalMagnitude;\n}\n",czm_translateRelativeToEye:"/**\n * Translates a position (or any <code>vec3</code>) that was encoded with {@link EncodedCartesian3},\n * and then provided to the shader as separate <code>high</code> and <code>low</code> bits to\n * be relative to the eye. As shown in the example, the position can then be transformed in eye\n * or clip coordinates using {@link czm_modelViewRelativeToEye} or {@link czm_modelViewProjectionRelativeToEye},\n * respectively.\n * <p>\n * This technique, called GPU RTE, eliminates jittering artifacts when using large coordinates as\n * described in {@link http://help.agi.com/AGIComponents/html/BlogPrecisionsPrecisions.htm|Precisions, Precisions}.\n * </p>\n *\n * @name czm_translateRelativeToEye\n * @glslFunction\n *\n * @param {vec3} high The position's high bits.\n * @param {vec3} low The position's low bits.\n * @returns {vec3} The position translated to be relative to the camera's position.\n *\n * @example\n * in vec3 positionHigh;\n * in vec3 positionLow;\n *\n * void main()\n * {\n * vec4 p = czm_translateRelativeToEye(positionHigh, positionLow);\n * gl_Position = czm_modelViewProjectionRelativeToEye * p;\n * }\n *\n * @see czm_modelViewRelativeToEye\n * @see czm_modelViewProjectionRelativeToEye\n * @see czm_computePosition\n * @see EncodedCartesian3\n */\nvec4 czm_translateRelativeToEye(vec3 high, vec3 low)\n{\n vec3 highDifference = high - czm_encodedCameraPositionMCHigh;\n // This check handles the case when NaN values have gotten into `highDifference`.\n // Such a thing could happen on devices running iOS.\n if (length(highDifference) == 0.0) { \n highDifference = vec3(0); \n }\n vec3 lowDifference = low - czm_encodedCameraPositionMCLow;\n\n return vec4(highDifference + lowDifference, 1.0);\n}\n",czm_translucentPhong:"/**\n * @private\n */\nvec4 czm_translucentPhong(vec3 toEye, czm_material material, vec3 lightDirectionEC)\n{\n // Diffuse from directional light sources at eye (for top-down and horizon views)\n float diffuse = czm_getLambertDiffuse(vec3(0.0, 0.0, 1.0), material.normal);\n\n if (czm_sceneMode == czm_sceneMode3D) {\n // (and horizon views in 3D)\n diffuse += czm_getLambertDiffuse(vec3(0.0, 1.0, 0.0), material.normal);\n }\n\n diffuse = clamp(diffuse, 0.0, 1.0);\n\n float specular = czm_getSpecular(lightDirectionEC, toEye, material.normal, material.shininess);\n\n // Temporary workaround for adding ambient.\n vec3 materialDiffuse = material.diffuse * 0.5;\n\n vec3 ambient = materialDiffuse;\n vec3 color = ambient + material.emission;\n color += materialDiffuse * diffuse * czm_lightColor;\n color += material.specular * specular * czm_lightColor;\n\n return vec4(color, material.alpha);\n}\n",czm_transpose:"/**\n * Returns the transpose of the matrix. The input <code>matrix</code> can be\n * a <code>mat2</code>, <code>mat3</code>, or <code>mat4</code>.\n *\n * @name czm_transpose\n * @glslFunction\n *\n * @param {} matrix The matrix to transpose.\n *\n * @returns {} The transposed matrix.\n *\n * @example\n * // GLSL declarations\n * mat2 czm_transpose(mat2 matrix);\n * mat3 czm_transpose(mat3 matrix);\n * mat4 czm_transpose(mat4 matrix);\n *\n * // Transpose a 3x3 rotation matrix to find its inverse.\n * mat3 eastNorthUpToEye = czm_eastNorthUpToEyeCoordinates(\n * positionMC, normalEC);\n * mat3 eyeToEastNorthUp = czm_transpose(eastNorthUpToEye);\n */\nmat2 czm_transpose(mat2 matrix)\n{\n return mat2(\n matrix[0][0], matrix[1][0],\n matrix[0][1], matrix[1][1]);\n}\n\nmat3 czm_transpose(mat3 matrix)\n{\n return mat3(\n matrix[0][0], matrix[1][0], matrix[2][0],\n matrix[0][1], matrix[1][1], matrix[2][1],\n matrix[0][2], matrix[1][2], matrix[2][2]);\n}\n\nmat4 czm_transpose(mat4 matrix)\n{\n return mat4(\n matrix[0][0], matrix[1][0], matrix[2][0], matrix[3][0],\n matrix[0][1], matrix[1][1], matrix[2][1], matrix[3][1],\n matrix[0][2], matrix[1][2], matrix[2][2], matrix[3][2],\n matrix[0][3], matrix[1][3], matrix[2][3], matrix[3][3]);\n}\n",czm_unpackClippingExtents:"vec2 getLookupUv(vec2 dimensions, int i) {\n int pixY = i / int(dimensions.x);\n int pixX = i - (pixY * int(dimensions.x));\n float pixelWidth = 1.0 / dimensions.x;\n float pixelHeight = 1.0 / dimensions.y;\n float u = (float(pixX) + 0.5) * pixelWidth; // sample from center of pixel\n float v = (float(pixY) + 0.5) * pixelHeight;\n return vec2(u, v);\n}\n\nvec4 czm_unpackClippingExtents(highp sampler2D extentsTexture, int index) {\n vec2 textureDimensions = vec2(textureSize(extentsTexture, 0));\n return texture(extentsTexture, getLookupUv(textureDimensions, index));\n}",czm_unpackDepth:"/**\n * Unpacks a vec4 depth value to a float in [0, 1) range.\n *\n * @name czm_unpackDepth\n * @glslFunction\n *\n * @param {vec4} packedDepth The packed depth.\n *\n * @returns {float} The floating-point depth in [0, 1) range.\n */\n float czm_unpackDepth(vec4 packedDepth)\n {\n // See Aras Pranckevičius' post Encoding Floats to RGBA\n // http://aras-p.info/blog/2009/07/30/encoding-floats-to-rgba-the-final/\n return dot(packedDepth, vec4(1.0, 1.0 / 255.0, 1.0 / 65025.0, 1.0 / 16581375.0));\n }\n",czm_unpackFloat:"/**\n * Unpack an IEEE 754 single-precision float that is packed as a little-endian unsigned normalized vec4.\n *\n * @name czm_unpackFloat\n * @glslFunction\n *\n * @param {vec4} packedFloat The packed float.\n *\n * @returns {float} The floating-point depth in arbitrary range.\n */\nfloat czm_unpackFloat(vec4 packedFloat)\n{\n // Convert to [0.0, 255.0] and round to integer\n packedFloat = floor(packedFloat * 255.0 + 0.5);\n float sign = 1.0 - step(128.0, packedFloat[3]) * 2.0;\n float exponent = 2.0 * mod(packedFloat[3], 128.0) + step(128.0, packedFloat[2]) - 127.0; \n if (exponent == -127.0)\n {\n return 0.0;\n }\n float mantissa = mod(packedFloat[2], 128.0) * 65536.0 + packedFloat[1] * 256.0 + packedFloat[0] + float(0x800000);\n float result = sign * exp2(exponent - 23.0) * mantissa;\n return result;\n}\n",czm_unpackUint:"/**\n * Unpack unsigned integers of 1-4 bytes. in WebGL 1, there is no uint type,\n * so the return value is an int.\n * <p>\n * There are also precision limitations in WebGL 1. highp int is still limited\n * to 24 bits. Above the value of 2^24 = 16777216, precision loss may occur.\n * </p>\n *\n * @param {float|vec2|vec3|vec4} packed The packed value. For vectors, the components are listed in little-endian order.\n *\n * @return {int} The unpacked value.\n */\n int czm_unpackUint(float packedValue) {\n float rounded = czm_round(packedValue * 255.0);\n return int(rounded);\n }\n\n int czm_unpackUint(vec2 packedValue) {\n vec2 rounded = czm_round(packedValue * 255.0);\n return int(dot(rounded, vec2(1.0, 256.0)));\n }\n\n int czm_unpackUint(vec3 packedValue) {\n vec3 rounded = czm_round(packedValue * 255.0);\n return int(dot(rounded, vec3(1.0, 256.0, 65536.0)));\n }\n\n int czm_unpackUint(vec4 packedValue) {\n vec4 rounded = czm_round(packedValue * 255.0);\n return int(dot(rounded, vec4(1.0, 256.0, 65536.0, 16777216.0)));\n }\n",czm_valueTransform:"/**\n * Transform metadata values following the EXT_structural_metadata spec\n * by multiplying by scale and adding the offset. Operations are always\n * performed component-wise, even for matrices.\n * \n * @param {float|vec2|vec3|vec4|mat2|mat3|mat4} offset The offset to add\n * @param {float|vec2|vec3|vec4|mat2|mat3|mat4} scale The scale factor to multiply\n * @param {float|vec2|vec3|vec4|mat2|mat3|mat4} value The original value.\n *\n * @return {float|vec2|vec3|vec4|mat2|mat3|mat4} The transformed value of the same scalar/vector/matrix type as the input.\n */\nfloat czm_valueTransform(float offset, float scale, float value) {\n return scale * value + offset;\n}\n\nvec2 czm_valueTransform(vec2 offset, vec2 scale, vec2 value) {\n return scale * value + offset;\n}\n\nvec3 czm_valueTransform(vec3 offset, vec3 scale, vec3 value) {\n return scale * value + offset;\n}\n\nvec4 czm_valueTransform(vec4 offset, vec4 scale, vec4 value) {\n return scale * value + offset;\n}\n\nmat2 czm_valueTransform(mat2 offset, mat2 scale, mat2 value) {\n return matrixCompMult(scale, value) + offset;\n}\n\nmat3 czm_valueTransform(mat3 offset, mat3 scale, mat3 value) {\n return matrixCompMult(scale, value) + offset;\n}\n\nmat4 czm_valueTransform(mat4 offset, mat4 scale, mat4 value) {\n return matrixCompMult(scale, value) + offset;\n}\n",czm_vertexLogDepth:"#ifdef LOG_DEPTH\n// 1.0 at the near plane, increasing linearly from there.\nout float v_depthFromNearPlusOne;\n#ifdef SHADOW_MAP\nout vec3 v_logPositionEC;\n#endif\n#endif\n\nvec4 czm_updatePositionDepth(vec4 coords) {\n#if defined(LOG_DEPTH)\n\n#ifdef SHADOW_MAP\n vec3 logPositionEC = (czm_inverseProjection * coords).xyz;\n v_logPositionEC = logPositionEC;\n#endif\n\n // With the very high far/near ratios used with the logarithmic depth\n // buffer, floating point rounding errors can cause linear depth values\n // to end up on the wrong side of the far plane, even for vertices that\n // are really nowhere near it. Since we always write a correct logarithmic\n // depth value in the fragment shader anyway, we just need to make sure\n // such errors don't cause the primitive to be clipped entirely before\n // we even get to the fragment shader.\n coords.z = clamp(coords.z / coords.w, -1.0, 1.0) * coords.w;\n#endif\n\n return coords;\n}\n\n/**\n * Writes the logarithmic depth to gl_Position using the already computed gl_Position.\n *\n * @name czm_vertexLogDepth\n * @glslFunction\n */\nvoid czm_vertexLogDepth()\n{\n#ifdef LOG_DEPTH\n v_depthFromNearPlusOne = (gl_Position.w - czm_currentFrustum.x) + 1.0;\n gl_Position = czm_updatePositionDepth(gl_Position);\n#endif\n}\n\n/**\n * Writes the logarithmic depth to gl_Position using the provided clip coordinates.\n * <p>\n * An example use case for this function would be moving the vertex in window coordinates\n * before converting back to clip coordinates. Use the original vertex clip coordinates.\n * </p>\n * @name czm_vertexLogDepth\n * @glslFunction\n *\n * @param {vec4} clipCoords The vertex in clip coordinates.\n *\n * @example\n * czm_vertexLogDepth(czm_projection * vec4(positionEyeCoordinates, 1.0));\n */\nvoid czm_vertexLogDepth(vec4 clipCoords)\n{\n#ifdef LOG_DEPTH\n v_depthFromNearPlusOne = (clipCoords.w - czm_currentFrustum.x) + 1.0;\n czm_updatePositionDepth(clipCoords);\n#endif\n}\n",czm_windowToEyeCoordinates:"vec4 czm_screenToEyeCoordinates(vec4 screenCoordinate)\n{\n // Reconstruct NDC coordinates\n float x = 2.0 * screenCoordinate.x - 1.0;\n float y = 2.0 * screenCoordinate.y - 1.0;\n float z = (screenCoordinate.z - czm_viewportTransformation[3][2]) / czm_viewportTransformation[2][2];\n vec4 q = vec4(x, y, z, 1.0);\n\n // Reverse the perspective division to obtain clip coordinates.\n q /= screenCoordinate.w;\n\n // Reverse the projection transformation to obtain eye coordinates.\n if (!(czm_inverseProjection == mat4(0.0))) // IE and Edge sometimes do something weird with != between mat4s\n {\n q = czm_inverseProjection * q;\n }\n else\n {\n float top = czm_frustumPlanes.x;\n float bottom = czm_frustumPlanes.y;\n float left = czm_frustumPlanes.z;\n float right = czm_frustumPlanes.w;\n\n float near = czm_currentFrustum.x;\n float far = czm_currentFrustum.y;\n\n q.x = (q.x * (right - left) + left + right) * 0.5;\n q.y = (q.y * (top - bottom) + bottom + top) * 0.5;\n q.z = (q.z * (near - far) - near - far) * 0.5;\n q.w = 1.0;\n }\n\n return q;\n}\n\n/**\n * Transforms a position from window to eye coordinates.\n * The transform from window to normalized device coordinates is done using components\n * of (@link czm_viewport} and {@link czm_viewportTransformation} instead of calculating\n * the inverse of <code>czm_viewportTransformation</code>. The transformation from\n * normalized device coordinates to clip coordinates is done using <code>fragmentCoordinate.w</code>,\n * which is expected to be the scalar used in the perspective divide. The transformation\n * from clip to eye coordinates is done using {@link czm_inverseProjection}.\n *\n * @name czm_windowToEyeCoordinates\n * @glslFunction\n *\n * @param {vec4} fragmentCoordinate The position in window coordinates to transform.\n *\n * @returns {vec4} The transformed position in eye coordinates.\n *\n * @see czm_modelToWindowCoordinates\n * @see czm_eyeToWindowCoordinates\n * @see czm_inverseProjection\n * @see czm_viewport\n * @see czm_viewportTransformation\n *\n * @example\n * vec4 positionEC = czm_windowToEyeCoordinates(gl_FragCoord);\n */\nvec4 czm_windowToEyeCoordinates(vec4 fragmentCoordinate)\n{\n vec2 screenCoordXY = (fragmentCoordinate.xy - czm_viewport.xy) / czm_viewport.zw;\n return czm_screenToEyeCoordinates(vec4(screenCoordXY, fragmentCoordinate.zw));\n}\n\nvec4 czm_screenToEyeCoordinates(vec2 screenCoordinateXY, float depthOrLogDepth)\n{\n // See reverseLogDepth.glsl. This is separate to re-use the pow.\n#if defined(LOG_DEPTH) || defined(LOG_DEPTH_READ_ONLY)\n float near = czm_currentFrustum.x;\n float far = czm_currentFrustum.y;\n float log2Depth = depthOrLogDepth * czm_log2FarDepthFromNearPlusOne;\n float depthFromNear = pow(2.0, log2Depth) - 1.0;\n float depthFromCamera = depthFromNear + near;\n vec4 screenCoord = vec4(screenCoordinateXY, far * (1.0 - near / depthFromCamera) / (far - near), 1.0);\n vec4 eyeCoordinate = czm_screenToEyeCoordinates(screenCoord);\n eyeCoordinate.w = 1.0 / depthFromCamera; // Better precision\n return eyeCoordinate;\n#else\n vec4 screenCoord = vec4(screenCoordinateXY, depthOrLogDepth, 1.0);\n vec4 eyeCoordinate = czm_screenToEyeCoordinates(screenCoord);\n#endif\n return eyeCoordinate;\n}\n\n/**\n * Transforms a position given as window x/y and a depth or a log depth from window to eye coordinates.\n * This function produces more accurate results for window positions with log depth than\n * conventionally unpacking the log depth using czm_reverseLogDepth and using the standard version\n * of czm_windowToEyeCoordinates.\n *\n * @name czm_windowToEyeCoordinates\n * @glslFunction\n *\n * @param {vec2} fragmentCoordinateXY The XY position in window coordinates to transform.\n * @param {float} depthOrLogDepth A depth or log depth for the fragment.\n *\n * @see czm_modelToWindowCoordinates\n * @see czm_eyeToWindowCoordinates\n * @see czm_inverseProjection\n * @see czm_viewport\n * @see czm_viewportTransformation\n *\n * @returns {vec4} The transformed position in eye coordinates.\n */\nvec4 czm_windowToEyeCoordinates(vec2 fragmentCoordinateXY, float depthOrLogDepth)\n{\n vec2 screenCoordXY = (fragmentCoordinateXY.xy - czm_viewport.xy) / czm_viewport.zw;\n return czm_screenToEyeCoordinates(screenCoordXY, depthOrLogDepth);\n}\n",czm_writeDepthClamp:"// emulated noperspective\n#if !defined(LOG_DEPTH)\nin float v_WindowZ;\n#endif\n\n/**\n * Emulates GL_DEPTH_CLAMP. Clamps a fragment to the near and far plane\n * by writing the fragment's depth. See czm_depthClamp for more details.\n *\n * @name czm_writeDepthClamp\n * @glslFunction\n *\n * @example\n * out_FragColor = color;\n * czm_writeDepthClamp();\n *\n * @see czm_depthClamp\n */\nvoid czm_writeDepthClamp()\n{\n#if (!defined(LOG_DEPTH) && (__VERSION__ == 300 || defined(GL_EXT_frag_depth)))\n gl_FragDepth = clamp(v_WindowZ * gl_FragCoord.w, 0.0, 1.0);\n#endif\n}\n",czm_writeLogDepth:"#ifdef LOG_DEPTH\nin float v_depthFromNearPlusOne;\n\n#ifdef POLYGON_OFFSET\nuniform vec2 u_polygonOffset;\n#endif\n\n#endif\n\n/**\n * Writes the fragment depth to the logarithmic depth buffer.\n * <p>\n * Use this when the vertex shader does not call {@link czm_vertexlogDepth}, for example, when\n * ray-casting geometry using a full screen quad.\n * </p>\n * @name czm_writeLogDepth\n * @glslFunction\n *\n * @param {float} depth The depth coordinate, where 1.0 is on the near plane and\n * depth increases in eye-space units from there\n *\n * @example\n * czm_writeLogDepth((czm_projection * v_positionEyeCoordinates).w + 1.0);\n */\nvoid czm_writeLogDepth(float depth)\n{\n#if (defined(LOG_DEPTH) && (__VERSION__ == 300 || defined(GL_EXT_frag_depth)))\n // Discard the vertex if it's not between the near and far planes.\n // We allow a bit of epsilon on the near plane comparison because a 1.0\n // from the vertex shader (indicating the vertex should be _on_ the near\n // plane) will not necessarily come here as exactly 1.0.\n if (depth <= 0.9999999 || depth > czm_farDepthFromNearPlusOne) {\n discard;\n }\n\n#ifdef POLYGON_OFFSET\n // Polygon offset: m * factor + r * units\n float factor = u_polygonOffset[0];\n float units = u_polygonOffset[1];\n\n#if (__VERSION__ == 300 || defined(GL_OES_standard_derivatives))\n // This factor doesn't work in IE 10\n if (factor != 0.0) {\n // m = sqrt(dZdX^2 + dZdY^2);\n float x = dFdx(depth);\n float y = dFdy(depth);\n float m = sqrt(x * x + y * y);\n\n // Apply the factor before computing the log depth.\n depth += m * factor;\n }\n#endif\n\n#endif\n\n gl_FragDepth = log2(depth) * czm_oneOverLog2FarDepthFromNearPlusOne;\n\n#ifdef POLYGON_OFFSET\n // Apply the units after the log depth.\n gl_FragDepth += czm_epsilon7 * units;\n#endif\n\n#endif\n}\n\n/**\n * Writes the fragment depth to the logarithmic depth buffer.\n * <p>\n * Use this when the vertex shader calls {@link czm_vertexlogDepth}.\n * </p>\n *\n * @name czm_writeLogDepth\n * @glslFunction\n */\nvoid czm_writeLogDepth() {\n#ifdef LOG_DEPTH\n czm_writeLogDepth(v_depthFromNearPlusOne);\n#endif\n}\n",czm_writeNonPerspective:"/**\n * Transforms a value for non-perspective interpolation by multiplying\n * it by w, the value used in the perspective divide. This function is\n * intended to be called in a vertex shader to compute the value of a\n * `varying` that should not be subject to perspective interpolation.\n * For example, screen-space texture coordinates. The fragment shader\n * must call {@link czm_readNonPerspective} to retrieve the final\n * non-perspective value.\n *\n * @name czm_writeNonPerspective\n * @glslFunction\n *\n * @param {float|vec2|vec3|vec4} value The value to be interpolated without accounting for perspective.\n * @param {float} w The perspective divide value. Usually this is the computed `gl_Position.w`.\n * @returns {float|vec2|vec3|vec4} The transformed value, intended to be stored in a `varying` and read in the\n * fragment shader with {@link czm_readNonPerspective}.\n */\nfloat czm_writeNonPerspective(float value, float w) {\n return value * w;\n}\n\nvec2 czm_writeNonPerspective(vec2 value, float w) {\n return value * w;\n}\n\nvec3 czm_writeNonPerspective(vec3 value, float w) {\n return value * w;\n}\n\nvec4 czm_writeNonPerspective(vec4 value, float w) {\n return value * w;\n}\n"},s=i(5430),l=function(e,t){let i=e;return i=(i=i.replaceAll("version 300 es","")).replaceAll(/(texture\()/g,"texture2D("),t?(i=i.replaceAll(/\n\s*(in)\s+(vec\d|mat\d|float)/g,` varying $2`),/out_FragData_(\d+)/.test(i)&&(i=(i=(i=`#extension GL_EXT_draw_buffers : enable ${i}`).replaceAll(/layout\s+\(location\s*=\s*\d+\)\s*out\s+vec4\s+out_FragData_\d+;/g,"")).replaceAll(/out_FragData_(\d+)/g,"gl_FragData[$1]")),i=(i=(i=i.replaceAll(/layout\s+\(location\s*=\s*0\)\s*out\s+vec4\s+out_FragColor;/g,"")).replaceAll(/out_FragColor/g,"gl_FragColor")).replaceAll(/out_FragColor\[(\d+)\]/g,"gl_FragColor[$1]"),/gl_FragDepth/.test(i)&&(i=(i=`#extension GL_EXT_frag_depth : enable ${i}`).replaceAll(/gl_FragDepth/g,"gl_FragDepthEXT")),i=`#ifdef GL_OES_standard_derivatives #extension GL_OES_standard_derivatives : enable #endif ${i}`):i=(i=i.replaceAll(/(in)\s+(vec\d|mat\d|float)/g,"attribute $2")).replaceAll(/(out)\s+(vec\d|mat\d|float)\s+([\w]+);/g,"varying $2 $3;"),i=`#version 100 ${i}`};function c(e){return(e=e.replace(/\/\/.*/g,"")).replace(/\/\*\*[\s\S]*?\*\//gm,function(e){let t=e.match(/\n/gm).length,i="";for(let e=0;e<t;++e)i+="\n";return i})}function u(e,t,i){let n;for(let t=0;t<i.length;++t)i[t].name===e&&(n=i[t]);return(0,r.Z)(n)||(n={name:e,glslSource:t=c(t),dependsOn:[],requiredBy:[],evaluated:!1},i.push(n)),n}function h(e,t,i){let n,a,s;let h="",f=e.sources;if((0,r.Z)(f))for(n=0,a=f.length;n<a;++n)h+=` #line 0 ${f[n]}`;h=(h=c(h)).replace(/#version\s+(.*?)\n/gm,function(e,t){if((0,r.Z)(s)&&s!==t)throw new o.Z(`inconsistent versions found: ${s} and ${t}`);return s=t,"\n"});let p=[];h=(h=h.replace(/#extension.*\n/gm,function(e){return p.push(e),"\n"})).replace(/precision\s(lowp|mediump|highp)\s(float|int);/,"");let m=e.pickColorQualifier;(0,r.Z)(m)&&(h=d.createPickFragmentShaderSource(h,m));let _="",g=p.length;for(n=0;n<g;n++)_+=p[n];t&&(_+="#ifdef GL_FRAGMENT_PRECISION_HIGH\n precision highp float;\n precision highp int;\n#else\n precision mediump float;\n precision mediump int;\n #define highp mediump\n#endif\n\n");let Z=e.defines;if((0,r.Z)(Z))for(n=0,a=Z.length;n<a;++n){let e=Z[n];0!==e.length&&(_+=`#define ${e} `)}i.textureFloatLinear&&(_+="#define OES_texture_float_linear\n\n"),i.floatingPointTexture&&(_+="#define OES_texture_float\n\n");let y="";e.includeBuiltIns&&(y=function(e){let t=[],i=u("main",e,t);(function e(t,i){if(t.evaluated)return;t.evaluated=!0;let n=t.glslSource.match(/\bczm_[a-zA-Z0-9_]*/g);(0,r.Z)(n)&&null!==n&&(n=n.filter(function(e,t){return n.indexOf(e)===t})).forEach(function(n){if(n!==t.name&&d._czmBuiltinsAndUniforms.hasOwnProperty(n)){let r=u(n,d._czmBuiltinsAndUniforms[n],i);t.dependsOn.push(r),r.requiredBy.push(t),e(r,i)}})})(i,t),function(e){let t=[],i=[];for(;e.length>0;){let n=e.pop();i.push(n),0===n.requiredBy.length&&t.push(n)}for(;t.length>0;){let i=t.shift();e.push(i);for(let e=0;e<i.dependsOn.length;++e){let n=i.dependsOn[e],r=n.requiredBy.indexOf(i);n.requiredBy.splice(r,1),0===n.requiredBy.length&&t.push(n)}}let n=[];for(let e=0;e<i.length;++e)0!==i[e].requiredBy.length&&n.push(i[e]);if(0!==n.length){let e="A circular dependency was found in the following built-in functions/structs/constants: \n";for(let t=0;t<n.length;++t)e=`${e+n[t].name} `;throw new o.Z(e)}}(t);let n="";for(let e=t.length-1;e>=0;--e)n=`${n+t[e].glslSource} `;return n.replace(i.glslSource,"")}(h)),_+="\n#line 0\n";let b=y+h;return i.webgl2&&t&&!/layout\s*\(location\s*=\s*0\)\s*out\s+vec4\s+out_FragColor;/g.test(b)&&!/czm_out_FragColor/g.test(b)&&/out_FragColor/g.test(b)&&(_+="layout(location = 0) out vec4 out_FragColor;\n\n"),_+=y+h,_=i.webgl2?`#version 300 es ${_}`:l(_,t)}function d(e){let t=(e=(0,n.Z)(e,n.Z.EMPTY_OBJECT)).pickColorQualifier;if((0,r.Z)(t)&&"uniform"!==t&&"in"!==t)throw new o.Z("options.pickColorQualifier must be 'uniform' or 'in'.");this.defines=(0,r.Z)(e.defines)?e.defines.slice(0):[],this.sources=(0,r.Z)(e.sources)?e.sources.slice(0):[],this.pickColorQualifier=t,this.includeBuiltIns=(0,n.Z)(e.includeBuiltIns,!0)}for(let e in d.prototype.clone=function(){return new d({sources:this.sources,defines:this.defines,pickColorQualifier:this.pickColorQualifier,includeBuiltIns:this.includeBuiltIns})},d.replaceMain=function(e,t){return t=`void ${t}()`,e.replace(/void\s+main\s*\(\s*(?:void)?\s*\)/g,t)},d.prototype.getCacheKey=function(){let e=this.defines.slice().sort().join(","),t=this.pickColorQualifier,i=this.includeBuiltIns,n=this.sources.join("\n");return`${e}:${t}:${i}:${n}`},d.prototype.createCombinedVertexShader=function(e){return h(this,!1,e)},d.prototype.createCombinedFragmentShader=function(e){return h(this,!0,e)},d._czmBuiltinsAndUniforms={},a)a.hasOwnProperty(e)&&(d._czmBuiltinsAndUniforms[e]=a[e]);for(let e in s.Z)if(s.Z.hasOwnProperty(e)){let t=s.Z[e];"function"==typeof t.getDeclaration&&(d._czmBuiltinsAndUniforms[e]=t.getDeclaration(e))}function f(e,t){let i=e.sources,n=i.length;for(let e=0;e<n;++e)if(-1!==i[e].indexOf(t))return!0;return!1}function p(e,t){let i=t.length;for(let n=0;n<i;++n){let i=t[n];if(f(e,i))return i}}d.createPickVertexShaderSource=function(e){let t=d.replaceMain(e,"czm_old_main");return`${t} in vec4 pickColor; out vec4 czm_pickColor; void main() { czm_old_main(); czm_pickColor = pickColor; }`},d.createPickFragmentShaderSource=function(e,t){let i=d.replaceMain(e,"czm_old_main"),n=`${t} vec4 czm_pickColor; void main() { czm_old_main(); if (out_FragColor.a == 0.0) { discard; } out_FragColor = czm_pickColor; }`;return`${i} ${n}`};let m=["v_normalEC","v_normal"];d.findNormalVarying=function(e){return f(e,"#ifdef HAS_NORMALS")?!function(e,t){let i=e.defines,n=i.length;for(let e=0;e<n;++e)if(i[e]===t)return!0;return!1}(e,"HAS_NORMALS")?void 0:"v_normalEC":p(e,m)};let _=["v_positionEC"];d.findPositionVarying=function(e){return p(e,_)};var g=d},4909:function(e,t,i){"use strict";var n=i(570),r=i(698),o=i(530),a=i(4572),s=i(9410),l=i(7998),c=i(9824),u=i(2150),h=i(6055),d=i(4318),f=i(4169),p=i(5463),m=i(5483),_=i(5874),g=i(9138);function Z(e){let t;e=(0,a.Z)(e,a.Z.EMPTY_OBJECT),r.Z.defined("options.context",e.context);let i=e.context,l=e.width,u=e.height,f=e.source;(0,s.Z)(f)&&((0,s.Z)(l)||(l=(0,a.Z)(f.videoWidth,f.width)),(0,s.Z)(u)||(u=(0,a.Z)(f.videoHeight,f.height)));let _=(0,a.Z)(e.pixelFormat,h.Z.RGBA),g=(0,a.Z)(e.pixelDatatype,p.Z.UNSIGNED_BYTE),Z=h.Z.toInternalFormat(_,g,i),y=h.Z.isCompressedFormat(Z);if(!(0,s.Z)(l)||!(0,s.Z)(u))throw new c.Z("options requires a source field to create an initialized texture or width and height fields to create a blank texture.");if(r.Z.typeOf.number.greaterThan("width",l,0),l>d.Z.maximumTextureSize)throw new c.Z(`Width must be less than or equal to the maximum texture size (${d.Z.maximumTextureSize}). Check maximumTextureSize.`);if(r.Z.typeOf.number.greaterThan("height",u,0),u>d.Z.maximumTextureSize)throw new c.Z(`Height must be less than or equal to the maximum texture size (${d.Z.maximumTextureSize}). Check maximumTextureSize.`);if(!h.Z.validate(_))throw new c.Z("Invalid options.pixelFormat.");if(!y&&!p.Z.validate(g))throw new c.Z("Invalid options.pixelDatatype.");if(_===h.Z.DEPTH_COMPONENT&&g!==p.Z.UNSIGNED_SHORT&&g!==p.Z.UNSIGNED_INT)throw new c.Z("When options.pixelFormat is DEPTH_COMPONENT, options.pixelDatatype must be UNSIGNED_SHORT or UNSIGNED_INT.");if(_===h.Z.DEPTH_STENCIL&&g!==p.Z.UNSIGNED_INT_24_8)throw new c.Z("When options.pixelFormat is DEPTH_STENCIL, options.pixelDatatype must be UNSIGNED_INT_24_8.");if(g===p.Z.FLOAT&&!i.floatingPointTexture)throw new c.Z("When options.pixelDatatype is FLOAT, this WebGL implementation must support the OES_texture_float extension. Check context.floatingPointTexture.");if(g===p.Z.HALF_FLOAT&&!i.halfFloatingPointTexture)throw new c.Z("When options.pixelDatatype is HALF_FLOAT, this WebGL implementation must support the OES_texture_half_float extension. Check context.halfFloatingPointTexture.");if(h.Z.isDepthFormat(_)){if((0,s.Z)(f))throw new c.Z("When options.pixelFormat is DEPTH_COMPONENT or DEPTH_STENCIL, source cannot be provided.");if(!i.depthTexture)throw new c.Z("When options.pixelFormat is DEPTH_COMPONENT or DEPTH_STENCIL, this WebGL implementation must support WEBGL_depth_texture. Check context.depthTexture.")}if(y){if(!(0,s.Z)(f)||!(0,s.Z)(f.arrayBufferView))throw new c.Z("When options.pixelFormat is compressed, options.source.arrayBufferView must be defined.");if(h.Z.isDXTFormat(Z)&&!i.s3tc)throw new c.Z("When options.pixelFormat is S3TC compressed, this WebGL implementation must support the WEBGL_compressed_texture_s3tc extension. Check context.s3tc.");if(h.Z.isPVRTCFormat(Z)&&!i.pvrtc)throw new c.Z("When options.pixelFormat is PVRTC compressed, this WebGL implementation must support the WEBGL_compressed_texture_pvrtc extension. Check context.pvrtc.");if(h.Z.isASTCFormat(Z)&&!i.astc)throw new c.Z("When options.pixelFormat is ASTC compressed, this WebGL implementation must support the WEBGL_compressed_texture_astc extension. Check context.astc.");if(h.Z.isETC2Format(Z)&&!i.etc)throw new c.Z("When options.pixelFormat is ETC2 compressed, this WebGL implementation must support the WEBGL_compressed_texture_etc extension. Check context.etc.");else if(h.Z.isETC1Format(Z)&&!i.etc1)throw new c.Z("When options.pixelFormat is ETC1 compressed, this WebGL implementation must support the WEBGL_compressed_texture_etc1 extension. Check context.etc1.");else if(h.Z.isBC7Format(Z)&&!i.bc7)throw new c.Z("When options.pixelFormat is BC7 compressed, this WebGL implementation must support the EXT_texture_compression_bptc extension. Check context.bc7.");if(h.Z.compressedTextureSizeInBytes(Z,l,u)!==f.arrayBufferView.byteLength)throw new c.Z("The byte length of the array buffer is invalid for the compressed texture with the given width and height.")}let b=e.preMultiplyAlpha||_===h.Z.RGB||_===h.Z.LUMINANCE,v=(0,a.Z)(e.flipY,!0),T=(0,a.Z)(e.skipColorSpaceConversion,!1),E=!0,x=i._gl,w=x.TEXTURE_2D,S=x.createTexture();x.activeTexture(x.TEXTURE0),x.bindTexture(w,S);let C=4;if((0,s.Z)(f)&&(0,s.Z)(f.arrayBufferView)&&!y&&(C=h.Z.alignmentInBytes(_,g,l)),x.pixelStorei(x.UNPACK_ALIGNMENT,C),T?x.pixelStorei(x.UNPACK_COLORSPACE_CONVERSION_WEBGL,x.NONE):x.pixelStorei(x.UNPACK_COLORSPACE_CONVERSION_WEBGL,x.BROWSER_DEFAULT_WEBGL),(0,s.Z)(f)){if((0,s.Z)(f.arrayBufferView)){let e,t,n;x.pixelStorei(x.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),x.pixelStorei(x.UNPACK_FLIP_Y_WEBGL,!1);let r=f.arrayBufferView;if(y){if(x.compressedTexImage2D(w,0,Z,l,u,0,r),(0,s.Z)(f.mipLevels))for(e=0,t=l,n=u;e<f.mipLevels.length;++e)(t=0|Math.floor(t/2))<1&&(t=1),(n=0|Math.floor(n/2))<1&&(n=1),x.compressedTexImage2D(w,e+1,Z,t,n,0,f.mipLevels[e])}else if(v&&(r=h.Z.flipY(r,_,g,l,u)),x.texImage2D(w,0,Z,l,u,0,_,p.Z.toWebGLConstant(g,i),r),(0,s.Z)(f.mipLevels))for(e=0,t=l,n=u;e<f.mipLevels.length;++e)(t=0|Math.floor(t/2))<1&&(t=1),(n=0|Math.floor(n/2))<1&&(n=1),x.texImage2D(w,e+1,Z,t,n,0,_,p.Z.toWebGLConstant(g,i),f.mipLevels[e])}else(0,s.Z)(f.framebuffer)?(x.pixelStorei(x.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),x.pixelStorei(x.UNPACK_FLIP_Y_WEBGL,!1),f.framebuffer!==i.defaultFramebuffer&&f.framebuffer._bind(),x.copyTexImage2D(w,0,Z,f.xOffset,f.yOffset,l,u,0),f.framebuffer!==i.defaultFramebuffer&&f.framebuffer._unBind()):(x.pixelStorei(x.UNPACK_PREMULTIPLY_ALPHA_WEBGL,b),x.pixelStorei(x.UNPACK_FLIP_Y_WEBGL,v),x.texImage2D(w,0,Z,_,p.Z.toWebGLConstant(g,i),f))}else x.texImage2D(w,0,Z,l,u,0,_,p.Z.toWebGLConstant(g,i),null),E=!1;x.bindTexture(w,null),t=y?h.Z.compressedTextureSizeInBytes(_,l,u):h.Z.textureSizeInBytes(_,g,l,u),this._id=(0,o.Z)(),this._context=i,this._textureFilterAnisotropic=i._textureFilterAnisotropic,this._textureTarget=w,this._texture=S,this._internalFormat=Z,this._pixelFormat=_,this._pixelDatatype=g,this._width=l,this._height=u,this._dimensions=new n.Z(l,u),this._hasMipmap=!1,this._sizeInBytes=t,this._preMultiplyAlpha=b,this._flipY=v,this._initialized=E,this._sampler=void 0,this.sampler=(0,s.Z)(e.sampler)?e.sampler:new m.Z}Z.create=function(e){return new Z(e)},Z.fromFramebuffer=function(e){e=(0,a.Z)(e,a.Z.EMPTY_OBJECT),r.Z.defined("options.context",e.context);let t=e.context,i=t._gl,n=(0,a.Z)(e.pixelFormat,h.Z.RGB),o=(0,a.Z)(e.framebufferXOffset,0),l=(0,a.Z)(e.framebufferYOffset,0),u=(0,a.Z)(e.width,i.drawingBufferWidth),d=(0,a.Z)(e.height,i.drawingBufferHeight),f=e.framebuffer;if(!h.Z.validate(n))throw new c.Z("Invalid pixelFormat.");if(h.Z.isDepthFormat(n)||h.Z.isCompressedFormat(n))throw new c.Z("pixelFormat cannot be DEPTH_COMPONENT, DEPTH_STENCIL or a compressed format.");if(r.Z.defined("options.context",e.context),r.Z.typeOf.number.greaterThanOrEquals("framebufferXOffset",o,0),r.Z.typeOf.number.greaterThanOrEquals("framebufferYOffset",l,0),o+u>i.drawingBufferWidth)throw new c.Z("framebufferXOffset + width must be less than or equal to drawingBufferWidth");if(l+d>i.drawingBufferHeight)throw new c.Z("framebufferYOffset + height must be less than or equal to drawingBufferHeight.");return new Z({context:t,width:u,height:d,pixelFormat:n,source:{framebuffer:(0,s.Z)(f)?f:t.defaultFramebuffer,xOffset:o,yOffset:l,width:u,height:d}})},Object.defineProperties(Z.prototype,{id:{get:function(){return this._id}},sampler:{get:function(){return this._sampler},set:function(e){let t=e.minificationFilter,i=e.magnificationFilter,n=this._context,r=this._pixelFormat,o=this._pixelDatatype,a=t===g.Z.NEAREST_MIPMAP_NEAREST||t===g.Z.NEAREST_MIPMAP_LINEAR||t===g.Z.LINEAR_MIPMAP_NEAREST||t===g.Z.LINEAR_MIPMAP_LINEAR;(o!==p.Z.FLOAT||n.textureFloatLinear)&&(o!==p.Z.HALF_FLOAT||n.textureHalfFloatLinear)||(t=a?g.Z.NEAREST_MIPMAP_NEAREST:g.Z.NEAREST,i=_.Z.NEAREST),n.webgl2&&h.Z.isDepthFormat(r)&&(t=g.Z.NEAREST,i=_.Z.NEAREST);let l=n._gl,c=this._textureTarget;l.activeTexture(l.TEXTURE0),l.bindTexture(c,this._texture),l.texParameteri(c,l.TEXTURE_MIN_FILTER,t),l.texParameteri(c,l.TEXTURE_MAG_FILTER,i),l.texParameteri(c,l.TEXTURE_WRAP_S,e.wrapS),l.texParameteri(c,l.TEXTURE_WRAP_T,e.wrapT),(0,s.Z)(this._textureFilterAnisotropic)&&l.texParameteri(c,this._textureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,e.maximumAnisotropy),l.bindTexture(c,null),this._sampler=e}},pixelFormat:{get:function(){return this._pixelFormat}},pixelDatatype:{get:function(){return this._pixelDatatype}},dimensions:{get:function(){return this._dimensions}},preMultiplyAlpha:{get:function(){return this._preMultiplyAlpha}},flipY:{get:function(){return this._flipY}},width:{get:function(){return this._width}},height:{get:function(){return this._height}},sizeInBytes:{get:function(){return this._hasMipmap?Math.floor(4*this._sizeInBytes/3):this._sizeInBytes}},_target:{get:function(){return this._textureTarget}}}),Z.prototype.copyFrom=function(e){r.Z.defined("options",e);let t=(0,a.Z)(e.xOffset,0),i=(0,a.Z)(e.yOffset,0);if(r.Z.defined("options.source",e.source),h.Z.isDepthFormat(this._pixelFormat))throw new c.Z("Cannot call copyFrom when the texture pixel format is DEPTH_COMPONENT or DEPTH_STENCIL.");if(h.Z.isCompressedFormat(this._pixelFormat))throw new c.Z("Cannot call copyFrom with a compressed texture pixel format.");r.Z.typeOf.number.greaterThanOrEquals("xOffset",t,0),r.Z.typeOf.number.greaterThanOrEquals("yOffset",i,0),r.Z.typeOf.number.lessThanOrEquals("xOffset + options.source.width",t+e.source.width,this._width),r.Z.typeOf.number.lessThanOrEquals("yOffset + options.source.height",i+e.source.height,this._height);let n=e.source,o=this._context,l=o._gl,u=this._textureTarget;l.activeTexture(l.TEXTURE0),l.bindTexture(u,this._texture);let d=n.width,f=n.height,m=n.arrayBufferView,_=this._width,g=this._height,Z=this._internalFormat,y=this._pixelFormat,b=this._pixelDatatype,v=this._preMultiplyAlpha,T=this._flipY,E=(0,a.Z)(e.skipColorSpaceConversion,!1),x=4;(0,s.Z)(m)&&(x=h.Z.alignmentInBytes(y,b,d)),l.pixelStorei(l.UNPACK_ALIGNMENT,x),E?l.pixelStorei(l.UNPACK_COLORSPACE_CONVERSION_WEBGL,l.NONE):l.pixelStorei(l.UNPACK_COLORSPACE_CONVERSION_WEBGL,l.BROWSER_DEFAULT_WEBGL);let w=!1;if(!this._initialized){if(0===t&&0===i&&d===_&&f===g)(0,s.Z)(m)?(l.pixelStorei(l.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),l.pixelStorei(l.UNPACK_FLIP_Y_WEBGL,!1),T&&(m=h.Z.flipY(m,y,b,_,g)),l.texImage2D(u,0,Z,_,g,0,y,p.Z.toWebGLConstant(b,o),m)):(l.pixelStorei(l.UNPACK_PREMULTIPLY_ALPHA_WEBGL,v),l.pixelStorei(l.UNPACK_FLIP_Y_WEBGL,T),l.texImage2D(u,0,Z,y,p.Z.toWebGLConstant(b,o),n)),w=!0;else{l.pixelStorei(l.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),l.pixelStorei(l.UNPACK_FLIP_Y_WEBGL,!1);let e=h.Z.createTypedArray(y,b,_,g);l.texImage2D(u,0,Z,_,g,0,y,p.Z.toWebGLConstant(b,o),e)}this._initialized=!0}w||((0,s.Z)(m)?(l.pixelStorei(l.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),l.pixelStorei(l.UNPACK_FLIP_Y_WEBGL,!1),T&&(m=h.Z.flipY(m,y,b,d,f)),l.texSubImage2D(u,0,t,i,d,f,y,p.Z.toWebGLConstant(b,o),m)):(l.pixelStorei(l.UNPACK_PREMULTIPLY_ALPHA_WEBGL,v),l.pixelStorei(l.UNPACK_FLIP_Y_WEBGL,T),l.texSubImage2D(u,0,t,i,y,p.Z.toWebGLConstant(b,o),n))),l.bindTexture(u,null)},Z.prototype.copyFromFramebuffer=function(e,t,i,n,o,s){if(e=(0,a.Z)(e,0),t=(0,a.Z)(t,0),i=(0,a.Z)(i,0),n=(0,a.Z)(n,0),o=(0,a.Z)(o,this._width),s=(0,a.Z)(s,this._height),h.Z.isDepthFormat(this._pixelFormat))throw new c.Z("Cannot call copyFromFramebuffer when the texture pixel format is DEPTH_COMPONENT or DEPTH_STENCIL.");if(this._pixelDatatype===p.Z.FLOAT)throw new c.Z("Cannot call copyFromFramebuffer when the texture pixel data type is FLOAT.");if(this._pixelDatatype===p.Z.HALF_FLOAT)throw new c.Z("Cannot call copyFromFramebuffer when the texture pixel data type is HALF_FLOAT.");if(h.Z.isCompressedFormat(this._pixelFormat))throw new c.Z("Cannot call copyFrom with a compressed texture pixel format.");r.Z.typeOf.number.greaterThanOrEquals("xOffset",e,0),r.Z.typeOf.number.greaterThanOrEquals("yOffset",t,0),r.Z.typeOf.number.greaterThanOrEquals("framebufferXOffset",i,0),r.Z.typeOf.number.greaterThanOrEquals("framebufferYOffset",n,0),r.Z.typeOf.number.lessThanOrEquals("xOffset + width",e+o,this._width),r.Z.typeOf.number.lessThanOrEquals("yOffset + height",t+s,this._height);let l=this._context._gl,u=this._textureTarget;l.activeTexture(l.TEXTURE0),l.bindTexture(u,this._texture),l.copyTexSubImage2D(u,0,e,t,i,n,o,s),l.bindTexture(u,null),this._initialized=!0},Z.prototype.generateMipmap=function(e){if(e=(0,a.Z)(e,f.Z.DONT_CARE),h.Z.isDepthFormat(this._pixelFormat))throw new c.Z("Cannot call generateMipmap when the texture pixel format is DEPTH_COMPONENT or DEPTH_STENCIL.");if(h.Z.isCompressedFormat(this._pixelFormat))throw new c.Z("Cannot call generateMipmap with a compressed pixel format.");if(!this._context.webgl2){if(this._width>1&&!u.Z.isPowerOfTwo(this._width))throw new c.Z("width must be a power of two to call generateMipmap() in a WebGL1 context.");if(this._height>1&&!u.Z.isPowerOfTwo(this._height))throw new c.Z("height must be a power of two to call generateMipmap() in a WebGL1 context.")}if(!f.Z.validate(e))throw new c.Z("hint is invalid.");this._hasMipmap=!0;let t=this._context._gl,i=this._textureTarget;t.hint(t.GENERATE_MIPMAP_HINT,e),t.activeTexture(t.TEXTURE0),t.bindTexture(i,this._texture),t.generateMipmap(i),t.bindTexture(i,null)},Z.prototype.isDestroyed=function(){return!1},Z.prototype.destroy=function(){return this._context._gl.deleteTexture(this._texture),(0,l.Z)(this)},t.Z=Z},5874:function(e,t,i){"use strict";var n=i(512);let r={NEAREST:n.Z.NEAREST,LINEAR:n.Z.LINEAR};r.validate=function(e){return e===r.NEAREST||e===r.LINEAR},t.Z=Object.freeze(r)},9138:function(e,t,i){"use strict";var n=i(512);let r={NEAREST:n.Z.NEAREST,LINEAR:n.Z.LINEAR,NEAREST_MIPMAP_NEAREST:n.Z.NEAREST_MIPMAP_NEAREST,LINEAR_MIPMAP_NEAREST:n.Z.LINEAR_MIPMAP_NEAREST,NEAREST_MIPMAP_LINEAR:n.Z.NEAREST_MIPMAP_LINEAR,LINEAR_MIPMAP_LINEAR:n.Z.LINEAR_MIPMAP_LINEAR};r.validate=function(e){return e===r.NEAREST||e===r.LINEAR||e===r.NEAREST_MIPMAP_NEAREST||e===r.LINEAR_MIPMAP_NEAREST||e===r.NEAREST_MIPMAP_LINEAR||e===r.LINEAR_MIPMAP_LINEAR},t.Z=Object.freeze(r)},9053:function(e,t,i){"use strict";var n=i(512);let r={CLAMP_TO_EDGE:n.Z.CLAMP_TO_EDGE,REPEAT:n.Z.REPEAT,MIRRORED_REPEAT:n.Z.MIRRORED_REPEAT,validate:function(e){return e===r.CLAMP_TO_EDGE||e===r.REPEAT||e===r.MIRRORED_REPEAT}};t.Z=Object.freeze(r)},6450:function(e,t,i){"use strict";var n=i(698),r=i(7559),o=i(4572),a=i(9410),s=i(7998),l=i(9824),c=i(3086),u=i(5837),h=i(2150),d=i(87),f=i(9780),p=i(2598),m=i(4318);function _(e,t,i){for(let i=0;i<t.length;++i){let n=t[i];n.enabled&&n.vertexAttrib(e)}(0,a.Z)(i)&&e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,i._getBuffer())}function g(e){let t,i;e=(0,o.Z)(e,o.Z.EMPTY_OBJECT),n.Z.defined("options.context",e.context),n.Z.defined("options.attributes",e.attributes);let s=e.context,c=s._gl,u=e.attributes,h=e.indexBuffer,d=[],f=1,p=!1,m=!1,g=u.length;for(t=0;t<g;++t)!function(e,t,i,n){let s=(0,a.Z)(t.vertexBuffer),c=(0,a.Z)(t.value),u=t.value?t.value.length:t.componentsPerAttribute;if(!s&&!c)throw new l.Z("attribute must have a vertexBuffer or a value.");if(s&&c)throw new l.Z("attribute cannot have both a vertexBuffer and a value. It must have either a vertexBuffer property defining per-vertex data or a value property defining data for all vertices.");if(1!==u&&2!==u&&3!==u&&4!==u){if(c)throw new l.Z("attribute.value.length must be in the range [1, 4].");throw new l.Z("attribute.componentsPerAttribute must be in the range [1, 4].")}if((0,a.Z)(t.componentDatatype)&&!r.Z.validate(t.componentDatatype))throw new l.Z("attribute must have a valid componentDatatype or not specify it.");if((0,a.Z)(t.strideInBytes)&&t.strideInBytes>255)throw new l.Z("attribute must have a strideInBytes less than or equal to 255 or not specify it.");if((0,a.Z)(t.instanceDivisor)&&t.instanceDivisor>0&&!n.instancedArrays)throw new l.Z("instanced arrays is not supported");if((0,a.Z)(t.instanceDivisor)&&t.instanceDivisor<0)throw new l.Z("attribute must have an instanceDivisor greater than or equal to zero");if((0,a.Z)(t.instanceDivisor)&&c)throw new l.Z("attribute cannot have have an instanceDivisor if it is not backed by a buffer");if((0,a.Z)(t.instanceDivisor)&&t.instanceDivisor>0&&0===t.index)throw new l.Z("attribute zero cannot have an instanceDivisor greater than 0");let h={index:(0,o.Z)(t.index,i),enabled:(0,o.Z)(t.enabled,!0),vertexBuffer:t.vertexBuffer,value:c?t.value.slice(0):void 0,componentsPerAttribute:u,componentDatatype:(0,o.Z)(t.componentDatatype,r.Z.FLOAT),normalize:(0,o.Z)(t.normalize,!1),offsetInBytes:(0,o.Z)(t.offsetInBytes,0),strideInBytes:(0,o.Z)(t.strideInBytes,0),instanceDivisor:(0,o.Z)(t.instanceDivisor,0)};if(s)h.vertexAttrib=function(e){let t=this.index;e.bindBuffer(e.ARRAY_BUFFER,this.vertexBuffer._getBuffer()),e.vertexAttribPointer(t,this.componentsPerAttribute,this.componentDatatype,this.normalize,this.strideInBytes,this.offsetInBytes),e.enableVertexAttribArray(t),this.instanceDivisor>0&&(n.glVertexAttribDivisor(t,this.instanceDivisor),n._vertexAttribDivisors[t]=this.instanceDivisor,n._previousDrawInstanced=!0)},h.disableVertexAttribArray=function(e){e.disableVertexAttribArray(this.index),this.instanceDivisor>0&&n.glVertexAttribDivisor(i,0)};else{switch(h.componentsPerAttribute){case 1:h.vertexAttrib=function(e){e.vertexAttrib1fv(this.index,this.value)};break;case 2:h.vertexAttrib=function(e){e.vertexAttrib2fv(this.index,this.value)};break;case 3:h.vertexAttrib=function(e){e.vertexAttrib3fv(this.index,this.value)};break;case 4:h.vertexAttrib=function(e){e.vertexAttrib4fv(this.index,this.value)}}h.disableVertexAttribArray=function(e){}}e.push(h)}(d,u[t],t,s);for(t=0,g=d.length;t<g;++t){let e=d[t];if((0,a.Z)(e.vertexBuffer)&&0===e.instanceDivisor){let t=e.strideInBytes||e.componentsPerAttribute*r.Z.getSizeInBytes(e.componentDatatype);f=e.vertexBuffer.sizeInBytes/t;break}}for(t=0;t<g;++t)d[t].instanceDivisor>0&&(p=!0),(0,a.Z)(d[t].value)&&(m=!0);let Z={};for(t=0;t<g;++t){let e=d[t].index;if(Z[e])throw new l.Z(`Index ${e} is used by more than one attribute.`);Z[e]=!0}s.vertexArrayObject&&(i=s.glCreateVertexArray(),s.glBindVertexArray(i),_(c,d,h),s.glBindVertexArray(null)),this._numberOfVertices=f,this._hasInstancedAttributes=p,this._hasConstantAttributes=m,this._context=s,this._gl=c,this._vao=i,this._attributes=d,this._indexBuffer=h}function Z(e){return e.values.length/e.componentsPerAttribute}g.fromGeometry=function(e){let t,i,s,l;e=(0,o.Z)(e,o.Z.EMPTY_OBJECT),n.Z.defined("options.context",e.context);let m=e.context,_=(0,o.Z)(e.geometry,o.Z.EMPTY_OBJECT),y=(0,o.Z)(e.bufferUsage,p.Z.DYNAMIC_DRAW),b=(0,o.Z)(e.attributeLocations,o.Z.EMPTY_OBJECT),v=(0,o.Z)(e.interleave,!1),T=e.vertexArrayAttributes,E=(0,a.Z)(T)?T:[],x=_.attributes;if(v){let e=function(e){let t,i,n,o;let s=[];for(i in e)e.hasOwnProperty(i)&&(0,a.Z)(e[i])&&(0,a.Z)(e[i].values)&&(s.push(i),e[i].componentDatatype===r.Z.DOUBLE&&(e[i].componentDatatype=r.Z.FLOAT,e[i].values=r.Z.createTypedArray(r.Z.FLOAT,e[i].values)));let l=s.length;if(l>0)for(t=1,o=Z(e[s[0]]);t<l;++t){let i=Z(e[s[t]]);if(i!==o)throw new d.Z(`Each attribute list must have the same number of vertices. Attribute ${s[t]} has a different number of vertices (${i.toString()}) than attribute ${s[0]} (${o.toString()}).`)}s.sort(function(t,i){return r.Z.getSizeInBytes(e[i].componentDatatype)-r.Z.getSizeInBytes(e[t].componentDatatype)});let c=0,u={};for(t=0;t<l;++t){var h;n=e[i=s[t]],u[i]=c,c+=(h=n,r.Z.getSizeInBytes(h.componentDatatype)*h.componentsPerAttribute)}if(c>0){let a=r.Z.getSizeInBytes(e[s[0]].componentDatatype),h=c%a;0!==h&&(c+=a-h);let d=new ArrayBuffer(o*c),f={};for(t=0;t<l;++t){i=s[t];let n=r.Z.getSizeInBytes(e[i].componentDatatype);f[i]={pointer:r.Z.createTypedArray(e[i].componentDatatype,d),index:u[i]/n,strideInComponentType:c/n}}for(t=0;t<o;++t)for(let r=0;r<l;++r){let o=(n=e[i=s[r]]).values,a=f[i],l=a.pointer,c=n.componentsPerAttribute;for(let e=0;e<c;++e)l[a.index+e]=o[t*c+e];a.index+=a.strideInComponentType}return{buffer:d,offsetsInBytes:u,vertexSizeInBytes:c}}}(x);if((0,a.Z)(e)){s=f.Z.createVertexBuffer({context:m,typedArray:e.buffer,usage:y});let n=e.offsetsInBytes,r=e.vertexSizeInBytes;for(t in x)x.hasOwnProperty(t)&&(0,a.Z)(x[t])&&(i=x[t],(0,a.Z)(i.values)?E.push({index:b[t],vertexBuffer:s,componentDatatype:i.componentDatatype,componentsPerAttribute:i.componentsPerAttribute,normalize:i.normalize,offsetInBytes:n[t],strideInBytes:r}):E.push({index:b[t],value:i.value,componentDatatype:i.componentDatatype,normalize:i.normalize}))}}else for(t in x)if(x.hasOwnProperty(t)&&(0,a.Z)(x[t])){let e=(i=x[t]).componentDatatype;e===r.Z.DOUBLE&&(e=r.Z.FLOAT),s=void 0,(0,a.Z)(i.values)&&(s=f.Z.createVertexBuffer({context:m,typedArray:r.Z.createTypedArray(e,i.values),usage:y})),E.push({index:b[t],vertexBuffer:s,value:i.value,componentDatatype:e,componentsPerAttribute:i.componentsPerAttribute,normalize:i.normalize})}let w=_.indices;return(0,a.Z)(w)&&(l=c.Z.computeNumberOfVertices(_)>=h.Z.SIXTY_FOUR_KILOBYTES&&m.elementIndexUint?f.Z.createIndexBuffer({context:m,typedArray:new Uint32Array(w),usage:y,indexDatatype:u.Z.UNSIGNED_INT}):f.Z.createIndexBuffer({context:m,typedArray:new Uint16Array(w),usage:y,indexDatatype:u.Z.UNSIGNED_SHORT})),new g({context:m,attributes:E,indexBuffer:l})},Object.defineProperties(g.prototype,{numberOfAttributes:{get:function(){return this._attributes.length}},numberOfVertices:{get:function(){return this._numberOfVertices}},indexBuffer:{get:function(){return this._indexBuffer}}}),g.prototype.getAttribute=function(e){return n.Z.defined("index",e),this._attributes[e]},g.prototype._bind=function(){(0,a.Z)(this._vao)?(this._context.glBindVertexArray(this._vao),this._context.instancedArrays&&function(e){let t;let i=e._context,n=e._hasInstancedAttributes;if(!n&&!i._previousDrawInstanced)return;i._previousDrawInstanced=n;let r=i._vertexAttribDivisors,o=e._attributes,a=m.Z.maximumVertexAttributes;if(n){let e=o.length;for(t=0;t<e;++t){let e=o[t];if(e.enabled){let t=e.instanceDivisor,n=e.index;t!==r[n]&&(i.glVertexAttribDivisor(n,t),r[n]=t)}}}else for(t=0;t<a;++t)r[t]>0&&(i.glVertexAttribDivisor(t,0),r[t]=0)}(this),this._hasConstantAttributes&&function(e,t){let i=e._attributes,n=i.length;for(let e=0;e<n;++e){let n=i[e];n.enabled&&(0,a.Z)(n.value)&&n.vertexAttrib(t)}}(this,this._gl)):_(this._gl,this._attributes,this._indexBuffer)},g.prototype._unBind=function(){if((0,a.Z)(this._vao))this._context.glBindVertexArray(null);else{let e=this._attributes,t=this._gl;for(let i=0;i<e.length;++i){let n=e[i];n.enabled&&n.disableVertexAttribArray(t)}this._indexBuffer&&t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,null)}},g.prototype.isDestroyed=function(){return!1},g.prototype.destroy=function(){let e=this._attributes;for(let t=0;t<e.length;++t){let i=e[t].vertexBuffer;(0,a.Z)(i)&&!i.isDestroyed()&&i.vertexArrayDestroyable&&i.destroy()}let t=this._indexBuffer;return(0,a.Z)(t)&&!t.isDestroyed()&&t.vertexArrayDestroyable&&t.destroy(),(0,a.Z)(this._vao)&&this._context.glDeleteVertexArray(this._vao),(0,s.Z)(this)},t.Z=g},7761:function(e,t,i){"use strict";var n=i(49),r=i(2115),o=i(4572),a=i(9410),s=i(1205),l=i(7048);function c(e){e=(0,o.Z)(e,o.Z.EMPTY_OBJECT),this.material=e.material,this.translucent=(0,o.Z)(e.translucent,!0),this._vertexShaderSource=e.vertexShaderSource,this._fragmentShaderSource=e.fragmentShaderSource,this._renderState=e.renderState,this._closed=(0,o.Z)(e.closed,!1)}Object.defineProperties(c.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}}}),c.prototype.getFragmentShaderSource=function(){let e=[];return this.flat&&e.push("#define FLAT"),this.faceForward&&e.push("#define FACE_FORWARD"),(0,a.Z)(this.material)&&e.push(this.material.shaderSource),e.push(this.fragmentShaderSource),e.join("\n")},c.prototype.isTranslucent=function(){return(0,a.Z)(this.material)&&this.material.isTranslucent()||!(0,a.Z)(this.material)&&this.translucent},c.prototype.getRenderState=function(){let e=this.isTranslucent(),t=(0,n.Z)(this.renderState,!1);return e?(t.depthMask=!1,t.blending=s.Z.ALPHA_BLEND):t.depthMask=!0,t},c.getDefaultRenderState=function(e,t,i){let n={depthTest:{enabled:!0}};return e&&(n.depthMask=!1,n.blending=s.Z.ALPHA_BLEND),t&&(n.cull={enabled:!0,face:l.Z.BACK}),(0,a.Z)(i)&&(n=(0,r.Z)(i,n,!0)),n},t.Z=c},1705:function(e,t,i){"use strict";var n=i(570),r=i(1486),o=i(3065),a=i(698),s=i(9824),l=i(3037),c=i(3186),u=i(4749);let h={SCALAR:"SCALAR",VEC2:"VEC2",VEC3:"VEC3",VEC4:"VEC4",MAT2:"MAT2",MAT3:"MAT3",MAT4:"MAT4"};h.getMathType=function(e){switch(e){case h.SCALAR:return Number;case h.VEC2:return n.Z;case h.VEC3:return r.Z;case h.VEC4:return o.Z;case h.MAT2:return l.Z;case h.MAT3:return c.Z;case h.MAT4:return u.Z;default:throw new s.Z("attributeType is not a valid value.")}},h.getNumberOfComponents=function(e){switch(e){case h.SCALAR:return 1;case h.VEC2:return 2;case h.VEC3:return 3;case h.VEC4:case h.MAT2:return 4;case h.MAT3:return 9;case h.MAT4:return 16;default:throw new s.Z("attributeType is not a valid value.")}},h.getAttributeLocationCount=function(e){switch(e){case h.SCALAR:case h.VEC2:case h.VEC3:case h.VEC4:return 1;case h.MAT2:return 2;case h.MAT3:return 3;case h.MAT4:return 4;default:throw new s.Z("attributeType is not a valid value.")}},h.getGlslType=function(e){switch(a.Z.typeOf.string("attributeType",e),e){case h.SCALAR:return"float";case h.VEC2:return"vec2";case h.VEC3:return"vec3";case h.VEC4:return"vec4";case h.MAT2:return"mat2";case h.MAT3:return"mat3";case h.MAT4:return"mat4";default:throw new s.Z("attributeType is not a valid value.")}},t.Z=Object.freeze(h)},996:function(e,t,i){"use strict";var n=i(698),r=i(3186),o=i(4749);let a={X:0,Y:1,Z:2};a.Y_UP_TO_Z_UP=o.Z.fromRotationTranslation(r.Z.fromArray([1,0,0,0,0,1,0,-1,0])),a.Z_UP_TO_Y_UP=o.Z.fromRotationTranslation(r.Z.fromArray([1,0,0,0,0,-1,0,1,0])),a.X_UP_TO_Z_UP=o.Z.fromRotationTranslation(r.Z.fromArray([0,0,1,0,1,0,-1,0,0])),a.Z_UP_TO_X_UP=o.Z.fromRotationTranslation(r.Z.fromArray([0,0,-1,0,1,0,1,0,0])),a.X_UP_TO_Y_UP=o.Z.fromRotationTranslation(r.Z.fromArray([0,1,0,-1,0,0,0,0,1])),a.Y_UP_TO_X_UP=o.Z.fromRotationTranslation(r.Z.fromArray([0,-1,0,1,0,0,0,0,1])),a.fromName=function(e){return n.Z.typeOf.string("name",e),a[e]},t.Z=Object.freeze(a)},4664:function(e,t,i){"use strict";var n=i(570),r=i(1486),o=i(3065),a=i(2115),s=i(7559),l=i(9410),c=i(7998),u=i(9824),h=i(6055),d=i(4318),f=i(5463),p=i(5483),m=i(4909);function _(e,t,i){if(!(0,l.Z)(e))throw new u.Z("context is required");if(!(0,l.Z)(t))throw new u.Z("attributes is required");if(!(0,l.Z)(i))throw new u.Z("numberOfInstances is required");if(this._attributes=t,this._numberOfInstances=i,0===t.length)return;let r=function(e){let t=!1,i=e.length;for(let n=0;n<i;++n)if(e[n].componentDatatype!==s.Z.UNSIGNED_BYTE){t=!0;break}return t?f.Z.FLOAT:f.Z.UNSIGNED_BYTE}(t),a=e.floatingPointTexture,c=r===f.Z.FLOAT&&!a,h=function(e,t){let i=Array(e.length),n=0,r=e.length;for(let o=0;o<r;++o){let r=e[o].componentDatatype;i[o]=n,r!==s.Z.UNSIGNED_BYTE&&t?n+=4:++n}return i}(t,c),p=function(e,t,i){let n=e.length,r=e[n-1];return t[n-1].componentDatatype!==s.Z.UNSIGNED_BYTE&&i?r+4:r+1}(h,t,c),m=Math.min(i,Math.floor(d.Z.maximumTextureSize/p)),_=p*m,g=Math.ceil(i/m),Z=1/_,y=1/g;this._textureDimensions=new n.Z(_,g),this._textureStep=new o.Z(Z,.5*Z,y,.5*y),this._pixelDatatype=c?f.Z.UNSIGNED_BYTE:r,this._packFloats=c,this._offsets=h,this._stride=p,this._texture=void 0;let b=4*_*g;this._batchValues=r!==f.Z.FLOAT||c?new Uint8Array(b):new Float32Array(b),this._batchValuesDirty=!1}function g(e,t){let i=e[t].componentsPerAttribute;return 2===i?n.Z:3===i?r.Z:4===i?o.Z:Number}Object.defineProperties(_.prototype,{attributes:{get:function(){return this._attributes}},numberOfInstances:{get:function(){return this._numberOfInstances}}});let Z=new o.Z,y=new o.Z;_.prototype.getBatchedAttribute=function(e,t,i){let n;if(e<0||e>=this._numberOfInstances)throw new u.Z("instanceIndex is out of range.");if(t<0||t>=this._attributes.length)throw new u.Z("attributeIndex is out of range");let r=this._attributes,a=this._offsets[t],s=4*this._stride*e+4*a;n=this._packFloats&&r[t].componentDatatype!==f.Z.UNSIGNED_BYTE?function(e,t,i){let n=o.Z.unpack(e,t,Z),r=o.Z.unpackFloat(n);n=o.Z.unpack(e,t+4,Z);let a=o.Z.unpackFloat(n);n=o.Z.unpack(e,t+8,Z);let s=o.Z.unpackFloat(n);n=o.Z.unpack(e,t+12,Z);let l=o.Z.unpackFloat(n);return o.Z.fromElements(r,a,s,l,i)}(this._batchValues,s,y):o.Z.unpack(this._batchValues,s,y);let c=g(r,t);return(0,l.Z)(c.fromCartesian4)?c.fromCartesian4(n,i):(0,l.Z)(c.clone)?c.clone(n,i):n.x};let b=[void 0,void 0,new n.Z,new r.Z,new o.Z],v=new o.Z;_.prototype.setBatchedAttribute=function(e,t,i){if(e<0||e>=this._numberOfInstances)throw new u.Z("instanceIndex is out of range.");if(t<0||t>=this._attributes.length)throw new u.Z("attributeIndex is out of range");if(!(0,l.Z)(i))throw new u.Z("value is required.");let n=this._attributes,r=b[n[t].componentsPerAttribute],a=this.getBatchedAttribute(e,t,r),s=g(this._attributes,t);if((0,l.Z)(s.equals)?s.equals(a,i):a===i)return;v.x=(0,l.Z)(i.x)?i.x:i,v.y=(0,l.Z)(i.y)?i.y:0,v.z=(0,l.Z)(i.z)?i.z:0,v.w=(0,l.Z)(i.w)?i.w:0;let c=this._offsets[t],h=4*this._stride*e+4*c;if(this._packFloats&&n[t].componentDatatype!==f.Z.UNSIGNED_BYTE){var d;let e;d=this._batchValues,e=o.Z.packFloat(v.x,Z),o.Z.pack(e,d,h),e=o.Z.packFloat(v.y,e),o.Z.pack(e,d,h+4),e=o.Z.packFloat(v.z,e),o.Z.pack(e,d,h+8),e=o.Z.packFloat(v.w,e),o.Z.pack(e,d,h+12)}else o.Z.pack(v,this._batchValues,h);this._batchValuesDirty=!0},_.prototype.update=function(e){(!(0,l.Z)(this._texture)||this._batchValuesDirty)&&0!==this._attributes.length&&(this._batchValuesDirty=!1,(0,l.Z)(this._texture)||function(e,t){let i=e._textureDimensions;e._texture=new m.Z({context:t,pixelFormat:h.Z.RGBA,pixelDatatype:e._pixelDatatype,width:i.x,height:i.y,sampler:p.Z.NEAREST,flipY:!1})}(this,e.context),function(e){let t=e._textureDimensions;e._texture.copyFrom({source:{width:t.x,height:t.y,arrayBufferView:e._batchValues}})}(this))},_.prototype.getUniformMapCallback=function(){let e=this;return function(t){return 0===e._attributes.length?t:(0,a.Z)(t,{batchTexture:function(){return e._texture},batchTextureDimensions:function(){return e._textureDimensions},batchTextureStep:function(){return e._textureStep}})}},_.prototype.getVertexShaderCallback=function(){let e=this._attributes;if(0===e.length)return function(e){return e};let t="uniform highp sampler2D batchTexture; \n";t+=`${function(e){let t=e._stride;return 1===e._textureDimensions.y?`uniform vec4 batchTextureStep; vec2 computeSt(float batchId) { float stepX = batchTextureStep.x; float centerX = batchTextureStep.y; float numberOfAttributes = float(${t}); return vec2(centerX + (batchId * numberOfAttributes * stepX), 0.5); } `:`uniform vec4 batchTextureStep; uniform vec2 batchTextureDimensions; vec2 computeSt(float batchId) { float stepX = batchTextureStep.x; float centerX = batchTextureStep.y; float stepY = batchTextureStep.z; float centerY = batchTextureStep.w; float numberOfAttributes = float(${t}); float xId = mod(batchId * numberOfAttributes, batchTextureDimensions.x); float yId = floor(batchId * numberOfAttributes / batchTextureDimensions.x); return vec2(centerX + (xId * stepX), centerY + (yId * stepY)); } `}(this)} `;let i=e.length;for(let e=0;e<i;++e)t+=function(e,t){let i=e._attributes[t],n=i.componentsPerAttribute,r=i.functionName,o=1===n?"float":`vec${n}`,a=1===n?".x":2===n?".xy":3===n?".xyz":"",l=e._offsets[t],c=`${o} ${r}(float batchId) { vec2 st = computeSt(batchId); st.x += batchTextureStep.x * float(${l}); `;return e._packFloats&&i.componentDatatype!==f.Z.UNSIGNED_BYTE?c+="vec4 textureValue; \ntextureValue.x = czm_unpackFloat(texture(batchTexture, st)); \ntextureValue.y = czm_unpackFloat(texture(batchTexture, st + vec2(batchTextureStep.x, 0.0))); \ntextureValue.z = czm_unpackFloat(texture(batchTexture, st + vec2(batchTextureStep.x * 2.0, 0.0))); \ntextureValue.w = czm_unpackFloat(texture(batchTexture, st + vec2(batchTextureStep.x * 3.0, 0.0))); \n":c+=" vec4 textureValue = texture(batchTexture, st); \n",c+=` ${o} value = textureValue${a}; `,e._pixelDatatype!==f.Z.UNSIGNED_BYTE||i.componentDatatype!==s.Z.UNSIGNED_BYTE||i.normalize?e._pixelDatatype===f.Z.FLOAT&&i.componentDatatype===s.Z.UNSIGNED_BYTE&&i.normalize&&(c+="value /= 255.0; \n"):c+="value *= 255.0; \n",c+=" return value; \n} \n"}(this,e);return function(e){let i=e.indexOf("void main"),n=e.substring(0,i),r=e.substring(i);return`${n} ${t} ${r}`}},_.prototype.isDestroyed=function(){return!1},_.prototype.destroy=function(){return this._texture=this._texture&&this._texture.destroy(),(0,c.Z)(this)},t.Z=_},2067:function(e,t,i){"use strict";var n=i(512);let r={ADD:n.Z.FUNC_ADD,SUBTRACT:n.Z.FUNC_SUBTRACT,REVERSE_SUBTRACT:n.Z.FUNC_REVERSE_SUBTRACT,MIN:n.Z.MIN,MAX:n.Z.MAX};t.Z=Object.freeze(r)},8133:function(e,t,i){"use strict";var n=i(512);let r={ZERO:n.Z.ZERO,ONE:n.Z.ONE,SOURCE_COLOR:n.Z.SRC_COLOR,ONE_MINUS_SOURCE_COLOR:n.Z.ONE_MINUS_SRC_COLOR,DESTINATION_COLOR:n.Z.DST_COLOR,ONE_MINUS_DESTINATION_COLOR:n.Z.ONE_MINUS_DST_COLOR,SOURCE_ALPHA:n.Z.SRC_ALPHA,ONE_MINUS_SOURCE_ALPHA:n.Z.ONE_MINUS_SRC_ALPHA,DESTINATION_ALPHA:n.Z.DST_ALPHA,ONE_MINUS_DESTINATION_ALPHA:n.Z.ONE_MINUS_DST_ALPHA,CONSTANT_COLOR:n.Z.CONSTANT_COLOR,ONE_MINUS_CONSTANT_COLOR:n.Z.ONE_MINUS_CONSTANT_COLOR,CONSTANT_ALPHA:n.Z.CONSTANT_ALPHA,ONE_MINUS_CONSTANT_ALPHA:n.Z.ONE_MINUS_CONSTANT_ALPHA,SOURCE_ALPHA_SATURATE:n.Z.SRC_ALPHA_SATURATE};t.Z=Object.freeze(r)},1205:function(e,t,i){"use strict";var n=i(2067),r=i(8133);let o={DISABLED:Object.freeze({enabled:!1}),ALPHA_BLEND:Object.freeze({enabled:!0,equationRgb:n.Z.ADD,equationAlpha:n.Z.ADD,functionSourceRgb:r.Z.SOURCE_ALPHA,functionSourceAlpha:r.Z.ONE,functionDestinationRgb:r.Z.ONE_MINUS_SOURCE_ALPHA,functionDestinationAlpha:r.Z.ONE_MINUS_SOURCE_ALPHA}),PRE_MULTIPLIED_ALPHA_BLEND:Object.freeze({enabled:!0,equationRgb:n.Z.ADD,equationAlpha:n.Z.ADD,functionSourceRgb:r.Z.ONE,functionSourceAlpha:r.Z.ONE,functionDestinationRgb:r.Z.ONE_MINUS_SOURCE_ALPHA,functionDestinationAlpha:r.Z.ONE_MINUS_SOURCE_ALPHA}),ADDITIVE_BLEND:Object.freeze({enabled:!0,equationRgb:n.Z.ADD,equationAlpha:n.Z.ADD,functionSourceRgb:r.Z.SOURCE_ALPHA,functionSourceAlpha:r.Z.ONE,functionDestinationRgb:r.Z.ONE,functionDestinationAlpha:r.Z.ONE})};t.Z=Object.freeze(o)},9344:function(e,t,i){"use strict";var n=i(8177),r=i(9410);function o(e,t){this._content=e,this._batchId=t,this._color=void 0}Object.defineProperties(o.prototype,{show:{get:function(){return this._content.batchTable.getShow(this._batchId)},set:function(e){this._content.batchTable.setShow(this._batchId,e)}},color:{get:function(){return(0,r.Z)(this._color)||(this._color=new n.Z),this._content.batchTable.getColor(this._batchId,this._color)},set:function(e){this._content.batchTable.setColor(this._batchId,e)}},polylinePositions:{get:function(){if((0,r.Z)(this._content.getPolylinePositions))return this._content.getPolylinePositions(this._batchId)}},content:{get:function(){return this._content}},tileset:{get:function(){return this._content.tileset}},primitive:{get:function(){return this._content.tileset}},featureId:{get:function(){return this._batchId}},pickId:{get:function(){return this._content.batchTable.getPickColor(this._batchId)}}}),o.prototype.hasProperty=function(e){return this._content.batchTable.hasProperty(this._batchId,e)},o.prototype.getPropertyIds=function(e){return this._content.batchTable.getPropertyIds(this._batchId,e)},o.prototype.getProperty=function(e){return this._content.batchTable.getProperty(this._batchId,e)},o.getPropertyInherited=function(e,t,i){let n;let o=e.batchTable;if((0,r.Z)(o)){if(o.hasPropertyBySemantic(t,i))return o.getPropertyBySemantic(t,i);if(o.hasProperty(t,i))return o.getProperty(t,i)}let a=e.metadata;if((0,r.Z)(a)){if(a.hasPropertyBySemantic(i))return a.getPropertyBySemantic(i);if(a.hasProperty(i))return a.getProperty(i)}let s=e.tile,l=s.metadata;if((0,r.Z)(l)){if(l.hasPropertyBySemantic(i))return l.getPropertyBySemantic(i);if(l.hasProperty(i))return l.getProperty(i)}if((0,r.Z)(s.implicitSubtree)&&(n=s.implicitSubtree.metadata),(0,r.Z)(n)){if(n.hasPropertyBySemantic(i))return n.getPropertyBySemantic(i);if(n.hasProperty(i))return n.getProperty(i)}let c=(0,r.Z)(e.group)?e.group.metadata:void 0;if((0,r.Z)(c)){if(c.hasPropertyBySemantic(i))return c.getPropertyBySemantic(i);if(c.hasProperty(i))return c.getProperty(i)}let u=e.tileset.metadata;if((0,r.Z)(u)){if(u.hasPropertyBySemantic(i))return u.getPropertyBySemantic(i);if(u.hasProperty(i))return u.getProperty(i)}},o.prototype.getPropertyInherited=function(e){return o.getPropertyInherited(this._content,this._batchId,e)},o.prototype.setProperty=function(e,t){this._content.batchTable.setProperty(this._batchId,e,t),this._content.featurePropertiesDirty=!0},o.prototype.isExactClass=function(e){return this._content.batchTable.isExactClass(this._batchId,e)},o.prototype.isClass=function(e){return this._content.batchTable.isClass(this._batchId,e)},o.prototype.getExactClassName=function(){return this._content.batchTable.getExactClassName(this._batchId)},t.Z=o},493:function(e,t){"use strict";let i={RENDER:0,PICK:1,SHADOW:2,PRELOAD:3,PRELOAD_FLIGHT:4,REQUEST_RENDER_MODE_DEFER_CHECK:5,MOST_DETAILED_PRELOAD:6,MOST_DETAILED_PICK:7,NUMBER_OF_PASSES:8},n=Array(i.NUMBER_OF_PASSES);n[i.RENDER]=Object.freeze({pass:i.RENDER,isRender:!0,requestTiles:!0,ignoreCommands:!1}),n[i.PICK]=Object.freeze({pass:i.PICK,isRender:!1,requestTiles:!1,ignoreCommands:!1}),n[i.SHADOW]=Object.freeze({pass:i.SHADOW,isRender:!1,requestTiles:!0,ignoreCommands:!1}),n[i.PRELOAD]=Object.freeze({pass:i.PRELOAD,isRender:!1,requestTiles:!0,ignoreCommands:!0}),n[i.PRELOAD_FLIGHT]=Object.freeze({pass:i.PRELOAD_FLIGHT,isRender:!1,requestTiles:!0,ignoreCommands:!0}),n[i.REQUEST_RENDER_MODE_DEFER_CHECK]=Object.freeze({pass:i.REQUEST_RENDER_MODE_DEFER_CHECK,isRender:!1,requestTiles:!0,ignoreCommands:!0}),n[i.MOST_DETAILED_PRELOAD]=Object.freeze({pass:i.MOST_DETAILED_PRELOAD,isRender:!1,requestTiles:!0,ignoreCommands:!0}),n[i.MOST_DETAILED_PICK]=Object.freeze({pass:i.MOST_DETAILED_PICK,isRender:!1,requestTiles:!1,ignoreCommands:!1}),i.getPassOptions=function(e){return n[e]},t.Z=Object.freeze(i)},5012:function(e,t){"use strict";let i={TERRAIN:0,CESIUM_3D_TILE:1,BOTH:2};i.NUMBER_OF_CLASSIFICATION_TYPES=3,t.Z=Object.freeze(i)},2835:function(e,t,i){"use strict";i.d(t,{Z:function(){return F}});var n=i(6936),r=i(570),o=i(1486),a=i(3065),s=i(698),l=i(8177),c=i(4572),u=i(9410),h=i(7998),d=i(9824),f=i(2198),p=i(487),m=i(4749),_=i(6055),g=i(6222),Z=i(4318),y=i(5463),b=i(5483),v=i(4909);function T(e,t){s.Z.typeOf.object("normal",e),s.Z.typeOf.number("distance",t),this._distance=t,this._normal=new E(e,this),this.onChangeCallback=void 0,this.index=-1}function E(e,t){this._clippingPlane=t,this._cartesian3=o.Z.clone(e)}function x(e){e=(0,c.Z)(e,c.Z.EMPTY_OBJECT),this._planes=[],this._dirtyIndex=-1,this._multipleDirtyPlanes=!1,this._enabled=(0,c.Z)(e.enabled,!0),this.modelMatrix=m.Z.clone((0,c.Z)(e.modelMatrix,m.Z.IDENTITY)),this.edgeColor=l.Z.clone((0,c.Z)(e.edgeColor,l.Z.WHITE)),this.edgeWidth=(0,c.Z)(e.edgeWidth,0),this.planeAdded=new f.Z,this.planeRemoved=new f.Z,this._owner=void 0;let t=(0,c.Z)(e.unionClippingRegions,!1);this._unionClippingRegions=t,this._testIntersection=t?w:S,this._uint8View=void 0,this._float32View=void 0,this._clippingPlanesTexture=void 0;let i=e.planes;if((0,u.Z)(i)){let e=i.length;for(let t=0;t<e;++t)this.add(i[t])}}function w(e){return e===p.Z.OUTSIDE}function S(e){return e===p.Z.INSIDE}function C(e,t){e._multipleDirtyPlanes=e._multipleDirtyPlanes||-1!==e._dirtyIndex&&e._dirtyIndex!==t,e._dirtyIndex=t}function A(e,t){let i=e.length;for(let n=0;n<i;++n)if(g.Z.equals(e[n],t))return n;return -1}Object.defineProperties(T.prototype,{distance:{get:function(){return this._distance},set:function(e){s.Z.typeOf.number("value",e),(0,u.Z)(this.onChangeCallback)&&e!==this._distance&&this.onChangeCallback(this.index),this._distance=e}},normal:{get:function(){return this._normal},set:function(e){s.Z.typeOf.object("value",e),(0,u.Z)(this.onChangeCallback)&&!o.Z.equals(this._normal._cartesian3,e)&&this.onChangeCallback(this.index),o.Z.clone(e,this._normal._cartesian3)}}}),T.fromPlane=function(e,t){return s.Z.typeOf.object("plane",e),(0,u.Z)(t)?(t.normal=e.normal,t.distance=e.distance):t=new T(e.normal,e.distance),t},T.clone=function(e,t){return(0,u.Z)(t)?(t.normal=e.normal,t.distance=e.distance,t):new T(e.normal,e.distance)},Object.defineProperties(E.prototype,{x:{get:function(){return this._cartesian3.x},set:function(e){s.Z.typeOf.number("value",e),(0,u.Z)(this._clippingPlane.onChangeCallback)&&e!==this._cartesian3.x&&this._clippingPlane.onChangeCallback(this._clippingPlane.index),this._cartesian3.x=e}},y:{get:function(){return this._cartesian3.y},set:function(e){s.Z.typeOf.number("value",e),(0,u.Z)(this._clippingPlane.onChangeCallback)&&e!==this._cartesian3.y&&this._clippingPlane.onChangeCallback(this._clippingPlane.index),this._cartesian3.y=e}},z:{get:function(){return this._cartesian3.z},set:function(e){s.Z.typeOf.number("value",e),(0,u.Z)(this._clippingPlane.onChangeCallback)&&e!==this._cartesian3.z&&this._clippingPlane.onChangeCallback(this._clippingPlane.index),this._cartesian3.z=e}}}),Object.defineProperties(x.prototype,{length:{get:function(){return this._planes.length}},unionClippingRegions:{get:function(){return this._unionClippingRegions},set:function(e){this._unionClippingRegions!==e&&(this._unionClippingRegions=e,this._testIntersection=e?w:S)}},enabled:{get:function(){return this._enabled},set:function(e){this._enabled!==e&&(this._enabled=e)}},texture:{get:function(){return this._clippingPlanesTexture}},owner:{get:function(){return this._owner}},clippingPlanesState:{get:function(){return this._unionClippingRegions?this._planes.length:-this._planes.length}}}),x.prototype.add=function(e){let t=this._planes.length,i=this;e.onChangeCallback=function(e){C(i,e)},e.index=t,C(this,t),this._planes.push(e),this.planeAdded.raiseEvent(e,t)},x.prototype.get=function(e){return s.Z.typeOf.number("index",e),this._planes[e]},x.prototype.contains=function(e){return -1!==A(this._planes,e)},x.prototype.remove=function(e){let t=this._planes,i=A(t,e);if(-1===i)return!1;e instanceof T&&(e.onChangeCallback=void 0,e.index=-1);let n=t.length-1;for(let e=i;e<n;++e){let i=t[e+1];t[e]=i,i instanceof T&&(i.index=e)}return this._multipleDirtyPlanes=!0,t.length=n,this.planeRemoved.raiseEvent(e,i),!0},x.prototype.removeAll=function(){let e=this._planes,t=e.length;for(let i=0;i<t;++i){let t=e[i];t instanceof T&&(t.onChangeCallback=void 0,t.index=-1),this.planeRemoved.raiseEvent(t,i)}this._multipleDirtyPlanes=!0,this._planes=[]};let I=new a.Z,O=new a.Z;function D(e,t,i){let r=e._uint8View,o=e._planes,s=0;for(let e=t;e<i;++e){let t=o[e],i=n.Z.octEncodeToCartesian4(t.normal,O);r[s]=i.x,r[s+1]=i.y,r[s+2]=i.z,r[s+3]=i.w;let l=a.Z.packFloat(t.distance,I);r[s+4]=l.x,r[s+5]=l.y,r[s+6]=l.z,r[s+7]=l.w,s+=8}}function P(e,t,i){let n=e._float32View,r=e._planes,o=0;for(let e=t;e<i;++e){let t=r[e],i=t.normal;n[o]=i.x,n[o+1]=i.y,n[o+2]=i.z,n[o+3]=t.distance,o+=4}}function R(e,t){let i=Z.Z.maximumTextureSize;return t.x=Math.min(e,i),t.y=Math.ceil(e/t.x),t}let N=new r.Z;x.prototype.update=function(e){let t=this._clippingPlanesTexture,i=e.context,n=x.useFloatTexture(i),r=n?this.length:2*this.length;if((0,u.Z)(t)){let e=t.width*t.height;(e<r||r<.25*e)&&(t.destroy(),t=void 0,this._clippingPlanesTexture=void 0)}if(0===this.length)return;if(!(0,u.Z)(t)){let e=R(r,N);e.y*=2,n?(t=new v.Z({context:i,width:e.x,height:e.y,pixelFormat:_.Z.RGBA,pixelDatatype:y.Z.FLOAT,sampler:b.Z.NEAREST,flipY:!1}),this._float32View=new Float32Array(e.x*e.y*4)):(t=new v.Z({context:i,width:e.x,height:e.y,pixelFormat:_.Z.RGBA,pixelDatatype:y.Z.UNSIGNED_BYTE,sampler:b.Z.NEAREST,flipY:!1}),this._uint8View=new Uint8Array(e.x*e.y*4)),this._clippingPlanesTexture=t,this._multipleDirtyPlanes=!0}let o=this._dirtyIndex;if(this._multipleDirtyPlanes||-1!==o){if(this._multipleDirtyPlanes)n?(P(this,0,this._planes.length),t.copyFrom({source:{width:t.width,height:t.height,arrayBufferView:this._float32View}})):(D(this,0,this._planes.length),t.copyFrom({source:{width:t.width,height:t.height,arrayBufferView:this._uint8View}}));else{let e=0,i=0;n?(i=Math.floor(o/t.width),e=Math.floor(o-i*t.width),P(this,o,o+1),t.copyFrom({source:{width:1,height:1,arrayBufferView:this._float32View},xOffset:e,yOffset:i})):(i=Math.floor(2*o/t.width),e=Math.floor(2*o-i*t.width),D(this,o,o+1),t.copyFrom({source:{width:2,height:1,arrayBufferView:this._uint8View},xOffset:e,yOffset:i}))}this._multipleDirtyPlanes=!1,this._dirtyIndex=-1}};let L=new m.Z,M=new g.Z(o.Z.UNIT_X,0);x.prototype.computeIntersectionWithBoundingVolume=function(e,t){let i=this._planes,n=i.length,r=this.modelMatrix;(0,u.Z)(t)&&(r=m.Z.multiply(t,r,L));let o=p.Z.INSIDE;!this.unionClippingRegions&&n>0&&(o=p.Z.OUTSIDE);for(let t=0;t<n;++t){let n=i[t];g.Z.transform(n,r,M);let a=e.intersectPlane(M);if(a===p.Z.INTERSECTING)o=a;else if(this._testIntersection(a))return a}return o},x.setOwner=function(e,t,i){if(e!==t[i]&&(t[i]=t[i]&&t[i].destroy(),(0,u.Z)(e))){if((0,u.Z)(e._owner))throw new d.Z("ClippingPlaneCollection should only be assigned to one object");e._owner=t,t[i]=e}},x.useFloatTexture=function(e){return e.floatingPointTexture},x.getTextureResolution=function(e,t,i){let n=e.texture;if((0,u.Z)(n))return i.x=n.width,i.y=n.height,i;let r=R(x.useFloatTexture(t)?e.length:2*e.length,i);return r.y*=2,r},x.prototype.isDestroyed=function(){return!1},x.prototype.destroy=function(){return this._clippingPlanesTexture=this._clippingPlanesTexture&&this._clippingPlanesTexture.destroy(),(0,h.Z)(this)};var F=x},2923:function(e,t,i){"use strict";i.d(t,{Z:function(){return L}});var n=i(570),r=i(2150),o=i(698),a=i(4572),s=i(9410),l=i(7998),c=i(9824),u=i(2198),h=i(487),d=i(6055),f=i(8054),p=i(4318),m=i(5463),_=i(87),g=i(5483),Z=i(4909),y=i(5874),b=i(9138),v=i(9053),T=i(1486),E=i(2820),x=i(1039),w=i(2966);function S(e){o.Z.typeOf.object("options",e),o.Z.typeOf.object("options.positions",e.positions),o.Z.typeOf.number.greaterThanOrEquals("options.positions.length",e.positions.length,3),this._ellipsoid=(0,a.Z)(e.ellipsoid,x.Z.WGS84),this._positions=[...e.positions]}Object.defineProperties(S.prototype,{length:{get:function(){return this._positions.length}},positions:{get:function(){return this._positions}},ellipsoid:{get:function(){return this._ellipsoid}}}),S.clone=function(e,t){return(o.Z.typeOf.object("polygon",e),(0,s.Z)(t))?(t._ellipsoid=e.ellipsoid,t._positions.length=0,t._positions.push(...e.positions),t):new S({positions:e.positions,ellipsoid:e.ellipsoid})},S.equals=function(e,t){return o.Z.typeOf.object("left",e),o.Z.typeOf.object("right",t),e.ellipsoid.equals(t.ellipsoid)&&e.positions===t.positions},S.prototype.computeRectangle=function(e){return w.Z.computeRectangleFromPositions(this.positions,this.ellipsoid,void 0,e)};let C=new f.Z,A=new T.Z;S.prototype.computeSphericalExtents=function(e){(0,s.Z)(e)||(e=new f.Z);let t=this.computeRectangle(C),i=E.Z.toCartesian(f.Z.southwest(t),this.ellipsoid,A),n=Math.sqrt(i.x*i.x+i.y*i.y),o=r.Z.fastApproximateAtan2(n,i.z),a=r.Z.fastApproximateAtan2(i.x,i.y);return e.south=o,e.west=a,n=Math.sqrt((i=E.Z.toCartesian(f.Z.northeast(t),this.ellipsoid,A)).x*i.x+i.y*i.y),o=r.Z.fastApproximateAtan2(n,i.z),a=r.Z.fastApproximateAtan2(i.x,i.y),e.north=o,e.east=a,e};var I=i(1295);function O(e){e=(0,a.Z)(e,a.Z.EMPTY_OBJECT),this._polygons=[],this._totalPositions=0,this.enabled=(0,a.Z)(e.enabled,!0),this.inverse=(0,a.Z)(e.inverse,!1),this.polygonAdded=new u.Z,this.polygonRemoved=new u.Z,this._owner=void 0,this._float32View=void 0,this._extentsFloat32View=void 0,this._extentsCount=0,this._polygonsTexture=void 0,this._extentsTexture=void 0,this._signedDistanceTexture=void 0,this._signedDistanceComputeCommand=void 0;let t=e.polygons;if((0,s.Z)(t)){let e=t.length;for(let i=0;i<e;++i)this._polygons.push(t[i])}}Object.defineProperties(O.prototype,{length:{get:function(){return this._polygons.length}},totalPositions:{get:function(){return this._totalPositions}},extentsTexture:{get:function(){return this._extentsTexture}},extentsCount:{get:function(){return this._extentsCount}},pixelsNeededForExtents:{get:function(){return this.length}},pixelsNeededForPolygonPositions:{get:function(){return this.totalPositions+this.length}},clippingTexture:{get:function(){return this._signedDistanceTexture}},owner:{get:function(){return this._owner}},clippingPolygonsState:{get:function(){return this.inverse?-this.extentsCount:this.extentsCount}}}),O.prototype.add=function(e){o.Z.typeOf.object("polygon",e);let t=this._polygons.length;return this._polygons.push(e),this.polygonAdded.raiseEvent(e,t),e},O.prototype.get=function(e){return o.Z.typeOf.number("index",e),this._polygons[e]},O.prototype.contains=function(e){return o.Z.typeOf.object("polygon",e),this._polygons.some(t=>S.equals(t,e))},O.prototype.remove=function(e){o.Z.typeOf.object("polygon",e);let t=this._polygons,i=t.findIndex(t=>S.equals(t,e));return -1!==i&&(t.splice(i,1),this.polygonRemoved.raiseEvent(e,i),!0)};let D=new f.Z;O.prototype.removeAll=function(){let e=this._polygons,t=e.length;for(let i=0;i<t;++i){let t=e[i];this.polygonRemoved.raiseEvent(t,i)}this._polygons=[]};let P=new n.Z;O.prototype.update=function(e){let t=e.context;if(!O.isSupported(e))throw new _.Z("ClippingPolygonCollections are only supported for WebGL 2.");let i=this._polygons.reduce((e,t)=>e+t.length,0);if(i===this.totalPositions||(this._totalPositions=i,0===this.length))return;(0,s.Z)(this._signedDistanceComputeCommand)&&(this._signedDistanceComputeCommand.canceled=!0,this._signedDistanceComputeCommand=void 0);let n=this._polygonsTexture,o=this._extentsTexture,a=this._signedDistanceTexture;if((0,s.Z)(n)){let e=n.width*n.height;(e<this.pixelsNeededForPolygonPositions||this.pixelsNeededForPolygonPositions<.25*e)&&(n.destroy(),n=void 0,this._polygonsTexture=void 0)}if(!(0,s.Z)(n)){let e=O.getTextureResolution(n,this.pixelsNeededForPolygonPositions,P);n=new Z.Z({context:t,width:e.x,height:e.y,pixelFormat:d.Z.RG,pixelDatatype:m.Z.FLOAT,sampler:g.Z.NEAREST,flipY:!1}),this._float32View=new Float32Array(e.x*e.y*2),this._polygonsTexture=n}if((0,s.Z)(o)){let e=o.width*o.height;(e<this.pixelsNeededForExtents||this.pixelsNeededForExtents<.25*e)&&(o.destroy(),o=void 0,this._extentsTexture=void 0)}if(!(0,s.Z)(o)){let e=O.getTextureResolution(o,this.pixelsNeededForExtents,P);o=new Z.Z({context:t,width:e.x,height:e.y,pixelFormat:d.Z.RGBA,pixelDatatype:m.Z.FLOAT,sampler:g.Z.NEAREST,flipY:!1}),this._extentsFloat32View=new Float32Array(e.x*e.y*4),this._extentsTexture=o}if(function(e){let t=e._float32View,i=e._extentsFloat32View,n=e._polygons,{extentsList:o,extentsIndexByPolygon:a}=function(e){let t=[],i=[],n=e.length;for(let r=0;r<n;++r){let n=e[r].computeSphericalExtents(),o=Math.max(2.5*n.height,.001),a=Math.max(2.5*n.width,.001),l=f.Z.clone(n);l.south-=o,l.west-=a,l.north+=o,l.east+=a,l.south=Math.max(l.south,-Math.PI),l.west=Math.max(l.west,-Math.PI),l.north=Math.min(l.north,Math.PI),l.east=Math.min(l.east,Math.PI);let c=[r];for(let r=0;r<t.length;++r){let u=t[r];if((0,s.Z)(u)&&(0,s.Z)(f.Z.simpleIntersection(u,l))&&!f.Z.equals(u,l)){let s=i[r];c.push(...s),s.reduce((t,i)=>f.Z.union(e[i].computeSphericalExtents(D),t,t),n),t[r]=void 0,i[r]=void 0,o=Math.max(2.5*n.height,.001),a=Math.max(2.5*n.width,.001),l=f.Z.clone(n,l),l.south-=o,l.west-=a,l.north+=o,l.east+=a,l.south=Math.max(l.south,-Math.PI),l.west=Math.max(l.west,-Math.PI),l.north=Math.min(l.north,Math.PI),l.east=Math.min(l.east,Math.PI),r=-1}}t.push(l),i.push(c)}let r=new Map;return i.filter(s.Z).forEach((e,t)=>e.forEach(e=>r.set(e,t))),{extentsList:t.filter(s.Z),extentsIndexByPolygon:r}}(n),l=0;for(let[e,i]of n.entries()){let n=i.length;t[l++]=n,t[l++]=a.get(e);for(let e=0;e<n;++e){let n=i.positions[e],o=Math.hypot(n.x,n.y),a=r.Z.fastApproximateAtan2(o,n.z),s=r.Z.fastApproximateAtan2(n.x,n.y);t[l++]=a,t[l++]=s}}let c=0;for(let e of o){let t=1/(e.east-e.west),n=1/(e.north-e.south);i[c++]=e.south,i[c++]=e.west,i[c++]=n,i[c++]=t}e._extentsCount=o.length}(this),o.copyFrom({source:{width:o.width,height:o.height,arrayBufferView:this._extentsFloat32View}}),n.copyFrom({source:{width:n.width,height:n.height,arrayBufferView:this._float32View}}),!(0,s.Z)(a)){let e=O.getClippingDistanceTextureResolution(this,P);a=new Z.Z({context:t,width:e.x,height:e.y,pixelFormat:t.webgl2?d.Z.RED:d.Z.LUMINANCE,pixelDatatype:m.Z.FLOAT,sampler:new g.Z({wrapS:v.Z.CLAMP_TO_EDGE,wrapT:v.Z.CLAMP_TO_EDGE,minificationFilter:b.Z.LINEAR,magnificationFilter:y.Z.LINEAR}),flipY:!1}),this._signedDistanceTexture=a}this._signedDistanceComputeCommand=function(e){let t=e._polygonsTexture,i=e._extentsTexture;return new I.Z({fragmentShaderSource:"in vec2 v_textureCoordinates;\n\nuniform int u_polygonsLength;\nuniform int u_extentsLength;\nuniform highp sampler2D u_polygonTexture;\nuniform highp sampler2D u_extentsTexture;\n\nint getPolygonIndex(float dimension, vec2 coord) {\n vec2 uv = coord.xy * dimension;\n return int(floor(uv.y) * dimension + floor(uv.x));\n}\n\nvec2 getLookupUv(ivec2 dimensions, int i) {\n int pixY = i / dimensions.x;\n int pixX = i - (pixY * dimensions.x);\n float pixelWidth = 1.0 / float(dimensions.x);\n float pixelHeight = 1.0 / float(dimensions.y);\n float u = (float(pixX) + 0.5) * pixelWidth; // sample from center of pixel\n float v = (float(pixY) + 0.5) * pixelHeight;\n return vec2(u, v);\n}\n\nvec4 getExtents(int i) {\n return texture(u_extentsTexture, getLookupUv(textureSize(u_extentsTexture, 0), i));\n}\n\nivec2 getPositionsLengthAndExtentsIndex(int i) {\n vec2 uv = getLookupUv(textureSize(u_polygonTexture, 0), i);\n vec4 value = texture(u_polygonTexture, uv);\n return ivec2(int(value.x), int(value.y));\n}\n\nvec2 getPolygonPosition(int i) {\n vec2 uv = getLookupUv(textureSize(u_polygonTexture, 0), i);\n return texture(u_polygonTexture, uv).xy;\n}\n\nvec2 getCoordinates(vec2 textureCoordinates, vec4 extents) {\n float latitude = mix(extents.x, extents.x + 1.0 / extents.z, textureCoordinates.y);\n float longitude = mix(extents.y, extents.y + 1.0 / extents.w, textureCoordinates.x);\n return vec2(latitude, longitude);\n}\n\nvoid main() {\n int lastPolygonIndex = 0;\n out_FragColor = vec4(1.0);\n\n // Get the relevant region of the texture\n float dimension = float(u_extentsLength);\n if (u_extentsLength > 2) {\n dimension = ceil(log2(float(u_extentsLength)));\n }\n int regionIndex = getPolygonIndex(dimension, v_textureCoordinates);\n\n for (int polygonIndex = 0; polygonIndex < u_polygonsLength; polygonIndex++) {\n ivec2 positionsLengthAndExtents = getPositionsLengthAndExtentsIndex(lastPolygonIndex);\n int positionsLength = positionsLengthAndExtents.x;\n int polygonExtentsIndex = positionsLengthAndExtents.y;\n lastPolygonIndex += 1;\n\n // Only compute signed distance for the relevant part of the atlas\n if (polygonExtentsIndex == regionIndex) {\n float clipAmount = czm_infinity;\n vec4 extents = getExtents(polygonExtentsIndex);\n vec2 textureOffset = vec2(mod(float(polygonExtentsIndex), dimension), floor(float(polygonExtentsIndex) / dimension)) / dimension;\n vec2 p = getCoordinates((v_textureCoordinates - textureOffset) * dimension, extents);\n float s = 1.0;\n\n // Check each edge for absolute distance\n for (int i = 0, j = positionsLength - 1; i < positionsLength; j = i, i++) {\n vec2 a = getPolygonPosition(lastPolygonIndex + i);\n vec2 b = getPolygonPosition(lastPolygonIndex + j);\n \n vec2 ab = b - a;\n vec2 pa = p - a;\n float t = dot(pa, ab) / dot(ab, ab);\n t = clamp(t, 0.0, 1.0);\n\n vec2 pq = pa - t * ab;\n float d = length(pq);\n\n // Inside / outside computation to determine sign\n bvec3 cond = bvec3(p.y >= a.y, \n p.y < b.y, \n ab.x * pa.y > ab.y * pa.x);\n if (all(cond) || all(not(cond))) s = -s;\n if (abs(d) < abs(clipAmount)) {\n clipAmount = d;\n }\n }\n\n // Normalize the range to [0,1]\n vec4 result = (s * vec4(clipAmount * length(extents.zw))) / 2.0 + 0.5;\n // In the case where we've iterated through multiple polygons, take the minimum\n out_FragColor = min(out_FragColor, result);\n }\n\n lastPolygonIndex += positionsLength;\n }\n}",outputTexture:e._signedDistanceTexture,uniformMap:{u_polygonsLength:function(){return e.length},u_extentsLength:function(){return e.extentsCount},u_extentsTexture:function(){return i},u_polygonTexture:function(){return t}},persists:!1,owner:e,postExecute:()=>{e._signedDistanceComputeCommand=void 0}})}(this)},O.prototype.queueCommands=function(e){(0,s.Z)(this._signedDistanceComputeCommand)&&e.commandList.push(this._signedDistanceComputeCommand)};let R=new f.Z,N=new f.Z;O.prototype.computeIntersectionWithBoundingVolume=function(e,t){let i=this._polygons,n=i.length,r=h.Z.OUTSIDE;this.inverse&&(r=h.Z.INSIDE);for(let o=0;o<n;++o){let n=i[o].computeRectangle(),a=e.rectangle;if(!(0,s.Z)(a)&&(0,s.Z)(e.boundingVolume?.computeCorners)){let i=e.boundingVolume.computeCorners();a=f.Z.fromCartesianArray(i,t,R)}(0,s.Z)(a)||(a=f.Z.fromBoundingSphere(e.boundingSphere,t,R));let l=f.Z.simpleIntersection(a,n,N);(0,s.Z)(l)&&(r=h.Z.INTERSECTING)}return r},O.setOwner=function(e,t,i){if(e!==t[i]&&(t[i]=t[i]&&t[i].destroy(),(0,s.Z)(e))){if((0,s.Z)(e._owner))throw new c.Z("ClippingPolygonCollection should only be assigned to one object");e._owner=t,t[i]=e}},O.isSupported=function(e){return e?.context.webgl2},O.getTextureResolution=function(e,t,i){if((0,s.Z)(e))return i.x=e.width,i.y=e.height,i;let n=p.Z.maximumTextureSize;return i.x=Math.min(t,n),i.y=Math.ceil(t/i.x),i.y*=2,i},O.getClippingDistanceTextureResolution=function(e,t){let i=e.signedDistanceTexture;return(0,s.Z)(i)?(t.x=i.width,t.y=i.height):(t.x=Math.min(p.Z.maximumTextureSize,4096),t.y=Math.min(p.Z.maximumTextureSize,4096)),t},O.getClippingExtentsTextureResolution=function(e,t){let i=e.extentsTexture;return(0,s.Z)(i)?(t.x=i.width,t.y=i.height,t):O.getTextureResolution(i,e.pixelsNeededForExtents,t)},O.prototype.isDestroyed=function(){return!1},O.prototype.destroy=function(){return(0,s.Z)(this._signedDistanceComputeCommand)&&(this._signedDistanceComputeCommand.canceled=!0),this._polygonsTexture=this._polygonsTexture&&this._polygonsTexture.destroy(),this._extentsTexture=this._extentsTexture&&this._extentsTexture.destroy(),this._signedDistanceTexture=this._signedDistanceTexture&&this._signedDistanceTexture.destroy(),(0,l.Z)(this)};var L=O},7048:function(e,t,i){"use strict";var n=i(512);let r={FRONT:n.Z.FRONT,BACK:n.Z.BACK,FRONT_AND_BACK:n.Z.FRONT_AND_BACK};t.Z=Object.freeze(r)},5292:function(e,t,i){"use strict";var n=i(512);let r={NEVER:n.Z.NEVER,LESS:n.Z.LESS,EQUAL:n.Z.EQUAL,LESS_OR_EQUAL:n.Z.LEQUAL,GREATER:n.Z.GREATER,NOT_EQUAL:n.Z.NOTEQUAL,GREATER_OR_EQUAL:n.Z.GEQUAL,ALWAYS:n.Z.ALWAYS};t.Z=Object.freeze(r)},6900:function(e,t,i){"use strict";i.d(t,{Z:function(){return O}});var n=i(3369),r=i(7559),o=i(4572),a=i(9410),s=i(7998),l=i(9824),c=i(7984),u=i(2081),h=i(1362),d=i(356),f=i(7363),p=i(480),m=i(9698),_=i(8516),g=i(1205),Z=i(5012),y=i(7048),b=i(4955),v=i(2307),T=i(5899),E=i(8593),x=i(2537),w=i(8557),S=i(1022);function C(e){e=(0,o.Z)(e,o.Z.EMPTY_OBJECT),this.geometryInstances=e.geometryInstances,this._hasPerInstanceColors=!0;let t=e.appearance;(0,a.Z)(t)||(t=new v.Z),this.appearance=t,this.show=(0,o.Z)(e.show,!0),this.classificationType=(0,o.Z)(e.classificationType,Z.Z.BOTH),this.debugShowBoundingVolume=(0,o.Z)(e.debugShowBoundingVolume,!1),this._debugShowShadowVolume=(0,o.Z)(e.debugShowShadowVolume,!1),this._primitiveOptions={geometryInstances:void 0,appearance:void 0,vertexCacheOptimize:!1,interleave:(0,o.Z)(e.interleave,!1),releaseGeometryInstances:(0,o.Z)(e.releaseGeometryInstances,!0),allowPicking:(0,o.Z)(e.allowPicking,!0),asynchronous:(0,o.Z)(e.asynchronous,!0),compressVertices:!1,_createShaderProgramFunction:void 0,_createCommandsFunction:void 0,_updateAndQueueCommandsFunction:void 0},this._zIndex=void 0,this._ready=!1,this._primitive=void 0,this._sp=void 0,this._sp2D=void 0,this._spMorph=void 0,this._renderState=A(!1),this._renderState3DTiles=A(!0),this._renderStateMorph=p.Z.fromCache({cull:{enabled:!0,face:y.Z.FRONT},depthTest:{enabled:!0},blending:g.Z.PRE_MULTIPLIED_ALPHA_BLEND,depthMask:!1})}function A(e){return p.Z.fromCache({cull:{enabled:!0},blending:g.Z.PRE_MULTIPLIED_ALPHA_BLEND,depthMask:!1,stencilTest:{enabled:e,frontFunction:w.Z.EQUAL,frontOperation:{fail:S.Z.KEEP,zFail:S.Z.KEEP,zPass:S.Z.KEEP},backFunction:w.Z.EQUAL,backOperation:{fail:S.Z.KEEP,zFail:S.Z.KEEP,zPass:S.Z.KEEP},reference:x.Z.CESIUM_3D_TILE_MASK,mask:x.Z.CESIUM_3D_TILE_MASK}})}function I(e,t,i,n,r,o,a){i.mode===E.Z.MORPHING?t=t.derivedCommands.colorMorph:i.mode!==E.Z.SCENE3D&&(t=t.derivedCommands.color2D),t.modelMatrix=n,t.boundingVolume=o,t.cull=r,t.debugShowBoundingVolume=a,i.commandList.push(t)}Object.defineProperties(C.prototype,{interleave:{get:function(){return this._primitiveOptions.interleave}},releaseGeometryInstances:{get:function(){return this._primitiveOptions.releaseGeometryInstances}},allowPicking:{get:function(){return this._primitiveOptions.allowPicking}},asynchronous:{get:function(){return this._primitiveOptions.asynchronous}},ready:{get:function(){return this._ready}},debugShowShadowVolume:{get:function(){return this._debugShowShadowVolume}}}),C.initializeTerrainHeights=function(){return n.Z.initialize()},C.prototype.update=function(e){let t;if(!(0,a.Z)(this._primitive)&&!(0,a.Z)(this.geometryInstances))return;if(!n.Z.initialized){if(!this.asynchronous)throw new l.Z("For synchronous GroundPolylinePrimitives, you must call GroundPolylinePrimitives.initializeTerrainHeights() and wait for the returned promise to resolve.");C.initializeTerrainHeights();return}let i=this,o=this._primitiveOptions;if(!(0,a.Z)(this._primitive)){let s;let l=Array.isArray(this.geometryInstances)?this.geometryInstances:[this.geometryInstances],p=l.length,g=Array(p);for(t=0;t<p;++t)if(s=l[t].attributes,!(0,a.Z)(s)||!(0,a.Z)(s.color)){this._hasPerInstanceColors=!1;break}for(t=0;t<p;++t){let n=l[t];s={};let o=n.attributes;for(let e in o)o.hasOwnProperty(e)&&(s[e]=o[e]);(0,a.Z)(s.width)||(s.width=new u.Z({componentDatatype:r.Z.UNSIGNED_BYTE,componentsPerAttribute:1,value:[n.geometry.width]})),n.geometry._scene3DOnly=e.scene3DOnly,h.Z.setProjectionAndEllipsoid(n.geometry,e.mapProjection),g[t]=new c.Z({geometry:n.geometry,attributes:s,id:n.id,pickPrimitive:i})}o.geometryInstances=g,o.appearance=this.appearance,o._createShaderProgramFunction=function(e,t,r){!function(e,t,i){let r=t.context,o=e._primitive,s=o._attributeLocations,l=o._batchTable.getVertexShaderCallback()('in vec3 position3DHigh;\nin vec3 position3DLow;\n\n// In 2D and in 3D, texture coordinate normalization component signs encodes:\n// * X sign - sidedness relative to right plane\n// * Y sign - is negative OR magnitude is greater than 1.0 if vertex is on bottom of volume\n#ifndef COLUMBUS_VIEW_2D\nin vec4 startHiAndForwardOffsetX;\nin vec4 startLoAndForwardOffsetY;\nin vec4 startNormalAndForwardOffsetZ;\nin vec4 endNormalAndTextureCoordinateNormalizationX;\nin vec4 rightNormalAndTextureCoordinateNormalizationY;\n#else\nin vec4 startHiLo2D;\nin vec4 offsetAndRight2D;\nin vec4 startEndNormals2D;\nin vec2 texcoordNormalization2D;\n#endif\n\nin float batchId;\n\nout vec4 v_startPlaneNormalEcAndHalfWidth;\nout vec4 v_endPlaneNormalEcAndBatchId;\nout vec4 v_rightPlaneEC;\nout vec4 v_endEcAndStartEcX;\nout vec4 v_texcoordNormalizationAndStartEcYZ;\n\n// For materials\n#ifdef WIDTH_VARYING\nout float v_width;\n#endif\n#ifdef ANGLE_VARYING\nout float v_polylineAngle;\n#endif\n\n#ifdef PER_INSTANCE_COLOR\nout vec4 v_color;\n#endif\n\nvoid main()\n{\n#ifdef COLUMBUS_VIEW_2D\n vec3 ecStart = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(vec3(0.0, startHiLo2D.xy), vec3(0.0, startHiLo2D.zw))).xyz;\n\n vec3 forwardDirectionEC = czm_normal * vec3(0.0, offsetAndRight2D.xy);\n vec3 ecEnd = forwardDirectionEC + ecStart;\n forwardDirectionEC = normalize(forwardDirectionEC);\n\n // Right plane\n v_rightPlaneEC.xyz = czm_normal * vec3(0.0, offsetAndRight2D.zw);\n v_rightPlaneEC.w = -dot(v_rightPlaneEC.xyz, ecStart);\n\n // start plane\n vec4 startPlaneEC;\n startPlaneEC.xyz = czm_normal * vec3(0.0, startEndNormals2D.xy);\n startPlaneEC.w = -dot(startPlaneEC.xyz, ecStart);\n\n // end plane\n vec4 endPlaneEC;\n endPlaneEC.xyz = czm_normal * vec3(0.0, startEndNormals2D.zw);\n endPlaneEC.w = -dot(endPlaneEC.xyz, ecEnd);\n\n v_texcoordNormalizationAndStartEcYZ.x = abs(texcoordNormalization2D.x);\n v_texcoordNormalizationAndStartEcYZ.y = texcoordNormalization2D.y;\n\n#else // COLUMBUS_VIEW_2D\n vec3 ecStart = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(startHiAndForwardOffsetX.xyz, startLoAndForwardOffsetY.xyz)).xyz;\n vec3 offset = czm_normal * vec3(startHiAndForwardOffsetX.w, startLoAndForwardOffsetY.w, startNormalAndForwardOffsetZ.w);\n vec3 ecEnd = ecStart + offset;\n\n vec3 forwardDirectionEC = normalize(offset);\n\n // start plane\n vec4 startPlaneEC;\n startPlaneEC.xyz = czm_normal * startNormalAndForwardOffsetZ.xyz;\n startPlaneEC.w = -dot(startPlaneEC.xyz, ecStart);\n\n // end plane\n vec4 endPlaneEC;\n endPlaneEC.xyz = czm_normal * endNormalAndTextureCoordinateNormalizationX.xyz;\n endPlaneEC.w = -dot(endPlaneEC.xyz, ecEnd);\n\n // Right plane\n v_rightPlaneEC.xyz = czm_normal * rightNormalAndTextureCoordinateNormalizationY.xyz;\n v_rightPlaneEC.w = -dot(v_rightPlaneEC.xyz, ecStart);\n\n v_texcoordNormalizationAndStartEcYZ.x = abs(endNormalAndTextureCoordinateNormalizationX.w);\n v_texcoordNormalizationAndStartEcYZ.y = rightNormalAndTextureCoordinateNormalizationY.w;\n\n#endif // COLUMBUS_VIEW_2D\n\n v_endEcAndStartEcX.xyz = ecEnd;\n v_endEcAndStartEcX.w = ecStart.x;\n v_texcoordNormalizationAndStartEcYZ.zw = ecStart.yz;\n\n#ifdef PER_INSTANCE_COLOR\n v_color = czm_batchTable_color(batchId);\n#endif // PER_INSTANCE_COLOR\n\n // Compute a normal along which to "push" the position out, extending the miter depending on view distance.\n // Position has already been "pushed" by unit length along miter normal, and miter normals are encoded in the planes.\n // Decode the normal to use at this specific vertex, push the position back, and then push to where it needs to be.\n vec4 positionRelativeToEye = czm_computePosition();\n\n // Check distance to the end plane and start plane, pick the plane that is closer\n vec4 positionEC = czm_modelViewRelativeToEye * positionRelativeToEye; // w = 1.0, see czm_computePosition\n float absStartPlaneDistance = abs(czm_planeDistance(startPlaneEC, positionEC.xyz));\n float absEndPlaneDistance = abs(czm_planeDistance(endPlaneEC, positionEC.xyz));\n vec3 planeDirection = czm_branchFreeTernary(absStartPlaneDistance < absEndPlaneDistance, startPlaneEC.xyz, endPlaneEC.xyz);\n vec3 upOrDown = normalize(cross(v_rightPlaneEC.xyz, planeDirection)); // Points "up" for start plane, "down" at end plane.\n vec3 normalEC = normalize(cross(planeDirection, upOrDown)); // In practice, the opposite seems to work too.\n\n // Extrude bottom vertices downward for far view distances, like for GroundPrimitives\n upOrDown = cross(forwardDirectionEC, normalEC);\n upOrDown = float(czm_sceneMode == czm_sceneMode3D) * upOrDown;\n upOrDown = float(v_texcoordNormalizationAndStartEcYZ.y > 1.0 || v_texcoordNormalizationAndStartEcYZ.y < 0.0) * upOrDown;\n upOrDown = min(GLOBE_MINIMUM_ALTITUDE, czm_geometricToleranceOverMeter * length(positionRelativeToEye.xyz)) * upOrDown;\n positionEC.xyz += upOrDown;\n\n v_texcoordNormalizationAndStartEcYZ.y = czm_branchFreeTernary(v_texcoordNormalizationAndStartEcYZ.y > 1.0, 0.0, abs(v_texcoordNormalizationAndStartEcYZ.y));\n\n // Determine distance along normalEC to push for a volume of appropriate width.\n // Make volumes about double pixel width for a conservative fit - in practice the\n // extra cost here is minimal compared to the loose volume heights.\n //\n // N = normalEC (guaranteed "right-facing")\n // R = rightEC\n // p = angle between N and R\n // w = distance to push along R if R == N\n // d = distance to push along N\n //\n // N R\n // { p| } * cos(p) = dot(N, R) = w / d\n // d | |w * d = w / dot(N, R)\n // { | }\n // o---------- polyline segment ---->\n //\n float width = czm_batchTable_width(batchId);\n#ifdef WIDTH_VARYING\n v_width = width;\n#endif\n\n v_startPlaneNormalEcAndHalfWidth.xyz = startPlaneEC.xyz;\n v_startPlaneNormalEcAndHalfWidth.w = width * 0.5;\n\n v_endPlaneNormalEcAndBatchId.xyz = endPlaneEC.xyz;\n v_endPlaneNormalEcAndBatchId.w = batchId;\n\n width = width * max(0.0, czm_metersPerPixel(positionEC)); // width = distance to push along R\n width = width / dot(normalEC, v_rightPlaneEC.xyz); // width = distance to push along N\n\n // Determine if this vertex is on the "left" or "right"\n#ifdef COLUMBUS_VIEW_2D\n normalEC *= sign(texcoordNormalization2D.x);\n#else\n normalEC *= sign(endNormalAndTextureCoordinateNormalizationX.w);\n#endif\n\n positionEC.xyz += width * normalEC;\n gl_Position = czm_depthClamp(czm_projection * positionEC);\n\n#ifdef ANGLE_VARYING\n // Approximate relative screen space direction of the line.\n vec2 approxLineDirection = normalize(vec2(forwardDirectionEC.x, -forwardDirectionEC.y));\n approxLineDirection.y = czm_branchFreeTernary(approxLineDirection.x == 0.0 && approxLineDirection.y == 0.0, -1.0, approxLineDirection.y);\n v_polylineAngle = czm_fastApproximateAtan(approxLineDirection.x, approxLineDirection.y);\n#endif\n}\n');l=T.Z._appendShowToShader(o,l),l=T.Z._appendDistanceDisplayConditionToShader(o,l),l=T.Z._modifyShaderPosition(e,l,t.scene3DOnly);let c=o._batchTable.getVertexShaderCallback()('in vec3 position3DHigh;\nin vec3 position3DLow;\n\nin vec4 startHiAndForwardOffsetX;\nin vec4 startLoAndForwardOffsetY;\nin vec4 startNormalAndForwardOffsetZ;\nin vec4 endNormalAndTextureCoordinateNormalizationX;\nin vec4 rightNormalAndTextureCoordinateNormalizationY;\nin vec4 startHiLo2D;\nin vec4 offsetAndRight2D;\nin vec4 startEndNormals2D;\nin vec2 texcoordNormalization2D;\n\nin float batchId;\n\nout vec3 v_forwardDirectionEC;\nout vec3 v_texcoordNormalizationAndHalfWidth;\nout float v_batchId;\n\n// For materials\n#ifdef WIDTH_VARYING\nout float v_width;\n#endif\n#ifdef ANGLE_VARYING\nout float v_polylineAngle;\n#endif\n\n#ifdef PER_INSTANCE_COLOR\nout vec4 v_color;\n#else\nout vec2 v_alignedPlaneDistances;\nout float v_texcoordT;\n#endif\n\n// Morphing planes using SLERP or NLERP doesn\'t seem to work, so instead draw the material directly on the shadow volume.\n// Morph views are from very far away and aren\'t meant to be used precisely, so this should be sufficient.\nvoid main()\n{\n v_batchId = batchId;\n\n // Start position\n vec4 posRelativeToEye2D = czm_translateRelativeToEye(vec3(0.0, startHiLo2D.xy), vec3(0.0, startHiLo2D.zw));\n vec4 posRelativeToEye3D = czm_translateRelativeToEye(startHiAndForwardOffsetX.xyz, startLoAndForwardOffsetY.xyz);\n vec4 posRelativeToEye = czm_columbusViewMorph(posRelativeToEye2D, posRelativeToEye3D, czm_morphTime);\n vec3 posEc2D = (czm_modelViewRelativeToEye * posRelativeToEye2D).xyz;\n vec3 posEc3D = (czm_modelViewRelativeToEye * posRelativeToEye3D).xyz;\n vec3 startEC = (czm_modelViewRelativeToEye * posRelativeToEye).xyz;\n\n // Start plane\n vec4 startPlane2D;\n vec4 startPlane3D;\n startPlane2D.xyz = czm_normal * vec3(0.0, startEndNormals2D.xy);\n startPlane3D.xyz = czm_normal * startNormalAndForwardOffsetZ.xyz;\n startPlane2D.w = -dot(startPlane2D.xyz, posEc2D);\n startPlane3D.w = -dot(startPlane3D.xyz, posEc3D);\n\n // Right plane\n vec4 rightPlane2D;\n vec4 rightPlane3D;\n rightPlane2D.xyz = czm_normal * vec3(0.0, offsetAndRight2D.zw);\n rightPlane3D.xyz = czm_normal * rightNormalAndTextureCoordinateNormalizationY.xyz;\n rightPlane2D.w = -dot(rightPlane2D.xyz, posEc2D);\n rightPlane3D.w = -dot(rightPlane3D.xyz, posEc3D);\n\n // End position\n posRelativeToEye2D = posRelativeToEye2D + vec4(0.0, offsetAndRight2D.xy, 0.0);\n posRelativeToEye3D = posRelativeToEye3D + vec4(startHiAndForwardOffsetX.w, startLoAndForwardOffsetY.w, startNormalAndForwardOffsetZ.w, 0.0);\n posRelativeToEye = czm_columbusViewMorph(posRelativeToEye2D, posRelativeToEye3D, czm_morphTime);\n posEc2D = (czm_modelViewRelativeToEye * posRelativeToEye2D).xyz;\n posEc3D = (czm_modelViewRelativeToEye * posRelativeToEye3D).xyz;\n vec3 endEC = (czm_modelViewRelativeToEye * posRelativeToEye).xyz;\n vec3 forwardEc3D = czm_normal * normalize(vec3(startHiAndForwardOffsetX.w, startLoAndForwardOffsetY.w, startNormalAndForwardOffsetZ.w));\n vec3 forwardEc2D = czm_normal * normalize(vec3(0.0, offsetAndRight2D.xy));\n\n // End plane\n vec4 endPlane2D;\n vec4 endPlane3D;\n endPlane2D.xyz = czm_normal * vec3(0.0, startEndNormals2D.zw);\n endPlane3D.xyz = czm_normal * endNormalAndTextureCoordinateNormalizationX.xyz;\n endPlane2D.w = -dot(endPlane2D.xyz, posEc2D);\n endPlane3D.w = -dot(endPlane3D.xyz, posEc3D);\n\n // Forward direction\n v_forwardDirectionEC = normalize(endEC - startEC);\n\n vec2 cleanTexcoordNormalization2D;\n cleanTexcoordNormalization2D.x = abs(texcoordNormalization2D.x);\n cleanTexcoordNormalization2D.y = czm_branchFreeTernary(texcoordNormalization2D.y > 1.0, 0.0, abs(texcoordNormalization2D.y));\n vec2 cleanTexcoordNormalization3D;\n cleanTexcoordNormalization3D.x = abs(endNormalAndTextureCoordinateNormalizationX.w);\n cleanTexcoordNormalization3D.y = rightNormalAndTextureCoordinateNormalizationY.w;\n cleanTexcoordNormalization3D.y = czm_branchFreeTernary(cleanTexcoordNormalization3D.y > 1.0, 0.0, abs(cleanTexcoordNormalization3D.y));\n\n v_texcoordNormalizationAndHalfWidth.xy = mix(cleanTexcoordNormalization2D, cleanTexcoordNormalization3D, czm_morphTime);\n\n#ifdef PER_INSTANCE_COLOR\n v_color = czm_batchTable_color(batchId);\n#else // PER_INSTANCE_COLOR\n // For computing texture coordinates\n\n v_alignedPlaneDistances.x = -dot(v_forwardDirectionEC, startEC);\n v_alignedPlaneDistances.y = -dot(-v_forwardDirectionEC, endEC);\n#endif // PER_INSTANCE_COLOR\n\n#ifdef WIDTH_VARYING\n float width = czm_batchTable_width(batchId);\n float halfWidth = width * 0.5;\n v_width = width;\n v_texcoordNormalizationAndHalfWidth.z = halfWidth;\n#else\n float halfWidth = 0.5 * czm_batchTable_width(batchId);\n v_texcoordNormalizationAndHalfWidth.z = halfWidth;\n#endif\n\n // Compute a normal along which to "push" the position out, extending the miter depending on view distance.\n // Position has already been "pushed" by unit length along miter normal, and miter normals are encoded in the planes.\n // Decode the normal to use at this specific vertex, push the position back, and then push to where it needs to be.\n // Since this is morphing, compute both 3D and 2D positions and then blend.\n\n // ****** 3D ******\n // Check distance to the end plane and start plane, pick the plane that is closer\n vec4 positionEc3D = czm_modelViewRelativeToEye * czm_translateRelativeToEye(position3DHigh, position3DLow); // w = 1.0, see czm_computePosition\n float absStartPlaneDistance = abs(czm_planeDistance(startPlane3D, positionEc3D.xyz));\n float absEndPlaneDistance = abs(czm_planeDistance(endPlane3D, positionEc3D.xyz));\n vec3 planeDirection = czm_branchFreeTernary(absStartPlaneDistance < absEndPlaneDistance, startPlane3D.xyz, endPlane3D.xyz);\n vec3 upOrDown = normalize(cross(rightPlane3D.xyz, planeDirection)); // Points "up" for start plane, "down" at end plane.\n vec3 normalEC = normalize(cross(planeDirection, upOrDown)); // In practice, the opposite seems to work too.\n\n // Nudge the top vertex upwards to prevent flickering\n vec3 geodeticSurfaceNormal = normalize(cross(normalEC, forwardEc3D));\n geodeticSurfaceNormal *= float(0.0 <= rightNormalAndTextureCoordinateNormalizationY.w && rightNormalAndTextureCoordinateNormalizationY.w <= 1.0);\n geodeticSurfaceNormal *= MAX_TERRAIN_HEIGHT;\n positionEc3D.xyz += geodeticSurfaceNormal;\n\n // Determine if this vertex is on the "left" or "right"\n normalEC *= sign(endNormalAndTextureCoordinateNormalizationX.w);\n\n // A "perfect" implementation would push along normals according to the angle against forward.\n // In practice, just pushing the normal out by halfWidth is sufficient for morph views.\n positionEc3D.xyz += halfWidth * max(0.0, czm_metersPerPixel(positionEc3D)) * normalEC; // prevent artifacts when czm_metersPerPixel is negative (behind camera)\n\n // ****** 2D ******\n // Check distance to the end plane and start plane, pick the plane that is closer\n vec4 positionEc2D = czm_modelViewRelativeToEye * czm_translateRelativeToEye(position2DHigh.zxy, position2DLow.zxy); // w = 1.0, see czm_computePosition\n absStartPlaneDistance = abs(czm_planeDistance(startPlane2D, positionEc2D.xyz));\n absEndPlaneDistance = abs(czm_planeDistance(endPlane2D, positionEc2D.xyz));\n planeDirection = czm_branchFreeTernary(absStartPlaneDistance < absEndPlaneDistance, startPlane2D.xyz, endPlane2D.xyz);\n upOrDown = normalize(cross(rightPlane2D.xyz, planeDirection)); // Points "up" for start plane, "down" at end plane.\n normalEC = normalize(cross(planeDirection, upOrDown)); // In practice, the opposite seems to work too.\n\n // Nudge the top vertex upwards to prevent flickering\n geodeticSurfaceNormal = normalize(cross(normalEC, forwardEc2D));\n geodeticSurfaceNormal *= float(0.0 <= texcoordNormalization2D.y && texcoordNormalization2D.y <= 1.0);\n geodeticSurfaceNormal *= MAX_TERRAIN_HEIGHT;\n positionEc2D.xyz += geodeticSurfaceNormal;\n\n // Determine if this vertex is on the "left" or "right"\n normalEC *= sign(texcoordNormalization2D.x);\n#ifndef PER_INSTANCE_COLOR\n // Use vertex\'s sidedness to compute its texture coordinate.\n v_texcoordT = clamp(sign(texcoordNormalization2D.x), 0.0, 1.0);\n#endif\n\n // A "perfect" implementation would push along normals according to the angle against forward.\n // In practice, just pushing the normal out by halfWidth is sufficient for morph views.\n positionEc2D.xyz += halfWidth * max(0.0, czm_metersPerPixel(positionEc2D)) * normalEC; // prevent artifacts when czm_metersPerPixel is negative (behind camera)\n\n // Blend for actual position\n gl_Position = czm_projection * mix(positionEc2D, positionEc3D, czm_morphTime);\n\n#ifdef ANGLE_VARYING\n // Approximate relative screen space direction of the line.\n vec2 approxLineDirection = normalize(vec2(v_forwardDirectionEC.x, -v_forwardDirectionEC.y));\n approxLineDirection.y = czm_branchFreeTernary(approxLineDirection.x == 0.0 && approxLineDirection.y == 0.0, -1.0, approxLineDirection.y);\n v_polylineAngle = czm_fastApproximateAtan(approxLineDirection.x, approxLineDirection.y);\n#endif\n}\n');c=T.Z._appendShowToShader(o,c),c=T.Z._appendDistanceDisplayConditionToShader(o,c),c=T.Z._modifyShaderPosition(e,c,t.scene3DOnly);let u=o._batchTable.getVertexShaderCallback()('in vec4 v_startPlaneNormalEcAndHalfWidth;\nin vec4 v_endPlaneNormalEcAndBatchId;\nin vec4 v_rightPlaneEC; // Technically can compute distance for this here\nin vec4 v_endEcAndStartEcX;\nin vec4 v_texcoordNormalizationAndStartEcYZ;\n\n#ifdef PER_INSTANCE_COLOR\nin vec4 v_color;\n#endif\n\nvoid main(void)\n{\n float logDepthOrDepth = czm_branchFreeTernary(czm_sceneMode == czm_sceneMode2D, gl_FragCoord.z, czm_unpackDepth(texture(czm_globeDepthTexture, gl_FragCoord.xy / czm_viewport.zw)));\n vec3 ecStart = vec3(v_endEcAndStartEcX.w, v_texcoordNormalizationAndStartEcYZ.zw);\n\n // Discard for sky\n if (logDepthOrDepth == 0.0) {\n#ifdef DEBUG_SHOW_VOLUME\n out_FragColor = vec4(1.0, 0.0, 0.0, 0.5);\n return;\n#else // DEBUG_SHOW_VOLUME\n discard;\n#endif // DEBUG_SHOW_VOLUME\n }\n\n vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, logDepthOrDepth);\n eyeCoordinate /= eyeCoordinate.w;\n\n float halfMaxWidth = v_startPlaneNormalEcAndHalfWidth.w * czm_metersPerPixel(eyeCoordinate);\n // Check distance of the eye coordinate against the right-facing plane\n float widthwiseDistance = czm_planeDistance(v_rightPlaneEC, eyeCoordinate.xyz);\n\n // Check eye coordinate against the mitering planes\n float distanceFromStart = czm_planeDistance(v_startPlaneNormalEcAndHalfWidth.xyz, -dot(ecStart, v_startPlaneNormalEcAndHalfWidth.xyz), eyeCoordinate.xyz);\n float distanceFromEnd = czm_planeDistance(v_endPlaneNormalEcAndBatchId.xyz, -dot(v_endEcAndStartEcX.xyz, v_endPlaneNormalEcAndBatchId.xyz), eyeCoordinate.xyz);\n\n if (abs(widthwiseDistance) > halfMaxWidth || distanceFromStart < 0.0 || distanceFromEnd < 0.0) {\n#ifdef DEBUG_SHOW_VOLUME\n out_FragColor = vec4(1.0, 0.0, 0.0, 0.5);\n return;\n#else // DEBUG_SHOW_VOLUME\n discard;\n#endif // DEBUG_SHOW_VOLUME\n }\n\n // Check distance of the eye coordinate against start and end planes with normals in the right plane.\n // For computing unskewed lengthwise texture coordinate.\n // Can also be used for clipping extremely pointy miters, but in practice unnecessary because of miter breaking.\n\n // aligned plane: cross the right plane normal with miter plane normal, then cross the result with right again to point it more "forward"\n vec3 alignedPlaneNormal;\n\n // start aligned plane\n alignedPlaneNormal = cross(v_rightPlaneEC.xyz, v_startPlaneNormalEcAndHalfWidth.xyz);\n alignedPlaneNormal = normalize(cross(alignedPlaneNormal, v_rightPlaneEC.xyz));\n distanceFromStart = czm_planeDistance(alignedPlaneNormal, -dot(alignedPlaneNormal, ecStart), eyeCoordinate.xyz);\n\n // end aligned plane\n alignedPlaneNormal = cross(v_rightPlaneEC.xyz, v_endPlaneNormalEcAndBatchId.xyz);\n alignedPlaneNormal = normalize(cross(alignedPlaneNormal, v_rightPlaneEC.xyz));\n distanceFromEnd = czm_planeDistance(alignedPlaneNormal, -dot(alignedPlaneNormal, v_endEcAndStartEcX.xyz), eyeCoordinate.xyz);\n\n#ifdef PER_INSTANCE_COLOR\n out_FragColor = czm_gammaCorrect(v_color);\n#else // PER_INSTANCE_COLOR\n // Clamp - distance to aligned planes may be negative due to mitering,\n // so fragment texture coordinate might be out-of-bounds.\n float s = clamp(distanceFromStart / (distanceFromStart + distanceFromEnd), 0.0, 1.0);\n s = (s * v_texcoordNormalizationAndStartEcYZ.x) + v_texcoordNormalizationAndStartEcYZ.y;\n float t = (widthwiseDistance + halfMaxWidth) / (2.0 * halfMaxWidth);\n\n czm_materialInput materialInput;\n\n materialInput.s = s;\n materialInput.st = vec2(s, t);\n materialInput.str = vec3(s, t, 0.0);\n\n czm_material material = czm_getMaterial(materialInput);\n out_FragColor = vec4(material.diffuse + material.emission, material.alpha);\n#endif // PER_INSTANCE_COLOR\n\n // Premultiply alpha. Required for classification primitives on translucent globe.\n out_FragColor.rgb *= out_FragColor.a;\n\n czm_writeDepthClamp();\n}\n'),h=[`GLOBE_MINIMUM_ALTITUDE ${t.mapProjection.ellipsoid.minimumRadius.toFixed(1)}`],d="",f="";(0,a.Z)(i.material)?(-1!==(f=(0,a.Z)(i.material)?i.material.shaderSource:"").search(/in\s+float\s+v_polylineAngle;/g)&&h.push("ANGLE_VARYING"),-1!==f.search(/in\s+float\s+v_width;/g)&&h.push("WIDTH_VARYING")):d="PER_INSTANCE_COLOR",h.push(d);let p=e.debugShowShadowVolume?["DEBUG_SHOW_VOLUME",d]:[d],g=new _.Z({defines:h,sources:[l]}),Z=new _.Z({defines:p,sources:[f,u]});e._sp=m.Z.replaceCache({context:r,shaderProgram:o._sp,vertexShaderSource:g,fragmentShaderSource:Z,attributeLocations:s});let y=r.shaderCache.getDerivedShaderProgram(e._sp,"2dColor");if(!(0,a.Z)(y)){let t=new _.Z({defines:h.concat(["COLUMBUS_VIEW_2D"]),sources:[l]});y=r.shaderCache.createDerivedShaderProgram(e._sp,"2dColor",{context:r,shaderProgram:e._sp2D,vertexShaderSource:t,fragmentShaderSource:Z,attributeLocations:s})}e._sp2D=y;let b=r.shaderCache.getDerivedShaderProgram(e._sp,"MorphColor");if(!(0,a.Z)(b)){let t=new _.Z({defines:h.concat([`MAX_TERRAIN_HEIGHT ${n.Z._defaultMaxTerrainHeight.toFixed(1)}`]),sources:[c]});u=o._batchTable.getVertexShaderCallback()("in vec3 v_forwardDirectionEC;\nin vec3 v_texcoordNormalizationAndHalfWidth;\nin float v_batchId;\n\n#ifdef PER_INSTANCE_COLOR\nin vec4 v_color;\n#else\nin vec2 v_alignedPlaneDistances;\nin float v_texcoordT;\n#endif\n\nfloat rayPlaneDistanceUnsafe(vec3 origin, vec3 direction, vec3 planeNormal, float planeDistance) {\n // We don't expect the ray to ever be parallel to the plane\n return (-planeDistance - dot(planeNormal, origin)) / dot(planeNormal, direction);\n}\n\nvoid main(void)\n{\n vec4 eyeCoordinate = gl_FragCoord;\n eyeCoordinate /= eyeCoordinate.w;\n\n#ifdef PER_INSTANCE_COLOR\n out_FragColor = czm_gammaCorrect(v_color);\n#else // PER_INSTANCE_COLOR\n // Use distances for planes aligned with segment to prevent skew in dashing\n float distanceFromStart = rayPlaneDistanceUnsafe(eyeCoordinate.xyz, -v_forwardDirectionEC, v_forwardDirectionEC.xyz, v_alignedPlaneDistances.x);\n float distanceFromEnd = rayPlaneDistanceUnsafe(eyeCoordinate.xyz, v_forwardDirectionEC, -v_forwardDirectionEC.xyz, v_alignedPlaneDistances.y);\n\n // Clamp - distance to aligned planes may be negative due to mitering\n distanceFromStart = max(0.0, distanceFromStart);\n distanceFromEnd = max(0.0, distanceFromEnd);\n\n float s = distanceFromStart / (distanceFromStart + distanceFromEnd);\n s = (s * v_texcoordNormalizationAndHalfWidth.x) + v_texcoordNormalizationAndHalfWidth.y;\n\n czm_materialInput materialInput;\n\n materialInput.s = s;\n materialInput.st = vec2(s, v_texcoordT);\n materialInput.str = vec3(s, v_texcoordT, 0.0);\n\n czm_material material = czm_getMaterial(materialInput);\n out_FragColor = vec4(material.diffuse + material.emission, material.alpha);\n#endif // PER_INSTANCE_COLOR\n}\n");let i=new _.Z({defines:p,sources:[f,u]});b=r.shaderCache.createDerivedShaderProgram(e._sp,"MorphColor",{context:r,shaderProgram:e._spMorph,vertexShaderSource:t,fragmentShaderSource:i,attributeLocations:s})}e._spMorph=b}(i,t,r)},o._createCommandsFunction=function(e,t,n,r,o,s,l){!function(e,t,i,n,r,o){let s=e._primitive,l=s._va.length;r.length=l,o.length=l;let c=t instanceof b.Z?{}:i._uniforms,u=s._batchTable.getUniformMapCallback()(c);for(let t=0;t<l;t++){let i=s._va[t],n=r[t];(0,a.Z)(n)||(n=r[t]=new d.Z({owner:e,primitiveType:s._primitiveType})),n.vertexArray=i,n.renderState=e._renderState,n.shaderProgram=e._sp,n.uniformMap=u,n.pass=f.Z.TERRAIN_CLASSIFICATION,n.pickId="czm_batchTable_pickColor(v_endPlaneNormalEcAndBatchId.w)";let o=d.Z.shallowClone(n,n.derivedCommands.tileset);o.renderState=e._renderState3DTiles,o.pass=f.Z.CESIUM_3D_TILE_CLASSIFICATION,n.derivedCommands.tileset=o;let l=d.Z.shallowClone(n,n.derivedCommands.color2D);l.shaderProgram=e._sp2D,n.derivedCommands.color2D=l;let c=d.Z.shallowClone(o,o.derivedCommands.color2D);c.shaderProgram=e._sp2D,o.derivedCommands.color2D=c;let h=d.Z.shallowClone(n,n.derivedCommands.colorMorph);h.renderState=e._renderStateMorph,h.shaderProgram=e._spMorph,h.pickId="czm_batchTable_pickColor(v_batchId)",n.derivedCommands.colorMorph=h}}(i,t,n,0,s,l)},o._updateAndQueueCommandsFunction=function(e,t,n,r,o,s,l,c){!function(e,t,i,n,r,o,s){let l;let c=e._primitive;T.Z._updateBoundingVolumes(c,t,r),t.mode===E.Z.SCENE3D?l=c._boundingSphereWC:t.mode===E.Z.COLUMBUS_VIEW?l=c._boundingSphereCV:t.mode===E.Z.SCENE2D&&(0,a.Z)(c._boundingSphere2D)?l=c._boundingSphere2D:(0,a.Z)(c._boundingSphereMorph)&&(l=c._boundingSphereMorph);let u=t.mode===E.Z.MORPHING,h=e.classificationType,d=h!==Z.Z.CESIUM_3D_TILE,f=h!==Z.Z.TERRAIN&&!u,p=t.passes;if(p.render||p.pick&&c.allowPicking){let n=i.length;for(let a=0;a<n;++a){let n=l[a];d&&I(e,i[a],t,r,o,n,s),f&&I(e,i[a].derivedCommands.tileset,t,r,o,n,s)}}}(i,t,n,0,o,s,l)},this._primitive=new T.Z(o)}if(this.appearance instanceof b.Z&&!this._hasPerInstanceColors)throw new l.Z("All GeometryInstances must have color attributes to use PolylineColorAppearance with GroundPolylinePrimitive.");this._primitive.appearance=this.appearance,this._primitive.show=this.show,this._primitive.debugShowBoundingVolume=this.debugShowBoundingVolume,this._primitive.update(e),e.afterRender.push(()=>{!this._ready&&(0,a.Z)(this._primitive)&&this._primitive.ready&&(this._ready=!0,this.releaseGeometryInstances&&(this.geometryInstances=void 0))})},C.prototype.getGeometryInstanceAttributes=function(e){if(!(0,a.Z)(this._primitive))throw new l.Z("must call update before calling getGeometryInstanceAttributes");return this._primitive.getGeometryInstanceAttributes(e)},C.isSupported=function(e){return e.frameState.context.depthTexture},C.prototype.isDestroyed=function(){return!1},C.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),this._sp=this._sp&&this._sp.destroy(),this._sp2D=void 0,this._spMorph=void 0,(0,s.Z)(this)};var O=C},3650:function(e,t,i){"use strict";i.d(t,{Z:function(){return ee}});var n=i(3369),r=i(7643),o=i(1486),a=i(2820),s=i(698),l=i(4572),c=i(9410),u=i(7998),h=i(9824),d=i(7984),f=i(7066),p=i(8054),m=i(7330),_=i(4127),g=i(2115),Z=i(356),y=i(7363),b=i(480),v=i(9698),T=i(8516),E=i(9762),x=i(1205),w=i(5012),S=i(5292),C=i(9250),A=i(5899),I=i(8593),O=i(3812),D=i(2537),P=i(8557),R=i(1022);function N(e){let t=(e=(0,l.Z)(e,l.Z.EMPTY_OBJECT)).geometryInstances;this.geometryInstances=t,this.show=(0,l.Z)(e.show,!0),this.classificationType=(0,l.Z)(e.classificationType,w.Z.BOTH),this.debugShowBoundingVolume=(0,l.Z)(e.debugShowBoundingVolume,!1),this.debugShowShadowVolume=(0,l.Z)(e.debugShowShadowVolume,!1),this._debugShowShadowVolume=!1,this._extruded=(0,l.Z)(e._extruded,!1),this._uniformMap=e._uniformMap,this._sp=void 0,this._spStencil=void 0,this._spPick=void 0,this._spColor=void 0,this._spPick2D=void 0,this._spColor2D=void 0,this._rsStencilDepthPass=void 0,this._rsStencilDepthPass3DTiles=void 0,this._rsColorPass=void 0,this._rsPickPass=void 0,this._commandsIgnoreShow=[],this._ready=!1,this._primitive=void 0,this._pickPrimitive=e._pickPrimitive,this._hasSphericalExtentsAttribute=!1,this._hasPlanarExtentsAttributes=!1,this._hasPerColorAttribute=!1,this.appearance=e.appearance,this._createBoundingVolumeFunction=e._createBoundingVolumeFunction,this._updateAndQueueCommandsFunction=e._updateAndQueueCommandsFunction,this._usePickOffsets=!1,this._primitiveOptions={geometryInstances:void 0,appearance:void 0,vertexCacheOptimize:(0,l.Z)(e.vertexCacheOptimize,!1),interleave:(0,l.Z)(e.interleave,!1),releaseGeometryInstances:(0,l.Z)(e.releaseGeometryInstances,!0),allowPicking:(0,l.Z)(e.allowPicking,!0),asynchronous:(0,l.Z)(e.asynchronous,!0),compressVertices:(0,l.Z)(e.compressVertices,!0),_createBoundingVolumeFunction:void 0,_createRenderStatesFunction:void 0,_createShaderProgramFunction:void 0,_createCommandsFunction:void 0,_updateAndQueueCommandsFunction:void 0,_createPickOffsets:!0}}function L(e,t){let i=t?P.Z.EQUAL:P.Z.ALWAYS;return{colorMask:{red:!1,green:!1,blue:!1,alpha:!1},stencilTest:{enabled:e,frontFunction:i,frontOperation:{fail:R.Z.KEEP,zFail:R.Z.DECREMENT_WRAP,zPass:R.Z.KEEP},backFunction:i,backOperation:{fail:R.Z.KEEP,zFail:R.Z.INCREMENT_WRAP,zPass:R.Z.KEEP},reference:D.Z.CESIUM_3D_TILE_MASK,mask:D.Z.CESIUM_3D_TILE_MASK},stencilMask:D.Z.CLASSIFICATION_MASK,depthTest:{enabled:!0,func:S.Z.LESS_OR_EQUAL},depthMask:!1}}function M(e){return{stencilTest:{enabled:e,frontFunction:P.Z.NOT_EQUAL,frontOperation:{fail:R.Z.ZERO,zFail:R.Z.ZERO,zPass:R.Z.ZERO},backFunction:P.Z.NOT_EQUAL,backOperation:{fail:R.Z.ZERO,zFail:R.Z.ZERO,zPass:R.Z.ZERO},reference:0,mask:D.Z.CLASSIFICATION_MASK},stencilMask:D.Z.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1,blending:x.Z.PRE_MULTIPLIED_ALPHA_BLEND}}Object.defineProperties(N.prototype,{vertexCacheOptimize:{get:function(){return this._primitiveOptions.vertexCacheOptimize}},interleave:{get:function(){return this._primitiveOptions.interleave}},releaseGeometryInstances:{get:function(){return this._primitiveOptions.releaseGeometryInstances}},allowPicking:{get:function(){return this._primitiveOptions.allowPicking}},asynchronous:{get:function(){return this._primitiveOptions.asynchronous}},compressVertices:{get:function(){return this._primitiveOptions.compressVertices}},ready:{get:function(){return this._ready}},_needs2DShader:{get:function(){return this._hasPlanarExtentsAttributes||this._hasSphericalExtentsAttribute}}}),N.isSupported=function(e){return e.context.stencilBuffer};let F={stencilTest:{enabled:!0,frontFunction:P.Z.NOT_EQUAL,frontOperation:{fail:R.Z.ZERO,zFail:R.Z.ZERO,zPass:R.Z.ZERO},backFunction:P.Z.NOT_EQUAL,backOperation:{fail:R.Z.ZERO,zFail:R.Z.ZERO,zPass:R.Z.ZERO},reference:0,mask:D.Z.CLASSIFICATION_MASK},stencilMask:D.Z.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1};function z(e,t){return Math.floor(e%t/2)}function B(e,t,i,n,r,o){e.modelMatrix=i,e.boundingVolume=r,e.cull=n,e.debugShowBoundingVolume=o,t.commandList.push(e)}function U(e,t,i,n,r){e.modelMatrix=i,e.boundingVolume=r,e.cull=n,t.commandList.push(e)}N.prototype.update=function(e){if(!(0,c.Z)(this._primitive)&&!(0,c.Z)(this.geometryInstances))return;let t=this.appearance;(0,c.Z)(t)&&(0,c.Z)(t.material)&&t.material.update(e.context);let i=this,n=this._primitiveOptions;if(!(0,c.Z)(this._primitive)){let e,r,o,a;let s=Array.isArray(this.geometryInstances)?this.geometryInstances:[this.geometryInstances],u=s.length,f=!1,p=!0,m=!1,x=!1;for(u>0&&(o=s[0].attributes,m=O.Z.hasAttributesForSphericalExtents(o),x=O.Z.hasAttributesForTextureCoordinatePlanes(o),a=o.color),e=0;e<u;e++){let t=(r=s[e]).attributes.color;if((0,c.Z)(t))f=!0;else if(f)throw new h.Z("All GeometryInstances must have color attributes to use per-instance color.");p=p&&(0,c.Z)(t)&&_.Z.equals(a,t)}if(!p&&!m&&!x)throw new h.Z("All GeometryInstances must have the same color attribute except via GroundPrimitives");if(f&&!(0,c.Z)(t)&&(t=new C.Z({flat:!0}),this.appearance=t),!f&&t instanceof C.Z)throw new h.Z("PerInstanceColorAppearance requires color GeometryInstanceAttributes on all GeometryInstances");if((0,c.Z)(t.material)&&!m&&!x)throw new h.Z("Materials on ClassificationPrimitives are not supported except via GroundPrimitives");this._usePickOffsets=!m&&!x,this._hasSphericalExtentsAttribute=m,this._hasPlanarExtentsAttributes=x,this._hasPerColorAttribute=f;let S=Array(u);for(e=0;e<u;++e)r=s[e],S[e]=new d.Z({geometry:r.geometry,attributes:r.attributes,modelMatrix:r.modelMatrix,id:r.id,pickPrimitive:(0,l.Z)(this._pickPrimitive,i)});n.appearance=t,n.geometryInstances=S,(0,c.Z)(this._createBoundingVolumeFunction)&&(n._createBoundingVolumeFunction=function(e,t){i._createBoundingVolumeFunction(e,t)}),n._createRenderStatesFunction=function(e,t,n,r){!function(e,t,i,n){if((0,c.Z)(e._rsStencilDepthPass))return;let r=!e.debugShowShadowVolume;e._rsStencilDepthPass=b.Z.fromCache(L(r,!1)),e._rsStencilDepthPass3DTiles=b.Z.fromCache(L(r,!0)),e._rsColorPass=b.Z.fromCache(M(r,!1)),e._rsPickPass=b.Z.fromCache(F)}(i,0)},n._createShaderProgramFunction=function(e,t,n){!function(e,t){let i=t.context,n=e._primitive,r='in vec3 position3DHigh;\nin vec3 position3DLow;\nin float batchId;\n\n#ifdef EXTRUDED_GEOMETRY\nin vec3 extrudeDirection;\n\nuniform float u_globeMinimumAltitude;\n#endif // EXTRUDED_GEOMETRY\n\n#ifdef PER_INSTANCE_COLOR\nout vec4 v_color;\n#endif // PER_INSTANCE_COLOR\n\n#ifdef TEXTURE_COORDINATES\n#ifdef SPHERICAL\nout vec4 v_sphericalExtents;\n#else // SPHERICAL\nout vec2 v_inversePlaneExtents;\nout vec4 v_westPlane;\nout vec4 v_southPlane;\n#endif // SPHERICAL\nout vec3 v_uvMinAndSphericalLongitudeRotation;\nout vec3 v_uMaxAndInverseDistance;\nout vec3 v_vMaxAndInverseDistance;\n#endif // TEXTURE_COORDINATES\n\nvoid main()\n{\n vec4 position = czm_computePosition();\n\n#ifdef EXTRUDED_GEOMETRY\n float delta = min(u_globeMinimumAltitude, czm_geometricToleranceOverMeter * length(position.xyz));\n delta *= czm_sceneMode == czm_sceneMode3D ? 1.0 : 0.0;\n\n //extrudeDirection is zero for the top layer\n position = position + vec4(extrudeDirection * delta, 0.0);\n#endif\n\n#ifdef TEXTURE_COORDINATES\n#ifdef SPHERICAL\n v_sphericalExtents = czm_batchTable_sphericalExtents(batchId);\n v_uvMinAndSphericalLongitudeRotation.z = czm_batchTable_longitudeRotation(batchId);\n#else // SPHERICAL\n#ifdef COLUMBUS_VIEW_2D\n vec4 planes2D_high = czm_batchTable_planes2D_HIGH(batchId);\n vec4 planes2D_low = czm_batchTable_planes2D_LOW(batchId);\n\n // If the primitive is split across the IDL (planes2D_high.x > planes2D_high.w):\n // - If this vertex is on the east side of the IDL (position3DLow.y > 0.0, comparison with position3DHigh may produce artifacts)\n // - existing "east" is on the wrong side of the world, far away (planes2D_high/low.w)\n // - so set "east" as beyond the eastmost extent of the projection (idlSplitNewPlaneHiLow)\n vec2 idlSplitNewPlaneHiLow = vec2(EAST_MOST_X_HIGH - (WEST_MOST_X_HIGH - planes2D_high.w), EAST_MOST_X_LOW - (WEST_MOST_X_LOW - planes2D_low.w));\n bool idlSplit = planes2D_high.x > planes2D_high.w && position3DLow.y > 0.0;\n planes2D_high.w = czm_branchFreeTernary(idlSplit, idlSplitNewPlaneHiLow.x, planes2D_high.w);\n planes2D_low.w = czm_branchFreeTernary(idlSplit, idlSplitNewPlaneHiLow.y, planes2D_low.w);\n\n // - else, if this vertex is on the west side of the IDL (position3DLow.y < 0.0)\n // - existing "west" is on the wrong side of the world, far away (planes2D_high/low.x)\n // - so set "west" as beyond the westmost extent of the projection (idlSplitNewPlaneHiLow)\n idlSplit = planes2D_high.x > planes2D_high.w && position3DLow.y < 0.0;\n idlSplitNewPlaneHiLow = vec2(WEST_MOST_X_HIGH - (EAST_MOST_X_HIGH - planes2D_high.x), WEST_MOST_X_LOW - (EAST_MOST_X_LOW - planes2D_low.x));\n planes2D_high.x = czm_branchFreeTernary(idlSplit, idlSplitNewPlaneHiLow.x, planes2D_high.x);\n planes2D_low.x = czm_branchFreeTernary(idlSplit, idlSplitNewPlaneHiLow.y, planes2D_low.x);\n\n vec3 southWestCorner = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(vec3(0.0, planes2D_high.xy), vec3(0.0, planes2D_low.xy))).xyz;\n vec3 northWestCorner = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(vec3(0.0, planes2D_high.x, planes2D_high.z), vec3(0.0, planes2D_low.x, planes2D_low.z))).xyz;\n vec3 southEastCorner = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(vec3(0.0, planes2D_high.w, planes2D_high.y), vec3(0.0, planes2D_low.w, planes2D_low.y))).xyz;\n#else // COLUMBUS_VIEW_2D\n // 3D case has smaller "plane extents," so planes encoded as a 64 bit position and 2 vec3s for distances/direction\n vec3 southWestCorner = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(czm_batchTable_southWest_HIGH(batchId), czm_batchTable_southWest_LOW(batchId))).xyz;\n vec3 northWestCorner = czm_normal * czm_batchTable_northward(batchId) + southWestCorner;\n vec3 southEastCorner = czm_normal * czm_batchTable_eastward(batchId) + southWestCorner;\n#endif // COLUMBUS_VIEW_2D\n\n vec3 eastWard = southEastCorner - southWestCorner;\n float eastExtent = length(eastWard);\n eastWard /= eastExtent;\n\n vec3 northWard = northWestCorner - southWestCorner;\n float northExtent = length(northWard);\n northWard /= northExtent;\n\n v_westPlane = vec4(eastWard, -dot(eastWard, southWestCorner));\n v_southPlane = vec4(northWard, -dot(northWard, southWestCorner));\n v_inversePlaneExtents = vec2(1.0 / eastExtent, 1.0 / northExtent);\n#endif // SPHERICAL\n vec4 uvMinAndExtents = czm_batchTable_uvMinAndExtents(batchId);\n vec4 uMaxVmax = czm_batchTable_uMaxVmax(batchId);\n\n v_uMaxAndInverseDistance = vec3(uMaxVmax.xy, uvMinAndExtents.z);\n v_vMaxAndInverseDistance = vec3(uMaxVmax.zw, uvMinAndExtents.w);\n v_uvMinAndSphericalLongitudeRotation.xy = uvMinAndExtents.xy;\n#endif // TEXTURE_COORDINATES\n\n#ifdef PER_INSTANCE_COLOR\n v_color = czm_batchTable_color(batchId);\n#endif\n\n gl_Position = czm_depthClamp(czm_modelViewProjectionRelativeToEye * position);\n}\n';r=e._primitive._batchTable.getVertexShaderCallback()(r),r=A.Z._appendDistanceDisplayConditionToShader(n,r),r=A.Z._modifyShaderPosition(e,r,t.scene3DOnly),r=A.Z._updateColorAttribute(n,r);let o=e._hasPlanarExtentsAttributes,a=o||e._hasSphericalExtentsAttribute;e._extruded&&(r=function(e,t){if(!e.compressVertices)return t;if(-1!==t.search(/in\s+vec3\s+extrudeDirection;/g)){let e="compressedAttributes",i=`in vec2 ${e};`,n=` extrudeDirection = czm_octDecode(${e}, 65535.0); `,r=t;return r=r.replace(/in\s+vec3\s+extrudeDirection;/g,""),[i,"vec3 extrudeDirection;\n",r=T.Z.replaceMain(r,"czm_non_compressed_main"),`void main() { ${n} czm_non_compressed_main(); }`].join("\n")}}(n,r));let s=e._extruded?"EXTRUDED_GEOMETRY":"",l=new T.Z({defines:[s],sources:[r]}),u=new T.Z({sources:[E.Z]}),h=e._primitive._attributeLocations,d=new O.Z(a,o,e.appearance);if(e._spStencil=v.Z.replaceCache({context:i,shaderProgram:e._spStencil,vertexShaderSource:l,fragmentShaderSource:u,attributeLocations:h}),e._primitive.allowPicking){let o=T.Z.createPickVertexShaderSource(r);o=A.Z._appendShowToShader(n,o),o=A.Z._updatePickColorAttribute(o);let l=d.createPickFragmentShader(!1),u=d.createPickVertexShader([s],o,!1,t.mapProjection);if(e._spPick=v.Z.replaceCache({context:i,shaderProgram:e._spPick,vertexShaderSource:u,fragmentShaderSource:l,attributeLocations:h}),a){let n=i.shaderCache.getDerivedShaderProgram(e._spPick,"2dPick");if(!(0,c.Z)(n)){let r=d.createPickFragmentShader(!0),a=d.createPickVertexShader([s],o,!0,t.mapProjection);n=i.shaderCache.createDerivedShaderProgram(e._spPick,"2dPick",{vertexShaderSource:a,fragmentShaderSource:r,attributeLocations:h})}e._spPick2D=n}}else e._spPick=v.Z.fromCache({context:i,vertexShaderSource:l,fragmentShaderSource:u,attributeLocations:h});r=A.Z._appendShowToShader(n,r),l=new T.Z({defines:[s],sources:[r]}),e._sp=v.Z.replaceCache({context:i,shaderProgram:e._sp,vertexShaderSource:l,fragmentShaderSource:u,attributeLocations:h});let f=d.createFragmentShader(!1),p=d.createVertexShader([s],r,!1,t.mapProjection);if(e._spColor=v.Z.replaceCache({context:i,shaderProgram:e._spColor,vertexShaderSource:p,fragmentShaderSource:f,attributeLocations:h}),a){let n=i.shaderCache.getDerivedShaderProgram(e._spColor,"2dColor");if(!(0,c.Z)(n)){let o=d.createFragmentShader(!0),a=d.createVertexShader([s],r,!0,t.mapProjection);n=i.shaderCache.createDerivedShaderProgram(e._spColor,"2dColor",{vertexShaderSource:a,fragmentShaderSource:o,attributeLocations:h})}e._spColor2D=n}}(i,t)},n._createCommandsFunction=function(e,t,n,r,o,a,s){(function(e,t){let i,n,r;let o=e._primitive,a=2*o._va.length;t.length=a;let s=0,l=o._batchTable.getUniformMapCallback()(e._uniformMap),u=e._needs2DShader;for(i=0;i<a;i+=2){let a=o._va[s++];n=t[i],(0,c.Z)(n)||(n=t[i]=new Z.Z({owner:e,primitiveType:o._primitiveType})),n.vertexArray=a,n.renderState=e._rsStencilDepthPass,n.shaderProgram=e._sp,n.uniformMap=l,n.pass=y.Z.TERRAIN_CLASSIFICATION,(r=Z.Z.shallowClone(n,n.derivedCommands.tileset)).renderState=e._rsStencilDepthPass3DTiles,r.pass=y.Z.CESIUM_3D_TILE_CLASSIFICATION,n.derivedCommands.tileset=r,n=t[i+1],(0,c.Z)(n)||(n=t[i+1]=new Z.Z({owner:e,primitiveType:o._primitiveType})),n.vertexArray=a,n.renderState=e._rsColorPass,n.shaderProgram=e._spColor,n.pass=y.Z.TERRAIN_CLASSIFICATION;let h=e.appearance.material;if((0,c.Z)(h)&&(l=(0,g.Z)(l,h._uniforms)),n.uniformMap=l,(r=Z.Z.shallowClone(n,n.derivedCommands.tileset)).pass=y.Z.CESIUM_3D_TILE_CLASSIFICATION,n.derivedCommands.tileset=r,u){let t=Z.Z.shallowClone(n,n.derivedCommands.appearance2D);t.shaderProgram=e._spColor2D,n.derivedCommands.appearance2D=t,(t=Z.Z.shallowClone(r,r.derivedCommands.appearance2D)).shaderProgram=e._spColor2D,r.derivedCommands.appearance2D=t}}let h=e._commandsIgnoreShow,d=e._spStencil,f=0;a=h.length=a/2;for(let e=0;e<a;++e){let i=h[e]=Z.Z.shallowClone(t[f],h[e]);i.shaderProgram=d,i.pass=y.Z.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW,f+=2}})(i,a),function(e,t){let i,n,r,o,a;let s=e._usePickOffsets,l=e._primitive,u=2*l._va.length,h=0;s&&(u=2*(i=l._pickOffsets).length),t.length=u;let d=0,f=l._batchTable.getUniformMapCallback()(e._uniformMap),p=e._needs2DShader;for(r=0;r<u;r+=2){let u=l._va[d++];if(s&&(n=i[h++],u=l._va[n.index]),o=t[r],(0,c.Z)(o)||(o=t[r]=new Z.Z({owner:e,primitiveType:l._primitiveType,pickOnly:!0})),o.vertexArray=u,o.renderState=e._rsStencilDepthPass,o.shaderProgram=e._sp,o.uniformMap=f,o.pass=y.Z.TERRAIN_CLASSIFICATION,s&&(o.offset=n.offset,o.count=n.count),(a=Z.Z.shallowClone(o,o.derivedCommands.tileset)).renderState=e._rsStencilDepthPass3DTiles,a.pass=y.Z.CESIUM_3D_TILE_CLASSIFICATION,o.derivedCommands.tileset=a,o=t[r+1],(0,c.Z)(o)||(o=t[r+1]=new Z.Z({owner:e,primitiveType:l._primitiveType,pickOnly:!0})),o.vertexArray=u,o.renderState=e._rsPickPass,o.shaderProgram=e._spPick,o.uniformMap=f,o.pass=y.Z.TERRAIN_CLASSIFICATION,s&&(o.offset=n.offset,o.count=n.count),(a=Z.Z.shallowClone(o,o.derivedCommands.tileset)).pass=y.Z.CESIUM_3D_TILE_CLASSIFICATION,o.derivedCommands.tileset=a,p){let t=Z.Z.shallowClone(o,o.derivedCommands.pick2D);t.shaderProgram=e._spPick2D,o.derivedCommands.pick2D=t,(t=Z.Z.shallowClone(a,a.derivedCommands.pick2D)).shaderProgram=e._spPick2D,a.derivedCommands.pick2D=t}}}(i,s)},(0,c.Z)(this._updateAndQueueCommandsFunction)?n._updateAndQueueCommandsFunction=function(e,t,n,r,o,a,s,l){i._updateAndQueueCommandsFunction(e,t,n,r,o,a,s,l)}:n._updateAndQueueCommandsFunction=function(e,t,n,r,o,a,s,l){!function(e,t,i,n,r,o,a,s){let l,u,h;let d=e._primitive;A.Z._updateBoundingVolumes(d,t,r),t.mode===I.Z.SCENE3D?l=d._boundingSphereWC:t.mode===I.Z.COLUMBUS_VIEW?l=d._boundingSphereCV:t.mode===I.Z.SCENE2D&&(0,c.Z)(d._boundingSphere2D)?l=d._boundingSphere2D:(0,c.Z)(d._boundingSphereMorph)&&(l=d._boundingSphereMorph);let f=e.classificationType,p=f!==w.Z.CESIUM_3D_TILE,m=f!==w.Z.TERRAIN,_=t.passes;if(_.render){let n=i.length;for(u=0;u<n;++u)h=l[z(u,n)],p&&B(i[u],t,r,o,h,a),m&&B(i[u].derivedCommands.tileset,t,r,o,h,a);if(t.invertClassification){let i=e._commandsIgnoreShow,n=i.length;for(u=0;u<n;++u)h=l[u],B(i[u],t,r,o,h,a)}}if(_.pick){let e=n.length,i=d._pickOffsets;for(u=0;u<e;++u)h=l[i[z(u,e)].index],p&&U(n[u],t,r,o,h),m&&U(n[u].derivedCommands.tileset,t,r,o,h)}}(i,t,n,r,o,a,s,0)},this._primitive=new A.Z(n)}if(this.debugShowShadowVolume&&!this._debugShowShadowVolume&&this._ready?(this._debugShowShadowVolume=!0,this._rsStencilDepthPass=b.Z.fromCache(L(!1,!1)),this._rsStencilDepthPass3DTiles=b.Z.fromCache(L(!1,!0)),this._rsColorPass=b.Z.fromCache(M(!1))):!this.debugShowShadowVolume&&this._debugShowShadowVolume&&(this._debugShowShadowVolume=!1,this._rsStencilDepthPass=b.Z.fromCache(L(!0,!1)),this._rsStencilDepthPass3DTiles=b.Z.fromCache(L(!0,!0)),this._rsColorPass=b.Z.fromCache(M(!0))),this._primitive.appearance!==t){if(!this._hasSphericalExtentsAttribute&&!this._hasPlanarExtentsAttributes&&(0,c.Z)(t.material))throw new h.Z("Materials on ClassificationPrimitives are not supported except via GroundPrimitive");if(!this._hasPerColorAttribute&&t instanceof C.Z)throw new h.Z("PerInstanceColorAppearance requires color GeometryInstanceAttribute");this._primitive.appearance=t}this._primitive.show=this.show,this._primitive.debugShowBoundingVolume=this.debugShowBoundingVolume,this._primitive.update(e),e.afterRender.push(()=>{(0,c.Z)(this._primitive)&&this._primitive.ready&&(this._ready=!0,this.releaseGeometryInstances&&(this.geometryInstances=void 0))})},N.prototype.getGeometryInstanceAttributes=function(e){if(!(0,c.Z)(this._primitive))throw new h.Z("must call update before calling getGeometryInstanceAttributes");return this._primitive.getGeometryInstanceAttributes(e)},N.prototype.isDestroyed=function(){return!1},N.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),this._sp=this._sp&&this._sp.destroy(),this._spPick=this._spPick&&this._spPick.destroy(),this._spColor=this._spColor&&this._spColor.destroy(),this._spPick2D=void 0,this._spColor2D=void 0,(0,u.Z)(this)};let k={u_globeMinimumAltitude:function(){return 55e3}};function V(e){let t=(e=(0,l.Z)(e,l.Z.EMPTY_OBJECT)).appearance,i=e.geometryInstances;if(!(0,c.Z)(t)&&(0,c.Z)(i)){let e=Array.isArray(i)?i:[i],n=e.length;for(let i=0;i<n;i++){let n=e[i].attributes;if((0,c.Z)(n)&&(0,c.Z)(n.color)){t=new C.Z({flat:!0});break}}}this.appearance=t,this.geometryInstances=e.geometryInstances,this.show=(0,l.Z)(e.show,!0),this.classificationType=(0,l.Z)(e.classificationType,w.Z.BOTH),this.debugShowBoundingVolume=(0,l.Z)(e.debugShowBoundingVolume,!1),this.debugShowShadowVolume=(0,l.Z)(e.debugShowShadowVolume,!1),this._boundingVolumes=[],this._boundingVolumes2D=[],this._ready=!1,this._primitive=void 0,this._maxHeight=void 0,this._minHeight=void 0,this._maxTerrainHeight=n.Z._defaultMaxTerrainHeight,this._minTerrainHeight=n.Z._defaultMinTerrainHeight,this._boundingSpheresKeys=[],this._boundingSpheres=[],this._useFragmentCulling=!1,this._zIndex=void 0,this._classificationPrimitiveOptions={geometryInstances:void 0,appearance:void 0,vertexCacheOptimize:(0,l.Z)(e.vertexCacheOptimize,!1),interleave:(0,l.Z)(e.interleave,!1),releaseGeometryInstances:(0,l.Z)(e.releaseGeometryInstances,!0),allowPicking:(0,l.Z)(e.allowPicking,!0),asynchronous:(0,l.Z)(e.asynchronous,!0),compressVertices:(0,l.Z)(e.compressVertices,!0),_createBoundingVolumeFunction:void 0,_updateAndQueueCommandsFunction:void 0,_pickPrimitive:this,_extruded:!0,_uniformMap:k}}function H(e){return function(t,i){let n=i.maximumRadius;return e._maxHeight+(n/Math.cos(.5*t)-n)}}function G(e){return function(t,i){return e._minHeight}}Object.defineProperties(V.prototype,{vertexCacheOptimize:{get:function(){return this._classificationPrimitiveOptions.vertexCacheOptimize}},interleave:{get:function(){return this._classificationPrimitiveOptions.interleave}},releaseGeometryInstances:{get:function(){return this._classificationPrimitiveOptions.releaseGeometryInstances}},allowPicking:{get:function(){return this._classificationPrimitiveOptions.allowPicking}},asynchronous:{get:function(){return this._classificationPrimitiveOptions.asynchronous}},compressVertices:{get:function(){return this._classificationPrimitiveOptions.compressVertices}},ready:{get:function(){return this._ready}}}),V.isSupported=N.isSupported;let j=new o.Z,W=new o.Z,q=new o.Z,Y=new a.Z,X=new p.Z;function $(e,t){let i=e.mapProjection.ellipsoid;if(!(0,c.Z)(t.attributes)||!(0,c.Z)(t.attributes.position3DHigh))return(0,c.Z)(t.rectangle)?t.rectangle:void 0;let n=t.attributes.position3DHigh.values,r=t.attributes.position3DLow.values,a=n.length,s=Number.POSITIVE_INFINITY,l=Number.POSITIVE_INFINITY,u=Number.NEGATIVE_INFINITY,h=Number.NEGATIVE_INFINITY;for(let e=0;e<a;e+=3){let t=o.Z.unpack(n,e,j),a=o.Z.unpack(r,e,W),c=o.Z.add(t,a,q),d=i.cartesianToCartographic(c,Y),f=d.latitude,p=d.longitude;s=Math.min(s,f),l=Math.min(l,p),u=Math.max(u,f),h=Math.max(h,p)}return X.north=u,X.south=s,X.east=h,X.west=l,X}function K(e,t){return Math.floor(e%t/2)}function Q(e,t,i,n,r,o,a){let s=e._primitive;i.mode!==I.Z.SCENE3D&&t.shaderProgram===s._spColor&&s._needs2DShader&&(t=t.derivedCommands.appearance2D),t.owner=e,t.modelMatrix=n,t.boundingVolume=o,t.cull=r,t.debugShowBoundingVolume=a,i.commandList.push(t)}function J(e,t,i,n,r,o){let a=e._primitive;i.mode!==I.Z.SCENE3D&&t.shaderProgram===a._spPick&&a._needs2DShader&&(t=t.derivedCommands.pick2D),t.owner=e,t.modelMatrix=n,t.boundingVolume=o,t.cull=r,i.commandList.push(t)}V.initializeTerrainHeights=function(){return n.Z.initialize()},V.prototype.update=function(e){if(!(0,c.Z)(this._primitive)&&!(0,c.Z)(this.geometryInstances))return;if(!n.Z.initialized){if(!this.asynchronous)throw new h.Z("For synchronous GroundPrimitives, you must call GroundPrimitive.initializeTerrainHeights() and wait for the returned promise to resolve.");V.initializeTerrainHeights();return}let t=this,i=this._classificationPrimitiveOptions;if(!(0,c.Z)(this._primitive)){let a,s,l,u,_;let g=e.mapProjection.ellipsoid,Z=Array.isArray(this.geometryInstances)?this.geometryInstances:[this.geometryInstances],y=Z.length,b=Array(y);for(u=0;u<y;++u){let t=$(e,s=(a=Z[u]).geometry);(0,c.Z)(_)?(0,c.Z)(t)&&p.Z.union(_,t,_):_=p.Z.clone(t);let i=a.id;if((0,c.Z)(i)&&(0,c.Z)(t)){let e=n.Z.getBoundingSphere(t,g);this._boundingSpheresKeys.push(i),this._boundingSpheres.push(e)}if(l=s.constructor,!(0,c.Z)(l)||!(0,c.Z)(l.createShadowVolume))throw new h.Z("Not all of the geometry instances have GroundPrimitive support.")}!function(e,t,i){let r=n.Z.getMinimumMaximumHeights(t,i);e._minTerrainHeight=r.minimumTerrainHeight,e._maxTerrainHeight=r.maximumTerrainHeight}(this,_,g);let v=e.verticalExaggeration,T=e.verticalExaggerationRelativeHeight;this._minHeight=m.Z.getHeight(this._minTerrainHeight,v,T),this._maxHeight=m.Z.getHeight(this._maxTerrainHeight,v,T);let E=V._supportsMaterials(e.context);if(this._useFragmentCulling=E,E){let t;let i=!0;for(u=0;u<y;++u)if(_=$(e,s=(a=Z[u]).geometry),O.Z.shouldUseSphericalCoordinates(_)){i=!1;break}for(u=0;u<y;++u){l=(s=(a=Z[u]).geometry).constructor;let n=$(e,s),r=s.textureCoordinateRotationPoints;t=i?O.Z.getPlanarTextureCoordinateAttributes(n,r,g,e.mapProjection,this._maxHeight):O.Z.getSphericalExtentGeometryInstanceAttributes(n,r,g,e.mapProjection);let o=a.attributes;for(let e in o)o.hasOwnProperty(e)&&(t[e]=o[e]);b[u]=new d.Z({geometry:l.createShadowVolume(s,G(this),H(this)),attributes:t,id:a.id})}}else for(u=0;u<y;++u)l=(s=(a=Z[u]).geometry).constructor,b[u]=new d.Z({geometry:l.createShadowVolume(s,G(this),H(this)),attributes:a.attributes,id:a.id});i.geometryInstances=b,i.appearance=this.appearance,i._createBoundingVolumeFunction=function(e,i){!function(e,t,i){let n=t.mapProjection.ellipsoid,a=$(t,i),s=f.Z.fromRectangle(a,e._minHeight,e._maxHeight,n);if(e._boundingVolumes.push(s),!t.scene3DOnly){let i=t.mapProjection,n=r.Z.fromRectangleWithHeights2D(a,i,e._maxHeight,e._minHeight);o.Z.fromElements(n.center.z,n.center.x,n.center.y,n.center),e._boundingVolumes2D.push(n)}}(t,e,i)},i._updateAndQueueCommandsFunction=function(e,i,n,r,o,a,s,l){!function(e,t,i,n,r,o,a,s){let l,c,u;l=t.mode===I.Z.SCENE3D?e._boundingVolumes:e._boundingVolumes2D;let h=e.classificationType,d=h!==w.Z.CESIUM_3D_TILE,f=h!==w.Z.TERRAIN,p=t.passes,m=e._primitive;if(p.render){let n=i.length;for(c=0;c<n;++c)u=l[K(c,n)],d&&Q(e,i[c],t,r,o,u,a),f&&Q(e,i[c].derivedCommands.tileset,t,r,o,u,a);if(t.invertClassification){let i=m._commandsIgnoreShow,n=i.length;for(c=0;c<n;++c)u=l[c],Q(e,i[c],t,r,o,u,a)}}if(p.pick){let i;let a=n.length;for(e._useFragmentCulling||(i=m._primitive._pickOffsets),c=0;c<a;++c)u=l[K(c,a)],e._useFragmentCulling||(u=l[i[K(c,a)].index]),d&&J(e,n[c],t,r,o,u),f&&J(e,n[c].derivedCommands.tileset,t,r,o,u)}}(t,i,n,r,o,a,s,0)},this._primitive=new N(i)}this._primitive.appearance=this.appearance,this._primitive.show=this.show,this._primitive.debugShowShadowVolume=this.debugShowShadowVolume,this._primitive.debugShowBoundingVolume=this.debugShowBoundingVolume,this._primitive.update(e),e.afterRender.push(()=>{!this._ready&&(0,c.Z)(this._primitive)&&this._primitive.ready&&(this._ready=!0,this.releaseGeometryInstances&&(this.geometryInstances=void 0))})},V.prototype.getBoundingSphere=function(e){let t=this._boundingSpheresKeys.indexOf(e);if(-1!==t)return this._boundingSpheres[t]},V.prototype.getGeometryInstanceAttributes=function(e){if(!(0,c.Z)(this._primitive))throw new h.Z("must call update before calling getGeometryInstanceAttributes");return this._primitive.getGeometryInstanceAttributes(e)},V.prototype.isDestroyed=function(){return!1},V.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),(0,u.Z)(this)},V._supportsMaterials=function(e){return e.depthTexture},V.supportsMaterials=function(e){return s.Z.typeOf.object("scene",e),V._supportsMaterials(e.frameState.context)};var ee=V},9386:function(e,t,i){"use strict";i.d(t,{c1:function(){return r},lJ:function(){return o}});let n={NONE:0,CLAMP_TO_GROUND:1,RELATIVE_TO_GROUND:2,CLAMP_TO_TERRAIN:3,RELATIVE_TO_TERRAIN:4,CLAMP_TO_3D_TILE:5,RELATIVE_TO_3D_TILE:6};function r(e){return e===n.CLAMP_TO_GROUND||e===n.CLAMP_TO_3D_TILE||e===n.CLAMP_TO_TERRAIN}function o(e){return e===n.RELATIVE_TO_GROUND||e===n.RELATIVE_TO_3D_TILE||e===n.RELATIVE_TO_TERRAIN}t.ZP=Object.freeze(n)},3447:function(e,t){"use strict";t.Z=Object.freeze({TEXTURE:0,PROGRAM:1,BUFFER:2,NUMBER_OF_JOB_TYPES:3})},3547:function(e,t,i){"use strict";i.d(t,{Z:function(){return D}});var n=i(570),r=i(49),o=i(8177),a=i(2115),s=i(530),l=i(4572),c=i(9410),u=i(7998),h=i(9824),d=i(4705),f=i(3037),p=i(3186),m=i(4749),_=i(8358),g=i(9441),Z=i(4909),y=i(5483),b=i(5874),v=i(9138);function T(e){this.type=void 0,this.shaderSource=void 0,this.materials=void 0,this.uniforms=void 0,this._uniforms=void 0,this.translucent=void 0,this._minificationFilter=(0,l.Z)(e.minificationFilter,v.Z.LINEAR),this._magnificationFilter=(0,l.Z)(e.magnificationFilter,b.Z.LINEAR),this._strict=void 0,this._template=void 0,this._count=void 0,this._texturePaths={},this._loadedImages=[],this._loadedCubeMaps=[],this._textures={},this._updateFunctions=[],this._defaultTexture=void 0,function(e,t){let i;e=(0,l.Z)(e,l.Z.EMPTY_OBJECT),t._strict=(0,l.Z)(e.strict,!1),t._count=(0,l.Z)(e.count,0),t._template=(0,r.Z)((0,l.Z)(e.fabric,l.Z.EMPTY_OBJECT)),t._template.uniforms=(0,r.Z)((0,l.Z)(t._template.uniforms,l.Z.EMPTY_OBJECT)),t._template.materials=(0,r.Z)((0,l.Z)(t._template.materials,l.Z.EMPTY_OBJECT)),t.type=(0,c.Z)(t._template.type)?t._template.type:(0,s.Z)(),t.shaderSource="",t.materials={},t.uniforms={},t._uniforms={},t._translucentFunctions=[];let n=T._materialCache.getMaterial(t.type);if((0,c.Z)(n)){let e=(0,r.Z)(n.fabric,!0);t._template=(0,a.Z)(t._template,e,!0),i=n.translucent}(function(e){let t=e._template,i=t.uniforms,n=t.materials,r=t.components;if((0,c.Z)(r)&&(0,c.Z)(t.source))throw new h.Z("fabric: cannot have source and components in the same template.");E(t,S,x,!0),E(r,C,x,!0);let o=[];for(let e in n)n.hasOwnProperty(e)&&o.push(e);E(i,o,w,!1)})(t),(0,c.Z)(n)||T._materialCache.addMaterial(t.type,t),function(e){let t=e._template.components,i=e._template.source;if((0,c.Z)(i))e.shaderSource+=`${i} `;else{if(e.shaderSource+="czm_material czm_getMaterial(czm_materialInput materialInput)\n{\n",e.shaderSource+="czm_material material = czm_getDefaultMaterial(materialInput);\n",(0,c.Z)(t)){let i=Object.keys(e._template.materials).length>0;for(let n in t)if(t.hasOwnProperty(n)){if("diffuse"===n||"emission"===n){let r=i&&function(e,t){let i=t._template.materials;for(let t in i)if(i.hasOwnProperty(t)&&e.indexOf(t)>-1)return!0;return!1}(t[n],e)?t[n]:`czm_gammaCorrect(${t[n]})`;e.shaderSource+=`material.${n} = ${r}; `}else"alpha"===n?e.shaderSource+=`material.alpha = ${t.alpha}; `:e.shaderSource+=`material.${n} = ${t[n]}; `}}e.shaderSource+="return material;\n}\n"}}(t),function(e){let t=e._template.uniforms;for(let i in t)t.hasOwnProperty(i)&&function e(t,i){let n=t._strict,r=t._template.uniforms,o=r[i],a=function(e){let t=e.type;if(!(0,c.Z)(t)){let i=typeof e;if("number"===i)t="float";else if("boolean"===i)t="bool";else if("string"===i||e instanceof _.Z||e instanceof HTMLCanvasElement||e instanceof HTMLImageElement)t=/^([rgba]){1,4}$/i.test(e)?"channels":e===T.DefaultCubeMapId?"samplerCube":"sampler2D";else if("object"===i){if(Array.isArray(e))(4===e.length||9===e.length||16===e.length)&&(t=`mat${Math.sqrt(e.length)}`);else{let i=0;for(let t in e)e.hasOwnProperty(t)&&(i+=1);i>=2&&i<=4?t=`vec${i}`:6===i&&(t="samplerCube")}}}return t}(o);if(!(0,c.Z)(a))throw new h.Z(`fabric: uniform '${i}' has invalid type.`);if("channels"===a){if(0===O(t,i,o,!1)&&n)throw new h.Z(`strict: shader source does not use channels '${i}'.`)}else{if("sampler2D"===a){let n=`${i}Dimensions`;O(t,n,n,void 0)>0&&(r[n]={type:"ivec3",x:1,y:1},e(t,n))}if(!RegExp(`uniform\\s+${a}\\s+${i}\\s*;`).test(t.shaderSource)){let e=`uniform ${a} ${i};`;t.shaderSource=e+t.shaderSource}let s=`${i}_${t._count++}`;if(1===O(t,i,s)&&n)throw new h.Z(`strict: shader source does not use uniform '${i}'.`);if(t.uniforms[i]=o,"sampler2D"===a){let e;t._uniforms[s]=function(){return t._textures[i]},t._updateFunctions.push(function(t,n){let r,o;let a=t.uniforms,s=a[i],l=e!==s,u=!(0,c.Z)(s)||s===T.DefaultImageId;e=s;let h=t._textures[i];if(s instanceof HTMLVideoElement){if(s.readyState>=2){if(l&&(0,c.Z)(h)&&(h!==n.defaultTexture&&h.destroy(),h=void 0),!(0,c.Z)(h)||h===n.defaultTexture){let e=new y.Z({minificationFilter:t._minificationFilter,magnificationFilter:t._magnificationFilter});h=new Z.Z({context:n,source:s,sampler:e}),t._textures[i]=h;return}h.copyFrom({source:s})}else(0,c.Z)(h)||(t._textures[i]=n.defaultTexture);return}if(s instanceof Z.Z&&s!==h){t._texturePaths[i]=void 0;let e=t._textures[i];(0,c.Z)(e)&&e!==t._defaultTexture&&e.destroy(),t._textures[i]=s,r=`${i}Dimensions`,a.hasOwnProperty(r)&&((o=a[r]).x=s._width,o.y=s._height);return}if(l&&(0,c.Z)(h)&&u&&(h!==t._defaultTexture&&h.destroy(),h=void 0),!(0,c.Z)(h)&&(t._texturePaths[i]=void 0,h=t._textures[i]=t._defaultTexture,r=`${i}Dimensions`,a.hasOwnProperty(r)&&((o=a[r]).x=h._width,o.y=h._height)),u)return;let f=s instanceof _.Z;if(!(0,c.Z)(t._texturePaths[i])||f&&s.url!==t._texturePaths[i].url||!f&&s!==t._texturePaths[i]){if("string"==typeof s||f){let e=f?s:_.Z.createIfNeeded(s);Promise.resolve(I.test(e.url)?(0,d.Z)(e.url):e.fetchImage()).then(function(e){t._loadedImages.push({id:i,image:e})}).catch(function(){(0,c.Z)(h)&&h!==t._defaultTexture&&h.destroy(),t._textures[i]=t._defaultTexture})}else(s instanceof HTMLCanvasElement||s instanceof HTMLImageElement)&&t._loadedImages.push({id:i,image:s});t._texturePaths[i]=s}})}else if("samplerCube"===a)t._uniforms[s]=function(){return t._textures[i]},t._updateFunctions.push(function(e,t){let n=e.uniforms[i];if(n instanceof g.Z){let t=e._textures[i];t!==e._defaultTexture&&t.destroy(),e._texturePaths[i]=void 0,e._textures[i]=n;return}if((0,c.Z)(e._textures[i])||(e._texturePaths[i]=void 0,e._textures[i]=t.defaultCubeMap),n===T.DefaultCubeMapId)return;let r=n.positiveX+n.negativeX+n.positiveY+n.negativeY+n.positiveZ+n.negativeZ;r!==e._texturePaths[i]&&(Promise.all([_.Z.createIfNeeded(n.positiveX).fetchImage(),_.Z.createIfNeeded(n.negativeX).fetchImage(),_.Z.createIfNeeded(n.positiveY).fetchImage(),_.Z.createIfNeeded(n.negativeY).fetchImage(),_.Z.createIfNeeded(n.positiveZ).fetchImage(),_.Z.createIfNeeded(n.negativeZ).fetchImage()]).then(function(t){e._loadedCubeMaps.push({id:i,images:t})}),e._texturePaths[i]=r)});else if(-1!==a.indexOf("mat")){let e=new A[a];t._uniforms[s]=function(){return A[a].fromColumnMajorArray(t.uniforms[i],e)}}else t._uniforms[s]=function(){return t.uniforms[i]}}}(e,i)}(t),function(e){let t=e._strict,i=e._template.materials;for(let n in i)if(i.hasOwnProperty(n)){let r=new T({strict:t,fabric:i[n],count:e._count});e._count=r._count,e._uniforms=(0,a.Z)(e._uniforms,r._uniforms,!0),e.materials[n]=r,e._translucentFunctions=e._translucentFunctions.concat(r._translucentFunctions);let o="czm_getMaterial",s=`${o}_${e._count++}`;if(O(r,o,s),e.shaderSource=r.shaderSource+e.shaderSource,0===O(e,n,`${s}(materialInput)`)&&t)throw new h.Z(`strict: shader source does not use material '${n}'.`)}}(t);let o=0===t._translucentFunctions.length||void 0;i=(0,l.Z)(i,o),i=(0,l.Z)(e.translucent,i),(0,c.Z)(i)&&("function"==typeof i?t._translucentFunctions.push(function(){return i(t)}):t._translucentFunctions.push(i))}(e,this),Object.defineProperties(this,{type:{value:this.type,writable:!1}}),(0,c.Z)(T._uniformList[this.type])||(T._uniformList[this.type]=Object.keys(this._uniforms))}function E(e,t,i,n){if((0,c.Z)(e)){for(let r in e)if(e.hasOwnProperty(r)){let e=-1!==t.indexOf(r);(n&&!e||!n&&e)&&i(r,t)}}}function x(e,t){let i=`fabric: property name '${e}' is not valid. It should be `;for(let e=0;e<t.length;e++){let n=`'${t[e]}'`;i+=e===t.length-1?`or ${n}.`:`${n}, `}throw new h.Z(i)}function w(e,t){let i=`fabric: uniforms and materials cannot share the same property '${e}'`;throw new h.Z(i)}T._uniformList={},T.fromType=function(e,t){if(!(0,c.Z)(T._materialCache.getMaterial(e)))throw new h.Z(`material with type '${e}' does not exist.`);let i=new T({fabric:{type:e}});if((0,c.Z)(t))for(let e in t)t.hasOwnProperty(e)&&(i.uniforms[e]=t[e]);return i},T.prototype.isTranslucent=function(){if((0,c.Z)(this.translucent))return"function"==typeof this.translucent?this.translucent():this.translucent;let e=!0,t=this._translucentFunctions,i=t.length;for(let n=0;n<i;++n){let i=t[n];if(!(e="function"==typeof i?e&&i():e&&i))break}return e},T.prototype.update=function(e){let t,i;this._defaultTexture=e.defaultTexture;let n=this._loadedImages,r=n.length;for(t=0;t<r;++t){let r,o;let a=n[t];i=a.id;let s=a.image;Array.isArray(s)&&(r=s.slice(1,s.length).map(function(e){return e.bufferView}),s=s[0]);let l=new y.Z({minificationFilter:this._minificationFilter,magnificationFilter:this._magnificationFilter});o=new Z.Z((0,c.Z)(s.internalFormat)?{context:e,pixelFormat:s.internalFormat,width:s.width,height:s.height,source:{arrayBufferView:s.bufferView,mipLevels:r},sampler:l}:{context:e,source:s,sampler:l});let u=this._textures[i];(0,c.Z)(u)&&u!==this._defaultTexture&&u.destroy(),this._textures[i]=o;let h=`${i}Dimensions`;if(this.uniforms.hasOwnProperty(h)){let e=this.uniforms[h];e.x=o._width,e.y=o._height}}n.length=0;let o=this._loadedCubeMaps;for(t=0,r=o.length;t<r;++t){let n=o[t];i=n.id;let r=n.images,a=new g.Z({context:e,source:{positiveX:r[0],negativeX:r[1],positiveY:r[2],negativeY:r[3],positiveZ:r[4],negativeZ:r[5]},sampler:new y.Z({minificationFilter:this._minificationFilter,magnificationFilter:this._magnificationFilter})});this._textures[i]=a}o.length=0;let a=this._updateFunctions;for(t=0,r=a.length;t<r;++t)a[t](this,e);let s=this.materials;for(let t in s)s.hasOwnProperty(t)&&s[t].update(e)},T.prototype.isDestroyed=function(){return!1},T.prototype.destroy=function(){let e=this._textures;for(let t in e)if(e.hasOwnProperty(t)){let i=e[t];i!==this._defaultTexture&&i.destroy()}let t=this.materials;for(let e in t)t.hasOwnProperty(e)&&t[e].destroy();return(0,u.Z)(this)};let S=["type","materials","uniforms","components","source"],C=["diffuse","specular","shininess","normal","emission","alpha"],A={mat2:f.Z,mat3:p.Z,mat4:m.Z},I=/\.ktx2$/i;function O(e,t,i,n){n=(0,l.Z)(n,!0);let r=0,o=RegExp(`([\\w${n?".":""}])?`+t+"([\\w])?","g");return e.shaderSource=e.shaderSource.replace(o,function(e,t,n){return t||n?e:(r+=1,i)}),r}T._materialCache={_materials:{},addMaterial:function(e,t){this._materials[e]=t},getMaterial:function(e){return this._materials[e]}},T.DefaultImageId="czm_defaultImage",T.DefaultCubeMapId="czm_defaultCubeMap",T.ColorType="Color",T._materialCache.addMaterial(T.ColorType,{fabric:{type:T.ColorType,uniforms:{color:new o.Z(1,0,0,.5)},components:{diffuse:"color.rgb",alpha:"color.a"}},translucent:function(e){return e.uniforms.color.alpha<1}}),T.ImageType="Image",T._materialCache.addMaterial(T.ImageType,{fabric:{type:T.ImageType,uniforms:{image:T.DefaultImageId,repeat:new n.Z(1,1),color:new o.Z(1,1,1,1)},components:{diffuse:"texture(image, fract(repeat * materialInput.st)).rgb * color.rgb",alpha:"texture(image, fract(repeat * materialInput.st)).a * color.a"}},translucent:function(e){return e.uniforms.color.alpha<1}}),T.DiffuseMapType="DiffuseMap",T._materialCache.addMaterial(T.DiffuseMapType,{fabric:{type:T.DiffuseMapType,uniforms:{image:T.DefaultImageId,channels:"rgb",repeat:new n.Z(1,1)},components:{diffuse:"texture(image, fract(repeat * materialInput.st)).channels"}},translucent:!1}),T.AlphaMapType="AlphaMap",T._materialCache.addMaterial(T.AlphaMapType,{fabric:{type:T.AlphaMapType,uniforms:{image:T.DefaultImageId,channel:"a",repeat:new n.Z(1,1)},components:{alpha:"texture(image, fract(repeat * materialInput.st)).channel"}},translucent:!0}),T.SpecularMapType="SpecularMap",T._materialCache.addMaterial(T.SpecularMapType,{fabric:{type:T.SpecularMapType,uniforms:{image:T.DefaultImageId,channel:"r",repeat:new n.Z(1,1)},components:{specular:"texture(image, fract(repeat * materialInput.st)).channel"}},translucent:!1}),T.EmissionMapType="EmissionMap",T._materialCache.addMaterial(T.EmissionMapType,{fabric:{type:T.EmissionMapType,uniforms:{image:T.DefaultImageId,channels:"rgb",repeat:new n.Z(1,1)},components:{emission:"texture(image, fract(repeat * materialInput.st)).channels"}},translucent:!1}),T.BumpMapType="BumpMap",T._materialCache.addMaterial(T.BumpMapType,{fabric:{type:T.BumpMapType,uniforms:{image:T.DefaultImageId,channel:"r",strength:.8,repeat:new n.Z(1,1)},source:"uniform sampler2D image;\nuniform float strength;\nuniform vec2 repeat;\n\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\n czm_material material = czm_getDefaultMaterial(materialInput);\n\n vec2 st = materialInput.st;\n\n vec2 centerPixel = fract(repeat * st);\n float centerBump = texture(image, centerPixel).channel;\n\n float imageWidth = float(imageDimensions.x);\n vec2 rightPixel = fract(repeat * (st + vec2(1.0 / imageWidth, 0.0)));\n float rightBump = texture(image, rightPixel).channel;\n\n float imageHeight = float(imageDimensions.y);\n vec2 leftPixel = fract(repeat * (st + vec2(0.0, 1.0 / imageHeight)));\n float topBump = texture(image, leftPixel).channel;\n\n vec3 normalTangentSpace = normalize(vec3(centerBump - rightBump, centerBump - topBump, clamp(1.0 - strength, 0.1, 1.0)));\n vec3 normalEC = materialInput.tangentToEyeMatrix * normalTangentSpace;\n\n material.normal = normalEC;\n material.diffuse = vec3(0.01);\n\n return material;\n}\n"},translucent:!1}),T.NormalMapType="NormalMap",T._materialCache.addMaterial(T.NormalMapType,{fabric:{type:T.NormalMapType,uniforms:{image:T.DefaultImageId,channels:"rgb",strength:.8,repeat:new n.Z(1,1)},source:"uniform sampler2D image;\nuniform float strength;\nuniform vec2 repeat;\n\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\n czm_material material = czm_getDefaultMaterial(materialInput);\n \n vec4 textureValue = texture(image, fract(repeat * materialInput.st));\n vec3 normalTangentSpace = textureValue.channels;\n normalTangentSpace.xy = normalTangentSpace.xy * 2.0 - 1.0;\n normalTangentSpace.z = clamp(1.0 - strength, 0.1, 1.0);\n normalTangentSpace = normalize(normalTangentSpace);\n vec3 normalEC = materialInput.tangentToEyeMatrix * normalTangentSpace;\n \n material.normal = normalEC;\n \n return material;\n}\n"},translucent:!1}),T.GridType="Grid",T._materialCache.addMaterial(T.GridType,{fabric:{type:T.GridType,uniforms:{color:new o.Z(0,1,0,1),cellAlpha:.1,lineCount:new n.Z(8,8),lineThickness:new n.Z(1,1),lineOffset:new n.Z(0,0)},source:'uniform vec4 color;\nuniform float cellAlpha;\nuniform vec2 lineCount;\nuniform vec2 lineThickness;\nuniform vec2 lineOffset;\n\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\n czm_material material = czm_getDefaultMaterial(materialInput);\n\n vec2 st = materialInput.st;\n\n float scaledWidth = fract(lineCount.s * st.s - lineOffset.s);\n scaledWidth = abs(scaledWidth - floor(scaledWidth + 0.5));\n float scaledHeight = fract(lineCount.t * st.t - lineOffset.t);\n scaledHeight = abs(scaledHeight - floor(scaledHeight + 0.5));\n\n float value;\n\n // Fuzz Factor - Controls blurriness of lines\n#if (__VERSION__ == 300 || defined(GL_OES_standard_derivatives))\n const float fuzz = 1.2;\n vec2 thickness = (lineThickness * czm_pixelRatio) - 1.0;\n\n // From "3D Engine Design for Virtual Globes" by Cozzi and Ring, Listing 4.13.\n vec2 dx = abs(dFdx(st));\n vec2 dy = abs(dFdy(st));\n vec2 dF = vec2(max(dx.s, dy.s), max(dx.t, dy.t)) * lineCount;\n value = min(\n smoothstep(dF.s * thickness.s, dF.s * (fuzz + thickness.s), scaledWidth),\n smoothstep(dF.t * thickness.t, dF.t * (fuzz + thickness.t), scaledHeight));\n#else\n // If no derivatives available (IE 10?), revert to view-dependent fuzz\n const float fuzz = 0.05;\n\n vec2 range = 0.5 - (lineThickness * 0.05);\n value = min(\n 1.0 - smoothstep(range.s, range.s + fuzz, scaledWidth),\n 1.0 - smoothstep(range.t, range.t + fuzz, scaledHeight));\n#endif\n\n // Edges taken from RimLightingMaterial.glsl\n // See http://www.fundza.com/rman_shaders/surface/fake_rim/fake_rim1.html\n float dRim = 1.0 - abs(dot(materialInput.normalEC, normalize(materialInput.positionToEyeEC)));\n float sRim = smoothstep(0.8, 1.0, dRim);\n value *= (1.0 - sRim);\n\n vec4 halfColor;\n halfColor.rgb = color.rgb * 0.5;\n halfColor.a = color.a * (1.0 - ((1.0 - cellAlpha) * value));\n halfColor = czm_gammaCorrect(halfColor);\n material.diffuse = halfColor.rgb;\n material.emission = halfColor.rgb;\n material.alpha = halfColor.a;\n\n return material;\n}\n'},translucent:function(e){let t=e.uniforms;return t.color.alpha<1||t.cellAlpha<1}}),T.StripeType="Stripe",T._materialCache.addMaterial(T.StripeType,{fabric:{type:T.StripeType,uniforms:{horizontal:!0,evenColor:new o.Z(1,1,1,.5),oddColor:new o.Z(0,0,1,.5),offset:0,repeat:5},source:"uniform vec4 evenColor;\nuniform vec4 oddColor;\nuniform float offset;\nuniform float repeat;\nuniform bool horizontal;\n\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\n czm_material material = czm_getDefaultMaterial(materialInput);\n\n // Based on the Stripes Fragment Shader in the Orange Book (11.1.2)\n float coord = mix(materialInput.st.s, materialInput.st.t, float(horizontal));\n float value = fract((coord - offset) * (repeat * 0.5));\n float dist = min(value, min(abs(value - 0.5), 1.0 - value));\n\n vec4 currentColor = mix(evenColor, oddColor, step(0.5, value));\n vec4 color = czm_antialias(evenColor, oddColor, currentColor, dist);\n color = czm_gammaCorrect(color);\n\n material.diffuse = color.rgb;\n material.alpha = color.a;\n\n return material;\n}\n"},translucent:function(e){let t=e.uniforms;return t.evenColor.alpha<1||t.oddColor.alpha<1}}),T.CheckerboardType="Checkerboard",T._materialCache.addMaterial(T.CheckerboardType,{fabric:{type:T.CheckerboardType,uniforms:{lightColor:new o.Z(1,1,1,.5),darkColor:new o.Z(0,0,0,.5),repeat:new n.Z(5,5)},source:"uniform vec4 lightColor;\nuniform vec4 darkColor;\nuniform vec2 repeat;\n\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\n czm_material material = czm_getDefaultMaterial(materialInput);\n\n vec2 st = materialInput.st;\n\n // From Stefan Gustavson's Procedural Textures in GLSL in OpenGL Insights\n float b = mod(floor(repeat.s * st.s) + floor(repeat.t * st.t), 2.0); // 0.0 or 1.0\n\n // Find the distance from the closest separator (region between two colors)\n float scaledWidth = fract(repeat.s * st.s);\n scaledWidth = abs(scaledWidth - floor(scaledWidth + 0.5));\n float scaledHeight = fract(repeat.t * st.t);\n scaledHeight = abs(scaledHeight - floor(scaledHeight + 0.5));\n float value = min(scaledWidth, scaledHeight);\n\n vec4 currentColor = mix(lightColor, darkColor, b);\n vec4 color = czm_antialias(lightColor, darkColor, currentColor, value, 0.03);\n\n color = czm_gammaCorrect(color);\n material.diffuse = color.rgb;\n material.alpha = color.a;\n\n return material;\n}\n"},translucent:function(e){let t=e.uniforms;return t.lightColor.alpha<1||t.darkColor.alpha<1}}),T.DotType="Dot",T._materialCache.addMaterial(T.DotType,{fabric:{type:T.DotType,uniforms:{lightColor:new o.Z(1,1,0,.75),darkColor:new o.Z(0,1,1,.75),repeat:new n.Z(5,5)},source:"uniform vec4 lightColor;\nuniform vec4 darkColor;\nuniform vec2 repeat;\n\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\n czm_material material = czm_getDefaultMaterial(materialInput);\n\n // From Stefan Gustavson's Procedural Textures in GLSL in OpenGL Insights\n float b = smoothstep(0.3, 0.32, length(fract(repeat * materialInput.st) - 0.5)); // 0.0 or 1.0\n\n vec4 color = mix(lightColor, darkColor, b);\n color = czm_gammaCorrect(color);\n material.diffuse = color.rgb;\n material.alpha = color.a;\n\n return material;\n}\n"},translucent:function(e){let t=e.uniforms;return t.lightColor.alpha<1||t.darkColor.alpha<1}}),T.WaterType="Water",T._materialCache.addMaterial(T.WaterType,{fabric:{type:T.WaterType,uniforms:{baseWaterColor:new o.Z(.2,.3,.6,1),blendColor:new o.Z(0,1,.699,1),specularMap:T.DefaultImageId,normalMap:T.DefaultImageId,frequency:10,animationSpeed:.01,amplitude:1,specularIntensity:.5,fadeFactor:1},source:"// Thanks for the contribution Jonas\n// http://29a.ch/2012/7/19/webgl-terrain-rendering-water-fog\n\nuniform sampler2D specularMap;\nuniform sampler2D normalMap;\nuniform vec4 baseWaterColor;\nuniform vec4 blendColor;\nuniform float frequency;\nuniform float animationSpeed;\nuniform float amplitude;\nuniform float specularIntensity;\nuniform float fadeFactor;\n\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\n czm_material material = czm_getDefaultMaterial(materialInput);\n\n float time = czm_frameNumber * animationSpeed;\n\n // fade is a function of the distance from the fragment and the frequency of the waves\n float fade = max(1.0, (length(materialInput.positionToEyeEC) / 10000000000.0) * frequency * fadeFactor);\n\n float specularMapValue = texture(specularMap, materialInput.st).r;\n\n // note: not using directional motion at this time, just set the angle to 0.0;\n vec4 noise = czm_getWaterNoise(normalMap, materialInput.st * frequency, time, 0.0);\n vec3 normalTangentSpace = noise.xyz * vec3(1.0, 1.0, (1.0 / amplitude));\n\n // fade out the normal perturbation as we move further from the water surface\n normalTangentSpace.xy /= fade;\n\n // attempt to fade out the normal perturbation as we approach non water areas (low specular map value)\n normalTangentSpace = mix(vec3(0.0, 0.0, 50.0), normalTangentSpace, specularMapValue);\n\n normalTangentSpace = normalize(normalTangentSpace);\n\n // get ratios for alignment of the new normal vector with a vector perpendicular to the tangent plane\n float tsPerturbationRatio = clamp(dot(normalTangentSpace, vec3(0.0, 0.0, 1.0)), 0.0, 1.0);\n\n // fade out water effect as specular map value decreases\n material.alpha = mix(blendColor.a, baseWaterColor.a, specularMapValue) * specularMapValue;\n\n // base color is a blend of the water and non-water color based on the value from the specular map\n // may need a uniform blend factor to better control this\n material.diffuse = mix(blendColor.rgb, baseWaterColor.rgb, specularMapValue);\n\n // diffuse highlights are based on how perturbed the normal is\n material.diffuse += (0.1 * tsPerturbationRatio);\n\n material.diffuse = material.diffuse;\n\n material.normal = normalize(materialInput.tangentToEyeMatrix * normalTangentSpace);\n\n material.specular = specularIntensity;\n material.shininess = 10.0;\n\n return material;\n}\n"},translucent:function(e){let t=e.uniforms;return t.baseWaterColor.alpha<1||t.blendColor.alpha<1}}),T.RimLightingType="RimLighting",T._materialCache.addMaterial(T.RimLightingType,{fabric:{type:T.RimLightingType,uniforms:{color:new o.Z(1,0,0,.7),rimColor:new o.Z(1,1,1,.4),width:.3},source:"uniform vec4 color;\nuniform vec4 rimColor;\nuniform float width;\n\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\n czm_material material = czm_getDefaultMaterial(materialInput);\n\n // See http://www.fundza.com/rman_shaders/surface/fake_rim/fake_rim1.html\n float d = 1.0 - dot(materialInput.normalEC, normalize(materialInput.positionToEyeEC));\n float s = smoothstep(1.0 - width, 1.0, d);\n\n vec4 outColor = czm_gammaCorrect(color);\n vec4 outRimColor = czm_gammaCorrect(rimColor);\n\n material.diffuse = outColor.rgb;\n material.emission = outRimColor.rgb * s;\n material.alpha = mix(outColor.a, outRimColor.a, s);\n\n return material;\n}\n"},translucent:function(e){let t=e.uniforms;return t.color.alpha<1||t.rimColor.alpha<1}}),T.FadeType="Fade",T._materialCache.addMaterial(T.FadeType,{fabric:{type:T.FadeType,uniforms:{fadeInColor:new o.Z(1,0,0,1),fadeOutColor:new o.Z(0,0,0,0),maximumDistance:.5,repeat:!0,fadeDirection:{x:!0,y:!0},time:new n.Z(.5,.5)},source:"uniform vec4 fadeInColor;\nuniform vec4 fadeOutColor;\nuniform float maximumDistance;\nuniform bool repeat;\nuniform vec2 fadeDirection;\nuniform vec2 time;\n\nfloat getTime(float t, float coord)\n{\n float scalar = 1.0 / maximumDistance;\n float q = distance(t, coord) * scalar;\n if (repeat)\n {\n float r = distance(t, coord + 1.0) * scalar;\n float s = distance(t, coord - 1.0) * scalar;\n q = min(min(r, s), q);\n }\n return clamp(q, 0.0, 1.0);\n}\n\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\n czm_material material = czm_getDefaultMaterial(materialInput);\n\n vec2 st = materialInput.st;\n float s = getTime(time.x, st.s) * fadeDirection.s;\n float t = getTime(time.y, st.t) * fadeDirection.t;\n\n float u = length(vec2(s, t));\n vec4 color = mix(fadeInColor, fadeOutColor, u);\n\n color = czm_gammaCorrect(color);\n material.emission = color.rgb;\n material.alpha = color.a;\n\n return material;\n}\n"},translucent:function(e){let t=e.uniforms;return t.fadeInColor.alpha<1||t.fadeOutColor.alpha<1}}),T.PolylineArrowType="PolylineArrow",T._materialCache.addMaterial(T.PolylineArrowType,{fabric:{type:T.PolylineArrowType,uniforms:{color:new o.Z(1,1,1,1)},source:"uniform vec4 color;\n\nfloat getPointOnLine(vec2 p0, vec2 p1, float x)\n{\n float slope = (p0.y - p1.y) / (p0.x - p1.x);\n return slope * (x - p0.x) + p0.y;\n}\n\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\n czm_material material = czm_getDefaultMaterial(materialInput);\n\n vec2 st = materialInput.st;\n\n#if (__VERSION__ == 300 || defined(GL_OES_standard_derivatives))\n float base = 1.0 - abs(fwidth(st.s)) * 10.0 * czm_pixelRatio;\n#else\n // If no derivatives available (IE 10?), 2.5% of the line will be the arrow head\n float base = 0.975;\n#endif\n\n vec2 center = vec2(1.0, 0.5);\n float ptOnUpperLine = getPointOnLine(vec2(base, 1.0), center, st.s);\n float ptOnLowerLine = getPointOnLine(vec2(base, 0.0), center, st.s);\n\n float halfWidth = 0.15;\n float s = step(0.5 - halfWidth, st.t);\n s *= 1.0 - step(0.5 + halfWidth, st.t);\n s *= 1.0 - step(base, st.s);\n\n float t = step(base, materialInput.st.s);\n t *= 1.0 - step(ptOnUpperLine, st.t);\n t *= step(ptOnLowerLine, st.t);\n\n // Find the distance from the closest separator (region between two colors)\n float dist;\n if (st.s < base)\n {\n float d1 = abs(st.t - (0.5 - halfWidth));\n float d2 = abs(st.t - (0.5 + halfWidth));\n dist = min(d1, d2);\n }\n else\n {\n float d1 = czm_infinity;\n if (st.t < 0.5 - halfWidth && st.t > 0.5 + halfWidth)\n {\n d1 = abs(st.s - base);\n }\n float d2 = abs(st.t - ptOnUpperLine);\n float d3 = abs(st.t - ptOnLowerLine);\n dist = min(min(d1, d2), d3);\n }\n\n vec4 outsideColor = vec4(0.0);\n vec4 currentColor = mix(outsideColor, color, clamp(s + t, 0.0, 1.0));\n vec4 outColor = czm_antialias(outsideColor, color, currentColor, dist);\n\n outColor = czm_gammaCorrect(outColor);\n material.diffuse = outColor.rgb;\n material.alpha = outColor.a;\n return material;\n}\n"},translucent:!0}),T.PolylineDashType="PolylineDash",T._materialCache.addMaterial(T.PolylineDashType,{fabric:{type:T.PolylineDashType,uniforms:{color:new o.Z(1,0,1,1),gapColor:new o.Z(0,0,0,0),dashLength:16,dashPattern:255},source:"uniform vec4 color;\nuniform vec4 gapColor;\nuniform float dashLength;\nuniform float dashPattern;\nin float v_polylineAngle;\n\nconst float maskLength = 16.0;\n\nmat2 rotate(float rad) {\n float c = cos(rad);\n float s = sin(rad);\n return mat2(\n c, s,\n -s, c\n );\n}\n\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\n czm_material material = czm_getDefaultMaterial(materialInput);\n\n vec2 pos = rotate(v_polylineAngle) * gl_FragCoord.xy;\n\n // Get the relative position within the dash from 0 to 1\n float dashPosition = fract(pos.x / (dashLength * czm_pixelRatio));\n // Figure out the mask index.\n float maskIndex = floor(dashPosition * maskLength);\n // Test the bit mask.\n float maskTest = floor(dashPattern / pow(2.0, maskIndex));\n vec4 fragColor = (mod(maskTest, 2.0) < 1.0) ? gapColor : color;\n if (fragColor.a < 0.005) { // matches 0/255 and 1/255\n discard;\n }\n\n fragColor = czm_gammaCorrect(fragColor);\n material.emission = fragColor.rgb;\n material.alpha = fragColor.a;\n return material;\n}\n"},translucent:!0}),T.PolylineGlowType="PolylineGlow",T._materialCache.addMaterial(T.PolylineGlowType,{fabric:{type:T.PolylineGlowType,uniforms:{color:new o.Z(0,.5,1,1),glowPower:.25,taperPower:1},source:"uniform vec4 color;\nuniform float glowPower;\nuniform float taperPower;\n\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\n czm_material material = czm_getDefaultMaterial(materialInput);\n\n vec2 st = materialInput.st;\n float glow = glowPower / abs(st.t - 0.5) - (glowPower / 0.5);\n\n if (taperPower <= 0.99999) {\n glow *= min(1.0, taperPower / (0.5 - st.s * 0.5) - (taperPower / 0.5));\n }\n\n vec4 fragColor;\n fragColor.rgb = max(vec3(glow - 1.0 + color.rgb), color.rgb);\n fragColor.a = clamp(0.0, 1.0, glow) * color.a;\n fragColor = czm_gammaCorrect(fragColor);\n\n material.emission = fragColor.rgb;\n material.alpha = fragColor.a;\n\n return material;\n}\n"},translucent:!0}),T.PolylineOutlineType="PolylineOutline",T._materialCache.addMaterial(T.PolylineOutlineType,{fabric:{type:T.PolylineOutlineType,uniforms:{color:new o.Z(1,1,1,1),outlineColor:new o.Z(1,0,0,1),outlineWidth:1},source:"uniform vec4 color;\nuniform vec4 outlineColor;\nuniform float outlineWidth;\n\nin float v_width;\n\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\n czm_material material = czm_getDefaultMaterial(materialInput);\n\n vec2 st = materialInput.st;\n float halfInteriorWidth = 0.5 * (v_width - outlineWidth) / v_width;\n float b = step(0.5 - halfInteriorWidth, st.t);\n b *= 1.0 - step(0.5 + halfInteriorWidth, st.t);\n\n // Find the distance from the closest separator (region between two colors)\n float d1 = abs(st.t - (0.5 - halfInteriorWidth));\n float d2 = abs(st.t - (0.5 + halfInteriorWidth));\n float dist = min(d1, d2);\n\n vec4 currentColor = mix(outlineColor, color, b);\n vec4 outColor = czm_antialias(outlineColor, color, currentColor, dist);\n outColor = czm_gammaCorrect(outColor);\n\n material.diffuse = outColor.rgb;\n material.alpha = outColor.a;\n\n return material;\n}\n"},translucent:function(e){let t=e.uniforms;return t.color.alpha<1||t.outlineColor.alpha<1}}),T.ElevationContourType="ElevationContour",T._materialCache.addMaterial(T.ElevationContourType,{fabric:{type:T.ElevationContourType,uniforms:{spacing:100,color:new o.Z(1,0,0,1),width:1},source:"uniform vec4 color;\nuniform float spacing;\nuniform float width;\n\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\n czm_material material = czm_getDefaultMaterial(materialInput);\n\n float distanceToContour = mod(materialInput.height, spacing);\n\n#if (__VERSION__ == 300 || defined(GL_OES_standard_derivatives))\n float dxc = abs(dFdx(materialInput.height));\n float dyc = abs(dFdy(materialInput.height));\n float dF = max(dxc, dyc) * czm_pixelRatio * width;\n float alpha = (distanceToContour < dF) ? 1.0 : 0.0;\n#else\n // If no derivatives available (IE 10?), use pixel ratio\n float alpha = (distanceToContour < (czm_pixelRatio * width)) ? 1.0 : 0.0;\n#endif\n\n vec4 outColor = czm_gammaCorrect(vec4(color.rgb, alpha * color.a));\n material.diffuse = outColor.rgb;\n material.alpha = outColor.a;\n\n return material;\n}\n"},translucent:!1}),T.ElevationRampType="ElevationRamp",T._materialCache.addMaterial(T.ElevationRampType,{fabric:{type:T.ElevationRampType,uniforms:{image:T.DefaultImageId,minimumHeight:0,maximumHeight:1e4},source:"uniform sampler2D image;\nuniform float minimumHeight;\nuniform float maximumHeight;\n\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\n czm_material material = czm_getDefaultMaterial(materialInput);\n float scaledHeight = clamp((materialInput.height - minimumHeight) / (maximumHeight - minimumHeight), 0.0, 1.0);\n vec4 rampColor = texture(image, vec2(scaledHeight, 0.5));\n rampColor = czm_gammaCorrect(rampColor);\n material.diffuse = rampColor.rgb;\n material.alpha = rampColor.a;\n return material;\n}\n"},translucent:!1}),T.SlopeRampMaterialType="SlopeRamp",T._materialCache.addMaterial(T.SlopeRampMaterialType,{fabric:{type:T.SlopeRampMaterialType,uniforms:{image:T.DefaultImageId},source:"uniform sampler2D image;\n\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\n czm_material material = czm_getDefaultMaterial(materialInput);\n vec4 rampColor = texture(image, vec2(materialInput.slope / (czm_pi / 2.0), 0.5));\n rampColor = czm_gammaCorrect(rampColor);\n material.diffuse = rampColor.rgb;\n material.alpha = rampColor.a;\n return material;\n}\n"},translucent:!1}),T.AspectRampMaterialType="AspectRamp",T._materialCache.addMaterial(T.AspectRampMaterialType,{fabric:{type:T.AspectRampMaterialType,uniforms:{image:T.DefaultImageId},source:"uniform sampler2D image;\n\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\n czm_material material = czm_getDefaultMaterial(materialInput);\n vec4 rampColor = texture(image, vec2(materialInput.aspect / (2.0 * czm_pi), 0.5));\n rampColor = czm_gammaCorrect(rampColor);\n material.diffuse = rampColor.rgb;\n material.alpha = rampColor.a;\n return material;\n}\n"},translucent:!1}),T.ElevationBandType="ElevationBand",T._materialCache.addMaterial(T.ElevationBandType,{fabric:{type:T.ElevationBandType,uniforms:{heights:T.DefaultImageId,colors:T.DefaultImageId},source:"uniform sampler2D heights;\nuniform sampler2D colors;\n\n// This material expects heights to be sorted from lowest to highest.\n\nfloat getHeight(int idx, float invTexSize)\n{\n vec2 uv = vec2((float(idx) + 0.5) * invTexSize, 0.5);\n#ifdef OES_texture_float\n return texture(heights, uv).x;\n#else\n return czm_unpackFloat(texture(heights, uv));\n#endif\n}\n\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\n czm_material material = czm_getDefaultMaterial(materialInput);\n\n float height = materialInput.height;\n float invTexSize = 1.0 / float(heightsDimensions.x);\n\n float minHeight = getHeight(0, invTexSize);\n float maxHeight = getHeight(heightsDimensions.x - 1, invTexSize);\n\n // early-out when outside the height range\n if (height < minHeight || height > maxHeight) {\n material.diffuse = vec3(0.0);\n material.alpha = 0.0;\n return material;\n }\n\n // Binary search to find heights above and below.\n int idxBelow = 0;\n int idxAbove = heightsDimensions.x;\n float heightBelow = minHeight;\n float heightAbove = maxHeight;\n\n // while loop not allowed, so use for loop with max iterations.\n // maxIterations of 16 supports a texture size up to 65536 (2^16).\n const int maxIterations = 16;\n for (int i = 0; i < maxIterations; i++) {\n if (idxBelow >= idxAbove - 1) {\n break;\n }\n\n int idxMid = (idxBelow + idxAbove) / 2;\n float heightTex = getHeight(idxMid, invTexSize);\n\n if (height > heightTex) {\n idxBelow = idxMid;\n heightBelow = heightTex;\n } else {\n idxAbove = idxMid;\n heightAbove = heightTex;\n }\n }\n\n float lerper = heightBelow == heightAbove ? 1.0 : (height - heightBelow) / (heightAbove - heightBelow);\n vec2 colorUv = vec2(invTexSize * (float(idxBelow) + 0.5 + lerper), 0.5);\n vec4 color = texture(colors, colorUv);\n\n // undo preumultiplied alpha\n if (color.a > 0.0) \n {\n color.rgb /= color.a;\n }\n \n color.rgb = czm_gammaCorrect(color.rgb);\n\n material.diffuse = color.rgb;\n material.alpha = color.a;\n return material;\n}\n"},translucent:!0});var D=T},9508:function(e,t,i){"use strict";var n=i(2150),r=i(698),o=i(7559),a=i(9824),s=i(894);let l={INT8:"INT8",UINT8:"UINT8",INT16:"INT16",UINT16:"UINT16",INT32:"INT32",UINT32:"UINT32",INT64:"INT64",UINT64:"UINT64",FLOAT32:"FLOAT32",FLOAT64:"FLOAT64"};l.getMinimum=function(e){switch(r.Z.typeOf.string("type",e),e){case l.INT8:return -128;case l.UINT8:return 0;case l.INT16:return -32768;case l.UINT16:return 0;case l.INT32:return -2147483648;case l.UINT32:return 0;case l.INT64:if(s.Z.supportsBigInt())return BigInt("-9223372036854775808");return -0x8000000000000000;case l.UINT64:if(s.Z.supportsBigInt())return BigInt(0);return 0;case l.FLOAT32:return -34028234663852886e22;case l.FLOAT64:return-Number.MAX_VALUE}},l.getMaximum=function(e){switch(r.Z.typeOf.string("type",e),e){case l.INT8:return 127;case l.UINT8:return 255;case l.INT16:return 32767;case l.UINT16:return 65535;case l.INT32:return 2147483647;case l.UINT32:return 4294967295;case l.INT64:if(s.Z.supportsBigInt())return BigInt("9223372036854775807");return 0x7fffffffffffffff-1;case l.UINT64:if(s.Z.supportsBigInt())return BigInt("18446744073709551615");return 18446744073709552e3-1;case l.FLOAT32:return 34028234663852886e22;case l.FLOAT64:return Number.MAX_VALUE}},l.isIntegerType=function(e){switch(r.Z.typeOf.string("type",e),e){case l.INT8:case l.UINT8:case l.INT16:case l.UINT16:case l.INT32:case l.UINT32:case l.INT64:case l.UINT64:return!0;default:return!1}},l.isUnsignedIntegerType=function(e){switch(r.Z.typeOf.string("type",e),e){case l.UINT8:case l.UINT16:case l.UINT32:case l.UINT64:return!0;default:return!1}},l.isVectorCompatible=function(e){switch(r.Z.typeOf.string("type",e),e){case l.INT8:case l.UINT8:case l.INT16:case l.UINT16:case l.INT32:case l.UINT32:case l.FLOAT32:case l.FLOAT64:return!0;default:return!1}},l.normalize=function(e,t){if("number"!=typeof e&&"bigint"!=typeof e)throw new a.Z("value must be a number or a BigInt");if(!l.isIntegerType(t))throw new a.Z("type must be an integer type");return Math.max(Number(e)/Number(l.getMaximum(t)),-1)},l.unnormalize=function(e,t){if(r.Z.typeOf.number("value",e),!l.isIntegerType(t))throw new a.Z("type must be an integer type");let i=l.getMaximum(t),o=l.isUnsignedIntegerType(t)?0:-i;return(e=n.Z.sign(e)*Math.round(Math.abs(e)*Number(i)),(t===l.INT64||t===l.UINT64)&&s.Z.supportsBigInt()&&(e=BigInt(e)),e>i)?i:e<o?o:e},l.applyValueTransform=function(e,t,i){return i*e+t},l.unapplyValueTransform=function(e,t,i){return 0===i?0:(e-t)/i},l.getSizeInBytes=function(e){switch(r.Z.typeOf.string("type",e),e){case l.INT8:case l.UINT8:return 1;case l.INT16:case l.UINT16:return 2;case l.INT32:case l.UINT32:return 4;case l.INT64:case l.UINT64:return 8;case l.FLOAT32:return 4;case l.FLOAT64:return 8}},l.fromComponentDatatype=function(e){switch(r.Z.typeOf.number("componentDatatype",e),e){case o.Z.BYTE:return l.INT8;case o.Z.UNSIGNED_BYTE:return l.UINT8;case o.Z.SHORT:return l.INT16;case o.Z.UNSIGNED_SHORT:return l.UINT16;case o.Z.INT:return l.INT32;case o.Z.UNSIGNED_INT:return l.UINT32;case o.Z.FLOAT:return l.FLOAT32;case o.Z.DOUBLE:return l.FLOAT64}},l.toComponentDatatype=function(e){switch(r.Z.typeOf.string("type",e),e){case l.INT8:return o.Z.BYTE;case l.UINT8:return o.Z.UNSIGNED_BYTE;case l.INT16:return o.Z.SHORT;case l.UINT16:return o.Z.UNSIGNED_SHORT;case l.INT32:return o.Z.INT;case l.UINT32:return o.Z.UNSIGNED_INT;case l.FLOAT32:return o.Z.FLOAT;case l.FLOAT64:return o.Z.DOUBLE}},t.Z=Object.freeze(l)},9337:function(e,t,i){"use strict";var n=i(698),r=i(570),o=i(1486),a=i(3065),s=i(9824),l=i(3037),c=i(3186),u=i(4749);let h={SCALAR:"SCALAR",VEC2:"VEC2",VEC3:"VEC3",VEC4:"VEC4",MAT2:"MAT2",MAT3:"MAT3",MAT4:"MAT4",BOOLEAN:"BOOLEAN",STRING:"STRING",ENUM:"ENUM"};h.isVectorType=function(e){switch(n.Z.typeOf.string("type",e),e){case h.VEC2:case h.VEC3:case h.VEC4:return!0;default:return!1}},h.isMatrixType=function(e){switch(n.Z.typeOf.string("type",e),e){case h.MAT2:case h.MAT3:case h.MAT4:return!0;default:return!1}},h.getComponentCount=function(e){switch(n.Z.typeOf.string("type",e),e){case h.SCALAR:case h.STRING:case h.ENUM:case h.BOOLEAN:return 1;case h.VEC2:return 2;case h.VEC3:return 3;case h.VEC4:case h.MAT2:return 4;case h.MAT3:return 9;case h.MAT4:return 16;default:throw new s.Z(`Invalid metadata type ${e}`)}},h.getMathType=function(e){switch(e){case h.VEC2:return r.Z;case h.VEC3:return o.Z;case h.VEC4:return a.Z;case h.MAT2:return l.Z;case h.MAT3:return c.Z;case h.MAT4:return u.Z;default:return}},t.Z=Object.freeze(h)},6176:function(e,t){"use strict";let i={MODIFY_MATERIAL:"MODIFY_MATERIAL",REPLACE_MATERIAL:"REPLACE_MATERIAL"};i.getDefineName=function(e){return`CUSTOM_SHADER_${e}`},t.Z=Object.freeze(i)},7972:function(e,t){"use strict";t.Z=Object.freeze({INHERIT:0,OPAQUE:1,TRANSLUCENT:2})},5986:function(e,t,i){"use strict";i.d(t,{Z:function(){return N}});var n=i(1486),r=i(7559),o=i(9410),a=i(7998),s=i(2198),l=i(5837),c=i(4705),u=i(6055),h=i(9780),d=i(2598),f=i(1295),p=i(9441),m=i(5463),_=i(9698),g=i(8516),Z=i(4909),y=i(6450);function b(e){this._url=e,this._cubeMapBuffers=void 0,this._cubeMaps=void 0,this._texture=void 0,this._mipTextures=void 0,this._va=void 0,this._sp=void 0,this._maximumMipmapLevel=void 0,this._loading=!1,this._ready=!1,this._errorEvent=new s.Z}Object.defineProperties(b.prototype,{url:{get:function(){return this._url}},errorEvent:{get:function(){return this._errorEvent}},texture:{get:function(){return this._texture}},maximumMipmapLevel:{get:function(){return this._maximumMipmapLevel}},ready:{get:function(){return this._ready}}}),b.isSupported=function(e){return e.colorBufferHalfFloat&&e.halfFloatingPointTexture||e.floatingPointTexture&&e.colorBufferFloat};let v=new n.Z(1,0,0),T=new n.Z(0,0,1),E=new n.Z(-1,0,0),x=new n.Z(0,0,-1),w=new n.Z(0,1,0),S=[w,E,T,new n.Z(0,-1,0),v,w,x,w,w],C=S.length,A=new Float32Array(3*C),I=0;for(let e=0;e<C;++e,I+=3)n.Z.pack(S[e],A,I);let O=new Float32Array([-1,1,-1,0,0,1,0,0,1,0,1,1,0,-1,-1,-1,1,-1]),D=new Uint16Array([0,1,2,2,3,1,7,6,1,3,6,1,2,5,4,3,4,2,4,8,6,3,4,6]);function P(e){return function(){return e}}function R(e){let t,i;e._va=e._va&&e._va.destroy(),e._sp=e._sp&&e._sp.destroy();let n=e._cubeMaps;if((0,o.Z)(n))for(t=0,i=n.length;t<i;++t)n[t].destroy();let r=e._mipTextures;if((0,o.Z)(r))for(t=0,i=r.length;t<i;++t)r[t].destroy();e._va=void 0,e._sp=void 0,e._cubeMaps=void 0,e._cubeMapBuffers=void 0,e._mipTextures=void 0}b.prototype.update=function(e){let t=e.context;if(!b.isSupported(t)||((0,o.Z)(this._texture)&&(0,o.Z)(this._va)&&R(this),(0,o.Z)(this._texture)))return;if(!(0,o.Z)(this._texture)&&!this._loading){let t=e.context.textureCache.getTexture(this._url);(0,o.Z)(t)&&(R(this),this._texture=t,this._maximumMipmapLevel=this._texture.maximumMipmapLevel,this._ready=!0)}let i=this._cubeMapBuffers;if(!(0,o.Z)(i)&&!this._loading){let e=this;(0,c.Z)(this._url).then(function(t){e._cubeMapBuffers=t,e._loading=!1}).catch(function(t){e.isDestroyed()||e._errorEvent.raiseEvent(t)}),this._loading=!0}if(!(0,o.Z)(this._cubeMapBuffers))return;let n=[],a=i[0].positiveX.pixelDatatype;(0,o.Z)(a)?n.push("RGBA_NORMALIZED"):a=t.halfFloatingPointTexture?m.Z.HALF_FLOAT:m.Z.FLOAT;let s=u.Z.RGBA,v=new g.Z({defines:n,sources:["in vec3 v_cubeMapCoordinates;\nuniform samplerCube cubeMap;\n\nvoid main()\n{\n vec4 rgba = czm_textureCube(cubeMap, v_cubeMapCoordinates);\n #ifdef RGBA_NORMALIZED\n out_FragColor = vec4(rgba.rgb, 1.0);\n #else\n float m = rgba.a * 16.0;\n vec3 r = rgba.rgb * m;\n out_FragColor = vec4(r * r, 1.0);\n #endif\n}\n"]});this._va=function(e){let t=h.Z.createVertexBuffer({context:e,typedArray:O,usage:d.Z.STATIC_DRAW}),i=h.Z.createVertexBuffer({context:e,typedArray:A,usage:d.Z.STATIC_DRAW}),n=h.Z.createIndexBuffer({context:e,typedArray:D,usage:d.Z.STATIC_DRAW,indexDatatype:l.Z.UNSIGNED_SHORT}),o=[{index:0,vertexBuffer:t,componentsPerAttribute:2,componentDatatype:r.Z.FLOAT},{index:1,vertexBuffer:i,componentsPerAttribute:3,componentDatatype:r.Z.FLOAT}];return new y.Z({context:e,attributes:o,indexBuffer:n})}(t),this._sp=_.Z.fromCache({context:t,vertexShaderSource:"in vec4 position;\nin vec3 cubeMapCoordinates;\n\nout vec3 v_cubeMapCoordinates;\n\nvoid main()\n{\n gl_Position = position;\n v_cubeMapCoordinates = cubeMapCoordinates;\n}\n",fragmentShaderSource:v,attributeLocations:{position:0,cubeMapCoordinates:1}});let T=Math.min(i.length,6);this._maximumMipmapLevel=T-1;let E=this._cubeMaps=Array(T),x=this._mipTextures=Array(T),w=2*i[0].positiveX.width,S={originalSize:function(){return w}};for(let n=0;n<T;++n){let r=i[n].positiveY;i[n].positiveY=i[n].negativeY,i[n].negativeY=r;let o=E[n]=new p.Z({context:t,source:i[n],pixelDatatype:a}),l=2*E[n].width,c=x[n]=new Z.Z({context:t,width:l,height:l,pixelDatatype:a,pixelFormat:s}),u=new f.Z({vertexArray:this._va,shaderProgram:this._sp,uniformMap:{cubeMap:P(o)},outputTexture:c,persists:!0,owner:this});e.commandList.push(u),S[`texture${n}`]=P(c)}this._texture=new Z.Z({context:t,width:1.5*w+2,height:w,pixelDatatype:a,pixelFormat:s}),this._texture.maximumMipmapLevel=this._maximumMipmapLevel,t.textureCache.addTexture(this._url,this._texture);let C=new f.Z({fragmentShaderSource:"in vec2 v_textureCoordinates;\n\nuniform float originalSize;\nuniform sampler2D texture0;\nuniform sampler2D texture1;\nuniform sampler2D texture2;\nuniform sampler2D texture3;\nuniform sampler2D texture4;\nuniform sampler2D texture5;\n\nconst float yMipLevel1 = 1.0 - (1.0 / pow(2.0, 1.0));\nconst float yMipLevel2 = 1.0 - (1.0 / pow(2.0, 2.0));\nconst float yMipLevel3 = 1.0 - (1.0 / pow(2.0, 3.0));\nconst float yMipLevel4 = 1.0 - (1.0 / pow(2.0, 4.0));\n\nvoid main()\n{\n vec2 uv = v_textureCoordinates;\n vec2 textureSize = vec2(originalSize * 1.5 + 2.0, originalSize);\n vec2 pixel = 1.0 / textureSize;\n\n float mipLevel = 0.0;\n\n if (uv.x - pixel.x > (textureSize.y / textureSize.x))\n {\n mipLevel = 1.0;\n if (uv.y - pixel.y > yMipLevel1)\n {\n mipLevel = 2.0;\n if (uv.y - pixel.y * 3.0 > yMipLevel2)\n {\n mipLevel = 3.0;\n if (uv.y - pixel.y * 5.0 > yMipLevel3)\n {\n mipLevel = 4.0;\n if (uv.y - pixel.y * 7.0 > yMipLevel4)\n {\n mipLevel = 5.0;\n }\n }\n }\n }\n }\n\n if (mipLevel > 0.0)\n {\n float scale = pow(2.0, mipLevel);\n\n uv.y -= (pixel.y * (mipLevel - 1.0) * 2.0);\n uv.x *= ((textureSize.x - 2.0) / textureSize.y);\n\n uv.x -= 1.0 + pixel.x;\n uv.y -= (1.0 - (1.0 / pow(2.0, mipLevel - 1.0)));\n uv *= scale;\n }\n else\n {\n uv.x *= (textureSize.x / textureSize.y);\n }\n\n if(mipLevel == 0.0)\n {\n out_FragColor = texture(texture0, uv);\n }\n else if(mipLevel == 1.0)\n {\n out_FragColor = texture(texture1, uv);\n }\n else if(mipLevel == 2.0)\n {\n out_FragColor = texture(texture2, uv);\n }\n else if(mipLevel == 3.0)\n {\n out_FragColor = texture(texture3, uv);\n }\n else if(mipLevel == 4.0)\n {\n out_FragColor = texture(texture4, uv);\n }\n else if(mipLevel == 5.0)\n {\n out_FragColor = texture(texture5, uv);\n }\n else\n {\n out_FragColor = vec4(0.0);\n }\n}\n",uniformMap:S,outputTexture:this._texture,persists:!1,owner:this});e.commandList.push(C),this._ready=!0},b.prototype.isDestroyed=function(){return!1},b.prototype.destroy=function(){return R(this),this._texture=this._texture&&this._texture.destroy(),(0,a.Z)(this)};var N=b},9250:function(e,t,i){"use strict";i.d(t,{Z:function(){return l}});var n=i(4572),r=i(4915),o=i(4324),a=i(7761);function s(e){e=(0,n.Z)(e,n.Z.EMPTY_OBJECT);let t=(0,n.Z)(e.translucent,!0),i=(0,n.Z)(e.closed,!1),r=(0,n.Z)(e.flat,!1),l=r?o.Z:"in vec3 v_positionEC;\nin vec3 v_normalEC;\nin vec4 v_color;\n\nvoid main()\n{\n vec3 positionToEyeEC = -v_positionEC;\n\n vec3 normalEC = normalize(v_normalEC);\n#ifdef FACE_FORWARD\n normalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC);\n#endif\n\n vec4 color = czm_gammaCorrect(v_color);\n\n czm_materialInput materialInput;\n materialInput.normalEC = normalEC;\n materialInput.positionToEyeEC = positionToEyeEC;\n czm_material material = czm_getDefaultMaterial(materialInput);\n material.diffuse = color.rgb;\n material.alpha = color.a;\n\n out_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC);\n}\n",c=r?s.FLAT_VERTEX_FORMAT:s.VERTEX_FORMAT;this.material=void 0,this.translucent=t,this._vertexShaderSource=(0,n.Z)(e.vertexShaderSource,r?"in vec3 position3DHigh;\nin vec3 position3DLow;\nin vec4 color;\nin float batchId;\n\nout vec4 v_color;\n\nvoid main()\n{\n vec4 p = czm_computePosition();\n\n v_color = color;\n\n gl_Position = czm_modelViewProjectionRelativeToEye * p;\n}\n":"in vec3 position3DHigh;\nin vec3 position3DLow;\nin vec3 normal;\nin vec4 color;\nin float batchId;\n\nout vec3 v_positionEC;\nout vec3 v_normalEC;\nout vec4 v_color;\n\nvoid main()\n{\n vec4 p = czm_computePosition();\n\n v_positionEC = (czm_modelViewRelativeToEye * p).xyz; // position in eye coordinates\n v_normalEC = czm_normal * normal; // normal in eye coordinates\n v_color = color;\n\n gl_Position = czm_modelViewProjectionRelativeToEye * p;\n}\n"),this._fragmentShaderSource=(0,n.Z)(e.fragmentShaderSource,l),this._renderState=a.Z.getDefaultRenderState(t,i,e.renderState),this._closed=i,this._vertexFormat=c,this._flat=r,this._faceForward=(0,n.Z)(e.faceForward,!i)}Object.defineProperties(s.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},vertexFormat:{get:function(){return this._vertexFormat}},flat:{get:function(){return this._flat}},faceForward:{get:function(){return this._faceForward}}}),s.VERTEX_FORMAT=r.Z.POSITION_AND_NORMAL,s.FLAT_VERTEX_FORMAT=r.Z.POSITION_ONLY,s.prototype.getFragmentShaderSource=a.Z.prototype.getFragmentShaderSource,s.prototype.isTranslucent=a.Z.prototype.isTranslucent,s.prototype.getRenderState=a.Z.prototype.getRenderState;var l=s},2494:function(e,t,i){"use strict";let n;i.d(t,{Z:function(){return ez}});var r=i(7643),o=i(570),a=i(1486),s=i(3065),l=i(2820),c=i(8177),u=i(2115),h=i(7559),d=i(4572),f=i(9410),p=i(7998),m=i(9824),_=i(3149),g=i(894),Z=i(5837),y=i(487),b=i(2150),v=i(4749),T=i(6222),E=i(87),x=i(9780),w=i(2598),S=i(4318),C=i(356),A=i(7363),I=i(480),O=i(9698),D=i(8516),P=i(4909),R=i(6450),N=i(8898),L=i(9373),M=i(4664),F=i(1205),z=i(3547),B=i(3453),U=i(9569),k=i(6896);function V(e,t){let i;e=(0,d.Z)(e,d.Z.EMPTY_OBJECT),this._show=(0,d.Z)(e.show,!0),this._width=(0,d.Z)(e.width,1),this._loop=(0,d.Z)(e.loop,!1),this._distanceDisplayCondition=e.distanceDisplayCondition,this._material=e.material,(0,f.Z)(this._material)||(this._material=z.Z.fromType(z.Z.ColorType,{color:new c.Z(1,1,1,1)}));let n=e.positions;(0,f.Z)(n)||(n=[]),this._positions=n,this._actualPositions=(0,B.Z)(n,a.Z.equalsEpsilon),this._loop&&this._actualPositions.length>2&&(this._actualPositions===this._positions&&(this._actualPositions=n.slice()),this._actualPositions.push(a.Z.clone(this._actualPositions[0]))),this._length=this._actualPositions.length,this._id=e.id,(0,f.Z)(t)&&(i=v.Z.clone(t.modelMatrix)),this._modelMatrix=i,this._segments=k.Z.wrapLongitude(this._actualPositions,i),this._actualLength=void 0,this._propertiesChanged=new Uint32Array(X),this._polylineCollection=t,this._dirty=!1,this._pickId=void 0,this._boundingVolume=r.Z.fromPoints(this._actualPositions),this._boundingVolumeWC=r.Z.transform(this._boundingVolume,this._modelMatrix),this._boundingVolume2D=new r.Z}let H=V.POSITION_INDEX=0,G=V.SHOW_INDEX=1,j=V.WIDTH_INDEX=2,W=V.MATERIAL_INDEX=3,q=V.POSITION_SIZE_INDEX=4,Y=V.DISTANCE_DISPLAY_CONDITION=5,X=V.NUMBER_OF_PROPERTIES=6;function $(e,t){++e._propertiesChanged[t];let i=e._polylineCollection;(0,f.Z)(i)&&(i._updatePolyline(e,t),e._dirty=!0)}Object.defineProperties(V.prototype,{show:{get:function(){return this._show},set:function(e){if(!(0,f.Z)(e))throw new m.Z("value is required.");e!==this._show&&(this._show=e,$(this,G))}},positions:{get:function(){return this._positions},set:function(e){if(!(0,f.Z)(e))throw new m.Z("value is required.");let t=(0,B.Z)(e,a.Z.equalsEpsilon);this._loop&&t.length>2&&(t===e&&(t=e.slice()),t.push(a.Z.clone(t[0]))),(this._actualPositions.length!==t.length||this._actualPositions.length!==this._length)&&$(this,q),this._positions=e,this._actualPositions=t,this._length=t.length,this._boundingVolume=r.Z.fromPoints(this._actualPositions,this._boundingVolume),this._boundingVolumeWC=r.Z.transform(this._boundingVolume,this._modelMatrix,this._boundingVolumeWC),$(this,H),this.update()}},material:{get:function(){return this._material},set:function(e){if(!(0,f.Z)(e))throw new m.Z("material is required.");this._material!==e&&(this._material=e,$(this,W))}},width:{get:function(){return this._width},set:function(e){if(!(0,f.Z)(e))throw new m.Z("value is required.");e!==this._width&&(this._width=e,$(this,j))}},loop:{get:function(){return this._loop},set:function(e){if(!(0,f.Z)(e))throw new m.Z("value is required.");if(e!==this._loop){let t=this._actualPositions;e?t.length>2&&!a.Z.equals(t[0],t[t.length-1])&&(t.length===this._positions.length&&(this._actualPositions=t=this._positions.slice()),t.push(a.Z.clone(t[0]))):t.length>2&&a.Z.equals(t[0],t[t.length-1])&&(t.length-1===this._positions.length?this._actualPositions=this._positions:t.pop()),this._loop=e,$(this,q)}}},id:{get:function(){return this._id},set:function(e){this._id=e,(0,f.Z)(this._pickId)&&(this._pickId.object.id=e)}},pickId:{get:function(){return this._pickId}},isDestroyed:{get:function(){return!(0,f.Z)(this._polylineCollection)}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){if((0,f.Z)(e)&&e.far<=e.near)throw new m.Z("far distance must be greater than near distance.");U.Z.equals(e,this._distanceDisplayCondition)||(this._distanceDisplayCondition=U.Z.clone(e,this._distanceDisplayCondition),$(this,Y))}}}),V.prototype.update=function(){let e=v.Z.IDENTITY;(0,f.Z)(this._polylineCollection)&&(e=this._polylineCollection.modelMatrix);let t=this._segments.positions.length,i=this._segments.lengths,n=this._propertiesChanged[H]>0||this._propertiesChanged[q]>0;if((!v.Z.equals(e,this._modelMatrix)||n)&&(this._segments=k.Z.wrapLongitude(this._actualPositions,e),this._boundingVolumeWC=r.Z.transform(this._boundingVolume,e,this._boundingVolumeWC)),this._modelMatrix=v.Z.clone(e,this._modelMatrix),this._segments.positions.length!==t)$(this,q);else{let e=i.length;for(let t=0;t<e;++t)if(i[t]!==this._segments.lengths[t]){$(this,q);break}}},V.prototype.getPickId=function(e){return(0,f.Z)(this._pickId)||(this._pickId=e.createPickId({primitive:this,collection:this._polylineCollection,id:this._id})),this._pickId},V.prototype._clean=function(){this._dirty=!1;let e=this._propertiesChanged;for(let t=0;t<X-1;++t)e[t]=0},V.prototype._destroy=function(){this._pickId=this._pickId&&this._pickId.destroy(),this._material=this._material&&this._material.destroy(),this._polylineCollection=void 0};var K=i(8593);let Q=V.SHOW_INDEX,J=V.WIDTH_INDEX,ee=V.POSITION_INDEX,et=V.MATERIAL_INDEX,ei=V.POSITION_SIZE_INDEX,en=V.DISTANCE_DISPLAY_CONDITION,er=V.NUMBER_OF_PROPERTIES,eo={texCoordExpandAndBatchIndex:0,position3DHigh:1,position3DLow:2,position2DHigh:3,position2DLow:4,prevPosition3DHigh:5,prevPosition3DLow:6,prevPosition2DHigh:7,prevPosition2DLow:8,nextPosition3DHigh:9,nextPosition3DLow:10,nextPosition2DHigh:11,nextPosition2DLow:12};function ea(e){e=(0,d.Z)(e,d.Z.EMPTY_OBJECT),this.show=(0,d.Z)(e.show,!0),this.modelMatrix=v.Z.clone((0,d.Z)(e.modelMatrix,v.Z.IDENTITY)),this._modelMatrix=v.Z.clone(v.Z.IDENTITY),this.debugShowBoundingVolume=(0,d.Z)(e.debugShowBoundingVolume,!1),this._opaqueRS=void 0,this._translucentRS=void 0,this._colorCommands=[],this._polylinesUpdated=!1,this._polylinesRemoved=!1,this._createVertexArray=!1,this._propertiesChanged=new Uint32Array(er),this._polylines=[],this._polylineBuckets={},this._positionBufferUsage={bufferUsage:w.Z.STATIC_DRAW,frameCount:0},this._mode=void 0,this._polylinesToUpdate=[],this._vertexArrays=[],this._positionBuffer=void 0,this._texCoordExpandAndBatchIndexBuffer=void 0,this._batchTable=void 0,this._createBatchTable=!1,this._useHighlightColor=!1,this._highlightColor=c.Z.clone(c.Z.WHITE);let t=this;this._uniformMap={u_highlightColor:function(){return t._highlightColor}}}Object.defineProperties(ea.prototype,{length:{get:function(){return e_(this),this._polylines.length}}}),ea.prototype.add=function(e){let t=new V(e,this);return t._index=this._polylines.length,this._polylines.push(t),this._createVertexArray=!0,this._createBatchTable=!0,t},ea.prototype.remove=function(e){if(this.contains(e)){if(this._polylinesRemoved=!0,this._createVertexArray=!0,this._createBatchTable=!0,(0,f.Z)(e._bucket)){let t=e._bucket;t.shaderProgram=t.shaderProgram&&t.shaderProgram.destroy()}return e._destroy(),!0}return!1},ea.prototype.removeAll=function(){eg(this),ey(this),this._polylineBuckets={},this._polylinesRemoved=!1,this._polylines.length=0,this._polylinesToUpdate.length=0,this._createVertexArray=!0},ea.prototype.contains=function(e){return(0,f.Z)(e)&&e._polylineCollection===this},ea.prototype.get=function(e){if(!(0,f.Z)(e))throw new m.Z("index is required.");return e_(this),this._polylines[e]};let es=new _.Z,el=new s.Z,ec=new o.Z;ea.prototype.update=function(e){let t;if(e_(this),0===this._polylines.length||!this.show)return;!function(e,t){let i=t.mode;e._mode===i&&v.Z.equals(e._modelMatrix,e.modelMatrix)||(e._mode=i,e._modelMatrix=v.Z.clone(e.modelMatrix),e._createVertexArray=!0)}(this,e);let i=e.context,n=e.mapProjection,a=this._propertiesChanged;if(this._createBatchTable){if(0===S.Z.maximumVertexTextureImageUnits)throw new E.Z("Vertex texture fetch support is required to render polylines. The maximum number of vertex texture image units must be greater than zero.");!function(e,t){(0,f.Z)(e._batchTable)&&e._batchTable.destroy();let i=[{functionName:"batchTable_getWidthAndShow",componentDatatype:h.Z.UNSIGNED_BYTE,componentsPerAttribute:2},{functionName:"batchTable_getPickColor",componentDatatype:h.Z.UNSIGNED_BYTE,componentsPerAttribute:4,normalize:!0},{functionName:"batchTable_getCenterHigh",componentDatatype:h.Z.FLOAT,componentsPerAttribute:3},{functionName:"batchTable_getCenterLowAndRadius",componentDatatype:h.Z.FLOAT,componentsPerAttribute:4},{functionName:"batchTable_getDistanceDisplayCondition",componentDatatype:h.Z.FLOAT,componentsPerAttribute:2}];e._batchTable=new M.Z(t,i,e._polylines.length)}(this,i),this._createBatchTable=!1}if(this._createVertexArray||function(e){let t=!1,i=e._propertiesChanged,n=e._positionBufferUsage;return i[ee]?(n.bufferUsage!==w.Z.STREAM_DRAW&&(t=!0,n.bufferUsage=w.Z.STREAM_DRAW),n.frameCount=100):n.bufferUsage!==w.Z.STATIC_DRAW&&(0===n.frameCount?(t=!0,n.bufferUsage=w.Z.STATIC_DRAW):n.frameCount--),t}(this))ef(this,i,n);else if(this._polylinesUpdated){let r=this._polylinesToUpdate;if(this._mode!==K.Z.SCENE3D){let e=r.length;for(let i=0;i<e;++i)(t=r[i]).update()}if(a[ei]||a[et])ef(this,i,n);else{let i=r.length,l=this._polylineBuckets;for(let c=0;c<i;++c){a=(t=r[c])._propertiesChanged;let i=t._bucket,u=0;for(let e in l)if(l.hasOwnProperty(e)){if(l[e]===i){a[ee]&&i.writeUpdate(u,t,this._positionBuffer,n);break}u+=l[e].lengthOfPositions}if((a[Q]||a[J])&&this._batchTable.setBatchedAttribute(t._index,0,new o.Z(t._width,t._show)),this._batchTable.attributes.length>2){if(a[ee]||a[ei]){let i=e.mode===K.Z.SCENE2D?t._boundingVolume2D:t._boundingVolumeWC,n=_.Z.fromCartesian(i.center,es),r=s.Z.fromElements(n.low.x,n.low.y,n.low.z,i.radius,el);this._batchTable.setBatchedAttribute(t._index,2,n.high),this._batchTable.setBatchedAttribute(t._index,3,r)}if(a[en]){ec.x=0,ec.y=Number.MAX_VALUE;let e=t.distanceDisplayCondition;(0,f.Z)(e)&&(ec.x=e.near,ec.y=e.far),this._batchTable.setBatchedAttribute(t._index,4,ec)}}t._clean()}}r.length=0,this._polylinesUpdated=!1}a=this._propertiesChanged;for(let e=0;e<er;++e)a[e]=0;let l=v.Z.IDENTITY;e.mode===K.Z.SCENE3D&&(l=this.modelMatrix);let c=e.passes,d=0!==e.morphTime;(0,f.Z)(this._opaqueRS)&&this._opaqueRS.depthTest.enabled===d||(this._opaqueRS=I.Z.fromCache({depthMask:d,depthTest:{enabled:d}})),(0,f.Z)(this._translucentRS)&&this._translucentRS.depthTest.enabled===d||(this._translucentRS=I.Z.fromCache({blending:F.Z.ALPHA_BLEND,depthMask:!d,depthTest:{enabled:d}})),this._batchTable.update(e),(c.render||c.pick)&&function(e,t,i,n){let o=t.context,a=t.commandList,s=i.length,l=0,c=!0,h=e._vertexArrays,d=e.debugShowBoundingVolume,p=e._batchTable.getUniformMapCallback(),m=h.length;for(let _=0;_<m;++_){let m=h[_],g=m.buckets,Z=g.length;for(let h=0;h<Z;++h){let _,Z,y,b;let v=g[h],T=v.offset,E=v.bucket.shaderProgram,x=v.bucket.polylines,w=x.length,S=0;for(let h=0;h<w;++h){let g;let w=x[h],I=function(e){let t=z.Z._uniformList[e.type],i=t.length;em.length=2*i;let n=0;for(let r=0;r<i;++r){let i=t[r];em[n]=i,em[n+1]=e._uniforms[i](),n+=2}return`${e.type}:${JSON.stringify(em,ep)}`}(w._material);if(I!==_){if((0,f.Z)(_)&&S>0){let t=Z.isTranslucent();l>=s?(y=new C.Z({owner:e}),i.push(y)):y=i[l],++l,b=(0,u.Z)(p(Z._uniforms),e._uniformMap),y.boundingVolume=r.Z.clone(eu,y.boundingVolume),y.modelMatrix=n,y.shaderProgram=E,y.vertexArray=m.va,y.renderState=t?e._translucentRS:e._opaqueRS,y.pass=t?A.Z.TRANSLUCENT:A.Z.OPAQUE,y.debugShowBoundingVolume=d,y.pickId="v_pickColor",y.uniformMap=b,y.count=S,y.offset=T,T+=S,S=0,c=!0,a.push(y)}(Z=w._material).update(o),_=I}let O=w._locatorBuckets,D=O.length;for(let e=0;e<D;++e){let t=O[e];t.locator===v&&(S+=t.count)}t.mode===K.Z.SCENE3D?g=w._boundingVolumeWC:t.mode===K.Z.COLUMBUS_VIEW?g=w._boundingVolume2D:t.mode===K.Z.SCENE2D?(0,f.Z)(w._boundingVolume2D)&&((g=r.Z.clone(w._boundingVolume2D,eh)).center.x=0):(0,f.Z)(w._boundingVolumeWC)&&(0,f.Z)(w._boundingVolume2D)&&(g=r.Z.union(w._boundingVolumeWC,w._boundingVolume2D,eh)),c?(c=!1,r.Z.clone(g,eu)):r.Z.union(g,eu,eu)}(0,f.Z)(_)&&S>0&&(l>=s?(y=new C.Z({owner:e}),i.push(y)):y=i[l],++l,b=(0,u.Z)(p(Z._uniforms),e._uniformMap),y.boundingVolume=r.Z.clone(eu,y.boundingVolume),y.modelMatrix=n,y.shaderProgram=E,y.vertexArray=m.va,y.renderState=Z.isTranslucent()?e._translucentRS:e._opaqueRS,y.pass=Z.isTranslucent()?A.Z.TRANSLUCENT:A.Z.OPAQUE,y.debugShowBoundingVolume=d,y.pickId="v_pickColor",y.uniformMap=b,y.count=S,y.offset=T,c=!0,a.push(y)),_=void 0}}i.length=l}(this,e,this._colorCommands,l)};let eu=new r.Z,eh=new r.Z;ea.prototype.isDestroyed=function(){return!1},ea.prototype.destroy=function(){return eZ(this),eg(this),ey(this),this._batchTable=this._batchTable&&this._batchTable.destroy(),(0,p.Z)(this)};let ed=[0,0,0];function ef(e,t,i){let n,r;e._createVertexArray=!1,eg(e),eZ(e),function(e){let t=e._mode,i=e._modelMatrix,n=e._polylineBuckets={},r=e._polylines,o=r.length;for(let e=0;e<o;++e){let o=r[e];if(o._actualPositions.length>1){o.update();let e=o.material,r=n[e.type];(0,f.Z)(r)||(r=n[e.type]=new ev(e,t,i)),r.addPolyline(o)}}}(e);let o=[[]],a=o[0],s=e._batchTable,l=e._useHighlightColor,c=[0],u=0,d=[[]],p=0,m=e._polylineBuckets;for(n in m)m.hasOwnProperty(n)&&((r=m[n]).updateShader(t,s,l),p+=r.lengthOfPositions);if(p>0){let l,_;let g=e._mode,y=new Float32Array(6*p*3),v=new Float32Array(4*p),T=0,E=0,S=0;for(n in m)if(m.hasOwnProperty(n)){(r=m[n]).write(y,v,T,E,S,s,t,i),g===K.Z.MORPHING&&((0,f.Z)(l)||(l=new Float32Array(6*p*3)),r.writeForMorph(l,T));let e=r.lengthOfPositions;T+=6*e*3,E+=4*e,S+=4*e,u=r.updateIndices(o,c,d,u)}let C=e._positionBufferUsage.bufferUsage,A=w.Z.STATIC_DRAW;e._positionBuffer=x.Z.createVertexBuffer({context:t,typedArray:y,usage:C}),(0,f.Z)(l)&&(_=x.Z.createVertexBuffer({context:t,typedArray:l,usage:C})),e._texCoordExpandAndBatchIndexBuffer=x.Z.createVertexBuffer({context:t,typedArray:v,usage:A});let I=3*Float32Array.BYTES_PER_ELEMENT,O=4*Float32Array.BYTES_PER_ELEMENT,D=0,P=o.length;for(let i=0;i<P;++i)if((a=o[i]).length>0){let n,r,o,s;let l=new Uint16Array(a),u=x.Z.createIndexBuffer({context:t,typedArray:l,usage:w.Z.STATIC_DRAW,indexDatatype:Z.Z.UNSIGNED_SHORT});D+=c[i];let f=6*(I*b.Z.SIXTY_FOUR_KILOBYTES*i-D*I),p=I+f,m=I+p,y=I+m,v=I+y,T=I+v,E=O*b.Z.SIXTY_FOUR_KILOBYTES*i-D*O,S=[{index:eo.position3DHigh,componentsPerAttribute:3,componentDatatype:h.Z.FLOAT,offsetInBytes:f,strideInBytes:6*I},{index:eo.position3DLow,componentsPerAttribute:3,componentDatatype:h.Z.FLOAT,offsetInBytes:p,strideInBytes:6*I},{index:eo.position2DHigh,componentsPerAttribute:3,componentDatatype:h.Z.FLOAT,offsetInBytes:f,strideInBytes:6*I},{index:eo.position2DLow,componentsPerAttribute:3,componentDatatype:h.Z.FLOAT,offsetInBytes:p,strideInBytes:6*I},{index:eo.prevPosition3DHigh,componentsPerAttribute:3,componentDatatype:h.Z.FLOAT,offsetInBytes:m,strideInBytes:6*I},{index:eo.prevPosition3DLow,componentsPerAttribute:3,componentDatatype:h.Z.FLOAT,offsetInBytes:y,strideInBytes:6*I},{index:eo.prevPosition2DHigh,componentsPerAttribute:3,componentDatatype:h.Z.FLOAT,offsetInBytes:m,strideInBytes:6*I},{index:eo.prevPosition2DLow,componentsPerAttribute:3,componentDatatype:h.Z.FLOAT,offsetInBytes:y,strideInBytes:6*I},{index:eo.nextPosition3DHigh,componentsPerAttribute:3,componentDatatype:h.Z.FLOAT,offsetInBytes:v,strideInBytes:6*I},{index:eo.nextPosition3DLow,componentsPerAttribute:3,componentDatatype:h.Z.FLOAT,offsetInBytes:T,strideInBytes:6*I},{index:eo.nextPosition2DHigh,componentsPerAttribute:3,componentDatatype:h.Z.FLOAT,offsetInBytes:v,strideInBytes:6*I},{index:eo.nextPosition2DLow,componentsPerAttribute:3,componentDatatype:h.Z.FLOAT,offsetInBytes:T,strideInBytes:6*I},{index:eo.texCoordExpandAndBatchIndex,componentsPerAttribute:4,componentDatatype:h.Z.FLOAT,vertexBuffer:e._texCoordExpandAndBatchIndexBuffer,offsetInBytes:E}];g===K.Z.SCENE3D?(r=e._positionBuffer,n="vertexBuffer",o=ed,s="value"):(g===K.Z.SCENE2D||g===K.Z.COLUMBUS_VIEW?(r=ed,n="value"):(r=_,n="vertexBuffer"),o=e._positionBuffer,s="vertexBuffer"),S[0][n]=r,S[1][n]=r,S[2][s]=o,S[3][s]=o,S[4][n]=r,S[5][n]=r,S[6][s]=o,S[7][s]=o,S[8][n]=r,S[9][n]=r,S[10][s]=o,S[11][s]=o;let C=new R.Z({context:t,attributes:S,indexBuffer:u});e._vertexArrays.push({va:C,buckets:d[i]})}}}function ep(e,t){return t instanceof P.Z?t.id:t}let em=[];function e_(e){if(e._polylinesRemoved){let t;e._polylinesRemoved=!1;let i=[],n=[],r=0,o=e._polylines.length;for(let a=0;a<o;++a)(t=e._polylines[a]).isDestroyed||(t._index=r++,n.push(t),i.push(t));e._polylines=i,e._polylinesToUpdate=n}}function eg(e){let t=e._polylines,i=t.length;for(let e=0;e<i;++e)if(!t[e].isDestroyed){let i=t[e]._bucket;(0,f.Z)(i)&&(i.shaderProgram=i.shaderProgram&&i.shaderProgram.destroy())}}function eZ(e){let t=e._vertexArrays.length;for(let i=0;i<t;++i)e._vertexArrays[i].va.destroy();e._vertexArrays.length=0}function ey(e){let t=e._polylines,i=t.length;for(let e=0;e<i;++e)t[e].isDestroyed||t[e]._destroy()}function eb(e,t,i){this.count=e,this.offset=t,this.bucket=i}function ev(e,t,i){this.polylines=[],this.lengthOfPositions=0,this.material=e,this.shaderProgram=void 0,this.mode=t,this.modelMatrix=i}function eT(e){return 0>a.Z.dot(a.Z.UNIT_X,e._boundingVolume.center)||e._boundingVolume.intersectPlane(T.Z.ORIGIN_ZX_PLANE)===y.Z.INTERSECTING}ea.prototype._updatePolyline=function(e,t){this._polylinesUpdated=!0,e._dirty||this._polylinesToUpdate.push(e),++this._propertiesChanged[t]},ev.prototype.addPolyline=function(e){this.polylines.push(e),e._actualLength=this.getPolylinePositionsLength(e),this.lengthOfPositions+=e._actualLength,e._bucket=this},ev.prototype.updateShader=function(e,t,i){if((0,f.Z)(this.shaderProgram))return;let n=["DISTANCE_DISPLAY_CONDITION"];i&&n.push("VECTOR_TILE"),-1!==this.material.shaderSource.search(/in\s+float\s+v_polylineAngle;/g)&&n.push("POLYLINE_DASH"),g.Z.isInternetExplorer()||n.push("CLIP_POLYLINE");let r=new D.Z({defines:n,sources:["in vec4 v_pickColor;\n",this.material.shaderSource,L.Z]}),o=t.getVertexShaderCallback()("in vec3 position3DHigh;\nin vec3 position3DLow;\nin vec3 position2DHigh;\nin vec3 position2DLow;\nin vec3 prevPosition3DHigh;\nin vec3 prevPosition3DLow;\nin vec3 prevPosition2DHigh;\nin vec3 prevPosition2DLow;\nin vec3 nextPosition3DHigh;\nin vec3 nextPosition3DLow;\nin vec3 nextPosition2DHigh;\nin vec3 nextPosition2DLow;\nin vec4 texCoordExpandAndBatchIndex;\n\nout vec2 v_st;\nout float v_width;\nout vec4 v_pickColor;\nout float v_polylineAngle;\n\nvoid main()\n{\n float texCoord = texCoordExpandAndBatchIndex.x;\n float expandDir = texCoordExpandAndBatchIndex.y;\n bool usePrev = texCoordExpandAndBatchIndex.z < 0.0;\n float batchTableIndex = texCoordExpandAndBatchIndex.w;\n\n vec2 widthAndShow = batchTable_getWidthAndShow(batchTableIndex);\n float width = widthAndShow.x + 0.5;\n float show = widthAndShow.y;\n\n if (width < 1.0)\n {\n show = 0.0;\n }\n\n vec4 pickColor = batchTable_getPickColor(batchTableIndex);\n\n vec4 p, prev, next;\n if (czm_morphTime == 1.0)\n {\n p = czm_translateRelativeToEye(position3DHigh.xyz, position3DLow.xyz);\n prev = czm_translateRelativeToEye(prevPosition3DHigh.xyz, prevPosition3DLow.xyz);\n next = czm_translateRelativeToEye(nextPosition3DHigh.xyz, nextPosition3DLow.xyz);\n }\n else if (czm_morphTime == 0.0)\n {\n p = czm_translateRelativeToEye(position2DHigh.zxy, position2DLow.zxy);\n prev = czm_translateRelativeToEye(prevPosition2DHigh.zxy, prevPosition2DLow.zxy);\n next = czm_translateRelativeToEye(nextPosition2DHigh.zxy, nextPosition2DLow.zxy);\n }\n else\n {\n p = czm_columbusViewMorph(\n czm_translateRelativeToEye(position2DHigh.zxy, position2DLow.zxy),\n czm_translateRelativeToEye(position3DHigh.xyz, position3DLow.xyz),\n czm_morphTime);\n prev = czm_columbusViewMorph(\n czm_translateRelativeToEye(prevPosition2DHigh.zxy, prevPosition2DLow.zxy),\n czm_translateRelativeToEye(prevPosition3DHigh.xyz, prevPosition3DLow.xyz),\n czm_morphTime);\n next = czm_columbusViewMorph(\n czm_translateRelativeToEye(nextPosition2DHigh.zxy, nextPosition2DLow.zxy),\n czm_translateRelativeToEye(nextPosition3DHigh.xyz, nextPosition3DLow.xyz),\n czm_morphTime);\n }\n\n #ifdef DISTANCE_DISPLAY_CONDITION\n vec3 centerHigh = batchTable_getCenterHigh(batchTableIndex);\n vec4 centerLowAndRadius = batchTable_getCenterLowAndRadius(batchTableIndex);\n vec3 centerLow = centerLowAndRadius.xyz;\n float radius = centerLowAndRadius.w;\n vec2 distanceDisplayCondition = batchTable_getDistanceDisplayCondition(batchTableIndex);\n\n float lengthSq;\n if (czm_sceneMode == czm_sceneMode2D)\n {\n lengthSq = czm_eyeHeight2D.y;\n }\n else\n {\n vec4 center = czm_translateRelativeToEye(centerHigh.xyz, centerLow.xyz);\n lengthSq = max(0.0, dot(center.xyz, center.xyz) - radius * radius);\n }\n\n float nearSq = distanceDisplayCondition.x * distanceDisplayCondition.x;\n float farSq = distanceDisplayCondition.y * distanceDisplayCondition.y;\n if (lengthSq < nearSq || lengthSq > farSq)\n {\n show = 0.0;\n }\n #endif\n\n float polylineAngle;\n vec4 positionWC = getPolylineWindowCoordinates(p, prev, next, expandDir, width, usePrev, polylineAngle);\n gl_Position = czm_viewportOrthographic * positionWC * show;\n\n v_st.s = texCoord;\n v_st.t = czm_writeNonPerspective(clamp(expandDir, 0.0, 1.0), gl_Position.w);\n\n v_width = width;\n v_pickColor = pickColor;\n v_polylineAngle = polylineAngle;\n}\n"),a=new D.Z({defines:n,sources:[N.Z,o]});this.shaderProgram=O.Z.fromCache({context:e,vertexShaderSource:a,fragmentShaderSource:r,attributeLocations:eo})},ev.prototype.getPolylinePositionsLength=function(e){let t;if(this.mode===K.Z.SCENE3D||!eT(e))return 4*(t=e._actualPositions.length)-4;let i=0,n=e._segments.lengths;t=n.length;for(let e=0;e<t;++e)i+=4*n[e]-4;return i};let eE=new a.Z,ex=new a.Z,ew=new a.Z,eS=new a.Z,eC=new s.Z,eA=new o.Z;ev.prototype.write=function(e,t,i,n,r,o,l,u){let h=this.mode,d=u.ellipsoid.maximumRadius*b.Z.PI,p=this.polylines,m=p.length;for(let n=0;n<m;++n){let m;let g=p[n],Z=g.width,y=g.show&&Z>0,b=g._index,v=this.getSegments(g,u),T=v.positions,E=v.lengths,x=T.length,w=g.getPickId(l).color,S=0,C=0;for(let n=0;n<x;++n){0===n?g._loop?m=T[x-2]:(m=eS,a.Z.subtract(T[0],T[1],m),a.Z.add(T[0],m,m)):m=T[n-1],a.Z.clone(m,ex),a.Z.clone(T[n],eE),n===x-1?g._loop?m=T[1]:(m=eS,a.Z.subtract(T[x-1],T[x-2],m),a.Z.add(T[x-1],m,m)):m=T[n+1],a.Z.clone(m,ew);let o=E[S];n===C+o&&(C+=o,++S);let s=n-C==0,l=n===C+E[S]-1;h===K.Z.SCENE2D&&(ex.z=0,eE.z=0,ew.z=0),(h===K.Z.SCENE2D||h===K.Z.MORPHING)&&(s||l)&&d-Math.abs(eE.x)<1&&((eE.x<0&&ex.x>0||eE.x>0&&ex.x<0)&&a.Z.clone(eE,ex),(eE.x<0&&ew.x>0||eE.x>0&&ew.x<0)&&a.Z.clone(eE,ew));let c=s?2:0,u=l?2:4;for(let o=c;o<u;++o){_.Z.writeElements(eE,e,i),_.Z.writeElements(ex,e,i+6),_.Z.writeElements(ew,e,i+12);let a=o-2<0?-1:1;t[r]=n/(x-1),t[r+1]=o%2*2-1,t[r+2]=a,t[r+3]=b,i+=18,r+=4}}eC.x=c.Z.floatToByte(w.red),eC.y=c.Z.floatToByte(w.green),eC.z=c.Z.floatToByte(w.blue),eC.w=c.Z.floatToByte(w.alpha),eA.x=Z,eA.y=y?1:0;let A=h===K.Z.SCENE2D?g._boundingVolume2D:g._boundingVolumeWC,I=_.Z.fromCartesian(A.center,es),O=I.high,D=s.Z.fromElements(I.low.x,I.low.y,I.low.z,A.radius,el);ec.x=0,ec.y=Number.MAX_VALUE;let P=g.distanceDisplayCondition;(0,f.Z)(P)&&(ec.x=P.near,ec.y=P.far),o.setBatchedAttribute(b,0,eA),o.setBatchedAttribute(b,1,eC),o.attributes.length>2&&(o.setBatchedAttribute(b,2,O),o.setBatchedAttribute(b,3,D),o.setBatchedAttribute(b,4,ec))}};let eI=new a.Z,eO=new a.Z,eD=new a.Z,eP=new a.Z;ev.prototype.writeForMorph=function(e,t){let i=this.modelMatrix,n=this.polylines,r=n.length;for(let o=0;o<r;++o){let r=n[o],s=r._segments.positions,l=r._segments.lengths,c=s.length,u=0,h=0;for(let n=0;n<c;++n){let o,d;0===n?r._loop?o=s[c-2]:(o=eP,a.Z.subtract(s[0],s[1],o),a.Z.add(s[0],o,o)):o=s[n-1],o=v.Z.multiplyByPoint(i,o,eO);let f=v.Z.multiplyByPoint(i,s[n],eI);n===c-1?r._loop?d=s[1]:(d=eP,a.Z.subtract(s[c-1],s[c-2],d),a.Z.add(s[c-1],d,d)):d=s[n+1],d=v.Z.multiplyByPoint(i,d,eD);let p=l[u];n===h+p&&(h+=p,++u);let m=n-h==0,g=n===h+l[u]-1,Z=m?2:0,y=g?2:4;for(let i=Z;i<y;++i)_.Z.writeElements(f,e,t),_.Z.writeElements(o,e,t+6),_.Z.writeElements(d,e,t+12),t+=18}}};let eR=[,];ev.prototype.updateIndices=function(e,t,i,n){let r=i.length-1,o=new eb(0,n,this);i[r].push(o);let a=0,s=e[e.length-1],l=0;s.length>0&&(l=s[s.length-1]+1);let c=this.polylines,u=c.length;for(let h=0;h<u;++h){let u;let d=c[h];if(d._locatorBuckets=[],this.mode===K.Z.SCENE3D){u=eR;let e=d._actualPositions.length;if(!(e>0))continue;u[0]=e}else u=d._segments.lengths;let f=u.length;if(f>0){let c=0;for(let h=0;h<f;++h){let f=u[h]-1;for(let u=0;u<f;++u)l+4>b.Z.SIXTY_FOUR_KILOBYTES&&(d._locatorBuckets.push({locator:o,count:c}),c=0,t.push(4),s=[],e.push(s),l=0,o.count=a,a=0,n=0,o=new eb(0,0,this),i[++r]=[o]),s.push(l,l+2,l+1),s.push(l+1,l+2,l+3),c+=6,a+=6,n+=6,l+=4}d._locatorBuckets.push({locator:o,count:c}),l+4>b.Z.SIXTY_FOUR_KILOBYTES&&(t.push(0),s=[],e.push(s),l=0,o.count=a,n=0,a=0,o=new eb(0,0,this),i[++r]=[o])}d._clean()}return o.count=a,n},ev.prototype.getPolylineStartIndex=function(e){let t=this.polylines,i=0,n=t.length;for(let r=0;r<n;++r){let n=t[r];if(n===e)break;i+=n._actualLength}return i};let eN={positions:void 0,lengths:void 0},eL=[,],eM=new a.Z,eF=new l.Z;ev.prototype.getSegments=function(e,t){let i,n=e._actualPositions;if(this.mode===K.Z.SCENE3D)return eL[0]=n.length,eN.positions=n,eN.lengths=eL,eN;eT(e)&&(n=e._segments.positions);let o=t.ellipsoid,s=[],l=this.modelMatrix,c=n.length,u=eM;for(let e=0;e<c;++e)i=n[e],u=v.Z.multiplyByPoint(l,i,u),s.push(t.project(o.cartesianToCartographic(u,eF)));if(s.length>0){e._boundingVolume2D=r.Z.fromPoints(s,e._boundingVolume2D);let t=e._boundingVolume2D.center;e._boundingVolume2D.center=new a.Z(t.z,t.x,t.y)}return eN.positions=s,eN.lengths=e._segments.lengths,eN},ev.prototype.writeUpdate=function(e,t,i,r){let o=this.mode,s=r.ellipsoid.maximumRadius*b.Z.PI,l=t._actualLength;if(l){let c;e+=this.getPolylineStartIndex(t);let u=n,h=6*l*3;!(0,f.Z)(u)||u.length<h?u=n=new Float32Array(h):u.length>h&&(u=new Float32Array(u.buffer,0,h));let d=this.getSegments(t,r),p=d.positions,m=d.lengths,g=0,Z=0,y=0;l=p.length;for(let e=0;e<l;++e){0===e?t._loop?c=p[l-2]:(c=eS,a.Z.subtract(p[0],p[1],c),a.Z.add(p[0],c,c)):c=p[e-1],a.Z.clone(c,ex),a.Z.clone(p[e],eE),e===l-1?t._loop?c=p[1]:(c=eS,a.Z.subtract(p[l-1],p[l-2],c),a.Z.add(p[l-1],c,c)):c=p[e+1],a.Z.clone(c,ew);let i=m[Z];e===y+i&&(y+=i,++Z);let n=e-y==0,r=e===y+m[Z]-1;o===K.Z.SCENE2D&&(ex.z=0,eE.z=0,ew.z=0),(o===K.Z.SCENE2D||o===K.Z.MORPHING)&&(n||r)&&s-Math.abs(eE.x)<1&&((eE.x<0&&ex.x>0||eE.x>0&&ex.x<0)&&a.Z.clone(eE,ex),(eE.x<0&&ew.x>0||eE.x>0&&ew.x<0)&&a.Z.clone(eE,ew));let h=n?2:0,d=r?2:4;for(let e=h;e<d;++e)_.Z.writeElements(eE,u,g),_.Z.writeElements(ex,u,g+6),_.Z.writeElements(ew,u,g+12),g+=18}i.copyFromArrayView(u,18*Float32Array.BYTES_PER_ELEMENT*e)}};var ez=ea},4955:function(e,t,i){"use strict";i.d(t,{Z:function(){return d}});var n=i(4572),r=i(894),o=i(4915),a=i(4324),s=i(8898),l=i(7761);let c=`${s.Z} in vec3 position3DHigh; \ in vec3 position3DLow; \ in vec3 prevPosition3DHigh; \ in vec3 prevPosition3DLow; \ in vec3 nextPosition3DHigh; \ in vec3 nextPosition3DLow; \ in vec2 expandAndWidth; \ in vec4 color; \ in float batchId; \ \ out vec4 v_color; \ \ void main() \ { \ float expandDir = expandAndWidth.x; \ float width = abs(expandAndWidth.y) + 0.5; \ bool usePrev = expandAndWidth.y < 0.0; \ \ vec4 p = czm_computePosition(); \ vec4 prev = czm_computePrevPosition(); \ vec4 next = czm_computeNextPosition(); \ \ float angle; \ vec4 positionWC = getPolylineWindowCoordinates(p, prev, next, expandDir, width, usePrev, angle); \ gl_Position = czm_viewportOrthographic * positionWC; \ \ v_color = color; \ } \ `,u=a.Z;function h(e){e=(0,n.Z)(e,n.Z.EMPTY_OBJECT);let t=(0,n.Z)(e.translucent,!0),i=h.VERTEX_FORMAT;this.material=void 0,this.translucent=t,this._vertexShaderSource=(0,n.Z)(e.vertexShaderSource,c),this._fragmentShaderSource=(0,n.Z)(e.fragmentShaderSource,u),this._renderState=l.Z.getDefaultRenderState(t,!1,e.renderState),this._closed=!1,this._vertexFormat=i}r.Z.isInternetExplorer()||(c=`#define CLIP_POLYLINE ${c}`),Object.defineProperties(h.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},vertexFormat:{get:function(){return this._vertexFormat}}}),h.VERTEX_FORMAT=o.Z.POSITION_ONLY,h.prototype.getFragmentShaderSource=l.Z.prototype.getFragmentShaderSource,h.prototype.isTranslucent=l.Z.prototype.isTranslucent,h.prototype.getRenderState=l.Z.prototype.getRenderState;var d=h},2307:function(e,t,i){"use strict";i.d(t,{Z:function(){return p}});var n=i(4572),r=i(9410),o=i(894),a=i(4915),s=i(8898),l=i(9373),c=i(7761),u=i(3547);let h=`${s.Z} in vec3 position3DHigh; \ in vec3 position3DLow; \ in vec3 prevPosition3DHigh; \ in vec3 prevPosition3DLow; \ in vec3 nextPosition3DHigh; \ in vec3 nextPosition3DLow; \ in vec2 expandAndWidth; \ in vec2 st; \ in float batchId; \ \ out float v_width; \ out vec2 v_st; \ out float v_polylineAngle; \ \ void main() \ { \ float expandDir = expandAndWidth.x; \ float width = abs(expandAndWidth.y) + 0.5; \ bool usePrev = expandAndWidth.y < 0.0; \ \ vec4 p = czm_computePosition(); \ vec4 prev = czm_computePrevPosition(); \ vec4 next = czm_computeNextPosition(); \ \ float angle; \ vec4 positionWC = getPolylineWindowCoordinates(p, prev, next, expandDir, width, usePrev, angle); \ gl_Position = czm_viewportOrthographic * positionWC; \ \ v_width = width; \ v_st.s = st.s; \ v_st.t = czm_writeNonPerspective(st.t, gl_Position.w); \ v_polylineAngle = angle; \ } \ `,d=l.Z;function f(e){e=(0,n.Z)(e,n.Z.EMPTY_OBJECT);let t=(0,n.Z)(e.translucent,!0),i=f.VERTEX_FORMAT;this.material=(0,r.Z)(e.material)?e.material:u.Z.fromType(u.Z.ColorType),this.translucent=t,this._vertexShaderSource=(0,n.Z)(e.vertexShaderSource,h),this._fragmentShaderSource=(0,n.Z)(e.fragmentShaderSource,d),this._renderState=c.Z.getDefaultRenderState(t,!1,e.renderState),this._closed=!1,this._vertexFormat=i}o.Z.isInternetExplorer()||(h=`#define CLIP_POLYLINE ${h}`),Object.defineProperties(f.prototype,{vertexShaderSource:{get:function(){let e=this._vertexShaderSource;return -1!==this.material.shaderSource.search(/in\s+float\s+v_polylineAngle;/g)&&(e=`#define POLYLINE_DASH ${e}`),e}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},vertexFormat:{get:function(){return this._vertexFormat}}}),f.VERTEX_FORMAT=a.Z.POSITION_AND_ST,f.prototype.getFragmentShaderSource=c.Z.prototype.getFragmentShaderSource,f.prototype.isTranslucent=c.Z.prototype.isTranslucent,f.prototype.getRenderState=c.Z.prototype.getRenderState;var p=f},5899:function(e,t,i){"use strict";let n;i.d(t,{Z:function(){return eD}});var r=i(7643),o=i(570),a=i(1486),s=i(3065),l=i(2820),c=i(49),u=i(8177),h=i(2115),d=i(7559),f=i(4572),p=i(9410),m=i(7998),_=i(9824),g=i(3149),Z=i(894),y=i(3086),b=i(2601),v=i(258),T=i(2246),E=i(487),x=i(4749),w=i(6222),S=i(87),C=function(e,t){if(!(0,p.Z)(e))throw new _.Z("array is required.");if(!(0,p.Z)(t)||t<1)throw new _.Z("numberOfArrays must be greater than 0.");let i=[],n=e.length,r=0;for(;r<n;){let o=Math.ceil((n-r)/t--);i.push(e.slice(r,r+o)),r+=o}return i},A=i(1250),I=i(2598),O=i(4318),D=i(356),P=i(7363),R=i(480),N=i(9698),L=i(8516),M=i(6450),F=i(4664),z=i(7048),B=i(5292),U=i(1039),k=i(4754),V=i(2926),H=i(5837),G=i(2660),j=i(9676);function W(e,t){let i=e.attributes,n=i.position,r=n.values.length/n.componentsPerAttribute;i.batchId=new b.Z({componentDatatype:d.Z.FLOAT,componentsPerAttribute:1,values:new Float32Array(r)});let o=i.batchId.values;for(let e=0;e<r;++e)o[e]=t}function q(e,t,i,n){let r,o,a;let s=n.length-1;if(s>=0){let e=n[s];r=e.offset+e.count,o=i[a=e.index].indices.length}else r=0,o=i[a=0].indices.length;let l=e.length;for(let s=0;s<l;++s){let l=e[s][t];if(!(0,p.Z)(l))continue;let c=l.indices.length;r+c>o&&(r=0,o=i[++a].indices.length),n.push({index:a,offset:r,count:c}),r+=c}}let Y={};function X(e){let t=e.length,i=new Float32Array(1+(r.Z.packedLength+1)*t),n=0;i[n++]=t;for(let o=0;o<t;++o){let t=e[o];(0,p.Z)(t)?(i[n++]=1,r.Z.pack(e[o],i,n)):i[n++]=0,n+=r.Z.packedLength}return i}function $(e){let t=Array(e[0]),i=0,n=1;for(;n<e.length;)1===e[n++]&&(t[i]=r.Z.unpack(e,n)),++i,n+=r.Z.packedLength;return t}Y.combineGeometry=function(e){let t,i,n,o;let a=e.instances,s=a.length,l=!1;s>0&&((t=function(e){let t,i,n;let o=e.instances,a=e.projection,s=e.elementIndexUintSupported,l=e.scene3DOnly,c=e.vertexCacheOptimize,u=e.compressVertices,h=e.modelMatrix,f=o.length;for(t=0;t<f;++t)if((0,p.Z)(o[t].geometry)){n=o[t].geometry.primitiveType;break}for(t=1;t<f;++t)if((0,p.Z)(o[t].geometry)&&o[t].geometry.primitiveType!==n)throw new _.Z("All instance geometries must have the same primitiveType.");if(function(e,t,i){let n,r=!i,o=e.length;if(!r&&o>1){let t=e[0].modelMatrix;for(n=1;n<o;++n)if(!x.Z.equals(t,e[n].modelMatrix)){r=!0;break}}if(r)for(n=0;n<o;++n)(0,p.Z)(e[n].geometry)&&V.Z.transformToWorldCoordinates(e[n]);else x.Z.multiplyTransformation(t,e[0].modelMatrix,t)}(o,h,l),!l)for(t=0;t<f;++t)(0,p.Z)(o[t].geometry)&&V.Z.splitLongitude(o[t]);if(function(e){let t=e.length;for(let i=0;i<t;++i){let t=e[i];(0,p.Z)(t.geometry)?W(t.geometry,i):(0,p.Z)(t.westHemisphereGeometry)&&(0,p.Z)(t.eastHemisphereGeometry)&&(W(t.westHemisphereGeometry,i),W(t.eastHemisphereGeometry,i))}}(o),c)for(t=0;t<f;++t){let e=o[t];(0,p.Z)(e.geometry)?(V.Z.reorderForPostVertexCache(e.geometry),V.Z.reorderForPreVertexCache(e.geometry)):(0,p.Z)(e.westHemisphereGeometry)&&(0,p.Z)(e.eastHemisphereGeometry)&&(V.Z.reorderForPostVertexCache(e.westHemisphereGeometry),V.Z.reorderForPreVertexCache(e.westHemisphereGeometry),V.Z.reorderForPostVertexCache(e.eastHemisphereGeometry),V.Z.reorderForPreVertexCache(e.eastHemisphereGeometry))}let m=V.Z.combineInstances(o);for(t=0,f=m.length;t<f;++t){let e=(i=m[t]).attributes;if(l)for(let t in e)e.hasOwnProperty(t)&&e[t].componentDatatype===d.Z.DOUBLE&&V.Z.encodeAttribute(i,t,`${t}3DHigh`,`${t}3DLow`);else for(let t in e)if(e.hasOwnProperty(t)&&e[t].componentDatatype===d.Z.DOUBLE){let e=`${t}3D`,n=`${t}2D`;V.Z.projectTo2D(i,t,e,n,a),(0,p.Z)(i.boundingSphere)&&"position"===t&&(i.boundingSphereCV=r.Z.fromVertices(i.attributes.position2D.values)),V.Z.encodeAttribute(i,e,`${e}High`,`${e}Low`),V.Z.encodeAttribute(i,n,`${n}High`,`${n}Low`)}u&&V.Z.compressVertices(i)}if(!s){let e=[];for(t=0,f=m.length;t<f;++t)i=m[t],e=e.concat(V.Z.fitToUnsignedShortIndices(i));m=e}return m}(e)).length>0&&(i=V.Z.createAttributeLocations(t[0]),e.createPickOffsets&&(n=function(e,t){let i=[];return q(e,"geometry",t,i),q(e,"westHemisphereGeometry",t,i),q(e,"eastHemisphereGeometry",t,i),i}(a,t))),(0,p.Z)(a[0].attributes)&&(0,p.Z)(a[0].attributes.offset)&&(o=Array(s),l=!0));let c=Array(s),u=Array(s);for(let e=0;e<s;++e){let t=a[e],i=t.geometry;(0,p.Z)(i)&&(c[e]=i.boundingSphere,u[e]=i.boundingSphereCV,l&&(o[e]=t.geometry.offsetAttribute));let n=t.eastHemisphereGeometry,s=t.westHemisphereGeometry;(0,p.Z)(n)&&(0,p.Z)(s)&&((0,p.Z)(n.boundingSphere)&&(0,p.Z)(s.boundingSphere)&&(c[e]=r.Z.union(n.boundingSphere,s.boundingSphere)),(0,p.Z)(n.boundingSphereCV)&&(0,p.Z)(s.boundingSphereCV)&&(u[e]=r.Z.union(n.boundingSphereCV,s.boundingSphereCV)))}return{geometries:t,modelMatrix:e.modelMatrix,attributeLocations:i,pickOffsets:n,offsetInstanceExtend:o,boundingSpheres:c,boundingSpheresCV:u}},Y.packCreateGeometryResults=function(e,t){let i=new Float64Array(function(e){let t=1,i=e.length;for(let n=0;n<i;n++){let i=e[n];if(++t,!(0,p.Z)(i))continue;let o=i.attributes;for(let e in t+=7+2*r.Z.packedLength+((0,p.Z)(i.indices)?i.indices.length:0),o)o.hasOwnProperty(e)&&(0,p.Z)(o[e])&&(t+=5+o[e].values.length)}return t}(e)),n=[],o={},a=e.length,s=0;i[s++]=a;for(let t=0;t<a;t++){let a=e[t],l=(0,p.Z)(a);if(i[s++]=l?1:0,!l)continue;i[s++]=a.primitiveType,i[s++]=a.geometryType,i[s++]=(0,f.Z)(a.offsetAttribute,-1);let c=(0,p.Z)(a.boundingSphere)?1:0;i[s++]=c,c&&r.Z.pack(a.boundingSphere,i,s),s+=r.Z.packedLength;let u=(0,p.Z)(a.boundingSphereCV)?1:0;i[s++]=u,u&&r.Z.pack(a.boundingSphereCV,i,s),s+=r.Z.packedLength;let h=a.attributes,d=[];for(let e in h)h.hasOwnProperty(e)&&(0,p.Z)(h[e])&&(d.push(e),(0,p.Z)(o[e])||(o[e]=n.length,n.push(e)));i[s++]=d.length;for(let e=0;e<d.length;e++){let t=d[e],n=h[t];i[s++]=o[t],i[s++]=n.componentDatatype,i[s++]=n.componentsPerAttribute,i[s++]=n.normalize?1:0,i[s++]=n.values.length,i.set(n.values,s),s+=n.values.length}let m=(0,p.Z)(a.indices)?a.indices.length:0;i[s++]=m,m>0&&(i.set(a.indices,s),s+=m)}return t.push(i.buffer),{stringTable:n,packedData:i}},Y.unpackCreateGeometryResults=function(e){let t;let i=e.stringTable,n=e.packedData,o=Array(n[0]),a=0,s=1;for(;s<n.length;){let e,l,c,u,h,f;if(1!==n[s++]){o[a++]=void 0;continue}let p=n[s++],m=n[s++],_=n[s++];-1===_&&(_=void 0),1===n[s++]&&(e=r.Z.unpack(n,s)),s+=r.Z.packedLength,1===n[s++]&&(l=r.Z.unpack(n,s)),s+=r.Z.packedLength;let g=new v.Z,Z=n[s++];for(t=0;t<Z;t++){let e=i[n[s++]],t=n[s++];h=n[s++];let r=0!==n[s++];c=n[s++],u=d.Z.createTypedArray(t,c);for(let e=0;e<c;e++)u[e]=n[s++];g[e]=new b.Z({componentDatatype:t,componentsPerAttribute:h,normalize:r,values:u})}if((c=n[s++])>0){let e=u.length/h;for(t=0,f=H.Z.createTypedArray(e,c);t<c;t++)f[t]=n[s++]}o[a++]=new y.Z({primitiveType:p,geometryType:m,boundingSphere:e,boundingSphereCV:l,indices:f,attributes:g,offsetAttribute:_})}return o},Y.packCombineGeometryParameters=function(e,t){let i=e.createGeometryResults,n=i.length;for(let e=0;e<n;e++)t.push(i[e].packedData.buffer);return{createGeometryResults:e.createGeometryResults,packedInstances:function(e,t){let i=e.length,n=new Float64Array(1+19*i),r=0;n[r++]=i;for(let t=0;t<i;t++){let i=e[t];if(x.Z.pack(i.modelMatrix,n,r),r+=x.Z.packedLength,(0,p.Z)(i.attributes)&&(0,p.Z)(i.attributes.offset)){let e=i.attributes.offset.value;n[r]=e[0],n[r+1]=e[1],n[r+2]=e[2]}r+=3}return t.push(n.buffer),n}(e.instances,t),ellipsoid:e.ellipsoid,isGeographic:e.projection instanceof k.Z,elementIndexUintSupported:e.elementIndexUintSupported,scene3DOnly:e.scene3DOnly,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:e.modelMatrix,createPickOffsets:e.createPickOffsets}},Y.unpackCombineGeometryParameters=function(e){let t=function(e){let t=Array(e[0]),i=0,n=1;for(;n<e.length;){let r;let o=x.Z.unpack(e,n);n+=x.Z.packedLength,(0,p.Z)(e[n])&&(r={offset:new G.Z(e[n],e[n+1],e[n+2])}),n+=3,t[i++]={modelMatrix:o,attributes:r}}return t}(e.packedInstances),i=e.createGeometryResults,n=i.length,r=0;for(let e=0;e<n;e++){let n=Y.unpackCreateGeometryResults(i[e]),o=n.length;for(let e=0;e<o;e++){let i=n[e];t[r].geometry=i,++r}}let o=U.Z.clone(e.ellipsoid),a=e.isGeographic?new k.Z(o):new j.Z(o);return{instances:t,ellipsoid:o,projection:a,elementIndexUintSupported:e.elementIndexUintSupported,scene3DOnly:e.scene3DOnly,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:x.Z.clone(e.modelMatrix),createPickOffsets:e.createPickOffsets}},Y.packCombineGeometryResults=function(e,t){(0,p.Z)(e.geometries)&&function(e,t){let i=e.length;for(let n=0;n<i;++n)!function(e,t){let i=e.attributes;for(let e in i)if(i.hasOwnProperty(e)){let n=i[e];(0,p.Z)(n)&&(0,p.Z)(n.values)&&t.push(n.values.buffer)}(0,p.Z)(e.indices)&&t.push(e.indices.buffer)}(e[n],t)}(e.geometries,t);let i=X(e.boundingSpheres),n=X(e.boundingSpheresCV);return t.push(i.buffer,n.buffer),{geometries:e.geometries,attributeLocations:e.attributeLocations,modelMatrix:e.modelMatrix,pickOffsets:e.pickOffsets,offsetInstanceExtend:e.offsetInstanceExtend,boundingSpheres:i,boundingSpheresCV:n}},Y.unpackCombineGeometryResults=function(e){return{geometries:e.geometries,attributeLocations:e.attributeLocations,modelMatrix:e.modelMatrix,pickOffsets:e.pickOffsets,offsetInstanceExtend:e.offsetInstanceExtend,boundingSpheres:$(e.boundingSpheres),boundingSpheresCV:$(e.boundingSpheresCV)}};var K=Object.freeze({READY:0,CREATING:1,CREATED:2,COMBINING:3,COMBINED:4,COMPLETE:5,FAILED:6}),Q=i(8593),J=i(1082);function ee(e){if(e=(0,f.Z)(e,f.Z.EMPTY_OBJECT),this.geometryInstances=e.geometryInstances,this.appearance=e.appearance,this._appearance=void 0,this._material=void 0,this.depthFailAppearance=e.depthFailAppearance,this._depthFailAppearance=void 0,this._depthFailMaterial=void 0,this.modelMatrix=x.Z.clone((0,f.Z)(e.modelMatrix,x.Z.IDENTITY)),this._modelMatrix=new x.Z,this.show=(0,f.Z)(e.show,!0),this._vertexCacheOptimize=(0,f.Z)(e.vertexCacheOptimize,!1),this._interleave=(0,f.Z)(e.interleave,!1),this._releaseGeometryInstances=(0,f.Z)(e.releaseGeometryInstances,!0),this._allowPicking=(0,f.Z)(e.allowPicking,!0),this._asynchronous=(0,f.Z)(e.asynchronous,!0),this._compressVertices=(0,f.Z)(e.compressVertices,!0),this.cull=(0,f.Z)(e.cull,!0),this.debugShowBoundingVolume=(0,f.Z)(e.debugShowBoundingVolume,!1),this.rtcCenter=e.rtcCenter,(0,p.Z)(this.rtcCenter)&&(!(0,p.Z)(this.geometryInstances)||Array.isArray(this.geometryInstances)&&1!==this.geometryInstances.length))throw new _.Z("Relative-to-center rendering only supports one geometry instance.");this.shadows=(0,f.Z)(e.shadows,J.Z.DISABLED),this._translucent=void 0,this._state=K.READY,this._geometries=[],this._error=void 0,this._numberOfInstances=0,this._boundingSpheres=[],this._boundingSphereWC=[],this._boundingSphereCV=[],this._boundingSphere2D=[],this._boundingSphereMorph=[],this._perInstanceAttributeCache=new Map,this._instanceIds=[],this._lastPerInstanceAttributeIndex=0,this._va=[],this._attributeLocations=void 0,this._primitiveType=void 0,this._frontFaceRS=void 0,this._backFaceRS=void 0,this._sp=void 0,this._depthFailAppearance=void 0,this._spDepthFail=void 0,this._frontFaceDepthFailRS=void 0,this._backFaceDepthFailRS=void 0,this._pickIds=[],this._colorCommands=[],this._pickCommands=[],this._createBoundingVolumeFunction=e._createBoundingVolumeFunction,this._createRenderStatesFunction=e._createRenderStatesFunction,this._createShaderProgramFunction=e._createShaderProgramFunction,this._createCommandsFunction=e._createCommandsFunction,this._updateAndQueueCommandsFunction=e._updateAndQueueCommandsFunction,this._createPickOffsets=e._createPickOffsets,this._pickOffsets=void 0,this._createGeometryResults=void 0,this._ready=!1,this._batchTable=void 0,this._batchTableAttributeIndices=void 0,this._offsetInstanceExtend=void 0,this._batchTableOffsetAttribute2DIndex=void 0,this._batchTableOffsetsUpdated=!1,this._instanceBoundingSpheres=void 0,this._instanceBoundingSpheresCV=void 0,this._tempBoundingSpheres=void 0,this._recomputeBoundingSpheres=!1,this._batchTableBoundingSpheresUpdated=!1,this._batchTableBoundingSphereAttributeIndices=void 0}Object.defineProperties(ee.prototype,{vertexCacheOptimize:{get:function(){return this._vertexCacheOptimize}},interleave:{get:function(){return this._interleave}},releaseGeometryInstances:{get:function(){return this._releaseGeometryInstances}},allowPicking:{get:function(){return this._allowPicking}},asynchronous:{get:function(){return this._asynchronous}},compressVertices:{get:function(){return this._compressVertices}},ready:{get:function(){return this._ready}}});let et=new o.Z,ei=new a.Z,en=new s.Z;function er(e){let t=e.length;return 1===t?e[0]:2===t?o.Z.unpack(e,0,et):3===t?a.Z.unpack(e,0,ei):4===t?s.Z.unpack(e,0,en):void 0}let eo=/in\s+vec(?:3|4)\s+(.*)3DHigh;/g;function ea(e){let t=L.Z.replaceMain(e,"czm_non_pick_main");return`${t} out vec4 v_pickColor; void main() { czm_non_pick_main(); v_pickColor = czm_batchTable_pickColor(batchId); }`}function es(e){return`in vec4 v_pickColor; ${e}`}function el(e,t){if(!e.compressVertices)return t;let i=-1!==t.search(/in\s+vec3\s+normal;/g),n=-1!==t.search(/in\s+vec2\s+st;/g);if(!i&&!n)return t;let r=-1!==t.search(/in\s+vec3\s+tangent;/g),o=-1!==t.search(/in\s+vec3\s+bitangent;/g),a=n&&i?2:1,s=(a+=r||o?1:0)>1?`vec${a}`:"float",l="compressedAttributes",c=`in ${s} ${l};`,u="",h="";if(n){u+="vec2 st;\n";let e=a>1?`${l}.x`:l;h+=` st = czm_decompressTextureCoordinates(${e}); `}i&&r&&o?(u+="vec3 normal;\nvec3 tangent;\nvec3 bitangent;\n",h+=` czm_octDecode(${l}.${n?"yz":"xy"}, normal, tangent, bitangent); `):(i&&(u+="vec3 normal;\n",h+=` normal = czm_octDecode(${l}${a>1?`.${n?"y":"x"}`:""}); `),r&&(u+="vec3 tangent;\n",h+=` tangent = czm_octDecode(${l}.${n&&i?"z":"y"}); `),o&&(u+="vec3 bitangent;\n",h+=` bitangent = czm_octDecode(${l}.${n&&i?"z":"y"}); `));let d=t;return d=(d=(d=(d=d.replace(/in\s+vec3\s+normal;/g,"")).replace(/in\s+vec2\s+st;/g,"")).replace(/in\s+vec3\s+tangent;/g,"")).replace(/in\s+vec3\s+bitangent;/g,""),[c,u,d=L.Z.replaceMain(d,"czm_non_compressed_main"),`void main() { ${h} czm_non_compressed_main(); }`].join("\n")}function ec(e,t){let i=e.vertexAttributes;for(let e in i)if(i.hasOwnProperty(e)&&!(0,p.Z)(t[e]))throw new _.Z(`Appearance/Geometry mismatch. The appearance requires vertex shader attribute input '${e}', which was not computed as part of the Geometry. Use the appearance's vertexFormat property when constructing the geometry.`)}ee._modifyShaderPosition=function(e,t,i){let n;let r="",o="",a="";for(;null!==(n=eo.exec(t));){let s=n[1],l=`vec4 czm_compute${s[0].toUpperCase()}${s.substr(1)}()`;"vec4 czm_computePosition()"!==l&&(r+=`${l}; `),(0,p.Z)(e.rtcCenter)?(t=(t=t.replace(/in\s+vec(?:3|4)\s+position3DHigh;/g,"")).replace(/in\s+vec(?:3|4)\s+position3DLow;/g,""),r+="uniform mat4 u_modifiedModelView;\n",o+="in vec4 position;\n",a+=`${l} { return u_modifiedModelView * position; } `,t=(t=t.replace(/czm_modelViewRelativeToEye\s+\*\s+/g,"")).replace(/czm_modelViewProjectionRelativeToEye/g,"czm_projection")):i?a+=`${l} { return czm_translateRelativeToEye(${s}3DHigh, ${s}3DLow); } `:(o+=`in vec3 ${s}2DHigh; in vec3 ${s}2DLow; `,a+=`${l} { vec4 p; if (czm_morphTime == 1.0) { p = czm_translateRelativeToEye(${s}3DHigh, ${s}3DLow); } else if (czm_morphTime == 0.0) { p = czm_translateRelativeToEye(${s}2DHigh.zxy, ${s}2DLow.zxy); } else { p = czm_columbusViewMorph( czm_translateRelativeToEye(${s}2DHigh.zxy, ${s}2DLow.zxy), czm_translateRelativeToEye(${s}3DHigh, ${s}3DLow), czm_morphTime); } return p; } `)}return[r,o,t,a].join("\n")},ee._appendShowToShader=function(e,t){if(!(0,p.Z)(e._batchTableAttributeIndices.show))return t;let i=L.Z.replaceMain(t,"czm_non_show_main");return`${i} void main() { czm_non_show_main(); gl_Position *= czm_batchTable_show(batchId); }`},ee._updateColorAttribute=function(e,t,i){if(!(0,p.Z)(e._batchTableAttributeIndices.color)&&!(0,p.Z)(e._batchTableAttributeIndices.depthFailColor)||-1===t.search(/in\s+vec4\s+color;/g))return t;if(i&&!(0,p.Z)(e._batchTableAttributeIndices.depthFailColor))throw new _.Z("A depthFailColor per-instance attribute is required when using a depth fail appearance that uses a color attribute.");let n=t;return n=n.replace(/in\s+vec4\s+color;/g,""),n=i?n.replace(/(\b)color(\b)/g,"$1czm_batchTable_depthFailColor(batchId)$2"):n.replace(/(\b)color(\b)/g,"$1czm_batchTable_color(batchId)$2")},ee._updatePickColorAttribute=function(e){return e.replace(/in\s+vec4\s+pickColor;/g,"").replace(/(\b)pickColor(\b)/g,"$1czm_batchTable_pickColor(batchId)$2")},ee._appendOffsetToShader=function(e,t){if(!(0,p.Z)(e._batchTableAttributeIndices.offset))return t;let i="in float batchId;\n";i+="in float applyOffset;";let n=t.replace(/in\s+float\s+batchId;/g,i),r="vec4 $1 = czm_computePosition();\n";return r+=" if (czm_sceneMode == czm_sceneMode3D)\n {\n $1 = $1 + vec4(czm_batchTable_offset(batchId) * applyOffset, 0.0); }\n else\n {\n $1 = $1 + vec4(czm_batchTable_offset2D(batchId) * applyOffset, 0.0); }\n",n=n.replace(/vec4\s+([A-Za-z0-9_]+)\s+=\s+czm_computePosition\(\);/g,r)},ee._appendDistanceDisplayConditionToShader=function(e,t,i){if(!(0,p.Z)(e._batchTableAttributeIndices.distanceDisplayCondition))return t;let n=L.Z.replaceMain(t,"czm_non_distanceDisplayCondition_main"),r="void main() \n{ \n czm_non_distanceDisplayCondition_main(); \n vec2 distanceDisplayCondition = czm_batchTable_distanceDisplayCondition(batchId);\n vec3 boundingSphereCenter3DHigh = czm_batchTable_boundingSphereCenter3DHigh(batchId);\n vec3 boundingSphereCenter3DLow = czm_batchTable_boundingSphereCenter3DLow(batchId);\n float boundingSphereRadius = czm_batchTable_boundingSphereRadius(batchId);\n";return i?r+=" vec4 centerRTE = czm_translateRelativeToEye(boundingSphereCenter3DHigh, boundingSphereCenter3DLow);\n":r+=" vec3 boundingSphereCenter2DHigh = czm_batchTable_boundingSphereCenter2DHigh(batchId);\n vec3 boundingSphereCenter2DLow = czm_batchTable_boundingSphereCenter2DLow(batchId);\n vec4 centerRTE;\n if (czm_morphTime == 1.0)\n {\n centerRTE = czm_translateRelativeToEye(boundingSphereCenter3DHigh, boundingSphereCenter3DLow);\n }\n else if (czm_morphTime == 0.0)\n {\n centerRTE = czm_translateRelativeToEye(boundingSphereCenter2DHigh.zxy, boundingSphereCenter2DLow.zxy);\n }\n else\n {\n centerRTE = czm_columbusViewMorph(\n czm_translateRelativeToEye(boundingSphereCenter2DHigh.zxy, boundingSphereCenter2DLow.zxy),\n czm_translateRelativeToEye(boundingSphereCenter3DHigh, boundingSphereCenter3DLow),\n czm_morphTime);\n }\n",r+=" float radiusSq = boundingSphereRadius * boundingSphereRadius; \n float distanceSq; \n if (czm_sceneMode == czm_sceneMode2D) \n { \n distanceSq = czm_eyeHeight2D.y - radiusSq; \n } \n else \n { \n distanceSq = dot(centerRTE.xyz, centerRTE.xyz) - radiusSq; \n } \n distanceSq = max(distanceSq, 0.0); \n float nearSq = distanceDisplayCondition.x * distanceDisplayCondition.x; \n float farSq = distanceDisplayCondition.y * distanceDisplayCondition.y; \n float show = (distanceSq >= nearSq && distanceSq <= farSq) ? 1.0 : 0.0; \n gl_Position *= show; \n}",`${n} ${r}`};let eu=Math.max(Z.Z.hardwareConcurrency-1,1),eh=new A.Z("combineGeometry"),ed=new g.Z,ef=new l.Z,ep=new a.Z,em=new r.Z,e_=new a.Z,eg=new a.Z;function eZ(e,t){if(!(0,p.Z)(e._batchTableAttributeIndices.offset)||e._batchTableOffsetsUpdated||t.scene3DOnly)return;let i=e._batchTableOffsetAttribute2DIndex,n=t.mapProjection,o=n.ellipsoid,s=e._batchTable,l=e._instanceBoundingSpheres,c=l.length;for(let t=0;t<c;++t){let c=l[t];if(!(0,p.Z)(c))continue;let u=s.getBatchedAttribute(t,e._batchTableAttributeIndices.offset);if(a.Z.equals(u,a.Z.ZERO)){s.setBatchedAttribute(t,i,a.Z.ZERO);continue}let h=e.modelMatrix;(0,p.Z)(h)&&(c=r.Z.transform(c,h,em));let d=c.center;d=o.scaleToGeodeticSurface(d,eg);let f=o.cartesianToCartographic(d,ef),m=n.project(f,ep),_=a.Z.add(u,d,e_);f=o.cartesianToCartographic(_,f);let g=n.project(f,e_),Z=a.Z.subtract(g,m,e_),y=Z.x;Z.x=Z.z,Z.z=Z.y,Z.y=y,s.setBatchedAttribute(t,i,Z)}e._batchTableOffsetsUpdated=!0}function ey(e,t,i,n){let r,o=i.getRenderState();n?((r=(0,c.Z)(o,!1)).cull={enabled:!0,face:z.Z.BACK},e._frontFaceRS=R.Z.fromCache(r),r.cull.face=z.Z.FRONT,e._backFaceRS=R.Z.fromCache(r)):(e._frontFaceRS=R.Z.fromCache(o),e._backFaceRS=e._frontFaceRS),r=(0,c.Z)(o,!1),(0,p.Z)(e._depthFailAppearance)&&(r.depthTest.enabled=!1),(0,p.Z)(e._depthFailAppearance)&&(o=e._depthFailAppearance.getRenderState(),(r=(0,c.Z)(o,!1)).depthTest.func=B.Z.GREATER,n?(r.cull={enabled:!0,face:z.Z.BACK},e._frontFaceDepthFailRS=R.Z.fromCache(r),r.cull.face=z.Z.FRONT,e._backFaceDepthFailRS=R.Z.fromCache(r)):(e._frontFaceDepthFailRS=R.Z.fromCache(r),e._backFaceDepthFailRS=e._frontFaceRS))}function eb(e,t,i){let n=t.context,r=e._attributeLocations,o=e._batchTable.getVertexShaderCallback()(i.vertexShaderSource);o=ee._appendOffsetToShader(e,o),o=ee._appendShowToShader(e,o),o=ea(o=ee._appendDistanceDisplayConditionToShader(e,o,t.scene3DOnly)),o=ee._updateColorAttribute(e,o,!1),o=el(e,o),o=ee._modifyShaderPosition(e,o,t.scene3DOnly);let a=i.getFragmentShaderSource();if(a=es(a),e._sp=N.Z.replaceCache({context:n,shaderProgram:e._sp,vertexShaderSource:o,fragmentShaderSource:a,attributeLocations:r}),ec(e._sp,r),(0,p.Z)(e._depthFailAppearance)){var s,l;o=e._batchTable.getVertexShaderCallback()(e._depthFailAppearance.vertexShaderSource),o=ee._appendShowToShader(e,o),o=ea(o=ee._appendDistanceDisplayConditionToShader(e,o,t.scene3DOnly)),o=ee._updateColorAttribute(e,o,!0),o=el(e,o),s=o=ee._modifyShaderPosition(e,o,t.scene3DOnly),o=L.Z.replaceMain(s,"czm_non_depth_clamp_main")+"void main() {\n czm_non_depth_clamp_main();\n gl_Position = czm_depthClamp(gl_Position);}\n",l=a=es(a=e._depthFailAppearance.getFragmentShaderSource()),a=L.Z.replaceMain(l,"czm_non_depth_clamp_main")+"void main() {\n czm_non_depth_clamp_main();\n #if defined(LOG_DEPTH)\n czm_writeLogDepth();\n #else\n czm_writeDepthClamp();\n #endif\n}\n",e._spDepthFail=N.Z.replaceCache({context:n,shaderProgram:e._spDepthFail,vertexShaderSource:o,fragmentShaderSource:a,attributeLocations:r}),ec(e._spDepthFail,r)}}let ev=new x.Z,eT=new a.Z;function eE(e,t,i,n){let r=(0,p.Z)(i)?i._uniforms:void 0,o={},a=t.uniforms;if((0,p.Z)(a)){for(let e in a)if(a.hasOwnProperty(e)){if((0,p.Z)(r)&&(0,p.Z)(r[e]))throw new _.Z(`Appearance and material have a uniform with the same name: ${e}`);o[e]=function(e,t){return function(){return e[t]}}(a,e)}}let s=(0,h.Z)(o,r);return s=e._batchTable.getUniformMapCallback()(s),(0,p.Z)(e.rtcCenter)&&(s.u_modifiedModelView=function(){let t=n.context.uniformState.view;return x.Z.multiply(t,e._modelMatrix,ev),x.Z.multiplyByPoint(ev,e.rtcCenter,eT),x.Z.setTranslation(ev,eT,ev),ev}),s}function ex(e,t,i,n,r,o,a,s){let l;let c=eE(e,t,i,s);(0,p.Z)(e._depthFailAppearance)&&(l=eE(e,e._depthFailAppearance,e._depthFailAppearance.material,s));let u=n?P.Z.TRANSLUCENT:P.Z.OPAQUE,h=r?2:1;h*=(0,p.Z)(e._depthFailAppearance)?2:1,o.length=e._va.length*h;let d=o.length,f=0;for(let t=0;t<d;++t){let i;r&&(i=o[t],(0,p.Z)(i)||(i=o[t]=new D.Z({owner:e,primitiveType:e._primitiveType})),i.vertexArray=e._va[f],i.renderState=e._backFaceRS,i.shaderProgram=e._sp,i.uniformMap=c,i.pass=u,++t),i=o[t],(0,p.Z)(i)||(i=o[t]=new D.Z({owner:e,primitiveType:e._primitiveType})),i.vertexArray=e._va[f],i.renderState=e._frontFaceRS,i.shaderProgram=e._sp,i.uniformMap=c,i.pass=u,(0,p.Z)(e._depthFailAppearance)&&(r&&(i=o[++t],(0,p.Z)(i)||(i=o[t]=new D.Z({owner:e,primitiveType:e._primitiveType})),i.vertexArray=e._va[f],i.renderState=e._backFaceDepthFailRS,i.shaderProgram=e._spDepthFail,i.uniformMap=l,i.pass=u),i=o[++t],(0,p.Z)(i)||(i=o[t]=new D.Z({owner:e,primitiveType:e._primitiveType})),i.vertexArray=e._va[f],i.renderState=e._frontFaceDepthFailRS,i.shaderProgram=e._spDepthFail,i.uniformMap=l,i.pass=u),++f}}function ew(e,t,i,n,r,o,a,s){let l;if(t.mode!==Q.Z.SCENE3D&&!x.Z.equals(r,x.Z.IDENTITY))throw new _.Z("Primitive.modelMatrix is only supported in 3D mode.");ee._updateBoundingVolumes(e,t,r),t.mode===Q.Z.SCENE3D?l=e._boundingSphereWC:t.mode===Q.Z.COLUMBUS_VIEW?l=e._boundingSphereCV:t.mode===Q.Z.SCENE2D&&(0,p.Z)(e._boundingSphere2D)?l=e._boundingSphere2D:(0,p.Z)(e._boundingSphereMorph)&&(l=e._boundingSphereMorph);let c=t.commandList,u=t.passes;if(u.render||u.pick){let t=e.allowPicking,n=J.Z.castShadows(e.shadows),u=J.Z.receiveShadows(e.shadows),h=i.length,d=s?2:1;d*=(0,p.Z)(e._depthFailAppearance)?2:1;for(let e=0;e<h;++e){let s=Math.floor(e/d),h=i[e];h.modelMatrix=r,h.boundingVolume=l[s],h.cull=o,h.debugShowBoundingVolume=a,h.castShadows=n,h.receiveShadows=u,t?h.pickId="v_pickColor":h.pickId=void 0,c.push(h)}}}ee._updateBoundingVolumes=function(e,t,i,n){let o,a,s;if(n||!x.Z.equals(i,e._modelMatrix))for(x.Z.clone(i,e._modelMatrix),a=e._boundingSpheres.length,o=0;o<a;++o)s=e._boundingSpheres[o],(0,p.Z)(s)&&(e._boundingSphereWC[o]=r.Z.transform(s,i,e._boundingSphereWC[o]),t.scene3DOnly||(e._boundingSphere2D[o]=r.Z.clone(e._boundingSphereCV[o],e._boundingSphere2D[o]),e._boundingSphere2D[o].center.x=0,e._boundingSphereMorph[o]=r.Z.union(e._boundingSphereWC[o],e._boundingSphereCV[o])));let l=e.appearance.pixelSize;if((0,p.Z)(l))for(o=0,a=e._boundingSpheres.length;o<a;++o){s=e._boundingSpheres[o];let i=e._boundingSphereWC[o],n=t.camera.getPixelSize(s,t.context.drawingBufferWidth,t.context.drawingBufferHeight)*l;i.radius=s.radius+n}},ee.prototype.update=function(e){if(!(0,p.Z)(this.geometryInstances)&&0===this._va.length||(0,p.Z)(this.geometryInstances)&&Array.isArray(this.geometryInstances)&&0===this.geometryInstances.length||!(0,p.Z)(this.appearance)||e.mode!==Q.Z.SCENE3D&&e.scene3DOnly||!e.passes.render&&!e.passes.pick)return;if((0,p.Z)(this._error))throw this._error;if((0,p.Z)(this.rtcCenter)&&!e.scene3DOnly)throw new _.Z("RTC rendering is only available for 3D only scenes.");if(this._state===K.FAILED)return;let t=e.context;if((0,p.Z)(this._batchTable)||function(e,t){let i,n,r,o;let a=e.geometryInstances,s=Array.isArray(a)?a:[a],l=s.length;if(0===l)return;let c=function(e){let t;let i=e.length,n=[],r=e[0].attributes;for(t in r)if(r.hasOwnProperty(t)&&(0,p.Z)(r[t])){let o=r[t],a=!0;for(let n=1;n<i;++n){let i=e[n].attributes[t];if(!(0,p.Z)(i)||o.componentDatatype!==i.componentDatatype||o.componentsPerAttribute!==i.componentsPerAttribute||o.normalize!==i.normalize){a=!1;break}}a&&n.push(t)}return n}(s),h=c.length,m=[],_={},g={},Z=s[0].attributes;for(n=0;n<h;++n)o=Z[r=c[n]],_[r]=n,m.push({functionName:`czm_batchTable_${r}`,componentDatatype:o.componentDatatype,componentsPerAttribute:o.componentsPerAttribute,normalize:o.normalize});-1!==c.indexOf("distanceDisplayCondition")&&(m.push({functionName:"czm_batchTable_boundingSphereCenter3DHigh",componentDatatype:d.Z.FLOAT,componentsPerAttribute:3},{functionName:"czm_batchTable_boundingSphereCenter3DLow",componentDatatype:d.Z.FLOAT,componentsPerAttribute:3},{functionName:"czm_batchTable_boundingSphereCenter2DHigh",componentDatatype:d.Z.FLOAT,componentsPerAttribute:3},{functionName:"czm_batchTable_boundingSphereCenter2DLow",componentDatatype:d.Z.FLOAT,componentsPerAttribute:3},{functionName:"czm_batchTable_boundingSphereRadius",componentDatatype:d.Z.FLOAT,componentsPerAttribute:1}),g.center3DHigh=m.length-5,g.center3DLow=m.length-4,g.center2DHigh=m.length-3,g.center2DLow=m.length-2,g.radius=m.length-1),-1!==c.indexOf("offset")&&(m.push({functionName:"czm_batchTable_offset2D",componentDatatype:d.Z.FLOAT,componentsPerAttribute:3}),i=m.length-1),m.push({functionName:"czm_batchTable_pickColor",componentDatatype:d.Z.UNSIGNED_BYTE,componentsPerAttribute:4,normalize:!0});let y=m.length,b=new F.Z(t,m,l);for(n=0;n<l;++n){let i=s[n];Z=i.attributes;for(let e=0;e<h;++e){let t=er((o=Z[r=c[e]]).value),i=_[r];b.setBatchedAttribute(n,i,t)}let a={primitive:(0,f.Z)(i.pickPrimitive,e)};(0,p.Z)(i.id)&&(a.id=i.id);let l=t.createPickId(a);e._pickIds.push(l);let d=l.color;en.x=u.Z.floatToByte(d.red),en.y=u.Z.floatToByte(d.green),en.z=u.Z.floatToByte(d.blue),en.w=u.Z.floatToByte(d.alpha),b.setBatchedAttribute(n,y-1,en)}e._batchTable=b,e._batchTableAttributeIndices=_,e._batchTableBoundingSphereAttributeIndices=g,e._batchTableOffsetAttribute2DIndex=i}(this,t),this._batchTable.attributes.length>0){if(0===O.Z.maximumVertexTextureImageUnits)throw new S.Z("Vertex texture fetch support is required to render primitives with per-instance attributes. The maximum number of vertex texture image units must be greater than zero.");this._batchTable.update(e)}if(this._state!==K.COMPLETE&&this._state!==K.COMBINED&&(this.asynchronous?function(e,t){let i,r,o,a;let s=e._instanceIds;if(e._state===K.READY){let l;i=Array.isArray(e.geometryInstances)?e.geometryInstances:[e.geometryInstances];let c=e._numberOfInstances=i.length,u=[],h=[];for(o=0;o<c;++o){if(r=i[o].geometry,s.push(i[o].id),(0,p.Z)(r._workerName)&&(0,p.Z)(r._workerPath)||!(0,p.Z)(r._workerName)&&!(0,p.Z)(r._workerPath))throw new _.Z("Must define either _workerName or _workerPath for asynchronous geometry.");h.push({moduleName:r._workerName,modulePath:r._workerPath,geometry:r})}if(!(0,p.Z)(n))for(o=0,n=Array(eu);o<eu;o++)n[o]=new A.Z("createGeometry");for(o=0,h=C(h,eu);o<h.length;o++){let e,t=0,i=h[o],s=i.length;for(a=0;a<s;++a)r=(l=i[a]).geometry,(0,p.Z)(r.constructor.pack)&&(l.offset=t,t+=(0,f.Z)(r.constructor.packedLength,r.packedLength));if(t>0){let n=new Float64Array(t);for(a=0,e=[n.buffer];a<s;++a)r=(l=i[a]).geometry,(0,p.Z)(r.constructor.pack)&&(r.constructor.pack(r,n,l.offset),l.geometry=n)}u.push(n[o].scheduleTask({subTasks:h[o]},e))}e._state=K.CREATING,Promise.all(u).then(function(t){e._createGeometryResults=t,e._state=K.CREATED}).catch(function(i){eO(e,t,K.FAILED,i)})}else if(e._state===K.CREATED){let n=[];i=Array.isArray(e.geometryInstances)?e.geometryInstances:[e.geometryInstances];let r=t.scene3DOnly,o=t.mapProjection,a=eh.scheduleTask(Y.packCombineGeometryParameters({createGeometryResults:e._createGeometryResults,instances:i,ellipsoid:o.ellipsoid,projection:o,elementIndexUintSupported:t.context.elementIndexUint,scene3DOnly:r,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:e.modelMatrix,createPickOffsets:e._createPickOffsets},n),n);e._createGeometryResults=void 0,e._state=K.COMBINING,Promise.resolve(a).then(function(i){let n=Y.unpackCombineGeometryResults(i);e._geometries=n.geometries,e._attributeLocations=n.attributeLocations,e.modelMatrix=x.Z.clone(n.modelMatrix,e.modelMatrix),e._pickOffsets=n.pickOffsets,e._offsetInstanceExtend=n.offsetInstanceExtend,e._instanceBoundingSpheres=n.boundingSpheres,e._instanceBoundingSpheresCV=n.boundingSpheresCV,(0,p.Z)(e._geometries)&&e._geometries.length>0?(e._recomputeBoundingSpheres=!0,e._state=K.COMBINED):eO(e,t,K.FAILED,void 0)}).catch(function(i){eO(e,t,K.FAILED,i)})}}(this,e):function(e,t){let i,n;let o=Array.isArray(e.geometryInstances)?e.geometryInstances:[e.geometryInstances],a=e._numberOfInstances=o.length,s=Array(a),l=e._instanceIds,c=0;for(n=0;n<a;n++){let e;let t=(i=o[n]).geometry;e=(0,p.Z)(t.attributes)&&(0,p.Z)(t.primitiveType)?function(e){let t;let i=e.attributes,n=new v.Z;for(let e in i)i.hasOwnProperty(e)&&(0,p.Z)(i[e])&&(n[e]=function(e){let t;return t=Array.isArray(e.values)?e.values.slice(0):new e.values.constructor(e.values),new b.Z({componentDatatype:e.componentDatatype,componentsPerAttribute:e.componentsPerAttribute,normalize:e.normalize,values:t})}(i[e]));if((0,p.Z)(e.indices)){let i=e.indices;t=Array.isArray(i)?i.slice(0):new i.constructor(i)}return new y.Z({attributes:n,indices:t,primitiveType:e.primitiveType,boundingSphere:r.Z.clone(e.boundingSphere)})}(t):t.constructor.createGeometry(t),s[c++]={geometry:e,attributes:i.attributes,modelMatrix:x.Z.clone(i.modelMatrix),pickPrimitive:i.pickPrimitive,id:i.id},l.push(i.id)}s.length=c;let u=t.scene3DOnly,h=t.mapProjection,d=Y.combineGeometry({instances:s,ellipsoid:h.ellipsoid,projection:h,elementIndexUintSupported:t.context.elementIndexUint,scene3DOnly:u,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:e.modelMatrix,createPickOffsets:e._createPickOffsets});e._geometries=d.geometries,e._attributeLocations=d.attributeLocations,e.modelMatrix=x.Z.clone(d.modelMatrix,e.modelMatrix),e._pickOffsets=d.pickOffsets,e._offsetInstanceExtend=d.offsetInstanceExtend,e._instanceBoundingSpheres=d.boundingSpheres,e._instanceBoundingSpheresCV=d.boundingSpheresCV,(0,p.Z)(e._geometries)&&e._geometries.length>0?(e._recomputeBoundingSpheres=!0,e._state=K.COMBINED):eO(e,t,K.FAILED,void 0)}(this,e)),this._state===K.COMBINED&&(function(e,t){if(!(0,p.Z)(e._batchTableAttributeIndices.distanceDisplayCondition)||e._batchTableBoundingSpheresUpdated)return;let i=e._batchTableBoundingSphereAttributeIndices,n=i.center3DHigh,o=i.center3DLow,a=i.center2DHigh,s=i.center2DLow,l=i.radius,c=t.mapProjection,u=c.ellipsoid,h=e._batchTable,d=e._instanceBoundingSpheres,f=d.length;for(let i=0;i<f;++i){let f=d[i];if(!(0,p.Z)(f))continue;let m=e.modelMatrix;(0,p.Z)(m)&&(f=r.Z.transform(f,m,em));let _=f.center,Z=f.radius,y=g.Z.fromCartesian(_,ed);if(h.setBatchedAttribute(i,n,y.high),h.setBatchedAttribute(i,o,y.low),!t.scene3DOnly){let e=u.cartesianToCartographic(_,ef),t=c.project(e,ep);y=g.Z.fromCartesian(t,ed),h.setBatchedAttribute(i,a,y.high),h.setBatchedAttribute(i,s,y.low)}h.setBatchedAttribute(i,l,Z)}e._batchTableBoundingSpheresUpdated=!0}(this,e),eZ(this,e),function(e,t){let i=e._attributeLocations,n=e._geometries,o=t.scene3DOnly,a=t.context,s=[],l=n.length;for(let c=0;c<l;++c){let l=n[c];if(s.push(M.Z.fromGeometry({context:a,geometry:l,attributeLocations:i,bufferUsage:I.Z.STATIC_DRAW,interleave:e._interleave})),(0,p.Z)(e._createBoundingVolumeFunction))e._createBoundingVolumeFunction(t,l);else if(e._boundingSpheres.push(r.Z.clone(l.boundingSphere)),e._boundingSphereWC.push(new r.Z),!o){let t=l.boundingSphereCV.center,i=t.x,n=t.y,o=t.z;t.x=o,t.y=i,t.z=n,e._boundingSphereCV.push(r.Z.clone(l.boundingSphereCV)),e._boundingSphere2D.push(new r.Z),e._boundingSphereMorph.push(new r.Z)}}e._va=s,e._primitiveType=n[0].primitiveType,e.releaseGeometryInstances&&(e.geometryInstances=void 0),e._geometries=void 0,eO(e,t,K.COMPLETE,void 0)}(this,e)),!this.show||this._state!==K.COMPLETE)return;this._batchTableOffsetsUpdated||eZ(this,e),this._recomputeBoundingSpheres&&function(e,t){let i;let n=e._batchTableAttributeIndices.offset;if(!e._recomputeBoundingSpheres||!(0,p.Z)(n)){e._recomputeBoundingSpheres=!1;return}let o=e._offsetInstanceExtend,s=e._instanceBoundingSpheres,l=s.length,c=e._tempBoundingSpheres;if(!(0,p.Z)(c)){for(i=0,c=Array(l);i<l;i++)c[i]=new r.Z;e._tempBoundingSpheres=c}for(i=0;i<l;++i){let t=c[i],r=e._batchTable.getBatchedAttribute(i,n,new a.Z);eA(t=s[i].clone(t),r,o[i])}let u=[],h=[],d=[];for(i=0;i<l;++i){let e=c[i];e.center.x-e.radius>0||r.Z.intersectPlane(e,w.Z.ORIGIN_ZX_PLANE)!==E.Z.INTERSECTING?u.push(e):(h.push(e),d.push(e))}let f=u[0],m=d[0],_=h[0];for(i=1;i<u.length;i++)f=r.Z.union(f,u[i]);for(i=1;i<d.length;i++)m=r.Z.union(m,d[i]);for(i=1;i<h.length;i++)_=r.Z.union(_,h[i]);let g=[];for((0,p.Z)(f)&&g.push(f),(0,p.Z)(m)&&g.push(m),(0,p.Z)(_)&&g.push(_),i=0;i<g.length;i++){let n=g[i].clone(e._boundingSpheres[i]);e._boundingSpheres[i]=n,e._boundingSphereCV[i]=r.Z.projectTo2D(n,t.mapProjection,e._boundingSphereCV[i])}ee._updateBoundingVolumes(e,t,e.modelMatrix,!0),e._recomputeBoundingSpheres=!1}(this,e);let i=this.appearance,o=i.material,s=!1,l=!1;this._appearance!==i?(this._appearance=i,this._material=o,s=!0,l=!0):this._material!==o&&(this._material=o,l=!0);let c=this.depthFailAppearance,h=(0,p.Z)(c)?c.material:void 0;this._depthFailAppearance!==c?(this._depthFailAppearance=c,this._depthFailMaterial=h,s=!0,l=!0):this._depthFailMaterial!==h&&(this._depthFailMaterial=h,l=!0);let m=this._appearance.isTranslucent();this._translucent!==m&&(this._translucent=m,s=!0),(0,p.Z)(this._material)&&this._material.update(t);let Z=i.closed&&m;s&&(0,f.Z)(this._createRenderStatesFunction,ey)(this,t,i,Z),l&&(0,f.Z)(this._createShaderProgramFunction,eb)(this,e,i),(s||l)&&(0,f.Z)(this._createCommandsFunction,ex)(this,i,o,m,Z,this._colorCommands,this._pickCommands,e),(0,f.Z)(this._updateAndQueueCommandsFunction,ew)(this,e,this._colorCommands,this._pickCommands,this.modelMatrix,this.cull,this.debugShowBoundingVolume,Z)};let eS=new r.Z,eC=new r.Z;function eA(e,t,i){if(i===T.Z.TOP){let i=r.Z.clone(e,eS),n=r.Z.clone(e,eC);n.center=a.Z.add(n.center,t,n.center),e=r.Z.union(i,n,e)}else i===T.Z.ALL&&(e.center=a.Z.add(e.center,t,e.center));return e}let eI=new a.Z;function eO(e,t,i,n){e._error=n,e._state=i,t.afterRender.push(function(){e._ready=e._state===K.COMPLETE||e._state===K.FAILED})}ee.prototype.getGeometryInstanceAttributes=function(e){var t,i,n,o;if(!(0,p.Z)(e))throw new _.Z("id is required");if(!(0,p.Z)(this._batchTable))throw new _.Z("must call update before calling getGeometryInstanceAttributes");let s=this._perInstanceAttributeCache.get(e);if((0,p.Z)(s))return s;let l=-1,c=this._lastPerInstanceAttributeIndex,u=this._instanceIds,h=u.length;for(let t=0;t<h;++t){let i=(c+t)%h;if(e===u[i]){l=i;break}}if(-1===l)return;let f=this._batchTable,m=this._batchTableAttributeIndices;s={};let g={};for(let e in m)if(m.hasOwnProperty(e)){let t=m[e];g[e]={get:function(e,t,i){return function(){let n=e.getBatchedAttribute(t,i),r=e.attributes[i],o=r.componentsPerAttribute,a=d.Z.createTypedArray(r.componentDatatype,o);return(0,p.Z)(n.constructor.pack)?n.constructor.pack(n,a,0):a[0]=n,a}}(f,l,t),set:function(e,t,i,n,r){return function(o){if(!(0,p.Z)(o)||!(0,p.Z)(o.length)||o.length<1||o.length>4)throw new _.Z("value must be and array with length between 1 and 4.");let a=er(o);e.setBatchedAttribute(t,i,a),"offset"===r&&(n._recomputeBoundingSpheres=!0,n._batchTableOffsetsUpdated=!1)}}(f,l,t,this,e)}}return t=this,i=l,g.boundingSphere={get:function(){let e=t._instanceBoundingSpheres[i];if((0,p.Z)(e)){e=e.clone();let n=t.modelMatrix,o=g.offset;(0,p.Z)(o)&&eA(e,a.Z.fromArray(o.get(),0,eI),t._offsetInstanceExtend[i]),(0,p.Z)(n)&&(e=r.Z.transform(e,n))}return e}},g.boundingSphereCV={get:function(){return t._instanceBoundingSpheresCV[i]}},n=this,o=l,g.pickId={get:function(){return n._pickIds[o]}},Object.defineProperties(s,g),this._lastPerInstanceAttributeIndex=l,this._perInstanceAttributeCache.set(e,s),s},ee.prototype.isDestroyed=function(){return!1},ee.prototype.destroy=function(){let e,t;this._sp=this._sp&&this._sp.destroy(),this._spDepthFail=this._spDepthFail&&this._spDepthFail.destroy();let i=this._va;for(t=0,e=i.length;t<e;++t)i[t].destroy();this._va=void 0;let n=this._pickIds;for(t=0,e=n.length;t<e;++t)n[t].destroy();return this._pickIds=void 0,this._batchTable=this._batchTable&&this._batchTable.destroy(),this._instanceIds=void 0,this._perInstanceAttributeCache=void 0,this._attributeLocations=void 0,(0,m.Z)(this)};var eD=ee},6547:function(e,t,i){"use strict";var n=i(530),r=i(4572),o=i(9410),a=i(7998),s=i(9824),l=i(2198);function c(e){e=(0,r.Z)(e,r.Z.EMPTY_OBJECT),this._primitives=[],this._guid=(0,n.Z)(),this._primitiveAdded=new l.Z,this._primitiveRemoved=new l.Z,this._zIndex=void 0,this.show=(0,r.Z)(e.show,!0),this.destroyPrimitives=(0,r.Z)(e.destroyPrimitives,!0)}function u(e,t){if(!e.contains(t))throw new s.Z("primitive is not in this collection.");return e._primitives.indexOf(t)}Object.defineProperties(c.prototype,{length:{get:function(){return this._primitives.length}},primitiveAdded:{get:function(){return this._primitiveAdded}},primitiveRemoved:{get:function(){return this._primitiveRemoved}}}),c.prototype.add=function(e,t){let i=(0,o.Z)(t);if(!(0,o.Z)(e))throw new s.Z("primitive is required.");if(i){if(t<0)throw new s.Z("index must be greater than or equal to zero.");if(t>this._primitives.length)throw new s.Z("index must be less than or equal to the number of primitives.")}let n=e._external=e._external||{};return(n._composites=n._composites||{})[this._guid]={collection:this},i?this._primitives.splice(t,0,e):this._primitives.push(e),this._primitiveAdded.raiseEvent(e),e},c.prototype.remove=function(e){if(this.contains(e)){let t=this._primitives.indexOf(e);if(-1!==t)return this._primitives.splice(t,1),delete e._external._composites[this._guid],this.destroyPrimitives&&e.destroy(),this._primitiveRemoved.raiseEvent(e),!0}return!1},c.prototype.removeAndDestroy=function(e){let t=this.remove(e);return t&&!this.destroyPrimitives&&e.destroy(),t},c.prototype.removeAll=function(){let e=this._primitives,t=e.length;for(let i=0;i<t;++i)delete e[i]._external._composites[this._guid],this.destroyPrimitives&&e[i].destroy(),this._primitiveRemoved.raiseEvent(e[i]);this._primitives=[]},c.prototype.contains=function(e){return!!((0,o.Z)(e)&&e._external&&e._external._composites&&e._external._composites[this._guid])},c.prototype.raise=function(e){if((0,o.Z)(e)){let t=u(this,e),i=this._primitives;if(t!==i.length-1){let e=i[t];i[t]=i[t+1],i[t+1]=e}}},c.prototype.raiseToTop=function(e){if((0,o.Z)(e)){let t=u(this,e),i=this._primitives;t!==i.length-1&&(i.splice(t,1),i.push(e))}},c.prototype.lower=function(e){if((0,o.Z)(e)){let t=u(this,e),i=this._primitives;if(0!==t){let e=i[t];i[t]=i[t-1],i[t-1]=e}}},c.prototype.lowerToBottom=function(e){if((0,o.Z)(e)){let t=u(this,e),i=this._primitives;0!==t&&(i.splice(t,1),i.unshift(e))}},c.prototype.get=function(e){if(!(0,o.Z)(e))throw new s.Z("index is required.");return this._primitives[e]},c.prototype.update=function(e){if(!this.show)return;let t=this._primitives;for(let i=0;i<t.length;++i)t[i].update(e)},c.prototype.prePassesUpdate=function(e){let t=this._primitives;for(let i=0;i<t.length;++i){let n=t[i];(0,o.Z)(n.prePassesUpdate)&&n.prePassesUpdate(e)}},c.prototype.updateForPass=function(e,t){let i=this._primitives;for(let n=0;n<i.length;++n){let r=i[n];(0,o.Z)(r.updateForPass)&&r.updateForPass(e,t)}},c.prototype.postPassesUpdate=function(e){let t=this._primitives;for(let i=0;i<t.length;++i){let n=t[i];(0,o.Z)(n.postPassesUpdate)&&n.postPassesUpdate(e)}},c.prototype.isDestroyed=function(){return!1},c.prototype.destroy=function(){return this.removeAll(),(0,a.Z)(this)},t.Z=c},8593:function(e,t){"use strict";let i={MORPHING:0,COLUMBUS_VIEW:1,SCENE2D:2,SCENE3D:3};i.getMorphTime=function(e){return e===i.SCENE3D?1:e!==i.MORPHING?0:void 0},t.Z=Object.freeze(i)},4364:function(e,t,i){"use strict";var n=i(1373),r=i(570),o=i(1486),a=i(3065),s=i(2820),l=i(9410),c=i(9824),u=i(2150),h=i(4749),d=i(3321),f=i(7604),p=i(7119),m=i(8593);let _={},g=new a.Z(0,0,0,1),Z=new a.Z,y=new n.Z,b=new r.Z,v=new r.Z;_.wgs84ToWindowCoordinates=function(e,t,i){return _.wgs84WithEyeOffsetToWindowCoordinates(e,t,o.Z.ZERO,i)};let T=new a.Z,E=new o.Z;function x(e,t,i,n){let r=i.viewMatrix,s=h.Z.multiplyByVector(r,a.Z.fromElements(e.x,e.y,e.z,1,T),T),l=o.Z.multiplyComponents(t,o.Z.normalize(s,E),E);return s.x+=t.x+l.x,s.y+=t.y+l.y,s.z+=l.z,h.Z.multiplyByVector(i.frustum.projectionMatrix,s,n)}let w=new s.Z(Math.PI,u.Z.PI_OVER_TWO),S=new o.Z,C=new o.Z;_.wgs84WithEyeOffsetToWindowCoordinates=function(e,t,i,n){if(!(0,l.Z)(e))throw new c.Z("scene is required.");if(!(0,l.Z)(t))throw new c.Z("position is required.");let a=e.frameState,s=_.computeActualWgs84Position(a,t,g);if(!(0,l.Z)(s))return;let T=e.canvas;y.x=0,y.y=0,y.width=T.clientWidth,y.height=T.clientHeight;let E=e.camera,A=!1;if(a.mode===m.Z.SCENE2D){let t=e.mapProjection.project(w,S),a=o.Z.clone(E.position,C),l=E.frustum.clone(),c=h.Z.computeViewportTransformation(y,0,1,new h.Z),d=E.frustum.projectionMatrix,f=E.positionWC.y,m=o.Z.fromElements(u.Z.sign(f)*t.x-f,0,-E.positionWC.x),g=p.Z.pointToGLWindowCoordinates(d,c,m);if(0===f||g.x<=0||g.x>=T.clientWidth)A=!0;else{if(g.x>.5*T.clientWidth){y.width=g.x,E.frustum.right=t.x-f,Z=x(s,i,E,Z),_.clipToGLWindowCoordinates(y,Z,b),y.x+=g.x,E.position.x=-E.position.x;let e=E.frustum.right;E.frustum.right=-E.frustum.left,E.frustum.left=-e,Z=x(s,i,E,Z),_.clipToGLWindowCoordinates(y,Z,v)}else{y.x+=g.x,y.width-=g.x,E.frustum.left=-t.x-f,Z=x(s,i,E,Z),_.clipToGLWindowCoordinates(y,Z,b),y.x=y.x-y.width,E.position.x=-E.position.x;let e=E.frustum.left;E.frustum.left=-E.frustum.right,E.frustum.right=-e,Z=x(s,i,E,Z),_.clipToGLWindowCoordinates(y,Z,v)}o.Z.clone(a,E.position),E.frustum=l.clone(),((n=r.Z.clone(b,n)).x<0||n.x>T.clientWidth)&&(n.x=v.x)}}if(a.mode!==m.Z.SCENE2D||A){if((Z=x(s,i,E,Z)).z<0&&!(E.frustum instanceof d.Z)&&!(E.frustum instanceof f.Z))return;n=_.clipToGLWindowCoordinates(y,Z,n)}return n.y=T.clientHeight-n.y,n},_.wgs84ToDrawingBufferCoordinates=function(e,t,i){if(i=_.wgs84ToWindowCoordinates(e,t,i),(0,l.Z)(i))return _.transformWindowToDrawingBuffer(e,i,i)};let A=new o.Z,I=new s.Z;_.computeActualWgs84Position=function(e,t,i){let n=e.mode;if(n===m.Z.SCENE3D)return o.Z.clone(t,i);let r=e.mapProjection,a=r.ellipsoid.cartesianToCartographic(t,I);if(!(0,l.Z)(a))return;if(r.project(a,A),n===m.Z.COLUMBUS_VIEW)return o.Z.fromElements(A.z,A.x,A.y,i);if(n===m.Z.SCENE2D)return o.Z.fromElements(0,A.x,A.y,i);let s=e.morphTime;return o.Z.fromElements(u.Z.lerp(A.z,t.x,s),u.Z.lerp(A.x,t.y,s),u.Z.lerp(A.y,t.z,s),i)};let O=new o.Z,D=new o.Z,P=new h.Z;_.clipToGLWindowCoordinates=function(e,t,i){return o.Z.divideByScalar(t,t.w,O),h.Z.computeViewportTransformation(e,0,1,P),h.Z.multiplyByPoint(P,O,D),r.Z.fromCartesian3(D,i)},_.transformWindowToDrawingBuffer=function(e,t,i){let n=e.canvas,o=e.drawingBufferWidth/n.clientWidth,a=e.drawingBufferHeight/n.clientHeight;return r.Z.fromElements(t.x*o,t.y*a,i)};let R=new a.Z,N=new a.Z;_.drawingBufferToWgs84Coordinates=function(e,t,i,n){let r;let s=e.context.uniformState,c=s.currentFrustum,u=c.x,d=c.y;e.frameState.useLogDepth&&(i=d*(1-u/(Math.pow(2,i*s.log2FarDepthFromNearPlusOne)-1+u))/(d-u));let f=e.view.passState.viewport,p=a.Z.clone(a.Z.UNIT_W,R);p.x=(t.x-f.x)/f.width*2-1,p.y=(t.y-f.y)/f.height*2-1,p.z=2*i-1,p.w=1;let m=e.camera.frustum;if((0,l.Z)(m.fovy)){let e=1/(r=h.Z.multiplyByVector(s.inverseViewProjection,p,N)).w;o.Z.multiplyByScalar(r,e,r)}else{let e=m.offCenterFrustum;(0,l.Z)(e)&&(m=e),(r=N).x=(p.x*(m.right-m.left)+m.left+m.right)*.5,r.y=(p.y*(m.top-m.bottom)+m.bottom+m.top)*.5,r.z=(p.z*(u-d)-u-d)*.5,r.w=1,r=h.Z.multiplyByVector(s.inverseView,r,r)}return o.Z.fromCartesian4(r,n)},t.Z=_},1082:function(e,t){"use strict";let i={DISABLED:0,ENABLED:1,CAST_ONLY:2,RECEIVE_ONLY:3};i.NUMBER_OF_SHADOW_MODES=4,i.castShadows=function(e){return e===i.ENABLED||e===i.CAST_ONLY},i.receiveShadows=function(e){return e===i.ENABLED||e===i.RECEIVE_ONLY},i.fromCastReceive=function(e,t){return e&&t?i.ENABLED:e?i.CAST_ONLY:t?i.RECEIVE_ONLY:i.DISABLED},t.Z=Object.freeze(i)},3812:function(e,t,i){"use strict";i.d(t,{Z:function(){return j}});var n=i(570),r=i(1486),o=i(2820),a=i(698),s=i(7559),l=i(4572),c=i(9410),u=i(3149),h=i(2081),d=i(2150),f=i(4749),p=i(8054),m=i(7119),_=i(8516),g=i(9250),Z="#ifdef TEXTURE_COORDINATES\n#ifdef SPHERICAL\nin vec4 v_sphericalExtents;\n#else // SPHERICAL\nin vec2 v_inversePlaneExtents;\nin vec4 v_westPlane;\nin vec4 v_southPlane;\n#endif // SPHERICAL\nin vec3 v_uvMinAndSphericalLongitudeRotation;\nin vec3 v_uMaxAndInverseDistance;\nin vec3 v_vMaxAndInverseDistance;\n#endif // TEXTURE_COORDINATES\n\n#ifdef PER_INSTANCE_COLOR\nin vec4 v_color;\n#endif\n\n#ifdef NORMAL_EC\nvec3 getEyeCoordinate3FromWindowCoordinate(vec2 fragCoord, float logDepthOrDepth) {\n vec4 eyeCoordinate = czm_windowToEyeCoordinates(fragCoord, logDepthOrDepth);\n return eyeCoordinate.xyz / eyeCoordinate.w;\n}\n\nvec3 vectorFromOffset(vec4 eyeCoordinate, vec2 positiveOffset) {\n vec2 glFragCoordXY = gl_FragCoord.xy;\n // Sample depths at both offset and negative offset\n float upOrRightLogDepth = czm_unpackDepth(texture(czm_globeDepthTexture, (glFragCoordXY + positiveOffset) / czm_viewport.zw));\n float downOrLeftLogDepth = czm_unpackDepth(texture(czm_globeDepthTexture, (glFragCoordXY - positiveOffset) / czm_viewport.zw));\n // Explicitly evaluate both paths\n // Necessary for multifrustum and for edges of the screen\n bvec2 upOrRightInBounds = lessThan(glFragCoordXY + positiveOffset, czm_viewport.zw);\n float useUpOrRight = float(upOrRightLogDepth > 0.0 && upOrRightInBounds.x && upOrRightInBounds.y);\n float useDownOrLeft = float(useUpOrRight == 0.0);\n vec3 upOrRightEC = getEyeCoordinate3FromWindowCoordinate(glFragCoordXY + positiveOffset, upOrRightLogDepth);\n vec3 downOrLeftEC = getEyeCoordinate3FromWindowCoordinate(glFragCoordXY - positiveOffset, downOrLeftLogDepth);\n return (upOrRightEC - (eyeCoordinate.xyz / eyeCoordinate.w)) * useUpOrRight + ((eyeCoordinate.xyz / eyeCoordinate.w) - downOrLeftEC) * useDownOrLeft;\n}\n#endif // NORMAL_EC\n\nvoid main(void)\n{\n#ifdef REQUIRES_EC\n float logDepthOrDepth = czm_unpackDepth(texture(czm_globeDepthTexture, gl_FragCoord.xy / czm_viewport.zw));\n vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, logDepthOrDepth);\n#endif\n\n#ifdef REQUIRES_WC\n vec4 worldCoordinate4 = czm_inverseView * eyeCoordinate;\n vec3 worldCoordinate = worldCoordinate4.xyz / worldCoordinate4.w;\n#endif\n\n#ifdef TEXTURE_COORDINATES\n vec2 uv;\n#ifdef SPHERICAL\n // Treat world coords as a sphere normal for spherical coordinates\n vec2 sphericalLatLong = czm_approximateSphericalCoordinates(worldCoordinate);\n sphericalLatLong.y += v_uvMinAndSphericalLongitudeRotation.z;\n sphericalLatLong.y = czm_branchFreeTernary(sphericalLatLong.y < czm_pi, sphericalLatLong.y, sphericalLatLong.y - czm_twoPi);\n uv.x = (sphericalLatLong.y - v_sphericalExtents.y) * v_sphericalExtents.w;\n uv.y = (sphericalLatLong.x - v_sphericalExtents.x) * v_sphericalExtents.z;\n#else // SPHERICAL\n // Unpack planes and transform to eye space\n uv.x = czm_planeDistance(v_westPlane, eyeCoordinate.xyz / eyeCoordinate.w) * v_inversePlaneExtents.x;\n uv.y = czm_planeDistance(v_southPlane, eyeCoordinate.xyz / eyeCoordinate.w) * v_inversePlaneExtents.y;\n#endif // SPHERICAL\n#endif // TEXTURE_COORDINATES\n\n#ifdef PICK\n#ifdef CULL_FRAGMENTS\n // When classifying translucent geometry, logDepthOrDepth == 0.0\n // indicates a region that should not be classified, possibly due to there\n // being opaque pixels there in another buffer.\n // Check for logDepthOrDepth != 0.0 to make sure this should be classified.\n if (0.0 <= uv.x && uv.x <= 1.0 && 0.0 <= uv.y && uv.y <= 1.0 || logDepthOrDepth != 0.0) {\n out_FragColor.a = 1.0; // 0.0 alpha leads to discard from ShaderSource.createPickFragmentShaderSource\n czm_writeDepthClamp();\n }\n#else // CULL_FRAGMENTS\n out_FragColor.a = 1.0;\n#endif // CULL_FRAGMENTS\n#else // PICK\n\n#ifdef CULL_FRAGMENTS\n // When classifying translucent geometry, logDepthOrDepth == 0.0\n // indicates a region that should not be classified, possibly due to there\n // being opaque pixels there in another buffer.\n if (uv.x <= 0.0 || 1.0 <= uv.x || uv.y <= 0.0 || 1.0 <= uv.y || logDepthOrDepth == 0.0) {\n discard;\n }\n#endif\n\n#ifdef NORMAL_EC\n // Compute normal by sampling adjacent pixels in 2x2 block in screen space\n vec3 downUp = vectorFromOffset(eyeCoordinate, vec2(0.0, 1.0));\n vec3 leftRight = vectorFromOffset(eyeCoordinate, vec2(1.0, 0.0));\n vec3 normalEC = normalize(cross(leftRight, downUp));\n#endif\n\n\n#ifdef PER_INSTANCE_COLOR\n\n vec4 color = czm_gammaCorrect(v_color);\n#ifdef FLAT\n out_FragColor = color;\n#else // FLAT\n czm_materialInput materialInput;\n materialInput.normalEC = normalEC;\n materialInput.positionToEyeEC = -eyeCoordinate.xyz;\n czm_material material = czm_getDefaultMaterial(materialInput);\n material.diffuse = color.rgb;\n material.alpha = color.a;\n\n out_FragColor = czm_phong(normalize(-eyeCoordinate.xyz), material, czm_lightDirectionEC);\n#endif // FLAT\n\n // Premultiply alpha. Required for classification primitives on translucent globe.\n out_FragColor.rgb *= out_FragColor.a;\n\n#else // PER_INSTANCE_COLOR\n\n // Material support.\n // USES_ is distinct from REQUIRES_, because some things are dependencies of each other or\n // dependencies for culling but might not actually be used by the material.\n\n czm_materialInput materialInput;\n\n#ifdef USES_NORMAL_EC\n materialInput.normalEC = normalEC;\n#endif\n\n#ifdef USES_POSITION_TO_EYE_EC\n materialInput.positionToEyeEC = -eyeCoordinate.xyz;\n#endif\n\n#ifdef USES_TANGENT_TO_EYE\n materialInput.tangentToEyeMatrix = czm_eastNorthUpToEyeCoordinates(worldCoordinate, normalEC);\n#endif\n\n#ifdef USES_ST\n // Remap texture coordinates from computed (approximately aligned with cartographic space) to the desired\n // texture coordinate system, which typically forms a tight oriented bounding box around the geometry.\n // Shader is provided a set of reference points for remapping.\n materialInput.st.x = czm_lineDistance(v_uvMinAndSphericalLongitudeRotation.xy, v_uMaxAndInverseDistance.xy, uv) * v_uMaxAndInverseDistance.z;\n materialInput.st.y = czm_lineDistance(v_uvMinAndSphericalLongitudeRotation.xy, v_vMaxAndInverseDistance.xy, uv) * v_vMaxAndInverseDistance.z;\n#endif\n\n czm_material material = czm_getMaterial(materialInput);\n\n#ifdef FLAT\n out_FragColor = vec4(material.diffuse + material.emission, material.alpha);\n#else // FLAT\n out_FragColor = czm_phong(normalize(-eyeCoordinate.xyz), material, czm_lightDirectionEC);\n#endif // FLAT\n\n // Premultiply alpha. Required for classification primitives on translucent globe.\n out_FragColor.rgb *= out_FragColor.a;\n\n#endif // PER_INSTANCE_COLOR\n czm_writeDepthClamp();\n#endif // PICK\n}\n";function y(e,t,i){a.Z.typeOf.bool("extentsCulling",e),a.Z.typeOf.bool("planarExtents",t),a.Z.typeOf.object("appearance",i),this._projectionExtentDefines={eastMostYhighDefine:"",eastMostYlowDefine:"",westMostYhighDefine:"",westMostYlowDefine:""};let n=new x;n.requiresTextureCoordinates=e,n.requiresEC=!i.flat;let r=new x;if(r.requiresTextureCoordinates=e,i instanceof g.Z)n.requiresNormalEC=!i.flat;else{let e=`${i.material.shaderSource} ${i.fragmentShaderSource}`;n.normalEC=-1!==e.indexOf("materialInput.normalEC")||-1!==e.indexOf("czm_getDefaultMaterial"),n.positionToEyeEC=-1!==e.indexOf("materialInput.positionToEyeEC"),n.tangentToEyeMatrix=-1!==e.indexOf("materialInput.tangentToEyeMatrix"),n.st=-1!==e.indexOf("materialInput.st")}this._colorShaderDependencies=n,this._pickShaderDependencies=r,this._appearance=i,this._extentsCulling=e,this._planarExtents=t}y.prototype.createFragmentShader=function(e){a.Z.typeOf.bool("columbusView2D",e);let t=this._appearance,i=this._colorShaderDependencies,n=[];e||this._planarExtents||n.push("SPHERICAL"),i.requiresEC&&n.push("REQUIRES_EC"),i.requiresWC&&n.push("REQUIRES_WC"),i.requiresTextureCoordinates&&n.push("TEXTURE_COORDINATES"),this._extentsCulling&&n.push("CULL_FRAGMENTS"),i.requiresNormalEC&&n.push("NORMAL_EC"),t instanceof g.Z&&n.push("PER_INSTANCE_COLOR"),i.normalEC&&n.push("USES_NORMAL_EC"),i.positionToEyeEC&&n.push("USES_POSITION_TO_EYE_EC"),i.tangentToEyeMatrix&&n.push("USES_TANGENT_TO_EYE"),i.st&&n.push("USES_ST"),t.flat&&n.push("FLAT");let r="";return t instanceof g.Z||(r=t.material.shaderSource),new _.Z({defines:n,sources:[r,Z]})},y.prototype.createPickFragmentShader=function(e){a.Z.typeOf.bool("columbusView2D",e);let t=this._pickShaderDependencies,i=["PICK"];return e||this._planarExtents||i.push("SPHERICAL"),t.requiresEC&&i.push("REQUIRES_EC"),t.requiresWC&&i.push("REQUIRES_WC"),t.requiresTextureCoordinates&&i.push("TEXTURE_COORDINATES"),this._extentsCulling&&i.push("CULL_FRAGMENTS"),new _.Z({defines:i,sources:[Z],pickColorQualifier:"in"})},y.prototype.createVertexShader=function(e,t,i,n){return a.Z.defined("defines",e),a.Z.typeOf.string("vertexShaderSource",t),a.Z.typeOf.bool("columbusView2D",i),a.Z.defined("mapProjection",n),E(this._colorShaderDependencies,this._planarExtents,i,e,t,this._appearance,n,this._projectionExtentDefines)},y.prototype.createPickVertexShader=function(e,t,i,n){return a.Z.defined("defines",e),a.Z.typeOf.string("vertexShaderSource",t),a.Z.typeOf.bool("columbusView2D",i),a.Z.defined("mapProjection",n),E(this._pickShaderDependencies,this._planarExtents,i,e,t,void 0,n,this._projectionExtentDefines)};let b=new r.Z,v=new o.Z,T={high:0,low:0};function E(e,t,i,n,r,o,a,s){let l=n.slice();if(""===s.eastMostYhighDefine){v.longitude=d.Z.PI,v.latitude=0,v.height=0;let e=a.project(v,b),t=u.Z.encode(e.x,T);s.eastMostYhighDefine=`EAST_MOST_X_HIGH ${t.high.toFixed(`${t.high}`.length+1)}`,s.eastMostYlowDefine=`EAST_MOST_X_LOW ${t.low.toFixed(`${t.low}`.length+1)}`,v.longitude=-d.Z.PI,v.latitude=0,v.height=0;let i=a.project(v,b);t=u.Z.encode(i.x,T),s.westMostYhighDefine=`WEST_MOST_X_HIGH ${t.high.toFixed(`${t.high}`.length+1)}`,s.westMostYlowDefine=`WEST_MOST_X_LOW ${t.low.toFixed(`${t.low}`.length+1)}`}return i&&(l.push(s.eastMostYhighDefine),l.push(s.eastMostYlowDefine),l.push(s.westMostYhighDefine),l.push(s.westMostYlowDefine)),(0,c.Z)(o)&&o instanceof g.Z&&l.push("PER_INSTANCE_COLOR"),e.requiresTextureCoordinates&&(l.push("TEXTURE_COORDINATES"),t||i||l.push("SPHERICAL"),i&&l.push("COLUMBUS_VIEW_2D")),new _.Z({defines:l,sources:[r]})}function x(){this._requiresEC=!1,this._requiresWC=!1,this._requiresNormalEC=!1,this._requiresTextureCoordinates=!1,this._usesNormalEC=!1,this._usesPositionToEyeEC=!1,this._usesTangentToEyeMat=!1,this._usesSt=!1}function w(e,t,i){return Math.abs((t.y-e.y)*i.x-(t.x-e.x)*i.y+t.x*e.y-t.y*e.x)/n.Z.distance(t,e)}Object.defineProperties(x.prototype,{requiresEC:{get:function(){return this._requiresEC},set:function(e){this._requiresEC=e||this._requiresEC}},requiresWC:{get:function(){return this._requiresWC},set:function(e){this._requiresWC=e||this._requiresWC,this.requiresEC=this._requiresWC}},requiresNormalEC:{get:function(){return this._requiresNormalEC},set:function(e){this._requiresNormalEC=e||this._requiresNormalEC,this.requiresEC=this._requiresNormalEC}},requiresTextureCoordinates:{get:function(){return this._requiresTextureCoordinates},set:function(e){this._requiresTextureCoordinates=e||this._requiresTextureCoordinates,this.requiresWC=this._requiresTextureCoordinates}},normalEC:{set:function(e){this.requiresNormalEC=e,this._usesNormalEC=e},get:function(){return this._usesNormalEC}},tangentToEyeMatrix:{set:function(e){this.requiresWC=e,this.requiresNormalEC=e,this._usesTangentToEyeMat=e},get:function(){return this._usesTangentToEyeMat}},positionToEyeEC:{set:function(e){this.requiresEC=e,this._usesPositionToEyeEC=e},get:function(){return this._usesPositionToEyeEC}},st:{set:function(e){this.requiresTextureCoordinates=e,this._usesSt=e},get:function(){return this._usesSt}}});let S=[new n.Z,new n.Z,new n.Z,new n.Z];function C(e,t){let i=n.Z.unpack(t,0,S[0]),r=n.Z.unpack(t,2,S[1]),o=n.Z.unpack(t,4,S[2]);e.uMaxVmax=new h.Z({componentDatatype:s.Z.FLOAT,componentsPerAttribute:4,normalize:!1,value:[r.x,r.y,o.x,o.y]});let a=1/w(i,r,o),l=1/w(i,o,r);e.uvMinAndExtents=new h.Z({componentDatatype:s.Z.FLOAT,componentsPerAttribute:4,normalize:!1,value:[i.x,i.y,a,l]})}let A=new o.Z,I=new r.Z,O=new r.Z,D=new r.Z,P={high:0,low:0};function R(e,t,i){A.height=0,A.longitude=e.west,A.latitude=e.south;let n=t.project(A,I);A.latitude=e.north;let r=t.project(A,O);A.longitude=e.east,A.latitude=e.south;let o=t.project(A,D),a=[0,0,0,0],l=[0,0,0,0],c=u.Z.encode(n.x,P);a[0]=c.high,l[0]=c.low,c=u.Z.encode(n.y,P),a[1]=c.high,l[1]=c.low,c=u.Z.encode(r.y,P),a[2]=c.high,l[2]=c.low,c=u.Z.encode(o.x,P),a[3]=c.high,l[3]=c.low,i.planes2D_HIGH=new h.Z({componentDatatype:s.Z.FLOAT,componentsPerAttribute:4,normalize:!1,value:a}),i.planes2D_LOW=new h.Z({componentDatatype:s.Z.FLOAT,componentsPerAttribute:4,normalize:!1,value:l})}let N=new f.Z,L=new f.Z,M=new r.Z,F=new o.Z,z=[new o.Z,new o.Z,new o.Z,new o.Z,new o.Z,new o.Z,new o.Z,new o.Z],B=new r.Z,U=new r.Z,k=new u.Z;y.getPlanarTextureCoordinateAttributes=function(e,t,i,n,c){a.Z.typeOf.object("boundingRectangle",e),a.Z.defined("textureCoordinateRotationPoints",t),a.Z.typeOf.object("ellipsoid",i),a.Z.typeOf.object("projection",n),function(e,t,i,n,a,s){let l=p.Z.center(e,F);l.height=i;let c=o.Z.toCartesian(l,t,M),u=m.Z.eastNorthUpToFixedFrame(c,t,N),h=f.Z.inverse(u,L),d=e.west,_=e.east,g=e.north,Z=e.south;z[0].latitude=Z,z[0].longitude=d,z[1].latitude=g,z[1].longitude=d,z[2].latitude=g,z[2].longitude=_,z[3].latitude=Z,z[3].longitude=_;let y=(d+_)*.5,b=(g+Z)*.5;z[4].latitude=Z,z[4].longitude=y,z[5].latitude=g,z[5].longitude=y,z[6].latitude=b,z[6].longitude=d,z[7].latitude=b,z[7].longitude=_;let v=Number.POSITIVE_INFINITY,T=Number.NEGATIVE_INFINITY,E=Number.POSITIVE_INFINITY,x=Number.NEGATIVE_INFINITY;for(let e=0;e<8;e++){z[e].height=i;let n=o.Z.toCartesian(z[e],t,M);f.Z.multiplyByPoint(h,n,n),n.z=0,v=Math.min(v,n.x),T=Math.max(T,n.x),E=Math.min(E,n.y),x=Math.max(x,n.y)}n.x=v,n.y=E,n.z=0,f.Z.multiplyByPoint(u,n,n),a.x=T,a.y=E,a.z=0,f.Z.multiplyByPoint(u,a,a),r.Z.subtract(a,n,a),s.x=v,s.y=x,s.z=0,f.Z.multiplyByPoint(u,s,s),r.Z.subtract(s,n,s)}(e,i,(0,l.Z)(c,0),I,B,U);let d={};C(d,t);let _=u.Z.fromCartesian(I,k);return d.southWest_HIGH=new h.Z({componentDatatype:s.Z.FLOAT,componentsPerAttribute:3,normalize:!1,value:r.Z.pack(_.high,[0,0,0])}),d.southWest_LOW=new h.Z({componentDatatype:s.Z.FLOAT,componentsPerAttribute:3,normalize:!1,value:r.Z.pack(_.low,[0,0,0])}),d.eastward=new h.Z({componentDatatype:s.Z.FLOAT,componentsPerAttribute:3,normalize:!1,value:r.Z.pack(B,[0,0,0])}),d.northward=new h.Z({componentDatatype:s.Z.FLOAT,componentsPerAttribute:3,normalize:!1,value:r.Z.pack(U,[0,0,0])}),R(e,n,d),d};let V=new r.Z;function H(e,t,i,n){A.latitude=e,A.longitude=t,A.height=0;let r=o.Z.toCartesian(A,i,V),a=Math.sqrt(r.x*r.x+r.y*r.y),s=d.Z.fastApproximateAtan2(a,r.z),l=d.Z.fastApproximateAtan2(r.x,r.y);return n.x=s,n.y=l,n}let G=new n.Z;y.getSphericalExtentGeometryInstanceAttributes=function(e,t,i,n){a.Z.typeOf.object("boundingRectangle",e),a.Z.defined("textureCoordinateRotationPoints",t),a.Z.typeOf.object("ellipsoid",i),a.Z.typeOf.object("projection",n);let r=H(e.south,e.west,i,G),o=r.x,l=r.y,c=H(e.north,e.east,i,G),u=c.x,f=c.y,p=0;l>f&&(p=d.Z.PI-l,l=-d.Z.PI,f+=p),o-=d.Z.EPSILON5,l-=d.Z.EPSILON5,u+=d.Z.EPSILON5;let m=1/((f+=d.Z.EPSILON5)-l),_=1/(u-o),g={sphericalExtents:new h.Z({componentDatatype:s.Z.FLOAT,componentsPerAttribute:4,normalize:!1,value:[o,l,_,m]}),longitudeRotation:new h.Z({componentDatatype:s.Z.FLOAT,componentsPerAttribute:1,normalize:!1,value:[p]})};return C(g,t),R(e,n,g),g},y.hasAttributesForTextureCoordinatePlanes=function(e){return(0,c.Z)(e.southWest_HIGH)&&(0,c.Z)(e.southWest_LOW)&&(0,c.Z)(e.northward)&&(0,c.Z)(e.eastward)&&(0,c.Z)(e.planes2D_HIGH)&&(0,c.Z)(e.planes2D_LOW)&&(0,c.Z)(e.uMaxVmax)&&(0,c.Z)(e.uvMinAndExtents)},y.hasAttributesForSphericalExtents=function(e){return(0,c.Z)(e.sphericalExtents)&&(0,c.Z)(e.longitudeRotation)&&(0,c.Z)(e.planes2D_HIGH)&&(0,c.Z)(e.planes2D_LOW)&&(0,c.Z)(e.uMaxVmax)&&(0,c.Z)(e.uvMinAndExtents)},y.shouldUseSphericalCoordinates=function(e){return a.Z.typeOf.object("rectangle",e),Math.max(e.width,e.height)>y.MAX_WIDTH_FOR_PLANAR_EXTENTS},y.MAX_WIDTH_FOR_PLANAR_EXTENTS=d.Z.toRadians(1);var j=y},7417:function(e,t){"use strict";t.Z=Object.freeze({LEFT:-1,NONE:0,RIGHT:1})},2537:function(e,t,i){"use strict";var n=i(8557),r=i(1022);let o={CESIUM_3D_TILE_MASK:128,SKIP_LOD_MASK:112,SKIP_LOD_BIT_SHIFT:4,CLASSIFICATION_MASK:15};o.setCesium3DTileBit=function(){return{enabled:!0,frontFunction:n.Z.ALWAYS,frontOperation:{fail:r.Z.KEEP,zFail:r.Z.KEEP,zPass:r.Z.REPLACE},backFunction:n.Z.ALWAYS,backOperation:{fail:r.Z.KEEP,zFail:r.Z.KEEP,zPass:r.Z.REPLACE},reference:o.CESIUM_3D_TILE_MASK,mask:o.CESIUM_3D_TILE_MASK}},t.Z=Object.freeze(o)},8557:function(e,t,i){"use strict";var n=i(512);let r={NEVER:n.Z.NEVER,LESS:n.Z.LESS,EQUAL:n.Z.EQUAL,LESS_OR_EQUAL:n.Z.LEQUAL,GREATER:n.Z.GREATER,NOT_EQUAL:n.Z.NOTEQUAL,GREATER_OR_EQUAL:n.Z.GEQUAL,ALWAYS:n.Z.ALWAYS};t.Z=Object.freeze(r)},1022:function(e,t,i){"use strict";var n=i(512);let r={ZERO:n.Z.ZERO,KEEP:n.Z.KEEP,REPLACE:n.Z.REPLACE,INCREMENT:n.Z.INCR,DECREMENT:n.Z.DECR,INVERT:n.Z.INVERT,INCREMENT_WRAP:n.Z.INCR_WRAP,DECREMENT_WRAP:n.Z.DECR_WRAP};t.Z=Object.freeze(r)},6171:function(e,t,i){"use strict";var n=i(7643),r=i(1486),o=i(2820),a=i(698),s=i(4127),l=i(4572),c=i(9410),u=i(1039),h=i(7984),d=i(15),f=i(4749),p=i(7066),m=i(6222),_=i(5352),g=i(8054),Z=i(7372),y=i(9250),b=i(5899),v=i(8593);function T(e){a.Z.typeOf.object("options",e),a.Z.typeOf.object("options.rectangle",e.rectangle),this.rectangle=g.Z.clone(e.rectangle),this.minimumHeight=(0,l.Z)(e.minimumHeight,0),this.maximumHeight=(0,l.Z)(e.maximumHeight,0),this.southwestCornerCartesian=new r.Z,this.northeastCornerCartesian=new r.Z,this.westNormal=new r.Z,this.southNormal=new r.Z,this.eastNormal=new r.Z,this.northNormal=new r.Z;let t=(0,l.Z)(e.ellipsoid,u.Z.WGS84);(function(e,t,i){let n,o;i.cartographicToCartesian(g.Z.southwest(t),e.southwestCornerCartesian),i.cartographicToCartesian(g.Z.northeast(t),e.northeastCornerCartesian),O.longitude=t.west,O.latitude=(t.south+t.north)*.5,O.height=0;let a=i.cartographicToCartesian(O,A),s=r.Z.cross(a,r.Z.UNIT_Z,S);r.Z.normalize(s,e.westNormal),O.longitude=t.east;let l=i.cartographicToCartesian(O,I),c=r.Z.cross(r.Z.UNIT_Z,l,E);r.Z.normalize(c,e.eastNormal);let u=r.Z.subtract(a,l,E);0===r.Z.magnitude(u)&&(u=r.Z.clone(s,u));let h=r.Z.normalize(u,C),f=t.south;if(f>0){O.longitude=(t.west+t.east)*.5,O.latitude=f;let o=i.cartographicToCartesian(O,P.origin);r.Z.clone(h,P.direction);let a=m.Z.fromPointNormal(e.southwestCornerCartesian,e.westNormal,D);d.Z.rayPlane(P,a,e.southwestCornerCartesian),n=i.geodeticSurfaceNormal(o,x)}else n=i.geodeticSurfaceNormalCartographic(g.Z.southeast(t),x);let p=r.Z.cross(n,u,w);r.Z.normalize(p,e.southNormal);let _=t.north;if(_<0){O.longitude=(t.west+t.east)*.5,O.latitude=_;let n=i.cartographicToCartesian(O,P.origin);r.Z.negate(h,P.direction);let a=m.Z.fromPointNormal(e.northeastCornerCartesian,e.eastNormal,D);d.Z.rayPlane(P,a,e.northeastCornerCartesian),o=i.geodeticSurfaceNormal(n,x)}else o=i.geodeticSurfaceNormalCartographic(g.Z.northwest(t),x);let Z=r.Z.cross(u,o,w);r.Z.normalize(Z,e.northNormal)})(this,e.rectangle,t),this._orientedBoundingBox=void 0,this._boundingSphere=void 0,(0,l.Z)(e.computeBoundingVolumes,!0)&&this.computeBoundingVolumes(t)}Object.defineProperties(T.prototype,{boundingVolume:{get:function(){return this._orientedBoundingBox}},boundingSphere:{get:function(){return this._boundingSphere}}}),T.prototype.computeBoundingVolumes=function(e){this._orientedBoundingBox=p.Z.fromRectangle(this.rectangle,this.minimumHeight,this.maximumHeight,e),this._boundingSphere=n.Z.fromOrientedBoundingBox(this._orientedBoundingBox)};let E=new r.Z,x=new r.Z,w=new r.Z,S=new r.Z,C=new r.Z,A=new r.Z,I=new r.Z,O=new o.Z,D=new m.Z(r.Z.UNIT_X,0),P=new _.Z,R=new r.Z,N=new r.Z,L=new r.Z(0,-1,0),M=new r.Z(0,0,-1),F=new r.Z;T.prototype.distanceToCamera=function(e){a.Z.defined("frameState",e);let t=function(e,t){let i,n,o;let a=t.camera,s=a.positionWC,l=a.positionCartographic,c=0;if(!g.Z.contains(e.rectangle,l)){let i=e.southwestCornerCartesian,n=e.northeastCornerCartesian,o=e.westNormal,a=e.southNormal,l=e.eastNormal,u=e.northNormal;t.mode!==v.Z.SCENE3D&&((i=t.mapProjection.project(g.Z.southwest(e.rectangle),R)).z=i.y,i.y=i.x,i.x=0,(n=t.mapProjection.project(g.Z.northeast(e.rectangle),N)).z=n.y,n.y=n.x,n.x=0,o=L,l=r.Z.UNIT_Y,a=M,u=r.Z.UNIT_Z);let h=r.Z.subtract(s,i,F),d=r.Z.dot(h,o),f=r.Z.dot(h,a),p=r.Z.subtract(s,n,F),m=r.Z.dot(p,l),_=r.Z.dot(p,u);d>0?c+=d*d:m>0&&(c+=m*m),f>0?c+=f*f:_>0&&(c+=_*_)}if(t.mode===v.Z.SCENE3D?(i=l.height,n=e.minimumHeight,o=e.maximumHeight):(i=s.x,n=0,o=0),i>o){let e=i-o;c+=e*e}else if(i<n){let e=n-i;c+=e*e}return Math.sqrt(c)}(this,e);return e.mode===v.Z.SCENE3D&&(0,c.Z)(this._orientedBoundingBox)?Math.max(t,Math.sqrt(this._orientedBoundingBox.distanceSquaredTo(e.camera.positionWC))):t},T.prototype.intersectPlane=function(e){return a.Z.defined("plane",e),this._orientedBoundingBox.intersectPlane(e)},T.prototype.createDebugVolume=function(e){a.Z.defined("color",e);let t=new f.Z.clone(f.Z.IDENTITY),i=new Z.Z({rectangle:this.rectangle,height:this.minimumHeight,extrudedHeight:this.maximumHeight}),n=new h.Z({geometry:i,id:"outline",modelMatrix:t,attributes:{color:s.Z.fromColor(e)}});return new b.Z({geometryInstances:n,appearance:new y.Z({translucent:!1,flat:!0}),asynchronous:!1})},t.Z=T},4324:function(e,t){"use strict";t.Z="in vec4 v_color;\n\nvoid main()\n{\n out_FragColor = czm_gammaCorrect(v_color);\n}\n"},8898:function(e,t){"use strict";t.Z="void clipLineSegmentToNearPlane(\n vec3 p0,\n vec3 p1,\n out vec4 positionWC,\n out bool clipped,\n out bool culledByNearPlane,\n out vec4 clippedPositionEC)\n{\n culledByNearPlane = false;\n clipped = false;\n\n vec3 p0ToP1 = p1 - p0;\n float magnitude = length(p0ToP1);\n vec3 direction = normalize(p0ToP1);\n\n // Distance that p0 is behind the near plane. Negative means p0 is\n // in front of the near plane.\n float endPoint0Distance = czm_currentFrustum.x + p0.z;\n\n // Camera looks down -Z.\n // When moving a point along +Z: LESS VISIBLE\n // * Points in front of the camera move closer to the camera.\n // * Points behind the camrea move farther away from the camera.\n // When moving a point along -Z: MORE VISIBLE\n // * Points in front of the camera move farther away from the camera.\n // * Points behind the camera move closer to the camera.\n\n // Positive denominator: -Z, becoming more visible\n // Negative denominator: +Z, becoming less visible\n // Nearly zero: parallel to near plane\n float denominator = -direction.z;\n\n if (endPoint0Distance > 0.0 && abs(denominator) < czm_epsilon7)\n {\n // p0 is behind the near plane and the line to p1 is nearly parallel to\n // the near plane, so cull the segment completely.\n culledByNearPlane = true;\n }\n else if (endPoint0Distance > 0.0)\n {\n // p0 is behind the near plane, and the line to p1 is moving distinctly\n // toward or away from it.\n\n // t = (-plane distance - dot(plane normal, ray origin)) / dot(plane normal, ray direction)\n float t = endPoint0Distance / denominator;\n if (t < 0.0 || t > magnitude)\n {\n // Near plane intersection is not between the two points.\n // We already confirmed p0 is behind the naer plane, so now\n // we know the entire segment is behind it.\n culledByNearPlane = true;\n }\n else\n {\n // Segment crosses the near plane, update p0 to lie exactly on it.\n p0 = p0 + t * direction;\n\n // Numerical noise might put us a bit on the wrong side of the near plane.\n // Don't let that happen.\n p0.z = min(p0.z, -czm_currentFrustum.x);\n\n clipped = true;\n }\n }\n\n clippedPositionEC = vec4(p0, 1.0);\n positionWC = czm_eyeToWindowCoordinates(clippedPositionEC);\n}\n\nvec4 getPolylineWindowCoordinatesEC(vec4 positionEC, vec4 prevEC, vec4 nextEC, float expandDirection, float width, bool usePrevious, out float angle)\n{\n // expandDirection +1 is to the _left_ when looking from positionEC toward nextEC.\n\n#ifdef POLYLINE_DASH\n // Compute the window coordinates of the points.\n vec4 positionWindow = czm_eyeToWindowCoordinates(positionEC);\n vec4 previousWindow = czm_eyeToWindowCoordinates(prevEC);\n vec4 nextWindow = czm_eyeToWindowCoordinates(nextEC);\n\n // Determine the relative screen space direction of the line.\n vec2 lineDir;\n if (usePrevious) {\n lineDir = normalize(positionWindow.xy - previousWindow.xy);\n }\n else {\n lineDir = normalize(nextWindow.xy - positionWindow.xy);\n }\n angle = atan(lineDir.x, lineDir.y) - 1.570796327; // precomputed atan(1,0)\n\n // Quantize the angle so it doesn't change rapidly between segments.\n angle = floor(angle / czm_piOverFour + 0.5) * czm_piOverFour;\n#endif\n\n vec4 clippedPrevWC, clippedPrevEC;\n bool prevSegmentClipped, prevSegmentCulled;\n clipLineSegmentToNearPlane(prevEC.xyz, positionEC.xyz, clippedPrevWC, prevSegmentClipped, prevSegmentCulled, clippedPrevEC);\n\n vec4 clippedNextWC, clippedNextEC;\n bool nextSegmentClipped, nextSegmentCulled;\n clipLineSegmentToNearPlane(nextEC.xyz, positionEC.xyz, clippedNextWC, nextSegmentClipped, nextSegmentCulled, clippedNextEC);\n\n bool segmentClipped, segmentCulled;\n vec4 clippedPositionWC, clippedPositionEC;\n clipLineSegmentToNearPlane(positionEC.xyz, usePrevious ? prevEC.xyz : nextEC.xyz, clippedPositionWC, segmentClipped, segmentCulled, clippedPositionEC);\n\n if (segmentCulled)\n {\n return vec4(0.0, 0.0, 0.0, 1.0);\n }\n\n vec2 directionToPrevWC = normalize(clippedPrevWC.xy - clippedPositionWC.xy);\n vec2 directionToNextWC = normalize(clippedNextWC.xy - clippedPositionWC.xy);\n\n // If a segment was culled, we can't use the corresponding direction\n // computed above. We should never see both of these be true without\n // `segmentCulled` above also being true.\n if (prevSegmentCulled)\n {\n directionToPrevWC = -directionToNextWC;\n }\n else if (nextSegmentCulled)\n {\n directionToNextWC = -directionToPrevWC;\n }\n\n vec2 thisSegmentForwardWC, otherSegmentForwardWC;\n if (usePrevious)\n {\n thisSegmentForwardWC = -directionToPrevWC;\n otherSegmentForwardWC = directionToNextWC;\n }\n else\n {\n thisSegmentForwardWC = directionToNextWC;\n otherSegmentForwardWC = -directionToPrevWC;\n }\n\n vec2 thisSegmentLeftWC = vec2(-thisSegmentForwardWC.y, thisSegmentForwardWC.x);\n\n vec2 leftWC = thisSegmentLeftWC;\n float expandWidth = width * 0.5;\n\n // When lines are split at the anti-meridian, the position may be at the\n // same location as the next or previous position, and we need to handle\n // that to avoid producing NaNs.\n if (!czm_equalsEpsilon(prevEC.xyz - positionEC.xyz, vec3(0.0), czm_epsilon1) && !czm_equalsEpsilon(nextEC.xyz - positionEC.xyz, vec3(0.0), czm_epsilon1))\n {\n vec2 otherSegmentLeftWC = vec2(-otherSegmentForwardWC.y, otherSegmentForwardWC.x);\n\n vec2 leftSumWC = thisSegmentLeftWC + otherSegmentLeftWC;\n float leftSumLength = length(leftSumWC);\n leftWC = leftSumLength < czm_epsilon6 ? thisSegmentLeftWC : (leftSumWC / leftSumLength);\n\n // The sine of the angle between the two vectors is given by the formula\n // |a x b| = |a||b|sin(theta)\n // which is\n // float sinAngle = length(cross(vec3(leftWC, 0.0), vec3(-thisSegmentForwardWC, 0.0)));\n // Because the z components of both vectors are zero, the x and y coordinate will be zero.\n // Therefore, the sine of the angle is just the z component of the cross product.\n vec2 u = -thisSegmentForwardWC;\n vec2 v = leftWC;\n float sinAngle = abs(u.x * v.y - u.y * v.x);\n expandWidth = clamp(expandWidth / sinAngle, 0.0, width * 2.0);\n }\n\n vec2 offset = leftWC * expandDirection * expandWidth * czm_pixelRatio;\n return vec4(clippedPositionWC.xy + offset, -clippedPositionWC.z, 1.0) * (czm_projection * clippedPositionEC).w;\n}\n\nvec4 getPolylineWindowCoordinates(vec4 position, vec4 previous, vec4 next, float expandDirection, float width, bool usePrevious, out float angle)\n{\n vec4 positionEC = czm_modelViewRelativeToEye * position;\n vec4 prevEC = czm_modelViewRelativeToEye * previous;\n vec4 nextEC = czm_modelViewRelativeToEye * next;\n return getPolylineWindowCoordinatesEC(positionEC, prevEC, nextEC, expandDirection, width, usePrevious, angle);\n}\n"},9373:function(e,t){"use strict";t.Z="#ifdef VECTOR_TILE\nuniform vec4 u_highlightColor;\n#endif\n\nin vec2 v_st;\n\nvoid main()\n{\n czm_materialInput materialInput;\n\n vec2 st = v_st;\n st.t = czm_readNonPerspective(st.t, gl_FragCoord.w);\n\n materialInput.s = st.s;\n materialInput.st = st;\n materialInput.str = vec3(st, 0.0);\n\n czm_material material = czm_getMaterial(materialInput);\n out_FragColor = vec4(material.diffuse + material.emission, material.alpha);\n#ifdef VECTOR_TILE\n out_FragColor *= u_highlightColor;\n#endif\n\n czm_writeLogDepth();\n}\n"},9762:function(e,t){"use strict";t.Z="#ifdef VECTOR_TILE\nuniform vec4 u_highlightColor;\n#endif\n\nvoid main(void)\n{\n#ifdef VECTOR_TILE\n out_FragColor = czm_gammaCorrect(u_highlightColor);\n#else\n out_FragColor = vec4(1.0);\n#endif\n czm_writeDepthClamp();\n}\n"},9601:function(e,t,i){"use strict";let n,r,o,a,s,l,c,u,h,d,f;i.d(t,{Z:function(){return yp}});var p,m=i(2059),_=i(1486),g=i(2677),Z=i(4572),y=i(9410),b=i(7998),v=i(9824),T=i(1039),E=i(894),x=function(e){let t;let i=e.name,n=e.message;t=(0,y.Z)(i)&&(0,y.Z)(n)?`${i}: ${n}`:e.toString();let r=e.stack;return(0,y.Z)(r)&&(t+=` ${r}`),t},w=function(e){if("string"==typeof e){let t=document.getElementById(e);if(null===t)throw new v.Z(`Element with id "${e}" does not exist in the document.`);e=t}return e},S=i(7643),C=i(2820),A=i(8177),I=i(2198),O=i(9589),D=i(698),P=i(4754),R=Object.freeze({NONE:0,LERC:1}),N=i(2741),L=i(570),M=i(8757),F=i(2150),z=i(4749),B=i(7066),U=i(8054),k=i(6936),V=i(7559),H=i(7330),G=Object.freeze({NONE:0,BITS12:1});let j=new _.Z,W=new _.Z,q=new L.Z,Y=new z.Z,X=new z.Z;function $(e,t,i,n,r,o,a,s,l,c){let u,h,d=G.NONE;if((0,y.Z)(t)&&(0,y.Z)(i)&&(0,y.Z)(n)&&(0,y.Z)(r)){let e=t.minimum,o=t.maximum,a=_.Z.subtract(o,e,W),s=n-i;d=4095>Math.max(_.Z.maximumComponent(a),s)?G.BITS12:G.NONE,u=z.Z.inverseTransformation(r,new z.Z);let l=_.Z.negate(e,j);z.Z.multiply(z.Z.fromTranslation(l,Y),u,u),j.x=1/a.x,j.y=1/a.y,j.z=1/a.z,z.Z.multiply(z.Z.fromScale(j,Y),u,u),h=z.Z.clone(r),z.Z.setTranslation(h,_.Z.ZERO,h),r=z.Z.clone(r,new z.Z);let c=z.Z.fromTranslation(e,Y),f=z.Z.fromScale(a,X),p=z.Z.multiply(c,f,Y);z.Z.multiply(r,p,r),z.Z.multiply(h,p,h)}this.quantization=d,this.minimumHeight=i,this.maximumHeight=n,this.center=_.Z.clone(e),this.toScaledENU=u,this.fromScaledENU=r,this.matrix=h,this.hasVertexNormals=o,this.hasWebMercatorT=(0,Z.Z)(a,!1),this.hasGeodeticSurfaceNormals=(0,Z.Z)(s,!1),this.exaggeration=(0,Z.Z)(l,1),this.exaggerationRelativeHeight=(0,Z.Z)(c,0),this.stride=0,this._offsetGeodeticSurfaceNormal=0,this._offsetVertexNormal=0,this._calculateStrideAndOffsets()}$.prototype.encode=function(e,t,i,n,r,o,a,s){let l=n.x,c=n.y;if(this.quantization===G.BITS12){(i=z.Z.multiplyByPoint(this.toScaledENU,i,j)).x=F.Z.clamp(i.x,0,1),i.y=F.Z.clamp(i.y,0,1),i.z=F.Z.clamp(i.z,0,1);let n=this.maximumHeight-this.minimumHeight,o=F.Z.clamp((r-this.minimumHeight)/n,0,1);L.Z.fromElements(i.x,i.y,q);let s=k.Z.compressTextureCoordinates(q);L.Z.fromElements(i.z,o,q);let u=k.Z.compressTextureCoordinates(q);L.Z.fromElements(l,c,q);let h=k.Z.compressTextureCoordinates(q);if(e[t++]=s,e[t++]=u,e[t++]=h,this.hasWebMercatorT){L.Z.fromElements(a,0,q);let i=k.Z.compressTextureCoordinates(q);e[t++]=i}}else _.Z.subtract(i,this.center,j),e[t++]=j.x,e[t++]=j.y,e[t++]=j.z,e[t++]=r,e[t++]=l,e[t++]=c,this.hasWebMercatorT&&(e[t++]=a);return this.hasVertexNormals&&(e[t++]=k.Z.octPackFloat(o)),this.hasGeodeticSurfaceNormals&&(e[t++]=s.x,e[t++]=s.y,e[t++]=s.z),t};let K=new _.Z,Q=new _.Z;$.prototype.addGeodeticSurfaceNormals=function(e,t,i){if(this.hasGeodeticSurfaceNormals)return;let n=this.stride,r=e.length/n;this.hasGeodeticSurfaceNormals=!0,this._calculateStrideAndOffsets();let o=this.stride;for(let a=0;a<r;a++){for(let i=0;i<n;i++){let r=a*n+i;t[a*o+i]=e[r]}let r=this.decodePosition(t,a,K),s=i.geodeticSurfaceNormal(r,Q),l=a*o+this._offsetGeodeticSurfaceNormal;t[l]=s.x,t[l+1]=s.y,t[l+2]=s.z}},$.prototype.removeGeodeticSurfaceNormals=function(e,t){if(!this.hasGeodeticSurfaceNormals)return;let i=this.stride,n=e.length/i;this.hasGeodeticSurfaceNormals=!1,this._calculateStrideAndOffsets();let r=this.stride;for(let o=0;o<n;o++)for(let n=0;n<r;n++){let a=o*i+n;t[o*r+n]=e[a]}},$.prototype.decodePosition=function(e,t,i){if((0,y.Z)(i)||(i=new _.Z),t*=this.stride,this.quantization===G.BITS12){let n=k.Z.decompressTextureCoordinates(e[t],q);i.x=n.x,i.y=n.y;let r=k.Z.decompressTextureCoordinates(e[t+1],q);return i.z=r.x,z.Z.multiplyByPoint(this.fromScaledENU,i,i)}return i.x=e[t],i.y=e[t+1],i.z=e[t+2],_.Z.add(i,this.center,i)},$.prototype.getExaggeratedPosition=function(e,t,i){i=this.decodePosition(e,t,i);let n=this.exaggeration,r=this.exaggerationRelativeHeight;if(1!==n&&this.hasGeodeticSurfaceNormals){let o=this.decodeGeodeticSurfaceNormal(e,t,Q),a=this.decodeHeight(e,t),s=H.Z.getHeight(a,n,r)-a;i.x+=o.x*s,i.y+=o.y*s,i.z+=o.z*s}return i},$.prototype.decodeTextureCoordinates=function(e,t,i){return((0,y.Z)(i)||(i=new L.Z),t*=this.stride,this.quantization===G.BITS12)?k.Z.decompressTextureCoordinates(e[t+2],i):L.Z.fromElements(e[t+4],e[t+5],i)},$.prototype.decodeHeight=function(e,t){return(t*=this.stride,this.quantization===G.BITS12)?k.Z.decompressTextureCoordinates(e[t+1],q).y*(this.maximumHeight-this.minimumHeight)+this.minimumHeight:e[t+3]},$.prototype.decodeWebMercatorT=function(e,t){return(t*=this.stride,this.quantization===G.BITS12)?k.Z.decompressTextureCoordinates(e[t+3],q).x:e[t+6]},$.prototype.getOctEncodedNormal=function(e,t,i){let n=e[t=t*this.stride+this._offsetVertexNormal]/256,r=Math.floor(n);return L.Z.fromElements(r,(n-r)*256,i)},$.prototype.decodeGeodeticSurfaceNormal=function(e,t,i){return t=t*this.stride+this._offsetGeodeticSurfaceNormal,i.x=e[t],i.y=e[t+1],i.z=e[t+2],i},$.prototype._calculateStrideAndOffsets=function(){let e=0;this.quantization===G.BITS12?e+=3:e+=6,this.hasWebMercatorT&&(e+=1),this.hasVertexNormals&&(this._offsetVertexNormal=e,e+=1),this.hasGeodeticSurfaceNormals&&(this._offsetGeodeticSurfaceNormal=e,e+=3),this.stride=e};let J={position3DAndHeight:0,textureCoordAndEncodedNormals:1,geodeticSurfaceNormal:2},ee={compressed0:0,compressed1:1,geodeticSurfaceNormal:2};$.prototype.getAttributes=function(e){let t=V.Z.FLOAT,i=V.Z.getSizeInBytes(t),n=this.stride*i,r=0,o=[];function a(a,s){o.push({index:a,vertexBuffer:e,componentDatatype:t,componentsPerAttribute:s,offsetInBytes:r,strideInBytes:n}),r+=s*i}if(this.quantization===G.NONE){let e;a(J.position3DAndHeight,4),e=2+(this.hasWebMercatorT?1:0)+(this.hasVertexNormals?1:0),a(J.textureCoordAndEncodedNormals,e),this.hasGeodeticSurfaceNormals&&a(J.geodeticSurfaceNormal,3)}else{let e=this.hasWebMercatorT||this.hasVertexNormals,t=this.hasWebMercatorT&&this.hasVertexNormals;a(ee.compressed0,e?4:3),t&&a(ee.compressed1,1),this.hasGeodeticSurfaceNormals&&a(ee.geodeticSurfaceNormal,3)}return o},$.prototype.getAttributeLocations=function(){return this.quantization===G.NONE?J:ee},$.clone=function(e,t){if((0,y.Z)(e))return(0,y.Z)(t)||(t=new $),t.quantization=e.quantization,t.minimumHeight=e.minimumHeight,t.maximumHeight=e.maximumHeight,t.center=_.Z.clone(e.center),t.toScaledENU=z.Z.clone(e.toScaledENU),t.fromScaledENU=z.Z.clone(e.fromScaledENU),t.matrix=z.Z.clone(e.matrix),t.hasVertexNormals=e.hasVertexNormals,t.hasWebMercatorT=e.hasWebMercatorT,t.hasGeodeticSurfaceNormals=e.hasGeodeticSurfaceNormals,t.exaggeration=e.exaggeration,t.exaggerationRelativeHeight=e.exaggerationRelativeHeight,t._calculateStrideAndOffsets(),t};var et=i(7119),ei=i(9676);let en={};en.DEFAULT_STRUCTURE=Object.freeze({heightScale:1,heightOffset:0,elementsPerHeight:1,stride:1,elementMultiplier:256,isBigEndian:!1});let er=new _.Z,eo=new z.Z,ea=new _.Z,es=new _.Z;en.computeVertices=function(e){let t,i,n,r,o,a,s,l;if(!(0,y.Z)(e)||!(0,y.Z)(e.heightmap))throw new v.Z("options.heightmap is required.");if(!(0,y.Z)(e.width)||!(0,y.Z)(e.height))throw new v.Z("options.width and options.height are required.");if(!(0,y.Z)(e.nativeRectangle))throw new v.Z("options.nativeRectangle is required.");if(!(0,y.Z)(e.skirtHeight))throw new v.Z("options.skirtHeight is required.");let c=Math.cos,u=Math.sin,h=Math.sqrt,d=Math.atan,f=Math.exp,p=F.Z.PI_OVER_TWO,m=F.Z.toRadians,g=e.heightmap,b=e.width,E=e.height,x=e.skirtHeight,w=(0,Z.Z)(e.isGeographic,!0),C=(0,Z.Z)(e.ellipsoid,T.Z.WGS84),A=1/C.maximumRadius,I=U.Z.clone(e.nativeRectangle),O=U.Z.clone(e.rectangle);(0,y.Z)(O)?(t=O.west,i=O.south,n=O.east,r=O.north):w?(t=m(I.west),i=m(I.south),n=m(I.east),r=m(I.north)):(t=I.west*A,i=p-2*d(f(-I.south*A)),n=I.east*A,r=p-2*d(f(-I.north*A)));let D=e.relativeToCenter,P=(0,y.Z)(D);D=P?D:_.Z.ZERO;let R=(0,Z.Z)(e.includeWebMercatorT,!1),k=(0,Z.Z)(e.exaggeration,1),V=(0,Z.Z)(e.exaggerationRelativeHeight,0),H=1!==k,G=(0,Z.Z)(e.structure,en.DEFAULT_STRUCTURE),j=(0,Z.Z)(G.heightScale,en.DEFAULT_STRUCTURE.heightScale),W=(0,Z.Z)(G.heightOffset,en.DEFAULT_STRUCTURE.heightOffset),q=(0,Z.Z)(G.elementsPerHeight,en.DEFAULT_STRUCTURE.elementsPerHeight),Y=(0,Z.Z)(G.stride,en.DEFAULT_STRUCTURE.stride),X=(0,Z.Z)(G.elementMultiplier,en.DEFAULT_STRUCTURE.elementMultiplier),K=(0,Z.Z)(G.isBigEndian,en.DEFAULT_STRUCTURE.isBigEndian),Q=U.Z.computeWidth(I),J=U.Z.computeHeight(I),ee=Q/(b-1),el=J/(E-1);w||(Q*=A,J*=A);let ec=C.radiiSquared,eu=ec.x,eh=ec.y,ed=ec.z,ef=65536,ep=-65536,em=et.Z.eastNorthUpToFixedFrame(D,C),e_=z.Z.inverseTransformation(em,eo);R&&(o=ei.Z.geodeticLatitudeToMercatorAngle(i),a=1/(ei.Z.geodeticLatitudeToMercatorAngle(r)-o)),ea.x=Number.POSITIVE_INFINITY,ea.y=Number.POSITIVE_INFINITY,ea.z=Number.POSITIVE_INFINITY,es.x=Number.NEGATIVE_INFINITY,es.y=Number.NEGATIVE_INFINITY,es.z=Number.NEGATIVE_INFINITY;let eg=Number.POSITIVE_INFINITY,eZ=b*E,ey=eZ+(x>0?2*b+2*E:0),eb=Array(ey),ev=Array(ey),eT=Array(ey),eE=R?Array(ey):[],ex=H?Array(ey):[],ew=0,eS=E,eC=0,eA=b;x>0&&(--ew,++eS,--eC,++eA);for(let e=ew;e<eS;++e){let s,l=e;l<0&&(l=0),l>=E&&(l=E-1);let Z=I.north-el*l,y=((Z=w?m(Z):p-2*d(f(-Z*A)))-i)/(r-i);y=F.Z.clamp(y,0,1);let v=e===ew,T=e===eS-1;x>0&&(v?Z+=1e-5*J:T&&(Z-=1e-5*J));let S=c(Z),O=u(Z),D=ed*O;R&&(s=(ei.Z.geodeticLatitudeToMercatorAngle(Z)-o)*a);for(let e=eC;e<eA;++e){let i,r=e;r<0&&(r=0),r>=b&&(r=b-1);let o=b*Y*l+r*Y;if(1===q)i=g[o];else{let e;if(i=0,K)for(e=0;e<q;++e)i=i*X+g[o+e];else for(e=q-1;e>=0;--e)i=i*X+g[o+e]}ep=Math.max(ep,i=i*j+W),ef=Math.min(ef,i);let a=I.west+ee*r;w?a=m(a):a*=A;let d=(a-t)/(n-t);d=F.Z.clamp(d,0,1);let f=l*b+r;if(x>0){let t=e===eC,n=e===eA-1,o=v||T||t||n;if((v||T)&&(t||n))continue;o&&(i-=x,t?(f=eZ+(E-l-1),a-=1e-5*Q):T?f=eZ+E+(b-r-1):n?(f=eZ+E+b+l,a+=1e-5*Q):v&&(f=eZ+E+b+E+r))}let p=S*c(a),Z=S*u(a),P=eu*p,N=eh*Z,M=1/h(P*p+N*Z+D*O),B=P*M,U=N*M,k=D*M,V=new _.Z;V.x=B+p*i,V.y=U+Z*i,V.z=k+O*i,z.Z.multiplyByPoint(e_,V,er),_.Z.minimumByComponent(er,ea,ea),_.Z.maximumByComponent(er,es,es),eg=Math.min(eg,i),eb[f]=V,eT[f]=new L.Z(d,y),ev[f]=i,R&&(eE[f]=s),H&&(ex[f]=C.geodeticSurfaceNormal(V))}}let eI=S.Z.fromPoints(eb);(0,y.Z)(O)&&(s=B.Z.fromRectangle(O,ef,ep,C)),P&&(l=new M.Z(C).computeHorizonCullingPointPossiblyUnderEllipsoid(D,eb,ef));let eO=new N.Z(ea,es,D),eD=new $(D,eO,eg,ep,em,!1,R,H,k,V),eP=new Float32Array(ey*eD.stride),eR=0;for(let e=0;e<ey;++e)eR=eD.encode(eP,eR,eb[e],eT[e],ev[e],void 0,eE[e],ex[e]);return{vertices:eP,maximumHeight:ep,minimumHeight:ef,encoding:eD,boundingSphere3D:eI,orientedBoundingBox:s,occludeePointInScaledSpace:l}};var el=i(1250);function ec(){v.Z.throwInstantiationError()}Object.defineProperties(ec.prototype,{credits:{get:v.Z.throwInstantiationError},waterMask:{get:v.Z.throwInstantiationError}}),ec.prototype.interpolateHeight=v.Z.throwInstantiationError,ec.prototype.isChildAvailable=v.Z.throwInstantiationError,ec.prototype.createMesh=v.Z.throwInstantiationError,ec.prototype.upsample=v.Z.throwInstantiationError,ec.prototype.wasCreatedByUpsampling=v.Z.throwInstantiationError,ec.maximumAsynchronousTasks=5;var eu=function(e,t,i,n,r,o,a,s,l,c,u,h,d,f,p,m){this.center=e,this.vertices=t,this.stride=(0,Z.Z)(c,6),this.indices=i,this.indexCountWithoutSkirts=n,this.vertexCountWithoutSkirts=r,this.minimumHeight=o,this.maximumHeight=a,this.boundingSphere3D=s,this.occludeePointInScaledSpace=l,this.orientedBoundingBox=u,this.encoding=h,this.westIndicesSouthToNorth=d,this.southIndicesEastToWest=f,this.eastIndicesNorthToSouth=p,this.northIndicesWestToEast=m},eh=i(5837);function ed(){v.Z.throwInstantiationError()}Object.defineProperties(ed.prototype,{errorEvent:{get:v.Z.throwInstantiationError},credit:{get:v.Z.throwInstantiationError},tilingScheme:{get:v.Z.throwInstantiationError},hasWaterMask:{get:v.Z.throwInstantiationError},hasVertexNormals:{get:v.Z.throwInstantiationError},availability:{get:v.Z.throwInstantiationError}});let ef=[];ed.getRegularGridIndices=function(e,t){if(e*t>=F.Z.FOUR_GIGABYTES)throw new v.Z("The total number of vertices (width * height) must be less than 4,294,967,296.");let i=ef[e];(0,y.Z)(i)||(ef[e]=i=[]);let n=i[t];return(0,y.Z)(n)||(n=e*t<F.Z.SIXTY_FOUR_KILOBYTES?i[t]=new Uint16Array((e-1)*(t-1)*6):i[t]=new Uint32Array((e-1)*(t-1)*6),eg(e,t,n,0)),n};let ep=[];ed.getRegularGridIndicesAndEdgeIndices=function(e,t){if(e*t>=F.Z.FOUR_GIGABYTES)throw new v.Z("The total number of vertices (width * height) must be less than 4,294,967,296.");let i=ep[e];(0,y.Z)(i)||(ep[e]=i=[]);let n=i[t];if(!(0,y.Z)(n)){let r=ed.getRegularGridIndices(e,t),o=e_(e,t),a=o.westIndicesSouthToNorth,s=o.southIndicesEastToWest,l=o.eastIndicesNorthToSouth,c=o.northIndicesWestToEast;n=i[t]={indices:r,westIndicesSouthToNorth:a,southIndicesEastToWest:s,eastIndicesNorthToSouth:l,northIndicesWestToEast:c}}return n};let em=[];function e_(e,t){let i;let n=Array(t),r=Array(e),o=Array(t),a=Array(e);for(i=0;i<e;++i)a[i]=i,r[i]=e*t-1-i;for(i=0;i<t;++i)o[i]=(i+1)*e-1,n[i]=(t-i-1)*e;return{westIndicesSouthToNorth:n,southIndicesEastToWest:r,eastIndicesNorthToSouth:o,northIndicesWestToEast:a}}function eg(e,t,i,n){let r=0;for(let o=0;o<t-1;++o){for(let t=0;t<e-1;++t){let t=r,o=t+e,a=o+1,s=t+1;i[n++]=t,i[n++]=o,i[n++]=s,i[n++]=s,i[n++]=o,i[n++]=a,++r}++r}}function eZ(e,t,i,n){let r=e[0],o=e.length;for(let a=1;a<o;++a){let o=e[a];i[n++]=r,i[n++]=o,i[n++]=t,i[n++]=t,i[n++]=o,i[n++]=t+1,r=o,++t}return n}function ey(e){if(!(0,y.Z)(e)||!(0,y.Z)(e.buffer))throw new v.Z("options.buffer is required.");if(!(0,y.Z)(e.width))throw new v.Z("options.width is required.");if(!(0,y.Z)(e.height))throw new v.Z("options.height is required.");this._buffer=e.buffer,this._width=e.width,this._height=e.height,this._childTileMask=(0,Z.Z)(e.childTileMask,15),this._encoding=(0,Z.Z)(e.encoding,R.NONE);let t=en.DEFAULT_STRUCTURE,i=e.structure;(0,y.Z)(i)?i!==t&&(i.heightScale=(0,Z.Z)(i.heightScale,t.heightScale),i.heightOffset=(0,Z.Z)(i.heightOffset,t.heightOffset),i.elementsPerHeight=(0,Z.Z)(i.elementsPerHeight,t.elementsPerHeight),i.stride=(0,Z.Z)(i.stride,t.stride),i.elementMultiplier=(0,Z.Z)(i.elementMultiplier,t.elementMultiplier),i.isBigEndian=(0,Z.Z)(i.isBigEndian,t.isBigEndian)):i=t,this._structure=i,this._createdByUpsampling=(0,Z.Z)(e.createdByUpsampling,!1),this._waterMask=e.waterMask,this._skirtHeight=void 0,this._bufferType=this._encoding===R.LERC?Float32Array:this._buffer.constructor,this._mesh=void 0}ed.getRegularGridAndSkirtIndicesAndEdgeIndices=function(e,t){if(e*t>=F.Z.FOUR_GIGABYTES)throw new v.Z("The total number of vertices (width * height) must be less than 4,294,967,296.");let i=em[e];(0,y.Z)(i)||(em[e]=i=[]);let n=i[t];if(!(0,y.Z)(n)){let r=e*t,o=(e-1)*(t-1)*6,a=2*e+2*t,s=e_(e,t),l=s.westIndicesSouthToNorth,c=s.southIndicesEastToWest,u=s.eastIndicesNorthToSouth,h=s.northIndicesWestToEast,d=eh.Z.createTypedArray(r+a,o+6*Math.max(0,a-4));eg(e,t,d,0),ed.addSkirtIndices(l,c,u,h,r,d,o),n=i[t]={indices:d,westIndicesSouthToNorth:l,southIndicesEastToWest:c,eastIndicesNorthToSouth:u,northIndicesWestToEast:h,indexCountWithoutSkirts:o}}return n},ed.addSkirtIndices=function(e,t,i,n,r,o,a){let s=r;a=eZ(e,s,o,a),s+=e.length,a=eZ(t,s,o,a),s+=t.length,a=eZ(i,s,o,a),eZ(n,s+=i.length,o,a)},ed.heightmapTerrainQuality=.25,ed.getEstimatedLevelZeroGeometricErrorForAHeightmap=function(e,t,i){return 2*e.maximumRadius*Math.PI*ed.heightmapTerrainQuality/(t*i)},ed.prototype.requestTileGeometry=v.Z.throwInstantiationError,ed.prototype.getLevelMaximumGeometricError=v.Z.throwInstantiationError,ed.prototype.getTileDataAvailable=v.Z.throwInstantiationError,ed.prototype.loadTileDataAvailability=v.Z.throwInstantiationError,Object.defineProperties(ey.prototype,{credits:{get:function(){}},waterMask:{get:function(){return this._waterMask}},childTileMask:{get:function(){return this._childTileMask}}});let eb="createVerticesFromHeightmap",ev=new el.Z(eb),eT=new el.Z(eb,ec.maximumAsynchronousTasks);function eE(e,t,i,n,r,o,a,s,l){let c=(s-r.west)*(o-1)/(r.east-r.west),u=(l-r.south)*(a-1)/(r.north-r.south),h=0|c,d=h+1;d>=o&&(d=o-1,h=o-2);let f=0|u,p=f+1;p>=a&&(p=a-1,f=a-2);let m=c-h,_=u-f;f=a-1-f,p=a-1-p;let g=(t.decodeHeight(e,f*o+h)-i)/n;return ex(m,_,g,(t.decodeHeight(e,f*o+d)-i)/n,(t.decodeHeight(e,p*o+h)-i)/n,(t.decodeHeight(e,p*o+d)-i)/n)}function ex(e,t,i,n,r,o){return t<e?i+e*(n-i)+t*(o-n):i+e*(o-r)+t*(r-i)}function ew(e,t,i,n,r,o){let a;o*=n;let s=0;if(r)for(a=0;a<t;++a)s=s*i+e[o+a];else for(a=t-1;a>=0;--a)s=s*i+e[o+a];return s}function eS(e){e=(0,Z.Z)(e,Z.Z.EMPTY_OBJECT),this._tilingScheme=e.tilingScheme,(0,y.Z)(this._tilingScheme)||(this._tilingScheme=new O.Z({ellipsoid:(0,Z.Z)(e.ellipsoid,T.Z.WGS84)})),this._levelZeroMaximumGeometricError=ed.getEstimatedLevelZeroGeometricErrorForAHeightmap(this._tilingScheme.ellipsoid,64,this._tilingScheme.getNumberOfXTilesAtLevel(0)),this._errorEvent=new I.Z}ey.prototype.createMesh=function(e){e=(0,Z.Z)(e,Z.Z.EMPTY_OBJECT),D.Z.typeOf.object("options.tilingScheme",e.tilingScheme),D.Z.typeOf.number("options.x",e.x),D.Z.typeOf.number("options.y",e.y),D.Z.typeOf.number("options.level",e.level);let t=e.tilingScheme,i=e.x,n=e.y,r=e.level,o=(0,Z.Z)(e.exaggeration,1),a=(0,Z.Z)(e.exaggerationRelativeHeight,0),s=(0,Z.Z)(e.throttle,!0),l=t.ellipsoid,c=t.tileXYToNativeRectangle(i,n,r),u=t.tileXYToRectangle(i,n,r),h=l.cartographicToCartesian(U.Z.center(u)),d=this._structure,f=ed.getEstimatedLevelZeroGeometricErrorForAHeightmap(l,this._width,t.getNumberOfXTilesAtLevel(0))/(1<<r);this._skirtHeight=Math.min(4*f,1e3);let p=(s?eT:ev).scheduleTask({heightmap:this._buffer,structure:d,includeWebMercatorT:!0,width:this._width,height:this._height,nativeRectangle:c,rectangle:u,relativeToCenter:h,ellipsoid:l,skirtHeight:this._skirtHeight,isGeographic:t.projection instanceof P.Z,exaggeration:o,exaggerationRelativeHeight:a,encoding:this._encoding});if(!(0,y.Z)(p))return;let m=this;return Promise.resolve(p).then(function(e){let t;t=m._skirtHeight>0?ed.getRegularGridAndSkirtIndicesAndEdgeIndices(e.gridWidth,e.gridHeight):ed.getRegularGridIndicesAndEdgeIndices(e.gridWidth,e.gridHeight);let i=e.gridWidth*e.gridHeight;return m._mesh=new eu(h,new Float32Array(e.vertices),t.indices,t.indexCountWithoutSkirts,i,e.minimumHeight,e.maximumHeight,S.Z.clone(e.boundingSphere3D),_.Z.clone(e.occludeePointInScaledSpace),e.numberOfAttributes,B.Z.clone(e.orientedBoundingBox),$.clone(e.encoding),t.westIndicesSouthToNorth,t.southIndicesEastToWest,t.eastIndicesNorthToSouth,t.northIndicesWestToEast),m._buffer=void 0,m._mesh})},ey.prototype._createMeshSync=function(e){let t;D.Z.typeOf.object("options.tilingScheme",e.tilingScheme),D.Z.typeOf.number("options.x",e.x),D.Z.typeOf.number("options.y",e.y),D.Z.typeOf.number("options.level",e.level);let i=e.tilingScheme,n=e.x,r=e.y,o=e.level,a=(0,Z.Z)(e.exaggeration,1),s=(0,Z.Z)(e.exaggerationRelativeHeight,0),l=i.ellipsoid,c=i.tileXYToNativeRectangle(n,r,o),u=i.tileXYToRectangle(n,r,o),h=l.cartographicToCartesian(U.Z.center(u)),d=this._structure,f=ed.getEstimatedLevelZeroGeometricErrorForAHeightmap(l,this._width,i.getNumberOfXTilesAtLevel(0))/(1<<o);this._skirtHeight=Math.min(4*f,1e3);let p=en.computeVertices({heightmap:this._buffer,structure:d,includeWebMercatorT:!0,width:this._width,height:this._height,nativeRectangle:c,rectangle:u,relativeToCenter:h,ellipsoid:l,skirtHeight:this._skirtHeight,isGeographic:i.projection instanceof P.Z,exaggeration:a,exaggerationRelativeHeight:s});this._buffer=void 0,t=this._skirtHeight>0?ed.getRegularGridAndSkirtIndicesAndEdgeIndices(this._width,this._height):ed.getRegularGridIndicesAndEdgeIndices(this._width,this._height);let m=p.gridWidth*p.gridHeight;return this._mesh=new eu(h,p.vertices,t.indices,t.indexCountWithoutSkirts,m,p.minimumHeight,p.maximumHeight,p.boundingSphere3D,p.occludeePointInScaledSpace,p.encoding.stride,p.orientedBoundingBox,p.encoding,t.westIndicesSouthToNorth,t.southIndicesEastToWest,t.eastIndicesNorthToSouth,t.northIndicesWestToEast),this._mesh},ey.prototype.interpolateHeight=function(e,t,i){let n;let r=this._width,o=this._height,a=this._structure,s=a.stride,l=a.elementsPerHeight,c=a.elementMultiplier,u=a.isBigEndian,h=a.heightOffset,d=a.heightScale,f=(0,y.Z)(this._mesh),p=this._encoding===R.LERC;if(f||!p)return f?eE(this._mesh.vertices,this._mesh.encoding,h,d,e,r,o,t,i):function(e,t,i,n,r,o,a,s,l,c){let u=(l-o.west)*(a-1)/(o.east-o.west),h=(c-o.south)*(s-1)/(o.north-o.south),d=0|u,f=d+1;f>=a&&(f=a-1,d=a-2);let p=0|h,m=p+1;m>=s&&(m=s-1,p=s-2);let _=u-d,g=h-p;p=s-1-p,m=s-1-m;let Z=ew(e,t,i,n,r,p*a+d);return ex(_,g,Z,ew(e,t,i,n,r,p*a+f),ew(e,t,i,n,r,m*a+d),ew(e,t,i,n,r,m*a+f))}(this._buffer,l,c,s,u,e,r,o,t,i)*d+h},ey.prototype.upsample=function(e,t,i,n,r,o,a){if(!(0,y.Z)(e))throw new v.Z("tilingScheme is required.");if(!(0,y.Z)(t))throw new v.Z("thisX is required.");if(!(0,y.Z)(i))throw new v.Z("thisY is required.");if(!(0,y.Z)(n))throw new v.Z("thisLevel is required.");if(!(0,y.Z)(r))throw new v.Z("descendantX is required.");if(!(0,y.Z)(o))throw new v.Z("descendantY is required.");if(!(0,y.Z)(a))throw new v.Z("descendantLevel is required.");if(a-n>1)throw new v.Z("Upsampling through more than one level at a time is not currently supported.");let s=this._mesh;if(!(0,y.Z)(s))return;let l=this._width,c=this._height,u=this._structure,h=u.stride,d=new this._bufferType(l*c*h),f=s.vertices,p=s.encoding,m=e.tileXYToRectangle(t,i,n),_=e.tileXYToRectangle(r,o,a),g=u.heightOffset,Z=u.heightScale,b=u.elementsPerHeight,T=u.elementMultiplier,E=u.isBigEndian,x=Math.pow(T,b-1);for(let e=0;e<c;++e){let t=F.Z.lerp(_.north,_.south,e/(c-1));for(let i=0;i<l;++i){let n=F.Z.lerp(_.west,_.east,i/(l-1)),r=eE(f,p,g,Z,m,l,c,n,t);(function(e,t,i,n,r,o,a,s){let l;if(a*=r,o)for(l=0;l<t-1;++l)e[a+l]=s/n|0,s-=e[a+l]*n,n/=i;else for(l=t-1;l>0;--l)e[a+l]=s/n|0,s-=e[a+l]*n,n/=i;e[a+l]=s})(d,b,T,x,h,E,e*l+i,r=(r=r<u.lowestEncodedHeight?u.lowestEncodedHeight:r)>u.highestEncodedHeight?u.highestEncodedHeight:r)}}return Promise.resolve(new ey({buffer:d,width:l,height:c,childTileMask:0,structure:this._structure,createdByUpsampling:!0}))},ey.prototype.isChildAvailable=function(e,t,i,n){if(!(0,y.Z)(e))throw new v.Z("thisX is required.");if(!(0,y.Z)(t))throw new v.Z("thisY is required.");if(!(0,y.Z)(i))throw new v.Z("childX is required.");if(!(0,y.Z)(n))throw new v.Z("childY is required.");let r=2;return i!==2*e&&++r,n!==2*t&&(r-=2),(this._childTileMask&1<<r)!=0},ey.prototype.wasCreatedByUpsampling=function(){return this._createdByUpsampling},Object.defineProperties(eS.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){}},tilingScheme:{get:function(){return this._tilingScheme}},hasWaterMask:{get:function(){return!1}},hasVertexNormals:{get:function(){return!1}},availability:{get:function(){}}}),eS.prototype.requestTileGeometry=function(e,t,i,n){return Promise.resolve(new ey({buffer:new Uint8Array(256),width:16,height:16}))},eS.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)},eS.prototype.getTileDataAvailable=function(e,t,i){},eS.prototype.loadTileDataAvailability=function(e,t,i){};var eC=i(15),eA=i(3336),eI=i(5352),eO=i(8358),eD=i(8516),eP=i(4909),eR="uniform vec3 u_radiiAndDynamicAtmosphereColor;\n\nuniform float u_atmosphereLightIntensity;\nuniform float u_atmosphereRayleighScaleHeight;\nuniform float u_atmosphereMieScaleHeight;\nuniform float u_atmosphereMieAnisotropy;\nuniform vec3 u_atmosphereRayleighCoefficient;\nuniform vec3 u_atmosphereMieCoefficient;\n\nconst float ATMOSPHERE_THICKNESS = 111e3; // The thickness of the atmosphere in meters.\nconst int PRIMARY_STEPS_MAX = 16; // Maximum number of times the ray from the camera to the world position (primary ray) is sampled.\nconst int LIGHT_STEPS_MAX = 4; // Maximum number of times the light is sampled from the light source's intersection with the atmosphere to a sample position on the primary ray.\n\n/**\n * This function computes the colors contributed by Rayliegh and Mie scattering on a given ray, as well as\n * the transmittance value for the ray.\n *\n * @param {czm_ray} primaryRay The ray from the camera to the position.\n * @param {float} primaryRayLength The length of the primary ray.\n * @param {vec3} lightDirection The direction of the light to calculate the scattering from.\n * @param {vec3} rayleighColor The variable the Rayleigh scattering will be written to.\n * @param {vec3} mieColor The variable the Mie scattering will be written to.\n * @param {float} opacity The variable the transmittance will be written to.\n * @glslFunction\n */\nvoid computeScattering(\n czm_ray primaryRay,\n float primaryRayLength,\n vec3 lightDirection,\n float atmosphereInnerRadius,\n out vec3 rayleighColor,\n out vec3 mieColor,\n out float opacity\n) {\n\n // Initialize the default scattering amounts to 0.\n rayleighColor = vec3(0.0);\n mieColor = vec3(0.0);\n opacity = 0.0;\n\n float atmosphereOuterRadius = atmosphereInnerRadius + ATMOSPHERE_THICKNESS;\n\n vec3 origin = vec3(0.0);\n\n // Calculate intersection from the camera to the outer ring of the atmosphere.\n czm_raySegment primaryRayAtmosphereIntersect = czm_raySphereIntersectionInterval(primaryRay, origin, atmosphereOuterRadius);\n\n // Return empty colors if no intersection with the atmosphere geometry.\n if (primaryRayAtmosphereIntersect == czm_emptyRaySegment) {\n return;\n }\n\n // To deal with smaller values of PRIMARY_STEPS (e.g. 4)\n // we implement a split strategy: sky or horizon.\n // For performance reasons, instead of a if/else branch\n // a soft choice is implemented through a weight 0.0 <= w_stop_gt_lprl <= 1.0\n float x = 1e-7 * primaryRayAtmosphereIntersect.stop / length(primaryRayLength);\n // Value close to 0.0: close to the horizon\n // Value close to 1.0: above in the sky\n float w_stop_gt_lprl = 0.5 * (1.0 + czm_approximateTanh(x));\n\n // The ray should start from the first intersection with the outer atmopshere, or from the camera position, if it is inside the atmosphere.\n float start_0 = primaryRayAtmosphereIntersect.start;\n primaryRayAtmosphereIntersect.start = max(primaryRayAtmosphereIntersect.start, 0.0);\n // The ray should end at the exit from the atmosphere or at the distance to the vertex, whichever is smaller.\n primaryRayAtmosphereIntersect.stop = min(primaryRayAtmosphereIntersect.stop, length(primaryRayLength));\n\n // For the number of ray steps, distinguish inside or outside atmosphere (outer space)\n // (1) from outer space we have to use more ray steps to get a realistic rendering\n // (2) within atmosphere we need fewer steps for faster rendering\n float x_o_a = start_0 - ATMOSPHERE_THICKNESS; // ATMOSPHERE_THICKNESS used as an ad-hoc constant, no precise meaning here, only the order of magnitude matters\n float w_inside_atmosphere = 1.0 - 0.5 * (1.0 + czm_approximateTanh(x_o_a));\n int PRIMARY_STEPS = PRIMARY_STEPS_MAX - int(w_inside_atmosphere * 12.0); // Number of times the ray from the camera to the world position (primary ray) is sampled.\n int LIGHT_STEPS = LIGHT_STEPS_MAX - int(w_inside_atmosphere * 2.0); // Number of times the light is sampled from the light source's intersection with the atmosphere to a sample position on the primary ray.\n\n // Setup for sampling positions along the ray - starting from the intersection with the outer ring of the atmosphere.\n float rayPositionLength = primaryRayAtmosphereIntersect.start;\n // (1) Outside the atmosphere: constant rayStepLength\n // (2) Inside atmosphere: variable rayStepLength to compensate the rough rendering of the smaller number of ray steps\n float totalRayLength = primaryRayAtmosphereIntersect.stop - rayPositionLength;\n float rayStepLengthIncrease = w_inside_atmosphere * ((1.0 - w_stop_gt_lprl) * totalRayLength / (float(PRIMARY_STEPS * (PRIMARY_STEPS + 1)) / 2.0));\n float rayStepLength = max(1.0 - w_inside_atmosphere, w_stop_gt_lprl) * totalRayLength / max(7.0 * w_inside_atmosphere, float(PRIMARY_STEPS));\n\n vec3 rayleighAccumulation = vec3(0.0);\n vec3 mieAccumulation = vec3(0.0);\n vec2 opticalDepth = vec2(0.0);\n vec2 heightScale = vec2(u_atmosphereRayleighScaleHeight, u_atmosphereMieScaleHeight);\n\n // Sample positions on the primary ray.\n for (int i = 0; i < PRIMARY_STEPS_MAX; ++i) {\n\n // The loop should be: for (int i = 0; i < PRIMARY_STEPS; ++i) {...} but WebGL1 cannot\n // loop with non-constant condition, so it has to break early instead\n if (i >= PRIMARY_STEPS) {\n break;\n }\n\n // Calculate sample position along viewpoint ray.\n vec3 samplePosition = primaryRay.origin + primaryRay.direction * (rayPositionLength + rayStepLength);\n\n // Calculate height of sample position above ellipsoid.\n float sampleHeight = length(samplePosition) - atmosphereInnerRadius;\n\n // Calculate and accumulate density of particles at the sample position.\n vec2 sampleDensity = exp(-sampleHeight / heightScale) * rayStepLength;\n opticalDepth += sampleDensity;\n\n // Generate ray from the sample position segment to the light source, up to the outer ring of the atmosphere.\n czm_ray lightRay = czm_ray(samplePosition, lightDirection);\n czm_raySegment lightRayAtmosphereIntersect = czm_raySphereIntersectionInterval(lightRay, origin, atmosphereOuterRadius);\n\n float lightStepLength = lightRayAtmosphereIntersect.stop / float(LIGHT_STEPS);\n float lightPositionLength = 0.0;\n\n vec2 lightOpticalDepth = vec2(0.0);\n\n // Sample positions along the light ray, to accumulate incidence of light on the latest sample segment.\n for (int j = 0; j < LIGHT_STEPS_MAX; ++j) {\n\n // The loop should be: for (int j = 0; i < LIGHT_STEPS; ++j) {...} but WebGL1 cannot\n // loop with non-constant condition, so it has to break early instead\n if (j >= LIGHT_STEPS) {\n break;\n }\n\n // Calculate sample position along light ray.\n vec3 lightPosition = samplePosition + lightDirection * (lightPositionLength + lightStepLength * 0.5);\n\n // Calculate height of the light sample position above ellipsoid.\n float lightHeight = length(lightPosition) - atmosphereInnerRadius;\n\n // Calculate density of photons at the light sample position.\n lightOpticalDepth += exp(-lightHeight / heightScale) * lightStepLength;\n\n // Increment distance on light ray.\n lightPositionLength += lightStepLength;\n }\n\n // Compute attenuation via the primary ray and the light ray.\n vec3 attenuation = exp(-((u_atmosphereMieCoefficient * (opticalDepth.y + lightOpticalDepth.y)) + (u_atmosphereRayleighCoefficient * (opticalDepth.x + lightOpticalDepth.x))));\n\n // Accumulate the scattering.\n rayleighAccumulation += sampleDensity.x * attenuation;\n mieAccumulation += sampleDensity.y * attenuation;\n\n // Increment distance on primary ray.\n rayPositionLength += (rayStepLength += rayStepLengthIncrease);\n }\n\n // Compute the scattering amount.\n rayleighColor = u_atmosphereRayleighCoefficient * rayleighAccumulation;\n mieColor = u_atmosphereMieCoefficient * mieAccumulation;\n\n // Compute the transmittance i.e. how much light is passing through the atmosphere.\n opacity = length(exp(-((u_atmosphereMieCoefficient * opticalDepth.y) + (u_atmosphereRayleighCoefficient * opticalDepth.x))));\n}\n\nvec4 computeAtmosphereColor(\n vec3 positionWC,\n vec3 lightDirection,\n vec3 rayleighColor,\n vec3 mieColor,\n float opacity\n) {\n // Setup the primary ray: from the camera position to the vertex position.\n vec3 cameraToPositionWC = positionWC - czm_viewerPositionWC;\n vec3 cameraToPositionWCDirection = normalize(cameraToPositionWC);\n\n float cosAngle = dot(cameraToPositionWCDirection, lightDirection);\n float cosAngleSq = cosAngle * cosAngle;\n\n float G = u_atmosphereMieAnisotropy;\n float GSq = G * G;\n\n // The Rayleigh phase function.\n float rayleighPhase = 3.0 / (50.2654824574) * (1.0 + cosAngleSq);\n // The Mie phase function.\n float miePhase = 3.0 / (25.1327412287) * ((1.0 - GSq) * (cosAngleSq + 1.0)) / (pow(1.0 + GSq - 2.0 * cosAngle * G, 1.5) * (2.0 + GSq));\n\n // The final color is generated by combining the effects of the Rayleigh and Mie scattering.\n vec3 rayleigh = rayleighPhase * rayleighColor;\n vec3 mie = miePhase * mieColor;\n\n vec3 color = (rayleigh + mie) * u_atmosphereLightIntensity;\n\n return vec4(color, opacity);\n}\n",eN="void computeAtmosphereScattering(vec3 positionWC, vec3 lightDirection, out vec3 rayleighColor, out vec3 mieColor, out float opacity) {\n\n vec3 cameraToPositionWC = positionWC - czm_viewerPositionWC;\n vec3 cameraToPositionWCDirection = normalize(cameraToPositionWC);\n czm_ray primaryRay = czm_ray(czm_viewerPositionWC, cameraToPositionWCDirection);\n \n float atmosphereInnerRadius = length(positionWC);\n\n computeScattering(\n primaryRay,\n length(cameraToPositionWC),\n lightDirection,\n atmosphereInnerRadius,\n rayleighColor,\n mieColor,\n opacity\n );\n}\n",eL=i(9698),eM=i(2835);let eF=new L.Z;var ez=function(e,t){let i,n,r,o;D.Z.typeOf.object("clippingPlaneCollection",e),D.Z.typeOf.object("context",t);let a=e.unionClippingRegions,s=e.length,l=eM.Z.useFloatTexture(t),c=eM.Z.getTextureResolution(e,t,eF),u=c.x,h=c.y;return(l?(-1===(i=`${1/u}`).indexOf(".")&&(i+=".0"),-1===(n=`${1/h}`).indexOf(".")&&(n+=".0"),`vec4 getClippingPlane(highp sampler2D packedClippingPlanes, int clippingPlaneNumber, mat4 transform) { int pixY = clippingPlaneNumber / ${u}; int pixX = clippingPlaneNumber - (pixY * ${u}); float u = (float(pixX) + 0.5) * ${i}; float v = (float(pixY) + 0.5) * ${n}; vec4 plane = texture(packedClippingPlanes, vec2(u, v)); return czm_transformPlane(plane, transform); } `):(-1===(r=`${1/u}`).indexOf(".")&&(r+=".0"),-1===(o=`${1/h}`).indexOf(".")&&(o+=".0"),`vec4 getClippingPlane(highp sampler2D packedClippingPlanes, int clippingPlaneNumber, mat4 transform) { int clippingPlaneStartIndex = clippingPlaneNumber * 2; int pixY = clippingPlaneStartIndex / ${u}; int pixX = clippingPlaneStartIndex - (pixY * ${u}); float u = (float(pixX) + 0.5) * ${r}; float v = (float(pixY) + 0.5) * ${o}; vec4 oct32 = texture(packedClippingPlanes, vec2(u, v)) * 255.0; vec2 oct = vec2(oct32.x * 256.0 + oct32.y, oct32.z * 256.0 + oct32.w); vec4 plane; plane.xyz = czm_octDecode(oct, 65535.0); plane.w = czm_unpackFloat(texture(packedClippingPlanes, vec2(u + ${r}, v))); return czm_transformPlane(plane, transform); } `))+"\n"+(a?`float clip(vec4 fragCoord, sampler2D clippingPlanes, mat4 clippingPlanesMatrix) { vec4 position = czm_windowToEyeCoordinates(fragCoord); vec3 clipNormal = vec3(0.0); vec3 clipPosition = vec3(0.0); float clipAmount; float pixelWidth = czm_metersPerPixel(position); bool breakAndDiscard = false; for (int i = 0; i < ${s}; ++i) { vec4 clippingPlane = getClippingPlane(clippingPlanes, i, clippingPlanesMatrix); clipNormal = clippingPlane.xyz; clipPosition = -clippingPlane.w * clipNormal; float amount = dot(clipNormal, (position.xyz - clipPosition)) / pixelWidth; clipAmount = czm_branchFreeTernary(i == 0, amount, min(amount, clipAmount)); if (amount <= 0.0) { breakAndDiscard = true; break; } } if (breakAndDiscard) { discard; } return clipAmount; } `:`float clip(vec4 fragCoord, sampler2D clippingPlanes, mat4 clippingPlanesMatrix) { bool clipped = true; vec4 position = czm_windowToEyeCoordinates(fragCoord); vec3 clipNormal = vec3(0.0); vec3 clipPosition = vec3(0.0); float clipAmount = 0.0; float pixelWidth = czm_metersPerPixel(position); for (int i = 0; i < ${s}; ++i) { vec4 clippingPlane = getClippingPlane(clippingPlanes, i, clippingPlanesMatrix); clipNormal = clippingPlane.xyz; clipPosition = -clippingPlane.w * clipNormal; float amount = dot(clipNormal, (position.xyz - clipPosition)) / pixelWidth; clipAmount = max(amount, clipAmount); clipped = clipped && (amount <= 0.0); } if (clipped) { discard; } return clipAmount; } `)},eB=i(8593);function eU(e,t,i,n,r,o){this.numberOfDayTextures=e,this.flags=t,this.material=i,this.shaderProgram=n,this.clippingShaderState=r,this.clippingPolygonShaderState=o}function ek(){this.baseVertexShaderSource=void 0,this.baseFragmentShaderSource=void 0,this._shadersByTexturesFlags=[],this.material=void 0}ek.prototype.getShaderProgram=function(e){let t=e.frameState,i=e.surfaceTile,n=e.numberOfDayTextures,r=e.applyBrightness,o=e.applyContrast,a=e.applyHue,s=e.applySaturation,l=e.applyGamma,c=e.applyAlpha,u=e.applyDayNightAlpha,h=e.applySplit,d=e.showReflectiveOcean,f=e.showOceanWaves,p=e.enableLighting,m=e.dynamicAtmosphereLighting,_=e.dynamicAtmosphereLightingFromSun,g=e.showGroundAtmosphere,Z=e.perFragmentGroundAtmosphere,b=e.hasVertexNormals,v=e.useWebMercatorProjection,T=e.enableFog,E=e.enableClippingPlanes,x=e.clippingPlanes,w=e.enableClippingPolygons,S=e.clippingPolygons,C=e.clippedByBoundaries,A=e.hasImageryLayerCutout,I=e.colorCorrect,O=e.highlightFillTile,D=e.colorToAlpha,P=e.hasGeodeticSurfaceNormals,R=e.hasExaggeration,N=e.showUndergroundColor,L=e.translucent,M=0,F="",z=i.renderedMesh.encoding;z.quantization===G.BITS12&&(M=1,F="QUANTIZATION_BITS12");let B=0,U="";C&&(B=1,U="TILE_LIMIT_RECTANGLE");let k=0,V="";A&&(k=1,V="APPLY_IMAGERY_CUTOUT");let H=t.mode,j=H|r<<2|o<<3|a<<4|s<<5|l<<6|c<<7|d<<8|f<<9|p<<10|m<<11|_<<12|g<<13|Z<<14|b<<15|v<<16|T<<17|M<<18|h<<19|E<<20|w<<21|B<<22|k<<23|I<<24|O<<25|D<<26|P<<27|R<<28|N<<29|L<<30|u<<31,W=0;(0,y.Z)(x)&&x.length>0&&(W=E?x.clippingPlanesState:0);let q=0;(0,y.Z)(S)&&S.length>0&&(q=w?S.clippingPolygonsState:0);let Y=i.surfaceShader;if((0,y.Z)(Y)&&Y.numberOfDayTextures===n&&Y.flags===j&&Y.material===this.material&&Y.clippingShaderState===W&&Y.clippingPolygonShaderState===q)return Y.shaderProgram;let X=this._shadersByTexturesFlags[n];if((0,y.Z)(X)||(X=this._shadersByTexturesFlags[n]=[]),Y=X[j],!(0,y.Z)(Y)||Y.material!==this.material||Y.clippingShaderState!==W||Y.clippingPolygonShaderState!==q){let e=this.baseVertexShaderSource.clone(),i=this.baseFragmentShaderSource.clone();0!==W&&i.sources.unshift(ez(x,t.context)),0!==q&&(i.sources.unshift(t.context.webgl2?`void clipPolygons(highp sampler2D clippingDistance, int regionsLength, vec2 clippingPosition, int regionIndex) { czm_clipPolygons(clippingDistance, regionsLength, clippingPosition, regionIndex); }`:`void clipPolygons(highp sampler2D clippingDistance, int regionsLength, vec2 clippingPosition, int regionIndex) { }`),e.sources.unshift(t.context.webgl2?`vec4 unpackClippingExtents(highp sampler2D extentsTexture, int index) { return czm_unpackClippingExtents(extentsTexture, index); }`:`vec4 unpackClippingExtents(highp sampler2D extentsTexture, int index) { return vec4(); }`)),e.defines.push(F),i.defines.push(`TEXTURE_UNITS ${n}`,U,V),r&&i.defines.push("APPLY_BRIGHTNESS"),o&&i.defines.push("APPLY_CONTRAST"),a&&i.defines.push("APPLY_HUE"),s&&i.defines.push("APPLY_SATURATION"),l&&i.defines.push("APPLY_GAMMA"),c&&i.defines.push("APPLY_ALPHA"),u&&i.defines.push("APPLY_DAY_NIGHT_ALPHA"),d&&(i.defines.push("SHOW_REFLECTIVE_OCEAN"),e.defines.push("SHOW_REFLECTIVE_OCEAN")),f&&i.defines.push("SHOW_OCEAN_WAVES"),D&&i.defines.push("APPLY_COLOR_TO_ALPHA"),N&&(e.defines.push("UNDERGROUND_COLOR"),i.defines.push("UNDERGROUND_COLOR")),L&&(e.defines.push("TRANSLUCENT"),i.defines.push("TRANSLUCENT")),p&&(b?(e.defines.push("ENABLE_VERTEX_LIGHTING"),i.defines.push("ENABLE_VERTEX_LIGHTING")):(e.defines.push("ENABLE_DAYNIGHT_SHADING"),i.defines.push("ENABLE_DAYNIGHT_SHADING"))),m&&(e.defines.push("DYNAMIC_ATMOSPHERE_LIGHTING"),i.defines.push("DYNAMIC_ATMOSPHERE_LIGHTING"),_&&(e.defines.push("DYNAMIC_ATMOSPHERE_LIGHTING_FROM_SUN"),i.defines.push("DYNAMIC_ATMOSPHERE_LIGHTING_FROM_SUN"))),g&&(e.defines.push("GROUND_ATMOSPHERE"),i.defines.push("GROUND_ATMOSPHERE"),Z&&(e.defines.push("PER_FRAGMENT_GROUND_ATMOSPHERE"),i.defines.push("PER_FRAGMENT_GROUND_ATMOSPHERE"))),e.defines.push("INCLUDE_WEB_MERCATOR_Y"),i.defines.push("INCLUDE_WEB_MERCATOR_Y"),T&&(e.defines.push("FOG"),i.defines.push("FOG")),h&&i.defines.push("APPLY_SPLIT"),E&&i.defines.push("ENABLE_CLIPPING_PLANES"),w&&(i.defines.push("ENABLE_CLIPPING_POLYGONS"),e.defines.push("ENABLE_CLIPPING_POLYGONS"),S.inverse&&i.defines.push("CLIPPING_INVERSE"),i.defines.push(`CLIPPING_POLYGON_REGIONS_LENGTH ${S.extentsCount}`),e.defines.push(`CLIPPING_POLYGON_REGIONS_LENGTH ${S.extentsCount}`)),I&&i.defines.push("COLOR_CORRECT"),O&&i.defines.push("HIGHLIGHT_FILL_TILE"),P&&e.defines.push("GEODETIC_SURFACE_NORMALS"),R&&e.defines.push("EXAGGERATION");let y=" vec4 computeDayColor(vec4 initialColor, vec3 textureCoordinates, float nightBlend)\n {\n vec4 color = initialColor;\n";A&&(y+=" vec4 cutoutAndColorResult;\n bool texelUnclipped;\n");for(let e=0;e<n;++e)A?y+=`\ cutoutAndColorResult = u_dayTextureCutoutRectangles[${e}]; \ texelUnclipped = v_textureCoordinates.x < cutoutAndColorResult.x || cutoutAndColorResult.z < v_textureCoordinates.x || v_textureCoordinates.y < cutoutAndColorResult.y || cutoutAndColorResult.w < v_textureCoordinates.y; \ cutoutAndColorResult = sampleAndBlend( `:y+=" color = sampleAndBlend(\n",y+=`\ color, \ u_dayTextures[${e}], \ u_dayTextureUseWebMercatorT[${e}] ? textureCoordinates.xz : textureCoordinates.xy, \ u_dayTextureTexCoordsRectangle[${e}], \ u_dayTextureTranslationAndScale[${e}], \ ${c?`u_dayTextureAlpha[${e}]`:"1.0"}, \ ${u?`u_dayTextureNightAlpha[${e}]`:"1.0"}, ${u?`u_dayTextureDayAlpha[${e}]`:"1.0"}, ${r?`u_dayTextureBrightness[${e}]`:"0.0"}, \ ${o?`u_dayTextureContrast[${e}]`:"0.0"}, \ ${a?`u_dayTextureHue[${e}]`:"0.0"}, \ ${s?`u_dayTextureSaturation[${e}]`:"0.0"}, \ ${l?`u_dayTextureOneOverGamma[${e}]`:"0.0"}, \ ${h?`u_dayTextureSplit[${e}]`:"0.0"}, \ ${D?`u_colorsToAlpha[${e}]`:"vec4(0.0)"}, \ nightBlend\ ); `,A&&(y+=" color = czm_branchFreeTernary(texelUnclipped, cutoutAndColorResult, color);\n");y+=" return color;\n }",i.sources.push(y),e.sources.push(function(e){let t;switch(e){case eB.Z.SCENE3D:t="vec4 getPosition(vec3 position, float height, vec2 textureCoordinates) { return getPosition3DMode(position, height, textureCoordinates); }";break;case eB.Z.SCENE2D:case eB.Z.COLUMBUS_VIEW:t="vec4 getPosition(vec3 position, float height, vec2 textureCoordinates) { return getPositionColumbusViewMode(position, height, textureCoordinates); }";break;case eB.Z.MORPHING:t="vec4 getPosition(vec3 position, float height, vec2 textureCoordinates) { return getPositionMorphingMode(position, height, textureCoordinates); }"}return t}(H)),e.sources.push(v?"float get2DYPositionFraction(vec2 textureCoordinates) { return get2DMercatorYPositionFraction(textureCoordinates); }":"float get2DYPositionFraction(vec2 textureCoordinates) { return get2DGeographicYPositionFraction(textureCoordinates); }");let C=eL.Z.fromCache({context:t.context,vertexShaderSource:e,fragmentShaderSource:i,attributeLocations:z.getAttributeLocations()});Y=X[j]=new eU(n,j,this.material,C,W,q)}return i.surfaceShader=Y,Y.shaderProgram},ek.prototype.destroy=function(){let e,t;let i=this._shadersByTexturesFlags;for(let n in i)if(i.hasOwnProperty(n)){let r=i[n];if(!(0,y.Z)(r))continue;for(e in r)r.hasOwnProperty(e)&&(t=r[e],(0,y.Z)(t)&&t.shaderProgram.destroy())}return(0,b.Z)(this)};var eV=i(9054),eH=i(3065),eG=i(49),ej=i(4127),eW=i(2115),eq=i(7984),eY=i(2926),eX=i(487),e$=i(3321),eK=i(5022),eQ=i(3358),eJ=Object.freeze({NONE:-1,PARTIAL:0,FULL:1}),e0=i(9780),e1=i(2598),e2=i(4318),e3=i(356),e4=i(7363),e5=i(480),e9=i(6450),e8=i(1205),e6=i(2923),e7=i(5292),te=i(6055),tt=i(8664),ti=i(1731),tn=i(4433);function tr(e,t,i,n,r,o,a){this.provider=e,this.message=t,this.x=i,this.y=n,this.level=r,this.timesRetried=(0,Z.Z)(o,0),this.retry=!1,this.error=a}tr.reportError=function(e,t,i,n,r,o,a,s){let l=e;return(0,y.Z)(e)?(l.provider=t,l.message=n,l.x=r,l.y=o,l.level=a,l.retry=!1,l.error=s,++l.timesRetried):l=new tr(t,n,r,o,a,0,s),(0,y.Z)(i)&&i.numberOfListeners>0?i.raiseEvent(l):(0,y.Z)(t)&&console.log(`An error occurred in "${t.constructor.name}": ${x(n)}`),l},tr.reportSuccess=function(e){(0,y.Z)(e)&&(e.timesRetried=-1)};var to=i(5463),ta=i(5483),ts=i(5874),tl=i(9138),tc=i(9053),tu=Object.freeze({UNLOADED:0,TRANSITIONING:1,RECEIVED:2,TEXTURE_LOADED:3,READY:4,FAILED:5,INVALID:6,PLACEHOLDER:7}),th=Object.freeze({START:0,LOADING:1,DONE:2,FAILED:3}),td=Object.freeze({FAILED:0,UNLOADED:1,RECEIVING:2,RECEIVED:3,TRANSFORMING:4,TRANSFORMED:5,READY:6});function tf(){this.imagery=[],this.waterMaskTexture=void 0,this.waterMaskTranslationAndScale=new eH.Z(0,0,1,1),this.terrainData=void 0,this.vertexArray=void 0,this.tileBoundingRegion=void 0,this.occludeePointInScaledSpace=new _.Z,this.boundingVolumeSourceTile=void 0,this.boundingVolumeIsFromMesh=!1,this.terrainState=td.UNLOADED,this.mesh=void 0,this.fill=void 0,this.pickBoundingSphere=new S.Z,this.surfaceShader=void 0,this.isClipped=!0,this.clippedByBoundaries=!1}Object.defineProperties(tf.prototype,{eligibleForUnloading:{get:function(){let e=this.terrainState,t=!(e===td.RECEIVING||e===td.TRANSFORMING),i=this.imagery;for(let e=0,n=i.length;t&&e<n;++e){let n=i[e];t=!(0,y.Z)(n.loadingImagery)||n.loadingImagery.state!==tu.TRANSITIONING}return t}},renderedMesh:{get:function(){return(0,y.Z)(this.vertexArray)?this.mesh:(0,y.Z)(this.fill)?this.fill.mesh:void 0}}});let tp=new C.Z;function tm(e,t,i,n,r,o){let a=e.getExaggeratedPosition(n,r,o);if((0,y.Z)(t)&&t!==eB.Z.SCENE3D){let e=i.ellipsoid.cartesianToCartographic(a,tp);a=i.project(e,o),a=_.Z.fromElements(a.z,a.x,a.y,o)}return a}let t_=new _.Z,tg=new _.Z,tZ=new _.Z;function ty(e,t,i,n){let r=e.renderedMesh,o=r.vertices,a=r.encoding,s=o.length/a.stride,l=$.clone(a);l.hasGeodeticSurfaceNormals=t;let c=(l=$.clone(l)).stride,u=new Float32Array(s*c);t?a.addGeodeticSurfaceNormals(o,u,i):a.removeGeodeticSurfaceNormals(o,u),r.vertices=u,r.stride=c,r!==e.mesh?(tf._freeVertexArray(e.fill.vertexArray),e.fill.vertexArray=tf._createVertexArrayForMesh(n.context,r)):(tf._freeVertexArray(e.vertexArray),e.vertexArray=tf._createVertexArrayForMesh(n.context,r)),tf._freeVertexArray(e.wireframeVertexArray),e.wireframeVertexArray=void 0}tf.prototype.pick=function(e,t,i,n,r){let o=this.renderedMesh;if(!(0,y.Z)(o))return;let a=o.vertices,s=o.indices,l=o.encoding,c=s.length,u=Number.MAX_VALUE;for(let r=0;r<c;r+=3){let o=s[r],c=s[r+1],h=s[r+2],d=tm(l,t,i,a,o,t_),f=tm(l,t,i,a,c,tg),p=tm(l,t,i,a,h,tZ),m=eC.Z.rayTriangleParametric(e,d,f,p,n);(0,y.Z)(m)&&m<u&&m>=0&&(u=m)}return u!==Number.MAX_VALUE?eI.Z.getPoint(e,u,r):void 0},tf.prototype.freeResources=function(){(0,y.Z)(this.waterMaskTexture)&&(--this.waterMaskTexture.referenceCount,0===this.waterMaskTexture.referenceCount&&this.waterMaskTexture.destroy(),this.waterMaskTexture=void 0),this.terrainData=void 0,this.terrainState=td.UNLOADED,this.mesh=void 0,this.fill=this.fill&&this.fill.destroy();let e=this.imagery;for(let t=0,i=e.length;t<i;++t)e[t].freeResources();this.imagery.length=0,this.freeVertexArray()},tf.prototype.freeVertexArray=function(){tf._freeVertexArray(this.vertexArray),this.vertexArray=void 0,tf._freeVertexArray(this.wireframeVertexArray),this.wireframeVertexArray=void 0},tf.initialize=function(e,t,i){let n=e.data;(0,y.Z)(n)||(n=e.data=new tf),e.state===th.START&&(function(e,t,i){let n=t.getTileDataAvailable(e.x,e.y,e.level);if(!(0,y.Z)(n)&&(0,y.Z)(e.parent)){let t=e.parent,i=t.data;(0,y.Z)(i)&&(0,y.Z)(i.terrainData)&&(n=i.terrainData.isChildAvailable(t.x,t.y,e.x,e.y))}!1===n&&(e.data.terrainState=td.FAILED);for(let n=0,r=i.length;n<r;++n){let r=i.get(n);r.show&&r._createTileImagerySkeletons(e,t)}}(e,t,i),e.state=th.LOADING)},tf.processStateMachine=function(e,t,i,n,r,o,a){tf.initialize(e,i,n);let s=e.data;if(e.state===th.LOADING&&function(e,t,i,n,r,o){var a,s,l,c;let u=e.data,h=e.parent;if(u.terrainState!==td.FAILED||void 0===h||void 0!==h.data&&void 0!==h.data.terrainData&&!1!==h.data.terrainData.canUpsample||tf.processStateMachine(h,t,i,n,r,o,!0),u.terrainState===td.FAILED&&function(e,t,i,n,r,o,a){let s=t.parent;if(!s){t.state=th.FAILED;return}let l=s.data.terrainData,c=s.x,u=s.y,h=s.level;if(!(0,y.Z)(l))return;let d=l.upsample(n.tilingScheme,c,u,h,r,o,a);(0,y.Z)(d)&&(e.terrainState=td.RECEIVING,Promise.resolve(d).then(function(t){(0,y.Z)(t)&&(e.terrainData=t,e.terrainState=td.RECEIVED)}).catch(function(){e.terrainState=td.FAILED}))}(u,e,0,i,e.x,e.y,e.level),u.terrainState===td.UNLOADED&&function(e,t,i,n,r){(function o(){let a=new tt.Z({throttle:!1,throttleByServer:!0,type:tn.Z.TERRAIN});e.request=a;let s=t.requestTileGeometry(i,n,r,a);(0,y.Z)(s)?(e.terrainState=td.RECEIVING,Promise.resolve(s).then(function(t){!function(t){if(!(0,y.Z)(t)){e.terrainState=td.UNLOADED,e.request=void 0;return}e.terrainData=t,e.terrainState=td.RECEIVED,e.request=void 0}(t)}).catch(function(a){!function(a){if(e.request.state===ti.Z.CANCELLED){e.terrainData=void 0,e.terrainState=td.UNLOADED,e.request=void 0;return}e.terrainState=td.FAILED,e.request=void 0;let s=`Failed to obtain terrain tile X: ${i} Y: ${n} Level: ${r}. Error message: "${a}"`;t._requestError=tr.reportError(t._requestError,t,t.errorEvent,s,i,n,r),t._requestError.retry&&o()}(a)})):(e.terrainState=td.UNLOADED,e.request=void 0)})()}(u,i,e.x,e.y,e.level),u.terrainState===td.RECEIVED&&function(e,t,i,n,r,o){let a=i.tilingScheme;tb.tilingScheme=a,tb.x=n,tb.y=r,tb.level=o,tb.exaggeration=t.verticalExaggeration,tb.exaggerationRelativeHeight=t.verticalExaggerationRelativeHeight,tb.throttle=!0;let s=e.terrainData.createMesh(tb);(0,y.Z)(s)&&(e.terrainState=td.TRANSFORMING,Promise.resolve(s).then(function(t){e.mesh=t,e.terrainState=td.TRANSFORMED}).catch(function(){e.terrainState=td.FAILED}))}(u,t,i,e.x,e.y,e.level),u.terrainState===td.TRANSFORMED&&(a=t.context,e.x,e.y,e.level,u.vertexArray=tf._createVertexArrayForMesh(a,u.mesh),u.terrainState=td.READY,u.fill=u.fill&&u.fill.destroy(o),u.updateExaggeration(e,t,r)),u.terrainState>=td.RECEIVED&&void 0===u.waterMaskTexture&&i.hasWaterMask){if(void 0!==u.terrainData.waterMask)(function(e,t){let i;let n=t.terrainData.waterMask,r=function(e){let t=e.cache.tile_waterMaskData;if(!(0,y.Z)(t)){let i=eP.Z.create({context:e,pixelFormat:te.Z.LUMINANCE,pixelDatatype:to.Z.UNSIGNED_BYTE,source:{arrayBufferView:new Uint8Array([255]),width:1,height:1}});i.referenceCount=1,t={allWaterTexture:i,sampler:new ta.Z({wrapS:tc.Z.CLAMP_TO_EDGE,wrapT:tc.Z.CLAMP_TO_EDGE,minificationFilter:tl.Z.LINEAR,magnificationFilter:ts.Z.LINEAR}),destroy:function(){this.allWaterTexture.destroy()}},e.cache.tile_waterMaskData=t}return t}(e),o=n.length;if(1===o){if(0===n[0])return;i=r.allWaterTexture}else{let t=Math.sqrt(o);(i=eP.Z.create({context:e,pixelFormat:te.Z.LUMINANCE,pixelDatatype:to.Z.UNSIGNED_BYTE,source:{width:t,height:t,arrayBufferView:n},sampler:r.sampler,flipY:!1})).referenceCount=0}++i.referenceCount,t.waterMaskTexture=i,eH.Z.fromElements(0,0,1,1,t.waterMaskTranslationAndScale)})(t.context,u);else{let t=u._findAncestorTileWithTerrainData(e);(0,y.Z)(t)&&(0,y.Z)(t.data.waterMaskTexture)&&(u.waterMaskTexture=t.data.waterMaskTexture,++u.waterMaskTexture.referenceCount,u._computeWaterMaskTranslationAndScale(e,t,u.waterMaskTranslationAndScale))}}}(e,t,i,n,r,o),a)return;let l=e.renderable;e.renderable=(0,y.Z)(s.vertexArray);let c=s.terrainState===td.READY;e.upsampledFromParent=(0,y.Z)(s.terrainData)&&s.terrainData.wasCreatedByUpsampling();let u=s.processImagery(e,i,t);if(c&&u){let t=e._loadedCallbacks,i={};for(let n in t)t.hasOwnProperty(n)&&!t[n](e)&&(i[n]=t[n]);e._loadedCallbacks=i,e.state=th.DONE}l&&(e.renderable=!0)},tf.prototype.processImagery=function(e,t,i,n){let r,o;let a=e.data,s=e.upsampledFromParent,l=!1,c=!0,u=a.imagery;for(r=0,o=u.length;r<o;++r){let a=u[r];if(!(0,y.Z)(a.loadingImagery)){s=!1;continue}if(a.loadingImagery.state===tu.PLACEHOLDER){let i=a.loadingImagery.imageryLayer;if(i.ready){a.freeResources(),u.splice(r,1),i._createTileImagerySkeletons(e,t,r),--r,o=u.length;continue}s=!1}let h=a.processStateMachine(e,i,n);c=c&&h,l=l||h||(0,y.Z)(a.readyImagery),s=s&&(0,y.Z)(a.loadingImagery)&&(a.loadingImagery.state===tu.FAILED||a.loadingImagery.state===tu.INVALID)}return e.upsampledFromParent=s,e.renderable=e.renderable&&(l||c),c},tf.prototype.addGeodeticSurfaceNormals=function(e,t){ty(this,!0,e,t)},tf.prototype.removeGeodeticSurfaceNormals=function(e){ty(this,!1,void 0,e)},tf.prototype.updateExaggeration=function(e,t,i){let n=this.renderedMesh;if(void 0===n)return;let r=t.verticalExaggeration,o=t.verticalExaggerationRelativeHeight,a=1!==r,s=n.encoding,l=s.exaggeration!==r,c=s.exaggerationRelativeHeight!==o;if(l||c){if(l){if(a&&!s.hasGeodeticSurfaceNormals){let i=e.tilingScheme.ellipsoid;this.addGeodeticSurfaceNormals(i,t)}else!a&&s.hasGeodeticSurfaceNormals&&this.removeGeodeticSurfaceNormals(t)}if(s.exaggeration=r,s.exaggerationRelativeHeight=o,void 0!==i){i._tileToUpdateHeights.push(e);let t=e.customData,n=t.length;for(let e=0;e<n;e++)t[e].level=-1}}};let tb={tilingScheme:void 0,x:0,y:0,level:0,exaggeration:1,exaggerationRelativeHeight:0,throttle:!0};tf._createVertexArrayForMesh=function(e,t){let i=t.vertices,n=e0.Z.createVertexBuffer({context:e,typedArray:i,usage:e1.Z.STATIC_DRAW}),r=t.encoding.getAttributes(n),o=t.indices.indexBuffers||{},a=o[e.id];if(!(0,y.Z)(a)||a.isDestroyed()){let i=t.indices;(a=e0.Z.createIndexBuffer({context:e,typedArray:i,usage:e1.Z.STATIC_DRAW,indexDatatype:eh.Z.fromSizeInBytes(i.BYTES_PER_ELEMENT)})).vertexArrayDestroyable=!1,a.referenceCount=1,o[e.id]=a,t.indices.indexBuffers=o}else++a.referenceCount;return new e9.Z({context:e,attributes:r,indexBuffer:a})},tf._freeVertexArray=function(e){if((0,y.Z)(e)){let t=e.indexBuffer;e.isDestroyed()||e.destroy(),(0,y.Z)(t)&&!t.isDestroyed()&&(0,y.Z)(t.referenceCount)&&(--t.referenceCount,0===t.referenceCount&&t.destroy())}},tf.prototype._findAncestorTileWithTerrainData=function(e){let t=e.parent;for(;(0,y.Z)(t)&&(!(0,y.Z)(t.data)||!(0,y.Z)(t.data.terrainData)||t.data.terrainData.wasCreatedByUpsampling());)t=t.parent;return t},tf.prototype._computeWaterMaskTranslationAndScale=function(e,t,i){let n=t.rectangle,r=e.rectangle,o=r.width,a=r.height,s=o/n.width,l=a/n.height;return i.x=s*(r.west-n.west)/o,i.y=l*(r.south-n.south)/a,i.z=s,i.w=l,i};var tv=i(3905),tT=i(87),tE=i(954);function tx(e){if(e=(0,Z.Z)(e,Z.Z.EMPTY_OBJECT),this._ellipsoid=(0,Z.Z)(e.ellipsoid,T.Z.WGS84),this._numberOfLevelZeroTilesX=(0,Z.Z)(e.numberOfLevelZeroTilesX,1),this._numberOfLevelZeroTilesY=(0,Z.Z)(e.numberOfLevelZeroTilesY,1),this._projection=new ei.Z(this._ellipsoid),(0,y.Z)(e.rectangleSouthwestInMeters)&&(0,y.Z)(e.rectangleNortheastInMeters))this._rectangleSouthwestInMeters=e.rectangleSouthwestInMeters,this._rectangleNortheastInMeters=e.rectangleNortheastInMeters;else{let e=this._ellipsoid.maximumRadius*Math.PI;this._rectangleSouthwestInMeters=new L.Z(-e,-e),this._rectangleNortheastInMeters=new L.Z(e,e)}let t=this._projection.unproject(this._rectangleSouthwestInMeters),i=this._projection.unproject(this._rectangleNortheastInMeters);this._rectangle=new U.Z(t.longitude,t.latitude,i.longitude,i.latitude)}Object.defineProperties(tx.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},rectangle:{get:function(){return this._rectangle}},projection:{get:function(){return this._projection}}}),tx.prototype.getNumberOfXTilesAtLevel=function(e){return this._numberOfLevelZeroTilesX<<e},tx.prototype.getNumberOfYTilesAtLevel=function(e){return this._numberOfLevelZeroTilesY<<e},tx.prototype.rectangleToNativeRectangle=function(e,t){let i=this._projection,n=i.project(U.Z.southwest(e)),r=i.project(U.Z.northeast(e));return(0,y.Z)(t)?(t.west=n.x,t.south=n.y,t.east=r.x,t.north=r.y,t):new U.Z(n.x,n.y,r.x,r.y)},tx.prototype.tileXYToNativeRectangle=function(e,t,i,n){let r=this.getNumberOfXTilesAtLevel(i),o=this.getNumberOfYTilesAtLevel(i),a=(this._rectangleNortheastInMeters.x-this._rectangleSouthwestInMeters.x)/r,s=this._rectangleSouthwestInMeters.x+e*a,l=this._rectangleSouthwestInMeters.x+(e+1)*a,c=(this._rectangleNortheastInMeters.y-this._rectangleSouthwestInMeters.y)/o,u=this._rectangleNortheastInMeters.y-t*c,h=this._rectangleNortheastInMeters.y-(t+1)*c;return(0,y.Z)(n)?(n.west=s,n.south=h,n.east=l,n.north=u,n):new U.Z(s,h,l,u)},tx.prototype.tileXYToRectangle=function(e,t,i,n){let r=this.tileXYToNativeRectangle(e,t,i,n),o=this._projection,a=o.unproject(new L.Z(r.west,r.south)),s=o.unproject(new L.Z(r.east,r.north));return r.west=a.longitude,r.south=a.latitude,r.east=s.longitude,r.north=s.latitude,r},tx.prototype.positionToTileXY=function(e,t,i){let n=this._rectangle;if(!U.Z.contains(n,e))return;let r=this.getNumberOfXTilesAtLevel(t),o=this.getNumberOfYTilesAtLevel(t),a=this._rectangleNortheastInMeters.x-this._rectangleSouthwestInMeters.x,s=this._rectangleNortheastInMeters.y-this._rectangleSouthwestInMeters.y,l=this._projection.project(e),c=l.x-this._rectangleSouthwestInMeters.x,u=this._rectangleNortheastInMeters.y-l.y,h=c/(a/r)|0;h>=r&&(h=r-1);let d=u/(s/o)|0;return(d>=o&&(d=o-1),(0,y.Z)(i))?(i.x=h,i.y=d,i):new L.Z(h,d)};let tw="AAPKe5e6f1571ad74096bfacbdf289c5cdb687BUrehhWYnNo9tN4coC66_qhHDNruh3ygZV90buspkWdOqZUq6tb0kCb_dms9Ir",tS={};tS.defaultAccessToken=tw,tS.defaultWorldImageryServer=new eO.Z({url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/World_Imagery/MapServer"}),tS.defaultWorldHillshadeServer=new eO.Z({url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer"}),tS.defaultWorldOceanServer=new eO.Z({url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Ocean/World_Ocean_Base/MapServer"}),tS.getDefaultTokenCredit=function(e){if(e===tw)return(0,y.Z)(n)||(n=new tE.Z('<b> This application is using a default ArcGIS access token. Please assign <i>Cesium.ArcGisMapService.defaultAccessToken</i> with an API key from your ArcGIS Developer account before using the ArcGIS tile services. You can sign up for a free ArcGIS Developer account at <a href="https://developers.arcgis.com/">https://developers.arcgis.com/</a>.</b>',!0)),n};var tC=i(5497);function tA(e){if(e=(0,Z.Z)(e,Z.Z.EMPTY_OBJECT),!(0,y.Z)(e.missingImageUrl))throw new v.Z("options.missingImageUrl is required.");if(!(0,y.Z)(e.pixelsToCheck))throw new v.Z("options.pixelsToCheck is required.");this._pixelsToCheck=e.pixelsToCheck,this._missingImagePixels=void 0,this._missingImageByteLength=void 0,this._isReady=!1;let t=eO.Z.createIfNeeded(e.missingImageUrl),i=this;t.fetchImage({preferBlob:!0,preferImageBitmap:!0,flipY:!0}).then(function(t){(0,y.Z)(t.blob)&&(i._missingImageByteLength=t.blob.size);let n=(0,tC.Z)(t);if(e.disableCheckIfAllPixelsAreTransparent){let i=!0,r=t.width,o=e.pixelsToCheck;for(let e=0,t=o.length;i&&e<t;++e){let t=o[e];n[4*t.x+t.y*r+3]>0&&(i=!1)}i&&(n=void 0)}i._missingImagePixels=n,i._isReady=!0}).catch(function(){i._missingImagePixels=void 0,i._isReady=!0})}function tI(){this.name=void 0,this.description=void 0,this.position=void 0,this.data=void 0,this.imageryLayer=void 0}tA.prototype.isReady=function(){return this._isReady},tA.prototype.shouldDiscardImage=function(e){if(!this._isReady)throw new v.Z("shouldDiscardImage must not be called before the discard policy is ready.");let t=this._pixelsToCheck,i=this._missingImagePixels;if(!(0,y.Z)(i)||(0,y.Z)(e.blob)&&e.blob.size!==this._missingImageByteLength)return!1;let n=(0,tC.Z)(e),r=e.width;for(let e=0,o=t.length;e<o;++e){let o=t[e],a=4*o.x+o.y*r;for(let e=0;e<4;++e){let t=a+e;if(n[t]!==i[t])return!1}}return!0},tI.prototype.configureNameFromProperties=function(e){let t,i=10;for(let n in e)if(e.hasOwnProperty(n)&&e[n]){let e=n.toLowerCase();i>1&&"name"===e?(i=1,t=n):i>2&&"title"===e?(i=2,t=n):i>3&&/name/i.test(n)?(i=3,t=n):i>4&&/title/i.test(n)&&(i=4,t=n)}(0,y.Z)(t)&&(this.name=e[t])},tI.prototype.configureDescriptionFromProperties=function(e){this.description=function e(t){let i='<table class="cesium-infoBox-defaultTable">';for(let n in t)if(t.hasOwnProperty(n)){let r=t[n];(0,y.Z)(r)&&("object"==typeof r?i+=`<tr><td>${n}</td><td>${e(r)}</td></tr>`:i+=`<tr><td>${n}</td><td>${r}</td></tr>`)}return i+"</table>"}(e)};var tO=i(4705);function tD(){v.Z.throwInstantiationError()}Object.defineProperties(tD.prototype,{rectangle:{get:v.Z.throwInstantiationError},tileWidth:{get:v.Z.throwInstantiationError},tileHeight:{get:v.Z.throwInstantiationError},maximumLevel:{get:v.Z.throwInstantiationError},minimumLevel:{get:v.Z.throwInstantiationError},tilingScheme:{get:v.Z.throwInstantiationError},tileDiscardPolicy:{get:v.Z.throwInstantiationError},errorEvent:{get:v.Z.throwInstantiationError},credit:{get:v.Z.throwInstantiationError},proxy:{get:v.Z.throwInstantiationError},hasAlphaChannel:{get:v.Z.throwInstantiationError}}),tD.prototype.getTileCredits=function(e,t,i){v.Z.throwInstantiationError()},tD.prototype.requestImage=function(e,t,i,n){v.Z.throwInstantiationError()},tD.prototype.pickFeatures=function(e,t,i,n,r){v.Z.throwInstantiationError()};let tP=/\.ktx2$/i;tD.loadImage=function(e,t){D.Z.defined("url",t);let i=eO.Z.createIfNeeded(t);return tP.test(i.url)?(0,tO.Z)(i):(0,y.Z)(e)&&(0,y.Z)(e.tileDiscardPolicy)?i.fetchImage({preferBlob:!0,preferImageBitmap:!0,flipY:!0}):i.fetchImage({preferImageBitmap:!0,flipY:!0})};var tR=Object.freeze({SATELLITE:1,OCEANS:2,HILLSHADE:3});function tN(e){this.useTiles=(0,Z.Z)(e.usePreCachedTilesIfAvailable,!0);let t=e.ellipsoid;this.tilingScheme=(0,Z.Z)(e.tilingScheme,new O.Z({ellipsoid:t})),this.rectangle=(0,Z.Z)(e.rectangle,this.tilingScheme.rectangle),this.ellipsoid=t;let i=e.credit;"string"==typeof i&&(i=new tE.Z(i)),this.credit=i,this.tileCredits=void 0,this.tileDiscardPolicy=e.tileDiscardPolicy,this.tileWidth=(0,Z.Z)(e.tileWidth,256),this.tileHeight=(0,Z.Z)(e.tileHeight,256),this.maximumLevel=e.maximumLevel}async function tL(e,t){let i=e.getDerivedResource({queryParameters:{f:"json"}});try{let e=await i.fetchJson();!function(e,t){let i=e.tileInfo;if((0,y.Z)(i)){if(t.tileWidth=i.rows,t.tileHeight=i.cols,102100===i.spatialReference.wkid||102113===i.spatialReference.wkid)t.tilingScheme=new tx({ellipsoid:t.ellipsoid});else if(4326===e.tileInfo.spatialReference.wkid)t.tilingScheme=new O.Z({ellipsoid:t.ellipsoid});else{let t=`Tile spatial reference WKID ${e.tileInfo.spatialReference.wkid} is not supported.`;throw new tT.Z(t)}if(t.maximumLevel=e.tileInfo.lods.length-1,(0,y.Z)(e.fullExtent)){if((0,y.Z)(e.fullExtent.spatialReference)&&(0,y.Z)(e.fullExtent.spatialReference.wkid)){if(102100===e.fullExtent.spatialReference.wkid||102113===e.fullExtent.spatialReference.wkid){let i=new ei.Z,n=e.fullExtent,r=i.unproject(new _.Z(Math.max(n.xmin,-t.tilingScheme.ellipsoid.maximumRadius*Math.PI),Math.max(n.ymin,-t.tilingScheme.ellipsoid.maximumRadius*Math.PI),0)),o=i.unproject(new _.Z(Math.min(n.xmax,t.tilingScheme.ellipsoid.maximumRadius*Math.PI),Math.min(n.ymax,t.tilingScheme.ellipsoid.maximumRadius*Math.PI),0));t.rectangle=new U.Z(r.longitude,r.latitude,o.longitude,o.latitude)}else if(4326===e.fullExtent.spatialReference.wkid)t.rectangle=U.Z.fromDegrees(e.fullExtent.xmin,e.fullExtent.ymin,e.fullExtent.xmax,e.fullExtent.ymax);else{let t=`fullExtent.spatialReference WKID ${e.fullExtent.spatialReference.wkid} is not supported.`;throw new tT.Z(t)}}}else t.rectangle=t.tilingScheme.rectangle;t.useTiles=!0}else t.useTiles=!1;(0,y.Z)(e.copyrightText)&&e.copyrightText.length>0&&((0,y.Z)(t.credit)?t.tileCredits=[new tE.Z(e.copyrightText)]:t.credit=new tE.Z(e.copyrightText))}(e,t)}catch(t){!function(e,t){let i=`An error occurred while accessing ${e.url}`;throw(0,y.Z)(t)&&(0,y.Z)(t.message)&&(i+=`: ${t.message}`),new tT.Z(i)}(e,t)}}function tM(e){e=(0,Z.Z)(e,Z.Z.EMPTY_OBJECT),this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this._tileDiscardPolicy=e.tileDiscardPolicy,this._tileWidth=(0,Z.Z)(e.tileWidth,256),this._tileHeight=(0,Z.Z)(e.tileHeight,256),this._maximumLevel=e.maximumLevel,this._tilingScheme=(0,Z.Z)(e.tilingScheme,new O.Z({ellipsoid:e.ellipsoid})),this._useTiles=(0,Z.Z)(e.usePreCachedTilesIfAvailable,!0),this._rectangle=(0,Z.Z)(e.rectangle,this._tilingScheme.rectangle),this._layers=e.layers,this._credit=e.credit,this._tileCredits=void 0;let t=e.credit;"string"==typeof t&&(t=new tE.Z(t)),this.enablePickFeatures=(0,Z.Z)(e.enablePickFeatures,!0),this._errorEvent=new I.Z}function tF(e,t,i,n,r){let o;if(e._useTiles)o=e._resource.getDerivedResource({url:`tile/${n}/${i}/${t}`,request:r});else{let a=e._tilingScheme.tileXYToNativeRectangle(t,i,n),s={bbox:`${a.west},${a.south},${a.east},${a.north}`,size:`${e._tileWidth},${e._tileHeight}`,format:"png32",transparent:!0,f:"image"};e._tilingScheme.projection instanceof P.Z?(s.bboxSR=4326,s.imageSR=4326):(s.bboxSR=3857,s.imageSR=3857),e.layers&&(s.layers=`show:${e.layers}`),o=e._resource.getDerivedResource({url:"export",request:r,queryParameters:s})}return o}tN.prototype.build=function(e){e._useTiles=this.useTiles,e._tilingScheme=this.tilingScheme,e._rectangle=this.rectangle,e._credit=this.credit,e._tileCredits=this.tileCredits,e._tileDiscardPolicy=this.tileDiscardPolicy,e._tileWidth=this.tileWidth,e._tileHeight=this.tileHeight,e._maximumLevel=this.maximumLevel,this.useTiles&&!(0,y.Z)(this.tileDiscardPolicy)&&(e._tileDiscardPolicy=new tA({missingImageUrl:tF(e,0,0,this.maximumLevel).url,pixelsToCheck:[new L.Z(0,0),new L.Z(200,20),new L.Z(20,200),new L.Z(80,110),new L.Z(160,130)],disableCheckIfAllPixelsAreTransparent:!0}))},tM.fromBasemapType=async function(e,t){let i,n,r;switch(D.Z.defined("style",e),t=(0,Z.Z)(t,Z.Z.EMPTY_OBJECT),e){case tR.SATELLITE:{i=(0,Z.Z)(t.token,tS.defaultAccessToken),(n=eO.Z.createIfNeeded(tS.defaultWorldImageryServer)).appendForwardSlash();let e=tS.getDefaultTokenCredit(i);(0,y.Z)(e)&&(r=tE.Z.clone(e))}break;case tR.OCEANS:{i=(0,Z.Z)(t.token,tS.defaultAccessToken),(n=eO.Z.createIfNeeded(tS.defaultWorldOceanServer)).appendForwardSlash();let e=tS.getDefaultTokenCredit(i);(0,y.Z)(e)&&(r=tE.Z.clone(e))}break;case tR.HILLSHADE:{i=(0,Z.Z)(t.token,tS.defaultAccessToken),(n=eO.Z.createIfNeeded(tS.defaultWorldHillshadeServer)).appendForwardSlash();let e=tS.getDefaultTokenCredit(i);(0,y.Z)(e)&&(r=tE.Z.clone(e))}break;default:throw new v.Z(`Unsupported basemap type: ${e}`)}return tM.fromUrl(n,{...t,token:i,credit:r,usePreCachedTilesIfAvailable:!0})},Object.defineProperties(tM.prototype,{url:{get:function(){return this._resource._url}},token:{get:function(){return this._resource.queryParameters.token}},proxy:{get:function(){return this._resource.proxy}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return 0}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},usingPrecachedTiles:{get:function(){return this._useTiles}},hasAlphaChannel:{get:function(){return!0}},layers:{get:function(){return this._layers}}}),tM.fromUrl=async function(e,t){D.Z.defined("url",e),t=(0,Z.Z)(t,Z.Z.EMPTY_OBJECT);let i=eO.Z.createIfNeeded(e);i.appendForwardSlash(),(0,y.Z)(t.token)&&i.setQueryParameters({token:t.token});let n=new tM(t);n._resource=i;let r=new tN(t);return(0,Z.Z)(t.usePreCachedTilesIfAvailable,!0)&&await tL(i,r),r.build(n),n},tM.prototype.getTileCredits=function(e,t,i){return this._tileCredits},tM.prototype.requestImage=function(e,t,i,n){return tD.loadImage(this,tF(this,e,t,i,n))},tM.prototype.pickFeatures=function(e,t,i,n,r){let o,a,s;if(!this.enablePickFeatures)return;let l=this._tilingScheme.tileXYToNativeRectangle(e,t,i);if(this._tilingScheme.projection instanceof P.Z)o=F.Z.toDegrees(n),a=F.Z.toDegrees(r),s="4326";else{let e=this._tilingScheme.projection.project(new C.Z(n,r,0));o=e.x,a=e.y,s="3857"}let c="visible";(0,y.Z)(this._layers)&&(c+=`:${this._layers}`);let u={f:"json",tolerance:2,geometryType:"esriGeometryPoint",geometry:`${o},${a}`,mapExtent:`${l.west},${l.south},${l.east},${l.north}`,imageDisplay:`${this._tileWidth},${this._tileHeight},96`,sr:s,layers:c};return this._resource.getDerivedResource({url:"identify",queryParameters:u}).fetchJson().then(function(e){let t=[],i=e.results;if(!(0,y.Z)(i))return t;for(let e=0;e<i.length;++e){let n=i[e],r=new tI;if(r.data=n,r.name=n.value,r.properties=n.attributes,r.configureDescriptionFromProperties(n.attributes),"esriGeometryPoint"===n.geometryType&&n.geometry){let e=n.geometry.spatialReference&&n.geometry.spatialReference.wkid?n.geometry.spatialReference.wkid:4326;if(4326===e||4283===e)r.position=C.Z.fromDegrees(n.geometry.x,n.geometry.y,n.geometry.z);else if(102100===e||900913===e||3857===e){let e=new ei.Z;r.position=e.unproject(new _.Z(n.geometry.x,n.geometry.y,n.geometry.z))}}t.push(r)}return t})},tM._metadataCache={};var tz=Object.freeze({AERIAL:"Aerial",AERIAL_WITH_LABELS:"AerialWithLabels",AERIAL_WITH_LABELS_ON_DEMAND:"AerialWithLabelsOnDemand",ROAD:"Road",ROAD_ON_DEMAND:"RoadOnDemand",CANVAS_DARK:"CanvasDark",CANVAS_LIGHT:"CanvasLight",CANVAS_GRAY:"CanvasGray",ORDNANCE_SURVEY:"OrdnanceSurvey",COLLINS_BART:"CollinsBart"});function tB(e){}function tU(e){this.tileWidth=void 0,this.tileHeight=void 0,this.maximumLevel=void 0,this.imageUrlSubdomains=void 0,this.imageUrlTemplate=void 0,this.attributionList=void 0}async function tk(e,t,i){let n=e.url,r=tV._metadataCache[n];(0,y.Z)(r)||(r=e.fetchJsonp("jsonp"),tV._metadataCache[n]=r);try{let e=await r;return function(e,t){if(1!==e.resourceSets.length)throw new tT.Z("metadata does not specify one resource in resourceSets");let i=e.resourceSets[0].resources[0];t.tileWidth=i.imageWidth,t.tileHeight=i.imageHeight,t.maximumLevel=i.zoomMax-1,t.imageUrlSubdomains=i.imageUrlSubdomains,t.imageUrlTemplate=i.imageUrl,t.attributionList=i.imageryProviders}(e,t)}catch(t){!function(e,t,i){let n=`An error occurred while accessing ${e.url}`;throw(0,y.Z)(t)&&(0,y.Z)(t.message)&&(n+=`: ${t.message}`),tr.reportError(void 0,i,(0,y.Z)(i)?i._errorEvent:void 0,n,void 0,void 0,void 0,t),new tT.Z(n)}(e,t,i)}}function tV(e){e=(0,Z.Z)(e,Z.Z.EMPTY_OBJECT),this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=1,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this._mapStyle=(0,Z.Z)(e.mapStyle,tz.AERIAL),this._mapLayer=e.mapLayer,this._culture=(0,Z.Z)(e.culture,""),this._key=e.key,this._tileDiscardPolicy=e.tileDiscardPolicy,(0,y.Z)(this._tileDiscardPolicy)||(this._tileDiscardPolicy=new tB),this._proxy=e.proxy,this._credit=new tE.Z(`<a href="https://www.microsoft.com/en-us/maps/product/enduserterms"><img src="${tV.logoUrl}" title="Bing Imagery"/></a>`),this._tilingScheme=new tx({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,ellipsoid:e.ellipsoid}),this._tileWidth=void 0,this._tileHeight=void 0,this._maximumLevel=void 0,this._imageUrlTemplate=void 0,this._imageUrlSubdomains=void 0,this._attributionList=void 0,this._errorEvent=new I.Z}tB.prototype.isReady=function(){return!0},tB.prototype.shouldDiscardImage=function(e){return tB.EMPTY_IMAGE===e},Object.defineProperties(tB,{EMPTY_IMAGE:{get:function(){return(0,y.Z)(r)||((r=new Image).src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII="),r}}}),tU.prototype.build=function(e){e._tileWidth=this.tileWidth,e._tileHeight=this.tileHeight,e._maximumLevel=this.maximumLevel,e._imageUrlSubdomains=this.imageUrlSubdomains,e._imageUrlTemplate=this.imageUrlTemplate;let t=e._attributionList=this.attributionList;t||(t=[]),e._attributionList=t;for(let e=0,i=t.length;e<i;++e){let i=t[e];if(i.credit instanceof tE.Z)break;i.credit=new tE.Z(i.attribution);let n=i.coverageAreas;for(let e=0,t=i.coverageAreas.length;e<t;++e){let t=n[e],i=t.bbox;t.bbox=new U.Z(F.Z.toRadians(i[1]),F.Z.toRadians(i[0]),F.Z.toRadians(i[3]),F.Z.toRadians(i[2]))}}},Object.defineProperties(tV.prototype,{url:{get:function(){return this._resource.url}},proxy:{get:function(){return this._resource.proxy}},key:{get:function(){return this._key}},mapStyle:{get:function(){return this._mapStyle}},mapLayer:{get:function(){return this._mapLayer}},culture:{get:function(){return this._culture}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return 0}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return(0,y.Z)(this.mapLayer)}}}),tV.fromUrl=async function(e,t){t=(0,Z.Z)(t,Z.Z.EMPTY_OBJECT),D.Z.defined("url",e),D.Z.defined("options.key",t.key);let i=t.tileProtocol;(0,y.Z)(i)?i.length>0&&":"===i[i.length-1]&&(i=i.substr(0,i.length-1)):i="http:"===document.location.protocol?"http":"https";let n=(0,Z.Z)(t.mapStyle,tz.AERIAL),r=eO.Z.createIfNeeded(e);r.appendForwardSlash();let o={incl:"ImageryProviders",key:t.key,uriScheme:i};(0,y.Z)(t.mapLayer)&&(o.mapLayer=t.mapLayer),(0,y.Z)(t.culture)&&(o.culture=t.culture);let a=r.getDerivedResource({url:`REST/v1/Imagery/Metadata/${n}`,queryParameters:o}),s=new tV(t);s._resource=r;let l=new tU(t);return await tk(a,l),l.build(s),s};let tH=new U.Z;tV.prototype.getTileCredits=function(e,t,i){let n=this._tilingScheme.tileXYToRectangle(e,t,i,tH);return function(e,t,i){++t;let n=[];for(let r=0,o=e.length;r<o;++r){let o=e[r],a=o.coverageAreas,s=!1;for(let e=0,n=o.coverageAreas.length;!s&&e<n;++e){let n=a[e];if(t>=n.zoomMin&&t<=n.zoomMax){let e=U.Z.intersection(i,n.bbox,tG);(0,y.Z)(e)&&(s=!0)}}s&&n.push(o.credit)}return n}(this._attributionList,i,n)},tV.prototype.requestImage=function(e,t,i,n){let r=tD.loadImage(this,function(e,t,i,n,r){let o=e._imageUrlTemplate,a=e._imageUrlSubdomains,s=(t+i+n)%a.length;return e._resource.getDerivedResource({url:o,request:r,templateValues:{quadkey:tV.tileXYToQuadKey(t,i,n),subdomain:a[s],culture:e._culture},queryParameters:{n:"z"}})}(this,e,t,i,n));if((0,y.Z)(r))return r.catch(function(e){return(0,y.Z)(e.blob)&&0===e.blob.size?tB.EMPTY_IMAGE:Promise.reject(e)})},tV.prototype.pickFeatures=function(e,t,i,n,r){},tV.tileXYToQuadKey=function(e,t,i){let n="";for(let r=i;r>=0;--r){let i=1<<r,o=0;(e&i)!=0&&(o|=1),(t&i)!=0&&(o|=2),n+=o}return n},tV.quadKeyToTileXY=function(e){let t=0,i=0,n=e.length-1;for(let r=n;r>=0;--r){let o=1<<r,a=+e[n-r];(1&a)!=0&&(t|=o),(2&a)!=0&&(i|=o)}return{x:t,y:i,level:n}},tV._logoUrl=void 0,Object.defineProperties(tV,{logoUrl:{get:function(){return(0,y.Z)(tV._logoUrl)||(tV._logoUrl=(0,m.Z)("Assets/Images/bing_maps_credit.png")),tV._logoUrl},set:function(e){D.Z.defined("value",e),tV._logoUrl=e}}});let tG=new U.Z;tV._metadataCache={};var tj=i(5342);let tW=/{[^}]+}/g,tq={x:function(e,t,i,n){return t3(e,"{x}",t)},y:function(e,t,i,n){return t3(e,"{y}",i)},z:function(e,t,i,n){return t3(e,"{z}",n)},s:function(e,t,i,n){let r=(t+i+n)%e._subdomains.length;return e._subdomains[r]},reverseX:function(e,t,i,n){let r=e.tilingScheme.getNumberOfXTilesAtLevel(n)-t-1;return t3(e,"{reverseX}",r)},reverseY:function(e,t,i,n){let r=e.tilingScheme.getNumberOfYTilesAtLevel(n)-i-1;return t3(e,"{reverseY}",r)},reverseZ:function(e,t,i,n){let r=e.maximumLevel;return t3(e,"{reverseZ}",(0,y.Z)(r)&&n<r?r-n-1:n)},westDegrees:function(e,t,i,n){return t4(e,t,i,n),tK.west},southDegrees:function(e,t,i,n){return t4(e,t,i,n),tK.south},eastDegrees:function(e,t,i,n){return t4(e,t,i,n),tK.east},northDegrees:function(e,t,i,n){return t4(e,t,i,n),tK.north},westProjected:function(e,t,i,n){return t5(e,t,i,n),tJ.west},southProjected:function(e,t,i,n){return t5(e,t,i,n),tJ.south},eastProjected:function(e,t,i,n){return t5(e,t,i,n),tJ.east},northProjected:function(e,t,i,n){return t5(e,t,i,n),tJ.north},width:function(e,t,i,n){return e.tileWidth},height:function(e,t,i,n){return e.tileHeight}},tY=(0,eW.Z)(tq,{i:function(e,t,i,n,r,o,a){return t6(e,t,i,n,r,o),t1.x},j:function(e,t,i,n,r,o,a){return t6(e,t,i,n,r,o),t1.y},reverseI:function(e,t,i,n,r,o,a){return t6(e,t,i,n,r,o),e.tileWidth-t1.x-1},reverseJ:function(e,t,i,n,r,o,a){return t6(e,t,i,n,r,o),e.tileHeight-t1.y-1},longitudeDegrees:function(e,t,i,n,r,o,a){return F.Z.toDegrees(r)},latitudeDegrees:function(e,t,i,n,r,o,a){return F.Z.toDegrees(o)},longitudeProjected:function(e,t,i,n,r,o,a){return ie(e,t,i,n,r,o),t8.x},latitudeProjected:function(e,t,i,n,r,o,a){return ie(e,t,i,n,r,o),t8.y},format:function(e,t,i,n,r,o,a){return a}});function tX(e){e=(0,Z.Z)(e,Z.Z.EMPTY_OBJECT),this._errorEvent=new I.Z,D.Z.defined("options.url",e.url);let t=eO.Z.createIfNeeded(e.url),i=eO.Z.createIfNeeded(e.pickFeaturesUrl);this._resource=t,this._urlSchemeZeroPadding=e.urlSchemeZeroPadding,this._getFeatureInfoFormats=e.getFeatureInfoFormats,this._pickFeaturesResource=i;let n=e.subdomains;n=Array.isArray(n)?n.slice():(0,y.Z)(n)&&n.length>0?n.split(""):["a","b","c"],this._subdomains=n,this._tileWidth=(0,Z.Z)(e.tileWidth,256),this._tileHeight=(0,Z.Z)(e.tileHeight,256),this._minimumLevel=(0,Z.Z)(e.minimumLevel,0),this._maximumLevel=e.maximumLevel,this._tilingScheme=(0,Z.Z)(e.tilingScheme,new tx({ellipsoid:e.ellipsoid})),this._rectangle=(0,Z.Z)(e.rectangle,this._tilingScheme.rectangle),this._rectangle=U.Z.intersection(this._rectangle,this._tilingScheme.rectangle),this._tileDiscardPolicy=e.tileDiscardPolicy;let r=e.credit;"string"==typeof r&&(r=new tE.Z(r)),this._credit=r,this._hasAlphaChannel=(0,Z.Z)(e.hasAlphaChannel,!0);let o=e.customTags,a=(0,eW.Z)(tq,o),s=(0,eW.Z)(tY,o);this._tags=a,this._pickFeaturesTags=s,this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this.enablePickFeatures=(0,Z.Z)(e.enablePickFeatures,!0)}Object.defineProperties(tX.prototype,{url:{get:function(){return this._resource.url}},urlSchemeZeroPadding:{get:function(){return this._urlSchemeZeroPadding}},pickFeaturesUrl:{get:function(){return this._pickFeaturesResource.url}},proxy:{get:function(){return this._resource.proxy}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return this._minimumLevel}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return this._hasAlphaChannel}}}),tX.prototype.getTileCredits=function(e,t,i){},tX.prototype.requestImage=function(e,t,i,n){return tD.loadImage(this,function(e,t,i,n,r){t$=!1,tQ=!1;let o=e._resource,a=o.getUrlComponent(!0),s=e._tags,l={},c=a.match(tW);return(0,y.Z)(c)&&c.forEach(function(r){let o=r.substring(1,r.length-1);(0,y.Z)(s[o])&&(l[o]=s[o](e,t,i,n))}),o.getDerivedResource({request:r,templateValues:l})}(this,e,t,i,n))},tX.prototype.pickFeatures=function(e,t,i,n,r){if(!this.enablePickFeatures||!(0,y.Z)(this._pickFeaturesResource)||0===this._getFeatureInfoFormats.length)return;let o=0,a=this;function s(e,t){return e.callback(t)}return function l(){if(o>=a._getFeatureInfoFormats.length)return Promise.resolve([]);let c=a._getFeatureInfoFormats[o],u=function(e,t,i,n,r,o,a){t$=!1,tQ=!1,t0=!1,t2=!1;let s=e._pickFeaturesResource,l=s.getUrlComponent(!0),c=e._pickFeaturesTags,u={},h=l.match(tW);return(0,y.Z)(h)&&h.forEach(function(s){let l=s.substring(1,s.length-1);(0,y.Z)(c[l])&&(u[l]=c[l](e,t,i,n,r,o,a))}),s.getDerivedResource({templateValues:u})}(a,e,t,i,n,r,c.format);return(++o,"json"===c.type)?u.fetchJson().then(c.callback).catch(l):"xml"===c.type?u.fetchXML().then(c.callback).catch(l):"text"===c.type||"html"===c.type?u.fetchText().then(c.callback).catch(l):u.fetch({responseType:c.format}).then(s.bind(void 0,c)).catch(l)}()};let t$=!1,tK=new U.Z,tQ=!1,tJ=new U.Z,t0=!1,t1=new L.Z,t2=!1;function t3(e,t,i){if(e&&e.urlSchemeZeroPadding&&e.urlSchemeZeroPadding.hasOwnProperty(t)){let n=e.urlSchemeZeroPadding[t];if("string"==typeof n){let e=n.length;e>1&&(i=i.length>=e?i:Array(e-i.toString().length+1).join("0")+i)}}return i}function t4(e,t,i,n){t$||(e.tilingScheme.tileXYToRectangle(t,i,n,tK),tK.west=F.Z.toDegrees(tK.west),tK.south=F.Z.toDegrees(tK.south),tK.east=F.Z.toDegrees(tK.east),tK.north=F.Z.toDegrees(tK.north),t$=!0)}function t5(e,t,i,n){tQ||(e.tilingScheme.tileXYToNativeRectangle(t,i,n,tJ),tQ=!0)}let t9=new U.Z,t8=new _.Z;function t6(e,t,i,n,r,o,a){if(t0)return;ie(e,t,i,n,r,o);let s=e.tilingScheme.tileXYToNativeRectangle(t,i,n,t9);t1.x=e.tileWidth*(t8.x-s.west)/s.width|0,t1.y=e.tileHeight*(s.north-t8.y)/s.height|0,t0=!0}let t7=new C.Z;function ie(e,t,i,n,r,o,a){t2||(e.tilingScheme.projection instanceof P.Z?(t8.x=F.Z.toDegrees(r),t8.y=F.Z.toDegrees(o)):(t7.longitude=r,t7.latitude=o,e.tilingScheme.projection.project(t7,t8)),t2=!0)}function it(e){tX.call(this,e)}function ii(e,t){return e.west<t.rectangle.west&&(e.west=t.rectangle.west),e.east>t.rectangle.east&&(e.east=t.rectangle.east),e.south<t.rectangle.south&&(e.south=t.rectangle.south),e.north>t.rectangle.north&&(e.north=t.rectangle.north),e}function ir(e,t,i){let n=e.positionToTileXY(U.Z.southwest(t),i),r=e.positionToTileXY(U.Z.northeast(t),i);return(Math.abs(r.x-n.x)+1)*(Math.abs(r.y-n.y)+1)>4?0:i}function io(e){this.channel=e.channel,this.ellipsoid=e.ellipsoid,this.tilingScheme=void 0,this.version=void 0}async function ia(e,t,i){try{let i=await e.fetchText();!function(e,t){let i,n;try{i=JSON.parse(e)}catch(t){i=JSON.parse(e.replace(/([\[\{,])[\n\r ]*([A-Za-z0-9]+)[\n\r ]*:/g,'$1"$2":'))}for(let e=0;e<i.layers.length;e++)if(i.layers[e].id===t.channel){n=i.layers[e];break}if(!(0,y.Z)(n)){let e=`Could not find layer with channel (id) of ${t.channel}.`;throw new tT.Z(e)}if(!(0,y.Z)(n.version)){let e=`Could not find a version in channel (id) ${t.channel}.`;throw new tT.Z(e)}if(t.version=n.version,(0,y.Z)(i.projection)&&"flat"===i.projection)t.tilingScheme=new O.Z({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,rectangle:new U.Z(-Math.PI,-Math.PI,Math.PI,Math.PI),ellipsoid:t.ellipsoid});else if((0,y.Z)(i.projection)&&"mercator"!==i.projection){let e=`Unsupported projection ${i.projection}.`;throw new tT.Z(e)}else t.tilingScheme=new tx({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,ellipsoid:t.ellipsoid})}(i,t)}catch(t){!function(e,t,i){let n=`An error occurred while accessing ${t.url}.`;throw(0,y.Z)(e)&&(0,y.Z)(e.message)&&(n+=`: ${e.message}`),tr.reportError(void 0,i,(0,y.Z)(i)?i._errorEvent:void 0,n),new tT.Z(n)}(t,e,i)}}function is(e){e=(0,Z.Z)(e,{}),this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=1.9,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this._tileDiscardPolicy=e.tileDiscardPolicy,this._channel=e.channel,this._requestType="ImageryMaps",this._credit=new tE.Z(`<a href="http://www.google.com/enterprise/mapsearth/products/earthenterprise.html"><img src="${is.logoUrl}" title="Google Imagery"/></a>`),this._tilingScheme=void 0,this._version=void 0,this._tileWidth=256,this._tileHeight=256,this._maximumLevel=e.maximumLevel,this._errorEvent=new I.Z}it._requestMetadata=async function(e,t,i,n){try{let r=await i.fetchXML();return it._metadataSuccess(r,e,t,i,n)}catch(i){if(i instanceof tj.Z)return it._metadataFailure(e,t);throw i}},it.fromUrl=async function(e,t){D.Z.defined("url",e);let i=eO.Z.createIfNeeded(e);i.appendForwardSlash();let n=i.getDerivedResource({url:"tilemapresource.xml"});t=(0,Z.Z)(t,Z.Z.EMPTY_OBJECT);let r=await it._requestMetadata(t,i,n);return new it(r)},(0,y.Z)(Object.create)&&(it.prototype=Object.create(tX.prototype),it.prototype.constructor=it),it._metadataSuccess=function(e,t,i,n,r){let o,a,s,l;let c=/tileformat/i,u=/tileset/i,h=/tilesets/i,d=/boundingbox/i,f=[],p=e.childNodes[0].childNodes;for(let e=0;e<p.length;e++)if(c.test(p.item(e).nodeName))o=p.item(e);else if(h.test(p.item(e).nodeName)){s=p.item(e);let t=p.item(e).childNodes;for(let e=0;e<t.length;e++)u.test(t.item(e).nodeName)&&f.push(t.item(e))}else d.test(p.item(e).nodeName)&&(a=p.item(e));if(!(0,y.Z)(s)||!(0,y.Z)(a))throw l=`Unable to find expected tilesets or bbox attributes in ${n.url}.`,(0,y.Z)(r)&&tr.reportError(void 0,r,r.errorEvent,l),new tT.Z(l);let m=(0,Z.Z)(t.fileExtension,o.getAttribute("extension")),_=(0,Z.Z)(t.tileWidth,parseInt(o.getAttribute("width"),10)),g=(0,Z.Z)(t.tileHeight,parseInt(o.getAttribute("height"),10)),b=(0,Z.Z)(t.minimumLevel,parseInt(f[0].getAttribute("order"),10)),v=(0,Z.Z)(t.maximumLevel,parseInt(f[f.length-1].getAttribute("order"),10)),T=s.getAttribute("profile"),E=t.tilingScheme;if(!(0,y.Z)(E)){if("geodetic"===T||"global-geodetic"===T)E=new O.Z({ellipsoid:t.ellipsoid});else if("mercator"===T||"global-mercator"===T)E=new tx({ellipsoid:t.ellipsoid});else throw l=`${n.url} specifies an unsupported profile attribute, ${T}.`,(0,y.Z)(r)&&tr.reportError(void 0,r,r.errorEvent,l),new tT.Z(l)}let x=U.Z.clone(t.rectangle);if(!(0,y.Z)(x)){let e,i,n,r;(0,Z.Z)(t.flipXY,!1)?(n=new L.Z(parseFloat(a.getAttribute("miny")),parseFloat(a.getAttribute("minx"))),r=new L.Z(parseFloat(a.getAttribute("maxy")),parseFloat(a.getAttribute("maxx")))):(n=new L.Z(parseFloat(a.getAttribute("minx")),parseFloat(a.getAttribute("miny"))),r=new L.Z(parseFloat(a.getAttribute("maxx")),parseFloat(a.getAttribute("maxy"))));let o="geodetic"===T||"mercator"===T;if(E.projection instanceof P.Z||o)e=C.Z.fromDegrees(n.x,n.y),i=C.Z.fromDegrees(r.x,r.y);else{let t=E.projection;e=t.unproject(n),i=t.unproject(r)}x=new U.Z(e.longitude,e.latitude,i.longitude,i.latitude)}return x=ii(x,E),b=ir(E,x,b),{url:i.getDerivedResource({url:`{z}/{x}/{reverseY}.${m}`}),tilingScheme:E,rectangle:x,tileWidth:_,tileHeight:g,minimumLevel:b,maximumLevel:v,tileDiscardPolicy:t.tileDiscardPolicy,credit:t.credit}},it._metadataFailure=function(e,t){let i=(0,Z.Z)(e.fileExtension,"png"),n=(0,Z.Z)(e.tileWidth,256),r=(0,Z.Z)(e.tileHeight,256),o=e.maximumLevel,a=(0,y.Z)(e.tilingScheme)?e.tilingScheme:new tx({ellipsoid:e.ellipsoid}),s=(0,Z.Z)(e.rectangle,a.rectangle);s=ii(s,a);let l=ir(a,s,e.minimumLevel);return{url:t.getDerivedResource({url:`{z}/{x}/{reverseY}.${i}`}),tilingScheme:a,rectangle:s,tileWidth:n,tileHeight:r,minimumLevel:l,maximumLevel:o,tileDiscardPolicy:e.tileDiscardPolicy,credit:e.credit}},io.prototype.build=function(e){e._channel=this.channel,e._version=this.version,e._tilingScheme=this.tilingScheme},Object.defineProperties(is.prototype,{url:{get:function(){return this._url}},path:{get:function(){return this._path}},proxy:{get:function(){return this._resource.proxy}},channel:{get:function(){return this._channel}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return 0}},tilingScheme:{get:function(){return this._tilingScheme}},version:{get:function(){return this._version}},requestType:{get:function(){return this._requestType}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return!0}}}),is.fromUrl=async function(e,t,i){D.Z.defined("url",e),D.Z.defined("channel",t),i=(0,Z.Z)(i,{});let n=(0,Z.Z)(i.path,"/default_map"),r=eO.Z.createIfNeeded(e).getDerivedResource({url:"/"===n[0]?n.substring(1):n});r.appendForwardSlash();let o=r.getDerivedResource({url:"query",queryParameters:{request:"Json",vars:"geeServerDefs",is2d:"t"}}),a=new io(i);a.channel=t,await ia(o,a);let s=new is(i);return a.build(s),s._resource=r,s._url=e,s._path=n,s},is.prototype.getTileCredits=function(e,t,i){},is.prototype.requestImage=function(e,t,i,n){let r=this._resource.getDerivedResource({url:"query",request:n,queryParameters:{request:this._requestType,channel:this._channel,version:this._version,x:e,y:t,z:i+1}});return tD.loadImage(this,r)},is.prototype.pickFeatures=function(e,t,i,n,r){},is._logoUrl=void 0,Object.defineProperties(is,{logoUrl:{get:function(){return(0,y.Z)(is._logoUrl)||(is._logoUrl=(0,m.Z)("Assets/Images/google_earth_credit.png")),is._logoUrl},set:function(e){D.Z.defined("value",e),is._logoUrl=e}}});let il=/\/$/,ic=new tE.Z('© <a href="https://www.mapbox.com/about/maps/">Mapbox</a> © <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a> <strong><a href="https://www.mapbox.com/map-feedback/">Improve this map</a></strong>');function iu(e){let t;let i=(e=(0,Z.Z)(e,Z.Z.EMPTY_OBJECT)).mapId;if(!(0,y.Z)(i))throw new v.Z("options.mapId is required.");let n=e.accessToken;if(!(0,y.Z)(n))throw new v.Z("options.accessToken is required.");this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0;let r=eO.Z.createIfNeeded((0,Z.Z)(e.url,"https://{s}.tiles.mapbox.com/v4/"));this._mapId=i,this._accessToken=n;let o=(0,Z.Z)(e.format,"png");/\./.test(o)||(o=`.${o}`),this._format=o;let a=r.getUrlComponent();il.test(a)||(a+="/"),a+=`${i}/{z}/{x}/{y}${this._format}`,r.url=a,r.setQueryParameters({access_token:n}),(0,y.Z)(e.credit)?"string"==typeof(t=e.credit)&&(t=new tE.Z(t)):t=ic,this._resource=r,this._imageryProvider=new tX({url:r,credit:t,ellipsoid:e.ellipsoid,minimumLevel:e.minimumLevel,maximumLevel:e.maximumLevel,rectangle:e.rectangle})}function ih(e){e=(0,Z.Z)(e,Z.Z.EMPTY_OBJECT),this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0;let t=(0,Z.Z)(e.rectangle,U.Z.MAX_VALUE),i=new O.Z({rectangle:t,numberOfLevelZeroTilesX:1,numberOfLevelZeroTilesY:1,ellipsoid:e.ellipsoid});this._tilingScheme=i,this._image=void 0,this._texture=void 0,this._hasError=!1,this._errorEvent=new I.Z;let n=e.credit;"string"==typeof n&&(n=new tE.Z(n)),this._credit=n,D.Z.defined("options.url",e.url);let r=eO.Z.createIfNeeded(e.url);this._resource=r,D.Z.typeOf.number("options.tileWidth",e.tileWidth),D.Z.typeOf.number("options.tileHeight",e.tileHeight),this._tileWidth=e.tileWidth,this._tileHeight=e.tileHeight}async function id(e,t,i){try{return await tD.loadImage(null,e)}catch(n){return function(e,t,i,n){let r=`Failed to load image ${e.url}`;(0,y.Z)(t)&&(0,y.Z)(t.message)&&(r+=`: ${t.message}`);let o=tr.reportError(n,i,(0,y.Z)(i)?i._errorEvent:void 0,r,0,0,0,t);if(o.retry)return id(e,i,o);throw(0,y.Z)(i)&&(i._hasError=!0),new tT.Z(r)}(e,n,t,i)}}function ip(e){let t=[],i=e.features;for(let e=0;e<i.length;++e){let n=i[e],r=new tI;if(r.data=n,r.properties=n.properties,r.configureNameFromProperties(n.properties),r.configureDescriptionFromProperties(n.properties),(0,y.Z)(n.geometry)&&"Point"===n.geometry.type){let e=n.geometry.coordinates[0],t=n.geometry.coordinates[1];r.position=C.Z.fromDegrees(e,t)}t.push(r)}return t}Object.defineProperties(iu.prototype,{url:{get:function(){return this._imageryProvider.url}},rectangle:{get:function(){return this._imageryProvider.rectangle}},tileWidth:{get:function(){return this._imageryProvider.tileWidth}},tileHeight:{get:function(){return this._imageryProvider.tileHeight}},maximumLevel:{get:function(){return this._imageryProvider.maximumLevel}},minimumLevel:{get:function(){return this._imageryProvider.minimumLevel}},tilingScheme:{get:function(){return this._imageryProvider.tilingScheme}},tileDiscardPolicy:{get:function(){return this._imageryProvider.tileDiscardPolicy}},errorEvent:{get:function(){return this._imageryProvider.errorEvent}},credit:{get:function(){return this._imageryProvider.credit}},proxy:{get:function(){return this._imageryProvider.proxy}},hasAlphaChannel:{get:function(){return this._imageryProvider.hasAlphaChannel}}}),iu.prototype.getTileCredits=function(e,t,i){},iu.prototype.requestImage=function(e,t,i,n){return this._imageryProvider.requestImage(e,t,i,n)},iu.prototype.pickFeatures=function(e,t,i,n,r){return this._imageryProvider.pickFeatures(e,t,i,n,r)},iu._defaultCredit=ic,Object.defineProperties(ih.prototype,{url:{get:function(){return this._resource.url}},proxy:{get:function(){return this._resource.proxy}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return 0}},minimumLevel:{get:function(){return 0}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){}},errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return!0}}}),ih.fromUrl=async function(e,t){D.Z.defined("url",e);let i=eO.Z.createIfNeeded(e),n=await id(i),r=new ih({...t=(0,Z.Z)(t,Z.Z.EMPTY_OBJECT),url:e,tileWidth:n.width,tileHeight:n.height});return r._image=n,r},ih.prototype.getTileCredits=function(e,t,i){},ih.prototype.requestImage=async function(e,t,i,n){if(!this._hasError&&!(0,y.Z)(this._image)){let e=await id(this._resource,this);return this._image=e,tr.reportSuccess(this._errorEvent),e}return this._image},ih.prototype.pickFeatures=function(e,t,i,n,r){};let im="http://www.mapinfo.com/mxp";function i_(e){let t=e.documentElement;if("MultiFeatureCollection"===t.localName&&t.namespaceURI===im)return function(e){let t=[],i=e.documentElement.getElementsByTagNameNS(im,"Feature");for(let e=0;e<i.length;++e){let n=i[e],r={},o=n.getElementsByTagNameNS(im,"Val");for(let e=0;e<o.length;++e){let t=o[e];if(t.hasAttribute("ref")){let e=t.getAttribute("ref"),i=t.textContent.trim();r[e]=i}}let a=new tI;a.data=n,a.properties=r,a.configureNameFromProperties(r),a.configureDescriptionFromProperties(r),t.push(a)}return t}(e);if("FeatureInfoResponse"===t.localName&&"http://www.esri.com/wms"===t.namespaceURI)return function(e){let t;let i=e.documentElement,n=[],r=i.getElementsByTagNameNS("*","FIELDS");if(r.length>0)for(let e=0;e<r.length;++e){let i=r[e];t={};let o=i.attributes;for(let e=0;e<o.length;++e){let i=o[e];t[i.name]=i.value}n.push(iZ(i,t))}else{let e=i.getElementsByTagNameNS("*","FeatureInfo");for(let i=0;i<e.length;++i){let r=e[i];t={};let o=r.childNodes;for(let e=0;e<o.length;++e){let i=o[e];i.nodeType===Node.ELEMENT_NODE&&(t[i.localName]=i.textContent)}n.push(iZ(r,t))}}return n}(e);if("FeatureCollection"===t.localName&&"http://www.opengis.net/wfs"===t.namespaceURI)return function(e){let t=[],i=e.documentElement.getElementsByTagNameNS("http://www.opengis.net/gml","featureMember");for(let e=0;e<i.length;++e){let n=i[e],r={};ig(n,r),t.push(iZ(n,r))}return t}(e);if("ServiceExceptionReport"===t.localName)throw new tT.Z(new XMLSerializer().serializeToString(t));return"msGMLOutput"===t.localName?function(e){let t;let i=[],n=e.documentElement.childNodes;for(let e=0;e<n.length;e++)if(n[e].nodeType===Node.ELEMENT_NODE){t=n[e];break}if(!(0,y.Z)(t))throw new tT.Z("Unable to find first child of the feature info xml document");let r=t.childNodes;for(let e=0;e<r.length;++e){let t=r[e];if(t.nodeType===Node.ELEMENT_NODE){let e={};ig(t,e),i.push(iZ(t,e))}}return i}(e):function(e){let t=new XMLSerializer().serializeToString(e),i=document.createElement("div"),n=document.createElement("pre");n.textContent=t,i.appendChild(n);let r=new tI;return r.data=e,r.description=i.innerHTML,[r]}(e)}function ig(e,t){let i=!0;for(let n=0;n<e.childNodes.length;++n){let r=e.childNodes[n];r.nodeType===Node.ELEMENT_NODE&&(i=!1),"Point"!==r.localName&&"LineString"!==r.localName&&"Polygon"!==r.localName&&"boundedBy"!==r.localName&&r.hasChildNodes()&&ig(r,t)&&(t[r.localName]=r.textContent)}return i}function iZ(e,t){let i=new tI;return i.data=e,i.properties=t,i.configureNameFromProperties(t),i.configureDescriptionFromProperties(t),i}let iy=/<body>\s*<\/body>/im,ib=/<ServiceExceptionReport([\s\S]*)<\/ServiceExceptionReport>/im,iv=/<title>([\s\S]*)<\/title>/im;function iT(e){let t;if(iy.test(e)||ib.test(e))return;let i=iv.exec(e);i&&i.length>1&&(t=i[1]);let n=new tI;return n.name=t,n.description=e,n.data=e,[n]}var iE=function(e,t,i){if(!(0,y.Z)(e))throw new v.Z("type is required.");if(this.type=e,!(0,y.Z)(t)){if("json"===e)t="application/json";else if("xml"===e)t="text/xml";else if("html"===e)t="text/html";else if("text"===e)t="text/plain";else throw new v.Z('format is required when type is not "json", "xml", "html", or "text".')}if(this.format=t,!(0,y.Z)(i)){if("json"===e)i=ip;else if("xml"===e)i=i_;else if("html"===e)i=iT;else if("text"===e)i=iT;else throw new v.Z('callback is required when type is not "json", "xml", "html", or "text".')}this.callback=i},ix=i(5951);function iw(e){e=(0,Z.Z)(e,Z.Z.EMPTY_OBJECT),D.Z.typeOf.object("options.clock",e.clock),D.Z.typeOf.object("options.times",e.times),D.Z.typeOf.func("options.requestImageFunction",e.requestImageFunction),D.Z.typeOf.func("options.reloadFunction",e.reloadFunction),this._tileCache={},this._tilesRequestedForInterval=[];let t=this._clock=e.clock;this._times=e.times,this._requestImageFunction=e.requestImageFunction,this._reloadFunction=e.reloadFunction,this._currentIntervalIndex=-1,t.onTick.addEventListener(this._clockOnTick,this),this._clockOnTick(t)}function iS(e,t,i){return`${e}-${t}-${i}`}function iC(e){let t;let i=e._times;if(!(0,y.Z)(i))return;let n=e._clock,r=n.currentTime,o=n.canAnimate&&n.shouldAnimate,a=n.multiplier;if(!o&&0!==a)return;let s=i.indexOf(r);if(s<0)return;let l=i.get(s);return a>0?(t=ix.Z.secondsDifference(l.stop,r),++s):(t=ix.Z.secondsDifference(l.start,r),--s),t/=a,s>=0&&t<=5?i.get(s):void 0}function iA(e,t,i){let n=e._times.indexOf(i.start),r=e._tileCache,o=r[n];(0,y.Z)(o)||(o=r[n]={});let a=t.key;if((0,y.Z)(o[a]))return!0;let s=function(e){let t=e.split("-");if(3===t.length)return{x:Number(t[0]),y:Number(t[1]),level:Number(t[2])}}(a),l=new tt.Z({throttle:!1,throttleByServer:!0,type:tn.Z.IMAGERY,priorityFunction:t.priorityFunction}),c=e._requestImageFunction(s.x,s.y,s.level,l,i);return!!(0,y.Z)(c)&&(o[a]={promise:c,request:l},!0)}Object.defineProperties(iw.prototype,{clock:{get:function(){return this._clock},set:function(e){if(!(0,y.Z)(e))throw new v.Z("value is required.");this._clock!==e&&(this._clock=e,this._clockOnTick(e),this._reloadFunction())}},times:{get:function(){return this._times},set:function(e){if(!(0,y.Z)(e))throw new v.Z("value is required.");this._times!==e&&(this._times=e,this._clockOnTick(this._clock),this._reloadFunction())}},currentInterval:{get:function(){return this._times.get(this._currentIntervalIndex)}}}),iw.prototype.getFromCache=function(e,t,i,n){let r;let o=iS(e,t,i),a=this._tileCache[this._currentIntervalIndex];if((0,y.Z)(a)&&(0,y.Z)(a[o])){let e=a[o];r=e.promise.catch(function(t){throw n.state=e.request.state,t}),delete a[o]}return r},iw.prototype.checkApproachingInterval=function(e,t,i,n){let r=iS(e,t,i),o=this._tilesRequestedForInterval,a=iC(this),s={key:r,priorityFunction:n.priorityFunction};(0,y.Z)(a)&&iA(this,s,a)||o.push(s),o.length>=512&&o.splice(0,256)},iw.prototype._clockOnTick=function(e){let t=e.currentTime,i=this._times.indexOf(t),n=this._currentIntervalIndex;if(i!==n){let e=this._tileCache[n];for(let t in e)e.hasOwnProperty(t)&&e[t].request.cancel();delete this._tileCache[n],this._tilesRequestedForInterval=[],this._currentIntervalIndex=i,this._reloadFunction();return}let r=iC(this);if((0,y.Z)(r)){let e=this._tilesRequestedForInterval,t=!0;for(;t&&0!==e.length;){let i=e.pop();(t=iA(this,i,r))||e.push(i)}}};let iI=[3034,3035,3042,3043,3044],iO=[4471,4559];function iD(e){if(e=(0,Z.Z)(e,Z.Z.EMPTY_OBJECT),!(0,y.Z)(e.url))throw new v.Z("options.url is required.");if(!(0,y.Z)(e.layers))throw new v.Z("options.layers is required.");if((0,y.Z)(e.times)&&!(0,y.Z)(e.clock))throw new v.Z("options.times was specified, so options.clock is required.");this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this._getFeatureInfoUrl=(0,Z.Z)(e.getFeatureInfoUrl,e.url);let t=eO.Z.createIfNeeded(e.url),i=eO.Z.createIfNeeded(this._getFeatureInfoUrl);t.setQueryParameters(iD.DefaultParameters,!0),i.setQueryParameters(iD.GetFeatureInfoDefaultParameters,!0),(0,y.Z)(e.parameters)&&t.setQueryParameters(iR(e.parameters)),(0,y.Z)(e.getFeatureInfoParameters)&&i.setQueryParameters(iR(e.getFeatureInfoParameters));let n=this;this._reload=void 0,(0,y.Z)(e.times)&&(this._timeDynamicImagery=new iw({clock:e.clock,times:e.times,requestImageFunction:function(e,t,i,r,o){return iP(n,e,t,i,r,o)},reloadFunction:function(){(0,y.Z)(n._reload)&&n._reload()}}));let r={};if(r.layers=e.layers,r.bbox="{westProjected},{southProjected},{eastProjected},{northProjected}",r.width="{width}",r.height="{height}",parseFloat(t.queryParameters.version)>=1.3){r.crs=(0,Z.Z)(e.crs,e.tilingScheme&&e.tilingScheme.projection instanceof ei.Z?"EPSG:3857":"CRS:84");let t=r.crs.split(":");if("EPSG"===t[0]&&2===t.length){let e=Number(t[1]);(e>=4e3&&e<5e3&&!iO.includes(e)||iI.includes(e))&&(r.bbox="{southProjected},{westProjected},{northProjected},{eastProjected}")}}else r.srs=(0,Z.Z)(e.srs,e.tilingScheme&&e.tilingScheme.projection instanceof ei.Z?"EPSG:3857":"EPSG:4326");t.setQueryParameters(r,!0),i.setQueryParameters(r,!0);let o={query_layers:e.layers,info_format:"{format}"};parseFloat(i.queryParameters.version)>=1.3?(o.i="{i}",o.j="{j}"):(o.x="{i}",o.y="{j}"),i.setQueryParameters(o,!0),this._resource=t,this._pickFeaturesResource=i,this._layers=e.layers,this._tileProvider=new tX({url:t,pickFeaturesUrl:i,tilingScheme:(0,Z.Z)(e.tilingScheme,new O.Z({ellipsoid:e.ellipsoid})),rectangle:e.rectangle,tileWidth:e.tileWidth,tileHeight:e.tileHeight,minimumLevel:e.minimumLevel,maximumLevel:e.maximumLevel,subdomains:e.subdomains,tileDiscardPolicy:e.tileDiscardPolicy,credit:e.credit,getFeatureInfoFormats:(0,Z.Z)(e.getFeatureInfoFormats,iD.DefaultGetFeatureInfoFormats),enablePickFeatures:e.enablePickFeatures})}function iP(e,t,i,n,r,o){let a=(0,y.Z)(o)?o.data:void 0,s=e._tileProvider;return(0,y.Z)(a)&&s._resource.setQueryParameters(a),s.requestImage(t,i,n,r)}function iR(e){let t={};for(let i in e)e.hasOwnProperty(i)&&(t[i.toLowerCase()]=e[i]);return t}Object.defineProperties(iD.prototype,{url:{get:function(){return this._resource._url}},proxy:{get:function(){return this._resource.proxy}},layers:{get:function(){return this._layers}},tileWidth:{get:function(){return this._tileProvider.tileWidth}},tileHeight:{get:function(){return this._tileProvider.tileHeight}},maximumLevel:{get:function(){return this._tileProvider.maximumLevel}},minimumLevel:{get:function(){return this._tileProvider.minimumLevel}},tilingScheme:{get:function(){return this._tileProvider.tilingScheme}},rectangle:{get:function(){return this._tileProvider.rectangle}},tileDiscardPolicy:{get:function(){return this._tileProvider.tileDiscardPolicy}},errorEvent:{get:function(){return this._tileProvider.errorEvent}},credit:{get:function(){return this._tileProvider.credit}},hasAlphaChannel:{get:function(){return this._tileProvider.hasAlphaChannel}},enablePickFeatures:{get:function(){return this._tileProvider.enablePickFeatures},set:function(e){this._tileProvider.enablePickFeatures=e}},clock:{get:function(){return this._timeDynamicImagery.clock},set:function(e){this._timeDynamicImagery.clock=e}},times:{get:function(){return this._timeDynamicImagery.times},set:function(e){this._timeDynamicImagery.times=e}},getFeatureInfoUrl:{get:function(){return this._getFeatureInfoUrl}}}),iD.prototype.getTileCredits=function(e,t,i){return this._tileProvider.getTileCredits(e,t,i)},iD.prototype.requestImage=function(e,t,i,n){let r,o;let a=this._timeDynamicImagery;return(0,y.Z)(a)&&(o=a.currentInterval,r=a.getFromCache(e,t,i,n)),(0,y.Z)(r)||(r=iP(this,e,t,i,n,o)),(0,y.Z)(r)&&(0,y.Z)(a)&&a.checkApproachingInterval(e,t,i,n),r},iD.prototype.pickFeatures=function(e,t,i,n,r){let o=this._timeDynamicImagery;return function(e,t,i,n,r,o,a){let s=(0,y.Z)(a)?a.data:void 0,l=e._tileProvider;return(0,y.Z)(s)&&l._pickFeaturesResource.setQueryParameters(s),l.pickFeatures(t,i,n,r,o)}(this,e,t,i,n,r,(0,y.Z)(o)?o.currentInterval:void 0)},iD.DefaultParameters=Object.freeze({service:"WMS",version:"1.1.1",request:"GetMap",styles:"",format:"image/jpeg"}),iD.GetFeatureInfoDefaultParameters=Object.freeze({service:"WMS",version:"1.1.1",request:"GetFeatureInfo"}),iD.DefaultGetFeatureInfoFormats=Object.freeze([Object.freeze(new iE("json","application/json")),Object.freeze(new iE("xml","text/xml")),Object.freeze(new iE("text","text/html"))]);let iN=Object.freeze({service:"WMTS",version:"1.0.0",request:"GetTile"});function iL(e){if(e=(0,Z.Z)(e,Z.Z.EMPTY_OBJECT),!(0,y.Z)(e.url))throw new v.Z("options.url is required.");if(!(0,y.Z)(e.layer))throw new v.Z("options.layer is required.");if(!(0,y.Z)(e.style))throw new v.Z("options.style is required.");if(!(0,y.Z)(e.tileMatrixSetID))throw new v.Z("options.tileMatrixSetID is required.");if((0,y.Z)(e.times)&&!(0,y.Z)(e.clock))throw new v.Z("options.times was specified, so options.clock is required.");this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0;let t=eO.Z.createIfNeeded(e.url),i=e.style,n=e.tileMatrixSetID,r=t.url,o=r.match(/{/g);!(0,y.Z)(o)||1===o.length&&/{s}/.test(r)?(t.setQueryParameters(iN),this._useKvp=!0):(t.setTemplateValues({style:i,Style:i,TileMatrixSet:n}),this._useKvp=!1),this._resource=t,this._layer=e.layer,this._style=i,this._tileMatrixSetID=n,this._tileMatrixLabels=e.tileMatrixLabels,this._format=(0,Z.Z)(e.format,"image/jpeg"),this._tileDiscardPolicy=e.tileDiscardPolicy,this._tilingScheme=(0,y.Z)(e.tilingScheme)?e.tilingScheme:new tx({ellipsoid:e.ellipsoid}),this._tileWidth=(0,Z.Z)(e.tileWidth,256),this._tileHeight=(0,Z.Z)(e.tileHeight,256),this._minimumLevel=(0,Z.Z)(e.minimumLevel,0),this._maximumLevel=e.maximumLevel,this._rectangle=(0,Z.Z)(e.rectangle,this._tilingScheme.rectangle),this._dimensions=e.dimensions;let a=this;this._reload=void 0,(0,y.Z)(e.times)&&(this._timeDynamicImagery=new iw({clock:e.clock,times:e.times,requestImageFunction:function(e,t,i,n,r){return iM(a,e,t,i,n,r)},reloadFunction:function(){(0,y.Z)(a._reload)&&a._reload()}}));let s=this._tilingScheme.positionToTileXY(U.Z.southwest(this._rectangle),this._minimumLevel),l=this._tilingScheme.positionToTileXY(U.Z.northeast(this._rectangle),this._minimumLevel),c=(Math.abs(l.x-s.x)+1)*(Math.abs(l.y-s.y)+1);if(c>4)throw new v.Z(`The imagery provider's rectangle and minimumLevel indicate that there are ${c} tiles at the minimum level. Imagery providers with more than four tiles at the minimum level are not supported.`);this._errorEvent=new I.Z;let u=e.credit;this._credit="string"==typeof u?new tE.Z(u):u,this._subdomains=e.subdomains,Array.isArray(this._subdomains)?this._subdomains=this._subdomains.slice():(0,y.Z)(this._subdomains)&&this._subdomains.length>0?this._subdomains=this._subdomains.split(""):this._subdomains=["a","b","c"]}function iM(e,t,i,n,r,o){let a,s;let l=e._tileMatrixLabels,c=(0,y.Z)(l)?l[n]:n.toString(),u=e._subdomains,h=e._dimensions,d=(0,y.Z)(o)?o.data:void 0;if(e._useKvp){let o={};o.tilematrix=c,o.layer=e._layer,o.style=e._style,o.tilerow=i,o.tilecol=t,o.tilematrixset=e._tileMatrixSetID,o.format=e._format,(0,y.Z)(h)&&(o=(0,eW.Z)(o,h)),(0,y.Z)(d)&&(o=(0,eW.Z)(o,d)),s={s:u[(t+i+n)%u.length]},(a=e._resource.getDerivedResource({queryParameters:o,request:r})).setTemplateValues(s)}else s={TileMatrix:c,TileRow:i.toString(),TileCol:t.toString(),s:u[(t+i+n)%u.length]},(a=e._resource.getDerivedResource({request:r})).setTemplateValues(s),(0,y.Z)(h)&&a.setTemplateValues(h),(0,y.Z)(d)&&a.setTemplateValues(d);return tD.loadImage(e,a)}Object.defineProperties(iL.prototype,{url:{get:function(){return this._resource.url}},proxy:{get:function(){return this._resource.proxy}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return this._minimumLevel}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},format:{get:function(){return this._format}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return!0}},clock:{get:function(){return this._timeDynamicImagery.clock},set:function(e){this._timeDynamicImagery.clock=e}},times:{get:function(){return this._timeDynamicImagery.times},set:function(e){this._timeDynamicImagery.times=e}},dimensions:{get:function(){return this._dimensions},set:function(e){this._dimensions!==e&&(this._dimensions=e,(0,y.Z)(this._reload)&&this._reload())}}}),iL.prototype.getTileCredits=function(e,t,i){},iL.prototype.requestImage=function(e,t,i,n){let r,o;let a=this._timeDynamicImagery;return(0,y.Z)(a)&&(o=a.currentInterval,r=a.getFromCache(e,t,i,n)),(0,y.Z)(r)||(r=iM(this,e,t,i,n,o)),(0,y.Z)(r)&&(0,y.Z)(a)&&a.checkApproachingInterval(e,t,i,n),r},iL.prototype.pickFeatures=function(e,t,i,n,r){};let iF={ARCGIS_MAPSERVER:tM.fromUrl,BING:async(e,t)=>tV.fromUrl(e,t),GOOGLE_EARTH:async(e,t)=>{let i=t.channel;return delete t.channel,is.fromUrl(e,i,t)},MAPBOX:(e,t)=>new iu({url:e,...t}),SINGLE_TILE:ih.fromUrl,TMS:it.fromUrl,URL_TEMPLATE:(e,t)=>new tX({url:e,...t}),WMS:(e,t)=>new iD({url:e,...t}),WMTS:(e,t)=>new iL({url:e,...t})};function iz(e){e=(0,Z.Z)(e,Z.Z.EMPTY_OBJECT),this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this._tileCredits=void 0,this._errorEvent=new I.Z}Object.defineProperties(iz.prototype,{rectangle:{get:function(){return this._imageryProvider.rectangle}},tileWidth:{get:function(){return this._imageryProvider.tileWidth}},tileHeight:{get:function(){return this._imageryProvider.tileHeight}},maximumLevel:{get:function(){return this._imageryProvider.maximumLevel}},minimumLevel:{get:function(){return this._imageryProvider.minimumLevel}},tilingScheme:{get:function(){return this._imageryProvider.tilingScheme}},tileDiscardPolicy:{get:function(){return this._imageryProvider.tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._imageryProvider.credit}},hasAlphaChannel:{get:function(){return this._imageryProvider.hasAlphaChannel}},proxy:{get:function(){}}}),iz.fromAssetId=async function(e,t){let i;D.Z.typeOf.number("assetId",e),t=(0,Z.Z)(t,Z.Z.EMPTY_OBJECT);let n=tv.Z._createEndpointResource(e,t),r=e.toString()+t.accessToken+t.server,o=iz._endpointCache[r];(0,y.Z)(o)||(o=n.fetchJson(),iz._endpointCache[r]=o);let a=await o;if("IMAGERY"!==a.type)throw new tT.Z(`Cesium ion asset ${e} is not an imagery asset.`);let s=a.externalType;if((0,y.Z)(s)){let e=iF[s];if(!(0,y.Z)(e))throw new tT.Z(`Unrecognized Cesium ion imagery type: ${s}`);let t={...a.options},n=t.url;delete t.url,i=await e(n,t)}else i=await it.fromUrl(new tv.Z(a,n));let l=new iz(t);return i.errorEvent.addEventListener(function(e){e.provider=l,l._errorEvent.raiseEvent(e)}),l._tileCredits=tv.Z.getCreditsFromEndpoint(a,n),l._imageryProvider=i,l},iz.prototype.getTileCredits=function(e,t,i){let n=this._imageryProvider.getTileCredits(e,t,i);return(0,y.Z)(n)?this._tileCredits.concat(n):this._tileCredits},iz.prototype.requestImage=function(e,t,i,n){return this._imageryProvider.requestImage(e,t,i,n)},iz.prototype.pickFeatures=function(e,t,i,n,r){return this._imageryProvider.pickFeatures(e,t,i,n,r)},iz._endpointCache={};var iB=Object.freeze({AERIAL:2,AERIAL_WITH_LABELS:3,ROAD:4}),iU=function(e){e=(0,Z.Z)(e,Z.Z.EMPTY_OBJECT);let t=(0,Z.Z)(e.style,iB.AERIAL);return iz.fromAssetId(t)},ik=i(1295),iV=i(4169);function iH(e,t,i,n,r){this.imageryLayer=e,this.x=t,this.y=i,this.level=n,this.request=void 0,0!==n&&(this.parent=e.getImageryFromCache(t/2|0,i/2|0,n-1)),this.state=tu.UNLOADED,this.imageUrl=void 0,this.image=void 0,this.texture=void 0,this.textureWebMercator=void 0,this.credits=void 0,this.referenceCount=0,!(0,y.Z)(r)&&e.ready&&(r=e.imageryProvider.tilingScheme.tileXYToRectangle(t,i,n)),this.rectangle=r}iH.createPlaceholder=function(e){let t=new iH(e,0,0,0);return t.addReference(),t.state=tu.PLACEHOLDER,t},iH.prototype.addReference=function(){++this.referenceCount},iH.prototype.releaseReference=function(){return(--this.referenceCount,0===this.referenceCount)?(this.imageryLayer.removeImageryFromCache(this),(0,y.Z)(this.parent)&&this.parent.releaseReference(),(0,y.Z)(this.image)&&(0,y.Z)(this.image.destroy)&&this.image.destroy(),(0,y.Z)(this.texture)&&this.texture.destroy(),(0,y.Z)(this.textureWebMercator)&&this.texture!==this.textureWebMercator&&this.textureWebMercator.destroy(),(0,b.Z)(this),0):this.referenceCount},iH.prototype.processStateMachine=function(e,t,i){this.state!==tu.UNLOADED||i||(this.state=tu.TRANSITIONING,this.imageryLayer._requestImagery(this)),this.state===tu.RECEIVED&&(this.state=tu.TRANSITIONING,this.imageryLayer._createTexture(e.context,this));let n=this.state===tu.READY&&t&&!this.texture;(this.state===tu.TEXTURE_LOADED||n)&&(this.state=tu.TRANSITIONING,this.imageryLayer._reprojectTexture(e,this,t))};var iG=i(7417);function ij(e,t,i){this.readyImagery=void 0,this.loadingImagery=e,this.textureCoordinateRectangle=t,this.textureTranslationAndScale=void 0,this.useWebMercatorT=i}function iW(e,t){this._imageryProvider=e,this._readyEvent=new I.Z,this._errorEvent=new I.Z,t=(0,Z.Z)(t,Z.Z.EMPTY_OBJECT),e=(0,Z.Z)(e,Z.Z.EMPTY_OBJECT),this.alpha=(0,Z.Z)(t.alpha,(0,Z.Z)(e._defaultAlpha,1)),this.nightAlpha=(0,Z.Z)(t.nightAlpha,(0,Z.Z)(e._defaultNightAlpha,1)),this.dayAlpha=(0,Z.Z)(t.dayAlpha,(0,Z.Z)(e._defaultDayAlpha,1)),this.brightness=(0,Z.Z)(t.brightness,(0,Z.Z)(e._defaultBrightness,iW.DEFAULT_BRIGHTNESS)),this.contrast=(0,Z.Z)(t.contrast,(0,Z.Z)(e._defaultContrast,iW.DEFAULT_CONTRAST)),this.hue=(0,Z.Z)(t.hue,(0,Z.Z)(e._defaultHue,iW.DEFAULT_HUE)),this.saturation=(0,Z.Z)(t.saturation,(0,Z.Z)(e._defaultSaturation,iW.DEFAULT_SATURATION)),this.gamma=(0,Z.Z)(t.gamma,(0,Z.Z)(e._defaultGamma,iW.DEFAULT_GAMMA)),this.splitDirection=(0,Z.Z)(t.splitDirection,iW.DEFAULT_SPLIT),this.minificationFilter=(0,Z.Z)(t.minificationFilter,(0,Z.Z)(e._defaultMinificationFilter,iW.DEFAULT_MINIFICATION_FILTER)),this.magnificationFilter=(0,Z.Z)(t.magnificationFilter,(0,Z.Z)(e._defaultMagnificationFilter,iW.DEFAULT_MAGNIFICATION_FILTER)),this.show=(0,Z.Z)(t.show,!0),this._minimumTerrainLevel=t.minimumTerrainLevel,this._maximumTerrainLevel=t.maximumTerrainLevel,this._rectangle=(0,Z.Z)(t.rectangle,U.Z.MAX_VALUE),this._maximumAnisotropy=t.maximumAnisotropy,this._imageryCache={},this._skeletonPlaceholder=new ij(iH.createPlaceholder(this)),this._show=!0,this._layerIndex=-1,this._isBaseLayer=!1,this._requestImageError=void 0,this._reprojectComputeCommands=[],this.cutoutRectangle=t.cutoutRectangle,this.colorToAlpha=t.colorToAlpha,this.colorToAlphaThreshold=(0,Z.Z)(t.colorToAlphaThreshold,iW.DEFAULT_APPLY_COLOR_TO_ALPHA_THRESHOLD)}ij.prototype.freeResources=function(){(0,y.Z)(this.readyImagery)&&this.readyImagery.releaseReference(),(0,y.Z)(this.loadingImagery)&&this.loadingImagery.releaseReference()},ij.prototype.processStateMachine=function(e,t,i){let n;let r=this.loadingImagery,o=r.imageryLayer;if(r.processStateMachine(t,!this.useWebMercatorT,i),r.state===tu.READY)return(0,y.Z)(this.readyImagery)&&this.readyImagery.releaseReference(),this.readyImagery=this.loadingImagery,this.loadingImagery=void 0,this.textureTranslationAndScale=o._calculateTextureTranslationAndScale(e,this),!0;let a=r.parent;for(;(0,y.Z)(a)&&(a.state!==tu.READY||!this.useWebMercatorT&&!(0,y.Z)(a.texture));)a.state!==tu.FAILED&&a.state!==tu.INVALID&&(n=n||a),a=a.parent;return this.readyImagery!==a&&((0,y.Z)(this.readyImagery)&&this.readyImagery.releaseReference(),this.readyImagery=a,(0,y.Z)(a)&&(a.addReference(),this.textureTranslationAndScale=o._calculateTextureTranslationAndScale(e,this))),(r.state===tu.FAILED||r.state===tu.INVALID)&&(!(0,y.Z)(n)||(n.processStateMachine(t,!this.useWebMercatorT,i),!1))},Object.defineProperties(iW.prototype,{imageryProvider:{get:function(){return this._imageryProvider}},ready:{get:function(){return(0,y.Z)(this._imageryProvider)}},errorEvent:{get:function(){return this._errorEvent}},readyEvent:{get:function(){return this._readyEvent}},rectangle:{get:function(){return this._rectangle}}}),iW.DEFAULT_BRIGHTNESS=1,iW.DEFAULT_CONTRAST=1,iW.DEFAULT_HUE=0,iW.DEFAULT_SATURATION=1,iW.DEFAULT_GAMMA=1,iW.DEFAULT_SPLIT=iG.Z.NONE,iW.DEFAULT_MINIFICATION_FILTER=tl.Z.LINEAR,iW.DEFAULT_MAGNIFICATION_FILTER=ts.Z.LINEAR,iW.DEFAULT_APPLY_COLOR_TO_ALPHA_THRESHOLD=.004,iW.fromProviderAsync=function(e,t){D.Z.typeOf.object("imageryProviderPromise",e);let i=new iW(void 0,t);return i1(i,Promise.resolve(e)),i},iW.fromWorldImagery=function(e){return e=(0,Z.Z)(e,Z.Z.EMPTY_OBJECT),iW.fromProviderAsync(iU({style:e.style}),e)},iW.prototype.isBaseLayer=function(){return this._isBaseLayer},iW.prototype.isDestroyed=function(){return!1},iW.prototype.destroy=function(){return(0,b.Z)(this)};let iq=new U.Z,iY=new U.Z,iX=new U.Z,i$=new U.Z;function iK(e,t,i){return`${e}:${t}:${i}`}function iQ(e,t,i){return JSON.stringify([e,t,i])}iW.prototype.getImageryRectangle=function(){let e=this._imageryProvider,t=this._rectangle;return U.Z.intersection(e.rectangle,t)},iW.prototype._createTileImagerySkeletons=function(e,t,i){let n,r,o;let a=e.data;if(!(0,y.Z)(t)||(0,y.Z)(this._minimumTerrainLevel)&&e.level<this._minimumTerrainLevel||(0,y.Z)(this._maximumTerrainLevel)&&e.level>this._maximumTerrainLevel)return!1;(0,y.Z)(i)||(i=a.imagery.length);let s=this._imageryProvider;if(!this.ready)return this._skeletonPlaceholder.loadingImagery.addReference(),a.imagery.splice(i,0,this._skeletonPlaceholder),!0;let l=s.tilingScheme.projection instanceof ei.Z&&e.rectangle.north<ei.Z.MaximumLatitude&&e.rectangle.south>-ei.Z.MaximumLatitude,c=U.Z.intersection(s.rectangle,this._rectangle,iq),u=U.Z.intersection(e.rectangle,c,iY);if(!(0,y.Z)(u)){if(!this.isBaseLayer())return!1;let t=e.rectangle;u=iY,t.south>=c.north?u.north=u.south=c.north:t.north<=c.south?u.north=u.south=c.south:(u.south=Math.max(t.south,c.south),u.north=Math.min(t.north,c.north)),t.west>=c.east?u.west=u.east=c.east:t.east<=c.west?u.west=u.east=c.west:(u.west=Math.max(t.west,c.west),u.east=Math.min(t.east,c.east))}let h=0;u.south>0?h=u.south:u.north<0&&(h=u.north);let d=function(e,t,i){let n=e._imageryProvider,r=n.tilingScheme,o=r.ellipsoid,a=e._imageryProvider.tilingScheme.projection instanceof P.Z?1:Math.cos(i),s=r.rectangle;return 0|Math.round(Math.log(o.maximumRadius*s.width*a/(n.tileWidth*r.getNumberOfXTilesAtLevel(0))/t)/Math.log(2))}(this,1*t.getLevelMaximumGeometricError(e.level),h);d=Math.max(0,d);let f=s.maximumLevel;if(d>f&&(d=f),(0,y.Z)(s.minimumLevel)){let e=s.minimumLevel;d<e&&(d=e)}let p=s.tilingScheme,m=p.positionToTileXY(U.Z.northwest(u),d),_=p.positionToTileXY(U.Z.southeast(u),d),g=e.rectangle.width/512,Z=e.rectangle.height/512,b=p.tileXYToRectangle(m.x,m.y,d);Math.abs(b.south-e.rectangle.north)<Z&&m.y<_.y&&++m.y,Math.abs(b.east-e.rectangle.west)<g&&m.x<_.x&&++m.x;let v=p.tileXYToRectangle(_.x,_.y,d);Math.abs(v.north-e.rectangle.south)<Z&&_.y>m.y&&--_.y,Math.abs(v.west-e.rectangle.east)<g&&_.x>m.x&&--_.x;let T=U.Z.clone(e.rectangle,i$),E=p.tileXYToRectangle(m.x,m.y,d),x=U.Z.intersection(E,c,iX);l?(p.rectangleToNativeRectangle(T,T),p.rectangleToNativeRectangle(E,E),p.rectangleToNativeRectangle(x,x),p.rectangleToNativeRectangle(c,c),n=p.tileXYToNativeRectangle.bind(p),g=T.width/512,Z=T.height/512):n=p.tileXYToRectangle.bind(p);let w=0,S=1;!this.isBaseLayer()&&Math.abs(x.west-T.west)>=g&&(w=Math.min(1,(x.west-T.west)/T.width)),!this.isBaseLayer()&&Math.abs(x.north-T.north)>=Z&&(S=Math.max(0,(x.north-T.south)/T.height));let C=S;for(let e=m.x;e<=_.x;e++)if(r=w,E=n(e,m.y,d),x=U.Z.simpleIntersection(E,c,iX),(0,y.Z)(x)){w=Math.min(1,(x.east-T.west)/T.width),e===_.x&&(this.isBaseLayer()||Math.abs(x.east-T.east)<g)&&(w=1),S=C;for(let t=m.y;t<=_.y;t++){if(o=S,E=n(e,t,d),x=U.Z.simpleIntersection(E,c,iX),!(0,y.Z)(x))continue;S=Math.max(0,(x.south-T.south)/T.height),t===_.y&&(this.isBaseLayer()||Math.abs(x.south-T.south)<Z)&&(S=0);let s=new eH.Z(r,S,w,o),u=this.getImageryFromCache(e,t,d);a.imagery.splice(i,0,new ij(u,s,l)),++i}}return!0},iW.prototype._calculateTextureTranslationAndScale=function(e,t){let i=t.readyImagery.rectangle,n=e.rectangle;if(t.useWebMercatorT){let e=t.readyImagery.imageryLayer.imageryProvider.tilingScheme;i=e.rectangleToNativeRectangle(i,iq),n=e.rectangleToNativeRectangle(n,i$)}let r=n.width,o=n.height,a=r/i.width,s=o/i.height;return new eH.Z(a*(n.west-i.west)/r,s*(n.south-i.south)/o,a,s)},iW.prototype._requestImagery=function(e){let t=this._imageryProvider,i=this;function n(n){if(e.request.state===ti.Z.CANCELLED){e.state=tu.UNLOADED,e.request=void 0;return}e.state=tu.FAILED,e.request=void 0;let o=`Failed to obtain image tile X: ${e.x} Y: ${e.y} Level: ${e.level}.`;i._requestImageError=tr.reportError(i._requestImageError,t,t.errorEvent,o,e.x,e.y,e.level,n),i._requestImageError.retry&&r()}function r(){let r=new tt.Z({throttle:!1,throttleByServer:!0,type:tn.Z.IMAGERY});e.request=r,e.state=tu.TRANSITIONING;let o=t.requestImage(e.x,e.y,e.level,r);if(!(0,y.Z)(o)){e.state=tu.UNLOADED,e.request=void 0;return}(0,y.Z)(t.getTileCredits)&&(e.credits=t.getTileCredits(e.x,e.y,e.level)),o.then(function(t){!function(t){if(!(0,y.Z)(t))return n();e.image=t,e.state=tu.RECEIVED,e.request=void 0,tr.reportSuccess(i._requestImageError)}(t)}).catch(function(e){n(e)})}r()},iW.prototype._createTextureWebGL=function(e,t){let i=new ta.Z({minificationFilter:this.minificationFilter,magnificationFilter:this.magnificationFilter}),n=t.image;return new eP.Z((0,y.Z)(n.internalFormat)?{context:e,pixelFormat:n.internalFormat,width:n.width,height:n.height,source:{arrayBufferView:n.bufferView},sampler:i}:{context:e,source:n,pixelFormat:this._imageryProvider.hasAlphaChannel?te.Z.RGBA:te.Z.RGB,sampler:i})},iW.prototype._createTexture=function(e,t){let i=this._imageryProvider,n=t.image;if((0,y.Z)(i.tileDiscardPolicy)){let e=i.tileDiscardPolicy;if((0,y.Z)(e)){if(!e.isReady()){t.state=tu.RECEIVED;return}if(e.shouldDiscardImage(n)){t.state=tu.INVALID;return}}}if(this.minificationFilter!==tl.Z.NEAREST&&this.minificationFilter!==tl.Z.LINEAR)throw new v.Z("ImageryLayer minification filter must be NEAREST or LINEAR");let r=this._createTextureWebGL(e,t);i.tilingScheme.projection instanceof ei.Z?t.textureWebMercator=r:t.texture=r,t.image=void 0,t.state=tu.TEXTURE_LOADED},iW.prototype._finalizeReprojectTexture=function(e,t){let i=this.minificationFilter,n=this.magnificationFilter;if(i===tl.Z.LINEAR&&n===ts.Z.LINEAR&&!te.Z.isCompressedFormat(t.pixelFormat)&&F.Z.isPowerOfTwo(t.width)&&F.Z.isPowerOfTwo(t.height)){i=tl.Z.LINEAR_MIPMAP_LINEAR;let r=e2.Z.maximumTextureFilterAnisotropy,o=Math.min(r,(0,Z.Z)(this._maximumAnisotropy,r)),a=iK(i,n,o),s=e.cache.imageryLayerMipmapSamplers;(0,y.Z)(s)||(s={},e.cache.imageryLayerMipmapSamplers=s);let l=s[a];(0,y.Z)(l)||(l=s[a]=new ta.Z({wrapS:tc.Z.CLAMP_TO_EDGE,wrapT:tc.Z.CLAMP_TO_EDGE,minificationFilter:i,magnificationFilter:n,maximumAnisotropy:o})),t.generateMipmap(iV.Z.NICEST),t.sampler=l}else{let r=iK(i,n,0),o=e.cache.imageryLayerNonMipmapSamplers;(0,y.Z)(o)||(o={},e.cache.imageryLayerNonMipmapSamplers=o);let a=o[r];(0,y.Z)(a)||(a=o[r]=new ta.Z({wrapS:tc.Z.CLAMP_TO_EDGE,wrapT:tc.Z.CLAMP_TO_EDGE,minificationFilter:i,magnificationFilter:n})),t.sampler=a}},iW.prototype._reprojectTexture=function(e,t,i){let n=t.textureWebMercator||t.texture,r=t.rectangle,o=e.context;if((i=(0,Z.Z)(i,!0))&&!(this._imageryProvider.tilingScheme.projection instanceof P.Z)&&r.width/n.width>1e-5){let e=this;t.addReference();let i=new ik.Z({persists:!0,owner:this,preExecute:function(e){(function(e,t,i,n){let r=t.cache.imageryLayer_reproject;if(!(0,y.Z)(r)){r=t.cache.imageryLayer_reproject={vertexArray:void 0,shaderProgram:void 0,sampler:void 0,destroy:function(){(0,y.Z)(this.framebuffer)&&this.framebuffer.destroy(),(0,y.Z)(this.vertexArray)&&this.vertexArray.destroy(),(0,y.Z)(this.shaderProgram)&&this.shaderProgram.destroy()}};let e=new Float32Array(256),i=0;for(let t=0;t<64;++t){let n=t/63;e[i++]=0,e[i++]=n,e[i++]=1,e[i++]=n}let n={position:0,webMercatorT:1},o=ed.getRegularGridIndices(2,64),a=e0.Z.createIndexBuffer({context:t,typedArray:o,usage:e1.Z.STATIC_DRAW,indexDatatype:eh.Z.UNSIGNED_SHORT});r.vertexArray=new e9.Z({context:t,attributes:[{index:n.position,vertexBuffer:e0.Z.createVertexBuffer({context:t,typedArray:e,usage:e1.Z.STATIC_DRAW}),componentsPerAttribute:2},{index:n.webMercatorT,vertexBuffer:e0.Z.createVertexBuffer({context:t,sizeInBytes:512,usage:e1.Z.STREAM_DRAW}),componentsPerAttribute:1}],indexBuffer:a});let s=new eD.Z({sources:["in vec4 position;\nin float webMercatorT;\n\nuniform vec2 u_textureDimensions;\n\nout vec2 v_textureCoordinates;\n\nvoid main()\n{\n v_textureCoordinates = vec2(position.x, webMercatorT);\n gl_Position = czm_viewportOrthographic * (position * vec4(u_textureDimensions, 1.0, 1.0));\n}\n"]});r.shaderProgram=eL.Z.fromCache({context:t,vertexShaderSource:s,fragmentShaderSource:"uniform sampler2D u_texture;\n\nin vec2 v_textureCoordinates;\n\nvoid main()\n{\n out_FragColor = texture(u_texture, v_textureCoordinates);\n}\n",attributeLocations:n}),r.sampler=new ta.Z({wrapS:tc.Z.CLAMP_TO_EDGE,wrapT:tc.Z.CLAMP_TO_EDGE,minificationFilter:tl.Z.LINEAR,magnificationFilter:ts.Z.LINEAR})}i.sampler=r.sampler;let o=i.width,a=i.height;iJ.textureDimensions.x=o,iJ.textureDimensions.y=a,iJ.texture=i;let s=Math.sin(n.south),l=.5*Math.log((1+s)/(1-s)),c=1/(.5*Math.log((1+(s=Math.sin(n.north)))/(1-s))-l),u=new eP.Z({context:t,width:o,height:a,pixelFormat:i.pixelFormat,pixelDatatype:i.pixelDatatype,preMultiplyAlpha:i.preMultiplyAlpha});F.Z.isPowerOfTwo(o)&&F.Z.isPowerOfTwo(a)&&u.generateMipmap(iV.Z.NICEST);let h=n.south,d=n.north,f=0;for(let e=0;e<64;++e){let t=e/63,i=(.5*Math.log((1+(s=Math.sin(F.Z.lerp(h,d,t))))/(1-s))-l)*c;i0[f++]=i,i0[f++]=i}r.vertexArray.getAttribute(1).vertexBuffer.copyFromArrayView(i0),e.shaderProgram=r.shaderProgram,e.outputTexture=u,e.uniformMap=iJ,e.vertexArray=r.vertexArray})(e,o,n,t.rectangle)},postExecute:function(i){t.texture=i,e._finalizeReprojectTexture(o,i),t.state=tu.READY,t.releaseReference()},canceled:function(){t.state=tu.TEXTURE_LOADED,t.releaseReference()}});this._reprojectComputeCommands.push(i)}else i&&(t.texture=n),this._finalizeReprojectTexture(o,n),t.state=tu.READY},iW.prototype.queueReprojectionCommands=function(e){let t=this._reprojectComputeCommands,i=t.length;for(let n=0;n<i;++n)e.commandList.push(t[n]);t.length=0},iW.prototype.cancelReprojections=function(){this._reprojectComputeCommands.forEach(function(e){(0,y.Z)(e.canceled)&&e.canceled()}),this._reprojectComputeCommands.length=0},iW.prototype.getImageryFromCache=function(e,t,i,n){let r=iQ(e,t,i),o=this._imageryCache[r];return(0,y.Z)(o)||(o=new iH(this,e,t,i,n),this._imageryCache[r]=o),o.addReference(),o},iW.prototype.removeImageryFromCache=function(e){let t=iQ(e.x,e.y,e.level);delete this._imageryCache[t]};let iJ={u_textureDimensions:function(){return this.textureDimensions},u_texture:function(){return this.texture},textureDimensions:new L.Z,texture:void 0},i0=E.Z.supportsTypedArrays()?new Float32Array(128):void 0;async function i1(e,t){let i;try{if(i=await Promise.resolve(t),e.isDestroyed())return;e._imageryProvider=i,e._readyEvent.raiseEvent(i)}catch(t){var n;(n=e._errorEvent).numberOfListeners>0?n.raiseEvent(t):console.error(t)}}var i2=i(9250),i3=i(5899),i4=i(1082),i5=i(8328),i9=i(2402),i8={WEST:0,NORTH:1,EAST:2,SOUTH:3,NORTHWEST:4,NORTHEAST:5,SOUTHWEST:6,SOUTHEAST:7};let i6={NONE:0,CULLED:1,RENDERED:2,REFINED:3,RENDERED_AND_KICKED:6,REFINED_AND_KICKED:7,CULLED_BUT_NEEDED:9,wasKicked:function(e){return e>=i6.RENDERED_AND_KICKED},originalResult:function(e){return 3&e},kick:function(e){return 4|e}};function i7(e){this.tile=e,this.frameLastUpdated=void 0,this.westMeshes=[],this.westTiles=[],this.southMeshes=[],this.southTiles=[],this.eastMeshes=[],this.eastTiles=[],this.northMeshes=[],this.northTiles=[],this.southwestMesh=void 0,this.southwestTile=void 0,this.southeastMesh=void 0,this.southeastTile=void 0,this.northwestMesh=void 0,this.northwestTile=void 0,this.northeastMesh=void 0,this.northeastTile=void 0,this.changedThisFrame=!0,this.visitedFrame=void 0,this.enqueuedFrame=void 0,this.mesh=void 0,this.vertexArray=void 0,this.waterMaskTexture=void 0,this.waterMaskTranslationAndScale=new eH.Z}i7.prototype.update=function(e,t,i){this.changedThisFrame&&(ny(e,t,this.tile,i),this.changedThisFrame=!1)},i7.prototype.destroy=function(e){this._destroyVertexArray(e),(0,y.Z)(this.waterMaskTexture)&&(--this.waterMaskTexture.referenceCount,0===this.waterMaskTexture.referenceCount&&this.waterMaskTexture.destroy(),this.waterMaskTexture=void 0)},i7.prototype._destroyVertexArray=function(e){(0,y.Z)(this.vertexArray)&&((0,y.Z)(e)?e.push(this.vertexArray):tf._freeVertexArray(this.vertexArray),this.vertexArray=void 0)};let ne=new i9.Z;function nt(e,t,i,n,r,o,a,s,l){if(void 0===n)return;let c=n;for(;c&&(c._lastSelectionResultFrame!==r||i6.wasKicked(c._lastSelectionResult)||i6.originalResult(c._lastSelectionResult)===i6.CULLED);){if(a)return;let e=c.parent;if(o>=i8.NORTHWEST&&void 0!==e)switch(o){case i8.NORTHWEST:c=c===e.northwestChild?e:void 0;break;case i8.NORTHEAST:c=c===e.northeastChild?e:void 0;break;case i8.SOUTHWEST:c=c===e.southwestChild?e:void 0;break;case i8.SOUTHEAST:c=c===e.southeastChild?e:void 0}else c=e}if(void 0!==c){if(c._lastSelectionResult===i6.RENDERED){if((0,y.Z)(c.data.vertexArray))return;!function(e,t,i,n,r,o,a,s){let l=n.data;if(void 0===l.fill)l.fill=new i7(n);else if(l.fill.visitedFrame===o)return;l.fill.enqueuedFrame!==o&&(l.fill.enqueuedFrame=o,l.fill.changedThisFrame=!1,a.enqueue(n)),function(e,t,i,n,r,o){let a,s,l,c,u,h,d;let f=n.data.fill,p=i.data.fill;switch((0,y.Z)(p)?(p.visitedFrame=t.frameNumber,p.changedThisFrame&&(ny(e,t,i,o),p.changedThisFrame=!1),a=i.data.fill.mesh):a=i.data.mesh,r){case i8.WEST:s=f.westMeshes,l=f.westTiles;break;case i8.SOUTH:s=f.southMeshes,l=f.southTiles;break;case i8.EAST:s=f.eastMeshes,l=f.eastTiles;break;case i8.NORTH:s=f.northMeshes,l=f.northTiles;break;case i8.NORTHWEST:f.changedThisFrame=f.changedThisFrame||f.northwestMesh!==a,f.northwestMesh=a,f.northwestTile=i;return;case i8.NORTHEAST:f.changedThisFrame=f.changedThisFrame||f.northeastMesh!==a,f.northeastMesh=a,f.northeastTile=i;return;case i8.SOUTHWEST:f.changedThisFrame=f.changedThisFrame||f.southwestMesh!==a,f.southwestMesh=a,f.southwestTile=i;return;case i8.SOUTHEAST:f.changedThisFrame=f.changedThisFrame||f.southeastMesh!==a,f.southeastMesh=a,f.southeastTile=i;return}if(i.level<=n.level){f.changedThisFrame=f.changedThisFrame||s[0]!==a||1!==s.length,s[0]=a,l[0]=i,s.length=1,l.length=1;return}let m=i.rectangle,_=n.rectangle;switch(r){case i8.WEST:for(c=0,d=(_.north-_.south)*F.Z.EPSILON5;c<l.length&&(h=l[c].rectangle,!F.Z.greaterThan(m.north,h.south,d));++c);for(u=c;u<l.length&&(h=l[u].rectangle,!F.Z.greaterThanOrEquals(m.south,h.north,d));++u);break;case i8.SOUTH:for(c=0,d=(_.east-_.west)*F.Z.EPSILON5;c<l.length&&(h=l[c].rectangle,!F.Z.lessThan(m.west,h.east,d));++c);for(u=c;u<l.length&&(h=l[u].rectangle,!F.Z.lessThanOrEquals(m.east,h.west,d));++u);break;case i8.EAST:for(c=0,d=(_.north-_.south)*F.Z.EPSILON5;c<l.length&&(h=l[c].rectangle,!F.Z.lessThan(m.south,h.north,d));++c);for(u=c;u<l.length&&(h=l[u].rectangle,!F.Z.lessThanOrEquals(m.north,h.south,d));++u);break;case i8.NORTH:for(c=0,d=(_.east-_.west)*F.Z.EPSILON5;c<l.length&&(h=l[c].rectangle,!F.Z.greaterThan(m.east,h.west,d));++c);for(u=c;u<l.length&&(h=l[u].rectangle,!F.Z.greaterThanOrEquals(m.west,h.east,d));++u);}u-c==1?(f.changedThisFrame=f.changedThisFrame||s[c]!==a,s[c]=a,l[c]=i):(f.changedThisFrame=!0,s.splice(c,u-c,a),l.splice(c,u-c,i))}(e,t,i,n,r,s)}(e,t,i,c,o,r,s,l);return}if(i6.originalResult(n._lastSelectionResult)!==i6.CULLED)switch(o){case i8.WEST:nt(e,t,i,n.northwestChild,r,o,!0,s,l),nt(e,t,i,n.southwestChild,r,o,!0,s,l);break;case i8.EAST:nt(e,t,i,n.southeastChild,r,o,!0,s,l),nt(e,t,i,n.northeastChild,r,o,!0,s,l);break;case i8.SOUTH:nt(e,t,i,n.southwestChild,r,o,!0,s,l),nt(e,t,i,n.southeastChild,r,o,!0,s,l);break;case i8.NORTH:nt(e,t,i,n.northeastChild,r,o,!0,s,l),nt(e,t,i,n.northwestChild,r,o,!0,s,l);break;case i8.NORTHWEST:nt(e,t,i,n.northwestChild,r,o,!0,s,l);break;case i8.NORTHEAST:nt(e,t,i,n.northeastChild,r,o,!0,s,l);break;case i8.SOUTHWEST:nt(e,t,i,n.southwestChild,r,o,!0,s,l);break;case i8.SOUTHEAST:nt(e,t,i,n.southeastChild,r,o,!0,s,l);break;default:throw new v.Z("Invalid edge")}}}i7.updateFillTiles=function(e,t,i,n){let r=e._quadtree,o=r._levelZeroTiles,a=r._lastSelectionFrameNumber;ne.clear();for(let e=0;e<t.length;++e){let i=t[e];(0,y.Z)(i.data.vertexArray)&&ne.enqueue(t[e])}let s=ne.dequeue();for(;void 0!==s;){let t=s.findTileToWest(o),r=s.findTileToSouth(o),l=s.findTileToEast(o),c=s.findTileToNorth(o);nt(e,i,s,t,a,i8.EAST,!1,ne,n),nt(e,i,s,r,a,i8.NORTH,!1,ne,n),nt(e,i,s,l,a,i8.WEST,!1,ne,n),nt(e,i,s,c,a,i8.SOUTH,!1,ne,n);let u=t.findTileToNorth(o),h=t.findTileToSouth(o),d=l.findTileToNorth(o),f=l.findTileToSouth(o);nt(e,i,s,u,a,i8.SOUTHEAST,!1,ne,n),nt(e,i,s,d,a,i8.SOUTHWEST,!1,ne,n),nt(e,i,s,h,a,i8.NORTHEAST,!1,ne,n),nt(e,i,s,f,a,i8.NORTHWEST,!1,ne,n),s=ne.dequeue()}};let ni=new C.Z,nn=new C.Z,nr=new _.Z,no=new _.Z,na=new L.Z,ns=new L.Z,nl=new L.Z;function nc(){this.height=0,this.encodedNormal=new L.Z}function nu(e,t,i,n,r,o,a,s,l){let c;if((0,y.Z)(r))return r;if((0,y.Z)(o)&&(0,y.Z)(a))c=(o.height+a.height)*.5;else if((0,y.Z)(o))c=o.height;else if((0,y.Z)(a))c=a.height;else if((0,y.Z)(s))c=s.height;else{let t=e.tile.data.tileBoundingRegion,i=0,n=0;(0,y.Z)(t)&&(i=t.minimumHeight,n=t.maximumHeight),c=(i+n)*.5}return nC(e,t,i,n,c,l),l}let nh={minimumHeight:0,maximumHeight:0},nd=new _.Z,nf=new nc,np=new nc,nm=new nc,n_=new nc,ng="undefined"!=typeof Uint8Array?new Uint8Array(81):void 0,nZ={tilingScheme:void 0,x:0,y:0,level:0,exaggeration:1,exaggerationRelativeHeight:0};function ny(e,t,i,n){let r,o;tf.initialize(i,e.terrainProvider,e._imageryLayers);let a=i.data,s=a.fill,l=i.rectangle,c=t.verticalExaggeration,u=t.verticalExaggerationRelativeHeight,h=1!==c,d=i.tilingScheme.ellipsoid,f=nA(s,d,0,1,s.northwestTile,s.northwestMesh,s.northTiles,s.northMeshes,s.westTiles,s.westMeshes,nm),p=nA(s,d,0,0,s.southwestTile,s.southwestMesh,s.westTiles,s.westMeshes,s.southTiles,s.southMeshes,nf),m=nA(s,d,1,0,s.southeastTile,s.southeastMesh,s.southTiles,s.southMeshes,s.eastTiles,s.eastMeshes,np),g=nA(s,d,1,1,s.northeastTile,s.northeastMesh,s.eastTiles,s.eastMeshes,s.northTiles,s.northMeshes,n_);f=nu(s,d,0,1,f,p,g,m,nm),p=nu(s,d,0,0,p,f,m,g,nf),m=nu(s,d,1,1,m,p,g,f,np),g=nu(s,d,1,1,g,m,f,p,n_);let Z=p.height,b=m.height,v=f.height,T=g.height,E=Math.min(Z,b,v,T),x=Math.max(Z,b,v,T),w=(E+x)*.5,C=e.getLevelMaximumGeometricError(i.level),A=4*Math.acos((d.maximumRadius-C)/d.maximumRadius);if(A*=1.5,l.width>A&&x-E<=C){let e=new ey({width:9,height:9,buffer:ng,structure:{heightOffset:x}});nZ.tilingScheme=i.tilingScheme,nZ.x=i.x,nZ.y=i.y,nZ.level=i.level,nZ.exaggeration=c,nZ.exaggerationRelativeHeight=u,s.mesh=e._createMeshSync(nZ)}else{let t,n;let a=U.Z.center(l,nn);a.height=w;let Z=new $(d.cartographicToCartesian(a,nd),void 0,void 0,void 0,void 0,!0,!0,h,c,u),y=5;for(r=0,o=(t=s.westMeshes).length;r<o;++r)y+=t[r].eastIndicesNorthToSouth.length;for(r=0,o=(t=s.southMeshes).length;r<o;++r)y+=t[r].northIndicesWestToEast.length;for(r=0,o=(t=s.eastMeshes).length;r<o;++r)y+=t[r].westIndicesSouthToNorth.length;for(r=0,o=(t=s.northMeshes).length;r<o;++r)y+=t[r].southIndicesEastToWest.length;nh.minimumHeight=E,nh.maximumHeight=x;let b=Z.stride,v=new Float32Array(y*b),T=0;T=nb(d,l,Z,v,0,0,1,f.height,f.encodedNormal,1,nh);let C=T=nO(s,d,Z,v,T,s.westTiles,s.westMeshes,i8.EAST,nh);T=nb(d,l,Z,v,T,0,0,p.height,p.encodedNormal,0,nh);let A=T=nO(s,d,Z,v,T,s.southTiles,s.southMeshes,i8.NORTH,nh);T=nb(d,l,Z,v,T,1,0,m.height,m.encodedNormal,0,nh);let I=T=nO(s,d,Z,v,T,s.eastTiles,s.eastMeshes,i8.WEST,nh);T=nb(d,l,Z,v,T,1,1,g.height,g.encodedNormal,1,nh),T=nO(s,d,Z,v,T,s.northTiles,s.northMeshes,i8.SOUTH,nh),E=nh.minimumHeight,x=nh.maximumHeight;let O=B.Z.fromRectangle(l,E,x,i.tilingScheme.ellipsoid),D=ei.Z.geodeticLatitudeToMercatorAngle(l.south),P=1/(ei.Z.geodeticLatitudeToMercatorAngle(l.north)-D),R=(ei.Z.geodeticLatitudeToMercatorAngle(a.latitude)-D)*P,N=d.geodeticSurfaceNormalCartographic(ni,no),M=k.Z.octEncode(N,na),F=T;Z.encode(v,T*b,O.center,L.Z.fromElements(.5,.5,nl),w,M,R,N);let z=++T,V=z<256?1:2,H=(z-1)*3,G=H*V;if((v.length-z*b)*Float32Array.BYTES_PER_ELEMENT>=G){let e=z*b*Float32Array.BYTES_PER_ELEMENT;n=z<256?new Uint8Array(v.buffer,e,H):new Uint16Array(v.buffer,e,H)}else n=z<256?new Uint8Array(H):new Uint16Array(H);v=new Float32Array(v.buffer,0,z*b);let j=0;for(r=0;r<z-2;++r)n[j++]=F,n[j++]=r,n[j++]=r+1;n[j++]=F,n[j++]=r,n[j++]=0;let W=[];for(r=C;r>=0;--r)W.push(r);let q=[];for(r=A;r>=C;--r)q.push(r);let Y=[];for(r=I;r>=A;--r)Y.push(r);let X=[];for(X.push(0),r=F-1;r>=I;--r)X.push(r);s.mesh=new eu(Z.center,v,n,H,z,E,x,S.Z.fromOrientedBoundingBox(O),function(e,t,i,n,r,o){let a=e.quadtree._occluders.ellipsoid,s=a.ellipsoid;return _.Z.fromRadians(i.west,i.south,r,s,nN[0]),_.Z.fromRadians(i.east,i.south,r,s,nN[1]),_.Z.fromRadians(i.west,i.north,r,s,nN[2]),_.Z.fromRadians(i.east,i.north,r,s,nN[3]),a.computeHorizonCullingPointPossiblyUnderEllipsoid(t,nN,n,void 0)}(e,O.center,l,E,x),Z.stride,O,Z,W,q,Y,X)}let I=t.context;s._destroyVertexArray(n),s.vertexArray=tf._createVertexArrayForMesh(I,s.mesh),a.processImagery(i,e.terrainProvider,t,!0);let O=s.waterMaskTexture;if(s.waterMaskTexture=void 0,e.terrainProvider.hasWaterMask){let e=a._findAncestorTileWithTerrainData(i);(0,y.Z)(e)&&(0,y.Z)(e.data.waterMaskTexture)&&(s.waterMaskTexture=e.data.waterMaskTexture,++s.waterMaskTexture.referenceCount,a._computeWaterMaskTranslationAndScale(i,e,s.waterMaskTranslationAndScale))}(0,y.Z)(O)&&(--O.referenceCount,0===O.referenceCount&&O.destroy())}function nb(e,t,i,n,r,o,a,s,l,c,u){let h;ni.longitude=F.Z.lerp(t.west,t.east,o),ni.latitude=F.Z.lerp(t.south,t.north,a),ni.height=s;let d=e.cartographicToCartesian(ni,nr);return i.hasGeodeticSurfaceNormals&&(h=e.geodeticSurfaceNormal(d,no)),ns.x=o,ns.y=a,i.encode(n,r*i.stride,d,ns,s,l,c,h),u.minimumHeight=Math.min(u.minimumHeight,s),u.maximumHeight=Math.max(u.maximumHeight,s),r+1}let nv=new U.Z;function nT(e,t,i,n){let r=e.rectangle,o=t.rectangle;0===t.x&&1===i.x&&e.x===e.tilingScheme.getNumberOfXTilesAtLevel(e.level)-1?(r=U.Z.clone(e.rectangle,nv),r.west-=F.Z.TWO_PI,r.east-=F.Z.TWO_PI):0===e.x&&0===i.x&&t.x===t.tilingScheme.getNumberOfXTilesAtLevel(t.level)-1&&(r=U.Z.clone(e.rectangle,nv),r.west+=F.Z.TWO_PI,r.east+=F.Z.TWO_PI);let a=r.east-r.west,s=(o.west-r.west)/a,l=(o.east-r.west)/a,c=r.north-r.south,u=(o.south-r.south)/c,h=(o.north-r.south)/c,d=(i.x-s)/(l-s),f=(i.y-u)/(h-u);return Math.abs(d)<Math.EPSILON5?d=0:Math.abs(d-1)<Math.EPSILON5&&(d=1),Math.abs(f)<Math.EPSILON5?f=0:Math.abs(f-1)<Math.EPSILON5&&(f=1),n.x=d,n.y=f,n}let nE=new L.Z;function nx(e,t,i,n,r){let o=e.encoding,a=e.vertices;if(r.height=o.decodeHeight(a,t),o.hasVertexNormals)o.getOctEncodedNormal(a,t,r.encodedNormal);else{let e=r.encodedNormal;e.x=0,e.y=0}}let nw=new L.Z,nS=new _.Z;function nC(e,t,i,n,r,o){o.height=r;let a=t.geodeticSurfaceNormalCartographic(ni,nr);k.Z.octEncode(a,o.encodedNormal)}function nA(e,t,i,n,r,o,a,s,l,c,u){let h,d;return nR(e,t,s,a,!1,i,n,u)||nR(e,t,c,l,!0,i,n,u)?u:nP(r,o)?(h=0===i?0===n?o.eastIndicesNorthToSouth[0]:o.southIndicesEastToWest[0]:0===n?o.northIndicesWestToEast[0]:o.westIndicesSouthToNorth[0],nx(o,h,i,n,u),u):(d=0===i?0===n?nI(e.westMeshes,e.westTiles,i8.EAST,e.southMeshes,e.southTiles,i8.NORTH,i,n):nI(e.northMeshes,e.northTiles,i8.SOUTH,e.westMeshes,e.westTiles,i8.EAST,i,n):0===n?nI(e.southMeshes,e.southTiles,i8.NORTH,e.eastMeshes,e.eastTiles,i8.WEST,i,n):nI(e.eastMeshes,e.eastTiles,i8.WEST,e.northMeshes,e.northTiles,i8.SOUTH,i,n),(0,y.Z)(d))?(nC(e,t,i,n,d,u),u):void 0}function nI(e,t,i,n,r,o,a,s){let l=nD(e,t,!1,i,a,s),c=nD(n,r,!0,o,a,s);return(0,y.Z)(l)&&(0,y.Z)(c)?(l+c)*.5:(0,y.Z)(l)?l:c}function nO(e,t,i,n,r,o,a,s,l){for(let c=0;c<o.length;++c)r=function(e,t,i,n,r,o,a,s,l){let c,u,h,d,f,p,m=o.rectangle;s===i8.EAST&&0===e.tile.x?(m=U.Z.clone(o.rectangle,nv),m.west-=F.Z.TWO_PI,m.east-=F.Z.TWO_PI):s===i8.WEST&&0===o.x&&(m=U.Z.clone(o.rectangle,nv),m.west+=F.Z.TWO_PI,m.east+=F.Z.TWO_PI);let _=e.tile.rectangle;switch(r>0&&(i.decodeTextureCoordinates(n,r-1,nl),c=nl.x,u=nl.y),s){case i8.WEST:h=a.westIndicesSouthToNorth,d=!1;break;case i8.NORTH:h=a.northIndicesWestToEast,d=!0;break;case i8.EAST:h=a.eastIndicesNorthToSouth,d=!1;break;case i8.SOUTH:h=a.southIndicesEastToWest,d=!0}let g=e.tile,Z=a.encoding,y=a.vertices,b=i.stride;Z.hasWebMercatorT&&(f=ei.Z.geodeticLatitudeToMercatorAngle(_.south),p=1/(ei.Z.geodeticLatitudeToMercatorAngle(_.north)-f));for(let e=0;e<h.length;++e){let a,s;let m=h[e],v=Z.decodeTextureCoordinates(y,m,nl);nT(o,g,v,v);let T=v.x,E=v.y,x=d?T:E;if(x<0||x>1||Math.abs(T-c)<F.Z.EPSILON5&&Math.abs(E-u)<F.Z.EPSILON5)continue;let w=Math.abs(T)<F.Z.EPSILON5||Math.abs(T-1)<F.Z.EPSILON5,S=Math.abs(E)<F.Z.EPSILON5||Math.abs(E-1)<F.Z.EPSILON5;if(w&&S)continue;let C=Z.decodePosition(y,m,nr),A=Z.decodeHeight(y,m);Z.hasVertexNormals?a=Z.getOctEncodedNormal(y,m,na):((a=na).x=0,a.y=0);let I=E;if(Z.hasWebMercatorT){let e=F.Z.lerp(_.south,_.north,E);I=(ei.Z.geodeticLatitudeToMercatorAngle(e)-f)*p}i.hasGeodeticSurfaceNormals&&(s=t.geodeticSurfaceNormal(C,no)),i.encode(n,r*b,C,v,A,a,I,s),l.minimumHeight=Math.min(l.minimumHeight,A),l.maximumHeight=Math.max(l.maximumHeight,A),++r}return r}(e,t,i,n,r,o[c],a[c],s,l);return r}function nD(e,t,i,n,r,o){let a,s,l;i?(a=0,s=e.length,l=1):(a=e.length-1,s=-1,l=-1);for(let r=a;r!==s;r+=l){let o;let a=e[r];if(!nP(t[r],a))continue;switch(n){case i8.WEST:o=a.westIndicesSouthToNorth;break;case i8.SOUTH:o=a.southIndicesEastToWest;break;case i8.EAST:o=a.eastIndicesNorthToSouth;break;case i8.NORTH:o=a.northIndicesWestToEast}let s=o[i?0:o.length-1];if((0,y.Z)(s))return a.encoding.decodeHeight(a.vertices,s)}}function nP(e,t){return(0,y.Z)(t)&&(!(0,y.Z)(e.data.fill)||!e.data.fill.changedThisFrame)}function nR(e,t,i,n,r,o,a,s){let l,c,u,h,d;let f=n[r?0:i.length-1],p=i[r?0:i.length-1];if(nP(f,p)&&(0===o?0===a?(l=r?p.northIndicesWestToEast:p.eastIndicesNorthToSouth,c=r,u=r):(l=r?p.eastIndicesNorthToSouth:p.southIndicesEastToWest,c=!r,u=!1):0===a?(l=r?p.westIndicesSouthToNorth:p.northIndicesWestToEast,c=!r,u=!0):(l=r?p.southIndicesEastToWest:p.westIndicesSouthToNorth,c=r,u=!r),l.length>0)){h=r?0:l.length-1,d=l[h],p.encoding.decodeTextureCoordinates(p.vertices,d,nl);let i=nT(f,e.tile,nl,nl);if(i.x===o&&i.y===a)return nx(p,d,o,a,s),!0;if(!((h=(0,i5.Z)(l,c?o:a,function(t,i){p.encoding.decodeTextureCoordinates(p.vertices,t,nl);let n=nT(f,e.tile,nl,nl);return u?c?n.x-o:n.y-a:c?o-n.x:a-n.y}))<0))return nx(p,l[h],o,a,s),!0;if((h=~h)>0&&h<l.length)return!function(e,t,i,n,r,o,a,s,l,c){let u,h;let d=n.encoding,f=n.vertices,p=nT(t,i,d.decodeTextureCoordinates(f,r,nl),nl),m=nT(t,i,d.decodeTextureCoordinates(f,o,ns),ns);u=l?(a-p.x)/(m.x-p.x):(s-p.y)/(m.y-p.y);let g=d.decodeHeight(f,r),Z=d.decodeHeight(f,o),y=i.rectangle;if(ni.longitude=F.Z.lerp(y.west,y.east,a),ni.latitude=F.Z.lerp(y.south,y.north,s),c.height=ni.height=F.Z.lerp(g,Z,u),d.hasVertexNormals){let e=d.getOctEncodedNormal(f,r,nE),t=d.getOctEncodedNormal(f,o,nw),i=k.Z.octDecode(e.x,e.y,nr),n=k.Z.octDecode(t.x,t.y,nS);h=_.Z.lerp(i,n,u,nr),_.Z.normalize(h,h),k.Z.octEncode(h,c.encodedNormal)}else h=e.geodeticSurfaceNormalCartographic(ni,nr),k.Z.octEncode(h,c.encodedNormal)}(t,f,e.tile,p,l[h-1],l[h],o,a,c,s),!0}return!1}let nN=[new _.Z,new _.Z,new _.Z,new _.Z];var nL=i(6171);function nM(e){if(!(0,y.Z)(e))throw new v.Z("options is required.");if((0,y.Z)(e.terrainProvider)){if((0,y.Z)(e.imageryLayers)){if(!(0,y.Z)(e.surfaceShaderSet))throw new v.Z("options.surfaceShaderSet is required.")}else throw new v.Z("options.imageryLayers is required.")}else throw new v.Z("options.terrainProvider is required.");this.lightingFadeOutDistance=65e5,this.lightingFadeInDistance=9e6,this.hasWaterMask=!1,this.oceanNormalMap=void 0,this.zoomedOutOceanSpecularIntensity=.5,this.enableLighting=!1,this.dynamicAtmosphereLighting=!1,this.dynamicAtmosphereLightingFromSun=!1,this.showGroundAtmosphere=!1,this.shadows=i4.Z.RECEIVE_ONLY,this.vertexShadowDarkness=.3,this.fillHighlightColor=void 0,this.hueShift=0,this.saturationShift=0,this.brightnessShift=0,this.showSkirts=!0,this.backFaceCulling=!0,this.undergroundColor=void 0,this.undergroundColorAlphaByDistance=void 0,this.lambertDiffuseMultiplier=0,this.materialUniformMap=void 0,this._materialUniformMap=void 0,this._quadtree=void 0,this._terrainProvider=e.terrainProvider,this._imageryLayers=e.imageryLayers,this._surfaceShaderSet=e.surfaceShaderSet,this._renderState=void 0,this._blendRenderState=void 0,this._disableCullingRenderState=void 0,this._disableCullingBlendRenderState=void 0,this._errorEvent=new I.Z,this._removeLayerAddedListener=this._imageryLayers.layerAdded.addEventListener(nM.prototype._onLayerAdded,this),this._removeLayerRemovedListener=this._imageryLayers.layerRemoved.addEventListener(nM.prototype._onLayerRemoved,this),this._removeLayerMovedListener=this._imageryLayers.layerMoved.addEventListener(nM.prototype._onLayerMoved,this),this._removeLayerShownListener=this._imageryLayers.layerShownOrHidden.addEventListener(nM.prototype._onLayerShownOrHidden,this),this._imageryLayersUpdatedEvent=new I.Z,this._layerOrderChanged=!1,this._tilesToRenderByTextureCount=[],this._drawCommands=[],this._uniformMaps=[],this._usedDrawCommands=0,this._vertexArraysToDestroy=[],this._debug={wireframe:!1,boundingSphereTile:void 0},this._baseColor=void 0,this._firstPassInitialColor=void 0,this.baseColor=new A.Z(0,0,.5,1),this._clippingPlanes=void 0,this._clippingPolygons=void 0,this.cartographicLimitRectangle=U.Z.clone(U.Z.MAX_VALUE),this._hasLoadedTilesThisFrame=!1,this._hasFillTilesThisFrame=!1,this._oldVerticalExaggeration=void 0,this._oldVerticalExaggerationRelativeHeight=void 0}function nF(e,t){let i=e.loadingImagery;(0,y.Z)(i)||(i=e.readyImagery);let n=t.loadingImagery;return(0,y.Z)(n)||(n=t.readyImagery),i.imageryLayer._layerIndex-n.imageryLayer._layerIndex}function nz(e,t){let i=t.globeTranslucencyState;if(i.translucent){let n=e.renderState.blending.enabled;i.pushDerivedCommands(e,n,t)}else t.commandList.push(e)}Object.defineProperties(nM.prototype,{baseColor:{get:function(){return this._baseColor},set:function(e){if(!(0,y.Z)(e))throw new v.Z("value is required.");this._baseColor=e,this._firstPassInitialColor=eH.Z.fromColor(e,this._firstPassInitialColor)}},quadtree:{get:function(){return this._quadtree},set:function(e){if(!(0,y.Z)(e))throw new v.Z("value is required.");this._quadtree=e}},tilingScheme:{get:function(){if((0,y.Z)(this._terrainProvider))return this._terrainProvider.tilingScheme}},errorEvent:{get:function(){return this._errorEvent}},imageryLayersUpdatedEvent:{get:function(){return this._imageryLayersUpdatedEvent}},terrainProvider:{get:function(){return this._terrainProvider},set:function(e){this._terrainProvider!==e&&(this._terrainProvider=e,(0,y.Z)(this._quadtree)&&this._quadtree.invalidateAllTiles())}},clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){eM.Z.setOwner(e,this,"_clippingPlanes")}},clippingPolygons:{get:function(){return this._clippingPolygons},set:function(e){e6.Z.setOwner(e,this,"_clippingPolygons")}}}),nM.prototype.update=function(e){this._imageryLayers._update()},nM.prototype.initialize=function(e){this._imageryLayers.queueReprojectionCommands(e),this._layerOrderChanged&&(this._layerOrderChanged=!1,this._quadtree.forEachLoadedTile(function(e){e.data.imagery.sort(nF)})),function(e,t){let i=t.creditDisplay,n=e._terrainProvider;(0,y.Z)(n)&&(0,y.Z)(n.credit)&&i.addCreditToNextFrame(n.credit);let r=e._imageryLayers;for(let e=0,t=r.length;e<t;++e){let t=r.get(e);t.ready&&t.show&&(0,y.Z)(t.imageryProvider.credit)&&i.addCreditToNextFrame(t.imageryProvider.credit)}}(this,e);let t=this._vertexArraysToDestroy,i=t.length;for(let e=0;e<i;++e)tf._freeVertexArray(t[e]);t.length=0},nM.prototype.beginUpdate=function(e){let t=this._tilesToRenderByTextureCount;for(let e=0,i=t.length;e<i;++e){let i=t[e];(0,y.Z)(i)&&(i.length=0)}let i=this._clippingPlanes;(0,y.Z)(i)&&i.enabled&&i.update(e);let n=this._clippingPolygons;(0,y.Z)(n)&&n.enabled&&(n.update(e),n.queueCommands(e)),this._usedDrawCommands=0,this._hasLoadedTilesThisFrame=!1,this._hasFillTilesThisFrame=!1},nM.prototype.endUpdate=function(e){if(!(0,y.Z)(this._renderState)){this._renderState=e5.Z.fromCache({cull:{enabled:!0},depthTest:{enabled:!0,func:e7.Z.LESS}}),this._blendRenderState=e5.Z.fromCache({cull:{enabled:!0},depthTest:{enabled:!0,func:e7.Z.LESS_OR_EQUAL},blending:e8.Z.ALPHA_BLEND});let e=(0,eG.Z)(this._renderState,!0);e.cull.enabled=!1,this._disableCullingRenderState=e5.Z.fromCache(e),(e=(0,eG.Z)(this._blendRenderState,!0)).cull.enabled=!1,this._disableCullingBlendRenderState=e5.Z.fromCache(e)}this._hasFillTilesThisFrame&&this._hasLoadedTilesThisFrame&&i7.updateFillTiles(this,this._quadtree._tilesToRender,e,this._vertexArraysToDestroy);let t=this.quadtree,i=e.verticalExaggeration,n=e.verticalExaggerationRelativeHeight,r=this._oldVerticalExaggeration!==i||this._oldVerticalExaggerationRelativeHeight!==n;this._oldVerticalExaggeration=i,this._oldVerticalExaggerationRelativeHeight=n,r&&t.forEachLoadedTile(function(i){i.data.updateExaggeration(i,e,t)});let l=this._tilesToRenderByTextureCount;for(let t=0,i=l.length;t<i;++t){let i=l[t];if((0,y.Z)(i))for(let t=0,n=i.length;t<n;++t){let n=i[t],r=n.data.tileBoundingRegion;(function(e,t,i){let n=t.data;(0,y.Z)(n.vertexArray)||(void 0===n.fill&&(n.fill=new i7(t)),n.fill.update(e,i));let r=i.creditDisplay,l=n.terrainData;if((0,y.Z)(l)&&(0,y.Z)(l.credits)){let e=l.credits;for(let t=0,i=e.length;t<i;++t)r.addCreditToNextFrame(e[t])}let c=e2.Z.maximumTextureImageUnits,u=n.waterMaskTexture,h=n.waterMaskTranslationAndScale;!(0,y.Z)(u)&&(0,y.Z)(n.fill)&&(u=n.fill.waterMaskTexture,h=n.fill.waterMaskTranslationAndScale);let d=i.cameraUnderground,f=i.globeTranslucencyState,p=f.translucent,m=f.frontFaceAlphaByDistance,g=f.backFaceAlphaByDistance,b=f.rectangle,T=(0,Z.Z)(e.undergroundColor,re),E=(0,Z.Z)(e.undergroundColorAlphaByDistance,rt),x=nG(e,i)&&i.mode===eB.Z.SCENE3D&&T.alpha>0&&(E.nearValue>0||E.farValue>0),w=e.lambertDiffuseMultiplier,C=e.vertexShadowDarkness,I=e.hasWaterMask&&(0,y.Z)(u),O=e.oceanNormalMap,D=I&&(0,y.Z)(O),P=e.terrainProvider,R=(0,y.Z)(P)&&e.terrainProvider.hasVertexNormals,N=i.fog.enabled&&i.fog.renderable&&!d,L=e.showGroundAtmosphere&&i.mode===eB.Z.SCENE3D,M=i4.Z.castShadows(e.shadows)&&!p,k=i4.Z.receiveShadows(e.shadows)&&!p,V=e.hueShift,H=e.saturationShift,j=e.brightnessShift,W=!(F.Z.equalsEpsilon(V,0,F.Z.EPSILON7)&&F.Z.equalsEpsilon(H,0,F.Z.EPSILON7)&&F.Z.equalsEpsilon(j,0,F.Z.EPSILON7)),q=!1;L&&(q=_.Z.magnitude(i.camera.positionWC)>e.nightFadeOutDistance),I&&--c,D&&--c,(0,y.Z)(i.shadowState)&&i.shadowState.shadowsEnabled&&--c,(0,y.Z)(e.clippingPlanes)&&e.clippingPlanes.enabled&&--c,(0,y.Z)(e.clippingPolygons)&&e.clippingPolygons.enabled&&(--c,--c),c-=f.numberOfTextureUniforms;let Y=n.renderedMesh,X=Y.center,$=Y.encoding,K=n.tileBoundingRegion,Q=i.verticalExaggeration,J=i.verticalExaggerationRelativeHeight,ee=1!==Q,et=$.hasGeodeticSurfaceNormals,en=0,er=0,eo=0,ea=0,es=!1;if(i.mode!==eB.Z.SCENE3D){let e=i.mapProjection,n=e.project(U.Z.southwest(t.rectangle),n1),r=e.project(U.Z.northeast(t.rectangle),n2);if(n$.x=n.x,n$.y=n.y,n$.z=r.x,n$.w=r.y,i.mode!==eB.Z.MORPHING&&((X=nJ).x=0,X.y=(n$.z+n$.x)*.5,X.z=(n$.w+n$.y)*.5,n$.x-=X.y,n$.y-=X.z,n$.z-=X.y,n$.w-=X.z),i.mode===eB.Z.SCENE2D&&$.quantization===G.BITS12){let e=(n$.z-n$.x)*1221001221001221e-19,t=(n$.w-n$.y)*1221001221001221e-19;n$.x-=e,n$.y-=t,n$.z+=e,n$.w+=t}e instanceof ei.Z&&(en=t.rectangle.south,er=t.rectangle.north,eo=ei.Z.geodeticLatitudeToMercatorAngle(en),ea=1/(ei.Z.geodeticLatitudeToMercatorAngle(er)-eo),es=!0)}n7.frameState=i,n7.surfaceTile=n,n7.showReflectiveOcean=I,n7.showOceanWaves=D,n7.enableLighting=e.enableLighting,n7.dynamicAtmosphereLighting=e.dynamicAtmosphereLighting,n7.dynamicAtmosphereLightingFromSun=e.dynamicAtmosphereLightingFromSun,n7.showGroundAtmosphere=L,n7.atmosphereLightIntensity=e.atmosphereLightIntensity,n7.atmosphereRayleighCoefficient=e.atmosphereRayleighCoefficient,n7.atmosphereMieCoefficient=e.atmosphereMieCoefficient,n7.atmosphereRayleighScaleHeight=e.atmosphereRayleighScaleHeight,n7.atmosphereMieScaleHeight=e.atmosphereMieScaleHeight,n7.atmosphereMieAnisotropy=e.atmosphereMieAnisotropy,n7.perFragmentGroundAtmosphere=q,n7.hasVertexNormals=R,n7.useWebMercatorProjection=es,n7.clippedByBoundaries=n.clippedByBoundaries,n7.hasGeodeticSurfaceNormals=et,n7.hasExaggeration=ee;let el=n.imagery,ec=0,eu=el.length,ed=e.showSkirts&&!d&&!p,ef=e.backFaceCulling&&!d&&!p,ep=ef?e._renderState:e._disableCullingRenderState,em=ef?e._blendRenderState:e._disableCullingBlendRenderState,e_=ep,eg=e._firstPassInitialColor,eZ=i.context;if((0,y.Z)(e._debug.boundingSphereTile)||s(),e._materialUniformMap!==e.materialUniformMap){e._materialUniformMap=e.materialUniformMap;let t=e._drawCommands.length;for(let n=0;n<t;++n)e._uniformMaps[n]=n8(i,e)}do{let s,l,Z=0;if(e._drawCommands.length<=e._usedDrawCommands?((s=new e3.Z).owner=t,s.cull=!1,s.boundingVolume=new S.Z,s.orientedBoundingBox=void 0,l=n8(i,e),e._drawCommands.push(s),e._uniformMaps.push(l)):(s=e._drawCommands[e._usedDrawCommands],l=e._uniformMaps[e._usedDrawCommands]),s.owner=t,++e._usedDrawCommands,t===e._debug.boundingSphereTile){let e=K.boundingVolume,t=K.boundingSphere;(0,y.Z)(e)?o(e,A.Z.RED).update(i):(0,y.Z)(t)&&a(t,A.Z.RED).update(i)}let I=l.properties;eH.Z.clone(eg,I.initialColor),I.oceanNormalMap=O,I.lightingFadeDistance.x=e.lightingFadeOutDistance,I.lightingFadeDistance.y=e.lightingFadeInDistance,I.nightFadeDistance.x=e.nightFadeOutDistance,I.nightFadeDistance.y=e.nightFadeInDistance,I.atmosphereLightIntensity=e.atmosphereLightIntensity,I.atmosphereRayleighCoefficient=e.atmosphereRayleighCoefficient,I.atmosphereMieCoefficient=e.atmosphereMieCoefficient,I.atmosphereRayleighScaleHeight=e.atmosphereRayleighScaleHeight,I.atmosphereMieScaleHeight=e.atmosphereMieScaleHeight,I.atmosphereMieAnisotropy=e.atmosphereMieAnisotropy,I.zoomedOutOceanSpecularIntensity=e.zoomedOutOceanSpecularIntensity;let D=d?g:m,P=d?m:g;(0,y.Z)(D)&&(eH.Z.fromElements(D.near,D.nearValue,D.far,D.farValue,I.frontFaceAlphaByDistance),eH.Z.fromElements(P.near,P.nearValue,P.far,P.farValue,I.backFaceAlphaByDistance)),eH.Z.fromElements(E.near,E.nearValue,E.far,E.farValue,I.undergroundColorAlphaByDistance),A.Z.clone(T,I.undergroundColor),I.lambertDiffuseMultiplier=w,I.vertexShadowDarkness=C;let R=!(0,y.Z)(n.vertexArray)&&(0,y.Z)(e.fillHighlightColor)&&e.fillHighlightColor.alpha>0;R&&A.Z.clone(e.fillHighlightColor,I.fillHighlightColor),I.verticalExaggerationAndRelativeHeight.x=Q,I.verticalExaggerationAndRelativeHeight.y=J,I.center3D=Y.center,_.Z.clone(X,I.rtc),eH.Z.clone(n$,I.tileRectangle),I.southAndNorthLatitude.x=en,I.southAndNorthLatitude.y=er,I.southMercatorYAndOneOverHeight.x=eo,I.southMercatorYAndOneOverHeight.y=ea;let G=nH(t.rectangle,e.cartographicLimitRectangle),q=nH(t.rectangle,b);_.Z.fromElements(V,H,j,I.hsbShift);let ee=t.rectangle,et=1/ee.width,ei=1/ee.height;nK.x=(G.west-ee.west)*et,nK.y=(G.south-ee.south)*ei,nK.z=(G.east-ee.west)*et,nK.w=(G.north-ee.south)*ei,eH.Z.clone(nK,I.localizedCartographicLimitRectangle),nQ.x=(q.west-ee.west)*et,nQ.y=(q.south-ee.south)*ei,nQ.z=(q.east-ee.west)*et,nQ.w=(q.north-ee.south)*ei,eH.Z.clone(nQ,I.localizedTranslucencyRectangle);let es=N&&F.Z.fog(t._distance,i.fog.density)>F.Z.EPSILON3;W=W&&(es||L);let ef=!1,ep=!1,ey=!1,eb=!1,ev=!1,eT=!1,eE=!1,ex=!1,ew=!1,eS=!1;for(;Z<c&&ec<eu;){let e=el[ec],i=e.readyImagery;if(++ec,!(0,y.Z)(i)||0===i.imageryLayer.alpha)continue;let n=e.useWebMercatorT?i.textureWebMercator:i.texture;if(!(0,y.Z)(n))throw new v.Z("readyImagery is not actually ready!");let o=i.imageryLayer;(0,y.Z)(e.textureTranslationAndScale)||(e.textureTranslationAndScale=o._calculateTextureTranslationAndScale(t,e)),I.dayTextures[Z]=n,I.dayTextureTranslationAndScale[Z]=e.textureTranslationAndScale,I.dayTextureTexCoordsRectangle[Z]=e.textureCoordinateRectangle,I.dayTextureUseWebMercatorT[Z]=e.useWebMercatorT,I.dayTextureAlpha[Z]=o.alpha,eT=eT||1!==I.dayTextureAlpha[Z],I.dayTextureNightAlpha[Z]=o.nightAlpha,eE=eE||1!==I.dayTextureNightAlpha[Z],I.dayTextureDayAlpha[Z]=o.dayAlpha,eE=eE||1!==I.dayTextureDayAlpha[Z],I.dayTextureBrightness[Z]=o.brightness,ef=ef||I.dayTextureBrightness[Z]!==iW.DEFAULT_BRIGHTNESS,I.dayTextureContrast[Z]=o.contrast,ep=ep||I.dayTextureContrast[Z]!==iW.DEFAULT_CONTRAST,I.dayTextureHue[Z]=o.hue,ey=ey||I.dayTextureHue[Z]!==iW.DEFAULT_HUE,I.dayTextureSaturation[Z]=o.saturation,eb=eb||I.dayTextureSaturation[Z]!==iW.DEFAULT_SATURATION,I.dayTextureOneOverGamma[Z]=1/o.gamma,ev=ev||I.dayTextureOneOverGamma[Z]!==1/iW.DEFAULT_GAMMA,I.dayTextureSplit[Z]=o.splitDirection,ex=ex||0!==I.dayTextureSplit[Z];let a=I.dayTextureCutoutRectangles[Z];if((0,y.Z)(a)||(a=I.dayTextureCutoutRectangles[Z]=new eH.Z),eH.Z.clone(eH.Z.ZERO,a),(0,y.Z)(o.cutoutRectangle)){let e=nH(ee,o.cutoutRectangle),t=U.Z.simpleIntersection(e,ee,nU);ew=(0,y.Z)(t)||ew,a.x=(e.west-ee.west)*et,a.y=(e.south-ee.south)*ei,a.z=(e.east-ee.west)*et,a.w=(e.north-ee.south)*ei}let s=I.colorsToAlpha[Z];(0,y.Z)(s)||(s=I.colorsToAlpha[Z]=new eH.Z);let l=(0,y.Z)(o.colorToAlpha)&&o.colorToAlphaThreshold>0;if(eS=eS||l,l){let e=o.colorToAlpha;s.x=e.red,s.y=e.green,s.z=e.blue,s.w=o.colorToAlphaThreshold}else s.w=-1;if((0,y.Z)(i.credits)){let e=i.credits;for(let t=0,i=e.length;t<i;++t)r.addCreditToNextFrame(e[t])}++Z}I.dayTextures.length=Z,I.waterMask=u,eH.Z.clone(h,I.waterMaskTranslationAndScale),I.minMaxHeight.x=$.minimumHeight,I.minMaxHeight.y=$.maximumHeight,z.Z.clone($.matrix,I.scaleAndBias);let eC=e._clippingPlanes,eA=(0,y.Z)(eC)&&eC.enabled&&t.isClipped;eA&&(I.clippingPlanesEdgeColor=A.Z.clone(eC.edgeColor,I.clippingPlanesEdgeColor),I.clippingPlanesEdgeWidth=eC.edgeWidth);let eI=e._clippingPolygons,eO=(0,y.Z)(eI)&&eI.enabled&&t.isClipped;n7.numberOfDayTextures=Z,n7.applyBrightness=ef,n7.applyContrast=ep,n7.applyHue=ey,n7.applySaturation=eb,n7.applyGamma=ev,n7.applyAlpha=eT,n7.applyDayNightAlpha=eE,n7.applySplit=ex,n7.enableFog=es,n7.enableClippingPlanes=eA,n7.clippingPlanes=eC,n7.enableClippingPolygons=eO,n7.clippingPolygons=eI,n7.hasImageryLayerCutout=ew,n7.colorCorrect=W,n7.highlightFillTile=R,n7.colorToAlpha=eS,n7.showUndergroundColor=x,n7.translucent=p;let eD=n.renderedMesh.indices.length;ed||(eD=n.renderedMesh.indexCountWithoutSkirts),s.shaderProgram=e._surfaceShaderSet.getShaderProgram(n7),s.castShadows=M,s.receiveShadows=k,s.renderState=e_,s.primitiveType=eK.Z.TRIANGLES,s.vertexArray=n.vertexArray||n.fill.vertexArray,s.count=eD,s.uniformMap=l,s.pass=e4.Z.GLOBE,e._debug.wireframe&&(function(e,t,i){let n,r;let o=i.data;if((0,y.Z)(o.vertexArray)?(n=o.mesh,r=o.vertexArray):(0,y.Z)(o.fill)&&(0,y.Z)(o.fill.vertexArray)&&(n=o.fill.mesh,r=o.fill.vertexArray),(0,y.Z)(n)&&(0,y.Z)(r)){if((0,y.Z)(o.wireframeVertexArray)){if(o.wireframeVertexArray.mesh===n)return;o.wireframeVertexArray.destroy(),o.wireframeVertexArray=void 0}o.wireframeVertexArray=function(e,t,i){let n={indices:i.indices,primitiveType:eK.Z.TRIANGLES};eY.Z.toWireframe(n);let r=n.indices,o=e0.Z.createIndexBuffer({context:e,typedArray:r,usage:e1.Z.STATIC_DRAW,indexDatatype:eh.Z.fromSizeInBytes(r.BYTES_PER_ELEMENT)});return new e9.Z({context:e,attributes:t._attributes,indexBuffer:o})}(e,r,n),o.wireframeVertexArray.mesh=n}}(eZ,0,t),(0,y.Z)(n.wireframeVertexArray)&&(s.vertexArray=n.wireframeVertexArray,s.primitiveType=eK.Z.LINES,s.count=2*eD));let eP=s.boundingVolume,eR=s.orientedBoundingBox;i.mode!==eB.Z.SCENE3D?(S.Z.fromRectangleWithHeights2D(t.rectangle,i.mapProjection,K.minimumHeight,K.maximumHeight,eP),_.Z.fromElements(eP.center.z,eP.center.x,eP.center.y,eP.center),i.mode===eB.Z.MORPHING&&(eP=S.Z.union(K.boundingSphere,eP,eP))):(s.boundingVolume=S.Z.clone(K.boundingSphere,eP),s.orientedBoundingBox=B.Z.clone(K.boundingVolume,eR)),s.dirty=!0,p&&f.updateDerivedCommands(s,i),nz(s,i),e_=em,eg=n6}while(ec<eu)})(this,n,e),e.minimumTerrainHeight=Math.min(e.minimumTerrainHeight,r.minimumHeight)}}},nM.prototype.updateForPick=function(e){let t=this._drawCommands;for(let i=0,n=this._usedDrawCommands;i<n;++i)nz(t[i],e)},nM.prototype.cancelReprojections=function(){this._imageryLayers.cancelReprojections()},nM.prototype.getLevelMaximumGeometricError=function(e){return(0,y.Z)(this._terrainProvider)?this._terrainProvider.getLevelMaximumGeometricError(e):0},nM.prototype.loadTile=function(e,t){let i,n=t.data,r=!0;(0,y.Z)(n)&&(r=n.boundingVolumeSourceTile!==t||t._lastSelectionResult===i6.CULLED_BUT_NEEDED,i=n.terrainState),tf.processStateMachine(t,e,this.terrainProvider,this._imageryLayers,this.quadtree,this._vertexArraysToDestroy,r),n=t.data,r&&i!==t.data.terrainState&&this.computeTileVisibility(t,e,this.quadtree.occluders)!==eJ.NONE&&n.boundingVolumeSourceTile===t&&(r=!1,tf.processStateMachine(t,e,this.terrainProvider,this._imageryLayers,this.quadtree,this._vertexArraysToDestroy,r))};let nB=new S.Z,nU=new U.Z,nk=new U.Z,nV=new C.Z;function nH(e,t){if(t.west<t.east)return t;let i=U.Z.clone(t,nk);return U.Z.center(e,nV).longitude>0?i.east=F.Z.PI:i.west=-F.Z.PI,i}function nG(e,t){if(t.cameraUnderground||t.globeTranslucencyState.translucent)return!0;if(e.backFaceCulling)return!1;let i=e._clippingPlanes;if((0,y.Z)(i)&&i.enabled)return!0;let n=e._clippingPolygons;return!!(0,y.Z)(n)&&!!n.enabled||!U.Z.equals(e.cartographicLimitRectangle,U.Z.MAX_VALUE)}nM.prototype.computeTileVisibility=function(e,t,i){let n;let r=this.computeDistanceToTile(e,t);e._distance=r;let o=nG(this,t);if(t.fog.enabled&&!o&&F.Z.fog(r,t.fog.density)>=1)return eJ.NONE;let a=e.data,s=a.tileBoundingRegion;if(void 0===a.boundingVolumeSourceTile)return eJ.PARTIAL;let l=t.cullingVolume,c=s.boundingVolume;(0,y.Z)(c)||(c=s.boundingSphere),a.clippedByBoundaries=!1;let u=nH(e.rectangle,this.cartographicLimitRectangle),h=U.Z.simpleIntersection(u,e.rectangle,nU);if(!(0,y.Z)(h))return eJ.NONE;if(U.Z.equals(h,e.rectangle)||(a.clippedByBoundaries=!0),t.mode!==eB.Z.SCENE3D&&(c=nB,S.Z.fromRectangleWithHeights2D(e.rectangle,t.mapProjection,s.minimumHeight,s.maximumHeight,c),_.Z.fromElements(c.center.z,c.center.x,c.center.y,c.center),t.mode===eB.Z.MORPHING&&(0,y.Z)(a.renderedMesh)&&(c=S.Z.union(s.boundingSphere,c,c))),!(0,y.Z)(c))return eJ.PARTIAL;let d=this._clippingPlanes;if((0,y.Z)(d)&&d.enabled){let t=d.computeIntersectionWithBoundingVolume(c);if(e.isClipped=t!==eX.Z.INSIDE,t===eX.Z.OUTSIDE)return eJ.NONE}let f=this._clippingPolygons;if((0,y.Z)(f)&&f.enabled){let t=f.computeIntersectionWithBoundingVolume(s);e.isClipped=t!==eX.Z.OUTSIDE}let p=l.computeVisibility(c);if(p===eX.Z.OUTSIDE?n=eJ.NONE:p===eX.Z.INTERSECTING?n=eJ.PARTIAL:p===eX.Z.INSIDE&&(n=eJ.FULL),n===eJ.NONE)return n;let m=t.mode===eB.Z.SCENE3D&&t.camera.frustum instanceof e$.Z;if(t.mode===eB.Z.SCENE3D&&!m&&(0,y.Z)(i)&&!o){let e=a.occludeePointInScaledSpace;return!(0,y.Z)(e)||i.ellipsoid.isScaledSpacePointVisiblePossiblyUnderEllipsoid(e,s.minimumHeight)?n:eJ.NONE}return n},nM.prototype.canRefine=function(e){return!!(0,y.Z)(e.data.terrainData)||void 0!==this.terrainProvider.getTileDataAvailable(2*e.x,2*e.y,e.level+1)};let nj=[],nW=[];nM.prototype.canRenderWithoutLosingDetail=function(e,t){let i,n,r;let o=e.data;nj.length=this._imageryLayers.length;let a=!1,s=!1;for((0,y.Z)(o)&&(a=o.terrainState===td.READY,s=!0,i=o.imagery),n=0,r=nj.length;n<r;++n)nj[n]=s;if((0,y.Z)(i))for(n=0,r=i.length;n<r;++n){let e=i[n],t=e.loadingImagery,r=!(0,y.Z)(t)||t.state===tu.FAILED||t.state===tu.INVALID,o=(e.loadingImagery||e.readyImagery).imageryLayer._layerIndex;nj[o]=r&&nj[o]}let l=this.quadtree._lastSelectionFrameNumber;for(nW.length=0,nW.push(e.southwestChild,e.southeastChild,e.northwestChild,e.northeastChild);nW.length>0;){let e=nW.pop(),t=e._lastSelectionResultFrame===l?e._lastSelectionResult:i6.NONE;if(t===i6.RENDERED){let t=e.data;if(!(0,y.Z)(t))continue;if(!a&&e.data.terrainState===td.READY)return!1;let i=e.data.imagery;for(n=0,r=i.length;n<r;++n){let e=i[n],t=e.loadingImagery,r=!(0,y.Z)(t)||t.state===tu.FAILED||t.state===tu.INVALID,o=(e.loadingImagery||e.readyImagery).imageryLayer._layerIndex;if(r&&!nj[o])return!1}}else t===i6.REFINED&&nW.push(e.southwestChild,e.southeastChild,e.northwestChild,e.northeastChild)}return!0};let nq=new _.Z;nM.prototype.computeTileLoadPriority=function(e,t){let i=e.data;if(void 0===i)return 0;let n=i.tileBoundingRegion.boundingVolume;if(void 0===n)return 0;let r=t.camera.positionWC,o=t.camera.directionWC,a=_.Z.subtract(n.center,r,nq),s=_.Z.magnitude(a);return s<F.Z.EPSILON5?0:(_.Z.divideByScalar(a,s,a),(1-_.Z.dot(a,o))*e._distance)};let nY=new z.Z,nX=new z.Z,n$=new eH.Z,nK=new eH.Z,nQ=new eH.Z,nJ=new _.Z,n0=new _.Z,n1=new _.Z,n2=new _.Z;nM.prototype.showTileThisFrame=function(e,t){let i=0,n=e.data.imagery;for(let e=0,t=n.length;e<t;++e){let t=n[e];(0,y.Z)(t.readyImagery)&&0!==t.readyImagery.imageryLayer.alpha&&++i}let r=this._tilesToRenderByTextureCount[i];(0,y.Z)(r)||(r=[],this._tilesToRenderByTextureCount[i]=r),r.push(e);let o=e.data;(0,y.Z)(o.vertexArray)?this._hasLoadedTilesThisFrame=!0:this._hasFillTilesThisFrame=!0;let a=this._debug;++a.tilesRendered,a.texturesRendered+=i};let n3=[new _.Z,new _.Z,new _.Z,new _.Z];function n4(e,t,i,n,r,o){let a=e.quadtree._occluders.ellipsoid,s=a.ellipsoid;return _.Z.fromRadians(i.west,i.south,r,s,n3[0]),_.Z.fromRadians(i.east,i.south,r,s,n3[1]),_.Z.fromRadians(i.west,i.north,r,s,n3[2]),_.Z.fromRadians(i.east,i.north,r,s,n3[3]),a.computeHorizonCullingPointPossiblyUnderEllipsoid(t,n3,n,o)}nM.prototype.computeDistanceToTile=function(e,t){!function(e,t,i){let n=e.data;void 0===n&&(n=e.data=new tf);let r=e.tilingScheme.ellipsoid;void 0===n.tileBoundingRegion&&(n.tileBoundingRegion=new nL.Z({computeBoundingVolumes:!1,rectangle:e.rectangle,ellipsoid:r,minimumHeight:0,maximumHeight:0}));let o=n.tileBoundingRegion,a=o.minimumHeight,s=o.maximumHeight,l=!1,c=e,u=n.mesh,h=n.terrainData;if(void 0!==u&&void 0!==u.minimumHeight&&void 0!==u.maximumHeight)o.minimumHeight=u.minimumHeight,o.maximumHeight=u.maximumHeight,l=!0;else if(void 0!==h&&void 0!==h._minimumHeight&&void 0!==h._maximumHeight)o.minimumHeight=h._minimumHeight,o.maximumHeight=h._maximumHeight;else{o.minimumHeight=Number.NaN,o.maximumHeight=Number.NaN;let t=e.parent;for(;void 0!==t;){let e=t.data;if(void 0!==e){let t=e.mesh,i=e.terrainData;if(void 0!==t&&void 0!==t.minimumHeight&&void 0!==t.maximumHeight){o.minimumHeight=t.minimumHeight,o.maximumHeight=t.maximumHeight;break}if(void 0!==i&&void 0!==i._minimumHeight&&void 0!==i._maximumHeight){o.minimumHeight=i._minimumHeight,o.maximumHeight=i._maximumHeight;break}}t=t.parent}c=t}if(void 0!==c){let h=i.verticalExaggeration,d=i.verticalExaggerationRelativeHeight;if(1!==h&&(l=!1,o.minimumHeight=H.Z.getHeight(o.minimumHeight,h,d),o.maximumHeight=H.Z.getHeight(o.maximumHeight,h,d)),l)n.boundingVolumeIsFromMesh||(o._orientedBoundingBox=B.Z.clone(u.orientedBoundingBox,o._orientedBoundingBox),o._boundingSphere=S.Z.clone(u.boundingSphere3D,o._boundingSphere),n.occludeePointInScaledSpace=_.Z.clone(u.occludeePointInScaledSpace,n.occludeePointInScaledSpace),(0,y.Z)(n.occludeePointInScaledSpace)||(n.occludeePointInScaledSpace=n4(t,o._orientedBoundingBox.center,e.rectangle,o.minimumHeight,o.maximumHeight,n.occludeePointInScaledSpace)));else{let i=void 0===o._orientedBoundingBox||void 0===o._boundingSphere;(o.minimumHeight!==a||o.maximumHeight!==s||i)&&(o.computeBoundingVolumes(r),n.occludeePointInScaledSpace=n4(t,o._orientedBoundingBox.center,e.rectangle,o.minimumHeight,o.maximumHeight,n.occludeePointInScaledSpace))}n.boundingVolumeSourceTile=c,n.boundingVolumeIsFromMesh=l}else n.boundingVolumeSourceTile=void 0,n.boundingVolumeIsFromMesh=!1}(e,this,t);let i=e.data;if(void 0===i.boundingVolumeSourceTile)return 9999999999;let n=i.tileBoundingRegion,r=n.minimumHeight,o=n.maximumHeight;if(i.boundingVolumeSourceTile!==e){let e=t.camera.positionCartographic.height;Math.abs(e-r)>Math.abs(e-o)?(n.minimumHeight=r,n.maximumHeight=r):(n.minimumHeight=o,n.maximumHeight=o)}let a=n.distanceToCamera(t);return n.minimumHeight=r,n.maximumHeight=o,a},nM.prototype.isDestroyed=function(){return!1},nM.prototype.destroy=function(){return this._tileProvider=this._tileProvider&&this._tileProvider.destroy(),this._clippingPlanes=this._clippingPlanes&&this._clippingPlanes.destroy(),this._clippingPolygons=this._clippingPolygons&&this._clippingPolygons.destroy(),this._removeLayerAddedListener=this._removeLayerAddedListener&&this._removeLayerAddedListener(),this._removeLayerRemovedListener=this._removeLayerRemovedListener&&this._removeLayerRemovedListener(),this._removeLayerMovedListener=this._removeLayerMovedListener&&this._removeLayerMovedListener(),this._removeLayerShownListener=this._removeLayerShownListener&&this._removeLayerShownListener(),(0,b.Z)(this)},nM.prototype._onLayerAdded=function(e,t){if(!this.isDestroyed()&&e.show){let t=this._terrainProvider,i=this,n=this._imageryLayersUpdatedEvent;e.ready&&(e.imageryProvider._reload=function(){e._imageryCache={},i._quadtree.forEachLoadedTile(function(i){let n;if((0,y.Z)(i._loadedCallbacks[e._layerIndex]))return;let r=i.data.imagery,o=r.length,a=-1,s=0;for(n=0;n<o;++n){let t=r[n];if((0,Z.Z)(t.readyImagery,t.loadingImagery).imageryLayer===e)-1===a&&(a=n),++s;else if(-1!==a)break}if(-1===a)return;let l=a+s;if(e._createTileImagerySkeletons(i,t,l)){var c;i._loadedCallbacks[e._layerIndex]=(c=s,function(i){let n,r,o;let a=-1,s=i.data.imagery,l=s.length;for(o=0;o<l;++o)if(n=s[o],(r=(0,Z.Z)(n.readyImagery,n.loadingImagery)).imageryLayer===e){a=o;break}if(-1!==a){let l=a+c;if(n=s[l],r=(0,y.Z)(n)?(0,Z.Z)(n.readyImagery,n.loadingImagery):void 0,!(0,y.Z)(r)||r.imageryLayer!==e)return!e._createTileImagerySkeletons(i,t,l);for(o=a;o<l;++o)s[o].freeResources();s.splice(a,c)}return!0}),i.state=th.LOADING}})}),this._quadtree.forEachLoadedTile(function(n){e._createTileImagerySkeletons(n,t)&&(n.state=th.LOADING,0!==n.level&&(n._lastSelectionResultFrame!==i.quadtree._lastSelectionFrameNumber||n._lastSelectionResult!==i6.RENDERED)&&(n.renderable=!1))}),this._layerOrderChanged=!0,n.raiseEvent()}},nM.prototype._onLayerRemoved=function(e,t){this._quadtree.forEachLoadedTile(function(t){let i=t.data.imagery,n=-1,r=0;for(let t=0,o=i.length;t<o;++t){let o=i[t],a=o.loadingImagery;if((0,y.Z)(a)||(a=o.readyImagery),a.imageryLayer===e)-1===n&&(n=t),o.freeResources(),++r;else if(-1!==n)break}-1!==n&&i.splice(n,r)}),(0,y.Z)(e.imageryProvider)&&(e.imageryProvider._reload=void 0),this._imageryLayersUpdatedEvent.raiseEvent()},nM.prototype._onLayerMoved=function(e,t,i){this._layerOrderChanged=!0,this._imageryLayersUpdatedEvent.raiseEvent()},nM.prototype._onLayerShownOrHidden=function(e,t,i){i?this._onLayerAdded(e,t):this._onLayerRemoved(e,t)};let n5=new z.Z,n9=new z.Z;function n8(e,t){let i={u_initialColor:function(){return this.properties.initialColor},u_fillHighlightColor:function(){return this.properties.fillHighlightColor},u_zoomedOutOceanSpecularIntensity:function(){return this.properties.zoomedOutOceanSpecularIntensity},u_oceanNormalMap:function(){return this.properties.oceanNormalMap},u_atmosphereLightIntensity:function(){return this.properties.atmosphereLightIntensity},u_atmosphereRayleighCoefficient:function(){return this.properties.atmosphereRayleighCoefficient},u_atmosphereMieCoefficient:function(){return this.properties.atmosphereMieCoefficient},u_atmosphereRayleighScaleHeight:function(){return this.properties.atmosphereRayleighScaleHeight},u_atmosphereMieScaleHeight:function(){return this.properties.atmosphereMieScaleHeight},u_atmosphereMieAnisotropy:function(){return this.properties.atmosphereMieAnisotropy},u_lightingFadeDistance:function(){return this.properties.lightingFadeDistance},u_nightFadeDistance:function(){return this.properties.nightFadeDistance},u_center3D:function(){return this.properties.center3D},u_verticalExaggerationAndRelativeHeight:function(){return this.properties.verticalExaggerationAndRelativeHeight},u_tileRectangle:function(){return this.properties.tileRectangle},u_modifiedModelView:function(){let t=e.context.uniformState.view,i=z.Z.multiplyByPoint(t,this.properties.rtc,n0);return z.Z.setTranslation(t,i,nY),nY},u_modifiedModelViewProjection:function(){let t=e.context.uniformState.view,i=e.context.uniformState.projection,n=z.Z.multiplyByPoint(t,this.properties.rtc,n0);return z.Z.setTranslation(t,n,nX),z.Z.multiply(i,nX,nX),nX},u_dayTextures:function(){return this.properties.dayTextures},u_dayTextureTranslationAndScale:function(){return this.properties.dayTextureTranslationAndScale},u_dayTextureTexCoordsRectangle:function(){return this.properties.dayTextureTexCoordsRectangle},u_dayTextureUseWebMercatorT:function(){return this.properties.dayTextureUseWebMercatorT},u_dayTextureAlpha:function(){return this.properties.dayTextureAlpha},u_dayTextureNightAlpha:function(){return this.properties.dayTextureNightAlpha},u_dayTextureDayAlpha:function(){return this.properties.dayTextureDayAlpha},u_dayTextureBrightness:function(){return this.properties.dayTextureBrightness},u_dayTextureContrast:function(){return this.properties.dayTextureContrast},u_dayTextureHue:function(){return this.properties.dayTextureHue},u_dayTextureSaturation:function(){return this.properties.dayTextureSaturation},u_dayTextureOneOverGamma:function(){return this.properties.dayTextureOneOverGamma},u_dayIntensity:function(){return this.properties.dayIntensity},u_southAndNorthLatitude:function(){return this.properties.southAndNorthLatitude},u_southMercatorYAndOneOverHeight:function(){return this.properties.southMercatorYAndOneOverHeight},u_waterMask:function(){return this.properties.waterMask},u_waterMaskTranslationAndScale:function(){return this.properties.waterMaskTranslationAndScale},u_minMaxHeight:function(){return this.properties.minMaxHeight},u_scaleAndBias:function(){return this.properties.scaleAndBias},u_dayTextureSplit:function(){return this.properties.dayTextureSplit},u_dayTextureCutoutRectangles:function(){return this.properties.dayTextureCutoutRectangles},u_clippingPlanes:function(){let i=t._clippingPlanes;return(0,y.Z)(i)&&(0,y.Z)(i.texture)?i.texture:e.context.defaultTexture},u_cartographicLimitRectangle:function(){return this.properties.localizedCartographicLimitRectangle},u_clippingPlanesMatrix:function(){let i=t._clippingPlanes,n=(0,y.Z)(i)?z.Z.multiply(e.context.uniformState.view,i.modelMatrix,n5):z.Z.IDENTITY;return z.Z.inverseTranspose(n,n9)},u_clippingPlanesEdgeStyle:function(){let e=this.properties.clippingPlanesEdgeColor;return e.alpha=this.properties.clippingPlanesEdgeWidth,e},u_clippingDistance:function(){let i=t._clippingPolygons.clippingTexture;return(0,y.Z)(i)?i:e.context.defaultTexture},u_clippingExtents:function(){let i=t._clippingPolygons.extentsTexture;return(0,y.Z)(i)?i:e.context.defaultTexture},u_minimumBrightness:function(){return e.fog.minimumBrightness},u_hsbShift:function(){return this.properties.hsbShift},u_colorsToAlpha:function(){return this.properties.colorsToAlpha},u_frontFaceAlphaByDistance:function(){return this.properties.frontFaceAlphaByDistance},u_backFaceAlphaByDistance:function(){return this.properties.backFaceAlphaByDistance},u_translucencyRectangle:function(){return this.properties.localizedTranslucencyRectangle},u_undergroundColor:function(){return this.properties.undergroundColor},u_undergroundColorAlphaByDistance:function(){return this.properties.undergroundColorAlphaByDistance},u_lambertDiffuseMultiplier:function(){return this.properties.lambertDiffuseMultiplier},u_vertexShadowDarkness:function(){return this.properties.vertexShadowDarkness},properties:{initialColor:new eH.Z(0,0,.5,1),fillHighlightColor:new A.Z(0,0,0,0),zoomedOutOceanSpecularIntensity:.5,oceanNormalMap:void 0,lightingFadeDistance:new L.Z(65e5,9e6),nightFadeDistance:new L.Z(1e7,4e7),atmosphereLightIntensity:10,atmosphereRayleighCoefficient:new _.Z(55e-7,13e-6,284e-7),atmosphereMieCoefficient:new _.Z(21e-6,21e-6,21e-6),atmosphereRayleighScaleHeight:1e4,atmosphereMieScaleHeight:3200,atmosphereMieAnisotropy:.9,hsbShift:new _.Z,center3D:void 0,rtc:new _.Z,modifiedModelView:new z.Z,tileRectangle:new eH.Z,verticalExaggerationAndRelativeHeight:new L.Z(1,0),dayTextures:[],dayTextureTranslationAndScale:[],dayTextureTexCoordsRectangle:[],dayTextureUseWebMercatorT:[],dayTextureAlpha:[],dayTextureNightAlpha:[],dayTextureDayAlpha:[],dayTextureBrightness:[],dayTextureContrast:[],dayTextureHue:[],dayTextureSaturation:[],dayTextureOneOverGamma:[],dayTextureSplit:[],dayTextureCutoutRectangles:[],dayIntensity:0,colorsToAlpha:[],southAndNorthLatitude:new L.Z,southMercatorYAndOneOverHeight:new L.Z,waterMask:void 0,waterMaskTranslationAndScale:new eH.Z,minMaxHeight:new L.Z,scaleAndBias:new z.Z,clippingPlanesEdgeColor:A.Z.clone(A.Z.WHITE),clippingPlanesEdgeWidth:0,localizedCartographicLimitRectangle:new eH.Z,frontFaceAlphaByDistance:new eH.Z,backFaceAlphaByDistance:new eH.Z,localizedTranslucencyRectangle:new eH.Z,undergroundColor:A.Z.clone(A.Z.TRANSPARENT),undergroundColorAlphaByDistance:new eH.Z,lambertDiffuseMultiplier:0,vertexShadowDarkness:0}};return(0,y.Z)(t.materialUniformMap)?(0,eW.Z)(i,t.materialUniformMap):i}!function(){let e,t;let i=new eq.Z({geometry:eV.Z.fromDimensions({dimensions:new _.Z(2,2,2)})}),n=new eq.Z({geometry:new eQ.Z({radius:1})}),r=new z.Z;function l(e){return new i3.Z({geometryInstances:e,appearance:new i2.Z({translucent:!1,flat:!0}),asynchronous:!1})}o=function(n,o){return n===e?t:(s(),e=n,r=z.Z.fromRotationTranslation(n.halfAxes,n.center,r),i.modelMatrix=r,i.attributes.color=ej.Z.fromColor(o),t=l(i))},a=function(i,o){return i===e?t:(s(),e=i,r=z.Z.fromTranslation(i.center,r),r=z.Z.multiplyByUniformScale(r,i.radius,r),n.modelMatrix=r,n.attributes.color=ej.Z.fromColor(o),t=l(n))},s=function(){(0,y.Z)(t)&&(t.destroy(),t=void 0,e=void 0)}}();let n6=new eH.Z(0,0,0,0),n7={frameState:void 0,surfaceTile:void 0,numberOfDayTextures:void 0,applyBrightness:void 0,applyContrast:void 0,applyHue:void 0,applySaturation:void 0,applyGamma:void 0,applyAlpha:void 0,applyDayNightAlpha:void 0,applySplit:void 0,showReflectiveOcean:void 0,showOceanWaves:void 0,enableLighting:void 0,dynamicAtmosphereLighting:void 0,dynamicAtmosphereLightingFromSun:void 0,showGroundAtmosphere:void 0,perFragmentGroundAtmosphere:void 0,hasVertexNormals:void 0,useWebMercatorProjection:void 0,enableFog:void 0,enableClippingPlanes:void 0,clippingPlanes:void 0,enableClippingPolygons:void 0,clippingPolygons:void 0,clippedByBoundaries:void 0,hasImageryLayerCutout:void 0,colorCorrect:void 0,colorToAlpha:void 0,hasGeodeticSurfaceNormals:void 0,hasExaggeration:void 0},re=A.Z.TRANSPARENT,rt=new eA.Z;function ri(){this._enabled=!1,this._frontFaceAlpha=1,this._frontFaceAlphaByDistance=void 0,this._backFaceAlpha=1,this._backFaceAlphaByDistance=void 0,this._rectangle=U.Z.clone(U.Z.MAX_VALUE)}function rn(){this._layers=[],this.layerAdded=new I.Z,this.layerRemoved=new I.Z,this.layerMoved=new I.Z,this.layerShownOrHidden=new I.Z}function rr(e,t){if(!(0,y.Z)(t))throw new v.Z("layer is required.");let i=e.indexOf(t);if(-1===i)throw new v.Z("layer is not in this collection.");return i}function ro(e,t,i){let n=e._layers;if((t=F.Z.clamp(t,0,n.length-1))===(i=F.Z.clamp(i,0,n.length-1)))return;let r=n[t];n[t]=n[i],n[i]=r,e._update(),e.layerMoved.raiseEvent(r,i,t)}Object.defineProperties(ri.prototype,{enabled:{get:function(){return this._enabled},set:function(e){D.Z.typeOf.bool("enabled",e),this._enabled=e}},frontFaceAlpha:{get:function(){return this._frontFaceAlpha},set:function(e){D.Z.typeOf.number.greaterThanOrEquals("frontFaceAlpha",e,0),D.Z.typeOf.number.lessThanOrEquals("frontFaceAlpha",e,1),this._frontFaceAlpha=e}},frontFaceAlphaByDistance:{get:function(){return this._frontFaceAlphaByDistance},set:function(e){if((0,y.Z)(e)&&e.far<e.near)throw new v.Z("far distance must be greater than near distance.");this._frontFaceAlphaByDistance=eA.Z.clone(e,this._frontFaceAlphaByDistance)}},backFaceAlpha:{get:function(){return this._backFaceAlpha},set:function(e){D.Z.typeOf.number.greaterThanOrEquals("backFaceAlpha",e,0),D.Z.typeOf.number.lessThanOrEquals("backFaceAlpha",e,1),this._backFaceAlpha=e}},backFaceAlphaByDistance:{get:function(){return this._backFaceAlphaByDistance},set:function(e){if((0,y.Z)(e)&&e.far<e.near)throw new v.Z("far distance must be greater than near distance.");this._backFaceAlphaByDistance=eA.Z.clone(e,this._backFaceAlphaByDistance)}},rectangle:{get:function(){return this._rectangle},set:function(e){(0,y.Z)(e)||(e=U.Z.clone(U.Z.MAX_VALUE)),U.Z.clone(e,this._rectangle)}}}),Object.defineProperties(rn.prototype,{length:{get:function(){return this._layers.length}}}),rn.prototype.add=function(e,t){let i=(0,y.Z)(t);if(!(0,y.Z)(e))throw new v.Z("layer is required.");if(i){if(t<0)throw new v.Z("index must be greater than or equal to zero.");if(t>this._layers.length)throw new v.Z("index must be less than or equal to the number of layers.")}i?this._layers.splice(t,0,e):(t=this._layers.length,this._layers.push(e)),this._update(),this.layerAdded.raiseEvent(e,t);let n=e.readyEvent.addEventListener(()=>{this.layerShownOrHidden.raiseEvent(e,e._layerIndex,e.show),n()})},rn.prototype.addImageryProvider=function(e,t){if(!(0,y.Z)(e))throw new v.Z("imageryProvider is required.");let i=new iW(e);return this.add(i,t),i},rn.prototype.remove=function(e,t){t=(0,Z.Z)(t,!0);let i=this._layers.indexOf(e);return -1!==i&&(this._layers.splice(i,1),this._update(),this.layerRemoved.raiseEvent(e,i),t&&e.destroy(),!0)},rn.prototype.removeAll=function(e){e=(0,Z.Z)(e,!0);let t=this._layers;for(let i=0,n=t.length;i<n;i++){let n=t[i];this.layerRemoved.raiseEvent(n,i),e&&n.destroy()}this._layers=[]},rn.prototype.contains=function(e){return -1!==this.indexOf(e)},rn.prototype.indexOf=function(e){return this._layers.indexOf(e)},rn.prototype.get=function(e){if(!(0,y.Z)(e))throw new v.Z("index is required.","index");return this._layers[e]},rn.prototype.raise=function(e){let t=rr(this._layers,e);ro(this,t,t+1)},rn.prototype.lower=function(e){let t=rr(this._layers,e);ro(this,t,t-1)},rn.prototype.raiseToTop=function(e){let t=rr(this._layers,e);t!==this._layers.length-1&&(this._layers.splice(t,1),this._layers.push(e),this._update(),this.layerMoved.raiseEvent(e,this._layers.length-1,t))},rn.prototype.lowerToBottom=function(e){let t=rr(this._layers,e);0!==t&&(this._layers.splice(t,1),this._layers.splice(0,0,e),this._update(),this.layerMoved.raiseEvent(e,0,t))};let ra=new U.Z;function rs(e,t,i,n){let r;let o=e.globe._surface._tilesToRender;for(let e=0;!(0,y.Z)(r)&&e<o.length;++e){let i=o[e];U.Z.contains(i.rectangle,t)&&(r=i)}if(!(0,y.Z)(r))return;let a=r.data.imagery;for(let e=a.length-1;e>=0;--e){let o=a[e],s=o.readyImagery;if(!(0,y.Z)(s)||!s.imageryLayer.ready)continue;let l=s.imageryLayer.imageryProvider;if(i&&!(0,y.Z)(l.pickFeatures)||!U.Z.contains(s.rectangle,t))continue;let c=1/1024;ra.west=F.Z.lerp(r.rectangle.west,r.rectangle.east,o.textureCoordinateRectangle.x-c),ra.east=F.Z.lerp(r.rectangle.west,r.rectangle.east,o.textureCoordinateRectangle.z+c),ra.south=F.Z.lerp(r.rectangle.south,r.rectangle.north,o.textureCoordinateRectangle.y-c),ra.north=F.Z.lerp(r.rectangle.south,r.rectangle.north,o.textureCoordinateRectangle.w+c),U.Z.contains(ra,t)&&n(s)}}rn.prototype.pickImageryLayers=function(e,t){let i=t.globe.pick(e,t);if(!(0,y.Z)(i))return;let n=t.globe.ellipsoid.cartesianToCartographic(i),r=[];if(rs(t,n,!1,function(e){r.push(e.imageryLayer)}),0!==r.length)return r},rn.prototype.pickImageryLayerFeatures=function(e,t){let i=t.globe.pick(e,t);if(!(0,y.Z)(i))return;let n=t.globe.ellipsoid.cartesianToCartographic(i),r=[],o=[];if(rs(t,n,!0,function(e){if(!e.imageryLayer.ready)return;let t=e.imageryLayer.imageryProvider.pickFeatures(e.x,e.y,e.level,n.longitude,n.latitude);(0,y.Z)(t)&&(r.push(t),o.push(e.imageryLayer))}),0!==r.length)return Promise.all(r).then(function(e){let t=[];for(let i=0;i<e.length;++i){let r=e[i],a=o[i];if((0,y.Z)(r)&&r.length>0)for(let e=0;e<r.length;++e){let i=r[e];i.imageryLayer=a,(0,y.Z)(i.position)||(i.position=n),t.push(i)}}return t})},rn.prototype.queueReprojectionCommands=function(e){let t=this._layers;for(let i=0,n=t.length;i<n;++i)t[i].queueReprojectionCommands(e)},rn.prototype.cancelReprojections=function(){let e=this._layers;for(let t=0,i=e.length;t<i;++t)e[t].cancelReprojections()},rn.prototype.isDestroyed=function(){return!1},rn.prototype.destroy=function(){return this.removeAll(!0),(0,b.Z)(this)},rn.prototype._update=function(){let e,t,i,n,r=!0,o=this._layers;for(i=0,n=o.length;i<n;++i)(t=o[i])._layerIndex=i,t.show?(t._isBaseLayer=r,r=!1):t._isBaseLayer=!1,t.show!==t._show&&((0,y.Z)(t._show)&&((0,y.Z)(e)||(e=[]),e.push(t)),t._show=t.show);if((0,y.Z)(e))for(i=0,n=e.length;i<n;++i)t=e[i],this.layerShownOrHidden.raiseEvent(t,t._layerIndex,t.show)};var rl=i(2594),rc=i(7604);function ru(e){this._ellipsoid=new M.Z(e.ellipsoid,_.Z.ZERO)}function rh(e){if(!(0,y.Z)(e))throw new v.Z("options is required.");if((0,y.Z)(e.x)){if((0,y.Z)(e.y)){if(e.x<0||e.y<0)throw new v.Z("options.x and options.y must be greater than or equal to zero.")}else throw new v.Z("options.y is required.")}else throw new v.Z("options.x is required.");if(!(0,y.Z)(e.level))throw new v.Z("options.level is required and must be greater than or equal to zero.");if(!(0,y.Z)(e.tilingScheme))throw new v.Z("options.tilingScheme is required.");this._tilingScheme=e.tilingScheme,this._x=e.x,this._y=e.y,this._level=e.level,this._parent=e.parent,this._rectangle=this._tilingScheme.tileXYToRectangle(this._x,this._y,this._level),this._southwestChild=void 0,this._southeastChild=void 0,this._northwestChild=void 0,this._northeastChild=void 0,this.replacementPrevious=void 0,this.replacementNext=void 0,this._distance=0,this._loadPriority=0,this._customData=[],this._frameUpdated=void 0,this._lastSelectionResult=i6.NONE,this._lastSelectionResultFrame=void 0,this._loadedCallbacks={},this.state=th.START,this.renderable=!1,this.upsampledFromParent=!1,this.data=void 0}function rd(e){(0,y.Z)(e)&&e.freeResources()}function rf(){this.head=void 0,this.tail=void 0,this.count=0,this._lastBeforeStartOfFrame=void 0}function rp(e,t){let i=t.replacementPrevious,n=t.replacementNext;t===e._lastBeforeStartOfFrame&&(e._lastBeforeStartOfFrame=n),t===e.head?e.head=n:i.replacementNext=n,t===e.tail?e.tail=i:n.replacementPrevious=i,t.replacementPrevious=void 0,t.replacementNext=void 0,--e.count}function rm(e){if(!(0,y.Z)(e)||!(0,y.Z)(e.tileProvider))throw new v.Z("options.tileProvider is required.");if((0,y.Z)(e.tileProvider.quadtree))throw new v.Z("A QuadtreeTileProvider can only be used with a single QuadtreePrimitive");this._tileProvider=e.tileProvider,this._tileProvider.quadtree=this,this._debug={enableDebugOutput:!1,maxDepth:0,maxDepthVisited:0,tilesVisited:0,tilesCulled:0,tilesRendered:0,tilesWaitingForChildren:0,lastMaxDepth:-1,lastMaxDepthVisited:-1,lastTilesVisited:-1,lastTilesCulled:-1,lastTilesRendered:-1,lastTilesWaitingForChildren:-1,suspendLodUpdate:!1};let t=this._tileProvider.tilingScheme.ellipsoid;this._tilesToRender=[],this._tileLoadQueueHigh=[],this._tileLoadQueueMedium=[],this._tileLoadQueueLow=[],this._tileReplacementQueue=new rf,this._levelZeroTiles=void 0,this._loadQueueTimeSlice=5,this._tilesInvalidated=!1,this._addHeightCallbacks=[],this._removeHeightCallbacks=[],this._tileToUpdateHeights=[],this._lastTileIndex=0,this._updateHeightsTimeSlice=2,this._cameraPositionCartographic=void 0,this._cameraReferenceFrameOriginCartographic=void 0,this.maximumScreenSpaceError=(0,Z.Z)(e.maximumScreenSpaceError,2),this.tileCacheSize=(0,Z.Z)(e.tileCacheSize,100),this.loadingDescendantLimit=20,this.preloadAncestors=!0,this.preloadSiblings=!1,this._occluders=new ru({ellipsoid:t}),this._tileLoadProgressEvent=new I.Z,this._lastTileLoadQueueLength=0,this._lastSelectionFrameNumber=void 0}function r_(e){let t=e._debug;t.maxDepth=0,t.maxDepthVisited=0,t.tilesVisited=0,t.tilesCulled=0,t.tilesRendered=0,t.tilesWaitingForChildren=0,e._tileLoadQueueHigh.length=0,e._tileLoadQueueMedium.length=0,e._tileLoadQueueLow.length=0}Object.defineProperties(ru.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),rh.createLevelZeroTiles=function(e){if(!(0,y.Z)(e))throw new v.Z("tilingScheme is required.");let t=e.getNumberOfXTilesAtLevel(0),i=e.getNumberOfYTilesAtLevel(0),n=Array(t*i),r=0;for(let o=0;o<i;++o)for(let i=0;i<t;++i)n[r++]=new rh({tilingScheme:e,x:i,y:o,level:0});return n},rh.prototype._updateCustomData=function(e,t,i){let n,r,o,a=this.customData;if((0,y.Z)(t)&&(0,y.Z)(i)){for(n=0,a=a.filter(function(e){return -1===i.indexOf(e)}),this._customData=a,o=this._rectangle;n<t.length;++n)r=t[n],U.Z.contains(o,r.positionCartographic)&&a.push(r);this._frameUpdated=e}else{let e=this._parent;if((0,y.Z)(e)&&this._frameUpdated!==e._frameUpdated){a.length=0,o=this._rectangle;let t=e.customData;for(n=0;n<t.length;++n)r=t[n],U.Z.contains(o,r.positionCartographic)&&a.push(r);this._frameUpdated=e._frameUpdated}}},Object.defineProperties(rh.prototype,{tilingScheme:{get:function(){return this._tilingScheme}},x:{get:function(){return this._x}},y:{get:function(){return this._y}},level:{get:function(){return this._level}},parent:{get:function(){return this._parent}},rectangle:{get:function(){return this._rectangle}},children:{get:function(){return[this.northwestChild,this.northeastChild,this.southwestChild,this.southeastChild]}},southwestChild:{get:function(){return(0,y.Z)(this._southwestChild)||(this._southwestChild=new rh({tilingScheme:this.tilingScheme,x:2*this.x,y:2*this.y+1,level:this.level+1,parent:this})),this._southwestChild}},southeastChild:{get:function(){return(0,y.Z)(this._southeastChild)||(this._southeastChild=new rh({tilingScheme:this.tilingScheme,x:2*this.x+1,y:2*this.y+1,level:this.level+1,parent:this})),this._southeastChild}},northwestChild:{get:function(){return(0,y.Z)(this._northwestChild)||(this._northwestChild=new rh({tilingScheme:this.tilingScheme,x:2*this.x,y:2*this.y,level:this.level+1,parent:this})),this._northwestChild}},northeastChild:{get:function(){return(0,y.Z)(this._northeastChild)||(this._northeastChild=new rh({tilingScheme:this.tilingScheme,x:2*this.x+1,y:2*this.y,level:this.level+1,parent:this})),this._northeastChild}},customData:{get:function(){return this._customData}},needsLoading:{get:function(){return this.state<th.DONE}},eligibleForUnloading:{get:function(){let e=!0;return(0,y.Z)(this.data)&&(e=this.data.eligibleForUnloading,(0,y.Z)(e)||(e=!0)),e}}}),rh.prototype.findLevelZeroTile=function(e,t,i){let n=this.tilingScheme.getNumberOfXTilesAtLevel(0);if(t<0?t+=n:t>=n&&(t-=n),!(i<0||i>=this.tilingScheme.getNumberOfYTilesAtLevel(0)))return e.filter(function(e){return e.x===t&&e.y===i})[0]},rh.prototype.findTileToWest=function(e){let t=this.parent;if(void 0===t)return this.findLevelZeroTile(e,this.x-1,this.y);if(t.southeastChild===this)return t.southwestChild;if(t.northeastChild===this)return t.northwestChild;let i=t.findTileToWest(e);return void 0===i?void 0:t.southwestChild===this?i.southeastChild:i.northeastChild},rh.prototype.findTileToEast=function(e){let t=this.parent;if(void 0===t)return this.findLevelZeroTile(e,this.x+1,this.y);if(t.southwestChild===this)return t.southeastChild;if(t.northwestChild===this)return t.northeastChild;let i=t.findTileToEast(e);return void 0===i?void 0:t.southeastChild===this?i.southwestChild:i.northwestChild},rh.prototype.findTileToSouth=function(e){let t=this.parent;if(void 0===t)return this.findLevelZeroTile(e,this.x,this.y+1);if(t.northwestChild===this)return t.southwestChild;if(t.northeastChild===this)return t.southeastChild;let i=t.findTileToSouth(e);return void 0===i?void 0:t.southwestChild===this?i.northwestChild:i.northeastChild},rh.prototype.findTileToNorth=function(e){let t=this.parent;if(void 0===t)return this.findLevelZeroTile(e,this.x,this.y-1);if(t.southwestChild===this)return t.northwestChild;if(t.southeastChild===this)return t.northeastChild;let i=t.findTileToNorth(e);return void 0===i?void 0:t.northwestChild===this?i.southwestChild:i.southeastChild},rh.prototype.freeResources=function(){this.state=th.START,this.renderable=!1,this.upsampledFromParent=!1,(0,y.Z)(this.data)&&(0,y.Z)(this.data.freeResources)&&this.data.freeResources(),rd(this._southwestChild),this._southwestChild=void 0,rd(this._southeastChild),this._southeastChild=void 0,rd(this._northwestChild),this._northwestChild=void 0,rd(this._northeastChild),this._northeastChild=void 0},rf.prototype.markStartOfRenderFrame=function(){this._lastBeforeStartOfFrame=this.head},rf.prototype.trimTiles=function(e){let t=this.tail,i=!0;for(;i&&(0,y.Z)(this._lastBeforeStartOfFrame)&&this.count>e&&(0,y.Z)(t);){i=t!==this._lastBeforeStartOfFrame;let e=t.replacementPrevious;t.eligibleForUnloading&&(t.freeResources(),rp(this,t)),t=e}},rf.prototype.markTileRendered=function(e){let t=this.head;if(t===e){e===this._lastBeforeStartOfFrame&&(this._lastBeforeStartOfFrame=e.replacementNext);return}if(++this.count,!(0,y.Z)(t)){e.replacementPrevious=void 0,e.replacementNext=void 0,this.head=e,this.tail=e;return}((0,y.Z)(e.replacementPrevious)||(0,y.Z)(e.replacementNext))&&rp(this,e),e.replacementPrevious=void 0,e.replacementNext=t,t.replacementPrevious=e,this.head=e},Object.defineProperties(rm.prototype,{tileProvider:{get:function(){return this._tileProvider}},tileLoadProgressEvent:{get:function(){return this._tileLoadProgressEvent}},occluders:{get:function(){return this._occluders}}}),rm.prototype.invalidateAllTiles=function(){this._tilesInvalidated=!0},rm.prototype.forEachLoadedTile=function(e){let t=this._tileReplacementQueue.head;for(;(0,y.Z)(t);)t.state!==th.START&&e(t),t=t.replacementNext},rm.prototype.forEachRenderedTile=function(e){let t=this._tilesToRender;for(let i=0,n=t.length;i<n;++i)e(t[i])},rm.prototype.updateHeight=function(e,t){let i=this,n={positionOnEllipsoidSurface:void 0,positionCartographic:e,level:-1,callback:t};return n.removeFunc=function(){let e=i._addHeightCallbacks,t=e.length;for(let i=0;i<t;++i)if(e[i]===n){e.splice(i,1);break}i._removeHeightCallbacks.push(n),n.callback&&(n.callback=void 0)},i._addHeightCallbacks.push(n),n.removeFunc},rm.prototype.update=function(e){(0,y.Z)(this._tileProvider.update)&&this._tileProvider.update(e)},rm.prototype.beginFrame=function(e){e.passes.render&&(this._tilesInvalidated&&(function(e){let t=e._tileReplacementQueue;t.head=void 0,t.tail=void 0,t.count=0,r_(e);let i=e._levelZeroTiles;if((0,y.Z)(i))for(let t=0;t<i.length;++t){let n=i[t].customData,r=n.length;for(let t=0;t<r;++t){let i=n[t];i.level=0,e._addHeightCallbacks.push(i)}i[t].freeResources()}e._levelZeroTiles=void 0,e._tileProvider.cancelReprojections()}(this),this._tilesInvalidated=!1),this._tileProvider.initialize(e),r_(this),this._debug.suspendLodUpdate||this._tileReplacementQueue.markStartOfRenderFrame())},rm.prototype.render=function(e){let t=e.passes,i=this._tileProvider;t.render&&(i.beginUpdate(e),function(e,t){let i,n,r;let o=e._debug;if(o.suspendLodUpdate)return;e._tilesToRender.length=0;let a=e._tileProvider;if(!(0,y.Z)(e._levelZeroTiles)){let t=a.tilingScheme;if(!(0,y.Z)(t))return;{let t=a.tilingScheme;e._levelZeroTiles=rh.createLevelZeroTiles(t);let n=e._levelZeroTiles.length;if(rb.length<n)for(i=0,rb=Array(n);i<n;++i)void 0===rb[i]&&(rb[i]=new rT)}}e._occluders.ellipsoid.cameraPosition=t.camera.positionWC;let s=e._levelZeroTiles,c=s.length>1?e._occluders:void 0;l=t.camera.positionCartographic,s.sort(rZ);let u=e._addHeightCallbacks,h=e._removeHeightCallbacks,d=t.frameNumber;if(u.length>0||h.length>0){for(i=0,r=s.length;i<r;++i)(n=s[i])._updateCustomData(d,u,h);u.length=0,h.length=0}let f=t.camera;e._cameraPositionCartographic=f.positionCartographic;let p=z.Z.getTranslation(f.transform,ry);for(i=0,e._cameraReferenceFrameOriginCartographic=e.tileProvider.tilingScheme.ellipsoid.cartesianToCartographic(p,e._cameraReferenceFrameOriginCartographic),r=s.length;i<r;++i)n=s[i],e._tileReplacementQueue.markTileRendered(n),n.renderable?function e(t,i,n,r,o,a,s){if(n.computeTileVisibility(i,r,o)!==eJ.NONE)return function(t,i,n,r,o){let a=t._debug;++a.tilesVisited,t._tileReplacementQueue.markTileRendered(n),n._updateCustomData(i.frameNumber),n.level>a.maxDepthVisited&&(a.maxDepthVisited=n.level);let s=function(e,t,i){if(t.mode===eB.Z.SCENE2D||t.camera.frustum instanceof e$.Z||t.camera.frustum instanceof rc.Z)return function(e,t,i){let n=t.camera.frustum,r=n.offCenterFrustum;(0,y.Z)(r)&&(n=r);let o=t.context,a=o.drawingBufferWidth,s=o.drawingBufferHeight,l=e._tileProvider.getLevelMaximumGeometricError(i.level)/(Math.max(n.top-n.bottom,n.right-n.left)/Math.max(a,s));return t.fog.enabled&&t.mode!==eB.Z.SCENE2D&&(l-=F.Z.fog(i._distance,t.fog.density)*t.fog.sse),l/=t.pixelRatio}(e,t,i);let n=e._tileProvider.getLevelMaximumGeometricError(i.level),r=i._distance,o=n*t.context.drawingBufferHeight/(r*t.camera.frustum.sseDenominator);return t.fog.enabled&&(o-=F.Z.fog(r,t.fog.density)*t.fog.sse),o/=t.pixelRatio}(t,i,n)<t.maximumScreenSpaceError,l=n.southwestChild,c=n.southeastChild,u=n.northwestChild,h=n.northeastChild,d=t._lastSelectionFrameNumber,f=n._lastSelectionResultFrame===d?n._lastSelectionResult:i6.NONE,p=t.tileProvider;if(s||r){let e=i6.originalResult(f)===i6.RENDERED,a=i6.originalResult(f)===i6.CULLED||f===i6.NONE,l=n.state===th.DONE,c=e||a||l;if(!c&&(0,y.Z)(p.canRenderWithoutLosingDetail)&&(c=p.canRenderWithoutLosingDetail(n)),c){s&&rv(t,t._tileLoadQueueMedium,n,i),rw(t,n),o.allAreRenderable=n.renderable,o.anyWereRenderedLastFrame=f===i6.RENDERED,o.notYetRenderableCount=n.renderable?0:1,n._lastSelectionResultFrame=i.frameNumber,n._lastSelectionResult=i6.RENDERED,o.anyWereRenderedLastFrame||t._tileToUpdateHeights.push(n);return}r=!0,s&&rv(t,t._tileLoadQueueHigh,n,i)}if(p.canRefine(n)){if(l.upsampledFromParent&&c.upsampledFromParent&&u.upsampledFromParent&&h.upsampledFromParent){rw(t,n),rv(t,t._tileLoadQueueMedium,n,i),t._tileReplacementQueue.markTileRendered(l),t._tileReplacementQueue.markTileRendered(c),t._tileReplacementQueue.markTileRendered(u),t._tileReplacementQueue.markTileRendered(h),o.allAreRenderable=n.renderable,o.anyWereRenderedLastFrame=f===i6.RENDERED,o.notYetRenderableCount=n.renderable?0:1,n._lastSelectionResultFrame=i.frameNumber,n._lastSelectionResult=i6.RENDERED,o.anyWereRenderedLastFrame||t._tileToUpdateHeights.push(n);return}n._lastSelectionResultFrame=i.frameNumber,n._lastSelectionResult=i6.REFINED;let s=t._tilesToRender.length,d=t._tileLoadQueueLow.length,p=t._tileLoadQueueMedium.length,m=t._tileLoadQueueHigh.length,_=t._tileToUpdateHeights.length;if(function(t,i,n,r,o,a,s,l){let c=a.camera.positionCartographic,u=t._tileProvider,h=t._occluders,d=rx[i.level],f=d.southwest,p=d.southeast,m=d.northwest,_=d.northeast;c.longitude<i.rectangle.east?c.latitude<i.rectangle.north?(e(t,i,u,a,h,s,f),e(t,n,u,a,h,s,p),e(t,r,u,a,h,s,m),e(t,o,u,a,h,s,_)):(e(t,r,u,a,h,s,m),e(t,i,u,a,h,s,f),e(t,o,u,a,h,s,_),e(t,n,u,a,h,s,p)):c.latitude<i.rectangle.north?(e(t,n,u,a,h,s,p),e(t,i,u,a,h,s,f),e(t,o,u,a,h,s,_),e(t,r,u,a,h,s,m)):(e(t,o,u,a,h,s,_),e(t,r,u,a,h,s,m),e(t,n,u,a,h,s,p),e(t,i,u,a,h,s,f)),d.combine(l)}(t,l,c,u,h,i,r,o),s!==t._tilesToRender.length){let e=o.allAreRenderable,r=o.anyWereRenderedLastFrame,l=o.notYetRenderableCount,c=!1;if(!e&&!r){let e=t._tilesToRender;for(let t=s;t<e.length;++t){let i=e[t];for(;void 0!==i&&i._lastSelectionResult!==i6.KICKED&&i!==n;)i._lastSelectionResult=i6.kick(i._lastSelectionResult),i=i.parent}t._tilesToRender.length=s,t._tileToUpdateHeights.length=_,rw(t,n),n._lastSelectionResult=i6.RENDERED;let r=f===i6.RENDERED;!r&&l>t.loadingDescendantLimit&&(t._tileLoadQueueLow.length=d,t._tileLoadQueueMedium.length=p,t._tileLoadQueueHigh.length=m,rv(t,t._tileLoadQueueMedium,n,i),o.notYetRenderableCount=n.renderable?0:1,c=!0),o.allAreRenderable=n.renderable,o.anyWereRenderedLastFrame=r,r||t._tileToUpdateHeights.push(n),++a.tilesWaitingForChildren}t.preloadAncestors&&!c&&rv(t,t._tileLoadQueueLow,n,i)}return}n._lastSelectionResultFrame=i.frameNumber,n._lastSelectionResult=i6.RENDERED,rw(t,n),rv(t,t._tileLoadQueueHigh,n,i),o.allAreRenderable=n.renderable,o.anyWereRenderedLastFrame=f===i6.RENDERED,o.notYetRenderableCount=n.renderable?0:1}(t,r,i,a,s);if(++t._debug.tilesCulled,t._tileReplacementQueue.markTileRendered(i),s.allAreRenderable=!0,s.anyWereRenderedLastFrame=!1,s.notYetRenderableCount=0,function(e,t){let i=t.rectangle;return(0,y.Z)(e._cameraPositionCartographic)&&U.Z.contains(i,e._cameraPositionCartographic)||(0,y.Z)(e._cameraReferenceFrameOriginCartographic)&&U.Z.contains(i,e._cameraReferenceFrameOriginCartographic)}(t,i)){(0,y.Z)(i.data)&&(0,y.Z)(i.data.vertexArray)||rv(t,t._tileLoadQueueMedium,i,r);let e=t._lastSelectionFrameNumber,n=i._lastSelectionResultFrame===e?i._lastSelectionResult:i6.NONE;n!==i6.CULLED_BUT_NEEDED&&n!==i6.RENDERED&&t._tileToUpdateHeights.push(i),i._lastSelectionResult=i6.CULLED_BUT_NEEDED}else(t.preloadSiblings||0===i.level)&&rv(t,t._tileLoadQueueLow,i,r),i._lastSelectionResult=i6.CULLED;i._lastSelectionResultFrame=r.frameNumber}(e,n,a,t,c,!1,rb[i]):(rv(e,e._tileLoadQueueHigh,n,t),++o.tilesWaitingForChildren);e._lastSelectionFrameNumber=d}(this,e),function(e,t){let i=e._tileProvider,n=e._tilesToRender;for(let e=0,r=n.length;e<r;++e){let r=n[e];i.showTileThisFrame(r,t)}}(this,e),i.endUpdate(e)),t.pick&&this._tilesToRender.length>0&&i.updateForPick(e)},rm.prototype.endFrame=function(e){e.passes.render&&e.mode!==eB.Z.MORPHING&&(function(e,t){let i=e._tileLoadQueueHigh,n=e._tileLoadQueueMedium,r=e._tileLoadQueueLow;if(0===i.length&&0===n.length&&0===r.length)return;e._tileReplacementQueue.trimTiles(e.tileCacheSize);let o=(0,rl.Z)()+e._loadQueueTimeSlice,a=e._tileProvider,s=rC(e,t,a,o,i,!1);s=rC(e,t,a,o,n,s),rC(e,t,a,o,r,s)}(this,e),function(e,t){let i;if(!(0,y.Z)(e.tileProvider.tilingScheme))return;rD.length=0;let n=e._tileToUpdateHeights,r=(0,rl.Z)()+e._updateHeightsTimeSlice,o=t.mode,a=t.mapProjection,s=e.tileProvider.tilingScheme.ellipsoid;for(;n.length>0;){let t=n[0];if(!(0,y.Z)(t.data)||!(0,y.Z)(t.data.mesh)){let i=t._lastSelectionResultFrame===e._lastSelectionFrameNumber?t._lastSelectionResult:i6.NONE;(i===i6.RENDERED||i===i6.CULLED_BUT_NEEDED)&&rD.push(t),n.shift(),e._lastTileIndex=0;continue}let l=t.customData,c=l.length,u=!1;for(i=e._lastTileIndex;i<c;++i){let e=l[i],n=t.data.terrainData,c=(0,y.Z)(n)&&n.wasCreatedByUpsampling();if(t.level>e.level&&!c){if((0,y.Z)(e.positionOnEllipsoidSurface)||(e.positionOnEllipsoidSurface=_.Z.fromRadians(e.positionCartographic.longitude,e.positionCartographic.latitude,0,s)),o===eB.Z.SCENE3D){let i=s.geodeticSurfaceNormal(e.positionOnEllipsoidSurface,rA.direction),n=s.getSurfaceNormalIntersectionWithZAxis(e.positionOnEllipsoidSurface,11500,rA.origin);if(!(0,y.Z)(n)){let n=0;(0,y.Z)(t.data.tileBoundingRegion)&&(n=t.data.tileBoundingRegion.minimumHeight);let r=Math.min(n,-11500),o=_.Z.multiplyByScalar(i,Math.abs(r)+1,rO);_.Z.subtract(e.positionOnEllipsoidSurface,o,rA.origin)}}else C.Z.clone(e.positionCartographic,rI),rI.height=-11500,a.project(rI,rO),_.Z.fromElements(rO.z,rO.x,rO.y,rO),_.Z.clone(rO,rA.origin),_.Z.clone(_.Z.UNIT_X,rA.direction);let i=t.data.pick(rA,o,a,!1,rO);(0,y.Z)(i)&&((0,y.Z)(e.callback)&&e.callback(i),e.level=t.level)}if((0,rl.Z)()>=r){u=!0;break}}if(u){e._lastTileIndex=i;break}e._lastTileIndex=0,n.shift()}for(i=0;i<rD.length;i++)n.push(rD[i])}(this,e),function(e,t){let i=e._tileLoadQueueHigh.length+e._tileLoadQueueMedium.length+e._tileLoadQueueLow.length;if(i!==e._lastTileLoadQueueLength||e._tilesInvalidated){let n=I.Z.prototype.raiseEvent.bind(e._tileLoadProgressEvent,i);t.afterRender.push(()=>(n(),!0)),e._lastTileLoadQueueLength=i}let n=e._debug;n.enableDebugOutput&&!n.suspendLodUpdate&&(n.maxDepth=e._tilesToRender.reduce(function(e,t){return Math.max(e,t.level)},-1),n.tilesRendered=e._tilesToRender.length,(n.tilesVisited!==n.lastTilesVisited||n.tilesRendered!==n.lastTilesRendered||n.tilesCulled!==n.lastTilesCulled||n.maxDepth!==n.lastMaxDepth||n.tilesWaitingForChildren!==n.lastTilesWaitingForChildren||n.maxDepthVisited!==n.lastMaxDepthVisited)&&(console.log(`Visited ${n.tilesVisited}, Rendered: ${n.tilesRendered}, Culled: ${n.tilesCulled}, Max Depth Rendered: ${n.maxDepth}, Max Depth Visited: ${n.maxDepthVisited}, Waiting for children: ${n.tilesWaitingForChildren}`),n.lastTilesVisited=n.tilesVisited,n.lastTilesRendered=n.tilesRendered,n.lastTilesCulled=n.tilesCulled,n.lastMaxDepth=n.maxDepth,n.lastTilesWaitingForChildren=n.tilesWaitingForChildren,n.lastMaxDepthVisited=n.maxDepthVisited))}(this,e))},rm.prototype.isDestroyed=function(){return!1},rm.prototype.destroy=function(){this._tileProvider=this._tileProvider&&this._tileProvider.destroy()};let rg=new C.Z;function rZ(e,t){let i=U.Z.center(e.rectangle,rg),n=i.longitude-l.longitude,r=i.latitude-l.latitude,o=(i=U.Z.center(t.rectangle,rg)).longitude-l.longitude,a=i.latitude-l.latitude;return n*n+r*r-(o*o+a*a)}let ry=new _.Z,rb=[];function rv(e,t,i,n){i.needsLoading&&(void 0!==e.tileProvider.computeTileLoadPriority&&(i._loadPriority=e.tileProvider.computeTileLoadPriority(i,n)),t.push(i))}function rT(){this.allAreRenderable=!0,this.anyWereRenderedLastFrame=!1,this.notYetRenderableCount=0}function rE(){this.southwest=new rT,this.southeast=new rT,this.northwest=new rT,this.northeast=new rT}rE.prototype.combine=function(e){let t=this.southwest,i=this.southeast,n=this.northwest,r=this.northeast;e.allAreRenderable=t.allAreRenderable&&i.allAreRenderable&&n.allAreRenderable&&r.allAreRenderable,e.anyWereRenderedLastFrame=t.anyWereRenderedLastFrame||i.anyWereRenderedLastFrame||n.anyWereRenderedLastFrame||r.anyWereRenderedLastFrame,e.notYetRenderableCount=t.notYetRenderableCount+i.notYetRenderableCount+n.notYetRenderableCount+r.notYetRenderableCount};let rx=Array(31);for(let e=0;e<rx.length;++e)rx[e]=new rE;function rw(e,t){e._tilesToRender.push(t)}function rS(e,t){return e._loadPriority-t._loadPriority}function rC(e,t,i,n,r,o){void 0!==i.computeTileLoadPriority&&r.sort(rS);for(let a=0,s=r.length;a<s&&((0,rl.Z)()<n||!o);++a){let n=r[a];e._tileReplacementQueue.markTileRendered(n),i.loadTile(t,n),o=!0}return o}let rA=new eI.Z,rI=new C.Z,rO=new _.Z,rD=[];function rP(e){let t=new eS({ellipsoid:e=(0,Z.Z)(e,T.Z.WGS84)}),i=new rn;this._ellipsoid=e,this._imageryLayerCollection=i,this._surfaceShaderSet=new ek,this._material=void 0,this._surface=new rm({tileProvider:new nM({terrainProvider:t,imageryLayers:i,surfaceShaderSet:this._surfaceShaderSet})}),this._terrainProvider=t,this._terrainProviderChanged=new I.Z,this._undergroundColor=A.Z.clone(A.Z.BLACK),this._undergroundColorAlphaByDistance=new eA.Z(e.maximumRadius/1e3,0,e.maximumRadius/5,1),this._translucency=new ri,rR(this),this.show=!0,this._oceanNormalMapResourceDirty=!0,this._oceanNormalMapResource=new eO.Z({url:(0,m.Z)("Assets/Textures/waterNormalsSmall.jpg")}),this.maximumScreenSpaceError=2,this.tileCacheSize=100,this.loadingDescendantLimit=20,this.preloadAncestors=!0,this.preloadSiblings=!1,this.fillHighlightColor=void 0,this.enableLighting=!1,this.lambertDiffuseMultiplier=.9,this.dynamicAtmosphereLighting=!0,this.dynamicAtmosphereLightingFromSun=!1,this.showGroundAtmosphere=!0,this.atmosphereLightIntensity=10,this.atmosphereRayleighCoefficient=new _.Z(55e-7,13e-6,284e-7),this.atmosphereMieCoefficient=new _.Z(21e-6,21e-6,21e-6),this.atmosphereRayleighScaleHeight=1e4,this.atmosphereMieScaleHeight=3200,this.atmosphereMieAnisotropy=.9,this.lightingFadeOutDistance=1e7,this.lightingFadeInDistance=2e7,this.nightFadeOutDistance=1e7,this.nightFadeInDistance=5e7,this.showWaterEffect=!0,this.depthTestAgainstTerrain=!1,this.shadows=i4.Z.RECEIVE_ONLY,this.atmosphereHueShift=0,this.atmosphereSaturationShift=0,this.atmosphereBrightnessShift=0,this.showSkirts=!0,this.backFaceCulling=!0,this._oceanNormalMap=void 0,this._zoomedOutOceanSpecularIntensity=void 0,this.vertexShadowDarkness=.3}function rR(e){let t=[],i=(0,y.Z)(e._material)&&((0,y.Z)(e._material.shaderSource.match(/slope/))||(0,y.Z)(e._material.shaderSource.match("normalEC"))),n=[eR,eN];(0,y.Z)(e._material)&&(!i||e._terrainProvider.requestVertexNormals)?(n.push(e._material.shaderSource),t.push("APPLY_MATERIAL"),e._surface._tileProvider.materialUniformMap=e._material._uniforms):e._surface._tileProvider.materialUniformMap=void 0,n.push("uniform vec4 u_initialColor;\n\n#if TEXTURE_UNITS > 0\nuniform sampler2D u_dayTextures[TEXTURE_UNITS];\nuniform vec4 u_dayTextureTranslationAndScale[TEXTURE_UNITS];\nuniform bool u_dayTextureUseWebMercatorT[TEXTURE_UNITS];\n\n#ifdef APPLY_ALPHA\nuniform float u_dayTextureAlpha[TEXTURE_UNITS];\n#endif\n\n#ifdef APPLY_DAY_NIGHT_ALPHA\nuniform float u_dayTextureNightAlpha[TEXTURE_UNITS];\nuniform float u_dayTextureDayAlpha[TEXTURE_UNITS];\n#endif\n\n#ifdef APPLY_SPLIT\nuniform float u_dayTextureSplit[TEXTURE_UNITS];\n#endif\n\n#ifdef APPLY_BRIGHTNESS\nuniform float u_dayTextureBrightness[TEXTURE_UNITS];\n#endif\n\n#ifdef APPLY_CONTRAST\nuniform float u_dayTextureContrast[TEXTURE_UNITS];\n#endif\n\n#ifdef APPLY_HUE\nuniform float u_dayTextureHue[TEXTURE_UNITS];\n#endif\n\n#ifdef APPLY_SATURATION\nuniform float u_dayTextureSaturation[TEXTURE_UNITS];\n#endif\n\n#ifdef APPLY_GAMMA\nuniform float u_dayTextureOneOverGamma[TEXTURE_UNITS];\n#endif\n\n#ifdef APPLY_IMAGERY_CUTOUT\nuniform vec4 u_dayTextureCutoutRectangles[TEXTURE_UNITS];\n#endif\n\n#ifdef APPLY_COLOR_TO_ALPHA\nuniform vec4 u_colorsToAlpha[TEXTURE_UNITS];\n#endif\n\nuniform vec4 u_dayTextureTexCoordsRectangle[TEXTURE_UNITS];\n#endif\n\n#ifdef SHOW_REFLECTIVE_OCEAN\nuniform sampler2D u_waterMask;\nuniform vec4 u_waterMaskTranslationAndScale;\nuniform float u_zoomedOutOceanSpecularIntensity;\n#endif\n\n#ifdef SHOW_OCEAN_WAVES\nuniform sampler2D u_oceanNormalMap;\n#endif\n\n#if defined(ENABLE_DAYNIGHT_SHADING) || defined(GROUND_ATMOSPHERE)\nuniform vec2 u_lightingFadeDistance;\n#endif\n\n#ifdef TILE_LIMIT_RECTANGLE\nuniform vec4 u_cartographicLimitRectangle;\n#endif\n\n#ifdef GROUND_ATMOSPHERE\nuniform vec2 u_nightFadeDistance;\n#endif\n\n#ifdef ENABLE_CLIPPING_PLANES\nuniform highp sampler2D u_clippingPlanes;\nuniform mat4 u_clippingPlanesMatrix;\nuniform vec4 u_clippingPlanesEdgeStyle;\n#endif\n\n#ifdef ENABLE_CLIPPING_POLYGONS\nuniform highp sampler2D u_clippingDistance;\nin vec2 v_clippingPosition;\nflat in int v_regionIndex;\n#endif\n\n#if defined(GROUND_ATMOSPHERE) || defined(FOG) && defined(DYNAMIC_ATMOSPHERE_LIGHTING) && (defined(ENABLE_VERTEX_LIGHTING) || defined(ENABLE_DAYNIGHT_SHADING))\nuniform float u_minimumBrightness;\n#endif\n\n#ifdef COLOR_CORRECT\nuniform vec3 u_hsbShift; // Hue, saturation, brightness\n#endif\n\n#ifdef HIGHLIGHT_FILL_TILE\nuniform vec4 u_fillHighlightColor;\n#endif\n\n#ifdef TRANSLUCENT\nuniform vec4 u_frontFaceAlphaByDistance;\nuniform vec4 u_backFaceAlphaByDistance;\nuniform vec4 u_translucencyRectangle;\n#endif\n\n#ifdef UNDERGROUND_COLOR\nuniform vec4 u_undergroundColor;\nuniform vec4 u_undergroundColorAlphaByDistance;\n#endif\n\n#ifdef ENABLE_VERTEX_LIGHTING\nuniform float u_lambertDiffuseMultiplier;\nuniform float u_vertexShadowDarkness;\n#endif\n\nin vec3 v_positionMC;\nin vec3 v_positionEC;\nin vec3 v_textureCoordinates;\nin vec3 v_normalMC;\nin vec3 v_normalEC;\n\n#ifdef APPLY_MATERIAL\nin float v_height;\nin float v_slope;\nin float v_aspect;\n#endif\n\n#if defined(FOG) || defined(GROUND_ATMOSPHERE) || defined(UNDERGROUND_COLOR) || defined(TRANSLUCENT)\nin float v_distance;\n#endif\n\n#if defined(GROUND_ATMOSPHERE) || defined(FOG)\nin vec3 v_atmosphereRayleighColor;\nin vec3 v_atmosphereMieColor;\nin float v_atmosphereOpacity;\n#endif\n\n#if defined(UNDERGROUND_COLOR) || defined(TRANSLUCENT)\nfloat interpolateByDistance(vec4 nearFarScalar, float distance)\n{\n float startDistance = nearFarScalar.x;\n float startValue = nearFarScalar.y;\n float endDistance = nearFarScalar.z;\n float endValue = nearFarScalar.w;\n float t = clamp((distance - startDistance) / (endDistance - startDistance), 0.0, 1.0);\n return mix(startValue, endValue, t);\n}\n#endif\n\n#if defined(UNDERGROUND_COLOR) || defined(TRANSLUCENT) || defined(APPLY_MATERIAL)\nvec4 alphaBlend(vec4 sourceColor, vec4 destinationColor)\n{\n return sourceColor * vec4(sourceColor.aaa, 1.0) + destinationColor * (1.0 - sourceColor.a);\n}\n#endif\n\n#ifdef TRANSLUCENT\nbool inTranslucencyRectangle()\n{\n return\n v_textureCoordinates.x > u_translucencyRectangle.x &&\n v_textureCoordinates.x < u_translucencyRectangle.z &&\n v_textureCoordinates.y > u_translucencyRectangle.y &&\n v_textureCoordinates.y < u_translucencyRectangle.w;\n}\n#endif\n\nvec4 sampleAndBlend(\n vec4 previousColor,\n sampler2D textureToSample,\n vec2 tileTextureCoordinates,\n vec4 textureCoordinateRectangle,\n vec4 textureCoordinateTranslationAndScale,\n float textureAlpha,\n float textureNightAlpha,\n float textureDayAlpha,\n float textureBrightness,\n float textureContrast,\n float textureHue,\n float textureSaturation,\n float textureOneOverGamma,\n float split,\n vec4 colorToAlpha,\n float nightBlend)\n{\n // This crazy step stuff sets the alpha to 0.0 if this following condition is true:\n // tileTextureCoordinates.s < textureCoordinateRectangle.s ||\n // tileTextureCoordinates.s > textureCoordinateRectangle.p ||\n // tileTextureCoordinates.t < textureCoordinateRectangle.t ||\n // tileTextureCoordinates.t > textureCoordinateRectangle.q\n // In other words, the alpha is zero if the fragment is outside the rectangle\n // covered by this texture. Would an actual 'if' yield better performance?\n vec2 alphaMultiplier = step(textureCoordinateRectangle.st, tileTextureCoordinates);\n textureAlpha = textureAlpha * alphaMultiplier.x * alphaMultiplier.y;\n\n alphaMultiplier = step(vec2(0.0), textureCoordinateRectangle.pq - tileTextureCoordinates);\n textureAlpha = textureAlpha * alphaMultiplier.x * alphaMultiplier.y;\n\n#if defined(APPLY_DAY_NIGHT_ALPHA) && defined(ENABLE_DAYNIGHT_SHADING)\n textureAlpha *= mix(textureDayAlpha, textureNightAlpha, nightBlend);\n#endif\n\n vec2 translation = textureCoordinateTranslationAndScale.xy;\n vec2 scale = textureCoordinateTranslationAndScale.zw;\n vec2 textureCoordinates = tileTextureCoordinates * scale + translation;\n vec4 value = texture(textureToSample, textureCoordinates);\n vec3 color = value.rgb;\n float alpha = value.a;\n\n#ifdef APPLY_COLOR_TO_ALPHA\n vec3 colorDiff = abs(color.rgb - colorToAlpha.rgb);\n colorDiff.r = czm_maximumComponent(colorDiff);\n alpha = czm_branchFreeTernary(colorDiff.r < colorToAlpha.a, 0.0, alpha);\n#endif\n\n#if !defined(APPLY_GAMMA)\n vec4 tempColor = czm_gammaCorrect(vec4(color, alpha));\n color = tempColor.rgb;\n alpha = tempColor.a;\n#else\n color = pow(color, vec3(textureOneOverGamma));\n#endif\n\n#ifdef APPLY_SPLIT\n float splitPosition = czm_splitPosition;\n // Split to the left\n if (split < 0.0 && gl_FragCoord.x > splitPosition) {\n alpha = 0.0;\n }\n // Split to the right\n else if (split > 0.0 && gl_FragCoord.x < splitPosition) {\n alpha = 0.0;\n }\n#endif\n\n#ifdef APPLY_BRIGHTNESS\n color = mix(vec3(0.0), color, textureBrightness);\n#endif\n\n#ifdef APPLY_CONTRAST\n color = mix(vec3(0.5), color, textureContrast);\n#endif\n\n#ifdef APPLY_HUE\n color = czm_hue(color, textureHue);\n#endif\n\n#ifdef APPLY_SATURATION\n color = czm_saturation(color, textureSaturation);\n#endif\n\n float sourceAlpha = alpha * textureAlpha;\n float outAlpha = mix(previousColor.a, 1.0, sourceAlpha);\n outAlpha += sign(outAlpha) - 1.0;\n\n vec3 outColor = mix(previousColor.rgb * previousColor.a, color, sourceAlpha) / outAlpha;\n\n // When rendering imagery for a tile in multiple passes,\n // some GPU/WebGL implementation combinations will not blend fragments in\n // additional passes correctly if their computation includes an unmasked\n // divide-by-zero operation,\n // even if it's not in the output or if the output has alpha zero.\n //\n // For example, without sanitization for outAlpha,\n // this renders without artifacts:\n // if (outAlpha == 0.0) { outColor = vec3(0.0); }\n //\n // but using czm_branchFreeTernary will cause portions of the tile that are\n // alpha-zero in the additional pass to render as black instead of blending\n // with the previous pass:\n // outColor = czm_branchFreeTernary(outAlpha == 0.0, vec3(0.0), outColor);\n //\n // So instead, sanitize against divide-by-zero,\n // store this state on the sign of outAlpha, and correct on return.\n\n return vec4(outColor, max(outAlpha, 0.0));\n}\n\nvec4 computeDayColor(vec4 initialColor, vec3 textureCoordinates, float nightBlend);\nvec4 computeWaterColor(vec3 positionEyeCoordinates, vec2 textureCoordinates, mat3 enuToEye, vec4 imageryColor, float specularMapValue, float fade);\n\nconst float fExposure = 2.0;\n\nvec3 computeEllipsoidPosition()\n{\n float mpp = czm_metersPerPixel(vec4(0.0, 0.0, -czm_currentFrustum.x, 1.0), 1.0);\n vec2 xy = gl_FragCoord.xy / czm_viewport.zw * 2.0 - vec2(1.0);\n xy *= czm_viewport.zw * mpp * 0.5;\n\n vec3 direction = normalize(vec3(xy, -czm_currentFrustum.x));\n czm_ray ray = czm_ray(vec3(0.0), direction);\n\n vec3 ellipsoid_center = czm_view[3].xyz;\n\n czm_raySegment intersection = czm_rayEllipsoidIntersectionInterval(ray, ellipsoid_center, czm_ellipsoidInverseRadii);\n\n vec3 ellipsoidPosition = czm_pointAlongRay(ray, intersection.start);\n return (czm_inverseView * vec4(ellipsoidPosition, 1.0)).xyz;\n}\n\nvoid main()\n{\n#ifdef TILE_LIMIT_RECTANGLE\n if (v_textureCoordinates.x < u_cartographicLimitRectangle.x || u_cartographicLimitRectangle.z < v_textureCoordinates.x ||\n v_textureCoordinates.y < u_cartographicLimitRectangle.y || u_cartographicLimitRectangle.w < v_textureCoordinates.y)\n {\n discard;\n }\n#endif\n\n#ifdef ENABLE_CLIPPING_PLANES\n float clipDistance = clip(gl_FragCoord, u_clippingPlanes, u_clippingPlanesMatrix);\n#endif\n\n#if defined(SHOW_REFLECTIVE_OCEAN) || defined(ENABLE_DAYNIGHT_SHADING) || defined(HDR)\n vec3 normalMC = czm_geodeticSurfaceNormal(v_positionMC, vec3(0.0), vec3(1.0)); // normalized surface normal in model coordinates\n vec3 normalEC = czm_normal3D * normalMC; // normalized surface normal in eye coordinates\n#endif\n\n#if defined(APPLY_DAY_NIGHT_ALPHA) && defined(ENABLE_DAYNIGHT_SHADING)\n float nightBlend = 1.0 - clamp(czm_getLambertDiffuse(czm_lightDirectionEC, normalEC) * 5.0, 0.0, 1.0);\n#else\n float nightBlend = 0.0;\n#endif\n\n // The clamp below works around an apparent bug in Chrome Canary v23.0.1241.0\n // where the fragment shader sees textures coordinates < 0.0 and > 1.0 for the\n // fragments on the edges of tiles even though the vertex shader is outputting\n // coordinates strictly in the 0-1 range.\n vec4 color = computeDayColor(u_initialColor, clamp(v_textureCoordinates, 0.0, 1.0), nightBlend);\n\n#ifdef SHOW_TILE_BOUNDARIES\n if (v_textureCoordinates.x < (1.0/256.0) || v_textureCoordinates.x > (255.0/256.0) ||\n v_textureCoordinates.y < (1.0/256.0) || v_textureCoordinates.y > (255.0/256.0))\n {\n color = vec4(1.0, 0.0, 0.0, 1.0);\n }\n#endif\n\n#if defined(ENABLE_DAYNIGHT_SHADING) || defined(GROUND_ATMOSPHERE)\n float cameraDist;\n if (czm_sceneMode == czm_sceneMode2D)\n {\n cameraDist = max(czm_frustumPlanes.x - czm_frustumPlanes.y, czm_frustumPlanes.w - czm_frustumPlanes.z) * 0.5;\n }\n else if (czm_sceneMode == czm_sceneModeColumbusView)\n {\n cameraDist = -czm_view[3].z;\n }\n else\n {\n cameraDist = length(czm_view[3]);\n }\n float fadeOutDist = u_lightingFadeDistance.x;\n float fadeInDist = u_lightingFadeDistance.y;\n if (czm_sceneMode != czm_sceneMode3D) {\n vec3 radii = czm_ellipsoidRadii;\n float maxRadii = max(radii.x, max(radii.y, radii.z));\n fadeOutDist -= maxRadii;\n fadeInDist -= maxRadii;\n }\n float fade = clamp((cameraDist - fadeOutDist) / (fadeInDist - fadeOutDist), 0.0, 1.0);\n#else\n float fade = 0.0;\n#endif\n\n#ifdef SHOW_REFLECTIVE_OCEAN\n vec2 waterMaskTranslation = u_waterMaskTranslationAndScale.xy;\n vec2 waterMaskScale = u_waterMaskTranslationAndScale.zw;\n vec2 waterMaskTextureCoordinates = v_textureCoordinates.xy * waterMaskScale + waterMaskTranslation;\n waterMaskTextureCoordinates.y = 1.0 - waterMaskTextureCoordinates.y;\n\n float mask = texture(u_waterMask, waterMaskTextureCoordinates).r;\n\n if (mask > 0.0)\n {\n mat3 enuToEye = czm_eastNorthUpToEyeCoordinates(v_positionMC, normalEC);\n\n vec2 ellipsoidTextureCoordinates = czm_ellipsoidWgs84TextureCoordinates(normalMC);\n vec2 ellipsoidFlippedTextureCoordinates = czm_ellipsoidWgs84TextureCoordinates(normalMC.zyx);\n\n vec2 textureCoordinates = mix(ellipsoidTextureCoordinates, ellipsoidFlippedTextureCoordinates, czm_morphTime * smoothstep(0.9, 0.95, normalMC.z));\n\n color = computeWaterColor(v_positionEC, textureCoordinates, enuToEye, color, mask, fade);\n }\n#endif\n\n#ifdef APPLY_MATERIAL\n czm_materialInput materialInput;\n materialInput.st = v_textureCoordinates.st;\n materialInput.normalEC = normalize(v_normalEC);\n materialInput.positionToEyeEC = -v_positionEC;\n materialInput.tangentToEyeMatrix = czm_eastNorthUpToEyeCoordinates(v_positionMC, normalize(v_normalEC));\n materialInput.slope = v_slope;\n materialInput.height = v_height;\n materialInput.aspect = v_aspect;\n czm_material material = czm_getMaterial(materialInput);\n vec4 materialColor = vec4(material.diffuse, material.alpha);\n color = alphaBlend(materialColor, color);\n#endif\n\n#ifdef ENABLE_VERTEX_LIGHTING\n float diffuseIntensity = clamp(czm_getLambertDiffuse(czm_lightDirectionEC, normalize(v_normalEC)) * u_lambertDiffuseMultiplier + u_vertexShadowDarkness, 0.0, 1.0);\n vec4 finalColor = vec4(color.rgb * czm_lightColor * diffuseIntensity, color.a);\n#elif defined(ENABLE_DAYNIGHT_SHADING)\n float diffuseIntensity = clamp(czm_getLambertDiffuse(czm_lightDirectionEC, normalEC) * 5.0 + 0.3, 0.0, 1.0);\n diffuseIntensity = mix(1.0, diffuseIntensity, fade);\n vec4 finalColor = vec4(color.rgb * czm_lightColor * diffuseIntensity, color.a);\n#else\n vec4 finalColor = color;\n#endif\n\n#ifdef ENABLE_CLIPPING_PLANES\n vec4 clippingPlanesEdgeColor = vec4(1.0);\n clippingPlanesEdgeColor.rgb = u_clippingPlanesEdgeStyle.rgb;\n float clippingPlanesEdgeWidth = u_clippingPlanesEdgeStyle.a;\n\n if (clipDistance < clippingPlanesEdgeWidth)\n {\n finalColor = clippingPlanesEdgeColor;\n }\n#endif\n\n#ifdef ENABLE_CLIPPING_POLYGONS\n vec2 clippingPosition = v_clippingPosition;\n int regionIndex = v_regionIndex;\n clipPolygons(u_clippingDistance, CLIPPING_POLYGON_REGIONS_LENGTH, clippingPosition, regionIndex); \n#endif\n\n#ifdef HIGHLIGHT_FILL_TILE\n finalColor = vec4(mix(finalColor.rgb, u_fillHighlightColor.rgb, u_fillHighlightColor.a), finalColor.a);\n#endif\n\n#if defined(DYNAMIC_ATMOSPHERE_LIGHTING_FROM_SUN)\n vec3 atmosphereLightDirection = czm_sunDirectionWC;\n#else\n vec3 atmosphereLightDirection = czm_lightDirectionWC;\n#endif\n\n#if defined(GROUND_ATMOSPHERE) || defined(FOG)\n if (!czm_backFacing())\n {\n bool dynamicLighting = false;\n #if defined(DYNAMIC_ATMOSPHERE_LIGHTING) && (defined(ENABLE_DAYNIGHT_SHADING) || defined(ENABLE_VERTEX_LIGHTING))\n dynamicLighting = true;\n #endif\n\n vec3 rayleighColor;\n vec3 mieColor;\n float opacity;\n\n vec3 positionWC;\n vec3 lightDirection;\n\n // When the camera is far away (camera distance > nightFadeOutDistance), the scattering is computed in the fragment shader.\n // Otherwise, the scattering is computed in the vertex shader.\n #ifdef PER_FRAGMENT_GROUND_ATMOSPHERE\n positionWC = computeEllipsoidPosition();\n lightDirection = czm_branchFreeTernary(dynamicLighting, atmosphereLightDirection, normalize(positionWC));\n computeAtmosphereScattering(\n positionWC,\n lightDirection,\n rayleighColor,\n mieColor,\n opacity\n );\n #else\n positionWC = v_positionMC;\n lightDirection = czm_branchFreeTernary(dynamicLighting, atmosphereLightDirection, normalize(positionWC));\n rayleighColor = v_atmosphereRayleighColor;\n mieColor = v_atmosphereMieColor;\n opacity = v_atmosphereOpacity;\n #endif\n\n #ifdef COLOR_CORRECT\n const bool ignoreBlackPixels = true;\n rayleighColor = czm_applyHSBShift(rayleighColor, u_hsbShift, ignoreBlackPixels);\n mieColor = czm_applyHSBShift(mieColor, u_hsbShift, ignoreBlackPixels);\n #endif\n\n vec4 groundAtmosphereColor = computeAtmosphereColor(positionWC, lightDirection, rayleighColor, mieColor, opacity);\n\n // Fog is applied to tiles selected for fog, close to the Earth.\n #ifdef FOG\n vec3 fogColor = groundAtmosphereColor.rgb;\n\n // If there is lighting, apply that to the fog.\n #if defined(DYNAMIC_ATMOSPHERE_LIGHTING) && (defined(ENABLE_VERTEX_LIGHTING) || defined(ENABLE_DAYNIGHT_SHADING))\n float darken = clamp(dot(normalize(czm_viewerPositionWC), atmosphereLightDirection), u_minimumBrightness, 1.0);\n fogColor *= darken;\n #endif\n\n #ifndef HDR\n fogColor.rgb = czm_acesTonemapping(fogColor.rgb);\n fogColor.rgb = czm_inverseGamma(fogColor.rgb);\n #endif\n\n const float modifier = 0.15;\n finalColor = vec4(czm_fog(v_distance, finalColor.rgb, fogColor.rgb, modifier), finalColor.a);\n\n #else\n // Apply ground atmosphere. This happens when the camera is far away from the earth.\n\n // The transmittance is based on optical depth i.e. the length of segment of the ray inside the atmosphere.\n // This value is larger near the \"circumference\", as it is further away from the camera. We use it to\n // brighten up that area of the ground atmosphere.\n const float transmittanceModifier = 0.5;\n float transmittance = transmittanceModifier + clamp(1.0 - groundAtmosphereColor.a, 0.0, 1.0);\n\n vec3 finalAtmosphereColor = finalColor.rgb + groundAtmosphereColor.rgb * transmittance;\n\n #if defined(DYNAMIC_ATMOSPHERE_LIGHTING) && (defined(ENABLE_VERTEX_LIGHTING) || defined(ENABLE_DAYNIGHT_SHADING))\n float fadeInDist = u_nightFadeDistance.x;\n float fadeOutDist = u_nightFadeDistance.y;\n\n float sunlitAtmosphereIntensity = clamp((cameraDist - fadeOutDist) / (fadeInDist - fadeOutDist), 0.05, 1.0);\n float darken = clamp(dot(normalize(positionWC), atmosphereLightDirection), 0.0, 1.0);\n vec3 darkenendGroundAtmosphereColor = mix(groundAtmosphereColor.rgb, finalAtmosphereColor.rgb, darken);\n\n finalAtmosphereColor = mix(darkenendGroundAtmosphereColor, finalAtmosphereColor, sunlitAtmosphereIntensity);\n #endif\n\n #ifndef HDR\n finalAtmosphereColor.rgb = vec3(1.0) - exp(-fExposure * finalAtmosphereColor.rgb);\n #else\n finalAtmosphereColor.rgb = czm_saturation(finalAtmosphereColor.rgb, 1.6);\n #endif\n\n finalColor.rgb = mix(finalColor.rgb, finalAtmosphereColor.rgb, fade);\n #endif\n }\n#endif\n\n#ifdef UNDERGROUND_COLOR\n if (czm_backFacing())\n {\n float distanceFromEllipsoid = max(czm_eyeHeight, 0.0);\n float distance = max(v_distance - distanceFromEllipsoid, 0.0);\n float blendAmount = interpolateByDistance(u_undergroundColorAlphaByDistance, distance);\n vec4 undergroundColor = vec4(u_undergroundColor.rgb, u_undergroundColor.a * blendAmount);\n finalColor = alphaBlend(undergroundColor, finalColor);\n }\n#endif\n\n#ifdef TRANSLUCENT\n if (inTranslucencyRectangle())\n {\n vec4 alphaByDistance = gl_FrontFacing ? u_frontFaceAlphaByDistance : u_backFaceAlphaByDistance;\n finalColor.a *= interpolateByDistance(alphaByDistance, v_distance);\n }\n#endif\n\n out_FragColor = finalColor;\n}\n\n\n#ifdef SHOW_REFLECTIVE_OCEAN\n\nfloat waveFade(float edge0, float edge1, float x)\n{\n float y = clamp((x - edge0) / (edge1 - edge0), 0.0, 1.0);\n return pow(1.0 - y, 5.0);\n}\n\nfloat linearFade(float edge0, float edge1, float x)\n{\n return clamp((x - edge0) / (edge1 - edge0), 0.0, 1.0);\n}\n\n// Based on water rendering by Jonas Wagner:\n// http://29a.ch/2012/7/19/webgl-terrain-rendering-water-fog\n\n// low altitude wave settings\nconst float oceanFrequencyLowAltitude = 825000.0;\nconst float oceanAnimationSpeedLowAltitude = 0.004;\nconst float oceanOneOverAmplitudeLowAltitude = 1.0 / 2.0;\nconst float oceanSpecularIntensity = 0.5;\n\n// high altitude wave settings\nconst float oceanFrequencyHighAltitude = 125000.0;\nconst float oceanAnimationSpeedHighAltitude = 0.008;\nconst float oceanOneOverAmplitudeHighAltitude = 1.0 / 2.0;\n\nvec4 computeWaterColor(vec3 positionEyeCoordinates, vec2 textureCoordinates, mat3 enuToEye, vec4 imageryColor, float maskValue, float fade)\n{\n vec3 positionToEyeEC = -positionEyeCoordinates;\n float positionToEyeECLength = length(positionToEyeEC);\n\n // The double normalize below works around a bug in Firefox on Android devices.\n vec3 normalizedPositionToEyeEC = normalize(normalize(positionToEyeEC));\n\n // Fade out the waves as the camera moves far from the surface.\n float waveIntensity = waveFade(70000.0, 1000000.0, positionToEyeECLength);\n\n#ifdef SHOW_OCEAN_WAVES\n // high altitude waves\n float time = czm_frameNumber * oceanAnimationSpeedHighAltitude;\n vec4 noise = czm_getWaterNoise(u_oceanNormalMap, textureCoordinates * oceanFrequencyHighAltitude, time, 0.0);\n vec3 normalTangentSpaceHighAltitude = vec3(noise.xy, noise.z * oceanOneOverAmplitudeHighAltitude);\n\n // low altitude waves\n time = czm_frameNumber * oceanAnimationSpeedLowAltitude;\n noise = czm_getWaterNoise(u_oceanNormalMap, textureCoordinates * oceanFrequencyLowAltitude, time, 0.0);\n vec3 normalTangentSpaceLowAltitude = vec3(noise.xy, noise.z * oceanOneOverAmplitudeLowAltitude);\n\n // blend the 2 wave layers based on distance to surface\n float highAltitudeFade = linearFade(0.0, 60000.0, positionToEyeECLength);\n float lowAltitudeFade = 1.0 - linearFade(20000.0, 60000.0, positionToEyeECLength);\n vec3 normalTangentSpace =\n (highAltitudeFade * normalTangentSpaceHighAltitude) +\n (lowAltitudeFade * normalTangentSpaceLowAltitude);\n normalTangentSpace = normalize(normalTangentSpace);\n\n // fade out the normal perturbation as we move farther from the water surface\n normalTangentSpace.xy *= waveIntensity;\n normalTangentSpace = normalize(normalTangentSpace);\n#else\n vec3 normalTangentSpace = vec3(0.0, 0.0, 1.0);\n#endif\n\n vec3 normalEC = enuToEye * normalTangentSpace;\n\n const vec3 waveHighlightColor = vec3(0.3, 0.45, 0.6);\n\n // Use diffuse light to highlight the waves\n float diffuseIntensity = czm_getLambertDiffuse(czm_lightDirectionEC, normalEC) * maskValue;\n vec3 diffuseHighlight = waveHighlightColor * diffuseIntensity * (1.0 - fade);\n\n#ifdef SHOW_OCEAN_WAVES\n // Where diffuse light is low or non-existent, use wave highlights based solely on\n // the wave bumpiness and no particular light direction.\n float tsPerturbationRatio = normalTangentSpace.z;\n vec3 nonDiffuseHighlight = mix(waveHighlightColor * 5.0 * (1.0 - tsPerturbationRatio), vec3(0.0), diffuseIntensity);\n#else\n vec3 nonDiffuseHighlight = vec3(0.0);\n#endif\n\n // Add specular highlights in 3D, and in all modes when zoomed in.\n float specularIntensity = czm_getSpecular(czm_lightDirectionEC, normalizedPositionToEyeEC, normalEC, 10.0);\n float surfaceReflectance = mix(0.0, mix(u_zoomedOutOceanSpecularIntensity, oceanSpecularIntensity, waveIntensity), maskValue);\n float specular = specularIntensity * surfaceReflectance;\n\n#ifdef HDR\n specular *= 1.4;\n\n float e = 0.2;\n float d = 3.3;\n float c = 1.7;\n\n vec3 color = imageryColor.rgb + (c * (vec3(e) + imageryColor.rgb * d) * (diffuseHighlight + nonDiffuseHighlight + specular));\n#else\n vec3 color = imageryColor.rgb + diffuseHighlight + nonDiffuseHighlight + specular;\n#endif\n\n return vec4(color, imageryColor.a);\n}\n\n#endif // #ifdef SHOW_REFLECTIVE_OCEAN\n"),e._surfaceShaderSet.baseVertexShaderSource=new eD.Z({sources:[eR,eN,"#ifdef QUANTIZATION_BITS12\nin vec4 compressed0;\nin float compressed1;\n#else\nin vec4 position3DAndHeight;\nin vec4 textureCoordAndEncodedNormals;\n#endif\n\n#ifdef GEODETIC_SURFACE_NORMALS\nin vec3 geodeticSurfaceNormal;\n#endif\n\n#ifdef EXAGGERATION\nuniform vec2 u_verticalExaggerationAndRelativeHeight;\n#endif\n\nuniform vec3 u_center3D;\nuniform mat4 u_modifiedModelView;\nuniform mat4 u_modifiedModelViewProjection;\nuniform vec4 u_tileRectangle;\n\n// Uniforms for 2D Mercator projection\nuniform vec2 u_southAndNorthLatitude;\nuniform vec2 u_southMercatorYAndOneOverHeight;\n\nout vec3 v_positionMC;\nout vec3 v_positionEC;\n\nout vec3 v_textureCoordinates;\nout vec3 v_normalMC;\nout vec3 v_normalEC;\n\n#ifdef APPLY_MATERIAL\nout float v_slope;\nout float v_aspect;\nout float v_height;\n#endif\n\n#if defined(FOG) || defined(GROUND_ATMOSPHERE) || defined(UNDERGROUND_COLOR) || defined(TRANSLUCENT)\nout float v_distance;\n#endif\n\n#if defined(FOG) || defined(GROUND_ATMOSPHERE)\nout vec3 v_atmosphereRayleighColor;\nout vec3 v_atmosphereMieColor;\nout float v_atmosphereOpacity;\n#endif\n\n#ifdef ENABLE_CLIPPING_POLYGONS\nuniform highp sampler2D u_clippingExtents;\nout vec2 v_clippingPosition;\nflat out int v_regionIndex;\n#endif\n\n// These functions are generated at runtime.\nvec4 getPosition(vec3 position, float height, vec2 textureCoordinates);\nfloat get2DYPositionFraction(vec2 textureCoordinates);\n\nvec4 getPosition3DMode(vec3 position, float height, vec2 textureCoordinates)\n{\n return u_modifiedModelViewProjection * vec4(position, 1.0);\n}\n\nfloat get2DMercatorYPositionFraction(vec2 textureCoordinates)\n{\n // The width of a tile at level 11, in radians and assuming a single root tile, is\n // 2.0 * czm_pi / pow(2.0, 11.0)\n // We want to just linearly interpolate the 2D position from the texture coordinates\n // when we're at this level or higher. The constant below is the expression\n // above evaluated and then rounded up at the 4th significant digit.\n const float maxTileWidth = 0.003068;\n float positionFraction = textureCoordinates.y;\n float southLatitude = u_southAndNorthLatitude.x;\n float northLatitude = u_southAndNorthLatitude.y;\n if (northLatitude - southLatitude > maxTileWidth)\n {\n float southMercatorY = u_southMercatorYAndOneOverHeight.x;\n float oneOverMercatorHeight = u_southMercatorYAndOneOverHeight.y;\n\n float currentLatitude = mix(southLatitude, northLatitude, textureCoordinates.y);\n currentLatitude = clamp(currentLatitude, -czm_webMercatorMaxLatitude, czm_webMercatorMaxLatitude);\n positionFraction = czm_latitudeToWebMercatorFraction(currentLatitude, southMercatorY, oneOverMercatorHeight);\n }\n return positionFraction;\n}\n\nfloat get2DGeographicYPositionFraction(vec2 textureCoordinates)\n{\n return textureCoordinates.y;\n}\n\nvec4 getPositionPlanarEarth(vec3 position, float height, vec2 textureCoordinates)\n{\n float yPositionFraction = get2DYPositionFraction(textureCoordinates);\n vec4 rtcPosition2D = vec4(height, mix(u_tileRectangle.st, u_tileRectangle.pq, vec2(textureCoordinates.x, yPositionFraction)), 1.0);\n return u_modifiedModelViewProjection * rtcPosition2D;\n}\n\nvec4 getPosition2DMode(vec3 position, float height, vec2 textureCoordinates)\n{\n return getPositionPlanarEarth(position, 0.0, textureCoordinates);\n}\n\nvec4 getPositionColumbusViewMode(vec3 position, float height, vec2 textureCoordinates)\n{\n return getPositionPlanarEarth(position, height, textureCoordinates);\n}\n\nvec4 getPositionMorphingMode(vec3 position, float height, vec2 textureCoordinates)\n{\n // We do not do RTC while morphing, so there is potential for jitter.\n // This is unlikely to be noticeable, though.\n vec3 position3DWC = position + u_center3D;\n float yPositionFraction = get2DYPositionFraction(textureCoordinates);\n vec4 position2DWC = vec4(height, mix(u_tileRectangle.st, u_tileRectangle.pq, vec2(textureCoordinates.x, yPositionFraction)), 1.0);\n vec4 morphPosition = czm_columbusViewMorph(position2DWC, vec4(position3DWC, 1.0), czm_morphTime);\n return czm_modelViewProjection * morphPosition;\n}\n\n#ifdef QUANTIZATION_BITS12\nuniform vec2 u_minMaxHeight;\nuniform mat4 u_scaleAndBias;\n#endif\n\nvoid main()\n{\n#ifdef QUANTIZATION_BITS12\n vec2 xy = czm_decompressTextureCoordinates(compressed0.x);\n vec2 zh = czm_decompressTextureCoordinates(compressed0.y);\n vec3 position = vec3(xy, zh.x);\n float height = zh.y;\n vec2 textureCoordinates = czm_decompressTextureCoordinates(compressed0.z);\n\n height = height * (u_minMaxHeight.y - u_minMaxHeight.x) + u_minMaxHeight.x;\n position = (u_scaleAndBias * vec4(position, 1.0)).xyz;\n\n#if (defined(ENABLE_VERTEX_LIGHTING) || defined(GENERATE_POSITION_AND_NORMAL)) && defined(INCLUDE_WEB_MERCATOR_Y) || defined(APPLY_MATERIAL)\n float webMercatorT = czm_decompressTextureCoordinates(compressed0.w).x;\n float encodedNormal = compressed1;\n#elif defined(INCLUDE_WEB_MERCATOR_Y)\n float webMercatorT = czm_decompressTextureCoordinates(compressed0.w).x;\n float encodedNormal = 0.0;\n#elif defined(ENABLE_VERTEX_LIGHTING) || defined(GENERATE_POSITION_AND_NORMAL)\n float webMercatorT = textureCoordinates.y;\n float encodedNormal = compressed0.w;\n#else\n float webMercatorT = textureCoordinates.y;\n float encodedNormal = 0.0;\n#endif\n\n#else\n // A single float per element\n vec3 position = position3DAndHeight.xyz;\n float height = position3DAndHeight.w;\n vec2 textureCoordinates = textureCoordAndEncodedNormals.xy;\n\n#if (defined(ENABLE_VERTEX_LIGHTING) || defined(GENERATE_POSITION_AND_NORMAL) || defined(APPLY_MATERIAL)) && defined(INCLUDE_WEB_MERCATOR_Y)\n float webMercatorT = textureCoordAndEncodedNormals.z;\n float encodedNormal = textureCoordAndEncodedNormals.w;\n#elif defined(ENABLE_VERTEX_LIGHTING) || defined(GENERATE_POSITION_AND_NORMAL) || defined(APPLY_MATERIAL)\n float webMercatorT = textureCoordinates.y;\n float encodedNormal = textureCoordAndEncodedNormals.z;\n#elif defined(INCLUDE_WEB_MERCATOR_Y)\n float webMercatorT = textureCoordAndEncodedNormals.z;\n float encodedNormal = 0.0;\n#else\n float webMercatorT = textureCoordinates.y;\n float encodedNormal = 0.0;\n#endif\n\n#endif\n\n vec3 position3DWC = position + u_center3D;\n\n#ifdef GEODETIC_SURFACE_NORMALS\n vec3 ellipsoidNormal = geodeticSurfaceNormal;\n#else\n vec3 ellipsoidNormal = normalize(position3DWC);\n#endif\n\n#if defined(EXAGGERATION) && defined(GEODETIC_SURFACE_NORMALS)\n float exaggeration = u_verticalExaggerationAndRelativeHeight.x;\n float relativeHeight = u_verticalExaggerationAndRelativeHeight.y;\n float newHeight = (height - relativeHeight) * exaggeration + relativeHeight;\n\n // stop from going through center of earth\n float minRadius = min(min(czm_ellipsoidRadii.x, czm_ellipsoidRadii.y), czm_ellipsoidRadii.z);\n newHeight = max(newHeight, -minRadius);\n\n vec3 offset = ellipsoidNormal * (newHeight - height);\n position += offset;\n position3DWC += offset;\n height = newHeight;\n#endif\n\n gl_Position = getPosition(position, height, textureCoordinates);\n\n v_positionEC = (u_modifiedModelView * vec4(position, 1.0)).xyz;\n v_positionMC = position3DWC; // position in model coordinates\n\n v_textureCoordinates = vec3(textureCoordinates, webMercatorT);\n\n#if defined(ENABLE_VERTEX_LIGHTING) || defined(GENERATE_POSITION_AND_NORMAL) || defined(APPLY_MATERIAL)\n vec3 normalMC = czm_octDecode(encodedNormal);\n\n#if defined(EXAGGERATION) && defined(GEODETIC_SURFACE_NORMALS)\n vec3 projection = dot(normalMC, ellipsoidNormal) * ellipsoidNormal;\n vec3 rejection = normalMC - projection;\n normalMC = normalize(projection + rejection * exaggeration);\n#endif\n\n v_normalMC = normalMC;\n v_normalEC = czm_normal3D * v_normalMC;\n#endif\n\n#ifdef ENABLE_CLIPPING_POLYGONS\n vec2 sphericalLatLong = czm_approximateSphericalCoordinates(position3DWC);\n sphericalLatLong.y = czm_branchFreeTernary(sphericalLatLong.y < czm_pi, sphericalLatLong.y, sphericalLatLong.y - czm_twoPi);\n \n vec2 minDistance = vec2(czm_infinity);\n v_clippingPosition = vec2(czm_infinity);\n v_regionIndex = -1;\n\n for (int regionIndex = 0; regionIndex < CLIPPING_POLYGON_REGIONS_LENGTH; regionIndex++) {\n vec4 extents = unpackClippingExtents(u_clippingExtents, regionIndex);\n vec2 rectUv = (sphericalLatLong.yx - extents.yx) * extents.wz;\n\n vec2 clamped = clamp(rectUv, vec2(0.0), vec2(1.0));\n vec2 distance = abs(rectUv - clamped) * extents.wz;\n\n float threshold = 0.01;\n if (minDistance.x > distance.x || minDistance.y > distance.y) {\n minDistance = distance;\n v_clippingPosition = rectUv;\n if (rectUv.x > threshold && rectUv.y > threshold && rectUv.x < 1.0 - threshold && rectUv.y < 1.0 - threshold) {\n v_regionIndex = regionIndex;\n }\n }\n }\n#endif\n\n#if defined(FOG) || (defined(GROUND_ATMOSPHERE) && !defined(PER_FRAGMENT_GROUND_ATMOSPHERE))\n\n bool dynamicLighting = false;\n\n #if defined(DYNAMIC_ATMOSPHERE_LIGHTING) && (defined(ENABLE_DAYNIGHT_SHADING) || defined(ENABLE_VERTEX_LIGHTING))\n dynamicLighting = true;\n #endif\n\n#if defined(DYNAMIC_ATMOSPHERE_LIGHTING_FROM_SUN)\n vec3 atmosphereLightDirection = czm_sunDirectionWC;\n#else\n vec3 atmosphereLightDirection = czm_lightDirectionWC;\n#endif\n\n vec3 lightDirection = czm_branchFreeTernary(dynamicLighting, atmosphereLightDirection, normalize(position3DWC));\n\n computeAtmosphereScattering(\n position3DWC,\n lightDirection,\n v_atmosphereRayleighColor,\n v_atmosphereMieColor,\n v_atmosphereOpacity\n );\n#endif\n\n#if defined(FOG) || defined(GROUND_ATMOSPHERE) || defined(UNDERGROUND_COLOR) || defined(TRANSLUCENT)\n v_distance = length((czm_modelView3D * vec4(position3DWC, 1.0)).xyz);\n#endif\n\n#ifdef APPLY_MATERIAL\n float northPoleZ = czm_ellipsoidRadii.z;\n vec3 northPolePositionMC = vec3(0.0, 0.0, northPoleZ);\n vec3 vectorEastMC = normalize(cross(northPolePositionMC - v_positionMC, ellipsoidNormal));\n float dotProd = abs(dot(ellipsoidNormal, v_normalMC));\n v_slope = acos(dotProd);\n vec3 normalRejected = ellipsoidNormal * dotProd;\n vec3 normalProjected = v_normalMC - normalRejected;\n vec3 aspectVector = normalize(normalProjected);\n v_aspect = acos(dot(aspectVector, vectorEastMC));\n float determ = dot(cross(vectorEastMC, aspectVector), ellipsoidNormal);\n v_aspect = czm_branchFreeTernary(determ < 0.0, 2.0 * czm_pi - v_aspect, v_aspect);\n v_height = height;\n#endif\n}\n"],defines:t}),e._surfaceShaderSet.baseFragmentShaderSource=new eD.Z({sources:n,defines:t}),e._surfaceShaderSet.material=e._material}Object.defineProperties(rP.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},imageryLayers:{get:function(){return this._imageryLayerCollection}},imageryLayersUpdatedEvent:{get:function(){return this._surface.tileProvider.imageryLayersUpdatedEvent}},tilesLoaded:{get:function(){return!(0,y.Z)(this._surface)||0===this._surface._tileLoadQueueHigh.length&&0===this._surface._tileLoadQueueMedium.length&&0===this._surface._tileLoadQueueLow.length}},baseColor:{get:function(){return this._surface.tileProvider.baseColor},set:function(e){this._surface.tileProvider.baseColor=e}},clippingPlanes:{get:function(){return this._surface.tileProvider.clippingPlanes},set:function(e){this._surface.tileProvider.clippingPlanes=e}},clippingPolygons:{get:function(){return this._surface.tileProvider.clippingPolygons},set:function(e){this._surface.tileProvider.clippingPolygons=e}},cartographicLimitRectangle:{get:function(){return this._surface.tileProvider.cartographicLimitRectangle},set:function(e){(0,y.Z)(e)||(e=U.Z.clone(U.Z.MAX_VALUE)),this._surface.tileProvider.cartographicLimitRectangle=e}},oceanNormalMapUrl:{get:function(){return this._oceanNormalMapResource.url},set:function(e){this._oceanNormalMapResource.url=e,this._oceanNormalMapResourceDirty=!0}},terrainProvider:{get:function(){return this._terrainProvider},set:function(e){e!==this._terrainProvider&&(this._terrainProvider=e,this._terrainProviderChanged.raiseEvent(e),(0,y.Z)(this._material)&&rR(this))}},terrainProviderChanged:{get:function(){return this._terrainProviderChanged}},tileLoadProgressEvent:{get:function(){return this._surface.tileLoadProgressEvent}},material:{get:function(){return this._material},set:function(e){this._material!==e&&(this._material=e,rR(this))}},undergroundColor:{get:function(){return this._undergroundColor},set:function(e){this._undergroundColor=A.Z.clone(e,this._undergroundColor)}},undergroundColorAlphaByDistance:{get:function(){return this._undergroundColorAlphaByDistance},set:function(e){if((0,y.Z)(e)&&e.far<e.near)throw new v.Z("far distance must be greater than near distance.");this._undergroundColorAlphaByDistance=eA.Z.clone(e,this._undergroundColorAlphaByDistance)}},translucency:{get:function(){return this._translucency}}});let rN=[],rL={start:0,stop:0};rP.prototype.pickWorldCoordinates=function(e,t,i,n){var r;let o,a,s;if(!(0,y.Z)(e))throw new v.Z("ray is required");if(!(0,y.Z)(t))throw new v.Z("scene is required");i=(0,Z.Z)(i,!0);let l=t.mode,c=t.mapProjection;rN.length=0;let u=this._surface._tilesToRender,h=u.length;for(a=0;a<h;++a){let t=(o=u[a]).data;if(!(0,y.Z)(t))continue;let i=t.pickBoundingSphere;if(l!==eB.Z.SCENE3D)t.pickBoundingSphere=i=S.Z.fromRectangleWithHeights2D(o.rectangle,c,t.tileBoundingRegion.minimumHeight,t.tileBoundingRegion.maximumHeight,i),_.Z.fromElements(i.center.z,i.center.x,i.center.y,i.center);else{if(!(0,y.Z)(t.renderedMesh))continue;S.Z.clone(t.tileBoundingRegion.boundingSphere,i)}let n=eC.Z.raySphere(e,i,rL);(0,y.Z)(n)&&rN.push(t)}for(rN.sort((r=e.origin,function(e,t){return S.Z.distanceSquaredTo(e.pickBoundingSphere,r)-S.Z.distanceSquaredTo(t.pickBoundingSphere,r)})),h=rN.length,a=0;a<h&&(s=rN[a].pick(e,t.mode,t.mapProjection,i,n),!(0,y.Z)(s));++a);return s};let rM=new C.Z;rP.prototype.pick=function(e,t,i){if(i=this.pickWorldCoordinates(e,t,!0,i),(0,y.Z)(i)&&t.mode!==eB.Z.SCENE3D){i=_.Z.fromElements(i.y,i.z,i.x,i);let e=t.mapProjection.unproject(i,rM);i=t.globe.ellipsoid.cartographicToCartesian(e,i)}return i};let rF=new _.Z,rz=new _.Z,rB=new C.Z,rU=new eI.Z;function rk(e,t){return(0,y.Z)(e)&&U.Z.contains(e.rectangle,t)?e:void 0}rP.prototype.getHeight=function(e){let t,i;if(!(0,y.Z)(e))throw new v.Z("cartographic is required");let n=this._surface._levelZeroTiles;if(!(0,y.Z)(n))return;let r=n.length;for(i=0;i<r&&(t=n[i],!U.Z.contains(t.rectangle,e));++i);if(i>=r)return;let o=t;for(;(0,y.Z)(t);)t=rk(t._southwestChild,e)||rk(t._southeastChild,e)||rk(t._northwestChild,e)||t._northeastChild,(0,y.Z)(t)&&(0,y.Z)(t.data)&&(0,y.Z)(t.data.renderedMesh)&&(o=t);if(t=o,!(0,y.Z)(t)||!(0,y.Z)(t.data)||!(0,y.Z)(t.data.renderedMesh))return;let a=this._surface._tileProvider.tilingScheme.projection,s=this._surface._tileProvider.tilingScheme.ellipsoid,l=_.Z.fromRadians(e.longitude,e.latitude,0,s,rF),c=s.geodeticSurfaceNormal(l,rU.direction),u=s.getSurfaceNormalIntersectionWithZAxis(l,11500,rU.origin);if(!(0,y.Z)(u)){let e;(0,y.Z)(t.data.tileBoundingRegion)&&(e=t.data.tileBoundingRegion.minimumHeight);let i=Math.min((0,Z.Z)(e,0),-11500),n=_.Z.multiplyByScalar(c,Math.abs(i)+1,rz);_.Z.subtract(l,n,rU.origin)}let h=t.data.pick(rU,void 0,a,!1,rz);if((0,y.Z)(h))return s.cartesianToCartographic(h,rB).height},rP.prototype.update=function(e){this.show&&e.passes.render&&this._surface.update(e)},rP.prototype.beginFrame=function(e){let t=this._surface,i=t.tileProvider,n=this.terrainProvider,r=this.showWaterEffect&&(0,y.Z)(n)&&n.hasWaterMask&&n.hasWaterMask;if(r&&this._oceanNormalMapResourceDirty){this._oceanNormalMapResourceDirty=!1;let t=this._oceanNormalMapResource,i=t.url;if((0,y.Z)(i)){let n=this;t.fetchImage().then(function(t){i===n._oceanNormalMapResource.url&&(n._oceanNormalMap=n._oceanNormalMap&&n._oceanNormalMap.destroy(),n._oceanNormalMap=new eP.Z({context:e.context,source:t}))})}else this._oceanNormalMap=this._oceanNormalMap&&this._oceanNormalMap.destroy()}let o=e.passes,a=e.mode;o.render&&(this.showGroundAtmosphere?this._zoomedOutOceanSpecularIntensity=.4:this._zoomedOutOceanSpecularIntensity=.5,t.maximumScreenSpaceError=this.maximumScreenSpaceError,t.tileCacheSize=this.tileCacheSize,t.loadingDescendantLimit=this.loadingDescendantLimit,t.preloadAncestors=this.preloadAncestors,t.preloadSiblings=this.preloadSiblings,i.terrainProvider=this.terrainProvider,i.lightingFadeOutDistance=this.lightingFadeOutDistance,i.lightingFadeInDistance=this.lightingFadeInDistance,i.nightFadeOutDistance=this.nightFadeOutDistance,i.nightFadeInDistance=this.nightFadeInDistance,i.zoomedOutOceanSpecularIntensity=a===eB.Z.SCENE3D?this._zoomedOutOceanSpecularIntensity:0,i.hasWaterMask=r,i.oceanNormalMap=this._oceanNormalMap,i.enableLighting=this.enableLighting,i.dynamicAtmosphereLighting=this.dynamicAtmosphereLighting,i.dynamicAtmosphereLightingFromSun=this.dynamicAtmosphereLightingFromSun,i.showGroundAtmosphere=this.showGroundAtmosphere,i.atmosphereLightIntensity=this.atmosphereLightIntensity,i.atmosphereRayleighCoefficient=this.atmosphereRayleighCoefficient,i.atmosphereMieCoefficient=this.atmosphereMieCoefficient,i.atmosphereRayleighScaleHeight=this.atmosphereRayleighScaleHeight,i.atmosphereMieScaleHeight=this.atmosphereMieScaleHeight,i.atmosphereMieAnisotropy=this.atmosphereMieAnisotropy,i.shadows=this.shadows,i.hueShift=this.atmosphereHueShift,i.saturationShift=this.atmosphereSaturationShift,i.brightnessShift=this.atmosphereBrightnessShift,i.fillHighlightColor=this.fillHighlightColor,i.showSkirts=this.showSkirts,i.backFaceCulling=this.backFaceCulling,i.vertexShadowDarkness=this.vertexShadowDarkness,i.undergroundColor=this._undergroundColor,i.undergroundColorAlphaByDistance=this._undergroundColorAlphaByDistance,i.lambertDiffuseMultiplier=this.lambertDiffuseMultiplier,t.beginFrame(e))},rP.prototype.render=function(e){this.show&&((0,y.Z)(this._material)&&this._material.update(e.context),this._surface.render(e))},rP.prototype.endFrame=function(e){this.show&&e.passes.render&&this._surface.endFrame(e)},rP.prototype.isDestroyed=function(){return!1},rP.prototype.destroy=function(){return this._surfaceShaderSet=this._surfaceShaderSet&&this._surfaceShaderSet.destroy(),this._surface=this._surface&&this._surface.destroy(),this._oceanNormalMap=this._oceanNormalMap&&this._oceanNormalMap.destroy(),(0,b.Z)(this)};var rV=function(e,t,i,n){this.rightAscension=e,this.declination=t,this.rotation=i,this.rotationRate=n},rH=i(3323);let rG={},rj=new ix.Z;rG.ComputeMoon=function(e,t){(0,y.Z)(e)||(e=ix.Z.now()),rj=ix.Z.addSeconds(e,32.184,rj);let i=ix.Z.totalDays(rj)-2451545,n=i/rH.Z.DAYS_PER_JULIAN_CENTURY,r=(125.045+-.0529921*i)*F.Z.RADIANS_PER_DEGREE,o=(250.089+-.1059842*i)*F.Z.RADIANS_PER_DEGREE,a=(260.008+13.0120009*i)*F.Z.RADIANS_PER_DEGREE,s=(176.625+13.3407154*i)*F.Z.RADIANS_PER_DEGREE,l=(357.529+.9856003*i)*F.Z.RADIANS_PER_DEGREE,c=(311.589+26.4057084*i)*F.Z.RADIANS_PER_DEGREE,u=(134.963+13.064993*i)*F.Z.RADIANS_PER_DEGREE,h=(276.617+.3287146*i)*F.Z.RADIANS_PER_DEGREE,d=(34.226+1.7484877*i)*F.Z.RADIANS_PER_DEGREE,f=(15.134+-.1589763*i)*F.Z.RADIANS_PER_DEGREE,p=(119.743+.0036096*i)*F.Z.RADIANS_PER_DEGREE,m=(239.961+.1643573*i)*F.Z.RADIANS_PER_DEGREE,_=(25.053+12.9590088*i)*F.Z.RADIANS_PER_DEGREE,g=Math.sin(r),Z=Math.sin(o),b=Math.sin(a),v=Math.sin(s),T=Math.sin(c),E=Math.sin(f),x=Math.sin(_),w=Math.cos(r),S=Math.cos(o),C=Math.cos(a),A=Math.cos(s),I=Math.cos(c),O=Math.cos(u),D=Math.cos(f),P=Math.cos(_),R=(269.9949+.0031*n-3.8787*g-.1204*Z+.07*b-.0172*v+.0072*T-.0052*E+.0043*x)*F.Z.RADIANS_PER_DEGREE,N=(66.5392+.013*n+1.5419*w+.0239*S-.0278*C+.0068*A-.0029*I+9e-4*O+8e-4*D-9e-4*P)*F.Z.RADIANS_PER_DEGREE,L=(38.3213+13.17635815*i-14e-13*i*i+3.561*g+.1208*Z-.0642*b+.0158*v+.0252*Math.sin(l)-.0066*T-.0047*Math.sin(u)-.0046*Math.sin(h)+.0028*Math.sin(d)+.0052*E+.004*Math.sin(p)+.0019*Math.sin(m)-.0044*x)*F.Z.RADIANS_PER_DEGREE,M=(13.17635815-2*i*14e-13+-(3.561*w*.0529921)+-(.1208*S*.1059842)-.0642*C*13.0120009+.0158*A*13.3407154+.0252*Math.cos(l)*.9856003-.0066*I*26.4057084-.0047*O*13.064993-.0046*Math.cos(h)*.3287146+.0028*Math.cos(d)*1.7484877+-(.0052*D*.1589763)+.004*Math.cos(p)*.0036096+.0019*Math.cos(m)*.1643573-.0044*P*12.9590088)/86400*F.Z.RADIANS_PER_DEGREE;return(0,y.Z)(t)||(t=new rV),t.rightAscension=R,t.declination=N,t.rotation=L,t.rotationRate=M,t};var rW=i(3186),rq=i(3578);function rY(e){(0,y.Z)(e)&&"function"==typeof e||(e=rG.ComputeMoon),this._computeFunction=e}let rX=new _.Z,r$=new _.Z,rK=new _.Z,rQ=new rW.Z,rJ=new rq.Z;rY.prototype.evaluate=function(e,t){(0,y.Z)(e)||(e=ix.Z.now());let i=this._computeFunction(e),n=function(e,t,i){rX.x=Math.cos(e+F.Z.PI_OVER_TWO),rX.y=Math.sin(e+F.Z.PI_OVER_TWO),rX.z=0;let n=Math.cos(t);rK.x=n*Math.cos(e),rK.y=n*Math.sin(e),rK.z=Math.sin(t);let r=_.Z.cross(rK,rX,r$);return(0,y.Z)(i)||(i=new rW.Z),i[0]=rX.x,i[1]=r.x,i[2]=rK.x,i[3]=rX.y,i[4]=r.y,i[5]=rK.y,i[6]=rX.z,i[7]=r.z,i[8]=rK.z,i}(i.rightAscension,i.declination,t),r=F.Z.zeroToTwoPi(i.rotation),o=rq.Z.fromAxisAngle(_.Z.UNIT_Z,r,rJ),a=rW.Z.fromQuaternion(rq.Z.conjugate(o,o),rQ);return rW.Z.multiply(a,n,n)};var r0=i(9311);let r1={};function r2(e,t){t=ix.Z.addSeconds(e,32.184,t);let i=ix.Z.totalDays(t)-2451545;return t=ix.Z.addSeconds(t,function(e){let t=6.239996+.0172019696544*e;return .001657*Math.sin(t+.01671*Math.sin(t))}(i),t)}let r3=new ix.Z(2451545,0,r0.Z.TAI),r4=F.Z.RADIANS_PER_DEGREE,r5=F.Z.RADIANS_PER_ARCSECOND,r9=new rW.Z;function r8(e,t,i,n,r,o,a){if(i<0&&(i=-i,r+=F.Z.PI),i<0||i>F.Z.PI)throw new v.Z("The inclination is out of range. Inclination must be greater than or equal to zero and less than or equal to Pi radians.");let s=e*(1-t),l=n-r,c=r,u=function(e,t){if(t<0||t>=1)throw new v.Z("eccentricity out of range.");return function(e,t){if(t<0||t>=1)throw new v.Z("eccentricity out of range.");let i=Math.floor(e/F.Z.TWO_PI),n=Math.cos(e-=i*F.Z.TWO_PI)-t,r=Math.atan2(Math.sin(e)*Math.sqrt(1-t*t),n);return r=F.Z.zeroToTwoPi(r),e<0&&(r-=F.Z.TWO_PI),r+=i*F.Z.TWO_PI}(function(e,t){let i;if(t<0||t>=1)throw new v.Z("eccentricity out of range.");let n=Math.floor(e/F.Z.TWO_PI),r=(e-=n*F.Z.TWO_PI)+t*Math.sin(e)/(1-Math.sin(e+t)+Math.sin(e)),o=Number.MAX_VALUE;for(i=0;i<50&&Math.abs(o-r)>r6;++i){let i=(o=r)-t*Math.sin(o)-e,n=1-t*Math.cos(o);r=o-i/n}if(i>=50)throw new v.Z("Kepler equation did not converge");return r+n*F.Z.TWO_PI}(e,t),t)}(o-n,t);if("Hyperbolic"===function(e,t){if(e<0)throw new v.Z("eccentricity cannot be negative.");return e<=0?"Circular":e<1?"Elliptical":e<=1+t?"Parabolic":"Hyperbolic"}(t,0)&&Math.abs(F.Z.negativePiToPi(u))>=Math.acos(-1/t))throw new v.Z("The true anomaly of the hyperbolic orbit lies outside of the bounds of the hyperbola.");!function(e,t,i,n){if(t<0||t>F.Z.PI)throw new v.Z("inclination out of range");let r=Math.cos(e),o=Math.sin(e),a=Math.cos(t),s=Math.sin(t),l=Math.cos(i),c=Math.sin(i);(0,y.Z)(n)?(n[0]=l*r-c*o*a,n[1]=c*r+l*o*a,n[2]=o*s,n[3]=-l*o-c*r*a,n[4]=-c*o+l*r*a,n[5]=r*s,n[6]=c*s,n[7]=-l*s,n[8]=a):n=new rW.Z(l*r-c*o*a,-l*o-c*r*a,c*s,c*r+l*o*a,-c*o+l*r*a,-l*s,o*s,r*s,a)}(l,i,c,r9);let h=s*(1+t),d=Math.cos(u),f=Math.sin(u),p=1+t*d;if(p<=F.Z.Epsilon10)throw new v.Z("elements cannot be converted to cartesian");let m=h/p;return(0,y.Z)(a)?(a.x=m*d,a.y=m*f,a.z=0):a=new _.Z(m*d,m*f,0),rW.Z.multiplyByVector(r9,a,a)}let r6=F.Z.EPSILON8,r7=100.46645683*r4,oe=1295977422.83429*r5,ot=-325*1e-7,oi=-322*1e-7,on=-79*1e-7,or=232*1e-7,oo=-52*1e-7,oa=97*1e-7,os=55*1e-7,ol=-41*1e-7,oc=-105*1e-7,ou=-137*1e-7,oh=258*1e-7,od=35*1e-7,of=-116*1e-7,op=-88*1e-7,om=-112*1e-7,o_=-80*1e-7,og=new ix.Z(0,0,r0.Z.TAI);function oZ(e,t){r2(e,og);let i=(og.dayNumber-r3.dayNumber+(og.secondsOfDay-r3.secondsOfDay)/rH.Z.SECONDS_PER_DAY)/rH.Z.DAYS_PER_JULIAN_CENTURY,n=i*i,r=n*i,o=r*i,a=383397.7725+.004*i,s=.055545526-16e-9*i,l=-.00008*i+.02966*n-42e-6*r-13e-8*o,c=14643420.2669*i-38.2702*n-.045047*r+21301e-8*o,u=-6967919.3631*i+6.3602*n+.007625*r-3586e-8*o,h=1732559343.4847*i-6.391*n+.006588*r-3169e-8*o,d=297.85019547*r4+r5*(1602961601.209*i-6.3706*n+.006593*r-3169e-8*o),f=134.96340251*r4+r5*(1717915923.2178*i+31.8792*n+.051635*r-2447e-7*o),p=357.52910918*r4+r5*(129596581.0481*i-.5532*n+136e-6*r-1149e-8*o),m=310.17137918*r4-r5*(6967051.436*i+6.2068*n+.007618*r-3219e-8*o),_=2*d,g=4*d,Z=6*d,y=2*f,b=3*f,v=4*f,T=2*(93.27209062*r4+r5*(1739527262.8478*i-12.7512*n-.001037*r+417e-8*o));a+=3400.4*Math.cos(_)-635.6*Math.cos(_-f)-235.6*Math.cos(f)+218.1*Math.cos(_-p)+181*Math.cos(_+f),s+=.014216*Math.cos(_-f)+.008551*Math.cos(_-y)-.001383*Math.cos(f)+.001356*Math.cos(_+f)-.001147*Math.cos(g-b)-914e-6*Math.cos(g-y)+869e-6*Math.cos(_-p-f)-627e-6*Math.cos(_)-394e-6*Math.cos(g-v)+282e-6*Math.cos(_-p-y)-279e-6*Math.cos(d-f)-236e-6*Math.cos(y)+231e-6*Math.cos(g)+229e-6*Math.cos(Z-v)-201e-6*Math.cos(y-T),l+=486.26*Math.cos(_-T)-40.13*Math.cos(_)+37.51*Math.cos(T)+25.73*Math.cos(y-T)+19.97*Math.cos(_-p-T),c+=-55609*Math.sin(_-f)-34711*Math.sin(_-y)-9792*Math.sin(f)+9385*Math.sin(g-b)+7505*Math.sin(g-y)+5318*Math.sin(_+f)+3484*Math.sin(g-v)-3417*Math.sin(_-p-f)-2530*Math.sin(Z-v)-2376*Math.sin(_)-2075*Math.sin(_-b)-1883*Math.sin(y)-1736*Math.sin(Z-5*f)+1626*Math.sin(p)-1370*Math.sin(Z-b),u+=-5392*Math.sin(_-T)-540*Math.sin(p)-441*Math.sin(_)+423*Math.sin(T)-288*Math.sin(y-T),h+=-3332.9*Math.sin(_)+1197.4*Math.sin(_-f)-662.5*Math.sin(p)+396.3*Math.sin(f)-218*Math.sin(_-p);let E=2*m,x=3*m;l+=46.997*Math.cos(m)*i-.614*Math.cos(_-T+m)*i+.614*Math.cos(_-T-m)*i-.0297*Math.cos(E)*n-.0335*Math.cos(m)*n+.0012*Math.cos(_-T+E)*n-16e-5*Math.cos(m)*r+4e-5*Math.cos(x)*r+4e-5*Math.cos(E)*r;let w=2.116*Math.sin(m)*i-.111*Math.sin(_-T-m)*i-.0015*Math.sin(m)*n;a*=1e3;let S=5.15668983*r4+l*r5,C=83.35324312*r4+(c+=w)*r5,A=218.31664563*r4+(h+=w)*r5;return r8(a,s,S,C,125.04455501*r4+(u+=-520.77*Math.sin(m)*i+13.66*Math.sin(_-T+m)*i+1.12*Math.sin(_-m)*i-1.06*Math.sin(T-m)*i+.66*Math.sin(E)*n+.371*Math.sin(m)*n-.035*Math.sin(_-T+E)*n-.015*Math.sin(_-T+m)*n+.0014*Math.sin(m)*r-.0011*Math.sin(x)*r-9e-4*Math.sin(E)*r)*r5,A,t)}let oy=new rW.Z(1.0000000000000002,5619723173785822e-31,4690511510146299e-34,-.0000000000000005154129427414611,.9174820620691819,-.39777715593191376,-.000000000000000223970096136568,.39777715593191376,.9174820620691819),ob=new _.Z;r1.computeSunPositionInEarthInertialFrame=function(e,t){var i;return(0,y.Z)(e)||(e=ix.Z.now()),(0,y.Z)(t)||(t=new _.Z),ob=function(e,t){r2(e,og);let i=(og.dayNumber-r3.dayNumber+(og.secondsOfDay-r3.secondsOfDay)/rH.Z.SECONDS_PER_DAY)/(10*rH.Z.DAYS_PER_JULIAN_CENTURY),n=.3595362*i;return r8(149598022260.7121+957426.3679999999*Math.cos(16002*n)+-2243968.05*Math.sin(16002*n)+-2273887.624*Math.cos(21863*n)+-688150.2019999999*Math.sin(21863*n)+927506.7939999999*Math.cos(32004*n)+1017265.516*Math.sin(32004*n)+-119678.29599999999*Math.cos(10931*n)+807828.4979999999*Math.sin(10931*n)+478713.18399999995*Math.cos(14529*n)+209437.01799999998*Math.sin(14529*n)+-613351.267*Math.cos(16368*n)+359034.888*Math.sin(16368*n)+284235.953*Math.cos(15318*n)+-418874.03599999996*Math.sin(15318*n)+-164557.65699999998*Math.cos(32794*n)+329115.31399999995*Math.sin(32794*n),.0167086342-4203654e-10*i,469.97289*r5*i,102.93734808*r4+11612.3529*r5*i,174.87317577*r4-8679.27034*r5*i,r7+oe*i+ot*Math.cos(10*n)+oc*Math.sin(10*n)+oi*Math.cos(16002*n)+ou*Math.sin(16002*n)+on*Math.cos(21863*n)+oh*Math.sin(21863*n)+or*Math.cos(10931*n)+od*Math.sin(10931*n)+oo*Math.cos(1473*n)+of*Math.sin(1473*n)+oa*Math.cos(32004*n)+op*Math.sin(32004*n)+os*Math.cos(4387*n)+om*Math.sin(4387*n)+ol*Math.cos(73*n)+o_*Math.sin(73*n),t)}(e,ob),t=_.Z.negate(ob,t),i=oZ(e,i=ob),_.Z.multiplyByScalar(i,-.01215058143522694,i),_.Z.subtract(t,ob,t),rW.Z.multiplyByVector(oy,t,t),t},r1.computeMoonPositionInEarthInertialFrame=function(e,t){return(0,y.Z)(e)||(e=ix.Z.now()),t=oZ(e,t),rW.Z.multiplyByVector(oy,t,t),t};var ov=i(9439),oT=i(4915),oE="uniform vec3 u_radii;\nuniform vec3 u_oneOverEllipsoidRadiiSquared;\n\nin vec3 v_positionEC;\n\nvec4 computeEllipsoidColor(czm_ray ray, float intersection, float side)\n{\n vec3 positionEC = czm_pointAlongRay(ray, intersection);\n vec3 positionMC = (czm_inverseModelView * vec4(positionEC, 1.0)).xyz;\n vec3 geodeticNormal = normalize(czm_geodeticSurfaceNormal(positionMC, vec3(0.0), u_oneOverEllipsoidRadiiSquared));\n vec3 sphericalNormal = normalize(positionMC / u_radii);\n vec3 normalMC = geodeticNormal * side; // normalized surface normal (always facing the viewer) in model coordinates\n vec3 normalEC = normalize(czm_normal * normalMC); // normalized surface normal in eye coordinates\n\n vec2 st = czm_ellipsoidWgs84TextureCoordinates(sphericalNormal);\n vec3 positionToEyeEC = -positionEC;\n\n czm_materialInput materialInput;\n materialInput.s = st.s;\n materialInput.st = st;\n materialInput.str = (positionMC + u_radii) / u_radii;\n materialInput.normalEC = normalEC;\n materialInput.tangentToEyeMatrix = czm_eastNorthUpToEyeCoordinates(positionMC, normalEC);\n materialInput.positionToEyeEC = positionToEyeEC;\n czm_material material = czm_getMaterial(materialInput);\n\n#ifdef ONLY_SUN_LIGHTING\n return czm_private_phong(normalize(positionToEyeEC), material, czm_sunDirectionEC);\n#else\n return czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC);\n#endif\n}\n\nvoid main()\n{\n // PERFORMANCE_TODO: When dynamic branching is available, compute ratio of maximum and minimum radii\n // in the vertex shader. Only when it is larger than some constant, march along the ray.\n // Otherwise perform one intersection test which will be the common case.\n\n // Test if the ray intersects a sphere with the ellipsoid's maximum radius.\n // For very oblate ellipsoids, using the ellipsoid's radii for an intersection test\n // may cause false negatives. This will discard fragments before marching the ray forward.\n float maxRadius = max(u_radii.x, max(u_radii.y, u_radii.z)) * 1.5;\n vec3 direction = normalize(v_positionEC);\n vec3 ellipsoidCenter = czm_modelView[3].xyz;\n\n float t1 = -1.0;\n float t2 = -1.0;\n\n float b = -2.0 * dot(direction, ellipsoidCenter);\n float c = dot(ellipsoidCenter, ellipsoidCenter) - maxRadius * maxRadius;\n\n float discriminant = b * b - 4.0 * c;\n if (discriminant >= 0.0) {\n t1 = (-b - sqrt(discriminant)) * 0.5;\n t2 = (-b + sqrt(discriminant)) * 0.5;\n }\n\n if (t1 < 0.0 && t2 < 0.0) {\n discard;\n }\n\n float t = min(t1, t2);\n if (t < 0.0) {\n t = 0.0;\n }\n\n // March ray forward to intersection with larger sphere and find\n czm_ray ray = czm_ray(t * direction, direction);\n\n vec3 ellipsoid_inverseRadii = vec3(1.0 / u_radii.x, 1.0 / u_radii.y, 1.0 / u_radii.z);\n\n czm_raySegment intersection = czm_rayEllipsoidIntersectionInterval(ray, ellipsoidCenter, ellipsoid_inverseRadii);\n\n if (czm_isEmpty(intersection))\n {\n discard;\n }\n\n // If the viewer is outside, compute outsideFaceColor, with normals facing outward.\n vec4 outsideFaceColor = (intersection.start != 0.0) ? computeEllipsoidColor(ray, intersection.start, 1.0) : vec4(0.0);\n\n // If the viewer either is inside or can see inside, compute insideFaceColor, with normals facing inward.\n vec4 insideFaceColor = (outsideFaceColor.a < 1.0) ? computeEllipsoidColor(ray, intersection.stop, -1.0) : vec4(0.0);\n\n out_FragColor = mix(insideFaceColor, outsideFaceColor, outsideFaceColor.a);\n out_FragColor.a = 1.0 - (1.0 - insideFaceColor.a) * (1.0 - outsideFaceColor.a);\n\n#if (defined(WRITE_DEPTH) && (__VERSION__ == 300 || defined(GL_EXT_frag_depth)))\n t = (intersection.start != 0.0) ? intersection.start : intersection.stop;\n vec3 positionEC = czm_pointAlongRay(ray, t);\n vec4 positionCC = czm_projection * vec4(positionEC, 1.0);\n#ifdef LOG_DEPTH\n czm_writeLogDepth(1.0 + positionCC.w);\n#else\n float z = positionCC.z / positionCC.w;\n\n float n = czm_depthRange.near;\n float f = czm_depthRange.far;\n\n gl_FragDepth = (z * (f - n) + f + n) * 0.5;\n#endif\n#endif\n}\n",ox="in vec3 position;\n\nuniform vec3 u_radii;\n\nout vec3 v_positionEC;\n\nvoid main()\n{\n // In the vertex data, the cube goes from (-1.0, -1.0, -1.0) to (1.0, 1.0, 1.0) in model coordinates.\n // Scale to consider the radii. We could also do this once on the CPU when using the BoxGeometry,\n // but doing it here allows us to change the radii without rewriting the vertex data, and\n // allows all ellipsoids to reuse the same vertex data.\n vec4 p = vec4(u_radii * position, 1.0);\n\n v_positionEC = (czm_modelView * p).xyz; // position in eye coordinates\n gl_Position = czm_modelViewProjection * p; // position in clip coordinates\n\n // With multi-frustum, when the ellipsoid primitive is positioned on the intersection of two frustums\n // and close to terrain, the terrain (writes depth) in the closest frustum can overwrite part of the\n // ellipsoid (does not write depth) that was rendered in the farther frustum.\n //\n // Here, we clamp the depth in the vertex shader to avoid being overwritten; however, this creates\n // artifacts since some fragments can be alpha blended twice. This is solved by only rendering\n // the ellipsoid in the closest frustum to the viewer.\n gl_Position.z = clamp(gl_Position.z, czm_depthRange.near, czm_depthRange.far);\n\n czm_vertexLogDepth();\n}\n",ow=i(7048),oS=i(3547);let oC={position:0};function oA(e){e=(0,Z.Z)(e,Z.Z.EMPTY_OBJECT),this.center=_.Z.clone((0,Z.Z)(e.center,_.Z.ZERO)),this._center=new _.Z,this.radii=_.Z.clone(e.radii),this._radii=new _.Z,this._oneOverEllipsoidRadiiSquared=new _.Z,this._boundingSphere=new S.Z,this.modelMatrix=z.Z.clone((0,Z.Z)(e.modelMatrix,z.Z.IDENTITY)),this._modelMatrix=new z.Z,this._computedModelMatrix=new z.Z,this.show=(0,Z.Z)(e.show,!0),this.material=(0,Z.Z)(e.material,oS.Z.fromType(oS.Z.ColorType)),this._material=void 0,this._translucent=void 0,this.id=e.id,this._id=void 0,this.debugShowBoundingVolume=(0,Z.Z)(e.debugShowBoundingVolume,!1),this.onlySunLighting=(0,Z.Z)(e.onlySunLighting,!1),this._onlySunLighting=!1,this._depthTestEnabled=(0,Z.Z)(e.depthTestEnabled,!0),this._useLogDepth=!1,this._sp=void 0,this._rs=void 0,this._va=void 0,this._pickSP=void 0,this._pickId=void 0,this._colorCommand=new e3.Z({owner:(0,Z.Z)(e._owner,this)}),this._pickCommand=new e3.Z({owner:(0,Z.Z)(e._owner,this),pickOnly:!0});let t=this;this._uniforms={u_radii:function(){return t.radii},u_oneOverEllipsoidRadiiSquared:function(){return t._oneOverEllipsoidRadiiSquared}},this._pickUniforms={czm_pickColor:function(){return t._pickId.color}}}function oI(e){let t=(e=(0,Z.Z)(e,Z.Z.EMPTY_OBJECT)).textureUrl;(0,y.Z)(t)||(t=(0,m.Z)("Assets/Textures/moonSmall.jpg")),this.show=(0,Z.Z)(e.show,!0),this.textureUrl=t,this._ellipsoid=(0,Z.Z)(e.ellipsoid,T.Z.MOON),this.onlySunLighting=(0,Z.Z)(e.onlySunLighting,!0),this._ellipsoidPrimitive=new oA({radii:this.ellipsoid.radii,material:oS.Z.fromType(oS.Z.ImageType),depthTestEnabled:!1,_owner:this}),this._ellipsoidPrimitive.material.translucent=!1,this._axes=new rY}oA.prototype.update=function(e){let t,i;if(!this.show||e.mode!==eB.Z.SCENE3D||!(0,y.Z)(this.center)||!(0,y.Z)(this.radii))return;if(!(0,y.Z)(this.material))throw new v.Z("this.material must be defined.");let n=e.context,r=this.material.isTranslucent(),o=this._translucent!==r;(!(0,y.Z)(this._rs)||o)&&(this._translucent=r,this._rs=e5.Z.fromCache({cull:{enabled:!0,face:ow.Z.FRONT},depthTest:{enabled:this._depthTestEnabled},depthMask:!r&&n.fragmentDepth,blending:r?e8.Z.ALPHA_BLEND:void 0})),(0,y.Z)(this._va)||(this._va=function(e){let t=e.cache.ellipsoidPrimitive_vertexArray;if((0,y.Z)(t))return t;let i=ov.Z.createGeometry(ov.Z.fromDimensions({dimensions:new _.Z(2,2,2),vertexFormat:oT.Z.POSITION_ONLY}));return t=e9.Z.fromGeometry({context:e,geometry:i,attributeLocations:oC,bufferUsage:e1.Z.STATIC_DRAW,interleave:!0}),e.cache.ellipsoidPrimitive_vertexArray=t,t}(n));let a=!1,s=this.radii;if(!_.Z.equals(this._radii,s)){_.Z.clone(s,this._radii);let e=this._oneOverEllipsoidRadiiSquared;e.x=1/(s.x*s.x),e.y=1/(s.y*s.y),e.z=1/(s.z*s.z),a=!0}z.Z.equals(this.modelMatrix,this._modelMatrix)&&_.Z.equals(this.center,this._center)||(z.Z.clone(this.modelMatrix,this._modelMatrix),_.Z.clone(this.center,this._center),z.Z.multiplyByTranslation(this.modelMatrix,this.center,this._computedModelMatrix),a=!0),a&&(_.Z.clone(_.Z.ZERO,this._boundingSphere.center),this._boundingSphere.radius=_.Z.maximumComponent(s),S.Z.transform(this._boundingSphere,this._computedModelMatrix,this._boundingSphere));let l=this._material!==this.material;this._material=this.material,this._material.update(n);let c=this.onlySunLighting!==this._onlySunLighting;this._onlySunLighting=this.onlySunLighting;let u=e.useLogDepth,h=this._useLogDepth!==u;this._useLogDepth=u;let d=this._colorCommand;(l||c||o||h)&&(t=new eD.Z({sources:[ox]}),i=new eD.Z({sources:[this.material.shaderSource,oE]}),this.onlySunLighting&&i.defines.push("ONLY_SUN_LIGHTING"),!r&&n.fragmentDepth&&i.defines.push("WRITE_DEPTH"),this._useLogDepth&&(t.defines.push("LOG_DEPTH"),i.defines.push("LOG_DEPTH")),this._sp=eL.Z.replaceCache({context:n,shaderProgram:this._sp,vertexShaderSource:t,fragmentShaderSource:i,attributeLocations:oC}),d.vertexArray=this._va,d.renderState=this._rs,d.shaderProgram=this._sp,d.uniformMap=(0,eW.Z)(this._uniforms,this.material._uniforms),d.executeInClosestFrustum=r);let f=e.commandList,p=e.passes;if(p.render&&(d.boundingVolume=this._boundingSphere,d.debugShowBoundingVolume=this.debugShowBoundingVolume,d.modelMatrix=this._computedModelMatrix,d.pass=r?e4.Z.TRANSLUCENT:e4.Z.OPAQUE,f.push(d)),p.pick){let e=this._pickCommand;(0,y.Z)(this._pickId)&&this._id===this.id||(this._id=this.id,this._pickId=this._pickId&&this._pickId.destroy(),this._pickId=n.createPickId({primitive:this,id:this.id})),(l||c||!(0,y.Z)(this._pickSP)||h)&&(t=new eD.Z({sources:[ox]}),i=new eD.Z({sources:[this.material.shaderSource,oE],pickColorQualifier:"uniform"}),this.onlySunLighting&&i.defines.push("ONLY_SUN_LIGHTING"),!r&&n.fragmentDepth&&i.defines.push("WRITE_DEPTH"),this._useLogDepth&&(t.defines.push("LOG_DEPTH"),i.defines.push("LOG_DEPTH")),this._pickSP=eL.Z.replaceCache({context:n,shaderProgram:this._pickSP,vertexShaderSource:t,fragmentShaderSource:i,attributeLocations:oC}),e.vertexArray=this._va,e.renderState=this._rs,e.shaderProgram=this._pickSP,e.uniformMap=(0,eW.Z)((0,eW.Z)(this._uniforms,this._pickUniforms),this.material._uniforms),e.executeInClosestFrustum=r),e.boundingVolume=this._boundingSphere,e.modelMatrix=this._computedModelMatrix,e.pass=r?e4.Z.TRANSLUCENT:e4.Z.OPAQUE,f.push(e)}},oA.prototype.isDestroyed=function(){return!1},oA.prototype.destroy=function(){return this._sp=this._sp&&this._sp.destroy(),this._pickSP=this._pickSP&&this._pickSP.destroy(),this._pickId=this._pickId&&this._pickId.destroy(),(0,b.Z)(this)},Object.defineProperties(oI.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});let oO=new rW.Z,oD=new rW.Z,oP=new _.Z,oR=[];oI.prototype.update=function(e){if(!this.show)return;let t=this._ellipsoidPrimitive;t.material.uniforms.image=this.textureUrl,t.onlySunLighting=this.onlySunLighting;let i=e.time;(0,y.Z)(et.Z.computeIcrfToFixedMatrix(i,oO))||et.Z.computeTemeToPseudoFixedMatrix(i,oO);let n=this._axes.evaluate(i,oD);rW.Z.transpose(n,n),rW.Z.multiply(oO,n,n);let r=r1.computeMoonPositionInEarthInertialFrame(i,oP);rW.Z.multiplyByVector(oO,r,r),z.Z.fromRotationTranslation(n,r,t.modelMatrix);let o=e.commandList;return e.commandList=oR,oR.length=0,t.update(e),e.commandList=o,1===oR.length?oR[0]:void 0},oI.prototype.isDestroyed=function(){return!1},oI.prototype.destroy=function(){return this._ellipsoidPrimitive=this._ellipsoidPrimitive&&this._ellipsoidPrimitive.destroy(),(0,b.Z)(this)};var oN=i(1373),oL=i(530),oM=i(8615),oF=i(8385),oz=i(9386);let oB=[],oU=[];var ok=function(e,t,i){if(!(0,y.Z)(e))throw new v.Z("array is required.");if(!(0,y.Z)(t))throw new v.Z("comparator is required.");let n=e.length,r=Math.ceil(.5*n);oB.length=r,oU.length=r,function e(t,i,n,r,o){if(r>=o)return;let a=Math.floor((r+o)*.5);e(t,i,n,r,a),e(t,i,n,a+1,o),function(e,t,i,n,r,o){let a,s;let l=r-n+1,c=o-r;for(a=0;a<l;++a)oB[a]=e[n+a];for(s=0;s<c;++s)oU[s]=e[r+s+1];a=0,s=0;for(let r=n;r<=o;++r){let n=oB[a],o=oU[s];a<l&&(s>=c||0>=t(n,o,i))?(e[r]=n,++a):s<c&&(e[r]=o,++s)}}(t,i,n,r,a,o)}(e,t,i,0,n-1),oB.length=0,oU.length=0};function oV(e,t){if(!(0,y.Z)(e))throw new v.Z("occluderBoundingSphere is required.");if(!(0,y.Z)(t))throw new v.Z("camera position is required.");this._occluderPosition=_.Z.clone(e.center),this._occluderRadius=e.radius,this._horizonDistance=0,this._horizonPlaneNormal=void 0,this._horizonPlanePosition=void 0,this._cameraPosition=void 0,this.cameraPosition=t}let oH=new _.Z;Object.defineProperties(oV.prototype,{position:{get:function(){return this._occluderPosition}},radius:{get:function(){return this._occluderRadius}},cameraPosition:{set:function(e){let t,i,n;if(!(0,y.Z)(e))throw new v.Z("cameraPosition is required.");e=_.Z.clone(e,this._cameraPosition);let r=_.Z.subtract(this._occluderPosition,e,oH),o=_.Z.magnitudeSquared(r),a=this._occluderRadius*this._occluderRadius;if(o>a){t=Math.sqrt(o-a),o=1/Math.sqrt(o),i=_.Z.multiplyByScalar(r,o,oH);let s=t*t*o;n=_.Z.add(e,_.Z.multiplyByScalar(i,s,oH),oH)}else t=Number.MAX_VALUE;this._horizonDistance=t,this._horizonPlaneNormal=i,this._horizonPlanePosition=n,this._cameraPosition=e}}}),oV.fromBoundingSphere=function(e,t,i){if(!(0,y.Z)(e))throw new v.Z("occluderBoundingSphere is required.");if(!(0,y.Z)(t))throw new v.Z("camera position is required.");return(0,y.Z)(i)?(_.Z.clone(e.center,i._occluderPosition),i._occluderRadius=e.radius,i.cameraPosition=t,i):new oV(e,t)};let oG=new _.Z;oV.prototype.isPointVisible=function(e){if(this._horizonDistance!==Number.MAX_VALUE){let t=_.Z.subtract(e,this._occluderPosition,oG),i=this._occluderRadius;if((i=_.Z.magnitudeSquared(t)-i*i)>0)return i=Math.sqrt(i)+this._horizonDistance,t=_.Z.subtract(e,this._cameraPosition,t),i*i>_.Z.magnitudeSquared(t)}return!1};let oj=new _.Z;oV.prototype.isBoundingSphereVisible=function(e){let t=_.Z.clone(e.center,oj),i=e.radius;if(this._horizonDistance!==Number.MAX_VALUE){let e=_.Z.subtract(t,this._occluderPosition,oG),n=this._occluderRadius-i;if(n=_.Z.magnitudeSquared(e)-n*n,i<this._occluderRadius)return n>0&&(n=Math.sqrt(n)+this._horizonDistance,e=_.Z.subtract(t,this._cameraPosition,e),n*n+i*i>_.Z.magnitudeSquared(e));if(n>0){e=_.Z.subtract(t,this._cameraPosition,e);let r=_.Z.magnitudeSquared(e),o=this._occluderRadius*this._occluderRadius,a=i*i;return(this._horizonDistance*this._horizonDistance+o)*a>r*o||(n=Math.sqrt(n)+this._horizonDistance)*n+a>r}return!0}return!1};let oW=new _.Z;oV.prototype.computeVisibility=function(e){if(!(0,y.Z)(e))throw new v.Z("occludeeBS is required.");let t=_.Z.clone(e.center),i=e.radius;if(i>this._occluderRadius)return eJ.FULL;if(this._horizonDistance!==Number.MAX_VALUE){let e=_.Z.subtract(t,this._occluderPosition,oW),n=this._occluderRadius-i,r=_.Z.magnitudeSquared(e);if((n=r-n*n)>0){n=Math.sqrt(n)+this._horizonDistance,e=_.Z.subtract(t,this._cameraPosition,e);let o=_.Z.magnitudeSquared(e);return n*n+i*i<o?eJ.NONE:(n=r-(n=this._occluderRadius+i)*n)>0?o<(n=Math.sqrt(n)+this._horizonDistance)*n+i*i?eJ.FULL:eJ.PARTIAL:(e=_.Z.subtract(t,this._horizonPlanePosition,e),_.Z.dot(e,this._horizonPlaneNormal)>-i?eJ.PARTIAL:eJ.FULL)}}return eJ.NONE};let oq=new _.Z;oV.computeOccludeePoint=function(e,t,i){let n;if(!(0,y.Z)(e))throw new v.Z("occluderBoundingSphere is required.");if(!(0,y.Z)(i))throw new v.Z("positions is required.");if(0===i.length)throw new v.Z("positions must contain at least one element");let r=_.Z.clone(t),o=_.Z.clone(e.center),a=e.radius,s=i.length;if(_.Z.equals(o,t))throw new v.Z("occludeePosition must be different than occluderBoundingSphere.center");let l=_.Z.normalize(_.Z.subtract(r,o,oq),oq),c=-_.Z.dot(l,o),u=oV._anyRotationVector(o,l,c),h=oV._horizonToPlaneNormalDotProduct(e,l,c,u,i[0]);if(!h)return;for(let t=1;t<s;++t){if(!(n=oV._horizonToPlaneNormalDotProduct(e,l,c,u,i[t])))return;n<h&&(h=n)}if(h<.0017453283658983088)return;let d=a/h;return _.Z.add(o,_.Z.multiplyByScalar(l,d,oq),oq)};let oY=[];oV.computeOccludeePointFromRectangle=function(e,t){if(!(0,y.Z)(e))throw new v.Z("rectangle is required.");t=(0,Z.Z)(t,T.Z.WGS84);let i=U.Z.subsample(e,t,0,oY),n=S.Z.fromPoints(i),r=_.Z.ZERO;if(!_.Z.equals(r,n.center))return oV.computeOccludeePoint(new S.Z(r,t.minimumRadius),n.center,i)};let oX=new _.Z;oV._anyRotationVector=function(e,t,i){let n;let r=_.Z.abs(t,oX),o=r.x>r.y?0:1;(0===o&&r.z>r.x||1===o&&r.z>r.y)&&(o=2);let a=new _.Z;0===o?(r.x=e.x,r.y=e.y+1,r.z=e.z+1,n=_.Z.UNIT_X):1===o?(r.x=e.x+1,r.y=e.y,r.z=e.z+1,n=_.Z.UNIT_Y):(r.x=e.x+1,r.y=e.y+1,r.z=e.z,n=_.Z.UNIT_Z);let s=-((_.Z.dot(t,r)+i)/_.Z.dot(t,n));return _.Z.normalize(_.Z.subtract(_.Z.add(r,_.Z.multiplyByScalar(n,s,a),r),e,r),r)};let o$=new _.Z;oV._rotationVector=function(e,t,i,n,r){let o=_.Z.subtract(n,e,o$);if(o=_.Z.normalize(o,o),.9999999847691291>_.Z.dot(t,o)){let e=_.Z.cross(t,o,o);if(_.Z.magnitude(e)>F.Z.EPSILON13)return _.Z.normalize(e,new _.Z)}return r};let oK=new _.Z,oQ=new _.Z,oJ=new _.Z,o0=new _.Z;function o1(e){e=(0,Z.Z)(e,Z.Z.EMPTY_OBJECT),this.left=e.left,this._left=void 0,this.right=e.right,this._right=void 0,this.top=e.top,this._top=void 0,this.bottom=e.bottom,this._bottom=void 0,this.near=(0,Z.Z)(e.near,1),this._near=this.near,this.far=(0,Z.Z)(e.far,5e8),this._far=this.far,this._cullingVolume=new oM.Z,this._perspectiveMatrix=new z.Z,this._infinitePerspective=new z.Z}function o2(e){if(!(0,y.Z)(e.right)||!(0,y.Z)(e.left)||!(0,y.Z)(e.top)||!(0,y.Z)(e.bottom)||!(0,y.Z)(e.near)||!(0,y.Z)(e.far))throw new v.Z("right, left, top, bottom, near, or far parameters are not set.");let t=e.top,i=e.bottom,n=e.right,r=e.left,o=e.near,a=e.far;if(t!==e._top||i!==e._bottom||r!==e._left||n!==e._right||o!==e._near||a!==e._far){if(e.near<=0||e.near>e.far)throw new v.Z("near must be greater than zero and less than far.");e._left=r,e._right=n,e._top=t,e._bottom=i,e._near=o,e._far=a,e._perspectiveMatrix=z.Z.computePerspectiveOffCenter(r,n,i,t,o,a,e._perspectiveMatrix),e._infinitePerspective=z.Z.computeInfinitePerspectiveOffCenter(r,n,i,t,o,e._infinitePerspective)}}oV._horizonToPlaneNormalDotProduct=function(e,t,i,n,r){let o=_.Z.clone(r,oK),a=_.Z.clone(e.center,oQ),s=e.radius,l=_.Z.subtract(a,o,oJ),c=_.Z.magnitudeSquared(l),u=s*s;if(c<u)return!1;let h=c-u,d=Math.sqrt(h),f=1/Math.sqrt(c)*d*d;l=_.Z.normalize(l,l);let p=_.Z.add(o,_.Z.multiplyByScalar(l,f,o0),o0),m=this._rotationVector(a,t,i,o,n),g=_.Z.fromElements(m.x*m.x*l.x+(m.x*m.y-m.z)*l.y+(m.x*m.z+m.y)*l.z,(m.x*m.y+m.z)*l.x+m.y*m.y*l.y+(m.y*m.z-m.x)*l.z,(m.x*m.z-m.y)*l.x+(m.y*m.z+m.x)*l.y+m.z*m.z*l.z,oK);g=_.Z.normalize(g,g);let Z=_.Z.multiplyByScalar(g,Math.sqrt(h-f*f),oK);m=_.Z.normalize(_.Z.subtract(_.Z.add(p,Z,oJ),a,oJ),oJ);let y=_.Z.dot(t,m);m=_.Z.normalize(_.Z.subtract(_.Z.subtract(p,Z,m),a,m),m);let b=_.Z.dot(t,m);return y<b?y:b},Object.defineProperties(o1.prototype,{projectionMatrix:{get:function(){return o2(this),this._perspectiveMatrix}},infiniteProjectionMatrix:{get:function(){return o2(this),this._infinitePerspective}}});let o3=new _.Z,o4=new _.Z,o5=new _.Z,o9=new _.Z;function o8(e){e=(0,Z.Z)(e,Z.Z.EMPTY_OBJECT),this._offCenterFrustum=new o1,this.fov=e.fov,this._fov=void 0,this._fovy=void 0,this._sseDenominator=void 0,this.aspectRatio=e.aspectRatio,this._aspectRatio=void 0,this.near=(0,Z.Z)(e.near,1),this._near=this.near,this.far=(0,Z.Z)(e.far,5e8),this._far=this.far,this.xOffset=(0,Z.Z)(e.xOffset,0),this._xOffset=this.xOffset,this.yOffset=(0,Z.Z)(e.yOffset,0),this._yOffset=this.yOffset}function o6(e){if(!(0,y.Z)(e.fov)||!(0,y.Z)(e.aspectRatio)||!(0,y.Z)(e.near)||!(0,y.Z)(e.far))throw new v.Z("fov, aspectRatio, near, or far parameters are not set.");let t=e._offCenterFrustum;if(e.fov!==e._fov||e.aspectRatio!==e._aspectRatio||e.near!==e._near||e.far!==e._far||e.xOffset!==e._xOffset||e.yOffset!==e._yOffset){if(e.fov<0||e.fov>=Math.PI)throw new v.Z("fov must be in the range [0, PI).");if(e.aspectRatio<0)throw new v.Z("aspectRatio must be positive.");if(e.near<0||e.near>e.far)throw new v.Z("near must be greater than zero and less than far.");e._aspectRatio=e.aspectRatio,e._fov=e.fov,e._fovy=e.aspectRatio<=1?e.fov:2*Math.atan(Math.tan(.5*e.fov)/e.aspectRatio),e._near=e.near,e._far=e.far,e._sseDenominator=2*Math.tan(.5*e._fovy),e._xOffset=e.xOffset,e._yOffset=e.yOffset,t.top=e.near*Math.tan(.5*e._fovy),t.bottom=-t.top,t.right=e.aspectRatio*t.top,t.left=-t.right,t.near=e.near,t.far=e.far,t.right+=e.xOffset,t.left+=e.xOffset,t.top+=e.yOffset,t.bottom+=e.yOffset}}o1.prototype.computeCullingVolume=function(e,t,i){if(!(0,y.Z)(e))throw new v.Z("position is required.");if(!(0,y.Z)(t))throw new v.Z("direction is required.");if(!(0,y.Z)(i))throw new v.Z("up is required.");let n=this._cullingVolume.planes,r=this.top,o=this.bottom,a=this.right,s=this.left,l=this.near,c=this.far,u=_.Z.cross(t,i,o3);_.Z.multiplyByScalar(t,l,o4),_.Z.add(e,o4,o4),_.Z.multiplyByScalar(t,c,o5),_.Z.add(e,o5,o5),_.Z.multiplyByScalar(u,s,o9),_.Z.add(o4,o9,o9),_.Z.subtract(o9,e,o9),_.Z.normalize(o9,o9),_.Z.cross(o9,i,o9),_.Z.normalize(o9,o9);let h=n[0];return(0,y.Z)(h)||(h=n[0]=new eH.Z),h.x=o9.x,h.y=o9.y,h.z=o9.z,h.w=-_.Z.dot(o9,e),_.Z.multiplyByScalar(u,a,o9),_.Z.add(o4,o9,o9),_.Z.subtract(o9,e,o9),_.Z.cross(i,o9,o9),_.Z.normalize(o9,o9),h=n[1],(0,y.Z)(h)||(h=n[1]=new eH.Z),h.x=o9.x,h.y=o9.y,h.z=o9.z,h.w=-_.Z.dot(o9,e),_.Z.multiplyByScalar(i,o,o9),_.Z.add(o4,o9,o9),_.Z.subtract(o9,e,o9),_.Z.cross(u,o9,o9),_.Z.normalize(o9,o9),h=n[2],(0,y.Z)(h)||(h=n[2]=new eH.Z),h.x=o9.x,h.y=o9.y,h.z=o9.z,h.w=-_.Z.dot(o9,e),_.Z.multiplyByScalar(i,r,o9),_.Z.add(o4,o9,o9),_.Z.subtract(o9,e,o9),_.Z.cross(o9,u,o9),_.Z.normalize(o9,o9),h=n[3],(0,y.Z)(h)||(h=n[3]=new eH.Z),h.x=o9.x,h.y=o9.y,h.z=o9.z,h.w=-_.Z.dot(o9,e),h=n[4],(0,y.Z)(h)||(h=n[4]=new eH.Z),h.x=t.x,h.y=t.y,h.z=t.z,h.w=-_.Z.dot(t,o4),_.Z.negate(t,o9),h=n[5],(0,y.Z)(h)||(h=n[5]=new eH.Z),h.x=o9.x,h.y=o9.y,h.z=o9.z,h.w=-_.Z.dot(o9,o5),this._cullingVolume},o1.prototype.getPixelDimensions=function(e,t,i,n,r){if(o2(this),!(0,y.Z)(e)||!(0,y.Z)(t))throw new v.Z("Both drawingBufferWidth and drawingBufferHeight are required.");if(e<=0)throw new v.Z("drawingBufferWidth must be greater than zero.");if(t<=0)throw new v.Z("drawingBufferHeight must be greater than zero.");if(!(0,y.Z)(i))throw new v.Z("distance is required.");if(!(0,y.Z)(n))throw new v.Z("pixelRatio is required");if(n<=0)throw new v.Z("pixelRatio must be greater than zero.");if(!(0,y.Z)(r))throw new v.Z("A result object is required.");let o=1/this.near,a=this.top*o,s=2*n*i*a/t,l=2*n*i*(a=this.right*o)/e;return r.x=l,r.y=s,r},o1.prototype.clone=function(e){return(0,y.Z)(e)||(e=new o1),e.right=this.right,e.left=this.left,e.top=this.top,e.bottom=this.bottom,e.near=this.near,e.far=this.far,e._left=void 0,e._right=void 0,e._top=void 0,e._bottom=void 0,e._near=void 0,e._far=void 0,e},o1.prototype.equals=function(e){return(0,y.Z)(e)&&e instanceof o1&&this.right===e.right&&this.left===e.left&&this.top===e.top&&this.bottom===e.bottom&&this.near===e.near&&this.far===e.far},o1.prototype.equalsEpsilon=function(e,t,i){return e===this||(0,y.Z)(e)&&e instanceof o1&&F.Z.equalsEpsilon(this.right,e.right,t,i)&&F.Z.equalsEpsilon(this.left,e.left,t,i)&&F.Z.equalsEpsilon(this.top,e.top,t,i)&&F.Z.equalsEpsilon(this.bottom,e.bottom,t,i)&&F.Z.equalsEpsilon(this.near,e.near,t,i)&&F.Z.equalsEpsilon(this.far,e.far,t,i)},o8.packedLength=6,o8.pack=function(e,t,i){return D.Z.typeOf.object("value",e),D.Z.defined("array",t),i=(0,Z.Z)(i,0),t[i++]=e.fov,t[i++]=e.aspectRatio,t[i++]=e.near,t[i++]=e.far,t[i++]=e.xOffset,t[i]=e.yOffset,t},o8.unpack=function(e,t,i){return D.Z.defined("array",e),t=(0,Z.Z)(t,0),(0,y.Z)(i)||(i=new o8),i.fov=e[t++],i.aspectRatio=e[t++],i.near=e[t++],i.far=e[t++],i.xOffset=e[t++],i.yOffset=e[t],i},Object.defineProperties(o8.prototype,{projectionMatrix:{get:function(){return o6(this),this._offCenterFrustum.projectionMatrix}},infiniteProjectionMatrix:{get:function(){return o6(this),this._offCenterFrustum.infiniteProjectionMatrix}},fovy:{get:function(){return o6(this),this._fovy}},sseDenominator:{get:function(){return o6(this),this._sseDenominator}},offCenterFrustum:{get:function(){return o6(this),this._offCenterFrustum}}}),o8.prototype.computeCullingVolume=function(e,t,i){return o6(this),this._offCenterFrustum.computeCullingVolume(e,t,i)},o8.prototype.getPixelDimensions=function(e,t,i,n,r){return o6(this),this._offCenterFrustum.getPixelDimensions(e,t,i,n,r)},o8.prototype.clone=function(e){return(0,y.Z)(e)||(e=new o8),e.aspectRatio=this.aspectRatio,e.fov=this.fov,e.near=this.near,e.far=this.far,e._aspectRatio=void 0,e._fov=void 0,e._near=void 0,e._far=void 0,this._offCenterFrustum.clone(e._offCenterFrustum),e},o8.prototype.equals=function(e){return!!(0,y.Z)(e)&&e instanceof o8&&(o6(this),o6(e),this.fov===e.fov&&this.aspectRatio===e.aspectRatio&&this._offCenterFrustum.equals(e._offCenterFrustum))},o8.prototype.equalsEpsilon=function(e,t,i){return!!(0,y.Z)(e)&&e instanceof o8&&(o6(this),o6(e),F.Z.equalsEpsilon(this.fov,e.fov,t,i)&&F.Z.equalsEpsilon(this.aspectRatio,e.aspectRatio,t,i)&&this._offCenterFrustum.equalsEpsilon(e._offCenterFrustum,t,i))};var o7=i(8041),ae=i(7992),at="in vec4 position;\nin vec2 textureCoordinates;\n\nout vec2 v_textureCoordinates;\n\nvoid main() \n{\n gl_Position = position;\n v_textureCoordinates = textureCoordinates;\n}\n",ai=i(1680);function an(e){this._context=e}let ar=new e3.Z({primitiveType:eK.Z.TRIANGLES}),ao=new ae.Z({color:new A.Z(0,0,0,0)});an.prototype.execute=function(e){var t;if(D.Z.defined("computeCommand",e),(0,y.Z)(e.preExecute)&&e.preExecute(e),!(0,y.Z)(e.fragmentShaderSource)&&!(0,y.Z)(e.shaderProgram))throw new v.Z("computeCommand.fragmentShaderSource or computeCommand.shaderProgram is required.");D.Z.defined("computeCommand.outputTexture",e.outputTexture);let i=e.outputTexture,n=i.width,r=i.height,o=this._context,a=(0,y.Z)(e.vertexArray)?e.vertexArray:o.getViewportQuadVertexArray(),s=(0,y.Z)(e.shaderProgram)?e.shaderProgram:(t=e.fragmentShaderSource,eL.Z.fromCache({context:o,vertexShaderSource:at,fragmentShaderSource:t,attributeLocations:{position:0,textureCoordinates:1}})),l=new ai.Z({context:o,colorTextures:[i],destroyAttachments:!1}),u=((0,y.Z)(c)&&c.viewport.width===n&&c.viewport.height===r||(c=e5.Z.fromCache({viewport:new oN.Z(0,0,n,r)})),c),h=e.uniformMap;ao.framebuffer=l,ao.renderState=u,ao.execute(o),ar.vertexArray=a,ar.renderState=u,ar.shaderProgram=s,ar.uniformMap=h,ar.framebuffer=l,ar.execute(o),l.destroy(),!e.persists&&(s.destroy(),(0,y.Z)(e.vertexArray)&&a.destroy()),(0,y.Z)(e.postExecute)&&e.postExecute(i)},an.prototype.isDestroyed=function(){return!1},an.prototype.destroy=function(){return(0,b.Z)(this)};var aa=i(3580),as=i(3086),al=i(2601),ac=i(512),au=i(9441),ah=function(e){this.context=e,this.framebuffer=void 0,this.blendingEnabled=void 0,this.scissorTest=void 0,this.viewport=void 0};function ad(e){this._context=e,this._shaders={},this._numberOfShaders=0,this._shadersToRelease={}}function af(e,t){let i=t.derivedKeywords,n=i.length;for(let r=0;r<n;++r){let n=i[r]+t.keyword,o=e._shaders[n];af(e,o)}delete e._shaders[t.keyword],t.shaderProgram.finalDestroy()}function ap(){this._textures={},this._numberOfTextures=0,this._texturesToRelease={}}Object.defineProperties(ad.prototype,{numberOfShaders:{get:function(){return this._numberOfShaders}}}),ad.prototype.replaceShaderProgram=function(e){return(0,y.Z)(e.shaderProgram)&&e.shaderProgram.destroy(),this.getShaderProgram(e)},ad.prototype.getShaderProgram=function(e){let t,i=e.vertexShaderSource,n=e.fragmentShaderSource,r=e.attributeLocations;"string"==typeof i&&(i=new eD.Z({sources:[i]})),"string"==typeof n&&(n=new eD.Z({sources:[n]}));let o=i.getCacheKey(),a=n.getCacheKey(),s=(0,y.Z)(r)?function(e){let t=Object.keys(e).sort();return JSON.stringify(e,t)}(r):"",l=`${o}:${a}:${s}`;if((0,y.Z)(this._shaders[l]))t=this._shaders[l],delete this._shadersToRelease[l];else{let e=this._context,o=i.createCombinedVertexShader(e),a=n.createCombinedFragmentShader(e),s=new eL.Z({gl:e._gl,logShaderCompilation:e.logShaderCompilation,debugShaders:e.debugShaders,vertexShaderSource:i,vertexShaderText:o,fragmentShaderSource:n,fragmentShaderText:a,attributeLocations:r});t={cache:this,shaderProgram:s,keyword:l,derivedKeywords:[],count:0},s._cachedShader=t,this._shaders[l]=t,++this._numberOfShaders}return++t.count,t.shaderProgram},ad.prototype.replaceDerivedShaderProgram=function(e,t,i){let n=e._cachedShader,r=t+n.keyword,o=this._shaders[r];if((0,y.Z)(o)){af(this,o);let e=n.derivedKeywords.indexOf(t);e>-1&&n.derivedKeywords.splice(e,1)}return this.createDerivedShaderProgram(e,t,i)},ad.prototype.getDerivedShaderProgram=function(e,t){let i=t+e._cachedShader.keyword,n=this._shaders[i];if((0,y.Z)(n))return n.shaderProgram},ad.prototype.createDerivedShaderProgram=function(e,t,i){let n=e._cachedShader,r=t+n.keyword,o=i.vertexShaderSource,a=i.fragmentShaderSource,s=i.attributeLocations;"string"==typeof o&&(o=new eD.Z({sources:[o]})),"string"==typeof a&&(a=new eD.Z({sources:[a]}));let l=this._context,c=o.createCombinedVertexShader(l),u=a.createCombinedFragmentShader(l),h=new eL.Z({gl:l._gl,logShaderCompilation:l.logShaderCompilation,debugShaders:l.debugShaders,vertexShaderSource:o,vertexShaderText:c,fragmentShaderSource:a,fragmentShaderText:u,attributeLocations:s}),d={cache:this,shaderProgram:h,keyword:r,derivedKeywords:[],count:0};return n.derivedKeywords.push(t),h._cachedShader=d,this._shaders[r]=d,h},ad.prototype.destroyReleasedShaderPrograms=function(){let e=this._shadersToRelease;for(let t in e)e.hasOwnProperty(t)&&(af(this,e[t]),--this._numberOfShaders);this._shadersToRelease={}},ad.prototype.releaseShaderProgram=function(e){if((0,y.Z)(e)){let t=e._cachedShader;t&&0==--t.count&&(this._shadersToRelease[t.keyword]=t)}},ad.prototype.isDestroyed=function(){return!1},ad.prototype.destroy=function(){let e=this._shaders;for(let t in e)e.hasOwnProperty(t)&&e[t].shaderProgram.finalDestroy();return(0,b.Z)(this)},Object.defineProperties(ap.prototype,{numberOfTextures:{get:function(){return this._numberOfTextures}}}),ap.prototype.getTexture=function(e){let t=this._textures[e];if((0,y.Z)(t))return delete this._texturesToRelease[e],++t.count,t.texture},ap.prototype.addTexture=function(e,t){let i={texture:t,count:1};t.finalDestroy=t.destroy;let n=this;t.destroy=function(){0==--i.count&&(n._texturesToRelease[e]=i)},this._textures[e]=i,++this._numberOfTextures},ap.prototype.destroyReleasedTextures=function(){let e=this._texturesToRelease;for(let t in e)if(e.hasOwnProperty(t)){let i=e[t];delete this._textures[t],i.texture.finalDestroy(),--this._numberOfTextures}this._texturesToRelease={}},ap.prototype.isDestroyed=function(){return!1},ap.prototype.destroy=function(){let e=this._textures;for(let t in e)e.hasOwnProperty(t)&&e[t].texture.finalDestroy();return(0,b.Z)(this)};var am=i(3149),a_=function(e){e=(0,Z.Z)(e,Z.Z.EMPTY_OBJECT),this.color=A.Z.clone((0,Z.Z)(e.color,A.Z.WHITE)),this.intensity=(0,Z.Z)(e.intensity,2)};function ag(){this.globeDepthTexture=void 0,this.gamma=void 0,this._viewport=new oN.Z,this._viewportCartesian4=new eH.Z,this._viewportDirty=!1,this._viewportOrthographicMatrix=z.Z.clone(z.Z.IDENTITY),this._viewportTransformation=z.Z.clone(z.Z.IDENTITY),this._model=z.Z.clone(z.Z.IDENTITY),this._view=z.Z.clone(z.Z.IDENTITY),this._inverseView=z.Z.clone(z.Z.IDENTITY),this._projection=z.Z.clone(z.Z.IDENTITY),this._infiniteProjection=z.Z.clone(z.Z.IDENTITY),this._entireFrustum=new L.Z,this._currentFrustum=new L.Z,this._frustumPlanes=new eH.Z,this._farDepthFromNearPlusOne=void 0,this._log2FarDepthFromNearPlusOne=void 0,this._oneOverLog2FarDepthFromNearPlusOne=void 0,this._frameState=void 0,this._temeToPseudoFixed=rW.Z.clone(z.Z.IDENTITY),this._view3DDirty=!0,this._view3D=new z.Z,this._inverseView3DDirty=!0,this._inverseView3D=new z.Z,this._inverseModelDirty=!0,this._inverseModel=new z.Z,this._inverseTransposeModelDirty=!0,this._inverseTransposeModel=new rW.Z,this._viewRotation=new rW.Z,this._inverseViewRotation=new rW.Z,this._viewRotation3D=new rW.Z,this._inverseViewRotation3D=new rW.Z,this._inverseProjectionDirty=!0,this._inverseProjection=new z.Z,this._modelViewDirty=!0,this._modelView=new z.Z,this._modelView3DDirty=!0,this._modelView3D=new z.Z,this._modelViewRelativeToEyeDirty=!0,this._modelViewRelativeToEye=new z.Z,this._inverseModelViewDirty=!0,this._inverseModelView=new z.Z,this._inverseModelView3DDirty=!0,this._inverseModelView3D=new z.Z,this._viewProjectionDirty=!0,this._viewProjection=new z.Z,this._inverseViewProjectionDirty=!0,this._inverseViewProjection=new z.Z,this._modelViewProjectionDirty=!0,this._modelViewProjection=new z.Z,this._inverseModelViewProjectionDirty=!0,this._inverseModelViewProjection=new z.Z,this._modelViewProjectionRelativeToEyeDirty=!0,this._modelViewProjectionRelativeToEye=new z.Z,this._modelViewInfiniteProjectionDirty=!0,this._modelViewInfiniteProjection=new z.Z,this._normalDirty=!0,this._normal=new rW.Z,this._normal3DDirty=!0,this._normal3D=new rW.Z,this._inverseNormalDirty=!0,this._inverseNormal=new rW.Z,this._inverseNormal3DDirty=!0,this._inverseNormal3D=new rW.Z,this._encodedCameraPositionMCDirty=!0,this._encodedCameraPositionMC=new am.Z,this._cameraPosition=new _.Z,this._sunPositionWC=new _.Z,this._sunPositionColumbusView=new _.Z,this._sunDirectionWC=new _.Z,this._sunDirectionEC=new _.Z,this._moonDirectionEC=new _.Z,this._lightDirectionWC=new _.Z,this._lightDirectionEC=new _.Z,this._lightColor=new _.Z,this._lightColorHdr=new _.Z,this._pass=void 0,this._mode=void 0,this._mapProjection=void 0,this._ellipsoid=void 0,this._cameraDirection=new _.Z,this._cameraRight=new _.Z,this._cameraUp=new _.Z,this._frustum2DWidth=0,this._eyeHeight=0,this._eyeHeight2D=new L.Z,this._eyeEllipsoidNormalEC=new _.Z,this._eyeEllipsoidCurvature=new L.Z,this._modelToEnu=new z.Z,this._enuToModel=new z.Z,this._pixelRatio=1,this._orthographicIn3D=!1,this._backgroundColor=new A.Z,this._brdfLut=void 0,this._environmentMap=void 0,this._sphericalHarmonicCoefficients=void 0,this._specularEnvironmentMaps=void 0,this._specularEnvironmentMapsDimensions=new L.Z,this._specularEnvironmentMapsMaximumLOD=void 0,this._fogDensity=void 0,this._fogMinimumBrightness=void 0,this._atmosphereHsbShift=void 0,this._atmosphereLightIntensity=void 0,this._atmosphereRayleighCoefficient=new _.Z,this._atmosphereRayleighScaleHeight=new _.Z,this._atmosphereMieCoefficient=new _.Z,this._atmosphereMieScaleHeight=void 0,this._atmosphereMieAnisotropy=void 0,this._atmosphereDynamicLighting=void 0,this._invertClassificationColor=void 0,this._splitPosition=0,this._pixelSizePerMeter=void 0,this._geometricToleranceOverMeter=void 0,this._minimumDisableDepthTestDistance=void 0}Object.defineProperties(ag.prototype,{frameState:{get:function(){return this._frameState}},viewport:{get:function(){return this._viewport},set:function(e){if(!oN.Z.equals(e,this._viewport)){oN.Z.clone(e,this._viewport);let t=this._viewport,i=this._viewportCartesian4;i.x=t.x,i.y=t.y,i.z=t.width,i.w=t.height,this._viewportDirty=!0}}},viewportCartesian4:{get:function(){return this._viewportCartesian4}},viewportOrthographic:{get:function(){return ax(this),this._viewportOrthographicMatrix}},viewportTransformation:{get:function(){return ax(this),this._viewportTransformation}},model:{get:function(){return this._model},set:function(e){z.Z.clone(e,this._model),this._modelView3DDirty=!0,this._inverseModelView3DDirty=!0,this._inverseModelDirty=!0,this._inverseTransposeModelDirty=!0,this._modelViewDirty=!0,this._inverseModelViewDirty=!0,this._modelViewRelativeToEyeDirty=!0,this._inverseModelViewDirty=!0,this._modelViewProjectionDirty=!0,this._inverseModelViewProjectionDirty=!0,this._modelViewProjectionRelativeToEyeDirty=!0,this._modelViewInfiniteProjectionDirty=!0,this._normalDirty=!0,this._inverseNormalDirty=!0,this._normal3DDirty=!0,this._inverseNormal3DDirty=!0,this._encodedCameraPositionMCDirty=!0}},inverseModel:{get:function(){return this._inverseModelDirty&&(this._inverseModelDirty=!1,z.Z.inverse(this._model,this._inverseModel)),this._inverseModel}},inverseTransposeModel:{get:function(){let e=this._inverseTransposeModel;return this._inverseTransposeModelDirty&&(this._inverseTransposeModelDirty=!1,z.Z.getMatrix3(this.inverseModel,e),rW.Z.transpose(e,e)),e}},view:{get:function(){return this._view}},view3D:{get:function(){return aN(this),this._view3D}},viewRotation:{get:function(){return aN(this),this._viewRotation}},viewRotation3D:{get:function(){return aN(this),this._viewRotation3D}},inverseView:{get:function(){return this._inverseView}},inverseView3D:{get:function(){return aL(this),this._inverseView3D}},inverseViewRotation:{get:function(){return this._inverseViewRotation}},inverseViewRotation3D:{get:function(){return aL(this),this._inverseViewRotation3D}},projection:{get:function(){return this._projection}},inverseProjection:{get:function(){return this._inverseProjectionDirty&&(this._inverseProjectionDirty=!1,this._mode===eB.Z.SCENE2D||this._mode===eB.Z.MORPHING||this._orthographicIn3D?z.Z.clone(z.Z.ZERO,this._inverseProjection):z.Z.inverse(this._projection,this._inverseProjection)),this._inverseProjection}},infiniteProjection:{get:function(){return this._infiniteProjection}},modelView:{get:function(){return this._modelViewDirty&&(this._modelViewDirty=!1,z.Z.multiplyTransformation(this._view,this._model,this._modelView)),this._modelView}},modelView3D:{get:function(){return this._modelView3DDirty&&(this._modelView3DDirty=!1,z.Z.multiplyTransformation(this.view3D,this._model,this._modelView3D)),this._modelView3D}},modelViewRelativeToEye:{get:function(){return function(e){if(e._modelViewRelativeToEyeDirty){e._modelViewRelativeToEyeDirty=!1;let t=e.modelView,i=e._modelViewRelativeToEye;i[0]=t[0],i[1]=t[1],i[2]=t[2],i[3]=t[3],i[4]=t[4],i[5]=t[5],i[6]=t[6],i[7]=t[7],i[8]=t[8],i[9]=t[9],i[10]=t[10],i[11]=t[11],i[12]=0,i[13]=0,i[14]=0,i[15]=t[15]}}(this),this._modelViewRelativeToEye}},inverseModelView:{get:function(){return this._inverseModelViewDirty&&(this._inverseModelViewDirty=!1,z.Z.inverse(this.modelView,this._inverseModelView)),this._inverseModelView}},inverseModelView3D:{get:function(){return this._inverseModelView3DDirty&&(this._inverseModelView3DDirty=!1,z.Z.inverse(this.modelView3D,this._inverseModelView3D)),this._inverseModelView3D}},viewProjection:{get:function(){return this._viewProjectionDirty&&(this._viewProjectionDirty=!1,z.Z.multiply(this._projection,this._view,this._viewProjection)),this._viewProjection}},inverseViewProjection:{get:function(){return this._inverseViewProjectionDirty&&(this._inverseViewProjectionDirty=!1,z.Z.inverse(this.viewProjection,this._inverseViewProjection)),this._inverseViewProjection}},modelViewProjection:{get:function(){return this._modelViewProjectionDirty&&(this._modelViewProjectionDirty=!1,z.Z.multiply(this._projection,this.modelView,this._modelViewProjection)),this._modelViewProjection}},inverseModelViewProjection:{get:function(){return this._inverseModelViewProjectionDirty&&(this._inverseModelViewProjectionDirty=!1,z.Z.inverse(this.modelViewProjection,this._inverseModelViewProjection)),this._inverseModelViewProjection}},modelViewProjectionRelativeToEye:{get:function(){return this._modelViewProjectionRelativeToEyeDirty&&(this._modelViewProjectionRelativeToEyeDirty=!1,z.Z.multiply(this._projection,this.modelViewRelativeToEye,this._modelViewProjectionRelativeToEye)),this._modelViewProjectionRelativeToEye}},modelViewInfiniteProjection:{get:function(){return this._modelViewInfiniteProjectionDirty&&(this._modelViewInfiniteProjectionDirty=!1,z.Z.multiply(this._infiniteProjection,this.modelView,this._modelViewInfiniteProjection)),this._modelViewInfiniteProjection}},normal:{get:function(){return function(e){if(e._normalDirty){e._normalDirty=!1;let t=e._normal;z.Z.getMatrix3(e.inverseModelView,t),rW.Z.transpose(t,t)}}(this),this._normal}},normal3D:{get:function(){return function(e){if(e._normal3DDirty){e._normal3DDirty=!1;let t=e._normal3D;z.Z.getMatrix3(e.inverseModelView3D,t),rW.Z.transpose(t,t)}}(this),this._normal3D}},inverseNormal:{get:function(){return function(e){if(e._inverseNormalDirty){e._inverseNormalDirty=!1;let t=e._inverseNormal;z.Z.getMatrix3(e.modelView,t),rW.Z.transpose(t,t)}}(this),this._inverseNormal}},inverseNormal3D:{get:function(){return function(e){if(e._inverseNormal3DDirty){e._inverseNormal3DDirty=!1;let t=e._inverseNormal3D;z.Z.getMatrix3(e.modelView3D,t),rW.Z.transpose(t,t)}}(this),this._inverseNormal3D}},entireFrustum:{get:function(){return this._entireFrustum}},currentFrustum:{get:function(){return this._currentFrustum}},frustumPlanes:{get:function(){return this._frustumPlanes}},farDepthFromNearPlusOne:{get:function(){return this._farDepthFromNearPlusOne}},log2FarDepthFromNearPlusOne:{get:function(){return this._log2FarDepthFromNearPlusOne}},oneOverLog2FarDepthFromNearPlusOne:{get:function(){return this._oneOverLog2FarDepthFromNearPlusOne}},eyeHeight:{get:function(){return this._eyeHeight}},eyeHeight2D:{get:function(){return this._eyeHeight2D}},eyeEllipsoidNormalEC:{get:function(){return this._eyeEllipsoidNormalEC}},eyeEllipsoidCurvature:{get:function(){return this._eyeEllipsoidCurvature}},modelToEnu:{get:function(){return this._modelToEnu}},enuToModel:{get:function(){return this._enuToModel}},sunPositionWC:{get:function(){return this._sunPositionWC}},sunPositionColumbusView:{get:function(){return this._sunPositionColumbusView}},sunDirectionWC:{get:function(){return this._sunDirectionWC}},sunDirectionEC:{get:function(){return this._sunDirectionEC}},moonDirectionEC:{get:function(){return this._moonDirectionEC}},lightDirectionWC:{get:function(){return this._lightDirectionWC}},lightDirectionEC:{get:function(){return this._lightDirectionEC}},lightColor:{get:function(){return this._lightColor}},lightColorHdr:{get:function(){return this._lightColorHdr}},encodedCameraPositionMCHigh:{get:function(){return aS(this),this._encodedCameraPositionMC.high}},encodedCameraPositionMCLow:{get:function(){return aS(this),this._encodedCameraPositionMC.low}},temeToPseudoFixedMatrix:{get:function(){return this._temeToPseudoFixed}},pixelRatio:{get:function(){return this._pixelRatio}},fogDensity:{get:function(){return this._fogDensity}},fogMinimumBrightness:{get:function(){return this._fogMinimumBrightness}},atmosphereHsbShift:{get:function(){return this._atmosphereHsbShift}},atmosphereLightIntensity:{get:function(){return this._atmosphereLightIntensity}},atmosphereRayleighCoefficient:{get:function(){return this._atmosphereRayleighCoefficient}},atmosphereRayleighScaleHeight:{get:function(){return this._atmosphereRayleighScaleHeight}},atmosphereMieCoefficient:{get:function(){return this._atmosphereMieCoefficient}},atmosphereMieScaleHeight:{get:function(){return this._atmosphereMieScaleHeight}},atmosphereMieAnisotropy:{get:function(){return this._atmosphereMieAnisotropy}},atmosphereDynamicLighting:{get:function(){return this._atmosphereDynamicLighting}},geometricToleranceOverMeter:{get:function(){return this._geometricToleranceOverMeter}},pass:{get:function(){return this._pass}},backgroundColor:{get:function(){return this._backgroundColor}},brdfLut:{get:function(){return this._brdfLut}},environmentMap:{get:function(){return this._environmentMap}},sphericalHarmonicCoefficients:{get:function(){return this._sphericalHarmonicCoefficients}},specularEnvironmentMaps:{get:function(){return this._specularEnvironmentMaps}},specularEnvironmentMapsDimensions:{get:function(){return this._specularEnvironmentMapsDimensions}},specularEnvironmentMapsMaximumLOD:{get:function(){return this._specularEnvironmentMapsMaximumLOD}},splitPosition:{get:function(){return this._splitPosition}},minimumDisableDepthTestDistance:{get:function(){return this._minimumDisableDepthTestDistance}},invertClassificationColor:{get:function(){return this._invertClassificationColor}},orthographicIn3D:{get:function(){return this._orthographicIn3D}},ellipsoid:{get:function(){return(0,Z.Z)(this._ellipsoid,T.Z.WGS84)}}});let aZ=new _.Z,ay=new z.Z,ab=new rW.Z,av=new C.Z;ag.prototype.updateCamera=function(e){var t,i;t=e.viewMatrix,z.Z.clone(t,this._view),z.Z.getMatrix3(t,this._viewRotation),this._view3DDirty=!0,this._inverseView3DDirty=!0,this._modelViewDirty=!0,this._modelView3DDirty=!0,this._modelViewRelativeToEyeDirty=!0,this._inverseModelViewDirty=!0,this._inverseModelView3DDirty=!0,this._viewProjectionDirty=!0,this._inverseViewProjectionDirty=!0,this._modelViewProjectionDirty=!0,this._modelViewProjectionRelativeToEyeDirty=!0,this._modelViewInfiniteProjectionDirty=!0,this._normalDirty=!0,this._inverseNormalDirty=!0,this._normal3DDirty=!0,this._inverseNormal3DDirty=!0,i=e.inverseViewMatrix,z.Z.clone(i,this._inverseView),z.Z.getMatrix3(i,this._inverseViewRotation),function(e,t){let i;_.Z.clone(t.positionWC,e._cameraPosition),_.Z.clone(t.directionWC,e._cameraDirection),_.Z.clone(t.rightWC,e._cameraRight),_.Z.clone(t.upWC,e._cameraUp);let n=e._ellipsoid,r=t.positionCartographic;if((0,y.Z)(r)?(e._eyeHeight=r.height,e._eyeEllipsoidNormalEC=n.geodeticSurfaceNormalCartographic(r,e._eyeEllipsoidNormalEC),i=_.Z.fromRadians(r.longitude,r.latitude,0,n,aZ)):(e._eyeHeight=-n.maximumRadius,_.Z.magnitude(t.positionWC)>0&&(e._eyeEllipsoidNormalEC=_.Z.normalize(t.positionWC,e._eyeEllipsoidNormalEC)),i=n.scaleToGeodeticSurface(t.positionWC,aZ)),e._encodedCameraPositionMCDirty=!0,!(0,y.Z)(i))return;e._eyeEllipsoidNormalEC=rW.Z.multiplyByVector(e._viewRotation,e._eyeEllipsoidNormalEC,e._eyeEllipsoidNormalEC);let o=et.Z.eastNorthUpToFixedFrame(i,n,ay);e._enuToModel=z.Z.multiplyTransformation(e.inverseModel,o,e._enuToModel),e._modelToEnu=z.Z.inverseTransformation(e._enuToModel,e._modelToEnu),F.Z.equalsEpsilon(n._radii.x,n._radii.y,F.Z.EPSILON15)&&(e._eyeEllipsoidCurvature=n.getLocalCurvature(i,e._eyeEllipsoidCurvature))}(this,e),this._entireFrustum.x=e.frustum.near,this._entireFrustum.y=e.frustum.far,this.updateFrustum(e.frustum),this._orthographicIn3D=this._mode!==eB.Z.SCENE2D&&e.frustum instanceof e$.Z},ag.prototype.updateFrustum=function(e){var t,i;t=e.projectionMatrix,z.Z.clone(t,this._projection),this._inverseProjectionDirty=!0,this._viewProjectionDirty=!0,this._inverseViewProjectionDirty=!0,this._modelViewProjectionDirty=!0,this._modelViewProjectionRelativeToEyeDirty=!0,(0,y.Z)(e.infiniteProjectionMatrix)&&(i=e.infiniteProjectionMatrix,z.Z.clone(i,this._infiniteProjection),this._modelViewInfiniteProjectionDirty=!0),this._currentFrustum.x=e.near,this._currentFrustum.y=e.far,this._farDepthFromNearPlusOne=e.far-e.near+1,this._log2FarDepthFromNearPlusOne=F.Z.log2(this._farDepthFromNearPlusOne),this._oneOverLog2FarDepthFromNearPlusOne=1/this._log2FarDepthFromNearPlusOne;let n=e.offCenterFrustum;(0,y.Z)(n)&&(e=n),this._frustumPlanes.x=e.top,this._frustumPlanes.y=e.bottom,this._frustumPlanes.z=e.left,this._frustumPlanes.w=e.right},ag.prototype.updatePass=function(e){this._pass=e};let aT=[],aE=new a_;function ax(e){if(e._viewportDirty){let t=e._viewport;z.Z.computeOrthographicOffCenter(t.x,t.x+t.width,t.y,t.y+t.height,0,1,e._viewportOrthographicMatrix),z.Z.computeViewportTransformation(t,0,1,e._viewportTransformation),e._viewportDirty=!1}}ag.prototype.update=function(e){let t;this._mode=e.mode,this._mapProjection=e.mapProjection,this._ellipsoid=e.mapProjection.ellipsoid,this._pixelRatio=e.pixelRatio;let i=e.camera;this.updateCamera(i),e.mode===eB.Z.SCENE2D?(this._frustum2DWidth=i.frustum.right-i.frustum.left,this._eyeHeight2D.x=.5*this._frustum2DWidth,this._eyeHeight2D.y=this._eyeHeight2D.x*this._eyeHeight2D.x):(this._frustum2DWidth=0,this._eyeHeight2D.x=0,this._eyeHeight2D.y=0),function(e,t){(0,y.Z)(et.Z.computeIcrfToFixedMatrix(t.time,ab))||(ab=et.Z.computeTemeToPseudoFixedMatrix(t.time,ab));let i=r1.computeSunPositionInEarthInertialFrame(t.time,e._sunPositionWC);rW.Z.multiplyByVector(ab,i,i),_.Z.normalize(i,e._sunDirectionWC),i=rW.Z.multiplyByVector(e.viewRotation3D,i,e._sunDirectionEC),_.Z.normalize(i,i),i=r1.computeMoonPositionInEarthInertialFrame(t.time,e._moonDirectionEC),rW.Z.multiplyByVector(ab,i,i),rW.Z.multiplyByVector(e.viewRotation3D,i,i),_.Z.normalize(i,i);let n=t.mapProjection,r=n.ellipsoid.cartesianToCartographic(e._sunPositionWC,av);n.project(r,e._sunPositionColumbusView)}(this,e);let n=(0,Z.Z)(e.light,aE);n instanceof a_?(this._lightDirectionWC=_.Z.clone(this._sunDirectionWC,this._lightDirectionWC),this._lightDirectionEC=_.Z.clone(this._sunDirectionEC,this._lightDirectionEC)):(this._lightDirectionWC=_.Z.normalize(_.Z.negate(n.direction,this._lightDirectionWC),this._lightDirectionWC),this._lightDirectionEC=rW.Z.multiplyByVector(this.viewRotation3D,this._lightDirectionWC,this._lightDirectionEC));let r=n.color,o=_.Z.fromElements(r.red,r.green,r.blue,this._lightColorHdr);o=_.Z.multiplyByScalar(o,n.intensity,o);let a=_.Z.maximumComponent(o);a>1?_.Z.divideByScalar(o,a,this._lightColor):_.Z.clone(o,this._lightColor);let s=e.brdfLutGenerator,l=(0,y.Z)(s)?s.colorTexture:void 0;this._brdfLut=l,this._environmentMap=(0,Z.Z)(e.environmentMap,e.context.defaultCubeMap),this._sphericalHarmonicCoefficients=(0,Z.Z)(e.sphericalHarmonicCoefficients,aT),this._specularEnvironmentMaps=e.specularEnvironmentMaps,this._specularEnvironmentMapsMaximumLOD=e.specularEnvironmentMapsMaximumLOD,(0,y.Z)(this._specularEnvironmentMaps)&&L.Z.clone(this._specularEnvironmentMaps.dimensions,this._specularEnvironmentMapsDimensions),this._fogDensity=e.fog.density,this._fogMinimumBrightness=e.fog.minimumBrightness;let c=e.atmosphere;(0,y.Z)(c)&&(this._atmosphereHsbShift=_.Z.fromElements(c.hueShift,c.saturationShift,c.brightnessShift,this._atmosphereHsbShift),this._atmosphereLightIntensity=c.lightIntensity,this._atmosphereRayleighCoefficient=_.Z.clone(c.rayleighCoefficient,this._atmosphereRayleighCoefficient),this._atmosphereRayleighScaleHeight=c.rayleighScaleHeight,this._atmosphereMieCoefficient=_.Z.clone(c.mieCoefficient,this._atmosphereMieCoefficient),this._atmosphereMieScaleHeight=c.mieScaleHeight,this._atmosphereMieAnisotropy=c.mieAnisotropy,this._atmosphereDynamicLighting=c.dynamicLighting),this._invertClassificationColor=e.invertClassificationColor,this._frameState=e,this._temeToPseudoFixed=et.Z.computeTemeToPseudoFixedMatrix(e.time,this._temeToPseudoFixed),this._splitPosition=e.splitPosition*e.context.drawingBufferWidth;let u=i.frustum.fov,h=this._viewport;t=(0,y.Z)(u)?h.height>h.width?2*Math.tan(.5*u)/h.height:2*Math.tan(.5*u)/h.width:1/Math.max(h.width,h.height),this._geometricToleranceOverMeter=t*e.maximumScreenSpaceError,A.Z.clone(e.backgroundColor,this._backgroundColor),this._minimumDisableDepthTestDistance=e.minimumDisableDepthTestDistance,this._minimumDisableDepthTestDistance*=this._minimumDisableDepthTestDistance,this._minimumDisableDepthTestDistance===Number.POSITIVE_INFINITY&&(this._minimumDisableDepthTestDistance=-1)};let aw=new _.Z;function aS(e){e._encodedCameraPositionMCDirty&&(e._encodedCameraPositionMCDirty=!1,z.Z.multiplyByPoint(e.inverseModel,e._cameraPosition,aw),am.Z.fromCartesian(aw,e._encodedCameraPositionMC))}let aC=new _.Z,aA=new _.Z,aI=new _.Z,aO=new _.Z,aD=new C.Z,aP=new _.Z,aR=new z.Z;function aN(e){e._view3DDirty&&(e._mode===eB.Z.SCENE3D?z.Z.clone(e._view,e._view3D):function(e,t,i,n,r,o,a,s){aC.x=e.y,aC.y=e.z,aC.z=e.x,aA.x=i.y,aA.y=i.z,aA.z=i.x,aI.x=n.y,aI.y=n.z,aI.z=n.x,aO.x=t.y,aO.y=t.z,aO.z=t.x,o===eB.Z.SCENE2D&&(aC.z=.5*r);let l=a.unproject(aC,aD);l.longitude=F.Z.clamp(l.longitude,-Math.PI,Math.PI),l.latitude=F.Z.clamp(l.latitude,-F.Z.PI_OVER_TWO,F.Z.PI_OVER_TWO);let c=a.ellipsoid,u=c.cartographicToCartesian(l,aP),h=et.Z.eastNorthUpToFixedFrame(u,c,aR);return z.Z.multiplyByPointAsVector(h,aA,aA),z.Z.multiplyByPointAsVector(h,aI,aI),z.Z.multiplyByPointAsVector(h,aO,aO),(0,y.Z)(s)||(s=new z.Z),s[0]=aA.x,s[1]=aI.x,s[2]=-aO.x,s[3]=0,s[4]=aA.y,s[5]=aI.y,s[6]=-aO.y,s[7]=0,s[8]=aA.z,s[9]=aI.z,s[10]=-aO.z,s[11]=0,s[12]=-_.Z.dot(aA,u),s[13]=-_.Z.dot(aI,u),s[14]=_.Z.dot(aO,u),s[15]=1,s}(e._cameraPosition,e._cameraDirection,e._cameraRight,e._cameraUp,e._frustum2DWidth,e._mode,e._mapProjection,e._view3D),z.Z.getMatrix3(e._view3D,e._viewRotation3D),e._view3DDirty=!1)}function aL(e){e._inverseView3DDirty&&(z.Z.inverseTransformation(e.view3D,e._inverseView3D),z.Z.getMatrix3(e._inverseView3D,e._inverseViewRotation3D),e._inverseView3DDirty=!1)}function aM(e,t){let i,n,r,o,a,s,l,c,u,h;D.Z.defined("canvas",e);let{getWebGLStub:d,requestWebgl1:f,webgl:p={},allowTextureFilterAnisotropic:m=!0}=(0,Z.Z)(t,{});p.alpha=(0,Z.Z)(p.alpha,!1),p.stencil=(0,Z.Z)(p.stencil,!0),p.powerPreference=(0,Z.Z)(p.powerPreference,"high-performance");let _=(0,y.Z)(d)?d(e,p):function(e,t,i){if("undefined"==typeof WebGLRenderingContext)throw new tT.Z("The browser does not support WebGL. Visit http://get.webgl.org.");let n="undefined"!=typeof WebGL2RenderingContext;i||n||(i=!0);let r=i?"webgl":"webgl2",o=e.getContext(r,t);if(!(0,y.Z)(o))throw new tT.Z("The browser supports WebGL, but initialization failed.");return o}(e,p,f),g="undefined"!=typeof WebGL2RenderingContext&&_ instanceof WebGL2RenderingContext;this._canvas=e,this._originalGLContext=_,this._gl=_,this._webgl2=g,this._id=(0,oL.Z)(),this.validateFramebuffer=!1,this.validateShaderProgram=!1,this.logShaderCompilation=!1,this._throwOnWebGLError=!1,this._shaderCache=new ad(this),this._textureCache=new ap,this._stencilBits=_.getParameter(_.STENCIL_BITS),e2.Z._maximumCombinedTextureImageUnits=_.getParameter(_.MAX_COMBINED_TEXTURE_IMAGE_UNITS),e2.Z._maximumCubeMapSize=_.getParameter(_.MAX_CUBE_MAP_TEXTURE_SIZE),e2.Z._maximumFragmentUniformVectors=_.getParameter(_.MAX_FRAGMENT_UNIFORM_VECTORS),e2.Z._maximumTextureImageUnits=_.getParameter(_.MAX_TEXTURE_IMAGE_UNITS),e2.Z._maximumRenderbufferSize=_.getParameter(_.MAX_RENDERBUFFER_SIZE),e2.Z._maximumTextureSize=_.getParameter(_.MAX_TEXTURE_SIZE),e2.Z._maximumVaryingVectors=_.getParameter(_.MAX_VARYING_VECTORS),e2.Z._maximumVertexAttributes=_.getParameter(_.MAX_VERTEX_ATTRIBS),e2.Z._maximumVertexTextureImageUnits=_.getParameter(_.MAX_VERTEX_TEXTURE_IMAGE_UNITS),e2.Z._maximumVertexUniformVectors=_.getParameter(_.MAX_VERTEX_UNIFORM_VECTORS),e2.Z._maximumSamples=this._webgl2?_.getParameter(_.MAX_SAMPLES):0;let b=_.getParameter(_.ALIASED_LINE_WIDTH_RANGE);e2.Z._minimumAliasedLineWidth=b[0],e2.Z._maximumAliasedLineWidth=b[1];let v=_.getParameter(_.ALIASED_POINT_SIZE_RANGE);e2.Z._minimumAliasedPointSize=v[0],e2.Z._maximumAliasedPointSize=v[1];let T=_.getParameter(_.MAX_VIEWPORT_DIMS);e2.Z._maximumViewportWidth=T[0],e2.Z._maximumViewportHeight=T[1];let E=_.getShaderPrecisionFormat(_.FRAGMENT_SHADER,_.HIGH_FLOAT);e2.Z._highpFloatSupported=0!==E.precision;let x=_.getShaderPrecisionFormat(_.FRAGMENT_SHADER,_.HIGH_INT);e2.Z._highpIntSupported=0!==x.rangeMax,this._antialias=_.getContextAttributes().antialias,this._standardDerivatives=!!az(_,["OES_standard_derivatives"]),this._blendMinmax=!!az(_,["EXT_blend_minmax"]),this._elementIndexUint=!!az(_,["OES_element_index_uint"]),this._depthTexture=!!az(_,["WEBGL_depth_texture","WEBKIT_WEBGL_depth_texture"]),this._fragDepth=!!az(_,["EXT_frag_depth"]),this._debugShaders=az(_,["WEBGL_debug_shaders"]),this._textureFloat=!!az(_,["OES_texture_float"]),this._textureHalfFloat=!!az(_,["OES_texture_half_float"]),this._textureFloatLinear=!!az(_,["OES_texture_float_linear"]),this._textureHalfFloatLinear=!!az(_,["OES_texture_half_float_linear"]),this._colorBufferFloat=!!az(_,["EXT_color_buffer_float","WEBGL_color_buffer_float"]),this._floatBlend=!!az(_,["EXT_float_blend"]),this._colorBufferHalfFloat=!!az(_,["EXT_color_buffer_half_float"]),this._s3tc=!!az(_,["WEBGL_compressed_texture_s3tc","MOZ_WEBGL_compressed_texture_s3tc","WEBKIT_WEBGL_compressed_texture_s3tc"]),this._pvrtc=!!az(_,["WEBGL_compressed_texture_pvrtc","WEBKIT_WEBGL_compressed_texture_pvrtc"]),this._astc=!!az(_,["WEBGL_compressed_texture_astc"]),this._etc=!!az(_,["WEBG_compressed_texture_etc"]),this._etc1=!!az(_,["WEBGL_compressed_texture_etc1"]),this._bc7=!!az(_,["EXT_texture_compression_bptc"]),tO.Z.setKTX2SupportedFormats(this._s3tc,this._pvrtc,this._astc,this._etc,this._etc1,this._bc7);let w=m?az(_,["EXT_texture_filter_anisotropic","WEBKIT_EXT_texture_filter_anisotropic"]):void 0;if(this._textureFilterAnisotropic=w,e2.Z._maximumTextureFilterAnisotropy=(0,y.Z)(w)?_.getParameter(w.MAX_TEXTURE_MAX_ANISOTROPY_EXT):1,g){let e=this;i=function(){return e._gl.createVertexArray()},n=function(t){e._gl.bindVertexArray(t)},r=function(t){e._gl.deleteVertexArray(t)},o=function(e,t,i,n,r){_.drawElementsInstanced(e,t,i,n,r)},a=function(e,t,i,n){_.drawArraysInstanced(e,t,i,n)},s=function(e,t){_.vertexAttribDivisor(e,t)},l=function(e){_.drawBuffers(e)}}else c=az(_,["OES_vertex_array_object"]),(0,y.Z)(c)&&(i=function(){return c.createVertexArrayOES()},n=function(e){c.bindVertexArrayOES(e)},r=function(e){c.deleteVertexArrayOES(e)}),u=az(_,["ANGLE_instanced_arrays"]),(0,y.Z)(u)&&(o=function(e,t,i,n,r){u.drawElementsInstancedANGLE(e,t,i,n,r)},a=function(e,t,i,n){u.drawArraysInstancedANGLE(e,t,i,n)},s=function(e,t){u.vertexAttribDivisorANGLE(e,t)}),h=az(_,["WEBGL_draw_buffers"]),(0,y.Z)(h)&&(l=function(e){h.drawBuffersWEBGL(e)});this.glCreateVertexArray=i,this.glBindVertexArray=n,this.glDeleteVertexArray=r,this.glDrawElementsInstanced=o,this.glDrawArraysInstanced=a,this.glVertexAttribDivisor=s,this.glDrawBuffers=l,this._vertexArrayObject=!!c,this._instancedArrays=!!u,this._drawBuffers=!!h,e2.Z._maximumDrawBuffers=this.drawBuffers?_.getParameter(ac.Z.MAX_DRAW_BUFFERS):1,e2.Z._maximumColorAttachments=this.drawBuffers?_.getParameter(ac.Z.MAX_COLOR_ATTACHMENTS):1,this._clearColor=new A.Z(0,0,0,0),this._clearDepth=1,this._clearStencil=0;let S=new ag,C=new ah(this),I=e5.Z.fromCache();this._defaultPassState=C,this._defaultRenderState=I,this._defaultTexture=void 0,this._defaultEmissiveTexture=void 0,this._defaultNormalTexture=void 0,this._defaultCubeMap=void 0,this._us=S,this._currentRenderState=I,this._currentPassState=C,this._currentFramebuffer=void 0,this._maxFrameTextureUnitIndex=0,this._vertexAttribDivisors=[],this._previousDrawInstanced=!1;for(let e=0;e<e2.Z._maximumVertexAttributes;e++)this._vertexAttribDivisors.push(0);this._pickObjects={},this._nextPickColor=new Uint32Array(1),this.options={getWebGLStub:d,requestWebgl1:f,webgl:p,allowTextureFilterAnisotropic:m},this.cache={},e5.Z.apply(_,I,C)}function aF(e,t,i){let n=e.getError();if(n!==e.NO_ERROR)throw new tT.Z(function(e,t,i,n){let r=`${function(e,t){let i="WebGL Error: ";switch(t){case e.INVALID_ENUM:i+="INVALID_ENUM";break;case e.INVALID_VALUE:i+="INVALID_VALUE";break;case e.INVALID_OPERATION:i+="INVALID_OPERATION";break;case e.OUT_OF_MEMORY:i+="OUT_OF_MEMORY";break;case e.CONTEXT_LOST_WEBGL:i+="CONTEXT_LOST_WEBGL lost";break;default:i+=`Unknown (${t})`}return i}(e,n)}: ${t.name}(`;for(let e=0;e<i.length;++e)0!==e&&(r+=", "),r+=i[e];return r+");"}(e,t,i,n))}function az(e,t){let i=t.length;for(let n=0;n<i;++n){let i=e.getExtension(t[n]);if(i)return i}}let aB={};function aU(e,t,i,n){let r=e._currentRenderState,o=e._currentPassState;e._currentRenderState=t,e._currentPassState=i,e5.Z.partialApply(e._gl,r,t,o,i,n)}function ak(e,t){if(t!==e._currentFramebuffer){e._currentFramebuffer=t;let i=u;if((0,y.Z)(t))t._bind(),function(e){if(e.validateFramebuffer){let t=e._gl,i=t.checkFramebufferStatus(t.FRAMEBUFFER);if(i!==t.FRAMEBUFFER_COMPLETE){let e;switch(i){case t.FRAMEBUFFER_INCOMPLETE_ATTACHMENT:e="Framebuffer is not complete. Incomplete attachment: at least one attachment point with a renderbuffer or texture attached has its attached object no longer in existence or has an attached image with a width or height of zero, or the color attachment point has a non-color-renderable image attached, or the depth attachment point has a non-depth-renderable image attached, or the stencil attachment point has a non-stencil-renderable image attached. Color-renderable formats include GL_RGBA4, GL_RGB5_A1, and GL_RGB565. GL_DEPTH_COMPONENT16 is the only depth-renderable format. GL_STENCIL_INDEX8 is the only stencil-renderable format.";break;case t.FRAMEBUFFER_INCOMPLETE_DIMENSIONS:e="Framebuffer is not complete. Incomplete dimensions: not all attached images have the same width and height.";break;case t.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:e="Framebuffer is not complete. Missing attachment: no images are attached to the framebuffer.";break;case t.FRAMEBUFFER_UNSUPPORTED:e="Framebuffer is not complete. Unsupported: the combination of internal formats of the attached images violates an implementation-dependent set of restrictions."}throw new v.Z(e)}}}(e),i=t._getActiveColorAttachments();else{let t=e._gl;t.bindFramebuffer(t.FRAMEBUFFER,null)}e.drawBuffers&&e.glDrawBuffers(i)}}Object.defineProperties(aM.prototype,{id:{get:function(){return this._id}},webgl2:{get:function(){return this._webgl2}},canvas:{get:function(){return this._canvas}},shaderCache:{get:function(){return this._shaderCache}},textureCache:{get:function(){return this._textureCache}},uniformState:{get:function(){return this._us}},stencilBits:{get:function(){return this._stencilBits}},stencilBuffer:{get:function(){return this._stencilBits>=8}},antialias:{get:function(){return this._antialias}},msaa:{get:function(){return this._webgl2}},standardDerivatives:{get:function(){return this._standardDerivatives||this._webgl2}},floatBlend:{get:function(){return this._floatBlend}},blendMinmax:{get:function(){return this._blendMinmax||this._webgl2}},elementIndexUint:{get:function(){return this._elementIndexUint||this._webgl2}},depthTexture:{get:function(){return this._depthTexture||this._webgl2}},floatingPointTexture:{get:function(){return this._webgl2||this._textureFloat}},halfFloatingPointTexture:{get:function(){return this._webgl2||this._textureHalfFloat}},textureFloatLinear:{get:function(){return this._textureFloatLinear}},textureHalfFloatLinear:{get:function(){return this._webgl2&&this._textureFloatLinear||!this._webgl2&&this._textureHalfFloatLinear}},textureFilterAnisotropic:{get:function(){return!!this._textureFilterAnisotropic}},s3tc:{get:function(){return this._s3tc}},pvrtc:{get:function(){return this._pvrtc}},astc:{get:function(){return this._astc}},etc:{get:function(){return this._etc}},etc1:{get:function(){return this._etc1}},bc7:{get:function(){return this._bc7}},supportsBasis:{get:function(){return this._s3tc||this._pvrtc||this._astc||this._etc||this._etc1||this._bc7}},vertexArrayObject:{get:function(){return this._vertexArrayObject||this._webgl2}},fragmentDepth:{get:function(){return this._fragDepth||this._webgl2}},instancedArrays:{get:function(){return this._instancedArrays||this._webgl2}},colorBufferFloat:{get:function(){return this._colorBufferFloat}},colorBufferHalfFloat:{get:function(){return this._webgl2&&this._colorBufferFloat||!this._webgl2&&this._colorBufferHalfFloat}},drawBuffers:{get:function(){return this._drawBuffers||this._webgl2}},debugShaders:{get:function(){return this._debugShaders}},throwOnWebGLError:{get:function(){return this._throwOnWebGLError},set:function(e){this._throwOnWebGLError=e,this._gl=function(e,t){if(!(0,y.Z)(t))return e;let i={};for(let n in e){let r=e[n];r instanceof Function?i[n]=function(i){return function(){let n=i.apply(e,arguments);return t(e,i,arguments),n}}(r):Object.defineProperty(i,n,function(e,t,i){return{get:function(){let n=e[t];return i(e,`get: ${t}`,n),e[t]},set:function(n){e[t]=n,i(e,`set: ${t}`,n)}}}(e,n,t))}return i}(this._originalGLContext,e?aF:void 0)}},defaultTexture:{get:function(){return void 0===this._defaultTexture&&(this._defaultTexture=new eP.Z({context:this,source:{width:1,height:1,arrayBufferView:new Uint8Array([255,255,255,255])},flipY:!1})),this._defaultTexture}},defaultEmissiveTexture:{get:function(){return void 0===this._defaultEmissiveTexture&&(this._defaultEmissiveTexture=new eP.Z({context:this,pixelFormat:te.Z.RGB,source:{width:1,height:1,arrayBufferView:new Uint8Array([0,0,0])},flipY:!1})),this._defaultEmissiveTexture}},defaultNormalTexture:{get:function(){return void 0===this._defaultNormalTexture&&(this._defaultNormalTexture=new eP.Z({context:this,pixelFormat:te.Z.RGB,source:{width:1,height:1,arrayBufferView:new Uint8Array([128,128,255])},flipY:!1})),this._defaultNormalTexture}},defaultCubeMap:{get:function(){if(void 0===this._defaultCubeMap){let e={width:1,height:1,arrayBufferView:new Uint8Array([255,255,255,255])};this._defaultCubeMap=new au.Z({context:this,source:{positiveX:e,negativeX:e,positiveY:e,negativeY:e,positiveZ:e,negativeZ:e},flipY:!1})}return this._defaultCubeMap}},drawingBufferHeight:{get:function(){return this._gl.drawingBufferHeight}},drawingBufferWidth:{get:function(){return this._gl.drawingBufferWidth}},defaultFramebuffer:{get:function(){return aB}}}),"undefined"!=typeof WebGLRenderingContext&&(u=[ac.Z.BACK]);let aV=new ae.Z;aM.prototype.clear=function(e,t){e=(0,Z.Z)(e,aV),t=(0,Z.Z)(t,this._defaultPassState);let i=this._gl,n=0,r=e.color,o=e.depth,a=e.stencil;(0,y.Z)(r)&&(A.Z.equals(this._clearColor,r)||(A.Z.clone(r,this._clearColor),i.clearColor(r.red,r.green,r.blue,r.alpha)),n|=i.COLOR_BUFFER_BIT),(0,y.Z)(o)&&(o!==this._clearDepth&&(this._clearDepth=o,i.clearDepth(o)),n|=i.DEPTH_BUFFER_BIT),(0,y.Z)(a)&&(a!==this._clearStencil&&(this._clearStencil=a,i.clearStencil(a)),n|=i.STENCIL_BUFFER_BIT),aU(this,(0,Z.Z)(e.renderState,this._defaultRenderState),t,!0),ak(this,(0,Z.Z)(e.framebuffer,t.framebuffer)),i.clear(n)},aM.prototype.draw=function(e,t,i,n){D.Z.defined("drawCommand",e),D.Z.defined("drawCommand.shaderProgram",e._shaderProgram),t=(0,Z.Z)(t,this._defaultPassState);let r=(0,Z.Z)(e._framebuffer,t.framebuffer),o=(0,Z.Z)(e._renderState,this._defaultRenderState);i=(0,Z.Z)(i,e._shaderProgram),n=(0,Z.Z)(n,e._uniformMap),function(e,t,i,n,r){if((0,y.Z)(t)&&r.depthTest&&r.depthTest.enabled&&!t.hasDepthAttachment)throw new v.Z("The depth test can not be enabled (drawCommand.renderState.depthTest.enabled) because the framebuffer (drawCommand.framebuffer) does not have a depth or depth-stencil renderbuffer.");ak(e,t),aU(e,r,i,!1),n._bind(),e._maxFrameTextureUnitIndex=Math.max(e._maxFrameTextureUnitIndex,n.maximumTextureUnitIndex)}(this,r,t,i,o),function(e,t,i,n){let r=t._primitiveType,o=t._vertexArray,a=t._offset,s=t._count,l=t.instanceCount;if(!eK.Z.validate(r))throw new v.Z("drawCommand.primitiveType is required and must be valid.");if(D.Z.defined("drawCommand.vertexArray",o),D.Z.typeOf.number.greaterThanOrEquals("drawCommand.offset",a,0),(0,y.Z)(s)&&D.Z.typeOf.number.greaterThanOrEquals("drawCommand.count",s,0),D.Z.typeOf.number.greaterThanOrEquals("drawCommand.instanceCount",l,0),l>0&&!e.instancedArrays)throw new v.Z("Instanced arrays extension is not supported");e._us.model=(0,Z.Z)(t._modelMatrix,z.Z.IDENTITY),i._setUniforms(n,e._us,e.validateShaderProgram),o._bind();let c=o.indexBuffer;(0,y.Z)(c)?(a*=c.bytesPerIndex,s=(0,y.Z)(s)?Math.min(s,c.numberOfIndices):c.numberOfIndices,0===l?e._gl.drawElements(r,s,c.indexDatatype,a):e.glDrawElementsInstanced(r,s,c.indexDatatype,a,l)):(s=(0,y.Z)(s)?Math.min(s,o.numberOfVertices):o.numberOfVertices,0===l?e._gl.drawArrays(r,a,s):e.glDrawArraysInstanced(r,a,s,l)),o._unBind()}(this,e,i,n)},aM.prototype.endFrame=function(){let e=this._gl;e.useProgram(null),this._currentFramebuffer=void 0,e.bindFramebuffer(e.FRAMEBUFFER,null);let t=u;this.drawBuffers&&this.glDrawBuffers(t);let i=this._maxFrameTextureUnitIndex;this._maxFrameTextureUnitIndex=0;for(let t=0;t<i;++t)e.activeTexture(e.TEXTURE0+t),e.bindTexture(e.TEXTURE_2D,null),e.bindTexture(e.TEXTURE_CUBE_MAP,null)},aM.prototype.readPixels=function(e){let t=this._gl;e=(0,Z.Z)(e,Z.Z.EMPTY_OBJECT);let i=Math.max((0,Z.Z)(e.x,0),0),n=Math.max((0,Z.Z)(e.y,0),0),r=(0,Z.Z)(e.width,t.drawingBufferWidth),o=(0,Z.Z)(e.height,t.drawingBufferHeight),a=e.framebuffer;D.Z.typeOf.number.greaterThan("readState.width",r,0),D.Z.typeOf.number.greaterThan("readState.height",o,0);let s=to.Z.UNSIGNED_BYTE;(0,y.Z)(a)&&a.numberOfColorAttachments>0&&(s=a.getColorTexture(0).pixelDatatype);let l=te.Z.createTypedArray(te.Z.RGBA,s,r,o);return ak(this,a),t.readPixels(i,n,r,o,te.Z.RGBA,to.Z.toWebGLConstant(s,this),l),l};let aH={position:0,textureCoordinates:1};function aG(e,t,i){this._pickObjects=e,this.key=t,this.color=i}aM.prototype.getViewportQuadVertexArray=function(){let e=this.cache.viewportQuad_vertexArray;if(!(0,y.Z)(e)){let t=new as.Z({attributes:{position:new al.Z({componentDatatype:V.Z.FLOAT,componentsPerAttribute:2,values:[-1,-1,1,-1,1,1,-1,1]}),textureCoordinates:new al.Z({componentDatatype:V.Z.FLOAT,componentsPerAttribute:2,values:[0,0,1,0,1,1,0,1]})},indices:new Uint16Array([0,1,2,0,2,3]),primitiveType:eK.Z.TRIANGLES});e=e9.Z.fromGeometry({context:this,geometry:t,attributeLocations:aH,bufferUsage:e1.Z.STATIC_DRAW,interleave:!0}),this.cache.viewportQuad_vertexArray=e}return e},aM.prototype.createViewportQuadCommand=function(e,t){return t=(0,Z.Z)(t,Z.Z.EMPTY_OBJECT),new e3.Z({vertexArray:this.getViewportQuadVertexArray(),primitiveType:eK.Z.TRIANGLES,renderState:t.renderState,shaderProgram:eL.Z.fromCache({context:this,vertexShaderSource:at,fragmentShaderSource:e,attributeLocations:aH}),uniformMap:t.uniformMap,owner:t.owner,framebuffer:t.framebuffer,pass:t.pass})},aM.prototype.getObjectByPickColor=function(e){return D.Z.defined("pickColor",e),this._pickObjects[e.toRgba()]},Object.defineProperties(aG.prototype,{object:{get:function(){return this._pickObjects[this.key]},set:function(e){this._pickObjects[this.key]=e}}}),aG.prototype.destroy=function(){delete this._pickObjects[this.key]},aM.prototype.createPickId=function(e){D.Z.defined("object",e),++this._nextPickColor[0];let t=this._nextPickColor[0];if(0===t)throw new tT.Z("Out of unique Pick IDs.");return this._pickObjects[t]=e,new aG(this._pickObjects,t,A.Z.fromRgba(t))},aM.prototype.isDestroyed=function(){return!1},aM.prototype.destroy=function(){let e=this.cache;for(let t in e)if(e.hasOwnProperty(t)){let i=e[t];(0,y.Z)(i.destroy)&&i.destroy()}return this._shaderCache=this._shaderCache.destroy(),this._textureCache=this._textureCache.destroy(),this._defaultTexture=this._defaultTexture&&this._defaultTexture.destroy(),this._defaultEmissiveTexture=this._defaultEmissiveTexture&&this._defaultEmissiveTexture.destroy(),this._defaultNormalTexture=this._defaultNormalTexture&&this._defaultNormalTexture.destroy(),this._defaultCubeMap=this._defaultCubeMap&&this._defaultCubeMap.destroy(),(0,b.Z)(this)},aM._deprecationWarning=aa.Z;let aj={NONE:0,SCENE_LIGHT:1,SUNLIGHT:2};aj.fromGlobeFlags=function(e){return e.enableLighting&&e.dynamicAtmosphereLighting?e.dynamicAtmosphereLightingFromSun?aj.SUNLIGHT:aj.SCENE_LIGHT:aj.NONE};var aW=Object.freeze(aj),aq=function(){this.lightIntensity=10,this.rayleighCoefficient=new _.Z(55e-7,13e-6,284e-7),this.mieCoefficient=new _.Z(21e-6,21e-6,21e-6),this.rayleighScaleHeight=1e4,this.mieScaleHeight=3200,this.mieAnisotropy=.9,this.hueShift=0,this.saturationShift=0,this.brightnessShift=0,this.dynamicLighting=aW.NONE};function aY(){this._colorTexture=void 0,this._drawCommand=void 0}Object.defineProperties(aY.prototype,{colorTexture:{get:function(){return this._colorTexture}}}),aY.prototype.update=function(e){if(!(0,y.Z)(this._colorTexture)){let t=e.context,i=new eP.Z({context:t,width:256,height:256,pixelFormat:te.Z.RGBA,pixelDatatype:to.Z.UNSIGNED_BYTE,sampler:ta.Z.NEAREST});this._colorTexture=i;let n=new ai.Z({context:t,colorTextures:[i],destroyAttachments:!1});(function(e,t,i){let n=t.createViewportQuadCommand("in vec2 v_textureCoordinates;\nconst float M_PI = 3.141592653589793;\n\nfloat vdcRadicalInverse(int i)\n{\n float r;\n float base = 2.0;\n float value = 0.0;\n float invBase = 1.0 / base;\n float invBi = invBase;\n for (int x = 0; x < 100; x++)\n {\n if (i <= 0)\n {\n break;\n }\n r = mod(float(i), base);\n value += r * invBi;\n invBi *= invBase;\n i = int(float(i) * invBase);\n }\n return value;\n}\n\nvec2 hammersley2D(int i, int N)\n{\n return vec2(float(i) / float(N), vdcRadicalInverse(i));\n}\n\nvec3 importanceSampleGGX(vec2 xi, float roughness, vec3 N)\n{\n float a = roughness * roughness;\n float phi = 2.0 * M_PI * xi.x;\n float cosTheta = sqrt((1.0 - xi.y) / (1.0 + (a * a - 1.0) * xi.y));\n float sinTheta = sqrt(1.0 - cosTheta * cosTheta);\n vec3 H = vec3(sinTheta * cos(phi), sinTheta * sin(phi), cosTheta);\n vec3 upVector = abs(N.z) < 0.999 ? vec3(0.0, 0.0, 1.0) : vec3(1.0, 0.0, 0.0);\n vec3 tangentX = normalize(cross(upVector, N));\n vec3 tangentY = cross(N, tangentX);\n return tangentX * H.x + tangentY * H.y + N * H.z;\n}\n\nfloat G1_Smith(float NdotV, float k)\n{\n return NdotV / (NdotV * (1.0 - k) + k);\n}\n\nfloat G_Smith(float roughness, float NdotV, float NdotL)\n{\n float k = roughness * roughness / 2.0;\n return G1_Smith(NdotV, k) * G1_Smith(NdotL, k);\n}\n\nvec2 integrateBrdf(float roughness, float NdotV)\n{\n vec3 V = vec3(sqrt(1.0 - NdotV * NdotV), 0.0, NdotV);\n float A = 0.0;\n float B = 0.0;\n const int NumSamples = 1024;\n for (int i = 0; i < NumSamples; i++)\n {\n vec2 xi = hammersley2D(i, NumSamples);\n vec3 H = importanceSampleGGX(xi, roughness, vec3(0.0, 0.0, 1.0));\n vec3 L = 2.0 * dot(V, H) * H - V;\n float NdotL = clamp(L.z, 0.0, 1.0);\n float NdotH = clamp(H.z, 0.0, 1.0);\n float VdotH = clamp(dot(V, H), 0.0, 1.0);\n if (NdotL > 0.0)\n {\n float G = G_Smith(roughness, NdotV, NdotL);\n float G_Vis = G * VdotH / (NdotH * NdotV);\n float Fc = pow(1.0 - VdotH, 5.0);\n A += (1.0 - Fc) * G_Vis;\n B += Fc * G_Vis;\n }\n }\n return vec2(A, B) / float(NumSamples);\n}\n\nvoid main()\n{\n out_FragColor = vec4(integrateBrdf(v_textureCoordinates.y, v_textureCoordinates.x), 0.0, 1.0);\n}\n",{framebuffer:i,renderState:e5.Z.fromCache({viewport:new oN.Z(0,0,256,256)})});e._drawCommand=n})(this,t,n),this._drawCommand.execute(t),n.destroy(),this._drawCommand.shaderProgram=this._drawCommand.shaderProgram&&this._drawCommand.shaderProgram.destroy()}},aY.prototype.isDestroyed=function(){return!1},aY.prototype.destroy=function(){return this._colorTexture=this._colorTexture&&this._colorTexture.destroy(),(0,b.Z)(this)};var aX=Object.freeze({Linear:Object.freeze({None:function(e){return e},In:function(e){return e},Out:function(e){return e},InOut:function(e){return e}}),Quadratic:Object.freeze({In:function(e){return e*e},Out:function(e){return e*(2-e)},InOut:function(e){return(e*=2)<1?.5*e*e:-.5*(--e*(e-2)-1)}}),Cubic:Object.freeze({In:function(e){return e*e*e},Out:function(e){return--e*e*e+1},InOut:function(e){return(e*=2)<1?.5*e*e*e:.5*((e-=2)*e*e+2)}}),Quartic:Object.freeze({In:function(e){return e*e*e*e},Out:function(e){return 1- --e*e*e*e},InOut:function(e){return(e*=2)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2)}}),Quintic:Object.freeze({In:function(e){return e*e*e*e*e},Out:function(e){return--e*e*e*e*e+1},InOut:function(e){return(e*=2)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2)}}),Sinusoidal:Object.freeze({In:function(e){return 1-Math.sin((1-e)*Math.PI/2)},Out:function(e){return Math.sin(e*Math.PI/2)},InOut:function(e){return .5*(1-Math.sin(Math.PI*(.5-e)))}}),Exponential:Object.freeze({In:function(e){return 0===e?0:Math.pow(1024,e-1)},Out:function(e){return 1===e?1:1-Math.pow(2,-10*e)},InOut:function(e){return 0===e?0:1===e?1:(e*=2)<1?.5*Math.pow(1024,e-1):.5*(-Math.pow(2,-10*(e-1))+2)}}),Circular:Object.freeze({In:function(e){return 1-Math.sqrt(1-e*e)},Out:function(e){return Math.sqrt(1- --e*e)},InOut:function(e){return(e*=2)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1)}}),Elastic:Object.freeze({In:function(e){return 0===e?0:1===e?1:-Math.pow(2,10*(e-1))*Math.sin((e-1.1)*5*Math.PI)},Out:function(e){return 0===e?0:1===e?1:Math.pow(2,-10*e)*Math.sin((e-.1)*5*Math.PI)+1},InOut:function(e){return 0===e?0:1===e?1:(e*=2)<1?-.5*Math.pow(2,10*(e-1))*Math.sin((e-1.1)*5*Math.PI):.5*Math.pow(2,-10*(e-1))*Math.sin((e-1.1)*5*Math.PI)+1}}),Back:Object.freeze({In:function(e){return 1===e?1:e*e*(2.70158*e-1.70158)},Out:function(e){return 0===e?0:--e*e*(2.70158*e+1.70158)+1},InOut:function(e){return(e*=2)<1?e*e*(3.5949095*e-2.5949095)*.5:.5*((e-=2)*e*(3.5949095*e+2.5949095)+2)}}),Bounce:Object.freeze({In:function(e){return 1-aX.Bounce.Out(1-e)},Out:function(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375},InOut:function(e){return e<.5?.5*aX.Bounce.In(2*e):.5*aX.Bounce.Out(2*e-1)+.5}}),generatePow:function(e){return void 0===e&&(e=4),e=(e=e<Number.EPSILON?Number.EPSILON:e)>1e4?1e4:e,{In:function(t){return Math.pow(t,e)},Out:function(t){return 1-Math.pow(1-t,e)},InOut:function(t){return t<.5?Math.pow(2*t,e)/2:(1-Math.pow(2-2*t,e))/2+.5}}}}),a$=function(){return performance.now()},aK=function(){function e(){this._tweens={},this._tweensAddedDuringUpdate={}}return e.prototype.getAll=function(){var e=this;return Object.keys(this._tweens).map(function(t){return e._tweens[t]})},e.prototype.removeAll=function(){this._tweens={}},e.prototype.add=function(e){this._tweens[e.getId()]=e,this._tweensAddedDuringUpdate[e.getId()]=e},e.prototype.remove=function(e){delete this._tweens[e.getId()],delete this._tweensAddedDuringUpdate[e.getId()]},e.prototype.update=function(e,t){void 0===e&&(e=a$()),void 0===t&&(t=!1);var i=Object.keys(this._tweens);if(0===i.length)return!1;for(;i.length>0;){this._tweensAddedDuringUpdate={};for(var n=0;n<i.length;n++){var r=this._tweens[i[n]],o=!t;r&&!1===r.update(e,o)&&!t&&delete this._tweens[i[n]]}i=Object.keys(this._tweensAddedDuringUpdate)}return!0},e}(),aQ={Linear:function(e,t){var i=e.length-1,n=i*t,r=Math.floor(n),o=aQ.Utils.Linear;return t<0?o(e[0],e[1],n):t>1?o(e[i],e[i-1],i-n):o(e[r],e[r+1>i?i:r+1],n-r)},Bezier:function(e,t){for(var i=0,n=e.length-1,r=Math.pow,o=aQ.Utils.Bernstein,a=0;a<=n;a++)i+=r(1-t,n-a)*r(t,a)*e[a]*o(n,a);return i},CatmullRom:function(e,t){var i=e.length-1,n=i*t,r=Math.floor(n),o=aQ.Utils.CatmullRom;return e[0]===e[i]?(t<0&&(r=Math.floor(n=i*(1+t))),o(e[(r-1+i)%i],e[r],e[(r+1)%i],e[(r+2)%i],n-r)):t<0?e[0]-(o(e[0],e[0],e[1],e[1],-n)-e[0]):t>1?e[i]-(o(e[i],e[i],e[i-1],e[i-1],n-i)-e[i]):o(e[r?r-1:0],e[r],e[i<r+1?i:r+1],e[i<r+2?i:r+2],n-r)},Utils:{Linear:function(e,t,i){return(t-e)*i+e},Bernstein:function(e,t){var i=aQ.Utils.Factorial;return i(e)/i(t)/i(e-t)},Factorial:(p=[1],function(e){var t=1;if(p[e])return p[e];for(var i=e;i>1;i--)t*=i;return p[e]=t,t}),CatmullRom:function(e,t,i,n,r){var o=(i-e)*.5,a=(n-t)*.5,s=r*r;return r*s*(2*t-2*i+o+a)+(-3*t+3*i-2*o-a)*s+o*r+t}}},aJ=function(){function e(){}return e.nextId=function(){return e._nextId++},e._nextId=0,e}(),a0=new aK,a1=function(){function e(e,t){void 0===t&&(t=a0),this._object=e,this._group=t,this._isPaused=!1,this._pauseStart=0,this._valuesStart={},this._valuesEnd={},this._valuesStartRepeat={},this._duration=1e3,this._isDynamic=!1,this._initialRepeat=0,this._repeat=0,this._yoyo=!1,this._isPlaying=!1,this._reversed=!1,this._delayTime=0,this._startTime=0,this._easingFunction=aX.Linear.None,this._interpolationFunction=aQ.Linear,this._chainedTweens=[],this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._id=aJ.nextId(),this._isChainStopped=!1,this._propertiesAreSetUp=!1,this._goToEnd=!1}return e.prototype.getId=function(){return this._id},e.prototype.isPlaying=function(){return this._isPlaying},e.prototype.isPaused=function(){return this._isPaused},e.prototype.getDuration=function(){return this._duration},e.prototype.to=function(e,t){if(void 0===t&&(t=1e3),this._isPlaying)throw Error("Can not call Tween.to() while Tween is already started or paused. Stop the Tween first.");return this._valuesEnd=e,this._propertiesAreSetUp=!1,this._duration=t<0?0:t,this},e.prototype.duration=function(e){return void 0===e&&(e=1e3),this._duration=e<0?0:e,this},e.prototype.dynamic=function(e){return void 0===e&&(e=!1),this._isDynamic=e,this},e.prototype.start=function(e,t){if(void 0===e&&(e=a$()),void 0===t&&(t=!1),this._isPlaying)return this;if(this._group&&this._group.add(this),this._repeat=this._initialRepeat,this._reversed)for(var i in this._reversed=!1,this._valuesStartRepeat)this._swapEndStartRepeatValues(i),this._valuesStart[i]=this._valuesStartRepeat[i];if(this._isPlaying=!0,this._isPaused=!1,this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._isChainStopped=!1,this._startTime=e,this._startTime+=this._delayTime,!this._propertiesAreSetUp||t){if(this._propertiesAreSetUp=!0,!this._isDynamic){var n={};for(var r in this._valuesEnd)n[r]=this._valuesEnd[r];this._valuesEnd=n}this._setupProperties(this._object,this._valuesStart,this._valuesEnd,this._valuesStartRepeat,t)}return this},e.prototype.startFromCurrentValues=function(e){return this.start(e,!0)},e.prototype._setupProperties=function(e,t,i,n,r){for(var o in i){var a=e[o],s=Array.isArray(a),l=s?"array":typeof a,c=!s&&Array.isArray(i[o]);if("undefined"!==l&&"function"!==l){if(c){var u=i[o];if(0===u.length)continue;for(var h=[a],d=0,f=u.length;d<f;d+=1){var p=this._handleRelativeValue(a,u[d]);if(isNaN(p)){c=!1,console.warn("Found invalid interpolation list. Skipping.");break}h.push(p)}c&&(i[o]=h)}if(("object"===l||s)&&a&&!c){for(var m in t[o]=s?[]:{},a)t[o][m]=a[m];n[o]=s?[]:{};var u=i[o];if(!this._isDynamic){var _={};for(var m in u)_[m]=u[m];i[o]=u=_}this._setupProperties(a,t[o],u,n[o],r)}else(void 0===t[o]||r)&&(t[o]=a),s||(t[o]*=1),c?n[o]=i[o].slice().reverse():n[o]=t[o]||0}}},e.prototype.stop=function(){return this._isChainStopped||(this._isChainStopped=!0,this.stopChainedTweens()),this._isPlaying&&(this._group&&this._group.remove(this),this._isPlaying=!1,this._isPaused=!1,this._onStopCallback&&this._onStopCallback(this._object)),this},e.prototype.end=function(){return this._goToEnd=!0,this.update(1/0),this},e.prototype.pause=function(e){return void 0===e&&(e=a$()),this._isPaused||!this._isPlaying||(this._isPaused=!0,this._pauseStart=e,this._group&&this._group.remove(this)),this},e.prototype.resume=function(e){return void 0===e&&(e=a$()),this._isPaused&&this._isPlaying&&(this._isPaused=!1,this._startTime+=e-this._pauseStart,this._pauseStart=0,this._group&&this._group.add(this)),this},e.prototype.stopChainedTweens=function(){for(var e=0,t=this._chainedTweens.length;e<t;e++)this._chainedTweens[e].stop();return this},e.prototype.group=function(e){return void 0===e&&(e=a0),this._group=e,this},e.prototype.delay=function(e){return void 0===e&&(e=0),this._delayTime=e,this},e.prototype.repeat=function(e){return void 0===e&&(e=0),this._initialRepeat=e,this._repeat=e,this},e.prototype.repeatDelay=function(e){return this._repeatDelayTime=e,this},e.prototype.yoyo=function(e){return void 0===e&&(e=!1),this._yoyo=e,this},e.prototype.easing=function(e){return void 0===e&&(e=aX.Linear.None),this._easingFunction=e,this},e.prototype.interpolation=function(e){return void 0===e&&(e=aQ.Linear),this._interpolationFunction=e,this},e.prototype.chain=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return this._chainedTweens=e,this},e.prototype.onStart=function(e){return this._onStartCallback=e,this},e.prototype.onEveryStart=function(e){return this._onEveryStartCallback=e,this},e.prototype.onUpdate=function(e){return this._onUpdateCallback=e,this},e.prototype.onRepeat=function(e){return this._onRepeatCallback=e,this},e.prototype.onComplete=function(e){return this._onCompleteCallback=e,this},e.prototype.onStop=function(e){return this._onStopCallback=e,this},e.prototype.update=function(e,t){if(void 0===e&&(e=a$()),void 0===t&&(t=!0),this._isPaused)return!0;var i,n=this._startTime+this._duration;if(!this._goToEnd&&!this._isPlaying){if(e>n)return!1;t&&this.start(e,!0)}if(this._goToEnd=!1,e<this._startTime)return!0;!1===this._onStartCallbackFired&&(this._onStartCallback&&this._onStartCallback(this._object),this._onStartCallbackFired=!0),!1===this._onEveryStartCallbackFired&&(this._onEveryStartCallback&&this._onEveryStartCallback(this._object),this._onEveryStartCallbackFired=!0);var r=e-this._startTime,o=this._duration+(null!==(i=this._repeatDelayTime)&&void 0!==i?i:this._delayTime),a=this._duration+this._repeat*o,s=this._calculateElapsedPortion(r,o,a),l=this._easingFunction(s),c=this._calculateCompletionStatus(r,o);if("repeat"===c&&this._processRepetition(r,o),this._updateProperties(this._object,this._valuesStart,this._valuesEnd,l),"about-to-repeat"===c&&this._processRepetition(r,o),this._onUpdateCallback&&this._onUpdateCallback(this._object,s),"repeat"===c||"about-to-repeat"===c)this._onRepeatCallback&&this._onRepeatCallback(this._object),this._onEveryStartCallbackFired=!1;else if("completed"===c){this._isPlaying=!1,this._onCompleteCallback&&this._onCompleteCallback(this._object);for(var u=0,h=this._chainedTweens.length;u<h;u++)this._chainedTweens[u].start(this._startTime+this._duration,!1)}return"completed"!==c},e.prototype._calculateElapsedPortion=function(e,t,i){if(0===this._duration||e>i)return 1;var n=Math.min(e%t/this._duration,1);return 0===n&&0!==e&&e%this._duration==0?1:n},e.prototype._calculateCompletionStatus=function(e,t){return 0!==this._duration&&e<this._duration?"playing":this._repeat<=0?"completed":e===this._duration?"about-to-repeat":"repeat"},e.prototype._processRepetition=function(e,t){var i=Math.min(Math.trunc((e-this._duration)/t)+1,this._repeat);for(var n in isFinite(this._repeat)&&(this._repeat-=i),this._valuesStartRepeat){var r=this._valuesEnd[n];this._yoyo||"string"!=typeof r||(this._valuesStartRepeat[n]=this._valuesStartRepeat[n]+parseFloat(r)),this._yoyo&&this._swapEndStartRepeatValues(n),this._valuesStart[n]=this._valuesStartRepeat[n]}this._yoyo&&(this._reversed=!this._reversed),this._startTime+=t*i},e.prototype._updateProperties=function(e,t,i,n){for(var r in i)if(void 0!==t[r]){var o=t[r]||0,a=i[r],s=Array.isArray(e[r]),l=Array.isArray(a);!s&&l?e[r]=this._interpolationFunction(a,n):"object"==typeof a&&a?this._updateProperties(e[r],o,a,n):"number"==typeof(a=this._handleRelativeValue(o,a))&&(e[r]=o+(a-o)*n)}},e.prototype._handleRelativeValue=function(e,t){return"string"!=typeof t?t:"+"===t.charAt(0)||"-"===t.charAt(0)?e+parseFloat(t):parseFloat(t)},e.prototype._swapEndStartRepeatValues=function(e){var t=this._valuesStartRepeat[e],i=this._valuesEnd[e];"string"==typeof i?this._valuesStartRepeat[e]=this._valuesStartRepeat[e]+parseFloat(i):this._valuesStartRepeat[e]=this._valuesEnd[e],this._valuesEnd[e]=t},e}();aJ.nextId,a0.getAll.bind(a0),a0.removeAll.bind(a0),a0.add.bind(a0),a0.remove.bind(a0),a0.update.bind(a0);var a2=Object.freeze({LINEAR_NONE:aX.Linear.None,QUADRATIC_IN:aX.Quadratic.In,QUADRATIC_OUT:aX.Quadratic.Out,QUADRATIC_IN_OUT:aX.Quadratic.InOut,CUBIC_IN:aX.Cubic.In,CUBIC_OUT:aX.Cubic.Out,CUBIC_IN_OUT:aX.Cubic.InOut,QUARTIC_IN:aX.Quartic.In,QUARTIC_OUT:aX.Quartic.Out,QUARTIC_IN_OUT:aX.Quartic.InOut,QUINTIC_IN:aX.Quintic.In,QUINTIC_OUT:aX.Quintic.Out,QUINTIC_IN_OUT:aX.Quintic.InOut,SINUSOIDAL_IN:aX.Sinusoidal.In,SINUSOIDAL_OUT:aX.Sinusoidal.Out,SINUSOIDAL_IN_OUT:aX.Sinusoidal.InOut,EXPONENTIAL_IN:aX.Exponential.In,EXPONENTIAL_OUT:aX.Exponential.Out,EXPONENTIAL_IN_OUT:aX.Exponential.InOut,CIRCULAR_IN:aX.Circular.In,CIRCULAR_OUT:aX.Circular.Out,CIRCULAR_IN_OUT:aX.Circular.InOut,ELASTIC_IN:aX.Elastic.In,ELASTIC_OUT:aX.Elastic.Out,ELASTIC_IN_OUT:aX.Elastic.InOut,BACK_IN:aX.Back.In,BACK_OUT:aX.Back.Out,BACK_IN_OUT:aX.Back.InOut,BOUNCE_IN:aX.Bounce.In,BOUNCE_OUT:aX.Bounce.Out,BOUNCE_IN_OUT:aX.Bounce.InOut}),a3=i(421),a4=i(8920),a5=i(9872);let a9={},a8=new _.Z,a6=new _.Z;function a7(e,t,i,n){if((0,y.Z)(n)&&i(.5)>n){let n=i(0),r=i(1),o=i(.5),a=o-n,s=o-r;return function(o){let l=i(o);return o<=.5?F.Z.lerp(e,-F.Z.PI_OVER_TWO,(l-n)/a):F.Z.lerp(-F.Z.PI_OVER_TWO,t,1-(l-r)/s)}}return function(i){return F.Z.lerp(e,t,i)}}function se(e,t,i,n,r){let o=r,a=Math.max(i,n);if(!(0,y.Z)(o)){let i=e.position,n=e.up,r=e.right,a=e.frustum,s=_.Z.subtract(i,t,a8);o=Math.min(.2*function(e,t,i){let n,r;if(e instanceof o8){let o=Math.tan(.5*e.fovy);return n=e.near,r=e.near*o,Math.max(t*n/(e.aspectRatio*r),i*n/r)}return e instanceof o1?(n=e.near,r=e.top,Math.max(t*n/e.right,i*n/r)):Math.max(t,i)}(a,_.Z.magnitude(_.Z.multiplyByScalar(n,_.Z.dot(s,n),a6)),_.Z.magnitude(_.Z.multiplyByScalar(r,_.Z.dot(s,r),a6))),1e9)}if(a<o){let e=-Math.pow((o-i)*1e6,.125),t=Math.pow((o-n)*1e6,.125);return function(i){return-Math.pow(i*(t-e)+e,8)/1e6+o}}return function(e){return F.Z.lerp(i,n,e)}}function st(e,t){return F.Z.equalsEpsilon(e,F.Z.TWO_PI,F.Z.EPSILON11)&&(e=0),t>e+Math.PI?e+=F.Z.TWO_PI:t<e-Math.PI&&(e-=F.Z.TWO_PI),e}let si=new _.Z;function sn(e,t,i,n,r,o,a,s){let l=e.camera,c=_.Z.clone(l.position,si),u=l.pitch,h=st(l.heading,n),d=st(l.roll,o),f=se(l,i,c.z,i.z,a),p=a7(u,r,f,s);return function(e){let r=e.time/t;l.setView({orientation:{heading:F.Z.lerp(h,n,r),pitch:p(r),roll:F.Z.lerp(d,o,r)}}),L.Z.lerp(c,i,r,l.position),l.position.z=f(r)}}let sr=new C.Z,so=new C.Z;function sa(e,t,i,n,r,o,a,s,l,c){let u=e.camera,h=e.mapProjection.ellipsoid,d=C.Z.clone(u.positionCartographic,sr),f=u.pitch,p=st(u.heading,n),m=st(u.roll,o),g=h.cartesianToCartographic(i,so);d.longitude=F.Z.zeroToTwoPi(d.longitude),g.longitude=F.Z.zeroToTwoPi(g.longitude);let Z=!1;if((0,y.Z)(s)){let e=F.Z.zeroToTwoPi(s),t=Math.min(d.longitude,g.longitude),i=Math.max(d.longitude,g.longitude),n=e>=t&&e<=i;if((0,y.Z)(l)){let e=Math.abs(d.longitude-g.longitude),t=F.Z.TWO_PI-e;(n?e:t)<(n?t:e)*l&&!n&&(Z=!0)}else n||(Z=!0)}Z?d.longitude<g.longitude?d.longitude+=F.Z.TWO_PI:g.longitude+=F.Z.TWO_PI:!function(e,t){let i=e.longitude-t.longitude;i<-F.Z.PI?e.longitude+=F.Z.TWO_PI:i>F.Z.PI&&(t.longitude+=F.Z.TWO_PI)}(d,g);let b=se(u,i,d.height,g.height,a),v=a7(f,r,b,c);return function(){let e=d.longitude,i=g.longitude,r=d.latitude,a=g.latitude;return function(s){let l=s.time/t,c=_.Z.fromRadians(F.Z.lerp(e,i,l),F.Z.lerp(r,a,l),b(l),h);u.setView({destination:c,orientation:{heading:F.Z.lerp(p,n,l),pitch:v(l),roll:F.Z.lerp(m,o,l)}})}}()}function ss(e,t,i,n,r,o,a){let s=e.camera,l=_.Z.clone(s.position,si),c=st(s.heading,n),u=s.frustum.right-s.frustum.left,h=se(s,i,u,i.z,a);return function(e){let r=e.time/t;s.setView({orientation:{heading:F.Z.lerp(c,n,r)}}),L.Z.lerp(l,i,r,s.position);let o=h(r),a=s.frustum,u=a.top/a.right,d=(o-(a.right-a.left))*.5;a.right+=d,a.left-=d,a.top=u*a.right,a.bottom=-a.top}}let sl=new C.Z,sc=new _.Z;function su(e,t){return{startObject:{},stopObject:{},duration:0,complete:e,cancel:t}}function sh(e,t){return function(){"function"==typeof t&&t(),e.enableInputs=!0}}a9.createTween=function(e,t){let i=(t=(0,Z.Z)(t,Z.Z.EMPTY_OBJECT)).destination;if(!(0,y.Z)(e))throw new v.Z("scene is required.");if(!(0,y.Z)(i))throw new v.Z("destination is required.");let n=e.mode;if(n===eB.Z.MORPHING)return su();let r=(0,Z.Z)(t.convert,!0),o=e.mapProjection,a=o.ellipsoid,s=t.maximumHeight,l=t.flyOverLongitude,c=t.flyOverLongitudeWeight,u=t.pitchAdjustHeight,h=t.easingFunction;r&&n!==eB.Z.SCENE3D&&(a.cartesianToCartographic(i,sl),i=o.project(sl,sc));let d=e.camera,f=t.endTransform;(0,y.Z)(f)&&d._setTransform(f);let p=t.duration;(0,y.Z)(p)||(p=Math.min(p=Math.ceil(_.Z.distance(d.position,i)/1e6)+2,3));let m=(0,Z.Z)(t.heading,0),g=(0,Z.Z)(t.pitch,-F.Z.PI_OVER_TWO),b=(0,Z.Z)(t.roll,0),T=e.screenSpaceCameraController;T.enableInputs=!1;let E=sh(T,t.complete),x=sh(T,t.cancel),w=d.frustum,S=e.mode===eB.Z.SCENE2D;if(S=(S=(S=(S=S&&L.Z.equalsEpsilon(d.position,i,F.Z.EPSILON6))&&F.Z.equalsEpsilon(Math.max(w.right-w.left,w.top-w.bottom),i.z,F.Z.EPSILON6))||e.mode!==eB.Z.SCENE2D&&_.Z.equalsEpsilon(i,d.position,F.Z.EPSILON10))&&F.Z.equalsEpsilon(F.Z.negativePiToPi(m),F.Z.negativePiToPi(d.heading),F.Z.EPSILON10)&&F.Z.equalsEpsilon(F.Z.negativePiToPi(g),F.Z.negativePiToPi(d.pitch),F.Z.EPSILON10)&&F.Z.equalsEpsilon(F.Z.negativePiToPi(b),F.Z.negativePiToPi(d.roll),F.Z.EPSILON10))return su(E,x);let C=[,,,,];if(C[eB.Z.SCENE2D]=ss,C[eB.Z.SCENE3D]=sa,C[eB.Z.COLUMBUS_VIEW]=sn,p<=0)return su(function(){C[n](e,1,i,m,g,b,s,l,c,u)({time:1}),"function"==typeof E&&E()},x);let A=C[n](e,p,i,m,g,b,s,l,c,u);if(!(0,y.Z)(h)){let e=d.positionCartographic.height;h=e>(n===eB.Z.SCENE3D?a.cartesianToCartographic(i).height:i.z)&&e>11500?a2.CUBIC_OUT:a2.QUINTIC_IN_OUT}return{duration:p,easingFunction:h,startObject:{time:0},stopObject:{time:p},update:A,complete:E,cancel:x}};var sd=Object.freeze({ROTATE:0,INFINITE_SCROLL:1});function sf(e){if(!(0,y.Z)(e))throw new v.Z("scene is required.");this._scene=e,this._transform=z.Z.clone(z.Z.IDENTITY),this._invTransform=z.Z.clone(z.Z.IDENTITY),this._actualTransform=z.Z.clone(z.Z.IDENTITY),this._actualInvTransform=z.Z.clone(z.Z.IDENTITY),this._transformChanged=!1,this.position=new _.Z,this._position=new _.Z,this._positionWC=new _.Z,this._positionCartographic=new C.Z,this._oldPositionWC=void 0,this.positionWCDeltaMagnitude=0,this.positionWCDeltaMagnitudeLastFrame=0,this.timeSinceMoved=0,this._lastMovedTimestamp=0,this.direction=new _.Z,this._direction=new _.Z,this._directionWC=new _.Z,this.up=new _.Z,this._up=new _.Z,this._upWC=new _.Z,this.right=new _.Z,this._right=new _.Z,this._rightWC=new _.Z,this.frustum=new o8,this.frustum.aspectRatio=e.drawingBufferWidth/e.drawingBufferHeight,this.frustum.fov=F.Z.toRadians(60),this.defaultMoveAmount=1e5,this.defaultLookAmount=Math.PI/60,this.defaultRotateAmount=Math.PI/3600,this.defaultZoomAmount=1e5,this.constrainedAxis=void 0,this.maximumZoomFactor=1.5,this._moveStart=new I.Z,this._moveEnd=new I.Z,this._changed=new I.Z,this._changedPosition=void 0,this._changedDirection=void 0,this._changedFrustum=void 0,this._changedHeading=void 0,this._changedRoll=void 0,this.percentageChanged=.5,this._viewMatrix=new z.Z,this._invViewMatrix=new z.Z,sp(this),this._mode=eB.Z.SCENE3D,this._modeChanged=!0;let t=e.mapProjection;this._projection=t,this._maxCoord=t.project(new C.Z(Math.PI,F.Z.PI_OVER_TWO)),this._max2Dfrustum=void 0,ly(this,sf.DEFAULT_VIEW_RECTANGLE,this.position,!0);let i=_.Z.magnitude(this.position);i+=i*sf.DEFAULT_VIEW_FACTOR,_.Z.normalize(this.position,this.position),_.Z.multiplyByScalar(this.position,i,this.position)}function sp(e){z.Z.computeView(e._position,e._direction,e._up,e._right,e._viewMatrix),z.Z.multiply(e._viewMatrix,e._actualInvTransform,e._viewMatrix),z.Z.inverseTransformation(e._viewMatrix,e._invViewMatrix)}sf.TRANSFORM_2D=new z.Z(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1),sf.TRANSFORM_2D_INVERSE=z.Z.inverseTransformation(sf.TRANSFORM_2D,new z.Z),sf.DEFAULT_VIEW_RECTANGLE=U.Z.fromDegrees(-95,-20,-70,90),sf.DEFAULT_VIEW_FACTOR=.5,sf.DEFAULT_OFFSET=new a4.Z(0,-F.Z.PI_OVER_FOUR,0),sf.prototype.canPreloadFlight=function(){return(0,y.Z)(this._currentFlight)&&this._mode!==eB.Z.SCENE2D},sf.prototype._updateCameraChanged=function(){let e;if(function(e){if((0,y.Z)(e._oldPositionWC)){e.positionWCDeltaMagnitudeLastFrame=e.positionWCDeltaMagnitude;let t=_.Z.subtract(e.positionWC,e._oldPositionWC,e._oldPositionWC);e.positionWCDeltaMagnitude=_.Z.magnitude(t),e._oldPositionWC=_.Z.clone(e.positionWC,e._oldPositionWC),e.positionWCDeltaMagnitude>0?(e.timeSinceMoved=0,e._lastMovedTimestamp=(0,rl.Z)()):e.timeSinceMoved=Math.max((0,rl.Z)()-e._lastMovedTimestamp,0)/1e3}else e._oldPositionWC=_.Z.clone(e.positionWC,e._oldPositionWC)}(this),0===this._changed.numberOfListeners)return;let t=this.percentageChanged,i=this.heading;(0,y.Z)(this._changedHeading)||(this._changedHeading=i);let n=Math.abs(this._changedHeading-i)%F.Z.TWO_PI,r=(n=n>F.Z.PI?F.Z.TWO_PI-n:n)/Math.PI;r>t&&(this._changedHeading=i);let o=this.roll;(0,y.Z)(this._changedRoll)||(this._changedRoll=o);let a=Math.abs(this._changedRoll-o)%F.Z.TWO_PI,s=(a=a>F.Z.PI?F.Z.TWO_PI-a:a)/Math.PI;if(s>t&&(this._changedRoll=o),(s>t||r>t)&&this._changed.raiseEvent(Math.max(s,r)),this._mode===eB.Z.SCENE2D){let e;if(!(0,y.Z)(this._changedFrustum)){this._changedPosition=_.Z.clone(this.position,this._changedPosition),this._changedFrustum=this.frustum.clone();return}let i=this.position,n=this._changedPosition,r=this.frustum,o=this._changedFrustum,a=i.x+r.left,s=i.x+r.right,l=n.x+o.left,c=n.x+o.right,u=i.y+r.bottom,h=i.y+r.top,d=n.y+o.bottom,f=n.y+o.top,p=Math.max(a,l),m=Math.min(s,c),g=Math.max(u,d);if(p>=m||g>=h)e=1;else{let t=o;a<l&&s>c&&u<d&&h>f&&(t=r),e=1-(m-p)*(Math.min(h,f)-g)/((t.right-t.left)*(t.top-t.bottom))}e>t&&(this._changed.raiseEvent(e),this._changedPosition=_.Z.clone(this.position,this._changedPosition),this._changedFrustum=this.frustum.clone(this._changedFrustum));return}if(!(0,y.Z)(this._changedDirection)){this._changedPosition=_.Z.clone(this.positionWC,this._changedPosition),this._changedDirection=_.Z.clone(this.directionWC,this._changedDirection);return}let l=F.Z.acosClamped(_.Z.dot(this.directionWC,this._changedDirection));e=(0,y.Z)(this.frustum.fovy)?l/(.5*this.frustum.fovy):l;let c=_.Z.distance(this.positionWC,this._changedPosition)/this.positionCartographic.height;(e>t||c>t)&&(this._changed.raiseEvent(Math.max(e,c)),this._changedPosition=_.Z.clone(this.positionWC,this._changedPosition),this._changedDirection=_.Z.clone(this.directionWC,this._changedDirection))};let sm=new C.Z,s_=new _.Z,sg=new _.Z,sZ=new eH.Z,sy=new eH.Z,sb=new eH.Z,sv=new eH.Z,sT=new eH.Z,sE=new _.Z;function sx(e){let t=e._mode,i=!1,n=0;t===eB.Z.SCENE2D&&(i=(n=e.frustum.right-e.frustum.left)!==e._positionCartographic.height);let r=e._position,o=!_.Z.equals(r,e.position)||i;o&&(r=_.Z.clone(e.position,e._position));let a=e._direction,s=!_.Z.equals(a,e.direction);s&&(_.Z.normalize(e.direction,e.direction),a=_.Z.clone(e.direction,e._direction));let l=e._up,c=!_.Z.equals(l,e.up);c&&(_.Z.normalize(e.up,e.up),l=_.Z.clone(e.up,e._up));let u=e._right,h=!_.Z.equals(u,e.right);h&&(_.Z.normalize(e.right,e.right),u=_.Z.clone(e.right,e._right));let d=e._transformChanged||e._modeChanged;e._transformChanged=!1,d&&((z.Z.inverseTransformation(e._transform,e._invTransform),e._mode===eB.Z.COLUMBUS_VIEW||e._mode===eB.Z.SCENE2D)?z.Z.equals(z.Z.IDENTITY,e._transform)?z.Z.clone(sf.TRANSFORM_2D,e._actualTransform):e._mode===eB.Z.COLUMBUS_VIEW?et.Z.basisTo2D(e._projection,e._transform,e._actualTransform):!function(e){let t=e._projection,i=t.ellipsoid,n=z.Z.getColumn(e._transform,3,sZ),r=i.cartesianToCartographic(n,sm),o=t.project(r,s_);sy.x=o.z,sy.y=o.x,sy.z=o.y,sy.w=1;let a=eH.Z.clone(eH.Z.UNIT_X,sT),s=eH.Z.add(z.Z.getColumn(e._transform,0,sg),n,sg);if(i.cartesianToCartographic(s,r),t.project(r,o),sb.x=o.z,sb.y=o.x,sb.z=o.y,sb.w=0,_.Z.subtract(sb,sy,sb),sb.x=0,_.Z.magnitudeSquared(sb)>F.Z.EPSILON10)_.Z.cross(a,sb,sv);else{let a=eH.Z.add(z.Z.getColumn(e._transform,1,sg),n,sg);i.cartesianToCartographic(a,r),t.project(r,o),sv.x=o.z,sv.y=o.x,sv.z=o.y,sv.w=0,_.Z.subtract(sv,sy,sv),sv.x=0,_.Z.magnitudeSquared(sv)<F.Z.EPSILON10&&(eH.Z.clone(eH.Z.UNIT_Y,sb),eH.Z.clone(eH.Z.UNIT_Z,sv))}_.Z.cross(sv,a,sb),_.Z.normalize(sb,sb),_.Z.cross(a,sb,sv),_.Z.normalize(sv,sv),z.Z.setColumn(e._actualTransform,0,sb,e._actualTransform),z.Z.setColumn(e._actualTransform,1,sv,e._actualTransform),z.Z.setColumn(e._actualTransform,2,a,e._actualTransform),z.Z.setColumn(e._actualTransform,3,sy,e._actualTransform)}(e):z.Z.clone(e._transform,e._actualTransform),z.Z.inverseTransformation(e._actualTransform,e._actualInvTransform),e._modeChanged=!1);let f=e._actualTransform;if((o||d)&&(e._positionWC=z.Z.multiplyByPoint(f,r,e._positionWC),t===eB.Z.SCENE3D||t===eB.Z.MORPHING?e._positionCartographic=e._projection.ellipsoid.cartesianToCartographic(e._positionWC,e._positionCartographic):(sE.x=e._positionWC.y,sE.y=e._positionWC.z,sE.z=e._positionWC.x,t===eB.Z.SCENE2D&&(sE.z=n),e._projection.unproject(sE,e._positionCartographic))),(s||c||h)&&Math.abs(1-_.Z.dot(a,_.Z.cross(l,u,sE)))>F.Z.EPSILON2){let t=1/_.Z.magnitudeSquared(l),i=_.Z.dot(l,a)*t,n=_.Z.multiplyByScalar(a,i,sE);l=_.Z.normalize(_.Z.subtract(l,n,e._up),e._up),_.Z.clone(l,e.up),u=_.Z.cross(a,l,e._right),_.Z.clone(u,e.right)}(s||d)&&(e._directionWC=z.Z.multiplyByPointAsVector(f,a,e._directionWC),_.Z.normalize(e._directionWC,e._directionWC)),(c||d)&&(e._upWC=z.Z.multiplyByPointAsVector(f,l,e._upWC),_.Z.normalize(e._upWC,e._upWC)),(h||d)&&(e._rightWC=z.Z.multiplyByPointAsVector(f,u,e._rightWC),_.Z.normalize(e._rightWC,e._rightWC)),(o||s||c||h||d)&&sp(e)}function sw(e,t){let i;return i=F.Z.equalsEpsilon(Math.abs(e.z),1,F.Z.EPSILON3)?Math.atan2(t.y,t.x)-F.Z.PI_OVER_TWO:Math.atan2(e.y,e.x)-F.Z.PI_OVER_TWO,F.Z.TWO_PI-F.Z.zeroToTwoPi(i)}function sS(e){return F.Z.PI_OVER_TWO-F.Z.acosClamped(e.z)}function sC(e,t,i){let n=0;return F.Z.equalsEpsilon(Math.abs(e.z),1,F.Z.EPSILON3)||(n=Math.atan2(-i.z,t.z),n=F.Z.zeroToTwoPi(n+F.Z.TWO_PI)),n}let sA=new z.Z,sI=new z.Z;Object.defineProperties(sf.prototype,{transform:{get:function(){return this._transform}},inverseTransform:{get:function(){return sx(this),this._invTransform}},viewMatrix:{get:function(){return sx(this),this._viewMatrix}},inverseViewMatrix:{get:function(){return sx(this),this._invViewMatrix}},positionCartographic:{get:function(){return sx(this),this._positionCartographic}},positionWC:{get:function(){return sx(this),this._positionWC}},directionWC:{get:function(){return sx(this),this._directionWC}},upWC:{get:function(){return sx(this),this._upWC}},rightWC:{get:function(){return sx(this),this._rightWC}},heading:{get:function(){if(this._mode!==eB.Z.MORPHING){let e=this._projection.ellipsoid,t=z.Z.clone(this._transform,sA),i=et.Z.eastNorthUpToFixedFrame(this.positionWC,e,sI);this._setTransform(i);let n=sw(this.direction,this.up);return this._setTransform(t),n}}},pitch:{get:function(){if(this._mode!==eB.Z.MORPHING){let e=this._projection.ellipsoid,t=z.Z.clone(this._transform,sA),i=et.Z.eastNorthUpToFixedFrame(this.positionWC,e,sI);this._setTransform(i);let n=sS(this.direction);return this._setTransform(t),n}}},roll:{get:function(){if(this._mode!==eB.Z.MORPHING){let e=this._projection.ellipsoid,t=z.Z.clone(this._transform,sA),i=et.Z.eastNorthUpToFixedFrame(this.positionWC,e,sI);this._setTransform(i);let n=sC(this.direction,this.up,this.right);return this._setTransform(t),n}}},moveStart:{get:function(){return this._moveStart}},moveEnd:{get:function(){return this._moveEnd}},changed:{get:function(){return this._changed}}}),sf.prototype.update=function(e){if(!(0,y.Z)(e))throw new v.Z("mode is required.");if(e===eB.Z.SCENE2D&&!(this.frustum instanceof rc.Z))throw new v.Z("An OrthographicOffCenterFrustum is required in 2D.");if((e===eB.Z.SCENE3D||e===eB.Z.COLUMBUS_VIEW)&&!(this.frustum instanceof o8)&&!(this.frustum instanceof e$.Z))throw new v.Z("A PerspectiveFrustum or OrthographicFrustum is required in 3D and Columbus view");let t=!1;if(e!==this._mode&&(this._mode=e,this._modeChanged=e!==eB.Z.MORPHING,t=this._mode===eB.Z.SCENE2D),t){let e=this._max2Dfrustum=this.frustum.clone();if(!(e instanceof rc.Z))throw new v.Z("The camera frustum is expected to be orthographic for 2D camera control.");let t=e.top/e.right;e.right=2*this._maxCoord.x,e.left=-e.right,e.top=t*e.right,e.bottom=-e.top}this._mode===eB.Z.SCENE2D&&sK(this,this.position)};let sO=new _.Z,sD=new _.Z,sP=new _.Z;sf.prototype._setTransform=function(e){let t=_.Z.clone(this.positionWC,sO),i=_.Z.clone(this.upWC,sD),n=_.Z.clone(this.directionWC,sP);z.Z.clone(e,this._transform),this._transformChanged=!0,sx(this);let r=this._actualInvTransform;z.Z.multiplyByPoint(r,t,this.position),z.Z.multiplyByPointAsVector(r,n,this.direction),z.Z.multiplyByPointAsVector(r,i,this.up),_.Z.cross(this.direction,this.up,this.right),sx(this)};let sR=new L.Z,sN=new eI.Z,sL=new _.Z,sM=new _.Z;function sF(e){let t,i,n;if(!z.Z.equals(z.Z.IDENTITY,e.transform))return _.Z.magnitude(e.position);let r=e._scene,o=r.globe;if(sR.x=r.drawingBufferWidth/2,sR.y=r.drawingBufferHeight/2,(0,y.Z)(o)){let i=e.getPickRay(sR,sN);t=o.pickWorldCoordinates(i,r,!0,sL)}return r.pickPositionSupported&&(i=r.pickPositionWorldCoordinates(sR,sM)),(0,y.Z)(t)||(0,y.Z)(i)?Math.min((0,y.Z)(i)?_.Z.distance(i,e.positionWC):Number.POSITIVE_INFINITY,(0,y.Z)(t)?_.Z.distance(t,e.positionWC):Number.POSITIVE_INFINITY):Math.max(e.positionCartographic.height,0)}sf.prototype._adjustOrthographicFrustum=function(e){this.frustum instanceof e$.Z&&(e||!(this._positionCartographic.height<15e4))&&(this.frustum.width=sF(this))};let sz=new _.Z,sB=new z.Z,sU=new z.Z,sk=new rq.Z,sV=new rW.Z,sH=new C.Z,sG=new _.Z,sj=new _.Z,sW=new _.Z;function sq(e,t,i,n){let r=_.Z.clone(i.direction,sG),o=_.Z.clone(i.up,sj);if(e._scene.mode===eB.Z.SCENE3D){let i=e._projection.ellipsoid,n=et.Z.eastNorthUpToFixedFrame(t,i,sA),a=z.Z.inverseTransformation(n,sI);z.Z.multiplyByPointAsVector(a,r,r),z.Z.multiplyByPointAsVector(a,o,o)}let a=_.Z.cross(r,o,sW);return n.heading=sw(r,o),n.pitch=sS(r),n.roll=sC(r,o,a),n}let sY={destination:void 0,orientation:{direction:void 0,up:void 0,heading:void 0,pitch:void 0,roll:void 0},convert:void 0,endTransform:void 0},sX=new a5.Z;sf.prototype.setView=function(e){e=(0,Z.Z)(e,Z.Z.EMPTY_OBJECT);let t=(0,Z.Z)(e.orientation,Z.Z.EMPTY_OBJECT),i=this._mode;if(i===eB.Z.MORPHING)return;(0,y.Z)(e.endTransform)&&this._setTransform(e.endTransform);let n=(0,Z.Z)(e.convert,!0),r=(0,Z.Z)(e.destination,_.Z.clone(this.positionWC,sz));if((0,y.Z)(r)&&(0,y.Z)(r.west)){if(isNaN((r=this.getRectangleCameraCoordinates(r,sz)).x)||isNaN(r.y))throw new v.Z("destination has a NaN component");n=!1}(0,y.Z)(t.direction)&&(t=sq(this,r,t,sY.orientation)),sX.heading=(0,Z.Z)(t.heading,0),sX.pitch=(0,Z.Z)(t.pitch,-F.Z.PI_OVER_TWO),sX.roll=(0,Z.Z)(t.roll,0),i===eB.Z.SCENE3D?function(e,t,i){if(isNaN(t.x)||isNaN(t.y)||isNaN(t.z))throw new v.Z("position has a NaN component");let n=z.Z.clone(e.transform,sB),r=et.Z.eastNorthUpToFixedFrame(t,e._projection.ellipsoid,sU);e._setTransform(r),_.Z.clone(_.Z.ZERO,e.position),i.heading=i.heading-F.Z.PI_OVER_TWO;let o=rq.Z.fromHeadingPitchRoll(i,sk),a=rW.Z.fromQuaternion(o,sV);rW.Z.getColumn(a,0,e.direction),rW.Z.getColumn(a,2,e.up),_.Z.cross(e.direction,e.up,e.right),e._setTransform(n),e._adjustOrthographicFrustum(!0)}(this,r,sX):i===eB.Z.SCENE2D?function(e,t,i,n){let r=z.Z.clone(e.transform,sB);if(e._setTransform(z.Z.IDENTITY),!_.Z.equals(t,e.positionWC)){if(n){let i=e._projection,n=i.ellipsoid.cartesianToCartographic(t,sH);t=i.project(n,sz)}L.Z.clone(t,e.position);let i=-(.5*t.z),r=-i,o=e.frustum;if(r>i){let e=o.top/o.right;o.right=r,o.left=i,o.top=o.right*e,o.bottom=-o.top}}if(e._scene.mapMode2D===sd.ROTATE){i.heading=i.heading-F.Z.PI_OVER_TWO,i.pitch=-F.Z.PI_OVER_TWO,i.roll=0;let t=rq.Z.fromHeadingPitchRoll(i,sk),n=rW.Z.fromQuaternion(t,sV);rW.Z.getColumn(n,2,e.up),_.Z.cross(e.direction,e.up,e.right)}e._setTransform(r)}(this,r,sX,n):function(e,t,i,n){let r=z.Z.clone(e.transform,sB);if(e._setTransform(z.Z.IDENTITY),!_.Z.equals(t,e.positionWC)){if(n){let i=e._projection,n=i.ellipsoid.cartesianToCartographic(t,sH);t=i.project(n,sz)}_.Z.clone(t,e.position)}i.heading=i.heading-F.Z.PI_OVER_TWO;let o=rq.Z.fromHeadingPitchRoll(i,sk),a=rW.Z.fromQuaternion(o,sV);rW.Z.getColumn(a,0,e.direction),rW.Z.getColumn(a,2,e.up),_.Z.cross(e.direction,e.up,e.right),e._setTransform(r),e._adjustOrthographicFrustum(!0)}(this,r,sX,n)};let s$=new _.Z;function sK(e,t){let i,n;let r=e._scene.mapMode2D===sd.ROTATE,o=e._maxCoord.x,a=e._maxCoord.y;r?i=-(n=o):(n=t.x-2*o,i=t.x+2*o),t.x>o&&(t.x=n),t.x<-o&&(t.x=i),t.y>a&&(t.y=a),t.y<-a&&(t.y=-a)}sf.prototype.flyHome=function(e){let t=this._mode;if(t===eB.Z.MORPHING&&this._scene.completeMorph(),t===eB.Z.SCENE2D)this.flyTo({destination:sf.DEFAULT_VIEW_RECTANGLE,duration:e,endTransform:z.Z.IDENTITY});else if(t===eB.Z.SCENE3D){let t=this.getRectangleCameraCoordinates(sf.DEFAULT_VIEW_RECTANGLE),i=_.Z.magnitude(t);i+=i*sf.DEFAULT_VIEW_FACTOR,_.Z.normalize(t,t),_.Z.multiplyByScalar(t,i,t),this.flyTo({destination:t,duration:e,endTransform:z.Z.IDENTITY})}else if(t===eB.Z.COLUMBUS_VIEW){let t=this._projection.ellipsoid.maximumRadius,i=new _.Z(0,-1,1);i=_.Z.multiplyByScalar(_.Z.normalize(i,i),5*t,i),this.flyTo({destination:i,duration:e,orientation:{heading:0,pitch:-Math.acos(_.Z.normalize(i,s$).z),roll:0},endTransform:z.Z.IDENTITY,convert:!1})}},sf.prototype.worldToCameraCoordinates=function(e,t){if(!(0,y.Z)(e))throw new v.Z("cartesian is required.");return(0,y.Z)(t)||(t=new eH.Z),sx(this),z.Z.multiplyByVector(this._actualInvTransform,e,t)},sf.prototype.worldToCameraCoordinatesPoint=function(e,t){if(!(0,y.Z)(e))throw new v.Z("cartesian is required.");return(0,y.Z)(t)||(t=new _.Z),sx(this),z.Z.multiplyByPoint(this._actualInvTransform,e,t)},sf.prototype.worldToCameraCoordinatesVector=function(e,t){if(!(0,y.Z)(e))throw new v.Z("cartesian is required.");return(0,y.Z)(t)||(t=new _.Z),sx(this),z.Z.multiplyByPointAsVector(this._actualInvTransform,e,t)},sf.prototype.cameraToWorldCoordinates=function(e,t){if(!(0,y.Z)(e))throw new v.Z("cartesian is required.");return(0,y.Z)(t)||(t=new eH.Z),sx(this),z.Z.multiplyByVector(this._actualTransform,e,t)},sf.prototype.cameraToWorldCoordinatesPoint=function(e,t){if(!(0,y.Z)(e))throw new v.Z("cartesian is required.");return(0,y.Z)(t)||(t=new _.Z),sx(this),z.Z.multiplyByPoint(this._actualTransform,e,t)},sf.prototype.cameraToWorldCoordinatesVector=function(e,t){if(!(0,y.Z)(e))throw new v.Z("cartesian is required.");return(0,y.Z)(t)||(t=new _.Z),sx(this),z.Z.multiplyByPointAsVector(this._actualTransform,e,t)};let sQ=new _.Z;sf.prototype.move=function(e,t){if(!(0,y.Z)(e))throw new v.Z("direction is required.");let i=this.position;_.Z.multiplyByScalar(e,t,sQ),_.Z.add(i,sQ,i),this._mode===eB.Z.SCENE2D&&sK(this,i),this._adjustOrthographicFrustum(!0)},sf.prototype.moveForward=function(e){e=(0,Z.Z)(e,this.defaultMoveAmount),this._mode===eB.Z.SCENE2D?s7(this,e):this.move(this.direction,e)},sf.prototype.moveBackward=function(e){e=(0,Z.Z)(e,this.defaultMoveAmount),this._mode===eB.Z.SCENE2D?s7(this,-e):this.move(this.direction,-e)},sf.prototype.moveUp=function(e){e=(0,Z.Z)(e,this.defaultMoveAmount),this.move(this.up,e)},sf.prototype.moveDown=function(e){e=(0,Z.Z)(e,this.defaultMoveAmount),this.move(this.up,-e)},sf.prototype.moveRight=function(e){e=(0,Z.Z)(e,this.defaultMoveAmount),this.move(this.right,e)},sf.prototype.moveLeft=function(e){e=(0,Z.Z)(e,this.defaultMoveAmount),this.move(this.right,-e)},sf.prototype.lookLeft=function(e){e=(0,Z.Z)(e,this.defaultLookAmount),this._mode!==eB.Z.SCENE2D&&this.look(this.up,-e)},sf.prototype.lookRight=function(e){e=(0,Z.Z)(e,this.defaultLookAmount),this._mode!==eB.Z.SCENE2D&&this.look(this.up,e)},sf.prototype.lookUp=function(e){e=(0,Z.Z)(e,this.defaultLookAmount),this._mode!==eB.Z.SCENE2D&&this.look(this.right,-e)},sf.prototype.lookDown=function(e){e=(0,Z.Z)(e,this.defaultLookAmount),this._mode!==eB.Z.SCENE2D&&this.look(this.right,e)};let sJ=new rq.Z,s0=new rW.Z;sf.prototype.look=function(e,t){if(!(0,y.Z)(e))throw new v.Z("axis is required.");let i=(0,Z.Z)(t,this.defaultLookAmount),n=rq.Z.fromAxisAngle(e,-i,sJ),r=rW.Z.fromQuaternion(n,s0),o=this.direction,a=this.up,s=this.right;rW.Z.multiplyByVector(r,o,o),rW.Z.multiplyByVector(r,a,a),rW.Z.multiplyByVector(r,s,s)},sf.prototype.twistLeft=function(e){e=(0,Z.Z)(e,this.defaultLookAmount),this.look(this.direction,e)},sf.prototype.twistRight=function(e){e=(0,Z.Z)(e,this.defaultLookAmount),this.look(this.direction,-e)};let s1=new rq.Z,s2=new rW.Z;sf.prototype.rotate=function(e,t){if(!(0,y.Z)(e))throw new v.Z("axis is required.");let i=(0,Z.Z)(t,this.defaultRotateAmount),n=rq.Z.fromAxisAngle(e,-i,s1),r=rW.Z.fromQuaternion(n,s2);rW.Z.multiplyByVector(r,this.position,this.position),rW.Z.multiplyByVector(r,this.direction,this.direction),rW.Z.multiplyByVector(r,this.up,this.up),_.Z.cross(this.direction,this.up,this.right),_.Z.cross(this.right,this.direction,this.up),this._adjustOrthographicFrustum(!1)},sf.prototype.rotateDown=function(e){s8(this,e=(0,Z.Z)(e,this.defaultRotateAmount))},sf.prototype.rotateUp=function(e){s8(this,-(e=(0,Z.Z)(e,this.defaultRotateAmount)))};let s3=new _.Z,s4=new _.Z,s5=new _.Z,s9=new _.Z;function s8(e,t){let i=e.position;if((0,y.Z)(e.constrainedAxis)&&!_.Z.equalsEpsilon(e.position,_.Z.ZERO,F.Z.EPSILON2)){let n=_.Z.normalize(i,s3),r=_.Z.equalsEpsilon(n,e.constrainedAxis,F.Z.EPSILON2),o=_.Z.equalsEpsilon(n,_.Z.negate(e.constrainedAxis,s9),F.Z.EPSILON2);if(r||o)(r&&t<0||o&&t>0)&&e.rotate(e.right,t);else{let i=_.Z.normalize(e.constrainedAxis,s4),r=_.Z.dot(n,i),o=F.Z.acosClamped(r);t>0&&t>o&&(t=o-F.Z.EPSILON4),r=_.Z.dot(n,_.Z.negate(i,s9)),o=F.Z.acosClamped(r),t<0&&-t>o&&(t=-o+F.Z.EPSILON4);let a=_.Z.cross(i,n,s5);e.rotate(a,t)}}else e.rotate(e.right,t)}function s6(e,t){(0,y.Z)(e.constrainedAxis)?e.rotate(e.constrainedAxis,t):e.rotate(e.up,t)}function s7(e,t){let i;let n=e.frustum;if(!(n instanceof rc.Z)||!(0,y.Z)(n.left)||!(0,y.Z)(n.right)||!(0,y.Z)(n.bottom)||!(0,y.Z)(n.top))throw new v.Z("The camera frustum is expected to be orthographic for 2D camera control.");if(t*=.5,Math.abs(n.top)+Math.abs(n.bottom)>Math.abs(n.left)+Math.abs(n.right)){let r=n.top-t,o=n.bottom+t,a=e._maxCoord.y;e._scene.mapMode2D===sd.ROTATE&&(a*=e.maximumZoomFactor),o>a&&(o=a,r=-a),r<=o&&(r=1,o=-1),i=n.right/n.top,n.top=r,n.bottom=o,n.right=n.top*i,n.left=-n.right}else{let r=n.right-t,o=n.left+t,a=e._maxCoord.x;e._scene.mapMode2D===sd.ROTATE&&(a*=e.maximumZoomFactor),r>a&&(r=a,o=-a),r<=o&&(r=1,o=-1),i=n.top/n.right,n.right=r,n.left=o,n.top=n.right*i,n.bottom=-n.top}}function le(e,t){e.move(e.direction,t)}sf.prototype.rotateRight=function(e){s6(this,-(e=(0,Z.Z)(e,this.defaultRotateAmount)))},sf.prototype.rotateLeft=function(e){s6(this,e=(0,Z.Z)(e,this.defaultRotateAmount))},sf.prototype.zoomIn=function(e){e=(0,Z.Z)(e,this.defaultZoomAmount),this._mode===eB.Z.SCENE2D?s7(this,e):le(this,e)},sf.prototype.zoomOut=function(e){e=(0,Z.Z)(e,this.defaultZoomAmount),this._mode===eB.Z.SCENE2D?s7(this,-e):le(this,-e)},sf.prototype.getMagnitude=function(){return this._mode===eB.Z.SCENE3D?_.Z.magnitude(this.position):this._mode===eB.Z.COLUMBUS_VIEW?Math.abs(this.position.z):this._mode===eB.Z.SCENE2D?Math.max(this.frustum.right-this.frustum.left,this.frustum.top-this.frustum.bottom):void 0};let lt=new z.Z;sf.prototype.lookAt=function(e,t){if(!(0,y.Z)(e))throw new v.Z("target is required");if(!(0,y.Z)(t))throw new v.Z("offset is required");if(this._mode===eB.Z.MORPHING)throw new v.Z("lookAt is not supported while morphing.");let i=et.Z.eastNorthUpToFixedFrame(e,T.Z.WGS84,lt);this.lookAtTransform(i,t)};let li=new _.Z,ln=new rq.Z,lr=new rq.Z,lo=new rW.Z;function la(e,t,i){t=F.Z.clamp(t,-F.Z.PI_OVER_TWO,F.Z.PI_OVER_TWO),e=F.Z.zeroToTwoPi(e)-F.Z.PI_OVER_TWO;let n=rq.Z.fromAxisAngle(_.Z.UNIT_Y,-t,ln),r=rq.Z.fromAxisAngle(_.Z.UNIT_Z,-e,lr),o=rq.Z.multiply(r,n,r),a=rW.Z.fromQuaternion(o,lo),s=_.Z.clone(_.Z.UNIT_X,li);return rW.Z.multiplyByVector(a,s,s),_.Z.negate(s,s),_.Z.multiplyByScalar(s,i,s),s}sf.prototype.lookAtTransform=function(e,t){let i;if(!(0,y.Z)(e))throw new v.Z("transform is required");if(this._mode===eB.Z.MORPHING)throw new v.Z("lookAtTransform is not supported while morphing.");if(this._setTransform(e),(0,y.Z)(t)){if(i=(0,y.Z)(t.heading)?la(t.heading,t.pitch,t.range):t,this._mode===eB.Z.SCENE2D){L.Z.clone(L.Z.ZERO,this.position),_.Z.negate(i,this.up),this.up.z=0,_.Z.magnitudeSquared(this.up)<F.Z.EPSILON10&&_.Z.clone(_.Z.UNIT_Y,this.up),_.Z.normalize(this.up,this.up),this._setTransform(z.Z.IDENTITY),_.Z.negate(_.Z.UNIT_Z,this.direction),_.Z.cross(this.direction,this.up,this.right),_.Z.normalize(this.right,this.right);let t=this.frustum,n=t.top/t.right;t.right=.5*_.Z.magnitude(i),t.left=-t.right,t.top=n*t.right,t.bottom=-t.top,this._setTransform(e);return}_.Z.clone(i,this.position),_.Z.negate(this.position,this.direction),_.Z.normalize(this.direction,this.direction),_.Z.cross(this.direction,_.Z.UNIT_Z,this.right),_.Z.magnitudeSquared(this.right)<F.Z.EPSILON10&&_.Z.clone(_.Z.UNIT_X,this.right),_.Z.normalize(this.right,this.right),_.Z.cross(this.right,this.direction,this.up),_.Z.normalize(this.up,this.up),this._adjustOrthographicFrustum(!0)}};let ls=new C.Z,ll=new C.Z,lc=new _.Z,lu=new _.Z,lh=new _.Z,ld=new _.Z,lf=new _.Z,lp=new _.Z,lm=new _.Z,l_=new _.Z,lg={direction:new _.Z,right:new _.Z,up:new _.Z};function lZ(e,t,i,n){return Math.abs(_.Z.dot(t,i))/n-_.Z.dot(e,i)}function ly(e,t,i,n){let r,o;let a=e._projection.ellipsoid,s=n?e:lg,l=t.north,c=t.south,u=t.east,d=t.west;d>u&&(u+=F.Z.TWO_PI);let f=(d+u)*.5;if(c<-F.Z.PI_OVER_TWO+F.Z.RADIANS_PER_DEGREE&&l>F.Z.PI_OVER_TWO-F.Z.RADIANS_PER_DEGREE)r=0;else{ls.longitude=f,ls.latitude=l,ls.height=0,ll.longitude=f,ll.latitude=c,ll.height=0;let e=h;(0,y.Z)(e)&&e.ellipsoid===a||(h=e=new a3.Z(void 0,void 0,a)),e.setEndPoints(ls,ll),r=e.interpolateUsingFraction(.5,ls).latitude}ls.longitude=f,ls.latitude=r,ls.height=0;let p=a.cartographicToCartesian(ls,lm);ls.longitude=u,ls.latitude=l;let m=a.cartographicToCartesian(ls,lc);ls.longitude=d;let g=a.cartographicToCartesian(ls,lh);ls.longitude=f;let Z=a.cartographicToCartesian(ls,lf);ls.latitude=c;let b=a.cartographicToCartesian(ls,lp);ls.longitude=u;let v=a.cartographicToCartesian(ls,ld);ls.longitude=d;let T=a.cartographicToCartesian(ls,lu);_.Z.subtract(g,p,g),_.Z.subtract(v,p,v),_.Z.subtract(m,p,m),_.Z.subtract(T,p,T),_.Z.subtract(Z,p,Z),_.Z.subtract(b,p,b);let E=a.geodeticSurfaceNormal(p,s.direction);_.Z.negate(E,E);let x=_.Z.cross(E,_.Z.UNIT_Z,s.right);_.Z.normalize(x,x);let w=_.Z.cross(x,E,s.up);if(e.frustum instanceof e$.Z){let t,i;let n=Math.max(_.Z.distance(m,g),_.Z.distance(v,T)),r=Math.max(_.Z.distance(m,v),_.Z.distance(g,T)),a=e.frustum._offCenterFrustum,s=a.right/a.top,l=r*s;n>l?i=(t=n)/s:(i=r,t=l),o=Math.max(t,i)}else{let t=Math.tan(.5*e.frustum.fovy),i=e.frustum.aspectRatio*t;if(o=Math.max(lZ(E,w,g,t),lZ(E,w,v,t),lZ(E,w,m,t),lZ(E,w,T,t),lZ(E,w,Z,t),lZ(E,w,b,t),lZ(E,x,g,i),lZ(E,x,v,i),lZ(E,x,m,i),lZ(E,x,T,i),lZ(E,x,Z,i),lZ(E,x,b,i)),c<0&&l>0){ls.longitude=d,ls.latitude=0,ls.height=0;let e=a.cartographicToCartesian(ls,l_);_.Z.subtract(e,p,e),o=Math.max(o,lZ(E,w,e,t),lZ(E,x,e,i)),ls.longitude=u,e=a.cartographicToCartesian(ls,l_),_.Z.subtract(e,p,e),o=Math.max(o,lZ(E,w,e,t),lZ(E,x,e,i))}}return _.Z.add(p,_.Z.multiplyByScalar(E,-o,l_),i)}let lb=new C.Z,lv=new _.Z,lT=new _.Z,lE=new C.Z,lx=new _.Z,lw=new _.Z;sf.prototype.getRectangleCameraCoordinates=function(e,t){if(!(0,y.Z)(e))throw new v.Z("rectangle is required");let i=this._mode;return((0,y.Z)(t)||(t=new _.Z),i===eB.Z.SCENE3D)?ly(this,e,t):i===eB.Z.COLUMBUS_VIEW?function(e,t,i){let n=e._projection;t.west>t.east&&(t=U.Z.MAX_VALUE);let r=e._actualTransform,o=e._actualInvTransform;lb.longitude=t.east,lb.latitude=t.north;let a=n.project(lb,lv);z.Z.multiplyByPoint(r,a,a),z.Z.multiplyByPoint(o,a,a),lb.longitude=t.west,lb.latitude=t.south;let s=n.project(lb,lT);if(z.Z.multiplyByPoint(r,s,s),z.Z.multiplyByPoint(o,s,s),i.x=(a.x-s.x)*.5+s.x,i.y=(a.y-s.y)*.5+s.y,(0,y.Z)(e.frustum.fovy)){let t=Math.tan(.5*e.frustum.fovy),n=e.frustum.aspectRatio*t;i.z=.5*Math.max((a.x-s.x)/n,(a.y-s.y)/t)}else{let e=a.x-s.x,t=a.y-s.y;i.z=Math.max(e,t)}return i}(this,e,t):i===eB.Z.SCENE2D?function(e,t,i){let n,r;let o=e._projection,a=t.east;t.west>t.east&&(e._scene.mapMode2D===sd.INFINITE_SCROLL?a+=F.Z.TWO_PI:a=(t=U.Z.MAX_VALUE).east);let s=lE;s.longitude=a,s.latitude=t.north;let l=o.project(s,lx);s.longitude=t.west,s.latitude=t.south;let c=o.project(s,lw),u=.5*Math.abs(l.x-c.x),h=.5*Math.abs(l.y-c.y),d=e.frustum.right/e.frustum.top,f=h*d;return u>f?r=(n=u)/d:(r=h,n=f),h=Math.max(2*n,2*r),i.x=(l.x-c.x)*.5+c.x,i.y=(l.y-c.y)*.5+c.y,(s=o.unproject(i,s)).height=h,i=o.project(s,i)}(this,e,t):void 0};let lS=new eI.Z,lC=new eI.Z,lA=new eI.Z;sf.prototype.pickEllipsoid=function(e,t,i){if(!(0,y.Z)(e))throw new v.Z("windowPosition is required.");let n=this._scene.canvas;if(0!==n.clientWidth&&0!==n.clientHeight){if((0,y.Z)(i)||(i=new _.Z),t=(0,Z.Z)(t,T.Z.WGS84),this._mode===eB.Z.SCENE3D)i=function(e,t,i,n){i=(0,Z.Z)(i,T.Z.WGS84);let r=e.getPickRay(t,lS),o=eC.Z.rayEllipsoid(r,i);if(!o)return;let a=o.start>0?o.start:o.stop;return eI.Z.getPoint(r,a,n)}(this,e,t,i);else if(this._mode===eB.Z.SCENE2D)i=function(e,t,i,n){let r=e.getPickRay(t,lC).origin;r=_.Z.fromElements(r.y,r.z,0,r);let o=i.unproject(r);if(!(o.latitude<-F.Z.PI_OVER_TWO)&&!(o.latitude>F.Z.PI_OVER_TWO))return i.ellipsoid.cartographicToCartesian(o,n)}(this,e,this._projection,i);else{if(this._mode!==eB.Z.COLUMBUS_VIEW)return;i=function(e,t,i,n){let r=e.getPickRay(t,lA),o=-r.origin.x/r.direction.x;eI.Z.getPoint(r,o,n);let a=i.unproject(new _.Z(n.y,n.z,0));if(!(a.latitude<-F.Z.PI_OVER_TWO)&&!(a.latitude>F.Z.PI_OVER_TWO)&&!(a.longitude<-Math.PI)&&!(a.longitude>Math.PI))return i.ellipsoid.cartographicToCartesian(a,n)}(this,e,this._projection,i)}return i}};let lI=new _.Z,lO=new _.Z,lD=new _.Z,lP=new _.Z;sf.prototype.getPickRay=function(e,t){if(!(0,y.Z)(e))throw new v.Z("windowPosition is required.");(0,y.Z)(t)||(t=new eI.Z);let i=this._scene.canvas;if(i.clientWidth<=0||i.clientHeight<=0)return;let n=this.frustum;return(0,y.Z)(n.aspectRatio)&&(0,y.Z)(n.fov)&&(0,y.Z)(n.near)?function(e,t,i){let n=e._scene.canvas,r=n.clientWidth,o=n.clientHeight,a=Math.tan(.5*e.frustum.fovy),s=e.frustum.aspectRatio*a,l=e.frustum.near,c=2/r*t.x-1,u=2/o*(o-t.y)-1,h=e.positionWC;_.Z.clone(h,i.origin);let d=_.Z.multiplyByScalar(e.directionWC,l,lI);_.Z.add(h,d,d);let f=_.Z.multiplyByScalar(e.rightWC,c*l*s,lO),p=_.Z.multiplyByScalar(e.upWC,u*l*a,lD),m=_.Z.add(d,f,i.direction);return _.Z.add(m,p,m),_.Z.subtract(m,h,m),_.Z.normalize(m,m),i}(this,e,t):function(e,t,i){let n=e._scene.canvas,r=n.clientWidth,o=n.clientHeight,a=e.frustum,s=a.offCenterFrustum;(0,y.Z)(s)&&(a=s);let l=2/r*t.x-1;l*=(a.right-a.left)*.5;let c=2/o*(o-t.y)-1;c*=(a.top-a.bottom)*.5;let u=i.origin;return _.Z.clone(e.position,u),_.Z.multiplyByScalar(e.right,l,lP),_.Z.add(lP,u,u),_.Z.multiplyByScalar(e.up,c,lP),_.Z.add(lP,u,u),_.Z.clone(e.directionWC,i.direction),(e._mode===eB.Z.COLUMBUS_VIEW||e._mode===eB.Z.SCENE2D)&&_.Z.fromElements(i.origin.z,i.origin.x,i.origin.y,i.origin),i}(this,e,t)};let lR=new _.Z,lN=new _.Z;sf.prototype.distanceToBoundingSphere=function(e){if(!(0,y.Z)(e))throw new v.Z("boundingSphere is required.");let t=_.Z.subtract(this.positionWC,e.center,lR),i=_.Z.multiplyByScalar(this.directionWC,_.Z.dot(t,this.directionWC),lN);return Math.max(0,_.Z.magnitude(i)-e.radius)};let lL=new L.Z;sf.prototype.getPixelSize=function(e,t,i){if(!(0,y.Z)(e))throw new v.Z("boundingSphere is required.");if(!(0,y.Z)(t))throw new v.Z("drawingBufferWidth is required.");if(!(0,y.Z)(i))throw new v.Z("drawingBufferHeight is required.");let n=this.distanceToBoundingSphere(e),r=this.frustum.getPixelDimensions(t,i,n,this._scene.pixelRatio,lL);return Math.max(r.x,r.y)};let lM=new _.Z,lF=new _.Z,lz=new _.Z,lB=new _.Z;sf.prototype.createCorrectPositionTween=function(e){if(!(0,y.Z)(e))throw new v.Z("duration is required.");if(this._mode===eB.Z.COLUMBUS_VIEW)return function(e,t){let i=e.position,n=e.direction,r=e.worldToCameraCoordinatesVector(_.Z.UNIT_X,lM),o=-_.Z.dot(r,i)/_.Z.dot(r,n),a=_.Z.add(i,_.Z.multiplyByScalar(n,o,lF),lF);e.cameraToWorldCoordinatesPoint(a,a),i=e.cameraToWorldCoordinatesPoint(e.position,lz);let s=Math.tan(.5*e.frustum.fovy),l=e.frustum.aspectRatio*s,c=_.Z.magnitude(_.Z.subtract(i,a,lB)),u=e._maxCoord.x,h=e._maxCoord.y,d=Math.max(l*c-u,u),f=Math.max(s*c-h,h);if(i.z<-d||i.z>d||i.y<-f||i.y>f){let n=a.y<-d||a.y>d,r=a.z<-f||a.z>f;if(n||r)return function(e,t,i,n,r,o){let a=_.Z.clone(t);return i.y>n?a.y-=i.y-n:i.y<-n&&(a.y+=-n-i.y),i.z>r?a.z-=i.z-r:i.z<-r&&(a.z+=-r-i.z),{easingFunction:a2.EXPONENTIAL_OUT,startObject:{time:0},stopObject:{time:1},duration:o,update:function(i){let n=_.Z.lerp(t,a,i.time,new _.Z);e.worldToCameraCoordinatesPoint(n,e.position)}}}(e,i,a,d,f,t)}}(this,e)};let lU=new _.Z,lk={destination:void 0,heading:void 0,pitch:void 0,roll:void 0,duration:void 0,complete:void 0,cancel:void 0,endTransform:void 0,maximumHeight:void 0,easingFunction:void 0};function lV(e,t,i){i=a4.Z.clone((0,y.Z)(i)?i:sf.DEFAULT_OFFSET);let n=e._scene.screenSpaceCameraController.minimumZoomDistance,r=e._scene.screenSpaceCameraController.maximumZoomDistance,o=i.range;if(!(0,y.Z)(o)||0===o){let o=t.radius;0===o?i.range=100:e.frustum instanceof e$.Z||e._mode===eB.Z.SCENE2D?i.range=function(e,t){let i,n,r=e.frustum,o=r.offCenterFrustum;(0,y.Z)(o)&&(r=o);let a=r.right/r.top,s=t*a;return t>s?n=(i=t)/a:(n=t,i=s),1.5*Math.max(i,n)}(e,o):i.range=function(e,t){let i=e.frustum,n=Math.tan(.5*i.fovy);return Math.max(t/(i.aspectRatio*n),t/n)}(e,o),i.range=F.Z.clamp(i.range,n,r)}return i}sf.prototype.cancelFlight=function(){(0,y.Z)(this._currentFlight)&&(this._currentFlight.cancelTween(),this._currentFlight=void 0)},sf.prototype.completeFlight=function(){if((0,y.Z)(this._currentFlight)){this._currentFlight.cancelTween();let e={destination:void 0,orientation:{heading:void 0,pitch:void 0,roll:void 0}};e.destination=lk.destination,e.orientation.heading=lk.heading,e.orientation.pitch=lk.pitch,e.orientation.roll=lk.roll,this.setView(e),(0,y.Z)(this._currentFlight.complete)&&this._currentFlight.complete(),this._currentFlight=void 0}},sf.prototype.flyTo=function(e){let t;let i=(e=(0,Z.Z)(e,Z.Z.EMPTY_OBJECT)).destination;if(!(0,y.Z)(i))throw new v.Z("destination is required.");if(this._mode===eB.Z.MORPHING)return;this.cancelFlight();let n=i instanceof U.Z;n&&(i=this.getRectangleCameraCoordinates(i,lU));let r=(0,Z.Z)(e.orientation,Z.Z.EMPTY_OBJECT);if((0,y.Z)(r.direction)&&(r=sq(this,i,r,sY.orientation)),(0,y.Z)(e.duration)&&e.duration<=0){sY.destination=e.destination,sY.orientation.heading=r.heading,sY.orientation.pitch=r.pitch,sY.orientation.roll=r.roll,sY.convert=e.convert,sY.endTransform=e.endTransform,this.setView(sY),"function"==typeof e.complete&&e.complete();return}let o=this;lk.destination=i,lk.heading=r.heading,lk.pitch=r.pitch,lk.roll=r.roll,lk.duration=e.duration,lk.complete=function(){t===o._currentFlight&&(o._currentFlight=void 0),(0,y.Z)(e.complete)&&e.complete()},lk.cancel=e.cancel,lk.endTransform=e.endTransform,lk.convert=!n&&e.convert,lk.maximumHeight=e.maximumHeight,lk.pitchAdjustHeight=e.pitchAdjustHeight,lk.flyOverLongitude=e.flyOverLongitude,lk.flyOverLongitudeWeight=e.flyOverLongitudeWeight,lk.easingFunction=e.easingFunction;let a=this._scene,s=a9.createTween(a,lk);if(0===s.duration){"function"==typeof s.complete&&s.complete();return}t=a.tweens.add(s),this._currentFlight=t;let l=this._scene.preloadFlightCamera;this._mode!==eB.Z.SCENE2D&&((0,y.Z)(l)||(l=sf.clone(this)),l.setView({destination:i,orientation:r}),this._scene.preloadFlightCullingVolume=l.frustum.computeCullingVolume(l.positionWC,l.directionWC,l.upWC))},sf.prototype.viewBoundingSphere=function(e,t){if(!(0,y.Z)(e))throw new v.Z("boundingSphere is required.");if(this._mode===eB.Z.MORPHING)throw new v.Z("viewBoundingSphere is not supported while morphing.");t=lV(this,e,t),this.lookAt(e.center,t)};let lH=new z.Z,lG=new _.Z,lj=new _.Z,lW=new _.Z,lq=new _.Z,lY=new eH.Z,lX=new rq.Z,l$=new rW.Z;sf.prototype.flyToBoundingSphere=function(e,t){let i,n,r;if(!(0,y.Z)(e))throw new v.Z("boundingSphere is required.");t=(0,Z.Z)(t,Z.Z.EMPTY_OBJECT);let o=this._mode===eB.Z.SCENE2D||this._mode===eB.Z.COLUMBUS_VIEW;this._setTransform(z.Z.IDENTITY);let a=lV(this,e,t.offset);i=o?_.Z.multiplyByScalar(_.Z.UNIT_Z,a.range,lG):la(a.heading,a.pitch,a.range);let s=et.Z.eastNorthUpToFixedFrame(e.center,T.Z.WGS84,lH);if(z.Z.multiplyByPoint(s,i,i),!o){if(n=_.Z.subtract(e.center,i,lj),_.Z.normalize(n,n),r=z.Z.multiplyByPointAsVector(s,_.Z.UNIT_Z,lW),1-Math.abs(_.Z.dot(n,r))<F.Z.EPSILON6){let e=rq.Z.fromAxisAngle(n,a.heading,lX),t=rW.Z.fromQuaternion(e,l$);_.Z.fromCartesian4(z.Z.getColumn(s,1,lY),r),rW.Z.multiplyByVector(t,r,r)}let t=_.Z.cross(n,r,lq);_.Z.cross(t,n,r),_.Z.normalize(r,r)}this.flyTo({destination:i,orientation:{direction:n,up:r},duration:t.duration,complete:t.complete,cancel:t.cancel,endTransform:t.endTransform,maximumHeight:t.maximumHeight,easingFunction:t.easingFunction,flyOverLongitude:t.flyOverLongitude,flyOverLongitudeWeight:t.flyOverLongitudeWeight,pitchAdjustHeight:t.pitchAdjustHeight})};let lK=new _.Z,lQ=new _.Z,lJ=new _.Z,l0=new _.Z,l1=[new _.Z,new _.Z,new _.Z,new _.Z],l2=new L.Z,l3=new _.Z,l4=[new C.Z,new C.Z,new C.Z,new C.Z];function l5(e,t,i,n,r,o){l2.x=e,l2.y=t;let a=n.pickEllipsoid(l2,r,l3);return(0,y.Z)(a)?(l4[i]=r.cartesianToCartographic(a,l4[i]),1):(l4[i]=r.cartesianToCartographic(o[i],l4[i]),0)}sf.prototype.computeViewRectangle=function(e,t){e=(0,Z.Z)(e,T.Z.WGS84);let i=this.frustum.computeCullingVolume(this.positionWC,this.directionWC,this.upWC),n=new S.Z(_.Z.ZERO,e.maximumRadius);if(i.computeVisibility(n)===eX.Z.OUTSIDE)return;let r=this._scene.canvas,o=r.clientWidth,a=r.clientHeight,s=0,l=function(e,t){let i,n;let r=t.radii,o=e.positionWC,a=_.Z.multiplyComponents(t.oneOverRadii,o,lK),s=_.Z.magnitude(a),l=_.Z.normalize(a,lQ);_.Z.equalsEpsilon(l,_.Z.UNIT_Z,F.Z.EPSILON10)?(i=new _.Z(0,1,0),n=new _.Z(0,0,1)):(i=_.Z.normalize(_.Z.cross(_.Z.UNIT_Z,l,lJ),lJ),n=_.Z.normalize(_.Z.cross(l,i,l0),l0));let c=Math.sqrt(_.Z.magnitudeSquared(a)-1),u=_.Z.multiplyByScalar(l,1/s,lK),h=c/s,d=_.Z.multiplyByScalar(i,h,lQ),f=_.Z.multiplyByScalar(n,h,lJ),p=_.Z.add(u,f,l1[0]);_.Z.subtract(p,d,p),_.Z.multiplyComponents(r,p,p);let m=_.Z.subtract(u,f,l1[1]);_.Z.subtract(m,d,m),_.Z.multiplyComponents(r,m,m);let g=_.Z.subtract(u,f,l1[2]);_.Z.add(g,d,g),_.Z.multiplyComponents(r,g,g);let Z=_.Z.add(u,f,l1[3]);return _.Z.add(Z,d,Z),_.Z.multiplyComponents(r,Z,Z),l1}(this,e);if((s+=l5(0,0,0,this,e,l)+l5(0,a,1,this,e,l)+l5(o,a,2,this,e,l)+l5(o,0,3,this,e,l))<2)return U.Z.MAX_VALUE;t=U.Z.fromCartographicArray(l4,t);let c=0,u=l4[3].longitude;for(let e=0;e<4;++e){let t=l4[e].longitude,i=Math.abs(t-u);i>F.Z.PI?c+=F.Z.TWO_PI-i:c+=i,u=t}return F.Z.equalsEpsilon(Math.abs(c),F.Z.TWO_PI,F.Z.EPSILON9)&&(t.west=-F.Z.PI,t.east=F.Z.PI,l4[0].latitude>=0?t.north=F.Z.PI_OVER_TWO:t.south=-F.Z.PI_OVER_TWO),t},sf.prototype.switchToPerspectiveFrustum=function(){if(this._mode===eB.Z.SCENE2D||this.frustum instanceof o8)return;let e=this._scene;this.frustum=new o8,this.frustum.aspectRatio=e.drawingBufferWidth/e.drawingBufferHeight,this.frustum.fov=F.Z.toRadians(60)},sf.prototype.switchToOrthographicFrustum=function(){if(this._mode===eB.Z.SCENE2D||this.frustum instanceof e$.Z)return;let e=sF(this),t=this._scene;this.frustum=new e$.Z,this.frustum.aspectRatio=t.drawingBufferWidth/t.drawingBufferHeight,this.frustum.width=e},sf.clone=function(e,t){return(0,y.Z)(t)||(t=new sf(e._scene)),_.Z.clone(e.position,t.position),_.Z.clone(e.direction,t.direction),_.Z.clone(e.up,t.up),_.Z.clone(e.right,t.right),z.Z.clone(e._transform,t.transform),t._transformChanged=!0,t.frustum=e.frustum.clone(),t};var l9=i(493),l8=function(e){D.Z.typeOf.object("options",e),D.Z.typeOf.number("options.pass",e.pass),this.pass=e.pass,this.commandList=e.commandList,this.camera=e.camera,this.cullingVolume=e.cullingVolume,this.ready=!1},l6=i(4989),l7=i(4355);let ce="#ffffff",ct="#48b";function ci(e,t){this.credit=e,this.count=(0,Z.Z)(t,1)}let cn="cesium-credit-delimiter";function cr(e){let t=document.createElement("span");return t.textContent=e,t.className=cn,t}function co(e,t){if((0,y.Z)(t)){let i=document.createElement(t);i._creditId=e._creditId,i.appendChild(e),e=i}return e}function ca(e,t,i,n){let r=e.childNodes,o=-1;t.sort(function(e,t){return t.count-e.count});for(let a=0;a<t.length;++a){let s=t[a].credit;if((0,y.Z)(s)){if(o=a,(0,y.Z)(i)&&(o*=2,a>0)){let t=o-1;if(r.length<=t)e.appendChild(cr(i));else{let n=r[t];n.className!==cn&&e.replaceChild(cr(i),n)}}let t=s.element;if(r.length<=o)e.appendChild(co(t,n));else{let i=r[o];i._creditId!==s._id&&e.replaceChild(co(t,n),i)}}}for(++o;o<r.length;)e.removeChild(r[o])}function cs(e,t){let i=`${e} {`;for(let e in t)t.hasOwnProperty(e)&&(i+=`${e}: ${t[e]}; `);return i+" }\n"}function cl(e,t,i){D.Z.defined("container",e);let n=this;i=(0,Z.Z)(i,document.body);let r=document.createElement("div");r.className="cesium-credit-lightbox-overlay",i.appendChild(r);let o=document.createElement("div");function a(e){o.contains(e.target)||n.hideLightbox()}o.className="cesium-credit-lightbox",r.appendChild(o),r.addEventListener("click",a,!1);let s=document.createElement("div");s.className="cesium-credit-lightbox-title",s.textContent="Data provided by:",o.appendChild(s);let l=document.createElement("a");l.onclick=this.hideLightbox.bind(this),l.innerHTML="×",l.className="cesium-credit-lightbox-close",o.appendChild(l);let c=document.createElement("ul");o.appendChild(c);let u=document.createElement("div");u.className="cesium-credit-logoContainer",u.style.display="inline",e.appendChild(u);let h=document.createElement("div");h.className="cesium-credit-textContainer",h.style.display="inline",e.appendChild(h);let d=document.createElement("a");d.className="cesium-credit-expand-link",d.onclick=this.showLightbox.bind(this),d.textContent="Data attribution",e.appendChild(d),function(e){let t="";t+=cs(".cesium-credit-lightbox-overlay",{display:"none","z-index":"1",position:"absolute",top:"0",left:"0",width:"100%",height:"100%","background-color":"rgba(80, 80, 80, 0.8)"})+cs(".cesium-credit-lightbox",{"background-color":"#303336",color:ce,position:"relative","min-height":"100px",margin:"auto"})+cs(".cesium-credit-lightbox > ul > li a, .cesium-credit-lightbox > ul > li a:visited",{color:ce})+cs(".cesium-credit-lightbox > ul > li a:hover",{color:ct})+cs(".cesium-credit-lightbox.cesium-credit-lightbox-expanded",{border:"1px solid #444","border-radius":"5px","max-width":"370px"})+cs(".cesium-credit-lightbox.cesium-credit-lightbox-mobile",{height:"100%",width:"100%"})+cs(".cesium-credit-lightbox-title",{padding:"20px 20px 0 20px"})+cs(".cesium-credit-lightbox-close",{"font-size":"18pt",cursor:"pointer",position:"absolute",top:"0",right:"6px",color:ce})+cs(".cesium-credit-lightbox-close:hover",{color:ct})+cs(".cesium-credit-lightbox > ul",{margin:"0",padding:"12px 20px 12px 40px","font-size":"13px"})+cs(".cesium-credit-lightbox > ul > li",{"padding-bottom":"6px"})+cs(".cesium-credit-lightbox > ul > li *",{padding:"0",margin:"0"})+cs(".cesium-credit-expand-link",{"padding-left":"5px",cursor:"pointer","text-decoration":"underline",color:ce})+cs(".cesium-credit-expand-link:hover",{color:ct})+cs(".cesium-credit-text",{color:ce})+cs(".cesium-credit-textContainer *, .cesium-credit-logoContainer *",{display:"inline"});let i=(0,Z.Z)(function(e){if(e.shadowRoot)return e.shadowRoot;if(e.getRootNode){let t=e.getRootNode();if(t instanceof ShadowRoot)return t}}(e),document.head),n=document.createElement("style");n.innerHTML=t,i.appendChild(n)}(e);let f=tE.Z.clone(cl.cesiumCredit);this._delimiter=(0,Z.Z)(t," • "),this._screenContainer=h,this._cesiumCreditContainer=u,this._lastViewportHeight=void 0,this._lastViewportWidth=void 0,this._lightboxCredits=o,this._creditList=c,this._lightbox=r,this._hideLightbox=a,this._expandLink=d,this._expanded=!1,this._staticCredits=[],this._cesiumCredit=f,this._previousCesiumCredit=void 0,this._currentCesiumCredit=f,this._creditDisplayElementPool=[],this._creditDisplayElementIndex=0,this._currentFrameCredits={screenCredits:new l6.Z,lightboxCredits:new l6.Z},this._defaultCredit=void 0,this.viewport=i,this.container=e}function cc(e,t,i,n){n=(0,Z.Z)(n,1);let r=t.get(i.id);if((0,y.Z)(r))r.count<Number.MAX_VALUE&&(r.count+=n);else{let o=e._creditDisplayElementPool,a=e._creditDisplayElementPoolIndex;a<o.length?((r=o[a]).credit=i,r.count=n):(r=new ci(i,n),o.push(r)),++e._creditDisplayElementPoolIndex,t.set(i.id,r)}}function cu(){if(!(0,y.Z)(d)){let e=(0,m.Z)("Assets/Images/ion-credit.png");0!==e.indexOf("http://")&&0!==e.indexOf("https://")&&0!==e.indexOf("data:")&&(e=new l7(e).path()),d=new tE.Z(`<a href="https://cesium.com/" target="_blank"><img src="${e}" title="Cesium ion"/></a>`,!0)}return cl._cesiumCreditInitialized||(cl._cesiumCredit=d,cl._cesiumCreditInitialized=!0),d}cl.prototype.addCreditToNextFrame=function(e){if(D.Z.defined("credit",e),e.isIon()){(0,y.Z)(this._defaultCredit)||(this._defaultCredit=tE.Z.clone(cu())),this._currentCesiumCredit=this._defaultCredit;return}cc(this,e.showOnScreen?this._currentFrameCredits.screenCredits:this._currentFrameCredits.lightboxCredits,e)},cl.prototype.addStaticCredit=function(e){D.Z.defined("credit",e);let t=this._staticCredits;!function(e,t){let i=e.length;for(let n=0;n<i;n++){let i=e[n];if(tE.Z.equals(i,t))return!0}return!1}(t,e)&&t.push(e)},cl.prototype.removeStaticCredit=function(e){D.Z.defined("credit",e);let t=this._staticCredits,i=t.indexOf(e);-1!==i&&t.splice(i,1)},cl.prototype.showLightbox=function(){this._lightbox.style.display="block",this._expanded=!0},cl.prototype.hideLightbox=function(){this._lightbox.style.display="none",this._expanded=!1},cl.prototype.update=function(){this._expanded&&function(e){let t=e._lightboxCredits,i=e.viewport.clientWidth,n=e.viewport.clientHeight;i!==e._lastViewportWidth&&(i<576?(t.className="cesium-credit-lightbox cesium-credit-lightbox-mobile",t.style.marginTop="0"):(t.className="cesium-credit-lightbox cesium-credit-lightbox-expanded",t.style.marginTop=`${Math.floor((n-t.clientHeight)*.5)}px`),e._lastViewportWidth=i),i>=576&&n!==e._lastViewportHeight&&(t.style.marginTop=`${Math.floor((n-t.clientHeight)*.5)}px`,e._lastViewportHeight=n)}(this)},cl.prototype.beginFrame=function(){let e=this._currentFrameCredits;this._creditDisplayElementPoolIndex=0;let t=e.screenCredits,i=e.lightboxCredits;t.removeAll(),i.removeAll();let n=this._staticCredits;for(let e=0;e<n.length;++e){let r=n[e],o=r.showOnScreen?t:i;r.isIon()&&tE.Z.equals(cl.cesiumCredit,this._cesiumCredit)||cc(this,o,r,Number.MAX_VALUE)}tE.Z.equals(cl.cesiumCredit,this._cesiumCredit)||(this._cesiumCredit=tE.Z.clone(cl.cesiumCredit)),this._currentCesiumCredit=this._cesiumCredit},cl.prototype.endFrame=function(){let e=this._currentFrameCredits.screenCredits.values;ca(this._screenContainer,e,this._delimiter,void 0);let t=this._currentFrameCredits.lightboxCredits.values;this._expandLink.style.display=t.length>0?"inline":"none",ca(this._creditList,t,void 0,"li"),function(e){let t=e._previousCesiumCredit,i=e._currentCesiumCredit;tE.Z.equals(i,t)||((0,y.Z)(t)&&e._cesiumCreditContainer.removeChild(t.element),(0,y.Z)(i)&&e._cesiumCreditContainer.appendChild(i.element),e._previousCesiumCredit=i)}(this)},cl.prototype.destroy=function(){return this._lightbox.removeEventListener("click",this._hideLightbox,!1),this.container.removeChild(this._cesiumCreditContainer),this.container.removeChild(this._screenContainer),this.container.removeChild(this._expandLink),this.viewport.removeChild(this._lightbox),(0,b.Z)(this)},cl.prototype.isDestroyed=function(){return!1},cl._cesiumCredit=void 0,cl._cesiumCreditInitialized=!1,Object.defineProperties(cl,{cesiumCredit:{get:function(){return cu(),cl._cesiumCredit},set:function(e){cl._cesiumCredit=e,cl._cesiumCreditInitialized=!0}}}),cl.CreditDisplayElement=ci;var ch=i(258);function cd(e){let t,i;D.Z.typeOf.object("options",e),D.Z.typeOf.object("options.frustum",e.frustum),D.Z.typeOf.object("options.origin",e.origin),D.Z.typeOf.object("options.orientation",e.orientation);let n=e.frustum,r=e.orientation,o=e.origin,a=(0,Z.Z)(e.vertexFormat,oT.Z.DEFAULT),s=(0,Z.Z)(e._drawNearPlane,!0);n instanceof o8?(t=0,i=o8.packedLength):n instanceof e$.Z&&(t=1,i=e$.Z.packedLength),this._frustumType=t,this._frustum=n.clone(),this._origin=_.Z.clone(o),this._orientation=rq.Z.clone(r),this._drawNearPlane=s,this._vertexFormat=a,this._workerName="createFrustumGeometry",this.packedLength=2+i+_.Z.packedLength+rq.Z.packedLength+oT.Z.packedLength}cd.pack=function(e,t,i){D.Z.typeOf.object("value",e),D.Z.defined("array",t),i=(0,Z.Z)(i,0);let n=e._frustumType,r=e._frustum;return t[i++]=n,0===n?(o8.pack(r,t,i),i+=o8.packedLength):(e$.Z.pack(r,t,i),i+=e$.Z.packedLength),_.Z.pack(e._origin,t,i),i+=_.Z.packedLength,rq.Z.pack(e._orientation,t,i),i+=rq.Z.packedLength,oT.Z.pack(e._vertexFormat,t,i),t[i+=oT.Z.packedLength]=e._drawNearPlane?1:0,t};let cf=new o8,cp=new e$.Z,cm=new rq.Z,c_=new _.Z,cg=new oT.Z;function cZ(e,t,i,n,r,o,a,s){let l=e/3*2;for(let r=0;r<4;++r)(0,y.Z)(t)&&(t[e]=o.x,t[e+1]=o.y,t[e+2]=o.z),(0,y.Z)(i)&&(i[e]=a.x,i[e+1]=a.y,i[e+2]=a.z),(0,y.Z)(n)&&(n[e]=s.x,n[e+1]=s.y,n[e+2]=s.z),e+=3;r[l]=0,r[l+1]=0,r[l+2]=1,r[l+3]=0,r[l+4]=1,r[l+5]=1,r[l+6]=0,r[l+7]=1}cd.unpack=function(e,t,i){let n;D.Z.defined("array",e),t=(0,Z.Z)(t,0);let r=e[t++];0===r?(n=o8.unpack(e,t,cf),t+=o8.packedLength):(n=e$.Z.unpack(e,t,cp),t+=e$.Z.packedLength);let o=_.Z.unpack(e,t,c_);t+=_.Z.packedLength;let a=rq.Z.unpack(e,t,cm);t+=rq.Z.packedLength;let s=oT.Z.unpack(e,t,cg),l=1===e[t+=oT.Z.packedLength];if(!(0,y.Z)(i))return new cd({frustum:n,origin:o,orientation:a,vertexFormat:s,_drawNearPlane:l});let c=r===i._frustumType?i._frustum:void 0;return i._frustum=n.clone(c),i._frustumType=r,i._origin=_.Z.clone(o,i._origin),i._orientation=rq.Z.clone(a,i._orientation),i._vertexFormat=oT.Z.clone(s,i._vertexFormat),i._drawNearPlane=l,i};let cy=new rW.Z,cb=new z.Z,cv=new z.Z,cT=new _.Z,cE=new _.Z,cx=new _.Z,cw=new _.Z,cS=new _.Z,cC=new _.Z,cA=[,,,],cI=[,,,,];cI[0]=new eH.Z(-1,-1,1,1),cI[1]=new eH.Z(1,-1,1,1),cI[2]=new eH.Z(1,1,1,1),cI[3]=new eH.Z(-1,1,1,1);let cO=[,,,,];for(let e=0;e<4;++e)cO[e]=new eH.Z;function cD(e){let t,i;D.Z.typeOf.object("options",e),D.Z.typeOf.object("options.frustum",e.frustum),D.Z.typeOf.object("options.origin",e.origin),D.Z.typeOf.object("options.orientation",e.orientation);let n=e.frustum,r=e.orientation,o=e.origin,a=(0,Z.Z)(e._drawNearPlane,!0);n instanceof o8?(t=0,i=o8.packedLength):n instanceof e$.Z&&(t=1,i=e$.Z.packedLength),this._frustumType=t,this._frustum=n.clone(),this._origin=_.Z.clone(o),this._orientation=rq.Z.clone(r),this._drawNearPlane=a,this._workerName="createFrustumOutlineGeometry",this.packedLength=2+i+_.Z.packedLength+rq.Z.packedLength}cd._computeNearFarPlanes=function(e,t,i,n,r,o,a,s){let l,c;let u=rW.Z.fromQuaternion(t,cy),h=(0,Z.Z)(o,cT),d=(0,Z.Z)(a,cE),f=(0,Z.Z)(s,cx);h=rW.Z.getColumn(u,0,h),d=rW.Z.getColumn(u,1,d),f=rW.Z.getColumn(u,2,f),_.Z.normalize(h,h),_.Z.normalize(d,d),_.Z.normalize(f,f),_.Z.negate(h,h);let p=z.Z.computeView(e,f,d,h,cb),m=n.projectionMatrix;if(0===i){let e=z.Z.multiply(m,p,cv);c=z.Z.inverse(e,cv)}else l=z.Z.inverseTransformation(p,cv);(0,y.Z)(c)?(cA[0]=n.near,cA[1]=n.far):(cA[0]=0,cA[1]=n.near,cA[2]=n.far);for(let t=0;t<2;++t)for(let i=0;i<4;++i){let o=eH.Z.clone(cI[i],cO[i]);if((0,y.Z)(c)){let i=1/(o=z.Z.multiplyByVector(c,o,o)).w;_.Z.multiplyByScalar(o,i,o),_.Z.subtract(o,e,o),_.Z.normalize(o,o);let n=_.Z.dot(f,o);_.Z.multiplyByScalar(o,cA[t]/n,o),_.Z.add(o,e,o)}else{let e=n.offCenterFrustum;(0,y.Z)(e)&&(n=e);let i=cA[t],r=cA[t+1];o.x=(o.x*(n.right-n.left)+n.left+n.right)*.5,o.y=(o.y*(n.top-n.bottom)+n.bottom+n.top)*.5,o.z=(o.z*(i-r)-i-r)*.5,o.w=1,z.Z.multiplyByVector(l,o,o)}r[12*t+3*i]=o.x,r[12*t+3*i+1]=o.y,r[12*t+3*i+2]=o.z}},cd.createGeometry=function(e){let t=e._frustumType,i=e._frustum,n=e._origin,r=e._orientation,o=e._drawNearPlane,a=e._vertexFormat,s=o?6:5,l=new Float64Array(72);cd._computeNearFarPlanes(n,r,t,i,l);let c=24;l[24]=l[12],l[c+1]=l[13],l[c+2]=l[14],l[c+3]=l[0],l[c+4]=l[1],l[c+5]=l[2],l[c+6]=l[9],l[c+7]=l[10],l[c+8]=l[11],l[c+9]=l[21],l[c+10]=l[22],l[c+11]=l[23],l[c+=12]=l[15],l[c+1]=l[16],l[c+2]=l[17],l[c+3]=l[3],l[c+4]=l[4],l[c+5]=l[5],l[c+6]=l[0],l[c+7]=l[1],l[c+8]=l[2],l[c+9]=l[12],l[c+10]=l[13],l[c+11]=l[14],l[c+=12]=l[3],l[c+1]=l[4],l[c+2]=l[5],l[c+3]=l[15],l[c+4]=l[16],l[c+5]=l[17],l[c+6]=l[18],l[c+7]=l[19],l[c+8]=l[20],l[c+9]=l[6],l[c+10]=l[7],l[c+11]=l[8],l[c+=12]=l[6],l[c+1]=l[7],l[c+2]=l[8],l[c+3]=l[18],l[c+4]=l[19],l[c+5]=l[20],l[c+6]=l[21],l[c+7]=l[22],l[c+8]=l[23],l[c+9]=l[9],l[c+10]=l[10],l[c+11]=l[11],o||(l=l.subarray(12));let u=new ch.Z({position:new al.Z({componentDatatype:V.Z.DOUBLE,componentsPerAttribute:3,values:l})});if((0,y.Z)(a.normal)||(0,y.Z)(a.tangent)||(0,y.Z)(a.bitangent)||(0,y.Z)(a.st)){let e=(0,y.Z)(a.normal)?new Float32Array(12*s):void 0,t=(0,y.Z)(a.tangent)?new Float32Array(12*s):void 0,i=(0,y.Z)(a.bitangent)?new Float32Array(12*s):void 0,n=(0,y.Z)(a.st)?new Float32Array(8*s):void 0,r=_.Z.negate(cT,cw),l=_.Z.negate(cE,cS),h=_.Z.negate(cx,cC);c=0,o&&(cZ(c,e,t,i,n,h,cT,cE),c+=12),cZ(c,e,t,i,n,cx,r,cE),cZ(c+=12,e,t,i,n,r,h,cE),cZ(c+=12,e,t,i,n,l,h,r),cZ(c+=12,e,t,i,n,cT,cx,cE),cZ(c+=12,e,t,i,n,cE,cx,r),(0,y.Z)(e)&&(u.normal=new al.Z({componentDatatype:V.Z.FLOAT,componentsPerAttribute:3,values:e})),(0,y.Z)(t)&&(u.tangent=new al.Z({componentDatatype:V.Z.FLOAT,componentsPerAttribute:3,values:t})),(0,y.Z)(i)&&(u.bitangent=new al.Z({componentDatatype:V.Z.FLOAT,componentsPerAttribute:3,values:i})),(0,y.Z)(n)&&(u.st=new al.Z({componentDatatype:V.Z.FLOAT,componentsPerAttribute:2,values:n}))}let h=new Uint16Array(6*s);for(let e=0;e<s;++e){let t=6*e,i=4*e;h[t]=i,h[t+1]=i+1,h[t+2]=i+2,h[t+3]=i,h[t+4]=i+2,h[t+5]=i+3}return new as.Z({attributes:u,indices:h,primitiveType:eK.Z.TRIANGLES,boundingSphere:S.Z.fromVertices(l)})},cD.pack=function(e,t,i){D.Z.typeOf.object("value",e),D.Z.defined("array",t),i=(0,Z.Z)(i,0);let n=e._frustumType,r=e._frustum;return t[i++]=n,0===n?(o8.pack(r,t,i),i+=o8.packedLength):(e$.Z.pack(r,t,i),i+=e$.Z.packedLength),_.Z.pack(e._origin,t,i),i+=_.Z.packedLength,rq.Z.pack(e._orientation,t,i),t[i+=rq.Z.packedLength]=e._drawNearPlane?1:0,t};let cP=new o8,cR=new e$.Z,cN=new rq.Z,cL=new _.Z;function cM(e){if(e=(0,Z.Z)(e,Z.Z.EMPTY_OBJECT),!(0,y.Z)(e.camera))throw new v.Z("options.camera is required.");this._camera=e.camera,this._frustumSplits=e.frustumSplits,this._color=(0,Z.Z)(e.color,A.Z.CYAN),this._updateOnChange=(0,Z.Z)(e.updateOnChange,!0),this.show=(0,Z.Z)(e.show,!0),this.id=e.id,this._id=void 0,this._outlinePrimitives=[],this._planesPrimitives=[]}cD.unpack=function(e,t,i){let n;D.Z.defined("array",e),t=(0,Z.Z)(t,0);let r=e[t++];0===r?(n=o8.unpack(e,t,cP),t+=o8.packedLength):(n=e$.Z.unpack(e,t,cR),t+=e$.Z.packedLength);let o=_.Z.unpack(e,t,cL);t+=_.Z.packedLength;let a=rq.Z.unpack(e,t,cN),s=1===e[t+=rq.Z.packedLength];if(!(0,y.Z)(i))return new cD({frustum:n,origin:o,orientation:a,_drawNearPlane:s});let l=r===i._frustumType?i._frustum:void 0;return i._frustum=n.clone(l),i._frustumType=r,i._origin=_.Z.clone(o,i._origin),i._orientation=rq.Z.clone(a,i._orientation),i._drawNearPlane=s,i},cD.createGeometry=function(e){let t,i;let n=e._frustumType,r=e._frustum,o=e._origin,a=e._orientation,s=e._drawNearPlane,l=new Float64Array(24);cd._computeNearFarPlanes(o,a,n,r,l);let c=new ch.Z({position:new al.Z({componentDatatype:V.Z.DOUBLE,componentsPerAttribute:3,values:l})}),u=s?2:1,h=new Uint16Array(8*(u+1)),d=s?0:1;for(;d<2;++d)t=s?8*d:0,i=4*d,h[t]=i,h[t+1]=i+1,h[t+2]=i+1,h[t+3]=i+2,h[t+4]=i+2,h[t+5]=i+3,h[t+6]=i+3,h[t+7]=i;for(d=0;d<2;++d)t=(u+d)*8,i=4*d,h[t]=i,h[t+1]=i+4,h[t+2]=i+1,h[t+3]=i+5,h[t+4]=i+2,h[t+5]=i+6,h[t+6]=i+3,h[t+7]=i+7;return new as.Z({attributes:c,indices:h,primitiveType:eK.Z.LINES,boundingSphere:S.Z.fromVertices(l)})};let cF=new _.Z,cz=new rW.Z,cB=new rq.Z,cU=new o8,ck=new o1,cV=new e$.Z,cH=new rc.Z,cG=new A.Z,cj=[1,1e5];function cW(e){this._rs=void 0,this._sp=void 0,this._va=void 0,this._command=void 0,this._mode=void 0,this._useLogDepth=!1,this._ellipsoidOffset=(0,Z.Z)(e,0)}cM.prototype.update=function(e){let t,i;if(!this.show)return;let n=this._planesPrimitives,r=this._outlinePrimitives;if(this._updateOnChange){for(t=0,i=n.length;t<i;++t)r[t]=r[t]&&r[t].destroy(),n[t]=n[t]&&n[t].destroy();n.length=0,r.length=0}if(0===n.length){let e,i;let o=this._camera,a=o.frustum;e=a instanceof o8?cU:a instanceof o1?ck:a instanceof e$.Z?cV:cH,e=a.clone(e);let s=this._frustumSplits;!(0,y.Z)(s)||s.length<=1?((s=cj)[0]=this._camera.frustum.near,s[1]=this._camera.frustum.far,i=1):i=s.length-1;let l=o.positionWC,c=o.directionWC,u=o.upWC,h=o.rightWC;h=_.Z.negate(h,cF),rW.Z.setColumn(cz,0,h,cz),rW.Z.setColumn(cz,1,u,cz),rW.Z.setColumn(cz,2,c,cz);let d=rq.Z.fromRotationMatrix(cz,cB);for(t=0,n.length=r.length=i;t<i;++t)e.near=s[t],e.far=s[t+1],n[t]=new i3.Z({geometryInstances:new eq.Z({geometry:new cd({origin:l,orientation:d,frustum:e,_drawNearPlane:0===t}),attributes:{color:ej.Z.fromColor(A.Z.fromAlpha(this._color,.1,cG))},id:this.id,pickPrimitive:this}),appearance:new i2.Z({translucent:!0,flat:!0}),asynchronous:!1}),r[t]=new i3.Z({geometryInstances:new eq.Z({geometry:new cD({origin:l,orientation:d,frustum:e,_drawNearPlane:0===t}),attributes:{color:ej.Z.fromColor(this._color)},id:this.id,pickPrimitive:this}),appearance:new i2.Z({translucent:!1,flat:!0}),asynchronous:!1})}for(t=0,i=n.length;t<i;++t)r[t].update(e),n[t].update(e)},cM.prototype.isDestroyed=function(){return!1},cM.prototype.destroy=function(){let e=this._planesPrimitives.length;for(let t=0;t<e;++t)this._outlinePrimitives[t]=this._outlinePrimitives[t]&&this._outlinePrimitives[t].destroy(),this._planesPrimitives[t]=this._planesPrimitives[t]&&this._planesPrimitives[t].destroy();return(0,b.Z)(this)};let cq=E.Z.supportsTypedArrays()?new Float32Array(12):[],cY=new _.Z,cX=new _.Z,c$=new _.Z,cK=new _.Z,cQ=new _.Z;function cJ(){}cW.prototype.update=function(e){if(this._mode=e.mode,e.mode!==eB.Z.SCENE3D)return;let t=e.context,i=e.mapProjection.ellipsoid.radii,n=new T.Z(i.x+this._ellipsoidOffset,i.y+this._ellipsoidOffset,i.z+this._ellipsoidOffset),r=e.useLogDepth;if((0,y.Z)(this._command)||(this._rs=e5.Z.fromCache({cull:{enabled:!0},depthTest:{enabled:!0},colorMask:{red:!1,green:!1,blue:!1,alpha:!1}}),this._command=new e3.Z({renderState:this._rs,boundingVolume:new S.Z(_.Z.ZERO,n.maximumRadius),pass:e4.Z.OPAQUE,owner:this})),!(0,y.Z)(this._sp)||this._useLogDepth!==r){this._useLogDepth=r;let e=new eD.Z({sources:["in vec4 position;\n\nout vec4 positionEC;\n\nvoid main()\n{\n positionEC = czm_modelView * position;\n gl_Position = czm_projection * positionEC;\n\n czm_vertexLogDepth();\n}\n"]}),i=new eD.Z({sources:["in vec4 positionEC;\n\nvoid main()\n{\n vec3 position;\n vec3 direction;\n if (czm_orthographicIn3D == 1.0)\n {\n vec2 uv = (gl_FragCoord.xy - czm_viewport.xy) / czm_viewport.zw;\n vec2 minPlane = vec2(czm_frustumPlanes.z, czm_frustumPlanes.y); // left, bottom\n vec2 maxPlane = vec2(czm_frustumPlanes.w, czm_frustumPlanes.x); // right, top\n position = vec3(mix(minPlane, maxPlane, uv), 0.0);\n direction = vec3(0.0, 0.0, -1.0);\n } \n else \n {\n position = vec3(0.0);\n direction = normalize(positionEC.xyz);\n }\n\n czm_ray ray = czm_ray(position, direction);\n\n vec3 ellipsoid_center = czm_view[3].xyz;\n\n czm_raySegment intersection = czm_rayEllipsoidIntersectionInterval(ray, ellipsoid_center, czm_ellipsoidInverseRadii);\n if (!czm_isEmpty(intersection))\n {\n out_FragColor = vec4(1.0, 1.0, 0.0, 1.0);\n }\n else\n {\n discard;\n }\n\n czm_writeLogDepth();\n}\n"]});r&&(i.defines.push("LOG_DEPTH"),e.defines.push("LOG_DEPTH")),this._sp=eL.Z.replaceCache({shaderProgram:this._sp,context:t,vertexShaderSource:e,fragmentShaderSource:i,attributeLocations:{position:0}}),this._command.shaderProgram=this._sp}let o=function(e,t){let i,n,r;let o=e.radii,a=t.camera;if(a.frustum instanceof e$.Z)i=_.Z.ZERO,n=a.rightWC,r=a.upWC;else{let t=a.positionWC,o=_.Z.multiplyComponents(e.oneOverRadii,t,cY),s=_.Z.normalize(o,cX),l=_.Z.normalize(_.Z.cross(_.Z.UNIT_Z,o,c$),c$),c=_.Z.normalize(_.Z.cross(s,l,cK),cK),u=_.Z.magnitude(o);i=_.Z.multiplyByScalar(s,1/u,cY);let h=Math.sqrt(u*u-1)/u;n=_.Z.multiplyByScalar(l,h,cX),r=_.Z.multiplyByScalar(c,h,c$)}let s=_.Z.add(i,r,cQ);_.Z.subtract(s,n,s),_.Z.multiplyComponents(o,s,s),_.Z.pack(s,cq,0);let l=_.Z.subtract(i,r,cQ);_.Z.subtract(l,n,l),_.Z.multiplyComponents(o,l,l),_.Z.pack(l,cq,3);let c=_.Z.add(i,r,cQ);_.Z.add(c,n,c),_.Z.multiplyComponents(o,c,c),_.Z.pack(c,cq,6);let u=_.Z.subtract(i,r,cQ);return _.Z.add(u,n,u),_.Z.multiplyComponents(o,u,u),_.Z.pack(u,cq,9),cq}(n,e);if((0,y.Z)(this._va))this._va.getAttribute(0).vertexBuffer.copyFromArrayView(o);else{let e=new as.Z({attributes:{position:new al.Z({componentDatatype:V.Z.FLOAT,componentsPerAttribute:3,values:o})},indices:[0,1,2,2,1,3],primitiveType:eK.Z.TRIANGLES});this._va=e9.Z.fromGeometry({context:t,geometry:e,attributeLocations:{position:0},bufferUsage:e1.Z.DYNAMIC_DRAW}),this._command.vertexArray=this._va}},cW.prototype.execute=function(e,t){this._mode===eB.Z.SCENE3D&&this._command.execute(e,t)},cW.prototype.isDestroyed=function(){return!1},cW.prototype.destroy=function(){this._sp=this._sp&&this._sp.destroy(),this._va=this._va&&this._va.destroy()};let c0=/\bgl_FragDepth\b/,c1=/\bdiscard\b/;cJ.createDepthOnlyDerivedCommand=function(e,t,i,n){let r,o;return(0,y.Z)(n)||(n={}),(0,y.Z)(n.depthOnlyCommand)&&(r=n.depthOnlyCommand.shaderProgram,o=n.depthOnlyCommand.renderState),n.depthOnlyCommand=e3.Z.shallowClone(t,n.depthOnlyCommand),(0,y.Z)(r)&&n.shaderProgramId===t.shaderProgram.id?(n.depthOnlyCommand.shaderProgram=r,n.depthOnlyCommand.renderState=o):(n.depthOnlyCommand.shaderProgram=function(e,t){let i=e.shaderCache.getDerivedShaderProgram(t,"depthOnly");if(!(0,y.Z)(i)){let n,r;let o=t._attributeLocations,a=t.fragmentShaderSource,s=!1,l=a.sources,c=l.length;for(n=0;n<c;++n)if(c0.test(l[n])||c1.test(l[n])){s=!0;break}let u=!1,h=a.defines;for(n=0,c=h.length;n<c;++n)if("LOG_DEPTH"===h[n]){u=!0;break}s||u?!s&&u&&(r="void main() \n{ \n out_FragColor = vec4(1.0); \n czm_writeLogDepth(); \n} \n",a=new eD.Z({defines:["LOG_DEPTH"],sources:[r]})):(r="void main() \n{ \n out_FragColor = vec4(1.0); \n} \n",a=new eD.Z({sources:[r]})),i=e.shaderCache.createDerivedShaderProgram(t,"depthOnly",{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:a,attributeLocations:o})}return i}(i,t.shaderProgram),n.depthOnlyCommand.renderState=function(e,t){let i=e._depthOnlyRenderStateCache,n=i[t.id];if(!(0,y.Z)(n)){let e=e5.Z.getState(t);e.depthMask=!0,e.colorMask={red:!1,green:!1,blue:!1,alpha:!1},n=e5.Z.fromCache(e),i[t.id]=n}return n}(e,t.renderState),n.shaderProgramId=t.shaderProgram.id),n};let c2=/\s+czm_writeLogDepth\(/,c3=/\s+czm_vertexLogDepth\(/;function c4(e){if(!(0,y.Z)(e))throw new v.Z("scene is required.");this._scene=e,this._lastAlpha=void 0,this._lastBeta=void 0,this._lastGamma=void 0,this._alpha=void 0,this._beta=void 0,this._gamma=void 0;let t=this;function i(e){let i=e.alpha;if(!(0,y.Z)(i)){t._alpha=void 0,t._beta=void 0,t._gamma=void 0;return}t._alpha=F.Z.toRadians(i),t._beta=F.Z.toRadians(e.beta),t._gamma=F.Z.toRadians(e.gamma)}window.addEventListener("deviceorientation",i,!1),this._removeListener=function(){window.removeEventListener("deviceorientation",i,!1)}}cJ.createLogDepthCommand=function(e,t,i){let n;return(0,y.Z)(i)||(i={}),(0,y.Z)(i.command)&&(n=i.command.shaderProgram),i.command=e3.Z.shallowClone(e,i.command),(0,y.Z)(n)&&i.shaderProgramId===e.shaderProgram.id?i.command.shaderProgram=n:(i.command.shaderProgram=function(e,t){if(t.fragmentShaderSource.defines.indexOf("LOG_DEPTH_READ_ONLY")>=0)return t;let i=e.shaderCache.getDerivedShaderProgram(t,"logDepth");if(!(0,y.Z)(i)){let n,r;let o=t._attributeLocations,a=t.vertexShaderSource.clone(),s=t.fragmentShaderSource.clone();a.defines=(0,y.Z)(a.defines)?a.defines.slice(0):[],a.defines.push("LOG_DEPTH"),s.defines=(0,y.Z)(s.defines)?s.defines.slice(0):[],s.defines.push("LOG_DEPTH");let l=!1,c=a.sources,u=c.length;for(n=0;n<u;++n)if(c3.test(c[n])){l=!0;break}if(!l){for(n=0;n<u;++n)c[n]=eD.Z.replaceMain(c[n],"czm_log_depth_main");r="\n\nvoid main() \n{ \n czm_log_depth_main(); \n czm_vertexLogDepth(); \n} \n",c.push(r)}for(n=0,u=(c=s.sources).length,l=!1;n<u;++n)c2.test(c[n])&&(l=!0);-1!==s.defines.indexOf("LOG_DEPTH_WRITE")&&(l=!0);let h="";if(!l){for(n=0;n<u;n++)c[n]=eD.Z.replaceMain(c[n],"czm_log_depth_main");h+="\nvoid main() \n{ \n czm_log_depth_main(); \n czm_writeLogDepth(); \n} \n"}c.push(h),i=e.shaderCache.createDerivedShaderProgram(t,"logDepth",{vertexShaderSource:a,fragmentShaderSource:s,attributeLocations:o})}return i}(t,e.shaderProgram),i.shaderProgramId=e.shaderProgram.id),i},cJ.createPickDerivedCommand=function(e,t,i,n){let r,o;return(0,y.Z)(n)||(n={}),(0,y.Z)(n.pickCommand)&&(r=n.pickCommand.shaderProgram,o=n.pickCommand.renderState),n.pickCommand=e3.Z.shallowClone(t,n.pickCommand),(0,y.Z)(r)&&n.shaderProgramId===t.shaderProgram.id?(n.pickCommand.shaderProgram=r,n.pickCommand.renderState=o):(n.pickCommand.shaderProgram=function(e,t,i){let n=e.shaderCache.getDerivedShaderProgram(t,"pick");if(!(0,y.Z)(n)){let r=t._attributeLocations,o=t.fragmentShaderSource,a=o.sources,s=a.length,l=a.some(e=>e.includes("out_FragData"))?"out_FragData_0":"out_FragColor",c=`void main () { czm_non_pick_main(); if (${l}.a == 0.0) { discard; } ${l} = ${i}; } `,u=Array(s+1);for(let e=0;e<s;++e)u[e]=eD.Z.replaceMain(a[e],"czm_non_pick_main");u[s]=c,o=new eD.Z({sources:u,defines:o.defines}),n=e.shaderCache.createDerivedShaderProgram(t,"pick",{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:o,attributeLocations:r})}return n}(i,t.shaderProgram,t.pickId),n.pickCommand.renderState=function(e,t){let i=e.picking.pickRenderStateCache,n=i[t.id];if(!(0,y.Z)(n)){let e=e5.Z.getState(t);e.blending.enabled=!1,e.depthMask=!0,n=e5.Z.fromCache(e),i[t.id]=n}return n}(e,t.renderState),n.shaderProgramId=t.shaderProgram.id),n},cJ.createHdrCommand=function(e,t,i){let n;return(0,y.Z)(i)||(i={}),(0,y.Z)(i.command)&&(n=i.command.shaderProgram),i.command=e3.Z.shallowClone(e,i.command),(0,y.Z)(n)&&i.shaderProgramId===e.shaderProgram.id?i.command.shaderProgram=n:(i.command.shaderProgram=function(e,t){let i=e.shaderCache.getDerivedShaderProgram(t,"HDR");if(!(0,y.Z)(i)){let n=t._attributeLocations,r=t.vertexShaderSource.clone(),o=t.fragmentShaderSource.clone();r.defines=(0,y.Z)(r.defines)?r.defines.slice(0):[],r.defines.push("HDR"),o.defines=(0,y.Z)(o.defines)?o.defines.slice(0):[],o.defines.push("HDR"),i=e.shaderCache.createDerivedShaderProgram(t,"HDR",{vertexShaderSource:r,fragmentShaderSource:o,attributeLocations:n})}return i}(t,e.shaderProgram),i.shaderProgramId=e.shaderProgram.id),i};let c5=new rq.Z,c9=new rq.Z,c8=new rW.Z;function c6(){this.enabled=!0,this.renderable=!0,this.density=2e-4,this.screenSpaceErrorFactor=2,this.minimumBrightness=.03}c4.prototype.update=function(){if(!(0,y.Z)(this._alpha))return;(0,y.Z)(this._lastAlpha)||(this._lastAlpha=this._alpha,this._lastBeta=this._beta,this._lastGamma=this._gamma);let e=this._lastAlpha-this._alpha,t=this._lastBeta-this._beta,i=this._lastGamma-this._gamma;(function(e,t,i,n){let r=e.direction,o=e.right,a=e.up,s=rq.Z.fromAxisAngle(r,i,c9),l=rq.Z.fromAxisAngle(o,n,c5),c=rq.Z.multiply(l,s,l),u=rq.Z.fromAxisAngle(a,t,c9);rq.Z.multiply(u,c,c);let h=rW.Z.fromQuaternion(c,c8);rW.Z.multiplyByVector(h,o,o),rW.Z.multiplyByVector(h,a,a),rW.Z.multiplyByVector(h,r,r)})(this._scene.camera,-e,t,i),this._lastAlpha=this._alpha,this._lastBeta=this._beta,this._lastGamma=this._gamma},c4.prototype.isDestroyed=function(){return!1},c4.prototype.destroy=function(){return this._removeListener(),(0,b.Z)(this)};let c7=[359.393,800.749,1275.6501,2151.1192,3141.7763,4777.5198,6281.2493,12364.307,15900.765,49889.0549,78026.8259,99260.7344,120036.3873,151011.0158,156091.1953,203849.3112,274866.9803,319916.3149,493552.0528,628733.5874],ue=[2e-5,2e-4,1e-4,7e-5,5e-5,4e-5,3e-5,19e-6,1e-5,85e-7,62e-7,58e-7,53e-7,52e-7,51e-7,42e-7,4e-6,34e-7,26e-7,22e-7];for(let e=0;e<ue.length;++e)ue[e]*=1e6;let ut=ue[1],ui=ue[ue.length-1];for(let e=0;e<ue.length;++e)ue[e]=(ue[e]-ui)/(ut-ui);let un=0,ur=new _.Z;c6.prototype.update=function(e){if(!(e.fog.enabled=this.enabled))return;e.fog.renderable=this.renderable;let t=e.camera,i=t.positionCartographic;if(!(0,y.Z)(i)||i.height>8e5||e.mode!==eB.Z.SCENE3D){e.fog.enabled=!1,e.fog.density=0;return}let n=i.height,r=function(e){let t;let i=c7.length;if(e<359.393)return un=0;if(e>c7[i-1])return un=i-2;if(e>=c7[un]){if(un+1<i&&e<c7[un+1])return un;if(un+2<i&&e<c7[un+2])return++un}else if(un-1>=0&&e>=c7[un-1])return--un;for(t=0;t<i-2&&(!(e>=c7[t])||!(e<c7[t+1]));++t);return un=t}(n),o=F.Z.clamp((n-c7[r])/(c7[r+1]-c7[r]),0,1),a=F.Z.lerp(ue[r],ue[r+1],o),s=1e6*this.density;a=a*(s-s/ut*ui)*1e-6;let l=_.Z.normalize(t.positionWC,ur);a*=1-Math.abs(_.Z.dot(t.directionWC,l)),e.fog.density=a,e.fog.sse=this.screenSpaceErrorFactor,e.fog.minimumBrightness=this.minimumBrightness};var uo=function(e,t,i){this.context=e,this.commandList=[],this.shadowMaps=[],this.brdfLutGenerator=void 0,this.environmentMap=void 0,this.sphericalHarmonicCoefficients=void 0,this.specularEnvironmentMaps=void 0,this.specularEnvironmentMapsMaximumLOD=void 0,this.mode=eB.Z.SCENE3D,this.morphTime=eB.Z.getMorphTime(eB.Z.SCENE3D),this.frameNumber=0,this.newFrame=!1,this.time=void 0,this.jobScheduler=i,this.mapProjection=void 0,this.camera=void 0,this.cameraUnderground=!1,this.globeTranslucencyState=void 0,this.cullingVolume=void 0,this.occluder=void 0,this.maximumScreenSpaceError=void 0,this.pixelRatio=1,this.passes={render:!1,pick:!1,pickVoxel:!1,depth:!1,postProcess:!1,offscreen:!1},this.creditDisplay=t,this.afterRender=[],this.scene3DOnly=!1,this.fog={enabled:!1,renderable:!1,density:void 0,sse:void 0,minimumBrightness:void 0},this.atmosphere=void 0,this.verticalExaggeration=1,this.verticalExaggerationRelativeHeight=0,this.shadowState={shadowsEnabled:!0,shadowMaps:[],lightShadowMaps:[],nearPlane:1,farPlane:5e3,closestObjectSize:1e3,lastDirtyTime:0,outOfView:!0},this.splitPosition=0,this.frustumSplits=[],this.backgroundColor=void 0,this.light=void 0,this.minimumDisableDepthTestDistance=void 0,this.invertClassification=!1,this.invertClassificationColor=void 0,this.useLogDepth=!1,this.tilesetPassState=void 0,this.minimumTerrainHeight=0};let ua={OPAQUE_FRONT_FACE:0,OPAQUE_BACK_FACE:1,DEPTH_ONLY_FRONT_FACE:2,DEPTH_ONLY_BACK_FACE:3,DEPTH_ONLY_FRONT_AND_BACK_FACE:4,TRANSLUCENT_FRONT_FACE:5,TRANSLUCENT_BACK_FACE:6,TRANSLUCENT_FRONT_FACE_MANUAL_DEPTH_TEST:7,TRANSLUCENT_BACK_FACE_MANUAL_DEPTH_TEST:8,PICK_FRONT_FACE:9,PICK_BACK_FACE:10,DERIVED_COMMANDS_MAXIMUM_LENGTH:11},us=ua.DERIVED_COMMANDS_MAXIMUM_LENGTH,ul=["opaqueFrontFaceCommand","opaqueBackFaceCommand","depthOnlyFrontFaceCommand","depthOnlyBackFaceCommand","depthOnlyFrontAndBackFaceCommand","translucentFrontFaceCommand","translucentBackFaceCommand","translucentFrontFaceManualDepthTestCommand","translucentBackFaceManualDepthTestCommand","pickFrontFaceCommand","pickBackFaceCommand"];function uc(){this._frontFaceAlphaByDistance=new eA.Z(0,1,0,1),this._backFaceAlphaByDistance=new eA.Z(0,1,0,1),this._frontFaceTranslucent=!1,this._backFaceTranslucent=!1,this._requiresManualDepthTest=!1,this._sunVisibleThroughGlobe=!1,this._environmentVisible=!1,this._useDepthPlane=!1,this._numberOfTextureUniforms=0,this._globeTranslucencyFramebuffer=void 0,this._rectangle=U.Z.clone(U.Z.MAX_VALUE),this._derivedCommandKey=0,this._derivedCommandsDirty=!1,this._derivedCommandPacks=void 0,this._derivedCommandTypes=Array(us),this._derivedBlendCommandTypes=Array(us),this._derivedPickCommandTypes=Array(us),this._derivedCommandTypesToUpdate=Array(us),this._derivedCommandsLength=0,this._derivedBlendCommandsLength=0,this._derivedPickCommandsLength=0,this._derivedCommandsToUpdateLength=0}function uu(e,t,i,n){return e?(0,y.Z)(i)?(eA.Z.clone(i,n),n.nearValue*=t,n.farValue*=t):(n.nearValue=t,n.farValue=t):(n.nearValue=1,n.farValue=1),n}function uh(e,t,i){return e&&(i.baseColor.alpha<1||t.nearValue<1||t.farValue<1)}function ud(e,t,i,n,r){let o=0,a=e._frontFaceTranslucent,s=e._backFaceTranslucent;if(!a)return o;let l=t.cameraUnderground,c=e._requiresManualDepthTest,u=n?ua.PICK_FRONT_FACE:c?ua.TRANSLUCENT_FRONT_FACE_MANUAL_DEPTH_TEST:ua.TRANSLUCENT_FRONT_FACE,h=n?ua.PICK_BACK_FACE:c?ua.TRANSLUCENT_BACK_FACE_MANUAL_DEPTH_TEST:ua.TRANSLUCENT_BACK_FACE;return t.mode===eB.Z.SCENE2D?(r[o++]=ua.DEPTH_ONLY_FRONT_FACE,r[o++]=u):s?(i||(r[o++]=ua.DEPTH_ONLY_FRONT_AND_BACK_FACE),l?(r[o++]=u,r[o++]=h):(r[o++]=h,r[o++]=u)):l?(i||(r[o++]=ua.DEPTH_ONLY_BACK_FACE),r[o++]=ua.OPAQUE_FRONT_FACE,r[o++]=h):(i||(r[o++]=ua.DEPTH_ONLY_FRONT_FACE),r[o++]=ua.OPAQUE_BACK_FACE,r[o++]=u),o}function uf(e,t){let i=e.indexOf(t);i>-1&&e.splice(i,1)}function up(e,t){return e.indexOf(t)>-1}function um(e,t){uf(e.defines,"TRANSLUCENT"),uf(t.defines,"TRANSLUCENT")}function u_(e,t){uf(e.defines,"GROUND_ATMOSPHERE"),uf(t.defines,"GROUND_ATMOSPHERE"),uf(e.defines,"FOG"),uf(t.defines,"FOG"),uf(e.defines,"TRANSLUCENT"),uf(t.defines,"TRANSLUCENT")}function ug(e,t){up(t.defines,"TILE_LIMIT_RECTANGLE")||up(t.defines,"ENABLE_CLIPPING_PLANES")||(t.sources=["void main() \n{ \n out_FragColor = vec4(1.0); \n} \n"])}function uZ(e,t){let i=t.sources,n=i.length;for(let e=0;e<n;++e)i[e]=eD.Z.replaceMain(i[e],"czm_globe_translucency_main");i.push("\n\nuniform sampler2D u_classificationTexture; \nvoid main() \n{ \n vec2 st = gl_FragCoord.xy / czm_viewport.zw; \n#ifdef MANUAL_DEPTH_TEST \n float logDepthOrDepth = czm_unpackDepth(texture(czm_globeDepthTexture, st)); \n if (logDepthOrDepth != 0.0) \n { \n vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, logDepthOrDepth); \n float depthEC = eyeCoordinate.z / eyeCoordinate.w; \n if (v_positionEC.z < depthEC) \n { \n discard; \n } \n } \n#endif \n czm_globe_translucency_main(); \n vec4 classificationColor = texture(u_classificationTexture, st); \n if (classificationColor.a > 0.0) \n { \n // Reverse premultiplication process to get the correct composited result of the classification primitives \n classificationColor.rgb /= classificationColor.a; \n } \n out_FragColor = classificationColor * vec4(classificationColor.aaa, 1.0) + out_FragColor * (1.0 - classificationColor.a); \n} \n")}function uy(e,t){uZ(e,t),uf(e.defines,"GROUND_ATMOSPHERE"),uf(t.defines,"GROUND_ATMOSPHERE"),uf(e.defines,"FOG"),uf(t.defines,"FOG")}function ub(e,t){uZ(e,t),e.defines.push("GENERATE_POSITION"),t.defines.push("MANUAL_DEPTH_TEST")}function uv(e,t){uy(e,t),e.defines.push("GENERATE_POSITION"),t.defines.push("MANUAL_DEPTH_TEST")}function uT(e,t){t.sources=["uniform sampler2D u_classificationTexture; \nvoid main() \n{ \n vec2 st = gl_FragCoord.xy / czm_viewport.zw; \n vec4 pickColor = texture(u_classificationTexture, st); \n if (pickColor == vec4(0.0)) \n { \n discard; \n } \n out_FragColor = pickColor; \n} \n"]}function uE(e){e.cull.face=ow.Z.BACK,e.cull.enabled=!0}function ux(e){e.cull.face=ow.Z.FRONT,e.cull.enabled=!0}function uw(e){e.cull.face=ow.Z.BACK,e.cull.enabled=!0,e.colorMask={red:!1,green:!1,blue:!1,alpha:!1}}function uS(e){e.cull.face=ow.Z.FRONT,e.cull.enabled=!0,e.colorMask={red:!1,green:!1,blue:!1,alpha:!1}}function uC(e){e.cull.enabled=!1,e.colorMask={red:!1,green:!1,blue:!1,alpha:!1}}function uA(e){e.cull.face=ow.Z.BACK,e.cull.enabled=!0,e.depthMask=!1,e.blending=e8.Z.ALPHA_BLEND}function uI(e){e.cull.face=ow.Z.FRONT,e.cull.enabled=!0,e.depthMask=!1,e.blending=e8.Z.ALPHA_BLEND}function uO(e){e.cull.face=ow.Z.BACK,e.cull.enabled=!0,e.blending.enabled=!1}function uD(e){e.cull.face=ow.Z.FRONT,e.cull.enabled=!0,e.blending.enabled=!1}function uP(e){return{u_classificationTexture:function(){return e._globeTranslucencyFramebuffer.classificationTexture}}}function uR(e){this.pass=e.pass,this.pickOnly=e.pickOnly,this.getShaderProgramFunction=e.getShaderProgramFunction,this.getRenderStateFunction=e.getRenderStateFunction,this.getUniformMapFunction=e.getUniformMapFunction,this.renderStateCache={}}Object.defineProperties(uc.prototype,{frontFaceAlphaByDistance:{get:function(){return this._frontFaceAlphaByDistance}},backFaceAlphaByDistance:{get:function(){return this._backFaceAlphaByDistance}},translucent:{get:function(){return this._frontFaceTranslucent}},sunVisibleThroughGlobe:{get:function(){return this._sunVisibleThroughGlobe}},environmentVisible:{get:function(){return this._environmentVisible}},useDepthPlane:{get:function(){return this._useDepthPlane}},numberOfTextureUniforms:{get:function(){return this._numberOfTextureUniforms}},rectangle:{get:function(){return this._rectangle}}}),uc.prototype.update=function(e){let t;let i=e.globe;if(!(0,y.Z)(i)||!i.show){this._frontFaceTranslucent=!1,this._backFaceTranslucent=!1,this._sunVisibleThroughGlobe=!0,this._environmentVisible=!0,this._useDepthPlane=!1;return}this._frontFaceAlphaByDistance=uu(i.translucency.enabled,i.translucency.frontFaceAlpha,i.translucency.frontFaceAlphaByDistance,this._frontFaceAlphaByDistance),this._backFaceAlphaByDistance=uu(i.translucency.enabled,i.translucency.backFaceAlpha,i.translucency.backFaceAlphaByDistance,this._backFaceAlphaByDistance),this._frontFaceTranslucent=uh(i.translucency.enabled,this._frontFaceAlphaByDistance,i),this._backFaceTranslucent=uh(i.translucency.enabled,this._backFaceAlphaByDistance,i),this._requiresManualDepthTest=this._frontFaceTranslucent&&!this._backFaceTranslucent&&!i.depthTestAgainstTerrain&&e.mode!==eB.Z.SCENE2D&&e.context.depthTexture,this._sunVisibleThroughGlobe=function(e,t){let i=e._frontFaceTranslucent,n=e._backFaceTranslucent;return i&&(t.cameraUnderground||n)}(this,e),this._environmentVisible=!e.cameraUnderground||this._frontFaceTranslucent,this._useDepthPlane=!e.cameraUnderground&&!this._frontFaceTranslucent,this._numberOfTextureUniforms=(t=0,this._frontFaceTranslucent&&++t,this._requiresManualDepthTest&&++t,t),this._rectangle=U.Z.clone(i.translucency.rectangle,this._rectangle),function(e,t){let i;e._derivedCommandsLength=ud(e,t,!1,!1,e._derivedCommandTypes),e._derivedBlendCommandsLength=ud(e,t,!0,!1,e._derivedBlendCommandTypes),e._derivedPickCommandsLength=ud(e,t,!1,!0,e._derivedPickCommandTypes);let n=0;for(i=0;i<e._derivedCommandsLength;++i)n|=1<<e._derivedCommandTypes[i];for(i=0;i<e._derivedBlendCommandsLength;++i)n|=1<<e._derivedBlendCommandTypes[i];for(i=0;i<e._derivedPickCommandsLength;++i)n|=1<<e._derivedPickCommandTypes[i];let r=0;for(i=0;i<us;++i)(n&1<<i)>0&&(e._derivedCommandTypesToUpdate[r++]=i);e._derivedCommandsToUpdateLength=r;let o=n!==e._derivedCommandKey;e._derivedCommandKey=n,e._derivedCommandsDirty=o,!(0,y.Z)(e._derivedCommandPacks)&&e._frontFaceTranslucent&&(e._derivedCommandPacks=[new uR({pass:e4.Z.GLOBE,pickOnly:!1,getShaderProgramFunction:um,getRenderStateFunction:uE,getUniformMapFunction:void 0}),new uR({pass:e4.Z.GLOBE,pickOnly:!1,getShaderProgramFunction:u_,getRenderStateFunction:ux,getUniformMapFunction:void 0}),new uR({pass:e4.Z.GLOBE,pickOnly:!1,getShaderProgramFunction:ug,getRenderStateFunction:uw,getUniformMapFunction:void 0}),new uR({pass:e4.Z.GLOBE,pickOnly:!1,getShaderProgramFunction:ug,getRenderStateFunction:uS,getUniformMapFunction:void 0}),new uR({pass:e4.Z.GLOBE,pickOnly:!1,getShaderProgramFunction:ug,getRenderStateFunction:uC,getUniformMapFunction:void 0}),new uR({pass:e4.Z.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:uZ,getRenderStateFunction:uA,getUniformMapFunction:uP}),new uR({pass:e4.Z.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:uy,getRenderStateFunction:uI,getUniformMapFunction:uP}),new uR({pass:e4.Z.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:ub,getRenderStateFunction:uA,getUniformMapFunction:uP}),new uR({pass:e4.Z.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:uv,getRenderStateFunction:uI,getUniformMapFunction:uP}),new uR({pass:e4.Z.TRANSLUCENT,pickOnly:!0,getShaderProgramFunction:uT,getRenderStateFunction:uO,getUniformMapFunction:uP}),new uR({pass:e4.Z.TRANSLUCENT,pickOnly:!0,getShaderProgramFunction:uT,getRenderStateFunction:uD,getUniformMapFunction:uP})])}(this,e)};let uN=Array(us),uL=Array(us);function uM(e,t,i,n,r,o,a){for(let s=0;s<t;++s){let t=e[s],l=t.derivedCommands.type;(!(0,y.Z)(a)||a.indexOf(l)>-1)&&i(t,n,r,o)}}function uF(e,t,i,n,r,o){for(let a=0;a<t;++a)i(e[a],n,r,o)}uc.prototype.updateDerivedCommands=function(e,t){let i=this._derivedCommandTypesToUpdate,n=this._derivedCommandsToUpdateLength;if(0!==n){for(let e=0;e<n;++e)uL[e]=this._derivedCommandPacks[i[e]],uN[e]=ul[i[e]];!function(e,t,i,n,r,o,a){let s=t.derivedCommands.globeTranslucency,l=e._derivedCommandsDirty;if(t.dirty||!(0,y.Z)(s)||l){t.dirty=!1,(0,y.Z)(s)||(s={},t.derivedCommands.globeTranslucency=s);let l=a.frameNumber,d=(0,Z.Z)(s.uniformMapDirtyFrame,0),f=(0,Z.Z)(s.shaderProgramDirtyFrame,0),p=(0,Z.Z)(s.renderStateDirtyFrame,0),m=s.uniformMap!==t.uniformMap,_=s.shaderProgramId!==t.shaderProgram.id,g=s.renderStateId!==t.renderState.id;m&&(s.uniformMapDirtyFrame=l),_&&(s.shaderProgramDirtyFrame=l),g&&(s.renderStateDirtyFrame=l),s.uniformMap=t.uniformMap,s.shaderProgramId=t.shaderProgram.id,s.renderStateId=t.renderState.id;for(let b=0;b<i;++b){var c,u,h;let i,v,T;let E=o[b],x=n[b],w=r[b],S=s[w];(0,y.Z)(S)?(i=S.uniformMap,v=S.shaderProgram,T=S.renderState):(i=void 0,v=void 0,T=void 0),S=e3.Z.shallowClone(t,S),s[w]=S;let C=(0,Z.Z)(S.derivedCommands.uniformMapDirtyFrame,0),A=(0,Z.Z)(S.derivedCommands.shaderProgramDirtyFrame,0),I=(0,Z.Z)(S.derivedCommands.renderStateDirtyFrame,0),O=m||C<d,D=_||A<f,P=g||I<p;O&&(S.derivedCommands.uniformMapDirtyFrame=l),D&&(S.derivedCommands.shaderProgramDirtyFrame=l),P&&(S.derivedCommands.renderStateDirtyFrame=l),S.derivedCommands.type=x,S.pass=E.pass,S.pickOnly=E.pickOnly,S.uniformMap=(c=t.uniformMap,u=i,h=E.getUniformMapFunction,(0,y.Z)(h)?!O&&(0,y.Z)(u)?u:(0,eW.Z)(c,h(e),!1):c),S.shaderProgram=function(e,t,i,n,r,o){if(!(0,y.Z)(r))return t;if(!n&&(0,y.Z)(i))return i;let a=e.shaderCache.getDerivedShaderProgram(t,o);if(!(0,y.Z)(a)){let i=t._attributeLocations,n=t.vertexShaderSource.clone(),s=t.fragmentShaderSource.clone();n.defines=(0,y.Z)(n.defines)?n.defines.slice(0):[],s.defines=(0,y.Z)(s.defines)?s.defines.slice(0):[],r(n,s),a=e.shaderCache.createDerivedShaderProgram(t,o,{vertexShaderSource:n,fragmentShaderSource:s,attributeLocations:i})}return a}(a.context,t.shaderProgram,v,D,E.getShaderProgramFunction,w),S.renderState=function(e,t,i,n,r){if(!(0,y.Z)(n))return e;if(!i&&(0,y.Z)(t))return t;let o=r[e.id];if(!(0,y.Z)(o)){let t=e5.Z.getState(e);n(t),o=e5.Z.fromCache(t),r[e.id]=o}return o}(t.renderState,T,P,E.getRenderStateFunction,E.renderStateCache)}}}(this,e,n,i,uN,uL,t)}},uc.prototype.pushDerivedCommands=function(e,t,i){let n=i.passes.pick||i.passes.pickVoxel;if(n&&t)return;let r=this._derivedCommandTypes,o=this._derivedCommandsLength;if(n?(r=this._derivedPickCommandTypes,o=this._derivedPickCommandsLength):t&&(r=this._derivedBlendCommandTypes,o=this._derivedBlendCommandsLength),0===o){i.commandList.push(e);return}let a=e.derivedCommands.globeTranslucency;for(let e=0;e<o;++e){let t=ul[r[e]];i.commandList.push(a[t])}};let uz=[ua.OPAQUE_FRONT_FACE,ua.OPAQUE_BACK_FACE],uB=[ua.DEPTH_ONLY_FRONT_FACE,ua.DEPTH_ONLY_BACK_FACE,ua.DEPTH_ONLY_FRONT_AND_BACK_FACE];uc.prototype.executeGlobeCommands=function(e,t,i,n,r){let o=n.context,a=e.commands[e4.Z.GLOBE],s=e.indices[e4.Z.GLOBE];0!==s&&(this._globeTranslucencyFramebuffer=i,i.clearClassification(o,r),uM(a,s,t,n,o,r,uz))},uc.prototype.executeGlobeClassificationCommands=function(e,t,i,n,r){let o=n.context,a=e.commands[e4.Z.GLOBE],s=e.indices[e4.Z.GLOBE],l=e.commands[e4.Z.TERRAIN_CLASSIFICATION],c=e.indices[e4.Z.TERRAIN_CLASSIFICATION];if(0===s||0===c)return;let u=this._frontFaceTranslucent,h=this._backFaceTranslucent;if(u&&h||uF(l,c,t,n,o,r),!u&&!h)return;this._globeTranslucencyFramebuffer=i;let d=o.uniformState.globeDepthTexture,f=r.framebuffer;if(r.framebuffer=i.classificationFramebuffer,uM(a,s,t,n,o,r,uB),o.depthTexture){let e=i.packDepth(o,r);o.uniformState.globeDepthTexture=e}uF(l,c,t,n,o,r),o.uniformState.globeDepthTexture=d,r.framebuffer=f};var uU=i(2763),uk=i(7975),uV=i(1419),uH="uniform sampler2D colorTexture;\n\nin vec2 v_textureCoordinates;\n\nvoid main()\n{\n out_FragColor = texture(colorTexture, v_textureCoordinates);\n}\n",uG=i(2537),uj=i(8557),uW=i(1022);function uq(){this._numSamples=1,this.previousFramebuffer=void 0,this._previousFramebuffer=void 0,this._depthStencilTexture=void 0,this._depthStencilRenderbuffer=void 0,this._fbo=new uU.Z({depthStencil:!0,createDepthAttachments:!1}),this._fboClassified=new uU.Z({depthStencil:!0,createDepthAttachments:!1}),this._rsUnclassified=void 0,this._rsClassified=void 0,this._unclassifiedCommand=void 0,this._classifiedCommand=void 0,this._translucentCommand=void 0,this._clearColorCommand=new ae.Z({color:new A.Z(0,0,0,0),owner:this}),this._clearCommand=new ae.Z({color:new A.Z(0,0,0,0),depth:1,stencil:0});let e=this;this._uniformMap={colorTexture:function(){return e._fbo.getColorTexture()},depthTexture:function(){return e._depthStencilTexture},classifiedTexture:function(){return e._fboClassified.getColorTexture()}}}Object.defineProperties(uq.prototype,{unclassifiedCommand:{get:function(){return this._unclassifiedCommand}}}),uq.isTranslucencySupported=function(e){return e.depthTexture&&e.fragmentDepth};let uY={depthMask:!1,stencilTest:{enabled:!0,frontFunction:uj.Z.EQUAL,frontOperation:{fail:uW.Z.KEEP,zFail:uW.Z.KEEP,zPass:uW.Z.KEEP},backFunction:uj.Z.NEVER,reference:0,mask:uG.Z.CLASSIFICATION_MASK},blending:e8.Z.ALPHA_BLEND},uX={depthMask:!1,stencilTest:{enabled:!0,frontFunction:uj.Z.NOT_EQUAL,frontOperation:{fail:uW.Z.KEEP,zFail:uW.Z.KEEP,zPass:uW.Z.KEEP},backFunction:uj.Z.NEVER,reference:0,mask:uG.Z.CLASSIFICATION_MASK},blending:e8.Z.ALPHA_BLEND},u$={depthMask:!0,depthTest:{enabled:!0},stencilTest:uG.Z.setCesium3DTileBit(),stencilMask:uG.Z.CESIUM_3D_TILE_MASK,blending:e8.Z.ALPHA_BLEND};uq.prototype.update=function(e,t,i){let n=this._fbo.getColorTexture(),r=this.previousFramebuffer!==this._previousFramebuffer;this._previousFramebuffer=this.previousFramebuffer;let o=this._numSamples!==t,a=e.drawingBufferWidth,s=e.drawingBufferHeight,l=!(0,y.Z)(n)||n.width!==a||n.height!==s;if((l||r||o)&&(this._numSamples=t,this._depthStencilTexture=this._depthStencilTexture&&this._depthStencilTexture.destroy(),this._depthStencilRenderbuffer=this._depthStencilRenderbuffer&&this._depthStencilRenderbuffer.destroy(),!(0,y.Z)(this._previousFramebuffer)&&(this._depthStencilTexture=new eP.Z({context:e,width:a,height:s,pixelFormat:te.Z.DEPTH_STENCIL,pixelDatatype:to.Z.UNSIGNED_INT_24_8}),t>1&&(this._depthStencilRenderbuffer=new uk.Z({context:e,width:a,height:s,format:uV.Z.DEPTH24_STENCIL8,numSamples:t})))),!(0,y.Z)(this._fbo.framebuffer)||l||r||o){let n,r;this._fbo.destroy(),this._fboClassified.destroy(),(0,y.Z)(this._previousFramebuffer)?(n=i.getDepthStencilTexture(),r=i.getDepthStencilRenderbuffer()):(n=this._depthStencilTexture,r=this._depthStencilRenderbuffer),this._fbo.setDepthStencilTexture(n),(0,y.Z)(r)&&this._fbo.setDepthStencilRenderbuffer(r),this._fbo.update(e,a,s,t),(0,y.Z)(this._previousFramebuffer)||(this._fboClassified.setDepthStencilTexture(n),this._fboClassified.update(e,a,s))}if((0,y.Z)(this._rsUnclassified)||(this._rsUnclassified=e5.Z.fromCache(uY),this._rsClassified=e5.Z.fromCache(uX),this._rsDefault=e5.Z.fromCache(u$)),!(0,y.Z)(this._unclassifiedCommand)||r||o){(0,y.Z)(this._unclassifiedCommand)&&(this._unclassifiedCommand.shaderProgram=this._unclassifiedCommand.shaderProgram&&this._unclassifiedCommand.shaderProgram.destroy(),this._classifiedCommand.shaderProgram=this._classifiedCommand.shaderProgram&&this._classifiedCommand.shaderProgram.destroy());let t=(0,y.Z)(this._previousFramebuffer)?"uniform sampler2D colorTexture;\nin vec2 v_textureCoordinates;\nvoid main()\n{\n vec4 color = texture(colorTexture, v_textureCoordinates);\n if (color.a == 0.0)\n {\n discard;\n }\n#ifdef UNCLASSIFIED\n out_FragColor = color * czm_invertClassificationColor;\n#else\n out_FragColor = color;\n#endif\n}\n":"uniform sampler2D colorTexture;\nuniform sampler2D depthTexture;\nuniform sampler2D classifiedTexture;\nin vec2 v_textureCoordinates;\nvoid main()\n{\n vec4 color = texture(colorTexture, v_textureCoordinates);\n if (color.a == 0.0)\n {\n discard;\n }\n bool isClassified = all(equal(texture(classifiedTexture, v_textureCoordinates), vec4(0.0)));\n#ifdef UNCLASSIFIED\n vec4 highlightColor = czm_invertClassificationColor;\n if (isClassified)\n {\n discard;\n }\n#else\n vec4 highlightColor = vec4(1.0);\n if (!isClassified)\n {\n discard;\n }\n#endif\n out_FragColor = color * highlightColor;\n gl_FragDepth = texture(depthTexture, v_textureCoordinates).r;\n}\n",i=new eD.Z({defines:["UNCLASSIFIED"],sources:[t]}),n=new eD.Z({sources:[t]});this._unclassifiedCommand=e.createViewportQuadCommand(i,{renderState:(0,y.Z)(this._previousFramebuffer)?this._rsUnclassified:this._rsDefault,uniformMap:this._uniformMap,owner:this}),this._classifiedCommand=e.createViewportQuadCommand(n,{renderState:(0,y.Z)(this._previousFramebuffer)?this._rsClassified:this._rsDefault,uniformMap:this._uniformMap,owner:this}),(0,y.Z)(this._translucentCommand)&&(this._translucentCommand.shaderProgram=this._translucentCommand.shaderProgram&&this._translucentCommand.shaderProgram.destroy()),(0,y.Z)(this._previousFramebuffer)||(this._translucentCommand=e.createViewportQuadCommand(uH,{renderState:this._rsUnclassified,uniformMap:this._uniformMap,owner:this}))}},uq.prototype.prepareTextures=function(e,t){this._fbo._numSamples>1&&this._fbo.prepareTextures(e,t)},uq.prototype.clear=function(e,t){(0,y.Z)(this._previousFramebuffer)?this._fbo.clear(e,this._clearColorCommand,t):(this._fbo.clear(e,this._clearCommand,t),this._fboClassified.clear(e,this._clearCommand,t))},uq.prototype.executeClassified=function(e,t){if(!(0,y.Z)(this._previousFramebuffer)){let i=t.framebuffer;this.prepareTextures(e,!0),t.framebuffer=this._fboClassified.framebuffer,this._translucentCommand.execute(e,t),t.framebuffer=i}this._classifiedCommand.execute(e,t)},uq.prototype.executeUnclassified=function(e,t){this._unclassifiedCommand.execute(e,t)},uq.prototype.isDestroyed=function(){return!1},uq.prototype.destroy=function(){return this._fbo.destroy(),this._fboClassified.destroy(),this._depthStencilTexture=this._depthStencilTexture&&this._depthStencilTexture.destroy(),this._depthStencilRenderbuffer=this._depthStencilRenderbuffer&&this._depthStencilRenderbuffer.destroy(),(0,y.Z)(this._unclassifiedCommand)&&(this._unclassifiedCommand.shaderProgram=this._unclassifiedCommand.shaderProgram&&this._unclassifiedCommand.shaderProgram.destroy(),this._classifiedCommand.shaderProgram=this._classifiedCommand.shaderProgram&&this._classifiedCommand.shaderProgram.destroy()),(0,b.Z)(this)};var uK=i(3447);function uQ(e){this._total=e,this.usedThisFrame=0,this.stolenFromMeThisFrame=0,this.starvedThisFrame=!1,this.starvedLastFrame=!1}function uJ(e){let t;if((0,y.Z)(e)&&e.length!==uK.Z.NUMBER_OF_JOB_TYPES)throw new v.Z("A budget must be specified for each job type; budgets.length should equal JobType.NUMBER_OF_JOB_TYPES.");let i=Array(uK.Z.NUMBER_OF_JOB_TYPES);i[uK.Z.TEXTURE]=new uQ((0,y.Z)(e)?e[uK.Z.TEXTURE]:10),i[uK.Z.PROGRAM]=new uQ((0,y.Z)(e)?e[uK.Z.PROGRAM]:10),i[uK.Z.BUFFER]=new uQ((0,y.Z)(e)?e[uK.Z.BUFFER]:30);let n=i.length,r=0;for(t=0;t<n;++t)r+=i[t].total;let o=Array(n);for(t=0;t<n;++t)o[t]=!1;this._totalBudget=r,this._totalUsedThisFrame=0,this._budgets=i,this._executedThisFrame=o}Object.defineProperties(uQ.prototype,{total:{get:function(){return this._total}}}),uJ.getTimestamp=rl.Z,Object.defineProperties(uJ.prototype,{totalBudget:{get:function(){return this._totalBudget}}}),uJ.prototype.disableThisFrame=function(){this._totalUsedThisFrame=this._totalBudget},uJ.prototype.resetBudgets=function(){let e=this._budgets,t=e.length;for(let i=0;i<t;++i){let t=e[i];t.starvedLastFrame=t.starvedThisFrame,t.starvedThisFrame=!1,t.usedThisFrame=0,t.stolenFromMeThisFrame=0}this._totalUsedThisFrame=0},uJ.prototype.execute=function(e,t){let i;let n=this._budgets,r=n[t],o=this._executedThisFrame[t];if(this._totalUsedThisFrame>=this._totalBudget&&o)return r.starvedThisFrame=!0,!1;if(r.usedThisFrame+r.stolenFromMeThisFrame>=r.total){let e;let t=n.length;for(e=0;e<t&&(!((i=n[e]).usedThisFrame+i.stolenFromMeThisFrame<i.total)||i.starvedLastFrame);++e);if(e===t&&o)return!1;o&&(r.starvedThisFrame=!0)}let a=uJ.getTimestamp();e.execute();let s=uJ.getTimestamp()-a;return this._totalUsedThisFrame+=s,i?i.stolenFromMeThisFrame+=s:r.usedThisFrame+=s,this._executedThisFrame[t]=!0,!0};var u0=i(5986);function u1(e){let t=w((e=(0,Z.Z)(e,Z.Z.EMPTY_OBJECT)).container);if(!(0,y.Z)(t))throw new v.Z("container is required");this._container=t;let i=document.createElement("div");i.className="cesium-performanceDisplay";let n=document.createElement("div");n.className="cesium-performanceDisplay-fps",this._fpsText=document.createTextNode(""),n.appendChild(this._fpsText);let r=document.createElement("div");r.className="cesium-performanceDisplay-ms",this._msText=document.createTextNode(""),r.appendChild(this._msText),i.appendChild(r),i.appendChild(n),this._container.appendChild(i),this._lastFpsSampleTime=(0,rl.Z)(),this._lastMsSampleTime=(0,rl.Z)(),this._fpsFrameCount=0,this._msFrameCount=0,this._throttled=!1;let o=document.createElement("div");o.className="cesium-performanceDisplay-throttled",this._throttledText=document.createTextNode(""),o.appendChild(this._throttledText),i.appendChild(o)}Object.defineProperties(u1.prototype,{throttled:{get:function(){return this._throttled},set:function(e){this._throttled!==e&&(e?this._throttledText.nodeValue="(throttled)":this._throttledText.nodeValue="",this._throttled=e)}}}),u1.prototype.update=function(e){let t=(0,rl.Z)(),i=(0,Z.Z)(e,!0);this._fpsFrameCount++;let n=t-this._lastFpsSampleTime;if(n>1e3){let e="N/A";i&&(e=1e3*this._fpsFrameCount/n|0),this._fpsText.nodeValue=`${e} FPS`,this._lastFpsSampleTime=t,this._fpsFrameCount=0}this._msFrameCount++;let r=t-this._lastMsSampleTime;if(r>200){let e="N/A";i&&(e=(r/this._msFrameCount).toFixed(2)),this._msText.nodeValue=`${e} MS`,this._lastMsSampleTime=t,this._msFrameCount=0}},u1.prototype.destroy=function(){return(0,b.Z)(this)};var u2=i(3369),u3=i(4186),u4=i(9344);function u5(){this._framebuffer=new uU.Z,this._textureToCopy=void 0,this._copyDepthCommand=void 0}Object.defineProperties(u5.prototype,{framebuffer:{get:function(){return this._framebuffer.framebuffer}}}),u5.prototype.update=function(e,t){var i;(function(e,t,i){let n=i.width,r=i.height;e._framebuffer.update(t,n,r)})(this,e,t),i=this,(0,y.Z)(i._copyDepthCommand)||(i._copyDepthCommand=e.createViewportQuadCommand(`uniform highp sampler2D colorTexture; in vec2 v_textureCoordinates; void main() { vec4 globeDepthPacked = texture(czm_globeDepthTexture, v_textureCoordinates); float globeDepth = czm_unpackDepth(globeDepthPacked); float depth = texture(colorTexture, v_textureCoordinates).r; out_FragColor = czm_branchFreeTernary(globeDepth <= 0.0 || globeDepth >= 1.0 || depth < globeDepth && depth > 0.0 && depth < 1.0, czm_packDepth(depth), globeDepthPacked); } `,{renderState:e5.Z.fromCache(),uniformMap:{colorTexture:function(){return i._textureToCopy}},owner:i})),i._textureToCopy=t,i._copyDepthCommand.framebuffer=i.framebuffer};let u9=new eH.Z,u8=new eH.Z(1,1/255,1/65025,1/16581375);u5.prototype.getDepth=function(e,t,i){if(!(0,y.Z)(this.framebuffer))return;let n=e.readPixels({x:t,y:i,width:1,height:1,framebuffer:this.framebuffer}),r=eH.Z.unpack(n,0,u9);return eH.Z.divideByScalar(r,255,r),eH.Z.dot(r,u8)},u5.prototype.executeCopyDepth=function(e,t){this._copyDepthCommand.execute(e,t)},u5.prototype.isDestroyed=function(){return!1},u5.prototype.destroy=function(){return this._framebuffer.destroy(),(0,y.Z)(this._copyDepthCommand)&&(this._copyDepthCommand.shaderProgram=(0,y.Z)(this._copyDepthCommand.shaderProgram)&&this._copyDepthCommand.shaderProgram.destroy()),(0,b.Z)(this)};var u6=i(6547),u7=i(4364),he=i(2944),ht=function(e,t){this.near=(0,Z.Z)(e,0),this.far=(0,Z.Z)(t,0);let i=e4.Z.NUMBER_OF_PASSES,n=Array(i),r=Array(i);for(let e=0;e<i;++e)n[e]=[],r[e]=0;this.commands=n,this.indices=r},hi="uniform highp sampler2D u_depthTexture;\n\nin vec2 v_textureCoordinates;\n\nvoid main()\n{\n out_FragColor = czm_packDepth(texture(u_depthTexture, v_textureCoordinates).r);\n}\n";function hn(){this._picking=!1,this._numSamples=1,this._tempCopyDepthTexture=void 0,this._pickColorFramebuffer=new uU.Z({depthStencil:!0,supportsDepthTexture:!0}),this._outputFramebuffer=new uU.Z({depthStencil:!0,supportsDepthTexture:!0}),this._copyDepthFramebuffer=new uU.Z,this._tempCopyDepthFramebuffer=new uU.Z,this._updateDepthFramebuffer=new uU.Z({createColorAttachments:!1,createDepthAttachments:!1,depthStencil:!0}),this._clearGlobeColorCommand=void 0,this._copyColorCommand=void 0,this._copyDepthCommand=void 0,this._tempCopyDepthCommand=void 0,this._updateDepthCommand=void 0,this._viewport=new oN.Z,this._rs=void 0,this._rsBlend=void 0,this._rsUpdate=void 0,this._useScissorTest=!1,this._scissorRectangle=void 0,this._useHdr=void 0,this._clearGlobeDepth=void 0}function hr(e,t,i,n,r){e._viewport.width=i,e._viewport.height=n;let o=!oN.Z.equals(e._viewport,r.viewport),a=o!==e._useScissorTest;e._useScissorTest=o,oN.Z.equals(e._scissorRectangle,r.viewport)||(e._scissorRectangle=oN.Z.clone(r.viewport,e._scissorRectangle),a=!0),(0,y.Z)(e._rs)&&oN.Z.equals(e._viewport,e._rs.viewport)&&!a||(e._rs=e5.Z.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle}}),e._rsBlend=e5.Z.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle},blending:e8.Z.ALPHA_BLEND}),e._rsUpdate=e5.Z.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle},stencilTest:{enabled:!0,frontFunction:uj.Z.EQUAL,frontOperation:{fail:uW.Z.KEEP,zFail:uW.Z.KEEP,zPass:uW.Z.KEEP},backFunction:uj.Z.NEVER,reference:uG.Z.CESIUM_3D_TILE_MASK,mask:uG.Z.CESIUM_3D_TILE_MASK}})),(0,y.Z)(e._copyDepthCommand)||(e._copyDepthCommand=t.createViewportQuadCommand(hi,{uniformMap:{u_depthTexture:function(){return e.colorFramebufferManager.getDepthStencilTexture()}},owner:e})),e._copyDepthCommand.framebuffer=e._copyDepthFramebuffer.framebuffer,e._copyDepthCommand.renderState=e._rs,(0,y.Z)(e._copyColorCommand)||(e._copyColorCommand=t.createViewportQuadCommand(uH,{uniformMap:{colorTexture:function(){return e.colorFramebufferManager.getColorTexture()}},owner:e})),e._copyColorCommand.renderState=e._rs,(0,y.Z)(e._tempCopyDepthCommand)||(e._tempCopyDepthCommand=t.createViewportQuadCommand(hi,{uniformMap:{u_depthTexture:function(){return e._tempCopyDepthTexture}},owner:e})),e._tempCopyDepthCommand.framebuffer=e._tempCopyDepthFramebuffer.framebuffer,e._tempCopyDepthCommand.renderState=e._rs,(0,y.Z)(e._updateDepthCommand)||(e._updateDepthCommand=t.createViewportQuadCommand(uH,{uniformMap:{colorTexture:function(){return e._tempCopyDepthFramebuffer.getColorTexture()}},owner:e})),e._updateDepthCommand.framebuffer=e._updateDepthFramebuffer.framebuffer,e._updateDepthCommand.renderState=e._rsUpdate,(0,y.Z)(e._clearGlobeColorCommand)||(e._clearGlobeColorCommand=new ae.Z({color:new A.Z(0,0,0,0),stencil:0,owner:e})),e._clearGlobeColorCommand.framebuffer=e.framebuffer}function ho(){this._framebuffer=new uU.Z({depthStencil:!0,supportsDepthTexture:!0}),this._packedDepthFramebuffer=new uU.Z,this._renderState=void 0,this._packedDepthCommand=void 0,this._clearCommand=void 0,this._viewport=new oN.Z,this._useScissorTest=!1,this._scissorRectangle=void 0,this._useHdr=void 0}Object.defineProperties(hn.prototype,{colorFramebufferManager:{get:function(){return this._picking?this._pickColorFramebuffer:this._outputFramebuffer}},framebuffer:{get:function(){return this.colorFramebufferManager.framebuffer}},depthStencilTexture:{get:function(){return this.colorFramebufferManager.getDepthStencilTexture()}},picking:{get:function(){return this._picking},set:function(e){this._picking=e}}}),hn.prototype.update=function(e,t,i,n,r,o){let a=i.width,s=i.height,l=r?e.halfFloatingPointTexture?to.Z.HALF_FLOAT:to.Z.FLOAT:to.Z.UNSIGNED_BYTE;this._numSamples=n,this.picking?this._pickColorFramebuffer.update(e,a,s):this._outputFramebuffer.update(e,a,s,n,l),this._copyDepthFramebuffer.update(e,a,s),hr(this,e,a,s,t),e.uniformState.globeDepthTexture=void 0,this._useHdr=r,this._clearGlobeDepth=o},hn.prototype.prepareColorTextures=function(e,t){!this.picking&&this._numSamples>1&&this._outputFramebuffer.prepareTextures(e,t)},hn.prototype.executeCopyDepth=function(e,t){(0,y.Z)(this._copyDepthCommand)&&(this.prepareColorTextures(e),this._copyDepthCommand.execute(e,t),e.uniformState.globeDepthTexture=this._copyDepthFramebuffer.getColorTexture())},hn.prototype.executeUpdateDepth=function(e,t,i,n){let r=(0,y.Z)(n)?n:t.framebuffer.depthStencilTexture;if(i||r!==this.colorFramebufferManager.getDepthStencilTexture()){if((0,y.Z)(this._updateDepthCommand)){if(!(0,y.Z)(this._updateDepthFramebuffer.framebuffer)||this._updateDepthFramebuffer.getDepthStencilTexture()!==r||this._updateDepthFramebuffer.getColorTexture()!==this._copyDepthFramebuffer.getColorTexture()){let i=this._copyDepthFramebuffer.getColorTexture().width,n=this._copyDepthFramebuffer.getColorTexture().height;this._tempCopyDepthFramebuffer.destroy(),this._tempCopyDepthFramebuffer.update(e,i,n);let o=this._copyDepthFramebuffer.getColorTexture();this._updateDepthFramebuffer.setColorTexture(o,0),this._updateDepthFramebuffer.setDepthStencilTexture(r),this._updateDepthFramebuffer.update(e,i,n),hr(this,e,i,n,t)}this._tempCopyDepthTexture=r,this._tempCopyDepthCommand.execute(e,t),this._updateDepthCommand.execute(e,t)}return}(0,y.Z)(this._copyDepthCommand)&&this._copyDepthCommand.execute(e,t)},hn.prototype.executeCopyColor=function(e,t){(0,y.Z)(this._copyColorCommand)&&this._copyColorCommand.execute(e,t)},hn.prototype.clear=function(e,t,i){let n=this._clearGlobeColorCommand;(0,y.Z)(n)&&(A.Z.clone(i,n.color),this.colorFramebufferManager.clear(e,n,t))},hn.prototype.isDestroyed=function(){return!1},hn.prototype.destroy=function(){return this._pickColorFramebuffer.destroy(),this._outputFramebuffer.destroy(),this._copyDepthFramebuffer.destroy(),this._tempCopyDepthFramebuffer.destroy(),this._updateDepthFramebuffer.destroy(),(0,y.Z)(this._copyColorCommand)&&(this._copyColorCommand.shaderProgram=this._copyColorCommand.shaderProgram.destroy()),(0,y.Z)(this._copyDepthCommand)&&(this._copyDepthCommand.shaderProgram=this._copyDepthCommand.shaderProgram.destroy()),(0,y.Z)(this._tempCopyDepthCommand)&&(this._tempCopyDepthCommand.shaderProgram=this._tempCopyDepthCommand.shaderProgram.destroy()),(0,y.Z)(this._updateDepthCommand)&&(this._updateDepthCommand.shaderProgram=this._updateDepthCommand.shaderProgram.destroy()),(0,b.Z)(this)},Object.defineProperties(ho.prototype,{classificationTexture:{get:function(){return this._framebuffer.getColorTexture()}},classificationFramebuffer:{get:function(){return this._framebuffer.framebuffer}},packedDepthFramebuffer:{get:function(){return this._packedDepthFramebuffer.framebuffer}},depthStencilTexture:{get:function(){return this._framebuffer.getDepthStencilTexture()}},depthStencilRenderbuffer:{get:function(){return this._framebuffer.getDepthStencilRenderbuffer()}},packedDepthTexture:{get:function(){return this._packedDepthFramebuffer.getColorTexture()}}}),ho.prototype.updateAndClear=function(e,t,i,n){let r=t.width,o=t.height;(function(e,t,i,n,r){let o=r?t.halfFloatingPointTexture?to.Z.HALF_FLOAT:to.Z.FLOAT:to.Z.UNSIGNED_BYTE;e._framebuffer.update(t,i,n,1,o),e._packedDepthFramebuffer.update(t,i,n)})(this,i,r,o,e),function(e,t,i,n,r){e._viewport.width=i,e._viewport.height=n;let o=!oN.Z.equals(e._viewport,r.viewport),a=o!==e._useScissorTest;e._useScissorTest=o,oN.Z.equals(e._scissorRectangle,r.viewport)||(e._scissorRectangle=oN.Z.clone(r.viewport,e._scissorRectangle),a=!0),(0,y.Z)(e._renderState)&&oN.Z.equals(e._viewport,e._renderState.viewport)&&!a||(e._renderState=e5.Z.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle}})),(0,y.Z)(e._packedDepthCommand)||(e._packedDepthCommand=t.createViewportQuadCommand(hi,{uniformMap:{u_depthTexture:function(){return e.depthStencilTexture}},owner:e})),(0,y.Z)(e._clearCommand)||(e._clearCommand=new ae.Z({color:new A.Z(0,0,0,0),depth:1,stencil:0,owner:e})),e._packedDepthCommand.framebuffer=e._packedDepthFramebuffer.framebuffer,e._packedDepthCommand.renderState=e._renderState,e._clearCommand.framebuffer=e.classificationFramebuffer,e._clearCommand.renderState=e._renderState}(this,i,r,o,n),this._useHdr=e},ho.prototype.clearClassification=function(e,t){this._clearCommand.execute(e,t)},ho.prototype.packDepth=function(e,t){return this._packedDepthCommand.execute(e,t),this.packedDepthTexture},ho.prototype.isDestroyed=function(){return!1},ho.prototype.destroy=function(){return this._framebuffer.destroy(),this._packedDepthFramebuffer.destroy(),(0,b.Z)(this)};var ha="#ifdef MRT\nlayout (location = 0) out vec4 out_FragData_0;\nlayout (location = 1) out vec4 out_FragData_1;\n#else\nlayout (location = 0) out vec4 out_FragColor;\n#endif\n\nuniform vec4 u_bgColor;\nuniform sampler2D u_depthTexture;\n\nin vec2 v_textureCoordinates;\n\nvoid main()\n{\n if (texture(u_depthTexture, v_textureCoordinates).r < 1.0)\n {\n#ifdef MRT\n out_FragData_0 = u_bgColor;\n out_FragData_1 = vec4(u_bgColor.a);\n#else\n out_FragColor = u_bgColor;\n#endif\n return;\n }\n \n discard;\n}\n",hs=i(2067),hl=i(8133);function hc(e){this._numSamples=1,this._translucentMultipassSupport=!1,this._translucentMRTSupport=!1;let t=e.colorBufferFloat&&e.depthTexture&&e.floatBlend;this._translucentMRTSupport=e.drawBuffers&&t,this._translucentMultipassSupport=!this._translucentMRTSupport&&t,this._opaqueFBO=void 0,this._opaqueTexture=void 0,this._depthStencilTexture=void 0,this._accumulationTexture=void 0,this._translucentFBO=new uU.Z({colorAttachmentsLength:this._translucentMRTSupport?2:1,createColorAttachments:!1,createDepthAttachments:!1,depth:!0}),this._alphaFBO=new uU.Z({createColorAttachments:!1,createDepthAttachments:!1,depth:!0}),this._adjustTranslucentFBO=new uU.Z({colorAttachmentsLength:this._translucentMRTSupport?2:1,createColorAttachments:!1}),this._adjustAlphaFBO=new uU.Z({createColorAttachments:!1}),this._opaqueClearCommand=new ae.Z({color:new A.Z(0,0,0,0),owner:this}),this._translucentMRTClearCommand=new ae.Z({color:new A.Z(0,0,0,1),owner:this}),this._translucentMultipassClearCommand=new ae.Z({color:new A.Z(0,0,0,0),owner:this}),this._alphaClearCommand=new ae.Z({color:new A.Z(1,1,1,1),owner:this}),this._translucentRenderStateCache={},this._alphaRenderStateCache={},this._compositeCommand=void 0,this._adjustTranslucentCommand=void 0,this._adjustAlphaCommand=void 0,this._viewport=new oN.Z,this._rs=void 0,this._useScissorTest=!1,this._scissorRectangle=void 0,this._useHDR=!1}function hu(e){e._accumulationTexture=e._accumulationTexture&&!e._accumulationTexture.isDestroyed()&&e._accumulationTexture.destroy(),e._revealageTexture=e._revealageTexture&&!e._revealageTexture.isDestroyed()&&e._revealageTexture.destroy()}function hh(e){e._translucentFBO.destroy(),e._alphaFBO.destroy(),e._adjustTranslucentFBO.destroy(),e._adjustAlphaFBO.destroy()}hc.prototype.update=function(e,t,i,n,r){let o,a;if(!this.isSupported())return;this._opaqueFBO=i,this._opaqueTexture=i.getColorTexture(0),this._depthStencilTexture=i.getDepthStencilTexture();let{width:s,height:l}=this._opaqueTexture,c=this._accumulationTexture,u=!(0,y.Z)(c)||c.width!==s||c.height!==l||n!==this._useHDR,h=this._numSamples!==r;if((u||h)&&(this._numSamples=r,function(e,t,i,n){hu(e),e._accumulationTexture=new eP.Z({context:t,width:i,height:n,pixelFormat:te.Z.RGBA,pixelDatatype:to.Z.FLOAT});let r=new Float32Array(i*n*4);e._revealageTexture=new eP.Z({context:t,pixelFormat:te.Z.RGBA,pixelDatatype:to.Z.FLOAT,source:{arrayBufferView:r,width:i,height:n},flipY:!1})}(this,e,s,l)),(!(0,y.Z)(this._translucentFBO.framebuffer)||u||h)&&!function(e,t){hh(e);let i=ac.Z.FRAMEBUFFER_COMPLETE,n=!0,{width:r,height:o}=e._accumulationTexture;if(e._translucentMRTSupport&&(e._translucentFBO.setColorTexture(e._accumulationTexture,0),e._translucentFBO.setColorTexture(e._revealageTexture,1),e._translucentFBO.setDepthStencilTexture(e._depthStencilTexture),e._translucentFBO.update(t,r,o),e._adjustTranslucentFBO.setColorTexture(e._accumulationTexture,0),e._adjustTranslucentFBO.setColorTexture(e._revealageTexture,1),e._adjustTranslucentFBO.update(t,r,o),(e._translucentFBO.status!==i||e._adjustTranslucentFBO.status!==i)&&(hh(e),e._translucentMRTSupport=!1)),!e._translucentMRTSupport){e._translucentFBO.setColorTexture(e._accumulationTexture),e._translucentFBO.setDepthStencilTexture(e._depthStencilTexture),e._translucentFBO.update(t,r,o),e._alphaFBO.setColorTexture(e._revealageTexture),e._alphaFBO.setDepthStencilTexture(e._depthStencilTexture),e._alphaFBO.update(t,r,o),e._adjustTranslucentFBO.setColorTexture(e._accumulationTexture),e._adjustTranslucentFBO.update(t,r,o),e._adjustAlphaFBO.setColorTexture(e._revealageTexture),e._adjustAlphaFBO.update(t,r,o);let a=e._translucentFBO.status===i,s=e._alphaFBO.status===i,l=e._adjustTranslucentFBO.status===i,c=e._adjustAlphaFBO.status===i;(!a||!s||!l||!c)&&(hu(e),hh(e),e._translucentMultipassSupport=!1,n=!1)}return n}(this,e))return;this._useHDR=n;let d=this;(0,y.Z)(this._compositeCommand)||(o=new eD.Z({sources:["/**\n * Compositing for Weighted Blended Order-Independent Transparency. See:\n * - http://jcgt.org/published/0002/02/09/\n * - http://casual-effects.blogspot.com/2014/03/weighted-blended-order-independent.html\n */\n\nuniform sampler2D u_opaque;\nuniform sampler2D u_accumulation;\nuniform sampler2D u_revealage;\n\nin vec2 v_textureCoordinates;\n\nvoid main()\n{\n vec4 opaque = texture(u_opaque, v_textureCoordinates);\n vec4 accum = texture(u_accumulation, v_textureCoordinates);\n float r = texture(u_revealage, v_textureCoordinates).r;\n\n#ifdef MRT\n vec4 transparent = vec4(accum.rgb / clamp(r, 1e-4, 5e4), accum.a);\n#else\n vec4 transparent = vec4(accum.rgb / clamp(accum.a, 1e-4, 5e4), r);\n#endif\n\n out_FragColor = (1.0 - transparent.a) * transparent + transparent.a * opaque;\n\n if (opaque != czm_backgroundColor)\n {\n out_FragColor.a = 1.0;\n }\n}\n"]}),this._translucentMRTSupport&&o.defines.push("MRT"),a={u_opaque:function(){return d._opaqueTexture},u_accumulation:function(){return d._accumulationTexture},u_revealage:function(){return d._revealageTexture}},this._compositeCommand=e.createViewportQuadCommand(o,{uniformMap:a,owner:this})),!(0,y.Z)(this._adjustTranslucentCommand)&&(this._translucentMRTSupport?(o=new eD.Z({defines:["MRT"],sources:[ha]}),a={u_bgColor:function(){return d._translucentMRTClearCommand.color},u_depthTexture:function(){return d._depthStencilTexture}},this._adjustTranslucentCommand=e.createViewportQuadCommand(o,{uniformMap:a,owner:this})):this._translucentMultipassSupport&&(o=new eD.Z({sources:[ha]}),a={u_bgColor:function(){return d._translucentMultipassClearCommand.color},u_depthTexture:function(){return d._depthStencilTexture}},this._adjustTranslucentCommand=e.createViewportQuadCommand(o,{uniformMap:a,owner:this}),a={u_bgColor:function(){return d._alphaClearCommand.color},u_depthTexture:function(){return d._depthStencilTexture}},this._adjustAlphaCommand=e.createViewportQuadCommand(o,{uniformMap:a,owner:this}))),this._viewport.width=s,this._viewport.height=l;let f=!oN.Z.equals(this._viewport,t.viewport),p=f!==this._useScissorTest;this._useScissorTest=f,oN.Z.equals(this._scissorRectangle,t.viewport)||(this._scissorRectangle=oN.Z.clone(t.viewport,this._scissorRectangle),p=!0),(0,y.Z)(this._rs)&&oN.Z.equals(this._viewport,this._rs.viewport)&&!p||(this._rs=e5.Z.fromCache({viewport:this._viewport,scissorTest:{enabled:this._useScissorTest,rectangle:this._scissorRectangle}})),(0,y.Z)(this._compositeCommand)&&(this._compositeCommand.renderState=this._rs),this._adjustTranslucentCommand&&(this._adjustTranslucentCommand.renderState=this._rs),(0,y.Z)(this._adjustAlphaCommand)&&(this._adjustAlphaCommand.renderState=this._rs)};let hd={enabled:!0,color:new A.Z(0,0,0,0),equationRgb:hs.Z.ADD,equationAlpha:hs.Z.ADD,functionSourceRgb:hl.Z.ONE,functionDestinationRgb:hl.Z.ONE,functionSourceAlpha:hl.Z.ZERO,functionDestinationAlpha:hl.Z.ONE_MINUS_SOURCE_ALPHA},hf={enabled:!0,color:new A.Z(0,0,0,0),equationRgb:hs.Z.ADD,equationAlpha:hs.Z.ADD,functionSourceRgb:hl.Z.ONE,functionDestinationRgb:hl.Z.ONE,functionSourceAlpha:hl.Z.ONE,functionDestinationAlpha:hl.Z.ONE},hp={enabled:!0,color:new A.Z(0,0,0,0),equationRgb:hs.Z.ADD,equationAlpha:hs.Z.ADD,functionSourceRgb:hl.Z.ZERO,functionDestinationRgb:hl.Z.ONE_MINUS_SOURCE_ALPHA,functionSourceAlpha:hl.Z.ZERO,functionDestinationAlpha:hl.Z.ONE_MINUS_SOURCE_ALPHA};function hm(e,t,i,n){let r=i[n.id];if(!(0,y.Z)(r)){let e=e5.Z.getState(n);e.depthMask=!1,e.blending=t,r=e5.Z.fromCache(e),i[n.id]=r}return r}function h_(e,t,i,n){let{shaderCache:r}=e,o=r.getDerivedShaderProgram(t,i);if((0,y.Z)(o))return o;let a=t._attributeLocations,s=t.fragmentShaderSource.clone();s.sources=s.sources.map(function(e){return eD.Z.replaceMain(e,"czm_translucent_main").replace(/out_FragColor/g,"czm_out_FragColor").replace(/layout\s*\(location\s*=\s*0\)\s*out\s+vec4\s+out_FragColor;/g,"").replace(/\bdiscard\b/g,"czm_discard = true").replace(/czm_phong/g,"czm_translucentPhong")}),s.sources.splice(0,0,`vec4 czm_out_FragColor; bool czm_discard = false; `);let l=[...n.matchAll(/out_FragData_(\d+)/g)],c="";for(let e=0;e<l.length;e++){let t=l[e];c=`layout (location = ${t[1]}) out vec4 ${t[0]}; ${c}`}return s.sources.push(c),s.sources.push(`void main() { czm_translucent_main(); if (czm_discard) { discard; } ${n}} `),r.createDerivedShaderProgram(t,i,{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:s,attributeLocations:a})}function hg(){this._framebuffer=new uU.Z({color:!1,depthStencil:!0,supportsDepthTexture:!0}),this._passState=void 0}function hZ(e){let t=new ah(e);t.blendingEnabled=!1,t.scissorTest={enabled:!0,rectangle:new oN.Z},t.viewport=new oN.Z,this._context=e,this._fb=new uU.Z({depthStencil:!0}),this._passState=t,this._width=0,this._height=0}hc.prototype.createDerivedCommands=function(e,t,i){var n,r,o;let a,s,l,c;if((0,y.Z)(i)||(i={}),this._translucentMRTSupport){let r,o;return((0,y.Z)(i.translucentCommand)&&(r=i.translucentCommand.shaderProgram,o=i.translucentCommand.renderState),i.translucentCommand=e3.Z.shallowClone(e,i.translucentCommand),(0,y.Z)(r)&&i.shaderProgramId===e.shaderProgram.id)?(i.translucentCommand.shaderProgram=r,i.translucentCommand.renderState=o):(i.translucentCommand.shaderProgram=h_(t,e.shaderProgram,"translucentMRT"," vec3 Ci = czm_out_FragColor.rgb * czm_out_FragColor.a;\n float ai = czm_out_FragColor.a;\n float wzi = czm_alphaWeight(ai);\n out_FragData_0 = vec4(Ci * wzi, ai);\n out_FragData_1 = vec4(ai * wzi);\n"),i.translucentCommand.renderState=(n=e.renderState,hm(t,hd,this._translucentRenderStateCache,n)),i.shaderProgramId=e.shaderProgram.id),i}return((0,y.Z)(i.translucentCommand)&&(a=i.translucentCommand.shaderProgram,s=i.translucentCommand.renderState,l=i.alphaCommand.shaderProgram,c=i.alphaCommand.renderState),i.translucentCommand=e3.Z.shallowClone(e,i.translucentCommand),i.alphaCommand=e3.Z.shallowClone(e,i.alphaCommand),(0,y.Z)(a)&&i.shaderProgramId===e.shaderProgram.id)?(i.translucentCommand.shaderProgram=a,i.translucentCommand.renderState=s,i.alphaCommand.shaderProgram=l,i.alphaCommand.renderState=c):(i.translucentCommand.shaderProgram=h_(t,e.shaderProgram,"translucentMultipass"," vec3 Ci = czm_out_FragColor.rgb * czm_out_FragColor.a;\n float ai = czm_out_FragColor.a;\n float wzi = czm_alphaWeight(ai);\n out_FragColor = vec4(Ci, ai) * wzi;\n"),i.translucentCommand.renderState=(r=e.renderState,hm(t,hf,this._translucentRenderStateCache,r)),i.alphaCommand.shaderProgram=h_(t,e.shaderProgram,"alphaMultipass"," float ai = czm_out_FragColor.a;\n out_FragColor = vec4(ai);\n"),i.alphaCommand.renderState=(o=e.renderState,hm(t,hp,this._alphaRenderStateCache,o)),i.shaderProgramId=e.shaderProgram.id),i},hc.prototype.executeCommands=function(e,t,i,n,r){if(this._translucentMRTSupport){!function(e,t,i,n,r,o){let a;let{context:s,frameState:l}=t,{useLogDepth:c,shadowState:u}=l,h=t._hdr,d=n.framebuffer,f=u.lightShadowsEnabled;n.framebuffer=e._adjustTranslucentFBO.framebuffer,e._adjustTranslucentCommand.execute(s,n);let p=e._opaqueFBO.framebuffer;n.framebuffer=e._translucentFBO.framebuffer;for(let e=0;e<r.length;++e)a=r[e],a=c?a.derivedCommands.logDepth.command:a,a=h?a.derivedCommands.hdr.command:a,i(f&&a.receiveShadows?a.derivedCommands.oit.shadows.translucentCommand:a.derivedCommands.oit.translucentCommand,t,s,n,p);(0,y.Z)(o)&&(a=o.unclassifiedCommand,i(f&&a.receiveShadows?a.derivedCommands.oit.shadows.translucentCommand:a.derivedCommands.oit.translucentCommand,t,s,n,p)),n.framebuffer=d}(this,e,t,i,n,r);return}!function(e,t,i,n,r,o){let a,s;let{context:l,frameState:c}=t,{useLogDepth:u,shadowState:h}=c,d=t._hdr,f=n.framebuffer,p=h.lightShadowsEnabled;n.framebuffer=e._adjustTranslucentFBO.framebuffer,e._adjustTranslucentCommand.execute(l,n),n.framebuffer=e._adjustAlphaFBO.framebuffer,e._adjustAlphaCommand.execute(l,n);let m=e._opaqueFBO.framebuffer;for(s=0,n.framebuffer=e._translucentFBO.framebuffer;s<r.length;++s)a=r[s],a=u?a.derivedCommands.logDepth.command:a,a=d?a.derivedCommands.hdr.command:a,i(p&&a.receiveShadows?a.derivedCommands.oit.shadows.translucentCommand:a.derivedCommands.oit.translucentCommand,t,l,n,m);for((0,y.Z)(o)&&(a=o.unclassifiedCommand,i(p&&a.receiveShadows?a.derivedCommands.oit.shadows.translucentCommand:a.derivedCommands.oit.translucentCommand,t,l,n,m)),n.framebuffer=e._alphaFBO.framebuffer,s=0;s<r.length;++s)a=r[s],a=u?a.derivedCommands.logDepth.command:a,a=d?a.derivedCommands.hdr.command:a,i(p&&a.receiveShadows?a.derivedCommands.oit.shadows.alphaCommand:a.derivedCommands.oit.alphaCommand,t,l,n,m);(0,y.Z)(o)&&(a=o.unclassifiedCommand,i(p&&a.receiveShadows?a.derivedCommands.oit.shadows.alphaCommand:a.derivedCommands.oit.alphaCommand,t,l,n,m)),n.framebuffer=f}(this,e,t,i,n,r)},hc.prototype.execute=function(e,t){this._compositeCommand.execute(e,t)},hc.prototype.clear=function(e,t,i){let n=t.framebuffer;t.framebuffer=this._opaqueFBO.framebuffer,A.Z.clone(i,this._opaqueClearCommand.color),this._opaqueClearCommand.execute(e,t),t.framebuffer=this._translucentFBO.framebuffer,(this._translucentMRTSupport?this._translucentMRTClearCommand:this._translucentMultipassClearCommand).execute(e,t),this._translucentMultipassSupport&&(t.framebuffer=this._alphaFBO.framebuffer,this._alphaClearCommand.execute(e,t)),t.framebuffer=n},hc.prototype.isSupported=function(){return this._translucentMRTSupport||this._translucentMultipassSupport},hc.prototype.isDestroyed=function(){return!1},hc.prototype.destroy=function(){return hu(this),hh(this),(0,y.Z)(this._compositeCommand)&&(this._compositeCommand.shaderProgram=this._compositeCommand.shaderProgram&&this._compositeCommand.shaderProgram.destroy()),(0,y.Z)(this._adjustTranslucentCommand)&&(this._adjustTranslucentCommand.shaderProgram=this._adjustTranslucentCommand.shaderProgram&&this._adjustTranslucentCommand.shaderProgram.destroy()),(0,y.Z)(this._adjustAlphaCommand)&&(this._adjustAlphaCommand.shaderProgram=this._adjustAlphaCommand.shaderProgram&&this._adjustAlphaCommand.shaderProgram.destroy()),(0,b.Z)(this)},Object.defineProperties(hg.prototype,{framebuffer:{get:function(){return this._framebuffer.framebuffer}}}),hg.prototype.update=function(e,t,i){let n=i.width,r=i.height;this._framebuffer.isDirty(n,r)&&function(e,t){let i=t.drawingBufferWidth,n=t.drawingBufferHeight;e._framebuffer.update(t,i,n);let r=new ah(t);r.blendingEnabled=!1,r.scissorTest={enabled:!0,rectangle:new oN.Z},r.viewport=new oN.Z,e._passState=r}(this,e);let o=this.framebuffer,a=this._passState;return a.framebuffer=o,a.viewport.width=n,a.viewport.height=r,a.scissorTest.rectangle.x=t.x,a.scissorTest.rectangle.y=r-t.y,a.scissorTest.rectangle.width=1,a.scissorTest.rectangle.height=1,a},hg.prototype.isDestroyed=function(){return!1},hg.prototype.destroy=function(){return function(e){e._framebuffer.destroy()}(this),(0,b.Z)(this)},hZ.prototype.begin=function(e,t){let i=this._context,{width:n,height:r}=t;return oN.Z.clone(e,this._passState.scissorTest.rectangle),this._width=n,this._height=r,this._fb.update(i,n,r),this._passState.framebuffer=this._fb.framebuffer,this._passState.viewport.width=n,this._passState.viewport.height=r,this._passState};let hy=new A.Z;function hb(){this._numSamples=1,this._colorFramebuffer=new uU.Z({depthStencil:!0,supportsDepthTexture:!0}),this._idFramebuffer=new uU.Z({depthStencil:!0,supportsDepthTexture:!0}),this._idClearColor=new A.Z(0,0,0,0),this._clearCommand=new ae.Z({color:new A.Z(0,0,0,0),depth:1,owner:this})}function hv(){}function hT(e){let t;let i=(e=(0,Z.Z)(e,Z.Z.EMPTY_OBJECT)).context;if(!(0,y.Z)(i))throw new v.Z("context is required.");if(!(0,y.Z)(e.lightCamera))throw new v.Z("lightCamera is required.");if((0,y.Z)(e.numberOfCascades)&&1!==e.numberOfCascades&&4!==e.numberOfCascades)throw new v.Z("Only one or four cascades are supported.");this._enabled=(0,Z.Z)(e.enabled,!0),this._softShadows=(0,Z.Z)(e.softShadows,!1),this._normalOffset=(0,Z.Z)(e.normalOffset,!0),this.dirty=!0,this.fromLightSource=(0,Z.Z)(e.fromLightSource,!0),this.darkness=(0,Z.Z)(e.darkness,.3),this._darkness=this.darkness,this.fadingEnabled=(0,Z.Z)(e.fadingEnabled,!0),this.maximumDistance=(0,Z.Z)(e.maximumDistance,5e3),this._outOfView=!1,this._outOfViewPrevious=!1,this._needsUpdate=!0;let n=!0;(E.Z.isInternetExplorer()||E.Z.isEdge()||(E.Z.isChrome()||E.Z.isFirefox())&&E.Z.isWindows()&&!i.depthTexture)&&(n=!1),this._polygonOffsetSupported=n,this._terrainBias={polygonOffset:n,polygonOffsetFactor:1.1,polygonOffsetUnits:4,normalOffset:this._normalOffset,normalOffsetScale:.5,normalShading:!0,normalShadingSmooth:.3,depthBias:1e-4},this._primitiveBias={polygonOffset:n,polygonOffsetFactor:1.1,polygonOffsetUnits:4,normalOffset:this._normalOffset,normalOffsetScale:.1,normalShading:!0,normalShadingSmooth:.05,depthBias:2e-5},this._pointBias={polygonOffset:!1,polygonOffsetFactor:1.1,polygonOffsetUnits:4,normalOffset:this._normalOffset,normalOffsetScale:0,normalShading:!0,normalShadingSmooth:.1,depthBias:5e-4},this._depthAttachment=void 0,this._colorAttachment=void 0,this._shadowMapMatrix=new z.Z,this._shadowMapTexture=void 0,this._lightDirectionEC=new _.Z,this._lightPositionEC=new eH.Z,this._distance=0,this._lightCamera=e.lightCamera,this._shadowMapCamera=new hL,this._shadowMapCullingVolume=void 0,this._sceneCamera=void 0,this._boundingSphere=new S.Z,this._isPointLight=(0,Z.Z)(e.isPointLight,!1),this._pointLightRadius=(0,Z.Z)(e.pointLightRadius,100),this._cascadesEnabled=!this._isPointLight&&(0,Z.Z)(e.cascadesEnabled,!0),this._numberOfCascades=this._cascadesEnabled?(0,Z.Z)(e.numberOfCascades,4):0,this._fitNearFar=!0,this._maximumCascadeDistances=[25,150,700,Number.MAX_VALUE],this._textureSize=new L.Z,this._isSpotLight=!1,this._cascadesEnabled?this._shadowMapCamera.frustum=new rc.Z:(0,y.Z)(this._lightCamera.frustum.fov)&&(this._isSpotLight=!0),this._cascadeSplits=[new eH.Z,new eH.Z],this._cascadeMatrices=[new z.Z,new z.Z,new z.Z,new z.Z],this._cascadeDistances=new eH.Z,t=this._isPointLight?6:this._cascadesEnabled?this._numberOfCascades:1,this._passes=Array(t);for(let e=0;e<t;++e)this._passes[e]=new hE(i);this.debugShow=!1,this.debugFreezeFrame=!1,this._debugFreezeFrame=!1,this._debugCascadeColors=!1,this._debugLightFrustum=void 0,this._debugCameraFrustum=void 0,this._debugCascadeFrustums=Array(this._numberOfCascades),this._debugShadowViewCommand=void 0,this._usesDepthTexture=i.depthTexture,this._isPointLight&&(this._usesDepthTexture=!1),this._primitiveRenderState=void 0,this._terrainRenderState=void 0,this._pointRenderState=void 0,hw(this),this._clearCommand=new ae.Z({depth:1,color:new A.Z}),this._clearPassState=new ah(i),this._size=(0,Z.Z)(e.size,2048),this.size=this._size}function hE(e){this.camera=new hL,this.passState=new ah(e),this.framebuffer=void 0,this.textureOffsets=void 0,this.commandList=[],this.cullingVolume=void 0}function hx(e,t){return e5.Z.fromCache({cull:{enabled:!0,face:ow.Z.BACK},depthTest:{enabled:!0},colorMask:{red:e,green:e,blue:e,alpha:e},depthMask:!0,polygonOffset:{enabled:t.polygonOffset,factor:t.polygonOffsetFactor,units:t.polygonOffsetUnits}})}function hw(e){let t=!e._usesDepthTexture;e._primitiveRenderState=hx(t,e._primitiveBias),e._terrainRenderState=hx(t,e._terrainBias),e._pointRenderState=hx(t,e._pointBias)}function hS(e){let t=e._passes.length;for(let i=0;i<t;++i){let t=e._passes[i],n=t.framebuffer;(0,y.Z)(n)&&!n.isDestroyed()&&n.destroy(),t.framebuffer=void 0}e._depthAttachment=e._depthAttachment&&e._depthAttachment.destroy(),e._colorAttachment=e._colorAttachment&&e._colorAttachment.destroy()}function hC(e,t){e._isPointLight?function(e,t){let i=new uk.Z({context:t,width:e._textureSize.x,height:e._textureSize.y,format:uV.Z.DEPTH_COMPONENT16}),n=new au.Z({context:t,width:e._textureSize.x,height:e._textureSize.y,pixelFormat:te.Z.RGBA,pixelDatatype:to.Z.UNSIGNED_BYTE,sampler:ta.Z.NEAREST}),r=[n.negativeX,n.negativeY,n.negativeZ,n.positiveX,n.positiveY,n.positiveZ];for(let n=0;n<6;++n){let o=new ai.Z({context:t,depthRenderbuffer:i,colorTextures:[r[n]],destroyAttachments:!1}),a=e._passes[n];a.framebuffer=o,a.passState.framebuffer=o}e._shadowMapTexture=n,e._depthAttachment=i,e._colorAttachment=n}(e,t):e._usesDepthTexture?function(e,t){let i=new eP.Z({context:t,width:e._textureSize.x,height:e._textureSize.y,pixelFormat:te.Z.DEPTH_STENCIL,pixelDatatype:to.Z.UNSIGNED_INT_24_8,sampler:ta.Z.NEAREST}),n=new ai.Z({context:t,depthStencilTexture:i,destroyAttachments:!1}),r=e._passes.length;for(let t=0;t<r;++t){let i=e._passes[t];i.framebuffer=n,i.passState.framebuffer=n}e._shadowMapTexture=i,e._depthAttachment=i}(e,t):function(e,t){let i=new uk.Z({context:t,width:e._textureSize.x,height:e._textureSize.y,format:uV.Z.DEPTH_COMPONENT16}),n=new eP.Z({context:t,width:e._textureSize.x,height:e._textureSize.y,pixelFormat:te.Z.RGBA,pixelDatatype:to.Z.UNSIGNED_BYTE,sampler:ta.Z.NEAREST}),r=new ai.Z({context:t,depthRenderbuffer:i,colorTextures:[n],destroyAttachments:!1}),o=e._passes.length;for(let t=0;t<o;++t){let i=e._passes[t];i.framebuffer=r,i.passState.framebuffer=r}e._shadowMapTexture=n,e._depthAttachment=i,e._colorAttachment=n}(e,t)}function hA(e,t,i){i=(0,Z.Z)(i,0),(e._isPointLight||0===i)&&(e._clearCommand.framebuffer=e._passes[i].framebuffer,e._clearCommand.execute(t,e._clearPassState))}hZ.prototype.end=function(e){let t=(0,Z.Z)(e.width,1),i=(0,Z.Z)(e.height,1),n=this._context,r=n.readPixels({x:e.x,y:e.y,width:t,height:i,framebuffer:this._fb.framebuffer}),o=Math.max(t,i),a=o*o,s=Math.floor(.5*t),l=Math.floor(.5*i),c=0,u=0,h=0,d=-1;for(let e=0;e<a;++e){if(-s<=c&&c<=s&&-l<=u&&u<=l){let e=4*((l-u)*t+c+s);hy.red=A.Z.byteToFloat(r[e]),hy.green=A.Z.byteToFloat(r[e+1]),hy.blue=A.Z.byteToFloat(r[e+2]),hy.alpha=A.Z.byteToFloat(r[e+3]);let i=n.getObjectByPickColor(hy);if((0,y.Z)(i))return i}if(c===u||c<0&&-c===u||c>0&&c===1-u){let e=h;h=-d,d=e}c+=h,u+=d}},hZ.prototype.readVoxelInfo=function(e){let t=(0,Z.Z)(e.width,1),i=(0,Z.Z)(e.height,1),n=this._context.readPixels({x:e.x,y:e.y,width:t,height:i,framebuffer:this._fb.framebuffer}),r=Math.floor(.5*t),o=4*(Math.floor(.5*i)*t+r);return n.slice(o,o+4)},hZ.prototype.isDestroyed=function(){return!1},hZ.prototype.destroy=function(){return this._fb.destroy(),(0,b.Z)(this)},Object.defineProperties(hb.prototype,{framebuffer:{get:function(){return this._colorFramebuffer.framebuffer}},idFramebuffer:{get:function(){return this._idFramebuffer.framebuffer}},depthStencilTexture:{get:function(){return this._colorFramebuffer.getDepthStencilTexture()}}}),hb.prototype.update=function(e,t,i,n){let r=t.width,o=t.height,a=i?e.halfFloatingPointTexture?to.Z.HALF_FLOAT:to.Z.FLOAT:to.Z.UNSIGNED_BYTE;this._numSamples=n,this._colorFramebuffer.update(e,r,o,n,a),this._idFramebuffer.update(e,r,o)},hb.prototype.clear=function(e,t,i){A.Z.clone(i,this._clearCommand.color),A.Z.clone(this._idClearColor,this._clearCommand.color),this._colorFramebuffer.clear(e,this._clearCommand,t),this._idFramebuffer.clear(e,this._clearCommand,t)},hb.prototype.getFramebuffer=function(){return this._colorFramebuffer.framebuffer},hb.prototype.getIdFramebuffer=function(){return this._idFramebuffer.framebuffer},hb.prototype.prepareColorTextures=function(e){this._numSamples>1&&this._colorFramebuffer.prepareTextures(e)},hb.prototype.isDestroyed=function(){return!1},hb.prototype.destroy=function(){return this._colorFramebuffer.destroy(),this._idFramebuffer.destroy(),(0,b.Z)(this)},hv.getShadowCastShaderKeyword=function(e,t,i,n){return`castShadow ${e} ${t} ${i} ${n}`},hv.createShadowCastVertexShader=function(e,t,i){let n=e.defines.slice(0),r=e.sources.slice(0);n.push("SHADOW_MAP"),i&&n.push("GENERATE_POSITION");let o=eD.Z.findPositionVarying(e),a=(0,y.Z)(o);if(t&&!a){let e=r.length;for(let t=0;t<e;++t)r[t]=eD.Z.replaceMain(r[t],"czm_shadow_cast_main");r.push("out vec3 v_positionEC; \nvoid main() \n{ \n czm_shadow_cast_main(); \n v_positionEC = (czm_inverseProjection * gl_Position).xyz; \n}")}return new eD.Z({defines:n,sources:r})},hv.createShadowCastFragmentShader=function(e,t,i,n){let r=e.defines.slice(0),o=e.sources.slice(0);r.push("SHADOW_MAP");let a=eD.Z.findPositionVarying(e),s=(0,y.Z)(a);s||(a="v_positionEC");let l=o.length;for(let e=0;e<l;++e)o[e]=eD.Z.replaceMain(o[e],"czm_shadow_cast_main");let c="";return t&&(s||(c+="in vec3 v_positionEC; \n"),c+="uniform vec4 shadowMap_lightPositionEC; \n"),n?c+="void main() \n{ \n":c+="void main() \n{ \n czm_shadow_cast_main(); \n if (out_FragColor.a == 0.0) \n { \n discard; \n } \n",t?c+=` float distance = length(${a}); if (distance >= shadowMap_lightPositionEC.w) { discard; } distance /= shadowMap_lightPositionEC.w; // radius out_FragColor = czm_packDepth(distance); `:i?c+=" out_FragColor = vec4(1.0); \n":c+=" out_FragColor = czm_packDepth(gl_FragCoord.z); \n",c+="} \n",o.push(c),new eD.Z({defines:r,sources:o})},hv.getShadowReceiveShaderKeyword=function(e,t,i,n){let r=e._usesDepthTexture,o=e._polygonOffsetSupported,a=e._isPointLight,s=e._isSpotLight,l=e._numberOfCascades>1,c=e.debugCascadeColors,u=e.softShadows;return`receiveShadow ${r}${o}${a}${s}${l}${c}${u}${t}${i}${n}`},hv.createShadowReceiveVertexShader=function(e,t,i){let n=e.defines.slice(0),r=e.sources.slice(0);return n.push("SHADOW_MAP"),t&&(i?n.push("GENERATE_POSITION_AND_NORMAL"):n.push("GENERATE_POSITION")),new eD.Z({defines:n,sources:r})},hv.createShadowReceiveFragmentShader=function(e,t,i,n,r){let o;let a=eD.Z.findNormalVarying(e),s=!n&&(0,y.Z)(a)||n&&r,l=eD.Z.findPositionVarying(e),c=(0,y.Z)(l),u=t._usesDepthTexture,h=t._polygonOffsetSupported,d=t._isPointLight,f=t._isSpotLight,p=t._numberOfCascades>1,m=t.debugCascadeColors,_=t.softShadows,g=d?t._pointBias:n?t._terrainBias:t._primitiveBias,Z=e.defines.slice(0),b=e.sources.slice(0),v=b.length;for(let e=0;e<v;++e)b[e]=eD.Z.replaceMain(b[e],"czm_shadow_receive_main");d?Z.push("USE_CUBE_MAP_SHADOW"):u&&Z.push("USE_SHADOW_DEPTH_TEXTURE"),_&&!d&&Z.push("USE_SOFT_SHADOWS"),p&&i&&n&&(s?Z.push("ENABLE_VERTEX_LIGHTING"):Z.push("ENABLE_DAYNIGHT_SHADING")),i&&g.normalShading&&s&&(Z.push("USE_NORMAL_SHADING"),g.normalShadingSmooth>0&&Z.push("USE_NORMAL_SHADING_SMOOTH"));let T="";return d?T+="uniform samplerCube shadowMap_textureCube; \n":T+="uniform sampler2D shadowMap_texture; \n",o=c?` return vec4(${l}, 1.0); `:"#ifndef LOG_DEPTH \n return czm_windowToEyeCoordinates(gl_FragCoord); \n#else \n return vec4(v_logPositionEC, 1.0); \n#endif \n",T+=`uniform mat4 shadowMap_matrix; uniform vec3 shadowMap_lightDirectionEC; uniform vec4 shadowMap_lightPositionEC; uniform vec4 shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness; uniform vec4 shadowMap_texelSizeDepthBiasAndNormalShadingSmooth; #ifdef LOG_DEPTH in vec3 v_logPositionEC; #endif vec4 getPositionEC() { ${o}} vec3 getNormalEC() { ${s?` return normalize(${a}); `:" return vec3(1.0); \n"}} void applyNormalOffset(inout vec4 positionEC, vec3 normalEC, float nDotL) { ${g.normalOffset&&s?" float normalOffset = shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness.x; \n float normalOffsetScale = 1.0 - nDotL; \n vec3 offset = normalOffset * normalOffsetScale * normalEC; \n positionEC.xyz += offset; \n":""}} void main() { czm_shadow_receive_main(); vec4 positionEC = getPositionEC(); vec3 normalEC = getNormalEC(); float depth = -positionEC.z; czm_shadowParameters shadowParameters; shadowParameters.texelStepSize = shadowMap_texelSizeDepthBiasAndNormalShadingSmooth.xy; shadowParameters.depthBias = shadowMap_texelSizeDepthBiasAndNormalShadingSmooth.z; shadowParameters.normalShadingSmooth = shadowMap_texelSizeDepthBiasAndNormalShadingSmooth.w; shadowParameters.darkness = shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness.w; `,n?T+=" shadowParameters.depthBias *= max(depth * 0.01, 1.0); \n":h||(T+=" shadowParameters.depthBias *= mix(1.0, 100.0, depth * 0.0015); \n"),d?T+=" vec3 directionEC = positionEC.xyz - shadowMap_lightPositionEC.xyz; \n float distance = length(directionEC); \n directionEC = normalize(directionEC); \n float radius = shadowMap_lightPositionEC.w; \n // Stop early if the fragment is beyond the point light radius \n if (distance > radius) \n { \n return; \n } \n vec3 directionWC = czm_inverseViewRotation * directionEC; \n shadowParameters.depth = distance / radius; \n shadowParameters.nDotL = clamp(dot(normalEC, -directionEC), 0.0, 1.0); \n shadowParameters.texCoords = directionWC; \n float visibility = czm_shadowVisibility(shadowMap_textureCube, shadowParameters); \n":f?T+=" vec3 directionEC = normalize(positionEC.xyz - shadowMap_lightPositionEC.xyz); \n float nDotL = clamp(dot(normalEC, -directionEC), 0.0, 1.0); \n applyNormalOffset(positionEC, normalEC, nDotL); \n vec4 shadowPosition = shadowMap_matrix * positionEC; \n // Spot light uses a perspective projection, so perform the perspective divide \n shadowPosition /= shadowPosition.w; \n // Stop early if the fragment is not in the shadow bounds \n if (any(lessThan(shadowPosition.xyz, vec3(0.0))) || any(greaterThan(shadowPosition.xyz, vec3(1.0)))) \n { \n return; \n } \n shadowParameters.texCoords = shadowPosition.xy; \n shadowParameters.depth = shadowPosition.z; \n shadowParameters.nDotL = nDotL; \n float visibility = czm_shadowVisibility(shadowMap_texture, shadowParameters); \n":p?T+=` float maxDepth = shadowMap_cascadeSplits[1].w; // Stop early if the eye depth exceeds the last cascade if (depth > maxDepth) { return; } // Get the cascade based on the eye-space depth vec4 weights = czm_cascadeWeights(depth); // Apply normal offset float nDotL = clamp(dot(normalEC, shadowMap_lightDirectionEC), 0.0, 1.0); applyNormalOffset(positionEC, normalEC, nDotL); // Transform position into the cascade vec4 shadowPosition = czm_cascadeMatrix(weights) * positionEC; // Get visibility shadowParameters.texCoords = shadowPosition.xy; shadowParameters.depth = shadowPosition.z; shadowParameters.nDotL = nDotL; float visibility = czm_shadowVisibility(shadowMap_texture, shadowParameters); // Fade out shadows that are far away float shadowMapMaximumDistance = shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness.z; float fade = max((depth - shadowMapMaximumDistance * 0.8) / (shadowMapMaximumDistance * 0.2), 0.0); visibility = mix(visibility, 1.0, fade); ${m?" // Draw cascade colors for debugging \n out_FragColor *= czm_cascadeColor(weights); \n":""}`:T+=" float nDotL = clamp(dot(normalEC, shadowMap_lightDirectionEC), 0.0, 1.0); \n applyNormalOffset(positionEC, normalEC, nDotL); \n vec4 shadowPosition = shadowMap_matrix * positionEC; \n // Stop early if the fragment is not in the shadow bounds \n if (any(lessThan(shadowPosition.xyz, vec3(0.0))) || any(greaterThan(shadowPosition.xyz, vec3(1.0)))) \n { \n return; \n } \n shadowParameters.texCoords = shadowPosition.xy; \n shadowParameters.depth = shadowPosition.z; \n shadowParameters.nDotL = nDotL; \n float visibility = czm_shadowVisibility(shadowMap_texture, shadowParameters); \n",T+=" out_FragColor.rgb *= visibility; \n} \n",b.push(T),new eD.Z({defines:Z,sources:b})},hT.MAXIMUM_DISTANCE=2e4,hT.prototype.debugCreateRenderStates=function(){hw(this)},Object.defineProperties(hT.prototype,{enabled:{get:function(){return this._enabled},set:function(e){this.dirty=this._enabled!==e,this._enabled=e}},normalOffset:{get:function(){return this._normalOffset},set:function(e){this.dirty=this._normalOffset!==e,this._normalOffset=e,this._terrainBias.normalOffset=e,this._primitiveBias.normalOffset=e,this._pointBias.normalOffset=e}},softShadows:{get:function(){return this._softShadows},set:function(e){this.dirty=this._softShadows!==e,this._softShadows=e}},size:{get:function(){return this._size},set:function(e){(function(e,t){e._size=t;let i=e._passes,n=i.length,r=e._textureSize;if(e._isPointLight){t=e2.Z.maximumCubeMapSize>=t?t:e2.Z.maximumCubeMapSize,r.x=t,r.y=t;let e=new oN.Z(0,0,t,t);i[0].passState.viewport=e,i[1].passState.viewport=e,i[2].passState.viewport=e,i[3].passState.viewport=e,i[4].passState.viewport=e,i[5].passState.viewport=e}else 1===n?(t=e2.Z.maximumTextureSize>=t?t:e2.Z.maximumTextureSize,r.x=t,r.y=t,i[0].passState.viewport=new oN.Z(0,0,t,t)):4===n&&(t=e2.Z.maximumTextureSize>=2*t?t:e2.Z.maximumTextureSize/2,r.x=2*t,r.y=2*t,i[0].passState.viewport=new oN.Z(0,0,t,t),i[1].passState.viewport=new oN.Z(t,0,t,t),i[2].passState.viewport=new oN.Z(0,t,t,t),i[3].passState.viewport=new oN.Z(t,t,t,t));e._clearPassState.viewport=new oN.Z(0,0,r.x,r.y);for(let e=0;e<n;++e){let t=i[e],n=t.passState.viewport,o=n.x/r.x,a=n.y/r.y,s=n.width/r.x,l=n.height/r.y;t.textureOffsets=new z.Z(s,0,0,o,0,l,0,a,0,0,1,0,0,0,0,1)}})(this,e)}},outOfView:{get:function(){return this._outOfView}},shadowMapCullingVolume:{get:function(){return this._shadowMapCullingVolume}},passes:{get:function(){return this._passes}},isPointLight:{get:function(){return this._isPointLight}},debugCascadeColors:{get:function(){return this._debugCascadeColors},set:function(e){this.dirty=this._debugCascadeColors!==e,this._debugCascadeColors=e}}});let hI=new oN.Z,hO=Array(8);hO[0]=new eH.Z(-1,-1,-1,1),hO[1]=new eH.Z(1,-1,-1,1),hO[2]=new eH.Z(1,1,-1,1),hO[3]=new eH.Z(-1,1,-1,1),hO[4]=new eH.Z(-1,-1,1,1),hO[5]=new eH.Z(1,-1,1,1),hO[6]=new eH.Z(1,1,1,1),hO[7]=new eH.Z(-1,1,1,1);let hD=new z.Z,hP=Array(8);for(let e=0;e<8;++e)hP[e]=new eH.Z;let hR=[A.Z.RED,A.Z.GREEN,A.Z.BLUE,A.Z.MAGENTA],hN=new _.Z;function hL(){this.viewMatrix=new z.Z,this.inverseViewMatrix=new z.Z,this.frustum=void 0,this.positionCartographic=new C.Z,this.positionWC=new _.Z,this.directionWC=_.Z.clone(_.Z.UNIT_Z),this.upWC=_.Z.clone(_.Z.UNIT_Y),this.rightWC=_.Z.clone(_.Z.UNIT_X),this.viewProjectionMatrix=new z.Z}hL.prototype.clone=function(e){z.Z.clone(e.viewMatrix,this.viewMatrix),z.Z.clone(e.inverseViewMatrix,this.inverseViewMatrix),this.frustum=e.frustum.clone(this.frustum),C.Z.clone(e.positionCartographic,this.positionCartographic),_.Z.clone(e.positionWC,this.positionWC),_.Z.clone(e.directionWC,this.directionWC),_.Z.clone(e.upWC,this.upWC),_.Z.clone(e.rightWC,this.rightWC)};let hM=new z.Z(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1);hL.prototype.getViewProjection=function(){let e=this.viewMatrix,t=this.frustum.projectionMatrix;return z.Z.multiply(t,e,this.viewProjectionMatrix),z.Z.multiply(hM,this.viewProjectionMatrix,this.viewProjectionMatrix),this.viewProjectionMatrix};let hF=[,,,,,],hz=new o8,hB=[,,,,],hU=new _.Z,hk=new _.Z,hV=new z.Z,hH=new _.Z,hG=new _.Z,hj=new _.Z,hW=[new _.Z(-1,0,0),new _.Z(0,-1,0),new _.Z(0,0,-1),new _.Z(1,0,0),new _.Z(0,1,0),new _.Z(0,0,1)],hq=[new _.Z(0,-1,0),new _.Z(0,0,-1),new _.Z(0,-1,0),new _.Z(0,-1,0),new _.Z(0,0,1),new _.Z(0,-1,0)],hY=[new _.Z(0,0,1),new _.Z(1,0,0),new _.Z(-1,0,0),new _.Z(0,0,-1),new _.Z(1,0,0),new _.Z(1,0,0)],hX=new _.Z,h$=new _.Z,hK=new S.Z,hQ=hK.center;hT.prototype.update=function(e){if(function(e,t){let i,n;let r=t.camera,o=e._lightCamera,a=e._sceneCamera,s=e._shadowMapCamera;e._cascadesEnabled?_.Z.clone(o.directionWC,s.directionWC):e._isPointLight?_.Z.clone(o.positionWC,s.positionWC):s.clone(o);let l=e._lightDirectionEC;z.Z.multiplyByPointAsVector(r.viewMatrix,s.directionWC,l),_.Z.normalize(l,l),_.Z.negate(l,l),z.Z.multiplyByPoint(r.viewMatrix,s.positionWC,e._lightPositionEC),e._lightPositionEC.w=e._pointLightRadius,e._fitNearFar?(i=Math.min(t.shadowState.nearPlane,e.maximumDistance),n=Math.max(n=Math.min(t.shadowState.farPlane,e.maximumDistance),i+1)):(i=r.frustum.near,n=e.maximumDistance),e._sceneCamera=sf.clone(r,a),r.frustum.clone(e._sceneCamera.frustum),e._sceneCamera.frustum.near=i,e._sceneCamera.frustum.far=n,e._distance=n-i,function(e,t){let i=e._sceneCamera,n=e._shadowMapCamera;if(e._cascadesEnabled){if(i.frustum.near>=e.maximumDistance){e._outOfView=!0,e._needsUpdate=!1;return}let r=t.mapProjection.ellipsoid.geodeticSurfaceNormal(i.positionWC,hX),o=_.Z.negate(n.directionWC,h$),a=_.Z.dot(r,o);if(e.fadingEnabled){let t=F.Z.clamp(a/.1,0,1);e._darkness=F.Z.lerp(1,e.darkness,t)}else e._darkness=e.darkness;if(a<0){e._outOfView=!0,e._needsUpdate=!1;return}e._needsUpdate=!0,e._outOfView=!1}else if(e._isPointLight)hK.center=n.positionWC,hK.radius=e._pointLightRadius,e._outOfView=t.cullingVolume.computeVisibility(hK)===eX.Z.OUTSIDE,e._needsUpdate=!e._outOfView&&!e._boundingSphere.equals(hK),S.Z.clone(hK,e._boundingSphere);else{let i=n.frustum.far/2,r=_.Z.add(n.positionWC,_.Z.multiplyByScalar(n.directionWC,i,hQ),hQ);hK.center=r,hK.radius=i,e._outOfView=t.cullingVolume.computeVisibility(hK)===eX.Z.OUTSIDE,e._needsUpdate=!e._outOfView&&!e._boundingSphere.equals(hK),S.Z.clone(hK,e._boundingSphere)}}(e,t),!e._outOfViewPrevious&&e._outOfView&&(e._needsUpdate=!0),e._outOfViewPrevious=e._outOfView}(this,e),this._needsUpdate){var t,i;if(t=this,i=e.context,(0,y.Z)(t._passes[0].framebuffer)&&t._shadowMapTexture.width===t._textureSize.x||(hS(t),hC(t,i),t._usesDepthTexture&&t._passes[0].framebuffer.status!==ac.Z.FRAMEBUFFER_COMPLETE&&(t._usesDepthTexture=!1,hw(t),hS(t),hC(t,i)),hA(t,i)),this._isPointLight&&function(e,t){let i=new o8;i.fov=F.Z.PI_OVER_TWO,i.near=1,i.far=e._pointLightRadius,i.aspectRatio=1;for(let n=0;n<6;++n){let r=e._passes[n].camera;r.positionWC=e._shadowMapCamera.positionWC,r.positionCartographic=t.mapProjection.ellipsoid.cartesianToCartographic(r.positionWC,r.positionCartographic),r.directionWC=hW[n],r.upWC=hq[n],r.rightWC=hY[n],z.Z.computeView(r.positionWC,r.directionWC,r.upWC,r.rightWC,r.viewMatrix),z.Z.inverse(r.viewMatrix,r.inverseViewMatrix),r.frustum=i}}(this,e),this._cascadesEnabled&&(function(e,t){let i=e._shadowMapCamera,n=e._sceneCamera,r=z.Z.multiply(n.frustum.projectionMatrix,n.viewMatrix,hD),o=z.Z.inverse(r,hD),a=i.directionWC,s=n.directionWC;_.Z.equalsEpsilon(a,s,F.Z.EPSILON10)&&(s=n.upWC);let l=_.Z.cross(a,s,hH);s=_.Z.cross(l,a,hG),_.Z.normalize(s,s),_.Z.normalize(l,l);let c=_.Z.fromElements(0,0,0,hj),u=z.Z.computeView(c,a,s,l,hV),h=z.Z.multiply(u,o,hD),d=_.Z.fromElements(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,hU),f=_.Z.fromElements(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,hk);for(let e=0;e<8;++e){let t=eH.Z.clone(hO[e],hP[e]);z.Z.multiplyByVector(h,t,t),_.Z.divideByScalar(t,t.w,t),_.Z.minimumByComponent(t,d,d),_.Z.maximumByComponent(t,f,f)}f.z+=1e3,d.z-=10,hj.x=-(.5*(d.x+f.x)),hj.y=-(.5*(d.y+f.y)),hj.z=-f.z;let p=z.Z.fromTranslation(hj,hD);u=z.Z.multiply(p,u,u);let m=.5*(f.x-d.x),g=.5*(f.y-d.y),Z=f.z-d.z,y=i.frustum;y.left=-m,y.right=m,y.bottom=-g,y.top=g,y.near=.01,y.far=Z,z.Z.clone(u,i.viewMatrix),z.Z.inverse(u,i.inverseViewMatrix),z.Z.getTranslation(i.inverseViewMatrix,i.positionWC),t.mapProjection.ellipsoid.cartesianToCartographic(i.positionWC,i.positionCartographic),_.Z.clone(a,i.directionWC),_.Z.clone(s,i.upWC),_.Z.clone(l,i.rightWC)}(this,e),this._numberOfCascades>1&&function(e,t){let i;let n=e._shadowMapCamera,r=e._sceneCamera,o=r.frustum.near,a=r.frustum.far,s=e._numberOfCascades,l=a-o,c=a/o,u=.9,h=!1;for(t.shadowState.closestObjectSize<200&&(h=!0,u=.9),i=0,hF[0]=o,hF[s]=a;i<s;++i){let e=(i+1)/s,t=o*Math.pow(c,e),n=o+l*e,r=F.Z.lerp(n,t,u);hF[i+1]=r,hB[i]=r-hF[i]}if(h){for(i=0;i<s;++i)hB[i]=Math.min(hB[i],e._maximumCascadeDistances[i]);let t=hF[0];for(i=0;i<s-1;++i)t+=hB[i],hF[i+1]=t}eH.Z.unpack(hF,0,e._cascadeSplits[0]),eH.Z.unpack(hF,1,e._cascadeSplits[1]),eH.Z.unpack(hB,0,e._cascadeDistances);let d=n.frustum,f=d.left,p=d.right,m=d.bottom,g=d.top,Z=d.near,y=d.far,b=n.positionWC,v=n.directionWC,T=n.upWC,E=r.frustum.clone(hz),x=n.getViewProjection();for(i=0;i<s;++i){E.near=hF[i],E.far=hF[i+1];let t=z.Z.multiply(E.projectionMatrix,r.viewMatrix,hD),o=z.Z.inverse(t,hD),a=z.Z.multiply(x,o,hD),s=_.Z.fromElements(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,hU),l=_.Z.fromElements(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,hk);for(let e=0;e<8;++e){let t=eH.Z.clone(hO[e],hP[e]);z.Z.multiplyByVector(a,t,t),_.Z.divideByScalar(t,t.w,t),_.Z.minimumByComponent(t,s,s),_.Z.maximumByComponent(t,l,l)}s.x=Math.max(s.x,0),s.y=Math.max(s.y,0),s.z=0,l.x=Math.min(l.x,1),l.y=Math.min(l.y,1),l.z=Math.min(l.z,1);let c=e._passes[i],u=c.camera;u.clone(n);let h=u.frustum;h.left=f+s.x*(p-f),h.right=f+l.x*(p-f),h.bottom=m+s.y*(g-m),h.top=m+l.y*(g-m),h.near=Z+s.z*(y-Z),h.far=Z+l.z*(y-Z),c.cullingVolume=u.frustum.computeCullingVolume(b,v,T);let d=e._cascadeMatrices[i];z.Z.multiply(u.getViewProjection(),r.inverseViewMatrix,d),z.Z.multiply(c.textureOffsets,d,d)}}(this,e)),this._isPointLight)this._shadowMapCullingVolume=oM.Z.fromBoundingSphere(this._boundingSphere);else{let e=this._shadowMapCamera,t=e.positionWC,i=e.directionWC,n=e.upWC;this._shadowMapCullingVolume=e.frustum.computeCullingVolume(t,i,n),1===this._passes.length&&this._passes[0].camera.clone(e)}}if(1===this._passes.length){let e=this._sceneCamera.inverseViewMatrix;z.Z.multiply(this._shadowMapCamera.getViewProjection(),e,this._shadowMapMatrix)}this.debugShow&&function(e,t){!function(e,t){let i=t.context,n=t.context.drawingBufferWidth,r=.3*Math.min(n,t.context.drawingBufferHeight);hI.x=n-r,hI.y=0,hI.width=r,hI.height=r;let o=e._debugShadowViewCommand;(0,y.Z)(o)||(o=function(e,t){let i;i=e._isPointLight?"uniform samplerCube shadowMap_textureCube; \nin vec2 v_textureCoordinates; \nvoid main() \n{ \n vec2 uv = v_textureCoordinates; \n vec3 dir; \n \n if (uv.y < 0.5) \n { \n if (uv.x < 0.333) \n { \n dir.x = -1.0; \n dir.y = uv.x * 6.0 - 1.0; \n dir.z = uv.y * 4.0 - 1.0; \n } \n else if (uv.x < 0.666) \n { \n dir.y = -1.0; \n dir.x = uv.x * 6.0 - 3.0; \n dir.z = uv.y * 4.0 - 1.0; \n } \n else \n { \n dir.z = -1.0; \n dir.x = uv.x * 6.0 - 5.0; \n dir.y = uv.y * 4.0 - 1.0; \n } \n } \n else \n { \n if (uv.x < 0.333) \n { \n dir.x = 1.0; \n dir.y = uv.x * 6.0 - 1.0; \n dir.z = uv.y * 4.0 - 3.0; \n } \n else if (uv.x < 0.666) \n { \n dir.y = 1.0; \n dir.x = uv.x * 6.0 - 3.0; \n dir.z = uv.y * 4.0 - 3.0; \n } \n else \n { \n dir.z = 1.0; \n dir.x = uv.x * 6.0 - 5.0; \n dir.y = uv.y * 4.0 - 3.0; \n } \n } \n \n float shadow = czm_unpackDepth(czm_textureCube(shadowMap_textureCube, dir)); \n out_FragColor = vec4(vec3(shadow), 1.0); \n} \n":`uniform sampler2D shadowMap_texture; in vec2 v_textureCoordinates; void main() { ${e._usesDepthTexture?" float shadow = texture(shadowMap_texture, v_textureCoordinates).r; \n":" float shadow = czm_unpackDepth(texture(shadowMap_texture, v_textureCoordinates)); \n"} out_FragColor = vec4(vec3(shadow), 1.0); } `;let n=t.createViewportQuadCommand(i,{uniformMap:{shadowMap_texture:function(){return e._shadowMapTexture},shadowMap_textureCube:function(){return e._shadowMapTexture}}});return n.pass=e4.Z.OVERLAY,n}(e,i),e._debugShadowViewCommand=o),(0,y.Z)(o.renderState)&&oN.Z.equals(o.renderState.viewport,hI)||(o.renderState=e5.Z.fromCache({viewport:oN.Z.clone(hI)})),t.commandList.push(e._debugShadowViewCommand)}(e,t);let i=e.debugFreezeFrame&&!e._debugFreezeFrame;if(e._debugFreezeFrame=e.debugFreezeFrame,e.debugFreezeFrame&&(i&&(e._debugCameraFrustum=e._debugCameraFrustum&&e._debugCameraFrustum.destroy(),e._debugCameraFrustum=new cM({camera:e._sceneCamera,color:A.Z.CYAN,updateOnChange:!1})),e._debugCameraFrustum.update(t)),e._cascadesEnabled){if(e.debugFreezeFrame){i&&(e._debugLightFrustum=e._debugLightFrustum&&e._debugLightFrustum.destroy(),e._debugLightFrustum=new cM({camera:e._shadowMapCamera,color:A.Z.YELLOW,updateOnChange:!1})),e._debugLightFrustum.update(t);for(let n=0;n<e._numberOfCascades;++n)i&&(e._debugCascadeFrustums[n]=e._debugCascadeFrustums[n]&&e._debugCascadeFrustums[n].destroy(),e._debugCascadeFrustums[n]=new cM({camera:e._passes[n].camera,color:hR[n],updateOnChange:!1})),e._debugCascadeFrustums[n].update(t)}}else if(e._isPointLight){if(!(0,y.Z)(e._debugLightFrustum)||e._needsUpdate){let t=e._shadowMapCamera.positionWC,i=rq.Z.IDENTITY,n=2*e._pointLightRadius,r=_.Z.fromElements(n,n,n,hN),o=z.Z.fromTranslationQuaternionRotationScale(t,i,r,hD);e._debugLightFrustum=e._debugLightFrustum&&e._debugLightFrustum.destroy(),e._debugLightFrustum=function(e,t){let i=new eq.Z({geometry:new eV.Z({minimum:new _.Z(-.5,-.5,-.5),maximum:new _.Z(.5,.5,.5)}),attributes:{color:ej.Z.fromColor(t)}}),n=new eq.Z({geometry:new eQ.Z({radius:.5}),attributes:{color:ej.Z.fromColor(t)}});return new i3.Z({geometryInstances:[i,n],appearance:new i2.Z({translucent:!1,flat:!0}),asynchronous:!1,modelMatrix:e})}(o,A.Z.YELLOW)}e._debugLightFrustum.update(t)}else(!(0,y.Z)(e._debugLightFrustum)||e._needsUpdate)&&(e._debugLightFrustum=new cM({camera:e._shadowMapCamera,color:A.Z.YELLOW,updateOnChange:!1})),e._debugLightFrustum.update(t)}(this,e)},hT.prototype.updatePass=function(e,t){hA(this,e,t)};let hJ=new L.Z;function h0(e,t,i){let n=e._isPointLight?e._pointBias:i?e._terrainBias:e._primitiveBias,r={shadowMap_texture:function(){return e._shadowMapTexture},shadowMap_textureCube:function(){return e._shadowMapTexture},shadowMap_matrix:function(){return e._shadowMapMatrix},shadowMap_cascadeSplits:function(){return e._cascadeSplits},shadowMap_cascadeMatrices:function(){return e._cascadeMatrices},shadowMap_lightDirectionEC:function(){return e._lightDirectionEC},shadowMap_lightPositionEC:function(){return e._lightPositionEC},shadowMap_cascadeDistances:function(){return e._cascadeDistances},shadowMap_texelSizeDepthBiasAndNormalShadingSmooth:function(){return hJ.x=1/e._textureSize.x,hJ.y=1/e._textureSize.y,eH.Z.fromElements(hJ.x,hJ.y,n.depthBias,n.normalShadingSmooth,this.combinedUniforms1)},shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness:function(){return eH.Z.fromElements(n.normalOffsetScale,e._distance,e.maximumDistance,e._darkness,this.combinedUniforms2)},combinedUniforms1:new eH.Z,combinedUniforms2:new eH.Z};return(0,eW.Z)(t,r,!1)}hT.createReceiveDerivedCommand=function(e,t,i,n,r){(0,y.Z)(r)||(r={});let o=e.length>0,a=t.shaderProgram,s=a.vertexShaderSource,l=a.fragmentShaderSource,c=t.pass===e4.Z.GLOBE,u=!1;if(c&&(u=t.owner.data.renderedMesh.encoding.hasVertexNormals),t.receiveShadows&&o){let o,h;(0,y.Z)(r.receiveCommand)&&(o=r.receiveCommand.shaderProgram,h=r.receiveCommand.uniformMap),r.receiveCommand=e3.Z.shallowClone(t,r.receiveCommand),r.castShadows=!1,r.receiveShadows=!0;let d=r.receiveShaderCastShadows!==t.castShadows,f=r.receiveShaderProgramId!==t.shaderProgram.id;if(!(0,y.Z)(o)||f||i||d){let i=hv.getShadowReceiveShaderKeyword(e[0],t.castShadows,c,u);if(o=n.shaderCache.getDerivedShaderProgram(a,i),!(0,y.Z)(o)){let r=hv.createShadowReceiveVertexShader(s,c,u),h=hv.createShadowReceiveFragmentShader(l,e[0],t.castShadows,c,u);o=n.shaderCache.createDerivedShaderProgram(a,i,{vertexShaderSource:r,fragmentShaderSource:h,attributeLocations:a._attributeLocations})}h=h0(e[0],t.uniformMap,c)}r.receiveCommand.shaderProgram=o,r.receiveCommand.uniformMap=h,r.receiveShaderProgramId=t.shaderProgram.id,r.receiveShaderCastShadows=t.castShadows}return r},hT.createCastDerivedCommand=function(e,t,i,n,r){if((0,y.Z)(r)||(r={}),t.castShadows){let o=r.castCommands;(0,y.Z)(o)||(o=r.castCommands=[]);let a=r.castShaderProgramId,s=e.length;o.length=s;for(let r=0;r<s;++r)o[r]=function(e,t,i,n,r,o){let a,s,l;if((0,y.Z)(o)&&(a=o.shaderProgram,s=o.renderState,l=o.uniformMap),(o=e3.Z.shallowClone(i,o)).castShadows=!0,o.receiveShadows=!1,!(0,y.Z)(a)||r!==i.shaderProgram.id||t){let t=i.shaderProgram,r=i.pass===e4.Z.GLOBE,o=i.pass!==e4.Z.TRANSLUCENT,c=e._isPointLight,u=e._usesDepthTexture,h=hv.getShadowCastShaderKeyword(c,r,u,o);if(a=n.shaderCache.getDerivedShaderProgram(t,h),!(0,y.Z)(a)){let e=t.vertexShaderSource,i=t.fragmentShaderSource,s=hv.createShadowCastVertexShader(e,c,r),l=hv.createShadowCastFragmentShader(i,c,u,o);a=n.shaderCache.createDerivedShaderProgram(t,h,{vertexShaderSource:s,fragmentShaderSource:l,attributeLocations:t._attributeLocations})}s=e._primitiveRenderState,c?s=e._pointRenderState:r&&(s=e._terrainRenderState),i.renderState.cull.enabled||((s=(0,eG.Z)(s,!1)).cull=(0,eG.Z)(s.cull,!1),s.cull.enabled=!1,s=e5.Z.fromCache(s)),l=h0(e,i.uniformMap,r)}return o.shaderProgram=a,o.renderState=s,o.uniformMap=l,o}(e[r],i,t,n,a,o[r]);r.castShaderProgramId=t.shaderProgram.id}return r},hT.prototype.isDestroyed=function(){return!1},hT.prototype.destroy=function(){hS(this),this._debugLightFrustum=this._debugLightFrustum&&this._debugLightFrustum.destroy(),this._debugCameraFrustum=this._debugCameraFrustum&&this._debugCameraFrustum.destroy(),this._debugShadowViewCommand=this._debugShadowViewCommand&&this._debugShadowViewCommand.shaderProgram&&this._debugShadowViewCommand.shaderProgram.destroy();for(let e=0;e<this._numberOfCascades;++e)this._debugCascadeFrustums[e]=this._debugCascadeFrustums[e]&&this._debugCascadeFrustums[e].destroy();return(0,b.Z)(this)};var h1="uniform sampler2D colorTexture;\n\n#ifdef DEBUG_SHOW_DEPTH\nuniform sampler2D u_packedTranslucentDepth;\n#endif\n\nin vec2 v_textureCoordinates;\n\nvoid main()\n{\n#ifdef DEBUG_SHOW_DEPTH\n if (v_textureCoordinates.x < 0.5)\n {\n out_FragColor.rgb = vec3(czm_unpackDepth(texture(u_packedTranslucentDepth, v_textureCoordinates)));\n out_FragColor.a = 1.0;\n }\n#else\n vec4 color = texture(colorTexture, v_textureCoordinates);\n\n#ifdef PICK\n if (color == vec4(0.0))\n {\n discard;\n }\n#else\n // Reverse premultiplication process to get the correct composited result of the classification primitives\n color.rgb /= color.a;\n#endif\n out_FragColor = color;\n#endif\n}\n";function h2(e){this._drawClassificationFBO=new uU.Z({createDepthAttachments:!1}),this._accumulationFBO=new uU.Z({createDepthAttachments:!1}),this._packFBO=new uU.Z,this._opaqueDepthStencilTexture=void 0,this._textureToComposite=void 0,this._translucentDepthStencilTexture=void 0,this._packDepthCommand=void 0,this._accumulateCommand=void 0,this._compositeCommand=void 0,this._copyCommand=void 0,this._clearColorCommand=new ae.Z({color:new A.Z(0,0,0,0),owner:this}),this._clearDepthStencilCommand=new ae.Z({depth:1,stencil:0,owner:this}),this._supported=e.depthTexture,this._viewport=new oN.Z,this._rsDepth=void 0,this._rsAccumulate=void 0,this._rsComp=void 0,this._useScissorTest=void 0,this._scissorRectangle=void 0,this._hasTranslucentDepth=!1,this._frustumsDrawn=0}function h3(e){e._textureToComposite=void 0,e._translucentDepthStencilTexture=e._translucentDepthStencilTexture&&!e._translucentDepthStencilTexture.isDestroyed()&&e._translucentDepthStencilTexture.destroy()}function h4(e){e._drawClassificationFBO.destroy(),e._accumulationFBO.destroy(),e._packFBO.destroy()}function h5(){this.command=void 0,this.near=void 0,this.far=void 0}function h9(e,t,i){let n,r;let o=e.context;o.depthTexture&&(n=new hn),e._useOIT&&o.depthTexture&&(r=new hc(o));let a=new ah(o);a.viewport=oN.Z.clone(i),this.camera=t,this._cameraClone=sf.clone(t),this._cameraStartFired=!1,this._cameraMovedTime=void 0,this.viewport=i,this.passState=a,this.pickFramebuffer=new hZ(o),this.pickDepthFramebuffer=new hg,this.sceneFramebuffer=new hb,this.globeDepth=n,this.globeTranslucencyFramebuffer=new ho,this.oit=r,this.translucentTileClassification=new h2(o),this.pickDepths=[],this.frustumCommandsList=[],this.debugFrustumStatistics=void 0,this._commandExtents=[]}Object.defineProperties(h2.prototype,{hasTranslucentDepth:{get:function(){return this._hasTranslucentDepth}}}),h2.prototype.executeTranslucentCommands=function(e,t,i,n,r){let o,a;let s=n.length,l=e.frameState.useLogDepth,c=e.context,u=i.framebuffer;for(a=0;a<s;++a)if(o=n[a],(o=l?o.derivedCommands.logDepth.command:o).depthForTranslucentClassification){this._hasTranslucentDepth=!0;break}if(this._hasTranslucentDepth){for(function(e,t,i,n){let r,o;if(!e.isSupported())return;e._opaqueDepthStencilTexture=n;let a=e._opaqueDepthStencilTexture.width,s=e._opaqueDepthStencilTexture.height;if(e._drawClassificationFBO.isDirty(a,s)&&(h3(e),e._translucentDepthStencilTexture=new eP.Z({context:t,width:a,height:s,pixelFormat:te.Z.DEPTH_STENCIL,pixelDatatype:to.Z.UNSIGNED_INT_24_8,sampler:ta.Z.NEAREST}),h4(e),e._drawClassificationFBO.setDepthStencilTexture(e._translucentDepthStencilTexture),e._drawClassificationFBO.update(t,a,s),e._accumulationFBO.setDepthStencilTexture(e._translucentDepthStencilTexture),e._accumulationFBO.update(t,a,s),e._packFBO.update(t,a,s)),(0,y.Z)(e._packDepthCommand)||(r=new eD.Z({sources:["uniform sampler2D u_opaqueDepthTexture;\nuniform sampler2D u_translucentDepthTexture;\n\nin vec2 v_textureCoordinates;\n\nvoid main()\n{\n float opaqueDepth = texture(u_opaqueDepthTexture, v_textureCoordinates).r;\n float translucentDepth = texture(u_translucentDepthTexture, v_textureCoordinates).r;\n translucentDepth = czm_branchFreeTernary(translucentDepth > opaqueDepth, 1.0, translucentDepth);\n out_FragColor = czm_packDepth(translucentDepth);\n}\n"]}),o={u_opaqueDepthTexture:function(){return e._opaqueDepthStencilTexture},u_translucentDepthTexture:function(){return e._translucentDepthStencilTexture}},e._packDepthCommand=t.createViewportQuadCommand(r,{uniformMap:o,owner:e})),!(0,y.Z)(e._compositeCommand)){r=new eD.Z({sources:[h1]}),o={colorTexture:function(){return e._textureToComposite}},e._compositeCommand=t.createViewportQuadCommand(r,{uniformMap:o,owner:e});let i=e._compositeCommand,n=i.shaderProgram,a=t.shaderCache.createDerivedShaderProgram(n,"pick",{vertexShaderSource:n.vertexShaderSource,fragmentShaderSource:new eD.Z({sources:r.sources,defines:["PICK"]}),attributeLocations:n._attributeLocations}),s=e3.Z.shallowClone(i);s.shaderProgram=a,i.derivedCommands.pick=s}(0,y.Z)(e._copyCommand)||(r=new eD.Z({sources:[h1]}),o={colorTexture:function(){return e._drawClassificationFBO.getColorTexture()}},e._copyCommand=t.createViewportQuadCommand(r,{uniformMap:o,owner:e})),(0,y.Z)(e._accumulateCommand)||(r=new eD.Z({sources:[h1]}),o={colorTexture:function(){return e._drawClassificationFBO.getColorTexture()}},e._accumulateCommand=t.createViewportQuadCommand(r,{uniformMap:o,owner:e})),e._viewport.width=a,e._viewport.height=s;let l=!oN.Z.equals(e._viewport,i.viewport),c=l!==e._useScissorTest;e._useScissorTest=l,oN.Z.equals(e._scissorRectangle,i.viewport)||(e._scissorRectangle=oN.Z.clone(i.viewport,e._scissorRectangle),c=!0),(0,y.Z)(e._rsDepth)&&oN.Z.equals(e._viewport,e._rsDepth.viewport)&&!c||(e._rsDepth=e5.Z.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle}})),(0,y.Z)(e._packDepthCommand)&&(e._packDepthCommand.renderState=e._rsDepth),(0,y.Z)(e._rsAccumulate)&&oN.Z.equals(e._viewport,e._rsAccumulate.viewport)&&!c||(e._rsAccumulate=e5.Z.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle},stencilTest:{enabled:!0,frontFunction:uj.Z.EQUAL,reference:uG.Z.CESIUM_3D_TILE_MASK}})),(0,y.Z)(e._accumulateCommand)&&(e._accumulateCommand.renderState=e._rsAccumulate),(0,y.Z)(e._rsComp)&&oN.Z.equals(e._viewport,e._rsComp.viewport)&&!c||(e._rsComp=e5.Z.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle},blending:e8.Z.ALPHA_BLEND})),(0,y.Z)(e._compositeCommand)&&(e._compositeCommand.renderState=e._rsComp,e._compositeCommand.derivedCommands.pick.renderState=e._rsComp)}(this,c,i,r),i.framebuffer=this._drawClassificationFBO.framebuffer,this._clearDepthStencilCommand.execute(c,i),a=0;a<s;++a)o=n[a],(o=l?o.derivedCommands.logDepth.command:o).depthForTranslucentClassification&&t(o.derivedCommands.depth.depthOnlyCommand,e,c,i);this._frustumsDrawn+=this._hasTranslucentDepth?1:0,this._hasTranslucentDepth&&(i.framebuffer=this._packFBO.framebuffer,this._packDepthCommand.execute(c,i)),i.framebuffer=u}},h2.prototype.executeClassificationCommands=function(e,t,i,n){if(!this._hasTranslucentDepth)return;let r=e.context,o=r.uniformState,a=i.framebuffer;2===this._frustumsDrawn&&(i.framebuffer=this._accumulationFBO.framebuffer,this._copyCommand.execute(r,i)),i.framebuffer=this._drawClassificationFBO.framebuffer,this._frustumsDrawn>1&&this._clearColorCommand.execute(r,i),o.updatePass(e4.Z.CESIUM_3D_TILE_CLASSIFICATION);let s=o.globeDepthTexture;o.globeDepthTexture=this._packFBO.getColorTexture();let l=n.commands[e4.Z.CESIUM_3D_TILE_CLASSIFICATION],c=n.indices[e4.Z.CESIUM_3D_TILE_CLASSIFICATION];for(let n=0;n<c;++n)t(l[n],e,r,i);o.globeDepthTexture=s,i.framebuffer=a,1!==this._frustumsDrawn&&(i.framebuffer=this._accumulationFBO.framebuffer,this._accumulateCommand.execute(r,i),i.framebuffer=a)},h2.prototype.execute=function(e,t){this._hasTranslucentDepth&&(1===this._frustumsDrawn?this._textureToComposite=this._drawClassificationFBO.getColorTexture():this._textureToComposite=this._accumulationFBO.getColorTexture(),(e.frameState.passes.pick?this._compositeCommand.derivedCommands.pick:this._compositeCommand).execute(e.context,t),function(e,t,i){if(!e._hasTranslucentDepth)return;let n=i.framebuffer;i.framebuffer=e._drawClassificationFBO.framebuffer,e._clearColorCommand.execute(t._context,i),i.framebuffer=n,e._frustumsDrawn>1&&(i.framebuffer=e._accumulationFBO.framebuffer,e._clearColorCommand.execute(t._context,i)),e._hasTranslucentDepth=!1,e._frustumsDrawn=0}(this,e,t))},h2.prototype.isSupported=function(){return this._supported},h2.prototype.isDestroyed=function(){return!1},h2.prototype.destroy=function(){return h3(this),h4(this),(0,y.Z)(this._compositeCommand)&&(this._compositeCommand.shaderProgram=this._compositeCommand.shaderProgram&&this._compositeCommand.shaderProgram.destroy()),(0,y.Z)(this._packDepthCommand)&&(this._packDepthCommand.shaderProgram=this._packDepthCommand.shaderProgram&&this._packDepthCommand.shaderProgram.destroy()),(0,b.Z)(this)};let h8=new _.Z,h6=new _.Z;h9.prototype.checkForCameraUpdates=function(e){let t=this.camera,i=this._cameraClone;return!function(e,t,i){var n,r;let o=1/Math.max(1,(n=e.position,r=t.position,Math.max(Math.max(Math.max(Math.abs(n.x),Math.abs(r.x)),Math.max(Math.abs(n.y),Math.abs(r.y))),Math.max(Math.abs(n.z),Math.abs(r.z)))));return _.Z.multiplyByScalar(e.position,o,h8),_.Z.multiplyByScalar(t.position,o,h6),_.Z.equalsEpsilon(h8,h6,i)&&_.Z.equalsEpsilon(e.direction,t.direction,i)&&_.Z.equalsEpsilon(e.up,t.up,i)&&_.Z.equalsEpsilon(e.right,t.right,i)&&z.Z.equalsEpsilon(e.transform,t.transform,i)&&e.frustum.equalsEpsilon(t.frustum,i)}(t,i,F.Z.EPSILON15)?(this._cameraStartFired||(t.moveStart.raiseEvent(),this._cameraStartFired=!0),this._cameraMovedTime=(0,rl.Z)(),sf.clone(t,i),!0):(this._cameraStartFired&&(0,rl.Z)()-this._cameraMovedTime>e.cameraEventWaitTime&&(t.moveEnd.raiseEvent(),this._cameraStartFired=!1),!1)};let h7=new oM.Z,de=new he.Z;h9.prototype.createPotentiallyVisibleSet=function(e){let t,i;let n=e.frameState,r=n.camera,o=r.directionWC,a=r.positionWC,s=e._computeCommandList,l=e._overlayCommandList,c=n.commandList;e.debugShowFrustums&&(this.debugFrustumStatistics={totalCommands:0,commandsInFrustums:{}});let u=this.frustumCommandsList,h=u.length,d=e4.Z.NUMBER_OF_PASSES;for(let e=0;e<h;++e)for(let t=0;t<d;++t)u[e].indices[t]=0;s.length=0,l.length=0;let f=this._commandExtents,p=f.length,m=0,_=+Number.MAX_VALUE,g=-Number.MAX_VALUE,Z=n.shadowState.shadowsEnabled,b=+Number.MAX_VALUE,v=-Number.MAX_VALUE,T=Number.MAX_VALUE,E=n.mode===eB.Z.SCENE3D?n.occluder:void 0,x=n.cullingVolume,w=h7.planes;for(let e=0;e<5;++e)w[e]=x.planes[e];x=h7;let S=c.length;for(let t=0;t<S;++t){let i=c[t],n=i.pass;if(n===e4.Z.COMPUTE)s.push(i);else if(n===e4.Z.OVERLAY)l.push(i);else{let t,s;let l=i.boundingVolume;if((0,y.Z)(l)){if(!e.isVisible(i,x,E))continue;let r=l.computePlaneDistances(a,o,de);if(t=r.start,s=r.stop,_=Math.min(_,t),g=Math.max(g,s),Z&&i.receiveShadows&&t<hT.MAXIMUM_DISTANCE&&!(n===e4.Z.GLOBE&&t<-100&&s>100)){let e=s-t;n!==e4.Z.GLOBE&&t<100&&(T=Math.min(T,e)),b=Math.min(b,t),v=Math.max(v,s)}}else i instanceof ae.Z?(t=r.frustum.near,s=r.frustum.far):(t=r.frustum.near,s=r.frustum.far,_=Math.min(_,t),g=Math.max(g,s));let c=f[m];(0,y.Z)(c)||(c=f[m]=new h5),c.command=i,c.near=t,c.far=s,m++}}for(Z&&(b=Math.min(Math.max(b,r.frustum.near),r.frustum.far),v=Math.max(Math.min(v,r.frustum.far),b)),Z&&(n.shadowState.nearPlane=b,n.shadowState.farPlane=v,n.shadowState.closestObjectSize=T),function(e,t,i,n){let r;let o=t.frameState,a=o.camera,s=o.useLogDepth?t.logarithmicDepthFarToNearRatio:t.farToNearRatio,l=t.mode===eB.Z.SCENE2D,c=t.nearToFarDistance2D;n*=1+F.Z.EPSILON2,i=Math.min(Math.max(i,a.frustum.near),a.frustum.far),n=Math.max(Math.min(n,a.frustum.far),i),l?(i=Math.min(i,n=Math.min(n,a.position.z+t.nearToFarDistance2D)),r=Math.ceil(Math.max(1,n-i)/t.nearToFarDistance2D)):r=Math.ceil(Math.log(n/i)/Math.log(s));let u=e.frustumCommandsList;u.length=r;for(let e=0;e<r;++e){let t,r;l?(t=Math.min(n-c,i+e*c),r=Math.min(n,t+c)):(t=Math.max(i,Math.pow(s,e)*i),r=Math.min(n,s*t));let o=u[e];(0,y.Z)(o)?(o.near=t,o.far=r):o=u[e]=new ht(t,r)}}(this,e,_,g),t=0;t<m;t++)!function(e,t,i,n,r){t.debugShowFrustums&&(i.debugOverlappingFrustums=0);let o=e.frustumCommandsList,a=o.length;for(let e=0;e<a;++e){let a=o[e],s=a.near;if(n>a.far)continue;if(r<s)break;let l=i.pass,c=a.indices[l]++;if(a.commands[l][c]=i,t.debugShowFrustums&&(i.debugOverlappingFrustums|=1<<e),i.executeInClosestFrustum)break}if(t.debugShowFrustums){let t=e.debugFrustumStatistics.commandsInFrustums;t[i.debugOverlappingFrustums]=(0,y.Z)(t[i.debugOverlappingFrustums])?t[i.debugOverlappingFrustums]+1:1,++e.debugFrustumStatistics.totalCommands}t.updateDerivedCommands(i)}(this,e,(i=f[t]).command,i.near,i.far);if(m<p)for(t=m;t<p&&(i=f[t],(0,y.Z)(i.command));t++)i.command=void 0;let C=u.length,A=n.frustumSplits;A.length=C+1;for(let e=0;e<C;++e)A[e]=u[e].near,e===C-1&&(A[e+1]=u[e].far)},h9.prototype.destroy=function(){let e;this.pickFramebuffer=this.pickFramebuffer&&this.pickFramebuffer.destroy(),this.pickDepthFramebuffer=this.pickDepthFramebuffer&&this.pickDepthFramebuffer.destroy(),this.sceneFramebuffer=this.sceneFramebuffer&&this.sceneFramebuffer.destroy(),this.globeDepth=this.globeDepth&&this.globeDepth.destroy(),this.oit=this.oit&&this.oit.destroy(),this.translucentTileClassification=this.translucentTileClassification&&this.translucentTileClassification.destroy(),this.globeTranslucencyFramebuffer=this.globeTranslucencyFramebuffer&&this.globeTranslucencyFramebuffer.destroy();let t=this.pickDepths,i=t.length;for(e=0;e<i;++e)t[e].destroy()};let dt=new l8({pass:l9.Z.MOST_DETAILED_PRELOAD}),di=new l8({pass:l9.Z.MOST_DETAILED_PICK}),dn=new l8({pass:l9.Z.PICK});function dr(e){this._mostDetailedRayPicks=[],this.pickRenderStateCache={},this._pickPositionCache={},this._pickPositionCacheDirty=!1;let t=new oN.Z(0,0,1,1),i=new sf(e);i.frustum=new e$.Z({width:.1,aspectRatio:1,near:.1}),this._pickOffscreenView=new h9(e,i,t)}dr.prototype.update=function(){this._pickPositionCacheDirty=!0},dr.prototype.getPickDepth=function(e,t){let i=e.view.pickDepths,n=i[t];return(0,y.Z)(n)||(n=new u5,i[t]=n),n};let da=new rc.Z,ds=new _.Z,dl=new _.Z,dc=new L.Z,du=new z.Z,dh=new o1,dd=new L.Z;function df(e,t,i,n,r){let o=e.camera.frustum;return o instanceof e$.Z||o instanceof rc.Z?function(e,t,i,n,r){let o=e.camera,a=o.frustum,s=a.offCenterFrustum;(0,y.Z)(s)&&(a=s);let l=2*(t.x-r.x)/r.width-1;l*=(a.right-a.left)*.5;let c=2*(r.height-t.y-r.y)/r.height-1;c*=(a.top-a.bottom)*.5;let u=z.Z.clone(o.transform,du);o._setTransform(z.Z.IDENTITY);let h=_.Z.clone(o.position,ds);_.Z.multiplyByScalar(o.right,l,dl),_.Z.add(dl,h,h),_.Z.multiplyByScalar(o.up,c,dl),_.Z.add(dl,h,h),o._setTransform(u),e.mode===eB.Z.SCENE2D&&_.Z.fromElements(h.z,h.x,h.y,h);let d=a.getPixelDimensions(r.width,r.height,1,1,dc);return da.right=.5*d.x,da.left=-da.right,da.top=.5*d.y,da.bottom=-da.top,da.near=a.near,da.far=a.far,da.computeCullingVolume(h,o.directionWC,o.upWC)}(e,t,0,0,r):function(e,t,i,n,r){let o=e.camera,a=o.frustum,s=a.near,l=Math.tan(.5*a.fovy),c=a.aspectRatio*l,u=2*(t.x-r.x)/r.width-1,h=2*(r.height-t.y-r.y)/r.height-1,d=u*s*c,f=h*s*l,p=a.getPixelDimensions(r.width,r.height,1,1,dd),m=p.x*i*.5,_=p.y*n*.5;return dh.top=f+_,dh.bottom=f-_,dh.right=d+m,dh.left=d-m,dh.near=s,dh.far=a.far,dh.computeCullingVolume(o.positionWC,o.directionWC,o.upWC)}(e,t,i,n,r)}let dp=3,dm=3,d_=new oN.Z(0,0,dp,dm),dg=new L.Z,dZ=new A.Z(0,0,0,0);dr.prototype.pick=function(e,t,i,n){D.Z.defined("windowPosition",t),dp=(0,Z.Z)(i,3),dm=(0,Z.Z)(n,dp);let{context:r,frameState:o,defaultView:a}=e,{viewport:s,pickFramebuffer:l}=a;e.view=a,s.x=0,s.y=0,s.width=r.drawingBufferWidth,s.height=r.drawingBufferHeight;let c=a.passState;c.viewport=oN.Z.clone(s,c.viewport);let u=u7.Z.transformWindowToDrawingBuffer(e,t,dg);e.jobScheduler.disableThisFrame(),e.updateFrameState(),o.cullingVolume=df(e,u,dp,dm,s),o.invertClassification=!1,o.passes.pick=!0,o.tilesetPassState=dn,r.uniformState.update(o),e.updateEnvironment(),d_.x=u.x-(dp-1)*.5,d_.y=e.drawingBufferHeight-u.y-(dm-1)*.5,d_.width=dp,d_.height=dm,c=l.begin(d_,s),e.updateAndExecuteCommands(c,dZ),e.resolveFramebuffers(c);let h=l.end(d_);return r.endFrame(),h},dr.prototype.pickVoxelCoordinate=function(e,t,i,n){D.Z.defined("windowPosition",t),dp=(0,Z.Z)(i,3),dm=(0,Z.Z)(n,dp);let{context:r,frameState:o,defaultView:a}=e,{viewport:s,pickFramebuffer:l}=a;e.view=a,s.x=0,s.y=0,s.width=r.drawingBufferWidth,s.height=r.drawingBufferHeight;let c=a.passState;c.viewport=oN.Z.clone(s,c.viewport);let u=u7.Z.transformWindowToDrawingBuffer(e,t,dg);e.jobScheduler.disableThisFrame(),e.updateFrameState(),o.cullingVolume=df(e,u,dp,dm,s),o.invertClassification=!1,o.passes.pickVoxel=!0,o.tilesetPassState=dn,r.uniformState.update(o),e.updateEnvironment(),d_.x=u.x-(dp-1)*.5,d_.y=e.drawingBufferHeight-u.y-(dm-1)*.5,d_.width=dp,d_.height=dm,c=l.begin(d_,s),e.updateAndExecuteCommands(c,dZ),e.resolveFramebuffers(c);let h=l.readVoxelInfo(d_);return r.endFrame(),h};let dy=new o8,db=new o1,dv=new e$.Z,dT=new rc.Z;dr.prototype.pickPositionWorldCoordinates=function(e,t,i){let n;if(!e.useDepthPicking)return;if(D.Z.defined("windowPosition",t),!e.context.depthTexture)throw new v.Z("Picking from the depth buffer is not supported. Check pickPositionSupported.");let r=t.toString();if(this._pickPositionCacheDirty)this._pickPositionCache={},this._pickPositionCacheDirty=!1;else if(this._pickPositionCache.hasOwnProperty(r))return _.Z.clone(this._pickPositionCache[r],i);let{context:o,frameState:a,camera:s,defaultView:l}=e,{uniformState:c}=o;e.view=l;let u=u7.Z.transformWindowToDrawingBuffer(e,t,dg);e.pickTranslucentDepth?function(e,t){let{defaultView:i,context:n,frameState:r,environmentState:o}=e,{viewport:a,pickDepthFramebuffer:s}=i;e.view=i,a.x=0,a.y=0,a.width=n.drawingBufferWidth,a.height=n.drawingBufferHeight;let l=i.passState;l.viewport=oN.Z.clone(a,l.viewport),e.clearPasses(r.passes),r.passes.pick=!0,r.passes.depth=!0,r.cullingVolume=df(e,t,1,1,a),r.tilesetPassState=dn,e.updateEnvironment(),o.renderTranslucentDepthForPick=!0,l=s.update(n,t,a),e.updateAndExecuteCommands(l,dZ),e.resolveFramebuffers(l),n.endFrame()}(e,u):(e.updateFrameState(),c.update(a),e.updateEnvironment()),u.y=e.drawingBufferHeight-u.y,n=(0,y.Z)(s.frustum.fov)?s.frustum.clone(dy):(0,y.Z)(s.frustum.infiniteProjectionMatrix)?s.frustum.clone(db):(0,y.Z)(s.frustum.width)?s.frustum.clone(dv):s.frustum.clone(dT);let h=l.frustumCommandsList,d=h.length;for(let t=0;t<d;++t){let l=this.getPickDepth(e,t).getDepth(o,u.x,u.y);if((0,y.Z)(l)&&l>0&&l<1){let o;let d=h[t];return e.mode===eB.Z.SCENE2D?(o=s.position.z,s.position.z=o-d.near+1,n.far=Math.max(1,d.far-d.near),n.near=1,c.update(a)):(n.near=d.near*(0!==t?e.opaqueFrustumNearOffset:1),n.far=d.far),c.updateFrustum(n),i=u7.Z.drawingBufferToWgs84Coordinates(e,u,l,i),e.mode===eB.Z.SCENE2D&&(s.position.z=o,c.update(a)),this._pickPositionCache[r]=_.Z.clone(i),i}}this._pickPositionCache[r]=void 0};let dE=new C.Z;function dx(e,t){let i,n;let r=[],o=[],a=[],s=[];(0,y.Z)(e)||(e=Number.MAX_VALUE);let l=t();for(;(0,y.Z)(l);){let i=l.object,c=l.position,u=l.exclude;if((0,y.Z)(c)&&!(0,y.Z)(i)){r.push(l);break}if(!(0,y.Z)(i)||!(0,y.Z)(i.primitive)||!u&&(r.push(l),0>=--e))break;let h=i.primitive,d=!1;"function"==typeof h.getGeometryInstanceAttributes&&(0,y.Z)(i.id)&&(n=h.getGeometryInstanceAttributes(i.id),(0,y.Z)(n)&&(0,y.Z)(n.show)&&(d=!0,n.show=u3.Z.toValue(!1,n.show),a.push(n))),i instanceof u4.Z&&(d=!0,i.show=!1,s.push(i)),d||(h.show=!1,o.push(h)),l=t()}for(i=0;i<o.length;++i)o[i].show=!0;for(i=0;i<a.length;++i)(n=a[i]).show=u3.Z.toValue(!0,n.show);for(i=0;i<s.length;++i)s[i].show=!0;return r}dr.prototype.pickPosition=function(e,t,i){if(i=this.pickPositionWorldCoordinates(e,t,i),(0,y.Z)(i)&&e.mode!==eB.Z.SCENE3D){_.Z.fromElements(i.y,i.z,i.x,i);let t=e.mapProjection,n=t.ellipsoid,r=t.unproject(i,dE);n.cartographicToCartesian(r,i)}return i},dr.prototype.drillPick=function(e,t,i,n,r){let o=this;return dx(i,function(){let i=o.pick(e,t,n,r);if((0,y.Z)(i))return{object:i,position:void 0,exclude:!1}}).map(function(e){return e.object})};let dw=new _.Z,dS=new _.Z;function dC(e,t,i){this.ray=e,this.width=t,this.tilesets=i,this.ready=!1;let n=this;this.promise=new Promise(e=>{n._completePick=()=>{e()}})}function dA(e,t,i,n){let r=t.direction,o=_.Z.mostOrthogonalAxis(r,dw),a=_.Z.cross(r,o,dw),s=_.Z.cross(r,a,dS);return n.position=t.origin,n.direction=r,n.up=s,n.right=a,n.frustum.width=(0,Z.Z)(i,.1),n.frustum.computeCullingVolume(n.positionWC,n.directionWC,n.upWC)}function dI(e,t,i,n,r,o){let a=[];if(!function e(t,i,n){for(let r=0;r<t.length;++r){let o=t.get(r);o.show&&((0,y.Z)(o.isCesium3DTileset)?(0,y.Z)(i)&&-1!==i.indexOf(o)||n.push(o):o instanceof u6.Z&&e(o,i,n))}}(t.primitives,n,a),0===a.length)return Promise.resolve(o());let s=new dC(i,r,a);return e._mostDetailedRayPicks.push(s),s.promise.then(function(){return o()})}function dO(e,t,i,n,r,o,a,s){return dx(n,function(){return function(e,t,i,n,r,o,a){let s;let{context:l,frameState:c}=t,u=l.uniformState,h=e._pickOffscreenView;t.view=h,dA(e,i,r,h.camera),d_=oN.Z.clone(h.viewport,d_);let d=h.pickFramebuffer.begin(d_,h.viewport);t.jobScheduler.disableThisFrame(),t.updateFrameState(),c.invertClassification=!1,c.passes.pick=!0,c.passes.offscreen=!0,a?c.tilesetPassState=di:c.tilesetPassState=dn,u.update(c),t.updateEnvironment(),t.updateAndExecuteCommands(d,dZ),t.resolveFramebuffers(d);let f=h.pickFramebuffer.end(d_);if(t.context.depthTexture){let n=h.frustumCommandsList.length;for(let r=0;r<n;++r){let n=e.getPickDepth(t,r).getDepth(l,0,0);if((0,y.Z)(n)&&n>0&&n<1){let e=h.frustumCommandsList[r],o=e.near*(0!==r?t.opaqueFrustumNearOffset:1),a=o+n*(e.far-o);s=eI.Z.getPoint(i,a);break}}}if(t.view=t.defaultView,l.endFrame(),(0,y.Z)(f)||(0,y.Z)(s))return{object:f,position:s,exclude:!(0,y.Z)(s)&&o||!!((0,y.Z)(f)&&(0,y.Z)(n))&&0!==n.length&&(n.indexOf(f)>-1||n.indexOf(f.primitive)>-1||n.indexOf(f.id)>-1)}}(e,t,i,r,o,a,s)})}function dD(e,t,i,n,r,o,a){let s=dO(e,t,i,1,n,r,o,a);if(s.length>0)return s[0]}function dP(e,t){return new Promise((i,n)=>{t.then(function(t){let n=e.postRender.addEventListener(function(){n(),i(t)});e.requestRender()}).catch(function(e){n(e)})})}dr.prototype.updateMostDetailedRayPicks=function(e){let t=this._mostDetailedRayPicks;for(let i=0;i<t.length;++i)(function(e,t,i){let n=t.frameState,{ray:r,width:o,tilesets:a}=i,s=e._pickOffscreenView.camera,l=dA(e,r,o,s);dt.camera=s,dt.cullingVolume=l;let c=!0,u=a.length;for(let e=0;e<u;++e){let i=a[e];i.show&&t.primitives.contains(i)&&(i.updateForPass(n,dt),c=c&&dt.ready)}return c&&i._completePick(),c})(this,e,t[i])&&t.splice(i--,1)},dr.prototype.pickFromRay=function(e,t,i,n){if(D.Z.defined("ray",t),e.mode!==eB.Z.SCENE3D)throw new v.Z("Ray intersections are only supported in 3D mode.");return dD(this,e,t,i,n,!1,!1)},dr.prototype.drillPickFromRay=function(e,t,i,n,r){if(D.Z.defined("ray",t),e.mode!==eB.Z.SCENE3D)throw new v.Z("Ray intersections are only supported in 3D mode.");return dO(this,e,t,i,n,r,!1,!1)},dr.prototype.pickFromRayMostDetailed=function(e,t,i,n){if(D.Z.defined("ray",t),e.mode!==eB.Z.SCENE3D)throw new v.Z("Ray intersections are only supported in 3D mode.");let r=this;return t=eI.Z.clone(t),i=(0,y.Z)(i)?i.slice():i,dP(e,dI(r,e,t,i,n,function(){return dD(r,e,t,i,n,!1,!0)}))},dr.prototype.drillPickFromRayMostDetailed=function(e,t,i,n,r){if(D.Z.defined("ray",t),e.mode!==eB.Z.SCENE3D)throw new v.Z("Ray intersections are only supported in 3D mode.");let o=this;return t=eI.Z.clone(t),n=(0,y.Z)(n)?n.slice():n,dP(e,dI(o,e,t,n,r,function(){return dO(o,e,t,i,n,r,!1,!0)}))};let dR=new _.Z,dN=new _.Z,dL=new eI.Z,dM=new C.Z;function dF(e,t){let i=e.globe,n=(0,y.Z)(i)?i.ellipsoid:e.mapProjection.ellipsoid,r=u2.Z._defaultMaxTerrainHeight,o=n.geodeticSurfaceNormalCartographic(t,dN),a=C.Z.toCartesian(t,n,dR);dL.origin=a,dL.direction=o;let s=new eI.Z;return eI.Z.getPoint(dL,r,s.origin),_.Z.negate(o,s.direction),s}function dz(e,t){let i=e.globe,n=(0,y.Z)(i)?i.ellipsoid:e.mapProjection.ellipsoid;return dF(e,C.Z.fromCartesian(t,n,dM))}function dB(e,t){let i=e.globe,n=(0,y.Z)(i)?i.ellipsoid:e.mapProjection.ellipsoid;return C.Z.fromCartesian(t,n,dM).height}dr.prototype.sampleHeight=function(e,t,i,n){if(D.Z.defined("position",t),e.mode!==eB.Z.SCENE3D)throw new v.Z("sampleHeight is only supported in 3D mode.");if(!e.sampleHeightSupported)throw new v.Z("sampleHeight requires depth texture support. Check sampleHeightSupported.");let r=dF(e,t),o=dD(this,e,r,i,n,!0,!1);if((0,y.Z)(o))return dB(e,o.position)},dr.prototype.clampToHeight=function(e,t,i,n,r){if(D.Z.defined("cartesian",t),e.mode!==eB.Z.SCENE3D)throw new v.Z("clampToHeight is only supported in 3D mode.");if(!e.clampToHeightSupported)throw new v.Z("clampToHeight requires depth texture support. Check clampToHeightSupported.");let o=dz(e,t),a=dD(this,e,o,i,n,!0,!1);if((0,y.Z)(a))return _.Z.clone(a.position,r)},dr.prototype.sampleHeightMostDetailed=function(e,t,i,n){if(D.Z.defined("positions",t),e.mode!==eB.Z.SCENE3D)throw new v.Z("sampleHeightMostDetailed is only supported in 3D mode.");if(!e.sampleHeightSupported)throw new v.Z("sampleHeightMostDetailed requires depth texture support. Check sampleHeightSupported.");i=(0,y.Z)(i)?i.slice():i;let r=t.length,o=Array(r);for(let a=0;a<r;++a)o[a]=function(e,t,i,n,r){let o=dF(t,i);return dI(e,t,o,n,r,function(){let i=dD(e,t,o,n,r,!0,!0);if((0,y.Z)(i))return dB(t,i.position)})}(this,e,t[a],i,n);return dP(e,Promise.all(o).then(function(e){let i=e.length;for(let n=0;n<i;++n)t[n].height=e[n];return t}))},dr.prototype.clampToHeightMostDetailed=function(e,t,i,n){if(D.Z.defined("cartesians",t),e.mode!==eB.Z.SCENE3D)throw new v.Z("clampToHeightMostDetailed is only supported in 3D mode.");if(!e.clampToHeightSupported)throw new v.Z("clampToHeightMostDetailed requires depth texture support. Check clampToHeightSupported.");i=(0,y.Z)(i)?i.slice():i;let r=t.length,o=Array(r);for(let a=0;a<r;++a)o[a]=function(e,t,i,n,r,o){let a=dz(t,i);return dI(e,t,a,n,r,function(){let i=dD(e,t,a,n,r,!0,!0);if((0,y.Z)(i))return _.Z.clone(i.position,o)})}(this,e,t[a],i,n,t[a]);return dP(e,Promise.all(o).then(function(e){let i=e.length;for(let n=0;n<i;++n)t[n]=e[n];return t}))},dr.prototype.destroy=function(){this._pickOffscreenView=this._pickOffscreenView&&this._pickOffscreenView.destroy()};var dU="#define SAMPLES 8\n\nuniform float delta;\nuniform float sigma;\nuniform float direction; // 0.0 for x direction, 1.0 for y direction\n\nuniform sampler2D colorTexture;\n\n#ifdef USE_STEP_SIZE\nuniform float stepSize;\n#else\nuniform vec2 step;\n#endif\n\nin vec2 v_textureCoordinates;\n\n// Incremental Computation of the Gaussian:\n// https://developer.nvidia.com/gpugems/GPUGems3/gpugems3_ch40.html\n\nvoid main()\n{\n vec2 st = v_textureCoordinates;\n vec2 dir = vec2(1.0 - direction, direction);\n\n#ifdef USE_STEP_SIZE\n vec2 step = vec2(stepSize * (czm_pixelRatio / czm_viewport.zw));\n#else\n vec2 step = step;\n#endif\n\n vec3 g;\n g.x = 1.0 / (sqrt(czm_twoPi) * sigma);\n g.y = exp((-0.5 * delta * delta) / (sigma * sigma));\n g.z = g.y * g.y;\n\n vec4 result = texture(colorTexture, st) * g.x;\n for (int i = 1; i < SAMPLES; ++i)\n {\n g.xy *= g.yz;\n\n vec2 offset = float(i) * dir * step;\n result += texture(colorTexture, st - offset) * g.x;\n result += texture(colorTexture, st + offset) * g.x;\n }\n\n out_FragColor = result;\n}\n";function dk(){this._uniformMap=void 0,this._command=void 0,this._colorTexture=void 0,this._depthTexture=void 0,this._ready=!1,this._name="czm_autoexposure",this._logDepthChanged=void 0,this._useLogDepth=void 0,this._framebuffers=void 0,this._previousLuminance=new uU.Z,this._commands=void 0,this._clearCommand=void 0,this._minMaxLuminance=new L.Z,this.enabled=!0,this._enabled=!0,this.minimumLuminance=.1,this.maximumLuminance=10}function dV(e){let t=e._framebuffers;if(!(0,y.Z)(t))return;let i=t.length;for(let e=0;e<i;++e)t[e].destroy();e._framebuffers=void 0,e._previousLuminance.destroy(),e._previousLuminance=void 0}function dH(e){let t=e._commands;if(!(0,y.Z)(t))return;let i=t.length;for(let e=0;e<i;++e)t[e].shaderProgram.destroy();e._commands=void 0}function dG(e){let t=(e=(0,Z.Z)(e,Z.Z.EMPTY_OBJECT)).fragmentShader,i=(0,Z.Z)(e.textureScale,1),n=(0,Z.Z)(e.pixelFormat,te.Z.RGBA);if(D.Z.typeOf.string("options.fragmentShader",t),D.Z.typeOf.number.greaterThan("options.textureScale",i,0),D.Z.typeOf.number.lessThanOrEquals("options.textureScale",i,1),!te.Z.isColorFormat(n))throw new v.Z("options.pixelFormat must be a color format.");this._fragmentShader=t,this._uniforms=e.uniforms,this._textureScale=i,this._forcePowerOfTwo=(0,Z.Z)(e.forcePowerOfTwo,!1),this._sampleMode=(0,Z.Z)(e.sampleMode,0),this._pixelFormat=n,this._pixelDatatype=(0,Z.Z)(e.pixelDatatype,to.Z.UNSIGNED_BYTE),this._clearColor=(0,Z.Z)(e.clearColor,A.Z.BLACK),this._uniformMap=void 0,this._command=void 0,this._colorTexture=void 0,this._depthTexture=void 0,this._idTexture=void 0,this._actualUniforms={},this._dirtyUniforms=[],this._texturesToRelease=[],this._texturesToCreate=[],this._texturePromise=void 0;let r=new ah;r.scissorTest={enabled:!0,rectangle:(0,y.Z)(e.scissorRectangle)?oN.Z.clone(e.scissorRectangle):new oN.Z},this._passState=r,this._ready=!1;let o=e.name;(0,y.Z)(o)||(o=(0,oL.Z)()),this._name=o,this._logDepthChanged=void 0,this._useLogDepth=void 0,this._selectedIdTexture=void 0,this._selected=void 0,this._selectedShadow=void 0,this._parentSelected=void 0,this._parentSelectedShadow=void 0,this._combinedSelected=void 0,this._combinedSelectedShadow=void 0,this._selectedLength=0,this._parentSelectedLength=0,this._selectedDirty=!0,this._textureCache=void 0,this._index=void 0,this.enabled=!0,this._enabled=!0}Object.defineProperties(dk.prototype,{ready:{get:function(){return this._ready}},name:{get:function(){return this._name}},outputTexture:{get:function(){let e=this._framebuffers;if((0,y.Z)(e))return e[e.length-1].getColorTexture(0)}}}),dk.prototype.clear=function(e){let t=this._framebuffers;if(!(0,y.Z)(t))return;let i=this._clearCommand;(0,y.Z)(i)||(i=this._clearCommand=new ae.Z({color:new A.Z(0,0,0,0),framebuffer:void 0}));let n=t.length;for(let r=0;r<n;++r)t[r].clear(e,i)},dk.prototype.update=function(e){let t=e.drawingBufferWidth,i=e.drawingBufferHeight;t===this._width&&i===this._height||(this._width=t,this._height=i,function(e,t){dV(e);let i=e._width,n=e._height,r=t.halfFloatingPointTexture?to.Z.HALF_FLOAT:to.Z.FLOAT,o=Math.ceil(Math.log(Math.max(i,n))/Math.log(3)),a=Array(o);for(let e=0;e<o;++e)i=Math.max(Math.ceil(i/3),1),n=Math.max(Math.ceil(n/3),1),a[e]=new uU.Z,a[e].update(t,i,n,1,r);let s=a[o-1].getColorTexture(0);e._previousLuminance.update(t,s.width,s.height,1,r),e._framebuffers=a}(this,e),function(e,t){dH(e);let i=e._framebuffers,n=i.length,r=Array(n);for(let o=0;o<n;++o)r[o]=t.createViewportQuadCommand(function(e,t){let i="uniform sampler2D colorTexture; \nin vec2 v_textureCoordinates; \nfloat sampleTexture(vec2 offset) { \n";return 0===e?i+=" vec4 color = texture(colorTexture, v_textureCoordinates + offset); \n return czm_luminance(color.rgb); \n":i+=" return texture(colorTexture, v_textureCoordinates + offset).r; \n",i+="}\n\nuniform vec2 colorTextureDimensions; \nuniform vec2 minMaxLuminance; \nuniform sampler2D previousLuminance; \nvoid main() { \n float color = 0.0; \n float xStep = 1.0 / colorTextureDimensions.x; \n float yStep = 1.0 / colorTextureDimensions.y; \n int count = 0; \n for (int i = 0; i < 3; ++i) { \n for (int j = 0; j < 3; ++j) { \n vec2 offset; \n offset.x = -xStep + float(i) * xStep; \n offset.y = -yStep + float(j) * yStep; \n if (offset.x < 0.0 || offset.x > 1.0 || offset.y < 0.0 || offset.y > 1.0) { \n continue; \n } \n color += sampleTexture(offset); \n ++count; \n } \n } \n if (count > 0) { \n color /= float(count); \n } \n",e===t-1&&(i+=" float previous = texture(previousLuminance, vec2(0.5)).r; \n color = clamp(color, minMaxLuminance.x, minMaxLuminance.y); \n color = previous + (color - previous) / (60.0 * 1.5); \n color = clamp(color, minMaxLuminance.x, minMaxLuminance.y); \n"),i+=" out_FragColor = vec4(color); \n} \n"}(o,n),{framebuffer:i[o].framebuffer,uniformMap:function(e,t){let i;if(0===t)i={colorTexture:function(){return e._colorTexture},colorTextureDimensions:function(){return e._colorTexture.dimensions}};else{let n=e._framebuffers[t-1].getColorTexture(0);i={colorTexture:function(){return n},colorTextureDimensions:function(){return n.dimensions}}}return i.minMaxLuminance=function(){return e._minMaxLuminance},i.previousLuminance=function(){return e._previousLuminance.getColorTexture(0)},i}(e,o)});e._commands=r}(this,e),this._ready||(this._ready=!0)),this._minMaxLuminance.x=this.minimumLuminance,this._minMaxLuminance.y=this.maximumLuminance;let n=this._framebuffers,r=n[n.length-1];n[n.length-1]=this._previousLuminance,this._commands[this._commands.length-1].framebuffer=this._previousLuminance.framebuffer,this._previousLuminance=r},dk.prototype.execute=function(e,t){this._colorTexture=t;let i=this._commands;if(!(0,y.Z)(i))return;let n=i.length;for(let t=0;t<n;++t)i[t].execute(e)},dk.prototype.isDestroyed=function(){return!1},dk.prototype.destroy=function(){return dV(this),dH(this),(0,b.Z)(this)},Object.defineProperties(dG.prototype,{ready:{get:function(){return this._ready}},name:{get:function(){return this._name}},fragmentShader:{get:function(){return this._fragmentShader}},uniforms:{get:function(){return this._uniforms}},textureScale:{get:function(){return this._textureScale}},forcePowerOfTwo:{get:function(){return this._forcePowerOfTwo}},sampleMode:{get:function(){return this._sampleMode}},pixelFormat:{get:function(){return this._pixelFormat}},pixelDatatype:{get:function(){return this._pixelDatatype}},clearColor:{get:function(){return this._clearColor}},scissorRectangle:{get:function(){return this._passState.scissorTest.rectangle}},outputTexture:{get:function(){if((0,y.Z)(this._textureCache)){let e=this._textureCache.getFramebuffer(this._name);if((0,y.Z)(e))return e.getColorTexture(0)}}},selected:{get:function(){return this._selected},set:function(e){this._selected=e}},parentSelected:{get:function(){return this._parentSelected},set:function(e){this._parentSelected=e}}});let dj=/uniform\s+sampler2D\s+depthTexture/g;function dW(e){(0,y.Z)(e._command)&&(e._command.shaderProgram=e._command.shaderProgram&&e._command.shaderProgram.destroy(),e._command=void 0),e._selectedIdTexture=e._selectedIdTexture&&e._selectedIdTexture.destroy();let t=e._textureCache;if(!(0,y.Z)(t))return;let i=e._uniforms,n=e._actualUniforms;for(let r in n)n.hasOwnProperty(r)&&n[r]instanceof eP.Z&&((0,y.Z)(t.getStageByName(i[r]))||n[r].destroy(),e._dirtyUniforms.push(r))}function dq(e){e=(0,Z.Z)(e,Z.Z.EMPTY_OBJECT),D.Z.defined("options.stages",e.stages),D.Z.typeOf.number.greaterThan("options.stages.length",e.stages.length,0),this._stages=e.stages,this._inputPreviousStageTexture=(0,Z.Z)(e.inputPreviousStageTexture,!0);let t=e.name;(0,y.Z)(t)||(t=(0,oL.Z)()),this._name=t,this._uniforms=e.uniforms,this._textureCache=void 0,this._index=void 0,this._selected=void 0,this._selectedShadow=void 0,this._parentSelected=void 0,this._parentSelectedShadow=void 0,this._combinedSelected=void 0,this._combinedSelectedShadow=void 0,this._selectedLength=0,this._parentSelectedLength=0,this._selectedDirty=!0}dG.prototype._isSupported=function(e){return!dj.test(this._fragmentShader)||e.depthTexture},dG.prototype.update=function(e,t){let i;if(this.enabled===this._enabled||this.enabled||dW(this),this._enabled=this.enabled,!this._enabled||(this._logDepthChanged=t!==this._useLogDepth,this._useLogDepth=t,this._selectedDirty=function(e){let t=(0,y.Z)(e._selected)?e._selected.length:0,i=(0,y.Z)(e._parentSelected)?e._parentSelected:0,n=e._selected!==e._selectedShadow||t!==e._selectedLength;if(n=n||e._parentSelected!==e._parentSelectedShadow||i!==e._parentSelectedLength,(0,y.Z)(e._selected)&&(0,y.Z)(e._parentSelected)?e._combinedSelected=e._selected.concat(e._parentSelected):(0,y.Z)(e._parentSelected)?e._combinedSelected=e._parentSelected:e._combinedSelected=e._selected,!n&&(0,y.Z)(e._combinedSelected)){if(!(0,y.Z)(e._combinedSelectedShadow))return!0;t=e._combinedSelected.length;for(let i=0;i<t;++i)if(e._combinedSelected[i]!==e._combinedSelectedShadow[i])return!0}return n}(this),this._selectedShadow=this._selected,this._parentSelectedShadow=this._parentSelected,this._combinedSelectedShadow=this._combinedSelected,this._selectedLength=(0,y.Z)(this._selected)?this._selected.length:0,this._parentSelectedLength=(0,y.Z)(this._parentSelected)?this._parentSelected.length:0,function(e,t){let i,n,r;if(!e._selectedDirty)return;e._selectedIdTexture=e._selectedIdTexture&&e._selectedIdTexture.destroy(),e._selectedIdTexture=void 0;let o=e._combinedSelected;if(!(0,y.Z)(o))return;let a=0,s=o.length;for(i=0;i<s;++i)n=o[i],(0,y.Z)(n.pickIds)?a+=n.pickIds.length:(0,y.Z)(n.pickId)&&++a;if(0===s||0===a){let i=new Uint8Array(4);i[0]=255,i[1]=255,i[2]=255,i[3]=255,e._selectedIdTexture=new eP.Z({context:t,pixelFormat:te.Z.RGBA,pixelDatatype:to.Z.UNSIGNED_BYTE,source:{arrayBufferView:i,width:1,height:1},sampler:ta.Z.NEAREST});return}let l=0,c=new Uint8Array(4*a);for(i=0;i<s;++i)if(n=o[i],(0,y.Z)(n.pickIds)){let e=n.pickIds,t=e.length;for(let i=0;i<t;++i)r=e[i].color,c[l]=A.Z.floatToByte(r.red),c[l+1]=A.Z.floatToByte(r.green),c[l+2]=A.Z.floatToByte(r.blue),c[l+3]=A.Z.floatToByte(r.alpha),l+=4}else(0,y.Z)(n.pickId)&&(r=n.pickId.color,c[l]=A.Z.floatToByte(r.red),c[l+1]=A.Z.floatToByte(r.green),c[l+2]=A.Z.floatToByte(r.blue),c[l+3]=A.Z.floatToByte(r.alpha),l+=4);e._selectedIdTexture=new eP.Z({context:t,pixelFormat:te.Z.RGBA,pixelDatatype:to.Z.UNSIGNED_BYTE,source:{arrayBufferView:c,width:a,height:1},sampler:ta.Z.NEAREST})}(this,e),function(e){if((0,y.Z)(e._uniformMap))return;let t={},i={},n=e._uniforms,r=e._actualUniforms;for(let o in n)if(n.hasOwnProperty(o)){"function"!=typeof n[o]?(t[o]=function(e,t){return function(){let i=e._actualUniforms[t];return"function"==typeof i?i():i}}(e,o),i[o]=function(e,t,i){let n=t[i];return("string"==typeof n||n instanceof HTMLCanvasElement||n instanceof HTMLImageElement||n instanceof HTMLVideoElement||n instanceof ImageData)&&e._dirtyUniforms.push(i),{get:function(){return t[i]},set:function(n){let r=t[i];t[i]=n;let o=e._actualUniforms,a=o[i];(0,y.Z)(a)&&a!==r&&a instanceof eP.Z&&!(0,y.Z)(e._textureCache.getStageByName(i))&&(e._texturesToRelease.push(a),delete o[i],delete o[`${i}Dimensions`]),r instanceof eP.Z&&e._texturesToRelease.push(r),"string"==typeof n||n instanceof HTMLCanvasElement||n instanceof HTMLImageElement||n instanceof HTMLVideoElement||n instanceof ImageData?e._dirtyUniforms.push(i):o[i]=n}}}(e,n,o)):(t[o]=n[o],i[o]=n[o]),r[o]=n[o];let a=t[o]();("string"==typeof a||a instanceof eP.Z||a instanceof HTMLImageElement||a instanceof HTMLCanvasElement||a instanceof HTMLVideoElement)&&(t[`${o}Dimensions`]=function(e,t){return function(){let i=e[t]();if((0,y.Z)(i))return i.dimensions}}(t,o))}e._uniforms={},Object.defineProperties(e._uniforms,i),e._uniformMap=(0,eW.Z)(t,{colorTexture:function(){return e._colorTexture},colorTextureDimensions:function(){return e._colorTexture.dimensions},depthTexture:function(){return e._depthTexture},depthTextureDimensions:function(){return e._depthTexture.dimensions},czm_idTexture:function(){return e._idTexture},czm_selectedIdTexture:function(){return e._selectedIdTexture},czm_selectedIdTextureStep:function(){return 1/e._selectedIdTexture.width}})}(this),function(e,t){let i,n,r;let o=e._texturesToRelease,a=o.length;for(i=0;i<a;++i)n=(n=o[i])&&n.destroy();o.length=0;let s=e._texturesToCreate;for(i=0,a=s.length;i<a;++i){let n=s[i];r=n.name;let o=n.source;e._actualUniforms[r]=new eP.Z({context:t,source:o})}s.length=0;let l=e._dirtyUniforms;if(0===l.length&&!(0,y.Z)(e._texturePromise)){e._ready=!0;return}if(0===l.length||(0,y.Z)(e._texturePromise))return;a=l.length;let c=e._uniforms,u=[];for(i=0;i<a;++i){let t=c[r=l[i]],n=e._textureCache.getStageByName(t);if((0,y.Z)(n))e._actualUniforms[r]=function(e,t){return function(){return e._textureCache.getOutputTexture(t)}}(e,t);else if("string"==typeof t){let i=new eO.Z({url:t});u.push(i.fetchImage().then(function(e,t){return function(i){e._texturesToCreate.push({name:t,source:i})}}(e,r)))}else e._texturesToCreate.push({name:r,source:t})}l.length=0,u.length>0?(e._ready=!1,e._texturePromise=Promise.all(u).then(function(){e._ready=!0,e._texturePromise=void 0})):e._ready=!0}(this,e),function(e,t){if((0,y.Z)(e._command)&&!e._logDepthChanged&&!e._selectedDirty)return;let i=e._fragmentShader;if((0,y.Z)(e._selectedIdTexture)){let t=e._selectedIdTexture.width;i=i.replace(/in\s+vec2\s+v_textureCoordinates;/g,""),i=`#define CZM_SELECTED_FEATURE uniform sampler2D czm_idTexture; uniform sampler2D czm_selectedIdTexture; uniform float czm_selectedIdTextureStep; in vec2 v_textureCoordinates; bool czm_selected(vec2 offset) { bool selected = false; vec4 id = texture(czm_idTexture, v_textureCoordinates + offset); for (int i = 0; i < ${t}; ++i) { vec4 selectedId = texture(czm_selectedIdTexture, vec2((float(i) + 0.5) * czm_selectedIdTextureStep, 0.5)); if (all(equal(id, selectedId))) { return true; } } return false; } bool czm_selected() { return czm_selected(vec2(0.0)); } ${i}`}let n=new eD.Z({defines:[e._useLogDepth?"LOG_DEPTH":""],sources:[i]});e._command=t.createViewportQuadCommand(n,{uniformMap:e._uniformMap,owner:e})}(this,e),function(e){let t,i;1===e._sampleMode?(t=tl.Z.LINEAR,i=ts.Z.LINEAR):(t=tl.Z.NEAREST,i=ts.Z.NEAREST);let n=e._sampler;(0,y.Z)(n)&&n.minificationFilter===t&&n.magnificationFilter===i||(e._sampler=new ta.Z({wrapS:tc.Z.CLAMP_TO_EDGE,wrapT:tc.Z.CLAMP_TO_EDGE,minificationFilter:t,magnificationFilter:i}))}(this),this._selectedDirty=!1,!this._ready))return;let n=this._textureCache.getFramebuffer(this._name);if(this._command.framebuffer=n,!(0,y.Z)(n))return;let r=n.getColorTexture(0);r.width===e.drawingBufferWidth&&r.height===e.drawingBufferHeight||(i=this._renderState,(0,y.Z)(i)&&r.width===i.viewport.width&&r.height===i.viewport.height||(this._renderState=e5.Z.fromCache({viewport:new oN.Z(0,0,r.width,r.height)}))),this._command.renderState=i},dG.prototype.execute=function(e,t,i,n){if(!(0,y.Z)(this._command)||!(0,y.Z)(this._command.framebuffer)||!this._ready||!this._enabled)return;this._colorTexture=t,this._depthTexture=i,this._idTexture=n,ta.Z.equals(this._colorTexture.sampler,this._sampler)||(this._colorTexture.sampler=this._sampler);let r=this.scissorRectangle.width>0&&this.scissorRectangle.height>0?this._passState:void 0;(0,y.Z)(r)&&(r.context=e),this._command.execute(e,r)},dG.prototype.isDestroyed=function(){return!1},dG.prototype.destroy=function(){return dW(this),(0,b.Z)(this)},Object.defineProperties(dq.prototype,{ready:{get:function(){let e=this._stages,t=e.length;for(let i=0;i<t;++i)if(!e[i].ready)return!1;return!0}},name:{get:function(){return this._name}},enabled:{get:function(){return this._stages[0].enabled},set:function(e){let t=this._stages,i=t.length;for(let n=0;n<i;++n)t[n].enabled=e}},uniforms:{get:function(){return this._uniforms}},inputPreviousStageTexture:{get:function(){return this._inputPreviousStageTexture}},length:{get:function(){return this._stages.length}},selected:{get:function(){return this._selected},set:function(e){this._selected=e}},parentSelected:{get:function(){return this._parentSelected},set:function(e){this._parentSelected=e}}}),dq.prototype._isSupported=function(e){let t=this._stages,i=t.length;for(let n=0;n<i;++n)if(!t[n]._isSupported(e))return!1;return!0},dq.prototype.get=function(e){return D.Z.typeOf.number.greaterThanOrEquals("index",e,0),D.Z.typeOf.number.lessThan("index",e,this.length),this._stages[e]},dq.prototype.update=function(e,t){this._selectedDirty=function(e){let t=(0,y.Z)(e._selected)?e._selected.length:0,i=(0,y.Z)(e._parentSelected)?e._parentSelected:0,n=e._selected!==e._selectedShadow||t!==e._selectedLength;if(n=n||e._parentSelected!==e._parentSelectedShadow||i!==e._parentSelectedLength,(0,y.Z)(e._selected)&&(0,y.Z)(e._parentSelected)?e._combinedSelected=e._selected.concat(e._parentSelected):(0,y.Z)(e._parentSelected)?e._combinedSelected=e._parentSelected:e._combinedSelected=e._selected,!n&&(0,y.Z)(e._combinedSelected)){if(!(0,y.Z)(e._combinedSelectedShadow))return!0;t=e._combinedSelected.length;for(let i=0;i<t;++i)if(e._combinedSelected[i]!==e._combinedSelectedShadow[i])return!0}return n}(this),this._selectedShadow=this._selected,this._parentSelectedShadow=this._parentSelected,this._combinedSelectedShadow=this._combinedSelected,this._selectedLength=(0,y.Z)(this._selected)?this._selected.length:0,this._parentSelectedLength=(0,y.Z)(this._parentSelected)?this._parentSelected.length:0;let i=this._stages,n=i.length;for(let r=0;r<n;++r){let n=i[r];this._selectedDirty&&(n.parentSelected=this._combinedSelected),n.update(e,t)}},dq.prototype.isDestroyed=function(){return!1},dq.prototype.destroy=function(){let e=this._stages,t=e.length;for(let i=0;i<t;++i)e[i].destroy();return(0,b.Z)(this)};let dY={};function dX(e){let t=`#define USE_STEP_SIZE ${dU}`,i=new dG({name:`${e}_x_direction`,fragmentShader:t,uniforms:{delta:1,sigma:2,stepSize:1,direction:0},sampleMode:1}),n=new dG({name:`${e}_y_direction`,fragmentShader:t,uniforms:{delta:1,sigma:2,stepSize:1,direction:1},sampleMode:1}),r={};return Object.defineProperties(r,{delta:{get:function(){return i.uniforms.delta},set:function(e){let t=i.uniforms,r=n.uniforms;t.delta=r.delta=e}},sigma:{get:function(){return i.uniforms.sigma},set:function(e){let t=i.uniforms,r=n.uniforms;t.sigma=r.sigma=e}},stepSize:{get:function(){return i.uniforms.stepSize},set:function(e){let t=i.uniforms,r=n.uniforms;t.stepSize=r.stepSize=e}}}),new dq({name:e,stages:[i,n],uniforms:r})}dY.createBlurStage=function(){return dX("czm_blur")},dY.createDepthOfFieldStage=function(){let e=dX("czm_depth_of_field_blur"),t=new dG({name:"czm_depth_of_field_composite",fragmentShader:"uniform sampler2D colorTexture;\nuniform sampler2D blurTexture;\nuniform sampler2D depthTexture;\nuniform float focalDistance;\n\nin vec2 v_textureCoordinates;\n\nvec4 toEye(vec2 uv, float depth)\n{\n vec2 xy = vec2((uv.x * 2.0 - 1.0), ((1.0 - uv.y) * 2.0 - 1.0));\n vec4 posInCamera = czm_inverseProjection * vec4(xy, depth, 1.0);\n posInCamera = posInCamera / posInCamera.w;\n return posInCamera;\n}\n\nfloat computeDepthBlur(float depth)\n{\n float f;\n if (depth < focalDistance)\n {\n f = (focalDistance - depth) / (focalDistance - czm_currentFrustum.x);\n }\n else\n {\n f = (depth - focalDistance) / (czm_currentFrustum.y - focalDistance);\n f = pow(f, 0.1);\n }\n f *= f;\n f = clamp(f, 0.0, 1.0);\n return pow(f, 0.5);\n}\n\nvoid main(void)\n{\n float depth = czm_readDepth(depthTexture, v_textureCoordinates);\n vec4 posInCamera = toEye(v_textureCoordinates, depth);\n float d = computeDepthBlur(-posInCamera.z);\n out_FragColor = mix(texture(colorTexture, v_textureCoordinates), texture(blurTexture, v_textureCoordinates), d);\n}\n",uniforms:{focalDistance:5,blurTexture:e.name}}),i={};return Object.defineProperties(i,{focalDistance:{get:function(){return t.uniforms.focalDistance},set:function(e){t.uniforms.focalDistance=e}},delta:{get:function(){return e.uniforms.delta},set:function(t){e.uniforms.delta=t}},sigma:{get:function(){return e.uniforms.sigma},set:function(t){e.uniforms.sigma=t}},stepSize:{get:function(){return e.uniforms.stepSize},set:function(t){e.uniforms.stepSize=t}}}),new dq({name:"czm_depth_of_field",stages:[e,t],inputPreviousStageTexture:!1,uniforms:i})},dY.isDepthOfFieldSupported=function(e){return e.context.depthTexture},dY.createEdgeDetectionStage=function(){let e=(0,oL.Z)();return new dG({name:`czm_edge_detection_${e}`,fragmentShader:"uniform sampler2D depthTexture;\nuniform float length;\nuniform vec4 color;\n\nin vec2 v_textureCoordinates;\n\nvoid main(void)\n{\n float directions[3];\n directions[0] = -1.0;\n directions[1] = 0.0;\n directions[2] = 1.0;\n\n float scalars[3];\n scalars[0] = 3.0;\n scalars[1] = 10.0;\n scalars[2] = 3.0;\n\n float padx = czm_pixelRatio / czm_viewport.z;\n float pady = czm_pixelRatio / czm_viewport.w;\n\n#ifdef CZM_SELECTED_FEATURE\n bool selected = false;\n for (int i = 0; i < 3; ++i)\n {\n float dir = directions[i];\n selected = selected || czm_selected(vec2(-padx, dir * pady));\n selected = selected || czm_selected(vec2(padx, dir * pady));\n selected = selected || czm_selected(vec2(dir * padx, -pady));\n selected = selected || czm_selected(vec2(dir * padx, pady));\n if (selected)\n {\n break;\n }\n }\n if (!selected)\n {\n out_FragColor = vec4(color.rgb, 0.0);\n return;\n }\n#endif\n\n float horizEdge = 0.0;\n float vertEdge = 0.0;\n\n for (int i = 0; i < 3; ++i)\n {\n float dir = directions[i];\n float scale = scalars[i];\n\n horizEdge -= texture(depthTexture, v_textureCoordinates + vec2(-padx, dir * pady)).x * scale;\n horizEdge += texture(depthTexture, v_textureCoordinates + vec2(padx, dir * pady)).x * scale;\n\n vertEdge -= texture(depthTexture, v_textureCoordinates + vec2(dir * padx, -pady)).x * scale;\n vertEdge += texture(depthTexture, v_textureCoordinates + vec2(dir * padx, pady)).x * scale;\n }\n\n float len = sqrt(horizEdge * horizEdge + vertEdge * vertEdge);\n out_FragColor = vec4(color.rgb, len > length ? color.a : 0.0);\n}\n",uniforms:{length:.25,color:A.Z.clone(A.Z.BLACK)}})},dY.isEdgeDetectionSupported=function(e){return e.context.depthTexture},dY.createSilhouetteStage=function(e){let t=function(e){if(!(0,y.Z)(e))return dY.createEdgeDetectionStage();let t=new dq({name:"czm_edge_detection_multiple",stages:e,inputPreviousStageTexture:!1}),i={},n="",r="";for(let t=0;t<e.length;++t)n+=`uniform sampler2D edgeTexture${t}; `,r+=` vec4 edge${t} = texture(edgeTexture${t}, v_textureCoordinates); if (edge${t}.a > 0.0) { color = edge${t}; break; } `,i[`edgeTexture${t}`]=e[t].name;return new dq({name:"czm_edge_detection_composite",stages:[t,new dG({name:"czm_edge_detection_combine",fragmentShader:`${n}in vec2 v_textureCoordinates; void main() { vec4 color = vec4(0.0); for (int i = 0; i < ${e.length}; i++) { ${r} } out_FragColor = color; } `,uniforms:i})]})}(e),i=new dG({name:"czm_silhouette_color_edges",fragmentShader:"uniform sampler2D colorTexture;\nuniform sampler2D silhouetteTexture;\n\nin vec2 v_textureCoordinates;\n\nvoid main(void)\n{\n vec4 silhouetteColor = texture(silhouetteTexture, v_textureCoordinates);\n vec4 color = texture(colorTexture, v_textureCoordinates);\n out_FragColor = mix(color, silhouetteColor, silhouetteColor.a);\n}\n",uniforms:{silhouetteTexture:t.name}});return new dq({name:"czm_silhouette",stages:[t,i],inputPreviousStageTexture:!1,uniforms:t.uniforms})},dY.isSilhouetteSupported=function(e){return e.context.depthTexture},dY.createBloomStage=function(){let e=new dG({name:"czm_bloom_contrast_bias",fragmentShader:"uniform sampler2D colorTexture;\nuniform float contrast;\nuniform float brightness;\n\nin vec2 v_textureCoordinates;\n\nvoid main(void)\n{\n vec3 sceneColor = texture(colorTexture, v_textureCoordinates).xyz;\n sceneColor = czm_RGBToHSB(sceneColor);\n sceneColor.z += brightness;\n sceneColor = czm_HSBToRGB(sceneColor);\n\n float factor = (259.0 * (contrast + 255.0)) / (255.0 * (259.0 - contrast));\n sceneColor = factor * (sceneColor - vec3(0.5)) + vec3(0.5);\n out_FragColor = vec4(sceneColor, 1.0);\n}\n",uniforms:{contrast:128,brightness:-.3}}),t=dX("czm_bloom_blur"),i=new dq({name:"czm_bloom_contrast_bias_blur",stages:[e,t]}),n=new dG({name:"czm_bloom_generate_composite",fragmentShader:"uniform sampler2D colorTexture;\nuniform sampler2D bloomTexture;\nuniform bool glowOnly;\n\nin vec2 v_textureCoordinates;\n\nvoid main(void)\n{\n vec4 color = texture(colorTexture, v_textureCoordinates);\n\n#ifdef CZM_SELECTED_FEATURE\n if (czm_selected()) {\n out_FragColor = color;\n return;\n }\n#endif\n\n vec4 bloom = texture(bloomTexture, v_textureCoordinates);\n out_FragColor = glowOnly ? bloom : bloom + color;\n}\n",uniforms:{glowOnly:!1,bloomTexture:i.name}}),r={};return Object.defineProperties(r,{glowOnly:{get:function(){return n.uniforms.glowOnly},set:function(e){n.uniforms.glowOnly=e}},contrast:{get:function(){return e.uniforms.contrast},set:function(t){e.uniforms.contrast=t}},brightness:{get:function(){return e.uniforms.brightness},set:function(t){e.uniforms.brightness=t}},delta:{get:function(){return t.uniforms.delta},set:function(e){t.uniforms.delta=e}},sigma:{get:function(){return t.uniforms.sigma},set:function(e){t.uniforms.sigma=e}},stepSize:{get:function(){return t.uniforms.stepSize},set:function(e){t.uniforms.stepSize=e}}}),new dq({name:"czm_bloom",stages:[i,n],inputPreviousStageTexture:!1,uniforms:r})},dY.createAmbientOcclusionStage=function(){let e=new dG({name:"czm_ambient_occlusion_generate",fragmentShader:"uniform sampler2D randomTexture;\nuniform sampler2D depthTexture;\nuniform float intensity;\nuniform float bias;\nuniform float lengthCap;\nuniform float stepSize;\nuniform float frustumLength;\n\nin vec2 v_textureCoordinates;\n\nvec4 clipToEye(vec2 uv, float depth)\n{\n vec2 xy = vec2((uv.x * 2.0 - 1.0), ((1.0 - uv.y) * 2.0 - 1.0));\n vec4 posEC = czm_inverseProjection * vec4(xy, depth, 1.0);\n posEC = posEC / posEC.w;\n return posEC;\n}\n\n//Reconstruct Normal Without Edge Removation\nvec3 getNormalXEdge(vec3 posInCamera, float depthU, float depthD, float depthL, float depthR, vec2 pixelSize)\n{\n vec4 posInCameraUp = clipToEye(v_textureCoordinates - vec2(0.0, pixelSize.y), depthU);\n vec4 posInCameraDown = clipToEye(v_textureCoordinates + vec2(0.0, pixelSize.y), depthD);\n vec4 posInCameraLeft = clipToEye(v_textureCoordinates - vec2(pixelSize.x, 0.0), depthL);\n vec4 posInCameraRight = clipToEye(v_textureCoordinates + vec2(pixelSize.x, 0.0), depthR);\n\n vec3 up = posInCamera.xyz - posInCameraUp.xyz;\n vec3 down = posInCameraDown.xyz - posInCamera.xyz;\n vec3 left = posInCamera.xyz - posInCameraLeft.xyz;\n vec3 right = posInCameraRight.xyz - posInCamera.xyz;\n\n vec3 DX = length(left) < length(right) ? left : right;\n vec3 DY = length(up) < length(down) ? up : down;\n\n return normalize(cross(DY, DX));\n}\n\nvoid main(void)\n{\n float depth = czm_readDepth(depthTexture, v_textureCoordinates);\n vec4 posInCamera = clipToEye(v_textureCoordinates, depth);\n\n if (posInCamera.z > frustumLength)\n {\n out_FragColor = vec4(1.0);\n return;\n }\n\n vec2 pixelSize = czm_pixelRatio / czm_viewport.zw;\n float depthU = czm_readDepth(depthTexture, v_textureCoordinates - vec2(0.0, pixelSize.y));\n float depthD = czm_readDepth(depthTexture, v_textureCoordinates + vec2(0.0, pixelSize.y));\n float depthL = czm_readDepth(depthTexture, v_textureCoordinates - vec2(pixelSize.x, 0.0));\n float depthR = czm_readDepth(depthTexture, v_textureCoordinates + vec2(pixelSize.x, 0.0));\n vec3 normalInCamera = getNormalXEdge(posInCamera.xyz, depthU, depthD, depthL, depthR, pixelSize);\n\n float ao = 0.0;\n vec2 sampleDirection = vec2(1.0, 0.0);\n float gapAngle = 90.0 * czm_radiansPerDegree;\n\n // RandomNoise\n float randomVal = texture(randomTexture, v_textureCoordinates / pixelSize / 255.0).x;\n\n //Loop for each direction\n for (int i = 0; i < 4; i++)\n {\n float newGapAngle = gapAngle * (float(i) + randomVal);\n float cosVal = cos(newGapAngle);\n float sinVal = sin(newGapAngle);\n\n //Rotate Sampling Direction\n vec2 rotatedSampleDirection = vec2(cosVal * sampleDirection.x - sinVal * sampleDirection.y, sinVal * sampleDirection.x + cosVal * sampleDirection.y);\n float localAO = 0.0;\n float localStepSize = stepSize;\n\n //Loop for each step\n for (int j = 0; j < 6; j++)\n {\n vec2 newCoords = v_textureCoordinates + rotatedSampleDirection * localStepSize * pixelSize;\n\n //Exception Handling\n if(newCoords.x > 1.0 || newCoords.y > 1.0 || newCoords.x < 0.0 || newCoords.y < 0.0)\n {\n break;\n }\n\n float stepDepthInfo = czm_readDepth(depthTexture, newCoords);\n vec4 stepPosInCamera = clipToEye(newCoords, stepDepthInfo);\n vec3 diffVec = stepPosInCamera.xyz - posInCamera.xyz;\n float len = length(diffVec);\n\n if (len > lengthCap)\n {\n break;\n }\n\n float dotVal = clamp(dot(normalInCamera, normalize(diffVec)), 0.0, 1.0 );\n float weight = len / lengthCap;\n weight = 1.0 - weight * weight;\n\n if (dotVal < bias)\n {\n dotVal = 0.0;\n }\n\n localAO = max(localAO, dotVal * weight);\n localStepSize += stepSize;\n }\n ao += localAO;\n }\n\n ao /= 4.0;\n ao = 1.0 - clamp(ao, 0.0, 1.0);\n ao = pow(ao, intensity);\n out_FragColor = vec4(vec3(ao), 1.0);\n}\n",uniforms:{intensity:3,bias:.1,lengthCap:.26,stepSize:1.95,frustumLength:1e3,randomTexture:void 0}}),t=dX("czm_ambient_occlusion_blur");t.uniforms.stepSize=.86;let i=new dq({name:"czm_ambient_occlusion_generate_blur",stages:[e,t]}),n=new dG({name:"czm_ambient_occlusion_composite",fragmentShader:"uniform sampler2D colorTexture;\nuniform sampler2D ambientOcclusionTexture;\nuniform bool ambientOcclusionOnly;\nin vec2 v_textureCoordinates;\n\nvoid main(void)\n{\n vec4 color = texture(colorTexture, v_textureCoordinates);\n vec4 ao = texture(ambientOcclusionTexture, v_textureCoordinates);\n out_FragColor = ambientOcclusionOnly ? ao : ao * color;\n}\n",uniforms:{ambientOcclusionOnly:!1,ambientOcclusionTexture:i.name}}),r={};return Object.defineProperties(r,{intensity:{get:function(){return e.uniforms.intensity},set:function(t){e.uniforms.intensity=t}},bias:{get:function(){return e.uniforms.bias},set:function(t){e.uniforms.bias=t}},lengthCap:{get:function(){return e.uniforms.lengthCap},set:function(t){e.uniforms.lengthCap=t}},stepSize:{get:function(){return e.uniforms.stepSize},set:function(t){e.uniforms.stepSize=t}},frustumLength:{get:function(){return e.uniforms.frustumLength},set:function(t){e.uniforms.frustumLength=t}},randomTexture:{get:function(){return e.uniforms.randomTexture},set:function(t){e.uniforms.randomTexture=t}},delta:{get:function(){return t.uniforms.delta},set:function(e){t.uniforms.delta=e}},sigma:{get:function(){return t.uniforms.sigma},set:function(e){t.uniforms.sigma=e}},blurStepSize:{get:function(){return t.uniforms.stepSize},set:function(e){t.uniforms.stepSize=e}},ambientOcclusionOnly:{get:function(){return n.uniforms.ambientOcclusionOnly},set:function(e){n.uniforms.ambientOcclusionOnly=e}}}),new dq({name:"czm_ambient_occlusion",stages:[i,n],inputPreviousStageTexture:!1,uniforms:r})},dY.isAmbientOcclusionSupported=function(e){return e.context.depthTexture};let d$=`#define FXAA_QUALITY_PRESET 39 /** \ * @license \ * Copyright (c) 2014-2015, NVIDIA CORPORATION. All rights reserved. \ * \ * Redistribution and use in source and binary forms, with or without \ * modification, are permitted provided that the following conditions \ * are met: \ * * Redistributions of source code must retain the above copyright \ * notice, this list of conditions and the following disclaimer. \ * * Redistributions in binary form must reproduce the above copyright \ * notice, this list of conditions and the following disclaimer in the \ * documentation and/or other materials provided with the distribution. \ * * Neither the name of NVIDIA CORPORATION nor the names of its \ * contributors may be used to endorse or promote products derived \ * from this software without specific prior written permission. \ * \ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS \`\`AS IS'' AND ANY \ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE \ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR \ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR \ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, \ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, \ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY \ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT \ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE \ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \ */ \ \ // NVIDIA GameWorks Graphics Samples GitHub link: https://github.com/NVIDIAGameWorks/GraphicsSamples \ // Original FXAA 3.11 shader link: https://github.com/NVIDIAGameWorks/GraphicsSamples/blob/master/samples/es3-kepler/FXAA/FXAA3_11.h \ \ // Steps used to integrate into Cesium: \ // * The following defines are set: \ // #define FXAA_PC 1 \ // #define FXAA_WEBGL_1 1 \ // #define FXAA_GREEN_AS_LUMA 1 \ // #define FXAA_EARLY_EXIT 1 \ // #define FXAA_GLSL_120 1 \ // * All other preprocessor directives besides the FXAA_QUALITY__P* directives were removed. \ // * Double underscores are invalid for preprocessor directives so replace them with a single underscore. Replace \ // /FXAA_QUALITY__P(.*)/g with /FXAA_QUALITY__P$1/. \ // * There are no implicit conversions from ivec* to vec* so replace: \ // #define FxaaInt2 ivec2 \ // with \ // #define FxaaInt2 vec2 \ // * The texture2DLod function is only available in vertex shaders so replace: \ // #define FxaaTexTop(t, p) texture2DLod(t, p, 0.0) \ // #define FxaaTexOff(t, p, o, r) texture2DLod(t, p + (o * r), 0.0) \ // with \ // #define FxaaTexTop(t, p) texture(t, p) \ // #define FxaaTexOff(t, p, o, r) texture(t, p + (o * r)) \ // * FXAA_QUALITY_PRESET is prepended in the javascript code. We may want to expose that setting in the future. \ // * The following parameters to FxaaPixelShader are unused and can be removed: \ // fxaaConsolePosPos \ // fxaaConsoleRcpFrameOpt \ // fxaaConsoleRcpFrameOpt2 \ // fxaaConsole360RcpFrameOpt2 \ // fxaaConsoleEdgeSharpness \ // fxaaConsoleEdgeThreshold \ // fxaaConsoleEdgeThresholdMi \ // fxaaConsole360ConstDir \ \ // \ // Choose the quality preset. \ // This needs to be compiled into the shader as it effects code. \ // Best option to include multiple presets is to \ // in each shader define the preset, then include this file. \ // \ // OPTIONS \ // ----------------------------------------------------------------------- \ // 10 to 15 - default medium dither (10=fastest, 15=highest quality) \ // 20 to 29 - less dither, more expensive (20=fastest, 29=highest quality) \ // 39 - no dither, very expensive \ // \ // NOTES \ // ----------------------------------------------------------------------- \ // 12 = slightly faster then FXAA 3.9 and higher edge quality (default) \ // 13 = about same speed as FXAA 3.9 and better than 12 \ // 23 = closest to FXAA 3.9 visually and performance wise \ // _ = the lowest digit is directly related to performance \ // _ = the highest digit is directly related to style \ // \ //#define FXAA_QUALITY_PRESET 12 \ \ \ #if (FXAA_QUALITY_PRESET == 10) \ #define FXAA_QUALITY_PS 3 \ #define FXAA_QUALITY_P0 1.5 \ #define FXAA_QUALITY_P1 3.0 \ #define FXAA_QUALITY_P2 12.0 \ #endif \ #if (FXAA_QUALITY_PRESET == 11) \ #define FXAA_QUALITY_PS 4 \ #define FXAA_QUALITY_P0 1.0 \ #define FXAA_QUALITY_P1 1.5 \ #define FXAA_QUALITY_P2 3.0 \ #define FXAA_QUALITY_P3 12.0 \ #endif \ #if (FXAA_QUALITY_PRESET == 12) \ #define FXAA_QUALITY_PS 5 \ #define FXAA_QUALITY_P0 1.0 \ #define FXAA_QUALITY_P1 1.5 \ #define FXAA_QUALITY_P2 2.0 \ #define FXAA_QUALITY_P3 4.0 \ #define FXAA_QUALITY_P4 12.0 \ #endif \ #if (FXAA_QUALITY_PRESET == 13) \ #define FXAA_QUALITY_PS 6 \ #define FXAA_QUALITY_P0 1.0 \ #define FXAA_QUALITY_P1 1.5 \ #define FXAA_QUALITY_P2 2.0 \ #define FXAA_QUALITY_P3 2.0 \ #define FXAA_QUALITY_P4 4.0 \ #define FXAA_QUALITY_P5 12.0 \ #endif \ #if (FXAA_QUALITY_PRESET == 14) \ #define FXAA_QUALITY_PS 7 \ #define FXAA_QUALITY_P0 1.0 \ #define FXAA_QUALITY_P1 1.5 \ #define FXAA_QUALITY_P2 2.0 \ #define FXAA_QUALITY_P3 2.0 \ #define FXAA_QUALITY_P4 2.0 \ #define FXAA_QUALITY_P5 4.0 \ #define FXAA_QUALITY_P6 12.0 \ #endif \ #if (FXAA_QUALITY_PRESET == 15) \ #define FXAA_QUALITY_PS 8 \ #define FXAA_QUALITY_P0 1.0 \ #define FXAA_QUALITY_P1 1.5 \ #define FXAA_QUALITY_P2 2.0 \ #define FXAA_QUALITY_P3 2.0 \ #define FXAA_QUALITY_P4 2.0 \ #define FXAA_QUALITY_P5 2.0 \ #define FXAA_QUALITY_P6 4.0 \ #define FXAA_QUALITY_P7 12.0 \ #endif \ #if (FXAA_QUALITY_PRESET == 20) \ #define FXAA_QUALITY_PS 3 \ #define FXAA_QUALITY_P0 1.5 \ #define FXAA_QUALITY_P1 2.0 \ #define FXAA_QUALITY_P2 8.0 \ #endif \ #if (FXAA_QUALITY_PRESET == 21) \ #define FXAA_QUALITY_PS 4 \ #define FXAA_QUALITY_P0 1.0 \ #define FXAA_QUALITY_P1 1.5 \ #define FXAA_QUALITY_P2 2.0 \ #define FXAA_QUALITY_P3 8.0 \ #endif \ #if (FXAA_QUALITY_PRESET == 22) \ #define FXAA_QUALITY_PS 5 \ #define FXAA_QUALITY_P0 1.0 \ #define FXAA_QUALITY_P1 1.5 \ #define FXAA_QUALITY_P2 2.0 \ #define FXAA_QUALITY_P3 2.0 \ #define FXAA_QUALITY_P4 8.0 \ #endif \ #if (FXAA_QUALITY_PRESET == 23) \ #define FXAA_QUALITY_PS 6 \ #define FXAA_QUALITY_P0 1.0 \ #define FXAA_QUALITY_P1 1.5 \ #define FXAA_QUALITY_P2 2.0 \ #define FXAA_QUALITY_P3 2.0 \ #define FXAA_QUALITY_P4 2.0 \ #define FXAA_QUALITY_P5 8.0 \ #endif \ #if (FXAA_QUALITY_PRESET == 24) \ #define FXAA_QUALITY_PS 7 \ #define FXAA_QUALITY_P0 1.0 \ #define FXAA_QUALITY_P1 1.5 \ #define FXAA_QUALITY_P2 2.0 \ #define FXAA_QUALITY_P3 2.0 \ #define FXAA_QUALITY_P4 2.0 \ #define FXAA_QUALITY_P5 3.0 \ #define FXAA_QUALITY_P6 8.0 \ #endif \ #if (FXAA_QUALITY_PRESET == 25) \ #define FXAA_QUALITY_PS 8 \ #define FXAA_QUALITY_P0 1.0 \ #define FXAA_QUALITY_P1 1.5 \ #define FXAA_QUALITY_P2 2.0 \ #define FXAA_QUALITY_P3 2.0 \ #define FXAA_QUALITY_P4 2.0 \ #define FXAA_QUALITY_P5 2.0 \ #define FXAA_QUALITY_P6 4.0 \ #define FXAA_QUALITY_P7 8.0 \ #endif \ #if (FXAA_QUALITY_PRESET == 26) \ #define FXAA_QUALITY_PS 9 \ #define FXAA_QUALITY_P0 1.0 \ #define FXAA_QUALITY_P1 1.5 \ #define FXAA_QUALITY_P2 2.0 \ #define FXAA_QUALITY_P3 2.0 \ #define FXAA_QUALITY_P4 2.0 \ #define FXAA_QUALITY_P5 2.0 \ #define FXAA_QUALITY_P6 2.0 \ #define FXAA_QUALITY_P7 4.0 \ #define FXAA_QUALITY_P8 8.0 \ #endif \ #if (FXAA_QUALITY_PRESET == 27) \ #define FXAA_QUALITY_PS 10 \ #define FXAA_QUALITY_P0 1.0 \ #define FXAA_QUALITY_P1 1.5 \ #define FXAA_QUALITY_P2 2.0 \ #define FXAA_QUALITY_P3 2.0 \ #define FXAA_QUALITY_P4 2.0 \ #define FXAA_QUALITY_P5 2.0 \ #define FXAA_QUALITY_P6 2.0 \ #define FXAA_QUALITY_P7 2.0 \ #define FXAA_QUALITY_P8 4.0 \ #define FXAA_QUALITY_P9 8.0 \ #endif \ #if (FXAA_QUALITY_PRESET == 28) \ #define FXAA_QUALITY_PS 11 \ #define FXAA_QUALITY_P0 1.0 \ #define FXAA_QUALITY_P1 1.5 \ #define FXAA_QUALITY_P2 2.0 \ #define FXAA_QUALITY_P3 2.0 \ #define FXAA_QUALITY_P4 2.0 \ #define FXAA_QUALITY_P5 2.0 \ #define FXAA_QUALITY_P6 2.0 \ #define FXAA_QUALITY_P7 2.0 \ #define FXAA_QUALITY_P8 2.0 \ #define FXAA_QUALITY_P9 4.0 \ #define FXAA_QUALITY_P10 8.0 \ #endif \ #if (FXAA_QUALITY_PRESET == 29) \ #define FXAA_QUALITY_PS 12 \ #define FXAA_QUALITY_P0 1.0 \ #define FXAA_QUALITY_P1 1.5 \ #define FXAA_QUALITY_P2 2.0 \ #define FXAA_QUALITY_P3 2.0 \ #define FXAA_QUALITY_P4 2.0 \ #define FXAA_QUALITY_P5 2.0 \ #define FXAA_QUALITY_P6 2.0 \ #define FXAA_QUALITY_P7 2.0 \ #define FXAA_QUALITY_P8 2.0 \ #define FXAA_QUALITY_P9 2.0 \ #define FXAA_QUALITY_P10 4.0 \ #define FXAA_QUALITY_P11 8.0 \ #endif \ #if (FXAA_QUALITY_PRESET == 39) \ #define FXAA_QUALITY_PS 12 \ #define FXAA_QUALITY_P0 1.0 \ #define FXAA_QUALITY_P1 1.0 \ #define FXAA_QUALITY_P2 1.0 \ #define FXAA_QUALITY_P3 1.0 \ #define FXAA_QUALITY_P4 1.0 \ #define FXAA_QUALITY_P5 1.5 \ #define FXAA_QUALITY_P6 2.0 \ #define FXAA_QUALITY_P7 2.0 \ #define FXAA_QUALITY_P8 2.0 \ #define FXAA_QUALITY_P9 2.0 \ #define FXAA_QUALITY_P10 4.0 \ #define FXAA_QUALITY_P11 8.0 \ #endif \ \ #define FxaaBool bool \ #define FxaaFloat float \ #define FxaaFloat2 vec2 \ #define FxaaFloat3 vec3 \ #define FxaaFloat4 vec4 \ #define FxaaHalf float \ #define FxaaHalf2 vec2 \ #define FxaaHalf3 vec3 \ #define FxaaHalf4 vec4 \ #define FxaaInt2 vec2 \ #define FxaaTex sampler2D \ \ #define FxaaSat(x) clamp(x, 0.0, 1.0) \ #define FxaaTexTop(t, p) texture(t, p) \ #define FxaaTexOff(t, p, o, r) texture(t, p + (o * r)) \ \ FxaaFloat FxaaLuma(FxaaFloat4 rgba) { return rgba.y; } \ \ FxaaFloat4 FxaaPixelShader( \ // \ // Use noperspective interpolation here (turn off perspective interpolation). \ // {xy} = center of pixel \ FxaaFloat2 pos, \ // \ // Input color texture. \ // {rgb_} = color in linear or perceptual color space \ // if (FXAA_GREEN_AS_LUMA == 0) \ // {___a} = luma in perceptual color space (not linear) \ FxaaTex tex, \ // \ // Only used on FXAA Quality. \ // This must be from a constant/uniform. \ // {x_} = 1.0/screenWidthInPixels \ // {_y} = 1.0/screenHeightInPixels \ FxaaFloat2 fxaaQualityRcpFrame, \ // \ // Only used on FXAA Quality. \ // This used to be the FXAA_QUALITY_SUBPIX define. \ // It is here now to allow easier tuning. \ // Choose the amount of sub-pixel aliasing removal. \ // This can effect sharpness. \ // 1.00 - upper limit (softer) \ // 0.75 - default amount of filtering \ // 0.50 - lower limit (sharper, less sub-pixel aliasing removal) \ // 0.25 - almost off \ // 0.00 - completely off \ FxaaFloat fxaaQualitySubpix, \ // \ // Only used on FXAA Quality. \ // This used to be the FXAA_QUALITY_EDGE_THRESHOLD define. \ // It is here now to allow easier tuning. \ // The minimum amount of local contrast required to apply algorithm. \ // 0.333 - too little (faster) \ // 0.250 - low quality \ // 0.166 - default \ // 0.125 - high quality \ // 0.063 - overkill (slower) \ FxaaFloat fxaaQualityEdgeThreshold, \ // \ // Only used on FXAA Quality. \ // This used to be the FXAA_QUALITY_EDGE_THRESHOLD_MIN define. \ // It is here now to allow easier tuning. \ // Trims the algorithm from processing darks. \ // 0.0833 - upper limit (default, the start of visible unfiltered edges) \ // 0.0625 - high quality (faster) \ // 0.0312 - visible limit (slower) \ // Special notes when using FXAA_GREEN_AS_LUMA, \ // Likely want to set this to zero. \ // As colors that are mostly not-green \ // will appear very dark in the green channel! \ // Tune by looking at mostly non-green content, \ // then start at zero and increase until aliasing is a problem. \ FxaaFloat fxaaQualityEdgeThresholdMin \ ) { \ /*--------------------------------------------------------------------------*/ \ FxaaFloat2 posM; \ posM.x = pos.x; \ posM.y = pos.y; \ FxaaFloat4 rgbyM = FxaaTexTop(tex, posM); \ #define lumaM rgbyM.y \ FxaaFloat lumaS = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 0, 1), fxaaQualityRcpFrame.xy)); \ FxaaFloat lumaE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 1, 0), fxaaQualityRcpFrame.xy)); \ FxaaFloat lumaN = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 0,-1), fxaaQualityRcpFrame.xy)); \ FxaaFloat lumaW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1, 0), fxaaQualityRcpFrame.xy)); \ /*--------------------------------------------------------------------------*/ \ FxaaFloat maxSM = max(lumaS, lumaM); \ FxaaFloat minSM = min(lumaS, lumaM); \ FxaaFloat maxESM = max(lumaE, maxSM); \ FxaaFloat minESM = min(lumaE, minSM); \ FxaaFloat maxWN = max(lumaN, lumaW); \ FxaaFloat minWN = min(lumaN, lumaW); \ FxaaFloat rangeMax = max(maxWN, maxESM); \ FxaaFloat rangeMin = min(minWN, minESM); \ FxaaFloat rangeMaxScaled = rangeMax * fxaaQualityEdgeThreshold; \ FxaaFloat range = rangeMax - rangeMin; \ FxaaFloat rangeMaxClamped = max(fxaaQualityEdgeThresholdMin, rangeMaxScaled); \ FxaaBool earlyExit = range < rangeMaxClamped; \ /*--------------------------------------------------------------------------*/ \ if(earlyExit) \ return rgbyM; \ /*--------------------------------------------------------------------------*/ \ FxaaFloat lumaNW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1,-1), fxaaQualityRcpFrame.xy)); \ FxaaFloat lumaSE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 1, 1), fxaaQualityRcpFrame.xy)); \ FxaaFloat lumaNE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 1,-1), fxaaQualityRcpFrame.xy)); \ FxaaFloat lumaSW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1, 1), fxaaQualityRcpFrame.xy)); \ /*--------------------------------------------------------------------------*/ \ FxaaFloat lumaNS = lumaN + lumaS; \ FxaaFloat lumaWE = lumaW + lumaE; \ FxaaFloat subpixRcpRange = 1.0/range; \ FxaaFloat subpixNSWE = lumaNS + lumaWE; \ FxaaFloat edgeHorz1 = (-2.0 * lumaM) + lumaNS; \ FxaaFloat edgeVert1 = (-2.0 * lumaM) + lumaWE; \ /*--------------------------------------------------------------------------*/ \ FxaaFloat lumaNESE = lumaNE + lumaSE; \ FxaaFloat lumaNWNE = lumaNW + lumaNE; \ FxaaFloat edgeHorz2 = (-2.0 * lumaE) + lumaNESE; \ FxaaFloat edgeVert2 = (-2.0 * lumaN) + lumaNWNE; \ /*--------------------------------------------------------------------------*/ \ FxaaFloat lumaNWSW = lumaNW + lumaSW; \ FxaaFloat lumaSWSE = lumaSW + lumaSE; \ FxaaFloat edgeHorz4 = (abs(edgeHorz1) * 2.0) + abs(edgeHorz2); \ FxaaFloat edgeVert4 = (abs(edgeVert1) * 2.0) + abs(edgeVert2); \ FxaaFloat edgeHorz3 = (-2.0 * lumaW) + lumaNWSW; \ FxaaFloat edgeVert3 = (-2.0 * lumaS) + lumaSWSE; \ FxaaFloat edgeHorz = abs(edgeHorz3) + edgeHorz4; \ FxaaFloat edgeVert = abs(edgeVert3) + edgeVert4; \ /*--------------------------------------------------------------------------*/ \ FxaaFloat subpixNWSWNESE = lumaNWSW + lumaNESE; \ FxaaFloat lengthSign = fxaaQualityRcpFrame.x; \ FxaaBool horzSpan = edgeHorz >= edgeVert; \ FxaaFloat subpixA = subpixNSWE * 2.0 + subpixNWSWNESE; \ /*--------------------------------------------------------------------------*/ \ if(!horzSpan) lumaN = lumaW; \ if(!horzSpan) lumaS = lumaE; \ if(horzSpan) lengthSign = fxaaQualityRcpFrame.y; \ FxaaFloat subpixB = (subpixA * (1.0/12.0)) - lumaM; \ /*--------------------------------------------------------------------------*/ \ FxaaFloat gradientN = lumaN - lumaM; \ FxaaFloat gradientS = lumaS - lumaM; \ FxaaFloat lumaNN = lumaN + lumaM; \ FxaaFloat lumaSS = lumaS + lumaM; \ FxaaBool pairN = abs(gradientN) >= abs(gradientS); \ FxaaFloat gradient = max(abs(gradientN), abs(gradientS)); \ if(pairN) lengthSign = -lengthSign; \ FxaaFloat subpixC = FxaaSat(abs(subpixB) * subpixRcpRange); \ /*--------------------------------------------------------------------------*/ \ FxaaFloat2 posB; \ posB.x = posM.x; \ posB.y = posM.y; \ FxaaFloat2 offNP; \ offNP.x = (!horzSpan) ? 0.0 : fxaaQualityRcpFrame.x; \ offNP.y = ( horzSpan) ? 0.0 : fxaaQualityRcpFrame.y; \ if(!horzSpan) posB.x += lengthSign * 0.5; \ if( horzSpan) posB.y += lengthSign * 0.5; \ /*--------------------------------------------------------------------------*/ \ FxaaFloat2 posN; \ posN.x = posB.x - offNP.x * FXAA_QUALITY_P0; \ posN.y = posB.y - offNP.y * FXAA_QUALITY_P0; \ FxaaFloat2 posP; \ posP.x = posB.x + offNP.x * FXAA_QUALITY_P0; \ posP.y = posB.y + offNP.y * FXAA_QUALITY_P0; \ FxaaFloat subpixD = ((-2.0)*subpixC) + 3.0; \ FxaaFloat lumaEndN = FxaaLuma(FxaaTexTop(tex, posN)); \ FxaaFloat subpixE = subpixC * subpixC; \ FxaaFloat lumaEndP = FxaaLuma(FxaaTexTop(tex, posP)); \ /*--------------------------------------------------------------------------*/ \ if(!pairN) lumaNN = lumaSS; \ FxaaFloat gradientScaled = gradient * 1.0/4.0; \ FxaaFloat lumaMM = lumaM - lumaNN * 0.5; \ FxaaFloat subpixF = subpixD * subpixE; \ FxaaBool lumaMLTZero = lumaMM < 0.0; \ /*--------------------------------------------------------------------------*/ \ lumaEndN -= lumaNN * 0.5; \ lumaEndP -= lumaNN * 0.5; \ FxaaBool doneN = abs(lumaEndN) >= gradientScaled; \ FxaaBool doneP = abs(lumaEndP) >= gradientScaled; \ if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P1; \ if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P1; \ FxaaBool doneNP = (!doneN) || (!doneP); \ if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P1; \ if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P1; \ /*--------------------------------------------------------------------------*/ \ if(doneNP) { \ if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy)); \ if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy)); \ if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5; \ if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5; \ doneN = abs(lumaEndN) >= gradientScaled; \ doneP = abs(lumaEndP) >= gradientScaled; \ if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P2; \ if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P2; \ doneNP = (!doneN) || (!doneP); \ if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P2; \ if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P2; \ /*--------------------------------------------------------------------------*/ \ #if (FXAA_QUALITY_PS > 3) \ if(doneNP) { \ if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy)); \ if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy)); \ if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5; \ if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5; \ doneN = abs(lumaEndN) >= gradientScaled; \ doneP = abs(lumaEndP) >= gradientScaled; \ if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P3; \ if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P3; \ doneNP = (!doneN) || (!doneP); \ if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P3; \ if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P3; \ /*--------------------------------------------------------------------------*/ \ #if (FXAA_QUALITY_PS > 4) \ if(doneNP) { \ if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy)); \ if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy)); \ if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5; \ if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5; \ doneN = abs(lumaEndN) >= gradientScaled; \ doneP = abs(lumaEndP) >= gradientScaled; \ if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P4; \ if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P4; \ doneNP = (!doneN) || (!doneP); \ if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P4; \ if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P4; \ /*--------------------------------------------------------------------------*/ \ #if (FXAA_QUALITY_PS > 5) \ if(doneNP) { \ if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy)); \ if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy)); \ if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5; \ if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5; \ doneN = abs(lumaEndN) >= gradientScaled; \ doneP = abs(lumaEndP) >= gradientScaled; \ if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P5; \ if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P5; \ doneNP = (!doneN) || (!doneP); \ if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P5; \ if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P5; \ /*--------------------------------------------------------------------------*/ \ #if (FXAA_QUALITY_PS > 6) \ if(doneNP) { \ if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy)); \ if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy)); \ if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5; \ if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5; \ doneN = abs(lumaEndN) >= gradientScaled; \ doneP = abs(lumaEndP) >= gradientScaled; \ if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P6; \ if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P6; \ doneNP = (!doneN) || (!doneP); \ if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P6; \ if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P6; \ /*--------------------------------------------------------------------------*/ \ #if (FXAA_QUALITY_PS > 7) \ if(doneNP) { \ if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy)); \ if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy)); \ if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5; \ if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5; \ doneN = abs(lumaEndN) >= gradientScaled; \ doneP = abs(lumaEndP) >= gradientScaled; \ if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P7; \ if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P7; \ doneNP = (!doneN) || (!doneP); \ if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P7; \ if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P7; \ /*--------------------------------------------------------------------------*/ \ #if (FXAA_QUALITY_PS > 8) \ if(doneNP) { \ if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy)); \ if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy)); \ if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5; \ if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5; \ doneN = abs(lumaEndN) >= gradientScaled; \ doneP = abs(lumaEndP) >= gradientScaled; \ if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P8; \ if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P8; \ doneNP = (!doneN) || (!doneP); \ if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P8; \ if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P8; \ /*--------------------------------------------------------------------------*/ \ #if (FXAA_QUALITY_PS > 9) \ if(doneNP) { \ if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy)); \ if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy)); \ if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5; \ if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5; \ doneN = abs(lumaEndN) >= gradientScaled; \ doneP = abs(lumaEndP) >= gradientScaled; \ if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P9; \ if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P9; \ doneNP = (!doneN) || (!doneP); \ if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P9; \ if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P9; \ /*--------------------------------------------------------------------------*/ \ #if (FXAA_QUALITY_PS > 10) \ if(doneNP) { \ if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy)); \ if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy)); \ if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5; \ if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5; \ doneN = abs(lumaEndN) >= gradientScaled; \ doneP = abs(lumaEndP) >= gradientScaled; \ if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P10; \ if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P10; \ doneNP = (!doneN) || (!doneP); \ if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P10; \ if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P10; \ /*--------------------------------------------------------------------------*/ \ #if (FXAA_QUALITY_PS > 11) \ if(doneNP) { \ if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy)); \ if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy)); \ if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5; \ if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5; \ doneN = abs(lumaEndN) >= gradientScaled; \ doneP = abs(lumaEndP) >= gradientScaled; \ if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P11; \ if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P11; \ doneNP = (!doneN) || (!doneP); \ if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P11; \ if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P11; \ /*--------------------------------------------------------------------------*/ \ #if (FXAA_QUALITY_PS > 12) \ if(doneNP) { \ if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy)); \ if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy)); \ if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5; \ if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5; \ doneN = abs(lumaEndN) >= gradientScaled; \ doneP = abs(lumaEndP) >= gradientScaled; \ if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P12; \ if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P12; \ doneNP = (!doneN) || (!doneP); \ if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P12; \ if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P12; \ /*--------------------------------------------------------------------------*/ \ } \ #endif \ /*--------------------------------------------------------------------------*/ \ } \ #endif \ /*--------------------------------------------------------------------------*/ \ } \ #endif \ /*--------------------------------------------------------------------------*/ \ } \ #endif \ /*--------------------------------------------------------------------------*/ \ } \ #endif \ /*--------------------------------------------------------------------------*/ \ } \ #endif \ /*--------------------------------------------------------------------------*/ \ } \ #endif \ /*--------------------------------------------------------------------------*/ \ } \ #endif \ /*--------------------------------------------------------------------------*/ \ } \ #endif \ /*--------------------------------------------------------------------------*/ \ } \ #endif \ /*--------------------------------------------------------------------------*/ \ } \ /*--------------------------------------------------------------------------*/ \ FxaaFloat dstN = posM.x - posN.x; \ FxaaFloat dstP = posP.x - posM.x; \ if(!horzSpan) dstN = posM.y - posN.y; \ if(!horzSpan) dstP = posP.y - posM.y; \ /*--------------------------------------------------------------------------*/ \ FxaaBool goodSpanN = (lumaEndN < 0.0) != lumaMLTZero; \ FxaaFloat spanLength = (dstP + dstN); \ FxaaBool goodSpanP = (lumaEndP < 0.0) != lumaMLTZero; \ FxaaFloat spanLengthRcp = 1.0/spanLength; \ /*--------------------------------------------------------------------------*/ \ FxaaBool directionN = dstN < dstP; \ FxaaFloat dst = min(dstN, dstP); \ FxaaBool goodSpan = directionN ? goodSpanN : goodSpanP; \ FxaaFloat subpixG = subpixF * subpixF; \ FxaaFloat pixelOffset = (dst * (-spanLengthRcp)) + 0.5; \ FxaaFloat subpixH = subpixG * fxaaQualitySubpix; \ /*--------------------------------------------------------------------------*/ \ FxaaFloat pixelOffsetGood = goodSpan ? pixelOffset : 0.0; \ FxaaFloat pixelOffsetSubpix = max(pixelOffsetGood, subpixH); \ if(!horzSpan) posM.x += pixelOffsetSubpix * lengthSign; \ if( horzSpan) posM.y += pixelOffsetSubpix * lengthSign; \ return FxaaFloat4(FxaaTexTop(tex, posM).xyz, lumaM); \ } \ in vec2 v_textureCoordinates; \ \ uniform sampler2D colorTexture; \ \ const float fxaaQualitySubpix = 0.5; \ const float fxaaQualityEdgeThreshold = 0.125; \ const float fxaaQualityEdgeThresholdMin = 0.0833; \ \ void main() \ { \ vec2 fxaaQualityRcpFrame = vec2(1.0) / czm_viewport.zw; \ vec4 color = FxaaPixelShader( \ v_textureCoordinates, \ colorTexture, \ fxaaQualityRcpFrame, \ fxaaQualitySubpix, \ fxaaQualityEdgeThreshold, \ fxaaQualityEdgeThresholdMin); \ float alpha = texture(colorTexture, v_textureCoordinates).a; \ out_FragColor = vec4(color.rgb, alpha); \ } \ `;function dK(e){this._collection=e,this._framebuffers=[],this._stageNameToFramebuffer={},this._width=void 0,this._height=void 0,this._updateDependencies=!1}function dQ(e){for(;(0,y.Z)(e.length);)e=e.get(e.length-1);return e.name}function dJ(e,t,i,n,r){if(!n.enabled||!n._isSupported(t))return r;let o=i[n.name]={};(0,y.Z)(r)&&(o[dQ(e.getStageByName(r))]=!0);let a=n.uniforms;if((0,y.Z)(a)){let t=Object.getOwnPropertyNames(a),i=t.length;for(let n=0;n<i;++n){let i=a[t[n]];if("string"==typeof i){let t=e.getStageByName(i);(0,y.Z)(t)&&(o[dQ(t)]=!0)}}}return n.name}function d0(e,t,i,n,r){let o,a;if((0,y.Z)(n.enabled)&&!n.enabled||(0,y.Z)(n._isSupported)&&!n._isSupported(t))return r;let s=r,l=!(0,y.Z)(n.inputPreviousStageTexture)||n.inputPreviousStageTexture,c=r,u=n.length;for(let o=0;o<u;++o){let a=n.get(o);c=(0,y.Z)(a.length)?d0(e,t,i,a,r):dJ(e,t,i,a,r),l&&(r=c)}if(l)for(o=1;o<u;++o)a=dQ(n.get(o)),(0,y.Z)(i[a])||(i[a]={}),i[a][s]=!0;else for(o=1;o<u;++o){let e=i[a=dQ(n.get(o))];for(let t=0;t<o;++t)e[dQ(n.get(t))]=!0}return c}function d1(e){let t=e._framebuffers,i=t.length;for(let e=0;e<i;++e)t[e].buffer.destroy()}dY.createFXAAStage=function(){return new dG({name:"czm_FXAA",fragmentShader:d$,sampleMode:1})},dY.createAcesTonemappingStage=function(e){let t=e?"#define AUTO_EXPOSURE\n":"";return new dG({name:"czm_aces",fragmentShader:t+="uniform sampler2D colorTexture;\n\nin vec2 v_textureCoordinates;\n\n#ifdef AUTO_EXPOSURE\nuniform sampler2D autoExposure;\n#endif\n\nvoid main()\n{\n vec4 fragmentColor = texture(colorTexture, v_textureCoordinates);\n vec3 color = fragmentColor.rgb;\n\n#ifdef AUTO_EXPOSURE\n color /= texture(autoExposure, vec2(0.5)).r;\n#endif\n color = czm_acesTonemapping(color);\n color = czm_inverseGamma(color);\n\n out_FragColor = vec4(color, fragmentColor.a);\n}\n",uniforms:{autoExposure:void 0}})},dY.createFilmicTonemappingStage=function(e){let t=e?"#define AUTO_EXPOSURE\n":"";return new dG({name:"czm_filmic",fragmentShader:t+="uniform sampler2D colorTexture;\n\nin vec2 v_textureCoordinates;\n\n#ifdef AUTO_EXPOSURE\nuniform sampler2D autoExposure;\n#endif\n\n// See slides 142 and 143:\n// http://www.gdcvault.com/play/1012459/Uncharted_2__HDR_Lighting\n\nvoid main()\n{\n vec4 fragmentColor = texture(colorTexture, v_textureCoordinates);\n vec3 color = fragmentColor.rgb;\n\n#ifdef AUTO_EXPOSURE\n float exposure = texture(autoExposure, vec2(0.5)).r;\n color /= exposure;\n#endif\n\n const float A = 0.22; // shoulder strength\n const float B = 0.30; // linear strength\n const float C = 0.10; // linear angle\n const float D = 0.20; // toe strength\n const float E = 0.01; // toe numerator\n const float F = 0.30; // toe denominator\n\n const float white = 11.2; // linear white point value\n\n vec3 c = ((color * (A * color + C * B) + D * E) / (color * ( A * color + B) + D * F)) - E / F;\n float w = ((white * (A * white + C * B) + D * E) / (white * ( A * white + B) + D * F)) - E / F;\n\n c = czm_inverseGamma(c / w);\n out_FragColor = vec4(c, fragmentColor.a);\n}\n",uniforms:{autoExposure:void 0}})},dY.createReinhardTonemappingStage=function(e){let t=e?"#define AUTO_EXPOSURE\n":"";return new dG({name:"czm_reinhard",fragmentShader:t+="uniform sampler2D colorTexture;\n\nin vec2 v_textureCoordinates;\n\n#ifdef AUTO_EXPOSURE\nuniform sampler2D autoExposure;\n#endif\n\n// See equation 3:\n// http://www.cs.utah.edu/~reinhard/cdrom/tonemap.pdf\n\nvoid main()\n{\n vec4 fragmentColor = texture(colorTexture, v_textureCoordinates);\n vec3 color = fragmentColor.rgb;\n#ifdef AUTO_EXPOSURE\n float exposure = texture(autoExposure, vec2(0.5)).r;\n color /= exposure;\n#endif\n color = color / (1.0 + color);\n color = czm_inverseGamma(color);\n out_FragColor = vec4(color, fragmentColor.a);\n}\n",uniforms:{autoExposure:void 0}})},dY.createModifiedReinhardTonemappingStage=function(e){let t=e?"#define AUTO_EXPOSURE\n":"";return new dG({name:"czm_modified_reinhard",fragmentShader:t+="uniform sampler2D colorTexture;\nuniform vec3 white;\n\nin vec2 v_textureCoordinates;\n\n#ifdef AUTO_EXPOSURE\nuniform sampler2D autoExposure;\n#endif\n\n// See equation 4:\n// http://www.cs.utah.edu/~reinhard/cdrom/tonemap.pdf\n\nvoid main()\n{\n vec4 fragmentColor = texture(colorTexture, v_textureCoordinates);\n vec3 color = fragmentColor.rgb;\n#ifdef AUTO_EXPOSURE\n float exposure = texture(autoExposure, vec2(0.5)).r;\n color /= exposure;\n#endif\n color = (color * (1.0 + color / white)) / (1.0 + color);\n color = czm_inverseGamma(color);\n out_FragColor = vec4(color, fragmentColor.a);\n}\n",uniforms:{white:A.Z.WHITE,autoExposure:void 0}})},dY.createAutoExposureStage=function(){return new dk},dY.createBlackAndWhiteStage=function(){return new dG({name:"czm_black_and_white",fragmentShader:"uniform sampler2D colorTexture;\nuniform float gradations;\n\nin vec2 v_textureCoordinates;\n\nvoid main(void)\n{\n vec3 rgb = texture(colorTexture, v_textureCoordinates).rgb;\n#ifdef CZM_SELECTED_FEATURE\n if (czm_selected()) {\n out_FragColor = vec4(rgb, 1.0);\n return;\n }\n#endif\n float luminance = czm_luminance(rgb);\n float darkness = luminance * gradations;\n darkness = (darkness - fract(darkness)) / gradations;\n out_FragColor = vec4(vec3(darkness), 1.0);\n}\n",uniforms:{gradations:5}})},dY.createBrightnessStage=function(){return new dG({name:"czm_brightness",fragmentShader:"uniform sampler2D colorTexture;\nuniform float brightness;\n\nin vec2 v_textureCoordinates;\n\nvoid main(void)\n{\n vec3 rgb = texture(colorTexture, v_textureCoordinates).rgb;\n vec3 target = vec3(0.0);\n out_FragColor = vec4(mix(target, rgb, brightness), 1.0);\n}\n",uniforms:{brightness:.5}})},dY.createNightVisionStage=function(){return new dG({name:"czm_night_vision",fragmentShader:"uniform sampler2D colorTexture;\n\nin vec2 v_textureCoordinates;\n\nfloat rand(vec2 co)\n{\n return fract(sin(dot(co.xy ,vec2(12.9898, 78.233))) * 43758.5453);\n}\n\nvoid main(void)\n{\n float noiseValue = rand(v_textureCoordinates + sin(czm_frameNumber)) * 0.1;\n vec3 rgb = texture(colorTexture, v_textureCoordinates).rgb;\n vec3 green = vec3(0.0, 1.0, 0.0);\n out_FragColor = vec4((noiseValue + rgb) * green, 1.0);\n}\n"})},dY.createDepthViewStage=function(){return new dG({name:"czm_depth_view",fragmentShader:"uniform sampler2D depthTexture;\n\nin vec2 v_textureCoordinates;\n\nvoid main(void)\n{\n float depth = czm_readDepth(depthTexture, v_textureCoordinates);\n out_FragColor = vec4(vec3(depth), 1.0);\n}\n"})},dY.createLensFlareStage=function(){return new dG({name:"czm_lens_flare",fragmentShader:"uniform sampler2D colorTexture;\nuniform sampler2D dirtTexture;\nuniform sampler2D starTexture;\nuniform vec2 dirtTextureDimensions;\nuniform float distortion;\nuniform float ghostDispersal;\nuniform float haloWidth;\nuniform float dirtAmount;\nuniform float earthRadius;\nuniform float intensity;\n\nin vec2 v_textureCoordinates;\n\n// whether it is in space or not\n// 6500000.0 is empirical value\n#define DISTANCE_TO_SPACE 6500000.0\n\n// return ndc from world coordinate biased earthRadius\nvec4 getNDCFromWC(vec3 WC, float earthRadius)\n{\n vec4 positionEC = czm_view * vec4(WC, 1.0);\n positionEC = vec4(positionEC.x + earthRadius, positionEC.y, positionEC.z, 1.0);\n vec4 positionWC = czm_eyeToWindowCoordinates(positionEC);\n return czm_viewportOrthographic * vec4(positionWC.xy, -positionWC.z, 1.0);\n}\n\n// Check if current pixel is included Earth\n// if then mask it gradually\nfloat isInEarth(vec2 texcoord, vec2 sceneSize)\n{\n vec2 NDC = texcoord * 2.0 - 1.0;\n vec4 earthPosSC = getNDCFromWC(vec3(0.0), 0.0);\n vec4 earthPosSCEdge = getNDCFromWC(vec3(0.0), earthRadius * 1.5);\n NDC.xy -= earthPosSC.xy;\n\n float X = abs(NDC.x) * sceneSize.x;\n float Y = abs(NDC.y) * sceneSize.y;\n\n return clamp(0.0, 1.0, max(sqrt(X * X + Y * Y) / max(abs(earthPosSCEdge.x * sceneSize.x), 1.0) - 0.8 , 0.0));\n}\n\n// For Chromatic effect\nvec4 textureDistorted(sampler2D tex, vec2 texcoord, vec2 direction, vec3 distortion, bool isSpace)\n{\n vec2 sceneSize = czm_viewport.zw;\n vec3 color;\n if(isSpace)\n {\n color.r = isInEarth(texcoord + direction * distortion.r, sceneSize) * texture(tex, texcoord + direction * distortion.r).r;\n color.g = isInEarth(texcoord + direction * distortion.g, sceneSize) * texture(tex, texcoord + direction * distortion.g).g;\n color.b = isInEarth(texcoord + direction * distortion.b, sceneSize) * texture(tex, texcoord + direction * distortion.b).b;\n }\n else\n {\n color.r = texture(tex, texcoord + direction * distortion.r).r;\n color.g = texture(tex, texcoord + direction * distortion.g).g;\n color.b = texture(tex, texcoord + direction * distortion.b).b;\n }\n return vec4(clamp(color, 0.0, 1.0), 0.0);\n}\n\nvoid main(void)\n{\n vec4 originalColor = texture(colorTexture, v_textureCoordinates);\n vec3 rgb = originalColor.rgb;\n bool isSpace = length(czm_viewerPositionWC.xyz) > DISTANCE_TO_SPACE;\n\n // Sun position\n vec4 sunPos = czm_morphTime == 1.0 ? vec4(czm_sunPositionWC, 1.0) : vec4(czm_sunPositionColumbusView.zxy, 1.0);\n vec4 sunPositionEC = czm_view * sunPos;\n vec4 sunPositionWC = czm_eyeToWindowCoordinates(sunPositionEC);\n sunPos = czm_viewportOrthographic * vec4(sunPositionWC.xy, -sunPositionWC.z, 1.0);\n\n // If sun is not in the screen space, use original color.\n if(!isSpace || !((sunPos.x >= -1.1 && sunPos.x <= 1.1) && (sunPos.y >= -1.1 && sunPos.y <= 1.1)))\n {\n // Lens flare is disabled when not in space until #5932 is fixed.\n // https://github.com/CesiumGS/cesium/issues/5932\n out_FragColor = originalColor;\n return;\n }\n\n vec2 texcoord = vec2(1.0) - v_textureCoordinates;\n vec2 pixelSize = czm_pixelRatio / czm_viewport.zw;\n vec2 invPixelSize = 1.0 / pixelSize;\n vec3 distortionVec = pixelSize.x * vec3(-distortion, 0.0, distortion);\n\n // ghost vector to image centre:\n vec2 ghostVec = (vec2(0.5) - texcoord) * ghostDispersal;\n vec3 direction = normalize(vec3(ghostVec, 0.0));\n\n // sample ghosts:\n vec4 result = vec4(0.0);\n vec4 ghost = vec4(0.0);\n for (int i = 0; i < 4; ++i)\n {\n vec2 offset = fract(texcoord + ghostVec * float(i));\n // Only bright spots from the centre of the source image\n ghost += textureDistorted(colorTexture, offset, direction.xy, distortionVec, isSpace);\n }\n result += ghost;\n\n // sample halo\n vec2 haloVec = normalize(ghostVec) * haloWidth;\n float weightForHalo = length(vec2(0.5) - fract(texcoord + haloVec)) / length(vec2(0.5));\n weightForHalo = pow(1.0 - weightForHalo, 5.0);\n\n result += textureDistorted(colorTexture, texcoord + haloVec, direction.xy, distortionVec, isSpace) * weightForHalo * 1.5;\n\n // dirt on lens\n vec2 dirtTexCoords = (v_textureCoordinates * invPixelSize) / dirtTextureDimensions;\n if (dirtTexCoords.x > 1.0)\n {\n dirtTexCoords.x = mod(floor(dirtTexCoords.x), 2.0) == 1.0 ? 1.0 - fract(dirtTexCoords.x) : fract(dirtTexCoords.x);\n }\n if (dirtTexCoords.y > 1.0)\n {\n dirtTexCoords.y = mod(floor(dirtTexCoords.y), 2.0) == 1.0 ? 1.0 - fract(dirtTexCoords.y) : fract(dirtTexCoords.y);\n }\n result += dirtAmount * texture(dirtTexture, dirtTexCoords);\n\n // Rotating starburst texture's coordinate\n // dot(czm_view[0].xyz, vec3(0.0, 0.0, 1.0)) + dot(czm_view[1].xyz, vec3(0.0, 1.0, 0.0))\n float camrot = czm_view[0].z + czm_view[1].y;\n float cosValue = cos(camrot);\n float sinValue = sin(camrot);\n mat3 rotation = mat3(\n cosValue, -sinValue, 0.0,\n sinValue, cosValue, 0.0,\n 0.0, 0.0, 1.0\n );\n\n vec3 st1 = vec3(v_textureCoordinates * 2.0 - vec2(1.0), 1.0);\n vec3 st2 = vec3((rotation * st1).xy, 1.0);\n vec3 st3 = st2 * 0.5 + vec3(0.5);\n vec2 lensStarTexcoord = st3.xy;\n float weightForLensFlare = length(vec3(sunPos.xy, 0.0));\n float oneMinusWeightForLensFlare = max(1.0 - weightForLensFlare, 0.0);\n\n if (!isSpace)\n {\n result *= oneMinusWeightForLensFlare * intensity * 0.2;\n }\n else\n {\n result *= oneMinusWeightForLensFlare * intensity;\n result *= texture(starTexture, lensStarTexcoord) * pow(weightForLensFlare, 1.0) * max((1.0 - length(vec3(st1.xy, 0.0))), 0.0) * 2.0;\n }\n\n result += texture(colorTexture, v_textureCoordinates);\n\n out_FragColor = result;\n}\n",uniforms:{dirtTexture:(0,m.Z)("Assets/Textures/LensFlare/DirtMask.jpg"),starTexture:(0,m.Z)("Assets/Textures/LensFlare/StarBurst.jpg"),intensity:2,distortion:10,ghostDispersal:.4,haloWidth:.4,dirtAmount:.4,earthRadius:T.Z.WGS84.maximumRadius}})},dK.prototype.updateDependencies=function(){this._updateDependencies=!0},dK.prototype.update=function(e){let t=this._collection,i=this._updateDependencies,n=(0,y.Z)(t.ambientOcclusion)&&t.ambientOcclusion.enabled&&t.ambientOcclusion._isSupported(e),r=(0,y.Z)(t.bloom)&&t.bloom.enabled&&t.bloom._isSupported(e),o=(0,y.Z)(t._tonemapping)&&t._tonemapping.enabled&&t._tonemapping._isSupported(e),a=(0,y.Z)(t.fxaa)&&t.fxaa.enabled&&t.fxaa._isSupported(e),s=!(0,y.Z)(t._activeStages)||t._activeStages.length>0||n||r||o||a;if((i||!s&&this._framebuffers.length>0)&&(d1(this),this._framebuffers.length=0,this._stageNameToFramebuffer={},this._width=void 0,this._height=void 0),!i&&!s)return;0===this._framebuffers.length&&function(e,t){let i=function(e,t){let i={};if((0,y.Z)(e.ambientOcclusion)){let n=e.ambientOcclusion,r=e.bloom,o=e._tonemapping,a=e.fxaa,s=d0(e,t,i,n,void 0);s=d0(e,t,i,r,s),s=dJ(e,t,i,o,s),s=d0(e,t,i,e,s),dJ(e,t,i,a,s)}else d0(e,t,i,e,void 0);return i}(e._collection,t);for(let t in i)i.hasOwnProperty(t)&&(e._stageNameToFramebuffer[t]=function(e,t,i){let n,r;let o=e._collection.getStageByName(t),a=o._textureScale,s=o._forcePowerOfTwo,l=o._pixelFormat,c=o._pixelDatatype,u=o._clearColor,h=e._framebuffers,d=h.length;for(n=0;n<d;++n){if(a!==(r=h[n]).textureScale||s!==r.forcePowerOfTwo||l!==r.pixelFormat||c!==r.pixelDatatype||!A.Z.equals(u,r.clearColor))continue;let e=r.stages,t=e.length,o=!1;for(let n=0;n<t;++n)if(i[e[n]]){o=!0;break}if(!o)break}return(0,y.Z)(r)&&n<d?r.stages.push(t):(r={textureScale:a,forcePowerOfTwo:s,pixelFormat:l,pixelDatatype:c,clearColor:u,stages:[t],buffer:new uU.Z({pixelFormat:l,pixelDatatype:c}),clear:void 0},h.push(r)),r}(e,t,i[t]))}(this,e);let l=e.drawingBufferWidth,c=e.drawingBufferHeight,u=this._width!==l||this._height!==c;(i||u)&&(this._width=l,this._height=c,this._updateDependencies=!1,d1(this),function(e,t){let i=e._width,n=e._height,r=e._framebuffers,o=r.length;for(let e=0;e<o;++e){let o=r[e],a=o.textureScale,s=Math.ceil(i*a),l=Math.ceil(n*a),c=Math.min(s,l);o.forcePowerOfTwo&&(F.Z.isPowerOfTwo(c)||(c=F.Z.nextPowerOfTwo(c)),s=c,l=c),o.buffer.update(t,s,l),o.clear=new ae.Z({color:o.clearColor,framebuffer:o.buffer.framebuffer})}}(this,e))},dK.prototype.clear=function(e){let t=this._framebuffers;for(let i=0;i<t.length;++i)t[i].clear.execute(e)},dK.prototype.getStageByName=function(e){return this._collection.getStageByName(e)},dK.prototype.getOutputTexture=function(e){return this._collection.getOutputTexture(e)},dK.prototype.getFramebuffer=function(e){let t=this._stageNameToFramebuffer[e];if((0,y.Z)(t))return t.buffer.framebuffer},dK.prototype.isDestroyed=function(){return!1},dK.prototype.destroy=function(){return d1(this),(0,b.Z)(this)};let d2={REINHARD:0,MODIFIED_REINHARD:1,FILMIC:2,ACES:3,validate:function(e){return e===d2.REINHARD||e===d2.MODIFIED_REINHARD||e===d2.FILMIC||e===d2.ACES}};var d3=Object.freeze(d2);let d4=[];function d5(){let e=dY.createFXAAStage(),t=dY.createAmbientOcclusionStage(),i=dY.createBloomStage();this._autoExposureEnabled=!1,this._autoExposure=dY.createAutoExposureStage(),this._tonemapping=void 0,this._tonemapper=void 0,this.tonemapper=d3.ACES;let n=this._tonemapping;e.enabled=!1,t.enabled=!1,i.enabled=!1,n.enabled=!1;let r=new dK(this),o={};for(d4.push(e,t,i,n);d4.length>0;){let e=d4.pop();o[e.name]=e,e._textureCache=r;let t=e.length;if((0,y.Z)(t))for(let i=0;i<t;++i)d4.push(e.get(i))}this._stages=[],this._activeStages=[],this._previousActiveStages=[],this._randomTexture=void 0;let a=this;t.uniforms.randomTexture=function(){return a._randomTexture},this._ao=t,this._bloom=i,this._fxaa=e,this._aoEnabled=void 0,this._bloomEnabled=void 0,this._tonemappingEnabled=void 0,this._fxaaEnabled=void 0,this._activeStagesChanged=!1,this._stagesRemoved=!1,this._textureCacheDirty=!1,this._stageNames=o,this._textureCache=r}function d9(e){if(!e._stagesRemoved)return;e._stagesRemoved=!1;let t=[],i=e._stages,n=i.length;for(let e=0,r=0;e<n;++e){let n=i[e];n&&(n._index=r++,t.push(n))}e._stages=t}function d8(e){for(;(0,y.Z)(e.length);)e=e.get(e.length-1);return e.outputTexture}function d6(e,t,i,n,r){let o;if((0,y.Z)(e.execute)){e.execute(t,i,n,r);return}let a=e.length;if(e.inputPreviousStageTexture)for(d6(e.get(0),t,i,n,r),o=1;o<a;++o)d6(e.get(o),t,d8(e.get(o-1)),n,r);else for(o=0;o<a;++o)d6(e.get(o),t,i,n,r)}Object.defineProperties(d5.prototype,{ready:{get:function(){let e=!1,t=this._stages,i=t.length;for(let n=i-1;n>=0;--n){let i=t[n];e=e||i.ready&&i.enabled}let n=this._fxaa,r=this._ao,o=this._bloom,a=this._tonemapping;return(e=(e=(e=e||n.ready&&n.enabled)||r.ready&&r.enabled)||o.ready&&o.enabled)||a.ready&&a.enabled}},fxaa:{get:function(){return this._fxaa}},ambientOcclusion:{get:function(){return this._ao}},bloom:{get:function(){return this._bloom}},length:{get:function(){return d9(this),this._stages.length}},outputTexture:{get:function(){let e=this._fxaa;if(e.enabled&&e.ready)return this.getOutputTexture(e.name);let t=this._stages,i=t.length;for(let e=i-1;e>=0;--e){let i=t[e];if((0,y.Z)(i)&&i.ready&&i.enabled)return this.getOutputTexture(i.name)}let n=this._tonemapping;if(n.enabled&&n.ready)return this.getOutputTexture(n.name);let r=this._bloom;if(r.enabled&&r.ready)return this.getOutputTexture(r.name);let o=this._ao;if(o.enabled&&o.ready)return this.getOutputTexture(o.name)}},hasSelected:{get:function(){let e=this._stages.slice();for(;e.length>0;){let t=e.pop();if(!(0,y.Z)(t))continue;if((0,y.Z)(t.selected))return!0;let i=t.length;if((0,y.Z)(i))for(let n=0;n<i;++n)e.push(t.get(n))}return!1}},tonemapper:{get:function(){return this._tonemapper},set:function(e){let t;if(this._tonemapper===e)return;if(!d3.validate(e))throw new v.Z("tonemapper was set to an invalid value.");(0,y.Z)(this._tonemapping)&&(delete this._stageNames[this._tonemapping.name],this._tonemapping.destroy());let i=this._autoExposureEnabled;switch(e){case d3.REINHARD:t=dY.createReinhardTonemappingStage(i);break;case d3.MODIFIED_REINHARD:t=dY.createModifiedReinhardTonemappingStage(i);break;case d3.FILMIC:t=dY.createFilmicTonemappingStage(i);break;default:t=dY.createAcesTonemappingStage(i)}if(i){let e=this._autoExposure;t.uniforms.autoExposure=function(){return e.outputTexture}}this._tonemapper=e,this._tonemapping=t,(0,y.Z)(this._stageNames)&&(this._stageNames[t.name]=t,t._textureCache=this._textureCache),this._textureCacheDirty=!0}}}),d5.prototype.add=function(e){D.Z.typeOf.object("stage",e);let t=this._stageNames;for(d4.push(e);d4.length>0;){let e=d4.pop();if((0,y.Z)(t[e.name]))throw new v.Z(`${e.name} has already been added to the collection or does not have a unique name.`);t[e.name]=e,e._textureCache=this._textureCache;let i=e.length;if((0,y.Z)(i))for(let t=0;t<i;++t)d4.push(e.get(t))}let i=this._stages;return e._index=i.length,i.push(e),this._textureCacheDirty=!0,e},d5.prototype.remove=function(e){if(!this.contains(e))return!1;let t=this._stageNames;for(d4.push(e);d4.length>0;){let e=d4.pop();delete t[e.name];let i=e.length;if((0,y.Z)(i))for(let t=0;t<i;++t)d4.push(e.get(t))}return this._stages[e._index]=void 0,this._stagesRemoved=!0,this._textureCacheDirty=!0,e._index=void 0,e._textureCache=void 0,e.destroy(),!0},d5.prototype.contains=function(e){return(0,y.Z)(e)&&(0,y.Z)(e._index)&&e._textureCache===this._textureCache},d5.prototype.get=function(e){d9(this);let t=this._stages,i=t.length;return D.Z.typeOf.number.greaterThanOrEquals("stages length",i,0),D.Z.typeOf.number.greaterThanOrEquals("index",e,0),D.Z.typeOf.number.lessThan("index",e,i),t[e]},d5.prototype.removeAll=function(){let e=this._stages,t=e.length;for(let i=0;i<t;++i)this.remove(e[i]);e.length=0},d5.prototype.getStageByName=function(e){return this._stageNames[e]},d5.prototype.update=function(e,t,i){let n,r;d9(this);let o=this._activeStages,a=this._activeStages=this._previousActiveStages;this._previousActiveStages=o;let s=this._stages,l=a.length=s.length,c=0;for(n=0;n<l;++n)(r=s[n]).ready&&r.enabled&&r._isSupported(e)&&(a[c++]=r);a.length=c;let u=c!==o.length;if(!u){for(n=0;n<c;++n)if(a[n]!==o[n]){u=!0;break}}let h=this._ao,d=this._bloom,f=this._autoExposure,p=this._tonemapping,m=this._fxaa;p.enabled=i;let _=h.enabled&&h._isSupported(e),g=d.enabled&&d._isSupported(e),Z=p.enabled&&p._isSupported(e),b=m.enabled&&m._isSupported(e);if((u||this._textureCacheDirty||_!==this._aoEnabled||g!==this._bloomEnabled||Z!==this._tonemappingEnabled||b!==this._fxaaEnabled)&&(this._textureCache.updateDependencies(),this._aoEnabled=_,this._bloomEnabled=g,this._tonemappingEnabled=Z,this._fxaaEnabled=b,this._textureCacheDirty=!1),(0,y.Z)(this._randomTexture)&&!_&&(this._randomTexture.destroy(),this._randomTexture=void 0),!(0,y.Z)(this._randomTexture)&&_){let t=new Uint8Array(l=196608);for(n=0;n<l;n+=3)t[n]=Math.floor(255*Math.random());this._randomTexture=new eP.Z({context:e,pixelFormat:te.Z.RGB,pixelDatatype:to.Z.UNSIGNED_BYTE,source:{arrayBufferView:t,width:256,height:256},sampler:new ta.Z({wrapS:tc.Z.REPEAT,wrapT:tc.Z.REPEAT,minificationFilter:tl.Z.NEAREST,magnificationFilter:ts.Z.NEAREST})})}for(this._textureCache.update(e),m.update(e,t),h.update(e,t),d.update(e,t),p.update(e,t),this._autoExposureEnabled&&f.update(e,t),l=s.length,n=0;n<l;++n)s[n].update(e,t);for(n=0,c=0;n<l;++n)(r=s[n]).ready&&r.enabled&&r._isSupported(e)&&c++;(u=c!==a.length)&&this.update(e,t,i)},d5.prototype.clear=function(e){this._textureCache.clear(e),this._autoExposureEnabled&&this._autoExposure.clear(e)},d5.prototype.getOutputTexture=function(e){let t=this.getStageByName(e);if((0,y.Z)(t))return d8(t)},d5.prototype.execute=function(e,t,i,n){let r=this._activeStages,o=r.length,a=this._fxaa,s=this._ao,l=this._bloom,c=this._autoExposure,u=this._tonemapping,h=s.enabled&&s._isSupported(e),d=l.enabled&&l._isSupported(e),f=this._autoExposureEnabled,p=u.enabled&&u._isSupported(e),m=a.enabled&&a._isSupported(e);if(!m&&!h&&!d&&!p&&0===o)return;let _=t;h&&s.ready&&(d6(s,e,_,i,n),_=d8(s)),d&&l.ready&&(d6(l,e,_,i,n),_=d8(l)),f&&c.ready&&d6(c,e,_,i,n),p&&u.ready&&(d6(u,e,_,i,n),_=d8(u));let g=_;if(o>0){d6(r[0],e,_,i,n);for(let t=1;t<o;++t)d6(r[t],e,d8(r[t-1]),i,n);g=d8(r[o-1])}m&&a.ready&&d6(a,e,g,i,n)},d5.prototype.copy=function(e,t){if(!(0,y.Z)(this._copyColorCommand)){let t=this;this._copyColorCommand=e.createViewportQuadCommand(uH,{uniformMap:{colorTexture:function(){return t.outputTexture}},owner:this})}this._copyColorCommand.framebuffer=t,this._copyColorCommand.execute(e)},d5.prototype.isDestroyed=function(){return!1},d5.prototype.destroy=function(){return this._fxaa.destroy(),this._ao.destroy(),this._bloom.destroy(),this._autoExposure.destroy(),this._tonemapping.destroy(),this.removeAll(),this._textureCache=this._textureCache&&this._textureCache.destroy(),(0,b.Z)(this)};var d7=i(55),fe=i(7022);function ft(e){D.Z.typeOf.object("scene",e),this._scene=e,this._currentTweens=[],this._morphHandler=void 0,this._morphCancelled=!1,this._completeMorph=void 0,this._morphToOrthographic=!1}ft.prototype.completeMorph=function(){(0,y.Z)(this._completeMorph)&&this._completeMorph()},ft.prototype.morphTo2D=function(e,t){(0,y.Z)(this._completeMorph)&&this._completeMorph();let i=this._scene;this._previousMode=i.mode,this._morphToOrthographic=i.camera.frustum instanceof e$.Z,this._previousMode!==eB.Z.SCENE2D&&this._previousMode!==eB.Z.MORPHING&&(this._scene.morphStart.raiseEvent(this,this._previousMode,eB.Z.SCENE2D,!0),i._mode=eB.Z.MORPHING,i.camera._setTransform(z.Z.IDENTITY),this._previousMode===eB.Z.COLUMBUS_VIEW?function(e,t){t*=.5;let i=e._scene,n=i.camera,r=_.Z.clone(n.position,fz),o=_.Z.clone(n.direction,fB),a=_.Z.clone(n.up,fU),s=_.Z.negate(_.Z.UNIT_Z,fV),l=_.Z.clone(_.Z.UNIT_Y,fH);if(t>0)_.Z.clone(_.Z.ZERO,fk),fk.z=5*i.mapProjection.ellipsoid.maximumRadius;else{_.Z.clone(r,fk),z.Z.multiplyByPoint(sf.TRANSFORM_2D,r,fj.origin),z.Z.multiplyByPointAsVector(sf.TRANSFORM_2D,o,fj.direction);let e=i.globe;if((0,y.Z)(e)){let t=e.pickWorldCoordinates(fj,i,!0,fW);(0,y.Z)(t)&&(z.Z.multiplyByPoint(sf.TRANSFORM_2D_INVERSE,t,fk),fk.z+=_.Z.distance(r,fk))}}fG.right=.5*fk.z,fG.left=-fG.right,fG.top=fG.right*(i.drawingBufferHeight/i.drawingBufferWidth),fG.bottom=-fG.top,fq.position=fk,fq.direction=s,fq.up=l,fq.frustum=fG;let c=f5(fq);function u(e,t){e.position.z=t}f_(e,c);let h=i.tweens.add({duration:t,easingFunction:a2.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:function(e){fM(r,fk,e.time,n.position),fM(o,s,e.time,n.direction),fM(a,l,e.time,n.up),_.Z.cross(n.direction,n.up,n.right),_.Z.normalize(n.right,n.right),n._adjustOrthographicFrustum(!0)},complete:function(){fF(e,t,fq,u,c)}});e._currentTweens.push(h)}(this,e):function(e,t,i){t*=.5;let n=e._scene,r=n.camera;if(t>0)_.Z.clone(_.Z.ZERO,fX.position),fX.position.z=5*i.maximumRadius,_.Z.negate(_.Z.UNIT_Z,fX.direction),_.Z.clone(_.Z.UNIT_Y,fX.up);else{i.cartesianToCartographic(r.positionWC,fY),n.mapProjection.project(fY,fX.position),_.Z.negate(_.Z.UNIT_Z,fX.direction),_.Z.clone(_.Z.UNIT_Y,fX.up),_.Z.clone(fX.position2D,fQ.origin);let e=_.Z.clone(r.directionWC,fQ.direction),t=i.scaleToGeodeticSurface(r.positionWC,f0),o=et.Z.eastNorthUpToFixedFrame(t,i,fJ);z.Z.inverseTransformation(o,o),z.Z.multiplyByPointAsVector(o,e,e),z.Z.multiplyByPointAsVector(sf.TRANSFORM_2D,e,e);let a=n.globe;if((0,y.Z)(a)){let e=a.pickWorldCoordinates(fQ,n,!0,fK);if((0,y.Z)(e)){let t=_.Z.distance(fX.position2D,e);e.x+=t,_.Z.clone(e,fX.position2D)}}}function o(e,t){e.position.x=t}z.Z.multiplyByPoint(sf.TRANSFORM_2D,fX.position,fX.position2D),z.Z.multiplyByPointAsVector(sf.TRANSFORM_2D,fX.direction,fX.direction2D),z.Z.multiplyByPointAsVector(sf.TRANSFORM_2D,fX.up,fX.up2D);let a=fX.frustum;a.right=.5*fX.position.z,a.left=-a.right,a.top=a.right*(n.drawingBufferHeight/n.drawingBufferWidth),a.bottom=-a.top,z.Z.multiplyByPoint(sf.TRANSFORM_2D_INVERSE,fX.position2D,f$.position),_.Z.clone(fX.direction,f$.direction),_.Z.clone(fX.up,f$.up),f$.frustum=a;let s=f5(f$);f_(e,s),f2(e,t,fX,function(){fF(e,t,fX,o,s)})}(this,e,t),0===e&&(0,y.Z)(this._completeMorph)&&this._completeMorph())};let fi=new _.Z,fn=new _.Z,fr=new _.Z,fo=new _.Z,fa=new _.Z,fs=new _.Z,fl=new _.Z,fc=new C.Z,fu=new z.Z,fh=new o8,fd=new e$.Z,ff={position:void 0,direction:void 0,up:void 0,position2D:void 0,direction2D:void 0,up2D:void 0,frustum:void 0};ft.prototype.morphToColumbusView=function(e,t){let i;(0,y.Z)(this._completeMorph)&&this._completeMorph();let n=this._scene;if(this._previousMode=n.mode,this._previousMode===eB.Z.COLUMBUS_VIEW||this._previousMode===eB.Z.MORPHING)return;this._scene.morphStart.raiseEvent(this,this._previousMode,eB.Z.COLUMBUS_VIEW,!0),n.camera._setTransform(z.Z.IDENTITY);let r=fi;if(e>0)r.x=0,r.y=-1,r.z=1,r=_.Z.multiplyByScalar(_.Z.normalize(r,r),5*t.maximumRadius,r),_.Z.negate(_.Z.normalize(r,fn),fn),_.Z.cross(_.Z.UNIT_X,fn,fr);else{let e=n.camera;if(this._previousMode===eB.Z.SCENE2D)_.Z.clone(e.position,r),r.z=e.frustum.right-e.frustum.left,_.Z.negate(_.Z.UNIT_Z,fn),_.Z.clone(_.Z.UNIT_Y,fr);else{_.Z.clone(e.positionWC,r),_.Z.clone(e.directionWC,fn),_.Z.clone(e.upWC,fr);let i=t.scaleToGeodeticSurface(r,fl),o=et.Z.eastNorthUpToFixedFrame(i,t,fu);z.Z.inverseTransformation(o,o),n.mapProjection.project(t.cartesianToCartographic(r,fc),r),z.Z.multiplyByPointAsVector(o,fn,fn),z.Z.multiplyByPointAsVector(o,fr,fr)}}this._morphToOrthographic?((i=fd).width=n.camera.frustum.right-n.camera.frustum.left,i.aspectRatio=n.drawingBufferWidth/n.drawingBufferHeight):((i=fh).aspectRatio=n.drawingBufferWidth/n.drawingBufferHeight,i.fov=F.Z.toRadians(60)),ff.position=r,ff.direction=fn,ff.up=fr,ff.frustum=i;let o=function(e){let t=e._scene;t._mode=eB.Z.COLUMBUS_VIEW,t.morphTime=eB.Z.getMorphTime(eB.Z.COLUMBUS_VIEW),fg(e);let i=t.camera;(e._previousModeMode!==eB.Z.MORPHING||e._morphCancelled)&&(e._morphCancelled=!1,_.Z.clone(ff.position,i.position),_.Z.clone(ff.direction,i.direction),_.Z.clone(ff.up,i.up),_.Z.cross(i.direction,i.up,i.right),_.Z.normalize(i.right,i.right));let n=i.frustum;t.frameState.useLogDepth&&(n.near=.1,n.far=1e10);let r=(0,y.Z)(e._completeMorph);e._completeMorph=void 0,t.camera.update(t.mode),e._scene.morphComplete.raiseEvent(e,e._previousMode,eB.Z.COLUMBUS_VIEW,r)};f_(this,o),this._previousMode===eB.Z.SCENE2D?function(e,t,i,n){t*=.5;let r=e._scene,o=r.camera,a=_.Z.clone(i.position,fR),s=_.Z.clone(i.direction,fN),l=_.Z.clone(i.up,fL);function c(){o.frustum=i.frustum.clone();let c=_.Z.clone(o.position,fO),u=_.Z.clone(o.direction,fD),h=_.Z.clone(o.up,fP);c.z=a.z;let d=r.tweens.add({duration:t,easingFunction:a2.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:function(e){fM(c,a,e.time,o.position),fM(u,s,e.time,o.direction),fM(h,l,e.time,o.up),_.Z.cross(o.direction,o.up,o.right),_.Z.normalize(o.right,o.right)},complete:function(){n(e)}});e._currentTweens.push(d)}r._mode=eB.Z.MORPHING,e._morphToOrthographic?c():f1(e,0,i,c)}(this,e,ff,o):(ff.position2D=z.Z.multiplyByPoint(sf.TRANSFORM_2D,r,fo),ff.direction2D=z.Z.multiplyByPointAsVector(sf.TRANSFORM_2D,fn,fa),ff.up2D=z.Z.multiplyByPointAsVector(sf.TRANSFORM_2D,fr,fs),n._mode=eB.Z.MORPHING,f2(this,e,ff,o)),0===e&&(0,y.Z)(this._completeMorph)&&this._completeMorph()};let fp={position:new _.Z,direction:new _.Z,up:new _.Z,frustum:void 0},fm=new o8;function f_(e,t){if(e._scene.completeMorphOnUserInput){e._morphHandler=new d7.Z(e._scene.canvas);let i=function(){e._morphCancelled=!0,e._scene.camera.cancelFlight(),t(e)};e._completeMorph=i,e._morphHandler.setInputAction(i,fe.Z.LEFT_DOWN),e._morphHandler.setInputAction(i,fe.Z.MIDDLE_DOWN),e._morphHandler.setInputAction(i,fe.Z.RIGHT_DOWN),e._morphHandler.setInputAction(i,fe.Z.WHEEL)}}function fg(e){let t=e._currentTweens;for(let e=0;e<t.length;++e)t[e].cancelTween();e._currentTweens.length=0,e._morphHandler=e._morphHandler&&e._morphHandler.destroy()}ft.prototype.morphTo3D=function(e,t){(0,y.Z)(this._completeMorph)&&this._completeMorph();let i=this._scene;if(this._previousMode=i.mode,this._previousMode!==eB.Z.SCENE3D&&this._previousMode!==eB.Z.MORPHING){if(this._scene.morphStart.raiseEvent(this,this._previousMode,eB.Z.SCENE3D,!0),i._mode=eB.Z.MORPHING,i.camera._setTransform(z.Z.IDENTITY),this._previousMode===eB.Z.SCENE2D)(function(e,t,i){let n,r,o;t/=3;let a=e._scene,s=a.camera;t>0?(n=fp,_.Z.fromDegrees(0,0,5*i.maximumRadius,i,n.position),_.Z.negate(n.position,n.direction),_.Z.normalize(n.direction,n.direction),_.Z.clone(_.Z.UNIT_Z,n.up)):(s.position.z=s.frustum.right-s.frustum.left,n=fv(e,i)),e._morphToOrthographic?((r=fI).aspectRatio=a.drawingBufferWidth/a.drawingBufferHeight,r.width=s.frustum.right-s.frustum.left):((r=fm).aspectRatio=a.drawingBufferWidth/a.drawingBufferHeight,r.fov=F.Z.toRadians(60)),n.frustum=r;let l=f4(n);f_(e,l),o=e._morphToOrthographic?function(){fA(e,t,n,l)}:function(){f1(e,t,n,function(){fA(e,t,n,l)})},t>0?(a._mode=eB.Z.SCENE2D,s.flyTo({duration:t,destination:_.Z.fromDegrees(0,0,5*i.maximumRadius,i,fR),complete:function(){a._mode=eB.Z.MORPHING,o()}})):o()})(this,e,t);else{let n,r;e>0?(n=fp,_.Z.fromDegrees(0,0,5*t.maximumRadius,t,n.position),_.Z.negate(n.position,n.direction),_.Z.normalize(n.direction,n.direction),_.Z.clone(_.Z.UNIT_Z,n.up)):n=fv(this,t);let o=i.camera;o.frustum instanceof e$.Z?r=o.frustum.clone():((r=fm).aspectRatio=i.drawingBufferWidth/i.drawingBufferHeight,r.fov=F.Z.toRadians(60)),n.frustum=r;let a=f4(n);f_(this,a),fA(this,e,n,a)}0===e&&(0,y.Z)(this._completeMorph)&&this._completeMorph()}},ft.prototype.isDestroyed=function(){return!1},ft.prototype.destroy=function(){return fg(this),(0,b.Z)(this)};let fZ=new C.Z,fy=new _.Z,fb=new z.Z;function fv(e,t){let i=e._scene,n=i.camera,r=fp.position,o=fp.direction,a=fp.up,s=i.mapProjection.unproject(n.position,fZ);t.cartographicToCartesian(s,r);let l=t.scaleToGeodeticSurface(r,fy),c=et.Z.eastNorthUpToFixedFrame(l,t,fb);return z.Z.multiplyByPointAsVector(c,n.direction,o),z.Z.multiplyByPointAsVector(c,n.up,a),fp}let fT=new _.Z,fE=new _.Z,fx=new _.Z,fw=new _.Z,fS=new _.Z,fC=new _.Z;function fA(e,t,i,n){t*=.5;let r=e._scene,o=r.camera,a=_.Z.clone(o.position,fT),s=_.Z.clone(o.direction,fE),l=_.Z.clone(o.up,fx),c=z.Z.multiplyByPoint(sf.TRANSFORM_2D_INVERSE,i.position,fw),u=z.Z.multiplyByPointAsVector(sf.TRANSFORM_2D_INVERSE,i.direction,fS),h=z.Z.multiplyByPointAsVector(sf.TRANSFORM_2D_INVERSE,i.up,fC),d=r.tweens.add({duration:t,easingFunction:a2.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:function(e){fM(a,c,e.time,o.position),fM(s,u,e.time,o.direction),fM(l,h,e.time,o.up),_.Z.cross(o.direction,o.up,o.right),_.Z.normalize(o.right,o.right)},complete:function(){f3(e,r,0,1,t,n)}});e._currentTweens.push(d)}let fI=new e$.Z,fO=new _.Z,fD=new _.Z,fP=new _.Z,fR=new _.Z,fN=new _.Z,fL=new _.Z;function fM(e,t,i,n){return _.Z.lerp(e,t,i,n)}function fF(e,t,i,n,r){let o=e._scene,a=o.camera;if(a.frustum instanceof e$.Z)return;let s=a.frustum.fov,l=.5*F.Z.RADIANS_PER_DEGREE,c=i.position.z*Math.tan(.5*s);a.frustum.far=c/Math.tan(.5*l)+1e7;let u=o.tweens.add({duration:t,easingFunction:a2.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:function(e){a.frustum.fov=F.Z.lerp(s,l,e.time);let t=c/Math.tan(.5*a.frustum.fov);n(a,t)},complete:function(){a.frustum=i.frustum.clone(),r(e)}});e._currentTweens.push(u)}let fz=new _.Z,fB=new _.Z,fU=new _.Z,fk=new _.Z,fV=new _.Z,fH=new _.Z,fG=new rc.Z,fj=new eI.Z,fW=new _.Z,fq={position:void 0,direction:void 0,up:void 0,frustum:void 0},fY=new C.Z,fX={position:new _.Z,direction:new _.Z,up:new _.Z,position2D:new _.Z,direction2D:new _.Z,up2D:new _.Z,frustum:new rc.Z},f$={position:new _.Z,direction:new _.Z,up:new _.Z,frustum:void 0},fK=new _.Z,fQ=new eI.Z,fJ=new z.Z,f0=new _.Z;function f1(e,t,i,n){let r=e._scene,o=r.camera,a=o.frustum.right-o.frustum.left;o.frustum=i.frustum.clone();let s=o.frustum.fov,l=.5*F.Z.RADIANS_PER_DEGREE,c=a*Math.tan(.5*s);o.frustum.far=c/Math.tan(.5*l)+1e7,o.frustum.fov=l;let u=r.tweens.add({duration:t,easingFunction:a2.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:function(e){o.frustum.fov=F.Z.lerp(l,s,e.time),o.position.z=c/Math.tan(.5*o.frustum.fov)},complete:function(){n(e)}});e._currentTweens.push(u)}function f2(e,t,i,n){let r=e._scene,o=r.camera,a=_.Z.clone(o.position,fO),s=_.Z.clone(o.direction,fD),l=_.Z.clone(o.up,fP),c=_.Z.clone(i.position2D,fR),u=_.Z.clone(i.direction2D,fN),h=_.Z.clone(i.up2D,fL),d=r.tweens.add({duration:t,easingFunction:a2.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:function(e){fM(a,c,e.time,o.position),fM(s,u,e.time,o.direction),fM(l,h,e.time,o.up),_.Z.cross(o.direction,o.up,o.right),_.Z.normalize(o.right,o.right),o._adjustOrthographicFrustum(!0)},complete:function(){f3(e,r,1,0,t,n)}});e._currentTweens.push(d)}function f3(e,t,i,n,r,o){let a={object:t,property:"morphTime",startValue:i,stopValue:n,duration:r,easingFunction:a2.QUARTIC_OUT};(0,y.Z)(o)&&(a.complete=function(){o(e)});let s=t.tweens.addProperty(a);e._currentTweens.push(s)}function f4(e){return function(t){let i=t._scene;i._mode=eB.Z.SCENE3D,i.morphTime=eB.Z.getMorphTime(eB.Z.SCENE3D),fg(t);let n=i.camera;(t._previousMode!==eB.Z.MORPHING||t._morphCancelled)&&(t._morphCancelled=!1,_.Z.clone(e.position,n.position),_.Z.clone(e.direction,n.direction),_.Z.clone(e.up,n.up),_.Z.cross(n.direction,n.up,n.right),_.Z.normalize(n.right,n.right),n.frustum=e.frustum.clone());let r=n.frustum;i.frameState.useLogDepth&&(r.near=.1,r.far=1e10);let o=(0,y.Z)(t._completeMorph);t._completeMorph=void 0,i.camera.update(i.mode),t._scene.morphComplete.raiseEvent(t,t._previousMode,eB.Z.SCENE3D,o)}}function f5(e){return function(t){let i=t._scene;i._mode=eB.Z.SCENE2D,i.morphTime=eB.Z.getMorphTime(eB.Z.SCENE2D),fg(t);let n=i.camera;_.Z.clone(e.position,n.position),n.position.z=2*i.mapProjection.ellipsoid.maximumRadius,_.Z.clone(e.direction,n.direction),_.Z.clone(e.up,n.up),_.Z.cross(n.direction,n.up,n.right),_.Z.normalize(n.right,n.right),n.frustum=e.frustum.clone();let r=(0,y.Z)(t._completeMorph);t._completeMorph=void 0,i.camera.update(i.mode),t._scene.morphComplete.raiseEvent(t,t._previousMode,eB.Z.SCENE2D,r)}}var f9=i(948),f8=i(6222),f6=Object.freeze({LEFT_DRAG:0,RIGHT_DRAG:1,MIDDLE_DRAG:2,WHEEL:3,PINCH:4});function f7(e,t){let i=e;return(0,y.Z)(t)&&(i+=`+${t}`),i}function pe(e,t,i){let n=f7(f6.PINCH,t),r=e._update,o=e._isDown,a=e._eventStartPosition,s=e._pressTime,l=e._releaseTime;r[n]=!0,o[n]=!1,a[n]=new L.Z;let c=e._movement[n];(0,y.Z)(c)||(c=e._movement[n]={}),c.distance={startPosition:new L.Z,endPosition:new L.Z},c.angleAndHeight={startPosition:new L.Z,endPosition:new L.Z},c.prevAngle=0,e._eventHandler.setInputAction(function(t){e._buttonsDown++,o[n]=!0,s[n]=new Date,L.Z.lerp(t.position1,t.position2,.5,a[n])},fe.Z.PINCH_START,t),e._eventHandler.setInputAction(function(){e._buttonsDown=Math.max(e._buttonsDown-1,0),o[n]=!1,l[n]=new Date},fe.Z.PINCH_END,t),e._eventHandler.setInputAction(function(e){if(o[n]){if(r[n]){var t;t=c,L.Z.clone(e.distance.startPosition,t.distance.startPosition),L.Z.clone(e.distance.endPosition,t.distance.endPosition),L.Z.clone(e.angleAndHeight.startPosition,t.angleAndHeight.startPosition),L.Z.clone(e.angleAndHeight.endPosition,t.angleAndHeight.endPosition),r[n]=!1,c.prevAngle=c.angleAndHeight.startPosition.x}else L.Z.clone(e.distance.endPosition,c.distance.endPosition),L.Z.clone(e.angleAndHeight.endPosition,c.angleAndHeight.endPosition);let o=c.angleAndHeight.endPosition.x,a=c.prevAngle,s=2*Math.PI;for(;o>=a+Math.PI;)o-=s;for(;o<a-Math.PI;)o+=s;c.angleAndHeight.endPosition.x=-o*i.clientWidth/12,c.angleAndHeight.startPosition.x=-a*i.clientWidth/12}},fe.Z.PINCH_MOVE,t)}function pt(e,t){let i=f7(f6.WHEEL,t),n=e._pressTime,r=e._releaseTime,o=e._update;o[i]=!0;let a=e._movement[i];(0,y.Z)(a)||(a=e._movement[i]={});let s=e._lastMovement[i];(0,y.Z)(s)||(s=e._lastMovement[i]={startPosition:new L.Z,endPosition:new L.Z,valid:!1}),a.startPosition=new L.Z,L.Z.clone(L.Z.ZERO,a.startPosition),a.endPosition=new L.Z,e._eventHandler.setInputAction(function(e){let t=7.5*F.Z.toRadians(e);n[i]=r[i]=new Date,a.endPosition.x=0,a.endPosition.y=t,L.Z.clone(a.endPosition,s.endPosition),s.valid=!0,o[i]=!1},fe.Z.WHEEL,t)}function pi(e,t,i){let n,r;let o=f7(i,t),a=e._isDown,s=e._eventStartPosition,l=e._pressTime,c=e._releaseTime;a[o]=!1,s[o]=new L.Z;let u=e._lastMovement[o];(0,y.Z)(u)||(u=e._lastMovement[o]={startPosition:new L.Z,endPosition:new L.Z,valid:!1}),i===f6.LEFT_DRAG?(n=fe.Z.LEFT_DOWN,r=fe.Z.LEFT_UP):i===f6.RIGHT_DRAG?(n=fe.Z.RIGHT_DOWN,r=fe.Z.RIGHT_UP):i===f6.MIDDLE_DRAG&&(n=fe.Z.MIDDLE_DOWN,r=fe.Z.MIDDLE_UP),e._eventHandler.setInputAction(function(t){e._buttonsDown++,u.valid=!1,a[o]=!0,l[o]=new Date,L.Z.clone(t.position,s[o])},n,t),e._eventHandler.setInputAction(function(){e._buttonsDown=Math.max(e._buttonsDown-1,0),a[o]=!1,c[o]=new Date},r,t)}function pn(e,t){L.Z.clone(e.startPosition,t.startPosition),L.Z.clone(e.endPosition,t.endPosition)}function pr(e,t){let i=e._update,n=e._movement,r=e._lastMovement,o=e._isDown;for(let n in f6)if(f6.hasOwnProperty(n)){let r=f6[n];if((0,y.Z)(r)){let n=f7(r,t);i[n]=!0,(0,y.Z)(e._lastMovement[n])||(e._lastMovement[n]={startPosition:new L.Z,endPosition:new L.Z,valid:!1}),(0,y.Z)(e._movement[n])||(e._movement[n]={startPosition:new L.Z,endPosition:new L.Z})}}e._eventHandler.setInputAction(function(a){for(let e in f6)if(f6.hasOwnProperty(e)){let s=f6[e];if((0,y.Z)(s)){let e=f7(s,t);o[e]&&(i[e]?(pn(n[e],r[e]),r[e].valid=!0,pn(a,n[e]),i[e]=!1):L.Z.clone(a.endPosition,n[e].endPosition))}}L.Z.clone(a.endPosition,e._currentMousePosition)},fe.Z.MOUSE_MOVE,t)}function po(e){if(!(0,y.Z)(e))throw new v.Z("canvas is required.");for(let t in this._eventHandler=new d7.Z(e),this._update={},this._movement={},this._lastMovement={},this._isDown={},this._eventStartPosition={},this._pressTime={},this._releaseTime={},this._buttonsDown=0,this._currentMousePosition=new L.Z,pt(this,void 0),pe(this,void 0,e),pi(this,void 0,f6.LEFT_DRAG),pi(this,void 0,f6.RIGHT_DRAG),pi(this,void 0,f6.MIDDLE_DRAG),pr(this,void 0),f9.Z)if(f9.Z.hasOwnProperty(t)){let i=f9.Z[t];(0,y.Z)(i)&&(pt(this,i),pe(this,i,e),pi(this,i,f6.LEFT_DRAG),pi(this,i,f6.RIGHT_DRAG),pi(this,i,f6.MIDDLE_DRAG),pr(this,i))}}function pa(e,t,i,n,r,o,a,s,l,c){this._tweens=e,this._tweenjs=t,this._startObject=(0,eG.Z)(i),this._stopObject=(0,eG.Z)(n),this._duration=r,this._delay=o,this._easingFunction=a,this._update=s,this._complete=l,this.cancel=c,this.needsStart=!0}function ps(){this._tweens=[]}function pl(e){if(!(0,y.Z)(e))throw new v.Z("scene is required.");this.enableInputs=!0,this.enableTranslate=!0,this.enableZoom=!0,this.enableRotate=!0,this.enableTilt=!0,this.enableLook=!0,this.inertiaSpin=.9,this.inertiaTranslate=.9,this.inertiaZoom=.8,this.maximumMovementRatio=.1,this.bounceAnimationTime=3,this.minimumZoomDistance=1,this.maximumZoomDistance=Number.POSITIVE_INFINITY,this.translateEventTypes=f6.LEFT_DRAG,this.zoomEventTypes=[f6.RIGHT_DRAG,f6.WHEEL,f6.PINCH],this.rotateEventTypes=f6.LEFT_DRAG,this.tiltEventTypes=[f6.MIDDLE_DRAG,f6.PINCH,{eventType:f6.LEFT_DRAG,modifier:f9.Z.CTRL},{eventType:f6.RIGHT_DRAG,modifier:f9.Z.CTRL}],this.lookEventTypes={eventType:f6.LEFT_DRAG,modifier:f9.Z.SHIFT},this.minimumPickingTerrainHeight=15e4,this._minimumPickingTerrainHeight=this.minimumPickingTerrainHeight,this.minimumPickingTerrainDistanceWithInertia=4e3,this.minimumCollisionTerrainHeight=15e3,this._minimumCollisionTerrainHeight=this.minimumCollisionTerrainHeight,this.minimumTrackBallHeight=75e5,this._minimumTrackBallHeight=this.minimumTrackBallHeight,this.enableCollisionDetection=!0,this._scene=e,this._globe=void 0,this._ellipsoid=void 0,this._lastGlobeHeight=0,this._aggregator=new po(e.canvas),this._lastInertiaSpinMovement=void 0,this._lastInertiaZoomMovement=void 0,this._lastInertiaTranslateMovement=void 0,this._lastInertiaTiltMovement=void 0,this._inertiaDisablers={_lastInertiaZoomMovement:["_lastInertiaSpinMovement","_lastInertiaTranslateMovement","_lastInertiaTiltMovement"],_lastInertiaTiltMovement:["_lastInertiaSpinMovement","_lastInertiaTranslateMovement"]},this._tweens=new ps,this._tween=void 0,this._horizontalRotationAxis=void 0,this._tiltCenterMousePosition=new L.Z(-1,-1),this._tiltCenter=new _.Z,this._rotateMousePosition=new L.Z(-1,-1),this._rotateStartPosition=new _.Z,this._strafeStartPosition=new _.Z,this._strafeMousePosition=new L.Z,this._strafeEndMousePosition=new L.Z,this._zoomMouseStart=new L.Z(-1,-1),this._zoomWorldPosition=new _.Z,this._useZoomWorldPosition=!1,this._panLastMousePosition=new L.Z,this._panLastWorldPosition=new _.Z,this._tiltCVOffMap=!1,this._looking=!1,this._rotating=!1,this._strafing=!1,this._zoomingOnVector=!1,this._zoomingUnderground=!1,this._rotatingZoom=!1,this._adjustedHeightForTerrain=!1,this._cameraUnderground=!1;let t=e.mapProjection;this._maxCoord=t.project(new C.Z(Math.PI,F.Z.PI_OVER_TWO)),this._zoomFactor=5,this._rotateFactor=void 0,this._rotateRateRangeAdjustment=void 0,this._maximumRotateRate=1.77,this._minimumRotateRate=2e-4,this._minimumZoomRate=20,this._maximumZoomRate=5906376272e3,this._minimumUndergroundPickDistance=2e3,this._maximumUndergroundPickDistance=1e4}Object.defineProperties(po.prototype,{currentMousePosition:{get:function(){return this._currentMousePosition}},anyButtonDown:{get:function(){let e=!this._update[f7(f6.WHEEL)]||!this._update[f7(f6.WHEEL,f9.Z.SHIFT)]||!this._update[f7(f6.WHEEL,f9.Z.CTRL)]||!this._update[f7(f6.WHEEL,f9.Z.ALT)];return this._buttonsDown>0||e}}}),po.prototype.isMoving=function(e,t){if(!(0,y.Z)(e))throw new v.Z("type is required.");let i=f7(e,t);return!this._update[i]},po.prototype.getMovement=function(e,t){if(!(0,y.Z)(e))throw new v.Z("type is required.");let i=f7(e,t);return this._movement[i]},po.prototype.getLastMovement=function(e,t){if(!(0,y.Z)(e))throw new v.Z("type is required.");let i=f7(e,t),n=this._lastMovement[i];if(n.valid)return n},po.prototype.isButtonDown=function(e,t){if(!(0,y.Z)(e))throw new v.Z("type is required.");let i=f7(e,t);return this._isDown[i]},po.prototype.getStartMousePosition=function(e,t){if(!(0,y.Z)(e))throw new v.Z("type is required.");if(e===f6.WHEEL)return this._currentMousePosition;let i=f7(e,t);return this._eventStartPosition[i]},po.prototype.getButtonPressTime=function(e,t){if(!(0,y.Z)(e))throw new v.Z("type is required.");let i=f7(e,t);return this._pressTime[i]},po.prototype.getButtonReleaseTime=function(e,t){if(!(0,y.Z)(e))throw new v.Z("type is required.");let i=f7(e,t);return this._releaseTime[i]},po.prototype.reset=function(){for(let e in this._update)this._update.hasOwnProperty(e)&&(this._update[e]=!0)},po.prototype.isDestroyed=function(){return!1},po.prototype.destroy=function(){return this._eventHandler=this._eventHandler&&this._eventHandler.destroy(),(0,b.Z)(this)},Object.defineProperties(pa.prototype,{startObject:{get:function(){return this._startObject}},stopObject:{get:function(){return this._stopObject}},duration:{get:function(){return this._duration}},delay:{get:function(){return this._delay}},easingFunction:{get:function(){return this._easingFunction}},update:{get:function(){return this._update}},complete:{get:function(){return this._complete}},tweenjs:{get:function(){return this._tweenjs}}}),pa.prototype.cancelTween=function(){this._tweens.remove(this)},Object.defineProperties(ps.prototype,{length:{get:function(){return this._tweens.length}}}),ps.prototype.add=function(e){if(e=(0,Z.Z)(e,Z.Z.EMPTY_OBJECT),!(0,y.Z)(e.startObject)||!(0,y.Z)(e.stopObject))throw new v.Z("options.startObject and options.stopObject are required.");if(!(0,y.Z)(e.duration)||e.duration<0)throw new v.Z("options.duration is required and must be positive.");if(0===e.duration)return(0,y.Z)(e.complete)&&e.complete(),new pa(this);let t=e.duration/rH.Z.SECONDS_PER_MILLISECOND,i=(0,Z.Z)(e.delay,0),n=i/rH.Z.SECONDS_PER_MILLISECOND,r=(0,Z.Z)(e.easingFunction,a2.LINEAR_NONE),o=e.startObject,a=new a1(o);a.to((0,eG.Z)(e.stopObject),t),a.delay(n),a.easing(r),(0,y.Z)(e.update)&&a.onUpdate(function(){e.update(o)}),a.onComplete((0,Z.Z)(e.complete,null)),a.repeat((0,Z.Z)(e._repeat,0));let s=new pa(this,a,e.startObject,e.stopObject,e.duration,i,r,e.update,e.complete,e.cancel);return this._tweens.push(s),s},ps.prototype.addProperty=function(e){let t=(e=(0,Z.Z)(e,Z.Z.EMPTY_OBJECT)).object,i=e.property,n=e.startValue,r=e.stopValue;if(!(0,y.Z)(t)||!(0,y.Z)(e.property))throw new v.Z("options.object and options.property are required.");if(!(0,y.Z)(t[i]))throw new v.Z("options.object must have the specified property.");if(!(0,y.Z)(n)||!(0,y.Z)(r))throw new v.Z("options.startValue and options.stopValue are required.");return this.add({startObject:{value:n},stopObject:{value:r},duration:(0,Z.Z)(e.duration,3),delay:e.delay,easingFunction:e.easingFunction,update:function(e){t[i]=e.value},complete:e.complete,cancel:e.cancel,_repeat:e._repeat})},ps.prototype.addAlpha=function(e){let t=(e=(0,Z.Z)(e,Z.Z.EMPTY_OBJECT)).material;if(!(0,y.Z)(t))throw new v.Z("options.material is required.");let i=[];for(let e in t.uniforms)t.uniforms.hasOwnProperty(e)&&(0,y.Z)(t.uniforms[e])&&(0,y.Z)(t.uniforms[e].alpha)&&i.push(e);if(0===i.length)throw new v.Z("material has no properties with alpha components.");return this.add({startObject:{alpha:(0,Z.Z)(e.startValue,0)},stopObject:{alpha:(0,Z.Z)(e.stopValue,1)},duration:(0,Z.Z)(e.duration,3),delay:e.delay,easingFunction:e.easingFunction,update:function(e){let n=i.length;for(let r=0;r<n;++r)t.uniforms[i[r]].alpha=e.alpha},complete:e.complete,cancel:e.cancel})},ps.prototype.addOffsetIncrement=function(e){let t=(e=(0,Z.Z)(e,Z.Z.EMPTY_OBJECT)).material;if(!(0,y.Z)(t))throw new v.Z("material is required.");if(!(0,y.Z)(t.uniforms.offset))throw new v.Z("material.uniforms must have an offset property.");let i=t.uniforms;return this.addProperty({object:i,property:"offset",startValue:i.offset,stopValue:i.offset+1,duration:e.duration,delay:e.delay,easingFunction:e.easingFunction,update:e.update,cancel:e.cancel,_repeat:1/0})},ps.prototype.remove=function(e){if(!(0,y.Z)(e))return!1;let t=this._tweens.indexOf(e);return -1!==t&&(e.tweenjs.stop(),(0,y.Z)(e.cancel)&&e.cancel(),this._tweens.splice(t,1),!0)},ps.prototype.removeAll=function(){let e=this._tweens;for(let t=0;t<e.length;++t){let i=e[t];i.tweenjs.stop(),(0,y.Z)(i.cancel)&&i.cancel()}e.length=0},ps.prototype.contains=function(e){return(0,y.Z)(e)&&-1!==this._tweens.indexOf(e)},ps.prototype.get=function(e){if(!(0,y.Z)(e))throw new v.Z("index is required.");return this._tweens[e]},ps.prototype.update=function(e){let t=this._tweens,i=0;for(e=(0,y.Z)(e)?e/rH.Z.SECONDS_PER_MILLISECOND:(0,rl.Z)();i<t.length;){let n=t[i],r=n.tweenjs;n.needsStart?(n.needsStart=!1,r.start(e)):r.update(e)?i++:(r.stop(),t.splice(i,1))}};let pc=[];function pu(e,t,i,n,r,o){if(!(0,y.Z)(i))return;let a=e._aggregator;Array.isArray(i)||(pc[0]=i,i=pc);let s=i.length;for(let l=0;l<s;++l){let s=i[l],c=(0,y.Z)(s.eventType)?s.eventType:s,u=s.modifier,h=a.isMoving(c,u)&&a.getMovement(c,u),d=a.getStartMousePosition(c,u);e.enableInputs&&t&&(h?(n(e,d,h),function(e,t){if((0,y.Z)(t)){let i=e[t];(0,y.Z)(i)&&(i.inertiaEnabled=!0);let n=e._inertiaDisablers[t];if((0,y.Z)(n)){let t=n.length;for(let r=0;r<t;++r)i=e[n[r]],(0,y.Z)(i)&&(i.inertiaEnabled=!1)}}}(e,o)):r<1&&function(e,t,i,n,r,o,a){let s=o[a];(0,y.Z)(s)||(s=o[a]={startPosition:new L.Z,endPosition:new L.Z,motion:new L.Z,inertiaEnabled:!0});let l=e.getButtonPressTime(t,i),c=e.getButtonReleaseTime(t,i),u=l&&c&&(c.getTime()-l.getTime())/1e3,h=new Date,d=c&&(h.getTime()-c.getTime())/1e3;if(l&&c&&u<.4){let a=d<0?0:Math.exp(-((1-n)*25)*d),l=e.getLastMovement(t,i);if(!(0,y.Z)(l)||L.Z.equalsEpsilon(l.startPosition,l.endPosition,F.Z.EPSILON14)||!s.inertiaEnabled||(s.motion.x=(l.endPosition.x-l.startPosition.x)*.5,s.motion.y=(l.endPosition.y-l.startPosition.y)*.5,s.startPosition=L.Z.clone(l.startPosition,s.startPosition),s.endPosition=L.Z.multiplyByScalar(s.motion,a,s.endPosition),s.endPosition=L.Z.add(s.startPosition,s.endPosition,s.endPosition),isNaN(s.endPosition.x)||isNaN(s.endPosition.y)||.5>L.Z.distance(s.startPosition,s.endPosition)))return;e.isButtonDown(t,i)||r(o,e.getStartMousePosition(t,i),s)}}(a,c,u,r,n,e,o))}}let ph=new eI.Z,pd=new _.Z,pf=new L.Z,pp=new _.Z,pm=new L.Z,p_=new _.Z,pg=new _.Z,pZ=new _.Z,py=new _.Z,pb=new _.Z,pv=new _.Z,pT=new _.Z,pE=new _.Z,px=new _.Z,pw=new _.Z,pS=new _.Z,pC=new _.Z,pA=new _.Z,pI=new _.Z,pO=new _.Z,pD=new _.Z,pP=new _.Z,pR=new _.Z,pN={orientation:new a5.Z};function pL(e,t,i,n,r,o){let a,s=1;(0,y.Z)(o)&&(s=F.Z.clamp(Math.abs(o),.25,1));let l=i.endPosition.y-i.startPosition.y,c=l>0?e.minimumZoomDistance*s:0,u=e.maximumZoomDistance,h=n*(r-c);h=F.Z.clamp(h,e._minimumZoomRate,e._maximumZoomRate);let d=l/e._scene.canvas.clientHeight,f=h*(d=Math.min(d,e.maximumMovementRatio));if(e.enableCollisionDetection||0===e.minimumZoomDistance||!(0,y.Z)(e._globe)){if(f>0&&1>Math.abs(r-c)||f<0&&1>Math.abs(r-u))return;r-f<c?f=r-c-1:r-f>u&&(f=r-u)}let p=e._scene,m=p.camera,g=p.mode,b=pN.orientation;if(b.heading=m.heading,b.pitch=m.pitch,b.roll=m.roll,m.frustum instanceof e$.Z){Math.abs(f)>0&&(m.zoomIn(f),m._adjustOrthographicFrustum(!0));return}let v=(0,Z.Z)(i.inertiaEnabled,L.Z.equals(t,e._zoomMouseStart)),T=e._zoomingOnVector,E=e._rotatingZoom;if(v||(e._zoomMouseStart=L.Z.clone(t,e._zoomMouseStart),(0,y.Z)(e._globe)&&g===eB.Z.SCENE2D?(a=m.getPickRay(t,ph).origin,a=_.Z.fromElements(a.y,a.z,a.x)):(0,y.Z)(e._globe)&&(a=pq(e,t,pd)),(0,y.Z)(a)?(e._useZoomWorldPosition=!0,e._zoomWorldPosition=_.Z.clone(a,e._zoomWorldPosition)):e._useZoomWorldPosition=!1,T=e._zoomingOnVector=!1,E=e._rotatingZoom=!1,e._zoomingUnderground=e._cameraUnderground),!e._useZoomWorldPosition){m.zoomIn(f);return}let x=g===eB.Z.COLUMBUS_VIEW;if(m.positionCartographic.height<2e6&&(E=!0),!v||E){if(g===eB.Z.SCENE2D){let i=e._zoomWorldPosition,n=m.position;if(!_.Z.equals(i,n)&&m.positionCartographic.height<2*e._maxCoord.x){let r=m.position.x,o=_.Z.subtract(i,n,pp);_.Z.normalize(o,o);let s=_.Z.distance(i,n)*f/(.5*m.getMagnitude());m.move(o,.5*s),(m.position.x<0&&r>0||m.position.x>0&&r<0)&&(a=m.getPickRay(t,ph).origin,a=_.Z.fromElements(a.y,a.z,a.x),e._zoomWorldPosition=_.Z.clone(a,e._zoomWorldPosition))}}else if(g===eB.Z.SCENE3D){let t=_.Z.normalize(m.position,pb);if(e._cameraUnderground||e._zoomingUnderground||m.positionCartographic.height<3e3&&.6>Math.abs(_.Z.dot(m.direction,t)))x=!0;else{let i=p.canvas;pm.x=i.clientWidth/2,pm.y=i.clientHeight/2;let n=pq(e,pm,p_);if((0,y.Z)(n)){if(m.positionCartographic.height<1e6){if(_.Z.dot(m.direction,t)>=-.5)x=!0;else{_.Z.clone(m.position,pT);let i=e._zoomWorldPosition,n=pv;if(n=_.Z.normalize(i,n),0>_.Z.dot(n,t))return;_.Z.clone(m.direction,pw),_.Z.add(pT,_.Z.multiplyByScalar(pw,1e3,pD),pO),_.Z.subtract(i,pT,pS),_.Z.normalize(pS,pC);let r=_.Z.dot(t,pC);if(r>=0){e._zoomMouseStart.x=-1;return}let o=Math.acos(-r),a=_.Z.magnitude(pT),s=_.Z.magnitude(i),l=a-f,c=_.Z.magnitude(pS),u=Math.asin(F.Z.clamp(c/s*Math.sin(o),-1,1))-Math.asin(F.Z.clamp(l/s*Math.sin(o),-1,1))+o;_.Z.normalize(pT,pE);let h=px;h=_.Z.cross(pC,pE,h),h=_.Z.normalize(h,h),_.Z.normalize(_.Z.cross(pE,h,pD),pw),_.Z.multiplyByScalar(_.Z.normalize(pO,pD),_.Z.magnitude(pO)-f,pO),_.Z.normalize(pT,pT),_.Z.multiplyByScalar(pT,l,pT),_.Z.multiplyByScalar(_.Z.add(_.Z.multiplyByScalar(pE,Math.cos(u)-1,pP),_.Z.multiplyByScalar(pw,Math.sin(u),pR),pD),l,pA),_.Z.add(pT,pA,pT),_.Z.normalize(pO,pE),_.Z.normalize(_.Z.cross(pE,h,pD),pw),_.Z.multiplyByScalar(_.Z.add(_.Z.multiplyByScalar(pE,Math.cos(u)-1,pP),_.Z.multiplyByScalar(pw,Math.sin(u),pR),pD),_.Z.magnitude(pO),pI),_.Z.add(pO,pI,pO),_.Z.clone(pT,m.position),_.Z.normalize(_.Z.subtract(pO,pT,pD),m.direction),_.Z.clone(m.direction,m.direction),_.Z.cross(m.direction,m.up,m.right),_.Z.cross(m.right,m.direction,m.up),m.setView(pN);return}}else{let t=_.Z.normalize(n,pg),i=_.Z.normalize(e._zoomWorldPosition,pZ),r=_.Z.dot(i,t);if(r>0&&r<1){let e=F.Z.acosClamped(r),n=_.Z.cross(i,t,py),o=Math.abs(e)>F.Z.toRadians(20)?.75*m.positionCartographic.height:m.positionCartographic.height-f,a=f/o;m.rotate(n,e*a)}}}else x=!0}}e._rotatingZoom=!x}if(!v&&x||T){let i=u7.Z.wgs84ToWindowCoordinates(p,e._zoomWorldPosition,pf),n=(g!==eB.Z.COLUMBUS_VIEW&&L.Z.equals(t,e._zoomMouseStart)&&(0,y.Z)(i)?m.getPickRay(i,ph):m.getPickRay(t,ph)).direction;(g===eB.Z.COLUMBUS_VIEW||g===eB.Z.SCENE2D)&&_.Z.fromElements(n.y,n.z,n.x,n),m.move(n,f),e._zoomingOnVector=!0}else m.zoomIn(f);e._cameraUnderground||m.setView(pN)}let pM=new eI.Z,pF=new eI.Z,pz=new _.Z;function pB(e,t,i){let n=e._scene.camera,r=n.getPickRay(i.startPosition,pM).origin,o=n.getPickRay(i.endPosition,pF).origin;r=_.Z.fromElements(r.y,r.z,r.x,r),o=_.Z.fromElements(o.y,o.z,o.x,o);let a=_.Z.subtract(r,o,pz),s=_.Z.magnitude(a);s>0&&(_.Z.normalize(a,a),n.move(a,s))}function pU(e,t,i){(0,y.Z)(i.distance)&&(i=i.distance);let n=e._scene.camera;pL(e,t,i,e._zoomFactor,n.getMagnitude())}let pk=new L.Z,pV=new L.Z;function pH(e,t,i){if((0,y.Z)(i.angleAndHeight)){!function(e,t,i){let n=e._rotateFactor*e._rotateRateRangeAdjustment;n>e._maximumRotateRate&&(n=e._maximumRotateRate),n<e._minimumRotateRate&&(n=e._minimumRotateRate);let r=e._scene,o=r.camera,a=r.canvas,s=(i.endPosition.x-i.startPosition.x)/a.clientWidth,l=n*(s=Math.min(s,e.maximumMovementRatio))*Math.PI*4;o.twistRight(l)}(e,0,i.angleAndHeight);return}let n=e._scene,r=n.camera,o=n.canvas,a=o.clientWidth,s=o.clientHeight,l=pk;l.x=2/a*i.startPosition.x-1,l.y=2/s*(s-i.startPosition.y)-1,l=L.Z.normalize(l,l);let c=pV;c.x=2/a*i.endPosition.x-1,c.y=2/s*(s-i.endPosition.y)-1,c=L.Z.normalize(c,c);let u=F.Z.acosClamped(l.x);l.y<0&&(u=F.Z.TWO_PI-u);let h=F.Z.acosClamped(c.x);c.y<0&&(h=F.Z.TWO_PI-h);let d=h-u;r.twistRight(d)}let pG=new eI.Z,pj=new _.Z,pW=new _.Z;function pq(e,t,i){let n;let r=e._scene,o=e._globe,a=r.camera;if(r.pickPositionSupported&&(n=r.pickPositionWorldCoordinates(t,pj)),!(0,y.Z)(o))return _.Z.clone(n,i);let s=!e._cameraUnderground,l=a.getPickRay(t,pG),c=o.pickWorldCoordinates(l,r,s,pW);return((0,y.Z)(n)?_.Z.distance(n,a.positionWC):Number.POSITIVE_INFINITY)<((0,y.Z)(c)?_.Z.distance(c,a.positionWC):Number.POSITIVE_INFINITY)?_.Z.clone(n,i):_.Z.clone(c,i)}let pY=new C.Z;function pX(e){let t=e._ellipsoid,i=e._scene,n=i.camera,r=i.mode,o=0;if(r===eB.Z.SCENE3D){let e=t.cartesianToCartographic(n.position,pY);(0,y.Z)(e)&&(o=e.height)}else o=n.position.z;return Math.abs((0,Z.Z)(e._scene.globeHeight,0)-o)}let p$=new _.Z;function pK(e,t){let i=t.origin,n=t.direction,r=pX(e),o=_.Z.normalize(i,p$),a=Math.abs(_.Z.dot(o,n));return r*(a=2*Math.max(a,.5))}function pQ(e,t,i,n){let r=_.Z.distance(t.origin,i),o=pX(e);return r>F.Z.clamp(5*o,e._minimumUndergroundPickDistance,e._maximumUndergroundPickDistance)&&(r=Math.max(r=Math.min(r,o/5),100)),eI.Z.getPoint(t,r,n)}function pJ(e,t,i,n){let r;return(0,y.Z)(i)?(r=_.Z.distance(t.origin,i))>e._maximumUndergroundPickDistance&&(r=pX(e)):r=pX(e),eI.Z.getPoint(t,r,n)}let p0=new L.Z;function p1(e,t){let i=t.endPosition,n=L.Z.subtract(t.endPosition,t.startPosition,p0),r=e._strafeEndMousePosition;L.Z.add(r,n,r),t.endPosition=r,mw(e,t,e._strafeStartPosition),t.endPosition=i}let p2=new eI.Z,p3=new eI.Z,p4=new _.Z,p5=new _.Z,p9=new _.Z,p8=new _.Z,p6=new f8.Z(_.Z.UNIT_X,0),p7=new L.Z,me=new L.Z;function mt(e,t,i){let n;if(_.Z.equals(t,e._translateMousePosition)||(e._looking=!1),_.Z.equals(t,e._strafeMousePosition)||(e._strafing=!1),e._looking){_a(e,t,i);return}if(e._strafing){p1(e,i);return}let r=e._scene.camera,o=e._cameraUnderground,a=L.Z.clone(i.startPosition,p7),s=L.Z.clone(i.endPosition,me),l=r.getPickRay(a,p2),c=_.Z.clone(_.Z.ZERO,p8),u=_.Z.UNIT_X;if(r.position.z<e._minimumPickingTerrainHeight&&(n=pq(e,a,p4),(0,y.Z)(n)&&(c.x=n.x)),o||c.x>r.position.z&&(0,y.Z)(n)){let r=n;o&&(r=pJ(e,l,n,p4)),L.Z.clone(t,e._strafeMousePosition),L.Z.clone(t,e._strafeEndMousePosition),_.Z.clone(r,e._strafeStartPosition),e._strafing=!0,mw(e,i,e._strafeStartPosition);return}let h=f8.Z.fromPointNormal(c,u,p6);l=r.getPickRay(a,p2);let d=eC.Z.rayPlane(l,h,p4),f=r.getPickRay(s,p3),p=eC.Z.rayPlane(f,h,p5);if(!(0,y.Z)(d)||!(0,y.Z)(p)){e._looking=!0,_a(e,t,i),L.Z.clone(t,e._translateMousePosition);return}let m=_.Z.subtract(d,p,p9),g=m.x;m.x=m.y,m.y=m.z,m.z=g;let Z=_.Z.magnitude(m);Z>F.Z.EPSILON6&&(_.Z.normalize(m,m),r.move(m,Z))}let mi=new L.Z,mn=new eI.Z,mr=new _.Z,mo=new _.Z,ma=new z.Z,ms=new z.Z,ml=new _.Z,mc=new f8.Z(_.Z.UNIT_X,0),mu=new _.Z,mh=new C.Z,md=new z.Z,mf=new rq.Z,mp=new rW.Z,mm=new _.Z;function m_(e,t,i){if((0,y.Z)(i.angleAndHeight)&&(i=i.angleAndHeight),L.Z.equals(t,e._tiltCenterMousePosition)||(e._tiltCVOffMap=!1,e._looking=!1),e._looking){_a(e,t,i);return}let n=e._scene.camera;e._tiltCVOffMap||!e.onMap()||Math.abs(n.position.z)>e._minimumPickingTerrainHeight?(e._tiltCVOffMap=!0,function(e,t,i){let n;let r=e._scene,o=r.camera,a=r.canvas;mi.x=a.clientWidth/2,mi.y=a.clientHeight/2;let s=o.getPickRay(mi,mn),l=_.Z.UNIT_X,c=s.origin,u=s.direction,h=_.Z.dot(l,u);if(Math.abs(h)>F.Z.EPSILON6&&(n=-_.Z.dot(l,c)/h),!(0,y.Z)(n)||n<=0){e._looking=!0,_a(e,t,i),L.Z.clone(t,e._tiltCenterMousePosition);return}let d=_.Z.multiplyByScalar(u,n,mr);_.Z.add(c,d,d);let f=r.mapProjection,p=f.ellipsoid;_.Z.fromElements(d.y,d.z,d.x,d);let m=f.unproject(d,mh);p.cartographicToCartesian(m,d);let g=et.Z.eastNorthUpToFixedFrame(d,p,ma),Z=e._globe,b=e._ellipsoid;e._globe=void 0,e._ellipsoid=T.Z.UNIT_SPHERE,e._rotateFactor=1,e._rotateRateRangeAdjustment=1;let v=z.Z.clone(o.transform,md);o._setTransform(g),mN(e,t,i,_.Z.UNIT_Z),o._setTransform(v),e._globe=Z,e._ellipsoid=b;let E=b.maximumRadius;e._rotateFactor=1/E,e._rotateRateRangeAdjustment=E}(e,t,i)):function(e,t,i){let n,r,o;let a=e._scene,s=a.camera,l=e._cameraUnderground,c=_.Z.UNIT_X;if(L.Z.equals(t,e._tiltCenterMousePosition))n=_.Z.clone(e._tiltCenter,mr);else{if(s.position.z<e._minimumPickingTerrainHeight&&(n=pq(e,t,mr)),!(0,y.Z)(n)){let o;let a=(r=s.getPickRay(t,mn)).origin,l=r.direction,u=_.Z.dot(c,l);if(Math.abs(u)>F.Z.EPSILON6&&(o=-_.Z.dot(c,a)/u),!(0,y.Z)(o)||o<=0){e._looking=!0,_a(e,t,i),L.Z.clone(t,e._tiltCenterMousePosition);return}n=_.Z.multiplyByScalar(l,o,mr),_.Z.add(a,n,n)}l&&((0,y.Z)(r)||(r=s.getPickRay(t,mn)),pQ(e,r,n,n)),L.Z.clone(t,e._tiltCenterMousePosition),_.Z.clone(n,e._tiltCenter)}let u=a.canvas;mi.x=u.clientWidth/2,mi.y=e._tiltCenterMousePosition.y,r=s.getPickRay(mi,mn);let h=_.Z.clone(_.Z.ZERO,ml);h.x=n.x;let d=f8.Z.fromPointNormal(h,c,mc),f=eC.Z.rayPlane(r,d,mo),p=s._projection,m=p.ellipsoid;_.Z.fromElements(n.y,n.z,n.x,n);let g=p.unproject(n,mh);m.cartographicToCartesian(g,n);let Z=et.Z.eastNorthUpToFixedFrame(n,m,ma);(0,y.Z)(f)?(_.Z.fromElements(f.y,f.z,f.x,f),g=p.unproject(f,mh),m.cartographicToCartesian(g,f),o=et.Z.eastNorthUpToFixedFrame(f,m,ms)):o=Z;let b=e._globe,v=e._ellipsoid;e._globe=void 0,e._ellipsoid=T.Z.UNIT_SPHERE,e._rotateFactor=1,e._rotateRateRangeAdjustment=1;let E=_.Z.UNIT_Z,x=z.Z.clone(s.transform,md);s._setTransform(Z);let w=_.Z.cross(_.Z.UNIT_Z,_.Z.normalize(s.position,mu),mu),S=_.Z.dot(s.right,w);if(mN(e,t,i,E,!1,!0),s._setTransform(o),S<0){let n=i.startPosition.y-i.endPosition.y;(l&&n<0||!l&&n>0)&&(E=void 0);let r=s.constrainedAxis;s.constrainedAxis=void 0,mN(e,t,i,E,!0,!1),s.constrainedAxis=r}else mN(e,t,i,E,!0,!1);if((0,y.Z)(s.constrainedAxis)){let e=_.Z.cross(s.direction,s.constrainedAxis,mm);_.Z.equalsEpsilon(e,_.Z.ZERO,F.Z.EPSILON6)||(0>_.Z.dot(e,s.right)&&_.Z.negate(e,e),_.Z.cross(e,s.direction,s.up),_.Z.cross(s.direction,s.up,s.right),_.Z.normalize(s.up,s.up),_.Z.normalize(s.right,s.right))}s._setTransform(x),e._globe=b,e._ellipsoid=v;let C=v.maximumRadius;e._rotateFactor=1/C,e._rotateRateRangeAdjustment=C;let A=_.Z.clone(s.positionWC,mu);if(e.enableCollisionDetection&&_c(e,!0),!_.Z.equals(s.positionWC,A)){s._setTransform(o),s.worldToCameraCoordinatesPoint(A,A);let e=_.Z.magnitudeSquared(A);_.Z.magnitudeSquared(s.position)>e&&(_.Z.normalize(s.position,s.position),_.Z.multiplyByScalar(s.position,Math.sqrt(e),s.position));let t=_.Z.angleBetween(A,s.position),i=_.Z.cross(A,s.position,A);_.Z.normalize(i,i);let n=rq.Z.fromAxisAngle(i,t,mf),r=rW.Z.fromQuaternion(n,mp);rW.Z.multiplyByVector(r,s.direction,s.direction),rW.Z.multiplyByVector(r,s.up,s.up),_.Z.cross(s.direction,s.up,s.right),_.Z.cross(s.right,s.direction,s.up),s._setTransform(x)}}(e,t,i)}let mg=new L.Z,mZ=new eI.Z,my=new _.Z;function mb(e,t,i){let n,r,o;(0,y.Z)(i.distance)&&(i=i.distance);let a=e._scene,s=a.camera,l=a.canvas,c=e._cameraUnderground;c?n=t:((n=mg).x=l.clientWidth/2,n.y=l.clientHeight/2);let u=s.getPickRay(n,mZ),h=u.origin,d=u.direction,f=s.position.z;if(f<e._minimumPickingTerrainHeight&&(r=pq(e,n,my)),(0,y.Z)(r)&&(o=_.Z.distance(h,r)),c){let t=pK(e,u,f);o=(0,y.Z)(o)?Math.min(o,t):t}if(!(0,y.Z)(o)){let e=_.Z.UNIT_X;o=-_.Z.dot(e,h)/_.Z.dot(e,d)}pL(e,t,i,e._zoomFactor,o)}let mv=new eI.Z,mT=new f8.Z(_.Z.UNIT_X,0),mE=new _.Z,mx=new _.Z;function mw(e,t,i){let n=e._scene,r=n.camera,o=r.getPickRay(t.endPosition,mv),a=_.Z.clone(r.direction,mx);n.mode===eB.Z.COLUMBUS_VIEW&&_.Z.fromElements(a.z,a.x,a.y,a);let s=f8.Z.fromPointNormal(i,a,mT),l=eC.Z.rayPlane(o,s,mE);(0,y.Z)(l)&&(a=_.Z.subtract(i,l,a),n.mode===eB.Z.COLUMBUS_VIEW&&_.Z.fromElements(a.y,a.z,a.x,a),_.Z.add(r.position,a,r.position))}let mS=new _.Z,mC=new C.Z,mA=new _.Z,mI=new T.Z,mO=new _.Z,mD=new _.Z,mP=new _.Z;function mR(e,t,i){let n,r;let o=e._scene.camera,a=e._cameraUnderground,s=e._ellipsoid;if(!z.Z.equals(o.transform,z.Z.IDENTITY)){mN(e,t,i);return}let l=s.geodeticSurfaceNormal(o.position,mO);if(L.Z.equals(t,e._rotateMousePosition)){if(e._looking)_a(e,t,i,l);else if(e._rotating)mN(e,t,i);else if(e._strafing)p1(e,i);else{if(_.Z.magnitude(o.position)<_.Z.magnitude(e._rotateStartPosition))return;n=_.Z.magnitude(e._rotateStartPosition),(r=mA).x=r.y=r.z=n,mW(e,t,i,s=T.Z.fromCartesian3(r,mI))}return}e._looking=!1,e._rotating=!1,e._strafing=!1;let c=s.cartesianToCartographic(o.positionWC,mC).height,u=e._globe;if((0,y.Z)(u)&&c<e._minimumPickingTerrainHeight){let c=pq(e,i.startPosition,mP);if((0,y.Z)(c)){let l=!1,u=o.getPickRay(i.startPosition,pG);if(a)l=!0,pJ(e,u,c,c);else{let e=s.geodeticSurfaceNormal(c,mD);l=.05>Math.abs(_.Z.dot(u.direction,e))||_.Z.magnitude(o.position)<_.Z.magnitude(c)}l?(L.Z.clone(t,e._strafeEndMousePosition),_.Z.clone(c,e._strafeStartPosition),e._strafing=!0,mw(e,i,e._strafeStartPosition)):(n=_.Z.magnitude(c),(r=mA).x=r.y=r.z=n,mW(e,t,i,s=T.Z.fromCartesian3(r,mI)),_.Z.clone(c,e._rotateStartPosition))}else e._looking=!0,_a(e,t,i,l)}else(0,y.Z)(o.pickEllipsoid(i.startPosition,e._ellipsoid,mS))?(mW(e,t,i,e._ellipsoid),_.Z.clone(mS,e._rotateStartPosition)):c>e._minimumTrackBallHeight?(e._rotating=!0,mN(e,t,i)):(e._looking=!0,_a(e,t,i,l));L.Z.clone(t,e._rotateMousePosition)}function mN(e,t,i,n,r,o){r=(0,Z.Z)(r,!1),o=(0,Z.Z)(o,!1);let a=e._scene,s=a.camera,l=a.canvas,c=s.constrainedAxis;(0,y.Z)(n)&&(s.constrainedAxis=n);let u=_.Z.magnitude(s.position),h=e._rotateFactor*(u-e._rotateRateRangeAdjustment);h>e._maximumRotateRate&&(h=e._maximumRotateRate),h<e._minimumRotateRate&&(h=e._minimumRotateRate);let d=(i.startPosition.x-i.endPosition.x)/l.clientWidth,f=(i.startPosition.y-i.endPosition.y)/l.clientHeight;d=Math.min(d,e.maximumMovementRatio),f=Math.min(f,e.maximumMovementRatio);let p=h*d*Math.PI*2,m=h*f*Math.PI;r||s.rotateRight(p),o||s.rotateUp(m),s.constrainedAxis=c}let mL=eH.Z.clone(eH.Z.UNIT_W),mM=eH.Z.clone(eH.Z.UNIT_W),mF=new _.Z,mz=new _.Z,mB=new _.Z,mU=new _.Z,mk=new L.Z,mV=new L.Z,mH=new L.Z,mG=new L.Z,mj=new eI.Z;function mW(e,t,i,n){let r,o;let a=e._scene,s=a.camera,l=L.Z.clone(i.startPosition,mk),c=L.Z.clone(i.endPosition,mV),u=n.cartesianToCartographic(s.positionWC,mC).height;if(!i.inertiaEnabled&&u<e._minimumPickingTerrainHeight&&(r=_.Z.clone(e._panLastWorldPosition,mL),(0,y.Z)(e._globe)||L.Z.equalsEpsilon(l,e._panLastMousePosition)||(r=pq(e,l,mL)),!(0,y.Z)(e._globe)&&(0,y.Z)(r))){let t=_.Z.subtract(r,s.positionWC,mz),i=_.Z.multiplyByScalar(s.directionWC,_.Z.dot(s.directionWC,t),mz),n=_.Z.magnitude(i),u=s.frustum.getPixelDimensions(a.drawingBufferWidth,a.drawingBufferHeight,n,a.pixelRatio,mG),h=L.Z.subtract(c,l,mH),d=_.Z.multiplyByScalar(s.rightWC,h.x*u.x,mz),f=_.Z.normalize(s.positionWC,pb),p=s.getPickRay(c,mj).direction,m=_.Z.subtract(p,_.Z.projectVector(p,s.rightWC,mB),mB),g=_.Z.angleBetween(m,s.directionWC),Z=1;(0,y.Z)(s.frustum.fov)&&(Z=Math.max(Math.tan(g),.1));let b=Math.abs(_.Z.dot(s.directionWC,f)),v=-h.y*u.y*2/Math.sqrt(Z)*(1-b),T=_.Z.multiplyByScalar(p,v,mB);b=Math.abs(_.Z.dot(s.upWC,f));let E=_.Z.multiplyByScalar(s.upWC,-h.y*(1-b)*u.y,mU);o=_.Z.add(r,d,mM),o=_.Z.add(o,T,o),o=_.Z.add(o,E,o),_.Z.clone(o,e._panLastWorldPosition),L.Z.clone(c,e._panLastMousePosition)}if((0,y.Z)(r)&&(0,y.Z)(o)||(r=s.pickEllipsoid(l,n,mL),o=s.pickEllipsoid(c,n,mM)),!(0,y.Z)(r)||!(0,y.Z)(o)){e._rotating=!0,mN(e,t,i);return}if(r=s.worldToCameraCoordinates(r,r),o=s.worldToCameraCoordinates(o,o),(0,y.Z)(s.constrainedAxis)){let e,t;let i=s.constrainedAxis,n=_.Z.mostOrthogonalAxis(i,mF);_.Z.cross(n,i,n),_.Z.normalize(n,n);let a=_.Z.cross(i,n,mz),l=_.Z.magnitude(r),c=_.Z.dot(i,r),u=Math.acos(c/l),h=_.Z.multiplyByScalar(i,c,mB);_.Z.subtract(r,h,h),_.Z.normalize(h,h);let d=_.Z.magnitude(o),f=_.Z.dot(i,o),p=Math.acos(f/d),m=_.Z.multiplyByScalar(i,f,mU);_.Z.subtract(o,m,m),_.Z.normalize(m,m);let g=Math.acos(_.Z.dot(h,n));0>_.Z.dot(h,a)&&(g=F.Z.TWO_PI-g);let Z=Math.acos(_.Z.dot(m,n));0>_.Z.dot(m,a)&&(Z=F.Z.TWO_PI-Z);let y=g-Z;e=_.Z.equalsEpsilon(i,s.position,F.Z.EPSILON2)?s.right:_.Z.cross(i,s.position,mF);let b=_.Z.cross(i,e,mF),v=_.Z.dot(b,_.Z.subtract(r,i,mz)),T=_.Z.dot(b,_.Z.subtract(o,i,mz));t=v>0&&T>0?p-u:v>0&&T<=0?_.Z.dot(s.position,i)>0?-u-p:u+p:u-p,s.rotateRight(y),s.rotateUp(t)}else{_.Z.normalize(r,r),_.Z.normalize(o,o);let e=_.Z.dot(r,o),t=_.Z.cross(r,o,mF);e<1&&!_.Z.equalsEpsilon(t,_.Z.ZERO,F.Z.EPSILON14)&&s.rotate(t,Math.acos(e))}}let mq=new _.Z,mY=new C.Z,mX=0;function m$(e,t,i){let n,r,o;(0,y.Z)(i.distance)&&(i=i.distance);let a=i.inertiaEnabled,s=e._ellipsoid,l=e._scene,c=l.camera,u=l.canvas,h=e._cameraUnderground;h?n=t:((n=mg).x=u.clientWidth/2,n.y=u.clientHeight/2);let d=c.getPickRay(n,mZ),f=s.cartesianToCartographic(c.position,mY).height,p=Math.abs(mX)<e.minimumPickingTerrainDistanceWithInertia;if((a?p:f<e._minimumPickingTerrainHeight)&&(r=pq(e,n,my)),(0,y.Z)(r)&&(mX=o=_.Z.distance(d.origin,r)),h){let t=pK(e,d,f);o=(0,y.Z)(o)?Math.min(o,t):t}(0,y.Z)(o)||(o=f);let m=_.Z.normalize(c.position,mq);pL(e,t,i,e._zoomFactor,o,_.Z.dot(m,c.direction))}let mK=new L.Z,mQ=new eI.Z,mJ=new _.Z,m0=new _.Z,m1=new z.Z,m2=new z.Z,m3=new z.Z,m4=new rq.Z,m5=new rW.Z,m9=new C.Z,m8=new _.Z;function m6(e,t,i){let n=e._scene.camera;if(!z.Z.equals(n.transform,z.Z.IDENTITY))return;if((0,y.Z)(i.angleAndHeight)&&(i=i.angleAndHeight),L.Z.equals(t,e._tiltCenterMousePosition)||(e._tiltOnEllipsoid=!1,e._looking=!1),e._looking){let r=e._ellipsoid.geodeticSurfaceNormal(n.position,m8);_a(e,t,i,r);return}let r=e._ellipsoid.cartesianToCartographic(n.position,m9);e._tiltOnEllipsoid||r.height>e._minimumCollisionTerrainHeight?(e._tiltOnEllipsoid=!0,function(e,t,i){let n;let r=e._ellipsoid,o=e._scene,a=o.camera,s=.25*e.minimumZoomDistance,l=r.cartesianToCartographic(a.positionWC,m7).height;if(l-s-1<F.Z.EPSILON3&&i.endPosition.y-i.startPosition.y<0)return;let c=o.canvas;mK.x=c.clientWidth/2,mK.y=c.clientHeight/2;let u=a.getPickRay(mK,mQ),h=eC.Z.rayEllipsoid(u,r);if((0,y.Z)(h))n=eI.Z.getPoint(u,h.start,mJ);else if(l>e._minimumTrackBallHeight){let e=eC.Z.grazingAltitudeLocation(u,r);if(!(0,y.Z)(e))return;let t=r.cartesianToCartographic(e,m9);t.height=0,n=r.cartographicToCartesian(t,mJ)}else{e._looking=!0;let n=e._ellipsoid.geodeticSurfaceNormal(a.position,m8);_a(e,t,i,n),L.Z.clone(t,e._tiltCenterMousePosition);return}let d=et.Z.eastNorthUpToFixedFrame(n,r,m1),f=e._globe,p=e._ellipsoid;e._globe=void 0,e._ellipsoid=T.Z.UNIT_SPHERE,e._rotateFactor=1,e._rotateRateRangeAdjustment=1;let m=z.Z.clone(a.transform,m3);a._setTransform(d),mN(e,t,i,_.Z.UNIT_Z),a._setTransform(m),e._globe=f,e._ellipsoid=p;let g=p.maximumRadius;e._rotateFactor=1/g,e._rotateRateRangeAdjustment=g}(e,t,i)):function(e,t,i){let n,r,o;let a=e._ellipsoid,s=e._scene,l=s.camera,c=e._cameraUnderground;if(L.Z.equals(t,e._tiltCenterMousePosition))n=_.Z.clone(e._tiltCenter,mJ);else{if(n=pq(e,t,mJ),!(0,y.Z)(n)){if(r=l.getPickRay(t,mQ),o=eC.Z.rayEllipsoid(r,a),!(0,y.Z)(o)){if(a.cartesianToCartographic(l.position,m9).height<=e._minimumTrackBallHeight){e._looking=!0;let n=e._ellipsoid.geodeticSurfaceNormal(l.position,m8);_a(e,t,i,n),L.Z.clone(t,e._tiltCenterMousePosition)}return}n=eI.Z.getPoint(r,o.start,mJ)}c&&((0,y.Z)(r)||(r=l.getPickRay(t,mQ)),pQ(e,r,n,n)),L.Z.clone(t,e._tiltCenterMousePosition),_.Z.clone(n,e._tiltCenter)}let u=s.canvas;mK.x=u.clientWidth/2,mK.y=e._tiltCenterMousePosition.y,r=l.getPickRay(mK,mQ);let h=_.Z.magnitude(n),d=_.Z.fromElements(h,h,h,mA),f=T.Z.fromCartesian3(d,mI);if(o=eC.Z.rayEllipsoid(r,f),!(0,y.Z)(o))return;let p=_.Z.magnitude(r.origin)>h?o.start:o.stop,m=eI.Z.getPoint(r,p,m0),g=et.Z.eastNorthUpToFixedFrame(n,a,m1),Z=et.Z.eastNorthUpToFixedFrame(m,f,m2),b=e._globe,v=e._ellipsoid;e._globe=void 0,e._ellipsoid=T.Z.UNIT_SPHERE,e._rotateFactor=1,e._rotateRateRangeAdjustment=1;let E=_.Z.UNIT_Z,x=z.Z.clone(l.transform,m3);l._setTransform(Z);let w=_.Z.cross(m,l.positionWC,mm);if(0>_.Z.dot(l.rightWC,w)){let n=i.startPosition.y-i.endPosition.y;(c&&n<0||!c&&n>0)&&(E=void 0);let r=l.constrainedAxis;l.constrainedAxis=void 0,mN(e,t,i,E,!0,!1),l.constrainedAxis=r}else mN(e,t,i,E,!0,!1);if(l._setTransform(g),mN(e,t,i,E,!1,!0),(0,y.Z)(l.constrainedAxis)){let e=_.Z.cross(l.direction,l.constrainedAxis,mm);_.Z.equalsEpsilon(e,_.Z.ZERO,F.Z.EPSILON6)||(0>_.Z.dot(e,l.right)&&_.Z.negate(e,e),_.Z.cross(e,l.direction,l.up),_.Z.cross(l.direction,l.up,l.right),_.Z.normalize(l.up,l.up),_.Z.normalize(l.right,l.right))}l._setTransform(x),e._globe=b,e._ellipsoid=v;let S=v.maximumRadius;e._rotateFactor=1/S,e._rotateRateRangeAdjustment=S;let C=_.Z.clone(l.positionWC,mm);if(e.enableCollisionDetection&&_c(e,!0),!_.Z.equals(l.positionWC,C)){l._setTransform(Z),l.worldToCameraCoordinatesPoint(C,C);let e=_.Z.magnitudeSquared(C);_.Z.magnitudeSquared(l.position)>e&&(_.Z.normalize(l.position,l.position),_.Z.multiplyByScalar(l.position,Math.sqrt(e),l.position));let t=_.Z.angleBetween(C,l.position),i=_.Z.cross(C,l.position,C);_.Z.normalize(i,i);let n=rq.Z.fromAxisAngle(i,t,m4),r=rW.Z.fromQuaternion(n,m5);rW.Z.multiplyByVector(r,l.direction,l.direction),rW.Z.multiplyByVector(r,l.up,l.up),_.Z.cross(l.direction,l.up,l.right),_.Z.cross(l.right,l.direction,l.up),l._setTransform(x)}}(e,t,i)}let m7=new C.Z,_e=new L.Z,_t=new L.Z,_i=new eI.Z,_n=new eI.Z,_r=new _.Z,_o=new _.Z;function _a(e,t,i,n){let r,o;let a=e._scene.camera;_e.x=i.startPosition.x,_e.y=0,_t.x=i.endPosition.x,_t.y=0;let s=a.getPickRay(_e,_i),l=a.getPickRay(_t,_n),c=0;a.frustum instanceof e$.Z?(r=s.origin,o=l.origin,_.Z.add(a.direction,r,r),_.Z.add(a.direction,o,o),_.Z.subtract(r,a.position,r),_.Z.subtract(o,a.position,o),_.Z.normalize(r,r),_.Z.normalize(o,o)):(r=s.direction,o=l.direction);let u=_.Z.dot(r,o);u<1&&(c=Math.acos(u)),c=i.startPosition.x>i.endPosition.x?-c:c;let h=e._horizontalRotationAxis;if((0,y.Z)(n)?a.look(n,-c):(0,y.Z)(h)?a.look(h,-c):a.lookLeft(c),_e.x=0,_e.y=i.startPosition.y,_t.x=0,_t.y=i.endPosition.y,s=a.getPickRay(_e,_i),l=a.getPickRay(_t,_n),c=0,a.frustum instanceof e$.Z?(r=s.origin,o=l.origin,_.Z.add(a.direction,r,r),_.Z.add(a.direction,o,o),_.Z.subtract(r,a.position,r),_.Z.subtract(o,a.position,o),_.Z.normalize(r,r),_.Z.normalize(o,o)):(r=s.direction,o=l.direction),(u=_.Z.dot(r,o))<1&&(c=Math.acos(u)),c=i.startPosition.y>i.endPosition.y?-c:c,n=(0,Z.Z)(n,h),(0,y.Z)(n)){let e=a.direction,t=_.Z.negate(n,_r),i=_.Z.equalsEpsilon(e,n,F.Z.EPSILON2),r=_.Z.equalsEpsilon(e,t,F.Z.EPSILON2);if(i||r)(i&&c<0||r&&c>0)&&a.look(a.right,-c);else{u=_.Z.dot(e,n);let i=F.Z.acosClamped(u);c>0&&c>i&&(c=i-F.Z.EPSILON4),u=_.Z.dot(e,t),i=F.Z.acosClamped(u),c<0&&-c>i&&(c=-i+F.Z.EPSILON4);let r=_.Z.cross(n,e,_o);a.look(r,c)}}else a.lookUp(c)}let _s=new z.Z,_l=new C.Z;function _c(e,t){let i,n;e._adjustedHeightForTerrain=!0;let r=e._scene,o=r.mode,a=r.globe;if(o===eB.Z.SCENE2D||o===eB.Z.MORPHING)return;let s=r.camera,l=(0,Z.Z)(a?.ellipsoid,T.Z.WGS84),c=r.mapProjection;z.Z.equals(s.transform,z.Z.IDENTITY)||(i=z.Z.clone(s.transform,_s),n=_.Z.magnitude(s.position),s._setTransform(z.Z.IDENTITY)),o===eB.Z.SCENE3D?l.cartesianToCartographic(s.position,_l):c.unproject(s.position,_l);let u=!1;if(_l.height<e._minimumCollisionTerrainHeight){let i=e._scene.globeHeight;if((0,y.Z)(i)){let n=i+e.minimumZoomDistance,r=i-e._lastGlobeHeight,a=r/e._lastGlobeHeight;_l.height<n&&(t||.1>=Math.abs(a))&&(_l.height=n,o===eB.Z.SCENE3D?l.cartographicToCartesian(_l,s.position):c.project(_l,s.position),u=!0),t||.1>=Math.abs(a)?e._lastGlobeHeight=i:e._lastGlobeHeight+=.1*r}}(0,y.Z)(i)&&(s._setTransform(i),u&&(_.Z.normalize(s.position,s.position),_.Z.negate(s.position,s.direction),_.Z.multiplyByScalar(s.position,Math.max(n,e.minimumZoomDistance),s.position),_.Z.normalize(s.direction,s.direction),_.Z.cross(s.direction,s.up,s.right),_.Z.cross(s.right,s.direction,s.up)))}pl.prototype.onMap=function(){let e=this._scene,t=e.mode,i=e.camera;return t!==eB.Z.COLUMBUS_VIEW||Math.abs(i.position.x)-this._maxCoord.x<0&&Math.abs(i.position.y)-this._maxCoord.y<0};let _u=new _.Z,_h=new _.Z;function _d(){this._sceneFramebuffer=new hb;let e=Array(6);e[0]=new dG({fragmentShader:uH,textureScale:.125,forcePowerOfTwo:!0,sampleMode:1});let t=e[1]=new dG({fragmentShader:'uniform sampler2D colorTexture;\n\nuniform float avgLuminance;\nuniform float threshold;\nuniform float offset;\n\nin vec2 v_textureCoordinates;\n\nfloat key(float avg)\n{\n float guess = 1.5 - (1.5 / (avg * 0.1 + 1.0));\n return max(0.0, guess) + 0.1;\n}\n\n// See section 9. "The bright-pass filter" of Realtime HDR Rendering\n// http://www.cg.tuwien.ac.at/research/publications/2007/Luksch_2007_RHR/Luksch_2007_RHR-RealtimeHDR%20.pdf\n\nvoid main()\n{\n vec4 color = texture(colorTexture, v_textureCoordinates);\n vec3 xyz = czm_RGBToXYZ(color.rgb);\n float luminance = xyz.r;\n\n float scaledLum = key(avgLuminance) * luminance / avgLuminance;\n float brightLum = max(scaledLum - threshold, 0.0);\n float brightness = brightLum / (offset + brightLum);\n\n xyz.r = brightness;\n out_FragColor = vec4(czm_XYZToRGB(xyz), 1.0);\n}\n',uniforms:{avgLuminance:.5,threshold:.25,offset:.1},textureScale:.125,forcePowerOfTwo:!0}),i=this;this._delta=1,this._sigma=2,this._blurStep=new L.Z,e[2]=new dG({fragmentShader:dU,uniforms:{step:function(){return i._blurStep.x=i._blurStep.y=1/t.outputTexture.width,i._blurStep},delta:function(){return i._delta},sigma:function(){return i._sigma},direction:0},textureScale:.125,forcePowerOfTwo:!0}),e[3]=new dG({fragmentShader:dU,uniforms:{step:function(){return i._blurStep.x=i._blurStep.y=1/t.outputTexture.width,i._blurStep},delta:function(){return i._delta},sigma:function(){return i._sigma},direction:1},textureScale:.125,forcePowerOfTwo:!0}),e[4]=new dG({fragmentShader:uH,sampleMode:1}),this._uCenter=new L.Z,this._uRadius=void 0,e[5]=new dG({fragmentShader:"uniform sampler2D colorTexture;\nuniform sampler2D colorTexture2;\n\nuniform vec2 center;\nuniform float radius;\n\nin vec2 v_textureCoordinates;\n\nvoid main()\n{\n vec4 color0 = texture(colorTexture, v_textureCoordinates);\n vec4 color1 = texture(colorTexture2, v_textureCoordinates);\n\n float x = length(gl_FragCoord.xy - center) / radius;\n float t = smoothstep(0.5, 0.8, x);\n out_FragColor = mix(color0 + color1, color1, t);\n}\n",uniforms:{center:function(){return i._uCenter},radius:function(){return i._uRadius},colorTexture2:function(){return i._sceneFramebuffer.framebuffer.getColorTexture(0)}}}),this._stages=new dq({stages:e});let n=new dK(this),r=e.length;for(let t=0;t<r;++t)e[t]._textureCache=n;this._textureCache=n,this.length=e.length}pl.prototype.update=function(){let e=this._scene,{camera:t,globe:i,mode:n}=e;z.Z.equals(t.transform,z.Z.IDENTITY)?(this._globe=i,this._ellipsoid=(0,y.Z)(this._globe)?this._globe.ellipsoid:e.mapProjection.ellipsoid):(this._globe=void 0,this._ellipsoid=T.Z.UNIT_SPHERE);let{verticalExaggeration:r,verticalExaggerationRelativeHeight:o}=e;this._minimumCollisionTerrainHeight=H.Z.getHeight(this.minimumCollisionTerrainHeight,r,o),this._minimumPickingTerrainHeight=H.Z.getHeight(this.minimumPickingTerrainHeight,r,o),this._minimumTrackBallHeight=H.Z.getHeight(this.minimumTrackBallHeight,r,o),this._cameraUnderground=e.cameraUnderground&&(0,y.Z)(this._globe);let a=this._ellipsoid.maximumRadius;this._rotateFactor=1/a,this._rotateRateRangeAdjustment=a,this._adjustedHeightForTerrain=!1;let s=_.Z.clone(t.positionWC,_u),l=_.Z.clone(t.directionWC,_h);n===eB.Z.SCENE2D?!function(e){let t=e._scene.mapMode2D===sd.ROTATE;z.Z.equals(z.Z.IDENTITY,e._scene.camera.transform)?(pu(e,e.enableTranslate,e.translateEventTypes,pB,e.inertiaTranslate,"_lastInertiaTranslateMovement"),pu(e,e.enableZoom,e.zoomEventTypes,pU,e.inertiaZoom,"_lastInertiaZoomMovement"),t&&pu(e,e.enableRotate,e.tiltEventTypes,pH,e.inertiaSpin,"_lastInertiaTiltMovement")):(pu(e,e.enableZoom,e.zoomEventTypes,pU,e.inertiaZoom,"_lastInertiaZoomMovement"),t&&pu(e,e.enableRotate,e.translateEventTypes,pH,e.inertiaSpin,"_lastInertiaSpinMovement"))}(this):n===eB.Z.COLUMBUS_VIEW?(this._horizontalRotationAxis=_.Z.UNIT_Z,function(e){let t=e._scene.camera;if(z.Z.equals(z.Z.IDENTITY,t.transform)){let i=e._tweens;if(e._aggregator.anyButtonDown&&i.removeAll(),pu(e,e.enableTilt,e.tiltEventTypes,m_,e.inertiaSpin,"_lastInertiaTiltMovement"),pu(e,e.enableTranslate,e.translateEventTypes,mt,e.inertiaTranslate,"_lastInertiaTranslateMovement"),pu(e,e.enableZoom,e.zoomEventTypes,mb,e.inertiaZoom,"_lastInertiaZoomMovement"),pu(e,e.enableLook,e.lookEventTypes,_a),!e._aggregator.anyButtonDown&&!i.contains(e._tween)){let n=t.createCorrectPositionTween(e.bounceAnimationTime);(0,y.Z)(n)&&(e._tween=i.add(n))}i.update()}else pu(e,e.enableRotate,e.rotateEventTypes,mN,e.inertiaSpin,"_lastInertiaSpinMovement"),pu(e,e.enableZoom,e.zoomEventTypes,m$,e.inertiaZoom,"_lastInertiaZoomMovement")}(this)):n===eB.Z.SCENE3D&&(this._horizontalRotationAxis=void 0,pu(this,this.enableRotate,this.rotateEventTypes,mR,this.inertiaSpin,"_lastInertiaSpinMovement"),pu(this,this.enableZoom,this.zoomEventTypes,m$,this.inertiaZoom,"_lastInertiaZoomMovement"),pu(this,this.enableTilt,this.tiltEventTypes,m6,this.inertiaSpin,"_lastInertiaTiltMovement"),pu(this,this.enableLook,this.lookEventTypes,_a)),this.enableCollisionDetection&&!this._adjustedHeightForTerrain&&_c(this,!_.Z.equals(s,t.positionWC)||!_.Z.equals(l,t.directionWC)),this._aggregator.reset()},pl.prototype.isDestroyed=function(){return!1},pl.prototype.destroy=function(){return this._tweens.removeAll(),this._aggregator=this._aggregator&&this._aggregator.destroy(),(0,b.Z)(this)},_d.prototype.get=function(e){return this._stages.get(e)},_d.prototype.getStageByName=function(e){let t=this._stages.length;for(let i=0;i<t;++i){let t=this._stages.get(i);if(t.name===e)return t}};let _f=new eH.Z,_p=new L.Z,_m=new L.Z,__=new z.Z;function _g(){this._cachedShowFrustumsShaders={}}_d.prototype.clear=function(e,t,i){this._sceneFramebuffer.clear(e,t,i),this._textureCache.clear(e)},_d.prototype.update=function(e){let t=e.context,i=e.viewport,n=this._sceneFramebuffer;n.update(t,i);let r=n.framebuffer;return this._textureCache.update(t),this._stages.update(t,!1),function(e,t,i){let n=t.uniformState,r=n.sunPositionWC,o=n.view,a=n.viewProjection,s=n.projection,l=z.Z.computeViewportTransformation(i,0,1,__),c=z.Z.multiplyByPoint(o,r,_f),u=et.Z.pointToGLWindowCoordinates(a,l,r,_p);c.x+=F.Z.SOLAR_RADIUS;let h=et.Z.pointToGLWindowCoordinates(s,l,c,c),d=60*L.Z.magnitude(L.Z.subtract(h,u,h));_m.x=d,_m.y=d,e._uCenter=L.Z.clone(u,e._uCenter),e._uRadius=.15*Math.max(_m.x,_m.y);let f=t.drawingBufferWidth,p=t.drawingBufferHeight,m=e._stages,_=m.get(0),g=_.outputTexture.width,Z=_.outputTexture.height,y=new oN.Z;y.width=g,y.height=Z,l=z.Z.computeViewportTransformation(y,0,1,__),u=et.Z.pointToGLWindowCoordinates(a,l,r,_p),_m.x*=g/f,_m.y*=Z/p;let b=_.scissorRectangle;b.x=Math.max(u.x-.5*_m.x,0),b.y=Math.max(u.y-.5*_m.y,0),b.width=Math.min(_m.x,f),b.height=Math.min(_m.y,p);for(let e=1;e<4;++e)oN.Z.clone(b,m.get(e).scissorRectangle)}(this,t,i),r},_d.prototype.execute=function(e){let t=this._sceneFramebuffer.framebuffer.getColorTexture(0),i=this._stages,n=i.length;i.get(0).execute(e,t);for(let t=1;t<n;++t)i.get(t).execute(e,i.get(t-1).outputTexture)},_d.prototype.copy=function(e,t){if(!(0,y.Z)(this._copyColorCommand)){let t=this;this._copyColorCommand=e.createViewportQuadCommand(uH,{uniformMap:{colorTexture:function(){return t._stages.get(t._stages.length-1).outputTexture}},owner:this})}this._copyColorCommand.framebuffer=t,this._copyColorCommand.execute(e)},_d.prototype.isDestroyed=function(){return!1},_d.prototype.destroy=function(){return this._textureCache.destroy(),this._stages.destroy(),(0,b.Z)(this)};let _Z=new A.Z,_y=new e3.Z;_g.prototype.executeDebugShowFrustumsCommand=function(e,t,i){let n;let r=t.shaderProgram.id,o=this._cachedShowFrustumsShaders[r];(0,y.Z)(o)||(o=function(e,t){let i;let n=e.context,r=t.fragmentShaderSource.clone(),o=[];r.sources=r.sources.map(function(e){let t;e=eD.Z.replaceMain(e,"czm_Debug_main");let i=/out_FragData_(\d+)/g;for(;null!==(t=i.exec(e));)-1===o.indexOf(t[1])&&o.push(t[1]);return e});let a=o.length,s="";if(s+="uniform vec3 debugShowCommandsColor;\nuniform vec3 debugShowFrustumsColor;\nvoid main() \n{ \n czm_Debug_main(); \n",a>0)for(i=0;i<a;++i)s+=` out_FragData_${o[i]}.rgb *= debugShowCommandsColor; out_FragData_${o[i]}.rgb *= debugShowFrustumsColor; `;else s+=" out_FragColor.rgb *= debugShowCommandsColor;\n out_FragColor.rgb *= debugShowFrustumsColor;\n";s+="}",r.sources.push(s);let l=function(e){let t={},i=e.vertexAttributes;for(let e in i)i.hasOwnProperty(e)&&(t[e]=i[e].index);return t}(t);return eL.Z.fromCache({context:n,vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:r,attributeLocations:l})}(e,t.shaderProgram),this._cachedShowFrustumsShaders[r]=o);let a=e3.Z.shallowClone(t,_y);a.shaderProgram=o,a.uniformMap=(n=(0,y.Z)(t.uniformMap)?t.uniformMap:{},(0,y.Z)(n.debugShowCommandsColor)||(0,y.Z)(n.debugShowFrustumsColor)||(n.debugShowCommandsColor=function(){return e.debugShowCommands?((0,y.Z)(t._debugColor)||(t._debugColor=A.Z.fromRandom()),t._debugColor):A.Z.WHITE},n.debugShowFrustumsColor=function(){return e.debugShowFrustums?(_Z.red=1&t.debugOverlappingFrustums?1:0,_Z.green=2&t.debugOverlappingFrustums?1:0,_Z.blue=4&t.debugOverlappingFrustums?1:0,_Z.alpha=1,_Z):A.Z.WHITE}),n),a.execute(e.context,i)};var _b=i(9337);function _v(e,t,i){this._primitive=e,this._tileIndex=t,this._sampleIndex=i,this._metadata={},this._orientedBoundingBox=new B.Z}_v.fromKeyframeNode=function(e,t,i,n){D.Z.typeOf.object("primitive",e),D.Z.typeOf.number("tileIndex",t),D.Z.typeOf.number("sampleIndex",i),D.Z.typeOf.object("keyframeNode",n);let r=new _v(e,t,i),{spatialNode:o,metadata:a}=n;return r._metadata=function(e,t,i){if(!(0,y.Z)(t))return;let{names:n,types:r}=e.provider,o={};for(let e=0;e<n.length;e++){let a=n[e],s=_b.Z.getComponentCount(r[e]),l=t[e].slice(i*s,(i+1)*s);o[a]=l}return o}(e,a,i),r._orientedBoundingBox=function(e,t,i,n){let r=t.dimensions,o=r.x*r.y,a=Math.floor(i/o),s=i-a*o,l=Math.floor(s/r.x),c=s-l*r.x,u=_.Z.fromElements(c,l,a,_T),h=_.Z.divideComponents(_.Z.subtract(u,e._paddingBefore,_T),e.dimensions,_E);return e._shape.computeOrientedBoundingBoxForSample(t,e.dimensions,h,n)}(e,o,i,r._orientedBoundingBox),r};let _T=new _.Z,_E=new _.Z;Object.defineProperties(_v.prototype,{metadata:{get:function(){return this._metadata}},primitive:{get:function(){return this._primitive}},sampleIndex:{get:function(){return this._sampleIndex}},tileIndex:{get:function(){return this._tileIndex}},orientedBoundingBox:{get:function(){return this._orientedBoundingBox.clone()}}}),_v.prototype.hasProperty=function(e){return(0,y.Z)(this._metadata[e])},_v.prototype.getNames=function(){return Object.keys(this._metadata)},_v.prototype.getProperty=function(e){return this._metadata[e]};var _x=i(8066),_w=i(5767),_S='// See IntersectionUtils.glsl for the definitions of Ray, NO_HIT, INF_HIT,\n// RayShapeIntersection\n\nvec4 intersectLongitude(in Ray ray, in float angle, in bool positiveNormal) {\n float normalSign = positiveNormal ? 1.0 : -1.0;\n vec2 planeNormal = vec2(-sin(angle), cos(angle)) * normalSign;\n\n vec2 position = ray.pos.xy;\n vec2 direction = ray.dir.xy;\n float approachRate = dot(direction, planeNormal);\n float distance = -dot(position, planeNormal);\n\n float t = (approachRate == 0.0)\n ? NO_HIT\n : distance / approachRate;\n\n return vec4(planeNormal, 0.0, t);\n}\n\nRayShapeIntersection intersectHalfSpace(in Ray ray, in float angle, in bool positiveNormal)\n{\n vec4 intersection = intersectLongitude(ray, angle, positiveNormal);\n vec4 farSide = vec4(normalize(ray.dir), INF_HIT);\n\n bool hitFront = (intersection.w > 0.0) == (dot(ray.pos.xy, intersection.xy) > 0.0);\n if (!hitFront) {\n return RayShapeIntersection(intersection, farSide);\n } else {\n return RayShapeIntersection(-1.0 * farSide, intersection);\n }\n}\n\nvoid intersectFlippedWedge(in Ray ray, in vec2 minMaxAngle, out RayShapeIntersection intersections[2])\n{\n intersections[0] = intersectHalfSpace(ray, minMaxAngle.x, false);\n intersections[1] = intersectHalfSpace(ray, minMaxAngle.y, true);\n}\n\nbool hitPositiveHalfPlane(in Ray ray, in vec4 intersection, in bool positiveNormal) {\n float normalSign = positiveNormal ? 1.0 : -1.0;\n vec2 planeDirection = vec2(intersection.y, -intersection.x) * normalSign;\n vec2 hit = ray.pos.xy + intersection.w * ray.dir.xy;\n return dot(hit, planeDirection) > 0.0;\n}\n\nvoid intersectHalfPlane(in Ray ray, in float angle, out RayShapeIntersection intersections[2]) {\n vec4 intersection = intersectLongitude(ray, angle, true);\n vec4 farSide = vec4(normalize(ray.dir), INF_HIT);\n\n if (hitPositiveHalfPlane(ray, intersection, true)) {\n intersections[0].entry = -1.0 * farSide;\n intersections[0].exit = vec4(-1.0 * intersection.xy, 0.0, intersection.w);\n intersections[1].entry = intersection;\n intersections[1].exit = farSide;\n } else {\n vec4 miss = vec4(normalize(ray.dir), NO_HIT);\n intersections[0].entry = -1.0 * farSide;\n intersections[0].exit = farSide;\n intersections[1].entry = miss;\n intersections[1].exit = miss;\n }\n}\n\nRayShapeIntersection intersectRegularWedge(in Ray ray, in vec2 minMaxAngle)\n{\n // Note: works for maxAngle > minAngle + pi, where the "regular wedge"\n // is actually a negative volume.\n // Compute intersections with the two planes.\n // Normals will point toward the "outside" (negative space)\n vec4 intersect1 = intersectLongitude(ray, minMaxAngle.x, false);\n vec4 intersect2 = intersectLongitude(ray, minMaxAngle.y, true);\n\n // Choose intersection with smallest T as the "first", the other as "last"\n // Note: first or last could be in the "shadow" wedge, beyond the tip\n bool inOrder = intersect1.w <= intersect2.w;\n vec4 first = inOrder ? intersect1 : intersect2;\n vec4 last = inOrder ? intersect2 : intersect1;\n\n bool firstIsAhead = first.w >= 0.0;\n bool startedInsideFirst = dot(ray.pos.xy, first.xy) < 0.0;\n bool exitFromInside = firstIsAhead == startedInsideFirst;\n bool lastIsAhead = last.w > 0.0;\n bool startedOutsideLast = dot(ray.pos.xy, last.xy) >= 0.0;\n bool enterFromOutside = lastIsAhead == startedOutsideLast;\n\n vec4 farSide = vec4(normalize(ray.dir), INF_HIT);\n vec4 miss = vec4(normalize(ray.dir), NO_HIT);\n\n if (exitFromInside && enterFromOutside) {\n // Ray crosses both faces of negative wedge, exiting then entering the positive shape\n return RayShapeIntersection(first, last);\n } else if (!exitFromInside && enterFromOutside) {\n // Ray starts inside wedge. last is in shadow wedge, and first is actually the entry\n return RayShapeIntersection(-1.0 * farSide, first);\n } else if (exitFromInside && !enterFromOutside) {\n // First intersection was in the shadow wedge, so last is actually the exit\n return RayShapeIntersection(last, farSide);\n } else { // !exitFromInside && !enterFromOutside\n // Both intersections were in the shadow wedge\n return RayShapeIntersection(miss, miss);\n }\n}\n',_C="// Main intersection function for Voxel scenes.\n// See IntersectBox.glsl, IntersectCylinder.glsl, or IntersectEllipsoid.glsl\n// for the definition of intersectShape. The appropriate function is selected\n// based on the VoxelPrimitive shape type, and added to the shader in\n// Scene/VoxelRenderResources.js.\n// See also IntersectClippingPlane.glsl and IntersectDepth.glsl.\n// See IntersectionUtils.glsl for the definitions of Ray, NO_HIT,\n// getFirstIntersection, initializeIntersections, nextIntersection.\n\n/* Intersection defines (set in Scene/VoxelRenderResources.js)\n#define INTERSECTION_COUNT ###\n*/\n\nRayShapeIntersection intersectScene(in vec2 screenCoord, in Ray ray, out Intersections ix) {\n // Do a ray-shape intersection to find the exact starting and ending points.\n intersectShape(ray, ix);\n\n // Exit early if the positive shape was completely missed or behind the ray.\n RayShapeIntersection intersection = getFirstIntersection(ix);\n if (intersection.entry.w == NO_HIT) {\n // Positive shape was completely missed - so exit early.\n return intersection;\n }\n\n // Clipping planes\n #if defined(CLIPPING_PLANES)\n intersectClippingPlanes(ray, ix);\n #endif\n\n // Depth\n #if defined(DEPTH_TEST)\n intersectDepth(screenCoord, ray, ix);\n #endif\n\n // Find the first intersection that's in front of the ray\n #if (INTERSECTION_COUNT > 1)\n initializeIntersections(ix);\n for (int i = 0; i < INTERSECTION_COUNT; ++i) {\n intersection = nextIntersection(ix);\n if (intersection.exit.w > 0.0) {\n // Set start to 0.0 when ray is inside the shape.\n intersection.entry.w = max(intersection.entry.w, 0.0);\n break;\n }\n }\n #else\n // Set start to 0.0 when ray is inside the shape.\n intersection.entry.w = max(intersection.entry.w, 0.0);\n #endif\n\n return intersection;\n}\n",_A=function(e){let t=new _w.Z;this.shaderBuilder=t;let i=e._customShader,n=(0,eW.Z)(e._uniformMap,i.uniformMap);e._uniformMap=n;let r=i.uniforms;for(let e in r)if(r.hasOwnProperty(e)){let i=r[e];t.addUniform(i.type,e,_x.Z.FRAGMENT)}t.addUniform("sampler2D","u_megatextureTextures[METADATA_COUNT]",_x.Z.FRAGMENT),this.uniformMap=n;let o=e._clippingPlanes,a=(0,y.Z)(o)&&o.enabled?o.length:0;this.clippingPlanes=o,this.clippingPlanesLength=a,t.addVertexLines(["in vec2 position;\n\nuniform vec4 u_ndcSpaceAxisAlignedBoundingBox;\n\nvoid main() {\n vec2 aabbMin = u_ndcSpaceAxisAlignedBoundingBox.xy;\n vec2 aabbMax = u_ndcSpaceAxisAlignedBoundingBox.zw;\n vec2 translation = 0.5 * (aabbMax + aabbMin);\n vec2 scale = 0.5 * (aabbMax - aabbMin);\n gl_Position = vec4(position * scale + translation, 0.0, 1.0);\n}\n"]),t.addFragmentLines([i.fragmentShaderText,"#line 0","// These octree flags must be in sync with GpuOctreeFlag in VoxelTraversal.js\n#define OCTREE_FLAG_INTERNAL 0\n#define OCTREE_FLAG_LEAF 1\n#define OCTREE_FLAG_PACKED_LEAF_FROM_PARENT 2\n\n#define OCTREE_MAX_LEVELS 32 // Harcoded value because GLSL doesn't like variable length loops\n\nuniform sampler2D u_octreeInternalNodeTexture;\nuniform vec2 u_octreeInternalNodeTexelSizeUv;\nuniform int u_octreeInternalNodeTilesPerRow;\n#if (SAMPLE_COUNT > 1)\nuniform sampler2D u_octreeLeafNodeTexture;\nuniform vec2 u_octreeLeafNodeTexelSizeUv;\nuniform int u_octreeLeafNodeTilesPerRow;\n#endif\n\nstruct OctreeNodeData {\n int data;\n int flag;\n};\n\nstruct TraversalData {\n ivec4 octreeCoords;\n int parentOctreeIndex;\n};\n\nstruct SampleData {\n int megatextureIndex;\n ivec4 tileCoords;\n vec3 tileUv;\n #if (SAMPLE_COUNT > 1)\n float weight;\n #endif\n};\n\n// Integer mod: For WebGL1 only\nint intMod(in int a, in int b) {\n return a - (b * (a / b));\n}\nint normU8_toInt(in float value) {\n return int(value * 255.0);\n}\nint normU8x2_toInt(in vec2 value) {\n return int(value.x * 255.0) + 256 * int(value.y * 255.0);\n}\nfloat normU8x2_toFloat(in vec2 value) {\n return float(normU8x2_toInt(value)) / 65535.0;\n}\n\nOctreeNodeData getOctreeNodeData(in vec2 octreeUv) {\n vec4 texData = texture(u_octreeInternalNodeTexture, octreeUv);\n\n OctreeNodeData data;\n data.data = normU8x2_toInt(texData.xy);\n data.flag = normU8x2_toInt(texData.zw);\n return data;\n}\n\nOctreeNodeData getOctreeChildData(in int parentOctreeIndex, in ivec3 childCoord) {\n int childIndex = childCoord.z * 4 + childCoord.y * 2 + childCoord.x;\n int octreeCoordX = intMod(parentOctreeIndex, u_octreeInternalNodeTilesPerRow) * 9 + 1 + childIndex;\n int octreeCoordY = parentOctreeIndex / u_octreeInternalNodeTilesPerRow;\n vec2 octreeUv = u_octreeInternalNodeTexelSizeUv * vec2(float(octreeCoordX) + 0.5, float(octreeCoordY) + 0.5);\n return getOctreeNodeData(octreeUv);\n}\n\nint getOctreeParentIndex(in int octreeIndex) {\n int octreeCoordX = intMod(octreeIndex, u_octreeInternalNodeTilesPerRow) * 9;\n int octreeCoordY = octreeIndex / u_octreeInternalNodeTilesPerRow;\n vec2 octreeUv = u_octreeInternalNodeTexelSizeUv * vec2(float(octreeCoordX) + 0.5, float(octreeCoordY) + 0.5);\n vec4 parentData = texture(u_octreeInternalNodeTexture, octreeUv);\n int parentOctreeIndex = normU8x2_toInt(parentData.xy);\n return parentOctreeIndex;\n}\n\n/**\n* Convert a position in the uv-space of the tileset bounding shape\n* into the uv-space of a tile within the tileset\n*/\nvec3 getTileUv(in vec3 shapePosition, in ivec4 octreeCoords) {\n // PERFORMANCE_IDEA: use bit-shifting (only in WebGL2)\n float dimAtLevel = exp2(float(octreeCoords.w));\n return shapePosition * dimAtLevel - vec3(octreeCoords.xyz);\n}\n\nvec3 getClampedTileUv(in vec3 shapePosition, in ivec4 octreeCoords) {\n vec3 tileUv = getTileUv(shapePosition, octreeCoords);\n return clamp(tileUv, vec3(0.0), vec3(1.0));\n}\n\nvoid getOctreeLeafSampleData(in OctreeNodeData data, in ivec4 octreeCoords, out SampleData sampleData) {\n sampleData.megatextureIndex = data.data;\n sampleData.tileCoords = (data.flag == OCTREE_FLAG_PACKED_LEAF_FROM_PARENT)\n ? ivec4(octreeCoords.xyz / 2, octreeCoords.w - 1)\n : octreeCoords;\n}\n\n#if (SAMPLE_COUNT > 1)\nvoid getOctreeLeafSampleDatas(in OctreeNodeData data, in ivec4 octreeCoords, out SampleData sampleDatas[SAMPLE_COUNT]) {\n int leafIndex = data.data;\n int leafNodeTexelCount = 2;\n // Adding 0.5 moves to the center of the texel\n float leafCoordXStart = float(intMod(leafIndex, u_octreeLeafNodeTilesPerRow) * leafNodeTexelCount) + 0.5;\n float leafCoordY = float(leafIndex / u_octreeLeafNodeTilesPerRow) + 0.5;\n\n // Get an interpolation weight and a flag to determine whether to read the parent texture\n vec2 leafUv0 = u_octreeLeafNodeTexelSizeUv * vec2(leafCoordXStart + 0.0, leafCoordY);\n vec4 leafData0 = texture(u_octreeLeafNodeTexture, leafUv0);\n float lerp = normU8x2_toFloat(leafData0.xy);\n sampleDatas[0].weight = 1.0 - lerp;\n sampleDatas[1].weight = lerp;\n // TODO: this looks wrong? Should be comparing to OCTREE_FLAG_PACKED_LEAF_FROM_PARENT\n sampleDatas[0].tileCoords = (normU8_toInt(leafData0.z) == 1)\n ? ivec4(octreeCoords.xyz / 2, octreeCoords.w - 1)\n : octreeCoords;\n sampleDatas[1].tileCoords = (normU8_toInt(leafData0.w) == 1)\n ? ivec4(octreeCoords.xyz / 2, octreeCoords.w - 1)\n : octreeCoords;\n\n // Get megatexture indices for both samples\n vec2 leafUv1 = u_octreeLeafNodeTexelSizeUv * vec2(leafCoordXStart + 1.0, leafCoordY);\n vec4 leafData1 = texture(u_octreeLeafNodeTexture, leafUv1);\n sampleDatas[0].megatextureIndex = normU8x2_toInt(leafData1.xy);\n sampleDatas[1].megatextureIndex = normU8x2_toInt(leafData1.zw);\n}\n#endif\n\nOctreeNodeData traverseOctreeDownwards(in vec3 shapePosition, inout TraversalData traversalData) {\n float sizeAtLevel = exp2(-1.0 * float(traversalData.octreeCoords.w));\n vec3 start = vec3(traversalData.octreeCoords.xyz) * sizeAtLevel;\n vec3 end = start + vec3(sizeAtLevel);\n OctreeNodeData childData;\n\n for (int i = 0; i < OCTREE_MAX_LEVELS; ++i) {\n // Find out which octree child contains the position\n // 0 if before center, 1 if after\n vec3 center = 0.5 * (start + end);\n vec3 childCoord = step(center, shapePosition);\n\n // Get octree coords for the next level down\n ivec4 octreeCoords = traversalData.octreeCoords;\n traversalData.octreeCoords = ivec4(octreeCoords.xyz * 2 + ivec3(childCoord), octreeCoords.w + 1);\n\n childData = getOctreeChildData(traversalData.parentOctreeIndex, ivec3(childCoord));\n\n if (childData.flag != OCTREE_FLAG_INTERNAL) {\n // leaf tile - stop traversing\n break;\n }\n\n // interior tile - keep going deeper\n start = mix(start, center, childCoord);\n end = mix(center, end, childCoord);\n traversalData.parentOctreeIndex = childData.data;\n }\n\n return childData;\n}\n\n/**\n* Transform a given position to an octree tile coordinate and a position within that tile,\n* and find the corresponding megatexture index and texture coordinates\n*/\nvoid traverseOctreeFromBeginning(in vec3 shapePosition, out TraversalData traversalData, out SampleData sampleDatas[SAMPLE_COUNT]) {\n traversalData.octreeCoords = ivec4(0);\n traversalData.parentOctreeIndex = 0;\n\n OctreeNodeData nodeData = getOctreeNodeData(vec2(0.0));\n if (nodeData.flag != OCTREE_FLAG_LEAF) {\n nodeData = traverseOctreeDownwards(shapePosition, traversalData);\n }\n\n #if (SAMPLE_COUNT == 1)\n getOctreeLeafSampleData(nodeData, traversalData.octreeCoords, sampleDatas[0]);\n sampleDatas[0].tileUv = getClampedTileUv(shapePosition, sampleDatas[0].tileCoords);\n #else\n getOctreeLeafSampleDatas(nodeData, traversalData.octreeCoords, sampleDatas);\n sampleDatas[0].tileUv = getClampedTileUv(shapePosition, sampleDatas[0].tileCoords);\n sampleDatas[1].tileUv = getClampedTileUv(shapePosition, sampleDatas[1].tileCoords);\n #endif\n}\n\nbool inRange(in vec3 v, in vec3 minVal, in vec3 maxVal) {\n return clamp(v, minVal, maxVal) == v;\n}\n\nbool insideTile(in vec3 shapePosition, in ivec4 octreeCoords) {\n vec3 tileUv = getTileUv(shapePosition, octreeCoords);\n bool inside = inRange(tileUv, vec3(0.0), vec3(1.0));\n // Assume (!) the position is always inside the root tile.\n return inside || octreeCoords.w == 0;\n}\n\nvoid traverseOctreeFromExisting(in vec3 shapePosition, inout TraversalData traversalData, inout SampleData sampleDatas[SAMPLE_COUNT]) {\n if (insideTile(shapePosition, traversalData.octreeCoords)) {\n for (int i = 0; i < SAMPLE_COUNT; i++) {\n sampleDatas[0].tileUv = getClampedTileUv(shapePosition, sampleDatas[0].tileCoords);\n }\n return;\n }\n\n // Go up tree until we find a parent tile containing shapePosition\n for (int i = 0; i < OCTREE_MAX_LEVELS; ++i) {\n traversalData.octreeCoords.xyz /= 2;\n traversalData.octreeCoords.w -= 1;\n\n if (insideTile(shapePosition, traversalData.octreeCoords)) {\n break;\n }\n\n traversalData.parentOctreeIndex = getOctreeParentIndex(traversalData.parentOctreeIndex);\n }\n\n // Go down tree\n OctreeNodeData nodeData = traverseOctreeDownwards(shapePosition, traversalData);\n\n #if (SAMPLE_COUNT == 1)\n getOctreeLeafSampleData(nodeData, traversalData.octreeCoords, sampleDatas[0]);\n sampleDatas[0].tileUv = getClampedTileUv(shapePosition, sampleDatas[0].tileCoords);\n #else\n getOctreeLeafSampleDatas(nodeData, traversalData.octreeCoords, sampleDatas);\n sampleDatas[0].tileUv = getClampedTileUv(shapePosition, sampleDatas[0].tileCoords);\n sampleDatas[1].tileUv = getClampedTileUv(shapePosition, sampleDatas[1].tileCoords);\n #endif\n}\n","struct Ray {\n vec3 pos;\n vec3 dir;\n vec3 rawDir;\n};\n\n#if defined(JITTER)\n/**\n * Generate a pseudo-random value for a given 2D screen coordinate.\n * Similar to https://www.shadertoy.com/view/4djSRW with a modified hashscale.\n */\nfloat hash(vec2 p)\n{\n vec3 p3 = fract(vec3(p.xyx) * 50.0);\n p3 += dot(p3, p3.yzx + 19.19);\n return fract((p3.x + p3.y) * p3.z);\n}\n#endif\n\nfloat minComponent(in vec3 v) {\n return min(min(v.x, v.y), v.z);\n}\n\nfloat maxComponent(in vec3 v) {\n return max(max(v.x, v.y), v.z);\n}\n\nstruct PointJacobianT {\n vec3 point;\n mat3 jacobianT;\n};\n","/* Intersection defines\n#define INTERSECTION_COUNT ###\n*/\n\n#define NO_HIT (-czm_infinity)\n#define INF_HIT (czm_infinity * 0.5)\n\nstruct RayShapeIntersection {\n vec4 entry;\n vec4 exit;\n};\n\nvec4 intersectionMin(in vec4 intersect0, in vec4 intersect1)\n{\n if (intersect0.w == NO_HIT) {\n return intersect1;\n } else if (intersect1.w == NO_HIT) {\n return intersect0;\n }\n return (intersect0.w <= intersect1.w) ? intersect0 : intersect1;\n}\n\nvec4 intersectionMax(in vec4 intersect0, in vec4 intersect1)\n{\n return (intersect0.w >= intersect1.w) ? intersect0 : intersect1;\n}\n\nRayShapeIntersection intersectIntersections(in Ray ray, in RayShapeIntersection intersect0, in RayShapeIntersection intersect1)\n{\n bool missed = (intersect0.entry.w == NO_HIT) ||\n (intersect1.entry.w == NO_HIT) ||\n (intersect0.exit.w < intersect1.entry.w) ||\n (intersect0.entry.w > intersect1.exit.w);\n if (missed) {\n vec4 miss = vec4(normalize(ray.dir), NO_HIT);\n return RayShapeIntersection(miss, miss);\n }\n\n vec4 entry = intersectionMax(intersect0.entry, intersect1.entry);\n vec4 exit = intersectionMin(intersect0.exit, intersect1.exit);\n\n return RayShapeIntersection(entry, exit);\n}\n\nstruct Intersections {\n // Don't access these member variables directly - call the functions instead.\n\n // Store an array of ray-surface intersections. Each intersection is composed of:\n // .xyz for the surface normal at the intersection point\n // .w for the T value\n // The scale of the normal encodes the shape intersection type:\n // length(intersection.xyz) = 1: positive shape entry\n // length(intersection.xyz) = 2: positive shape exit\n // length(intersection.xyz) = 3: negative shape entry\n // length(intersection.xyz) = 4: negative shape exit\n // INTERSECTION_COUNT is the number of ray-*shape* (volume) intersections,\n // so we need twice as many to track ray-*surface* intersections\n vec4 intersections[INTERSECTION_COUNT * 2];\n\n #if (INTERSECTION_COUNT > 1)\n // Maintain state for future nextIntersection calls\n int index;\n int surroundCount;\n bool surroundIsPositive;\n #endif\n};\n\nRayShapeIntersection getFirstIntersection(in Intersections ix) \n{\n return RayShapeIntersection(ix.intersections[0], ix.intersections[1]);\n}\n\nvec4 encodeIntersectionType(vec4 intersection, int index, bool entry)\n{\n float scale = float(index > 0) * 2.0 + float(!entry) + 1.0;\n return vec4(intersection.xyz * scale, intersection.w);\n}\n\n// Use defines instead of real functions because WebGL1 cannot access array with non-constant index.\n#define setIntersection(/*inout Intersections*/ ix, /*int*/ index, /*float*/ t, /*bool*/ positive, /*bool*/ enter) (ix).intersections[(index)] = vec4(0.0, float(!positive) * 2.0 + float(!enter) + 1.0, 0.0, (t))\n#define setIntersectionPair(/*inout Intersections*/ ix, /*int*/ index, /*vec2*/ entryExit) (ix).intersections[(index) * 2 + 0] = vec4(0.0, float((index) > 0) * 2.0 + 1.0, 0.0, (entryExit).x); (ix).intersections[(index) * 2 + 1] = vec4(0.0, float((index) > 0) * 2.0 + 2.0, 0.0, (entryExit).y)\n#define setSurfaceIntersection(/*inout Intersections*/ ix, /*int*/ index, /*vec4*/ intersection, /*bool*/ positive, /*bool*/ enter) (ix).intersections[(index)] = encodeIntersectionType((intersection), int(!positive), (enter))\n#define setShapeIntersection(/*inout Intersections*/ ix, /*int*/ index, /*RayShapeIntersection*/ intersection) (ix).intersections[(index) * 2 + 0] = encodeIntersectionType((intersection).entry, (index), true); (ix).intersections[(index) * 2 + 1] = encodeIntersectionType((intersection).exit, (index), false)\n\n#if (INTERSECTION_COUNT > 1)\nvoid initializeIntersections(inout Intersections ix) {\n // Sort the intersections from min T to max T with bubble sort.\n // Note: If this sorting function changes, some of the intersection test may\n // need to be updated. Search for \"bubble sort\" to find those areas.\n const int sortPasses = INTERSECTION_COUNT * 2 - 1;\n for (int n = sortPasses; n > 0; --n) {\n for (int i = 0; i < sortPasses; ++i) {\n // The loop should be: for (i = 0; i < n; ++i) {...} but WebGL1 cannot\n // loop with non-constant condition, so it has to break early instead\n if (i >= n) { break; }\n\n vec4 intersect0 = ix.intersections[i + 0];\n vec4 intersect1 = ix.intersections[i + 1];\n\n bool inOrder = intersect0.w <= intersect1.w;\n\n ix.intersections[i + 0] = inOrder ? intersect0 : intersect1;\n ix.intersections[i + 1] = inOrder ? intersect1 : intersect0;\n }\n }\n\n // Prepare initial state for nextIntersection\n ix.index = 0;\n ix.surroundCount = 0;\n ix.surroundIsPositive = false;\n}\n#endif\n\n#if (INTERSECTION_COUNT > 1)\nRayShapeIntersection nextIntersection(inout Intersections ix) {\n vec4 surfaceIntersection = vec4(0.0, 0.0, 0.0, NO_HIT);\n RayShapeIntersection shapeIntersection = RayShapeIntersection(surfaceIntersection, surfaceIntersection);\n\n const int passCount = INTERSECTION_COUNT * 2;\n\n if (ix.index == passCount) {\n return shapeIntersection;\n }\n\n for (int i = 0; i < passCount; ++i) {\n // The loop should be: for (i = ix.index; i < passCount; ++i) {...} but WebGL1 cannot\n // loop with non-constant condition, so it has to continue instead.\n if (i < ix.index) {\n continue;\n }\n\n ix.index = i + 1;\n\n surfaceIntersection = ix.intersections[i];\n int intersectionType = int(length(surfaceIntersection.xyz) - 0.5);\n bool currShapeIsPositive = intersectionType < 2;\n bool enter = intMod(intersectionType, 2) == 0;\n\n ix.surroundCount += enter ? +1 : -1;\n ix.surroundIsPositive = currShapeIsPositive ? enter : ix.surroundIsPositive;\n\n // entering positive or exiting negative\n if (ix.surroundCount == 1 && ix.surroundIsPositive && enter == currShapeIsPositive) {\n shapeIntersection.entry = surfaceIntersection;\n }\n\n // exiting positive or entering negative after being inside positive\n bool exitPositive = !enter && currShapeIsPositive && ix.surroundCount == 0;\n bool enterNegativeFromPositive = enter && !currShapeIsPositive && ix.surroundCount == 2 && ix.surroundIsPositive;\n if (exitPositive || enterNegativeFromPositive) {\n shapeIntersection.exit = surfaceIntersection;\n\n // entry and exit have been found, so the loop can stop\n if (exitPositive) {\n // After exiting positive shape there is nothing left to intersect, so jump to the end index.\n ix.index = passCount;\n }\n break;\n }\n }\n\n return shapeIntersection;\n}\n#endif\n\n// NOTE: initializeIntersections, nextIntersection aren't even declared unless INTERSECTION_COUNT > 1\n","// See Octree.glsl for the definitions of SampleData and intMod\n\n/* Megatexture defines (set in Scene/VoxelRenderResources.js)\n#define SAMPLE_COUNT ###\n#define NEAREST_SAMPLING\n#define PADDING\n*/\n\nuniform ivec2 u_megatextureSliceDimensions; // number of slices per tile, in two dimensions\nuniform ivec2 u_megatextureTileDimensions; // number of tiles per megatexture, in two dimensions\nuniform vec2 u_megatextureVoxelSizeUv;\nuniform vec2 u_megatextureSliceSizeUv;\nuniform vec2 u_megatextureTileSizeUv;\n\nuniform ivec3 u_dimensions; // does not include padding\n#if defined(PADDING)\n uniform ivec3 u_paddingBefore;\n uniform ivec3 u_paddingAfter;\n#endif\n\n// Integer min, max, clamp: For WebGL1 only\nint intMin(int a, int b) {\n return a <= b ? a : b;\n}\nint intMax(int a, int b) {\n return a >= b ? a : b;\n}\nint intClamp(int v, int minVal, int maxVal) {\n return intMin(intMax(v, minVal), maxVal);\n}\n\nvec2 index1DTo2DTexcoord(int index, ivec2 dimensions, vec2 uvScale)\n{\n int indexX = intMod(index, dimensions.x);\n int indexY = index / dimensions.x;\n return vec2(indexX, indexY) * uvScale;\n}\n\n/*\n How is 3D data stored in a 2D megatexture?\n\n In this example there is only one loaded tile and it has 2x2x2 voxels (8 voxels total).\n The data is sliced by Z. The data at Z = 0 is placed in texels (0,0), (0,1), (1,0), (1,1) and\n the data at Z = 1 is placed in texels (2,0), (2,1), (3,0), (3,1).\n Note that there could be empty space in the megatexture because it's a power of two.\n\n 0 1 2 3\n +---+---+---+---+\n | | | | | 3\n +---+---+---+---+\n | | | | | 2\n +-------+-------+\n |010|110|011|111| 1\n |--- ---|--- ---|\n |000|100|001|101| 0\n +-------+-------+\n\n When doing linear interpolation the megatexture needs to be sampled twice: once for\n the Z slice above the voxel coordinate and once for the slice below. The two slices\n are interpolated with fract(coord.z - 0.5). For example, a Z coordinate of 1.0 is\n halfway between two Z slices so the interpolation factor is 0.5. Below is a side view\n of the 3D voxel grid with voxel coordinates on the left side.\n\n 2 +---+\n |001|\n 1 +-z-+\n |000|\n 0 +---+\n\n When doing nearest neighbor the megatexture only needs to be sampled once at the closest Z slice.\n*/\n\nProperties getPropertiesFromMegatexture(in SampleData sampleData) {\n int tileIndex = sampleData.megatextureIndex;\n vec3 voxelCoord = sampleData.tileUv * vec3(u_dimensions);\n ivec3 voxelDimensions = u_dimensions;\n\n #if defined(PADDING)\n voxelDimensions += u_paddingBefore + u_paddingAfter;\n voxelCoord += vec3(u_paddingBefore);\n #endif\n\n #if defined(NEAREST_SAMPLING)\n // Round to the center of the nearest voxel\n voxelCoord = floor(voxelCoord) + vec3(0.5);\n #endif\n\n // Tile location\n vec2 tileUvOffset = index1DTo2DTexcoord(tileIndex, u_megatextureTileDimensions, u_megatextureTileSizeUv);\n\n // Slice location\n float slice = voxelCoord.z - 0.5;\n int sliceIndex = int(floor(slice));\n int sliceIndex0 = intClamp(sliceIndex, 0, voxelDimensions.z - 1);\n vec2 sliceUvOffset0 = index1DTo2DTexcoord(sliceIndex0, u_megatextureSliceDimensions, u_megatextureSliceSizeUv);\n\n // Voxel location\n vec2 voxelUvOffset = clamp(voxelCoord.xy, vec2(0.5), vec2(voxelDimensions.xy) - vec2(0.5)) * u_megatextureVoxelSizeUv;\n\n // Final location in the megatexture\n vec2 uv0 = tileUvOffset + sliceUvOffset0 + voxelUvOffset;\n\n #if defined(NEAREST_SAMPLING)\n return getPropertiesFromMegatextureAtUv(uv0);\n #else\n float sliceLerp = fract(slice);\n int sliceIndex1 = intMin(sliceIndex + 1, voxelDimensions.z - 1);\n vec2 sliceUvOffset1 = index1DTo2DTexcoord(sliceIndex1, u_megatextureSliceDimensions, u_megatextureSliceSizeUv);\n vec2 uv1 = tileUvOffset + sliceUvOffset1 + voxelUvOffset;\n Properties properties0 = getPropertiesFromMegatextureAtUv(uv0);\n Properties properties1 = getPropertiesFromMegatextureAtUv(uv1);\n return mixProperties(properties0, properties1, sliceLerp);\n #endif\n}\n\n// Convert an array of sample datas to a final weighted properties.\nProperties accumulatePropertiesFromMegatexture(in SampleData sampleDatas[SAMPLE_COUNT]) {\n #if (SAMPLE_COUNT == 1)\n return getPropertiesFromMegatexture(sampleDatas[0]);\n #else\n // When more than one sample is taken the accumulator needs to start at 0\n Properties properties = clearProperties();\n for (int i = 0; i < SAMPLE_COUNT; ++i) {\n float weight = sampleDatas[i].weight;\n\n // Avoid reading the megatexture when the weight is 0 as it can be costly.\n if (weight > 0.0) {\n Properties tempProperties = getPropertiesFromMegatexture(sampleDatas[i]);\n tempProperties = scaleProperties(tempProperties, weight);\n properties = sumProperties(properties, tempProperties);\n }\n }\n return properties;\n #endif\n}\n"]),a>0&&(t.addDefine("CLIPPING_PLANES",void 0,_x.Z.FRAGMENT),t.addDefine("CLIPPING_PLANES_COUNT",a,_x.Z.FRAGMENT),o.unionClippingRegions&&t.addDefine("CLIPPING_PLANES_UNION",void 0,_x.Z.FRAGMENT),t.addFragmentLines(["// See IntersectionUtils.glsl for the definitions of Ray, Intersections, INF_HIT,\n// NO_HIT, setShapeIntersection\n\n/* Clipping plane defines (set in Scene/VoxelRenderResources.js)\n#define CLIPPING_PLANES_UNION\n#define CLIPPING_PLANES_COUNT\n#define CLIPPING_PLANES_INTERSECTION_INDEX\n*/\n\nuniform sampler2D u_clippingPlanesTexture;\nuniform mat4 u_clippingPlanesMatrix;\n\n// Plane is in Hessian Normal Form\nvec4 intersectPlane(in Ray ray, in vec4 plane) {\n vec3 n = plane.xyz; // normal\n float w = plane.w; // -dot(pointOnPlane, normal)\n\n float a = dot(ray.pos, n);\n float b = dot(ray.dir, n);\n float t = -(w + a) / b;\n\n return vec4(n, t);\n}\n\nvoid intersectClippingPlanes(in Ray ray, inout Intersections ix) {\n vec4 backSide = vec4(-ray.dir, -INF_HIT);\n vec4 farSide = vec4(ray.dir, +INF_HIT);\n RayShapeIntersection clippingVolume;\n\n #if (CLIPPING_PLANES_COUNT == 1)\n // Union and intersection are the same when there's one clipping plane, and the code\n // is more simplified.\n vec4 planeUv = getClippingPlane(u_clippingPlanesTexture, 0, u_clippingPlanesMatrix);\n vec4 intersection = intersectPlane(ray, planeUv);\n bool reflects = dot(ray.dir, intersection.xyz) < 0.0;\n clippingVolume.entry = reflects ? backSide : intersection;\n clippingVolume.exit = reflects ? intersection : farSide;\n setShapeIntersection(ix, CLIPPING_PLANES_INTERSECTION_INDEX, clippingVolume);\n #elif defined(CLIPPING_PLANES_UNION)\n vec4 firstTransmission = vec4(ray.dir, +INF_HIT);\n vec4 lastReflection = vec4(-ray.dir, -INF_HIT);\n for (int i = 0; i < CLIPPING_PLANES_COUNT; i++) {\n vec4 planeUv = getClippingPlane(u_clippingPlanesTexture, i, u_clippingPlanesMatrix);\n vec4 intersection = intersectPlane(ray, planeUv);\n if (dot(ray.dir, planeUv.xyz) > 0.0) {\n firstTransmission = intersection.w <= firstTransmission.w ? intersection : firstTransmission;\n } else {\n lastReflection = intersection.w >= lastReflection.w ? intersection : lastReflection;\n }\n }\n clippingVolume.entry = backSide;\n clippingVolume.exit = lastReflection;\n setShapeIntersection(ix, CLIPPING_PLANES_INTERSECTION_INDEX + 0, clippingVolume);\n clippingVolume.entry = firstTransmission;\n clippingVolume.exit = farSide;\n setShapeIntersection(ix, CLIPPING_PLANES_INTERSECTION_INDEX + 1, clippingVolume);\n #else // intersection\n vec4 lastTransmission = vec4(ray.dir, -INF_HIT);\n vec4 firstReflection = vec4(-ray.dir, +INF_HIT);\n for (int i = 0; i < CLIPPING_PLANES_COUNT; i++) {\n vec4 planeUv = getClippingPlane(u_clippingPlanesTexture, i, u_clippingPlanesMatrix);\n vec4 intersection = intersectPlane(ray, planeUv);\n if (dot(ray.dir, planeUv.xyz) > 0.0) {\n lastTransmission = intersection.w > lastTransmission.w ? intersection : lastTransmission;\n } else {\n firstReflection = intersection.w < firstReflection.w ? intersection: firstReflection;\n }\n }\n if (lastTransmission.w < firstReflection.w) {\n clippingVolume.entry = lastTransmission;\n clippingVolume.exit = firstReflection;\n } else {\n clippingVolume.entry = vec4(-ray.dir, NO_HIT);\n clippingVolume.exit = vec4(ray.dir, NO_HIT);\n }\n setShapeIntersection(ix, CLIPPING_PLANES_INTERSECTION_INDEX, clippingVolume);\n #endif\n}\n"])),e._depthTest&&(t.addDefine("DEPTH_TEST",void 0,_x.Z.FRAGMENT),t.addFragmentLines(["// See IntersectionUtils.glsl for the definitions of Ray, Intersections,\n// setIntersectionPair, INF_HIT, NO_HIT\n\n/* intersectDepth defines (set in Scene/VoxelRenderResources.js)\n#define DEPTH_INTERSECTION_INDEX ###\n*/\n\nuniform mat4 u_transformPositionViewToUv;\n\nvoid intersectDepth(in vec2 screenCoord, in Ray ray, inout Intersections ix) {\n float logDepthOrDepth = czm_unpackDepth(texture(czm_globeDepthTexture, screenCoord));\n if (logDepthOrDepth != 0.0) {\n // Calculate how far the ray must travel before it hits the depth buffer.\n vec4 eyeCoordinateDepth = czm_screenToEyeCoordinates(screenCoord, logDepthOrDepth);\n eyeCoordinateDepth /= eyeCoordinateDepth.w;\n vec3 depthPositionUv = vec3(u_transformPositionViewToUv * eyeCoordinateDepth);\n float t = dot(depthPositionUv - ray.pos, ray.dir);\n setIntersectionPair(ix, DEPTH_INTERSECTION_INDEX, vec2(t, +INF_HIT));\n } else {\n // There's no depth at this location.\n setIntersectionPair(ix, DEPTH_INTERSECTION_INDEX, vec2(NO_HIT));\n }\n}\n"]));let s=e._provider.shape;"BOX"===s?t.addFragmentLines(["/* Box defines (set in Scene/VoxelBoxShape.js)\n#define BOX_HAS_SHAPE_BOUNDS\n*/\n\n#if defined(BOX_HAS_SHAPE_BOUNDS)\n uniform vec3 u_boxUvToShapeUvScale;\n uniform vec3 u_boxUvToShapeUvTranslate;\n#endif\n\nPointJacobianT convertUvToShapeSpaceDerivative(in vec3 positionUv) {\n // For BOX, UV space = shape space, so we can use positionUv as-is,\n // and the Jacobian is the identity matrix, except that a step of 1\n // only spans half the shape space [-1, 1], so the identity is scaled.\n return PointJacobianT(positionUv, mat3(0.5));\n}\n\nvec3 convertShapeToShapeUvSpace(in vec3 positionShape) {\n#if defined(BOX_HAS_SHAPE_BOUNDS)\n return positionShape * u_boxUvToShapeUvScale + u_boxUvToShapeUvTranslate;\n#else\n return positionShape;\n#endif\n}\n\nPointJacobianT convertUvToShapeUvSpaceDerivative(in vec3 positionUv) {\n PointJacobianT pointJacobian = convertUvToShapeSpaceDerivative(positionUv);\n pointJacobian.point = convertShapeToShapeUvSpace(pointJacobian.point);\n return pointJacobian;\n}\n\nvec3 convertShapeUvToUvSpace(in vec3 shapeUv) {\n#if defined(BOX_HAS_SHAPE_BOUNDS)\n return (shapeUv - u_boxUvToShapeUvTranslate) / u_boxUvToShapeUvScale;\n#else\n return shapeUv;\n#endif\n}\n\nvec3 scaleShapeUvToShapeSpace(in vec3 shapeUv) {\n#if defined(BOX_HAS_SHAPE_BOUNDS)\n return shapeUv / u_boxUvToShapeUvScale;\n#else\n return shapeUv;\n#endif\n}","// See IntersectionUtils.glsl for the definitions of Ray, RayShapeIntersection,\n// NO_HIT, Intersections\n\n/* Box defines (set in Scene/VoxelBoxShape.js)\n#define BOX_INTERSECTION_INDEX ### // always 0\n*/\n\nuniform vec3 u_renderMinBounds;\nuniform vec3 u_renderMaxBounds;\n\nRayShapeIntersection intersectBox(in Ray ray, in vec3 minBound, in vec3 maxBound)\n{\n // Consider the box as the intersection of the space between 3 pairs of parallel planes\n // Compute the distance along the ray to each plane\n vec3 t0 = (minBound - ray.pos) / ray.dir;\n vec3 t1 = (maxBound - ray.pos) / ray.dir;\n\n // Identify candidate entries/exits based on distance from ray.pos\n vec3 entries = min(t0, t1);\n vec3 exits = max(t0, t1);\n\n vec3 directions = sign(ray.dir);\n\n // The actual intersection points are the furthest entry and the closest exit\n float lastEntry = maxComponent(entries);\n bvec3 isLastEntry = equal(entries, vec3(lastEntry));\n vec3 entryNormal = -1.0 * vec3(isLastEntry) * directions;\n vec4 entry = vec4(entryNormal, lastEntry);\n\n float firstExit = minComponent(exits);\n bvec3 isFirstExit = equal(exits, vec3(firstExit));\n vec3 exitNormal = vec3(isLastEntry) * directions;\n vec4 exit = vec4(exitNormal, firstExit);\n\n if (entry.w > exit.w) {\n entry.w = NO_HIT;\n exit.w = NO_HIT;\n }\n\n return RayShapeIntersection(entry, exit);\n}\n\nvoid intersectShape(in Ray ray, inout Intersections ix)\n{\n RayShapeIntersection intersection = intersectBox(ray, u_renderMinBounds, u_renderMaxBounds);\n setShapeIntersection(ix, BOX_INTERSECTION_INDEX, intersection);\n}\n",_C]):"CYLINDER"===s?t.addFragmentLines(["/* Cylinder defines (set in Scene/VoxelCylinderShape.js)\n#define CYLINDER_HAS_SHAPE_BOUNDS_RADIUS\n#define CYLINDER_HAS_SHAPE_BOUNDS_HEIGHT\n#define CYLINDER_HAS_SHAPE_BOUNDS_ANGLE\n#define CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_DISCONTINUITY\n#define CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MAX_DISCONTINUITY\n#define CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_MAX_REVERSED\n*/\n\n#if defined(CYLINDER_HAS_SHAPE_BOUNDS_RADIUS)\n uniform vec2 u_cylinderUvToShapeUvRadius; // x = scale, y = offset\n#endif\n#if defined(CYLINDER_HAS_SHAPE_BOUNDS_HEIGHT)\n uniform vec2 u_cylinderUvToShapeUvHeight; // x = scale, y = offset\n#endif\n#if defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE)\n uniform vec2 u_cylinderUvToShapeUvAngle; // x = scale, y = offset\n#endif\n#if defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_DISCONTINUITY) || defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MAX_DISCONTINUITY)\n uniform vec2 u_cylinderShapeUvAngleMinMax;\n#endif\n#if defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_DISCONTINUITY) || defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MAX_DISCONTINUITY) || defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_MAX_REVERSED)\n uniform float u_cylinderShapeUvAngleRangeZeroMid;\n#endif\n\nPointJacobianT convertUvToShapeSpaceDerivative(in vec3 positionUv) {\n // Convert from Cartesian UV space [0, 1] to Cartesian local space [-1, 1]\n vec3 position = positionUv * 2.0 - 1.0;\n\n float radius = length(position.xy); // [0, 1]\n vec3 radial = normalize(vec3(position.xy, 0.0));\n\n // Shape space height is defined within [0, 1]\n float height = positionUv.z; // [0, 1]\n vec3 z = vec3(0.0, 0.0, 1.0);\n\n float angle = atan(position.y, position.x);\n vec3 east = normalize(vec3(-position.y, position.x, 0.0));\n\n vec3 point = vec3(radius, height, angle);\n mat3 jacobianT = mat3(radial, z, east / length(position.xy));\n return PointJacobianT(point, jacobianT);\n}\n\nvec3 convertShapeToShapeUvSpace(in vec3 positionShape) {\n float radius = positionShape.x;\n #if defined(CYLINDER_HAS_SHAPE_BOUNDS_RADIUS)\n radius = radius * u_cylinderUvToShapeUvRadius.x + u_cylinderUvToShapeUvRadius.y;\n #endif\n\n float height = positionShape.y;\n #if defined(CYLINDER_HAS_SHAPE_BOUNDS_HEIGHT)\n height = height * u_cylinderUvToShapeUvHeight.x + u_cylinderUvToShapeUvHeight.y;\n #endif\n\n float angle = (positionShape.z + czm_pi) / czm_twoPi;\n #if defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE)\n #if defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_MAX_REVERSED)\n // Comparing against u_cylinderShapeUvAngleMinMax has precision problems. u_cylinderShapeUvAngleRangeZeroMid is more conservative.\n angle += float(angle < u_cylinderShapeUvAngleRangeZeroMid);\n #endif\n\n // Avoid flickering from reading voxels from both sides of the -pi/+pi discontinuity.\n #if defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_DISCONTINUITY)\n angle = angle > u_cylinderShapeUvAngleRangeZeroMid ? u_cylinderShapeUvAngleMinMax.x : angle;\n #elif defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MAX_DISCONTINUITY)\n angle = angle < u_cylinderShapeUvAngleRangeZeroMid ? u_cylinderShapeUvAngleMinMax.y : angle;\n #endif\n\n angle = angle * u_cylinderUvToShapeUvAngle.x + u_cylinderUvToShapeUvAngle.y;\n #endif\n\n return vec3(radius, height, angle);\n}\n\nPointJacobianT convertUvToShapeUvSpaceDerivative(in vec3 positionUv) {\n PointJacobianT pointJacobian = convertUvToShapeSpaceDerivative(positionUv);\n pointJacobian.point = convertShapeToShapeUvSpace(pointJacobian.point);\n return pointJacobian;\n}\n\nvec3 scaleShapeUvToShapeSpace(in vec3 shapeUv) {\n float radius = shapeUv.x;\n #if defined(CYLINDER_HAS_SHAPE_BOUNDS_RADIUS)\n radius /= u_cylinderUvToShapeUvRadius.x;\n #endif\n\n float height = shapeUv.y;\n #if defined(CYLINDER_HAS_SHAPE_BOUNDS_HEIGHT)\n height /= u_cylinderUvToShapeUvHeight.x;\n #endif\n\n float angle = shapeUv.z * czm_twoPi;\n #if defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE)\n angle /= u_cylinderUvToShapeUvAngle.x;\n #endif\n\n return vec3(radius, height, angle);\n}\n",_S,"// See IntersectionUtils.glsl for the definitions of Ray, NO_HIT, Intersections,\n// RayShapeIntersection, setSurfaceIntersection, setShapeIntersection,\n// intersectIntersections\n// See IntersectLongitude.glsl for the definitions of intersectHalfPlane,\n// intersectFlippedWedge, intersectRegularWedge\n\n/* Cylinder defines (set in Scene/VoxelCylinderShape.js)\n#define CYLINDER_HAS_RENDER_BOUNDS_RADIUS_MIN\n#define CYLINDER_HAS_RENDER_BOUNDS_RADIUS_FLAT\n#define CYLINDER_HAS_RENDER_BOUNDS_ANGLE\n#define CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_UNDER_HALF\n#define CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_OVER_HALF\n#define CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_EQUAL_ZERO\n\n#define CYLINDER_INTERSECTION_INDEX_RADIUS_MAX\n#define CYLINDER_INTERSECTION_INDEX_RADIUS_MIN\n#define CYLINDER_INTERSECTION_INDEX_ANGLE\n*/\n\n// Cylinder uniforms\nuniform vec2 u_cylinderRenderRadiusMinMax;\nuniform vec2 u_cylinderRenderHeightMinMax;\n#if defined(CYLINDER_HAS_RENDER_BOUNDS_ANGLE)\n uniform vec2 u_cylinderRenderAngleMinMax;\n#endif\n\n/**\n * Find the intersection of a ray with the volume defined by two planes of constant z\n */\nRayShapeIntersection intersectHeightBounds(in Ray ray, in vec2 minMaxHeight, in bool convex)\n{\n float zPosition = ray.pos.z;\n float zDirection = ray.dir.z;\n\n float tmin = (minMaxHeight.x - zPosition) / zDirection;\n float tmax = (minMaxHeight.y - zPosition) / zDirection;\n\n // Normals point outside the volume\n float signFlip = convex ? 1.0 : -1.0;\n vec4 intersectMin = vec4(0.0, 0.0, -1.0 * signFlip, tmin);\n vec4 intersectMax = vec4(0.0, 0.0, 1.0 * signFlip, tmax);\n\n bool topEntry = zDirection < 0.0;\n vec4 entry = topEntry ? intersectMax : intersectMin;\n vec4 exit = topEntry ? intersectMin : intersectMax;\n\n return RayShapeIntersection(entry, exit);\n}\n\n/**\n * Find the intersection of a ray with a right cylindrical surface of a given radius\n * about the z-axis.\n */\nRayShapeIntersection intersectCylinder(in Ray ray, in float radius, in bool convex)\n{\n vec2 position = ray.pos.xy;\n vec2 direction = ray.dir.xy;\n\n float a = dot(direction, direction);\n float b = dot(position, direction);\n float c = dot(position, position) - radius * radius;\n float determinant = b * b - a * c;\n\n if (determinant < 0.0) {\n vec4 miss = vec4(normalize(ray.dir), NO_HIT);\n return RayShapeIntersection(miss, miss);\n }\n\n determinant = sqrt(determinant);\n float t1 = (-b - determinant) / a;\n float t2 = (-b + determinant) / a;\n float signFlip = convex ? 1.0 : -1.0;\n vec4 intersect1 = vec4(normalize(position + t1 * direction) * signFlip, 0.0, t1);\n vec4 intersect2 = vec4(normalize(position + t2 * direction) * signFlip, 0.0, t2);\n\n return RayShapeIntersection(intersect1, intersect2);\n}\n\n/**\n * Find the intersection of a ray with a right cylindrical solid of given\n * radius and height bounds. NOTE: The shape is assumed to be convex.\n */\nRayShapeIntersection intersectBoundedCylinder(in Ray ray, in float radius, in vec2 minMaxHeight)\n{\n RayShapeIntersection cylinderIntersection = intersectCylinder(ray, radius, true);\n RayShapeIntersection heightBoundsIntersection = intersectHeightBounds(ray, minMaxHeight, true);\n return intersectIntersections(ray, cylinderIntersection, heightBoundsIntersection);\n}\n\nvoid intersectShape(Ray ray, inout Intersections ix)\n{\n // Position is converted from [0,1] to [-1,+1] because shape intersections assume unit space is [-1,+1].\n // Direction is scaled as well to be in sync with position.\n ray.pos = ray.pos * 2.0 - 1.0;\n ray.dir *= 2.0;\n\n RayShapeIntersection outerIntersect = intersectBoundedCylinder(ray, u_cylinderRenderRadiusMinMax.y, u_cylinderRenderHeightMinMax);\n\n setShapeIntersection(ix, CYLINDER_INTERSECTION_INDEX_RADIUS_MAX, outerIntersect);\n\n if (outerIntersect.entry.w == NO_HIT) {\n return;\n }\n\n #if defined(CYLINDER_HAS_RENDER_BOUNDS_RADIUS_FLAT)\n // When the cylinder is perfectly thin it's necessary to sandwich the\n // inner cylinder intersection inside the outer cylinder intersection.\n\n // Without this special case,\n // [outerMin, outerMax, innerMin, innerMax] will bubble sort to\n // [outerMin, innerMin, outerMax, innerMax] which will cause the back\n // side of the cylinder to be invisible because it will think the ray\n // is still inside the inner (negative) cylinder after exiting the\n // outer (positive) cylinder.\n\n // With this special case,\n // [outerMin, innerMin, innerMax, outerMax] will bubble sort to\n // [outerMin, innerMin, innerMax, outerMax] which will work correctly.\n\n // Note: If initializeIntersections() changes its sorting function\n // from bubble sort to something else, this code may need to change.\n RayShapeIntersection innerIntersect = intersectCylinder(ray, 1.0, false);\n setSurfaceIntersection(ix, 0, outerIntersect.entry, true, true); // positive, enter\n setSurfaceIntersection(ix, 1, innerIntersect.entry, false, true); // negative, enter\n setSurfaceIntersection(ix, 2, innerIntersect.exit, false, false); // negative, exit\n setSurfaceIntersection(ix, 3, outerIntersect.exit, true, false); // positive, exit\n #elif defined(CYLINDER_HAS_RENDER_BOUNDS_RADIUS_MIN)\n RayShapeIntersection innerIntersect = intersectCylinder(ray, u_cylinderRenderRadiusMinMax.x, false);\n setShapeIntersection(ix, CYLINDER_INTERSECTION_INDEX_RADIUS_MIN, innerIntersect);\n #endif\n\n #if defined(CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_UNDER_HALF)\n RayShapeIntersection wedgeIntersect = intersectRegularWedge(ray, u_cylinderRenderAngleMinMax);\n setShapeIntersection(ix, CYLINDER_INTERSECTION_INDEX_ANGLE, wedgeIntersect);\n #elif defined(CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_OVER_HALF)\n RayShapeIntersection wedgeIntersects[2];\n intersectFlippedWedge(ray, u_cylinderRenderAngleMinMax, wedgeIntersects);\n setShapeIntersection(ix, CYLINDER_INTERSECTION_INDEX_ANGLE + 0, wedgeIntersects[0]);\n setShapeIntersection(ix, CYLINDER_INTERSECTION_INDEX_ANGLE + 1, wedgeIntersects[1]);\n #elif defined(CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_EQUAL_ZERO)\n RayShapeIntersection wedgeIntersects[2];\n intersectHalfPlane(ray, u_cylinderRenderAngleMinMax.x, wedgeIntersects);\n setShapeIntersection(ix, CYLINDER_INTERSECTION_INDEX_ANGLE + 0, wedgeIntersects[0]);\n setShapeIntersection(ix, CYLINDER_INTERSECTION_INDEX_ANGLE + 1, wedgeIntersects[1]);\n #endif\n}\n",_C]):"ELLIPSOID"===s&&(t.addDefine("SHAPE_ELLIPSOID",void 0,_x.Z.FRAGMENT),t.addFragmentLines(["/* Ellipsoid defines (set in Scene/VoxelEllipsoidShape.js)\n#define ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MIN_DISCONTINUITY\n#define ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MAX_DISCONTINUITY\n#define ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE\n#define ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE_MIN_MAX_REVERSED\n#define ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE\n*/\n\nuniform vec3 u_ellipsoidRadiiUv; // [0,1]\nuniform vec2 u_evoluteScale; // (radiiUv.x ^ 2 - radiiUv.z ^ 2) * vec2(1.0, -1.0) / radiiUv;\nuniform vec3 u_ellipsoidInverseRadiiSquaredUv;\n#if defined(ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MIN_DISCONTINUITY) || defined(ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MAX_DISCONTINUITY) || defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE_MIN_MAX_REVERSED)\n uniform vec3 u_ellipsoidShapeUvLongitudeMinMaxMid;\n#endif\n#if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE)\n uniform vec2 u_ellipsoidUvToShapeUvLongitude; // x = scale, y = offset\n#endif\n#if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE)\n uniform vec2 u_ellipsoidUvToShapeUvLatitude; // x = scale, y = offset\n#endif\nuniform float u_ellipsoidInverseHeightDifferenceUv;\n\n// robust iterative solution without trig functions\n// https://github.com/0xfaded/ellipse_demo/issues/1\n// https://stackoverflow.com/questions/22959698/distance-from-given-point-to-given-ellipse\n// Extended to return radius of curvature along with the point\nvec3 nearestPointAndRadiusOnEllipse(vec2 pos, vec2 radii) {\n vec2 p = abs(pos);\n vec2 inverseRadii = 1.0 / radii;\n\n // We describe the ellipse parametrically: v = radii * vec2(cos(t), sin(t))\n // but store the cos and sin of t in a vec2 for efficiency.\n // Initial guess: t = pi/4\n vec2 tTrigs = vec2(0.7071067811865476);\n // Initial guess of point on ellipsoid\n vec2 v = radii * tTrigs;\n // Center of curvature of the ellipse at v\n vec2 evolute = u_evoluteScale * tTrigs * tTrigs * tTrigs;\n\n const int iterations = 3;\n for (int i = 0; i < iterations; ++i) {\n // Find the (approximate) intersection of p - evolute with the ellipsoid.\n vec2 q = normalize(p - evolute) * length(v - evolute);\n // Update the estimate of t.\n tTrigs = (q + evolute) * inverseRadii;\n tTrigs = normalize(clamp(tTrigs, 0.0, 1.0));\n v = radii * tTrigs;\n evolute = u_evoluteScale * tTrigs * tTrigs * tTrigs;\n }\n\n return vec3(v * sign(pos), length(v - evolute));\n}\n\nPointJacobianT convertUvToShapeSpaceDerivative(in vec3 positionUv) {\n // Convert from UV space [0, 1] to local space [-1, 1]\n vec3 position = positionUv * 2.0 - 1.0;\n // Undo the scaling from ellipsoid to sphere\n position = position * u_ellipsoidRadiiUv;\n\n float longitude = atan(position.y, position.x);\n vec3 east = normalize(vec3(-position.y, position.x, 0.0));\n\n // Convert the 3D position to a 2D position relative to the ellipse (radii.x, radii.z)\n // (assume radii.y == radii.x) and find the nearest point on the ellipse and its normal\n float distanceFromZAxis = length(position.xy);\n vec2 posEllipse = vec2(distanceFromZAxis, position.z);\n vec3 surfacePointAndRadius = nearestPointAndRadiusOnEllipse(posEllipse, u_ellipsoidRadiiUv.xz);\n vec2 surfacePoint = surfacePointAndRadius.xy;\n\n vec2 normal2d = normalize(surfacePoint * u_ellipsoidInverseRadiiSquaredUv.xz);\n float latitude = atan(normal2d.y, normal2d.x);\n vec3 north = vec3(-normal2d.y * normalize(position.xy), abs(normal2d.x));\n\n float heightSign = length(posEllipse) < length(surfacePoint) ? -1.0 : 1.0;\n float height = heightSign * length(posEllipse - surfacePoint);\n vec3 up = normalize(cross(east, north));\n\n vec3 point = vec3(longitude, latitude, height);\n mat3 jacobianT = mat3(east / distanceFromZAxis, north / (surfacePointAndRadius.z + height), up);\n return PointJacobianT(point, jacobianT);\n}\n\nvec3 convertShapeToShapeUvSpace(in vec3 positionShape) {\n // Longitude: shift & scale to [0, 1]\n float longitude = (positionShape.x + czm_pi) / czm_twoPi;\n\n // Correct the angle when max < min\n // Technically this should compare against min longitude - but it has precision problems so compare against the middle of empty space.\n #if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE_MIN_MAX_REVERSED)\n longitude += float(longitude < u_ellipsoidShapeUvLongitudeMinMaxMid.z);\n #endif\n\n // Avoid flickering from reading voxels from both sides of the -pi/+pi discontinuity.\n #if defined(ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MIN_DISCONTINUITY)\n longitude = longitude > u_ellipsoidShapeUvLongitudeMinMaxMid.z ? u_ellipsoidShapeUvLongitudeMinMaxMid.x : longitude;\n #endif\n #if defined(ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MAX_DISCONTINUITY)\n longitude = longitude < u_ellipsoidShapeUvLongitudeMinMaxMid.z ? u_ellipsoidShapeUvLongitudeMinMaxMid.y : longitude;\n #endif\n\n #if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE)\n longitude = longitude * u_ellipsoidUvToShapeUvLongitude.x + u_ellipsoidUvToShapeUvLongitude.y;\n #endif\n\n // Latitude: shift and scale to [0, 1]\n float latitude = (positionShape.y + czm_piOverTwo) / czm_pi;\n #if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE)\n latitude = latitude * u_ellipsoidUvToShapeUvLatitude.x + u_ellipsoidUvToShapeUvLatitude.y;\n #endif\n\n // Height: scale to the range [0, 1]\n float height = 1.0 + positionShape.z * u_ellipsoidInverseHeightDifferenceUv;\n\n return vec3(longitude, latitude, height);\n}\n\nPointJacobianT convertUvToShapeUvSpaceDerivative(in vec3 positionUv) {\n PointJacobianT pointJacobian = convertUvToShapeSpaceDerivative(positionUv);\n pointJacobian.point = convertShapeToShapeUvSpace(pointJacobian.point);\n return pointJacobian;\n}\n\nvec3 scaleShapeUvToShapeSpace(in vec3 shapeUv) {\n // Convert from [0, 1] to radians [-pi, pi]\n float longitude = shapeUv.x * czm_twoPi;\n #if defined (ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE)\n longitude /= u_ellipsoidUvToShapeUvLongitude.x;\n #endif\n\n // Convert from [0, 1] to radians [-pi/2, pi/2]\n float latitude = shapeUv.y * czm_pi;\n #if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE)\n latitude /= u_ellipsoidUvToShapeUvLatitude.x;\n #endif\n \n float height = shapeUv.z / u_ellipsoidInverseHeightDifferenceUv;\n\n return vec3(longitude, latitude, height);\n}\n",_S,"// See IntersectionUtils.glsl for the definitions of Ray, NO_HIT, INF_HIT, Intersections,\n// RayShapeIntersection, setSurfaceIntersection, setShapeIntersection\n// See IntersectLongitude.glsl for the definitions of intersectHalfPlane,\n// intersectFlippedWedge, intersectRegularWedge\n\n/* Ellipsoid defines (set in Scene/VoxelEllipsoidShape.js)\n#define ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE\n#define ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_EQUAL_ZERO\n#define ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_UNDER_HALF\n#define ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_OVER_HALF\n#define ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_UNDER_HALF\n#define ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_EQUAL_HALF\n#define ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_OVER_HALF\n#define ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_UNDER_HALF\n#define ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_EQUAL_HALF\n#define ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_OVER_HALF\n#define ELLIPSOID_INTERSECTION_INDEX_LONGITUDE\n#define ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MAX\n#define ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MIN\n#define ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MAX\n#define ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MIN\n*/\n\n#if defined(ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE)\n uniform vec2 u_ellipsoidRenderLongitudeMinMax;\n#endif\nuniform float u_eccentricitySquared;\nuniform vec2 u_ellipsoidRenderLatitudeSinMinMax;\nuniform vec2 u_clipMinMaxHeight;\n\nRayShapeIntersection intersectZPlane(in Ray ray, in float z) {\n float t = -ray.pos.z / ray.dir.z;\n\n bool startsOutside = sign(ray.pos.z) == sign(z);\n bool entry = (t >= 0.0) != startsOutside;\n\n vec4 intersect = vec4(0.0, 0.0, z, t);\n vec4 farSide = vec4(normalize(ray.dir), INF_HIT);\n\n if (entry) {\n return RayShapeIntersection(intersect, farSide);\n } else {\n return RayShapeIntersection(-1.0 * farSide, intersect);\n }\n}\n\nRayShapeIntersection intersectHeight(in Ray ray, in float relativeHeight, in bool convex)\n{\n // Scale the ray by the ellipsoid axes to make it a unit sphere\n // Note: approximating ellipsoid + height as an ellipsoid\n vec3 radiiCorrection = u_ellipsoidRadiiUv / (u_ellipsoidRadiiUv + relativeHeight);\n vec3 position = ray.pos * radiiCorrection;\n vec3 direction = ray.dir * radiiCorrection;\n\n float a = dot(direction, direction); // ~ 1.0 (or maybe 4.0 if ray is scaled)\n float b = dot(direction, position); // roughly inside [-1.0, 1.0] when zoomed in\n float c = dot(position, position) - 1.0; // ~ 0.0 when zoomed in.\n float determinant = b * b - a * c; // ~ b * b when zoomed in\n\n if (determinant < 0.0) {\n vec4 miss = vec4(normalize(direction), NO_HIT);\n return RayShapeIntersection(miss, miss);\n }\n\n determinant = sqrt(determinant);\n\n // Compute larger root using standard formula\n float signB = b < 0.0 ? -1.0 : 1.0;\n // The other root may suffer from subtractive cancellation in the standard formula.\n // Compute it from the first root instead.\n float t1 = (-b - signB * determinant) / a;\n float t2 = c / (a * t1);\n float tmin = min(t1, t2);\n float tmax = max(t1, t2);\n\n float directionScale = convex ? 1.0 : -1.0;\n vec3 d1 = directionScale * normalize(position + tmin * direction);\n vec3 d2 = directionScale * normalize(position + tmax * direction);\n\n return RayShapeIntersection(vec4(d1, tmin), vec4(d2, tmax));\n}\n\n/**\n * Given a circular cone around the z-axis, with apex at the origin,\n * find the parametric distance(s) along a ray where that ray intersects\n * the cone.\n * The cone opening angle is described by the squared cosine of\n * its half-angle (the angle between the Z-axis and the surface)\n */\nvec2 intersectDoubleEndedCone(in Ray ray, in float cosSqrHalfAngle)\n{\n vec3 o = ray.pos;\n vec3 d = ray.dir;\n float sinSqrHalfAngle = 1.0 - cosSqrHalfAngle;\n\n float aSin = d.z * d.z * sinSqrHalfAngle;\n float aCos = -dot(d.xy, d.xy) * cosSqrHalfAngle;\n float a = aSin + aCos;\n\n float bSin = d.z * o.z * sinSqrHalfAngle;\n float bCos = -dot(o.xy, d.xy) * cosSqrHalfAngle;\n float b = bSin + bCos;\n\n float cSin = o.z * o.z * sinSqrHalfAngle;\n float cCos = -dot(o.xy, o.xy) * cosSqrHalfAngle;\n float c = cSin + cCos;\n // determinant = b * b - a * c. But bSin * bSin = aSin * cSin.\n // Avoid subtractive cancellation by expanding to eliminate these terms\n float determinant = 2.0 * bSin * bCos + bCos * bCos - aSin * cCos - aCos * cSin - aCos * cCos;\n\n if (determinant < 0.0) {\n return vec2(NO_HIT);\n } else if (a == 0.0) {\n // Ray is parallel to cone surface\n return (b == 0.0)\n ? vec2(NO_HIT) // Ray is on cone surface\n : vec2(-0.5 * c / b, NO_HIT);\n }\n\n determinant = sqrt(determinant);\n\n // Compute larger root using standard formula\n float signB = b < 0.0 ? -1.0 : 1.0;\n float t1 = (-b - signB * determinant) / a;\n // The other root may suffer from subtractive cancellation in the standard formula.\n // Compute it from the first root instead.\n float t2 = c / (a * t1);\n float tmin = min(t1, t2);\n float tmax = max(t1, t2);\n return vec2(tmin, tmax);\n}\n\n/**\n * Given a point on a conical surface, find the surface normal at that point.\n */\nvec3 getConeNormal(in vec3 p, in bool convex) {\n // Start with radial component pointing toward z-axis\n vec2 radial = -abs(p.z) * normalize(p.xy);\n // Z component points toward opening of cone\n float zSign = (p.z < 0.0) ? -1.0 : 1.0;\n float z = length(p.xy) * zSign;\n // Flip normal if shape is convex\n float flip = (convex) ? -1.0 : 1.0;\n return normalize(vec3(radial, z) * flip);\n}\n\n/**\n * Compute the shift between the ellipsoid origin and the apex of a cone of latitude\n */\nfloat getLatitudeConeShift(in float sinLatitude) {\n // Find prime vertical radius of curvature: \n // the distance along the ellipsoid normal to the intersection with the z-axis\n float x2 = u_eccentricitySquared * sinLatitude * sinLatitude;\n float primeVerticalRadius = inversesqrt(1.0 - x2);\n\n // Compute a shift from the origin to the intersection of the cone with the z-axis\n return primeVerticalRadius * u_eccentricitySquared * sinLatitude;\n}\n\nvoid intersectFlippedCone(in Ray ray, in float cosHalfAngle, out RayShapeIntersection intersections[2]) {\n // Undo the scaling from ellipsoid to sphere\n ray.pos = ray.pos * u_ellipsoidRadiiUv;\n ray.dir = ray.dir * u_ellipsoidRadiiUv;\n // Shift the ray to account for the latitude cone not being centered at the Earth center\n ray.pos.z += getLatitudeConeShift(cosHalfAngle);\n\n float cosSqrHalfAngle = cosHalfAngle * cosHalfAngle;\n vec2 intersect = intersectDoubleEndedCone(ray, cosSqrHalfAngle);\n\n vec4 miss = vec4(normalize(ray.dir), NO_HIT);\n vec4 farSide = vec4(normalize(ray.dir), INF_HIT);\n\n // Initialize output with no intersections\n intersections[0].entry = -1.0 * farSide;\n intersections[0].exit = farSide;\n intersections[1].entry = miss;\n intersections[1].exit = miss;\n\n if (intersect.x == NO_HIT) {\n return;\n }\n\n // Find the points of intersection\n float tmin = intersect.x;\n float tmax = intersect.y;\n vec3 p0 = ray.pos + tmin * ray.dir;\n vec3 p1 = ray.pos + tmax * ray.dir;\n\n vec4 intersect0 = vec4(getConeNormal(p0, true), tmin);\n vec4 intersect1 = vec4(getConeNormal(p1, true), tmax);\n\n bool p0InShadowCone = sign(p0.z) != sign(cosHalfAngle);\n bool p1InShadowCone = sign(p1.z) != sign(cosHalfAngle);\n\n if (p0InShadowCone && p1InShadowCone) {\n // no valid intersections\n } else if (p0InShadowCone) {\n intersections[0].exit = intersect1;\n } else if (p1InShadowCone) {\n intersections[0].entry = intersect0;\n } else {\n intersections[0].exit = intersect0;\n intersections[1].entry = intersect1;\n intersections[1].exit = farSide;\n }\n}\n\nRayShapeIntersection intersectRegularCone(in Ray ray, in float cosHalfAngle, in bool convex) {\n // Undo the scaling from ellipsoid to sphere\n ray.pos = ray.pos * u_ellipsoidRadiiUv;\n ray.dir = ray.dir * u_ellipsoidRadiiUv;\n // Shift the ray to account for the latitude cone not being centered at the Earth center\n ray.pos.z += getLatitudeConeShift(cosHalfAngle);\n\n float cosSqrHalfAngle = cosHalfAngle * cosHalfAngle;\n vec2 intersect = intersectDoubleEndedCone(ray, cosSqrHalfAngle);\n\n vec4 miss = vec4(normalize(ray.dir), NO_HIT);\n vec4 farSide = vec4(normalize(ray.dir), INF_HIT);\n\n if (intersect.x == NO_HIT) {\n return RayShapeIntersection(miss, miss);\n }\n\n // Find the points of intersection\n float tmin = intersect.x;\n float tmax = intersect.y;\n vec3 p0 = ray.pos + tmin * ray.dir;\n vec3 p1 = ray.pos + tmax * ray.dir;\n\n vec4 intersect0 = vec4(getConeNormal(p0, convex), tmin);\n vec4 intersect1 = vec4(getConeNormal(p1, convex), tmax);\n\n bool p0InShadowCone = sign(p0.z) != sign(cosHalfAngle);\n bool p1InShadowCone = sign(p1.z) != sign(cosHalfAngle);\n\n if (p0InShadowCone && p1InShadowCone) {\n return RayShapeIntersection(miss, miss);\n } else if (p0InShadowCone) {\n return RayShapeIntersection(intersect1, farSide);\n } else if (p1InShadowCone) {\n return RayShapeIntersection(-1.0 * farSide, intersect0);\n } else {\n return RayShapeIntersection(intersect0, intersect1);\n }\n}\n\nvoid intersectShape(in Ray ray, inout Intersections ix) {\n // Position is converted from [0,1] to [-1,+1] because shape intersections assume unit space is [-1,+1].\n // Direction is scaled as well to be in sync with position.\n ray.pos = ray.pos * 2.0 - 1.0;\n ray.dir *= 2.0;\n\n // Outer ellipsoid\n RayShapeIntersection outerIntersect = intersectHeight(ray, u_clipMinMaxHeight.y, true);\n setShapeIntersection(ix, ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MAX, outerIntersect);\n\n // Exit early if the outer ellipsoid was missed.\n if (outerIntersect.entry.w == NO_HIT) {\n return;\n }\n\n // Inner ellipsoid\n RayShapeIntersection innerIntersect = intersectHeight(ray, u_clipMinMaxHeight.x, false);\n\n if (innerIntersect.entry.w == NO_HIT) {\n setShapeIntersection(ix, ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MIN, innerIntersect);\n } else {\n // When the ellipsoid is large and thin it's possible for floating point math\n // to cause the ray to intersect the inner ellipsoid before the outer ellipsoid. \n // To prevent this from happening, clamp innerIntersect to outerIntersect and\n // sandwich the inner ellipsoid intersection inside the outer ellipsoid intersection.\n\n // Without this special case,\n // [outerMin, outerMax, innerMin, innerMax] will bubble sort to\n // [outerMin, innerMin, outerMax, innerMax] which will cause the back\n // side of the ellipsoid to be invisible because it will think the ray\n // is still inside the inner (negative) ellipsoid after exiting the\n // outer (positive) ellipsoid.\n\n // With this special case,\n // [outerMin, innerMin, innerMax, outerMax] will bubble sort to\n // [outerMin, innerMin, innerMax, outerMax] which will work correctly.\n\n // Note: If initializeIntersections() changes its sorting function\n // from bubble sort to something else, this code may need to change.\n innerIntersect.entry.w = max(innerIntersect.entry.w, outerIntersect.entry.w);\n innerIntersect.exit.w = min(innerIntersect.exit.w, outerIntersect.exit.w);\n setSurfaceIntersection(ix, 0, outerIntersect.entry, true, true); // positive, enter\n setSurfaceIntersection(ix, 1, innerIntersect.entry, false, true); // negative, enter\n setSurfaceIntersection(ix, 2, innerIntersect.exit, false, false); // negative, exit\n setSurfaceIntersection(ix, 3, outerIntersect.exit, true, false); // positive, exit\n }\n\n // Bottom cone\n #if defined(ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_UNDER_HALF)\n RayShapeIntersection bottomConeIntersection = intersectRegularCone(ray, u_ellipsoidRenderLatitudeSinMinMax.x, false);\n setShapeIntersection(ix, ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MIN, bottomConeIntersection);\n #elif defined(ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_EQUAL_HALF)\n RayShapeIntersection bottomConeIntersection = intersectZPlane(ray, -1.0);\n setShapeIntersection(ix, ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MIN, bottomConeIntersection);\n #elif defined(ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_OVER_HALF)\n RayShapeIntersection bottomConeIntersections[2];\n intersectFlippedCone(ray, u_ellipsoidRenderLatitudeSinMinMax.x, bottomConeIntersections);\n setShapeIntersection(ix, ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MIN + 0, bottomConeIntersections[0]);\n setShapeIntersection(ix, ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MIN + 1, bottomConeIntersections[1]);\n #endif\n\n // Top cone\n #if defined(ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_UNDER_HALF)\n RayShapeIntersection topConeIntersections[2];\n intersectFlippedCone(ray, u_ellipsoidRenderLatitudeSinMinMax.y, topConeIntersections);\n setShapeIntersection(ix, ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MAX + 0, topConeIntersections[0]);\n setShapeIntersection(ix, ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MAX + 1, topConeIntersections[1]);\n #elif defined(ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_EQUAL_HALF)\n RayShapeIntersection topConeIntersection = intersectZPlane(ray, 1.0);\n setShapeIntersection(ix, ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MAX, topConeIntersection);\n #elif defined(ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_OVER_HALF)\n RayShapeIntersection topConeIntersection = intersectRegularCone(ray, u_ellipsoidRenderLatitudeSinMinMax.y, false);\n setShapeIntersection(ix, ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MAX, topConeIntersection);\n #endif\n\n // Wedge\n #if defined(ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_EQUAL_ZERO)\n RayShapeIntersection wedgeIntersects[2];\n intersectHalfPlane(ray, u_ellipsoidRenderLongitudeMinMax.x, wedgeIntersects);\n setShapeIntersection(ix, ELLIPSOID_INTERSECTION_INDEX_LONGITUDE + 0, wedgeIntersects[0]);\n setShapeIntersection(ix, ELLIPSOID_INTERSECTION_INDEX_LONGITUDE + 1, wedgeIntersects[1]);\n #elif defined(ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_UNDER_HALF)\n RayShapeIntersection wedgeIntersect = intersectRegularWedge(ray, u_ellipsoidRenderLongitudeMinMax);\n setShapeIntersection(ix, ELLIPSOID_INTERSECTION_INDEX_LONGITUDE, wedgeIntersect);\n #elif defined(ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_OVER_HALF)\n RayShapeIntersection wedgeIntersects[2];\n intersectFlippedWedge(ray, u_ellipsoidRenderLongitudeMinMax, wedgeIntersects);\n setShapeIntersection(ix, ELLIPSOID_INTERSECTION_INDEX_LONGITUDE + 0, wedgeIntersects[0]);\n setShapeIntersection(ix, ELLIPSOID_INTERSECTION_INDEX_LONGITUDE + 1, wedgeIntersects[1]);\n #endif\n}\n",_C])),t.addFragmentLines(["// See Intersection.glsl for the definition of intersectScene\n// See IntersectionUtils.glsl for the definition of nextIntersection\n// See convertUvToBox.glsl, convertUvToCylinder.glsl, or convertUvToEllipsoid.glsl\n// for the definition of convertUvToShapeUvSpace. The appropriate function is \n// selected based on the VoxelPrimitive shape type, and added to the shader in\n// Scene/VoxelRenderResources.js.\n// See Octree.glsl for the definitions of TraversalData, SampleData,\n// traverseOctreeFromBeginning, and traverseOctreeFromExisting\n// See Megatexture.glsl for the definition of accumulatePropertiesFromMegatexture\n\n#define STEP_COUNT_MAX 1000 // Harcoded value because GLSL doesn't like variable length loops\n#if defined(PICKING_VOXEL)\n #define ALPHA_ACCUM_MAX 0.1\n#else\n #define ALPHA_ACCUM_MAX 0.98 // Must be > 0.0 and <= 1.0\n#endif\n\nuniform mat3 u_transformDirectionViewToLocal;\nuniform vec3 u_cameraPositionUv;\nuniform float u_stepSize;\n\n#if defined(PICKING)\n uniform vec4 u_pickColor;\n#endif\n\nvec3 getSampleSize(in int level) {\n vec3 sampleCount = exp2(float(level)) * vec3(u_dimensions);\n vec3 sampleSizeUv = 1.0 / sampleCount;\n return scaleShapeUvToShapeSpace(sampleSizeUv);\n}\n\n#define MINIMUM_STEP_SCALAR (0.02)\n#define SHIFT_FRACTION (0.001)\n\n/**\n * Given a coordinate within a tile, and sample spacings along a ray through\n * the coordinate, find the distance to the points where the ray entered and\n * exited the voxel cell, along with the surface normals at those points.\n * The surface normals are returned in shape space coordinates.\n */\nRayShapeIntersection getVoxelIntersection(in vec3 tileUv, in vec3 sampleSizeAlongRay) {\n vec3 voxelCoord = tileUv * vec3(u_dimensions);\n vec3 directions = sign(sampleSizeAlongRay);\n vec3 positiveDirections = max(directions, 0.0);\n vec3 entryCoord = mix(ceil(voxelCoord), floor(voxelCoord), positiveDirections);\n vec3 exitCoord = entryCoord + directions;\n\n vec3 distanceFromEntry = -abs((entryCoord - voxelCoord) * sampleSizeAlongRay);\n float lastEntry = maxComponent(distanceFromEntry);\n bvec3 isLastEntry = equal(distanceFromEntry, vec3(lastEntry));\n vec3 entryNormal = -1.0 * vec3(isLastEntry) * directions;\n vec4 entry = vec4(entryNormal, lastEntry);\n\n vec3 distanceToExit = abs((exitCoord - voxelCoord) * sampleSizeAlongRay);\n float firstExit = minComponent(distanceToExit);\n bvec3 isFirstExit = equal(distanceToExit, vec3(firstExit));\n vec3 exitNormal = vec3(isFirstExit) * directions;\n vec4 exit = vec4(exitNormal, firstExit);\n\n return RayShapeIntersection(entry, exit);\n}\n\nvec4 getStepSize(in SampleData sampleData, in Ray viewRay, in RayShapeIntersection shapeIntersection, in mat3 jacobianT, in float currentT) {\n // The Jacobian is computed in a space where the shape spans [-1, 1].\n // But the ray is marched in a space where the shape fills [0, 1].\n // So we need to scale the Jacobian by 2.\n vec3 gradient = 2.0 * viewRay.rawDir * jacobianT;\n vec3 sampleSizeAlongRay = getSampleSize(sampleData.tileCoords.w) / gradient;\n\n RayShapeIntersection voxelIntersection = getVoxelIntersection(sampleData.tileUv, sampleSizeAlongRay);\n\n // Transform normal from shape space to Cartesian space\n vec3 voxelNormal = normalize(jacobianT * voxelIntersection.entry.xyz);\n // Compare with the shape intersection, to choose the appropriate normal\n vec4 voxelEntry = vec4(voxelNormal, currentT + voxelIntersection.entry.w);\n vec4 entry = intersectionMax(shapeIntersection.entry, voxelEntry);\n\n float fixedStep = minComponent(abs(sampleSizeAlongRay)) * u_stepSize;\n float shift = fixedStep * SHIFT_FRACTION;\n float dt = voxelIntersection.exit.w + shift;\n if ((currentT + dt) > shapeIntersection.exit.w) {\n // Stop at end of shape\n dt = shapeIntersection.exit.w - currentT + shift;\n }\n float stepSize = clamp(dt, fixedStep * MINIMUM_STEP_SCALAR, fixedStep + shift);\n\n return vec4(entry.xyz, stepSize);\n}\n\nvec2 packIntToVec2(int value) {\n float shifted = float(value) / 255.0;\n float lowBits = fract(shifted);\n float highBits = floor(shifted) / 255.0;\n return vec2(highBits, lowBits);\n}\n\nvec2 packFloatToVec2(float value) {\n float lowBits = fract(value);\n float highBits = floor(value) / 255.0;\n return vec2(highBits, lowBits);\n}\n\nint getSampleIndex(in vec3 tileUv) {\n ivec3 voxelDimensions = u_dimensions;\n vec3 sampleCoordinate = tileUv * vec3(voxelDimensions);\n // tileUv = 1.0 is a valid coordinate but sampleIndex = voxelDimensions is not.\n // (tileUv = 1.0 corresponds to the last sample, at index = voxelDimensions - 1).\n // Clamp to [0, voxelDimensions - 0.5) to avoid numerical error before flooring\n vec3 maxCoordinate = vec3(voxelDimensions) - vec3(0.5);\n sampleCoordinate = clamp(sampleCoordinate, vec3(0.0), maxCoordinate);\n ivec3 sampleIndex = ivec3(floor(sampleCoordinate));\n #if defined(PADDING)\n voxelDimensions += u_paddingBefore + u_paddingAfter;\n sampleIndex += u_paddingBefore;\n #endif\n // Convert to a 1D index for lookup in a 1D data array\n return sampleIndex.x + voxelDimensions.x * (sampleIndex.y + voxelDimensions.y * sampleIndex.z);\n}\n\nvoid main()\n{\n vec4 fragCoord = gl_FragCoord;\n vec2 screenCoord = (fragCoord.xy - czm_viewport.xy) / czm_viewport.zw; // [0,1]\n vec3 eyeDirection = normalize(czm_windowToEyeCoordinates(fragCoord).xyz);\n vec3 viewDirWorld = normalize(czm_inverseViewRotation * eyeDirection); // normalize again just in case\n vec3 viewDirUv = normalize(u_transformDirectionViewToLocal * eyeDirection); // normalize again just in case\n vec3 viewPosUv = u_cameraPositionUv;\n #if defined(SHAPE_ELLIPSOID)\n // viewDirUv has been scaled to a space where the ellipsoid is a sphere.\n // Undo this scaling to get the raw direction.\n vec3 rawDir = viewDirUv * u_ellipsoidRadiiUv;\n Ray viewRayUv = Ray(viewPosUv, viewDirUv, rawDir);\n #else\n Ray viewRayUv = Ray(viewPosUv, viewDirUv, viewDirUv);\n #endif\n\n Intersections ix;\n RayShapeIntersection shapeIntersection = intersectScene(screenCoord, viewRayUv, ix);\n\n // Exit early if the scene was completely missed.\n if (shapeIntersection.entry.w == NO_HIT) {\n discard;\n }\n\n float currentT = shapeIntersection.entry.w;\n float endT = shapeIntersection.exit.w;\n vec3 positionUv = viewPosUv + currentT * viewDirUv;\n PointJacobianT pointJacobian = convertUvToShapeUvSpaceDerivative(positionUv);\n\n // Traverse the tree from the start position\n TraversalData traversalData;\n SampleData sampleDatas[SAMPLE_COUNT];\n traverseOctreeFromBeginning(pointJacobian.point, traversalData, sampleDatas);\n vec4 step = getStepSize(sampleDatas[0], viewRayUv, shapeIntersection, pointJacobian.jacobianT, currentT);\n\n #if defined(JITTER)\n float noise = hash(screenCoord); // [0,1]\n currentT += noise * step.w;\n positionUv += noise * step.w * viewDirUv;\n #endif\n\n FragmentInput fragmentInput;\n #if defined(STATISTICS)\n setStatistics(fragmentInput.metadata.statistics);\n #endif\n\n vec4 colorAccum = vec4(0.0);\n\n for (int stepCount = 0; stepCount < STEP_COUNT_MAX; ++stepCount) {\n // Read properties from the megatexture based on the traversal state\n Properties properties = accumulatePropertiesFromMegatexture(sampleDatas);\n\n // Prepare the custom shader inputs\n copyPropertiesToMetadata(properties, fragmentInput.metadata);\n fragmentInput.voxel.positionUv = positionUv;\n fragmentInput.voxel.positionShapeUv = pointJacobian.point;\n fragmentInput.voxel.positionUvLocal = sampleDatas[0].tileUv;\n fragmentInput.voxel.viewDirUv = viewDirUv;\n fragmentInput.voxel.viewDirWorld = viewDirWorld;\n fragmentInput.voxel.surfaceNormal = step.xyz;\n fragmentInput.voxel.travelDistance = step.w;\n fragmentInput.voxel.stepCount = stepCount;\n fragmentInput.voxel.tileIndex = sampleDatas[0].megatextureIndex;\n fragmentInput.voxel.sampleIndex = getSampleIndex(sampleDatas[0].tileUv);\n\n // Run the custom shader\n czm_modelMaterial materialOutput;\n fragmentMain(fragmentInput, materialOutput);\n\n // Sanitize the custom shader output\n vec4 color = vec4(materialOutput.diffuse, materialOutput.alpha);\n color.rgb = max(color.rgb, vec3(0.0));\n color.a = clamp(color.a, 0.0, 1.0);\n\n // Pre-multiplied alpha blend\n colorAccum += (1.0 - colorAccum.a) * vec4(color.rgb * color.a, color.a);\n\n // Stop traversing if the alpha has been fully saturated\n if (colorAccum.a > ALPHA_ACCUM_MAX) {\n colorAccum.a = ALPHA_ACCUM_MAX;\n break;\n }\n\n if (step.w == 0.0) {\n // Shape is infinitely thin. The ray may have hit the edge of a\n // foreground voxel. Step ahead slightly to check for more voxels\n step.w == 0.00001;\n }\n\n // Keep raymarching\n currentT += step.w;\n positionUv = viewPosUv + currentT * viewDirUv;\n\n // Check if there's more intersections.\n if (currentT > endT) {\n #if (INTERSECTION_COUNT == 1)\n break;\n #else\n shapeIntersection = nextIntersection(ix);\n if (shapeIntersection.entry.w == NO_HIT) {\n break;\n } else {\n // Found another intersection. Resume raymarching there\n currentT = shapeIntersection.entry.w;\n endT = shapeIntersection.exit.w;\n positionUv = viewPosUv + currentT * viewDirUv;\n }\n #endif\n }\n\n // Traverse the tree from the current ray position.\n // This is similar to traverseOctreeFromBeginning but is faster when the ray is in the same tile as the previous step.\n pointJacobian = convertUvToShapeUvSpaceDerivative(positionUv);\n traverseOctreeFromExisting(pointJacobian.point, traversalData, sampleDatas);\n step = getStepSize(sampleDatas[0], viewRayUv, shapeIntersection, pointJacobian.jacobianT, currentT);\n }\n\n // Convert the alpha from [0,ALPHA_ACCUM_MAX] to [0,1]\n colorAccum.a /= ALPHA_ACCUM_MAX;\n\n #if defined(PICKING)\n // If alpha is 0.0 there is nothing to pick\n if (colorAccum.a == 0.0) {\n discard;\n }\n out_FragColor = u_pickColor;\n #elif defined(PICKING_VOXEL)\n // If alpha is 0.0 there is nothing to pick\n if (colorAccum.a == 0.0) {\n discard;\n }\n vec2 megatextureId = packIntToVec2(sampleDatas[0].megatextureIndex);\n vec2 sampleIndex = packIntToVec2(getSampleIndex(sampleDatas[0].tileUv));\n out_FragColor = vec4(megatextureId, sampleIndex);\n #else\n out_FragColor = colorAccum;\n #endif\n}\n"]);let l=e._shape,c=l.shaderDefines;for(let e in c)if(c.hasOwnProperty(e)){let i=c[e];(0,y.Z)(i)&&(i=!0===i?void 0:i,t.addDefine(e,i,_x.Z.FRAGMENT))}let u=l.shaderMaximumIntersectionsLength;a>0&&(t.addDefine("CLIPPING_PLANES_INTERSECTION_INDEX",u,_x.Z.FRAGMENT),1===a?u+=1:o.unionClippingRegions?u+=2:u+=1),e._depthTest&&(t.addDefine("DEPTH_INTERSECTION_INDEX",u,_x.Z.FRAGMENT),u+=1),t.addDefine("INTERSECTION_COUNT",u,_x.Z.FRAGMENT),_.Z.equals(e.paddingBefore,_.Z.ZERO)&&_.Z.equals(e.paddingAfter,_.Z.ZERO)||t.addDefine("PADDING",void 0,_x.Z.FRAGMENT),e._useLogDepth&&t.addDefine("LOG_DEPTH_READ_ONLY",void 0,_x.Z.FRAGMENT),e._jitter&&t.addDefine("JITTER",void 0,_x.Z.FRAGMENT),e._nearestSampling&&t.addDefine("NEAREST_SAMPLING",void 0,_x.Z.FRAGMENT);let h=e._traversal;t.addDefine("SAMPLE_COUNT",`${h._sampleCount}`,_x.Z.FRAGMENT)};function _I(e){return e===_b.Z.SCALAR?"float":e===_b.Z.VEC2?"vec2":e===_b.Z.VEC3?"vec3":e===_b.Z.VEC4?"vec4":void 0}function _O(e){let t=e.toString();return -1===t.indexOf(".")&&(t=`${e}.0`),t}var _D=function(e,t){var i,n,r;let{shaderBuilder:o}=e,{names:a,types:s,componentTypes:l,minimumValues:c,maximumValues:u}=t._provider,h=s.length,d=(0,y.Z)(c)&&(0,y.Z)(u);o.addDefine("METADATA_COUNT",h,_x.Z.FRAGMENT),d&&o.addDefine("STATISTICS",void 0,_x.Z.FRAGMENT);for(let e=0;e<h;e++){let t=a[e],i=s[e],n=`PropertyStatistics_${t}`,r=`PropertyStatistics_${t}`;o.addStruct(n,r,_x.Z.FRAGMENT);let l=_I(i);o.addStructField(n,l,"min"),o.addStructField(n,l,"max")}let f="Statistics",p="Statistics",m="statistics";o.addStruct(f,p,_x.Z.FRAGMENT);for(let e=0;e<h;e++){let t=a[e],i=`PropertyStatistics_${t}`;o.addStructField(f,i,t)}let _="Metadata",g="Metadata",Z="metadata";o.addStruct(_,g,_x.Z.FRAGMENT),o.addStructField(_,p,m);for(let e=0;e<h;e++){let t=a[e],i=_I(s[e]);o.addStructField(_,i,t)}for(let e=0;e<h;e++){let t=a[e],n=(i=s[e])===_b.Z.SCALAR?"vec3":i===_b.Z.VEC2?"mat2":i===_b.Z.VEC3?"mat3":i===_b.Z.VEC4?"mat4":void 0,r=`VoxelProperty_${t}`,l=`VoxelProperty_${t}`;o.addStruct(r,l,_x.Z.FRAGMENT),o.addStructField(r,n,"partialDerivativeLocal"),o.addStructField(r,n,"partialDerivativeWorld"),o.addStructField(r,n,"partialDerivativeView"),o.addStructField(r,n,"partialDerivativeValid")}let b="Voxel",v="Voxel";o.addStruct(b,v,_x.Z.FRAGMENT);for(let e=0;e<h;e++){let t=a[e],i=`VoxelProperty_${t}`;o.addStructField(b,i,t)}o.addStructField(b,"vec3","positionEC"),o.addStructField(b,"vec3","positionUv"),o.addStructField(b,"vec3","positionShapeUv"),o.addStructField(b,"vec3","positionUvLocal"),o.addStructField(b,"vec3","viewDirUv"),o.addStructField(b,"vec3","viewDirWorld"),o.addStructField(b,"vec3","surfaceNormal"),o.addStructField(b,"float","travelDistance"),o.addStructField(b,"int","stepCount"),o.addStructField(b,"int","tileIndex"),o.addStructField(b,"int","sampleIndex");let T="FragmentInput";o.addStruct(T,"FragmentInput",_x.Z.FRAGMENT),o.addStructField(T,g,Z),o.addStructField(T,v,"voxel");let E="Properties",x="Properties",w="properties";o.addStruct(E,x,_x.Z.FRAGMENT);for(let e=0;e<h;e++){let t=a[e],i=_I(s[e]);o.addStructField(E,i,t)}{let e="clearProperties";o.addFunction(e,`${x} clearProperties()`,_x.Z.FRAGMENT),o.addFunctionLines(e,[`${x} ${w};`]);for(let t=0;t<h;t++){let i=a[t],n=_I(s[t],l[t]);o.addFunctionLines(e,[`${w}.${i} = ${n}(0.0);`])}o.addFunctionLines(e,[`return ${w};`])}{let e="sumProperties";o.addFunction(e,`${x} sumProperties(${x} propertiesA, ${x} propertiesB)`,_x.Z.FRAGMENT),o.addFunctionLines(e,[`${x} ${w};`]);for(let t=0;t<h;t++){let i=a[t];o.addFunctionLines(e,[`${w}.${i} = propertiesA.${i} + propertiesB.${i};`])}o.addFunctionLines(e,[`return ${w};`])}{let e="scaleProperties";o.addFunction(e,`${x} scaleProperties(${x} ${w}, float scale)`,_x.Z.FRAGMENT),o.addFunctionLines(e,[`${x} scaledProperties = ${w};`]);for(let t=0;t<h;t++){let i=a[t];o.addFunctionLines(e,[`scaledProperties.${i} *= scale;`])}o.addFunctionLines(e,["return scaledProperties;"])}{let e="mixProperties";o.addFunction(e,`${x} mixProperties(${x} propertiesA, ${x} propertiesB, float mixFactor)`,_x.Z.FRAGMENT),o.addFunctionLines(e,[`${x} ${w};`]);for(let t=0;t<h;t++){let i=a[t];o.addFunctionLines(e,[`${w}.${i} = mix(propertiesA.${i}, propertiesB.${i}, mixFactor);`])}o.addFunctionLines(e,[`return ${w};`])}{let e="copyPropertiesToMetadata";o.addFunction(e,`void copyPropertiesToMetadata(in ${x} ${w}, inout ${g} ${Z})`,_x.Z.FRAGMENT);for(let t=0;t<h;t++){let i=a[t];o.addFunctionLines(e,[`${Z}.${i} = ${w}.${i};`])}}if(d){let e="setStatistics";o.addFunction(e,`void setStatistics(inout ${p} ${m})`,_x.Z.FRAGMENT);for(let t=0;t<h;t++){let i=a[t],r=s[t],l=_b.Z.getComponentCount(r);for(let a=0;a<l;a++){let s=(n=a,r===_b.Z.SCALAR?"":`[${n}]`),l=c[t][a],h=u[t][a];o.addFunctionLines(e,[`${m}.${i}.min${s} = ${_O(l)};`,`${m}.${i}.max${s} = ${_O(h)};`])}}}{let e="getPropertiesFromMegatextureAtUv";o.addFunction(e,`${x} getPropertiesFromMegatextureAtUv(vec2 texcoord)`,_x.Z.FRAGMENT),o.addFunctionLines(e,[`${x} ${w};`]);for(let t=0;t<h;t++){let i=a[t],n=(r=s[t],l[t],r===_b.Z.SCALAR?".r":r===_b.Z.VEC2?".ra":r===_b.Z.VEC3?".rgb":r===_b.Z.VEC4?"":void 0);o.addFunctionLines(e,[`properties.${i} = texture(u_megatextureTextures[${t}], texcoord)${n};`])}o.addFunctionLines(e,[`return ${w};`])}},_P=function(e,t){let i=new _A(e);_D(i,e);let{shaderBuilder:n,clippingPlanes:r,clippingPlanesLength:o}=i;if(o>0){let e="getClippingPlane",i=ez(r,t),o=i.indexOf(")")+1,a=i.indexOf("{",o)+1,s=i.indexOf("}",a),l=i.slice(0,o),c=i.slice(a,s);n.addFunction(e,l,_x.Z.FRAGMENT),n.addFunctionLines(e,[c])}let a=n.clone();a.addDefine("PICKING",void 0,_x.Z.FRAGMENT);let s=n.clone();s.addDefine("PICKING_VOXEL",void 0,_x.Z.FRAGMENT);let l=n.buildShaderProgram(t),c=a.buildShaderProgram(t),u=s.buildShaderProgram(t),h=e5.Z.fromCache({cull:{enabled:!0,face:ow.Z.BACK},depthTest:{enabled:!1},depthMask:!1,blending:e8.Z.PRE_MULTIPLIED_ALPHA_BLEND}),d=t.getViewportQuadVertexArray(),f=e._depthTest,p=new e3.Z({vertexArray:d,primitiveType:eK.Z.TRIANGLES,renderState:h,shaderProgram:l,uniformMap:i.uniformMap,modelMatrix:e._compoundModelMatrix,pass:e4.Z.VOXELS,executeInClosestFrustum:!0,owner:this,cull:f,occlude:f}),m=e3.Z.shallowClone(p,new e3.Z);m.shaderProgram=c,m.pickOnly=!0;let _=e3.Z.shallowClone(p,new e3.Z);if(_.shaderProgram=u,_.pickOnly=!0,(0,y.Z)(e._drawCommand)){let t=e._drawCommand;t.shaderProgram=t.shaderProgram&&t.shaderProgram.destroy()}if((0,y.Z)(e._drawCommandPick)){let t=e._drawCommandPick;t.shaderProgram=t.shaderProgram&&t.shaderProgram.destroy()}if((0,y.Z)(e._drawCommandPickVoxel)){let t=e._drawCommandPickVoxel;t.shaderProgram=t.shaderProgram&&t.shaderProgram.destroy()}e._drawCommand=p,e._drawCommandPick=m,e._drawCommandPickVoxel=_},_R=i(5776),_N=i(9508),_L=i(2494);function _M(){this.orientedBoundingBox=new B.Z,this.boundingSphere=new S.Z,this.boundTransform=new z.Z,this.shapeTransform=new z.Z,this._minBounds=_.Z.clone(_M.DefaultMinBounds,new _.Z),this._maxBounds=_.Z.clone(_M.DefaultMaxBounds,new _.Z),this.shaderUniforms={renderMinBounds:new _.Z,renderMaxBounds:new _.Z,boxUvToShapeUvScale:new _.Z,boxUvToShapeUvTranslate:new _.Z},this.shaderDefines={BOX_INTERSECTION_INDEX:void 0,BOX_HAS_SHAPE_BOUNDS:void 0},this.shaderMaximumIntersectionsLength=0}let _F=new _.Z,_z=new _.Z,_B=new rW.Z,_U=new _.Z,_k=new _.Z,_V=new _.Z,_H=new _.Z,_G=z.Z.fromRotationTranslation(rW.Z.fromUniformScale(.5,new rW.Z),new _.Z(.5,.5,.5),new z.Z);_M.prototype.update=function(e,t,i,n,r){n=(0,Z.Z)(n,_M.DefaultMinBounds),r=(0,Z.Z)(r,_M.DefaultMaxBounds),D.Z.typeOf.object("modelMatrix",e),D.Z.typeOf.object("minBounds",t),D.Z.typeOf.object("maxBounds",i);let o=_M.DefaultMinBounds,a=_M.DefaultMaxBounds;t=this._minBounds=_.Z.clamp(t,o,a,this._minBounds),i=this._maxBounds=_.Z.clamp(i,o,a,this._maxBounds),n=_.Z.clamp(n,o,a,_U),r=_.Z.clamp(r,o,a,_k);let s=_.Z.clamp(t,n,r,_V),l=_.Z.clamp(i,n,r,_H),c=z.Z.getScale(e,_z);if(s.x>l.x||s.y>l.y||s.z>l.z||(s.x===l.x)+(s.y===l.y)+(s.z===l.z)>=2||n.x>r.x||n.y>r.y||n.z>r.z||0===c.x||0===c.y||0===c.z)return!1;this.shapeTransform=z.Z.clone(e,this.shapeTransform),this.orientedBoundingBox=_Y(s,l,this.shapeTransform,this.orientedBoundingBox),this.boundTransform=z.Z.fromRotationTranslation(this.orientedBoundingBox.halfAxes,this.orientedBoundingBox.center,this.boundTransform),this.boundingSphere=S.Z.fromOrientedBoundingBox(this.orientedBoundingBox,this.boundingSphere);let{shaderUniforms:u,shaderDefines:h}=this;for(let e in h)h.hasOwnProperty(e)&&(h[e]=void 0);let d=!_.Z.equals(t,o)||!_.Z.equals(i,a),f=0;if(h.BOX_INTERSECTION_INDEX=f,f+=1,u.renderMinBounds=z.Z.multiplyByPoint(_G,s,u.renderMinBounds),u.renderMaxBounds=z.Z.multiplyByPoint(_G,l,u.renderMaxBounds),d){h.BOX_HAS_SHAPE_BOUNDS=!0;let e=t,n=i;u.boxUvToShapeUvScale=_.Z.fromElements(2/(e.x===n.x?1:n.x-e.x),2/(e.y===n.y?1:n.y-e.y),2/(e.z===n.z?1:n.z-e.z),u.boxUvToShapeUvScale),u.boxUvToShapeUvTranslate=_.Z.fromElements(-u.boxUvToShapeUvScale.x*(.5*e.x+.5),-u.boxUvToShapeUvScale.y*(.5*e.y+.5),-u.boxUvToShapeUvScale.z*(.5*e.z+.5),u.boxUvToShapeUvTranslate)}return this.shaderMaximumIntersectionsLength=f,!0};let _j=new _.Z,_W=new _.Z;_M.prototype.computeOrientedBoundingBoxForTile=function(e,t,i,n,r){D.Z.typeOf.number("tileLevel",e),D.Z.typeOf.number("tileX",t),D.Z.typeOf.number("tileY",i),D.Z.typeOf.number("tileZ",n),D.Z.typeOf.object("result",r);let o=this._minBounds,a=this._maxBounds,s=1/Math.pow(2,e);return _Y(_.Z.fromElements(F.Z.lerp(o.x,a.x,s*t),F.Z.lerp(o.y,a.y,s*i),F.Z.lerp(o.z,a.z,s*n),_j),_.Z.fromElements(F.Z.lerp(o.x,a.x,s*(t+1)),F.Z.lerp(o.y,a.y,s*(i+1)),F.Z.lerp(o.z,a.z,s*(n+1)),_W),this.shapeTransform,r)};let _q=new _.Z;function _Y(e,t,i,n){let r=_M.DefaultMinBounds,o=_M.DefaultMaxBounds;if(_.Z.equals(e,r)&&_.Z.equals(t,o))n.center=z.Z.getTranslation(i,n.center),n.halfAxes=z.Z.getMatrix3(i,n.halfAxes);else{let r=z.Z.getScale(i,_z),o=_.Z.midpoint(e,t,_F);n.center=z.Z.multiplyByPoint(i,o,n.center),r=_.Z.fromElements(.5*r.x*(t.x-e.x),.5*r.y*(t.y-e.y),.5*r.z*(t.z-e.z),_z);let a=z.Z.getRotation(i,_B);n.halfAxes=rW.Z.setScale(a,r,n.halfAxes)}return n}function _X(){this.orientedBoundingBox=new B.Z,this.boundingSphere=new S.Z,this.boundTransform=new z.Z,this.shapeTransform=new z.Z,this._minimumRadius=_X.DefaultMinBounds.x,this._maximumRadius=_X.DefaultMaxBounds.x,this._minimumHeight=_X.DefaultMinBounds.y,this._maximumHeight=_X.DefaultMaxBounds.y,this._minimumAngle=_X.DefaultMinBounds.z,this._maximumAngle=_X.DefaultMaxBounds.z,this.shaderUniforms={cylinderRenderHeightMinMax:new L.Z,cylinderRenderRadiusMinMax:new L.Z,cylinderRenderAngleMinMax:new L.Z,cylinderUvToShapeUvRadius:new L.Z,cylinderUvToShapeUvHeight:new L.Z,cylinderUvToShapeUvAngle:new L.Z,cylinderShapeUvAngleMinMax:new L.Z,cylinderShapeUvAngleRangeZeroMid:0},this.shaderDefines={CYLINDER_HAS_RENDER_BOUNDS_RADIUS_MIN:void 0,CYLINDER_HAS_RENDER_BOUNDS_RADIUS_FLAT:void 0,CYLINDER_HAS_RENDER_BOUNDS_ANGLE:void 0,CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_EQUAL_ZERO:void 0,CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_UNDER_HALF:void 0,CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_OVER_HALF:void 0,CYLINDER_HAS_SHAPE_BOUNDS_RADIUS:void 0,CYLINDER_HAS_SHAPE_BOUNDS_HEIGHT:void 0,CYLINDER_HAS_SHAPE_BOUNDS_ANGLE:void 0,CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_DISCONTINUITY:void 0,CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MAX_DISCONTINUITY:void 0,CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_MAX_REVERSED:void 0,CYLINDER_INTERSECTION_INDEX_RADIUS_MAX:void 0,CYLINDER_INTERSECTION_INDEX_RADIUS_MIN:void 0,CYLINDER_INTERSECTION_INDEX_ANGLE:void 0},this.shaderMaximumIntersectionsLength=0}_M.prototype.computeOrientedBoundingBoxForSample=function(e,t,i,n){D.Z.typeOf.object("spatialNode",e),D.Z.typeOf.object("tileDimensions",t),D.Z.typeOf.object("tileUv",i),D.Z.typeOf.object("result",n);let r=1/Math.pow(2,e.level),o=_.Z.divideComponents(_.Z.ONE,t,_q),a=_.Z.multiplyByScalar(o,r,_q),s=_.Z.multiplyByScalar(_.Z.fromElements(e.x+i.x,e.y+i.y,e.z+i.z,_j),r,_j),l=_.Z.add(s,a,_W),c=this._minBounds,u=this._maxBounds;return _Y(_.Z.fromElements(F.Z.lerp(c.x,u.x,s.x),F.Z.lerp(c.y,u.y,s.y),F.Z.lerp(c.z,u.z,s.z),_j),_.Z.fromElements(F.Z.lerp(c.x,u.x,l.x),F.Z.lerp(c.y,u.y,l.y),F.Z.lerp(c.z,u.z,l.z),_W),this.shapeTransform,n)},_M.DefaultMinBounds=Object.freeze(new _.Z(-1,-1,-1)),_M.DefaultMaxBounds=Object.freeze(new _.Z(1,1,1));let _$=new _.Z;_X.prototype.update=function(e,t,i,n,r){n=(0,Z.Z)(n,_X.DefaultMinBounds),r=(0,Z.Z)(r,_X.DefaultMaxBounds),D.Z.typeOf.object("modelMatrix",e),D.Z.typeOf.object("minBounds",t),D.Z.typeOf.object("maxBounds",i);let o=_X.DefaultMinBounds.x,a=_X.DefaultMaxBounds.x,s=_X.DefaultMinBounds.y,l=_X.DefaultMaxBounds.y,c=_X.DefaultMinBounds.z,u=_X.DefaultMaxBounds.z,h=u-c,d=.5*h,f=F.Z.EPSILON10,p=F.Z.EPSILON3,m=F.Z.EPSILON10,_=F.Z.clamp(t.x,o,a),g=F.Z.clamp(i.x,o,a),y=F.Z.clamp(n.x,o,a),b=F.Z.clamp(r.x,o,a),v=Math.max(_,y),T=Math.min(g,b),E=F.Z.clamp(t.y,s,l),x=F.Z.clamp(i.y,s,l),w=F.Z.clamp(n.y,s,l),C=F.Z.clamp(r.y,s,l),A=Math.max(E,w),I=Math.min(x,C),O=F.Z.negativePiToPi(t.z),P=F.Z.negativePiToPi(i.z),R=F.Z.negativePiToPi(n.z),N=F.Z.negativePiToPi(r.z),M=Math.max(O,R),B=Math.min(P,N),U=z.Z.getScale(e,_$);if(0===T||v>T||A>I||F.Z.equalsEpsilon(U.x,0,void 0,f)||F.Z.equalsEpsilon(U.y,0,void 0,f)||F.Z.equalsEpsilon(U.z,0,void 0,f))return!1;this._minimumRadius=_,this._maximumRadius=g,this._minimumHeight=E,this._maximumHeight=x,this._minimumAngle=O,this._maximumAngle=P,this.shapeTransform=z.Z.clone(e,this.shapeTransform),this.orientedBoundingBox=gi(v,T,A,I,M,B,this.shapeTransform,this.orientedBoundingBox),this.boundTransform=z.Z.fromRotationTranslation(this.orientedBoundingBox.halfAxes,this.orientedBoundingBox.center,this.boundTransform),this.boundingSphere=S.Z.fromOrientedBoundingBox(this.orientedBoundingBox,this.boundingSphere);let k=g===a,V=_===o,H=E===s&&x===l,G=P<O,j=P-O+G*h,W=F.Z.equalsEpsilon(O,c,void 0,p),q=F.Z.equalsEpsilon(P,u,void 0,p),Y=v===o,X=B<M,$=B-M+X*h,K=$>=d-m&&$<h-m,Q=$>m&&$<d-m,J=$<=m,{shaderUniforms:ee,shaderDefines:et}=this;for(let e in et)et.hasOwnProperty(e)&&(et[e]=void 0);let ei=0;if(et.CYLINDER_INTERSECTION_INDEX_RADIUS_MAX=ei,ei+=1,Y||(et.CYLINDER_HAS_RENDER_BOUNDS_RADIUS_MIN=!0,et.CYLINDER_INTERSECTION_INDEX_RADIUS_MIN=ei,ei+=1),ee.cylinderRenderRadiusMinMax=L.Z.fromElements(v,T,ee.cylinderRenderRadiusMinMax),v===T&&(et.CYLINDER_HAS_RENDER_BOUNDS_RADIUS_FLAT=!0),!(V&&k)){et.CYLINDER_HAS_SHAPE_BOUNDS_RADIUS=!0;let e=g-_,t=0,i=1;0!==e&&(t=1/e,i=-_/e),ee.cylinderUvToShapeUvRadius=L.Z.fromElements(t,i,ee.cylinderUvToShapeUvRadius)}if(!H){et.CYLINDER_HAS_SHAPE_BOUNDS_HEIGHT=!0;let e=x-E,t=0,i=1;0!==e&&(t=2/e,i=-(E+1)/e),ee.cylinderUvToShapeUvHeight=L.Z.fromElements(t,i,ee.cylinderUvToShapeUvHeight)}if(ee.cylinderRenderHeightMinMax=L.Z.fromElements(A,I,ee.cylinderRenderHeightMinMax),G&&(et.CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_MAX_REVERSED=!0),(K||Q||J)&&(et.CYLINDER_HAS_RENDER_BOUNDS_ANGLE=!0,et.CYLINDER_INTERSECTION_INDEX_ANGLE=ei,K?(et.CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_UNDER_HALF=!0,ei+=1):Q?(et.CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_OVER_HALF=!0,ei+=2):J&&(et.CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_EQUAL_ZERO=!0,ei+=2),ee.cylinderRenderAngleMinMax=L.Z.fromElements(M,B,ee.cylinderRenderAngleMinMax)),j>d+m&&j<h-m||j<d-m||j>=d-m&&j<=d+m){et.CYLINDER_HAS_SHAPE_BOUNDS_ANGLE=!0,W&&(et.CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_DISCONTINUITY=!0),q&&(et.CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MAX_DISCONTINUITY=!0);let e=(P-c)/h;if(ee.cylinderShapeUvAngleMinMax=L.Z.fromElements((O-c)/h,e,ee.cylinderShapeUvAngleMinMax),ee.cylinderShapeUvAngleRangeZeroMid=(e+.5*(1-j/h))%1,j<=m)ee.cylinderUvToShapeUvAngle=L.Z.fromElements(0,1,ee.cylinderUvToShapeUvAngle);else{let e=-(O-c)/j;ee.cylinderUvToShapeUvAngle=L.Z.fromElements(h/j,e,ee.cylinderUvToShapeUvAngle)}}return this.shaderMaximumIntersectionsLength=ei,!0},_X.prototype.computeOrientedBoundingBoxForTile=function(e,t,i,n,r){D.Z.typeOf.number("tileLevel",e),D.Z.typeOf.number("tileX",t),D.Z.typeOf.number("tileY",i),D.Z.typeOf.number("tileZ",n),D.Z.typeOf.object("result",r);let o=this._minimumRadius,a=this._maximumRadius,s=this._minimumHeight,l=this._maximumHeight,c=this._minimumAngle,u=this._maximumAngle,h=1/Math.pow(2,e),d=F.Z.lerp(o,a,t*h),f=F.Z.lerp(o,a,(t+1)*h),p=F.Z.lerp(s,l,i*h);return gi(d,f,p,F.Z.lerp(s,l,(i+1)*h),F.Z.lerp(c,u,n*h),F.Z.lerp(c,u,(n+1)*h),this.shapeTransform,r)};let _K=new _.Z,_Q=new _.Z,_J=new _.Z;_X.prototype.computeOrientedBoundingBoxForSample=function(e,t,i,n){D.Z.typeOf.object("spatialNode",e),D.Z.typeOf.object("tileDimensions",t),D.Z.typeOf.object("tileUv",i),D.Z.typeOf.object("result",n);let r=1/Math.pow(2,e.level),o=_.Z.divideComponents(_.Z.ONE,t,_K),a=_.Z.multiplyByScalar(o,r,_K),s=_.Z.multiplyByScalar(_.Z.fromElements(e.x+i.x,e.y+i.y,e.z+i.z,_Q),r,_Q),l=_.Z.add(s,a,_J),c=this._minimumRadius,u=this._maximumRadius,h=this._minimumHeight,d=this._maximumHeight,f=this._minimumAngle,p=this._maximumAngle,m=F.Z.lerp(c,u,s.x),g=F.Z.lerp(c,u,l.x),Z=F.Z.lerp(h,d,s.y);return gi(m,g,Z,F.Z.lerp(h,d,l.y),F.Z.lerp(f,p,s.z),F.Z.lerp(f,p,l.z),this.shapeTransform,n)},_X.DefaultMinBounds=Object.freeze(new _.Z(0,-1,-F.Z.PI)),_X.DefaultMaxBounds=Object.freeze(new _.Z(1,1,+F.Z.PI));let _0=[,,,,,],_1=new _.Z,_2=new rW.Z,_3=new z.Z,_4=new z.Z,_5=new z.Z,_9=new z.Z,_8=new _.Z,_6=new _.Z,_7=new _.Z,ge=Array(8);for(let e=0;e<8;e++)ge[e]=new _.Z;function gt(e,t,i){return Math.abs(eH.Z.dot(e,t))<i}function gi(e,t,i,n,r,o,a,s){let l=_X.DefaultMinBounds,c=_X.DefaultMaxBounds,u=l.x,h=c.x,d=l.y,f=c.y,p=l.z,m=c.z;if(e===u&&t===h&&i===d&&n===f&&r===p&&o===m)return s.center=z.Z.getTranslation(a,s.center),s.halfAxes=z.Z.getMatrix3(a,s.halfAxes),s;o<r&&(o+=F.Z.TWO_PI);let g=o-r,Z=r+.5*g,y=0;_0[y++]=r,_0[y++]=o,_0[y++]=Z,g>F.Z.PI&&(_0[y++]=Z-F.Z.PI_OVER_TWO,_0[y++]=Z+F.Z.PI_OVER_TWO);let b=1,v=1,T=-1,E=-1;for(let i=0;i<y;++i){let n=_0[i]-Z,r=Math.cos(n),o=Math.sin(n),a=r*e,s=o*e,l=r*t,c=o*t;b=Math.min(b,a),v=Math.min(v,s),b=Math.min(b,l),v=Math.min(v,c),T=Math.max(T,a),E=Math.max(E,s),T=Math.max(T,l),E=Math.max(E,c)}let x=T-b,w=E-v,S=(b+T)*.5,C=(v+E)*.5,A=_.Z.fromElements(S,C,(i+n)*.5,_1),I=rW.Z.fromRotationZ(Z,_2),O=_.Z.fromElements(x,w,n-i,_$),D=z.Z.fromScale(O,_5),P=z.Z.fromRotation(I,_4),R=z.Z.fromTranslation(A,_3),N=z.Z.multiplyTransformation(P,z.Z.multiplyTransformation(R,D,_9),_9),L=z.Z.multiplyTransformation(a,N,_9);return!function(e){let t=z.Z.getColumn(e,0,_8),i=z.Z.getColumn(e,1,_6),n=z.Z.getColumn(e,2,_7),r=F.Z.EPSILON4;return gt(t,i,r)&>(i,n,r)}(L)?function(e,t){_.Z.fromElements(-.5,-.5,-.5,ge[0]),_.Z.fromElements(-.5,-.5,.5,ge[1]),_.Z.fromElements(-.5,.5,-.5,ge[2]),_.Z.fromElements(-.5,.5,.5,ge[3]),_.Z.fromElements(.5,-.5,-.5,ge[4]),_.Z.fromElements(.5,-.5,.5,ge[5]),_.Z.fromElements(.5,.5,-.5,ge[6]),_.Z.fromElements(.5,.5,.5,ge[7]);for(let t=0;t<8;++t)z.Z.multiplyByPoint(e,ge[t],ge[t]);return B.Z.fromPoints(ge,t)}(L,s):B.Z.fromTransformation(L,s)}function gn(){this.orientedBoundingBox=new B.Z,this.boundingSphere=new S.Z,this.boundTransform=new z.Z,this.shapeTransform=new z.Z,this._rectangle=new U.Z,this._minimumHeight=gn.DefaultMinBounds.z,this._maximumHeight=gn.DefaultMaxBounds.z,this._ellipsoid=new T.Z,this._translation=new _.Z,this._rotation=new rW.Z,this.shaderUniforms={ellipsoidRadiiUv:new _.Z,eccentricitySquared:0,evoluteScale:new L.Z,ellipsoidInverseRadiiSquaredUv:new _.Z,ellipsoidRenderLongitudeMinMax:new L.Z,ellipsoidShapeUvLongitudeMinMaxMid:new _.Z,ellipsoidUvToShapeUvLongitude:new L.Z,ellipsoidUvToShapeUvLatitude:new L.Z,ellipsoidRenderLatitudeSinMinMax:new L.Z,ellipsoidInverseHeightDifferenceUv:0,clipMinMaxHeight:new L.Z},this.shaderDefines={ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_EQUAL_ZERO:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_UNDER_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_OVER_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MIN_DISCONTINUITY:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MAX_DISCONTINUITY:void 0,ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE:void 0,ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE_MIN_MAX_REVERSED:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_UNDER_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_EQUAL_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_OVER_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_UNDER_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_EQUAL_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_OVER_HALF:void 0,ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE:void 0,ELLIPSOID_INTERSECTION_INDEX_LONGITUDE:void 0,ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MAX:void 0,ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MIN:void 0,ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MAX:void 0,ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MIN:void 0},this.shaderMaximumIntersectionsLength=0}let gr=new _.Z,go=new _.Z,ga=new _.Z,gs=new _.Z,gl=new _.Z,gc=new _.Z,gu=new _.Z,gh=new _.Z,gd=new rW.Z,gf=new _.Z,gp=new _.Z,gm=new U.Z;gn.prototype.update=function(e,t,i,n,r){let{DefaultMinBounds:o,DefaultMaxBounds:a}=gn;n=(0,Z.Z)(n,o),r=(0,Z.Z)(r,a),D.Z.typeOf.object("modelMatrix",e),D.Z.typeOf.object("minBounds",t),D.Z.typeOf.object("maxBounds",i);let s=F.Z.EPSILON10,l=F.Z.EPSILON3,c=F.Z.EPSILON10,u=F.Z.EPSILON10,h=F.Z.EPSILON3,d=z.Z.getScale(e,gh),f=_.Z.clone(o,gr);f.z=-_.Z.minimumComponent(d);let p=_.Z.clamp(t,f,a,go),m=_.Z.clamp(i,f,a,ga),g=_.Z.clamp(n,f,a,gs),y=_.Z.clamp(r,f,a,gl),b=_.Z.maximumByComponent(p,g,gc),v=_.Z.minimumByComponent(m,y,gu),E=_.Z.add(d,_.Z.fromElements(m.z,m.z,m.z,gf),gf),x=_.Z.maximumComponent(E),w=_.Z.add(d,_.Z.fromElements(v.z,v.z,v.z,gp),gp);if(b.y>v.y||b.y===a.y||v.y===o.y||b.z>v.z||F.Z.equalsEpsilon(w,_.Z.ZERO,void 0,s))return!1;this._rectangle=U.Z.fromRadians(p.x,p.y,m.x,m.y),this._translation=z.Z.getTranslation(e,this._translation),this._rotation=z.Z.getRotation(e,this._rotation),this._ellipsoid=T.Z.fromCartesian3(d,this._ellipsoid),this._minimumHeight=p.z,this._maximumHeight=m.z;let C=U.Z.fromRadians(b.x,b.y,v.x,v.y,gm);this.orientedBoundingBox=gb(C,b.z,v.z,this._ellipsoid,this._translation,this._rotation,this.orientedBoundingBox),this.shapeTransform=z.Z.fromRotationTranslation(rW.Z.setScale(this._rotation,E,gd),this._translation,this.shapeTransform),this.boundTransform=z.Z.fromRotationTranslation(this.orientedBoundingBox.halfAxes,this.orientedBoundingBox.center,this.boundTransform),this.boundingSphere=S.Z.fromOrientedBoundingBox(this.orientedBoundingBox,this.boundingSphere);let A=a.x-o.x,I=.5*A,O=v.x<b.x,P=v.x-b.x+O*A,R=P<=c,N=P>=I-c&&P<A-c,M=P>c&&P<I-c,B=R||N||M,k=m.x<p.x,V=m.x-p.x+k*A,H=v.y<-h,G=v.y>=-h&&v.y<=+h,j=v.y>+h&&v.y<a.y-u,W=H||G||j,q=b.y>o.y+u&&b.y<-h,Y=b.y>=-h&&b.y<=+h,X=b.y>+h,$=q||Y||X,K=m.y-p.y,Q=m.y<-h,J=m.y>=-h&&m.y<=+h,ee=m.y>+h&&m.y<a.y-u,et=p.y>o.y+u&&p.y<-h,ei=p.y>=-h&&p.y<=+h,en=p.y>+h,{shaderUniforms:er,shaderDefines:eo}=this;for(let e in eo)eo.hasOwnProperty(e)&&(eo[e]=void 0);er.ellipsoidRadiiUv=_.Z.divideByScalar(E,x,er.ellipsoidRadiiUv);let{x:ea,z:es}=er.ellipsoidRadiiUv,el=es/ea;er.eccentricitySquared=1-el*el,er.evoluteScale=L.Z.fromElements((ea*ea-es*es)/ea,(es*es-ea*ea)/es,er.evoluteScale),er.ellipsoidInverseRadiiSquaredUv=_.Z.divideComponents(_.Z.ONE,_.Z.multiplyComponents(er.ellipsoidRadiiUv,er.ellipsoidRadiiUv,er.ellipsoidInverseRadiiSquaredUv),er.ellipsoidInverseRadiiSquaredUv);let ec=0;eo.ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MAX=ec,ec+=1,eo.ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MIN=ec,ec+=1,er.clipMinMaxHeight=L.Z.fromElements((b.z-m.z)/x,(v.z-m.z)/x,er.clipMinMaxHeight);let eu=(m.z-p.z)/x;if(er.ellipsoidInverseHeightDifferenceUv=1/eu,p.z===m.z&&(er.ellipsoidInverseHeightDifferenceUv=0),B&&(eo.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE=!0,eo.ELLIPSOID_INTERSECTION_INDEX_LONGITUDE=ec,N?(eo.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_UNDER_HALF=!0,ec+=1):M?(eo.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_OVER_HALF=!0,ec+=2):R&&(eo.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_EQUAL_ZERO=!0,ec+=2),er.ellipsoidRenderLongitudeMinMax=L.Z.fromElements(b.x,v.x,er.ellipsoidRenderLongitudeMinMax)),V>I+c&&V<A-c||V>=I-c&&V<=I+c||V<I-c){if(eo.ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE=!0,m.x<p.x&&(eo.ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE_MIN_MAX_REVERSED=!0),V<=c)er.ellipsoidUvToShapeUvLongitude=L.Z.fromElements(0,1,er.ellipsoidUvToShapeUvLongitude);else{let e=-(p.x-o.x)/V;er.ellipsoidUvToShapeUvLongitude=L.Z.fromElements(A/V,e,er.ellipsoidUvToShapeUvLongitude)}}if(B){let e=F.Z.equalsEpsilon(b.x,o.x,void 0,l),t=F.Z.equalsEpsilon(v.x,a.x,void 0,l);e&&(eo.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MIN_DISCONTINUITY=!0),t&&(eo.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MAX_DISCONTINUITY=!0);let i=(p.x-o.x)/A,n=(m.x-o.x)/A,r=(v.x-o.x)/A;er.ellipsoidShapeUvLongitudeMinMaxMid=_.Z.fromElements(i,n,(r+.5*(1-P/A))%1,er.ellipsoidShapeUvLongitudeMinMaxMid)}if((W||$)&&($&&(eo.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN=!0,eo.ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MIN=ec,q?(eo.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_UNDER_HALF=!0,ec+=1):Y?(eo.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_EQUAL_HALF=!0,ec+=1):X&&(eo.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_OVER_HALF=!0,ec+=2)),W&&(eo.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX=!0,eo.ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MAX=ec,H?(eo.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_UNDER_HALF=!0,ec+=2):G?(eo.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_EQUAL_HALF=!0,ec+=1):j&&(eo.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_OVER_HALF=!0,ec+=1)),er.ellipsoidRenderLatitudeSinMinMax=L.Z.fromElements(Math.sin(b.y),Math.sin(v.y),er.ellipsoidRenderLatitudeSinMinMax)),Q||J||ee||et||ei||en){if(eo.ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE=!0,K<u)er.ellipsoidUvToShapeUvLatitude=L.Z.fromElements(0,1,er.ellipsoidUvToShapeUvLatitude);else{let e=a.y-o.y,t=(o.y-p.y)/K;er.ellipsoidUvToShapeUvLatitude=L.Z.fromElements(e/K,t,er.ellipsoidUvToShapeUvLatitude)}}return this.shaderMaximumIntersectionsLength=ec,!0};let g_=new U.Z;gn.prototype.computeOrientedBoundingBoxForTile=function(e,t,i,n,r){D.Z.typeOf.number("tileLevel",e),D.Z.typeOf.number("tileX",t),D.Z.typeOf.number("tileY",i),D.Z.typeOf.number("tileZ",n),D.Z.typeOf.object("result",r);let o=1/Math.pow(2,e);return gb(U.Z.subsection(this._rectangle,t*o,i*o,(t+1)*o,(i+1)*o,g_),F.Z.lerp(this._minimumHeight,this._maximumHeight,n*o),F.Z.lerp(this._minimumHeight,this._maximumHeight,(n+1)*o),this._ellipsoid,this._translation,this._rotation,r)};let gg=new _.Z,gZ=new _.Z,gy=new _.Z;function gb(e,t,i,n,r,o,a){return(a=B.Z.fromRectangle(e,t,i,n,a)).center=_.Z.add(a.center,r,a.center),a.halfAxes=rW.Z.multiply(a.halfAxes,o,a.halfAxes),a}gn.prototype.computeOrientedBoundingBoxForSample=function(e,t,i,n){D.Z.typeOf.object("spatialNode",e),D.Z.typeOf.object("tileDimensions",t),D.Z.typeOf.object("tileUv",i),D.Z.typeOf.object("result",n);let r=1/Math.pow(2,e.level),o=_.Z.divideComponents(_.Z.ONE,t,gg),a=_.Z.multiplyByScalar(o,r,gg),s=_.Z.multiplyByScalar(_.Z.fromElements(e.x+i.x,e.y+i.y,e.z+i.z,gZ),r,gZ),l=_.Z.add(s,a,gy);return gb(U.Z.subsection(this._rectangle,s.x,s.y,l.x,l.y,g_),F.Z.lerp(this._minimumHeight,this._maximumHeight,s.z),F.Z.lerp(this._minimumHeight,this._maximumHeight,l.z),this._ellipsoid,this._translation,this._rotation,n)},gn.DefaultMinBounds=Object.freeze(new _.Z(-F.Z.PI,-F.Z.PI_OVER_TWO,-T.Z.WGS84.minimumRadius)),gn.DefaultMaxBounds=Object.freeze(new _.Z(F.Z.PI,F.Z.PI_OVER_TWO,10*T.Z.WGS84.maximumRadius));let gv={BOX:"BOX",ELLIPSOID:"ELLIPSOID",CYLINDER:"CYLINDER"};gv.getMinBounds=function(e){switch(e){case gv.BOX:return _M.DefaultMinBounds;case gv.ELLIPSOID:return gn.DefaultMinBounds;case gv.CYLINDER:return _X.DefaultMinBounds;default:throw new v.Z(`Invalid shape type ${e}`)}},gv.getMaxBounds=function(e){switch(e){case gv.BOX:return _M.DefaultMaxBounds;case gv.ELLIPSOID:return gn.DefaultMaxBounds;case gv.CYLINDER:return _X.DefaultMaxBounds;default:throw new v.Z(`Invalid shape type ${e}`)}},gv.getShapeConstructor=function(e){switch(e){case gv.BOX:return _M;case gv.ELLIPSOID:return gn;case gv.CYLINDER:return _X;default:throw new v.Z(`Invalid shape type ${e}`)}};var gT=Object.freeze(gv);function gE(e){D.Z.typeOf.object("options",e),D.Z.defined("options.comparator",e.comparator),(0,y.Z)(e.maximumLength)&&D.Z.typeOf.number.greaterThanOrEquals("options.maximumLength",e.maximumLength,0),this._comparator=e.comparator,this._maximumLength=e.maximumLength,this._array=(0,y.Z)(e.maximumLength)?Array(e.maximumLength):[],this._length=0}function gx(e,t,i){let n=e._array,r=n[t];n[t]=n[i],n[i]=r}function gw(e,t,i){return 0>e._comparator(e._array[t],e._array[i])}function gS(e,t,i){return e._comparator(e._array[t],e._array[i])>0}function gC(e,t){if(0===t)return;let i=Math.floor(F.Z.log2(t+1))%2==0,n=Math.floor((t-1)/2),r=gw(e,t,n);for(r!==i&&(gx(e,t,n),t=n);t>=3;){let i=Math.floor((t-3)/4);if(gw(e,t,i)!==r)break;gx(e,t,i),t=i}}function gA(e,t){let i;let n=e._length,r=Math.floor(F.Z.log2(t+1))%2==0;for(;(i=2*t+1)<n;){let o=i,a=i+1;if(a<n){gw(e,a,o)===r&&(o=a);let t=2*i+1,s=Math.max(Math.min(n-t,4),0);for(let i=0;i<s;i++){let n=t+i;gw(e,n,o)===r&&(o=n)}}if(gw(e,o,t)===r&&(gx(e,o,t),o!==i&&o!==a)){let t=Math.floor((o-1)/2);gS(e,o,t)===r&&gx(e,o,t)}t=o}}Object.defineProperties(gE.prototype,{length:{get:function(){return this._length}},maximumLength:{get:function(){return this._maximumLength},set:function(e){if((0,y.Z)(e)){for(D.Z.typeOf.number.greaterThanOrEquals("maximumLength",e,0);this._length>e;)this.removeMinimum();this._array.length=e}this._maximumLength=e}},internalArray:{get:function(){return this._array}},comparator:{get:function(){return this._comparator}}}),gE.prototype.clone=function(){let e=this._maximumLength,t=this._comparator,i=this._array,n=this._length,r=new gE({comparator:t,maximumLength:e});r._length=n;for(let e=0;e<n;e++)r._array[e]=i[e];return r},gE.prototype.reset=function(){this._length=0;let e=this._maximumLength;if((0,y.Z)(e))for(let t=0;t<e;t++)this._array[t]=void 0;else this._array.length=0},gE.prototype.resort=function(){let e=this._length;for(let t=0;t<e;t++)gC(this,t)},gE.prototype.insert=function(e){let t;let i=this._maximumLength;if((0,y.Z)(i)){if(0===i)return;if(this._length===i){let i=this._array[0];if(0>=this._comparator(e,i))return e;t=this.removeMinimum()}}let n=this._length;return this._array[n]=e,this._length++,gC(this,n),t},gE.prototype.removeMinimum=function(){let e=this._length;if(0===e)return;this._length--;let t=this._array[0];return e>=2&&(this._array[0]=this._array[e-1],gA(this,0)),this._array[e-1]=void 0,t},gE.prototype.removeMaximum=function(){let e;let t=this._length;if(0!==t){if(this._length--,t<=2)e=this._array[t-1];else{let i=gS(this,1,2)?1:2;e=this._array[i],this._array[i]=this._array[t-1],t>=4&&gA(this,i)}return this._array[t-1]=void 0,e}},gE.prototype.getMinimum=function(){if(0!==this._length)return this._array[0]},gE.prototype.getMaximum=function(){let e=this._length;return 0===e?void 0:e<=2?this._array[e-1]:this._array[gS(this,1,2)?1:2]};let gI=Object.freeze({UNLOADED:0,RECEIVING:1,RECEIVED:2,LOADED:3,FAILED:4,UNAVAILABLE:5});function gO(e,t){this.spatialNode=e,this.keyframe=t,this.state=gI.UNLOADED,this.metadata=[],this.megatextureIndex=-1,this.priority=-Number.MAX_VALUE,this.highPriorityFrameNumber=-1}function gD(e,t,i,n,r){let o,a;n===_N.Z.UNSIGNED_SHORT&&(n=_N.Z.FLOAT32);let s=e.floatingPointTexture;if(n===_N.Z.FLOAT32&&!s)throw new tT.Z("Floating point texture not supported");n===_N.Z.FLOAT32||n===_N.Z.FLOAT64?o=to.Z.FLOAT:n===_N.Z.UINT8&&(o=to.Z.UNSIGNED_BYTE),1===i?a=e.webgl2?te.Z.RED:te.Z.LUMINANCE:2===i?a=e.webgl2?te.Z.RG:te.Z.LUMINANCE_ALPHA:3===i?a=te.Z.RGB:4===i&&(a=te.Z.RGBA),r=Math.min((0,Z.Z)(r,134217728),536870912);let l=e2.Z.maximumTextureSize,c=Math.floor(r/(i*_N.Z.getSizeInBytes(n))),u=Math.min(l,F.Z.previousPowerOfTwo(Math.floor(Math.sqrt(c)))),h=Math.ceil(Math.sqrt(t.x)),d=Math.ceil(t.z/h),f=h*t.x,p=d*t.y,m=Math.floor(u/f),g=Math.floor(u/p);if(0===m||0===g)throw new tT.Z("Tileset is too large to fit into megatexture");this.channelCount=i,this.componentType=n,this.voxelCountPerTile=_.Z.clone(t,new _.Z),this.maximumTileCount=m*g,this.regionCountPerMegatexture=new L.Z(m,g),this.voxelCountPerRegion=new L.Z(f,p),this.sliceCountPerRegion=new L.Z(h,d),this.voxelSizeUv=new L.Z(1/u,1/u),this.sliceSizeUv=new L.Z(t.x/u,t.y/u),this.regionSizeUv=new L.Z(f/u,p/u),this.texture=new eP.Z({context:e,pixelFormat:a,pixelDatatype:o,flipY:!1,width:u,height:u,sampler:new ta.Z({wrapS:tc.Z.CLAMP_TO_EDGE,wrapT:tc.Z.CLAMP_TO_EDGE,minificationFilter:tl.Z.LINEAR,magnificationFilter:ts.Z.LINEAR})});let y=_N.Z.toComponentDatatype(n);this.tileVoxelDataTemp=V.Z.createTypedArray(y,f*p*i),this.nodes=Array(this.maximumTileCount);for(let e=0;e<this.maximumTileCount;e++)this.nodes[e]=new gP(e);for(let e=0;e<this.maximumTileCount;e++){let t=this.nodes[e];t.previousNode=e>0?this.nodes[e-1]:void 0,t.nextNode=e<this.maximumTileCount-1?this.nodes[e+1]:void 0}this.occupiedList=void 0,this.emptyList=this.nodes[0],this.occupiedCount=0}function gP(e){this.index=e,this.nextNode=void 0,this.previousNode=void 0}function gR(e,t,i,n,r,o,a){this.children=void 0,this.parent=r,this.level=e,this.x=t,this.y=i,this.z=n,this.dimensions=_.Z.clone(a),this.keyframeNodes=[],this.renderableKeyframeNodes=[],this.renderableKeyframeNodeLerp=0,this.renderableKeyframeNodePrevious=void 0,this.renderableKeyframeNodeNext=void 0,this.orientedBoundingBox=new B.Z,this.approximateVoxelSize=0,this.screenSpaceError=0,this.visitedFrameNumber=-1,this.computeBoundingVolumes(o)}gO.priorityComparator=function(e,t){return e.priority-t.priority},gO.searchComparator=function(e,t){return e.keyframe-t.keyframe},gO.LoadState=gI,gD.prototype.add=function(e){if(this.isFull())throw new v.Z("Trying to add when there are no empty spots");let t=this.emptyList;this.emptyList=this.emptyList.nextNode,(0,y.Z)(this.emptyList)&&(this.emptyList.previousNode=void 0),t.nextNode=this.occupiedList,(0,y.Z)(t.nextNode)&&(t.nextNode.previousNode=t),this.occupiedList=t;let i=t.index;return this.writeDataToTexture(i,e),this.occupiedCount++,i},gD.prototype.remove=function(e){if(e<0||e>=this.maximumTileCount)throw new v.Z("Megatexture index out of bounds");let t=this.nodes[e];(0,y.Z)(t.previousNode)&&(t.previousNode.nextNode=t.nextNode),(0,y.Z)(t.nextNode)&&(t.nextNode.previousNode=t.previousNode),t.nextNode=this.emptyList,(0,y.Z)(t.nextNode)&&(t.nextNode.previousNode=t),t.previousNode=void 0,this.emptyList=t,this.occupiedCount--},gD.prototype.isFull=function(){return void 0===this.emptyList},gD.getApproximateTextureMemoryByteLength=function(e,t,i,n){n===_N.Z.UNSIGNED_SHORT&&(n=_N.Z.FLOAT32);let r=_N.Z.getSizeInBytes(n),o=e*t.x*t.y*t.z,a=Math.ceil(Math.sqrt(t.x)),s=Math.ceil(t.z/a),l=a*t.x,c=s*t.y,u=F.Z.previousPowerOfTwo(Math.floor(Math.sqrt(o)));for(;!(Math.floor(u/l)*Math.floor(u/c)>=e);)u*=2;return u*u*i*r},gD.prototype.writeDataToTexture=function(e,t){let i=t.constructor===Uint16Array?new Float32Array(t):t,n=this.voxelCountPerTile,r=this.sliceCountPerRegion,o=this.voxelCountPerRegion,a=this.channelCount,s=this.tileVoxelDataTemp;for(let e=0;e<n.z;e++){let t=e%r.x*n.x,l=Math.floor(e/r.x)*n.y;for(let r=0;r<n.y;r++)for(let c=0;c<n.x;c++){let u=e*n.y*n.x+r*n.x+c,h=(l+r)*o.x+(t+c);for(let e=0;e<a;e++)s[h*a+e]=i[u*a+e]}}let l=this.regionCountPerMegatexture,c=o.x,u=o.y,h=e%l.x*o.x,d=Math.floor(e/l.x)*o.y;this.texture.copyFrom({source:{arrayBufferView:s,width:c,height:u},xOffset:h,yOffset:d})},gD.prototype.isDestroyed=function(){return!1},gD.prototype.destroy=function(){return this.texture=this.texture&&this.texture.destroy(),(0,b.Z)(this)};let gN=new _.Z;gR.prototype.computeBoundingVolumes=function(e){this.orientedBoundingBox=e.computeOrientedBoundingBoxForTile(this.level,this.x,this.y,this.z,this.orientedBoundingBox);let t=rW.Z.getScale(this.orientedBoundingBox.halfAxes,gN),i=2*_.Z.maximumComponent(t);this.approximateVoxelSize=i/_.Z.minimumComponent(this.dimensions)},gR.prototype.constructChildNodes=function(e){let{level:t,x:i,y:n,z:r}=this,o=2*i,a=2*n,s=2*r,l=a+1,c=o+1,u=s+1,h=t+1;this.children=[[h,o,a,s],[h,c,a,s],[h,o,l,s],[h,c,l,s],[h,o,a,u],[h,c,a,u],[h,o,l,u],[h,c,l,u]].map(([t,i,n,r])=>new gR(t,i,n,r,this,e,this.dimensions))},gR.prototype.visibility=function(e,t){let i=this.orientedBoundingBox;return e.cullingVolume.computeVisibilityWithPlaneMask(i,t)},gR.prototype.computeScreenSpaceError=function(e,t){let i=Math.sqrt(this.orientedBoundingBox.distanceSquaredTo(e));i=Math.max(i,F.Z.EPSILON7);let n=this.approximateVoxelSize/i*t;this.screenSpaceError=n};let gL={keyframe:0};function gM(e,t){return gL.keyframe=e,(0,i5.Z)(t,gL,gO.searchComparator)}function gF(e,t){return e*Math.exp(4*e)+t*(t>=0?1:-200)}function gz(e,t,i,n,r,o,a){this._primitive=e,this.megatextures=Array(n.length);for(let e=0;e<n.length;e++){let o=n[e],s=_b.Z.getComponentCount(o),l=r[e];this.megatextures[e]=new gD(t,i,s,l,a)}let s=this.megatextures[0].maximumTileCount;this._simultaneousRequestCount=0,this._debugPrint=!1,this._frameNumber=0;let l=e._shape;this.rootNode=new gR(0,0,0,0,void 0,l,i),this._priorityQueue=new gE({maximumLength:s,comparator:gO.priorityComparator}),this._highPriorityKeyframeNodes=Array(s),this._keyframeNodesInMegatexture=Array(s),this._keyframeCount=o,this._sampleCount=void 0,this._keyframeLocation=0,this._binaryTreeKeyframeWeighting=Array(o);let c=this._binaryTreeKeyframeWeighting;c[0]=0,c[o-1]=0,function e(t,i,n,r){if(i>n)return;let o=Math.floor((i+n)/2);t[o]=r,e(t,i,o-1,r+1),e(t,o+1,n,r+1)}(c,1,o-2,0);let u=Math.floor(227.55555555555554),h=Math.ceil(s/u);this.internalNodeTexture=new eP.Z({context:t,pixelFormat:te.Z.RGBA,pixelDatatype:to.Z.UNSIGNED_BYTE,flipY:!1,width:2048,height:h,sampler:new ta.Z({minificationFilter:tl.Z.NEAREST,magnificationFilter:ts.Z.NEAREST})}),this.internalNodeTilesPerRow=u,this.internalNodeTexelSizeUv=new L.Z(48828125e-11,1/h),this.leafNodeTexture=void 0,this.leafNodeTilesPerRow=void 0,this.leafNodeTexelSizeUv=new L.Z}gR.prototype.computeSurroundingRenderableKeyframeNodes=function(e){let t,i,n=this,r=n.level,o=Math.floor(e),a=Math.ceil(e),s=+Number.MAX_VALUE,l=+Number.MAX_VALUE;for(;(0,y.Z)(n);){let{renderableKeyframeNodes:e}=n;if(e.length>=1){let c=function(e,t){let i=gM(e,t);return i<0?F.Z.clamp(~i-1,0,t.length-1):i}(o,e),u=e[c],h=a===o||o<u.keyframe?c:Math.min(c+1,e.length-1),d=e[h],f=o-u.keyframe,p=gF(r-n.level,f);p<s&&(s=p,t=u);let m=d.keyframe-a,_=gF(r-n.level,m);if(_<l&&(l=_,i=d),0===f&&0===m)break}n=n.parent}if(this.renderableKeyframeNodePrevious=t,this.renderableKeyframeNodeNext=i,!(0,y.Z)(t)||!(0,y.Z)(i))return;let c=t.keyframe,u=i.keyframe;this.renderableKeyframeNodeLerp=c===u?0:F.Z.clamp((e-c)/(u-c),0,1)},gR.prototype.isVisited=function(e){return this.visitedFrameNumber===e},gR.prototype.createKeyframeNode=function(e){let t=gM(e,this.keyframeNodes);if(t<0){t=~t;let i=new gO(this,e);this.keyframeNodes.splice(t,0,i)}},gR.prototype.destroyKeyframeNode=function(e,t){let i=e.keyframe,n=gM(i,this.keyframeNodes);if(n<0)throw new v.Z("Keyframe node does not exist.");if(this.keyframeNodes.splice(n,1),-1!==e.megatextureIndex){for(let i=0;i<t.length;i++)t[i].remove(e.megatextureIndex);let n=gM(i,this.renderableKeyframeNodes);if(n<0)throw new v.Z("Renderable keyframe node does not exist.");this.renderableKeyframeNodes.splice(n,1)}e.spatialNode=void 0,e.state=gO.LoadState.UNLOADED,e.metadata={},e.megatextureIndex=-1,e.priority=-Number.MAX_VALUE,e.highPriorityFrameNumber=-1},gR.prototype.addKeyframeNodeToMegatextures=function(e,t){if(e.state!==gO.LoadState.RECEIVED||-1!==e.megatextureIndex||e.metadata.length!==t.length)throw new v.Z("Keyframe node cannot be added to megatexture");for(let i=0;i<t.length;i++){let n=t[i];e.megatextureIndex=n.add(e.metadata[i])}e.state=gO.LoadState.LOADED;let i=this.renderableKeyframeNodes,n=gM(e.keyframe,i);if(n>=0)throw new v.Z("Keyframe already renderable");n=~n,i.splice(n,0,e)},gR.prototype.isRenderable=function(e){let t=this.renderableKeyframeNodePrevious,i=this.renderableKeyframeNodeNext,n=this.level;return(0,y.Z)(t)&&(0,y.Z)(i)&&(t.spatialNode.level===n||i.spatialNode.level===n)&&this.visitedFrameNumber===e},gz.prototype.findKeyframeNode=function(e){return this._keyframeNodesInMegatexture.find(function(t){return t.megatextureIndex===e})},gz.simultaneousRequestCountMaximum=50,gz.prototype.update=function(e,t,i,n){let r=this._primitive,o=e.context,a=this.megatextures[0].maximumTileCount,s=this._keyframeCount,l=r._levelBlendFactor,c=(l>0?2:1)*(s>1?2:1);this._sampleCount=c;let u=c>=2;if(u&&!(0,y.Z)(this.leafNodeTexture)){let e=Math.floor(512),t=Math.ceil(a/e);this.leafNodeTexture=new eP.Z({context:o,pixelFormat:te.Z.RGBA,pixelDatatype:to.Z.UNSIGNED_BYTE,flipY:!1,width:1024,height:t,sampler:new ta.Z({minificationFilter:tl.Z.NEAREST,magnificationFilter:ts.Z.NEAREST})}),this.leafNodeTexelSizeUv=L.Z.fromElements(9765625e-10,1/t,this.leafNodeTexelSizeUv),this.leafNodeTilesPerRow=e}else!u&&(0,y.Z)(this.leafNodeTexture)&&(this.leafNodeTexture=this.leafNodeTexture.destroy());if(this._keyframeLocation=F.Z.clamp(t,0,s-1),i&&function e(t,i){if(i.computeBoundingVolumes(t._primitive._shape),(0,y.Z)(i.children))for(let n=0;n<8;n++)e(t,i.children[n])}(this,this.rootNode),n)return;this._frameNumber=e.frameNumber;let h=(0,rl.Z)();(function(e,t){let i;let n=e._frameNumber,r=e._primitive,o=r._shape,a=r.screenSpaceError,s=e._priorityQueue,l=e._keyframeCount,c=F.Z.clamp(Math.floor(e._keyframeLocation),0,l-2),u=c+1,{camera:h,context:d,pixelRatio:f}=t,{positionWC:p,frustum:m}=h,_=d.drawingBufferHeight/f/m.sseDenominator;s.reset(),function i(r,h){if(r.computeScreenSpaceError(p,_),(h=r.visibility(t,h))===oM.Z.MASK_OUTSIDE)return;if(r.visitedFrameNumber=n,1===l)r.createKeyframeNode(0);else if(r.keyframeNodes.length!==l)for(let e=0;e<l;e++)r.createKeyframeNode(e);let{screenSpaceError:d,keyframeNodes:f}=r,m=d/(1+d),g=!1;for(let t=0;t<f.length;t++){let i=f[t];i.priority=10*m+function(e,t,i,n){let r=Math.max(e,n._keyframeCount-i-1,1),o=Math.pow(1-Math.min(Math.abs(t-e),Math.abs(t-i))/r,4),a=Math.exp(-n._binaryTreeKeyframeWeighting[t]);return F.Z.lerp(a,o,.15+.85*o)}(c,i.keyframe,u,e),i.state!==gO.LoadState.UNAVAILABLE&&i.state!==gO.LoadState.FAILED&&i.priority!==-Number.MAX_VALUE&&s.insert(i),i.state===gO.LoadState.LOADED&&(g=!0)}if(d<a||!g){r.children=void 0;return}(0,y.Z)(r.children)||r.constructChildNodes(o);for(let e=0;e<8;e++)i(r.children[e],h)}(e.rootNode,oM.Z.MASK_INDETERMINATE);let g=e._highPriorityKeyframeNodes,Z=0;for(;s.length>0;)(i=s.removeMaximum()).highPriorityFrameNumber=n,g[Z]=i,Z++;let b=e._keyframeNodesInMegatexture,v=e.megatextures[0],T=v.occupiedCount;b.length=T,b.sort(function(e,t){return e.highPriorityFrameNumber===t.highPriorityFrameNumber?t.priority-e.priority:t.highPriorityFrameNumber-e.highPriorityFrameNumber});let E=0,x=0;for(let t=0;t<Z;t++)if((i=g[t]).state!==gO.LoadState.LOADED&&void 0!==i.spatialNode&&(i.state===gO.LoadState.UNLOADED&&function(e,t){if(e._simultaneousRequestCount>=gz.simultaneousRequestCountMaximum)return;let i=e._primitive._provider,{keyframe:n,spatialNode:r}=t,o=i.requestData({tileLevel:r.level,tileX:r.x,tileY:r.y,tileZ:r.z,keyframe:n});(0,y.Z)(o)?(e._simultaneousRequestCount++,t.state=gO.LoadState.RECEIVING,o.then(function(n){e._simultaneousRequestCount--;let r=i.types.length;if((0,y.Z)(n)){if(n===gO.LoadState.FAILED)t.state=gO.LoadState.FAILED;else if(Array.isArray(n)&&n.length===r){let i=e.megatextures;for(let e=0;e<r;e++){let{voxelCountPerTile:r,channelCount:o}=i[e],{x:a,y:s,z:l}=r,c=a*s*l,u=n[e],h=c*o;if(u.length===h)t.metadata[e]=u,t.state=gO.LoadState.RECEIVED;else{t.state=gO.LoadState.FAILED;break}}}else t.state=gO.LoadState.FAILED}else t.state=gO.LoadState.UNAVAILABLE}).catch(function(){e._simultaneousRequestCount--,t.state=gO.LoadState.FAILED})):t.state=gO.LoadState.FAILED}(e,i),i.state===gO.LoadState.RECEIVED)){let t=0;if(v.isFull()){t=T-1-E,E++;let i=b[t];i.spatialNode.destroyKeyframeNode(i,e.megatextures)}else t=T+x,x++;i.spatialNode.addKeyframeNodeToMegatextures(i,e.megatextures),b[t]=i}})(this,e);let d=(0,rl.Z)();(function(e,t,i){let n=e._primitive._screenSpaceError,r=e._keyframeLocation,o=e._frameNumber,a=t>=2,s=0,l=0,c=[],u=[],h=e.rootNode;h.computeSurroundingRenderableKeyframeNodes(r),h.isRenderable(o)&&function e(t,h,d,f,p){let m=!1;if((0,y.Z)(t.children))for(let e=0;e<8;e++){let i=t.children[e];i.computeSurroundingRenderableKeyframeNodes(r),i.isRenderable(o)&&(m=!0)}if(m){c[p]=gB.INTERNAL<<16|h,c[d]=f,s++,p=9*(f=h)+1;for(let i=0;i<8;i++){let n=t.children[i];d=9*(h=s)+0,e(n,h,d,f,p+i)}}else{if(a){let e=5*l,r=t.renderableKeyframeNodePrevious,o=t.level-r.spatialNode.level,a=r.spatialNode.parent,s=(0,y.Z)(a)?a.renderableKeyframeNodePrevious:r,h=function(e,t,i){if(void 0===e.parent)return 0;let n=e.screenSpaceError,r=e.parent.screenSpaceError;return F.Z.clamp(((t-n)/(r-n)+i-1)/i,0,1)}(t,n,i),d=r.megatextureIndex,f=s.megatextureIndex;u[e+0]=h,u[e+1]=o,u[e+2]=1,u[e+3]=d,u[e+4]=f,c[p]=gB.LEAF<<16|l}else{let e=t.renderableKeyframeNodePrevious,i=0==t.level-e.spatialNode.level?gB.LEAF:gB.PACKED_LEAF_FROM_PARENT;c[p]=i<<16|e.megatextureIndex}l++}}(h,0,0,0,0),function(e,t,i,n){let r=te.Z.componentsLength(n.pixelFormat),o=Math.ceil(e.length/9),a=Math.max(1,9*Math.min(o,i)),s=Math.max(1,Math.ceil(o/i)),l=new Uint8Array(a*s*r);for(let t=0;t<e.length;t++){let i=e[t],n=t*r;for(let e=0;e<r;e++)l[n+e]=i>>>8*e&255}n.copyFrom({source:{arrayBufferView:l,width:a,height:s},xOffset:0,yOffset:0})}(c,9,e.internalNodeTilesPerRow,e.internalNodeTexture),a&&function(e,t,i,n){let r=te.Z.componentsLength(n.pixelFormat),o=Math.ceil(e.length/5),a=Math.max(1,2*Math.min(o,i)),s=Math.max(1,Math.ceil(o/i)),l=new Uint8Array(a*s*r);for(let t=0;t<o;t++){let i=e[5*t+0],n=e[5*t+1],r=e[5*t+2],o=e[5*t+3],a=e[5*t+4],s=F.Z.clamp(Math.floor(65536*i),0,65535);l[8*t+0]=s>>>0&255,l[8*t+1]=s>>>8&255,l[8*t+2]=255&n,l[8*t+3]=255&r,l[8*t+4]=o>>>0&255,l[8*t+5]=o>>>8&255,l[8*t+6]=a>>>0&255,l[8*t+7]=a>>>8&255}n.copyFrom({source:{arrayBufferView:l,width:a,height:s},xOffset:0,yOffset:0})}(u,0,e.leafNodeTilesPerRow,e.leafNodeTexture)})(this,c,l);let f=(0,rl.Z)();this._debugPrint&&function(e,t,i,n){let r=e._keyframeCount,o=e.rootNode,a=Object.keys(gO.LoadState).length,s=Array(a),l=Array(a),c=0;for(let e=0;e<a;e++){let t=Array(r);s[e]=t;for(let e=0;e<r;e++)t[e]=0;l[e]=0}!function e(t){let i=t.keyframeNodes;for(let e=0;e<i.length;e++){let t=i[e],n=t.keyframe,r=t.state;s[r][n]+=1,l[r]+=1,c++}if((0,y.Z)(t.children))for(let i=0;i<8;i++)e(t.children[i])}(o);let u=`KEYFRAMES: ${s[gO.LoadState.LOADED]}`,h=`UNLOADED: ${l[gO.LoadState.UNLOADED]} | RECEIVING: ${l[gO.LoadState.RECEIVING]} | RECEIVED: ${l[gO.LoadState.RECEIVED]} | LOADED: ${l[gO.LoadState.LOADED]} | FAILED: ${l[gO.LoadState.FAILED]} | UNAVAILABLE: ${l[gO.LoadState.UNAVAILABLE]} | TOTAL: ${c}`,d=`LOAD: ${Math.round(100*t)/100} | OCT: ${Math.round(100*i)/100} | ALL: ${Math.round(100*n)/100}`;console.log(`${u} || ${h} || ${d}`)}(this,d-h,f-d,f-h)},gz.prototype.isRenderable=function(e){return e.isRenderable(this._frameNumber)},gz.prototype.isDestroyed=function(){return!1},gz.prototype.destroy=function(){let e=this.megatextures,t=e.length;for(let i=0;i<t;i++)e[i]=e[i]&&e[i].destroy();return this.internalNodeTexture=this.internalNodeTexture&&this.internalNodeTexture.destroy(),this.leafNodeTexture=this.leafNodeTexture&&this.leafNodeTexture.destroy(),(0,b.Z)(this)};let gB={INTERNAL:0,LEAF:1,PACKED_LEAF_FROM_PARENT:2};gz.getApproximateTextureMemoryByteLength=function(e,t,i,n){let r=0,o=i.length;for(let a=0;a<o;a++){let o=i[a],s=n[a],l=_b.Z.getComponentCount(o);r+=gD.getApproximateTextureMemoryByteLength(e,t,l,s)}return r};var gU=i(6176),gk=Object.freeze({FLOAT:"float",VEC2:"vec2",VEC3:"vec3",VEC4:"vec4",INT:"int",INT_VEC2:"ivec2",INT_VEC3:"ivec3",INT_VEC4:"ivec4",BOOL:"bool",BOOL_VEC2:"bvec2",BOOL_VEC3:"bvec3",BOOL_VEC4:"bvec4",MAT2:"mat2",MAT3:"mat3",MAT4:"mat4",SAMPLER_2D:"sampler2D",SAMPLER_CUBE:"samplerCube"}),gV=function(e,t,i){let n=new ImageData(new Uint8ClampedArray(e.buffer),t,i),r=document.createElement("canvas");return r.width=t,r.height=i,r.getContext("2d").putImageData(n,0,0),r},gH=i(5695);function gG(){this._defaultTexture=void 0,this._textures={},this._loadedImages=[],this._lastUpdatedFrame=-1}function gj(e,t,i){let{typedArray:n,sampler:r}=e,o=(0,y.Z)(n)?gq(e,i):new eP.Z({context:i,source:t,sampler:r});return gW(r)&&o.generateMipmap(),o}function gW(e){return[tl.Z.NEAREST_MIPMAP_NEAREST,tl.Z.NEAREST_MIPMAP_LINEAR,tl.Z.LINEAR_MIPMAP_NEAREST,tl.Z.LINEAR_MIPMAP_LINEAR].includes(e.minificationFilter)}function gq(e,t){let{pixelFormat:i,pixelDatatype:n,width:r,height:o,typedArray:a,sampler:s}=e;return new eP.Z({context:t,pixelFormat:i,pixelDatatype:n,source:{arrayBufferView:a,width:r,height:o},sampler:s,flipY:!1})}gG.prototype.getTexture=function(e){return this._textures[e]},gG.prototype.loadTexture2D=function(e,t){(0,y.Z)(t.typedArray)?this._loadedImages.push({id:e,textureUniform:t}):function(e,t,i){i.resource.fetchImage().then(function(n){e._loadedImages.push({id:t,image:n,textureUniform:i})}).catch(function(){let i=e._textures[t];(0,y.Z)(i)&&i!==e._defaultTexture&&i.destroy(),e._textures[t]=e._defaultTexture})}(this,e,t)},gG.prototype.update=function(e){if(e.frameNumber===this._lastUpdatedFrame)return;this._lastUpdatedFrame=e.frameNumber;let t=e.context;this._defaultTexture=t.defaultTexture;let i=this._loadedImages;for(let e=0;e<i.length;e++)!function(e,t,i){let{id:n,textureUniform:r,image:o}=t,a=i.webgl2?gj(r,o,i):function(e,t,i){let{typedArray:n,sampler:r}=e,o=gW(r),a=r.wrapS===tc.Z.REPEAT||r.wrapS===tc.Z.MIRRORED_REPEAT||r.wrapT===tc.Z.REPEAT||r.wrapT===tc.Z.MIRRORED_REPEAT,{width:s,height:l}=(0,y.Z)(n)?e:t,c=[s,l].every(F.Z.isPowerOfTwo);if(!((o||a)&&!c))return gj(e,t,i);if(!(0,y.Z)(n))return gj(e,(0,gH.Z)(t),i);if(e.pixelDatatype===to.Z.UNSIGNED_BYTE){let e=gV(n,s,l);return gj({sampler:r},(0,gH.Z)(e),i)}return o?console.warn("Texture requires resizing for mipmaps but pixelDataType cannot be resized. The texture may be rendered incorrectly."):a&&console.warn("Texture requires resizing for wrapping but pixelDataType cannot be resized. The texture may be rendered incorrectly."),gq(e,i)}(r,o,i),s=e._textures[n];(0,y.Z)(s)&&s!==i.defaultTexture&&s.destroy(),e._textures[n]=a}(this,i[e],t);i.length=0},gG.prototype.isDestroyed=function(){return!1},gG.prototype.destroy=function(){let e=this._textures;for(let t in e)if(e.hasOwnProperty(t)){let i=e[t];i!==this._defaultTexture&&i.destroy()}return(0,b.Z)(this)};var gY=i(7972);function gX(e){e=(0,Z.Z)(e,Z.Z.EMPTY_OBJECT),this.mode=(0,Z.Z)(e.mode,gU.Z.MODIFY_MATERIAL),this.lightingModel=e.lightingModel,this.uniforms=(0,Z.Z)(e.uniforms,Z.Z.EMPTY_OBJECT),this.varyings=(0,Z.Z)(e.varyings,Z.Z.EMPTY_OBJECT),this.vertexShaderText=e.vertexShaderText,this.fragmentShaderText=e.fragmentShaderText,this.translucencyMode=(0,Z.Z)(e.translucencyMode,gY.Z.INHERIT),this._textureManager=new gG,this._defaultTexture=void 0,this.uniformMap=function(e){let t=e.uniforms,i={};for(let n in t)if(t.hasOwnProperty(n)){let r=t[n],o=r.type;if(o===gk.SAMPLER_CUBE)throw new v.Z("CustomShader does not support samplerCube uniforms");o===gk.SAMPLER_2D?(e._textureManager.loadTexture2D(n,r.value),i[n]=function(e,t){return function(){return(0,Z.Z)(e._textureManager.getTexture(t),e._defaultTexture)}}(e,n)):i[n]=function(e,t){return function(){return e.uniforms[t].value}}(e,n)}return i}(this),this.usedVariablesVertex={attributeSet:{},featureIdSet:{},metadataSet:{}},this.usedVariablesFragment={attributeSet:{},featureIdSet:{},metadataSet:{},materialSet:{}},function(e){let t=/[vf]sInput\.attributes\.(\w+)/g,i=/[vf]sInput\.featureIds\.(\w+)/g,n=/[vf]sInput\.metadata.(\w+)/g,r=e.vertexShaderText;(0,y.Z)(r)&&(g$(r,t,e.usedVariablesVertex.attributeSet),g$(r,i,e.usedVariablesVertex.featureIdSet),g$(r,n,e.usedVariablesVertex.metadataSet));let o=e.fragmentShaderText;(0,y.Z)(o)&&(g$(o,t,e.usedVariablesFragment.attributeSet),g$(o,i,e.usedVariablesFragment.featureIdSet),g$(o,n,e.usedVariablesFragment.metadataSet),g$(o,/material\.(\w+)/g,e.usedVariablesFragment.materialSet))}(this),function(e){let t=e.usedVariablesVertex.attributeSet;gQ(t,"position","positionMC","vertex"),gQ(t,"normal","normalMC","vertex"),gQ(t,"tangent","tangentMC","vertex"),gQ(t,"bitangent","bitangentMC","vertex"),gQ(t,"positionWC","positionMC","vertex"),gQ(t,"positionEC","positionMC","vertex"),gQ(t,"normalEC","normalMC","vertex"),gQ(t,"tangentEC","tangentMC","vertex"),gQ(t,"bitangentEC","bitangentMC","vertex");let i=e.usedVariablesFragment.attributeSet;gQ(i,"position","positionEC","fragment"),gQ(i,"normal","normalEC","fragment"),gQ(i,"tangent","tangentEC","fragment"),gQ(i,"bitangent","bitangentEC","fragment"),gQ(i,"normalMC","normalEC","fragment"),gQ(i,"tangentMC","tangentEC","fragment"),gQ(i,"bitangentMC","bitangentEC","fragment")}(this)}function g$(e,t,i){let n;for(;null!==(n=t.exec(e));)i[n[1]]=!0}function gK(e){return/^.*MC$/.test(e)?`${e} (model coordinates)`:/^.*WC$/.test(e)?`${e} (Cartesian world coordinates)`:/^.*EC$/.test(e)?`${e} (eye coordinates)`:e}function gQ(e,t,i,n){if(e.hasOwnProperty(t)){let e=`${gK(t)} is not available in the ${n} shader. Did you mean ${gK(i)} instead?`;throw new v.Z(e)}}function gJ(e){e=(0,Z.Z)(e,Z.Z.EMPTY_OBJECT),this._ready=!1,this._provider=(0,Z.Z)(e.provider,gJ.DefaultProvider),this._traversal=void 0,this._shape=void 0,this._shapeVisible=!1,this._paddingBefore=new _.Z,this._paddingAfter=new _.Z,this._minBounds=new _.Z,this._minBoundsOld=new _.Z,this._maxBounds=new _.Z,this._maxBoundsOld=new _.Z,this._exaggeratedMinBounds=new _.Z,this._exaggeratedMinBoundsOld=new _.Z,this._exaggeratedMaxBounds=new _.Z,this._exaggeratedMaxBoundsOld=new _.Z,this._minClippingBounds=new _.Z,this._minClippingBoundsOld=new _.Z,this._maxClippingBounds=new _.Z,this._maxClippingBoundsOld=new _.Z,this._clippingPlanes=void 0,this._clippingPlanesState=0,this._clippingPlanesEnabled=!1,this._modelMatrix=z.Z.clone((0,Z.Z)(e.modelMatrix,z.Z.IDENTITY)),this._exaggeratedModelMatrix=z.Z.clone(this._modelMatrix),this._compoundModelMatrix=new z.Z,this._compoundModelMatrixOld=new z.Z,this._customShader=(0,Z.Z)(e.customShader,gJ.DefaultCustomShader),this._customShaderCompilationEvent=new I.Z,this._shaderDirty=!0,this._drawCommand=void 0,this._drawCommandPick=void 0,this._pickId=void 0,this._clock=e.clock,this._transformPositionWorldToUv=new z.Z,this._transformPositionUvToWorld=new z.Z,this._transformDirectionWorldToLocal=new rW.Z,this._transformNormalLocalToWorld=new rW.Z,this._jitter=!1,this._nearestSampling=!1,this._levelBlendFactor=0,this._stepSizeMultiplier=1,this._depthTest=!0,this._useLogDepth=void 0,this._screenSpaceError=4,this._debugPolylines=new _L.Z,this._debugDraw=!1,this._disableRender=!1,this._disableUpdate=!1,this._uniforms={octreeInternalNodeTexture:void 0,octreeInternalNodeTilesPerRow:0,octreeInternalNodeTexelSizeUv:new L.Z,octreeLeafNodeTexture:void 0,octreeLeafNodeTilesPerRow:0,octreeLeafNodeTexelSizeUv:new L.Z,megatextureTextures:[],megatextureSliceDimensions:new L.Z,megatextureTileDimensions:new L.Z,megatextureVoxelSizeUv:new L.Z,megatextureSliceSizeUv:new L.Z,megatextureTileSizeUv:new L.Z,dimensions:new _.Z,paddingBefore:new _.Z,paddingAfter:new _.Z,transformPositionViewToUv:new z.Z,transformPositionUvToView:new z.Z,transformDirectionViewToLocal:new rW.Z,transformNormalLocalToWorld:new rW.Z,cameraPositionUv:new _.Z,ndcSpaceAxisAlignedBoundingBox:new eH.Z,clippingPlanesTexture:void 0,clippingPlanesMatrix:new z.Z,stepSize:0,pickColor:new A.Z},this._shapeDefinesOld={},this._uniformMap={};let t=this._uniforms,i=this._uniformMap;for(let e in t)t.hasOwnProperty(e)&&(i[`u_${e}`]=function(){return t[e]});!function(e,t){let{shape:i,minBounds:n=gT.getMinBounds(i),maxBounds:r=gT.getMaxBounds(i)}=t;e.minBounds=n,e.maxBounds=r,e.minClippingBounds=gT.getMinBounds(i),e.maxClippingBounds=gT.getMaxBounds(i),e._exaggeratedMinBounds=_.Z.clone(e._minBounds,e._exaggeratedMinBounds),e._exaggeratedMaxBounds=_.Z.clone(e._maxBounds,e._exaggeratedMaxBounds),e._exaggeratedModelMatrix=z.Z.clone(e._modelMatrix,e._exaggeratedModelMatrix),Za(e,t);let o=gT.getShapeConstructor(i);e._shape=new o,e._shapeVisible=Zl(e,e._shape,t)}(this,this._provider)}gX.prototype.setUniform=function(e,t){if(D.Z.typeOf.string("uniformName",e),D.Z.defined("value",t),!(0,y.Z)(this.uniforms[e]))throw new v.Z(`Uniform ${e} must be declared in the CustomShader constructor.`);let i=this.uniforms[e];i.type===gk.SAMPLER_2D?this._textureManager.loadTexture2D(e,t):(0,y.Z)(t.clone)?i.value=t.clone(i.value):i.value=t},gX.prototype.update=function(e){this._defaultTexture=e.context.defaultTexture,this._textureManager.update(e)},gX.prototype.isDestroyed=function(){return!1},gX.prototype.destroy=function(){this._textureManager=this._textureManager&&this._textureManager.destroy(),(0,b.Z)(this)},Object.defineProperties(gJ.prototype,{ready:{get:function(){return this._ready}},provider:{get:function(){return this._provider}},boundingSphere:{get:function(){return this._shape.boundingSphere}},orientedBoundingBox:{get:function(){return this._shape.orientedBoundingBox}},modelMatrix:{get:function(){return this._modelMatrix},set:function(e){D.Z.typeOf.object("modelMatrix",e),this._modelMatrix=z.Z.clone(e,this._modelMatrix)}},shape:{get:function(){return this._provider.shape}},dimensions:{get:function(){return this._provider.dimensions}},minimumValues:{get:function(){return this._provider.minimumValues}},maximumValues:{get:function(){return this._provider.maximumValues}},show:{get:function(){return!this._disableRender},set:function(e){D.Z.typeOf.bool("show",e),this._disableRender=!e}},disableUpdate:{get:function(){return this._disableUpdate},set:function(e){D.Z.typeOf.bool("disableUpdate",e),this._disableUpdate=e}},debugDraw:{get:function(){return this._debugDraw},set:function(e){D.Z.typeOf.bool("debugDraw",e),this._debugDraw=e}},depthTest:{get:function(){return this._depthTest},set:function(e){D.Z.typeOf.bool("depthTest",e),this._depthTest!==e&&(this._depthTest=e,this._shaderDirty=!0)}},jitter:{get:function(){return this._jitter},set:function(e){D.Z.typeOf.bool("jitter",e),this._jitter!==e&&(this._jitter=e,this._shaderDirty=!0)}},nearestSampling:{get:function(){return this._nearestSampling},set:function(e){D.Z.typeOf.bool("nearestSampling",e),this._nearestSampling!==e&&(this._nearestSampling=e,this._shaderDirty=!0)}},levelBlendFactor:{get:function(){return this._levelBlendFactor},set:function(e){D.Z.typeOf.number("levelBlendFactor",e),this._levelBlendFactor=F.Z.clamp(e,0,1)}},screenSpaceError:{get:function(){return this._screenSpaceError},set:function(e){D.Z.typeOf.number("screenSpaceError",e),this._screenSpaceError=e}},stepSize:{get:function(){return this._stepSizeMultiplier},set:function(e){D.Z.typeOf.number("stepSize",e),this._stepSizeMultiplier=e}},minBounds:{get:function(){return this._minBounds},set:function(e){D.Z.defined("minBounds",e),this._minBounds=_.Z.clone(e,this._minBounds)}},maxBounds:{get:function(){return this._maxBounds},set:function(e){D.Z.defined("maxBounds",e),this._maxBounds=_.Z.clone(e,this._maxBounds)}},minClippingBounds:{get:function(){return this._minClippingBounds},set:function(e){D.Z.defined("minClippingBounds",e),this._minClippingBounds=_.Z.clone(e,this._minClippingBounds)}},maxClippingBounds:{get:function(){return this._maxClippingBounds},set:function(e){D.Z.defined("maxClippingBounds",e),this._maxClippingBounds=_.Z.clone(e,this._maxClippingBounds)}},clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){eM.Z.setOwner(e,this,"_clippingPlanes")}},customShader:{get:function(){return this._customShader},set:function(e){if(this._customShader!==e){let t=this._uniformMap,i=this._customShader.uniformMap;for(let e in i)i.hasOwnProperty(e)&&delete t[e];(0,y.Z)(e)?this._customShader=e:this._customShader=gJ.DefaultCustomShader,this._shaderDirty=!0}}},customShaderCompilationEvent:{get:function(){return this._customShaderCompilationEvent}}});let g0=new _.Z,g1=new eH.Z,g2=new eH.Z,g3=new _.Z,g4=new _.Z,g5=new rW.Z,g9=new rW.Z,g8=new z.Z,g6=new z.Z,g7=new z.Z,Ze=z.Z.fromRotationTranslation(rW.Z.fromUniformScale(.5,new rW.Z),new _.Z(.5,.5,.5),new z.Z),Zt=z.Z.fromRotationTranslation(rW.Z.fromUniformScale(2,new rW.Z),new _.Z(-1,-1,-1),new z.Z);gJ.prototype.update=function(e){let t=this._provider;this._customShader.update(e);let i=e.context;if(!this._ready){(function(e,t,i){let n=e._uniforms;e._pickId=i.createPickId({primitive:e}),n.pickColor=A.Z.clone(e._pickId.color,n.pickColor);let{shaderDefines:r,shaderUniforms:o}=e._shape;e._shapeDefinesOld=(0,eG.Z)(r,!0);let a=e._uniformMap;for(let e in o)if(o.hasOwnProperty(e)){let t=`u_${e}`;(0,y.Z)(a[t])&&(0,_R.Z)(`VoxelPrimitive: Uniform name "${t}" is already defined`),a[t]=function(){return o[e]}}n.dimensions=_.Z.clone(t.dimensions,n.dimensions),e._paddingBefore=_.Z.clone((0,Z.Z)(t.paddingBefore,_.Z.ZERO),e._paddingBefore),n.paddingBefore=_.Z.clone(e._paddingBefore,n.paddingBefore),e._paddingAfter=_.Z.clone((0,Z.Z)(t.paddingAfter,_.Z.ZERO),e._paddingBefore),n.paddingAfter=_.Z.clone(e._paddingAfter,n.paddingAfter),e._traversal=function(e,t,i){let n=_.Z.clone(t.dimensions,g0);_.Z.add(n,e._paddingBefore,n),_.Z.add(n,e._paddingAfter,n);let r=t.maximumTileCount,o=(0,y.Z)(r)?gz.getApproximateTextureMemoryByteLength(r,n,t.types,t.componentTypes):void 0,a=(0,Z.Z)(t.keyframeCount,1);return new gz(e,i,n,t.types,t.componentTypes,a,o)}(e,t,i),function(e,t){t.octreeInternalNodeTexture=e.internalNodeTexture,t.octreeInternalNodeTexelSizeUv=L.Z.clone(e.internalNodeTexelSizeUv,t.octreeInternalNodeTexelSizeUv),t.octreeInternalNodeTilesPerRow=e.internalNodeTilesPerRow;let i=e.megatextures,n=i[0],r=i.length;t.megatextureTextures=Array(r);for(let e=0;e<r;e++)t.megatextureTextures[e]=i[e].texture;t.megatextureSliceDimensions=L.Z.clone(n.sliceCountPerRegion,t.megatextureSliceDimensions),t.megatextureTileDimensions=L.Z.clone(n.regionCountPerMegatexture,t.megatextureTileDimensions),t.megatextureVoxelSizeUv=L.Z.clone(n.voxelSizeUv,t.megatextureVoxelSizeUv),t.megatextureSliceSizeUv=L.Z.clone(n.sliceSizeUv,t.megatextureSliceSizeUv),t.megatextureTileSizeUv=L.Z.clone(n.regionSizeUv,t.megatextureTileSizeUv)}(e._traversal,n)})(this,t,i),e.afterRender.push(()=>(this._ready=!0,!0));return}!function(e,t){if(e._exaggeratedMinBounds=_.Z.clone(e._minBounds,e._exaggeratedMinBounds),e._exaggeratedMaxBounds=_.Z.clone(e._maxBounds,e._exaggeratedMaxBounds),e.shape===gT.ELLIPSOID){let i=t.verticalExaggerationRelativeHeight,n=t.verticalExaggeration;e._exaggeratedMinBounds.z=(e._minBounds.z-i)*n+i,e._exaggeratedMaxBounds.z=(e._maxBounds.z-i)*n+i}else if(e.shape===gT.BOX){let i=_.Z.fromElements(1,1,t.verticalExaggeration,Zi);e._exaggeratedModelMatrix=z.Z.multiplyByScale(e._modelMatrix,i,e._exaggeratedModelMatrix),e._exaggeratedModelMatrix=z.Z.multiplyByTranslation(e._exaggeratedModelMatrix,function(e,t){let{shapeTransform:i=z.Z.IDENTITY,globalTransform:n=z.Z.IDENTITY}=e._provider,r=z.Z.getTranslation(i,Zn),o=z.Z.multiplyByPoint(e._modelMatrix,r,Zn),a=z.Z.multiplyByPoint(n,o,Zn),s=T.Z.WGS84.cartesianToCartographic(a,Zr),l=0;(0,y.Z)(s)&&(l=s.height);let c=H.Z.getHeight(l,t.verticalExaggeration,t.verticalExaggerationRelativeHeight);return _.Z.fromElements(0,0,(c-l)/t.verticalExaggeration,Zo)}(e,t),e._exaggeratedModelMatrix)}}(this,e);let n=Za(this,t),r=this._shape;if(n&&(this._shapeVisible=Zl(this,r,t),function(e,t){let i=t.shaderDefines,n=Object.keys(i).some(t=>i[t]!==e._shapeDefinesOld[t]);return n&&(e._shapeDefinesOld=(0,eG.Z)(i,!0)),n}(this,r)&&(this._shaderDirty=!0)),!this._shapeVisible)return;let o=function(e,t){let i;if(!(0,y.Z)(e)||!(0,y.Z)(t))return 0;let n=t.currentTime,r=e.indexOf(n);r>=0?i=e.get(r):(r=~r)===e.length?(r=e.length-1,n=(i=e.get(r)).stop):n=(i=e.get(r)).start;let o=ix.Z.secondsDifference(i.stop,i.start);return r+ix.Z.secondsDifference(n,i.start)/o}(t.timeIntervalCollection,this._clock),a=this._traversal,s=a._sampleCount;if(a.update(e,o,n,this._disableUpdate),s!==a._sampleCount&&(this._shaderDirty=!0),!a.isRenderable(a.rootNode)||(this._debugDraw&&function(e,t){let i=e._traversal,n=e._debugPolylines;function r(e,t,i,r){n.add({positions:[e,t],width:r,material:oS.Z.fromType("Color",{color:i})})}function o(e,t,i){let n=e.computeCorners();r(n[0],n[1],t,i),r(n[2],n[3],t,i),r(n[4],n[5],t,i),r(n[6],n[7],t,i),r(n[0],n[2],t,i),r(n[4],n[6],t,i),r(n[1],n[3],t,i),r(n[5],n[7],t,i),r(n[0],n[4],t,i),r(n[2],n[6],t,i),r(n[1],n[5],t,i),r(n[3],n[7],t,i)}n.removeAll(),o(e._shape.orientedBoundingBox,A.Z.WHITE,5),function e(t){if(!i.isRenderable(t))return;let n=t.level,r=[A.Z.RED,A.Z.LIME,A.Z.BLUE][n%3];if(o(t.orientedBoundingBox,r,Math.max(1,5/Math.pow(2,n))),(0,y.Z)(t.children))for(let i=0;i<8;i++)e(t.children[i])}(i.rootNode),r(_.Z.ZERO,Zd,A.Z.RED,10),r(_.Z.ZERO,Zf,A.Z.LIME,10),r(_.Z.ZERO,Zp,A.Z.BLUE,10),n.update(t)}(this,e),this._disableRender))return;this._useLogDepth!==e.useLogDepth&&(this._useLogDepth=e.useLogDepth,this._shaderDirty=!0),function(e,t){let i=e.clippingPlanes;if(!(0,y.Z)(i))return!1;i.update(t);let{clippingPlanesState:n,enabled:r}=i;if(r){let t=e._uniforms;t.clippingPlanesTexture=i.texture,t.clippingPlanesMatrix=z.Z.transpose(z.Z.multiplyTransformation(z.Z.inverse(i.modelMatrix,t.clippingPlanesMatrix),e._transformPositionUvToWorld,t.clippingPlanesMatrix),t.clippingPlanesMatrix)}return(e._clippingPlanesState!==n||e._clippingPlanesEnabled!==r)&&(e._clippingPlanesState=n,e._clippingPlanesEnabled=r,!0)}(this,e)&&(this._shaderDirty=!0);let l=a.leafNodeTexture,c=this._uniforms;(0,y.Z)(l)&&(c.octreeLeafNodeTexture=a.leafNodeTexture,c.octreeLeafNodeTexelSizeUv=L.Z.clone(a.leafNodeTexelSizeUv,c.octreeLeafNodeTexelSizeUv),c.octreeLeafNodeTilesPerRow=a.leafNodeTilesPerRow),this._shaderDirty&&(_P(this,i),this._shaderDirty=!1);let u=i.uniformState.viewProjection,h=function(e,t,i){let n;let r=z.Z.fromRotationTranslation(e.halfAxes,e.center,g6),o=z.Z.multiply(t,r,g7),a=+Number.MAX_VALUE,s=-Number.MAX_VALUE,l=+Number.MAX_VALUE,c=-Number.MAX_VALUE,u=Zc.length;for(n=0;n<u;n++)z.Z.multiplyByVector(o,Zc[n],Zh[n]);for(n=0;n<u;n++){let e=Zh[n];if(e.z>=-e.w){let t=e.x/e.w,i=e.y/e.w;a=Math.min(a,t),s=Math.max(s,t),l=Math.min(l,i),c=Math.max(c,i)}else for(let t=0;t<3;t++){let i=Zh[Zu[3*n+t]];if(i.z>=-i.w){let t=e.z+e.w,n=t/(t-(i.z+i.w)),r=eH.Z.lerp(e,i,n,g1),o=r.x/r.w,u=r.y/r.w;a=Math.min(a,o),s=Math.max(s,o),l=Math.min(l,u),c=Math.max(c,u)}}}return a=F.Z.clamp(a,-1,1),l=F.Z.clamp(l,-1,1),s=F.Z.clamp(s,-1,1),c=F.Z.clamp(c,-1,1),i=eH.Z.fromElements(a,l,s,c,i)}(r.orientedBoundingBox,u,g2);if(1===h.x||1===h.y||-1===h.z||-1===h.w)return;c.ndcSpaceAxisAlignedBoundingBox=eH.Z.clone(h,c.ndcSpaceAxisAlignedBoundingBox);let d=i.uniformState.inverseView;c.transformPositionViewToUv=z.Z.multiplyTransformation(this._transformPositionWorldToUv,d,c.transformPositionViewToUv);let f=i.uniformState.view;c.transformPositionUvToView=z.Z.multiplyTransformation(f,this._transformPositionUvToWorld,c.transformPositionUvToView);let p=i.uniformState.inverseViewRotation;c.transformDirectionViewToLocal=rW.Z.multiply(this._transformDirectionWorldToLocal,p,c.transformDirectionViewToLocal),c.transformNormalLocalToWorld=rW.Z.clone(this._transformNormalLocalToWorld,c.transformNormalLocalToWorld);let m=e.camera.positionWC;c.cameraPositionUv=z.Z.multiplyByPoint(this._transformPositionWorldToUv,m,c.cameraPositionUv),c.stepSize=this._stepSizeMultiplier;let g=e.passes.pick?this._drawCommandPick:e.passes.pickVoxel?this._drawCommandPickVoxel:this._drawCommand;g.boundingVolume=r.boundingSphere,e.commandList.push(g)};let Zi=new _.Z,Zn=new _.Z,Zr=new C.Z,Zo=new _.Z;function Za(e,t){let i=(0,Z.Z)(t.shapeTransform,z.Z.IDENTITY),n=(0,Z.Z)(t.globalTransform,z.Z.IDENTITY);return z.Z.multiplyTransformation(n,e._exaggeratedModelMatrix,e._compoundModelMatrix),z.Z.multiplyTransformation(e._compoundModelMatrix,i,e._compoundModelMatrix),Zs(e,"_compoundModelMatrix","_compoundModelMatrixOld")+Zs(e,"_minBounds","_minBoundsOld")+Zs(e,"_maxBounds","_maxBoundsOld")+Zs(e,"_exaggeratedMinBounds","_exaggeratedMinBoundsOld")+Zs(e,"_exaggeratedMaxBounds","_exaggeratedMaxBoundsOld")+Zs(e,"_minClippingBounds","_minClippingBoundsOld")+Zs(e,"_maxClippingBounds","_maxClippingBoundsOld")>0}function Zs(e,t,i){let n=e[t],r=e[i],o=!n.equals(r);return o&&n.clone(r),o?1:0}function Zl(e,t,i){if(!t.update(e._compoundModelMatrix,e._exaggeratedMinBounds,e._exaggeratedMaxBounds,e.minClippingBounds,e.maxClippingBounds))return!1;let n=t.shapeTransform,r=z.Z.inverse(n,g8),o=z.Z.getRotation(n,g5),a=z.Z.getScale(n,g3),s=_.Z.maximumComponent(a),l=_.Z.divideByScalar(a,s,g4),c=rW.Z.multiplyByScale(o,l,g9);return e._transformPositionWorldToUv=z.Z.multiplyTransformation(Ze,r,e._transformPositionWorldToUv),e._transformPositionUvToWorld=z.Z.multiplyTransformation(n,Zt,e._transformPositionUvToWorld),e._transformDirectionWorldToLocal=z.Z.getMatrix3(r,e._transformDirectionWorldToLocal),e._transformNormalLocalToWorld=rW.Z.inverseTranspose(c,e._transformNormalLocalToWorld),!0}gJ.prototype.isDestroyed=function(){return!1},gJ.prototype.destroy=function(){let e=this._drawCommand;(0,y.Z)(e)&&(e.shaderProgram=e.shaderProgram&&e.shaderProgram.destroy());let t=this._drawCommandPick;return(0,y.Z)(t)&&(t.shaderProgram=t.shaderProgram&&t.shaderProgram.destroy()),this._pickId=this._pickId&&this._pickId.destroy(),this._traversal=this._traversal&&this._traversal.destroy(),this._clippingPlanes=this._clippingPlanes&&this._clippingPlanes.destroy(),(0,b.Z)(this)};let Zc=[new eH.Z(-1,-1,-1,1),new eH.Z(1,-1,-1,1),new eH.Z(-1,1,-1,1),new eH.Z(1,1,-1,1),new eH.Z(-1,-1,1,1),new eH.Z(1,-1,1,1),new eH.Z(-1,1,1,1),new eH.Z(1,1,1,1)],Zu=[1,2,4,0,3,5,0,3,6,1,2,7,0,5,6,1,4,7,2,4,7,3,5,6],Zh=[new eH.Z,new eH.Z,new eH.Z,new eH.Z,new eH.Z,new eH.Z,new eH.Z,new eH.Z],Zd=new _.Z(3e7,0,0),Zf=new _.Z(0,3e7,0),Zp=new _.Z(0,0,3e7);function Zm(){this.ready=!0,this.shape=gT.BOX,this.dimensions=new _.Z(1,1,1),this.names=["data"],this.types=[_b.Z.SCALAR],this.componentTypes=[_N.Z.FLOAT32],this.maximumTileCount=1}gJ.DefaultCustomShader=new gX({fragmentShaderText:`void fragmentMain(FragmentInput fsInput, inout czm_modelMaterial material) { material.diffuse = vec3(1.0); material.alpha = 1.0; }`}),Zm.prototype.requestData=function(e){if(!(((0,y.Z)(e)?(0,Z.Z)(e.tileLevel,0):0)>=1))return Promise.resolve([new Float32Array(1)])},gJ.DefaultProvider=new Zm;let Z_=function(e){return function(){e.frameState.afterRender.push(function(){e.requestRender()})}};function Zg(e){let t=(e=(0,Z.Z)(e,Z.Z.EMPTY_OBJECT)).canvas,i=e.creditContainer,n=e.creditViewport,r=(0,eG.Z)(e.contextOptions);if(!(0,y.Z)(t))throw new v.Z("options and options.canvas are required.");let o=(0,y.Z)(i),a=new aM(t,r);o||((i=document.createElement("div")).style.position="absolute",i.style.bottom="0",i.style["text-shadow"]="0 0 2px #000000",i.style.color="#ffffff",i.style["font-size"]="10px",i.style["padding-right"]="5px",t.parentNode.appendChild(i)),(0,y.Z)(n)||(n=t.parentNode),this._id=(0,oL.Z)(),this._jobScheduler=new uJ,this._frameState=new uo(a,new cl(i," • ",n),this._jobScheduler),this._frameState.scene3DOnly=(0,Z.Z)(e.scene3DOnly,!1),this._removeCreditContainer=!o,this._creditContainer=i,this._canvas=t,this._context=a,this._computeEngine=new an(a),this._globe=void 0,this._globeTranslucencyState=new uc,this._primitives=new u6.Z,this._groundPrimitives=new u6.Z,this._globeHeight=void 0,this._globeHeightDirty=!0,this._cameraUnderground=!1,this._removeUpdateHeightCallback=void 0,this._logDepthBuffer=Zg.defaultLogDepthBuffer&&a.fragmentDepth,this._logDepthBufferDirty=!0,this._tweens=new ps,this._shaderFrameCount=0,this._sunPostProcess=void 0,this._computeCommandList=[],this._overlayCommandList=[],this._useOIT=(0,Z.Z)(e.orderIndependentTranslucency,!0),this._executeOITFunction=void 0,this._depthPlane=new cW(e.depthPlaneEllipsoidOffset),this._clearColorCommand=new ae.Z({color:new A.Z,stencil:0,owner:this}),this._depthClearCommand=new ae.Z({depth:1,owner:this}),this._stencilClearCommand=new ae.Z({stencil:0}),this._classificationStencilClearCommand=new ae.Z({stencil:0,renderState:e5.Z.fromCache({stencilMask:uG.Z.CLASSIFICATION_MASK})}),this._depthOnlyRenderStateCache={},this._transitioner=new ft(this),this._preUpdate=new I.Z,this._postUpdate=new I.Z,this._renderError=new I.Z,this._preRender=new I.Z,this._postRender=new I.Z,this._minimumDisableDepthTestDistance=0,this._debugInspector=new _g,this._msaaSamples=(0,Z.Z)(e.msaaSamples,1),this.rethrowRenderErrors=!1,this.completeMorphOnUserInput=!0,this.morphStart=new I.Z,this.morphComplete=new I.Z,this.skyBox=void 0,this.skyAtmosphere=void 0,this.sun=void 0,this.sunBloom=!0,this._sunBloom=void 0,this.moon=void 0,this.backgroundColor=A.Z.clone(A.Z.BLACK),this._mode=eB.Z.SCENE3D,this._mapProjection=(0,y.Z)(e.mapProjection)?e.mapProjection:new P.Z,this.morphTime=1,this.farToNearRatio=1e3,this.logarithmicDepthFarToNearRatio=1e9,this.nearToFarDistance2D=175e4,this.verticalExaggeration=1,this.verticalExaggerationRelativeHeight=0,this.debugCommandFilter=void 0,this.debugShowCommands=!1,this.debugShowFrustums=!1,this.debugShowFramesPerSecond=!1,this.debugShowDepthFrustum=1,this.debugShowFrustumPlanes=!1,this._debugShowFrustumPlanes=!1,this._debugFrustumPlanes=void 0,this.useDepthPicking=!0,this.pickTranslucentDepth=!1,this.cameraEventWaitTime=500,this.atmosphere=new aq,this.fog=new c6,this._shadowMapCamera=new sf(this),this.shadowMap=new hT({context:a,lightCamera:this._shadowMapCamera,enabled:(0,Z.Z)(e.shadows,!1)}),this.invertClassification=!1,this.invertClassificationColor=A.Z.clone(A.Z.WHITE),this._actualInvertClassificationColor=A.Z.clone(this._invertClassificationColor),this._invertClassification=new uq,this.focalLength=void 0,this.eyeSeparation=void 0,this.postProcessStages=new d5,this._brdfLutGenerator=new aY,this._performanceDisplay=void 0,this._debugVolume=void 0,this._screenSpaceCameraController=new pl(this),this._cameraUnderground=!1,this._mapMode2D=(0,Z.Z)(e.mapMode2D,sd.INFINITE_SCROLL),this._environmentState={skyBoxCommand:void 0,skyAtmosphereCommand:void 0,sunDrawCommand:void 0,sunComputeCommand:void 0,moonCommand:void 0,isSunVisible:!1,isMoonVisible:!1,isReadyForAtmosphere:!1,isSkyAtmosphereVisible:!1,clearGlobeDepth:!1,useDepthPlane:!1,renderTranslucentDepthForPick:!1,originalFramebuffer:void 0,useGlobeDepthFramebuffer:!1,useOIT:!1,useInvertClassification:!1,usePostProcess:!1,usePostProcessSelected:!1,useWebVR:!1},this._useWebVR=!1,this._cameraVR=void 0,this._aspectRatioVR=void 0,this.requestRenderMode=(0,Z.Z)(e.requestRenderMode,!1),this._renderRequested=!0,this.maximumRenderTimeChange=(0,Z.Z)(e.maximumRenderTimeChange,0),this._lastRenderTime=void 0,this._frameRateMonitor=void 0,this._removeRequestListenerCallback=o7.Z.requestCompletedEvent.addEventListener(Z_(this)),this._removeTaskProcessorListenerCallback=el.Z.taskCompletedEvent.addEventListener(Z_(this)),this._removeGlobeCallbacks=[],this._removeTerrainProviderReadyListener=void 0;let s=new oN.Z(0,0,a.drawingBufferWidth,a.drawingBufferHeight),l=new sf(this);this._logDepthBuffer&&(l.frustum.near=.1,l.frustum.far=1e10),this.preloadFlightCamera=new sf(this),this.preloadFlightCullingVolume=void 0,this._picking=new dr(this),this._defaultView=new h9(this,l,s),this._view=this._defaultView,this._hdr=void 0,this._hdrDirty=void 0,this.highDynamicRange=!1,this.gamma=2.2,this.sphericalHarmonicCoefficients=void 0,this.specularEnvironmentMaps=void 0,this._specularEnvironmentMapAtlas=void 0,this.light=new a_,Zx(this,0,ix.Z.now()),this.updateFrameState(),this.initializeFrame()}function ZZ(e,t,i){let n=e._frameState,r=e._context,o=e._view.oit,a=n.shadowState.lightShadowMaps,s=n.shadowState.lightShadowsEnabled,l=t.derivedCommands;(0,y.Z)(t.pickId)&&(l.picking=cJ.createPickDerivedCommand(e,t,r,l.picking)),t.pickOnly||(l.depth=cJ.createDepthOnlyDerivedCommand(e,t,r,l.depth)),l.originalCommand=t,e._hdr&&(l.hdr=cJ.createHdrCommand(t,r,l.hdr),l=(t=l.hdr.command).derivedCommands),s&&t.receiveShadows&&(l.shadows=hT.createReceiveDerivedCommand(a,t,i,r,l.shadows)),t.pass===e4.Z.TRANSLUCENT&&(0,y.Z)(o)&&o.isSupported()&&(s&&t.receiveShadows?(l.oit=(0,y.Z)(l.oit)?l.oit:{},l.oit.shadows=o.createDerivedCommands(l.shadows.receiveCommand,r,l.oit.shadows)):l.oit=o.createDerivedCommands(t,r,l.oit))}Zg.defaultLogDepthBuffer=!0,Object.defineProperties(Zg.prototype,{canvas:{get:function(){return this._canvas}},drawingBufferHeight:{get:function(){return this._context.drawingBufferHeight}},drawingBufferWidth:{get:function(){return this._context.drawingBufferWidth}},maximumAliasedLineWidth:{get:function(){return e2.Z.maximumAliasedLineWidth}},maximumCubeMapSize:{get:function(){return e2.Z.maximumCubeMapSize}},pickPositionSupported:{get:function(){return this._context.depthTexture}},sampleHeightSupported:{get:function(){return this._context.depthTexture}},clampToHeightSupported:{get:function(){return this._context.depthTexture}},invertClassificationSupported:{get:function(){return this._context.depthTexture}},specularEnvironmentMapsSupported:{get:function(){return u0.Z.isSupported(this._context)}},globe:{get:function(){return this._globe},set:function(e){this._globe=this._globe&&this._globe.destroy(),this._globe=e,function(e,t){for(let t=0;t<e._removeGlobeCallbacks.length;++t)e._removeGlobeCallbacks[t]();e._removeGlobeCallbacks.length=0;let i=[];(0,y.Z)(t)&&(i.push(t.imageryLayersUpdatedEvent.addEventListener(Z_(e))),i.push(t.terrainProviderChanged.addEventListener(Z_(e)))),e._removeGlobeCallbacks=i}(this,e)}},primitives:{get:function(){return this._primitives}},groundPrimitives:{get:function(){return this._groundPrimitives}},camera:{get:function(){return this._view.camera},set:function(e){this._view.camera=e}},view:{get:function(){return this._view},set:function(e){this._view=e}},defaultView:{get:function(){return this._defaultView}},picking:{get:function(){return this._picking}},screenSpaceCameraController:{get:function(){return this._screenSpaceCameraController}},mapProjection:{get:function(){return this._mapProjection}},jobScheduler:{get:function(){return this._jobScheduler}},frameState:{get:function(){return this._frameState}},environmentState:{get:function(){return this._environmentState}},tweens:{get:function(){return this._tweens}},imageryLayers:{get:function(){if((0,y.Z)(this.globe))return this.globe.imageryLayers}},terrainProvider:{get:function(){if((0,y.Z)(this.globe))return this.globe.terrainProvider},set:function(e){this._removeTerrainProviderReadyListener=this._removeTerrainProviderReadyListener&&this._removeTerrainProviderReadyListener(),(0,y.Z)(this.globe)&&(this.globe.terrainProvider=e)}},terrainProviderChanged:{get:function(){if((0,y.Z)(this.globe))return this.globe.terrainProviderChanged}},preUpdate:{get:function(){return this._preUpdate}},postUpdate:{get:function(){return this._postUpdate}},renderError:{get:function(){return this._renderError}},preRender:{get:function(){return this._preRender}},postRender:{get:function(){return this._postRender}},lastRenderTime:{get:function(){return this._lastRenderTime}},context:{get:function(){return this._context}},debugFrustumStatistics:{get:function(){return this._view.debugFrustumStatistics}},scene3DOnly:{get:function(){return this._frameState.scene3DOnly}},orderIndependentTranslucency:{get:function(){return this._useOIT}},id:{get:function(){return this._id}},mode:{get:function(){return this._mode},set:function(e){if(this.scene3DOnly&&e!==eB.Z.SCENE3D)throw new v.Z("Only SceneMode.SCENE3D is valid when scene3DOnly is true.");if(e===eB.Z.SCENE2D)this.morphTo2D(0);else if(e===eB.Z.SCENE3D)this.morphTo3D(0);else if(e===eB.Z.COLUMBUS_VIEW)this.morphToColumbusView(0);else throw new v.Z("value must be a valid SceneMode enumeration.");this._mode=e}},frustumCommandsList:{get:function(){return this._view.frustumCommandsList}},numberOfFrustums:{get:function(){return this._view.frustumCommandsList.length}},useWebVR:{get:function(){return this._useWebVR},set:function(e){if(this.camera.frustum instanceof e$.Z)throw new v.Z("VR is unsupported with an orthographic projection.");this._useWebVR=e,this._useWebVR?(this._frameState.creditDisplay.container.style.visibility="hidden",this._cameraVR=new sf(this),(0,y.Z)(this._deviceOrientationCameraController)||(this._deviceOrientationCameraController=new c4(this)),this._aspectRatioVR=this.camera.frustum.aspectRatio):(this._frameState.creditDisplay.container.style.visibility="visible",this._cameraVR=void 0,this._deviceOrientationCameraController=this._deviceOrientationCameraController&&!this._deviceOrientationCameraController.isDestroyed()&&this._deviceOrientationCameraController.destroy(),this.camera.frustum.aspectRatio=this._aspectRatioVR,this.camera.frustum.xOffset=0)}},mapMode2D:{get:function(){return this._mapMode2D}},splitPosition:{get:function(){return this._frameState.splitPosition},set:function(e){this._frameState.splitPosition=e}},minimumDisableDepthTestDistance:{get:function(){return this._minimumDisableDepthTestDistance},set:function(e){if(!(0,y.Z)(e)||e<0)throw new v.Z("minimumDisableDepthTestDistance must be greater than or equal to 0.0.");this._minimumDisableDepthTestDistance=e}},logarithmicDepthBuffer:{get:function(){return this._logDepthBuffer},set:function(e){e=this._context.fragmentDepth&&e,this._logDepthBuffer!==e&&(this._logDepthBuffer=e,this._logDepthBufferDirty=!0)}},gamma:{get:function(){return this._context.uniformState.gamma},set:function(e){this._context.uniformState.gamma=e}},highDynamicRange:{get:function(){return this._hdr},set:function(e){let t=this._context,i=e&&t.depthTexture&&(t.colorBufferFloat||t.colorBufferHalfFloat);this._hdrDirty=i!==this._hdr,this._hdr=i}},highDynamicRangeSupported:{get:function(){let e=this._context;return e.depthTexture&&(e.colorBufferFloat||e.colorBufferHalfFloat)}},cameraUnderground:{get:function(){return this._cameraUnderground}},msaaSamples:{get:function(){return this._msaaSamples},set:function(e){e=Math.min(e,e2.Z.maximumSamples),this._msaaSamples=e}},msaaSupported:{get:function(){return this._context.msaa}},pixelRatio:{get:function(){return this._frameState.pixelRatio},set:function(e){this._frameState.pixelRatio=e}},opaqueFrustumNearOffset:{get:function(){return .9999}},globeHeight:{get:function(){return this._globeHeight}}}),Zg.prototype.getCompressedTextureFormatSupported=function(e){let t=this.context;return("WEBGL_compressed_texture_s3tc"===e||"s3tc"===e)&&t.s3tc||("WEBGL_compressed_texture_pvrtc"===e||"pvrtc"===e)&&t.pvrtc||("WEBGL_compressed_texture_etc"===e||"etc"===e)&&t.etc||("WEBGL_compressed_texture_etc1"===e||"etc1"===e)&&t.etc1||("WEBGL_compressed_texture_astc"===e||"astc"===e)&&t.astc||("EXT_texture_compression_bptc"===e||"bc7"===e)&&t.bc7},Zg.prototype.updateDerivedCommands=function(e){if(!(0,y.Z)(e.derivedCommands))return;let t=this._frameState,i=this._context,n=!1,r=t.shadowState.lastDirtyTime;e.lastDirtyTime!==r&&(e.lastDirtyTime=r,e.dirty=!0,n=!0);let o=t.useLogDepth,a=this._hdr,s=e.derivedCommands,l=(0,y.Z)(s.logDepth),c=(0,y.Z)(s.hdr),u=(0,y.Z)(s.originalCommand),h=o&&!l,d=(!o||!a)&&!u;if(e.dirty=e.dirty||h||a&&!c||d,e.dirty){e.dirty=!1;let r=t.shadowState.shadowMaps;t.shadowState.shadowsEnabled&&e.castShadows&&(s.shadows=hT.createCastDerivedCommand(r,e,n,i,s.shadows)),(l||h)&&(s.logDepth=cJ.createLogDepthCommand(e,i,s.logDepth),ZZ(this,s.logDepth.command,n)),(u||d)&&ZZ(this,e,n)}};let Zy=new l8({pass:l9.Z.RENDER}),Zb=new l8({pass:l9.Z.PRELOAD}),Zv=new l8({pass:l9.Z.PRELOAD_FLIGHT}),ZT=new l8({pass:l9.Z.REQUEST_RENDER_MODE_DEFER_CHECK}),ZE=new S.Z;function Zx(e,t,i){let n=e._frameState;n.frameNumber=t,n.time=ix.Z.clone(i,n.time)}Zg.prototype.clearPasses=function(e){e.render=!1,e.pick=!1,e.pickVoxel=!1,e.depth=!1,e.postProcess=!1,e.offscreen=!1},Zg.prototype.updateFrameState=function(){let e=this.camera,t=this._frameState;t.commandList.length=0,t.shadowMaps.length=0,t.brdfLutGenerator=this._brdfLutGenerator,t.environmentMap=this.skyBox&&this.skyBox._cubeMap,t.mode=this._mode,t.morphTime=this.morphTime,t.mapProjection=this.mapProjection,t.camera=e,t.cullingVolume=e.frustum.computeCullingVolume(e.positionWC,e.directionWC,e.upWC),t.occluder=function(e){let t=e.globe;if(e._mode===eB.Z.SCENE3D&&(0,y.Z)(t)&&t.show&&!e._cameraUnderground&&!e._globeTranslucencyState.translucent){let i=t.ellipsoid,n=e.frameState.minimumTerrainHeight;return ZE.radius=i.minimumRadius+n,f=oV.fromBoundingSphere(ZE,e.camera.positionWC,f)}}(this),t.minimumTerrainHeight=0,t.minimumDisableDepthTestDistance=this._minimumDisableDepthTestDistance,t.invertClassification=this.invertClassification,t.useLogDepth=this._logDepthBuffer&&!(this.camera.frustum instanceof e$.Z||this.camera.frustum instanceof rc.Z),t.light=this.light,t.cameraUnderground=this._cameraUnderground,t.globeTranslucencyState=this._globeTranslucencyState;let{globe:i}=this;(0,y.Z)(i)&&i._terrainExaggerationChanged&&(this.verticalExaggeration=i._terrainExaggeration,this.verticalExaggerationRelativeHeight=i._terrainExaggerationRelativeHeight,i._terrainExaggerationChanged=!1),t.verticalExaggeration=this.verticalExaggeration,t.verticalExaggerationRelativeHeight=this.verticalExaggerationRelativeHeight,(0,y.Z)(this._specularEnvironmentMapAtlas)&&this._specularEnvironmentMapAtlas.ready?(t.specularEnvironmentMaps=this._specularEnvironmentMapAtlas.texture,t.specularEnvironmentMapsMaximumLOD=this._specularEnvironmentMapAtlas.maximumMipmapLevel):(t.specularEnvironmentMaps=void 0,t.specularEnvironmentMapsMaximumLOD=void 0),t.sphericalHarmonicCoefficients=this.sphericalHarmonicCoefficients,this._actualInvertClassificationColor=A.Z.clone(this.invertClassificationColor,this._actualInvertClassificationColor),uq.isTranslucencySupported(this._context)||(this._actualInvertClassificationColor.alpha=1),t.invertClassificationColor=this._actualInvertClassificationColor,(0,y.Z)(this.globe)?t.maximumScreenSpaceError=this.globe.maximumScreenSpaceError:t.maximumScreenSpaceError=2,this.clearPasses(t.passes),t.tilesetPassState=void 0},Zg.prototype.isVisible=function(e,t,i){return(0,y.Z)(e)&&(!(0,y.Z)(e.boundingVolume)||!e.cull||t.computeVisibility(e.boundingVolume)!==eX.Z.OUTSIDE&&(!(0,y.Z)(i)||!e.occlude||!e.boundingVolume.isOccluded(i)))};let Zw=new z.Z(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1);function ZS(e,t,i,n,r){let o=t._frameState;if((0,y.Z)(t.debugCommandFilter)&&!t.debugCommandFilter(e))return;if(e instanceof ae.Z){e.execute(i,n);return}e.debugShowBoundingVolume&&(0,y.Z)(e.boundingVolume)&&function(e,t,i,n){let r,o;let a=t._frameState,s=a.context,l=e.boundingVolume;(0,y.Z)(t._debugVolume)&&t._debugVolume.destroy();let c=_.Z.clone(l.center);if(a.mode!==eB.Z.SCENE3D){c=z.Z.multiplyByPoint(Zw,c,c);let e=a.mapProjection,t=e.unproject(c);c=e.ellipsoid.cartographicToCartesian(t)}if((0,y.Z)(l.radius)){let e=l.radius;r=eY.Z.toWireframe(oF.Z.createGeometry(new oF.Z({radii:new _.Z(e,e,e),vertexFormat:i2.Z.FLAT_VERTEX_FORMAT}))),t._debugVolume=new i3.Z({geometryInstances:new eq.Z({geometry:r,modelMatrix:z.Z.fromTranslation(c),attributes:{color:new ej.Z(1,0,0,1)}}),appearance:new i2.Z({flat:!0,translucent:!1}),asynchronous:!1})}else{let e=l.halfAxes;r=eY.Z.toWireframe(ov.Z.createGeometry(ov.Z.fromDimensions({dimensions:new _.Z(2,2,2),vertexFormat:i2.Z.FLAT_VERTEX_FORMAT}))),t._debugVolume=new i3.Z({geometryInstances:new eq.Z({geometry:r,modelMatrix:z.Z.fromRotationTranslation(e,c,new z.Z),attributes:{color:new ej.Z(1,0,0,1)}}),appearance:new i2.Z({flat:!0,translucent:!1}),asynchronous:!1})}let u=a.commandList,h=a.commandList=[];t._debugVolume.update(a),e=h[0],a.useLogDepth&&(e=cJ.createLogDepthCommand(e,s).command),(0,y.Z)(n)&&(o=i.framebuffer,i.framebuffer=n),e.execute(s,i),(0,y.Z)(o)&&(i.framebuffer=o),a.commandList=u}(e,t,n,r),o.useLogDepth&&(0,y.Z)(e.derivedCommands.logDepth)&&(e=e.derivedCommands.logDepth.command);let a=o.passes;if(!a.pick&&!a.pickVoxel&&!a.depth&&t._hdr&&(0,y.Z)(e.derivedCommands)&&(0,y.Z)(e.derivedCommands.hdr)&&(e=e.derivedCommands.hdr.command),a.pick||a.depth){if(a.pick&&!a.depth&&(0,y.Z)(e.derivedCommands.picking)){(e=e.derivedCommands.picking.pickCommand).execute(i,n);return}if((0,y.Z)(e.derivedCommands.depth)){(e=e.derivedCommands.depth.depthOnlyCommand).execute(i,n);return}}if(t.debugShowCommands||t.debugShowFrustums){t._debugInspector.executeDebugShowFrustumsCommand(t,e,n);return}o.shadowState.lightShadowsEnabled&&e.receiveShadows&&(0,y.Z)(e.derivedCommands.shadows)?e.derivedCommands.shadows.receiveCommand.execute(i,n):e.execute(i,n)}function ZC(e,t,i,n){let r=t._frameState,o=e.derivedCommands;(0,y.Z)(o)&&(r.useLogDepth&&(0,y.Z)(o.logDepth)&&(e=o.logDepth.command),o=e.derivedCommands,(0,y.Z)(o.picking)?(e=o.picking.pickCommand).execute(i,n):(0,y.Z)(o.depth)&&(e=o.depth.depthOnlyCommand).execute(i,n))}function ZA(e,t,i){return t.boundingVolume.distanceSquaredTo(i)-e.boundingVolume.distanceSquaredTo(i)}function ZI(e,t,i){return e.boundingVolume.distanceSquaredTo(i)-t.boundingVolume.distanceSquaredTo(i)+F.Z.EPSILON12}function ZO(e,t,i,n,r){let o=e.context;ok(n,ZA,e.camera.positionWC),(0,y.Z)(r)&&t(r.unclassifiedCommand,e,o,i);let a=n.length;for(let r=0;r<a;++r)t(n[r],e,o,i)}function ZD(e,t,i,n,r){let o=e.context;ok(n,ZI,e.camera.positionWC),(0,y.Z)(r)&&t(r.unclassifiedCommand,e,o,i);let a=n.length;for(let r=0;r<a;++r)t(n[r],e,o,i)}Zw=z.Z.inverseTransformation(Zw,Zw);let ZP=new o8,ZR=new o1,ZN=new e$.Z,ZL=new rc.Z;function ZM(e,t){let i,n,r;let{camera:o,context:a,frameState:s}=e,{uniformState:l}=a;l.updateCamera(o),(i=(0,y.Z)(o.frustum.fov)?o.frustum.clone(ZP):(0,y.Z)(o.frustum.infiniteProjectionMatrix)?o.frustum.clone(ZR):(0,y.Z)(o.frustum.width)?o.frustum.clone(ZN):o.frustum.clone(ZL)).near=o.frustum.near,i.far=o.frustum.far,l.updateFrustum(i),l.updatePass(e4.Z.ENVIRONMENT);let c=s.passes,u=c.pick||c.pickVoxel,h=e._environmentState,d=e._view,f=h.renderTranslucentDepthForPick,p=h.useWebVR;if(!u){let i=h.skyBoxCommand;if((0,y.Z)(i)&&ZS(i,e,a,t),h.isSkyAtmosphereVisible&&ZS(h.skyAtmosphereCommand,e,a,t),h.isSunVisible&&(h.sunDrawCommand.execute(a,t),e.sunBloom&&!p)){let i;i=h.useGlobeDepthFramebuffer?d.globeDepth.framebuffer:h.usePostProcess?d.sceneFramebuffer.framebuffer:h.originalFramebuffer,e._sunPostProcess.execute(a),e._sunPostProcess.copy(a,i),t.framebuffer=i}h.isMoonVisible&&h.moonCommand.execute(a,t)}h.useOIT?((0,y.Z)(e._executeOITFunction)||(e._executeOITFunction=function(e,t,i,n,r){d.globeDepth.prepareColorTextures(a),d.oit.executeCommands(e,t,i,n,r)}),n=e._executeOITFunction):n=c.render?ZO:ZD;let m=d.frustumCommandsList,_=m.length,g=h.clearGlobeDepth,Z=h.useDepthPlane,b=e._globeTranslucencyState,v=b.translucent,T=e._view.globeTranslucencyFramebuffer,E=e._depthClearCommand,x=e._stencilClearCommand,w=e._classificationStencilClearCommand,S=e._depthPlane,C=h.usePostProcessSelected,A=o.position.z;for(let c=0;c<_;++c){let p;let I=_-c-1,O=m[I];e.mode===eB.Z.SCENE2D?(o.position.z=A-O.near+1,i.far=Math.max(1,O.far-O.near),i.near=1,l.update(s)):(i.near=0!==I?O.near*e.opaqueFrustumNearOffset:O.near,i.far=O.far),l.updateFrustum(i),E.execute(a,t),a.stencilBuffer&&x.execute(a,t),l.updatePass(e4.Z.GLOBE);let D=O.commands[e4.Z.GLOBE],P=O.indices[e4.Z.GLOBE];if(v)b.executeGlobeCommands(O,ZS,T,e,t);else for(r=0;r<P;++r)ZS(D[r],e,a,t);let R=d.globeDepth;if((0,y.Z)(R)&&h.useGlobeDepthFramebuffer&&R.executeCopyDepth(a,t),!h.renderTranslucentDepthForPick){if(l.updatePass(e4.Z.TERRAIN_CLASSIFICATION),D=O.commands[e4.Z.TERRAIN_CLASSIFICATION],P=O.indices[e4.Z.TERRAIN_CLASSIFICATION],v)b.executeGlobeClassificationCommands(O,ZS,T,e,t);else for(r=0;r<P;++r)ZS(D[r],e,a,t)}if(g&&(E.execute(a,t),Z&&S.execute(a,t)),!h.useInvertClassification||u||h.renderTranslucentDepthForPick){for(l.updatePass(e4.Z.CESIUM_3D_TILE),D=O.commands[e4.Z.CESIUM_3D_TILE],P=O.indices[e4.Z.CESIUM_3D_TILE],r=0;r<P;++r)ZS(D[r],e,a,t);if(P>0&&((0,y.Z)(R)&&h.useGlobeDepthFramebuffer&&(R.prepareColorTextures(a,g),R.executeUpdateDepth(a,t,g,R.depthStencilTexture)),!h.renderTranslucentDepthForPick))for(l.updatePass(e4.Z.CESIUM_3D_TILE_CLASSIFICATION),D=O.commands[e4.Z.CESIUM_3D_TILE_CLASSIFICATION],P=O.indices[e4.Z.CESIUM_3D_TILE_CLASSIFICATION],r=0;r<P;++r)ZS(D[r],e,a,t)}else{e._invertClassification.clear(a,t);let i=t.framebuffer;for(t.framebuffer=e._invertClassification._fbo.framebuffer,l.updatePass(e4.Z.CESIUM_3D_TILE),D=O.commands[e4.Z.CESIUM_3D_TILE],P=O.indices[e4.Z.CESIUM_3D_TILE],r=0;r<P;++r)ZS(D[r],e,a,t);for((0,y.Z)(R)&&h.useGlobeDepthFramebuffer&&(e._invertClassification.prepareTextures(a),R.executeUpdateDepth(a,t,g,e._invertClassification._fbo.getDepthStencilTexture())),l.updatePass(e4.Z.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW),D=O.commands[e4.Z.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW],P=O.indices[e4.Z.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW],r=0;r<P;++r)ZS(D[r],e,a,t);for(t.framebuffer=i,e._invertClassification.executeClassified(a,t),1===s.invertClassificationColor.alpha&&e._invertClassification.executeUnclassified(a,t),P>0&&a.stencilBuffer&&w.execute(a,t),l.updatePass(e4.Z.CESIUM_3D_TILE_CLASSIFICATION),D=O.commands[e4.Z.CESIUM_3D_TILE_CLASSIFICATION],P=O.indices[e4.Z.CESIUM_3D_TILE_CLASSIFICATION],r=0;r<P;++r)ZS(D[r],e,a,t)}for(P>0&&a.stencilBuffer&&x.execute(a,t),l.updatePass(e4.Z.VOXELS),D=O.commands[e4.Z.VOXELS],P=O.indices[e4.Z.VOXELS],D.length=P,function(e,t,i,n){let r=e.context;ok(n,ZA,e.camera.positionWC);let o=n.length;for(let a=0;a<o;++a)t(n[a],e,r,i)}(e,ZS,t,D),l.updatePass(e4.Z.OPAQUE),D=O.commands[e4.Z.OPAQUE],P=O.indices[e4.Z.OPAQUE],r=0;r<P;++r)ZS(D[r],e,a,t);if(0!==I&&e.mode!==eB.Z.SCENE2D&&(i.near=O.near,l.updateFrustum(i)),!u&&h.useInvertClassification&&s.invertClassificationColor.alpha<1&&(p=e._invertClassification),l.updatePass(e4.Z.TRANSLUCENT),(D=O.commands[e4.Z.TRANSLUCENT]).length=O.indices[e4.Z.TRANSLUCENT],n(e,ZS,t,D,p),O.indices[e4.Z.CESIUM_3D_TILE_CLASSIFICATION]>0&&d.translucentTileClassification.isSupported()&&(d.translucentTileClassification.executeTranslucentCommands(e,ZS,t,D,R.depthStencilTexture),d.translucentTileClassification.executeClassificationCommands(e,ZS,t,O)),a.depthTexture&&e.useDepthPicking&&(h.useGlobeDepthFramebuffer||f)){let i=R.depthStencilTexture,n=e._picking.getPickDepth(e,I);n.update(a,i),n.executeCopyDepth(a,t)}if(u||!C)continue;let N=t.framebuffer;if(t.framebuffer=d.sceneFramebuffer.getIdFramebuffer(),i.near=0!==I?O.near*e.opaqueFrustumNearOffset:O.near,i.far=O.far,l.updateFrustum(i),l.updatePass(e4.Z.GLOBE),D=O.commands[e4.Z.GLOBE],P=O.indices[e4.Z.GLOBE],v)b.executeGlobeCommands(O,ZC,T,e,t);else for(r=0;r<P;++r)ZC(D[r],e,a,t);for(g&&(E.framebuffer=t.framebuffer,E.execute(a,t),E.framebuffer=void 0),g&&Z&&S.execute(a,t),l.updatePass(e4.Z.CESIUM_3D_TILE),D=O.commands[e4.Z.CESIUM_3D_TILE],P=O.indices[e4.Z.CESIUM_3D_TILE],r=0;r<P;++r)ZC(D[r],e,a,t);for(l.updatePass(e4.Z.OPAQUE),D=O.commands[e4.Z.OPAQUE],P=O.indices[e4.Z.OPAQUE],r=0;r<P;++r)ZC(D[r],e,a,t);for(l.updatePass(e4.Z.TRANSLUCENT),D=O.commands[e4.Z.TRANSLUCENT],P=O.indices[e4.Z.TRANSLUCENT],r=0;r<P;++r)ZC(D[r],e,a,t);t.framebuffer=N}}function ZF(e){e.context.uniformState.updatePass(e4.Z.COMPUTE);let t=e._environmentState.sunComputeCommand;(0,y.Z)(t)&&t.execute(e._computeEngine);let i=e._computeCommandList,n=i.length;for(let t=0;t<n;++t)i[t].execute(e._computeEngine)}function Zz(e){let t=e.frameState,i=t.shadowState.shadowMaps,n=i.length;if(!t.shadowState.shadowsEnabled)return;let r=e.context,o=r.uniformState;for(let t=0;t<n;++t){let n=i[t];if(n.outOfView)continue;let a=n.passes,s=a.length;for(let e=0;e<s;++e)a[e].commandList.length=0;let l=e.frameState.commandList;!function(e,t,i){let n=i.shadowMapCullingVolume,r=i.isPointLight,o=i.passes,a=o.length,s=t.length;for(let i=0;i<s;++i){let s=t[i];if(e.updateDerivedCommands(s),s.castShadows&&(s.pass===e4.Z.GLOBE||s.pass===e4.Z.CESIUM_3D_TILE||s.pass===e4.Z.OPAQUE||s.pass===e4.Z.TRANSLUCENT)&&e.isVisible(s,n)){if(r)for(let e=0;e<a;++e)o[e].commandList.push(s);else if(1===a)o[0].commandList.push(s);else{let t=!1;for(let i=a-1;i>=0;--i){let n=o[i].cullingVolume;if(e.isVisible(s,n))o[i].commandList.push(s),t=!0;else if(t)break}}}}}(e,l,n);for(let i=0;i<s;++i){let a=n.passes[i];o.updateCamera(a.camera),n.updatePass(r,i);let s=a.commandList.length;for(let i=0;i<s;++i){let n=a.commandList[i];o.updatePass(n.pass),ZS(n.derivedCommands.shadows.castCommands[t],e,r,a.passState)}}}}let ZB=new _.Z;Zg.prototype.updateAndExecuteCommands=function(e,t){let i=this._frameState.mode;this._environmentState.useWebVR?function(e,t,i){let n=e._view,r=n.camera,o=e._environmentState.renderTranslucentDepthForPick;ZK(e,t,i),Z$(e),n.createPotentiallyVisibleSet(e),ZF(e),o||Zz(e);let a=t.viewport;a.x=0,a.y=0,a.width=.5*a.width;let s=sf.clone(r,e._cameraVR);s.frustum=r.frustum;let l=r.frustum.near,c=l*(0,Z.Z)(e.focalLength,5),u=(0,Z.Z)(e.eyeSeparation,c/30),h=_.Z.multiplyByScalar(s.right,.5*u,ZB);r.frustum.aspectRatio=a.width/a.height;let d=.5*u*l/c;_.Z.add(s.position,h,r.position),r.frustum.xOffset=d,ZM(e,t),a.x=a.width,_.Z.subtract(s.position,h,r.position),r.frustum.xOffset=-d,ZM(e,t),sf.clone(s,r)}(this,e,t):i!==eB.Z.SCENE2D||this._mapMode2D===sd.ROTATE?ZY(!0,this,e,t):(ZK(this,e,t),function(e,t){let i=e.context,n=e.frameState,r=e.camera,o=t.viewport,a=oN.Z.clone(o,Zq);t.viewport=a,e.mapProjection.project(ZU,Zk);let s=_.Z.clone(r.position,ZV),l=z.Z.clone(r.transform,ZG),c=r.frustum.clone();r._setTransform(z.Z.IDENTITY);let u=z.Z.computeViewportTransformation(a,0,1,ZH),h=r.frustum.projectionMatrix,d=r.positionWC.y,f=_.Z.fromElements(F.Z.sign(d)*Zk.x-d,0,-r.positionWC.x,Zj),p=et.Z.pointToGLWindowCoordinates(h,u,f,ZW);p.x=Math.floor(p.x);let m=a.x,g=a.width;if(0===d||p.x<=m||p.x>=m+g)ZY(!0,e,t);else if(1>Math.abs(m+.5*g-p.x))a.width=p.x-a.x,r.position.x*=F.Z.sign(r.position.x),r.frustum.right=0,n.cullingVolume=r.frustum.computeCullingVolume(r.positionWC,r.directionWC,r.upWC),i.uniformState.update(n),ZY(!0,e,t),a.x=p.x,r.position.x=-r.position.x,r.frustum.right=-r.frustum.left,r.frustum.left=0,n.cullingVolume=r.frustum.computeCullingVolume(r.positionWC,r.directionWC,r.upWC),i.uniformState.update(n),ZY(!1,e,t);else if(p.x>m+.5*g){a.width=p.x-m;let o=r.frustum.right;r.frustum.right=Zk.x-d,n.cullingVolume=r.frustum.computeCullingVolume(r.positionWC,r.directionWC,r.upWC),i.uniformState.update(n),ZY(!0,e,t),a.x=p.x,a.width=m+g-p.x,r.position.x=-r.position.x,r.frustum.left=-r.frustum.right,r.frustum.right=o-2*r.frustum.right,n.cullingVolume=r.frustum.computeCullingVolume(r.positionWC,r.directionWC,r.upWC),i.uniformState.update(n),ZY(!1,e,t)}else{a.x=p.x,a.width=m+g-p.x;let o=r.frustum.left;r.frustum.left=-Zk.x-d,n.cullingVolume=r.frustum.computeCullingVolume(r.positionWC,r.directionWC,r.upWC),i.uniformState.update(n),ZY(!0,e,t),a.x=m,a.width=p.x-m,r.position.x=-r.position.x,r.frustum.right=-r.frustum.left,r.frustum.left=o-2*r.frustum.left,n.cullingVolume=r.frustum.computeCullingVolume(r.positionWC,r.directionWC,r.upWC),i.uniformState.update(n),ZY(!1,e,t)}r._setTransform(l),_.Z.clone(s,r.position),r.frustum=c.clone(),t.viewport=o}(this,e))};let ZU=new C.Z(Math.PI,F.Z.PI_OVER_TWO),Zk=new _.Z,ZV=new _.Z,ZH=new z.Z,ZG=new z.Z,Zj=new _.Z,ZW=new _.Z,Zq=new oN.Z;function ZY(e,t,i,n){let r=t._environmentState,o=t._view,a=r.renderTranslucentDepthForPick;e||(t.frameState.commandList.length=0),Z$(t),o.createPotentiallyVisibleSet(t),e&&((0,y.Z)(n)&&ZK(t,i,n),ZF(t),a||Zz(t)),ZM(t,i)}let ZX=new oM.Z;function Z$(e){let t=e._frameState;e._groundPrimitives.update(t),e._primitives.update(t),function(e){let t=e._frameState;e.debugShowFrustumPlanes!==e._debugShowFrustumPlanes&&(e.debugShowFrustumPlanes?e._debugFrustumPlanes=new cM({camera:e.camera,updateOnChange:!1,frustumSplits:t.frustumSplits}):e._debugFrustumPlanes=e._debugFrustumPlanes&&e._debugFrustumPlanes.destroy(),e._debugShowFrustumPlanes=e.debugShowFrustumPlanes),(0,y.Z)(e._debugFrustumPlanes)&&e._debugFrustumPlanes.update(t)}(e),function(e){let t=e._frameState,i=t.shadowMaps,n=i.length,r=n>0&&!t.passes.pick&&!t.passes.pickVoxel&&e.mode===eB.Z.SCENE3D;if(r!==t.shadowState.shadowsEnabled&&(++t.shadowState.lastDirtyTime,t.shadowState.shadowsEnabled=r),t.shadowState.lightShadowsEnabled=!1,r){for(let e=0;e<n;++e)if(i[e]!==t.shadowState.shadowMaps[e]){++t.shadowState.lastDirtyTime;break}t.shadowState.shadowMaps.length=0,t.shadowState.lightShadowMaps.length=0;for(let e=0;e<n;++e){let n=i[e];n.update(t),t.shadowState.shadowMaps.push(n),n.fromLightSource&&(t.shadowState.lightShadowMaps.push(n),t.shadowState.lightShadowsEnabled=!0),n.dirty&&(++t.shadowState.lastDirtyTime,n.dirty=!1)}}}(e),e._globe&&e._globe.render(t)}function ZK(e,t,i){let n=e._context,r=e._frameState,o=e._environmentState,a=e._view,s=e._frameState.passes,l=s.pick||s.pickVoxel;(0,y.Z)(a.globeDepth)&&(a.globeDepth.picking=l);let c=o.useWebVR;o.originalFramebuffer=t.framebuffer,(0,y.Z)(e.sun)&&e.sunBloom!==e._sunBloom?(e.sunBloom&&!c?e._sunPostProcess=new _d:(0,y.Z)(e._sunPostProcess)&&(e._sunPostProcess=e._sunPostProcess.destroy()),e._sunBloom=e.sunBloom):!(0,y.Z)(e.sun)&&(0,y.Z)(e._sunPostProcess)&&(e._sunPostProcess=e._sunPostProcess.destroy(),e._sunBloom=!1);let u=e._clearColorCommand;A.Z.clone(i,u.color),u.execute(n,t);let h=o.useGlobeDepthFramebuffer=(0,y.Z)(a.globeDepth);h&&(a.globeDepth.update(n,t,a.viewport,e.msaaSamples,e._hdr,o.clearGlobeDepth),a.globeDepth.clear(n,t,i));let d=a.oit,f=o.useOIT=!l&&(0,y.Z)(d)&&d.isSupported();f&&(d.update(n,t,a.globeDepth.colorFramebufferManager,e._hdr,e.msaaSamples),d.clear(n,t,i),o.useOIT=d.isSupported());let p=e.postProcessStages,m=o.usePostProcess=!l&&(e._hdr||p.length>0||p.ambientOcclusion.enabled||p.fxaa.enabled||p.bloom.enabled);if(o.usePostProcessSelected=!1,m&&(a.sceneFramebuffer.update(n,a.viewport,e._hdr,e.msaaSamples),a.sceneFramebuffer.clear(n,t,i),p.update(n,r.useLogDepth,e._hdr),p.clear(n),m=o.usePostProcess=p.ready,o.usePostProcessSelected=m&&p.hasSelected),o.isSunVisible&&e.sunBloom&&!c?(t.framebuffer=e._sunPostProcess.update(t),e._sunPostProcess.clear(n,t,i)):h?t.framebuffer=a.globeDepth.framebuffer:m&&(t.framebuffer=a.sceneFramebuffer.framebuffer),(0,y.Z)(t.framebuffer)&&u.execute(n,t),o.useInvertClassification=!l&&(0,y.Z)(t.framebuffer)&&e.invertClassification){let i;if(1===e.frameState.invertClassificationColor.alpha&&o.useGlobeDepthFramebuffer&&(i=a.globeDepth.framebuffer),(0,y.Z)(i)||n.depthTexture){if(e._invertClassification.previousFramebuffer=i,e._invertClassification.update(n,e.msaaSamples,a.globeDepth.colorFramebufferManager),e._invertClassification.clear(n,t),e.frameState.invertClassificationColor.alpha<1&&f){let t=e._invertClassification.unclassifiedCommand,i=t.derivedCommands;i.oit=d.createDerivedCommands(t,n,i.oit)}}else o.useInvertClassification=!1}e._globeTranslucencyState.translucent&&a.globeTranslucencyFramebuffer.updateAndClear(e._hdr,a.viewport,n,t)}Zg.prototype.updateEnvironment=function(){let e=this._frameState,t=this._view,i=this._environmentState,n=e.passes.render,r=e.passes.offscreen,o=this.atmosphere,a=this.skyAtmosphere,s=this.globe,l=this._globeTranslucencyState;if(!n||this._mode!==eB.Z.SCENE2D&&t.camera.frustum instanceof e$.Z||!l.environmentVisible)i.skyAtmosphereCommand=void 0,i.skyBoxCommand=void 0,i.sunDrawCommand=void 0,i.sunComputeCommand=void 0,i.moonCommand=void 0;else{if((0,y.Z)(a)){if((0,y.Z)(s))a.setDynamicLighting(aW.fromGlobeFlags(s)),i.isReadyForAtmosphere=i.isReadyForAtmosphere||!s.show||s._surface._tilesToRender.length>0;else{let e=o.dynamicLighting;a.setDynamicLighting(e),i.isReadyForAtmosphere=!0}i.skyAtmosphereCommand=a.update(e,s),(0,y.Z)(i.skyAtmosphereCommand)&&this.updateDerivedCommands(i.skyAtmosphereCommand)}else i.skyAtmosphereCommand=void 0;i.skyBoxCommand=(0,y.Z)(this.skyBox)?this.skyBox.update(e,this._hdr):void 0;let n=(0,y.Z)(this.sun)?this.sun.update(e,t.passState,this._hdr):void 0;i.sunDrawCommand=(0,y.Z)(n)?n.drawCommand:void 0,i.sunComputeCommand=(0,y.Z)(n)?n.computeCommand:void 0,i.moonCommand=(0,y.Z)(this.moon)?this.moon.update(e):void 0}let c=i.clearGlobeDepth=(0,y.Z)(s)&&s.show&&(!s.depthTestAgainstTerrain||this.mode===eB.Z.SCENE2D);(i.useDepthPlane=c&&this.mode===eB.Z.SCENE3D&&l.useDepthPlane)&&this._depthPlane.update(e),i.renderTranslucentDepthForPick=!1,i.useWebVR=this._useWebVR&&this.mode!==eB.Z.SCENE2D&&!r;let u=e.mode!==eB.Z.SCENE3D||l.sunVisibleThroughGlobe?void 0:e.occluder,h=e.cullingVolume,d=ZX.planes;for(let e=0;e<5;++e)d[e]=h.planes[e];h=ZX,i.isSkyAtmosphereVisible=(0,y.Z)(i.skyAtmosphereCommand)&&i.isReadyForAtmosphere,i.isSunVisible=this.isVisible(i.sunDrawCommand,h,u),i.isMoonVisible=this.isVisible(i.moonCommand,h,u);let f=this.specularEnvironmentMaps,p=this._specularEnvironmentMapAtlas;(0,y.Z)(f)&&(!(0,y.Z)(p)||p.url!==f)?(p=p&&p.destroy(),this._specularEnvironmentMapAtlas=new u0.Z(f)):!(0,y.Z)(f)&&(0,y.Z)(p)&&(p.destroy(),this._specularEnvironmentMapAtlas=void 0),(0,y.Z)(this._specularEnvironmentMapAtlas)&&this._specularEnvironmentMapAtlas.update(e)},Zg.prototype.resolveFramebuffers=function(e){let t=this._context,i=this._environmentState,n=this._view,r=n.globeDepth;(0,y.Z)(r)&&r.prepareColorTextures(t);let o=i.useOIT,a=i.useGlobeDepthFramebuffer,s=i.usePostProcess,l=i.originalFramebuffer,c=a?r.colorFramebufferManager:void 0,u=n.sceneFramebuffer._colorFramebuffer,h=n.sceneFramebuffer.idFramebuffer;o&&(e.framebuffer=s?u.framebuffer:l,n.oit.execute(t,e));let d=n.translucentTileClassification;if(d.hasTranslucentDepth&&d.isSupported()&&d.execute(this,e),s){n.sceneFramebuffer.prepareColorTextures(t);let e=u;a&&!o&&(e=c);let i=this.postProcessStages,r=e.getColorTexture(0),s=h.getColorTexture(0),d=(0,Z.Z)(c,u).getDepthStencilTexture();i.execute(t,r,d,s),i.copy(t,l)}o||s||!a||(e.framebuffer=l,r.executeCopyColor(t,e))},Zg.prototype.getHeight=function(e,t){if(!(0,y.Z)(e))return;let i=t===oz.ZP.CLAMP_TO_TERRAIN||t===oz.ZP.RELATIVE_TO_TERRAIN,n=t===oz.ZP.CLAMP_TO_3D_TILE||t===oz.ZP.RELATIVE_TO_3D_TILE;if(!(0,y.Z)(e))return;let r=Number.NEGATIVE_INFINITY;if(!i){let t=this.primitives.length;for(let i=0;i<t;++i){let t=this.primitives.get(i);if(!t.isCesium3DTileset||!t.show||!t.enableCollision)continue;let n=t.getHeight(e,this);(0,y.Z)(n)&&n>r&&(r=n)}}let o=this._globe;if(!n&&(0,y.Z)(o)&&o.show){let t=o.getHeight(e);t>r&&(r=t)}if(r>Number.NEGATIVE_INFINITY)return r};let ZQ=new C.Z;function ZJ(e){e._jobScheduler.resetBudgets();let t=e._frameState;e.primitives.prePassesUpdate(t),(0,y.Z)(e.globe)&&e.globe.update(t),e._picking.update(),t.creditDisplay.update()}function Z0(e){let t=e._frameState;e.primitives.postPassesUpdate(t),o7.Z.update()}Zg.prototype.updateHeight=function(e,t,i){let n;D.Z.typeOf.func("callback",t);let r=()=>{C.Z.clone(e,ZQ);let n=this.getHeight(e,i);(0,y.Z)(n)&&(ZQ.height=n,t(ZQ))},o=i===oz.ZP.CLAMP_TO_TERRAIN||i===oz.ZP.RELATIVE_TO_TERRAIN;!(i===oz.ZP.CLAMP_TO_3D_TILE||i===oz.ZP.RELATIVE_TO_3D_TILE)&&(0,y.Z)(this.globe)&&(n=this.globe._surface.updateHeight(e,r));let a={},s=this.globe?.ellipsoid,l=t=>{if(o||t.isDestroyed()||!t.isCesium3DTileset)return;let i=t.updateHeight(e,r,s);a[t.id]=i};if(!o){let e=this.primitives.length;for(let t=0;t<e;++t)l(this.primitives.get(t))}let c=this.primitives.primitiveAdded.addEventListener(l),u=this.primitives.primitiveRemoved.addEventListener(e=>{!e.isDestroyed()&&e.isCesium3DTileset&&((0,y.Z)(a[e.id])&&a[e.id](),delete a[e.id])});return()=>{n=n&&n(),Object.values(a).forEach(e=>e()),a={},c(),u()}},Zg.prototype.initializeFrame=function(){if(120==this._shaderFrameCount++&&(this._shaderFrameCount=0,this._context.shaderCache.destroyReleasedShaderPrograms(),this._context.textureCache.destroyReleasedTextures()),this._tweens.update(),this._globeHeightDirty){(0,y.Z)(this._removeUpdateHeightCallback)&&(this._removeUpdateHeightCallback(),this._removeUpdateHeightCallback=void 0),this._globeHeight=function(e){if(e.mode===eB.Z.MORPHING)return;let t=e.camera.positionCartographic;return e.getHeight(t)}(this),this._globeHeightDirty=!1;let e=this.camera.positionCartographic;this._removeUpdateHeightCallback=this.updateHeight(e,e=>{this.isDestroyed()||(this._globeHeight=e.height)})}this._cameraUnderground=function(e){let t=e.camera,i=e._mode,n=e._screenSpaceCameraController,r=t.positionCartographic;if(!(0,y.Z)(r))return!1;if(!n.onMap()&&r.height<0)return!0;if(i===eB.Z.SCENE2D||i===eB.Z.MORPHING)return!1;let o=e._globeHeight;return(0,y.Z)(o)&&r.height<o}(this),this._globeTranslucencyState.update(this),this._screenSpaceCameraController.update(),(0,y.Z)(this._deviceOrientationCameraController)&&this._deviceOrientationCameraController.update(),this.camera.update(this._mode),this.camera._updateCameraChanged()};let Z1=new A.Z;function Z2(e){let t=e._frameState,i=e.context,n=i.uniformState,r=e._defaultView;e._view=r,e.updateFrameState(),t.passes.render=!0,t.passes.postProcess=e.postProcessStages.hasSelected,t.tilesetPassState=Zy;let o=(0,Z.Z)(e.backgroundColor,A.Z.BLACK);e._hdr&&((o=A.Z.clone(o,Z1)).red=Math.pow(o.red,e.gamma),o.green=Math.pow(o.green,e.gamma),o.blue=Math.pow(o.blue,e.gamma)),t.backgroundColor=o,t.atmosphere=e.atmosphere,e.fog.update(t),n.update(t);let a=e.shadowMap;(0,y.Z)(a)&&a.enabled&&(!(0,y.Z)(e.light)||e.light instanceof a_?_.Z.negate(n.sunDirectionWC,e._shadowMapCamera.direction):_.Z.clone(e.light.direction,e._shadowMapCamera.direction),t.shadowMaps.push(a)),e._computeCommandList.length=0,e._overlayCommandList.length=0;let s=r.viewport;s.x=0,s.y=0,s.width=i.drawingBufferWidth,s.height=i.drawingBufferHeight;let l=r.passState;l.framebuffer=void 0,l.blendingEnabled=void 0,l.scissorTest=void 0,l.viewport=oN.Z.clone(s,l.viewport),(0,y.Z)(e.globe)&&e.globe.beginFrame(t),e.updateEnvironment(),e.updateAndExecuteCommands(l,o),e.resolveFramebuffers(l),l.framebuffer=void 0,function(e,t){e.context.uniformState.updatePass(e4.Z.OVERLAY);let i=e.context,n=e._overlayCommandList,r=n.length;for(let e=0;e<r;++e)n[e].execute(i,t)}(e,l),(0,y.Z)(e.globe)&&(e.globe.endFrame(t),e.globe.tilesLoaded||(e._renderRequested=!0)),i.endFrame()}function Z3(e,t){try{t(e)}catch(t){if(e._renderError.raiseEvent(e,t),e.rethrowRenderErrors)throw t}}function Z4(e){return e._picking.updateMostDetailedRayPicks(e)}function Z5(e){let t=e._frameState;Zb.camera=t.camera,Zb.cullingVolume=t.cullingVolume,e.primitives.updateForPass(t,Zb)}function Z9(e){let t=e._frameState;t.camera.canPreloadFlight()&&(Zv.camera=e.preloadFlightCamera,Zv.cullingVolume=e.preloadFlightCullingVolume,e.primitives.updateForPass(t,Zv))}function Z8(e){e.primitives.updateForPass(e._frameState,ZT)}Zg.prototype.render=function(e){this._preUpdate.raiseEvent(this,e);let t=this._frameState;t.newFrame=!1,(0,y.Z)(e)||(e=ix.Z.now());let i=this._view.checkForCameraUpdates(this);i&&(this._globeHeightDirty=!0);let n=!this.requestRenderMode||this._renderRequested||i||this._logDepthBufferDirty||this._hdrDirty||this.mode===eB.Z.MORPHING;if(!n&&(0,y.Z)(this.maximumRenderTimeChange)&&(0,y.Z)(this._lastRenderTime)){let t=Math.abs(ix.Z.secondsDifference(this._lastRenderTime,e));n=n||t>this.maximumRenderTimeChange}n&&(this._lastRenderTime=ix.Z.clone(e,this._lastRenderTime),this._renderRequested=!1,this._logDepthBufferDirty=!1,this._hdrDirty=!1,Zx(this,F.Z.incrementWrap(t.frameNumber,15e6,1),e),t.newFrame=!0),Z3(this,ZJ),this.primitives.show&&(Z3(this,Z4),Z3(this,Z5),Z3(this,Z9),n||Z3(this,Z8)),this._postUpdate.raiseEvent(this,e),n&&(this._preRender.raiseEvent(this,e),t.creditDisplay.beginFrame(),Z3(this,Z2)),function(e,t){if(e.debugShowFramesPerSecond){if(!(0,y.Z)(e._performanceDisplay)){let t=document.createElement("div");t.className="cesium-performanceDisplay-defaultContainer",e._canvas.parentNode.appendChild(t);let i=new u1({container:t});e._performanceDisplay=i,e._performanceContainer=t}e._performanceDisplay.throttled=e.requestRenderMode,e._performanceDisplay.update(t)}else(0,y.Z)(e._performanceDisplay)&&(e._performanceDisplay=e._performanceDisplay&&e._performanceDisplay.destroy(),e._performanceContainer.parentNode.removeChild(e._performanceContainer))}(this,n),Z3(this,Z0),function(e){let t=e._frameState.afterRender;for(let i=0,n=t.length;i<n;++i)t[i]()&&e.requestRender();t.length=0}(this),n&&(this._postRender.raiseEvent(this,e),t.creditDisplay.endFrame())},Zg.prototype.forceRender=function(e){this._renderRequested=!0,this.render(e)},Zg.prototype.requestRender=function(){this._renderRequested=!0},Zg.prototype.clampLineWidth=function(e){return Math.max(e2.Z.minimumAliasedLineWidth,Math.min(e,e2.Z.maximumAliasedLineWidth))},Zg.prototype.pick=function(e,t,i){return this._picking.pick(this,e,t,i)},Zg.prototype.pickVoxel=function(e,t,i){let n=this.pick(e,t,i);if(!(0,y.Z)(n))return;let r=n.primitive;if(!(r instanceof gJ))return;let o=this._picking.pickVoxelCoordinate(this,e,t,i),a=255*o[0]+o[1],s=r._traversal.findKeyframeNode(a);if(!(0,y.Z)(s))return;let l=255*o[2]+o[3];return _v.fromKeyframeNode(r,a,l,s)},Zg.prototype.pickPositionWorldCoordinates=function(e,t){return this._picking.pickPositionWorldCoordinates(this,e,t)},Zg.prototype.pickPosition=function(e,t){return this._picking.pickPosition(this,e,t)},Zg.prototype.drillPick=function(e,t,i,n){return this._picking.drillPick(this,e,t,i,n)},Zg.prototype.pickFromRay=function(e,t,i){return this._picking.pickFromRay(this,e,t,i)},Zg.prototype.drillPickFromRay=function(e,t,i,n){return this._picking.drillPickFromRay(this,e,t,i,n)},Zg.prototype.pickFromRayMostDetailed=function(e,t,i){return this._picking.pickFromRayMostDetailed(this,e,t,i)},Zg.prototype.drillPickFromRayMostDetailed=function(e,t,i,n){return this._picking.drillPickFromRayMostDetailed(this,e,t,i,n)},Zg.prototype.sampleHeight=function(e,t,i){return this._picking.sampleHeight(this,e,t,i)},Zg.prototype.clampToHeight=function(e,t,i,n){return this._picking.clampToHeight(this,e,t,i,n)},Zg.prototype.sampleHeightMostDetailed=function(e,t,i){return this._picking.sampleHeightMostDetailed(this,e,t,i)},Zg.prototype.clampToHeightMostDetailed=function(e,t,i){return this._picking.clampToHeightMostDetailed(this,e,t,i)},Zg.prototype.cartesianToCanvasCoordinates=function(e,t){return u7.Z.wgs84ToWindowCoordinates(this,e,t)},Zg.prototype.completeMorph=function(){this._transitioner.completeMorph()},Zg.prototype.morphTo2D=function(e){let t;let i=this.globe;t=(0,y.Z)(i)?i.ellipsoid:this.mapProjection.ellipsoid,e=(0,Z.Z)(e,2),this._transitioner.morphTo2D(e,t)},Zg.prototype.morphToColumbusView=function(e){let t;let i=this.globe;t=(0,y.Z)(i)?i.ellipsoid:this.mapProjection.ellipsoid,e=(0,Z.Z)(e,2),this._transitioner.morphToColumbusView(e,t)},Zg.prototype.morphTo3D=function(e){let t;let i=this.globe;t=(0,y.Z)(i)?i.ellipsoid:this.mapProjection.ellipsoid,e=(0,Z.Z)(e,2),this._transitioner.morphTo3D(e,t)},Zg.prototype.setTerrain=function(e){return D.Z.typeOf.object("terrain",e),function(e,t){if(e._removeTerrainProviderReadyListener=e._removeTerrainProviderReadyListener&&e._removeTerrainProviderReadyListener(),t.ready){(0,y.Z)(e.globe)&&(e.globe.terrainProvider=t.provider);return}e.globe.terrainProvider=void 0,e._removeTerrainProviderReadyListener=t.readyEvent.addEventListener(t=>{(0,y.Z)(e)&&(0,y.Z)(e.globe)&&(e.globe.terrainProvider=t),e._removeTerrainProviderReadyListener()})}(this,e),e},Zg.prototype.isDestroyed=function(){return!1},Zg.prototype.destroy=function(){this._tweens.removeAll(),this._computeEngine=this._computeEngine&&this._computeEngine.destroy(),this._screenSpaceCameraController=this._screenSpaceCameraController&&this._screenSpaceCameraController.destroy(),this._deviceOrientationCameraController=this._deviceOrientationCameraController&&!this._deviceOrientationCameraController.isDestroyed()&&this._deviceOrientationCameraController.destroy(),this._primitives=this._primitives&&this._primitives.destroy(),this._groundPrimitives=this._groundPrimitives&&this._groundPrimitives.destroy(),this._globe=this._globe&&this._globe.destroy(),this._removeTerrainProviderReadyListener=this._removeTerrainProviderReadyListener&&this._removeTerrainProviderReadyListener(),this.skyBox=this.skyBox&&this.skyBox.destroy(),this.skyAtmosphere=this.skyAtmosphere&&this.skyAtmosphere.destroy(),this._debugSphere=this._debugSphere&&this._debugSphere.destroy(),this.sun=this.sun&&this.sun.destroy(),this._sunPostProcess=this._sunPostProcess&&this._sunPostProcess.destroy(),this._depthPlane=this._depthPlane&&this._depthPlane.destroy(),this._transitioner=this._transitioner&&this._transitioner.destroy(),this._debugFrustumPlanes=this._debugFrustumPlanes&&this._debugFrustumPlanes.destroy(),this._brdfLutGenerator=this._brdfLutGenerator&&this._brdfLutGenerator.destroy(),this._picking=this._picking&&this._picking.destroy(),this._defaultView=this._defaultView&&this._defaultView.destroy(),this._view=void 0,this._removeCreditContainer&&this._canvas.parentNode.removeChild(this._creditContainer),this.postProcessStages=this.postProcessStages&&this.postProcessStages.destroy(),this._context=this._context&&this._context.destroy(),this._frameState.creditDisplay=this._frameState.creditDisplay&&this._frameState.creditDisplay.destroy(),(0,y.Z)(this._performanceDisplay)&&(this._performanceDisplay=this._performanceDisplay&&this._performanceDisplay.destroy(),this._performanceContainer.parentNode.removeChild(this._performanceContainer)),this._removeRequestListenerCallback(),this._removeTaskProcessorListenerCallback();for(let e=0;e<this._removeGlobeCallbacks.length;++e)this._removeGlobeCallbacks[e]();return this._removeGlobeCallbacks.length=0,(0,y.Z)(this._removeUpdateHeightCallback)&&(this._removeUpdateHeightCallback(),this._removeUpdateHeightCallback=void 0),(0,b.Z)(this)};var Z6="float interpolateByDistance(vec4 nearFarScalar, float distance)\n{\n float startDistance = nearFarScalar.x;\n float startValue = nearFarScalar.y;\n float endDistance = nearFarScalar.z;\n float endValue = nearFarScalar.w;\n float t = clamp((distance - startDistance) / (endDistance - startDistance), 0.0, 1.0);\n return mix(startValue, endValue, t);\n}\n\nvoid computeAtmosphereScattering(vec3 positionWC, vec3 lightDirection, out vec3 rayleighColor, out vec3 mieColor, out float opacity, out float underTranslucentGlobe)\n{\n float ellipsoidRadiiDifference = czm_ellipsoidRadii.x - czm_ellipsoidRadii.z;\n\n // Adjustment to the atmosphere radius applied based on the camera height.\n float distanceAdjustMin = czm_ellipsoidRadii.x / 4.0;\n float distanceAdjustMax = czm_ellipsoidRadii.x;\n float distanceAdjustModifier = ellipsoidRadiiDifference / 2.0;\n float distanceAdjust = distanceAdjustModifier * clamp((czm_eyeHeight - distanceAdjustMin) / (distanceAdjustMax - distanceAdjustMin), 0.0, 1.0);\n\n // Since atmosphere scattering assumes the atmosphere is a spherical shell, we compute an inner radius of the atmosphere best fit\n // for the position on the ellipsoid.\n float radiusAdjust = (ellipsoidRadiiDifference / 4.0) + distanceAdjust;\n float atmosphereInnerRadius = (length(czm_viewerPositionWC) - czm_eyeHeight) - radiusAdjust;\n\n // Setup the primary ray: from the camera position to the vertex position.\n vec3 cameraToPositionWC = positionWC - czm_viewerPositionWC;\n vec3 cameraToPositionWCDirection = normalize(cameraToPositionWC);\n czm_ray primaryRay = czm_ray(czm_viewerPositionWC, cameraToPositionWCDirection);\n\n underTranslucentGlobe = 0.0;\n\n // Brighten the sky atmosphere under the Earth's atmosphere when translucency is enabled.\n #if defined(GLOBE_TRANSLUCENT)\n\n // Check for intersection with the inner radius of the atmopshere.\n czm_raySegment primaryRayEarthIntersect = czm_raySphereIntersectionInterval(primaryRay, vec3(0.0), atmosphereInnerRadius + radiusAdjust);\n if (primaryRayEarthIntersect.start > 0.0 && primaryRayEarthIntersect.stop > 0.0) {\n\n // Compute position on globe.\n vec3 direction = normalize(positionWC);\n czm_ray ellipsoidRay = czm_ray(positionWC, -direction);\n czm_raySegment ellipsoidIntersection = czm_rayEllipsoidIntersectionInterval(ellipsoidRay, vec3(0.0), czm_ellipsoidInverseRadii);\n vec3 onEarth = positionWC - (direction * ellipsoidIntersection.start);\n\n // Control the color using the camera angle.\n float angle = dot(normalize(czm_viewerPositionWC), normalize(onEarth));\n\n // Control the opacity using the distance from Earth.\n opacity = interpolateByDistance(vec4(0.0, 1.0, czm_ellipsoidRadii.x, 0.0), length(czm_viewerPositionWC - onEarth));\n vec3 horizonColor = vec3(0.1, 0.2, 0.3);\n vec3 nearColor = vec3(0.0);\n\n rayleighColor = mix(nearColor, horizonColor, exp(-angle) * opacity);\n\n // Set the traslucent flag to avoid alpha adjustment in computeFinalColor funciton.\n underTranslucentGlobe = 1.0;\n return;\n }\n #endif\n\n computeScattering(\n primaryRay,\n length(cameraToPositionWC),\n lightDirection,\n atmosphereInnerRadius,\n rayleighColor,\n mieColor,\n opacity\n );\n\n // Alter the opacity based on how close the viewer is to the ground.\n // (0.0 = At edge of atmosphere, 1.0 = On ground)\n float cameraHeight = czm_eyeHeight + atmosphereInnerRadius;\n float atmosphereOuterRadius = atmosphereInnerRadius + ATMOSPHERE_THICKNESS;\n opacity = clamp((atmosphereOuterRadius - cameraHeight) / (atmosphereOuterRadius - atmosphereInnerRadius), 0.0, 1.0);\n\n // Alter alpha based on time of day (0.0 = night , 1.0 = day)\n float nightAlpha = (u_radiiAndDynamicAtmosphereColor.z != 0.0) ? clamp(dot(normalize(positionWC), lightDirection), 0.0, 1.0) : 1.0;\n opacity *= pow(nightAlpha, 0.5);\n}\n",Z7=i(996);function ye(e){e=(0,Z.Z)(e,T.Z.WGS84),this.show=!0,this.perFragmentAtmosphere=!1,this._ellipsoid=e;let t=_.Z.multiplyByScalar(e.radii,1.025,new _.Z);this._scaleMatrix=z.Z.fromScale(t),this._modelMatrix=new z.Z,this._command=new e3.Z({owner:this,modelMatrix:this._modelMatrix}),this._spSkyFromSpace=void 0,this._spSkyFromAtmosphere=void 0,this._flags=void 0,this.atmosphereLightIntensity=50,this.atmosphereRayleighCoefficient=new _.Z(55e-7,13e-6,284e-7),this.atmosphereMieCoefficient=new _.Z(21e-6,21e-6,21e-6),this.atmosphereRayleighScaleHeight=1e4,this.atmosphereMieScaleHeight=3200,this.atmosphereMieAnisotropy=.9,this.hueShift=0,this.saturationShift=0,this.brightnessShift=0,this._hueSaturationBrightness=new _.Z;let i=new _.Z;i.x=1.025*e.maximumRadius,i.y=e.maximumRadius,i.z=0,this._radiiAndDynamicAtmosphereColor=i;let n=this;this._command.uniformMap={u_radiiAndDynamicAtmosphereColor:function(){return n._radiiAndDynamicAtmosphereColor},u_hsbShift:function(){return n._hueSaturationBrightness.x=n.hueShift,n._hueSaturationBrightness.y=n.saturationShift,n._hueSaturationBrightness.z=n.brightnessShift,n._hueSaturationBrightness},u_atmosphereLightIntensity:function(){return n.atmosphereLightIntensity},u_atmosphereRayleighCoefficient:function(){return n.atmosphereRayleighCoefficient},u_atmosphereMieCoefficient:function(){return n.atmosphereMieCoefficient},u_atmosphereRayleighScaleHeight:function(){return n.atmosphereRayleighScaleHeight},u_atmosphereMieScaleHeight:function(){return n.atmosphereMieScaleHeight},u_atmosphereMieAnisotropy:function(){return n.atmosphereMieAnisotropy}}}Object.defineProperties(ye.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),ye.prototype.setDynamicLighting=function(e){this._radiiAndDynamicAtmosphereColor.z=e};let yt=new z.Z;ye.prototype.update=function(e,t){if(!this.show)return;let i=e.mode;if(i!==eB.Z.SCENE3D&&i!==eB.Z.MORPHING||!e.passes.render)return;let n=z.Z.fromRotationTranslation(e.context.uniformState.inverseViewRotation,_.Z.ZERO,yt),r=z.Z.multiplyTransformation(n,Z7.Z.Y_UP_TO_Z_UP,yt),o=z.Z.multiply(this._scaleMatrix,r,yt);z.Z.clone(o,this._modelMatrix);let a=e.context,s=!(F.Z.equalsEpsilon(this.hueShift,0,F.Z.EPSILON7)&&F.Z.equalsEpsilon(this.saturationShift,0,F.Z.EPSILON7)&&F.Z.equalsEpsilon(this.brightnessShift,0,F.Z.EPSILON7)),l=e.globeTranslucencyState.translucent,c=this.perFragmentAtmosphere||l||!(0,y.Z)(t)||!t.show,u=this._command;if(!(0,y.Z)(u.vertexArray)){let e=oF.Z.createGeometry(new oF.Z({radii:new _.Z(1,1,1),slicePartitions:256,stackPartitions:256,vertexFormat:oT.Z.POSITION_ONLY}));u.vertexArray=e9.Z.fromGeometry({context:a,geometry:e,attributeLocations:eY.Z.createAttributeLocations(e),bufferUsage:e1.Z.STATIC_DRAW}),u.renderState=e5.Z.fromCache({cull:{enabled:!0,face:ow.Z.FRONT},blending:e8.Z.ALPHA_BLEND,depthMask:!1})}let h=s|c<<2|l<<3;if(h!==this._flags){this._flags=h;let e=[];s&&e.push("COLOR_CORRECT"),c&&e.push("PER_FRAGMENT_ATMOSPHERE"),l&&e.push("GLOBE_TRANSLUCENT");let t=new eD.Z({defines:e,sources:[eR,Z6,"in vec4 position;\n\nout vec3 v_outerPositionWC;\n\n#ifndef PER_FRAGMENT_ATMOSPHERE\nout vec3 v_mieColor;\nout vec3 v_rayleighColor;\nout float v_opacity;\nout float v_translucent;\n#endif\n\nvoid main(void)\n{\n vec4 positionWC = czm_model * position;\n float lightEnum = u_radiiAndDynamicAtmosphereColor.z;\n vec3 lightDirection = czm_getDynamicAtmosphereLightDirection(positionWC.xyz, lightEnum);\n\n #ifndef PER_FRAGMENT_ATMOSPHERE\n computeAtmosphereScattering(\n positionWC.xyz,\n lightDirection,\n v_rayleighColor,\n v_mieColor,\n v_opacity,\n v_translucent\n );\n #endif\n\n v_outerPositionWC = positionWC.xyz;\n gl_Position = czm_modelViewProjection * position;\n}\n"]}),i=new eD.Z({defines:e,sources:[eR,Z6,"in vec3 v_outerPositionWC;\n\nuniform vec3 u_hsbShift;\n\n#ifndef PER_FRAGMENT_ATMOSPHERE\nin vec3 v_mieColor;\nin vec3 v_rayleighColor;\nin float v_opacity;\nin float v_translucent;\n#endif\n\nvoid main (void)\n{\n float lightEnum = u_radiiAndDynamicAtmosphereColor.z;\n vec3 lightDirection = czm_getDynamicAtmosphereLightDirection(v_outerPositionWC, lightEnum);\n\n vec3 mieColor;\n vec3 rayleighColor;\n float opacity;\n float translucent;\n\n #ifdef PER_FRAGMENT_ATMOSPHERE\n computeAtmosphereScattering(\n v_outerPositionWC,\n lightDirection,\n rayleighColor,\n mieColor,\n opacity,\n translucent\n );\n #else\n mieColor = v_mieColor;\n rayleighColor = v_rayleighColor;\n opacity = v_opacity;\n translucent = v_translucent;\n #endif\n\n vec4 color = computeAtmosphereColor(v_outerPositionWC, lightDirection, rayleighColor, mieColor, opacity);\n\n #ifndef HDR\n color.rgb = czm_acesTonemapping(color.rgb);\n color.rgb = czm_inverseGamma(color.rgb);\n #endif\n\n #ifdef COLOR_CORRECT\n const bool ignoreBlackPixels = true;\n color.rgb = czm_applyHSBShift(color.rgb, u_hsbShift, ignoreBlackPixels);\n #endif\n\n // For the parts of the sky atmosphere that are not behind a translucent globe,\n // we mix in the default opacity so that the sky atmosphere still appears at distance.\n // This is needed because the opacity in the sky atmosphere is initially adjusted based\n // on the camera height.\n if (translucent == 0.0) {\n color.a = mix(color.b, 1.0, color.a) * smoothstep(0.0, 1.0, czm_morphTime);\n }\n\n out_FragColor = color;\n}\n"]});this._spSkyAtmosphere=eL.Z.fromCache({context:a,vertexShaderSource:t,fragmentShaderSource:i}),u.shaderProgram=this._spSkyAtmosphere}return u},ye.prototype.isDestroyed=function(){return!1},ye.prototype.destroy=function(){let e=this._command;return e.vertexArray=e.vertexArray&&e.vertexArray.destroy(),this._spSkyAtmosphere=this._spSkyAtmosphere&&this._spSkyAtmosphere.destroy(),(0,b.Z)(this)};var yi=function(e,t,i){if(D.Z.defined("context",e),!(0,y.Z)(t)||!(0,y.Z)(t.positiveX)||!(0,y.Z)(t.negativeX)||!(0,y.Z)(t.positiveY)||!(0,y.Z)(t.negativeY)||!(0,y.Z)(t.positiveZ)||!(0,y.Z)(t.negativeZ))throw new v.Z("urls is required and must have positiveX, negativeX, positiveY, negativeY, positiveZ, and negativeZ properties.");let n={flipY:!0,skipColorSpaceConversion:i,preferImageBitmap:!0};return Promise.all([eO.Z.createIfNeeded(t.positiveX).fetchImage(n),eO.Z.createIfNeeded(t.negativeX).fetchImage(n),eO.Z.createIfNeeded(t.positiveY).fetchImage(n),eO.Z.createIfNeeded(t.negativeY).fetchImage(n),eO.Z.createIfNeeded(t.positiveZ).fetchImage(n),eO.Z.createIfNeeded(t.negativeZ).fetchImage(n)]).then(function(t){return new au.Z({context:e,source:{positiveX:t[0],negativeX:t[1],positiveY:t[2],negativeY:t[3],positiveZ:t[4],negativeZ:t[5]}})})};function yn(e){this.sources=e.sources,this._sources=void 0,this.show=(0,Z.Z)(e.show,!0),this._command=new e3.Z({modelMatrix:z.Z.clone(z.Z.IDENTITY),owner:this}),this._cubeMap=void 0,this._attributeLocations=void 0,this._useHdr=void 0}function yr(){this.show=!0,this._drawCommand=new e3.Z({primitiveType:eK.Z.TRIANGLES,boundingVolume:new S.Z,owner:this}),this._commands={drawCommand:this._drawCommand,computeCommand:void 0},this._boundingVolume=new S.Z,this._boundingVolume2D=new S.Z,this._texture=void 0,this._drawingBufferWidth=void 0,this._drawingBufferHeight=void 0,this._radiusTS=void 0,this._size=void 0,this.glowFactor=1,this._glowFactorDirty=!1,this._useHdr=void 0;let e=this;this._uniformMap={u_texture:function(){return e._texture},u_size:function(){return e._size}}}yn.prototype.update=function(e,t){let i=this;if(!this.show||e.mode!==eB.Z.SCENE3D&&e.mode!==eB.Z.MORPHING||!e.passes.render)return;let n=e.context;if(this._sources!==this.sources){this._sources=this.sources;let e=this.sources;if(!(0,y.Z)(e.positiveX)||!(0,y.Z)(e.negativeX)||!(0,y.Z)(e.positiveY)||!(0,y.Z)(e.negativeY)||!(0,y.Z)(e.positiveZ)||!(0,y.Z)(e.negativeZ))throw new v.Z("this.sources is required and must have positiveX, negativeX, positiveY, negativeY, positiveZ, and negativeZ properties.");if(typeof e.positiveX!=typeof e.negativeX||typeof e.positiveX!=typeof e.positiveY||typeof e.positiveX!=typeof e.negativeY||typeof e.positiveX!=typeof e.positiveZ||typeof e.positiveX!=typeof e.negativeZ)throw new v.Z("this.sources properties must all be the same type.");"string"==typeof e.positiveX?yi(n,this._sources).then(function(e){i._cubeMap=i._cubeMap&&i._cubeMap.destroy(),i._cubeMap=e}):(this._cubeMap=this._cubeMap&&this._cubeMap.destroy(),this._cubeMap=new au.Z({context:n,source:e}))}let r=this._command;if(!(0,y.Z)(r.vertexArray)){r.uniformMap={u_cubeMap:function(){return i._cubeMap}};let e=ov.Z.createGeometry(ov.Z.fromDimensions({dimensions:new _.Z(2,2,2),vertexFormat:oT.Z.POSITION_ONLY})),t=this._attributeLocations=eY.Z.createAttributeLocations(e);r.vertexArray=e9.Z.fromGeometry({context:n,geometry:e,attributeLocations:t,bufferUsage:e1.Z.STATIC_DRAW}),r.renderState=e5.Z.fromCache({blending:e8.Z.ALPHA_BLEND})}if(!(0,y.Z)(r.shaderProgram)||this._useHdr!==t){let e=new eD.Z({defines:[t?"HDR":""],sources:["uniform samplerCube u_cubeMap;\n\nin vec3 v_texCoord;\n\nvoid main()\n{\n vec4 color = czm_textureCube(u_cubeMap, normalize(v_texCoord));\n out_FragColor = vec4(czm_gammaCorrect(color).rgb, czm_morphTime);\n}\n"]});r.shaderProgram=eL.Z.fromCache({context:n,vertexShaderSource:"in vec3 position;\n\nout vec3 v_texCoord;\n\nvoid main()\n{\n vec3 p = czm_viewRotation * (czm_temeToPseudoFixed * (czm_entireFrustum.y * position));\n gl_Position = czm_projection * vec4(p, 1.0);\n v_texCoord = position.xyz;\n}\n",fragmentShaderSource:e,attributeLocations:this._attributeLocations}),this._useHdr=t}if((0,y.Z)(this._cubeMap))return r},yn.prototype.isDestroyed=function(){return!1},yn.prototype.destroy=function(){let e=this._command;return e.vertexArray=e.vertexArray&&e.vertexArray.destroy(),e.shaderProgram=e.shaderProgram&&e.shaderProgram.destroy(),this._cubeMap=this._cubeMap&&this._cubeMap.destroy(),(0,b.Z)(this)},Object.defineProperties(yr.prototype,{glowFactor:{get:function(){return this._glowFactor},set:function(e){e=Math.max(e,0),this._glowFactor=e,this._glowFactorDirty=!0}}});let yo=new L.Z,ya=new L.Z,ys=new eH.Z,yl=new eH.Z;function yc(e){return(0,m.Z)(`Assets/Textures/SkyBox/tycho2t3_80_${e}.jpg`)}function yu(e){let t=e._useBrowserRecommendedResolution?1:window.devicePixelRatio;return t*=e._resolutionScale,(0,y.Z)(e._scene)&&(e._scene.pixelRatio=t),t}function yh(e){let t=e._canvas,i=t.clientWidth,n=t.clientHeight,r=yu(e);e._canvasClientWidth=i,e._canvasClientHeight=n,i*=r,n*=r,t.width=i,t.height=n,e._canRender=0!==i&&0!==n,e._lastDevicePixelRatio=window.devicePixelRatio}function yd(e){let t=e._canvas,i=t.width,n=t.height;if(0!==i&&0!==n){let t=e._scene.camera.frustum;(0,y.Z)(t.aspectRatio)?t.aspectRatio=i/n:(t.top=t.right*(n/i),t.bottom=-t.top)}}function yf(e,t){if(!(0,y.Z)(e))throw new v.Z("container is required.");e=w(e),t=(0,Z.Z)(t,Z.Z.EMPTY_OBJECT);let i=document.createElement("div");i.className="cesium-widget",e.appendChild(i);let n=document.createElement("canvas"),r=E.Z.supportsImageRenderingPixelated();function o(){n!==n.ownerDocument.activeElement&&n.ownerDocument.activeElement.blur()}this._supportsImageRenderingPixelated=r,r&&(n.style.imageRendering=E.Z.imageRenderingValue()),n.oncontextmenu=function(){return!1},n.onselectstart=function(){return!1},(0,Z.Z)(t.blurActiveElementOnCanvasFocus,!0)&&(n.addEventListener("mousedown",o),n.addEventListener("pointerdown",o)),i.appendChild(n);let a=document.createElement("div");a.className="cesium-widget-credits";let s=(0,y.Z)(t.creditContainer)?w(t.creditContainer):i;s.appendChild(a);let l=(0,y.Z)(t.creditViewport)?w(t.creditViewport):i,c=(0,Z.Z)(t.showRenderLoopErrors,!0),u=(0,Z.Z)(t.useBrowserRecommendedResolution,!0);this._element=i,this._container=e,this._canvas=n,this._canvasClientWidth=0,this._canvasClientHeight=0,this._lastDevicePixelRatio=0,this._creditViewport=l,this._creditContainer=s,this._innerCreditContainer=a,this._canRender=!1,this._renderLoopRunning=!1,this._showRenderLoopErrors=c,this._resolutionScale=1,this._useBrowserRecommendedResolution=u,this._forceResize=!1,this._clock=(0,y.Z)(t.clock)?t.clock:new g.Z,yh(this);try{let e=new Zg({canvas:n,contextOptions:t.contextOptions,creditContainer:a,creditViewport:l,mapProjection:t.mapProjection,orderIndependentTranslucency:t.orderIndependentTranslucency,scene3DOnly:(0,Z.Z)(t.scene3DOnly,!1),shadows:t.shadows,mapMode2D:t.mapMode2D,requestRenderMode:t.requestRenderMode,maximumRenderTimeChange:t.maximumRenderTimeChange,depthPlaneEllipsoidOffset:t.depthPlaneEllipsoidOffset,msaaSamples:t.msaaSamples});this._scene=e,e.camera.constrainedAxis=_.Z.UNIT_Z,yu(this),yd(this);let i=(0,Z.Z)(e.mapProjection.ellipsoid,T.Z.WGS84),r=t.globe;(0,y.Z)(r)||(r=new rP(i)),!1!==r&&(e.globe=r,e.globe.shadows=(0,Z.Z)(t.terrainShadows,i4.Z.RECEIVE_ONLY));let o=t.skyBox;(0,y.Z)(o)||(o=new yn({sources:{positiveX:yc("px"),negativeX:yc("mx"),positiveY:yc("py"),negativeY:yc("my"),positiveZ:yc("pz"),negativeZ:yc("mz")}})),!1!==o&&(e.skyBox=o,e.sun=new yr,e.moon=new oI);let s=t.skyAtmosphere;(0,y.Z)(s)||((s=new ye(i)).show=!1!==t.globe&&r.show),!1!==s&&(e.skyAtmosphere=s);let c=t.baseLayer;if(!1!==t.globe&&!1!==c&&((0,y.Z)(c)||(c=iW.fromWorldImagery()),e.imageryLayers.add(c)),(0,y.Z)(t.terrainProvider)&&!1!==t.globe&&(e.terrainProvider=t.terrainProvider),(0,y.Z)(t.terrain)&&!1!==t.globe){if((0,y.Z)(t.terrainProvider))throw new v.Z("Specify either options.terrainProvider or options.terrain.");e.setTerrain(t.terrain)}this._screenSpaceEventHandler=new d7.Z(n),(0,y.Z)(t.sceneMode)&&(t.sceneMode===eB.Z.SCENE2D&&this._scene.morphTo2D(0),t.sceneMode===eB.Z.COLUMBUS_VIEW&&this._scene.morphToColumbusView(0)),this._useDefaultRenderLoop=void 0,this.useDefaultRenderLoop=(0,Z.Z)(t.useDefaultRenderLoop,!0),this._targetFrameRate=void 0,this.targetFrameRate=t.targetFrameRate;let u=this;this._onRenderError=function(e,t){u._useDefaultRenderLoop=!1,u._renderLoopRunning=!1,u._showRenderLoopErrors&&u.showErrorPanel("An error occurred while rendering. Rendering has stopped.",void 0,t)},e.renderError.addEventListener(this._onRenderError)}catch(e){throw c&&this.showErrorPanel("Error constructing CesiumWidget.",'Visit <a href="http://get.webgl.org">http://get.webgl.org</a> to verify that your web browser and hardware support WebGL. Consider trying a different web browser or updating your video drivers. Detailed error information is below:',e),e}}yr.prototype.update=function(e,t,i){if(!this.show)return;let n=e.mode;if(n===eB.Z.SCENE2D||n===eB.Z.MORPHING||!e.passes.render)return;let r=e.context,o=t.viewport.width,a=t.viewport.height;if(!(0,y.Z)(this._texture)||o!==this._drawingBufferWidth||a!==this._drawingBufferHeight||this._glowFactorDirty||i!==this._useHdr){this._texture=this._texture&&this._texture.destroy(),this._drawingBufferWidth=o,this._drawingBufferHeight=a,this._glowFactorDirty=!1,this._useHdr=i;let e=Math.max(o,a);e=Math.max(1,e=Math.pow(2,Math.ceil(Math.log(e)/Math.log(2))-2));let t=i?r.halfFloatingPointTexture?to.Z.HALF_FLOAT:to.Z.FLOAT:to.Z.UNSIGNED_BYTE;this._texture=new eP.Z({context:r,width:e,height:e,pixelFormat:te.Z.RGBA,pixelDatatype:t}),this._glowLengthTS=5*this._glowFactor,this._radiusTS=1/(1+2*this._glowLengthTS)*.5;let n=this;this._commands.computeCommand=new ik.Z({fragmentShaderSource:"uniform float u_radiusTS;\n\nin vec2 v_textureCoordinates;\n\nvec2 rotate(vec2 p, vec2 direction)\n{\n return vec2(p.x * direction.x - p.y * direction.y, p.x * direction.y + p.y * direction.x);\n}\n\nvec4 addBurst(vec2 position, vec2 direction, float lengthScalar)\n{\n vec2 rotatedPosition = rotate(position, direction) * vec2(25.0, 0.75);\n float radius = length(rotatedPosition) * lengthScalar;\n float burst = 1.0 - smoothstep(0.0, 0.55, radius);\n return vec4(burst);\n}\n\nvoid main()\n{\n float lengthScalar = 2.0 / sqrt(2.0);\n vec2 position = v_textureCoordinates - vec2(0.5);\n float radius = length(position) * lengthScalar;\n float surface = step(radius, u_radiusTS);\n vec4 color = vec4(vec2(1.0), surface + 0.2, surface);\n\n float glow = 1.0 - smoothstep(0.0, 0.55, radius);\n color.ba += mix(vec2(0.0), vec2(1.0), glow) * 0.75;\n\n vec4 burst = vec4(0.0);\n\n // The following loop has been manually unrolled for speed, to\n // avoid sin() and cos().\n //\n //for (float i = 0.4; i < 3.2; i += 1.047) {\n // vec2 direction = vec2(sin(i), cos(i));\n // burst += 0.4 * addBurst(position, direction, lengthScalar);\n //\n // direction = vec2(sin(i - 0.08), cos(i - 0.08));\n // burst += 0.3 * addBurst(position, direction, lengthScalar);\n //}\n\n burst += 0.4 * addBurst(position, vec2(0.38942, 0.92106), lengthScalar); // angle == 0.4\n burst += 0.4 * addBurst(position, vec2(0.99235, 0.12348), lengthScalar); // angle == 0.4 + 1.047\n burst += 0.4 * addBurst(position, vec2(0.60327, -0.79754), lengthScalar); // angle == 0.4 + 1.047 * 2.0\n\n burst += 0.3 * addBurst(position, vec2(0.31457, 0.94924), lengthScalar); // angle == 0.4 - 0.08\n burst += 0.3 * addBurst(position, vec2(0.97931, 0.20239), lengthScalar); // angle == 0.4 + 1.047 - 0.08\n burst += 0.3 * addBurst(position, vec2(0.66507, -0.74678), lengthScalar); // angle == 0.4 + 1.047 * 2.0 - 0.08\n\n // End of manual loop unrolling.\n\n color += clamp(burst, vec4(0.0), vec4(1.0)) * 0.15;\n\n out_FragColor = clamp(color, vec4(0.0), vec4(1.0));\n}\n",outputTexture:this._texture,uniformMap:{u_radiusTS:function(){return n._radiusTS}},persists:!1,owner:this,postExecute:function(){n._commands.computeCommand=void 0}})}let s=this._drawCommand;if(!(0,y.Z)(s.vertexArray)){let e={direction:0},t=new Uint8Array(8);t[0]=0,t[1]=0,t[2]=255,t[3]=0,t[4]=255,t[5]=255,t[6]=0,t[7]=255;let i=e0.Z.createVertexBuffer({context:r,typedArray:t,usage:e1.Z.STATIC_DRAW}),n=[{index:e.direction,vertexBuffer:i,componentsPerAttribute:2,normalize:!0,componentDatatype:V.Z.UNSIGNED_BYTE}],o=e0.Z.createIndexBuffer({context:r,typedArray:new Uint16Array([0,1,2,0,2,3]),usage:e1.Z.STATIC_DRAW,indexDatatype:eh.Z.UNSIGNED_SHORT});s.vertexArray=new e9.Z({context:r,attributes:n,indexBuffer:o}),s.shaderProgram=eL.Z.fromCache({context:r,vertexShaderSource:"in vec2 direction;\n\nuniform float u_size;\n\nout vec2 v_textureCoordinates;\n\nvoid main() \n{\n vec4 position;\n if (czm_morphTime == 1.0)\n {\n position = vec4(czm_sunPositionWC, 1.0);\n }\n else\n {\n position = vec4(czm_sunPositionColumbusView.zxy, 1.0);\n }\n \n vec4 positionEC = czm_view * position;\n vec4 positionWC = czm_eyeToWindowCoordinates(positionEC);\n \n vec2 halfSize = vec2(u_size * 0.5);\n halfSize *= ((direction * 2.0) - 1.0);\n \n gl_Position = czm_viewportOrthographic * vec4(positionWC.xy + halfSize, -positionWC.z, 1.0);\n \n v_textureCoordinates = direction;\n}\n",fragmentShaderSource:"uniform sampler2D u_texture;\n\nin vec2 v_textureCoordinates;\n\nvoid main()\n{\n vec4 color = texture(u_texture, v_textureCoordinates);\n out_FragColor = czm_gammaCorrect(color);\n}\n",attributeLocations:e}),s.renderState=e5.Z.fromCache({blending:e8.Z.ALPHA_BLEND}),s.uniformMap=this._uniformMap}let l=r.uniformState.sunPositionWC,c=r.uniformState.sunPositionColumbusView,u=this._boundingVolume,h=this._boundingVolume2D;_.Z.clone(l,u.center),h.center.x=c.z,h.center.y=c.x,h.center.z=c.y,u.radius=F.Z.SOLAR_RADIUS+F.Z.SOLAR_RADIUS*this._glowLengthTS,h.radius=u.radius,n===eB.Z.SCENE3D?S.Z.clone(u,s.boundingVolume):n===eB.Z.COLUMBUS_VIEW&&S.Z.clone(h,s.boundingVolume);let d=u7.Z.computeActualWgs84Position(e,l,yl),f=_.Z.magnitude(_.Z.subtract(d,e.camera.position,yl)),p=r.uniformState.projection;ys.x=0,ys.y=0,ys.z=-f,ys.w=1;let m=z.Z.multiplyByVector(p,ys,yl),g=u7.Z.clipToGLWindowCoordinates(t.viewport,m,yo);ys.x=F.Z.SOLAR_RADIUS;let Z=z.Z.multiplyByVector(p,ys,yl),b=u7.Z.clipToGLWindowCoordinates(t.viewport,Z,ya);return this._size=L.Z.magnitude(L.Z.subtract(b,g,yl)),this._size=2*this._size*(1+2*this._glowLengthTS),this._size=Math.ceil(this._size),this._commands},yr.prototype.isDestroyed=function(){return!1},yr.prototype.destroy=function(){let e=this._drawCommand;return e.vertexArray=e.vertexArray&&e.vertexArray.destroy(),e.shaderProgram=e.shaderProgram&&e.shaderProgram.destroy(),this._texture=this._texture&&this._texture.destroy(),(0,b.Z)(this)},Object.defineProperties(yf.prototype,{container:{get:function(){return this._container}},canvas:{get:function(){return this._canvas}},creditContainer:{get:function(){return this._creditContainer}},creditViewport:{get:function(){return this._creditViewport}},scene:{get:function(){return this._scene}},imageryLayers:{get:function(){return this._scene.imageryLayers}},terrainProvider:{get:function(){return this._scene.terrainProvider},set:function(e){this._scene.terrainProvider=e}},creditDisplay:{get:function(){return this._scene.frameState.creditDisplay}},camera:{get:function(){return this._scene.camera}},clock:{get:function(){return this._clock}},screenSpaceEventHandler:{get:function(){return this._screenSpaceEventHandler}},targetFrameRate:{get:function(){return this._targetFrameRate},set:function(e){if(e<=0)throw new v.Z("targetFrameRate must be greater than 0, or undefined.");this._targetFrameRate=e}},useDefaultRenderLoop:{get:function(){return this._useDefaultRenderLoop},set:function(e){if(this._useDefaultRenderLoop!==e&&(this._useDefaultRenderLoop=e,e&&!this._renderLoopRunning)){var t;let e;t=this,t._renderLoopRunning=!0,e=0,requestAnimationFrame(function i(n){if(!t.isDestroyed()){if(t._useDefaultRenderLoop)try{let r=t._targetFrameRate;if((0,y.Z)(r)){let o=1e3/r,a=n-e;a>o&&(t.resize(),t.render(),e=n-a%o),requestAnimationFrame(i)}else t.resize(),t.render(),requestAnimationFrame(i)}catch(e){t._useDefaultRenderLoop=!1,t._renderLoopRunning=!1,t._showRenderLoopErrors&&t.showErrorPanel("An error occurred while rendering. Rendering has stopped.",void 0,e)}else t._renderLoopRunning=!1}})}}},resolutionScale:{get:function(){return this._resolutionScale},set:function(e){if(e<=0)throw new v.Z("resolutionScale must be greater than 0.");this._resolutionScale!==e&&(this._resolutionScale=e,this._forceResize=!0)}},useBrowserRecommendedResolution:{get:function(){return this._useBrowserRecommendedResolution},set:function(e){this._useBrowserRecommendedResolution!==e&&(this._useBrowserRecommendedResolution=e,this._forceResize=!0)}}}),yf.prototype.showErrorPanel=function(e,t,i){let n=this._element,r=document.createElement("div");r.className="cesium-widget-errorPanel";let o=document.createElement("div");o.className="cesium-widget-errorPanel-content",r.appendChild(o);let a=document.createElement("div");a.className="cesium-widget-errorPanel-header",a.appendChild(document.createTextNode(e)),o.appendChild(a);let s=document.createElement("div");function l(){s.style.maxHeight=`${Math.max(Math.round(.9*n.clientHeight-100),30)}px`}s.className="cesium-widget-errorPanel-scroll",o.appendChild(s),l(),(0,y.Z)(window.addEventListener)&&window.addEventListener("resize",l,!1);let c=(0,y.Z)(t),u=(0,y.Z)(i);if(c||u){let n=document.createElement("div");if(n.className="cesium-widget-errorPanel-message",s.appendChild(n),u){let n=x(i);c||("string"==typeof i&&(i=Error(i)),t=x({name:i.name,message:i.message}),n=i.stack),"undefined"!=typeof console&&console.error(`${e} ${t} ${n}`);let r=document.createElement("div");r.className="cesium-widget-errorPanel-message-details collapsed";let a=document.createElement("span");a.className="cesium-widget-errorPanel-more-details",a.appendChild(document.createTextNode("See more...")),r.appendChild(a),r.onclick=function(e){r.removeChild(a),r.appendChild(document.createTextNode(n)),r.className="cesium-widget-errorPanel-message-details",o.className="cesium-widget-errorPanel-content expanded",r.onclick=void 0},s.appendChild(r)}n.innerHTML=`<p>${t}</p>`}let h=document.createElement("div");h.className="cesium-widget-errorPanel-buttonPanel",o.appendChild(h);let d=document.createElement("button");d.setAttribute("type","button"),d.className="cesium-button",d.appendChild(document.createTextNode("OK")),d.onclick=function(){(0,y.Z)(l)&&(0,y.Z)(window.removeEventListener)&&window.removeEventListener("resize",l,!1),n.removeChild(r)},h.appendChild(d),n.appendChild(r)},yf.prototype.isDestroyed=function(){return!1},yf.prototype.destroy=function(){(0,y.Z)(this._scene)&&(this._scene.renderError.removeEventListener(this._onRenderError),this._scene=this._scene.destroy()),this._container.removeChild(this._element),this._creditContainer.removeChild(this._innerCreditContainer),(0,b.Z)(this)},yf.prototype.resize=function(){let e=this._canvas;(this._forceResize||this._canvasClientWidth!==e.clientWidth||this._canvasClientHeight!==e.clientHeight||this._lastDevicePixelRatio!==window.devicePixelRatio)&&(this._forceResize=!1,yh(this),yd(this),this._scene.requestRender())},yf.prototype.render=function(){if(this._canRender){this._scene.initializeFrame();let e=this._clock.tick();this._scene.render(e)}else this._clock.tick()};var yp=yf},8472:function(e,t,i){"use strict";let n,r,o,a;i.d(t,{Z:function(){return tr}});var s,l={};function c(e,t){return function(){return e.apply(t,arguments)}}i.r(l),i.d(l,{hasBrowserEnv:function(){return eh},hasStandardBrowserEnv:function(){return ed},hasStandardBrowserWebWorkerEnv:function(){return ef},origin:function(){return ep}});let{toString:u}=Object.prototype,{getPrototypeOf:h}=Object,d=(n=Object.create(null),e=>{let t=u.call(e);return n[t]||(n[t]=t.slice(8,-1).toLowerCase())}),f=e=>(e=e.toLowerCase(),t=>d(t)===e),p=e=>t=>typeof t===e,{isArray:m}=Array,_=p("undefined"),g=f("ArrayBuffer"),Z=p("string"),y=p("function"),b=p("number"),v=e=>null!==e&&"object"==typeof e,T=e=>{if("object"!==d(e))return!1;let t=h(e);return(null===t||t===Object.prototype||null===Object.getPrototypeOf(t))&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},E=f("Date"),x=f("File"),w=f("Blob"),S=f("FileList"),C=f("URLSearchParams"),[A,I,O,D]=["ReadableStream","Request","Response","Headers"].map(f);function P(e,t,{allOwnKeys:i=!1}={}){let n,r;if(null!=e){if("object"!=typeof e&&(e=[e]),m(e))for(n=0,r=e.length;n<r;n++)t.call(null,e[n],n,e);else{let r;let o=i?Object.getOwnPropertyNames(e):Object.keys(e),a=o.length;for(n=0;n<a;n++)r=o[n],t.call(null,e[r],r,e)}}}function R(e,t){let i;t=t.toLowerCase();let n=Object.keys(e),r=n.length;for(;r-- >0;)if(t===(i=n[r]).toLowerCase())return i;return null}let N="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,L=e=>!_(e)&&e!==N,M=(r="undefined"!=typeof Uint8Array&&h(Uint8Array),e=>r&&e instanceof r),F=f("HTMLFormElement"),z=(({hasOwnProperty:e})=>(t,i)=>e.call(t,i))(Object.prototype),B=f("RegExp"),U=(e,t)=>{let i=Object.getOwnPropertyDescriptors(e),n={};P(i,(i,r)=>{let o;!1!==(o=t(i,r,e))&&(n[r]=o||i)}),Object.defineProperties(e,n)},k="abcdefghijklmnopqrstuvwxyz",V="0123456789",H={DIGIT:V,ALPHA:k,ALPHA_DIGIT:k+k.toUpperCase()+V},G=f("AsyncFunction");var j={isArray:m,isArrayBuffer:g,isBuffer:function(e){return null!==e&&!_(e)&&null!==e.constructor&&!_(e.constructor)&&y(e.constructor.isBuffer)&&e.constructor.isBuffer(e)},isFormData:e=>{let t;return e&&("function"==typeof FormData&&e instanceof FormData||y(e.append)&&("formdata"===(t=d(e))||"object"===t&&y(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&g(e.buffer)},isString:Z,isNumber:b,isBoolean:e=>!0===e||!1===e,isObject:v,isPlainObject:T,isReadableStream:A,isRequest:I,isResponse:O,isHeaders:D,isUndefined:_,isDate:E,isFile:x,isBlob:w,isRegExp:B,isFunction:y,isStream:e=>v(e)&&y(e.pipe),isURLSearchParams:C,isTypedArray:M,isFileList:S,forEach:P,merge:function e(){let{caseless:t}=L(this)&&this||{},i={},n=(n,r)=>{let o=t&&R(i,r)||r;T(i[o])&&T(n)?i[o]=e(i[o],n):T(n)?i[o]=e({},n):m(n)?i[o]=n.slice():i[o]=n};for(let e=0,t=arguments.length;e<t;e++)arguments[e]&&P(arguments[e],n);return i},extend:(e,t,i,{allOwnKeys:n}={})=>(P(t,(t,n)=>{i&&y(t)?e[n]=c(t,i):e[n]=t},{allOwnKeys:n}),e),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,i,n)=>{e.prototype=Object.create(t.prototype,n),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),i&&Object.assign(e.prototype,i)},toFlatObject:(e,t,i,n)=>{let r,o,a;let s={};if(t=t||{},null==e)return t;do{for(o=(r=Object.getOwnPropertyNames(e)).length;o-- >0;)a=r[o],(!n||n(a,e,t))&&!s[a]&&(t[a]=e[a],s[a]=!0);e=!1!==i&&h(e)}while(e&&(!i||i(e,t))&&e!==Object.prototype);return t},kindOf:d,kindOfTest:f,endsWith:(e,t,i)=>{e=String(e),(void 0===i||i>e.length)&&(i=e.length),i-=t.length;let n=e.indexOf(t,i);return -1!==n&&n===i},toArray:e=>{if(!e)return null;if(m(e))return e;let t=e.length;if(!b(t))return null;let i=Array(t);for(;t-- >0;)i[t]=e[t];return i},forEachEntry:(e,t)=>{let i;let n=(e&&e[Symbol.iterator]).call(e);for(;(i=n.next())&&!i.done;){let n=i.value;t.call(e,n[0],n[1])}},matchAll:(e,t)=>{let i;let n=[];for(;null!==(i=e.exec(t));)n.push(i);return n},isHTMLForm:F,hasOwnProperty:z,hasOwnProp:z,reduceDescriptors:U,freezeMethods:e=>{U(e,(t,i)=>{if(y(e)&&-1!==["arguments","caller","callee"].indexOf(i))return!1;if(y(e[i])){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+i+"'")})}})},toObjectSet:(e,t)=>{let i={};return(e=>{e.forEach(e=>{i[e]=!0})})(m(e)?e:String(e).split(t)),i},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(e,t,i){return t.toUpperCase()+i}),noop:()=>{},toFiniteNumber:(e,t)=>null!=e&&Number.isFinite(e=+e)?e:t,findKey:R,global:N,isContextDefined:L,ALPHABET:H,generateString:(e=16,t=H.ALPHA_DIGIT)=>{let i="",{length:n}=t;for(;e--;)i+=t[Math.random()*n|0];return i},isSpecCompliantForm:function(e){return!!(e&&y(e.append)&&"FormData"===e[Symbol.toStringTag]&&e[Symbol.iterator])},toJSONObject:e=>{let t=Array(10),i=(e,n)=>{if(v(e)){if(t.indexOf(e)>=0)return;if(!("toJSON"in e)){t[n]=e;let r=m(e)?[]:{};return P(e,(e,t)=>{let o=i(e,n+1);_(o)||(r[t]=o)}),t[n]=void 0,r}}return e};return i(e,0)},isAsyncFn:G,isThenable:e=>e&&(v(e)||y(e))&&y(e.then)&&y(e.catch)};function W(e,t,i,n,r){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),i&&(this.config=i),n&&(this.request=n),r&&(this.response=r)}j.inherits(W,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:j.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});let q=W.prototype,Y={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{Y[e]={value:e}}),Object.defineProperties(W,Y),Object.defineProperty(q,"isAxiosError",{value:!0}),W.from=(e,t,i,n,r,o)=>{let a=Object.create(q);return j.toFlatObject(e,a,function(e){return e!==Error.prototype},e=>"isAxiosError"!==e),W.call(a,e.message,t,i,n,r),a.cause=e,a.name=e.name,o&&Object.assign(a,o),a};var X=i(6300).Buffer;function $(e){return j.isPlainObject(e)||j.isArray(e)}function K(e){return j.endsWith(e,"[]")?e.slice(0,-2):e}function Q(e,t,i){return e?e.concat(t).map(function(e,t){return e=K(e),!i&&t?"["+e+"]":e}).join(i?".":""):t}let J=j.toFlatObject(j,{},null,function(e){return/^is[A-Z]/.test(e)});var ee=function(e,t,i){if(!j.isObject(e))throw TypeError("target must be an object");t=t||new FormData;let n=(i=j.toFlatObject(i,{metaTokens:!0,dots:!1,indexes:!1},!1,function(e,t){return!j.isUndefined(t[e])})).metaTokens,r=i.visitor||c,o=i.dots,a=i.indexes,s=(i.Blob||"undefined"!=typeof Blob&&Blob)&&j.isSpecCompliantForm(t);if(!j.isFunction(r))throw TypeError("visitor must be a function");function l(e){if(null===e)return"";if(j.isDate(e))return e.toISOString();if(!s&&j.isBlob(e))throw new W("Blob is not supported. Use a Buffer instead.");return j.isArrayBuffer(e)||j.isTypedArray(e)?s&&"function"==typeof Blob?new Blob([e]):X.from(e):e}function c(e,i,r){let s=e;if(e&&!r&&"object"==typeof e){if(j.endsWith(i,"{}"))i=n?i:i.slice(0,-2),e=JSON.stringify(e);else{var c;if(j.isArray(e)&&(c=e,j.isArray(c)&&!c.some($))||(j.isFileList(e)||j.endsWith(i,"[]"))&&(s=j.toArray(e)))return i=K(i),s.forEach(function(e,n){j.isUndefined(e)||null===e||t.append(!0===a?Q([i],n,o):null===a?i:i+"[]",l(e))}),!1}}return!!$(e)||(t.append(Q(r,i,o),l(e)),!1)}let u=[],h=Object.assign(J,{defaultVisitor:c,convertValue:l,isVisitable:$});if(!j.isObject(e))throw TypeError("data must be an object");return!function e(i,n){if(!j.isUndefined(i)){if(-1!==u.indexOf(i))throw Error("Circular reference detected in "+n.join("."));u.push(i),j.forEach(i,function(i,o){!0===(!(j.isUndefined(i)||null===i)&&r.call(t,i,j.isString(o)?o.trim():o,n,h))&&e(i,n?n.concat(o):[o])}),u.pop()}}(e),t};function et(e){let t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(e){return t[e]})}function ei(e,t){this._pairs=[],e&&ee(e,this,t)}let en=ei.prototype;function er(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function eo(e,t,i){let n;if(!t)return e;let r=i&&i.encode||er,o=i&&i.serialize;if(n=o?o(t,i):j.isURLSearchParams(t)?t.toString():new ei(t,i).toString(r)){let t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+n}return e}en.append=function(e,t){this._pairs.push([e,t])},en.toString=function(e){let t=e?function(t){return e.call(this,t,et)}:et;return this._pairs.map(function(e){return t(e[0])+"="+t(e[1])},"").join("&")};class ea{constructor(){this.handlers=[]}use(e,t,i){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!i&&i.synchronous,runWhen:i?i.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){j.forEach(this.handlers,function(t){null!==t&&e(t)})}}var es={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},el="undefined"!=typeof URLSearchParams?URLSearchParams:ei,ec="undefined"!=typeof FormData?FormData:null,eu="undefined"!=typeof Blob?Blob:null;let eh="undefined"!=typeof window&&"undefined"!=typeof document,ed=(o="undefined"!=typeof navigator&&navigator.product,eh&&0>["ReactNative","NativeScript","NS"].indexOf(o)),ef="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,ep=eh&&window.location.href||"http://localhost";var em={...l,isBrowser:!0,classes:{URLSearchParams:el,FormData:ec,Blob:eu},protocols:["http","https","file","blob","url","data"]},e_=function(e){if(j.isFormData(e)&&j.isFunction(e.entries)){let t={};return j.forEachEntry(e,(e,i)=>{!function e(t,i,n,r){let o=t[r++];if("__proto__"===o)return!0;let a=Number.isFinite(+o),s=r>=t.length;return(o=!o&&j.isArray(n)?n.length:o,s)?j.hasOwnProp(n,o)?n[o]=[n[o],i]:n[o]=i:(n[o]&&j.isObject(n[o])||(n[o]=[]),e(t,i,n[o],r)&&j.isArray(n[o])&&(n[o]=function(e){let t,i;let n={},r=Object.keys(e),o=r.length;for(t=0;t<o;t++)n[i=r[t]]=e[i];return n}(n[o]))),!a}(j.matchAll(/\w+|\[(\w*)]/g,e).map(e=>"[]"===e[0]?"":e[1]||e[0]),i,t,0)}),t}return null};let eg={transitional:es,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){let i;let n=t.getContentType()||"",r=n.indexOf("application/json")>-1,o=j.isObject(e);if(o&&j.isHTMLForm(e)&&(e=new FormData(e)),j.isFormData(e))return r?JSON.stringify(e_(e)):e;if(j.isArrayBuffer(e)||j.isBuffer(e)||j.isStream(e)||j.isFile(e)||j.isBlob(e)||j.isReadableStream(e))return e;if(j.isArrayBufferView(e))return e.buffer;if(j.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();if(o){if(n.indexOf("application/x-www-form-urlencoded")>-1){var a,s;return(a=e,s=this.formSerializer,ee(a,new em.classes.URLSearchParams,Object.assign({visitor:function(e,t,i,n){return em.isNode&&j.isBuffer(e)?(this.append(t,e.toString("base64")),!1):n.defaultVisitor.apply(this,arguments)}},s))).toString()}if((i=j.isFileList(e))||n.indexOf("multipart/form-data")>-1){let t=this.env&&this.env.FormData;return ee(i?{"files[]":e}:e,t&&new t,this.formSerializer)}}return o||r?(t.setContentType("application/json",!1),function(e,t,i){if(j.isString(e))try{return(0,JSON.parse)(e),j.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(0,JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){let t=this.transitional||eg.transitional,i=t&&t.forcedJSONParsing,n="json"===this.responseType;if(j.isResponse(e)||j.isReadableStream(e))return e;if(e&&j.isString(e)&&(i&&!this.responseType||n)){let i=t&&t.silentJSONParsing;try{return JSON.parse(e)}catch(e){if(!i&&n){if("SyntaxError"===e.name)throw W.from(e,W.ERR_BAD_RESPONSE,this,null,this.response);throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:em.classes.FormData,Blob:em.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};j.forEach(["delete","get","head","post","put","patch"],e=>{eg.headers[e]={}});let eZ=j.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]);var ey=e=>{let t,i,n;let r={};return e&&e.split("\n").forEach(function(e){n=e.indexOf(":"),t=e.substring(0,n).trim().toLowerCase(),i=e.substring(n+1).trim(),!t||r[t]&&eZ[t]||("set-cookie"===t?r[t]?r[t].push(i):r[t]=[i]:r[t]=r[t]?r[t]+", "+i:i)}),r};let eb=Symbol("internals");function ev(e){return e&&String(e).trim().toLowerCase()}function eT(e){return!1===e||null==e?e:j.isArray(e)?e.map(eT):String(e)}let eE=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function ex(e,t,i,n,r){if(j.isFunction(n))return n.call(this,t,i);if(r&&(t=i),j.isString(t)){if(j.isString(n))return -1!==t.indexOf(n);if(j.isRegExp(n))return n.test(t)}}class ew{constructor(e){e&&this.set(e)}set(e,t,i){let n=this;function r(e,t,i){let r=ev(t);if(!r)throw Error("header name must be a non-empty string");let o=j.findKey(n,r);o&&void 0!==n[o]&&!0!==i&&(void 0!==i||!1===n[o])||(n[o||t]=eT(e))}let o=(e,t)=>j.forEach(e,(e,i)=>r(e,i,t));if(j.isPlainObject(e)||e instanceof this.constructor)o(e,t);else if(j.isString(e)&&(e=e.trim())&&!eE(e))o(ey(e),t);else if(j.isHeaders(e))for(let[t,n]of e.entries())r(n,t,i);else null!=e&&r(t,e,i);return this}get(e,t){if(e=ev(e)){let i=j.findKey(this,e);if(i){let e=this[i];if(!t)return e;if(!0===t)return function(e){let t;let i=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;for(;t=n.exec(e);)i[t[1]]=t[2];return i}(e);if(j.isFunction(t))return t.call(this,e,i);if(j.isRegExp(t))return t.exec(e);throw TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=ev(e)){let i=j.findKey(this,e);return!!(i&&void 0!==this[i]&&(!t||ex(this,this[i],i,t)))}return!1}delete(e,t){let i=this,n=!1;function r(e){if(e=ev(e)){let r=j.findKey(i,e);r&&(!t||ex(i,i[r],r,t))&&(delete i[r],n=!0)}}return j.isArray(e)?e.forEach(r):r(e),n}clear(e){let t=Object.keys(this),i=t.length,n=!1;for(;i--;){let r=t[i];(!e||ex(this,this[r],r,e,!0))&&(delete this[r],n=!0)}return n}normalize(e){let t=this,i={};return j.forEach(this,(n,r)=>{let o=j.findKey(i,r);if(o){t[o]=eT(n),delete t[r];return}let a=e?r.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,i)=>t.toUpperCase()+i):String(r).trim();a!==r&&delete t[r],t[a]=eT(n),i[a]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){let t=Object.create(null);return j.forEach(this,(i,n)=>{null!=i&&!1!==i&&(t[n]=e&&j.isArray(i)?i.join(", "):i)}),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,t])=>e+": "+t).join("\n")}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){let i=new this(e);return t.forEach(e=>i.set(e)),i}static accessor(e){let t=(this[eb]=this[eb]={accessors:{}}).accessors,i=this.prototype;function n(e){let n=ev(e);t[n]||(!function(e,t){let i=j.toCamelCase(" "+t);["get","set","has"].forEach(n=>{Object.defineProperty(e,n+i,{value:function(e,i,r){return this[n].call(this,t,e,i,r)},configurable:!0})})}(i,e),t[n]=!0)}return j.isArray(e)?e.forEach(n):n(e),this}}function eS(e,t){let i=this||eg,n=t||i,r=ew.from(n.headers),o=n.data;return j.forEach(e,function(e){o=e.call(i,o,r.normalize(),t?t.status:void 0)}),r.normalize(),o}function eC(e){return!!(e&&e.__CANCEL__)}function eA(e,t,i){W.call(this,null==e?"canceled":e,W.ERR_CANCELED,t,i),this.name="CanceledError"}function eI(e,t,i){let n=i.config.validateStatus;!i.status||!n||n(i.status)?e(i):t(new W("Request failed with status code "+i.status,[W.ERR_BAD_REQUEST,W.ERR_BAD_RESPONSE][Math.floor(i.status/100)-4],i.config,i.request,i))}ew.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),j.reduceDescriptors(ew.prototype,({value:e},t)=>{let i=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[i]=e}}}),j.freezeMethods(ew),j.inherits(eA,W,{__CANCEL__:!0});var eO=function(e,t){let i;let n=Array(e=e||10),r=Array(e),o=0,a=0;return t=void 0!==t?t:1e3,function(s){let l=Date.now(),c=r[a];i||(i=l),n[o]=s,r[o]=l;let u=a,h=0;for(;u!==o;)h+=n[u++],u%=e;if((o=(o+1)%e)===a&&(a=(a+1)%e),l-i<t)return;let d=c&&l-c;return d?Math.round(1e3*h/d):void 0}},eD=function(e,t){let i=0,n=1e3/t,r=null;return function(){let t=Date.now();if(this===!0||t-i>n)return r&&(clearTimeout(r),r=null),i=t,e.apply(null,arguments);r||(r=setTimeout(()=>(r=null,i=Date.now(),e.apply(null,arguments)),n-(t-i)))}},eP=(e,t,i=3)=>{let n=0,r=eO(50,250);return eD(i=>{let o=i.loaded,a=i.lengthComputable?i.total:void 0,s=o-n,l=r(s);n=o;let c={loaded:o,total:a,progress:a?o/a:void 0,bytes:s,rate:l||void 0,estimated:l&&a&&o<=a?(a-o)/l:void 0,event:i,lengthComputable:null!=a};c[t?"download":"upload"]=!0,e(c)},i)},eR=em.hasStandardBrowserEnv?function(){let e;let t=/(msie|trident)/i.test(navigator.userAgent),i=document.createElement("a");function n(e){let n=e;return t&&(i.setAttribute("href",n),n=i.href),i.setAttribute("href",n),{href:i.href,protocol:i.protocol?i.protocol.replace(/:$/,""):"",host:i.host,search:i.search?i.search.replace(/^\?/,""):"",hash:i.hash?i.hash.replace(/^#/,""):"",hostname:i.hostname,port:i.port,pathname:"/"===i.pathname.charAt(0)?i.pathname:"/"+i.pathname}}return e=n(window.location.href),function(t){let i=j.isString(t)?n(t):t;return i.protocol===e.protocol&&i.host===e.host}}():function(){return!0},eN=em.hasStandardBrowserEnv?{write(e,t,i,n,r,o){let a=[e+"="+encodeURIComponent(t)];j.isNumber(i)&&a.push("expires="+new Date(i).toGMTString()),j.isString(n)&&a.push("path="+n),j.isString(r)&&a.push("domain="+r),!0===o&&a.push("secure"),document.cookie=a.join("; ")},read(e){let t=document.cookie.match(RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read:()=>null,remove(){}};function eL(e,t){return e&&!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)?t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e:t}let eM=e=>e instanceof ew?{...e}:e;function eF(e,t){t=t||{};let i={};function n(e,t,i){return j.isPlainObject(e)&&j.isPlainObject(t)?j.merge.call({caseless:i},e,t):j.isPlainObject(t)?j.merge({},t):j.isArray(t)?t.slice():t}function r(e,t,i){return j.isUndefined(t)?j.isUndefined(e)?void 0:n(void 0,e,i):n(e,t,i)}function o(e,t){if(!j.isUndefined(t))return n(void 0,t)}function a(e,t){return j.isUndefined(t)?j.isUndefined(e)?void 0:n(void 0,e):n(void 0,t)}function s(i,r,o){return o in t?n(i,r):o in e?n(void 0,i):void 0}let l={url:o,method:o,data:o,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,withXSRFToken:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:s,headers:(e,t)=>r(eM(e),eM(t),!0)};return j.forEach(Object.keys(Object.assign({},e,t)),function(n){let o=l[n]||r,a=o(e[n],t[n],n);j.isUndefined(a)&&o!==s||(i[n]=a)}),i}var ez=e=>{let t;let i=eF({},e),{data:n,withXSRFToken:r,xsrfHeaderName:o,xsrfCookieName:a,headers:s,auth:l}=i;if(i.headers=s=ew.from(s),i.url=eo(eL(i.baseURL,i.url),e.params,e.paramsSerializer),l&&s.set("Authorization","Basic "+btoa((l.username||"")+":"+(l.password?unescape(encodeURIComponent(l.password)):""))),j.isFormData(n)){if(em.hasStandardBrowserEnv||em.hasStandardBrowserWebWorkerEnv)s.setContentType(void 0);else if(!1!==(t=s.getContentType())){let[e,...i]=t?t.split(";").map(e=>e.trim()).filter(Boolean):[];s.setContentType([e||"multipart/form-data",...i].join("; "))}}if(em.hasStandardBrowserEnv&&(r&&j.isFunction(r)&&(r=r(i)),r||!1!==r&&eR(i.url))){let e=o&&a&&eN.read(a);e&&s.set(o,e)}return i},eB="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise(function(t,i){let n;let r=ez(e),o=r.data,a=ew.from(r.headers).normalize(),{responseType:s}=r;function l(){r.cancelToken&&r.cancelToken.unsubscribe(n),r.signal&&r.signal.removeEventListener("abort",n)}let c=new XMLHttpRequest;function u(){if(!c)return;let n=ew.from("getAllResponseHeaders"in c&&c.getAllResponseHeaders());eI(function(e){t(e),l()},function(e){i(e),l()},{data:s&&"text"!==s&&"json"!==s?c.response:c.responseText,status:c.status,statusText:c.statusText,headers:n,config:e,request:c}),c=null}c.open(r.method.toUpperCase(),r.url,!0),c.timeout=r.timeout,"onloadend"in c?c.onloadend=u:c.onreadystatechange=function(){c&&4===c.readyState&&(0!==c.status||c.responseURL&&0===c.responseURL.indexOf("file:"))&&setTimeout(u)},c.onabort=function(){c&&(i(new W("Request aborted",W.ECONNABORTED,r,c)),c=null)},c.onerror=function(){i(new W("Network Error",W.ERR_NETWORK,r,c)),c=null},c.ontimeout=function(){let e=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded",t=r.transitional||es;r.timeoutErrorMessage&&(e=r.timeoutErrorMessage),i(new W(e,t.clarifyTimeoutError?W.ETIMEDOUT:W.ECONNABORTED,r,c)),c=null},void 0===o&&a.setContentType(null),"setRequestHeader"in c&&j.forEach(a.toJSON(),function(e,t){c.setRequestHeader(t,e)}),j.isUndefined(r.withCredentials)||(c.withCredentials=!!r.withCredentials),s&&"json"!==s&&(c.responseType=r.responseType),"function"==typeof r.onDownloadProgress&&c.addEventListener("progress",eP(r.onDownloadProgress,!0)),"function"==typeof r.onUploadProgress&&c.upload&&c.upload.addEventListener("progress",eP(r.onUploadProgress)),(r.cancelToken||r.signal)&&(n=t=>{c&&(i(!t||t.type?new eA(null,e,c):t),c.abort(),c=null)},r.cancelToken&&r.cancelToken.subscribe(n),r.signal&&(r.signal.aborted?n():r.signal.addEventListener("abort",n)));let h=function(e){let t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(r.url);if(h&&-1===em.protocols.indexOf(h)){i(new W("Unsupported protocol "+h+":",W.ERR_BAD_REQUEST,e));return}c.send(o||null)})},eU=(e,t)=>{let i,n=new AbortController,r=function(e){if(!i){i=!0,a();let t=e instanceof Error?e:this.reason;n.abort(t instanceof W?t:new eA(t instanceof Error?t.message:t))}},o=t&&setTimeout(()=>{r(new W(`timeout ${t} of ms exceeded`,W.ETIMEDOUT))},t),a=()=>{e&&(o&&clearTimeout(o),o=null,e.forEach(e=>{e&&(e.removeEventListener?e.removeEventListener("abort",r):e.unsubscribe(r))}),e=null)};e.forEach(e=>e&&e.addEventListener&&e.addEventListener("abort",r));let{signal:s}=n;return s.unsubscribe=a,[s,()=>{o&&clearTimeout(o),o=null}]};let ek=function*(e,t){let i,n=e.byteLength;if(!t||n<t){yield e;return}let r=0;for(;r<n;)i=r+t,yield e.slice(r,i),r=i},eV=async function*(e,t,i){for await(let n of e)yield*ek(ArrayBuffer.isView(n)?n:await i(String(n)),t)},eH=(e,t,i,n,r)=>{let o=eV(e,t,r),a=0;return new ReadableStream({type:"bytes",async pull(e){let{done:t,value:r}=await o.next();if(t){e.close(),n();return}let s=r.byteLength;i&&i(a+=s),e.enqueue(new Uint8Array(r))},cancel:e=>(n(e),o.return())},{highWaterMark:2})},eG=(e,t)=>{let i=null!=e;return n=>setTimeout(()=>t({lengthComputable:i,total:e,loaded:n}))},ej="function"==typeof fetch&&"function"==typeof Request&&"function"==typeof Response,eW=ej&&"function"==typeof ReadableStream,eq=ej&&("function"==typeof TextEncoder?(a=new TextEncoder,e=>a.encode(e)):async e=>new Uint8Array(await new Response(e).arrayBuffer())),eY=eW&&(()=>{let e=!1,t=new Request(em.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t})(),eX=eW&&!!(()=>{try{return j.isReadableStream(new Response("").body)}catch(e){}})(),e$={stream:eX&&(e=>e.body)};ej&&(s=new Response,["text","arrayBuffer","blob","formData","stream"].forEach(e=>{e$[e]||(e$[e]=j.isFunction(s[e])?t=>t[e]():(t,i)=>{throw new W(`Response type '${e}' is not supported`,W.ERR_NOT_SUPPORT,i)})}));let eK=async e=>null==e?0:j.isBlob(e)?e.size:j.isSpecCompliantForm(e)?(await new Request(e).arrayBuffer()).byteLength:j.isArrayBufferView(e)?e.byteLength:(j.isURLSearchParams(e)&&(e+=""),j.isString(e))?(await eq(e)).byteLength:void 0,eQ=async(e,t)=>{let i=j.toFiniteNumber(e.getContentLength());return null==i?eK(t):i},eJ={http:null,xhr:eB,fetch:ej&&(async e=>{let t,i,n,{url:r,method:o,data:a,signal:s,cancelToken:l,timeout:c,onDownloadProgress:u,onUploadProgress:h,responseType:d,headers:f,withCredentials:p="same-origin",fetchOptions:m}=ez(e);d=d?(d+"").toLowerCase():"text";let[_,g]=s||l||c?eU([s,l],c):[],Z=()=>{t||setTimeout(()=>{_&&_.unsubscribe()}),t=!0};try{if(h&&eY&&"get"!==o&&"head"!==o&&0!==(n=await eQ(f,a))){let e,t=new Request(r,{method:"POST",body:a,duplex:"half"});j.isFormData(a)&&(e=t.headers.get("content-type"))&&f.setContentType(e),t.body&&(a=eH(t.body,65536,eG(n,eP(h)),null,eq))}j.isString(p)||(p=p?"cors":"omit"),i=new Request(r,{...m,signal:_,method:o.toUpperCase(),headers:f.normalize().toJSON(),body:a,duplex:"half",withCredentials:p});let t=await fetch(i),s=eX&&("stream"===d||"response"===d);if(eX&&(u||s)){let e={};["status","statusText","headers"].forEach(i=>{e[i]=t[i]});let i=j.toFiniteNumber(t.headers.get("content-length"));t=new Response(eH(t.body,65536,u&&eG(i,eP(u,!0)),s&&Z,eq),e)}d=d||"text";let l=await e$[j.findKey(e$,d)||"text"](t,e);return s||Z(),g&&g(),await new Promise((n,r)=>{eI(n,r,{data:l,headers:ew.from(t.headers),status:t.status,statusText:t.statusText,config:e,request:i})})}catch(t){if(Z(),t&&"TypeError"===t.name&&/fetch/i.test(t.message))throw Object.assign(new W("Network Error",W.ERR_NETWORK,e,i),{cause:t.cause||t});throw W.from(t,t&&t.code,e,i)}})};j.forEach(eJ,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}});let e0=e=>`- ${e}`,e1=e=>j.isFunction(e)||null===e||!1===e;var e2=e=>{let t,i;let{length:n}=e=j.isArray(e)?e:[e],r={};for(let o=0;o<n;o++){let n;if(i=t=e[o],!e1(t)&&void 0===(i=eJ[(n=String(t)).toLowerCase()]))throw new W(`Unknown adapter '${n}'`);if(i)break;r[n||"#"+o]=i}if(!i){let e=Object.entries(r).map(([e,t])=>`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build"));throw new W("There is no suitable adapter to dispatch the request "+(n?e.length>1?"since :\n"+e.map(e0).join("\n"):" "+e0(e[0]):"as no adapter specified"),"ERR_NOT_SUPPORT")}return i};function e3(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new eA(null,e)}function e4(e){return e3(e),e.headers=ew.from(e.headers),e.data=eS.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1),e2(e.adapter||eg.adapter)(e).then(function(t){return e3(e),t.data=eS.call(e,e.transformResponse,t),t.headers=ew.from(t.headers),t},function(t){return!eC(t)&&(e3(e),t&&t.response&&(t.response.data=eS.call(e,e.transformResponse,t.response),t.response.headers=ew.from(t.response.headers))),Promise.reject(t)})}let e5="1.7.2",e9={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{e9[e]=function(i){return typeof i===e||"a"+(t<1?"n ":" ")+e}});let e8={};e9.transitional=function(e,t,i){function n(e,t){return"[Axios v"+e5+"] Transitional option '"+e+"'"+t+(i?". "+i:"")}return(i,r,o)=>{if(!1===e)throw new W(n(r," has been removed"+(t?" in "+t:"")),W.ERR_DEPRECATED);return t&&!e8[r]&&(e8[r]=!0,console.warn(n(r," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(i,r,o)}};var e6={assertOptions:function(e,t,i){if("object"!=typeof e)throw new W("options must be an object",W.ERR_BAD_OPTION_VALUE);let n=Object.keys(e),r=n.length;for(;r-- >0;){let o=n[r],a=t[o];if(a){let t=e[o],i=void 0===t||a(t,o,e);if(!0!==i)throw new W("option "+o+" must be "+i,W.ERR_BAD_OPTION_VALUE);continue}if(!0!==i)throw new W("Unknown option "+o,W.ERR_BAD_OPTION)}},validators:e9};let e7=e6.validators;class te{constructor(e){this.defaults=e,this.interceptors={request:new ea,response:new ea}}async request(e,t){try{return await this._request(e,t)}catch(e){if(e instanceof Error){let t;Error.captureStackTrace?Error.captureStackTrace(t={}):t=Error();let i=t.stack?t.stack.replace(/^.+\n/,""):"";try{e.stack?i&&!String(e.stack).endsWith(i.replace(/^.+\n.+\n/,""))&&(e.stack+="\n"+i):e.stack=i}catch(e){}}throw e}}_request(e,t){let i,n;"string"==typeof e?(t=t||{}).url=e:t=e||{};let{transitional:r,paramsSerializer:o,headers:a}=t=eF(this.defaults,t);void 0!==r&&e6.assertOptions(r,{silentJSONParsing:e7.transitional(e7.boolean),forcedJSONParsing:e7.transitional(e7.boolean),clarifyTimeoutError:e7.transitional(e7.boolean)},!1),null!=o&&(j.isFunction(o)?t.paramsSerializer={serialize:o}:e6.assertOptions(o,{encode:e7.function,serialize:e7.function},!0)),t.method=(t.method||this.defaults.method||"get").toLowerCase();let s=a&&j.merge(a.common,a[t.method]);a&&j.forEach(["delete","get","head","post","put","patch","common"],e=>{delete a[e]}),t.headers=ew.concat(s,a);let l=[],c=!0;this.interceptors.request.forEach(function(e){("function"!=typeof e.runWhen||!1!==e.runWhen(t))&&(c=c&&e.synchronous,l.unshift(e.fulfilled,e.rejected))});let u=[];this.interceptors.response.forEach(function(e){u.push(e.fulfilled,e.rejected)});let h=0;if(!c){let e=[e4.bind(this),void 0];for(e.unshift.apply(e,l),e.push.apply(e,u),n=e.length,i=Promise.resolve(t);h<n;)i=i.then(e[h++],e[h++]);return i}n=l.length;let d=t;for(h=0;h<n;){let e=l[h++],t=l[h++];try{d=e(d)}catch(e){t.call(this,e);break}}try{i=e4.call(this,d)}catch(e){return Promise.reject(e)}for(h=0,n=u.length;h<n;)i=i.then(u[h++],u[h++]);return i}getUri(e){return eo(eL((e=eF(this.defaults,e)).baseURL,e.url),e.params,e.paramsSerializer)}}j.forEach(["delete","get","head","options"],function(e){te.prototype[e]=function(t,i){return this.request(eF(i||{},{method:e,url:t,data:(i||{}).data}))}}),j.forEach(["post","put","patch"],function(e){function t(t){return function(i,n,r){return this.request(eF(r||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:i,data:n}))}}te.prototype[e]=t(),te.prototype[e+"Form"]=t(!0)});class tt{constructor(e){let t;if("function"!=typeof e)throw TypeError("executor must be a function.");this.promise=new Promise(function(e){t=e});let i=this;this.promise.then(e=>{if(!i._listeners)return;let t=i._listeners.length;for(;t-- >0;)i._listeners[t](e);i._listeners=null}),this.promise.then=e=>{let t;let n=new Promise(e=>{i.subscribe(e),t=e}).then(e);return n.cancel=function(){i.unsubscribe(t)},n},e(function(e,n,r){i.reason||(i.reason=new eA(e,n,r),t(i.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;let t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}static source(){let e;return{token:new tt(function(t){e=t}),cancel:e}}}let ti={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(ti).forEach(([e,t])=>{ti[t]=e});let tn=function e(t){let i=new te(t),n=c(te.prototype.request,i);return j.extend(n,te.prototype,i,{allOwnKeys:!0}),j.extend(n,i,null,{allOwnKeys:!0}),n.create=function(i){return e(eF(t,i))},n}(eg);tn.Axios=te,tn.CanceledError=eA,tn.CancelToken=tt,tn.isCancel=eC,tn.VERSION=e5,tn.toFormData=ee,tn.AxiosError=W,tn.Cancel=tn.CanceledError,tn.all=function(e){return Promise.all(e)},tn.spread=function(e){return function(t){return e.apply(null,t)}},tn.isAxiosError=function(e){return j.isObject(e)&&!0===e.isAxiosError},tn.mergeConfig=eF,tn.AxiosHeaders=ew,tn.formToJSON=e=>e_(j.isHTMLForm(e)?new FormData(e):e),tn.getAdapter=e2,tn.HttpStatusCode=ti,tn.default=tn;var tr=tn}}]);
Close