// All material copyright ESRI, All Rights Reserved, unless otherwise specified. // See https://js.arcgis.com/4.7/esri/copyright.txt for details. //>>built require({cache:{"esri/views/BreakpointsOwner":function(){define("require exports ../core/tsSupport/declareExtendsHelper ../core/tsSupport/decorateHelper ../core/tsSupport/assignHelper dojo/dom-class ../core/Accessor ../core/ArrayPool ../core/Handles ../core/watchUtils ../core/accessorSupport/decorators ./DOMContainer".split(" "),function(r,h,f,a,e,c,g,d,b,k,l,p){var n={widthBreakpoint:{getValue:function(a){var c=a.viewSize[0];a=a.breakpoints;var b=this.values;return c<=a.xsmall?b.xsmall:c<=a.small? b.small:c<=a.medium?b.medium:c<=a.large?b.large:b.xlarge},values:{xsmall:"xsmall",small:"small",medium:"medium",large:"large",xlarge:"xlarge"},valueToClassName:{xsmall:"esri-view-width-xsmall esri-view-width-less-than-small esri-view-width-less-than-medium esri-view-width-less-than-large esri-view-width-less-than-xlarge",small:"esri-view-width-small esri-view-width-greater-than-xsmall esri-view-width-less-than-medium esri-view-width-less-than-large esri-view-width-less-than-xlarge",medium:"esri-view-width-medium esri-view-width-greater-than-xsmall esri-view-width-greater-than-small esri-view-width-less-than-large esri-view-width-less-than-xlarge", large:"esri-view-width-large esri-view-width-greater-than-xsmall esri-view-width-greater-than-small esri-view-width-greater-than-medium esri-view-width-less-than-xlarge",xlarge:"esri-view-width-xlarge esri-view-width-greater-than-xsmall esri-view-width-greater-than-small esri-view-width-greater-than-medium esri-view-width-greater-than-large"}},heightBreakpoint:{getValue:function(a){var c=a.viewSize[1];a=a.breakpoints;var b=this.values;return c<=a.xsmall?b.xsmall:c<=a.small?b.small:c<=a.medium?b.medium: c<=a.large?b.large:b.xlarge},values:{xsmall:"xsmall",small:"small",medium:"medium",large:"large",xlarge:"xlarge"},valueToClassName:{xsmall:"esri-view-height-xsmall esri-view-height-less-than-small esri-view-height-less-than-medium esri-view-height-less-than-large esri-view-height-less-than-xlarge",small:"esri-view-height-small esri-view-height-greater-than-xsmall esri-view-height-less-than-medium esri-view-height-less-than-large esri-view-height-less-than-xlarge",medium:"esri-view-height-medium esri-view-height-greater-than-xsmall esri-view-height-greater-than-small esri-view-height-less-than-large esri-view-height-less-than-xlarge", large:"esri-view-height-large esri-view-height-greater-than-xsmall esri-view-height-greater-than-small esri-view-height-greater-than-medium esri-view-height-less-than-xlarge",xlarge:"esri-view-height-xlarge esri-view-height-greater-than-xsmall esri-view-height-greater-than-small esri-view-height-greater-than-medium esri-view-height-greater-than-large"}},orientation:{getValue:function(a){a=a.viewSize;var c=this.values;return a[1]>=a[0]?c.portrait:c.landscape},values:{portrait:"portrait",landscape:"landscape"}, valueToClassName:{portrait:"esri-view-orientation-portrait",landscape:"esri-view-orientation-landscape"}}},t={xsmall:544,small:768,medium:992,large:1200};return function(g){function q(){var a=null!==g&&g.apply(this,arguments)||this;a._breakpointsHandles=new b;a.breakpoints=t;a.orientation=null;a.widthBreakpoint=null;a.heightBreakpoint=null;return a}f(q,g);q.prototype.initialize=function(){this._breakpointsHandles.add([k.init(this,["breakpoints","size"],this._updateClassNames)])};q.prototype.destroy= function(){this.destroyed||(this._removeActiveClassNames(),this._breakpointsHandles.destroy(),this._breakpointsHandles=null)};q.prototype._updateClassNames=function(){if(this.container){var a=d.acquire(),c=d.acquire(),m=!1,b,g,e;for(b in n)g=this[b],e=n[b].getValue({viewSize:this.size,breakpoints:this.breakpoints}),g!==e&&(m=!0,this[b]=e,c.push(n[b].valueToClassName[g]),a.push(n[b].valueToClassName[e]));m&&(this._applyClassNameChanges(a,c),d.release(a),d.release(c))}};q.prototype._applyClassNameChanges= function(a,b){var m=this.container;m&&(c.remove(m,b),c.add(m,a))};q.prototype._removeActiveClassNames=function(){var a=this.container;if(a)for(var b in n)c.remove(a,n[b].valueToClassName[this[b]])};a([l.property({set:function(a){var b=this._get("breakpoints");if(a!==b){b=(b=a)&&b.xsmall=document.body.clientWidth||m>=document.body.clientHeight)}), "dom-size");this._set("container",a);this._startMeasuring();a=new t({enabled:!0,view:this});this._set("popupManager",a)}else this._set("width",0),this._set("height",0),this._set("position",null),this._set("suspended",!0),this._set("surface",null),this._set("container",null)}},enumerable:!0,configurable:!0});Object.defineProperty(m.prototype,"focused",{get:function(){return document.activeElement===this.surface},enumerable:!0,configurable:!0});Object.defineProperty(m.prototype,"size",{get:function(){return[this.width, this.height]},enumerable:!0,configurable:!0});m.prototype.blur=function(){this.surface&&this.surface.blur()};m.prototype.focus=function(){this.surface&&this.surface.focus()};m.prototype.pageToContainer=function(a,m,b){var c=this.position;a-=c[0];m-=c[1];b?(b[0]=a,b[1]=m):b=[a,m];return b};m.prototype.containerToPage=function(a,m,b){var c=this.position;a+=c[0];m+=c[1];b?(b[0]=a,b[1]=m):b=[a,m];return b};m.prototype._handleUIChange=function(a,m){m&&(this._domHandles.remove("ui"),m.destroy());a&&this._wireUI(a); this._set("ui",a)};m.prototype._wireUI=function(a){this._domHandles.remove("ui");a&&(a.view=this,this._domHandles.add([p.init(this,"root",function(m){a.container=m?c.create("div",null,m):null}),p.init(this,"popup",function(m,b){b&&(a.remove(b,"popup"),b!==m&&b.destroy());m&&(m.view=a.view,a.add(m,{key:"popup",position:"manual"}))})],"ui"))};m.prototype._focusEvent=function(a){this.notifyChange("focused");this.emit("focus",{native:a})};m.prototype._blurEvent=function(a){this.notifyChange("focused"); this.emit("blur",{native:a})};m.prototype._stopMeasuring=function(){this._domHandles.remove("measuring");this._get("resizing")&&this._set("resizing",!1)};m.prototype._startMeasuring=function(){var a=this,m=this._freqInfo;m.freq=16;m.time=750;this._domHandles.add([g(window,"resize",function(){m.freq=16;m.time=750}),l.addFrameTask({prepare:function(m){var b=a._measure(),c=a._freqInfo;c.time+=m.deltaTime;b&&(c.freq=16,a._get("resizing")||a._set("resizing",!0));c.timea.width-g.right||"left"===d&&c.x-b/2a.height-g.bottom?!0:!1};q.prototype._determineCurrentAlignment=function(){var a=this._pointerOffsetInPx,m=this._containerNode,b=this._mainContainerNode,d=this.viewModel,g=d.screenLocation,d=d.view;if(!g||!d||!m)return"top-center";if(!this._isScreenLocationWithinView(g, d))return this._get("currentAlignment")||"top-center";var e=b?window.getComputedStyle(b,null):null,b=e?parseInt(e.getPropertyValue("max-height").replace(/[^-\d\.]/g,""),10):0,e=e?parseInt(e.getPropertyValue("height").replace(/[^-\d\.]/g,""),10):0,k=c.getContentBox(m),m=k.w+a,k=Math.max(k.h,b,e)+a,a=this._isOutsideView({popupHeight:k,popupWidth:m,screenLocation:g,side:"right",view:d}),b=this._isOutsideView({popupHeight:k,popupWidth:m,screenLocation:g,side:"left",view:d}),e=this._isOutsideView({popupHeight:k, popupWidth:m,screenLocation:g,side:"top",view:d}),g=this._isOutsideView({popupHeight:k,popupWidth:m,screenLocation:g,side:"bottom",view:d});return b?e?"bottom-right":"top-right":a?e?"bottom-left":"top-left":e?g?"top-center":"bottom-center":"top-center"};q.prototype._getCurrentAlignment=function(){var a=this.alignment;return this.dockEnabled?null:"auto"===a?this._determineCurrentAlignment():"function"===typeof a?a.call(this):a};q.prototype._setCurrentAlignment=function(){this._set("currentAlignment", this._getCurrentAlignment())};q.prototype._setCurrentDockPosition=function(){this._set("currentDockPosition",this._getCurrentDockPosition())};q.prototype._getDockPosition=function(){var a=this.get("dockOptions.position");return"auto"===a?this._determineCurrentDockPosition():"function"===typeof a?a.call(this):a};q.prototype._getCurrentDockPosition=function(){return this.dockEnabled?this._getDockPosition():null};q.prototype._wouldDockTo=function(){return this.dockEnabled?null:this._getDockPosition()}; q.prototype._renderFeatureMenuItemNode=function(a,b,c,d){var e=b===c;d=(k={},k["esri-popup__feature-menu-item--selected"]=e,k);k=e?m.tsx("span",{key:B("feature-menu-selected-feature-"+c),title:g.selectedFeature,"aria-label":g.selectedFeature,class:"esri-icon-check-mark"}):null;a=m.tsx("span",{innerHTML:a.title||g.untitled});return m.tsx("li",{role:"menuitem",tabIndex:-1,key:B("feature-menu-feature-"+c),classes:d,class:"esri-popup__feature-menu-item",bind:this,"data-feature-index":b,onkeyup:this._handleFeatureMenuItemKeyup, onclick:this._selectFeature,onkeydown:this._selectFeature},m.tsx("span",{class:"esri-popup__feature-menu-title"},a,k));var k};q.prototype._renderFeatureMenuNode=function(a,b,c,d){var g=this;return 1g||c>g&&d<=g||a<=b&&m>b||a>b&&m<=b};q.prototype._updateDockEnabledForViewSize=function(a,m){if(a&&m){var b=this.get("viewModel.view.padding")||{left:0,right:0,top:0,bottom:0},c=b.left+b.right,d=b.top+b.bottom,b=[],g=[];b[0]=a[0]-c;b[1]=a[1]-d;g[0]=m[0]-c;g[1]=m[1]-d;a=this.dockOptions;this._dockingThresholdCrossed(b,g,a.breakpoint)&&this._setDockEnabledForViewSize(a);this._setCurrentDockPosition()}};q.prototype._focusDockButtonNode=function(a){this._focusDockButton&& (this._focusDockButton=!1,a.focus())};q.prototype._mainContainerNodeUpdated=function(a){this._mainContainerNode=a;this._focusContainer?(this._focusContainer=!1,a.focus()):this._blurContainer&&(this._blurContainer=!1,a.blur())};q.prototype._featureMenuNodeUpdated=function(a){(this._featureMenuNode=a)&&this._focusFirstFeature&&(this._focusFirstFeature=!1,a=a.querySelectorAll("li"),a.length&&a[0].focus())};q.prototype._focusFeatureMenuButtonNode=function(a){this._focusFeatureMenuButton&&(this._focusFeatureMenuButton= !1,a.focus())};q.prototype._featureMenuViewportNodeUpdated=function(a){a&&(a.scrollTop=0)};q.prototype._toggleScreenLocationEnabled=function(){var a=this.dockEnabled,m=this.viewModel;m&&(m.screenLocationEnabled=this.visible&&!a)};q.prototype._shouldDockAtCurrentViewSize=function(a){a=a.breakpoint;var m=this.get("viewModel.view.ui"),b=m.width,m=m.height;if(isNaN(b)||isNaN(m))return!1;b=a.hasOwnProperty("width")&&b<=a.width;a=a.hasOwnProperty("height")&&m<=a.height;return b||a};q.prototype._setDockEnabledForViewSize= function(a){a.breakpoint&&(this.dockEnabled=this._shouldDockAtCurrentViewSize(a))};q.prototype._getPageText=function(a,m){return k.substitute({index:m+1,total:a},g.pageText)};q.prototype._destroySpinner=function(){var a=this._spinner,m=this.view;a&&(m&&m.ui.remove(this._spinner,"popup-spinner"),a.destroy(),this._spinner=null)};q.prototype._createSpinner=function(a){a&&(this._spinner=new u({view:a}),a.ui.add(this._spinner,{key:"popup-spinner",position:"manual"}))};q.prototype._toggleCollapsed=function(){this.collapsed= !this.collapsed};q.prototype._close=function(){this.close();this.view&&this.view.focus()};q.prototype._toggleDockEnabled=function(){this.dockEnabled=!this.dockEnabled;this._focusDockButton=!0;this.scheduleRender()};q.prototype._toggleFeatureMenu=function(){var a=!this.featureMenuOpen;this._featureMenuOpenChanged(a);this.featureMenuOpen=a};q.prototype._triggerAction=function(a){this.viewModel.triggerAction(a.currentTarget["data-action-index"])};q.prototype._selectFeature=function(a){a=a.currentTarget["data-feature-index"]; isNaN(a)||(this.viewModel.selectedFeatureIndex=a)};q.prototype._next=function(){this.next()};q.prototype._previous=function(){this.previous()};a([n.aliasOf("viewModel.actions"),m.renderable()],q.prototype,"actions",void 0);a([n.property()],q.prototype,"alignment",void 0);a([n.aliasOf("viewModel.autoCloseEnabled")],q.prototype,"autoCloseEnabled",void 0);a([n.aliasOf("viewModel.content"),m.renderable()],q.prototype,"content",void 0);a([n.property(),m.renderable()],q.prototype,"collapsed",void 0);a([n.property(), m.renderable()],q.prototype,"collapseEnabled",void 0);a([n.property({readOnly:!0,dependsOn:["dockEnabled","alignment"]}),m.renderable()],q.prototype,"currentAlignment",null);a([n.property({readOnly:!0,dependsOn:["viewModel.view.ready","dockEnabled","dockOptions"]}),m.renderable()],q.prototype,"currentDockPosition",null);a([n.property(),m.renderable()],q.prototype,"dockOptions",null);a([n.property(),m.renderable()],q.prototype,"dockEnabled",void 0);a([n.aliasOf("viewModel.featureCount"),m.renderable()], q.prototype,"featureCount",void 0);a([n.property({dependsOn:["viewModel.visible"]}),m.renderable()],q.prototype,"featureMenuOpen",null);a([n.aliasOf("viewModel.features"),m.renderable()],q.prototype,"features",void 0);a([n.property(),m.renderable()],q.prototype,"featureNavigationEnabled",void 0);a([n.aliasOf("viewModel.highlightEnabled")],q.prototype,"highlightEnabled",void 0);a([n.aliasOf("viewModel.location"),m.renderable()],q.prototype,"location",void 0);a([n.property({readOnly:!0}),m.renderable()], q.prototype,"featureWidgets",void 0);a([n.aliasOf("viewModel.promises")],q.prototype,"promises",void 0);a([n.aliasOf("viewModel.selectedFeature"),m.renderable()],q.prototype,"selectedFeature",void 0);a([n.aliasOf("viewModel.selectedFeatureIndex"),m.renderable()],q.prototype,"selectedFeatureIndex",void 0);a([n.property({readOnly:!0}),m.renderable()],q.prototype,"selectedFeatureWidget",void 0);a([n.property()],q.prototype,"spinnerEnabled",void 0);a([n.aliasOf("viewModel.title"),m.renderable()],q.prototype, "title",void 0);a([n.aliasOf("viewModel.updateLocationEnabled")],q.prototype,"updateLocationEnabled",void 0);a([n.aliasOf("viewModel.view")],q.prototype,"view",void 0);a([n.property({type:v}),m.renderable("viewModel.screenLocation viewModel.screenLocationEnabled viewModel.state viewModel.pendingPromisesCount viewModel.promiseCount viewModel.waitingForResult".split(" ")),m.vmEvent(["triggerAction","trigger-action"])],q.prototype,"viewModel",void 0);a([n.aliasOf("viewModel.visible"),m.renderable()], q.prototype,"visible",void 0);a([n.aliasOf("viewModel.clear")],q.prototype,"clear",null);a([n.aliasOf("viewModel.next")],q.prototype,"next",null);a([n.aliasOf("viewModel.previous")],q.prototype,"previous",null);a([n.aliasOf("viewModel.triggerAction")],q.prototype,"triggerAction",null);a([m.accessibleHandler()],q.prototype,"_toggleCollapsed",null);a([m.accessibleHandler()],q.prototype,"_close",null);a([m.accessibleHandler()],q.prototype,"_toggleDockEnabled",null);a([m.accessibleHandler()],q.prototype, "_toggleFeatureMenu",null);a([m.accessibleHandler()],q.prototype,"_triggerAction",null);a([m.accessibleHandler()],q.prototype,"_selectFeature",null);a([m.accessibleHandler()],q.prototype,"_next",null);a([m.accessibleHandler()],q.prototype,"_previous",null);return q=a([n.subclass("esri.widgets.Popup")],q)}(n.declared(q))})},"esri/widgets/Feature":function(){define("require exports ../core/tsSupport/declareExtendsHelper ../core/tsSupport/decorateHelper dojo/i18n!./Feature/nls/Feature dojo/keys ../core/promiseUtils ../core/watchUtils ../core/accessorSupport/decorators ./Widget ./Feature/FeatureViewModel ./Feature/support/attachmentUtils ./support/uriUtils ./support/widget".split(" "), function(r,h,f,a,e,c,g,d,b,k,l,p,n,t){function u(a,b){return void 0===b?"esri-feature__"+a:"esri-feature__"+a+"-"+b}return function(k){function q(a){a=k.call(this)||this;a._chartMap=new Map;a._activeMediaMap=new Map;a._chartRequirePromise=null;a._refreshTimers=new Map;a._mediaInfo=new Map;a.contentEnabled=null;a.graphic=null;a.title=null;a.view=null;a.viewModel=new l;return a}f(q,k);q.prototype.postInitialize=function(){var a=this;this.own(d.init(this,"viewModel.content",function(){return a._setupMediaRefreshTimers()}))}; q.prototype.destroy=function(){this._clearMediaRefreshTimers();this._activeMediaMap.clear();this._activeMediaMap=null;this._cancelChartModules();this._destroyCharts()};q.prototype.render=function(){var a=t.tsx("div",{key:u("loading-container"),class:"esri-feature__loading-container"},t.tsx("span",{class:t.join("esri-icon-loading-indicator esri-rotating","esri-feature__loading-spinner")})),a=this.viewModel.waitingForContent?a:this._renderContent();return t.tsx("div",{class:"esri-feature"},t.tsx("div", {class:"esri-feature__size-container"},t.tsx("div",{class:"esri-feature__main-container"},a)))};q.prototype.goToMedia=function(a,m){this._setContentElementMedia(a,m)};q.prototype.nextMedia=function(a){this._pageContentElementMedia(a,"next")};q.prototype.previousMedia=function(a){this._pageContentElementMedia(a,"previous")};q.prototype._cancelChartModules=function(){this._chartRequirePromise&&this._chartRequirePromise.cancel()};q.prototype._destroyChart=function(a){var m=this._chartMap.get(a);m&&(m.chart.destroy(), m.tooltip.destroy());this._chartMap.delete(a)};q.prototype._destroyCharts=function(){this._chartMap.forEach(function(a){a.chart.destroy();a.tooltip.destroy()});this._chartMap.clear()};q.prototype._renderContent=function(){this._destroyCharts();var a=this.viewModel.content;if("string"===typeof a)return t.tsx("div",{key:u("content-string"),innerHTML:a});if(t.isWidget(a))return t.tsx("div",{key:u("content-widget")},a.render());if(a instanceof HTMLElement)return t.tsx("div",{key:u("content-html-element"), bind:a,afterCreate:this._attachToNode});if(t.isWidgetBase(a))return t.tsx("div",{key:u("content-dijit"),bind:a.domNode,afterCreate:this._attachToNode});if(Array.isArray(a))return a.length?t.tsx("div",{key:u("content-content-elements")},a.map(this._renderContentElement,this)):null};q.prototype._renderContentElement=function(a,m){switch(a.type){case "attachments":return this._renderAttachments(a,m);case "fields":return this._renderFields(a,m);case "media":return this._renderMedia(a,m);case "text":return this._renderText(a, m);default:return null}};q.prototype._renderAttachmentInfo=function(a){var m=a.attachmentInfo,b=a.supportsResizeAttachments,c=m.contentType;a=m.name;var d=m.url,g=b&&p.isSupportedImage(c),k=-1===d.indexOf("?")?"?":"\x26",c=g?""+d+k+"w\x3d48":p.getIconPath(c),g=(l={},l["esri-feature__attachment-item-mask--icon"]=!g,l),l=(f={},f["esri-feature__attachments-image--resizable"]=b,f);return t.tsx("li",{class:"esri-feature__attachments-item",key:m},t.tsx("a",{class:"esri-feature__attachments-item-link",href:d, target:"_blank"},t.tsx("div",{classes:g,class:"esri-feature__attachment-item-mask"},t.tsx("img",{alt:a,classes:l,class:"esri-feature__attachments-image",title:a,src:c}),t.tsx("span",{class:"esri-feature__attachments-image-overlay"},t.tsx("span",{"aria-hidden":"true",class:"esri-feature__attachments-link-icon esri-icon-link-external"}))),t.tsx("span",{class:"esri-feature__attachments-filename"},a||e.noTitle)));var l,f};q.prototype._renderAttachments=function(a,m){var b=this,c=a.displayType,d=(m=a.attachmentInfos)&& m.length,g=this.get("graphic.layer.capabilities.operations.supportsResizeAttachments"),c=(k={},k["esri-feature__attachments--list"]="preview"!==c,k["esri-feature__attachments--preview"]="preview"===c,k);return d?t.tsx("div",{key:u("attachments-element"),class:t.join("esri-feature__attachments","esri-feature__content-element"),classes:c},t.tsx("div",{class:"esri-feature__attachments-title"},e.attach),t.tsx("ul",{class:"esri-feature__attachments-items"},m.map(function(m,c){return b._renderAttachmentInfo({attachmentInfo:m, attachmentInfoIndex:c,supportsResizeAttachments:g,contentElement:a})}))):null;var k};q.prototype._forceLTR=function(a){return"\x26lrm;"+a};q.prototype._renderFieldInfo=function(a,m){var b=this.viewModel.formattedAttributes,c=b?b.content[m]||b.global:null,d=a.fieldName,b=a.label||d,c=c?null==c[d]?"":c[d]:"";a=!(!a.format||!a.format.dateFormat);c="number"!==typeof c||a?n.autoLink(c):this._forceLTR(c);a=(g={},g["esri-feature__field-data--date"]=a,g);return t.tsx("tr",{key:u("fields-element-info-row", m)},t.tsx("th",{key:u("fields-element-info-row-header",m),class:"esri-feature__field-header",innerHTML:b}),t.tsx("td",{key:u("fields-element-info-row-data",m),class:"esri-feature__field-data",classes:a,innerHTML:c}));var g};q.prototype._renderFields=function(a,m){var b=this;return(a=a.fieldInfos)?t.tsx("div",{key:u("fields-element",m),class:t.join("esri-feature__fields","esri-feature__content-element")},t.tsx("table",{class:"esri-table",summary:e.fieldsSummary,key:u("fields-element-table",m)},t.tsx("tbody", {key:u("fields-element-table-body",m)},a.map(function(a){return b._renderFieldInfo(a,m)})))):null};q.prototype._shouldOpenInNewTab=function(a){void 0===a&&(a="");return!/^(?:mailto:|tel:)/.test(a.trim().toLowerCase())};q.prototype._clearMediaRefreshTimers=function(){this._refreshTimers.forEach(function(a){return clearTimeout(a)});this._refreshTimers.clear()};q.prototype._clearMediaRefreshTimer=function(a){var m=this._refreshTimers.get(a);m&&(clearTimeout(m),this._refreshTimers.delete(a))};q.prototype._getImageSource= function(a,m){var b=-1!==a.indexOf("?")?"\x26":"?";a=a.split("#");var c=a[1],c=void 0===c?"":c;return""+a[0]+b+"timestamp\x3d"+m+(c?"#":"")+c};q.prototype._setupMediaRefreshTimer=function(a){var m=this.get("viewModel.content");if(Array.isArray(m)&&(m=m[a])&&"media"===m.type){var b=this._activeMediaMap.get(a);isNaN(b)&&(b=0);(m=m.mediaInfos[b])&&"image"===m.type&&m.refreshInterval&&this._setRefreshTimeout(a,m)}};q.prototype._setupMediaRefreshTimers=function(){var a=this;this._clearMediaRefreshTimers(); var m=this.get("viewModel.content");Array.isArray(m)&&m.forEach(function(m,b){return a._setupMediaRefreshTimer(b)})};q.prototype._updateMediaInfoTimestamp=function(a,m){var b=Date.now();this._mediaInfo.set(m,{timestamp:b,sourceURL:this._getImageSource(a,b)});this.scheduleRender()};q.prototype._setRefreshTimeout=function(a,m){var b=this,c=m.refreshInterval,d=m.value;c&&(m=6E4*c,this._updateMediaInfoTimestamp(d.sourceURL,a),m=setInterval(function(){b._updateMediaInfoTimestamp(d.sourceURL,a)},m),this._refreshTimers.set(a, m))};q.prototype._renderMediaInfoType=function(a,m){var b=a.value,c=a.title,c=void 0===c?"":c,d=a.type,g=a.refreshInterval,e=b.sourceURL,b=b.linkURL;if("image"===d)return a=this._shouldOpenInNewTab(b)?"_self":"_blank",e=(g=g?this._mediaInfo.get(m):null)?g.sourceURL:e,m=t.tsx("img",{alt:c,key:u("media-image-"+(g?g.timestamp:0),m),src:e}),(c=b?t.tsx("a",{title:c,href:b,target:a},m):null)?c:m;if(-1!==d.indexOf("chart"))return t.tsx("div",{key:u("chart",m),bind:this,"data-media-info":a,"data-content-element-index":m, class:"esri-feature__media-chart",afterCreate:this._getChartDependencies,afterUpdate:this._getChartDependencies})};q.prototype._getChartDependencies=function(a){var m=this,b=a["data-media-info"],c=a["data-content-element-index"],d=b.value,e=d.theme||"Claro",k=b.type,l=e;"string"===typeof e&&(l=e.replace(/\./g,"/"));this._cancelChartModules();this._chartRequirePromise=g.create(function(a){return r(["dojox/charting/Chart2D","dojox/charting/action2d/Tooltip","dojox/charting/themes/"+l],function(){for(var b= [],m=0;m\&]/gim,function(a){return"\x26#"+a.charCodeAt(0)+";"})}var C=p.getLogger("esri.widgets.FeatureViewModel"),A=/^\s*expression\//i,D=new b("cancelled-query","cancelled feature query"),E=d.getFormat("short-date-short-time"),F="DateFormat"+E;return function(b){function e(a){a=b.call(this)||this;a._handles=new k;a._featurePromise=void 0;a._layerDateFields= [];a.content=null;a.contentEnabled=!0;a.formattedAttributes=null;a.title="";a.view=null;return a}f(e,b);e.prototype.destroy=function(){this._clear();this._handles.destroy();this.graphic=this.view=this._handles=null};Object.defineProperty(e.prototype,"graphic",{get:function(){return this._get("graphic")||null},set:function(a){if(a){var b=v.getSourceLayer(a);this._layerDateFields=b?this._getDateFields(b):[]}this._set("graphic",a);this._graphicChanged(a)},enumerable:!0,configurable:!0});Object.defineProperty(e.prototype, "waitingForContent",{get:function(){var a=this._featurePromise;return a?!a.isFulfilled():!1},enumerable:!0,configurable:!0});e.prototype._clear=function(){this._cancelFeatureQuery();this._set("title","");this._set("content",null);this._set("formattedAttributes",null)};e.prototype._graphicChanged=function(a){var b=this,m=this._handles;m&&(m.remove("graphic"),this._clear(),a&&(m.add(t.watch(this,["graphic.popupTemplate.title","graphic.popupTemplate.content","graphic.popupTemplate.fieldInfos","contentEnabled"], function(){b._graphicChanged(b.graphic)}),"graphic"),this._featurePromise=this._queryFeature().then(function(){b.notifyChange("waitingForContent")}).catch(function(a){b.notifyChange("waitingForContent");a!==D&&C.log("error","error loading template",a);throw a;}),this.notifyChange("waitingForContent")))};e.prototype._cancelFeatureQuery=function(){var a=this._featurePromise;a&&!a.isFulfilled()&&a.cancel(D)};e.prototype._compileContent=function(a,b){var c=this;if(a&&(a.nodeName||a&&m.isWidgetBase(a)|| m.isWidget(a)))return a;if("string"===typeof a)return this._compileText({type:"text",text:a}).text;if(Array.isArray(a))return a.map(function(a,m){m=(m=b&&b[m])&&m.value;var d=a.type;if("attachments"===d)return c._compileAttachments(a,m);if("fields"===d)return c._compileFields(a);if("media"===d)return c._compileMedia(a);if("text"===d)return c._compileText(a)});a&&C.warn("invalid content type.")};e.prototype._compileFields=function(a){var b=this,m=this.graphic;a=l.clone(a);var c=m.get("popupTemplate.expressionInfos"), m=a.fieldInfos?void 0:m.get("popupTemplate.fieldInfos"),m=a.fieldInfos||l.clone(m),d=[];m&&m.forEach(function(a){var m=a.fieldName.toLowerCase();if(!a.hasOwnProperty("visible")||a.visible)m=b._isExpressionField(m)?b._getExpressionInfo(c,m):null,a.label=m?m.title:a.label,d.push(a)});a.fieldInfos=d;return a};e.prototype._setImageValue=function(a,b,m){var c=a.linkURL;a.sourceURL=l.substitute(b,this._fixTokens(a.sourceURL,m));a.sourceURL&&c&&(a.linkURL=(""+l.substitute(b,this._fixTokens(c,m))).trim())}; e.prototype._compileMedia=function(a){var b=this,m=this._layerDateFields,c=this.graphic;a=l.clone(a);var d=a.mediaInfos||[],e=c.attributes,g=v.getSourceLayer(c),k=this.formattedAttributes.global,f={dateFormat:{properties:m,formatter:F}};a.mediaInfos=d.map(function(a){if(a=l.clone(a)){var m=a.value,c=a.type,d=a.title?b._processFieldsInLinks(b._fixTokens(a.title,g),e):"",B=a.caption?b._processFieldsInLinks(b._fixTokens(a.caption,g),e):"";a.title=d?(""+l.substitute(k,d,f)).trim():"";a.caption=B?(""+ l.substitute(k,B,f)).trim():"";if("image"===c)return b._setImageValue(m,k,g),a;if("pie-chart"===c||"line-chart"===c||"column-chart"===c||"bar-chart"===c)return b._setChartValue(m,k,g),a}});return a};e.prototype._compileText=function(a){var b=this._layerDateFields,m=this.graphic;if((a=l.clone(a))&&a.text){var c=v.getSourceLayer(m),d=m.attributes,m=this.formattedAttributes.global,b={dateFormat:{properties:b,formatter:F}},c=this._processFieldsInLinks(this._fixTokens(a.text,c),d);a.text=(""+l.substitute(m, c,b)).trim()}return a};e.prototype._compileTitle=function(){var a=this._layerDateFields,b=this.graphic,m=b.get("popupTemplate.title"),c=b.attributes,d=v.getSourceLayer(b),a={dateFormat:{properties:a,formatter:F}},g=this.formattedAttributes.global;return"function"===typeof m?m.call(null,{graphic:b}):"string"===typeof m&&m?(b=this._processFieldsInLinks(this._fixTokens(m,d),c),(""+l.substitute(g,b,a)).trim()):""};e.prototype._getExpressionInfo=function(a,b){if(this._isExpressionField(b)){var m=b.replace(A, "").toLowerCase(),c;a.some(function(a){if(a.name.toLowerCase()===m)return c=a,!0});return c}};e.prototype._fixTokens=function(a,b){return a.replace(/(\{([^\{\r\n]+)\})/g,function(a,m,c){return(a=B(b,c))?"{"+a.name+"}":m})};e.prototype._encodeAttributes=function(a){var b=a?l.clone(a):{};Object.keys(b).forEach(function(a){var m=b[a];"string"===typeof m&&(m=encodeURIComponent(m).replace(/\'/g,"\x26apos;"),b[a]=m)});return b};e.prototype._formatAttributesToFieldInfos=function(a,b,m){var c=this,d=l.clone(this._layerDateFields); a.forEach(function(g){var e=c._getFixedFieldName(g.fieldName,b);g.fieldName=e;m[e]=c._formatValue(m[e],{fieldInfos:a,fieldName:e,layer:b});d&&g.format&&g.format.dateFormat&&(g=d.indexOf(e),-1a||!b?-1:(a+b)%b;this._set("selectedFeatureIndex",a)},enumerable:!0,configurable:!0});Object.defineProperty(m.prototype,"state",{get:function(){return this.get("view.ready")?"ready":"disabled"},enumerable:!0,configurable:!0}); m.prototype.centerAtLocation=function(){var a=this.location,m=this.view;return a&&m?m.goTo({target:a,scale:m.scale},this.goToOptions):b.reject(new g(this.declaredClass+"::Cannot center at location without a location and view."))};m.prototype.clear=function(){this.set({promises:[],features:[],content:null,title:null,location:null})};m.prototype.open=function(a){this.set(e({visible:!1},{updateLocationEnabled:!1,promises:[]},a));this._setVisibleWhenContentExists()};m.prototype.triggerAction=function(a){(a= this.actions.getItemAt(a))&&this.emit("trigger-action",{action:a})};m.prototype.next=function(){this.selectedFeatureIndex+=1;return this};m.prototype.previous=function(){--this.selectedFeatureIndex;return this};m.prototype.zoomToLocation=function(){var a=this,m=this.location,c=this.selectedFeature,d=this.view,e=this.zoomFactor;if(!m||!d)return b.reject(new g(this.declaredClass+"::Cannot zoom to location without a location and view."));var e=d.scale/e,k=this.get("selectedFeature.geometry"),l=c&&"3d"=== d.type,m=(l=k||l)?c:m,f=l&&k&&"point"===k.type&&this._isScreenSize(c);return d.goTo({target:m,scale:f?e:void 0},this.goToOptions).then(function(){f&&"point"===k.type&&(a.location=k)})};m.prototype._setVisibleWhenContentExists=function(){var a=this,b=this._handles,m=this.promiseCount;b.remove("pendingVisible");m?(m=k.init(this,"pendingPromisesCount",function(m){a.featureCount&&(a.set("visible",!0),b.remove("pendingVisible"));m||b.remove("pendingVisible")}),b.add(m,"pendingVisible")):this.set("visible", !0)};m.prototype._autoClose=function(){this.autoCloseEnabled&&(this.visible=!1)};m.prototype._isScreenSize=function(a){var b=this.view;if("3d"!==b.type||"esri.Graphic"!==a.declaredClass)return!0;if((b=b.getViewForGraphic(a))&&b.whenGraphicBounds){var m=!1;b.whenGraphicBounds(a,{useViewElevation:!0}).then(function(a){m=!a||!a.boundingBox||a.boundingBox[0]===a.boundingBox[3]&&a.boundingBox[1]===a.boundingBox[4]&&a.boundingBox[2]===a.boundingBox[5]});return m}return!0};m.prototype._getSelectedFeatureActions= function(){this._originalActions&&(this.actions=this._originalActions,this._originalActions=null);var a=this.actions.filter(function(a){return!a.temporary}),b=this.get("selectedFeature.popupTemplate");b&&b.overwriteActions&&(this._originalActions=a);this.actions=this._getNewActions(b,a)};m.prototype._getNewActions=function(a,b){if(!a||!a.actions)return b;var m=a.actions;m.forEach(function(a){a.temporary=!0});return a.overwriteActions?m:b.concat(m)};m.prototype._getPointFromGeometry=function(a){return a? "point"===a.type?a:"extent"===a.type?a.center:"polygon"===a.type?a.centroid:"multipoint"===a.type||"polyline"===a.type?a.extent.center:null:null};m.prototype._centerAtLocation=function(){var a=this.location,b=this.updateLocationEnabled,m=this.get("view.extent");b&&m&&a&&!m.contains(a)&&this.centerAtLocation()};m.prototype._highlightFeature=function(){this._handles.remove("highlight");var a=this.selectedFeature,b=this.highlightEnabled,m=this.view,c=this.visible;a&&m&&b&&c&&(b=a.layer)&&(m=q(b,m))&& "function"===typeof m.highlight&&(b=b.objectIdField,c=a.attributes,a=m.highlight(c&&c[b]||a,{}),this._handles.add(a,"highlight"))};m.prototype._updateFeatures=function(a,b){var m=this.features;a&&b&&b.length&&!(!this._validatePromise(a)||b instanceof g||b instanceof Error)&&(m.length?(a=b.filter(function(a){return-1===m.indexOf(a)}),this.features=m.concat(a)):this.features=b)};m.prototype._validatePromise=function(a){return a&&(!a.isCanceled||!a.isCanceled())};a([l.property({type:c.ofType(t)})],m.prototype, "actions",void 0);a([l.property()],m.prototype,"goToOptions",void 0);a([l.property()],m.prototype,"autoCloseEnabled",void 0);a([l.property()],m.prototype,"content",void 0);a([l.property({readOnly:!0,dependsOn:["features"]})],m.prototype,"featureCount",null);a([l.property()],m.prototype,"features",null);a([l.property()],m.prototype,"highlightEnabled",void 0);a([l.property({type:p})],m.prototype,"location",null);a([l.property({readOnly:!0,dependsOn:["promises"]})],m.prototype,"pendingPromisesCount", null);a([l.property({readOnly:!0,dependsOn:["featureCount","pendingPromisesCount"]})],m.prototype,"waitingForResult",null);a([l.property({readOnly:!0,dependsOn:["promises"]})],m.prototype,"promiseCount",null);a([l.property()],m.prototype,"promises",null);a([l.property({value:null,readOnly:!0,dependsOn:["features","selectedFeatureIndex","updateLocationEnabled"]})],m.prototype,"selectedFeature",null);a([l.property({value:-1})],m.prototype,"selectedFeatureIndex",null);a([l.property({readOnly:!0,dependsOn:["view.ready"]})], m.prototype,"state",null);a([l.property()],m.prototype,"title",void 0);a([l.property()],m.prototype,"updateLocationEnabled",void 0);a([l.property()],m.prototype,"view",void 0);a([l.property()],m.prototype,"visible",void 0);a([l.property()],m.prototype,"zoomFactor",void 0);a([l.property()],m.prototype,"centerAtLocation",null);a([l.property()],m.prototype,"clear",null);a([l.property()],m.prototype,"triggerAction",null);a([l.property()],m.prototype,"next",null);a([l.property()],m.prototype,"previous", null);a([l.property()],m.prototype,"zoomToLocation",null);return m=a([l.subclass("esri.widgets.Popup.PopupViewModel")],m)}(l.declared(u))})},"esri/views/3d/constraints/Constraints":function(){define("require exports ../../../core/tsSupport/declareExtendsHelper ../../../core/tsSupport/decorateHelper ../../../core/Accessor ../../../core/accessorSupport/decorators ./AltitudeConstraint ./ClipDistanceConstraint ./CollisionConstraint ./TiltConstraint".split(" "),function(r,h,f,a,e,c,g,d,b,k){Object.defineProperty(h, "__esModule",{value:!0});r=function(e){function l(){var a=null!==e&&e.apply(this,arguments)||this;a.tilt=new k.default;a.altitude=new g.default;a.clipDistance=new d.default;a.collision=new b.default;return a}f(l,e);a([c.property({type:k.default})],l.prototype,"tilt",void 0);a([c.property({type:g.default})],l.prototype,"altitude",void 0);a([c.property({type:d.default})],l.prototype,"clipDistance",void 0);a([c.property({type:b.default})],l.prototype,"collision",void 0);return l=a([c.subclass("esri.views.3d.constraints.Constraints")], l)}(c.declared(e));h.Constraints=r;h.default=r})},"esri/views/3d/constraints/AltitudeConstraint":function(){define("require exports ../../../core/tsSupport/declareExtendsHelper ../../../core/tsSupport/decorateHelper dojo/_base/kernel ../../../core/Accessor ../../../core/accessorSupport/decorators ../state/Constraints".split(" "),function(r,h,f,a,e,c,g,d){Object.defineProperty(h,"__esModule",{value:!0});r=function(b){function c(){var a=null!==b&&b.apply(this,arguments)||this;a.min=d.AltitudeDefault.min; a.max=d.AltitudeDefault.max;return a}f(c,b);Object.defineProperty(c.prototype,"mode",{get:function(){e.deprecated("esri.views.SceneView.constraints.altitude.mode is deprecated. The altitude constraint no longer applies to local scenes and does not have an automatic mode anymore.","","4.6");return"manual"},set:function(a){e.deprecated("esri.views.SceneView.constraints.altitude.mode is deprecated. The altitude constraint no longer applies to local scenes and does not have an automatic mode anymore.", "","4.6")},enumerable:!0,configurable:!0});a([g.property({type:Number})],c.prototype,"min",void 0);a([g.property({type:Number})],c.prototype,"max",void 0);return c=a([g.subclass("esri.views.3d.constraints.AltitudeConstraint")],c)}(g.declared(c));h.AltitudeConstraint=r;h.default=r})},"esri/views/3d/state/Constraints":function(){define("require exports ../../../core/tsSupport/declareExtendsHelper ../../../core/tsSupport/decorateHelper ../../../core/Accessor ../../../core/Logger ../../../core/accessorSupport/decorators ../support/earthUtils ../support/mathUtils".split(" "), function(r,h,f,a,e,c,g,d,b){Object.defineProperty(h,"__esModule",{value:!0});var k=c.getLogger("esri.views.3d.state.Constraints");r=function(c){function d(a){a=c.call(this)||this;a.collision=new p;a.distance=Infinity;a.minimumPoiDistance=4;return a}f(d,c);Object.defineProperty(d.prototype,"altitude",{get:function(){return"local"===this.mode?null:this._get("altitude")||null},set:function(a){"local"===this.mode?k.warn("Altitude constraint is ignored in local scenes"):this._set("altitude",a)},enumerable:!0, configurable:!0});d.prototype.clampAltitude=function(a){return this.altitude?b.clamp(a,this.altitude.min,this.altitude.max):a};d.prototype.clampTilt=function(a,c){if(!this.tilt)return c;a=this.tilt(a);return b.clamp(c,a.min,a.max)};d.prototype.clampDistance=function(a){return Math.min(a,this.distance)};d.prototype.createDefaultTilt=function(){return"local"===this.mode?this.createDefaultTiltLocal():this.createDefaultTiltGlobal()};d.prototype.createConstantMaxTilt=function(a){return function(b,c){void 0=== c&&(c=l);c.min=h.TiltDefault.min;c.max=a;return c}};d.prototype.createDefaultTiltLocal=function(){var a=b.makePiecewiseLinearFunction([[4E3,h.TiltDefault.max],[1E4,b.deg2rad(88)],[6E6,b.deg2rad(88)]]);return function(b,c){void 0===c&&(c=l);c.min=h.TiltDefault.min;c.max=a(b);return c}};d.prototype.createDefaultTiltGlobal=function(){var a=b.makePiecewiseLinearFunction([[4E3,h.TiltDefault.max],[5E4,b.deg2rad(88)],[6E6,b.deg2rad(88)],[2E7,h.TiltDefault.min]]);return function(b,c){void 0===c&&(c=l);c.min= h.TiltDefault.min;c.max=a(b);return c}};a([g.property()],d.prototype,"altitude",null);a([g.property({readOnly:!0})],d.prototype,"collision",void 0);a([g.property()],d.prototype,"distance",void 0);a([g.property({readOnly:!0})],d.prototype,"minimumPoiDistance",void 0);a([g.property()],d.prototype,"tilt",void 0);a([g.property({constructOnly:!0})],d.prototype,"mode",void 0);return d=a([g.subclass("esri.views.3d.state.Constraints")],d)}(g.declared(e));h.Constraints=r;h.AltitudeDefault={min:-d.earthRadius, max:4*d.earthRadius};h.TiltDefault={min:b.deg2rad(.5),max:b.deg2rad(179.5)};var l={min:0,max:0},p=function(b){function c(){var a=null!==b&&b.apply(this,arguments)||this;a.enabled=!0;a.elevationMargin=5;return a}f(c,b);a([g.property({type:Boolean})],c.prototype,"enabled",void 0);a([g.property({type:Number})],c.prototype,"elevationMargin",void 0);return c=a([g.subclass("esri.views.3d.state.Constraints.CollisionConstraint")],c)}(g.declared(e));h.default=r})},"esri/views/3d/constraints/ClipDistanceConstraint":function(){define("require exports ../../../core/tsSupport/declareExtendsHelper ../../../core/tsSupport/decorateHelper ../../../core/Accessor ../../../core/accessorSupport/decorators".split(" "), function(r,h,f,a,e,c){Object.defineProperty(h,"__esModule",{value:!0});r=function(e){function d(){var a=null!==e&&e.apply(this,arguments)||this;a.mode="auto";return a}f(d,e);Object.defineProperty(d.prototype,"near",{get:function(){return this._get("near")},set:function(a){this._set("near",a);a>=this._get("far")&&(this.far=a+1E-9);this.mode="manual"},enumerable:!0,configurable:!0});d.prototype.castNear=function(a){return Math.max(1E-8,a)};Object.defineProperty(d.prototype,"far",{get:function(){return this._get("far")}, set:function(a){this._set("far",a);a<=this._get("near")&&(this.near=a-1E-9);this.mode="manual"},enumerable:!0,configurable:!0});d.prototype.castFar=function(a){return Math.max(1E-8,a)};d.prototype.autoUpdate=function(a,c){"auto"===this.mode&&(this._get("near")!==a&&this._set("near",a),this._get("far")!==c&&this._set("far",c))};a([c.property({type:Number,value:1E-8})],d.prototype,"near",null);a([c.cast("near")],d.prototype,"castNear",null);a([c.property({type:Number,value:1E-8})],d.prototype,"far", null);a([c.cast("far")],d.prototype,"castFar",null);a([c.property({type:String})],d.prototype,"mode",void 0);return d=a([c.subclass("esri.views.3d.constraints.ClipDistanceConstraint")],d)}(c.declared(e));h.ClipDistanceConstraint=r;h.default=r})},"esri/views/3d/constraints/CollisionConstraint":function(){define("require exports ../../../core/tsSupport/declareExtendsHelper ../../../core/tsSupport/decorateHelper ../../../core/Accessor ../../../core/accessorSupport/decorators".split(" "),function(r,h, f,a,e,c){Object.defineProperty(h,"__esModule",{value:!0});r=function(e){function d(){var a=null!==e&&e.apply(this,arguments)||this;a.enabled=!0;return a}f(d,e);a([c.property()],d.prototype,"enabled",void 0);return d=a([c.subclass("esri.views.3d.constraints.CollisionConstraint")],d)}(c.declared(e));h.CollisionConstraint=r;h.default=r})},"esri/views/3d/constraints/TiltConstraint":function(){define("require exports ../../../core/tsSupport/declareExtendsHelper ../../../core/tsSupport/decorateHelper ../../../core/Accessor ../../../core/accessorSupport/decorators ../state/Constraints ../support/mathUtils".split(" "), function(r,h,f,a,e,c,g,d){Object.defineProperty(h,"__esModule",{value:!0});var b=d.rad2deg(g.TiltDefault.min),k=d.rad2deg(g.TiltDefault.max);r=function(e){function g(){var a=null!==e&&e.apply(this,arguments)||this;a.mode="auto";return a}f(g,e);Object.defineProperty(g.prototype,"max",{get:function(){return this._get("max")},set:function(a){this._set("max",a);this.mode="manual"},enumerable:!0,configurable:!0});g.prototype.castMax=function(a){return d.clamp(a,b,k)};g.prototype.autoUpdate=function(a){"auto"=== this.mode&&this._get("max")!==a&&this._set("max",a)};a([c.property({type:String})],g.prototype,"mode",void 0);a([c.property({type:Number,value:k})],g.prototype,"max",null);a([c.cast("max")],g.prototype,"castMax",null);return g=a([c.subclass("esri.views.3d.constraints.TiltConstraint")],g)}(c.declared(e));h.TiltConstraint=r;h.default=r})},"esri/views/3d/environment/SceneViewEnvironment":function(){define("require exports ../../../core/tsSupport/declareExtendsHelper ../../../core/tsSupport/decorateHelper ../../../core/accessorSupport/decorators ./SceneViewAtmosphere ./SceneViewLighting ../../../webscene/Environment ../../../webscene/Lighting".split(" "), function(r,h,f,a,e,c,g,d,b){Object.defineProperty(h,"__esModule",{value:!0});r=function(d){function k(){var a=null!==d&&d.apply(this,arguments)||this;a.atmosphere=new c.default;a.atmosphereEnabled=!0;a.starsEnabled=!0;return a}f(k,d);p=k;Object.defineProperty(k.prototype,"lighting",{set:function(a){if(a)if(this.lighting)null!=a.date&&(this.lighting.date=a.date),null!=a.defaultDate&&(this.lighting.defaultDate=a.defaultDate),null!=a.displayUTCOffset&&(this.lighting.displayUTCOffset=a.displayUTCOffset), this.lighting.directShadowsEnabled=a.directShadowsEnabled,null!=a.ambientOcclusionEnabled&&(this.lighting.ambientOcclusionEnabled=a.ambientOcclusionEnabled),null!=a.cameraTrackingEnabled&&(this.lighting.cameraTrackingEnabled=a.cameraTrackingEnabled);else if(a instanceof g.default)this._set("lighting",a);else if(a instanceof b){var c={directShadowsEnabled:a.directShadowsEnabled};null!=a.date&&(c.date=a.date);null!=a.displayUTCOffset&&(c.displayUTCOffset=a.displayUTCOffset);null!=a.defaultDate&&(c.defaultDate= a.defaultDate);this._set("lighting",new g.default(c))}else this._set("lighting",new g.default(a));else this.lighting||this._set("lighting",new g.default)},enumerable:!0,configurable:!0});k.prototype.clone=function(){return new p({lighting:this.lighting.clone(),atmosphere:this.atmosphere.clone(),atmosphereEnabled:this.atmosphereEnabled,starsEnabled:this.starsEnabled})};a([e.property({type:c.default,json:{read:!1}})],k.prototype,"atmosphere",void 0);a([e.property({type:Boolean,json:{read:!1}})],k.prototype, "atmosphereEnabled",void 0);a([e.property({type:Boolean,json:{read:!1}})],k.prototype,"starsEnabled",void 0);a([e.property()],k.prototype,"lighting",null);return k=p=a([e.subclass("esri.views.3d.environment.SceneViewEnvironment")],k);var p}(e.declared(d));h.SceneViewEnvironment=r;h.default=r})},"esri/views/3d/environment/SceneViewAtmosphere":function(){define("require exports ../../../core/tsSupport/declareExtendsHelper ../../../core/tsSupport/decorateHelper ../../../core/Accessor ../../../core/accessorSupport/decorators".split(" "), function(r,h,f,a,e,c){Object.defineProperty(h,"__esModule",{value:!0});r=function(e){function d(){return null!==e&&e.apply(this,arguments)||this}f(d,e);Object.defineProperty(d.prototype,"quality",{set:function(a){-1!==["low","high"].indexOf(a)&&this._set("quality",a)},enumerable:!0,configurable:!0});d.prototype.clone=function(){return new this.constructor({quality:this.quality})};a([c.property({type:String,value:"low"})],d.prototype,"quality",null);return d=a([c.subclass("esri.views.3d.environment.SceneViewAtmosphere")], d)}(c.declared(e));h.SceneViewAtmosphere=r;h.default=r})},"esri/views/3d/environment/SceneViewLighting":function(){define("require exports ../../../core/tsSupport/declareExtendsHelper ../../../core/tsSupport/decorateHelper ../../../core/Evented ../../../core/accessorSupport/decorators ../../../webscene/Lighting".split(" "),function(r,h,f,a,e,c,g){Object.defineProperty(h,"__esModule",{value:!0});r=function(e){function g(a){a=e.call(this)||this;a.positionTimezoneInfo={hours:0,minutes:0,seconds:0,autoUpdated:!0}; a.cameraTrackingEnabled=!0;a.ambientOcclusionEnabled=!1;var b=(new Date).getFullYear(),b=new Date("March 15, "+b+" 12:00:00 UTC");a._set("defaultDate",b);a._set("date",b);return a}f(g,e);Object.defineProperty(g.prototype,"defaultDate",{get:function(){return new Date(this._get("defaultDate").getTime())},set:function(a){var b=this._get("date")===this._get("defaultDate");a=new Date(a.getTime());this._set("defaultDate",a);b&&this._set("date",a)},enumerable:!0,configurable:!0});Object.defineProperty(g.prototype, "date",{set:function(a){null!=a&&(this._set("date",new Date(a.getTime())),this.positionTimezoneInfo.autoUpdated=!1,this._emitDateWillChange())},enumerable:!0,configurable:!0});g.prototype.autoUpdate=function(a,b){var c=this._calculateTimezoneOffset(this.positionTimezoneInfo);this.positionTimezoneInfo.hours=b.hours;this.positionTimezoneInfo.minutes=b.minutes;this.positionTimezoneInfo.seconds=b.seconds;b=null;null!=a&&(this.positionTimezoneInfo.autoUpdated=!0,b=this.date&&this.date.getTime(),this._set("date", new Date(a.getTime())),this._emitDateWillChange());var d=this._calculateTimezoneOffset(this.positionTimezoneInfo);c!==d&&(k.target=this,k.timezoneOffset=d,this.emit("timezone-will-change",k));if(null!=a)return b!==a.getTime()};g.prototype._calculateTimezoneOffset=function(a){return Math.round(a.hours+a.minutes/60+a.seconds/3600)};g.prototype._emitDateWillChange=function(){b.target=this;d.setTime(this._get("date").getTime());b.date=d;this.emit("date-will-change",b)};a([c.property({type:Boolean})], g.prototype,"cameraTrackingEnabled",void 0);a([c.property({type:Boolean})],g.prototype,"ambientOcclusionEnabled",void 0);a([c.property({type:Date})],g.prototype,"defaultDate",null);a([c.property({type:Date})],g.prototype,"date",null);return g=a([c.subclass("esri.views.3d.environment.SceneViewLighting")],g)}(c.declared(g,e));h.SceneViewLighting=r;var d=new Date,b={target:null,date:null},k={target:null,timezoneOffset:0};h.default=r})},"esri/webscene/Lighting":function(){define("require exports ../core/tsSupport/declareExtendsHelper ../core/tsSupport/decorateHelper ../core/JSONSupport ../core/accessorSupport/decorators".split(" "), function(r,h,f,a,e,c){return function(e){function d(a){a=e.call(this,a)||this;a.date=null;a.directShadowsEnabled=!1;a.displayUTCOffset=null;return a}f(d,e);b=d;d.prototype.readDate=function(a,b){return null!=b.datetime&&new Date(b.datetime)||null};d.prototype.writeDate=function(a,b,c){b[c]=a.getTime()};d.prototype.readDirectShadowsEnabled=function(a,b){return!!b.directShadows};d.prototype.writedirectShadowsEnabled=function(a,b,c){a&&(b[c]=a)};d.prototype.writeDisplayUTCOffset=function(a,b){null!= a&&(b.displayUTCOffset=a)};d.prototype.clone=function(){return new b({date:null!=this.date?new Date(this.date.getTime()):null,directShadowsEnabled:this.directShadowsEnabled,displayUTCOffset:null!=this.displayUTCOffset?this.displayUTCOffset:null})};d.sanitizeJSON=function(a){var b={datetime:a.datetime};void 0!==a.directShadows&&(b.directShadows=!!a.directShadows);void 0!==a.displayUTCOffset&&(b.displayUTCOffset=a.displayUTCOffset);return b};a([c.property({type:Date,json:{type:Number,write:{target:"datetime"}}})], d.prototype,"date",void 0);a([c.reader("date",["datetime"])],d.prototype,"readDate",null);a([c.writer("date")],d.prototype,"writeDate",null);a([c.property({type:Boolean,json:{write:{target:"directShadows"}}})],d.prototype,"directShadowsEnabled",void 0);a([c.reader("directShadowsEnabled",["directShadows"])],d.prototype,"readDirectShadowsEnabled",null);a([c.writer("directShadowsEnabled")],d.prototype,"writedirectShadowsEnabled",null);a([c.property({type:Number,json:{write:!0}})],d.prototype,"displayUTCOffset", void 0);a([c.writer("displayUTCOffset")],d.prototype,"writeDisplayUTCOffset",null);return d=b=a([c.subclass("esri.webscene.Lighting")],d);var b}(c.declared(e))})},"esri/webscene/Environment":function(){define("require exports ../core/tsSupport/declareExtendsHelper ../core/tsSupport/decorateHelper ../core/JSONSupport ../core/accessorSupport/decorators ./Lighting".split(" "),function(r,h,f,a,e,c,g){return function(d){function b(a){a=d.call(this,a)||this;a.lighting=new g;return a}f(b,d);e=b;b.prototype.clone= function(){return new e({lighting:g.prototype.clone.call(this.lighting)})};b.sanitizeJSON=function(a){return{lighting:a.lighting?g.sanitizeJSON(a.lighting):(new g).toJSON()}};a([c.property({type:g,json:{write:!0}})],b.prototype,"lighting",void 0);return b=e=a([c.subclass("esri.webscene.Environment")],b);var e}(c.declared(e))})},"esri/views/3d/environment/SceneViewEnvironmentManager":function(){define("require exports ../../../core/tsSupport/declareExtendsHelper ../../../core/tsSupport/decorateHelper ../../../core/Accessor ../../../core/Evented ../../../core/Handles ../../../core/promiseUtils ../../../core/watchUtils ../../../core/accessorSupport/decorators ../../../geometry/Point ../../../geometry/SpatialReference ../../../geometry/support/webMercatorUtils ./EnvironmentRenderer ../lib/glMatrix ../support/earthUtils ../support/sunUtils ../webgl-engine/lighting/Lightsources".split(" "), function(r,h,f,a,e,c,g,d,b,k,l,p,n,t,u,q,v,x){Object.defineProperty(h,"__esModule",{value:!0});var m=[.5773502691896258,-.5773502691896258,.5773502691896258];r=function(c){function e(a){a=c.call(this)||this;a.referencePointUpdateDelay=200;a.referencePointUpdateInterval=3E3;a.referencePointUpdateDistThreshold=1E6;a._referencePosUpdateQuery=null;a._referencePosMapCoordsRequested=null;a._viewHandles=new g;a._preserveAbsoluteDateTime=!1;a._trackingEnabled=!1;a._viewConnected=!1;a._referencePosResetPreserveAbsoluteTime= !1;a._referencePosUpdateTimer=null;a._referencePosWGS84=null;a._referencePosMapCoords=null;a._mainLight=new x.MainLight;a._ambientLight=new x.AmbientLight;a._moonLight=new x.FillLight;a._environmentRenderer=null;a._resetReferencePosition();return a}f(e,c);e.prototype.destroy=function(){this._viewHandles.destroy();this.disposeRendering()};Object.defineProperty(e.prototype,"updating",{get:function(){return!this.noReferencePositionQueries&&(!!this._referencePosUpdateQuery||!!this._referencePosMapCoordsRequested)}, enumerable:!0,configurable:!0});e.prototype.updateReadyChange=function(a){a&&!this._viewConnected?(this._viewConnected=!0,this.connectView(this.view)):!a&&this._viewConnected&&(this._viewConnected=!1,this.disconnectView(this.view))};e.prototype.disposeRendering=function(){this._environmentRenderer&&(this._environmentRenderer.destroy(),this._environmentRenderer=null);this._resetReferencePosition(!0)};e.prototype.connectView=function(a){this._environmentRenderer=new t({view:a});this._viewHandles.add([b.on(this.view, "environment.lighting","date-will-change",this._lightingDateHandler.bind(this)),this.view.watch("interacting,stationary",this._interactingStationaryHandler.bind(this)),this.view.watch("environment.lighting.directShadowsEnabled,environment.lighting.ambientOcclusionEnabled",this._updateRenderParamsHandler.bind(this)),this.view.watch("spatialReference",this._spatialReferenceHandler.bind(this)),b.init(this.view,"viewingMode",this._viewingModeHandler.bind(this)),b.init(this.view,"environment.lighting.cameraTrackingEnabled", this._updateCameraTracking.bind(this),!0),this.watch("noReferencePositionQueries",this._cameraHandler.bind(this,null))]);this._updateRenderParamsHandler();this._updateLightParams();this._cameraHandler()};e.prototype._updateCameraTracking=function(a){if(this._trackingEnabled=a)a=b.init(this,"view.state.camera",this._cameraHandler.bind(this,null),!0),this._viewHandles.add(a,"camera");else{if(a=this.get("view.environment.lighting"))a.positionTimezoneInfo.autoUpdated=!1;this._viewHandles.remove("camera")}}; e.prototype.disconnectView=function(a){this.disposeRendering();this._viewHandles.removeAll()};e.prototype._lightingDateHandler=function(a){if(a=a.date){var b=this.view.environment.lighting;if(!b.positionTimezoneInfo.autoUpdated){this._preserveAbsoluteDateTime=!0;var c=this.view.spatialReference;if(!(c.isWGS84||c.isWebMercator||(c=this.view.camera.position,this._referencePosMapCoords&&this._referencePosMapCoords.equals(c)))){this._requestReferencePositionUpdate(c);return}this._preupdateTracking(a); this._referencePosWGS84&&(c=q.positionToTimezone(this._referencePosWGS84,z),b.autoUpdate(null,c),this._trackingEnabled&&(b.positionTimezoneInfo.autoUpdated=!0))}this._updateLightParams(a)}};e.prototype._preupdateTracking=function(a){!this._trackingEnabled&&this.get("view.environment.lighting.cameraTrackingEnabled")&&this._cameraHandler(a)};e.prototype._cameraHandler=function(a){void 0===a&&(a=null);if(this.view.ready){var b=this.view.camera;if(b){var c=this.view.spatialReference;c.isWGS84||c.isWebMercator? this._cameraHandlerGlobal(b,a):this._cameraHandlerLocal(b,a)}}};e.prototype._cameraHandlerGlobal=function(a,b){a=a.position;this._referencePosWGS84||(this._referencePosWGS84=new l({spatialReference:p.WGS84}));a.spatialReference.isWebMercator?n.webMercatorToGeographic(a,!1,this._referencePosWGS84):(this._referencePosWGS84.x=a.x,this._referencePosWGS84.y=a.y);this._referencePosWGS84.z=a.z;this._autoUpdateTimezone(a,b)||this._updateLightParams(b)};e.prototype._cameraHandlerLocal=function(a,b){a=a.position; (!this._referencePosMapCoords||this._referencePosMapCoordsRequested||this._exceedsReferencePosDistThreshold(a))&&this._requestReferencePositionUpdate(a,!0);this.view.mapCoordsHelper&&this._referencePosWGS84&&(this._referencePosWGS84.z=a.z*this.view.mapCoordsHelper.unitInMeters,this._referencePosChanged())};e.prototype._interactingStationaryHandler=function(){!this.view.interacting&&this.view.stationary&&this._executePendingReferencePositionUpdate()};e.prototype._updateLightParams=function(a){void 0=== a&&(a=null);var b=this.view.environment.lighting;a=a||b.date;var b=this.view._stage,c;this._referencePosWGS84?(c=v.computeColorAndIntensity(a,this._referencePosWGS84),v.computeDirection(a,this._referencePosWGS84,this.view.viewingMode,c.diffuse.direction)):c={diffuse:{color:[1,1,1],intensity:.55,direction:m},ambient:{color:[1,1,1],intensity:.55},noonFactor:.5,globalFactor:0};u.vec3d.scale(c.diffuse.color,c.diffuse.intensity*Math.PI,this._mainLight.intensity);u.vec3d.negate(c.diffuse.direction,this._mainLight.direction); u.vec3d.scale(c.ambient.color,c.ambient.intensity,this._ambientLight.intensity);u.vec3d.lerp(C,A,c.globalFactor,this._moonLight.intensity);u.vec3d.scale(this._moonLight.intensity,(1-.5*c.globalFactor)*(1-.4*c.noonFactor*(1-c.globalFactor)));u.vec3d.set(c.diffuse.direction,this._moonLight.direction);b.setLighting({lights:[this._mainLight,this._ambientLight,this._moonLight],globalFactor:c.globalFactor,groundLightingFactor:1-c.noonFactor});this._updateRenderParamsHandler()};e.prototype._autoUpdateTimezone= function(a,b){void 0===b&&(b=null);if(!this.view.get("environment.lighting.cameraTrackingEnabled"))return!1;var c=B;c.setTime((b||this.view.environment.lighting.date).getTime());a=q.positionToTimezone(a,z);var m=this.view.environment.lighting.positionTimezoneInfo;if(!m.autoUpdated)m=a;else if(m.hours===a.hours&&m.minutes===a.minutes&&m.seconds===a.seconds)return!1;var d=c.getUTCHours()-(a.hours-m.hours),e=c.getUTCMinutes()-(a.minutes-m.minutes),m=c.getUTCSeconds()-(a.seconds-m.seconds);c.setUTCHours(d); c.setUTCMinutes(e);c.setUTCSeconds(m);return b?!1:this.view.environment.lighting.autoUpdate(c,a)};e.prototype._updateRenderParamsHandler=function(){var a=this.view._stage,b=!0;this._referencePosWGS84&&(b=v.computeShadowsEnabled(this._referencePosWGS84,this.view.viewingMode));a&&a.setRenderParams({shadowMap:this.view.environment.lighting.directShadowsEnabled&&b,ssao:this.view.environment.lighting.ambientOcclusionEnabled})};e.prototype._spatialReferenceHandler=function(){this._resetReferencePosition()}; e.prototype._viewingModeHandler=function(){this._resetReferencePosition()};e.prototype._resetReferencePosition=function(a){void 0===a&&(a=!1);this._cancelReferencePosUpdates();this._referencePosWGS84=this._referencePosResetPreserveAbsoluteTime=this._referencePosMapCoordsRequested=this._referencePosMapCoords=null;a||this.notifyChange("updating")};e.prototype._requestReferencePositionUpdate=function(a,b){var c=this;void 0===b&&(b=!1);if(this.view.mapCoordsHelper.canProject()&&!this.noReferencePositionQueries&& (this._referencePosMapCoordsRequested?this._referencePosMapCoordsRequested.copy(a):this._referencePosMapCoordsRequested=a.clone(),this._referencePosResetPreserveAbsoluteTime=!!b,!this._referencePosUpdateQuery&&!this._referencePosUpdateTimer&&!this.view.interacting&&this.view.stationary)){var m=this._referencePosUpdateQuery=d.after(this.referencePointUpdateDelay).then(function(){if(c._referencePosUpdateQuery===m)return c._doReferencePositionUpdateQuery(function(){return c._referencePosUpdateQuery!== m})}).always(function(){c._referencePosUpdateQuery===m&&(c._referencePosUpdateQuery=null,c._referencePosUpdateTimer||c._executePendingReferencePositionUpdate(),c.notifyChange("updating"))}),e=this._referencePosUpdateTimer=d.after(this.referencePointUpdateInterval).then(function(){c._referencePosUpdateTimer===e&&(c._referencePosUpdateTimer=null,c._referencePosUpdateQuery||c._executePendingReferencePositionUpdate())});this.notifyChange("updating")}};e.prototype._doReferencePositionUpdateQuery=function(a){var b= this;this._referencePosResetPreserveAbsoluteTime&&(this._preserveAbsoluteDateTime=!1);this._referencePosMapCoords?this._referencePosMapCoords.copy(this._referencePosMapCoordsRequested):this._referencePosMapCoords=this._referencePosMapCoordsRequested.clone();this._referencePosMapCoordsRequested=this._referencePosResetPreserveAbsoluteTime=null;return this.view.mapCoordsHelper.toGeographic(this._referencePosMapCoords).then(function(c){if(!a()&&!isNaN(c[0])&&!isNaN(c[1])){var m=b._referencePosMapCoords.z* b.view.mapCoordsHelper.unitInMeters;b._referencePosWGS84?(b._referencePosWGS84.x=c[0],b._referencePosWGS84.y=c[1],b._referencePosWGS84.z=m):b._referencePosWGS84=new l({x:c[0],y:c[1],z:m,spatialReference:p.WGS84});b._referencePosChanged()}})};e.prototype._executePendingReferencePositionUpdate=function(){var a=this._referencePosMapCoordsRequested;a&&this._requestReferencePositionUpdate(a,this._referencePosResetPreserveAbsoluteTime)};e.prototype._referencePosChanged=function(){this._preserveAbsoluteDateTime? this._updateLightParams():this._autoUpdateTimezone(this._referencePosWGS84)||this._updateLightParams()};e.prototype._exceedsReferencePosDistThreshold=function(a){return this._referencePosMapCoords?(a=this._referencePosMapCoords.distance(a),this.view.mapCoordsHelper&&(a*=this.view.mapCoordsHelper.unitInMeters),a>this.referencePointUpdateDistThreshold):!0};e.prototype._cancelReferencePosUpdates=function(){this._referencePosUpdateTimer=this._referencePosUpdateQuery=null};e.FIXED_LIGHT_DIRECTION=m;a([k.property({type:Boolean, dependsOn:["noReferencePositionQueries"],readOnly:!0})],e.prototype,"updating",null);a([k.property()],e.prototype,"noReferencePositionQueries",void 0);a([k.property({constructOnly:!0})],e.prototype,"view",void 0);a([k.property()],e.prototype,"_environmentRenderer",void 0);return e=a([k.subclass("esri.views.3d.environment.SceneViewEnvironmentManager")],e)}(k.declared(e,c));h.SceneViewEnvironmentManager=r;var B=new Date,z={hours:0,minutes:0,seconds:0},C=u.vec3d.createFrom(.22,.22,.33),A=u.vec3d.createFrom(.22, .22,.22);h.default=r})},"esri/views/3d/environment/EnvironmentRenderer":function(){define("../../../core/watchUtils ../support/ExternalRenderer ./PanoramicAtmosphere ./RealisticAtmosphere ./SimpleAtmosphere ./Stars ../webgl-engine/lib/RenderSlot".split(" "),function(r,h,f,a,e,c,g){return h.createSubclass({declaredClass:"esri.views.3d.environment.EnvironmentRenderer",properties:{view:{},viewingMode:{dependsOn:["view.viewingMode"],get:function(){return this.get("view.viewingMode")||"global"}},atmosphereQuality:{dependsOn:["view.environment.atmosphereEnabled", "view.environment.atmosphere.quality"],get:function(){return this.get("view.environment.atmosphereEnabled")?this.get("view.environment.atmosphere.quality")||"none":"none"}},starsEnabled:{dependsOn:["view.environment.starsEnabled"],get:function(){return this.get("view.environment.starsEnabled")||!1}},transparent:{dependsOn:["view.basemapTerrain.opacity","view.basemapTerrain.wireframe"],get:function(){var a=this.get("view.basemapTerrain");return a&&a._renderer.isTransparent()}},_atmosphere:{},_stars:{}, needsRender:{dependsOn:["_stars.needsRender","_atmosphere.needsRender"],get:function(){return!!(this._needsRender||this._atmosphere&&this._atmosphere.needsRender||this._stars&&this._stars.needsRender)}}},constructor:function(){this._slots=[g.POSTPROCESSING_ATMOSPHERE_OPAQUE,g.POSTPROCESSING_ATMOSPHERE_TRANSPARENT];this._stars=this._atmosphere=this._atmosphereReadyPromise=this._AtmosphereClass=null;this._needsRender=!0;this.notifyChange("needsRender")},initialize:function(){this.view._stage.addExternalRenderer(this._slots, this);this._basemapTerrainHandle=r.when(this.view,"basemapTerrain",this._updateBasemapTerrain.bind(this))},destroy:function(){this._atmosphere&&(this._atmosphere.destroy(),this._atmosphere=null);this._stars&&(this._stars.destroy(),this._stars=null);this._basemapTerrainHandle&&this._basemapTerrainHandle.remove();this.view&&(this.view._stage.removeExternalRenderer(this),this.view=null)},setup:function(a){this.watch("viewingMode,atmosphereQuality,transparent,visible",this._updateAtmosphere.bind(this)); this._updateAtmosphere();this.watch("starsEnabled,transparent,visible",this._updateStars.bind(this));this._updateStars();this.watch("view.basemapTerrain.loaded",function(){this._needsRender=!0;this.notifyChange("needsRender")}.bind(this))},resetNeedsRender:function(){this._atmosphere&&(this._atmosphere.resetNeedsRender?this._atmosphere.resetNeedsRender():this._atmosphere.didRender&&(this._atmosphere.needsRender=!1,this._atmosphere.didRender=!1));this._stars&&(this._stars.resetNeedsRender?this._stars.resetNeedsRender(): this._stars.didRender&&(this._stars.needsRender=!1,this._stars.didRender=!1));this.didRender&&(this.didRender=this._needsRender=!1,this.notifyChange("needsRender"))},render:function(a){if(!this.get("view.basemapTerrain.loaded")&&"global"===this.viewingMode)return!1;if(!this._stars&&!this._atmosphere)return!0;this._stars&&this._stars.render(a);this._atmosphere&&this._atmosphere.render(a);return this._stars&&this._stars.didRender||this._atmosphere&&this._atmosphere.didRender},_updateStars:function(){var a= this._getSimpleAtmosphereSlot();this.starsEnabled&&!this._stars?(this._stars=new c({view:this.view,slot:a}),this._stars.initializeRenderContext(this.renderContext)):!this.starsEnabled&&this._stars?(this._stars.destroy(),this._stars=null):this._stars&&(this._stars.slot=a);this._needsRender=!0;this.notifyChange("needsRender")},_updateAtmosphere:function(){var a=this._getSimpleAtmosphereSlot();this._atmosphere&&(this._atmosphere.slot=a);if(this._updateAtmosphereClass(this.renderContext)){this._needsRender= !0;this.notifyChange("needsRender");var b=function(){this._atmosphere&&(this._atmosphere.destroy(),this._atmosphere=null)}.bind(this);if(this._AtmosphereClass){this._atmosphereReadyPromise&&(this._atmosphereReadyPromise.cancel(),this._atmosphereReadyPromise=null);var c=new this._AtmosphereClass({view:this.view,slot:a});c.initializeRenderContext(this.renderContext);this._atmosphere?this._atmosphereReadyPromise=c.when(function(){b();this._atmosphereReadyPromise=null;this._atmosphere=c}.bind(this)): this._atmosphere=c;c.when(this._updateBasemapTerrain.bind(this))}else b(),this._updateBasemapTerrain()}},_updateAtmosphereClass:function(c){var b=this._AtmosphereClass;"none"===this.atmosphereQuality?this._AtmosphereClass=null:"high"===this.atmosphereQuality&&!this.transparent&&a.isSupported(c)?this._AtmosphereClass="local"===this.viewingMode?f:a:this._AtmosphereClass="local"===this.viewingMode?f:e;return this._AtmosphereClass!==b},_getSimpleAtmosphereSlot:function(){return this.transparent&&"global"=== this.viewingMode?g.POSTPROCESSING_ATMOSPHERE_TRANSPARENT:g.POSTPROCESSING_ATMOSPHERE_OPAQUE},_updateBasemapTerrain:function(){var c=this.get("view.basemapTerrain");c&&(c.velvetOverground=!(!this._AtmosphereClass||this._AtmosphereClass===a))}})})},"esri/views/3d/support/ExternalRenderer":function(){define("../../../core/declare ../../../core/Accessor ../../../core/Promise dojo/Deferred dojo/aspect dojo/_base/lang".split(" "),function(r,h,f,a,e,c){return r([h,f],{"-chains-":c.mixin(h._meta.chains,{setup:"after", initializeRenderContext:"after",uninitializeRenderContext:"before"}),properties:{gl:{readOnly:!0,get:function(){return this._gl}},needsRender:{value:!0},visible:{value:!0}},constructor:function(){this.didRender=!1;this.renderContext=null;this.watch("visible",function(){this.needsRender=!0}.bind(this));this._contextDfd=new a},initialize:function(){this.addResolvingPromise(this._contextDfd.promise);e.around(this,"render",function(a){return function(){return this.isRejected()?this.didRender=!0:this.isResolved()? !this.visible||a.apply(this,arguments)?this.didRender=!0:!1:!1}.bind(this)}.bind(this));this.when(function(){this.destroyed||this.setup(this.renderContext)}.bind(this))},needsRender:!0,visible:!0,initializeRenderContext:function(a){this.renderContext=a;this._contextDfd.resolve()},uninitializeRenderContext:function(a){},setup:function(a){},render:function(a){return!1}})})},"esri/views/3d/environment/PanoramicAtmosphere":function(){define("dojo/text!./materials/SimpleAtmosphereMaterial.xml dojo/Deferred ../support/ExternalRenderer ../lib/glMatrix ../webgl-engine/lib/GeometryRenderer ../webgl-engine/lib/GeometryUtil ../webgl-engine/lib/Texture ../webgl-engine/lib/Util ../webgl-engine/lib/GLTextureRep ../webgl-engine/lib/RenderPass ../webgl-engine/lib/RenderSlot ./resources/SimpleAtmosphereTexture ../../webgl/Program ../webgl-engine/lib/DefaultVertexBufferLayouts ../webgl-engine/lib/DefaultVertexAttributeLocations".split(" "), function(r,h,f,a,e,c,g,d,b,k,l,p,n,t,u){var q=a.vec2d,v=a.vec3d,x=a.mat4d,m=d.VertexAttrConstants,B=x.create();return f.createSubclass({declaredClass:"esri.views.3d.environment.PanoramicAtmosphere",properties:{view:{},needsRender:{value:!1},slot:{value:l.BACKGROUND,set:function(a){this.needsRender=!0;this._set("slot",a)}}},constructor:function(){this._renderData={texV:q.create(),silCircleCenter:v.create(),silCircleV1:v.create(),silCircleV2:v.create()};this._textureRep=this._texture=null;this.slot= l.BACKGROUND},initialize:function(){this._textureDfd=new h;this.addResolvingPromise(this._textureDfd.promise)},destroy:function(){this._textureRep&&(this._texture&&(this._textureRep.release("SimpleAtmosphere"),this._textureRep.getTexture("SimpleAtmosphere").unload()),this._textureRep=null);this._program&&(this._program.dispose(),this._program=null);this._textureDfd&&(this._textureDfd.cancel(),this._textureDfd=null)},initializeRenderContext:function(a){this._textureRep=new b({SimpleAtmosphere:new g(p, "SimpleAtmosphere",{wrapClamp:!0})},a.programRep,function(){return this.view.state.camera.viewport}.bind(this),a.rctx);this._texture=this._textureRep.aquire("SimpleAtmosphere",void 0,function(a){this._texture=a.getGLTexture();this._textureDfd.resolve();this._textureDfd=null}.bind(this))},setup:function(a){var b=this._createGeometryData(),c=this.renderContext.rctx;this._renderer=new e(b,t.Pos3,null,c);a.shaderSnippets.vsSimpleAtmosphere||a.shaderSnippets._parse(r);this._program=new n(c,a.shaderSnippets.vsSimpleAtmosphere, a.shaderSnippets.fsSimpleAtmosphere,u.Default3D,["PANORAMIC"])},render:function(a){if(a.slot!==this.slot||a.pass!==k.MATERIAL||!this._textureRep.getIsLoaded("SimpleAtmosphere"))return!1;var b=this.renderContext.rctx,c=b.gl,m=this._program;b.bindProgram(m);b.bindTexture(this._texture);m.setUniform1i("tex",0);m.setUniformMatrix4fv("proj",a.camera.projectionMatrix);x.toRotationMat(a.camera.viewMatrix,B);m.setUniformMatrix4fv("view",B);m.setUniform4f("color",1,1,1,1);m.setUniform3fv("lightDirection", a.lightingData.direction);b.setDepthTestEnabled(!0);b.setFaceCullingEnabled(!0);b.setDepthFunction(c.LEQUAL);b.setBlendingEnabled(!0);b.setDepthWriteEnabled(!1);this._renderer.render(this._program);b.setDepthWriteEnabled(!0);b.setBlendingEnabled(!1);b.setDepthFunction(c.LESS);b.setFaceCullingEnabled(!1);return!0},_createGeometryData:function(){for(var a=c.createPolySphereGeometry(1,2),b=a.indices[m.POSITION],d=0;dc?c:a}function c(a){return a/180*Math.PI}function g(a){return 180*a/Math.PI}function d(a,b,c){f.mat4d.multiply(b,a,u);f.mat4d.inverse(u);for(a=0;8>a;++a)f.mat4d.multiplyVec4(u,q[a],v),f.vec3d.set3(v[0]/v[3],v[1]/v[3],v[2]/v[3],c[a])}function b(a,b,c,d){f.vec3d.subtract(a,b,m);f.vec3d.subtract(c,b,B);f.vec3d.cross(B,m,d);f.vec3d.normalize(d);d[3]=-f.vec3d.dot(d,a)}function k(a,b,c,m){var d=6378137/Math.sqrt(1-h.ECCENTRICITY_SQUARED*Math.pow(Math.sin(a),2)),e=Math.cos(a);m[0]=(d+ c)*Math.cos(b)*e;m[1]=(d*(1-h.ECCENTRICITY_SQUARED)+c)*Math.sin(a);m[2]=-(d+c)*Math.sin(b)*e}function l(a){for(var b in a)return b}function p(a,b){a[12]=b[0];a[13]=b[1];a[14]=b[2]}function n(a,b){void 0===b&&(b=0);for(var c=0,m=0;4>m;m++)c+=a[b+m]*X[m];return c}function t(a){return a-Math.floor(a)}Object.defineProperty(h,"__esModule",{value:!0});var u=f.mat4d.create(),q=[f.vec4d.createFrom(-1,-1,-1,1),f.vec4d.createFrom(1,-1,-1,1),f.vec4d.createFrom(1,1,-1,1),f.vec4d.createFrom(-1,1,-1,1),f.vec4d.createFrom(-1, -1,1,1),f.vec4d.createFrom(1,-1,1,1),f.vec4d.createFrom(1,1,1,1),f.vec4d.createFrom(-1,1,1,1)],v=f.vec4d.create(),x=[f.vec3d.create(),f.vec3d.create(),f.vec3d.create(),f.vec3d.create(),f.vec3d.create(),f.vec3d.create(),f.vec3d.create(),f.vec3d.create()],m=f.vec3d.create(),B=f.vec3d.create(),z=f.vec3d.create(),C=f.vec3d.create(),A=f.vec3d.create(),D=f.vec3d.create(),E=f.vec3d.create(),F=f.vec3d.create(),I=f.vec3d.create(),P=f.vec3d.create(),G=f.vec3d.create(),M=f.vec3d.create(),H=f.vec3d.create(), J=f.vec3d.create(),O=f.vec3d.createFrom(0,0,0),N=function(){function a(a){this.message=a}a.prototype.toString=function(){return"AssertException: "+this.message};return a}();h.AssertException=N;h.EARTH_RADIUS=6378137;h.METER2FEET=3.28084;h.ECCENTRICITY_SQUARED=.0066943799901414;h.VertexAttrConstants={POSITION:"position",NORMAL:"normal",NORMALCOMPRESSED:"normalCompressed",UV0:"uv0",AUXPOS1:"auxpos1",AUXPOS2:"auxpos2",COLOR:"color",SYMBOLCOLOR:"symbolColor",SIZE:"size",REGION:"region",COMPONENTINDEX:"componentIndex"}; h.assert=a;h.verify=function(a,b){a||(console.log("Verify failed: "+b),console.log(Error("dummy").stack))};h.isPowerOfTwo=function(a){return 0===(a&a-1)};h.lerp=function(a,b,c){return a+(b-a)*c};h.clamp=e;h.encodeInt16=function(a){return e(Math.round(32767*a),-32767,32767)};h.encodeNormal=function(a,b){var c=Math.abs(a[0]),m=Math.abs(a[1]),d=1/(c+m+Math.abs(a[2])),c=c*d,m=m*d,d=Math.min(a[2]*d,0);b[0]=S(a[0])*(c-d);b[1]=S(a[1])*(m-d)};var S="function"===typeof Math.sign?Math.sign:function(a){return+(0< a)-+(0>a)||0};h.fallbackIfUndefined=function(a,b){return void 0===a?b:a};h.hex2rgb=function(a){a=Math.floor(a);return[(a>>16&255)/255,(a>>8&255)/255,(a&255)/255]};h.rgb2hex=function(a){var b=e(Math.round(255*a[0]),0,255),c=e(Math.round(255*a[1]),0,255);a=e(Math.round(255*a[2]),0,255);return"0x"+((b<<16)+(c<<8)+a).toString(16)};h.dec2hex=function(a){a=a.toString(16);return"00000000".substr(0,8-a.length)+a};h.deg2rad=c;h.rad2deg=g;h.azimuthElevationAngle2Direction=function(a,b){a=1.5*Math.PI-a;b=.5* Math.PI-b;return[Math.cos(a)*Math.sin(b),Math.cos(b),Math.sin(a)*Math.sin(b)]};h.rayPlane=function(a,b,c,m){var d=f.vec3d.dot(c,b);if(0===d)return!1;c=-(f.vec3d.dot(c,a)+c[3])/d;f.vec3d.add(a,f.vec3d.scale(b,c,m),m);return!0};h.raySphere=function(a,b,c,d,e){c=c||O;var g=f.vec3d.subtract(a,c,m);c=f.vec3d.dot(b,b);var k=2*f.vec3d.dot(b,g);d=f.vec3d.dot(g,g)-d*d;d=k*k-4*c*d;if(0>d)return!1;g=Math.sqrt(d);d=(-k-g)/(2*c);c=(-k+g)/(2*c);if(0>d||ck)return!1;k=1/k;var n=a[0]-c[e],z=a[1]-c[e+1];a=a[2]-c[e+2];l[1]=k*(n*u+z*v+a*p);if(0>l[1]||1l[2]||1g&&(d=e,e=g,g=d);var k=(c[1]-a[1])/b[1],l=(m[1]-a[1])/b[1];k>l&&(d=k,k=l,l=d);if(e>l||k>g)return!1;k>e&&(e=k);la&&(d=c,c=a,a=d);if(e>a||c>g)return!1;ag?!1:!0};h.rayRay2D=function(a,b,c,m,d,e){void 0===e&&(e=f.vec2d.create());var g=(m[d]-c[d])*(b[0]-a[0])-(m[0]-c[0])*(b[d]-a[d]);if(0===g)return!1;c=((m[0]-c[0])*(a[d]-c[d])-(m[d]-c[d])*(a[0]-c[0]))/g;e[0]=a[0]+c*(b[0]- a[0]);e[1]=a[d]+c*(b[d]-a[d]);return!0};h.matrix2frustum=d;h.matrix2frustumPlanes=function(a,c,m,e){void 0===e&&(e=m,m=x);d(a,c,m);b(m[4],m[0],m[3],e[0]);b(m[1],m[5],m[6],e[1]);b(m[4],m[5],m[1],e[2]);b(m[3],m[2],m[6],e[3]);b(m[0],m[1],m[2],e[4]);b(m[5],m[4],m[7],e[5])};h.point2plane=b;h.planeDistance=function(a,b){return b[0]*a[0]+b[1]*a[1]+b[2]*a[2]+b[3]};h.project=function(b,c,m,d,e){e||(e=b);v[0]=b[0];v[1]=b[1];v[2]=b[2];v[3]=1;f.mat4d.multiplyVec4(c,v);2a[2]?1:-1)*Math.acos(e(a[0]/(Math.cos(b[0])*c),-1,1));b[0]=g(b[0]);b[1]=g(b[1]);b[2]=c};h.pos2latLonWGS84Ellipsoid=function(a,b){var c=a[0],m=-a[2],d=a[1],e=Math.sqrt(Math.pow(6378137, 2)*(1-h.ECCENTRICITY_SQUARED));a=Math.sqrt(Math.pow(c,2)+Math.pow(m,2));var g=Math.atan2(6378137*d,e*a),c=Math.atan2(m,c),m=Math.atan2(d+Math.pow(Math.sqrt((Math.pow(6378137,2)-Math.pow(e,2))/Math.pow(e,2)),2)*e*Math.pow(Math.sin(g),3),a-6378137*h.ECCENTRICITY_SQUARED*Math.pow(Math.cos(g),3));a=a/Math.cos(m)-6378137/Math.sqrt(1-h.ECCENTRICITY_SQUARED*Math.pow(Math.sin(m),2))+h.EARTH_RADIUS;b[0]=m;b[1]=c;b[2]=a};h.computeGlobeTransformation=function(a,b,m){var d=c(a[0]);a=c(a[1]);k(d,a,b,z);f.mat4d.translate(m, z);f.mat4d.rotateY(m,.5*Math.PI+a);f.mat4d.rotateX(m,.5*Math.PI-d);return m};h.readUInt16=function(a,b){return a[b]+(a[b+1]<<8)};h.readUInt32=function(a,b){return a[b]+(a[b+1]<<8)+(a[b+2]<<16)+(a[b+3]<<24)};h.setIfDefined=function(a,b,c){void 0!==b[a]&&(c[a]=b[a])};h.array2object=function(a,b){var c={};if(void 0!==b)for(var m=0;mb;b<<=1)a|=a>>b;return a+1};h.nextHighestPowerOfTen=function(a){return Math.pow(10,Math.ceil(Math.LOG10E*Math.log(a)))};h.lineLineDistanceSquared3D=function(a,b,c,m,d){C[0]=a[0]-c[0];C[1]=a[1]-c[1];C[2]=a[2]-c[2];A[0]=m[0]-c[0];A[1]=m[1]-c[1];A[2]=m[2]-c[2];if(1E-4>Math.abs(A[0])&&1E-4>Math.abs(A[1])&& 1E-4>Math.abs(A[2]))return d.success=!1,d;D[0]=b[0]-a[0];D[1]=b[1]-a[1];D[2]=b[2]-a[2];if(1E-4>Math.abs(D[0])&&1E-4>Math.abs(D[1])&&1E-4>Math.abs(D[2]))return d.success=!1,d;b=C[0]*A[0]+C[1]*A[1]+C[2]*A[2];m=A[0]*D[0]+A[1]*D[1]+A[2]*D[2];var g=C[0]*D[0]+C[1]*D[1]+C[2]*D[2],k=A[0]*A[0]+A[1]*A[1]+A[2]*A[2],l=(D[0]*D[0]+D[1]*D[1]+D[2]*D[2])*k-m*m;if(1E-4>Math.abs(l))return d.success=!1,d;g=e((b*m-g*k)/l,0,1);b=e((b+m*g)/k,0,1);E[0]=a[0]+g*D[0];E[1]=a[1]+g*D[1];E[2]=a[2]+g*D[2];F[0]=c[0]+b*A[0];F[1]= c[1]+b*A[1];F[2]=c[2]+b*A[2];a=f.vec3d.dist2(E,F);d.success=!0;d.dist2=a;d.pa=E;d.pb=F;return d};h.pointLineSegmentDistanceSquared2D=function(a,b,c){M[0]=b[0]-a[0];M[1]=b[1]-a[1];M[2]=0;H[0]=c[0]-a[0];H[1]=c[1]-a[1];H[2]=0;J[0]=c[0];J[1]=c[1];J[2]=0;b=f.vec2d.dot(H,M);c=f.vec2d.dot(M,M);b=e(b/c,0,1);G[0]=M[0]*b;G[1]=M[1]*b;I[0]=a[0]+G[0];I[1]=a[1]+G[1];f.vec2d.subtract(J,I,P);a=f.vec2d.dot(P,P);b=f.vec2d.dot(H,H);c=f.vec2d.dot(M,M);var m=f.vec2d.dot(G,G);if(m>b||m>c)a=Number.MAX_VALUE;return a};h.packFloatRGBA= function(a,b,c){void 0===c&&(c=0);a=e(a,0,Q);for(var m=0;4>m;m++)b[c+m]=Math.floor(256*t(a*Y[m]))};h.unpackFloatRGBA=n;var Y=[1,256,65536,16777216],X=[1/256,1/65536,1/16777216,1/4294967296],Q=n(new Uint8ClampedArray([255,255,255,255]))})},"esri/views/3d/webgl-engine/lib/gl-matrix":function(){define([],function(){var r={};(function(h,f){f(h,!0);f(h,!1)})(r,function(h,f){var a={};(function(){if("undefined"!=typeof Float32Array){var b=new Float32Array(1),c=new Int32Array(b.buffer);a.invsqrt=function(a){b[0]= a;c[0]=1597463007-(c[0]>>1);var m=b[0];return m*(1.5-.5*a*m*m)}}else a.invsqrt=function(a){return 1/Math.sqrt(a)}})();var e=Array;"undefined"!=typeof Float32Array&&(e=f?Float32Array:Array);var c={create:function(a){var b=new e(3);a?(b[0]=a[0],b[1]=a[1],b[2]=a[2]):b[0]=b[1]=b[2]=0;return b},createFrom:function(a,b,c){var m=new e(3);m[0]=a;m[1]=b;m[2]=c;return m},set:function(a,b){b[0]=a[0];b[1]=a[1];b[2]=a[2];return b},set3:function(a,b,c,d){d[0]=a;d[1]=b;d[2]=c;return d},add:function(a,b,c){if(!c|| a===c)return a[0]+=b[0],a[1]+=b[1],a[2]+=b[2],a;c[0]=a[0]+b[0];c[1]=a[1]+b[1];c[2]=a[2]+b[2];return c},subtract:function(a,b,c){if(!c||a===c)return a[0]-=b[0],a[1]-=b[1],a[2]-=b[2],a;c[0]=a[0]-b[0];c[1]=a[1]-b[1];c[2]=a[2]-b[2];return c},multiply:function(a,b,c){if(!c||a===c)return a[0]*=b[0],a[1]*=b[1],a[2]*=b[2],a;c[0]=a[0]*b[0];c[1]=a[1]*b[1];c[2]=a[2]*b[2];return c},max:function(a,b,c){c[0]=Math.max(a[0],b[0]);c[1]=Math.max(a[1],b[1]);c[2]=Math.max(a[2],b[2]);return c},min:function(a,b,c){c[0]= Math.min(a[0],b[0]);c[1]=Math.min(a[1],b[1]);c[2]=Math.min(a[2],b[2]);return c},negate:function(a,b){b||(b=a);b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];return b},scale:function(a,b,c){if(!c||a===c)return a[0]*=b,a[1]*=b,a[2]*=b,a;c[0]=a[0]*b;c[1]=a[1]*b;c[2]=a[2]*b;return c},normalize:function(a,b){b||(b=a);var c=a[0],m=a[1];a=a[2];var d=Math.sqrt(c*c+m*m+a*a);if(!d)return b[0]=0,b[1]=0,b[2]=0,b;if(1===d)return b[0]=c,b[1]=m,b[2]=a,b;d=1/d;b[0]=c*d;b[1]=m*d;b[2]=a*d;return b},cross:function(a,b,c){c||(c=a); var m=a[0],d=a[1];a=a[2];var e=b[0],g=b[1];b=b[2];c[0]=d*b-a*g;c[1]=a*e-m*b;c[2]=m*g-d*e;return c},length:function(a){var b=a[0],c=a[1];a=a[2];return Math.sqrt(b*b+c*c+a*a)},length2:function(a){var b=a[0],c=a[1];a=a[2];return b*b+c*c+a*a},dot:function(a,b){return a[0]*b[0]+a[1]*b[1]+a[2]*b[2]},direction:function(a,b,c){c||(c=a);var m=a[0]-b[0],d=a[1]-b[1];a=a[2]-b[2];b=Math.sqrt(m*m+d*d+a*a);if(!b)return c[0]=0,c[1]=0,c[2]=0,c;b=1/b;c[0]=m*b;c[1]=d*b;c[2]=a*b;return c},lerp:function(a,b,c,d){d||(d= a);d[0]=a[0]+c*(b[0]-a[0]);d[1]=a[1]+c*(b[1]-a[1]);d[2]=a[2]+c*(b[2]-a[2]);return d},dist:function(a,b){var c=b[0]-a[0],m=b[1]-a[1];a=b[2]-a[2];return Math.sqrt(c*c+m*m+a*a)},dist2:function(a,b){var c=b[0]-a[0],m=b[1]-a[1];a=b[2]-a[2];return c*c+m*m+a*a}},g=null,d=new e(4);c.unproject=function(a,b,c,e,k){k||(k=a);g||(g=u.create());var m=g;d[0]=2*(a[0]-e[0])/e[2]-1;d[1]=2*(a[1]-e[1])/e[3]-1;d[2]=2*a[2]-1;d[3]=1;u.multiply(c,b,m);if(!u.inverse(m))return null;u.multiplyVec4(m,d);if(0===d[3])return null; k[0]=d[0]/d[3];k[1]=d[1]/d[3];k[2]=d[2]/d[3];return k};var b=c.createFrom(1,0,0),k=c.createFrom(0,1,0),l=c.createFrom(0,0,1);c.rotationTo=function(a,d,e){e||(e=q.create());var m=c.dot(a,d),g=c.create();if(1<=m)q.set(v,e);else if(-.999999>m)c.cross(b,a,g),1E-6>g.length&&c.cross(k,a,g),1E-6>g.length&&c.cross(l,a,g),c.normalize(g),q.fromAxisAngle(g,Math.PI,e);else{var m=Math.sqrt(2*(1+m)),f=1/m;c.cross(a,d,g);e[0]=g[0]*f;e[1]=g[1]*f;e[2]=g[2]*f;e[3]=.5*m;q.normalize(e)}1e[3]&&(e[3]=-1); return e};var p=c.create(),n=c.create();c.project=function(a,b,d,e){e||(e=a);c.direction(b,d,p);c.subtract(a,b,n);a=c.dot(p,n);c.scale(p,a,e);c.add(e,b,e)};c.str=function(a){return"["+a[0]+", "+a[1]+", "+a[2]+"]"};var t={create:function(a){var b=new e(9);a?(b[0]=a[0],b[1]=a[1],b[2]=a[2],b[3]=a[3],b[4]=a[4],b[5]=a[5],b[6]=a[6],b[7]=a[7],b[8]=a[8]):b[0]=b[1]=b[2]=b[3]=b[4]=b[5]=b[6]=b[7]=b[8]=0;return b},createFrom:function(a,b,c,d,g,k,l,f,q){var m=new e(9);m[0]=a;m[1]=b;m[2]=c;m[3]=d;m[4]=g;m[5]=k; m[6]=l;m[7]=f;m[8]=q;return m},determinant:function(a){var b=a[3],c=a[4],m=a[5],d=a[6],e=a[7],g=a[8];return a[0]*(g*c-m*e)+a[1]*(-g*b+m*d)+a[2]*(e*b-c*d)},inverse:function(a,b){var c=a[0],m=a[1],d=a[2],e=a[3],g=a[4],k=a[5],l=a[6],f=a[7];a=a[8];var q=a*g-k*f,B=-a*e+k*l,u=f*e-g*l,v=c*q+m*B+d*u;if(!v)return null;v=1/v;b||(b=t.create());b[0]=q*v;b[1]=(-a*m+d*f)*v;b[2]=(k*m-d*g)*v;b[3]=B*v;b[4]=(a*c-d*l)*v;b[5]=(-k*c+d*e)*v;b[6]=u*v;b[7]=(-f*c+m*l)*v;b[8]=(g*c-m*e)*v;return b},multiply:function(a,b,c){c|| (c=a);var m=a[0],d=a[1],e=a[2],g=a[3],k=a[4],l=a[5],f=a[6],q=a[7];a=a[8];var t=b[0],u=b[1],v=b[2],B=b[3],p=b[4],n=b[5],z=b[6],x=b[7];b=b[8];c[0]=t*m+u*g+v*f;c[1]=t*d+u*k+v*q;c[2]=t*e+u*l+v*a;c[3]=B*m+p*g+n*f;c[4]=B*d+p*k+n*q;c[5]=B*e+p*l+n*a;c[6]=z*m+x*g+b*f;c[7]=z*d+x*k+b*q;c[8]=z*e+x*l+b*a;return c},multiplyVec2:function(a,b,c){c||(c=b);var m=b[0];b=b[1];c[0]=m*a[0]+b*a[3]+a[6];c[1]=m*a[1]+b*a[4]+a[7];return c},multiplyVec3:function(a,b,c){c||(c=b);var m=b[0],d=b[1];b=b[2];c[0]=m*a[0]+d*a[3]+b* a[6];c[1]=m*a[1]+d*a[4]+b*a[7];c[2]=m*a[2]+d*a[5]+b*a[8];return c},set:function(a,b){b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];b[4]=a[4];b[5]=a[5];b[6]=a[6];b[7]=a[7];b[8]=a[8];return b},identity:function(a){a||(a=t.create());a[0]=1;a[1]=0;a[2]=0;a[3]=0;a[4]=1;a[5]=0;a[6]=0;a[7]=0;a[8]=1;return a},transpose:function(a,b){if(!b||a===b){b=a[1];var c=a[2],m=a[5];a[1]=a[3];a[2]=a[6];a[3]=b;a[5]=a[7];a[6]=c;a[7]=m;return a}b[0]=a[0];b[1]=a[3];b[2]=a[6];b[3]=a[1];b[4]=a[4];b[5]=a[7];b[6]=a[2];b[7]=a[5];b[8]= a[8];return b},toMat4:function(a,b){b||(b=u.create());b[15]=1;b[14]=0;b[13]=0;b[12]=0;b[11]=0;b[10]=a[8];b[9]=a[7];b[8]=a[6];b[7]=0;b[6]=a[5];b[5]=a[4];b[4]=a[3];b[3]=0;b[2]=a[2];b[1]=a[1];b[0]=a[0];return b},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+", "+a[4]+", "+a[5]+", "+a[6]+", "+a[7]+", "+a[8]+"]"}},u={create:function(a){var b=new e(16);4===arguments.length?(b[0]=arguments[0],b[1]=arguments[1],b[2]=arguments[2],b[3]=arguments[3],b[4]=arguments[4],b[5]=arguments[5],b[6]=arguments[6], b[7]=arguments[7],b[8]=arguments[8],b[9]=arguments[9],b[10]=arguments[10],b[11]=arguments[11],b[12]=arguments[12],b[13]=arguments[13],b[14]=arguments[14],b[15]=arguments[15]):a&&(b[0]=a[0],b[1]=a[1],b[2]=a[2],b[3]=a[3],b[4]=a[4],b[5]=a[5],b[6]=a[6],b[7]=a[7],b[8]=a[8],b[9]=a[9],b[10]=a[10],b[11]=a[11],b[12]=a[12],b[13]=a[13],b[14]=a[14],b[15]=a[15]);return b},createFrom:function(a,b,c,d,g,k,l,f,q,t,u,v,p,n,x,h){var m=new e(16);m[0]=a;m[1]=b;m[2]=c;m[3]=d;m[4]=g;m[5]=k;m[6]=l;m[7]=f;m[8]=q;m[9]=t; m[10]=u;m[11]=v;m[12]=p;m[13]=n;m[14]=x;m[15]=h;return m},createFromMatrixRowMajor:function(a){var b=new e(16);b[0]=a[0];b[4]=a[1];b[8]=a[2];b[12]=a[3];b[1]=a[4];b[5]=a[5];b[9]=a[6];b[13]=a[7];b[2]=a[8];b[6]=a[9];b[10]=a[10];b[14]=a[11];b[3]=a[12];b[7]=a[13];b[11]=a[14];b[15]=a[15];return b},createFromMatrix:function(a){var b=new e(16);b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];b[4]=a[4];b[5]=a[5];b[6]=a[6];b[7]=a[7];b[8]=a[8];b[9]=a[9];b[10]=a[10];b[11]=a[11];b[12]=a[12];b[13]=a[13];b[14]=a[14];b[15]= a[15];return b},set:function(a,b){b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];b[4]=a[4];b[5]=a[5];b[6]=a[6];b[7]=a[7];b[8]=a[8];b[9]=a[9];b[10]=a[10];b[11]=a[11];b[12]=a[12];b[13]=a[13];b[14]=a[14];b[15]=a[15];return b},setRowMajor:function(a,b){b[0]=a[0];b[4]=a[1];b[8]=a[2];b[12]=a[3];b[1]=a[4];b[5]=a[5];b[9]=a[6];b[13]=a[7];b[2]=a[8];b[6]=a[9];b[10]=a[10];b[14]=a[11];b[3]=a[12];b[7]=a[13];b[11]=a[14];b[15]=a[15];return b},identity:function(a){a||(a=u.create());a[0]=1;a[1]=0;a[2]=0;a[3]=0;a[4]=0;a[5]= 1;a[6]=0;a[7]=0;a[8]=0;a[9]=0;a[10]=1;a[11]=0;a[12]=0;a[13]=0;a[14]=0;a[15]=1;return a},transpose:function(a,b){if(!b||a===b){b=a[1];var c=a[2],d=a[3],m=a[6],e=a[7],g=a[11];a[1]=a[4];a[2]=a[8];a[3]=a[12];a[4]=b;a[6]=a[9];a[7]=a[13];a[8]=c;a[9]=m;a[11]=a[14];a[12]=d;a[13]=e;a[14]=g;return a}b[0]=a[0];b[1]=a[4];b[2]=a[8];b[3]=a[12];b[4]=a[1];b[5]=a[5];b[6]=a[9];b[7]=a[13];b[8]=a[2];b[9]=a[6];b[10]=a[10];b[11]=a[14];b[12]=a[3];b[13]=a[7];b[14]=a[11];b[15]=a[15];return b},determinant:function(a){var b= a[0],c=a[1],d=a[2],e=a[3],m=a[4],g=a[5],k=a[6],l=a[7],f=a[8],q=a[9],t=a[10],u=a[11],v=a[12],p=a[13],n=a[14];a=a[15];return v*q*k*e-f*p*k*e-v*g*t*e+m*p*t*e+f*g*n*e-m*q*n*e-v*q*d*l+f*p*d*l+v*c*t*l-b*p*t*l-f*c*n*l+b*q*n*l+v*g*d*u-m*p*d*u-v*c*k*u+b*p*k*u+m*c*n*u-b*g*n*u-f*g*d*a+m*q*d*a+f*c*k*a-b*q*k*a-m*c*t*a+b*g*t*a},inverse:function(a,b){b||(b=a);var c=a[0],d=a[1],e=a[2],m=a[3],g=a[4],k=a[5],l=a[6],f=a[7],q=a[8],t=a[9],u=a[10],v=a[11],p=a[12],n=a[13],B=a[14];a=a[15];var x=c*k-d*g,h=c*l-e*g,r=c*f-m* g,Q=d*l-e*k,K=d*f-m*k,L=e*f-m*l,V=q*n-t*p,U=q*B-u*p,ca=q*a-v*p,ga=t*B-u*n,da=t*a-v*n,ka=u*a-v*B,Z=x*ka-h*da+r*ga+Q*ca-K*U+L*V;if(!Z)return null;Z=1/Z;b[0]=(k*ka-l*da+f*ga)*Z;b[1]=(-d*ka+e*da-m*ga)*Z;b[2]=(n*L-B*K+a*Q)*Z;b[3]=(-t*L+u*K-v*Q)*Z;b[4]=(-g*ka+l*ca-f*U)*Z;b[5]=(c*ka-e*ca+m*U)*Z;b[6]=(-p*L+B*r-a*h)*Z;b[7]=(q*L-u*r+v*h)*Z;b[8]=(g*da-k*ca+f*V)*Z;b[9]=(-c*da+d*ca-m*V)*Z;b[10]=(p*K-n*r+a*x)*Z;b[11]=(-q*K+t*r-v*x)*Z;b[12]=(-g*ga+k*U-l*V)*Z;b[13]=(c*ga-d*U+e*V)*Z;b[14]=(-p*Q+n*h-B*x)*Z;b[15]=(q* Q-t*h+u*x)*Z;return b},toRotationMat:function(a,b){b||(b=u.create());b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];b[4]=a[4];b[5]=a[5];b[6]=a[6];b[7]=a[7];b[8]=a[8];b[9]=a[9];b[10]=a[10];b[11]=a[11];b[12]=0;b[13]=0;b[14]=0;b[15]=1;return b},toMat3:function(a,b){b||(b=t.create());b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[4];b[4]=a[5];b[5]=a[6];b[6]=a[8];b[7]=a[9];b[8]=a[10];return b},toInverseMat3:function(a,b){var c=a[0],d=a[1],e=a[2],m=a[4],g=a[5],k=a[6],l=a[8],f=a[9];a=a[10];var q=a*g-k*f,u=-a*m+k*l,v=f*m- g*l,p=c*q+d*u+e*v;if(!p)return null;p=1/p;b||(b=t.create());b[0]=q*p;b[1]=(-a*d+e*f)*p;b[2]=(k*d-e*g)*p;b[3]=u*p;b[4]=(a*c-e*l)*p;b[5]=(-k*c+e*m)*p;b[6]=v*p;b[7]=(-f*c+d*l)*p;b[8]=(g*c-d*m)*p;return b},multiply:function(a,b,c){c||(c=a);var d=a[0],e=a[1],m=a[2],g=a[3],k=a[4],l=a[5],f=a[6],q=a[7],t=a[8],u=a[9],v=a[10],p=a[11],n=a[12],B=a[13],z=a[14];a=a[15];var x=b[0],h=b[1],r=b[2],K=b[3],L=b[4],V=b[5],U=b[6],ca=b[7],ga=b[8],da=b[9],ka=b[10],Z=b[11],ea=b[12],ja=b[13],aa=b[14];b=b[15];c[0]=x*d+h*k+r* t+K*n;c[1]=x*e+h*l+r*u+K*B;c[2]=x*m+h*f+r*v+K*z;c[3]=x*g+h*q+r*p+K*a;c[4]=L*d+V*k+U*t+ca*n;c[5]=L*e+V*l+U*u+ca*B;c[6]=L*m+V*f+U*v+ca*z;c[7]=L*g+V*q+U*p+ca*a;c[8]=ga*d+da*k+ka*t+Z*n;c[9]=ga*e+da*l+ka*u+Z*B;c[10]=ga*m+da*f+ka*v+Z*z;c[11]=ga*g+da*q+ka*p+Z*a;c[12]=ea*d+ja*k+aa*t+b*n;c[13]=ea*e+ja*l+aa*u+b*B;c[14]=ea*m+ja*f+aa*v+b*z;c[15]=ea*g+ja*q+aa*p+b*a;return c},multiplyVec3:function(a,b,c){c||(c=b);var d=b[0],e=b[1];b=b[2];c[0]=a[0]*d+a[4]*e+a[8]*b+a[12];c[1]=a[1]*d+a[5]*e+a[9]*b+a[13];c[2]=a[2]* d+a[6]*e+a[10]*b+a[14];return c},multiplyVec4:function(a,b,c){c||(c=b);var d=b[0],e=b[1],m=b[2];b=b[3];c[0]=a[0]*d+a[4]*e+a[8]*m+a[12]*b;c[1]=a[1]*d+a[5]*e+a[9]*m+a[13]*b;c[2]=a[2]*d+a[6]*e+a[10]*m+a[14]*b;c[3]=a[3]*d+a[7]*e+a[11]*m+a[15]*b;return c},translate:function(a,b,c){var d=b[0],e=b[1];b=b[2];var g,m,k,l,f,q,t,u,v,p,n,B;if(!c||a===c)return a[12]=a[0]*d+a[4]*e+a[8]*b+a[12],a[13]=a[1]*d+a[5]*e+a[9]*b+a[13],a[14]=a[2]*d+a[6]*e+a[10]*b+a[14],a[15]=a[3]*d+a[7]*e+a[11]*b+a[15],a;g=a[0];m=a[1];k= a[2];l=a[3];f=a[4];q=a[5];t=a[6];u=a[7];v=a[8];p=a[9];n=a[10];B=a[11];c[0]=g;c[1]=m;c[2]=k;c[3]=l;c[4]=f;c[5]=q;c[6]=t;c[7]=u;c[8]=v;c[9]=p;c[10]=n;c[11]=B;c[12]=g*d+f*e+v*b+a[12];c[13]=m*d+q*e+p*b+a[13];c[14]=k*d+t*e+n*b+a[14];c[15]=l*d+u*e+B*b+a[15];return c},scale:function(a,b,c){var d=b[0],e=b[1];b=b[2];if(!c||a===c)return a[0]*=d,a[1]*=d,a[2]*=d,a[3]*=d,a[4]*=e,a[5]*=e,a[6]*=e,a[7]*=e,a[8]*=b,a[9]*=b,a[10]*=b,a[11]*=b,a;c[0]=a[0]*d;c[1]=a[1]*d;c[2]=a[2]*d;c[3]=a[3]*d;c[4]=a[4]*e;c[5]=a[5]*e; c[6]=a[6]*e;c[7]=a[7]*e;c[8]=a[8]*b;c[9]=a[9]*b;c[10]=a[10]*b;c[11]=a[11]*b;c[12]=a[12];c[13]=a[13];c[14]=a[14];c[15]=a[15];return c},maxScale:function(a){return Math.max(Math.max(Math.sqrt(a[0]*a[0]+a[4]*a[4]+a[8]*a[8]),Math.sqrt(a[1]*a[1]+a[5]*a[5]+a[9]*a[9])),Math.sqrt(a[2]*a[2]+a[6]*a[6]+a[10]*a[10]))},rotate:function(a,b,c,d){var e=c[0],g=c[1];c=c[2];var m=Math.sqrt(e*e+g*g+c*c),k,l,f,q,t,u,v,p,n,B,z,x,C,h,r,L,V,U,ca,ga;if(!m)return null;1!==m&&(m=1/m,e*=m,g*=m,c*=m);k=Math.sin(b);l=Math.cos(b); f=1-l;b=a[0];m=a[1];q=a[2];t=a[3];u=a[4];v=a[5];p=a[6];n=a[7];B=a[8];z=a[9];x=a[10];C=a[11];h=e*e*f+l;r=g*e*f+c*k;L=c*e*f-g*k;V=e*g*f-c*k;U=g*g*f+l;ca=c*g*f+e*k;ga=e*c*f+g*k;e=g*c*f-e*k;g=c*c*f+l;d?a!==d&&(d[12]=a[12],d[13]=a[13],d[14]=a[14],d[15]=a[15]):d=a;d[0]=b*h+u*r+B*L;d[1]=m*h+v*r+z*L;d[2]=q*h+p*r+x*L;d[3]=t*h+n*r+C*L;d[4]=b*V+u*U+B*ca;d[5]=m*V+v*U+z*ca;d[6]=q*V+p*U+x*ca;d[7]=t*V+n*U+C*ca;d[8]=b*ga+u*e+B*g;d[9]=m*ga+v*e+z*g;d[10]=q*ga+p*e+x*g;d[11]=t*ga+n*e+C*g;return d},rotateX:function(a, b,c){var d=Math.sin(b);b=Math.cos(b);var e=a[4],g=a[5],m=a[6],k=a[7],l=a[8],f=a[9],q=a[10],t=a[11];c?a!==c&&(c[0]=a[0],c[1]=a[1],c[2]=a[2],c[3]=a[3],c[12]=a[12],c[13]=a[13],c[14]=a[14],c[15]=a[15]):c=a;c[4]=e*b+l*d;c[5]=g*b+f*d;c[6]=m*b+q*d;c[7]=k*b+t*d;c[8]=e*-d+l*b;c[9]=g*-d+f*b;c[10]=m*-d+q*b;c[11]=k*-d+t*b;return c},rotateY:function(a,b,c){var d=Math.sin(b);b=Math.cos(b);var e=a[0],g=a[1],k=a[2],m=a[3],l=a[8],f=a[9],q=a[10],t=a[11];c?a!==c&&(c[4]=a[4],c[5]=a[5],c[6]=a[6],c[7]=a[7],c[12]=a[12], c[13]=a[13],c[14]=a[14],c[15]=a[15]):c=a;c[0]=e*b+l*-d;c[1]=g*b+f*-d;c[2]=k*b+q*-d;c[3]=m*b+t*-d;c[8]=e*d+l*b;c[9]=g*d+f*b;c[10]=k*d+q*b;c[11]=m*d+t*b;return c},rotateZ:function(a,b,c){var d=Math.sin(b);b=Math.cos(b);var e=a[0],g=a[1],k=a[2],m=a[3],l=a[4],f=a[5],q=a[6],t=a[7];c?a!==c&&(c[8]=a[8],c[9]=a[9],c[10]=a[10],c[11]=a[11],c[12]=a[12],c[13]=a[13],c[14]=a[14],c[15]=a[15]):c=a;c[0]=e*b+l*d;c[1]=g*b+f*d;c[2]=k*b+q*d;c[3]=m*b+t*d;c[4]=e*-d+l*b;c[5]=g*-d+f*b;c[6]=k*-d+q*b;c[7]=m*-d+t*b;return c}, frustum:function(a,b,c,d,e,g,k){k||(k=u.create());var m=b-a,l=d-c,f=g-e;k[0]=2*e/m;k[1]=0;k[2]=0;k[3]=0;k[4]=0;k[5]=2*e/l;k[6]=0;k[7]=0;k[8]=(b+a)/m;k[9]=(d+c)/l;k[10]=-(g+e)/f;k[11]=-1;k[12]=0;k[13]=0;k[14]=-(g*e*2)/f;k[15]=0;return k},perspective:function(a,b,c,d,e){a=c*Math.tan(a*Math.PI/360);b*=a;return u.frustum(-b,b,-a,a,c,d,e)},ortho:function(a,b,c,d,e,g,k){k||(k=u.create());var m=b-a,l=d-c,f=g-e;k[0]=2/m;k[1]=0;k[2]=0;k[3]=0;k[4]=0;k[5]=2/l;k[6]=0;k[7]=0;k[8]=0;k[9]=0;k[10]=-2/f;k[11]=0;k[12]= -(a+b)/m;k[13]=-(d+c)/l;k[14]=-(g+e)/f;k[15]=1;return k},lookAt:function(a,b,c,d){d||(d=u.create());var e,g,k,m,l,f,q,t,v=a[0],p=a[1];a=a[2];k=c[0];m=c[1];g=c[2];q=b[0];c=b[1];e=b[2];if(v===q&&p===c&&a===e)return u.identity(d);b=v-q;c=p-c;q=a-e;t=1/Math.sqrt(b*b+c*c+q*q);b*=t;c*=t;q*=t;e=m*q-g*c;g=g*b-k*q;k=k*c-m*b;(t=Math.sqrt(e*e+g*g+k*k))?(t=1/t,e*=t,g*=t,k*=t):k=g=e=0;m=c*k-q*g;l=q*e-b*k;f=b*g-c*e;(t=Math.sqrt(m*m+l*l+f*f))?(t=1/t,m*=t,l*=t,f*=t):f=l=m=0;d[0]=e;d[1]=m;d[2]=b;d[3]=0;d[4]=g;d[5]= l;d[6]=c;d[7]=0;d[8]=k;d[9]=f;d[10]=q;d[11]=0;d[12]=-(e*v+g*p+k*a);d[13]=-(m*v+l*p+f*a);d[14]=-(b*v+c*p+q*a);d[15]=1;return d},fromRotationTranslation:function(a,b,c){c||(c=u.create());var d=a[0],e=a[1],g=a[2],k=a[3],m=d+d,l=e+e,f=g+g;a=d*m;var q=d*l,d=d*f,t=e*l,e=e*f,g=g*f,m=k*m,l=k*l,k=k*f;c[0]=1-(t+g);c[1]=q+k;c[2]=d-l;c[3]=0;c[4]=q-k;c[5]=1-(a+g);c[6]=e+m;c[7]=0;c[8]=d+l;c[9]=e-m;c[10]=1-(a+t);c[11]=0;c[12]=b[0];c[13]=b[1];c[14]=b[2];c[15]=1;return c},str:function(a){return"["+a[0]+", "+a[1]+ ", "+a[2]+", "+a[3]+", "+a[4]+", "+a[5]+", "+a[6]+", "+a[7]+", "+a[8]+", "+a[9]+", "+a[10]+", "+a[11]+", "+a[12]+", "+a[13]+", "+a[14]+", "+a[15]+"]"}},q={create:function(a){var b=new e(4);a?(b[0]=a[0],b[1]=a[1],b[2]=a[2],b[3]=a[3]):b[0]=b[1]=b[2]=b[3]=0;return b},createFrom:function(a,b,c,d){var g=new e(4);g[0]=a;g[1]=b;g[2]=c;g[3]=d;return g},set:function(a,b){b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];return b},identity:function(a){a||(a=q.create());a[0]=0;a[1]=0;a[2]=0;a[3]=1;return a}},v=q.identity(); q.calculateW=function(a,b){var c=a[0],d=a[1],e=a[2];if(!b||a===b)return a[3]=-Math.sqrt(Math.abs(1-c*c-d*d-e*e)),a;b[0]=c;b[1]=d;b[2]=e;b[3]=-Math.sqrt(Math.abs(1-c*c-d*d-e*e));return b};q.dot=function(a,b){return a[0]*b[0]+a[1]*b[1]+a[2]*b[2]+a[3]*b[3]};q.inverse=function(a,b){var c=a[0],d=a[1],e=a[2],g=a[3],c=(c=c*c+d*d+e*e+g*g)?1/c:0;if(!b||a===b)return a[0]*=-c,a[1]*=-c,a[2]*=-c,a[3]*=c,a;b[0]=-a[0]*c;b[1]=-a[1]*c;b[2]=-a[2]*c;b[3]=a[3]*c;return b};q.conjugate=function(a,b){if(!b||a===b)return a[0]*= -1,a[1]*=-1,a[2]*=-1,a;b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];b[3]=a[3];return b};q.length=function(a){var b=a[0],c=a[1],d=a[2];a=a[3];return Math.sqrt(b*b+c*c+d*d+a*a)};q.normalize=function(a,b){b||(b=a);var c=a[0],d=a[1],e=a[2];a=a[3];var g=Math.sqrt(c*c+d*d+e*e+a*a);if(0===g)return b[0]=0,b[1]=0,b[2]=0,b[3]=0,b;g=1/g;b[0]=c*g;b[1]=d*g;b[2]=e*g;b[3]=a*g;return b};q.add=function(a,b,c){if(!c||a===c)return a[0]+=b[0],a[1]+=b[1],a[2]+=b[2],a[3]+=b[3],a;c[0]=a[0]+b[0];c[1]=a[1]+b[1];c[2]=a[2]+b[2];c[3]=a[3]+ b[3];return c};q.multiply=function(a,b,c){c||(c=a);var d=a[0],e=a[1],g=a[2];a=a[3];var k=b[0],l=b[1],f=b[2];b=b[3];c[0]=d*b+a*k+e*f-g*l;c[1]=e*b+a*l+g*k-d*f;c[2]=g*b+a*f+d*l-e*k;c[3]=a*b-d*k-e*l-g*f;return c};q.multiplyVec3=function(a,b,c){c||(c=b);var d=b[0],e=b[1],g=b[2];b=a[0];var k=a[1],l=a[2];a=a[3];var f=a*d+k*g-l*e,m=a*e+l*d-b*g,q=a*g+b*e-k*d,d=-b*d-k*e-l*g;c[0]=f*a+d*-b+m*-l-q*-k;c[1]=m*a+d*-k+q*-b-f*-l;c[2]=q*a+d*-l+f*-k-m*-b;return c};q.scale=function(a,b,c){if(!c||a===c)return a[0]*=b, a[1]*=b,a[2]*=b,a[3]*=b,a;c[0]=a[0]*b;c[1]=a[1]*b;c[2]=a[2]*b;c[3]=a[3]*b;return c};q.toMat3=function(a,b){b||(b=t.create());var c=a[0],d=a[1],e=a[2],g=a[3],k=c+c,l=d+d,f=e+e;a=c*k;var m=c*l,c=c*f,q=d*l,d=d*f,e=e*f,k=g*k,l=g*l,g=g*f;b[0]=1-(q+e);b[1]=m+g;b[2]=c-l;b[3]=m-g;b[4]=1-(a+e);b[5]=d+k;b[6]=c+l;b[7]=d-k;b[8]=1-(a+q);return b};q.toMat4=function(a,b){b||(b=u.create());var c=a[0],d=a[1],e=a[2],g=a[3],k=c+c,l=d+d,f=e+e;a=c*k;var m=c*l,c=c*f,q=d*l,d=d*f,e=e*f,k=g*k,l=g*l,g=g*f;b[0]=1-(q+e);b[1]= m+g;b[2]=c-l;b[3]=0;b[4]=m-g;b[5]=1-(a+e);b[6]=d+k;b[7]=0;b[8]=c+l;b[9]=d-k;b[10]=1-(a+q);b[11]=0;b[12]=0;b[13]=0;b[14]=0;b[15]=1;return b};q.slerp=function(a,b,c,d){d||(d=a);var e=a[0]*b[0]+a[1]*b[1]+a[2]*b[2]+a[3]*b[3],g,k;if(1<=Math.abs(e))return d!==a&&(d[0]=a[0],d[1]=a[1],d[2]=a[2],d[3]=a[3]),d;g=Math.acos(e);k=Math.sqrt(1-e*e);if(.001>Math.abs(k))return d[0]=.5*a[0]+.5*b[0],d[1]=.5*a[1]+.5*b[1],d[2]=.5*a[2]+.5*b[2],d[3]=.5*a[3]+.5*b[3],d;e=Math.sin((1-c)*g)/k;c=Math.sin(c*g)/k;d[0]=a[0]*e+b[0]* c;d[1]=a[1]*e+b[1]*c;d[2]=a[2]*e+b[2]*c;d[3]=a[3]*e+b[3]*c;return d};q.fromRotationMatrix=function(a,b){b||(b=q.create());var c=a[0]+a[4]+a[8],d;if(0a[0]&&(c=1);a[8]>a[3*c+c]&&(c=2);var e=d[c],g=d[e];d=Math.sqrt(a[3*c+c]-a[3*e+e]-a[3*g+g]+1);b[c]=.5*d;d=.5/d;b[3]=(a[3*g+e]-a[3*e+g])*d;b[e]=(a[3*e+c]+a[3*c+e])*d;b[g]=(a[3*g+ c]+a[3*c+g])*d}return b};t.toQuat4=q.fromRotationMatrix;(function(){var a=t.create();q.fromAxes=function(b,c,d,e){a[0]=c[0];a[3]=c[1];a[6]=c[2];a[1]=d[0];a[4]=d[1];a[7]=d[2];a[2]=b[0];a[5]=b[1];a[8]=b[2];return q.fromRotationMatrix(a,e)}})();q.identity=function(a){a||(a=q.create());a[0]=0;a[1]=0;a[2]=0;a[3]=1;return a};q.fromAngleAxis=function(a,b,c){c||(c=q.create());a*=.5;var d=Math.sin(a);c[3]=Math.cos(a);c[0]=d*b[0];c[1]=d*b[1];c[2]=d*b[2];return c};q.toAngleAxis=function(b,c){c||(c=b);var d= b[0]*b[0]+b[1]*b[1]+b[2]*b[2];0g;++g)void 0!==a[g]&&p(a[g],b,c,d,e);return}n(b,c,0,q,k,l,g,e)}}function n(a,b,c,d,g,k,l,f){var q=k.data,m=k.offsetIdx;k=k.strideIdx;var t=a[0],u=a[1];a=a[2];var v=b[0]-t,p=b[1]-u;for(b=b[2]-a;cC){H=z*H+N*M+O*S;if(0>H||H>J)continue;M=v*F+p*r+b*w;if(0>M||H+M>J)continue}else if(J<-C){H=z*H+N*M+O*S;if(0e)return!1;g=(a[2]-d-b[2])*c[2];a=(a[5]+d-b[2])*c[2];k=Math.max(k,Math.min(g,a));e=Math.min(e,Math.max(g,a));return k<=e}function q(a,b){b=b?q(b):{};for(var c in a){var d=a[c];d&&d.forEach&&(d=v(d));null== d&&c in b||(b[c]=d)}return b}function v(a){var b=[];a.forEach(function(a){return b.push(a)});return b}Object.defineProperty(h,"__esModule",{value:!0});var x=e.mat4d.create(),m=f.create(),B=g.VertexAttrConstants;h.IDENTITY=e.mat4d.identity();h.fill=b;h.fillColor=function(a,b,c,d,e){for(var g=0;g=a[3]?0:a[3]-a[0]}function c(a){return a[1]>=a[4]?0:a[4]-a[1]}function g(a){return a[2]>=a[5]?0:a[5]-a[2]}function d(a){return 6=== a.length}Object.defineProperty(h,"__esModule",{value:!0});h.create=function(a){void 0===a&&(a=h.ZERO);return[a[0],a[1],a[2],a[3],a[4],a[5]]};h.fromExtent=function(a){return[a.xmin,a.ymin,a.zmin,a.xmax,a.ymax,a.zmax]};h.toExtent=function(a,c){return isFinite(a[2])||isFinite(a[5])?new f({xmin:a[0],xmax:a[3],ymin:a[1],ymax:a[4],zmin:a[2],zmax:a[5],spatialReference:c}):new f({xmin:a[0],xmax:a[3],ymin:a[1],ymax:a[4],spatialReference:c})};h.fromMinMax=function(a,c){return[a[0],a[1],a[2],c[0],c[1],c[2]]}; h.expand=function(b,c,e){void 0===e&&(e=b);var g=c.declaredClass;"esri.geometry.Extent"===g?(e[0]=Math.min(b[0],c.xmin),e[1]=Math.min(b[1],c.ymin),e[3]=Math.max(b[3],c.xmax),e[4]=Math.max(b[4],c.ymax),c.hasZ&&(e[2]=Math.min(b[2],c.zmin),e[5]=Math.max(b[5],c.zmax))):"esri.geometry.Point"===g?(e[0]=Math.min(b[0],c.x),e[1]=Math.min(b[1],c.y),e[3]=Math.max(b[3],c.x),e[4]=Math.max(b[4],c.y),c.hasZ&&(e[2]=Math.min(b[2],c.z),e[5]=Math.max(b[5],c.z))):d(c)?(e[0]=Math.min(b[0],c[0]),e[1]=Math.min(b[1],c[1]), e[2]=Math.min(b[2],c[2]),e[3]=Math.max(b[3],c[3]),e[4]=Math.max(b[4],c[4]),e[5]=Math.max(b[5],c[5])):a.is(c)?(e[0]=Math.min(b[0],c[0]),e[1]=Math.min(b[1],c[1]),e[3]=Math.max(b[3],c[2]),e[4]=Math.max(b[4],c[3])):Array.isArray(c)&&(2===c.length?(e[0]=Math.min(b[0],c[0]),e[1]=Math.min(b[1],c[1]),e[3]=Math.max(b[3],c[0]),e[4]=Math.max(b[4],c[1])):3===c.length&&(e[0]=Math.min(b[0],c[0]),e[1]=Math.min(b[1],c[1]),e[2]=Math.min(b[2],c[2]),e[3]=Math.max(b[3],c[0]),e[4]=Math.max(b[4],c[1]),e[5]=Math.max(b[5], c[2])));return e};h.expandBuffer=function(a,c,d,e,g){void 0===g&&(g=a);var b=a[0],k=a[1],l=a[2],f=a[3],p=a[4];a=a[5];for(var m=0;mb;b++)if(!isFinite(a[b]))return!1;return!0};h.width=e;h.depth=c;h.height=g;h.center=function(a,d){void 0===d&&(d=[0,0,0]);d[0]=a[0]+ e(a)/2;d[1]=a[1]+c(a)/2;d[2]=a[2]+g(a)/2;return d};h.size=function(a,d){void 0===d&&(d=[0,0,0]);d[0]=e(a);d[1]=c(a);d[2]=g(a);return d};h.containsPoint=function(a,c){return c[0]>=a[0]&&c[1]>=a[1]&&c[2]>=a[2]&&c[0]<=a[3]&&c[1]<=a[4]&&c[2]<=a[5]};h.containsPointWithMargin=function(a,c,d){return c[0]>=a[0]-d&&c[1]>=a[1]-d&&c[2]>=a[2]-d&&c[0]<=a[3]+d&&c[1]<=a[4]+d&&c[2]<=a[5]+d};h.contains=function(a,c){return c[0]>=a[0]&&c[1]>=a[1]&&c[2]>=a[2]&&c[3]<=a[3]&&c[4]<=a[4]&&c[5]<=a[5]};h.intersects=function(a, c){return Math.max(c[0],a[0])<=Math.min(c[3],a[3])&&Math.max(c[1],a[1])<=Math.min(c[4],a[4])&&Math.max(c[2],a[2])<=Math.min(c[5],a[5])};h.offset=function(a,c,d,e,g){void 0===g&&(g=a);g[0]=a[0]+c;g[1]=a[1]+d;g[2]=a[2]+e;g[3]=a[3]+c;g[4]=a[4]+d;g[5]=a[5]+e;return g};h.setMin=function(a,c,d){void 0===d&&(d=a);d[0]=c[0];d[1]=c[1];d[2]=c[2];d!==a&&(d[3]=a[3],d[4]=a[4],d[5]=a[5]);return d};h.setMax=function(a,c,d){void 0===d&&(d=a);d[3]=c[0];d[4]=c[1];d[5]=c[2];d!==a&&(d[0]=a[0],d[1]=a[1],d[2]=a[2]);return a}; h.set=function(a,c){a[0]=c[0];a[1]=c[1];a[2]=c[2];a[3]=c[3];a[4]=c[4];a[5]=c[5];return a};h.toRect=function(b,c){c||(c=a.create());c[0]=b[0];c[1]=b[1];c[2]=b[3];c[3]=b[4];return c};h.fromRect=function(a,c){a[0]=c[0];a[1]=c[1];a[3]=c[2];a[4]=c[3];return a};h.is=d;h.isPoint=function(a){return 0===e(a)&&0===c(a)&&0===g(a)};h.equals=function(a,c,e){if(null==a||null==c)return a===c;if(!d(a)||!d(c))return!1;if(e)for(var b=0;b=a[2]?0:a[2]-a[0]}function e(a){return a[1]>=a[3]?0:a[3]-a[1]}function c(a){return 4===a.length}Object.defineProperty(h,"__esModule",{value:!0});h.create=function(a){void 0=== a&&(a=h.ZERO);return[a[0],a[1],a[2],a[3]]};h.fromExtent=function(a){return[a.xmin,a.ymin,a.xmax,a.ymax]};h.expand=function(a,d,b){void 0===b&&(b=a);var e=d.declaredClass;"esri.geometry.Extent"===e?(b[0]=Math.min(a[0],d.xmin),b[1]=Math.min(a[1],d.ymin),b[2]=Math.max(a[2],d.xmax),b[3]=Math.max(a[3],d.ymax)):"esri.geometry.Point"===e?(b[0]=Math.min(a[0],d.x),b[1]=Math.min(a[1],d.y),b[2]=Math.max(a[2],d.x),b[3]=Math.max(a[3],d.y)):c(d)?(b[0]=Math.min(a[0],d[0]),b[1]=Math.min(a[1],d[1]),b[2]=Math.max(a[2], d[2]),b[3]=Math.max(a[3],d[3])):!Array.isArray(d)||2!==d.length&&3!==d.length||(b[0]=Math.min(a[0],d[0]),b[1]=Math.min(a[1],d[1]),b[2]=Math.max(a[2],d[0]),b[3]=Math.max(a[3],d[1]));return b};h.allFinite=function(a){for(var c=0;4>c;c++)if(!isFinite(a[c]))return!1;return!0};h.width=a;h.height=e;h.center=function(c,d){void 0===d&&(d=[0,0]);d[0]=c[0]+a(c)/2;d[1]=c[1]+e(c)/2;return d};h.containsPoint=function(a,c){return c[0]>=a[0]&&c[1]>=a[1]&&c[0]<=a[2]&&c[1]<=a[3]};h.containsPointWithMargin=function(a, c,b){return c[0]>=a[0]-b&&c[1]>=a[1]-b&&c[0]<=a[2]+b&&c[1]<=a[3]+b};h.intersects=function(a,c){return Math.max(c[0],a[0])<=Math.min(c[2],a[2])&&Math.max(c[1],a[1])<=Math.min(c[3],a[3])};h.contains=function(a,c){return c[0]>=a[0]&&c[2]<=a[2]&&c[1]>=a[1]&&c[3]<=a[3]};h.intersection=function(a,c,b){void 0===b&&(b=a);var d=c[0],e=c[1],g=c[2];c=c[3];b[0]=f.clamp(a[0],d,g);b[1]=f.clamp(a[1],e,c);b[2]=f.clamp(a[2],d,g);b[3]=f.clamp(a[3],e,c);return b};h.offset=function(a,c,b,e){void 0===e&&(e=a);e[0]=a[0]+ c;e[1]=a[1]+b;e[2]=a[2]+c;e[3]=a[3]+b;return e};h.setMin=function(a,c,b){void 0===b&&(b=a);b[0]=c[0];b[1]=c[1];b!==a&&(b[2]=a[2],b[3]=a[3]);return b};h.setMax=function(a,c,b){void 0===b&&(b=a);b[2]=c[0];b[3]=c[1];b!==a&&(b[0]=a[0],b[1]=a[1]);return a};h.set=function(a,c){a[0]=c[0];a[1]=c[1];a[2]=c[2];a[3]=c[3];return a};h.is=c;h.isPoint=function(c){return(0===a(c)||!isFinite(c[0]))&&(0===e(c)||!isFinite(c[1]))};h.equals=function(a,d,b){if(null==a||null==d)return a===d;if(!c(a)||!c(d))return!1;if(b)for(var e= 0;e=d||(c+1===d&&k===g?b.range[1]=e:a.push({range:[d,e],options:g}))}function d(a){void 0===a&&(a=!0);return{isVisibleBit:!a,data:new Uint32Array(0)}}function b(a,b){return l(a,b,!0)}function k(a,b){return l(a,b,!1)}function l(a,b,c){var d=!1;a=a||u;d=a.isVisibleBit;a=a.data;b=t(b);var e=8*a.BYTES_PER_ELEMENT, g=a.length*e;c=c===d;if(0===a.length||0===b)d=!c;else if(gk&&a&&!l?c.push([b[k],b[f]-1]):l&&(l=c[c.length-1],l[1]=b[a?f:Math.min(f,k)]-1)}else c=[],c=a.isVisibleBit?c:null;else c=null;return c}; h.addHighlight=function(a,b,c,d){a=a||[];b={component:b,options:c,id:d};a.push(b);b=e(b);for(c=a.length-1;0r;r++)q.push(Math.pow(2, r)-1);h.componentCount=t;h.componentFind=function(a,b){a=f.binaryIndexOf(a,b,!0);return 0<=a?a:null}})},"esri/views/3d/webgl-engine/lib/screenSizePerspectiveUtils":function(){define(["require","exports","./Util"],function(r,h,f){function a(a){return Math.abs(a*a*a)}function e(b,c,d,e){void 0===e&&(e=l);var g=d.parameters;d=d.paddingPixelsOverride;e.scale=Math.min(g.divisor/(c-g.offset),1);e.factor=a(b);e.minPixelSize=g.minPixelSize;e.paddingPixels=d;return e}function c(a,b){return 0===a?b.minPixelSize: b.minPixelSize*(1+2*b.paddingPixels/a)}function g(a,b){return Math.max(f.lerp(a*b.scale,a,b.factor),c(a,b))}function d(a,b,c){a=e(a,b,c);a.minPixelSize=0;a.paddingPixels=0;return g(1,a)}Object.defineProperty(h,"__esModule",{value:!0});h.getSettings=function(a){return new b(a,h.defaultDescription)};h.getLabelSettings=function(a){var c=h.defaultDescription.curvatureDependent;return new b(a,{curvatureDependent:{min:{curvature:c.min.curvature,tiltAngle:c.min.tiltAngle,scaleFallOffFactor:k.curvatureDependent.min.scaleFallOffFactor}, max:{curvature:c.max.curvature,tiltAngle:c.max.tiltAngle,scaleFallOffFactor:k.curvatureDependent.max.scaleFallOffFactor}},scaleStart:h.defaultDescription.scaleStart,scaleFallOffRange:h.defaultDescription.scaleFallOffRange,minPixelSize:k.minPixelSize})};h.perspectiveFactor=a;h.scaleFactor=e;h.applyScaleFactor=g;h.applyScaleFactorVec2=function(a,b,d){void 0===d&&(d=[0,0]);var e=Math.min(Math.max(b.scale,c(a[1],b)/a[1]),1);d[0]=f.lerp(a[0]*e,a[0],b.factor);d[1]=f.lerp(a[1]*e,a[1],b.factor);return d}; h.precomputeScale=d;h.precomputeScaleFactor=function(a,b,c,e){e.scale=d(a,b,c);e.factor=0;e.minPixelSize=c.parameters.minPixelSize;e.paddingPixels=c.paddingPixelsOverride;return e};h.applyPrecomputedScaleFactorVec2=function(a,b,d){void 0===d&&(d=[0,0]);b=Math.min(Math.max(b.scale,c(a[1],b)/a[1]),1);d[0]=a[0]*b;d[1]=a[1]*b;return d};h.scale=function(a,b,c,d){return g(a,e(b,c,d))};var b=function(){function a(a,b,c,d){void 0===c&&(c={camera:{distance:0,fovY:0},divisor:0,offset:0,minPixelSize:0,paddingPixels:0}); this.viewingMode=a;this.description=b;this.parameters=c;this._paddingPixelsOverride=d;"local"===this.viewingMode?(this.coverageCompensation=this.surfaceCoverageCompensationLocal,this.calculateCurvatureDependentParameters=this.calculateCurvatureDependentParametersLocal):(this.coverageCompensation=this.surfaceCoverageCompensationGlobal,this.calculateCurvatureDependentParameters=this.calculateCurvatureDependentParametersGlobal)}Object.defineProperty(a.prototype,"paddingPixelsOverride",{get:function(){return this._paddingPixelsOverride|| this.parameters.paddingPixels},enumerable:!0,configurable:!0});a.prototype.update=function(a){if(this.parameters&&this.parameters.camera.fovY===a.fovY&&this.parameters.camera.distance===a.distance)return!1;this.calculateParameters(a,this.parameters);return!0};a.prototype.overridePadding=function(b){return b!==this.paddingPixelsOverride?new a(this.viewingMode,this.description,this.parameters,b):this};a.prototype.calculateParameters=function(a,b){var c=this.description,d=c.scaleStart,e=c.scaleFallOffRange, c=c.minPixelSize,g=a.fovY,k=a.distance,f=this.calculateCurvatureDependentParameters(a),l=this.coverageCompensation(a,f),q=f.tiltAngle,f=f.scaleFallOffFactor,k=Math.sin(q)*k,q=.5*Math.PI-q-g*(.5-d*l),d=k/Math.cos(q),e=(d-k/Math.cos(q+g*e*l)*f)/(1-f);b.camera.fovY=a.fovY;b.camera.distance=a.distance;b.offset=e;b.divisor=d-e;b.minPixelSize=c;return b};a.prototype.calculateCurvatureDependentParametersLocal=function(a,b){void 0===b&&(b=p);b.tiltAngle=this.description.curvatureDependent.min.tiltAngle;b.scaleFallOffFactor= this.description.curvatureDependent.min.scaleFallOffFactor;return b};a.prototype.calculateCurvatureDependentParametersGlobal=function(a,b){void 0===b&&(b=p);var c=this.description.curvatureDependent;a=1+a.distance/n;var d=[c.min.curvature,c.max.curvature],e=d[0];a=f.clamp((Math.sqrt(a*a-1)-e)/(d[1]-e),0,1);d=[c.min,c.max];c=d[0];d=d[1];b.tiltAngle=f.lerp(c.tiltAngle,d.tiltAngle,a);b.scaleFallOffFactor=f.lerp(c.scaleFallOffFactor,d.scaleFallOffFactor,a);return b};a.prototype.surfaceCoverageCompensationLocal= function(a,b){return(a.fovY-b.tiltAngle)/a.fovY};a.prototype.surfaceCoverageCompensationGlobal=function(a,b){var c=n*n;b=b.tiltAngle+.5*Math.PI;var d=a.fovY;a=a.distance;a=a*a+c-2*Math.cos(b)*a*n;var e=Math.sqrt(a);return(Math.acos(Math.sqrt(a-c)/e)-Math.asin(n/(e/Math.sin(b)))+.5*d)/d};return a}();h.defaultDescription={curvatureDependent:{min:{curvature:f.deg2rad(10),tiltAngle:f.deg2rad(12),scaleFallOffFactor:.5},max:{curvature:f.deg2rad(70),tiltAngle:f.deg2rad(40),scaleFallOffFactor:.8}},scaleStart:.3, scaleFallOffRange:.65,minPixelSize:0};var k={curvatureDependent:{min:{scaleFallOffFactor:.7},max:{scaleFallOffFactor:.95}},minPixelSize:14};h.copyParameters=function(a,b){b.camera.distance=a.camera.distance;b.camera.fovY=a.camera.fovY;b.divisor=a.divisor;b.offset=a.offset;b.minPixelSize=a.minPixelSize;return b};var l={scale:0,factor:0,minPixelSize:0,paddingPixels:0},p={tiltAngle:0,scaleFallOffFactor:0},n=6378137})},"esri/views/webgl/Util":function(){define(["require","exports","../../core/tsSupport/assignHelper", "../../core/Error"],function(r,h,f,a){return function(){function e(){}e.vertexCount=function(a,g){return a.vertexBuffers[g].size/e.getStride(a.layout[g])};e.getStride=function(a){return a[0].stride};e.getBytesPerElement=function(a){switch(a){case 5126:return 4;case 5124:return 4;case 5125:return 4;case 5122:return 2;case 5123:return 2;case 5120:return 1;case 5121:return 1;default:throw Error("Unknown data type");}};e.addDescriptor=function(a,g,d,b,k,f){var c=e.getBytesPerElement(b);if(0a&&console.error("Buffer size cannot be negative!"),34963===this._bufferType&&e)switch(this._indexType=e,this._size=a,e){case 5123:a*=2;break;case 5125:a*=4}}else e=a.byteLength,a instanceof Uint16Array&&(e/=2,this._indexType=5123),a instanceof Uint32Array&&(e/=4,this._indexType=5125),this._size=e;e=this._context.getBoundVAO();this._context.bindVAO(null);this._context.bindBuffer(this);this._context.gl.bufferData(this._bufferType, a,this._usage);this._context.bindVAO(e)}};f.prototype.setSubData=function(a,e,c,g){void 0===e&&(e=0);void 0===c&&(c=0);if(a){(0>e||e>=this._size)&&console.error("offset is out of range!");var d=e,b=c,k=g,f=a.byteLength;a instanceof Uint16Array&&(f/=2,d*=2,b*=2,k*=2);a instanceof Uint32Array&&(f/=4,d*=4,b*=4,k*=4);void 0===g&&(g=f-1);c>=g&&console.error("end must be bigger than start!");e+c-g>this._size&&console.error("An attempt to write beyond the end of the buffer!");e=this._context.getBoundVAO(); this._context.bindVAO(null);this._context.bindBuffer(this);this._context.gl.bufferSubData(this._bufferType,d,(a instanceof ArrayBuffer?a:a.buffer).slice(b,k));this._context.bindVAO(e)}};f._nextId=0;return f}()})},"esri/views/webgl/VertexArrayObject":function(){define(["require","exports"],function(r,h){return function(){function f(a,e,c,g,d){this._locations=this._layout=this._glName=this._context=null;this._indexBuffer=this._buffers=void 0;this._initialized=!1;this._context=a;this._layout=c;this._buffers= g;this._locations=e;d&&(this._indexBuffer=d);this._id=f._nextId++}Object.defineProperty(f.prototype,"id",{get:function(){return this._id},enumerable:!0,configurable:!0});Object.defineProperty(f.prototype,"glName",{get:function(){return this._glName},enumerable:!0,configurable:!0});Object.defineProperty(f.prototype,"vertexBuffers",{get:function(){return this._buffers},enumerable:!0,configurable:!0});Object.defineProperty(f.prototype,"indexBuffer",{get:function(){return this._indexBuffer},enumerable:!0, configurable:!0});Object.defineProperty(f.prototype,"size",{get:function(){var a=this;return Object.keys(this._buffers).reduce(function(e,c){return e+a._buffers[c].size},this._indexBuffer?this._indexBuffer.size:0)},enumerable:!0,configurable:!0});Object.defineProperty(f.prototype,"layout",{get:function(){return this._layout},enumerable:!0,configurable:!0});Object.defineProperty(f.prototype,"locations",{get:function(){return this._locations},enumerable:!0,configurable:!0});f.prototype.dispose=function(a){void 0=== a&&(a=!0);if(this._context){var e=this._context.capabilities.vao;e&&this._glName&&(e.deleteVertexArray(this._glName),this._glName=null);this._context.getBoundVAO()===this&&this._context.bindVAO(null);if(a){for(var c in this._buffers)this._buffers[c].dispose(),delete this._buffers[c];this._indexBuffer&&(this._indexBuffer.dispose(),this._indexBuffer=null)}this._context=null}};f.prototype.initialize=function(){if(!this._initialized){var a=this._context.capabilities.vao;if(a){var e=a.createVertexArray(); a.bindVertexArray(e);this._bindLayout();a.bindVertexArray(null);this._glName=e}this._initialized=!0}};f.prototype.bind=function(){this.initialize();var a=this._context.capabilities.vao;a?a.bindVertexArray(this.glName):(this._context.bindVAO(null),this._bindLayout())};f.prototype._bindLayout=function(){var a=this._buffers,e=!!this._context.capabilities.vao,c=this._layout,g=this._indexBuffer;a||console.error("Vertex buffer dictionary is empty!");var d=this._context.gl,b,k,f=0,p;for(p in a)for((b=a[p])|| console.error("Vertex buffer is uninitialized!"),(k=c[p])||console.error("Vertex element descriptor is empty!"),this._context.bindBuffer(b),f=0;f=b.count){if(d.enableVertexAttribArray(n),d.vertexAttribPointer(n, b.count,b.type,b.normalized,b.stride,b.offset+t),b.divisor&&0q;q++)d.enableVertexAttribArray(n+q),d.vertexAttribPointer(n+q,4,b.type,b.normalized,b.stride,b.offset+16*q+t),b.divisor&&0g)return!1;c.cross(a,b,d);c.normalize(d);c.cross(d,a,e);c.normalize(e);return!0}var c=a.vec3,g=a.vec4,d=a.vec3d,b=f.VertexAttrConstants,k=h.Vec3Compact,l=d.create(), p=d.create(),n={createSphereGeometry:function(a,d,e,g,k,l,p){a=a||50;g=void 0!==g?g:-Math.PI;k=void 0!==k?k:2*Math.PI;l=void 0!==l?l:.5*-Math.PI;p=void 0!==p?p:Math.PI;var q=Math.max(3,Math.floor(d)||8),m=Math.max(2,Math.floor(e)||6),t=(q+1)*(m+1);e=new Float32Array(3*t);d=new Float32Array(3*t);var t=new Float32Array(2*t),n,u,v=[],x=c.create(),h=0;for(u=0;u<=m;u++){var B=[],M=u/m,H=l+M*p,J=Math.cos(H);for(n=0;n<=q;n++){var O=n/q,N=g+O*k,S=Math.cos(N)*J*a,R=Math.sin(H)*a,N=-Math.sin(N)*J*a;e[3*h]= S;e[3*h+1]=R;e[3*h+2]=N;c.set3(S,R,N,x);c.normalize(x);d[3*h]=x[0];d[3*h+1]=x[1];d[3*h+2]=x[2];t[2*h]=O;t[2*h+1]=M;B.push(h);++h}v.push(B)}a=new Uint32Array(2*q*(m-1)*3);for(u=h=0;uc&&(b=c+(c=b,0));var d=b.toString()+"."+c.toString();if(l[d])return l[d];var e=f.length;f.length+=3;k.add(f,3*b,f,3*c,f,e);k.scale(f,e,a/k.length(f,e));e/=3;return l[d]=e}var g,f;d?(f=[0,-1,0,1,0,0,0,0,1,-1,0,0,0,0,-1,0,1,0],d=[0,1,2,0,2,3,0,3,4,0,4,1,1,5,2,2,5,3,3,5,4,4,5,1]):(d=a*(1+Math.sqrt(5))/2,f=[-a,d,0,a,d,0,-a,-d,0,a,-d,0,0,-a,d,0,a,d,0,-a,-d,0,a,-d,d,0,-a,d,0,a,-d,0,-a,-d,0,a], d=[0,11,5,0,5,1,0,1,7,0,7,10,0,10,11,1,5,9,5,11,4,11,10,2,10,7,6,7,1,8,3,9,4,3,4,2,3,2,6,3,6,8,3,8,9,4,9,5,2,4,11,6,2,10,8,6,7,9,8,1]);for(g=0;gc;c++)for(d=0;3>d;d++)e[3*c+d]=a[c][d];else e[0]=-1,e[1]=-1,e[2]=0,e[3]=1,e[4]=-1,e[5]=0,e[6]=1,e[7]=1,e[8]=0,e[9]=-1,e[10]=1,e[11]=0;d=new Uint32Array(6);d[0]=0;d[1]= 1;d[2]=2;d[3]=2;d[4]=3;d[5]=0;a=new Float32Array(3);a[0]=0;a[1]=0;a[2]=1;var g=new Uint32Array(6);for(c=0;6>c;c++)g[c]=0;c=new Float32Array(8);c[0]=0;c[1]=0;c[2]=1;c[3]=0;c[4]=1;c[5]=1;c[6]=0;c[7]=1;var k=new Uint8Array(4);k[0]=255;k[1]=255;k[2]=255;k[3]=255;var f={};f[b.POSITION]=d;f[b.NORMAL]=g;f[b.UV0]=d;f[b.COLOR]=g;d={};d[b.POSITION]={size:3,data:e};d[b.NORMAL]={size:3,data:a};d[b.UV0]={size:2,data:c};d[b.COLOR]={size:4,data:k};return new r(d,f)},createBoxGeometry:function(){var a,c,d=[[-.5, -.5,.5],[.5,-.5,.5],[.5,.5,.5],[-.5,.5,.5],[-.5,-.5,-.5],[.5,-.5,-.5],[.5,.5,-.5],[-.5,.5,-.5]],e=[0,0,1,-1,0,0,1,0,0,0,-1,0,0,1,0,0,0,-1],g=[0,0,1,0,1,1,0,1],k=[0,1,2,2,3,0,4,0,3,3,7,4,1,5,6,6,2,1,1,0,4,4,5,1,3,2,6,6,7,3,5,4,7,7,6,5],f=Array(36);for(a=0;6>a;a++)for(c=0;6>c;c++)f[6*a+c]=a;var l=Array(36);for(a=0;6>a;a++)l[6*a+0]=0,l[6*a+1]=1,l[6*a+2]=2,l[6*a+3]=2,l[6*a+4]=3,l[6*a+5]=0;return function(a){var c;Array.isArray(a)||(a=[a,a,a]);var q=new Float32Array(24);for(c=0;8>c;c++)q[3*c]=d[c][0]* a[0],q[3*c+1]=d[c][1]*a[1],q[3*c+2]=d[c][2]*a[2];a={};a[b.POSITION]=new Uint32Array(k);a[b.NORMAL]=new Uint32Array(f);a[b.UV0]=new Uint32Array(l);c={};c[b.POSITION]={size:3,data:q};c[b.NORMAL]={size:3,data:new Float32Array(e)};c[b.UV0]={size:2,data:new Float32Array(g)};return new r(c,a)}}(),createDiamondGeometry:function(){var a=[[-.5,0,-.5],[.5,0,-.5],[.5,0,.5],[-.5,0,.5],[0,-.5,0],[0,.5,0]],c=[0,1,-1,1,1,0,0,1,1,-1,1,0,0,-1,-1,1,-1,0,0,-1,1,-1,-1,0],d=[5,1,0,5,2,1,5,3,2,5,0,3,4,0,1,4,1,2,4,2,3, 4,3,0],e=[0,0,0,1,1,1,2,2,2,3,3,3,4,4,4,5,5,5,6,6,6,7,7,7];return function(g){var k;Array.isArray(g)||(g=[g,g,g]);var f=new Float32Array(18);for(k=0;6>k;k++)f[3*k]=a[k][0]*g[0],f[3*k+1]=a[k][1]*g[1],f[3*k+2]=a[k][2]*g[2];g={};g[b.POSITION]=new Uint32Array(d);g[b.NORMAL]=new Uint32Array(e);k={};k[b.POSITION]={size:3,data:f};k[b.NORMAL]={size:3,data:new Float32Array(c)};return new r(k,g)}}(),createTetrahedronGeometry:function(){var a=c.createFrom(-.5,0,-.5),d=c.createFrom(.5,0,-.5),e=c.createFrom(0, 0,.5),g=c.createFrom(0,.5,0),k=c.create(),f=c.create(),l=c.create(),p=c.create(),n=c.create();c.subtract(a,g,k);c.subtract(a,d,f);c.cross(k,f,l);c.normalize(l,l);c.subtract(d,g,k);c.subtract(d,e,f);c.cross(k,f,p);c.normalize(p,p);c.subtract(e,g,k);c.subtract(e,a,f);c.cross(k,f,n);c.normalize(n,n);var h=[a,d,e,g],D=[0,-1,0,l[0],l[1],l[2],p[0],p[1],p[2],n[0],n[1],n[2]],E=[0,1,2,3,1,0,3,2,1,3,0,2],F=[0,0,0,1,1,1,2,2,2,3,3,3];return function(a){var c;Array.isArray(a)||(a=[a,a,a]);var d=new Float32Array(12); for(c=0;4>c;c++)d[3*c]=h[c][0]*a[0],d[3*c+1]=h[c][1]*a[1],d[3*c+2]=h[c][2]*a[2];a={};a[b.POSITION]=new Uint32Array(E);a[b.NORMAL]=new Uint32Array(F);c={};c[b.POSITION]={size:3,data:d};c[b.NORMAL]={size:3,data:new Float32Array(D)};return new r(c,a)}}(),createConeGeometry:function(a,d,e,g){var k=0,f=c.createFrom(0,k,0),l=c.createFrom(0,k+a,0),q=c.createFrom(0,-1,0),p=c.createFrom(0,1,0);g&&(k=a,l=c.createFrom(0,0,0),f=c.createFrom(0,k,0),q=c.createFrom(0,1,0),p=c.createFrom(0,-1,0));var f=[l,f],q=[q, p],p=e+2,n=0,l=Math.sqrt(a*a+d*d);if(g)for(g=e-1;0<=g;g--)n=2*Math.PI/e*g,t=c.createFrom(Math.cos(n)*d,k,Math.sin(n)*d),f.push(t),n=c.createFrom(a*Math.cos(n)/l,-d/l,a*Math.sin(n)/l),q.push(n);else for(g=0;g1-c.dot(l,p))&&c.set3(0,0,1,p);var n=c.create();c.cross(l,p,n);c.normalize(n);c.cross(n,l,p);var m=2*e+(f?2:0),t=e+(f?2:0);k=new Float32Array(3*m);a=new Float32Array(3*t);var u=new Float32Array(2* m),v=new Uint32Array(3*e*(f?4:2)),h=new Uint32Array(3*e*(f?4:2));f&&(k[3*(m-2)+0]=q[0],k[3*(m-2)+1]=q[1],k[3*(m-2)+2]=q[2],u[2*(m-2)]=0,u[2*(m-2)+1]=0,k[3*(m-1)+0]=k[3*(m-2)+0]+g[0],k[3*(m-1)+1]=k[3*(m-2)+1]+g[1],k[3*(m-1)+2]=k[3*(m-2)+2]+g[2],u[2*(m-1)]=1,u[2*(m-1)+1]=1,a[3*(t-2)+0]=-l[0],a[3*(t-2)+1]=-l[1],a[3*(t-2)+2]=-l[2],a[3*(t-1)+0]=l[0],a[3*(t-1)+1]=l[1],a[3*(t-1)+2]=l[2]);var l=function(a,b,c){v[a]=b;h[a]=c},x,M,H=0,J=c.create(),O=c.create();for(x=0;xja;ja++)P[H++]=G[M-6+ja]-q;da+=t}ka=k[k.length-1];for(q=0;qp;p++)d[g++]=a[l][p];0p;p++)d[n++]=c[l][p];g[b.NORMAL]=e;k[b.NORMAL]={size:3,data:d}}return new r(k,g,r.DefaultOffsets,"line")},addVertexColors:function(a,c){var d,e=c||[1,1,1,1];c=new Uint8Array(4);c[0]=255*e[0];c[1]=255*e[1];c[2]=255*e[2];c[3]=255*(3f||null==a){for(;c>f;)f*=2;a=new Uint32Array(f);for(var e=0;e>8&255,n>>16&255,n>>24&255)),null}var u=1;d[2]&131072&&!1!==l&&(u=Math.max(1,d[7]));l=d[4];var q=d[3],v=d[1]+4,h,m;b.samplingMode=1>1);q=Math.max(1,q>>1)}return b}})},"esri/views/webgl/Texture":function(){define(["require","exports"],function(r,h){return function(){function f(a,e,c){this._glName=this._context=null;this._id=-1;this._desc=void 0;this._wrapModeDirty=this._samplingModeDirty=!1;this._boundToUnits=new Set;this._context=a;this._desc={pixelFormat:e.pixelFormat,internalFormat:e.internalFormat,dataType:e.dataType,target:e.target?e.target:3553,samplingMode:e.samplingMode? e.samplingMode:9729,wrapMode:e.wrapMode?e.wrapMode:10497,maxAnisotropy:e.maxAnisotropy,flipped:void 0!==e.flipped?e.flipped:!1,hasMipmap:void 0!==e.hasMipmap?e.hasMipmap:!1,level:void 0!==e.level?e.level:0,unpackAlignment:e.unpackAlignment?e.unpackAlignment:4,width:e.width,height:e.height,preMultiplyAlpha:void 0!==e.preMultiplyAlpha?e.preMultiplyAlpha:!1};this._id=++f._nextId;this.setData(c)}Object.defineProperty(f.prototype,"id",{get:function(){return this._id},enumerable:!0,configurable:!0});Object.defineProperty(f.prototype, "glName",{get:function(){return this._glName},enumerable:!0,configurable:!0});Object.defineProperty(f.prototype,"descriptor",{get:function(){return this._desc},enumerable:!0,configurable:!0});f.prototype.dispose=function(){var a=this;if(this._context){if(this._glName){var e=this._context.gl;this._boundToUnits.forEach(function(c){a._context.bindTexture(null,c)});e.deleteTexture(this._glName);this._glName=null}this._context=null}};f.prototype.resize=function(a,e){var c=this._desc;if(c.width!==a||c.height!== e)c.width=a,c.height=e,this.setData(null)};f.prototype.setData=function(a){var e=this._context.gl;this._glName||(this._glName=e.createTexture());void 0===a&&(a=null);null===a&&(this._desc.width=this._desc.width||4,this._desc.height=this._desc.height||4);var c=this._context.getBoundTexture(0);this._context.bindTexture(this,0);var g=this._desc;f._validateTexture(g);e.pixelStorei(e.UNPACK_ALIGNMENT,g.unpackAlignment);e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,g.flipped?1:0);e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL, g.preMultiplyAlpha);if(a instanceof ImageData||a instanceof HTMLImageElement||a instanceof HTMLCanvasElement||a instanceof HTMLVideoElement)g.width&&g.height&&console.assert(a.width===g.width&&a.height===g.height),e.texImage2D(e.TEXTURE_2D,g.level,g.internalFormat?g.internalFormat:g.pixelFormat,g.pixelFormat,g.dataType,a),void 0===this._desc.width&&(this._desc.width=a.width),void 0===this._desc.height&&(this._desc.height=a.height);else{null!=g.width&&null!=g.height||console.error("Width and height must be specified!"); var d=g.internalFormat?g.internalFormat:g.pixelFormat,b=g.pixelFormat;e.DEPTH24_STENCIL8&&d===e.DEPTH_STENCIL&&(d=e.DEPTH24_STENCIL8);e.texImage2D(e.TEXTURE_2D,g.level,d,g.width,g.height,0,b,g.dataType,a)}g.hasMipmap&&this.generateMipmap();f._applySamplingMode(e,this._desc);f._applyWrapMode(e,this._desc);f._applyAnisotropicFilteringParameters(this._context,this._desc);this._context.bindTexture(c,0)};f.prototype.updateData=function(a,e,c,g,d,b){b||console.error("An attempt to use uninitialized data!"); this._glName||console.error("An attempt to update uninitialized texture!");var k=this._context.gl,f=this._desc,p=this._context.getBoundTexture(0);this._context.bindTexture(this,0);(0>e||0>c||g>f.width||d>f.height||e+g>f.width||c+d>f.height)&&console.error("An attempt to update out of bounds of the texture!");b instanceof ImageData||b instanceof HTMLImageElement||b instanceof HTMLCanvasElement||b instanceof HTMLVideoElement?(console.assert(b.width===g&&b.height===d),k.texSubImage2D(k.TEXTURE_2D,a, e,c,f.pixelFormat,f.dataType,b)):k.texSubImage2D(k.TEXTURE_2D,a,e,c,g,d,f.pixelFormat,f.dataType,b);this._context.bindTexture(p,0)};f.prototype.generateMipmap=function(){var a=this._desc;a.hasMipmap||(a.hasMipmap=!0,f._validateTexture(a));9729===a.samplingMode?(this._samplingModeDirty=!0,a.samplingMode=9985):9728===a.samplingMode&&(this._samplingModeDirty=!0,a.samplingMode=9984);a=this._context.getBoundTexture(0);this._context.bindTexture(this,0);var e=this._context.gl;e.generateMipmap(e.TEXTURE_2D); this._context.bindTexture(a,0)};f.prototype.setSamplingMode=function(a){a!==this._desc.samplingMode&&(this._desc.samplingMode=a,f._validateTexture(this._desc),this._samplingModeDirty=!0)};f.prototype.setWrapMode=function(a){a!==this._desc.wrapMode&&(this._desc.wrapMode=a,f._validateTexture(this._desc),this._wrapModeDirty=!0)};f.prototype.applyChanges=function(){var a=this._context.gl,e=this._desc;this._samplingModeDirty&&(f._applySamplingMode(a,e),this._samplingModeDirty=!1);this._wrapModeDirty&& (f._applyWrapMode(a,e),this._wrapModeDirty=!1)};f.prototype.setBoundToUnit=function(a,e){e?this._boundToUnits.add(a):this._boundToUnits.delete(a)};f._isPowerOfTwo=function(a){return 0===(a&a-1)};f._validateTexture=function(a){(0>a.width||0>a.height)&&console.error("Negative dimension parameters are not allowed!");f._isPowerOfTwo(a.width)&&f._isPowerOfTwo(a.height)||(33071!==a.wrapMode&&console.error("Non-power-of-two textures must have a wrap mode of CLAMP_TO_EDGE!"),a.hasMipmap&&console.error("Mipmapping requires power-of-two textures!"))}; f._applySamplingMode=function(a,e){var c=e.samplingMode;if(9985===c||9987===c)c=9729;else if(9984===c||9986===c)c=9728;a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MAG_FILTER,c);a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MIN_FILTER,e.samplingMode)};f._applyWrapMode=function(a,e){a.texParameteri(a.TEXTURE_2D,a.TEXTURE_WRAP_S,e.wrapMode);a.texParameteri(a.TEXTURE_2D,a.TEXTURE_WRAP_T,e.wrapMode)};f._applyAnisotropicFilteringParameters=function(a,e){if(null!=e.maxAnisotropy){var c=a.capabilities.textureFilterAnisotropic; c&&(a=a.gl,a.texParameterf(a.TEXTURE_2D,c.TEXTURE_MAX_ANISOTROPY,e.maxAnisotropy))}};f._nextId=0;return f}()})},"esri/views/3d/webgl-engine/lib/DefaultVertexBufferLayouts":function(){define(["require","exports"],function(r,h){Object.defineProperty(h,"__esModule",{value:!0});h.Pos3=[{name:"position",count:3,type:5126,offset:0,stride:12,normalized:!1}];h.Pos3Tex=[{name:"position",count:3,type:5126,offset:0,stride:20,normalized:!1},{name:"uv0",count:2,type:5126,offset:12,stride:20,normalized:!1}];h.Pos3Col= [{name:"position",count:3,type:5126,offset:0,stride:16,normalized:!1},{name:"color",count:4,type:5121,offset:12,stride:16,normalized:!1}];h.Pos2=[{name:"position",count:2,type:5126,offset:0,stride:8,normalized:!1}];h.Pos2Tex=[{name:"position",count:2,type:5126,offset:0,stride:16,normalized:!1},{name:"uv0",count:2,type:5126,offset:8,stride:16,normalized:!1}]})},"esri/views/3d/webgl-engine/lib/glUtil3D":function(){define("require exports ./DefaultVertexAttributeLocations ./DefaultVertexBufferLayouts ../../../webgl/BufferObject ../../../webgl/Texture ../../../webgl/VertexArrayObject".split(" "), function(r,h,f,a,e,c,g){Object.defineProperty(h,"__esModule",{value:!0});h.createQuadVAO=function(c,b){void 0===b&&(b=a.Pos2);var d=b===a.Pos3Tex?new Float32Array([-1,-1,0,0,0,1,-1,0,1,0,-1,1,0,0,1,1,1,0,1,1]):new Float32Array([-1,-1,1,-1,-1,1,1,1]);return new g(c,f.Default3D,{geometry:b},{geometry:e.createVertex(c,35044,d)})};h.createEmptyTexture=function(a){return new c(a,{target:3553,pixelFormat:6408,dataType:5121,samplingMode:9728,width:4,height:4})}})},"esri/views/3d/webgl-engine/lib/IdGen":function(){define(["require", "exports"],function(r,h){return function(){function f(){this._count=0}f.prototype.gen=function(a){null==a&&(a="a");return a+"_"+this._count++};return f}()})},"esri/views/webgl/FramebufferObject":function(){define(["require","exports","./Texture"],function(r,h,f){return function(){function a(e,c,g,d){this._colorAttachment=this._stencilAttachment=this._depthAttachment=this._glName=this._context=null;this._initialized=!1;this._context=e;this._desc={colorTarget:c.colorTarget,depthStencilTarget:c.depthStencilTarget, width:c.width,height:c.height,multisampled:c.multisampled};this._id=a._nextId++;g&&(e=void 0,g instanceof f?(this._colorAttachment=g,e=g.descriptor):(e=g,this._colorAttachment=new f(this._context,e)),0!==this._desc.colorTarget&&console.error("Framebuffer is initialized with a texture however the descriptor indicates using a renderbuffer color attachment!"),a._validateTextureDimensions(e,this._desc));d&&(this._context.capabilities.depthTexture||console.error("Extension WEBGL_depth_texture isn't supported therefore it is no possible to set the depth/stencil texture as an attachment!"), g=void 0,d instanceof f?(this._depthStencilTexture=d,g=this._depthStencilTexture.descriptor):(g=d,this._depthStencilTexture=new f(this._context,g)),a._validateTextureDimensions(g,this._desc))}a.create=function(e,c){return new a(e,c)};a.createWithAttachments=function(e,c,g,d){return new a(e,g,c,d)};Object.defineProperty(a.prototype,"id",{get:function(){return this._id},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"glName",{get:function(){return this._glName},enumerable:!0,configurable:!0}); Object.defineProperty(a.prototype,"descriptor",{get:function(){return this._desc},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"colorTexture",{get:function(){return this._colorAttachment instanceof f?this._colorAttachment:null},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"depthStencilTexture",{get:function(){return this._depthStencilTexture},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"width",{get:function(){return this._desc.width}, enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"height",{get:function(){return this._desc.height},enumerable:!0,configurable:!0});a.prototype.dispose=function(){this._context&&this._glName&&(this._disposeColorAttachment(),this._disposeDepthStencilAttachments(),this._context.gl.deleteFramebuffer(this._glName),this._glName=null)};a.prototype.attachColorTexture=function(e){if(e){a._validateTextureDimensions(e.descriptor,this._desc);this._disposeColorAttachment();if(this._initialized){this._context.bindFramebuffer(this); var c=this._context.gl;c.framebufferTexture2D(c.FRAMEBUFFER,c.COLOR_ATTACHMENT0,c.TEXTURE_2D,e.glName,0)}this._colorAttachment=e}};a.prototype.detachColorTexture=function(){var a=void 0;if(this._colorAttachment instanceof f){a=this._colorAttachment;if(this._initialized){this._context.bindFramebuffer(this);var c=this._context.gl;this._context.gl.framebufferTexture2D(c.FRAMEBUFFER,c.COLOR_ATTACHMENT0,c.TEXTURE_2D,null,0)}this._colorAttachment=null}return a};a.prototype.attachDepthStencilTexture=function(e){if(e){var c= e.descriptor;34041!==c.pixelFormat&&console.error("Depth/Stencil texture must have a pixel type of DEPTH_STENCIL!");34042!==c.dataType&&console.error("Depth/Stencil texture must have data type of UNSIGNED_INT_24_8_WEBGL!");this._context.capabilities.depthTexture||console.error("Extension WEBGL_depth_texture isn't supported therefore it is no possible to set the depth/stencil texture!");a._validateTextureDimensions(c,this._desc);4!==this._desc.depthStencilTarget&&(this._desc.depthStencilTarget=4); this._disposeDepthStencilAttachments();this._initialized&&(this._context.bindFramebuffer(this),c=this._context.gl,c.framebufferTexture2D(c.FRAMEBUFFER,c.DEPTH_STENCIL_ATTACHMENT,c.TEXTURE_2D,e.glName,0));this._depthStencilTexture=e}};a.prototype.detachDepthStencilTexture=function(){var a=this._depthStencilTexture;if(a&&this._initialized){this._context.bindFramebuffer(this);var c=this._context.gl;this._context.gl.framebufferTexture2D(c.FRAMEBUFFER,c.DEPTH_STENCIL_ATTACHMENT,c.TEXTURE_2D,null,0)}this._depthStencilTexture= null;return a};a.prototype.copyToTexture=function(a,c,g,d,b,k,f){(0>a||0>c||0>b||0>k)&&console.error("Offsets cannot be negative!");(0>=g||0>=d)&&console.error("Copy width and height must be greater than zero!");var e=this._desc,l=f.descriptor;3553!==f.descriptor.target&&console.error("Texture target must be TEXTURE_2D!");(a+g>e.width||c+d>e.height||b+g>l.width||k+d>l.height)&&console.error("Bad dimensions, the current input values will attempt to read or copy out of bounds!");e=this._context;e.bindTexture(f); e.bindFramebuffer(this);e.gl.copyTexSubImage2D(3553,0,b,k,a,c,g,d)};a.prototype.readPixels=function(a,c,g,d,b,k,f){(0>=g||0>=d)&&console.error("Copy width and height must be greater than zero!");f||console.error("Target memory is not initialized!");this._context.bindFramebuffer(this);this._context.gl.readPixels(a,c,g,d,b,k,f)};a.prototype.resize=function(e,c){var g=this._desc;if(g.width!==e||g.height!==c)if(this._initialized)g.width=e,g.height=c,this._colorAttachment instanceof f?(d=this._colorAttachment, g=d.descriptor,g.width=e,g.height=c,this._colorAttachment.dispose(),this._colorAttachment=new f(this._context,g),a._validateTextureDimensions(d.descriptor,this._desc)):this._colorAttachment&&this._disposeColorAttachment(),null!=this._depthStencilTexture?(g=this._depthStencilTexture.descriptor,g.width=e,g.height=c,this._depthStencilTexture.dispose(),this._depthStencilTexture=new f(this._context,g)):(this._depthAttachment||this._stencilAttachment)&&this._disposeDepthStencilAttachments(),this._context.getBoundFramebufferObject()=== this&&this._context.bindFramebuffer(null),this._initialized=!1;else{g.width=e;g.height=c;if(this._colorAttachment instanceof f){var d=this._colorAttachment;d.resize(e,c)}this._depthStencilTexture&&this._depthStencilTexture.resize(e,c)}};a.prototype.initialize=function(){if(this._initialized)return!1;var a=this._context.gl;this._glName&&a.deleteFramebuffer(this._glName);var c=a.createFramebuffer(),g=this._desc;a.bindFramebuffer(a.FRAMEBUFFER,c);if(!this._colorAttachment)if(0===g.colorTarget)this._colorAttachment= new f(this._context,{target:3553,pixelFormat:6408,dataType:5121,samplingMode:9728,wrapMode:33071,width:g.width,height:g.height});else{var d=a.createRenderbuffer();a.bindRenderbuffer(a.RENDERBUFFER,d);a.renderbufferStorage(a.RENDERBUFFER,a.RGBA4,g.width,g.height);a.framebufferRenderbuffer(a.FRAMEBUFFER,a.COLOR_ATTACHMENT0,a.RENDERBUFFER,d);this._colorAttachment=d}this._colorAttachment instanceof f&&a.framebufferTexture2D(a.FRAMEBUFFER,a.COLOR_ATTACHMENT0,a.TEXTURE_2D,this._colorAttachment.glName,0); switch(g.depthStencilTarget){case 1:case 3:d=a.createRenderbuffer();a.bindRenderbuffer(a.RENDERBUFFER,d);var b=1===g.depthStencilTarget?a.DEPTH_ATTACHMENT:a.DEPTH_STENCIL_ATTACHMENT;a.renderbufferStorage(a.RENDERBUFFER,1===g.depthStencilTarget?a.DEPTH_COMPONENT16:a.DEPTH_STENCIL,g.width,g.height);a.framebufferRenderbuffer(a.FRAMEBUFFER,b,a.RENDERBUFFER,d);this._depthAttachment=d;break;case 2:d=a.createRenderbuffer();a.bindRenderbuffer(a.RENDERBUFFER,d);a.renderbufferStorage(a.RENDERBUFFER,a.STENCIL_INDEX8, g.width,g.height);a.framebufferRenderbuffer(a.FRAMEBUFFER,a.STENCIL_ATTACHMENT,a.RENDERBUFFER,d);this._stencilAttachment=d;break;case 4:this._depthStencilTexture||(this._context.capabilities.depthTexture||console.error("Extension WEBGL_depth_texture isn't supported therefore it is no possible to set the depth/stencil texture as an attachment!"),this._depthStencilTexture=new f(this._context,{target:3553,pixelFormat:34041,dataType:34042,samplingMode:9728,wrapMode:33071,width:g.width,height:g.height})), a.framebufferTexture2D(a.FRAMEBUFFER,a.DEPTH_STENCIL_ATTACHMENT,a.TEXTURE_2D,this._depthStencilTexture.glName,0)}a.checkFramebufferStatus(a.FRAMEBUFFER)!==a.FRAMEBUFFER_COMPLETE&&console.error("Framebuffer is incomplete!");this._glName=c;return this._initialized=!0};a.prototype._disposeColorAttachment=function(){if(this._colorAttachment instanceof f){var a=this._colorAttachment;if(this._initialized){this._context.bindFramebuffer(this);var c=this._context.gl;c.framebufferTexture2D(c.FRAMEBUFFER,c.COLOR_ATTACHMENT0, c.TEXTURE_2D,null,0)}a.dispose()}else this._colorAttachment instanceof WebGLRenderbuffer&&(a=this._colorAttachment,c=this._context.gl,this._initialized&&(this._context.bindFramebuffer(this),c.framebufferRenderbuffer(c.FRAMEBUFFER,c.COLOR_ATTACHMENT0,c.RENDERBUFFER,null)),this._context.gl.deleteRenderbuffer(a));this._colorAttachment=null};a.prototype._disposeDepthStencilAttachments=function(){var a=this._context.gl;if(this._depthAttachment){if(this._initialized){this._context.bindFramebuffer(this); var c=this._context.gl;c.framebufferRenderbuffer(c.FRAMEBUFFER,1===this._desc.depthStencilTarget?c.DEPTH_ATTACHMENT:c.DEPTH_STENCIL_ATTACHMENT,c.RENDERBUFFER,null)}a.deleteRenderbuffer(this._depthAttachment);this._depthAttachment=null}this._stencilAttachment&&(this._initialized&&(this._context.bindFramebuffer(this),c=this._context.gl,c.framebufferRenderbuffer(c.FRAMEBUFFER,c.STENCIL_ATTACHMENT,c.RENDERBUFFER,null)),a.deleteRenderbuffer(this._stencilAttachment),this._stencilAttachment=null);this._depthStencilTexture&& (this._initialized&&(this._context.bindFramebuffer(this),a=this._context.gl,a.framebufferTexture2D(a.FRAMEBUFFER,a.DEPTH_STENCIL_ATTACHMENT,a.TEXTURE_2D,null,0)),this._depthStencilTexture.dispose(),this._depthStencilTexture=null)};a._validateTextureDimensions=function(a,c){console.assert(0<=a.width&&0<=a.height);3553!==a.target&&console.error("Texture type must be TEXTURE_2D!");void 0!==c.width&&0<=c.width&&void 0!==c.height&&0<=c.height?c.width===a.width&&c.height===a.height||console.error("Color attachment texture must match the framebuffer's!"): (c.width=a.width,c.height=a.height)};a._nextId=0;return a}()})},"esri/views/3d/webgl-engine/lib/GLTextureRep":function(){define(["require","exports","../../../../core/Logger","./Util","../../../webgl/Texture"],function(r,h,f,a,e){var c=f.getLogger("esri.views.3d.webgl-engine.lib.GLTextureRep"),g=function(){function c(a){this._glTexture=null;this._refCount=0;this._glTexture=a}c.prototype.incRefCnt=function(){++this._refCount};c.prototype.decRefCnt=function(){--this._refCount;a.assert(0<=this._refCount)}; c.prototype.getRefCnt=function(){return this._refCount};c.prototype.setGLTexture=function(a){this._glTexture=a};c.prototype.getGLTexture=function(){return this._glTexture};return c}();return function(){function d(a,c,d,e){this.NUM_PARALLEL=8;this.textures=a;this._programRepository=c;this.getViewportToRestore=d;this._rctx=e;this.NUM_PARALLEL=8;this.id2textureRef={};this.loading={};this._queue=[];this.listeners=[];this.maxMaxAnisotropy=(this.afExt=e.capabilities.textureFilterAnisotropic)?e.parameters.maxMaxAnisotropy: 1;this.maxAnisotropy=Math.min(8,this.maxMaxAnisotropy);this._needsRender=!0;this._fallbackTextureData=new Uint8Array(256);this._fallbackTextureTransparentData=new Uint8Array(256);for(a=0;aa&&(c=(" "+a).slice(-3));return c};e.prototype._addLineNumbers=function(a){var c=2;return a.replace(/\n/g,function(){return"\n"+e._padToThree(c++)+":"})};e.prototype._loadShader=function(c){var e=35633===c,d=e?this._vertexShaderSource:this._fragmentShaderSource,b;b="";for(var k in this._defines)b+="#define "+k+" "+this._defines[k]+"\n";b+=d;"webgl2"===this._context.contextVersion&& (b=a.transpileShader(b,e?"vertex":"fragment"));e=this._context.gl;c=e.createShader(c);e.shaderSource(c,b);e.compileShader(c);e.getShaderParameter(c,e.COMPILE_STATUS)||(console.error(e.getShaderInfoLog(c)),console.error(this._addLineNumbers(b)),"webgl2"===this._context.contextVersion&&(console.log("Shader source before transpilation:"),console.log(d)));return c};e._matrix4Equal=function(a,e){return a[0]===e[0]&&a[1]===e[1]&&a[2]===e[2]&&a[3]===e[3]&&a[4]===e[4]&&a[5]===e[5]&&a[6]===e[6]&&a[7]===e[7]&& a[8]===e[8]&&a[9]===e[9]&&a[10]===e[10]&&a[11]===e[11]&&a[12]===e[12]&&a[13]===e[13]&&a[14]===e[14]&&a[15]===e[15]};e._matrix3Equal=function(a,e){return a[0]===e[0]&&a[1]===e[1]&&a[2]===e[2]&&a[3]===e[3]&&a[4]===e[4]&&a[5]===e[5]&&a[6]===e[6]&&a[7]===e[7]&&a[8]===e[8]};e._arraysEqual=function(a,e){if(a.length!==e.length)return!1;for(var c=0;cthis._earthRadius||ag?(k=.001953125, f=.1015625):500>g?(l=(g-50)/450,k=.001953125*(1-l)+.001953125*l,f=.1015625*(1-l)+.21875*l):5E3>g?(l=(g-500)/4500,k=.001953125*(1-l)+.001953125*l,f=.21875*(1-l)+.51171875*l):5E4>g&&(l=(g-5E3)/45E3,k=.001953125*(1-l)+.001953125*l,f=.51171875*(1-l)+.4140625*l);g=A+k*D;l=A+e*f*D;50v.length2(k)&&v.cross(a,c,k);v.scale(k,g/v.length(k));v.cross(k,a,f);v.scale(f,g/v.length(f));return g},_computeScreenRimWidth:function(a,b,c,e){var g=m.create();m.lookAt(a, c,b,g);a=this.view.state.camera;d.project(c,g,a.projectionMatrix,a.viewport);d.project(e,g,a.projectionMatrix,a.viewport);return v.dist(c,e)/a.height},_createRibbonGeometryData:function(){for(var a=new Float32Array(768),b=new Uint32Array(768),c=0;128>c;c++){var d=6*c;a[d+0]=c;a[d+1]=z;a[d+2]=0;a[d+3]=c;a[d+4]=C;a[d+5]=1;var e=2*c,g=127===c?0:e+2;b[d+0]=e;b[d+1]=e+1;b[d+2]=g+1;b[d+3]=g+1;b[d+4]=g;b[d+5]=e}c={};c[B.POSITION]=b;b={};b[B.POSITION]={size:3,data:a};return{indices:c,vertexAttr:b}}})})}, "esri/views/3d/environment/Stars":function(){define("dojo/text!./materials/StarMaterial.xml require ../../../request ../../../core/watchUtils ../../../core/promiseUtils ../../../core/Error ../../../core/Logger ../lib/glMatrix ../support/ExternalRenderer ../webgl-engine/lib/GeometryRenderer ../webgl-engine/lib/Util ../webgl-engine/materials/internal/MaterialUtil ../webgl-engine/lib/RenderPass ../webgl-engine/lib/RenderSlot ../../webgl/Program ../webgl-engine/lib/DefaultVertexAttributeLocations ../../webgl/Util".split(" "), function(r,h,f,a,e,c,g,d,b,k,l,p,n,t,u,q,v){var x=d.mat4d;d=d.mat3d;var m=l.VertexAttrConstants,B="9bb2ff;9eb5ff;aabfff;bbccff;ccd8ff ;dae2ff;e4e9ff;eeefff;f8f6ff;fff9fb;fff5ef;fff1e5;ffeddb;ffe9d2;ffe6ca;ffe3c3;ffe0bb;ffddb4;ffdaad;ffd6a5;ffd29c;ffcc8f;ffc178;ffa94b;ff7b00".split(";"),z=g.getLogger("esri.views.3d.environment.Stars"),C=d.toMat4(d.createFrom(1,0,0,0,.9174771405229186,.39778850739794974,0,-.39778850739794974,.9174771405229186)),A=d.toMat4(d.createFrom(1,0,0,0,.9174771405229186,-.39778850739794974, 0,.39778850739794974,.9174771405229186)),D=null;return b.createSubclass({properties:{view:{},numBinaryFloats:{value:2},numBinaryUInt8:{value:1},bytesPerStar:{value:9},needsRender:{value:!1},slot:{value:t.BACKGROUND,set:function(a){this.needsRender=!0;this._set("slot",a)}}},constructor:function(){this._renderData={model:x.identity()};this.slot=t.BACKGROUND;this._vertexBufferLayout=[{name:"position",count:3,type:5126,offset:0,stride:20,normalized:!1},{name:"color",count:4,type:5121,offset:12,stride:20, normalized:!1},{name:"size",count:1,type:5126,offset:16,stride:20,normalized:!1}]},initialize:function(){this._loadDataPromise=this._loadBrightStarCatalogue();this.addResolvingPromise(this._loadDataPromise)},destroy:function(){this._loadDataPromise.isFulfilled()||this._loadDataPromise.cancel("Atmosphere has been removed.");this._dateHandle&&(this._dateHandle.remove(),this._dateHandle=null);this._program&&(this._program.dispose(),this._program=null)},setup:function(b){this._numStars=this._starData.byteLength/ this.bytesPerStar;var c=new Float32Array(this._starData,0,this._numStars*this.numBinaryFloats),d=new Uint8Array(this._starData,this._numStars*this.numBinaryFloats*4,this._numStars*this.numBinaryUInt8),c=this._createStarGeometryData(c,d);this._renderer=new k(c,this._vertexBufferLayout,this._fillInterleaved,b.rctx);this._renderer.enablePointRendering(!0);this._dateHandle=a.init(this,"view.environment.lighting.date",this._update.bind(this));b.shaderSnippets.vertexShaderStar||b.shaderSnippets._parse(r); this._program=new u(b.rctx,b.shaderSnippets.vertexShaderStar,b.shaderSnippets.fragmentShaderStar,q.Default3D)},render:function(a){if(a.slot!==this.slot||a.pass!==n.MATERIAL)return!1;var b=this.renderContext.rctx,c=b.gl,d=this._program;b.bindProgram(d);d.setUniformMatrix4fv("view",a.camera.viewMatrix);d.setUniformMatrix4fv("proj",a.camera.projectionMatrix);d.setUniform4fv("viewport",a.camera.fullViewport);d.setUniformMatrix4fv("model",this._renderData.model);b.setDepthTestEnabled(!0);b.setDepthFunction(c.LEQUAL); b.setBlendingEnabled(!0);b.setBlendFunctionSeparate(c.SRC_ALPHA,c.ONE_MINUS_SRC_ALPHA,c.ONE,c.ONE_MINUS_SRC_ALPHA);b.setDepthWriteEnabled(!1);this._renderer.render(d);b.setBlendingEnabled(!1);b.setDepthWriteEnabled(!0);b.setDepthFunction(c.LESS);return!0},_fillInterleaved:function(a,b,c,d,e,g,k){var f=v.getStride(e);c=f/4;var l=p.fill,q=a.indices[m.POSITION],n=a.vertexAttr[m.POSITION].data;d=k+v.findAttribute(e,"position").offset/4;for(var t=0;ta)throw new c("stars:invalid-data","Failed to create stars because star catalogue data is invalid");},_loadBrightStarCatalogue:function(){return D?(this._starData=D,e.resolve()):f(h.toUrl("./resources/stars.wsv"), {responseType:"array-buffer",failOk:!0}).then(function(a){a=a.data;this._verifyStartData(a);this._starData=D=a}.bind(this)).catch(function(a){z.error("loadBrightStarCatalogue",a.message);throw a;})}})})},"esri/views/3d/support/sunUtils":function(){define(["./mathUtils","../lib/glMatrix","../lib/SunCalc"],function(r,h,f){var a=h.vec3d,e=h.mat4d,c=r.lerp,g=e.identity(),d={azimuth:0,altitude:0},b={local:{altitude:1500,ambientAtNight:.1,ambientAtNoon:.45,ambientAtTwilight:.2,diffuseAtNoon:.65,diffuseAtTwilight:.7}, global:{altitude:8E5,ambient:.015,diffuse:.75},planarDirection:{localAltitude:1E4,globalAltitude:1E6,globalAngles:{azimuth:Math.PI/3,altitude:Math.PI/3}}},k={ambient:{color:a.create(),intensity:0},diffuse:{color:a.create(),intensity:0,direction:a.create()}},l={settings:b,computeDirection:function(b,c,k,q){q||(q=a.create());var p=e.identity(g);if("global"===k)f.getPosition(b,0,0,d),a.set3(0,0,-1,q),e.rotateX(p,-d.azimuth),e.rotateY(p,-d.altitude);else{var n=l.settings.planarDirection;k=n.globalAngles; n=(Math.abs(c.z)-n.localAltitude)/(n.globalAltitude-n.localAltitude);n=r.clamp(n,0,1);1>n?(f.getPosition(b,c.y,c.x,d),d.azimuth=(1-n)*d.azimuth+n*k.azimuth,d.altitude=(1-n)*d.altitude+n*k.altitude):(d.azimuth=k.azimuth,d.altitude=k.altitude);a.set3(0,-1,0,q);e.rotateZ(p,-d.azimuth);e.rotateX(p,-d.altitude)}e.multiplyVec3(p,q);return q},computeShadowsEnabled:function(a,b){return"global"===b?!0:Math.abs(a.z)t){q=d.valueOf();var m,h;e.polarException===f.POLAR_EXCEPTION.MIDNIGHT_SUN?(m=q-36E5*(d.getHours()+48)-6E4*d.getMinutes(),h=m+432E6):e.polarException===f.POLAR_EXCEPTION.POLAR_NIGHT?(m=q-2,h=q-1):(m=e.sunrise.valueOf(), h=e.sunset.valueOf());var z=h-m;n=m+z/2;var C=z/4;g=n-C;var C=n+C,A=.06*z,z=m-A/2;m+=A/2;var D=h-A/2,E=h+A/2;h=b.local;var F=[.01,h.ambientAtNight],I=[.8,.8,1],P=[.01,.01,.01],G=[h.diffuseAtTwilight,h.ambientAtTwilight],M=[1,.75,.75],H=[.8,.8,1],J=[.9*h.diffuseAtNoon,h.ambientAtNoon],O=[1,.98,.98],N=[.98,.98,1],S=[h.diffuseAtNoon,h.ambientAtNoon],R=[1,1,1],Y=[1,1,1];h=[0,0];var X=[0,0],A=[0,0];qE?(h=F,X=P,A=I):qa?B.POLAR_EXCEPTION.MIDNIGHT_SUN:1=c&&4>l&&(l=4,c=l/f);1E-6>Math.abs(f-l)||(f=e.vec3d.length(b.center),this.sphere.radius!==f&&e.vec3d.scale(b.center,(this.sphere.radius+c*(f-this.sphere.radius))/f),e.vec3d.scale(this.tmpViewDir,-c),e.vec3d.add(b.center,this.tmpViewDir,b.eye),a.applyAll(this.view,b,this.constraintOptions),1E-12=Math.abs(a)?0:a}function d(b,c,d,e){b.renderCoordsHelper.worldUpAtPosition(c.eye,e);a.vec3d.scale(e,d);return e}Object.defineProperty(h, "__esModule",{value:!0});h.apply=function(b,t,u,q){void 0===u&&(u=f.defaultApplyOptions);void 0===q&&(q=t);q!==t&&q.copyFrom(t);var n=g(b,t,u);if(0===n)return!1;var h=b.renderCoordsHelper,m=h.getAltitude(t.eye)+n;b=f.interactionDirectionTowardsConstraintMinimization(b,t,u.interactionDirection,d(b,t,c.sign(n),l),k);u=a.vec3d.set(t.viewForward,p);h.intersectManifold(t.eye,b,m,q.eye)||h.setAltitude(m,q.eye);e.closestPointOnRay(t.eye,u,t.center,t.center);q.markViewDirty();return!0};h.error=g;var b={min:0, max:0},k=a.vec3d.create(),l=a.vec3d.create(),p=a.vec3d.create()})},"esri/views/3d/camera/constraintUtils/common":function(){define(["require","exports","../../lib/glMatrix","../../support/mathUtils"],function(r,h,f,a){Object.defineProperty(h,"__esModule",{value:!0});h.hasConstraintType=function(a,c){return 0!==(a&c)};h.adjustRangeForInteraction=function(a,c,g,d,b,k){0!==a&&(g?(k.min=Math.min(k.min,c),k.max=Math.max(k.max,c)):null!=d?(k.min-=Math.max(0,(c-k.min)*(1-d)),k.max+=Math.max(0,(c-k.max)* (1-d))):b&&(k.min-=Math.max(0,c-k.min-b),k.max+=Math.max(0,c-k.max-b)))};h.defaultApplyOptions={selection:0,interactionType:0,interactionFactor:0,interactionStartCamera:null,interactionDirection:null};h.interactionDirectionTowardsConstraintMinimization=function(e,c,g,d,b){g||(g=c.viewForward);f.vec3d.set(g,b);f.vec3d.scale(b,a.sign(f.vec3d.dot(g,d)));return b}})},"esri/views/3d/support/intersectionUtils":function(){define(["../lib/glMatrix"],function(r){function h(c,d,b,e){e.clip[0]=0;e.clip[1]=b? e.len:Number.MAX_VALUE;for(b=0;bf&&0<=t?g=!1:-1E-6t?g=!0:!(0>f||0>t)||0>f&&0>t?(f/=t,0g.clip[0]&&(g.clip[0]=f),g=g.clip[0]<=g.clip[1]):g=!0;if(!g)return!1}return!0}function f(c,d,b,k){c?(b&&k&&(e.len=a.dist(d,b)),a.set(c,e.dir)):k?(e.len=a.dist(d,b),a.scale(a.subtract(b,d,e.dir),1/e.len)):a.normalize(a.subtract(b,d,e.dir));return e}var a=r.vec3d;r=r.vec2d;var e={dir:a.create(), len:0,clip:r.create()},c={planeSphere:function(a,c,b){return a[0]*c[0]+a[1]*c[1]+a[2]*c[2]+a[3]e;e++)if(!c.planeSphere(a[e],d,b))return!1;return!0},frustumRay:function(a,c,b,e){b=f(e,c,b,!1);return h(a,c,null,b)},frustumPoint:function(c,d){for(var b=0;6>b;b++){var e=c[b];if(0>-a.dot(d,e)-e[3])return!1}return!0},frustumLineSegment:function(a,c,b,e){e=f(e,c,b,!0);return h(a,c,b,e)},closestPointOnRay:function(c,d,b,e){b=a.dot(d,a.subtract(b,c,e));a.add(c, a.scale(d,b,e),e);return e}};return c})},"esri/views/3d/camera/constraintUtils/distance":function(){define(["require","exports","./common","../../lib/glMatrix","../../webgl-engine/lib/Util"],function(r,h,f,a,e){function c(b,d,e){void 0===e&&(e=f.defaultApplyOptions);if(!b.state.isLocal)return 0;var k=b.state.constraints.distance;if(!b.pointsOfInterest.surfaceOrigin.renderLocation||Infinity===k)return 0;g.min=0;g.max=k;var k=g,l=e.interactionType;if(0!==l){var p=k.min,n=k.max,t=e.interactionStartCamera; e=e.interactionFactor;var l=1===l||4===l,h=c(b,t),t=0===h?0:a.vec3d.dist(t.eye,b.pointsOfInterest.surfaceOrigin.renderLocation);k.min=p;k.max=n;f.adjustRangeForInteraction(h,t,l,e,.05*t,k)}b=a.vec3d.dist(d.eye,b.pointsOfInterest.surfaceOrigin.renderLocation);b=g.max-b;return-1E-6<=b?0:b}Object.defineProperty(h,"__esModule",{value:!0});h.error=c;h.apply=function(g,n,t,u){void 0===t&&(t=f.defaultApplyOptions);void 0===u&&(u=n);u!==n&&u.copyFrom(n);var q=c(g,n,t);if(0===q)return!1;var p=g.pointsOfInterest.surfaceOrigin, q=a.vec3d.dist(n.eye,g.pointsOfInterest.surfaceOrigin.renderLocation)+q,h=a.vec3d.set(n.eye,d);t=f.interactionDirectionTowardsConstraintMinimization(g,n,t.interactionDirection,a.vec3d.direction(g.pointsOfInterest.surfaceOrigin.renderLocation,n.eye,l),k);return e.raySphere(n.eye,t,p.renderLocation,q,u.eye)?(n=a.vec3d.subtract(u.eye,h,b),a.vec3d.add(u.center,n),u.markViewDirty(),n=g.renderCoordsHelper.getAltitude(u.center),g.renderCoordsHelper.intersectManifold(u.eye,u.viewForward,n,u.center),u.markViewDirty(), !0):!1};var g={min:0,max:0},d=a.vec3d.create(),b=a.vec3d.create(),k=a.vec3d.create(),l=a.vec3d.create()})},"esri/views/3d/camera/constraintUtils/surfaceCollision":function(){define(["require","exports","../intersectionUtils","../../lib/glMatrix"],function(r,h,f,a){Object.defineProperty(h,"__esModule",{value:!0});h.apply=function(c,g,d,b){void 0===d&&(d=0);void 0===b&&(b=g);var k=c.state.constraints;g!==b&&b.copyFrom(g);if(!k.collision.enabled)return!1;var l=f.surfaceElevationBelowEye(c,g);g=c.renderCoordsHelper.getAltitude(g.eye); k=k.collision.elevationMargin;if(g-l>=k)return!1;a.vec3d.subtract(b.center,b.eye,e);c.renderCoordsHelper.setAltitude(l+k,b.eye);1===d&&a.vec3d.add(b.eye,e,b.center);b.markViewDirty();return!0};var e=a.vec3d.create()})},"esri/views/3d/camera/intersectionUtils":function(){define("require exports ../../../geometry/Point ../lib/glMatrix ../support/aaBoundingRect ../support/earthUtils ../webgl-engine/lib/Selector".split(" "),function(r,h,f,a,e,c,g){function d(d,e,k,f){void 0===f&&(f=a.vec3d.create()); var l=b[d.viewingMode];l||(l=new g(d.viewingMode),l.enableBackfacesTerrain=!d.state.isGlobal,l.enableInvisibleTerrain=!0,b[d.viewingMode]=l);d._stage.pickRay(e,k,null,null,null,null,l);if((l=l.getMinResult())&&l.getIntersectionPoint(f))return f;l=a.vec3d.direction(k,e,n);if(!d.renderCoordsHelper.intersectManifold(e,l,0,f))if("global"===d.viewingMode){d=f;var l=a.vec3d.dot(e,e),q=c.earthRadius*c.earthRadius,l=l>q?Math.sqrt(l-q)/3:1;a.vec3d.subtract(k,e,d);a.vec3d.scale(d,l/a.vec3d.length(d),d);a.vec3d.add(d, e)}else k!==f&&a.vec3d.set(k,f);return f}Object.defineProperty(h,"__esModule",{value:!0});h.eyeWithinExtent=function(a,b,c,d){return a.renderCoordsHelper.fromRenderCoords(b.eye,k,d)&&e.containsPoint(c,k)};h.surfaceElevationBelowEye=function(a,b){return a.renderCoordsHelper.fromRenderCoords(b.eye,p,a.basemapTerrain.spatialReference)?a.basemapTerrain.getElevation(p)||0:0};h.cameraOnContentAlongViewDirection=function(b,c,e,g){var k=b.state.camera.copy();c&&(k.eye=c);e&&(k.center=e);g&&(k.up=g);d(b,k.eye, k.center,l);e=b.state.constraints;g=e.minimumPoiDistance;a.vec3d.dist2(k.eye,l)=e.minResult.priority)&&(null==e.minResult.dist||a=e.maxResult.priority)&&(null==e.maxResult.dist||a>e.maxResult.dist)&&e.maxResult.set(c,k,a,d,f,null,p,g)))},m.customTransformation))}};c.prototype.getMinResult=function(){return this.minResult};c.prototype.getMaxResult=function(){return this.maxResult};c.prototype.getHudResults=function(){return this.hudResults};c.DEFAULT_TOLERANCE=1E-5;return c}();var b=function(){function b(b,c){this.normal=a.vec3d.create();this.init(b,c)}b.prototype.getIntersectionPoint=function(b){if(null==this.dist)return!1; a.vec3d.lerp(this.p0,this.p1,this.dist,b);return!0};b.prototype.set=function(b,c,d,g,k,f,l,m){this.dist=d;a.vec3d.set(g,this.normal);this.targetType=b?b instanceof e?"StageObject":"StagePoint":"None";this.target=b;this.name=c;this.priority=k;this.center=f?a.vec3d.create(f):null;this.geometryId=l;this.triangleNr=m};b.prototype.copyFrom=function(b){this.p0=b.p0;this.p1=b.p1;this.dist=b.dist;this.targetType=b.targetType;this.target=b.target;this.name=b.name;this.priority=b.priority;this.center=b.center? a.vec3d.create(b.center):null;this.geometryId=b.geometryId;this.triangleNr=b.triangleNr;this.intersector=b.intersector;a.vec3d.set(b.normal,this.normal)};b.prototype.setIntersector=function(a){this.intersector=a};b.prototype.init=function(a,b){this.dist=void 0;this.targetType="None";this.priority=this.name=this.target=void 0;this.triangleNr=this.geometryId=this.center=null;this.intersector="stage";this.p0=a;this.p1=b};return b}(),k=function(){function a(a,b,c){this.original=a;this.update=b;this.dirty= !0;this.transform=c()}a.prototype.invalidate=function(){this.dirty=!0};Object.defineProperty(a.prototype,"value",{get:function(){this.dirty&&(this.update(this.original.value,this.transform),this.dirty=!1);return this.transform},enumerable:!0,configurable:!0});return a}();return r})},"esri/views/3d/webgl-engine/lib/Object3D":function(){define("require exports ./ComponentUtils ./GeometryRecord ./gl-matrix ./HighlightUtils ./IdGen ./ModelContentType ./Util".split(" "),function(r,h,f,a,e,c,g,d,b){var k= b.assert,l=e.mat4d,p=e.vec3d,n=l.identity();r=function(){function b(a){void 0===a&&(a={});this._bvObjectSpace=new t;this._bvWorldSpace=new t;this._bvDirty=!0;this._hasVolatileTransformation=!1;this.id=b._idGen.gen(a.idHint);this.name=a.name;this.castShadow=null!=a.castShadow?a.castShadow:!0;this.metadata=a.metadata;this.objectTransformation=l.identity();this._initializeGeometryRecords(a.geometries,a.materials,a.transformations)}b.prototype._initializeGeometryRecords=function(b,c,d){if(Array.isArray(b)){k(c.length=== b.length,"Object3D: materials don't match geometries");k(d.length===b.length,"Object3D: transformations don't match geometries");this.geometryRecords=Array(b.length);this.geometries=b.slice();for(var e=0;ek;++k){p.set(d,e);p.set(a,g);-1f;++f)b.bbMin[f]=Math.min(b.bbMin[f],e[f],g[f]),b.bbMax[f]=Math.max(b.bbMax[f],e[f],g[f])}};b.prototype._getScaleFactor=function(a){return Math.max(Math.max(Math.sqrt(a[0]*a[0]+a[4]*a[4]+a[8]*a[8]),Math.sqrt(a[1]*a[1]+a[5]*a[5]+a[9]*a[9])),Math.sqrt(a[2]*a[2]+a[6]*a[6]+a[10]*a[10]))};b.prototype._invalidateBoundingVolume=function(){this._bvDirty=!0;this._parentLayer&& this._parentLayer.notifyObjectBBChanged(this,this._bvWorldSpace)};b.prototype._notifyDirty=function(a,b,c,e){this._parentLayer&&(c=c||d.OBJECT,this._parentLayer.notifyDirty(a,b,c,e||this))};b._idGen=new g;return b}();var t=function(){function a(){this.bbMin=p.create();this.bbMax=p.create();this.center=p.create();this.bsRadius=0}a.prototype.init=function(){p.set3(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,this.bbMin);p.set3(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,this.bbMax); p.set3(0,0,0,this.center);this.bsRadius=0};a.prototype.getCenter=function(){return this.center};a.prototype.getBSRadius=function(){return this.bsRadius};return a}();return r})},"esri/views/3d/webgl-engine/lib/GeometryRecord":function(){define(["require","exports","./IdGen"],function(r,h,f){return function(){function a(e,c,g,d,b,k){this.id=a._idGen.gen(e.id);this.geometry=e;this.materials=c;this.transformation=g;this.instanceParameters=d;this.origin=b;this.customTransformation=k}a.prototype.getStaticTransformation= function(){return this.transformation};a.prototype.getShaderTransformation=function(){return this.customTransformation?this.customTransformation(this.transformation):this.transformation};a._idGen=new f;return a}()})},"esri/views/3d/webgl-engine/lib/HighlightUtils":function(){define(["require","exports","./IdGen"],function(r,h,f){Object.defineProperty(h,"__esModule",{value:!0});var a=new f;h.generateHighlightId=function(){return a.gen("highlight")}})},"esri/views/3d/webgl-engine/lib/ModelContentType":function(){define(["require", "exports"],function(r,h){return function(){function f(){}f.LAYER="layers";f.OBJECT="objects";f.GEOMETRY="geometries";f.MATERIAL="materials";f.TEXTURE="textures";return f}()})},"esri/views/3d/webgl-engine/lib/PerformanceTimer":function(){define(["require","exports","./Performance"],function(r,h,f){return function(){function a(a){this._filterSampleIndex=0;this._lastTime=NaN;this._numMeasurements=this._totalTime=0;this._filterSamples=Array(a);this.reset();this._filterSize=a}a.prototype.reset=function(){for(var a= this._filterSampleIndex=0;a=Math.abs(q)?0:q}function b(b,d,e){if(!b.state.isLocal){var k=b.state.constraints;if(k.altitude){b=a.vec3d.length2(d.center);var f=Math.sqrt(b);d=d.distance;var l=k.altitude.min+c.earthRadius,k=k.altitude.max+c.earthRadius,l=(l*l-d*d-b)/ (-2*f*d);e.min=Math.max(e.min,Math.min(Math.PI-g.acos((k*k-d*d-b)/(-2*f*d)),e.max));e.max=Math.min(e.max,Math.PI-g.acos(l))}}}Object.defineProperty(h,"__esModule",{value:!0});h.apply=function(b,c,e,g){void 0===e&&(e=f.defaultApplyOptions);void 0===g&&(g=c);c!==g&&g.copyFrom(c);b=d(b,c,e);if(0===b)return!1;a.mat4d.identity(l);a.mat4d.rotate(l,-b,c.viewRight);a.vec3d.subtract(c.center,c.eye,k);a.mat4d.multiplyVec3(l,k);a.vec3d.subtract(c.center,k,g.eye);a.mat4d.multiplyVec3(l,g.up);g.markViewDirty(); return!0};h.error=d;var k=a.vec3d.create(),l=a.mat4d.create(),p=g.deg2rad(5),n={min:0,max:0}})},"esri/views/3d/state/utils/viewUtils":function(){define(["require","exports","../../lib/glMatrix","../../support/mathUtils"],function(r,h,f,a){Object.defineProperty(h,"__esModule",{value:!0});h.viewAngle=function(g,d,b){g.worldUpAtPosition(d,e);f.vec3d.subtract(b,d,c);g=f.vec3d.length(c);return 0===g?0:a.acos(f.vec3d.dot(c,e)/g)};var e=f.vec3d.create(),c=f.vec3d.create()})},"esri/views/animation/easing":function(){define(["require", "exports"],function(r,h){function f(a){return a}function a(a){var c=2*(a-Math.sqrt((a-1)*a)),d=c/2/a;return function(b){return ba?h.inQuad(2*a)/2:(h.outQuad(2*(a-.5))+1)/2};h.inCubic=function(a){return a*a*a};h.outCubic=function(a){return 1- h.inCubic(1-a)};h.inOutCubic=function(a){return.5>a?h.inCubic(2*a)/2:(h.outCubic(2*(a-.5))+1)/2};h.inQuart=function(a){return a*a*a*a};h.outQuart=function(a){return 1-h.inQuart(1-a)};h.inOutQuart=function(a){return.5>a?h.inQuart(2*a)/2:(h.outQuart(2*(a-.5))+1)/2};h.inQuint=function(a){return a*a*a*a*a};h.outQuint=function(a){return 1-h.inQuint(1-a)};h.inOutQuint=function(a){return.5>a?h.inQuint(2*a)/2:(h.outQuint(2*(a-.5))+1)/2};h.inSine=function(a){return-Math.cos(a*Math.PI/2)+1};h.outSine=function(a){return 1- h.inSine(1-a)};h.inOutSine=function(a){return.5>a?h.inSine(2*a)/2:(h.outSine(2*(a-.5))+1)/2};h.inExpo=function(a){return Math.pow(2,10*(a-1))};h.outExpo=function(a){return 1-h.inExpo(1-a)};h.inOutExpo=function(a){return.5>a?h.inExpo(2*a)/2:(h.outExpo(2*(a-.5))+1)/2};h.inCirc=function(a){return-(Math.sqrt(1-a*a)-1)};h.outCirc=function(a){return 1-h.inCirc(1-a)};h.inOutCirc=function(a){return.5>a?h.inCirc(2*a)/2:(h.outCirc(2*(a-.5))+1)/2};h.inCoastQuad=e(a(1),1);h.outCoastQuad=e(a(1),0);h.inOutCoastQuad= e(a(1),.5);h.inCoastCubic=e(a(2),1);h.outCoastCubic=e(a(2),0);h.inOutCoastCubic=e(a(2),.5);h.inCoastQuart=e(a(3),1);h.outCoastQuart=e(a(3),0);h.inOutCoastQuart=e(a(3),.5);h.inCoastQuint=e(a(4),1);h.outCoastQuint=e(a(4),0);h.inOutCoastQuint=e(a(4),.5);h.named={linear:f,"in-quad":h.inQuad,"out-quad":h.outQuad,"in-out-quad":h.inOutQuad,"in-cubic":h.inCubic,"out-cubic":h.outCubic,"in-out-cubic":h.inOutCubic,"in-quart":h.inQuart,"out-quart":h.outQuart,"in-out-quart":h.inOutQuart,"in-quint":h.inQuint,"out-quint":h.outQuint, "in-out-quint":h.inOutQuint,"in-sine":h.inSine,"out-sine":h.outSine,"in-out-sine":h.inOutSine,"in-expo":h.inExpo,"out-expo":h.outExpo,"in-out-expo":h.inOutExpo,"in-circ":h.inCirc,"out-circ":h.outCirc,"in-out-circ":h.inOutCirc}})},"esri/views/3d/state/controllers/PointToPointAnimationController":function(){define("require exports ../../../../core/tsSupport/extendsHelper ../../animation/pointToPoint/Animation ../../lib/glMatrix ./AnimationController ../../webgl-engine/lib/Camera".split(" "),function(r, h,f,a,e,c,g){Object.defineProperty(h,"__esModule",{value:!0});r=function(c){function e(b,d,e){e=c.call(this,e)||this;e.viewState=b;e.pickingHelper=d;e.hasTarget=!1;e.animation=new a.default(e.viewState.mode);return e}f(e,c);e.prototype.begin=function(a,c){this.hasTarget=!0;c=this.animationSettings(c);d.copyFrom(this.viewState.camera);this.pickingHelper.pickRaySegment(d.eye,d.center,b)&&(d.center=b);this.animation.update(d,a,c);this.animation.finished&&this.finish()};e.prototype.finish=function(){this.animation.currentTime= this.animation.time;c.prototype.finish.call(this)};Object.defineProperty(e.prototype,"steppingFinished",{get:function(){return this.hasTarget&&this.animation.finished},enumerable:!0,configurable:!0});e.prototype.stepController=function(a,b){c.prototype.stepController.call(this,a,b);this.hasTarget&&this.animation.step(a,b)};e.prototype.onControllerEnd=function(a){this.hasTarget&&(this.animation.cameraAt(this.animation.currentTime/this.animation.time,a),this.animation.currentTime=this.animation.time); c.prototype.onControllerEnd.call(this,a)};e.prototype.animationSettings=function(a){void 0===a&&(a={});return{apex:{maximumDistance:this.viewState.constraints.clampAltitude(Infinity)/6,ascensionFactor:void 0,descensionFactor:void 0},speedFactor:a.speedFactor,duration:a.duration,maxDuration:a.maxDuration,easing:a.easing}};return e}(c.AnimationController);h.PointToPointAnimationController=r;var d=new g,b=e.vec3d.create()})},"esri/views/3d/animation/pointToPoint/Animation":function(){define("require exports ../../../../core/tsSupport/extendsHelper ./Camera ../../lib/glMatrix ../../webgl-engine/lib/Camera ../../../animation/pointToPoint/Animation".split(" "), function(r,h,f,a,e,c,g){Object.defineProperty(h,"__esModule",{value:!0});var d=e.vec3d,b=d.create();r=function(){function e(b){this.currentTime=0;this.animation=new g.Animation(function(){return new a.default(b)});this._current=new a.default(b)}Object.defineProperty(e.prototype,"finished",{get:function(){return this.currentTime>=this.animation.time},enumerable:!0,configurable:!0});Object.defineProperty(e.prototype,"time",{get:function(){return this.animation.time},enumerable:!0,configurable:!0}); e.prototype.update=function(a,c,e){var g=this.animation.definition.source,k=this.animation.definition.target,f=d.subtract(c.center,a.center,b),l=d.length(f);1E-5<=l?(f[0]/=l,f[1]/=l,f[2]/=l):(f[0]=0,f[1]=1,f[0]=0);d.set(f,g.lookAtDirection);d.set(f,k.lookAtDirection);g.copyFromRenderCamera(a);k.copyFromRenderCamera(c);this._current.copyFrom(g);this.animation.update(g,k,e);this.currentTime=0;a.almostEquals(c,5E-4,!0)&&(this.currentTime=this.animation.time)};e.prototype.cameraAt=function(a,b){a=this.animation.cameraAt(a, this._current);b||(b=new c);a.copyToRenderCamera(b);return b};e.prototype.step=function(a,b){this.finished||(this.currentTime+=a,this.currentTime>=this.time&&(this.currentTime=this.time));return this.cameraAt(this.currentTime/this.time,b)};return e}();h.Animation=r;h.default=r})},"esri/views/3d/animation/pointToPoint/Camera":function(){define(["require","exports","../../lib/glMatrix","../../support/mathUtils"],function(r,h,f,a){Object.defineProperty(h,"__esModule",{value:!0});var e=a.angle,c=a.lerp, g=a.slerp,d=f.vec3d,b=f.mat3d,k=d.create(),l=d.create(),p=d.create(),n=d.create(),t=d.create(),u=d.create(),q=d.createFrom(0,0,1),v=d.createFrom(0,1,0),x=d.createFrom(1,0,0),m=b.create();r=function(){function a(a){void 0===a&&(a="global");this.viewingMode=a;this.center=d.create();this.distance=this.yaw=this.pitch=0;this.lookAtDirection=d.create(v)}a.prototype.pixelsPerPanAtZoom=function(a){return this.size/2/(this._zoomToPanScale*a)};a.prototype.zoomAtPixelsPerPan=function(a){return this.size/2/(this._zoomToPanScale* a)};a.prototype.pixelsPerRotateAtZoom=function(a){return this.size/2/Math.max(Math.cos(Math.abs(this.pitch)),.5)};a.prototype.compareTo=function(a,b){b||(b={pan:0,rotate:0,sourceZoom:0,targetZoom:0});if("global"===this.viewingMode){var c=d.length(this.center),g=d.length(a.center),c=(c+g)/2;b.pan=e(this.center,a.center)*c}else b.pan=d.dist(this.center,a.center);c=Math.abs(a.yaw-this.yaw);c>=Math.PI&&(c=2*Math.PI-c);b.rotate=Math.max(c,Math.abs(a.pitch-this.pitch));b.sourceZoom=this.distance;b.targetZoom= a.distance;return b};a.prototype.interpolate=function(a,b,e){"global"===this.viewingMode?g(a.center,b.center,e.pan,this.center):d.lerp(a.center,b.center,e.pan,this.center);this.distance=c(a.distance,b.distance,e.zoom);this.pitch=c(a.pitch,b.pitch,e.rotate);a=a.yaw;b=b.yaw;Math.abs(b-a)>=Math.PI&&(a+=2*(aMath.abs(b[2])?(d.set(b,u),0Math.abs(a._fov-this._fov)&&.5>e(a._padding,this._padding)&&.5>e(a._viewport,this._viewport)};f.prototype.markViewDirty=function(){this._viewProjectionDirty=this._frustumPlanesDirty=this._viewDirty=!0};f.prototype.computePixelSizeAt=function(a){return this.computePixelSizeAtDist(d.dist(a,this._eye))};f.prototype.computePixelSizeAtDist=function(a){return 2*a*Math.tan(this.fovX/2)/this.width};f.prototype.computeDistanceFromRadius= function(a,b){return a/Math.tan(Math.min(this.fovX,this.fovY)/(2*(b||1)))};f.prototype.copyFrustumPlanes=function(a){if(!a){a=Array(6);for(var c=0;6>c;++c)a[c]=b.create()}for(var d=this.frustumPlanes,c=0;6>c;c++)b.set(d[c],a[c]);return a};f.prototype.computeFrustumPoints=function(b){if(!b){b=Array(8);for(var c=0;8>c;++c)b[c]=d.create()}a.matrix2frustum(this.viewMatrix,this.projectionMatrix,b);return b};f.prototype.setGLViewport=function(a){var b=this.viewport,c=this.padding;a.setViewport(b[0]-c[3], b[1]-c[2],b[2]+c[1]+c[3],b[3]+c[0]+c[2])};f.prototype.applyProjection=function(b,c,e){void 0===e&&(e=!1);b!==l&&d.set(b,l);l[3]=1;e&&(c[2]=-l[2]);k.multiplyVec4(this.projectionMatrix,l);d.scale(l,1/Math.abs(l[3]));b=this.fullViewport;c[0]=a.lerp(0,b[0]+b[2],.5+.5*l[0]);c[1]=a.lerp(0,b[1]+b[3],.5+.5*l[1]);e||(c[2]=.5*(l[2]+1));return c};f.prototype.projectPoint=function(b,c){l[0]=b[0];l[1]=b[1];l[2]=b[2];l[3]=1;k.multiplyVec4(this.viewProjectionMatrix,l);d.scale(l,1/Math.abs(l[3]));b=this.fullViewport; c[0]=a.lerp(0,b[0]+b[2],.5+.5*l[0]);c[1]=a.lerp(0,b[1]+b[3],.5+.5*l[1]);c[2]=.5*(l[2]+1);return c};f.prototype.unprojectPoint=function(a,b,c){void 0===c&&(c=!1);if(c)return console.error("Camera.unprojectPoint() not yet implemented for linear Z"),null;k.multiply(this.projectionMatrix,this.viewMatrix,p);if(!k.inverse(p))return null;c=this.fullViewport;l[0]=2*(a[0]-c[0])/c[2]-1;l[1]=2*(a[1]-c[1])/c[3]-1;l[2]=2*a[2]-1;l[3]=1;k.multiplyVec4(p,l);if(0===l[3])return null;b[0]=l[0]/l[3];b[1]=l[1]/l[3];b[2]= l[2]/l[3];return b};f.prototype.computeUp=function(a){"global"===a?this.computeUpGlobal():this.computeUpLocal()};f.prototype.computeUpGlobal=function(){d.subtract(this.center,this.eye,n);var a=d.length(this.center);1>a?(d.set3(0,0,1,this.up),this.markViewDirty()):Math.abs(d.dot(n,this.center))>.9999*d.length(n)*a||(d.cross(n,this.center,this.up),d.cross(this.up,n,this.up),d.normalize(this.up),this.markViewDirty())};f.prototype.computeUpLocal=function(){d.direction(this.center,this.eye,n);.9999>=Math.abs(n[2])&& (d.scale(n,n[2]),d.set3(-n[0],-n[1],1-n[2],this.up),d.normalize(this.up),this.markViewDirty())};f.prototype._compareAndSetView=function(a,b){c(a,b)||(d.set(a,b),this._viewProjectionDirty=this._frustumPlanesDirty=this._viewDirty=!0)};f.prototype._computeFrustumPlanes=function(c){if(!c){c=Array(6);for(var d=0;6>d;++d)c[d]=b.create()}a.matrix2frustumPlanes(this.viewMatrix,this.projectionMatrix,c);return c};f.prototype._ensureViewClean=function(){this._viewDirty&&(k.lookAt(this._eye,this._center,this._up, this._viewMatrix),d.set3(-this._viewMatrix[2],-this._viewMatrix[6],-this._viewMatrix[10],this._viewForward),d.set3(this._viewMatrix[1],this._viewMatrix[5],this._viewMatrix[9],this._viewUp),d.set3(this._viewMatrix[0],this._viewMatrix[4],this._viewMatrix[8],this._viewRight),this._viewDirty=!1,this._viewInverseTransposeMatrixDirty=!0)};return f}();var l=b.create(),p=k.create(),n=d.create(),t=d.create();return r})},"esri/views/animation/pointToPoint/Animation":function(){define("require exports ../easing ./Definition ./Settings ./apex/Path".split(" "), function(r,h,f,a,e,c){Object.defineProperty(h,"__esModule",{value:!0});var g={zoom:0,pan:0,rotate:0};r=function(){function d(b){this.createCamera=b;this.time=0;this.definition=new a.Definition(b);this.path=new c.Path}d.prototype.update=function(a,c,d){this.definition.update(a,c,d);this.path.update(this.definition,d);this.time=this._applyTimeSettings(this.path.time,d);this.settings=d};d.prototype.cameraAt=function(a,c){c||(c=this.createCamera());a=Math.min(Math.max(0,a),1);a=this.settings.easing?this.normalizedEasing(this.settings.easing, a,1E3*this.time):1<=this.time?this.normalizedEasing(f.inOutCoastQuad,a):this.normalizedEasing(f.outExpo,a);a=this.path.interpolateComponentsAt(a,g);c.interpolate(this.definition.source,this.definition.target,a);return c};d.prototype.normalizedEasing=function(a,c,d){d=a(0);var b=a(1);return(a(c)-d)/(b-d)};d.prototype._applyTimeSettings=function(a,c){var b=null!=c.speedFactor?c.speedFactor:1;null!=c.duration?a=c.duration:null!=c.speedFactor&&(a/=b);return a=Math.min(Math.max(null!=c.minDuration?c.minDuration: e.defaultSettings.minDuration/b,a),null!=c.maxDuration?c.maxDuration:e.defaultSettings.maxDuration/b)};return d}();h.Animation=r;h.default=r})},"esri/views/animation/pointToPoint/Definition":function(){define(["require","exports","./Settings"],function(r,h,f){Object.defineProperty(h,"__esModule",{value:!0});r=function(){function a(a){this.createCamera=a;this.compared={sourceZoom:0,targetZoom:0,pan:0,rotate:0};this.settings={desiredScreenFlow:f.defaultSettings.desiredScreenFlow};this.source=a();this.target= a()}a.prototype.clone=function(){var e=new a(this.createCamera);e.copyFrom(this);return e};a.prototype.copyFrom=function(a){this.update(a.source,a.target,a.settings)};a.prototype.update=function(a,c,g){this.source!==a&&this.source.copyFrom(a);this.target!==c&&this.target.copyFrom(c);this.settings.desiredScreenFlow=null!=g.desiredScreenFlow?g.desiredScreenFlow:f.defaultSettings.desiredScreenFlow;this.compared=this.source.compareTo(this.target,this.compared);this.desiredPixelFlow=this.settings.desiredScreenFlow* this.target.size;this.halfWindowSize=this.target.size/2};a.prototype.halfWindowPanAtZoom=function(a){a=this.target.pixelsPerPanAtZoom(a);return this.halfWindowSize/a};Object.defineProperty(a.prototype,"hasZoom",{get:function(){return 1E-5g?1:-1;this._panPixelsAtSource=e.pan*a.source.pixelsPerPanAtZoom(c);a=(a.source.pixelsPerRotateAtZoom(c)+a.target.pixelsPerRotateAtZoom(g))/2;this._rotatePixels=e.rotate*a};f.prototype._updatePixelFlow=function(){var a=this.definition.compared.sourceZoom,e=this.definition.compared.targetZoom,c=this.definition.hasZoom,g=this.definition.hasPan,d=this.definition.hasRotate, b,f;b=g&&c?(e/a-1)/(-1/(this._sl*this.definition.halfWindowSize)*Math.LN2*this._panPixelsAtSource):0;f=c&&d?Math.log(a/e)/Math.LN2*this._sl*this.definition.halfWindowSize/this._rotatePixels:0;this._rotatePixelFlow=this._panPixelFlow=this._zoomPixelFlow=0;a=this.definition.desiredPixelFlow;c&&g&&d?(e=b+f+b*f,this._zoomPixelFlow=b*f/e*a,this._panPixelFlow=f/e*a,this._rotatePixelFlow=b/e*a):c&&g?(e=1+b,this._zoomPixelFlow=b/e*a,this._panPixelFlow=1/e*a):c&&d?(e=1+f,this._zoomPixelFlow=f/e*a,this._rotatePixelFlow= 1/e*a):g&&d?(b=this._panPixelsAtSource/this._rotatePixels,e=1+b,this._panPixelFlow=b/e*a,this._rotatePixelFlow=1/e*a):g?this._panPixelFlow=a:c?this._zoomPixelFlow=a:d&&(this._rotatePixelFlow=a);this.time=d?this.rotateTime:c?this.zoomTime:g?this.panTime:0};Object.defineProperty(f.prototype,"zoomTime",{get:function(){return this.definition.hasZoom?Math.log(this.definition.compared.sourceZoom/this.definition.compared.targetZoom)/Math.LN2*this._sl*this.definition.halfWindowSize/this._zoomPixelFlow:0}, enumerable:!0,configurable:!0});Object.defineProperty(f.prototype,"panTime",{get:function(){if(this.definition.hasPan){if(this.definition.hasZoom){var a=-1/(this._sl*this.definition.halfWindowSize)*Math.LN2;return Math.log(this._zoomPixelFlow/this._panPixelFlow*this._panPixelsAtSource*a+1)/(a*this._zoomPixelFlow)}return this._panPixelsAtSource/this._panPixelFlow}return 0},enumerable:!0,configurable:!0});Object.defineProperty(f.prototype,"rotateTime",{get:function(){return this.definition.hasRotate? this._rotatePixels/this._rotatePixelFlow:0},enumerable:!0,configurable:!0});f.prototype._interpolateComponentsZoom=function(a){if(this.definition.hasZoom){var e=this.definition.compared.sourceZoom,c=this.definition.compared.targetZoom;return(e*Math.pow(e/c,-a)-e)/(c-e)}return a};f.prototype._interpolateComponentsPan=function(a){if(this.definition.hasPan&&this.definition.hasZoom){var e=-1/(this._sl*this.definition.halfWindowSize)*this._zoomPixelFlow;return 1/this._panPixelsAtSource*this._panPixelFlow* (Math.pow(2,e*a*this.time)-1)/(e*Math.LN2)}return a};f.prototype._interpolateComponentsRotate=function(a){return a};f.prototype.interpolateComponentsAt=function(a,e){a=Math.min(Math.max(a,0),1);var c=this._interpolateComponentsZoom(a),g=this._interpolateComponentsPan(a);a=this._interpolateComponentsRotate(a);e?(e.zoom=c,e.pan=g,e.rotate=a):e={zoom:c,pan:g,rotate:a};return e};return f}();h.Segment=r;h.default=r})},"esri/views/animation/pointToPoint/apex/planning":function(){define(["require","exports", "./functions"],function(r,h,f){function a(a,c){var e=Math.max(a.compared.sourceZoom,a.compared.targetZoom);a=a.source.zoomAtPixelsPerPan(a.desiredPixelFlow/a.compared.pan)/2;return a=z&&0>C){if(!isFinite(z))return null;g=z;h=b(g);break}g-=C;if(g=Math.abs(C-h)/h)break;h=C}return h>.7*m?null:gMath.PI;)a-=2*Math.PI;for(;a<-Math.PI;)a+=2*Math.PI;return a};h.applyRotation=b;h.closestPointOnSphereSilhouette=k;h.intersectPlaneFromScreenPoint=function(b,c,d,e){var g=A;a.createRay(c,d,g);return a.intersectPlane(b,g,e)};h.applyZoomToPoint=function(a,b,c,d){var e=m;c=1-c;f.vec3d.subtract(b,a.eye,e); var g=f.vec3d.length(e),k=g*(1-c);0<=c&&kMath.abs(g-k)||(f.vec3d.scale(e,c),f.vec3d.add(a.eye,e),f.vec3d.lerp(a.center,b,c))};h.applyZoomOnSphere=function(a,b,c){f.vec2d.set2(b.padding[3]+b.width/2,b.padding[2]+b.height/2,p);g(a,b,p,b.center);f.vec3d.subtract(b.center,b.eye,m);a=f.vec3d.length(m);1E-6>Math.abs(a-a*c)||(f.vec3d.scale(m,c),f.vec3d.subtract(b.center,m,b.eye),b.markViewDirty())};var p=f.vec2d.create();h.navPointToScreenPoint=function(a,b,c){f.vec2d.set2(b.x, a.fullHeight-b.y,c)};h.centroidOnSphere=function(a,b,c){l(b,c);f.vec3d.normalize(c);f.vec3d.scale(c,a)};h.centroid=l;var n;(function(a){a[a.Vertical=0]="Vertical";a[a.Horizontal=1]="Horizontal"})(n=h.PanMode||(h.PanMode={}));h.VerticalPanTresholds={Elevation:3E4,Angle:8/180*Math.PI};h.pickPointAndInitSphere=function(a,b,d,e){var k=f.vec3d.create(),l={center:f.vec3d.create(),radius:0},p=!0;a.pickPointInScreen(d,k)?l.radius=f.vec3d.length(k):(l.radius=f.vec3d.length(b.center),l.radius<.9*h.Earth.radius&& (l.radius=h.Earth.radius),l.radius=Math.max(f.vec3d.length(b.center),.9*h.Earth.radius),e?c(l,b,d,k):p=g(l,b,d,k));return{sphere:l,scenePickPoint:p?k:null}};h.decidePanMode=function(a,b,c){if(f.vec3d.length(a.eye)-h.Earth.radiusf.vec3d.length(a.eye))return n.Vertical;f.vec3d.normalize(f.vec3d.subtract(a.eye,c,t));return Math.abs(.5*Math.PI-Math.acos(f.vec3d.dot(c,t)/f.vec3d.length(c)))a)return!1;b=Math.sqrt(a);a=(-l-b)/(2*c);c=(-l+b)/(2*c);if(0>a||ca)return!1;f.vec3d.add(e.origin,f.vec3d.scale(e.direction,a,d),d);return!0}; var a=f.vec3d.create(),e=f.vec3d.create()})},"esri/views/3d/state/controllers/local/ZoomStepController":function(){define("require exports ../../../../../core/tsSupport/extendsHelper ../../../camera/constraintUtils ../../../lib/glMatrix ../PointToPointAnimationController ../../../webgl-engine/lib/Camera ../../../../animation/easing".split(" "),function(r,h,f,a,e,c,g,d){Object.defineProperty(h,"__esModule",{value:!0});r=function(b){function c(a,c,d){c=b.call(this,a.state,c,"interaction"===d?null:void 0)|| this;c.view=a;c.mode=d;c.zoomLocation=e.vec3d.create();c.tmpCamera=new g;c.tmpRayDir=e.vec3d.create();c.tmpCenter=e.vec3d.create();c.constraintOptions={selection:15,interactionType:1,interactionFactor:null,interactionStartCamera:new g,interactionDirection:null};return c}f(c,b);Object.defineProperty(c.prototype,"isInteractive",{get:function(){return"interaction"===this.mode},enumerable:!0,configurable:!0});c.prototype.zoomStep=function(a,b){if(this.active){var c=this.view.state,d=this.constraintOptions.interactionStartCamera; this.animation.finished?d.copyFrom(c.camera):this.animation.cameraAt(1,d);this.tmpCamera.copyFrom(c.camera);0=c&&4>f&&(f=4,c=f/g);1E-6>Math.abs(g-f)||(e.vec3d.scale(this.tmpRayDir,c),e.vec3d.subtract(d,this.tmpRayDir,b.eye),e.vec3d.lerp(b.center,d,1-c),a.applyAll(this.view,this.tmpCamera, this.constraintOptions))};return c}(c.PointToPointAnimationController);h.ZoomStepController=r})},"esri/views/3d/state/helpers/PickingHelper":function(){define(["require","exports","../../camera/intersectionUtils","../../lib/glMatrix","../../webgl-engine/lib/Selector"],function(r,h,f,a,e){Object.defineProperty(h,"__esModule",{value:!0});r=function(){function c(c){this.view=c;this.tmpR0=a.vec3d.create();this.tmpR1=a.vec3d.create();this.tmpSelector=new e(this.view.viewingMode)}c.prototype.pickPointInScreen= function(a,c){return this.pickedIntersectionPoint(this.pickInScreen(a,!1),c)};c.prototype.pickFreePointFromSegment=function(c,d,b){a.vec3d.set(c,this.tmpR0);a.vec3d.set(d,this.tmpR1);a.vec3d.subtract(this.tmpR1,this.tmpR0);a.vec3d.normalize(this.tmpR1);var e=this.view.dataExtent;c=Math.max(e.xmax-e.xmin,e.ymax-e.ymin,8*Math.max(e.xmax-e.xmin,e.ymax-e.ymin));d=this.view.state.camera;var g=Math.max(0,e.xmin-d.eye[0],d.eye[0]-e.xmax),e=Math.max(0,e.ymin-d.eye[1],d.eye[1]-e.ymax),g=Math.sqrt(g*g+e*e), e=this.view.renderCoordsHelper.getAltitude(d.eye);d=f.surfaceElevationBelowEye(this.view,d);d=c/Math.max(1,Math.pow(Math.max(0,Math.log(c/(Math.abs(e-d)+Number.MIN_VALUE))),2));d=Math.max(d,Math.min(g,c));a.vec3d.scale(this.tmpR1,d);a.vec3d.add(this.tmpR0,this.tmpR1,b)};c.prototype.pickFreePointInScreen=function(a,c){this.view._pickRayWithBeginPoint(a,void 0,this.view.state.camera.viewMatrix,this.tmpR0,this.tmpR1);this.pickFreePointFromSegment(this.tmpR0,this.tmpR1,c)};c.prototype.pickRaySegment= function(a,c,b){return this.pickedIntersectionPoint(this.view._pickRay(a,c,null,null,null,null,this.tmpSelector),b)};c.prototype.pickInScreen=function(c,d){this.view._pickRayWithBeginPoint(c,void 0,this.view.state.camera.viewMatrix,this.tmpR0,this.tmpR1);d&&a.vec3d.set(this.view.state.camera.eye,this.tmpR0);return this.view._pickRay(this.tmpR0,this.tmpR1,c,c,null,null,this.tmpSelector)};c.prototype.pickedIntersectionPoint=function(a,c){return a?a.getMinResult().getIntersectionPoint(c):!1};return c}(); h.PickingHelper=r})},"esri/views/input/InputHandler":function(){define(["require","exports","../../core/Logger","./EventMatch"],function(r,h,f,a){Object.defineProperty(h,"__esModule",{value:!0});var e=f.getLogger("esri.views.input.InputHandler");r=function(){function d(a){this._manager=null;this._incoming={};this._outgoing={};this._outgoingEventTypes=this._incomingEventTypes=this._incomingEventMatches=null;this._hasSideEffects=a}Object.defineProperty(d.prototype,"incomingEventMatches",{get:function(){if(!this._incomingEventMatches){this._incomingEventMatches= [];for(var a in this._incoming)for(var c=0,d=this._incoming[a];cd&&fMath.abs(c-f)||(this.hasPickPoint&&fthis.tmpN[1]&&e.vec3d.negate(this.tmpN),g.setPlane(this.tmpP,this.tmpN,this.plane),this.constraintOptions.interactionStartCamera= this.beginCamera)};c.prototype.update=function(b){if(this.active){g.intersectPlaneFromScreenPoint(this.plane,this.currentCamera,this.dragBeginPoint,this.tmpPoi)||e.vec3d.set(this.currentCamera.center,this.tmpPoi);g.normalizeCoordinate(this.currentCamera,b,this.tmpP0);var c=4*(this.normalizedAnchorPoint[1]-this.tmpP0[1]);e.vec2d.set(this.tmpP0,this.normalizedAnchorPoint);e.vec3d.subtract(this.tmpPoi,this.currentCamera.eye,this.tmpRayDir);var f=e.vec3d.length(this.tmpRayDir),k=f*(1-c);e.vec3d.set(this.tmpRayDir, this.constraintOptions.interactionDirection);e.vec3d.scale(this.constraintOptions.interactionDirection,d.sign(c)/f);var l=this.view.state.constraints.minimumPoiDistance;0<=c&&kMath.abs(f-k)||(e.vec3d.scale(this.tmpRayDir,c),e.vec3d.add(this.currentCamera.eye,this.tmpRayDir),e.vec3d.lerp(this.currentCamera.center,this.tmpPoi,c),this.currentCamera.center[2]=this.tmpPoi[2]>this.beginCamera.center[2]?Math.max(this.beginCamera.center[2],this.currentCamera.center[2]):Math.min(this.beginCamera.center[2], this.currentCamera.center[2]),this.currentCamera.markViewDirty(),this.constraintOptions.interactionFactor=a.pixelDistanceToInteractionFactor(this.dragBeginPoint,b),a.applyAll(this.view,this.currentCamera,this.constraintOptions))}};c.prototype.end=function(){this.active&&this.finishController()};return c}(c.InteractiveController);h.ZoomController=r})},"esri/views/3d/input/handlers/KeyPan":function(){define(["require","exports","../../../../core/tsSupport/extendsHelper","../../state/controllers/global/PanContinuousController", "../../../input/InputHandler"],function(r,h,f,a,e){Object.defineProperty(h,"__esModule",{value:!0});r=function(c){function e(d,b,e){var g=c.call(this,!0)||this;g.view=d;g.keyToDirection=(f={},f[b.left]=a.Direction.LEFT,f[b.right]=a.Direction.RIGHT,f[b.forward]=a.Direction.FORWARD,f[b.backward]=a.Direction.BACKWARD,f[b.up]=a.Direction.UP,f[b.down]=a.Direction.DOWN,f);d.state.isGlobal&&(g.registerIncoming("key-down",e,function(a){return g.handleKeyDown(a)}),g.registerIncoming("key-up",e,function(a){return g.handleKeyUp(a)})); return g;var f}f(e,c);e.prototype.handleKeyDown=function(c){if(!c.data.repeat){var b=this.keyToDirection[c.data.key];null!=b&&(this.cameraController&&this.cameraController.active||(this.cameraController=new a.PanContinuousController(this.view),this.view.state.switchCameraController(this.cameraController)),this.cameraController.active&&this.handleKey(c,b,!0))}};e.prototype.handleKeyUp=function(a){var b=this.keyToDirection[a.data.key];null!=b&&this.cameraController&&this.cameraController.active&&this.handleKey(a, b,!1)};e.prototype.handleKey=function(a,b,c){c?this.cameraController.addDirection(b):this.cameraController.removeDirection(b);a.stopPropagation()};return e}(e.InputHandler);h.KeyPan=r})},"esri/views/3d/state/controllers/global/PanContinuousController":function(){define("require exports ../../../../../core/tsSupport/extendsHelper ../../../camera/constraintUtils ../../../lib/glMatrix ../CameraController ../../../support/earthUtils ../../../support/mathUtils".split(" "),function(r,h,f,a,e,c,g,d){Object.defineProperty(h, "__esModule",{value:!0});h.Direction={LEFT:1,RIGHT:2,FORWARD:4,BACKWARD:8,UP:16,DOWN:32};var b=e.vec3d,k=e.mat4d;r=function(c){function e(a){var d=c.call(this)||this;d.view=a;d.directionStatus=0;d.direction=b.create();d.tmpAxis=b.create();d.radiusChange=0;d.velocity=0;d.tmpP1=b.create();d.tmpTransf=k.create();return d}f(e,c);Object.defineProperty(e.prototype,"isInteractive",{get:function(){return!0},enumerable:!0,configurable:!0});e.prototype.addDirection=function(a){0===this.directionStatus&&b.set3(0, 0,0,this.direction);this.directionStatus&a||(this.directionStatus|=a,a&(h.Direction.LEFT|h.Direction.RIGHT|h.Direction.FORWARD|h.Direction.BACKWARD)?(this.computePanAxis(a,this.tmpAxis),b.add(this.direction,this.tmpAxis)):(a=this.directionStatus&(h.Direction.UP|h.Direction.DOWN),this.radiusChange=a===h.Direction.UP?1:a===h.Direction.DOWN?-1:0),this.velocity=this.computePanVelocity())};e.prototype.removeDirection=function(a){this.directionStatus&=~a;0===this.directionStatus&&this.active?this.finishController(): a&(h.Direction.LEFT|h.Direction.RIGHT|h.Direction.FORWARD|h.Direction.BACKWARD)?(this.computePanAxis(a,this.tmpAxis),b.subtract(this.direction,this.tmpAxis),.01>b.length(this.direction)&&b.set3(0,0,0,this.direction)):(a=this.directionStatus&(h.Direction.UP|h.Direction.DOWN),this.radiusChange=a===h.Direction.UP?1:a===h.Direction.DOWN?-1:0)};e.prototype.stepController=function(d,e){c.prototype.stepController.call(this,d,e);d*=this.velocity;var g=!1;if(0this.radiusChange)&&b.scale(e.center,g);b.scale(e.eye,g);this.velocity=this.computePanVelocity();g=!0}.01b;switch(a.data.action){case "start":case "update":if(b)break; this.controller&&this.controller.active?2this.time.computeDelta(d)||(this.screen[0].update(a[0]),this.screen[1].update(a[1]),this.scene[0].update(c[0]),this.scene[1].update(c[1]),this.scene[2].update(c[2]),this.time.update(d))}; c.prototype.reset=function(){this.screen[0].reset();this.screen[1].reset();this.scene[0].reset();this.scene[1].reset();this.scene[2].reset();this.time.reset()};c.prototype.evaluateMomentum=function(){if(!this.screen[0].hasFilteredDelta)return null;var a=this.screen[0].filteredDelta,c=this.screen[1].filteredDelta,a=Math.sqrt(a*a+c*c)/this.time.filteredDelta;return Math.abs(a)this.duration};Object.defineProperty(a.prototype,"friction",{get:function(){return this._friction},enumerable:!0,configurable:!0});a.prototype.value=function(a){return this.valueFromInitialVelocity(this._initialVelocity,a)};a.prototype.valueDelta=function(a,c){var e=this.value(a);return this.value(a+ c)-e};a.prototype.valueFromInitialVelocity=function(a,c){c=Math.min(c,this.duration);var e=1-this.friction;return a*(Math.pow(e,c)-1)/Math.log(e)};return a}();h.Momentum=r})},"esri/views/navigation/PanSphericalMomentumEstimator":function(){define("require exports ../../core/tsSupport/extendsHelper ../3d/lib/glMatrix ../../views/3d/state/utils/navigationUtils ./FilteredFiniteDifference ./FilteredValue ./Momentum".split(" "),function(r,h,f,a,e,c,g,d){Object.defineProperty(h,"__esModule",{value:!0}); var b=function(a){function b(b,c,d,e,g){b=a.call(this,b,c,d)||this;b.angularVelocity=e;b.axis=g;return b}f(b,a);b.prototype.value=function(b){return a.prototype.valueFromInitialVelocity.call(this,this.angularVelocity,b)};return b}(d.Momentum);h.PanSphericalMomentum=b;r=function(){function d(b,d,e){void 0===b&&(b=300);void 0===d&&(d=12);void 0===e&&(e=.84);this.minimumInitialVelocity=b;this.stopVelocity=d;this.friction=e;this.tmpAxis=a.vec3d.create();this.time=new c.FilteredFiniteDifference(.3);this.screen= [new c.FilteredFiniteDifference(.4),new c.FilteredFiniteDifference(.4)];this.angle=new g.FilteredValue(.6);this.axis=a.vec3d.create();this.lastScene=a.vec3d.create()}d.prototype.add=function(b,c,d){if(this.time.hasLastValue){if(.01>this.time.computeDelta(d))return;var g=e.rotationAndAxisFromPoints(this.lastScene,c,this.tmpAxis);1E-5>a.vec3d.length2(this.tmpAxis)?g=0:a.vec3d.normalize(this.tmpAxis,this.axis);this.angle.update(g);a.vec3d.set(c,this.lastScene)}this.screen[0].update(b[0]);this.screen[1].update(b[1]); this.time.update(d)};d.prototype.reset=function(){this.screen[0].reset();this.screen[1].reset();this.angle.reset();this.time.reset()};d.prototype.evaluateMomentum=function(){if(!this.screen[0].hasFilteredDelta)return null;var a=this.screen[0].filteredDelta,b=this.screen[1].filteredDelta,a=Math.sqrt(a*a+b*b)/this.time.filteredDelta;return Math.abs(a)Math.PI;)c-=2*Math.PI;for(;c<-Math.PI;)c+=2*Math.PI;c=b+c}a.prototype.add.call(this,c,d)};return c}(a.MomentumEstimator);h.RotationMomentumEstimator=r})},"esri/views/navigation/MomentumEstimator":function(){define("require exports ../../core/tsSupport/extendsHelper ../3d/support/mathUtils ./FilteredFiniteDifference ./Momentum".split(" "),function(r,h,f,a,e,c){Object.defineProperty(h,"__esModule",{value:!0}); r=function(){function g(a,b,c,g){void 0===a&&(a=2.5);void 0===b&&(b=.01);void 0===c&&(c=.95);void 0===g&&(g=12);this.minimumInitialVelocity=a;this.stopVelocity=b;this.friction=c;this.maxVelocity=g;this.value=new e.FilteredFiniteDifference(.8);this.time=new e.FilteredFiniteDifference(.3)}g.prototype.add=function(a,b){if(this.time.hasLastValue){if(.01>this.time.computeDelta(b))return;if(this.value.hasFilteredDelta){var c=this.value.computeDelta(a);0>this.value.filteredDelta*c&&this.value.reset()}}this.time.update(b); this.value.update(a)};g.prototype.reset=function(){this.value.reset();this.time.reset()};g.prototype.evaluateMomentum=function(){if(!this.value.hasFilteredDelta)return null;var c=this.value.filteredDelta/this.time.filteredDelta,c=a.clamp(c,-this.maxVelocity,this.maxVelocity);return Math.abs(c)g?-g:g)>=x?q.Horizontal:q.Vertical;l.setPlaneD(b,this.planeHorizontal);0>c.vec3d.dot(this.planeHorizontal.normal,this.beginCamera.eye)+this.planeHorizontal.d&&(c.vec3d.negate(this.planeHorizontal.normal),this.planeHorizontal.d*=-1);this.panMode===q.Vertical?(c.vec3d.scale(e,g),c.vec3d.subtract(d,e,this.planeVertical.normal),c.vec3d.normalize(this.planeVertical.normal), l.setPlaneD(b,this.planeVertical),this.computePlanePoints(a.pointers,this.planeVertical,this.beginCamera,this.tmpPoints)):this.computePlanePoints(a.pointers,this.planeHorizontal,this.beginCamera,this.tmpPoints);l.centroid(this.tmpPoints,this.beginCenter);this.constraintOptions.interactionStartCamera.copyFrom(this.beginCamera)}};m.prototype.update=function(b){if(this.active){this.currentCamera.copyFrom(this.beginCamera);var c=1=Math.abs(c-g.x)&&25>=f)return!0}},prepareEvent:function(a){var b=v.cloneEvent(a),c=b.preventDefault;b.preventDefault=function(){a.preventDefault();c()};b.pointerId=this.POINTER_ID;b.isPrimary=!0;b.pointerType=this.POINTER_TYPE;return b},prepareButtonsForMove:function(a,b){var c=G.get(this.POINTER_ID);a.buttons=0!==b.which&&c?c.buttons:0;b.buttons=a.buttons},mousedown:function(a){if(!this.isEventSimulatedFromTouch(a)){var b=G.get(this.POINTER_ID),c=this.prepareEvent(a);H||(c.buttons=M[c.button], b&&(c.buttons|=b.buttons),a.buttons=c.buttons);G.set(this.POINTER_ID,a);b&&0!==b.buttons?v.move(c):v.down(c)}},mousemove:function(a){if(!this.isEventSimulatedFromTouch(a)){var b=this.prepareEvent(a);H||this.prepareButtonsForMove(b,a);b.button=-1;G.set(this.POINTER_ID,a);v.move(b)}},mouseup:function(a){if(!this.isEventSimulatedFromTouch(a)){var b=G.get(this.POINTER_ID),c=this.prepareEvent(a);if(!H){var d=M[c.button];c.buttons=b?b.buttons&~d:0;a.buttons=c.buttons}G.set(this.POINTER_ID,a);c.buttons&= ~M[c.button];0===c.buttons?v.up(c):v.move(c)}},mouseover:function(a){if(!this.isEventSimulatedFromTouch(a)){var b=this.prepareEvent(a);H||this.prepareButtonsForMove(b,a);b.button=-1;G.set(this.POINTER_ID,a);v.enterOver(b)}},mouseout:function(a){if(!this.isEventSimulatedFromTouch(a)){var b=this.prepareEvent(a);H||this.prepareButtonsForMove(b,a);b.button=-1;v.leaveOut(b)}},cancel:function(a){a=this.prepareEvent(a);v.cancel(a);this.deactivateMouse()},deactivateMouse:function(){G.delete(this.POINTER_ID)}}, O=v.captureInfo,N=x.findTarget.bind(x),S=x.allShadows.bind(x),R=v.pointermap,Y,X={events:["touchstart","touchmove","touchend","touchcancel"],register:function(a){Y.enableOnSubtree(a)},unregister:function(a){},elementAdded:function(a){var b=a.getAttribute("touch-action"),c=this.touchActionToScrollType(b);c&&(a._scrollType=c,v.listen(a,this.events),S(a).forEach(function(a){a._scrollType=c;v.listen(a,this.events)},this))},elementRemoved:function(a){a._scrollType=void 0;v.unlisten(a,this.events);S(a).forEach(function(a){a._scrollType= void 0;v.unlisten(a,this.events)},this)},elementChanged:function(a,b){var c=a.getAttribute("touch-action"),d=this.touchActionToScrollType(c);b=this.touchActionToScrollType(b);d&&b?(a._scrollType=d,S(a).forEach(function(a){a._scrollType=d},this)):b?this.elementRemoved(a):d&&this.elementAdded(a)},scrollTypes:{EMITTER:"none",XSCROLLER:"pan-x",YSCROLLER:"pan-y",SCROLLER:/^(?:pan-x pan-y)|(?:pan-y pan-x)|auto$/},touchActionToScrollType:function(a){var b=this.scrollTypes;if("none"===a)return"none";if(a=== b.XSCROLLER)return"X";if(a===b.YSCROLLER)return"Y";if(b.SCROLLER.exec(a))return"XY"},POINTER_TYPE:"touch",firstTouch:null,isPrimaryTouch:function(a){return this.firstTouch===a.identifier},setPrimaryTouch:function(a){if(0===R.size||1===R.size&&R.has(1))this.firstTouch=a.identifier,this.firstXY={X:a.clientX,Y:a.clientY},this.scrolling=!1,this.cancelResetClickCount()},removePrimaryPointer:function(a){a.isPrimary&&(this.firstXY=this.firstTouch=null,this.resetClickCount())},clickCount:0,resetId:null,resetClickCount:function(){var a= function(){this.clickCount=0;this.resetId=null}.bind(this);this.resetId=setTimeout(a,200)},cancelResetClickCount:function(){this.resetId&&clearTimeout(this.resetId)},typeToButtons:function(a){var b=0;if("touchstart"===a||"touchmove"===a)b=1;return b},touchToPointer:function(a){var b=this.currentTouchEvent,c=v.cloneEvent(a),d=c.pointerId=a.identifier+2;c.target=O[d]||N(c);c.bubbles=!0;c.cancelable=!0;c.detail=this.clickCount;c.button=0;c.buttons=this.typeToButtons(b.type);c.width=a.radiusX||a.webkitRadiusX|| 0;c.height=a.radiusY||a.webkitRadiusY||0;c.pressure=a.force||a.webkitForce||.5;c.isPrimary=this.isPrimaryTouch(a);c.pointerType=this.POINTER_TYPE;c.altKey=b.altKey;c.ctrlKey=b.ctrlKey;c.metaKey=b.metaKey;c.shiftKey=b.shiftKey;var e=this;c.preventDefault=function(){e.scrolling=!1;e.firstXY=null;b.preventDefault()};return c},processTouches:function(a,b){var c=a.changedTouches;this.currentTouchEvent=a;a=0;for(var d;a=Math.abs(a["client"+c]-this.firstXY[c])}this.firstXY=null;return b}},findTouch:function(a,b){for(var c=0,d=a.length,e;c=b.length){var c=[];R.forEach(function(a,d){1===d||this.findTouch(b,d-2)||c.push(a.out)},this);c.forEach(this.cancelOut, this)}},touchstart:function(a){this.vacuumTouches(a);this.setPrimaryTouch(a.changedTouches[0]);this.dedupSynthMouse(a);this.scrolling||(this.clickCount++,this.processTouches(a,this.overDown))},overDown:function(a){R.set(a.pointerId,{target:a.target,out:a,outTarget:a.target});v.enterOver(a);v.down(a)},touchmove:function(a){this.scrolling||(this.shouldScroll(a)?(this.scrolling=!0,this.touchcancel(a)):(a.preventDefault(),this.processTouches(a,this.moveOverOut)))},moveOverOut:function(a){var b=R.get(a.pointerId); if(b){var c=b.out,d=b.outTarget;v.move(a);c&&d!==a.target&&(c.relatedTarget=a.target,a.relatedTarget=d,c.target=d,a.target?(v.leaveOut(c),v.enterOver(a)):(a.target=d,a.relatedTarget=null,this.cancelOut(a)));b.out=a;b.outTarget=a.target}},touchend:function(a){this.dedupSynthMouse(a);this.processTouches(a,this.upOut)},upOut:function(a){this.scrolling||(v.up(a),v.leaveOut(a));this.cleanUpPointer(a)},touchcancel:function(a){this.processTouches(a,this.cancelOut)},cancelOut:function(a){v.cancel(a);v.leaveOut(a); this.cleanUpPointer(a)},cleanUpPointer:function(a){R.delete(a.pointerId);this.removePrimaryPointer(a)},dedupSynthMouse:function(a){var b=J.lastTouches;a=a.changedTouches[0];this.isPrimaryTouch(a)&&(a={x:a.clientX,y:a.clientY},b.push(a),b=function(a,b){b=a.indexOf(b);-1r;r++)a[r]=String.fromCharCode(r);for(r=1;25>r;r++)a[111+r]="F"+r;for(r=65;91>r;r++)a[r]=[String.fromCharCode(r+32),String.fromCharCode(r)];var e={Left:"ArrowLeft",Right:"ArrowRight",Up:"ArrowUp",Down:"ArrowDown",Esc:"Escape"};h.eventKey=function(c){if(void 0!==c.key)return e[c.key]||c.key;var g=a[c.keyCode];return Array.isArray(g)?c.shiftKey?g[1]:g[0]:g};h.isSystemModifier=function(a){switch(a){case "Ctrl":case "Alt":case "Shift":case "Meta":case "Primary":return!0}}})}, "esri/views/input/InputManager":function(){define("require exports ../../core/tsSupport/declareExtendsHelper ../../core/tsSupport/decorateHelper ../../core/Accessor ../../core/Logger ../../core/now ../../core/accessorSupport/decorators ./keys ./recognizers ./handlers/LatestPointerType".split(" "),function(r,h,f,a,e,c,g,d,b,k,l){Object.defineProperty(h,"__esModule",{value:!0});var p=c.getLogger("esri.views.input.InputManager");r=function(c){function e(a,d){a=c.call(this)||this;a._pointerCaptures=new Map; a._nameToGroup={};a._handlers=[];a._currentPropagation=null;a._sourceEvents=new Set;a._keyModifiers=new Set;a._activeKeyModifiers=new Set;a.primaryKey=b.primaryKey;a.latestPointerType="mouse";a._installRecognizers();return a}f(e,c);e.prototype.normalizeCtorArgs=function(a,b){this._browserEvents=a;this._browserEvents.onEventReceived=this._onEventReceived.bind(this);this._recognizers=b;this._recognizers||(this._recognizers=k.defaults.map(function(a){return new a}));return{}};e.prototype.destroy=function(){for(var a= 0,b=Object.keys(this._nameToGroup);aa.keyModifiers.length?-1:1}},f=0,k=b.handler.incomingEventMatches;fb.priorityIndex?-1:1};e.prototype._sortHandlersPriority=function(a){for(var b=[],c=0;cMath.PI;)c-=2*Math.PI;for(;c<-Math.PI;)c+=2*Math.PI;c=a.lastAngle+c;a.lastAngle=c;e+=c-a.initialAngle}); e/=a.size||1;return{angle:e,radius:d.radius,center:d.center}}function d(a){var b=new Map;a.forEach(function(a,c){return b.set(c,a.event)});return b}function b(a,b){a=a.event;return Math.atan2(a.y-b.center.y,a.x-b.center.x)}Object.defineProperty(h,"__esModule",{value:!0});r=function(a){function e(){var b=a.call(this,!1)||this;b.startStateModifiers=new Set;b.activePointerMap=new Map;b.isDragging=!1;b.drag=b.registerOutgoing("drag");b.registerIncoming("pointer-drag",b.handlePointerDrag.bind(b));b.registerIncoming("pointer-up", b.handlePointerUpAndPointerLost.bind(b));b.registerIncoming("pointer-capture-lost",b.handlePointerUpAndPointerLost.bind(b));return b}f(e,a);e.prototype.createPayload=function(a,b,c,e){return{action:a,pointerType:this.pointerType,button:this.mouseButton,buttons:b.buttons,timestamp:e,pointers:d(this.activePointerMap),pointer:b,angle:c.angle,radius:c.radius,center:c.center}};e.prototype.addPointer=function(a){var d=a.native.pointerId,e=g(this.activePointerMap).angle;a={event:a,initialAngle:0,lastAngle:0}; this.activePointerMap.set(d,a);d=b(a,c(this.activePointerMap));a.initialAngle=d;a.lastAngle=d;this.updatePointerAngles(e)};e.prototype.updatePointer=function(a){if(!a||null!=a.x||null!=a.y){var b=this.activePointerMap.get(a.native.pointerId);b?b.event=a:this.addPointer(a)}};e.prototype.removePointer=function(a){var b=g(this.activePointerMap).angle;this.activePointerMap.delete(a);this.updatePointerAngles(b)};e.prototype.updatePointerAngles=function(a){var c=g(this.activePointerMap);this.activePointerMap.forEach(function(d){d.initialAngle= b(d,c)-a;d.lastAngle=b(d,c)-a})};e.prototype.emitEvent=function(a,b,c){var d=g(this.activePointerMap);this.drag.emit(this.createPayload(a,b,d,c),void 0,this.startStateModifiers)};e.prototype.handlePointerUpAndPointerLost=function(a){var b=a.data.native.pointerId,c=a.timestamp;this.activePointerMap.get(b)&&(1===this.activePointerMap.size?(this.updatePointer(a.data),this.emitEvent("end",a.data,c),this.isDragging=!1,this.removePointer(b)):(this.removePointer(b),this.emitEvent("removed",a.data,a.timestamp)))}; e.prototype.handlePointerDrag=function(a){var b=a.data,c=b.currentEvent,d=a.timestamp;switch(b.action){case "start":case "update":this.isDragging?this.activePointerMap.has(c.native.pointerId)?(this.updatePointer(c),this.emitEvent("update",c,d)):(this.addPointer(c),this.emitEvent("added",c,d)):(this.updatePointer(c),this.pointerType=a.data.startEvent.pointerType,this.mouseButton=a.data.startEvent.button,this.startStateModifiers=a.modifiers,this.isDragging=!0,this.emitEvent("start",c,d))}};return e}(a.InputHandler); h.Drag=r;(function(a){a[a.Left=0]="Left";a[a.Middle=1]="Middle";a[a.Right=2]="Right";a[a.Back=3]="Back";a[a.Forward=4]="Forward";a[a.Undefined=-1]="Undefined"})(h.Button||(h.Button={}))})},"esri/views/input/recognizers/support":function(){define(["require","exports"],function(r,h){Object.defineProperty(h,"__esModule",{value:!0});h.manhattanDistance=function(f,a){return Math.abs(a.x-f.x)+Math.abs(a.y-f.y)};h.euclideanDistance=function(f,a){var e=a.x-f.x;f=a.y-f.y;return Math.sqrt(e*e+f*f)};h.fitCircleLSQ= function(f,a){a?(a.radius=0,a.center.x=0,a.center.y=0):a={radius:0,center:{x:0,y:0}};if(0===f.length)return a;if(1===f.length)return a.center.x=f[0].x,a.center.y=f[0].y,a;if(2===f.length){var e=f[0];f=f[1];var c=[f.x-e.x,f.y-e.y],g=c[0],c=c[1];a.radius=Math.sqrt(g*g+c*c)/2;a.center.x=(e.x+f.x)/2;a.center.y=(e.y+f.y)/2;return a}for(var d=0,b=0,k=0;k("touch"===b.native.pointerType?this.movementUntilTouchDrag:this.movementUntilMouseDrag)&&this.startDragging(a),c.previousEvent=b)};c.prototype.startDragging=function(a){var b=this,c=a.data,d=c.native.pointerId;this._pointerState.forEach(function(e){0!==e.holdTimeout&&(clearTimeout(e.holdTimeout),e.holdTimeout=0);e.isDragging||(e.modifiers=a.modifiers,e.isDragging=!0,d===e.startEvent.native.pointerId?b._pointerDrag.emit(b._createPointerDragData("start",e,c)):b._pointerDrag.emit(b._createPointerDragData("start", e,e.previousEvent),a.timestamp))})};c.prototype._handlePointerUpOrLost=function(a){var b=a.data,c=b.native.pointerId,d=this._pointerState.get(c);d&&(0!==d.holdTimeout&&clearTimeout(d.holdTimeout),d.isDragging?this._pointerDrag.emit(this._createPointerDragData("end",d,b),void 0,d.modifiers):d.downButton===b.native.button&&a.timestamp-d.startTimestamp<=this.maximumClickDelay&&!d.holdEmitted&&this._immediateClick.emit(b),this._pointerState.delete(c),this.stopCapturingPointer(b.native),0===this._pointerState.size&& this._moveHandle.pause())};return c}(a.InputHandler);h.PointerClickHoldAndDrag=r})},"esri/views/input/recognizers/SingleAndDoubleClick":function(){define(["require","exports","../../../core/tsSupport/extendsHelper","../InputHandler","./support"],function(r,h,f,a,e){Object.defineProperty(h,"__esModule",{value:!0});h.DefaultParameters={maximumDoubleClickDelay:250,maximumDoubleClickDistance:10,maximumDoubleTouchDelay:350,maximumDoubleTouchDistance:35};r=function(a){function c(c,b,e,g){void 0===c&&(c= h.DefaultParameters.maximumDoubleClickDelay);void 0===b&&(b=h.DefaultParameters.maximumDoubleClickDistance);void 0===e&&(e=h.DefaultParameters.maximumDoubleTouchDelay);void 0===g&&(g=h.DefaultParameters.maximumDoubleTouchDistance);var d=a.call(this,!1)||this;d.maximumDoubleClickDelay=c;d.maximumDoubleClickDistance=b;d.maximumDoubleTouchDelay=e;d.maximumDoubleTouchDistance=g;d._pointerState=new Map;d._click=d.registerOutgoing("click");d._doubleClick=d.registerOutgoing("double-click");d.registerIncoming("immediate-click", d._handleImmediateClick.bind(d));return d}f(c,a);c.prototype.onUninstall=function(){this._pointerState.forEach(function(a){0!==a.doubleClickTimeout&&(clearTimeout(a.doubleClickTimeout),a.doubleClickTimeout=0)})};c.prototype._pointerId=function(a){a=a.native;return"mouse"===a.pointerType?a.pointerId+":"+a.button:""+a.pointerType};c.prototype._handleImmediateClick=function(a){var b=a.data,c=this._pointerId(b),d=this._pointerState.get(c);if(d){clearTimeout(d.doubleClickTimeout);d.doubleClickTimeout= 0;var g="touch"===b.native.pointerType?this.maximumDoubleTouchDistance:this.maximumDoubleClickDistance;e.manhattanDistance(d.event.data,b)>g?(this._doubleClickTimeoutExceeded(c),this._startClick(a)):(this._doubleClick.emit(b,void 0,d.event.modifiers),this._pointerState.delete(c))}else this._startClick(a)};c.prototype._startClick=function(a){var b=this,c=this._pointerId(a.data);this._pointerState.set(c,{event:a,doubleClickTimeout:setTimeout(function(){return b._doubleClickTimeoutExceeded(c)},"touch"=== a.data.native.pointerType?this.maximumDoubleTouchDelay:this.maximumDoubleClickDelay)})};c.prototype._doubleClickTimeoutExceeded=function(a){var b=this._pointerState.get(a);this._click.emit(b.event.data,void 0,b.event.modifiers);b.doubleClickTimeout=0;this._pointerState.delete(a)};return c}(a.InputHandler);h.SingleAndDoubleClick=r})},"esri/views/input/recognizers/VerticalTwoFingerDrag":function(){define(["require","exports","../../../core/tsSupport/extendsHelper","../DragEventSeparator","../InputHandler"], function(r,h,f,a,e){Object.defineProperty(h,"__esModule",{value:!0});r=function(c){function e(d,b){void 0===d&&(d=20);void 0===b&&(b=40);var e=c.call(this,!1)||this;e._threshold=d;e._maxDelta=b;e.state="ready";e.emittedArtificalEnd2=!1;e._vertical=e.registerOutgoing("vertical-two-finger-drag");e._artificalDrag=e.registerOutgoing("drag");e.dragEventSeparator=new a.DragEventSeparator({start:function(a,b){return e.observeStart(a,b)},update:function(a,b,c){return e.observeUpdate(a,b,c)},end:function(a, b){return e.observeEnd(a,b)}});e.registerIncoming("drag",function(a){return e.dragEventSeparator.handle(a)});return e}f(e,c);Object.defineProperty(e.prototype,"failed",{get:function(){return"failed"===this.state},enumerable:!0,configurable:!0});e.prototype.observeStart=function(a,b){1===a&&this.emittedArtificalEnd2&&(this.emittedArtificalEnd2=!1,this._artificalDrag.emit({action:"start",button:b.data.button,buttons:b.data.buttons,pointerType:b.data.pointerType,timestamp:b.data.timestamp,pointers:b.data.pointers, pointer:b.data.pointer,angle:b.data.angle,radius:b.data.radius,center:b.data.center,artifical:!0}),b.stopPropagation());this.state=2===a?"ready":"failed"};e.prototype.observeUpdate=function(a,b,c){"failed"!==this.state&&2===a&&("active"===this.state?(this._vertical.emit({delta:b.data.center.y-this._thresholdReachedCenter.y,action:"update"}),b.stopPropagation()):this.checkMovementWithinLimits(b.data,c.data)?this.checkVerticalThresholdReached(b.data,c.data)&&(this.state="active",this.emittedArtificalEnd2= !0,this._thresholdReachedCenter=b.data.center,this._artificalDrag.emit({action:"end",button:b.data.button,buttons:b.data.buttons,pointerType:b.data.pointerType,timestamp:b.data.timestamp,pointers:b.data.pointers,pointer:b.data.pointer,angle:b.data.angle,radius:b.data.radius,center:b.data.center,artifical:!0}),this._vertical.emit({delta:b.data.center.y-this._thresholdReachedCenter.y,action:"begin"}),b.stopPropagation()):this.state="failed")};e.prototype.observeEnd=function(a,b){"active"===this.state&& (this._vertical.emit({delta:b.data.center.y-this._thresholdReachedCenter.y,action:"end"}),this.state="ready",b.stopPropagation())};e.prototype.checkMovementWithinLimits=function(a,b){var c=-Infinity,d=Infinity,e=-Infinity,g=Infinity;b.pointers.forEach(function(a){c=Math.max(c,a.x);d=Math.min(d,a.x);e=Math.max(e,a.y);g=Math.min(g,a.y)});var f=-Infinity,u=Infinity,q=-Infinity,v=Infinity;a.pointers.forEach(function(a){f=Math.max(f,a.x);u=Math.min(u,a.x);q=Math.max(q,a.y);v=Math.min(v,a.y)});return Math.abs(a.center.x- b.center.x)=this._threshold};return e}(e.InputHandler);h.VerticalTwoFingerDrag=r})},"esri/views/input/DragEventSeparator":function(){define(["require","exports"],function(r,h){Object.defineProperty(h,"__esModule",{value:!0}); r=function(){function f(a){this.callbacks=a;this.currentCount=0;this.callbacks.condition||(this.callbacks.condition=function(){return!0})}f.prototype.handle=function(a){var e=a.data,c=e.pointers.size;switch(e.action){case "start":this.currentCount=c;this.emitStart(a);break;case "added":this.emitEnd(this.previousEvent);this.currentCount=c;this.emitStart(a);break;case "update":this.emitUpdate(a);break;case "removed":this.startEvent&&this.emitEnd(this.previousEvent);this.currentCount=c;this.emitStart(a); break;case "end":this.emitEnd(a),this.currentCount=0}this.previousEvent=a};f.prototype.emitStart=function(a){this.startEvent=a;this.callbacks.condition(this.currentCount,a)&&this.callbacks.start(this.currentCount,a,this.startEvent)};f.prototype.emitUpdate=function(a){this.callbacks.condition(this.currentCount,a)&&this.callbacks.update(this.currentCount,a,this.startEvent)};f.prototype.emitEnd=function(a){this.callbacks.condition(this.currentCount,a)&&this.callbacks.end(this.currentCount,a,this.startEvent); this.startEvent=null};return f}();h.DragEventSeparator=r})},"esri/views/input/handlers/LatestPointerType":function(){define(["require","exports","../../../core/tsSupport/extendsHelper","../InputHandler"],function(r,h,f,a){Object.defineProperty(h,"__esModule",{value:!0});r=function(a){function c(c){var d=a.call(this,!0)||this;d._onChange=c;d._value="mouse";d.registerIncoming("pointer-down",function(a){d._setValue("touch"===a.data.native.pointerType?"touch":"mouse")});d._moveHandler=d.registerIncoming("pointer-move", function(a){d._setValue("touch"===a.data.native.pointerType?"touch":"mouse")});d._moveHandler.pause();return d}f(c,a);c.prototype._setValue=function(a){a!==this._value&&("touch"===a?this._moveHandler.resume():this._moveHandler.pause(),this._value=a,this._onChange(a))};return c}(a.InputHandler);h.LatestPointerType=r})},"esri/views/input/ViewEvents":function(){define("require exports ../../core/tsSupport/extendsHelper ../../geometry/ScreenPoint ../3d/support/mathUtils ./InputHandler".split(" "),function(r, h,f,a,e,c){function g(a){return!!b[a]}function d(a){for(var b=0;bm.xmax&&(m.xmax=c),em.ymax&&(m.ymax=g)):this.computedExtent=m=new l(b,e,c,g,a.spatialReference);if(M.isFinite(f)&&!M.isFinite(k)){if(null==m.zmin||fm.zmax)m.zmax=k}this.onComputedExtentChange&&this.onComputedExtentChange()}};d.prototype.updateHasDraped=function(){this.hasDraped=!1;for(var a in this.graphicsDrapedIds)if(this.graphicsDrapedIds.hasOwnProperty(a)){this.hasDraped= !0;break}};d.prototype.elevationInfoChange=function(){R(this.layer);var a=C.extractExpressionInfo(this.layer.elevationInfo,this.elevationFeatureExpressionEnabled);this.symbolCreationContext.featureExpressionInfoContext=C.createContext(a,this.viewSR,Q);this.labeling&&this.labeling.elevationInfoChange();this.layer.renderer!==this.symbolCreationContext.renderer&&this.rendererChange(this.layer.renderer);for(var b in this.graphicsBySymbol){var c=this.symbols[b],a=this.graphicsBySymbol[b];if(c&&c.layerPropertyChanged("elevationInfo", a)){for(var d in a){var e=a[d],c=e.graphic,e=e._labelGraphics;this.elevation&&this.elevation.markGraphicElevationDirty(c.uid);for(var g=0;gd[0]&&a[1]=N|| Math.abs(t[1]-E[G+1])>=N||Math.abs(t[2]-E[G+2])>=N)H=!0;G+=I}v+=J/P;H&&b.geometryVertexAttrsUpdated(x)}return v/m};h.perObjectElevationAligner=function(b,c,f,k,l){var m=c.centerPointInElevationSR,n=0;l=0;if(b.metadata.usesVerticalDistanceToGround)n=a.computeElevation(f,m,c,k,u),e.updateVertexAttributeAuxpos1w(b,u.verticalDistanceToGround),l=u.terrainElevation;else{var q="absolute-height"!==c.mode,n=a.computeElevation(f,m,c,k,q?u:null);q&&(l=u.terrainElevation)}c=b.getObjectTransformation();f=[c[12], c[13],c[14]];g.DISABLE_ELEVATION_ALIGNERS_ITERATIVE_UPDATES?(p[0]=m.x,p[1]=m.y,p[2]=n,d.computeLinearTransformation(m.spatialReference,p,c,k.spatialReference)&&b.setObjectTransformation(c)):k.setAltitudeOfTransformation(n,c);k=h.updateThresholdInMeters/k.unitInMeters;(Math.abs(c[12]-f[0])>=k||Math.abs(c[13]-f[1])>=k||Math.abs(c[14]-f[2])>=k)&&b.setObjectTransformation(c);return l};h.updateThresholdInMeters=.01;h.iterativeUpdatesEnabled=!0})},"esri/views/3d/layers/graphics/Graphics3DSymbolCommonCode":function(){define("require exports ../../../../geometry/Point ../../../../geometry/support/coordsUtils ../../../../geometry/support/triangulationUtils ../../../../symbols/callouts/calloutUtils ./graphicUtils ../../lib/glMatrix ../../support/projectionUtils ../../webgl-engine/lib/Object3D".split(" "), function(r,h,f,a,e,c,g,d,b,k){function l(a,b,c,d,e){var g=0,f=b.z||0,k=0,k=c.mode;d=c.calculateOffsetRenderUnits(d);c=c.featureExpressionInfoContext;"on-the-ground"===k?(g=k=a.getElevation(b,"ground")||0,e&&(e.verticalDistanceToGround=0,e.terrainElevation=k)):"relative-to-ground"===k?(k=a.getElevation(b,"ground")||0,g=d,null==c&&(g+=f),e&&(e.verticalDistanceToGround=g,e.terrainElevation=k),g+=k):"relative-to-scene"===k?(k=a.getElevation(b,"scene")||0,g=d,e&&(e.verticalDistanceToGround=g,e.terrainElevation= k),g+=k):"absolute-height"===k&&(g=d,null==c&&(g+=f),e&&(k=a.getElevation(b,"ground")||0,e.verticalDistanceToGround=g-k,e.terrainElevation=k));return g}function p(a,b){a=e.pathsToTriangulationInfo(a,b);return{vertexData:a.position,polygons:a.polygons,outlines:a.outlines}}function n(a,b,c,d,e){b*=3;d*=3;for(var g=0;g b[3]||a[0]b[4]||a[1]a[3]||b[3]a[4]||b[4]d[3]&&(d[3]=g);f>d[4]&&(d[4]=f);k>d[5]&&(d[5]=k)}return d};h.pointInBox2D=q;h.boxesIntersect2D=v;h.boundingBoxClipped=function(a,b){return b?!v(a,b):!1};h.needsElevationUpdates2D=function(a){return"relative-to-ground"===a||"relative-to-scene"===a};h.needsElevationUpdates3D=function(a){return"absolute-height"!==a};h.needsOffsetAdjustment=function(a, b,d,e){if(!1===b.needsOffsetAdjustment||!1===b.supportsOffsetAdjustment||"on-the-ground"===a.mode)return!1;if(0===a.meterUnitOffset){if(!0===b.needsOffsetAdjustment)return!0;if(c.isCalloutSupport(e)&&e.hasVisibleVerticalOffset())return!1;if("relative-to-ground"===a.mode&&(!d.hasZ||a.featureExpressionInfoContext)||"relative-to-scene"===a.mode)return!0}return!1};var z={verticalDistanceToGround:0,terrainElevation:0}})},"esri/views/3d/layers/graphics/graphicUtils":function(){define(["require","exports", "../../../../geometry","../../../../geometry/support/webMercatorUtils","../../lib/glMatrix"],function(r,h,f,a,e){function c(b,c){var d=b.spatialReference;d.equals(c)||(d.isWebMercator&&c.wkid===f.SpatialReference.WGS84.wkid?a.webMercatorToGeographic(b,!1,b):c.isWebMercator&&d.wkid===f.SpatialReference.WGS84.wkid&&a.geographicToWebMercator(b,!1,b))}function g(a){if(Array.isArray(a)){for(var b=0;bf;++f)g[f]=a&&null!=a[f]?a[f]:c&&null!=c[f]?c[f]:e[f];g[3]=null!=b?b:null!=d?d:e[3];return g};h.computeObjectScale=function(a,b,c,d){void 0===a&&(a=k);void 0===d&&(d=1);var e=Array(3);if(null==b||null==c)e[0]=1,e[1]=1,e[2]=1;else{for(var g=void 0,f=0,l=2;0<=l;l--){var m=a[l],n=void 0,p=null!=m,t=0===l&&!g&&!p,h=c[l];"symbolValue"===m||t?n=0!==h?b[l]/h:1:p&&"proportional"!== m&&isFinite(m)&&(n=0!==h?m/h:1);null!=n&&(g=e[l]=n,f=Math.max(f,Math.abs(n)))}for(l=2;0<=l;l--)null==e[l]?e[l]=g:0===e[l]&&(e[l]=.001*f)}for(l=2;0<=l;l--)e[l]/=d;return e};h.computeSizeWithResourceSize=function(a,b){var c=b.width,d=b.depth,e=b.height;b=b.isPrimitive?10:1;if(null==c&&null==e&&null==d)return[b*a[0],b*a[1],b*a[2]];for(var c=[c,d,e],g,d=0;3>d;d++)if(e=c[d],null!=e){g=e/a[d];break}for(d=0;3>d;d++)null==c[d]&&(c[d]=a[d]*g);return c};h.validateSymbolLayerSize=function(a){null!=a.isPrimitive&& (a=[a.width,a.depth,a.height]);return g(a)?null:"Symbol sizes may not be negative values"};h.computeObjectRotation=function(a,c,d,e){void 0===e&&(e=b.identity());a=a||0;c=c||0;d=d||0;0!==a&&b.rotateZ(e,-a/180*Math.PI,e);0!==c&&b.rotateX(e,c/180*Math.PI,e);0!==d&&b.rotateY(e,d/180*Math.PI,e);return e}})},"esri/views/3d/support/debugFlags":function(){define("require exports ../../../core/tsSupport/extendsHelper ../../../core/tsSupport/decorateHelper ../../../core/Accessor ../../../core/accessorSupport/decorators".split(" "), function(r,h,f,a,e,c){return new (function(e){function d(){var a=null!==e&&e.apply(this,arguments)||this;a.SCENEVIEW_HITTEST_RETURN_SELECTOR=!1;a.SCENEVIEW_LOCKING_LOG=!1;a.HIGHLIGHTS_GRID_OPTIMIZATION_DISABLED=!1;a.HIGHLIGHTS_VISUALIZE_BLOCKS=!1;a.HIGHLIGHTS_PROFILE_TO_CONSOLE=!1;a.DECONFLICTOR_SHOW_OUTLINES=!1;a.DECONFLICTOR_SHOW_GRID=!1;a.LABELS_SHOW_BORDER=!1;a.OVERLAY_DRAW_TEST_TEXTURE=!1;a.OVERLAY_SHOW_CENTER=!1;a.TESTS_DISABLE_UPDATE_THROTTLE_THRESHOLDS=!1;a.DISABLE_POI_UPDATE_ON_SURFACE_GEOMETRY_CHANGES= !1;a.DISABLE_ELEVATION_ALIGNERS_ITERATIVE_UPDATES=!1;a.DRAW_MESH_GEOMETRY_NORMALS=!1;return a}f(d,e);a([c.property()],d.prototype,"SCENEVIEW_HITTEST_RETURN_SELECTOR",void 0);a([c.property()],d.prototype,"SCENEVIEW_LOCKING_LOG",void 0);a([c.property()],d.prototype,"HIGHLIGHTS_GRID_OPTIMIZATION_DISABLED",void 0);a([c.property()],d.prototype,"HIGHLIGHTS_VISUALIZE_BLOCKS",void 0);a([c.property()],d.prototype,"HIGHLIGHTS_PROFILE_TO_CONSOLE",void 0);a([c.property()],d.prototype,"DECONFLICTOR_SHOW_OUTLINES", void 0);a([c.property()],d.prototype,"DECONFLICTOR_SHOW_GRID",void 0);a([c.property()],d.prototype,"LABELS_SHOW_BORDER",void 0);a([c.property()],d.prototype,"OVERLAY_DRAW_TEST_TEXTURE",void 0);a([c.property()],d.prototype,"OVERLAY_SHOW_CENTER",void 0);a([c.property()],d.prototype,"TESTS_DISABLE_UPDATE_THROTTLE_THRESHOLDS",void 0);a([c.property()],d.prototype,"DISABLE_POI_UPDATE_ON_SURFACE_GEOMETRY_CHANGES",void 0);a([c.property()],d.prototype,"DISABLE_ELEVATION_ALIGNERS_ITERATIVE_UPDATES",void 0); a([c.property()],d.prototype,"DRAW_MESH_GEOMETRY_NORMALS",void 0);return d=a([c.subclass()],d)}(c.declared(e)))})},"esri/views/3d/layers/graphics/Graphics3DGraphicLayer":function(){define("require exports ../../../../core/tsSupport/extendsHelper ../../../../core/tsSupport/generatorHelper ../../../../core/tsSupport/awaiterHelper ./featureExpressionInfoUtils ./Graphics3DGraphicElevationContext ../../lib/glMatrix ../../support/aaBoundingBox ../../webgl-engine/Stage".split(" "),function(r,h,f,a,e,c,g, d,b,k){r=d.vec3d;var l=d.mat4d,p=[0,0,0];d=function(){function d(a,b,c,e,f,k,l,n){this._addedToStage=!1;this.alignedTerrainElevation=0;this.needsElevationUpdates=!1;this.graphics3DSymbolLayer=a;this.uniqueMaterials=e;this.uniqueGeometries=c;this.uniqueTextures=f;this.stageObject=b;this.elevationAligner=k;this.elevationContext=new g(l);this.stageLayer=this.stage=null;this._visible=!1;this.visibilityMode=null!=n?n:d.VisibilityModes.HIDE_FACERANGE}d.prototype.initialize=function(a,b){this.stageLayer= a;this.stage=b;if(this.uniqueMaterials)for(a=0;aB;B++)e[B]=Math.min(e[B],n[q+B]),e[B+3]=Math.max(e[B+3],n[q+B]);v&&f.push({location:n.slice(q,q+3),screenSpaceBoundingRect:v})}if(!d)return[3,5]; b.center(e,p);if("absolute-height"===this.elevationContext.mode)return[3,5];x=void 0;a.label=1;case 1:return a.trys.push([1,3,,4]),[4,d.queryElevation(p[0],p[1])];case 2:return x=a.sent(),[3,4];case 3:return a.sent(),x=null,[3,4];case 4:null!=x&&b.offset(e,0,0,-this.alignedTerrainElevation+x),a.label=5;case 5:return[2,e];case 6:return[2,null]}})})};d.prototype.addHighlight=function(a,b){b=this.stageObject.highlightAllComponents(b);a.addObject(this.stageObject,b)};d.prototype.removeHighlight=function(a){a.removeObject(this.stageObject)}; d.VisibilityModes={REMOVE_OBJECT:0,HIDE_FACERANGE:1};return d}();var n=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],t=r.create(),u=[[0,1,2],[3,1,2],[0,4,2],[3,4,2],[0,1,5],[3,1,5],[0,4,5],[3,4,5]];return d})},"esri/views/3d/layers/graphics/Graphics3DGraphicElevationContext":function(){define(["require","exports","../../../../core/tsSupport/extendsHelper","./ElevationContext"],function(r,h,f,a){return function(a){function c(c){c=a.call(this,c)||this;c.centerPointInElevationSR=null;return c}f(c, a);return c}(a)})},"esri/views/3d/layers/graphics/ElevationContext":function(){define(["require","exports","../../../../symbols/support/unitConversionUtils","./featureExpressionInfoUtils"],function(r,h,f,a){return function(){function e(a){a?this.set(a):this.setDefaults()}Object.defineProperty(e.prototype,"meterUnitOffset",{get:function(){return this._meterUnitOffset},enumerable:!0,configurable:!0});Object.defineProperty(e.prototype,"unit",{get:function(){return this._unit},enumerable:!0,configurable:!0}); e.prototype.setUnit=function(a){this._unit=a;this._metersPerElevationInfoUnit=f.getMetersPerUnit(a)};e.prototype.setDefaults=function(){this.mode=null;this._renderUnitOffset=this._meterUnitOffset=0;this.featureExpressionInfoContext=null;this.hasOffsetAdjustment=!1;this.setUnit("meters")};e.prototype.set=function(a){this.mode=a.mode;this._meterUnitOffset=a._meterUnitOffset||0;this._renderUnitOffset=a._renderUnitOffset||0;this.featureExpressionInfoContext=a.featureExpressionInfoContext;this.hasOffsetAdjustment= a.hasOffsetAdjustment;this.setUnit(a.unit)};e.prototype.setOffsetMeters=function(a){this._meterUnitOffset=a;this._renderUnitOffset=0};e.prototype.setOffsetElevationInfoUnits=function(a){this._meterUnitOffset=a*this._metersPerElevationInfoUnit;this._renderUnitOffset=0};e.prototype.setOffsetRenderUnits=function(a){this._meterUnitOffset=0;this._renderUnitOffset=a};e.prototype.addOffsetRenderUnits=function(a){this._renderUnitOffset+=a};e.prototype.mixinApi=function(a){null!=a.mode&&(this.mode=a.mode); null!=a.unit&&this.setUnit(a.unit);null!=a.offset&&this.setOffsetElevationInfoUnits(a.offset)};e.prototype.calculateOffsetRenderUnits=function(c){var e=this._meterUnitOffset,d=this.featureExpressionInfoContext;null!=d&&(e+=a.execute(d)*this._metersPerElevationInfoUnit);return e/c.unitInMeters+this._renderUnitOffset};return e}()})},"esri/views/3d/webgl-engine/Stage":function(){define("require exports ./lib/Camera ./lib/gl-matrix ./lib/ModelContentType ./lib/Selector ./lib/Util ./lighting/Lightsources ./parts/Model ./parts/View".split(" "), function(r,h,f,a,e,c,g,d,b,k){r=a.vec2d;h=a.vec2;var l=a.vec3d;a=function(){function a(a,e,g){this._intersectTolerance=c.DEFAULT_TOLERANCE;this._viewContent=[];this._externalIntersectionHandlers=[];this.container=e;this.viewingMode=a;this.model=new b;this.view=new k(e,this,this.model.getDirtySet(),g);this._validateHUDSelector=new c(this.viewingMode);this._validateHUDSelector.enableHUDSelection=!1;this.view.setLighting({lights:[new d.MainLight(l.createFrom(.7,.7,.7)),new d.AmbientLight(l.createFrom(.3, .3,.3))],groundLightingFactor:.5,globalFactor:.5})}a.prototype.setNeedsRender=function(){this.view.setNeedsRender()};a.prototype.dispose=function(){this.view.dispose();this.model=this.view=null};a.prototype.frame=function(a,b){void 0===b&&(b=0);var c=Math.max(1E-6,a.getBSRadius());b=Math.max(2,b+2);b*=c;var c=this.getCamera(),d=l.create(c.viewForward);l.scale(d,-(1.5*b/Math.tan(c.fov)));l.set(a.getCenter(),c.center);l.add(c.center,d,c.eye);c=new f(c.eye,c.center,c.up);this.setCamera(c)};a.prototype.beginMod= function(){a.DebugSettings.fineGrainedContentValidation&&this.model.validateContent()};a.prototype.endMod=function(b){void 0===b&&(b=!1);a.DebugSettings.fineGrainedContentValidation&&!b&&this.model.validateContent()};a.prototype.add=function(a,b){this.model.add(a,b);"function"===typeof b.addParentStage&&b.addParentStage(this)};a.prototype.remove=function(a,b){a=this.model.remove(a,b);"function"===typeof a.removeParentStage&&a.removeParentStage(this);return a};a.prototype.notifyDirty=function(a,b, c,d){this.model.notifyDirty(a,b,c,d)};a.prototype.processDirty=function(){var b=this.model.getDirtySet(),c=b.getDirtyMaterials();if(b.hasDirtyGeometryRecords()||c){a.DebugSettings.endFrameContentValidation&&this.model.validateContent();a.DebugSettings.logDirtySet&&console.log("Dirty set: "+this.model.getDirtySet().formatDebugInfo(!1));var d=b.getAddRemoveUpdateListFilteredByLayers(this._viewContent,!0);(0=this._samples?"ssao8":16>=this._samples?"ssao16":32>=this._samples?"ssao32":"ssao64"),q=this._programRep.get("blur"),h=a.projectionMatrix;B[0]=-2/(m*h[0]);B[1]=-2/(p*h[5]);B[2]=(1-h[2])/h[0];B[3]=(1+h[6])/h[5];h=0===h[11];n.setUniform2f("rnmScale",f/E,l/E);n.setUniform3fv("pSphere", 8>=this._samples?z:16>=this._samples?C:32>=this._samples?A:D);g.bindProgram(n);n.setUniform1f("numSpiralTurns",this._samplesn||2>h||10*n>a-20||10*h>b-20?(k[l++]=255,k[l++]=255,k[l++]=255,k[l++]=255):(k[l++]=255,k[l++]=255,k[l++]=255,n&1&&h&1?k[l++]=p&1^m&1?0:255:k[l++]=n&1^h&1?0:128)}a= new q(g,{target:3553,pixelFormat:6408,dataType:5121,samplingMode:9728,width:a,height:b},k);this._testPatternMat=new t(this._programRep,a,[1,1,1,1],!0,f.ALWAYS);this._testPatternBindParams={proj:B.identity(),view:B.identity(),nearFar:[-1,1],origin:[0,0,0],viewInvTransp:null,viewport:null,lightingData:null,fovY:0};this._quadVAO=d.createQuadVAO(g,c.Pos3Tex)}this._testPatternMat.setColor([e[0],e[1],e[2],1]);this._testPatternMat.bind(g,this._testPatternBindParams);this._testPatternMat.bindView(g,this._testPatternBindParams); g.bindVAO(this._quadVAO);g.drawArrays(5,0,v.vertexCount(this._quadVAO,"geometry"));this._testPatternMat.release(g)};a.prototype.getOrigin=function(a,b){var c=0;b=10*b/1E4;1this._threshold);return b?K.Instanced:K.Merged};d.prototype._getTargetMat2Data=function(a){switch(a){case K.Merged:return this._mat2DataMerged;case K.Instanced:return this._mat2DataInstanced;case K.Preinterleaved:return this._mat2DataPreinterleaved}}; d.prototype._getOriginData=function(a,b,c){return this._getTargetMat2Data(a)[b].origin2data[c]};d.prototype._modifiedMergedFacerangesKey=function(a,b){return a+"_"+b};d.prototype._insertIntoRenderOrder=function(a,b,c){for(var d=a[u.MATERIAL].materialId,e=this._renderOrder.length,g=0;g=b;){var f=this._renderOrder[g][1];if(f.id===d){J(!f[c],"matData for type already exists");f[c]=a;return}g++}d={id:d,instanced:null,merged:null};d[c]=a;this._renderOrder.splice(g,0,[b,d])}; d.prototype._removeFromRenderOrder=function(a,b){var c=a[u.MATERIAL].materialId;for(a=0;this._renderOrder[a][1].id!==c;)a++;c=this._renderOrder[a][1];c[b]=null;c.instanced||c.merged||this._renderOrder.splice(a,1)};d.prototype._sortHighlightsByRenderOrder=function(){this._highlights.sort(function(a,b){a=a.matData[u.MATERIAL].renderPriority;b=b.matData[u.MATERIAL].renderPriority;return a>b?-1:b>a?1:0})};d.prototype._updateRenderOrder=function(a,b){for(var c=b.length,d=0;de?-1:1,d+=e;-1e*a;){var g=b[d];b[d]=b[d-e];b[d-e]=g;d+=e}}};d.prototype._modifyMaterials=function(a){for(var b in a)this._materialRep.updateMaterialParameters(b)};d.prototype.modifyRenderOrder=function(a){if(this._orderedRendering){for(var b in a)this._updateRenderOrder(b,this._renderOrder);this._sortHighlightsByRenderOrder();this._needsRender=!0}};d.prototype._initializeMatData= function(a){var b={origin2data:{}};b[u.MATERIAL]=this._materialRep.aquire(a);b[u.MATERIAL_DEPTH_SHADOWMAP]=this._materialRep.aquireDepthShadowMap(a);b[u.MATERIAL_NORMAL]=this._materialRep.aquireNormal(a);b[u.MATERIAL_DEPTH]=this._materialRep.aquireDepth(a);b[u.MATERIAL_HIGHLIGHT]=this._materialRep.aquireHighlight(a);return b};d.prototype._releaseMaterials=function(a){if(Array.isArray(a))for(var b=0;ba&&(a=f.nextHighestPowerOfTwo(a));this.array=new Float32Array(a);this.size=0}a.prototype.resize=function(a,c){void 0===c&&(c=!1);this.size= a;var e;if(this.size>this.array.length){for(a=this.array.length||1;a=e;)a=Math.floor(a/2);e=new Float32Array(a);c&&e.set(this.array.subarray(0,a));this.array=e;return!0}return!1};a.prototype.append=function(a){var c=this.size;this.resize(this.size+a.length,!0);this.array.set(a,c)};a.prototype.erase=function(a,c){for(;athis.array.length){for(c=this.array.length||1;c=a;)c/=2;a=new Float32Array(c);a.set(this.array.subarray(0,c));this.array=a}};return a}()})},"esri/views/3d/webgl-engine/lib/IntervalUtilities":function(){define(["require","exports"],function(r,h){return function(){function f(){} f.copyIntervals=function(a){for(var e=[],c=0;cc[1]?1:a[1]c[0]?1:a[0]=a.length)return[];for(var c=[],g=0;ge[1]||(d=[d[0],d[1]],d[0]e[1]&&(d[1]=e[1]),c.push(d))}return c};f.mergeIntervals=function(a){if(0>=a.length)return[];var e=[];a=this.sortIntervals(a);e.push(a[0]);for(var c=1;cg&&c.push([g,b[0]-1]);g=b[1]+1}g<=e&&c.push([g,e]);return c};f.offsetIntervals=function(a,e){for(var c=[],g=0;gd;g--)u[c+2*g+2]=u[c+2*g],u[c+2*g+3]=u[c+2*g+1];u[c+2*g+2]=d;u[c+2*g+3]=e}};for(l=0;l>>2)|0;u>>>=0;for(var q=u%k,v=p;0!==a[2*q+1];){if(a[2*q]===u){var x=a[2*q+1]-1,m=x*c;a:{for(var B=0;B= k&&(q-=k)}v===p&&(a[2*q]=u,a[2*q+1]=l+1,p++);d[l]=v}if(0!==g&&1-p/bc;c++)e[c]=this.data[a+c];return e};f.prototype.setMat=function(a, e){a*=this.elementStride;for(var c=0;16>c;c++)this.data[a+c]=e[c]};f.prototype.get=function(a,e){return this.data[a*this.elementStride+e]};f.prototype.set=function(a,e,c){this.data[a*this.elementStride+e]=c};Object.defineProperty(f.prototype,"count",{get:function(){return Math.ceil(this.data.length/this.elementStride)},enumerable:!0,configurable:!0});Object.defineProperty(f.prototype,"buffer",{get:function(){return this.data.buffer},enumerable:!0,configurable:!0});Object.defineProperty(f.prototype, "typedBuffer",{get:function(){return this.data},enumerable:!0,configurable:!0});Object.defineProperty(f.prototype,"stride",{get:function(){return this.elementStride*this.TypedArrayConstructor.BYTES_PER_ELEMENT},enumerable:!0,configurable:!0});f.ElementCount=16;return f}();h.BufferViewMat4=r})},"esri/views/3d/support/buffer/internals/Single":function(){define(["require","exports"],function(r,h){Object.defineProperty(h,"__esModule",{value:!0});r=function(){function f(a,e,c,g){void 0===c&&(c=0);a=this.TypedArrayConstructor= a;void 0===g&&(g=a.BYTES_PER_ELEMENT);this.data=new a(e,0===e.byteLength?0:c);this.elementStride=g/a.BYTES_PER_ELEMENT}f.prototype.get=function(a){return this.data[a*this.elementStride]};f.prototype.set=function(a,e){this.data[a*this.elementStride]=e};Object.defineProperty(f.prototype,"count",{get:function(){return Math.ceil(this.data.length/this.elementStride)},enumerable:!0,configurable:!0});Object.defineProperty(f.prototype,"buffer",{get:function(){return this.data.buffer},enumerable:!0,configurable:!0}); Object.defineProperty(f.prototype,"typedBuffer",{get:function(){return this.data},enumerable:!0,configurable:!0});Object.defineProperty(f.prototype,"stride",{get:function(){return this.elementStride*this.TypedArrayConstructor.BYTES_PER_ELEMENT},enumerable:!0,configurable:!0});f.ElementCount=1;return f}();h.BufferViewSingle=r})},"esri/views/3d/support/buffer/internals/Vec2":function(){define(["require","exports","../../../lib/glMatrix"],function(r,h,f){Object.defineProperty(h,"__esModule",{value:!0}); r=function(){function a(a,c,g,d){void 0===g&&(g=0);a=this.TypedArrayConstructor=a;void 0===d&&(d=2*a.BYTES_PER_ELEMENT);this.data=new a(c,0===c.byteLength?0:g);this.elementStride=d/a.BYTES_PER_ELEMENT}a.prototype.getVec=function(a,c){return f.vec2d.set2(this.data[a*this.elementStride],this.data[a*this.elementStride+1],c)};a.prototype.setVec=function(a,c){this.data[a*this.elementStride]=c[0];this.data[a*this.elementStride+1]=c[1]};a.prototype.get=function(a,c){return this.data[a*this.elementStride+ c]};a.prototype.set=function(a,c,g){this.data[a*this.elementStride+c]=g};Object.defineProperty(a.prototype,"count",{get:function(){return Math.ceil(this.data.length/this.elementStride)},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"buffer",{get:function(){return this.data.buffer},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"typedBuffer",{get:function(){return this.data},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"stride",{get:function(){return this.elementStride* this.TypedArrayConstructor.BYTES_PER_ELEMENT},enumerable:!0,configurable:!0});a.ElementCount=2;return a}();h.BufferViewVec2=r})},"esri/views/3d/support/buffer/internals/Vec3":function(){define(["require","exports","../../../lib/glMatrix"],function(r,h,f){Object.defineProperty(h,"__esModule",{value:!0});r=function(){function a(a,c,g,d){void 0===g&&(g=0);a=this.TypedArrayConstructor=a;void 0===d&&(d=3*a.BYTES_PER_ELEMENT);this.data=new a(c,0===c.byteLength?0:g);this.elementStride=d/a.BYTES_PER_ELEMENT} a.prototype.getVec=function(a,c){return f.vec3d.set3(this.data[a*this.elementStride],this.data[a*this.elementStride+1],this.data[a*this.elementStride+2],c)};a.prototype.setVec=function(a,c){this.data[a*this.elementStride]=c[0];this.data[a*this.elementStride+1]=c[1];this.data[a*this.elementStride+2]=c[2]};a.prototype.get=function(a,c){return this.data[a*this.elementStride+c]};a.prototype.set=function(a,c,g){this.data[a*this.elementStride+c]=g};Object.defineProperty(a.prototype,"count",{get:function(){return Math.ceil(this.data.length/ this.elementStride)},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"buffer",{get:function(){return this.data.buffer},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"typedBuffer",{get:function(){return this.data},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"stride",{get:function(){return this.elementStride*this.TypedArrayConstructor.BYTES_PER_ELEMENT},enumerable:!0,configurable:!0});a.ElementCount=3;return a}();h.BufferViewVec3=r})},"esri/views/3d/support/buffer/internals/Vec4":function(){define(["require", "exports","../../../lib/glMatrix"],function(r,h,f){Object.defineProperty(h,"__esModule",{value:!0});r=function(){function a(a,c,g,d){void 0===g&&(g=0);a=this.TypedArrayConstructor=a;void 0===d&&(d=4*a.BYTES_PER_ELEMENT);this.data=new a(c,0===c.byteLength?0:g);this.elementStride=d/a.BYTES_PER_ELEMENT}a.prototype.getVec=function(a,c){return f.vec4d.set4(this.data[a*this.elementStride],this.data[a*this.elementStride+1],this.data[a*this.elementStride+2],this.data[a*this.elementStride+3],c)};a.prototype.setVec= function(a,c){this.data[a*this.elementStride]=c[0];this.data[a*this.elementStride+1]=c[1];this.data[a*this.elementStride+2]=c[2];this.data[a*this.elementStride+3]=c[3]};a.prototype.get=function(a,c){return this.data[a*this.elementStride+c]};a.prototype.set=function(a,c,g){this.data[a*this.elementStride+c]=g};Object.defineProperty(a.prototype,"count",{get:function(){return Math.ceil(this.data.length/this.elementStride)},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"buffer",{get:function(){return this.data.buffer}, enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"typedBuffer",{get:function(){return this.data},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"stride",{get:function(){return this.elementStride*this.TypedArrayConstructor.BYTES_PER_ELEMENT},enumerable:!0,configurable:!0});a.ElementCount=4;return a}();h.BufferViewVec4=r})},"esri/views/3d/support/buffer/InterleavedLayout":function(){define(["require","exports","./BufferView"],function(r,h,f){Object.defineProperty(h, "__esModule",{value:!0});var a=function(){function a(a,c){this.layout=a;this.buffer="number"===typeof c?new ArrayBuffer(c*a.stride):c;c=0;for(var b=a.fieldNames;ca&&(a+=f.length),a=Math.min(f.length,Math.max(0,a)));void 0===e?e=f.length:(0>e&&(e+=f.length),e=Math.min(f.length,Math.max(0,e)));e=Math.max(0,e-a);for(var c=new f.constructor(e),g=0;g= a)return d}if(!(a>f.MAX_INDEX_COUNT))return a=new f.ManagedTextureBackedBuffer(this.rctx),this.buffers.push(a),a};a.prototype.updateTextures=function(){for(var a=0,c=this.buffers;a=this.data.count&&(a=new f.BufferViewVec4u8(new ArrayBuffer(Math.ceil((a+1)/this.textureWidth)*this.textureWidth*4)),a.typedBuffer.set(this.data.typedBuffer), this.data=a)};e.prototype.updateTexture=function(){if(this.dirty){var a=this.texture.descriptor.width;this.data.count>a*this.texture.descriptor.height&&this.texture.resize(a,this.data.count/a);this.texture.setData(this.data.typedBuffer);this.dirty=!1}};e.prototype.bind=function(a,e){this.rctx.bindTexture(this.texture,e.unit);a.setUniform1i(e.tex,e.unit);a.setUniform2f(e.invDim,1/this.texture.descriptor.width,1/this.texture.descriptor.height)};return e}();h.TextureBackedBuffer=r})},"esri/views/3d/webgl-engine/lib/edgeRendering/EdgeRenderer":function(){define("require exports ../../../../../core/tsSupport/assignHelper dojo/text!./EdgeRendererUtils.xml ../../../support/buffer/glUtil ../../../support/buffer/InterleavedLayout ./edgePreprocessing ../../../../webgl/BufferObject ../../../../webgl/VertexArrayObject".split(" "), function(r,h,f,a,e,c,g,d,b){Object.defineProperty(h,"__esModule",{value:!0});var k=c.newLayout().vec2u8("sidenessAtt");h.glVertexLayout=e.glLayout(k);r=function(){function c(a,b,c){this.rctx=a;this.programRepository=b;this.key=c;this.depthBiasZ=-4E-4;this.depthBiasXY=.5;a=k.createBuffer(4);for(b=0;4>b;b++)a.sidenessAtt.set(b,0,0===b||3===b?0:1),a.sidenessAtt.set(b,1,0===b||1===b?0:1);this.verticesBufferObject=d.createVertex(this.rctx,35044,a.buffer)}c.prototype.dispose=function(){for(var a in this.programs){var b= this.programs[a];b&&(this.programRepository.decreaseRefCount(b),this.programs[a]=null)}this.verticesBufferObject&&(this.verticesBufferObject.dispose(),this.verticesBufferObject=null)};c.prototype.createInstance=function(a,c,e){c=g.extractEdges(c,this.edgeBufferWriters.default.writer,this.edgeBufferWriters.silhouette.writer);var k=c.averageEdgeLength,l=null,n=null,p=0;0c}function d(a){var b=a.faces.length/3,c=a.faces;a=a.neighbors;for(var d=0,e=0;eA)continue;S+=U;R++;ka||r.cosAngleq;q++)u.affectsShaderTypes[q]&&(u.shaderSnippetSuffixes&&(e[q]+=u.shaderSnippetSuffixes[v],f[q]+=u.shaderSnippetSuffixes[v]),u.defineStr&&v&&(g.push(u.defineStr), f[q]+=u.shaderNameSuffixes))}return{programName:d,shaderSnippetNames:e,shaderNames:f,defines:g}};d.prototype.getProgram=function(a,d,f,h){void 0===d&&(d=this.snippets);void 0===f&&(f=this.rctx);void 0===h&&(h=e.Default3D);this.sealed=!0;var b=a.reduce(function(a,b){return a+b.toString()},"");if(this.programCache[b])return this.programCache[b];a=this.getShaderVariation(a);var k=this.programRep.get(a.programName);if(k)return k;var l=a.shaderSnippetNames[0],k=d[l];c.assert(null!=k,"shader snippet '"+ l+"' does not exist");l=a.shaderSnippetNames[1];d=d[l];c.assert(null!=d,"shader snippet '"+l+"' does not exist");k=new g(f,k,d,h,a.defines);this.programCache[b]=k;this.programRep.add(a.programName,k);return k};return d}()})},"esri/views/3d/webgl-engine/lib/edgeRendering/ribbonEdgeBufferWriters":function(){define("require exports ../../../../../core/tsSupport/assignHelper ../../../../../core/tsSupport/extendsHelper ../../../lib/glMatrix ../../../support/buffer/glUtil ../../../support/buffer/InterleavedLayout ../Util".split(" "), function(r,h,f,a,e,c,g,d){Object.defineProperty(h,"__esModule",{value:!0});r=g.newLayout().vec3f("position0").vec3f("position1").u16("componentIndex").vec2u8("packedAttributes").u8("variantOffset",{glNormalized:!0}).u8("variantStroke").u8("variantExtension",{glNormalized:!0}).u8("_padding",{glPadding:!0});var b=function(){function a(a){this.settings=a}a.prototype.write=function(a,b,c){var e=k;e[0]=c.position0[0];e[1]=c.position0[1];e[2]=c.position0[2];e[3]=c.position1[0];e[4]=c.position1[1];e[5]= c.position1[2];p[0]=5381;for(e=0;eg?-1:1)*.5+.5);a.position0.setVec(b,c.position0);a.position1.setVec(b,c.position1);a.componentIndex.set(b,c.componentIndex);if(this.settings.uber){var m=c.type|d.clamp(c.lineWidth,0,127)<<1;a.packedAttributes.set(b,0,m);a.packedAttributes.set(b, 1,Math.round(d.clamp(c.extensions,0,255)))}a.variantOffset.set(b,e);a.variantStroke.set(b,f);a.variantExtension.set(b,g)};a.prototype.trim=function(a,b){return a.slice(0,b)};return a}();h.RibbonCommonBufferWriter=b;var k=new Float32Array(6),l=new Uint32Array(k.buffer),p=new Uint32Array(1),n=new (function(){function a(a){void 0===a&&(a=1);this.seed=a}a.prototype.randomFloat=function(){return this.step()/a.LARGE_PRIME};a.prototype.randomRangeInt=function(a,b){b-=a;return Math.round(a+this.randomFloat()* b)};a.prototype.reseed=function(a){this.seed=a};a.prototype.step=function(){return this.seed=this.seed*a.SMALL_PRIME%a.LARGE_PRIME};a.LARGE_PRIME=2147483647;a.SMALL_PRIME=16807;return a}()),t=r.clone().vec3f("normal");f=function(){function a(a){this.commonWriter=new b(a)}a.prototype.allocate=function(a){return t.createBuffer(a)};a.prototype.write=function(a,b,c){this.commonWriter.write(a,b,c);c=e.vec3d.normalize(e.vec3d.add(c.faceNormal0,c.faceNormal1,q));a.normal.setVec(b,c)};a.prototype.trim=function(a, b){return this.commonWriter.trim(a,b)};a.Layout=t;a.glLayout=c.glLayout(t,1);return a}();h.RibbonDefaultEdgeBufferWriter=f;var u=r.clone().vec3f("normalA").vec3f("normalB");r=function(){function a(a){this.commonWriter=new b(a)}a.prototype.allocate=function(a){return u.createBuffer(a)};a.prototype.write=function(a,b,c){this.commonWriter.write(a,b,c);a.normalA.setVec(b,c.faceNormal0);a.normalB.setVec(b,c.faceNormal1)};a.prototype.trim=function(a,b){return this.commonWriter.trim(a,b)};a.Layout=u;a.glLayout= c.glLayout(u,1);return a}();h.RibbonSilhouetteBufferWriter=r;var q=e.vec3d.create()})},"esri/views/3d/webgl-engine/lib/edgeRendering/strokes":function(){define("require exports ../../../../../core/tsSupport/assignHelper ../../../support/mathUtils ../Util ../../../../webgl/Texture".split(" "),function(r,h,f,a,e,c){function g(a,c){if(!a)return null;var e=a.length/2,f=d*e,e=Array(e),g=0;c=1===c;for(var k=0;k=d.length?(c=h=0,b=this.params.texCoordScale[0], l=this.params.texCoordScale[1]):(h=a.vertexAttr[t.VertexAttrConstants.UV0].data[0],c=a.vertexAttr[t.VertexAttrConstants.UV0].data[1],b=a.vertexAttr[t.VertexAttrConstants.UV0].data[2],l=a.vertexAttr[t.VertexAttrConstants.UV0].data[3]);b=Math.min(1.99999,b+1);l=Math.min(1.99999,l+1);m=f+q.findAttribute(A,t.VertexAttrConstants.UV0).offset/4;for(d=0;dx&&n[0]A&&n[1]=f.timestampBits())return null;var d=f.createQuery();f.createTimestamp(d);var b=function(){var a=f.resultAvailable(d),g=f.disjoint();a&&!g?(a=f.getResult(d),e(a/1E6)):g?e():setTimeout(b,c)};b()};h.supportsTimestamps=function(a){a=a.capabilities.disjointTimerQuery; if(!a)return!1;a=a.timestampBits();console.log({bits:a});return 0this.params.color[3]?d.TRANSPARENT_MATERIAL:d.OPAQUE_MATERIAL)};b.prototype.getProgram=function(){return this.program};b.prototype.bind=function(a,b){b=this.program;var c=this.params;a.bindProgram(b);b.setUniform4fv("eColor",c.color);a.setFaceCullingEnabled(!1);c.polygonOffset&&(a.setPolygonOffsetFillEnabled(!0),a.setPolygonOffset(1,1));c.transparent&&(a.setBlendingEnabled(!0),a.setBlendFunctionSeparate(a.gl.SRC_ALPHA,a.gl.ONE_MINUS_SRC_ALPHA, a.gl.ONE,a.gl.ONE_MINUS_SRC_ALPHA));a.setDepthTestEnabled(!0)};b.prototype.release=function(a){var b=this.params;a.setPolygonOffsetFillEnabled(!1);b.transparent&&a.setBlendingEnabled(!1)};b.prototype.bindView=function(a,b){l.bindView(b.origin,b.view,this.program)};b.prototype.bindInstance=function(a,b){this.program.setUniformMatrix4fv("model",b.transformation)};b.prototype.getDrawMode=function(a){return a.gl.TRIANGLES};return b}(c),v=function(a){function b(b,c,d){b=a.call(this,b,c)||this;b.updateParameters(); return b}f(b,a);b.prototype.updateParameters=function(){this.params=this.material.getParameterValues();this.selectProgram()};b.prototype.selectProgram=function(){this.program=this.programRep.getShaderVariationsProgram("colorMaterial",[this.params.vertexColors])};b.prototype.beginSlot=function(a){return a===d.OPAQUE_MATERIAL};b.prototype.getProgram=function(){return this.program};b.prototype.bind=function(a,b){b=this.program;var c=this.params;a.bindProgram(b);b.setUniform4fv("eColor",c.color);a.setFaceCullingEnabled(!1); c.polygonOffset&&(a.setPolygonOffsetFillEnabled(!0),a.setPolygonOffset(1,1))};b.prototype.release=function(a){a.setPolygonOffsetFillEnabled(!1)};b.prototype.bindView=function(a,b){l.bindView(b.origin,b.view,this.program)};b.prototype.bindInstance=function(a,b){this.program.setUniformMatrix4fv("model",b.transformation)};b.prototype.getDrawMode=function(a){return a.gl.TRIANGLES};return b}(c);return r})},"esri/views/3d/webgl-engine/materials/DefaultMaterial":function(){define("require exports ../../../../core/tsSupport/extendsHelper dojo/text!./DefaultMaterial.xml ../../layers/graphics/graphicUtils ../../support/buffer/glUtil ../../support/buffer/InterleavedLayout ../lib/DefaultVertexAttributeLocations ../lib/gl-matrix ../lib/GLMaterialTexture ../lib/Material ../lib/RenderSlot ../lib/ShaderVariations ../lib/Util ./internal/MaterialUtil ../../../webgl/Program ../../../webgl/Util".split(" "), function(r,h,f,a,e,c,g,d,b,k,l,p,n,t,u,q,v){function x(a,b){var c=a.gl;(b.cullFace?"none"===b.cullFace:b.transparent)?a.setFaceCullingEnabled(!1):(a.setFaceCullingEnabled(!0),"front"===b.cullFace&&a.setCullFace(c.FRONT))}function m(a,b){var c=a.gl;(b.cullFace?"none"===b.cullFace:b.transparent)?a.setFaceCullingEnabled(!0):(a.setFaceCullingEnabled(!1),"front"===b.cullFace&&a.setCullFace(c.BACK))}function B(a,b){return a?p.TRANSPARENT_MATERIAL:b?p.STENCIL_MATERIAL:p.OPAQUE_MATERIAL}function z(a,b){var c= b.vvSizeEnabled;b.vvSizeEnabled?(a.setUniform3fv("vvSizeMinSize",b.vvSizeMinSize),a.setUniform3fv("vvSizeMaxSize",b.vvSizeMaxSize),a.setUniform3fv("vvSizeOffset",b.vvSizeOffset),a.setUniform3fv("vvSizeFactor",b.vvSizeFactor)):c&&a.setUniform3fv("vvSizeValue",b.vvSizeValue);c&&(a.setUniform3fv("vvSymbolAnchor",b.vvSymbolAnchor),e.computeObjectRotation(b.vvSymbolRotation[2],b.vvSymbolRotation[0],b.vvSymbolRotation[1],F.identity(L)),a.setUniformMatrix3fv("vvSymbolRotation",F.toMat3(L,K)));b.vvColorEnabled&& (a.setUniform1fv("vvColorValues",b.vvColorValues),a.setUniform4fv("vvColorColors",b.vvColorColors))}function C(a,b){a.vvSizeEnabled=b.vvSizeEnabled;a.vvSizeMinSize=b.vvSizeMinSize;a.vvSizeMaxSize=b.vvSizeMaxSize;a.vvSizeOffset=b.vvSizeOffset;a.vvSizeFactor=b.vvSizeFactor;a.vvSizeValue=b.vvSizeValue;a.vvSymbolAnchor=b.vvSymbolAnchor;a.vvSymbolRotation=b.vvSymbolRotation}var A=b.vec3d,D=b.vec4d,E=b.mat3d,F=b.mat4d,I=t.assert;r=function(b){function e(a,c){c=b.call(this,c)||this;c.supportsEdges=!0;c.params= u.copyParameters(a,O);c.instanced=!!a.instanced;c.vertexBufferLayout=e.getVertexBufferLayout(c.params);c.instanceBufferLayout=c.instanced?e.getInstanceBufferLayout(c.params):null;return c}f(e,b);e.prototype.isVisible=function(){var a=this.params;if(!b.prototype.isVisible.call(this)||0===a.layerOpacity)return!1;var c=N&&a.instanced,d=a.vertexColors,e=a.symbolColors,c=!!c&&-1h;h++)k.fill(a,m,f,b,e,d),b+=12};c.prototype.fillInterleaved=function(a,b,c,d,e,f,g){this.fillAttributeData(a,n.POSITION,f,3,b,e);this.fillAttributeData(a,n.NORMAL,f,3,c,e);this.fillAttributeData(a,n.AUXPOS1, f,4,null,e);a=f+l.findAttribute(t,n.UV0).offset/4;b=0;for(c=v;bh;h++)k.unprojectPoint(H[h],J[h]);n.point2plane(k.eye,J[0],J[1],O);n.point2plane(k.eye,J[1],J[2],N);n.point2plane(k.eye,J[2],J[3],S);n.point2plane(k.eye,J[3],J[0],R);g=Number.MAX_VALUE;for(h=0;hn.planeDistance(C,O)&&0>n.planeDistance(A,O)||0>n.planeDistance(C,N)&&0>n.planeDistance(A,N)||0>n.planeDistance(C,S)&&0>n.planeDistance(A,S)||0>n.planeDistance(C,R)&&0>n.planeDistance(A,R))){k.projectPoint(C,F);k.projectPoint(A,I);if(0>F[2]&&0I[2])d.vec3d.subtract(A,C,D),t=k.frustumPlanes,p=-(d.vec3d.dot(t[4],A)+t[4][3]),t=p/d.vec3d.dot(D,t[4]),d.vec3d.scale(D,t,D),d.vec3d.add(A,D,A),k.projectPoint(A,I);else if(0>F[2]&&0>I[2])continue;t=n.pointLineSegmentDistanceSquared2D(F,I,m);tK||h*V+t*U+q*L+u>K||r*V+I*U+P*L+G>K||M*V+H*U+J*L+O>K||(U=N*V+S*U+R*L,V=U+K,U=-U+K,V>a&&(a=V),U>c&&(c=U),this._stats.renderGeometriesVisible++)}Q=a!==-Number.MAX_VALUE;0c.bestFar&&(c.bestFar=c.near[b]),2=c.bestNear2?c.bestNear=c.near[b]:c.nearSpecial[e++]=b),c.far[b]>c.bestFar&&(c.far[b]<=c.bestFar2?c.bestFar=c.far[b]:c.farSpecial[g++]=b);if(0===e&&0===g)return[c.bestNear,c.bestFar];c.nearSpecial.length=e;c.farSpecial.length=g;c.nearSpecial.sort(function(a,b){return c.near[a]c.near[b]?1:0});c.farSpecial.sort(function(a,b){return c.far[a]c.far[b]?-1:0});this._boundingInfoHelper.init(a, c);for(b=0;bc.bestFar&&(d=c.content[c.farSpecial[b]],a=d.boundingInfo,this._boundingInfoHelper.includeFarBoundingInfoRec(a,d.getShaderTransformation()));return[c.bestNear,c.bestFar]};return a}();var d=function(){function a(){this._clippingHelper=new b;this._planes=[c.create(),c.create(), c.create(),c.create(),c.create(),c.create()];this._viewProj=g.create();this._view=g.create()}a.prototype.init=function(a,b){this._context=b;g.set(a.viewMatrix,this._view);g.multiply(a.projectionMatrix,this._view,this._viewProj);a.copyFrustumPlanes(this._planes);this._clippingHelper.init(b)};a.prototype.includeNearBoundingInfoRec=function(a,b){var c=a.getBSRadius(),d=a.getCenter();g.multiplyVec3(b,d,l);var d=l[0],e=l[1],f=l[2],c=c*Math.sqrt(Math.max(Math.max(b[0]*b[0]+b[4]*b[4]+b[8]*b[8],b[1]*b[1]+ b[5]*b[5]+b[9]*b[9]),b[2]*b[2]+b[6]*b[6]+b[10]*b[10]));if(!(this._planes[0][0]*d+this._planes[0][1]*e+this._planes[0][2]*f+this._planes[0][3]>c||this._planes[1][0]*d+this._planes[1][1]*e+this._planes[1][2]*f+this._planes[1][3]>c||this._planes[2][0]*d+this._planes[2][1]*e+this._planes[2][2]*f+this._planes[2][3]>c||this._planes[3][0]*d+this._planes[3][1]*e+this._planes[3][2]*f+this._planes[3][3]>c||(d=this._view[2]*d+this._view[6]*e+this._view[10]*f+this._view[14],e=d+c,2>-(d-c)||-e>=this._context.bestNear)))if(-e> this._context.bestNear2)this._context.bestNear=-e;else{if(100a;++a)void 0!==c[a]&&this.includeNearBoundingInfoRec(c[a],b);return}this._clippingHelper.intersectFrustumAABB(this._viewProj,b,a.getBBMin(),a.getBBMax())}};a.prototype.includeFarBoundingInfoRec=function(a,b){var c=a.getBSRadius(),d=a.getCenter();g.multiplyVec3(b,d,l);var d=l[0],e=l[1],f=l[2],c=c*Math.sqrt(Math.max(Math.max(b[0]*b[0]+b[4]*b[4]+b[8]*b[8],b[1]*b[1]+b[5]*b[5]+b[9]*b[9]),b[2]*b[2]+ b[6]*b[6]+b[10]*b[10]));if(!(this._planes[0][0]*d+this._planes[0][1]*e+this._planes[0][2]*f+this._planes[0][3]>c||this._planes[1][0]*d+this._planes[1][1]*e+this._planes[1][2]*f+this._planes[1][3]>c||this._planes[2][0]*d+this._planes[2][1]*e+this._planes[2][2]*f+this._planes[2][3]>c||this._planes[3][0]*d+this._planes[3][1]*e+this._planes[3][2]*f+this._planes[3][3]>c||(d=this._view[2]*d+this._view[6]*e+this._view[10]*f+this._view[14]-c,-d<=this._context.bestFar)))if(-da;++a)void 0!==c[a]&&this.includeFarBoundingInfoRec(c[a],b);return}this._clippingHelper.intersectFrustumAABB(this._viewProj,b,a.getBBMin(),a.getBBMax())}};return a}(),b=function(){function a(){this._clipP=Array(8);for(var a=0;8>a;++a)this._clipP[a]=c.create()}a.prototype.init=function(a){this._context=a};a.prototype.intersectFrustumAABB=function(a,b,c,d){g.multiply(a,b,p);for(a=0;8>a;++a){b=this._clipP[a];var e=0===a||3===a||4===a||7===a? c[0]:d[0],f=0===a||1===a||4===a||5===a?c[1]:d[1],l=4>a?c[2]:d[2];b[0]=p[0]*e+p[4]*f+p[8]*l+p[12];b[1]=p[1]*e+p[5]*f+p[9]*l+p[13];b[2]=p[2]*e+p[6]*f+p[10]*l+p[14];b[3]=p[3]*e+p[7]*f+p[11]*l+p[15]}for(a=0;12>a;++a){c=this._clipTriangle(this._clipP[k[a][0]],this._clipP[k[a][1]],this._clipP[k[a][2]]);d=!0;for(b=0;bthis._context.bestFar&&(this._context.bestFar=e)}}; a.prototype._inside=function(a,b){if(0===b)return a[0]>=-a[3];if(1===b)return a[1]>=-a[3];if(2===b)return a[0]<=a[3];if(3===b)return a[1]<=a[3];e.assert(!1)};a.prototype._intersect=function(a,b,d){var e=0;0===d?e=(-a[3]-a[0])/(b[0]-a[0]+b[3]-a[3]):1===d?e=(-a[3]-a[1])/(b[1]-a[1]+b[3]-a[3]):2===d?e=(a[3]-a[0])/(b[0]-a[0]-b[3]+a[3]):3===d&&(e=(a[3]-a[1])/(b[1]-a[1]-b[3]+a[3]));return c.lerp(a,b,e,c.create())};a.prototype._clipTriangle=function(a,b,c){a=[a,b,c];for(b=0;4>b;++b){c=a;a=[];for(var d=0;d< c.length;++d){var e=c[d],f=c[(d+1)%c.length];this._inside(f,b)?(this._inside(e,b)||a.push(this._intersect(e,f,b)),a.push(f)):this._inside(e,b)&&a.push(this._intersect(e,f,b))}}return a};return a}(),k=[[0,1,3],[2,3,1],[1,5,2],[6,2,5],[5,4,6],[7,6,4],[4,0,7],[3,7,0],[3,2,7],[6,7,2],[4,5,0],[1,0,5]],l=r.create(),p=g.create();return a})},"esri/views/3d/webgl-engine/lib/ShadowMap":function(){define("./Camera ./Util ./gl-matrix ./glUtil3D ../../../../core/Logger ../../../webgl/Texture ../../../webgl/FramebufferObject ../../../webgl/VertexArrayObject ../../../webgl/BufferObject ./DefaultVertexAttributeLocations ./DefaultVertexBufferLayouts ../../../webgl/Util".split(" "), function(r,h,f,a,e,c,g,d,b,k,l,p){var n=f.vec2d,t=f.vec3d,u=f.vec4d,q=f.mat3d,v=f.mat4d,x=f.mat4,m=e.getLogger("esri.views.3d.webgl-engine.lib.ShadowMap");return function(e,f){function z(a,b){t.set3(a[b],a[b+3],a[b+6],Fa);return Fa}var B=f.gl,D,E=4096,F,I=a.createEmptyTexture(f),P=1,G=2,M=[0,0,0,0,0];this.dispose=function(){I.dispose();I=null};var H=function(){this.camera=new r;this.lightMat=v.create()},J=[],O,N,S;for(O=0;4>O;++O)J[O]=new H;this.getIsSupported=function(){return f.capabilities.standardDerivatives}; this.setTextureResolution=function(a){E=a};this.getTextureResolution=function(){return E};this.setMaxNumCascades=function(a){G=h.clamp(Math.floor(a),1,4)};this.getMaxNumCascades=function(){return G};this.setEnableState=function(a){a?this.enable():this.disable()};this.getEnableState=function(){return void 0!==D};this.getDepthTexture=function(){return D};this.enable=function(){this.getEnableState()||(this.getIsSupported()?(D=new c(f,{target:B.TEXTURE_2D,pixelFormat:B.RGBA,dataType:B.UNSIGNED_BYTE,wrapMode:B.CLAMP_TO_EDGE, samplingMode:B.NEAREST,flipped:!0,width:E,height:E}),F=g.createWithAttachments(f,D,{colorTarget:0,depthStencilTarget:1,width:E,height:E})):m.warn("Shadow maps are not supported for this browser or hardware"))};this.disable=function(){this.getEnableState()&&F&&(F.dispose(),D=F=void 0)};var R=v.create(),Y=v.create(),X=u.create(),Q=Array(8);for(O=0;8>O;++O)Q[O]=u.create();var K=t.create(),L=t.create(),V=n.create(),U=n.create(),ca=n.create(),ga=n.create(),da=n.create(),ka=v.create(),Z=t.create();this.prepare= function(a,b,c,d){h.assert(this.getEnableState());v.multiply(a.projectionMatrix,a.viewMatrix,R);var e=d[0],g=d[1];2>e&&(e=2);2>g&&(g=2);e>=g&&(e=2,g=4);P=Math.min(1+Math.floor(h.logWithBase(g/e,4)),G);c=Math.pow(g/e,1/P);for(d=0;dN;++N)for(u.set4(0===N%4||3==N%4?-1:1,0===N%4||1==N%4?-1:1,4>N?e:g,1,X),v.multiplyVec4(Y,X,Q[N]),S=0;3>S;++S)Q[N][S]/=Q[N][3];t.negate(Q[0],Z);v.translate(ka,Z,k.camera.viewMatrix);for(N=0;8>N;++N)v.multiplyVec3(k.camera.viewMatrix,Q[N]);t.set(Q[0],K);t.set(Q[0],L);for(N=1;8>N;++N)for(S=0;3>S;++S)K[S]=Math.min(K[S],Q[N][S]),L[S]=Math.max(L[S],Q[N][S]);K[2]-=200;L[2]+=200;k.camera.near=-L[2];k.camera.far=-K[2];e=1/Q[0][3];g=1/Q[4][3];h.assert(er;++r)n.add(T,e[r],T);n.scale(T,.25);n.set2(0,0,ha);for(r=4;8>r;++r)n.add(ha,e[r],ha);n.scale(ha,.25);n.lerp(e[4],e[5],.5,ia[0]);n.lerp(e[5],e[6],.5,ia[1]);n.lerp(e[6],e[7],.5,ia[2]);n.lerp(e[7],e[4],.5,ia[3]);for(var D=0,I=n.dist2(ia[0],T),r=1;4>r;++r){var H=n.dist2(ia[r],T);Hr;++r)I=n.dot(n.subtract(e[r],T,ra),la),ID&&(D=I);n.set(T,m);n.scale(la,q-p,ra);n.add(m,ra,m);for(var H=-1,O=1,r=p=I=0;8>r;++r){n.subtract(e[r],m,wa);n.normalize(wa);var za=la[0]*wa[1]-la[1]*wa[0];0H&&(H=za,I=r):zaO,"rightArea");n.scale(la,q,xa);n.add(xa,T,xa);n.scale(la,D,oa);n.add(oa,T,oa);na[0]=-la[1];na[1]=la[0];x=h.rayRay2D(m,e[p],oa,n.add(oa,na,ra),1,x);C=h.rayRay2D(m, e[I],oa,ra,1,C);A=h.rayRay2D(m,e[I],xa,n.add(xa,na,ra),1,A);e=h.rayRay2D(m,e[p],xa,ra,1,l);h.verify(x,"rayRay");h.verify(C,"rayRay");h.verify(A,"rayRay");h.verify(e,"rayRay");C=V;e=U;m=ga;A=da;l=k.camera.projectionMatrix;n.scale(n.subtract(m,A,ua),.5);ba[0]=ua[0];ba[1]=ua[1];ba[2]=0;ba[3]=ua[1];ba[4]=-ua[0];ba[5]=0;ba[6]=ua[0]*ua[0]+ua[1]*ua[1];ba[7]=ua[0]*ua[1]-ua[1]*ua[0];ba[8]=1;ba[6]=-n.dot(z(ba,0),C);ba[7]=-n.dot(z(ba,1),C);C=n.dot(z(ba,0),m)+ba[6];x=n.dot(z(ba,1),m)+ba[7];r=n.dot(z(ba,0),A)+ ba[6];A=n.dot(z(ba,1),A)+ba[7];C=-(C+r)/(x+A);ba[0]+=ba[1]*C;ba[3]+=ba[4]*C;ba[6]+=ba[7]*C;C=1/(n.dot(z(ba,0),m)+ba[6]);x=1/(n.dot(z(ba,1),m)+ba[7]);ba[0]*=C;ba[3]*=C;ba[6]*=C;ba[1]*=x;ba[4]*=x;ba[7]*=x;ba[2]=ba[1];ba[5]=ba[4];ba[8]=ba[7];ba[7]+=1;C=n.dot(z(ba,1),e)+ba[7];x=n.dot(z(ba,2),e)+ba[8];r=n.dot(z(ba,1),m)+ba[7];A=n.dot(z(ba,2),m)+ba[8];C=-.5*(C/x+r/A);ba[1]+=ba[2]*C;ba[4]+=ba[5]*C;ba[7]+=ba[8]*C;C=n.dot(z(ba,1),e)+ba[7];x=n.dot(z(ba,2),e)+ba[8];r=-x/C;ba[1]*=r;ba[4]*=r;ba[7]*=r;l[0]=ba[0]; l[1]=ba[1];l[2]=0;l[3]=ba[2];l[4]=ba[3];l[5]=ba[4];l[6]=0;l[7]=ba[5];l[8]=0;l[9]=0;l[10]=1;l[11]=0;l[12]=ba[6];l[13]=ba[7];l[14]=0;l[15]=ba[8];k.camera.projectionMatrix[10]=2/(K[2]-L[2]);k.camera.projectionMatrix[14]=-(K[2]+L[2])/(K[2]-L[2]);v.multiply(k.camera.projectionMatrix,k.camera.viewMatrix,k.lightMat);e=E/2;k.camera.viewport[0]=0===d%2?0:e;k.camera.viewport[1]=0===Math.floor(d/2)?0:e;k.camera.viewport[2]=e;k.camera.viewport[3]=e}fa=void 0;M[P]=100*g;f.bindFramebuffer(F);f.bindTexture(null, 7);f.setClearColor(1,1,1,1);f.clear(B.COLOR_BUFFER_BIT|B.DEPTH_BUFFER_BIT);f.setBlendingEnabled(!1)};var ea=[];this.getCascades=function(){for(var a=0;ac;++c)aa[16*N+c]=ja[c]}a.setUniformMatrix4fv("shadowMapMatrix",aa)}};H=new Float32Array(16);H[0]=0;H[1]=0;H[2]=0;H[3]= 0;H[4]=256;H[5]=0;H[6]=1;H[7]=0;H[8]=0;H[9]=256;H[10]=0;H[11]=1;H[12]=256;H[13]=256;H[14]=1;H[15]=1;var qa=new d(f,k.Default3D,{geometry:l.Pos2Tex},{geometry:b.createVertex(f,B.STATIC_DRAW,H)});this.drawDebugQuad=function(a){h.assert(this.getEnableState());var b=e.get("showDepth");f.setDepthTestEnabled(!1);f.bindProgram(b);b.setUniformMatrix4fv("proj",a);b.setUniform1i("depthTex",0);f.bindTexture(D,0);f.bindVAO(qa);p.assertCompatibleVertexAttributeLocations(qa,b);f.drawArrays(B.TRIANGLE_STRIP,0,p.vertexCount(qa, "geometry"));f.setDepthTestEnabled(!0)};var T=n.create(),ha=n.create(),ia=[n.create(),n.create(),n.create(),n.create()],la=n.create(),w=n.create(),ra=n.create(),wa=n.create(),xa=n.create(),oa=n.create(),na=n.create(),Fa=t.create(),ua=n.create(),ba=q.create()}})},"esri/views/support/screenshotUtils":function(){define(["require","exports","dojo/_base/lang"],function(r,h,f){Object.defineProperty(h,"__esModule",{value:!0});h.adjustScreenshotSettings=function(a,e){a=f.mixin({format:"png",quality:100}, a||{});var c,g;a.includePadding?(c=e.width,g=e.height):(c=e.width-e.padding.left-e.padding.right,g=e.height-e.padding.top-e.padding.bottom);var d=c/g;void 0!==a.width&&void 0===a.height?a.height=a.width/d:void 0!==a.height&&void 0===a.width&&(a.width=d*a.height);void 0!==a.height&&(a.height=Math.floor(a.height));void 0!==a.width&&(a.width=Math.floor(a.width));a.area||a.includePadding||(a.area={x:e.padding.left,y:e.padding.top,width:c,height:g});return a};h.resampleHermite=function(a,e,c,f,d,b,k){void 0=== k&&(k=!0);var g=e/d;c/=b;for(var h=Math.ceil(g/2),n=Math.ceil(c/2),t=0;t=v&&(v=2*v*v*v-3*v*v+1,0a[G+3]&&(v=v*a[G+3]/250),B+=v*a[G],z+=v*a[G+1],C+=v*a[G+2],x+=v))}f[q]=B/x;f[q+1]=z/x;f[q+2]=C/x;f[q+3]= r/m}}})},"esri/views/webgl/RenderingContext":function(){define(["require","exports","./enums","./capabilities/isWebGL2Context","./capabilities/load"],function(r,h,f,a,e){return function(){function c(c,d){this.gl=null;this._blendEnabled=!1;this._blendColorState={r:0,g:0,b:0,a:0};this._blendFunctionState={srcRGB:1,dstRGB:0,srcAlpha:1,dstAlpha:0};this._blendEquationState={mode:32774,modeAlpha:32774};this._colorMaskState={r:!0,g:!0,b:!0,a:!0};this._polygonCullingEnabled=!1;this._cullFace=1029;this._frontFace= 2305;this._scissorTestEnabled=!1;this._scissorRect={x:0,y:0,width:0,height:0};this._depthTestEnabled=!1;this._depthFunction=513;this._clearDepth=1;this._depthWriteEnabled=!0;this._depthRange={zNear:0,zFar:1};this._viewport=null;this._polygonOffsetFillEnabled=this._stencilTestEnabled=!1;this._polygonOffset=[0,0];this._stencilFunction={face:1032,func:519,ref:0,mask:1};this._clearStencil=0;this._stencilWriteMask=1;this._stencilOperation={face:1032,fail:7680,zFail:7680,zPass:7680};this._lineWidth=1;this._clearColor= {r:0,g:0,b:0,a:0};this._activeFramebuffer=this._activeIndexBuffer=this._activeVertexBuffer=this._activeShaderProgram=null;this._activeTextureUnit=0;this._textureUnitMap={};this.contextVersion=a.default(c)?"webgl2":"webgl";this.gl=c;c instanceof WebGLRenderingContext&&this.gl.getExtension("OES_element_index_uint");this._capabilities=e.loadCapabilities(c,d);c=this.gl.getParameter(this.gl.VIEWPORT);this._viewport={x:c[0],y:c[1],width:c[2],height:c[3]};c=this.capabilities.textureFilterAnisotropic;this._parameters= {versionString:this.gl.getParameter(this.gl.VERSION),maxVertexTextureImageUnits:this.gl.getParameter(this.gl.MAX_VERTEX_TEXTURE_IMAGE_UNITS),maxVertexAttributes:this.gl.getParameter(this.gl.MAX_VERTEX_ATTRIBS),maxMaxAnisotropy:c?this.gl.getParameter(c.MAX_TEXTURE_MAX_ANISOTROPY):void 0,maxTextureImageUnits:this.gl.getParameter(this.gl.MAX_TEXTURE_IMAGE_UNITS)};this.enforceState()}Object.defineProperty(c.prototype,"contextAttributes",{get:function(){return this.gl.getContextAttributes()},enumerable:!0, configurable:!0});Object.defineProperty(c.prototype,"parameters",{get:function(){return this._parameters},enumerable:!0,configurable:!0});c.prototype.dispose=function(){this.bindVAO(null);this.unbindBuffer(34962);this.unbindBuffer(34963);this._textureUnitMap={};this.gl=null};c.prototype.setBlendingEnabled=function(a){this._blendEnabled!==a&&(!0===a?this.gl.enable(this.gl.BLEND):this.gl.disable(this.gl.BLEND),this._blendEnabled=a)};c.prototype.setBlendColor=function(a,c,b,e){if(a!==this._blendColorState.r|| c!==this._blendColorState.g||b!==this._blendColorState.b||e!==this._blendColorState.a)this.gl.blendColor(a,c,b,e),this._blendColorState.r=a,this._blendColorState.g=c,this._blendColorState.b=b,this._blendColorState.a=e};c.prototype.setBlendFunction=function(a,c){if(a!==this._blendFunctionState.srcRGB||c!==this._blendFunctionState.dstRGB)this.gl.blendFunc(a,c),this._blendFunctionState.srcRGB=a,this._blendFunctionState.srcAlpha=a,this._blendFunctionState.dstRGB=c,this._blendFunctionState.dstAlpha=c}; c.prototype.setBlendFunctionSeparate=function(a,c,b,e){if(this._blendFunctionState.srcRGB!==a||this._blendFunctionState.srcAlpha!==b||this._blendFunctionState.dstRGB!==c||this._blendFunctionState.dstAlpha!==e)this.gl.blendFuncSeparate(a,c,b,e),this._blendFunctionState.srcRGB=a,this._blendFunctionState.srcAlpha=b,this._blendFunctionState.dstRGB=c,this._blendFunctionState.dstAlpha=e};c.prototype.setBlendEquation=function(a){this._blendEquationState.mode!==a&&(this.gl.blendEquation(a),this._blendEquationState.mode= a,this._blendEquationState.modeAlpha=a)};c.prototype.setBlendEquationSeparate=function(a,c){if(this._blendEquationState.mode!==a||this._blendEquationState.modeAlpha!==c)this.gl.blendEquationSeparate(a,c),this._blendEquationState.mode=a,this._blendEquationState.modeAlpha=c};c.prototype.setColorMask=function(a,c,b,e){if(this._colorMaskState.r!==a||this._colorMaskState.g!==c||this._colorMaskState.b!==b||this._colorMaskState.a!==e)this.gl.colorMask(a,c,b,e),this._colorMaskState.r=a,this._colorMaskState.g= c,this._colorMaskState.b=b,this._colorMaskState.a=e};c.prototype.setClearColor=function(a,c,b,e){if(this._clearColor.r!==a||this._clearColor.g!==c||this._clearColor.b!==b||this._clearColor.a!==e)this.gl.clearColor(a,c,b,e),this._clearColor.r=a,this._clearColor.g=c,this._clearColor.b=b,this._clearColor.a=e};c.prototype.setFaceCullingEnabled=function(a){this._polygonCullingEnabled!==a&&(!0===a?this.gl.enable(this.gl.CULL_FACE):this.gl.disable(this.gl.CULL_FACE),this._polygonCullingEnabled=a)};c.prototype.setPolygonOffsetFillEnabled= function(a){this._polygonOffsetFillEnabled!==a&&(!0===a?this.gl.enable(this.gl.POLYGON_OFFSET_FILL):this.gl.disable(this.gl.POLYGON_OFFSET_FILL),this._polygonOffsetFillEnabled=a)};c.prototype.setPolygonOffset=function(a,c){if(this._polygonOffset[0]!==a||this._polygonOffset[1]!==c)this._polygonOffset[0]=a,this._polygonOffset[1]=c,this.gl.polygonOffset(a,c)};c.prototype.setCullFace=function(a){this._cullFace!==a&&(this.gl.cullFace(a),this._cullFace=a)};c.prototype.setFrontFace=function(a){this._frontFace!== a&&(this.gl.frontFace(a),this._frontFace=a)};c.prototype.setScissorTestEnabled=function(a){this._scissorTestEnabled!==a&&(!0===a?this.gl.enable(this.gl.SCISSOR_TEST):this.gl.disable(this.gl.SCISSOR_TEST),this._scissorTestEnabled=a)};c.prototype.setScissorRect=function(a,c,b,e){if(this._scissorRect.x!==a||this._scissorRect.y!==c||this._scissorRect.width!==b||this._scissorRect.height!==e)this.gl.scissor(a,c,b,e),this._scissorRect.x=a,this._scissorRect.y=c,this._scissorRect.width=b,this._scissorRect.height= e};c.prototype.setDepthTestEnabled=function(a){this._depthTestEnabled!==a&&(!0===a?this.gl.enable(this.gl.DEPTH_TEST):this.gl.disable(this.gl.DEPTH_TEST),this._depthTestEnabled=a)};c.prototype.setClearDepth=function(a){this._clearDepth!==a&&(this.gl.clearDepth(a),this._clearDepth=a)};c.prototype.setDepthFunction=function(a){this._depthFunction!==a&&(this.gl.depthFunc(a),this._depthFunction=a)};c.prototype.setDepthWriteEnabled=function(a){this._depthWriteEnabled!==a&&(this.gl.depthMask(a),this._depthWriteEnabled= a)};c.prototype.setDepthRange=function(a,c){if(this._depthRange.zNear!==a||this._depthRange.zFar!==c)this.gl.depthRange(a,c),this._depthRange.zNear=a,this._depthRange.zFar=c};c.prototype.setStencilTestEnabled=function(a){this._stencilTestEnabled!==a&&(!0===a?this.gl.enable(this.gl.STENCIL_TEST):this.gl.disable(this.gl.STENCIL_TEST),this._stencilTestEnabled=a)};c.prototype.setClearStencil=function(a){a!==this._clearStencil&&(this.gl.clearStencil(a),this._clearStencil=a)};c.prototype.setStencilFunction= function(a,c,b){if(this._stencilFunction.func!==a||this._stencilFunction.ref!==c||this._stencilFunction.mask!==b)this.gl.stencilFunc(a,c,b),this._stencilFunction.face=1032,this._stencilFunction.func=a,this._stencilFunction.ref=c,this._stencilFunction.mask=b};c.prototype.setStencilFunctionSeparate=function(a,c,b,e){if(this._stencilFunction.face!==a||this._stencilFunction.func!==c||this._stencilFunction.ref!==b||this._stencilFunction.mask!==e)this.gl.stencilFuncSeparate(a,c,b,e),this._stencilFunction.face= a,this._stencilFunction.func=c,this._stencilFunction.ref=b,this._stencilFunction.mask=e};c.prototype.setStencilWriteMask=function(a){this._stencilWriteMask!==a&&(this.gl.stencilMask(a),this._stencilWriteMask=a)};c.prototype.setStencilOp=function(a,c,b){if(this._stencilOperation.fail!==a||this._stencilOperation.zFail!==c||this._stencilOperation.zPass!==b)this.gl.stencilOp(a,c,b),this._stencilOperation.face=1032,this._stencilOperation.fail=a,this._stencilOperation.zFail=c,this._stencilOperation.zPass= b};c.prototype.setStencilOpSeparate=function(a,c,b,e){if(this._stencilOperation.face!==a||this._stencilOperation.fail!==c||this._stencilOperation.zFail!==b||this._stencilOperation.zPass!==e)this.gl.stencilOpSeparate(a,c,b,e),this._stencilOperation.face=a,this._stencilOperation.face=a,this._stencilOperation.fail=c,this._stencilOperation.zFail=b,this._stencilOperation.zPass=e};c.prototype.setLineWidth=function(a){var c=this._lineWidth;this._lineWidth!==a&&(this.gl.lineWidth(a),this._lineWidth=a);return c}; c.prototype.setActiveTexture=function(a){var c=this._activeTextureUnit;0<=a&&a!==this._activeTextureUnit&&(this.gl.activeTexture(f.BASE_TEXTURE_UNIT+a),this._activeTextureUnit=a);return c};c.prototype.clear=function(a){a&&this.gl.clear(a)};c.prototype.drawArrays=function(a,c,b){this.gl.drawArrays(a,c,b)};c.prototype.drawElements=function(a,c,b,e){5123===b?this.gl.drawElements(a,c,b,e):5125===b&&this.gl.drawElements(a,c,b,e)};Object.defineProperty(c.prototype,"capabilities",{get:function(){return this._capabilities}, enumerable:!0,configurable:!0});c.prototype.setViewport=function(a,c,b,e){var d=this._viewport;if(d.x!==a||d.y!==c||d.width!==b||d.height!==e)d.x=a,d.y=c,d.width=b,d.height=e,this.gl.viewport(a,c,b,e)};c.prototype.getViewport=function(){return{x:this._viewport.x,y:this._viewport.y,width:this._viewport.width,height:this._viewport.height}};c.prototype.bindProgram=function(a){a?this._activeShaderProgram!==a&&(a.initialize(),this.gl.useProgram(a.glName),this._activeShaderProgram=a):(this.gl.useProgram(null), this._activeShaderProgram=null)};c.prototype.bindTexture=function(a,d){void 0===d&&(d=0);-1===c._MAX_TEXTURE_IMAGE_UNITS&&(c._MAX_TEXTURE_IMAGE_UNITS=this.gl.getParameter(this.gl.MAX_TEXTURE_IMAGE_UNITS));(d>=c._MAX_TEXTURE_IMAGE_UNITS||0>d)&&console.error("Input texture unit is out of range of available units!");var b=this._textureUnitMap[d];this.setActiveTexture(d);null==a||null==a.glName?(null!=b&&(this.gl.bindTexture(b.descriptor.target,null),b.setBoundToUnit(d,!1)),this._textureUnitMap[d]=null): b&&b.id===a.id?a.applyChanges():(this.gl.bindTexture(a.descriptor.target,a.glName),a.setBoundToUnit(d,!0),a.applyChanges(),this._textureUnitMap[d]=a)};c.prototype.bindFramebuffer=function(a){a?this._activeFramebuffer!==a&&(a.initialize()||this.gl.bindFramebuffer(this.gl.FRAMEBUFFER,a.glName),this._activeFramebuffer=a):(this.gl.bindFramebuffer(this.gl.FRAMEBUFFER,null),this._activeFramebuffer=null)};c.prototype.bindBuffer=function(a){a&&(34962===a.bufferType?this._activeVertexBuffer=c._bindBuffer(this.gl, a,a.bufferType,this._activeVertexBuffer):this._activeIndexBuffer=c._bindBuffer(this.gl,a,a.bufferType,this._activeIndexBuffer))};c.prototype.unbindBuffer=function(a){34962===a?this._activeVertexBuffer=c._bindBuffer(this.gl,null,a,this._activeVertexBuffer):this._activeIndexBuffer=c._bindBuffer(this.gl,null,a,this._activeIndexBuffer)};c.prototype.bindVAO=function(a){a?this._activeVertexArrayObject&&this._activeVertexArrayObject.id===a.id||(a.bind(),this._activeVertexArrayObject=a):this._activeVertexArrayObject&& (this._activeVertexArrayObject.unbind(),this._activeVertexArrayObject=null)};c.prototype.getBoundTexture=function(a){return this._textureUnitMap[a]};c.prototype.getBoundFramebufferObject=function(){return this._activeFramebuffer};c.prototype.getBoundVAO=function(){return this._activeVertexArrayObject};c.prototype.resetState=function(){this.bindProgram(null);this.bindVAO(null);this.bindFramebuffer(null);this.unbindBuffer(34962);this.unbindBuffer(34963);for(var a=0;ac;c++)b[c]=this.componentAABB[6*a+c];return b};b.prototype._computeComponentAABB= function(){for(var a=this.getComponentCount(),b=new Float32Array(6*a),c=0;c=c.length*d);a.assert(3===f.size||4===f.size);this.primitiveIndices=c;this.indices=b;this._position=f;this._numIndexPerPrimitive=d;var g=f.data,k=f.offsetIdx;f=f.strideIdx;var h=c.length,t=k+f*b[d*c[0]];this.bbMin=e.createFrom(g[t],g[t+1],g[t+2]);this.bbMax=e.create(this.bbMin);for(var u=0;ul;++l)f[l]=0;for(var l=this._position,h=l.data,n=l.offsetIdx,t=l.strideIdx,l=0;ll;++l)0a)return;a=Array(8);for(l=0;8>l;++l)a[l]=0l;++l)f[l]=0;for(l=0;ll;++l)void 0!==a[l]&&(this.children[l]=new c(a[l],this._numIndexPerPrimitive,this.indices,this._position))}return this.children};return c}()})},"esri/views/3d/layers/graphics/Graphics3DSymbol":function(){define("require exports ../../../../core/tsSupport/extendsHelper ./Graphics3DGraphic ./Graphics3DSymbolLayerFactory ../../support/PromiseLightweight".split(" "), function(r,h,f,a,e,c){return function(c){function d(a,d,f){var b=c.call(this)||this;b.symbol=a;a=a.symbolLayers;f&&(a=f.concat(a));f=a.length;b.childGraphics3DSymbols=Array(a.length);b.childGraphics3DSymbolPromises=Array(a.length);for(var g=d.layerOrder,k=0,l=0,h=!1,v=function(a,b){b&&(this.childGraphics3DSymbols[a]=b,l++);k--;!this.isRejected()&&h&&1>k&&(0k&&b.resolve();return b}f(d,c);d.prototype.createGraphics3DGraphic=function(b,c,d){for(var e=Array(this.childGraphics3DSymbols.length),f=0;fn&&(a=G,b=P);for(L=0;Lm&&(n=e+g+1,q=e);h*=3;for(var B=0;Bb||this._isPropertyDriven("opacity"),vertexColors:!0};this._material=new m(c,a+"_3dlinemat");this._context.stage.add(t.ModelContentType.MATERIAL,this._material);this.resolve()}; e.prototype.destroy=function(){b.prototype.destroy.call(this);this.isFulfilled()||this.reject();this._material&&this._context.stage.remove(t.ModelContentType.MATERIAL,this._material.id)};e.prototype.createGraphics3DGraphic=function(a,b){var c=this._validateGeometry(a.geometry);if("polygon"!==c.type&&"extent"!==c.type)return this._logWarning("unsupported geometry type for extrude symbol: "+c.type),null;var c="polygon"===c.type||"extent"===c.type?"rings":"paths",d="graphic"+a.uid,e=this._getVertexOpacityAndColor(b, Float32Array,255),f=this.getGraphicElevationContext(a);return this._createAs3DShape(a,c,b,e,f,d,a.uid)};e.prototype.layerPropertyChanged=function(a,b,c){if("opacity"===a){b=this._getMaterialOpacity();c=1>b||this._isPropertyDriven("opacity");this._material.setParameterValues({opacity:b,transparent:c});if(0r||Math.abs(X[1]-n[u+1])>r||Math.abs(X[2]-n[u+2])>r)z=!0;v+=3;u+=3}z&&a.geometryVertexAttrsUpdated(m);h+=x/q}b=h/k;ga(a);return b},h);p.alignedTerrainElevation=f.terrainElevation;p.needsElevationUpdates=d.needsElevationUpdates3D(h.mode);return p}}return null}; e.prototype._createExtrudeGeometry=function(a,b,c){for(var d=a.length,e=new Uint32Array(d),f=0;fc&&(c=64);var f=a.resource||{primitive:"circle",href:void 0},e={anchorPos:this._getAnchorPos(a)},g=this.symbolContainer; if(this._hasVisibleVerticalOffset(g)){var g=g.verticalOffset,k=g.minWorldLength,l=g.maxWorldLength;e.verticalOffset={screenLength:b.pt2px(g.screenLength),minWorldLength:k||0,maxWorldLength:null!=l?l:Infinity}}this._context.screenSizePerspectiveEnabled&&(e.screenSizePerspective=this._context.sharedResources.screenSizePerspectiveSettings);f.href?(this._outlineSize=this._getOutlineSize(a,null),e.color=this._getFillColor(a,null),e.outlineColor=this._getOutlineColor(a),e.outlineSize=this._outlineSize, e.textureIsSignedDistanceField=!1,this._prepareImageResources(c,e,d)):(f=f.primitive||"circle",g="primitive:"+f,this._primitive=f,this._outlineSize=this._getOutlineSize(a,f),e.color=this._getFillColor(a,f),e.outlineColor=this._getOutlineColor(a),e.outlineSize=this._outlineSize,M(f)&&0===e.outlineSize?this.reject():(this.texture=this._context.sharedResources.textures.acquire(g,H),this._textureURI=g,e.textureIsSignedDistanceField=!0,e.distanceFieldBoundingBox=Q,e.textureId=this.texture.id,this._size= [c,c],this._symbolTextureRatio=2,this._createMaterialsAndAddToStage(e,this._context.stage,d),this.resolve()))};x.prototype._getOutlineSize=function(a,c){var d=0,d=a.outline&&null!=a.outline.size?b.pt2px(a.outline.size):M(c)?1.5:0;return Math.max(d,0)};x.prototype._getOutlineColor=function(a){var b=this._getLayerOpacity();if(a.outline&&null!=a.outline.color){var c=g.toUnitRGB(a.outline.color);return[c[0],c[1],c[2],a.outline.color.a*b]}return[0,0,0,b]};x.prototype._getFillColor=function(a,b){return M(b)? S:this._getMaterialOpacityAndColor()};x.prototype._getAnchorPos=function(a){return-1c;c++){var d=a.size[c];d&&"symbolValue"!==d&&"proportional"!==d&&(a.size[c]=b.pt2px(d))}c= this._size[0]>this._size[1]?this._size[0]:this._size[1];if("symbolValue"!==a.size[0]){if(isFinite(+a.size[0]))return+a.size[0]/c;if(isFinite(+a.size[2]))return+a.size[2]/c}}return 1};x.prototype.createGraphics3DGraphic=function(a,b){var c=this._getGeometry(a);if(null===c)return null;var d="graphic"+a.uid,e=this._getVertexOpacityAndColor(b),f=1;this._fastUpdates.enabled&&this._fastUpdates.visualVariables.size||(f=this._getScaleFactor(b));f*=this._symbolTextureRatio;b=[this._size[0]*f,this._size[1]* f];f=this.getGraphicElevationContext(a);return"on-the-ground"===f.mode?this._createAsOverlay(a,c,e,b,f,d,a.uid):this._createAs3DShape(a,c,e,b,f,d,a.uid)};x.prototype.layerPropertyChanged=function(a,b,c){if("opacity"===a)return b=this._getFillColor(this.symbol,this._primitive),this._drapedMaterial.setParameterValues({color:b}),this._material.setParameterValues({color:b}),b=this._getOutlineColor(this.symbol),this._drapedMaterial.setParameterValues({outlineColor:b}),this._material.setParameterValues({outlineColor:b}), !0;if("elevationInfo"===a){a=this._elevationContext.mode;this._updateElevationContext();var d=this._elevationContext.mode;if("on-the-ground"===a&&"on-the-ground"===d)return!0;if(a!==d&&("on-the-ground"===a||"on-the-ground"===d))return!1;a=v.needsElevationUpdates2D(d)||"absolute-height"===d;for(var e in b){var f=b[e];(d=c(f))&&!d.isDraped()&&(f=this.getGraphicElevationContext(f.graphic),d.needsElevationUpdates=a,d.elevationContext.set(f))}return!0}return!1};x.prototype.applyRendererDiff=function(a, b,c,d){for(var e in a.diff)switch(e){case "visualVariables":if(z.updateFastSymbolUpdatesState(this._fastUpdates,b,this._fastVisualVariableConvertOptions()))this._material.setParameterValues(this._fastUpdates.materialParameters),this._drapedMaterial.setParameterValues(this._fastUpdates.materialParameters);else return!1;break;default:return!1}return!0};x.prototype.setDrawOrder=function(a,b,c){this._drapedMaterial&&(this._drapedMaterial.renderPriority=a,c[this._drapedMaterial.id]=!0)};x.prototype._defaultElevationInfoNoZ= function(){return V};x.prototype._createAs3DShape=function(a,b,c,d,e,f,g){var k=this,l=this._getFastUpdateAttrValues(a);a=l?function(a){return z.evaluateModelTransform(k._fastUpdates.materialParameters,l,a)}:null;c=F.createPointGeometry(N,null,c,d,U,null,l);c=[new E(c,f)];f=v.createStageObjectForPoint.call(this,b,c,[[this._material]],null,null,e,f,this._context.layer.uid,g,!0,a);if(null===f)return null;var h=new q(this,f.object,c,null,null,t.perObjectElevationAligner,e);h.alignedTerrainElevation= f.terrainElevation;h.needsElevationUpdates=v.needsElevationUpdates2D(e.mode)||"absolute-height"===e.mode;h.getScreenSize=this._createScreenSizeGetter(d,a);h.calculateRelativeScreenBounds=function(a){return k._material.calculateRelativeScreenBounds(h.getScreenSize(),1,a)};v.extendPointGraphicElevationContext(h,b,this._context.elevationProvider);return h};x.prototype._createAsOverlay=function(a,b,c,d,e,f,g){var k=this;this._drapedMaterial.renderPriority=this._symbolLayerOrder;g=J.create();A.pointToVector(b, g,this._context.overlaySR);g[2]=this._getDrapedZ();if((b=this._context.clippingExtent)&&!v.pointInBox2D(g,b))return null;var l=this._getFastUpdateAttrValues(a);a=l?function(a){return z.evaluateModelTransform(k._fastUpdates.materialParameters,l,a)}:null;c=F.createPointGeometry(N,g,c,d,null,null,l);b=new I(c);b.material=this._drapedMaterial;b.center=g;b.bsRadius=0;b.transformation=O;b.name=f;b.uniqueName=f+"#"+c.id;var h=new u(this,[b],null,null,null,e);h.getScreenSize=this._createScreenSizeGetter(d, a);h.calculateRelativeScreenBounds=function(a){return k._drapedMaterial.calculateRelativeScreenBounds(h.getScreenSize(),1,a)};return h};x.prototype._createScreenSizeGetter=function(a,b){var c=this._outlineSize+2;if(this._fastUpdates.enabled){var d=a[0]/this._symbolTextureRatio,e=a[1]/this._symbolTextureRatio;return function(a){void 0===a&&(a=Array(2));var f=b(O);a[0]=f[0]*d+c;a[1]=f[5]*e+c;return a}}var f=a[0]/this._symbolTextureRatio+c,g=a[1]/this._symbolTextureRatio+c;return function(a){void 0=== a&&(a=Array(2));a[0]=f;a[1]=g;return a}};x.prototype._supportsShaderVisualVariables=function(){return!0};x.prototype._fastVisualVariableConvertOptions=function(){var a=this._size[0]>this._size[1]?this._size[0]:this._size[1],c=[a,a,a],d=b.px2pt(1),a=a*d;return{modelSize:c,symbolSize:[a,a,a],unitInMeters:d,transformation:{anchor:R,scale:Y,rotation:R}}};x.prototype._hasVisibleVerticalOffset=function(a){return this.symbolContainer&&"point-3d"===this.symbolContainer.type&&this.symbolContainer.hasVisibleVerticalOffset()}; x.PRIMITIVE_SIZE=L;x.VALID_ANCHOR_STRINGS=X;return x}(x);var V={mode:"relative-to-ground",offset:0},U=r.createFrom(0,0,0,1);return x})},"esri/symbols/support/symbolUtils":function(){define(["require","exports","../../core/sniff"],function(r,h,f){Object.defineProperty(h,"__esModule",{value:!0});h.isVolumetricSymbol=function(a){return(a=a&&a.symbolLayers)?a.some(function(a){a=a.type;return"object"===a||"path"===a||"extrude"===a}):!1};h.getIconHref=function(e,c){c=c.resource.href;return!f("esri-canvas-svg-support")&& e.styleOrigin&&a.test(c)?c.replace(a,"/resource/png/$1.png"):c};var a=/\/resource\/(.*?)\.svg$/})},"esri/views/3d/layers/graphics/Graphics3DDrapedGraphicLayer":function(){define("require exports ../../../../core/tsSupport/extendsHelper ../../../../core/tsSupport/generatorHelper ../../../../core/tsSupport/awaiterHelper ./ElevationContext ../../support/aaBoundingBox ../../support/aaBoundingRect ../../webgl-engine/Stage".split(" "),function(r,h,f,a,e,c,g,d,b){r=function(){function d(a,b,d,e,f,g){this.needsElevationUpdates= !1;this.graphics3DSymbolLayer=a;this.renderGeometries=b;this.uniqueMaterials=d;this.uniqueTextures=e;this.boundingBox=f;this.elevationContext=new c(g);this.stage=null;this._visible=!1}d.prototype.initialize=function(a,c){this.stage=c;if(this.uniqueMaterials)for(a=0;al?k>c?Math.sqrt((k-c)*(k-c)+l*l):l:l>c?Math.sqrt(k*k+(l-c)*(l-c)):k;x=x/a+.5;e(x,b,4*h)}return b}})},"esri/views/3d/layers/support/FastSymbolUpdates":function(){define(["require","exports", "../../../../renderers/support/utils","../graphics/graphicUtils","../../lib/glMatrix"],function(r,h,f,a,e){function c(a){return null!==a&&void 0!==a}function g(a){return"number"===typeof a}function d(a,b){a&&a.push(b)}function b(a,b,e,l,h){var m=a.minSize,n=a.maxSize;if(a.expression)return d(h,"Could not convert size info: expression not supported"),!1;if(a.useSymbolValue)return a=l.symbolSize[e],b.minSize[e]=a,b.maxSize[e]=a,b.offset[e]=b.minSize[e],b.factor[e]=0,b.type[e]=1,!0;if(c(a.field)){if(c(a.stops)){if(2=== a.stops.length&&g(a.stops[0].size)&&g(a.stops[1].size))return k(a.stops[0].size,a.stops[1].size,a.stops[0].value,a.stops[1].value,b,e),b.type[e]=1,!0;d(h,"Could not convert size info: stops only supported with 2 elements");return!1}if(g(m)&&g(n)&&c(a.minDataValue)&&c(a.maxDataValue))return k(m,n,a.minDataValue,a.maxDataValue,b,e),b.type[e]=1,!0;if(null!=f.meterIn[a.valueUnit])return b.minSize[e]=-Infinity,b.maxSize[e]=Infinity,b.offset[e]=0,b.factor[e]=1/f.meterIn[a.valueUnit],b.type[e]=1,!0;"unknown"=== a.valueUnit?d(h,"Could not convert size info: proportional size not supported"):d(h,"Could not convert size info: scale-dependent size not supported");return!1}if(!c(a.field)){if(a.stops&&a.stops[0]&&g(a.stops[0].size))return b.minSize[e]=a.stops[0].size,b.maxSize[e]=a.stops[0].size,b.offset[e]=b.minSize[e],b.factor[e]=0,b.type[e]=1,!0;if(g(m))return b.minSize[e]=m,b.maxSize[e]=m,b.offset[e]=m,b.factor[e]=0,b.type[e]=1,!0}d(h,"Could not convert size info: unsupported variant of sizeInfo");return!1} function k(a,b,c,d,e,f){d=0e;++e){var f=b.unitInMeters;1===a.type[e]&&(f*=b.modelSize[e],a.type[e]=2);a.minSize[e]/=f;a.maxSize[e]/=f;a.offset[e]/=f;a.factor[e]/=f}if(0!==a.type[0])b=0;else if(0!==a.type[1])b=1;else if(0!==a.type[2])b=2;else return d(c,"No size axis contains a valid size or scale"),!1;for(e=0;3>e;++e)0===a.type[e]&&(a.minSize[e]=a.minSize[b],a.maxSize[e]=a.maxSize[b],a.offset[e]=a.offset[b],a.factor[e]=a.factor[b],a.type[e]=a.type[b]);return!0}function n(a, b,c){a[4*b+0]=c.r/255;a[4*b+1]=c.g/255;a[4*b+2]=c.b/255;a[4*b+3]=c.a}function t(a,b,e){if(a.normalizationField)return d(e,"Could not convert color info: unsupported property"),null;if("string"===typeof a.field)if(a.stops){if(8e;++e){var f=a[Math.min(e,a.length-1)];b.color.values[e]= f.value;n(b.color.colors,e,f.color)}}else if(a.colors){if(!c(a.minDataValue)||!c(a.maxDataValue))return d(e,"Could not convert color info: missing data values"),null;if(2!==a.colors.length)return d(e,"Could not convert color info: invalid colors array"),null;b.color={field:a.field,values:[0,0,0,0,0,0,0,0],colors:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]};b.color.values[0]=a.minDataValue;n(b.color.colors,0,a.colors[0]);b.color.values[1]=a.maxDataValue;n(b.color.colors,1,a.colors[1]); for(e=2;8>e;++e)b.color.values[e]=a.maxDataValue,n(b.color.colors,e,a.colors[1])}else return d(e,"Could not convert color info: missing stops or colors"),null;else if(a.stops&&0<=a.stops.length||a.colors&&0<=a.colors.length)for(a=a.stops&&0<=a.stops.length?a.stops[0].color:a.colors[0],b.color={field:null,values:[0,0,0,0,0,0,0,0],colors:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]},e=0;8>e;e++)b.color.values[e]=Infinity,n(b.color.colors,e,a);else return d(e,"Could not convert color info: no field and no colors/stops"), null;return b}function u(a,b,c,d){a=2===c&&"arithmetic"===a.rotationType;b.offset[c]=a?90:0;b.factor[c]=a?-1:1;b.type[c]=1}function q(a,b,c){if("string"!==typeof a.field)return d(c,"Could not convert rotation info: field is not a string"),null;if(!b.rotation)b.rotation={field:a.field,offset:[0,0,0],factor:[1,1,1],type:[0,0,0]};else if(a.field)if(!b.rotation.field)b.rotation.field=a.field;else if(a.field!==b.rotation.field)return d(c,"Could not convert rotation info: multiple fields in use"),null; switch(a.axis){case "tilt":return u(a,b.rotation,0,c),b;case "roll":return u(a,b.rotation,1,c),b;case null:case void 0:case "heading":return u(a,b.rotation,2,c),b;default:return d(c,'Could not convert rotation info: unknown axis "'+a.axis+'""'),null}}function v(a,b,c){if(!a)return null;var e=!b.supportedTypes||!!b.supportedTypes.size,f=!b.supportedTypes||!!b.supportedTypes.color,g=!b.supportedTypes||!!b.supportedTypes.rotation;return(a=a.reduce(function(a,k){if(!a)return a;if(k.valueExpression)return d(c, "Could not convert visual variables: arcade expressions not supported"),null;switch(k.type){case "size":return e?l(k,a,b,c):a;case "color":return f?t(k,a,c):a;case "rotation":return g?q(k,a,c):a;default:return d(c,"Could not convert visual variables: unsupported type "+k.type),null}},{size:null,color:null,rotation:null}))&&a.size&&!p(a.size,b,c)?null:a}function x(a,b,c){if(!!a!==!!b||a&&a.field!==b.field)return!1;if(a&&"rotation"===c)for(c=0;3>c;c++)if(a.type[c]!==b.type[c]||a.offset[c]!==b.offset[c]|| a.factor[c]!==b.factor[c])return!1;return!0}function m(a,b){var c={vvSizeEnabled:!1,vvSizeMinSize:null,vvSizeMaxSize:null,vvSizeOffset:null,vvSizeFactor:null,vvSizeValue:null,vvColorEnabled:!1,vvColorValues:null,vvColorColors:null,vvSymbolAnchor:null,vvSymbolRotation:null},d=a&&null!=a.size;a&&a.size?(c.vvSizeEnabled=!0,c.vvSizeMinSize=a.size.minSize,c.vvSizeMaxSize=a.size.maxSize,c.vvSizeOffset=a.size.offset,c.vvSizeFactor=a.size.factor):a&&d&&(c.vvSizeValue=b.transformation.scale);a&&d&&(c.vvSymbolAnchor= b.transformation.anchor,c.vvSymbolRotation=b.transformation.rotation);a&&a.color&&(c.vvColorEnabled=!0,c.vvColorValues=a.color.values,c.vvColorColors=a.color.colors);return c}Object.defineProperty(h,"__esModule",{value:!0});h.convertVisualVariables=v;h.initFastSymbolUpdatesState=function(a,b,c){return b&&a&&!a.disableFastUpdates?(a=v(a.visualVariables,c))?{enabled:!0,visualVariables:a,materialParameters:m(a,c),customTransformation:a&&null!=a.size}:{enabled:!1}:{enabled:!1}};h.updateFastSymbolUpdatesState= function(a,b,c){if(!b||!a.enabled)return!1;var d=a.visualVariables;b=v(b.visualVariables,c);if(!(b&&x(d.size,b.size,"size")&&x(d.color,b.color,"color")&&x(d.rotation,b.rotation,"rotation")))return!1;a.visualVariables=b;a.materialParameters=m(b,c);a.customTransformation=b&&null!=b.size;return!0};h.getMaterialParams=m;var B;(function(b){var c=e.mat4d,d=e.vec3,f=c.create(),g=d.create();b.evaluateModelTransform=function(b,d,e){if(!b.vvSizeEnabled)return e;c.identity(f);c.multiply(e,f,f);a.computeObjectRotation(b.vvSymbolRotation[2], b.vvSymbolRotation[0],b.vvSymbolRotation[1],f);if(b.vvSizeEnabled){for(e=0;3>e;++e){var k=b.vvSizeOffset[e]+d[0]*b.vvSizeFactor[e],l=e;var h=b.vvSizeMinSize[e],m=b.vvSizeMaxSize[e],k=km?m:k;g[l]=k}c.scale(f,g,f)}else c.scale(f,b.vvSizeValue,f);c.translate(f,b.vvSymbolAnchor,f);return f}})(B||(B={}));h.evaluateModelTransform=B.evaluateModelTransform})},"esri/views/3d/layers/graphics/Graphics3DLineSymbolLayer":function(){define("require exports ../../../../core/tsSupport/extendsHelper ../../../../core/screenUtils ../../../../geometry/Polygon ./ElevationAligners ./Graphics3DDrapedGraphicLayer ./Graphics3DGraphicLayer ./Graphics3DSymbolCommonCode ./Graphics3DSymbolLayer ./graphicUtils ./lineUtils ../../lib/glMatrix ../../support/aaBoundingBox ../../webgl-engine/Stage ../../webgl-engine/lib/Geometry ../../webgl-engine/lib/Object3D ../../webgl-engine/lib/RenderGeometry".split(" "), function(r,h,f,a,e,c,g,d,b,k,l,p,n,t,u,q,v,x){var m=n.vec3d,B=n.mat4d;return function(k){function h(){return null!==k&&k.apply(this,arguments)||this}f(h,k);h.prototype._prepareResources=function(){var a=this.symbol,b=this._isPropertyDriven("size")||this._isPropertyDriven("color")||this._isPropertyDriven("opacity"),a={idHint:this._getStageIdHint(),width:this._getWidth(a),color:this._getMaterialOpacityAndColor()};if(!this._isPropertyDriven("size")){var c=l.validateSymbolLayerSize(a.width);if(c){this._logWarning(c); this.reject();return}}if(b||1.5<=a.width)this._isPropertyDriven("size")&&(a.width=0),this._material=p.createRibbonMaterial(a);else if(0=D.count)){var F=D.index,L=D.count;if(this._context.clippingExtent&& (b.computeBoundingBox(x,F,L,A),b.boundingBoxClipped(A,this._context.clippingExtent)))continue;b.chooseOrigin(t,F,L,C);b.subtractCoordinates(t,F,L,C);D=new Float64Array(x.buffer,3*F*x.BYTES_PER_ELEMENT,3*L);F=new Float64Array(t.buffer,3*F*t.BYTES_PER_ELEMENT,3*L);F=p.createPolylineGeometry(F,D,"rings"===e,f,g);F=new q(F,l+"path"+E);F.singleUse=!0;a.push(F);z.push([this._material]);F=B.identity();B.translate(F,C,F);r.push(F)}}if(0m;m++)f.unprojectPoint(M[m],H[m]);l.point2plane(f.eye,H[0],H[1],J);l.point2plane(f.eye,H[1],H[2],O);l.point2plane(f.eye,H[2], H[3],N);l.point2plane(f.eye,H[3],H[0],S);a=Number.MAX_VALUE;for(m=0;ml.planeDistance(z,J)&&0>l.planeDistance(C,J)||0>l.planeDistance(z,O)&&0>l.planeDistance(C,O)||0>l.planeDistance(z,N)&&0>l.planeDistance(C,N)||0>l.planeDistance(z,S)&&0>l.planeDistance(C,S))){f.projectPoint(z,E);f.projectPoint(C,F);if(0>E[2]&&0F[2])g.vec3d.subtract(C,z,A),n=f.frustumPlanes,p=-(g.vec3d.dot(n[4],C)+n[4][3]),n=p/g.vec3d.dot(A,n[4]),g.vec3d.scale(A,n,A),g.vec3d.add(C,A,C),f.projectPoint(C,F);else if(0>E[2]&&0>F[2])continue;n=l.pointLineSegmentDistanceSquared2D(E,F,k);na&&(a=l.lineLineDistanceSquared3D(I,P,c,d,G),b=Number.MAX_VALUE,a.success&&(g.vec3d.subtract(a.pa, c,D),a=g.vec3d.length(D),g.vec3d.scale(D,1/a),b=a/g.vec3d.dist(c,d)),h(b,D))}else x.error("intersection assumes a translation-only matrix")};b.prototype.getGLMaterials=function(){return{color:m,depthShadowMap:void 0,normal:void 0,depth:void 0,highlight:B}};b.prototype.getAllTextureIds=function(){return[]};return b}(b);var m=function(a){function b(b,c,d){b=a.call(this,b,c)||this;b.program=c.get("simple");b.updateParameters();return b}f(b,a);b.prototype.updateParameters=function(){this.params=this.material.getParameterValues()}; b.prototype.beginSlot=function(a){return a===k.OPAQUE_MATERIAL};b.prototype.getProgram=function(){return this.program};b.prototype.bind=function(a,b){b=this.program;var c=this.params;a.bindProgram(b);b.setUniform4fv("color",c.color);a.setBlendingEnabled(1>c.color[3]);a.setBlendFunctionSeparate(a.gl.SRC_ALPHA,a.gl.ONE_MINUS_SRC_ALPHA,a.gl.ONE,a.gl.ONE_MINUS_SRC_ALPHA);a.setDepthTestEnabled(!0)};b.prototype.release=function(a){1>this.params.color[3]&&a.setBlendingEnabled(!1)};b.prototype.bindView=function(a, b){p.bindView(b.origin,b.view,this.program)};b.prototype.bindInstance=function(a,b){this.program.setUniformMatrix4fv("model",b.transformation)};b.prototype.getDrawMode=function(a){return a.gl.LINES};return b}(d),B=function(a){function b(b,c,d){b=a.call(this,b,c)||this;b.program=c.get("highlight");return b}f(b,a);b.prototype.updateParameters=function(){};b.prototype.beginSlot=function(a){return a===k.OPAQUE_MATERIAL};b.prototype.getProgram=function(){return this.program};b.prototype.bind=function(a, b){a.bindProgram(this.program);a.setDepthTestEnabled(!0)};b.prototype.release=function(a){};b.prototype.bindView=function(a,b){p.bindView(b.origin,b.view,this.program)};b.prototype.bindInstance=function(a,b){this.program.setUniformMatrix4fv("model",b.transformation)};b.prototype.getDrawMode=function(a){return a.gl.LINES};return b}(d),z=g.vec3d.create(),C=g.vec3d.create(),A=g.vec3d.create(),D=g.vec3d.create(),E=g.vec3d.create(),F=g.vec3d.create(),I=g.vec3d.create(),P=g.vec3d.create(),G={success:!1, dist2:0,pa:g.vec3d.create(),pb:g.vec3d.create()},M=[g.vec3d.create(),g.vec3d.create(),g.vec3d.create(),g.vec3d.create()],H=[g.vec3d.create(),g.vec3d.create(),g.vec3d.create(),g.vec3d.create()],J=g.vec4d.create(),O=g.vec4d.create(),N=g.vec4d.create(),S=g.vec4d.create(),R=[];return r})},"esri/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer":function(){define("require exports ../../../../core/tsSupport/extendsHelper ../../../../Color ../../../../geometry/support/MeshComponent ../../../../geometry/support/webMercatorUtils ../../../../geometry/support/meshUtils/projection ./ElevationAligners ./Graphics3DGraphicLayer ./Graphics3DSymbolCommonCode ./Graphics3DSymbolLayer ../support/edgeUtils ../support/symbolColorUtils ../../lib/glMatrix ../../support/aaBoundingBox ../../support/debugFlags ../../support/projectionUtils ../../webgl-engine/Stage ../../webgl-engine/lib/Geometry ../../webgl-engine/lib/GeometryData ../../webgl-engine/lib/Object3D ../../webgl-engine/lib/Texture ../../webgl-engine/lib/Util ../../webgl-engine/materials/DefaultMaterial ../../webgl-engine/materials/NativeLineMaterial".split(" "), function(r,h,f,a,e,c,g,d,b,k,l,p,n,t,u,q,v,x,m,B,z,C,A,D,E){var F=A.VertexAttrConstants;r=function(e){function l(){var a=null!==e&&e.apply(this,arguments)||this;a._edgeStageObjects=new Set;a._materials={};a._textures={};return a}f(l,e);l.prototype._prepareResources=function(){q.DRAW_MESH_GEOMETRY_NORMALS&&(this._debugVertexNormalMaterial=new E({color:[1,0,1,1]},"debugVertexNormal"),this._debugFaceNormalMaterial=new E({color:[0,1,1,1]},"debugFAceNormal"));this.resolve()};l.prototype.destroy=function(){e.prototype.destroy.call(this); this.isFulfilled()||this.reject();for(var a in this._materials)this._context.stage.remove(x.ModelContentType.MATERIAL,this._materials[a].material.id);for(a in this._textures)this._context.stage.remove(x.ModelContentType.TEXTURE,this._textures[a].id);this._materials={};this._textures={}};l.prototype.createGraphics3DGraphic=function(a,b){var c=this._validateGeometry(a.geometry);if("mesh"!==c.type)return this._logWarning("unsupported geometry type for fill on mesh-3d symbol: "+c.type),null;var c="graphic"+ a.uid,d=this.getGraphicElevationContext(a);return this._createAs3DShape(a,b,d,c,a.uid)};l.prototype.layerPropertyChanged=function(a,b,c){if("opacity"===a){b=this._getLayerOpacity();for(var d in this._materials){c=this._materials[d];c.material.setParameterValues({layerOpacity:b});var e=c.material.getParameterValues();this._setMaterialTransparentParameter(e);c.material.setParameterValues({transparent:e.transparent})}if(0a.layerOpacity|| 1>a.opacity||a.externalColor&&1>a.externalColor[3]};l.prototype._addDebugNormals=function(a,b,c,d){var e=b.length,f=a.spatialReference.isWGS84?20015077/180:1,g=.1*Math.max(a.extent.width*f,a.extent.height*f,a.extent.zmax-a.extent.zmin),k=[],l=[];a=[];for(var f=[],h=0;hr;r++)k.push(p[x+ r]);for(r=0;3>r;r++)k.push(p[x+r]+q[z+r]*g);l.push(l.length);l.push(l.length);if(0===v%3){this._calculateFaceNormal(p,u,v,N);this._getFaceVertices(p,u,v,H,J,O);t.vec3d.add(H,J);t.vec3d.add(H,O);t.vec3d.scale(H,1/3);for(r=0;3>r;r++)a.push(H[r]);for(r=0;3>r;r++)a.push(H[r]+N[r]*g);f.push(f.length);f.push(f.length)}}e=(C={},C[F.POSITION]={data:new Float64Array(k),size:3},C);C=(A={},A[F.POSITION]=new Uint32Array(l),A);A=new B(e,C,void 0,"line");A=new m(A,"debugVertexNormal");A.singleUse=!0;b.push(A); c.push([this._debugVertexNormalMaterial]);d.push(t.mat4d.create(d[0]));e=(E={},E[F.POSITION]={data:new Float64Array(a),size:3},E);C=(D={},D[F.POSITION]=new Uint32Array(f),D);A=new B(e,C,void 0,"line");A=new m(A,"debugFaceNormal");A.singleUse=!0;b.push(A);c.push([this._debugFaceNormalMaterial]);d.push(t.mat4d.create(d[0]));var C,A,E,D};l.prototype._createAs3DShape=function(a,c,e,f,g){var l=this;a=a.geometry;if("mesh"!==a.type)return null;var h=this._createGeometryInfo(a,c,f);if(!h)return null;c=h.geometries; var m=h.materials,n=h.transformations,h=h.objectTransformation;q.DRAW_MESH_GEOMETRY_NORMALS&&this._addDebugNormals(a,c,m,n);f=new z({geometries:c,materials:m,transformations:n,castShadow:!0,metadata:{layerUid:this._context.layer.uid,graphicId:g},idHint:f});f.setObjectTransformation(h);var t=function(a){var b=l._context.stage.view.getEdgeView();if(b){b.removeObject(a);l._edgeStageObjects.delete(a);var c=p.createMaterial(b,l.symbol,l._getLayerOpacity());c&&(l._edgeStageObjects.add(a),b.addObject(a, [c],{mergeGeometries:!0}))}};t(f);g=function(a,b,c,e,f){b=d.perObjectElevationAligner(a,b,c,e,f);t(a);return b};c=new b(this,f,c,null,null,g,e);c.needsElevationUpdates=k.needsElevationUpdates3D(e.mode);e=a.extent.center.clone();e.z=0;c.elevationContext.centerPointInElevationSR=e;c.alignedTerrainElevation=g(f,c.elevationContext,this._context.elevationProvider,this._context.renderCoordsHelper,this._context.featureExpressionInfoContext);return c};l.prototype._createComponentNormals=function(a,b,c,d){switch(c.shading|| "flat"){case "source":return this._createComponentNormalsSource(a,b,c,d);case "flat":return this._createComponentNormalsFlat(a,c,d);case "smooth":return this._createComponentNormalsSmooth(a,c,d)}};l.prototype._createComponentNormalsSource=function(a,b,c,d){if(!b)return this._createComponentNormalsFlat(a,c,d);c=!1;for(var e=0;ef;f++){var g=3*d[e+f];H[0]=b[g+0];H[1]=b[g+1];H[2]=b[g+2];0>t.vec3d.dot(N,H)&&(b[g+0]=-b[g+0],b[g+1]=-b[g+1], b[g+2]=-b[g+2],c=!0)}}return{normals:b,indices:d,didFlipNormals:c}};l.prototype._createComponentNormalsFlat=function(a,b,c){b=new Float32Array(c.length);for(var d=new Uint32Array(3*c.length),e=0;eg;g++)b[e+g]=f[g],d[e+g]=e/3;return{normals:b,indices:d,didFlipNormals:!1}};l.prototype._createComponentNormalsSmooth=function(a,b,c){b={};for(var d=0;df;f++){var g=c[d+f],k= b[g];k||(k={normal:t.vec3d.create(),count:0},b[g]=k);t.vec3d.add(k.normal,e);k.count++}a=new Float32Array(3*c.length);e=new Uint32Array(3*c.length);for(d=0;df;f++)a[3*d+f]=k.normal[f];e[d]=d}return{normals:a,indices:e,didFlipNormals:!1}};l.prototype._getFaceVertices=function(a,b,c,d,e,f){var g=3*b[c+0],k=3*b[c+1];b=3*b[c+2];d[0]=a[g+0];d[1]=a[g+1];d[2]=a[g+2];e[0]=a[k+0];e[1]=a[k+1]; e[2]=a[k+2];f[0]=a[b+0];f[1]=a[b+1];f[2]=a[b+2]};l.prototype._calculateFaceNormal=function(a,b,c,d){this._getFaceVertices(a,b,c,H,J,O);t.vec3d.subtract(J,H);t.vec3d.subtract(O,H);t.vec3d.cross(J,O,H);t.vec3d.normalize(H,d);return d};l.prototype._getOrCreateComponents=function(a){return a.components?a.components:X};l.prototype._createPositionBuffer=function(a){var b=a.vertexAttributes.position,c=new Float64Array(b.length);k.reproject(a.vertexAttributes.position,0,a.spatialReference,c,0,this._context.renderSpatialReference, b.length/3);return c};l.prototype._createNormalBuffer=function(a,b){var c=a.vertexAttributes.normal;if(!c)return null;if("local"===this._context.layerView.view.viewingMode)return c;var d=a.vertexAttributes.position,e=new Float32Array(c.length);return g.projectNormalToECEF(c,d,b,a.spatialReference,e)};l.prototype._createColorBuffer=function(a){if(this._requiresVertexColors()){a=this._getVertexOpacityAndColor(a);var b=this.symbol.material&&this.symbol.material.colorMixMode||null,c=new Uint8Array(4); n.encodeSymbolColor(a,b,c);return c}return null};l.prototype._createColorIndices=function(a,b){a=new Uint32Array(b.length);for(b=0;bc&&(c=e)}if(a<=c)return this._logWarning("Vertex index "+c+" is out of bounds of the mesh position buffer"),!1}else if(0!==a%3)return this._logWarning("Mesh position buffer length must be a multiple of 9 if no component faces are defined (3 values per vertex * 3 vertices per triangle)"),!1;return!0};l.prototype._getOrCreateFaces=function(a,b){if(b.faces)return b.faces;a=new Uint32Array(a.vertexAttributes.position.length/3);for(b=0;bb||this._isPropertyDriven("opacity"),instanced:["transformation"],ambient:D,diffuse:D};var f=this.symbolContainer;if("point-3d"===f.type&&f.verticalOffset){var f= f.verticalOffset,k=f.minWorldLength,l=f.maxWorldLength;b.verticalOffset={screenLength:g.pt2px(f.screenLength),minWorldLength:k||0,maxWorldLength:null!=l?l:Infinity};b.castShadows=!1}this._context.screenSizePerspectiveEnabled&&(b.screenSizePerspective=this._context.sharedResources.screenSizePerspectiveSettings);this._isPropertyDriven("color")?b.externalColor=E:(e=e.material?c.toUnitRGBA(e.material.color):E,b.externalColor=e);this._fastUpdates=u.initFastSymbolUpdatesState(this._context.renderer,this._supportsShaderVisualVariables(), this._fastVisualVariableConvertOptions());this._fastUpdates.enabled?(a.mixin(b,this._fastUpdates.materialParameters),b.instanced.push("featureAttribute")):this._hasPerInstanceColor()&&b.instanced.push("color");this._material=new z(b,d+"_objectmat");this._context.stage.add(x.ModelContentType.MATERIAL,this._material);this.resolve()};p.prototype._prepareModelResources=function(b,c){var d=this,f=["transformation"];c={materialParamsMixin:{instanced:f},idHint:c,streamDataSupplier:this._context.streamDataSupplier}; this._fastUpdates=u.initFastSymbolUpdatesState(this._context.renderer,this._supportsShaderVisualVariables(),this._fastVisualVariableConvertOptions());this._fastUpdates.enabled?(a.mixin(c.materialParamsMixin,this._fastUpdates.materialParameters),f.push("featureAttribute")):this._hasPerInstanceColor()&&f.push("color");f=this.symbolContainer;if("point-3d"===f.type&&f.verticalOffset){var f=f.verticalOffset,k=f.minWorldLength,l=f.maxWorldLength;c.materialParamsMixin.verticalOffset={screenLength:g.pt2px(f.screenLength), minWorldLength:k||0,maxWorldLength:null!=l?l:Infinity};c.materialParamsMixin.castShadows=!1}this._symbolLoaderPromise=t.fetch(b,c);this._symbolLoaderPromise.then(function(a){d._symbolLoaderPromise=null;if(!d.isRejected()){var b=d._context,c=a.stageResources,e=b.stage,f=d._getExternalColorParameters(d.symbol.material),g=d._getMaterialOpacity(),k=d._isPropertyDriven("opacity"),l=c[x.ModelContentType.MATERIAL];a.originalMaterialOpacities=Array(l.length);l.forEach(function(c,d){var e=c.getParameterValues(); c.setParameterValues(f);a.originalMaterialOpacities[d]=e.opacity;d=e.opacity*g;c.setParameterValues({opacity:d,transparent:1>d||k||e.transparent});b.screenSizePerspectiveEnabled&&c.setParameterValues({screenSizePerspective:b.sharedResources.screenSizePerspectiveSettings})});P.forEach(function(a){for(var b=c[a],d=0;b&&d b||e})})}else b=this._getMaterialOpacity(),this._material.setParameterValues({opacity:b,transparent:1>b||e});return!0}if("elevationInfo"===a){this._updateElevationContext();for(var g in b){var k=b[g];if(a=c(k))k=this.getGraphicElevationContext(k.graphic),a.needsElevationUpdates=l.needsElevationUpdates3D(k.mode),a.elevationContext.set(k)}return!0}return!1};p.prototype.applyRendererDiff=function(a,b,c,d){var e=this,f;for(f in a.diff)switch(f){case "visualVariables":if(u.updateFastSymbolUpdatesState(this._fastUpdates, b,this._fastVisualVariableConvertOptions()))this._forEachMaterial(function(a){return a.setParameterValues(e._fastUpdates.materialParameters)});else return!1;break;default:return!1}return!0};p.prototype._createAs3DShape=function(a,c,d,e,f,g){var h=this,m=null,p=null;if(a=this._getFastUpdateAttrValues(a))m=m||{},m.featureAttribute=a,p=function(a){return u.evaluateModelTransform(h._fastUpdates.materialParameters,m.featureAttribute,a)};!this._fastUpdates.enabled&&this._hasPerInstanceColor()&&(m=m||{}, m.color=n.mixinColorAndOpacity(d.color,d.opacity));a=this._context.layer.uid;var t=C.identity();this._applyObjectRotation(d,t);this._applyObjectRotation(this.symbol,t);this._applyObjectScale(d,t);this._applyAnchor(t);if(this._i3sModel){d=this._i3sModel.stageResources[x.ModelContentType.GEOMETRY];for(var q=this._i3sModel.materialsByComponent,v=Array(d.length),z=0;zf;++f)b[f]=Math.min(b[f],c[f]),b[f+3]=Math.max(b[f+3],d[f])}return b};h.createStageResources=B})},"esri/core/Version":function(){define(["require","exports","./Error"],function(r,h,f){Object.defineProperty(h,"__esModule",{value:!0}); r=function(){function a(a,c,f){void 0===f&&(f="");this.major=a;this.minor=c;this._context=f}a.prototype.lessThan=function(a,c){return this.majorb||this._isPropertyDriven("opacity"),vertexColors:this._isPropertyDriven("color")||this._isPropertyDriven("opacity")};this._material=new q(c,a+"_3dlinemat");this._context.stage.add(l.ModelContentType.MATERIAL,this._material);this.resolve()};b.prototype.destroy=function(){a.prototype.destroy.call(this); this.isFulfilled()||this.reject();this._material&&(this._context.stage.remove(l.ModelContentType.MATERIAL,this._material.id),this._material=null)};b.prototype.createGraphics3DGraphic=function(a,b){var c=this._validateGeometry(a.geometry);if("polyline"!==c.type)return this._logWarning("unsupported geometry type for path symbol: "+c.type),null;var c="graphic"+a.uid,d=this.getGraphicElevationContext(a);return this._createAs3DShape(a,b,d,c,a.uid)};b.prototype.layerPropertyChanged=function(a,b,d){if("opacity"=== a)return b=this._getMaterialOpacity(),d=1>b||this._isPropertyDriven("opacity"),this._material.setParameterValues({opacity:b,transparent:d}),!0;if("elevationInfo"===a){this._updateElevationContext();for(var e in b){var f=b[e];if(a=d(f))f=this.getGraphicElevationContext(f.graphic),a.needsElevationUpdates=c.needsElevationUpdates3D(f.mode),a.elevationContext.set(f)}return!0}return!1};b.prototype._getPathSize=function(a){a=a.size&&this._isPropertyDriven("size")?c.getSingleSizeDriver(a.size):this._getSymbolSize(); return a/=this._context.renderCoordsHelper.unitInMeters};b.prototype._getSymbolSize=function(){return this.symbol.size||1};b.prototype._createAs3DShape=function(a,b,d,f,g){var l=a.geometry,h=l.hasZ,q=l.paths;a=[];var u=[],z=[],B=x.create(),r=this._context.renderSpatialReference===k.SphericalECEFSpatialReference,C=Array(6),A=this._getPathSize(b),l=c.getGeometryVertexData3D(q,h,l.spatialReference,this._context.renderSpatialReference,this._context.elevationProvider,this._context.renderCoordsHelper,d); this._logGeometryCreationWarnings(l,q,"paths","PathSymbol3DLayer");if(0=I.count)){var G=I.index,P=I.count;if(this._context.clippingExtent&&(c.computeBoundingBox(h,G,P,C),c.boundingBoxClipped(C,this._context.clippingExtent)))continue;c.chooseOrigin(D,G,P,B);c.subtractCoordinates(D,G,P,B);I=new Float64Array(h.buffer,3*G*h.BYTES_PER_ELEMENT,3*P);G=c.flatArrayToArrayOfArrays(D,G,P);G=n.createTubeGeometry(G, .5*A,E,r,B);G.getVertexAttr().mapPos={size:3,data:I,offsetIdx:0,strideIdx:3};this._material.getParams().vertexColors&&(I=this._getVertexOpacityAndColor(b),G=n.addVertexColors(G,I));I=new p(G,f+"path"+F);I.singleUse=!0;a.push(I);u.push([this._material]);I=m.identity();m.translate(I,B,I);z.push(I)}}if(0b[3]||this._isPropertyDriven("opacity"),polygonOffset:!1,vertexColors:!0};this._material=new A(b,a+"_colormat");this._context.stage.add(v.ModelContentType.MATERIAL,this._material)};p.prototype._prepareOutlineResources=function(){var a=this.symbol.outline;if(this._hasOutline=!!(a&&a.size&&0c),this._outlineMaterial&&(b=this._outlineMaterial.getColor(),this._outlineMaterial.setColor([b[0],b[1],b[2],this._getOutlineOpacity()])),!0;if("elevationInfo"===a){a=this._elevationContext.mode;this._updateElevationContext();var d=this._elevationContext.mode;if(null==a||null==d)return!1;if("on-the-ground"===a&&"on-the-ground"===d)return!0;if(a!==d&&("on-the-ground"===a||"on-the-ground"===d))return!1;a=l.needsElevationUpdates2D(d);for(var e in b){var f= b[e];(d=c(f))&&!d.isDraped()&&(f=f.graphic,d.needsElevationUpdates=a,d.elevationContext.set(this.getGraphicElevationContext(f)))}return!0}return!1};p.prototype.setDrawOrder=function(a,b,c){this._material&&(this._material.renderPriority=a+b/2,c[this._material.id]=!0);this._outlineMaterial&&(this._outlineMaterial.renderPriority=a,c[this._outlineMaterial.id]=!0)};p.prototype._createAs3DShape=function(a,b,c,e,f){var g=this._getPolyGeometry(a),h=g.hasZ;a=g.rings;var m=this._getOutlineGeometry(g,a),g=l.getGeometryVertexData3D(m, h,g.spatialReference,this._context.renderSpatialReference,this._context.elevationProvider,this._context.renderCoordsHelper,c);G.idHint=e;G.color=b;G.data=g;var n;this._hasOutline&&(n=new g.vertexData.constructor(g.vertexData));G.outNum=0;G.outGeometries=[];G.outTransforms=[];G.outMaterials=[];this._createAs3DShapeFill(G);G.data.vertexData=n;this._createAs3DShapeOutline(G);this._logGeometryCreationWarnings(G.data,a,"rings","FillSymbol3DLayer");if(0===G.outNum)return null;b=new B({geometries:G.outGeometries, materials:G.outMaterials,transformations:G.outTransforms,castShadow:!1,metadata:{layerUid:this._context.layer.uid,graphicId:f},idHint:e});b=new k(this,b,G.outGeometries,null,null,d.perVertexElevationAligner,c);b.alignedTerrainElevation=g.terrainElevation;b.needsElevationUpdates=l.needsElevationUpdates2D(c.mode);return b};p.prototype._createAs3DShapeFill=function(a){for(var b=a.data.geometryData.polygons,d=a.data.eleVertexData,e=a.data.vertexData,f=function(f){var k=b[f];f=k.count;var h=k.index;if(g._context.clippingExtent&& (l.computeBoundingBox(d,h,f,F),l.boundingBoxClipped(F,g._context.clippingExtent)))return"continue";var m=new Float64Array(d.buffer,3*h*d.BYTES_PER_ELEMENT,3*f),n=new Float64Array(e.buffer,3*h*e.BYTES_PER_ELEMENT,3*f),k=k.holeIndices.map(function(a){return a-h}),k=c(m,k,3);if(0===k.length)return"continue";l.chooseOrigin(e,h,f,I);l.subtractCoordinates(e,h,f,I);f=g._createFillGeometry(k,0,n,m,a.color);f=new x(f,a.idHint);f.singleUse=!0;m=E.identity();E.translate(m,I,m);a.outGeometries.push(f);a.outMaterials.push([g._material]); a.outTransforms.push(m);a.outNum++},g=this,k=0;kk.length)return null;b&&null!=b.needsOffsetAdjustment&&(this._elevationOptions.needsOffsetAdjustment=b.needsOffsetAdjustment); var l=this.getGraphicElevationContext(a,b.elevationOffset||0);return this._createAs3DShape(this.symbol,f,k,l,g,a.uid,b,c,d,e)};h.prototype.getGraphicElevationContext=function(a,b){void 0===b&&(b=0);a=k.prototype.getGraphicElevationContext.call(this,a);a.addOffsetRenderUnits(b);return a};h.prototype.layerPropertyChanged=function(a,b,c){if("opacity"===a)this._logWarning("layer opacity change not yet implemented in Graphics3DTextSymbolLayer");else if("elevationInfo"===a){this._updateElevationContext(); if(b)for(var d in b){a=b[d];var e=c(a);e&&this.updateGraphicElevationContext(a.graphic,e)}return!0}return!1};h.prototype.updateGraphicElevationContext=function(a,c){a=this.getGraphicElevationContext(a,c.metadata.elevationOffset);c.elevationContext.set(a);c.needsElevationUpdates=b.needsElevationUpdates2D(a.mode)||"absolute-height"===a.mode};h.prototype._defaultElevationInfoNoZ=function(){return x};h.prototype._createAs3DShape=function(f,k,l,h,x,z,B,r,M,H){var C=B.centerOffset||m,A=B.screenOffset|| [0,0],E=B.debugDrawBorder||!1,D=B.translation||[0,0,0],F=B.anchor||this._anchor||"center";this._anchor=F;var I=f.material?a.toUnitRGBA(f.material.color):q,G=f.halo&&f.halo.color&&0=this._renderedWidth&&2048>=this._renderedHeight);this._width=a.nextHighestPowerOfTwo(this._renderedWidth);this._height=a.nextHighestPowerOfTwo(this._renderedHeight)}Object.defineProperty(k.prototype,"id",{get:function(){null== this._id&&(this._id=f.idGen.gen(this._idHint));return this._id},enumerable:!0,configurable:!0});k.prototype.getParams=function(){return this._params};k.prototype.getText=function(){return this._text};k.prototype.deferredLoading=function(){return!1};k.prototype.getWidth=function(){return this._width};k.prototype.getHeight=function(){return this._height};k.prototype.getTextWidth=function(){return this._textWidth};k.prototype.getTextHeight=function(){return this._textHeight};k.prototype.getRenderedWidth= function(){return this._renderedWidth};k.prototype.getRenderedHeight=function(){return this._renderedHeight};k.prototype.initializeThroughRender=function(a,b){var c=this._getTextCanvas();c.width=this._width;c.height=this._height;var d=c.getContext("2d");d.save();b.samplingMode=9987;b.wrapMode=33071;b.flipped=!0;b.preMultiplyAlpha=!0;b.hasMipmap=!0;this.renderText(this._renderedWidth,this._renderedHeight,d,0,this._height-this._renderedHeight);a=new e(a,b,c);d.restore();return a};k.prototype.getTexcoordScale= function(){return[this._renderedWidth/this._width,this._renderedHeight/this._height]};k.prototype.setUnloadFunc=function(a){this._unloadFunc=a};k.prototype.unload=function(){this._unloadFunc&&(this._unloadFunc(this._id),this._unloadFunc=null)};k.prototype.renderText=function(a,c,d,e,f){void 0===e&&(e=0);void 0===f&&(f=0);c=this._lineHeight*this._scaleFactor;var g=this._haloSize,k=d.textAlign;a=("center"===k?.5*a:"right"===k?a:0)+g;d.save();var l=3>g;if(0r;r++)n.lineWidth= (.6+.1*r)*u,n.strokeText(l,a,k);k+=c}d.globalAlpha=this._params.halo.color[3];d.drawImage(h,e,f);h.width=512;h.height=512;d.globalAlpha=1}this._setFontProperties(d,this._params.size*this._scaleFactor);k=f+g;f=0;for(g=this._textLines;fb&&(b=e)}c=this._params.font;if("italic"===c.style||"oblique"===c.style||"string"===typeof c.weight&&("bold"===c.weight||"bolder"===c.weight)||"number"===typeof c.weight&&600h;h+=22.5)b.push([Math.cos(Math.PI*h/180),Math.sin(Math.PI*h/180)]);return r})},"esri/views/3d/layers/graphics/Graphics3DWebStyleSymbol":function(){define(["require","exports","../../../../core/tsSupport/extendsHelper","../../support/PromiseLightweight"],function(r,h,f,a){return function(a){function c(c,d){var b=a.call(this)||this;b.symbol=null;b.graphics3DSymbol=null;b.symbol=c;c.fetchSymbol().then(function(a){if(b.isRejected())throw Error();b.graphics3DSymbol=d(a)}).then(function(){if(b.isRejected())throw Error(); b.graphics3DSymbol.then(function(){b.isRejected()||b.resolve()},function(a){b.isRejected()||b.reject(a)})}).catch(function(a){b.isRejected()||b.reject(a)});return b}f(c,a);c.prototype.createGraphics3DGraphic=function(a,c){return this.graphics3DSymbol.createGraphics3DGraphic(a,c,this)};c.prototype.layerPropertyChanged=function(a,c){return this.graphics3DSymbol.layerPropertyChanged(a,c)};c.prototype.applyRendererDiff=function(a,c,b){return this.graphics3DSymbol.applyRendererDiff(a,c,b)};c.prototype.getFastUpdateStatus= function(){return this.graphics3DSymbol?this.graphics3DSymbol.getFastUpdateStatus():{loading:1,fast:0,slow:0}};c.prototype.setDrawOrder=function(a,c){return this.graphics3DSymbol.setDrawOrder(a,c)};c.prototype.destroy=function(){this.isFulfilled()||this.reject();this.graphics3DSymbol&&this.graphics3DSymbol.destroy()};return c}(a.Promise)})},"esri/views/3d/webgl-engine/lib/FloatingBoxLocalOriginFactory":function(){define(["require","exports","./gl-matrix"],function(r,h,f){var a=f.vec3d;r=function(){function c(a, c){this._origins=[];this._boxSize=a;this._maxNumOrigins=c}c.prototype.getOrigin=function(f){for(var d=this._origins.length,b,g=!1,l=Number.MAX_VALUE,h=0;hc;c++)b=Math.max(b,a[1][c]-a[0][c]);c=k.create();k.lerp(a[0],a[1],.5,c);this._spatialAccelerator=new g(c,1.2*b);this._spatialAccelerator.add(this._children)};a.prototype._invalidateExtent=function(){this._extentDirty=!0};a.prototype._updateExtent=function(){if(this._extentDirty)if(0===this._children.length)this._extent=[[0,0,0],[0,0,0]];else{var a=this._children[0];this._extent=[k.create(a.getBBMin()),k.create(a.getBBMax())]; for(a=0;ad;++d)this._extent[0][d]=Math.min(this._extent[0][d],c[d]),this._extent[1][d]=Math.max(this._extent[1][d],b[d]);this._extentDirty=!1}};a._idGen=new e;return a}()})},"esri/views/3d/webgl-engine/lib/Octree":function(){define(["require","exports","./gl-matrix","./Util"],function(r,h,f,a){function e(a,b,c){c=c||a;c[0]=a[0]+b;c[1]=a[1]+b;c[2]=a[2]+b;return c}var c=f.vec3d;r=function(){function d(a,b,d){this._maximumObjectsPerNode= 10;this._maximumDepth=20;this._autoResize=!0;this._outsiders=[];d&&(void 0!==d.maximumObjectsPerNode&&(this._maximumObjectsPerNode=d.maximumObjectsPerNode),void 0!==d.maximumDepth&&(this._maximumDepth=d.maximumDepth),void 0!==d.autoResize&&(this._autoResize=d.autoResize));isNaN(a[0])||isNaN(a[1])||isNaN(a[2])||isNaN(b)?this._root=new g(null,c.createFrom(0,0,0),.5):this._root=new g(null,a,b/2)}Object.defineProperty(d.prototype,"center",{get:function(){return this._root.center},enumerable:!0,configurable:!0}); Object.defineProperty(d.prototype,"size",{get:function(){return 2*this._root.halfSize},enumerable:!0,configurable:!0});Object.defineProperty(d.prototype,"root",{get:function(){return this._root.node},enumerable:!0,configurable:!0});Object.defineProperty(d.prototype,"outsiders",{get:function(){return this._outsiders.slice()},enumerable:!0,configurable:!0});Object.defineProperty(d.prototype,"maximumObjectsPerNode",{get:function(){return this._maximumObjectsPerNode},enumerable:!0,configurable:!0});Object.defineProperty(d.prototype, "maximumDepth",{get:function(){return this._maximumDepth},enumerable:!0,configurable:!0});Object.defineProperty(d.prototype,"autoResize",{get:function(){return this._autoResize},enumerable:!0,configurable:!0});d.prototype.add=function(a){a=this._objectOrObjectsArray(a);this._grow(a);for(var b=g.acquire(),c=0;ce;e++)if(c.center[e]+db[e])return!1;return!0},c)};d.prototype.forEachNode=function(a){this._forEachNode(this._root,function(b){return a(b.node,b.center,2*b.halfSize)})};d.prototype._forEachTest=function(a,b){this._outsiders.forEach(b);this._forEachNode(this._root,function(c){return a(c)?(c=c.node, c.terminals.forEach(b),null!==c.residents&&c.residents.forEach(b),!0):!1})};d.prototype._forEachNode=function(a,b){a=g.acquire().init(a);for(var c=[a];0!==c.length;){a=c.pop();if(b(a)&&!a.isLeaf())for(var d=0;dthis._maximumObjectsPerNode&&b.depththis._maximumDepth};d.prototype._rootBoundsForRootAsSubNode=function(a,b){var c=a.radius,d=a.center; a=-Infinity;for(var e=this._root.center,f=this._root.halfSize,g=0;3>g;g++){var l=Math.max(0,Math.ceil((e[g]-f-(d[g]-c))/(2*f))),h=Math.max(0,Math.ceil((d[g]+c-(e[g]+f))/(2*f)))+1;a=Math.max(a,Math.pow(2,Math.ceil(Math.log(l+h)*Math.LOG2E)));x[g].min=l;x[g].max=h}for(g=0;3>g;g++)l=x[g].min,h=x[g].max,c=(a-(l+h))/2,l+=Math.ceil(c),h+=Math.floor(c),k[g]=e[g]-f-l*f*2+(h+l)*f;return b.initFrom(null,k,a*f,0)};d.prototype._growRootAsSubNode=function(a){var b=this._root.node;c.set(this._root.center,u.center); u.radius=this._root.halfSize;this._root.init(a);a.advanceTo(u,null,!0);a.node.children=b.children;a.node.residents=b.residents;a.node.terminals=b.terminals};d.prototype._shrink=function(){if(this._autoResize)for(;;){var a=this._findShrinkIndex();if(-1===a)break;this._root.advance(a);this._root.depth=0}};d.prototype._findShrinkIndex=function(){if(0!==this._root.node.terminals.length||this._root.isLeaf())return-1;for(var a=null,b=this._root.node.children,c=0,d=0;d=b[0]-c&&d[0]<=b[0]+c&&d[1]>=b[1]-c&&d[1]<=b[1]+c&&d[2]>=b[2]-c&&d[2]<=b[2]+c};d.prototype._boundingSphereFromObject=function(a,b){c.set(a.getCenter(),b.center);b.radius=a.getBSRadius();return b};d.prototype._boundingSphereFromObjects=function(a,b,d){if(1===a.length){var e=b(a[0],u);c.set(e.center,d.center);d.radius=e.radius}else{l[0]=Infinity; l[1]=Infinity;l[2]=Infinity;p[0]=-Infinity;p[1]=-Infinity;p[2]=-Infinity;for(var f=0;fthis.halfSize/ 2};a.prototype._childIndex=function(a){a=a.center;for(var b=this.center,c=0,d=0;3>d;d++)b[d]c.xmin&&e[0]c.ymin&&e[1]d&&g.pop().client.terminate();return e}var c= r([a],{declaredClass:"esri.workers.RequestClient",constructor:function(){this.setWorker(["./mutableWorker","./requestWorker"],function(){})},get:function(a){return this._send("GET",a)},post:function(a){return this._send("POST",a)},_send:function(a,b){b=h._ioSetArgs(b);b.xhr=null;var c=b.ioArgs,d=c.url;delete c.url;delete c.args;this.postMessage({method:a,url:d,options:c}).then(this._getSuccessHandler(b),this._getErrorHandler(b),this._getProgressHandler(b));return b},_addHeaderFunctions:function(a){a.getResponseHeader= function(b){var c,d=a.headers;Object.keys(d).forEach(function(a){if(a.toLowerCase()==b.toLowerCase())return c=d[a],!1});return c};a.getAllResponseHeaders=function(){var b=[],c=a.headers;Object.keys(c).forEach(function(a){b.push(a+": "+c[a])});return b=b.join("\n")};return a},_getSuccessHandler:function(a){var b=this,c=a.ioArgs;return function(d){a.xhr=b._addHeaderFunctions(d);d=a.xhr.getResponseHeader("content-type");("xml"==c.handleAs||-1=this.list.length&&this.list.push(new this.creator(a));return this.list[this.currentIndex++]};a.prototype.freeAll=function(){for(var a=this.currentIndex,b=this.disposer,c=this.list;0<=--a;)b(c[a]);this.currentIndex=0};return a}(),H=function(){function a(){this.graphics3DGraphic=null;this.positions=[q.create(),q.create(),q.create(),q.create()];this.posView=this.yMax=this.yMin=this.xMax=this.xMin=0;this.graphicsOwner=null;this.graphicId=this.id=0}a.release=function(a){a.graphics3DGraphic= null;a.graphicsOwner=null};return a}();e=function(){function d(b){var d=this;this.graphicsOwners=[];this.deconflictTimeoutId=0;this.handles=new a;this.graphicInfoPool=new M(H,H.release);this.nextGraphicInfoId=0;this.accBinsNumX=15;this.accBinsNumY=20;this.accBinsSizeY=this.accBinsSizeX=0;this.accBins=null;this.accNumTests=0;this.iconMarginFactor=-.1;this.view=b;this.handles.add([b.watch("state.camera",function(){return d.scheduleRun()}),c.whenNot(b,"ready",function(){return d.clearDeconflictTimeout()})])} d.prototype.destroy=function(){this.handles.destroy();this.handles=null;this.clearDeconflictTimeout();this.graphicInfoPool.freeAll();this.view=this.graphicInfoPool=null};d.prototype.clearDeconflictTimeout=function(){this.deconflictTimeoutId&&(clearTimeout(this.deconflictTimeoutId),this.deconflictTimeoutId=0)};d.prototype.addGraphicsOwner=function(a){var b=this;this.graphicsOwners.push(a);this.setDirty();a.layer&&"function"===typeof a.layer.watch&&a.layer.watch("featureReduction",function(c,d){u(c)? b.setDirty():u(d)&&(b._removeIconVisibilityFlags(a),b.setDirty())})};d.prototype.removeGraphicsOwner=function(a){a=this.graphicsOwners.indexOf(a);0<=a&&this.graphicsOwners.splice(a,1);this.setDirty()};d.prototype.setDirty=function(){this.scheduleRun(10)};d.prototype.initializeLabelVisibility=function(a){a.setVisibilityFlag(2,!1,1)};d.prototype.doesIntersectExistingPoly=function(a){var b=a.graphicId,c=a.positions;F.clear();for(var d=Math.floor(a.xMin/this.accBinsSizeX);d<=Math.floor(a.xMax/this.accBinsSizeX);d++)if(!(0> d||d>=this.accBinsNumX))for(var e=Math.floor(a.yMin/this.accBinsSizeY);e<=Math.floor(a.yMax/this.accBinsSizeY);e++)if(!(0>e||e>=this.accBinsNumY)){var f=this.accBins[d][e],g=0;a:for(;gl;l++){var h=0===l?c:k,m=0===l?k:c,n=0;b:for(;4>n;n++){var p=h[n],t=h[(n+1)%4],u=h[(n+2)%4];A[0]=t[0]-p[0];A[1]=t[1]-p[1];t=q.normalize(A);x=[-t[1],t[0]];t[0]=x[0];t[1]=x[1];p=t[0]*p[0]+t[1]*p[1]; u=t[0]*u[0]+t[1]*u[1]x;x++){var v=m[x],v=t[0]*v[0]+t[1]*v[1];if(u&&vp)continue b}continue a}}return!0}}}return!1;var x};d.prototype.initBins=function(a,b){if(null==this.accBins){this.accBins=[];for(var c=0;cb||b>=this.accBinsNumX))for(var c=Math.floor(a.yMin/this.accBinsSizeY);c<=Math.floor(a.yMax/this.accBinsSizeY);c++)0>c||c>=this.accBinsNumY||this.accBins[b][c].push(a)};d.prototype.scheduleRun=function(a){var b=this;void 0===a&&(a=200);0===this.deconflictTimeoutId&&(this.deconflictTimeoutId=setTimeout(function(){return b.run()}, a))};d.prototype.run=function(){var a=this.view;this.clearDeconflictTimeout();if(a.ready){var b=a.state.camera;this.graphicInfoPool.freeAll();this.nextGraphicInfoId=0;var c=b.fullWidth,d=b.fullHeight;g.prepare(a);P.clear();G.clear();for(var a=!1,e=0;eS)){var G=F.getGeometryRecord(0),N=G.materials[0];if(N instanceof n)if(1u[0]||-1>u[1]||-1>u[2]||1<=u[0]||1<=u[1])break;p=q[2];a.areVisibilityFlagsSet(2,void 0,h)&&(p*=.7)}A=A.getScreenSize(O);l.applyPrecomputedScaleFactorVec2(A, J.factor,A);N=b.offset(N.calculateRelativeScreenBounds(A,J.scaleAlignment,E),I(0,e.fullWidth,.5+.5*u[0]),I(0,e.fullHeight,.5+.5*u[1]));0!==g&&(A=g*Math.min(b.width(N),b.height(N)),N[0]-=A,N[1]-=A,N[2]+=A,N[3]+=A);b.expand(c,N)}}}}null!=p&&(e=this.graphicInfoPool.alloc(),e.id=this.nextGraphicInfoId++,e.graphicId=a.graphic.uid,e.xMin=c[0],e.yMin=c[1],e.xMax=c[2],e.yMax=c[3],e.positions[0][0]=c[0],e.positions[0][1]=c[1],e.positions[1][0]=c[0],e.positions[1][1]=c[3],e.positions[2][0]=c[2],e.positions[2][1]= c[3],e.positions[3][0]=c[2],e.positions[3][1]=c[1],e.graphics3DGraphic=a,e.posView=p,e.graphicsOwner=d,f.push(e))}};d.prototype._deconflictVisibleObjects=function(a,b){for(var c=b?1:0,d=0;db;b++)e.lineTo(a[b][0],c-a[b][1]),e.stroke();e.lineTo(a[0][0],c-a[0][1]);e.stroke();e.closePath()}}Object.defineProperty(h,"__esModule",{value:!0});var g=a.vec2d,d=!1,b=!1,k,l;h.drawAccelerationStruct=function(a,d){if(b&&l){for(var e=l,f=[g.create(),g.create(),g.create(),g.create()],k=0,h=0;h=this.data.length&&this.grow(Math.max(2*this.length,a));for(a=0;a>>1,b=f[g-1];a<=d;){a=g<<1;ac(f[a-1],f[a])&&++a;var k=f[a-1];if(0>=c(k,b))break; f[g-1]=k;g=a}f[g-1]=b}function h(f,a){return fa?1:0}return{sort:function(f,a,e,c){void 0===a&&(a=0);void 0===e&&(e=f.length);void 0===c&&(c=h);for(var g=e>>>1;g>a;g--)r(f,g,e,c);for(var d=a+1,g=e-1;g>a;g--)e=f[a],f[a]=f[g],f[g]=e,r(f,d,g,c);return f}}})},"esri/views/3d/state/ViewState":function(){define("require exports ../../../core/tsSupport/declareExtendsHelper ../../../core/tsSupport/decorateHelper ../../../core/Accessor ../../../core/accessorSupport/decorators ../../../views/ViewAnimation ../lib/glMatrix ./Constraints ./controllers/AnimationController ./controllers/CameraController ../support/earthUtils ../support/Evented ../support/PropertiesPool ../webgl-engine/lib/Camera".split(" "), function(r,h,f,a,e,c,g,d,b,k,l,p,n,t,u){Object.defineProperty(h,"__esModule",{value:!0});r=function(e){function h(a){a=e.call(this,a)||this;a.propertiesPool=new t.default({camera:u},a);a.events=new n.Evented;a.updateQueue=new x;a.processingUpdates=!1;return a}f(h,e);h.prototype.destroy=function(){this.propertiesPool&&(this.propertiesPool.destroy(),this.propertiesPool=null)};h.prototype.normalizeCtorArgs=function(a){return{camera:this.createInitialCamera(a.viewingMode),mode:a.viewingMode,spatialReference:a.spatialReference, constraints:new b.default({mode:a.viewingMode})}};Object.defineProperty(h.prototype,"animation",{get:function(){return this.cameraController instanceof k.AnimationController?this.cameraController.viewAnimation:null},enumerable:!0,configurable:!0});Object.defineProperty(h.prototype,"camera",{get:function(){return this._get("camera")},set:function(a){a!==q&&q.copyFrom(a);q.markViewDirty();q.computeUp(this.mode);v.camera=q;this.events.emit("before-camera-change",v);(a=this._get("camera"))&&a.equivalent(q)|| this._set("camera",this.propertiesPool.get("camera").copyFrom(q))},enumerable:!0,configurable:!0});Object.defineProperty(h.prototype,"isGlobal",{get:function(){return!this.isLocal},enumerable:!0,configurable:!0});Object.defineProperty(h.prototype,"isLocal",{get:function(){return"local"===this.mode},enumerable:!0,configurable:!0});Object.defineProperty(h.prototype,"interacting",{get:function(){return!!this.cameraController&&this.cameraController.isInteractive},enumerable:!0,configurable:!0});Object.defineProperty(h.prototype, "cameraController",{get:function(){return this._get("cameraController")},set:function(a){var b=this;this.stopActiveCameraController()?(a&&(a.watch("state",function(c){if(c===l.State.Finished||c===l.State.Stopped)b._set("cameraController",null),b.updateCamera(function(b){a.onControllerEnd(b)})},!0),a.onControllerStart(this.camera)),this._set("cameraController",a)):a&&(a.state=l.State.Rejected)},enumerable:!0,configurable:!0});h.prototype.switchCameraController=function(a){this.cameraController=a;return a.state!== l.State.Rejected};h.prototype.stopActiveCameraController=function(){return this.cameraController&&!this.cameraController.stopController()?!1:!0};h.prototype.cameraChanged=function(){this.updateCamera(function(){})};h.prototype.updateCamera=function(a){this.updateQueue.enqueue(a);this.processingUpdates||this.processUpdateQueue()};h.prototype.processUpdateQueue=function(){if(0!==this.updateQueue.length&&!this.processingUpdates){this.processingUpdates=!0;var a=this.updateQueue.dequeue();q.copyFrom(this._get("camera")); a(q);this.camera=q;this.processingUpdates=!1;this.processUpdateQueue()}};h.prototype.createInitialCamera=function(a){return"global"===a?new u(d.vec3d.createFrom(4*p.earthRadius,0,0),d.vec3d.createFrom(p.earthRadius,0,0),d.vec3d.createFrom(0,0,1)):new u(d.vec3d.createFrom(0,0,100),d.vec3d.createFrom(0,0,0),d.vec3d.createFrom(0,1,0))};a([c.property({readOnly:!0,type:g,dependsOn:["cameraController"]})],h.prototype,"animation",null);a([c.property({type:u})],h.prototype,"camera",null);a([c.property({constructOnly:!0})], h.prototype,"constraints",void 0);a([c.property({readOnly:!0})],h.prototype,"events",void 0);a([c.property({readOnly:!0,dependsOn:["isLocal"]})],h.prototype,"isGlobal",null);a([c.property({readOnly:!0,dependsOn:["mode"]})],h.prototype,"isLocal",null);a([c.property({constructOnly:!0})],h.prototype,"mode",void 0);a([c.property({constructOnly:!0})],h.prototype,"spatialReference",void 0);a([c.property({readOnly:!0,dependsOn:["cameraController"]})],h.prototype,"interacting",null);a([c.property()],h.prototype, "cameraController",null);return h=a([c.subclass()],h)}(c.declared(e));h.ViewState=r;var q=new u,v={camera:null},x=function(){function a(){this.data=[];this.length=this.ptr=0}a.prototype.enqueue=function(a){this.data.push(a);this.length++};a.prototype.dequeue=function(){if(0===this.length)return null;var a=this.data[this.ptr++];this.length--;0===this.length&&(this.ptr=this.data.length=0);return a};return a}();h.default=r})},"esri/views/3d/support/Evented":function(){define(["require","exports"],function(r, h){Object.defineProperty(h,"__esModule",{value:!0});r=function(){function f(){this._listeners={}}f.prototype.hasEventListener=function(a){return null!=this._listeners[a]&&0c?1:0})};l.prototype.setInitialView=function(a){if(a&&!this.cameraSetByUser){var b={applyConstraints:!0};a instanceof c?b.applyConstraints=!1:a instanceof g?a.targetGeometry instanceof u?a=I.fromExtent(this.view, a.targetGeometry,0,.5,{noReset:!0}):(a.camera&&(b.applyConstraints=!1),a=G.toCamera(this.view,a)):a=I.fromExtent(this.view,a,0,.5,{noReset:!0});this.setStateCamera(I.externalToInternal(this.view,a),b)}};l.prototype.updatePropertyBeforeReady=function(a,b){if(this.ready)return!1;this._override(a,b);var c=this.internalSetOrder.indexOf(a);-1!==c&&(this.internalSetOrder=this.internalSetOrder.splice(c,1));b&&(this.internalSetOrder.push(a),-1!==O.indexOf(a)&&this._override("hasInitialView",!0));return!0}; l.prototype.isCompatible=function(a){return a?a instanceof g?a.camera?this.isCompatible(a.camera):this.isCompatible(a.targetGeometry):a instanceof c?this.isCompatible(a.position):a.spatialReference&&x.canProject(a.spatialReference,this.view.spatialReference):!1};l.prototype.getPreservingHeadingTilt=function(a){void 0===a&&(a=S);this.cameraSetByUser?(a.heading=this.camera.heading,a.tilt=this.camera.tilt):(a.heading=0,a.tilt=.5);return a};l.prototype.centerPointAtDistanceToCamera=function(a,b,c){void 0=== c&&(c=Y);var d=this.getPreservingHeadingTilt();return(a=I.eyeHeadingTiltForCenterPointAtDistance(this.view,d.heading,d.tilt,a,b))?(c.copyFrom(this.view.state.camera),c.eye=a.eye,c.center=a.center,c.up=a.up,c):null};l.prototype.centerToCamera=function(a){var b=this.view.pointsOfInterest.centerOnContent;b.forceUpdate();return this.centerPointAtDistanceToCamera(a,b.distance)};l.prototype.extentToCamera=function(a){var b=this.getPreservingHeadingTilt();if(a=I.fromExtent(this.view,a,b.heading,b.tilt,R))return I.externalToInternal(this.view, a)};l.prototype.scaleToCamera=function(a){var b=this.view.pointsOfInterest.centerOnContent;b.forceUpdate();var c=b.renderLocation;a=I.scaleToDistance(this.view,a,b.location.latitude);return this.centerPointAtDistanceToCamera(c,a)};l.prototype.zoomToCamera=function(a){return this.scaleToCamera(I.zoomToScale(this.view,a))};l.prototype.viewpointToCamera=function(a){return(a=G.toCamera(this.view,a))?I.externalToInternal(this.view,a):null};l.prototype.setStateCamera=function(a,b){var c=this;if(!a||!this.view.state.stopActiveCameraController())return!1; this.cameraSetByUser=!0;this.cancelImmediateGoTo();this.view.state.updateCamera(function(d){d.copyFrom(a);b.applyConstraints&&m.applyAll(c.view,d)});b.applyConstraints||(this.view.state.cameraController=new E.SurfaceCollisionCorrectionController({view:this.view,desiredCamera:a}));return!0};l.prototype.handleResize=function(a,b){var c=this.view.canvas;!c||c.width===a&&c.height===b||(c.width=a,c.height=b);this.view.state&&(c=this.view.state.camera,c.fullWidth!==a||c.fullHeight!==b)&&(Y.copyFrom(c), Y.fullWidth=a,Y.fullHeight=b,this.view.state.camera=Y)};l.prototype.beforeCameraChangeHandle=function(a){this.updateCameraAboveGround(a)};l.prototype.cameraChangedSync=function(a){a&&this.view._stage&&this.view._stage.setCamera(a)};l.prototype.updateCameraAboveGround=function(a){var b=this.view.basemapTerrain,c=this.view.renderCoordsHelper.getAltitude(a.eye),b=b&&b.spatialReference?B.surfaceElevationBelowEye(this.view,a):0;a.aboveGround=c>=b};l.prototype.createGoToCamera=function(a){var d=this;return n.whenOnce(this, "ready",null,!0).then(function(){return G.create(d.view,a)}).then(function(e){var f=!!(a instanceof g&&a.camera||a instanceof c),k=e.camera;if(!d.isCompatible(k))throw e=(e=k.position)&&e.spatialReference,new b("goto:incompatible-spatialreference","Resulting camera has an incompatible spatial reference (camera: "+(e?e.wkid:"none")+", view: "+d.view.spatialReference.wkid+")",{camera:k});k=I.externalToInternal(d.view,k);if(!k)throw new b("goto:invalid-camera","Resulting camera is invalid");return{viewpoint:e, camera:k,isFullySpecified:f}})};l.prototype.cancellableGoTo=function(a){var b=this,c;return p.create(function(b,d){c={resolve:b,reject:d};a.asyncResult=c},function(){b.view.state.cameraController===a&&a.active&&a.asyncResult===c&&a.stopController()})};l.prototype.goToImmediate=function(a,c){var d=this;this.cancelAnimatedGoTo();this.cancelImmediateGoTo();var e=this.createGoToCamera(a).then(function(a){d.immediateGoToPromise===e&&(d.immediateGoToPromise=null);d.setStateCamera(a.camera,{applyConstraints:!a.isFullySpecified})}).catch(function(a){d.immediateGoToPromise=== e&&(d.immediateGoToPromise=null);a instanceof b&&a.message&&J.error("#goTo()","Failed to create camera from target, "+a.message[0].toLowerCase()+a.message.slice(1));throw a;});return this.immediateGoToPromise=e};l.prototype.goToAnimatedBeforeReady=function(a,c){var d=this;this.cancelAnimatedGoTo();var e=n.whenOnce(this.view,"ready").then(function(){if(e===d.animatedGoToPromise)return d.animatedGoToPromise=null,d.goToAnimated(a,c);throw new b("view:goto-cancelled","Cancelled");});return this.animatedGoToPromise= e};l.prototype.goToAnimated=function(a,c){var d=this;this.cancelAnimatedGoTo();if(!this.ready)return this.goToAnimatedBeforeReady(a,c);var e=this.view.state.cameraController,f;e instanceof D.PointToPointAnimationController&&(e.updateStateFromViewAnimation(),e.active&&(f=e));null==f&&(f=new D.PointToPointAnimationController(this.view.state,this.pickingHelper));var g=f.viewAnimation;a=this.createGoToCamera(a);var k=a.then(function(a){return a.viewpoint});g.update(k);if(f!==e&&!this.view.state.switchCameraController(f))return g.stop(), J.error("#goTo()","Cannot start an animation while interacting"),p.reject(new b("view:goto-cannot-interrupt","Cannot start an animation while interacting"));var l=g.target,h=function(){return d.view.state.cameraController===f&&f.viewAnimation.target===l&&f.active};a.then(function(a){var b=a.viewpoint,e=a.camera;a=a.isFullySpecified;if(h()){f.viewAnimation.update(b);l=f.viewAnimation.target;var k;a?(k=new E.SurfaceCollisionCorrectionController({view:d.view,desiredCamera:e}),m.applySurfaceCollision(d.view, e,1)):m.applyAll(d.view,e);f.begin(e,d.internalAnimateOptions(c));return g.when().then(function(){var a=d.view.state.cameraController;k&&(a&&a.active?a instanceof D.PointToPointAnimationController&&a.viewAnimation.target===l&&(d.view.state.cameraController=k):f.viewAnimation.target===l&&(d.view.state.cameraController=k))})}}).catch(function(a){a instanceof b&&a.message&&J.error("#goTo()","Failed to create camera from target, "+a.message[0].toLowerCase()+a.message.slice(1));if(h())throw d.view.state.cameraController.stopController(), a;});return this.cancellableGoTo(f)};l.prototype.internalAnimateOptions=function(a){var b={};a&&(null!=a.speedFactor&&(b.speedFactor=a.speedFactor),null!=a.duration&&(b.duration=a.duration/1E3),null!=a.maxDuration&&(b.maxDuration=a.maxDuration/1E3),null!=a.easing&&(b.easing="string"===typeof a.easing?H.named[a.easing]:a.easing));return b};a([t.property({type:c,dependsOn:["view.state.camera","ready"]})],l.prototype,"camera",null);a([t.property({type:q,dependsOn:["view.pointsOfInterest.centerOnContent.location", "ready"]})],l.prototype,"center",null);a([t.property({type:u,dependsOn:["view.state.camera","ready"]})],l.prototype,"extent",null);a([t.property({readOnly:!0,dependsOn:["view.state.camera","ready"]})],l.prototype,"frustum",null);a([t.property({readOnly:!0,dependsOn:["view.map.initialViewProperties.viewpoint"]})],l.prototype,"hasInitialView",null);a([t.property({readOnly:!0,type:Boolean})],l.prototype,"ready",void 0);a([t.property({dependsOn:["view.pointsOfInterest.centerOnContent.distance","ready"], type:Number})],l.prototype,"scale",null);a([t.property({dependsOn:["view.state.camera","ready"]})],l.prototype,"padding",null);a([t.property({readOnly:!0,dependsOn:["view.width","view.height","padding"]})],l.prototype,"screenCenter",null);a([t.property({constructOnly:!0})],l.prototype,"view",void 0);a([t.property({type:g,dependsOn:["camera","ready"]})],l.prototype,"viewpoint",null);a([t.property({type:Number,dependsOn:["scale"]})],l.prototype,"zoom",null);return l=a([t.subclass("esri.views.3d.state.ViewStateManager")], l)}(t.declared(d));h.ViewStateManager=r;var O="camera viewpoint extent scale center zoom".split(" "),N=[{propertyName:"camera",overrides:["viewpoint"]},{propertyName:"viewpoint",overrides:["extent"]},{propertyName:"extent",overrides:["center","scale"]},{propertyName:"scale",overrides:["zoom"]},{propertyName:"center",overrides:[]},{propertyName:"zoom",overrides:[]},{propertyName:"padding",overrides:[]}],S={heading:0,tilt:0},R=new c,Y=new M,X=z.vec4d.create(),Q="pending-initial-view";h.default=r})}, "esri/views/3d/state/ConstraintsManager":function(){define("require exports ../../../core/tsSupport/declareExtendsHelper ../../../core/tsSupport/decorateHelper ../../../core/Accessor ../../../core/Handles ../../../core/watchUtils ../../../core/accessorSupport/decorators ../camera/constraintUtils ../camera/intersectionUtils ./NearFarHeuristic ./SurfaceCollisionConstraint ../support/mathUtils".split(" "),function(r,h,f,a,e,c,g,d,b,k,l,p,n){Object.defineProperty(h,"__esModule",{value:!0});r=function(e){function h(a){var b= e.call(this)||this;b.handles=new c;b.nearFarHeuristic=l.createNearFarHeuristic(a.view.state.mode,a.view.basemapTerrain,a.view.renderCoordsHelper.spatialReference);return b}f(h,e);h.prototype.initialize=function(){var a=this;this.handles.add([this.view.watch(["constraints.clipDistance.near","constraints.clipDistance.far"],function(){return a.handleClipDistanceNearFarChanged()}),this.view.watch("constraints.clipDistance.mode",function(){return a.handleClipDistanceModeChanged()}),this.view.state.events.on("before-camera-change", function(b){return a.cameraUpdateNearFar(b.camera)}),this.view.watch("dataExtent",function(){return a.updateNearFar()},!0)],"clipDistance");this.handles.add([this.view.watch(["constraints.altitude.min","constraints.altitude.max"],function(){return a.handleAltitudeMinMaxChanged()},!0)],"altitude");this.handles.add([this.view.watch("constraints.tilt.max",function(){return a.handleTiltMaxChanged()},!0),this.view.watch("constraints.tilt.mode",function(){return a.handleTiltModeChanged()},!0),this.view.watch("state.camera", function(){return a.tiltAutoUpdateMax()},!0)],"tilt");this.handles.add([this.view.watch("constraints.collision.enabled",function(){return a.handleCollisionEnabledChanged()},!0)],"collision");this.view.state.isLocal&&this.handles.add(g.init(this.view,"dataExtent",function(b){return a.updateLocalSurfaceDistance(b)}));this.updateNearFar();"local"!==this.view.state.mode&&this.updateAltitude();this.updateTilt();this.updateCollision();this._set("surfaceCollisionConstraint",new p.default({view:this.view}))}; h.prototype.destroy=function(){this.handles&&(this.handles.destroy(),this.handles=null);this.surfaceCollisionConstraint&&(this.surfaceCollisionConstraint.destroy(),this._set("surfaceCollisionConstraint",null))};h.prototype.handleClipDistanceNearFarChanged=function(){var a=this,b=this.view.constraints&&this.view.constraints.clipDistance;b&&"auto"!==b.mode&&this.view.state.updateCamera(function(c){a.cameraUpdateNearFarManual(c,b);return!0})};h.prototype.handleClipDistanceModeChanged=function(){this.updateNearFar()}; h.prototype.updateNearFar=function(){var a=this;this.view.state.updateCamera(function(b){a.cameraUpdateNearFar(b);return!0})};h.prototype.cameraUpdateNearFar=function(a){var b=this.view.constraints&&this.view.constraints.clipDistance;"manual"===(b?b.mode:"auto")?this.cameraUpdateNearFarManual(a,b):this.cameraUpdateNearFarAuto(a,b)};h.prototype.cameraUpdateNearFarAuto=function(a,b){var c=this.nearFarHeuristic.compute(a.eye,a.center,this.view.dataExtent,k.surfaceElevationBelowEye(this.view,a),t),d= c.distance,e=c.maxFarNearRatio,c=c.minNearDistance;d/e>c?(a.far=d,a.near=a.far/e):(a.near=c,a.far=a.near*e);b&&b.autoUpdate(a.near,a.far)};h.prototype.cameraUpdateNearFarManual=function(a,b){b&&(a.near=b.near,a.far=b.far)};h.prototype.handleCollisionEnabledChanged=function(){this.updateCollision()};h.prototype.updateCollision=function(){var a=this.view.constraints&&this.view.constraints.collision,b=this.view.state.constraints.collision,a=a?a.enabled:!1;a!==b.enabled&&(b.enabled=a)&&this.reapplyConstraints(8)}; h.prototype.handleAltitudeMinMaxChanged=function(){this.updateAltitude()};h.prototype.updateAltitude=function(){var a=this.view.constraints&&this.view.constraints.altitude;this.view.state.constraints.altitude=a&&"local"!==this.view.state.mode?{min:a.min,max:a.max}:null;this.reapplyConstraints()};h.prototype.handleTiltModeChanged=function(){this.updateTilt()};h.prototype.handleTiltMaxChanged=function(){var a=this.view.constraints&&this.view.constraints.tilt;a&&"auto"!==a.mode&&(this.updateTiltManual(a), this.reapplyConstraints())};h.prototype.updateTilt=function(){var a=this.view.constraints&&this.view.constraints.tilt;"manual"===(a?a.mode:"auto")?this.updateTiltManual(a):this.updateTiltAuto(a);this.reapplyConstraints()};h.prototype.updateTiltManual=function(a){var b=this.view.state.constraints;b.tilt=b.createConstantMaxTilt(n.deg2rad(a.max))};h.prototype.updateTiltAuto=function(a){a=this.view.state.constraints;a.tilt=a.createDefaultTilt();this.tiltAutoUpdateMax()};h.prototype.tiltAutoUpdateMax= function(){var a=this.view.constraints&&this.view.constraints.tilt;if(a&&"auto"===a.mode){var b=this.view.state.constraints;b.tilt&&(b=b.tilt(this.view.state.camera.distance).max,a.autoUpdate(n.rad2deg(b)))}};h.prototype.updateLocalSurfaceDistance=function(a){var b=Math.max(a.width,a.height);0>=b||(a.hasZ&&(b=Math.max(b,a.zmax-a.zmin)),a=this.view.state,b=3*b/Math.atan(a.camera.fov/2),b!==a.constraints.distance&&(a.constraints.distance=b))};h.prototype.reapplyConstraints=function(a){var c=this;void 0=== a&&(a=15);this.view.state.updateCamera(function(d){return b.applyAll(c.view,d,{selection:a,interactionType:0,interactionFactor:null,interactionStartCamera:null,interactionDirection:null})})};a([d.property({constructOnly:!0})],h.prototype,"view",void 0);a([d.property({readOnly:!0})],h.prototype,"surfaceCollisionConstraint",void 0);return h=a([d.subclass("esri.views.3d.state.ConstraintsManager")],h)}(d.declared(e));h.ConstraintsManager=r;var t={distance:0,maxFarNearRatio:0,minNearDistance:0};h.default= r})},"esri/views/3d/state/NearFarHeuristic":function(){define("require exports ../../../geometry/support/scaleUtils ../lib/glMatrix ../support/earthUtils ../support/mathUtils".split(" "),function(r,h,f,a,e,c){Object.defineProperty(h,"__esModule",{value:!0});h.createNearFarHeuristic=function(a,b,c){return"global"===a?new d:new g(b,c)};var g=function(){function d(a,b){this.elevationProvider=a;this.unitInMeters=f.getMetersPerUnitForSR(b)}d.prototype.compute=function(d,f,g,l,h){h||(h={maxFarNearRatio:0, distance:0,minNearDistance:0});var m=e.earthRadius;h.maxFarNearRatio=b;h.minNearDistance=k/this.unitInMeters;var p=d[2]*this.unitInMeters,v=p;l=p-l;var x=this.elevationProvider?this.elevationProvider.getElevationBounds():null;x&&(p=0<=l?v-this.unitInMeters*x[0]:this.unitInMeters*x[1]-v);v=Math.max(g.xmax-g.xmin,g.ymax-g.ymin,4*Math.max(g.xmax-g.xmin,g.ymax-g.ymin));a.vec3d.subtract(f,d,q);u[0]=0g?(h.maxFarNearRatio=c.clamp(2E4-(Math.log(Math.sqrt(d)-f)-7.983)/9.011*19E3,1E3,2E4),h.distance=Math.sqrt(d-g)/1):h.distance=h.maxFarNearRatio*h.minNearDistance;h.distance*=1.2;return h};d.prototype.isNemoMode=function(a,b){var c=e.earthRadius+l;return aa;a++)this.planes[a]=f.vec4d.create();for(a=0;8>a;a++)this.points[a]=f.vec3d.create();for(a=0;12>a;a++)this.lines[a]={origin:null,direction:f.vec3d.create(),endpoint:null}} c.prototype.updateLine=function(a,c,b){a.origin=c;a.endpoint=b;f.vec3d.direction(b,c,a.direction)};c.prototype.update=function(c){e.matrix2frustumPlanes(c.viewMatrix,c.projectionMatrix,this.points,this.planes);for(var d=0;4>d;d++){var b=d,g=d+4;this.updateLine(this.lines[d],this.points[b],this.points[g]);this.updateLine(this.lines[d+4],this.points[b],3===d?this.points[0]:this.points[b+1]);this.updateLine(this.lines[d+8],this.points[g],3===d?this.points[4]:this.points[g+1])}f.vec3d.set(c.eye,this.origin); f.vec3d.set(c.viewForward,this.direction);this._altitude=f.vec3d.length(this.origin)-a.earthRadius};Object.defineProperty(c.prototype,"altitude",{get:function(){return this._altitude},enumerable:!0,configurable:!0});return c}();h.Frustum=r;h.default=r})},"esri/views/3d/state/controllers/SurfaceCollisionCorrectionController":function(){define("require exports ../../../../core/tsSupport/extendsHelper ../../../../core/Handles ../../camera/constraintUtils ../../camera/intersectionUtils ./CameraController".split(" "), function(r,h,f,a,e,c,g){Object.defineProperty(h,"__esModule",{value:!0});r=function(d){function b(b){var c=d.call(this)||this;c.handles=new a;c.view=b.view;c.desiredCamera=b.desiredCamera.copy();return c}f(b,d);Object.defineProperty(b.prototype,"canStop",{get:function(){return!0},enumerable:!0,configurable:!0});Object.defineProperty(b.prototype,"constraintEnabled",{get:function(){return this.view.state.constraints.collision.enabled},enumerable:!0,configurable:!0});b.prototype.onControllerStart=function(a){var b= this;d.prototype.onControllerStart.call(this,a);this.handles.add(this.view.basemapTerrain.on("elevation-change",function(a){return b.handleElevationChangeEvent(a)}));this.applyCorrection()};b.prototype.onControllerEnd=function(a){this.handles.removeAll();d.prototype.onControllerEnd.call(this,a)};b.prototype.handleElevationChangeEvent=function(a){c.eyeWithinExtent(this.view,this.desiredCamera,a.extent,a.spatialReference)&&this.applyCorrection()};b.prototype.applyCorrection=function(){var a=this;this.view.state.updateCamera(function(b){b.copyViewFrom(a.desiredCamera); e.applySurfaceCollision(a.view,b,1)||a.constraintEnabled||(a.state=g.State.Stopped)})};return b}(g.CameraController);h.SurfaceCollisionCorrectionController=r})},"esri/views/3d/support/cameraUtils":function(){define("require exports dojo/_base/lang ../../../Camera ../../../config ../../../geometry/Point ../../../geometry/SpatialReference ../../../geometry/support/webMercatorUtils ../camera/intersectionUtils ../lib/glMatrix ./cameraUtilsPlanar ./cameraUtilsSpherical ./earthUtils ./mathUtils ./projectionUtils ../webgl-engine/lib/Camera".split(" "), function(r,h,f,a,e,c,g,d,b,k,l,p,n,t,u,q){function v(a){return"global"===a.viewingMode?p:l}function x(b,d,e){var f=b.renderSpatialReference,l=k.vec3d.set(d.viewForward,F),l=C(b,d.eye,l,d.up,I);b=b.spatialReference||g.WGS84;u.vectorToVector(d.eye,f,D,b)||(b=g.WGS84,u.vectorToVector(d.eye,f,D,b));return e?(e.position.x=D[0],e.position.y=D[1],e.position.z=D[2],e.position.spatialReference=b,e.heading=l.heading,e.tilt=l.tilt,e.fov=t.rad2deg(d.fov),e):new a(new c(D,b),l.heading,l.tilt,t.rad2deg(d.fov))} function m(a,b,c){var d=a.state.camera,f=d.fovX,d=d.width/2;"global"===a.viewingMode&&null!=c&&(b*=Math.cos(t.deg2rad(c)));b/=a.renderCoordsHelper.unitInMeters;return d/(39.37*e.screenDPI/b)/Math.tan(f/2)}function B(a,b,c){var d=a.state.camera;b=39.37*e.screenDPI/(d.width/2/(b*Math.tan(d.fovX/2)));"global"===a.viewingMode&&(b/=Math.cos(t.deg2rad(c)));return b*=a.renderCoordsHelper.unitInMeters}function z(b,c,d,e,f,k){var l=b.renderSpatialReference;c=A(b,e.heading,e.tilt,c,d,f);b=u.vectorToPoint(c.eye, l,b.spatialReference||g.WGS84);if(!b)return null;if(!k)return new a(b,c.heading,c.tilt,e.fov);k.position=b;k.heading=c.heading;k.tilt=c.tilt;k.fov=e.fov;return k}function C(a,b,c,d,e){return v(a).directionToHeadingTilt(b,c,d,e)}function A(a,b,d,e,l,h){var m=k.vec3d.create(),n=a.renderSpatialReference;if(e)if(e instanceof c){var p=e;u.pointToVector(p,m,a.renderSpatialReference);null==p.z&&null!=a.basemapTerrain&&(p=a.basemapTerrain.getElevation(p),null!=p&&a.renderCoordsHelper.setAltitude(p,m))}else e&& k.vec3d.set(e,m);else k.vec3d.set(a.state.camera.center,m);e&&e instanceof c||(e=u.vectorToPoint(m,n,a.spatialReference||g.WGS84));l=Math.max(l,a.state.constraints.minimumPoiDistance);n=d;d=l;if(!(p=h&&h.noReset))var p=e,t=a.engineToScreen(a.state.camera.center),q=a.toScreen(p),p=t.x-q.x,t=t.y-q.y,q=a.pointsOfInterest.centerOnSurfaceFrequent.distance,q=Math.log(Math.max(d,q)/Math.min(d,q))/Math.LN2,p=!(Math.sqrt(p*p+t*t)>5*Math.max(a.width,a.height)||8P.z-1:!1,!b)?m:(m=a.state.constraints.tilt(l).min,A(a,0,m,e,l,f.mixin({},h,{noReset:!0})))}Object.defineProperty(h, "__esModule",{value:!0});var D=k.vec3d.create(),E=k.vec3d.create(),F=k.vec3d.create(),I={heading:0,tilt:0},P=new c,G=new t.Cyclical(-2.0037508342788905E7,2.0037508342788905E7);h.externalToInternal=function(a,c){var d=a.renderSpatialReference,e=v(a).headingTiltToDirectionUp,f=k.vec3d.create();return u.pointToVector(c.position,f,d)?(d=e(f,c.heading,c.tilt),k.vec3d.add(d.direction,f),a=b.cameraOnContentAlongViewDirection(a,f,d.direction,d.up),a.fov=t.deg2rad(c.fov),a):null};h.internalToExternal=x;h.scaleToDistance= m;h.distanceToScale=B;h.fromCenterScale=function(a,b,c,d,e,f){c=m(a,c,b.latitude);return z(a,b,c,d,e,f)};h.fromCenterDistance=z;h.directionToHeadingTilt=C;h.eyeHeadingTiltForCenterPointAtDistance=A;h.fromExtent=function(b,e,f,k,l,h){var m;l instanceof a?(h=l,m={noReset:!1}):m=l;var p="global"===b.viewingMode;l=b.renderSpatialReference;var t=b.spatialReference||g.WGS84,q=g.WebMercator,v=e.spatialReference||q,x,r=0;null!=e.zmax&&null!=e.zmin&&(x=(e.zmax+e.zmin)/2,r=e.zmax-e.zmin);if(p){var p=new c(e.xmin, e.ymin,v),z=new c(e.xmax,e.ymax,v),p=d.project(p,q),z=d.project(z,q);if(null===p||null===z)return;e=new c(G.center(p.x,z.x),(z.y+p.y)/2,q);null!=x&&(e.z=x);x=n.getGreatCircleSpanAt(e,p,z);q=x.lon;v=x.lat;G.diff(p.x,z.x)>G.range/2&&(q+=n.halfEarthCircumference);q=Math.min(q,n.halfEarthCircumference);v=Math.min(v,n.halfEarthCircumference)}else d.canProject(e,t)&&(e=d.project(e,t)),q=e.xmax-e.xmin,v=e.ymax-e.ymin,e=new c({x:e.xmin+.5*q,y:e.ymin+.5*v,z:x,spatialReference:t});x=b.state.camera;f=A(b,f, k,e,Math.max(1/Math.tan(x.fovX/2)*q*.5,1/Math.tan(x.fovY/2)*v*.5,1/Math.tan(x.fov/2)*r*.5)/1,m);k=u.vectorToPoint(f.eye,l,t);if(!k)return null;h||(h=new a);h.position=k;h.heading=f.heading;h.tilt=f.tilt;h.fov=b.camera.fov;return h};h.toExtent=function(a,b,c,d,e){var f;f=a.renderSpatialReference;b||(c||(c=a.state.camera),b=x(a,c,e));if(c)e=u.vectorToPoint(c.center,f,a.spatialReference||g.WGS84),f=c.distance;else{e=a.toMap(a.screenCenter);if(!e)return null;f=n.computeCarthesianDistance(b.position,e)}c|| (c=a.state.camera);b=2*f*Math.tan(c.fovX/2)*1;c=2*f*Math.tan(c.fovY/2)*1;return"global"===a.viewingMode?p.toExtent(a,e,b,c,d):l.toExtent(a,e,b,c,d)};h.scaleToZoom=function(a,b){return(a=a.basemapTerrain&&a.basemapTerrain.tilingScheme)?a.levelAtScale(b):void 0};h.zoomToScale=function(a,b){return(a=a.basemapTerrain&&a.basemapTerrain.tilingScheme)?a.scaleAtLevel(b):void 0};h.computeScale=function(a,b,c){var d=a.renderSpatialReference;b||(b=a.state.camera);var e;e=g.WGS84;b instanceof q?(u.vectorToVector(b.center, d,E,e),e=E[1],b=b.distance):(e=b.position.latitude,u.pointToVector(b.position,D,d),u.pointToVector(c,E,d),b=k.vec3d.dist(D,E));return B(a,b,e)}})},"esri/views/3d/support/cameraUtilsPlanar":function(){define("require exports ../../../geometry/Extent ../lib/glMatrix ./cameraUtilsInternal ./mathUtils ./projectionUtils".split(" "),function(r,h,f,a,e,c,g){function d(d,e,f){d=a.vec3d.create();var g=a.vec3d.create();a.mat4d.identity(l);a.mat4d.rotateZ(l,-c.deg2rad(e));a.mat4d.rotateX(l,c.deg2rad(f));a.mat4d.multiplyVec3(l, k,d);a.vec3d.scale(d,-1);a.mat4d.multiplyVec3(l,b,g);return{direction:d,up:g}}Object.defineProperty(h,"__esModule",{value:!0});var b=a.vec3d.createFrom(0,1,0),k=a.vec3d.createFrom(0,0,1),l=a.mat4d.create(),p=a.vec3d.create(),n=a.vec3d.create();h.headingTiltToDirectionUp=d;h.directionToHeadingTilt=function(a,c,d,f){return e.directionToHeadingTilt(c,d,f,k,b)};h.eyeForCenterWithHeadingTilt=function(b,c,e,f){var g=d(b,e,f);b=a.vec3d.add(a.vec3d.scale(g.direction,-c,a.vec3d.create()),b);return{up:g.up, eye:b,heading:e,tilt:f}};h.lookAtTiltToEyeTilt=function(a,b,d){return c.rad2deg(d)};h.eyeTiltToLookAtTilt=function(a,b,d){return c.deg2rad(d)};h.toExtent=function(a,b,c,d,e){var k=a.renderSpatialReference;a=a.map&&a.spatialReference||b.spatialReference;g.pointToVector(b,p,k);g.pointToVector(b,n,k);p[0]-=c/2;n[0]+=c/2;p[1]-=d/2;n[1]+=d/2;g.vectorToVector(p,k,p,a);g.vectorToVector(n,k,n,a);e?(e.xmin=p[0],e.ymin=p[1],e.xmax=n[0],e.ymax=n[1],e.spatialReference=a):e=new f(p[0],p[1],n[0],n[1],a);return e}})}, "esri/views/3d/support/cameraUtilsInternal":function(){define(["require","exports","../lib/glMatrix","./mathUtils"],function(r,h,f,a){Object.defineProperty(h,"__esModule",{value:!0});var e=f.vec3d.create(),c=f.vec3d.create();h.directionToHeadingTilt=function(g,d,b,k,l){var h=e;f.vec3d.normalize(g,h);var n=f.vec3d.dot(h,k),t=0n?(f.vec3d.set(d,h),t&&f.vec3d.scale(h,-1)):h=null);d=0;h&&(f.vec3d.scale(k,f.vec3d.dot(k,h),c),f.vec3d.subtract(h,c), d=f.vec3d.dot(h,l)/(f.vec3d.length(h)*f.vec3d.length(l)),f.vec3d.cross(h,l,c),d=(0Math.abs(h))h=d+t;else var q=t/m,u=b.asin(d/q),h=q*Math.sin(Math.PI-h-u);var q=m*d,n=n*d,u=e*q,x=h-n,r=x*x,z=d*d*m*m,m=e*e*z,z=f*f*z,B=k[1]*x,C=m*(m+r-k[1]*k[1]);if(0>C)return c.vec3d.scale(k,h/t,g.eye),g.tilt=0,g;var R=Math.sqrt(C),C=m+r,B=0Math.abs(C))return 1E-8>t?(g.eye[0]=0,g.eye[1]=0,g.eye[2]=d):c.vec3d.scale(k, h/t,g.eye),g.tilt=0,l(g.eye),p(g,a);g.eye[1]=B/C;C=g.eye[1]*g.eye[1];d=1-C;B=Math.sqrt(d);u=m*C+z-2*u*g.eye[1]*B*x+d*r;if(1E-8>Math.abs(u))return c.vec3d.scale(k,h/t,g.eye),g.tilt=0,l(g.eye),p(g,a);g.eye[0]=(d*(h*k[0]-n*k[0])-q*B*(k[0]*g.eye[1]*e+k[2]*f))/u;g.eye[2]=(d*(h*k[2]-n*k[2])-q*B*(k[2]*g.eye[1]*e-k[0]*f))/u;c.vec3d.scale(g.eye,h);l(g.eye);return p(g,a)};h.lookAtTiltToEyeTilt=function(a,d,e){a=c.vec3d.length(a);d=b.asin(d/(Math.sqrt(d*d+a*a-2*d*a*Math.cos(Math.PI-e))/Math.sin(e)));return b.rad2deg(e- d)};h.eyeTiltToLookAtTilt=function(a,d,e){e=b.deg2rad(e);a=c.vec3d.length(a);return b.asin(d/(a/Math.sin(e)))+e};h.toExtent=function(c,g,k,l,h){function m(a){var c=Math.PI/2;a=b.cyclical2PI.normalize(a,-c);a>c&&(a=Math.PI-a);return a}var n;n=g.latitude;g=g.longitude;var p=d.getLonDeltaForDistance(g,n,k)/2;k=g-p;g+=p;n=b.deg2rad(n);p=d.earthRadius;n=(1+Math.sin(n))/(1-Math.sin(n));var t=(n+1)*Math.tan(l/p/2);n=1.5*Math.PI-2*Math.atan(.5*(t+Math.sqrt(4*n+t*t)));l=n+l/p;n=m(n);l=m(l);lg.vec3d.dot(g.vec3d.direction(q,a,v),b))return!1;g.vec3d.set(q,e);return!0};return c}(r),t=function(a){function b(b){b=a.call(this,b,c.getMetersPerUnitForSR(b))||this;b.worldX=[1,0,0];b.worldY=[0,1,0];b.worldZ=[0,0,1];return b}f(b,a);b.prototype.getAltitude=function(a,b){return b?a[b+2]:a[2]};b.prototype.setAltitude=function(a,b){b[2]=a};b.prototype.setAltitudeOfTransformation= function(a,b){b[14]=a};b.prototype.worldUpAtPosition=function(a,b){return g.vec3d.set(this.worldZ,b)};b.prototype.worldBasisAtPosition=function(a,b,c){switch(b){case p.X:return g.vec3d.set(this.worldX,c);case p.Y:return g.vec3d.set(this.worldY,c);case p.Z:return g.vec3d.set(this.worldZ,c)}};b.prototype.intersectManifold=function(a,b,c,d){void 0===d&&(d=g.vec3d.create());g.vec4d.set4(this.worldZ[0],this.worldZ[1],this.worldZ[2],-c,u);if(!l.rayPlane(a,b,u,q)||0>g.vec3d.dot(g.vec3d.direction(q,a,v), b))return!1;g.vec3d.set(q,d);return!0};return b}(r),u=g.vec4d.create(),q=g.vec3d.create(),v=g.vec3d.create(),x=[0,0,0]})},"esri/views/3d/support/ResourceController":function(){define("../../../core/declare ../../../core/Handles ../../../core/Logger ../../../core/scheduling ./MemoryController ./StreamDataSupplier ./StreamDataLoader ./PreallocArray ../webgl-engine/lib/Performance ../webgl-engine/lib/Util".split(" "),function(r,h,f,a,e,c,g,d,b,k){function l(a){this.budget=this.begin=0;this.performance= a;this.enabled=!0}var p=k.assert,n={TERRAIN:"terrain",SCENE:"scene",SYMBOLOGY:"symbols"},t=new d(20),u=f.getLogger("esri.views.support.ResourceController");l.prototype.now=function(){return this.performance.now()};l.prototype.reset=function(a){this.begin=this.now();this.budget=this.enabled?a:Number.MAX_VALUE};l.prototype.done=function(){return this.enabled&&this.elapsed()>=this.budget};l.prototype.remaining=function(){return Math.max(this.budget-this.elapsed(),0)};l.prototype.elapsed=function(){return this.now()- this.begin};r=r(null,{constructor:function(c,d,f){f=f||b;this._clients=[];this._frameWorkers=[];this._nextFrameWorker=0;this._budget=new l(f);this._idleFrameWorkers=[];this._idleFrameWorkerRobin=0;this._idleUpdatesStartFired=!1;this._lastTargetChangeTime=f.now();this._memoryController=new e(c);this.navigationTimeout=300;this.animatingFrameTimeBudget=10;this.idleFrameWorkerBudget=30;this.idleFrameTimeBudget=50;f={};for(var k in n)f[n[k]]=0;f[n.TERRAIN]=15;f[n.SCENE]=20;f[n.SYMBOLOGY]=5;this.streamDataLoader= new g(f);this._cameraListeners=new h;this._cameraListeners.add([c.watch("state.camera",this._cameraChangedHandler.bind(this),!0)]);d||(d=a);this._frameTask=d.addFrameTask({update:this._frameUpdate.bind(this)});this._view=c;this.stats={frameUpdateTime:new q,idleUpdateTime:new q};this.frameUpdateNavigation=null},destroy:function(){this._frameTask.remove();this._frameTask=null;this._cameraListeners.remove();this.streamDataLoader.destroy();this.streamDataLoader=null},setEnableBudget:function(a){this._budget.enabled= !!a},isUpdating:function(){return this._memoryController.updating},registerClient:function(a,b,d){this._clients.push({client:a,type:b});this._memoryController.setDirty();return new c(b,this.streamDataLoader,d)},deregisterClient:function(a){for(var b=0;bthis._budget.remaining()){this._nextFrameWorker=(b+1)%this._frameWorkers.length;break}this.stats.frameUpdateTime.addSample(this._budget.elapsed()); this._isIdle()&&(this._idleUpdatesStartFired||(this._callWorkersNoScheduling("idleBegin"),this._idleUpdatesStartFired=!0),this._budget.reset(this.idleFrameTimeBudget-this._budget.elapsed()),3this.navigationTimeout},_callWorkersNoScheduling:function(a){for(var b=this._idleFrameWorkers, c=0;c=this._memoryCommitted)){this._unloadSuspended();var a=this._layersUpdating();if(a){if(this._quality<=this._minQuality)return;if(this._memoryCommitted> 1.1*this._memoryHWM||this._memoryUsed>this._memoryHWM)0this._memoryHWM||this._memoryUsed>this._memoryHWM)this._stableQuality=0,a=this._updateQuality(this._quality/this._divideRate);this._memoryCommitted1.1*c._memoryHWM||c._memoryUsed>c._memoryHWM||c._memoryUsed>=c._memoryLWM&&.9>c._quality};if(b())for(var e=this._view.allLayerViews.toArray().filter(function(a){return a.suspended}), f=function(){var b=null,c=0;e.forEach(function(d){if(a.isMemoryManagedLayerView(d)){var e=d.getUsedMemory();e>c&&(c=e,b=d)}});if(!b)return{value:void 0};b.removeCachedData();e.splice(e.indexOf(b),1);g._updateMemory()},g=this;b()&&0this._maxMemory&&d!==this._warnMemoryUsage&&(this._warnMemoryUsage=d,f=function(a){return a.toLocaleString(void 0,{maximumFractionDigits:1})+" Mb"},c.warn("GPU Memory Limit exceeded! Limit: "+f(this._maxMemory)+" Current: "+f(d)+" Projected: "+f(d+b))); this._memoryUsed=d/this._maxMemory;this._memoryCommitted=(d+b-e)/this._maxMemory;this._memoryCached=e/this._maxMemory};return f}()})},"esri/views/3d/layers/support/MemoryManagedLayerView":function(){define(["require","exports"],function(r,h){Object.defineProperty(h,"__esModule",{value:!0});h.isMemoryManagedLayerView=function(f){return"function"===typeof f.getUsedMemory}})},"esri/views/3d/support/StreamDataSupplier":function(){define(["require","exports"],function(r,h){return function(){function f(a, e,c){this._clientType=a;this._loader=e;this._activeRequests=null;c&&c.trackRequests&&(this._activeRequests=new Map)}f.prototype.request=function(a,e){var c=this;e=this._loader.request(a,e,this._clientType);if(this._activeRequests){this._activeRequests.set(a,e);var f=function(){c._activeRequests.delete(a)};e.then(f,f)}return e};f.prototype.cancelRequest=function(a){this._loader.cancel(a)};f.prototype.cancelAll=function(){var a=this;this._activeRequests&&(this._activeRequests.forEach(function(e){a._loader.cancel(e)}), this._activeRequests.clear())};f.prototype.hasPendingDownloads=function(){return this._loader.hasPendingDownloads()};return f}()})},"esri/views/3d/support/StreamDataLoader":function(){define("require exports ../../../request ./AsyncQuotaRoundRobinQueue ./PromiseLightweight ../webgl-engine/lib/Performance ../webgl-engine/lib/Util".split(" "),function(r,h,f,a,e,c,g){function d(a,d){if(a.status===b.CANCELLED)return!1;a.status=b.DOWNLOADING;var e,g;switch(a.docType){case "binary":g="array-buffer";e=0; break;case "image":g="image";break;default:g="json"}a.startTime=c.now();a.downloadObj=f(a.url,{responseType:g,timeout:e,allowImageDataAccess:"image"===a.docType});a.downloadObj.then(function(b){a.duration=c.now()-a.startTime;a.size="binary"===a.docType?b.data.byteLength:0;a.result=b.data;d(a)},function(b){a.downloadObj.isCanceled()||d(a,b)});return!0}var b;(function(a){a[a.QUEUED=1]="QUEUED";a[a.DOWNLOADING=2]="DOWNLOADING";a[a.CANCELLED=4]="CANCELLED"})(b||(b={}));return function(){function c(b){this.tasks= new Map;this.loadQueue=new a(d,this._doneLoadingCallback,this,b)}c.prototype.destroy=function(){var a=this;this.tasks.forEach(function(b,c){c.isRejected()||c.reject(b.url,null);a._cancelTask(c)});this.loadQueue.clear();this.tasks=this.loadQueue=null};c.prototype.request=function(a,c,d){var f=this,g=new e.Promise(function(){f.cancel(g)});a={url:a,docType:c,clientType:d,result:null,status:b.QUEUED,clientPromise:g,downloadObj:null,_cancelledInQueue:!1,startTime:0,duration:0,size:0};this.tasks.set(g, a);this.loadQueue.push(a);return g};c.prototype.cancel=function(a){this._cancelTask(a)};c.prototype.hasPendingDownloads=function(){return 0b.referenceCount&&console.warn("TextureCollection: reference count is \x3c 1 for "+a),b.referenceCount--,1>b.referenceCount&&(b.texture?(this._stage.remove(e.ModelContentType.TEXTURE,b.texture.id),b.texture=null):this._streamDataSupplier.cancelRequest(b.loaderDfd),delete this._textureRecords[a])):console.warn("TextureCollection: texture doesn't exist: "+a)},isInUse:function(a){a=this._textureRecords[a];d(!a||0k.earthRadius/4&&d.vec3d.add(d.vec3d.scale(c.viewForward,a-Math.sqrt(e),b),c.eye)}else if(c=this.surface.ready&&this.surface.extent)b[0]=l.clamp(b[0],c[0],c[2]),b[1]=l.clamp(b[1],c[1],c[3]); return!0};n.prototype.latestSurfaceAltitudeChangesDistanceSignificantly=function(a,c){if(this.latestSurfaceAltitude===this.currentSurfaceAltitude||null==a)return!1;if(this.calculateSurfaceIntersection(this.latestSurfaceAltitude,c)){var e=this.state.camera.eye;a=d.vec3d.dist(e,a);c=d.vec3d.dist(e,c);if(b.TESTS_DISABLE_UPDATE_THROTTLE_THRESHOLDS||Math.abs(c-a)/a>m.RELATIVE_ALTITUDE_CHANGE_THRESHOLD)return!0}return!1};n.RELATIVE_ALTITUDE_CHANGE_THRESHOLD=.05;a([c.property({constructOnly:!0})],n.prototype, "altitudeEstimationInterval",void 0);a([c.property({readOnly:!0})],n.prototype,"distance",void 0);a([c.property({constructOnly:!0})],n.prototype,"estimateSurfaceAltitudeAtCenter",void 0);a([c.property({readOnly:!0,dependsOn:["renderLocation"]})],n.prototype,"location",null);a([c.property({readOnly:!0})],n.prototype,"renderLocation",void 0);return n=m=a([c.subclass("esri.views.3d.support.CenterOnSurface")],n);var m}(c.declared(n.PointOfInterest));h.CenterOnSurface=r;var u=d.vec3d.create(),q=d.vec3d.create(); h.default=r})},"esri/views/3d/support/pointsOfInterest/PointOfInterest":function(){define("require exports ../../../../core/tsSupport/declareExtendsHelper ../../../../core/tsSupport/decorateHelper ../../../../core/Accessor ../../../../core/Handles ../../../../core/accessorSupport/decorators ./disposeMembers".split(" "),function(r,h,f,a,e,c,g,d){Object.defineProperty(h,"__esModule",{value:!0});r=function(b){function e(a){a=b.call(this)||this;a.handles=new c;return a}f(e,b);e.prototype.destroy=function(){d.default(this, "handles")};a([g.property({constructOnly:!0})],e.prototype,"renderCoordsHelper",void 0);a([g.property({constructOnly:!0})],e.prototype,"surface",void 0);a([g.property({constructOnly:!0})],e.prototype,"state",void 0);return e=a([g.subclass("esri.views.3d.support.PointOfInterest")],e)}(g.declared(e));h.PointOfInterest=r;h.default=r})},"esri/views/3d/support/pointsOfInterest/disposeMembers":function(){define(["require","exports","../../../../core/Accessor"],function(r,h,f){function a(a){for(var c=[], e=1;ea.distance&&(a=c)}return a};e.prototype.centerIntersectsExtent=function(a,b){var d=this.state.camera.eye,e=p,f=this.furthestCenterOnSurface();this.renderCoordsHelper.fromRenderCoords(d,k,b);this.renderCoordsHelper.fromRenderCoords(f.renderLocation, l,b);k[0]c;c++)a._curFrustumPlanes[c]=K.create();return a}f(e,b);e.prototype.normalizeCtorArgs=function(a,b){this._view=a;this._stage=a._stage;this._set("manifold",b);return{}};e.prototype.initialize=function(){var a=this;this.tilePool="planar"===this.manifold?A.Pool:D.Pool;this._renderer=new P(this.manifold, null,this._view.pointsOfInterest);this._renderer.loaded=this._setLoaded.bind(this);this._renderer.updateTileBackground(this.tileBackground);this._renderer.install(this._view._stage);this._set("overlayManager",new C({terrainSurface:this,view:this._view}));this._handles.add(this.watch("overlayManager.hasHighlights",this._handleHasHighlights.bind(this)),"overlayManager");var b={layers:this._view.map.allLayers,layerViews:this._view.allLayerViews,spatialReference:this._view.spatialReference};this.extentHelper= "spherical"===this.manifold?new E.SurfaceExtentHelperGlobal(b):new E.SurfaceExtentHelperLocal(b);this._handles.add(l.init(this.extentHelper,"stencilEnabledExtents",function(b){a._renderer.setStencilEnabledLayerExtents(b)}),"extentHelper");b=this._view.defaultsFromMap?new g({root:this._view.map,rootCollectionNames:this._view.defaultsFromMap.mapCollectionPaths,getChildrenFunction:function(a){return a.layers}}):this._view.map.allLayers;b=new F({layers:b,extentHelper:this.extentHelper,manifold:this.manifold, viewSpatialReference:this._view.spatialReference});this._set("tilingSchemeLogic",b);this._handles.add([this.tilingSchemeLogic.watch("tilingScheme",this._updateTilingSchemeAndExtent.bind(this),!0),this.tilingSchemeLogic.watch("extent",this._updateTilingSchemeAndExtent.bind(this),!0)],"tilingSchemeLogic");this._updateTilingSchemeAndExtent();this._streamDataSupplier=this._view.resourceController.registerClient(this,z.ClientType.TERRAIN);b={needsUpdate:this._needsIdleUpdate,idleFrame:this._idleUpdate}; this._frameLambda=this._frameUpdate.bind(this);this._view.resourceController.registerFrameWorker(this._frameLambda);this._view.resourceController.registerIdleFrameWorker(this,b);this._viewChangeUpdate=this._viewChangeUpdate.bind(this);this._view.resourceController.getMemoryEvents().on("quality-changed",function(){return a._viewChangeUpdate()});this._handles.add([this._view.on("resize",this._viewChangeUpdate),this._view.watch("state.camera",this._viewChangeUpdate,!0),this._view.watch("qualitySettings.tiledSurface.lodBias", this._viewChangeUpdate),this._view.watch("clippingArea",this._clippingChanged.bind(this))],"view");this._handles.add(this._view.allLayerViews.on("change",this._handleLayerViewChanges.bind(this)),"allLayerViews");this._handleLayerViewChanges({added:this._view.allLayerViews.toArray(),removed:[],moved:[],target:this._view.allLayerViews});this._updateClippingExtent();this.notifyChange("extent")};e.prototype.destroy=function(){this._handles.destroy();this._removeAllTiles();this.tilingSchemeLogic.destroy(); this._set("tilingSchemeLogic",null);this.extentHelper.destroy();this.extentHelper=null;for(var a in this._basemapLayerViewHandles)this._unregisterTiledLayerView(a);this._view.resourceController.deregisterFrameWorker(this._frameLambda);this._view.resourceController.deregisterIdleFrameWorker(this);this._view.resourceController.deregisterClient(this);this.overlayManager&&(this.overlayManager.destroy(),this._set("overlayManager",null));this._renderer.destroy(this._stage);this._streamDataSupplier=this._stage= this._view=this._renderer=null};Object.defineProperty(e.prototype,"cullBackFaces",{set:function(a){this._renderer.setCullBackFaces(a);this._set("cullBackFaces",a)},enumerable:!0,configurable:!0});Object.defineProperty(e.prototype,"extent",{get:function(){return this._clippingExtent||this._rootExtent},enumerable:!0,configurable:!0});Object.defineProperty(e.prototype,"frontMostTransparent",{set:function(a){this._renderer.setFrontMostTransparent(a);this._set("frontMostTransparent",a)},enumerable:!0, configurable:!0});Object.defineProperty(e.prototype,"opacity",{set:function(a){this._renderer.setOpacity(a);this._set("opacity",a)},enumerable:!0,configurable:!0});Object.defineProperty(e.prototype,"ready",{get:function(){return!!this.rootTiles},enumerable:!0,configurable:!0});Object.defineProperty(e.prototype,"renderOrder",{set:function(a){this._renderer.setRenderOrder(a);this._set("renderOrder",a)},enumerable:!0,configurable:!0});Object.defineProperty(e.prototype,"skirts",{set:function(a){this._renderer.setDrawSkirts(a); this._set("skirts",a)},enumerable:!0,configurable:!0});Object.defineProperty(e.prototype,"tileBackground",{set:function(a){a!==this.tileBackground&&this._renderer.updateTileBackground(a);this._set("tileBackground",a)},enumerable:!0,configurable:!0});Object.defineProperty(e.prototype,"velvetOverground",{set:function(a){a!==this.velvetOverground&&this._renderer.setVelvetOverground(a);this._set("velvetOverground",a)},enumerable:!0,configurable:!0});Object.defineProperty(e.prototype,"wireframe",{set:function(a){this._renderer.setWireframe(a); this._set("wireframe",a);this._view._stage.setRenderParams({earlyOcclusionPixelDraw:a})},enumerable:!0,configurable:!0});e.prototype.setVisibility=function(a){a!==this.visible&&(this.visible=a,this._renderer.setVisibility(a),this.setUpdatesDisabled(!a),a&&this._viewChangeUpdate())};e.prototype.isVisible=function(){return this.visible&&this.ready};e.prototype.isSeeThrough=function(){return this._renderer.isTransparent()};e.prototype.setUpdatesDisabled=function(a){(this.suspended=a)||this._viewChangeUpdate()}; e.prototype.intersect=function(a,b,c){this._renderer.intersect(a,b,c)};e.prototype.getElevation=function(a){if(!this.ready)return null;var b=this.rootTiles;if(0===b[0].layerInfo[I.LayerClass.ELEVATION].length)return null;if(a instanceof n){if(!m.pointToVector(a,ea,this.tilingScheme.spatialReference))return U.error("TerrainSurface.getElevation(): could not project given point to tiling scheme coordinate system"),null;a=ea}for(var c,d=0;d.5*(e.extent[0]+e.extent[2])&&(b+=1),a[1]<.5*(e.extent[1]+e.extent[3])&&(b+=2),e=e.children[b];c=(b=e.renderData)&&b.geometryState?b.geometryState.samplerData:null;break}}return c?M.elevationSampler(a[0],a[1],c):null};e.prototype.getElevationBounds=function(){return this._elevationBounds};e.prototype.getScale=function(a){if(this.tilingScheme){if(!m.pointToVector(a,ea,this.spatialReference))return U.error("TerrainSurface.getElevation(): could not project given point to tiling scheme coordinate system"), null;if(this.rootTiles)for(var b=0;ba.children[0].extent[2]&&(b+=1),ea[1]da){U.warn(I.TOO_MANY_ROOT_TILES_AFTER_CHANGE_ERROR);return}var b=this.rootTiles.map(function(a){return a.lij}),g=c.difference(b,f,R);if(0da&&(U.warn(I.TOO_MANY_ROOT_TILES_FOR_LAYER_ERROR),f=d.rootTilesInExtent(b,e,da)),this._set("rootTiles",f.map(function(b){b=a._acquireTile(0,b[1],b[2],null);a._loadTile(b);return b})),this._renderer.setRootTiles(this.rootTiles);c.equals(e,this._rootExtent)||(this._rootExtent=K.create(e),this._hasFixedExtent()||this.notifyChange("extent"));this.setVisibility(!0);this._viewChangeUpdate();this.overlayManager.setOverlayDirty(); this.notifyChange("ready")}};e.prototype._viewChangeUpdate=function(){this._stage&&!this.suspended&&this.tilingScheme&&this.visible&&(this._updateViewDependentParameters(),this._updateOverlayOpacity(this._curEyePos),this._updateTiles(this.rootTiles))};e.prototype._updateClippingStatus=function(a){a.updateClippingStatus(this._clippingExtent)&&a.pendingUpdates&Z.UPDATE_GEOMETRY&&(this._renderer.updateTileGeometryNeedsUpdate(a),this._updateTileGeometry(a),a.pendingUpdates&=~Z.UPDATE_GEOMETRY)};e.prototype._updateTiles= function(a){var b=this._iteratorPool.acquire();b.reset(a);var c=this._curSplitLimits,d=this._curFrustumPlanes,e=this._curEyePos,f;J.hasVisibleSiblings(a)?(a=this._elevationBounds[0],f=this._elevationBounds[1]):(a=Infinity,f=-Infinity);for(;!b.done;){var g=b.next();this._updateClippingStatus(g);var k=!0;if(g.updateVisibility(d,e)){g.updateScreenDepth(this._viewProjectionMatrix);g.renderData&&(a=Math.min(g.elevationBounds[0],a),f=Math.max(g.elevationBounds[1],f));var h=g.shouldSplit(c,e);h===Z.SPLIT? (g.pendingUpdates&=~Z.MERGE,g.renderData?(k=!1,g.pendingUpdates|=Z.SPLIT,b.skip()):k=!1):(g.pendingUpdates&=~Z.SPLIT,h===Z.VSPLITMERGE&&g.updateAgents(I.LayerClass.ELEVATION),b.skip())}else b.skip();if(k&&!g.renderData){g.pendingUpdates|=Z.MERGE;g.pendingUpdates&=~Z.SPLIT;k=this._iteratorPool.acquire();for(k.reset(g);!k.done;)h=k.next(),this._updateClippingStatus(h),h.updateVisibility(d,e),h.visible&&h.updateScreenDepth(this._viewProjectionMatrix);this._iteratorPool.release(k)}0!==g.pendingUpdates&& (this._pendingUpdates=!0)}this._iteratorPool.release(b);isFinite(a)&&isFinite(f)&&(this._elevationBounds[0]!==a||this._elevationBounds[1]!==f)&&(this._elevationBounds[0]=a,this._elevationBounds[1]=f,this.emit("elevation-bounds-change",null))};e.prototype._updateViewDependentParameters=function(){var a=this._view.state.camera,b=Math.tan(.5*a.fovX),c=Math.tan(.5*a.fovY),d=this.tilingScheme.pixelSize,e=Math.pow(2,-this._getLodBias());this._curSplitLimits[0]=b;this._curSplitLimits[1]=d[0]/a.width*this.maxTextureScale* e;this._curSplitLimits[2]=c;this._curSplitLimits[3]=d[1]/a.height*this.maxTextureScale*e;this._curSplitLimits[4]=this.tilingScheme.getMaxLod();this._curSplitLimits[5]=this._view.qualitySettings.tiledSurface.angledSplitBias;a.copyFrustumPlanes(this._curFrustumPlanes);L.multiply(a.projectionMatrix,a.viewMatrix,this._viewProjectionMatrix);Q.set(a.eye,this._curEyePos);G.autoUpdateSkirtsVisibility(this,this._curEyePos)};e.prototype._setLayerViewsUpdating=function(){for(var a=0;ad;d++)c.children[d]=null;c!==a&&this._purgeTile(c)}};e.prototype._purgeTile=function(a){a.unload(this._renderer);this._cancelTilemapRequests(a);a.parent=null;this._releaseTile(a)};e.prototype._splitTile=function(a){var b=a.lij[0]+1,c=2*a.lij[1],d=2*a.lij[2];a.children[0]=this._createTile(b,c,d,a);a.children[1]=this._createTile(b,c,d+1,a);a.children[2]=this._createTile(b,c+1,d,a); a.children[3]=this._createTile(b,c+1,d+1,a);a.unload(this._renderer);fa.spatialReference=this.spatialReference;fa.extent=a.extent;fa.scale=this._getLodBiasCorrectedScale(b);this.emit("scale-change",fa)};e.prototype._createTile=function(a,b,c,d){V(!!d,"_createTile sanity check");a=this._acquireTile(a,b,c,d);a.updateClippingStatus(this._clippingExtent);a.updateVisibility(this._curFrustumPlanes,this._curEyePos);a.visible&&(a.updateScreenDepth(this._viewProjectionMatrix),a.shouldSplit(this._curSplitLimits, this._curEyePos)===Z.SPLIT&&(a.pendingUpdates|=Z.SPLIT,this._pendingUpdates=!0));this._loadTile(a);return a};e.prototype._mergeTile=function(a){V(!a.renderData,"_mergeTile sanity check");this._loadTile(a);this._purgeChildTiles(a);fa.spatialReference=this.spatialReference;fa.extent=a.extent;fa.scale=this._getLodBiasCorrectedScale(a.lij[0]);this.emit("scale-change",fa)};e.prototype._loadTile=function(a){a.load(this._renderer);this.overlayManager&&this.overlayManager.hasOverlays()&&this.overlayManager.setOverlayParamsOfTile(a, a.renderData,this._curOverlayOpacity);aa.spatialReference=this.spatialReference;aa.tile=a;aa.extent=a.extent;this.emit("elevation-change",aa)};e.prototype._handleHasHighlights=function(a){this._renderer.setNeedsHighlight(a)};e.prototype._decodeElevation=function(a){var b=I.LayerClass.ELEVATION,c=a.layerInfo[b];if(c)for(var d=0;de)&&(e=b.maxDataLevel),c[d.MAP].push(b))):U.warn("Terrain: tiling scheme of layer "+g.id+" is incompatible with other tiled layers, will not be drawn"):U.warn("Terrain: Map or elevation layer does not have fullExtent: "+g.id)}},this);for(var b=function(a){var b=g._layerViews[a],e=c[a];e.reverse();var f=b.length!==e.length,k= e.length,h=Array(k),l=Array(b.length);g._layerIndexByLayerViewId[a]={};for(var m=0;mI.TILEMAP_SIZE_EXP?J.getTileNLevelsUp(a,I.TILEMAP_SIZE_EXP):this._topLevelTilemapOnlyTiles[b]};e.prototype._dispatchDataEvent=function(a,b,c,d,e){d=this._layerIndexByLayerViewId[c][d.uid];if(null!=d)a[b](d,c,e);else U.warn("TerrainSurface: received data from unknown layer")}; e.prototype._updateTileOverlayParams=function(){if(this.rootTiles){var a=this._iteratorPool.acquire();for(a.reset(this.rootTiles);!a.done;){var b=a.next();b.renderData&&this.overlayManager&&this.overlayManager.setOverlayParamsOfTile(b,b.renderData,this._curOverlayOpacity)}this._iteratorPool.release(a);this._renderer.setNeedsRender()}};e.prototype._updateOverlayOpacity=function(a){if(this.overlayManager&&(a=this.overlayManager.updateOpacity(a),!isNaN(a))){if(a!==this._curOverlayOpacity&&this.rootTiles){var b= this._iteratorPool.acquire();for(b.reset(this.rootTiles);!b.done;){var c=b.next();c.renderData&&c.renderData.overlayTexId&&(c.renderData.overlayOpacity=a)}this._iteratorPool.release(b)}this._curOverlayOpacity=a;this._renderer.setNeedsRender()}};e.prototype.getStats=function(){var a=0,b=0,c=0,d=[],e=this._iteratorPool.acquire();for(e.reset(this.rootTiles);!e.done;){var f=e.next();a++;f.renderData&&(b++,f.visible&&(c++,f=f.lij[0],d[f]=null!=d[f]?d[f]+1:1))}this._iteratorPool.release(e);return{numNodes:a, numLeaves:b,numVisible:c,numVisiblePerLevel:d}};e.prototype.getUsedMemory=function(){if(!this._view||!this._view.basemapTerrain)return 0;var a=this._view.basemapTerrain.getMemoryUsage(),b=0,c;for(c in a)b+=a[c];return b/1024/1024};e.prototype.getMemoryUsage=function(){0===Object.keys(this._memoryUsage).length&&this._updateMemoryUsage();return this._memoryUsage};e.prototype._updateMemoryUsage=function(){if(this.tilingScheme){var a=0,b=0,c=0,d=0,e=0,f=0,g=this._iteratorPool.acquire();g.reset(this.rootTiles); for(var k=this.tilingScheme.pixelSize,k=k[0]*k[1]*4;!g.done;){for(var h=g.next(),l=X(h),m=0,n=h.layerInfo[I.LayerClass.MAP];m>=1}V(f.lij[0]===b[0]&&f.lij[1]===b[1]&&f.lij[2]===b[2],"not the right tile?");return f}return null};e.prototype.hasPendingUpdates=function(){if(this._streamDataSupplier.hasPendingDownloads()|| 0!==this._vectorTileLayerRequests)return!0;var a=this._iteratorPool.acquire();for(a.reset(this.rootTiles);!a.done;)if(0g;g++)if(Math.abs(e[g]-d[g])>f){d=!0;break a}d=!1}if(d){n.vec4d.set(a[b],c.extent);c.renderLocalOrigin={id:"OV_"+this._latestOriginId++,vec3:u.center(c.extent,n.vec3d.create())};for(var k in this._connectedLayers)d= this._connectedLayers[k].layerView,d.setDrapingExtent&&d.setDrapingExtent(b,a[b],this._overlaySR,2048,c.renderLocalOrigin)}}this._setOverlayUpdating(!1);this._drawOverlays();this.terrainSurface._updateTileOverlayParams();this._dirty=!1}}};g.prototype.overlaysNeedUpdate=function(){return this._dirty&&!!this._overlaySR};g.prototype.updateOpacity=function(a){var b=1;if(this._overlays){var c=this._scale;a=this.view.renderCoordsHelper.getAltitude(a);3.5*ag&&(f=g-(d[2]-d[0]))}n.vec2d.set2((f-e[0])/(e[2]-e[0]),(d[1]-e[1])/(e[3]-e[1]),b.overlayTexOffset);b.overlayTexId=a.valid?a.texture.id: this._initialEmptyTexture.id;b.highlightOverlayTexId=a.highlightValid?a.highlightTexture.id:this._initialEmptyTexture.id;b.overlayOpacity=void 0!==c?c:1}else b.overlayTexId=null,b.highlightOverlayTexId=null};g.prototype.overlayPixelSizeInMapUnits=function(a){var b;this._overlays&&(this._overlays[0]&&this._pointIsInExtent(a,this._overlays[0].extent)?b=this._overlays[0].extent:this._overlays[1]&&(b=this._overlays[1].extent));return b?(b[2]-b[0])/2048:0};g.prototype._overlayForTile=function(a){var b= a.extent;a=a.clippingArea?u.intersection(b,a.clippingArea,H):b;return this._rectInsideRect(a,this._overlays[0].extent)?this._overlays[0]:this._rectanglesOverlap(a,this._overlays[1].extent)?this._overlays[1]:null};g.prototype._createEmptyOverlay=function(){var a=new A(null,"overlay",{wrapClamp:!0,mipmap:!0});this._stage.add(z.ModelContentType.TEXTURE,a);var b=new A(null,"highlightOverlay",{wrapClamp:!0,mipmap:!0});this._stage.add(z.ModelContentType.TEXTURE,b);return{extent:n.vec4d.create(),texture:a, valid:!1,highlightTexture:b,highlightValid:!1,renderLocalOrigin:{id:"O",vec3:[0,0,0]}}};g.prototype._initOverlays=function(){this._overlays=[this._createEmptyOverlay(),this._createEmptyOverlay()]};g.prototype._disposeOverlays=function(){if(this._overlays){var a=this._stage;this._overlays.forEach(function(b){a.remove(z.ModelContentType.TEXTURE,b.texture.id);a.remove(z.ModelContentType.TEXTURE,b.highlightTexture.id)});this._overlays=null}};g.prototype._intersectGroundFromView=function(a,b,c,d){var e= n.vec3d.createFrom(b*this.view.width,c*this.view.height,1);n.vec3d.unproject(e,a.viewMatrix,a.projectionMatrix,a.fullViewport,e);b=n.vec3d.createFrom(b*this.view.width,c*this.view.height,0);n.vec3d.unproject(b,a.viewMatrix,a.projectionMatrix,a.fullViewport,b);this.groundSelector.init([],b,e,null,a,null,!1);this.view.basemapTerrain.intersect(this.groundSelector,b,e);return this.groundSelector.minResult.getIntersectionPoint(d)};g.prototype._findHorizonBasedPointOfInterest=function(a,b,c){var d=.5;if("global"=== this.view.viewingMode){d=n.vec3d.create(a.eye);n.vec3d.normalize(d);n.vec3d.negate(d);b=n.vec3d.length(b);b=Math.asin(b/n.vec3d.length(a.eye));var e=Math.acos(n.vec3d.dot(a.viewForward,d)),d=m.clamp((b-(e-.5*a.fovY))/a.fovY,0,1);b=m.clamp((-b-(e-.5*a.fovY))/a.fovY,0,1);d=1===d&&0===b?.5:b+.55*(d-b)}else d=n.mat4d.multiplyVec4(a.projectionMatrix,n.vec4d.createFrom(0,Math.tan(.5*Math.PI-Math.acos(-a.viewForward[2])),1,0))[1],d=m.clamp(.5+.5*d,0,1),d=1===d||0===d?.5:0=k&&(g=k,d[1]=0,this._overlaySR.isWebMercator&&(d[0]=0)));var h=1;f&&(h=1/Math.max(.2,Math.cos(Math.abs(m.deg2rad(d[1])))),180b[2]-b[0]?n.vec4d.set(b,f):e<=.25*Math.PI?(f[0]-=q,f[1]-=g,f[2]+=q,f[3]+=g):(B.vectorToVector(a.eye,this._renderSR,J,this._overlaySR),n.vec2d.subtract(d,J,H),a= -Math.atan2(H[1],H[0])+.125*Math.PI,0>a&&(a+=2*Math.PI),n.vec4d.scale(D[Math.floor(a/(.25*Math.PI))],2*g,H),H[0]*=h,H[2]*=h,n.vec4d.add(f,H,f));this._isSpherical&&(f[0]=this._longitudeCyclical.clamp(f[0]),f[2]=this._longitudeCyclical.clamp(f[2]),f[1]=Math.max(f[1],-k),f[3]=Math.min(f[3],k));!this._isSpherical&&b&&(a=u.intersection(r,b,N),b=u.intersection(f,b,S),u.contains(a,b)&&(f[2]=f[0],f[3]=f[1]));this.opacity=1;return O};g.prototype._drawOverlays=function(){for(var a=this._overlays[0].extent[2]- this._overlays[0].extent[0],b=this._renderer,c=0;cthis._longitudeCyclical.max:!1,f=this._longitudeCyclical?d[0]b[3]||a[3]b[1]&&a[3]=b[1]&&a.y<=b[3];var c=a.x;a=a.y;return c>b[0]&&cb[1]&&ab&&(d=b-a[2]);a[1]<-c?e=a[1]+c:a[3]>c&&(e=c-a[3]);u.offset(a,d,e)};g.EXTENTS_DIFFER_THRESHOLD=1E-5;a([k.property()],g.prototype,"view",void 0);a([k.property()],g.prototype,"terrainSurface",void 0);a([k.property({type:Boolean})],g.prototype,"hasHighlights",null);return g=a([k.subclass("esri.views.3d.terrain.OverlayManager")],g)}(k.declared(g)), P={width:0,height:0,pixelRatio:0,views:null},G=[{viewport:n.vec4d.create(),extent:n.vec4d.create()}],M=[G[0],{viewport:n.vec4d.create(),extent:n.vec4d.create()}],H=n.vec4d.create(),J=n.vec3d.create(),O=[n.vec4d.create(),n.vec4d.create()],N=u.create(),S=u.create();return I})},"esri/views/3d/terrain/PlanarTile":function(){define(["./TileBase","./TileGeometryFactory","../../../core/ObjectPool","../support/mathUtils","../lib/glMatrix"],function(r,h,f,a,e){var c=e.vec3d.createFrom(0,0,1);e=function(a, d,b,e){r.call(this);this.tileUp=c;void 0!==a&&this.init(a,d,b,e)};e.prototype=new r;e.prototype.constructor=e;e.prototype.init=function(c,d,b,e){r.prototype.init.call(this,c,d,b,e);this.edgeLen=this.extent[2]-this.extent[0];this.curvatureHeight=0;this.centerAtSeaLevel[0]=a.lerp(this.extent[0],this.extent[2],.5);this.centerAtSeaLevel[1]=a.lerp(this.extent[1],this.extent[3],.5);this.centerAtSeaLevel[2]=0;this.updateRadiusAndCenter()};e.prototype.updateRadiusAndCenter=function(){r.prototype.updateRadiusAndCenter.call(this); var a=(this.extent[2]-this.extent[0])*Math.SQRT1_2,c=.5*(this.elevationBounds[0]-this.elevationBounds[1]);this.radius=Math.sqrt(a*a+c*c)};e.prototype.isVisible=function(a){if(!this.intersectsClippingArea)return!1;var c=this.extent[0],b=this.extent[1],e=this.elevationBounds[0],f=this.extent[2],g=this.extent[3],h=this.elevationBounds[1];return 0a;a++)this.children[a]=null;this.pendingUpdates=0;this.renderData=null;this.renderOrder=this.screenDepth=0;this.visible=!1;this.parentSurface=c;for(a=0;a=h?(b=c+Math.ceil(-d.log2(g/f)),b!==this.vlevel?(this.vlevel=b,D.VSPLITMERGE):D.NONE):6this.radius*this.radius&&(l.scale(v, this.radius/l.length(v)),l.add(v,this.center),l.subtract(b,v,v),b=this.elevationBounds[1]-this.elevationBounds[0],Math.min(1,(Math.abs(l.dot(v,this.tileUp))+.5*b+this.curvatureHeight)/l.length(v))*e<.1/a*k))?D.NONE:D.SPLIT};b.prototype.decodeElevationData=function(b){var c;if(b instanceof ArrayBuffer)try{c=a.createFromLERC(this.lij,this.extent,b,f.noDataValueOpt)}catch(I){console.warn("Error decoding %s: %s",b.url,I.message)}else c=a.createFromFetchTileResult(this.lij,this.extent,b);return c};b.prototype.getWGS84Extent= function(){return this.extentWGS84Rad.map(d.rad2deg)};b.prototype.load=function(a){for(var b=0;bb;b++){var c=this.children[b];c&&(c.descendants(a),a.unshift(this.children[b]))}return a};b.prototype.isLij=function(a){return this.lij[0]===a[0]&&this.lij[1]===a[1]&&this.lij[2]==a[2]};b.prototype.findByLij=function(a){if(this.isLij(a))return this;for(var b=0;4>b;b++){var c=this.children[b];if(c&&(c=c.findByLij(a)))return c}return null};b.prototype.unrequestLayerData=function(a,b,c){f.TILE_LOADING_DEBUGLOG&& console.log("tile %s layer %d/%d canceled by tile %s",this.lij.toString(),b,a,c.tile.lij.toString());var d=this.layerInfo[b][a],e=d.waitingAgents;c=e.indexOf(c);u(-1e.length&&(e=d.requestPromise,c=!1,b===C&&(c=this.parentSurface.layerViewByIndex(a,C),c=r.isVectorTileLayerView(c)),c||u(e||d.rawData,"no pending operations on layerInfo that agents were waiting for"),e&&!e.isFulfilled()&&(e.cancel(),d.requestPromise= null),f.TILE_LOADING_DEBUGLOG&&console.log("tile %s layer %d/%d request/loading canceled",this.lij.toString(),b,a))};b.prototype.dataArrived=function(a,b,c){a=this.layerInfo[b][a];a.data=c;a.dataInvalidated=!1;for(c=0;c=f.ELEVATION_DESIRED_RESOLUTION_LEVEL)break;d=d.parent}if(k=k||g)k.computeMinMaxValue(this.lij[0],this.lij[1],this.lij[2],v),Infinity!==v[0]&&(v[2]= k.level,b=!0)}b&&(c.elevationBounds?l.set(v,c.elevationBounds):c.elevationBounds=[v[0],v[1],v[2]])}};b.prototype.updateGeometry=function(){this.pendingUpdates|=f.TileUpdateTypes.UPDATE_GEOMETRY;this.parentSurface._pendingUpdates=!0};b.prototype.modifyLayers=function(a,b,d){for(var k=b.length,h=this.layerInfo[d],l=Array(k),m=0;m>b)+1,2,e+1)):b=8>e?this._numSubdivisionsAtLevel[e]+1:2;e=this.clippingArea;if(!this.intersectsClippingArea||this.isWithinClippingArea)e=null;a?(a.numVertsPerRow!==b&&(a.numVertsPerRow=b,g=!0),c.changed&&(a.samplerData=c.samplerData,g=!0),k.equals(a.clippingArea,e)||(a.clippingArea=e,g=!0),a.needsUpdate=g):a={numVertsPerRow:b,samplerData:c.samplerData, needsUpdate:!0,clippingArea:e};return a};b.prototype._getElevationInfo=function(a){for(var b=this.layerInfo[A],c=b.length,d=Array(c),e=0,f=0,g=!1,k=0;k=a[0]&&a[2]>=b[2]&&b[1]>=a[1]&&a[3]>=b[3]};b.prototype.intersectsExtent=function(a){var b=this.extent;return b[2]>=a[0]&&a[2]>=b[0]&&b[3]>=a[1]&&a[3]>=b[1]};return b})},"esri/views/3d/terrain/terrainUtils":function(){define("require exports ../../../layers/BaseElevationLayer ../../../layers/BaseTileLayer ../../../layers/ElevationLayer ../../../layers/TiledLayer ../../../layers/TileLayer ../../../layers/VectorTileLayer ../../../layers/WMTSLayer ../../../support/basemapDefinitions ./terrainUtilsPlanar ./terrainUtilsSpherical".split(" "), function(r,h,f,a,e,c,g,d,b,k,l,p){function n(a){return a&&"esri.views.3d.layers.TileLayerView3D"===a.declaredClass}function t(a){return a&&"esri.views.3d.layers.VectorTileLayerView3D"===a.declaredClass}function u(a){return a&&"esri.views.3d.layers.WMTSLayerView3D"===a.declaredClass}function q(a){return a&&"esri.views.3d.layers.ElevationLayerView3D"===a.declaredClass}function v(){B={};for(var a in k)k[a].baseMapLayers.forEach(function(a){B[a.url]=19});B["//services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer"]= 20}function x(a,b,c,d){return m["local"===d||"planar"===d?"planar":"spherical"].checkIfTileInfoSupportedForViewSR(a,b,c)}Object.defineProperty(h,"__esModule",{value:!0});var m={planar:l,spherical:p};h.weakAssert=function(a,b){a||console.warn("Terrain: "+b)};h.autoUpdateSkirtsVisibility=function(a,b){m[a.manifold].autoUpdateSkirtsVisibility(a,b)};h.isTiledLayer=function(d){return d&&(d.isInstanceOf(c)||d.isInstanceOf(a)||d.isInstanceOf(f)||d.isInstanceOf(b))};h.isVectorTileLayer=function(a){return a&& a.isInstanceOf(d)};h.isTileLayerView=n;h.isVectorTileLayerView=t;h.isWMTSLayerView=u;h.isElevationLayerView=q;h.isTiledLayerView=function(a){return a&&(n(a)||q(a)||t(a)||u(a))};h.useFetchTileForLayer=function(a){return a.fetchTile&&!(a.fetchTile===g.prototype.fetchTile||a.fetchTile===e.prototype.fetchTile)};var B=null;h.getKnownTiledServiceLevelCap=function(a){B||v();a=a&&a.replace(/https?:/,"");return a in B?B[a]:Infinity};h.prepareKnownTiledServiceLevelCaps=v;h.checkIfTileInfoSupportedForView=x; h.getTiledLayerInfo=function(a,c,e){var f,g;if(a.isInstanceOf(b)){if(a=a.activeLayer){var k=a.tileMatrixSet;if(k)f=k.tileInfo,g=k.fullExtent;else if(a=a.tileMatrixSets)if(a=a.find(function(a){return null==x(a.tileInfo,a.fullExtent,c,e)}))return{tileInfo:a.tileInfo,fullExtent:a.fullExtent}}}else f=a.isInstanceOf(d)?a.compatibleTileInfo256:a.tileInfo,g=a.fullExtent;return f&&g&&null==x(f,g,c,e)?{tileInfo:f,fullExtent:g}:{tileInfo:null,fullExtent:null}}})},"esri/layers/BaseElevationLayer":function(){define("require exports ../core/tsSupport/declareExtendsHelper ../core/tsSupport/decorateHelper ../core/Error ../core/promiseUtils ../core/accessorSupport/decorators ../geometry/Extent ../geometry/SpatialReference ./Layer ./support/TileInfo".split(" "), function(r,h,f,a,e,c,g,d,b,k,l){var p={id:"0/0/0",level:0,row:0,col:0,extent:null};return function(k){function h(){var a=null!==k&&k.apply(this,arguments)||this;a.tileInfo=l.create({spatialReference:b.WebMercator,size:256});a.fullExtent=new d(-2.0037508342787E7,-2.003750834278E7,2.003750834278E7,2.0037508342787E7,b.WebMercator);a.spatialReference=b.WebMercator;a.type="base-elevation";return a}f(h,k);h.prototype.getTileBounds=function(a,b,c,d){d=d||[0,0,0,0];p.level=a;p.row=b;p.col=c;p.extent=d;this.tileInfo.updateTileInfo(p); p.extent=null;return d};h.prototype.fetchTile=function(a,b,c,d){throw new e("BaseElevationLayer:fetchtile-not-implemented","fetchTile() is not implemented");};h.prototype.importLayerViewModule=function(a){switch(a.type){case "2d":return c.reject(new e("base-elevation-layer:view-not-supported","BaseElevationLayer is only supported in 3D"));case "3d":return c.create(function(a){return r(["../views/3d/layers/ElevationLayerView3D"],a)})}};a([g.property({type:l})],h.prototype,"tileInfo",void 0);a([g.property()], h.prototype,"fullExtent",void 0);a([g.property()],h.prototype,"spatialReference",void 0);a([g.property({readOnly:!0,value:"base-elevation"})],h.prototype,"type",void 0);return h=a([g.subclass("esri.layers.BaseElevationLayer")],h)}(g.declared(k))})},"esri/layers/BaseTileLayer":function(){define("require exports ../core/tsSupport/declareExtendsHelper ../core/tsSupport/decorateHelper dojo/_base/lang ../request ../core/Error ../core/promiseUtils ../core/accessorSupport/decorators ../geometry/Extent ../geometry/SpatialReference ./Layer ./mixins/RefreshableLayer ./mixins/ScaleRangeLayer ./support/TileInfo".split(" "), function(r,h,f,a,e,c,g,d,b,k,l,p,n,t,u){var q={id:"0/0/0",level:0,row:0,col:0,extent:null};return function(h){function n(){var a=null!==h&&h.apply(this,arguments)||this;a.tileInfo=u.create({spatialReference:l.WebMercator,size:256});a.type="base-tile";a.fullExtent=new k(-2.0037508342787E7,-2.003750834278E7,2.003750834278E7,2.0037508342787E7,l.WebMercator);a.spatialReference=l.WebMercator;return a}f(n,h);n.prototype.getTileBounds=function(a,b,c,d){d=d||[0,0,0,0];q.level=a;q.row=b;q.col=c;q.extent=d; this.tileInfo.updateTileInfo(q);q.extent=null;return d};n.prototype.getTileUrl=function(a,b,c){throw new g("basetilelayer:gettileurl-not-implemented","getTileUrl() is not implemented");};n.prototype.fetchTile=function(a,b,d,f){a=this.getTileUrl(a,b,d);var g={responseType:"image"};f&&f.timestamp&&(g.query={_ts:f.timestamp});return"string"===typeof a?c(a,e.mixin({allowImageDataAccess:f&&f.allowImageDataAccess||!1},g)).then(function(a){return a.data}):a.then(function(a){return c(a,g)}).then(function(a){return a.data})}; n.prototype.importLayerViewModule=function(a){switch(a.type){case "2d":return d.create(function(a){return r(["../views/2d/layers/TiledLayerView2D"],a)});case "3d":return d.create(function(a){return r(["../views/3d/layers/TileLayerView3D"],a)})}};a([b.property({type:u})],n.prototype,"tileInfo",void 0);a([b.property({readOnly:!0,value:"base-tile"})],n.prototype,"type",void 0);a([b.property()],n.prototype,"fullExtent",void 0);a([b.property()],n.prototype,"spatialReference",void 0);return n=a([b.subclass("esri.layers.BaseTileLayer")], n)}(b.declared(p,n,t))})},"esri/layers/VectorTileLayer":function(){define("require exports ../core/tsSupport/declareExtendsHelper ../core/tsSupport/decorateHelper dojo/_base/lang ../request ../core/Error ../core/MultiOriginJSONSupport ../core/promiseUtils ../core/urlUtils ../core/urlUtils ../core/accessorSupport/decorators ../geometry/Extent ../geometry/SpatialReference ./TiledLayer ./mixins/ArcGISCachedService ./mixins/OperationalLayer ./mixins/PortalLayer ./mixins/ScaleRangeLayer ./support/TileInfo ./support/TilemapCache ./support/vectorTileLayerLoader ../portal/support/jsonContext ../views/vectorTiles/SchemaHelper ../views/vectorTiles/style/StyleRepository".split(" "), function(r,h,f,a,e,c,g,d,b,k,l,p,n,t,u,q,v,x,m,B,z,C,A,D,E){return function(d){function h(a,b){a=d.call(this)||this;a.capabilities=null;a.currentStyleInfo=null;a.fullExtent=null;a.style=null;a.operationalLayerType="VectorTileLayer";a.tileInfo=null;a.tilemapCache=null;a.type="vector-tile";a.url=null;return a}f(h,d);h.prototype.normalizeCtorArgs=function(a,b){return"string"===typeof a?e.mixin({},{url:a},b):a};h.prototype.load=function(){var a=this,b=this.loadFromPortal({supportedTypes:["Vector Tile Service"], supportsData:!1}).then(function(){if(a.portalItem&&a.portalItem.id){var b=a.portalItem.itemUrl+"/resources/styles/root.json";return c(b,{query:{f:"json"}}).then(function(c){c.data&&a.read({url:b},A.createForItem(a.portalItem))})}}).always(function(){return a.loadStyle()});this.addResolvingPromise(b);return this.when()};Object.defineProperty(h.prototype,"attributionDataUrl",{get:function(){var a=this.currentStyleInfo;return(a=a&&a.serviceUrl&&l.urlToObject(a.serviceUrl))?this._getDefaultAttribution(a.path): null},enumerable:!0,configurable:!0});h.prototype.readCapabilities=function(a,b){return{supportsExportTiles:!!(b&&b.hasOwnProperty("exportTilesAllowed")&&b.exportTilesAllowed),supportsTileMapIndexing:b.capabilities?-1!==b.capabilities.toLowerCase().indexOf("tilemap"):!1}};Object.defineProperty(h.prototype,"parsedUrl",{get:function(){return this.serviceUrl?k.urlToObject(this.serviceUrl):null},enumerable:!0,configurable:!0});Object.defineProperty(h.prototype,"serviceUrl",{get:function(){return this.currentStyleInfo&& this.currentStyleInfo.serviceUrl||null},enumerable:!0,configurable:!0});Object.defineProperty(h.prototype,"spatialReference",{get:function(){return this.tileInfo&&this.tileInfo.spatialReference||null},enumerable:!0,configurable:!0});Object.defineProperty(h.prototype,"styleUrl",{get:function(){return this.currentStyleInfo&&this.currentStyleInfo.styleUrl||null},enumerable:!0,configurable:!0});h.prototype.writeStyleUrl=function(a,b){a&&l.isProtocolRelative(a)&&(a="https:"+a);b.styleUrl=a};h.prototype.readTileIndexType= function(a,b){return b.type};h.prototype.readTileIndexUrl=function(a,b){return l.join(this.serviceUrl,b.tileMap)};h.prototype.readTilemapCache=function(a,b){return b.capabilities&&-1>=1,a>>=1):256===this.lockedSchemaPixelSize&&0>=1,a>>=1);return[e,c,a]};f.prototype.getSchemaShift=function(a,e){var c=0,f=0;if(256===this.lockedSchemaPixelSize||this.isWGS84)a[2]%2&&(c=2*e),a[1]%2&&(f=2*e);return[c, f]};f.prototype.adjustLevel=function(a){return this.isWGS84?a:256===this.lockedSchemaPixelSize?0b.key?1:0});for(var c,d,b=a.length,e=0;ethis._val;case 5:return a.values[this._key]<=this._val;case 6:return a.values[this._key]>=this._val;case 7:return-1!==this._val.indexOf(a.values[this._key]); case 8:return-1===this._val.indexOf(a.values[this._key]);case 9:for(var e=0,c=this._val;ethis._val;case 16:return a.type>=this._val;case 17:return a.type<= this._val;case 18:return-1!==this._val.indexOf(a.type);case 19:return-1===this._val.indexOf(a.type)}};f.createFilter=function(a){if(!a)return new f(0,void 0,!0);var e=a[0];if(1>=a.length)return new f(0,void 0,"any"!==e);switch(e){case "\x3d\x3d":return new f(1,a[1],a[2]);case "!\x3d":return new f(2,a[1],a[2]);case "\x3e":return new f(4,a[1],a[2]);case "\x3c":return new f(3,a[1],a[2]);case "\x3e\x3d":return new f(6,a[1],a[2]);case "\x3c\x3d":return new f(5,a[1],a[2]);case "in":return new f(7,a[1], a.slice(2));case "!in":return new f(8,a[1],a.slice(2));case "any":return new f(9,void 0,a.slice(1).map(f.createFilter.bind(this)));case "all":return new f(10,void 0,a.slice(1).map(f.createFilter.bind(this)));case "none":return new f(11,void 0,a.slice(1).map(f.createFilter.bind(this)));default:throw Error("invalid operator: "+e);}};f._types=["Unknown","Point","LineString","Polygon"];return f}()})},"esri/views/vectorTiles/style/StyleDefinition":function(){define(["require","exports"],function(r,h){Object.defineProperty(h, "__esModule",{value:!0});r=function(){function f(){}f.backgroundLayoutDefinition={visibility:{type:"enum",values:["visible","none"],"default":"visible"}};f.fillLayoutDefinition={visibility:{type:"enum",values:["visible","none"],"default":"visible"}};f.lineLayoutDefinition={visibility:{type:"enum",values:["visible","none"],"default":"visible"},"line-cap":{type:"enum",values:["butt","round","square"],"default":"butt"},"line-join":{type:"enum",values:["bevel","round","miter"],"default":"miter"},"line-miter-limit":{type:"number", "default":2},"line-round-limit":{type:"number","default":1.05}};f.symbolLayoutDefinition={visibility:{type:"enum",values:["visible","none"],"default":"visible"},"symbol-placement":{type:"enum",values:["point","line"],"default":"point"},"symbol-spacing":{type:"number",minimum:1,"default":250},"symbol-avoid-edges":{type:"boolean","default":!1},"icon-image":{type:"string"},"icon-allow-overlap":{type:"boolean","default":!1},"icon-ignore-placement":{type:"boolean","default":!1},"icon-optional":{type:"boolean", "default":!1},"icon-rotation-alignment":{type:"enum",values:["map","viewport","auto"],"default":"auto"},"icon-size":{type:"number",minimum:0,"default":1},"icon-rotate":{type:"number","default":0},"icon-padding":{type:"number",minimum:0,"default":2},"icon-keep-upright":{type:"boolean","default":!1},"icon-offset":{type:"array",value:"number",length:2,"default":[0,0]},"text-field":{type:"string"},"text-rotation-alignment":{type:"enum",values:["map","viewport","auto"],"default":"auto"},"text-font":{type:"array", value:"string","default":["Open Sans Regular","Arial Unicode MS Regular"]},"text-size":{type:"number",minimum:0,"default":16},"text-max-width":{type:"number",minimum:0,"default":10},"text-line-height":{type:"number","default":1.2},"text-letter-spacing":{type:"number","default":0},"text-justify":{type:"enum",values:["left","center","right"],"default":"center"},"text-anchor":{type:"enum",values:"center left right top bottom top-left top-right bottom-left bottom-right".split(" "),"default":"center"}, "text-max-angle":{type:"number",minimum:0,"default":45},"text-rotate":{type:"number","default":0},"text-padding":{type:"number",minimum:0,"default":2},"text-keep-upright":{type:"boolean","default":!0},"text-transform":{type:"enum",values:["none","uppercase","lowercase"],"default":"none"},"text-offset":{type:"array",value:"number",length:2,"default":[0,0]},"text-allow-overlap":{type:"boolean","default":!1},"text-ignore-placement":{type:"boolean","default":!1},"text-optional":{type:"boolean","default":!1}}; f.circleLayoutDefinition={visibility:{type:"enum",values:["visible","none"],"default":"visible"}};f.backgroundPaintDefinition={"background-opacity":{type:"number",minimum:0,maximum:1,"default":1},"background-color":{type:"color","default":[0,0,0,1]},"background-pattern":{type:"string"}};f.fillPaintDefinition={"fill-opacity":{type:"number",minimum:0,maximum:1,"default":1},"fill-antialias":{type:"boolean","default":!0},"fill-color":{type:"color","default":[0,0,0,1]},"fill-outline-color":{type:"color", "default":[0,0,0,0]},"fill-translate":{type:"array",value:"number",length:2,"default":[0,0]},"fill-translate-anchor":{type:"enum",values:["map","viewport"],"default":"map"},"fill-pattern":{type:"string"}};f.linePaintDefinition={"line-opacity":{type:"number",minimum:0,maximum:1,"default":1},"line-color":{type:"color","default":[0,0,0,1]},"line-translate":{type:"array",value:"number",length:2,"default":[0,0]},"line-translate-anchor":{type:"enum",values:["map","viewport"],"default":"map"},"line-width":{type:"number", minimum:0,"default":1},"line-gap-width":{type:"number",minimum:0,"default":0},"line-offset":{type:"number","default":0},"line-blur":{type:"number",minimum:0,"default":0},"line-dasharray":{type:"array",value:"number","default":[]},"line-pattern":{type:"string"}};f.symbolPaintDefinition={"icon-opacity":{type:"number",minimum:0,maximum:1,"default":1},"icon-color":{type:"color","default":[0,0,0,1]},"icon-halo-color":{type:"color","default":[0,0,0,0]},"icon-halo-width":{type:"number",minimum:0,"default":0}, "icon-halo-blur":{type:"number",minimum:0,"default":0},"icon-translate":{type:"array",value:"number",length:2,"default":[0,0]},"icon-translate-anchor":{type:"enum",values:["map","viewport"],"default":"map"},"text-opacity":{type:"number",minimum:0,maximum:1,"default":1},"text-color":{type:"color","default":[0,0,0,1]},"text-halo-color":{type:"color","default":[0,0,0,0]},"text-halo-width":{type:"number",minimum:0,"default":0},"text-halo-blur":{type:"number",minimum:0,"default":0},"text-translate":{type:"array", value:"number",length:2,"default":[0,0]},"text-translate-anchor":{type:"enum",values:["map","viewport"],"default":"map"}};f.rasterPaintDefinition={"raster-opacity":{type:"number",minimum:0,maximum:1,"default":1},"raster-hue-rotate":{type:"number","default":0},"raster-brightness-min":{type:"number",minimum:0,maximum:1,"default":0},"raster-brightness-max":{type:"number",minimum:0,maximum:1,"default":1},"raster-saturation":{type:"number",minimum:-1,maximum:1,"default":0},"raster-contrast":{type:"number", minimum:-1,maximum:1,"default":0},"raster-fade-duration":{type:"number",minimum:0,"default":300}};f.circlePaintDefinition={"circle-opacity":{type:"number",minimum:0,maximum:1,"default":1},"circle-radius":{type:"number",minimum:0,"default":5},"circle-color":{type:"color","default":[0,0,0,1]},"circle-blur":{type:"number",minimum:0,"default":0},"circle-translate":{type:"array",value:"number",length:2,"default":[0,0]},"circle-translate-anchor":{type:"enum",values:["map","viewport"],"default":"map"},"circle-stroke-width":{type:"number", minimum:0,"default":0},"circle-stroke-color":{type:"color","default":[0,0,0,1]},"circle-stroke-opacity":{type:"number",minimum:0,maximum:1,"default":1}};return f}();h.StyleDefinition=r})},"esri/views/vectorTiles/style/StyleProperty":function(){define(["require","exports","../../../Color","../GeometryUtils"],function(r,h,f,a){return function(){function e(a,f,d){this.isDataDriven=!1;switch(f.type){case "number":a=!0;break;case "color":a=!0;d=e._parseColor(d);break;case "array":a="number"===f.value; break;default:a=!1}null==d&&(d=f.default);a&&"interval"===d.type&&(a=!1);var b=d&&d.stops&&0=c&&a<=f||a>=f&&a<=c}})},"esri/layers/WMTSLayer":function(){define("require exports ../core/tsSupport/declareExtendsHelper ../core/tsSupport/decorateHelper dojo/_base/lang ../request ../core/Collection ../core/Error ../core/Handles ../core/promiseUtils ../core/accessorSupport/decorators ../geometry/Extent ./Layer ./WebTileLayer ./mixins/OperationalLayer ./mixins/PortalLayer ./mixins/RefreshableLayer ./mixins/ScaleRangeLayer ./support/WMTSSublayer ./support/wmtsUtils".split(" "), function(r,h,f,a,e,c,g,d,b,k,l,p,n,t,u,q,v,x,m,B){function z(a,b){return a.map(function(a){var c=new m;c.read(a,b);return c})}var C={"image/png":".png","image/png8":".png","image/png24":".png","image/png32":".png","image/jpg":".jpg","image/jpeg":".jpeg","image/gif":".gif","image/bmp":".bmp","image/tiff":".tif","image/jpgpng":"","image/jpegpng":"","image/unknown":""};return function(h){function n(a,c){var d=h.call(this)||this;d._sublayersHandles=new b;d.copyright=null;d.customParameters=null;d.customLayerParameters= null;d.fullExtent=null;d.operationalLayerType="WebTiledLayer";d.resourceInfo=null;d.serviceMode="RESTful";d.sublayers=null;d.type="wmts";d.version="1.0.0";d.watch("activeLayer",function(a,b){b&&(b.layer=null);a&&(a.layer=d)},!0);d.watch("sublayers",function(a,c){c&&(c.forEach(function(a){a.layer=null}),d._sublayersHandles.removeAll(),d._sublayersHandles=null);a&&(a.forEach(function(a){a.layer=d}),d._sublayersHandles||(d._sublayersHandles=new b),d._sublayersHandles.add([a.on("after-add",function(a){a.item.layer= d}),a.on("after-remove",function(a){a.item.layer=null})]))},!0);return d}f(n,h);n.prototype.normalizeCtorArgs=function(a,b){return"string"===typeof a?e.mixin({},{url:a},b):a};n.prototype.load=function(){var a=this;if("KVP"!==this.serviceMode&&"RESTful"!==this.serviceMode)console.error("WMTS mode could only be 'KVP' or 'RESTful'");else return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["WMTS"]}).then(function(){return a._fetchService()}).catch(function(){return k.reject(new d("wmtslayer:unsupported-service-data", "Invalid response from the WMTS service."))})),this.when()};Object.defineProperty(n.prototype,"activeLayer",{get:function(){return this._get("activeLayer")},set:function(a){this._set("activeLayer",a)},enumerable:!0,configurable:!0});n.prototype.readActiveLayerFromService=function(a,b,c){var d=this,e;this.activeLayer?b.layers.some(function(a){return a.id===d.activeLayer.id?(e=a,!0):!1}):(this.activeLayer=new m,e=b.layers[0]);this.activeLayer.read(e,c);return this.activeLayer};n.prototype.readActiveLayerFromItemOrWebDoc= function(a,b,c){return new m({id:b.wmtsInfo.layerIdentifier,tileMatrixSetId:b.wmtsInfo.tileMatrixSet})};n.prototype.writeActiveLayer=function(a,b){a=this.activeLayer;b.templateUrl=this.getUrlTemplate(a.id,a.tileMatrixSetId,a.imageFormat,a.styleId);b.wmtsInfo=e.mixin(b.wmtsInfo||{},{layerIdentifier:a.id,tileMatrixSet:a.tileMatrixSetId})};Object.defineProperty(n.prototype,"fullExtents",{get:function(){var a=[];this.activeLayer.tileMatrixSets.forEach(function(b){b.fullExtent&&a.push(b.fullExtent)}); return a},enumerable:!0,configurable:!0});n.prototype.readServiceMode=function(a,b,c){return-1=a[0]&&c<=a[1]||4326===f&&(!g||q))return t=new e(n,m,k),!0;b===z.length-1&&(t=new e(m,n,k));return!1});return t}function x(c,d,e,f){var g=b("BoundingBox",c),k,h; g&&(k=l("LowerCorner",g).split(" "),h=l("UpperCorner",g).split(" "));k&&1=f?c:g<=f?d:a.vec3d.add(c,a.vec3d.scale(e,f/g),k);b=a.vec3d.subtract(b,c,k);return Math.PI/2-Math.atan(b[2]/Math.sqrt(b[0]*b[0]+b[1]*b[1]))} function b(a,b){var c=a.getElevationBounds();a=a.extent;c=.5*(c[0]+c[1]);p[0]=a[0];p[1]=a[1];p[2]=c;n[0]=a[2];n[1]=a[3];n[2]=c;a=c=Infinity;b[0]n[0]&&(c=d(b,n,p,0));b[1]n[1]&&(a=d(b,n,p,1));return Math.min(c,a)}Object.defineProperty(h,"__esModule",{value:!0});var k=a.vec3d.create(),l=a.vec3d.create(),p=a.vec3d.create(),n=a.vec3d.create();h.autoUpdateSkirtsVisibility=function(a,c){var d,f=!0,g=a.extent,k=e.containsPoint(g,c);k?d=a.getElevation(c):(d= a.getElevationBounds(),d=.5*(d[0]+d[1]));d>c[2]?f=!1:k||(e.containsPointWithMargin(g,c,a.hideSkirtsDistanceFromExtentMargin*Math.min(g[2]-g[0],g[3]-g[1]))?b(a,c)>a.hideSkirtsMinimumCameraTilt&&(f=!1):f=!1);f!==a.skirts&&(a.skirts=f)};h.tiltOnEdge=d;h.tiltToExtentEdge=b;h.checkIfTileInfoSupportedForViewSR=function(a,b,d){if(a.spatialReference.isGeographic)return new f("tilingscheme:local-gcs-not-supported","Geographic coordinate systems are not supported in local scenes");var k=g.checkUnsupported(a); if(k)return k;var h=a.lods,k=h[0].resolution*Math.pow(2,h[0].level),l=[k*a.size[0],k*a.size[1]],n=[a.origin.x,a.origin.y];b=e.fromExtent(b);var p=e.create();g.computeRowColExtent(b,l,n,p);l=(p[2]-p[0])*(p[3]-p[1]);l>c.MAX_ROOT_TILES?(h=h[0].scale*Math.pow(2,h[0].level),k=Math.max((b[3]-b[1])/a.size[1],(b[2]-b[0])/a.size[0])*h/k,b=Math.floor(Math.log(k)/Math.log(10)),k=Math.ceil(k/Math.pow(10,b))*Math.pow(10,b),k=new f("tilingscheme:too-many-root-tiles","Scale of level 0 of the tiling scheme (1:"+ Math.floor(h).toLocaleString()+") is too large for the layer's extent. Suggested scale: 1:"+k.toLocaleString()+".",{level0Scale:h,suggestedLevel0Scale:k,requiredNumRootTiles:l,allowedNumRootTiles:c.MAX_ROOT_TILES})):k=null;return k?k:d&&!a.spatialReference.equals(d)?new f("tilingscheme:spatial-reference-mismatch","The tiling scheme does not match the spatial reference of the local scene"):null}})},"esri/views/3d/terrain/TerrainConst":function(){define(["require","exports","../support/aaBoundingRect", "./TilingScheme"],function(r,h,f,a){Object.defineProperty(h,"__esModule",{value:!0});(function(a){a[a.MAP=0]="MAP";a[a.ELEVATION=1]="ELEVATION";a[a.LAYER_CLASS_COUNT=2]="LAYER_CLASS_COUNT"})(h.LayerClass||(h.LayerClass={}));(function(a){a[a.NONE=0]="NONE";a[a.SPLIT=1]="SPLIT";a[a.VSPLITMERGE=2]="VSPLITMERGE";a[a.MERGE=4]="MERGE";a[a.DECODE_ELEVATION=8]="DECODE_ELEVATION";a[a.UPDATE_GEOMETRY=16]="UPDATE_GEOMETRY";a[a.UPDATE_TEXTURE=32]="UPDATE_TEXTURE"})(h.TileUpdateTypes||(h.TileUpdateTypes={})); h.TILE_LOADING_DEBUGLOG=!1;h.MAX_ROOT_TILES=64;h.MAX_TILE_TESSELATION=512;h.ELEVATION_NODATA_VALUE=3.40282347E38/10;h.noDataValueOpt={noDataValue:h.ELEVATION_NODATA_VALUE};h.ELEVATION_DESIRED_RESOLUTION_LEVEL=4;h.TILEMAP_SIZE_EXP=5;h.TILEMAP_SIZE=1< a+1&&(this.levels.length=a+1)},getMaxLod:function(){return this.levels.length-1},scaleAtLevel:function(a){return this.levels[0].scale/Math.pow(2,a)},levelAtScale:function(a){var b=this.levels[0].scale;return a>=b?0:Math.log(b/a)*Math.LOG2E},compatibleWith:function(a){if(!(a instanceof b)){if(b._checkUnsupported(a))return!1;a=new b(a)}if(!a.spatialReference.equals(this.spatialReference)||a.pixelSize[0]!==this.pixelSize[0]||a.pixelSize[1]!==this.pixelSize[1])return!1;var c=Math.min(this.levels.length, a.levels.length)-1,d=this.levels[c].resolution,f=e.floatEqualAbsolute,g=.5*d;if(!f(a.origin[0],this.origin[0],g)||!f(a.origin[1],this.origin[1],g))return!1;g=.5*d/Math.pow(2,c)/Math.max(this.pixelSize[0],this.pixelSize[1])*12;return f(d,a.levels[c].resolution,g)},rootTilesInExtent:function(a,c,e){var f=this.levels[0].tileSize;b.computeRowColExtent(a,f,this.origin,d);a=d[1];var g=d[3],h=d[0],k=d[2],l=k-h,p=g-a;l*p>e&&(e=Math.floor(Math.sqrt(e)),p>e&&(a=a+Math.floor(.5*p)-Math.floor(.5*e),g=a+e),l> e&&(h=h+Math.floor(.5*l)-Math.floor(.5*e),k=h+e));e=Array((k-h)*(g-a));l=0;for(p=a;p=b};b._checkUnsupported=function(a){return a?1>a.lods.length?new r("tilingscheme:generic","Tiling scheme must have at least one level"): b.isPowerOfTwo(a)?null:new r("tilingscheme:power-of-two","Tiling scheme must be power of two"):new r("tilingscheme:tile-info-missing","Tiling scheme must have tiling information")};b.checkUnsupported=function(a){var c=b._checkUnsupported(a);return c?c:b.hasGapInLevels(a)?new r("tilingscheme:gaps","Tiling scheme levels must not have gaps between min and max level"):b.tileSizeSupported(a)?null:new r("tilingscheme:tile-size","Tiles must be square and size must be one of [128, 256, 512]")};b.fromExtent= function(a,c){var d=a[2]-a[0],e=a[3]-a[1],g=f.getMetersPerUnitForSR(c),h=1.2*Math.max(d,e);a=new b({size:[256,256],origin:{x:a[0]-.5*(h-d),y:a[3]+.5*(h-e)},lods:[{level:0,resolution:h/256,scale:1/(256/96*.0254/(h*g))}],spatialReference:c});a.ensureMaxLod(20);return a};b.WebMercatorAuxiliarySphereTileInfo={size:[256,256],origin:{x:-2.0037508342787E7,y:2.0037508342787E7},spatialReference:h.WebMercator,lods:[{level:0,resolution:156543.03392800014,scale:5.91657527591555E8}]};b.makeWebMercatorAuxiliarySphere= function(a){a=null!=a?a:19;var c=new b(b.WebMercatorAuxiliarySphereTileInfo);c.ensureMaxLod(a);return c};b.WebMercatorAuxiliarySphere=b.makeWebMercatorAuxiliarySphere(19);b.makeWGS84WithTileSize=function(a,c){c=null!=c?c:16;var d=256/a;a=new b({size:[a,a],origin:{x:-180,y:90},spatialReference:h.WGS84,lods:[{level:0,resolution:.703125*d,scale:2.95497598570834E8*d}]});a.ensureMaxLod(c);return a};return b})},"esri/views/3d/terrain/terrainUtilsSpherical":function(){define(["require","exports","../../../core/Error", "./TilingScheme"],function(r,h,f,a){Object.defineProperty(h,"__esModule",{value:!0});h.autoUpdateSkirtsVisibility=function(a,c){};h.checkIfTileInfoSupportedForViewSR=function(e,c,g){c=e.lods.length-1;if(e.spatialReference.isWebMercator){if(!a.makeWebMercatorAuxiliarySphere(c).compatibleWith(e))return new f("tilingscheme:incompatible-global-web-mercator","The tiling scheme is not compatible with the ArcGIS Online Web Mercator tiling scheme")}else if(e.spatialReference.isWGS84){if(!a.makeWGS84WithTileSize(e.size[1], c).compatibleWith(e))return new f("tilingscheme:incompatible-global-wgs84","The tiling scheme is not compatible with the ArcGIS Online WGS84 tiling scheme")}else return new f("tilingscheme:global-unsupported-spatial-reference","The tiling scheme spatial reference is not supported in global scenes");if(g&&!e.spatialReference.equals(g))return new f("tilingscheme:spatial-reference-mismatch","The tiling scheme does not match the spatial reference of the global scene")}})},"esri/views/3d/terrain/tileUtils":function(){define(["require", "exports","../support/PreallocArray","./UpsampleInfo"],function(r,h,f,a){function e(a,c,d,f){f=c.call(d,a,f);for(var b=0;4>b;b++){var g=a.children[b];g&&e(g,c,d,f)}}function c(a,c,d){if(Array.isArray(a))for(var b=0;bb;b++){var f=a.children[b];f&&c(f,d,e)}d.call(e,a)}Object.defineProperty(h,"__esModule",{value:!0});r=function(){function a(a){void 0===a&&(a=100);this.q=new f(a);this._last=null;this.done=!0}a.prototype.reset=function(a){this.q.clear(); a&&this.q.pushEither(a);this._last=null;this.done=0===this.q.length};a.prototype.skip=function(){this._last=null;0===this.q.length&&(this.done=!0)};a.prototype.next=function(){if(this.done)return null;if(null!==this._last){var a=this._last.children;if(a[0])for(var b=4;0<=b;b--){var c=a[b];c&&this.q.push(c)}this._last=null}this._last=this.q.pop();0!==this.q.length||this._last.children[0]||(this.done=!0);return this._last};return a}();h.IteratorPreorder=r;r=function(){function a(a){void 0===a&&(a=100); this.q=new f(a);this.done=!0}a.prototype.reset=function(a){this.q.clear();this.q.pushEither(a);for(a=0;ac;c++){var d=b.children[c];d&&this.q.push(d)}this.done=0===this.q.length};a.prototype.next=function(){var a=this.q.pop();this.done=0===this.q.length;return a};return a}();h.IteratorPostorder=r;h.lij2str=function(a,c,d){return a+"/"+c+"/"+d};h.tile2str=function(a){return a.lij[0]+"/"+a.lij[1]+"/"+a.lij[2]};h.traverseTilesPreorder=function(a,c,d,f){if(Array.isArray(a))for(var b= 0;bb.xmax||e[3]>b.ymax)return!1}else if(b.xmin>e[2]||b.ymin>e[3]||b.xmax1.00000001*c.minScale||0=a[0]&&c[1]>= a[1]&&c[0]<=a[2]&&c[1]<=a[3]};h.getTileNLevelsUp=function(a,c){for(;0>b,e=0;a.lij[1]>>b&1&&(e+=2);d&1&&(e+=1);return c.children[e]};h.computeUpsampleInfoForAncestor=function(b,c){for(var d=1,e=0,f=0;b!==c;)if(d*=.5,e*=.5,f*=.5,b.lij[2]&1&&(e+=.5),0===(b.lij[1]&1)&&(f+=.5),b=b.parent,null==b)throw Error("tile was not a descendant of ancestorTile");b=a.Pool.acquire();b.init(c,e,f,d);return b};var d= [null];h.hasVisibleSiblings=function(a){Array.isArray(a)||(d[0]=a,a=d);for(var b=0;bf;f++){var g=e.children[f];if(g&&g!==c&&g.visible)return!0}}return!1}})},"esri/views/3d/terrain/UpsampleInfo":function(){define(["require","exports","../../../core/ObjectPool","../lib/glMatrix"],function(r,h,f,a){var e=a.vec2d;return function(){function a(a,c,b,f){this.scale=0;this.tile=null;this.offset=e.create();void 0!==a&&this.init(a,c,b,f)}a.prototype.init= function(a,c,b,e){this.tile=a;this.offset[0]=c;this.offset[1]=b;this.scale=e};a.prototype.dispose=function(){this.tile=null;this.offset[0]=0;this.scale=this.offset[1]=0};a.Pool=new f(a);return a}()})},"esri/views/3d/terrain/ElevationData":function(){define(["require","exports","../../../layers/support/rasterFormats/LercCodec","../support/mathUtils","./TerrainConst"],function(r,h,f,a,e){return function(){function c(a,c,b,e){this.samplerData=null;this.level=a;this.i=c;this.j=b;this.extent=e}c.prototype.computeMinMaxValue= function(c,d,b,f){var g=Infinity,h=-Infinity;c-=this.level;var k=Math.pow(2,c);if(Math.floor(d/k)===this.i&&Math.floor(b/k)===this.j&&0c){var k=Math.floor(b),v=Math.floor(d),r=k+v*t,m=u[r],B=u[r+1],z=u[r+t],r=u[r+t+1];if(m+B+z+rh?0:h)}f[0]=g;f[1]=h;return f};c.createFromLERC=function(a,d,b,e){b=f.decode(b,e);a=new c(a[0],a[1],a[2],d);a.samplerData={pixelData:b.pixelData,width:b.width,height:b.height,minValue:b.minValue,maxValue:b.maxValue,noDataValue:b.noDataValue,safeWidth:.99999999*(b.width-1),dx:(b.width-1)/ (a.extent[2]-a.extent[0]),dy:(b.width-1)/(a.extent[3]-a.extent[1]),x0:a.extent[0],y1:a.extent[3]};a.bounds=[a.samplerData.minValue,-3E38g?u:g,h=!1)}h&&(g=f=0);a.samplerData={pixelData:b.values,width:b.width,height:b.height,minValue:f,maxValue:g,noDataValue:e, safeWidth:.99999999*(b.width-1),dx:(b.width-1)/(a.extent[2]-a.extent[0]),dy:(b.width-1)/(a.extent[3]-a.extent[1]),x0:a.extent[0],y1:a.extent[3]};a.bounds=[f,g];return a};return c}()})},"esri/views/3d/terrain/TilePerLayerInfo":function(){define("require exports ./TerrainConst ./TileAgentBase ./UpsampleInfo ../../vectorTiles/VectorTileDisplayObject ../../webgl/Texture".split(" "),function(r,h,f,a,e,c,g){return function(){function d(a){this.waitingAgents=[];this.rawData=this.requestPromise=this.loadingAgent= this.upsampleFromTile=this.tilemapRequest=this.tilemap=this.data=null;this.pendingUpdates=0;this.elevationBounds=void 0;this.init(a)}d.prototype.init=function(a){this.waitingAgents.length=0;this.data=null;this.dataInvalidated=this.dataMissing=!1;this.rawData=this.requestPromise=this.loadingAgent=this.upsampleFromTile=this.tilemapRequest=this.tilemap=null;this.pendingUpdates=0;a===f.LayerClass.ELEVATION&&(this.elevationBounds=null)};d.prototype.invalidateSourceData=function(){this.tilemap=null;this.dataInvalidated= !0;this.dataMissing=!1;this.upsampleFromTile&&(e.Pool.release(this.upsampleFromTile),this.upsampleFromTile=null)};d.prototype.dispose=function(){this.loadingAgent&&this.loadingAgent!==a.AGENT_DONE&&(this.loadingAgent.dispose(),this.loadingAgent=null);this.requestPromise&&(this.requestPromise.cancel(),this.requestPromise=null);this.tilemap=null;this.tilemapRequest&&(this.tilemapRequest.cancel(),this.tilemapRequest=null);this.upsampleFromTile&&(e.Pool.release(this.upsampleFromTile),this.upsampleFromTile= null);this.rawData=null;this.pendingUpdates=0;this.disposeData()};d.prototype.disposeData=function(){var a=this.data;a&&(a instanceof g?a.dispose():a instanceof c&&a.dispose(),this.data=null)};d.makeEmptyLayerInfo=function(a,c){return c?(c.init(a),c):new d(a)};return d}()})},"esri/views/3d/terrain/TileAgentBase":function(){define(["require","exports","./tileUtils","./UpsampleInfo"],function(r,h,f,a){function e(c,d,b,f,h,p,n){if(!c.parent||6=e;){var E=v.layerInfo[b][a];if(E.data&&r>=n){v.lij[0]>B&&this._setUpsamplingTile(v); E.dataInvalidated&&(q=v);break}if(A&&!A.tileDataAvailable(v,a,b))D=!0;else if(v.lij[0]<=h&&!E.data&&!E.dataMissing&&(q=v,r>=t))break;(v=v.parent)&&A&&(A=A.parent||z.getTilemapTile(v));r++}q&&m-q.lij[0]=b[f+1]||0===this._vectorTileData.bufferData[d].byteLength))switch(b[f]){case 1:this.fillVertexBuffer?this.fillVertexBuffer.setData(this._vectorTileData.bufferData[d]):this.fillVertexBuffer=l.createVertex(a,35044,this._vectorTileData.bufferData[d]);break;case 2:this.fillDDVertexBuffer?this.fillDDVertexBuffer.setData(this._vectorTileData.bufferData[d]):this.fillDDVertexBuffer=l.createVertex(a,35044,this._vectorTileData.bufferData[d]); break;case 3:this.fillIndexBuffer?this.fillIndexBuffer.setData(this._vectorTileData.bufferData[d]):this.fillIndexBuffer=l.createIndex(a,35044,this._vectorTileData.bufferData[d]);break;case 4:this.outlineVertexBuffer?this.outlineVertexBuffer.setData(this._vectorTileData.bufferData[d]):this.outlineVertexBuffer=l.createVertex(a,35044,this._vectorTileData.bufferData[d]);break;case 5:this.outlineDDVertexBuffer?this.outlineDDVertexBuffer.setData(this._vectorTileData.bufferData[d]):this.outlineDDVertexBuffer= l.createVertex(a,35044,this._vectorTileData.bufferData[d]);break;case 6:this.outlineIndexBuffer?this.outlineIndexBuffer.setData(this._vectorTileData.bufferData[d]):this.outlineIndexBuffer=l.createIndex(a,35044,this._vectorTileData.bufferData[d]);break;case 7:this.lineVertexBuffer?this.lineVertexBuffer.setData(this._vectorTileData.bufferData[d]):this.lineVertexBuffer=l.createVertex(a,35044,this._vectorTileData.bufferData[d]);break;case 8:this.lineDDVertexBuffer?this.lineDDVertexBuffer.setData(this._vectorTileData.bufferData[d]): this.lineDDVertexBuffer=l.createVertex(a,35044,this._vectorTileData.bufferData[d]);break;case 9:this.lineIndexBuffer?this.lineIndexBuffer.setData(this._vectorTileData.bufferData[d]):this.lineIndexBuffer=l.createIndex(a,35044,this._vectorTileData.bufferData[d]);break;case 10:this.iconVertexBuffer?this.iconVertexBuffer.setData(this._vectorTileData.bufferData[d]):this.iconVertexBuffer=l.createVertex(a,35044,this._vectorTileData.bufferData[d]);break;case 11:this.iconDDVertexBuffer?this.iconDDVertexBuffer.setData(this._vectorTileData.bufferData[d]): this.iconDDVertexBuffer=l.createVertex(a,35044,this._vectorTileData.bufferData[d]);break;case 12:this.iconIndexBuffer?this.iconIndexBuffer.setData(this._vectorTileData.bufferData[d]):this.iconIndexBuffer=l.createIndex(a,35044,this._vectorTileData.bufferData[d]);break;case 13:this.textVertexBuffer?this.textVertexBuffer.setData(this._vectorTileData.bufferData[d]):this.textVertexBuffer=l.createVertex(a,35044,this._vectorTileData.bufferData[d]);break;case 14:this.textDDVertexBuffer?this.textDDVertexBuffer.setData(this._vectorTileData.bufferData[d]): this.textDDVertexBuffer=l.createVertex(a,35044,this._vectorTileData.bufferData[d]);break;case 15:this.textIndexBuffer?this.textIndexBuffer.setData(this._vectorTileData.bufferData[d]):this.textIndexBuffer=l.createIndex(a,35044,this._vectorTileData.bufferData[d]);break;case 16:this.circleVertexBuffer?this.circleVertexBuffer.setData(this._vectorTileData.bufferData[d]):this.circleVertexBuffer=l.createVertex(a,35044,this._vectorTileData.bufferData[d]);break;case 17:this.circleIndexBuffer?this.circleIndexBuffer.setData(this._vectorTileData.bufferData[d]): this.circleIndexBuffer=l.createIndex(a,35044,this._vectorTileData.bufferData[d])}this._vectorTileData=null;this.status=4;return!0};h.prototype.detach=function(a){this.client&&6!==this.status&&7!==this.status&&this.client.invoke("destructTileData",this.id);this.dispose();d.prototype.detach.call(this,a)};h.prototype.doRender=function(a){if(this.visible&&4===this.status){var b=a.context,c=a.renderer;if(b&&c){var d=a.drawphase;this._symbolUpdateData&&this._updateSymbolData(a);b.setStencilFunction(514, this.stencilData.reference,this.stencilData.mask);var e=this.styleLayers,f=void 0!==a.layerOpacity?a.layerOpacity:1;if(0!==f){var g,h=this._renderBuckets.length,k=0;if(0===d)for(k=h-1;0<=k;k--)g=this._renderBuckets[k],3!==g.type&&g.hasData()&&c.renderBucket(b,g,a.displayLevel,a.requiredLevel,d,this,e.layers[g.layerID],f);else for(k=0;ka[5]&a[0]>a[10]?(c=2*Math.sqrt(1+a[0]-a[5]-a[10]),f[3]=(a[6]-a[9])/c,f[0]=.25*c,f[1]=(a[1]+a[4])/c,f[2]=(a[8]+a[2])/c):a[5]>a[10]?(c=2*Math.sqrt(1+a[5]- a[0]-a[10]),f[3]=(a[8]-a[2])/c,f[0]=(a[1]+a[4])/c,f[1]=.25*c,f[2]=(a[6]+a[9])/c):(c=2*Math.sqrt(1+a[10]-a[0]-a[5]),f[3]=(a[1]-a[4])/c,f[0]=(a[8]+a[2])/c,f[1]=(a[6]+a[9])/c,f[2]=.25*c);return f};h.fromRotationTranslationScale=function(f,a,e,c){var g=a[0],d=a[1],b=a[2],h=a[3],l=g+g,p=d+d,n=b+b;a=g*l;var t=g*p,g=g*n,u=d*p,d=d*n,b=b*n,l=h*l,p=h*p,h=h*n,n=c[0],q=c[1];c=c[2];f[0]=(1-(u+b))*n;f[1]=(t+h)*n;f[2]=(g-p)*n;f[3]=0;f[4]=(t-h)*q;f[5]=(1-(a+b))*q;f[6]=(d+l)*q;f[7]=0;f[8]=(g+p)*c;f[9]=(d-l)*c;f[10]= (1-(a+u))*c;f[11]=0;f[12]=e[0];f[13]=e[1];f[14]=e[2];f[15]=1;return f};h.fromRotationTranslationScaleOrigin=function(f,a,e,c,g){var d=a[0],b=a[1],h=a[2],l=a[3],p=d+d,n=b+b,t=h+h;a=d*p;var u=d*n,d=d*t,q=b*n,b=b*t,h=h*t,p=l*p,n=l*n,l=l*t,t=c[0],v=c[1];c=c[2];var r=g[0],m=g[1];g=g[2];f[0]=(1-(q+h))*t;f[1]=(u+l)*t;f[2]=(d-n)*t;f[3]=0;f[4]=(u-l)*v;f[5]=(1-(a+h))*v;f[6]=(b+p)*v;f[7]=0;f[8]=(d+n)*c;f[9]=(b-p)*c;f[10]=(1-(a+q))*c;f[11]=0;f[12]=e[0]+r-(f[0]*r+f[4]*m+f[8]*g);f[13]=e[1]+m-(f[1]*r+f[5]*m+f[9]* g);f[14]=e[2]+g-(f[2]*r+f[6]*m+f[10]*g);f[15]=1;return f};h.fromQuat=function(f,a){var e=a[0],c=a[1],g=a[2];a=a[3];var d=e+e,b=c+c,h=g+g,e=e*d,l=c*d,c=c*b,p=g*d,n=g*b,g=g*h,d=a*d,b=a*b;a*=h;f[0]=1-c-g;f[1]=l+a;f[2]=p-b;f[3]=0;f[4]=l-a;f[5]=1-e-g;f[6]=n+d;f[7]=0;f[8]=p+b;f[9]=n-d;f[10]=1-e-c;f[11]=0;f[12]=0;f[13]=0;f[14]=0;f[15]=1;return f};h.frustum=function(f,a,e,c,g,d,b){var h=1/(e-a),l=1/(g-c),p=1/(d-b);f[0]=2*d*h;f[1]=0;f[2]=0;f[3]=0;f[4]=0;f[5]=2*d*l;f[6]=0;f[7]=0;f[8]=(e+a)*h;f[9]=(g+c)*l;f[10]= (b+d)*p;f[11]=-1;f[12]=0;f[13]=0;f[14]=b*d*2*p;f[15]=0;return f};h.perspective=function(f,a,e,c,g){a=1/Math.tan(a/2);var d=1/(c-g);f[0]=a/e;f[1]=0;f[2]=0;f[3]=0;f[4]=0;f[5]=a;f[6]=0;f[7]=0;f[8]=0;f[9]=0;f[10]=(g+c)*d;f[11]=-1;f[12]=0;f[13]=0;f[14]=2*g*c*d;f[15]=0;return f};h.perspectiveFromFieldOfView=function(f,a,e,c){var g=Math.tan(a.upDegrees*Math.PI/180),d=Math.tan(a.downDegrees*Math.PI/180),b=Math.tan(a.leftDegrees*Math.PI/180);a=Math.tan(a.rightDegrees*Math.PI/180);var h=2/(b+a),l=2/(g+d);f[0]= h;f[1]=0;f[2]=0;f[3]=0;f[4]=0;f[5]=l;f[6]=0;f[7]=0;f[8]=-((b-a)*h*.5);f[9]=(g-d)*l*.5;f[10]=c/(e-c);f[11]=-1;f[12]=0;f[13]=0;f[14]=c*e/(e-c);f[15]=0;return f};h.ortho=function(f,a,e,c,g,d,b){var h=1/(a-e),l=1/(c-g),p=1/(d-b);f[0]=-2*h;f[1]=0;f[2]=0;f[3]=0;f[4]=0;f[5]=-2*l;f[6]=0;f[7]=0;f[8]=0;f[9]=0;f[10]=2*p;f[11]=0;f[12]=(a+e)*h;f[13]=(g+c)*l;f[14]=(b+d)*p;f[15]=1;return f};h.lookAt=function(f,a,e,c){var g,d,b,k,l,p,n,t,u=a[0],q=a[1];a=a[2];b=c[0];k=c[1];d=c[2];n=e[0];c=e[1];g=e[2];if(Math.abs(u- n)=e.ELEVATION_DESIRED_RESOLUTION_LEVEL));)c=c.parent;return f?(a=g.Pool.acquire(),a.init(f,0,0,1),a):null};b.prototype._desiredMinLevelDelta= function(){return e.ELEVATION_DESIRED_RESOLUTION_LEVEL-(this.tile.vlevel-this.tile.lij[0])};b.prototype._setUpsamplingTile=function(a){this._unsetUpsamplingTile();var b=g.Pool.acquire();b.init(a,0,0,1);this._tileLayerInfo.upsampleFromTile=b;this.updateGeometry()};b.Pool=new a(b);return b}(c)})},"esri/views/3d/terrain/MapTileAgent":function(){define("require exports ../../../core/tsSupport/extendsHelper ../../../core/ObjectPool ./TileAgentBase ./tileUtils".split(" "),function(r,h,f,a,e,c){return function(e){function d(){var a= e.call(this)||this;a._scaleRangeEnabled=!0;return a}f(d,e);d.prototype.dataArrived=function(a){a!==this.tile?this._setUpsamplingTile(a):(this._unsetUpsamplingTile(),this.tile.updateTexture());this._dataRequested=null;a!==this.tile&&this._requestNext()};d.prototype._desiredMinLevelDelta=function(){return 0};d.prototype._setUpsamplingTile=function(a){this._tileLayerInfo.upsampleFromTile&&this._tileLayerInfo.upsampleFromTile.tile===a||(this._unsetUpsamplingTile(),this._tileLayerInfo.upsampleFromTile= c.computeUpsampleInfoForAncestor(this.tile,a),this.tile.updateTexture())};d.Pool=new a(d);return d}(e)})},"esri/views/3d/terrain/TileGeometryFactory":function(){define("require exports ../support/aaBoundingBox ../support/ArrayPool ../support/earthUtils ../support/mathUtils ./TerrainConst".split(" "),function(r,h,f,a,e,c,g){function d(a,b,d){for(var e=0;ed[3]&&(d[3]=a);bd[4]&&(d[4]=b);cd[5]&&(d[5]=c)}function l(a,b,c,d,f){a*=e.earthRadius;for(var g=0;g<=b;g++)c[5*d]=0,c[5*d+1]=0,c[5*d+2]=a,k(0, 0,a,f),d++}Object.defineProperty(h,"__esModule",{value:!0});var p=new a.ArrayPool(Float32Array);h.releaseGeometry=function(a){p.put(a.vertexAttributes);a.vertexAttributes=null;a.indices=null};h.elevationSampler=d;h.createSphericalGlobeTile=function(a,g,h,n,r,A,D,E,F){var m=h[0],x=h[1],z=h[2],B=h[3],C=Math.max(.9,1-.5*(z-m));h=a-1;var J=a-1,O=a*a,N=p.get(5*(O+(2*h+2*J))),S=F.boundingBox;f.set(S,f.NEGATIVE_INFINITY);var R=g[2]-g[0],Y=g[3]-g[1],X=z-m,z=A[0],Q=A[1];A=A[2];for(var K=0;K<=h;K++){var L= K/h,V=m+L*X;t[K]=Math.sin(V);u[K]=Math.cos(V);q[K]=L;v[K]=g[0]+L*R}for(R=m=0;R<=J;R++){var X=R/J,K=c.lerp(x,B,X),V=Math.cos(K),U=Math.sin(K),ca=void 0;n?(ca=e.earthRadius/2*Math.log((1+U)/(1-U)),X=(ca-g[1])/Y):ca=180*K/Math.PI;for(K=0;K<=h;K++){var L=q[K],ga=t[K],da=u[K],ka=e.earthRadius;r&&(ka+=d(v[K],ca,r)||0);var da=da*V*ka,ga=ga*V*ka,ka=U*ka,Z=da-z,ea=ga-Q,ja=ka-A;k(Z,ea,ja,S);var aa=5*m;N[aa+0]=Z;N[aa+1]=ea;N[aa+2]=ja;N[aa+3]=L;N[aa+4]=X;aa=-1;0===R&&(aa=O+K);K===h&&(aa=O+h+R);R===J&&(aa=O+h+ J+(h-K));0===K&&0l[3]&&(Y=l[3],D=(Y-q)/c));for(var X=0;X<=v;X++){var Q=X/v,K=m+Q*t;l&&(Kl[2]&&(K=l[2],Q=(K-m)/t));var L=e?d(K,Y,e)||0:0,K=K-g[0],V=Y-g[1],L=L-g[2];k(K,V,L,B);z[5*A]=K;z[5*A+1]=V;z[5*A+2]=L;z[5*A+3]=Q;z[5*A+4]=D;var U=-1;0===C&&(U=x+X);X===v&&(U=x+v+C);C===r&&(U=x+v+r+(v-X));0===X&&0e;e++)this.obb[e]=g.create();void 0!==a&&this.init(a,b,c,d)};e.prototype=new r;e.prototype.constructor=e;e.prototype.init=function(c,e,f,h){r.prototype.init.call(this,c,e,f,h);this._isWebMercator=h.spatialReference.isWebMercator;e=this.extentWGS84Rad[0];f=this.extentWGS84Rad[1];h=this.extentWGS84Rad[2];var k=this.extentWGS84Rad[3];c=c[0];var l=a.lerp(f,k,.5),n=a.lerp(e,h,.5); this.edgeLen=(h-e)*Math.cos(0===c?0:Math.min(Math.abs(f),Math.abs(k)))*d;this.curvatureHeight=d-Math.sqrt(d*d-this.edgeLen*this.edgeLen/4);b(l,n,0,this.centerAtSeaLevel);g.set(this.centerAtSeaLevel,this.tileUp);g.normalize(this.tileUp);this._updateOBB();this.updateRadiusAndCenter()};e.prototype.isVisible=function(a,b){if(!this.intersectsClippingArea)return!1;if(9c;c++){for(var d=0;8>d&&!(0>a[c][0]*b[d][0]+a[c][1]*b[d][1]+a[c][2]*b[d][2]+a[c][3]);d++);if(8=== d)return!1}}else if(b=this.radius,c=this.center,a[0][0]*c[0]+a[0][1]*c[1]+a[0][2]*c[2]+a[0][3]>b||a[1][0]*c[0]+a[1][1]*c[1]+a[1][2]*c[2]+a[1][3]>b||a[2][0]*c[0]+a[2][1]*c[1]+a[2][2]*c[2]+a[2][3]>b||a[3][0]*c[0]+a[3][1]*c[1]+a[3][2]*c[2]+a[3][3]>b||a[4][0]*c[0]+a[4][1]*c[1]+a[4][2]*c[2]+a[4][3]>b||a[5][0]*c[0]+a[5][1]*c[1]+a[5][2]*c[2]+a[5][3]>b)return!1;return!0};e.prototype.computeElevationBounds=function(){r.prototype.computeElevationBounds.call(this);this._updateOBB()};e.prototype.updateRadiusAndCenter= function(){if(0===this.lij[0])g.set3(0,0,0,this.center),this.radius=d+this.elevationBounds[1];else{r.prototype.updateRadiusAndCenter.call(this);var a=Math.max(g.dist2(this.center,this.obb[0]),g.dist2(this.center,this.obb[1]));this.radius=Math.sqrt(a)}};e.prototype._numSubdivisionsAtLevel=[128,64,32,16,16,8,8,4];e.prototype.createGeometry=function(a,b,c,d){var e=this._isPole(this.lij[1],this.lij[0]);a.needsUpdate=!1;return h.createSphericalGlobeTile(a.numVertsPerRow,this.extent,this.extentWGS84Rad, this._isWebMercator,a.samplerData,b,e,c,d)};e.prototype._updateOBB=function(){var a=this.extentWGS84Rad,c=this.obb,e;for(e=0;2>e;e++){var f=this.elevationBounds[e],h=4*e;b(a[1],a[0],f,c[h++]);b(a[3],a[0],f,c[h++]);b(a[3],a[2],f,c[h++]);b(a[1],a[2],f,c[h++])}this._isWebMercator&&(a=this._isPole(this.lij[1],this.lij[0]),2===a?(g.set3(0,0,d,c[1]),g.set3(0,0,d,c[2]),g.set3(0,0,d,c[5]),g.set3(0,0,d,c[6])):1===a&&(g.set3(0,0,-d,c[0]),g.set3(0,0,-d,c[3]),g.set3(0,0,-d,c[4]),g.set3(0,0,-d,c[7])))};e.prototype._isPole= function(a,b){var c=0;a===(1<c&&e.capMaxLod(c);this._set("tilingSchemeDone", !0);this._lockTilingScheme(e)}else this._updateWhen(c);else this._set("tilingSchemeDone",!0)}};h.prototype._updateWhen=function(a){var b=this,c=a.when().always(function(){c===b._waitTask&&b._update()});this._waitTask=c};h.prototype._lockTilingScheme=function(a){var c=this;if("spherical"===this.manifold){var d=a.levels.length-1;a=a.spatialReference.isWebMercator?b.makeWebMercatorAuxiliarySphere(d):b.makeWGS84WithTileSize(a.pixelSize[0],d)}this.tilingSchemeLocked=!0;this.tilingScheme=a;this.extentHelper.tilingScheme= this.tilingScheme;this._updateTiledLayerExtent();this._changeHandles.removeAll();this._changeHandles.add(this.extentHelper.watch("tiledLayersExtent",function(){return c._updateTiledLayerExtent()}))};h.prototype._updateTiledLayerExtent=function(){this.extent=this.extentHelper.tiledLayersExtent};h.prototype._setAdHocTilingScheme=function(){if("spherical"===this.manifold)this.tilingScheme=this.extentHelper.spatialReference.isWebMercator?b.WebMercatorAuxiliarySphere:b.makeWGS84WithTileSize(256),this.extent= this.extentHelper.layerViewsExtent;else{var a=this.extentHelper.layerViewsExtent;a&&(this.tilingScheme=b.fromExtent(a,this.extentHelper.spatialReference),this.extent=a)}};a([g.property()],h.prototype,"tilingScheme",void 0);a([g.property()],h.prototype,"extent",void 0);a([g.property({value:!1})],h.prototype,"tilingSchemeLocked",void 0);a([g.property({readOnly:!0,value:!1})],h.prototype,"tilingSchemeDone",void 0);a([g.property({constructOnly:!0})],h.prototype,"viewSpatialReference",void 0);a([g.property({constructOnly:!0})], h.prototype,"layers",void 0);a([g.property({constructOnly:!0})],h.prototype,"extentHelper",void 0);a([g.property({constructOnly:!0})],h.prototype,"manifold",void 0);return h=a([g.subclass()],h)}(g.declared(e))})},"esri/views/3d/terrain/TerrainRenderer":function(){define("dojo/when ./tileUtils ./TerrainConst ./TileGeometryFactory ./TileRenderData ./ResourceCounter ./TileRenderer ../support/PreallocArray ../../../core/ObjectPool ../../../core/promiseUtils ../support/imageUtils ../webgl-engine/lib/ShaderVariations dojo/text!./TerrainMaterial.xml ../webgl-engine/materials/internal/MaterialUtil ../webgl-engine/lib/Util ../webgl-engine/lib/Geometry ../webgl-engine/lib/GeometryData ../lib/glMatrix ../webgl-engine/lib/RenderPass ../webgl-engine/lib/RenderSlot ../webgl-engine/lib/tracer ../../webgl/VertexArrayObject ../../webgl/BufferObject ../../webgl/Program ../webgl-engine/lib/DefaultVertexAttributeLocations ../webgl-engine/lib/DefaultVertexBufferLayouts ../webgl-engine/lib/screenSizePerspectiveUtils ../webgl-engine/lib/glUtil3D ../../webgl/Util".split(" "), function(r,h,f,a,e,c,g,d,b,k,l,p,n,t,u,q,v,x,m,B,z,C,A,D,E,F,I,P,G){var M=u.assert;u=x.vec2d;var H=x.vec3d,J=x.vec4d,O=x.mat4d.identity(),N=[2,2],S=B.OPAQUE_TERRAIN,R=B.TRANSPARENT_TERRAIN,Y=H.create(),X=u.create();x=function(q,u,v){function x(a,b){a=a.screenDepth;b=b.screenDepth;return ab?ba:0}function B(a,b){return 0===a.tiles.length?-ba:0===b.tiles.length?ba:x(a.tiles.data[0],b.tiles.data[0])}u=u||256;var L,K=!1,V=null,Z=null,ea=null,ja={},aa,fa,qa=new b(e),T=new d(10,function(){return{root:null, tiles:new d(300)}}),ha=!0,ia=new h.IteratorPreorder,la=null,w=!0,ra=1,wa=!0,xa=!1,oa={mode:"none",width:1.5,falloff:1.5,wireOpacity:1,surfaceOpacity:0,color:[1,1,1,0],resolution:64},na=!1,Fa=!1,ua=!1,ba=1,za=!0,Pa=!0,Ga=null,ya=null,Ca=null,Ra=!1,Sa=[];this.updateTileBackground=function(a){Ca&&Ca.cancel();Ca=a?l.requestImage(a).catch(function(){return null}):k.resolve(null);this.renderTileBackground();return Ca};var Va=0,Qa=0,Za=0,Wa=0;this.resourceCounter=new c;this.castShadows=!0;this.clippingExtent= null;this.loaded=function(){};var $a=!1;this.needsRender=!0;this.receiveShadows=this.needsHighlight=this.didRender=!1;var Aa=new d(10),Ia=0,Ta=new d(30),fb=new b(function(){this.extent=J.create();this.maxLevel=this.minLevel=0;this.callback=null},!1);this.renderTileBackground=function(){if(aa&&Ca&&ya)return Ca.then(function(a){ya&&(Ra=!0,ya.setGridImage(a),V&&h.traverseTilesPreorder(V,function(a){ya.updateTileTexture(a)}.bind(this)))}.bind(this))};this.initializeRenderContext=function(a){aa=a.rctx; fa=a.rctx.gl;var b=function(a){r(a).then(function(){K=!0;this.setNeedsRender()}.bind(this)).catch(b)}.bind(this);b(this.renderTileBackground());L=a.textureRep;var c=a.shaderSnippets;a=a.programRep;c.vsTerrain||c._parse(n);var d=new p("terrain",["vsTerrain","fsTerrain"],null,a,c,aa);d.addDefine("Spherical","SPHERICAL");d.addDefine("Overlay","OVERLAY");d.addDefine("Atmosphere","ATMOSPHERE");d.addDefine("Wireframe","WIREFRAME");d.addDefine("TileBorders","TILE_BORDERS");d.addBinaryShaderSnippetSuffix("Wireframe", "Wireframe",[!1,!0]);d.addDefine("ReceiveShadows","RECEIVE_SHADOWS");d.addDefine("ScreenSizePerspective","SCREEN_SIZE_PERSPECTIVE");var e=new p("terrainNormal",["vsTerrainNormal","fsNormal"],null,a,c,aa);e.addDefine("Spherical","SPHERICAL");e.addDefine("AlphaZero","ALPHA_ZERO");ea={depth:a.get("depth"),depthShadowMap:a.get("depthShadowMap"),depthOnly:new D(aa,c.vsTerrainDepthOnly,c.fsTerrainDepthOnly,E.Default3D),highlight:new D(aa,c.vsTerrainHighlight,c.fsTerrainHighlight,E.Default3D)};Z={color:d, normal:e};this._updatePrograms();ya=new g(aa,u,a,this.resourceCounter,this.setNeedsRender.bind(this));this.renderTileBackground();Ga=P.createEmptyTexture(aa)};this.uninitializeRenderContext=function(a){null!=Ga&&(Ga.dispose(),Ga=null);ya&&(ya.dispose(),ya=null)};this._updatePrograms=function(){var a="spherical"===q,b="shader"===oa.mode;ea.color=Z.color.getProgram([a,!0,a&&Pa,b,na,b||na,this.receiveShadows,xa]);ea.normal=Z.normal.getProgram([a,!0]);this.setNeedsRender()};this.destroy=function(a){this.uninstall(a); Ca&&(Ca.cancel(),Ca=null)};this.install=function(a){a.addExternalRenderer([S,R],this)};this.uninstall=function(a){a.removeExternalRenderer(this)};this.setRootTiles=function(a){V=a;this.setNeedsRender()};this.setNeedsHighlight=function(a){this.needsHighlight=a;this.setNeedsRender()};this.setStencilEnabledLayerExtents=function(a){Sa=a;this.setNeedsRender()};this.setTileSize=function(a){u=a;ya&&(ya.tileSize=a);this.setNeedsRender()};this.loadTile=function(a){M(null===a.renderData);a.renderData=qa.acquire(); a.renderData.init();var b=this.getLocalOriginOfTile(a);a.createGeometry(a.renderData.updateGeometryState(a),b,"debug"===oa.mode,a.renderData.geometryInfo);a.renderData.localOrigin=b;this._updateTileGeometryBuffers(a);Ra&&ya.updateTileTexture(a)};this.queryVisibleLevelRange=function(a,b,c,d){var e=fb.acquire();J.set(a,e.extent);e.minLevel=b?b:-Number.MAX_VALUE;e.maxLevel=null!=c?c:Number.MAX_VALUE;e.callback=d;Ta.push(e);this.setNeedsRender()};this.updateTileTexture=function(a){ya&&Ra&&ya.updateTileTexture(a)}; this.updateTileGeometryNeedsUpdate=function(a){return a.renderData.updateGeometryState(a).needsUpdate};this._updateTileGeometry=function(a){for(var b=a.renderData.geometryState,c=a.layerInfo[f.LayerClass.ELEVATION],d=0;dra||"shader"===oa.mode&&(1>oa.wireOpacity||1>oa.surfaceOpacity)};this._renderMaterialPass=function(a,b){var c=this.isTransparent(),d=a.shadowMap&&a.shadowMap.getEnableState();this.receiveShadows!=d&&(this.receiveShadows=d,this._updatePrograms());d=a.camera;aa.setDepthTestEnabled(!0);aa.setBlendingEnabled(c);c&&aa.setBlendFunctionSeparate(fa.SRC_ALPHA,fa.ONE_MINUS_SRC_ALPHA, fa.ONE,fa.ONE_MINUS_SRC_ALPHA);c&&za?(c=ea.depthOnly,aa.bindProgram(c),aa.setColorMask(!1,!1,!1,!1),aa.setDepthWriteEnabled(!0),this._renderTilesAuxiliary(a,c,b),aa.setColorMask(!0,!0,!0,!0),aa.setDepthFunction(fa.EQUAL),aa.setDepthWriteEnabled(!1)):aa.setDepthFunction(fa.LESS);c=ea.color;aa.bindProgram(c);c.setUniform1f("opacity",ra);if("shader"===oa.mode||na)c.setUniform1f("wireframe.width",oa.width),c.setUniform1f("wireframe.falloff",Math.min(oa.width,oa.falloff)),c.setUniform1f("wireframe.wireOpacity", oa.wireOpacity*ra),c.setUniform1f("wireframe.surfaceOpacity",oa.surfaceOpacity*ra),c.setUniform4fv("wireframe.color",oa.color);d=a.camera;a.shadowMap&&a.shadowMap.bind(c);a.ssaoHelper&&a.ssaoHelper.setUniforms(c);c.setUniform1i("tex",4);c.setUniform1i("overlayTex",5);c.setUniformMatrix4fv("viewNormal",d.viewInverseTransposeMatrix);c.setUniformMatrix4fv("proj",d.projectionMatrix);a.lightingData.helper.setUniforms(c,!0);d=d.viewMatrix;H.set3(d[12],d[13],d[14],Ha);H.normalize(Ha);c.setUniform3fv("viewDirection", Ha);for(Wa=Va=Za=Qa=0;Aa.length=Ia),b.callback=null;Aa.clear();0la.vlevel)la=b;ia.skip()}}}};this._sortFrontToBack=function(a,b){a.sort(b)};this._updateStencilReadStateForTile=function(a,b){if(a.stencilRenderingHelper&&a.stencilRenderingHelper.getEnableState()){for(var c= !1,d=0;d=r.minLevel&&n<=r.maxLevel&&x[0]<=f[2]&&x[2]>=f[0]&&x[1]<=f[3]&&x[3]>=f[1]?(Aa.swap(p,Ia-1),Ia--):p++}}}}aa.bindVAO(null);a.stencilRenderingHelper&&a.stencilRenderingHelper.disableStencilRead()};var ab=function(a,b,c){var d=ja[c];d||(d=L.aquire(c).getGLTexture(),M(d),ja[c]=d);a.setUniform2fv("overlayTexOffset",b.overlayTexOffset);a.setUniform2fv("overlayTexScale",b.overlayTexScale); a.setUniform1f("overlayOpacity",b.overlayOpacity);aa.bindTexture(d,5)},gb=H.create(),Ja=H.create(),Xa=H.create(),hb=this.clippingExtent;this.intersect=function(a,b,c){if(V&&(!a.isSelection||!this.isTransparent())&&a.enableTerrain){H.subtract(c,b,gb);var d=a.getMinResult(),e=a.getMaxResult();ia.reset(V);for(var f={};!ia.done;){var g=ia.next();if(null!==g.renderData){if(a.enableInvisibleTerrain){if(!g.visible&&hb&&!g.intersectsExtent(hb))continue}else if(!g.visible)continue;var k=g.renderData.geometryInfo; Q.getData().getAttribute("terrain").data=k.vertexAttributes;Q.getData()._indices.terrain=k.indices;var l=k.boundingBox;H.set3(l[0],l[1],l[2],Q.boundingInfo.bbMin);H.set3(l[3],l[4],l[5],Q.boundingInfo.bbMax);Q.boundingInfo.indices=k.indices;Q.boundingInfo.positionData=Q.getData().getAttribute("terrain");k=g.renderData.localOrigin;H.subtract(b,k,Ja);H.subtract(c,k,Xa);t.intersectTriangleGeometry(Q,f,void 0,a,Ja,Xa,function(b,c,f){if((wa||!(3*f>=g.renderData.geometryInfo.numWithoutSkirtIndices))&&0<= b&&(a.enableBackfacesTerrain||0>H.dot(c,gb))){if(void 0===d.dist||be.dist)f=h.lij2str(g.lij[0],g.lij[1],g.lij[2]),e.set(void 0,f,b,c,void 0),e.setIntersector("terrain")}})}}}};this._updateTileGeometryBuffers=function(a){a=a.renderData;var b=a.geometryInfo.indices;a.vao=new C(aa,E.Default3D,{geometry:F.Pos3Tex},{geometry:A.createVertex(aa,fa.STATIC_DRAW,a.geometryInfo.vertexAttributes)}, A.createIndex(aa,fa.STATIC_DRAW,b));this.setNeedsRender()};this._releaseTileGeometry=function(b){b=b.renderData;b.vao.dispose(!0);b.vao=null;a.releaseGeometry(b.geometryInfo);this.setNeedsRender()}};v=new v({terrain:{data:null,size:5}},{terrain:null});var Q=new q(v,"tmpTerrainGeometry",{bbMin:H.create(),bbMax:H.create(),indices:null,positionData:null,getBBMin:function(){return this.bbMin},getBBMax:function(){return this.bbMax},getPrimitiveIndices:function(){},getChildren:function(){},getIndices:function(){return this.indices}, getPosition:function(){return this.positionData}});x.TileRenderData=e;return x})},"esri/views/3d/terrain/TileRenderData":function(){define(["require","exports","../lib/glMatrix","../support/aaBoundingBox"],function(r,h,f,a){var e=f.vec2d;return function(){function c(){this.overlayTexOffset=e.create();this.texOffset=e.create();this.geometryInfo={indices:null,vertexAttributes:null,boundingBox:a.create(a.NEGATIVE_INFINITY),numSurfaceIndices:0,numSkirtIndices:0,numWithoutSkirtIndices:0,numVertsPerRow:0}; this.init()}c.prototype.init=function(){var c=this.geometryInfo;c.indices=null;c.vertexAttributes=null;a.set(c.boundingBox,a.NEGATIVE_INFINITY);c.numSurfaceIndices=0;c.numSkirtIndices=0;c.numWithoutSkirtIndices=0;c.numVertsPerRow=0;this.textureReference=this.texture=this.vao=this.geometryState=null;e.set2(0,0,this.texOffset);this.texScale=1;this.highlightOverlayTexId=this.overlayTexId=null;this.overlayTexScale=[1,1];this.overlayOpacity=1;this.localOrigin=null};c.prototype.updateGeometryState=function(a){return this.geometryState= a.geometryState(this.geometryState)};c.prototype.estimateGeometryMemoryUsage=function(){var a=this.geometryInfo;return a.indices.byteLength+a.vertexAttributes.byteLength};return c}()})},"esri/views/3d/terrain/ResourceCounter":function(){define(["require","exports"],function(r,h){return function(){function f(){this._numTileTexturesComposited=0}Object.defineProperty(f.prototype,"numTileTexturesComposited",{get:function(){return this._numTileTexturesComposited},enumerable:!0,configurable:!0});f.prototype.incrementNumTileTexturesComposited= function(){this._numTileTexturesComposited++};f.prototype.resetNumTileTexturesComposited=function(){this._numTileTexturesComposited=0};return f}()})},"esri/views/3d/terrain/TileRenderer":function(){define("require exports ../lib/glMatrix ./TerrainConst ../webgl-engine/lib/DefaultVertexAttributeLocations ../webgl-engine/lib/DefaultVertexBufferLayouts ../../vectorTiles/tileRendererHelper3D ../../vectorTiles/VectorTileDisplayObject ../../webgl/BufferObject ../../webgl/FramebufferObject ../../webgl/Texture ../../webgl/Util ../../webgl/VertexArrayObject".split(" "), function(r,h,f,a,e,c,g,d,b,k,l,p,n){var t=f.vec2d,u=Array(20),q=[0,0];return function(){function f(a,d,f,g,h){this._gridTex=null;this.tileSize=256;this._context=a;this.tileSize=d;this._resourceCounter=g;this._setNeedsRender=h;a.capabilities.textureFilterAnisotropic&&(this._maxAnisotropy=Math.min(8,a.parameters.maxMaxAnisotropy));d=new Float32Array(20);d[0]=-1;d[1]=-1;d[2]=0;d[3]=0;d[4]=0;d[5]=1;d[6]=-1;d[7]=0;d[8]=1;d[9]=0;d[10]=-1;d[11]=1;d[12]=0;d[13]=0;d[14]=1;d[15]=1;d[16]=1;d[17]=0;d[18]=1;d[19]= 1;this._vaoQuad=new n(a,e.Default3D,{geometry:c.Pos3Tex},{geometry:b.createVertex(a,35044,d)});this._blendLayersProgram=f.get("blendLayers")}f.prototype.dispose=function(){this._fbo&&(this._fbo.dispose(),this._fbo=null);this._vaoQuad&&(this._vaoQuad.dispose(),this._vaoQuad=null);this._gridTex&&(this._gridTex.dispose(),this._gridTex=null);this._blendLayersProgram&&(this._blendLayersProgram.dispose(),this._blendLayersProgram=null);this._context&&(this._context=null)};f.prototype.updateTileTexture=function(b){for(var c= a.LayerClass.MAP,d=b.layerInfo[c],e=0;ek;k*=2)q[0]--,q[1]>>=1,q[2]>>=1;b={context:d,state:c,stationary:!0,pixelRatio:1,displayLevel:p.adjustLevel(n),requiredLevel:p.adjustLevel(b[0]),drawphase:0,renderer:h,layerOpacity:B,painter:null};if(t!==u)throw Error("It is expected that tiles are square!");n=1/v;B=p.getSchemaShift(q,n);k=B[1];e.tileTransform.displayCoord[0]=-1-2*n*r[0]-B[0];e.tileTransform.displayCoord[1]=1+2*n*(1-r[1]-v)+k;v=e.tileTransform.transform;a.identity(v);p.isWGS84&&512===p.lockedSchemaPixelSize&& (n*=2);0===m&&(n/=2);p=.25*n/t;g.set([p,-p,1]);a.scale(v,v,g);d.setBlendFunctionSeparate(1,771,1,771);d.setClearDepth(1);d.clear(d.gl.DEPTH_BUFFER_BIT);b.state.size=[t,u];b.state.width=t;b.state.height=u;h.setStateParams(b.state,b.pixelRatio,q[0]);e.attach(b);d.setFaceCullingEnabled(!1);d.setDepthFunction(515);d.setBlendingEnabled(!1);d.setDepthTestEnabled(!0);d.setDepthWriteEnabled(!0);e.processRender(b);d.setDepthWriteEnabled(!1);d.setBlendingEnabled(!0);b.drawphase=1;e.processRender(b);b.drawphase= 2;e.processRender(b);f("esri-vector-tiles-debug")&&h.renderTileInfo(d,e);d.setDepthWriteEnabled(!0);d.setDepthTestEnabled(!1);d.setFaceCullingEnabled(!0)}})},"esri/core/libs/gl-matrix/vec3":function(){define(["./common"],function(r){var h={create:function(){var f=new r.ARRAY_TYPE(3);f[0]=0;f[1]=0;f[2]=0;return f},clone:function(f){var a=new r.ARRAY_TYPE(3);a[0]=f[0];a[1]=f[1];a[2]=f[2];return a},fromValues:function(f,a,e){var c=new r.ARRAY_TYPE(3);c[0]=f;c[1]=a;c[2]=e;return c},copy:function(f,a){f[0]= a[0];f[1]=a[1];f[2]=a[2];return f},set:function(f,a,e,c){f[0]=a;f[1]=e;f[2]=c;return f},add:function(f,a,e){f[0]=a[0]+e[0];f[1]=a[1]+e[1];f[2]=a[2]+e[2];return f},subtract:function(f,a,e){f[0]=a[0]-e[0];f[1]=a[1]-e[1];f[2]=a[2]-e[2];return f}};h.sub=h.subtract;h.multiply=function(f,a,e){f[0]=a[0]*e[0];f[1]=a[1]*e[1];f[2]=a[2]*e[2];return f};h.mul=h.multiply;h.divide=function(f,a,e){f[0]=a[0]/e[0];f[1]=a[1]/e[1];f[2]=a[2]/e[2];return f};h.div=h.divide;h.ceil=function(f,a){f[0]=Math.ceil(a[0]);f[1]= Math.ceil(a[1]);f[2]=Math.ceil(a[2]);return f};h.floor=function(f,a){f[0]=Math.floor(a[0]);f[1]=Math.floor(a[1]);f[2]=Math.floor(a[2]);return f};h.min=function(f,a,e){f[0]=Math.min(a[0],e[0]);f[1]=Math.min(a[1],e[1]);f[2]=Math.min(a[2],e[2]);return f};h.max=function(f,a,e){f[0]=Math.max(a[0],e[0]);f[1]=Math.max(a[1],e[1]);f[2]=Math.max(a[2],e[2]);return f};h.round=function(f,a){f[0]=Math.round(a[0]);f[1]=Math.round(a[1]);f[2]=Math.round(a[2]);return f};h.scale=function(f,a,e){f[0]=a[0]*e;f[1]=a[1]* e;f[2]=a[2]*e;return f};h.scaleAndAdd=function(f,a,e,c){f[0]=a[0]+e[0]*c;f[1]=a[1]+e[1]*c;f[2]=a[2]+e[2]*c;return f};h.distance=function(f,a){var e=a[0]-f[0],c=a[1]-f[1];f=a[2]-f[2];return Math.sqrt(e*e+c*c+f*f)};h.dist=h.distance;h.squaredDistance=function(f,a){var e=a[0]-f[0],c=a[1]-f[1];f=a[2]-f[2];return e*e+c*c+f*f};h.sqrDist=h.squaredDistance;h.length=function(f){var a=f[0],e=f[1];f=f[2];return Math.sqrt(a*a+e*e+f*f)};h.len=h.length;h.squaredLength=function(f){var a=f[0],e=f[1];f=f[2];return a* a+e*e+f*f};h.sqrLen=h.squaredLength;h.negate=function(f,a){f[0]=-a[0];f[1]=-a[1];f[2]=-a[2];return f};h.inverse=function(f,a){f[0]=1/a[0];f[1]=1/a[1];f[2]=1/a[2];return f};h.normalize=function(f,a){var e=a[0],c=a[1],g=a[2],e=e*e+c*c+g*g;0=d.length?this._placeComponent(b,a,"last"):this._placeComponent(b, d[c],"before")):this._placeComponent(b,a,"last")};h.prototype._placeComponent=function(a,b,d){var e=a.widget;e&&!e._started&&"function"===typeof e.postMixInProperties&&"function"===typeof e.buildRendering&&"function"===typeof e.postCreate&&"function"===typeof e.startup&&a.widget.startup();c.place(a.node,b,d)};h.prototype._applyViewPadding=function(){var a=this.container;a&&g.set(a,this._toPxPosition(this._getViewPadding()))};h.prototype._applyUIPadding=function(){this._innerContainer&&g.set(this._innerContainer, this._toPxPosition(this.padding))};h.prototype._toPxPosition=function(a){return{top:this._toPxUnit(a.top),left:this._toPxUnit(a.left),right:this._toPxUnit(a.right),bottom:this._toPxUnit(a.bottom)}};h.prototype._toPxUnit=function(a){return 0===a?0:a+"px"};h.prototype._findByComponent=function(a){var b=null,c;this._components.some(function(d){(c=d===a)&&(b=d);return c});return b};h.prototype._findById=function(a){var b=null,c;this._components.some(function(d){(c=d.id===a)&&(b=d);return c});return b}; h.prototype._findByNode=function(a){var b=null,c;this._components.some(function(d){(c=d.node===a)&&(b=d);return c});return b};a([n.property()],h.prototype,"container",null);a([n.property({dependsOn:["view.height"]})],h.prototype,"height",null);a([n.property()],h.prototype,"padding",void 0);a([n.cast("padding")],h.prototype,"castPadding",null);a([n.property()],h.prototype,"view",void 0);a([n.property({dependsOn:["view.width"]})],h.prototype,"width",null);return h=a([n.subclass("esri.views.ui.UI")], h)}(n.declared(b,k))})},"esri/widgets/Attribution":function(){define("require exports ../core/tsSupport/declareExtendsHelper ../core/tsSupport/decorateHelper dojo/i18n!./Attribution/nls/Attribution ../core/watchUtils ../core/accessorSupport/decorators ./Widget ./Attribution/AttributionViewModel ./support/widget".split(" "),function(r,h,f,a,e,c,g,d,b,k){return function(d){function h(a){a=d.call(this)||this;a._isOpen=!1;a._attributionTextOverflowed=!1;a._prevSourceNodeHeight=0;a.iconClass="esri-icon-description"; a.itemDelimiter=" | ";a.label=e.widgetLabel;a.view=null;a.viewModel=new b;return a}f(h,d);h.prototype.postInitialize=function(){var a=this;this.own(c.on(this,"viewModel.items","change",function(){return a.scheduleRender()}))};Object.defineProperty(h.prototype,"attributionText",{get:function(){return this.viewModel.items.reduce(function(a,b){-1===a.indexOf(b.text)&&a.push(b.text);return a},[]).join(this.itemDelimiter)},enumerable:!0,configurable:!0});h.prototype.render=function(){var a=(b={},b["esri-attribution--open"]= this._isOpen,b);return k.tsx("div",{bind:this,class:"esri-attribution esri-widget",classes:a,onclick:this._toggleState,onkeydown:this._toggleState},this._renderSourcesNode(),k.tsx("div",{class:"esri-attribution__powered-by"},"Powered by ",k.tsx("a",{target:"_blank",href:"http://www.esri.com/",class:"esri-attribution__link"},"Esri")));var b};h.prototype._renderSourcesNode=function(){var a=this._isOpen,b=this._isInteractive(),c=this.attributionText,a=(d={},d["esri-attribution__sources--open"]=a,d["esri-interactive"]= b,d);return k.tsx("div",{afterCreate:this._afterSourcesNodeCreate,afterUpdate:this._afterSourcesNodeUpdate,bind:this,class:"esri-attribution__sources",classes:a,innerHTML:c,role:b?"button":void 0,tabIndex:b?0:-1});var d};h.prototype._afterSourcesNodeCreate=function(a){this._prevSourceNodeHeight=a.clientWidth};h.prototype._afterSourcesNodeUpdate=function(a){var b=!1,c=a.clientHeight;a=a.scrollWidth>=a.clientWidth;var d=this._attributionTextOverflowed!==a;this._attributionTextOverflowed=a;d&&(b=!0); this._isOpen&&(a=c=b)return"";a=a[b];var f=e.center.clone().normalize(),g={};return a.filter(function(a){var b= !g[a.id]&&a.extent.contains(f);b&&(g[a.id]=!0);return b}).sort(function(a,b){return b.score-a.score||a.objectId-b.objectId}).map(function(a){return a.attribution}).join(", ")};a([k.property({readOnly:!0,type:c})],h.prototype,"items",void 0);a([k.property({dependsOn:["view.ready"],readOnly:!0})],h.prototype,"state",null);a([k.property()],h.prototype,"view",void 0);return h=a([k.subclass("esri.widgets.Attribution.AttributionViewModel")],h)}(k.declared(e))})},"esri/widgets/Compass":function(){define("require exports ../core/tsSupport/declareExtendsHelper ../core/tsSupport/decorateHelper dojo/i18n!./Compass/nls/Compass ../core/accessorSupport/decorators ./Widget ./Compass/CompassViewModel ./support/widget".split(" "), function(r,h,f,a,e,c,g,d,b){return function(g){function h(a){a=g.call(this)||this;a.activeMode=null;a.iconClass="esri-icon-locate-circled";a.label=e.widgetLabel;a.modes=null;a.view=null;a.viewModel=new d;return a}f(h,g);h.prototype.reset=function(){};h.prototype.render=function(){var a=this.viewModel.orientation,c=this.viewModel.state,d="disabled"===c,f="compass"===("rotation"===c?"rotation":"compass"),c=(g={},g["esri-disabled"]=d,g["esri-compass--active"]="device-orientation"===this.viewModel.activeMode, g["esri-interactive"]=!d,g),g=(h={},h["esri-icon-compass"]=f,h["esri-icon-dial"]=!f,h);return b.tsx("div",{bind:this,class:"esri-compass esri-widget-button esri-widget",classes:c,onclick:this._start,onkeydown:this._start,role:"button",tabIndex:d?-1:0,"aria-label":e.reset,title:e.reset},b.tsx("span",{"aria-hidden":"true",class:"esri-compass__icon",classes:g,styles:this._toRotationTransform(a)}),b.tsx("span",{class:"esri-icon-font-fallback-text"},e.reset));var g,h};h.prototype._start=function(){var a= this.viewModel;a.nextMode();a.startMode()};h.prototype._toRotationTransform=function(a){return{transform:"rotateZ("+a.z+"deg)"}};a([c.aliasOf("viewModel.activeMode")],h.prototype,"activeMode",void 0);a([c.property()],h.prototype,"iconClass",void 0);a([c.property()],h.prototype,"label",void 0);a([c.aliasOf("viewModel.modes")],h.prototype,"modes",void 0);a([c.aliasOf("viewModel.view")],h.prototype,"view",void 0);a([c.property({type:d}),b.renderable(["viewModel.orientation","viewModel.state"])],h.prototype, "viewModel",void 0);a([c.aliasOf("viewModel.reset")],h.prototype,"reset",null);a([b.accessibleHandler()],h.prototype,"_start",null);return h=a([c.subclass("esri.widgets.Compass")],h)}(c.declared(g))})},"esri/widgets/Compass/CompassViewModel":function(){define("require exports ../../core/tsSupport/declareExtendsHelper ../../core/tsSupport/decorateHelper ../../core/Accessor ../../core/Handles ../../core/Logger ../../core/promiseUtils ../../core/watchUtils ../../core/accessorSupport/decorators".split(" "), function(r,h,f,a,e,c,g,d,b,k){var l=g.getLogger("esri.widgets.CompassViewModel");return function(e){function g(a){a=e.call(this,a)||this;a._handles=new c;a.canUseHeading=!1;a.orientation={x:0,y:0,z:0};a.view=null;a._updateForCamera=a._updateForCamera.bind(a);a._updateForRotation=a._updateForRotation.bind(a);a._updateRotationWatcher=a._updateRotationWatcher.bind(a);a._updateViewHeading=a._updateViewHeading.bind(a);a._checkHeadingSupport=a._checkHeadingSupport.bind(a);a._canUseHeading();return a}f(g, e);g.prototype.initialize=function(){this._handles.add(b.init(this,"view",this._updateRotationWatcher))};g.prototype.destroy=function(){this._removeCheckHeadingListener();this._removeOrientationListener();this._handles.destroy();this.view=this._handles=null};Object.defineProperty(g.prototype,"activeMode",{get:function(){var a=this._get("activeMode");return a?a:(a=this.modes)?a[0]:"none"},set:function(a){this.stopMode();this._set("activeMode",a);void 0===a&&this._clearOverride("activeMode")},enumerable:!0, configurable:!0});Object.defineProperty(g.prototype,"canShowNorth",{get:function(){var a=this.get("view.spatialReference");return a&&(a.isWebMercator||a.isWGS84)},enumerable:!0,configurable:!0});Object.defineProperty(g.prototype,"modes",{get:function(){return this._get("modes")||["reset"]},set:function(a){this._set("modes",a);void 0===a&&this._clearOverride("modes")},enumerable:!0,configurable:!0});Object.defineProperty(g.prototype,"state",{get:function(){return this.get("view.ready")?this.canShowNorth? "compass":"rotation":"disabled"},enumerable:!0,configurable:!0});g.prototype.previousMode=function(){var a=this.modes;2>a.length||(a=a.indexOf(this.activeMode),this._paginateMode(a-1))};g.prototype.nextMode=function(){var a=this.modes;2>a.length||(a=a.indexOf(this.activeMode),this._paginateMode(a+1))};g.prototype.startMode=function(){var a=this.activeMode;"reset"===a&&this.reset();"device-orientation"===a&&(this._removeOrientationListener(),this._addOrientationListener())};g.prototype.stopMode=function(){"device-orientation"=== this.activeMode&&this._removeOrientationListener()};g.prototype.reset=function(){if(this.get("view.ready")){var a={};"2d"===this.view.type?a.rotation=0:a.heading=0;this.view.goTo(a)}};g.prototype._supportsDeviceOrientation=function(){return"DeviceOrientationEvent"in window};g.prototype._paginateMode=function(a){var b=this.modes;this.activeMode=b[(a+b.length)%b.length]};g.prototype._supportsHeading=function(a){var b="number"===typeof a.webkitCompassHeading;return"number"===typeof a.compassHeading|| b||!1};g.prototype._getAccuracy=function(a){return a.compassAccuracy||a.webkitCompassAccuracy||0};g.prototype._getHeading=function(a){return a.webkitCompassHeading||a.compassHeading||void 0};g.prototype._removeCheckHeadingListener=function(){this._supportsDeviceOrientation()&&window.removeEventListener("deviceorientation",this._checkHeadingSupport)};g.prototype._checkHeadingSupport=function(a){this._supportsHeading(a)&&this._set("canUseHeading",!0);this._removeCheckHeadingListener()};g.prototype._canUseHeading= function(){var a=this;this._supportsDeviceOrientation()&&(window.addEventListener("deviceorientation",this._checkHeadingSupport),d.after(500).then(function(){a._removeCheckHeadingListener()}))};g.prototype._getHeadingAdjustment=function(a,b){if("orientation"in window){b=window.orientation;if("number"!==typeof b)return a;a+=b;return 360a?a+360:a}return a};g.prototype._updateViewHeading=function(a){var b=this.view,c=this._getHeading(a),d=this._getAccuracy(a);!b||!b.stationary||"number"!== typeof c||0>c||360c},enumerable:!0,configurable:!0});Object.defineProperty(d.prototype,"canZoomOut",{get:function(){var a=this.get("view.scale"),c=this.get("view.constraints.effectiveMinScale");return 0===c||athis._errorCount?J.error("Error during processing: "+Y):50===this._errorCount&&J.error("Too many errors for this layer. Further errors will not be displayed."),this._errorCount++}};d.prototype._process=function(a, b){this._restartNodeLoading&&(this.cancelNodeLoading(),this._startNodeLoading());if(null!=this._nodeLoader&&null!=this._indexLoader){this._updateViewData();var c=this._indexLoader.isLoading();this._processIndex()&&(b=!1);c||this._dirtyNodes?b=this._processNodes(a,b):this._unloadedMemoryEstimate=this._numUnloadedNodes=0;for(;0=d)return this._dirtyNodes=!0,!1;d=this._collectUpdates(d);d.cancel.forEach(this._cancelNodeIdLoading,this);d.update.forEach(function(d){if(b||!a.done())b=!1,c._updateLoadedNode(d.id)});d.add.forEach(function(d,e){if(b||!a.done())b=!1,c._loadNode(c.nodeIndex[e])}); this._dirtyNodes=0d,disableLod:this._alwaysLoadEverythingModeEnabled}); this._cameraDirty=!1;this.notifyChange("rootNodeVisible")};d.prototype._updateViewData=function(){if(this._cameraDirty&&this._indexLoader){var a=this.layerView.view,b=a.state.camera;this.camPos=F.vec3d.create(a.pointsOfInterest.renderPointOfView);this.screenSizeFactor=1/b.perPixelRatio;this._poi=this._calculatePointOfInterest(this._poi);this._viewportQueries.updateCamera(b);this._viewportQueries.updatePointOfInterest(this._poi);a=(this._lodFactorProperty&&this.layerView.view.get(this._lodFactorProperty)|| 1)*this._getLodMemoryFactor();this._viewportQueries.updateScreenSpaceErrorBias(a);this._indexLoader.progressiveLoadPenalty=10*this._viewportQueries.distCameraToPOI();this._indexLoader.requestReload();this._alwaysLoadEverythingModeEnabled||this._removeInvisibleNodes();this._cameraDirty=!1;this.notifyChange("rootNodeVisible")}};d.prototype._getProgressiveLoadFactor=function(a,b){return a instanceof x&&"mesh"===a.geometryType?(a=1<=b&&e("enable-feature:progressive-3dobject"))?.05:1:a instanceof v?(a= 1<=b&&!e("disable-feature:progressive-im"))?.2:1:1};d.prototype._getLodMemoryFactor=function(){return this.layerView.view.resourceController.getMemoryFactor()};d.prototype._getLodDropFactor=function(){return Math.min(this._getLodMemoryFactor(),.5)/.5};d.prototype._startNodeLoadingWhileSuspended=function(){this._initViewData();this._alwaysLoadEverythingModeEnabled&&this.layerView.visible&&!this.layerView.get("parent.suspended")||this._removeInvisibleNodes()};d.prototype.isGeometryVisible=function(a){return this._viewportQueries.isGeometryVisible(a)}; d.prototype._shouldLoadNode=function(a){if(!this._lodHandling.shouldLoadNode(a))return!1;var b=this._getLodDropFactor();return 0this._viewportQueries.maxDistance*b?!1:a.obb?this._viewportQueries.isGeometryVisible(a):!0};d.prototype._startNodeLoading=function(){var a=this;this._restartNodeLoading=!1;if(!this._updatesDisabled&&null!=this.streamDataSupplier){this._initViewData();null!=this.layerViewOptionalFunctions.getLoadedAttributes&& this._requiredAttributesDirty&&(this._requiredAttributes=this._getRequiredAttributes(),this._requiredAttributesDirty=!1,this._handles.add([this.layer.watch("renderer",function(){return a._requiredFieldsChange()}),this.layer.watch("definitionExpression",function(){return a._requiredFieldsChange()}),this.layer.watch("labelsVisible",function(){return a._labelingChanged()}),this.layer.watch("labelingInfo",function(){return a._labelingChanged()})],"requiredAttributes"));var b=this.layerViewOptionalFunctions.textureOptions, c=C.TextureFormat.Normal;b&&b.useCompressedTextures?c=C.TextureFormat.Compressed:this._uncompressedTextureDownsamplingEnabled&&(c=C.TextureFormat.Downsampled);b=this._defaultGeometrySchema;this._nodeLoader=new C(this.streamDataSupplier,J,b,this._requiredAttributes,{textureFormat:c,loadTextureData:this.layerView instanceof m&&this.layerView.rendererNeedsTextures,loadFeatureData:!this.isMeshPyramid||null==b||null==b.ordering});c=10*this._viewportQueries.distCameraToPOI();this._indexLoader=new B(this.getBaseUrl(), this._rootNodeUrl,this._rootNodeId,c,this.nodeIndex,this.streamDataSupplier,this._viewportQueries,J);this._alwaysLoadEverythingModeEnabled||this._removeInvisibleNodes();this._lodHandling.startNodeLoading(function(b){return a._viewportQueries.isNodeVisible(b)},function(b){return a._viewportQueries.isGeometryVisible(b)},function(b){return a._indexLoader.nodeTraversalState(b)},this.nodeIndex,this._rootNodeId,{maxLodLevel:this._viewportQueries.maxLodLevel});this.layerViewOptionalFunctions.additionalStartNodeLoadingHandler&& this.layerViewOptionalFunctions.additionalStartNodeLoadingHandler();this._evaluateUpdatingState()}};d.prototype.isNodeLoading=function(){return null!=this._nodeLoader&&null!=this._indexLoader};d.prototype.cancelNodeLoading=function(){this.isNodeLoading()&&(this._indexLoader.cancel(),this._nodeLoader.cancel(),this.streamDataSupplier.cancelAll(),this._idleQueue.cancelAll(),this._cancelNodeLoading(),this._poi=this._indexLoader=this._nodeLoader=null,this.layerViewOptionalFunctions.additionalCancelNodeLoadingHandler&& this.layerViewOptionalFunctions.additionalCancelNodeLoadingHandler(),this._evaluateUpdatingState())};d.prototype._removeInvisibleNodes=function(){for(var a=this.layerViewRequiredFunctions.getAddedNodeIDs(),b=this._getLodDropFactor(),c=this._viewportQueries.maxDistance*b,b=0c)this._lodHandling.setLodGlobalDirty(),this.layerViewRequiredFunctions.removeNodeData(e)}}; d.prototype._needsUpdate=function(a){if(null==a.featureData||0===a.featureData.length||this._updatingNodes.has(a.id))return!1;var b=this.layerViewOptionalFunctions.getLoadedAttributes;a=null!=b?b(a):void 0;return null!=a&&a!==this._requiredAttributes};d.prototype._updateLoadedNode=function(a){var b=this,d=this.nodeIndex[a],e=d.baseUrl,f=this.layerViewOptionalFunctions.getLoadedAttributes(d),e=M(f,this._requiredAttributes)?n.resolve(this.layerViewOptionalFunctions.getAttributeData(d)):this._nodeLoader.loadAttributes(d, e,this._requiredAttributes);this._updatingNodes.set(a,e);e.then(function(a){return b.schedule().then(function(){return b.layerViewOptionalFunctions.setAttributeData(d,b._requiredAttributes,a)})}).catch(function(a){a instanceof c||b.layerViewOptionalFunctions.setAttributeData(d,b._requiredAttributes,{})}).always(function(){b._updatingNodes.delete(a);b._evaluateUpdatingState()});this._evaluateUpdatingState()};d.prototype._loadNode=function(a){var b=this,c=new P.Promise;this._loadingNodes.set(a.id,c); this._evaluateUpdatingState();this._loadAndAddBundle(a).always(function(){b._loadingNodes.delete(a.id);b._evaluateUpdatingState();c.done()});return c};d.prototype._loadAndAddBundle=function(a){var b=this;1!==a.featureData.length&&J.warn("Node ${node.id} has ${node.featureData.length} bundles. Only the first bundle will be loaded.");return this._loadCached(a).then(function(c){if(!c)return b._loadUncached(a)}).catch(function(d){if(!(d instanceof c))return b._loadUncached(a)})};d.prototype._loadCached= function(a){var b=this,c=this.disableCache?null:this.layerViewOptionalFunctions.loadCachedBundle,d=this.disableCache?null:this.layerViewOptionalFunctions.addCachedBundle;return c&&d?this.schedule().then(function(){return c(a,function(a,c){return b._nodeLoader.loadTextures(a,c)})}).then(function(c){if(null==c)return!1;var e=b._requiredAttributes;return b.schedule().then(function(){return b._nodeLoader.loadAttributes(a,a.baseUrl,e)}).then(function(a){return b.schedule({loadedAttributes:e,attributeData:a})}).then(function(b){return d(a, c,b)}).then(function(){b._lodHandling.lodSwapBundleLoaded(a);return!0})}):n.resolve(!1)};d.prototype._loadUncached=function(a){var b=this;return this.schedule().then(function(){return b._nodeLoader.loadBundleData(a,0)}).then(function(a){return b.schedule(a)}).then(function(c){return b.layerViewRequiredFunctions.addBundle(a,c)}).then(function(){return b._lodHandling.lodSwapBundleLoaded(a)}).catch(function(b){b instanceof c||(J.error("Failed to load node '"+a.id+"' bundle 0: "+b),a.failed=!0)})};d.prototype._updateIdleState= function(a){a!==this._isIdle&&(this._isIdle=a,this._viewportQueries&&this._viewportQueries.setCameraIdle(!0),this._evaluateUpdatingState())};a([u.property({readOnly:!0})],d.prototype,"isMeshPyramid",null);a([u.property({readOnly:!0})],d.prototype,"streamDataSupplier",null);a([u.property({readOnly:!0,dependsOn:["layer.definitionExpression"]})],d.prototype,"parsedDefinitionExpression",null);a([u.property({readOnly:!0,dependsOn:["parsedDefinitionExpression"]})],d.prototype,"definitionExpressionFields", null);a([u.property({readOnly:!0})],d.prototype,"crsVertex",null);a([u.property({readOnly:!0})],d.prototype,"crsIndex",null);a([u.property({readOnly:!0})],d.prototype,"nodeIndex",void 0);a([u.property()],d.prototype,"camPos",void 0);a([u.property()],d.prototype,"screenSizeFactor",void 0);a([u.property()],d.prototype,"layerView",void 0);a([u.property()],d.prototype,"layerViewRequiredFunctions",void 0);a([u.property()],d.prototype,"layerViewOptionalFunctions",void 0);a([u.property()],d.prototype,"layer", void 0);a([u.property({readOnly:!0})],d.prototype,"updating",void 0);a([u.property({readOnly:!0})],d.prototype,"updatingPercentage",void 0);a([u.property({readOnly:!0})],d.prototype,"rootNodeVisible",null);return d=a([u.subclass("esri.layers.graphics.controllers.I3SOnDemandController")],d)}(u.declared(d,p,b))})},"esri/core/sql/WhereClause":function(){define(["require","exports","../../moment","./StandardizedFunctions","./WhereGrammar"],function(r,h,f,a,e){function c(a){return Array.isArray(a)?a:[a]} function g(a){return null!==a?!0!==a:null}function d(a,b){if(null==a)return null;for(var c=!1,d=0;dc;case "\x3c":return b=c;case "\x3c\x3d":return b<=c}}function p(a){for(var b=[],c={},d=0;d=h[0]&&n<=h[1];case "NOTBETWEEN":return n=this.evaluateNode(e.left,h),h=this.evaluateNode(e.right,h),null==n||null==h[0]||null==h[1]?null:nh[1];case "LIKE":return b(this.evaluateNode(e.left,h),this.evaluateNode(e.right,h),e.escape);case "NOT LIKE":return g(b(this.evaluateNode(e.left,h),this.evaluateNode(e.right,h),e.escape));case "\x3c\x3e":case "\x3c":case "\x3e":case "\x3e\x3d":case "\x3c\x3d":case "\x3d":return l(e.operator, this.evaluateNode(e.left,h),this.evaluateNode(e.right,h));case "*":return this.evaluateNode(e.left,h)*this.evaluateNode(e.right,h);case "-":return this.evaluateNode(e.left,h)-this.evaluateNode(e.right,h);case "+":return this.evaluateNode(e.left,h)+this.evaluateNode(e.right,h);case "/":return this.evaluateNode(e.left,h)/this.evaluateNode(e.right,h)}throw Error("Not Supported Operator "+e.operator);case "null":case "bool":case "string":case "number":return e.value;case "date":return f(e.value,["YYYY-M-D"]).toDate(); case "timestamp":return f(e.value,["YYYY-M-D H:m:s","YYYY-M-D H:mZ","YYYY-M-D H:m:sZ","YYYY-M-D H:m","YYYY-m-d"]).toDate();case "column_ref":return"CURRENT_DATE"===e.column.toUpperCase()?(t=new Date,t.setHours(0,0,0,0),t):"CURRENT_TIMESTAMP"===e.column.toUpperCase()?new Date:this.featureValue(h,e.column,e);case "function":return h=this.evaluateNode(e.args,h),a.evaluateFunction(e.name,h)}throw Error("Unsupported sql syntax "+e.type);};return h}()})},"esri/core/sql/StandardizedFunctions":function(){define(["require", "exports","dojo/regexp"],function(r,h,f){Object.defineProperty(h,"__esModule",{value:!0});h.evaluateFunction=function(e,c){var f=a[e.toLowerCase()];if(null==f)throw Error("Function Not Recognised");if(c.lengthf.maxParams)throw Error("Invalid Parameter count for call to "+e.toUpperCase());return f.evaluate(c)};h.isStandardized=function(e,c){e=a[e.toLowerCase()];return null!=e&&c>=e.minParams&&c<=e.maxParams};var a={extract:{minParams:2,maxParams:2,evaluate:function(a){var c= a[0];a=a[1];if(null==a)return null;if(a instanceof Date)switch(c.toUpperCase()){case "SECOND":return a.getSeconds();case "MINUTE":return a.getMinutes();case "HOUR":return a.getHours();case "DAY":return a.getDate();case "MONTH":return a.getMonth()+1;case "YEAR":return a.getFullYear()}throw Error("Invalid Parameter for call to EXTRACT");}},substring:{minParams:2,maxParams:3,evaluate:function(a){if(2===a.length){var c=a[0],e=a[1];return null==c||null==e?null:c.toString().substring(e-1)}if(3===a.length)return c= a[0],e=a[1],a=a[2],null==c||null==e||null==a?null:0>=a?"":c.toString().substring(e-1,e+a-1)}},position:{minParams:2,maxParams:2,evaluate:function(a){var c=a[0];a=a[1];return null==c||null==a?null:a.indexOf(c)+1}},trim:{minParams:2,maxParams:3,evaluate:function(a){var c=3===a.length,e=c?a[1]:" ",c=c?a[2]:a[1];if(null==e||null==c)return null;e="("+f.escapeString(e)+")";switch(a[0]){case "BOTH":return c.replace(new RegExp("^"+e+"*|"+e+"*$","g"),"");case "LEADING":return c.replace(new RegExp("^"+e+"*", "g"),"");case "TRAILING":return c.replace(new RegExp(e+"*$","g"),"")}throw Error("Invalid Parameter for call to TRIM");}},abs:{minParams:1,maxParams:1,evaluate:function(a){return null==a[0]?null:Math.abs(a[0])}},ceiling:{minParams:1,maxParams:1,evaluate:function(a){return null==a[0]?null:Math.ceil(a[0])}},floor:{minParams:1,maxParams:1,evaluate:function(a){return null==a[0]?null:Math.floor(a[0])}},log:{minParams:1,maxParams:1,evaluate:function(a){return null==a[0]?null:Math.log(a[0])}},log10:{minParams:1, maxParams:1,evaluate:function(a){return null==a[0]?null:Math.log(a[0])*Math.LOG10E}},sin:{minParams:1,maxParams:1,evaluate:function(a){return null==a[0]?null:Math.sin(a[0])}},cos:{minParams:1,maxParams:1,evaluate:function(a){return null==a[0]?null:Math.cos(a[0])}},tan:{minParams:1,maxParams:1,evaluate:function(a){return null==a[0]?null:Math.tan(a[0])}},asin:{minParams:1,maxParams:1,evaluate:function(a){return null==a[0]?null:Math.asin(a[0])}},acos:{minParams:1,maxParams:1,evaluate:function(a){return null== a[0]?null:Math.acos(a[0])}},atan:{minParams:1,maxParams:1,evaluate:function(a){return null==a[0]?null:Math.atan(a[0])}},sign:{minParams:1,maxParams:1,evaluate:function(a){return null==a[0]?null:0a[1]?-1:0}},power:{minParams:2,maxParams:2,evaluate:function(a){return null==a[0]||null==a[1]?null:Math.pow(a[0],a[1])}},mod:{minParams:2,maxParams:2,evaluate:function(a){return null==a[0]||null==a[1]?null:a[0]%a[1]}},round:{minParams:1,maxParams:2,evaluate:function(a){var c=a[0];a=2===a.length? Math.pow(10,a[1]):1;return null==c?null:Math.round(c*a)/a}},truncate:{minParams:1,maxParams:2,evaluate:function(a){return null==a[0]?null:1===a.length?parseInt(a[0].toFixed(0),10):parseFloat(a[0].toFixed(a[1]))}},char_length:{minParams:1,maxParams:1,evaluate:function(a){return"string"===typeof a[0]||a[0]instanceof String?a[0].length:0}},concat:{minParams:1,maxParams:Infinity,evaluate:function(a){for(var c="",e=0;eDa&&(Da=y,wb=[]),wb.push(a))}function b(){var a,b,c;a=y;b=T();b!==w?(b=l(),b!==w?(c=T(),c!==w?a=b:(y=a,a=w)):(y=a,a=w)):(y=a,a=w);return a}function k(){var a,b,c,d,e,f,g,h;a=y;b=l();if(b!==w){c=[];d=y;e=T();e!==w?(f=aa(),f!==w?(g=T(),g!==w?(h=l(),h!==w?d=e=[e,f,g,h]:(y=d,d=w)):(y=d,d=w)):(y=d,d=w)):(y=d,d=w);for(;d!==w;)c.push(d),d=y,e=T(),e!==w? (f=aa(),f!==w?(g=T(),g!==w?(h=l(),h!==w?d=e=[e,f,g,h]:(y=d,d=w)):(y=d,d=w)):(y=d,d=w)):(y=d,d=w);if(c!==w){a={type:"expr_list"};b=[b];for(d=0;dthis.gpuMemoryEstimate&&(this.texMemoryEstimate=this.gpuMemoryEstimate=0)};p.prototype.memEstimateGeometryAdded=function(a){a=a.estimateGpuMemoryUsage()/1048576;this.gpuMemoryEstimate+=a;this.geoMemoryEstimate+=a;return a};p.prototype.memEstimateGeometryRemoved= function(a){a=a.estimateGpuMemoryUsage()/1048576;this.gpuMemoryEstimate-=a;this.geoMemoryEstimate-=a;9.5367431640625E-7>this.gpuMemoryEstimate&&(this.texMemoryEstimate=this.gpuMemoryEstimate=0)};p.prototype._isBundleLoaded=function(a){return this._nodeId2Meta.has(a.id)};p.prototype._initGraphicsController=function(){var a=this;this.layer.createGraphicsController({layerView:this,layerViewRequiredFunctions:{addBundle:function(b,c){return a._addBundle(b,c)},isBundleLoaded:function(b){return a._isBundleLoaded(b)}, getMemoryUsage:function(){return a.view.resourceController.getUsedMemory()},removeNodeData:function(b){return a._removeNodeDataFromStage(b.id)},getAddedNodeIDs:function(){return a._getAddedNodeIDs()}},layerViewOptionalFunctions:{setPolygonOffset:function(b,c){return a._setPolygonOffset(b,c?!0:!1)},textureOptions:{useCompressedTextures:this._useCompressedTextures},getLoadedAttributes:function(b){return a._getLoadedAttributes(b)},getAttributeData:function(b){return a._getAttributeData(b)},setAttributeData:function(b, c,d){return a._setAttributeData(b,c,d)},additionalCancelNodeLoadingHandler:function(){return a._cancel()},loadCachedBundle:function(b,c){return a._loadCachedBundle(b,c)},addCachedBundle:function(b,c,d){return a._addCachedBundle(b,c,d)}}}).then(function(b){a._controller=b;b.watch("rootNodeVisible",function(){a.notifyChange("suspended")})}).always(function(){a._controllerCreated=!0;a.notifyChange("updating")})};p.prototype.getUsedMemory=function(){return this.gpuMemoryEstimate};p.prototype.getUnloadedMemory= function(){return this._controller?this._controller.getUnloadedMemoryEstimate():0};p.prototype.removeCachedData=function(){this._removeAllNodeDataFromStage()};p.prototype.setVisibility=function(a){var b=this;this._nodeId2Meta.forEach(function(c){c=c.engineObject;c.setHidden(c.geometryRecords[0],!a);b._edgeView&&b._edgeView.updateObjectVisibility(c,a)});if(a){var c=this._isIntegratedMesh()?"im":"scene";this.view.elevationProvider.register(c,this._elevationProvider);this.visibleGeometryChanged()}else this.visibleGeometryChanged(), this.view.elevationProvider.unregister(this._elevationProvider)};p.prototype.getStats=function(){var a={nodesInIndex:0,knownFeatures:0,activeMaterials:0,"Total GPU Memory Estimate":this.gpuMemoryEstimate+"MB","Geometry Memory Estimate":this.geoMemoryEstimate+"MB","Texture Memory Estimate":this.texMemoryEstimate+"MB"};if(!this._controller)return a;a.nodesInIndex=Object.keys(this._controller.nodeIndex).length;return a};p.prototype._addThisLayerToStage=function(){for(var a=this._stage,b=new Uint8Array(256), c=0;ce||1>d||a&&l.endsWith(a.channels,"a")||!0===b.useVertexColorAlpha||c;return{opacity:e,layerOpacity:d,transparent:a}};p.prototype._calcEngineMaterialDoubleSidedParams=function(a){return null!=a.doubleSided?a.doubleSided:!0};p.prototype._calcEngineMaterialCullFaceParams=function(a){return a.cullFace?a.cullFace: null!=a.doubleSided?a.doubleSided?"none":"back":"none"};p.prototype._getMaterialParameters=function(a,b,d,e){var f;null!=a&&(f=(f=this._texId2Meta.get(b))&&f.engineTex?f.engineTex.id:this._whiteTexture.id);b=d.params;var g=Z.fallbackIfUndefined(b.diffuse,w);"standard"!==d.type&&ia.warn("Unknown material type '"+d.type+"', must be 'standard'");d=this._isIntegratedMesh();e={ambient:g,diffuse:g,specular:Z.fallbackIfUndefined(b.specular,ra),atlasRegions:b.vertexRegions,textureId:f,vertexColors:this._hasVertexColors(), componentIndices:this._hasSymbolColors(),componentColorBuffer:this._hasSymbolColors()&&e?e.textureBuffer:null,flipV:!1,doubleSided:this._calcEngineMaterialDoubleSidedParams(b),cullFace:this._calcEngineMaterialCullFaceParams(b),writeStencil:d,receiveSSAO:!d,groundNormalShading:d,compressedNormals:!d};d||(a=this._calcEngineMaterialTransparencyParams(a,b),c.mixin(e,a));return e};p.prototype._createEngineMaterial=function(a,b,c,d,e,f,g){var h=null!=b?this._getI3STexEncoding(b):null;g=this._getMaterialParameters(b, c,d,g);g=new ja(g,e);g.metadata={i3sMatId:e,i3sTexId:c,i3sTex:b,i3sMatParams:d.params};if(null!=b){(d=this._texId2Meta.get(c))?d.usedByEngineMats.push(g):(d={id:c,usedByEngineMats:[g],images:b.images,encoding:h,atlas:!0===b.atlas,wrap:"none"!==b.wrap[0]||"none"!==b.wrap[1]},this._texId2Meta.set(c,d));a:{for(b=0;b=d.length||d[a]!==g?c.setComponentVisibility(e,f,!1):a++}}};p.prototype._removeAllNodeDataFromStage=function(){var a=this;this._nodeId2Meta.forEach(function(b,c){a._removeNodeDataFromStage(c)})};p.prototype._removeNodeDataFromStage=function(a){var b=this._nodeId2Meta.get(a);if(b){var c=this._stage,d=this._stageLayer,e=b.engineObject;this._highlights.objectDeleted(e);this._edgeView&&this._edgeView.removeObject(e);this.visibleGeometryChanged(e);d.removeObject(e);for(var d= 0,f=e.getGeometryRecords();dq[3]&&(h=!0),O.encodeSymbolColor(q,l.colorMixMode,k)):O.encodeSymbolColor(null,null,k);a.componentColorBuffer.textureBuffer.setData(a.componentIndices[p],k[0],k[1],k[2],k[3])}this._updateObjectOpacity(a.engineObject, h)}};p.prototype._setComponentIndices=function(a,b){for(var c=a.getAttribute(Z.VertexAttrConstants.COMPONENTINDEX),d=c.data,e=c.offsetIdx,c=c.strideIdx,f=a.getIndices(Z.VertexAttrConstants.COMPONENTINDEX),g=0;gd;++d)wa[0]=d&1?a[0]:a[3],wa[1]=d&2?a[1]:a[4],wa[2]=d&4?a[2]:a[5],X.mat4d.multiplyVec3(b.objectTransformation,wa),c[3*d]=wa[0],c[3*d+1]=wa[1],c[3*d+2]=wa[2];return c};p.prototype.highlight=function(a,b){var c=this,e=this._highlights;if(a instanceof E){b=e.acquireSet(b);var f=b.set,g=b.handle;this.queryObjectIds(a).then(function(a){return e.setFeatureIds(f,a)});return g}if("number"===typeof a||a instanceof d)return this.highlight([a],b);a instanceof k&&(a=a.toArray());if(Array.isArray(a)&& 0S.uniqueCount?new Uint16Array(S.indices):S.indices,v.push({layout:O,interleavedVertexData:S.buffer,indices:N,corMatrices:Y,hasNonWhiteColors:r}),h&&(h.push(S.buffer),h.push(N.buffer))):(v.push({layout:O,interleavedVertexData:N,corMatrices:Y,hasNonWhiteColors:r}),h&&h.push(N))}x&&(g.mat4d.multiplyVec3(F,x.center,x.center),k.vectorToVector(x.center,t,x.center,q),x.center[2]-=f.elevationOffset);return{geometryBuffer:f.geometryBuffer,transformedGeometries:v, obb:x?x:f.obb}};h.prototype._hasNonWhiteColors=function(a){var b=a.data,c=a.size,d=a.strideIdx;for(a=a.offsetIdx;a=b[f+1]&&f++,c[a]=f,a+=d};h.prototype._updateObb=function(a,c,d){if(0x;x++)B=q+k*b[r+x],p[B]=c.encodeInt16(d[0]),p[B+1]=c.encodeInt16(d[1])}}else if(b=f.createTypedView(d,b.params.vertexAttributes.normal),d=h.normals,B="earth-centered"===a?g:null,a=b.length/3,h=d.data,g=d.offsetIdx,d=d.strideIdx,null!=B)for(m=B[0],n=B[1],l=B[2],p=B[4],q=B[5],k=B[6],r=B[8],x=B[9],B=B[10],H=0;Hc.uniqueCount;if(d)for(e=new (b?Uint16Array:Uint32Array)(d.length),b=0;bg)e+=String.fromCharCode(g),f++;else if(192<=g&&224>g){if(f+1>=d)throw new a("utf8-decode-error","UTF-8 Decode failed. Two byte character was truncated.");var h=b[c+f+1],g=(g&31)<<6|h&63,e=e+String.fromCharCode(g),f=f+2}else if(224<=g&&240>g){if(f+2>=d)throw new a("utf8-decode-error","UTF-8 Decode failed. Multi byte character was truncated.");var h=b[c+f+1],k=b[c+f+2],g=(g&15)<<12|(h&63)<<6|k&63,e=e+String.fromCharCode(g),f=f+3}else if(240<=g&&248>g){if(f+ 3>=d)throw new a("utf8-decode-error","UTF-8 Decode failed. Multi byte character was truncated.");h=b[c+f+1];k=b[c+f+2];g=(g&7)<<18|(h&63)<<12|(k&63)<<6|b[c+f+3]&63;e=65536<=g?e+String.fromCharCode((g-65536>>10)+55296,(g&1023)+56320):e+String.fromCharCode(g);f+=4}else throw new a("utf8-decode-error","UTF-8 Decode failed. Invalid multi byte sequence.");}return e}function d(a,b){for(var c={byteOffset:0,byteCount:0,fields:Object.create(null)},d=0,e=0;e>6,e=0;if(0===k)e=d.getUint32(1,!0),b+=5;else if(1=== k)e=d.getUint16(1,!0),b+=3;else if(2===k)e=d.getUint8(1),b+=2;else throw new f("lepcc-decode-error","Bad count type");if(h)throw new f("lepcc-decode-error","LUT not implemented");a=new Uint8Array(a,b,Math.ceil(e*g/8));for(var k=h=d=0,q=-1>>>32-g,r=0;r>>=g;h-=g;32>8-h)}return b+k}Object.defineProperty(h,"__esModule",{value:!0});var g={identifierOffset:0,identifierLength:10,versionOffset:10,checksumOffset:12,byteCount:16};h.decodeXYZ= function(c){var b,d,h,p,n,t,r,q,v,x,m,B,z=new DataView(c,0),C=0;p=a(c,z,C);h=p.identifier;p=p.version;C+=g.byteCount;if("LEPCC "!==h)throw new f("lepcc-decode-error","Bad identifier");if(1=n&&1===t){if(q+3!==c.byteLength||1!==h)throw new f("lepcc-decode-error","Bad count");h=r.getUint8(q);b=r.getUint8(q+1);r=r.getUint8(q+2);q=new Uint8Array(3*e);for(c=0;ca?1:e<-a?-1:0}function d(a,b){k.conjugate(a.quaternion,p);k.multiplyVec3(p,b,n);a=a.halfSize;return Math.abs(n[0]*a[0])+Math.abs(n[1]*a[1])+Math.abs(n[2]*a[2])}function b(a,b){return b[0]*a[0]+b[1]*a[1]+b[2]*a[2]+b[3]}Object.defineProperty(h, "__esModule",{value:!0});var k=f.quat4,l=f.vec3;r=f.mat3d;var p=k.create(),n=l.create(),t=l.create(),u=r.create();r=function(){return function(a){this.buffer=new ArrayBuffer(56*a);this.obbs=Array(a);for(var b=0;b=g(a,b[0])&&0>=g(a,b[1])&&0>=g(a,b[2])&&0>=g(a,b[3])&&0>=g(a,b[4])&&0>=g(a,b[5])};h.intersectLine=function(a,b,c,d){void 0===d&&(d=0);k.conjugate(a.quaternion, p);f.vec3.subtract(b,a.center,n);b=k.multiplyVec3(p,n,n);c=k.multiplyVec3(p,c,t);for(var e=-Infinity,g=Infinity,h=0;3>h;h++)if(1E-6a.halfSize[h]+d||b[h]<-a.halfSize[h]-d)return!1;return e<=g}})},"esri/views/3d/support/dito":function(){define(["require","exports","../lib/glMatrix"],function(r,h,f){function a(a,c,d,g,h,k){if(!(1E-6>f.vec3d.length2(c)))for(f.vec3d.cross(d, c,C),f.vec3d.cross(g,c,A),f.vec3d.cross(h,c,D),e(a,c,z),F[1]=z[0],E[1]=z[1],I[1]=E[1]-F[1],d=[d,g,h],g=[C,A,D],h=0;3>h;++h){e(a,d[h],z);F[0]=z[0];E[0]=z[1];e(a,g[h],z);F[2]=z[0];E[2]=z[1];I[0]=E[0]-F[0];I[2]=E[2]-F[2];var l=b(I);l=r)){var A=new X(e);f.vec3d.add(A.minProj,A.maxProj,k);f.vec3d.scale(k,.5);f.vec3d.subtract(A.maxProj,A.minProj,l);var C=b(l),D=new Q;D.quality=C;14>r&&(e={data:new Float64Array(A.buffer, 112,42),size:3,offsetIdx:0,strideIdx:3});var E=f.vec3d.create(),F=f.vec3d.create(),K=f.vec3d.create(),r=f.vec3d.create(),L=f.vec3d.create(),S=f.vec3d.create(),I=f.vec3d.create(),R;R=e;for(var Y=f.vec3d.dist2(A.maxVert[0],A.minVert[0]),T=0,ha=1;7>ha;++ha){var ia=f.vec3d.dist2(A.maxVert[ha],A.minVert[ha]);ia>Y&&(Y=ia,T=ha)}f.vec3d.set(A.minVert[T],E);f.vec3d.set(A.maxVert[T],F);if(1E-6>f.vec3d.dist2(E,F))R=1;else{f.vec3d.subtract(E,F,r);f.vec3d.normalize(r);A=R.data;Y=R.strideIdx;T=Number.NEGATIVE_INFINITY; ha=0;for(ia=R.offsetIdx;iaT&&(T=la,ha=ia)}f.vec3d.set3(A[ha],A[ha+1],A[ha+2],K);1E-6>T?R=2:(f.vec3d.subtract(F,K,L),f.vec3d.normalize(L),f.vec3d.subtract(K,E,S),f.vec3d.normalize(S),f.vec3d.cross(L,r,I),f.vec3d.normalize(I),a(R,I,r,L,S,D),R=0)}switch(R){case 1:c(k,l,h);return;case 2:C=e;f.vec3d.set(r,G);Math.abs(r[0])>Math.abs(r[1])&&Math.abs(r[0])> Math.abs(r[2])?G[0]=0:Math.abs(r[1])>Math.abs(r[2])?G[1]=0:G[2]=0;1E-6>f.vec3d.length2(G)&&(G[0]=G[1]=G[2]=1);f.vec3d.cross(r,G,M);f.vec3d.normalize(M);f.vec3d.cross(r,M,H);f.vec3d.normalize(H);g(C,r,M,H,J,O);f.vec3d.subtract(O,J,N);d(r,M,H,J,O,N,h);return}R=e;A=p;Y=n;T=z;ha=R.data;la=R.offsetIdx;ia=R.strideIdx;f.vec3d.set3(ha[la],ha[la+1],ha[la+2],Y);f.vec3d.set(Y,A);T[0]=f.vec3d.dot(P,I);T[1]=T[0];for(la+=ia;laT[1]&&(T[1]=w,f.vec3d.set(P,A));I=f.vec3.dot(E,I);z[1]-1E-6<=I&&(A[0]=void 0);z[0]+1E-6>=I&&(Y[0]=void 0);void 0!==p[0]&&(f.vec3d.subtract(p,E,t),f.vec3d.normalize(t),f.vec3d.subtract(p,F,u),f.vec3d.normalize(u),f.vec3d.subtract(p,K,q),f.vec3d.normalize(q),f.vec3d.cross(u,r,v),f.vec3d.normalize(v),f.vec3d.cross(q,L,x),f.vec3d.normalize(x),f.vec3d.cross(t,S,m),f.vec3d.normalize(m),a(R,v,r,u,t,D),a(R,x,L,q,u,D),a(R,m,S,t,q,D));void 0!==n[0]&&(f.vec3d.subtract(n,E,t),f.vec3d.normalize(t), f.vec3d.subtract(n,F,u),f.vec3d.normalize(u),f.vec3d.subtract(n,K,q),f.vec3d.normalize(q),f.vec3d.cross(u,r,v),f.vec3d.normalize(v),f.vec3d.cross(q,L,x),f.vec3d.normalize(x),f.vec3d.cross(t,S,m),f.vec3d.normalize(m),a(R,v,r,u,t,D),a(R,x,L,q,u,D),a(R,m,S,t,q,D));g(e,D.b0,D.b1,D.b2,J,O);e=f.vec3d.create();f.vec3d.subtract(O,J,e);D.quality=b(e);D.qualitythis.minVert.length;)this.minVert.push(new Float64Array(this.buffer,b,3)),b+=24;for(;7>this.maxVert.length;)this.maxVert.push(new Float64Array(this.buffer,b,3)),b+=24;for(b=0;7>b;++b)this.minProj[b]=Number.POSITIVE_INFINITY,this.maxProj[b]=Number.NEGATIVE_INFINITY;for(var c=[],d=[],e=a.data,g=a.strideIdx,b=a.offsetIdx;bthis.maxProj[0]&&(this.maxProj[0]=a,d[0]= b),a=e[b+1],athis.maxProj[1]&&(this.maxProj[1]=a,d[1]=b),a=e[b+2],athis.maxProj[2]&&(this.maxProj[2]=a,d[2]=b),a=e[b]+e[b+1]+e[b+2],athis.maxProj[3]&&(this.maxProj[3]=a,d[3]=b),a=e[b]+e[b+1]-e[b+2],athis.maxProj[4]&&(this.maxProj[4]=a,d[4]=b),a=e[b]-e[b+1]+e[b+2],athis.maxProj[5]&& (this.maxProj[5]=a,d[5]=b),a=e[b]-e[b+1]-e[b+2],athis.maxProj[6]&&(this.maxProj[6]=a,d[6]=b);for(b=0;7>b;++b)a=c[b],f.vec3d.set3(e[a],e[a+1],e[a+2],this.minVert[b]),a=d[b],f.vec3d.set3(e[a],e[a+1],e[a+2],this.maxVert[b])}}(),Q=function(){return function(){this.b0=f.vec3d.createFrom(1,0,0);this.b1=f.vec3d.createFrom(0,1,0);this.b2=f.vec3d.createFrom(0,0,1);this.quality=0}}()})},"esri/views/3d/layers/i3s/Highlights":function(){define(["require","exports", "../../webgl-engine/lib/HighlightSet"],function(r,h,f){var a=function(){return function(a){this.highlightSet=new f;this.ids=new Set;this.options=a}}();return function(){function e(a){this.highlights=[];this.layerView=a}e.prototype.destroy=function(){this.highlights.forEach(function(a){return a.highlightSet.removeAll()});this.highlights=null};e.prototype.acquireSet=function(c){var e=this,d=new a(c);this.highlights.push(d);return{set:d,handle:{remove:function(){return e.releaseSet(d)}}}};e.prototype.releaseSet= function(a){a.highlightSet.removeAll();a=this.highlights?this.highlights.indexOf(a):-1;-1!==a&&this.highlights.splice(a,1)};e.prototype.setFeatureIds=function(a,e){e.forEach(function(c){return a.ids.add(c)});this.layerView._forAllFeatures(function(c,b,e,f){a.ids.has(c)&&(c=e.engineObject.setComponentHighlight(f,b,a.options),a.highlightSet.addObject(e.engineObject,c))},null,!0)};e.prototype.objectCreated=function(a){var c=this;this.highlights.forEach(function(d){c.layerView._forAllFeaturesOfNode(c.layerView._getMetadata(a), function(b,c,e,f){d.ids.has(b)&&(b=a.setComponentHighlight(f,c,d.options),d.highlightSet.addObject(a,b))},!0)})};e.prototype.objectDeleted=function(a){this.highlights.forEach(function(c){c.highlightSet.removeObject(a)})};e.prototype.allObjectsDeleted=function(){this.highlights.forEach(function(a){return a.highlightSet.removeAll()})};return e}()})},"esri/views/3d/webgl-engine/lib/HighlightSet":function(){define(["require","exports"],function(r,h){return function(){function f(){this.items=[]}f.prototype.addObject= function(a,e){this.items.push({type:"object",highlightId:e,object:a})};f.prototype.addRenderGeometry=function(a,e,c){this.items.push({type:"renderGeometry",highlightId:c,renderGeometry:a,renderer:e})};f.prototype.removeObject=function(a){for(var e=this.items.length-1;0<=e;--e){var c=this.items[e];"object"===c.type&&c.object===a&&(c.object.removeHighlights(c.highlightId),this.items.splice(e,1))}};f.prototype.removeRenderGeometry=function(a){for(var e=this.items.length-1;0<=e;--e){var c=this.items[e]; "renderGeometry"===c.type&&c.renderGeometry===a&&(c.renderer.removeRenderGeometryHighlight(c.renderGeometry,c.highlightId),this.items.splice(e,1))}};f.prototype.removeAll=function(){this.items.forEach(function(a){"object"===a.type?a.object.removeHighlights(a.highlightId):"renderGeometry"===a.type&&a.renderer.removeRenderGeometryHighlight(a.renderGeometry,a.highlightId)});this.items=[]};return f}()})},"esri/views/3d/layers/i3s/I3SElevationProvider":function(){define("require exports ../../../../core/tsSupport/declareExtendsHelper ../../../../core/tsSupport/decorateHelper ../../../../core/Accessor ../../../../core/Logger ../../../../core/accessorSupport/decorators ../../../../geometry/Point ../../lib/glMatrix ../../support/aaBoundingRect ../../support/Evented ../../webgl-engine/lib/Selector".split(" "), function(r,h,f,a,e,c,g,d,b,k,l,p){var n=k.create(k.NEGATIVE_INFINITY),t={spatialReference:null,extent:n},u=b.vec3d.create(),q=b.vec3d.create(),v=b.vec3d.create(),x=c.getLogger("esri.views.3d.layers.i3s.I3SElevationProvider");return function(c){function e(a){return c.call(this)||this}f(e,c);e.prototype.initialize=function(){this.renderCoordsHelper=this.layerView.view.renderCoordsHelper;this.intersectLayers=[this.stageLayer];this.selector=new p(this.layerView.view.viewingMode);var a=this.layerView.layer.fullExtent; this.zmin=a.zmin;this.zmax=a.zmax};e.prototype.getElevation=function(a){if(a instanceof d){if(!this.renderCoordsHelper.toRenderCoords(a,u))return x.error("could not project point for elevation alignment"),-Infinity}else if(!this.renderCoordsHelper.toRenderCoords(a,this.spatialReference,u))return x.error("could not project point for elevation alignment"),-Infinity;var c=this.layerView.elevationOffset;a=this.zmin+c;c=this.zmax+c;b.vec3d.set(u,q);b.vec3d.set(u,v);this.renderCoordsHelper.setAltitude(c, q);this.renderCoordsHelper.setAltitude(a,v);this.selector.init(this.intersectLayers,q,v,null,null,1,!1);return this.selector.getMinResult().getIntersectionPoint(u)?this.renderCoordsHelper.getAltitude(u):-Infinity};e.prototype.layerChanged=function(){this.spatialReference&&(t.extent=this.computeLayerExtent(this.intersectLayers[0]),t.spatialReference=this.spatialReference,this.emit("elevation-change",t))};e.prototype.objectChanged=function(a){this.spatialReference&&(t.extent=this.computeObjectExtent(a), t.spatialReference=this.spatialReference,this.emit("elevation-change",t))};e.prototype.computeObjectExtent=function(a){k.set(n,k.NEGATIVE_INFINITY);this.expandExtent(a,n);return n};e.prototype.computeLayerExtent=function(a){k.set(n,k.NEGATIVE_INFINITY);var b=0;for(a=a.getObjects();bf;++f)u[0]=f&1?d[0]:e[0],u[1]=f&2?d[1]:e[1],u[2]=f&4?d[2]:e[2],b.mat4d.multiplyVec3(a.objectTransformation, u),this.renderCoordsHelper.fromRenderCoords(u,u,this.spatialReference),k.expand(c,u);return c};a([g.property({constructOnly:!0})],e.prototype,"layerView",void 0);a([g.property({constructOnly:!0})],e.prototype,"stageLayer",void 0);a([g.property({readOnly:!0,aliasOf:"layerView.view.elevationProvider.spatialReference"})],e.prototype,"spatialReference",void 0);return e=a([g.subclass("esri.views.3d.layers.i3s.I3SElevationProvider")],e)}(g.declared(e,l.Evented))})},"esri/views/3d/layers/i3s/I3SQueryEngine":function(){define("require exports dojo/promise/all ../../../../core/Error ../../../../core/promiseUtils ../../../../tasks/support/FeatureSet".split(" "), function(r,h,f,a,e,c){return function(){function g(a,b){this._support=a;this._options=b}g.prototype.queryExtent=function(a){var b=this;return this._rejectUnsupported(a).then(function(){var c=0,d=b._support.createExtentBuilder();b._forAllQueried(a,function(a){c++;d.add(a)});return{count:c,extent:0===c?null:d.getExtent()}})};g.prototype.queryFeatureCount=function(a){var b=this;return this._rejectUnsupported(a).then(function(){var c=0;b._forAllQueried(a,function(){return c++});return c})};g.prototype.queryFeatures= function(d){var b=this;return this._rejectUnsupported(d).then(function(){var c=[],g=d&&d.outFields,h=[];if(0= g)return--g,!1;if(0a[3]&&(g=c-a[3],f+=g*g);d>a[4]&&(g=d-a[4],f+=g*g);e>a[5]&& (g=e-a[5],f+=g*g);if(f>b*b)return 0;if(0b?2:1}function x(a,b,c){var d=[],e=c&&c.missingFields;c=c&&c.originalFields;for(var f=0;fc.maxRecordCount){var g=E(d,c.maxRecordCount);return e.all(g.map(function(a){return C(c,a,f)})).then(F)}g=new k({objectIds:d,outFields:f,orderByFields:[c.objectIdField]});return(new b(c.parsedUrl.path)).execute(g).then(function(b){return b&&b.features&&b.features.length===d.length?b.features.map(function(a){return a.attributes}):e.reject(new a("scenelayer:feature-not-in-associated-layer","Feature not found in associated feature layer"))})}function A(b,d,g,h,k){for(var m=[],n=0;nb;)c()};var H=p.vec4d.create();h.intersectBoundingBoxWithMbs=v;h.findFieldsCaseInsensitive=x;h.whenGraphicAttributes=function(b,c,d,f,g,h){var k= !0===(h&&h.populateObjectId),l=h.ignoreUnavailableFields?void 0:[],n=1===f.length&&"*"===f[0];!n&&k&&(f=m(f,d));f=n?f:x(f,b.fields,{missingFields:l});if(l&&0!==l.length)return e.reject(new a("scenelayer:unknown-fields","This scene layer does not have the requested fields",{unknownFields:l}));if(0===c.length)return e.resolve(c);var k=b.associatedLayer,l=b.attributeStorageInfo,p=n?b.fields.map(function(a){return a.name}):f;if(k)return B(k,c,d,p);b=z(p,c[0]);return 0===b.length?e.resolve(c):l?(g=g(), null==g?e.reject(new a("scenelayer:feature-not-loaded","Tried to query attributes for unloaded features")):A(l,g.node,g.indices,b,h).then(function(a){for(var b=0;bd._gcCounter&&(d._gcCounter=d.gcFrequency, d._getCacheSize().then(function(a){return d._removeLeastRecentlyAccessed(a-d.maxByteSize)}))})};g.prototype.get=function(d){var b=this;return null==this._db?a.resolve(null):a.resolve().then(function(){var a=b._db.transaction(b._storeName,"readonly").objectStore(b._storeName).get(d);return c(a)}).then(function(a){null!=a&&b._db.transaction("last_access","readwrite").objectStore("last_access").put({date:(new Date).getTime(),byteSize:a.byteSize},d);return a}).catch(function(a){return null})};g.prototype.remove= function(c){var b=this;return null==this._db?a.resolve():a.resolve().then(function(){var a=b._db.transaction([b._storeName,"last_access"],"readwrite"),d=a.objectStore(b._storeName),f=a.objectStore("last_access");d.delete(c);f.delete(c);return e(a)})};g.prototype._put=function(a,b){var c=this._db.transaction([this._storeName,"last_access"],"readwrite");c.objectStore(this._storeName).put(b,a);c.objectStore("last_access").put({date:(new Date).getTime(),byteSize:b.byteSize},a);return e(c)};g.prototype._removeLeastRecentlyAccessed= function(a){if(!(0>=a)){var b=this._db.transaction([this._storeName,"last_access"],"readwrite"),c=b.objectStore(this._storeName),d=b.objectStore("last_access"),f=0,g=d.index("date").openCursor(null,"next");g.onsuccess=function(b){b=g.result;null!=b&&(null!=b.value.byteSize&&(f+=b.value.byteSize),c.delete(b.primaryKey),d.delete(b.primaryKey),ff;if(c)return c.lodLevel=g,c.isChosen=f,c.version=this._version,c;this._nodeTraversalState[b.id]={nodeHasLOD:e, lodLevel:g,isChosen:f,version:this._version};return this._nodeTraversalState[a]};c.prototype._loadNode=function(a,c){var b=this;this._loadingNodes.add(a.id);var d=f.makeAbsolute(a.href,a.baseUrl);this.streamDataSupplier.request(d,"json").then(function(a,d){var f={id:d.id,mbs:d.mbs,parentNode:d.parentNode,children:d.children,featureData:d.featureData};e.forEach(function(a){f[a]=d.hasOwnProperty(a)?d[a]:null});b.nodeIndex[f.id]=f;f.baseUrl=a;c(a,f);b._loadingNodes.delete(f.id)},function(c){b.loadErrorCallback(d); b._loadingNodes.delete(a.id)})};c.prototype._collectMissing=function(c){var d=this,b=new Map;this._pendingNodes=0;this.traverseVisible(function(e,f){var g=e.id;if(d.nodeIndex[g])return!0;++d._pendingNodes;if(d._loadingNodes.has(g))return!0;a.buildTopNodeMap(b,c,{id:g,href:e.href,baseUrl:f?f.baseUrl:""},d.entryPriority(e));return!0});return b};c.prototype.entryPriority=function(a){if(a.id===this.rootId)return 0;var c=0,b=this.nodeIndex[a.id];null!=b&&null!=b.parentNode&&(b=this._nodeTraversalState[b.parentNode.id], null!=b&&(c=b.lodLevel));a=this.viewportQueries.distToPOI(a);return-a-c*(a+this.progressiveLoadPenalty)};c.prototype.traverseVisible=function(a){var c=this.nodeIndex[this.rootId];return this._traverse({id:this.rootId,mbs:c?c.mbs:null,href:this.rootUrl},a,null)};c.prototype._traverse=function(a,c,b){if(!c(a,b))return!1;b=this.nodeIndex[a.id];if(!b)return!0;a=this.nodeTraversalState(a.id);if(a.nodeHasLOD&&a.lodLevel===this._maxLodLevel)return!0;if(b.children){a=0;for(var d=b.children;ac;++c)this.fp[c]=d.vec4d.create();this.updateCamera(g);this._poi=d.vec3d.create(h);this.engineSR=this._renderCoordsHelper.spatialReference;p?(this._elevationContext=new a,this._elevationContext.featureExpressionInfoContext=e.createContext(e.extractExpressionInfo(p,!1)),this._elevationContext.mixinApi(p)): this._elevationContext=null;this.tmpPoint=new f({x:0,y:0,z:0,spatialReference:b})}h.prototype.updateCamera=function(a){l.matrix2frustumPlanes(a.viewMatrix,a.projectionMatrix,this.fp);this._screenSizeFactor=1/a.perPixelRatio;this._camPos=a.eye;this._isNodeVisibleCached={}};h.prototype.updatePointOfInterest=function(a){d.vec3d.set(a,this._poi);this.maxDistance=0};h.prototype.updateScreenSpaceErrorBias=function(a){this.screenspaceErrorBias=a};h.prototype.setCameraIdle=function(a){this._idleCamera!== a&&(this._idleCamera=a,this._isNodeVisibleCached={})};h.prototype.updateExtent=function(a){this.extent=a;this._isNodeVisibleCached={}};h.prototype.computeMbs=function(a){var b=this._computedMBSs[a.id];b||(b=d.vec4d.createFrom(a.mbs[0],a.mbs[1],a.mbs[2],-1),this._computedMBSs[a.id]=b);0>b[3]&&(d.vec4d.set(a.mbs,b),this._elevationContext&&1E5>b[3]&&(this.tmpPoint.x=b[0],this.tmpPoint.y=b[1],this.tmpPoint.z=b[2],b[2]=c.computeElevation(this.elevationProvider,this.tmpPoint,this._elevationContext,this._renderCoordsHelper, null)),k.mbsToMbs(b,this.indexSR,b,this.engineSR));return b};h.prototype.computeObb=function(a){if(a.obb&&!(0>a.obb.halfSize[0])){var e=this._computedOBBs[a.id];e||(e=b.clone(a.obb),e.halfSize[0]=-1,this._computedOBBs[a.id]=e);0>e.halfSize[0]&&(e.halfSize[0]=a.obb.halfSize[0],d.vec3d.set(a.obb.center,e.center),this._elevationContext&&1E5>a.mbs[3]&&(this.tmpPoint.x=a.obb.center[0],this.tmpPoint.y=a.obb.center[1],this.tmpPoint.z=a.obb.center[2],e.center[2]=c.computeElevation(this.elevationProvider, this.tmpPoint,this._elevationContext,this._renderCoordsHelper,null)),k.bufferToBuffer(e.center,this.indexSR,0,e.center,this.engineSR,0,1));return e}};h.prototype._isNodeVisible=function(a){a=this.computeMbs(a);return this.isMBSinExtent(a)&&this.isMBSVisible(a)};h.prototype.isNodeVisible=function(a){if(!this.enableLoD)return!0;if(!this._idleCamera)return this._isNodeVisible(a);if(null!=this._isNodeVisibleCached[a.id])return this._isNodeVisibleCached[a.id];this._isNodeVisibleCached[a.id]=this._isNodeVisible(a); return this._isNodeVisibleCached[a.id]};h.prototype.isGeometryVisible=function(a){return this.isNodeVisible(a)?(a=this.computeObb(a))?b.isVisible(a,this.fp):!0:!1};h.prototype.invalidateCache=function(a){if(null==a){for(var b=0,c=Object.keys(this._computedMBSs);ba?.5*Number.MAX_VALUE:b/Math.sqrt(a)*this._screenSizeFactor};h.prototype.calcCameraDistance=function(a){a=this.computeMbs(a);return Math.max(0,d.vec3d.dist(a,this._camPos)-a[3])};h.prototype.calcAngleDependentLoD=function(a){a=this.computeMbs(a);var b=a[3];a=(Math.abs(a[0]*(a[0]-this._camPos[0])+a[1]*(a[1]-this._camPos[1])+a[2]*(a[2]-this._camPos[2]))/d.vec3d.length(a)+b)/d.vec3d.dist(a,this._camPos);return Math.min(1,a)}; h.prototype.hasLOD=function(a){return null!=a.lodSelection};h.prototype.hasFeatures=function(a){return null!=a.featureData};h.prototype.getDistancePlanarMode=function(a,b,c){var d=a[0]-b[0],e=a[1]-b[1];a=a[2]-b[2];d=d+d+e*e;if(d<=c*c)return Math.abs(a);c=Math.sqrt(d)-c;return Math.sqrt(a*a+c*c)};h.prototype.getDistanceGlobeMode=function(a,b,c){var e=d.vec3d.length(b),f=d.vec3d.length(a)-e;d.vec3d.scale(a,d.vec3d.dot(a,b)/d.vec3d.length2(a),this._tmp0);if(d.vec3d.dist2(b,this._tmp0)<=c*c)return Math.abs(f); b=d.vec3d.scale(b,1/e,this._tmp0);var e=d.vec3d.scale(b,e-c*c/2/e,this._tmp1),g=d.vec3d.subtract(a,e,this._tmp2),g=d.vec3d.subtract(g,d.vec3d.scale(b,d.vec3d.dot(b,g),this._tmp3),this._tmp2),e=d.vec3d.add(e,d.vec3d.scale(g,c/d.vec3d.length(g),this._tmp2),this._tmp2);c=d.vec3d.dist(a,e);2E5<=f&&(a=d.vec3d.subtract(a,e,this._tmp1),a=d.vec3d.dot(a,b)/d.vec3d.length(a),.08>a&&(a=1E-4),c/=a);return c};h.prototype.getDistance=function(a,b,c){return this.engineSR===k.SphericalECEFSpatialReference?this.getDistanceGlobeMode(a, b,c):this.getDistancePlanarMode(a,b,c)};h.prototype._selectErrorMetric=function(a){if(this.errorMetricPreference)for(var b=0;b=a.lodSelection.length||!1===this.hasFeatures(a))return 0;if(null==a.children||0=== a.children.length)return this.maxLodLevel;var b=this.enableLoD?this._selectErrorMetric(a.lodSelection):null;if(null==b)return 0;if(1>this.progressiveLoadFactor){var c=this.screenspaceErrorBias;return this.evaluateLODmetric(a,this.progressiveLoadFactor*this.screenspaceErrorBias,b)?this.evaluateLODmetric(a,c,b)?2:1:0}return this.evaluateLODmetric(a,this.screenspaceErrorBias,b)?this.maxLodLevel:0};h.prototype.evaluateLODmetric=function(a,b,c){return"screenSpaceRelative"===c.metricType?(a=this.computeMbs(a), a=2*this.getDistance(this._camPos,a,a[3])/this._screenSizeFactor,c.maxError*b<=a):"maxScreenThreshold"===c.metricType?(b=this.calcScreenSpaceSize(a,a.mbs[3]*b),this.options.angleDependentLoD&&(b*=this.calcAngleDependentLoD(a)),bthis.calcScreenSpaceSize(a,c.maxError)*b:"distanceRangeFromDefaultCamera"===c.metricType?this.calcCameraDistance(a)>c.maxError*b:!1};h.prototype.distToPOI=function(a){a=this.computeMbs(a);a=d.vec3d.dist(a,this._poi)-a[3]; this.maxDistance=Math.max(this.maxDistance,a);return a};h.prototype.distCameraToPOI=function(){return d.vec3d.dist(this._camPos,this._poi)};return h}()})},"esri/views/3d/layers/i3s/IdleQueue":function(){define(["require","exports","dojo/Deferred"],function(r,h,f){Object.defineProperty(h,"__esModule",{value:!0});r=function(){function a(){this._deferreds=[];this._values=[]}a.prototype.push=function(a){var c=new f;this._deferreds.push(c);this._values.push(a);return c.promise};a.prototype.length=function(){return this._deferreds.length}; a.prototype.process=function(){this._deferreds.shift().resolve(this._values.shift())};a.prototype.cancelAll=function(){for(var a=0,c=this._deferreds;athis.fullOpacity||this.formatIsTransparent},enumerable:!0,configurable:!0});g.prototype.getTileUrl=function(a,b,c){return this.layer.getTileUrl(a,b,c)};g.prototype._evaluateUpdatingState=function(a){this._isUpdating=a;this.notifyChange("updating")}; g.prototype.isUpdating=function(){return this._isUpdating};g.prototype._getTileInfoSupportError=function(a,c){if(a=b.checkIfTileInfoSupportedForView(a,c,this.view.spatialReference,this.view.basemapTerrain.manifold)){c={layer:this.layer,error:a};var d=void 0;switch(a.name){case "tilingscheme:local-gcs-not-supported":d=new e("layerview:local-gcs-not-supported","Geographic coordinate systems are not supported in local scenes",c);break;case "tilingscheme:spatial-reference-mismatch":case "tilingscheme:global-unsupported-spatial-reference":d= new e("layerview:spatial-reference-incompatible","The spatial reference of this layer does not meet the requirements of the view",c);break;default:d=new e("layerview:tiling-scheme-unsupported","The tiling scheme of this layer is not supported by SceneView",c)}return d}return null};g.prototype._getTileInfoCompatibilityError=function(a,b){return b.compatibleWith(a)?null:new e("layerview:tiling-scheme-incompatible","The tiling scheme of this layer is incompatible with the tiling scheme of the surface")}; g.prototype._updateMinMaxDataLevel=function(){var a=Infinity,b=0;this.tileInfo.lods.forEach(function(c){a=Math.min(c.level,a);b=Math.max(c.level,b)});c=[a,b];this.minDataLevel=c[0];this.maxDataLevel=c[1];var c};a([c.property({readOnly:!0})],g.prototype,"formatIsTransparent",null);a([c.property()],g.prototype,"fullExtent",void 0);a([c.property({readOnly:!0,dependsOn:["fullOpacity","formatIsTransparent"]})],g.prototype,"isTransparent",null);a([c.property()],g.prototype,"layer",void 0);a([c.property()], g.prototype,"minDataLevel",void 0);a([c.property()],g.prototype,"maxDataLevel",void 0);a([c.property()],g.prototype,"tileInfo",void 0);return g=a([c.subclass("esri.views.3d.layers.TiledLayerView3D")],g)}(c.declared(g,d))})},"esri/views/3d/layers/support/tiledLayerUtils":function(){define("require exports dojo/request/xhr ../../../../core/Error ../../../../core/promiseUtils ../../../../layers/support/arcgisLayerUrl".split(" "),function(r,h,f,a,e,c){function g(a){var b=null,c=a.search(/\/rest\/services\//i); 0d.version)return d=new a("layerview:service-version-too-old","Tiled Map Layers on servers prior to 10.2.2 are not supported. Detected version: "+d.version,{minVersion:10.22,detectedVersion:d.version}),e.reject(d);if(10.22!==d.version||c.isHostedSecuredProxyService(d.url,d.get("portalItem.id")))return e.resolve();d=g(d.url); var b=new a("tiledlayerview3d:service-missing-cors-patch","Tiled Map Layers from 10.2.2 servers are only supported if all server updates have been applied.");return f(d+"self?f\x3djson",{headers:{"X-Requested-With":null},timeout:1E4,handleAs:"json"}).then(function(a){if(!a||a.error)throw b;}).catch(function(){throw b;})}};h.throwIfError=function(a){if(a)throw a;}})},"esri/views/3d/layers/FeatureLayerView3D":function(){define("require exports ../../../core/tsSupport/declareExtendsHelper ../../../core/tsSupport/decorateHelper ../../../core/Error ../../../core/promiseUtils ../../../core/watchUtils ../../../core/accessorSupport/decorators ../../../layers/FeatureLayer ../../../layers/graphics/controllers/SnapshotController ../../../layers/graphics/controllers/support/controllerUtils ./GraphicLayerView3DBase ../../layers/RefreshableLayerView".split(" "), function(r,h,f,a,e,c,g,d,b,k,l,p,n){return function(h){function n(a){var c=h.call(this)||this;c.labelingEnabled=a.layer instanceof b;return c}f(n,h);p=n;n.prototype.initialize=function(){this.addResolvingPromise(this.validateMaximumFeatureCount())};n.prototype.createController=function(){var a=this;return this.layer.createGraphicsController({layerView:this,options:{maxPageSize:300,extent:this.view.clippingArea}}).then(function(b){b instanceof k&&a._eventHandles.push(g.whenFalseOnce(a,"suspended", function(){b.startup()}));return b}).catch(function(a){return c.reject(new e("featurelayerview3d:create-controller",a.message,{error:a}))})};n.prototype.validateMaximumFeatureCount=function(){return 0>p.maximumFeatureCount||!this.layer.url?c.resolve():this.layer.queryFeatureCount().then(function(a){if(a>p.maximumFeatureCount)throw new e("featurelayerview3d:maximum-feature-count-exceeded","The maximum number of allowed features (${maximumFeatureCount}) has been exceeded (layer has ${numberOfFeatures} features)", {maximumFeatureCount:p.maximumFeatureCount,numberOfFeatures:a});})};n.prototype.doRefresh=function(){!this.suspended&&l.isRefreshable(this.controller)&&this.controller.refresh()};n.maximumFeatureCount=-1;a([d.property()],n.prototype,"controller",void 0);return n=p=a([d.subclass("esri.views.3d.layers.FeatureLayerView3D")],n);var p}(d.declared(p,n))})},"esri/layers/graphics/controllers/support/controllerUtils":function(){define(["require","exports"],function(r,h){Object.defineProperty(h,"__esModule", {value:!0});h.isRefreshable=function(f){return f&&f.refresh}})},"esri/views/3d/layers/GraphicLayerView3DBase":function(){define("require exports ../../../core/tsSupport/declareExtendsHelper ../../../core/tsSupport/decorateHelper dojo/promise/all ../../../core/Error ../../../core/promiseUtils ../../../core/watchUtils ../../../core/accessorSupport/decorators ../../../layers/graphics/QueryEngine ../../../renderers/support/renderingInfoUtils ./LayerView3D ./graphics/Graphics3DLayerViewCore ./graphics/graphicUtils ./support/LayerViewUpdatingPercentage ./support/projectExtentUtils".split(" "), function(r,h,f,a,e,c,g,d,b,k,l,p,n,t,u,q){return function(h){function p(a){a=h.call(this)||this;a.supportsHeightUnitConversion=!0;a.controller=null;a.supportsDraping=!0;a._overlayUpdating=null;a._progressMaxNumNodes=0;a._eventHandles=[];a._controllerClientSideFiltering=!1;a._suspendResumeExtent=null;a.fullExtentInViewSpatialReference=null;a._isUpdating=!1;a._controllerCreated=!1;return a}f(p,h);Object.defineProperty(p.prototype,"drawingOrder",{set:function(a){this._layerViewCore.graphicsCore.setDrawingOrder(a); this._set("drawingOrder",a)},enumerable:!0,configurable:!0});Object.defineProperty(p.prototype,"hasDraped",{get:function(){return this._layerViewCore.graphicsCore.hasDraped},enumerable:!0,configurable:!0});p.prototype.initialize=function(){var a=this;this._layerViewCore=new n({owner:this,layer:this.layer,spatialIndexRequired:!0,frustumVisibilityEnabled:!0,scaleVisibilityEnabled:!0,labelingEnabled:this.labelingEnabled,elevationAlignmentEnabled:!0,elevationFeatureExpressionEnabled:!0,verticalScaleEnabled:this.supportsHeightUnitConversion, highlightsEnabled:!0,updateSuspendResumeExtent:function(){return a.updateSuspendResumeExtent()},updateClippingExtent:function(b){return a.updateClippingExtent(b)}});this.addResolvingPromise(this._layerViewCore.initialize());this.drawingOrder=this.view.getDrawingOrder(this.layer.uid);this.initializeController();this.addResolvingPromise(this.validateGeometryType());var b=q.toView(this).then(function(b){a.fullExtentInViewSpatialReference=b});b&&this.addResolvingPromise(b);this._evaluateUpdatingState()}; p.prototype.destroy=function(){this._eventHandles.forEach(function(a){return a.remove()});this._eventHandles=null;this.controller&&(this.controller.destroy(),this.controller=null);this._layerViewCore&&(this._layerViewCore.destroy(),this._layerViewCore=null);this.loadedGraphics=null};p.prototype.getRenderingInfo=function(a){if((a=l.getRenderingInfo(a,{renderer:this.layer.renderer}))&&a.color){var b=a.color;b[0]/=255;b[1]/=255;b[2]/=255}return a};p.prototype.getGraphicsFromStageObject=function(a,b){var c= a.getMetadata().graphicId,d=null;this.loadedGraphics&&this.loadedGraphics.some(function(a){return a.uid===c?(d=a,!0):!1});return g.create(function(a,b){null!==d?a(d):b()})};p.prototype.getGraphics3DGraphics=function(){return this._layerViewCore.graphicsCore.getGraphics3DGraphics()};p.prototype.getGraphics3DGraphicsKeys=function(){return this._layerViewCore.graphicsCore.getGraphics3DGraphicsKeys()};p.prototype.getSymbolUpdateType=function(){return this._layerViewCore.graphicsCore.getSymbolUpdateType()}; p.prototype.queryGraphics=function(){return this._queryEngine?this._queryEngine.queryFeatures():this._rejectQuery()};p.prototype.queryFeatures=function(a){return this._queryEngine?this._queryEngine.queryFeatures(a):this._rejectQuery()};p.prototype.queryObjectIds=function(a){return this._queryEngine?this._queryEngine.queryObjectIds(a):this._rejectQuery()};p.prototype.queryFeatureCount=function(a){return this._queryEngine?this._queryEngine.queryFeatureCount(a):this._rejectQuery()};p.prototype.queryExtent= function(a){return this._queryEngine?this._queryEngine.queryExtent(a):this._rejectQuery()};p.prototype.whenGraphicBounds=function(a,b){return this._layerViewCore.graphicsCore.whenGraphicBounds(a,b)};p.prototype.highlight=function(a,b){return this._layerViewCore.highlight(a,b,this.layer.objectIdField)};p.prototype._rejectQuery=function(){return g.reject(new c("FeatureLayerView3D","Not ready to execute query"))};p.prototype._notifySuspendedChange=function(){this.notifyChange("suspended")};p.prototype._notifyDrapedDataChange= function(){this.notifyChange("hasDraped");this.emit("draped-data-change")};p.prototype.canResume=function(){return this.inherited(arguments)&&this._layerViewCore&&this._layerViewCore.canResume()};p.prototype._evaluateUpdatingState=function(){if(this._layerViewCore.elevationAlignment){var a;a=0+this._layerViewCore.elevationAlignment.numNodesUpdating();a+=this._layerViewCore.graphicsCore.numNodesUpdating();var b;b=(b=(b=(b=(b=!this._controllerCreated)||this.controller&&this.controller.updating)||this._overlayUpdating)|| this._layerViewCore.graphicsCore.needsIdleUpdate())||!(this.view.basemapTerrain&&this.view.basemapTerrain.ready);var c;c=(c=0a;a++)this.extent[a]={origin:f.vec3d.create(),originLength:0,direction:f.vec3d.create(),cap:{next:null,direction:f.vec3d.create()}},this.planes[a]=f.vec4d.create();this.planes[4]=f.vec4d.create()}c.prototype.toRenderBoundingExtent= function(c,g,h,k){e.center(c,q);q[2]=k;b.computeLinearTransformation(h,q,v,g);f.mat4d.inverse(v,x);a.set(m,a.NEGATIVE_INFINITY);for(var l=0,n=u;lA;A++){var B=A/4;q[0]=d.lerp(c[r],c[t],B);q[1]=d.lerp(c[z],c[p],B);q[2]=k;b.vectorToVector(q,h,q,g);f.mat4d.multiplyVec3(x,q);a.expand(m,q)}f.mat4d.multiplyVec3(v,f.vec3d.set3(m[0],m[1],m[2],this.extent[0].origin));f.mat4d.multiplyVec3(v,f.vec3d.set3(m[3],m[1],m[2],this.extent[1].origin));f.mat4d.multiplyVec3(v, f.vec3d.set3(m[3],m[4],m[2],this.extent[2].origin));f.mat4d.multiplyVec3(v,f.vec3d.set3(m[0],m[4],m[2],this.extent[3].origin))};c.prototype.update=function(a,b,c,d,e,g){e=this.extent;this.toRenderBoundingExtent(a,c,d,g);f.vec3d.add(e[0].origin,e[2].origin,this.center.origin);f.vec3d.scale(this.center.origin,.5);b(this.center.origin,this.center.direction);for(c=0;4>c;c++)d=e[c],b(d.origin,d.direction),d.originLength=f.vec3d.length(d.origin),g=e[3===c?0:c+1],d.cap.next=g.origin,f.vec3d.direction(g.origin, d.origin,d.cap.direction),this._computePlane(d.cap.direction,d.direction,d.origin,this.planes[c]);this._computePlane(e[1].cap.direction,e[0].cap.direction,e[0].origin,this.planes[4]);this.maxSpan=Math.max(Math.abs(a[0]-a[2]),Math.abs(a[1]-a[3]))};c.prototype.isVisibleInFrustumGlobal=function(a){if(0>f.vec3d.dot(this.center.direction,a.direction))return!0;for(var b=0;4>b;b++)if(0>f.vec3d.dot(this.extent[b].direction,a.direction))return!0;return!1};c.prototype.isVisibleInFrustum=function(a,b,c){if("global"=== a.viewingMode){if(this.maxSpan>(a.spatialReference.isWGS84?l:p))return!0;if(b.altitude>=n)return this.isVisibleInFrustumGlobal(b)}for(a=0;aa||50f&&(!c||aq.x|| e[1]>q.y||e[2]q("safari")&&(a=new l("sceneview:browser-not-supported","This browser is not supported by SceneView (Safari \x3c 9)",{type:"safari",requiredVersion:9,detectedVersion:q("safari")}));return a?(ha.warn("#validate()",a.message),t.reject(a)):t.resolve()};n.prototype.isSpatialReferenceSupported=function(a,b,c){var d=a.isGeographic,e=a.isWebMercator,f=a.isWGS84,g="local"===this.viewingMode,h=!(!this._isOverridden("viewingMode")&&!this.get("map.initialViewProperties.viewingMode")); if(h){if(g&&d)return c&&c("Layer "+b.id+" is ignored because it is GCS and viewing mode is local"),!1;if(!g&&!e&&!f)return c&&c("Layer "+b.id+" is ignored because its spatial reference is not supported in global viewing mode"),!1}else if(d&&!f)return c&&c("Layer "+b.id+" is ignored because its spatial reference is geographic but not WGS84"),!1;if(b)if(Z.isTiledLayer(b)){if(d=void 0,h?h=Z.getTiledLayerInfo(b,a,this.viewingMode):(h=Z.getTiledLayerInfo(b,a,"global"),null==h.tileInfo&&(h=Z.getTiledLayerInfo(b, a,"local"))),d=null!=h.tileInfo,!d)return c&&c("Layer "+b.id+" is ignored because it is tiled but\n its tiling scheme is not supported or compatible with the viewing mode"),!1}else if((f||e)&&!g)return null==this._initialDefaultSpatialReference&&(this._initialDefaultSpatialReference=a),h||this._internallyReady||(this.viewingMode="global",c&&c("Viewing mode locked to global due to reprojectable layer "+b.id)),c&&c("Layer "+b.id+" is ignored because it supports server-side reprojection"), !1;return!0};n.prototype.engineToScreen=function(a,b){var c=O.vec3d.create();this.state.camera.projectPoint(a,c);a=c[0];var e=this.height-c[1],c=c[2];return b?(b.x=a,b.y=e,b.z=c,b):new d.ScreenPoint({x:a,y:e,z:c})};n.prototype.flushDisplayModifications=function(){this._stage.processDirty()};n.prototype.getDrawingOrder=function(a){return this.allLayerViews.findIndex(function(b){return b.layer&&b.layer.uid===a})};n.prototype.getViewForGraphic=function(a){return a.layer?this.allLayerViews.find(function(b){return b.layer=== a.layer}):this._graphicsView};n.prototype.whenViewForGraphic=function(a){return a.layer?this.whenLayerView(a.layer):t.resolve(this._graphicsView)};n.prototype._computeMapPointFromIntersectionResult=function(a,b){if(a.getIntersectionPoint(ia)){b=this._computeMapPointFromVec3d(ia,b);var c=this._get("basemapTerrain");"terrain"===a.intersector&&c&&(a=c.getElevation(b),null!==a&&(b.z=a));return b}return null};n.prototype._computeMapPointFromVec3d=function(a,b){var c=this.spatialReference||d.SpatialReference.WGS84; L.vectorToVector(a,this.renderSpatialReference,a,c)||(c=d.SpatialReference.WGS84,L.vectorToVector(a,this.renderSpatialReference,a,c));b?(b.x=a[0],b.y=a[1],b.z=a[2],b.spatialReference=c):b=new d.Point(a,c);return b};n.prototype._getGraphicFromStageObject=function(a,b){var c=a.getMetadata();if(null!=c&&null!=c.layerUid){if(c.layerUid===this._graphicsView.mockLayerId)return this._graphicsView.getGraphicsFromStageObject(a,b);if(c=this.map.findLayerByUid(c.layerUid))return this.whenLayerView(c).then(function(c){if(c&& null!=c.getGraphicsFromStageObject&&!c.suspended)return c.getGraphicsFromStageObject(a,b)})}return null};n.prototype._getGraphicFromStagePoint=function(a){var c=this._computeMapPointFromVec3d(a.point),c=new b(c);a=a.metadata.layerUid;null!=a&&c.set("layer",this.map.findLayerByUid(a));return c};n.prototype._viewingModeToManifold=function(a){switch(a){case "global":return"spherical";case "local":return"planar"}};n.prototype._initBasemapTerrain=function(a){this._disposeBasemapTerrain();this._set("basemapTerrain", new ka(this,this._viewingModeToManifold(a)));this._set("elevationProvider",new R({view:this}));this.elevationProvider.register("ground",this.basemapTerrain)};n.prototype._initGlobe=function(a){this._initCoordinateSystem();this._initState();this._stage.setViewParams({backgroundColor:[0,0,0,0],maxFarNearRatio:0,frustumCullingEnabled:!1});this._initBasemapTerrain(a);this._set("pointsOfInterest",new da.default({view:this}));this._initStateManager()};n.prototype._initCoordinateSystem=function(){if(this.spatialReference){var a= this.spatialReference;this.mapCoordsHelper&&this.mapCoordsHelper.spatialReference.equals(a)||this._set("mapCoordsHelper",new K.default(this.map,a));var b="global"===this.viewingMode,a=b?L.SphericalECEFSpatialReference:a;a!==this.renderSpatialReference&&(this.renderSpatialReference=a,this._set("renderCoordsHelper",U.createRenderCoordsHelper(b?"global":"local",a)),this._stage&&this._stage.setIntersectTolerance(ja.DEFAULT_TOLERANCE/this.renderCoordsHelper.unitInMeters))}else this._set("mapCoordsHelper", null),this._set("renderCoordsHelper",null),this.renderSpatialReference=null};n.prototype._evaluateUpdating=function(){var a=0,b=0,c=!1;this.allLayerViews.forEach(function(d){d.updating&&(c=!0,d=d.updatingPercentage,null!=d&&(++b,a+=d))});if(this._graphicsView&&this._graphicsView.updating||this.resourceController&&this.resourceController.isUpdating())c=!0;c!==this.updating&&this._set("updating",c);a=0!==b?a/b:c?100:0;this.updatingPercentage!==a&&this._set("updatingPercentage",a)};n.prototype._updateUpdatingMonitors= function(a){for(var b=0;b