")),series.forEach((function(serie){node.append($(" | ").text(serie.getLabel()).attr("scope","col"))})),tbl.append(node);for(var rowId=0;rowId"),labels.length>0&&node.append($(" | ").text(labels[rowId]).attr("scope","row"));for(var serieId=0;serieId").text(value));tbl.append(node)}return tbl},Output.prototype.update=function(){this._build()},Output}));
define("core/toast",["exports","core/templates","core/notification","core/pending"],(function(_exports,_templates,_notification,_pending){function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}
/**
* A system for displaying small snackbar notifications to users which disappear shortly after they are shown.
*
* @module core/toast
* @copyright 2019 Andrew Nicols
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/Object.defineProperty(_exports,"__esModule",{value:!0}),_exports.removeToastRegion=_exports.addToastRegion=_exports.add=void 0,_templates=_interopRequireDefault(_templates),_notification=_interopRequireDefault(_notification),_pending=_interopRequireDefault(_pending);const addToastRegion=async parent=>{const pendingPromise=new _pending.default("addToastRegion");try{const{html:html,js:js}=await _templates.default.renderForPromise("core/local/toast/wrapper",{});_templates.default.prependNodeContents(parent,html,js)}catch(e){_notification.default.exception(e)}pendingPromise.resolve()};_exports.addToastRegion=addToastRegion;_exports.add=async(message,configuration)=>{const pendingPromise=new _pending.default("addToastRegion");configuration={type:"info",closeButton:!1,autohide:!0,delay:4e3,...configuration};try{const{html:html,js:js}=await _templates.default.renderForPromise("core/local/toast/message",{message:await message,...configuration}),targetNode=await getTargetNode();_templates.default.prependNodeContents(targetNode,html,js)}catch(e){_notification.default.exception(e)}pendingPromise.resolve()};const getTargetNode=async()=>{const regions=document.querySelectorAll(".toast-wrapper");return regions.length?regions[regions.length-1]:(await addToastRegion(document.body),getTargetNode())};_exports.removeToastRegion=async function(parent){let newParent=arguments.length>1&&void 0!==arguments[1]?arguments[1]:document;const pendingPromise=new _pending.default("core/toast:removeToastRegion"),getRegionFromParent=thisParent=>thisParent.querySelector(".toast-wrapper"),regionToRemove=getRegionFromParent(parent);if(regionToRemove){const targetRegion=getRegionFromParent(newParent);regionToRemove.children.forEach((node=>{targetRegion.insertBefore(node,targetRegion.firstChild)})),regionToRemove.remove()}pendingPromise.resolve()}}));
/**
* Contain the logic for the loading icon.
*
* @module core/loadingicon
* @copyright 2019 Andrew Nicols
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
define("core/loadingicon",["jquery","core/templates"],(function($,Templates){var TEMPLATES_LOADING="core/loading",getIcon=function(){return Templates.render(TEMPLATES_LOADING,{})},addIconToContainerRemoveOnCompletion=function(container,loadingIconPromise){return getIcon().then((function(html){var loadingIcon=$(html).hide();return $(container).append(loadingIcon),loadingIcon.fadeIn(150),$.when(loadingIcon.promise(),loadingIconPromise)})).then((function(loadingIcon){return loadingIcon.fadeOut(100).promise()})).then((function(loadingIcon){loadingIcon.remove()}))};return{getIcon:getIcon,addIconToContainer:function(container){return getIcon().then((function(html){var loadingIcon=$(html).hide();return $(container).append(loadingIcon),loadingIcon.fadeIn(150),loadingIcon}))},addIconToContainerWithPromise:function(container){var loadingIconPromise=$.Deferred();return addIconToContainerRemoveOnCompletion(container,loadingIconPromise),loadingIconPromise},addIconToContainerRemoveOnCompletion:addIconToContainerRemoveOnCompletion}}));
/**
* Chart pie.
*
* @copyright 2016 Frédéric Massart - FMCorz.net
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @module core/chart_pie
*/
define("core/chart_pie",["core/chart_base"],(function(Base){function Pie(){Base.prototype.constructor.apply(this,arguments)}return Pie.prototype=Object.create(Base.prototype),Pie.prototype.TYPE="pie",Pie.prototype._doughnut=null,Pie.prototype.create=function(Klass,data){var chart=Base.prototype.create.apply(this,arguments);return chart.setDoughnut(data.doughnut),chart},Pie.prototype.addSeries=function(series){if(null===series.getColor()){for(var colors=[],configColorSet=this.getConfigColorSet()||Base.prototype.COLORSET,i=0;i=1)throw new Error("Pie charts only support one serie.");return Base.prototype._validateSeries.apply(this,arguments)},Pie}));
/**
* Chart series.
*
* @copyright 2016 Frédéric Massart - FMCorz.net
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @module core/chart_series
*/
define("core/chart_series",[],(function(){function Series(label,values){if("string"!=typeof label)throw new Error("Invalid label for series.");if("object"!=typeof values)throw new Error("Values for a series must be an array.");if(values.length<1)throw new Error("Invalid values received for series.");this._colors=[],this._label=label,this._values=values}return Series.prototype.TYPE_DEFAULT=null,Series.prototype.TYPE_LINE="line",Series.prototype._colors=null,Series.prototype._fill=!1,Series.prototype._label=null,Series.prototype._labels=null,Series.prototype._smooth=!1,Series.prototype._type=Series.prototype.TYPE_DEFAULT,Series.prototype._values=null,Series.prototype._xaxis=null,Series.prototype._yaxis=null,Series.prototype.create=function(obj){var s=new Series(obj.label,obj.values);return s.setType(obj.type),s.setXAxis(obj.axes.x),s.setYAxis(obj.axes.y),s.setLabels(obj.labels),obj.colors&&obj.colors.length>1?s.setColors(obj.colors):s.setColor(obj.colors[0]),s.setFill(obj.fill),s.setSmooth(obj.smooth),s},Series.prototype.getColor=function(){return this._colors[0]||null},Series.prototype.getColors=function(){return this._colors},Series.prototype.getCount=function(){return this._values.length},Series.prototype.getFill=function(){return this._fill},Series.prototype.getLabel=function(){return this._label},Series.prototype.getLabels=function(){return this._labels},Series.prototype.getSmooth=function(){return this._smooth},Series.prototype.getType=function(){return this._type},Series.prototype.getValues=function(){return this._values},Series.prototype.getXAxis=function(){return this._xaxis},Series.prototype.getYAxis=function(){return this._yaxis},Series.prototype.hasColoredValues=function(){return this._colors.length==this.getCount()},Series.prototype.setColor=function(color){this._colors=[color]},Series.prototype.setColors=function(colors){if(colors&&colors.length!=this.getCount())throw new Error("When setting multiple colors there must be one per value.");this._colors=colors||[]},Series.prototype.setFill=function(fill){this._fill=void 0===fill?null:fill},Series.prototype.setLabels=function(labels){this._validateLabels(labels),labels=void 0===labels?null:labels,this._labels=labels},Series.prototype.setSmooth=function(smooth){smooth=void 0===smooth?null:smooth,this._smooth=smooth},Series.prototype.setType=function(type){if(type!=this.TYPE_DEFAULT&&type!=this.TYPE_LINE)throw new Error("Invalid serie type.");this._type=type||null},Series.prototype.setXAxis=function(index){this._xaxis=index||null},Series.prototype.setYAxis=function(index){this._yaxis=index||null},Series.prototype._validateLabels=function(labels){if(labels&&labels.length>0&&labels.length!=this.getCount())throw new Error("Series labels must match series values.")},Series}));
/**
* Simple API for set/get to localstorage, with cacherev expiration.
*
* @module core/localstorage
* @class localstorage
* @copyright 2015 Damyon Wiese
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @since 2.9
*/
define("core/localstorage",["core/config","core/storagewrapper"],(function(config,StorageWrapper){var storage=new StorageWrapper(window.localStorage);return{get:function(key){return storage.get(key)},set:function(key,value){return storage.set(key,value)},clean:function(){return storage.clean()}}}));
define("core/event_dispatcher",["exports"],(function(_exports){Object.defineProperty(_exports,"__esModule",{value:!0}),_exports.dispatchEvent=void 0;_exports.dispatchEvent=function(eventName){let detail=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},container=arguments.length>2&&void 0!==arguments[2]?arguments[2]:document,{bubbles:bubbles=!0,cancelable:cancelable=!1,composed:composed=!1}=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const customEvent=new CustomEvent(eventName,{bubbles:bubbles,cancelable:cancelable,composed:composed,detail:detail});return container.dispatchEvent(customEvent),customEvent}}));
/**
* Chart.js loader.
*
* @copyright 2016 Frédéric Massart - FMCorz.net
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
define("core/chartjs",["core/chartjs-lazy"],(function(ChartJS){return ChartJS}));
/**
* This is an empty module, that is required before all other modules.
* Because every module is returned from a request for any other module, this
* forces the loading of all modules with a single request.
*
* @module core/log
* @copyright 2015 Andrew Nicols
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
define("core/log",["core/loglevel"],(function(log){var originalFactory=log.methodFactory;return log.methodFactory=function(methodName,logLevel){var rawMethod=originalFactory(methodName,logLevel);return function(message,source){rawMethod(source?source+": "+message:message)}},log.setConfig=function(config){void 0!==config.level&&log.setLevel(config.level)},log}));
/**
* A module to help with toggle select/deselect all.
*
* @module core/checkbox-toggleall
* @copyright 2019 Andrew Nicols
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
define("core/checkbox-toggleall",["jquery","core/pubsub"],(function($,PubSub){var registered=!1,events={checkboxToggled:"core/checkbox-toggleall:checkboxToggled"},getToggleGroupElements=function(root,toggleGroup,exactMatch){return exactMatch?root.find('[data-action="toggle"][data-togglegroup="'+toggleGroup+'"]'):root.find('[data-action="toggle"][data-togglegroup^="'+toggleGroup+'"]')},getAllSlaveCheckboxes=function(root,toggleGroup){return getToggleGroupElements(root,toggleGroup,!1).filter('[data-toggle="slave"]')},getControlCheckboxes=function(root,toggleGroup,exactMatch){return getToggleGroupElements(root,toggleGroup,exactMatch).filter('[data-toggle="master"]')},toggleSlavesFromMasters=function(e){var targetState,root=e.data.root,target=$(e.target),toggleGroupName=target.data("togglegroup");targetState=target.is(":checkbox")?target.is(":checked"):1===target.data("checkall"),toggleSlavesToState(root,toggleGroupName,targetState)},toggleMastersAndActionElements=function(root,toggleGroupName){var toggleGroupSlaves=getAllSlaveCheckboxes(root,toggleGroupName);if(toggleGroupSlaves.length>0){var toggleGroupCheckedSlaves=toggleGroupSlaves.filter(":checked"),targetState=toggleGroupSlaves.length===toggleGroupCheckedSlaves.length;setMasterStates(root,toggleGroupName,targetState,!0),setActionElementStates(root,toggleGroupName,!toggleGroupCheckedSlaves.length)}},getToggleGroupLevels=function(toggleGroupName){var toggleGroups=toggleGroupName.split(" "),toggleGroupLevels=[],toggleGroupLevel="";return toggleGroups.forEach((function(toggleGroupName){toggleGroupLevel+=" "+toggleGroupName,toggleGroupLevels.push(toggleGroupLevel.trim())})),toggleGroupLevels},toggleSlavesToState=function(root,toggleGroupName,targetState){var slaves=getAllSlaveCheckboxes(root,toggleGroupName);slaves.prop("checked",targetState).trigger("change");var checkedSlaves=slaves.filter(":checked");setMasterStates(root,toggleGroupName,targetState,!1),setActionElementStates(root,toggleGroupName,!checkedSlaves.length),getToggleGroupLevels(toggleGroupName).filter((toggleGroupLevel=>toggleGroupLevel!==toggleGroupName)).forEach((function(toggleGroupLevel){toggleMastersAndActionElements(root,toggleGroupLevel)})),PubSub.publish(events.checkboxToggled,{root:root,toggleGroupName:toggleGroupName,slaves:slaves,checkedSlaves:checkedSlaves,anyChecked:targetState})},toggleMastersFromSlaves=function(e){var root=e.data.root,toggleGroupName=$(e.target).data("togglegroup"),slaves=getAllSlaveCheckboxes(root,toggleGroupName),checkedSlaves=slaves.filter(":checked");getToggleGroupLevels(toggleGroupName).forEach((function(toggleGroupLevel){toggleMastersAndActionElements(root,toggleGroupLevel)})),PubSub.publish(events.checkboxToggled,{root:root,toggleGroupName:toggleGroupName,slaves:slaves,checkedSlaves:checkedSlaves,anyChecked:!!checkedSlaves.length})},setActionElementStates=function(root,toggleGroupName,disableActionElements){(function(root,toggleGroup){return getToggleGroupElements(root,toggleGroup,!0).filter('[data-toggle="action"]')})(root,toggleGroupName).prop("disabled",disableActionElements)},setMasterStates=function(root,toggleGroupName,targetState,exactMatch){var masters=getControlCheckboxes(root,toggleGroupName,exactMatch);masters.prop("checked",targetState),masters.each((function(i,masterElement){var targetString;if(masterElement=$(masterElement),targetString=targetState?masterElement.data("toggle-deselectall"):masterElement.data("toggle-selectall"),masterElement.is(":checkbox")){var masterLabel=root.find('[for="'+masterElement.attr("id")+'"]');masterLabel.length&&masterLabel.html()!==targetString&&masterLabel.html(targetString)}else masterElement.text(targetString),masterElement.data("checkall",targetState?0:1)}))};return{init:function(){!function(){if(!registered){registered=!0;var root=$(document.body);root.on("click",'[data-action="toggle"][data-toggle="master"]',{root:root},toggleSlavesFromMasters),root.on("click",'[data-action="toggle"][data-toggle="slave"]',{root:root},toggleMastersFromSlaves)}}()},events:events,setGroupState:function(root,toggleGroupName,targetState){root=$(root),setMasterStates(root,toggleGroupName,targetState,!0),toggleSlavesToState(root,toggleGroupName,targetState)},updateSlavesFromMasterState:function(root,toggleGroupName){root=$(root);var targetState,target=getControlCheckboxes(root,toggleGroupName,!1);targetState=target.is(":checkbox")?target.is(":checked"):1===target.data("checkall"),toggleSlavesToState(root,toggleGroupName,targetState)}}}));
define("core/copy_to_clipboard",["core/str","core/toast","core/prefetch"],(function(_str,_toast,_prefetch){
/**
* A JavaScript module that enhances a button and text container to support copy-to-clipboard functionality.
*
* This module needs to be loaded by pages/templates/modules that require this functionality.
*
* To enable copy-to-clipboard functionality, we need a trigger element (usually a button) and a copy target element
* (e.g. a div, span, text input, or text area).
*
* In the trigger element, we need to declare the data-action="copytoclipboard" attribute and set the
* data-clipboard-target attribute which is the CSS selector that points to the target element that contains the text
* to be copied.
*
* When the text is successfully copied to the clipboard, a toast message that indicates that the copy operation was a success
* will be shown. This success message can be customised by setting the data-clipboard-success-message attribute in the
* trigger element.
*
* @module core/copy_to_clipboard
* @copyright 2021 Jun Pataleta
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*
* @example |
---|