"use strict";(self["webpackChunkplatypush"]=self["webpackChunkplatypush"]||[]).push([[8448],{634:function(e,t,n){n.d(t,{N:function(){returnl}});vari=n(9584);n(1703);functiono(e,t){if(!(einstanceoft))thrownewTypeError("Cannot call a class as a function")}functionr(e,t){for(varn=0;n<t.length;n++){vari=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"ini&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}functiona(e,t,n){returnt&&r(e.prototype,t),n&&r(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}n(7941),n(6977),n(1249),n(2222),n(7042),n(9600),n(1539),n(9714);varl=function(){functione(t){if(o(this,e),this.ranges={hue:[0,360],sat:[0,100],bri:[0,100],ct:[154,500]},t)for(varn=0,i=Object.keys(this.ranges);n<i.length;n++){varr=i[n];t[r]&&(this.ranges[r]=t[r])}}returna(e,[{key:"normalize",value:function(e,t,n){returnn[0]+(e-t[0])*(n[1]-n[0])/(t[1]-t[0])}},{key:"hslToRgb",value:function(e,t,n){vari=[this.normalize(e,this.ranges.hue,[0,360]),this.normalize(t,this.ranges.sat,[0,100]),this.normalize(n,this.ranges.bri,[0,100])];e=i[0],t=i[1],n=i[2],n/=100;varo=t*Math.min(n,1-n)/100,r=function(t){vari=(t+e/30)%12,r=n-o*Math.max(Math.min(i-3,9-i,1),-1);returnMath.round(255*r)};return[r(0),r(8),r(4)]}},{key:"rgbToHsl",value:function(e,t,n){e/=255,t/=255,n/=255;vari,o,r=Math.max(e,t,n),a=Math.min(e,t,n),l=(r+a)/2;if(r===a)i=o=0;else{vars=r-a;switch(o=l>.5?s/(2-r-a):s/(r+a),r){casee:i=(t-n)/s+(t<n?6:0);break;caset:i=(n-e)/s+2;break;casen:i=(e-t)/s+4;break}i/=6}return[parseInt(this.normalize(i,[0,1],this.ranges.hue)),parseInt(this.normalize(o,[0,1],this.ranges.sat)),parseInt(this.normalize(l,[0,1],this.ranges.bri))]}},{key:"xyToRgb",value:function(e,t,n){null==n&&(n=this.ranges.bri[1]);vari=1-e-t,o=(n/(this.ranges.bri[1]-1)).toFixed(2),r=o/t*e,a=o/t*i,l=1.656492*r-.354851*o-.255038*a,s=.707196*-r+1.655397*o+.036152*a,u=.051713*r-.121364*o+1.01153*a;returnl>u&&l>s&&l>1?(s/=l,u/=l,l=1):s>u&&s>l&&s>1?(l/=s,u/=s,s=1):u>l&&u>s&&u>1&&(l/=u,s/=u,u=1),l=l<=.0031308?12.92*l:1.055*Math.pow(l,1/2.4)-.055,s=s<=.0031308?12.92*s:1.055*Math.pow(s,1/2.4)-.055,u=u<=.0031308?12.92*u:1.055*Math.pow(u,1/2.4)-.055,l=Math.round(255*l),s=Math.round(255*s),u=Math.round(255*u),isNaN(l)&&(l=0),isNaN(s)&&(s=0),isNaN(u)&&(u=0),[l,s,u].map((function(e){returnMath.min(Math.max(0,e),255)}))}},{key:"rgbToXY",value:function(e,t,n){e>1&&(e/=255),t>1&&(t/=255),n>1&&(n/=255),e=e>.04045?Math.pow((e+.055)/1.055,2.4):e/12.92,t=t>.04045?Math.pow((t+.055)/1.055,2.4):t/12.92,n=n>.04045?Math.pow((n+.055)/1.055,2.4):n/12.92;vari=.664511*e+.154324*t+.162028*n,o=.283881*e+.668433*t+.047685*n,r=88e-6*e+.07231*t+.986039*n,a=parseFloat((i/(i+o+r)).toFixed(4)),l=parseFloat((o/(i+o+r)).toFixed(4));returnisNaN(a)&&(a=0),isNaN(l)&&(l=0),[a,l]}},{key:"rgbToBri",value:function(e,t,n){returnMath.min(2*this.rgbToHsl(e,t,n)[2],this.ranges.bri[1])}},{key:"getRGB",value:function(e){returnnull!=e.red&&null!=e.green&&null!=e.blue?[e.red,e.green,e.blue]:null!=e.r&&null!=e.g&&null!=e.b?[e.r,e.g,e.b]:e.rgb?e.rgb:void0}},{key:"getXY",value:function(e){returnnull!=e.x&&null!=e.y?[e.x,e.y]:e.xy?e.xy:void0}},{key:"toRGB",value:function(e){vart=this.getRGB(e);if(t)returnt;varn=this.getXY(e);returnn&&e.bri?this.xyToRgb.apply(this,(0,i.Z)(n).concat([e.bri])):e.hue&&e.sat&&e.bri?this.hslToRgb(e.hue,e.sat,e.bri):(console.debug("Could not determine color space"),voidconsole.debug(e))}},{key:"toXY",value:function(e){vart=this.getXY(e);if(t&&e.bri)return[t[0],t[1],e.bri];varn=this.getRGB(e);if(n)returnthis.rgbToXY.apply(this,(0,i.Z)(n));if(e.hue&&e.sat&&e.bri){varo=this.hslToRgb(e.hue,e.sat,e.bri);returnthis.rgbToXY.apply(this,(0,i.Z)(o))}console.debug("Could not determine color space"),console.debug(e)}},{key:"toHSL",value:function(e){if(e.hue&&e.sat&&e.bri)return[e.hue,e.sat,e.bri];vart=this.getRGB(e);if(t)returnthis.rgbToHsl.apply(this,(0,i.Z)(t));varn=this.getXY(e);if(n&&e.bri){varo=this.xyToRgb.apply(this,(0,i.Z)(n).concat([e.bri]));returnthis.rgbToHsl.apply(this,(0,i.Z)(o))}console.debug("Could not determine color space"),console.debu