/** * IBM Confidential OCO Source Materials IBM Business Platform: Dashboards * (C) Copyright IBM Corp. 2016, 2020 * * The source code for this program is not published or otherwise divested of * its trade secrets, irrespective of what has been deposited with the U.S. * Copyright Office */ function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function _possibleConstructorReturn(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var _extends=Object.assign||function(e){for(var t=1;t=a.length)break;s=a[n++]}else{if((n=a.next()).done)break;s=n.value}var r=i[s];t.deepFreezeObject(r)}}return i},t}()})),define("dashboard-analytics/visualizations/definitions/providers/BaseProvider",["underscore","../../../lib/@waca/core-client/js/core-client/ui/core/Class","../../../widgets/livewidget/nls/StringResources","../../../lib/@waca/dashboard-common/dist/utils/ObjectHelper"],(function(e,t,i,a){return t.extend({init:function(e){this.dashboardApi=e.dashboardApi,this.definitionIds={},this.icon_root=this.dashboardApi&&this.dashboardApi.getConfiguration("liveWidgetImagesRoot")||"dashboard-analytics/images/",this.icon_root.lastIndexOf("/")!==this.icon_root.length-1&&(this.icon_root+="/")},clear:function(){},contains:function(t){return 0===e.size(this.definitionIds)?this.getDefinition(t).then((function(e){return!!e})):Promise.resolve(!!this.definitionIds[t])},refreshProvider:function(){},setDefinitions:function(t){var i=this;0===e.size(this.definitionIds)&&e.each(t,(function(e){i.definitionIds[e.id]=!0}))},getDefinitions:function(){return Promise.resolve([])},getDefinition:function(t){return this.getDefinitions().then((function(i){return e.find(i,(function(e){return e.id===t}))}))},_rewriteVisUri:function(e){return this.dashboardApi.getGlassSvc(".Ajax",(function(t){e.uri&&(e.uri=t.rewriteUrl(e.uri)),e.icon&&(e.icon=t.rewriteUrl(e.icon)),e.iconUri&&(e.iconUri=t.rewriteUrl(e.iconUri)),e.specification&&e.specification.template&&(e.specification.template=t.rewriteUrl(e.specification.template))})),e},_getProductLocale:function(){return this.dashboardApi.getGlassCoreSvc(".UserProfile").preferences.productLocale||"en"},_getLocalizedValue:function(e,t){var a=i.get(e);return-1!==a.indexOf("__NOT_TRANSLATED__")&&(a=t),a},freezeDefinitions:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];e.forEach((function(e,t,i){i[t]=a.deepFreezeObject(e)}))},massageDefinitions:function(){}})})),define("dashboard-analytics/visualizations/properties/PropertiesCreator",["underscore","dashboard-analytics/widgets/livewidget/nls/StringResources"],(function(e,t){"use strict";var i;return i=null,{getInstance:function(){return i||(i={createCheckboxProperty:function(e){var t=!!(e.defaultValue?e.defaultValue:e.value);return{id:e.name,type:"ToggleButton",propertyType:"CheckBox",label:e.caption,ariaLabel:e.caption,public:this._isPropertyPublic(e),name:e.name,displayPos:this._isPropertyValidNumber(e.displayPos)?e.displayPos:10,checked:t,defaultValue:t,active:!!e.active&&e.active}},createTextInputProperty:function(e){return{id:e.name,type:"InputLabel",propertyType:"InputLabel",label:e.caption,ariaLabel:e.caption,public:!0,name:e.name,handleReturnKey:!0,displayPos:10,defaultValue:e.defaultValue?e.defaultValue:"",active:!!e.active&&e.active,multilingual:!!e.multilingual&&e.multilingual}},createFontSizeProperty:function(e){var i=[{value:"auto",label:t.get("fontSizeAuto")},{value:"12",label:"12"},{value:"14",label:"14"},{value:"16",label:"16"},{value:"24",label:"24"}];return{type:"DropDown",id:e.name,name:e.name,label:e.caption,propertyType:"font",defaultValue:e.defaultValue?e.defaultValue:"auto",public:!1,active:!!e.active&&e.active,options:i}},createNumberProperty:function(e){var t={type:"InputLabel",inputType:"text",id:e.name,label:e.caption,defaultValue:e.defaultValue?e.defaultValue:null,ariaLabel:e.caption,displayMultiplier:e.displayMultiplier,value:e.value?e.value:null,active:!!e.active&&e.active,public:this._isPropertyPublic(e),parseFloat:!0};return e.supportsValidationChecks&&e.validationInfo&&i._addValidationChecksForNumberProp(e,t),t},_addValidationChecksForNumberProp:function(e,i){i.handleReturnKey=!0,i.showInlineError=!0,e.validationInfo&&e.validationInfo.placeHolderTextId&&(i.placeHolderText=t.get(e.validationInfo.placeHolderTextId)),i.customValidatorCallback=function(i){return{isValid:Number.isInteger(i)||""===i&&e.allowNull,message:t.get(e.validationInfo.messageId)}}},_getDefaultValueForEnum:function(e){return e.hasOwnProperty("def")&&e.def.hasOwnProperty("defaultValue")&&e.def.defaultValue?e.def.defaultValue.name:e.hasOwnProperty("defaultValue")?e.defaultValue&&e.defaultValue.name?e.defaultValue.name:e.defaultValue:e.value},createEnumProperty:function(t){var a=[];e.each(t.possibleValues,(function(e){var t={label:e.caption,value:e.name};a.push(t)}));var o=i._getDefaultValueForEnum(t);return{type:"DropDown",id:t.name,label:t.caption,ariaLabel:t.caption,defaultValue:o,options:a,active:!!t.active&&t.active,public:this._isPropertyPublic(t)}},_isPropertyPublic:function(e){return void 0===e.public||e.public},_isPropertyValidNumber:function(e){return"number"==typeof e},getMaintainAxisScaleProperty:function(){return{type:"ToggleButton",id:"maintainAxisScales",name:"maintainAxisScales",label:t.get("propMaintainAxisScales"),ariaLabel:t.get("propMaintainAxisScales"),public:!0,defautValue:!1,displayPos:0,active:!0}},getDonutRadius:function(e){return{name:"donutRadius",id:"donutRadius",label:t.get("propDonutRadius"),ariaLabel:t.get("propDonutRadius"),type:null,module:"../../core-client/ui/UiSlider",sliderType:"percentage",connect:[!0,!1],defaultValue:e.value||e.defaultValue?e.value||e.defaultValue:.5,range:{min:0,max:100},step:1,format:{decimals:1,postfix:"%"},displayPos:19,noInputView:!0,active:!!e.active&&e.active}},getTransparencyPropertyForLayer:function(e){return e?{name:e.name,id:e.name,label:e.caption,ariaLabel:e.caption,type:null,module:"../../core-client/ui/UiSlider",sliderType:"percentage",connect:[!0,!1],defaultValue:e.value||e.defaultValue?e.value||e.defaultValue:.2,range:{min:0,max:100},step:1,format:{decimals:1,postfix:"%"},displayPos:19,noInputView:!0,active:!!e.active&&e.active}:null}}),i}}})),define("dashboard-analytics/visualizations/vipr/properties/ColorPropertiesCreator",["underscore","dashboard-analytics/widgets/livewidget/nls/StringResources","dashboard-analytics/visualizations/vipr/VIPRUtils","dashboard-analytics/visualizations/vipr/VIPRConfig"],(function(e,t,i,a){"use strict";var o;return o=null,{getInstance:function(){return o||(o={_getThemeIdForVIPRId:function(e){return{"itemAxis.title.color":"axisTitleFontColor","valueAxis.title.color":"axisTitleFontColor","valueAxis.column.title.color":"axisTitleFontColor","valueAxis.line.title.color":"axisTitleFontColor","axis.title.color":"axisTitleFontColor","target.title.color":"axisTitleFontColor","widget.legend.titleColor":"legendTitleColor","widget.legend.color":"legendBodyColor","widget.repeatHorizontal.labels.color":"repeatLabelColor","widget.repeatVertical.labels.color":"repeatLabelColor","itemAxis.ticks.labels.color":"axisLabelColor","valueAxis.ticks.labels.color":"axisLabelColor","valueAxis.column.ticks.labels.color":"axisLabelColor","valueAxis.line.ticks.labels.color":"axisLabelColor","axis.label.color":"axisLabelColor","labels.color":"elementsLabelColor","valueLabels.color":"elementsLabelColor","column.valueLabels.color":"elementsLabelColor","lineWithPoints.valueLabels.color":"elementsLabelColor","barLabels.color":"elementsLabelColor","itemAxis.ticks.color":"axisGridLineColor","valueAxis.ticks.color":"axisGridLineColor","valueAxis.column.ticks.color":"axisGridLineColor","valueAxis.line.ticks.color":"axisGridLineColor",axisColor:"axisLineColor",gridlineColor:"axisGridLineColor",labelColor:"axisLabelColor"}[e]},getThemeIdMappings:function(t){var i=this,a=[],o={};return e.each(t,(function(e){var t=i._getThemeIdForVIPRId(e.id);if(t){var n=o[t];n||(n={id:t,mapping:[]},o[t]=n,a.push(n)),n.mapping.push(e.id)}})),a},createColorProperty:function(e){var i={id:e.name,type:"Color",propertyType:"Color",label:e.caption,ariaLabel:e.caption,public:!1,sectionName:t.get("sectionName_colorPalette"),tabName:t.get("tabName_visualization"),name:e.name,displayPos:10,active:!!e.active&&e.active},a=o._getThemeIdForVIPRId(e.name);return a&&(i.themeProperty=a),i},getCategoricalColorPalettePropertyDesc:function(){return{id:"colorPalette",name:"colorPalette",type:"NewPalette",sectionLabel:t.get("propColorPalette"),newPaletteLabel:t.get("propNewColorPaletteLabel"),linkLabel:t.get("propColorPaletteChangeLabel"),enableReorder:!1,ariaLabel:t.get("propColorPalette"),sectionName:t.get("sectionName_colorPalette"),tabName:t.get("tabName_visualization"),public:!0,paletteType:"ColorPalette",displayPos:0,reversePalettePropName:"heatScalePalette",active:!0}},getDataLayerIdFromPaletteAndSlots:function(t,i){var a=t&&t.slot&&t.slot.name,o=a&&e.find(i,(function(e){return a===e.getId()})),n=o&&o.getDefinition().getDatasetIdList()[0];return"data"===n||"dataset"===n?null:n},getContinuousColorPalettePropertyNameWithLayer:function(e){return e?"contColorPalette_"+e:"contColorPalette"},_getCategoricalColorPalettePropertyNameWithLayer:function(e){return e?"colorPalette_"+e:"colorPalette"},getHeatScalePalettePropertyNameWithLayer:function(e){return e?"heatScalePalette_"+e:"heatScalePalette"},getHeatScalePalettePropertySectionNameWithLayer:function(e){return t.get(e&&e.colorRelatedProps.sectionNameId||"sectionName_colorPalette")},_getLayerDescriptionUsingId:function(t,i){return e.find(t.layerDescriptions,(function(e){return e.id===i}))},_getCategoricalColorPalettePropertyDescWithLayerId:function(i,a){var n=o._getCategoricalColorPalettePropertyNameWithLayer(a),s=o.getHeatScalePalettePropertyNameWithLayer(a),r=o._getLayerDescriptionUsingId(i,a),l=[{id:n,name:n,type:"NewPalette",sectionLabel:t.get(r&&r.colorRelatedProps.labelId||"propColorPalette"),newPaletteLabel:t.get("propNewColorPaletteLabel"),linkLabel:t.get("propColorPaletteChangeLabel"),enableReorder:!1,ariaLabel:t.get(r&&r.colorRelatedProps.labelId||"propColorPalette"),sectionName:o.getHeatScalePalettePropertySectionNameWithLayer(r),tabName:t.get("tabName_visualization"),public:!0,paletteType:"ColorPalette",displayPos:0,reversePalettePropName:s,defaultValue:r?r.colorRelatedProps.defaultPaletteValue:null,active:!0}];return r&&e.has(r.colorRelatedProps,"defaultColorIndex")&&l.push({id:n+"_defaultIndex",displayPos:1,type:"ColorPicker",public:!0,showHexValue:!0,sectionName:t.get("sectionName_colorPalette"),tabName:t.get("tabName_visualization"),palettePropertyName:n,paletteType:"ColorPalette",defaultValue:r.colorRelatedProps.defaultColorIndex.defaultValue||0,label:t.get(r.colorRelatedProps.defaultColorIndex.labelId),ariaLabel:t.get(r.colorRelatedProps.defaultColorIndex.labelId),active:!0,addMissingBaseColors:!1}),l},_getContinuousColorPalettePropertyDescWithLayerId:function(e,i){var a=o.getContinuousColorPalettePropertyNameWithLayer(i),n=o.getHeatScalePalettePropertyNameWithLayer(i),s=o._getLayerDescriptionUsingId(e,i);return{id:a,name:a,type:"NewPalette",sectionLabel:t.get(s&&(s.colorRelatedProps.contLabelId||s.colorRelatedProps.labelId)||"propHeatScalePalette"),newPaletteLabel:t.get("propNewHeatPaletteLabel"),linkLabel:t.get("propHeatPaletteChangeLabel"),open:!1,ariaLabel:t.get(s&&(s.colorRelatedProps.contLabelId||s.colorRelatedProps.labelId)||"propHeatScalePalette"),enableReorder:!0,paletteType:"HeatPalette",sectionName:o.getHeatScalePalettePropertySectionNameWithLayer(s),tabName:t.get("tabName_visualization"),reversePalettePropName:n,defaultValue:s?s.colorRelatedProps.defaultPaletteValue:null,active:!0}},_getHeatScaleOrderPropertyDescriptionWithLayerId:function(e,i){var a=e&&o._getLayerDescriptionUsingId(e,i);return{id:o.getHeatScalePalettePropertyNameWithLayer(i),public:!1,active:!0,sectionName:o.getHeatScalePalettePropertySectionNameWithLayer(a),tabName:t.get("tabName_visualization")}},_getHeatScaleOrderPropertyDescription:function(){return o._getHeatScaleOrderPropertyDescriptionWithLayerId(null)},_getColorPalettePropertiesForLayersFromVisId:function(e){var t=[];return e.layerDescriptions.forEach((function(i){t.push.apply(t,o._getCategoricalColorPalettePropertyDescWithLayerId(e,i.id)),t.push(o._getContinuousColorPalettePropertyDescWithLayerId(e,i.id));var a={name:i.colorRelatedProps.transparencyProp,active:!0},n=o.getTransparencyPropertyForLayer(a);n&&t.push(n);var s=o._getHeatScaleOrderPropertyDescriptionWithLayerId(e,i.id);s&&t.push(s)})),t},_getColorPalettePropertyForLayer:function(e,t,i,a){switch(e){case"cat":i.push.apply(i,o._getCategoricalColorPalettePropertyDescWithLayerId(t,a)),i.push(o._getHeatScaleOrderPropertyDescriptionWithLayerId(t,a));break;case"cont":i.push(o._getContinuousColorPalettePropertyDescWithLayerId(t,a));break;case"single":i.push(o._getCategoricalColorPalettePropertyDesc())}},getTransparencyPropertyForLayer:function(e){return e?{name:e.name,id:e.name,label:e.caption,ariaLabel:e.caption,type:null,module:"lib/@waca/core-client/js/core-client/ui/UiSlider",sliderType:"percentage",description:t.get("propTransparencyDescription"),connect:[!0,!1],defaultValue:e.value||e.defaultValue?e.value||e.defaultValue:.2,range:{min:0,max:100},step:1,format:{decimals:1,postfix:"%"},displayPos:19,noInputView:!0,sectionName:t.get("sectionName_colorPalette"),tabName:t.get("tabName_visualization"),active:!!e.active&&e.active}:null},_getColorPaletteLayerTransparencyPropertyForLayer:function(t,i,a,n,s){var r=o.getDataLayerIdFromPaletteAndSlots(a,n),l=e.find(i.layerDescriptions,(function(e){return e.id===r})),c=t.get(l.colorRelatedProps.transparencyProp),u=o.getTransparencyPropertyForLayer(c);u&&s.push(u)},_getColorPaletteProperties:function(e,t,n){var s=[],r=a.getConfig(n);return r&&r.supportsLayers?i.getPalettes(e,n).forEach(function(i){var a=o.getDataLayerIdFromPaletteAndSlots(i,t);a&&(o._getColorPalettePropertyForLayer(i.paletteType,r,s,a),o._getColorPaletteLayerTransparencyPropertyForLayer(e,r,i,t,s))}.bind(o)):r&&i.getPalettes(e,n).forEach((function(e){switch(e.paletteType){case"cat":case"customcat":s.push(o._getCategoricalColorPalettePropertyDesc()),s.push(o._getHeatScaleOrderPropertyDescription());break;case"cont":case"customcont":s.push(o._getContinuousColorPalettePropertyDescWithLayerId(r))}})),s},_includesPalettesOfType:function(e,t){return e.some((function(e){return e&&e.paletteType===t}))},getDefaultPaletteIndexProperty:function(){return{id:"defaultPaletteIndex",displayPos:1,type:"ColorPicker",public:!0,showHexValue:!0,sectionName:t.get("sectionName_colorPalette"),tabName:t.get("tabName_visualization"),palettePropertyName:"colorPalette",paletteType:"ColorPalette",defaultColorIndex:0,label:t.get("propElementColor"),ariaLabel:t.get("propElementColor"),active:!0,addMissingBaseColors:!1}},getSinglePaletteColorProperty:function(e){return{id:e.id,displayPos:1,type:"ColorPicker",public:!0,showHexValue:!0,sectionName:t.get("sectionName_colorPalette"),tabName:t.get("tabName_visualization"),palettePropertyName:"colorPalette",paletteType:"ColorPalette",defaultColorIndex:e.defaultColorIndex,label:t.get(e.labelId),ariaLabel:t.get(e.labelId),active:!0,addMissingBaseColors:!1}},_isColorSlotEncoded:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=e.find((function(e){return"color"===e.getId()}));return!(!t||!t.getDataItemList().length)},_getCategoricalColorPalettePropertyDesc:function(){return{id:"colorPalette",name:"colorPalette",type:"NewPalette",sectionLabel:t.get("propColorPalette"),newPaletteLabel:t.get("propNewColorPaletteLabel"),linkLabel:t.get("propColorPaletteChangeLabel"),enableReorder:!1,ariaLabel:t.get("propColorPalette"),sectionName:t.get("sectionName_colorPalette"),tabName:t.get("tabName_visualization"),public:!0,paletteType:"ColorPalette",displayPos:0,reversePalettePropName:"heatScalePalette",active:!0}},_addCategoricalPalletePropForSinglePalletesIfNeeded:function(e,t,n){var s=o._includesPalettesOfType(i.getPalettes(t,n),"cat"),r=a.getConfig(n);if(!s&&!r.doesNotSupportCategoricalPalette){var l=o._getCategoricalColorPalettePropertyDesc();e[l.id]=l}},addColorRelatedProperties:function(e,t,a,n){if(o._getColorPaletteProperties(t,a,n).forEach((function(t){e[t.id]=t})),i.getSinglePalettes(t,n).length>0){o._addCategoricalPalletePropForSinglePalletesIfNeeded(e,t,n);var s=i.getSinglePaletteProperties(n)||{};Object.values(s).forEach((function(t){var i=o.getSinglePaletteColorProperty(t);e[i.id]=i}))}else if(!o._isColorSlotEncoded(a)&&!i.doesConfigPropertyMatchExpected(n,"ignoreElementColor",!0)){var r=o.getDefaultPaletteIndexProperty();e[r.id]=r}},getColorPalettePropertiesFromVisId:function(e){var t=a.getConfig(e);if(t&&t.supportsLayers)return o._getColorPalettePropertiesForLayersFromVisId(t);var i=[];return t&&(i.push(o.getCategoricalColorPalettePropertyDesc(t)),i.push(o._getContinuousColorPalettePropertyDescWithLayerId(t)),i.push(o._getHeatScaleOrderPropertyDescription())),i}}),o}}})),define("dashboard-analytics/visualizations/vipr/properties/PropertiesCreatorFromVisDefinition",["underscore","dashboard-analytics/widgets/livewidget/nls/StringResources","dashboard-analytics/visualizations/properties/PropertiesCreator","dashboard-analytics/visualizations/vipr/properties/ColorPropertiesCreator","dashboard-analytics/visualizations/vipr/VIPRUtils","../VIPRConfig"],(function(e,t,i,a,o,n){"use strict";var s;return s=null,{getInstance:function(){return s||(s={_createGenericProperty:function(e){return{id:e,name:e}},getPropertiesFromDefintion:function(e){var t=i.getInstance(),r=a.getInstance(),l=[],c=n.getConfig(e)||{};c&&c.config&&c.config.include&&c.config.include.forEach((function(t){var i=s._createGenericProperty(t),a=o.overrideProperty(e,i,t);l.push(a)})),l.push(t.getMaintainAxisScaleProperty());var u=o.getSinglePaletteProperties(e);u?Object.values(u).forEach((function(e){l.push(r.getSinglePaletteColorProperty(e))})):l.push(r.getDefaultPaletteIndexProperty());var d=r.getColorPalettePropertiesFromVisId(e);return d&&d.length&&(l=l.concat(d)),c.propertyList&&(l=l.concat(c.propertyList)),l},getVizDefPropertiesFromDefinition:function(t){var i=[],a=n.getConfig(t.id)||{};return a&&a.config&&a.config.include&&a.config.include.forEach((function(a){var n=s._createGenericProperty(a),r=t.vizDef.getProperty(a)||{};n.active=!0,n=e.extend(r,n);var l=o.overrideProperty(t.id,n,a);i.push(l)})),i.get=function(e){return i.find((function(t){return t.id===e}))},i}}),s}}})),define("dashboard-analytics/visualizations/definitions/providers/VIPR3Provider",["underscore","./BaseProvider","../../vipr/VIPR","../../vipr/VIPRUtils","../../vipr/VIPRConfig","../../vipr/VIPRLibraries","../../vipr/properties/PropertiesCreatorFromVisDefinition","../../vipr/properties/ColorPropertiesCreator","../../../lib/@waca/dashboard-common/dist/utils/ObjectHelper","../../../widgets/livewidget/nls/StringResources","../../../widgets/livewidget/util/VisUtil"],(function(e,t,i,a,o,n,s,r,l,c,u){"use strict";var d="dashboard-analytics/visualizations/renderer/vipr3/VIPRView",h=t.extend({init:function(){h.inherited("init",this,arguments),this.viprdefinitionsPromises=null,this.createDefinitionsMap={},this.loadedVipr3Bundles={},this.initPromise=i.initialize({dashboardApi:this.dashboardApi})},contains:function(e){return this.initPromise.then((function(){var t=i.getLibraries();return Promise.resolve(!!t[e])}))},clear:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:n.LIB_TYPE_ALL;if(t===n.LIB_TYPE_ALL)this.viprdefinitionsPromises=null,this.createDefinitionsMap={},this.loadedVipr3Bundles={};else if(this.viprdefinitionsPromises){var a=[];t===n.LIB_TYPE_SYSTEM?a=i.getSystemLibIds():t===n.LIB_TYPE_CUSTOM&&(a=i.getCustomLibIds()),a.forEach((function(t){delete e.viprdefinitionsPromises[t],delete e.createDefinitionsMap[t],delete e.loadedVipr3Bundles[t],o.removeCustomVisConfiguration(t)}))}},_visualizationPreviewWasLoaded:function(){return!!this.loadedVipr3Bundles.visualizationPreview},refreshProvider:function(t){var a=this,o=this._visualizationPreviewWasLoaded();return this.clear(n.LIB_TYPE_CUSTOM),this.initPromise=i.initialize({dashboardApi:t,refresh:!0}),this.initPromise.then(this._getVIPRDefinitions.bind(this,n.LIB_TYPE_CUSTOM,o)).then((function(){var t=Object.values(a.viprdefinitionsPromises);return Promise.all(t).then((function(t){return e.chain(t).map((function(e){return e?a.createDefinition(e,!0):null})).filter((function(e){return!!e})).value()}))}))},getDefinition:function(e){var t=this;return this.initPromise.then((function(){return t._getVIPRDefinition(e).then((function(i){return i?(t.createDefinitionsMap[e]||(t.createDefinitionsMap[e]=t.createDefinition(i,!0)),t.createDefinitionsMap[e]):Promise.reject(u.createVisDefinitionLoadingError(e))}))}))},getDefinitions:function(){var e=this;return this.initPromise.then((function(){return e._getVIPRDefinitions().then((function(t){return e._createDefinitions(t,!0)}))}))},_createDefinitions:function(t,i){var a=this;return this.createDefinitionsMap||(this.createDefinitionsMap={}),e.chain(t).map((function(e){if(!a.createDefinitionsMap[e.id])return a.createDefinitionsMap[e.id]=a.createDefinition(e,i),a.createDefinitionsMap[e.id]})).filter((function(e){return!!e})).value()},refresh:function(e){var t=this;return i.unloadBundle(e),this._loadVIPRDefinition(e).then((function(i){return t.createDefinitionsMap||(t.createDefinitionsMap={}),t.createDefinitionsMap[e]=i?t.createDefinition(i,!0):{id:e,renderer:d,empty:!0},t.createDefinitionsMap[e]}))},_loadVIPRDefinition:function(e){var t=this;return i.loadBundle(e).then((function(i){return t.loadedVipr3Bundles[e]=i,i})).catch((function(e){console.error(e)}))},_getVIPRDefinition:function(e){return this.viprdefinitionsPromises||(this.viprdefinitionsPromises={}),this.viprdefinitionsPromises[e]||(this.viprdefinitionsPromises[e]=this._loadVIPRDefinition(e)),this.viprdefinitionsPromises[e]},_getVIPRDefinitions:function(){var t=this,a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:n.LIB_TYPE_ALL,o=arguments.length>1&&void 0!==arguments[1]&&arguments[1],s=void 0;s=o?i.getBundleIds(a):e.without(i.getBundleIds(a),"visualizationPreview");var r=e.map(s,(function(e){return t._getVIPRDefinition(e)}));return Promise.all(r.map((function(e){return e.catch((function(e){return e}))}))).then((function(t){return e.filter(t,(function(e){return!!e}))})).catch((function(e){console.error(e)}))},_getViprDefinitionProperties:function(e){return e.vizDef.properties},_getCaption:function(e,t,i,a){return"customVisTestVisualization"===e.userData.name?t.name:i?e.userData.name:a&&"schematicTestCaption"!==e.userData.name?t.name:c.get(e.userData.name)},createDefinition:function(e,t){var i=o.getConfig(e.id),n=i&&i.type,c=i&&i.isSchematic,u=i&&i.isCustomVis,h=i&&i.usages,p=this._getPlaceholder(e,u,c),g=this._getCaption(e,i,u,c),v=c?i.icon:e.userData.icon,m=c?i.assetId:e.userData.assetId;a.includeAllProperties(e)&&this._setViprConfigDefinition(i,e,[],{});var f=s.getInstance().getVizDefPropertiesFromDefinition(e),_=s.getInstance().getPropertiesFromDefintion(e.id),y={type:n,isSchematic:c,isCustomVis:u,id:e.id,supportsSortAction:a.supportsSortAction(e.id),supportsContextualTopBottomAction:a.supportsContextualTopBottomAction(e.id),supportsNonContextualTopBottomAction:a.supportsNonContextualTopBottomAction(e.id),supportsFormatAction:a.supportsFormatAction(e.id),supportsMaintainAxisScale:a.supportsMaintainAxisScale(e.id),supportsCustomGroupAction:a.supportsCustomGroupAction(e.id),supportsCustomDataSelection:a.supportsCustomDataSelection(e.id),supportsAnnotations:a.supportsAnnotations(e.id),datasets:this._getDatasets(e.vizDef.dataSets),geo:a.isGeospatial(e.id),name:e.manifest.name,caption:g,label:g,icon:v,assetId:m,tabs:a.getVisualizationTabs(e.id),placeholderIcon:p,isRecommendable:a.isRecommendable(e.id),noDataQuery:a.noDataQuery(e.id),isMultilayersWidget:a.doesConfigPropertyMatchExpected(e.id,"isMultilayersWidget",!0),useFPDAsInsightsInput:a.useFPDAsInsightsInput(e.id),disablePan:a.isDisablePan(e.id),renderWithoutCompletingMapping:a.isRenderWithoutCompletingMapping(e.id),aggregateAndSortOnClient:a.aggregateAndSortOnClient(e.id),preferredSize:{height:420,width:500},dataSlots:a.createDataSlots(e),metaDataEntries:a.createMetaDataEntries(e.vizDef),properties:_,vizDefProperties:f,propertyPrefixes:a.getPropertyPrefixes(e),listenForPropChanges:a.getListenForPropChanges(e),groupedProperty:a.getGroupedProperty(e),renderer:d,scope:"default",themeMapping:r.getInstance().getThemeIdMappings(_),queryHints:a.getQueryHints(e.id),binningConfig:a.getBinning(e.id),canApplyBinning:a.canApplyAutoBin(e.id),isViewBinned:!1,supportsOLAP:!a.doesConfigPropertyMatchExpected(e.id,"doesNotSupportOLAP",!0),usages:h};c&&(y.getSchematicContent=i.schematicVis.getSchematicContent.bind(i.schematicVis));var I=a.getDataRowLimit(e.id);I&&(y.dataRowLimit=I);var b=a.getDataRowLimitIE(e.id);return b&&(y.dataRowLimitIE=b),t?l.deepFreezeObject(y):y},_setViprConfigDefinition:function(e,t,n,s){a.getViprProperiesAndGroups(t,n,s);var r={viprProperties:n,viprGroupProperties:_extends({},s),dataSets:t.vizDef.dataSets};o.setAllViprConfigProperties(e,r),t.userData.config={properties:{exclude:[],include:e.bundleInclude}},i.updateCustomLibrary(t.id)},_getPlaceholder:function(e,t,i){var a=i&&"com.ibm.vis.schematicsPreview"!==e.id,o=t&&"visualizationPreview"!==e.id,n=this.icon_root,s=e.userData.placeholderIcon;return e.userData.icon?(o||a)&&(n=e.userData.placeholderIcon,s=e.userData.icon):t?s="placeholders/custom-visual.svg":i&&(s="placeholders/custom-schematic.svg"),n+s},_getDatasets:function(t){var i=1===t.length;return e.map(t,(function(e){return{name:i&&!e.name?"data":e.name,optional:e.optional,suppressMissing:e.suppressMissing,needsSorted:e.needsSorted,requiresValues:e.requiresValues,caption:e.caption}}))}});return h})),define("dashboard-analytics/visualizations/definitions/providers/LocalProvider",["underscore","./BaseProvider","../../../DynamicFileLoader"],(function(e,t,i){var a=/{{ICON:.*}}/,o=t.extend({definitionsPromise:null,init:function(e){o.inherited("init",this,arguments),this.logger=e.dashboardApi.getGlassCoreSvc(".Logger"),this.localDefinitions=[]},clear:function(){this.definitionsPromise=null},_fetchIconId:function(e){var t=this,o=[],n=function(n){if("object"==_typeof(e[n])&&null!==e[n])o.push.apply(o,t._fetchIconId(e[n]));else if("string"==typeof e[n]&&a.test(e[n])){var s=e[n].slice(7,-2).split("."),r=s[0],l=s.slice(1),c="dashboard-analytics/lib/@waca/dashboard-common/dist/lib/@ba-ui-toolkit/ba-graphics/dist/icons-js/"+r;o.push(i.load([c]).then((function(t){var i=t[0];l.forEach((function(e){i=i[e]})),e[n]=i})))}};for(var s in e)n(s);return o},_preprocessDefinitions:function(e){var t=this,i=[];return e.forEach((function(e){e.id=e.id.replace("com.ibm.bi.dashboard.",""),i.push.apply(i,t._fetchIconId(e))})),Promise.all(i).then((function(){return e}))},getDefinitions:function(){var e=this;return this.definitionsPromise||(this.definitionsPromise=new Promise((function(t){e.dashboardApi.findGlassCollection("com.ibm.bi.dashboard.live-visualizations").then((function(t){return e._preprocessDefinitions(t)})).then((function(i){var a;e.setDefinitions(i),e.massageDefinitions(i),e.freezeDefinitions(i),i=i||[],(a=e.localDefinitions).push.apply(a,i),t(e.localDefinitions)})).catch((function(i){e.logger.error("Error: unable to query local definitions",i),t([])}))}))),this.definitionsPromise},massageDefinitions:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];e.forEach((function(e){var t=e.datasets;t&&t.forEach((function(e){e.getId=function(){return e.name}}))}))},refreshProvider:function(){return Promise.resolve(this.localDefinitions)},refresh:function(){throw new Error("refresh is not supported for local provider")}});return o})),define("dashboard-analytics/visualizations/vipr/properties/VIPRPropertiesOrderer",["underscore"],(function(e){"use strict";var t;return t=null,{getInstance:function(){return t||(t={_setPropertyDescLevel:function(e,t,i){var a=e[t];a&&(a.displayPos=i)},_setLevel0To4:function(e){t._setPropertyDescLevel(e,"itemAxis.title.visible",0),t._setPropertyDescLevel(e,"valueAxis.title.visible",0),t._setPropertyDescLevel(e,"valueAxis.column.title.visible",0),t._setPropertyDescLevel(e,"itemAxis.ticks.labels.visible",0),t._setPropertyDescLevel(e,"valueAxis.ticks.labels.visible",0),t._setPropertyDescLevel(e,"colorPalette",0),t._setPropertyDescLevel(e,"colorPalette_column_defaultIndex",0),t._setPropertyDescLevel(e,"itemAxis.ticks.visible",1),t._setPropertyDescLevel(e,"valueAxis.ticks.visible",1),t._setPropertyDescLevel(e,"defaultPaletteIndex",1),t._setPropertyDescLevel(e,"valueAxis.column.title",1),t._setPropertyDescLevel(e,"valueAxis.column.title.font",2),t._setPropertyDescLevel(e,"valueAxis.column.ticks.labels.font",2),t._setPropertyDescLevel(e,"lineColor",2),t._setPropertyDescLevel(e,"valueAxis.column.title.color",4),t._setPropertyDescLevel(e,"valueAxis.line.title.visible",5),t._setPropertyDescLevel(e,"valueAxis.line.title",6),t._setPropertyDescLevel(e,"valueAxis.line.title.font",7),t._setPropertyDescLevel(e,"valueAxis.line.title.color",9)},_setBooleanDefaultOrder:function(t){e.each(t,(function(e){"CheckBox"===e.type&&(e.displayPos=6)}))},_setLevel10To14:function(e){t._setPropertyDescLevel(e,"valueAxis.minValue",5),t._setPropertyDescLevel(e,"valueAxis.maxValue",6),t._setPropertyDescLevel(e,"valueAxis.line.minValue",5),t._setPropertyDescLevel(e,"valueAxis.line.maxValue",6),t._setPropertyDescLevel(e,"valueAxis.column.minValue",7),t._setPropertyDescLevel(e,"valueAxis.column.maxValue",8),t._setPropertyDescLevel(e,"itemAxis.minValue",7),t._setPropertyDescLevel(e,"itemAxis.maxValue",8),t._setPropertyDescLevel(e,"itemAxis.labels.layoutMode",13),t._setPropertyDescLevel(e,"axis.x.alignment",14),t._setPropertyDescLevel(e,"itemAxis.alignment",14)},_setLevel15To19:function(e){t._setPropertyDescLevel(e,"stacked",15),t._setPropertyDescLevel(e,"stacked.percent",16)},_setLevel20To24:function(e){t._setPropertyDescLevel(e,"target.marker.color",0),t._setPropertyDescLevel(e,"axisColor",0),t._setPropertyDescLevel(e,"target.marker.thickness",1),t._setPropertyDescLevel(e,"label.location",2),t._setPropertyDescLevel(e,"label.percentage",3),t._setPropertyDescLevel(e,"valueLabels.visible",4),t._setPropertyDescLevel(e,"column.valueLabels.visible",4),t._setPropertyDescLevel(e,"column.valueLabels.location",4),t._setPropertyDescLevel(e,"column.valueLabels.orientation",4),t._setPropertyDescLevel(e,"column.valueLabels.color",5),t._setPropertyDescLevel(e,"valueLabels.location",5),t._setPropertyDescLevel(e,"valueLabels.orientation",6),t._setPropertyDescLevel(e,"lineWithPoints.valueLabels.visible",6),t._setPropertyDescLevel(e,"lineWithPoints.valueLabels.color",7),t._setPropertyDescLevel(e,"valueLabels.format",7),t._setPropertyDescLevel(e,"contrast.label.color",8),t._setPropertyDescLevel(e,"bar.direction.vertical",8),t._setPropertyDescLevel(e,"lineWithPoints.interpolate",9),t._setPropertyDescLevel(e,"label.shadow",9),t._setPropertyDescLevel(e,"labels.format",10),t._setPropertyDescLevel(e,"labelLocation",11),t._setPropertyDescLevel(e,"leaf.labels.visible",11),t._setPropertyDescLevel(e,"renderingMode",12),t._setPropertyDescLevel(e,"valueAxis.tickInterval",12),t._setPropertyDescLevel(e,"valueAxis.logarithmic",13),t._setPropertyDescLevel(e,"valueAxis.line.logarithmic",13),t._setPropertyDescLevel(e,"valueAxis.column.logarithmic",14),t._setPropertyDescLevel(e,"totalColumn.visible",0),t._setPropertyDescLevel(e,"subcategory.values",1),t._setPropertyDescLevel(e,"subcategory.totals",2)},_setLevel25To29:function(e){t._setPropertyDescLevel(e,"lines.visible",25),t._setPropertyDescLevel(e,"linesWithPoints.symbol",26),t._setPropertyDescLevel(e,"symbol.shape",27),t._setPropertyDescLevel(e,"symbolShape",27),t._setPropertyDescLevel(e,"markers.visible",28),t._setPropertyDescLevel(e,"lineWithPoints.display",28),t._setPropertyDescLevel(e,"lineWithPoints.symbol",29)},_setLevel30To34:function(e){t._setPropertyDescLevel(e,"pie.has.hole",30),t._setPropertyDescLevel(e,"donutRadius",31),t._setPropertyDescLevel(e,"widget.legend.display",32),t._setPropertyDescLevel(e,"widget.legend.titleVisible",33),t._setPropertyDescLevel(e,"locationColor.title",34)},_setLevel35To39:function(e){t._setPropertyDescLevel(e,"pointSize.title",35),t._setPropertyDescLevel(e,"pointColor.title",36),t._setPropertyDescLevel(e,"latlongSize.title",37),t._setPropertyDescLevel(e,"latlongColor.title",38),t._setPropertyDescLevel(e,"widget.legend.position",39),t._setPropertyDescLevel(e,"totalColumn.legend.label.positive",40),t._setPropertyDescLevel(e,"widget.legend.font",40),t._setPropertyDescLevel(e,"itemAxis.title.font",40),t._setPropertyDescLevel(e,"itemAxis.ticks.labels.font",40),t._setPropertyDescLevel(e,"valueAxis.title.font",40),t._setPropertyDescLevel(e,"valueAxis.ticks.labels.font",40),t._setPropertyDescLevel(e,"valueAxis.line.ticks.labels.font",40),t._setPropertyDescLevel(e,"firstColumn.positive.label",41),t._setPropertyDescLevel(e,"firstColumn.negative.label",41),t._setPropertyDescLevel(e,"value.positive.label",42),t._setPropertyDescLevel(e,"value.negative.label",42),t._setPropertyDescLevel(e,"widget.legend.color",43),t._setPropertyDescLevel(e,"color.title",44),t._setPropertyDescLevel(e,"pointcolor.title",44),t._setPropertyDescLevel(e,"series.title",44),t._setPropertyDescLevel(e,"categories.title",44),t._setPropertyDescLevel(e,"columnColor.title",44),t._setPropertyDescLevel(e,"lineColor.title",44),t._setPropertyDescLevel(e,"values.title",45),t._setPropertyDescLevel(e,"size.title",46),t._setPropertyDescLevel(e,"color.min",47),t._setPropertyDescLevel(e,"color.mid",48),t._setPropertyDescLevel(e,"color.max",49)},orderProperties:function(e){t._setLevel0To4(e),t._setBooleanDefaultOrder(e),t._setLevel10To14(e),t._setLevel15To19(e),t._setLevel20To24(e),t._setLevel25To29(e),t._setLevel30To34(e),t._setLevel35To39(e)}}),t}}})),define("dashboard-analytics/visualizations/properties/PropertySectioner",["underscore","dashboard-analytics/widgets/livewidget/nls/StringResources"],(function(e,t){"use strict";var i,a,o,n;return i=null,a={colorPalette:1,axis:2,legend:3,chart:4},o={"itemAxis.title.visible":{sectionId:"axis.itemAxisTitle",sectionResource:"sectionName_axis",tabId:"visualization",tabResource:"tabName_visualization"},"valueAxis.title.visible":{sectionId:"axis.valueAxisTitle",sectionResource:"sectionName_axis",tabId:"visualization",tabResource:"tabName_visualization"},"valueAxis.column.title.visible":{sectionId:"axis.valueAxisTitle",sectionResource:"sectionName_axis",tabId:"visualization",tabResource:"tabName_visualization"},"valueAxis.line.title.visible":{sectionId:"axis.valueAxisTitle",sectionResource:"sectionName_axis",tabId:"visualization",tabResource:"tabName_visualization"},"itemAxis.ticks.labels.layoutMode":{sectionId:"axis",sectionResource:"sectionName_axis",tabId:"visualization",tabResource:"tabName_visualization"},heatScalePalette:{sectionId:"colorPalette",sectionResource:"sectionName_colorPalette",tabId:"visualization",tabResource:"tabName_visualization"},colorPalette:{sectionId:"colorPalette",sectionResource:"sectionName_colorPalette",tabId:"visualization",tabResource:"tabName_visualization"},contColorPalette:{sectionId:"colorPalette",sectionResource:"sectionName_colorPalette",tabId:"visualization",tabResource:"tabName_visualization"},defaultPaletteIndex:{sectionId:"colorPalette",sectionResource:"sectionName_colorPalette",tabId:"visualization",tabResource:"tabName_visualization"},lineColor:{sectionId:"colorPalette",sectionResource:"sectionName_colorPalette",tabId:"visualization",tabResource:"tabName_visualization"},fromColor:{sectionId:"colorPalette",sectionResource:"sectionName_colorPalette",tabId:"visualization",tabResource:"tabName_visualization"},goal_color:{sectionId:"colorPalette",sectionResource:"sectionName_colorPalette",tabId:"visualization",tabResource:"tabName_visualization"},compositeLineColor:{sectionId:"colorPalette",sectionResource:"sectionName_colorPalette",tabId:"visualization",tabResource:"tabName_visualization"},maintainAxisScales:{sectionId:"axis",sectionResource:"sectionName_axis",tabId:"visualization",tabResource:"tabName_visualization"},"itemAxis.minValue":{sectionId:"axis",sectionResource:"sectionName_axis",tabId:"visualization",tabResource:"tabName_visualization"},"itemAxis.maxValue":{sectionId:"axis",sectionResource:"sectionName_axis",tabId:"visualization",tabResource:"tabName_visualization"},"valueAxis.minValue":{sectionId:"axis",sectionResource:"sectionName_axis",tabId:"visualization",tabResource:"tabName_visualization"},"valueAxis.maxValue":{sectionId:"axis",sectionResource:"sectionName_axis",tabId:"visualization",tabResource:"tabName_visualization"},"valueAxis.line.minValue":{sectionId:"axis",sectionResource:"sectionName_axis",tabId:"visualization",tabResource:"tabName_visualization"},"valueAxis.line.maxValue":{sectionId:"axis",sectionResource:"sectionName_axis",tabId:"visualization",tabResource:"tabName_visualization"},"valueAxis.column.minValue":{sectionId:"axis",sectionResource:"sectionName_axis",tabId:"visualization",tabResource:"tabName_visualization"},"valueAxis.column.maxValue":{sectionId:"axis",sectionResource:"sectionName_axis",tabId:"visualization",tabResource:"tabName_visualization"},"widget.legend.display":{sectionId:"legend",sectionResource:"sectionName_legend",tabId:"visualization",tabResource:"tabName_visualization"},"widget.legend.titleVisible":{sectionId:"legend",sectionResource:"sectionName_legend",tabId:"visualization",tabResource:"tabName_visualization"},"widget.legend.aggregateTypeVisible":{sectionId:"legend",sectionResource:"sectionName_legend",tabId:"visualization",tabResource:"tabName_visualization"},"widget.legend.position":{sectionId:"legend",sectionResource:"sectionName_legend",tabId:"visualization",tabResource:"tabName_visualization"},"color.title":{sectionId:"legend",sectionResource:"sectionName_legend",tabId:"visualization",tabResource:"tabName_visualization"},"pointcolor.title":{sectionId:"legend",sectionResource:"sectionName_legend",tabId:"visualization",tabResource:"tabName_visualization"},"series.title":{sectionId:"legend",sectionResource:"sectionName_legend",tabId:"visualization",tabResource:"tabName_visualization"},"values.title":{sectionId:"legend",sectionResource:"sectionName_legend",tabId:"visualization",tabResource:"tabName_visualization"},"categories.title":{sectionId:"legend",sectionResource:"sectionName_legend",tabId:"visualization",tabResource:"tabName_visualization"},"size.title":{sectionId:"legend",sectionResource:"sectionName_legend",tabId:"visualization",tabResource:"tabName_visualization"},"columnColor.title":{sectionId:"legend",sectionResource:"sectionName_legend",tabId:"visualization",tabResource:"tabName_visualization"},"lineColor.title":{sectionId:"legend",sectionResource:"sectionName_legend",tabId:"visualization",tabResource:"tabName_visualization"},"gridLines.visible":{sectionId:"chart",sectionResource:"sectionName_chart",tabId:"visualization",tabResource:"tabName_visualization"},axisColor:{sectionId:"axis",sectionResource:"sectionName_axis",tabId:"visualization",tabResource:"tabName_visualization"},"itemAxis.ticks.labels.color":{sectionId:"axis.itemAxisLabel",sectionResource:"sectionName_axis",tabId:"visualization",tabResource:"tabName_visualization"},"valueAxis.ticks.labels.color":{sectionId:"axis.valueAxisLabel",sectionResource:"sectionName_axis",tabId:"visualization",tabResource:"tabName_visualization"},"itemAxis.ticks.labels.font":{sectionId:"axis.itemAxisLabel",sectionResource:"sectionName_axis",tabId:"visualization",tabResource:"tabName_visualization"},"valueAxis.ticks.labels.font":{sectionId:"axis.valueAxisLabel",sectionResource:"sectionName_axis",tabId:"visualization",tabResource:"tabName_visualization"},"itemAxis.title.color":{sectionId:"axis.itemAxisTitle",sectionResource:"sectionName_axis",tabId:"visualization",tabResource:"tabName_visualization"},"valueAxis.title.color":{sectionId:"axis.valueAxisTitle",sectionResource:"sectionName_axis",tabId:"visualization",tabResource:"tabName_visualization"},"itemAxis.title":{sectionId:"axis.itemAxisTitle",sectionResource:"sectionName_axis",tabId:"visualization",tabResource:"tabName_visualization"},"valueAxis.title":{sectionId:"axis.valueAxisTitle",sectionResource:"sectionName_axis",tabId:"visualization",tabResource:"tabName_visualization"},"itemAxis.title.font":{sectionId:"axis.itemAxisTitle",sectionResource:"sectionName_axis",tabId:"visualization",tabResource:"tabName_visualization"},"itemAxis.ticks.labels.visible":{sectionId:"axis.itemAxisLabel",sectionResource:"sectionName_axis",tabId:"visualization",tabResource:"tabName_visualization"},"itemAxis.ticks.visible":{sectionId:"axis.itemAxisLabel",sectionResource:"sectionName_axis",tabId:"visualization",tabResource:"tabName_visualization"},"valueAxis.ticks.labels.visible":{sectionId:"axis.valueAxisLabel",sectionResource:"sectionName_axis",tabId:"visualization",tabResource:"tabName_visualization"},"valueAxis.ticks.visible":{sectionId:"axis.valueAxisLabel",sectionResource:"sectionName_axis",tabId:"visualization",tabResource:"tabName_visualization"},"valueAxis.title.font":{sectionId:"axis.valueAxisTitle",sectionResource:"sectionName_axis",tabId:"visualization",tabResource:"tabName_visualization"},"valueAxis.tickInterval":{sectionId:"chart",sectionResource:"sectionName_chart",tabId:"visualization",tabResource:"tabName_visualization"},"valueAxis.logarithmic":{sectionId:"chart",sectionResource:"sectionName_chart",tabId:"visualization",tabResource:"tabName_visualization"},"valueAxis.line.logarithmic":{sectionId:"chart",sectionResource:"sectionName_chart",tabId:"visualization",tabResource:"tabName_visualization"},"valueAxis.column.logarithmic":{sectionId:"chart",sectionResource:"sectionName_chart",tabId:"visualization",tabResource:"tabName_visualization"},"itemAxis.labels.layoutMode":{sectionId:"axis.itemAxisLabel",sectionResource:"sectionName_axis",tabId:"visualization",tabResource:"tabName_visualization"},"axis.x.alignment":{sectionId:"axis",sectionResource:"sectionName_axis",tabId:"visualization",tabResource:"tabName_visualization"},"itemAxis.alignment":{sectionId:"axis",sectionResource:"sectionName_axis",tabId:"visualization",tabResource:"tabName_visualization"},gridlineColor:{sectionId:"chart",sectionResource:"sectionName_chart",tabId:"visualization",tabResource:"tabName_visualization"},labelColor:{sectionId:"chart",sectionResource:"sectionName_chart",tabId:"visualization",tabResource:"tabName_visualization"},backgroundColor:{sectionId:"colorPalette",sectionResource:"sectionName_colorPalette",tabId:"visualization",tabResource:"tabName_visualization"},colorPalette_column:{sectionId:"colorPalette",sectionResource:"sectionName_colorPalette",tabId:"visualization",tabResource:"tabName_visualization"},colorPalette_column_defaultIndex:{sectionId:"colorPalette",sectionResource:"sectionName_colorPalette",tabId:"visualization",tabResource:"tabName_visualization"},contColorPalette_column:{sectionId:"colorPalette",sectionResource:"sectionName_colorPalette",tabId:"visualization",tabResource:"tabName_visualization"},colorPalette_line:{sectionId:"colorPalette",sectionResource:"sectionName_colorPalette",tabId:"visualization",tabResource:"tabName_visualization"},colorPalette_line_defaultIndex:{sectionId:"colorPalette",sectionResource:"sectionName_colorPalette",tabId:"visualization",tabResource:"tabName_visualization"},optimizeSize:{sectionId:"chart",sectionResource:"sectionName_chart",tabId:"visualization",tabResource:"tabName_visualization"},"border.width":{sectionId:"chart",sectionResource:"sectionName_chart",tabId:"visualization",tabResource:"tabName_visualization"},"border.color":{sectionId:"chart",sectionResource:"sectionName_chart",tabId:"visualization",tabResource:"tabName_visualization"},"widget.legend.color":{sectionId:"legend",sectionResource:"sectionName_legend",tabId:"visualization",tabResource:"tabName_visualization"},"widget.legend.font":{sectionId:"legend",sectionResource:"sectionName_legend",tabId:"visualization",tabResource:"tabName_visualization"},"widget.legend.titleColor":{sectionId:"legend",sectionResource:"sectionName_legend",tabId:"visualization",tabResource:"tabName_visualization"},"itemAxis.labels.visible":{sectionId:"axis",sectionResource:"sectionName_axis",tabId:"visualization",tabResource:"tabName_visualization"},"valueAxis.labels.visible":{sectionId:"axis",sectionResource:"sectionName_axis",tabId:"visualization",tabResource:"tabName_visualization"},"valueAxis.zeroOrigin":{sectionId:"chart",sectionResource:"sectionName_chart",tabId:"visualization",tabResource:"tabName_visualization"},transpose:{sectionId:"chart",sectionResource:"sectionName_chart",tabId:"visualization",tabResource:"tabName_visualization"},"area.interpolate":{sectionId:"chart",sectionResource:"sectionName_chart",tabId:"visualization",tabResource:"tabName_visualization"},"data.handling":{sectionId:"chart",sectionResource:"sectionName_chart",tabId:"visualization",tabResource:"tabName_visualization"},"contrast.axes.color":{sectionId:"chart",sectionResource:"sectionName_chart",tabId:"visualization",tabResource:"tabName_visualization"},"contrast.text.color":{sectionId:"chart",sectionResource:"sectionName_chart",tabId:"visualization",tabResource:"tabName_visualization"},"axis.title.visible":{sectionId:"axis",sectionResource:"sectionName_axis",tabId:"visualization",tabResource:"tabName_visualization"},"axis.indicators.visible":{sectionId:"axis",sectionResource:"sectionName_axis",tabId:"visualization",tabResource:"tabName_visualization"},"axis.labels.visible":{sectionId:"axis",sectionResource:"sectionName_axis",tabId:"visualization",tabResource:"tabName_visualization"},"target.title.visible":{sectionId:"chart",sectionResource:"sectionName_chart",tabId:"visualization",tabResource:"tabName_visualization"},"target.title.color":{sectionId:"chart",sectionResource:"sectionName_chart",tabId:"visualization",tabResource:"tabName_visualization"},"target.marker.color":{sectionId:"chart",sectionResource:"sectionName_chart",tabId:"visualization",tabResource:"tabName_visualization"},"target.marker.thickness":{sectionId:"chart",sectionResource:"sectionName_chart",tabId:"visualization",tabResource:"tabName_visualization"},"axis.label.color":{sectionId:"axis",sectionResource:"sectionName_axis",tabId:"visualization",tabResource:"tabName_visualization"},"axis.title.color":{sectionId:"axis",sectionResource:"sectionName_axis",tabId:"visualization",tabResource:"tabName_visualization"},targetVisibility:{sectionId:"chart",sectionResource:"sectionName_chart",tabId:"visualization",tabResource:"tabName_visualization"},"effect.duration":{sectionId:"chart",sectionResource:"sectionName_chart",tabId:"visualization",tabResource:"tabName_visualization"},tableAreaBackground:{sectionId:"colorPalette",sectionResource:"sectionName_colorPalette",tabId:"visualization",tabResource:"tabName_visualization"},tableContentBackground:{sectionId:"colorPalette",sectionResource:"sectionName_colorPalette",tabId:"visualization",tabResource:"tabName_visualization"},contrastText:{sectionId:"chart",sectionResource:"sectionName_chart",tabId:"visualization",tabResource:"tabName_visualization"},showMinimap:{sectionId:"chart",sectionResource:"sectionName_chart",tabId:"visualization",tabResource:"tabName_visualization"},actions:{sectionId:"chart",sectionResource:"sectionName_chart",tabId:"visualization",tabResource:"tabName_visualization"},showInsights:{sectionId:"chart",sectionResource:"sectionName_chart",tabId:"visualization",tabResource:"tabName_visualization"},treeMode:{sectionId:"chart",sectionResource:"sectionName_chart",tabId:"visualization",tabResource:"tabName_visualization"},topBottomN:{sectionId:"chart",sectionResource:"sectionName_chart",tabId:"visualization",tabResource:"tabName_visualization"},topBottomTargetValue:{sectionId:"chart",sectionResource:"sectionName_chart",tabId:"visualization",tabResource:"tabName_visualization"},"leaf.labels.visible":{sectionId:"chart",sectionResource:"sectionName_chart",tabId:"visualization",tabResource:"tabName_visualization"},"contrast.label.color":{sectionId:"chart",sectionResource:"sectionName_chart",tabId:"visualization",tabResource:"tabName_visualization"},"label.shadow":{sectionId:"chart",sectionResource:"sectionName_chart",tabId:"visualization",tabResource:"tabName_visualization"},donutRadius:{sectionId:"chart",sectionResource:"sectionName_chart",tabId:"visualization",tabResource:"tabName_visualization"},"label.percentage":{sectionId:"chart",sectionResource:"sectionName_chart",tabId:"visualization",tabResource:"tabName_visualization"},"labels.visible":{sectionId:"chart",sectionResource:"sectionName_chart",tabId:"visualization",tabResource:"tabName_visualization"},labelLocation:{sectionId:"chart",sectionResource:"sectionName_chart",tabId:"visualization",tabResource:"tabName_visualization"},sort:{sectionId:"chart",sectionResource:"sectionName_chart",tabId:"visualization",tabResource:"tabName_visualization"},dataHandling:{sectionId:"chart",sectionResource:"sectionName_chart",tabId:"visualization",tabResource:"tabName_visualization"},symbolShape:{sectionId:"chart",sectionResource:"sectionName_chart",tabId:"visualization",tabResource:"tabName_visualization"},"stacked.percent":{sectionId:"chart",sectionResource:"sectionName_chart",tabId:"visualization",tabResource:"tabName_visualization"},"gridlines.visible":{sectionId:"chart",sectionResource:"sectionName_chart",tabId:"visualization",tabResource:"tabName_visualization"},"column.border.width":{sectionId:"chart",sectionResource:"sectionName_chart",tabId:"visualization",tabResource:"tabName_visualization"},"column.border.color":{sectionId:"chart",sectionResource:"sectionName_chart",tabId:"visualization",tabResource:"tabName_visualization"},"valueLabels.visible":{sectionId:"chart",sectionResource:"sectionName_chart",tabId:"visualization",tabResource:"tabName_visualization"},"column.valueLabels.visible":{sectionId:"chart",sectionResource:"sectionName_chart",tabId:"visualization",tabResource:"tabName_visualization"},"column.valueLabels.location":{sectionId:"chart",sectionResource:"sectionName_chart",tabId:"visualization",tabResource:"tabName_visualization"},"column.valueLabels.orientation":{sectionId:"chart",sectionResource:"sectionName_chart",tabId:"visualization",tabResource:"tabName_visualization"},"lineWithPoints.valueLabels.visible":{sectionId:"chart",sectionResource:"sectionName_chart",tabId:"visualization",tabResource:"tabName_visualization"},"color.min":{sectionId:"colorPalette",sectionResource:"sectionName_colorPalette",tabId:"visualization",tabResource:"tabName_visualization"},"color.mid":{sectionId:"colorPalette",sectionResource:"sectionName_colorPalette",tabId:"visualization",tabResource:"tabName_visualization"},"color.max":{sectionId:"colorPalette",sectionResource:"sectionName_colorPalette",tabId:"visualization",tabResource:"tabName_visualization"},"labels.format":{sectionId:"chart",sectionResource:"sectionName_chart",tabId:"visualization",tabResource:"tabName_visualization"},"valueLabels.location":{sectionId:"chart",sectionResource:"sectionName_chart",tabId:"visualization",tabResource:"tabName_visualization"},"valueLabels.orientation":{sectionId:"chart",sectionResource:"sectionName_chart",tabId:"visualization",tabResource:"tabName_visualization"},"itemAxis.labels.vertical":{sectionId:"chart",sectionResource:"sectionName_chart",tabId:"visualization",tabResource:"tabName_visualization"},"lines.visible":{sectionId:"chart",sectionResource:"sectionName_chart",tabId:"visualization",tabResource:"tabName_visualization"},"markers.visible":{sectionId:"chart",sectionResource:"sectionName_chart",tabId:"visualization",tabResource:"tabName_visualization"},"lineWithPoints.interpolate":{sectionId:"chart",sectionResource:"sectionName_chart",tabId:"visualization",tabResource:"tabName_visualization"},"lineWithPoints.symbol":{sectionId:"chart",sectionResource:"sectionName_chart",tabId:"visualization",tabResource:"tabName_visualization"},"valueLabels.format":{sectionId:"chart",sectionResource:"sectionName_chart",tabId:"visualization",tabResource:"tabName_visualization"},"line.interpolate":{sectionId:"chart",sectionResource:"sectionName_chart",tabId:"visualization",tabResource:"tabName_visualization"},"effect.entry.line.type":{sectionId:"chart",sectionResource:"sectionName_chart",tabId:"visualization",tabResource:"tabName_visualization"},"effect.entry.line.delay":{sectionId:"chart",sectionResource:"sectionName_chart",tabId:"visualization",tabResource:"tabName_visualization"},"effect.entry.line.stagger":{sectionId:"chart",sectionResource:"sectionName_chart",tabId:"visualization",tabResource:"tabName_visualization"},"effect.entry.line.duration":{sectionId:"chart",sectionResource:"sectionName_chart",tabId:"visualization",tabResource:"tabName_visualization"},"word.orientation":{sectionId:"chart",sectionResource:"sectionName_chart",tabId:"visualization",tabResource:"tabName_visualization"},"valueLabels.color":{sectionId:"chart",sectionResource:"sectionName_chart",tabId:"visualization",tabResource:"tabName_visualization"},"valueLabels.size":{sectionId:"chart",sectionResource:"sectionName_chart",tabId:"visualization",tabResource:"tabName_visualization"},"dial.roundedEnds":{sectionId:"chart",sectionResource:"sectionName_chart",tabId:"visualization",tabResource:"tabName_visualization"},"dial.maxValue":{sectionId:"chart",sectionResource:"sectionName_chart",tabId:"visualization",tabResource:"tabName_visualization"},"dial.propotionalwidths":{sectionId:"chart",sectionResource:"sectionName_chart",tabId:"visualization",tabResource:"tabName_visualization"},"dial.showAsPercentage":{sectionId:"chart",sectionResource:"sectionName_chart",tabId:"visualization",tabResource:"tabName_visualization"},"bar.padding":{sectionId:"chart",sectionResource:"sectionName_chart",tabId:"visualization",tabResource:"tabName_visualization"},"bar.direction.vertical":{sectionId:"chart",sectionResource:"sectionName_chart",tabId:"visualization",tabResource:"tabName_visualization"},stacked:{sectionId:"chart",sectionResource:"sectionName_chart",tabId:"visualization",tabResource:"tabName_visualization"},"effect.entry.bar.type":{sectionId:"chart",sectionResource:"sectionName_chart",tabId:"visualization",tabResource:"tabName_visualization"},"effect.entry.bar.delay":{sectionId:"chart",sectionResource:"sectionName_chart",tabId:"visualization",tabResource:"tabName_visualization"},"effect.entry.bar.stagger":{sectionId:"chart",sectionResource:"sectionName_chart",tabId:"visualization",tabResource:"tabName_visualization"},"effect.entry.bar.duration":{sectionId:"chart",sectionResource:"sectionName_chart",tabId:"visualization",tabResource:"tabName_visualization"},"lines.smooth":{sectionId:"chart",sectionResource:"sectionName_chart",tabId:"visualization",tabResource:"tabName_visualization"},"valueAxis.column.title":{sectionId:"axis.valueAxisTitle",sectionResource:"sectionName_axis",tabId:"visualization",tabResource:"tabName_visualization"},"valueAxis.column.title.color":{sectionId:"axis.valueAxisTitle",sectionResource:"sectionName_axis",tabId:"visualization",tabResource:"tabName_visualization"},"valueAxis.column.title.font":{sectionId:"axis.valueAxisTitle",sectionResource:"sectionName_axis",tabId:"visualization",tabResource:"tabName_visualization"},"valueAxis.gridLines.visible":{sectionId:"chart",sectionResource:"sectionName_chart",tabId:"visualization",tabResource:"tabName_visualization"},"valueAxis.line.title":{sectionId:"axis.valueAxisTitle",sectionResource:"sectionName_axis",tabId:"visualization",tabResource:"tabName_visualization"},"valueAxis.line.title.color":{sectionId:"axis.valueAxisTitle",sectionResource:"sectionName_axis",tabId:"visualization",tabResource:"tabName_visualization"},"valueAxis.line.title.font":{sectionId:"axis.valueAxisTitle",sectionResource:"sectionName_axis",tabId:"visualization",tabResource:"tabName_visualization"},"valueAxis.column.ticks.labels.visible":{sectionId:"axis.valueAxisLabel",sectionResource:"sectionName_axis",tabId:"visualization",tabResource:"tabName_visualization"},"valueAxis.column.ticks.visible":{sectionId:"axis.valueAxisLabel",sectionResource:"sectionName_axis",tabId:"visualization",tabResource:"tabName_visualization"},"valueAxis.line.ticks.labels.visible":{sectionId:"axis.valueAxisLabel",sectionResource:"sectionName_axis",tabId:"visualization",tabResource:"tabName_visualization"},"valueAxis.line.ticks.visible":{sectionId:"axis.valueAxisLabel",sectionResource:"sectionName_axis",tabId:"visualization",tabResource:"tabName_visualization"},"valueAxis.column.ticks.labels.font":{sectionId:"axis.valueAxisLabel",sectionResource:"sectionName_axis",tabId:"visualization",tabResource:"tabName_visualization"},"valueAxis.column.ticks.labels.color":{sectionId:"axis.valueAxisLabel",sectionResource:"sectionName_axis",tabId:"visualization",tabResource:"tabName_visualization"},"valueAxis.line.ticks.labels.font":{sectionId:"axis.valueAxisLabel",sectionResource:"sectionName_axis",tabId:"visualization",tabResource:"tabName_visualization"},"valueAxis.line.ticks.labels.color":{sectionId:"axis.valueAxisLabel",sectionResource:"sectionName_axis",tabId:"visualization",tabResource:"tabName_visualization"},sortX:{sectionId:"chart",sectionResource:"sectionName_chart",tabId:"visualization",tabResource:"tabName_visualization"},useSingleAxis:{sectionId:"chart",sectionResource:"sectionName_chart",tabId:"visualization",tabResource:"tabName_visualization"},syncAxes:{sectionId:"chart",sectionResource:"sectionName_chart",tabId:"visualization",tabResource:"tabName_visualization"},"lineWithPoints.display":{sectionId:"chart",sectionResource:"sectionName_chart",tabId:"visualization",tabResource:"tabName_visualization"},swapLineColumn:{sectionId:"chart",sectionResource:"sectionName_chart",tabId:"visualization",tabResource:"tabName_visualization"},"network.links.color":{sectionId:"colorPalette",sectionResource:"sectionName_colorPalette",tabId:"visualization",tabResource:"tabName_visualization"},"totalColumn.positive.color":{sectionId:"colorPalette",sectionResource:"sectionName_colorPalette",tabId:"visualization",tabResource:"tabName_visualization"},"totalColumn.negative.color":{sectionId:"colorPalette",sectionResource:"sectionName_colorPalette",tabId:"visualization",tabResource:"tabName_visualization"},"firstColumn.positive.color":{sectionId:"colorPalette",sectionResource:"sectionName_colorPalette",tabId:"visualization",tabResource:"tabName_visualization"},"firstColumn.negative.color":{sectionId:"colorPalette",sectionResource:"sectionName_colorPalette",tabId:"visualization",tabResource:"tabName_visualization"},"column.positive.color":{sectionId:"colorPalette",sectionResource:"sectionName_colorPalette",tabId:"visualization",tabResource:"tabName_visualization"},"column.negative.color":{sectionId:"colorPalette",sectionResource:"sectionName_colorPalette",tabId:"visualization",tabResource:"tabName_visualization"},"totalColumn.legend.label.positive":{sectionId:"chart",sectionResource:"sectionName_legend",tabId:"visualization",tabResource:"tabName_visualization"},"totalColumn.legend.label.negative":{sectionId:"chart",sectionResource:"sectionName_legend",tabId:"visualization",tabResource:"tabName_visualization"},"firstColumn.positive.label":{sectionId:"chart",sectionResource:"sectionName_legend",tabId:"visualization",tabResource:"tabName_visualization"},"firstColumn.negative.label":{sectionId:"chart",sectionResource:"sectionName_legend",tabId:"visualization",tabResource:"tabName_visualization"},"value.positive.label":{sectionId:"chart",sectionResource:"sectionName_legend",tabId:"visualization",tabResource:"tabName_visualization"},"value.negative.label":{sectionId:"chart",sectionResource:"sectionName_legend",tabId:"visualization",tabResource:"tabName_visualization"},mapStyle:{sectionId:"chart",sectionResource:"sectionName_chart",tabId:"visualization",tabResource:"tabName_visualization"},autoZoom:{sectionId:"chart",sectionResource:"sectionName_chart",tabId:"visualization",tabResource:"tabName_visualization"},maxZoom:{sectionId:"chart",sectionResource:"sectionName_chart",tabId:"visualization",tabResource:"tabName_visualization"},"views.hidden":{sectionId:"chart",sectionResource:"sectionName_chart",tabId:"visualization",tabResource:"tabName_visualization"},enableLayerControl:{sectionId:"chart",sectionResource:"sectionName_chart",tabId:"visualization",tabResource:"tabName_visualization"},enableFeatureSearchControl:{sectionId:"chart",sectionResource:"sectionName_chart",tabId:"visualization",tabResource:"tabName_visualization"},"region.visible":{sectionId:"regionLayer",sectionResource:"sectionName_regionLayer",tabId:"visualization",tabResource:"tabName_visualization"},"region.transparency":{sectionId:"regionLayer",sectionResource:"sectionName_regionLayer",tabId:"visualization",tabResource:"tabName_visualization"},"region.custom.mapId":{sectionId:"regionLayer",sectionResource:"sectionName_regionLayer",tabId:"visualization",tabResource:"tabName_visualization"},"region.custom.layerName":{sectionId:"regionLayer",sectionResource:"sectionName_regionLayer",tabId:"visualization",tabResource:"tabName_visualization"},"region.custom.propertyName":{sectionId:"regionLayer",sectionResource:"sectionName_regionLayer",tabId:"visualization",tabResource:"tabName_visualization"},"locationColor.title":{sectionId:"regionLayer",sectionResource:"sectionName_regionLayer",tabId:"visualization",tabResource:"tabName_visualization"},"point.visible":{sectionId:"pointLayer",sectionResource:"sectionName_pointLayer",tabId:"visualization",tabResource:"tabName_visualization"},"point.defaultSize":{sectionId:"pointLayer",sectionResource:"sectionName_pointLayer",tabId:"visualization",tabResource:"tabName_visualization"},"point.minSize":{sectionId:"pointLayer",sectionResource:"sectionName_pointLayer",tabId:"visualization",tabResource:"tabName_visualization"},"point.maxSize":{sectionId:"pointLayer",sectionResource:"sectionName_pointLayer",tabId:"visualization",tabResource:"tabName_visualization"},"point.transparency":{sectionId:"pointLayer",sectionResource:"sectionName_pointLayer",tabId:"visualization",tabResource:"tabName_visualization"},"point.staticZeroValueSize":{sectionId:"pointLayer",sectionResource:"sectionName_pointLayer",tabId:"visualization",tabResource:"tabName_visualization"},"point.custom.mapId":{sectionId:"pointLayer",sectionResource:"sectionName_pointLayer",tabId:"visualization",tabResource:"tabName_visualization"},"point.custom.layerName":{sectionId:"pointLayer",sectionResource:"sectionName_pointLayer",tabId:"visualization",tabResource:"tabName_visualization"},"point.custom.propertyName":{sectionId:"pointLayer",sectionResource:"sectionName_pointLayer",tabId:"visualization",tabResource:"tabName_visualization"},"point.grouping.mode":{sectionId:"pointLayer",sectionResource:"sectionName_pointLayer",tabId:"visualization",tabResource:"tabName_visualization"},"point.grouping.transition":{sectionId:"pointLayer",sectionResource:"sectionName_pointLayer",tabId:"visualization",tabResource:"tabName_visualization"},"point.grouping.heat.weight":{sectionId:"pointLayer",sectionResource:"sectionName_pointLayer",tabId:"visualization",tabResource:"tabName_visualization"},"point.grouping.cluster.radius":{sectionId:"pointLayer",sectionResource:"sectionName_pointLayer",tabId:"visualization",tabResource:"tabName_visualization"},"point.grouping.cluster.groups":{sectionId:"pointLayer",sectionResource:"sectionName_pointLayer",tabId:"visualization",tabResource:"tabName_visualization"},"pointSize.title":{sectionId:"pointLayer",sectionResource:"sectionName_pointLayer",tabId:"visualization",tabResource:"tabName_visualization"},"pointColor.title":{sectionId:"pointLayer",sectionResource:"sectionName_pointLayer",tabId:"visualization",tabResource:"tabName_visualization"},"point.sizeScaling":{sectionId:"pointLayer",sectionResource:"sectionName_pointLayer",tabId:"visualization",tabResource:"tabName_visualization"},"latlongSize.title":{sectionId:"latLongLayer",sectionResource:"sectionName_latLongLayer",tabId:"visualization",tabResource:"tabName_visualization"},"latlongColor.title":{sectionId:"latLongLayer",sectionResource:"sectionName_latLongLayer",tabId:"visualization",tabResource:"tabName_visualization"},"latLong.visible":{sectionId:"latLongLayer",sectionResource:"sectionName_latLongLayer",tabId:"visualization",tabResource:"tabName_visualization"},"latLong.defaultSize":{sectionId:"latLongLayer",sectionResource:"sectionName_latLongLayer",tabId:"visualization",tabResource:"tabName_visualization"},"latLong.minSize":{sectionId:"latLongLayer",sectionResource:"sectionName_latLongLayer",tabId:"visualization",tabResource:"tabName_visualization"},"latLong.maxSize":{sectionId:"latLongLayer",sectionResource:"sectionName_latLongLayer",tabId:"visualization",tabResource:"tabName_visualization"},"latLong.transparency":{sectionId:"latLongLayer",sectionResource:"sectionName_latLongLayer",tabId:"visualization",tabResource:"tabName_visualization"},"latLong.staticZeroValueSize":{sectionId:"latLongLayer",sectionResource:"sectionName_latLongLayer",tabId:"visualization",tabResource:"tabName_visualization"},"latLong.grouping.mode":{sectionId:"latLongLayer",sectionResource:"sectionName_latLongLayer",tabId:"visualization",tabResource:"tabName_visualization"},"latLong.grouping.transition":{sectionId:"latLongLayer",sectionResource:"sectionName_latLongLayer",tabId:"visualization",tabResource:"tabName_visualization"},"latLong.grouping.heat.weight":{sectionId:"latLongLayer",sectionResource:"sectionName_latLongLayer",tabId:"visualization",tabResource:"tabName_visualization"},"latLong.grouping.cluster.radius":{sectionId:"latLongLayer",sectionResource:"sectionName_latLongLayer",tabId:"visualization",tabResource:"tabName_visualization"},"latLong.grouping.cluster.groups":{sectionId:"latLongLayer",sectionResource:"sectionName_latLongLayer",tabId:"visualization",tabResource:"tabName_visualization"},"colorPalette_data.region":{sectionId:"regionLayer",sectionResource:"sectionName_regionLayer",tabId:"visualization",tabResource:"tabName_visualization"},"colorPalette_data.point":{sectionId:"pointLayer",sectionResource:"sectionName_pointLayer",tabId:"visualization",tabResource:"tabName_visualization"},"colorPalette_data.latlong":{sectionId:"latLongLayer",sectionResource:"sectionName_latLongLayer",tabId:"visualization",tabResource:"tabName_visualization"},"contColorPalette_data.region":{sectionId:"regionLayer",sectionResource:"sectionName_regionLayer",tabId:"visualization",tabResource:"tabName_visualization"},"contColorPalette_data.point":{sectionId:"pointLayer",sectionResource:"sectionName_pointLayer",tabId:"visualization",tabResource:"tabName_visualization"},"contColorPalette_data.latlong":{sectionId:"latLongLayer",sectionResource:"sectionName_latLongLayer",tabId:"visualization",tabResource:"tabName_visualization"},"Mapbox.secretToken":{sectionId:"regionLayer",sectionResource:"sectionName_regionLayer",tabId:"visualization",tabResource:"tabName_visualization"},"Mapbox.accountName":{sectionId:"regionLayer",sectionResource:"sectionName_regionLayer",tabId:"visualization",tabResource:"tabName_visualization"},"Mapbox.token":{sectionId:"regionLayer",sectionResource:"sectionName_regionLayer",tabId:"visualization",tabResource:"tabName_visualization"}},n={itemAxisTitle:{active:!0,collapsible:!1,id:"itemAxisTitle",label:t.get("sectionItemAxisTitle"),type:"Section",position:20},itemAxisLabel:{active:!0,collapsible:!1,id:"itemAxisLabel",label:t.get("sectionItemAxisLabel"),type:"Section",position:21},valueAxisTitle:{active:!0,collapsible:!1,id:"valueAxisTitle",label:t.get("sectionValueAxisTitle"),type:"Section",position:22},valueAxisLabel:{active:!0,collapsible:!1,id:"valueAxisLabel",label:t.get("sectionValueAxisLabel"),type:"Section",position:23}},{getInstance:function(){return i||(i={getSectionInformationForPropertyId:function(i){var n=void 0;return o&&o[i]?((n=o[i]).tabId=n.tabId,n.tabName=t.get(n.tabResource),n.sectionId=n.sectionId,n.sectionName=t.get(n.sectionResource),n.sectionPosition=a[n.sectionId.split(".")[0]],e.omit(n,"tabResource","sectionResource")):((n={}).tabId="visualization",n.tabName=t.get("tabName_visualization"),n.sectionId="chart",n.sectionName=t.get("sectionName_chart"),n.sectionPosition=a[n.sectionId.split(".")[0]],n)},getSection:function(e){return n[e]}}),i}}})),define("dashboard-analytics/util/FontFamilyOptions",["../widgets/livewidget/nls/StringResources"],(function(e){return[{value:"Anton",label:"Anton",cssClass:"rt_fontFamilyAnton"},{value:"CherryCreamSoda",label:"Cherry Cream Soda",cssClass:"rt_fontFamilyCherryCreamSoda"},{value:"Condiment-Regular",label:"Condiment",cssClass:"rt_fontFamilyCondiment-Regular"},{value:"DidactGothic",label:"Didact Gothic",cssClass:"rt_fontFamilyDidactGothic"},{value:"EuphoriaScript-Regular",label:"Euphoria Script",cssClass:"rt_fontFamilyEuphoriaScript-Regular"},{value:"Helvetica Neue for IBM",label:"Helvetica Neue",cssClass:"rt_fontFamilyHelvNeueforIBM-Regular",subCssClasses:[{value:"light",label:e.get("textFontFamilySubClassLight"),cssClass:"rt_fontFamilyHelvNeueforIBM-Light"},{value:"lightitalic",label:e.get("textFontFamilySubClassLightItalic"),cssClass:"rt_fontFamilyHelvNeueforIBM-LightItalic"},{value:"regular",label:e.get("textFontFamilySubClassRegular"),cssClass:"rt_fontFamilyHelvNeueforIBM-Regular"},{value:"italic",label:e.get("textFontFamilySubClassItalic"),cssClass:"rt_fontFamilyHelvNeueforIBM-Italic"},{value:"medium",label:e.get("textFontFamilySubClassMedium"),cssClass:"rt_fontFamilyHelvNeueforIBM-Medium"},{value:"mediumitalic",label:e.get("textFontFamilySubClassMediumItalic"),cssClass:"rt_fontFamilyHelvNeueforIBM-MediumItalic"},{value:"bold",label:e.get("textFontFamilySubClassBold"),cssClass:"rt_fontFamilyHelvNeueforIBM-Bold"},{value:"bolditalic",label:e.get("textFontFamilySubClassBoldItalic"),cssClass:"rt_fontFamilyHelvNeueforIBM-BoldItalic"}]},{value:"KaushanScript-Regular",label:"Kaushan Script",cssClass:"rt_fontFamilyKaushanScript-Regular"},{value:"Lobster",label:"Lobster",cssClass:"rt_fontFamilyLobster"},{value:"Merriweather-Regular",label:"Merriweather",cssClass:"rt_fontFamilyMerriweather-Regular",subCssClasses:[{value:"italic",label:e.get("textFontFamilySubClassItalic"),cssClass:"rt_fontFamilyMerriweather-Italic"},{value:"light",label:e.get("textFontFamilySubClassLight"),cssClass:"rt_fontFamilyMerriweather-Light"},{value:"regular",label:e.get("textFontFamilySubClassRegular"),cssClass:"rt_fontFamilyMerriweather-Regular"},{value:"bold",label:e.get("textFontFamilySubClassBold"),cssClass:"rt_fontFamilyMerriweather-Bold"},{value:"bolditalic",label:e.get("textFontFamilySubClassBoldItalic"),cssClass:"rt_fontFamilyMerriweather-BoldItalic"},{value:"black",label:e.get("textFontFamilySubClassBlack"),cssClass:"rt_fontFamilyMerriweather-Black"},{value:"lightitalic",label:e.get("textFontFamilySubClassLightItalic"),cssClass:"rt_fontFamilyMerriweather-LightItalic"},{value:"heavyitalic",label:e.get("textFontFamilySubClassHeavyItalic"),cssClass:"rt_fontFamilyMerriweather-HeavyItalic"}]},{value:"MerriweatherSans-Regular",label:"Merriweather Sans",cssClass:"rt_fontFamilyMerriweatherSans-Regular",subCssClasses:[{value:"italic",label:e.get("textFontFamilySubClassItalic"),cssClass:"rt_fontFamilyMerriweatherSans-Italic"},{value:"light",label:e.get("textFontFamilySubClassLight"),cssClass:"rt_fontFamilyMerriweatherSans-Light"},{value:"lightitalic",label:e.get("textFontFamilySubClassLightItalic"),cssClass:"rt_fontFamilyMerriweatherSans-LightItalic"},{value:"regular",label:e.get("textFontFamilySubClassRegular"),cssClass:"rt_fontFamilyMerriweatherSans-Regular"},{value:"bold",label:e.get("textFontFamilySubClassBold"),cssClass:"rt_fontFamilyMerriweatherSans-Bold"},{value:"bolditalic",label:e.get("textFontFamilySubClassBoldItalic"),cssClass:"rt_fontFamilyMerriweatherSans-BoldItalic"},{value:"extrabold",label:e.get("textFontFamilySubClassExtraBold"),cssClass:"rt_fontFamilyMerriweatherSans-ExtraBold"},{value:"extrabolditalic",label:e.get("textFontFamilySubClassExtraBoldItalic"),cssClass:"rt_fontFamilyMerriweatherSans-ExtraBoldItalic"}]},{value:"Monoton-Regular",label:"Monoton",cssClass:"rt_fontFamilyMonoton-Regular"},{value:"Montserrat-Regular",label:"Montserrat",cssClass:"rt_fontFamilyMontserrat-Regular",subCssClasses:[{value:"hairline",label:e.get("textFontFamilySubClassHairline"),cssClass:"rt_fontFamilyMontserrat-Hairline"},{value:"light",label:e.get("textFontFamilySubClassLight"),cssClass:"rt_fontFamilyMontserrat-Light"},{value:"regular",label:e.get("textFontFamilySubClassRegular"),cssClass:"rt_fontFamilyMontserrat-Regular"},{value:"bold",label:e.get("textFontFamilySubClassBold"),cssClass:"rt_fontFamilyMontserrat-Bold"},{value:"black",label:e.get("textFontFamilySubClassBlack"),cssClass:"rt_fontFamilyMontserrat-Black"}]},{value:"OpenSansCondensed-Light",label:"Open Sans Condensed",cssClass:"rt_fontFamilyOpenSansCondensed-Light",subCssClasses:[{value:"light",label:e.get("textFontFamilySubClassLight"),cssClass:"rt_fontFamilyOpenSansCondensed-Light"},{value:"lightitalic",label:e.get("textFontFamilySubClassLightItalic"),cssClass:"rt_fontFamilyOpenSansCondensed-LightItalic"},{value:"bold",label:e.get("textFontFamilySubClassBold"),cssClass:"rt_fontFamilyOpenSansCondensed-Bold"}]},{value:"Oswald-Regular",label:"Oswald",cssClass:"rt_fontFamilyOswald-Regular",subCssClasses:[{value:"extralight",label:e.get("textFontFamilySubClassExtraLight"),cssClass:"rt_fontFamilyOswald-ExtraLight"},{value:"extralightitalic",label:e.get("textFontFamilySubClassExtraLightItalic"),cssClass:"rt_fontFamilyOswald-ExtraLightItalic"},{value:"light",label:e.get("textFontFamilySubClassLight"),cssClass:"rt_fontFamilyOswald-Light"},{value:"lightitalic",label:e.get("textFontFamilySubClassLightItalic"),cssClass:"rt_fontFamilyOswald-LightItalic"},{value:"regular",label:e.get("textFontFamilySubClassRegular"),cssClass:"rt_fontFamilyOswald-Regular"},{value:"regularitalic",label:e.get("textFontFamilySubClassRegularItalic"),cssClass:"rt_fontFamilyOswald-RegularItalic"},{value:"medium",label:e.get("textFontFamilySubClassMedium"),cssClass:"rt_fontFamilyOswald-Medium"},{value:"mediumitalic",label:e.get("textFontFamilySubClassMediumItalic"),cssClass:"rt_fontFamilyOswald-MediumItalic"},{value:"demibold",label:e.get("textFontFamilySubClassDemiBold"),cssClass:"rt_fontFamilyOswald-DemiBold"},{value:"demibolditalic",label:e.get("textFontFamilySubClassDemiBoldItalic"),cssClass:"rt_fontFamilyOswald-DemiBoldItalic"},{value:"bold",label:e.get("textFontFamilySubClassBold"),cssClass:"rt_fontFamilyOswald-Bold"},{value:"bolditalic",label:e.get("textFontFamilySubClassBoldItalic"),cssClass:"rt_fontFamilyOswald-BoldItalic"},{value:"heavy",label:e.get("textFontFamilySubClassHeavy"),cssClass:"rt_fontFamilyOswald-Heavy"},{value:"heavyitalic",label:e.get("textFontFamilySubClassHeavyItalic"),cssClass:"rt_fontFamilyOswald-HeavyItalic"},{value:"stencil",label:e.get("textFontFamilySubClassStencil"),cssClass:"rt_fontFamilyOswald-Stencil"}]},{value:"Playball",label:"Playball",cssClass:"rt_fontFamilyPlayball"},{value:"Plex-Regular",label:"IBM Plex",cssClass:"rt_fontFamilyPlex-Regular",subCssClasses:[{value:"thin",label:e.get("textFontFamilySubClassThin"),cssClass:"rt_fontFamilyPlex-Thin"},{value:"thinitalic",label:e.get("textFontFamilySubClassThinItalic"),cssClass:"rt_fontFamilyPlex-ThinItalic"},{value:"light",label:e.get("textFontFamilySubClassLight"),cssClass:"rt_fontFamilyPlex-Light"},{value:"lightitalic",label:e.get("textFontFamilySubClassLightItalic"),cssClass:"rt_fontFamilyPlex-LightItalic"},{value:"regular",label:e.get("textFontFamilySubClassRegular"),cssClass:"rt_fontFamilyPlex-Regular"},{value:"italic",label:e.get("textFontFamilySubClassItalic"),cssClass:"rt_fontFamilyPlex-Italic"},{value:"medium",label:e.get("textFontFamilySubClassMedium"),cssClass:"rt_fontFamilyPlex-Medium"},{value:"mediumitalic",label:e.get("textFontFamilySubClassMediumItalic"),cssClass:"rt_fontFamilyPlex-MediumItalic"},{value:"bold",label:e.get("textFontFamilySubClassBold"),cssClass:"rt_fontFamilyPlex-Bold"},{value:"bolditalic",label:e.get("textFontFamilySubClassBoldItalic"),cssClass:"rt_fontFamilyPlex-BoldItalic"}]},{value:"Roboto-Regular",label:"Roboto",cssClass:"rt_fontFamilyRoboto-Regular",subCssClasses:[{value:"thin",label:e.get("textFontFamilySubClassThin"),cssClass:"rt_fontFamilyRoboto-Thin"},{value:"thinitalic",label:e.get("textFontFamilySubClassThinItalic"),cssClass:"rt_fontFamilyRoboto-ThinItalic"},{value:"light",label:e.get("textFontFamilySubClassLight"),cssClass:"rt_fontFamilyRoboto-Light"},{value:"lightitalic",label:e.get("textFontFamilySubClassLightItalic"),cssClass:"rt_fontFamilyRoboto-LightItalic"},{value:"regular",label:e.get("textFontFamilySubClassRegular"),cssClass:"rt_fontFamilyRoboto-Regular"},{value:"italic",label:e.get("textFontFamilySubClassItalic"),cssClass:"rt_fontFamilyRoboto-Italic"},{value:"medium",label:e.get("textFontFamilySubClassMedium"),cssClass:"rt_fontFamilyRoboto-Medium"},{value:"mediumitalic",label:e.get("textFontFamilySubClassMediumItalic"),cssClass:"rt_fontFamilyRoboto-MediumItalic"},{value:"bold",label:e.get("textFontFamilySubClassBold"),cssClass:"rt_fontFamilyRoboto-Bold"},{value:"bolditalic",label:e.get("textFontFamilySubClassBoldItalic"),cssClass:"rt_fontFamilyRoboto-BoldItalic"},{value:"black",label:e.get("textFontFamilySubClassBlack"),cssClass:"rt_fontFamilyRoboto-Black"},{value:"blackitalic",label:e.get("textFontFamilySubClassBlackItalic"),cssClass:"rt_fontFamilyRoboto-BlackItalic"}]},{value:"SortsMillGoudy-Regular",label:"Sorts Mill Goudy",cssClass:"rt_fontFamilySortsMillGoudy-Regular",subCssClasses:[{value:"regular",label:e.get("textFontFamilySubClassRegular"),cssClass:"rt_fontFamilySortsMillGoudy-Regular"},{value:"italic",label:e.get("textFontFamilySubClassItalic"),cssClass:"rt_fontFamilySortsMillGoudy-Italic"}]},{value:"SpecialElite",label:"Special Elite",cssClass:"rt_fontFamilySpecialElite"}]})),define("dashboard-analytics/visualizations/vipr/properties/VIPRProperties",["underscore","jquery","../../../widgets/livewidget/nls/StringResources","../VIPRUtils","./VIPRPropertiesOrderer","com/ibm/vipr/VIPR","../VIPRConfig","dashboard-analytics/visualizations/properties/PropertiesCreator","dashboard-analytics/visualizations/vipr/properties/ColorPropertiesCreator","dashboard-analytics/visualizations/properties/PropertySectioner","dashboard-analytics/util/FontFamilyOptions","./PropertiesHelper","../../../apiHelpers/SlotAPIHelper"],(function(e,t,i,a,o,n,s,r,l,c,u,d,h){"use strict";var p,g=["widget.legend.font","itemAxis.title.font","itemAxis.ticks.labels.font","valueAxis.title.font","valueAxis.ticks.labels.font","valueAxis.column.ticks.labels.font","valueAxis.column.title.font","valueAxis.line.title.font"],v=["widget.legend.color","valueAxis.column.ticks.labels.color","valueAxis.column.ticks.labels.font"],m=[],f=[];return p=null,{getInstance:function(){return p||(p={_getConfiguration:function(e){return s.getConfig(e)||{}},_orderProperties:function(e){o.getInstance().orderProperties(e)},_filterToActiveProperties:function(t){return e.filter(t,(function(e){return!0===e.active}))},_moveLayersProperties:function(e,t){var i=p._getConfiguration(e);i&&i.supportsLayers&&i.layerDescriptions.forEach((function(e){var i=t[e.id];i&&e.visibleLayerProps.forEach((function(e){var a=t[e];a&&(i.items.push(a),delete t[e])}))}))},_addColorRelatedProperties:function(e,t,i,a){l.getInstance().addColorRelatedProperties(e,t,i,a)},_getPropertyDescriptionForProperty:function(e,t){var i=null;return"boolean"===e.type?i=t.createCheckboxProperty(e):"enum"===e.type?i=t.createEnumProperty(e):"string"===e.type?i=t.createTextInputProperty(e):"number"===e.type||"length"===e.type?i=t.createNumberProperty(e):"font"===e.type?i=t.createFontSizeProperty(e):"color"===e.type&&(i=l.getInstance().createColorProperty(e)),i},_doesConfigSupportProp:function(e,t,i){return a.doesConfigPropertyMatchExpected(e,t,i)},_addMaintainAxisScalePropIfNeeded:function(e,t,i){p._doesConfigSupportProp(e,"supportsMaintainAxisScale",!0)&&(i.maintainAxisScales=t.getMaintainAxisScaleProperty())},_addDonutRadiusIfNeeded:function(e,t,i){var a=e.get("donutRadius");a&&(i.donutRadius=t.getDonutRadius(a))},_addAggTypeIfNeeded:function(t,a){var o={id:"widget.legend.aggregateTypeVisible",type:"ToggleButton",propertyType:"CheckBox",label:i.get("aggregateTypeToggler"),ariaLabel:i.get("aggregateTypeToggler"),public:!0,name:"widget.legend.aggregateTypeVisible",displayPos:38,checked:!1,defaultValue:!1,active:e.some(a,(function(e){return!0===h.isMultiMeasuresValueSlot(e)}))&&t["widget.legend.titleVisible"].active};t["widget.legend.aggregateTypeVisible"]=o},_addColorSetProperty:function(t,o,n,s,r){var l=a.isPropertyIncluded(r,n)?t.get(n):void 0,c=s.properties[n],u=this._isCustomVis(r);l&&(o[n]=e.extend({showHexValue:!0,paletteType:"DashboardColorSet",id:n,label:u&&c.caption?c.caption:c.caption?i.get(c.caption):l.caption,type:"ColorPicker",open:!1,originalGroupName:u&&this._hasVisPropertyValue(n,"originalGroupName",o)?o[n].originalGroupName:null,groupName:u&&this._hasVisPropertyValue(n,"groupName",o)?o[n].groupName:null,groupCaption:u&&this._hasVisPropertyValue(n,"groupCaption",o)?o[n].groupCaption:null,sectionName:i.get("sectionName_colorPalette"),tabName:i.get("tabName_visualization"),ariaLabel:u?this._hasVisPropertyValue(n,"name",o):c.caption?i.get(c.caption):s.caption,public:void 0===l.public||l.public,active:void 0===l.active||l.active},e.pick(s.properties[n],"addButton","displayPos")))},_hasVisPropertyValue:function(e,t,i){return i[e]&&i[e][t]},isTargetThicknessInputValid:function(e){var t=e&&e.endsWith&&e.endsWith("px")?Number(e.slice(0,-2)):Number(e);return Number.isInteger(t)&&t>=2&&t<=20},_addTargetMarkerThicknessIfNeeded:function(e,t,o,n){var s=a.isPropertyIncluded(n,"target.marker.thickness")?e.get("target.marker.thickness"):void 0;if(s){var r=t.createNumberProperty(s);r.handleReturnKey=!0,r.placeHolderText=i.get("targetThicknessPlaceHolder",{min:2,max:20}),r.showInlineError=!0,r.customValidatorCallback=function(e){return{isValid:p.isTargetThicknessInputValid(e),message:i.get("targetThicknessErrorMsg",{min:2,max:20})}},o["target.marker.thickness"]=r}},_addPropsFromVIPR:function(e,t,i,a){var o=this,n=p._getConfiguration(a);n.config&&n.config.include.forEach((function(n){o._addPropertyFromVIPR(e,n,t,i,a)}))},_addCustomVisPropsFromVIPR:function(t,i,a,o){var n=this;m=[],f=[];var s=this._getGroupProperties(o);e.forEach(s,(function(e,s){e.forEach((function(e){n._addPropertyFromVIPR(t,e,i,a,o,s,!0)}))}))},_addPropertyFromVIPR:function(e,i,o,n,s,r,l){var c=e.get(i);if(c){var u=a.overrideProperty(s,c,i);if(!0!==u.hidden){var d=p._getPropertyDescriptionForProperty(u,o);if(d){if(d.name=i,d.id=i,r){var h=e.get(r).caption;d.groupName="customVis-"+t.escapeSelector(r),d.originalGroupName=r,d.groupCaption=h,l&&(e.get(r).active||(d.active=!1),this._addCustomVisAllowedGroups(d,c))}n[i]=d}}}},_addCustomVisAllowedGroups:function(e,t){"font"===e.propertyType?(-1===f.indexOf(this._getFontColorGroupName(e.id,"font"))&&f.push(this._getFontColorGroupName(e.id,"font")),m.push(e.name)):"Color"===e.propertyType&&-1===f.indexOf(this._getFontColorGroupName(e.id,"color"))&&(f.push(this._getFontColorGroupName(e.id,"color")),e.caption=t.caption)},_getFontColorGroupName:function(e,t){return e+"."+t},_isCustomVisAllowedGroups:function(e){var t=-1!==f.indexOf(this._getFontColorGroupName(e,"font")),i=-1!==f.indexOf(this._getFontColorGroupName(e,"color"));return t||i},_filterListonToActiveProperties:function(e,t){var i=this._getListenForPropChangesFromVIPRConfig(t),a=i.slice();i.forEach((function(t){if(!e.filter((function(e){return e.name===t})).length){var i=a.indexOf(t);-1!==i&&a.splice(i,1)}})),this._setListenForPropChangesForVIPRConfig(t,a)},_getPropertyListFromVIPRConfig:function(e){var t=p._getConfiguration(e);return t&&t.propertyList},_getListenForPropChangesFromVIPRConfig:function(e){var t=p._getConfiguration(e);return t&&t.listenForPropChanges},_setListenForPropChangesForVIPRConfig:function(e,t){p._getConfiguration(e).listenForPropChanges=t},_isCustomVis:function(e){var t=p._getConfiguration(e);return t&&t.isCustomVis},_getGroupProperties:function(e){var t=p._getConfiguration(e);return t&&t.groupedProperty},_addColorSetProps:function(e,t,i){var o=p._getConfiguration(i);o.config&&o.config.include.forEach((function(n){var s=e.get(n);s&&a.overrideProperty(i,s,n).colorClass&&p._addColorSetProperty(e,t,n,o,i)}))},getProperties:function(t,i,a){var o={},n=r.getInstance(),s=this._isCustomVis(a);s?p._addCustomVisPropsFromVIPR(t,n,o,a):p._addPropsFromVIPR(t,n,o,a),p._addMaintainAxisScalePropIfNeeded(a,n,o),p._addColorRelatedProperties(o,t,i,a),p._addAggTypeIfNeeded(o,i),p._addDonutRadiusIfNeeded(t,n,o),p._addTargetMarkerThicknessIfNeeded(t,n,o,a),p._addColorSetProps(t,o,a),p._moveLayersProperties(a,o),p._orderProperties(o);var l=e.toArray(o),c=p._filterToActiveProperties(l);return s&&p._filterListonToActiveProperties(l,a),p._sectionalizeProperties(c)},getPropertyList:function(t,i,a){var o=a.getFeature("Visualization").getDefinition();if(o.getState().getError())return[];var n=o.getId(),s=this.getProperties(t,i,n),r=p._getPropertyListFromVIPRConfig(n);return r&&!e.isEmpty(r)&&(s=s.concat(r)),this._toUIControlProperties(s)},getPropertyLayoutList:function(t,i,o,n){var s=this,r=o.getFeature("Visualization").getDefinition().getId(),l=this._isCustomVis(r),u=o.getFeature("Visualization").getDefinition().getProperty("groupedProperty")||{},h={},p=[],f=this.getProperties(t,i,r);return e.each(f,(function(e){h[e.tabId]={type:"Group",id:e.tabId,label:e.tabName};var t=c.getInstance();if(e.sectionId){var i=[];d.splitEscapedString(e.sectionId,".",i),i.forEach((function(i,a){var o={type:"Section",id:i,label:e.sectionName,position:e.sectionPosition};if(0!=a&&!(o=t.getSection(i)))throw new Error("section info not found");h[i]=o}))}var r=-1!==v.indexOf(e.id)||s._isCustomVisAllowedGroups(e.id),f=[];l&&r&&e.originalGroupName&&(f=u[e.originalGroupName]),-1!==g.indexOf(e.id)||-1!==m.indexOf(e.id)?p=p.concat(s._getFontPropertyLayout(e,o,a,n,l)):(l&&-1!==f.indexOf(e.id)||u[e.id])&&r&&(p=p.concat(s._getGroupedPropertyLayout(e,o,n)))})),e.values(h).concat(p)},_sectionalizeProperties:function(e){var t=c.getInstance();return e.forEach((function(e){var i=t.getSectionInformationForPropertyId(e.id);i&&(e.sectionId=e.groupName||i.sectionId||e.sectionId,e.sectionName=e.groupCaption||i.sectionName||e.sectionName,e.tabId=i.tabId||e.tabId,e.tabName=i.tabName||e.tabName,e.sectionPosition=i.sectionPosition||100)})),e},_toUIControlProperties:function(t){var i=this;return e.map(t,(function(t){var a=e.pick(t,"id");a.editor={sectionId:t.sectionId?t.tabId+"."+t.sectionId:t.tabId,uiControl:i._getPropertyUIControl(t)},e.isNumber(t.displayPos)&&(a.editor.position=t.displayPos);var o=!1===t.public,n=-1!==g.indexOf(a.id)||-1!==m.indexOf(a.id),s=-1!==v.indexOf(a.id)||i._isCustomVisAllowedGroups(a.id);return(o||n||s)&&(a.editor.hidden=!0),a}))},_getLegendFontSizeOptions:function(){return[{value:"auto",label:i.get("automaticTypeCaption")},{value:"11px",label:"11px"},{value:"14px",label:"14px"},{value:"16px",label:"16px"}]},_getNonLegendFontSizeOptions:function(){return[{value:"auto",label:i.get("automaticTypeCaption")},{value:"12px",label:"12px"},{value:"14px",label:"14px"},{value:"16px",label:"16px"},{value:"24px",label:"24px"}]},_getGroupedPropertyLayout:function(t,i,a){var o=i.getFeature("Visualization").getDefinition().getProperty("groupedProperty")||{};return[{id:t.id,editor:{position:t.displayPos,sectionId:t.sectionId?t.tabId+"."+t.sectionId:t.tabId,uiControl:this._getPropertyUIControl(e.extend(t,{onChange:function(n,s){"ColorPicker"===t.type&&(s=s.name);var r=[n];e.each(o[n],(function(e){return r.push(e)}));var l=a.getFeature("Transaction").startTransaction();r.forEach((function(e){return i.setPropertyValue(e,s,l)})),a.getFeature("Transaction").endTransaction(l)}}))}}]},_getFontPropertyLayout:function(t,a,o,n,s){var r=[].concat(u);return r.unshift({value:"auto",label:i.get("automaticTypeCaption")}),[{id:"font.xdashboardx."+t.id,editor:{position:t.displayPos,sectionId:t.sectionId?t.tabId+"."+t.sectionId:t.tabId,uiControl:this._getPropertyUIControl({name:"font.xdashboardx."+t.id,active:!0,options:r,public:!0,ariaLabel:i.get("fontPropLabel"),label:s&&t.label?t.label+" "+i.get("fontFamily"):i.get("fontPropLabel"),type:"DropDown",onChange:this._getSetFontProperty("font",t.id,a,o,n),value:o.getVidaFontPropertiesPart("family",a.getPropertyValue(t.id))||i.get("automaticTypeCaption")})}},{id:"fontSize.xdashboardx."+t.id,editor:{position:t.displayPos+1,sectionId:t.sectionId?t.tabId+"."+t.sectionId:t.tabId,uiControl:this._getPropertyUIControl(e.extend(t,{ariaLabel:i.get("fontSizePropLabel"),label:s&&t.label?t.label+" "+i.get("fontSize"):i.get("fontSizePropLabel"),options:"widget.legend.font"===t.id?this._getLegendFontSizeOptions():this._getNonLegendFontSizeOptions(),onChange:this._getSetFontProperty("fontSize",t.id,a,o,n),value:o.getVidaFontPropertiesPart("size",a.getPropertyValue(t.id))||i.get("automaticTypeCaption")}))}}]},_getSetFontProperty:function(t,i,a,o,n){return function(s,r){var l,c=a.getFeature("Visualization").getDefinition().getProperty("groupedProperty")||{};"auto"===r&&(r=null);var u=o.buildVidaFontPropertiesFromParts(((l={})[t]=r,l),a.getPropertyValue(i)),d=[i];-1!==v.indexOf(i)&&e.each(c[i],(function(e){return d.push(e)}));var h=n.getFeature("Transaction").startTransaction();d.forEach((function(e){return a.setPropertyValue(e,u,h)})),n.getFeature("Transaction").endTransaction(h)}.bind(this)},_getPropertyUIControl:function(t){return e.omit(t,"id","public","displayPos","tabId","tabName","sectionPosition","sectionId","sectionName")},setProperty:function(e,t){e.setProperty(t.id,t.value)},_initializeFredIsRedPalette:function(t,i,a){var o={defaultIndex:a||0,colors:i.colors,colorCallback:n.util.Color.rgb},s=i.toString();i.getColor=function(i,a,n){var s=[];if(void 0!==i&&void 0!==a&&void 0!==n&&n>=0){var r=i&&i.items[n];s.push(r&&r.source&&r.source.unformattedValue||"")}else s=i&&e.map(i.items,(function(e){return e.source&&e.source.unformattedValue||""}));return t.getColor(o,s,a)},i.toString=function(){return"fredIsRed("+s+")"}},setPaletteResolvers:function(e,t,i,a){var o=l.getInstance().getDataLayerIdFromPaletteAndSlots(e,i);if(e.paletteType===t.type&&(!t.dataLayerId||o===t.dataLayerId)){var s=null;if(t.colors){switch(t.type){case"cat":s=new n.util.CatPalette(t.colors,t.defaultIndex),a&&p._initializeFredIsRedPalette(a,s,t.defaultIndex);break;case"customcat":s=new n.util.CustomCatPalette(t.colors);break;case"cont":s=new n.util.ContPalette(t.colors,null);break;case"customcont":s=new n.util.CustomContPalette(t.colors,null);break;default:s=null}if(s){var r=e.getValue&&e.getValue()?e.getValue():{};r.toString()===s.toString()&&r.defaultIndex===s.defaultIndex||e.setValue(s)}}}},setSinglePaletteResolvers:function(e,t){var i=new n.util.CatPalette(t.colors),o=t.colors.length;i.ordinal=t.defaultIndex;var s=i.ordinal=o?0:l,r.setValue(i.getSingleColor(i.defaultIndex+l))}}}),p}}})),define("dashboard-analytics/visualizations/recommender/SmartsRecommenderService",["../../lib/@waca/core-client/js/core-client/ui/core/Class"],(function(e){"use strict";var t=e.extend({init:function(e){t.inherited("init",this,arguments),this.ajaxSvc=e.ajaxSvc,this.logger=e.logger},destroy:function(){this.ajaxSvc=null,this.logger=null},_executeRequest:function(e,t){var i={type:"POST",headers:{"Content-Type":"application/json"},data:JSON.stringify(e),processData:!1,url:t};return this.ajaxSvc.ajax(i).then((function(e){return Promise.resolve(e)}))}});return t})),define("dashboard-analytics/visualizations/recommender/SmartsRecommenderError",["../../widgets/livewidget/nls/StringResources"],(function(e){"use strict";var t=function(t){function i(e,a){_classCallCheck(this,i);var o=_possibleConstructorReturn(this,t.call(this,i.msg));return o.status=e,o.details=a,o}return _inherits(i,t),_createClass(i,null,[{key:"STATUS",get:function(){return{OK:0,NO_SMARTS_MODULE_SPECIFIED:1,SMARTS_MODULE_NOT_FOUND:2,SMARTS_MODULE_TIMEOUT:3,JSON_ERROR_IN_INPUT:4,UNKNOWN_CHART_TYPE:5,MISSING_REQUIRED_PARAMETERS:6,UNKNOWN_CHART_SPECIFIED:7,NO_UNBOUND_COLUMNS:8,INVALID_LEARNING_DIRECTIVE:9,INVALID_ACTION_TYPE:10,INVALID_ACTION_PAYLOAD:11,COLUMNS_NOT_FROM_SAME_OR_JOINED_DATASET:12,MISSING_ACTION:13,SMARTS_MODULE_NOT_READY:14,NO_COLUMNS:15,INVALID_BINDING:16,ERROR:100}}},{key:"msg",get:function(){return i._message||(i._message=e.get("recommendRequestFailed")),i._message}}]),i}(Error);return t._message=null,t})),define("dashboard-analytics/visualizations/recommender/SmartsVisRecommenderService",["./SmartsRecommenderService","./SmartsRecommenderError"],(function(e,t){"use strict";var i=e.extend({init:function(e){i.inherited("init",this,arguments),this.ajaxSvc=e.ajaxSvc,this.logger=e.logger},getChartInfo:function(e){return this.logger.debug("getRecommendInfo"),this._executeRequest(e,"v1/smarts/visualization-recommender/chartInfo").catch(this._handleError.bind(this)).then((function(e){var i=e.data;if(i.smartsStatus!==t.STATUS.OK)throw new t(i.smartsStatus,i.details);var a=i;if(i.recommendations){var o=i.recommendations.filter((function(e){return!e.mandatorySlotsMissing}));a=o&&o.length?o[0]:i.recommendations[0]}return{title:a.title,label:a.label,description:a.description,mandatorySlotsMissing:a.mandatorySlotsMissing}}))},recommendAlternateVisualizationsOrBindings:function(e){return this.logger.debug("recommendAlternateVisualizationsOrBindings"),this._executeRequest(e,"v1/smarts/visualization-recommender/recommend").catch(this._handleError.bind(this)).then(this._processResponse.bind(this))},recommendRelatedVisualizations:function(e){var t="v1/smarts/insights/related-visualizations";return e.includeBestVisForTargetFields&&(t="v1/smarts/explore/related-visualizations"),this.logger.debug("recommendRelatedVisualizations"),this._executeRequest(e,t).catch(this._handleError.bind(this)).then(this._processResponse.bind(this))},recommendCompareVisualizations:function(e){return this.logger.debug("recommendCompareVisualizations"),this._executeRequest(e,"v1/smarts/content-recommender/comparison").catch(this._handleError.bind(this)).then(this._processCompareResponse.bind(this))},_processResponse:function(e){var i=e.data;if(i.smartsStatus===t.STATUS.OK)return i.recommendations;throw new t(i.smartsStatus,i.details)},_processCompareResponse:function(e){var i=e.data;if(i.status.code===t.STATUS.OK)return i.ircontent;throw new t(i.smartsStatus,i.details)},_handleError:function(e){var i=e.jqXHR.responseJSON;throw this.logger.debug(i),i?new t(i.smartsStatus,i.details):new t(e.jqXHR.fail().status,e.jqXHR.fail().responseText)}});return i})),define("dashboard-analytics/visualizations/recommender/SmartsToVizMapping",{Area:{visId:"com.ibm.vis.rave2bundlearea",CATEGORY:"categories",VALUE:"values",COLOR:"series",MATRIX_COLUMN:"repeatHorizontal",MATRIX_ROW:"repeatVertical"},StackedArea:{visId:"com.ibm.vis.rave2bundlearea",CATEGORY:"categories",VALUE:"values",COLOR:"series",MATRIX_COLUMN:"repeatHorizontal",MATRIX_ROW:"repeatVertical"},Bar:{visId:"com.ibm.vis.rave2bundlebar",CATEGORY:"categories",VALUE:"values",COLOR:"color",MATRIX_COLUMN:"repeatHorizontal",MATRIX_ROW:"repeatVertical",TARGET_LINE:"target"},ClusteredBar:{visId:"com.ibm.vis.rave2bundlebar",CATEGORY:"categories",VALUE:"values",COLOR:"color",MATRIX_COLUMN:"repeatHorizontal",MATRIX_ROW:"repeatVertical",TARGET_LINE:"target"},StackedBar:{visId:"com.ibm.vis.rave2bundlestackedbar",CATEGORY:"categories",VALUE:"values",COLOR:"color",MATRIX_COLUMN:"repeatHorizontal",MATRIX_ROW:"repeatVertical"},Bubble:{visId:"com.ibm.vis.ravebubble",X:"x",Y:"y",SIZE:"size",COLOR:"color",POINTS:"categories",MATRIX_COLUMN:"repeatHorizontal",MATRIX_ROW:"repeatVertical"},Column:{visId:"com.ibm.vis.rave2bundlecolumn",CATEGORY:"categories",VALUE:"values",COLOR:"color",MATRIX_COLUMN:"repeatHorizontal",MATRIX_ROW:"repeatVertical",TARGET_LINE:"target"},ClusteredColumn:{visId:"com.ibm.vis.rave2bundlecolumn",CATEGORY:"categories",VALUE:"values",COLOR:"color",MATRIX_COLUMN:"repeatHorizontal",MATRIX_ROW:"repeatVertical",TARGET_LINE:"target"},StackedColumn:{visId:"com.ibm.vis.rave2bundlestackedcolumn",CATEGORY:"categories",VALUE:"values",COLOR:"color",MATRIX_COLUMN:"repeatHorizontal",MATRIX_ROW:"repeatVertical"},Crosstab:{visId:"crosstab",VALUE:"values",COLUMN_HIERARCHY:"column_level1",ROW_HIERARCHY:"row_level1"},Heatmap:{visId:"com.ibm.vis.rave2heat",ROW:"categories",COLUMN:"series",COLOR:"color",SIZE:"size",POINTS:"points",MATRIX_COLUMN:"repeatHorizontal",MATRIX_ROW:"repeatVertical"},Line:{visId:"com.ibm.vis.rave2line",CATEGORY:"categories",VALUE:"values",COLOR:"series",MATRIX_COLUMN:"repeatHorizontal",MATRIX_ROW:"repeatVertical"},ClusteredLine:{visId:"com.ibm.vis.rave2line",CATEGORY:"categories",VALUE:"values",COLOR:"series",MATRIX_COLUMN:"repeatHorizontal",MATRIX_ROW:"repeatVertical"},DualAxis:{visId:"com.ibm.vis.rave2bundlecomposite",CATEGORY:"categories",Y1:"lineValue",Y2:"columnValue",MATRIX_COLUMN:"repeatHorizontal",MATRIX_ROW:"repeatVertical"},Tiledmap:{visId:"com.ibm.vis.rave2bundletiledmap",REGION_LOCATION:"locations",REGION_COLOR:"locationColor",POINT_LOCATION:"pointLocations",POINT_COLOR:"pointColor",POINT_SIZE:"pointSize",COORDINATE_LATITUDE:"latlongLocations.latitude",COORDINATE_LONGITUDE:"latlongLocations.longitude",COORDINATE_COLOR:"latlongColor",COORDINATE_SIZE:"latlongSize",COORDINATE_LABEL:"latlongLocations.caption"},PackedBubble:{visId:"com.ibm.vis.rave2bundlepackedbubble",CATEGORY:"categories",COLOR:"color",SIZE:"size",MATRIX_COLUMN:"repeatHorizontal",MATRIX_ROW:"repeatVertical"},HierarchicalPackedBubble:{visId:"com.ibm.vis.rave2bundlehierarchicalpackedbubble",HIERARCHY:"categories",COLOR:"color",SIZE:"size",MATRIX_COLUMN:"repeatHorizontal",MATRIX_ROW:"repeatVertical"},Network:{visId:"com.ibm.vis.rave2network",TO:"series",FROM:"categories",LINK_WIDTH:"values",MATRIX_COLUMN:"repeatHorizontal",MATRIX_ROW:"repeatVertical"},Pie:{visId:"com.ibm.vis.rave2bundlepie",CATEGORY:"categories",VALUE:"values",MATRIX_COLUMN:"repeatHorizontal",MATRIX_ROW:"repeatVertical"},HierarchicalPie:{visId:"com.ibm.vis.rave2bundlepie",HIERARCHY:"categories",VALUE:"values",MATRIX_COLUMN:"repeatHorizontal",MATRIX_ROW:"repeatVertical"},Point:{visId:"com.ibm.vis.rave2point",CATEGORY:"categories",VALUE:"values",COLOR:"series",MATRIX_COLUMN:"repeatHorizontal",MATRIX_ROW:"repeatVertical"},ClusteredPoint:{visId:"com.ibm.vis.rave2point",CATEGORY:"categories",VALUE:"values",COLOR:"series",MATRIX_COLUMN:"repeatHorizontal",MATRIX_ROW:"repeatVertical"},Dial:{visId:"com.ibm.vis.rave2bundleradialbar",CATEGORY:"categories",VALUE:"values",COLOR:"color",MATRIX_COLUMN:"repeatHorizontal",MATRIX_ROW:"repeatVertical"},Scatter:{visId:"com.ibm.vis.ravescatter",X:"x",Y:"y",COLOR:"color",POINTS:"categories",MATRIX_COLUMN:"repeatHorizontal",MATRIX_ROW:"repeatVertical"},Singleton:{visId:"summary",VALUE:"actual"},KPI:{visId:"kpi",ACTUAL:"actual",PLANNED:"goal",CATEGORY:"sparkline.time"},List:{visId:"JQGrid",ANY:"grid_cols"},Treemap:{visId:"com.ibm.vis.rave2bundletreemap",HIERARCHY:"categories",CATEGORY:"categories",SIZE:"size",COLOR:"color",MATRIX_COLUMN:"repeatHorizontal",MATRIX_ROW:"repeatVertical"},Wordle:{visId:"com.ibm.vis.rave2bundlewordcloud",CATEGORY:"categories",SIZE:"size",COLOR:"color",MATRIX_COLUMN:"repeatHorizontal",MATRIX_ROW:"repeatVertical"},Spiral:{visId:"com.ibm.vis.spiral",TARGET:"values"},DriverAnalysis:{visId:"com.ibm.vis.rave2comet",TARGET:"values"},DecisionTree:{visId:"com.ibm.vis.decisiontree",TARGET:"values"},Sunburst:{visId:"com.ibm.vis.sunburst",TARGET:"values"},Bullet:{visId:"com.ibm.vis.rave2bundlebullet",PLANNED:"goal",ACTUAL:"actual",MINIMUM:"min",MIDDLE:"mid",MAXIMUM:"max",MATRIX_COLUMN:"repeatHorizontal",MATRIX_ROW:"repeatVertical"},Marimekko:{visId:"com.ibm.vis.rave2marimekko",BARS:"categories",LENGTH:"values",WIDTH:"width",COLOR:"color",MATRIX_COLUMN:"repeatHorizontal",MATRIX_ROW:"repeatVertical"},Mentions:{visId:"com.ibm.vis.snippetlistbundle",POSTID:"postId",AUTHORNAME:"authorName",AUTHORNICKNAME:"authorNickname",AUTHORPROFILEURL:"authorProfileUrl",AUTHORURL:"authorProfileUrl",AUTHORAVATAR:"authorAvatar",SITETITLE:"siteTitle",TITLE:"title",DATE:"date",SOURCE:"source",URL:"url",CONVERSATIONSIZE:"conversationSize",MENTIONID:"mentionId",SNIPPET:"snippet",SENTIMENT:"sentiment"},ConversationCluster:{visId:"com.ibm.vis.convoclusterbundle",CLUSTER:"cluster",KEYWORD:"keyword",WEIGHT:"weight",BREAKDOWN:"breakdown",MENTIONS:"mentions"},Waterfall:{visId:"com.ibm.vis.rave2bundlewaterfall",CATEGORY:"categories",CUMULATIVE:"values",MATRIX_COLUMN:"repeatHorizontal",MATRIX_ROW:"repeatVertical"}}),define("dashboard-analytics/visualizations/recommender/VisToSmartsMapping",["./SmartsToVizMapping"],(function(e){"use strict";var t={};return Object.keys(e).forEach((function(i){var a=e[i];t[a.visId]||(t[a.visId]={});var o=t[a.visId];Object.keys(e[i]).forEach((function(e){"visId"===e?o.chartType||(o.chartType=i):o[a[e]]||(o[a[e]]=e)}))})),t})),define("dashboard-analytics/visualizations/recommender/IRUtils",[],(function(){"use strict";var e={sum:"SUM"},t={pre:"PRE",post:"POST",PRE:"pre",POST:"post"};return function(){function i(){_classCallCheck(this,i)}return i.findDataItem=function(e,t){var i=-1,a=-1;for(var o in e.data.dataViews||[]){var n=e.data.dataViews[o].dataItems||[];for(var s in n)t(n[s],s)&&(i=o,a=s)}if(-1!==i&&-1!==a)return{viewIndex:i,viewItemIndex:a}},i.getColumnInfo=function(e,t,i){var a=e.find((function(e){return e.itemId===i})),o=!0;if(!a){o=!1;var n=t.getDataSource().getMetadataColumn(i);a={id:n.getId(),label:n.getLabel()}}return _extends({},a,{isProjected:o})},i.IRAggregateType=function(e){return{sum:"SUM",countdistinct:"COUNT_DISTINCT",count:"COUNT",avg:"AVERAGE",min:"MINIMUM",max:"MAXIMUM"}[e]},i.fromIRAggregateType=function(e){return{SUM:"sum",COUNT_DISTINCT:"countdistinct",COUNT:"count",AVERAGE:"avg",MINIMUM:"min",MAXIMUM:"max"}[e]},i.IRTopBottomType=function(e){return"topcount"===e||"toppercent"===e?"TOP":"BOTTOM"},i.IRTopBottomMethod=function(e){return"bottompercent"===e||"toppercent"===e?"PERCENTAGE":"COUNT"},i.IRToTopBottomType=function(e,t){return{BOTTOM:"bottom",TOP:"top"}[e]+{PERCENTAGE:"percent",COUNT:"count"}[t]},i.localFilters2IRFilters=function(i,a,o){i.forEach((function(i){var n={};if(n.filterId=i.id,n.columnId=i.columnId,n.label=i.binsLabel,!n.label&&o&&(n.label=o.getDataSource().getMetadataColumn(i.columnId).getLabel()),"in"===i.operator||"notin"===i.operator){var s=(i.values||[]).map((function(e){return{uniqueValue:e.u,displayValue:e.d}})),r=(i.excludedValues||[]).map((function(e){return{uniqueValue:e.u,displayValue:e.d}}));i.conditions&&(i.conditions.or||i.conditions.and)||i.conditions&&i.conditions.not||i.conditions||(n.type="INCLUSION_EXCLUSION",n.inclusionValues=s,n.exclusionValues=r,n.invertFlag="in"!==i.operator)}else"between"===i.operator||"notbetween"===i.operator?(n.lowValue={value:i.values[0].u,inclusive:!1},n.highValue={value:i.values[1].u,inclusive:!1},n.invertFlag="notbetween"===i.operator,n.type="NUMERICRANGE",n.filterAggregation={aggregationType:e[i.aggregationType],preOrPostAggregation:t[i.preOrPost]}):(n.type="GENERIC",n.expression="");n.type&&a.push(n)}))},i.topBottomToIRFilters=function(e,t){e.forEach((function(e){var a={};a.filterId=e.id,a.columnId=e.itemId,a.topBottomType=i.IRTopBottomType(e.selection.topBottom.type),a.method=i.IRTopBottomMethod(e.selection.topBottom.type),a.domainSize=e.selection.topBottom.value,e.selection.context&&(a.byColumn=e.selection.context[0].itemId),a.type="TOP_BOTTOM",t.push(a)}))},i.IRFilters2TopBottom=function(e,t,a,o,n){"RECOMMEND_FILTER"===o.reason?o.type="PART_TO_WHOLE":"INVERT_FILTER"===o.reason&&(o.type="INVERT_FILTER_TOP_BOTTOM");var s=i.findDataItem(t,(function(t){return t.id===e.filterId})),r=void 0,l=void 0;if(s){var c=t.data.dataViews[s.viewIndex].dataItems[s.viewItemIndex];r=c.itemLabel;var u=c.selection[0];u&&u.context&&u.context[0]&&u.context[0].aggregate&&(l=u.context[0].aggregate)}else{var d=(e.columnId||"").split(".");r=d[d.length-1]}var h={};h.id=e.filterId,h.itemId=e.columnId,h.itemLabel=r;var p=i.getColumnInfo(a,n,e.columnId);o.column=p;var g={operation:"keep",topBottom:{type:i.IRToTopBottomType(e.topBottomType,e.method),value:e.domainSize}};if(o.info=g.topBottom,e.byColumn){g.context=[{aggregate:l,itemId:e.byColumn}];var v=i.getColumnInfo(a,n,e.byColumn);o.byColumn=v}return h.selection=[g],h},i.IRFilters2LocalFilter=function(e,i){var a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},n=arguments[4];"INVERT_FILTER"===o.reason&&(o.type="INVERT_FILTER_LOCAL");var s={};s.id=e.filterId,s.columnId=e.columnId;var r=a.find((function(t){return t.itemId===e.columnId}));if(r?o.column={id:e.columnId,label:r.label}:n&&(o.column={id:e.columnId,label:n.getDataSource().getMetadataColumn(e.columnId).getLabel()}),"NUMERICRANGE"===e.type){if(e.invertFlag?s.operator="notbetween":s.operator="between",s.values=[{d:e.lowValue.value,u:e.lowValue.value},{d:e.highValue.value,u:e.highValue.value}],e.filterAggregation)s.aggregationType=e.filterAggregation.aggregationType,s.preOrPost=t[e.filterAggregation.preOrPostAggregation];else if(i){var l=i.localFilters.find((function(t){return t.id===e.filterId}));s.aggregationType=l.aggregationType,s.preOrPost=l.preOrPost}}else"COMPOSITE"===e.type||("INCLUSION_EXCLUSION"!==e.type||e.filterCondition?"GENERIC"===e.type&&(s.columnId=e.columnId,s.id=e.filterId):(s.columnId=e.columnId,s.id=e.filterId,s.operator=e.invertFlag?"notin":"in",s.values=(e.inclusionValues||e.values||[]).map((function(e){return{u:e.uniqueValue,d:e.displayValue}})),s.binsLabel=e.label));return s},i}()})),define("dashboard-analytics/visualizations/recommender/SmartsSupportedChartTypes",["bi/smarts-js/smarts.min"],(function(e){var t={};return function(){function i(){_classCallCheck(this,i)}return i.get=function(i,a){var o=JSON.stringify(a);if(!t[o]){var n=new e.SmartsService(i);t[o]=n.getSupportedChartTypes(a)}return t[o]},i}()})),define("dashboard-analytics/visualizations/recommender/SmartsCompareCardRecommenderHelper",["underscore","../../lib/@waca/core-client/js/core-client/ui/core/Class","./IRUtils","../../lib/@waca/dashboard-common/dist/core/UniqueHashIdBuilder","../../filters/FilterSpecHelper"],(function(e,t,i,a,o){"use strict";var n=0,s={fact:"ordinal",attribute:"category"},r=t.extend({init:function(e,t){this.columnIds=e,this.requestOptions=t,this.id="id_"+ ++n,r.inherited("init",this,arguments)},getRequestParameters:function(e){var t=this.columnIds,i=this.requestOptions,a=i.assetId,o=i.numResults,n=i.sourceType,s=i.module,r=this._getColumnsInfo(t).map((function(e){return e.id})).reduce((function(e,t){return e.concat(t)}),[]),l=e?s.copyPartialMoserModuleJSON(r):s.getTemporarySessionModuleJSON(),c=i.widgetSpec,u=i.visualization,d=this._toIRFilters(u,c),h={id:this.id,topicId:"",combinations:[{columnCombinations:this._getColumnCombinationsForIR(u),filters:d}]},p={sourceModuleId:a,sourceModule:JSON.stringify(l),sourceType:n,includedColumns:[],excludedColumns:[],shapedModule:!!s.getShapingId(),irContents:[h],maxCardsPerIR:o||10};return s.saveTemporaryModule().then((function(e){return a!==e&&(p.tempModuleId=e),p}))},_restoreHiddenCustomGroupCols:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];0!==t.length&&Object.keys(e).forEach((function(i){e[i].forEach((function(e){(e.combinations||[]).forEach((function(e){(e.columnCombinations||[]).forEach((function(e,i){var a=t.find((function(e){return e.index===i}));a&&a.to===e.id&&(e.id=a.from)}))}))}))}))},_replaceHiddenCustomGroupCols:function(e,t){var i=this,a=t.visualization,o=t.moserDataSources,n=a.getDataSource().getId();o&&o.isConsumerGroupColumn&&e.forEach((function(t,a){var s=t.itemId;if(o.isConsumerGroupColumn(n,s)){var r=o.getCustomGroupData(n,s);if(r&&r.basedOnMoserObjectId){var l=e[a].itemId,c=r.basedOnMoserObjectId;e[a].itemId=c,i.requestOptions.hiddenCustomGroupColumnReplacements||(i.requestOptions.hiddenCustomGroupColumnReplacements=[]),i.requestOptions.hiddenCustomGroupColumnReplacements.push({index:a,from:l,to:c})}}}))},_getColumnCombinationsForIR:function(e){var t=this._getColumnCombinations(e);return this._replaceHiddenCustomGroupCols(t,{visualization:e,moserDataSources:this.requestOptions.moserDataSources}),t.map((function(e){var t={id:e.itemId};return e.aggregation&&(t.aggregation=e.aggregation),e.autoGrouping&&(t.autoGrouping=e.autoGrouping),t}))},_getColumnCombinations:function(e){var t=[];return e.getSlots().getMappedSlotList().forEach((function(e){e.getDataItemList(!0).forEach((function(e){var a=e.getAggregation(),o=e.getId(),n=e.getColumnId(),r=e.getMetadataColumn().getType(),l=e.getLabel(),c=s[e.getType()];if("_multiMeasuresSeries"!==n)if(a&&"ordinal"===c)t.push({id:o,itemId:n,dataType:r,finalSlotType:c,label:l,aggregation:i.IRAggregateType(a)});else{var u=void 0;e.getBinning()&&(u={size:e.getBinning().bins}),t.push({id:o,itemId:n,dataType:r,finalSlotType:c,label:l,autoGrouping:u})}}))})),t},transformCompareRecommendationResponse:function(e,t,i){var a=this.requestOptions;return this._fromIRContent(a,t,i)},_getColumnsInfo:function(e){return e.map((function(e){return{id:[e]}}))},_toIRFilters:function(e,t){var a=this._getFilters(e),o=this._getTopBottom(t),n=[];return i.localFilters2IRFilters(a,n,e),i.topBottomToIRFilters(o,n),n},_getFilters:function(e){var t=this,i=e.getLocalFilters().getFilterList();i||(i=[]);var a=[];return i.forEach((function(e){return t._collectLeafFilterEntries(e,a)})),JSON.parse(JSON.stringify(a))},_collectLeafFilterEntries:function(e,t){var i=this;o.isCompound(e)?e.values.forEach((function(e){e&&i._collectLeafFilterEntries(e,t)})):t.push(e)},_getTopBottom:function(e){var t=[];return(JSON.parse(JSON.stringify(e)).data.dataViews||[]).forEach((function(e){(e.dataItems||[]).forEach((function(e){(e.selection||[]).forEach((function(i){i&&i.topBottom&&t.push({id:e.id,itemId:e.itemId,selection:i})}))}))})),t},_fromIRContent:function(e,t,i){var a=this,o=e.visualization,n=[],s=this._getColumnCombinations(o);return this._restoreHiddenCustomGroupCols(i,e.hiddenCustomGroupColumnReplacements),i&&i[this.id]&&i[this.id].forEach((function(e){var i=a._processIRContent(e,t,s,e.details,o);n.push.apply(n,i)})),n},_processIRContent:function(e,t,a,o,n){var s=this,r=e.combinations,l=[],c={reason:o};return r.forEach((function(e){var o={local:[],topBottom:[]};(e.filters||[]).forEach((function(e){if("TOP_BOTTOM"===e.type){var s=i.IRFilters2TopBottom(e,t,a,c,n);s&&o.topBottom.push(s)}else{var r=i.IRFilters2LocalFilter(e,t,a,c,n);r&&o.local.push(r)}})),t.titleHtml=void 0,t.name=void 0;var r=s._transform2WidgetSpec(t,a,e.columnCombinations,o,c,n,{});r&&l.push({spec:r,details:c,score:e.score})})),l},_transform2WidgetSpec:function(e,t,i,a,o,n,s){var r=JSON.parse(JSON.stringify(e));return this._assimilateTopBottom(r,a.topBottom,t,s),this._assimilateFilters(r,a.local),this._assimilateComparableMeasures(r,i,t,o,n,s),r},_replaceSlotId:function(e,t,i){e.slotmapping.slots.forEach((function(a,o){var n=a.dataItems.indexOf(t);-1!==n&&(e.slotmapping.slots[o].dataItems[n]=i)}))},_assimilateTopBottom:function(e,t,i,a){var o=this;t.forEach((function(t){o._assimilateTopBottomItem(e,t,i,a)}))},_findMatchingColumnEntry:function(e,t){var i=void 0;if(t.some((function(t){if(t.id===e.id)return i=t,!0})),!i){1===t.length?i=t[0].itemId===e.itemId?t[0]:void 0:t.some((function(t){if(t.itemId===e.itemId&&function(e,t){return!t.selection[0].context||"ordinal"!==e.finalSlotType}(t,e))return i=t,!0}))}return i},_assimilateTopBottomItem:function(e,t,o,n){var s=this._findMatchingColumnEntry(t,o);if(s){var r=i.findDataItem(e,(function(e){return e.id===s.id}));if(r){var l=e.data.dataViews[r.viewIndex].dataItems[r.viewItemIndex],c=l.id,u=a.createUniqueHashId(l.itemId,n);n[u]=u,e.data.dataViews[r.viewIndex].dataItems[r.viewItemIndex]=_extends({},t,{id:u}),this._replaceSlotId(e,c,u)}}},_assimilateFilters:function(e,t){0===t.length&&void 0===e.localFilters||(e.localFilters=t)},_assimilateComparableMeasures:function(t,a,o,n,s,r){var l=a.map((function(e){return e.id})),c=o.map((function(e){return e.itemId})),u=e.difference(c,l)[0],d=e.difference(l,c)[0];!u&&d&&(u=c[0]);var h=void 0;o.forEach((function(e){e.itemId!==u||"category"==e.finalSlotType||h||(h=e.id)})),h||o.forEach((function(e){e.itemId!==u||h||(h=e.id)})),"REPLACE_COMPARABLE_MEASURE"===n.reason&&(n.type="REPLACE_COMPARABLE_MEASURE",n.from=i.getColumnInfo(o,s,u),n.to=i.getColumnInfo(o,s,d)),this._assimilateComparableMeasure(t,u,d,h,r)},_assimilateComparableMeasure:function(e,t,o,n,s){var r=i.findDataItem(e,(function(e){return e.itemId===t&&e.id===n}));if(r){var l=e.data.dataViews[r.viewIndex].dataItems[r.viewItemIndex],c=l.id,u=a.createUniqueHashId(l.itemId,s);s[u]=u;var d=o.split("."),h=d[d.length-1];e.data.dataViews[r.viewIndex].dataItems[r.viewItemIndex]=_extends({},l,{itemId:o,itemLabel:h,id:u}),this._replaceSlotId(e,c,u)}}});return r})),define("dashboard-analytics/visualizations/recommender/BaseSmartsVisRecommenderWrapper",["../../lib/@waca/core-client/js/core-client/ui/core/Class","./SmartsVisRecommenderService","./SmartsToVizMapping","./VisToSmartsMapping","./IRUtils","./SmartsSupportedChartTypes","underscore","./SmartsCompareCardRecommenderHelper","../../apiHelpers/SlotAPIHelper"],(function(e,t,i,a,o,n,s,r,l){"use strict";var c=["com.ibm.vis.rave2network"],u=e.extend({init:function(e){var o=e.moserDataSources,n=e.ajaxSvc,s=e.logger,r=e.glassOptions,l=e.dashboardApi,c=e.dataSources;u.inherited("init",this,arguments),this.moserDataSources=o,this._recommenderService=new t({ajaxSvc:n,logger:s}),this.dataSources=c,this._glassOptions=r,this._smartsToVisInfoMap=i,this._visToSmartsInfoMap=a,this._supportedVisIds=Object.keys(this._smartsToVisInfoMap),this._recommenderApi=l.getFeature("Recommender.internal")},destroy:function(){u.inherited("destroy",this,arguments),this._recommenderService&&(this._recommenderService.destroy(),this._recommenderService=null),this.dataSources=null,this._glassOptions=null,this._smartsToVisInfoMap=null,this._visToSmartsInfoMap=null,this._supportedVisIds=null,this._recommenderApi=null},recommendAlternateVisualizations:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this._getRequestParametersForRecommendVisualizations(e,t,!0).then(this._recommenderService.recommendAlternateVisualizationsOrBindings.bind(this._recommenderService)).then(this._transformRecommendationResponse.bind(this,t.module.getSourceId())).then(this._stripDuplicates.bind(this))},recommendRelatedVisualizations:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this._getRequestParametersForRecommendVisualizations(e,t).then(this._recommenderService.recommendRelatedVisualizations.bind(this._recommenderService)).then(this._transformRecommendationResponse.bind(this,t.module.getSourceId()))},recommendCompareVisualizations:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],i=arguments[1],a=new r(t,i);return a.getRequestParameters().then((function(t){return e._recommenderService.recommendCompareVisualizations(t).then(a.transformCompareRecommendationResponse.bind(a,i.module,i.widgetSpec))}))},_getIncludedCharts:function(){return n.get(this._glassOptions,this._recommenderApi.getChartTypeList())},_getRequestParametersForRecommendVisualizations:function(e,t,i){var a=this,o=t.visualization,n=t.moserDataSources;if(o&&n&&n.isConsumerGroupColumn){var s=o.getDataSource().getId();e.forEach((function(t,i){if(n.isConsumerGroupColumn(s,t)){var a=n.getCustomGroupData(s,t);a&&a.basedOnMoserObjectId&&(e[i]=a.basedOnMoserObjectId)}}))}var r={columns:this._getColumnsInfo(e)};return t.includeBestVisForTargetFields&&(r.includeBestVisForTargetFields=!0),this._getIncludedCharts().then((function(e){return e&&(r.includedCharts=e),a._addCommonRequestParameters(r,t,i)}))},recommendBindings:function(e){var t=this,i=e.visId,a=e.columnsToBind,o=e.requestOptions,n=e.boundColumnsInfo,s=e.originalVisId,r=[];if(a&&(r=r.concat(this._getColumnsInfo(a))),n){var l=this._visToSmartsInfoMap[s]||this._visToSmartsInfoMap[i];if(!l)return Promise.reject(new Error("Invalid originalVisId or visId"));r=r.concat(this._getColumnsInfoForBoundColumns(n,l))}var c={columns:r,chartType:this._visToSmartsInfoMap[i].chartType,allowBindingsWithWarnings:!0};return s&&this._visToSmartsInfoMap[s]&&(c.originalChartType=this._visToSmartsInfoMap[s].chartType),this._addCommonRequestParameters(c,o,!0).then((function(){return t._recommenderService.recommendAlternateVisualizationsOrBindings(c).then(t._transformBindingRecommendationResponse.bind(t,i,o.module))}))},getRecommendInfo:function(e){var t=this,i=e.columns,a=e.visId,o=e.requestOptions,n=this._visToSmartsInfoMap[a];if(!n)return Promise.reject(new Error(this.getUnsupportedVizErrCode()));i=this._sanitizeColumnInfo(i);var s={columns:this._getColumnsInfoForBoundColumns(i,n),chartType:this._visToSmartsInfoMap[a].chartType};return this._addCommonRequestParameters(s,o,!0).then((function(){return t._recommenderService.getChartInfo(s)}))},getUnsupportedVizErrCode:function(){return"ERR_CODE_UNSUPPORTED_VIS"},_isSupportedViz:function(e){return-1!==this._supportedVisIds.indexOf(e.chartType)},_addCommonRequestParameters:function(e,t,i){var a=t.assetId,o=t.numResults,n=t.sourceType,r=t.oneChartPerType,l=t.module,c=t.filters,u=e.columns.map((function(e){return e.id})).reduce((function(e,t){return e.concat(t)}),[]),d=i?l.copyPartialMoserModuleJSON(u):l.getTemporarySessionModuleJSON(),h={sourceModuleId:a,oneChartPerType:r||!0,numResults:o||10,sourceType:n,shapedModule:!!l.getShapingId()};return d&&(h.tempModule=JSON.stringify(d)),c&&(h.filters=c),l.saveTemporaryModule().then((function(t){return a!==t&&(h.tempModuleId=t),s.extend(e,h)}))},_transformRecommendationResponse:function(e,t){return t.filter(this._isSupportedViz.bind(this)).filter(this._isSupportedBinding.bind(this,e)).filter(this._hasSupportedFilter.bind(this)).map(this._transformRecommendation.bind(this))},_stripDuplicates:function(e){var t=[],i=new Map,a=e,o=Array.isArray(a),n=0;for(a=o?a:a[Symbol.iterator]();;){var s;if(o){if(n>=a.length)break;s=a[n++]}else{if((n=a.next()).done)break;s=n.value}var r=s;i.has(r.visId)||(i.set(r.visId,!0),t.push(r))}return t},_transformRecommendation:function(e){var t=e.chartType,i=e.label,a=e.description,o=e.title,n=e.columns,s=e.filters,r=e.autoGroupingMap,l=this._smartsToVisInfoMap[t];return{label:i,description:a,title:o,visId:l.visId,topBottom:this._transformTopBottomFromSmartsFilters(s),filters:this._transformFiltersFromSmartsFilters(s),autoGroup:this._transformAutoGroupFromSmartsAutoGroupingMap(r),slots:this._transformFromSmartsColumnInfo(n,l)}},_getColumnsInfo:function(e){return e.map((function(e){return{id:[e]}}))},_sanitizeColumnInfo:function(e){return e.map((function(e){return{slotId:e.slotId,columnIds:s.without(e.columnIds,l.MULTI_MEASURES_SERIES)}})).filter((function(e){return e.columnIds.length>0}))},_getColumnsInfoForBoundColumns:function(e,t){return e.map((function(e){return{slot:t[e.slotId],id:e.columnIds}}))},_transformAutoGroupFromSmartsAutoGroupingMap:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Object.keys(e).map((function(t){var i=e[t];return _extends({itemId:t},i)}))},_transformTopBottomFromSmartsFilters:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.filter((function(e){return"TOP_BOTTOM"===e.type})).map((function(e){return{itemId:e.columnId,spec:{type:o.IRToTopBottomType(e.topBottomType,e.method),value:e.domainSize,context:e.byColumn,aggregate:"sum"}}}))},_transformFiltersFromSmartsFilters:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.filter((function(e){return"TOP_BOTTOM"!==e.type})).map((function(e){return o.IRFilters2LocalFilter(e)}))},_transformFromSmartsColumnInfo:function(e,t){var i={};return e.forEach((function(e){var a=t[e.slot],o=i[a]||[];i[a]=o.concat(e.id)})),i},_getSmartsToVisMappingForUnsupportedVisualization:function(e){var t={},i=this._visToSmartsInfoMap[e];return Object.keys(i).forEach((function(a){"chartType"===a?t.visId=e:t[i[a]]=a})),t},_transformBindingRecommendationResponse:function(e,t,i){var a=this,o=void 0;return c.indexOf(e)>-1&&(o=this._getSmartsToVisMappingForUnsupportedVisualization(e)),i.map((function(t){var i=t.chartType,n=t.columns,s=t.unbound;return o=o||a._smartsToVisInfoMap[i],{visId:e||o.visId,slots:a._transformFromSmartsColumnInfo(n,o),unbound:s}}))},_isSupportedBinding:function(e,t){var i=t.chartType,a=t.columns;switch(i.toUpperCase()){case"SPIRAL":return this._isSupportedSpiral(e,a);default:return!0}},_hasSupportedFilter:function(e){if(e){var t=e.filters;if(t&&t.length>0){return!t.some((function(t){return"TOP_BOTTOM"===t.type&&(i=t.columnId,!(e.columns||[]).some((function(e){return-1!==e.id.indexOf(i)})));var i}))}}return!0},_isSupportedSpiral:function(e,t){var i=this.dataSources.getDataSource(e),a=t.some((function(e){var t=i.getMetadataColumn(e.id);return t&&t.isOlapColumn()})),o=this.moserDataSources.getModule(e);return!(a||o.isOlapPackage())}});return u})),define("dashboard-analytics/visualizations/renderer/common/EventTarget",[],(function(){var e="Must provide implementation";return function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};_classCallCheck(this,t),this.$el=e.$el,this.visAPI=e.visAPI,this.visualization=e.visualization,this.content=e.content}return t.prototype.canRestore=function(){return!1},t.prototype.restore=function(){},t.prototype.getTargetElement=function(){return this.$el},t.prototype.getValuesAtPoint=function(){throw new Error(e)},t.prototype.getEventTargets=function(){throw new Error(e)},t.prototype.getTargetsByCords=function(){throw new Error(e)},t.prototype.decorateTarget=function(){throw new Error(e)},t.prototype.getDecoration=function(){throw new Error(e)},t.prototype.completeDecorations=function(){throw new Error(e)},t.prototype.applyCustomDataSelection=function(){throw new Error(e)},t.prototype.getCustomDataSelections=function(){throw new Error(e)},t.prototype.canZoom=function(){throw new Error(e)},t.prototype.zoom=function(){throw new Error(e)},t.prototype.zoomStart=function(){throw new Error(e)},t.prototype.zoomEnd=function(){throw new Error(e)},t.prototype.pan=function(){throw new Error(e)},t.prototype.panStart=function(){throw new Error(e)},t.prototype.panEnd=function(){throw new Error(e)},t.prototype.processKeyDown=function(){throw new Error(e)},t.prototype.remove=function(){this.$el=null,this.visualization=null,this.visAPI=null,this.content=null},t.prototype.getAPI=function(){return{canRestore:this.canRestore.bind(this),restore:this.restore.bind(this),getTargetElement:this.getTargetElement.bind(this),getEventTargets:this.getEventTargets.bind(this),getTargetsByCords:this.getTargetsByCords.bind(this),getValuesAtPoint:this.getValuesAtPoint.bind(this),decorateTarget:this.decorateTarget.bind(this),completeDecorations:this.completeDecorations.bind(this),getDecoration:this.getDecoration.bind(this),applyCustomDataSelection:this.applyCustomDataSelection.bind(this),getCustomDataSelections:this.getCustomDataSelections.bind(this),canZoom:this.canZoom.bind(this),zoom:this.zoom.bind(this),zoomStart:this.zoomStart.bind(this),zoomEnd:this.zoomEnd.bind(this),pan:this.pan.bind(this),panStart:this.panStart.bind(this),panEnd:this.panEnd.bind(this),processKeyDown:this.processKeyDown.bind(this),remove:this.remove.bind(this)}},t}()})),define("dashboard-analytics/lib/@waca/dashboard-common/dist/utils/EventChainLocal",["../lib/@waca/core-client/js/core-client/ui/core/Class"],(function(e){return e.extend({init:function(e){this.event=e},_getSourceEvent:function(){return this.event.gesture?this.event.gesture.srcEvent:this.event.originalEvent?this.event.originalEvent:this.event},_getPropertyMap:function(){var e=this._getSourceEvent();return e._eventChainLocalMap||(e._eventChainLocalMap={}),e._eventChainLocalMap},setProperty:function(e,t){this._getPropertyMap()[e]=t},getProperty:function(e){return this._getPropertyMap()[e]}})})),define("dashboard-analytics/visualizations/renderer/VisSelectionInfo",["underscore","../../lib/@waca/core-client/js/core-client/ui/core/Class"],(function(e,t){"use strict";return t.extend({init:function(){this._aOrdinalSelections=[],this._aCategorySelections=[],this._slotToCategoryCount={}},getCategorySelections:function(){return this._aCategorySelections},getOrdinalSelections:function(){return this._aAdditionalOrdinalSelections?this._aOrdinalSelections.concat(this._aAdditionalOrdinalSelections):this._aOrdinalSelections},_createSelectionObject:function(e,t,i,a){return{slot:e,slotDataItem:t,value:i,isEdgeSelection:a||this._isEdgeSelection(e)}},addSelection:function(e,t,i,a){var o=t.getType();this._ordinalSelectionAdded(e,t,o)?"fact"===o&&(this._aAdditionalOrdinalSelections=this._aAdditionalOrdinalSelections||[],this._aAdditionalOrdinalSelections.push(this._createSelectionObject(e,t,i,a))):(this["fact"===o?"_aOrdinalSelections":"_aCategorySelections"].push(this._createSelectionObject(e,t,i,a)),this._registerCategoryCount(o,e,t))},_isEdgeSelection:function(e){return!(!e.getDefinition()||!e.getDefinition().treatOrdinalAsCategory)&&e.getDefinition().treatOrdinalAsCategory},_ordinalSelectionAdded:function(t,i,a){var o=!1;return"fact"===a&&(o=!!e.find(this._aOrdinalSelections,(function(e){return e.slot.getId()===t.getId()&&e.slotDataItem.getId()===i.getId()}))),o},_registerCategoryCount:function(e,t,i){if("fact"!==e){var a=this._slotToCategoryCount[t.getId()]||{count:0,dataItems:[]};-1===a.dataItems.indexOf(i.getId())&&(a.count+=1,a.dataItems.push(i.getId()),this._slotToCategoryCount[t.getId()]=a)}},getCategorySetSize:function(){var t=0,i=e.reduce(this._slotToCategoryCount,(function(e,t){return e+t.count}),0);return this._aCategorySelections.length&&(t=this._aCategorySelections.length/i),t}})})),define("dashboard-analytics/visualizations/renderer/VisTooltipInfo",["underscore","./VisSelectionInfo"],(function(e,t){"use strict";var i=t.extend({init:function(){i.inherited("init",this,arguments),this._aCustomSelections=[]},addCustomSelection:function(e,t){this._aCustomSelections.push({name:e,value:t})},getCustomLabelSelections:function(){return e.filter(this._aCustomSelections,(function(e){return"name"in e&&e.name}))},getCustomTitleSelections:function(){return e.filter(this._aCustomSelections,(function(e){return!("name"in e)||!e.name}))}});return i})),define("dashboard-analytics/visualizations/interactions/lassoSelect/LassoSelectView",["../../../lib/@waca/core-client/js/core-client/ui/View","jquery","../../../lib/@waca/core-client/js/core-client/utils/BrowserUtils","../../../lib/@waca/dashboard-common/dist/utils/EventChainLocal"],(function(e,t,i,a){var o=1,n=27,s="mousedown touchstart",r="mousemove touchmove",l="mouseup touchend",c="mouseleave";return e.extend({id:"lw-lasso-select",init:function(i,a,o){e.inherited("init",this,arguments),this.$el.prependTo(document.body),this.$target=i,this.targetNode=this.$target.get(0),this.$body=t(document.body),this.cordinateResolver=a,this._isDragging=o,this.handlers={mousemove:this._getPipedHandler(this._handleMouseMove),mouseup:this._getPipedHandler(this._handleMouseUp),mousedown:this._getPipedHandler(this._handleMouseDown),keyup:this._getPipedHandler(this._handleKeyup),mouseleave:this._getPipedHandler(this._handleMouseLeave)},this._isIE()||this._configCursor(),this.$el.on(r,this.handlers.mousemove),this.$body.keyup(this.handlers.keyup),this.$target.on(c,this.handlers.mouseleave).on(r,this.handlers.mousemove).on(s,this.handlers.mousedown)},_handleMouseMove:function(e){this._updateCursor(e);var t={left:Math.min(e.pageX,this.left),top:Math.min(e.pageY,this.top),width:Math.abs(e.pageX-this.left),height:Math.abs(e.pageY-this.top)};this._isDragging(e)&&(this.$el.css(t),this._isLassoWithinTarget()&&this.trigger("lassoSelect:cordsChange",{event:e,cords:this._getCords()}))},_handleKeyup:function(e){e.keyCode===n&&this.trigger("lassoSelect:cancel",{})},_handleMouseUp:function(e){this._isLassoWithinTarget()&&this.trigger("lassoSelect:done",{event:e,cords:this._getCords()});this.$el.css({left:0,top:0,width:0,height:0}),this.$body.off(l,this.handlers.mouseup)},_handleMouseDown:function(e){"touchstart"!==e.type&&e.which!==o||(this.left=e.pageX,this.top=e.pageY,this.$body.on(l,this.handlers.mouseup))},_handleMouseLeave:function(e){this._updateCursor(e,!1)},remove:function(){this.$el.off(r,this.handlers.mousemove),this.$body.off(l,this.handlers.mouseup).off("keyup",this.handlers.keyup),this.$target.off(s,this.handlers.mousedown).off(c,this.handlers.mouseleave).off(r,this.handlers.mousemove),this._initCursor&&(this.targetNode.style.cursor=this._initCursor.target),this.handlers=null,this.$cursor&&(this.$cursor.remove(),this.$cursor=null),e.inherited("remove",this,arguments)},_getCords:function(){var e=this.el.getBoundingClientRect();return[{x:e.left,y:e.top},{x:e.right,y:e.top},{x:e.right,y:e.bottom},{x:e.left,y:e.bottom}]},_isLassoWithinTarget:function(){var e=this.$target.get(0).getBoundingClientRect(),t=this.el.getBoundingClientRect();return t.top>=e.top&&t.left>=e.left&&t.right<=e.right&&t.bottom<=e.bottom},_getPipedHandler:function(e){return function(t){this._isTouch(t)&&(t.preventDefault(),this.cordinateResolver(t)),new a(t).setProperty("preventWidgetDeselect",!0),e.bind(this)(t)}.bind(this)},_isTouch:function(e){return e.type&&("touchstart"===e.type||"touchmove"===e.type||"touchend"===e.type)},_updateCursor:function(e,i){if(this._isIE()){var a=10,o=12;!1!==i?(this.$cursor&&!this.$cursor.is(":visible")?this.$cursor.show():this.$cursor||(this.$cursor=t('
'),this.$cursor.prependTo(document.body)),this.$cursor.css({left:e.pageX+a,top:e.pageY+o})):this.$cursor&&this.$cursor.hide()}},_isIE:function(){return i.isIE()},_configCursor:function(){this._initCursor={},this._initCursor.target=this.targetNode.style.cursor,this.targetNode.style.cursor="url(dashboard-analytics/images/pointer-marquee_32.svg), auto"},getCoordinates:function(){return this._getCords()}})})),define("dashboard-analytics/visualizations/interactions/lassoSelect/LassoController",["../../../lib/@waca/core-client/js/core-client/ui/core/Events","./LassoSelectView","dashboard-analytics/DynamicFileLoader"],(function(e,t,i){var a=e.extend({init:function(e){var i;a.inherited("init",this,arguments),this.targetElement=e.targetElement,this.cordinateResolver=e.cordinateResolver,this.isDragging=e.isDragging,this._views=((i={})[a.DEFAULT_VIEW_ID]={promise:Promise.resolve([t]),id:a.DEFAULT_VIEW_ID},i),this.dashboard=e.dashboard,this._loadViewExts()},_loadViewExts:function(){var e=this;this.dashboard&&this.dashboard.getCollectionExtension("com.ibm.bi.dashboard.live-lassoView").then((function(t){return t.forEach((function(t){return e._views[t.id]={promise:i.load([t.class]),css:t.css,id:t.id}}))}))},_loadCss:function(e){var t=document.getElementsByTagName("head")[0];if(!t.querySelectorAll("[href='"+e+"']").length){var i=document.createElement("link");i.rel="stylesheet",i.type="text/css",i.href=e,i.media="all",t.appendChild(i)}},activateLassoMode:function(e,t){var i=this;if(e||!1){var o=this._views[t]||this._views[a.DEFAULT_VIEW_ID],n=o.promise,s=o.css,r=o.id;return this.viewId=r,s&&this._loadCss(s),n.then((function(e){i.view=new e[0](i.targetElement,i.cordinateResolver,i.isDragging),i.view.on("all",i._handleViewEvent,i)}))}return this.isLassoMode()&&(this.view.off("all",this._handleViewEvent,this),this.view.remove(),this.view=null,this.viewId=""),Promise.resolve()},isLassoMode:function(){return!!this.viewId},_handleViewEvent:function(e,t){this.trigger(t,e)},getCoordinates:function(){return this.view&&this.view.getCoordinates()},getCurrentViewId:function(){return this.viewId},remove:function(){this.activateLassoMode(!1),a.inherited("remove",this,arguments),this.targetElement=null}});return a.DEFAULT_VIEW_ID="lw-lasso-select",a})),define("dashboard-analytics/features/content/visualizationGesture/api/VisualizationGestureAPI",[],(function(){return function(){function e(){_classCallCheck(this,e)}return e.prototype.setLassoSelectState=function(){},e.prototype.getLassoSelectState=function(){},e.prototype.getLassoViewId=function(){},e}()})),define("dashboard-analytics/visualizations/renderer/VisEventHandler",["jquery","underscore","../../lib/@waca/dashboard-common/dist/utils/EventChainLocal","../../apiHelpers/SlotAPIHelper","./VisSelectionInfo","./VisTooltipInfo","../../util/DashboardFormatter","../interactions/lassoSelect/LassoController","../../features/content/visualizationGesture/api/VisualizationGestureAPI","../../lib/@waca/dashboard-common/dist/core/APIFactory"],(function(e,t,i,a,o,n,s,r,l,c){"use strict";var u=function(){function u(e){_classCallCheck(this,u),this._init(e)}return u.prototype._init=function(e){this._oTimerOut=null,this._lastSelected=null,this._lastHighlighted=null,this._lastImpliedSelection=[],this.dashboard=e.dashboard,this.logger=e.logger,this._target=e.target,this._targetElement=this._target.getTargetElement(),this._ownerWidget=e.ownerWidget,this.content=this._ownerWidget.content,this.state=this.content.getFeature("state"),this.visualization=this.content.getFeature("Visualization"),this._visAPI=e.visAPI,this._visController=this.content.getFeature("InteractivityController.deprecated"),this._selector=this.content.getFeature("DataPointSelections"),this._transaction=e.transaction,this._visActionHelper=this._visController?this._visController.getActionHelper():null;var t=[{key:"mousedown",callback:this.onMouseDown.bind(this)},{key:"mouseup",callback:this.onMouseUp.bind(this)},{key:"mousewheel wheel",callback:this.onMouseWheel.bind(this)},{key:"touchstart",callback:this.onClickTapPanStart.bind(this)},{key:"touchend",callback:this.onPanEnd.bind(this)},{key:"touchmove",callback:this.onPanMove.bind(this)},{key:"transformstart",callback:this.onPinchStart.bind(this),hammer:!0},{key:"transform",callback:this.onPinch.bind(this),hammer:!0},{key:"transformend",callback:this.onPinchEnd.bind(this),hammer:!0}],i=[{key:"mousemove touchmove",callback:this.onHover.bind(this)},{key:"mouseleave touchend",callback:this.onMouseLeave.bind(this)}],a=[{key:"contextmenu",callback:this.onClick.bind(this)},{key:"clicktap",callback:this.onClickTapPanStart.bind(this),data:{allowPropagationDefaultAction:!0}},{key:"hold",callback:this.onHold.bind(this),hammer:!0}],o=[{key:"keydown",callback:this.onKeyDown.bind(this)}];this._visControlEvents=[];var n=this._visAPI.getInteractivitySettings();n.isClickDisabled||(this._visControlEvents.push.apply(this._visControlEvents,a),this._visControlEvents.push.apply(this._visControlEvents,o)),n.isPanAndZoomDisabled||this._visControlEvents.push.apply(this._visControlEvents,t),n.isHoverDisabled||this._visControlEvents.push.apply(this._visControlEvents,i),this.serializeInteractivity=!!n.serialize,this._edgeSelection=!!e.edgeSelection,this._registerEvents(),this.lassoCtrl=new r({targetElement:this._targetElement,cordinateResolver:this._resolveCoordinates,isDragging:this._isDragging.bind(this),dashboard:this.dashboard}),this._ownerWidget.contentFeatureLoader&&this._ownerWidget.contentFeatureLoader.registerFeature(this._ownerWidget.id,"VisualizationGesture",this)},u.prototype.getAPI=function(){return this.api||(this.api=c.createAPI(this,[l])),this.api},u.prototype.isReadyToInteract=function(){return!this.serializeInteractivity||this.state.getStatus()===this.state.STATUS.RENDERED},u.prototype.restoreState=function(){this._target.canRestore()&&this._target.restore(this._visAPI.getPropertyValue("interactivityState"))},u.prototype.remove=function(){var t=this;e(document).off("mouseup",this._onMouseUpHandler),e(document).off("touchend",this._onTouchEndHandler),this._targetElement&&this._visControlEvents.forEach((function(e){e.hammer?t._targetElement.hammer().off(e.key,e.callback):t._targetElement.off(e.key,null,e.callback)})),this._target&&(this._target.remove(),this._target=null),this._lastHoverEvent=null,this._tooltipItems=null,this._lastHighlighted=null,this.content=null,this.lassoCtrl&&(this._endLassoSelection(),this.lassoCtrl.remove(),this.lassoCtrl=null)},u.prototype._registerEvents=function(){var t=this;this._onMouseUpHandler=this._onDocumentMouseUp.bind(this),e(document).on("mouseup",this._onMouseUpHandler),this._onTouchEndHandler=this._onDocumentTouchEnd.bind(this),e(document).on("touchend",this._onTouchEndHandler),this._targetElement&&this._visControlEvents.forEach((function(e){e.hammer?t._targetElement.hammer(e.hammerOption).on(e.key,e.callback):e.data?t._targetElement.on(e.key,null,e.data,e.callback):t._targetElement.on(e.key,null,e.callback)}))},u.prototype.onHover=function(e){e.clientX||this._resolveCoordinates(e),this._isDragging(e)&&!this.lassoCtrl.isLassoMode()?(this._target.canZoom()&&this._target.pan&&this._target.pan(e),this._skipSelection=!0):(this._skipSelection=!this.isReadyToInteract(),this._skipHoverover=this._skipSelection);var t=this._target&&this._target.getEventTargets?this._target.getEventTargets(e):[];this._stopHoverover?this._targetElement&&(t&&t.length>0?this._targetElement.addClass("cursor-pointer"):this._targetElement.removeClass("cursor-pointer")):(this._mouseDown&&(this._clearHoverTimer(),this._visActionHelper.hideToolbarActions()),this._handleImpliedSelections(t,e.ctrlKey||e.metaKey,!1),this._handleHighlights(t),this._handleTooltips(e,t),this._triggerWidgetEvent("visevent:onmove",e,this._target,t,{mouseDown:this._mouseDown,onHold:this._onHold}))},u.prototype.onMouseLeave=function(e){e.clientX||this._resolveCoordinates(e);var t=this._target&&this._target.getEventTargets?this._target.getEventTargets(e):[];this._lastHoverEvent=e,this._tooltipItems=t,this._tooltipItems&&this._tooltipItems.length>0?this._clearHoverTimer():this._lastTooltip&&(this._lastTooltip=null,this._clearHoverTimer(),this._oTimerOut=setTimeout(this._handleMouseleaveTimeout.bind(this),500))},u.prototype._handleMouseleaveTimeout=function(){this._stopHoverover||this._visActionHelper.hideToolbarActions()},u.prototype.onClickTap=function(e){return e&&"tap"===e.type?this.onTap(e):this.onClick(e)},u.prototype.onClick=function(e){if(this._skipSelection)this.setEventLocalProperty(e,"preventDefaultContextBar",!0);else{var t=this._getOnClickData(e),i=t.shouldHandle,a=t.items,o=t.isMultiSelect;i&&a&&(a.length>0?(this._handleSelections(e,a,{isMultiSelect:o}),e.preventDefault(),this.setEventLocalProperty(e,"preventDefaultContextBar",!0)):(this._clearHoverTimer(),this._clearAll(e)))}},u.prototype.onKeyDown=function(e){if(this._target&&this._target.processKeyDown(e)){var t=this._target.getEventTargets(e);t&&t.length>0&&(this._handleSelections(e,t,{forceRightClick:!0}),e.preventDefault(),this.setEventLocalProperty(e,"preventDefaultContextBar",!0))}},u.prototype._getOnClickData=function(e){var t=this._target&&this._target.getEventTargets?this._target.getEventTargets(e):[],i=!("contextmenu"===e.type)&&this.lassoCtrl.isLassoMode();return{shouldHandle:!i,items:t,isMultiSelect:!i&&t&&t.length>1}},u.prototype.onTap=function(e){if(this._resolveCoordinates(e),this._skipSelection)this.setEventLocalProperty(e,"preventDefaultContextBar",!0);else{var t=this._target&&this._target.getEventTargets?this._target.getEventTargets(e):[];if(t)if(t.length>0){var i=this._isItemsSelected(t),a=this._isItemsHighlighed(t);this.setEventLocalProperty(e,"preventDefaultContextBar",!0),i||a?this._handleSelections(e,t,{forceCtrlClick:!0}):(this._handleHighlights(t),this._handleTooltips(e,t,!0))}else this._clearAll(e)}},u.prototype.onHold=function(e){this._resolveCoordinates(e);var t=!1;this._onHold=!0;var i=void 0;this.lassoCtrl.isLassoMode()?(i=this._target&&this._target.getTargetsByCords?this._target.getTargetsByCords(this.lassoCtrl.getCoordinates(),!1):[],t=!0):i=this._target&&this._target.getEventTargets?this._target.getEventTargets(e):[],this._handleSelections(e,i,{forceRightClick:!0,isMultiSelect:t})},u.prototype._storeInteractivityState=function(e){this._ownerWidget.updateVisProperties({id:"interactivityState",value:e},{silent:!0})},u.prototype.onMouseWheel=function(e){if(this._target.canZoom()&&this._target.zoom){this._target.zoomStart(e),this._target.zoom(e);var t=this._target.zoomEnd(e);t&&this._storeInteractivityState(t),e.preventDefault()}},u.prototype.onPinchStart=function(e){this._target.canZoom()&&this._target.zoom&&(this._resolveCoordinates(e),this._target.panEnd(e),this._target.zoomStart(e))},u.prototype.onPinch=function(e){this._target.canZoom()&&this._target.zoom&&(this._resolveCoordinates(e),this._target.zoom(e),(e.gesture||e.originalEvent||e).preventDefault())},u.prototype.onPinchEnd=function(e){if(this._target.canZoom()&&this._target.zoom){this._resolveCoordinates(e);var t=this._target.zoomEnd(e);t&&this._storeInteractivityState(t)}},u.prototype.onClickTapPanStart=function(e){return"touchstart"===e.type?this.onPanStart(e):this.onClickTap(e)},u.prototype.onPanStart=function(e){this._canPan(e)&&(this._resolveCoordinates(e),this._target.panStart(e))},u.prototype.onPanEnd=function(e){this._resolveCoordinates(e);var t=this._target.panEnd(e);t&&this._storeInteractivityState(t)},u.prototype.onPanMove=function(e){var t=e.gesture||e.originalEvent||e,i=t.touches&&2===e.originalEvent.touches.length;this._canPan(e)?(this._resolveCoordinates(e),this._target.pan(e),t.preventDefault()):i&&t.preventDefault()},u.prototype.onMouseDown=function(e){var t=this._getOnClickData(e),i=t.shouldHandle,a=t.items;i&&a&&a.length>0&&this.setEventLocalProperty(e,"preventWidgetDeselect",!0),this._skipSelection=!1,this._mouseDown={X:e.pageX,Y:e.pageY},!this.lassoCtrl.isLassoMode()&&this._target.canZoom&&this._target.canZoom()&&this._target.panStart&&this._target.panStart(e)},u.prototype.onMouseUp=function(e){if(this._target.canZoom&&this._target.canZoom()&&this._target.panEnd){var t=this._target.panEnd(e);t&&this._storeInteractivityState(t)}},u.prototype.getEdgeSelection=function(){return this._edgeSelection},u.prototype._onDocumentMouseUp=function(){this._mouseDown=!1},u.prototype._onDocumentTouchEnd=function(){this._onHold&&(this._onHold=!1)},u.prototype._canPan=function(e){return this._target.canZoom&&this._target.canZoom()&&1===e.originalEvent.touches.length&&!this.lassoCtrl.isLassoMode()},u.prototype._resolveCoordinates=function(e){var t=null;if(e.targetTouches?t=e.targetTouches:e.originalEvent&&e.originalEvent.targetTouches?t=e.originalEvent.targetTouches:e.gesture&&(t=e.gesture.touches),t&&t.length){var i=t&&t.length?t[0]:null;i&&void 0!==i.clientX&&(e.isTouch=!0,e.clientX=i.clientX,e.clientY=i.clientY,e.pageX=i.pageX,e.pageY=i.pageY)}else e.gesture&&e.gesture.center?(e.clientX=e.clientX||e.gesture.center.clientX,e.clientY=e.clientY||e.gesture.center.clientY,e.pageX=e.pageX||e.gesture.center.pageX,e.pageY=e.pageY||e.gesture.center.pageY):e.originalEvent&&(e.clientX=e.clientX||e.originalEvent.clientX||e.originalEvent.pageX,e.clientY=e.clientY||e.originalEvent.clientY||e.originalEvent.pageY,e.pageX=e.pageX||e.originalEvent.pageX,e.pageY=e.pageY||e.originalEvent.pageY)},u.prototype._getBoundsInfoFromEvent=function(e){return{top:e.clientY,height:1,left:e.clientX-10,width:20,parent:document.body}},u.prototype.setEventLocalProperty=function(e,t,a){new i(e).setProperty(t,a)},u.prototype._isDragging=function(e){return"touchmove"===e.type&&this.lassoCtrl.isLassoMode()?1===e.originalEvent.touches.length:this._mouseDown&&(Math.abs(this._mouseDown.X-e.pageX)>5||Math.abs(this._mouseDown.Y-e.pageY)>5)},u.prototype._clearHoverTimer=function(){null!==this._oTimerOut&&(clearTimeout(this._oTimerOut),this._oTimerOut=null)},u.prototype._clearLastHighlight=function(){this._lastHighlighted&&this._clearDecorations(this._lastHighlighted,"highlight"),this._lastHighlighted=void 0,this._skipHoverover=!1},u.prototype._clearDecorations=function(e,t){this._target&&this._target.decorateTarget&&this._target.decorateTarget(e,t,!1)},u.prototype._compareItems=function(e,i){var a=t.pluck(e,"key"),o=t.pluck(i,"key");return 0===t.difference(a,o).length&&0===t.difference(o,a).length},u.prototype._isItemsHighlighed=function(e){return this._compareItems(this._lastHighlighted,e)},u.prototype._isItemsImpliedSelected=function(e){return t.find(this._lastImpliedSelection,(function(t){return t===e}))},u.prototype._handleTooltips=function(e,t,i){var a=this,o=this._lastTooltip?this._lastTooltip:[];this._lastHoverEvent=e,this._tooltipItems=t,this._tooltipItems&&this._tooltipItems.length>0?(this._targetElement.addClass("cursor-pointer"),this._compareItems(o,this._tooltipItems)||(this._clearHoverTimer(),this._oTimerOut=setTimeout((function(){a._clearHoverTimer();var e=a._tooltipItems&&a._tooltipItems.length>0,t=!a._stopHoverover&&!a._skipHoverover;if(e&&(t||i)){var o=a._getDataPayload(a._tooltipItems,n);if(o)a._showSelectionInfo(o,a._lastHoverEvent,!1,!0,a._drillOnly,!1,{isHover:!0})&&(a._lastTooltip=a._tooltipItems),a._lastHoverEvent=null,a._tooltipItems=null}}),500))):(this._targetElement.removeClass("cursor-pointer"),this._lastTooltip&&(this._lastTooltip=null,this._clearHoverTimer(),this._oTimerOut=setTimeout((function(){a._clearHoverTimer(),a._stopHoverover||a._visActionHelper.hideToolbarActions()}),500)))},u.prototype._handleHighlights=function(e,i){var a=this._lastHighlighted?this._lastHighlighted:[];if(i){var o=t.filter(this._lastHighlighted,(function(e){return e.source&&e.source.getDecoration&&!e.source.getDecoration("selected")}));e.push.apply(e,o)}e&&e.length>0?this._isItemsHighlighed(e)||this._target&&this._target.decorateTarget&&(this._clearLastHighlight(),this._target.decorateTarget(e,"highlight")&&(this._lastHighlighted=e)):a.length>0&&this._clearLastHighlight(),!this._compareItems(a,this._lastHighlighted)&&this._target.completeDecorations&&this._target.completeDecorations()},u.prototype._handleSelections=function(e,t,i){var a=i.forceCtrlClick||e.ctrlKey||e.metaKey,o=i.forceRightClick||"contextmenu"===e.type;this._skipHoverover=!1;var s=null;if(o){this._skipHoverover=!0;var r=this._getDataPayload(t,n);if((s=this._resolveItems(t)).length>0){var l=t[0].selectionContext?{slots:t[0].selectionContext.slots,mapIndex:t[0].selectionContext.mapIndex,actions:t[0].selectionContext.actions}:{};l.area=t[0].area,l.isAreaSelected=t[0].isAreaSelected;var c=void 0,u=void 0,d=void 0;return t[0].onlyGlobalActions?(c=!1,u=!0,d=!0):(c=o,u=!1,d=!1),this._showSelectionInfo(r,e,c,u,void 0,d,l),this._triggerWidgetEvent("visevent:select",e,this._target,t,{selectionInfo:r,append:a,lasso:i.isMultiSelect}),this._handleHighlights(t,a),this._select(s,!0,a,!0,t[0].isEdgeSelect,i.isMultiSelect)}this._titleActions(e,t)}else{if(s=this._resolveItems(t),this._handleHighlights(t),s.length>0){var h=this._isSelected(s,t[0].isEdgeSelect),p=!h,g=a||this.lassoCtrl.isLassoMode()&&h,v=this._getDataPayload(t);return this._triggerWidgetEvent("visevent:select",e,this._target,t,{selectionInfo:v,append:g,lasso:i.isMultiSelect}),this._select(s,p,g,!1,t[0].isEdgeSelect,i.isMultiSelect)}if(t&&t.length>=1)switch(t[0].type){case"customdata":return this._handleCustomDataSelections(t,e);case"itemclass":case"summary":return this._handleImpliedSelections(t,a,!0)}}},u.prototype._isSelectionsWithCustomData=function(e){var i=t.filter(e,(function(e){return"customdata"!==e.type}));return e.length>0&&(!i||0===i.length)},u.prototype._handleImpliedSelections=function(e,t,i){var a=this._lastImpliedSelection?this._lastImpliedSelection:[];i&&e&&e.length>0?this._isItemsImpliedSelected(e)||(this._lastImpliedSelection.push(e),this._target.decorateTarget(e,"implied_selection",i,t)):a.length>0&&!t&&(this._lastImpliedSelection=[],this._clearDecorations(e,"implied_selection"))},u.prototype._handleCustomDataSelections=function(e,i){if(this._triggerWidgetEvent("visevent:customdataselection",i,this._target,e),this._target&&this._target.applyCustomDataSelection){var a=t.pluck(this._visAPI.getDecoratedCustomData("selected"),"id");this._target.applyCustomDataSelection(t.filter(e,(function(e){return!t.contains(a,e.key)})))}},u.prototype._resolveItems=function(e){var i=this,a=[];return t.each(e,(function(e){"datapoint"===e.type?a=a.concat(i._resolveDataPointItem(e)):"item"===e.type&&(a=a.concat(i._resolveEdgeItem(e)))})),a},u.prototype._processDataPointSelection=function(e,i){var o=this,n=this._getMappedSlotListByItem(i);t.each(i.values,(function(r,l){var c=i.slotAPIs?i.slotAPIs[l]:n[l];if(c){var u=0;t.each(r,(function(t,n){null===t&&(t=s.format(null));var r=o._getSlotDataItem(c,i,n+u);t.span&&(u+=t.span-1),!r||"object"===(void 0===t?"undefined":_typeof(t))&&a.isMultiMeasuresSeriesOrValueDataItem(r)||e.addSelection(c,r,t,i.isEdgeSelect)}))}}))},u.prototype._resolveDataPointItem=function(e){var i=this._getMappedSlotListByItem(e),o=[];return t.each(e.values,(function(n,s){var r=e.slotAPIs?e.slotAPIs[s]:i[s];if(r){var l=r.getDataItemList();t.each(n,(function(e,t){var i=l[t];i&&"attribute"===i.getType()&&!a.isMultiMeasuresSeriesOrValueDataItem(i)&&o.push({dataItemId:i.getId(),itemId:i.getColumnId(),tupleItem:e})}))}})),[o]},u.prototype._resolveEdgeItem=function(e){var i=this._getMappedSlotListByItem(e),o=[];return t.each(e.values,(function(e,n){var s=i[n];if(s){var r=s.getDataItemList();t.each(e,(function(e,t){var i=r[t];a.isMultiMeasuresSeriesOrValueDataItem(i)||"attribute"!==i.getType()||o.push({dataItemId:i.getId(),itemId:i.getColumnId(),tupleItem:e})}))}})),o},u.prototype._processEdgeSelection=function(e,i){var o=this,n=this._getMappedSlotListByItem(i);i.values&&t.each(i.values,(function(s,r,l){if(s)for(var c=0;c0&&function(){var e=u.getDefinition().getDatasetIdList()[0],i=t.find(n,(function(t){return a.isMultiMeasuresSeriesSlot(t)&&t.getDefinition().getDatasetIdList()[0]===e}));i||(i=a.getMultiMeasureSeriesSlot(o.visualization,e));var s=t.indexOf(t.map(n,(function(e){return e.getId()})),i.getId()),r=t.indexOf(t.map(i.getDataItemList(),(function(e){return e.getColumnId()})),a.MULTI_MEASURES_SERIES);if(s>=0&&r>=0&&l[s]&&l[s][r]&&l[s][r].u){var c=l[s][r].u;d=t.find(u.getDataItemList(),(function(e){return e.getId()===c}))}}(),void 0===d&&(d=u.getDataItemList()[c]),d&&e.addSelection(u,d,s[c],i.isEdgeSelect)}}))},u.prototype._processCustomDataSelection=function(e,i){if(this._target&&this._target.getCustomDataSelections&&e.addCustomSelection){var a=this._target.getCustomDataSelections(i);t.each(a,(function(t){return e.addCustomSelection("object"===(void 0===t?"undefined":_typeof(t))?t.label:t,"object"===(void 0===t?"undefined":_typeof(t))?t.value:void 0)}))}},u.prototype._processDecorationTooltips=function(e,t){try{if(t&&1===t.length&&this._target&&this._target.getDecoration&&e.addCustomSelection){var i=this._target.getDecoration(t[0],u.DECORATIONS.TOOLTIP);i&&"string"==typeof i?e.addCustomSelection(i):i&&Array.isArray(i)&&i.forEach((function(t){Array.isArray(t)&&2===t.length&&e.addCustomSelection(t[0],t[1])}))}}catch(e){this.logger.error(e)}},u.prototype._getSlotDataItem=function(e,i,o){var n=e.getDataItemList();if(a.isMultiMeasuresValueSlot(e)){var s=this._getMappedSlotListByItem(i),r=void 0,l=void 0;if(t.find(s,(function(e,t){return!!a.isMultiMeasuresSeriesSlot(e)&&(r=t,!0)})),r){t.find(s[r].getDataItemList(),(function(e,t){return!!a.isMultiMeasuresSeriesOrValueDataItem(e)&&(l=t,!0)}));var c=i.values[r][l].u;return t.find(e.getDataItemList(),(function(e){return e.getId()===c}))}return e.getDataItemList()[o]}return n[o]},u.prototype._isSelected=function(e,t){var i=this._getSelectionPayload(e,!1,t);return this._selector.isSelected(i,this._edgeSelection||t)},u.prototype._isCustomDataItems=function(e){return t.chain(e).pluck("type").contains("customdata").value()},u.prototype._isCustomDataSelected=function(e){var i=t.pluck(this._visAPI.getDecoratedCustomData("selected"),"id");if(i.length>0){var a=t.chain(e).pluck("values").flatten().pluck("payload").pluck("id").value();if(a.length>0)return t.intersection(i,a).length===a.length}return!1},u.prototype._isItemsSelected=function(e){var t=!1;if(this._isCustomDataItems(e))t=this._isCustomDataSelected(e);else{var i=this._resolveItems(e);t=i.length>0&&this._isSelected(i,e[0].isEdgeSelect)}return t},u.prototype._select=function(e,t,i,a,o,n){var s=this._transaction.startTransaction(),r=a?this.content.getFeature("DataPointSelections.pending"):this.content.getFeature("DataPointSelections"),l=this._getSelectionPayload(e,n,o);i||r.clearAll(s),t?r.select(l,s):r.deselect(l,s),this._transaction.endTransaction(s)},u.prototype._getSelectionPayload=function(e,i){var a=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return i?a?t.map(t.flatten(e),(function(e){return{categories:[{dataItemId:e.dataItemId,columnId:e.itemId,label:e.tupleItem&&e.tupleItem.d,parentId:e.tupleItem&&e.tupleItem.p&&e.tupleItem.p.u,value:e.tupleItem&&e.tupleItem.u}],edgeSelect:a}})):t.map(e,(function(e){return{categories:t.map(e,(function(e){return{dataItemId:e.dataItemId,columnId:e.itemId,label:e.tupleItem&&e.tupleItem.d,parentId:e.tupleItem&&e.tupleItem.p&&e.tupleItem.p.u,value:e.tupleItem&&e.tupleItem.u}})),edgeSelect:a}})):[{categories:t.chain(e).flatten().map((function(e){return{dataItemId:e.dataItemId,columnId:e.itemId,label:e.tupleItem&&e.tupleItem.d,parentId:e.tupleItem&&e.tupleItem.p&&e.tupleItem.p.u,value:e.tupleItem&&e.tupleItem.u}})).value(),edgeSelect:a}]},u.prototype.reduceItems=function(e){var i={itemIds:[],tuple:[]};return e.reduce((function(e,i){var a=void 0,o=void 0;return Array.isArray(i)?(a=t.map(i,(function(e){return e.itemId})),o=t.map(i,(function(e){return t.isUndefined(e.tupleItem&&e.tupleItem.u)?{u:e.tupleItem,d:e.tupleItem}:e.tupleItem}))):(a=[i.itemId],o=i.tupleItem),e.itemIds=t.uniq(e.itemIds.concat(a)),e.tuple.push(Array.isArray(o)?t.uniq(o,!1,(function(e){return e&&e.u||e})):o),e}),i),i},u.prototype._titleActions=function(e,t){var i=this,a=[],o=t&&t[0]?t[0].area:void 0;if(t&&t.length){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:r.DEFAULT_VIEW_ID;return this.lassoCtrl.getCurrentViewId()&&this.lassoCtrl.getCurrentViewId()!==t&&(this._endLassoSelection(),e=!0),this.toggleLassoSelect(e,t)},u.prototype.toggleLassoSelect=function(e,t){var i=0===arguments.length?!this.lassoCtrl.isLassoMode():!!e;return this.lassoCtrl.isLassoMode()!==i&&(i?(this.lassoCtrl.activateLassoMode(!0,t),this.lassoCtrl.on("lassoSelect:done",this._handleLassoSelection,this),this.lassoCtrl.on("lassoSelect:cordsChange",this._handleLassoCordChange,this),this.lassoCtrl.on("lassoSelect:cancel",this._endLassoSelection,this)):this._endLassoSelection()),i},u.prototype.getLassoViewId=function(){return this.lassoCtrl.getCurrentViewId()},u.prototype._handleLassoSelection=function(e){try{var i=[];if(i=t.isUndefined(e.radius)?this._target&&this._target.getTargetsByCords?this._target.getTargetsByCords(e.cords,!1):[]:this._target&&this._target.getEventTargets?this._target.getEventTargets(e.event,e.radius):[]){var a={isMultiSelect:!0};"touchend"===e.event.type&&(a.forceCtrlClick=!0),this._handleHighlights(i),this._handleSelections(e.event,i,a)}}catch(e){this.logger.error(e)}},u.prototype._handleLassoCordChange=function(e){try{var i=[];(i=t.isUndefined(e.radius)?this._target&&this._target.getTargetsByCords?this._target.getTargetsByCords(e.cords,!1):[]:this._target&&this._target.getEventTargets?this._target.getEventTargets(e.event,e.radius):[])&&this._handleHighlights(i)}catch(e){this.logger.error(e)}},u.prototype._endLassoSelection=function(){this.lassoCtrl.off("lassoSelect:done",this._handleLassoSelection,this),this.lassoCtrl.off("lassoSelect:cordsChange",this._handleLassoCordChange,this),this.lassoCtrl.off("lassoSelect:cancel",this._endLassoSelection,this),this.lassoCtrl.activateLassoMode(!1)},u.prototype.isLassoSelectActive=function(){return this.lassoCtrl.isLassoMode()},u.prototype.getLassoSelectState=function(){return this.isLassoSelectActive()},u.prototype._triggerWidgetEvent=function(e,i,a,o,n){var s={sender:this._widgetApi,event:i,target:a,items:o};t.each(n,(function(e,t){s[t]=e})),this._ownerWidget.trigger(e,s)},u.prototype.setPopoverClosed=function(e){this._isHoverFlyoutShowing=!1,e&&e.isHover||(this._stopHoverover=!1)},u.prototype.setPopoverOpened=function(e){e&&e.isHover||(this._stopHoverover=!0,e&&e.isWidgetOdt&&(this._stopHoverover=!1))},u.prototype._getMappedSlotListByItem=function(e){return e&&e.datasetId?a.getMappedSlotListByDataset(this.visualization,e.datasetId):this.visualization.getSlots().getMappedSlotList()},u}();return u.DECORATIONS={HIGHLIGHT:"highlight",SELECT:"select",TOOLTIP:"tooltip"},u})),define("dashboard-analytics/visualizations/renderer/vipr3/VIPRDataPointSummarizer",["underscore","../../../apiHelpers/SlotAPIHelper"],(function(e,t){return function(){function i(e){_classCallCheck(this,i),this.slots=e&&e.getSlots()}return i.prototype.summarizeDataPointValues=function(e,t,i){var a=this,o=this._buildHeaderLine(i,t);if(!e||!e.length||!this.slots)return o;var n={},s=i.dataset;return s&&function(){for(var t=a.slots.getMappedSlotList().filter((function(e){return-1!==e.getDefinition().getDatasetIdList().indexOf(s.id)})),r=a._getMultiMeasureAssignment(t,i),l=function(i){var o=s.getDataItem(i);if("cont"===o.getType()){var l=o.indexes&&o.indexes.dataitem;null==l&&(l=i);var c=t[l],u=c.getDataItemList();c.getDataItemList().forEach((function(e){var t=e.getColumnId();n[t]||(n[t]={measureValues:[],aggregationType:e.getAggregation()||"sum"})})),e.forEach((function(e){var t=a._getMeasureIdFromDataPoint(e,u,r,c,i-l);if(t){var o=e.getValue(i);n[t].measureValues.push(o.getValue()),n[t].indexInResult=l}}))}},c=0;c1&&o&&t.isMultiMeasuresValueSlot(n)){var l=i.getTupleIndex(o.slotIndex),c=o.tuplesInSlot[l].tuple[o.indexInSlot].u,u=e.find(a,(function(e){return c===e.getId()}));r=u&&u.getColumnId()}else(!o||o&&i.index%o.multiMeasureItemCount==0)&&(r=a[s].getColumnId());return r},i.prototype._summarizeValuesInPointsMap=function(e,t){for(var i in t){var a=t[i].measureValues,o=t[i].aggregationType,n=t[i].indexInResult;e[n]=e[n]||[];var s=void 0;if(a.length>1&&("avg"===o||"countdistinct"===o||"calculated"===o))s="N/A";else{s=a[0];for(var r=1;r0&&t.push.apply(t,i.getLines())}if(i.getCaption){var o=i.getCaption();o&&t.push({value:o})}}})),t},I.prototype._handleInteractivityState=function(e){return n.isPropertyIncluded(this.visualization.getDefinition().getId(),"interactivityState")?e:void 0},I.prototype.canZoom=function(){return!!this.viprInteractivity&&this.viprInteractivity.canZoom()},I.prototype.zoomStart=function(e){if(this.viprInteractivity)try{var t=e.gesture?e.gesture.center:e,i=this.viprWidget.getVisCoordinate(this._getClientX(t),this._getClientY(t));this.viprInteractivity.startInteractivity(i),this.gestureScale=1}catch(e){console.warn(e)}},I.prototype.zoom=function(e){if(this.viprInteractivity)try{var t=e.gesture?e.gesture.center:e,i=this.viprWidget.getVisCoordinate(this._getClientX(t),this._getClientY(t)),a=this._getZoomScale(e);this.viprInteractivity.zoom(i,a)}catch(e){console.warn(e)}},I.prototype.zoomEnd=function(e){if(this.viprInteractivity)try{var t=e.gesture?e.gesture.center:e,i=this.viprWidget.getVisCoordinate(this._getClientX(t),this._getClientY(t));return this.viprInteractivity.endInteractivity(i),this.gestureScale=0,this._handleInteractivityState(this.viprWidget.getState())}catch(e){console.warn(e)}},I.prototype.panStart=function(e){if(this.viprInteractivity)try{var t=this.viprWidget.getVisCoordinate(this._getClientX(e),this._getClientY(e));this.viprInteractivity.startInteractivity(t)}catch(e){console.warn(e)}},I.prototype.pan=function(e){if(this.viprInteractivity)try{var t=this.viprWidget.getVisCoordinate(this._getClientX(e),this._getClientY(e));this.viprInteractivity.translate(t)}catch(e){console.warn(e)}},I.prototype.panEnd=function(e){if(this.viprInteractivity)try{var t=this.viprWidget.getVisCoordinate(this._getClientX(e),this._getClientY(e));return this.viprInteractivity.endInteractivity(t),this._handleInteractivityState(this.viprWidget.getState())}catch(e){console.warn(e)}},I.prototype.processKeyDown=function(){return!1},I.prototype._getClientX=function(e){return e.hasOwnProperty("clientX")?e.clientX:e.originalEvent.clientX},I.prototype._getClientY=function(e){return e.hasOwnProperty("clientY")?e.clientY:e.originalEvent.clientY},I.prototype._processItems=function(e,t){var i,o=this,s=t.summarize,r=t.visCoord;switch(this._getTargetType(e)){case u:var l=n.doesConfigPropertyMatchExpected(this.visualization.getDefinition().getId(),"shouldMultiPointSelectionSummarize",!0);i=this._processDataPointTargets(e,s||l);break;case v:i=this._processValueTargets(e);break;case h:case g:i=this._processTupleItemTargets(e);break;case d:case p:i=this._processDataItemClassTargets(e);break;case c:i=this._processCustomDataTargets(e);break;case f:i=[];break;case m:default:i=null}return a.each(i,(function(e){r&&r.area&&(e.area=r.area,e.selectionContext={actions:{actionOptions:{TextAction:{area:r.area}}}}),e.datasetId=o._datasetId(e)})),i},I.prototype._getTargetType=function(e){return e?e.length>0?e[0].infoType:f:m},I.prototype._processValueTargets=function(e){var t=[];return a.each(e,(function(e){var i=e.source,a=i.getIndex(),o=[];o[a]=[e.value],t.push({key:"value_"+a,type:u,source:i,values:o})})),t},I.prototype._processDataPointTargets=function(e,t){var i=this,o=[];t=void 0===t||t;var n=null;return a.each(e,(function(e){var t=i._getSlotAPIsForItem(e),a=t&&t[0].getDefinition().getDatasetIdList()[0];n&&a!==n||(n=a,o.push({key:e.key+":"+a,type:u,source:e.source,values:i._itemRowToTargetValues(e.row),slotAPIs:t,onlyGlobalActions:i._isForecastData(e.source)}))})),o.length&&t&&(o=this.viprDataPointSummarizer.summarizeDataPointTargets(o)),o},I.prototype._getSlotAPIsForItem=function(e){var t=e.source&&e.source.dataset&&e.source.dataset.slotAPIs;return!t&&e.source&&e.source.dataset&&(t=i.getMappedSlotListByDataset(this.visualization,e.source.dataset.getId())),t&&this._isForecastData(e.source)?t.map((function(e){return e.getDataItemList().find((function(e){return"fact"===e.getType()}))?null:e})):t},I.prototype._datasetId=function(e){return e&&e.source&&e.source.dataset&&e.source.dataset.getId&&e.source.dataset.getId()},I.prototype._processTupleItemTargets=function(e){var t=this,i=[];return a.each(e,(function(e){var a=e.source,o=!1;a.datapoints&&a.datapoints.length>0&&(o=t._isForecastData(a.datapoints[0])||!1),a&&i.push({key:e.key||e.getUniqueName(),type:h,source:a,values:t.viprDataPointSummarizer.summarizeDataPointValues(a.datapoints,a.indexes.dataitem,a),isEdgeSelect:!0,onlyGlobalActions:o})})),e.length>1&&(i=this._mergeTupleItemTargets(i)),i},I.prototype._processDataItemClassTargets=function(e){var t=this,i=[];return a.each(e,(function(e){var o=[],n=a.map(t.visualization.getSlots().getMappedSlotList(),(function(e){return e.getId()})).indexOf(e.slotDef.name);n>-1&&(o[n]=[{u:e.source.getUniqueName(),d:e.source.getCaption()}],i.push({key:e.source.getUniqueName(),type:d,source:e.source,values:o}))})),i},I.prototype._processCustomDataTargets=function(e){var t=[];return a.each(e,(function(e){t.push({key:e.id,type:e.infoType,source:{},values:[{payload:e.payload,customType:e.type}]})})),t},I.prototype._itemRowToTargetValues=function(e){var t=[];return e&&e.forEach((function(o,n){if(o.infoType===y){var s=o.dataItem&&o.dataItem.source&&o.dataItem.source.indexes&&o.dataItem.source.indexes.dataitem;null==s&&(s=n),t[s]||(t[s]=[]);var l=t[s],c=a.find(e,(function(e){return e.key&&0===e.key.indexOf(i.MULTI_MEASURES_SERIES)})),u=c?c.index:l.length;o.dataItem&&o.dataItem.source instanceof r?l[u]={u:o.value,d:o.value}:l[u]=o.source&&o.source.getRawValue?o.source.getRawValue():o.value}else t[n]=a.map(o.items,(function(e){return{u:e.source.item.u,d:e.source.item.d,p:e.source.item.p}}))})),t},I.prototype._mergeTupleItemTargets=function(t){return[e.extend.apply(e,[!0,{}].concat(t))]},I.prototype._handleCustomDataDecorations=function(e,t){var i=[];a.chain(e).pluck("values").flatten().each((function(e){a.contains(_,e.customType)&&i.push({id:e.payload.id,value:!0})})),this.visAPI.setCustomDataDecoration("selected",i,t)},I.prototype._getZoomScale=function(e){if(e.gesture){var t=this.gestureScale||1;return this.gestureScale=e.gesture.scale,e.gesture.scale/t}var i=e.originalEvent.deltaMode,a=e.originalEvent.deltaY;return 1===i&&(a=100*a/3),1-.002*a},I.prototype._isForecastData=function(e){return e&&e.deco&&e.deco.forecast},I}(t)})),define("dashboard-analytics/lib/@waca/dashboard-common/dist/utils/FlyoutContentBase",["../lib/@waca/core-client/js/core-client/ui/core/View"],(function(e){var t=e.extend({init:function(e){this.popupParent=e.popupContainer,this.content=e.content||"",t.inherited("init",this,arguments)},getRenderedHtml:function(){return this.content},onPopupShown:function(){},onPopupClosed:function(){}});return t})),define("text!dashboard-analytics/visualizations/renderer/filter/FilterList.html",[],(function(){return'
\n\t
{{!it.title}}
\n\t
    \n\t{{~it.lines :line}}\n\t\t
  • \n\t\t\t{{?line.deleteEnabled}}\n\t\t\t\t
    \n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t
    \n\t\t\t{{?}}\n\t\t\t{{?line.editEnabled}}\n\t\t\t\t{{?line.extraEditEnabled}}\n\t\t\t\t\t
    \n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t
    \n\t\t\t\t{{?}}\n\t\t\t\t
    \n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t
    \n\t\t\t{{?}}\n\t\t\t
    \n\t\t\t\t
    {{!line.title}}
    \n\t\t\t\t
    {{!line.description}}
    \n\t\t\t
    \n\t\t
  • \n\t{{~}}\n\t
\n
\n'})),define("dashboard-analytics/util/KeyCodes",[],(function(){return{KEY_DELETE_MAC:8,KEY_TAB:9,KEY_ENTER:13,KEY_CTRL:17,KEY_ESCAPE:27,KEY_SPACE:32,KEY_END:35,KEY_HOME:36,KEY_LEFT:37,KEY_UP:38,KEY_RIGHT:39,KEY_DOWN:40,KEY_DELETE:46,KEY_SECOND:50,KEY_s:83,KEY_OPEN_BRACKET:219,KEY_CLOSE_BRACKET:221,KEY_h:72,KEY_e:69}})),define("dashboard-analytics/visualizations/renderer/filter/FilterFlyoutView",["jquery","underscore","../../../widgets/livewidget/nls/StringResources","../../../util/TransactionUtil","./FilterLabelHelper","../../../lib/@waca/dashboard-common/dist/utils/FlyoutContentBase","doT","text!./FilterList.html","../../../lib/@waca/core-client/js/core-client/utils/Utils","../../../util/KeyCodes"],(function(e,t,i,a,o,n,s,r,l,c){"use strict";var u=s.template(r),d=n.extend({init:function(e){d.inherited("init",this,arguments),this.visAPI=e.viewOptions.visAPI,this.config=e.viewOptions.config,this.visController=e.viewOptions.visController,this.transaction=e.viewOptions.transaction,this.visualization=e.viewOptions.visualization;var t=this.visualization.getDataSource();this._filterLabelHelper=new o({dataSource:t,visAPI:this.visAPI}),this.visAPI.ownerWidget.model.on("change:localFilters",this._updateFilterLabels,this),this.popOver=null,this.logger=e.logger,this.iconsFeature=this.visAPI.ownerWidget.getDashboardApi().getFeature("Icons"),this.addIcon=this.iconsFeature.getIcon("addNew"),this.editIcon=this.iconsFeature.getIcon("common-edit")},destroy:function(){this.visAPI.ownerWidget.model.off("change:localFilters",this._updateFilterLabels,this)},_getFilterId:function(t){var i=e(t.target).parents(".filterEntry")[0]||e(t.target)[0];return i?i.getAttribute("data-id"):null},setFocus:function(){this.popOver=e(".filterPopover"),this.popOver.find("li:first-Child").focus()},_onKeyUp:function(e){e.keyCode!==c.KEY_DELETE&&e.keyCode!==c.KEY_DELETE_MAC||this.onRemoveContextFilter(e)},onPopupShown:function(){this.onPopupClosed();var t=e(".filterPopover");(t=l.embedSVGIcon(t)).on("primaryaction",".filterDelete",null,this.onRemoveContextFilter.bind(this)),t.on("primaryaction",".localFilterList .visTopCapsule.filterEntry .filterLineContent.filterSelector, .localFilterList .visTopCapsule.filterEntry .filterEdit, .localFilterList li.visTopCapsule.filterEntry",null,this.onEditContextFilter.bind(this)),t.on("keyup",".visTopCapsule.filterEntry",null,this._onKeyUp.bind(this)),t.on("primaryaction",".topBottomDelete",null,this.onRemoveContextTopBottom.bind(this)),t.on("primaryaction",".visTopCapsule.topBottomEntry, .filterLineContent.topBottomSelector, .topBottomEdit",null,this.onEditContextTopBottom.bind(this)),t.on("deleteaction",".visTopCapsule.topBottomEntry",null,this.onRemoveContextTopBottom.bind(this)),t.on("primaryaction",".visTopCapsule.promptEntry, .filterLineContent.promptSelector, .promptEdit",null,this.onEditPrompt.bind(this)),t.on("primaryaction",".drillStateDelete",null,this.onRemoveContextDrill.bind(this))},onPopupClosed:function(){e(".filterPopover").off()},onEditPrompt:function(t){t.stopPropagation();var i=(e(t.target).parents(".promptEntry")[0]||e(t.target)[0]).getAttribute("data-id");return i?(this.visAPI.ownerWidget.rePrompt(i),this.popupParent.close(),!1):(this.logger.error("Could not find prompt info to edit",t),!1)},onEditContextFilter:function(t){var i=this;t.stopPropagation();var a=this._getFilterId(t);this._currentFilterId=a;var o=e(t.target).parents(".filterEntry")[0]||e(t.target)[0];return this.visController.getActionHelper().editLocalFilter(a,o).then((function(e){e&&(i.popupParent.detachHideEvents(),i.parentListClass=".filterList")}))},_updateFilterLabels:function(){var i=this.visAPI.getFilterInfo();t.each(i.localFilters,function(t){if(t.id===this._currentFilterId){var i=e('.filterEntry[data-id="'+t.id+'"] .filterSummary'),a=this._filterLabelHelper.getFilterDescription(t);return a||(a=""),i.text(a),void i.attr("title",a)}}.bind(this))},onRemoveContextFilter:function(e){e.stopPropagation();var t=this._getFilterId(e);if(t){this.visAPI.localFilters.removeFilterEntry({id:t}),this.visAPI.localFilters.allFilterModificationComplete();var i={filterToDelete:t,pageContext:this.visAPI.getPageContextAPI()};this.visAPI.ownerWidget.getDashboardApi().triggerDashboardEvent("filterIndicator:removeEntry",i)}this.popupParent.close()},getRenderedHtml:function(){var e=this.visAPI.getFilterInfo(),t=this.visAPI.getTopBottomInfo(),a=this.visAPI.getDrillInfo(),o=this.config.localFilters&&e.localFilters.length>0,n=this.config.localTopbottoms&&t.length>0,s=this.config.drillState&&a.length>0,r=this.visAPI.getPromptSpec(),l="";if(o||n||s||r){var c=[];o&&(c=c.concat(this._filterLabelHelper.generateFilterListItems(e.localFilters))),n&&(c=c.concat(this._filterLabelHelper.generateTopBottomListItems(t))),s&&this._generateDrillStateListItems(a,c),r&&this._generatePromptListItems(r,c),l+=u({title:i.get("localFilterTitle"),className:"localFilterList",lines:c,addIcon:this.addIcon.id,editIcon:this.editIcon.id})}if(this.config.globalFilters&&e.filters.length>0){var d;d=this._filterLabelHelper.generateFilterListItems(e.filters),l+=u({title:i.get("globalFilterTitle"),className:"globalFilterList",lines:d,addIcon:this.addIcon.id,editIcon:this.editIcon.id})}return l},onRemoveContextTopBottom:function(e){e.stopPropagation();var t=this._getTopBottomId(e);if(t){var i=this.visualization.getSlots().getMappingInfo(t),a=i.slot,o=i.indexInSlot;if(a&&o>=0)this.visAPI.ownerWidget.content.getFeature("topBottomAction").reset(a.getId(),o),this.popupParent.close()}},onRemoveContextDrill:function(e){e.stopPropagation();var t=this._getDrillId(e);if(t){var i=this.visualization.getSlots().getDataItem(t),o=this.transaction.startTransaction();i.clearDrill(o),this.visAPI.getLocalFilters().removeFilterEntry({id:i.getColumnId()}),this.visAPI.getLocalFilters().allFilterModificationComplete(a.transactionTokenToOptions(o)),this.transaction.endTransaction(o),this.popupParent.close()}},onEditContextTopBottom:function(t){var i=this;t.stopPropagation();var a=this._getTopBottomId(t),o=e(t.target).parents(".topBottomEntry")[0]||e(t.target)[0],n=void 0;if(a){var s=this.visualization.getSlots().getMappingInfo(a),r=s.slot,l=s.indexInSlot;n=r&&l>=0?this.visController.getActionHelper().showAction("topBottomAction",r,o,l).then((function(e){e&&(i.popupParent.detachHideEvents(),i.parentListClass=".topBottomList")})):Promise.resolve()}else n=Promise.resolve();return n},_getDrillId:function(t){var i=e(t.target).parents(".drillStateEntry")[0]||e(t.target)[0];return i?i.getAttribute("data-id"):null},_getTopBottomId:function(t){var i=e(t.target).parents(".topBottomEntry")[0]||e(t.target)[0];return i?i.getAttribute("data-id"):null},_generatePromptListItems:function(e,t){for(var a in e)if(e.hasOwnProperty(a)){var o=e[a],n=this._filterLabelHelper.getPromptLabel(o),s={type:"prompt",deleteEnabled:!1,editEnabled:!0,extraEditEnabled:!0,dataId:o.name,title:o.name,description:n,toolTip:n,svgHref:"#common-filter",editLabel:i.get("editFilter"),ariaEditLabel:i.get("ariaEditPrompt")};t.push(s)}},_generateDrillStateListItems:function(e,a){t.each(e,function(e){var t={},o=this._getDrillStateDescription(e);if(void 0!==e.columnId||void 0!==e.columnLabel){if(!o)return;t=o}e.id&&(t.deleteEnabled=e.deleteEnabled,t.editEnabled=e.editEnabled,t.dataId=e.id,t.deleteLabel=i.get("deleteTopBottom"),t.ariaDeleteLabel=i.get("ariaDeleteDrillStateLabel")),t.type="drillState",a.push(t)}.bind(this))},_getDrillStateDescription:function(e){if(void 0!==e.columnId){var t=this._filterLabelHelper.getColumnMetadataNameFromColumnId(e.columnId);return t?(e.columnLabel=t.getLabel(),this._getDrillStateLabel(e,t)):null}},_getDrillStateLabel:function(e){var t,a;return e.children?(e.operator="in",e.values=[{d:e.columnLabel,u:e.children}],a=this._filterLabelHelper.getFilterDescription(e),t={title:i.get("drillDownStateTitle"),description:a,toolTip:a}):e.drillUp&&(e.operator="in",e.values=[{d:e.columnLabel,u:e.drillUp}],a=this._filterLabelHelper.getFilterDescription(e),t={title:i.get("drillUpStateTitle"),description:a,toolTip:a}),t}});return d})),define("text!dashboard-analytics/visualizations/renderer/filter/FilterIndicator.html",[],(function(){return'
\n\t\n\t\t\n\t\n
\n'})),define("dashboard-analytics/visualizations/renderer/filter/FilterIndicator",["jquery","../../../lib/@waca/core-client/js/core-client/ui/core/Class","../../../lib/@waca/dashboard-common/dist/utils/Flyout","./FilterFlyoutView","doT","text!./FilterIndicator.html","../../../lib/@waca/dashboard-common/dist/utils/EventChainLocal","../../../widgets/livewidget/nls/StringResources","../../../lib/@waca/core-client/js/core-client/utils/Utils"],(function(e,t,i,a,o,n,s,r,l){"use strict";var c=o.template(n);return t.extend({init:function(t,i,a,o,n,s){this.visAPI=t,this.config=n,this.logger=s,this.transaction=a,this.interactivityController=o,this.visualization=i;var u=this.visAPI.ownerWidget.dashboardApi.getFeature("Icons").getIcon("filterApplied");this.$filter=e(c({title:r.get("widgetFiltersLabel"),iconId:u.id})),this.$filter=l.embedSVGIcon(this.$filter)},initEvents:function(){var e=this._onClick.bind(this);this.$filter.on("tap keydown click",e)},remove:function(){this.$filter&&this.$filter.off()&&this.$filter.remove(),this._clearFlyout(),this.visAPI=null,this.config=null,this.$filter=null},_clearFlyout:function(){this.flyout&&this.flyout.destroy(),this.flyout=null},setSynchronizeDataFilters:function(e){this.visAPI.setSynchronizeDataFilters(e)},update:function(){this._clearFlyout();var e=this.visAPI.getFilterInfo(),t=this.visAPI.getTopBottomInfo(),i=this.visAPI.getDrillInfo(),a=!!this.visAPI.getPromptSpec();if(e||t||a||i){var o=0,n=0,s=0,r=0;if(e){if(o=this.config.localFilters?e.localFilters.length:0)e.localFilters.find((function(e){return e.isMissing}))&&this.$filter.addClass("dataWidgetFiltersNone");n=this.config.globalFilters?e.filters.length:0}t&&(s=this.config.localTopbottoms?t.length:0),i&&(r=this.config.drillState?i.length:0),o+n+s+r||a?this.$filter.removeClass("dataWidgetFiltersNone"):this.$filter.addClass("dataWidgetFiltersNone")}},isVisible:function(){return!this.$filter.hasClass("dataWidgetFiltersNone")},_preventWidgetContextBar:function(e){new s(e).setProperty("preventDefaultContextBar",!0)},_onClick:function(e){e.keyCode&&13!==e.keyCode||(e.gesture&&e.gesture.preventDefault(),this.flyout||(this.flyout=new i({container:document.body,selector:this.$filter,popoverClass:"filterPopover visTopPopover",viewport:this.el,viewClass:a,viewOptions:{visController:this.interactivityController,visAPI:this.visAPI,config:this.config,visualization:this.visualization,transaction:this.transaction},logger:this.logger})),this.flyout.open(this.$filter),e.stopPropagation())}})})),define("text!dashboard-analytics/visualizations/renderer/info/templates/InfoIndicator.html",[],(function(){return'
\n\t
\n\t\t\n\t\t\t\n\t\t\n\t
\n
'})),define("text!dashboard-analytics/visualizations/renderer/info/templates/InfoList.html",[],(function(){return'
\n{{\n\tvar firstMessage = true;\n}}\n{{~it.messages :msg}}\n\t
\n\t\t{{? firstMessage === false}}\n\t\t\t
\n\t\t{{??}}\n\t\t\t{{\n\t\t\t\tfirstMessage = false;\n\t\t\t}}\n\t\t{{?}}\n\t\t
{{!msg.label}}
\n\t\t
\n\t\t\t
    \n\t\t\t{{~msg.items :item}}\n\t\t\t\t{{? item.isSubMessage === true}}\n\t\t\t\t\t
  • {{!item.label}}
  • \n\t\t\t\t{{??}}\n\t\t\t \t
  • {{!item.label}}
  • \n\t\t\t\t{{?}}\n\t\t\t{{~}}\n\t\t\t
\n\t\t
\n\t
\n{{~}}\n
\n'})),define("dashboard-analytics/visualizations/renderer/info/InfoFlyoutView",["jquery","../../../lib/@waca/dashboard-common/dist/utils/FlyoutContentBase","doT","text!./templates/InfoList.html"],(function(e,t,i,a){"use strict";var o=i.template(a),n=t.extend([],{init:function(e){n.inherited("init",this,arguments),this.setMessages(e.viewOptions.messages)},setMessages:function(e){this.messages=e},setFocus:function(){e(".infoDiv").next().first("li").focus()},onPopupShown:function(){this.onPopupClosed();e(".infoDataScrollable").on("mousewheel DOMMouseScroll",(function(e){var t=e.originalEvent,i=t.wheelDelta||-t.detail;this.scrollTop+=10*(i<0?1:-1),e.preventDefault()}))},getRenderedHtml:function(){return o({messages:this.messages,small:this.messages.length>1})}});return n})),define("dashboard-analytics/visualizations/renderer/info/InfoIndicator",["underscore","../../../lib/@waca/core-client/js/core-client/ui/core/View","../../../lib/@waca/dashboard-common/dist/utils/Flyout","../../../widgets/livewidget/nls/StringResources","text!./templates/InfoIndicator.html","./InfoFlyoutView"],(function(e,t,i,a,o,n){"use strict";var s=t.extend({templateString:o,events:{clicktap:"_onClick",keydown:"_onClick"},init:function(e){s.inherited("init",this,arguments);var t=e.ownerWidget.dashboardApi.getFeature("Icons").getIcon("warnIcon");this.messages={},this.$el.empty().append(this.dotTemplate({title:a.get("warning"),iconId:t.id})),this._hideIndicator()},remove:function(){this.flyout&&this.flyout.destroy(),s.inherited("remove",this,arguments)},addInfo:function(t){var i=this,a=e.filter(t,(function(e){return e.items.length>0}));e.each(a,(function(e){i.messages[e.id]=e})),e.isEmpty(this.messages)?this._hideIndicator():this.$el.show()},reset:function(){this.messages={},this._hideIndicator()},_hideIndicator:function(){this.$el.hide()},clearMessagesByIdAndSubtype:function(e){var t=this,i=e.id,a=e.type;Object.values(this.messages).forEach((function(e){for(var o=0;o\n\t\n\t\t\n\t\n
\n'})),define("dashboard-analytics/visualizations/renderer/refreshtimer/RefreshTimerIndicator",["../../../lib/@waca/core-client/js/core-client/ui/core/View","jquery","underscore","text!./templates/RefreshTimerIndicator.html","../../../widgets/livewidget/nls/StringResources","../../../lib/@waca/dashboard-common/dist/utils/Flyout","../../../lib/@waca/core-client/js/core-client/utils/Utils"],(function(e,t,i,a,o,n,s){var r=e.extend({templateString:a,init:function(e){this.ownerWidget=e;var a=e.get("queryRefresh"),n=a||{autoRefresh:!1};i.extend(this,n),r.inherited("init",this,n),this.$icon&&this.$icon.remove(),this.ariaLabel=o.get("widgetTimer"),this.title=o.get("widgetTimer"),this.clockIcon=this.ownerWidget.dashboardApi.getFeature("Icons").getIcon("common-clock-time").id,this.$icon=t(this.dotTemplate(this))},initEvents:function(){var e=this._onClick.bind(this);this.$icon.on("mousedown tap keydown mouseup",e)},remove:function(){this.$icon&&this.$icon.off(),this.$icon=null,r.inherited("remove",this,arguments)},_onClick:function(e){if("mouseup"!==e.type){if(!e.keyCode||13===e.keyCode){if(e.gesture&&e.gesture.preventDefault(),this.ownerWidget){var i=this.ownerWidget.get("queryRefresh").lastRefreshed,a=(new Date).getTime()-i,r=o.get("lastRefresh",{timeInterval:s.formatDuration(a)});this.flyout?(this.flyout.view.empty(),this.flyout.view.html(r)):this.flyout=new n({container:document.body,selector:this.$icon,viewInstance:t("
"+r+"
")}),this.flyout.open(this.$icon)}e.stopPropagation()}}else e.stopPropagation()}});return r})),define("text!dashboard-analytics/visualizations/renderer/templates/EmptyVisualization.template",[],(function(){return'
\n\t
\n\t\t{{= it.caption}}\n\t
\n\t
\n\t\t
{{= it.title }}
\n\t\t
{{= it.description }}
\n\t
\n
\n'})),define("text!dashboard-analytics/visualizations/renderer/forecastIndicator/templates/ForecastIndicator.html",[],(function(){return'
\n\t\n\t\t\n\t\n
\n'})),define("text!dashboard-analytics/visualizations/renderer/forecastIndicator/templates/ForecastOptionsList.html",[],(function(){return'
'})),define("dashboard-analytics/visualizations/renderer/forecastIndicator/ForecastFlyoutView",["jquery","../../../widgets/livewidget/nls/StringResources","../../../lib/@waca/dashboard-common/dist/utils/FlyoutContentBase","doT","text!./templates/ForecastOptionsList.html","react-dom","react","ca-ui-toolkit","underscore"],(function(e,t,i,a,o,n,s,r,l){"use strict";var c=a.template(o),u=r.ToggleSwitch,d=r.Label,h=r.Tooltip,p=r.TextInput,g=r.Select,v=r.keyboardUtils,m=v.isKey,f=v.keyNames;function _(e){var i=t.get("forecast_title"),a=s.createElement(u,{className:"forecastTitleToggle",checked:e.toggleEnabled,onChange:e.onToggleChange,small:!0,align:"right"}),o=e.toggleEnabled?t.get("forecast_toggle_off"):t.get("forecast_toggle_on"),n=a?s.createElement(h,{title:o,orient:"top"},a):null;return s.createElement("div",{className:"forecastWrapperDiv"},s.createElement("div",{className:"forecastTitleDiv"},s.createElement(h,{title:i,orient:"top"},s.createElement(d,{className:"forecastTitleLabel",label:i})),n))}var y=function(e){function t(i){_classCallCheck(this,t);var a=_possibleConstructorReturn(this,e.call(this,i)),o=a._clearValidationErrorForAllSettings(l.clone(i.settings));return a.state={settings:o},a}return _inherits(t,e),t.prototype.validateNumberInput=function(e,t){if(l.isEmpty(e))return!0;var i=Number(e);if(!l.isNumber(i))return!1;var a=l.find(this.state.settings,(function(e){return e.id===t})),o=a.restrictions.minimum,n=a.restrictions.maximum;return o<=i&&i<=n},t.prototype._clearValidationErrorForAllSettings=function(e){var t=l.clone(e);return l.each(t,(function(e){e.showValidationError=!1})),t},t.prototype._validateNumberInputForItem=function(e,t){var i=this.validateNumberInput(t,e.id);return i||(e.showValidationError=!0,this.setState({validationError:!0})),i},t.prototype._checkAndSetNumberValues=function(e,t){if(this._validateNumberInputForItem(e,t)){var i=this._clearValidationErrorForAllSettings(this.state.settings);this.setState({predictItems:i,validationError:!1}),this.props.onForecastPredictItemsChanged(i)}},t.prototype.onBlur=function(e,t){this._checkAndSetNumberValues(e,t)},t.prototype._getNumberReactComponent=function(e){var t=this,i=e.showValidationError?"Enter a number between "+e.restrictions.minimum+" and "+e.restrictions.maximum:e.value;return s.createElement("div",{className:"forecastPredictInput",key:e.id},s.createElement(h,{title:e.description,orient:"top"},s.createElement(d,{type:"caption",htmlFor:e.id,label:e.name,className:"predictForecastTitle"})),s.createElement(p,{className:"predictForecastOptionEntry",id:e.id,title:i,value:e.value,disabled:this.props.isDisabled,placeholder:e.default,onValueChange:function(i,a){return t._applyNumberValuesToState(i,e,a)},fireOnBlur:!0,onBlur:function(i){return t.onBlur(e,i.target.value)},allowInvalidEntry:!0,hasValidationError:e.showValidationError,showIsReqWhenValidErrTxt:!1,onValueChangeInvalid:function(){e.showValidationError=!0,t.setState({validationError:!0})},validEntryMatch:function(i){return t.validateNumberInput(i,e.id)}}))},t.prototype._updateStateClearErrorsGetNewPredictItems=function(e,t){var i=l.clone(this.state.settings);return i.forEach((function(i){i.id===t.id&&(i.showValidationError=!1,l.isEmpty(e)?delete i.value:i.value="confidenceLevel"===t.id?e:parseInt(e))})),this.setState({predictItems:i,validationError:!1}),i},t.prototype._applyNumberValuesToState=function(e,t,i){if(this._validateNumberInputForItem(t,e)){var a=this._updateStateClearErrorsGetNewPredictItems(e,t);"keydown"===i.type&&m(i,f.ENTER)&&this.props.onForecastPredictItemsChanged(a)}},t.prototype._applySelectValuesToState=function(e,t){var i=this._updateStateClearErrorsGetNewPredictItems(e,t);this.props.onForecastPredictItemsChanged(i)},t.prototype._getEnumerationReactComponent=function(e){var t=this,i=[];e.restrictions.values.map((function(e){i.push({value:e.value,label:e.name})}));var a=e.value||e.default;return s.createElement("div",{className:"forecastPredictInput",key:e.id},s.createElement(h,{title:e.description,orient:"top"},s.createElement(d,{type:"caption",htmlFor:e.id,label:e.name,className:"predictForecastTitle"})),s.createElement(g,{id:e.id,selected:a,disabled:this.props.isDisabled,onChange:function(i){return t._applySelectValuesToState(i,e)},options:i,className:"predictForecastOptionEntry"}))},t.prototype.render=function(){var e=this,t=this.state.settings.map((function(t){return"enumeration"===t.restrictions.type?e._getEnumerationReactComponent(t):e._getNumberReactComponent(t)}));return s.createElement("div",{className:"predictForecastOptions"},t)},t}(s.Component),I=function(e){function t(i){_classCallCheck(this,t);var a=_possibleConstructorReturn(this,e.call(this,i));return a.state={toggleEnabled:a.props.initialState.toggleEnabled,settings:a.props.initialState.settings},a}return _inherits(t,e),t.prototype._updateForecastState=function(e){this.props.onForecastValuesStateChanged(l.clone(e))},t.prototype.onToggleChange=function(){var e=l.extend({},this.state,{toggleEnabled:!this.state.toggleEnabled});this.setState(e),this._updateForecastState(e)},t.prototype.predictSettingsChanged=function(e){var t=l.extend({},this.state,{settings:e});this._updateForecastState(t)},t.prototype.render=function(){var e=this;return s.createElement("div",{className:"forecastComponents"},s.createElement("div",{className:"ba-theme-waca",role:"region","aria-label":"{{!it.title}}"},s.createElement(_,{onToggleChange:function(){return e.onToggleChange()},toggleEnabled:this.state.toggleEnabled}),s.createElement(y,{settings:this.state.settings,isDisabled:!this.state.toggleEnabled,onForecastPredictItemsChanged:function(t){return e.predictSettingsChanged(t)}})))},t}(s.Component),b=i.extend({init:function(e){b.inherited("init",this,arguments),this.visAPI=e.viewOptions.visAPI,this.uniqueId=e.viewOptions.uniqueId,this.popOver=null,this.markup=c({title:"Forecast"}),this.content=e.viewOptions.content},setFocus:function(){this.popOver=e(".forecastPopover."+this.uniqueId),this.popOver.find("input:first").focus()},_onRemove:function(){if(this.popOver){var t=this.popOver.find(".popover-content")[0];e(t).find(".forecastComponents").length>0&&n.unmountComponentAtNode(t),this.popOver.remove()}this.popupShown=!1,this.reactComponents=null},remove:function(){b.inherited("remove",this,arguments),this._onRemove()},onPopupClosed:function(){this._onRemove()},getRenderedHtml:function(){if(this.popOver&&this.popOver.find(".popover-content")[0]){var t=this.popOver.find(".popover-content")[0];e(t).find(".forecastComponents").length>0&&n.unmountComponentAtNode(t)}return this.markup},onPopupShown:function(){var e=this,t=this.popOver.find(".popover-content")[0];if(!this.popupShown){var i=l.clone(this.content.getFeature("Forecast").getForecastDisplayState());this.popupShown=!0,this.reactComponents=n.render(s.createElement(I,{initialState:i,onForecastValuesStateChanged:function(t){return e.onForecastValuesStateChanged(t)}}),t),this.setFocus()}},onForecastValuesStateChanged:function(e){this.content.getFeature("Forecast").applyStateChange(e)}});return b})),define("dashboard-analytics/visualizations/renderer/forecastIndicator/ForecastIndicator",["jquery","../../../lib/@waca/core-client/js/core-client/ui/core/Class","text!./templates/ForecastIndicator.html","../../../lib/@waca/core-client/js/core-client/utils/Utils","./ForecastFlyoutView","../../../lib/@waca/dashboard-common/dist/utils/Flyout","doT","../../../widgets/livewidget/nls/StringResources","underscore","../../../lib/@waca/dashboard-common/dist/utils/EventChainLocal"],(function(e,t,i,a,o,n,s,r,l,c){"use strict";var u=s.template(i);return t.extend({init:function(t){this.visModel=t.visModel,this.ownerWidget=t.ownerWidget,this.supportsForecasts=t.supportsForecasts,this.eventRouter=t.ownerWidget.eventRouter,this.visAPI=t.visAPI,this.content=t.content;var i=this.ownerWidget.dashboardApi.getFeature("Icons").getIcon("forecast");this.$forecastIndicator=e(u({title:r.get("forecast_title"),forecastIcon:i.id})),this.$forecastIndicator=a.embedSVGIcon(this.$forecastIndicator),this.logger=t.logger,this.ownerView=t.ownerView},initEvents:function(){var e=this._onClick.bind(this);this.$forecastIndicator.on("tap keydown click",e),this.update()},update:function(){this._areThereValidForecastMessages()?this.$forecastIndicator.removeClass("liveWidgetForecastNone"):this.$forecastIndicator.addClass("liveWidgetForecastNone")},_areThereValidForecastMessages:function(){return!(!this.ownerView.supportsForecasts()||!this.content)&&this.content.getFeature("Forecast").areThereValidForecastSettings()},getIndicator:function(){return this.$forecastIndicator},_onClick:function(e){if(new c(e).setProperty("preventDefaultContextBar",!0),!e.keyCode||13===e.keyCode){if(e.gesture&&e.gesture.preventDefault(),!this.flyout){var t=l.uniqueId("ForecastIndicatorPopover");this.flyout=new n({container:document.body,selector:this.$forecastIndicator,popoverClass:"forecastPopover visTopPopover "+t,viewport:this.el,viewClass:o,placement:"left",viewOptions:{visAPI:this.visModel,uniqueId:t,content:this.content},logger:this.logger}),this.eventRouter&&this.eventRouter.on("widget:hideToolbar",this.closeFlyout,this)}this.flyout.open(this.$forecastIndicator)}},closeFlyout:function(){this.flyout.close()}})})),define("dashboard-analytics/visualizations/renderer/VisTabs",["jquery","underscore","../../lib/@waca/core-client/js/core-client/ui/core/View","react-dom","react","ca-ui-toolkit"],(function(e,t,i,a,o,n){"use strict";var s=n.TabPanel,r=n.Tabs,l=function(e){function i(a){_classCallCheck(this,i);var o=_possibleConstructorReturn(this,e.call(this,a));return o.state=t.clone(a.state),o}return _inherits(i,e),i.prototype.render=function(){return o.createElement(r,{selected:this.getSelectedId(),onChange:this._onChange.bind(this)},this._renderPanels())},i.prototype.select=function(e){this.setState({selectedTab:e||this.props.selectedTab})},i.prototype.getSelectedId=function(){return this.state.selectedTab},i.prototype._renderPanels=function(){return t.map(this.props.entries,(function(e){return o.createElement(s,{key:e.id,id:e.id,label:e.label})}))},i.prototype._onChange=function(e){this.select(e);var i=t.findWhere(this.props.entries,{id:e});i&&i.onChange&&i.onChange(e)},i}(o.Component),c=i.extend({className:"visTabsView",init:function(){c.inherited("init",this,arguments)},placeAt:function(t){e(t).find(".visTabsView").remove(),this.$el.prependTo(t)},createTabs:function(e,t){this.entries=e;var i={selectedTab:t||(e&&e.length?e[0].id:null)};this.ctrl=a.render(o.createElement(l,{entries:e,state:i}),this.el)},reset:function(){this.ctrl&&(a.unmountComponentAtNode(this.el),this.entries=null,this.ctrl=null)},remove:function(){this.reset(),c.inherited("remove",this,arguments)},getTabsCount:function(){return this.entries?this.entries.length:0},selectTab:function(e){this.ctrl&&this.ctrl.getSelectedId()!==e&&(this.ctrl.select(e),this.ctrl.render())}});return c})),define("dashboard-analytics/visualizations/renderer/VisView",["jquery","underscore","doT","../../lib/@waca/core-client/js/core-client/ui/core/View","./filter/FilterIndicator","./info/InfoIndicator","../../widgets/livewidget/nls/StringResources","../../lib/@waca/core-client/js/core-client/utils/Utils","./refreshtimer/RefreshTimerIndicator","text!./templates/EmptyVisualization.template","./forecastIndicator/ForecastIndicator","./VisTabs","../../lib/@waca/core-client/js/core-client/utils/BrowserUtils","../../widgets/livewidget/util/VisUtil","../../lib/@waca/dashboard-common/dist/utils/MemUtil"],(function(e,t,i,a,o,n,s,r,l,c,u,d,h,p,g){var v=["filterIndicator","refreshTimerIndicator","conditionalViewIndicator","infoIndicator"],m=a.extend({DEFAULT_ANIMATION_SPEED:900,ANIMATION_TYPES:{NONE:"none",DEFAULT:"default",FADEIN:"fadein",TRANSITION:"transition",GROW:"grow",REVEAL:"reveal",BIGDATA:"bigdata"},init:function(e){m.inherited("init",this,arguments),t.extend(this,arguments[0]),this.noRotate=!0,this.isMaximizable=!0,this.logger=e.logger,this.ownerWidget=e.ownerWidget,this.visualization=this.ownerWidget.getVisualizationApi(),this.transactionApi=this.dashboardApi.getFeature("Transaction"),this.internalVisDefinitions=this.dashboardApi.getFeature("VisDefinitions.internal"),this.content=e.ownerWidget.content,this._processTemplateString(),e.proxiedView||this._viewManagesOwnQuery()||this._initIndicators(),this.visEl=this.el.firstChild?this.el.firstChild:this.el,this.createTabs(),this.overrideDefaultAnimationSpeed=-1,this.animationType=this.ANIMATION_TYPES.NONE,this.animationSpeed=this.DEFAULT_ANIMATION_SPEED,this._renderingNewData=!1,e.proxiedView||this._viewManagesOwnQuery()||this.createView(),e.proxiedView||this._addPropertyHandler()},createTabs:function(){var e={};if(this.ownerWidget&&this.ownerWidget.$el){var t=this.ownerWidget.$el.find(".visTabsView");e.el=t.length?t[0]:null}this._tabs=new d(e),this._tabs.hide()},placeAt:function(e){this.$el.prependTo(e),this._tabs&&this._tabs.placeAt(e)},setInExpandedMode:function(){var e=this.content.getFeature("ConditionalViewIndicator");e&&e.setInExpandedMode()},onRestore:function(){var e=this.content.getFeature("ConditionalViewIndicator");e&&e.onRestore()},_doesViewSupportSmartAnnotations:function(){return!1},doesVisPropertyMatchExpected:function(){return!1},canApplyAutoBin:function(){return!1},getBinningConfig:function(){},_initFilterIndicator:function(){var e=this.getFilterIndicatorSpec();e&&(e.localFilters||e.globalFilters||e.localTopBottoms||e.drillState)&&(this.filterIndicator=new o(this.visModel,this.visualization,this.transactionApi,this.getController(),e,this.logger),this.ownerWidget.addIcon(this.filterIndicator.$filter,"filterIcon"))},_initIndicators:function(){var e=this,i=this.content.getFeature("VisIndicators");if(i&&this.ownerWidget&&this.ownerWidget.$el){this._initRefreshIndicator(),this._initFilterIndicator(),this._initInfoIndicator(),this._initForecastingIndicator();var a=i.getIndicatorList();t.each(a,(function(t){e.ownerWidget.addIcon(t.icon,t.name)}))}},_initForecastingIndicator:function(){this.forecastIndicator=new u({visModel:this.visModel,ownerWidget:this.ownerWidget,logger:this.logger,supportsForecasts:!0,ownerView:this,visAPI:this.ownerWidget.visAPI,content:this.content}),this.ownerWidget.addIcon(this.forecastIndicator.getIndicator(),"forecastIcon")},_initInfoIndicator:function(){this.infoIndicator=new n({visModel:this.visModel,ownerWidget:this.ownerWidget}),this.ownerWidget.addIcon(this.infoIndicator.$el,"infoIconDiv")},_initRefreshIndicator:function(){this.refreshTimerIndicator=new l(this.ownerWidget),this.ownerWidget.addIcon(this.refreshTimerIndicator.$icon,"timerIcon")},getFilterIndicatorSpec:function(){return{localFilters:!0,globalFilters:!0,localTopbottoms:!0,drillState:!0}},getController:function(){return this.content&&this.content.getFeature("InteractivityController.deprecated")},getSelector:function(){return this.content.getFeature("DataPointSelections.deprecated")},whenVisControlReady:function(){return this._noOpRenderStep("base class whenVisControlReady called!")},whenVisSpecReady:function(){return this._noOpRenderStep("base class whenVisSpecReady called!")},supportsAnnotations:function(){return!1},supportsForecasts:function(){return!1},preDataReady:function(){this.infoIndicator&&this.infoIndicator.clearMessagesWithIds(["visualization_notifications","moreDataIndicator","autobinSuggestion","data_notifications"])},_hasMappedSlots:function(){return 0!==this.visualization.getSlots().getMappedSlotList().length},whenDataReady:function(e){var t=this,i=void 0;return this._hasMappedSlots()&&this.canExecuteQuery()&&!this.hasUnavailableMetadataColumns()&&!this.hasMissingFilters()?(e.isDevInstall=this.ownerWidget.getDashboardApi().isDevInstall,i=this._executeQueries(e).then((function(i){return t.dashboardApi.triggerDashboardEvent("synchronize:pageContextFilters",{synchDataFilterEntries:i.synchDataFilterEntries}),t.filterIndicator&&(t.filterIndicator.setSynchronizeDataFilters(i.synchDataFilterEntries),t.filterIndicator.update()),t._updateInfoIndicator(i,e),{data:i,sameQueryData:t.isSameQueryData(e,i)}}))):i=Promise.resolve({data:{}}),i},_updateInfoIndicator:function(e,i){var a=void 0,o=void 0,n=void 0;if(i.useAPI){var r=t.find(e.getQueryResultIdList(),(function(t){return e.getResult(t).hasMoreData()}));o=(a=void 0!==r)&&e.getResult(r).getRowCount(),n=e.getWarningList()}else a=e.hasMoreData,o=e.queryThreshold;if(this.infoIndicator){var l=[];a&&(o&&l.push({id:"moreDataIndicator",label:s.get("moreDataIndicator",{threshold:o})}),this.canApplyAutoBin()&&!this.hasBinnedDataItems()&&l.push({id:"autobinSuggestion",label:s.get("autobinSuggestion"),isSubMessage:!0})),n&&n.length&&n.forEach((function(e){l.push({id:e.resourceId,label:s.get(e.resourceId,e.params),isSubMessage:!!e.isSubMessage})})),this.infoIndicator.addInfo([{id:"data_notifications",label:s.get("dataNotifications"),items:l}])}},_executeQueries:function(e){if(e.useAPI){var t=this.content.getFeature("DataQueryExecution");return e.extraInfo&&e.extraInfo.dataQueryParams&&t.addRequestOptions(e.extraInfo.dataQueryParams),t.executeQueries()}return this.visModel.whenQueryResultsReady(e)},whenSetDataReady:function(){return Promise.resolve(!0)},isSameQueryData:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments[1];if(void 0===e.sameQueryData){var i=t&&t.getCacheValidateTag&&t.getCacheValidateTag();e.sameQueryData=this._previousTag&&this._previousTag===i,this._previousTag=i}return!!(e.sameQueryData||e.extraInfo&&e.extraInfo.annotationRequest)},updateInfoIndicator:function(e){this.infoIndicator&&this.infoIndicator.update(e)},setRenderingNewData:function(e){this._renderingNewData=e},getRenderingNewData:function(){return this._renderingNewData},isMappingComplete:function(){return this.visualization.getSlots().isMappingComplete()},canExecuteQuery:function(){return!0===this.dashboardApi.getConfiguration("forceQuery")||this.isMappingComplete()},isRenderWithoutCompletingMapping:function(){return!0===this.visualization.getDefinition().getProperty("renderWithoutCompletingMapping")},hasUnavailableMetadataColumns:function(){return this.visualization.hasUnavailableMetadataColumns()},whenHighlighterReady:function(){return this._noOpRenderStep("base class whenHighlighterReady called!")},_getInfoIndicatorEntries:function(e,i){return[{id:e,label:s.get(e),items:t.map(i,(function(e){return{id:e.id,label:e.caption}}))}]},_setInfoIndicatorWarningsAndErrors:function(e){if(this.infoIndicator&&e){var t=e.getWarnings(),i=e.getErrors();this.infoIndicator.addInfo(this._getInfoIndicatorEntries("smart_warnings",t)),this.infoIndicator.addInfo(this._getInfoIndicatorEntries("smart_errors",i))}},clearInfoIndicator:function(){if(this.infoIndicator)if(this.isMappingComplete()){for(var e=arguments.length,t=Array(e),i=0;i0&&void 0!==arguments[0]?arguments[0]:{};if(this._isViewSlotsEmpty())return this.ownerWidget._rebuildVis(e);var t={refresh:{predictSuggestions:!0,keyDrivers:!0,data:!0}};this.filterIndicator&&this.filterIndicator.update(),this.appendExtraInfoToRenderOptions(t,e),this.ownerWidget.isVisible()?this._reRender(t):this.ownerWidget.setReRenderOnShow(t)},onRefreshAllVisDefinition:function(){(this.visualization.getDefinition().getState().getError()||this.content.getFeature("state").getError())&&this._reRender({refreshAll:!0})},onRefreshVisDefinition:function(e){var t=this.visualization.getDefinition();t&&e&&e.info&&t.getId()===e.info.id&&this._reRender({refreshAll:!0})},onAllContentChanges:function(e){if(e&&e.info&&e.info.refresh){var i={refresh:t.extend({},e.info.refresh),extraInfo:{payloadData:{transactionToken:e.transactionToken}}};i.refresh.all&&(i.refreshAll=i.refresh.all);var a=e.context&&e.context.undoRedo&&"ConditionalFormatting"!==e.info.featureName;i.refresh.propertiesPane=this._refreshPropertiesPane(i,a),this._reRender(i)}},_refreshPropertiesPane:function(e,t){return!this._isLocalViz()||e.refresh.propertiesPane||!this._isNewConditionalFormattingEnabled()||!!t},_isLocalViz:function(){var e=this.content.getFeature("Visualization").getType();return t.contains(["KPI","Singleton","Hierarchy","Crosstab","List","DataPlayer"],e)},_isNewConditionalFormattingEnabled:function(){var e=!this.dashboardApi.getGlassCoreSvc(".FeatureChecker").checkValue("dashboard","condFormat","disabled"),t=!this.dashboardApi.getGlassCoreSvc(".FeatureChecker").checkValue("dashboard","xtabcondFormat","disabled");return e||t},updateSubViews:function(){this.updateConditionalViewIndicator()},_processTemplateString:function(){if(this.templateString){var e=this.dotTemplate(this.templateString);e||(e=this.templateString),this.$el.html(e);var i=this.el.querySelectorAll("div[data-attach-point]"),a={};t.each(i,(function(e){a[e.getAttribute("data-attach-point")]=e})),t.extend(this,a)}},resize:function(e){if(e){var t=e.height||this.$el.parent().height();this._tabs&&this._tabs.getTabsCount()>0&&this.ownerWidget.allowShowTabs&&this.ownerWidget.allowShowTabs()&&this.isMappingComplete()&&(t-=this._tabs.$el.height());var i=function(e,t,i){void 0!==i&&i!==parseInt(e[t],10)&&(e[t]=i+"px")},a=this.el.style;i(a,"left",e.left),i(a,"top",e.top),i(a,"width",e.width),i(a,"height",t)}},remove:function(){var e=this,t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];for(var i in this.removeIconView(),m.inherited("remove",this,arguments),v.forEach((function(t){e[t]&&e[t].remove(),e[t]=null})),this.visModelEvents)this.visModelEvents.hasOwnProperty(i)&&this.visModel.off(i,this.visModelEvents[i],this);this.ownerWidget.model.off("change:searchFilters",this.onChangeLocalFilter,this),this.ownerWidget.model.off("change:localFilters",this.onChangeLocalFilter,this),this.ownerWidget.model.off("change:properties",this.onChangeProperties,this),this.ownerWidget.model.off("change:fillColor",this.onChangeProperties,this),this.ownerWidget.model.off("change:conditions",this.onChangeConditions,this),this.ownerWidget.model.off("change:possibleKeyDrivers",this.onChangePossibleKeyDrivers,this),this._tabs&&(this._tabs.remove(),this._tabs=null);var a=this.ownerWidget.content;a&&a.off("all",this.onAllContentChanges,this);var o=this.dashboardApi.getFeature("VisDefinitions");o.off("refresh:definition",this.onRefreshVisDefinition,this),o.off("refresh:all",this.onRefreshAllVisDefinition,this);var n=this.dashboardApi.getFeature("Colors");n.off("theme:changed",this.onChangeProperties,this),t&&g.destroy(this)},onChangePageContext:function(e){var t=this;return this.onChangeFilter(e).catch((function(e){var i=e&&"dwErrorStaleRequest"===e.message?"debug":"error";t.logger[i](e)}))},_rebuildVis:function(e,t){this._rebuildPending=!0;var i=t&&t.extraInfo&&t.extraInfo.payloadData&&t.extraInfo.payloadData.transactionToken;return this.transactionApi.registerTransactionHandler(i||{},this.ownerWidget.id+"_rebuildvis",function(){var t=this;this.ownerWidget._rebuildVis(e).then((function(){t._rebuildPending=!1}))}.bind(this),t)},_getRenderTransaction:function(e){var t=e&&e.extraInfo&&e.extraInfo.payloadData&&e.extraInfo.payloadData.transactionToken;return!t||t.transactionId?t:null},_reRender:function(e){if(!this._rebuildPending)if(this.ownerWidget.isVisible()){var t=this._getRenderTransaction(e);if(!t||this.transactionApi.isValidTransaction(t))return this.transactionApi.registerTransactionHandler(t||{},this.ownerWidget.id,function(e){return this.ownerWidget?this.ownerWidget.getAPI().getVisApi().getRenderSequence().reRender(this._mergeOptions(e)):Promise.resolve()}.bind(this),e)}else this.ownerWidget.setReRenderOnShow(e);return Promise.resolve()},_mergeOptions:function(e){var t=e[0],i=e.length;if(i>1)for(var a=1;a0&&0===t&&(this.animationSpeed=this.overrideDefaultAnimationSpeed)},isAnimationEnabledForNonVIPRVisualizations:function(){return this.animationType&&this.animationType!==this.ANIMATION_TYPES.NONE},animate:function(t){var i=this;if(this.visModel.renderCompleteBeforeAnimation(),this.isAnimationEnabledForNonVIPRVisualizations()){this.updateAnimationSettings(),e(this.el).fadeOut(0),e(this.el).fadeIn(this.animationSpeed,(function(){i.visModel.renderComplete(t)}))}},renderSelected:function(){},renderFocused:function(){},render:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return this.animate(e),this.updateConditionalViewIndicator({data:e.data}),t&&!this.isAnimationEnabledForNonVIPRVisualizations()&&this.visModel.renderComplete(e),Promise.resolve(this)},removeIconView:function(){this.hasUnavailableMetadataColumns()||this.hasMissingFilters()||this._removeMissingDataColumnWarning(),this.$iconView&&(this.$el.find('div[role="application"]').removeClass("hide"),this.$el.parent().removeClass("showIconView"),this.$iconView.remove(),this.$iconView=null),this._removeVisualizationDropZones()},_removeVisualizationDropZones:function(){var e=this.content.getFeature("DropZonesOverlayState");e&&e.isEnabled()&&e.hide()},_renderWarningContainer:function(t){this._removeWarningContainer(),this.$warningContainer=e("
",{class:"warningContainer"}),t.append(this.$warningContainer)},_removeWarningContainer:function(){this.$warningContainer&&(this.$warningContainer.remove(),this.$warningContainer=null)},_renderMissingDataColumnWarning:function(t){this._removeMissingDataColumnWarning(),this.hasMissingFilters()&&this.filterIndicator&&this.filterIndicator.$filter&&this.filterIndicator.$filter.addClass("dataWidgetFiltersNone"),this.$dataUnavailable=e("
",{class:"data-unavailable"}),this._renderWarningContainer(t),this.$warningContainer.append(this.$dataUnavailable);var i=e("
",{"aria-label":s.get("warning"),class:"warningIcon"});this.$dataUnavailable.append(i),r.setIcon(i,"common-warning",s.get("warning"));var a=e("
",{class:"warningText",text:s.get("datasetItemsUnavailable")});this.$dataUnavailable.append(a)},_removeMissingDataColumnWarning:function(){this.$dataUnavailable&&(this.$dataUnavailable.remove(),this.$dataUnavailable=null),this._removeWarningContainer()},renderIconView:function(){this._tabs&&this._tabs.hide();var e=this._prepareRenderIconView();this._renderIconView(e),this._renderVisualizationDropZones()},_renderVisualizationDropZones:function(){var e=this.content.getFeature("DropZonesOverlayDOM"),t=this.content.getFeature("DropZonesOverlayState");t&&t.isEnabled()&&!this.hasMissingFilters()&&(e.isMounted()?t.show():e.render())},updateSmartAnnotationsIndicator:function(){var e=this.content.getFeature("SmartsIndicator");e&&e.update()},updateConditionalViewIndicator:function(e){var t=this.content.getFeature("ConditionalViewIndicator");t&&t.update(e)},updateForecastIndicator:function(){this.forecastIndicator&&this.forecastIndicator.update()},_renderIconView:function(e){e.append(this.$iconView),this.$el.find('div[role="application"]').addClass("hide"),this.$el.parent().addClass("showIconView"),this.visModel.renderCompleteBeforeAnimation(),this.visModel.renderComplete()},getContentNode:function(){return this.contentNode?e(this.contentNode):this.$el},_prepareRenderIconView:function(){var t=this.visualization.getDefinition(),a=t.getPlaceholderIconUri(),o=t.getLabel(),n=this.getContentNode();this.hasUnavailableMetadataColumns()||this.hasMissingFilters()?this._renderMissingDataColumnWarning(n):this.$dataUnavailable&&this._removeMissingDataColumnWarning();var r=i.template(c);return this.$iconView&&this.$iconView.remove(),this.$iconView=e(r({icon:a,caption:o,title:s.get("LIVE_empty_visualization_hint_title"),description:s.get("LIVE_empty_visualization_hint_description")})),n},hasMissingFilters:function(){return this.ownerWidget.getUnavailableLocalFilter().length>0},resizeToWidget:function(e){this.resize(e.widgetSize)},getLabel:function(){var e=this.visualization.getDefinition();return e?e.getLabel():s.get("visualizationLabel")},getDescription:function(){var e=this.getLabel(),t=this._getColumnInformationForLabel();return s.get("dataWidgetDescription",{widgetLabel:e,columnNames:t})},_getColumnInformationForLabel:function(){for(var e="",t=this.visualization.getSlots().getMappingInfoList(),i=0;i0&&(e+=", "),e+=t[i].dataItem.getLabel();return e},getCurrentViewSelector:function(){return null},getProperties:function(){return this.visModel.getDefinition().properties?Promise.resolve(this.visModel.getDefinition().properties.slice(0)):Promise.resolve([])},hasBinnedDataItems:function(){return!!this.visualization.getSlots().getMappingInfoList().find((function(e){return!!e.dataItem.getBinning()}))},generateThumbnail:function(){var e=this,t=!1,i=!1;this._isThumbnailDisabled()&&(t=!0),this.isMappingComplete()||(i=!0);return(t||i?Promise.resolve():this.dashboardApi.getDashboardSvc(".Thumbnail").then((function(t){return t.generateMarkup(e.$el.get(0))}))).then((function(e){return{isMappingIncomplete:i,isDisabled:t,thumbnail:e}}))},_isThumbnailDisabled:function(){if(h.isIE()&&!h.isIEEdge()){var e=this.visModel.getDefinition();if(e&&e.thumbnailConfig){var t=e.thumbnailConfig.unsupportedBrowsers;return-1!==(void 0===t?[]:t).indexOf("IE")}}return!1},onSummaryDataCellError:function(){var e=s.get("errorCellWarning");this.infoIndicator.addInfo([{id:"error_summary_cell",title:e,items:[{id:"error_summary_cell",label:e,isSubMessage:!0}]}])},appendExtraInfoToRenderOptions:function(e,i,a){return(i=i&&i.changeEvent||i)&&i.data&&(e.extraInfo?e.extraInfo.payloadData=i.data:e.extraInfo={payloadData:i.data}),e&&e.extraInfo&&a&&(e.extraInfo=t.extend(e.extraInfo,a)),e}});return m})),define("dashboard-analytics/dataSources/ModuleUtils",["underscore"],(function(e){"use strict";var t={SHAPING:{DATAITEM_CHANGED:0},updateDataItemId:function(e,t){var i=e,a=i.split(".");return i.replace(a[0],t)},getColumnPropertyValue:function(t,i){var a;return t.moserObject.getProperty&&(a=e.find(t.moserObject.getProperty(),(function(e){return e.getName()===i}))),a?a.getValue():null}};return t})),define("dashboard-analytics/visualizations/vipr/VIPRDataRequestHandler",["underscore","../../lib/@waca/core-client/js/core-client/ui/core/Class","../../dataSources/ModuleUtils","../../widgets/livewidget/query/QueryFilterSpec","../../widgets/livewidget/nls/StringResources","./VIPRUtils"],(function(e,t,i,a,o,n){"use strict";return t.extend({CATALYST_OP:{KEYDRIVER:"GetKeyDrivers",DECISIONTREE:"GetDecisionTree"},GEO_AMBIGUOUS_ID:"geo_ambiguous",GEO_UNMATCHED_ID:"geo_unmatched",PREDICT_ERROR_ID:"predict_error",PREDICT_WARNING_ID:"predict_warning",TILED_MAP_ATLAS:"tiledMap_atlas",TYPE_ATLAS:"atlas",_lastRequestData:{},init:function(e){this.logger=e.logger,this.visAPI=e.visAPI,this.queryService=this.visAPI.getQueryManager().queryService,this.visView=e.visView,this.dashboardApi=this.visAPI.ownerWidget.getDashboardApi(),this._callbacks={Atlas:this._geoQueryCallback.bind(this),MapPolygons:this._geoQueryCallback.bind(this),Catalyst:this._fastPredictCallback.bind(this)},this._customData=null},resetCustomData:function(){this._customData=null},_geoQueryCallback:function(t,i){if(t&&t.infoIndicator&&i){var a=[{id:this.GEO_AMBIGUOUS_ID,property:"ambiguous",resourceId:"geomapAmbiguousLocations"},{id:this.GEO_UNMATCHED_ID,property:"unmatched",resourceId:"geomapUnrecognizedLocations"}];t.infoIndicator.addInfo(e.map(a,(function(t){return{id:t.id,label:o.get(t.resourceId),items:e.map(i[t.property],(function(e){return{id:"_"+e.replace(/\s/g,"_"),label:e}}))}})))}},_addErrorsAndWarningsForCandidates:function(t,i,a){e.each(i,(function(i){var n=a[i.property];n&&n.length&&t.infoIndicator.addInfo([{id:i.id,label:o.get(i.resourceId),items:e.map(n,(function(e){return{id:e.id,label:e.caption}}))}])}))},_addFPDInsightMessages:function(e){if(n.doesConfigPropertyMatchExpected(this.visAPI.getVisId(),"shouldLogFPDInsightMessages",!0)){var t=this.visAPI.getSmartAnnotationsManger();if(t){var i=null;e&&e.messages&&e.messages.length>0&&(i=e.messages),t.addFPDInsightMessages(i),this.visView.updateSmartAnnotationsIndicator()}}},_fastPredictCallback:function(e,t){if(e&&e.infoIndicator&&t&&t.predictStatus){this._addFPDInsightMessages(t.predictStatus);var i=t.predictStatus,a=[{id:this.PREDICT_ERROR_ID,property:"errors",resourceId:"predict_errors"},{id:this.PREDICT_WARNING_ID,property:"warnings",resourceId:"predict_warnings"}];this._addErrorsAndWarningsForCandidates(e,a,i)}},request:function(e){switch(e.name){case"Schematics":this._handleSchematicRequest(e);break;case"Atlas":case"MapPolygons":this._handleGeoRequest(e);break;case"Catalyst":this._handleKeyDriversRequest(e);break;default:this._requestFail(e)}},_logNotification:function(e,t,i){var a=this;switch(e){case"warn":this.logger.warn(t),i&&i.truncations&&i.truncations.forEach((function(e){a.logger.warn(e.toString())}));break;case"error":this.logger.error(t),i&&i.truncations&&i.truncations.forEach((function(e){a.logger.error(e.toString())}))}},_addNotifyMessagesToInfoIndicator:function(t,i,a,n,s){var r=this;if(this.visView&&this.visView.infoIndicator&&i){var l=[];l.push(this._getMessageLabel(i,!1,n,s)),a&&a.truncations&&a.truncations.forEach((function(e){(function(e){l.push(this._getMessageLabel(e,!0))}).bind(r)(e.toString())})),this.visView.infoIndicator.addInfo(e.map([{id:"visualization_notifications",property:"visualizationnotifications",resourceId:"visualizationNotifications"}],(function(e){return{id:e.id,label:o.get(e.resourceId),items:l}})))}},_getMessageLabel:function(e,t,i,a){return{id:i||"_"+e.replace(/\s/g,"_"),type:a,label:e,isSubMessage:t||!1}},_isNotificationAGeoWarning:function(e,t){return"warn"===e&&t===this.TILED_MAP_ATLAS},notify:function(e){this._logNotification(e.level,e.localizedMessage,e.payload),"clear"===e.type?this._clearIndicatorWarning(e):this._isNotificationAGeoWarning(e.level,e.id)||this._addNotifyMessagesToInfoIndicator(e.level,e.localizedMessage,e.payload,e.id,e.type)},_clearIndicatorWarning:function(e){var t=this;e.payload&&e.payload.length&&e.payload.forEach((function(e){e.id===t.TILED_MAP_ATLAS&&e.type===t.TYPE_ATLAS?t.visView.infoIndicator.clearMessagesWithIds([t.GEO_AMBIGUOUS_ID,t.GEO_UNMATCHED_ID]):t.visView.infoIndicator.clearMessagesByIdAndSubtype(e)}))},_setDefaultSelections:function(){if(this.dashboardApi.getConfiguration("enableCustomDataSelection")||n.supportsCustomDataSelection(this.visAPI.getVisId())){var e=this.visAPI.getDecoratedCustomData("selected");if(!(!this.visView||!this.visView.getRenderingNewData())&&0===e.length&&this._customData.length>0){var t=this._customData[0],i=[],a=[];t.hasOwnProperty("valueFloored")?a=(i=this._customData.filter((function(e){return e.valueFloored===t.valueFloored}))).map((function(e){return{id:e.id,value:!0}})):(i.push(t),a.push({id:t.id,value:!0})),this.visAPI.setCustomDataDecoration("selected",a,{silent:!0}),e.push.apply(e,i)}e.forEach(function(e){e.setDecoration&&e.setDecoration("selected",!0)}.bind(this))}},setCustomData:function(e,t){this._customData||(this._customData=t,this._setDefaultSelections())},getCustomData:function(){return this._customData},_invokeCallback:function(e,t){var i=this._callbacks[e];i&&i(this.visView,t)},_requestComplete:function(e,t){var i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(i&&this.setLastRequestData(e.name,t),"Catalyst"===e.name){var a=this._getCatalystOperation(e),o=this._getFastPatternDetectionMethods(a);t=this._filterPredictResults(t,o)}this._invokeCallback(e.name,t),e.complete(t)},_requestFail:function(e,t){var i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];i&&this.setLastRequestData(e.name,null),this._invokeCallback(e.name,t),e.fail(t)},setLastRequestData:function(e,t){this._lastRequestData[e]=t},getLastRequestData:function(e){return this._lastRequestData[e]},_handleSchematicRequest:function(e){var t=this,i=this.visView.visualization.getDefinition().getProperty("getSchematicContent");if(i&&e.payload)return i(e.payload,this.dashboardApi).then((function(i){t._requestComplete(e,i)}),(function(i){t._requestFail(e,i)}));this._requestFail(e,new Error(o.get("schematicServiceRequestError")))},_getGeoEndpoint:function(){var e=this.dashboardApi.getConfiguration("geoService");return"CA"===e?null:e},_handleGeoRequest:function(e){this.visView.infoIndicator.clearMessagesWithIds([this.GEO_AMBIGUOUS_ID,this.GEO_UNMATCHED_ID]),this.queryService.runGeoQuery(e.payload,this._getGeoEndpoint()).then(function(t){e.payload.useMapBoxPB&&Object.defineProperty(t,"results",Object.getOwnPropertyDescriptor(t,"mapboxData")),this._requestComplete(e,t)}.bind(this),function(t){this._requestFail(e,t)}.bind(this))},_getCatalystOperation:function(e){return e&&e.payload&&e.payload.catalystOperation},_getFastPatternDetectionMethods:function(e){return e===this.CATALYST_OP.DECISIONTREE?["tree"]:["drivers","tree"]},_handleErrorPossibleKeyDriverRequest:function(e,t){var i=this.visAPI.ownerWidget.getCurrentVis();if(i&&i.infoIndicator){var a=t.error.caption,n=t.error&&t.error.categoryId?t.error.categoryId:"predict_error";i.infoIndicator.addInfo([{id:n,label:o.get(n),items:[{id:"_"+a.replace(/\s/g,"_"),label:a}]}])}this._requestComplete(e,{result:[],predictStatus:{}})},_handleEmptyPossibleKeyDriverRequest:function(e){this._requestComplete(e,{result:[],predictStatus:{}})},_fpdRequestFailed:function(e,t){if(this.visView&&this.visView.infoIndicator){var i={label:o.get("predict_errors"),id:this.PREDICT_ERROR_ID,items:[]};t&&t.errors&&t.errors.length?t.errors.forEach((function(e){i.items.push({id:e.code,label:e.message})})):i.items.push({id:t&&t.code||500,label:o.get("catalyst_service_error")}),this.visView.infoIndicator.addInfo([i])}this._requestFail(e,new Error(o.get("catalyst_service_internal_server_error")))},_handleKeyDriversRequest:function(e){var t=this;this.visView.infoIndicator.clearMessagesWithIds([this.PREDICT_ERROR_ID,this.PREDICT_WARNING_ID]);var i=this._getTargetId(e),a=this._getCatalystOperation(e),o=this._getFastPatternDetectionMethods(a),n=this.visAPI.getEnabledPossibleKeyDrivers(i);if(n.errorState&&n.errorState.inErrorState)this._handleErrorPossibleKeyDriverRequest(e,n.errorState);else{var s=n.possibleKeyDrivers;try{this.visAPI.executeFastPatternDetectionRequest(i,s,o).then((function(i){t._requestComplete(e,i)}),(function(i){t._fpdRequestFailed(e,i&&i.data)}))}catch(e){this.logger.error(e)}}},_getValidPredictResultTypes:function(t){var i=[];return e.each(t,(function(e){switch(e){case"tree":i.push("TREE");break;case"oneway":i.push("ONE_WAY");break;case"twoway":i.push("TWO_WAY");break;case"drivers":i.push("ONE_WAY"),i.push("TWO_WAY")}})),i},_filterPredictResults:function(t,i){var a=this._getValidPredictResultTypes(i);return a&&a.length>0&&(t.results=e.filter(t.results,(function(e){return a.indexOf(e.type)>-1}))),t},_getTargetId:function(e){var t,a=e.payload.catalystPayload.target,o=this.visAPI.getModule().getMetadataColumns((function(e){return e.getId()===a}));return o.length&&(t=i.getColumnPropertyValue(o[0],"wa_attributeUniqueName")),t||a},_addLocalFiltersToRequest:function(e){var t=this._getWidgetLocalFilters();t&&(e.sessionShapingChange=!0,e.localFilters=this._normalizeFilters(t))},_getWidgetLocalFilters:function(){var e=this.visAPI.getLocalFilters(),t=new a;return t.addFiltersToSpec(e),t.hasFilterSpec()?t.getFilterSpec():null},_normalizeFilters:function(t){var i=[];e.each(t,function(e){e=this._doSort(e),i.push(JSON.stringify(e))}.bind(this)),i.sort();var a=[];return e.each(i,(function(e){a.push(JSON.parse(e))})),a},_doSort:function(t){var i,a=[],o=e.keys(t);o&&o.length>1&&o.sort();for(var n=0;nthis.viprData.getDataSetCount()||!this._isViprWidgetValid())return null;var i=this.viprData.getDataSetAt(e);if(i){var a=i.getDataPointIterator()&&i.getDataPointIterator().datapoints;return{decorateItem:function(a,o,n){t.dataItemDecorations[e]||(t.dataItemDecorations[e]={}),t.dataItemDecorations[e][a]||(t.dataItemDecorations[e][a]={});var s=i.getDataItem(a),r=s&&s.decorate(o,n);t.dataItemDecorations[e][a][o]=r},decoratePoint:function(e,t,i){return a&&a[e]&&a[e].decorate&&a[e].decorate(t,i)},decorate:function(e,t){return i.decorate(e,t)},clearItemDecoration:function(a){if(t.dataItemDecorations[e]){var o=void 0;for(o in t.dataItemDecorations[e]){var n=i.getDataItem(o);n&&n.decorate(a,""),delete t.dataItemDecorations[e][o][a]}}},updateDecorations:function(){return t.renderVIPRControl()}}}return null},getDecoratorAPIs:function(){var e=[];if(this.viprData&&this.viprData.getDataSetCount)for(var t=0;t0&&void 0!==arguments[0])||arguments[0];this.visModel.off("change:theme",this.onChangeTheme,this),this._isSmartTitleEnabled()?this.visModel.off("change:titleMode",this.onShowTitle,this):this.visModel.off("change:showTitle",this.onShowTitle,this),this.visModel.off("change:customData",this.onChangeCustomData,this),this._cleanupVIPRWidget(e),w.inherited("remove",this,arguments)},_cleanupVIPRWidget:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.eventHandler&&this.eventHandler.remove(),this.$customVisPreviewMessage&&(f.unmountComponentAtNode(this.$customVisPreviewMessage[0]),this.$customVisPreviewMessage.remove(),this.$customVisPreviewMessage=null),this._destroyCustomVisShowError(),this.viprWidget&&(e&&!this.viprControlRenderInProgress?(this.viprWidget.destroy(),this.viprWidget=null):-1===this._deferredDestroyViprWidgetsList.indexOf(this.viprWidget)&&this._deferredDestroyViprWidgetsList.push(this.viprWidget))},_destroyCustomVisShowError:function(){this.sdkShowError&&(this.sdkShowError.destroy(),this.sdkShowError=null)},_deferredDestroyVIPRWidgets:function(){t.each(this._deferredDestroyViprWidgetsList,(function(e){e.destroy()})),this._deferredDestroyViprWidgetsList=[]},_createVIPRWidget:function(){var a=this;if(!this.viprWidget){var r="VIPR_"+this.viewId;this.$el.append(e('
'));var c=s.getCursor(this.visAPI.getVisId());c&&t.forEach(c,(function(e){a.$el.get(0).style.cursor=e})),this.predictData&&(this.predictHandler.setLastRequestData("Catalyst",this.predictData),this.predictHandler=this._createPredictHandler(l,this.predictHandler)),this.viprWidget=n.createWidget(r,this.predictHandler);var u=this.dashboard.getGlassCoreSvc(".UserProfile");u&&(this.viprWidget.formatLocale=u.preferences.contentLocale),this.eventHandler=new o({target:new i({$el:this.$el,viprWidget:this.viprWidget,visAPI:this.visAPI,visualization:this.visualization,content:this.content}),transaction:this.transactionApi,ownerWidget:this.ownerWidget,visAPI:this.visAPI,logger:this.logger,dashboard:this.dashboard})}},whenVisControlReady:function(){var e=this;return this.initVizPromise||(this._createVIPRWidget(),this.initVizPromise=this.viprWidget.newViz(this.visAPI.getVisId(),"client").then((function(t){return e.viprData=null,e.vizBundle=t,e.visController})).catch((function(t){if("visualizationPreview"===e.visAPI.getVisId())return e.logger.error(t,e),e.visController;throw t}))),this.initVizPromise},createViprData:function(e){var t=e.getQueryResults?s.createData(e.getQueryResults(),this.visualization,this.content):s.createQueryResultData(e,this.visualization,this.content);return t.hasMoreData=e.hasMoreData,t.queryThreshold=e.queryThreshold,t},canRender:function(){return this._hasMappedSlots()&&this.isMappingComplete()},whenDataReady:function(){var e=this;return w.inherited("whenDataReady",this,arguments).then((function(t){var i=t.data,a=t.sameQueryData,o=void 0;return!e.canRender()||e.hasUnavailableMetadataColumns()||e.hasMissingFilters()?o={data:{}}:(e._dataObject=i,a?o={data:i,sameQueryData:a}:(e.predictHandler.resetCustomData(),e._viprSlotMapping=s.createSlotMapping(e.visualization),o={data:i})),o}))},_setModelProperty:function(e,t){if(this._shouldPropertyBeApplied(e)){var i={id:e,value:this._getPropValueWhenSaving(t,e)};this.setProperty(i)}},_setPreDataProperties:function(){var e=this,t=this.visAPI.getVisId(),i=d.getConfig(t);i&&i.propertiesToSetBeforeData&&i.propertiesToSetBeforeData.length>0&&i.propertiesToSetBeforeData.forEach((function(i){e._setModelProperty(i,t)}))},whenSetDataReady:function(e){var t=Promise.resolve(!0);if(!this.canRender()||this.hasUnavailableMetadataColumns()||this.hasMissingFilters()){var i=this.isMappingComplete()&&this.visualization.getSlots().getMappingInfoList().length>0;this.isRenderWithoutCompletingMapping()&&!i&&(this.viprWidget.setData(null),this.infoIndicator&&this.infoIndicator.reset())}else{var a=!!!!(e&&e.extraInfo&&e.extraInfo.queryRefresh)&&!!e.sameQueryData;if(!this.viprData||!a)if(this._isAnnotated=!1,this._setPreDataProperties(),this._dataObject=e.data,this._viprSlotMapping=s.createSlotMapping(this.visualization),this.viprData=this.createViprData(this._dataObject),this.viprData)try{this.viprWidget.setData(this.viprData,this._viprSlotMapping)}catch(e){t=Promise.reject(e)}else t=Promise.reject(new Error("Unable to create VIPR data in whenSetDataReady"))}return t},_getAnnotationMessages:function(e){return e.getMessages()||{}},whenAnnotatedResultsReady:function(){var e=this;return w.inherited("whenAnnotatedResultsReady",this,arguments).then((function(i){return i&&(e._dataObject=i._aQueryResults&&i._aQueryResults.length?i:e._dataObject,t.isEmpty(e.content.getFeature("Forecast").getForecastInfo().annotations)||(e.viprData=e.createViprData(e._dataObject),e.viprWidget.setData(e.viprData,e._viprSlotMapping)),e._queryResults=i.getQueryResults(),e._isAnnotated=!0,e.visAPI.setAnnotationMessages(e._getAnnotationMessages(i))),i})).catch((function(e){throw e}))},onShowTitle:function(e){this._hasUserTitle="noTitle"!==e.value,this._hasUserTitle&&(this._hasAnnotationTitle=!1)},animate:function(){},_readyForRender:function(){return(this.canRender()||this.isRenderWithoutCompletingMapping())&&!this.hasUnavailableMetadataColumns()&&!this.hasMissingFilters()},_updateViprProp:function(e,t){void 0!==e&&void 0!==t&&this.visModel.ownerWidget.updateVisProperties({id:e,value:t&&t.name?t.name:t},{merge:!0,remove:!1,silent:!1})},_onViprPropValueChange:function(e){var t=e.property.getName(),i=e.property.getValue();"length"===e.property.type&&(i=i?i.toString():i),this._updateViprProp(t,i)},_allowShowTabs:function(){return this.ownerWidget.allowShowTabs&&this.ownerWidget.allowShowTabs()},_renderTabs:function(){this._tabs.getTabsCount()>0&&this._allowShowTabs()?(this._tabs.show(),this._tabs.selectTab(this.visModel.getPropertyValue("actions"))):this._tabs.hide()},render:function(e){var t=this;return w.inherited("render",this,[e,!1]),this._destroyCustomVisShowError(),this.viprWidget?(this._renderCustomVisContext()&&(e.widgetSize.height=this.$el.closest(".liveWidgetContent").height()),this.resizeToWidget(e),this._readyForRender()?(this._renderTabs(),this.removeIconView(),this.propChangeslistener||this._registerListenerForPropChanges(),this._applySavedModelProperties(e).then((function(){if(t.visModel.getRenderSequence().isActive()){var i=t.visAPI.ownerWidget.model.augmentation;if(i&&i.length>0)for(var a=0;a"),this.$customVisPreviewMessage.addClass("customVisPreviewMessage"),i.prepend(this.$customVisPreviewMessage),f.render(_.createElement(y,{iconsFeature:t}),this.$customVisPreviewMessage[0])),!0}return!1},reveal:function(){var e=this;if(h.isIE11()||!this._readyForRender()||!this._getEntryDurationProperty()||!this.viprData)return this.visAPI.renderCompleteBeforeAnimation(),Promise.resolve();var t=this.viprWidget.processData(this.viprData,this._viprSlotMapping).empty();return this.viprWidget.setData(t,this._viprSlotMapping),this._applyEntryDurationProperty("zero"),this.renderVIPRControl().then((function(){return e._applyEntryDurationProperty("model"),e.viprWidget.setData(e.viprData,e._viprSlotMapping),e.renderVIPRControl(),{renderControlApi:e.renderControlApi}})).catch((function(t){throw e.viprWidget.setData(e.viprData,e._viprSlotMapping),t}))},getCurrentViewSelector:function(){return this.eventHandler},_getDatapointKeyFromSmartAnnotationsResult:function(e){return e?t.filter(e.pt,(function(e){return"number"==typeof e})).toString():""},_decorateDatapoints:function(e,i){for(var a=e.getDataPointIterator(),o=this.getSelector().getSelection(I.getColumnIdList(e.slots||this.visualization.getSlots().getMappedSlotList(),"attribute")),n=this._isAnnotated?this._queryResults[i]:null,s=n?n.getFacetData():null,r=s?s.getDatapoints():null,l=a.nextValue(),c=0;null!==l;){if(l.decorate&&l.hasDecoration){if(r&&r[c]&&l.getDataPointKey()===this._getDatapointKeyFromSmartAnnotationsResult(r[c])){var u=r[c++].deco;void 0!==u?t.each(u,(function(e,t){l.decorate(t,e)})):l.clearDecorations()}else l.clearDecorations();o&&o.isSelected(a.getTupleItems())?l.decorate("selected",!0):l.hasDecoration("selected")&&l.decorate("selected",!1)}l=a.nextValue()}return!!o},_decorateDataItems:function(e,i){for(var a=this,o=!1,n=this._isAnnotated?this._queryResults[i]:null,s=n?n.getFacetData():null,r=function(n){var r=e.getDataItem(n);if(s){var l=s.getResultDataItem(n);if(l){var c=l.getDecoration();t.isEmpty(c)?r.clearDecorations():t.each(c,(function(e,t){r.decorate(t,e)}))}}else r.clearDecorations();if(a.dataItemDecorations[i]&&a.dataItemDecorations[i][n]){var u=a.dataItemDecorations[i][n],d=void 0;for(d in u)null!==u[d]&&void 0!==u[d]&&r.decorate(d,u[d])}"cat"===r.getType()&&function(){for(var e=[],t=r.getItemClassSet(),i=0;i1&&void 0!==arguments[1]?arguments[1]:{dataPoints:!0,dataItems:!0,selection:!0,annotations:!0},a=void 0,o=0;o0&&void 0!==arguments[0]?arguments[0]:{callRenderComplete:!1},i=t.renderInfo,a=t.callRenderComplete;return this.renderControlApi&&this.renderControlApi.complete&&this.renderControlApi.complete(),this.viprControlRenderInProgress=!0,this.renderControlApi=this.viprWidget.render("client"),this.renderControlApi.onprogress=function(t){"animating"===t.status&&e.visAPI.renderCompleteBeforeAnimation()},this.renderControlApi.then((function(){a&&e.visAPI.renderComplete(i),e._deferredDestroyVIPRWidgets(),e.viprControlRenderInProgress=!1})).catch((function(e){throw e}))},doesVisPropertyMatchExpected:function(e,t){return!(!e||!this.viprWidget)&&s.doesConfigPropertyMatchExpected(this.visualization.getDefinition().getId(),e,t)},canApplyAutoBin:function(){var e=s.canApplyAutoBin(this.visualization.getDefinition().getId()),i=this.visualization.getDefinition(),a=this.visualization.getSlots().getMappedSlotList(),o=!1;return i.getProperty("canApplyBinning")&&t.find(a,(function(e){var t=e.getDefinition().getRole();if("ordinal"!==e.getDefinition().getType()&&("explanatory"===t||"group"===t)){var i=e.getDataItemList().find((function(e){return"fact"===e.getMetadataColumn().getType()}));return o=!!i}})),e&&o},getBinningConfig:function(){return s.getBinning(this.visualization.getDefinition().getId())},_getDefaultContinuousPaletteName:function(){return this.colorsService.getDefaultPaletteName("HeatPalette")},_getDefaultCategoricalPaletteName:function(){return this.colorsService.getDefaultPaletteName("ColorPalette")},_getContinuousColorPaletteDesc:function(e,t){var i=this,a=u.getInstance(),o=a.getDataLayerIdFromPaletteAndSlots(e,t),n=a.getContinuousColorPalettePropertyNameWithLayer(o),s=this.visModel.getPropertyValue(n)||this._getDefaultContinuousPaletteName();return this.colorsService.getPalette({paletteId:s,type:"HeatPalette"}).then((function(e){var t={type:""};if(e){t.type="cont",t.dataLayerId=o;for(var n=[],s=a.getHeatScalePalettePropertyNameWithLayer(o),r=i.visModel.getPropertyValue(s),l=e.fills,c=l.length,u=0;u=0&&(e="effect.duration")}return e},_isDurationPropertyValuePropValid:function(e){return!(void 0===e||e<0)},_applyEntryDurationProperty:function(e){var t=this._getEntryDurationProperty();if(t){var i=void 0,a=s.getOverridenDefaultForProperty(this.visAPI.getVisId(),"effect.duration").defaultValue||0;"zero"===e?(i=0,a=0):"model"===e&&(i=this.visModel.getPropertyValue(t)),this._isDurationPropertyValuePropValid(i)||(i=s.getOverridenDefaultForProperty(this.visAPI.getVisId(),t).defaultValue),this._isDurationPropertyValuePropValid(i)&&(this.setProperty({id:"effect.duration",value:a}),this.setProperty({id:t,value:i}))}},_applySavedSingleColorPalette:function(){var e=this;return this._getCategoricalColorPaletteDesc().then((function(t){return c.getInstance().setSinglePaletteResolvers(e.viprWidget,t)}))},_shouldPropertyBeApplied:function(e){var t=["legend.display","legend.position","effect.duration","effect.entry.line.duration","effect.entry.bar.duration"];return!(-1!==(t=t.concat(this._getDontApplyProperties())).indexOf(e))},_getDontApplyProperties:function(){var e=[];return s.getPalettes(this.viprWidget.properties,this.visualization.getDefinition().getId()).forEach((function(t){"colors.series"!==t.name&&e.push(t.name)})),e},_applySavedNonSingleColorPalette:function(){var e=this,t=[],i=this.visualization.getSlots().getSlotList();return s.getPalettes(this.viprWidget.properties,this.visualization.getDefinition().getId()).forEach((function(a){t.push(e._getPaletteDescForPalette(a,i).then((function(t){return t&&c.getInstance().setPaletteResolvers(a,t,i,e.visAPI.getFredIsRed()),t})))})),Promise.all(t)},_applySavedColorPalette:function(){return s.getSinglePalettes(this.viprWidget.properties,this.visualization.getDefinition().getId()).length>0?this._applySavedSingleColorPalette():this._applySavedNonSingleColorPalette()},_setOptimizedSizeProperty:function(e){var i=this._getPropValueWhenSaving(e,"optimizeSize");if(!i){var a=t.filter(this.visualization.getSlots().getMappedSlotList(),(function(e){return!0===e.getDefinition().getProperty("multiplier")}));(a&&a.length>0||this.visAPI.isOptimizeForSize())&&(i=!0)}var o={id:"optimizeSize",value:null==i||i};this.setProperty(o)},_getDefaultBackgroundColorInHex:function(){var e=this.colorsService.getPropertyForUIElement("widget","backgroundColor").value;return t.isObject(e)&&(e=e.color),"$"===e.substring(0,1)&&(e=this.colorsService.getValueForVariable("Color",e.substr(1))),"#"===e.substring(0,1)&&!isNaN(parseInt(e.substr(1),16))||"transparent"===e?e:null},_setBackgroundColor:function(){var e=this;if(this.highContrastEnabled){this.setProperty({id:"backgroundColor",value:void 0});var t=this.colorsService.getForegroundPropertiesForUIElement(),i={};this.visModel.getDefinition().themeMapping.forEach((function(e){i[e.id]=e.mapping})),t.forEach((function(t){i[t.id]?i[t.id].forEach((function(t){e.setProperty({id:t,value:void 0})})):e.setProperty({id:t.id,value:void 0})}))}else{var a=this.visModel.ownerWidget.model.fillColor,o={id:"backgroundColor",value:a?this.colorsService.getHexColorFromDashboardColorSet(a):this._getDefaultBackgroundColorInHex()};this.setProperty(o)}},_getColorToSave:function(e,i){var a=void 0;return t.isString(e)?(this.colorsService.isCustomColor(e)&&this.colorsService.addCustomColor(this.colorsService.getHexColorFromClassName(e)),a=this.colorsService.getHexColorFromDashboardColorSet(e)):(i&&(e=this.colorsService.makeSureColorIsValidInModel(e)),a=e),a},_applyColorSetProperty:function(e,t,i){var a=this._getPropValueWhenSaving(e,t);if(a){var o={id:t,value:this._getColorToSave(a,i)};this.setProperty(o)}},_applyColorSetProperties:function(e,t,i){var a=this;t.forEach((function(t){var o=a.visModel.getPropertyById(t);o&&o.colorClass&&a._applyColorSetProperty(e,t,i)}))},_getLengthPropWithPxUnit:function(e){return null!=e?e&&e.endsWith&&e.endsWith("px")?e:e+"px":null},_applyTargetMarkerThicknessProperties:function(e){var t=this._getPropValueWhenSaving(e,"target.marker.thickness");if(c.getInstance().isTargetThicknessInputValid(t)){var i={id:"target.marker.thickness",value:this._getLengthPropWithPxUnit(t)};this.setProperty(i)}},_applySavedLayerTransparencies:function(){var e=d.getConfig(this.visAPI.getVisId());e&&e.supportsLayers&&e.layerDescriptions.forEach(function(e){var t=this.visModel.getPropertyValue(e.colorRelatedProps.transparencyProp);if(null!=t){var i={id:e.colorRelatedProps.transparencyProp,value:100*t};this.setProperty(i)}}.bind(this))},_isPropValueValid:function(e,t){return(!t.checkForValidValue||t.checkForValidValue(e))&&void 0!==e},_isValidReadOnlyProperty:function(e){return e&&!1===e.isActive&&!0===e.isReadOnly&&this._isPropValueValid(e.defaultValue,e)},overrideWithVidaProperty:function(e){var i=this.visModel.getPropertyById(e),a=this.viprWidget.properties.get(e);if(a&&i){var o={active:a.active,caption:a.caption,defaultValue:a.defaultValue,description:a.description,name:a.name,type:a.type,possibleValues:a.possibleValues};void 0!==i.value&&t.extend(o,{value:a.value}),t.defaults(i,o)}},_getPropValueWhenSaving:function(e,t){var i=null,a=s.getOverridenDefaultForProperty(e,t);if(this._isValidReadOnlyProperty(a))i=a.defaultValue;else{this.overrideWithVidaProperty(t);var o=this.visModel.getPropertyValue(t);i=this._isPropValueValid(o,a)?o:a.defaultValue}return i},_registerListenerForPropChanges:function(){var e=this,i=this.visAPI.getListenForPropChangesFromDefinition();i&&(t.each(i,(function(t){e.viprWidget.properties.get(t).on("value",e._onViprPropValueChange.bind(e))})),this.propChangeslistener=!0)},_applySavedModelProperties:function(e){var t=this;return this._applySavedColorPalette().then((function(){var i=t.visAPI.getVisId(),a=d.getConfig(i),o=a&&a.config&&a.config.include?a.config.include:[];a&&a.isCustomVis&&a.bundleInclude&&(o=a.bundleInclude),o.forEach((function(e){t._setModelProperty(e,i)})),t._applySavedLayerTransparencies(),e&&e.extraInfo&&!0===e.extraInfo.preserveDrawingBuffer?t.setProperty({id:"webGL.preserveDrawingBuffer",value:!0}):t.setProperty({id:"webGL.preserveDrawingBuffer",value:!1}),t._setOptimizedSizeProperty(i),t._setBackgroundColor(),t._applyEntryDurationProperty(e&&e.extraInfo&&e.extraInfo.entryDuration),t._applyTargetMarkerThicknessProperties(i),a&&t._applyColorSetProperties(i,a.config.include,a.isCustomVis)}))},getProperties:function(){var e=this;return this.whenVisControlReady().then((function(){return c.getInstance().getProperties(e.viprWidget.properties,e.visualization.getSlots().getSlotList(),e.visualization.getDefinition().getId())})).then((function(t){var i=e.visModel.ownerWidget.getFeature("visPropertiesFilter");return i?i.filter(t):t}))},getPropertyList:function(){return c.getInstance().getPropertyList(this.viprWidget.properties,this.visualization.getSlots().getSlotList(),this.content)},getPropertyLayoutList:function(){return c.getInstance().getPropertyLayoutList(this.viprWidget.properties,this.visualization.getSlots().getSlotList(),this.content,this.dashboard)},onChangeTheme:function(){this.visModel.getRenderSequence().reRender()},setProperty:function(e){c.getInstance().setProperty(this.viprWidget,e)},generateThumbnail:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=t.size,a=void 0===i?{}:i,o=t.type,n=void 0===o?"svg":o,s=this.getThumbnailConfig(),r=s.enabled,c=void 0===r||r,u=!1,d=!c;this.isMappingComplete()||(u=!0);var h=void 0;if(d||u)h=Promise.resolve();else{var p=this.getThumbnailConfig(),g=p.type,v=p.properties,m=void 0===v?{}:v,f=a.width,_=a.height;g&&(n=g);var y=this._createPredictHandler(l,this.predictHandler);h=this.viprWidget.createHidden(f,_,n,!0,S,y).then((function(t){var i=Object.assign({},C,m);return Object.keys(i).forEach((function(e){var a=i[e];t.setProperty(e,a)})),t.render(n).then((function(i){var a=void 0;return i&&i.completed&&(a=e.processThumbnailData(i.data)),t.destroy(),a}))}))}return h.then((function(e){return{thumbnail:e,isMappingIncomplete:u,isDisabled:d}}))},processThumbnailData:function(e){var t=this;return e instanceof Blob?new Promise((function(i,a){try{var o=new FileReader,n=p.get("loadedThumbnailImage",{visType:t.visModel.getDefinition().label});o.addEventListener("loadend",(function(){i(''+n+'')})),o.readAsDataURL(e)}catch(e){a(e)}})):Promise.resolve(e)},getThumbnailConfig:function(){var e=(d.getConfig(this.visAPI.getVisId())||{}).thumbnail;return void 0===e?{}:e},_isSmartTitleEnabled:function(){var e=this.dashboard&&this.dashboard.getGlassCoreSvc(".FeatureChecker");return!(!e||!e.checkValue)&&!e.checkValue("dashboard","SmartTitle","disabled")},_isViprWidgetValid:function(){var e=this;return!this._deferredDestroyViprWidgetsList.find((function(t){return t.id===e.viprWidget.id}))}});return w})),define("dashboard-analytics/visualizations/renderer/summary/control/SummaryControl",["underscore","../../../../lib/@waca/core-client/js/core-client/ui/core/Class"],(function(e,t){"use strict";return t.extend({domNode:null,init:function(){e.extend(this,arguments[0])}})})),define("text!dashboard-analytics/visualizations/renderer/kpi/Kpi.html",[],(function(){return'
\n\t
\n\t\n\t\n
\n'})),define("text!dashboard-analytics/visualizations/renderer/kpi/kpiSparklineSpec.json",[],(function(){return'{\n\t"type": "live",\n\t"visId": "com.ibm.vis.rave2line",\n\t"data": {},\n\t"slotmapping": {},\n\t"properties": [\n\t\t{\n\t\t\t"id": "gridLines.visible",\n\t\t\t"value": false\n\t\t},\n\t\t{\n\t\t\t"id": "itemAxis.title.visible",\n\t\t\t"value": false\n\t\t},\n\t\t{\n\t\t\t"id": "markers.visible",\n\t\t\t"value": false\n\t\t},\n\t\t{\n\t\t\t"id": "valueAxis.zeroOrigin",\n\t\t\t"value": false\n\t\t},\n\t\t{\n\t\t\t"id": "valueAxis.title.visible",\n\t\t\t"value": false\n\t\t},\n\t\t{\n\t\t\t"id": "itemAxis.ticks.labels.visible",\n\t\t\t"value": false\n\t\t},\n\t\t{\n\t\t\t"id": "itemAxis.ticks.visible",\n\t\t\t"value": false\n\t\t},\n\t\t{\n\t\t\t"id": "valueAxis.ticks.labels.visible",\n\t\t\t"value": false\n\t\t},\n\t\t{\n\t\t\t"id": "valueAxis.ticks.visible",\n\t\t\t"value": false\n\t\t},\n\t\t{\n\t\t\t"id": "valueAxis.line.visible",\n\t\t\t"value": false\n\t\t},\n\t\t{\n\t\t\t"id": "itemAxis.line.visible",\n\t\t\t"value": false\n\t\t}\n\t],\n\t"fillColor": "transparent"\n}\n'})),define("dashboard-analytics/visualizations/renderer/common/NonVIPREventTarget",["./EventTarget","jquery","../../../util/KeyCodes"],(function(e,t,i){return function(e){function a(){_classCallCheck(this,a);for(var t=arguments.length,i=Array(t),o=0;o0&&void 0!==arguments[0]?arguments[0]:{};return e.gesture?e.gesture.target:e.target},a.prototype._canProcessKeyDown=function(e){return"keydown"===e.type&&e.keyCode===i.KEY_ENTER},a.prototype.processKeyDown=function(e){var t=this._canProcessKeyDown(e);return t&&this._getKeyDownEventCoordinates(e),t},a.prototype.mouseWithinBoundCheck=function(e){if(this.getTargetElement()){var t=this.getTargetElement().get(0).getBoundingClientRect();return e.pageX>t.left&&e.pageXt.top&&e.pageY{{!it.value||" "}}{{? it.shapeId }}{{?}}\n{{? it.showLabel }}\n
{{!it.label||" "}}
\n{{?}}\n'})),define("dashboard-analytics/visualizations/renderer/common/LabeledValueView",["jquery","underscore","doT","../../../lib/@waca/core-client/js/core-client/ui/core/View","text!./LabeledValue.html"],(function(e,t,i,a,o){var n=a.extend({templateString:o,init:function(e){n.inherited("init",this,arguments),this.$el.addClass("labeled-value"),this.dashboardApi=e.dashboardApi,this._value=e.value,this._valueStyle=e.valueStyle,this._showValueTranslationIcon=!!e.showValueTranslationIcon,this._label=e.label,this._labelStyle=e.labelStyle,this._showLabel=void 0===e.showLabel||e.showLabel,this._showLabelTranslationIcon=!!e.showLabelTranslationIcon,this._conditionalFormatting=e.conditionalFormatting},remove:function(){this.$el.removeClass("labeled-value"),n.inherited("remove",this,arguments)},render:function(){if(this.$el.empty(),this.$el.prepend(this.dotTemplate({value:this._value,valueStyle:this._valueStyle,label:this._label,labelStyle:this._labelStyle,showLabel:this._showLabel,shapeId:this._conditionalFormatting&&this._conditionalFormatting.shapeId,shapeColor:this._conditionalFormatting&&this._conditionalFormatting.color})),this._valueNode=this.$el.find(".labeled-value-value"),this._labelNode=this.$el.find(".labeled-value-label"),this.dashboardApi&&(this._showValueTranslationIcon||this._showLabelTranslationIcon)){var e=this.dashboardApi.getDashboardCoreSvc("TranslationService");this._showValueTranslationIcon&&e.appendTranslationIcon(this.$el.find(".labeled-value-value > span")),this._showLabelTranslationIcon&&this._showLabel&&e.appendTranslationIcon(this.$el.find(".labeled-value-label > span"))}return Promise.resolve(this)},setValue:function(e){this._value=e},setValueStyle:function(e){this._valueStyle=e},setShowValueTranslationIcon:function(e){this._showValueTranslationIcon=e},setLabel:function(e){this._label=e},setLabelStyle:function(e){this._labelStyle=e},setShowLabel:function(e){this._showLabel=e},setShowLabelTranslationIcon:function(e){this._showLabelTranslationIcon=e},setConditionalFormatting:function(e){this._conditionalFormatting=e},getShowLabel:function(){return this._showLabel},getValueNode:function(){return this._valueNode},getLabelNode:function(){return this._labelNode},hasShape:function(){return!(!this._conditionalFormatting||!this._conditionalFormatting.shapeId)}});return n})),define("dashboard-analytics/preview/error/ErrorView",["jquery","../../../app/nls/StringResources"],(function(e,t){return function(){function i(){_classCallCheck(this,i)}return i.prototype.renderContainer=function(t){return e('
Error: '+this.makeNlsMessage(t.msg)+"
")},i.prototype.makeNlsMessage=function(e){return e.params?t.get(e.str,e.params):t.get(e.str)},i}()})),define("dashboard-analytics/widgets/livewidget/StandaloneLiveWidget",["./LiveWidget","../../lib/@waca/core-client/js/core-client/ui/core/Events","../../lib/@waca/core-client/js/core-client/utils/LoadCSSPromise","./nls/StringResources","underscore","dashboard-core/js/canvas/Content","dashboard-core/js/dashboard/model/LayoutModel","dashboard-core/js/features/content/InlineFeatures","./models/LiveWidgetModel"],(function(e,t,i,a,o,n,s,r,l){var c=!1;return function(){function u(e){_classCallCheck(this,u),this._destroyed=!1,this.spec=JSON.parse(JSON.stringify(e.spec)),this.spec.id=o.uniqueId("LW"),this.spec.type="live",this.board=e.board,this.node=e.node,this._glassContext=e.glassContext,this.runtimeEnv=e.runtimeEnv,this.predictData=e.predictData,this.isPredictPreview=e.isPredictPreview,this._inlineContentFeatures=e.inlineContentFeatures||[],this._queryResults=e.queryResults,this._managesOwnQueries=e.managesOwnQueries,this._LayoutModelClass=e.layoutModelClass||s,this.runtimeEnv&&!this.runtimeEnv.dashboardApi&&(this.runtimeEnv.dashboardApi=this._glassContext.appController.getCurrentContentView().getDashboardApi()),this.runtimeEnv&&!this.runtimeEnv.dashboardFeatureLoader&&(this.runtimeEnv.dashboardFeatureLoader=this.runtimeEnv.dashboardApi.getFeature("DashboardFeatureLoader.internal")),this._defaultEventRouter=new t,this.interactivitySettings={isClickDisabled:!e.enableClick,isPanAndZoomDisabled:!e.enablePanAndZoom,isHoverDisabled:!e.enableHover,tabNavigation:e.tabNavigation},this.featureSet=e.featureSet}return u.prototype._createEnvironment=function(){var e=this;return this.runtimeEnv?Promise.resolve():this._glassContext.getSvc(".DashboardRuntime").then((function(t){var a={spec:t.getDefaultSpec()};return a.spec.widgets[e.spec.id]=e.spec,a.spec.name=e.board&&e.board.name||a.spec.name,a.spec.version=e.board&&e.board.version||a.spec.version,t.getRuntimeEnvironment(a).then((function(t){e.spec=t.boardModel.widgets[e.spec.id];var a=[];return e.runtimeEnv=t,t.cssStyles&&!c&&(c=!0,t.cssStyles.forEach((function(e){a.push(i.load(e,null,null,[{type:"text/css"}]))}))),Promise.all(a)}))}))},u.prototype.render=function(){var t=this,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this._createEnvironment().then((function(){return t._updateModelIds()})).then((function(){return t._createContent(i.isPreview)})).then((function(e){return t._queryResults&&(t._inlineContentFeatures=t._addQueryOverrideFeature()),Promise.all([e,e.registerFeatures(t._inlineContentFeatures)])})).then((function(a){var n=a[0];t._queryResults&&n.getFeature("QueryResultOverride").setQueryResults(t._queryResults),i.widgetModel=n.widgetModel,i.initialConfigJSON=n.widgetModel,i=o.extend(i,{dashboardApi:t.runtimeEnv.dashboardApi,eventRouter:t.runtimeEnv.eventRouter||t._defaultEventRouter,registry:t.runtimeEnv.dashboardApi.getWidgetRegistry?t.runtimeEnv.dashboardApi.getWidgetRegistry().live:{},contentFeatureLoader:t._createContentFeatureLoader(n),content:n});var s=void 0;if(t.widget)s=Promise.resolve();else{t.contentNode=t.contentNode||i.el,t.node.appendChild(t.contentNode);var r=t._liveWidgetClass||e;t.widget=new r(i),s=t.widget.initialize()}return s})).then((function(){if(!t._destroyed)return t.widget.onContainerReady({model:t.widget.model})})).then((function(){if(!t._destroyed)return t.widget.render(null,!1)})).then((function(){if(!t._destroyed)return t.widget.whenRenderComplete()})).catch((function(e){var t=e&&e.message;if("promptingIsDisabled"===t)throw e;var i=e&&e.datasetName;if(t&&i){var o=a.get(t,{datasetName:i});throw new Error(o)}throw e}))},u.prototype._addQueryOverrideFeature=function(){return this._inlineContentFeatures.push({containerId:"com.ibm.bi.dashboard.content-features",name:"QueryResultOverride",id:"com.ibm.bi.dashboard.content-features.queryResultOverride",class:"dashboard-analytics/features/widget/queryResultOverride/QueryResultOverride",types:["widget.live"]}),this._inlineContentFeatures},u.prototype._createContentFeatureLoader=function(e){var t=this;return{whenContentReady:function(){return Promise.resolve()},registerFeatureCollection:function(i,a){return t.runtimeEnv.dashboardApi.findGlassCollection(a).then((function(t){return e.registerFeatures(t||[])}))},registerFeature:function(t,i,a,o){return e.registerFeature(i,a,o)},registerDeprecatedFeature:function(t,i,a){return e.registerFeature(i,a,{},!0)}}},u.prototype._createContent=function(e){var t=this,i=this.runtimeEnv.dashboardApi;return i.findGlassCollection("com.ibm.bi.dashboard.content-features").then((function(a){var o=r.concat(a||[]),s=i.getFeature("internal").getBoardModel(),c=i.getFeature("Logger"),u=new t._LayoutModelClass({type:"widget",content:{features:{Visualization:{isPreview:!0===e}}}},s,c);return t.content=new n({contentFeatureCollection:o,dashboardFeatures:t.runtimeEnv.dashboardFeatureLoader,boardModel:s,layoutModel:u,canvas:i.getCanvas(),widgetModel:new l(t.spec)}),t.content.initialize().then((function(){return t.content}))}))},u.prototype.getTitle=function(){if(!this._destroyed)return this.widget.getTitle()},u.prototype.resize=function(){if(!this._destroyed)return this.widget?this.widget.resize():void 0},u.prototype.destroy=function(){this._destroyed||(this._destroyed=!0,this.content&&(this.content.destroy(),this.content=null),this.widget&&(this.widget.destroy(),this.widget=null),this.contentNode&&(this.contentNode.parentNode&&this.contentNode.parentNode.removeChild(this.contentNode),this.contentNode=null))},u.prototype.toJSON=function(){if(!this._destroyed)return this.widget.model.toJSON()},u.prototype._updateModelIds=function(){var e=this,t=this.runtimeEnv.dashboardApi,i=t.getFeature("DataSources"),a=i.getDataSourceList()||[],n=[];return this.spec.data&&this.spec.data.dataViews&&this.spec.data.dataViews.forEach((function(s){if(!s.modelRef&&s.model){var r=o.chain(a).filter((function(e){return e.getAssetId()===s.model.assetId})).map((function(e){return e.getId()})).value();r.length>0?(s.modelRef=r[0],delete s.model):s.model.type?e._convertModelToModelRef(s,i):n.push(e._getAssetType(s.model.assetId).then((function(t){s.model.type=t,e._convertModelToModelRef(s,i)})))}else if(s.modelRef&&!s.model){var l=t.getActiveDataSourceId();l&&l!==s.modelRef&&(s.modelRef=l)}})),Promise.all(n)},u.prototype._convertModelToModelRef=function(e,t){e.modelRef=t.addDataSource(e.model),delete e.model},u.prototype._getAssetType=function(e){return this.runtimeEnv.dashboardApi.getGlassCoreSvc(".Ajax").ajax({url:"v1/objects/"+e+"?fields=userInterfaces,defaultName,searchPath",type:"GET",headers:{Accept:"application/json"}}).then((function(e){if(e.data&&e.data.data&&e.data.data.length>0)return e.data.data[0].type}))},u}()})),define("dashboard-analytics/preview/LiveWidgetPreview",["./error/ErrorView","jquery","underscore","../lib/@waca/core-client/js/core-client/utils/BrowserUtils","../widgets/livewidget/StandaloneLiveWidget"],(function(e,t,i,a,o){var n={"com.ibm.vis.rave2bundletiledmap":"dashboard-analytics/images/placeholders/map.svg"};return function(i){function o(e){return _classCallCheck(this,o),_possibleConstructorReturn(this,i.call(this,e))}return _inherits(o,i),o.prototype.render=function(){if(this.contentNode=document.createElement("div"),this.contentNode.setAttribute("class","liveWidgetPreview"),this.contentNode.setAttribute("style","width:100%;height:100%; padding:0px"),this.contentNode.setAttribute("data-vis-id",this.spec.visId),this._isStaticView()){var t=this._getStaticView();return this.contentNode.appendChild(t),this.node.appendChild(this.contentNode),Promise.resolve()}var a={id:this.spec.id,el:this.contentNode,errorView:new e,featureSet:this.featureSet||[],interactivitySettings:this.interactivitySettings,optimizeForSize:!0,forceDisabledThumbnail:!0,isPreview:!0,isPredictPreview:this.isPredictPreview,predictData:this.predictData,managesOwnQueries:this._managesOwnQueries};return i.prototype.render.call(this,a)},o.prototype._isStaticView=function(){return!(!a.isIE()||!n[this.spec.visId])},o.prototype._getStaticView=function(){if(n[this.spec.visId])return t('
')[0]},o}(o)})),define("dashboard-analytics/visualizations/renderer/kpi/KpiViewFactory",["jquery","../common/LabeledValueView","../../../preview/LiveWidgetPreview"],(function(e,t,i){return function(){function e(){_classCallCheck(this,e)}return e.prototype.createSparklineView=function(e){return new i(e)},e.prototype.createLabeledValueView=function(e){return new t(e)},e}()})),define("dashboard-analytics/util/TextScrambler",["../lib/@waca/core-client/js/core-client/ui/core/Class","jquery"],(function(e,t){"use strict";var i="ABCDEFGHIJKLMNOPQRSTUVWXYZ",a="abcdefghijklmnopqrstuvwxyz",o="0123456789",n="!'#$*&()%+=,-./:;<=>?@[]^_`{}|~";return e.extend({init:function(e){this.ignoreSet=e.ignoreSet,this.el=e.el,this.text=e.el.innerText},scramble:function(){var e=this._applyIgnoreSet();this.queue=[];for(var t=1;t<=e.length;t++)this.queue.push({char:e[t-1],start:Math.floor(t/this.text.length*15)});this.frame=0,this._update()},_applyIgnoreSet:function(){var e=this.text;return this.ignoreSet&&t.each(this.ignoreSet,(function(t,i){e=e.replace(new RegExp("\\"+i,"g"),"")})),e},_update:function(e){!this.startTime&&e&&(this.startTime=e);var i="",a=!1;t.each(this.queue,function(e,t){this.frame>=t.start&&(i+=this._getRandomChar(t.char))}.bind(this)),e-this.startTime>485&&(i=this.text,a=!0),this.el.innerHTML=i,a||(this.frame++,this._setTimeout(function(){this.frameRequest=this._requestAnimationFrame(this._update.bind(this))}.bind(this),25))},_requestAnimationFrame:function(e){return window.requestAnimationFrame(e)},_getRandomChar:function(e){return" "===e?e:e>="0"&&e<="9"?o[Math.floor(this._random()*o.length)]:e>="A"&&e<="Z"?i[Math.floor(this._random()*i.length)]:e>="a"&&e<="z"?a[Math.floor(this._random()*a.length)]:n[Math.floor(this._random()*a.length)]},_random:function(){return Math.random()},_setTimeout:function(e,t){return window.setTimeout(e,t)}})})),define("dashboard-analytics/visualizations/renderer/kpi/KpiView",["jquery","underscore","../VisView","text!./Kpi.html","text!./kpiSparklineSpec.json","../../../util/DashboardFormatter","./KpiEventTarget","./KpiViewFactory","../VisEventHandler","../../../DynamicFileLoader","../../../widgets/livewidget/nls/StringResources","../../../util/TextScrambler","../../../features/content/dataQueryExecution/QueryResults"],(function(e,t,i,a,o,n,s,r,l,c,u,d,h){"use strict";var p=i.extend({BASE_SLOT_ID:"actual",TARGET_SLOT_ID:"goal",SPARKLINE_TIME_SLOT_ID:"sparkline.time",SPARKLINE_ACTUAL_SLOT_ID:"sparkline.actual",className:"dataview kpi-widget",templateString:a,init:function(e){p.inherited("init",this,arguments),this._baseValueView=null,this._targetValueView=null,this._sparkLineView=null,this._content=e.content;var t=this._isNewConditionalFormatFeature(),i=t?"ConditionalFormatting":"conditionalFormatting";if(this._conditionalFormattingFeature=this._content.getFeature(i),this._colorsService=this.dashboardApi.getFeature("Colors"),this._visualizationAPI=this._content.getFeature("Visualization.internal"),this._kpiViewFactory=e.kpiViewFactory||new r,!t){var a=this._content.getFeature("ConditionalFormatting");a&&(this._content.getFeature("Properties").deregisterProvider(a),this.dashboardApi.getFeature("CustomColor").deregisterProvider(a))}},summaryReveal:function(){if(this.visModel.renderCompleteBeforeAnimation(),!this._readyToRender())return Promise.resolve();var e=this.$el.find(".kpi-widget-base-value .labeled-value-label"),t=this.$el.find(".kpi-widget-base-value .labeled-value-value");return e.length&&(this.labelScrambler=new d({el:e[0]}),this.labelScrambler.scramble()),t.length&&(this.valueScrambler=new d({ignoreSet:["-",",","."],el:t[0]}),this.valueScrambler.scramble()),Promise.resolve()},remove:function(){this.eventHandler&&(this.eventHandler.remove(),this.eventHandler=null),this._removeViews(),p.inherited("remove",this,arguments)},whenVisControlReady:function(){var e=this;return this.visControl?Promise.resolve(this.visControl):c.load(["dashboard-analytics/visualizations/renderer/kpi/control/KpiControl"]).then((function(t){var i=t[0];return e.visControl=new i({domNode:e.$el.find(".kpi-widget-content")[0]}),e.eventHandler=new l({target:new s({$el:e.$el,visControl:e.visControl,visAPI:e.visModel,view:e,visualization:e.visualization}),transaction:e.transactionApi,ownerWidget:e.ownerWidget,visAPI:e.visModel,edgeSelection:!0}),e.visControl}))},_removeViews:function(){this._baseValueView&&(this._baseValueView.remove(),this._baseValueView=null),this._targetValueView&&(this._targetValueView.remove(),this._targetValueView=null),this._removeSparkLine()},_initializeConditionalFormatting:function(){return this._conditionalFormattingFeature?this._conditionalFormattingFeature.initializeFeature():Promise.resolve()},render:function(t){var i=this,a=arguments;return this._initializeConditionalFormatting().then((function(){i._baseValue=null,i._targetValue=null;var a=i._getBaseSlot(),o=i._getTargetSlot();if(!i._readyToRender()||!a)return i.renderIconView(),Promise.resolve();i.removeIconView(),e(i.contentNode).css("text-align",i._getTextAlignment()||"center"),i._baseValueNode||(i._baseValueNode=i.$el.find(".kpi-widget-base-value"),i._targetValueNode=i.$el.find(".kpi-widget-target-value"),i._sparkLineNode=i._getSparklineContainer());var n=t.data.getResult();i._baseValue=i._getQueryResultValue(n,0,0),i._targetValue=i._getQueryResultValue(n,0,1);var s=i._getBaseProperties(),r=i._formatValue(a,i._baseValue),l=i._getDataItem(a),c=l.getLabel(),d=i._getTargetProperties();i._targetValueNode.addClass("hidden"),i._targetValueNode.empty();var h=[],p=i._isSlotMapped(o);if(p||(d.manualValue||0===d.manualValue)&&!isNaN(d.manualValue)){var g=void 0,v=void 0;if(p)g=o,v=i._getDataItem(o).getLabel();else g=a,v=u.get("kpiDefaultTargetLabel"),i._targetValue=Number(d.manualValue);if(d.showValue||d.showDistance){i._targetValueNode.removeClass("hidden");var m=i._getTargetValueString(d,g);h.push(i._renderLabeledValue(m,v,d,"targetValue"))}}var f=i._conditionalFormattingFeature?i._conditionalFormattingFeature.getFormatting(i._baseValue,i._targetValue,l.getColumnId()):null;h.push(i._renderLabeledValue(r,c,s,"baseValue",f));var _=t.data.getResult("sparkline"),y=i._shouldDisplaySparkline(_);return i._sparkLineNode.toggleClass("hidden",!y),y?h.push(i._renderSparkLine(t,f,s)):i._removeSparkLine(),Promise.all(h)})).then((function(){return"auto"===i._getBaseProperties().labelSize&&i._scaleSections(i._getResizeDefinition()),p.inherited("render",i,a)}))},_getQueryResultValue:function(e,t,i){var a=null;tMath.round(l)&&(c+=8,r&&(t=e.maximumHeight),r=s(e,t=t*l/c))}o=o||r,r?n.reservedSpace+=e.maximumHeight:n.children.push(e)})),e.$node.css("overflow",""),o&&this._scaleSections(n)}function s(e,t){var i=!1;e.minimumHeight&&(t=Math.max(Math.floor(t),e.minimumHeight)),e.maximumHeight&&(i=(t=Math.min(t,e.maximumHeight))===e.maximumHeight);var a=t;e.$node.css("height",a+"px");var o=t/1.2;if(e.text&&e.$node.css({"font-size":o+"px","line-height":t+"px","flex-basis":t+"px"}),e.icon){var n=o/2,s={width:n+"px",height:n+"px"};e.icon.paddingDivisor&&(s["padding-left"]=n/e.icon.paddingDivisor+"px"),e.icon.$node.css(s)}return i}},_formatValue:function(e,t){var i=this._getFormatForSlot(e);return t=n.format(t,i)},_getFormatForSlot:function(e){var t=this._getDataItem(e);return t&&t.getFormat()||{}},_getFormattedTargetDistanceString:function(e,t,i){if(0===i)return u.get("kpiDistanceUndefined");var a=(t-i)/Math.abs(i),o={convertPercent:!0,maximumFractionDigits:2,minimumFractionDigits:0,type:"percent",locale:e.locale},s=n.format(a,o);return a>0&&(s="+"+s),s},_getBaseProperties:function(){return{labelSize:this._content.getPropertyValue("baseValueSize"),showLabel:!1!==this._content.getPropertyValue("showItemLabel"),label:this._content.getPropertyValue("baseValueLabel"),valueColor:this._content.getPropertyValue("elementColor")}},_getTargetProperties:function(){return{labelSize:this._content.getPropertyValue("targetValueSize"),showLabel:!1!==this._content.getPropertyValue("showTargetLabel"),showValue:!1!==this._content.getPropertyValue("showTargetValue"),showDistance:!1!==this._content.getPropertyValue("showTargetDistance"),label:this._content.getPropertyValue("targetValueLabel"),manualValue:this._content.getPropertyValue("targetValue")}},_getTimeProperties:function(){return{showSparkline:!1!==this._content.getPropertyValue("showSparkline")}},_getTextAlignment:function(){return this._content.getPropertyValue("textAlignment")},_getBaseSlot:function(){return this._visualizationAPI.getSlots().getSlot(this.BASE_SLOT_ID)},_getTargetSlot:function(){return this._visualizationAPI.getSlots().getSlot(this.TARGET_SLOT_ID)},_getSparklineTimeSlot:function(){return this._visualizationAPI.getSlots().getSlot(this.SPARKLINE_TIME_SLOT_ID)},_getSparklineActualSlot:function(){return this._visualizationAPI.getSlots().getSlot(this.SPARKLINE_ACTUAL_SLOT_ID)},_getDataItem:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return e.getDataItemList()[t]},_isSlotMapped:function(e){return(e&&e.getDataItemList()||[]).length>0},animate:function(){this.resizing?this.visModel.renderCompleteBeforeAnimation():p.inherited("animate",this,arguments)},resize:function(){if(this.isMappingComplete()){var e=this._getBaseProperties();"auto"===e.labelSize&&this._scaleSections(this._getResizeDefinition())}else p.inherited("resize",this,arguments)},onChangeValueSizeProperty:function(e,i){var a={};"auto"===i?(a.baseValueSize="auto",a.targetValueSize="auto"):(a.baseValueSize=this._content.getPropertyValue("baseValueSize"),a.targetValueSize=this._content.getPropertyValue("targetValueSize"),"auto"===a.baseValueSize&&(a.baseValueSize="32",a.targetValueSize="16"),a[e]=i);var o=t.uniqueId("kpi_font_size");for(var n in a)this.ownerWidget.onPropertyUpdate({category:n,item:a[n],transactionId:o})},getDecoratorAPI:function(){var e=[this._baseValueView,this._targetValueView];return{decorateItem:function(t){e[t]&&e[t].setShowLabelTranslationIcon(!0)},decoratePoint:function(){return null},decorate:function(){return null},clearItemDecoration:function(){e.forEach((function(e){e&&e.setShowLabelTranslationIcon(!1)}))},updateDecorations:function(){e.forEach((function(e){e&&e.render()}))}}},getBaseValue:function(){return this._baseValue},getTargetValue:function(){return this._targetValue},_removeSparkLine:function(){this._sparkLineView&&(this._sparkLineView.destroy(),this._sparkLineView=null)},_shouldDisplaySparkline:function(e){return!!this._isSlotMapped(this._getSparklineActualSlot())&&(!!this._isSlotMapped(this._getSparklineTimeSlot())&&(!!this._getTimeProperties().showSparkline&&!!this._hasEnoughDataToRenderSparkline(e)))},_hasEnoughDataToRenderSparkline:function(e){if(!e)return!1;var t=e.getDataPointValueList(),i=t.length;if(!t||i<2)return this._addNotRenderingSparklineInfo(),!1;for(var a=0,o=0;o1));o++);return!(a<2)||(this._addNotRenderingSparklineInfo(),!1)},_addNotRenderingSparklineInfo:function(){this.infoIndicator&&this.infoIndicator.addInfo([{id:"data_notifications",label:u.get("visualizationNotifications"),items:[{id:"sparkLineInfoLabel",label:u.get("kpiUnableDrawSparklineLabel"),isSubMessage:!1},{id:"sparkLineInfo",label:u.get("kpiUnableDrawSparklineInfo"),isSubMessage:!0}]}])},_renderSparkLine:function(e,t,i){var a="";if(t&&t.color)a=t.color;else if(i.valueColor){var o=this._colorsService.getHexColorFromDashboardColorSet(i.valueColor);"transparent"!==o&&(a=o)}this._sparkLineView&&(e.refresh&&e.refresh.data?this._removeSparkLine():this.resizing&&this._sparkLineView.resize());var n=a!==this._cachedSparkLineColor;if(this._updateCachedSparkLineColor(a),this._sparkLineView)n&&this._sparkLineView.widget.updateVisProperties(this._getSparklineColorProperty());else{var s=new h;s.addResult(e.data.getResult("sparkline")),this._sparkLineView=this._createSparkLine(s.getAPI()),this._sparkLineView.render()}return Promise.resolve()},_getSparklineContainer:function(){return this.$el.find(".kpi-widget-sparkline")},_addSlotDef:function(e,t,i){var a={name:t,dataItems:[]};i.getDataItemList().forEach((function(t){var i={id:t.getId(),itemId:t.getColumnId()};t.getSort()&&(i.selection=[{operation:"order",sort:t.getSort()}]),e.data.dataViews[0].dataItems.push(i),a.dataItems.push(t.getId())})),e.slotmapping.slots.push(a)},_getSparklineColorProperty:function(){return{id:"colors.series",value:this._cachedSparkLineColor}},_updateCachedSparkLineColor:function(e){this._cachedSparkLineColor=e;var t=this._getSparklineContainer();this._cachedSparkLineColor?t.removeClass("defaultColors"):t.addClass("defaultColors")},_buildSparklineSpec:function(){var e=JSON.parse(o);this._cachedSparkLineColor&&e.properties.push(this._getSparklineColorProperty()),e.data={dataViews:[{modelRef:this._visualizationAPI.getDataSource().getId(),dataItems:[]}]},e.slotmapping.slots=[],this._addSlotDef(e,"categories",this._getSparklineTimeSlot()),this._addSlotDef(e,"values",this._getSparklineActualSlot());var t=this._visualizationAPI.getLocalFilters();return e.localFilters=t.getFilterList(),e},_createSparkLine:function(e){var t=this._buildSparklineSpec(),i=this._getSparklineContainer(),a={enableHover:!0,enableClick:!1,enablePanAndZoom:!1,tabNavigation:!1,runtimeEnv:{dashboardApi:this.dashboardApi},node:i[0],spec:t,queryResults:e,managesOwnQueries:!0};return this._kpiViewFactory.createSparklineView(a)},_isNewConditionalFormatFeature:function(){return!this.dashboardApi.getGlassCoreSvc(".FeatureChecker").checkValue("dashboard","condFormat","disabled")}});return p})),define("text!dashboard-analytics/visualizations/renderer/infographic/Infographic.html",[],(function(){return'{{? it.infographic }}\n\t
\n\t\t
\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t{{=it.infographic.content}}\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t
\n\n\t\t{{ for(var i=0; i\n\t\t\t\t\n\t\t\t\t\t{{? it.infographic.doFillAnimation }}\n\t\t\t\t\t\t\n\t\t\t\t\t{{?}}\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t
\n\t\t{{ } }}\n\n\t\t{{? it.infographic.scaleComponents.partialValue > 0 }}\n\t\t\t
\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t
\n\t\t{{?}}\n\n\t\t{{ for(var i=0; i\n\t\t\t\t\n\t\t\t\t\t \n\t\t\t\t\n\t\t\t\n\t\t{{ } }}\n\t\n\n\t{{? it.showTitleString }}\n\t
\n\t\t
\n\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\t = {{? it.infographic.percentageScaleValue}}{{=it.infographic.percentageScaleValue}}{{??}}{{=it.infographic.abbreviatedScale}}{{?}} {{=it.label}}\n\t\t
\n\t
\n\t{{?}}\n{{??}}\n
\n{{?}}\n'})),define("dashboard-analytics/lib/@waca/dashboard-common/dist/utils/ScaleUtil",["../lib/@waca/core-client/js/core-client/ui/core/Class"],(function(e){return new(e.extend({SCALE_VALUE_FEW:0,SCALE_VALUE_DEFAULT:1,SCALE_VALUE_MANY:2,PERCENT_OPTIMAL_VALUE:.1,PERCENT_SCALE_OPTIONS:[.01,.1,1],calcOptimalValue:function(e,t){if(null===e&&(e=0),"number"!=typeof e)return null;if(t)return this.PERCENT_OPTIMAL_VALUE;var i=Math.abs(e),a=this.getSign(e)||1,o=Math.ceil(Math.log(i+1)/Math.LN10),n=1;return o>2&&(n=Math.pow(10,o-2)),n*a},getScalingProperties:function(e,t){if(null===e&&(e=0),"number"!=typeof e)return null;if(t)return{availableScales:this.PERCENT_SCALE_OPTIONS,optimalScale:this.PERCENT_OPTIMAL_VALUE,scalingOptions:[this.SCALE_VALUE_FEW,this.SCALE_VALUE_DEFAULT,this.SCALE_VALUE_MANY]};var i=Math.abs(e),a=this.getSign(e)||1,o=this.calcOptimalValue(i),n=[o*a];o>1&&n.unshift(o/10*a);var s=10*o;i/s>=1&&n.push(s*a);var r={availableScales:n,optimalScale:o*a};return r.scalingOptions=this._getScaleOptions(r,t),r},getMinMax:function(e,t){null===e&&(e=0);var i=this.getScalingProperties(e,t);return{min:i.scalingOptions[0],max:i.scalingOptions[i.scalingOptions.length-1]}},getScaleComponents:function(e,t,i){function a(e,t){for(;t<1&&t>0;)t*=10,e*=10;return e/t}null===e&&(e=0),e=Math.abs(e),t=Math.abs(t);var o,n,s=Math.floor(a(e,t)),r=a((o=e)-(n=t)*Math.floor(a(o,n)),t);return{numShapes:s,partialValue:r=parseFloat(r.toFixed(2)),numGreyedShapes:i?a(1,t)-s-Math.ceil(r):0}},_getScaleOptions:function(e){var t,i=e.availableScales.length;return 3===i?t=[this.SCALE_VALUE_FEW,this.SCALE_VALUE_DEFAULT,this.SCALE_VALUE_MANY]:1===i?t=[this.SCALE_VALUE_DEFAULT]:0===e.availableScales.indexOf(e.optimalScale)?t=[this.SCALE_VALUE_FEW,this.SCALE_VALUE_DEFAULT]:1===e.availableScales.indexOf(e.optimalScale)&&(t=[this.SCALE_VALUE_DEFAULT,this.SCALE_VALUE_MANY]),t},getSign:function(e){return e=+e,isNaN(e)?NaN:e>=0?1:-1}}))})),define("text!dashboard-analytics/lib/@waca/dashboard-common/dist/ui/templates/Slider.template",[],(function(){return'
\n\t
\n\t\t{{? !it.minimized}}\n\t\t{{? it.isRange }}\n\t\t
\n\t\t\t
\n\t\t\t
\n\t\t
\n\t\t{{?}}\n\t\t
\n\t\t\t
\n\t\t\t
\n\t\t
\n\t\t{{?}}\n\t\t\n\t\t{{? it.isRange}}\n\t\t
\n\t\t\t
\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t
\n\t\t\t
\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t
\n\t\t
\n\t\t{{?}}\n\t\t{{? it.showMinMax}}\n\t\t
\n\t\t\t{{=it.min}}\n\t\t\t{{=it.max}}\n\t\t
\n\t\t{{?}}\n\t
\n
\n'})),define("dashboard-analytics/lib/@waca/dashboard-common/dist/ui/Slider",["jquery","underscore","../lib/@waca/core-client/js/core-client/ui/core/View","text!./templates/Slider.template","../lib/@waca/core-client/js/core-client/i18n/Formatter","../nls/StringResources","bootstrap-slider"],(function(e,t,i,a,o,n){var s=i.extend({templateString:a,leftTooltip:null,leftTooltipArrow:null,leftTooltipInput:null,rightTooltip:null,rightTooltipArrow:null,rightTooltipInput:null,tooltipPadding:5,events:{"change .tooltipHandle input":"onInputChange","keyup .tooltipHandle input":"onKeyUp","keydown .tooltipHandle input":"onKeyDown","keypress .tooltipHandle input":"onKeyPress","mousedown .tooltipHandle input":"onMouseDownTooltip","focus .tooltipHandle input":"onInputFocus","blur .tooltipHandle input":"onInputBlur","keydown div.slider-handle.round":"onHandleKeyDown"},init:function(e){s.inherited("init",this,arguments),t.defaults(e,{sliderId:"slider",min:0,max:10,precision:20,value:0,inverted:!1,enabled:!0,minimized:!1,indeterminate:!1,showMinMax:!0,valueFormatter:this.valueFormatter,prettyValue:this.prettyValue,tooltipTemplate:'',style:"simple"}),e.min===e.max&&(e.enabled=!1),e.indeterminate&&(e.value=e.max,e.enabled=!1,e.minimized=!0),e.minimized&&(e.showMinMax=!1),this.options=e},valueFormatter:function(e){return e},_getKeyCode:function(e){return e.keyCode||e.which},prettyValue:function(e){return e},setFocus:function(){this.$(".slider-handle").first().focus()},render:function(){var t=this,i=!0,a=this.options.value instanceof Array;this.$el.empty();var o=this.dotTemplate({min:this.options.min,max:this.options.max,value:this.options.value,showMinMax:this.options.showMinMax,isRange:a,minimized:this.options.minimized});this.$el.attr("role","application"),this.$el.attr("aria-label",n.get("sliderRegionLabel")),this.$el.html(o);var s=this.$el.find(".slider-container");s.addClass(this.options.style);var r=s.find(".slider-control");r.attr("id",this.options.sliderId);var l,c=r.bootstrapSlider({tooltip:"hide",value:this.options.value,min:this.options.min,max:this.options.max,step:this.options.step,precision:this.options.precision});this.slider=c,this.$el.find(".tooltip").remove();var u=void 0;if(this.options.minimized)s.addClass("minimized"),this.options.indeterminate&&s.addClass("indeterminate"),u=Promise.resolve();else{c.on("slide",this.onSlide.bind(this)).on("slideStart",this.onSlideStart.bind(this)).on("slideStop",this.onSlideStop.bind(this));var d=this.$el.find(".tooltipHandle"),h=d.find(".tooltip-inner");if(d.css({position:"absolute"}),d.hide(),d.find(".tooltipHandle .tooltip-arrow").css({left:"0",right:"0",padding:"0","margin-left":"auto","margin-right":"auto",width:"0",height:"0"}),this.sliderSelection=this.$el.find(".slider-selection"),this.sliderTrack=this.$el.find(".slider-track"),l=this.$el.find(".slider-handle"),a&&s.hasClass("dual")){this.leftLinkLineTop=this.$el.find(".lineSegment.top .linkLine.left"),this.rightLinkLineTop=this.$el.find(".lineSegment.top .linkLine.right"),this.leftLinkLineBottom=this.$el.find(".lineSegment.bottom .linkLine.left"),this.rightLinkLineBottom=this.$el.find(".lineSegment.bottom .linkLine.right");var p=e('
'),g=e('
');p.appendTo(l),g.appendTo(l),this.rightHandle=l.eq(1),this.leftTooltip=d.eq(0),this.rightTooltip=d.eq(1),this.leftTooltipInner=h.eq(0),this.rightTooltipInner=h.eq(1)}else this.sliderTrack.append('
'),this.rightHandle=l,this.rightTooltip=d,this.rightTooltipArrow=this.rightTooltip.find(".tooltip-arrow"),this.rightTooltipInner=h;this.updateTooltips(),this.updateFilterRangeInfo(),i=!1,u=new Promise((function(e,i){try{setTimeout((function(){t.layout(),t.leftTooltip&&t.leftTooltip.fadeIn(),t.rightTooltip.fadeIn(),e()}),100)}catch(e){i(e)}}))}return this.options.inverted&&this.invert(),this.setEnabled(this.options.enabled),this.setSliderAriaLabel(l),i&&(u=Promise.resolve()),u},setSliderAriaLabel:function(e){e&&e.length>0&&(e.get(0).style.left&&(e.attr("role","slider"),e.attr("aria-valuenow",n.get("a11ySliderHandleLabel",{sliderValue:this.options.prettyValue(this.getValue())}))))},getValue:function(){return this.options.value},getMin:function(){return this.options.min},getMax:function(){return this.options.max},isInverted:function(){return this.inverted},invert:function(){this.inverted=!this.inverted,this.$el.find(".slider-container").toggleClass("invert"),this.options.invertedTooltipTemplate&&(this.updateTooltips(),this.updateFilterRangeInfo(),this.layout())},isCleared:function(){if(this._applyFilter)return!1;var e=this.getValue();return e instanceof Array?!this.inverted&&(e[0]===this.getMin()&&e[1]===this.getMax()):this.inverted?e===this.getMax():e===this.getMin()},clear:function(){this.isInverted()&&this.invert();var e,t=this.getMin(),i=this.getMax();e=this.getValue()instanceof Array?[t,i]:this.inverted?t:i,this.setValue(e),this.updateFilterRangeInfo()},remove:function(){this.slider&&(this.slider.bootstrapSlider("destroy"),this.slider.remove()),this.slider=null,s.inherited("remove",this,arguments)},updateValue:function(){this.slider&&(this.options.value=this.slider.bootstrapSlider("getValue")),this.setSliderAriaLabel(this.$el.find(".slider-handle"))},updateFilterRangeInfo:function(){var e=this.$el.parents().find(".titleInfo .rangeInfo");if(this.options.value instanceof Array&&(this.options.min!==this.options.value[0]||this.options.max!==this.options.value[1])){if(this.leftTooltipInner){var t=this.leftTooltipInner.text(),i=this.rightTooltipInner.text(),a=this.options.prettyValue(this.options.value);this.inverted?e.text(t+a[0]+" "+i+a[1]):e.text(a[0]+" - "+a[1])}}else e.text("")},setValue:function(e,t){this.options.value=e,this.slider&&(this.slider.bootstrapSlider("setValue",e),this.layout()),this.triggerOnChange(),t||this.triggerSlideStop()},setStep:function(e){this.options.step=e,this.slider&&this.slider.bootstrapSlider("setAttribute","step",e)},setMin:function(e){this.options.min=e,this.slider&&this.slider.bootstrapSlider("setAttribute","min",e)},setMax:function(e){this.options.max=e,this.slider&&this.slider.bootstrapSlider("setAttribute","max",e)},setEnabled:function(e){e?(this.slider.bootstrapSlider("enable"),this.$el.find(".slider-container").removeClass("disabled")):(this.slider.bootstrapSlider("disable"),this.$el.find(".slider-container").addClass("disabled"))},onKeyDown:function(e){13===e.keyCode&&(e.preventDefault(),this.onInputChange(e))},onKeyUp:function(){},onKeyPress:function(){this.layoutTooltips()},onMouseDownTooltip:function(t){e(t.target).is(":focus")||(t.preventDefault(),t.stopPropagation(),t.target.select())},onInputFocus:function(t){e(t.target).parent().addClass("focus"),t.preventDefault(),t.stopPropagation()},onInputBlur:function(t){e(t.target).parent().removeClass("focus")},calculateTooltipsWidth:function(){this.leftTooltipInput&&(this.leftTooltipWidth=this.calculateTooltipWidth(this.leftTooltipInput)),this.rightTooltipWidth=this.calculateTooltipWidth(this.rightTooltipInput)},calculateTooltipWidth:function(e){var t=20+5*(e.val().length+1),i=Math.floor((this.sliderTrack.width()-this.tooltipPadding)/1.3);return t>i&&(t=i),t},updateTooltipsWidth:function(){this.leftTooltipInput&&this.updateTooltipWidth(this.leftTooltip,this.leftTooltipWidth),this.updateTooltipWidth(this.rightTooltip,this.rightTooltipWidth)},updateTooltipWidth:function(e,t){e.attr("aria-label",e.attr("value")),e.css({width:t+"px"})},onInputChange:function(t){var i,a,n=e(t.currentTarget),s=0,r=0;"left"===n.data("input")?(r=o.parseDecimal(n.val()),s=this.rightTooltipInput.data("value")?this.rightTooltipInput.data("value"):this.rightTooltipInput.val()):"right"===n.data("input")&&(this.leftTooltipInput&&(r=this.leftTooltipInput.data("value")?this.leftTooltipInput.data("value"):this.leftTooltipInput.val()),s=o.parseDecimal(n.val())),this.options.value instanceof Array?(i=this.validate(r,s),r===(i=this.options.valueFormatter(i))[0]&&s===i[1]||(a=this.options.prettyValue(i),this.leftTooltipInput.data("value",i[0]),this.leftTooltipInput.val(a[0]),this.rightTooltipInput.data("value",i[1]),this.rightTooltipInput.val(a[1]))):(i=this.validateMax(s),s!==(i=this.options.valueFormatter(i))&&(a=this.options.prettyValue(i),this.rightTooltipInput.data("value",i),this.rightTooltipInput.val(a))),i[0]this.options.value[1]&&(this._applyFilter=!0,this.setMax(i[1])),this.setValue(i),this.updateFilterRangeInfo()},updateTooltips:function(){var t,i;this.options.tooltipTemplate instanceof Array?(this.inverted&&this.options.invertedTooltipTemplate?(t=this.options.invertedTooltipTemplate[0],i=this.options.invertedTooltipTemplate[1]):(t=this.options.tooltipTemplate[0],i=this.options.tooltipTemplate[1]),this.leftTooltipInner.html(e(t)),this.rightTooltipInner.html(e(i))):this.rightTooltipInner.html(e(this.options.tooltipTemplate));this.updateInputs()},updateInputs:function(){this.rightTooltipInput=this.rightTooltip.find("input"),this.rightTooltipInput.data("input","right"),this.leftTooltip&&(this.leftTooltipInput=this.leftTooltip.find("input"),this.leftTooltipInput.data("input","left"))},layoutValues:function(){this.updateValue();var e=this.options.valueFormatter(this.getValue()),t=this.options.prettyValue(e);this.leftTooltip?(this.leftTooltipInput.data("value",e[0]),this.leftTooltipInput.val(t[0]),this.rightTooltipInput.data("value",e[1]),this.rightTooltipInput.val(t[1])):(this.rightTooltipInput.data("value",e),this.rightTooltipInput.val(t))},layout:function(){this.layoutValues(),this.layoutTooltips()},layoutTooltips:function(){this.calculateTooltipsWidth(),this.calculateRightTooltip(),this.leftTooltip&&(this.calculateLeftTooltip(),this.calculateCollisions(),this.paintLines(),this.layoutTooltip(this.leftTooltip,this.leftTooltipCenter,this.leftTooltipMarginLeft)),this.layoutTooltip(this.rightTooltip,this.rightTooltipCenter,this.rightTooltipMarginLeft),this.rightTooltipArrow&&this.layoutTooltipArrow(this.rightTooltipArrow,this.rightTooltipArrowLeft),this.updateTooltipsWidth()},layoutTooltip:function(e,t,i){e.css({left:t,"margin-left":i})},layoutTooltipArrow:function(e,t){e.css({left:t})},paintLines:function(){this.leftLinkLineTop.css({left:Math.min(this.leftHandleCenter,this.leftTooltipCenter),width:this.leftHandleCenter-this.leftTooltipCenter}),this.rightLinkLineTop.css({left:this.rightHandleCenter,width:this.rightTooltipCenter-this.rightHandleCenter}),this.leftLinkLineBottom.css({left:this.leftHandleCenter}),this.rightLinkLineBottom.css({left:this.rightHandleCenter})},calculateLeftTooltip:function(){var e=this.leftTooltipWidth,t=Math.floor(this.sliderSelection.position().left);this.leftHandleCenter=t;var i=t;i=this.checkLeftBoundaryForLeftTooltip(i,e),i=this.checkRightBoundary(i,e);var a=Math.floor(-e/2);this.leftTooltipCenter=i,this.leftTooltipMarginLeft=a,this.leftTooltipWidth=e},calculateRightTooltip:function(){var e=this.rightTooltipWidth,t=Math.floor(this.rightHandle.position().left);this.rightHandleCenter=t;var i=t;i=this.checkLeftBoundaryForRightTooltip(i,e),i=this.checkRightBoundary(i,e);var a=Math.floor(-e/2);this.rightTooltipCenter=i,this.rightTooltipMarginLeft=a,this.rightTooltipArrow&&(this.rightTooltipArrowLeft=2*(t-i)),this.rightTooltipWidth=e},calculateCollisions:function(){var e=this.tooltipPadding,t=this.leftTooltipCenter+this.leftTooltipWidth/2,i=this.rightTooltipCenter-this.rightTooltipWidth/2-t-e;if(i<0){var a=Math.floor(i/2);if(this.leftTooltipCenter+=a,this.rightTooltipCenter-=a,this.leftTooltipCenter<=this.tooltipMinLeftForLeftTooltip)this.leftTooltipCenter=this.tooltipMinLeftForLeftTooltip,this.rightTooltipCenter=this.leftTooltipCenter+this.leftTooltipWidth/2+e+this.rightTooltipWidth/2;else{var o=this.rightTooltipCenter+this.rightTooltipWidth/2,n=this.sliderTrack.position().left+this.sliderTrack.width()+15;(i=o-n)>0&&(this.rightTooltipCenter=n-this.rightTooltipWidth/2,this.leftTooltipCenter=this.rightTooltipCenter-this.rightTooltipWidth/2-e-this.leftTooltipWidth/2)}this.rightTooltipCenter=Math.floor(this.rightTooltipCenter),this.leftTooltipCenter=Math.floor(this.leftTooltipCenter)}},checkLeftBoundaryForLeftTooltip:function(e,t){var i=this.sliderTrack.position().left+t/2-15;return this.tooltipMinLeftForLeftTooltip=i,ei&&(e=i),e},onSlide:function(){this.layout(),this.triggerOnChange()},onSlideStart:function(){this.sliding=!0},onSlideStop:function(){this.sliding=!1,this.updateValue(),this.updateFilterRangeInfo(),this.layout(),this.triggerOnChange(),this.triggerSlideStop()},triggerSlideStop:function(){this.trigger("action:slidestop",{})},triggerOnChange:function(){this.trigger("action:change",{})},validate:function(e,t){if(e=this.validateMin(e),void 0!==t){if((t=this.validateMax(t))=i)return i}return e}});return s})),define("dashboard-analytics/visualizations/renderer/infographic/InfographicScaleView",["underscore","../../../widgets/livewidget/nls/StringResources","../../../lib/@waca/core-client/js/core-client/ui/core/View","../../../lib/@waca/dashboard-common/dist/ui/Slider","../../../lib/@waca/dashboard-common/dist/utils/ScaleUtil"],(function(e,t,i,a,o){"use strict";var n={};n[o.SCALE_VALUE_FEW]=t.get("propScaleFew"),n[o.SCALE_VALUE_DEFAULT]=t.get("propScaleDefault"),n[o.SCALE_VALUE_MANY]=t.get("propScaleMany");var s=i.extend({init:function(t){s.inherited("init",this,arguments),e.extend(this,t)},render:function(){this.$el.css({height:93,width:200});var e=o.getMinMax(this.widgetValue,this.isPercent),i={el:this.$el[0],name:"scaleSlider",label:t.get("propScaleLabel"),type:"slider",description:t.get("propScaleDescription"),min:e.min,max:e.max,step:1,showMinMax:!1,value:this.currentScaleOption,style:"simple",valueFormatter:this.valueFormatter.bind(this)};return this.slider=new a(i),this.slider.render()},notifyRenderComplete:function(){this.slider&&(this.slider.layout(),this.slider.slider&&this.slider.slider.on("slideStop",this.onWidgetScaleUpdate.bind(this)))},onWidgetScaleUpdate:function(e){this.content.setPropertyValue("value.graphic.currentScaleOption",e.value)},valueFormatter:function(e){return n[e]||e},setFocus:function(){this.slider&&this.slider.setFocus()}});return s})),define("dashboard-analytics/visualizations/renderer/infographic/InfographicEventTarget",["jquery","../common/NonVIPREventTarget"],(function(e,t){return function(t){function i(){var e;_classCallCheck(this,i);for(var a=arguments.length,o=Array(a),n=0;n0?e.getValue(0,0).value:null,this.infographicInfo=this._buildHtml(i[0],this.infographicValue,t),this.dotTemplate(this.infographicInfo)):Promise.resolve("")},onChangeTheme:function(){this.visModel.getRenderSequence().reRender()},_showItemLabel:function(){return this.visModel.getPropertyValue("showItemLabel")},_getCustomLabel:function(){return this.visModel.getPropertyValue("baseValueLabel")},_fillVertically:function(){return"BottomToTop"===this.visModel.getPropertyValue("fillDirection")},_valueFormat:function(e,t){var i=e.getFormat();if((t=o.format(t,i)).length<5){var a=t.length<3?" ":" ";t=a+t+a}return t},_getForegroundColor:function(){var e=this._colorsService.getHexColorFromDashboardColorSet(this.visModel.getPropertyValue("elementColor"));return"transparent"===e&&(e=""),e},getScaleOption:function(){return void 0!==this.graphicCurrentScaleOption?this.graphicCurrentScaleOption:s.SCALE_VALUE_DEFAULT},getScaleValue:function(e,t,i){var a;if(e&&void 0!==t){var o=e.availableScales;if(t===s.SCALE_VALUE_DEFAULT)a=e.optimalScale;else if(t===s.SCALE_VALUE_MANY){var n=o.indexOf(e.optimalScale)-1;n<0&&(n=0),a=o[n]}else{var r=o.indexOf(e.optimalScale)+1;r>o.length-1&&(r=o.length-1),a=o[r]}}else i&&(a=s.calcOptimalValue(i));return a},_calcScale:function(e){var t={},i=s.getScalingProperties(e,this.isPercent);return t.currentScaleOption=this.getScaleOption(),t.scale=this.getScaleValue(i,t.currentScaleOption,e),t.abbreviatedScale=o.format(t.scale,{decimalFormatLength:"short"}),t.scaleComponents=s.getScaleComponents(e,t.scale,this.isPercent),t},_isPercent:function(e,t){var i=e.getFormat();return i&&"percent"===i.type&&Math.abs(t)<=1},_constructShapeStyle:function(e){var t={},i="fill:",a="colorFill";return t.svgClass="Shape","transparent"===this.graphicFillColor&&(a="colorStroke",i="stroke:",t.svgClass="Line"),""!==e?(t.colorClass="",t.coloredStyle='style="'+i+e+'"'):(t.colorClass=a,t.coloredStyle=""),t},_buildHtml:function(e,i,a){var o,n=e.getDataItemList()[0],s=this._getForegroundColor(),r=this._fillVertically(),l=this._constructShapeStyle(s);this.isPercent=this._isPercent(n,i);var c=this._calcScale(i),u=c.scale,d=c.scaleComponents,h=this.graphicContent.match(RegExp('viewBox="(.*?)"')),p=h&&h[1]?h[1]:"0 0 100 100",g=this._extractSvgContent(this.graphicContent),v=this._calculateClipPath({x:p.split(" ")[0],y:p.split(" ")[1],width:p.split(" ")[2],height:p.split(" ")[3]},d,r,a);return o={content:g,scaleComponents:d,percentageScaleValue:this._getPercentageScaleValue(i,u),scale:u,abbreviatedScale:c.abbreviatedScale,viewBox:p,svgId:t.uniqueId("svgDef"),style:l,fillClass:r?"fillVertical":"fillHorizontal",doFillAnimation:a,fillDuration:.5/(d.numShapes+1),clipPathLastElement:v},this.currentScaleOption=c.currentScaleOption,this.numOfShapes=d.numShapes+d.numGreyedShapes,d.partialValue>0&&this.numOfShapes++,{v:i=this._valueFormat(n,i),showTitleString:this._showItemLabel(),label:this._getCustomLabel()||n.getLabel(),infographic:o}},_getPercentageScaleValue:function(e,t){if(!this.isPercent)return!1;var i=100*t;return e<0&&(i*=-1),o.format(i/100,{type:"percent",maximumFractionDigits:1,minimumFractionalDigits:1})},_calculateClipPath:function(e,t,i){return i?{width:"100%",y:e.height*(1-t.partialValue)+Number(e.y)}:{width:e.width*t.partialValue+Number(e.x),y:0}},_extractSvgContent:function(t){var i=e(t).children(),a=new XMLSerializer,o="";return i.each((function(){o+=a.serializeToString(this)})),o},addToDom:function(e){this.$el.empty(),this.$el.prepend(e),this.setElement(this.$el)},onVisible:function(){this.renderOnVisible&&this._resize()},applyVisModelProperties:function(){this._resizeInfographicShapes()},_resizeInfographicShapes:function(){if(0!==this.numOfShapes){var t,i,a=e(this.el).find(".infographic"),o=Math.floor(a.width()),n=Math.floor(a.height())||1,s=this.numOfShapes,r=Math.ceil(Math.sqrt(s*o/n));t=Math.floor(r*n/o)*r0&&void 0!==arguments[0])||arguments[0];this._kpiView.remove(e),this._infographicView.remove(e),e&&r.destroy(this)},whenVisControlReady:function(){var e=this,t=[this._kpiView.whenVisControlReady(),this._infographicView.whenVisControlReady()];return Promise.all(t).then((function(){return e.visControl?e.visControl:s.load(["dashboard-analytics/visualizations/renderer/summary/control/SummaryControl"]).then((function(t){var i=t[0];return e.visControl=new i({domNode:e.$el[0]}),e.visControl}))}))},placeAt:function(e){this._containingElement=e,this._activeView&&this._activeView.placeAt(e)},updateActiveView:function(){this._activeView&&this._activeView.$el.detach();var e=this.isInfographic(!0);this._activeView=e?this._infographicView:this._kpiView,this.$el=this._activeView.$el,this._containingElement&&this._activeView.placeAt(this._containingElement)},getActiveView:function(){return this._activeView},render:function(e){return this.updateActiveView(),this._activeView.render(e)},isInfographic:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(void 0===this._isInfographic||e){var t=this.content.getPropertyValue("value.graphic.content");this._isInfographic=!!t}return this._isInfographic},getDecoratorAPI:function(){return this._activeView.getDecoratorAPI?this._activeView.getDecoratorAPI():null}});return l})),define("dashboard-analytics/util/EdgeIterator",[],(function(){"use strict";return function(){function e(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;_classCallCheck(this,e),this.edge=t.edge,this.keys=t.sortedKeys,this.currentKeyIndex=0,this.subIterator=null,this.numberOfLeafNodes=0,this.leafnode_index_no_summary=i}return e.prototype.next=function(e,t){var i=null;if(this._previous&&!this._previous.isSummary&&++this.leafnode_index_no_summary,this.currentKeyIndex1||0===this.colEdgeNestingLevel,this._columnEdgeHasMeasure?this.colEdgeNestingLevelWithMeasure=this.colEdgeNestingLevel+1:this._crosstabMeasure=this._measuresInfo.length?this._measuresInfo[0].label:null}return t.prototype._addEdgeDataItemInfo=function(e,t,i){this.data&&(i===n?this.indexInfo.row.push({slotIndex:e,nestedIndex:t}):this.indexInfo.col.push({slotIndex:e,nestedIndex:t}))},t.prototype.create=function(){this._hideSummaries=this.visModel.getPropertyValue("hideSummaries"),this._generateEdgesAndValueMap();var e=[];return this._addColumnEdgeCategories(e),this._addRowEdgeCategoriesAndFactCells(e),e},t.prototype.getNestingLevels=function(){return this._columnEdgeHasMeasure?{colNestingLevel:this.colEdgeNestingLevel+1,rowNestingLevel:this.rowEdgeNestingLevel}:{colNestingLevel:this.colEdgeNestingLevel,rowNestingLevel:this.rowEdgeNestingLevel}},t.prototype.getLevelInfo=function(){return this.levelInfo},t.prototype.getCellValue=function(e,t,i){var a=this.data.getValue(e,t),n=a,s=n&&n.type===this.data.VALUE_TYPE.SUMMARY;return Array.isArray(n)&&void 0!==i&&(n=n[i]),s&&(n=n||a&&a.length&&a[a.length-1])&&((n=JSON.parse(JSON.stringify(n))).label=o,n.isSummary=!0),n},t.prototype._determineLevelInfo=function(e,t,i){if(void 0!==this.levelInfo[e][t]){var a=this.levelInfo[e][t],o=a.rootLevelnumber,n=a.maxLevelDepth;this.levelInfo[e][t]={rootLevelnumber:Math.min(o,i),maxLevelDepth:Math.max(n,i-o)}}else this.levelInfo[e][t]={rootLevelnumber:i,maxLevelDepth:0}},t.prototype._generateEdgesAndValueMap=function(){for(var e=this,t={},i={},o=this.data.getRowCount(),s=a.getDataItemCount(this.data.getResultItemList()),r=this._valuesStartIdx+this._measuresInfo.length,l=0;l2&&void 0!==arguments[2]?arguments[2]:void 0;if(!e.isSummary&&e.value&&e.value.span){for(var a=e.value.span-1,o=0;o0){var r=t[0].value;if(!e[r]){e[r]={level:s,type:a,value:t[0]},t[0].isSummary&&(e[r].isSummary=t[0].isSummary);var l=null;a===n?l=this._getFormatSpec(this._rowInfo[s]):"column"===a&&(l=this._getFormatSpec(this._columnInfo[s])),l&&"date"===l.type&&(e[r].formatSpec=l)}var c=t.slice(1,t.length);c.length>0?(e[r].nestedEdges||(e[r].nestedEdges={}),this._addDimensionToEdge(e[r].nestedEdges,c,i,a,o,s+1)):this._columnEdgeHasMeasure&&"column"===a&&(e[r].nestedEdges||(e[r].nestedEdges={},e[r].hasMeasureChildren=!0),this._addMeasureToEdge(e[r].nestedEdges,o,a,s+1,!1))}else this._columnEdgeHasMeasure&&"column"===a&&this._addMeasureToEdge(e,o,a,s,!1)},t.prototype._getFormatSpec=function(e){return e.formatSpec&&e.formatSpec.formatSpec},t.prototype._addMeasureToEdge=function(e,t,i,a,o,n){if(t)for(var s=void 0,r=0;r0&&void 0!==arguments[0]?arguments[0]:[],t=arguments[1];if(!t)throw new Error("Invalid dataItem provided");return!!e.find((function(e){return e.getId()===t.getId()}))},t}()})),define("dashboard-analytics/visualizations/renderer/grid/GridDnDManager",["underscore","../../../dataSources/utils/ShapingConstants"],(function(e,t){return function(){function i(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};_classCallCheck(this,i),this.grid=e.grid,this.dashboardApi=e.dashboardApi,this.content=e.content,this.gridEdgeMappedToId=e.gridEdgeMappedToId,this.visualization=this.content.getFeature("Visualization"),this.visDnDUtils=this.content.getFeature("VisDnD.utils")}return i.prototype.registerElement=function(e,t){this.dashboardApi.getFeature("DashboardDnd.internal").addDropTarget(t,{accepts:this.accepts.bind(this,e,t),onDrop:this.onDrop.bind(this,e),onDragEnter:this.onDragEnter.bind(this),onDragMove:this.onDragMove.bind(this,e),onDragLeave:this.onDragLeave.bind(this,e)})},i.prototype.deregisterElement=function(e){this.dashboardApi.getFeature("DashboardDnd.internal").removeDropTarget(e)},i.prototype.accepts=function(e,i,a){if(!e||!e.props)return!1;var o={dropTarget:t.DROP_TARGET_OPTIONS.SLOT};i&&(o.targetNode=i);var n=this._getContent().getFeature("Visualization"),s=void 0;!this.dashboardApi.getGlassCoreSvc(".FeatureChecker").checkValue("dashboard","expandCollapse","disabled")&&"Crosstab"===n.getType()&&(s=i&&this._getDropAction(e,a,i))&&(s.actionSpec.slot=this._findSlot(s.actionSpec.gridEdge),o.dropAction=s);var r=this.visDnDUtils.accepts(a,o);if(r){var l=this.grid.$el[0],c=l&&l.getBoundingClientRect(),u=e.ref.current,d=u&&u.getBoundingClientRect();(!c||!d||parseInt(c.bottom)3)&&(r=!1)}return r},i.prototype.onDragEnter=function(){},i.prototype._findSlot=function(t){var i=this,a=this.visualization.getSlots();return e.find(a.getSlotList(),(function(e){switch(t){case"row":return e.getId()===i.gridEdgeMappedToId.row;case"column":return e.getId()===i.gridEdgeMappedToId.column;case"values":return e.getId()===i.gridEdgeMappedToId.values}}))},i.prototype._insertDataItems=function(e){var t=e.gridEdge,i=e.droppedColumns,a=e.position,o=this._findSlot(t);o&&this.visDnDUtils.mapColumns(o.getId(),i,{position:a,bReplace:!1})},i.prototype._replaceDataItems=function(t){var i=t.gridEdge,a=t.droppedColumns,o=t.position,n=this._findSlot(i);if(n){var s=n.getDataItemList();if(e.isEmpty(s))return;this.visDnDUtils.mapColumns(n.getId(),a,{position:o,bReplace:!0})}},i.prototype._findValuesSlotPosition=function(t){var i=this._findSlot("values"),a=-1;if(i){var o=i.getDataItemList();e.isEmpty(o)||(a=o.findIndex((function(e){return e.getLabel()===t.props.useValue})))}return a},i.prototype._getDropAction=function(t,i,a){var o=i.data.columns;if(e.pluck(o,"metadataColumn").length>0){var n=this._getDropZoneInfo(i,a,t),s=n.action,r=n.idx;switch(s){case"insertLeft":return this._getInsertLeftAction(t,o,r);case"insertRight":return this._getInsertRightAction(t,o,r);case"replaceRow":return this._getReplaceRowAction(t,o,r);case"insertAbove":return this._getInsertAboveAction(o,r);case"insertBelow":return this._getInsertBelowAction(o,r);case"replaceCol":return this._getReplaceColumnAction(t,o,r)}}},i.prototype.onDrop=function(e,t,i){var a=this._getDropAction(e,t,i);return this.grid.hideDropZones(),a.action(a.actionSpec)},i.prototype.onDragMove=function(e,t,i){var a=this._getDropZoneInfo(t,i,e),o=a.action,n=a.idx;switch(o){case"insertLeft":return this.grid.showLeftDropZone(n);case"insertRight":return this.grid.showRightDropZone(n);case"replaceRow":return e.props.isMeasure&&"corner"!==e.props.cellType?this.grid.showReplaceDropZone(e.props.row,"row",e.props.useValue):this.grid.showReplaceDropZone(n,"col");case"insertAbove":return this.grid.showTopDropZone(n);case"insertBelow":return this.grid.showBottomDropZone(n);case"replaceCol":return this.grid.showReplaceDropZone(n,"row")}},i.prototype.onDragLeave=function(){this.grid.hideDropZones()},i.prototype._getInsertLeftAction=function(e,t,i){var a=void 0;return(a="corner"===e.props.cellType?{gridEdge:"values",droppedColumns:t,position:0}:e.props.isMeasure?{gridEdge:"values",droppedColumns:t,position:this._findValuesSlotPosition(e)}:{gridEdge:"row",droppedColumns:t,position:parseInt(i)}).replace=!1,{actionSpec:a,action:this._insertDataItems.bind(this)}},i.prototype._getInsertRightAction=function(e,t,i){var a=void 0;return(a="corner"===e.props.cellType?{gridEdge:"values",droppedColumns:t,position:-1}:e.props.isMeasure?{gridEdge:"values",droppedColumns:t,position:this._findValuesSlotPosition(e)+1}:{gridEdge:"row",droppedColumns:t,position:parseInt(i)+1}).replace=!1,{actionSpec:a,action:this._insertDataItems.bind(this)}},i.prototype._getReplaceRowAction=function(e,t,i){var a=void 0;return(a="corner"===e.props.cellType?{gridEdge:"values",droppedColumns:t,position:0}:e.props.isMeasure?{gridEdge:"values",droppedColumns:t,position:this._findValuesSlotPosition(e)}:{gridEdge:"row",droppedColumns:t,position:parseInt(i)}).replace=!0,{actionSpec:a,action:this._replaceDataItems.bind(this)}},i.prototype._getInsertAboveAction=function(e,t){return{actionSpec:{gridEdge:"column",droppedColumns:e,position:parseInt(t),replace:!1},action:this._insertDataItems.bind(this)}},i.prototype._getInsertBelowAction=function(e,t){var i={gridEdge:"column",droppedColumns:e,position:parseInt(t)+1,replace:!1};return{actionSpec:i,action:this._insertDataItems.bind(this)}},i.prototype._getReplaceColumnAction=function(e,t,i){var a=void 0;return(a=e.props.isMeasure?{gridEdge:"values",droppedColumns:t,position:this._findValuesSlotPosition(e)}:{gridEdge:"column",droppedColumns:t,position:parseInt(i)}).replace=!0,{actionSpec:a,action:this._replaceDataItems.bind(this)}},i.prototype._getDropZoneInfo=function(e,t,i){return"column"===i.props.cellType?this._getColumnDropZoneInfo(e,t,i):"row"===i.props.cellType?this._getRowDropZoneInfo(e,t,i):"corner"===i.props.cellType?this._getCornerDropZoneInfo(e,t,i):void 0},i.prototype._getColumnDropZoneInfo=function(e,t){var i=t.getBoundingClientRect(),a=t&&t.getAttribute("col"),o=(e.position.x-i.left)/i.width*100;return o<33?{action:"insertLeft",idx:a}:o>66?{action:"insertRight",idx:a}:{action:"replaceRow",idx:a}},i.prototype._getRowDropZoneInfo=function(e,t,i){var a=t.getBoundingClientRect();if(i.props.isMeasure)return this._getColumnDropZoneInfo(e,t);var o=t&&t.getAttribute("row"),n=(e.position.y-a.top)/a.height*100;return n<33?{action:"insertAbove",idx:o}:n>66?{action:"insertBelow",idx:o}:{action:"replaceCol",idx:o}},i.prototype._getCornerDropZoneInfo=function(e,t){var i=t.getBoundingClientRect(),a=(e.position.x-i.left)/i.width*100;return a<33?{action:"insertLeft",idx:"corner"}:a>66?{action:"insertRight",idx:"corner"}:{action:"replaceRow",idx:"corner"}},i.prototype._getContent=function(){if(!this.content){var e=this.grid.gridView||this.grid.crosstabView;this.content=this.dashboardApi.getCanvas()&&this.dashboardApi.getCanvas().getContent(e.ownerWidget.getId())}return this.content},i}()})),define("dashboard-analytics/visualizations/renderer/grid/GridDataProvider",["../../../lib/@waca/core-client/js/core-client/ui/core/Class","underscore"],(function(e,t){"use strict";return e.extend({_data:null,_numRows:null,_numColumns:null,init:function(e){e&&(this._data=e,this._setDataDimensions())},getNumRows:function(){return this._numRows},getNumColumns:function(){return this._numColumns},getValue:function(e,t){return this._data[e][t]},_setDataDimensions:function(){this._data&&(this._numRows=this._data.length,this._numColumns=t.isArray(this._data[0])?this._data[0].length:0)},updateData:function(e){e&&(this._data=e,this._setDataDimensions())}})})),define("dashboard-analytics/visualizations/renderer/grid/GridDropTarget",["react","prop-types"],(function(e,t){var i,a;return a=i=function(t){function i(a){_classCallCheck(this,i);var o=_possibleConstructorReturn(this,t.call(this,a));return o.ref=e.createRef(),o}return _inherits(i,t),i.prototype.componentDidMount=function(){this.props.dndManager.registerElement(this,this.ref.current)},i.prototype.componentWillUnmount=function(){this.props.dndManager.deregisterElement(this.ref.current)},i.prototype.render=function(){var t=_extends({},this.props);return delete t.dndManager,e.createElement("div",_extends({ref:this.ref},t))},i}(e.Component),i.propTypes={dndManager:t.any},a})),define("dashboard-analytics/visualizations/renderer/grid/GridContentRenderer",["react","prop-types"],(function(e,t){var i=function(t){function i(e){return _classCallCheck(this,i),_possibleConstructorReturn(this,t.call(this,e))}return _inherits(i,t),i.prototype.render=function(){var t=this.props.displayValue,i=this.props.shapeId,a=["dashboard-text-cell"];return"shapeId"in this.props&&(a.push("grid-shape-right"),i||a.push("noShape")),e.createElement(e.Fragment,null,e.createElement("div",{className:a.join(" ")},t),i&&e.createElement("svg",{className:"dashboard-grid-shape"},e.createElement("use",{xlinkHref:"#"+i}),e.createElement("title",null,i)))},i}(e.Component);return i.propTypes={displayValue:t.string.isRequired,shapeId:t.string},i})),define("dashboard-analytics/visualizations/renderer/crosstab/CrosstabGrid",["../../../widgets/livewidget/nls/StringResources","./Pivot","../grid/GridDnDManager","underscore","../grid/GridDataProvider","../grid/GridDropTarget","../grid/GridContentRenderer","react-dom","react","ca-ui-toolkit","react-draggable","jquery","../../../util/DashboardFormatter"],(function(e,t,i,a,o,n,s,r,l,c,u,d,h){"use strict";var p="cell_edge_row",g="cell_edge_column",v="cell",m="values",f="summary",_="10pt",y="IBM Plex Sans",I=18;return function(){function b(e){_classCallCheck(this,b),e=e||{},this.$el=e.$el,this.visModel=e.visModel,this.dashboardApi=e.dashboardApi,this.crosstabView=e.crosstabView,this.content=this.crosstabView&&this.crosstabView.content,this.colorsService=e.colorsService,this.conditionalFormatting=e.conditionalFormatting,this.dataProvider=new o,this.textStyleIndex={cell:"dataValueStyles",corner:"valueHeadingStyles",row:"rowHeadingStyles",column:"columnHeadingStyles",summary:"summaryStyles",selectedArea:"selectedAreaStyles"},this._gridDnDManager=new i({grid:this,dashboardApi:this.dashboardApi,content:this.content,gridEdgeMappedToId:{row:"row_level1",column:"column_level1",values:"values"}}),this._shapeCols=[]}return b.prototype.render=function(e,i,a,o){return this.eventHandler=o,i&&!a&&this.data||(this._pivotTable=new t({data:e,visModel:this.visModel,slots:this.content.getFeature("Visualization").getSlots(),dashboard:this.dashboardApi,conditionalFormatting:this.conditionalFormatting}),this.data=this._pivotTable.create(),this._cellWidthStatus=null),this._alternateRowFlag=-1,this._cellStartRow=this._pivotTable.colEdgeNestingLevelWithMeasure?this._pivotTable.colEdgeNestingLevelWithMeasure:this._pivotTable.colEdgeNestingLevel,this.gridRef&&i&&!a?(this.onResize(),this.onSyncScrollBar(),Promise.resolve(!0)):(this.dataProvider.updateData(this.data),this._errorWarningAdded?this._errorWarningAdded=!1:this.crosstabView.clearInfoIndicator("error_summary_cell"),this.$el.addClass("dashboard-common-grid").addClass("xtab-grid"),this._renderReactGrid(),this.gridRef?Promise.resolve(!0):Promise.resolve(!1))},b.prototype.onResize=function(){this.maxColHeight=this._getMaxColHeight(),this.gridRef&&this.gridRef.recomputeGridSize()},b.prototype._getMaxColHeight=function(){return this.$el&&this.$el.length&&this.$el[0].offsetHeight||1/0},b.prototype.onSyncScrollBar=function(){var e=d(this.$el[0]),t=e.find(".ba-common-grid__bottom-right-grid"),i=e.find(".ba-common-grid__top-right-grid"),a=e.find(".ba-common-grid__bottom-left-grid");d(t).animate({scrollLeft:d(i).scrollLeft(),scrollTop:d(a).scrollTop()},0)},b.prototype.removeGridView=function(){this.gridRef&&this.$el&&(r.unmountComponentAtNode(this.$el[0]),this.gridRef=null)},b.prototype.remove=function(){this.columnWidths=null,this.rowHeights=null,this.fixedRowHeight=null,this.fixedColumnWidth=null,this.hiddenRowsAndColumns=null,this._cachedHiddenCol=null,this._cachedHiddenRow=null,this._cachedRowDataItemInfo=null,this._cachedLevelInfo=null,this._cachedColumnDataItemInfo=null,this.expandCollapseFeature=null,this.isExpandable=null,this.dataProvider=null,this.data=null,this._pivotTable=null,this.eventHandler=null,this._selections=null,this._measureHeaderDecorations=null,this._selectedMeasureNodes=null,this._isSummaryHighlighted=null,this._cellWidthStatus=null,this._canvas=null,this.removeGridView(),this.$el=null},b.prototype._setSummaryColor=function(e){var t=this.conditionalFormatting&&this.conditionalFormatting.getSummaryFillColor();t&&a.extend(e.style,{"background-color":t})},b.prototype._getConditionalFormatting=function(e,t,i){var a=void 0;if(this.conditionalFormatting){var o=i>=0&&this._pivotTable._measuresInfo.length>i?this._pivotTable._measuresInfo[i]:void 0;if(o){var n=this.content.getFeature("Visualization").getSlots().getDataItem(o.id);a=this.conditionalFormatting.getFormatting(t.rawValue,e.value,n.getColumnId())}}else{var s=this.visModel.getConditions()?this.visModel.getConditions().palette:null;if(s){var r=s.getColorByValue(e.value);r&&(a=r.getStyle())}}return a},b.prototype._getDataCellValue=function(e,t){if("tuple"===t)e=e&&e.tuple;else if("useValue"===t)e=e&&e.isMeasure?this._getValue(e):this._getUseValue(e);else if("condValue"===t)e=e&&e.condValue;else if("type"===t)e=e&&e.type;else if("isMeasure"===t)e=e&&e.isMeasure;else if("nestlevel"===t)e=e&&e.nestlevel;else if("rowEdge"===t)e=e&&e.rowEdge;else if("columnEdge"===t)e=e&&e.columnEdge;else if("ancestor_or_self"===t)e=e&&e.ancestor_or_self;else if("levelNumber"===t)e=e&&e.value&&e.value.ln;else if("parentUseValue"===t)e=e&&e.value&&e.value.pu;else{var i=this._getValue(e);e=void 0===i?"":i}return e},b.prototype._removeFocusedClassName=function(e){return this._selections&&(this._selections.datapointSelection||this._selections.rowSelection||this._selections.colSelection)||!e||-1===e.indexOf("cell-is-focused")?e:e.replace("cell-is-focused","").trim()},b.prototype.restoreFormat=function(){this.fixedRowHeight=null,this.fixedColumnWidth=null,this.columnWidths=null,this.rowHeights=null},b.prototype.setFormat=function(e){this.fixedRowHeight=e.fixedRowHeight,this.fixedColumnWidth=e.fixedColumnWidth,this.columnWidths=e.columnWidths,this.rowHeights=e.rowHeights},b.prototype.setHiddenRowsAndColumns=function(e){this.hiddenRowsAndColumns=e},b.prototype.setMeasureHeaderDecorations=function(e){var t=d(e).attr("usevalue");this._measureHeaderDecorations=this._measureHeaderDecorations||[],this._selectedMeasureNodes=this._selectedMeasureNodes||[],this._measureHeaderDecorations.indexOf(t)>-1||d(e).hasClass("dashboard-grid-cell-selected")?this.clearMeasureHeaderDecorations():(this._measureHeaderDecorations.push(t),this._selectedMeasureNodes.push(e))},b.prototype.getSelectedMeasureNodes=function(){return this._selectedMeasureNodes},b.prototype.clearMeasureHeaderDecorations=function(){this._measureHeaderDecorations=null,this._selectedMeasureNodes=null},b.prototype.highlightSummary=function(e){this._isSummaryHighlighted=!d(e).hasClass("dashboard-grid-cell-selected")},b.prototype.resetSummaryHighlight=function(){this._isSummaryHighlighted=!1},b.prototype.isSummaryHighlighted=function(){return this._isSummaryHighlighted},b.prototype._buildResizeKey=function(e){var t="";return a.each(e,(function(e){e.value?t+=e.value+",":t+=e+","})),t.slice(0,-1)},b.prototype._getSpanIndex=function(e){var t=e.colIndex,i=e.rowIndex,a=e.colBound,o=e.rowBound,n=e.dataProvider,s=e.fixedRows,r=e.fixedColumns,l=e.dataCellValue,c=e.gridCellProps,u=e.defaultColumnWidth,d=e.defaultRowHeight,h=e.ignoreGrouping,p=t+1,g=parseInt(c.style.width,10);if(!h.column)for(;p<=a&&this._getDataCellValue(n.getValue(i,p))===l&&this._getDataCellValue(n.getValue(0,p))===this._getDataCellValue(n.getValue(0,t));)g+=this._getColumnWidth(n,s-1,p,u),p++;var v=p-t-1,m=i+1,f=parseInt(c.style.height,10);if(!h.row)for(;m<=o&&this._getDataCellValue(n.getValue(m,t))===l&&this._getDataCellValue(n.getValue(m,0))===this._getDataCellValue(n.getValue(i,0));)f+=this._getRowHeight(n,m,r-1,d),m++;return{colSpan:v,rowSpan:m-i-1,gridCellColumnWidth:g,gridCellRowHeight:f}},b.prototype._calculateDelta=function(e,t,i,a){if(e+a0){var o=parseInt((e+a)/(i+1));op+1&&t.getValue(c-1,p+1))&&"corner"===this._getDataCellValue(b,"type")?this._getCachedDataItemInfoByIndex(this._cachedRowDataItemInfo,p+1,"dataitemId"):this._buildResizeKey(this._getDataCellValue(b,"ancestor_or_self"))):(f=this.rowHeights||{},_="rowHeights",p=o,v=n,g=r,m=24,y=t.getValue(p,l-1),I="corner"===this._getDataCellValue(y,"type")?this._getCachedDataItemInfoByIndex(this._cachedColumnDataItemInfo,p,"dataitemId")||"Measures_Row":this._buildResizeKey(this._getDataCellValue(y,"ancestor_or_self")),C=(b=t.getNumRows()-1>p+1&&t.getValue(p+1,l-1))&&"corner"===this._getDataCellValue(C,"type")?this._getCachedDataItemInfoByIndex(this._cachedColumnDataItemInfo,p+1,"dataitemId")||"Measures_Row":this._buildResizeKey(this._getDataCellValue(C,"ancestor_or_self")));var w=a+d;if(f[this._buildResizeKey(this._getDataCellValue(S,"ancestor_or_self"))]=w,f[I]=w,!h&&v>0&&g<=0&&C&&(f[C]=f[C]||u,f[C]=Math.max(f[C]-a,m)),g>0)for(var P=parseInt(w/(g+1)),R=g+1;R>0;)(I="x"===i?this._buildResizeKey(this._getDataCellValue(t.getValue(c-1,p+R-1),"ancestor_or_self")):this._buildResizeKey(this._getDataCellValue(t.getValue(p+R-1,l-1),"ancestor_or_self")))&&(f[I]=P),R--;this.crosstabView.setPropertyValue(_,f)}},b.prototype._onStartResizeGuideLine=function(e,t,i,o){var n={},s=void 0;"x"===t?(s="grid-column-resizer-guideLine",n.height=this.$el[0].clientHeight):(s="grid-row-resizer-guideLine",n.width=this.$el[0].clientWidth);var r=d(this.$el[0]).find("."+i);a.each(r,(function(e){d(e).addClass(i+"-resizing")}));var l=d(this.$el[0]).find(".xtab-grid-guideLine"),c=d(this.$el[0]).find("."+o).offsetParent().offsetParent().offset();d(l).addClass(s),n.top=e.clientY-c.top-1+"px",n.left=e.clientX-c.left-1+"px",d(l).css(n)},b.prototype._onDragResizeGuideLine=function(e,t,i){var a="x"===t,o=a?"grid-column-resizer-guideLine":"grid-row-resizer-guideLine",n=d(this.$el[0]).find("."+o),s=d(this.$el[0]).find("."+i).offsetParent().offsetParent().offset();a?d(n).css({left:e.clientX-s.left-1+"px"}):d(n).css({top:e.clientY-s.top-1+"px"})},b.prototype._onStopResizeGuideLine=function(e,t,i){var o="x"===t,n=o?"grid-column-resizer-guideLine":"grid-row-resizer-guideLine",s=o?{height:"",top:"",left:""}:{width:"",top:"",left:""},r=d(this.$el[0]).find("."+i);a.each(r,(function(e){d(e).removeClass(i+"-resizing")}));var l=d(this.$el[0]).find("."+n);d(l).css(s),d(l).removeClass(n)},b.prototype._renderResizeHandler=function(e){var t=this,i=e.dataProvider,a=e.direction,o=e.className,n=e.defaultValue,s=e.currentValue,r=e.containerClassName,c=e.offSetParent,d=e.rowIndex,h=e.colIndex,p=e.colSpan,g=e.rowSpan,v=e.fixedColumns,m=e.fixedRows,f=e.bound,_=e.skipBound,y="x"===a?p:g,I=l.createElement("div",{className:o,onDoubleClick:function(){var e="x"===a&&t._cellWidthStatus&&t._cellWidthStatus[h]&&t._cellWidthStatus[h].textWidth||n;-1!==t._shapeCols.indexOf(h)&&(e+=24);var o=e-s;if(y>0&&(o=e*y-s),o>0){var r={dataProvider:i,direction:a,delta:o,rowIndex:d,colIndex:h,colSpan:p,rowSpan:g,fixedColumns:v,fixedRows:m,defaultValue:n,currentValue:s,skipBound:_};t._onDraggableResize(r)}}},"");return l.createElement(u,{axis:a,position:{x:0,y:0},onStart:function(e){t._onStartResizeGuideLine(e,a,r,c)},onDrag:function(e){t._onDragResizeGuideLine(e,a,c)},onStop:function(e,o){t._onStopResizeGuideLine(e,a,r);var l="x"===a?o.x:o.y,c=t._calculateDelta(l,f,y,s),u={dataProvider:i,direction:a,delta:c,rowIndex:d,colIndex:h,colSpan:p,rowSpan:g,fixedColumns:v,fixedRows:m,defaultValue:n,currentValue:s,skipBound:_};t._onDraggableResize(u)}},I)},b.prototype._renderHiddenRowsAndColumnsHandler=function(e){var t=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"bottom";return l.createElement("div",{class:"grid-hidden-rowsAndColumns "+i,onDoubleClick:function(){t.crosstabView.setPropertyValue("hiddenRowsAndColumns",t.hiddenRowsAndColumns.filter((function(t){return t!==e})))}},"")},b.prototype._renderExpandButton=function(t){var i=this,a=t.dataItemInfo,o=t.parentUseValue,n=t.currentUseValue;return l.createElement(c.Button,{icon:"visualizations-expand_16",iconSize:"small",variant:"icon",intent:"primary",title:e.get("expandBtnLabel"),onClick:function(e){i.expandCollapseFeature.expand(a.dataitemUniqueId,o,n),e.stopPropagation()}})},b.prototype._renderCollapseButton=function(t){var i=this,a=t.dataItemInfo,o=t.parentUseValue,n=t.currentUseValue,s=t.hasChildren;return l.createElement(c.Button,{icon:"visualizations-collapse_16",iconSize:"small",variant:"icon",intent:"primary",title:e.get("collapseBtnLabel"),onClick:function(e){i.expandCollapseFeature.collapse(a.dataitemUniqueId,o,n),e.stopPropagation()},style:s?{}:{visibility:"hidden"}})},b.prototype._renderTextCell=function(e,t){var i=[],a={};if(void 0!==t.levelNumber){var o=t.isExpanded?this._renderCollapseButton(t):this._renderExpandButton(t);i.push(o),a["top"===t.position?"margin-top":"margin-left"]=24*(t.levelNumber-t.rootLevel)}return i.push(e),l.createElement("div",{class:"dashboard-text-cell",style:a},i)},b.prototype._renderGridCellContent=function(e,t,i,a){var o=e+i,n=-1!==this._shapeCols.indexOf(o);!n&&t.shapeId&&(n=!!this._shapeCols.push(o));var r={displayValue:this._wrapDataCellValue(e+i,a,t,!0,n)};return n&&(r.shapeId=t.shapeId),l.createElement(s,r)},b.prototype._renderEdgeSelection=function(e,t,i,o){var n=this._getSlotIDByEdgeType(e),s=this._getDataCellValue(t,"ancestor_or_self"),r="row_level1"===n?this._selections.rowSelection:this._selections.colSelection;r&&r.isSelected(s)?o.push("dashboard-grid-cell-selected"):-1!==a.chain(a.pluck(this.crosstabView.getSelector().getSelections(),"categories")).flatten().map((function(e){return e.value})).value().indexOf(i)&&o.push("dashboard-grid-cell-selected")},b.prototype._renderDatapointSelection=function(e,t){var i=this._getDataCellValue(e,"columnEdge"),o=this._getDataCellValue(e,"rowEdge");if(i&&o&&a.isObject(o.value)&&(i.isMeasure||a.isObject(i.value))){var n=this._selections.datapointSelection;if(n){var s=i.isMeasure?[]:this._getCurrentEdgeSelectionContext(i),r=this._getCurrentEdgeSelectionContext(o);n.isSelected(s.concat(r))&&t.push("dashboard-grid-cell-selected")}}},b.prototype._getSelectionFormattingStyles=function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",i=this.textStyle[this.textStyleIndex.selectedArea],o={},n="";if(a.each(i,(function(i,a){for(var s=t,r=i&&i[s];s&&s.lastIndexOf(",")>0;){s=s.slice(0,s.lastIndexOf(","));var l=i&&i[s];(r&&l&&r.weightn&&(n=c)})),""!==a.values(o).join(""))return{convertedStylesValue:o,weight:n}},b.prototype._getSelectionFormattingStylesForTuple=function(e,t){var i=this._getEdgeUseValues(e,t),a=i.columnEdgeUseValue,o=i.rowEdgeUseValue,n=this._getSelectionFormattingStyles(a),s=this._getSelectionFormattingStyles(o),r=n||s;return n&&s&&(r=n.weight>s.weight?n:s),r},b.prototype._getEdgeUseValues=function(e,t){var i=e.columnEdge&&e.columnEdge.descendant_or_self_without_measures,o=i&&i.length||0,n=t&&a.isString(t)?t.split(","):null;return{columnEdgeUseValue:n&&n.slice(0,o).join(","),rowEdgeUseValue:n&&n.slice(o,n.length).join(",")}},b.prototype._isMeasureHidden=function(e,t,i){if(t<1)return!1;var a=e.getValue(t-1,i),o=this._getDataCellValue(a,"useValue");return this._isRowOrColumnHidden(o)},b.prototype._isRowOrColumnHidden=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";if(this.hiddenRowsAndColumns.length<1)return!1;for(var t=-1!==this.hiddenRowsAndColumns.indexOf(e);e&&e.lastIndexOf(",")>0&&!t;)e=e.slice(0,e.lastIndexOf(",")),t=-1!==this.hiddenRowsAndColumns.indexOf(e);return t},b.prototype._getCanvasFont=function(e){var t={"font-style":e["font-style"],"font-weight":e["font-weight"],"font-size":e["font-size"]||_,"font-family":e["font-family"]||y};return a.values(t).join(" ")},b.prototype._getTextWidth=function(e,t){this._canvas=this._canvas||document.createElement("canvas");var i=this._canvas.getContext("2d");return i.font=t,parseInt(i.measureText(e).width)},b.prototype._generateWrappedText=function(e,t,i){var a=this._cellWidthStatus&&this._cellWidthStatus[e],o=a&&a.charCount,n=a&&a.cellWidth;if(o&&i===n)return"#".repeat(o);var s=this._getTextWidth("#",t),r=parseInt((i-I)/s);return r=r<=0?1:r,this._cellWidthStatus=this._cellWidthStatus||{},this._cellWidthStatus[e]=this._cellWidthStatus[e]||{},this._cellWidthStatus[e].charCount=r,this._cellWidthStatus[e].cellWidth=i,"#".repeat(r)},b.prototype._wrapDataCellValue=function(e,t,i,a,o){var n=this._getCanvasFont(i),s=this._getTextWidth(t,n)+I,r=parseInt(i.width),l=s;return o&&(l+=24),l>r&&(this._cellWidthStatus=this._cellWidthStatus||{},this._cellWidthStatus[e]=this._cellWidthStatus[e]||{},this._cellWidthStatus[e].textWidth=this._cellWidthStatus[e].textWidth0&&(i++,o.forEach((function(e){var o=e.getDrillDownValue();if(t[o]=!0,e.getUnion().getDataItemList().length>0){var n=a._getExpandInfo(e,t,i).maxDepth;n>i&&(i=n)}}))),{maxDepth:i,expandMap:t}},b.prototype._getDataItemInfoBySlotId=function(e){var t=this,i=this.content&&this.content.getFeature("Visualization"),o=(i&&i.getSlots()).getSlot(e),n={};return o&&a.each(o.getDataItemList(),(function(e,i){var a=t._getExpandInfo(e,{},0);n[i]={dataitemId:e.getColumnId(),dataitemUniqueId:e.getId(),expandMap:a.expandMap,maxDepth:a.maxDepth,isProperty:e.getMetadataColumn().isProperty()}})),n},b.prototype._getCachedDataItemInfoByIndex=function(e,t,i){var a=e&&e[t];return i?a&&a[i]:a},b.prototype._getCellPropertyColors=function(){try{var e=this.content&&this.content.getPropertyValue("fillColor"),t=e&&this.colorsService.getHexColorFromDashboardColorSet(e),i=this.colorsService.getForegroundColorPropertiesForUIElement(e,"tabs");return{cellFillColor:t,cellTextColor:i&&i.length&&i[0].value}}catch(e){return{}}},b.prototype._getIndentationDepth=function(e,t,i){var a=this._getCachedDataItemInfoByIndex(e,i,"maxDepth")||0,o=this._cachedLevelInfo[t][i],n=o&&o.maxLevelDepth||0;return Math.max(a,n)},b.prototype._getColumnWidth=function(e,t,i,a){if(this._cachedHiddenCol[i])return 1e-6;var o=e.getValue(t,i),n=this._getDataCellValue(o,"isMeasure");if(this._isRowOrColumnHidden(this._getDataCellValue(o,"useValue"))||n&&this._isMeasureHidden(e,t,i))return this._cachedHiddenCol[i]=!0,1e-6;var s="corner"===this._getDataCellValue(o,"type")?this._getCachedDataItemInfoByIndex(this._cachedRowDataItemInfo,i,"dataitemId"):this._buildResizeKey(this._getDataCellValue(o,"ancestor_or_self"));if(this.columnWidths&&this.columnWidths[s])return this.columnWidths[s];-1!==this._shapeCols.indexOf(i)&&(a+=24);var r=this._getIndentationDepth(this._cachedRowDataItemInfo,"col",i);return this.isExpandable&&r>0?parseInt(a,10)+24*r:a},b.prototype._getRowHeight=function(e,t,i,a){if(this._cachedHiddenRow[i])return 1e-6;var o=e.getValue(t,i);if(this._isRowOrColumnHidden(this._getDataCellValue(o,"useValue")))return this._cachedHiddenRow[t]=!0,1e-6;var n="corner"===this._getDataCellValue(o,"type")?this._getCachedDataItemInfoByIndex(this._cachedColumnDataItemInfo,t,"dataitemId")||"Measures_Row":this._buildResizeKey(this._getDataCellValue(o,"ancestor_or_self"));if(this.rowHeights&&this.rowHeights[n])return this.rowHeights[n];var s=this._getIndentationDepth(this._cachedColumnDataItemInfo,"row",t);return this.isExpandable&&s>0?parseInt(a,10)+24*s:a},b.prototype._renderReactGrid=function(){var e=this,t=this.dataProvider;t.updateData.bind(this.dataProvider),t.getNumColumns.bind(this.dataProvider),t.getNumRows.bind(this.dataProvider),t.getValue.bind(this.dataProvider),this.maxColHeight=this._getMaxColHeight();var i=this._pivotTable.getNestingLevels().rowNestingLevel,o=this._pivotTable.getNestingLevels().colNestingLevel;t.updateData(this.data);var s=t.getNumColumns()-i,u=t.getNumRows()-o,d=this.fixedRowHeight||32,_=this.fixedColumnWidth||120;0===u&&(o=u),0===s&&(i=s);var y=this._getCellPropertyColors(),I=y.cellFillColor,b=y.cellTextColor,C=this._isSuppressionOn();this.isExpandable=this._isExpandable(),this.isExpandable&&(this.expandCollapseFeature=this.content&&this.content.getFeature("ExpandCollapse")),this._cachedRowDataItemInfo=this._getDataItemInfoBySlotId("row_level1"),this._cachedColumnDataItemInfo=this._getDataItemInfoBySlotId("column_level1"),this._cachedLevelInfo=this._pivotTable.getLevelInfo(),this._cachedHiddenRow={},this._cachedHiddenCol={};var S=i>1?2:20,w=o>1?2:10,P=l.createElement(c.Grid,{rowHeight:function(a){return e._getRowHeight(t,a,i-1,d)},columnWidth:function(i){return e._getColumnWidth(t,o-1,i,_)},numColumns:s,numRows:u,fixedRows:o,fixedColumns:i,dataCellRenderer:function(n,s,r){var c=t.getValue(n+o,s+i),u=e._isSummary(c),d=e._getDataCellValue(c),p=e._pivotTable._measuresInfo,g=p.length>0?s%p.length:null,m=Number.isInteger(g)?p[g].formatSpec:null,_=e.crosstabView&&e.crosstabView.content;if(_){var y=_.getPropertyValue("format");y&&(m=a.extend({},m,y))}d=h.formatNull(d,m);var C=e._getDataCellValue(c,"tuple"),S=["word-break","white-space"];a.extend(r,{tuple:C,measure:e._getDataCellValue(c,"isMeasure"),row:n+o,col:s+i,"aria-label":d,tabindex:0,area:v}),r.className=e._removeFocusedClassName(r.className);var w=[r.className];if(w.push("grid-data-cell","dashboard-grid-cell"),e._cachedHiddenRow[n+o]||e._cachedHiddenCol[s+i])return r.className=w.join(" "),l.createElement("div",r,"");if(I&&!u&&((n+o)%2==0?(r.style=a.extend(r.style,{color:b}),w.push("light")):r.style=a.extend(r.style,{backgroundColor:I,color:b})),!e._getDataCellValue(c,"type")){var P=Object.assign({},e.textStyle[e.textStyleIndex.cell]);Object.keys(P).forEach((function(e){return""===P[e]&&delete P[e]})),Object.assign(r.style,e._getWhiteListStyles(P,S))}var R=e._getSelectionFormattingStylesForTuple(c,C);if(R){var D=R.convertedStylesValue;Object.keys(D).forEach((function(e){return""===D[e]&&delete D[e]})),Object.assign(r.style,e._getWhiteListStyles(D,S))}(n+o)%2==0&&w.push("alternate");var x=e._getDataCellValue(c,"condValue");if(x){var T=e._getConditionalFormatting(x,c,g);a.extend(r.style,T)}e._renderDatapointSelection(c,w);var V=[];return u&&(w.push("summary"),c.rowEdge.isSummary&&V.push(l.createElement("div",{className:"grid-summary-decorator"},"")),r.area=f,a.extend(r.style,e._getWhiteListStyles(e.textStyle[e.textStyleIndex.summary],S)),a.extend(r.style,{"font-weight":"bold"}),e._isSummaryHighlighted&&w.push("dashboard-grid-cell-selected"),e._setSummaryColor(r)),V.push(e._renderGridCellContent(s,r.style,i,d)),r.className=w.join(" "),l.createElement("div",r,V)},fixedRowCellRenderer:function(r,c,u){var p=t.getValue(r,c+i),v=e._isSummary(p),y=e._getDataCellValue(p,"useValue"),I=e._getDataCellValue(p),b=e._getDataCellValue(p,"isMeasure");a.extend(u,{useValue:y,nestlevel:e._getDataCellValue(p,"nestlevel"),row:r,col:c+i,scope:"col","aria-label":I,tabindex:0,area:g});var S=u.className?[u.className]:[];if(S.push("grid-fixed-row-cell","dashboard-grid-cell"),e._cachedHiddenCol[c+i])return u.className=S.join(" "),u.style.zIndex=s-c,delete u.style.width,l.createElement("div",u,e._renderHiddenRowsAndColumnsHandler(y,"left"));var w=e._getDataCellValue(p,"type");if(w=w&&"column"===w&&b?"corner":w){var P=e.textStyleIndex[w];a.extend(u.style,e.textStyle[P]),"corner"===w&&(a.extend(u,{area:m,measure:"true"}),e._measureHeaderDecorations&&e._measureHeaderDecorations.indexOf(y)>-1&&S.push("dashboard-grid-cell-selected"))}var R=e._getSelectionFormattingStyles(y);R&&a.extend(u.style,R.convertedStylesValue);var D={colIndex:c+i,rowIndex:r,colBound:s+1,rowBound:o,dataProvider:t,fixedRows:o,fixedColumns:i,dataCellValue:I,gridCellProps:u,defaultColumnWidth:_,defaultRowHeight:d,ignoreGrouping:{row:!v}},x=e._getSpanIndex(D),T=x.colSpan,V=x.rowSpan,L=x.gridCellColumnWidth,E=x.gridCellRowHeight;a.extend(u.style,{width:L+"px",zIndex:s-c+(T>V?T:V)});var A=e._pivotTable._columnInfo,N=c%A.length,F=A[N]&&A[N].formatSpec,M=e.crosstabView&&e.crosstabView.content;if(M){var z=M.getPropertyValue("format");z&&(F=a.extend({},F,z))}v&&(F=null);var O=C?h.format(I,F):h.formatNull(I),k=c+ix?D:x)});var L=e._pivotTable._rowInfo,E=r%L.length,A=L[E]&&L[E].formatSpec,N=e.crosstabView&&e.crosstabView.content;if(N){var F=N.getPropertyValue("format");F&&(A=a.extend({},A,F))}v&&(A=null);var M=C?h.format(y,A):h.formatNull(y),z=sb?I:b)});var w=[l.createElement("div",{class:"dashboard-text-cell"},h)];return h&&(w.push(l.createElement("div",{class:"grid-drop-zone left"},"")),w.push(l.createElement("div",{class:"grid-drop-zone replace"},"")),w.push(l.createElement("div",{class:"grid-drop-zone right"},""))),c.className=p.join(" "),l.createElement(n,_extends({dndManager:e._gridDnDManager,isMeasure:!0,cellType:"corner"},c),w)},overscanRowCount:S,overscanColumnCount:w,style:{},ref:function(t){e.gridRef=t},maxColumnWidth:1/0}),R=l.createElement("div",{class:"xtab-grid-guideLine"},""),D=l.createElement("div",{class:"xtab-grid-view"},[P,R]);r.render(D,this.$el[0]),this.gridRef&&this.gridRef.recomputeGridSize()},b.prototype._isSummary=function(e){return!!e&&(e.rowEdge&&e.columnEdge?e.columnEdge.isSummary||e.rowEdge.isSummary:e.isSummary)},b.prototype.setSelections=function(e,t){t&&t.clearSelectionCaches&&(this.resetSummaryHighlight(),this.clearMeasureHeaderDecorations()),this._selections=e},b.prototype._getSlotIDByEdgeType=function(e){return"row"===e?"row_level1":"column"===e?"column_level1":null},b.prototype.setStyles=function(e){this.textStyle=e},b.prototype._getCurrentEdgeSelectionContext=function(e){var t=a.clone(e.ancestor_or_self),i=a.clone(e.descendant_or_self);return(t=a.filter(t,(function(e){return e.value}))).pop(),i=a.filter(i,(function(e){return e.value})),(t||[]).concat(i||[])},b.prototype.onEnterContainer=function(){var e=d(this.$el[0]).find('.grid-corner-cell[row="0"][col="0"]');e.length&&e.focus()},b.prototype._getValue=function(e){if(null!=e)return e.value&&void 0!==e.value.label?e.value.label:e.value},b.prototype._getUseValue=function(e){if("column"===e.type||"row"===e.type){var t=e.ancestor_or_self;if(t)return a.pluck(t,"value")+""}return null},b.prototype.showDropZone=function(e){this.hideDropZones(),this.$el.find(e).css({display:"block"}),this.$el.find(".grid-column-resizer, .grid-row-resizer").css({display:"none"})},b.prototype.hideDropZones=function(){this.$el.find(".grid-drop-zone").css({display:"none"}),this.$el.find(".grid-column-resizer, .grid-row-resizer").css({display:"block"})},b.prototype.showReplaceDropZone=function(e,t,i){"corner"===e?this.showDropZone(".grid-corner-cell > .grid-drop-zone"):"row"===t?i?this.showDropZone('.grid-fixed-row-cell[row="'+e+'"][useValue="'+i+'"] > .grid-drop-zone'):this.showDropZone('.grid-fixed-row-cell[row="'+e+'"] > .grid-drop-zone'):"col"===t&&this.showDropZone('.grid-fixed-column-cell[col="'+e+'"] > .grid-drop-zone')},b.prototype.showLeftDropZone=function(e){"corner"===e?this.showDropZone(".grid-corner-cell > .grid-drop-zone.left"):this.showDropZone('.grid-fixed-column-cell[col="'+e+'"] > .grid-drop-zone.left, .grid-fixed-row-cell[col="'+e+'"] > .grid-drop-zone.left')},b.prototype.showRightDropZone=function(e){"corner"===e?this.showDropZone(".grid-corner-cell > .grid-drop-zone.right"):this.showDropZone('.grid-fixed-column-cell[col="'+e+'"] > .grid-drop-zone.right, .grid-fixed-row-cell[col="'+e+'"] > .grid-drop-zone.right')},b.prototype.showTopDropZone=function(e){this.showDropZone('.grid-fixed-row-cell[row="'+e+'"] > .grid-drop-zone.top')},b.prototype.showBottomDropZone=function(e){this.showDropZone('.grid-fixed-row-cell[row="'+e+'"] > .grid-drop-zone.bottom')},b}()})),define("text!dashboard-analytics/visualizations/renderer/crosstab/Crosstab.html",[],(function(){return'
\n\t
{{=it.v||" "}}
\n\t{{=it.showTitleString || ""}}\n
'})),define("dashboard-analytics/visualizations/renderer/crosstab/CrosstabEventTarget",["jquery","../common/NonVIPREventTarget","underscore"],(function(e,t,i){var a="datapoint",o="itemclass",n="item",s="summary",r="expanded",l="row",c="column",u="values",d="summary",h="column_level1",p="row_level1",g="values",v="heat";return function(t){function m(){_classCallCheck(this,m);for(var e=arguments.length,i=Array(e),a=0;a0){var s=e[0].source;if(s){var r=s.attr("area"),l=r===d;r===u&&(i?a?n.decorateMeasureHeader(s[0]):this._clearSelectionController().then((function(){n.clearSelection({clearSelectionCaches:!0}),n.decorateMeasureHeader(s[0])})):n.resetMeasureHeaderDecorations(),o=!0),l&&(i?this._clearSelectionController().then((function(){n.clearSelection({clearSelectionCaches:!0}),n.highlightSummary(s[0])})):n.resetSummaryHighlight(),o=!0)}}else e||(n.resetMeasureHeaderDecorations(),n.resetSummaryHighlight(),o=!0)}return o},m.prototype._clearSelectionController=function(){var e=this.content.getFeature("Visualization").getSlots().getMappedSlotList(),t=[];return i.each(e,(function(e){var a=e.getDataItemList();"category"===a[0].getType()&&i.each(a,(function(e){t.push(e.getColumnId())}))})),this.content.getFeature("InteractivityController.deprecated").select({itemIds:t,tuple:[],command:"update",slotsToClear:e})},m.prototype.remove=function(){this.ownerWidget=null,this.view=null,t.prototype.remove.call(this)},m.prototype._getEventTargetItem=function(t){var i=this._getTargetNode(t);if(i&&i.textContent){var a=e(i),o=a.attr("tuple");return this.view.visControl.isCrosstaMeasureNodeSelected(i)||"true"===a.attr("measure")?[this._getMeasureItemClassTarget(t)]:a.attr("area")===d?[this._getSummaryItemTarget(t,o)]:o?[this._getDatapointTarget(t)]:[this._getItemTarget(t)]}},m.prototype._getDatapointTarget=function(t){var o=this.view.visControl.dataPointNodeToSlotsSelections(t);if(!o)return null;var n=o.attributeSelections,s=[];o.selectionContext?s[o.selectionContext]=o.factSelections&&o.factSelections[0]?o.factSelections[0].value:[]:s=o.factSelections&&o.factSelections[0]?[o.factSelections[0].value]:[];var u=i.pluck(i.filter(n,(function(e){return e.edgeType===c})),"value"),d=i.pluck(i.filter(n,(function(e){return e.edgeType===l})),"value"),h=o.factSelections&&o.factSelections[1]?[o.factSelections[1].value]:[],p=this._createItem(a,t);return this._addItemValues(p.values,u,d,s,h),this._includesExpanded(u,d)?(p.infoType=r,p.values=[],e(t.currentTarget).addClass("hoverExpanded")):e(t.currentTarget).removeClass("hoverExpanded"),p},m.prototype._getItemTarget=function(t){var i=this.view.visControl.nodeToSelection(t);if(!i)return null;var o=i.column_level1?i.column_level1.value:[],s=i.row_level1?i.row_level1.value:[],l=i.datapoint?[i.datapoint]:[],c=i.itemClassValues?i.itemClassValues:[],u=!0===i.isInnerEdge?a:n,d=this._createItem(u,t);if(c.length>0)d.values=c,d.selectionContext=this._getMeasureSelectionContext(d.values);else{var h=this._getSelectionContext(i.selectionContext);h&&(d.selectionContext=h,d.selectionContext.actions.actionOptions={deleteAction:{excludeAction:!0},jumpToAction:{area:t.target.getAttribute("area")}}),this._addItemValues(d.values,o,s,l)}return this._includesExpanded(o,s)?(d.infoType=r,d.values=[],e(t.currentTarget).addClass("hoverExpanded")):e(t.currentTarget).removeClass("hoverExpanded"),d},m.prototype._getMeasureSelectionContext=function(e){var t={actions:{actionsToKeep:[],actionOptions:{}}};return t.slots=[this.visualization.getSlots().getSlot(g)],t.mapIndex=[],i.each(e,(function(e){i.each(e,(function(e){t.mapIndex.push(e.mapIndex)}))})),t},m.prototype._getSelectionContext=function(e){if(void 0===e.level)return null;var t=this.visualization.getSlots().getSlot(e.slotID),i=t&&t.getDataItemList();return i&&i.length>0&&e.level-1)this._slotRowSortOrder=this._slots[e].getDefinition().getSortOrder(),this._slotRowStartIndex=e;else if(this._slots[e].getId().indexOf("value")>-1){this._slotValueStartIndex=e;break}this._populateFactSlots()},clear:function(){t(this.domNode).empty()},setGridData:function(e){this._crosstabGrid=e},_removeNonProjectedSelections:function(e){for(var t=0;t=2&&(i.isInnerEdge=!0),r.columnEdge&&this._getSelectionOnEdges(i,r.columnEdge.descendant_or_self,!0,r,a,"column_level1"),r.rowEdge&&this._getSelectionOnEdges(i,r.rowEdge.descendant_or_self,!1,r,a,"row_level1"),r.rowEdge||this._getSelectionOnEdges(i,r.ancestor_or_self,"column"===r.type,r,a),"column"!==r.type&&"row"!==r.type&&(i.datapoint=r.value),(this.isCrosstaMeasureNodeSelected(e.target)||"true"===t(e.target).attr("measure"))&&this._getMeasureHeaderItemValues(i,e)}return i}},_getSelectionOnEdges:function(e,t,i,o,n){var s=i?"column_level1":"row_level1";e.selectionContext={slotID:s,level:o.nestLevel},a.each(t,function(t){this.isFactSlot(t)||(n.push(t.u),e[s]?e[s].value.push(t):e[s]={value:[t]})}.bind(this))},_populateFactSlots:function(){for(var e=[],t=this._slots,i=[],o=0;o=0},edgeNodeToSelectionObject:function(e,t){var i=e.attr("col")||e.parent().attr("col"),a=e.attr("row")||e.parent().attr("row"),o=this._crosstabGrid.data[a][i];if(o.type)return{attributeSelections:[{column:t.getMapping(),value:o.value,edgeType:o.type}]}},dataPointNodeToSlotsSelections:function(e){var i=t(e.target),o=i.attr("col")||i.parent().attr("col"),n=i.attr("row")||i.parent().attr("row"),s=this._crosstabGrid.data[n][o];if(!s.type){var r=[];if(this._getSlotsOnEdges(e,r),0!==r.length){for(var l=void 0,c=0;c0&&v[0].getLabel()!==d.columnName&&u.push({columnName:v[0].getLabel(),value:s.condValue?s.condValue.formatted:s.value})}return{attributeSelections:r,factSelections:u,selectionContext:h}}}},_getFactDataItemIndex:function(e){for(var t=e.columnEdge;t.subCategory;)t=t.subCategory;return t.index},_getFactDataslot:function(e){return a.find(this._factDataslots,function(t){var i=t.getMapping();return this.visModel.getLabelByMapping(i)===e}.bind(this))},isSummaryNodeSelected:function(e){return e.textContent===o.get("summaryCaption")},_getSlotsOnEdges:function(e,i){var a=t(e.target),o=a.attr("col")||a.parent().attr("col"),n=a.attr("row")||a.parent().attr("row"),s=this._crosstabGrid.data[n][o];s.columnEdge&&this._getSlotsSelectionsOnEdges(i,s.columnEdge),s.rowEdge&&this._getSlotsSelectionsOnEdges(i,s.rowEdge),s.rowEdge||this._getSlotsSelectionsOnEdges(i,s)},edgeNodeToDataslots:function(e){if(this.isEdgeNodeSelected(e)){var i=e.textContent;if(this.isFactSlot(i))return this._getFactDataslot(i);var a=t(e),o=Number(a.attr("nestLevel"));return t(e).hasClass("row")&&(o+=this._slotRowStartIndex),this._slots[o]}},measureNodeToDataslots:function(e){if(this.isCrosstaMeasureNodeSelected(e))return this._slots[this._slotValueStartIndex]},_getSlotsSelectionsOnEdges:function(e,t){for(var i=t;i;){var a;if(i.isMeasure)a=this.visualization.getSlots().getSlot("values");else{var o="column"===i.type?"column_level1":"row_level1";a=this.visualization.getSlots().getSlot(o)}e.push({column:a.getDataItemList()[0],value:i.value,edgeType:i.type}),i=i.subCategory}},_getMeasureHeaderItemValues:function(e,i){var o=this,n=void 0,s=[],r=this.getSelectedMeasureNodes();n=r&&2===r.length&&r[0]!==r[1]?r:[t(i.target)],a.each(n,(function(e){var i=void 0,n=o.visualization.getSlots().getMappedSlotList();a.find(n,(function(e,t){if("values"===e.getId())return i=t,!0}));var r=t(e),l=o._crosstabGrid.data[r.attr("row")][r.attr("col")],c=o.visualization.getSlots().getSlot("values").getDataItemList(),u=void 0;a.find(c,(function(e,t){if(e.getLabel()===l.value)return u=t,!0}));var d=c[u],h={u:d.getColumnId(),d:d.getLabel(),mapIndex:u};s[i]||(s[i]=[]),s[i].push(h)})),e.itemClassValues=s},getSelectedMeasureNodes:function(){return this._crosstabGrid.getSelectedMeasureNodes()}});return n})),define("dashboard-analytics/visualizations/renderer/grid/GridEventTarget",["jquery","../common/NonVIPREventTarget","underscore","../VisEventHandler","../../../lib/@waca/dashboard-common/dist/utils/EventChainLocal","../../../util/EventUtils"],(function(e,t,i,a,o,n){return function(t){function s(){var e;_classCallCheck(this,s);for(var i=arguments.length,o=Array(i),n=0;n0?i.push({key:a+":",type:"itemclass",source:t,isEdgeSelect:!0,values:this._getColumnTargetValues(s,a),selectionContext:this._getHeaderSelectionContext(s),area:"visualization"}):new o(e).setProperty("preventDefaultContextBar",!0);return i},s.prototype._getColumnTargetValues=function(t,a){var o=this,n=[];return i.each(t,(function(t){var s=e(t).attr("col"),r=o.visControl.findSlotDetails(s).slotIndex,l=o.visControl._dataRows[a][s];l=i.isUndefined(l.value)?l:l.value,l=i.isArray(l)?l[0]:l,n[r]={value:l}})),n},s.prototype._getRowTargets=function(e,t){var i=[],a=parseInt(t.attr("row")),o=parseInt(t.attr("col")),n=this.visControl.isGroupedColumn(o)?o+1:this.visControl._dataRows[a].length,s="click"===e.type&&1===e.which||"tap"===e.type;return i.push({key:a+":"+(n-1),type:s?"item":"datapoint",source:t,isEdgeSelect:!0,values:this._getRowTargetValues(a,n),area:"visualization"}),i},s.prototype._getRowTargetValues=function(e,t){for(var a=[],o=[],s=void 0,r=0;r',className:"dataview grid-view",alwaysRenderOnResize:!0,PROPERTY_TO_STYLE:{"font-weight":"bold","font-style":"italic","text-decoration":"underline"},CELL_VALUE_PROPERTY_MAP:{cellValueColor:"color",cellValueFontSize:"font-size",cellValueFontFace:"font-family",cellValueFontBold:"font-weight",cellValueFontItalic:"font-style",cellValueFontUnderline:"text-decoration",cellValueFontAlign:"text-align"},COL_HEADING_PROPERTY_MAP:{columnHeadingColor:"color",columnHeadingFontSize:"font-size",columnHeadingFontFace:"font-family",columnHeadingFontBold:"font-weight",columnHeadingFontItalic:"font-style",columnHeadingFontUnderline:"text-decoration",columnHeadingFontAlign:"text-align"},_focusedCellIDs:{key:null,cellIDs:[]},init:function(){if(s.inherited("init",this,arguments),this.isMobilePannable=!0,this._isNewConditionalFormatFeature())this._conditionalFormatting=this.content.getFeature("ConditionalFormatting");else{var e=this.content.getFeature("ConditionalFormatting");if(e){var t=this.content.getFeature("Properties"),i=this.dashboardApi.getFeature("CustomColor");t.deregisterProvider(e),i.deregisterProvider(e)}}},_isNewConditionalFormatFeature:function(){return!this.dashboardApi.getGlassCoreSvc(".FeatureChecker").checkValue("dashboard","xtabcondFormat","disabled")},_initializeConditionalFormatting:function(){return this._conditionalFormatting?this._conditionalFormatting.initializeFeature():Promise.resolve()},whenVisControlReady:function(){var e=this;return this.visControl?Promise.resolve(this.visControl):new Promise((function(t,i){try{require([e.visModel.getDefinition().control],(function(i){e.visControl=new i({domNode:e.$el.find(".grid-view")[0],gridView:e,tabNavigation:e.ownerWidget.interactivitySettings.tabNavigation,dashboardApi:e.dashboardApi,summaryFeature:e.content.getFeature("SummaryFeature"),conditionalFormatting:e._conditionalFormatting,cellRenderer:e.content.getFeature("CellRenderer.react")}),e.visControl.reset(e.visModel),t(e.visControl)}),i)}catch(e){i(e)}})).then((function(){return e.eventHandler=new o({target:new i({$el:e.$el,visControl:e.visControl,visAPI:e.visModel}),transaction:e.transactionApi,ownerWidget:e.ownerWidget,visAPI:e.visModel,edgeSelection:!0}),e.visControl}))},getCurrentViewSelector:function(){return this.eventHandler},animate:function(){this.resizing?this.visModel.renderCompleteBeforeAnimation():s.inherited("animate",this,arguments)},whenSetDataReady:function(e){return e.data&&e.data.getResult&&(this.visControl.reset(this.visModel),this.visControl.setData(e.data.getResult())),Promise.resolve(!0)},render:function(e){var t=this,i=arguments;return this._initializeConditionalFormatting().then((function(){if(!t.isMappingComplete()||t.hasMissingFilters()||t.hasUnavailableMetadataColumns())return t.removeGridView(),t.resizeToWidget(e),t.renderIconView(),t.updateSubViews(),Promise.resolve(t);if(!t.visControl)return Promise.reject(new Error);if(!t.visControl.hasData())return Promise.resolve(t);t.removeIconView(),t.resizeToWidget(e);var a=t.resizing,o=t.getRenderingNewData(),n={};return n.headerStyles=t._constructTextStyles(t.COL_HEADING_PROPERTY_MAP,t.visModel),n.cellStyles=t._constructTextStyles(t.CELL_VALUE_PROPERTY_MAP,t.visModel),t.visControl.setStyles(n),t.setSelections(),t.visControl.render(a,o).then((function(e){return e?s.inherited("render",t,i):{reRenderNeeded:!0}}))}))},_constructTextStyles:function(e,i){var a={},o=this.PROPERTY_TO_STYLE;return t.each(e,(function(e,t){var n=i.getPropertyValue(t);n?(o[e]&&(n=o[e]),a[e]=n):a[e]=""})),a},getDescription:function(){var e=s.inherited("getDescription",this,arguments);return n.get("WidgetLabelWithDescripion",{label:e,description:n.get("f12KeyDescription")})},removeGridView:function(){this.visControl&&this.visControl.removeGridView()},remove:function(){this.eventHandler&&(this.eventHandler.remove(),this.eventHandler=null),this.visControl&&(this.visControl.remove(),this.visControl=null),s.inherited("remove",this,arguments)},_extendTuples:function(e,i,a,o){t.each(e,(function(e){var n={};n[a]=o,i.push(t.extend(n,e))}))},_getSelectionValues:function(){var e=[],i=this.getController(),a=this.visControl.getRankDataItemCount();return t.each(this.visualization.getSlots().getMappedSlotList(),function(o){"heat"!==o.getId()&&t.each(o.getDataItemList(),function(o){var n=i.getSelectedTuples([o.getColumnId()]);if(n&&n.length){var s=[];t.each(n,function(t){if(0===e.length){var i={};i[a]=t,s.push(i)}else this._extendTuples(e,s,a,t)}.bind(this)),e=s.slice()}a++}.bind(this))}.bind(this)),e},setSelections:function(){this.visControl.setSelections(this._getSelectionValues())},renderSelected:function(){this.setSelections(),this.visControl&&this.visControl.onResize()},getFocusedCellIDs:function(){return this._focusedCellIDs},setFocusedCellIDs:function(e,t){this._focusedCellIDs.key=e,this._focusedCellIDs.cellIDs=t},onEnterContainer:function(){this.visControl.onEnterContainer()},filterNodeKeydownHandler:function(e){e.stopPropagation()}});return s})),define("dashboard-analytics/util/ArrayUtils",[],(function(){return function(){function e(){_classCallCheck(this,e)}return e.isArrayInArray=function(e,t){if(Array.isArray(e)&&Array.isArray(t)&&t.length>0&&t.length<=e.length)for(var i=0;i0){var s=n[0]&&n[0].value;if(!s)continue;var r=t[0].value;if(!r)continue;var l=s.deco&&s.deco.rank;if(!l)continue;if(l===r){a=o;break}}else{for(var c=n.map((function(e){return e.value&&"undefined"!==_typeof(e.value.value)?e.value.value:e.value})),u=[],d=0;d=0;--h){n[h]=r,p=u(n),f.summaryKeys.push(p);var _={categoryUIds:[],tupleUIds:[]};if(!(f.isLocalSummary||this.summaryNotSupported||f.oCategoryAndTupleUIds[p]))for(var y=0;y5&&void 0!==arguments[5]?arguments[5]:0;if(a=a||0,t&&t.length>0){var s=t[n].value;e[s]||(e[s]={value:t[n],level:a,cellIdx:i+":"+a},this._doSummary&&this._addSummaryToGroupedItemsContainer(e,a,o));var r=n+1;r=0;--i)e[i]=r,t[u(e)]=!0;return Object.keys(t)},e.prototype._generateNewDataTableWithSummaries=function(e){for(var t=[],i=void 0,o=void 0,n=0,s=new a(e,void 0);i=s.next();)o=[],this._addGroupedItemsToRow(o,i),this._addValuesToRow(o,i,++n),t.push(o);this._preProcessedData=t},e.prototype._addGroupedItemsToRow=function(e,t){for(var i=t,a=0;i&&a0){var n=this.dataItems[i].getId();t[this.rankRefIds.indexOf(n)]={v:o}}}t.splice(0,0,0,0),Array.prototype.splice.apply(e,t)},t.prototype._processDataItems=function(){for(var t=0;t0&&void 0!==arguments[0]?arguments[0]:{};this.domNode=i.domNode,this.gridView=i.gridView,this.colorsService=i.dashboardApi.getFeature("Colors"),this.tabNavigation=i.tabNavigation,this.conditionalFormatting=i.conditionalFormatting,this.cellRenderer=i.cellRenderer,this._dataRows=null,this._focusNode=null,this._heatByIndex=-1,this._heatIndice=[],this._colorAllColumns=!1,this._bGroupingEnabled=!0,this._filterableSlots=[],this._selectedCellCache={},this._slotFormatCache={},this._rankDataItems=[],this._columnDataItems=[],this._visModel=i.visModel,this._hideSummaries=!1,this._hasTopBottomLimit=null,this._columnsInfo={groupedIndices:[],factIndices:[]};var a=this.gridView&&this.gridView.content;this.summaryFeature=i.summaryFeature,this.visualization=a.getFeature("Visualization"),this._gridDnDManager=new s({grid:this,dashboardApi:i.dashboardApi,content:a,gridEdgeMappedToId:{row:"grid_cols"}}),this._setSummaryColor=function(i){var a=t.conditionalFormatting&&t.conditionalFormatting.getSummaryFillColor();a&&e.extend(i.style,{"background-color":a})}},v.prototype.reset=function(e){this._visModel=e,this._heatIndice=[],this._heatByIndex=-1,this._colorAllColumns=!1,this._columnSlot=this.visualization.getSlots().getSlot("grid_cols"),this._heatSlot=this.visualization.getSlots().getSlot("heat"),this._slots=[this._columnSlot,this._heatSlot],this._rankDataItems=[],this._columnDataItems=[],this._dataRows=[],this._hasTopBottomLimit=null,this._columnsInfo={groupedIndices:[],factIndices:[]}},v.prototype._whenRankProcessed=function(){this._columnDataItems=this._rankDataItems.concat(this._columnSlot&&this._columnSlot.getDataItemList()||[]),this._filterHeatBySlot(this.visualization.getSlots().getSlotList()),this._setColumnsInfo(),this._doGrouping=this._columnsInfo&&!(this._columnsInfo.disableGrouping||this._hasTopBottomLimit),this._setDoSummaryInfo()},v.prototype._setDoSummaryInfo=function(){this._hideSummaries=this._visModel.getPropertyValue("hideSummaries"),void 0===this._hideSummaries&&(this._columnDataItems?this._columnDataItems.length:0)>12&&(this._hideSummaries=!0,this.gridView.ownerWidget.updateVisProperties({id:"hideSummaries",value:!0},{silent:!0}));var e=this._columnsInfo.factIndices.length,t=this._columnsInfo.groupedIndices.length;this._doSummary=e&&t&&!this._hideSummaries&&this._doGrouping},v.prototype._setColumnsInfo=function(){if(this._columnDataItems&&this._columnDataItems.length){var e=this._columnDataItems.length,t=[],i=[];this._columnsInfo={},this._setLeftMostFactSlotIndex(),this._columnsInfo.disableGrouping=!1;for(var a=0;a=i)&&"attribute"===this._columnDataItems[t].getType()},v.prototype._filterHeatBySlot=function(t){var i=this;if(this._hasDataMappings()){var a=this.getRankDataItemCount(),o=this._heatSlot.getDataItemList(),n=this._heatSlot&&o.length>0?o[0].getColumnId():null,s=e.filter(t,(function(e){var t=e.getDataItemList();return 0!=t.length&&("heat"===e.getId()?(i._heatByIndex=a++,!1):(a+=t.length,!0))}));return n&&(a=this.getRankDataItemCount(),e.each(s,(function(t){var o=t.getDataItemList();if(o.length>0){var s=e.map(o,(function(e){return e.getColumnId()}));e.each(s,(function(e){e===n&&i._heatIndice.push(a),a++}))}})),0===this._heatIndice.length&&(this._colorAllColumns=!0)),s}},v.prototype.setData=function(e){this._queryResult=e,this._processRank()},v.prototype.hasData=function(){return!!this._queryResult},v.prototype.setStyles=function(e){e&&(this.headerStyles=e.headerStyles,this.cellStyles=e.cellStyles)},v.prototype.resetOnRender=function(){this._groupedConditionalColor&&delete this._groupedConditionalColor,this._setDoSummaryInfo()},v.prototype._processRank=function(){var e=new l(this._queryResult,this.findSlotDetailsByRealColumnIndex.bind(this));this._rankDataItems=e.processData(),this._whenRankProcessed()},v.prototype._generateDataRows=function(){var e=this;0===this._columnDataItems.length&&this._whenRankProcessed(),this._resetOnGetDataRows();var t=new o({queryResult:this._queryResult,numberOfColumns:this._columnDataItems?this._columnDataItems.length:0,exceedsColumnThreshold:(this._columnDataItems?this._columnDataItems.length:0)>12,columnSlot:this._columnSlot,rankDataItems:this._rankDataItems,columnDataItems:this._columnDataItems,lastGroupedColumnIndex:this._columnsInfo?this._columnsInfo.leftMostFactSlotIndex:0,visModel:this._visModel,factColumnIndices:this._columnsInfo?this._columnsInfo.factIndices:0,doSummary:this._doSummary,onCellDataChange:this._onCellDataChange.bind(this),getRankFormat:this._getRankFormat,getRealColumnIndex:this.getRealColumnIndex.bind(this),summaryFeature:this.summaryFeature});return t.getData().then((function(i){e._dataRows=i,e._columnDataItems.length>0&&(e._headers=e._columnDataItems.map((function(t,i){var o=t.getLabel();return e.isRank(i)&&(o=a.get("topBottomRankLabel",{label:o})),o}))),e._dataRows.unshift(e._headers),e._WhenDataRowsAreReady(),t.whenAllSummaryValuesAreReady().then(e.onResize.bind(e))}))},v.prototype.onResize=function(){this.maxColHeight=this._getMaxColHeight(),this.gridRef&&this.gridRef.recomputeGridSize()},v.prototype.render=function(e,t){var i=this;return this.gridRef&&e&&!t?(this.onResize(),this.onSyncScrollBar(),Promise.resolve(!0)):(this._errorWarningAdded?this._errorWarningAdded=!1:this.gridView&&this.gridView.clearInfoIndicator("error_summary_cell"),this.resetOnRender(),this._generateDataRows().then(this._renderReactGrid.bind(this)).then((function(){return!!i.gridRef})))},v.prototype.onSyncScrollBar=function(){var e=t(this.domNode),i=e.find(".ba-common-grid__bottom-right-grid"),a=e.find(".ba-common-grid__top-right-grid"),o=t(i).find(".bottom-right-grid-cell"),n=o&&o[0];t(i).animate({scrollLeft:t(a).scrollLeft(),scrollTop:n&&n.offsetTop||1},0)},v.prototype.setSelections=function(e){var t=this;this._selections=e,this._selectionValues=[],this._selectedCellCache={},this._selections.forEach((function(e){var i=[];Object.values(e).forEach((function(e){i.push(e.u)})),t._selectionValues.push(i)}))},v.prototype._getDataCellValue=function(e,t){if(null!=e)return e="useValue"===t?this._getValue(e,"value"):"type"===t?e.type:"isSummary"===t?e.isSummary:"summaryOf"===t?e.summaryOf:"tuple"===t?e.key:"rank"===t?e.value&&(e.value.deco&&e.value.deco.rank||e.value.value)||e.value:e.isSummary&&this._getValue(e,"value")===e.summaryOf?g:this._getValue(e,"label")},v.prototype._removeFocusedClassName=function(e){return Array.isArray(this._selections)&&0===this._selections.length&&-1!==e.indexOf("cell-is-focused")?e.replace("cell-is-focused","").trim():e},v.prototype._getValueForRowAtIndex=function(e,t){var i=e[t];return i.value&&i.value.value?i.value.value:i[0]?i[0].value:null},v.prototype._calculateSelectionForFact=function(t){for(var i=this._dataRows[t+1],a=!1,o=[],n=0;n0&&(a=-1!==this._columnsInfo.factIndices.indexOf(t)?this._calculateSelectionForFact(e):this._calculateSelectionForAttribute(e,t)),this._selectedCellCache[i]=a,a},v.prototype._getCellPropertyColors=function(){try{var e=this.gridView&&this.gridView.content&&this.gridView.content.getPropertyValue("fillColor"),t=e&&this.colorsService.getHexColorFromDashboardColorSet(e),i=e&&this.colorsService.getForegroundColorPropertiesForUIElement(e,"tabs");return{cellFillColor:t,cellTextColor:i&&i.length&&i[0].value}}catch(e){return{}}},v.prototype._prepFormatCache=function(e){this._slotFormatCache={};for(var t=0;t12&&(I=20);var b={rowHeight:function(){return 32},columnWidth:function(){var e=i.domNode.clientWidth;if(i.domNode.clientHeight/32e&&R++})),!v&&tx?T:x),!v&&i._isCellSelected(t,c)&&w.push("dashboard-grid-cell-selected"),b&&w.push("measure"),d.className=w.join(" ");var N={displayValue:V?"":S},F=-1!==_.indexOf(c);(F||d.style.shapeId)&&(F||_.push(c),N.shapeId=d.style.shapeId);var M=void 0;if(i.cellRenderer&&i.cellRenderer.canRender()){var z=void 0;p.isSummary?(z={},"object"===_typeof(p.value)?(z.label=p.value.label,z.value=p.value.value):(z.label=p.value,z.value=p.rawValue||p.value)):z=p.value;var O=i.isRank(c),k=i.isRank(c)?i.getRefIndex(c)+i.getRankDataItemCount():c,H={dataItem:i._columnDataItems[k],dataValue:z,rowIndex:t,colIndex:c};O&&(H.isRank=!0),p.isSummary&&(H.isSummary=!0),M=i.cellRenderer.getComponentList(H)}else M=[];return 0===M.length&&M.push(h.createElement(u,_extends({},N,{key:c}))),v?(M.push(h.createElement("div",{className:"grid-summary-decorator"},"")),i._setSummaryColor(d)):(M.push(h.createElement("div",{class:"grid-drop-zone left"},"")),M.push(h.createElement("div",{class:"grid-drop-zone replace"},"")),M.push(h.createElement("div",{class:"grid-drop-zone right"},""))),h.createElement(n,_extends({dndManager:i._gridDnDManager,cellType:"column"},d),M)}catch(e){}},fixedRowCellRenderer:function(t,o,s){var r=a.getValue(t,o),l=i._getDataCellValue(r,"isSummary"),c=i._getDataCellValue(r);s.row=t,s.col=o,s.scope="col",s["aria-label"]=c,s.tabindex=0,s.className=i._removeFocusedClassName(s.className);var u=[s.className];u.push("grid-fixed-row-cell","dashboard-grid-cell"),s.style=e.extend(s.style,{}),s.style=e.extend(s.style,i.headerStyles),s.className=u.join(" ");var d=[c],p=i._getSortType(o);if(p){var g="asc"===p?"wfg_sorted_asc":"wfg_sorted_desc",v=h.createElement("span",{className:g},"");d.push(v)}var m=[h.createElement("div",{className:"dashboard-text-cell"},d)];return l?m.push(h.createElement("div",{className:"grid-summary-decorator"},"")):(m.push(h.createElement("div",{class:"grid-drop-zone left"},"")),m.push(h.createElement("div",{class:"grid-drop-zone replace"},"")),m.push(h.createElement("div",{class:"grid-drop-zone right"},""))),h.createElement(n,_extends({dndManager:i._gridDnDManager,cellType:"column"},s),m)},style:{},ref:function(e){i.gridRef=e},maxColumnWidth:1/0},C=h.createElement(p.Grid,b);this.$el=t(this.domNode).addClass("dashboard-common-grid").addClass("table-grid"),d.render(C,this.domNode),this.gridRef&&this.gridRef.recomputeGridSize()},v.prototype._getMaxColHeight=function(){return this.domNode.offsetHeight||1/0},v.prototype._onCellDataChange=function(e,t,i,o){this._dataRowsIsReady||this._delayedCellUpdate.push({row:e,column:t,value:i,rawValue:o}),i&&i.error&&(this._errorWarningAdded||(this.gridView.onSummaryDataCellError(),this._errorWarningAdded=!0),i=a.get("value_is_not_available")),this._dataRows&&e-1||o==this._heatByIndex||this._colorAllColumns)){var u=this._queryResult.getValue(e,this._heatByIndex),d=c.getColorByValue(this._getValue(u,"value"));return d&&this.cellStyles&&this.cellStyles.color&&delete d.color,d}}return null},v.prototype.getSelectedColumnHeaderNodes=function(){return t(this.domNode).find(".header-cell.implied_selection")},v.prototype.hilightColumn=function(e,i,a,o){var n=t(e);a&&o||(i&&this.clearColumnHighlight(),a?n.removeClass("implied_selection"):n.addClass("implied_selection"))},v.prototype.clearColumnHighlight=function(){t(this.domNode).find(".header-cell.implied_selection").removeClass("implied_selection")},v.prototype.isCellSelected=function(e){var i=t(e);return i.hasClass("dashboard-grid-cell-selected")||i.hasClass("implied_selection")},v.prototype.isGroupedColumn=function(e){var t=e;return"object"===(void 0===e?"undefined":_typeof(e))&&(t=this.getColumnIndex(e)),this._columnsInfo.groupedIndices&&-1!==this._columnsInfo.groupedIndices.indexOf(parseInt(t))},v.prototype._isFactColumn=function(e){return-1!==this._columnsInfo.factIndices.indexOf(parseInt(e))},v.prototype.getRowIndexFromSelectedNode=function(e){return parseInt(t(e).attr("row"),10)},v.prototype.getColumnIndex=function(e){return parseInt(t(e).attr("col"),10)},v.prototype._hasDataMappings=function(){return this.visualization.getSlots().getMappedSlotList().length>0},v.prototype.getColumnCount=function(){return this._columnDataItems.length},v.prototype.findSlotDetails=function(e){var t=this.getRealColumnIndex(e);return this.findSlotDetailsByRealColumnIndex(t)},v.prototype.findSlotDetailsByRealColumnIndex=function(e){for(var t=0,i=null,a=null,o=0,n=0;n1&&void 0!==arguments[1]?arguments[1]:"col";this.showDropZone("["+t+"="+e+"] > .grid-drop-zone")},v.prototype.showLeftDropZone=function(e){this.showDropZone("[col="+e+"] > .grid-drop-zone.left")},v.prototype.showRightDropZone=function(e){this.showDropZone("[col="+e+"] > .grid-drop-zone.right")},v.prototype._determineHeatColumnPosition=function(){var e=this,t=[],i=this.conditionalFormatting&&this.conditionalFormatting.getConditionalFormatting();return i&&this._heatSlot.getDataItemList().forEach((function(a){var o=i.conditionalFormats.find((function(e){return e.heatId===a.getId()}));o&&t.push(e._columnsInfo.factIndices.find((function(t){return!e.isRank(t)&&o.dataItemId===e._columnDataItems[t].getColumnId()})))})),t},v}()})),define("dashboard-analytics/lib/@waca/dashboard-common/dist/utils/ScrollBarUtil",["jquery","../lib/@waca/core-client/js/core-client/ui/core/Class"],(function(e,t){var i=null;return i=t.extend({init:function(e,t,a){i.inherited("init",this,arguments),this.inner=e||null,this.outer=t||null,this.event=a||null},doesHaveVerticalScrollBar:function(t,i){return t=t||this.inner,i=i||this.outer,t=t instanceof e?t.get(0):t,i=i instanceof e?i:e(i),this._getScrollHeight(t)>i.height()},doesHaveHorizontalScrollBar:function(t,i){return t=t||this.inner,i=i||this.outer,t=t instanceof e?t.get(0):t,i=i instanceof e?i:e(i),this._getScrollWidth(t)>i.width()},isEventOnVerticalScrollBar:function(t){t=t||this.event;var i=e(t.target);return i.offset().left+this._getContextClientWidth(i)-t.pageX<=0},isEventOnHorizontalScrollBar:function(t){t=t||this.event;var i=e(t.target);return i.offset().top+this._getContextClientHeight(i)-t.pageY<=0},isOnScrollBar:function(e,t,i){return 1===arguments.length?(i=e||this.event,e=this.inner,t=this.outer):(e=e||this.inner,t=t||this.outer,i=i||this.event),this.doesHaveVerticalScrollBar(e,t)&&this.isEventOnVerticalScrollBar(i)||this.doesHaveHorizontalScrollBar(e,t)&&this.isEventOnHorizontalScrollBar(i)},_getScrollHeight:function(e){return e.scrollHeight},_getScrollWidth:function(e){return e.scrollWidth},_getContextClientWidth:function(e){var t=e[0].clientWidth;return t===e.width()&&(t-=30),t},_getContextClientHeight:function(e){var t=e[0].clientHeight;return t===e.height()&&(t-=30),t}})})),define("dashboard-analytics/visualizations/renderer/indentedlist/IndentedListEventTarget",["jquery","underscore","../common/NonVIPREventTarget","../../../util/EventUtils"],(function(e,t,i,a){return function(i){function o(){var e;_classCallCheck(this,o);for(var t=arguments.length,a=Array(t),n=0;n',events:{"mousedown .item":"onDataItemMousedown","touchdown .item":"onDataItemMousedown","keydown .item":"onDataItemKeydown","hold .item":"onDataItemHold",mousedown:"onMouseDown"},initialRender:!0,_groupArrays:[],_groupCounter:0,init:function(){h.inherited("init",this,arguments),this._cache=[],this._groupArrays=[],this._groupCounter=0,this._focusedNode=null,this.$el.addClass("dataview indentedlist-view indentedlist-view-initial-max-size"),this.initialRender=!0;var e=this.$el.find(".indentedlist-content").first();this.scrollBarUtil=new o(e,this.$el),this.isMobilePannable=!0,this.content=this.content||this.dashboardApi.getCanvas().getContent(this.ownerWidget.getId()),this._scrollHandlerFn=this.scrollHandler.bind(this)},scrollHandler:function(t){var i=e(t.target);i.scrollTop()+i.innerHeight()>=i[0].scrollHeight-20&&this._addMore()},onMouseDown:function(e){this._isOnScrollBar(e)&&e.stopPropagation()},getRenderer:function(){return"dashboard-analytics/visualizations/renderer/indentedlist/IndentedListRenderer"},whenVisControlReady:function(){var e=this;return this.visControl?Promise.resolve(this.visControl):new Promise((function(t,i){try{require([e.visModel.getDefinition().control],(function(i){e.visControl=new i({domNode:e.$el.find(".indentedlist-content")[0]}),t(e.visControl)}),i)}catch(e){i(e)}})).then((function(){return e.eventHandler=new c({target:new u({$el:e.$el,visControl:e.visControl,visAPI:e.visModel,view:e,logger:e.logger}),transaction:e.transactionApi,logger:e.logger,ownerWidget:e.ownerWidget,visAPI:e.visModel,edgeSelection:!0}),e.visControl}))},_clampDefaultDimensions:function(){if(this.$el.hasClass("indentedlist-view-initial-max-size")&&(this.$el.width()>this.DEFAULT_MAX_WIDTH?this.$el.width(this.DEFAULT_MAX_WIDTH):this.$el.width(this.$el.width()),this.$el.removeClass("indentedlist-view-initial-max-size"),this.$el.height()>this.DEFAULT_MAX_HEIGHT)){this.$el.height(this.DEFAULT_MAX_HEIGHT);var e=this.$el.width()+this._getScrollbarWidth();this.$el.width(e)}},_clearDefaultDimensionClamp:function(){this.$el.width(""),this.$el.height("")},_getScrollbarWidth:function(){var e=this.$el.find(".datawidget");return e.width()-e[0].scrollWidth},render:function(e){var t=this;return this._cache=[],this._groupArrays=[],this._groupCounter=0,this._focusedNode=null,!this.isMappingComplete()||this.hasMissingFilters()||this.hasUnavailableMetadataColumns()?(this.$el.find(".indentedlist-content").empty(),this.resizeToWidget(e),this.initialRender=!0,this.renderIconView(),Promise.resolve(this)):(this.dataItems=e.useAPI?e.data.getResult():e.data.getDefaultQueryResult().getQueryResult(),this.onResultsReady(this.dataItems),this.removeIconView(),this.resizeToWidget(e),this.renderSelected(),this.initialRender&&(this.initialRender=!1,this.visModel.ownerWidget.whenContainerIsReady.promise.then((function(){t._clampDefaultDimensions(),t._clearDefaultDimensionClamp()}))),h.inherited("render",this,arguments))},remove:function(){this.scrollBarUtil=null,this.eventHandler&&(this.eventHandler.remove(),this.eventHandler=null),this._cache&&(this._cache=null),h.inherited("remove",this,arguments)},getDescription:function(){var e=h.inherited("getDescription",this,arguments);return r.get("WidgetLabelWithDescripion",{label:e,description:r.get("f12KeyDescription")})},renderIconView:function(){this.$el.removeClass("indentedlist-view-initial-max-size"),h.inherited("renderIconView",this,arguments)},_groupItems:function(e){var i=t.groupBy(e,function(e,t){return Math.floor(t/this.GROUP_MAX_LENGTH)}.bind(this));return t.toArray(i)},_isEqualLevel:function(e,i){return!t.find(e,(function(e,t){return!i[t]||i[t].value!==e.value}))},onResultsReady:function(e){var i=this,a=[],o=null,r=0,l=this.content.getFeature("Visualization").getSlots().getSlot("level1"),c=e.getRowCount(),u={};t.each(l.getDataItemList(),(function(e){u[e.getId()]=e.getFormat()}));for(var d=function(c){var d=[];t.each(l.getDataItemList(),(function(t,i){var a=[],o={},r=e.getValue(c,i)[0],l=r.label;t&&(a.push(s.format(l,u[t.getId()])),o[t.getColumnId()]=r),d.push({tuple:o,value:a.join(n.getListSeparatorSymbol()+" "),rowId:c,colId:i})}));var h={},m=0;if(o)for(;m");for(v=m;v0&&v!==m&&(r++,a.push('
0?"arrow wfg_shape_arrow_right":"no-arrow";return['
','',"",t.escape(o.substr(0,500)),"","
"].join("")}},renderSelected:function(){var i=this.getController();if(i){var a=e(this.el).find(".item");t.each(a,function(t){var a=null;e(t).removeClass("selected");try{var o=decodeURIComponent(t.getAttribute("data-tuple"));a=JSON.parse(o)}catch(e){this.logger&&this.logger.warn("Unable to parse the string into a JSON object in the indented list.",o)}this.isSubsetOfTupleSelected(a,i)&&e(t).addClass("selected")}.bind(this))}},renderFocused:function(t){e(this.el).find(".item.focused").removeClass("focused"),t&&(e(this._focusedNode).hasClass("selected")||e(this._focusedNode).is(":focus"))?e(this._focusedNode).addClass("focused"):(e(this._focusedNode).blur(),this._focusedNode=null)},isSubsetOfTupleSelected:function(e,i){if(!e||!i)return!1;for(var a=!1,o=t.keys(e),n=0;n0&&(this._focusedNode?this._focusedNode.focus():t[0].focus())},onDataItemKeydown:function(e){switch(e.keyCode){case 37:case 38:this._moveFocusUp();break;case 39:case 40:this._moveFocusDown();break;case 32:case 13:this.onDataItemClick(e),e.stopPropagation();break;default:return}e.preventDefault()},_getFocusedItemIndex:function(){for(var t=e(this.el).find(".item"),i=0,a=0;a\n\t
\n\t
\n\t
\n
\n'})),define("dashboard-analytics/visualizations/renderer/dataplayer/DataPlayerView",["jquery","underscore","../../../util/DashboardFormatter","../VisView","../../../widgets/livewidget/nls/StringResources","text!./DataPlayerView.html","../../../util/EventUtils"],(function(e,t,i,a,o,n,s){"use strict";var r=null;return r=a.extend({templateString:n,playerSpeed:1600,tickMinDistance:44,maxLabelLayerCount:2,verticalPositionScaleFactor:2/3,barOverflow:60,$_sliderNode:null,$_sliderBar:null,$_sliderContainer:null,$_playPauseButton:null,_dataItemAPI:null,_playTimeout:null,_playIndex:-1,_currentSelectionIndex:-1,_mouseStartX:0,_mouseOrgStartX:0,_nodeVirtualPosition:0,_snapThreshold:15,_dragging:!1,$tick:e('
'),$label:e('
'),events:{"clicktap .sliderLabel":"onLabelClick","keydown .sliderLabel":"onLabelKeypress","click .sliderTickForHorizontal":"onTickClick","tap .sliderTickForHorizontal":"onTickClick","touchstart .sliderNode":"onSliderNodeMouseDown","touchend .slider":"onSliderMouseUp","mousedown .sliderNode":"onSliderNodeMouseDown","mouseup .slider":"onSliderMouseUp","clicktap .playOrPause":"onPlayOrPauseClick","mousedown .playOrPause":"preventSelection","keydown .playOrPause":"onPlayOrPauseKeypress"},getRenderer:function(){return"dashboard-analytics/visualizations/renderer/dataplayer/DataPlayerRenderer"},init:function(){if(r.inherited("init",this,arguments),!this.visModel)throw"Invalid VisModel reference.";var t=this.dashboardApi.getFeature("Icons"),i=t.getIcon("playIcon"),a=t.getIcon("pauseIcon");e(this.el).find(".playOrPause").append(''),this.el.style.position="relative",this.playerEntries=[]},remove:function(){this._clearPlayTimer(),this.ownerWidget.dashboardApi.off("open:sharePanel",this._onSharePanelOpen,this),this.ownerWidget.dashboardApi.off("close:sharePanel",this._onSharePanelClose,this),r.inherited("remove",this,arguments)},whenDataReady:function(){var e=this;return!this.isMappingComplete()||this.hasUnavailableMetadataColumns()||this.hasMissingFilters()?Promise.resolve({data:{}}):(this._dataItemAPI=this.visualization.getSlots().getSlotList()[0].getDataItemList()[0],this.content.getFeature("DataQueryExecution").executeQueries().then((function(t){return e.filterIndicator&&e.filterIndicator.update(),{data:t}})))},getDescription:function(){var e=r.inherited("getDescription",this,arguments);return o.get("WidgetLabelWithDescripion",{label:e,description:o.get("f12KeyDescription")})},render:function(t){return this.visModel&&this.visModel.getRenderer()===this.getRenderer()?(this.$_playPauseButton=e(this.visEl).find(".playOrPause"),!this.isMappingComplete()||this.hasMissingFilters()||this.hasUnavailableMetadataColumns()?(this._getSliderContainer().empty(),this.renderIconView(),this.resizeToWidget(t),e(this.visEl).animate({opacity:1}),this.$_playPauseButton.hide(),Promise.resolve(this)):(this.removeIconView(),this.resizeToWidget(t),this.onResultsReady(t.data.getResult()),this.$_playPauseButton.attr("aria-label",o.get("playButtonLabel")),this.$_playPauseButton.show(),this.ownerWidget.dashboardApi.on("open:sharePanel",this._onSharePanelOpen,this),this.ownerWidget.dashboardApi.on("close:sharePanel",this._onSharePanelClose,this),r.inherited("render",this,arguments))):Promise.resolve(this)},onExitContainer:function(){this.$_playPauseButton.attr("tabindex","-1"),this.$el.find(".sliderLabel.selected").attr("tabindex","-1")},onEnterContainer:function(){this.$_playPauseButton.attr("tabindex","0"),this.$el.find(".sliderLabel.selected").attr("tabindex","0"),this.$_playPauseButton.focus()},onLabelKeypress:function(t){var i=e(t.currentTarget),a=t.keyCode;37===a||38===a?(this._moveToItem(i,i.prevAll(".sliderLabel").first()),t.stopPropagation()):39!==a&&40!==a||(this._moveToItem(i,i.nextAll(".sliderLabel").first()),t.stopPropagation())},preventSelection:function(e){e.stopPropagation()},_moveToItem:function(e,t){e.attr("tabindex","-1"),t.click().attr("tabindex","0").focus()},getFilterIndicatorSpec:function(){return{localFilters:!0}},onResultsReady:function(e){for(var t=[],i=e.getResultItemList()[0].getRowCount(),a=0;a0&&(t=this._getEntryIndex(e[0])),t!==this._currentSelectionIndex&&(this._currentSelectionIndex=t,this._positionSlider(this._currentSelectionIndex,!0,!0))}}.bind(this))},_renderSlider:function(t){if(this.$_sliderContainer=this._getSliderContainer(),this.$_sliderContainer.attr("aria-label",o.get("dataPlayerValueListLabel")),this.$_sliderContainer.empty(),t&&t.length>1){var i=this.$_sliderContainer[0].clientWidth,a=this.$_sliderContainer[0].clientHeight;this._initPlayPauseButton(a);var n=this.tickMinDistance*(t.length-1),s=Math.max(n,i-2*this.barOverflow),r=s/(t.length-1),l=Math.round(a*this.verticalPositionScaleFactor);this._createSliderBar(l,this.barOverflow/2,s),this._createSliderNode();var c=l-this.$_sliderNode[0].clientHeight/2,u=[];this.playerEntries.length=0;for(var d={},h=0;h0&&(v=-1!==(v=this._getEntryIndex(g[0]))?v:0,m=!0),this._currentSelectionIndex=v,this._positionSlider(v,!1,m),e(this.visEl).animate({opacity:1})}},_getPlayerEntry:function(t){var i=null,a=e.grep(this.playerEntries,(function(e){return e.value.value===t}));return a.length>0&&(i=a[0]),i},_getEntryIndex:function(e){var t=-1,i=this._getPlayerEntry(e);return i&&(t=i.index),t},_calcSliderPosition:function(e){var t={},i=this.playerEntries[e];return i&&(t=this._getTickTopLeftPosition(i)),t},_getTickTopLeftPosition:function(e){var t={};return t.top=Math.round(e.tick.top+e.tick.height/2-this.$_sliderNode[0].clientHeight/2),t.left=Math.round(e.tick.left+e.tick.width/2-this.$_sliderNode[0].clientWidth/2),t},_positionSlider:function(e,t,i){if(e<0)return this.$_sliderNode.css("opacity",0),this.$_sliderNode.css("display","none"),void this._selectLabel(-1);var a=this.$_sliderContainer.scrollLeft(),o=this.$_sliderContainer[0].clientWidth,n=this._calcSliderPosition(e);this.$_sliderNode.css("top",n.top+"px"),(n.left>=a+o-10||n.left=0&&e(this.visEl).find('.sliderLabel[data-item-index="'+t+'"]').addClass("selected").attr("aria-selected","true").attr("tabindex",a)},_positionLabels:function(t){if(0!==t.length)for(var i=[t],a=0;athis.maxLabelLayerCount){for(var s=[],r=0;r0&&e.push(t)},_rotateLabels:function(e){if(!(e.length<1))for(var t=this.$_sliderContainer[0].scrollWidth||this.$_sliderContainer[0].clientWidth,i=Math.max(-8,e[0].labelBaseline-e[0].height),a=Math.max(25,Math.floor(Math.sqrt(i*i+i*i))),o=0;o=r-n,u=0===s&&l,d=s===this.playerEntries.length-1&&c;if(u||d||l&&c){a=this._calcSliderPosition(s).left,o=s;break}}return{left:Math.round(a),index:o}},_createSliderBar:function(t,i,a){this.$_sliderBar=e('
'),this.$_sliderContainer.append(this.$_sliderBar),this.$_sliderBar.css("top",t+"px"),this.$_sliderBar.css("left",i+"px"),this.$_sliderBar.css("width",a+"px")},_createSliderNode:function(){this.$_sliderNode=e('
'),this.$_sliderContainer.append(this.$_sliderNode)},_initPlayPauseButton:function(t){this.$_playPauseButton=e(this.visEl).find(".playOrPause"),this.$_playPauseButton.css("top",Math.round(t*this.verticalPositionScaleFactor-28)+"px")},_createTick:function(e,t,i,a){var o,n,s=this.$tick.clone();this.$_sliderNode.before(s),a.w?o=a.w:(o=s[0].clientWidth,a.w=o),a.h?n=a.h:(n=s[0].clientHeight,a.h=n),s.attr("data-item-index",e),s.css("height",n+"px");var r=t-Math.round(n/2),l=Math.round(this.barOverflow/2+i*e-o/2);return s.css("top",r+"px"),s.css("left",l+"px"),{top:r,left:l,width:o,height:n,spacing:i}},_createLabel:function(e,t,a,o,n){var s=i.format(e,this._dataItemAPI.getFormat()),r=this.$label.clone();r.attr("title",s),r.attr("role","option"),r.attr("tabindex","-1"),r.text(s),this.$_sliderNode.before(r),r.attr("data-item-index",t);var l=r[0].clientWidth,c=l;if(n){var u=2*this.barOverflow-10;l>u&&(l=Math.round(u),r.css("width",l+"px"))}var d=r[0].clientHeight,h=Math.round(a-l/2),p=h+l;return h<0&&(p+=0-h,h=0),{$el:r,left:h,right:p,width:l,actualWidth:c,height:d,labelBaseline:o,tickLeft:a}},_getPageX:function(e){return"touch"!==e.type.substr(0,5)?e.pageX:e.originalEvent.touches[0].pageX}})})),define("dashboard-analytics/visualizations/renderer/kpi/control/KpiControl",["underscore","../../../../lib/@waca/core-client/js/core-client/ui/core/Class"],(function(e,t){"use strict";return t.extend({domNode:null,init:function(){e.extend(this,arguments[0])}})})),define("dashboard-analytics/visualizations/renderer/infographic/control/InfographicControl",["underscore","../../../../lib/@waca/core-client/js/core-client/ui/core/Class"],(function(e,t){"use strict";return t.extend({domNode:null,init:function(){e.extend(this,arguments[0])}})})),define("dashboard-analytics/visualizations/renderer/sequence/BaseTask",["../../../lib/@waca/core-client/js/core-client/ui/core/Class"],(function(e){"use strict";var t=e.extend({init:function(e){t.inherited("init",this,arguments),this.id=e.id,this.owner=e.owner,this.ownerWidget=e.ownerWidget,this.logger=e.logger,this.visAPI=e.visAPI,this.dashboardApi=e.dashboardApi,this.content=e.content,this._initializeStep=this.owner._initializeStep.bind(this.owner),this._isStepComplete=this.owner._isStepComplete.bind(this.owner),this._completeStep=this.owner._completeStep.bind(this.owner),this._logRenderContext=this.owner._logRenderContext.bind(this.owner),this.id&&this._initializeStep(this.id)},getId:function(){return this.id},getRenderState:function(){return this.owner._renderState},clearError:function(){var e=this.content.getFeature("state.internal");e&&e.clearError()},showError:function(){},process:function(){return Promise.reject(new Error("BaseTask.process needs to be overridden!"))}});return t})),define("dashboard-analytics/visualizations/renderer/sequence/DataTask",["./BaseTask","underscore"],(function(e,t){"use strict";var i=e.extend({init:function(){i.inherited("init",this,arguments)},process:function(e){var i=this,a=this.getRenderState().getCurrentContextData("visView");return!a||this._isStepComplete(e,"data")?Promise.resolve(e):(a.preDataReady(),a.whenDataReady(e).then((function(a){return t.isEmpty(a.data)?[a]:Promise.all([a,i._handleRenderContextForConditionalPalette(e)])})).then((function(t){var o=t[0];if(o){var n=o.data;a.setRenderingNewData(!0),e.extraInfo&&e.extraInfo.sameQueryValidateMode&&(e.sameQueryData=!0,e.extraInfo.queryRefresh=!0),i._completeStep(e,"data",n)}return e})).catch((function(e){if(!e||"dwErrorStaleRequest"!==e.msg){var t=e?e.msg:"dwErrorRenderingVisualization",a=e?e.param:null;i.showError(t,a)}throw e})))},_handleRenderContextForConditionalPalette:function(e){return e.refresh&&e.refresh.data?this.visAPI.initConditionalPalette(e.extraInfo):e.refreshAll?this.visAPI.updateConditionalPalette():Promise.resolve()}});return i})),define("dashboard-analytics/visualizations/renderer/sequence/HighlighterTask",["./BaseTask"],(function(e){"use strict";return e.extend({process:function(e){return this._isStepComplete(e,"highlighter")?Promise.resolve(e):this.getRenderState().getCurrentContextData("visView").whenHighlighterReady().then(function(t){return this._completeStep(e,"highlighter",t),e}.bind(this)).catch(function(e){throw this.showError("dwErrorRenderingVisualization"),e}.bind(this))}})})),define("dashboard-analytics/visualizations/renderer/sequence/KeyDriversTask",["./BaseTask","dashboard-analytics/visualizations/vipr/VIPRUtils"],(function(e,t){"use strict";return e.extend({process:function(e){var t=this;return this._isStepComplete(e,"keyDrivers")?Promise.resolve(e):this._getPossibleDrivers(e).then((function(i){return t._completeStep(e,"keyDrivers",i),e})).catch((function(){return e}))},_getPossibleDrivers:function(e){var i=this.content.getFeature("Visualization");return i.getSlots().isMappingComplete()&&t.doesConfigPropertyMatchExpected(i.getDefinition().getId(),"supportsPossibleKeyDrivers",!0)?this.visAPI.whenPossibleKeyDriversAreReady(e,this._getTargetId()):Promise.resolve([])},_getTargetId:function(){return this.content.getFeature("Visualization").getSlots().getMappedSlotList()[0].getDataItemList()[0].getColumnId()}})})),define("dashboard-analytics/visualizations/renderer/sequence/RenderTask",["underscore","./BaseTask"],(function(e,t){"use strict";var i={ENGINE_LAYOUT_DOES_NOT_FIT:"dwErrorVisualizationTooSmall"},a=["id","extraInfo"];return t.extend({process:function(e){this._logRenderContext("_render:ContextStepsComplete",e);var t=e.extraInfo&&e.extraInfo.annotationRequest;return this._isStepComplete(e,"render")||t?(this._completeStep(e,"render",this.getRenderState()),Promise.resolve(e)):this.render(e)},render:function(t){var i=t.resizing;delete t.resizing;var a=void 0,o=this.getRenderState(),n=t.extraInfo&&"realtimeRefresh"===t.extraInfo.sender;return o.readyToRender()?!0===t.sameQueryData&&n?(t.renderComplete=!0,this.visAPI.renderComplete(),a=Promise.resolve(t)):(this.clearError(),a=this.ownerWidget.getVisBounds().then(function(a){var n=this;if(this._logRenderContext("_render:visBoundReady",t),o.readyToRender()){o.lastSizeRendered=a,e.each(e.keys(t),(function(e){!n._isReservedContextKey(e)&&o.getCurrentContext(e)&&(t[e]=o.getCurrentContext(e)[e])})),t.widgetSize=a;var s=this.getRenderState().getCurrentContextData("visView");s.show();try{return s.resizing=i,s.render(t).then((function(e){if(e&&e.reRenderNeeded)return n.ownerWidget.setReRenderOnShow({resizing:!0}),t.renderComplete=!1,t;n._completeStep(t,"render",o),o.firstRenderComplete=!0,t.renderComplete=!0,s.setRenderingNewData(!1);var a=t&&t.extraInfo&&"realtimeRefresh"===t.extraInfo.sender,r=t&&t.refresh&&t.refresh.propertiesPane;return(r=r||void 0===r&&t.refreshAll)&&n.ownerWidget.focusOn&&!i&&!a&&n.ownerWidget.refreshPropertiesPane(),t})).catch(function(e){return this._showRenderError(t,e),t.renderComplete=!0,s.setRenderingNewData(!1),t}.bind(this))}catch(e){s.setRenderingNewData(!1),this._showRenderError(t,e)}o.firstRenderComplete=!0}return t.renderComplete=!0,t}.bind(this))):a=Promise.resolve(t),a},_isReservedContextKey:function(e){return a.indexOf(e)>-1},_showRenderError:function(e,t){if(this.owner.isActive()){if(this.owner.isLastRun(e)){e.visView.hide();var a=t.getErrorCode&&t.getErrorCode(),o=a&&a.name(),n=o&&i[o]||"dwErrorRenderingVisualization";this.owner.showError(n)}this.logger.error("An error occured during the data widget rendering sequence",t,this.visAPI)}else this.logger.debug("An error occured during the data widget rendering sequence",t,this.visAPI)}})})),define("dashboard-analytics/visualizations/renderer/sequence/ResultDataReader",["../../../lib/@waca/core-client/js/core-client/ui/core/Class","../../../apiHelpers/SlotAPIHelper","dashboard-analytics/widgets/livewidget/query/QueryResultData"],(function(e,t,i){"use strict";var a=e.extend({init:function(e,t,i){a.inherited("init",this,arguments),this.visualization=t,this._createQueryResultData=i||this._createQueryResultData,this.plugins=e.getMatchingFeatures("ResultDataReaderPlugin",!0)},_createQueryResultData:function(e){return new i(e)},hasPlugins:function(){return this.plugins.length>0},onNewResults:function(e){this.plugins.forEach((function(t){return t.onNewResults&&t.onNewResults(e)}))},processData:function(e,t,i){return this.plugins.length?this._readResultData(e,t,i):[Promise.resolve({hasPlugins:!1})]},_readResultData:function(e,t,i){var a=i&&i.useAPI,o=a?e:e._resultData&&this._createQueryResultData(e._resultData),n=this._buildRowHeaders(t),s=a?o.getRowCount():o.getDatapointCount();this.plugins.forEach((function(e){return e.onDataStart&&e.onDataStart(o,n)}));for(var r=0;r1&&a&&(n=e.getDataItemList().length),e.getDataItemList().forEach((function(e,t){var n=a?t:0;"fact"===e.getType()?i.push({dataItemUniqueId:e.getId(),index:r,valueItemIndex:n,aggregate:e.getAggregation(),multiMeasuresValueItem:a}):(s.itemIds.push(e.getColumnId()),o?0===t&&s.columnIndexes.push(r):s.columnIndexes.push(r)),r+=o?0:1})),r+=o?1:0})),{layerId:e,categoryItemHeaders:s,measureItemHeaders:i,valueSlotMeasureCount:n}}});return a})),define("dashboard-analytics/visualizations/renderer/sequence/ResultsDataReaderTask",["dashboard-analytics/visualizations/renderer/sequence/BaseTask","./ResultDataReader"],(function(e,t){"use strict";var i=e.extend({init:function(){i.inherited("init",this,arguments),this._initializeStep("resultsdatareader"),this.resultDataReader=new t(this.ownerWidget.getAPI(),this.content.getFeature("Visualization"))},process:function(e){return this._isStepComplete(e,"resultsdatareader")||!this.resultDataReader.hasPlugins()?Promise.resolve(e):this._processQueryResults(e.data,e).then(function(t){return this._completeStep(e,"resultsdatareader",t),e}.bind(this)).catch(function(e){throw this.showError("dwErrorRenderingVisualization"),e}.bind(this))},_processQueryResults:function(e,t){var i=this;if(!(t&&t.useAPI))return this._processQueryResults_oldQueryAPI(e,t);if(this.resultDataReader.onNewResults(e),e&&e.getResult){var a=[];if(e.getQueryResultIdList().forEach((function(o){var n=e.getResult(o);a=a.concat(i._processOneQueryResult(n,o,t))})),a.length)return Promise.all(a)}return Promise.resolve({})},_processOneQueryResult:function(e,t,i){return this.resultDataReader.processData(e,t,i)},_processQueryResults_oldQueryAPI:function(e,t){var i=this;if(this.resultDataReader.onNewResults(e),e&&e.getQueryResults){var a=[];if(e.getQueryResults().forEach((function(e){a=a.concat(i._processOneQueryResult_oldQueryAPI(e,t))})),a.length)return Promise.all(a)}return Promise.resolve({})},_processOneQueryResult_oldQueryAPI:function(e,t){return this.resultDataReader.processData(e.data,e.getDataViewId&&e.getDataViewId(),t)}});return i})),define("dashboard-analytics/visualizations/renderer/sequence/SetDataTask",["dashboard-analytics/visualizations/renderer/sequence/BaseTask"],(function(e){"use strict";return e.extend({process:function(e){var t=this;return this._isStepComplete(e,"setData")?Promise.resolve(e):this.getRenderState().getCurrentContextData("visView").whenSetDataReady(e).then((function(i){return t._completeStep(e,"setData",i),e})).catch(function(e){throw this.showError("dwErrorRenderingVisualization"),e}.bind(this))}})})),define("dashboard-analytics/visualizations/renderer/sequence/VisControlTask",["./BaseTask"],(function(e){"use strict";return e.extend({process:function(e){return this._isStepComplete(e,"visControl")?Promise.resolve(e):this.getRenderState().getCurrentContextData("visView").whenVisControlReady().then(function(t){return this._completeStep(e,"visControl",t),e}.bind(this)).catch(function(e){throw this.showError("dwErrorRenderingVisualization"),e}.bind(this))}})})),define("dashboard-analytics/visualizations/renderer/sequence/VisSpecTask",["./BaseTask"],(function(e){"use strict";return e.extend({process:function(e){return this._isStepComplete(e,"visSpec")?Promise.resolve(e):this.getRenderState().getCurrentContextData("visView").whenVisSpecReady().then(function(t){return this._completeStep(e,"visSpec",t),e}.bind(this)).catch(function(e){throw this.showError("dwErrorRenderingVisualization"),e}.bind(this))}})})),define("dashboard-analytics/visualizations/renderer/sequence/VisViewTask",["./BaseTask","../../../DynamicFileLoader"],(function(e,t){"use strict";return e.extend({process:function(e){var t=this.ownerWidget;if(t&&t.setLayoutProperties({pannable:!1,mobilePannable:!1,noRotate:!0,maximizable:!0}),this._isStepComplete(e,"visView"))return Promise.resolve(e);this.getRenderState().firstRenderComplete=!1;var i=this._rendererToView();return this._loadVisView(i).then(function(t){return this._completeStep(e,"visView",t)?this._placeViewIntoDOM(t,e.widgetSize):t.remove(),e}.bind(this))},_loadVisView:function(e){return t.load([e]).then(function(e){return new(0,e[0])({visModel:this.visAPI,logger:this.logger,ownerWidget:this.ownerWidget,dashboardApi:this.dashboardApi,content:this.content})}.bind(this))},_rendererToView:function(){var e=this.visAPI.getRenderer();return"Renderer"===e.substr(e.length-8)?e.substr(0,e.length-8)+"View":e},_placeViewIntoDOM:function(e,t){var i=this.ownerWidget;i.placeAt(e),i.applyCommonProperties(),i.dataSlotsView||e.resize(t)}})})),define("dashboard-analytics/visualizations/interactions/FilterAction",["../../lib/@waca/core-client/js/core-client/ui/core/Events","../../widgets/livewidget/nls/StringResources"],(function(e,t){"use strict";var i=null;return i=e.extend({init:function(e,a,o,n,s){i.inherited("init",this,arguments),this.visualization=e,this.slot=a,this.mapIndex=o,this.dashboardApi=n,this.logger=s;var r=a.getDataItemList()[this.mapIndex];this.itemContext={uniqueId:r.getId(),itemId:r.getColumnId(),itemName:r.getLabel(),dataType:r.getDataType(),aggregationType:r.getAggregation(),sourceId:this.visualization.getDataSource().getId()};var l=r.getMetadataColumn();l&&l.isNamedSet&&l.isNamedSet()&&(this.itemContext.isNamedSet=!0),this.renderModule=this.getEditorModuleName();var c=t.get("toolbarActionFilter"),u=this.dashboardApi.getFeature("Icons"),d=u.getIcon("common-filter");this.toolbarContribution=[{name:"filter",text:c,label:c,icon:d.id,type:"NextView",group:"filterAction",viewModule:this.renderModule,viewOptions:this.getViewOptions.bind(this)}]},getActionId:function(){return"filterAction"},getAvailableActions:function(){return this.toolbarContribution},getViewOptions:function(){return{height:300,width:212,slot:this.slot,mapIndex:this.mapIndex,logger:this.logger,itemContext:this.itemContext,dashboardApi:this.dashboardApi,visualization:this.visualization}},getEditorModuleName:function(){return"dashboard-analytics/dialogs/CommonViewWrapper"}})})),define("dashboard-analytics/visualizations/layers",["./definitions/providers/VIPR3Provider","./definitions/providers/LocalProvider","./vipr/VIPR","./vipr/properties/VIPRProperties","./recommender/BaseSmartsVisRecommenderWrapper","./recommender/SmartsRecommenderService","./renderer/vipr3/VIPRView","./renderer/summary/control/SummaryControl","./renderer/summary/SummaryProxyView","./renderer/infographic/InfographicView","./renderer/crosstab/CrosstabView","./renderer/crosstab/CrosstabControl","./renderer/grid/GridView","./renderer/grid/control/JQGrid","./renderer/indentedlist/IndentedListView","./renderer/indentedlist/control/IndentedListControl","./renderer/dataplayer/DataPlayerView","./renderer/kpi/KpiView","./renderer/kpi/control/KpiControl","./renderer/infographic/control/InfographicControl","./renderer/sequence/DataTask","./renderer/sequence/HighlighterTask","./renderer/sequence/KeyDriversTask","./renderer/sequence/RenderTask","./renderer/sequence/ResultsDataReaderTask","./renderer/sequence/SetDataTask","./renderer/sequence/VisControlTask","./renderer/sequence/VisSpecTask","./renderer/sequence/VisViewTask","./interactions/FilterAction"],(function(){})),define("@dashboard-features/smartAnnotations/js/AnnotationTask",["underscore","@waca/dashboard-livewidget/js/visualizations/renderer/sequence/RenderTask"],(function(e,t){"use strict";return t.extend({_requiresAnnotationRender:function(e){var t=this.visAPI.getEnabledAnnotations()||[];return e.extraInfo&&e.extraInfo.annotationRequest||t.length>0},_requiresForecastRender:function(e){var t=this._getForecastAnnotations();return e.extraInfo&&e.extraInfo.forecastRequest||t.length>0},_getForecastAnnotations:function(){var e=this.content&&this.content.getFeature("Forecast");return e&&e.getForecastInfo&&e.getForecastInfo().annotations||[]},process:function(t){var i=this;if(this._isStepComplete(t,"annotation"))return Promise.resolve(t);var a=this.getRenderState().getCurrentContextData("visView");a.clearAnnotationErrorsAndWarnings();var o=this.content.getFeature("SmartsExecution").getNonAnnotatableReasons(),n=this.content.getFeature("Forecast");if(a.updateSmartAnnotationsIndicator(),a.updateForecastIndicator(),o.descriptions.length>0){var s=e.flatten(o.descriptions);-1!==o.nonAnnotatableFeatures.indexOf("forecast")&&n.setQueryResult(null),a.infoIndicator.addInfo(s)}return!this._requiresAnnotationRender(t)&&!this._requiresForecastRender(t)||o.allLayers?t.extraInfo&&t.extraInfo.annotationRequest?this.render(t):Promise.resolve(t):a.whenAnnotatedResultsReady(this.getRenderState().getFullRenderContext()).then(function(){return this._completeStep(t,"annotation",this.visAPI.getEnabledAnnotations()),t}.bind(this)).then((function(e){return i.render(e)})).finally(a.updateSmartAnnotationsIndicator.bind(a)).catch(function(e){return this._handleAnnotationServiceFailure(t,a,e)}.bind(this))},_handleAnnotationServiceFailure:function(e,t,i){return t.addUnavailableAnnotationServiceErrorMessageToIndicator(),this.logger.error("An error occured while waiting for the annotation to be ready",i,this.visAPI),this._completeStep(e,"annotation",i),e.extraInfo.annotationRequest?this.render(e):e}})})),define("@dashboard-features/smartAnnotations/js/SuggestionTask",["@waca/dashboard-livewidget/js/visualizations/renderer/sequence/BaseTask"],(function(e){"use strict";return e.extend({process:function(e){var t=this,i=this.getRenderState().getCurrentContextData("visView");return!i||this._isStepComplete(e,"predictSuggestions")?Promise.resolve(e):i.whenPredictSuggestionsReady(e).then((function(i){return t._completeStep(e,"predictSuggestions",i),e})).catch((function(){return e}))}})})),define("@dashboard-features/smartAnnotations/js/visualization_layers",["./AnnotationTask","./SuggestionTask"],(function(){})),define("dashboard-analytics/visualizationBundle",(function(){}));