text: /**
   * Copyright (c) 2014, 2016, Oracle and/or its affiliates.
   * The Universal Permissive License (UPL), Version 1.0
   */
  "use strict";
  define(['./DvtToolkit', './DvtPanZoomCanvas'], function(dvt) {
    // Internal use only.  All APIs and functionality are subject to change at any time.
  
  !function(t){t.ThematicMap=function(t,e,a){this.Init(t,e,a)},t.Obj.createSubclass(t.ThematicMap,t.PanZoomComponent),t.ThematicMap.DEFAULT_MAX_ZOOM_FACTOR=6,t.ThematicMap.prototype.Init=function(a,i,r){t.ThematicMap.superclass.Init.call(this,a,i,r),this._layers=[],this._createLayers(),this._bRendered=!1,this.Defaults=new e,this._initialZooming=!1,this._zooming=!1,this._panning=!1,this._selectedAreas={},this._bListenersRemoved=!1,this._createHandlers(),this.EventManager.associate(this,this)},t.ThematicMap.prototype._createLayers=function(){this._areaLayers=new t.Container(this.getCtx()),this._dataAreaLayers=new t.Container(this.getCtx()),this._dataPointLayers=new t.Container(this.getCtx()),this._labelLayers=new t.Container(this.getCtx()),this._linkLayers=new t.Container(this.getCtx())},t.ThematicMap.newInstance=function(e,a,i){return new t.ThematicMap(e,a,i)},t.ThematicMap.prototype.SetOptions=function(e){t.ThematicMap.superclass.SetOptions.call(this,e),t.Agent.isEnvironmentBrowser()||(this.Options.animationOnDisplay="none",this.Options.animationOnMapChange="none"),new S(this).parse(this.Options)},t.ThematicMap.prototype.setStyleDefaults=function(t){this._styleDefaults=t},t.ThematicMap.prototype.getStyleDefaults=function(){return this._styleDefaults},t.ThematicMap.prototype.getMaxZoomFactor=function(){var e=this.Options.maxZoom;return this._zooming?isNaN(e)?t.ThematicMap.DEFAULT_MAX_ZOOM_FACTOR:Math.max(e,1):1},t.ThematicMap.prototype.isMarkerZoomBehaviorFixed=function(){return"fixed"==this.Options.markerZoomBehavior},t.ThematicMap.prototype.addLayer=function(t){this._layers.push(t)},t.ThematicMap.prototype.getLayer=function(t){for(var e=0;e<this._layers.length;e++)if(this._layers[e].getLayerName()==t)return this._layers[e]},t.ThematicMap.prototype.getAllLayers=function(){return this._layers},t.ThematicMap.prototype.getAreaLayerContainer=function(){return this._areaLayers},t.ThematicMap.prototype.getDataAreaContainer=function(){return this._dataAreaLayers},t.ThematicMap.prototype.getDataPointContainer=function(){return this._dataPointLayers},t.ThematicMap.prototype.getLabelContainer=function(){return this._labelLayers},t.ThematicMap.prototype.getLinkContainer=function(){return this._linkLayers},t.ThematicMap.prototype.setMapName=function(t){this._bBaseMapChanged=this._mapName&&this._mapName!=t,this._mapName=t},t.ThematicMap.prototype.setAnimationDuration=function(t){this._animationDuration=parseFloat(t)},t.ThematicMap.prototype.getAnimationDuration=function(){return this._animationDuration},t.ThematicMap.prototype.getDisplayTooltips=function(){var t=this.Options.tooltipDisplay;switch(t){case"shortDesc":return"shortDescOnly";case"none":return t;default:return"auto"}},t.ThematicMap.prototype.setInitialZooming=function(t){this._initialZooming=t},t.ThematicMap.prototype.PreRender=function(){t.ThematicMap.superclass.PreRender.call(this),this._bBaseMapChanged=!1,!this.IsResize()&&this._pzcContainer&&(this._oldMapProvider=this.Options.mapProvider,this._layers=[],this._zooming=!0,this._panning=!0,this._oldPzc=this._pzc,this._createLayers(),this.EventManager.removeListeners(this),this._createHandlers(),this._bListenersRemoved=!1,this.EventManager.hideTooltip(),this.EventManager.associate(this,this))},t.ThematicMap.prototype._createHandlers=function(){this.EventManager=new f(this.getCtx(),this.dispatchEvent,this),this.EventManager.addListeners(this),t.Agent.isTouchDevice()?this._keyboardHandler=null:(this._keyboardHandler=new y(this,this.EventManager),this.EventManager.setKeyboardHandler(this._keyboardHandler))},t.ThematicMap.prototype.Render=function(){t.ThematicMap.superclass.Render.call(this);var e=new t.Container(this.getCtx()),a=new t.Container(this.getCtx());if(this._pzc=this.getPanZoomCanvas(),this._pzc.addChild(e),this._pzc.getContentPane().addChild(a),this._render(e,a),this._areaLayer){this.StopAnimation(!0);var i=new t.Rectangle(0,0,this.getWidth(),this.getHeight());if(null==this.getMapName()){var r=this.Options.mapProvider;this._oldMapProvider!==r&&(this._bBaseMapChanged=!0,this._oldMapProvider=r)}if(this._bRendered||this._oldPzc){if(this._bBaseMapChanged&&!this.IsResize()){var n=this.Options.animationOnMapChange;(n="auto"===n?"alphaFade":null)&&(this.Animation=t.BlackBoxAnimationHandler.getCombinedAnimation(this.getCtx(),n,this._oldPzc,this._pzc,i,this._animationDuration),this.addChild(this._oldPzc))}}else{var o=this.Options.animationOnDisplay;(o="auto"===o?"alphaFade":null)&&(this.Animation=t.BlackBoxAnimationHandler.getInAnimation(this.getCtx(),o,this._pzc,i,this._animationDuration))}this.Animation?(this.EventManager.hideTooltip(),this.EventManager.removeListeners(this),this._bListenersRemoved=!0,this.Animation.setOnEnd(this.OnAnimationEnd,this),this.Animation.play()):this.OnAnimationEnd(),this._pzcContainer=e,this.getCtx().setKeyboardFocusArray([this]),this._bRendered=!0}},t.ThematicMap.prototype._calcMinZoom=function(){var t=this._pzc.getZoomToFitPadding(),e=this._areaLayer.getLayerDim(),a=this._pzc.getSize(),i=(a.w-2*t)/e.w,r=(a.h-2*t)/e.h;return Math.min(i,r)},t.ThematicMap.prototype._render=function(t,e){e.addChild(this._areaLayers),e.addChild(this._dataAreaLayers),this.isMarkerZoomBehaviorFixed()?t.addChild(this._dataPointLayers):e.addChild(this._dataPointLayers),t.addChild(this._labelLayers),t.addChild(this._linkLayers);var a=this._pzc.getContentPane().getMatrix();this._areaLayerRendered=!1;for(var i=0;i<this._layers.length;i++){var r=this._layers[i];(!this._areaLayerRendered&&r instanceof d||!(r instanceof d))&&(r.render(a),!this._areaLayerRendered&&r instanceof d&&(this._areaLayerRendered=!0,this._areaLayer=r))}if(this._areaLayer){var n=this._areaLayer.getIsolatedArea();this._isolatedArea!=n&&(this._isolatedArea=n),this._setInitialKeyboardFocus(),this._pzc.setMinZoom(null),this._pzc.setMaxZoom(null),this._pzc.setZoomingEnabled(!0),this._pzc.setPanningEnabled(!0),this._pzc.zoomToFit(null,this._areaLayer.getLayerDim()),this._updateZoomLimits(),this._pzc.setZoomingEnabled(this._zooming),this._pzc.setPanningEnabled(this._panning),this.Options._resources&&this._pzc.setPanCursor(this.Options._resources.panCursorUp,this.Options._resources.panCursorDown)}},t.ThematicMap.prototype._setInitialKeyboardFocus=function(){if(this._keyboardHandler){var t=this.getNavigableAreas();0==t.length&&(t=this.getNavigableMarkers()),0==t.length&&(t=this.getNavigableLinks()),this.EventManager.setInitialFocus(t[0])}},t.ThematicMap.prototype.updateLayer=function(t,e,a){this._bRendered=!1,this.StopAnimation(!0),new S(this).ParseDataLayers([t],this.getLayer(e),this._areaLayer.getLayerName(),a),this._bRendered=!0,this._setInitialKeyboardFocus(),this.getCtx().setKeyboardFocusArray([this]),this._updateZoomLimits()},t.ThematicMap.prototype._renderCompleted=function(){this.AnimationStopped||this.RenderComplete(),this.Animation=null,this.AnimationStopped=!1},t.ThematicMap.prototype._updateZoomLimits=function(){var t=this._calcMinZoom();this._pzc.setMinZoom(t),this._pzc.setMaxZoom(t*this.getMaxZoomFactor())},t.ThematicMap.prototype.OnUpdateLayerEnd=function(){this._areaLayer.getIsolatedArea()&&this._pzc.zoomToFit(null,this._areaLayer.getLayerDim()),this._initialZooming&&this._zoomData(),this._renderCompleted()},t.ThematicMap.prototype.getMapName=function(){return this._mapName},t.ThematicMap.prototype._transformContainers=function(e){var a=new t.Matrix;a.translate(e.getTx(),e.getTy()),this.isMarkerZoomBehaviorFixed()&&this._dataPointLayers.setMatrix(a),this._labelLayers.setMatrix(a),this._linkLayers.setMatrix(a)},t.ThematicMap.prototype._constrainPanning=function(e){var a=this._pzc.getZoomToFitPadding(),i=this._pzc.getSize(),r=new t.Rectangle(a,a,i.w-2*a,i.h-2*a),n=this._areaLayer.getLayerDim(),o=n.x*e,s=n.y*e,l=n.w*e,h=n.h*e;if(l>r.w)this._pzc.setMinPanX(r.x+r.wt-(o+l)),this._pzc.setMaxPanX(r.x-o);else{var c=(r.x+r.w)/2-(o+l/2);this._pzc.setMinPanX(c),this._pzc.setMaxPanX(c)}if(h>r.h)this._pzc.setMinPanY(r.y+r.h-(s+h)),this._pzc.setMaxPanY(r.y-s);else{var p=(r.y+r.h)/2-(s+h/2);this._pzc.setMinPanY(p),this._pzc.setMaxPanY(p)}},t.ThematicMap.prototype._updateAnimator=function(e,a){var i=e.getAnimator();if(i){var r=this._pzc.getContentPane(),n=i.getDestVal(r,r.getMatrix);a&&(this._currentAnimMatrix=r.getMatrix(),i.addProp(t.Animator.TYPE_MATRIX,this,this._getCenteredObjsMatrix,this._setCenteredObjsMatrix,n));var o=new t.Matrix(1,0,0,1,n.getTx(),n.getTy());this.isMarkerZoomBehaviorFixed()&&i.addProp(t.Animator.TYPE_MATRIX,this._dataPointLayers,this._dataPointLayers.getMatrix,this._dataPointLayers.setMatrix,o),i.addProp(t.Animator.TYPE_MATRIX,this._labelLayers,this._labelLayers.getMatrix,this._labelLayers.setMatrix,o),i.addProp(t.Animator.TYPE_MATRIX,this._linkLayers,this._linkLayers.getMatrix,this._linkLayers.setMatrix,o)}},t.ThematicMap.prototype.HandleZoomEvent=function(e){switch(e.getSubType()){case t.ZoomEvent.SUBTYPE_ADJUST_PAN_CONSTRAINTS:this._panning&&this._constrainPanning(e.getNewZoom());break;case t.ZoomEvent.SUBTYPE_ZOOMING:case t.ZoomEvent.SUBTYPE_ELASTIC_ANIM_BEGIN:this._updateAnimator(e,!0);break;case t.ZoomEvent.SUBTYPE_ZOOMED:var a=e.getNewZoom();if(null!=a){var i=this._pzc.getContentPane().getMatrix();e._animator=null,this.dispatchEvent(t.EventFactory.newThematicMapViewportChangeEvent(i.getTx(),i.getTy(),a)),this._transformContainers(i);for(var r=0;r<this._layers.length;r++)this._layers[r].HandleZoomEvent(e,i)}break;case t.ZoomEvent.SUBTYPE_ZOOM_AND_CENTER:this.fitSelectedRegions();break;case t.ZoomEvent.SUBTYPE_ZOOM_TO_FIT_END:this.dispatchEvent(t.EventFactory.newThematicMapViewportChangeEvent())}},t.ThematicMap.prototype.HandlePanEvent=function(e){var a=e.getSubType();if(a==t.PanEvent.SUBTYPE_ELASTIC_ANIM_BEGIN||a==t.PanEvent.SUBTYPE_PANNING)this._updateAnimator(e,!1);else if(a==t.PanEvent.SUBTYPE_PANNED&&null!=e.getNewX()){var i=this._pzc.getContentPane().getMatrix();e._animator=null,this.dispatchEvent(t.EventFactory.newThematicMapViewportChangeEvent(i.getTx(),i.getTy(),this._pzc.getZoom())),this._transformContainers(i);for(var r=0;r<this._layers.length;r++)this._layers[r].HandlePanEvent(i)}},t.ThematicMap.prototype.GetControlPanelBehavior=function(){return t.PanZoomComponent.CONTROL_PANEL_BEHAVIOR_HIDDEN},t.ThematicMap.prototype.GetControlPanel=function(){return null},t.ThematicMap.prototype.setZooming=function(t){this._zooming=t},t.ThematicMap.prototype.setPanning=function(t){this._panning=t},t.ThematicMap.prototype._zoomData=function(){var e=this._dataAreaLayers.getDimensions(),a=this._dataPointLayers.getDimensions();if(this.isMarkerZoomBehaviorFixed()){var i=this._pzc.getContentPane().getMatrix();a.w/=i.getA(),a.h/=i.getD(),a.x/=i.getA(),a.y/=i.getD()}var r,n,o=e.getUnion(a);this.StopAnimation(!0),this._pzc.isZoomingEnabled()||(r=this._pzc.getMaxZoom(),this._pzc.setMaxZoom(r*t.ThematicMap.DEFAULT_MAX_ZOOM_FACTOR)),t.Agent.isEnvironmentBrowser()&&(n=new t.Animator(this.getCtx(),.3)),o.w>0&&o.h>0?this._pzc.zoomToFit(n,o):this._pzc.zoomToFit(n,this._areaLayer.getLayerDim()),n&&n.play(),r&&this._pzc.setMaxZoom(r)},t.ThematicMap.prototype._zoomToFitBounds=function(e){var a=new t.Animator(this.getCtx(),.3);this._pzc.zoomToFit(a,e),a.play()},t.ThematicMap.prototype.fitRegion=function(t){t||(t=this._zoomToFitObject),t||(t=this._clickedObject),this._zoomToFitBounds(t.getDimensions())},t.ThematicMap.prototype.fitSelectedRegions=function(){if(this._clickedDataLayerId){var t=this.getLayer(this._clickedLayerName).getDataLayer(this._clickedDataLayerId);if(t){var e=t._selectionHandler;if(e){for(var a=e.getSelection(),i=0;i<a.length;i++)a[i]=a[i].getDisplayable();if(a.length>0){for(var r=a[0].getDimensions(),n=1;n<a.length;n++)r=r.getUnion(a[n].getDimensions());this._zoomToFitBounds(r)}}}}},t.ThematicMap.prototype.fitMap=function(){var e=new t.Animator(this.getCtx(),.3);this._pzc.zoomToFit(e),e.play()},t.ThematicMap.prototype.getNavigableAreas=function(){var t=[];if(this._areaLayer){var e=this._areaLayer.getDataLayers();for(var a in e)t=t.concat(e[a].getNavigableAreaObjects())}return t},t.ThematicMap.prototype.getNavigableMarkers=function(){for(var t=[],e=0;e<this._layers.length;e++){var a=this._layers[e].getDataLayers();for(var i in a)t=t.concat(a[i].getMarkerObjects())}return t},t.ThematicMap.prototype.getNavigableLinks=function(){for(var t=[],e=0;e<this._layers.length;e++){var a=this._layers[e].getDataLayers();for(var i in a)t=t.concat(a[i].getLinkObjects())}return t},t.ThematicMap.prototype._setCenteredObjsMatrix=function(t){if(this._currentAnimMatrix=t,this.isMarkerZoomBehaviorFixed()){for(var e=this.getNavigableMarkers(),a=0;a<e.length;a++)e[a].HandleZoomEvent(t);for(var i=this._labelLayers.getNumChildren(),r=0;r<i;r++)for(var n=this._labelLayers.getChildAt(r),o=n.getNumChildren(),s=0;s<o;s++){var h=n.getChildAt(s);h instanceof l&&h.update(t)}}},t.ThematicMap.prototype._getCenteredObjsMatrix=function(){return this._currentAnimMatrix},t.ThematicMap.prototype.setClickInfo=function(t,e,a){this._clickedLayerName=e,this._clickedDataLayerId=t,this._clickedObject=a},t.ThematicMap.prototype.dispatchEvent=function(e){"selection"==e.type&&this._handleSelectionEvent(e),t.ThematicMap.superclass.dispatchEvent.call(this,e)},t.ThematicMap.prototype._handleSelectionEvent=function(e){if(this._clickedDataLayerId){this._selectedRowKeys=e.selection;var a=this.getLayer(this._clickedLayerName).getDataLayer(this._clickedDataLayerId);this._selectedAreas[this._clickedLayerName]=a.getSelectedAreas(this._selectedRowKeys),e.clientId=this._clickedDataLayerId,this._clickedObject&&!(this._clickedObject instanceof t.SimpleMarker||this._clickedObject instanceof t.ImageMarker)&&(this._zoomToFitObject=this._clickedObject)}else this._zoomToFitObject=null},t.ThematicMap.prototype.destroy=function(){for(var e=this.getAllLayers(),a=0;a<e.length;a++)e[a].destroy();t.ThematicMap.superclass.destroy.call(this)},t.ThematicMap.prototype.OnAnimationEnd=function(){this._oldPzc&&(this.removeChild(this._oldPzc),this._oldPzc=null),this._renderCompleted(),this._initialZooming&&this._zoomData(),this.Options.highlightedCategories&&this.Options.highlightedCategories.length>0&&this.highlight(this.Options.highlightedCategories),this._bListenersRemoved&&(this.EventManager.addListeners(this),this._bListenersRemoved=!1)},t.ThematicMap.prototype.getAutomation=function(){return this.Automation||(this.Automation=new i(this)),this.Automation},t.ThematicMap.prototype.GetComponentDescription=function(){return t.Bundle.getTranslatedString(t.Bundle.UTIL_PREFIX,"THEMATIC_MAP")},t.ThematicMap.prototype.highlight=function(e){this.Options.highlightedCategories=t.JsonUtils.clone(e),t.CategoryRolloverHandler.highlight(e,this.getNavigableAreas().concat(this.getNavigableMarkers()).concat(this.getNavigableLinks()),"any"==this.Options.highlightMatch)},t.ThematicMap.prototype.processDefaultHoverEffect=function(t,e){var a=this._getDataItemById(t);a&&a.processDefaultHoverEffect(e)},t.ThematicMap.prototype.processDefaultSelectionEffect=function(t,e){var a=this._getDataItemById(t);a&&a.processDefaultSelectionEffect(e)},t.ThematicMap.prototype.processDefaultFocusEffect=function(t,e){var a=this._getDataItemById(t);a&&a.processDefaultFocusEffect(e)},t.ThematicMap.prototype._getDataItemById=function(e){for(var a=this.getCtx(),i=0;i<this._layers.length;i++){var r=this._layers[i].getDataLayers();for(var n in r)for(var o=r[n].getMarkerObjects(),s=0;s<o.length;s++)if(t.Obj.compareValues(a,o[s].getId(),e))return o[s]}return null},t.ThematicMap.prototype._getAreaFromDataLayer=function(t,e){for(var a=e.getAreaObjects(),i=0;i<a.length;i++)if(a[i].getLocation()===t)return a[i];return null};var e=function(){this.Init({fusion:e.DEFAULT,alta:e.SKIN_ALTA})};t.Obj.createSubclass(e,t.BaseComponentDefaults),e.DEFAULT={animationDuration:500,animationOnDisplay:"none",animationOnMapChange:"none",highlightMatch:"all",hoverBehavior:"none",initialZooming:"none",markerZoomBehavior:"fixed",panning:"none",tooltipDisplay:"auto",touchResponse:"auto",visualEffects:"none",zooming:"none",styleDefaults:{skin:"alta",_areaStyle:{backgroundColor:"#B8CDEC",borderColor:"#FFFFFF"},hoverBehaviorDelay:200,dataAreaDefaults:{borderColor:"#FFFFFF",hoverColor:"#FFFFFF",opacity:1,selectedInnerColor:"#FFFFFF",selectedOuterColor:"#000000"},dataMarkerDefaults:{borderColor:"#FFFFFF",borderStyle:"solid",borderWidth:.5,color:"#000000",height:8,labelStyle:new t.CSSStyle(t.BaseComponentDefaults.FONT_FAMILY_SKYROS+t.BaseComponentDefaults.FONT_SIZE_13+"color:#000000"),opacity:.4,scaleX:1,scaleY:1,shape:"circle",width:8},linkDefaults:{color:"#9bb2c7",_hoverColor:"#FFFFFF",_selectedColor:"#000000",width:2},labelStyle:new t.CSSStyle(t.BaseComponentDefaults.FONT_FAMILY_SKYROS+t.BaseComponentDefaults.FONT_SIZE_11)},resources:{images:{},translations:{}}},e.SKIN_ALTA={styleDefaults:{_areaStyle:{backgroundColor:"#DDDDDD",borderColor:"#FFFFFF"},dataMarkerDefaults:{color:"rgb(51,51,51)",labelStyle:new t.CSSStyle(t.BaseComponentDefaults.FONT_FAMILY_ALTA_12+"color:#333333"),opacity:1},labelStyle:new t.CSSStyle(t.BaseComponentDefaults.FONT_FAMILY_ALTA_12)}},e.DEFAULT_AREA_LAYER={animationOnLayerChange:"none",labelDisplay:"auto",labelType:"short"},e.DEFAULT_DATA_LAYER={animationOnDataChange:"none",selectionMode:"none"},e.prototype.calcAreaLayerOptions=function(a,i){var r=e.DEFAULT_AREA_LAYER;return i&&(r=t.JsonUtils.merge({labelDisplay:"off"},r)),t.JsonUtils.merge(a,r)},e.prototype.calcDataLayerOptions=function(a){return t.JsonUtils.merge(a,e.DEFAULT_DATA_LAYER)},e.getGapSize=function(t,e){return Math.ceil(e*t.getGapRatio())},e.prototype.getNoCloneObject=function(){return{mapProvider:!0,areaLayers:{areaDataLayer:{areas:!0,markers:!0,links:!0}},pointDataLayers:{markers:!0,links:!0},areas:!0,markers:!0,links:!0}},e.prototype.getAnimationDuration=function(t){return t.animationDuration},t.ThematicMap.prototype._getCurrentDragSource=function(){for(var t=0;t<this._layers.length;t++){var e=this._layers[t].getDataLayers();for(var a in e){var i=e[a].getDragSource();if(i&&i.getDragCandidate())return i}}return null},t.ThematicMap.prototype.isDragAvailable=function(t,e,a){this._dragAllowed=!1;var i=this._getCurrentDragSource();return!!i&&i.isDragAvailable(a)},t.ThematicMap.prototype.getDragTransferable=function(t,e){var a=this._getCurrentDragSource();return a?a.getDragTransferable(t,e):null},t.ThematicMap.prototype.getDragOverFeedback=function(t,e){var a=this._getCurrentDragSource();return a?a.getDragOverFeedback(t,e):null},t.ThematicMap.prototype.getDragContext=function(t,e){var a=this._getCurrentDragSource();return a?a.getDragContext(t,e):null},t.ThematicMap.prototype.getDragOffset=function(t,e){var a=this._getCurrentDragSource();return a?a.getDragOffset(t,e):null},t.ThematicMap.prototype.getPointerOffset=function(t,e){var a=this._getCurrentDragSource();return a?a.getPointerOffset(t,e):null},t.ThematicMap.prototype.initiateDrag=function(){var t=this._getCurrentDragSource();t&&t.initiateDrag()},t.ThematicMap.prototype.dragDropEnd=function(){var t=this._getCurrentDragSource();t&&t.dragDropEnd(),this.getPanZoomCanvas().resetTouchTargets()},t.ThematicMap.prototype.prepDrag=function(){this._panning?this._startDragDropTimer(1e3):this._dragAllowed=!0},t.ThematicMap.prototype.abortPrep=function(){this._stopDragDropTimer()},t.ThematicMap.prototype.recognizeDrag=function(){return this._stopDragDropTimer(),this._dragAllowed},t.ThematicMap.prototype._startDragDropTimer=function(e){this._dragDropTimer=new t.Timer(this.getCtx(),e,this._handleDragDropTimer,this,1),this._dragDropTimer.start()},t.ThematicMap.prototype._handleDragDropTimer=function(){this._stopDragDropTimer(),this._dragAllowed=!0},t.ThematicMap.prototype._stopDragDropTimer=function(){this._dragDropTimer&&(this._dragDropTimer.stop(),this._dragDropTimer=null)},t.ThematicMap.prototype._getCurrentDropTarget=function(t,e){for(var a=0;a<this._layers.length;a++)if(this._layers[a].getDropTarget){var i=this._layers[a].getDropTarget();if(i&&i.getDropSite(t,e))return i}return null},t.ThematicMap.prototype.acceptDrag=function(t,e,a){var i=this._pzc.getZoom();return t=(t-this._pzc.getPanX())/i,e=(e-this._pzc.getPanY())/i,this._dropTarget=this._getCurrentDropTarget(t,e),this._dropTarget?this._dropTarget.acceptDrag(t,e,a):null},t.ThematicMap.prototype.dragEnter=function(){this._dropTarget&&this._dropTarget.dragEnter()},t.ThematicMap.prototype.dragExit=function(){this._dropTarget&&this._dropTarget.dragExit()},t.ThematicMap.prototype.getDropSite=function(t,e){var a=this._pzc.getZoom();return t=(t-this._pzc.getPanX())/a,e=(e-this._pzc.getPanY())/a,this._dropTarget?this._dropTarget.getDropSite(t,e):null};var a=function(t,e){this._areaLayer=t,this._basemap=e};t.Obj.createSubclass(a,t.DropTarget),a.prototype.acceptDrag=function(t,e,a){var i=this._areaLayer.__getObjectUnderPoint(t,e);return i?(i!=this._dropSite&&(this._areaLayer.__showDropSiteFeedback(i),this._dropSite=i),a[0]):(this._areaLayer.__showDropSiteFeedback(null),null)},a.prototype.dragExit=function(){this._areaLayer.__showDropSiteFeedback(null),this._dropSite=null},a.prototype.getDropSite=function(t,e){var a=this._areaLayer.__getObjectUnderPoint(t,e);if(a){var i=m.inverseProject(t,e,this._basemap);return{regionId:a.getAreaId(),localX:i.x,localY:i.y}}return null};var i=function(t){this._tmap=t};t.Obj.createSubclass(i,t.Automation),i.prototype.GetSubIdForDomElement=function(t){var e=this._tmap.getEventManager().GetLogicalObject(t);return e&&(e instanceof c||e instanceof h)?this._getSubId(e):null},i.prototype.getDomElementForSubId=function(e){if(e==t.Automation.TOOLTIP_SUBID)return this.GetTooltipElement(this._tmap);var a=e.indexOf(":"),i=e.indexOf("[");if(a>0&&i>0){var r=e.substring(0,a),n=e.substring(a+1,i),o=parseInt(e.substring(i+1,e.length-1));return this._getDomElement(r,n,o)}return null},i.prototype.getData=function(t,e,a){var i=this._getDataObject(t,e,a);if(i){var r={};r.color=i.getDatatipColor(),r.tooltip=i.getShortDesc();var n=i.getLabel();return r.label=n?n.getTextString():null,r.selected=i.isSelected(),r}return null},i.prototype._getDomElement=function(t,e,a){var i=this._getDataObject(t,e,a);return i?i.getDisplayable().getElem():null},i.prototype._getSubId=function(e){for(var a=e.getDisplayable(),i=this._tmap.getAllLayers(),r=0;r<i.length;r++){var n=i[r].getDataLayers();for(var o in n)if(a instanceof t.Path){for(var s=n[o].getAreaObjects(),l=0;l<s.length;l++)if(s[l]===e)return this._getDataLayerId(o)+":area["+l+"]";var h=n[o].getLinkObjects();for(l=0;l<h.length;l++)if(h[l]===e)return this._getDataLayerId(o)+":link["+l+"]"}else{var c=n[o].getMarkerObjects();for(l=0;l<c.length;l++)if(c[l]===e)return this._getDataLayerId(o)+":marker["+l+"]"}}return null},i.prototype._getDataObject=function(t,e,a){for(var i=this._tmap.getAllLayers(),r=0;r<i.length;r++){var n=i[r].getDataLayers();for(var o in n)if(this._getDataLayerId(o)==t){if("area"==e)return n[o].getDataAreaCollection()[a];if("marker"==e)return n[o].getDataMarkerCollection()[a];if("link"==e)return n[o].getDataLinkCollection()[a]}}return null},i.prototype._getDataLayerId=function(t){var e=t.lastIndexOf(":");return e>0?t.substring(e+1):t};var r=function(t,e){this.Init(t,e)};t.Obj.createSubclass(r,t.Path),r.HOVER_STROKE_WIDTH=2,r.SELECTED_INNER_STROKE_WIDTH=1,r.SELECTED_OUTER_STROKE_WIDTH=4,r.SELECTED_HOVER_OUTER_STROKE_WIDTH=6,r.prototype.Init=function(t,e){r.superclass.Init.call(this,t),this.Zoom=1,this._bSupportsVectorEffects=e},r.prototype.setSelected=function(t){this.IsSelected!=t&&(t&&(this.isHoverEffectShown()?(this.CreateSelectedHoverStrokes(),this.SelectedHoverInnerStroke=this._adjustStrokeZoomWidth(this.SelectedHoverInnerStroke,r.HOVER_STROKE_WIDTH),this.SelectedHoverOuterStroke=this._adjustStrokeZoomWidth(this.SelectedHoverOuterStroke,r.SELECTED_HOVER_OUTER_STROKE_WIDTH)):(this.SelectedInnerStroke=this._adjustStrokeZoomWidth(this.SelectedInnerStroke,r.SELECTED_INNER_STROKE_WIDTH),this.SelectedOuterStroke=this._adjustStrokeZoomWidth(this.SelectedOuterStroke,r.SELECTED_OUTER_STROKE_WIDTH))),r.superclass.setSelected.call(this,t))},r.prototype.showHoverEffect=function(){this.isSelected()?(this.CreateSelectedHoverStrokes(),this.SelectedHoverInnerStroke=this._adjustStrokeZoomWidth(this.SelectedHoverInnerStroke,r.HOVER_STROKE_WIDTH),this.SelectedHoverOuterStroke=this._adjustStrokeZoomWidth(this.SelectedHoverOuterStroke,r.SELECTED_HOVER_OUTER_STROKE_WIDTH)):this.HoverInnerStroke=this._adjustStrokeZoomWidth(this.HoverInnerStroke,r.HOVER_STROKE_WIDTH),r.superclass.showHoverEffect.call(this)},r.prototype.CreateSelectedHoverStrokes=function(){this.SelectedHoverInnerStroke||(this.SelectedHoverInnerStroke=this.HoverInnerStroke.clone(),this.SelectedHoverInnerStroke.setWidth(r.HOVER_STROKE_WIDTH),this._bSupportsVectorEffects&&this.SelectedHoverInnerStroke.setFixedWidth(!0)),this.SelectedHoverOuterStroke||(this.SelectedHoverOuterStroke=this.SelectedOuterStroke.clone(),this.SelectedHoverOuterStroke.setWidth(r.SELECTED_HOVER_OUTER_STROKE_WIDTH),this._bSupportsVectorEffects&&this.SelectedHoverOuterStroke.setFixedWidth(!0))},r.prototype.hideHoverEffect=function(){this.isSelected()&&(this.SelectedInnerStroke=this._adjustStrokeZoomWidth(this.SelectedInnerStroke,r.SELECTED_INNER_STROKE_WIDTH),this.SelectedOuterStroke=this._adjustStrokeZoomWidth(this.SelectedOuterStroke,r.SELECTED_OUTER_STROKE_WIDTH)),r.superclass.hideHoverEffect.call(this)},r.prototype.setHoverStroke=function(t,e){return r.superclass.setHoverStroke.call(this,t,e),this._bSupportsVectorEffects&&(this.HoverInnerStroke&&this.HoverInnerStroke.setFixedWidth(!0),this.HoverOuterStroke&&this.HoverOuterStroke.setFixedWidth(!0)),this},r.prototype.setSelectedStroke=function(t,e){return r.superclass.setSelectedStroke.call(this,t,e),this._bSupportsVectorEffects&&(this.SelectedInnerStroke&&this.SelectedInnerStroke.setFixedWidth(!0),this.SelectedOuterStroke&&this.SelectedOuterStroke.setFixedWidth(!0)),this},r.prototype.setSelectedHoverStroke=function(t,e){return r.superclass.setSelectedHoverStroke.call(this,t,e),this._bSupportsVectorEffects&&(this.SelectedHoverInnerStroke&&this.SelectedHoverInnerStroke.setFixedWidth(!0),this.SelectedHoverOuterStroke&&this.SelectedHoverOuterStroke.setFixedWidth(!0)),this},r.prototype._updateStrokeZoomWidth=function(t,e){if(!this._bSupportsVectorEffects){var a=t.getStroke();a&&((a=a.clone()).setWidth(e/this.Zoom),t.setStroke(a))}},r.prototype._adjustStrokeZoomWidth=function(t,e){if(!this._bSupportsVectorEffects){var a=t.clone();return a.setWidth(e/this.Zoom),a}return t},r.prototype.handleZoomEvent=function(t){this.Zoom=t.getA(),this.isSelected()?this.isHoverEffectShown()?(this._updateStrokeZoomWidth(this.InnerShape,r.HOVER_STROKE_WIDTH),this._updateStrokeZoomWidth(this,r.SELECTED_HOVER_OUTER_STROKE_WIDTH)):(this._updateStrokeZoomWidth(this.InnerShape,r.SELECTED_INNER_STROKE_WIDTH),this._updateStrokeZoomWidth(this,r.SELECTED_OUTER_STROKE_WIDTH)):this.isHoverEffectShown()?this._updateStrokeZoomWidth(this.InnerShape,r.HOVER_STROKE_WIDTH):this._updateStrokeZoomWidth(this,1)};var n,o=function(t,e,a){this.Init(t,e,a)};t.Obj.createSubclass(o,t.Container),o.prototype.Init=function(e,a,i){if(o.superclass.Init.call(this,e),this._dataItem=a,a instanceof t.BaseComponent)this._width=a.getWidth(),this._height=a.getHeight(),this.addChild(a);else{this.getElem().appendChild(a);var r=t.DisplayableUtils.getDimensionsForced(e,this);this._width=r.w,this._height=r.h}this._boundingRect=new t.Rect(e,0,0,this._width,this._height),this._boundingRect.setInvisibleFill();var n=new t.SolidStroke(i.selectedInnerColor,1,2),s=new t.SolidStroke("rgb(235, 236, 237)",1,2),l=new t.SolidStroke(i.selectedInnerColor,1,1),h=new t.SolidStroke(i.selectedOuterColor,1,2),c=new t.SolidStroke(i.selectedInnerColor,1,2),p=new t.SolidStroke(i.selectedOuterColor,1,2);this._boundingRect.setHoverStroke(n,s).setSelectedStroke(l,h).setSelectedHoverStroke(c,p),this._boundingRect.setStrokeAlignment(t.Stroke.OUTER),this.addChildAt(this._boundingRect,0)},o.prototype.setAriaProperty=function(e,a){t.Agent.isTouchDevice()?this._boundingRect.setAriaProperty(e,a):o.superclass.setAriaProperty.call(this,e,a)},o.prototype.setAriaRole=function(e){t.Agent.isTouchDevice()?this._boundingRect.setAriaRole(e):o.superclass.setAriaRole.call(this,e)},o.prototype.getWidth=function(){return this._width},o.prototype.getHeight=function(){return this._height},o.prototype.setSelectable=function(t){this._boundingRect.setSelectable(t)},o.prototype.isSelectable=function(){return this._boundingRect.isSelectable()},o.prototype.isSelected=function(){return this._boundingRect.isSelected()},o.prototype.setSelected=function(t){this._boundingRect.setSelected(t)},o.prototype.showHoverEffect=function(){this._boundingRect.showHoverEffect()},o.prototype.hideHoverEffect=function(){this._boundingRect.hideHoverEffect()},o.prototype.getRootElement=function(){return this._dataItem},o.prototype.updateRootElement=function(e){this._dataItem!==e&&(this._dataItem&&(this._dataItem instanceof t.BaseComponent?this.removeChild(this._dataItem):this.getElem().removeChild(this._dataItem)),e instanceof t.BaseComponent?this.addChild(e):this.getElem().appendChild(e),this._dataItem=e)},o.prototype.fireKeyboardListener=function(e){this._dataItem instanceof t.BaseComponent&&this._dataItem.fireKeyboardListener(e)},this?this.DvtBaseMapManager?n=this.DvtBaseMapManager:(n={},this.DvtBaseMapManager=n,n._UNPROCESSED_MAPS=[[],[],[]],n._UNPROCESSED_PARENT_UPDATES=[[]]):window.DvtBaseMapManager?n=window.DvtBaseMapManager:(n={},window.DvtBaseMapManager=n,n._UNPROCESSED_MAPS=[[],[],[]],n._UNPROCESSED_PARENT_UPDATES=[[]]),t.Obj.createSubclass(n,t.Obj,"DvtBaseMapManager"),n.TYPE_LABELS=0,n.TYPE_PATH=1,n.TYPE_PARENTREGION_CHILDREN=2,n.TYPE_LABELINFO=3,n.TYPE_DIM=4,n._INDEX="__index",n._GLOBAL_MAPS=new Object,n.getBaseMapDim=function(e,a){n._processUnprocessedMaps();var i=n._GLOBAL_MAPS[e][a];if(i){var r=i[n.TYPE_DIM];if(r)return new t.Rectangle(r[0],r[1],r[2],r[3])}return null},n.getAreaLabelInfo=function(t,e){n._processUnprocessedMaps();var a=n._GLOBAL_MAPS[t][e];return a?a[n.TYPE_LABELINFO]:null},n.getAreaIds=function(t,e){var a=[],i=n.getAreaPaths(t,e);for(var r in i)a.push(r);return a},n.getAreaLabels=function(t,e){n._processUnprocessedMaps();var a=n._GLOBAL_MAPS[t][e];return a?a[n.TYPE_LABELS]:null},n.getLongAreaLabel=function(t,e,a){n._processUnprocessedMaps();var i,r=n._GLOBAL_MAPS[t][e];return r&&(i=r[n.TYPE_LABELS]),i&&i[a]?i[a][1]:null},n.getCityCoordinates=function(e,a){n._processUnprocessedMaps();var i=n._GLOBAL_MAPS[e];if(i){var r=i.cities;if(r){var o=r[n.TYPE_PATH][a];if(o)return new t.Point(o[0],o[1])}}return null},n.getCityLabel=function(t,e){n._processUnprocessedMaps();var a=n._GLOBAL_MAPS[t];if(a){var i=a.cities;if(i){var r=i[n.TYPE_LABELS][e];if(r)return r[1]}}return null},n.getAreaCenter=function(e,a,i){n._processUnprocessedMaps();var r=n._GLOBAL_MAPS[e];if(r){var o=r[a];if(o){var s=o[n.TYPE_LABELINFO];if(s&&s[i]){var l=s[i][0];return t.Rectangle.create(l).getCenter()}}}return null},n.getAreaPaths=function(t,e,a,i,r){n._processUnprocessedMaps();var o=n._GLOBAL_MAPS[t][e],s=o[n.TYPE_PATH],l=o[n.TYPE_DIM];return l?n._simplifyAreaPaths(s,l[2],l[3],a,i,r):s},n.getPathForArea=function(t,e,a){n._processUnprocessedMaps();var i=n._GLOBAL_MAPS[t][e];return i?i[n.TYPE_PATH][a]:null},n.registerBaseMapLayer=function(t,e,a,i,r,o,s,l){var h=n._GLOBAL_MAPS[t];h||((h=new Object)[n._INDEX]=new Array,n._GLOBAL_MAPS[t]=h);var c=h[e];c||(c=new Object,h[e]=c,null!=s&&(h[n._INDEX][s]=e)),c[n.TYPE_LABELS]=a,c[n.TYPE_PATH]=i,c[n.TYPE_PARENTREGION_CHILDREN]=r,c[n.TYPE_LABELINFO]=o,c[n.TYPE_DIM]=l,c[n._INDEX]=s},n.registerResourceBundle=function(t,e,a){var i,r=n._GLOBAL_MAPS[t];r||(r=new Object,n._GLOBAL_MAPS[t]=r),(i=r[e])||(i=new Object,r[e]=i),(i=r[e])&&(i[n.TYPE_LABELS]=a)},n.updateResourceBundle=function(t,e,a){var i=n._GLOBAL_MAPS[t];if(i){var r=i[e];if(r)for(var o in a)r[n.TYPE_LABELS][o]=a[o]}},n._processUnprocessedMaps=function(){var t,e=n._UNPROCESSED_MAPS;if(e){for(_=0;_<e[0].length;_++)t=e[0][_],n.registerBaseMapLayer(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7]);for(_=0;_<e[1].length;_++)t=e[1][_],n.registerResourceBundle(t[0],t[1],t[2]);for(_=0;_<e[2].length;_++)t=e[2][_],n.updateResourceBundle(t[0],t[1],t[2]);n._UNPROCESSED_MAPS=[[],[],[]]}var a=n._UNPROCESSED_PARENT_UPDATES;if(a){for(_=0;_<a[0].length;_++){var i,r,o=(t=a[0][_])[0],s=t[1],l=t[2],h=n._GLOBAL_MAPS[o];if(h){if(r=h[s]){r[n.TYPE_PARENTREGION_CHILDREN]=t[3],i=r[n.TYPE_DIM];var c=r[n._INDEX],p=h[n._INDEX];p.splice(c,0,l),h[l][n._INDEX]=c;for(var _=c+1;_<p.length;_++){var g=h[p[_]];g&&g[n._INDEX]++}}(r=h[t[2]])&&(r[n.TYPE_DIM]=i)}}n._UNPROCESSED_PARENT_UPDATES=[[]]}},n._simplifyAreaPaths=function(e,a,i,r,n,o){if(o>0){var s=r/a,l=n/i,h=1/(Math.min(s,l)*o);if(h<=1)return e;var c=[];if(e)for(var p in e){var _=e[p];isNaN(_)&&(_=t.PathUtils.createPathArray(e[p])),c[p]=t.PathUtils.simplifyPath(_,h)}return c}return e},n.getLayerIds=function(t,e){n._processUnprocessedMaps();var a=n._GLOBAL_MAPS[t][e],i={};if(a){var r=a[n.TYPE_LABELS];for(var o in r)i[o]=r[o][1];if("cities"!==e&&!r)for(var s=n.getAreaIds(t,e),l=0;l<s.length;l++)i[s[l]]=null}return i};var s=function(t,e){this.Init(t,e)};t.Obj.createSubclass(s,t.Obj),s.prototype.Init=function(t,e){this._displayable=t,this._category=e},s.prototype.getCategories=function(){return this._category},s.prototype.getDisplayables=function(){return[this._displayable]};var l=function(t,e,a,i,r,n){this.Init(t,e,a,i,r,n)};t.Obj.createSubclass(l,t.OutputText),l.prototype.Init=function(e,a,i,r,n,o){if(l.superclass.Init.call(this,e,a,0,0),this._bSupportsVectorEffects=o,this._boundRectangle=new Array,this.setMouseEnabled(!1),this.alignCenter(),this.alignMiddle(),this._center=null,this._labelDisplay=r,this._parentContainer=n,i&&(this._boundRectangle.push(t.Rectangle.create(i[0])),i.length>1)){this._leaderLines=new Array;for(var s=1;s<i.length;s++){var h=i[s];this._boundRectangle.push(t.Rectangle.create(h[0]));var c=new t.Polyline(e,h[1]);c.setPixelHinting(!0);var p=new t.SolidStroke("#000000");this._bSupportsVectorEffects&&p.setFixedWidth(!0),c.setStroke(p),this._leaderLines.push(c)}}},l.prototype.addBounds=function(t){this._boundRectangle.push(t)},l.prototype.hasBounds=function(){return this._boundRectangle.length>0},l.prototype.update=function(e){for(var a=e.getA(),i=-1,r=this.getDimensions(),n=0;n<this._boundRectangle.length;n++){var o=this._boundRectangle[n].w*a,s=this._boundRectangle[n].h*a;if(r.h<=s&&r.w<=o){i=n;break}}if(-1==i&&"on"==this._labelDisplay&&(i=this._boundRectangle.length-1),this._currentState!=i){if(-1==i)this.reset();else{this.getParent()||this._parentContainer.addChild(this);var l=this._boundRectangle[i].getCenter();if(this.setCenter(l),this._leaderLines)if(this._parentContainer.removeChild(this._leaderLine),this._leaderLine=null,i>0){this._leaderLine=this._leaderLines[i-1],this._parentContainer.addChild(this._leaderLine),(_=this.getCSSStyle()).setStyle(t.CSSStyle.COLOR,"#000000"),this.setCSSStyle(_);var h=this._boundRectangle[i],c=this._leaderLine.getPoints(),p=c.length;h.x>c[p-2]?(this.alignLeft(),this.alignMiddle(),this.setCenter(new t.Point(h.x,l.y))):h.y>c[p-1]?(this.alignTop(),this.alignCenter(),this.setCenter(new t.Point(l.x,h.y))):h.x+h.w<c[p-2]?(this.alignRight(),this.alignMiddle(),this.setCenter(new t.Point(h.x+h.w,l.y))):h.y+h.h<c[p-1]&&(this.alignBottom(),this.alignCenter(),this.setCenter(new t.Point(l.x,h.y+h.h)))}else{var _;this.alignCenter(),this.alignMiddle(),(_=this.getCSSStyle()).setStyle(t.CSSStyle.COLOR,this._labelColor),this.setCSSStyle(_)}}this._currentState=i}if(-1!=this._currentState){var g=new t.Matrix;if(g.translate(a*this._center.x-this._center.x,a*this._center.y-this._center.y),this.setMatrix(g),this._leaderLine&&(this._leaderLine.setMatrix(new t.Matrix(a,0,0,a)),!this._bSupportsVectorEffects)){var d=this._leaderLine.getStroke().clone();d.setWidth(1/a),this._leaderLine.setStroke(d)}}},l.prototype.setCenter=function(t){this._center=t,this.setX(t.x),this.setY(t.y)},l.prototype.getLeaderLine=function(){return this._leaderLine},l.prototype.getCenter=function(){return this._center},l.prototype.setCSSStyle=function(e){l.superclass.setCSSStyle.call(this,e),this._labelColor||(this._labelColor=e.getStyle(t.CSSStyle.COLOR))},l.prototype.reset=function(){this._parentContainer.removeChild(this),this._currentState=-1,this._leaderLine&&(this._parentContainer.removeChild(this._leaderLine),this._leaderLine=null)};var h=function(t,e,a,i,r,n){this.Init(t,e,a,i,r,n)};t.Obj.createSubclass(h,t.Obj,"DvtMapObjPeer"),h.ANIMATION_DELETE_PRIORITY=0,h.ANIMATION_UPDATE_PRIORITY=1,h.ANIMATION_INSERT_PRIORITY=2,h.prototype.Init=function(t,e,a,i,r,n){if(this._data=t,this._itemData=this._data._itemData,this._dataLayer=e,this.Displayable=a,this._isSelected=!1,this._isShowingHoverEffect=!1,this._isShowingKeyboardFocusEffect=!1,this.Displayable.setDataColor&&this.Displayable.setDataColor(t.color),this._label=i,this._center=r,this.Zoom=1,this._view=e.getMap(),this._locationName=n,this._data.categories||this._label&&(this._data.categories=[this._label.getTextString()]),"auto"==this._view.getDisplayTooltips()&&n&&(this._data.shortDesc=t.shortDesc?n+": "+t.shortDesc:n),this.Displayable){var o=t.svgStyle||t.style,s=t.svgClassName||t.className;this.Displayable.setStyle(o).setClassName(s),this.Displayable.setAriaRole("img")}this.UpdateAriaLabel(),this.setSelectable(this.isSelectable())},h.prototype.getId=function(){return this._data.id},h.prototype.getLocation=function(){return this._data.location},h.prototype.getLocationName=function(){return this._locationName},h.prototype.getCenter=function(){return this._center},h.prototype._setCenter=function(t){this._center=t,this.__recenter()},h.prototype.getDisplayable=function(){return this.Displayable},h.prototype.getLabel=function(){return this._label},h.prototype.getDataLayer=function(){return this._dataLayer},h.prototype.hasAction=function(){return null!=this.getAction()},h.prototype.getAction=function(){return this._data.action},h.prototype.setVisible=function(t){this.Displayable.setVisible(t),this._label&&this._label.setVisible(t)},h.prototype.getShortDesc=function(){return this._data.shortDesc},h.prototype.removeLabel=function(){this._label=null},h.prototype.getSize=function(){return this.Displayable.getWidth?this.Displayable.getWidth()*this.Displayable.getHeight():0},h.prototype.getCategories=function(){var t=this._data.categories;return t||[]},h.prototype.getDatatip=function(){if("none"!=this._view.getDisplayTooltips()){var t=this._view.getOptions()._tooltip;return t?this._view.getCtx().getTooltipManager().getCustomTooltip(t.renderer,this.getDataContext()):this.getShortDesc()}return null},h.prototype.getDataContext=function(){return{color:this.getDatatipColor(),component:this._view.getOptions()._widgetConstructor,data:this._data,id:this.getId(),itemData:this._itemData,label:this._label?this._label.getTextString():null,location:this.getLocation(),locationName:this.getLocationName(),tooltip:this.getShortDesc(),x:this._data.x,y:this._data.y}},h.prototype.getDatatipColor=function(){return this._data.color?this._data.color:"#000000"},h.prototype.getAriaLabel=function(){var e=[];return this.isSelectable()&&e.push(t.Bundle.getTranslatedString(t.Bundle.UTIL_PREFIX,this.isSelected()?"STATE_SELECTED":"STATE_UNSELECTED")),t.Displayable.generateAriaLabel(this.getShortDesc(),e)},h.prototype.getDisplayables=function(){return[this.getDisplayable()]},h.prototype.UpdateAriaLabel=function(){if(!t.Agent.deferAriaCreation()){var e=this.getAriaLabel();e&&this.Displayable.setAriaProperty("label",e)}},h.prototype.setSelectable=function(e){var a=this.getLabel();this.Displayable.setSelectable&&(this.Displayable.setSelectable(e),a&&e&&a.setCursor(t.SelectionEffectUtils.getSelectingCursor()))},h.prototype.isSelectable=function(){return!!this.Displayable.isSelectable&&("off"!==this._data.selectable&&this._dataLayer.isSelectable())},h.prototype.isSelected=function(){return this._isSelected},h.prototype.setSelected=function(t){if(this.isSelectable()){var e=this._getState();this._isSelected=t,this._dataLayer.getOptions().selectionRenderer?this._callCustomRenderer(this._dataLayer.getOptions().selectionRenderer,this._getState(),e):this.processDefaultSelectionEffect(t),this.UpdateAriaLabel()}},h.prototype.showHoverEffect=function(){if(!this.IsHoverEffectShown()){var t=this._getState();this._isShowingHoverEffect=!0,this._dataLayer.getOptions().hoverRenderer?this._callCustomRenderer(this._dataLayer.getOptions().hoverRenderer,this._getState(),t):this.processDefaultHoverEffect(!0)}},h.prototype.hideHoverEffect=function(){if(this.IsHoverEffectShown()){var t=this._getState();this._isShowingHoverEffect=!1,this._dataLayer.getOptions().hoverRenderer?this._callCustomRenderer(this._dataLayer.getOptions().hoverRenderer,this._getState(),t):this.processDefaultHoverEffect(!1)}},h.prototype.setShowPopupBehaviors=function(t){this._showPopupBehaviors=t},h.prototype.getShowPopupBehaviors=function(){return this._showPopupBehaviors},h.prototype.isDragAvailable=function(t){for(var e=this._dataLayer.getClientId(),a=0;a<t.length;a++)if(t[a]==e)return e;return e},h.prototype.getDragTransferable=function(t,e){return this._dataLayer.__getDragTransferable(this)},h.prototype.getDragFeedback=function(t,e){return this._dataLayer.__getDragFeedback()},h.prototype.getNextNavigable=function(e){var a;if(e.type==t.MouseEvent.CLICK)return this;if(e.keyCode==t.KeyboardEvent.SPACE&&e.ctrlKey)return this;if((e.keyCode==t.KeyboardEvent.OPEN_ANGLED_BRACKET||t.KeyboardEvent.CLOSE_ANGLED_BRACKET)&&e.altKey){var i=this.getDataLayer().getNavigableLinksForNodeId(this.getId());a=y.getFirstNavigableLink(this,e,i)}else a=t.KeyboardHandler.getNextAdjacentNavigable(this,e,this.GetNavigables());return this.getDataLayer().getMap().ensureObjInViewport(e,a),a},h.prototype.GetNavigables=function(){return this.getDataLayer().getMap().getNavigableMarkers()},h.prototype.getKeyboardBoundingBox=function(e){return this.Displayable.getParent()?this.Displayable.getDimensions(e||this.Displayable.getCtx().getStage()):new t.Rectangle(0,0,0,0)},h.prototype.getTargetElem=function(){return this.Displayable.getElem()},h.prototype.showKeyboardFocusEffect=function(){if(!this.isShowingKeyboardFocusEffect()){var t=this._getState();this._isShowingKeyboardFocusEffect=!0,this._dataLayer.getOptions().focusRenderer?this._callCustomRenderer(this._dataLayer.getOptions().focusRenderer,this._getState(),t):this.processDefaultFocusEffect(!0)}},h.prototype.hideKeyboardFocusEffect=function(){if(this.isShowingKeyboardFocusEffect()){var t=this._getState();this._isShowingKeyboardFocusEffect=!1,this._dataLayer.getOptions().focusRenderer?this._callCustomRenderer(this._dataLayer.getOptions().focusRenderer,this._getState(),t):this.processDefaultFocusEffect(!1)}},h.prototype.isShowingKeyboardFocusEffect=function(){return this._isShowingKeyboardFocusEffect},h.prototype.HandleZoomEvent=function(t){this.Displayable.getParent()&&(this.Zoom=t.getA(),this.__recenter())},h.prototype.positionLabel=function(){if(this._label){this._label.alignCenter();var e,a=this.Displayable.getCx()*this.Zoom,i=this.Displayable.getCy()*this.Zoom,r=this.Displayable.getHeight(),n=this.Displayable instanceof t.SimpleMarker?this.Displayable.getType():"image",o=this._data.labelPosition;"top"==o?(e=i-r/2-4,this._label.alignBottom()):"bottom"==o?(e=i+r/2,this._label.alignTop()):n==t.SimpleMarker.TRIANGLE_UP?(e=i+r/6,this._label.alignMiddle()):n==t.SimpleMarker.TRIANGLE_DOWN?(e=i-r/6,this._label.alignMiddle()):(e=i,this._label.alignMiddle()),this._label.setX(a).setY(e)}},h.prototype.__recenter=function(){var e=this.Displayable.getWidth(),a=this.Displayable.getHeight();if(null!=e&&null!=a&&this.Displayable.getParent()){var i=0,r=this._center.x,n=this._center.y;this.Displayable.getRotation&&(i=this.Displayable.getRotation(),r=this._center.x*Math.cos(i)-this._center.y*Math.sin(i),n=this._center.x*Math.sin(i)+this._center.y*Math.cos(i)),r=this._center.x*this.Zoom-r,n=this._center.y*this.Zoom-n,this.Displayable instanceof o&&(r+=this._center.x-e/2,n+=this._center.y-a/2),this.Displayable.setTranslate(r,n),t.Agent.workaroundFirefoxRepaint(this.Displayable),this.positionLabel()}},h.prototype.animateUpdate=function(e,a){var i=new t.CustomAnimation(this._view.getCtx(),this.Displayable,this.getDataLayer().getAnimationDuration()),r=a.getDisplayable();if(this.Displayable.getFill){var n=r.getFill(),o=this.Displayable.getFill();if(o instanceof t.SolidFill&&!o.equals(n)){if(this.Displayable.setFill(n),a.getLabel()&&this._label){var s=this._label.getFill();this._label.setFill(a.getLabel().getFill().clone()),s.equals(this._label.getFill())||i.getAnimator().addProp(t.Animator.TYPE_FILL,this._label,this._label.getFill,this._label.setFill,s)}i.getAnimator().addProp(t.Animator.TYPE_FILL,this.Displayable,this.Displayable.getFill,this.Displayable.setFill,o)}}if(this.Displayable.getCenterDimensions){var l=a.getDisplayable().getCenterDimensions(),c=this.Displayable.getCenterDimensions();l.x==c.x&&l.y==c.y&&l.w==c.w&&l.h==c.h||(this.Displayable.setCenterDimensions(l),i.getAnimator().addProp(t.Animator.TYPE_RECTANGLE,this.Displayable,this.Displayable.getCenterDimensions,this.Displayable.setCenterDimensions,c))}var p=r.getRotation(),_=this.Displayable.getRotation();if(p!=_){var g=p-_;g>Math.PI?p-=2*Math.PI:g<-Math.PI&&(p+=2*Math.PI),this.Displayable.setRotation(p),i.getAnimator().addProp(t.Animator.TYPE_NUMBER,this.Displayable,this.Displayable.getRotation,this.Displayable.setRotation,_)}var d=a.getCenter(),u=this.getCenter();if(d&&u&&(d.x==u.x&&d.y==u.y&&p==_||(this._setCenter(new t.Point(d.x,d.y)),i.getAnimator().addProp(t.Animator.TYPE_POINT,this,this.getCenter,this._setCenter,new t.Point(u.x,u.y)))),this._label&&a.getLabel()){var y=a.getLabel().getX(),f=this._label.getX();y!=f&&(this._label.setX(y),i.getAnimator().addProp(t.Animator.TYPE_NUMBER,this._label,this._label.getX,this._label.setX,f));var S=a.getLabel().getY(),m=this._label.getY();S!=m&&(this._label.setY(S),i.getAnimator().addProp(t.Animator.TYPE_NUMBER,this._label,this._label.getY,this._label.setY,m)),a.getLabel().setAlpha(0)}else a.getLabel()&&a.getLabel().setAlpha(0);r.setAlpha(0),e.add(i,h.ANIMATION_UPDATE_PRIORITY)},h.prototype.animateDelete=function(e,a){var i=[this.Displayable],r=this.getLabel();r&&i.push(r);var n=new t.AnimFadeOut(this._view.getCtx(),i,this.getDataLayer().getAnimationDuration());e.add(n,h.ANIMATION_DELETE_PRIORITY)},h.prototype.animateInsert=function(e){var a=[this.Displayable];this.Displayable.setAlpha(0);var i=this.getLabel();i&&(i.setAlpha(0),a.push(i));var r=new t.AnimFadeIn(this._view.getCtx(),a,this.getDataLayer().getAnimationDuration());e.add(r,h.ANIMATION_INSERT_PRIORITY)},h.prototype.processDefaultSelectionEffect=function(t){this.Displayable.setSelected&&this.Displayable.setSelected(t)},h.prototype.processDefaultFocusEffect=function(t){this.processDefaultHoverEffect(t)},h.prototype.processDefaultHoverEffect=function(t){t?this.Displayable.showHoverEffect&&this.Displayable.showHoverEffect():this.Displayable.hideHoverEffect&&!this.isShowingKeyboardFocusEffect()&&this.Displayable.hideHoverEffect()},h.prototype._callCustomRenderer=function(t,e,a){if(this.Displayable instanceof o){var i=this._view.getOptions()._contextHandler;if(i){var r=this.Displayable.getRootElement(),n=t(i(this.Displayable.getElem(),r,this._data,this._itemData,e,a));!n&&r&&this._view.getCtx().isCustomElement()||this.Displayable.updateRootElement(n)}}},h.prototype.IsHoverEffectShown=function(){return this._isShowingHoverEffect},h.prototype._getState=function(){return{hovered:this.IsHoverEffectShown(),selected:this.isSelected(),focused:this.isShowingKeyboardFocusEffect()}};var c=function(t,e,a,i,r){this.Init(t,e,a,i,r)};t.Obj.createSubclass(c,h,"DvtMapAreaPeer"),c.prototype.Init=function(t,e,a,i,r){c.superclass.Init.call(this,t,e,a,i,null,r)},c.prototype.setAreaLayer=function(t){this._dataAreaLayer=t},c.prototype.setSelected=function(t){this.isSelectable()&&(t&&!this.IsHoverEffectShown()&&this._dataAreaLayer.addChild(this.Displayable),c.superclass.setSelected.call(this,t))},c.prototype.showHoverEffect=function(){this._dataAreaLayer.addChild(this.Displayable),c.superclass.showHoverEffect.call(this)},c.prototype.hideHoverEffect=function(){this.isSelected()?this._dataAreaLayer.addChild(this.Displayable):this._dataAreaLayer.addChildAt(this.Displayable,0),c.superclass.hideHoverEffect.call(this)},c.prototype.HandleZoomEvent=function(t){c.superclass.HandleZoomEvent.call(this,t),this.Displayable.getParent()&&(this.Displayable.handleZoomEvent(t),this.positionLabel(t))},c.prototype.positionLabel=function(t){this.getLabel()&&this.getLabel().update(t)},c.prototype.GetNavigables=function(){return this.getDataLayer().getMap().getNavigableAreas()},c.prototype.animateUpdate=function(t,e){c.superclass.animateUpdate.call(this,t,e),this.getDataLayer().getMapLayer().setAreaRendered(this.getLocation(),!1)},c.prototype.__recenter=function(){};var p=function(t,e,a,i,r,n,o){this.Init(t,e,a,i,r,n,o)};t.Obj.createSubclass(p,h,"DvtMapLinkPeer"),p.prototype.Init=function(t,e,a,i,r,n,o){p.superclass.Init.call(this,t,e,a),this._startPt=i,this._endPt=r,this._startMarker=n,this._endMarker=o},p.prototype.getStartMarker=function(){return this._startMarker},p.prototype.getEndMarker=function(){return this._endMarker},p.prototype.getStartPoint=function(){return this._startPt},p.prototype.getEndPoint=function(){return this._endPt},p.prototype.getNextNavigable=function(e){var a,i=this._dataLayer.getMap().EventManager.getKeyboardHandler();if(e.type==t.MouseEvent.CLICK)return this;if(e.keyCode==t.KeyboardEvent.SPACE&&e.ctrlKey)return this;if(i.getLinkNavigationType()===y.LINK_NODE_NAV)if(e.keyCode===t.KeyboardEvent.UP_ARROW){var r=i.getLinkMarker().getId(),n=(o=this.getDataLayer().getNavigableLinksForNodeId(r)).indexOf(this);++n===o.length&&(n=0),a=o[n]}else if(e.keyCode===t.KeyboardEvent.DOWN_ARROW){var o;r=i.getLinkMarker().getId(),n=(o=this.getDataLayer().getNavigableLinksForNodeId(r)).indexOf(this);-1===--n&&(n=o.length-1),a=o[n]}else if(e.keyCode===t.KeyboardEvent.LEFT_ARROW)a=this.getStartPoint().x<=this.getEndPoint().x?this.getStartMarker():this.getEndMarker();else{if(e.keyCode!==t.KeyboardEvent.RIGHT_ARROW)return this;a=this.getStartPoint().x>=this.getEndPoint().x?this.getStartMarker():this.getEndMarker()}else a=t.KeyboardHandler.getNextAdjacentNavigable(this,e,this.GetNavigables());return this.getDataLayer().getMap().ensureObjInViewport(e,a),a},p.prototype.GetNavigables=function(){return this.getDataLayer().getMap().getNavigableLinks()},p.prototype.__recenter=function(){if(this.Displayable.getParent()){var e=new t.Point(this._startPt.x*this.Zoom,this._startPt.y*this.Zoom),a=new t.Point(this._endPt.x*this.Zoom,this._endPt.y*this.Zoom),i=S.calcCurve(this._dataLayer,this._startPt,this._endPt,e,a);this.Displayable.setCmds(i),t.Agent.workaroundFirefoxRepaint(this.Displayable)}},p.prototype.animateUpdate=function(e,a){var i=new t.CustomAnimation(this._view.getCtx(),this.Displayable,this.getDataLayer().getAnimationDuration()),r=a.getDisplayable(),n=r.getStroke(),o=this.Displayable.getStroke();o.getColor()!=n.getColor()&&(this.Displayable.setStroke(n),i.getAnimator().addProp(t.Animator.TYPE_STROKE,this.Displayable,this.Displayable.getStroke,this.Displayable.setStroke,o));var s=a.getStartPoint(),l=a.getEndPoint(),c=this.getStartPoint(),p=this.getEndPoint(),_=!0;s.equals(c)&&l.equals(p)||(_=!1,this.Displayable.setAlpha(0),i.getAnimator().addProp(t.Animator.TYPE_NUMBER,this.Displayable,this.Displayable.getAlpha,this.Displayable.setAlpha,1),i.getAnimator().addProp(t.Animator.TYPE_NUMBER,r,r.getAlpha,r.setAlpha,0)),_&&r.setAlpha(0),e.add(i,h.ANIMATION_UPDATE_PRIORITY)};var _=function(t,e,a,i,r,n){this.Init(t,e,a,i,r,n)};t.Obj.createSubclass(_,t.Container),_._DEFAULT_STROKE_WIDTH=1,_.prototype.Init=function(t,e,a,i,r,n){_.superclass.Init.call(this,t),this._areaId=i,this._areaName=r,this._shape=a,this.addChild(this._shape),this._view=e,this._bSupportsVectorEffects=n;var o=a.getStroke();o&&(this._areaStrokeWidth=o.getWidth())},_.prototype.getAreaId=function(){return this._areaId},_.prototype.getDatatip=function(){if("none"!=this._view.getDisplayTooltips()){var t=this._view.getOptions()._tooltip;return t?this._view.getCtx().getTooltipManager().getCustomTooltip(t.renderer,this.getDataContext()):this._tooltip}return null},_.prototype.setDatatip=function(t){this._tooltip=t},_.prototype.getDataContext=function(){return{color:null,component:this._view.getOptions()._widgetConstructor,data:null,id:null,label:null,location:this.getAreaId(),locationName:this._areaName,tooltip:this._tooltip,x:null,y:null}},_.prototype.getStroke=function(){return this._shape instanceof t.Shape?this._shape.getStroke():null},_.prototype.setStroke=function(e){this._shape instanceof t.Shape&&this._shape.setStroke(e)},_.prototype.setFill=function(e){this._shape instanceof t.Shape&&this._shape.setFill(e)},_.prototype.getFill=function(){return this._shape instanceof t.Shape?this._shape.getFill():null},_.prototype.getCmds=function(){return this._shape instanceof t.Path?this._shape.getCmds():null},_.prototype.setCmds=function(e){this._shape instanceof t.Path&&this._shape.setCmds(e)},_.prototype.setSrc=function(e){this._shape instanceof t.Image&&this._shape.setSrc(e)},_.prototype.getDropSiteFeedback=function(){return this._shape.copyShape()},_.prototype.contains=function(t,e){var a=this.getDimensions();return t>=a.x&&t<=a.x+a.w&&e>=a.y&&e<=a.y+a.h},_.prototype.HandleZoomEvent=function(t){if(!this._bSupportsVectorEffects&&this._shape&&this._areaStrokeWidth){var e=this._shape.getStroke().clone();e.setWidth(this._areaStrokeWidth/t.getA()),this._shape.setStroke(e)}};var g=function(t,e,a){this.Init(t,e,a)};t.Obj.createSubclass(g,t.Obj),g.prototype.Init=function(e,a,i){this._tmap=e,this.LayerName=a,this.EventHandler=i,this.DataLayers={},this.PzcMatrix=new t.Matrix},g.prototype.addDataLayer=function(t){this.DataLayers[t.getClientId()]=t},g.prototype.PreDataLayerUpdate=function(){},g.prototype.PostDataLayerUpdate=function(){},g.prototype.updateDataLayer=function(e,a,i){if(this._animation&&this._animation.stop(!0),this.PzcMatrix=a,this._oldDataLayer=this.getDataLayer(e.getClientId()),this.addDataLayer(e),e.render(this.PzcMatrix),e.HandleZoomEvent(new t.ZoomEvent(t.ZoomEvent.SUBTYPE_ZOOMED),this.PzcMatrix),this._oldDataLayer){var r=e.getAnimation(),n=e.getAnimationDuration();if("auto"==r){var o=new t.DataAnimationHandler(this._tmap.getCtx());o.constructAnimation(this._oldDataLayer.getAllObjects(),e.getAllObjects()),this._animation=o.getAnimation()}else if(t.BlackBoxAnimationHandler.isSupported(r)){this._removeAnimRect=!0;for(var s=new t.Rectangle(0,0,this._tmap.getWidth(),this._tmap.getHeight()),l=this._oldDataLayer.getNonScaledContainers(),h=0;h<l.length;h++){(u=new t.Rect(this._tmap.getCtx(),0,0,this._tmap.getWidth(),this._tmap.getHeight())).setFill(null),l[h].addChild(u)}var c=e.getNonScaledContainers();for(h=0;h<c.length;h++){(u=new t.Rect(this._tmap.getCtx(),0,0,this._tmap.getWidth(),this._tmap.getHeight())).setFill(null),c[h].addChild(u)}var p=t.BlackBoxAnimationHandler.getCombinedAnimation(this._tmap.getCtx(),r,l,c,s,n),_=new t.Rectangle(0,0,this._tmap.getWidth()/this.PzcMatrix.getA(),this._tmap.getHeight()/this.PzcMatrix.getA()),g=this._oldDataLayer.getScaledContainers();for(h=0;h<g.length;h++){(u=new t.Rect(this._tmap.getCtx(),0,0,this._tmap.getWidth()/this.PzcMatrix.getA(),this._tmap.getHeight()/this.PzcMatrix.getA())).setFill(null),g[h].addChild(u)}var d=e.getScaledContainers();for(h=0;h<d.length;h++){var u;(u=new t.Rect(this._tmap.getCtx(),0,0,this._tmap.getWidth()/this.PzcMatrix.getA(),this._tmap.getHeight()/this.PzcMatrix.getA())).setFill(null),d[h].addChild(u)}var y=t.BlackBoxAnimationHandler.getCombinedAnimation(this._tmap.getCtx(),r,g,d,_,n);this._animation=new t.ParallelPlayable(this._tmap.getCtx(),[p,y])}else{var f=this._oldDataLayer.getContainers();for(h=0;h<f.length;h++){f[h].getParent().removeChild(f[h])}}if(this.PreDataLayerUpdate(),this._animation){this.EventHandler.removeListeners(this._callbackObj);var S=this;this._animation.setOnEnd(function(){S.OnAnimationEnd(e)},this),this._animation.play()}}else this.PostDataLayerUpdate(),this._tmap.OnUpdateLayerEnd()},g.prototype.getDataLayers=function(){return this.DataLayers},g.prototype.getDataLayer=function(t){return this.DataLayers?this.DataLayers[t]:null},g.prototype.getLayerName=function(){return this.LayerName},g.prototype.render=function(t){for(var e in this.PzcMatrix=t,this.DataLayers)this.DataLayers[e].render(t)},g.prototype.HandleZoomEvent=function(t,e){for(var a in this.PzcMatrix=e,this.DataLayers)this.DataLayers[a].HandleZoomEvent(t,e)},g.prototype.HandlePanEvent=function(t){for(var e in this.PzcMatrix=t,this.DataLayers)this.DataLayers[e].HandlePanEvent(t)},g.prototype.OnAnimationEnd=function(t){if(this._oldDataLayer)for(var e=this._oldDataLayer.getContainers(),a=0;a<e.length;a++){var i=e[a].getParent();i&&i.removeChild(e[a])}if(this._removeAnimRect){this._removeAnimRect=!1;var r=t.getNonScaledContainers();for(a=0;a<r.length;a++)r[a].removeChildAt(r[a].getNumChildren()-1);var n=t.getScaledContainers();for(a=0;a<n.length;a++)n[a].removeChildAt(n[a].getNumChildren()-1)}this.PostDataLayerUpdate(),this._tmap.OnUpdateLayerEnd(),this._animation=null,this.EventHandler.addListeners(this._callbackObj)},g.prototype.destroy=function(){var t=this.getDataLayers();for(var e in t)t[e].destroy()};var d=function(t,e,a,i,r){this.Init(t,e,a,i,r)};t.Obj.createSubclass(d,g),d._SHORT_NAME=0,d._LONG_NAME=1,d.prototype.Init=function(e,i,r,n,o){d.superclass.Init.call(this,e,i,o),this._labelDisplay=r,this._labelType=n,this._areaLabels=new Object,this.Areas=new Object,this.AreaShapes={},this.AreaLabels=null,this._labelInfo=null,this._renderArea={},this._renderLabel={},this._renderedLabels={},this.AreaContainer=new t.Container(this._tmap.getCtx()),this.LabelContainer=new t.Container(this._tmap.getCtx()),this._tmap.getAreaLayerContainer().addChildAt(this.AreaContainer,0),this._tmap.getLabelContainer().addChildAt(this.LabelContainer,0),this._dropTarget=new a(this,this._tmap.getMapName())},d.prototype.getDropTarget=function(){return this._dropTarget},d.prototype.getLabelType=function(){return this._labelType},d.prototype.setAreaShapes=function(t){for(var e in this.AreaShapes=t,t)this.setAreaRendered(e,!0)},d.prototype.setAreaLabels=function(t){for(var e in this.AreaLabels=t,t)this.setLabelRendered(e,!0)},d.prototype.getShortAreaName=function(t){return this.AreaLabels&&this.AreaLabels[t]?this.AreaLabels[t][d._SHORT_NAME]:null},d.prototype.getLongAreaName=function(t){return this.AreaLabels&&this.AreaLabels[t]?this.AreaLabels[t][d._LONG_NAME]:null},d.prototype.setAreaLabelInfo=function(t){this._labelInfo=t},d.prototype.getLabelInfoForArea=function(t){return this._labelInfo?this._labelInfo[t]:null},d.prototype.getArea=function(t){return this.Areas[t]},d.prototype.getAreaShape=function(t){return this.AreaShapes[t]},d.prototype.getLabelDisplay=function(){return this._labelDisplay},d.prototype.setDropSiteCSSStyle=function(t){this._dropSiteCSSStyle=t},d.prototype.setLayerCSSStyle=function(t){this._layerCSSStyle=t},d.prototype.getLayerCSSStyle=function(){return this._layerCSSStyle},d.prototype.setAreaRendered=function(t,e){this._renderArea[t]=e},d.prototype.setLabelRendered=function(t,e){this._renderLabel[t]=e},d.prototype.setIsolatedArea=function(t){for(var e in this._isolatedArea=t,this._layerDim=null,this.AreaShapes)e!=t&&(this._renderArea[e]=!1)},d.prototype.getIsolatedArea=function(){return this._isolatedArea},d.prototype.getLayerDim=function(){if(!this._layerDim){var e=this._tmap.getMapName();if(this._isolatedArea)this._layerDim=e?t.PathUtils.getDimensions(t.PathUtils.createPathArray(n.getPathForArea(this._tmap.getMapName(),this.LayerName,this._isolatedArea))):t.DisplayableUtils.getDimensionsForced(this._tmap.getCtx(),this.getAreaShape(this._isolatedArea));else if(e&&"world"!=e&&"worldRegions"!=e&&(this._layerDim=n.getBaseMapDim(this._tmap.getMapName(),this.LayerName)),!this._layerDim){var a=this.AreaContainer.getDimensions().getUnion(this._tmap.getDataAreaContainer().getDimensions());a.w>0&&a.h>0&&(this._layerDim=a)}}return this._layerDim},d.prototype._createAreaAndLabel=function(e){var a=this.AreaShapes[e];if(a){if(!this.Areas[e]){var i=this._tmap.getCtx(),r=this.AreaLabels&&this.AreaLabels[e]?this.AreaLabels[e][d._LONG_NAME]:null,n=new _(i,this._tmap,a,e,r,this._tmap.supportsVectorEffects());this.Areas[e]=n,this.EventHandler.associate(a,n),n.setDatatip(r)}if(this._renderLabel[e]){var o=this._areaLabels[e];if(!o&&"off"!=this._labelDisplay&&this.AreaLabels){var s="short"==this._labelType?this.AreaLabels[e][d._SHORT_NAME]:this.AreaLabels[e][d._LONG_NAME];if(s){if(this._labelInfo&&this._labelInfo[e])o=new l(this._tmap.getCtx(),s,this._labelInfo[e],this._labelDisplay,this.LabelContainer,this._tmap.supportsVectorEffects());else{var h=t.DisplayableUtils.getDimensionsForced(this._tmap.getCtx(),a);o=new l(this._tmap.getCtx(),s,[[h.x,h.y,h.w,h.h]],this._labelDisplay,this.LabelContainer,this._tmap.supportsVectorEffects())}this._areaLabels[e]=o,this._layerCSSStyle&&o.setCSSStyle(this._layerCSSStyle)}}}}},d.prototype._addAreaAndLabel=function(t,e){if(this.AreaShapes[t]){this.AreaContainer.addChild(this.Areas[t]);var a=this._areaLabels[t];a&&(this._renderLabel[t]?a.update(this.PzcMatrix):a.reset(),this._renderedLabels[t]=this._renderLabel[t]),e&&(e.push(this.Areas[t]),a&&(e.push(a),e.push(a.getLeaderLine())))}},d.prototype.resetRenderedAreas=function(){for(var t in this.AreaLabels)this.setAreaRendered(t,!0),this.setLabelRendered(t,!0)},d.prototype.updateDataLayer=function(t,e,a){if(d.superclass.updateDataLayer.call(this,t,e,a),a==this.getLayerName())for(var i in this.AreaShapes)this._createAreaAndLabel(i),this._renderArea[i]&&this._addAreaAndLabel(i)},d.prototype.render=function(t){for(var e in this.AreaShapes)this._createAreaAndLabel(e),this._renderArea[e]&&this._addAreaAndLabel(e);d.superclass.render.call(this,t)},d.prototype.PreDataLayerUpdate=function(){for(var t in this._renderArea)this._renderArea[t]||(this._createAreaAndLabel(t),this._addAreaAndLabel(t))},d.prototype.PostDataLayerUpdate=function(){for(var t in this._renderArea)if(!this._renderArea[t]){this.AreaContainer.removeChild(this.Areas[t]);var e=this._areaLabels[t];if(e){this._renderedLabels[t]=!1,this.LabelContainer.removeChild(e);var a=e.getLeaderLine();a&&this.LabelContainer.removeChild(a)}}},d.prototype._renderSelectedAreasAndLabels=function(t,e){for(var a=0;a<t.length;a++)this._createAreaAndLabel(t[a]),this._renderArea[t[a]]&&this._addAreaAndLabel(t[a],e)},d.prototype.__getObjectUnderPoint=function(t,e){for(var a in this.Areas)if(this.Areas[a].contains(t,e))return this.Areas[a];return null},d.prototype.__showDropSiteFeedback=function(e){if(this._dropSiteFeedback&&(this.AreaContainer.removeChild(this._dropSiteFeedback),this._dropSiteFeedback=null),e&&(this._dropSiteFeedback=e.getDropSiteFeedback(),this._dropSiteFeedback)){this._dropSiteFeedback.setFill(new t.SolidFill(this._dropSiteCSSStyle.getStyle(t.CSSStyle.BACKGROUND_COLOR)));var a=this._dropSiteCSSStyle.getStyle(t.CSSStyle.BORDER_WIDTH)?this._dropSiteCSSStyle.getStyle(t.CSSStyle.BORDER_WIDTH).substring(0,this._dropSiteCSSStyle.getStyle(t.CSSStyle.BORDER_WIDTH).indexOf("px")):1;this._tmap.supportsVectorEffects()||(a/=this.PzcMatrix.getA());var i=new t.SolidStroke(this._dropSiteCSSStyle.getStyle(t.CSSStyle.BORDER_COLOR),1,a);this._tmap.supportsVectorEffects()&&i.setFixedWidth(!0),this._dropSiteFeedback.setStroke(i),this.AreaContainer.addChild(this._dropSiteFeedback)}return this._dropSiteFeedback},d.prototype.HandleZoomEvent=function(t,e){if(d.superclass.HandleZoomEvent.call(this,t,e),!this._tmap.supportsVectorEffects())for(var a in this.Areas)this.Areas[a].HandleZoomEvent(e);for(var a in this._renderedLabels)if(this._renderedLabels[a]){var i=this._areaLabels[a];i&&i.update(e)}};var u=function(t,e,a,i,r){this.Init(t,e,a,i,r)};t.Obj.createSubclass(u,t.Obj),u.prototype.Init=function(e,a,i,r,n){this._tmap=e,this._clientId=i,this._options=n,this._areaObjs=[],this._markerObjs=[],this._linkObjs=[],this._dataAreaCollection=[],this._dataMarkerCollection=[],this._dataLinkCollection=[],this._eventHandler=r,this._linkMap={},this._dragSource=new t.DragSource(e.getCtx()),this._eventHandler.setDragSource(this._dragSource),this._dataAreaLayer=new t.Container(this._tmap.getCtx()),this._dataPointLayer=new t.Container(this._tmap.getCtx()),this._dataLabelLayer=new t.Container(this._tmap.getCtx()),this._dataLinkLayer=new t.Container(this._tmap.getCtx()),this._tmap.getDataAreaContainer().addChildAt(this._dataAreaLayer,0),this._tmap.getDataPointContainer().addChildAt(this._dataPointLayer,0),this._tmap.getLabelContainer().addChildAt(this._dataLabelLayer,0),this._tmap.getLinkContainer().addChildAt(this._dataLinkLayer,0),this._parentLayer=a},u.prototype.getOptions=function(){return this._options},u.prototype.getDragSource=function(){return this._dragSource},u.prototype.getContainers=function(){return[this._dataAreaLayer,this._dataPointLayer,this._dataLabelLayer,this._dataLinkLayer]},u.prototype.getScaledContainers=function(){return[this._dataAreaLayer]},u.prototype.getNonScaledContainers=function(){var t=[this._dataLabelLayer,this._dataLinkLayer];return this._tmap.isMarkerZoomBehaviorFixed()&&t.push(this._dataPointLayer),t},u.prototype.getDataLabelContainer=function(){return this._dataLabelLayer},u.prototype.getMapLayer=function(){return this._parentLayer},u.prototype.getMap=function(){return this._tmap},u.prototype.getAllObjects=function(){return this._markerObjs.concat(this._areaObjs).concat(this._linkObjs)},u.prototype.getAreaObjects=function(){return this._areaObjs},u.prototype.getMarkerObjects=function(){return this._markerObjs},u.prototype.getLinkObjects=function(){return this._linkObjs},u.prototype.getNavigableAreaObjects=function(){for(var t=[],e=0;e<this._areaObjs.length;e++)t.push(this._areaObjs[e]);return t},u.prototype.addMarkerObject=function(t){if(this._dataMarkerCollection.push(t),t){this._markerObjs.push(t),this._eventHandler.associate(t.getDisplayable(),t);var e=t.getLabel();e&&this._eventHandler.associate(e,t)}},u.prototype.addAreaObject=function(t){this._dataAreaCollection.push(t),t&&(this._areaObjs.push(t),this._eventHandler.associate(t.getDisplayable(),t),t.setAreaLayer(this._dataAreaLayer))},u.prototype.addLinkObject=function(t){this._dataLinkCollection.push(t),t&&(this._linkObjs.push(t),this._eventHandler.associate(t.getDisplayable(),t))},u.prototype.trackLink=function(t,e){var a=u._getLinkKey(t,e);return this._linkMap[a]?this._linkMap[a]++:this._linkMap[a]=1,this._linkMap[a]},u._getLinkKey=function(t,e){return t.x<e.x?t.x.toString()+t.y.toString()+e.x.toString()+e.y.toString():e.x.toString()+e.y.toString()+t.x.toString()+t.y.toString()},u.prototype.getDataAreaCollection=function(){return this._dataAreaCollection},u.prototype.getDataMarkerCollection=function(){return this._dataMarkerCollection},u.prototype.getDataLinkCollection=function(){return this._dataLinkCollection},u.prototype._removeAreaObject=function(t){var e=this._areaObjs.indexOf(t);-1!==e&&this._areaObjs.splice(e,1)},u.prototype.getClientId=function(){return this._clientId},u.prototype.setAnimation=function(t){this._animType=t},u.prototype.getAnimation=function(){return this._animType},u.prototype.setAnimationDuration=function(t){this._animDur=t},u.prototype.getAnimationDuration=function(){return this._animDur},u.prototype.setSelectionMode=function(e){this._selectionMode=e,this._selectionMode&&(this._selectionHandler=new t.SelectionHandler(this._tmap.getCtx(),this._selectionMode),this._eventHandler.setSelectionHandler(this._clientId,this._selectionHandler))},u.prototype.isSelectable=function(){return null!=this._selectionMode},u.prototype.setIsolatedAreaRowKey=function(t){this._isolatedAreaRowKey=t},u.prototype._updateAreaShape=function(t){var e=t.getDisplayable(),a=this._parentLayer.getAreaShape(t.getLocation());return a?(e.setCmds(a.getCmds()),!0):(this._removeAreaObject(t),!1)},u.prototype._renderAreaAndLabel=function(t){if(this._updateAreaShape(this._areaObjs[t])){var e=this._areaObjs[t].getDisplayable();this._dataAreaLayer.addChild(e);var a=this._areaObjs[t].getLabel();if(a){if(!a.hasBounds()){var i=e.getDimensions();a.addBounds(i)}a.update(this._pzcMatrix)}return!0}return!1},u.prototype.render=function(e){this._pzcMatrix=e;var a={},i=this._markerObjs.slice();i.sort(function(t,e){return t.getSize()<e.getSize()?1:t.getSize()>e.getSize()?-1:0});for(var r=0;r<i.length;r++){var n=i[r],o=n.getDisplayable(),s=n.getLabel();if(s){var l=new t.Container(o.getCtx());this._dataPointLayer.addChild(l),l.addChild(o),l.addChild(s),n.positionLabel()}else this._dataPointLayer.addChild(o);var h=n.getLocation();h&&(a[h]=!0)}for(r=0;r<this._areaObjs.length;r++)a[this._areaObjs[r].getLocation()]&&this._areaObjs[r].removeLabel(),this._renderAreaAndLabel(r)||r--;for(r=0;r<this._linkObjs.length;r++)this._dataLinkLayer.addChild(this._linkObjs[r].getDisplayable());this._initSelections&&this._processInitialSelections()},u.prototype.HandleZoomEvent=function(t,e){this._pzcMatrix=e;for(var a=this.getAreaObjects(),i=0;i<a.length;i++)a[i].HandleZoomEvent(e);if(this._tmap.isMarkerZoomBehaviorFixed()){var r=this.getMarkerObjects();for(i=0;i<r.length;i++)r[i].HandleZoomEvent(e)}this._linkMap={};var n=this.getLinkObjects();for(i=0;i<n.length;i++)n[i].HandleZoomEvent(e)},u.prototype.HandlePanEvent=function(t){this._pzcMatrix=t},u.prototype.setInitialSelections=function(t){this._initSelections=t},u.prototype._processInitialSelections=function(){this._selectionHandler&&(this._selectionHandler.processInitialSelections(this._initSelections,this.getAllObjects()),this._initSelections=null)},u.prototype.__getDragTransferable=function(t){if(this._selectionHandler){t.isSelected()||(this._selectionHandler.processClick(t,!1),this._eventHandler.fireSelectionEvent(t));for(var e=[],a=this._selectionHandler.getSelection(),i=0;i<a.length;i++)e.push(a[i].getId());return e}return null},u.prototype.__getDragFeedback=function(){for(var t=[],e=this._selectionHandler.getSelection(),a=0;a<e.length;a++)t.push(e[a].getDisplayable());return t},u.prototype.getSelectedAreas=function(t){for(var e=[],a=this.getAreaObjects(),i=new(this._tmap.getCtx().KeySetImpl)(t),r=0;r<a.length;r++)if(i.has(a[r].getId())){e.push(a[r].getLocation());break}return e},u.prototype.destroy=function(){for(var t=this.getAllObjects(),e=0;e<t.length;e++){var a=t[e].getDisplayable();if(a instanceof o){var i=a.getRootElement();i.destroy&&i.destroy()}}this._eventHandler=null},u.prototype.getNavigableLinksForNodeId=function(e){for(var a=[],i=this._tmap.getCtx(),r=0;r<this._dataLinkCollection.length;r++){var n=this._dataLinkCollection[r],o=n.getStartMarker(),s=n.getEndMarker();o&&t.Obj.compareValues(i,o.getId(),e)?a.push(n):s&&t.Obj.compareValues(i,s.getId(),e)&&a.push(n)}return a};var y=function(t,e){this.Init(t,e)};t.Obj.createSubclass(y,t.PanZoomCanvasKeyboardHandler),y.LINK_NODE_NAV="linkNode",y.LINK_NAV="link",y.prototype.Init=function(t,e){y.superclass.Init.call(this,t,e),this._tmap=t,this._linkNavType=y.LINK_NAV},y.prototype.isSelectionEvent=function(t){return this.isNavigationEvent(t)&&!t.ctrlKey},y.prototype.processKeyDown=function(e){var a=e.keyCode,i=this._eventManager.getFocus();if(a==t.KeyboardEvent.CLOSE_BRACKET){this._linkNavType=y.LINK_NAV;var r=[];i instanceof c&&(r=this._tmap.getNavigableMarkers()),"DvtMapObjPeer"!==i.getTypeName()&&0!==r.length||(r=this._tmap.getNavigableLinks()),r.length>0&&(i=t.KeyboardHandler.getNextAdjacentNavigable(i,e,r),this._tmap.ensureObjInViewport(e,i)),this._eventManager.SetClickInfo(i)}else if(a==t.KeyboardEvent.OPEN_BRACKET){this._linkNavType=y.LINK_NAV;r=[];i instanceof p&&(r=this._tmap.getNavigableMarkers()),"DvtMapObjPeer"!==i.getTypeName()&&0!==r.length||(r=this._tmap.getNavigableAreas()),r.length>0&&(i=t.KeyboardHandler.getNextAdjacentNavigable(i,e,r),this._tmap.ensureObjInViewport(e,i)),this._eventManager.SetClickInfo(i)}else(e.keyCode==t.KeyboardEvent.OPEN_ANGLED_BRACKET||t.KeyboardEvent.CLOSE_ANGLED_BRACKET)&&e.altKey&&(this._linkMarker=i,this._linkNavType=y.LINK_NODE_NAV),i=y.superclass.processKeyDown.call(this,e),this.isNavigationEvent(e)&&!e.ctrlKey&&this._eventManager.SetClickInfo(i);return i},y.prototype.getLinkNavigationType=function(){return this._linkNavType},y.prototype.getLinkMarker=function(){return this._linkMarker},y.prototype.isMultiSelectEvent=function(e){return e.keyCode==t.KeyboardEvent.SPACE&&e.ctrlKey},y.prototype.isNavigationEvent=function(e){var a=y.superclass.isNavigationEvent.call(this,e);switch(e.keyCode){case t.KeyboardEvent.OPEN_BRACKET:case t.KeyboardEvent.CLOSE_BRACKET:a=!0;break;case t.KeyboardEvent.OPEN_ANGLED_BRACKET:case t.KeyboardEvent.CLOSE_ANGLED_BRACKET:a=!!e.altKey;break;default:a=y.superclass.isNavigationEvent.call(this,e)}return a},y.getFirstNavigableLink=function(e,a,i){var r=a.keyCode;if(!i||i.length<1||!e)return null;for(var n=e.getCenter(),o=e.getDisplayable().getCtx(),s=0;s<i.length;s++){var l,h=i[s];if(l=t.Obj.compareValues(o,e.getId(),h.getStartMarker().getId())?h.getEndPoint():h.getStartPoint(),r==t.KeyboardEvent.OPEN_ANGLED_BRACKET&&l.x<=n.x||r==t.KeyboardEvent.CLOSE_ANGLED_BRACKET&&l.x>=n.x)break}return h};var f=function(t,e,a){this.Init(t,e,a)};t.Obj.createSubclass(f,t.EventManager),f.prototype.Init=function(t,e,a){f.superclass.Init.call(this,t,e,a),this._selectionHandlers=new Object,this._tmap=a,this._bPassOnEvent=!1},f.prototype.getSelectionHandler=function(t){if(t&&t.getDataLayer){var e=t.getDataLayer().getClientId();return this._selectionHandlers[e]}},f.prototype.setSelectionHandler=function(t,e){this._selectionHandlers[t]=e},f.prototype.setInitialFocus=function(t){t&&f.superclass.setFocus.call(this,t)},f.prototype.OnClick=function(e){var a=this.GetLogicalObject(e.target);if(this.SetClickInfo(a),!(a&&a.isSelectable&&a.isSelectable()))for(var i in this._selectionHandlers){if(this._selectionHandlers[i].processClick(null,e.ctrlKey)){var r=t.EventFactory.newSelectionEvent([]);r.clientId=i,this._callback.call(this._callbackObj,r)}}f.superclass.OnClick.call(this,e)},f.prototype.SetClickInfo=function(t){var e=null,a=null,i=null;if(t&&(t instanceof h?i=t.getDisplayable():t instanceof _&&(i=t),t.getDataLayer)){var r=t.getDataLayer();e=r.getClientId(),a=r.getMapLayer().getLayerName()}this._tmap.setClickInfo(e,a,i)},f.prototype.ProcessKeyboardEvent=function(e){var a=!0,i=e.keyCode,r=this.getFocus(),n=r.getDisplayable();return i!=t.KeyboardEvent.TAB&&this._bPassOnEvent?(n.fireKeyboardListener(e),e.preventDefault()):i==t.KeyboardEvent.SPACE&&e.ctrlKey?(this.SetClickInfo(r),this.ProcessSelectionEventHelper(r,!0),e.preventDefault()):i!=t.KeyboardEvent.ZERO&&i!=t.KeyboardEvent.NUMPAD_ZERO||!e.ctrlKey?i==t.KeyboardEvent.TAB&&n instanceof o?!e.shiftKey&&r.isShowingKeyboardFocusEffect()?(r.hideKeyboardFocusEffect(),n.fireKeyboardListener(e),e.preventDefault(),this._bPassOnEvent=!0):e.shiftKey&&this._bPassOnEvent?(this.ShowFocusEffect(e,r),e.preventDefault(),this._bPassOnEvent=!1):(this._bPassOnEvent&&r.showKeyboardFocusEffect(),a=f.superclass.ProcessKeyboardEvent.call(this,e),this._bPassOnEvent=!1):(i==t.KeyboardEvent.TAB&&r&&this._tmap.ensureObjInViewport(e,r),a=f.superclass.ProcessKeyboardEvent.call(this,e)):(e.altKey?this._tmap.fitRegion(n):this._tmap.fitSelectedRegions(),e.preventDefault()),a},f.prototype.OnComponentTouchClick=function(e){if(!this.GetEventInfo(e,t.PanZoomCanvasEventManager.EVENT_INFO_PANNED_KEY)){var a=this.GetLogicalObject(e.target);if(this.SetClickInfo(a),a instanceof t.ThematicMap)for(var i in this._selectionHandlers){if(this._selectionHandlers[i].processClick(null,e.ctrlKey)){for(var r=this._selectionHandlers[i].getSelection(),n=[],o=0;o<r.length;o++)n.push(r[o].getId());var s=t.EventFactory.newSelectionEvent(n);this._callback.call(this._callbackObj,s)}}f.superclass.OnComponentTouchClick.call(this,e)}},f.prototype.HandleTouchActionsEnd=function(t,e){var a=this.GetLogicalObject(t.target);this.SetClickInfo(a),f.superclass.HandleTouchActionsEnd.call(this,t,e)},f.prototype.ProcessRolloverEvent=function(e,a,i){var r=this._tmap.getOptions();if("dim"==r.hoverBehavior){var n=a.getCategories?a.getCategories():[];r.highlightedCategories=i?n.slice():null;var o=t.EventFactory.newCategoryHighlightEvent(r.highlightedCategories,i),s=t.StyleUtils.getTimeMilliseconds(r.styleDefaults.hoverBehaviorDelay);this.RolloverHandler.processEvent(o,this._tmap.getNavigableAreas().concat(this._tmap.getNavigableMarkers()).concat(this._tmap.getNavigableLinks()),s,"any"==r.highlightMatch)}},f.prototype.GetTouchResponse=function(){var e=this._tmap.getOptions();return"none"!==e.panning||"none"!==e.zooming?t.EventManager.TOUCH_RESPONSE_TOUCH_HOLD:e.touchResponse===t.EventManager.TOUCH_RESPONSE_TOUCH_START?t.EventManager.TOUCH_RESPONSE_TOUCH_START:t.EventManager.TOUCH_RESPONSE_AUTO},f.prototype.StoreInfoByEventType=function(e){return e!=t.PanZoomCanvasEventManager.EVENT_INFO_PANNED_KEY&&f.superclass.StoreInfoByEventType.call(this,e)},f.prototype.showFocusEffect=function(t,e){this.ShowFocusEffect(t,e)},f.prototype.ShowFocusEffect=function(t,e){this._tmap.isPanning()||f.superclass.ShowFocusEffect.call(this,t,e)};var S=function(t){this.Init(t)};t.Obj.createSubclass(S,t.Obj),S._MIN_MARKER_SIZE=6,S._MAX_MARKER_SIZE_RATIO=.5,S._PZC_PADDING=20,S.prototype.Init=function(t){this._tmap=t,this._areaLayerStyle=null,this._areaLayerStyleObject=null},S.prototype.parse=function(t){var e=t.mapProvider;v.containsGeoJson(e)&&(this._mapProvider=e),this._parseMapProperties(t),this._parseStyles(t.styleDefaults),this._parseAreaLayer(t.areaLayers),this.ParseDataLayers(t.pointDataLayers,null,null,!1)},S.prototype._parseMapProperties=function(t){var e=t.animationDuration;"string"==typeof e?"ms"==e.slice(-2)?e=parseInt(e.slice(0,-2))/1e3:"s"==e.slice(-1)&&(e=parseFloat(e.slice(0,-1))):e/=1e3,this._tmap.setAnimationDuration(e),this._mapProvider||this._tmap.setMapName(t.basemap),this._tmap.setInitialZooming("auto"==t.initialZooming),this._tmap.setPanning("auto"==t.panning),this._tmap.setZooming("auto"==t.zooming)},S.prototype._parseAreaLayer=function(e){var a=this._tmap.getCtx(),i=this._tmap.Defaults.calcAreaLayerOptions(e[0],a.isCustomElement()),r=i.layer;if(r||this._mapProvider){var o,s=i.areaSvgStyle||i.areaStyle;if(s){s instanceof Object||(s=t.CSSStyle.cssStringToObject(s));var l=S._getAreaCSSStyle(s);this._areaLayerStyleObject=t.JsonUtils.merge(s,this._areaLayerStyleObject),this._areaLayerStyle.merge(l)}var h=this._tmap.getStyleDefaults().labelStyle;h&&this._areaLayerStyle.merge(h),(h=i.labelStyle)&&this._areaLayerStyle.parseInlineStyle(h),o=new d(this._tmap,r,i.labelDisplay,i.labelType,this._tmap.getEventManager());var c,p,_,g=this._tmap.getMapName();if(this._mapProvider){var u=v.parseMapInfo(a,this._mapProvider);c=u.areas,p=u.labels}else c=n.getAreaPaths(g,r,this._tmap.getWidth(),this._tmap.getHeight(),this._tmap.getMaxZoomFactor()),p=n.getAreaLabels(g,r),_=n.getAreaLabelInfo(g,r);o.setAreaShapes(this._createPathShapes(c)),o.setAreaLabels(p),o.setAreaLabelInfo(_),o.setLayerCSSStyle(this._areaLayerStyle),o.setDropSiteCSSStyle(this._areaDropSiteStyle),this._tmap.addLayer(o),i.areaDataLayer&&this.ParseDataLayers([i.areaDataLayer],o,null,!0),i.pointDataLayers&&this.ParseDataLayers(i.pointDataLayers,o,null,!1)}},S.prototype.ParseDataLayers=function(e,a,i,r){if(e)for(var n=this._tmap.getCtx(),o=0;o<e.length;o++){var s=this._tmap.Defaults.calcDataLayerOptions(e[o]);a?a instanceof d&&r&&a.resetRenderedAreas():(a=new g(this._tmap,s.id,this._tmap.getEventManager()),this._tmap.addLayer(a));var l=new u(this._tmap,a,s.id,this._tmap.getEventManager(),s),h=s.selectionMode;"single"==h?l.setSelectionMode(t.SelectionHandler.TYPE_SINGLE):"multiple"==h&&l.setSelectionMode(t.SelectionHandler.TYPE_MULTIPLE),l.setAnimation(s.animationOnDataChange),l.setAnimationDuration(this._tmap.getAnimationDuration());var c,p=null;a instanceof d&&(p=s.isolatedItem);r=a instanceof d;var _=this._tmap.getOptions().hiddenCategories,y=s.areas;if(y)for(var f=0;f<y.length;f++)if(_&&t.ArrayUtils.hasAnyItem(_,y[f].categories))l.addAreaObject(null);else{var m=y[f].location;if(p){if(!t.Obj.compareValues(n,p,y[f].id))continue;c=m}(O=this._createArea(a,l,y[f]))&&l.addAreaObject(O)}var v=s.renderer,A=s.markers;if(A){v||S._calcBubbleSizes(this._tmap,A);for(f=0;f<A.length;f++)if(_&&t.ArrayUtils.hasAnyItem(_,A[f].categories))l.addMarkerObject(null);else{m=A[f].location;if(p){if(!t.Obj.compareValues(n,p,A[f].id))continue;c=m}if(v){var b=A[f],D=v(this._tmap.getOptions()._contextHandler(this._tmap.getElem(),null,b,b._itemData,{hovered:!1,selected:!1,focused:!1},null));O=this._createCustomDataItem(a,l,A[f],D,r)}else O=this._createMarker(a,l,A[f],r);O&&l.addMarkerObject(O)}}var E=s.images;if(E)for(f=0;f<E.length;f++){m=E[f].location;if(p){if(!t.Obj.compareValues(n,p,E[f].id))continue;c=m}(O=this._createImage(a,l,E[f],r))&&l.addMarkerObject(O)}var L=s.links;if(L)for(f=0;f<L.length;f++){var O;if(_&&t.ArrayUtils.hasAnyItem(_,L[f].categories))l.addAreaObject(null);else(O=this._createLink(l,L[f]))&&l.addLinkObject(O)}c&&(l.setIsolatedAreaRowKey(p),a.setIsolatedArea(c));var C=s.selection;C&&C.length>0&&l.setInitialSelections(C),i?a.updateDataLayer(l,this._tmap.getPanZoomCanvas().getContentPane().getMatrix(),i):a.addDataLayer(l)}},S.prototype._parseStyles=function(e){this._tmap.parseComponentJson(e);var a=e.areaSvgStyle||e.areaStyle;!a||a instanceof Object||(a=t.CSSStyle.cssStringToObject(a)),a=t.JsonUtils.merge(a,e._areaStyle),this._areaLayerStyle=S._getAreaCSSStyle(a),this._areaLayerStyleObject=a,this._areaLayerStyle.parseInlineStyle(e.labelStyle),this._areaDropSiteStyle=new t.CSSStyle(e.dropTargetStyle),this._tmap.setStyleDefaults(e)},S._getAreaCSSStyle=function(e){var a=new t.CSSStyle;return t.ArrayUtils.forEach([t.CSSStyle.BORDER_COLOR,t.CSSStyle.BACKGROUND_COLOR],function(i){var r=null,n=t.CSSStyle.cssStringToObjectProperty(i);e&&null!=e[n]&&(r=e[n],delete e[n]),a.setStyle(i,r)}),a},S.prototype._createPathShapes=function(e){var a={},i=this._tmap.getCtx();for(var r in e){var n=new t.Path(i);n.setCmds(e[r]);var o=this._areaLayerStyle.getStyle(t.CSSStyle.BORDER_COLOR);if(o&&"transparent"!=o){var s=new t.SolidStroke(o);this._tmap.supportsVectorEffects()&&s.setFixedWidth(!0),n.setStroke(s)}var l=this._areaLayerStyle.getStyle(t.CSSStyle.BACKGROUND_COLOR);"transparent"!=l?n.setSolidFill(l):n.setFill(null),this._areaLayerStyleObject&&n.setStyle(this._areaLayerStyleObject),a[r]=n}return a},S.prototype._createArea=function(e,a,i){var n=i.location;if(e.getAreaShape(n)){e.setAreaRendered(n,!1);var o=this._tmap.getCtx(),s=new r(o,this._tmap.supportsVectorEffects());(i=t.JsonUtils.merge(i,this._tmap.getStyleDefaults().dataAreaDefaults)).labelStyle||(i.labelStyle=this._tmap.getStyleDefaults().labelStyle);var l=new t.SolidStroke(i.hoverColor,1,r.HOVER_STROKE_WIDTH),h=new t.SolidStroke(i.selectedInnerColor,1,r.SELECTED_INNER_STROKE_WIDTH),p=new t.SolidStroke(i.selectedOuterColor,1,r.SELECTED_OUTER_STROKE_WIDTH);s.setHoverStroke(l,null).setSelectedStroke(h,p),e.setLabelRendered(i.location,!1),this._styleDisplayable(i,s);var _=this._createLabel(e,a,i,s,!0),g=S._getLocationName(this._tmap.getMapName(),a,i);return new c(i,a,s,_,g)}return null},S.prototype._createMarker=function(e,a,i,r){var n,o=i._size;if(!(n=this._mapProvider&&!i.location?new t.Point(i.x,-i.y):S.getCenter(a,i.location,i.x,i.y))||0===o)return null;var s,l,c=this._tmap.getStyleDefaults().dataMarkerDefaults,p=c.labelStyle;if(p.parseInlineStyle(i.labelStyle),(i=t.JsonUtils.merge(i,c)).labelStyle=p,null!=o)s=o,l=o;else{var _=i.scaleX;null==_&&(_=1);var g=i.scaleY;null==g&&(g=1);var d=i.width;null==d&&(d=this._tmap.getOptions().styleDefaults.dataMarkerDefaults.width);var u=i.height;null==u&&(u=this._tmap.getOptions().styleDefaults.dataMarkerDefaults.height),s=d*_,l=u*g}var y,f=i.borderRadius;if(i.source)y=new t.ImageMarker(this._tmap.getCtx(),n.x,n.y,s,l,f,i.source,i.sourceSelected,i.sourceHover,i.sourceHoverSelected);else{var m=i.shape?i.shape:this._tmap.getOptions().styleDefaults.dataMarkerDefaults.shape;y=new t.SimpleMarker(this._tmap.getCtx(),m,this._tmap.getSkinName(),n.x,n.y,s,l,f)}var v=i.rotation;if(v){var A=v*Math.PI/180;y.setRotation(A)}r&&e.setLabelRendered(i.location,!1),this._styleDisplayable(i,y);var b=this._createLabel(e,a,i,y,r),D=S._getLocationName(this._tmap.getMapName(),a,i);return new h(i,a,y,b,n,D)},S.prototype._createImage=function(e,a,i,r){var n=S.getCenter(a,i.location,i.x,i.y);if(!n)return null;var o=new t.Image(this._tmap.getCtx(),i.url),s=i.width,l=i.height;null!=s&&null!=l&&(o.setX(n.x-s/2),o.setY(n.y-l/2),o.setWidth(s),o.setHeight(l)),r&&e.setLabelRendered(i.location,!1);var c=S._getLocationName(this._tmap.getMapName(),a,i),p=new h(i,a,o,null,n,c);if(!s||!l){t.ImageLoader.loadImage(this._tmap.getCtx(),i.url,function(t){t&&t.width&&t.height&&(o.setWidth(t.width),o.setHeight(t.height),o.setX(n.x-t.width/2),o.setY(n.y-t.height/2),p.__recenter())})}return p},S.prototype._createCustomDataItem=function(e,a,i,r,n){var s;if(!(s=this._mapProvider&&!i.location?new t.Point(i.x,-i.y):S.getCenter(a,i.location,i.x,i.y)))return null;n&&e.setLabelRendered(i.location,!1);var l=new o(this._tmap.getCtx(),r,this._tmap.getStyleDefaults().dataAreaDefaults),c=S._getLocationName(this._tmap.getMapName(),a,i);return new h(i,a,l,null,s,c)},S.prototype._createLink=function(e,a){var i,r,n,o,s=a.startLocation,l=a.endLocation,h=this._tmap.getCtx();if(s.id){for(var c=e.getDataMarkerCollection(),_=0;_<c.length;_++){if((d=c[_])&&t.Obj.compareValues(h,d.getId(),s.id)){r=d,i=d.getCenter();break}}if(!r){var g=e.getDataAreaCollection();for(_=0;_<g.length;_++){if((u=g[_])&&t.Obj.compareValues(h,u.getId(),s.id)){r=u,i=this._getPtFromLocation(e,{location:u.getLocation()});break}}}}else i=this._getPtFromLocation(e,s);if(l.id){for(c=e.getDataMarkerCollection(),_=0;_<c.length;_++){var d;if((d=c[_])&&t.Obj.compareValues(h,d.getId(),l.id)){o=d,n=d.getCenter();break}}if(!o)for(g=e.getDataAreaCollection(),_=0;_<g.length;_++){var u;if((u=g[_])&&t.Obj.compareValues(h,u.getId(),l.id)){o=u,n=this._getPtFromLocation(e,{location:u.getLocation()});break}}}else n=this._getPtFromLocation(e,l);if(!n||!i)return null;var y=new t.Path(this._tmap.getCtx(),S.calcCurve(e,i,n,i,n));y.setFill(null);var f=this._tmap.getStyleDefaults().linkDefaults,m=a.color;m||(m=f.color);var v=a.width;v||(v=f.width);var A=new t.SolidStroke(m,1,v);A.setFixedWidth(!0),y.setStroke(A);var b=f._hoverColor,D=f._selectedColor,E=new t.SolidStroke(b,1,v),L=new t.SolidStroke(m,1,v+2),O=new t.SolidStroke(m,1,v),C=new t.SolidStroke(D,1,v+2),T=new t.SolidStroke(b,1,v),P=new t.SolidStroke(D,1,v+2);return y.setHoverStroke(E,L).setSelectedStroke(O,C).setSelectedHoverStroke(T,P),new p(a,e,y,i,n,r,o)},S.prototype._getPtFromLocation=function(e,a){return this._mapProvider?new t.Point(a.x,-a.y):S.getCenter(e,a.location,a.x,a.y)},S.prototype._createLabel=function(e,a,i,r,n){var o=i.location,s=i.label,h=s?"on":"off";n&&(h=e.getLabelDisplay());var c=r instanceof t.Path;if(!s&&n&&(c&&"off"!=h||!c&&"on"==h)&&(s="long"==e.getLabelType()?e.getLongAreaName(o):e.getShortAreaName(o)),s){var p,_=this._tmap.getCtx();p=c?new l(_,s,e.getLabelInfoForArea?e.getLabelInfoForArea(o):null,h,a.getDataLabelContainer(),this._tmap.supportsVectorEffects()):new t.OutputText(_,s,0,0);var g=c?e.getLayerCSSStyle():new t.CSSStyle;i.labelStyle&&g.merge(i.labelStyle);var d=g.getStyle(t.CSSStyle.COLOR);g.setStyle(t.CSSStyle.COLOR,null),p.setCSSStyle(g),i.color&&p instanceof l&&(t.Agent.isHighContrast()||!d)&&(d=t.ColorUtils.getContrastingTextColor(i.color)),d&&p.setSolidFill(d)}return p},S.prototype._styleDisplayable=function(e,a){var i=e.color,r=t.Agent.isTouchDevice()||this._tmap.getSkinName()==t.CSSStyle.SKIN_ALTA?"none":e.visualEffects;if(a instanceof t.SimpleMarker){if("none"!=e.borderStyle){var n=e.borderWidth;"string"==typeof n&&(n="px"==n.slice(-2)?parseFloat(e.borderWidth.slice(0,-2)):parseFloat(e.borderWidth));var o=new t.SolidStroke(e.borderColor,1,n);this._tmap.isMarkerZoomBehaviorFixed()||o.setFixedWidth(!0),o.setType(t.Stroke.convertTypeString(e.borderStyle)),a.setStroke(o)}var s=e.opacity;"none"!=r?a.setFill(new t.MarkerGradient.createMarkerGradient(i,a,s)):i&&a.setSolidFill(i,s)}else if(a instanceof t.Path){var l=e.borderColor;if(l){o=new t.SolidStroke(l);this._tmap.supportsVectorEffects()&&o.setFixedWidth(!0),a.setStroke(o)}a.setSolidFill(i,s)}},S.getCenter=function(e,a,i,r){var o=e.getMap(),s=o.getMapName(),l=e.getMapLayer(),h=l.getLayerName();if(a){var c=n.getCityCoordinates(s,a);if(c)return c;var p,_=n.getAreaCenter(s,h,a);if(_)return _;if(!s&&l.getAreaShape){var g=l.getAreaShape(a);if(!g)return null;p=t.DisplayableUtils.getDimensionsForced(o.getCtx(),g)}else{var d=n.getPathForArea(s,h,a);if(!d)return null;var u=t.PathUtils.createPathArray(d);p=t.PathUtils.getDimensions(u)}return p.getCenter()}return m.project(i,r,s)},S._calcBubbleSizes=function(e,a){for(var i=-1/0,r=1/0,n=0;n<a.length;n++){null==(p=a[n].value)||p<=0||(i=Math.max(i,p),r=Math.min(r,p))}if(r!==1/0){var o=2*S._PZC_PADDING,s=e.getWidth()-o,l=e.getHeight()-o,h=s/l;h<1.3?l=2*s/3:h>1.7&&(s=1.5*l);var c=S._MAX_MARKER_SIZE_RATIO*Math.min(s,l);for(n=0;n<a.length;n++){var p=a[n].value;a[n]._size=null==p||p<=0?0:t.LayoutUtils.getBubbleSize(p,r,i,S._MIN_MARKER_SIZE,c)}}},S.calcCurve=function(e,a,i,r,n){var o=r.x,s=r.y,l=n.x,h=n.y,c=e.getMap(),p=t.PathUtils.moveTo(o,s),_=e.trackLink(a,i),g=Math.min(c.getWidth(),c.getHeight())/35;if(l-o==0||h-s==0){if(_>1){if(g*=_-1,l-o==0){var d=.3*Math.abs(s-h);C=s>h?s-d:s+d,m=S=o+g,T=h>s?h-d:h+d}else{d=.3*Math.abs(o-l);S=o>l?o-d:o+d,m=l>o?l-d:l+d,T=C=s-g}p+=t.PathUtils.cubicTo(S,C,m,T,l,h)}else p+=t.PathUtils.lineTo(l,h)}else{var u=(d=Math.sqrt(Math.pow(l-o,2),Math.pow(h-s,2)))/4;_>1&&(u+=(_-1)*g);var y=(h-s)/(l-o),f=-1/y;f>0&&(u*=-1);var S,m,v=.3*d/Math.sqrt(1+Math.pow(y,2)),A=l-o>0,b=o+(A?1:-1)*v,D=y*(b-o)+s,E=l+(A?-1:1)*v,L=y*(E-l)+h,O=u/Math.sqrt(1+Math.pow(f,2)),C=f*((S=b+O)-b)+D,T=f*((m=E+O)-E)+L;p+=t.PathUtils.cubicTo(S,C,m,T,l,h)}return p},S._getLocationName=function(t,e,a){var i=a.location;if(i){var r=e.getMapLayer();return r instanceof d?r.getLongAreaName(i):n.getCityLabel(t,i)}return null};var m={};t.Obj.createSubclass(m,t.Obj),m._VIEWPORT_BOUNDS=new t.Rectangle(0,0,800,500),m._RADIUS=6378206.4,m._NEW_ZEALAND_RECT=new t.Rectangle(500,200,200,200),m._NEW_ZEALAND_BOUNDS=new t.Rectangle(163,-49,17,17),m._AFRICA_BOUNDS=new t.Rectangle(-17.379205428479874,-37.201510854305546,68.66391442808313,77.50071544582713),m._ASIA_BOUNDS=new t.Rectangle(-.8436866097568272,-.7626456732012923,1.8336308036296942,1.5748427214611724),m._AUSTRALIA_BOUNDS=new t.Rectangle(113.29667079927977,-52.89550592498755,65.25257389065216,42.123114617504626),m._EUROPE_BOUNDS=new t.Rectangle(-.47944476148667076,-.0014669405958800579,.7364925893845453,.6293972741802124),m._N_AMERICA_BOUNDS=new t.Rectangle(-.6154469465354344,-.24589767758847714,1.2448236795108683,1.2631535127174947),m._S_AMERICA_BOUNDS=new t.Rectangle(-80.60817722658722,-60.796273249672765,46.608687602908056,66.96595767361796),m._APAC_BOUNDS=new t.Rectangle(68.20516856593524,-52.89892708045518,111.65739821771903,116.55460214469134),m._EMEA_BOUNDS=new t.Rectangle(-24.543831069368586,-37.202500659225905,204.54283106936856,164.9634493690208),m._L_AMERICA_BOUNDS=new t.Rectangle(-117.12451221229134,-54.95921623126266,82.33223251442891,87.67786623127876),m._USA_CANADA_BOUNDS=new t.Rectangle(-.6154656300926513,.0507209798775865,1.0153104799231851,.966537441082997),m._WORLD_BOUNDS=new t.Rectangle(-171.9,-62.6,349.8,150.8),m._ALASKA1_RECT=new t.Rectangle(172,51,8,3),m._ALASKA2_RECT=new t.Rectangle(-180,51,51,21),m._HAWAII_RECT=new t.Rectangle(-178.5,18.9,35,11),m._USA_RECT=new t.Rectangle(-124.8,24.4,58,25.5),m._ALASKA_BOUNDS=new t.Rectangle(-187.5517578125,59.82610321044922,57.562225341796875,43.83738708496094),m._HAWAII_BOUNDS=new t.Rectangle(-160.23606872558594,18.91549301147461,5.4374847412109375,3.3189010620117188),m._USA_BOUNDS=new t.Rectangle(-2386803.25,-1183550.5,4514111,2908402),m._HAWAII_WINDOW=new t.Rectangle(165,400,100,100),m._ALASKA_WINDOW=new t.Rectangle(-75,350,240,150),m._ROBINSON_COORDINATES=[[1,0],[.9986,.0314],[.9954,.0629],[.99,.0943],[.9822,.1258],[.973,.1572],[.96,.1887],[.9427,.2201],[.9216,.2515],[.8962,.2826],[.8679,.3132],[.835,.3433],[.7986,.3726],[.7597,.4008],[.6732,.4532],[.6213,.4765],[.5722,.4951],[.5322,.5072]],m.project=function(e,a,i){var r;switch(i){case"africa":r=m._getAffineProjection(m._AFRICA_BOUNDS,m._getMercatorProjection(e,a));break;case"asia":r=m._getAffineProjection(m._ASIA_BOUNDS,m._getAlbersEqualAreaConicProjection(40,95,20,60,e,a),m.toRadians(5));break;case"australia":r=m._getAustraliaProjection(e,a);break;case"europe":r=m._getAffineProjection(m._EUROPE_BOUNDS,m._getAlbersEqualAreaConicProjection(35,25,40,65,e,a),m.toRadians(10));break;case"northAmerica":r=m._getAffineProjection(m._N_AMERICA_BOUNDS,m._getAlbersEqualAreaConicProjection(23,-96,20,60,e,a));break;case"southAmerica":r=m._getAffineProjection(m._S_AMERICA_BOUNDS,new t.Point(e,a),m.toRadians(5));break;case"apac":r=m._getAffineProjection(m._APAC_BOUNDS,m._getMercatorProjection(e,a));break;case"emea":r=m._getAffineProjection(m._EMEA_BOUNDS,m._getMercatorProjection(e,a));break;case"latinAmerica":r=m._getAffineProjection(m._L_AMERICA_BOUNDS,new t.Point(e,a));break;case"usaAndCanada":r=m._getAffineProjection(m._USA_CANADA_BOUNDS,m._getAlbersEqualAreaConicProjection(23,-96,20,60,e,a));break;case"worldRegions":r=m._getWorldProjection(e,a);break;case"usa":r=m._getUSAProjection(e,a);break;case"world":r=m._getWorldProjection(e,a)}return r?new t.Point(10*r.x,10*r.y):null},m._getUSAProjection=function(e,a){var i,r;return m._ALASKA1_RECT.containsPoint(e,a)||m._ALASKA2_RECT.containsPoint(e,a)?(i=m._getViewPortTransformation(m._ALASKA_BOUNDS,m._ALASKA_WINDOW),r=m._applyAffineTransform(i,m._getMercatorProjection(e,a))):m._HAWAII_RECT.containsPoint(e,a)?(i=m._getViewPortTransformation(m._HAWAII_BOUNDS,m._HAWAII_WINDOW),r=m._applyAffineTransform(i,new t.Point(e,a))):m._USA_RECT.containsPoint(e,a)&&(i=m._getViewPortTransformation(m._USA_BOUNDS,m._VIEWPORT_BOUNDS),r=m._applyAffineTransform(i,m._getOrthographicProjection(new t.Point(-95,36),e,a))),m._getBoundedTransformedPoint(m._VIEWPORT_BOUNDS,r)},m._getWorldProjection=function(t,e){var a=m._getViewPortTransformation(m._WORLD_BOUNDS,m._VIEWPORT_BOUNDS),i=m._applyAffineTransform(a,m._getRobinsonProjection(t,e));return m._getBoundedTransformedPoint(m._VIEWPORT_BOUNDS,i)},m._getAustraliaProjection=function(t,e){var a;a=m._NEW_ZEALAND_BOUNDS.containsPoint(t,e)?m._getViewPortTransformation(m._NEW_ZEALAND_BOUNDS,m._NEW_ZEALAND_RECT):m._getViewPortTransformation(m._AUSTRALIA_BOUNDS,m._VIEWPORT_BOUNDS);var i=m._applyAffineTransform(a,m._getMercatorProjection(t,e));return m._getBoundedTransformedPoint(m._VIEWPORT_BOUNDS,i)},m._getAffineProjection=function(e,a,i){var r=m._getViewPortTransformation(e,m._VIEWPORT_BOUNDS);if(i){var n=new t.Matrix;n.rotate(i),r=m._concatAffineTransforms(r,n)}var o=r.transformPoint(a);return m._getBoundedTransformedPoint(m._VIEWPORT_BOUNDS,o)},m._getBoundedTransformedPoint=function(t,e){return e&&t.containsPoint(e.x,e.y)?e:null},m._getAlbersEqualAreaConicProjection=function(e,a,i,r,n,o){var s=m.toRadians(a),l=m.toRadians(e);i=m.toRadians(i),r=m.toRadians(r);var h=.5*(Math.sin(i)+Math.sin(r)),c=Math.pow(Math.cos(i),2)+2*h*Math.sin(i),p=c-2*h*Math.sin(l);p=Math.sqrt(p)/h;var _=m.toRadians(n),g=m.toRadians(o),d=h*(_-s),u=c-2*h*Math.sin(g),y=(u=Math.sqrt(u)/h)*Math.sin(d),f=p-u*Math.cos(d);return new t.Point(y,f)},m._getMercatorProjection=function(e,a){var i=Math.log(Math.tan(.25*Math.PI+.5*m.toRadians(a)));return new t.Point(e,m.toDegrees(i))},m._getOrthographicProjection=function(e,a,i){var r=m.toRadians(a),n=m.toRadians(i),o=m.toRadians(e.x),s=m.toRadians(e.y),l=Math.cos(n)*Math.sin(r-o),h=Math.cos(s)*Math.sin(n)-Math.sin(s)*Math.cos(n)*Math.cos(r-o);return new t.Point(l*m._RADIUS,h*m._RADIUS)},m._getRobinsonProjection=function(e,a){var i=Math.floor(Math.abs(a)/5);i>=m._ROBINSON_COORDINATES.length-1&&(i=m._ROBINSON_COORDINATES.length-2);var r=(Math.abs(a)-5*i)/5,n=m._ROBINSON_COORDINATES[i+1][0]-m._ROBINSON_COORDINATES[i][0],o=m._ROBINSON_COORDINATES[i+1][1]-m._ROBINSON_COORDINATES[i][1],s=e*(m._ROBINSON_COORDINATES[i][0]+r*n),l=m._ROBINSON_COORDINATES[i][1]+r*o;return a<0&&(l*=-1),new t.Point(s,180*l)},m._applyAffineTransform=function(e,a){return new t.Point(a.x*e.getA()+e.getTx(),a.y*e.getD()+e.getTy())},m._concatAffineTransforms=function(e,a){var i=e.getA(),r=a.getA()*i,n=a.getB()*i,o=e.getTx()+a.getTx()*i,s=e.getD(),l=a.getC()*s,h=a.getD()*s,c=e.getTy()+a.getTy()*s;return new t.Matrix(r,n,l,h,o,c)},m._getViewPortTransformation=function(e,a){var i,r=a.x,n=a.y,o=e.w,s=e.h,l=a.w/o,h=a.h/s;i=l<=h?l:h;var c=r-e.x*i,p=n+e.y*i;return c+=(a.w-o*i)/2,p+=a.h-(a.h-s*i)/2,new t.Matrix(i,0,0,-i,c,p)},m.toRadians=function(t){return t*(Math.PI/180)},m.toDegrees=function(t){return t*(180/Math.PI)},m.inverseProject=function(e,a,i){var r;switch(e/=10,a/=10,i){case"africa":r=m._getInverseAffineProjection(m._AFRICA_BOUNDS,new t.Point(e,a)),r=m._getInverseMercatorProjection(r.x,r.y);break;case"asia":r=m._getInverseAffineProjection(m._ASIA_BOUNDS,new t.Point(e,a),m.toRadians(5)),r=m._getInverseAlbersEqualAreaConicProjection(40,95,20,60,r.x,r.y);break;case"australia":r=m._getInverseAustraliaProjection(e,a);break;case"europe":r=m._getInverseAffineProjection(m._EUROPE_BOUNDS,new t.Point(e,a),m.toRadians(10)),r=m._getInverseAlbersEqualAreaConicProjection(35,25,40,65,r.x,r.y);break;case"northAmerica":r=m._getInverseAffineProjection(m._N_AMERICA_BOUNDS,new t.Point(e,a)),r=m._getInverseAlbersEqualAreaConicProjection(23,-96,20,60,r.x,r.y);break;case"southAmerica":r=m._getInverseAffineProjection(m._S_AMERICA_BOUNDS,new t.Point(e,a),m.toRadians(5));break;case"apac":r=m._getInverseAffineProjection(m._APAC_BOUNDS,new t.Point(e,a)),r=m._getInverseMercatorProjection(r.x,r.y);break;case"emea":r=m._getInverseAffineProjection(m._EMEA_BOUNDS,new t.Point(e,a)),r=m._getInverseMercatorProjection(r.x,r.y);break;case"latinAmerica":r=m._getInverseAffineProjection(m._L_AMERICA_BOUNDS,new t.Point(e,a));break;case"usaAndCanada":r=m._getInverseAffineProjection(m._USA_CANADA_BOUNDS,new t.Point(e,a)),r=m._getInverseAlbersEqualAreaConicProjection(23,-96,20,60,r.x,r.y);break;case"worldRegions":r=m._getInverseWorldProjection(e,a);break;case"usa":r=m._getInverseUSAProjection(e,a);break;case"world":r=m._getInverseWorldProjection(e,a)}return r||new t.Point(e,a)},m._getInverseUSAProjection=function(e,a){var i;if(m._ALASKA_WINDOW.containsPoint(e,a)){(i=m._getViewPortTransformation(m._ALASKA_BOUNDS,m._ALASKA_WINDOW)).invert();var r=i.transformPoint(new t.Point(e,a));return m._getInverseMercatorProjection(r.x,r.y)}if(m._HAWAII_WINDOW.containsPoint(e,a))return(i=m._getViewPortTransformation(m._HAWAII_BOUNDS,m._HAWAII_WINDOW)).invert(),i.transformPoint(new t.Point(e,a));if(m._VIEWPORT_BOUNDS.containsPoint(e,a)){(i=m._getViewPortTransformation(m._USA_BOUNDS,m._VIEWPORT_BOUNDS)).invert();r=i.transformPoint(new t.Point(e,a));return m._getInverseOrthographicProjection(new t.Point(-95,36),r.x,r.y)}return new t.Point(e,a)},m._getInverseWorldProjection=function(e,a){var i=m._getViewPortTransformation(m._WORLD_BOUNDS,m._VIEWPORT_BOUNDS);i.invert();var r=i.transformPoint(new t.Point(e,a));return m._getInverseRobinsonProjection(r.x,r.y)},m._getInverseAustraliaProjection=function(e,a){var i;(i=m._NEW_ZEALAND_RECT.containsPoint(e,a)?m._getViewPortTransformation(m._NEW_ZEALAND_BOUNDS,m._NEW_ZEALAND_RECT):m._getViewPortTransformation(m._AUSTRALIA_BOUNDS,m._VIEWPORT_BOUNDS)).invert();var r=i.transformPoint(new t.Point(e,a));return m._getInverseMercatorProjection(r.x,r.y)},m._getInverseAffineProjection=function(e,a,i){var r=m._getViewPortTransformation(e,m._VIEWPORT_BOUNDS);if(i){var n=new t.Matrix;n.rotate(i),r=m._concatAffineTransforms(r,n)}return r.invert(),r.transformPoint(a)},m._getInverseAlbersEqualAreaConicProjection=function(e,a,i,r,n,o){var s=m.toRadians(a),l=m.toRadians(e);i=m.toRadians(i),r=m.toRadians(r);var h=.5*(Math.sin(i)+Math.sin(r)),c=Math.pow(Math.cos(i),2)+2*h*Math.sin(i),p=c-2*h*Math.sin(l);p=Math.sqrt(p)/h;var _=Math.sqrt(n*n+(p-o)*(p-o)),g=Math.atan(n/(p-o)),d=Math.asin((c-_*_*h*h)/(2*h)),u=s+g/h;return new t.Point(m.toDegrees(u),m.toDegrees(d))},m._getInverseMercatorProjection=function(e,a){var i=2*Math.atan(Math.exp(m.toRadians(a)))-.5*Math.PI;return new t.Point(e,m.toDegrees(i))},m._getInverseOrthographicProjection=function(e,a,i){var r=a/m._RADIUS,n=i/m._RADIUS,o=m.toRadians(e.x),s=m.toRadians(e.y),l=Math.sqrt(r*r+n*n),h=Math.asin(l),c=Math.asin(Math.cos(h)*Math.sin(s)+n*Math.sin(h)*Math.cos(s)/l),p=o+Math.atan(r*Math.sin(h)/(l*Math.cos(s)*Math.cos(h)-n*Math.sin(s)*Math.sin(h)));return new t.Point(m.toDegrees(p),m.toDegrees(c))},m._getInverseRobinsonProjection=function(e,a){var i=Math.floor(Math.abs(a)/5);i>=m._ROBINSON_COORDINATES.length-1&&(i=m._ROBINSON_COORDINATES.length-2);var r=m._ROBINSON_COORDINATES[i+1][0]-m._ROBINSON_COORDINATES[i][0],n=m._ROBINSON_COORDINATES[i+1][1]-m._ROBINSON_COORDINATES[i][1],o=(Math.abs(a/180)-m._ROBINSON_COORDINATES[i][1])/n,s=5*o+5*i,l=e/(m._ROBINSON_COORDINATES[i][0]+o*r);return a<0&&(s*=-1),new t.Point(l,s)},t.exportProperty(n,"getLayerIds",n.getLayerIds),t.exportProperty(t,"ThematicMap",t.ThematicMap),t.exportProperty(t.ThematicMap,"newInstance",t.ThematicMap.newInstance),t.exportProperty(t.ThematicMap.prototype,"updateLayer",t.ThematicMap.prototype.updateLayer),t.exportProperty(t.ThematicMap.prototype,"destroy",t.ThematicMap.prototype.destroy),t.exportProperty(t.ThematicMap.prototype,"getAutomation",t.ThematicMap.prototype.getAutomation),t.exportProperty(t.ThematicMap.prototype,"highlight",t.ThematicMap.prototype.highlight),t.exportProperty(t.ThematicMap.prototype,"processDefaultHoverEffect",t.ThematicMap.prototype.processDefaultHoverEffect),t.exportProperty(t.ThematicMap.prototype,"processDefaultSelectionEffect",t.ThematicMap.prototype.processDefaultSelectionEffect),t.exportProperty(t.ThematicMap.prototype,"processDefaultFocusEffect",t.ThematicMap.prototype.processDefaultFocusEffect),t.exportProperty(i.prototype,"getDomElementForSubId",i.prototype.getDomElementForSubId),t.exportProperty(i.prototype,"getData",i.prototype.getData);var v={_MANAGER:"DvtBaseMapManager",_UNPROCESSED:"_UNPROCESSED_MAPS",_TYPE:"type",_GEOMETRY:"geometry",_COORDINATES:"coordinates",_FEATURES:"features",_PROPERTIES:"properties",_TYPE_FEATURE_COLLECTION:"FeatureCollection",_TYPE_GEOMETRY_COLLECTION:"GeometryCollection",_TYPE_FEATURE:"Feature",_TYPE_POLYGON:"Polygon",_TYPE_MULTI_POLYGON:"MultiPolygon",_ID:"id",_SHORT_LABEL:"shortLabel",_LONG_LABEL:"longLabel",containsGeoJson:function(t){return t&&t.geo&&t.geo[v._TYPE]},parseMapInfo:function(t,e){var a={},i={},r=e.geo,n=e.propertiesKeys||{};if(!n[v._ID])throw new Error("Missing required mapProvider.propertiesKeys.id property.");var o=r[v._TYPE];if(o===v._TYPE_FEATURE_COLLECTION)for(var s=r[v._FEATURES],l=0;l<s.length;l++)v._parseFeature(t,s[l],n,i,a);else{if(o!==v._TYPE_FEATURE)throw new Error("GeoJSON type of "+o+" is not supported. Only Feature and FeatureCollection types are supported.");v._parseFeature(t,r,n,i,a)}if(0===Object.keys(i).length)throw new Error("No valid Features found in GeoJSON.");return{labels:a,areas:i}},_parseFeature:function(t,e,a,i,r){var n=e[v._PROPERTIES],o=e[v._GEOMETRY];if(v._isSupportedGeometry(o)){var s=n[a[v._ID]];if(s){var l=n[a[v._SHORT_LABEL]],h=n[a[v._LONG_LABEL]];(l||h)&&(r[s]=[l,h]),i[s]=v._geomToPath(o)}else t.oj.Logger.warn("No 'id' value found in the mapProvider.propertiesKey object. A Feature's 'properties' object must have an id in the field specified by the mapProvider.propertiesKey.id value.")}else t.oj.Logger.warn("A geometry of type "+o[v._TYPE]+" is not supported and will be skipped.")},_isSupportedGeometry:function(t){var e=t[v._TYPE];return e===v._TYPE_POLYGON||e===v._TYPE_MULTI_POLYGON},_geomToPath:function(t){var e="",a=t[v._TYPE],i=t[v._COORDINATES];if(a===v._TYPE_POLYGON)e=v._polygonToPath(i);else if(a===v._TYPE_MULTI_POLYGON)for(var r=0;r<i.length;r++)e+=v._polygonToPath(i[r]);return e},_polygonToPath:function(t){for(var e="",a=0;a<t.length;a++)e+=v._linearRingToPath(t[a]);return e},_linearRingToPath:function(t){var e,a,i,r="M";if(t)for(var n=0;n<t.length;n++){var o=t[n],s=o[0],l=-o[1];if("M"!==r){var h=s-a,c=l-i;if("l"==r){if(a==s){i=l,e=e+(r="v")+c;continue}if(i==l){a=s,e=e+(r="h")+h;continue}e=e+" "+h+" "+c}else r="l",e=e+"l"+h+" "+c;a=s,i=l}else a=s,i=l,r="x",e="M"+s+" "+l}return e+"Z"},_getCoord:function(t,e){for(var a=e;a<t.length;a++){var i=t[a];if("-"!==i&&(isNaN(i)||" "===i)){var r=null;return" "!==i&&(r=i),{coord:parseInt(t.substring(e,a)),idx:a,cmd:r}}}return{}},_pathToPolygon:function(t){var e=[],a=0,i=0,r=t[0];if(t)for(var n=[],o=1;o<t.length;o++){var s=v._getCoord(t,o),l=null;o=s.idx,"v"!==r&&"h"!==r?(l=v._getCoord(t,++o),o=l.idx,a+=s.coord,i+=l.coord):"v"===r?i+=s.coord:"h"===r&&(a+=s.coord),n.push([a,-i]),l?null!=l.cmd&&(r=l.cmd):null!=s.cmd&&(r=s.cmd),"Z"===r&&(e.push(n),n=[],r=t[++o])}return e}}}(dvt);
  // To avoid changing the basemaps, which each call the basemap manager, we will
  // put the basemap manager onto the returned object. We'll only do this if it's
  // not defined, since in min/min-debug mode, the non-exported version is on the window.
  if(!dvt['DvtBaseMapManager'])
    dvt['DvtBaseMapManager'] = DvtBaseMapManager;
  
    return dvt;
  });
  