/**
 * Highstock JS v11.2.0 (2023-10-30)
 *
 * Indicator series type for Highcharts Stock
 *
 * (c) 2010-2021 Paweł Dalek
 *
 * License: www.highcharts.com/license
 */!function(t){"object"==typeof module&&module.exports?(t.default=t,module.exports=t):"function"==typeof define&&define.amd?define("highcharts/indicators/vwap",["highcharts","highcharts/modules/stock"],function(e){return t(e),t.Highcharts=e,t}):t("undefined"!=typeof Highcharts?Highcharts:void 0)}(function(t){"use strict";var e=t?t._modules:{};function o(t,e,o,r){t.hasOwnProperty(e)||(t[e]=r.apply(null,o),"function"==typeof CustomEvent&&window.dispatchEvent(new CustomEvent("HighchartsModuleLoaded",{detail:{path:e,module:t[e]}})))}o(e,"Stock/Indicators/VWAP/VWAPIndicator.js",[e["Core/Series/SeriesRegistry.js"],e["Core/Utilities.js"]],function(t,e){var o,r=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),n=t.seriesTypes.sma,i=e.error,s=e.isArray,a=e.merge,u=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.data=void 0,e.points=void 0,e.options=void 0,e}return r(e,t),e.prototype.getValues=function(t,e){var o,r=t.chart,n=t.xData,a=t.yData,u=e.period,c=!0;if(!(o=r.get(e.volumeSeriesID))){i("Series "+e.volumeSeriesID+" not found! Check `volumeSeriesID`.",!0,r);return}return s(a[0])||(c=!1),this.calculateVWAPValues(c,n,a,o,u)},e.prototype.calculateVWAPValues=function(t,e,o,r,n){var i,s,a,u,c,p,l=r.yData,d=r.xData.length,f=e.length,h=[],y=[],v=[],m=[],g=[];for(c=0,i=f<=d?f:d,p=0;c<i;c++)s=(t?(o[c][1]+o[c][2]+o[c][3])/3:o[c])*l[c],a=p?h[c-1]+s:s,u=p?y[c-1]+l[c]:l[c],h.push(a),y.push(u),g.push([e[c],a/u]),v.push(g[c][0]),m.push(g[c][1]),++p===n&&(p=0);return{values:g,xData:v,yData:m}},e.defaultOptions=a(n.defaultOptions,{params:{index:void 0,period:30,volumeSeriesID:"volume"}}),e}(n);return t.registerSeriesType("vwap",u),u}),o(e,"masters/indicators/vwap.src.js",[],function(){})});//# sourceMappingURL=vwap.js.map