2 lines
54 KiB
JavaScript
2 lines
54 KiB
JavaScript
|
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["main~workouts"],{"00fd":function(t,e,r){var n=r("9e69"),o=Object.prototype,a=o.hasOwnProperty,c=o.toString,i=n?n.toStringTag:void 0;function u(t){var e=a.call(t,i),r=t[i];try{t[i]=void 0;var n=!0}catch(u){}var o=c.call(t);return n&&(e?t[i]=r:delete t[i]),o}t.exports=u},"03dd":function(t,e,r){var n=r("eac5"),o=r("57a5"),a=Object.prototype,c=a.hasOwnProperty;function i(t){if(!n(t))return o(t);var e=[];for(var r in Object(t))c.call(t,r)&&"constructor"!=r&&e.push(r);return e}t.exports=i},"0644":function(t,e,r){var n=r("3818"),o=1,a=4;function c(t){return n(t,o|a)}t.exports=c},"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"),c=n(r("e740")),i=n(r("bba4")),u=n(r("0644")),f=n(r("63ea")),s=r("e1bd");a.install();const d=t=>c.default(i.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:c}){const i=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),c=JSON.stringify(n);c===a&&e.datasets.length===t.datasets.length&&r?(t.datasets.forEach((t,n)=>{const o=Object.keys(e.datasets[n]),a=Object.keys(t),c=o.filter(t=>"_meta"!==t&&-1===a.indexOf(t));c.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&&x(),h())}else l.value&&x(),h()}function h(){i.value?(l.value=new o.Chart(i.value,{data:r.chartData,type:e,options:u.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;c("labels:update"),null===(t=r.onLabelsUpdate)||void 0===t||t.call(r)}function b(){var t;l.value&&(c("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(),c("chart:render",l.value),null===(t=r.onChartRender)||void 0===t||t.call(r,l.value))}function x(){var t,e;null===(t=l.value)||void 0===t||t.destroy(),c("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=u.default(t),e=u.default(t),y())},{deep:!0}),a.onMounted(h),a.onBeforeUnmount(()=>{var t;l.value&&(null===(t=l.value)||void 0===t||t.destroy())}),{canvasRef:i,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,c=a&&"object"==typeof t&&t&&!t.nodeType&&t,i=c&&c.exports===a,u=i?n.Buffer:void 0,f=u?u.isBuffer:vo
|
||
|
//# sourceMappingURL=main~workouts.896585f2.js.map
|