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