iobroker.lovelace
Version:
With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI
1 lines • 39.2 kB
JavaScript
"use strict";(self.rspackChunkhome_assistant_frontend=self.rspackChunkhome_assistant_frontend||[]).push([[92965],{77957:function(t,i,s){var e=s(76080),a=s(79504),n=s(47055),r=s(48981),o=s(56969),l=s(26198),h=s(2360),c=s(35370),d=Array,u=a([].push);t.exports=function(t,i,s,a){for(var p,_,g,f=r(t),v=n(f),P=e(i,s),m=h(null),y=l(v),w=0;y>w;w++)g=v[w],(_=o(P(g,w,f)))in m?u(m[_],g):m[_]=[g];if(a&&(p=a(f))!==d)for(_ in m)m[_]=c(p,m[_]);return m}},46058:function(t,i,s){var e=s(46518),a=s(77957),n=s(6469);e({target:"Array",proto:!0},{group:function(t){return a(this,t,arguments.length>1?arguments[1]:void 0)}}),n("group")},41780:function(t,i,s){s.d(i,{E:function(){return d}});s(16280),s(44114),s(3362),s(17642),s(58004),s(33853),s(45876),s(32475),s(15024),s(31698),s(88454),s(29452),s(62953);var e=s(35128),a=s(90500),n=s(53461),r=s(15620);function o(t,i,s){const e=i[s];var a;void 0!==e&&(t[s]=(null!==(a=t[s])&&void 0!==a?a:1)*e)}class l{get settings(){return this._contextSettings}canvasClear(){this._container.actualOptions.clear&&this.draw(t=>{(0,r.IU)(t,this._canvasManager.size)})}clear(){let t=!1;for(const e of this._canvasClearPlugins){var i,s;if(t=null!==(i=null===(s=e.canvasClear)||void 0===s?void 0:s.call(e))&&void 0!==i&&i,t)break}t||this.canvasClear()}destroy(){this.stop(),this._preDrawUpdaters=[],this._postDrawUpdaters=[],this._colorPlugins=[],this._canvasClearPlugins=[],this._canvasPaintPlugins=[],this._clearDrawPlugins=[],this._drawParticlePlugins=[],this._drawParticlesCleanupPlugins=[],this._drawParticlesSetupPlugins=[],this._drawPlugins=[],this._drawSettingsSetupPlugins=[],this._drawSettingsCleanupPlugins=[]}draw(t){const i=this._context;if(i)return t(i)}drawParticle(t,i){if(t.spawning||t.destroyed)return;const s=t.getRadius();if(s<=0)return;const e=t.getFillColor(),a=t.getStrokeColor();let[o,l]=this._getPluginParticleColors(t);if(null!=o||(o=e),null!=l||(l=a),!o&&!l)return;const h=this._container,c=t.options.zIndex,d=1-t.zIndexFactor,{fillOpacity:u,opacity:p,strokeOpacity:_}=t.getOpacity(),g=this._reusableTransform,f=this._reusableColorStyles,v=o?(0,n.LC)(o,h.hdr,u*p):void 0,P=l?(0,n.LC)(l,h.hdr,_*p):v;g.a=g.b=g.c=g.d=void 0,f.fill=v,f.stroke=P,this.draw(e=>{for(const s of this._drawParticlesSetupPlugins){var a;null===(a=s.drawParticleSetup)||void 0===a||a.call(s,e,t,i)}this._applyPreDrawUpdaters(e,t,s,p,f,g),(0,r.p0)({container:h,context:e,particle:t,delta:i,colorStyles:f,radius:s*d**c.sizeRate,opacity:p,transform:g}),this._applyPostDrawUpdaters(t);for(const s of this._drawParticlesCleanupPlugins){var n;null===(n=s.drawParticleCleanup)||void 0===n||n.call(s,e,t,i)}})}drawParticlePlugins(t,i){this.draw(s=>{for(const e of this._drawParticlePlugins)(0,r.Wb)(s,e,t,i)})}drawParticles(t){const{particles:i}=this._container;this.clear(),i.update(t),this.draw(s=>{for(const i of this._drawSettingsSetupPlugins){var e;null===(e=i.drawSettingsSetup)||void 0===e||e.call(i,s,t)}for(const i of this._drawPlugins){var a;null===(a=i.draw)||void 0===a||a.call(i,s,t)}i.drawParticles(t);for(const i of this._clearDrawPlugins){var n;null===(n=i.clearDraw)||void 0===n||n.call(i,s,t)}for(const i of this._drawSettingsCleanupPlugins){var r;null===(r=i.drawSettingsCleanup)||void 0===r||r.call(i,s,t)}})}init(){this.initUpdaters(),this.initPlugins(),this.paint()}initPlugins(){this._colorPlugins=[],this._canvasClearPlugins=[],this._canvasPaintPlugins=[],this._clearDrawPlugins=[],this._drawParticlePlugins=[],this._drawParticlesSetupPlugins=[],this._drawParticlesCleanupPlugins=[],this._drawPlugins=[],this._drawSettingsSetupPlugins=[],this._drawSettingsCleanupPlugins=[];for(const i of this._container.plugins){var t;(null!==(t=i.particleFillColor)&&void 0!==t?t:i.particleStrokeColor)&&this._colorPlugins.push(i),i.canvasClear&&this._canvasClearPlugins.push(i),i.canvasPaint&&this._canvasPaintPlugins.push(i),i.drawParticle&&this._drawParticlePlugins.push(i),i.drawParticleSetup&&this._drawParticlesSetupPlugins.push(i),i.drawParticleCleanup&&this._drawParticlesCleanupPlugins.push(i),i.draw&&this._drawPlugins.push(i),i.drawSettingsSetup&&this._drawSettingsSetupPlugins.push(i),i.drawSettingsCleanup&&this._drawSettingsCleanupPlugins.push(i),i.clearDraw&&this._clearDrawPlugins.push(i)}}initUpdaters(){this._preDrawUpdaters=[],this._postDrawUpdaters=[];for(const s of this._container.particleUpdaters){var t,i;s.afterDraw&&this._postDrawUpdaters.push(s),(null!==(t=null!==(i=s.getColorStyles)&&void 0!==i?i:s.getTransformValues)&&void 0!==t?t:s.beforeDraw)&&this._preDrawUpdaters.push(s)}}paint(){let t=!1;for(const e of this._canvasPaintPlugins){var i,s;if(t=null!==(i=null===(s=e.canvasPaint)||void 0===s?void 0:s.call(e))&&void 0!==i&&i,t)break}t||this.paintBase()}paintBase(t){this.draw(i=>{(0,r.Sn)(i,this._canvasManager.size,t)})}paintImage(t,i){this.draw(s=>{(0,r.Md)(s,this._canvasManager.size,t,i)})}setContext(t){this._context=t,this._context&&(this._context.globalCompositeOperation=a.yj)}setContextSettings(t){this._contextSettings=t}stop(){this.draw(t=>{(0,r.IU)(t,this._canvasManager.size)})}constructor(t,i,s){this._reusableColorStyles={},this._reusablePluginColors=[void 0,void 0],this._reusableTransform={},this._applyPostDrawUpdaters=t=>{for(const s of this._postDrawUpdaters){var i;null===(i=s.afterDraw)||void 0===i||i.call(s,t)}},this._applyPreDrawUpdaters=(t,i,s,e,a,n)=>{for(const l of this._preDrawUpdaters){var r;if(l.getColorStyles){const{fill:n,stroke:r}=l.getColorStyles(i,t,s,e);n&&(a.fill=n),r&&(a.stroke=r)}if(l.getTransformValues){const t=l.getTransformValues(i);for(const i in t)o(n,t,i)}null===(r=l.beforeDraw)||void 0===r||r.call(l,i)}},this._getPluginParticleColors=t=>{let i,s;for(const e of this._colorPlugins)if(!i&&e.particleFillColor&&(i=(0,n.R5)(this._pluginManager,e.particleFillColor(t))),!s&&e.particleStrokeColor&&(s=(0,n.R5)(this._pluginManager,e.particleStrokeColor(t))),i&&s)break;return this._reusablePluginColors[0]=i,this._reusablePluginColors[1]=s,this._reusablePluginColors},this._pluginManager=t,this._container=i,this._canvasManager=s,this._context=null,this._preDrawUpdaters=[],this._postDrawUpdaters=[],this._colorPlugins=[],this._canvasClearPlugins=[],this._canvasPaintPlugins=[],this._clearDrawPlugins=[],this._drawParticlePlugins=[],this._drawParticlesCleanupPlugins=[],this._drawParticlesSetupPlugins=[],this._drawPlugins=[],this._drawSettingsSetupPlugins=[],this._drawSettingsCleanupPlugins=[]}}const h=new WeakMap;function c(t,i,s=!1){if(!i)return;const e=t.style,a=new Set;for(let n=0;n<e.length;n++){const t=e.item(n);t&&a.add(t)}for(let n=0;n<i.length;n++){const t=i.item(n);t&&a.add(t)}for(const n of a){const t=i.getPropertyValue(n);t?e.setProperty(n,t,s?"important":""):e.removeProperty(n)}}class d{get _fullScreen(){return this._container.actualOptions.fullScreen.enable}destroy(){if(this.stop(),this._generated){const t=this.domElement;null==t||t.remove(),this.domElement=void 0,this.renderCanvas=void 0}else this._resetOriginalStyle();this.render.destroy(),this._resizePlugins=[]}getZoomCenter(){const t=this._container.retina.pixelRatio,{width:i,height:s}=this.size;return this._zoomCenter?this._zoomCenter:{x:.5*i/t,y:.5*s/t}}init(){this._safeMutationObserver(t=>{t.disconnect()}),this._mutationObserver=(0,e.tG)(t=>{for(const i of t)"attributes"===i.type&&"style"===i.attributeName&&this._repairStyle()}),this.resize(),this._initStyle(),this.initBackground(),this._safeMutationObserver(t=>{const i=this.domElement;i&&i instanceof Node&&t.observe(i,{attributes:!0})}),this.initPlugins(),this.render.init()}initBackground(){const{_container:t}=this,i=t.actualOptions.background,s=this.domElement;if(!s)return;const e=s.style,a=(0,n.BN)(this._pluginManager,i.color);e.backgroundColor=a?(0,n.xx)(a,t.hdr,i.opacity):"",e.backgroundImage=i.image||"",e.backgroundPosition=i.position||"",e.backgroundRepeat=i.repeat||"",e.backgroundSize=i.size||""}initPlugins(){this._resizePlugins=[];for(const t of this._container.plugins)t.resize&&this._resizePlugins.push(t)}loadCanvas(t){this._generated&&this.domElement&&this.domElement.remove();const i=this._container,s=(t=>"undefined"!=typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement)(t)?t:void 0;this.domElement=s,this._generated=!!s&&"true"===s.dataset[a.eb],this.renderCanvas=s?(t=>{const i=h.get(t);if(i)return i;if("function"!=typeof t.transferControlToOffscreen)throw new TypeError("OffscreenCanvas is required but not supported by this browser");try{const i=t.transferControlToOffscreen();return h.set(t,i),i}catch(s){throw new TypeError("OffscreenCanvas transfer failed")}})(s):t;const n=this.domElement;n&&(n.ariaHidden="true",this._originalStyle=(0,e.td)(n.style));const r=this._standardSize,o=this.renderCanvas;n?(r.height=n.offsetHeight,r.width=n.offsetWidth):(r.height=o.height,r.width=o.width);const l=this._container.retina.pixelRatio,c=this.size;o.height=c.height=r.height*l,o.width=c.width=r.width*l;const d=(0,e.lV)("(color-gamut: p3)");this.render.setContextSettings({alpha:!0,colorSpace:null!=d&&d.matches&&i.hdr?"display-p3":"srgb",desynchronized:!0,willReadFrequently:!1}),this.render.setContext(o.getContext("2d",this.render.settings)),this._safeMutationObserver(t=>{t.disconnect()}),i.retina.init(),this.initBackground(),this._safeMutationObserver(t=>{const i=this.domElement;i&&i instanceof Node&&t.observe(i,{attributes:!0})})}resize(){const t=this.domElement;if(!t)return!1;const i=this._container,s=this.renderCanvas;if(void 0===s)return!1;const e=i.canvas._standardSize,a={width:t.offsetWidth,height:t.offsetHeight},n=i.retina.pixelRatio,r={width:a.width*n,height:a.height*n};if(a.height===e.height&&a.width===e.width&&r.height===s.height&&r.width===s.width)return!1;const o=Object.assign({},e);e.height=a.height,e.width=a.width;const l=this.size;return s.width=l.width=r.width,s.height=l.height=r.height,this._container.started&&i.particles.setResizeFactor({width:e.width/o.width,height:e.height/o.height}),!0}setPointerEvents(t){this.domElement&&(this._pointerEvents=t,this._repairStyle())}setZoom(t,i){this.zoom=t,this._zoomCenter=i}stop(){this._safeMutationObserver(t=>{t.disconnect()}),this._mutationObserver=void 0,this.render.stop()}async windowResize(){if(!this.domElement||!this.resize())return;const t=this._container,i=t.updateActualOptions();t.particles.setDensity(),this._applyResizePlugins(),i&&await t.refresh()}constructor(t,i){this.zoom=1,this._applyResizePlugins=()=>{for(const i of this._resizePlugins){var t;null===(t=i.resize)||void 0===t||t.call(i)}},this._initStyle=()=>{const t=this.domElement,i=this._container.actualOptions;if(t){this._fullScreen?this._setFullScreenStyle():this._resetOriginalStyle();for(const s in i.style){if(!s||!(s in i.style))continue;const e=i.style[s];e&&t.style.setProperty(s,e,"important")}}},this._repairStyle=()=>{const t=this.domElement;if(!t)return;this._safeMutationObserver(t=>{t.disconnect()}),this._initStyle(),this.initBackground();const i=this._pointerEvents;t.style.pointerEvents=i,t.style.setProperty("pointer-events",i),this._safeMutationObserver(i=>{t instanceof Node&&i.observe(t,{attributes:!0})})},this._resetOriginalStyle=()=>{const t=this.domElement,i=this._originalStyle;t&&i&&c(t,i,!0)},this._safeMutationObserver=t=>{this._mutationObserver&&t(this._mutationObserver)},this._setFullScreenStyle=()=>{const t=this.domElement;t&&c(t,(0,e.hJ)(this._container.actualOptions.fullScreen.zIndex),!0)},this._pluginManager=t,this._container=i,this.render=new l(t,i,this),this._standardSize={height:0,width:0};const s=i.retina.pixelRatio,a=this._standardSize;this.size={height:a.height*s,width:a.width*s},this._generated=!1,this._resizePlugins=[],this._pointerEvents="none"}}},13540:function(t,i,s){s.a(t,async function(t,e){try{s.d(i,{Container:function(){return P}});s(89463),s(44114),s(45367),s(92731),s(3362),s(62953);var a=s(65746),n=s(41780),r=s(73348),o=s(33904),l=s(46359),h=s(49661),c=s(75839),d=s(13250),u=s(9310),p=t([r]);function g(t){return!t.destroyed}function f(t,i,s=60,e=!1){t.value=i,t.factor=e?60/s:60*i/1e3}function v(t,i,...s){const e=new l.J(t,i);return(0,u.Z)(e,...s),e}r=(p.then?(await p)():p)[0];class P{get animationStatus(){return!this._paused&&!this.pageHidden&&g(this)}get options(){return this._options}get sourceOptions(){return this._sourceOptions}addLifeTime(t){this._lifeTime+=t}alive(){return!this._duration||this._lifeTime<=this._duration}destroy(t=!0){if(g(this)){this.stop(),this.particles.destroy(),this.canvas.destroy();for(const[,t]of this.effectDrawers){var i;null===(i=t.destroy)||void 0===i||i.call(t,this)}for(const[,t]of this.shapeDrawers){var s;null===(s=t.destroy)||void 0===s||s.call(t,this)}for(const t of this.plugins){var e;null===(e=t.destroy)||void 0===e||e.call(t)}this.effectDrawers=new Map,this.shapeDrawers=new Map,this.particleUpdaters=[],this.plugins.length=0,this._pluginManager.clearPlugins(this),this.destroyed=!0,this._onDestroy(t),this.dispatchEvent(o.B.containerDestroyed)}}dispatchEvent(t,i){this._dispatchCallback(t,{container:this,data:i})}draw(t){if(!g(this))return;let i=t;this._drawAnimationFrame=(0,a.i0)(t=>{i&&(this._lastFrameTime=void 0,i=!1),this._nextFrame(t)})}async export(t,i={}){for(const s of this.plugins){if(!s.export)continue;const e=await s.export(t,i);if(e.supported)return e.blob}(0,d.t)().error(`Export plugin with type ${t} not found`)}async init(){if(!g(this))return;const t=new Map;for(const a of this._pluginManager.plugins){const i=await a.getPlugin(this);i.preInit&&await i.preInit(),t.set(a,i)}await this.initDrawersAndUpdaters(),this._options=v(this._pluginManager,this,this._initialSourceOptions,this.sourceOptions),this.actualOptions=v(this._pluginManager,this,this._options),this.plugins.length=0,this.particleDestroyedPlugins.length=0,this.particleCreatedPlugins.length=0,this.particlePositionPlugins.length=0;for(const[a,o]of t)a.needsPlugin(this.actualOptions)&&(this.plugins.push(o),o.particleCreated&&this.particleCreatedPlugins.push(o),o.particleDestroyed&&this.particleDestroyedPlugins.push(o),o.particlePosition&&this.particlePositionPlugins.push(o));this.retina.init(),this.canvas.init(),this.updateActualOptions(),this.canvas.initBackground(),this.canvas.resize();const{delay:i,duration:s,fpsLimit:e,hdr:n,smooth:r,zLayers:l}=this.actualOptions;this.hdr=n,this.zLayers=l,this._duration=1e3*(0,a.VG)(s),this._delay=1e3*(0,a.VG)(i),this._lifeTime=0,this.fpsLimit=e>0?e:120,this._smooth=r;for(const a of this.plugins){var h;await(null===(h=a.init)||void 0===h?void 0:h.call(a))}await this.particles.init(),this.dispatchEvent(o.B.containerInit),this.particles.setDensity();for(const a of this.plugins){var c;null===(c=a.particlesSetup)||void 0===c||c.call(a)}this.dispatchEvent(o.B.particlesSetup)}async initDrawersAndUpdaters(){const t=this._pluginManager;this.effectDrawers=await t.getEffectDrawers(this,!0),this.shapeDrawers=await t.getShapeDrawers(this,!0),this.particleUpdaters=await t.getUpdaters(this,!0)}pause(){if(g(this)&&(void 0!==this._drawAnimationFrame&&((0,a.px)(this._drawAnimationFrame),delete this._drawAnimationFrame),!this._paused)){for(const i of this.plugins){var t;null===(t=i.pause)||void 0===t||t.call(i)}this.pageHidden||(this._paused=!0),this.dispatchEvent(o.B.containerPaused)}}play(t){if(!g(this))return;const i=this._paused||t;if(!this._firstStart||this.actualOptions.autoPlay){if(this._paused&&(this._paused=!1),i)for(const t of this.plugins)t.play&&t.play();this.dispatchEvent(o.B.containerPlay),this.draw(null!=i&&i)}else this._firstStart=!1}async refresh(){if(g(this))return this.stop(),this.start()}async reset(t){if(g(this))return this._initialSourceOptions=t,this._sourceOptions=t,this._options=v(this._pluginManager,this,this._initialSourceOptions,this.sourceOptions),this.actualOptions=v(this._pluginManager,this,this._options),this.refresh()}async start(){g(this)&&!this.started&&(await this.init(),this.started=!0,await new Promise(t=>{const i=async()=>{this._eventListeners.addListeners();for(const t of this.plugins){var i;await(null===(i=t.start)||void 0===i?void 0:i.call(t))}this.dispatchEvent(o.B.containerStarted),this.play(),t()};this._delayTimeout=setTimeout(()=>{i()},this._delay)}))}stop(){if(g(this)&&this.started){this._delayTimeout&&(clearTimeout(this._delayTimeout),delete this._delayTimeout),this._firstStart=!0,this.started=!1,this._eventListeners.removeListeners(),this.pause(),this.particles.clear(),this.canvas.stop();for(const i of this.plugins){var t;null===(t=i.stop)||void 0===t||t.call(i)}this.particleCreatedPlugins.length=0,this.particleDestroyedPlugins.length=0,this.particlePositionPlugins.length=0,this._sourceOptions=this._options,this.dispatchEvent(o.B.containerStopped)}}updateActualOptions(){let t=!1;for(const i of this.plugins)i.updateActualOptions&&(t=i.updateActualOptions()||t);return t}constructor(t){this._delta={value:0,factor:0},this._nextFrame=t=>{try{var i;if(!this._smooth&&void 0!==this._lastFrameTime&&t<this._lastFrameTime+1e3/this.fpsLimit)return void this.draw(!1);if(null!==(i=this._lastFrameTime)&&void 0!==i||(this._lastFrameTime=t),f(this._delta,t-this._lastFrameTime,this.fpsLimit,this._smooth),this.addLifeTime(this._delta.value),this._lastFrameTime=t,this._delta.value>1e3)return void this.draw(!1);if(this.canvas.render.drawParticles(this._delta),!this.alive())return void this.destroy();this.animationStatus&&this.draw(!1)}catch(s){(0,d.t)().error("error in animation loop",s)}};const{dispatchCallback:i,pluginManager:s,id:e,onDestroy:a,sourceOptions:l}=t;this._pluginManager=s,this._dispatchCallback=i,this._onDestroy=a,this.id=Symbol(e),this.fpsLimit=120,this.hdr=!1,this._smooth=!1,this._delay=0,this._duration=0,this._lifeTime=0,this._firstStart=!0,this.started=!1,this.destroyed=!1,this._paused=!0,this._lastFrameTime=0,this.zLayers=100,this.pageHidden=!1,this._sourceOptions=l,this._initialSourceOptions=l,this.effectDrawers=new Map,this.shapeDrawers=new Map,this.particleUpdaters=[],this.retina=new c.i(this),this.canvas=new n.E(this._pluginManager,this),this.particles=new h.h(this._pluginManager,this),this.plugins=[],this.particleDestroyedPlugins=[],this.particleCreatedPlugins=[],this.particlePositionPlugins=[],this._options=v(this._pluginManager,this),this.actualOptions=v(this._pluginManager,this),this._eventListeners=new r.g(this),this.dispatchEvent(o.B.containerBuilt)}}e()}catch(_){e(_)}})},49661:function(t,i,s){s.d(i,{h:function(){return m}});s(44114),s(18111),s(22489),s(20116),s(45367),s(92731),s(3362),s(17642),s(58004),s(33853),s(45876),s(32475),s(15024),s(31698),s(46058),s(62953);var e=s(33904),a=s(24881),n=(s(16280),s(23685)),r=s(53461),o=s(65746),l=s(35128),h=s(90500),c=s(91519),d=s(39814),u=s(46398),p=s(9310);function _(t){if(!(0,l.hn)(t.outMode,t.checkModes))return;const i=2*t.radius;t.coord>t.maxCoord-i?t.setCb(-t.radius):t.coord<i&&t.setCb(t.radius)}class g{destroy(t){var i;if(this.unbreakable||this.destroyed)return;this.destroyed=!0,this.bubble.inRange=!1,this.slow.inRange=!1;const s=this._container,a=this.shape?s.shapeDrawers.get(this.shape):void 0;null==a||null===(i=a.particleDestroy)||void 0===i||i.call(a,this);for(const e of s.particleDestroyedPlugins){var n;null===(n=e.particleDestroyed)||void 0===n||n.call(e,this,t)}for(const e of s.particleUpdaters){var r;null===(r=e.particleDestroyed)||void 0===r||r.call(e,this,t)}this._container.dispatchEvent(e.B.particleDestroyed,{particle:this})}draw(t){const i=this._container.canvas.render;i.drawParticlePlugins(this,t),i.drawParticle(this,t)}getAngle(){return this.rotation+(this.pathRotation?this.velocity.angle:0)}getFillColor(){var t;return this._getRollColor(null!==(t=this.bubble.color)&&void 0!==t?t:(0,r.O_)(this.fillColor))}getMass(){return this.getRadius()**2*Math.PI*.5}getOpacity(){var t,i,s,e,a;const n=this.options.zIndex,r=(1-this.zIndexFactor)**n.opacityRate,l=null!==(t=this.bubble.opacity)&&void 0!==t?t:(0,o.VG)(null!==(i=null===(s=this.opacity)||void 0===s?void 0:s.value)&&void 0!==i?i:1),h=null!==(e=this.fillOpacity)&&void 0!==e?e:1,c=null!==(a=this.strokeOpacity)&&void 0!==a?a:1;return this._cachedOpacityData.fillOpacity=l*h*r,this._cachedOpacityData.opacity=l*r,this._cachedOpacityData.strokeOpacity=l*c*r,this._cachedOpacityData}getPosition(){return this._cachedPosition.x=this.position.x+this.offset.x,this._cachedPosition.y=this.position.y+this.offset.y,this._cachedPosition.z=this.position.z,this._cachedPosition}getRadius(){var t;return null!==(t=this.bubble.radius)&&void 0!==t?t:this.size.value}getRotateData(){const t=this.getAngle();return this._cachedRotateData.sin=Math.sin(t),this._cachedRotateData.cos=Math.cos(t),this._cachedRotateData}getStrokeColor(){var t;return this._getRollColor(null!==(t=this.bubble.color)&&void 0!==t?t:(0,r.O_)(this.strokeColor))}getTransformData(t){var i,s,e,a,n,r;const o=this.getRotateData(),l=this.isRotating;return this._cachedTransform.a=o.cos*(null!==(i=t.a)&&void 0!==i?i:h.Ug.a),this._cachedTransform.b=l?o.sin*(null!==(s=t.b)&&void 0!==s?s:1):null!==(e=t.b)&&void 0!==e?e:h.Ug.b,this._cachedTransform.c=l?-o.sin*(null!==(a=t.c)&&void 0!==a?a:1):null!==(n=t.c)&&void 0!==n?n:h.Ug.c,this._cachedTransform.d=o.cos*(null!==(r=t.d)&&void 0!==r?r:h.Ug.d),this._cachedTransform}init(t,i,s,e){var a,n,r,h,c,d,_,g,f;const v=this._container;this.id=t,this.group=e,this.justWarped=!1,this.effectClose=!0,this.shapeClose=!0,this.pathRotation=!1,this.lastPathTime=0,this.destroyed=!1,this.unbreakable=!1,this.isRotating=!1,this.rotation=0,this.misplaced=!1,this.retina={maxDistance:{},maxSpeed:0,moveDrift:0,moveSpeed:0,sizeAnimationSpeed:0},this.outType=u.x.normal,this.ignoresResizeRatio=!0;const P=v.retina.pixelRatio,m=v.actualOptions,y=(0,p.y)(this._pluginManager,v,m.particles),w=y.reduceDuplicates,z=y.effect.type,b=y.shape.type;this.effect=(0,l.TA)(z,this.id,w),this.shape=(0,l.TA)(b,this.id,w);const C=y.effect,S=y.shape;if(s){var x,k;if(null!==(x=s.effect)&&void 0!==x&&x.type){const t=s.effect.type,i=(0,l.TA)(t,this.id,w);i&&(this.effect=i,C.load(s.effect))}if(null!==(k=s.shape)&&void 0!==k&&k.type){const t=s.shape.type,i=(0,l.TA)(t,this.id,w);i&&(this.shape=i,S.load(s.shape))}}if("random"===this.effect){const t=[...this._container.effectDrawers.keys()];this.effect=t[Math.floor((0,o.G0)()*t.length)]}if("random"===this.shape){const t=[...this._container.shapeDrawers.keys()];this.shape=t[Math.floor((0,o.G0)()*t.length)]}this.effectData=this.effect?function(t,i,s,e){const a=i.options[t];return(0,l.zw)({close:i.close},(0,l.TA)(a,s,e))}(this.effect,C,this.id,w):void 0,this.shapeData=this.shape?function(t,i,s,e){const a=i.options[t];return(0,l.zw)({close:i.close},(0,l.TA)(a,s,e))}(this.shape,S,this.id,w):void 0,y.load(s);const M=this.effectData;M&&y.load(M.particles);const D=this.shapeData;let O,R;D&&y.load(D.particles),this.effectClose=null!==(a=null==M?void 0:M.close)&&void 0!==a?a:y.effect.close,this.shapeClose=null!==(n=null==D?void 0:D.close)&&void 0!==n?n:y.shape.close,this.options=y,v.retina.initParticle(this),this.size=(0,l.Xs)(this.options.size,P),this.bubble={inRange:!1},this.slow={inRange:!1,factor:1},this._initPosition(i),this.initialVelocity=this._calculateVelocity(),this.velocity=this.initialVelocity.copy(),this.zIndexFactor=this.position.z/v.zLayers,this.sides=24,this.effect&&(O=v.effectDrawers.get(this.effect)),null!==(r=O)&&void 0!==r&&r.loadEffect&&O.loadEffect(this),this.shape&&(R=v.shapeDrawers.get(this.shape)),null!==(h=R)&&void 0!==h&&h.loadShape&&R.loadShape(this);const B=null===(c=R)||void 0===c?void 0:c.getSidesCount;B&&(this.sides=B(this)),this.spawning=!1;for(const o of v.particleUpdaters)o.init(this);null===(d=O)||void 0===d||null===(_=d.particleInit)||void 0===_||_.call(d,v,this),null===(g=R)||void 0===g||null===(f=g.particleInit)||void 0===f||f.call(g,v,this);for(const o of v.particleCreatedPlugins){var I;null===(I=o.particleCreated)||void 0===I||I.call(o,this)}}isInsideCanvas(){const t=this.getRadius(),i=this._container.canvas.size,s=this.position;return s.x>=-t&&s.y>=-t&&s.y<=i.height+t&&s.x<=i.width+t}isShowingBack(){if(!this.roll)return!1;const t=this.roll.angle;if(this.roll.horizontal&&this.roll.vertical){const i=t%h.R1,s=i<0?i+h.R1:i;return s>=.5*Math.PI&&s<3*Math.PI*.5}if(this.roll.horizontal){const i=(t+.5*Math.PI)%(2*Math.PI),s=i<0?i+2*Math.PI:i;return s>=Math.PI&&s<2*Math.PI}if(this.roll.vertical){const i=t%(2*Math.PI),s=i<0?i+2*Math.PI:i;return s>=Math.PI&&s<2*Math.PI}return!1}isVisible(){return!this.destroyed&&!this.spawning&&this.isInsideCanvas()}reset(){for(const i of this._container.particleUpdaters){var t;null===(t=i.reset)||void 0===t||t.call(i,this)}}constructor(t,i){this._cachedOpacityData={fillOpacity:1,opacity:1,strokeOpacity:1},this._cachedPosition=n.p.origin,this._cachedRotateData={sin:0,cos:0},this._cachedTransform={a:1,b:0,c:0,d:1},this._calcPosition=(t,i)=>{let s=0,e=t?n.p.create(t.x,t.y,i):void 0;const a=this._container,r=a.particlePositionPlugins,l=this.options.move.outModes,h=this.getRadius(),c=a.canvas.size,d=new AbortController,{signal:u}=d;for(;!u.aborted;){var p,_,g,f;for(const s of r){var v;const t=null===(v=s.particlePosition)||void 0===v?void 0:v.call(s,e,this);if(t)return n.p.create(t.x,t.y,i)}const t=(0,o.Nx)({size:c,position:e}),d=n.p.create(t.x,t.y,i);this._fixHorizontal(d,h,null!==(p=l.left)&&void 0!==p?p:l.default),this._fixHorizontal(d,h,null!==(_=l.right)&&void 0!==_?_:l.default),this._fixVertical(d,h,null!==(g=l.top)&&void 0!==g?g:l.default),this._fixVertical(d,h,null!==(f=l.bottom)&&void 0!==f?f:l.default);let u=!0;for(const i of a.particles.checkParticlePositionPlugins){var P,m;if(u=null===(P=null===(m=i.checkParticlePosition)||void 0===m?void 0:m.call(i,this,d,s))||void 0===P||P,!u)break}if(u)return d;s+=1,e=void 0}return e},this._calculateVelocity=()=>{const t=(0,o.$m)(this.direction).copy(),i=this.options.move;if(i.direction===c.F.inside||i.direction===c.F.outside)return t;const s=(0,o.pu)((0,o.VG)(i.angle.value)),e=(0,o.pu)((0,o.VG)(i.angle.offset)),a={left:e-.5*s,right:e+.5*s};return i.straight||(t.angle+=(0,o.vE)((0,o.DT)(a.left,a.right))),i.random&&"number"==typeof i.speed&&(t.length*=(0,o.G0)()),t},this._fixHorizontal=(t,i,s)=>{_({outMode:s,checkModes:[d.Y.bounce],coord:t.x,maxCoord:this._container.canvas.size.width,setCb:i=>t.x+=i,radius:i})},this._fixVertical=(t,i,s)=>{_({outMode:s,checkModes:[d.Y.bounce],coord:t.y,maxCoord:this._container.canvas.size.height,setCb:i=>t.y+=i,radius:i})},this._getRollColor=t=>t&&this.roll&&(this.backColor||this.roll.alter)&&this.isShowingBack()?this.backColor?this.backColor:this.roll.alter?(0,r.yx)(t,this.roll.alter.type,this.roll.alter.value):t:t,this._initPosition=t=>{const i=this._container,s=Math.floor((0,o.VG)(this.options.zIndex.value)),e=this._calcPosition(t,(0,o.qE)(s,0,i.zLayers));if(!e)throw new Error("a valid position cannot be found for particle");this.position=e,this.initialPosition=this.position.copy();const a=i.canvas.size;switch(this.moveCenter=Object.assign(Object.assign({},(0,l.E9)(this.options.move.center,a)),{},{radius:this.options.move.center.radius,mode:this.options.move.center.mode}),this.direction=(0,o.JY)(this.options.move.direction,this.position,this.moveCenter),this.options.move.direction){case c.F.inside:this.outType=u.x.inside;break;case c.F.outside:this.outType=u.x.outside}this.offset=n.M.origin},this._pluginManager=t,this._container=i}}var f=s(52531);class v{clear(){this._cells.clear();const t=this._pendingCellSize;t&&(this._cellSize=t),this._pendingCellSize=void 0}insert(t){var i;const{x:s,y:e}=t.getPosition(),a=this._cellKeyFromCoords(s,e);this._cells.has(a)||this._cells.set(a,[]),null===(i=this._cells.get(a))||void 0===i||i.push(t)}query(t,i,s=[]){const e=this._getRangeBounds(t);if(!e)return s;const a=Math.floor(e.minX/this._cellSize),n=Math.floor(e.maxX/this._cellSize),r=Math.floor(e.minY/this._cellSize),o=Math.floor(e.maxY/this._cellSize);for(let l=a;l<=n;l++)for(let e=r;e<=o;e++){const a=`${l}_${e}`,n=this._cells.get(a);if(n)for(const e of n)i&&!i(e)||t.contains(e.getPosition())&&s.push(e)}return s}queryCircle(t,i,s,e=[]){const a=this._acquireCircle(t.x,t.y,i),n=this.query(a,s,e);return this._releaseShapes(),n}queryRectangle(t,i,s,e=[]){const a=this._acquireRectangle(t.x,t.y,i.width,i.height),n=this.query(a,s,e);return this._releaseShapes(),n}setCellSize(t){this._pendingCellSize=t}_acquireCircle(t,i,s){var e,a,n;return(null!==(n=(e=this._circlePool)[a=this._circlePoolIdx++])&&void 0!==n?n:e[a]=new f.jl(t,i,s)).reset(t,i,s)}_acquireRectangle(t,i,s,e){var a,n,r;return(null!==(r=(a=this._rectanglePool)[n=this._rectanglePoolIdx++])&&void 0!==r?r:a[n]=new f.M_(t,i,s,e)).reset(t,i,s,e)}_cellKeyFromCoords(t,i){return`${Math.floor(t/this._cellSize)}_${Math.floor(i/this._cellSize)}`}_getRangeBounds(t){if(t instanceof f.jl){const i=t.radius,{x:s,y:e}=t.position;return{minX:s-i,maxX:s+i,minY:e-i,maxY:e+i}}if(t instanceof f.M_){const{x:i,y:s}=t.position,{width:e,height:a}=t.size;return{minX:i,maxX:i+e,minY:s,maxY:s+a}}return null}_releaseShapes(){this._circlePoolIdx=0,this._rectanglePoolIdx=0}constructor(t){this._cells=new Map,this._circlePool=[],this._rectanglePool=[],this._cellSize=t,this._circlePoolIdx=0,this._rectanglePoolIdx=0}}var P=s(13250);class m{get count(){return this._array.length}addParticle(t,i,s,n){var r;const o=this._container.actualOptions.particles.number.limit.mode,l=void 0===s?this._limit:null!==(r=this._groupLimits.get(s))&&void 0!==r?r:this._limit,h=this.count;if(l>0)switch(o){case a.d.delete:{const t=h+1-l;t>0&&this.removeQuantity(t);break}case a.d.wait:if(h>=l)return}try{var c;const a=null!==(c=this._pool.pop())&&void 0!==c?c:new g(this._pluginManager,this._container);a.init(this._nextId,t,i,s);let r=!0;return n&&(r=n(a)),r?(this._array.push(a),this._insertParticleIntoBucket(a),this._nextId++,this._container.dispatchEvent(e.B.particleAdded,{particle:a}),a):void this._pool.push(a)}catch(d){(0,P.t)().warning(`error adding particle: ${d}`)}}clear(){this._array=[],this._particleBuckets.clear(),this._resetBuckets(this._container.zLayers)}destroy(){this._array=[],this._pool.length=0,this._particleBuckets.clear(),this._zBuckets=[],this.checkParticlePositionPlugins=[],this._particleResetPlugins=[],this._particleUpdatePlugins=[],this._postUpdatePlugins=[],this._postParticleUpdatePlugins=[],this._updatePlugins=[]}drawParticles(t){for(let i=this._zBuckets.length-1;i>=0;i--){const s=this._zBuckets[i];if(s)for(const i of s)i.draw(t)}}filter(t){return this._array.filter(t)}find(t){return this._array.find(t)}get(t){return this._array[t]}async init(){const t=this._container,i=t.actualOptions;this.checkParticlePositionPlugins=[],this._updatePlugins=[],this._particleUpdatePlugins=[],this._postUpdatePlugins=[],this._particleResetPlugins=[],this._postParticleUpdatePlugins=[],this._particleBuckets.clear(),this._resetBuckets(t.zLayers),this.grid=new v(100*t.retina.pixelRatio);for(const o of t.plugins)o.redrawInit&&await o.redrawInit(),o.checkParticlePosition&&this.checkParticlePositionPlugins.push(o),o.update&&this._updatePlugins.push(o),o.particleUpdate&&this._particleUpdatePlugins.push(o),o.postUpdate&&this._postUpdatePlugins.push(o),o.particleReset&&this._particleResetPlugins.push(o),o.postParticleUpdate&&this._postParticleUpdatePlugins.push(o);await this._container.initDrawersAndUpdaters();for(const o of this._container.effectDrawers.values()){var s;await(null===(s=o.init)||void 0===s?void 0:s.call(o,t))}for(const o of this._container.shapeDrawers.values()){var e;await(null===(e=o.init)||void 0===e?void 0:e.call(o,t))}let a=!1;for(const o of t.plugins){var n,r;if(a=null!==(n=null===(r=o.particlesInitialization)||void 0===r?void 0:r.call(o))&&void 0!==n?n:a,a)break}if(!a){const t=i.particles,s=t.groups;for(const i in s){const e=s[i];if(e)for(let s=this.count,a=0;a<e.number.value&&s<t.number.value;s++,a++)this.addParticle(void 0,e,i)}for(let i=this.count;i<t.number.value;i++)this.addParticle()}}push(t,i,s,e){for(let a=0;a<t;a++)this.addParticle(i,s,e)}async redraw(){this.clear(),await this.init(),this._container.canvas.render.drawParticles({value:0,factor:0})}remove(t,i,s){this.removeAt(this._array.indexOf(t),void 0,i,s)}removeAt(t,i=1,s,e){if(t<0||t>this.count)return;let a=0;for(let n=t;a<i&&n<this.count;n++)this._removeParticle(n,s,e)&&(n--,a++)}removeQuantity(t,i){this.removeAt(0,t,i)}setDensity(){const t=this._container.actualOptions,i=t.particles.groups;let s=0;for(const e of this._container.plugins)e.particlesDensityCount&&(s+=e.particlesDensityCount());for(const e in i){const t=i[e];if(!t)continue;const a=(0,p.y)(this._pluginManager,this._container,t);this._applyDensity(a,s,e)}this._applyDensity(t.particles,s)}setResizeFactor(t){this._resizeFactor=t}update(t){this.grid.clear();for(const a of this._updatePlugins){var i;null===(i=a.update)||void 0===i||i.call(a,t)}const s=this._updateParticlesPhase1(t);for(const a of this._postUpdatePlugins){var e;null===(e=a.postUpdate)||void 0===e||e.call(a,t)}if(this._updateParticlesPhase2(t,s),s.size)for(const a of s)this.remove(a);delete this._resizeFactor}constructor(t,i){this._addToPool=(...t)=>{this._pool.push(...t)},this._applyDensity=(t,i,s,e)=>{const a=t.number;if(!a.density.enable){var n;if(void 0===s)this._limit=a.limit.value;else if(null!==(n=null==e?void 0:e.number.limit.value)&&void 0!==n?n:a.limit.value){var r;this._groupLimits.set(s,null!==(r=null==e?void 0:e.number.limit.value)&&void 0!==r?r:a.limit.value)}return}const o=this._initDensityFactor(a.density),l=a.value,h=a.limit.value>0?a.limit.value:l,c=Math.min(l,h)*o+i,d=Math.min(this.count,this.filter(t=>t.group===s).length);void 0===s?this._limit=a.limit.value*o:this._groupLimits.set(s,a.limit.value*o),d<c?this.push(Math.abs(c-d),void 0,t,s):d>c&&this.removeQuantity(d-c,s)},this._createBuckets=t=>{const i=Math.max(Math.floor(t),1);return Array.from({length:i},()=>[])},this._getBucketIndex=t=>{const i=this._zBuckets.length-1;return i<=0?0:Math.min(Math.max(Math.floor(t),0),i)},this._getParticleInsertIndex=(t,i)=>{let s=0,e=t.length;for(;s<e;){const a=Math.floor((s+e)/2),n=t[a];n?n.id<i?s=a+1:e=a:e=a}return s},this._initDensityFactor=t=>{const i=this._container;if(!t.enable)return 1;const s=i.canvas.size,e=i.retina.pixelRatio;return s.width&&s.height?s.width*s.height/(t.height*t.width*e**2):1},this._insertParticleIntoBucket=t=>{const i=this._getBucketIndex(t.position.z),s=this._zBuckets[i];s&&(s.splice(this._getParticleInsertIndex(s,t.id),0,t),this._particleBuckets.set(t.id,i))},this._removeParticle=(t,i,s)=>{const a=this._array[t];return!!a&&(a.group===i&&(this._array.splice(t,1),this._removeParticleFromBucket(a),a.destroy(s),this._container.dispatchEvent(e.B.particleRemoved,{particle:a}),this._addToPool(a),!0))},this._removeParticleFromBucket=t=>{var i,s;const e=null!==(i=this._particleBuckets.get(t.id))&&void 0!==i?i:this._getBucketIndex(t.position.z),a=this._zBuckets[e];if(!a)return void this._particleBuckets.delete(t.id);const n=this._getParticleInsertIndex(a,t.id);(null===(s=a[n])||void 0===s?void 0:s.id)===t.id?(a.splice(n,1),this._particleBuckets.delete(t.id)):this._particleBuckets.delete(t.id)},this._resetBuckets=t=>{const i=Math.max(Math.floor(t),1);if(this._zBuckets.length===i)for(const s of this._zBuckets)s.length=0;else this._zBuckets=this._createBuckets(i)},this._updateParticleBucket=t=>{const i=this._getBucketIndex(t.position.z),s=this._particleBuckets.get(t.id);if(void 0===s)return void this._insertParticleIntoBucket(t);if(s===i)return;const e=this._zBuckets[s];if(e){var a;const i=this._getParticleInsertIndex(e,t.id);(null===(a=e[i])||void 0===a?void 0:a.id)===t.id&&e.splice(i,1)}const n=this._zBuckets[i];n?(n.splice(this._getParticleInsertIndex(n,t.id),0,t),this._particleBuckets.set(t.id,i)):this._particleBuckets.set(t.id,i)},this._updateParticlesPhase1=t=>{const i=new Set,s=this._resizeFactor;for(const n of this._array){s&&!n.ignoresResizeRatio&&(n.position.x*=s.width,n.position.y*=s.height,n.initialPosition.x*=s.width,n.initialPosition.y*=s.height),n.ignoresResizeRatio=!1;for(const t of this._particleResetPlugins){var e;null===(e=t.particleReset)||void 0===e||e.call(t,n)}for(const i of this._particleUpdatePlugins){var a;if(n.destroyed)break;null===(a=i.particleUpdate)||void 0===a||a.call(i,n,t)}n.destroyed?i.add(n):this.grid.insert(n)}return i},this._updateParticlesPhase2=(t,i)=>{for(const e of this._array)if(e.destroyed)i.add(e);else{for(const i of this._container.particleUpdaters)i.update(e,t);if(!e.spawning)for(const i of this._postParticleUpdatePlugins){var s;null===(s=i.postParticleUpdate)||void 0===s||s.call(i,e,t)}this._updateParticleBucket(e)}},this._pluginManager=t,this._container=i,this._nextId=0,this._array=[],this._pool=[],this._limit=0,this._groupLimits=new Map,this._particleBuckets=new Map,this._zBuckets=this._createBuckets(this._container.zLayers),this.grid=new v(100),this.checkParticlePositionPlugins=[],this._particleResetPlugins=[],this._particleUpdatePlugins=[],this._postUpdatePlugins=[],this._postParticleUpdatePlugins=[],this._updatePlugins=[]}}},75839:function(t,i,s){s.d(i,{i:function(){return a}});var e=s(65746);class a{init(){const t=this.container,i=t.actualOptions;this.pixelRatio=i.detectRetina?devicePixelRatio:1,this.reduceFactor=1;const s=this.pixelRatio,e=t.canvas,a=e.domElement;a&&(e.size.width=a.offsetWidth*s,e.size.height=a.offsetHeight*s)}initParticle(t){const i=t.options,s=this.pixelRatio,a=i.move,n=a.distance,r=t.retina;r.maxSpeed=(0,e.VG)(a.gravity.maxSpeed)*s,r.moveDrift=(0,e.VG)(a.drift)*s,r.moveSpeed=(0,e.VG)(a.speed)*s,r.sizeAnimationSpeed=(0,e.VG)(i.size.animation.speed)*s;const o=r.maxDistance;o.horizontal=void 0===n.horizontal?void 0:n.horizontal*s,o.vertical=void 0===n.vertical?void 0:n.vertical*s}constructor(t){this.container=t,this.pixelRatio=1,this.reduceFactor=1}}},73348:function(t,i,s){s.a(t,async function(t,e){try{s.d(i,{g:function(){return l}});var a=s(69235),n=(s(55081),s(18111),s(20116),s(3362),s(35128)),r=s(90500),o=t([a]);a=(o.then?(await o)():o)[0];class l{addListeners(){this._manageListeners(!0)}removeListeners(){this._manageListeners(!1)}constructor(t){this._handleVisibilityChange=()=>{const t=this.container;t.actualOptions.pauseOnBlur&&((0,n.T5)().hidden?(t.pageHidden=!0,t.pause()):(t.pageHidden=!1,t.animationStatus?t.play(!0):t.draw(!0)))},this._handleWindowResize=()=>{this._resizeTimeout&&(clearTimeout(this._resizeTimeout),delete this._resizeTimeout);const t=async()=>{const t=this.container.canvas;await t.windowResize()};this._resizeTimeout=setTimeout(()=>{t()},1e3*this.container.actualOptions.resize.delay)},this._manageListeners=t=>{const i=this._handlers;this._manageResize(t),(0,n.Kp)(document,r.nK,i.visibilityChange,t,!1)},this._manageResize=t=>{const i=this._handlers,s=this.container;if(!s.actualOptions.resize.enable)return;if("undefined"==typeof ResizeObserver)return void(0,n.Kp)(globalThis,"resize",i.resize,t);const e=s.canvas.domElement;this._resizeObserver&&!t?(e&&this._resizeObserver.unobserve(e),this._resizeObserver.disconnect(),delete this._resizeObserver):!this._resizeObserver&&t&&e&&(this._resizeObserver=new ResizeObserver(t=>{t.find(t=>t.target===e)&&this._handleWindowResize()}),this._resizeObserver.observe(e))},this.container=t,this._handlers={visibilityChange:()=>{this._handleVisibilityChange()},resize:()=>{this._handleWindowResize()}}}}e()}catch(l){e(l)}})}}]);