FitTrackee/fittrackee/dist/static/js/main~workouts.aa540c70.js

2 lines
56 KiB
JavaScript
Raw Normal View History

2021-11-06 21:27:23 +01:00
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["main~workouts"],{"00fd":function(t,e,n){var r=n("9e69"),o=Object.prototype,a=o.hasOwnProperty,c=o.toString,u=r?r.toStringTag:void 0;function i(t){var e=a.call(t,u),n=t[u];try{t[u]=void 0;var r=!0}catch(i){}var o=c.call(t);return r&&(e?t[u]=n:delete t[u]),o}t.exports=i},"03dd":function(t,e,n){var r=n("eac5"),o=n("57a5"),a=Object.prototype,c=a.hasOwnProperty;function u(t){if(!r(t))return o(t);var e=[];for(var n in Object(t))c.call(t,n)&&"constructor"!=n&&e.push(n);return e}t.exports=u},"0644":function(t,e,n){var r=n("3818"),o=1,a=4;function c(t){return r(t,o|a)}t.exports=c},"07c7":function(t,e){function n(){return!1}t.exports=n},"0801":function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.defineChartComponent=void 0;const o=n("9b4a"),a=n("72dd"),c=r(n("e740")),u=r(n("bba4")),i=r(n("0644")),f=r(n("63ea"));(0,a.install)();const s=n("e1bd"),d=t=>(0,c.default)((0,u.default)(t)).replace(/ /g,""),l=(t,e)=>{const n={options:{type:Object,required:!1},chartId:{default:t,type:String},width:{default:400,type:Number},height:{default:400,type:Number},cssClasses:{type:String,default:""},styles:{type:Object},plugins:{type:Array,default:()=>[]},chartData:{type:Object,required:!0},onLabelsUpdate:{type:Function},onChartUpdate:{type:Function},onChartDestroy:{type:Function},onChartRender:{type:Function}},r=d(t);return(0,a.defineComponent)({name:r,props:n,emits:{"labels:update":()=>!0,"chart:update":t=>!0,"chart:destroy":t=>!0,"chart:render":()=>!0},setup(n,{emit:c}){const u=(0,a.ref)(),d=`${t}-${(0,s.nanoid)(6)}`;let l=(0,a.shallowRef)(null);function p(t,e){if(e){let n=l.value,r=t.datasets.map(t=>t.label),o=e.datasets.map(t=>t.label);const a=JSON.stringify(o),c=JSON.stringify(r);c===a&&e.datasets.length===t.datasets.length&&n?(t.datasets.forEach((t,r)=>{const o=Object.keys(e.datasets[r]),a=Object.keys(t),c=o.filter(t=>"_meta"!==t&&-1===a.indexOf(t));c.forEach(t=>{(null===n||void 0===n?void 0:n.data.datasets[r])&&delete n.data.datasets[r][t]});for(const e in t){const o=t[e];t.hasOwnProperty(e)&&o&&n&&(n.data.datasets[r][e]=o)}}),t.hasOwnProperty("labels")&&(n.data.labels=t.labels,v()),y()):(n&&g(),h())}else l.value&&g(),h()}function h(){u.value?(l.value=new o.Chart(u.value,{data:n.chartData,type:e,options:(0,i.default)(n.options),plugins:n.plugins}),b()):console.error(`Error on component ${r}, canvas cannot be rendered. Check if the render appends server-side`)}function v(){var t;c("labels:update"),null===(t=n.onLabelsUpdate)||void 0===t||t.call(n)}function b(){var t;l.value&&(c("chart:render",l.value),null===(t=n.onChartRender)||void 0===t||t.call(n,l.value))}function y(){var t;l.value&&(l.value.update(),c("chart:render",l.value),null===(t=n.onChartRender)||void 0===t||t.call(n,l.value))}function g(){var t,e;null===(t=l.value)||void 0===t||t.destroy(),c("chart:destroy"),null===(e=n.onChartDestroy)||void 0===e||e.call(n)}return(0,a.watch)(()=>n.chartData,p,{deep:!0}),(0,a.watch)(()=>n.options,(t,e)=>{l.value&&t&&!(0,f.default)(l.value.options,e)&&(l.value.options=(0,i.default)(t),e=(0,i.default)(t),y())},{deep:!0}),(0,a.onMounted)(h),(0,a.onBeforeUnmount)(()=>{var t;l.value&&(null===(t=l.value)||void 0===t||t.destroy())}),{canvasRef:u,renderChart:h,chartInstance:l,canvasId:d}},render(){return(0,a.h)("div",{style:{maxWidth:"100%",...this.styles,position:"relative"},class:this.cssClasses},[(0,a.h)("canvas",{style:{maxWidth:"100%",maxHeight:"100%"},...a.isVue2&&{attrs:{id:this.canvasId,width:this.width,height:this.height}},...a.isVue3&&{id:this.canvasId,width:this.width,height:this.height},ref:"canvasRef"})])}})};e.defineChartComponent=l},"087d":function(t,e){function n(t,e){var n=-1,r=e.length,o=t.length;while(++n<r)t[o+n]=e[n];return t}t.exports=n},"0b07":function(t,e,n){var r=n("34ac"),o=n("3698");function a(t,e){var n=o(t,e);return r(n)?n:void 0}t.exports=a},"0d24":function(t,e,n){(function(t){var r=n("2b3e"),o=n("07c7"),a=e&&!e.nodeType&&e,c=a&&"object"==typeof t&&t&&!t.nod
//# sourceMappingURL=main~workouts.aa540c70.js.map