/** * 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(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function _possibleConstructorReturn(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function _classCallCheck(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};define("dashboard-core/js/lib/@waca/dashboard-common/dist/ui/react_toolbar/components/Button",["react","prop-types","ca-ui-toolkit","require"],(function(t,e,i,n){var o=i.Button,s=function(e){function i(o){_classCallCheck(this,i);var s=_possibleConstructorReturn(this,e.call(this,o));return s._handleKeyDown=function(t){32!==t.keyCode&&13!==t.keyCode||s._buttonSelected(t)},s.itemSpec=s.props.itemSpec,s.myRef=t.createRef(),s.requireFn=o.requireFn||n,s.state=s.props.itemSpec,s._isMounted=!1,s}return _inherits(i,e),i.prototype._buttonSelected=function(t){this.state.update&&this.props.updateButton(),void 0!==this.state.selected&&(this.setState({selected:!this.itemSpec.selected}),this.props.updateButton()),"NextView"===this.state.type?this.props.nextViewCb(this.state,t,this.props.updateButton):this.state.actions?this.state.actions.apply.apply(this,arguments):this.itemSpec.action&&this.state.action.apply(this,arguments)},i.prototype._handleClick=function(t){this._buttonSelected(t)},i.prototype._renderCoachMark=function(){if(this.state.coachMark&&this.state.coachMark.dashboard){var t=this.state.coachMark.dashboard,e=t.getFeature("CoachMark");if(e){var i={id:this.state.coachMark.id,title:this.state.coachMark.title,contents:this.state.coachMark.contents,placement:"bottom",domElement:this.myRef.current._node};t.prepareGlassOptions(i),e.addCoachMark(i)}}},i.prototype._renderDecorator=function(){var t=this;if(this.state.decoratorView){var e=this.state.decoratorView;this.requireFn([e.viewModule],(function(i){if(t._isMounted)try{var n="function"==typeof e.viewOptions?e.viewOptions():e.viewOptions;(n=n||{}).containerNode=t.myRef.current._node,t._decorator=new i(n),t._decorator.render()}catch(t){console.error(t)}}))}},i.prototype._removeDecorator=function(){this._decorator&&(this._decorator.remove(),this._decorator=null)},i.prototype.componentDidMount=function(){this._isMounted=!0,this.state.callbacks&&this.state.callbacks.registerCallback(this);try{this._renderCoachMark(),this._renderDecorator()}catch(t){console.error(t)}},i.prototype.componentWillUnmount=function(){this._isMounted=!1,this.state.callbacks&&this.state.callbacks.unregisterCallback(),this._removeDecorator()},i.prototype.updateState=function(t){this.setState(t)},i.prototype._getButtonClass=function(){var t=[];return this.state.selected&&t.push("selected"),this.state.className&&t.push(this.state.className),t.join(" ")},i.prototype.render=function(){var e=this,i=this._getButtonClass();return t.createElement(o,{"appcues-data-id":this.state.name,ref:this.myRef,key:this.state.name,title:this.state.label,label:this.props.toolbarOptions&&this.props.toolbarOptions.iconOnly?void 0:this.state.text,iconSize:"small",variant:"icon",intent:"primary",autofocus:this.state.focus,ellipsis:!0,disabled:!!e.state.disabled&&("function"!=typeof e.state.disabled||e.state.disabled()),iconLeft:this.props.toolbarOptions&&this.props.toolbarOptions.textOnly?void 0:this.state.icon,"aria-label":this.state.label,className:i,onClick:function(t){return e._handleClick(t)},onKeyDown:function(t){return e._handleKeyDown(t)}})},i}(t.Component);return s.propTypes={itemSpec:e.array,icon:e.string,focus:e.boolean,updateButton:e.function,nextViewCb:e.function,requireFn:e.function,toolbarOptions:e.object},s})),define("dashboard-core/js/lib/@waca/dashboard-common/dist/ui/react_toolbar/components/ToggleButton",["react","underscore","prop-types","./Button"],(function(t,e,i,n){var o=function(t){function e(i){return _classCallCheck(this,e),_possibleConstructorReturn(this,t.call(this,i))}return _inherits(e,t),e.prototype._handleClick=function(){this.itemSpec.checked=!this.itemSpec.checked,this.itemSpec.checked&&"function"==typeof this.itemSpec.action?this.itemSpec.action.apply(this,arguments):this.itemSpec.checked||"function"!=typeof this.itemSpec.offAction||this.itemSpec.offAction.apply(this,arguments),this.props.updateButton()},e.prototype._getButtonClass=function(){var t=[];return this.itemSpec.checked&&t.push("toolbarButtonToggle"),this.itemSpec.className&&t.push(this.itemSpec.className),t.join(" ")},e}(n);return o.propTypes={itemSpec:i.array,icon:i.object,updateButton:i.function,nextViewCb:i.function,toolbarOptions:i.object},o})),define("dashboard-core/js/lib/@waca/dashboard-common/dist/ui/react_toolbar/ReactToolbar",["react","prop-types","ca-ui-toolkit","./components/Button","./components/ToggleButton"],(function(t,e,i,n,o){var s={Button:n,NextView:n,ToggleButton:o},a=i.Toolbar,r=function(e){function i(t){_classCallCheck(this,i);var n=_possibleConstructorReturn(this,e.call(this,t));n.updateButton=function(){n.forceUpdate()},n.items=n.props.itemSpecs,n.orientation=n.props.orientation;return n.state={enabled:void 0!==n.props.enabled?n.props.enabled:n.props.itemSpecs.length>0},n}return _inherits(i,e),i.prototype._getComponent=function(e,i){var n=s[e.type];if(n){var o=e.icon,a=0===i;return t.createElement(n,{key:i,itemSpec:e,icon:o,focus:a,updateButton:this.updateButton,nextViewCb:this.props.nextViewCb,toolbarOptions:this.props.toolbarOptions})}},i.prototype.render=function(){var e=this;if(this.state.enabled){var i="toolbarIcon toolbarItem";return this.props.toolbarOptions&&this.props.toolbarOptions.isTextEditorOnly&&(i+=" textOnlyToolBar"),t.createElement("div",{className:"reactToolbar"},t.createElement(a,{className:i,orientation:this.orientation},this.items.map((function(t,i){return e._getComponent(t,i)}))))}return null},i}(t.Component);return r.propTypes={itemSpecs:e.array,orientation:e.string,nextViewCb:e.function,enabled:e.boolean,toolbarOptions:e.object},r})),define("dashboard-core/js/lib/@waca/dashboard-common/dist/ui/toolbar_components/Button",["../../lib/@waca/core-client/js/core-client/ui/core/View","jquery","underscore","require","../../lib/@waca/core-client/js/core-client/utils/Utils"],(function(t,e,i,n,o){var s=t.extend({events:{primaryaction:"_handleClick",mousedown:"_handleStartDrag",dragdown:"_handleStartDrag"},baseClass:"toolbar",init:function(t,e,o){this.group=null,this.selected=!1,this.toolbar=o,i.extend(this,t),s.inherited("init",this,arguments),this.requireFn=this.requireFn||n},_handleClick:function(){if(!this.$("button").prop("disabled")){var t=null;this.actions?t=this.actions.apply.apply(this,arguments):this.action&&(t=this.action.apply(this,arguments)),this.arrow&&t&&t.then&&t.then(this.$el.addClass.bind(this.$el,"open")),this.$("button").prop("update")&&this.toolbar.updateButtons()}},_handleStartDrag:function(){this.$("button").prop("disabled")||this.startDrag&&this.startDrag.apply(this,arguments)},render:function(){if(this.labelOnly)return this.$el.empty().prepend(e(''+this.label+"")),this;var t;t=e(""),this.toolbar&&this.toolbar.options?(this.text&&!this.toolbar.options.iconOnly&&(t=e("")),this.icon&&!this.toolbar.options.textOnly&&o.setIcon(t,this.icon,this.label,this.label)):(this.text&&(t=e("")),this.icon&&o.setIcon(t,this.icon,this.label,this.label)),this._renderCoachMark();var i=function(e,i){i&&t.attr(e,i)},n=function(t,e){e&&t.addClass(e)};return this.icon||i("aria-label",this.label),i("title",this.label),i("appcues-data-id",this.name),n(t,this.className),i("id",this.id),i("accesskey",this.accesskey),"function"==typeof this.disabled?!0===this.disabled()&&t.prop("disabled",!0):!0===this.disabled&&t.prop("disabled",!0),"function"==typeof this.update?!0===this.update()&&t.prop("update",!0):!0===this.update&&t.prop("update",!0),this.hidden&&this.$el.hide(),this.$el.empty().addClass(this.baseClass+"Icon "+this.baseClass+"Item").prepend(t),this.selected&&this.$el.addClass("selected"),n(this.$el,this.group),this.arrow&&this.$el.append(e('
')),this._renderDecorator(),this},setFocus:function(){this.$("button").focus()},remove:function(){this._removeDecorator(),s.inherited("remove",this,arguments)},_renderCoachMark:function(){if(this.coachMark&&this.coachMark.dashboard){var t=this.coachMark.dashboard,e={id:this.coachMark.id,title:this.coachMark.title,contents:this.coachMark.contents,placement:"bottom",domElement:this.el};t.prepareGlassOptions(e),t.getFeature("CoachMark").addCoachMark(e)}},_renderDecorator:function(){var t=this;if(this.decoratorView){var e=this.decoratorView;this.requireFn([e.viewModule],(function(i){var n="function"==typeof e.viewOptions?e.viewOptions():e.viewOptions;(n=n||{}).containerNode=t.$("button"),t._decorator=new i(n),t._decorator.render()}))}},_removeDecorator:function(){this._decorator&&(this._decorator.remove(),this._decorator=null)}});return s})),define("dashboard-core/js/lib/@waca/dashboard-common/dist/DynamicFileLoader",["require"],(function(t){return{_require:t,load:function(t){if(!Array.isArray(t))throw new Error("modules must be an array");t.forEach((function(e,i){-1!==e.indexOf("text!")?t[i]=e.replace("text!","text!./"):t[i]="./"+e}));var e=[],i=[];return t.forEach((function(){var t={},n=new Promise((function(e,i){t.resolve=e,t.reject=i}));i.push(t),e.push(n)})),this._require(t,(function(){for(var t=0;t");return this.$el.append(i),this._renderItem(e,i)},_renderItem:function(t,e){t.type||t.module||(t.type="Menu");var i=t.type?"ui/toolbar_components/"+t.type:t.module;return this._renderItemHelper(i,t,e)},_renderItemHelper:function(t,e,n){var o=this,s=i.load([t]).then((function(t){var i=t[0];e.el=n;var s=new i(e,o.rootMenu||o.parentView,o);return o.itemMap[s.name]=s,Promise.resolve().then(s.render.bind(s))}));return this._readyArray.push(s),s},removeItem:function(t){this.itemMap[t].remove(),delete this.itemMap[t]},_canRenderInReactToolbar:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=function(t){return"SubView"!==t.type};return this.options.reactToolbar&&t.every(e)},addItems:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return this._isReactToolbar=this._canRenderInReactToolbar(e),this._isReactToolbar?this.addItemsReady=i.load(["ui/react_toolbar/ReactToolbarContainer"]).then((function(i){var n=i[0];t._reactToolbarContainer=new n(e,t.el,t),t.itemMap=e})):this.addItemsReady=Promise.all(e.map((function(e){return t._addItem(e)}))),this.addItemsReady},clearItems:function(){e.each(this.itemMap,(function(t){t.remove&&t.remove()})),this._isReactToolbar?this._reactToolbarContainer&&(this._reactToolbarContainer.clearItems(),this._reactToolbarContainer=null):this.$el.empty(),this.itemMap={},this._readyArray=[]},render:function(){return this.$el.empty(),this.items?this.addItems(this.items):Promise.resolve()},ready:function(){var t=this;return this._isReactToolbar?this.addItemsReady.then((function(){var e=t.options.preferredVertical?"vertical":"horizontal";return e="top"===t.placement?"horizontal":e,t._reactToolbarContainer.ready(e)})):Promise.all(this._readyArray)},setFocus:function(){var t=Object.keys(this.itemMap)[0];if(t){var e=this.itemMap[t];e&&e.setFocus&&e.setFocus()}},updateButtons:function(){this.itemMap&&e.each(this.itemMap,(function(t){t.update&&t.render()}))},remove:function(){this.clearItems(),o.inherited("remove",this,arguments)}});return o})),define("dashboard-core/js/lib/@waca/dashboard-common/dist/nls/DashboardCommonResources",{root:!0,cs:!0,da:!0,de:!0,es:!0,fi:!0,fr:!0,he:!0,hr:!0,hu:!0,it:!0,ja:!0,kk:!0,ko:!0,no:!0,nb:!0,nl:!0,pl:!0,pt:!0,"pt-br":!0,ro:!0,ru:!0,sl:!0,sv:!0,th:!0,tr:!0,zh:!0,"zh-cn":!0,"zh-tw":!0}),define("dashboard-core/js/lib/@waca/dashboard-common/dist/nls/root/DashboardCommonResources",{dlg_loading:"Loading...",dlg_close:"Close",dlg_ok:"OK",dlg_cancel:"Cancel",dlg_back:"Go back",sliderRegionLabel:"Slider control, use right and left arrows to move the slider handles",sliderHandleLabel:"Slider handle",a11ySliderHandleLabel:"Slider handle %{sliderValue}",sliderInputLabel:"value",sidebarAdd:"Add",clearTextFilterValue:"Clear",missingDataSetData:"The data for this data set is not available. Refresh the data set or contact your administrator for access to the source.",toolbarRegionLabel:"Toolbar",toolbarLabel:"%{labelName}:",toolbarNoValueLabel:"%{labelName}",fontSelect:"Font family",fontSizeSelect:"Font size",bold:"Bold",italic:"Italic",underline:"Underline",justifyLeft:"Align left",justifyCenter:"Align center",justifyRight:"Align right",insertOrderedList:"Ordered List",insertUnorderedList:"Unordered List",fontColorPicker:"Color picker",textWrap:"Wrap text",restore:"Restore defaults",topbottomNumberOfResultsLabel:"Number of results",topbottomPercentLabel:"Percent",topbottomNumberOfResultsLimit:"The value can be %{lower} - %{higher}",topbottomSelectOption:"Top or bottom option",topbottomOptionLabel:"Show",searchByLabel:"By",searchNoMatches:"No matches found",topbottomRankColumnLabel:"Add a rank column to table",topbottomNone:"None",topCount:"Top count",topPercent:"Top %",bottomCount:"Bottom count",bottomPercent:"Bottom %",searchColumn:"Find a column",searchColumnAriaLabel:"Find a column. Type the name of the column to search for then use the down arrow to find the column in a list",rankColumnLabel:"Rank (%{columnLabel})",topbottomClearLabel:"Clear",formatAuto:"Auto",formatConvertPercent:"Convert decimal to percentage",formatAbbreviate:"Abbreviate",formatUseGrouping:"Use thousands separator",dateStyle:"Date style",dateTimeStyle:"Date/Time style",formatMissingValueCharactersInfo:"Missing value characters specifies the characters to be displayed when the value is missing.",currencySymbolLabel:"Currency symbol",customSymbolPlaceholder:"Add a symbol",customSymbolLabelInfo:"Specifies a character or characters to use as a custom symbol. This symbol will precede the number and any sign.",numberLabel:"Number label",numberPositionLabel:"Label position",numberLabelInfo:"Specifies a label for the formatted number and placed as a prefix or suffix depending on the label position.",nullValueDefault:"",nullValueContent:"(no value)",default:"Default",beginning:"Beginning",end:"End",moreDataIndicator:"Your data was clipped at %{threshold} items. Apply a filter to show less.",evCollapse:"Collapse",duplicate:"Duplicate",copyOf:"Copy of %{name}",unableToDuplicateBoard:'Unable to duplicate "%{name}".',errorLoadingWidgetList:"We can't load the objects.",customWidget:"Custom widget"}),define("dashboard-core/js/lib/@waca/dashboard-common/dist/nls/StringResources",["i18n!./DashboardCommonResources","../lib/@waca/core-client/js/core-client/utils/Lexicon"],(function(t,e){"use strict";var i=new e({data:t,verbose:!0}),n=function(){};return n.prototype.get=function(t,e){return i.translate(t,e)},new n})),define("text!dashboard-core/js/lib/@waca/dashboard-common/dist/ui/templates/Labels.template",[],(function(){return'{{? it.title}}\n
{{!it.title}}
\n{{?}}\n{{~ it.labels :label:index}}\n
\n\t
{{!label.name}}
\n\t{{?label.value}}\n\t
{{!label.value}}
\n\t{{?}}\n
\n{{~}}\n'})),define("dashboard-core/js/lib/@waca/dashboard-common/dist/ui/Labels",["../lib/@waca/core-client/js/core-client/ui/core/View","../lib/@waca/core-client/js/core-client/i18n/Formatter","../nls/StringResources","text!./templates/Labels.template","underscore"],(function(t,e,i,n,o){var s=t.extend({templateString:n,init:function(t){s.inherited("init",this,arguments),this.labels=t.labels,this.title=t.title,this._formatter=t.formatter||e},render:function(){var t=[];if(this.labels)for(var e=0;e0){var s=o.split("(")[1].split(")")[0].split(","),a=e(s[1]),r=e(s[0]);i=Math.atan2(a,r)}}catch(t){console.warn(t)}return i},e.getAngleFromMatrix=function(t){var e=0;if(t&&"none"!==t){var i=t.split("(")[1];if(i){var n=i.split(")")[0].split(","),o=n[0],s=n[1];e=Math.round(this.radianToDegree(Math.atan2(s,o)))}}return(e%360+360)%360},e.getAbsoluteAngleRadian=function(e,i){for(var n,o=t(e).parents(),s=this.getAngleRadian(e),a=0,r=o.length;aa.maxTop)&&(a.maxTop=o),o=s.left+s.width,(void 0===a.maxLeft||o>a.maxLeft)&&(a.maxLeft=o);return a},e.getNodes=function(t,e){var i=[];return e&&e.length&&e.forEach((function(e){var n=t.layoutController.getLayoutView(e);n&&n.domNode&&i.push(n.domNode)})),i},e}()})),define("dashboard-core/js/lib/@waca/dashboard-common/dist/utils/DialogBlocker",["jquery"],(function(t){return{dialogBlockerClasses:["dialogBlocker","ba-common-dialog__blockerCell"],isShowingDialogBlocker:function(){return this.dialogBlockerClasses.some((function(t){return document.getElementsByClassName(t).length>0}))},createBlocker:function(){var t=document.createElement("div");return t.classList.add("dialogBlocker"),t.setAttribute("tabindex","-1"),t},getJqBlocker:function(){return this._wrapEleInJq(this.createBlocker())},show:function(t,e){return e?e.length>0&&(e=e[0]):e=this.createBlocker(),(t=t.length?t[0]:t).appendChild(e),this._wrapEleInJq(e)},_wrapEleInJq:function(e){return t(e)}}})),define("dashboard-core/js/lib/@waca/dashboard-common/dist/utils/Flyout",["jquery","../lib/@waca/core-client/js/core-client/ui/AccessibleView","doT","underscore","./DialogBlocker"],(function(t,e,i,n,o){var s=0,a=e.extend({bsFullTemplateString:'
{{=it.containerTemplate}}
',containerTemplateString:'{{=it.closeBtn}}
',closeBtnTemplateString:'
',placement:null,enableTabLooping:!0,init:function(e){if(a.inherited("init",this,[{launchPoint:e.launchPoint}]),n.defaults(e,{modal:!1}),this.forceRedraw=e.forceRedraw,this.logger=e.logger,this.selector=e.selector,this.notCentered=e.notCentered,this.relatedNodes=e.relatedNodes||[],this.once=e.once,this.modal=e.modal,this.hideOnMouseLeave=e.hideOnMouseLeave,this.placement||(this.placement=e.placement),this.notCentered=e.notCentered,this.alignment=e.alignment,this.hideEventsAttached=!1,e.pageX){var i=t(this.selector),r=e.placement||this._calculatePlacement(0,i);if("top"===r||"bottom"===r){var l=t(this.selector).offset().left+t(this.selector).width()/2;e.marginLeft=e.pageX-l}}s++,this.id="_pop_"+s;var c=this.id+"_btn_",d=this._generateContainerTemplate(e,this.id,c);this.contentRootSelector="#"+this.id+">.popover-content";var h=e.viewInstance;h||(h=new e.viewClass({popupContainer:this,content:e.content,viewOptions:e.viewOptions,contentRootSelector:this.contentRootSelector,maxHt:e.maxHt,maxWd:e.maxWd,logger:this.logger}),this.isDestroyContentView=!0),this.view=h;var u=h;h.getRenderedHtml&&(u=h.getRenderedHtml.bind(h)),this.content=u;var p=e.container;this.modal&&((p=o.getJqBlocker()).addClass("show"),p.addClass("transparent"),this._blocker=p);var f=e.viewport,m={placement:e.placement||this._calculatePlacement.bind(this),trigger:"manual",container:p,content:u,viewport:f,html:!0,template:d,sanitize:!1};this.popover=t(this.selector).popover(m),this._bindEvents(e,c)},_addBlocker:function(){o.show(document.body,this._blocker)},_findCurrentOpenedPopoversToClose:function(){var e=t(".flyout-content-container"),i=[];return n.each(e,(function(e){var n=t(e).data("flyout");n&&i.push(n)})),i},open:function(t){return this.forceRedraw||!this.isOpen?this._open(t):(this.isOpenReady=Promise.resolve(),this.isOpenReady)},_open:function(e){var i=this;return this.isOpenReady=new Promise((function(t){var e=i._findCurrentOpenedPopoversToClose();if(e.length>0){var o={},s={};n.each(e,(function(e){s[e.id]=e,o[e.id]={flyout:e,hiddenPopoverCallback:function(){delete s[e.id],0===n.keys(s).length&&t(o)}},e.popover.on("hidden.bs.popover",o[e.id].hiddenPopoverCallback)})),n.each(o,(function(t){t.flyout.close()}))}else t()})).then((function(o){n.each(o,(function(t){t.flyout.popover.off("hidden.bs.popover",t.hiddenPopoverCallback)})),i.modal&&!i.isOpen&&t(i.popover).has(e)&&i._addBlocker(),i._openFlyout(e)})),this.isOpenReady},openIsReady:function(){var t=this;return(this.isOpenReady||Promise.resolve()).then((function(){return!!t.isOpen}))},_openFlyout:function(e){var i=this;if(!this.isOpen){if(t(this.popover).has(e)){var n=t(e);n.popover("show");var o=n.length&&t.data(n[0],"bs.popover");o&&o.$tip?("top"===this.alignment?o.$tip.css("top",o.$element.position().top):"left"===this.alignment&&o.$tip.css("left",o.$element.position().left),!this.notCentered||"right"!==this.placement&&"left"!==this.placement?!this.notCentered||"top"!==this.placement&&"bottom"!==this.placement||o.$tip.css("left",o.$element.offset().left):o.$tip.css("top",o.$element.offset().top),this.adjustPopoverInViewport(o),o.$tip.on("userCloseFlyout",(function(){i.close()}))):console.error("Cannot retrieve popover object")}this.isOpen=!0}},adjustPopoverInViewport:function(e){var i=e.$tip,n=i.get(0).getBoundingClientRect(),o=t(window).width(),s=t(window).height(),a=parseFloat(i.css("margin-left")),r=parseFloat(i.css("margin-right")),l=parseFloat(i.css("margin-top")),c=parseFloat(i.css("margin-bottom")),d=n.left+a,h=n.right-r,u=n.top+l,p=n.bottom-c;if(d<0)i.css("left",-a);else if(o=Math.round(l+r)?s="top":Math.round(a.height()-(o.offset().top+o.outerHeight(!0)))>=Math.round(l+r)?s="bottom":Math.round(a.width()-(o.offset().left+o.outerWidth(!0)))>=Math.round(c+r)?s="right":Math.round(o.offset().left)>=Math.round(c+r)&&(s="left"),this.placement=s,s}});return a})),define("dashboard-core/js/lib/@waca/dashboard-common/dist/ui/AuthoringToolbar",["jquery","underscore","./Toolbar","./Labels","./CustomTooltip","./interaction/Utils","../utils/Flyout","../nls/StringResources","../utils/DialogBlocker"],(function(t,e,i,n,o,s,a,r,l){var c=null;return c=i.extend({baseClass:"toolbar authoringToolbar",init:function(t){this.options=t,c.inherited("init",this,arguments),this.$el.addClass(this.baseClass),this.id=e.uniqueId("authtb_"),this.selectionNodes=[],this._viewStack=[],this._savedItemSpecs=[],this.isOpened=!1,this._labelsView=null,this._labelsAsActionView=null},_addLabelsView_asAction:function(e){this._labelsAsActionView&&this._labelsAsActionView.remove(),this._labelsAsActionView=t('
'),this._labelsAsActionView.prepend(e)},_renderCaptionButton:function(e,i,n,o,s){e.addClass("caption");var a=t('');a.attr({"aria-label":r.get(n)}),e.addClass("child"),e.prepend(a),e.on("primaryaction",s)},closeFlyout:function(){this.closeButtonEnabled?this.hide(1):!1!==this.goToPreviousEnabled&&this.showPreviousView()},getRenderedHtml:function(){var e;if((e=this.options.textOnly?t('
'):t('
')).attr({role:"region","aria-label":this.name||r.get("toolbarRegionLabel")}),this.name&&this.showCaption){var i=t("

").text(this.name);this.closeButtonEnabled?this._renderCaptionButton(i,"wfg_shape_x","dlg_close","right",this.hide.bind(this)):!1!==this.goToPreviousEnabled?(i.addClass("caption"),(this.options.launchView||this._viewStack.length)&&this._renderCaptionButton(i,"wfg_leftarrow","dlg_back","left",this.showPreviousView.bind(this))):i.addClass("staticNextViewCaption"),e.append(i)}this._labelsView&&(this.itemMap.subview||e.append(this._labelsView.$el)),this._labelsAsActionView&&e.append(this._labelsAsActionView);var n=Object.getOwnPropertyNames(this.itemMap).length;return n>0&&(this._labelsView&&!this.options.isTextEditorOnly&&e.append('
'),this.$el.hasClass("textOnlyToolBar")&&this.$el.removeClass("textOnlyToolBar"),e.append(this.$el),this.name&&n>1&&e.css("max-width",47*n*1.5+"px")),this.options.isTextEditorOnly&&(this._labelsView&&this._labelsView.$el.addClass("textOnlyToolBar"),this.$el.addClass("textOnlyToolBar")),e},setFocus:function(){this.itemMap.subview&&this.itemMap.subview.subView.setFocus?this.itemMap.subview.subView.setFocus():this.options.noFocus||c.inherited("setFocus",this,arguments)},setLabels:function(t){this._labelsView&&(this._labelsView.remove(),this._labelsView=null),t.tooltipRenderer&&t.tooltipContext&&t.tooltipRenderer.canRender(t.tooltipContext)?(this._labelsView=new o(t.tooltipRenderer,t.tooltipContext),this._labelsView.render()):(t.labels||t.title)&&(this._labelsView=new n(t),this._labelsView.render())},setName:function(t){this.name=t||null},setShowCaption:function(t){this.showCaption=t},enableGoPrevious:function(t){this.goToPreviousEnabled=!1!==t},enableClose:function(t){this.closeButtonEnabled=!!t},focusGoPrevious:function(){this.goToPreviousEnabled&&this.$el.prev().find("*[tabindex=0]").first().focus()},setOptions:function(t){this._options=t,t&&t.addClass&&("string"==typeof t.addClass?this.$el.addClass(t.addClass):this.$el.addClass(t.addClass.join(" ")))},onPopupShown:function(){this.isOpened=!0,this.$boundingRectNode&&this.$boundingRectNode.css("display","none"),this.trigger("toolbar:show",this._options)},onPopupClosed:function(){var t=this;(this.isOpened?this.hide():Promise.resolve()).then((function(){t.trigger("toolbar:hide",t._options)}))},setSelectionContext:function(i){var n=void 0,o=e.union(this.selectionNodes,i).length;return this.selectionNodes&&o===i.length&&o===this.selectionNodes.length&&this.lastPositionKey===this.getPositionKey(i)||(n=this._destroyFlyout()),this.launchPoint=this._getSelector(t(i).last()),this.options.launchView&&this.options.launchView.getFlyout&&(this.launchPoint=this.options.launchView.getFlyout().getLaunchPoint()),this.lastPositionKey=this.getPositionKey(),this.selectionNodes=i.slice(),this.selectionBounds=null,n||Promise.resolve()},_getSelector:function(t){for(var e,i=t;i.length;){var n=i[0],o=n.localName;if(!o)break;o=o.toLowerCase();var s=i.parent(),a=s.children(o);a.length>1&&(o+=":eq("+a.index(n)+")"),e=o+(e?">"+e:""),i=s}return e},getPositionKey:function(t){return e.map(t||this.selectionNodes,(function(t){return[t.offsetTop,t.offsetLeft,t.offsetWidth,t.offsetHeight].join("_")})).sort().join("_")},setSelectionBounds:function(t){var e=this._destroyFlyout();return this.selectionBounds=t,this.selectionNodes=[],e},_getFlyoutNode:function(){if(this.options.triggerNode)return this.options.triggerNode;if(this.selectionNodes.length>1||this.selectionBounds||this.options.calculateBoundingRect){if(!this.$boundingRectNode){var e=this.getSelectionBounds(),i=e.minTop,n=e.minLeft,o=document.fullscreenElement||document.mozFullScreenElement||document.webkitFullscreenElement;if(e.parent&&e.parent!=o){var s=t(e.parent).offset();i+=s.top,n+=s.left}this.$boundingRectNode=t('
');var a=Math.round(e.maxTop-e.minTop),r=Math.round(e.maxLeft-e.minLeft);i=Math.round(i),n=Math.round(n);var l=t("#main");if(l.length){var c=l.height()-i;a=Math.min(a,c)}this.$boundingRectNode.css({position:"absolute",top:i+"px",left:n+"px",height:a+"px",width:r+"px"}),this.$boundingRectNode.appendTo("body"),this.applyDimensionsForBestLocation(e,this.$boundingRectNode)}return this.$boundingRectNode[0]}return 1===this.selectionNodes.length?this.selectionNodes[0]:void 0},applyDimensionsForBestLocation:function(t,e){var i=Math.round(t.maxLeft-t.minLeft),n=Math.round(t.maxTop-t.minTop),o=Math.min(i,n),s=e[0].getBoundingClientRect();if(Math.round(s.width)>i||Math.round(s.height)>n){e.css({top:t.minTop+"px",left:t.minLeft+"px",height:o+"px",width:o+"px"});var a=e[0].getBoundingClientRect();Math.round(a.top)>Math.round(s.top)&&e.css({top:t.maxTop-o+"px",left:t.maxLeft-o+"px",height:o+"px",width:o+"px"})}if(this.selectionNodes&&this.selectionNodes.length>0){var r=this.selectionNodes[0].parentNode;if(r&&r.getBoundingClientRect){var l=r.getBoundingClientRect();s=e[0].getBoundingClientRect();var c=Math.max(s.top,l.top),d=Math.min(s.bottom,l.bottom),h=Math.max(s.left,l.left),u=Math.min(s.right,l.right);e.css({top:c+"px",left:h+"px",height:d-c+"px",width:u-h+"px"})}}},getSelectionBounds:function(){return this.selectionBounds?{minTop:this.selectionBounds.top,minLeft:this.selectionBounds.left,maxTop:this.selectionBounds.top+this.selectionBounds.height,maxLeft:this.selectionBounds.left+this.selectionBounds.width,parent:this.selectionBounds.parent}:s.getMinMaxTopLeft(this.selectionNodes,(function(e){var i=t(e).offset(),n=e.scrollHeight-e.clientHeight,o=e.scrollWidth-e.clientWidth;i.top-=n/2,i.left-=o/2;var s=e.getBoundingClientRect();return i.height=Math.max(s.height,s.height+n),i.width=Math.max(s.width,s.width+o),i}))},pushItemsOnStack:function(){this._viewStack.push({name:this.name,items:this._savedItemSpecs}),this._savedItemSpecs=[]},showPreviousView:function(){var t=this;if(this._viewStack.length){var e=this._viewStack.pop();return this.hide(1).then((function(){t.clearItems(),t.setName(e.name)})).then(this.addItems.bind(this,e.items)).then(this.show.bind(this,this.placement))}return this.options.launchView&&this.options.backButtonCallback&&(this.flyout.destroy(),this.options.backButtonCallback.apply(this.options.launchView)),Promise.resolve()},clearHistory:function(){this._viewStack=[]},clearItems:function(){this._savedItemSpecs=[],this._labelsAsActionView&&(this._labelsAsActionView.remove(),this._labelsAsActionView=null),c.inherited("clearItems",this,arguments)},show:function(t){var e=this,i=this._getFlyoutNode();return i?(this._createFlyout(i,t||this.options.placement),this.ready().then((function(){var t=e._options&&e._options.isWidgetOdt&&l.isShowingDialogBlocker();if(e.flyout&&!e.isOpened&&!t)return e.$boundingRectNode&&e.$boundingRectNode.css("display","block"),e.trigger("toolbar:show:before",e._options),e.flyout.open(i).then((function(){e.notifyItemsOpened()}))}))):Promise.reject()},_createFlyout:function(i,n){if(!this.flyout){var o=t(this._getTopParentNode()).get(0).getBoundingClientRect();n=n||this._getPlacement(i,o,n);var s=e.extend({selector:i,viewInstance:this,popoverClass:this._getPopoverClass(n),placement:n,alignment:this._getAlignment(n),hideOnMouseLeave:!0===this.options.hideOnMouseLeave,relatedNodes:this.selectionNodes,launchPoint:this.launchPoint},this.options);this.options&&"localFilterViewWrapper"===this.options.popoverContentClass&&(s.placement=n),this.options&&this.options.triggerNode&&(s.notCentered=!0),this.flyout=new a(s),this.launchPoint||(this.launchPoint=this.flyout.getLaunchPoint()),this.options.launchView&&this.options.launchView.setFlyout&&this.options.launchView.setFlyout(this.flyout)}},getContentDimensions:function(){var i=this,n="popover actionToolbarPopover";function o(t){return'
'}this.options.preferredVertical&&(n+=" vertical");var s=t(o(n)).appendTo("body");if(this._labelsView&&s.append(this._labelsView.$el),this._labelsAsActionView&&s.append(this._labelsAsActionView),s.append(this.$el),!this.options.popoverContentClass&&this._savedItemSpecs&&this._savedItemSpecs.length>0&&e.each(this._savedItemSpecs,(function(t){t.subView&&t.subView.$el&&t.subView.$el.hasClass("localFilterViewWrapper")&&(i.options.popoverContentClass="localFilterViewWrapper")})),this.options.popoverContentClass&&!this.$el.find(".localFilterViewWrapper").length>0){var a=t(o(this.options.popoverContentClass));s.append(a)}var r={w:s.outerWidth(),h:s.outerHeight()};return this.$el.detach(),this._labelsView&&this._labelsView.$el.detach(),this._labelsAsActionView&&this._labelsAsActionView.detach(),s.remove(),r},_getPlacement:function(i,n,o){var s=this,a=this.getContentDimensions(),r=t(i).get(0).getBoundingClientRect(),l=a.w,c=a.h;e.each(this._savedItemSpecs,(function(t){t.viewOptions&&(l=isNaN(t.viewOptions.width)?l:Math.max(t.viewOptions.width,l),c=isNaN(t.viewOptions.height)?c:Math.max(t.viewOptions.height,c))}));var d=function(){return!s._options||!s._options.isWidgetOdt||r.top+c0&&d()?h="left auto":r.left+r.width+l-n.left0&&void 0!==arguments[0]?arguments[0]:[];this._savedItemSpecs=e;var i=[],n=[];return e.forEach((function(e){t._updateActionHandler(e),t._isLabelOnly(e)?n.push(t._addLabelOnlyItem(e)):i.push(e)})),n.push(c.inherited("addItems",this,[i])),Promise.all(n)},_addLabelOnlyItem:function(e){var i=t("
");return this._addLabelsView_asAction(i),this._renderItem(e,i)},_isLabelOnly:function(t){return t.labelOnly},_updateActionHandler:function(t){t.closeOnActionApplied&&(t.action&&(t.action=this._applyActionThenClose.bind(this,t.action)),t.actions&&(t.actions.apply=this._applyActionThenClose.bind(this,t.actions.apply))),t.removeOnActionApplied&&(t.action&&(t.action=this._applyActionThenRemove.bind(this,t.action)),t.actions&&(t.actions.apply=this._applyActionThenRemove.bind(this,t.actions.apply))),t.removeThenApplyAction&&(t.action&&(t.action=this._removeThenApplyAction.bind(this,t.action)),t.actions&&(t.actions.apply=this._removeThenApplyAction.bind(this,t.actions.apply)))},_applyActionThenClose:function(t){var e=[].concat(Array.prototype.slice.call(arguments));t.apply(this,e.shift()),this.hide()},_applyActionThenRemove:function(t){var e=[].concat(Array.prototype.slice.call(arguments));t.apply(this,e.shift()),this.remove(!0)},_removeThenApplyAction:function(t){this.remove(!0);var e=[].concat(Array.prototype.slice.call(arguments));t.apply(this,e.shift())},remove:function(t){var e=this,i=arguments;this.clearItems(),this._destroyFlyout().then((function(){t&&e.trigger("toolbar:remove",e._options),c.inherited("remove",e,i)}))},focus:function(){if(this.isOpened){var e=t(this.el).find("button");if(e.length>0)return e[0].focus(),!0}return!1},updateButtons:function(){this.itemMap&&e.each(this.itemMap,(function(t){t.update&&t.render()}))}})})),define("dashboard-core/js/lib/@waca/dashboard-common/dist/ui/toolbar_components/NextView",["./Button","../AuthoringToolbar","require","jquery"],(function(t,e,i,n){var o=t.extend({events:{primaryaction:"_handleClick"},baseClass:"toolbar",init:function(t,e,n){o.inherited("init",this,arguments),this.requireFn=this.requireFn||i,this.toolbar=n,this.parentItem=e,this.toolbarItemsTriggered={}},_handleClick:function(t){return this.$("button").prop("disabled")?Promise.resolve():this.initializeNextView(t)},initializeNextView:function(t){var e=this;this.currentTarget=t.currentTarget;var i=this.viewModule||this.view&&this.view.module;return i&&!(this.currentTarget in this.toolbarItemsTriggered)?(this.toolbarItemsTriggered[this.currentTarget]=!0,this._loadModule(i).then((function(t){var i=new t((e.view&&e.view.state?{state:e.view.state,actions:e.actions}:"function"==typeof e.viewOptions?e.viewOptions():e.viewOptions)||{});if(i.preload)return i.preload().then(e._renderNextView.bind(e,i)).then((function(t){i.renderCallBack&&i.renderCallBack(t)}));e._renderNextView(i)})).then((function(t){return delete e.toolbarItemsTriggered[e.currentTarget],Promise.resolve(t)}),(function(t){return delete e.toolbarItemsTriggered[e.currentTarget],Promise.reject(t)}))):Promise.resolve()},_loadModule:function(t){var e=this;return new Promise((function(i,n){try{e.requireFn([t],i,n)}catch(t){n(t)}}))},createFlyoutSubView:function(){return new e({container:n("body"),placement:"bottom",triggerNode:this.currentTarget})},_renderNextView:function(t){var e=this,i=function(i,n){var o=void 0===e.showCaption||e.showCaption;return new Promise((function(s,a){return i.clearItems(),i.setName(e.label),i.setShowCaption(o),n?i.enableGoPrevious(e.enableGoPrevious):i.enableClose(!0),i.addItems([{name:"subview",responsive:!1,editable:!1,changedAction:null,subView:t,type:"SubView"}]).then((function(){i.show(i.placement)})).then((function(){s(i)})).catch(a)}))},n=!!this.toolbar.pushItemsOnStack;return n?(this.toolbar.pushItemsOnStack(),this.toolbar.hide(1).then((function(){return i(e.toolbar,n)}))):this.flyoutSubView?this.flyoutSubView.hide().then((function(){return i(e.flyoutSubView,n)})):(this.flyoutSubView=this.createFlyoutSubView(),this.update&&this.flyoutSubView.on("toolbar:hide",(function(){e.toolbar.updateButtons()})),i(this.flyoutSubView,n))},remove:function(){this.flyoutSubView&&this.flyoutSubView.isOpened&&this.flyoutSubView.hide(),o.inherited("remove",this,arguments)}});return o})),define("dashboard-core/js/lib/@waca/dashboard-common/dist/ui/react_toolbar/ReactToolbarContainer",["../../lib/@waca/core-client/js/core-client/ui/core/View","react","react-dom","require","./ReactToolbar","../toolbar_components/NextView"],(function(t,e,i,n,o,s){var a=t.extend({init:function(t,e,i){a.inherited("init",this,arguments),this.itemSpecs=t,this.el=e,this._toolbar=i},getItems:function(){return this.itemSpecs},setFocus:function(){var t=this._toolbar.$el.find("button")[0];t&&t.focus()},_nextViewCb:function(t,e,i,n){t._toolbar.updateButtons=n,new s(e,null,t._toolbar).initializeNextView(i)},ready:function(t){var n=this;return new Promise((function(s){i.render(e.createElement(o,{itemSpecs:n.getItems(),orientation:t,nextViewCb:function(t,e,i){return n._nextViewCb(n,t,e,i)},toolbarOptions:n._toolbar.options}),n.el,(function(){n._toolbar.on("toolbar:show",n.setFocus,n),s()}))}))},clearItems:function(){this.itemSpecs=[],i.unmountComponentAtNode(this.el)}});return a})),define("dashboard-core/js/lib/@waca/dashboard-common/dist/api/Error",[],(function(){return function(){function t(e,i){_classCallCheck(this,t),this._message=e.msg,this._params=e.params,this._type=i&&"warning"===i.type?"warning":"error"}return t.prototype.getMessage=function(){return this._message},t.prototype.getParams=function(){return this._params},t.prototype.getType=function(){return this._type},t.prototype.toJson=function(){return{message:this.getMessage(),params:this.getParams(),type:this.getType()}},t}()})),define("dashboard-core/js/lib/@waca/dashboard-common/dist/utils/HtmlXSSUtils",[],(function(){var t=["body","embed","script","object","applet","meta","style","link"];return{cleanseContentElements:function(t,e,i){if(!t)return null;var n=(((e=e||[])+"").toLowerCase().match(/<[a-z][a-z0-9]*>/g)||[]).join("");if(i){t=t.replace(/|<\?(?:php)?[\s\S]*?\?>/gi,"")}return t.replace(/<\/?([a-z][a-z0-9]*)\b[^>]*>/gi,(function(t,e){return n.indexOf("<"+e.toLowerCase()+">")>-1?t:""}))},isValidHtmlContent:function(t){return!this.containsTag(t)&&!this.containsBlackListedAttributes(t)&&this.isHtmlSafe(t)},containsTag:function(e){return new RegExp("<("+t.join("|")+")(\\s|\\/|>|$)","i").test(e)},containsBlackListedAttributes:function(t){return new RegExp("<\\w+[^>]*\\bon\\w+\\s*=","i").test(t)},isHtmlSafe:function(t){var e=t.match(/<\s*\w+\b[^>]+\s*>/g);return!e||[!0].concat(e).reduce((function(t,e){return t&&!e.match(/\w+\s*=\s*"?\s*javascript/gi)}))},sanitizeHtml:function(t){return t&&this.isValidHtmlContent(t)?t:""}}})),define("dashboard-core/js/lib/@waca/dashboard-common/dist/core/Events",["underscore","../lib/@waca/core-client/js/core-client/ui/core/Events"],(function(t,e){return function(e){function i(){return _classCallCheck(this,i),_possibleConstructorReturn(this,e.apply(this,arguments))}return _inherits(i,e),i.prototype.on=function(i,n,o){var s=e.prototype.on.call(this,i,n,o),a=this._events[i].length-1,r=this._events[i][a];return r.id=t.uniqueId("__api_eventHandler_"),r.eventName=i,s},i.prototype.setTransaction=function(t){this.transaction||(this.transaction=t)},i.prototype.trigger=function(t,e){var i=this,n=[].concat(this._events.all||[]),o=[],s=t.split(":");if(s.length>1){var a=[];s.forEach((function(t){var e=t;a.length>0&&(e=a[a.length-1]+":"+t),a.push(e)})),a.forEach((function(e){i._events[e]&&(e===t?n.push.apply(n,i._events[e]):o.push.apply(o,i._events[e]))}))}else this._events[t]&&n.push.apply(n,this._events[t]);for(var r=0;r=e.length)break;o=e[n++]}else{if((n=e.next()).done)break;o=n.value}var s=o,a=t[s];t[s]=a&&"object"===(void 0===a?"undefined":_typeof(a))?this.deepFreeze(a):a}t=Object.freeze(t)}return t},i.prototype.trigger=function(t,i){i||(t=JSON.parse(JSON.stringify(t)));var n=t.transactionToken,o=t.bubbleInfo,s=o?o.callStack:null;if(!this.isDisableTriggerOnSelf){var a=e.extend({},t.tracking);a.callStack=s?s.concat():[];var r=(t.type||"change")+":"+t.name,l=this.deepFreeze({name:r,info:t.info||{},tracking:a,transactionToken:n,context:t.context||{}});this.events.trigger(r,l)}if(this.parentEventEmitter){s||(s=[]),s.unshift(this.callStack);var c={name:this.namespace?this.namespace+":"+t.name:t.name,info:e.extend(e.extend({},this.info),t.info),type:t.type,tracking:t.tracking,transactionToken:t.transactionToken,bubbleInfo:{callStack:s},context:e.extend({},t.context)};this.parentEventEmitter.trigger(c,!0)}},i}()})),define("dashboard-core/js/lib/@waca/dashboard-common/dist/core/APIEventSupport",["./EventEmitter","underscore"],(function(t,e){return function(){function i(e,n,o,s){var a=this;_classCallCheck(this,i),this.apiImplementation=e,this.eventSpec=this.createSpec(n),this.apiName=o;var r=this.getEventEmitterOptions(),l=s&&s["Dashboard.Transaction"];this.eventEmitter=new t(r,l),this.apiImplementation.getEventSupport=function(){return a},this.apiImplementation.on=this.on.bind(this),this.apiImplementation.off=this.off.bind(this),this.eventSpec.serializeActions&&(this.apiImplementation.serializeActions=this.serializeActions.bind(this))}return i.prototype.isSupported=function(t){return!!this.getActionSpec(t)},i.prototype.extendAPI=function(t,e){this.apiInstance=t,e.prototype.on&&this.eventEmitter.enableTriggerOnSelf()},i.prototype.serializeActions=function(){var t=[],e=this.eventSpec.actions,i={};if(e){var n=void 0;for(n in e){if(e[n].isResolvePostResponse)throw new Error("serializeActions is not supported when isResolvePostResponse = true for "+n);var o=this.getUndoActions(e[n],n);if(1!==o.length)throw new Error("serializeActions is not supported when undoActions length is not 1");if(Array.isArray(o[0].params)){var s=!0;if(o[0].params.forEach((function(t){null!=t&&(s=!1)})),!s){var a=JSON.stringify(o[0]);i[a]||(i[a]=!0,t.push(o[0]))}}}}return this.eventSpec.serializeActions.children&&this.eventSpec.serializeActions.children.forEach((function(e){if("function"==typeof e.getObject){var i=e.getObject();if(i&&"function"==typeof i.serializeActions){var n=i.serializeActions();n.forEach((function(t){t.callStack=e.callStack})),t.push.apply(t,n)}}})),t},i.prototype.createSpec=function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=e.actions,n=void 0,o=function(){var e,o=n,s=i[n].transactionParamIndex;if(i[n].getUndoActions||(i[n].getUndoActions=function(){return[{name:o,params:[]}]}),i[n].autoCreateTransaction&&!i[n].onBeforeAction&&!i[n].onAfterAction&&i[n].transactionAPI){var a=i[n].transactionAPI;i[n].onBeforeAction=function(t){var e={};return t[s]||(t[s]=a.startTransaction(),e.transactionCreated=!0),e},i[n].onAfterAction=function(t,e,i){i.transactionCreated&&a.endTransaction(t[s])}}i[n].getAction||(i[n].getAction=function(e){var i=e.filter((function(i,n){return!(n===e.length-1&&t._isTransactionToken(i))}));return{name:o,params:i}}),i[n].getInfo||(i[n].getInfo=function(e){var i=e.filter((function(i,n){return!(n===e.length-1&&(n===s||t._isTransactionToken(i)))})),n={};return 1===i.length?n.value=i[0]:i.length>1&&(n.value=i),n}),i[n].getTransactionToken||(i[n].getTransactionToken=(e=i[n],function(i){var n=null;if(i.length>0){var o=i[void 0===e.transactionParamIndex?i.length-1:e.transactionParamIndex];t._isTransactionToken(o)&&(n=o)}return n}))};for(n in i)o();return e},i.prototype._isTransactionToken=function(t){return t&&(t.transactionId||t.__transaction)},i.prototype.getUndoActions=function(t,e,i,n){var o=t.getUndoActions(i,n);return o.forEach((function(t){t.name||(t.name=e)})),o},i.prototype.onBeforeAction=function(t,e,i){var n={},o=this.getActionSpec(t);o&&i&&i.transactionToken&&(e[void 0!==o.transactionParamIndex?o.transactionParamIndex:e.length]=i.transactionToken);return o&&"function"==typeof o.onBeforeAction&&(n.options=o.onBeforeAction(e)),o&&"function"==typeof o.getUndoActions&&!o.isResolvePostResponse&&(n.undoActions=this.getUndoActions(o,t,e)),n},i.prototype.onAfterAction=function(t,i,n,o,s){var a=this.getActionSpec(t);if(a&&"function"==typeof a.getAction&&"function"==typeof a.getInfo&&"function"==typeof a.getTransactionToken&&"function"==typeof a.getUndoActions){var r=a.getAction(i,n);if(r.name=t,a.isResolvePostResponse&&(o.undoActions=this.getUndoActions(a,t,i,n)),(a.isTriggerEvent||function(t,e){var i=e.length>1;if(!i){var n=e[0]||{};if(!(i=t.name!==n.name))i=(t.params?JSON.stringify(t.params):"[]")!==(n.params?JSON.stringify(n.params):"null")}return i})(r,o.undoActions,n)){var l=a.getInfo(i,n);a.info&&e.extend(l,a.info),l.actionName||(l.actionName=t);var c=a.getTransactionToken(i)||{__transaction:!0};"event"===(c=JSON.parse(JSON.stringify(c))).source?c.eventGenerated=!0:c.source="event";var d=void 0;d="function"==typeof a.getEventName?a.getEventName(i):a.eventName;var h={type:a.type||"change",name:d,info:l,tracking:{action:r,undoActions:o.undoActions},transactionToken:c,context:s?s.toJSON():void 0};s&&s.addEvent(h),this.triggerEvent(h)}a&&"function"==typeof a.onAfterAction&&a.onAfterAction(i,n,o.options)}},i.prototype.getActionSpec=function(t){return this.eventSpec.actions&&this.eventSpec.actions[t]},i.prototype.enableChildEventPropagation=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if("function"==typeof t.getEventSupport){var i=t.getEventSupport();e.parentEventEmitter=this.eventEmitter,i.enableEventPropagation(e)}},i.prototype.enableEventPropagation=function(t){this.propagationInfo=t,this.eventEmitter&&this.eventEmitter.enableEventPropagation(this.getEventEmitterOptions())},i.prototype.getEventEmitterOptions=function(){var t=this.eventSpec.propagationInfo?JSON.parse(JSON.stringify(this.eventSpec.propagationInfo)):{};if(this.propagationInfo){var i=void 0;for(i in this.propagationInfo)t[i]?e.extend(t[i],this.propagationInfo[i]):t[i]=this.propagationInfo[i]}return t.name=this.apiName,t},i.prototype.triggerEvent=function(t){this.eventEmitter&&this.eventEmitter.trigger(t)},i.prototype.on=function(t,e,i){if(this.eventEmitter)return this.eventEmitter.on(t,e,i)},i.prototype.off=function(t,e,i){this.eventEmitter&&this.eventEmitter.off(t,e,i)},i}()})),define("dashboard-core/js/lib/@waca/dashboard-common/dist/core/APIExtension",["./APIEventSupport"],(function(t){return function(){function e(t){_classCallCheck(this,e),this.apiImplementation=t,this.apiExtensions={};var i=void 0;if("function"==typeof t.getAPISpec&&(i=t.getAPISpec()),i){var n=void 0;for(n in i){var o=this.createExtension(t,n,i.events,i.name,i.features);o&&(this.apiExtensions[n]=o,this._enabled=!0)}}}return e.getAPIExtension=function(t){return t.__apiExtension||(t.__apiExtension=new e(t)),t.__apiExtension},e.prototype.extendAPI=function(t,e){var i=void 0;for(i in this.apiExtensions)this.apiExtensions[i].extendAPI&&this.apiExtensions[i].extendAPI(t,e)},e.prototype.createExtension=function(e,i,n,o,s){if("events"===i)return new t(e,n,o,s)},e.prototype.isEnabled=function(){return!!this._enabled},e.prototype.getSupport=function(t){return this.apiExtensions[t]},e.prototype.isSupported=function(t){for(var e in this.apiExtensions)if(this.apiExtensions[e].isSupported(t))return!0;return!1},e.prototype.onBeforeAction=function(t,e,i){var n={},o=void 0;for(o in this.apiExtensions)n[o]=this.apiExtensions[o].onBeforeAction(t,e,i);return n},e.prototype.onAfterAction=function(t,e,i,n,o){var s=void 0;for(s in this.apiExtensions)n[s]=this.apiExtensions[s].onAfterAction(t,e,i,n[s],o)},e}()})),define("dashboard-core/js/lib/@waca/dashboard-common/dist/core/APIContext",["underscore"],(function(t){return function(){function e(i){_classCallCheck(this,e),this.options=i,t.extend(this,i),this._events=[]}return e.prototype.toJSON=function(){return this.options},e.prototype.addEvent=function(t){this._events.push(t)},e.prototype.getEventList=function(){return this._events},e}()})),define("dashboard-core/js/lib/@waca/dashboard-common/dist/utils/MemUtil",[],(function(){var t=new WeakMap,e=function(){};return function(){function i(){_classCallCheck(this,i)}return i.destroy=function(i){var n=t.get(i.__proto__);if(!n)for(var o in n={},t.set(i.__proto__,n),i.__proto__)"function"==typeof i.__proto__[o]&&(n[o]=e);for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&("function"==typeof i[s]?i[s]=e:delete i[s]);i.__proto__=n,i.__destroyed__=!0},i.isDestroyed=function(t){return t.__destroyed__},i}()})),define("dashboard-core/js/lib/@waca/dashboard-common/dist/core/APIFactory",["./APIExtension","./APIContext","../utils/MemUtil","underscore"],(function(t,e,i,n){var o=function(){},s={},a={},r=function t(e,i){_classCallCheck(this,t),Object.defineProperty(this,"getInterfaceType",{configurable:!1,value:function(){return e}}),Object.defineProperty(this,"getImplType",{configurable:!1,value:function(){return i}})},l=function(e){return t.getAPIExtension(e)},c=function(t,n,o){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},c=new WeakMap;c.set(s,n),c.set(a,r.logger);var d=r.isDeprecated,h=l(n),u=n[o];if(!u)throw new Error('The method "'+o+'" is not part of the provided implementation');if("function"!=typeof u)throw new Error('The method "'+o+'" is not a function in the provided implementation');d?t[o]=function(){try{throw new Error}catch(e){(c.get(a)||console).log('The function "'+o+'" of the API "'+t.getInterfaceType()+'" is deprecated',{callStack:e.stack})}var e=c.get(s);if(e)try{return e[o].apply(e,arguments)}catch(t){if(!e||e.__api__destroyed)throw new Error("Access to a destroyed API instance");throw t}}:h.isEnabled()&&h.isSupported(o)?t[o]=function(){var t=[].concat(Array.prototype.slice.call(arguments)),n=void 0;t[0]instanceof e&&(n=t[0],t.shift());var a=h.onBeforeAction(o,t,n),r=c.get(s),l=void 0;try{l=r[o].apply(r,t)}catch(t){if(!r||i.isDestroyed(r))throw new Error("Access to a destroyed API instance");throw t}return l instanceof Promise?l.then((function(e){h.onAfterAction(o,t,e,a,n)})):h.onAfterAction(o,t,l,a,n),l}:t[o]=function(){var t=c.get(s);return t[o].apply(t,arguments)}},d=function(t,e,i){Object.defineProperty(t,e,{value:i,writable:!1})},h=function(t,e,s,a){if("function"!=typeof s)throw new Error("The interface is not a class");if(l(e).extendAPI(t,s),e.destroy||(e.destroy=o),"function"==typeof e.destroy&&!e.____destroy____){var r=new WeakMap,h={},u={};r.set(h,e),r.set(u,t),e.____destroy____=e.destroy,e.destroy=function(){var t=r.get(h),e=r.get(u);t.____destroy____.apply(t,arguments),e&&i.destroy(e),t&&i.destroy(t)}}for(var p=Object.getOwnPropertyNames(s.prototype),f=0;f0&&t[0].implementation.constructor?t[0].implementation.constructor.constructor.name:"anonymous",i=u(t[0].interface,e);return t.forEach((function(t){l(t.implementation),h(i,t.implementation,t.interface,t.options||{})})),i},t}())})),define("dashboard-core/js/lib/@waca/dashboard-common/dist/api/WidgetAPI",[],(function(){return function(){function t(){_classCallCheck(this,t)}return t.prototype.getId=function(){},t.prototype.getEventGroupId=function(){},t.prototype.getScope=function(){},t.prototype.getLayoutAPI=function(){},t.prototype.getType=function(){},t.prototype.getProperties=function(){},t.prototype.getProperty=function(){},t.prototype.getPropertyLayoutList=function(){},t.prototype.getPropertyList=function(){},t.prototype.getFeature=function(){},t.prototype.getContextToolbarItems=function(){},t.prototype.getError=function(){},t.prototype.getErrorDetails=function(){},t.prototype.hasError=function(){},t.prototype.hasWarning=function(){},t.prototype.clearError=function(){},t.prototype.on=function(){},t.prototype.off=function(){},t.prototype.isWidgetMaximized=function(){},t.prototype.isContextualGridEnabled=function(){},t.prototype.setFeatureEnabled=function(){},t}()})),define("dashboard-core/js/lib/@waca/dashboard-common/dist/api/impl/Widget",["../../core/APIFactory","../WidgetAPI"],(function(t,e){return function(){function i(t){_classCallCheck(this,i),this.widget=t}return i.prototype.getAPI=function(){return t.createAPI(this,[e])},i.prototype.getId=function(){return this.widget.getId()},i.prototype.getEventGroupId=function(){return this.widget.getEventGroupId()},i.prototype.getScope=function(){return this.widget.getContainerPageId()},i.prototype.getLayoutAPI=function(){return this.widget.getLayoutAPI()},i.prototype.getType=function(){return this.widget.getType()},i.prototype.getProperties=function(t){return this.widget.getProperties(t)},i.prototype.getProperty=function(t){return this.widget.getProperty(t)},i.prototype.getPropertyLayoutList=function(){return this.widget.getPropertyLayoutList()},i.prototype.getPropertyList=function(){return this.widget.getPropertyList()},i.prototype.getFeature=function(t){return this.widget.getFeature(t)},i.prototype.getContextToolbarItems=function(){return this.widget.getContextToolbarItems()},i.prototype.getError=function(){return this.widget.getError()},i.prototype.getErrorDetails=function(){return this.hasError()?{errorMessage:this.widget.getError()}:null},i.prototype.hasError=function(){return this.widget.hasError()},i.prototype.hasWarning=function(){return this.widget.hasWarning()},i.prototype.clearError=function(){this.widget.clearError()},i.prototype.on=function(t,e,i){return this.widget.on(t,e,i)},i.prototype.off=function(t,e,i){return this.widget.off(t,e,i)},i.prototype.isWidgetMaximized=function(){return this.widget.isWidgetMaximized()},i.prototype.isContextualGridEnabled=function(){return this.widget.isContextualGridEnabled()},i.prototype.setFeatureEnabled=function(t,e){return this.widget.setFeatureEnabled(t,e)},i}()})),define("dashboard-core/js/lib/@waca/dashboard-common/dist/utils/ContentUtil",[],(function(){return function(){function t(){_classCallCheck(this,t)}return t.getPageContent=function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"page",i=null;t;)e&&t.getType()===e&&(i=t),t=t.getContainer();return i},t}()})),define("dashboard-core/js/lib/@waca/dashboard-common/dist/ui/ExpandedController",["jquery"],(function(t){var e=function(t){this.widget=t.widget};return e.prototype.toggle=function(){var e=t('
');return this.widget.$el.parent().append(e),this.widget.getExpandViewContent&&this.widget.getExpandViewContent(this.data,e),Promise.resolve()},e})),define("text!dashboard-core/js/lib/@waca/dashboard-common/dist/ui/templates/FocusView.template",[],(function(){return'
\n\t\n\t\t\n\t\n
'})),define("dashboard-core/js/lib/@waca/dashboard-common/dist/ui/FocusView",["../lib/@waca/core-client/js/core-client/ui/AccessibleView","../nls/StringResources","jquery","doT","text!./templates/FocusView.template"],(function(t,e,i,n,o){var s=t.extend({init:function(t){s.inherited("init",this,arguments),this._content=t.content,this._owner=t.owner,this._widgetNode=t.data,this._dashboardState=t.dashboardState,this._iconsFeature=this._owner.dashboardApi.getFeature("Icons")},onKeyPress:function(t){27===t.keyCode&&this.cancel()},onTapBackground:function(){this.cancel()},_onClick:function(){this._owner.layoutAPI.offFocus()},render:function(){var t=this,s=this.containerElement||document.body,a=document.createElement("div");a.classList.add("focusViewContainer"),a.setAttribute("tabindex","-1");var r=i(s[0].appendChild(a));r.addClass("expandedView"),this._$container=r;var l=i('
');r.append(l);var c=this._owner.getExpandStartingPosition?this._owner.getExpandStartingPosition():this._getCardPosition(this._widgetNode.rowDiv),d=this._content.getFeature("VisExpandMode");if(d){this._setFocusState(!0),d.renderExpandedModeContent(l.get(0));var h=n.template(o)({label:e.get("evCollapse"),collapseIcon:this._iconsFeature.getIcon("minimize").id}),u=i(h);u.on("primaryaction",this._collapse.bind(this)),l.children().first().append(u)}var p={left:0,top:0,height:"100%",width:"100%"};l.css({"min-height":"inherit",top:c.top,left:c.left}).height(c.height).width(c.width),this._returnPosition=c,r.show();var f=new Promise(function(t){l.animate(p,"fast",function(){this.postRenderAnimation&&this.postRenderAnimation({height:l.height()}),t(r);var e=i(".popover");e.length&&e.popover("hide")}.bind(this._owner))}.bind(this));return i("body").on("tap.focusView",".focusViewContainer.expandedView",this.onTapBackground.bind(this)),i("body").on("keydown.pageView",this.onKeyPress.bind(this)),i("body").on("click.widgetContent",".widgetContent",this._onClick.bind(this)),r.on("touch","span.expand",(function(e){e.preventDefault(),e.stopImmediatePropagation(),t._collapse()})).on("tap","div.card",(function(t){t.preventDefault(),t.stopImmediatePropagation()})),f},remove:function(){return this._setFocusState(!1),this._$container&&(this._$container.remove(),this._$container=null),i("body").off("tap.focusView"),i("body").off("keydown.pageView"),i("body").off("click.widgetContent"),s.inherited("remove",this,arguments)},_getCardPosition:function(t){var e=i(t).parents(".cardscroll")[0],n=i(e).scrollTop(),o=this._getPosition(t);return o.y-=n,{top:o.y,left:o.x,height:i(t).height(),width:i(t).width()}},_restoreUI:function(){this._owner.onRestore&&this._owner.onRestore(),this.getLaunchPoint()&&this.getLaunchPoint().focus()},_collapse:function(){this._setFocusState(!1);var t=this._$container.find("div.card");t.css({overflow:"hidden"});var e=this.remove.bind(this);t.animate(this._returnPosition,"fast",function(){this._$container.fadeOut("fast",e)}.bind(this)),this._restoreUI()},cancel:function(){this._setFocusState(!1),this._$container&&(this._$container.fadeOut("fast",this.remove.bind(this)),this._restoreUI())},_getPosition:function(t){for(var e=0,i=0;t;)e+=t.offsetLeft-t.scrollLeft+t.clientLeft,i+=t.offsetTop-t.scrollTop+t.clientTop,t=t.offsetParent;return{x:e,y:i}},_setFocusState:function(t){this._dashboardState.getUiState().focus!=t&&this._dashboardState.updateUiState({stateChange:{focus:t}})}});return s})),define("dashboard-core/js/lib/@waca/dashboard-common/dist/ui/WidgetBase",["../lib/@waca/core-client/js/core-client/ui/core/Events","../lib/@waca/core-client/js/core-client/utils/Deferred","../api/Error","underscore","jquery","../utils/HtmlXSSUtils","../DynamicFileLoader","../api/impl/Widget","../utils/ContentUtil","./ExpandedController","./FocusView"],(function(t,e,i,n,o,s,a,r,l,c,d){var h=300,u=300,p=t.extend({expanded:!1,init:function(t){p.inherited("init",this,arguments),this.dashboardApi=t.dashboardApi;var i=-1!==[void 0,!0,"true"].indexOf(this.dashboardApi.getAppConfig("usePreferredSize")),n=t.initialConfigJSON&&t.initialConfigJSON.usePreferredSize;this.usePreferredSize=!1!==n&&i,this.whenContainerIsReady=new e,this.id=t.id,this.canvas=t.canvas,this.content=t.content,this._stateAPI=this.content.getFeature("state.internal"),this._stateAPI.onChangeError(this.onStateChangeError.bind(this)),this.initialConfigJSON=t.initialConfigJSON,this.el=t.el,this.$el=o(this.el),this.$widgetContainer=o(t.widgetContainer),this.eventRouter=t.eventRouter,this.services=t.services,t.registry&&(this.properties=t.registry.properties);var s=this.dashboardApi.getFeature("internal");s&&(this.eventGroups=s.getBoardModel().eventGroups),this.colorsService=this.dashboardApi.getFeature("Colors"),this.registerEvents(t.eventRouter),this.contributionSpec=t.registry,this.logger=this.dashboardApi.getGlassCoreSvc(".Logger"),this.errorView=t.errorView,this.propertiesUtil=t.propertiesUtil,t.contentFeatureLoader.registerDeprecatedFeature(this.id,"WidgetAPI.deprecated",{getAPI:this.getAPI.bind(this)}),this._expandModeContainerSelector=".boardPageView:visible > .pageViewContent > .dashboardFrame > .dashboardFrameCentre"},getDashboardApi:function(){return this.dashboardApi},_extendAPI:function(t){var e=this.getAPI();for(var i in t)"function"==typeof t[i]&&(e[i]=t[i])},getFeature:function(){return null},setFeatureEnabled:function(){},getId:function(){return this.id},getAPI:function(){return this.widgetAPI||(this.widgetAPI=new r(this).getAPI()),this.widgetAPI},registerEvents:function(){this.dashboardApi.on("widget:stopMove",this.onStopMove,this),this.dashboardApi.on("widget:startMove",this.onStartMove,this),this.dashboardApi.on("widget:onDetailErrors",this.addErrorDetailsHandler,this),this.colorsService&&this.colorsService.on("colorSet:changed",this.onDashboardColorSetChanged,this)},unregisterEvents:function(){this.dashboardApi.off("widget:stopMove",this.onStopMove,this),this.dashboardApi.off("widget:startMove",this.onStartMove,this),this.dashboardApi.off("widget:onDetailErrors",this.addErrorDetailsHandler,this),this.colorsService&&this.colorsService.off("colorSet:changed",this.onDashboardColorSetChanged,this)},registerEventGroup:function(t){if(t=t||n.uniqueId("_addToDefaultGroup_"),this.eventGroups){var e=this.eventGroups.findGroup(this.id);if(!e||e.getPageId()!==this.getContainerPageId())return e=this.eventGroups.getDefaultGroup(this.getContainerPageId(),{payloadData:{undoRedoTransactionId:t}}),this.eventGroups.addToGroup(e.id,[this.id],{payloadData:{undoRedoTransactionId:t}}),!0}return!1},registerWidgetChromeEvents:function(t){t&&(t.on("widget:onResize",this.resize,this),t.on("widget:onShow",this.onShow,this),t.on("widget:onHide",this.onHide,this),t.on("widget:onMaximize",this.onMaximize,this),t.on("widget:onRestore",this.onRestore,this),t.on("widget:onTitleChange",this.onTitleChange,this),t.on("widgetchrome:selected",this.onChromeSelected,this),t.on("widgetchrome:deselected",this.onChromeDeselected,this),t.on("widget:onAuthoringMode",this.onAuthoringMode,this),t.on("widget:onConsumeMode",this.onConsumeMode,this),t.on("widget:onEventGroupMode",this.onEventGroupMode,this),t.on("widget:onEnterContainer",this.onEnterContainer,this),t.on("widget:onExitContainer",this.onExitContainer,this),t.on("layout:fillColorChange",this.onPagefillColorChange,this))},unregisterWidgetChromeEvents:function(t){t&&(t.off("widget:onResize",this.resize,this),t.off("widget:onShow",this.onShow,this),t.off("widget:onHide",this.onHide,this),t.off("widget:onMaximize",this.onMaximize,this),t.off("widget:onRestore",this.onRestore,this),t.off("widget:onTitleChange",this.onTitleChange,this),t.off("widgetchrome:selected",this.onChromeSelected,this),t.off("widgetchrome:deselected",this.onChromeDeselected,this),t.off("widget:onAuthoringMode",this.onAuthoringMode,this),t.off("widget:onConsumeMode",this.onConsumeMode,this),t.off("widget:onEventGroupMode",this.onEventGroupMode,this),t.off("widget:onEnterContainer",this.onEnterContainer,this),t.off("widget:onExitContainer",this.onExitContainer,this),t.off("layout:fillColorChange",this.onPagefillColorChange,this))},_registerModelEvents:function(){this.model.on("change",this._onModelChange,this),this.model.on("change:fillColor",this.applyFillColor,this),this.model.on("change:borderColor",this.applyBorderColor,this),this._modelEventsRegistered=!0},_unregisterModelEvents:function(){this._modelEventsRegistered&&(this.model.off("change",this._onModelChange,this),this.model.off("change:fillColor",this.applyFillColor,this),this.model.off("change:borderColor",this.applyBorderColor,this),this._modelEventsRegistered=!1)},onStartMove:function(){},onStopMove:function(){},onPagefillColorChange:function(){},onDashboardColorSetChanged:function(){this.colorsService.makeSureColorIsValidInModel({model:this.model,propertyName:"fillColor"}),this.colorsService.makeSureColorIsValidInModel({model:this.model,propertyName:"borderColor"})},getDefaultValue:function(t){var e=n.find(this.properties,(function(e){return e.id===t}));if(e)return e.defaultValue},onContainerReady:function(t){var e=t.model,i=t.widgetChromeEventRouter,n=t.isAuthoringMode,o=t.additionalWidgetData,s=void 0===o?{}:o,a=t.layoutAPI;this.model=e,this.widgetChromeEventRouter=i,this.isAuthoringMode=n,this.addPayloadData=s.addPayloadData,this.layoutAPI=a,this.model&&(this._registerModelEvents(),this.addWhiteListAttrs("fillColor","borderColor","animationEntrance","animationExit"),this.addColorProperties(["fillColor","borderColor"]),this.model.localizedProps&&this.model.localizedProps.length&&this.dashboardApi.getFeature("TranslationService").registerView({view:this,model:this.model})),this.registerWidgetChromeEvents(this.widgetChromeEventRouter),this.whenContainerIsReady.resolve()},getLayoutAPI:function(){return this.layoutAPI},onAuthoringMode:function(){this.isAuthoringMode=!0,this.isEventGroupMode=!1},onConsumeMode:function(){this.isAuthoringMode=!1,this.isEventGroupMode=!1},onEventGroupMode:function(){this.isAuthoringMode=!0,this.isEventGroupMode=!0,this._setEventGroupOverlayContent(this.eventGroups.findGroup(this.id))},getEventGroupId:function(){return this.eventRouter?this.eventRouter.channelId:void 0},setEventRouter:function(t,e){!t&&this.eventRouter?(this.unregisterEvents(this.eventRouter),this.onRemoveCurrentEventRouter(e),this.unregistered=!0):(this.unregistered||t.channelId!==this.eventRouter.channelId)&&(this.unregistered||(this.unregisterEvents(this.eventRouter),this.onRemoveCurrentEventRouter(e)),this.eventRouter=t,this.eventRouter&&(this.registerEvents(this.eventRouter),this.onNewEventRouter(e),this.unregistered=!1)),this._setEventGroupOverlayContent()},onRemoveCurrentEventRouter:function(){},onNewEventRouter:function(){},_setEventGroupOverlayContent:function(){var t=this.eventGroups.findGroup(this.id),e=this.getWidgetStyleNode().find(".eventGroupOverlayContent");t&&e&&e.text(t.getGroupIndex())},onEnterContainer:function(){},onExitContainer:function(){},_onModelChange:function(t){t&&"UndoRedoController"===t.sender&&this.refreshPropertiesPane()},destroy:function(){this._unregisterModelEvents(),this._expanded&&this._expanded.remove(),this.unregisterEvents(this.eventRouter),this.unregisterWidgetChromeEvents(this.widgetChromeEventRouter),this.model&&(this.model.localizedProps&&this.model.localizedProps.length&&this.dashboardApi.getFeature("TranslationService").deregisterView(this.model.id),this.model.contentReferences=[]),this._expanded=null,this.eventRouter=null},get:function(t){return this.model?this.model[t]:void 0},set:function(t,e){this.model&&t&&(e=e||{},e=n.defaults(e,{sender:this.id}),this.model.set(t,e))},triggerExternalEvent:function(t,e){this.eventRouter&&this.eventRouter.trigger(t,e)},onTitleChange:function(){},onPropertyUpdate:function(t){var e={};e[t.category]=t.item;var i=null;t.transactionId&&(i={undoRedoTransactionId:t.transactionId,transactionToken:t.transactionToken}),"fillColor"!==t.category&&"borderColor"!==t.category||this.colorsService.prepareForColorModelChange(e,t.category),this.set(e,{silent:!1,payloadData:i})},updateDescription:function(t){this.widgetChromeEventRouter&&this.widgetChromeEventRouter.trigger("widget:updateDescription",{value:t})},updateWidgetArialabel:function(t){this.widgetChromeEventRouter&&this.widgetChromeEventRouter.trigger("widget:updateWidgetArialabel",{value:t})},clearWidgetArialabel:function(){this.widgetChromeEventRouter&&this.widgetChromeEventRouter.trigger("widget:clearWidgetArialabel")},setLayoutProperties:function(t){this.widgetChromeEventRouter&&this.widgetChromeEventRouter.trigger("widget:setLayoutProperties",t)},addIcon:function(t,e){if(this.widgetChromeEventRouter){var i=void 0,n=this._isMaximized&&this._expanded&&this._expanded.containerElement&&this._expanded.containerElement.find(".widgetHeader");n&&n.length&&0===(i=n.find(".widgetIcons")).length&&(i=n),this.widgetChromeEventRouter.trigger("widget:addIcon",{widgetIcon:t,name:e,location:i})}},applyCommonProperties:function(){if(this.model){this.applyFillColor({value:this.model.fillColor}),this.applyBorderColor({value:this.model.borderColor});var t=this.model.showTitle;t||(t=this.getDefaultValue("showTitle")),this.showTitle({value:t})}},showTitle:function(t){if(!t.value){var e=this.$el.parent();e.hasClass("widget")&&e.find(".textArea").addClass("hidden")}},changeTitleType:function(t){if("smart"===t.value){var e=this.model.toJSON();e.name="";var i=this.dashboardApi.getDashboardCoreSvc(".SmartNamingSvc").getWidgetName(e);this.$el.parent().find(".textArea").text(i)}},applyFillColor:function(t){this.applyColor(t,"fill")},applyBorderColor:function(t){this.applyColor(t,"border")},applyColor:function(t,e){this.getWidgetStyleNode().each(function(i,n){var o=new RegExp("\\s*\\b"+e+"-[^\\s]*\\b","g"),s=n.getAttribute("class")||"";s=s.replace(o,""),t.value&&(s+=" "+this.getThemeColorClassName(t.value,e)),n.setAttribute("class",s)}.bind(this))},getWidgetStyleNode:function(){return this.$el.closest(".widget")},getThemeColorClassName:function(t,e){return e+"-"+t},resize:function(){},onShow:function(){},onHide:function(){},reveal:function(){},onChromeSelected:function(){this.chromeSelected=!0,this.triggerExternalEvent("widget:selected",{sender:this.model.id,payloadData:this})},onChromeDeselected:function(){this.chromeSelected=!1,this.triggerExternalEvent("widget:deselected",{sender:this.model.id}),this.triggerExternalEvent("properties:deregister",{sender:this.model.id})},showWarning:function(t,e){this.showError(t,e,"warning")},_updateErrorContainer:function(){},_updateErrorType:function(t,e){return e||"error"},hasError:function(){return this.$el.has(".errorContainer").length>0},hasWarning:function(){return this.$el.has(".warningContainer").length>0},getError:function(){return this.errorMessage},onStateChangeError:function(t){t?this.renderError(t.getMessage(),t.getParams(),t.getType()):this._clearError()},renderError:function(t,e,i){e&&e.errorInfo&&(this._lastErrorInfo=e.errorInfo),i=this._updateErrorType(t,i);var n=this.hasError();if(this.el){var o=this.errorView.renderContainer({id:this.id+"Title",type:i,msg:{str:t,params:e}});if(this._updateErrorContainer(t,o),this.$el.find(".errorContainer").remove(),this.widgetChromeEventRouter&&!n){var s={"min-height":Math.max(u,this.$el.innerHeight()),"min-width":h};this.widgetChromeEventRouter.trigger("widget:showError",s,this)}var a=this.errorView.makeNlsMessage({str:t,params:e});this.errorMessage=a,this.updateWidgetArialabel(a),this.$el.append(o),this.addErrorDetailsHandler(),this.renderComplete&&this.renderComplete()}},showError:function(t,e,n){var o=new i({msg:t,params:e},{type:n});this._stateAPI.setError(o)},addErrorDetailsHandler:function(){!0===window.dashboardErrorDetailsEnabled&&this._lastErrorInfo&&this.$el.has(".errorContainer").length>0&&this.$el.find(".dashboardMessageBox").onClick(this._showErrorDetails.bind(this))},_showErrorDetails:function(){return this._lastErrorInfo?a.load(["ui/dialogs/MessageBox"]).then(function(t){var e=t[0],i={httpResponse:{status:this._lastErrorInfo.status,details:this._lastErrorInfo.responseJSON?this._lastErrorInfo.responseJSON:{}},httpRequest:{querySpec:this._lastErrorInfo.querySpec?this._lastErrorInfo.querySpec:{}},widgetSpec:this.model};new e("selectableInfo","Error details",JSON.stringify(i,null,4)).open()}.bind(this)):Promise.resolve()},clearError:function(){this._stateAPI.clearError()},_clearError:function(){if(this._lastQueryErrorInfo=null,this.errorMessage=null,this.hasError()){if(this.widgetChromeEventRouter){this.widgetChromeEventRouter.trigger("widget:clearError",{})}this.$el.find(".errorContainer").remove()}},clearMoreDataIndicator:function(){this.widgetChromeEventRouter&&this.widgetChromeEventRouter.trigger("widget:clearMoreDataIndicator")},addWhiteListAttrs:function(){var t=Array.prototype.slice.call(arguments,0);this.model&&t.length>0&&(this.model.whitelistAttrs?this.model.whitelistAttrs=n.uniq(this.model.whitelistAttrs.concat(t)):this.model.whitelistAttrs=t)},addColorProperties:function(t){this.model&&(this.model.colorProperties?this.model.colorProperties=this.model.colorProperties.concat(t):this.model.colorProperties=t)},addContentReferences:function(t){this.model&&(this.model.contentReferences=this.model.contentReferences.concat(t))},removeWhiteListAttrs:function(){if(this.model&&this.model.whitelistAttrs){var t=Array.prototype.slice.call(arguments,0);this.model.whitelistAttrs=n.difference(this.model.whitelistAttrs,t)}},getExpandStartingPosition:function(){var t=o(this._expandModeContainerSelector).offset().top,e=this.$el.offset();return e.top-=t,e.width=this.$el.width(),e.height=this.$el.height(),t=o(this._expandModeContainerSelector).offset().left,e.left-=t,e},getExpandViewContent:function(){return o('')},isWidgetMaximized:function(){return!0===this._isMaximized},onMaximize:function(){if(!this._isMaximized&&this.isMaximizeSupported)return this._isMaximized=!0,this.triggerExternalEvent("widget:maximize",{id:this.id}),this._expanded&&this._expanded.remove(),this._restoreToParent=this.$el.parent(),this._expanded=new d({owner:this,content:this.content,data:this.el,containerElement:o(this._expandModeContainerSelector),launchPoint:this.getWidgetStyleNode()[0],dashboardState:this.dashboardApi.getFeature("DashboardState")}),this._expanded.render()},toggleExpanded:function(t){return void 0===t&&(t=!this.expanded),t!==this.expanded?(this.expanded=t,this._getExpandedController().toggle(t)):Promise.resolve()},_getExpandedController:function(){return this._expandedController||(this._expandedController=new c({widget:this})),this._expandedController},whenRenderComplete:function(){return this._stateAPI.setStatus(this._stateAPI.STATUS.RENDERED),Promise.resolve()},onRestore:function(){if(this._isMaximized=!1,this.triggerExternalEvent("widget:restore",{id:this.id}),this._restoreToParent)return this.getVisBounds().then(function(t){this.$el.css({width:t.width,height:t.height}),this._restoreToParent.append(this.$el),this._restoreToParent=null,this.applyCommonProperties(),this.resize()}.bind(this))},getContextToolbarItems:function(){return[]},getContainerPageId:function(){var t=this.dashboardApi.getAppConfig("pageContainerType"),e=l.getPageContent(this.content,t);return e?e.getId():null},resizeToPreferredSize:function(){},setPreferredSize:function(t,e){if(this.usePreferredSize){var i={preferredSize:t,options:e};this.widgetChromeEventRouter&&this.widgetChromeEventRouter.trigger("widget:setPreferredSize",i,this)}},getVisBounds:function(){var t=new e;if(!this.widgetChromeEventRouter||this._isMaximized&&this._expanded)t.resolve({top:0,left:0,width:this.$el.innerWidth(),height:this.$el.innerHeight()});else if(this._isIntentViewMode()){var i=this.$el.parents(".intent-results-preview");t.resolve({top:0,left:0,width:i.innerWidth(),height:i.innerHeight()})}else this.widgetChromeEventRouter.trigger("widget:getSize",{deferred:t},this);return t.promise},_isIntentViewMode:function(){return this.$el.parents(".intent-results-preview").length>0},getType:function(){return this.model.type},_filterActiveAutoBinProperty:function(t){var e=this;return n.filter(t,(function(t){return!["autoBin.toggle","autoBin.count"].includes(t.id)||e.visModelManager.getDefinition().binningConfig&&!0===e.visModelManager.getDefinition().binningConfig.auto}))},onPropertyChange:function(t,e){this.onPropertyUpdate(this.propertiesUtil.buildPropChangePayload(t,e))},refreshPropertiesPane:function(t){this.model&&this.triggerExternalEvent("properties:refreshPane",n.extend({sender:this.model.id},t))},isValidHtmlContent:function(t){return s.isValidHtmlContent(t)},doesVisPropertyMatchExpected:function(t,e){if(this._currVis&&this._currVis.doesVisPropertyMatchExpected)return this._currVis.doesVisPropertyMatchExpected(t,e)},isContextualGridEnabled:function(){return Promise.resolve(!1)},_invokeLifeCycleHandlers:function(t,e){var i=this;return this.dashboardApi.getDashboardSvc(".LifeCycleManager").then((function(i){return i.invokeLifeCycleHandlers(t,e)})).catch((function(t){i.logger.error(t)}))},render:function(){return this._stateAPI.setStatus(this._stateAPI.STATUS.RENDERING),Promise.resolve(this.$el)}});return p})),define("text!dashboard-core/js/lib/@waca/dashboard-common/dist/ui/templates/ListView.template",[],(function(){return'/*\n *+------------------------------------------------------------------------+\n *| Licensed Materials - Property of IBM\n *| IBM Cognos Products: Dashboard\n *| (C) Copyright IBM Corp. 2015, 2021\n *|\n *| US Government Users Restricted Rights - Use, duplication or disclosure\n *| restricted by GSA ADP Schedule Contract with IBM Corp.\n *+------------------------------------------------------------------------+\n */\n{{? it.searchText && !it.listOnly}}\n
\n\t{{? it.newStyle}}\n\t\n\t\n\t
\n\t{{??}}\n\t\n\t\n\t{{?}}\n\t{{? it.sortFlyout && !it.listOnly}}\n\t
\n\t\t
\n\t
\n\t{{?}}\n
\n{{?}}\n
{{#def.listTemplate}}
\n{{? it.multiSelect && !it.listOnly}}\n
\n\t
\n\t\t\n\t\t
\n\t
\n\t\n
\n{{?}}\n'})),define("text!dashboard-core/js/lib/@waca/dashboard-common/dist/ui/templates/ListItems.template",[],(function(){return'{{ function children(it, items, level) { }}\n{{ var padding = level?(level-1)*12 + 10:10; }}\n{{~ items :item}}\n
\n\n{{? it.controlType === "tree"}}\n\n{{?}}\n\t{{#def.itemTemplate}}\n{{? !item.hasChildren && item.canSelect }}\n\n{{?}}\n{{? !item.hasChildren && item.canSingleDelete }}\n
\n\t
\n
\n{{?}}\n
\n{{? it.controlType === \'tree\' }}\n{{? item.children }}\n
\n{{ children( it, item.children, level+1 ); }}\n
{{??}}\n
{{?}}\n{{?}}{{~}}\n{{ } }}\n{{ children( it, it.items, it.level ); }}\n'})),define("dashboard-core/js/lib/@waca/dashboard-common/dist/ui/CenterLoadingSpinner",["react","ca-ui-toolkit","prop-types"],(function(t,e,i){var n=function(i){return t.createElement("div",{className:"loadingBlocker blockerCenterContents"},t.createElement(e.ProgressIndicator,{size:i.size,variant:i.variant}))};return n.propTypes={size:i.string.isRequiried,variant:i.string.isRequiried},n})),define("dashboard-core/js/lib/@waca/dashboard-common/dist/ui/BaseListView",["../lib/@waca/core-client/js/core-client/ui/core/View","text!./templates/ListView.template","text!./templates/ListItems.template","jquery","underscore","doT","../nls/StringResources","../lib/@waca/core-client/js/core-client/errors/BaseError","react-dom","./CenterLoadingSpinner"],(function(t,e,i,n,o,s,a,r,l,c){var d=t.extend({templateString:e,itemTemplate:'
{{? item.label }}{{!item.label}}{{??}}{{!item.name}}{{?}}
',listTemplate:i,itemClass:"listitem",controlClass:"list",treeItemClass:"treeitem",treeControlClass:"tree",listItemClass:"listitem",listControlClass:"list",isTree:!1,init:function(t){!this._baseEvents&&this.events&&(this._baseEvents=this.events),t&&t.isTree&&(this.isTree=!0),this.setIsTree(this.isTree),d.inherited("init",this,arguments),this.dotTemplate=s.template(this.templateString||"",void 0,{listTemplate:this.listTemplate,itemTemplate:this.itemTemplate}),this.dotListTemplate=s.template(this.listTemplate,void 0,{itemTemplate:this.itemTemplate}),this.$el.addClass("baseListView")},_setupEvents:function(){this._baseEvents?this.events=o.clone(this._baseEvents):this.events={},this.events["click "+this.itemClassSelector]="onSelectItem",this.events["keydown "+this.itemClassSelector]="onKeyDown",this.events["focus "+this.itemClassSelector]="onItemFocus",this.events["click .treeitem"]="onToggleItem"},setIsTree:function(t){this.isTree=!!t,this.isTree?(this.itemClass=this.treeItemClass,this.controlClass=this.treeControlClass):(this.itemClass=this.listItemClass,this.controlClass=this.listControlClass),this.itemClassSelector="."+this.itemClass,this.controlClassSelector="."+this.controlClass,this._setupEvents()},rightArrowHandler:function(t){return this.downArrowHandler(t)},leftArrowHandler:function(t){return this.upArrowHandler(t)},downArrowHandler:function(t){var e=this.$(this.itemClassSelector+":visible");return n(e[e.index(t)+1])},upArrowHandler:function(t){var e=this.$(this.itemClassSelector+":visible");return n(e[e.index(t)-1])},onKeyDown:function(t){var e,i,o,s,a=n(this.getTarget(t.target,this.itemClass)),r=null,l=t.keyCode||t.charCode;switch(this.isTree?(e=39,i=37,o=-5,s=-5):(e=-5,i=-5,o=39,s=37),l){case 13:case 32:t.preventDefault(),this.onSelectItem(t);break;case o:t.preventDefault(),r=this.rightArrowHandler(a);break;case 40:t.preventDefault(),r=this.downArrowHandler(a);break;case s:t.preventDefault(),r=this.leftArrowHandler(a);break;case 38:t.preventDefault(),r=this.upArrowHandler(a);break;case 35:t.preventDefault(),r=this.$(this.itemClassSelector+":visible").last();break;case 36:t.preventDefault(),r=this.$(this.itemClassSelector+":visible").first();break;case 107:case e:t.preventDefault(),this.expandItem(a);break;case 109:case i:t.preventDefault(),this.collapseItem(a);break;case 46:t.preventDefault(),this.onDeleteItem(t)}r&&r.length&&this.setFocusOnItem(r)},_getCurrentlyFocusedItems:function(){return this.$(this.itemClassSelector+'[tabindex="0"]')},_triggerFocusEvent:function(t){this.trigger("focus:item",{id:t.attr("data-id")})},onItemFocus:function(t,e){var i=n(this.getTarget(t.target,this.itemClass)),o=this._getCurrentlyFocusedItems(i);(o.length&&o.first()[0])!==i[0]&&(this._changeTabindices(o,i),e||(i[0].focus(),this._triggerFocusEvent(i)))},_changeTabindices:function(t,e){t.attr({"aria-activedescendant":"false",tabindex:-1}),e.attr({"aria-activedescendant":"true",tabindex:0})},onDeleteItem:function(){},onToggleItem:function(t){var e=n(this.getTarget(t.target,this.itemClass));t.preventDefault(),this.toggleItem(e)},setFocusOnItem:function(t,e){this.onItemFocus({target:t[0]},e)},prepareListItem:function(t){return t},prepareTreeItem:function(t){return this.prepareListItem(t)},getListItems:function(){return Promise.resolve([])},getRootItems:function(){return this.getListItems()},getChildItems:function(){return Promise.resolve([])},_getRequestFunction:function(){return this.isTree?this.getRootItems.bind(this):this.getListItems.bind(this)},_getPrepareFunction:function(){return this.isTree?this.prepareTreeItem:this.prepareListItem},render:function(){var t=this;this.elementClass&&this.$el.addClass(this.elementClass);var e=document.createElement("div");return this.$el.append(e),l.render(c({variant:"circle",size:"normal"}),e),Promise.resolve().then((function(){return t._getRequestFunction()()})).then((function(i){if(l.unmountComponentAtNode(e),n(e).remove(),!t.dotTemplate)throw new r("the list has been removed");var s=t._getPrepareFunction(),c=o.extend({controlType:t.controlClass,level:1,items:i.map(s.bind(t)),lbl_add:a.get("sidebarAdd"),lbl_clear:a.get("clearTextFilterValue"),lbl_missingDataSetData:a.get("missingDataSetData")},t.getCustomRenderProperties()),d=t.dotTemplate(c);t.$el.empty().append(d),t.setElement(t.$el),t.canMultiSelect&&t._updateMultiSelectUI(),t._setInitialFocus(),t.renderComplete()}))},getCustomRenderProperties:function(){return{}},renderComplete:function(){},renderChildren:function(t,e){var i=this._getPrepareFunction(),n=e.attr("aria-level");n=n?Number(n)+1:1;var o=this.dotListTemplate({controlType:this.controlClass,items:t.map(i.bind(this)),listOnly:!0,level:n});e.next().empty().attr("data-loaded","true").append(o)},renderTree:function(t){this.renderList(t)},renderList:function(t){var e=this._getListItemsHtml(t);this.$(this.controlClassSelector).empty(),this.$(this.controlClassSelector).append(e)},_setInitialFocus:function(){var t=this.$(this.itemClassSelector).first();t.length&&this.setFocusOnItem(t)},_getListItemsHtml:function(t){var e=this._getPrepareFunction(),i=o.extend({controlType:this.controlClass,items:t.map(e.bind(this)),listOnly:!0,level:1},this.getCustomRenderProperties());return this.dotListTemplate(i)},expandItem:function(t){var e=this;if(t.attr("aria-expanded")){var i=t.next();if("true"!==i.attr("data-loaded"))return Promise.resolve(this.getChildItems(t.attr("data-id"),t)).then((function(n){n&&0!==n.length?(e.renderChildren(n,t),t.attr("aria-expanded","true"),t.children().first().removeClass("wfg_twisty-closed").addClass("wfg_twisty-open"),i.show()):(t.removeAttr("aria-expanded"),t.children().first().removeClass("wfg_twisty-open wfg_twisty-closed"),i.attr("data-loaded","true"))}));t.attr("aria-expanded","true"),t.children().first().removeClass("wfg_twisty-closed").addClass("wfg_twisty-open"),i.show()}return Promise.resolve()},collapseItem:function(t){t.attr("aria-expanded")&&(t.attr("aria-expanded","false").next().hide(),t.children().first().removeClass("wfg_twisty-open").addClass("wfg_twisty-closed"))},toggleItem:function(t){var e=t.attr("aria-expanded");"true"===e?this.collapseItem(t):"false"===e&&this.expandItem(t)},setItemSelected:function(t){t.attr("aria-selected",!0)},showError:function(t,e){var i='
'+a.get(t);e&&(i+="
"+e+""),this.$el.empty().append(i+"
")},remove:function(){return this.$(this.itemClassSelector).remove(),this.dotTemplate=null,d.inherited("remove",this,arguments),this}});return d})),define("dashboard-core/js/lib/@waca/dashboard-common/dist/ui/SearchableListView",["./BaseListView","../lib/@waca/core-client/js/core-client/utils/BidiUtil","jquery","underscore"],(function(t,e,i,n){var o=t.extend({_setupEvents:function(){o.inherited("_setupEvents",this,arguments),this.events["click .treeSearchIcon"]="onSearchIconClick",this.events["input .treeSearchInput"]="onSearchTextInput",this.events["input input"]="searchTypeDelay"},_setInitialFocus:function(){var t=this.$(".treeSearchInput");e.initElementForBidi(t[0]),t.focus()},onSearchIconClick:function(t){var e=i(t.target).hasClass("wfg_close"),n=this.$el.find(".treeSearchInput");n.focus(),e&&(n.val(""),n.trigger("input")),this._toggleCanClearSearch()},onSearchTextInput:function(){this._toggleCanClearSearch()},_toggleCanClearSearch:function(){var t=this._getSearchInputText().length>0;this.$el.find(".treeSearchIcon").toggleClass("wfg_close",t)},searchTypeDelay:function(t,e){this.iTypeDelayTimer&&window.clearTimeout(this.iTypeDelayTimer),this.iTypeDelayTimer=window.setTimeout(this.searchData.bind(this,e||this._getSearchInputText()),250)},searchData:function(t){var e=null;if(t){this._isSearching=!0;var i=function(e){return-1!==this._getSearchableFieldValue(e).toLowerCase().indexOf(t.toLowerCase())}.bind(this);this.isTree?(e=[],n.each(this._getSearchableItems(),(function(t){var o=[],s=n.clone(t);t.children&&(o=n.filter(t.children,i)),o.length?(s.children=o,s.expanded=!0,e.push(s)):i(s)&&(s.expanded=!1,e.push(s))}))):e=n.filter(this._getSearchableItems(),i),this._renderResultListItems(e)}else this._isSearching&&(this._isSearching=!1,e=this._getSearchableItems(),this._renderResultListItems(e))},_renderResultListItems:function(t){this._sortListItems(t),this.renderList(t),this.renderComplete()},_getSearchInputText:function(){return this.$el.find(".treeSearchInput").val()},_getSearchableItems:function(){return[]},_getSearchableFieldValue:function(){return""},_sortListItems:function(t){return t}});return o})),define("text!dashboard-core/js/lib/@waca/dashboard-common/dist/ui/toolbar_components/templates/Menu.html",[],(function(){return'\n
\n\t
\n
\n\n'})),define("dashboard-core/js/lib/@waca/dashboard-common/dist/ui/toolbar_components/Menu",["../../lib/@waca/core-client/js/core-client/ui/core/View","jquery","underscore","../../lib/@waca/core-client/js/core-client/utils/BidiUtil","text!./templates/Menu.html"],(function(t,e,i,n,o){var s=t.extend({templateString:o,events:{keydown:"_handleKeyboard","click .dropdown-menuitem":"_handleClick"},itemActions:null,itemSpecMap:null,baseClass:"toolbar",hcLabel:null,showTitle:!0,init:function(t){var e=this;i.defaults(t,{hcLabel:!0}),i.extend(this,t),this.itemActions={},this.itemSpecMap={},i.each(this.items,(function(t){e.itemSpecMap[t.name]=t})),s.inherited("init",this,arguments)},_handleClick:function(t){t.preventDefault(),this._performAction(t.currentTarget.id)},_performAction:function(t){var e=this.itemActions[t];e&&setTimeout(e,10)},removeItem:function(t){var e=this.viewId+"_"+t;this.$menu.children("#"+e).remove(),delete this.itemSpecMap[t],delete this.itemActions[e]},addDivider:function(){var t=e('
  • '),n=null;return n=t.checked?e(''+t.label+""):e(''+t.label+""),i.append(n),i.addClass("dropdown-menuitem"),i.addClass(t.name),this.$menu.append(i),this._buildMenuItem(t),i},showItem:function(t){this.$menu.find("."+t).removeClass("hidden")},hideItem:function(t){this.$menu.find("."+t).addClass("hidden")},_handleKeyboard:function(t){var n=t.which||t.keyCode||t.charCode,o=e(t.target);switch(n){case 9:t.shiftKey?o.hasClass("firstMenuItem")&&(o.closest("ul").find("a.lastMenuItem").focus(),t.preventDefault()):o.hasClass("lastMenuItem")&&(o.closest("ul").find("a.firstMenuItem").focus(),t.preventDefault());break;case 13:case 32:if(t.preventDefault(),this.$toggle.dropdown("toggle"),e(t.target).hasClass("dropdown-toggle")){this.$el.find(".dropdown-menu a").first().focus()}else{var s=this.getTarget(t.target,"dropdown-menuitem");this._performAction(s.id)}break;case 37:case 39:if(e(t.target.parentNode).hasClass("dropdown-menuitem")){var a=i.clone(t);a.keyCode=n+1,e(t.target).trigger(a)}}},_templateParams:function(){return{id:this.viewId,items:this.items,label:this.label,icon:this.icon,hcLabel:this.hcLabel,baseClass:this.baseClass,labelOnly:this.labelOnly,showTitle:this.showTitle}},render:function(){var t=this.dotTemplate(this._templateParams());return this.$el.append(t),this.$el.addClass(this.baseClass+"ItemWrapper"),this.$el.addClass("dropdown"),this.$toggle=this.$el.children(".dropdown-toggle"),this.$toggle.addClass(this.baseClass+"Icon"),this.$iconImage=e(''),this.icon&&this.$toggle.prepend(this.$iconImage),this.$toggle.attr("title",this.label),this.$toggle.addClass(this.baseClass+"Item"),this.$menu=this.$el.children(".dropdown-menu"),this.trailing&&this.$menu.addClass("dropdown-menu-right"),this.$menuLabel=this.$el.find(".menu-label"),this._buildDropDown()},_buildDropDown:function(){var t=this;return new Promise((function(e,i){try{require(["bsdropdown"],(function(){t.$toggle.dropdown(),t.action&&t.$el.on("show.bs.dropdown",t.action.bind(t)),t._buildMenuItems(),e(t.$el)}),i)}catch(t){i(t)}}))},_buildMenuItems:function(){var t=this;i.each(this.items,(function(e){t._buildMenuItem(e)}))},_getItemId:function(t){return this.viewId+"_"+t},_buildMenuItem:function(t){var i=this._getItemId(t.name);this.itemActions[i]=t.action;var o=e("#"+i).get(0);o&&n.initElementForBidi(o)}});return s})),define("dashboard-core/js/lib/@waca/dashboard-common/dist/ui/toolbar_components/MenuWithTick",["./Menu","underscore","text!./templates/Menu.html"],(function(t,e,i){var n=t.extend({templateString:i,init:function(t){e.extend(this,t),n.inherited("init",this,arguments)},_templateParams:function(){var t=n.inherited("_templateParams",this,arguments);return t.showTick=!0,t},updateMenuItemTick:function(t,e){if(t){var i=t.find("a");e?i.addClass("menuitem-toggled"):i.removeClass("menuitem-toggled"),t.find("a")[0].setAttribute("aria-checked",e?"true":"false")}}});return n})),define("dashboard-core/js/lib/@waca/dashboard-common/dist/ui/toolbar_components/ToggleMenuBar",["./MenuWithTick","underscore"],(function(t,e){var i=t.extend({itemMap:{},sCheckedItemName:null,updateLabel:!1,init:function(t){e.extend(this,t),i.inherited("init",this,arguments)},toggleHandler:function(t){this.updateSelectedItem(t)},updateSelectedItem:function(t){var e=this.itemMap[t];e&&e.children&&(this.sCheckedItemName&&this.updateMenuItemTick(this.itemMap[this.sCheckedItemName],!1),this.sCheckedItemName=t,this.updateMenuItemTick(this.itemMap[this.sCheckedItemName],!0),this.updateLabel&&this.$menuLabel.length>0&&e.children&&this.$menuLabel.text(e.children("a").attr("aria-label")))},render:function(){var t=this,n=i.inherited("render",this,arguments);return this.updateLabel&&(e.each(this.items,(function(e){e.checked&&t.updateSelectedItem(e.name)})),this.sCheckedItemName||this.updateSelectedItem(this.items[0].name)),n},_performAction:function(t){this.updateSelectedItem(this._getItemNameFromID(t)),i.inherited("_performAction",this,arguments)},_getItemNameFromID:function(t){var e=this.viewId+"_";return t.substr(e.length)},_buildDropDown:function(){var t=this,n=i.inherited("_buildDropDown",this,arguments);return e.each(this.items,(function(e){var i=t._getItemId(e.name);t.itemMap[e.name]=t.$menu.find("#"+i),e.checked&&(t.sCheckedItemName=e.name)})),this.updateMenuItemTick(this.itemMap[this.sCheckedItemName],!0),n},remove:function(){e.each(this.itemMap,(function(t){t.remove&&t.remove()})),i.inherited("remove",this,arguments)}});return i})),define("dashboard-core/js/lib/@waca/dashboard-common/dist/ui/toolbar_components/CollapsibleItem",["../../lib/@waca/core-client/js/core-client/ui/core/Class","jquery","underscore"],(function(t,e,i){var n=t.extend({collapsedItemMap:{},_rootMenu:null,_bCollapsedRenderDone:!1,init:function(t,e){i.extend(this,t),n.inherited("init",this,arguments),this._rootMenu=e,this._bCollapsedRenderDone=!1},renderCollapsed:function(){var t=this;if(!this._bCollapsedRenderDone){var n=e('
  • ');this._rootMenu.$menu.children().last().hasClass("divider")||this._rootMenu.$menu.append(n);var o=e('");this._rootMenu.$menu.append(o);var s=null;if(this.items&&(i.each(this.items,(function(e){e.checked&&!s?s=e.name:e.checked=!1;var n=i.clone(e);n._action=n.action,n.action=function(){t.updateSelectedItemInHamburgerMenu(n.name)};var o=t._rootMenu.addItem(n);o.addClass("visible-xs"),t.collapsedItemMap[n.name]=o})),!s)){var a=this.items[0];this.updateSelectedItemInHamburgerMenu(a.name)}this._rootMenu.$menu.append(n),this._bCollapsedRenderDone=!0}},updateMenuItemTick:function(t,e){if(t){var i=t.find("a");i.toggleClass("menuitem-toggled",e),i[0].setAttribute("aria-checked",e?"true":"false")}},updateSelectedItemInHamburgerMenu:function(t){return t},remove:function(){i.each(this.collapsedItemMap,(function(t){t.remove&&t.remove()}))}});return n})),define("dashboard-core/js/lib/@waca/dashboard-common/dist/ui/toolbar_components/ToggleButtonBar",["require","../Toolbar","jquery","underscore"],(function(t,e,i,n){var o=e.extend({baseClass:"appbar",sCheckedItemName:null,requireFn:t,init:function(t){n.extend(this,t),o.inherited("init",this,arguments)},_renderItem:function(t,e){var i=this;return t.type="ToggleButton",t.containerCallbacks={click:function(){this.toggleHandler(t.name)}.bind(this)},this._loadModule("./"+t.type).then((function(n){t.el=e;var o=new n(t,i.rootMenu);o.render(),i.itemMap[t.name]=o}))},_loadModule:function(t){var e=this;return new Promise((function(i,n){try{e.requireFn([t],i,n)}catch(t){n(t)}}))},toggleHandler:function(t){this.sCheckedItemName&&this.itemMap[this.sCheckedItemName].unselect();this.sCheckedItemName=t},updateSelectedItem:function(t){this.toggleHandler(t);var e=this.itemMap[this.sCheckedItemName];e&&e.updateUI(!0)},render:function(){var t=this,e=void 0;if(this.$el.empty(),this.$el.addClass(this.baseClass+"ItemWrapper"),this.items){var i=n.map(this.items,(function(e){return e.checked&&(t.sCheckedItemName?e.checked=!1:t.sCheckedItemName=e.name),t.addItem(e)}));if(e=Promise.all(i),!this.sCheckedItemName){var o=this.items[0];this.toggleHandler(o.name)}}return e||Promise.resolve()}});return o})),define("dashboard-core/js/lib/@waca/dashboard-common/dist/ui/toolbar_components/CollapsibleToggleButtonBar",["./CollapsibleItem","./ToggleButtonBar","underscore"],(function(t,e,i){var n=null;return n=e.extend([t],{init:function(t,e){i.extend(this,t),n.inherited("init",this,arguments),this.rootMenu=e},toggleHandler:function(t){if(this.sCheckedItemName){var e=this.itemMap[this.sCheckedItemName];e&&e.unselect(),this.updateMenuItemTick(this.collapsedItemMap[this.sCheckedItemName],!1)}this.sCheckedItemName=t,this.updateMenuItemTick(this.collapsedItemMap[this.sCheckedItemName],!0)},updateSelectedItemInHamburgerMenu:function(t){this.toggleHandler(t),this.itemMap[this.sCheckedItemName].select()},render:function(){return this.$el.addClass("hidden-xs"),n.inherited("render",this,arguments),this.renderCollapsed(),this},remove:function(){i.each(this.collapsedItemMap,(function(t){t.remove&&t.remove()})),n.inherited("remove",this,arguments)}})})),define("dashboard-core/js/lib/@waca/dashboard-common/dist/ui/toolbar_components/Separator",["../../lib/@waca/core-client/js/core-client/ui/core/View","underscore"],(function(t,e){var i=null;return i=t.extend({events:{click:"action"},baseClass:"toolbar",init:function(t){e.extend(this,t),i.inherited("init",this,arguments)},render:function(){return this.$el.empty(),this.$el.addClass(this.baseClass+"SeparatorItem"),this.$el.attr("role","presentation"),this}})})),define("dashboard-core/js/lib/@waca/dashboard-common/dist/ui/toolbar_components/SearchBar",["../../lib/@waca/core-client/js/core-client/ui/core/View","../../nls/StringResources","jquery","underscore","../../lib/@waca/core-client/js/core-client/utils/EventHelper"],(function(t,e,i,n){var o=null;return o=t.extend({events:{click:"action"},baseClass:"toolbar",init:function(t){n.extend(this,t),o.inherited("init",this,arguments),this.$input=i('');var s=this;this.$input.on("search",(function(){s.execSearch()})),this.$input.on("click",(function(){this.setSelectionRange(0,9999)})),this.$input.keyup((function(t){13===t.which?(s.execSearch(),s.$input.blur(),t.preventDefault()):s.showHideClearSearchButton()})),this.$searchButton=i(''),this.$searchButton.click((function(){s.execSearch()})),this.$clearSearchButton=i(''),this.$clearSearchButton.click((function(){s.$input.val(""),s.execSearch(),s.showHideClearSearchButton()})),this.$clearSearchButton.css("visibility","hidden"),this.$input.on("change",this.showHideClearSearchButton.bind(this))},render:function(){this.$el.empty();var t=i('