UNPKG

@lightningchart/lcjs

Version:

A high-performance charting library.

2 lines 1.45 MB
/* LightningChart JS v8.2.0 */ "use strict";Object.defineProperty(exports,"u",{value:!0});var t=require("immutable"),i=require("earcut");function s(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}function e(t){if(t&&t.u)return t;var i=Object.create(null);return t&&Object.keys(t).forEach((function(s){if("default"!==s){var e=Object.getOwnPropertyDescriptor(t,s);Object.defineProperty(i,s,e.get?e:{enumerable:!0,get:function(){return t[s]}})}})),i.default=t,Object.freeze(i)}var r=e(t),h=s(i);class n{constructor(){this.S=!0}M(){return this.S}}class o extends n{constructor(t,i){super(),this._=t,this.C=t,this.S=i}T(t){return t!==this._&&(this.C=this._,this._=t,this.S=!0),this}F(){return this._}M(){return super.M()}}const a=(t,i)=>({x:t,y:i}),l=(t,i)=>({x:t,y:i}),u=(t,i,s)=>({position:t,high:i,low:s}),c=(t,i,s)=>({x:t,y:i,z:s}),d=t=>{const i=Array(0),s=Array(0);return t.length>0&&t.forEach((t=>{i.push(a(t.position,t.high)),s.push(a(t.position,t.low))})),[i,s]},f=(t,i)=>({min:t,max:i}),A=(t,i,s,e)=>({x:t,y:i,width:s,height:e}),g=(t,i=!0)=>new o(t,i),p=(t=0,i=0,s=0,e=0)=>({left:t,top:i,right:s,bottom:e}),v=p,y=(t,i)=>({left:void 0!==i.left?i.left:t.left,top:void 0!==i.top?i.top:t.top,right:void 0!==i.right?i.right:t.right,bottom:void 0!==i.bottom?i.bottom:t.bottom}),m=t.Record({type:"color",r:1,g:1,b:1,a:1});class x extends m{constructor(t){super(t)}toUint32(){return void 0!==this.I||(this.I=F(this.getR(),this.getG(),this.getB(),this.getA())),this.I}toString(){return`color:${this.r},${this.g},${this.b},${this.a}`}setA(t){return this.set("a",t/255)}setR(t){return this.set("r",t/255)}setG(t){return this.set("g",t/255)}setB(t){return this.set("b",t/255)}getA(){return 255*this.get("a")}getR(){return 255*this.get("r")}getG(){return 255*this.get("g")}getB(){return 255*this.get("b")}getHighlight(){return this.P||(this.P=new x({r:this.r+.45*(1-this.r),g:this.g+.45*(1-this.g),b:this.b+.45*(1-this.b),a:this.a<1?this.a+.45*(1-this.a):1})),this.P}getLighter(){return this.L||(this.L=new x({r:this.r+.4*(1-this.r),g:this.g+.4*(1-this.g),b:this.b+.4*(1-this.b),a:this.a})),this.L}getDarker(){return this.D||(this.D=new x({r:this.r-.4*(1-this.r),g:this.g-.4*(1-this.g),b:this.b-.4*(1-this.b),a:this.a})),this.D}toRGBAString(){return`rgba(${(255*this.r).toFixed(0)},${(255*this.g).toFixed(0)},${(255*this.b).toFixed(0)},${this.a})`}}const S=t=>!(!t||"object"!=typeof t||!("type"in t)||"color"!==t.type),b=(t,i,s,e=255)=>new x({r:t/255,g:i/255,b:s/255,a:e/255}),M=t=>{const i=t.startsWith("#")?t.substring(1):t.startsWith("0x")?t.substr(2):t;switch(i.length){case 8:return new x({r:Number(`0x${i.substring(0,2)}`)/255,g:Number(`0x${i.substring(2,4)}`)/255,b:Number(`0x${i.substring(4,6)}`)/255,a:Number(`0x${i.substring(6,8)}`)/255});case 6:return new x({r:Number(`0x${i.substring(0,2)}`)/255,g:Number(`0x${i.substring(2,4)}`)/255,b:Number(`0x${i.substring(4,6)}`)/255});case 4:return new x({r:Number(`0x${i.charAt(0)}${i.charAt(0)}`)/255,g:Number(`0x${i.charAt(1)}${i.charAt(1)}`)/255,b:Number(`0x${i.charAt(2)}${i.charAt(2)}`)/255,a:Number(`0x${i.charAt(3)}${i.charAt(3)}`)/255});case 3:return new x({r:Number(`0x${i.charAt(0)}${i.charAt(0)}`)/255,g:Number(`0x${i.charAt(1)}${i.charAt(1)}`)/255,b:Number(`0x${i.charAt(2)}${i.charAt(2)}`)/255});default:throw new Error(`ColorHEX parsing error | input: ${t}`)}},_=(t,i=1,s=1)=>{let e,r,h;t/=360;const n=Math.floor(6*t),o=6*t-n,a=s*(1-i),l=s*(1-o*i),u=s*(1-(1-o)*i);switch(n%6){case 0:e=s,r=u,h=a;break;case 1:e=l,r=s,h=a;break;case 2:e=a,r=s,h=u;break;case 3:e=a,r=l,h=s;break;case 4:e=u,r=a,h=s;break;default:e=s,r=a,h=l}return new x({r:e,g:r,b:h})},w=t=>b(255&t,255&(t>>=8),255&(t>>=8),255&(t>>=8)),k={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgrey:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370d8",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#d87093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"},C=new x({}),T=b(0,0,0,0),F=(t,i,s,e=255)=>(e<<24|s<<16|i<<8|t)>>>0,I=t.Record({type:"font",size:14,family:"Arial",weight:"normal",style:"normal",variant:!1});class P extends I{constructor(t){super(t)}setSize(t){return this.set("size",t)}setFamily(t){return this.set("family",t)}setWeight(t){return this.set("weight",t)}setStyle(t){return this.set("style",t)}setVariant(t){return this.set("variant",t)}getSize(){return this.get("size")}getFamily(){return this.get("family")}getWeight(){return this.get("weight")}getStyle(){return this.get("style")}getVariant(){return this.get("variant")}}const L=t=>!(!t||"object"!=typeof t||!("type"in t)||"font"!==t.type),B=new P;var D,E;exports.GradientShape=void 0,(D=exports.GradientShape||(exports.GradientShape={})).circle="circle",D.ellipse="ellipse",exports.GradientExtent=void 0,(E=exports.GradientExtent||(exports.GradientExtent={})).closestSide="closest-side",E.closestCorner="closest-corner",E.farthestSide="farthest-side",E.farthestCorner="farthest-corner";const R=t.Record({type:"fillstyle",fillType:"radial-gradient",ditheringEnabled:!0,stops:[{color:M("#f00"),offset:0},{color:M("#0f0"),offset:1}],position:a(.5,.5),shape:exports.GradientShape.ellipse,extent:exports.GradientExtent.farthestCorner});class O extends R{constructor(t){if(super(t),null===t||t&&null===t.stops||t&&t.stops&&!Array.isArray(t.stops)||t&&t.stops&&Array.isArray(t.stops)&&t.stops.length<2)throw new Error("RadialGradientFill requires minimum two color stops to be defined.")}toString(){return`radialGradientFill:${this.shape},${this.ditheringEnabled},${this.extent},${this.position.x},${this.position.y},${this.stops.map((t=>`${t.offset},${t.color.toString()}`)).join(",")}`}toCSS(){return`radial-gradient(${this.shape} ${this.extent} at ${100*this.position.x}% ${100*this.position.y}%, ${this.stops.map((t=>`${t.color.toString()} ${100*t.offset}%`)).join(", ")})`}setColorStops(t){if(t.length<2)throw new Error("Minimum of two color stops required");return this.set("stops",t)}getColorStops(){return this.get("stops")}setPosition(t){return this.set("position",t)}getPosition(){return this.get("position")}setShape(t){return this.set("shape",t)}getShape(){return this.get("shape")}setExtent(t){return this.set("extent",t)}getExtent(){return this.get("extent")}setDitheringEnabled(t){return this.set("ditheringEnabled",t)}getDitheringEnabled(){return this.get("ditheringEnabled")}}const z=t=>!!(t&&"object"==typeof t&&"type"in t&&"fillstyle"===t.type&&"fillType"in t&&"radial-gradient"===t.fillType),V=t.Record({type:"fillstyle",fillType:"linear-gradient",stops:[{color:M("#f00"),offset:0},{color:M("#0f0"),offset:1}],angle:0});class N extends V{constructor(t){if(super(t),null===t||t&&null===t.stops||t&&t.stops&&!Array.isArray(t.stops)||t&&t.stops&&Array.isArray(t.stops)&&t.stops.length<2)throw new Error("LinearGradientFill requires minimum two color stops to be defined.")}toString(){return`linearGradientFill:${this.angle},${this.stops.map((t=>`${t.offset},${t.color.toString()}`)).join(",")}`}toCSS(){return`linear-gradient(${this.angle}deg, ${this.stops.map((t=>`${t.color.toString()} ${100*t.offset}%`)).join(", ")})`}setColorStops(t){if(t.length<2)throw new Error("Minimum of two color stops required");const i=t.sort(((t,i)=>t.offset-i.offset));return this.set("stops",i)}getColorStops(){return this.get("stops")}setAngle(t,i){return this.set("angle",i?function(t){return 180*t/Math.PI}(t):t)}getAngle(t){return t?$s(this.get("angle")):this.get("angle")}}const G=t=>!!(t&&"object"==typeof t&&"type"in t&&"fillstyle"===t.type&&"fillType"in t&&"linear-gradient"===t.fillType);class ${constructor(t,i,s,e){this.R=new yt,this.cellIndex=t,this.cellSpan=i,this.cellsAmount=s,this.observedAmount=e,this.x=new U,this.y=new U,this.z=new U;const r={...t},h={...i};if(e){const t=t=>{const i=t.value;this.cellsAmount.x=i.reduce(gs,0),this.cellIndex.x=i.reduce(((t,i,s)=>s>=r.x?t:t+i),0),this.cellSpan.x=i.reduce(((t,i,s)=>s>=r.x&&s<r.x+h.x?t+i:t),0),this.R.O("cellresize",{})};e.x.V("change",t),t({value:e.x.F()});const i=t=>{const i=t.value;this.cellsAmount.y=i.reduce(gs,0),this.cellIndex.y=i.reduce(((t,i,s)=>s>=r.y?t:t+i),0),this.cellSpan.y=i.reduce(((t,i,s)=>s>=r.y&&s<r.y+h.y?t+i:t),0),this.R.O("cellresize",{})};e.y.V("change",i),i({value:e.y.F()}),this.N=()=>{e.x.G("change",t),e.y.G("change",i)}}}$(){return this.N&&(this.N(),this.N=void 0),this}addEventListener(t,i,s){this.R.addEventListener(t,i,s)}removeEventListener(t,i){this.R.removeEventListener(t,i)}}class U extends n{constructor(){super(...arguments),this.U=0,this.j=10,this.Y=1,this.H=!1}W(){return!1}X(){return this.S=!1,this}Z(){return this.S=!0,this}getInnerStart(){return this.U}getInnerEnd(){return this.j}getInnerInterval(){return Math.abs(this.getInnerEnd()-this.getInnerStart())}J(t,i){return this.U=t,this.j=i,this.K(),this}q(t){return this.Y=t,this.K(),this}tt(t){return t/this.Y}K(){const t=this.tt(this.j-this.U),i=this.Y;void 0!==this.it&&!1!==Xt(t,this.it)||(this.S=!0,this.st=i,this.it=t);let s=this.U;this.j;let e=0;this.H&&(s=0,this.j,this.U,e=this.U);const r=t,h=s+.5*r*i;this.et={displacement:h,scaling:r,highPrecisionOffset:e}}rt(){return this.it}ht(){return this.j<this.U}nt(){return this.et}ot(t,i){return!0}}class j{constructor(){this.ut=!0}getInnerStart(){return this.U}getInnerEnd(){return this.j}getInnerInterval(){return Math.abs(this.j-this.U)}J(t,i){return t===this.U&&i===this.j||(this.ut=!0),this.U=t,this.j=i,this}X(){return this.ut=!1,this}Z(){return this.ut=!0,this}}class Y extends j{constructor(t,i,s,e){if(super(),this.ct=!0,this.dt=!0,this.ft=[0,0],this.At=!0,this.vt=t,this.yt=i,this.xt=s,this.St=t,this.bt=i,e){const t=t=>{this.Mt(t.value)};e.V("change",t),this.Mt(e.F()),this._t=()=>e.G("change",t)}}W(){return this.dt}q(t){return this.Y=t,this.dt=!0,this}wt(t){return this.ft=t.map(Math.abs),this.At=!0,this}kt(){return this.vt/this.xt*this.Y+this.ft[0]}Ct(){return(this.vt+this.yt)/this.xt*this.Y-this.ft[1]}Tt(){return this.getCellSize()-this.Ft()}It(){return this.Y}getCellSize(){return this.Pt(this.Y)}Ft(){return this.ft[0]+this.ft[1]}Lt(){return this.ft}Mt(t){this.xt=t.reduce(gs,0),this.vt=t.reduce(((t,i,s)=>s>=this.St?t:t+i),0),this.yt=t.reduce(((t,i,s)=>s>=this.St&&s<this.St+this.bt?t+i:t),0),this.ct=!0,this.Bt()}Pt(t){return t*this.yt/this.xt}X(){return super.X(),this.dt=!1,this.At=!1,this.ct=!1,this}Z(){return super.Z(),this.dt=!0,this.At=!0,this.ct=!0,this}}class H extends Y{constructor(t,i,s,e){super(t,i,s,e),this.H=!1,this.Dt=!1,this.Et=0,this.Y=1e3,this.J(0,10),this.K()}Rt(){return this.Dt}ot(t,i,s,e,r){if(t===i)return!1;const h=Math.abs(e-s),n=Math.abs(i-t);if(!this.H){const s=_i(t,i,this.getCellSize());if(void 0===s)return!1;if(n>s)return!0;const e=(i+t)/2,o=(r?s/2:h/2)*(t>i?-1:1);return{start:e-o,end:e+o}}const o=10**-(12-Math.log10(Math.max(Math.abs(t),1)));if(n>o)return!0;const a=(i+t)/2,l=(r?o/2:h/2)*(t>i?-1:1);return{start:a-l,end:a+l}}Bt(){this.K()}Ot(t){return this.kt()+(t-this.U)/(this.j-this.U)*(this.Ct()-this.kt())}zt(t){return this.U+(t-this.kt())/(this.Ct()-this.kt())*(this.j-this.U)}J(t,i){return super.J(t,i),this.K(),this}wt(t){return super.wt(t),this.K(),this}q(t){return super.q(t),this.Vt=W(this.j-this.U,this.ft,this.Y,this.yt,this.xt),this.K(),this}Nt(){return this.H=!0,this}Gt(){return this.H}$t(){return Math.abs(this.Ut)}jt(){return this.$t()/this.Vt}Yt(){return this.Ht}Wt(){return this.Xt}getPixelSize(){return this.Vt}nt(){return this.et}Z(){return super.Z(),this.Dt=!0,this}X(){return super.X(),this.Dt=!1,this}Zt(t,i=te.Numeric){return i(t,{start:this.U,end:this.j})}Jt(){const t=Math.abs(this.getInnerEnd()).toString().length,i=Math.abs(this.getInnerStart()).toString().length;return t>i?t:i}Qt(t){return W(t,this.ft,this.Y,this.yt,this.xt)}K(){let t=this.U,i=this.j,s=0;this.H&&(t=0,i=this.j-this.U,s=this.U);const e=i-t,r=W(e,this.ft,this.Y,this.yt,this.xt);this.Xt=this.U-this.ft[0]*r,this.Ht=this.j+this.ft[1]*r;const h=t-this.ft[0]*r,n=i+this.ft[1]*r-h,o=n-this.Ut,a=Math.abs(o/r),l=e-this.Et,u=Math.abs(l/r);(!this.et||a>=.4||u>=.4)&&(this.Et=e,this.Ut=n,this.Vt=r,this.Dt=!0);const c=this.Ut*this.xt/(2*this.yt),d=-(h-this.Ut*this.vt/this.yt)-c,f=2*this.kt()/this.Y-1,A=2*this.Ct()/this.Y-1-f;this.et={displacement:d,scaling:c,highPrecisionOffset:s,viewportStart:f,viewportSize:A,scaleStartLog:0,scaleIntervalLog:0}}Kt(t,i){return t+this.Vt*i}}const W=(t,i,s,e=1,r=1)=>t/(s*e/r-(i[0]+i[1]));class X{qt(t,i){return"x"in t?(this.x=t.x,this.y=t.y):(this.x=t,this.y=i),this}X(){return this.x.X(),this.y.X(),this}Z(){return this.x.Z(),this.y.Z(),this}q(t,i){return"object"==typeof t?(this.x.q(t.x),this.y.q(t.y)):(this.x.q(t),this.y.q(i)),this}It(){return a(this.x.It(),this.y.It())}ti(t){return this.x.wt(t),this}ii(t){return this.y.wt(t),this}Ft(){return a(this.x.Ft(),this.y.Ft())}si(t,i){return this.x.J(t,i),this}ei(t,i){return this.y.J(t,i),this}getInnerIntervalPixels(){const t=this.x.getCellSize(),i=this.y.getCellSize();return{x:t-this.x.Ft(),y:i-this.y.Ft()}}ri(){return this.x.Rt()||this.y.Rt()}}class Z extends X{constructor(){super(...arguments),this.hi="LinearScaleXY"}ni(t,i,s,e){return this.x=new H(t.x,i.x,s.x,e?e.x:void 0),this.y=new H(t.y,i.y,s.y,e?e.y:void 0),this}Gt(){return this.x.Gt()||this.y.Gt()}oi(){return a(this.x.getPixelSize(),this.y.getPixelSize())}nt(){return{x:this.x.nt(),y:this.y.nt()}}Kt(t,i){const s=this.oi();return{x:t.x+i.x*s.x,y:t.y+i.y*s.y}}ai(t,i,s,e){const r=this.oi(),h=Ls(t,i);return h.x*=e,h.y*=e,{x:t.x+s*r.x*h.x,y:t.y+s*r.y*h.y}}}class J extends X{constructor(){super(...arguments),this.hi="MixedScaleXY"}Gt(){return!1}Kt(t,i){const s=this.x.Ot(t.x),e=this.y.Ot(t.y),r={x:s+i.x,y:e+i.y};return{x:this.x.zt(r.x),y:this.y.zt(r.y)}}ai(t,i,s,e){const r={x:this.x.Ot(t.x),y:this.y.Ot(t.y)},h={x:this.x.Ot(i.x),y:this.y.Ot(i.y)},n=Ps(Rs(h,r)),o=Ls(h,r),a={x:r.x+n.x*e+o.x*s,y:r.y+n.y*e+o.y*s};return{x:this.x.zt(a.x),y:this.y.zt(a.y)}}nt(){const t=this.x.nt(),i=this.y.nt();return{uScaleStart:[this.x.U,this.y.U],uScaleInterval:[this.x.j-this.x.U,this.y.j-this.y.U],uScaleStartLog:[t.scaleStartLog,i.scaleStartLog],uScaleIntervalLog:[t.scaleIntervalLog,i.scaleIntervalLog],uViewportStart:[t.viewportStart,i.viewportStart],uViewportSize:[t.viewportSize,i.viewportSize]}}}const Q={d1:t=>new t.scale1DConstructor(0,1,1,void 0),d2:t=>(new t.scaleXYConstructor).ni({x:0,y:0},{x:1,y:1},{x:1,y:1},void 0),d3:()=>new $({x:0,y:0},{x:1,y:1},{x:1,y:1},void 0)},K=(t,i,s)=>i===s?t:s.zt(i.Ot(t)),q=(t,i,s)=>{if(i===s)return t;const e=i instanceof X?i.x:i.x instanceof X?i.x.x:i.x.li,r=i instanceof X?i.y:i.y instanceof X?i.y.y:i.y.li,h=s instanceof X?s.x:s.x instanceof X?s.x.x:s.x.li,n=s instanceof X?s.y:s.y instanceof X?s.y.y:s.y.li;return{...t,x:K(t.x,e,h),y:K(t.y,r,n)}},tt=(...t)=>{if(0===t.length)return{remove:Wt};let i=!1;const s=t.map((s=>{const e=e=>{((s,e,r)=>{i||(i=!0,t.filter((t=>t!==s)).forEach((t=>t.ui(e,r,!1,s.getStopped(),"synchronizedAxis"))),i=!1)})(s,e.start,e.end)};return s.addEventListener("intervalchange",e),e}));let e=!1;const r=t.map((i=>{const s=s=>{((i,s)=>{e||(e=!0,t.filter((t=>t!==i)).forEach((t=>t.setStopped(s))),e=!1)})(i,s.isStopped)};return i.addEventListener("stoppedchange",s),s}));return{remove:()=>{t.forEach(((t,i)=>{t.removeEventListener("intervalchange",s[i]),t.removeEventListener("stoppedchange",r[i])}))}}},it=t=>t&&"object"==typeof t&&"column"in t&&"row"in t,st=t=>t&&"object"==typeof t&&"z"in t&&"column"in t&&"row"in t,et=t=>t&&"object"==typeof t&&"annulus"in t&&"sector"in t,rt=t=>t&&"object"==typeof t&&"index"in t,ht=t=>t&&"object"==typeof t&&"x"in t&&"y"in t,nt=(t,i,s,e)=>s<0?t:s>1?i:b(t.getR()+s*(i.getR()-t.getR()),t.getG()+s*(i.getG()-t.getG()),t.getB()+s*(i.getB()-t.getB()),void 0===e?t.getA()+s*(i.getA()-t.getA()):e);var ot;!function(t){t[t.Nearest=0]="Nearest",t[t.NearestX=1]="NearestX",t[t.NearestY=2]="NearestY"}(ot||(ot={}));const at=(t,i,s,e,r,h,n,o,a,l)=>{const u=t.length;if(0===u)return;const c=e?1:0,d=u-(r?2:1);if(s===ot.Nearest)return lt(t,i,h,n,c,d);if(s===ot.NearestX||s===ot.NearestY){if("boolean"==typeof l&&("x"===a&&s===ot.NearestX||"y"===a&&s===ot.NearestY))return dt(t,q(i,n,h),a,l,c,d);if(s===ot.NearestX)return ut(t,q(i,n,h),o,c,d);if(s===ot.NearestY)return ct(t,q(i,n,h),o,c,d)}},lt=(t,i,s,e,r,h)=>{let n,o=Number.MAX_VALUE;for(let a=r;a<=h;a+=1){const r=t[a];if(!Number.isNaN(r.x)&&!Number.isNaN(r.y)){const t=q(r,s,e),h=(t.x-i.x)**2+(t.y-i.y)**2;h<o&&(o=h,n=a)}}return n},ut=(t,i,s,e,r)=>{if(i.x<s.min.x||i.x>s.max.x)return;let h,n=Number.MAX_VALUE;for(let s=e;s<=r;s+=1){const e=t[s],r=e.x>i.x?e.x-i.x:i.x-e.x;r<n&&!Number.isNaN(e.x)&&!Number.isNaN(e.y)&&(n=r,h=s)}return h},ct=(t,i,s,e,r)=>{if(i.y<s.min.y||i.y>s.max.y)return;let h,n=Number.MAX_VALUE;for(let s=e;s<=r;s+=1){const e=t[s],r=e.y>i.y?e.y-i.y:i.y-e.y;r<n&&!Number.isNaN(e.x)&&!Number.isNaN(e.y)&&(n=r,h=s)}return h},dt=(t,i,s,e,r,h)=>{const n="x"===s,o=n?i.x:i.y,a=t[r],l=t[h],u=a.x<l.x?a.x:l.x,c=a.y<l.y?a.y:l.y,d=a.x>l.x?a.x:l.x,f=a.y>l.y?a.y:l.y;if(n&&(o<u||o>d)||!n&&(o<c||o>f))return;let A=r,g=Math.floor((r+h)/2),p=h,v=-1;for(;;){const i=o-(n?t[g].x:t[g].y);if(i*(e?-1:1)>0)A=Math.min(g+1,p),v=Math.floor((A+p)/2);else{if(0===Math.abs(i))return g;p=Math.max(g-1,A),v=Math.floor((A+p)/2)}if(v===g){const s=g>r?Math.abs(o-(n?t[g-1].x:t[g-1].y)):ns,e=g<h?Math.abs(o-(n?t[g+1].x:t[g+1].y)):ns,a=Math.abs(i);switch(Math.min(a,s,e)){case s:return g-1;case e:return g+1;default:return g}}else g=v}},ft=(t,i,s,e,r,h)=>{const n="x"===s,o=n?i.x:i.y,a=t[r],l=t[h],u=a.x<l.x?a.x:l.x,c=a.y<l.y?a.y:l.y,d=a.x>l.x?a.x:l.x,f=a.y>l.y?a.y:l.y;if(n&&(o<u||o>d)||!n&&(o<c||o>f))return;let A=r,g=Math.floor((r+h)/2),p=h,v=-1;for(;;){const s=o-(n?t[g].x:t[g].y);if(s*(e?-1:1)>0)A=Math.min(g+1,p),v=Math.floor((A+p)/2);else{if(0===Math.abs(s))return{a:g,b:g,lerpAmount:0};p=Math.max(g-1,A),v=Math.floor((A+p)/2)}if(v===g){if(s*(e?-1:1)<0&&g>r){const s=t[g-1],e=t[g];return{a:g-1,b:g,lerpAmount:n?(i.x-s.x)/(e.x-s.x):(i.y-s.y)/(e.y-s.y)}}if(g<h){const s=t[g],e=t[g+1];return{a:g,b:g+1,lerpAmount:n?(i.x-s.x)/(e.x-s.x):(i.y-s.y)/(e.y-s.y)}}return{a:g,b:g,lerpAmount:0}}g=v}};let At=0;class gt{constructor(t,i,s){this.ci=g(!0),this.di=!1,this.fi=!0,this.Ai=!1,this.gi=void 0,this.pi=0,this.R=new yt,this.yi=t,this.mi=i,this.xi=s,this.Si=At,At+=1,this.bi=t.Mi.highlightColorOffset}_i(){let t;return this.wi("DataPattern",(i=>(t=i.pattern,!0))),"ProgressiveX"===t||"RegressiveX"===t?ot.NearestX:"ProgressiveY"===t||"RegressiveY"===t?ot.NearestY:ot.Nearest}ki(){}addEventListener(t,i,s){this.R.addEventListener(t,i,s)}O(t,i,s,e){this.R.O(t,i,{collectionMember:s,info:e})}removeEventListener(t,i){this.R.removeEventListener(t,i)}Ci(t){return void 0!==this.xi.find((i=>i.type===t))}wi(t,i){var s;return!!this.Ci(t)&&!0===i(null===(s=this.xi.find((i=>i.type===t)))||void 0===s?void 0:s.args)}dispose(){return this.di||(this.yi.Ti(this),this.di=!0,this.mi(this),this.R.O("dispose",{})),this}isDisposed(){return this.di}setVisible(t){const i=this.fi;return this.fi=t,!t&&i&&this.ci.F()&&this.yi.Ti(this),this}getVisible(){return this.fi}setPointerEvents(t){const i=this.ci.F();return this.ci.T(t),t||i&&this.yi.Ti(this),this}getPointerEvents(){return this.ci.F()}Fi(t){return this.gi=t,this}Ii(){return this.gi?this.gi:pt}Pi(t){return this.pi=t,this}Li(){return this.pi}Bi(t){return this.bi=t,this}Di(){return this.bi}}const pt=f(a(0,0),a(0,0)),vt={click:!0,contextmenu:!0,dblclick:!0,gotpointercapture:!0,lostpointercapture:!0,pointercancel:!0,pointerdown:!0,pointerenter:!0,pointerleave:!0,pointermove:!0,pointerout:!0,pointerover:!0,pointerup:!0,touchcancel:!0,touchend:!0,touchmove:!0,touchstart:!0,wheel:!0,drag:!0,dragend:!0,dragenter:!0,dragleave:!0,dragover:!0,dragstart:!0,drop:!0};class yt{constructor(){this.Ei=new Array,this.Ri=[],this.ci=!0,this.Oi=!1,this.zi=new Map}setPointerEvents(t){this.ci=t,this.Ri.forEach((i=>i.setPointerEvents(t)))}getPointerEvents(){return this.ci}addEventListener(t,i,s){this.Ei.push({listener:i,key:t,options:s||{}})}removeEventListener(t,i){const s=this.Ei.findIndex((t=>t.listener===i));s>=0&&this.Ei.splice(s,1)}set draggable(t){this.Oi=t,this.Ri.forEach((i=>{i.Ai=t}))}get draggable(){return this.Oi}O(t,i,s=void 0){const e=this.Ei.slice();for(let r=e.length-1;r>=0;r-=1){const h=e[r];h.key===t&&(h.listener(i,s),!0===h.options.once&&this.removeEventListener(t,h.listener))}}Vi(t,i){const s=[];Object.keys(vt).forEach((e=>{const r=(t,s)=>{const r=mt(t)?{clientX:t.changedTouches[0].clientX,clientY:t.changedTouches[0].clientY}:t,h=(null==i?void 0:i.getExtraData)&&void 0!==r.clientX?i.getExtraData(r,s.collectionMember,s.info):{};this.O(e,t,h),!t.defaultPrevented&&(null==i?void 0:i.continueIfNotPrevented)&&i.continueIfNotPrevented(e,t,h)};t.addEventListener(e,r),s.push((()=>t.removeEventListener(e,r)))})),this.Ri.push(t);const e=()=>{const i=this.Ri.indexOf(t);i>=0&&this.Ri.splice(i,1),s.forEach((t=>t()))};t.addEventListener("dispose",e),s.push((()=>t.removeEventListener("dispose",e))),this.zi.set(t,(()=>{s.forEach((t=>t()))})),t.Ai=this.Oi,t.setPointerEvents(this.ci)}Ni(){this.zi.forEach((t=>t())),this.zi.clear(),this.Ri.length=0}Gi(t,i){const s=[];Object.keys(vt).forEach((e=>{const r=(t,s)=>{const r=i(s.collectionMember);r&&this.O(e,t,r)};t.addEventListener(e,r),s.push((()=>t.removeEventListener(e,r)))})),this.Ri.push(t);const e=()=>{const i=this.Ri.indexOf(t);i>=0&&this.Ri.splice(i,1),s.forEach((t=>t()))};t.addEventListener("dispose",e),s.push((()=>t.removeEventListener("dispose",e))),this.zi.set(t,(()=>{s.forEach((t=>t()))})),t.setPointerEvents(this.ci),t.Ai=this.Oi}$i(t){Object.keys(vt).forEach((i=>{t.addEventListener(i,((t,s)=>{this.O(i,t,s)}))})),t.setPointerEvents(this.ci),t.draggable=this.Oi}}const mt=t=>!(!t||"object"!=typeof t||!("touches"in t)),xt={linear:(t,i,s)=>{const e=i-t;return r=>r<s?t+e/s*r:i},easeIn:(t,i,s)=>e=>e<s?t+Math.abs(2*(Math.sqrt(.5)*e/s)**2)*(i-t):i,easeOut:(t,i,s)=>e=>e<s?t+Math.abs(1-2*(Math.sqrt(.5)*(1-e/s))**2)*(i-t):i,ease:(t,i,s)=>e=>e<s?t+(e<s/2?.5*(e/s*2)**2.5:.5+.5*(1-(1-2*(e/s-.5))**2.5))*(i-t):i,logarithmic:t=>{const i=ki(t);return(s,e,r)=>{const h=i(s),n=i(e);return i=>i<r?t**(h+Math.abs(1-2*(Math.sqrt(.5)*(1-i/r))**2)*(n-h)):e}}};class St{constructor(t,i,s,e=xt.linear,r){this.delta=0,this.nextAnimations=new Array,this.Ui=!1,this.easing=xt.linear,this.isOver=()=>(this.delta===this.duration||this.Ui)&&0===this.nextAnimations.length,this.R=new yt,this.values=t,this.action=i,this.duration=s,this.easing=e,this.ji=r,this.eases=t.map((([t,i])=>e(t,i,s)))}Yi(){this.R.O("start",{})}start(){return this.ji.includes(this)||this.ji.push(this),this}addNextAnimations(t){return t instanceof Array?t.forEach((t=>this.nextAnimations.push(t))):this.nextAnimations.push(t),this}NextAnimation(t,i,s=this.duration,e=this.easing){const r=new St(t,i,s,e,this.ji);return this.nextAnimations.push(r),r}finish(t=!0){if(this.Ui=!0,this.ji.splice(this.ji.indexOf(this),1),this.nextAnimations.length>0){const i=this.nextAnimations[0];return t&&this.R.Ei.forEach((t=>{"allAnimationEnd"===t.key&&i.addEventListener("allAnimationEnd",t.listener),"everyAnimationEnd"===t.key&&i.addEventListener("everyAnimationEnd",t.listener)})),i.addNextAnimations(this.nextAnimations.slice(1)),i.start(),t&&(this.R.O("end",{nextAnimation:i}),this.R.O("everyAnimationEnd",{nextAnimation:i})),i}t&&(this.R.O("end",{nextAnimation:void 0}),this.R.O("everyAnimationEnd",{nextAnimation:void 0}),this.R.O("allAnimationEnd",{}))}finishAll(t=!0){let i=this;for(;i;)i=i.finish(t)}getFinalValues(){return this.nextAnimations.length>0?this.nextAnimations[this.nextAnimations.length-1].values.map(Yt):this.values.map(Yt)}getTimeUntilFinish(){let t=this.duration-this.delta;for(let i=0;i<this.nextAnimations.length;i+=1)t+=this.nextAnimations[i].duration-this.nextAnimations[i].delta;return t}addEventListener(t,i,s){this.R.addEventListener(t,i,s)}removeEventListener(t,i){this.R.removeEventListener(t,i)}}const bt=(t,i=60)=>{i>60&&console.log("Note: Animator FPS is usually capped at 60 by the browser!");const s=[];let e,r,h=0;const n=()=>{e=void 0;const o=Date.now();r=r||o,h=o-r,h/1e3>=1/i&&(r=Date.now()-h%(1e3/i),s.forEach((t=>{0===t.delta&&t.Yi(),t.delta+=h-h%(1e3/i),t.delta>t.duration&&(t.delta=t.duration),t.action(t.eases.map((i=>i(t.delta)))),t.delta===t.duration&&t.finish()})),t()),s.length>0?e=$t.requestAnimationFrame(n):(e=void 0,r=void 0)};return(t=1e3,i=xt.linear)=>(r,h,o=t)=>{const a=new St(r,h,o,i,s).start();return e||(e=$t.requestAnimationFrame(n)),a}};var Mt;exports.ImageFitMode=void 0,(Mt=exports.ImageFitMode||(exports.ImageFitMode={}))[Mt.Fill=0]="Fill",Mt[Mt.Fit=1]="Fit",Mt[Mt.Stretch=2]="Stretch",Mt[Mt.Center=3]="Center",Mt[Mt.Tile=4]="Tile";const _t=t.Record({type:"fillstyle",fillType:"image",source:void 0,surroundingColor:b(0,0,0,0),sourceMissingColor:b(0,0,0,0),fitMode:exports.ImageFitMode.Fill});class wt extends _t{constructor(t){super(t)}setSource(t){return this.set("source",t)}getSource(){return this.get("source")}setSurroundingColor(t){return S(t)?this.set("surroundingColor",t):this.set("surroundingColor",t(this.get("surroundingColor")))}getSurroundingColor(){return this.get("surroundingColor")}setSourceMissingColor(t){return S(t)?this.set("sourceMissingColor",t):this.set("sourceMissingColor",t(this.get("sourceMissingColor")))}getSourceMissingColor(){return this.get("sourceMissingColor")}setFitMode(t){return this.set("fitMode",t)}getFitMode(){return this.get("fitMode")}toString(){return`imagefill:${this.fitMode}`}toCSS(){return`url(${this.getSource().src})`}}const kt=t=>!!(t&&"object"==typeof t&&"type"in t&&"fillstyle"===t.type&&"fillType"in t&&"image"===t.fillType),Ct=t.Record({type:"linestyle",lineType:"empty"}),Tt=new class extends Ct{constructor(){super(...arguments),this.thickness=0}setThickness(t){return this}getThickness(){return 0}Hi(){return 0}setFillStyle(t){return this}getFillStyle(){return ue}},Ft=t=>!(!t||"object"!=typeof t||!("lineType"in t)||"empty"!==t.lineType),It=-34028234663852886e22,Pt="-340282346638528859811704183484516925440.0";var Lt,Bt,Dt,Et;exports.UISpace=void 0,(Lt=exports.UISpace||(exports.UISpace={}))[Lt.Content=0]="Content",Lt[Lt.PaddedContent=1]="PaddedContent",Lt[Lt.PaddedBackground=2]="PaddedBackground",Lt[Lt.Everything=3]="Everything",exports.UIVisibilityModes=void 0,(Bt=exports.UIVisibilityModes||(exports.UIVisibilityModes={}))[Bt.never=0]="never",Bt[Bt.always=1]="always",Bt[Bt.whenHovered=2]="whenHovered",Bt[Bt.whenDragged=3]="whenDragged",Bt[Bt.whenNotDragged=4]="whenNotDragged",Bt[Bt.whenHoveredOrDragged=5]="whenHoveredOrDragged",exports.UIDraggingModes=void 0,(Dt=exports.UIDraggingModes||(exports.UIDraggingModes={}))[Dt.notDraggable=0]="notDraggable",Dt[Dt.draggable=1]="draggable",Dt[Dt.onlyHorizontal=2]="onlyHorizontal",Dt[Dt.onlyVertical=3]="onlyVertical",exports.UIDirections=void 0,(Et=exports.UIDirections||(exports.UIDirections={}))[Et.Up=0]="Up",Et[Et.Right=1]="Right",Et[Et.Down=2]="Down",Et[Et.Left=3]="Left";const Rt=t=>"getHighlight"in t&&"setHighlight"in t,Ot=(t,i,s)=>void 0===t||"number"==typeof t||"string"==typeof t?t:Array.isArray(t)?t.slice(i,s):t.subarray(i,s),zt=(...t)=>{const i=t=>t&&"object"==typeof t&&!Array.isArray(t);return t.reduce(((t,s)=>s?(Object.keys(s).forEach((e=>{const r=t[e],h=s[e];i(r)&&i(h)?t[e]=zt(r,h):t[e]=h})),t):t),{})},Vt=t=>{if(t.resourcesBaseUrl){const i=t.styleFactory(t.resourcesBaseUrl),s=kt(i)&&i.getSource(),e=s&&s instanceof Image?s:void 0;return null==e||e.addEventListener("error",(()=>{Wi(t.resourcesBaseUrl,e.src,"Theme resource",{shouldCrash:!1})})),i}const i=`${$t.location.origin}/resources`,s=t.styleFactory(i);if(kt(s)){const i=s.getSource();i instanceof Image&&i.addEventListener("error",(()=>{const s=t.styleFactory("https://lcjs-resources.lightningchart.com/v1"),e=kt(s)&&s.getSource(),r=e&&e instanceof Image?e:void 0;$t.console.warn("LightningChart JS warning | fallbacking to publicly hosted asset resources.\nFor more information, please see https://lightningchart.com/js-charts/docs/troubleshooting/warning-using-publicly-hosted-resources/"),null==r||r.addEventListener("load",(()=>{t.apply(s)})),null==r||r.addEventListener("error",(()=>{Wi(t.resourcesBaseUrl,i.src,"Theme resource",{shouldCrash:!1})}))}))}return s};let Nt=0;const Gt=()=>{const t=Date.now().toString(36),i=(1048575&Nt++).toString(36);return`${t}-${Math.floor(4294967295*Math.random()).toString(36)}-${i}`},$t="undefined"!=typeof window?window:"undefined"!=typeof global&&global._lcjs?global._lcjs:{},Ut=(t,i)=>t.x===i.x&&t.y===i.y,jt=t=>t!==ns&&t!==os&&!Number.isNaN(t)&&Number.isFinite(t)&&t!==1/0&&t!==-1/0,Yt=t=>t[1],Ht=t=>t.dispose(),Wt=()=>{},Xt=(t,i)=>t===i,Zt=(t,i,s)=>s>i?Math.min(Math.max(t,i),s):Math.min(Math.max(t,s),i),Jt=t=>Array.prototype.concat.apply([],t),Qt=(t,i)=>void 0===t||Number.isNaN(t)?i:t,Kt=t=>t.Wi(),qt=t=>t.Xi(),ti=t=>t.Zi(),ii=t=>t.Ji(),si=t=>t.min.x,ei=t=>t.max.x,ri=t=>t.min.y,hi=t=>t.max.y,ni=(t,i,s,e,r)=>{if(t.length>0){let h=r?e(r):void 0;for(let e=0;e<t.length;e+=1){const r=i(t[e]);void 0!==r&&(h=void 0!==h?s(h,r):r)}return h}if(r)return e(r)},oi=a(0,1),ai=a(1,0),li=a(0,-1),ui=a(-1,0),ci=a(0,0),di=t=>{switch(t){case exports.UIDirections.Up:return oi;case exports.UIDirections.Right:return ai;case exports.UIDirections.Down:return li;case exports.UIDirections.Left:return ui;default:return ci}},fi=t=>t===exports.UIDirections.Left||t===exports.UIDirections.Right,Ai=t=>{t.stopPropagation(),t.preventDefault()},gi=(t,i)=>{if(!i)return t;const s=t.length,e=new Float32Array(2*s);let r=0;for(let i=0;i<s;i+=1){const s=t[i],h=Math.fround(s);e[r+0]=h,e[r+1]=s-h,r+=2}return e},pi=(t,i,s=Float32Array)=>{if(!i){const i=t.length,e=new s(2*i);let r=0;for(let s=0;s<i;s+=1){const i=t[s];e[r+0]=i.x,e[r+1]=i.y,r+=2}return e}const e=t.length,r=new s(4*e);let h=0;for(let i=0;i<e;i+=1){const s=t[i],e=Math.fround(s.x),n=Math.fround(s.y);r[h+0]=e,r[h+1]=n,r[h+2]=s.x-e,r[h+3]=s.y-n,h+=4}return r},vi=(t,i)=>{if(!i){const i=t.length,s=new Float32Array(3*i);let e=0;for(let r=0;r<i;r+=1){const i=t[r];s[e+0]=i.x,s[e+1]=i.y,s[e+2]=i.z,e+=3}return s}const s=t.length,e=new Float32Array(6*s);let r=0;for(let i=0;i<s;i+=1){const s=t[i],h=Math.fround(s.x),n=Math.fround(s.y),o=Math.fround(s.z);e[r+0]=h,e[r+1]=n,e[r+2]=o,e[r+3]=s.x-h,e[r+4]=s.y-n,e[r+5]=s.z-o,r+=6}return e},yi=(t,i,s,e,r)=>t||i||s||e?!t||i||s||e||r?t||!i||s||e||r?t||i||!s||e||r?t||i||s||!e||r?(h,n,o)=>{const a=3+(r?3:0)+(t?4:0)+(i?1:0)+(s?1:0)+(e?3:0),l=h.length,u=new Float32Array(l*a);let c=0,d=c;if(r){for(let t=0;t<l;t+=1){const i=h[t],s=Math.fround(i.x),e=Math.fround(i.y),r=Math.fround(i.z);u[d+0]=s,u[d+1]=e,u[d+2]=r,u[d+3]=i.x-s,u[d+4]=i.y-e,u[d+5]=i.z-r,d+=a}c+=6}else{for(let t=0;t<l;t+=1){const i=h[t];u[d+0]=i.x,u[d+1]=i.y,u[d+2]=i.z,d+=a}c+=3}if(t){const t=o&&ve(o)&&o.getFallbackColor()||C;d=c;for(let i=0;i<l;i+=1){const s=h[i].color||t;u[d+0]=s.r,u[d+1]=s.g,u[d+2]=s.b,u[d+3]=s.a,d+=a}c+=4}if(i){const t=n&&n.getSize();let i=1;"number"==typeof t&&(i=t),d=c;for(let t=0;t<l;t+=1){const s=h[t],e=void 0!==s.size?s.size:i;u[d+0]=e,d+=a}c+=1}if(s){d=c;for(let t=0;t<l;t+=1){const i=h[t];u[d+0]=void 0!==i.value?i.value:It,d+=a}c+=1}if(e){const t=n&&n.getSize();let i={x:1,y:1,z:1};"object"==typeof t&&(i=t),d=c;for(let t=0;t<l;t+=1){const s=h[t],e=void 0!==s.sizeAxisX?s.sizeAxisX:i.x,r=void 0!==s.sizeAxisY?s.sizeAxisY:i.y,n=void 0!==s.sizeAxisZ?s.sizeAxisZ:i.z;u[d+0]=e,u[d+1]=r,u[d+2]=n,d+=a}c+=3}return u}:(t,i,s)=>mi(t,i):(t,i,s)=>bi(t):(t,i,s)=>Si(t,i):(t,i,s)=>xi(t,s):(t,i,s)=>vi(t,r),mi=(t,i)=>{const s=i&&i.getSize();let e={x:1,y:1,z:1};"object"==typeof s&&(e=s);const r=t.length,h=new Float32Array(6*r);let n=0;for(let i=0;i<r;i+=1){const s=t[i];h[n+0]=s.x,h[n+1]=s.y,h[n+2]=s.z;const r=void 0!==s.sizeAxisX?s.sizeAxisX:e.x,o=void 0!==s.sizeAxisY?s.sizeAxisY:e.y,a=void 0!==s.sizeAxisZ?s.sizeAxisZ:e.z;h[n+3]=r,h[n+4]=o,h[n+5]=a,n+=6}return h},xi=(t,i)=>{const s=i&&ve(i)&&i.getFallbackColor()||C,e=t.length,r=new Float32Array(7*e);for(let i=0,h=0;i<e;i+=1){const e=t[i];r[h+0]=e.x,r[h+1]=e.y,r[h+2]=e.z;const n=e.color||s;r[h+3]=n.r,r[h+4]=n.g,r[h+5]=n.b,r[h+6]=n.a,h+=7}return r},Si=(t,i)=>{const s=i&&i.getSize();let e=1;"number"==typeof s&&(e=s);const r=t.length,h=new Float32Array(4*r);for(let i=0,s=0;i<r;i+=1){const r=t[i];h[s+0]=r.x,h[s+1]=r.y,h[s+2]=r.z;const n=void 0!==r.size?r.size:e;h[s+3]=n,s+=4}return h},bi=t=>{const i=t.length,s=new Float32Array(4*i);for(let e=0,r=0;e<i;e+=1){const i=t[e];s[r+0]=i.x,s[r+1]=i.y,s[r+2]=i.z,s[r+3]=void 0!==i.value?i.value:It,r+=4}return s},Mi=t=>i=>{const s=t.indexOf(i);s>=0&&t.splice(s,1)},_i=(t,i,s)=>{const e=((t,i)=>{if(i<ns&&i>os&&t<ns&&t>os){const s=Math.abs(t/2**23),e=Math.abs(i/2**23),r=Math.min(s,e);return 10**Math.floor(Math.log10(r))}})(t,i);if(void 0!==e)return e*s},wi=t=>{let i=t.length;for(let s=0;s<i-1;s+=1)t[s].x===t[s+1].x&&t[s].y===t[s+1].y&&(t.splice(s,1),s-=1,i-=1);return t},ki=t=>{const i=Math.log(t);return t=>Math.log(t)/i},Ci=ki(Math.E),Ti=(t,i)=>{const s=i[t];return s?s():void 0},Fi=(t,i)=>{let s;if(i)s=i;else{const i={x:0,y:0};for(let s=0;s<t.length;s+=1)i.x+=t[s].x/t.length,i.y+=t[s].y/t.length;s=i}return t.sort(((t,i)=>Us(Rs(t,s))-Us(Rs(i,s))))},Ii=(t,i,s)=>{if(0===t.length)return!1===s.canReturnB?i.slice():i;const e=i.length;if(e<1e5)return t.push.apply(t,i),t;for(let s=0;s<e;s+=1)t.push(i[s]);return t},Pi=t=>255===t.getA()?t:t.setA(255),Li=(()=>{const t=b(0,0,0);return i=>(i=Pi(i),new N({angle:180,stops:[{offset:0,color:i},{offset:1,color:nt(i,t,.5)}]}))})(),Bi=(()=>{const t=(t,i)=>{var s;if(t){if(ge(t)){if(0===t.getColor().getA())return;return t.getColor()}if(z(t)||G(t)){const i=t.getColorStops();return 2===i.length?i[1].color:null===(s=i[0])||void 0===s?void 0:s.color}return xe(t)&&void 0!==i?t.lut.getColors(i,void 0):void 0}};return(i,s,e)=>{var r;const h=[];if(e.fill&&h.push(e.fill),e.fill2&&h.push(e.fill2),e.stroke){const t=e.stroke.getFillStyle();t!==ue&&("stroke"===(null===(r=e.behavior)||void 0===r?void 0:r.priority)?h.unshift(t):h.push(t))}if(e.point3D){const t=e.point3D;h.push(t.getFillStyle())}let n;if(e.behavior&&!0===e.behavior.colorStep){const[s,r]=h.reduce(((i,s)=>{if(i[0]&&i[1])return i;const r=t(s,e.lutValue);return r&&(void 0===i[0]?i[0]=r:i[1]=r),i}),[void 0,void 0]);n=s&&r?(o=s)===(a=r)||o.getR()===a.getR()&&o.getG()===a.getG()&&o.getB()===a.getB()?Li(o):(o=Pi(o),a=Pi(a),new N({angle:0,stops:[{offset:0,color:a},{offset:.5,color:a},{offset:.5,color:o},{offset:1,color:o}]})):i.uiButtonFillStyle}else{const r=h.reduce(((i,s)=>i||t(s,e.lutValue)),void 0);n=r?s?new Ae({color:r}):Li(r):i.uiButtonFillStyle}var o,a;return n}})(),Di=(t,i)=>{const s=t;if(xe(s))return{lut:s.getPalette(),lookUpProperty:s.getLookUpProperty(),valueRange:i}},Ei=t=>{let i=0;return()=>(i+=1,`${t}-${i}`)},Ri=(t,i)=>{let s="string"==typeof t?t:String(t);const e=s.indexOf(".");let r=e>=0?e:s.length;for(;r<i;r+=1)s=`0${s}`;return s},Oi=(t,i)=>"function"==typeof t?t(i):t,zi=(t,i)=>i(),Vi=()=>new Error("LightningChart JS encountered an unexpected error.\nPlease report this issue to https://lightningchart.com/js-charts/docs/contact"),Ni=t=>t===as||t.min.x===as.min.x&&t.max.x===as.max.x&&t.min.y===as.min.y&&t.max.y===as.max.y,Gi=t=>Array.from(new Set(t)),$i=t=>t.filter((t=>void 0!==t)),Ui=t=>"boolean"==typeof t?t?1:0:t>1?1:t<0?0:t,ji=(t,i)=>{throw new Error(i)},Yi=t=>{let i;return()=>i||(i=t(),i)},Hi=t=>{if(t===Tt)return 0;const i=t.getThickness();return i<0?1:1*i},Wi=(t,i,s,e)=>{const r=`LightningChart JS Resources not found.\nresourcesBaseUrl: "${t}"\ninitiator: ${s}\nresource url: ${i}\nFor more information, please see https://lightningchart.com/js-charts/docs/troubleshooting/error-resources-not-found/`;if(e.shouldCrash)throw $t.alert(r),new Error(r);$t.console.warn(r)},Xi=(t,i,s,e=0)=>{if(t<s(e)||s(i)<t)return;const r=i;for(;e!==i;){const r=Math.ceil((e+i)/2);t<s(r)?i=r-1:e=r}const h=Math.abs(t-s(e));return e<r&&Math.abs(t-s(e+1))<h?e+1:e},Zi=()=>{const t=new Map;return{Qi:i=>(Object.keys(vt).forEach((s=>{i.addEventListener(s,((i,e)=>{const r=e.collectionMember&&t.get(e.collectionMember);if(!r)return;const h=mt(i)?{clientX:i.changedTouches[0].clientX,clientY:i.changedTouches[0].clientY}:i,n=r.Ki(e.info,h,e.collectionMember);r.R.O(s,i,n)}))})),i),qi:(i,s)=>{t.set(i,s)},Ni:()=>{t.clear()}}},Ji={left:0,right:0,top:0,bottom:0},Qi=()=>Math.round(Math.random()*Number.MAX_SAFE_INTEGER),Ki=(t,i,s)=>{i&&i.ts();const e=s();return Object.keys(e).forEach((i=>{const s=i,r=e[s];t.addEventListener(s,r)})),{es:t,ts:()=>{Object.entries(e).forEach((([i,s])=>{const e=i,r=s;t.removeEventListener(e,r)}))}}},qi=(t,i,s)=>{let e;const r=()=>(e=s(),e),h={...t,resolve:()=>e||r()};for(const t of Object.keys(i))Object.defineProperty(h,t,{get:function(){return e?e[t]:r()[t]}});return h},ts=t=>{if(t)return"resolve"in t?t.resolve():t},is=t=>{let i=t;return{rs:t=>{const s=i;return i=s+t,[s,t]}}},ss=t=>{const i=Date.now();$t.document.body.addEventListener(t,(t=>{Date.now()-i>500||(t.stopPropagation(),t.preventDefault())}),{once:!0,capture:!0})},es=()=>{const t=$t.performance.now();$t.document.body.addEventListener("contextmenu",(i=>{$t.performance.now()-t>5e3||i.preventDefault()}),{once:!0})},rs=()=>{const t=$t.performance.now();$t.document.body.addEventListener("touchstart",(i=>{$t.performance.now()-t>5e3||i.preventDefault()}),{once:!0})},hs={add:(t,i)=>c(t.x+i,t.y+i,t.z+i),addVec(t,...i){const s={x:t.x,y:t.y,z:t.z};for(const t of i)s.x+=t.x,s.y+=t.y,s.z+=t.z;return s},subtract:(t,i)=>c(t.x-i,t.y-i,t.z-i),subtractVec(t,...i){const s={x:t.x,y:t.y,z:t.z};for(const t of i)s.x-=t.x,s.y-=t.y,s.z-=t.z;return s},multiply:(t,i)=>c(t.x*i,t.y*i,t.z*i),divide:(t,i)=>c(t.x/i,t.y/i,t.z/i),multiplyVec(t,...i){const s={x:t.x,y:t.y,z:t.z};for(const t of i)s.x*=t.x,s.y*=t.y,s.z*=t.z;return s},divideVec(t,...i){const s={x:t.x,y:t.y,z:t.z};for(const t of i)s.x/=t.x,s.y/=t.y,s.z/=t.z;return s},length:t=>Math.sqrt(t.x*t.x+t.y*t.y+t.z*t.z),normalize:t=>hs.divide(t,hs.length(t)),dot:(t,i)=>t.x*i.x+t.y*i.y+t.z*i.z,cross:(t,i)=>c(t.y*i.z-t.z*i.y,t.z*i.x-t.x*i.z,t.x*i.y-t.y*i.x),angle:(t,i)=>Math.acos(hs.dot(t,i)/(hs.length(t)*hs.length(i))),rotateAroundAxis(t,i,s){const e=Math.cos(s),r=Math.sin(s),h=hs.dot(i,t),n=hs.cross(i,t);return hs.addVec(hs.multiply(t,e),hs.addVec(hs.multiply(i,(1-e)*h),hs.multiply(n,r)))},lerp:(t,i,s)=>(s=Zt(s,0,1),hs.addVec(hs.multiply(t,1-s),hs.multiply(i,s))),equals:(t,i)=>Xt(t.x,i.x)&&Xt(t.y,i.y)&&Xt(t.z,i.z),abs:t=>({x:Math.abs(t.x),y:Math.abs(t.y),z:Math.abs(t.z)}),sign:t=>({x:Math.sign(t.x),y:Math.sign(t.y),z:Math.sign(t.z)})},ns=Number.MAX_VALUE,os=-Number.MAX_VALUE,as=f(a(ns,ns),a(os,os)),ls=f(c(ns,ns,ns),c(os,os,os)),us=(t,i)=>{const s=Math.log(t)/Math.log(i);return Math.floor((t=>(Math.ceil(t)-t<1e-4?t=Math.ceil(t):t-Math.floor(t)<1e-4&&(t=Math.floor(t)),t))(s))},cs=(t,i)=>!(i.min.x>t.max.x||i.max.x<t.min.x||i.min.y>t.max.y||i.max.y<t.min.y),ds=(t,i)=>!(t[1].x<i[0].x||t[0].x>i[1].x||t[3].y<i[0].y||t[0].y>i[3].y),fs=(t,i)=>({min:{x:Math.min(t[0].x,i[0].x),y:Math.min(t[0].y,i[0].y)},max:{x:Math.max(t[2].x,i[2].x),y:Math.max(t[2].y,i[2].y)}}),As=t=>{const i=t.length;for(let s=0;s<i;s+=1)for(let e=s+1;e<i;e+=1)if(cs(t[s],t[e]))return!0;return!1},gs=(t,i)=>i+t,ps=(t,i,s)=>{const e=Rs(i,t),r=e.x*e.x+e.y*e.y;if(0===r)return t;const h=Rs(s,t),n=(h.x*e.x+h.y*e.y)/r;return n<=0?t:n>=1?i:a(t.x+n*e.x,t.y+n*e.y)},vs=(t,i,s)=>s>i?t>=i&&t<=s:t>=s&&t<=i,ys=(t,i)=>{const s=t.x-i.x,e=t.y-i.y;return Math.sqrt(s*s+e*e)},ms=(t,i)=>{const s=t.x-i.x,e=t.y-i.y;return s*s+e*e},xs=(t,i,s)=>{let e=s.x-i.x,r=s.y-i.y;const h=e*e+r*r;if(h<.01)return Number.MAX_VALUE;const n=((t.x-i.x)*e+(t.y-i.y)*r)/h,o=i.x+n*e,a=i.y+n*r;return e=t.x-o,r=t.y-a,e*e+r*r},Ss=(t,i,s)=>Es(t,Ds(Rs(i,t),s)),bs=(t,i,s)=>hs.addVec(t,hs.multiply(hs.subtractVec(i,t),s));function Ms(t){const i=t.length;if(i>0){let s=t[0].x,e=t[0].x,r=t[0].y,h=t[0].y;for(let n=1;n<i;n+=1){const i=t[n];i.x>s&&(s=i.x),i.x<e&&(e=i.x),i.y>r&&(r=i.y),i.y<h&&(h=i.y)}return f(a(e,h),a(s,r))}return as}function _s(t){const i=t.length;if(i>0){let s=t[0].x,e=t[0].x,r=t[0].y,h=t[0].y,n=t[0].z,o=t[0].z;for(let a=0;a<i;a+=1){const i=t[a];i.x>s&&(s=i.x),i.x<e&&(e=i.x),i.y>r&&(r=i.y),i.y<h&&(h=i.y),i.z>n&&(n=i.z),i.z<o&&(o=i.z)}return f(c(e,h,o),c(s,r,n))}return ls}const ws=(...t)=>{const i={min:{x:ns,y:ns},max:{x:os,y:os}};for(const s of t)i.min.x=i.min.x<s.min.x?i.min.x:s.min.x,i.max.x=i.max.x>s.max.x?i.max.x:s.max.x,i.min.y=i.min.y<s.min.y?i.min.y:s.min.y,i.max.y=i.max.y>s.max.y?i.max.y:s.max.y;return i},ks=(t,i)=>f(c(t.min.x<i.min.x?t.min.x:i.min.x,t.min.y<i.min.y?t.min.y:i.min.y,t.min.z<i.min.z?t.min.z:i.min.z),c(t.max.x>i.max.x?t.max.x:i.max.x,t.max.y>i.max.y?t.max.y:i.max.y,t.max.z>i.max.z?t.max.z:i.max.z));function Cs(t,i,s,e){const r=t.x-e.x,h=t.y-e.y,n=e.x-s.x,o=s.y-e.y,a=o*r+n*h,l=(e.y-i.y)*r+(i.x-e.x)*h,u=o*(i.x-e.x)+n*(i.y-e.y);return u<0?a<=0&&l<=0&&a+l>=u:a>=0&&l>=0&&a+l<=u}const Ts=(t,i,s)=>!(t.x>s.x||t.y>s.y||t.x<i.x||t.y<i.y);function Fs(t,i,s){return a(Math.cos(s)*(t.x-i.x)+Math.sin(s)*(t.y-i.y)+i.x,-Math.sin(s)*(t.x-i.x)+Math.cos(s)*(t.y-i.y)+i.y)}function Is(t,i){return a(t.x-i.x,t.y-i.y)}function Ps(t){const i=Bs(t);return 0===i?a(0,0):a(t.x/i,t.y/i)}function Ls(t,i){let s={x:i.x-t.x,y:i.y-t.y};s=Ps(s);const e=Math.PI/2,r=s.x;return s.x=-Math.sin(e)*s.y,s.y=r*Math.sin(e),s}function Bs(t){return Math.sqrt(t.x*t.x+t.y*t.y)}function Ds(t,i){return a(t.x*i,t.y*i)}function Es(t,i){return a(t.x+i.x,t.y+i.y)}function Rs(t,i){return a(t.x-i.x,t.y-i.y)}function Os(t,i){return a(t.x*i.x,t.y*i.y)}function zs(t,i){return a(t.x/i.x,t.y/i.y)}function Vs(t){return Ds(t,-1)}function Ns(t,i){return t.x*i.x+t.y*i.y}const Gs=(t,i,s)=>{const e=(s.y-i.y)/(s.x-i.x),r=i.y+(t-i.x)*e;return a(t,r)};function $s(t){return t*Math.PI/180}function Us(t){return 180*Math.atan2(t.y,t.x)/Math.PI}function js(t){return a(Math.cos(t),Math.sin(t))}const Ys=(t,i,s,e)=>{let r,h,n,o;if(i.x-t.x!=0||e.x-s.x!=0)return i.x-t.x==0?(n=i.x,h=(e.y-s.y)/(e.x-s.x),o=h*(n-s.x)+s.y):e.x-s.x==0?(n=e.x,r=(i.y-t.y)/(i.x-t.x),o=r*(n-t.x)+t.y):(r=(i.y-t.y)/(i.x-t.x),h=(e.y-s.y)/(e.x-s.x),n=(s.y-h*s.x+r*t.x-t.y)/(r-h),o=r*(n-t.x)+t.y),a(n,o)},Hs=(t,i)=>{const s=t.length,e=i.length,r=new Uint16Array(s+e);return r.set(t,0),r.set(i,s),r};class Ws extends Y{constructor(t,i,s,e){super(t,i,s,e),this.hs={internal:10,function:Xs(10),number:10},this.Y=1e3,this.J(1,1e3),this.et=this.ns()}ot(t,i,s,e,r){if(t===i)return!1;const h=Math.min(t,i)<Js,n=Math.max(t,i)>Qs;return!h&&!n||!!r&&(i>t?{start:h?Js:t,end:n?Qs:i}:{start:n?Qs:t,end:h?Js:i})}Ot(t){const i=this.kt(),s=this.Ct(),e=Math.max(t,Js);return i+(this.hs.function(e)-this.et.scaleStartLog)/this.et.scaleIntervalLog*(s-i)}zt(t){const i=this.kt(),s=(t-i)/(this.Ct()-i),e=this.et.scaleStartLog+s*this.et.scaleIntervalLog;return this.hs.number**e}Bt(){this.hs&&this.ns()}J(t,i){return super.J(t,i),this.hs&&this.ns(),this}wt(t){return super.wt(t),this.hs&&this.ns(),this}q(t){return super.q(t),this.hs&&this.ns(),this}ls(t){return this.hs={internal:t,function:Xs(t),number:Zs(t)},this}us(){return this.hs.internal}Kt(t,i){const s=this.Ot(t)+i;return this.zt(s)}Rt(){return this.dt||this.ut||this.At||this.ct}ns(){const t=this.hs.function(this.U),i=this.hs.function(this.j)-t,s=2*this.kt()/this.Y-1,e=2*this.Ct()/this.Y-1-s;return this.et={scaleStartLog:t,scaleIntervalLog:i,viewportStart:s,viewportSize:e},this.et}nt(){return this.et}}const Xs=t=>"e"===t?Ci:ki(t),Zs=t=>"e"===t?Math.E:t,Js=.9*10**-20,Qs=1.1*10**25,Ks=[{prefix:"T",unit:10**12},{prefix:"B",unit:10**9},{prefix:"M",unit:1e6},{prefix:"K",unit:1e3}],qs=(t,i,s)=>{const e=Math.abs(s-i);if(0===e)return t.toFixed(0);const r=Math.max(2-us(e,10),0);return t.toFixed(r)},te={Numeric:(t,i)=>{const{start:s,end:e}=i;return qs(t,s,e)},NumericUnits:(t,i)=>{const{start:s,end:e}=i,r=Math.abs(e-s),h=t<0;t=Math.abs(t);let n="",o="";if(r>=1e3&&t>1e3){let i="";for(const s of Ks){const e=Math.round(1e3*t/s.unit)/1e3;if(e>=1){i=e.toString(),o=s.prefix;break}}n=(h?"-":"")+i}else{let i=String(Math.floor(t));const s=us(t,1e3);for(let t=1;t<=s;t+=1){const s=i.length-(3*t+(t-1));i=`${i.substring(0,s)} ${i.substring(s,i.length)}`}n=(h?"-":"")+i+(r<=10?((t,i)=>{if(0===i)return"";let s=(Math.abs(t)-Math.abs(Math.floor(t))).toString().substring(1);return s.length>i&&(s=s.substring(0,i+1)),s})(t,2-us(r,10)):"")}return n+=o,n},LogarithmicExponentsRounded:(t,i,s,e=10)=>{const r=Xs(e)(t);return`${e}${ie(r)}`},LogarithmicExponents:(t,i,s,e=10)=>{const r=Xs(e),h=Math.floor(r(t)),n=t/Zs(e)**h;return`${Math.round(n)}×${e}${ie(h)}`},LogarithmicExtreme:(t,i,s,e=10)=>{const r=Xs(e),h=Math.floor(r(t));return`${(t/Zs(e)**h).toFixed(2)}×${e}${ie(h)}`},LogarithmicNoExponents:(t,i,s,e=10)=>{const r=Xs(e);if("e"===e)return`${Math.floor(r(t))}e`;const h=t.toString();if(t>1)return h;const n=Math.floor(r(t));return t.toFixed(Math.abs(n))},Scientific:(t,i)=>{const{start:s,end:e}=i,r=Math.max(Math.abs(s),Math.abs(e)),h=Math.floor(Math.log10(r));return 0===t?`0.00e${h<0?"":"+"}${h}`:t.toExponential(2)}},ie=t=>Math.round(t).toString().split("").map((t=>{switch(t){case"0":return"⁰";case"1":return"¹";case"2":return"²";case"3":return"³";case"4":return"⁴";case"5":return"⁵";case"6":return"⁶";case"7":return"⁷";case"8":return"⁸";case"9":return"⁹";case"-":return"⁻";default:return t}})).join(""),se=(t,i)=>t.value-i.value,ee=t.Record({type:"lut",steps:[],title:"",units:"",interpolate:!0,color:b(0,0,0,255),length:0,min:0,max:0,subranges:[],isValid:!1,percentageValues:!1,formatter:(t,i)=>qs(t,i.min,i.max)}),re=t=>{const{steps:i}=t,s=i.length;i.sort(se);const[e,r]=s>0?[i[0].value,i[s-1].value]:[0,0],h=s>0?s-1:0,n=Array(h);for(let t=0;t<h;t+=1)n[t]={min:i[t],max:i[t+1]};return{min:e,max:r,length:s,steps:i,subranges:n,isValid:s>0&&e!==r}};class he extends ee{constructor(t){super(((t,i)=>({steps:t.steps,title:t.title,units:t.units,interpolate:t.interpolate,percentageValues:t.percentageValues,color:t.color,formatter:t.formatter,length:i.length,min:i.min,max:i.max,subranges:i.subranges,isValid:i.isValid}))(t,re(t)))}toString(){return`LUT:interpolate=${this.interpolate},steps=${this.steps.length},percentage=${this.percentageValues}`}setSteps(t){return this.merge(re({...this,steps:t}))}getSteps(){return this.get("steps")}setTitle(t){return this.set("title",t)}getTitle(){return this.get("title")}setUnits(t){return this.set("units",t)}getUnits(){return this.get("units")}setInterpolation(t){return this.set("interpolate",t)}getInterpolation(){return this.get("interpolate")}setFallbackColor(t){return this.set("color",t)}getFallbackColor(){return this.get("color")}setPercentageValues(t){return this.set("percentageValues",t)}getPercentageValues(){return this.get("percentageValues")}setFormatter(t){return this.set("formatter",t)}getFormatter(){return this.get("formatter")}getColors(t,i){if(Array.isArray(t)){if(Array.isArray(t[0])){const s=t,e=s.length,r=s[0].length,h=[...Array(e)].map((()=>Array(r)));for(let t=0;t<e;t+=1)for(let e=0;e<r;e+=1)h[t][e]=this.fs(s[t][e],i);return h}const s=t,e=s.length,r=Array(e);for(let t=0;t<e;t+=1)r[t]=this.fs(s[t],i);return r}return this.fs(t,i)}fs(t,i){const{steps:s}=this,e=s.length;if(0===e)return this.getFallbackColor();if(1===e)return s[0].color||this.color;if(this.percentageValues,this.percentageValues&&i&&(t=Math.max(Math.min((t-i.min)/(i.max-i.min),1),0)),this.interpolate){for(let i=0;i<e-1;i+=1){const e=s[i],o=s[i+1],a=Math.min(e.value,o.value),l=Math.max(e.value,o.value);if(t>=a&&t<=l){if(a===l)return e.color;const i=(t-e.value)/(o.value-e.value);return r=e.color,h=o.color,n=i,new x({r:r.r+(h.r-r.r)*n,g:r.g+(h.g-r.g)*n,b:r.b+(h.b-r.b)*n,a:r.a+(h.a-r.a)*n})}}return t<s[0].value?s[0].color:s[e-1].color}var r,h,n;for(let i=e-1;i>=0;i-=1)if(t>=s[i].value)return s[i].color;r