@tsparticles/plugin-infection 4.0.0-beta.12 → 4.0.0-beta.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,357 +1,323 @@
1
- /*!
2
- * Author : Matteo Bruni
3
- * MIT license: https://opensource.org/licenses/MIT
4
- * Demo / Generator : https://particles.js.org/
5
- * GitHub : https://www.github.com/matteobruni/tsparticles
6
- * How to use? : Check the GitHub README
7
- * v4.0.0-beta.12
8
- */
9
- /*
10
- * ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development").
11
- * This devtool is neither made for production nor for readable output files.
12
- * It uses "eval()" calls to create a separate source file in the browser devtools.
13
- * If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/)
14
- * or disable the default devtool with "devtool: false".
15
- * If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/).
16
- */
17
- (function webpackUniversalModuleDefinition(root, factory) {
18
- if(typeof exports === 'object' && typeof module === 'object')
19
- module.exports = factory(require("@tsparticles/plugin-interactivity"), require("@tsparticles/engine"));
20
- else if(typeof define === 'function' && define.amd)
21
- define(["@tsparticles/plugin-interactivity", "@tsparticles/engine"], factory);
22
- else {
23
- var a = typeof exports === 'object' ? factory(require("@tsparticles/plugin-interactivity"), require("@tsparticles/engine")) : factory(root["window"], root["window"]);
24
- for(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i];
25
- }
26
- })(this, (__WEBPACK_EXTERNAL_MODULE__tsparticles_plugin_interactivity__, __WEBPACK_EXTERNAL_MODULE__tsparticles_engine__) => {
27
- return /******/ (() => { // webpackBootstrap
28
- /******/ "use strict";
29
- /******/ var __webpack_modules__ = ({
1
+ (function(g){g.__tsParticlesInternals=g.__tsParticlesInternals||{};g.__tsParticlesInternals.bundles=g.__tsParticlesInternals.bundles||{};g.__tsParticlesInternals.effects=g.__tsParticlesInternals.effects||{};g.__tsParticlesInternals.engine=g.__tsParticlesInternals.engine||{};g.__tsParticlesInternals.interactions=g.__tsParticlesInternals.interactions||{};g.__tsParticlesInternals.palettes=g.__tsParticlesInternals.palettes||{};g.__tsParticlesInternals.paths=g.__tsParticlesInternals.paths||{};g.__tsParticlesInternals.plugins=g.__tsParticlesInternals.plugins||{};g.__tsParticlesInternals.plugins=g.__tsParticlesInternals.plugins||{};g.__tsParticlesInternals.plugins.emittersShapes=g.__tsParticlesInternals.plugins.emittersShapes||{};g.__tsParticlesInternals.presets=g.__tsParticlesInternals.presets||{};g.__tsParticlesInternals.shapes=g.__tsParticlesInternals.shapes||{};g.__tsParticlesInternals.updaters=g.__tsParticlesInternals.updaters||{};g.__tsParticlesInternals.utils=g.__tsParticlesInternals.utils||{};g.__tsParticlesInternals.canvas=g.__tsParticlesInternals.canvas||{};g.__tsParticlesInternals.canvas=g.__tsParticlesInternals.canvas||{};g.__tsParticlesInternals.canvas.utils=g.__tsParticlesInternals.canvas.utils||{};g.__tsParticlesInternals.path=g.__tsParticlesInternals.path||{};g.__tsParticlesInternals.path=g.__tsParticlesInternals.path||{};g.__tsParticlesInternals.path.utils=g.__tsParticlesInternals.path.utils||{};var __tsProxyFactory=typeof Proxy!=="undefined"?function(obj){return new Proxy(obj,{get:function(target,key){if(!(key in target)){target[key]={};}return target[key];}});}:function(obj){return obj;};g.__tsParticlesInternals.bundles=__tsProxyFactory(g.__tsParticlesInternals.bundles);g.__tsParticlesInternals.effects=__tsProxyFactory(g.__tsParticlesInternals.effects);g.__tsParticlesInternals.interactions=__tsProxyFactory(g.__tsParticlesInternals.interactions);g.__tsParticlesInternals.palettes=__tsProxyFactory(g.__tsParticlesInternals.palettes);g.__tsParticlesInternals.paths=__tsProxyFactory(g.__tsParticlesInternals.paths);g.__tsParticlesInternals.plugins=__tsProxyFactory(g.__tsParticlesInternals.plugins);g.__tsParticlesInternals.plugins.emittersShapes=__tsProxyFactory(g.__tsParticlesInternals.plugins.emittersShapes);g.__tsParticlesInternals.presets=__tsProxyFactory(g.__tsParticlesInternals.presets);g.__tsParticlesInternals.shapes=__tsProxyFactory(g.__tsParticlesInternals.shapes);g.__tsParticlesInternals.updaters=__tsProxyFactory(g.__tsParticlesInternals.updaters);g.__tsParticlesInternals.utils=__tsProxyFactory(g.__tsParticlesInternals.utils);g.__tsParticlesInternals.canvas=__tsProxyFactory(g.__tsParticlesInternals.canvas);g.__tsParticlesInternals.path=__tsProxyFactory(g.__tsParticlesInternals.path);g.tsparticlesInternalExports=g.tsparticlesInternalExports||{};})(typeof globalThis!=="undefined"?globalThis:typeof window!=="undefined"?window:this);
2
+ /* Plugin v4.0.0-beta.16 */
3
+ (function (global, factory) {
4
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@tsparticles/plugin-interactivity'), require('@tsparticles/engine')) :
5
+ typeof define === 'function' && define.amd ? define(['exports', '@tsparticles/plugin-interactivity', '@tsparticles/engine'], factory) :
6
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.__tsParticlesInternals = global.__tsParticlesInternals || {}, global.__tsParticlesInternals.plugins = global.__tsParticlesInternals.plugins || {}, global.__tsParticlesInternals.plugins.infection = global.__tsParticlesInternals.plugins.infection || {}), global.__tsParticlesInternals.plugins.interactivity, global.__tsParticlesInternals.engine));
7
+ })(this, (function (exports, pluginInteractivity, engine) { 'use strict';
30
8
 
31
- /***/ "@tsparticles/engine"
32
- /*!*********************************************************************************************************************************!*\
33
- !*** external {"commonjs":"@tsparticles/engine","commonjs2":"@tsparticles/engine","amd":"@tsparticles/engine","root":"window"} ***!
34
- \*********************************************************************************************************************************/
35
- (module) {
9
+ class InfectionStage {
10
+ color;
11
+ duration;
12
+ infectedStage;
13
+ radius;
14
+ rate;
15
+ constructor() {
16
+ this.color = new engine.OptionsColor();
17
+ this.color.value = "#ff0000";
18
+ this.radius = 0;
19
+ this.rate = 1;
20
+ }
21
+ load(data) {
22
+ if (engine.isNull(data)) {
23
+ return;
24
+ }
25
+ if (data.color !== undefined) {
26
+ this.color = engine.OptionsColor.create(this.color, data.color);
27
+ }
28
+ this.duration = data.duration;
29
+ this.infectedStage = data.infectedStage;
30
+ if (data.radius !== undefined) {
31
+ this.radius = data.radius;
32
+ }
33
+ if (data.rate !== undefined) {
34
+ this.rate = data.rate;
35
+ }
36
+ }
37
+ }
36
38
 
37
- module.exports = __WEBPACK_EXTERNAL_MODULE__tsparticles_engine__;
39
+ class Infection {
40
+ cure;
41
+ delay;
42
+ enable;
43
+ infections;
44
+ stages;
45
+ constructor() {
46
+ this.cure = false;
47
+ this.delay = 0;
48
+ this.enable = false;
49
+ this.infections = 0;
50
+ this.stages = [];
51
+ }
52
+ load(data) {
53
+ if (engine.isNull(data)) {
54
+ return;
55
+ }
56
+ if (data.cure !== undefined) {
57
+ this.cure = data.cure;
58
+ }
59
+ if (data.delay !== undefined) {
60
+ this.delay = data.delay;
61
+ }
62
+ if (data.enable !== undefined) {
63
+ this.enable = data.enable;
64
+ }
65
+ if (data.infections !== undefined) {
66
+ this.infections = data.infections;
67
+ }
68
+ if (data.stages === undefined) {
69
+ return;
70
+ }
71
+ this.stages = data.stages.map(t => {
72
+ const s = new InfectionStage();
73
+ s.load(t);
74
+ return s;
75
+ });
76
+ }
77
+ }
38
78
 
39
- /***/ },
79
+ class InfectionPlugin {
80
+ id = "infection";
81
+ async getPlugin(container) {
82
+ const { InfectionPluginInstance } = await Promise.resolve().then(function () { return InfectionPluginInstance$1; });
83
+ return new InfectionPluginInstance(container);
84
+ }
85
+ loadOptions(_container, options, source) {
86
+ if (!this.needsPlugin(options) && !this.needsPlugin(source)) {
87
+ return;
88
+ }
89
+ let infectionOptions = options.infection;
90
+ if (infectionOptions?.load === undefined) {
91
+ options.infection = infectionOptions = new Infection();
92
+ }
93
+ infectionOptions.load(source?.infection);
94
+ }
95
+ needsPlugin(options) {
96
+ return options?.infection?.enable ?? false;
97
+ }
98
+ }
40
99
 
41
- /***/ "@tsparticles/plugin-interactivity"
42
- /*!***************************************************************************************************************************************************************************!*\
43
- !*** external {"commonjs":"@tsparticles/plugin-interactivity","commonjs2":"@tsparticles/plugin-interactivity","amd":"@tsparticles/plugin-interactivity","root":"window"} ***!
44
- \***************************************************************************************************************************************************************************/
45
- (module) {
100
+ const minStagesCount = 1;
101
+ class ParticlesInfecter extends pluginInteractivity.ParticlesInteractorBase {
102
+ _maxDistance;
103
+ constructor(container) {
104
+ super(container);
105
+ this._maxDistance = 0;
106
+ }
107
+ get maxDistance() {
108
+ return this._maxDistance;
109
+ }
110
+ clear() {
111
+ }
112
+ init() {
113
+ }
114
+ interact(p1, _interactivityData, delta) {
115
+ const infecter = this.container.infecter;
116
+ if (!infecter) {
117
+ return;
118
+ }
119
+ infecter.updateInfection(p1, delta.value);
120
+ if (p1.infection?.stage === undefined) {
121
+ return;
122
+ }
123
+ const container = this.container, options = container.actualOptions, infectionOptions = options.infection;
124
+ if (!infectionOptions?.enable || infectionOptions.stages.length < minStagesCount) {
125
+ return;
126
+ }
127
+ const infectionStage1 = infectionOptions.stages[p1.infection.stage];
128
+ if (!infectionStage1) {
129
+ return;
130
+ }
131
+ this._maxDistance = Math.max(this._maxDistance, infectionStage1.radius);
132
+ const pxRatio = container.retina.pixelRatio, radius = p1.getRadius() * engine.double + infectionStage1.radius * pxRatio, pos = p1.getPosition(), infectedStage1 = infectionStage1.infectedStage ?? p1.infection.stage, query = container.particles.grid.queryCircle(pos, radius), infections = infectionStage1.rate, neighbors = query.length;
133
+ for (const p2 of query) {
134
+ const infP2 = p2;
135
+ if (infP2 === p1 ||
136
+ infP2.destroyed ||
137
+ infP2.spawning ||
138
+ !(infP2.infection?.stage === undefined || infP2.infection.stage !== p1.infection.stage) ||
139
+ engine.getRandom() >= infections / neighbors) {
140
+ continue;
141
+ }
142
+ if (infP2.infection?.stage === undefined) {
143
+ infecter.startInfection(infP2, infectedStage1);
144
+ }
145
+ else if (infP2.infection.stage < p1.infection.stage) {
146
+ infecter.updateInfectionStage(infP2, infectedStage1);
147
+ }
148
+ else if (infP2.infection.stage > p1.infection.stage) {
149
+ const infectionStage2 = infectionOptions.stages[infP2.infection.stage];
150
+ if (!infectionStage2) {
151
+ continue;
152
+ }
153
+ const infectedStage2 = infectionStage2.infectedStage ?? infP2.infection.stage;
154
+ infecter.updateInfectionStage(p1, infectedStage2);
155
+ }
156
+ }
157
+ }
158
+ isEnabled() {
159
+ return this.container.actualOptions.infection?.enable ?? false;
160
+ }
161
+ reset() {
162
+ }
163
+ }
46
164
 
47
- module.exports = __WEBPACK_EXTERNAL_MODULE__tsparticles_plugin_interactivity__;
165
+ async function loadInfectionPlugin(engine) {
166
+ engine.checkVersion("4.0.0-beta.16");
167
+ await engine.pluginManager.register((e) => {
168
+ pluginInteractivity.ensureInteractivityPluginLoaded(e);
169
+ e.pluginManager.addPlugin(new InfectionPlugin());
170
+ e.pluginManager.addInteractor?.("particlesInfection", (container) => {
171
+ return Promise.resolve(new ParticlesInfecter(container));
172
+ });
173
+ });
174
+ }
48
175
 
49
- /***/ },
176
+ const globalObject = globalThis;
177
+ globalObject.__tsParticlesInternals = globalObject.__tsParticlesInternals ?? {};
178
+ globalObject.loadInfectionPlugin = loadInfectionPlugin;
50
179
 
51
- /***/ "./dist/browser/index.js"
52
- /*!*******************************!*\
53
- !*** ./dist/browser/index.js ***!
54
- \*******************************/
55
- (__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
180
+ const minStage$1 = 0, minDuration = 0;
181
+ class Infecter {
182
+ _container;
183
+ constructor(container) {
184
+ this._container = container;
185
+ }
186
+ startInfection(particle, stage) {
187
+ const infectionOptions = this._container.actualOptions.infection, { infection } = particle;
188
+ if (!infectionOptions || !infection) {
189
+ return;
190
+ }
191
+ const stages = infectionOptions.stages, stagesCount = stages.length;
192
+ if (stage > stagesCount || stage < minStage$1) {
193
+ return;
194
+ }
195
+ infection.delay = 0;
196
+ infection.delayStage = stage;
197
+ }
198
+ updateInfection(particle, delta) {
199
+ const infectionOptions = this._container.actualOptions.infection, { infection } = particle;
200
+ if (!infectionOptions || !infection) {
201
+ return;
202
+ }
203
+ const stages = infectionOptions.stages, stagesCount = stages.length;
204
+ if (infection.delay !== undefined && infection.delayStage !== undefined) {
205
+ const stage = infection.delayStage;
206
+ if (stage > stagesCount || stage < minStage$1) {
207
+ return;
208
+ }
209
+ if (infection.delay >= infectionOptions.delay * engine.millisecondsToSeconds) {
210
+ infection.stage = stage;
211
+ infection.time = 0;
212
+ delete infection.delay;
213
+ delete infection.delayStage;
214
+ }
215
+ else {
216
+ infection.delay += delta;
217
+ }
218
+ }
219
+ else {
220
+ delete infection.delay;
221
+ delete infection.delayStage;
222
+ }
223
+ if (infection.stage !== undefined && infection.time !== undefined) {
224
+ const infectionStage = stages[infection.stage];
225
+ if (infectionStage?.duration !== undefined && infectionStage.duration >= minDuration) {
226
+ if (infection.time > infectionStage.duration * engine.millisecondsToSeconds) {
227
+ this._nextInfectionStage(particle);
228
+ }
229
+ else {
230
+ infection.time += delta;
231
+ }
232
+ }
233
+ else {
234
+ infection.time += delta;
235
+ }
236
+ }
237
+ else {
238
+ delete infection.stage;
239
+ delete infection.time;
240
+ }
241
+ }
242
+ updateInfectionStage(particle, stage) {
243
+ const options = this._container.actualOptions, { infection } = particle;
244
+ if (!options.infection || !infection) {
245
+ return;
246
+ }
247
+ const stagesCount = options.infection.stages.length;
248
+ if (stage > stagesCount || stage < minStage$1 || (infection.stage !== undefined && infection.stage > stage)) {
249
+ return;
250
+ }
251
+ infection.stage = stage;
252
+ infection.time = 0;
253
+ }
254
+ _nextInfectionStage = particle => {
255
+ const infectionOptions = this._container.actualOptions.infection, { infection } = particle;
256
+ if (!infectionOptions || !infection) {
257
+ return;
258
+ }
259
+ const stagesCount = infectionOptions.stages.length;
260
+ if (stagesCount <= minStage$1 || infection.stage === undefined) {
261
+ return;
262
+ }
263
+ infection.time = 0;
264
+ if (stagesCount <= ++infection.stage) {
265
+ if (infectionOptions.cure) {
266
+ delete infection.stage;
267
+ delete infection.time;
268
+ }
269
+ else {
270
+ infection.stage = 0;
271
+ infection.time = 0;
272
+ }
273
+ }
274
+ };
275
+ }
56
276
 
57
- eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ loadInfectionPlugin: () => (/* binding */ loadInfectionPlugin)\n/* harmony export */ });\nasync function loadInfectionPlugin(engine) {\n engine.checkVersion(\"4.0.0-beta.12\");\n await engine.pluginManager.register(async (e)=>{\n const [{ ensureInteractivityPluginLoaded }, { InfectionPlugin }] = await Promise.all([\n Promise.resolve(/*! import() */).then(__webpack_require__.t.bind(__webpack_require__, /*! @tsparticles/plugin-interactivity */ \"@tsparticles/plugin-interactivity\", 19)),\n __webpack_require__.e(/*! import() */ \"dist_browser_InfectionPlugin_js\").then(__webpack_require__.bind(__webpack_require__, /*! ./InfectionPlugin.js */ \"./dist/browser/InfectionPlugin.js\"))\n ]);\n ensureInteractivityPluginLoaded(e);\n e.pluginManager.addPlugin(new InfectionPlugin());\n e.pluginManager.addInteractor?.(\"particlesInfection\", async (container)=>{\n const { ParticlesInfecter } = await __webpack_require__.e(/*! import() */ \"dist_browser_ParticlesInfecter_js\").then(__webpack_require__.bind(__webpack_require__, /*! ./ParticlesInfecter.js */ \"./dist/browser/ParticlesInfecter.js\"));\n return new ParticlesInfecter(container);\n });\n });\n}\n\n\n//# sourceURL=webpack://@tsparticles/plugin-infection/./dist/browser/index.js?\n}");
277
+ const minStage = 0;
278
+ class InfectionPluginInstance {
279
+ _container;
280
+ constructor(container) {
281
+ this._container = container;
282
+ this._container.infecter = new Infecter(this._container);
283
+ }
284
+ particleFillColor(particle) {
285
+ const options = this._container.actualOptions;
286
+ if (!particle.infection || !options.infection) {
287
+ return;
288
+ }
289
+ const infectionStage = particle.infection.stage, infection = options.infection, infectionStages = infection.stages;
290
+ return infectionStage === undefined ? undefined : infectionStages[infectionStage]?.color;
291
+ }
292
+ particleStrokeColor(particle) {
293
+ return this.particleFillColor(particle);
294
+ }
295
+ particlesSetup() {
296
+ const options = this._container.actualOptions;
297
+ if (!options.infection) {
298
+ return;
299
+ }
300
+ for (let i = 0; i < options.infection.infections; i++) {
301
+ const notInfected = this._container.particles.filter(p => {
302
+ const infP = p;
303
+ infP.infection ??= {};
304
+ return infP.infection.stage === undefined;
305
+ }), infected = engine.itemFromArray(notInfected);
306
+ if (!infected) {
307
+ continue;
308
+ }
309
+ this._container.infecter?.startInfection(infected, minStage);
310
+ }
311
+ }
312
+ }
58
313
 
59
- /***/ }
314
+ var InfectionPluginInstance$1 = /*#__PURE__*/Object.freeze({
315
+ __proto__: null,
316
+ InfectionPluginInstance: InfectionPluginInstance
317
+ });
60
318
 
61
- /******/ });
62
- /************************************************************************/
63
- /******/ // The module cache
64
- /******/ var __webpack_module_cache__ = {};
65
- /******/
66
- /******/ // The require function
67
- /******/ function __webpack_require__(moduleId) {
68
- /******/ // Check if module is in cache
69
- /******/ var cachedModule = __webpack_module_cache__[moduleId];
70
- /******/ if (cachedModule !== undefined) {
71
- /******/ return cachedModule.exports;
72
- /******/ }
73
- /******/ // Create a new module (and put it into the cache)
74
- /******/ var module = __webpack_module_cache__[moduleId] = {
75
- /******/ // no module.id needed
76
- /******/ // no module.loaded needed
77
- /******/ exports: {}
78
- /******/ };
79
- /******/
80
- /******/ // Execute the module function
81
- /******/ if (!(moduleId in __webpack_modules__)) {
82
- /******/ delete __webpack_module_cache__[moduleId];
83
- /******/ var e = new Error("Cannot find module '" + moduleId + "'");
84
- /******/ e.code = 'MODULE_NOT_FOUND';
85
- /******/ throw e;
86
- /******/ }
87
- /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
88
- /******/
89
- /******/ // Return the exports of the module
90
- /******/ return module.exports;
91
- /******/ }
92
- /******/
93
- /******/ // expose the modules object (__webpack_modules__)
94
- /******/ __webpack_require__.m = __webpack_modules__;
95
- /******/
96
- /************************************************************************/
97
- /******/ /* webpack/runtime/create fake namespace object */
98
- /******/ (() => {
99
- /******/ var getProto = Object.getPrototypeOf ? (obj) => (Object.getPrototypeOf(obj)) : (obj) => (obj.__proto__);
100
- /******/ var leafPrototypes;
101
- /******/ // create a fake namespace object
102
- /******/ // mode & 1: value is a module id, require it
103
- /******/ // mode & 2: merge all properties of value into the ns
104
- /******/ // mode & 4: return value when already ns object
105
- /******/ // mode & 16: return value when it's Promise-like
106
- /******/ // mode & 8|1: behave like require
107
- /******/ __webpack_require__.t = function(value, mode) {
108
- /******/ if(mode & 1) value = this(value);
109
- /******/ if(mode & 8) return value;
110
- /******/ if(typeof value === 'object' && value) {
111
- /******/ if((mode & 4) && value.__esModule) return value;
112
- /******/ if((mode & 16) && typeof value.then === 'function') return value;
113
- /******/ }
114
- /******/ var ns = Object.create(null);
115
- /******/ __webpack_require__.r(ns);
116
- /******/ var def = {};
117
- /******/ leafPrototypes = leafPrototypes || [null, getProto({}), getProto([]), getProto(getProto)];
118
- /******/ for(var current = mode & 2 && value; (typeof current == 'object' || typeof current == 'function') && !~leafPrototypes.indexOf(current); current = getProto(current)) {
119
- /******/ Object.getOwnPropertyNames(current).forEach((key) => (def[key] = () => (value[key])));
120
- /******/ }
121
- /******/ def['default'] = () => (value);
122
- /******/ __webpack_require__.d(ns, def);
123
- /******/ return ns;
124
- /******/ };
125
- /******/ })();
126
- /******/
127
- /******/ /* webpack/runtime/define property getters */
128
- /******/ (() => {
129
- /******/ // define getter functions for harmony exports
130
- /******/ __webpack_require__.d = (exports, definition) => {
131
- /******/ for(var key in definition) {
132
- /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
133
- /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
134
- /******/ }
135
- /******/ }
136
- /******/ };
137
- /******/ })();
138
- /******/
139
- /******/ /* webpack/runtime/ensure chunk */
140
- /******/ (() => {
141
- /******/ __webpack_require__.f = {};
142
- /******/ // This file contains only the entry chunk.
143
- /******/ // The chunk loading function for additional chunks
144
- /******/ __webpack_require__.e = (chunkId) => {
145
- /******/ return Promise.all(Object.keys(__webpack_require__.f).reduce((promises, key) => {
146
- /******/ __webpack_require__.f[key](chunkId, promises);
147
- /******/ return promises;
148
- /******/ }, []));
149
- /******/ };
150
- /******/ })();
151
- /******/
152
- /******/ /* webpack/runtime/get javascript chunk filename */
153
- /******/ (() => {
154
- /******/ // This function allow to reference async chunks
155
- /******/ __webpack_require__.u = (chunkId) => {
156
- /******/ // return url for filenames based on template
157
- /******/ return "" + chunkId + ".js";
158
- /******/ };
159
- /******/ })();
160
- /******/
161
- /******/ /* webpack/runtime/global */
162
- /******/ (() => {
163
- /******/ __webpack_require__.g = (function() {
164
- /******/ if (typeof globalThis === 'object') return globalThis;
165
- /******/ try {
166
- /******/ return this || new Function('return this')();
167
- /******/ } catch (e) {
168
- /******/ if (typeof window === 'object') return window;
169
- /******/ }
170
- /******/ })();
171
- /******/ })();
172
- /******/
173
- /******/ /* webpack/runtime/hasOwnProperty shorthand */
174
- /******/ (() => {
175
- /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
176
- /******/ })();
177
- /******/
178
- /******/ /* webpack/runtime/load script */
179
- /******/ (() => {
180
- /******/ var inProgress = {};
181
- /******/ var dataWebpackPrefix = "@tsparticles/plugin-infection:";
182
- /******/ // loadScript function to load a script via script tag
183
- /******/ __webpack_require__.l = (url, done, key, chunkId) => {
184
- /******/ if(inProgress[url]) { inProgress[url].push(done); return; }
185
- /******/ var script, needAttach;
186
- /******/ if(key !== undefined) {
187
- /******/ var scripts = document.getElementsByTagName("script");
188
- /******/ for(var i = 0; i < scripts.length; i++) {
189
- /******/ var s = scripts[i];
190
- /******/ if(s.getAttribute("src") == url || s.getAttribute("data-webpack") == dataWebpackPrefix + key) { script = s; break; }
191
- /******/ }
192
- /******/ }
193
- /******/ if(!script) {
194
- /******/ needAttach = true;
195
- /******/ script = document.createElement('script');
196
- /******/
197
- /******/ script.charset = 'utf-8';
198
- /******/ if (__webpack_require__.nc) {
199
- /******/ script.setAttribute("nonce", __webpack_require__.nc);
200
- /******/ }
201
- /******/ script.setAttribute("data-webpack", dataWebpackPrefix + key);
202
- /******/
203
- /******/ script.src = url;
204
- /******/ }
205
- /******/ inProgress[url] = [done];
206
- /******/ var onScriptComplete = (prev, event) => {
207
- /******/ // avoid mem leaks in IE.
208
- /******/ script.onerror = script.onload = null;
209
- /******/ clearTimeout(timeout);
210
- /******/ var doneFns = inProgress[url];
211
- /******/ delete inProgress[url];
212
- /******/ script.parentNode && script.parentNode.removeChild(script);
213
- /******/ doneFns && doneFns.forEach((fn) => (fn(event)));
214
- /******/ if(prev) return prev(event);
215
- /******/ }
216
- /******/ var timeout = setTimeout(onScriptComplete.bind(null, undefined, { type: 'timeout', target: script }), 120000);
217
- /******/ script.onerror = onScriptComplete.bind(null, script.onerror);
218
- /******/ script.onload = onScriptComplete.bind(null, script.onload);
219
- /******/ needAttach && document.head.appendChild(script);
220
- /******/ };
221
- /******/ })();
222
- /******/
223
- /******/ /* webpack/runtime/make namespace object */
224
- /******/ (() => {
225
- /******/ // define __esModule on exports
226
- /******/ __webpack_require__.r = (exports) => {
227
- /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
228
- /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
229
- /******/ }
230
- /******/ Object.defineProperty(exports, '__esModule', { value: true });
231
- /******/ };
232
- /******/ })();
233
- /******/
234
- /******/ /* webpack/runtime/publicPath */
235
- /******/ (() => {
236
- /******/ var scriptUrl;
237
- /******/ if (__webpack_require__.g.importScripts) scriptUrl = __webpack_require__.g.location + "";
238
- /******/ var document = __webpack_require__.g.document;
239
- /******/ if (!scriptUrl && document) {
240
- /******/ if (document.currentScript && document.currentScript.tagName.toUpperCase() === 'SCRIPT')
241
- /******/ scriptUrl = document.currentScript.src;
242
- /******/ if (!scriptUrl) {
243
- /******/ var scripts = document.getElementsByTagName("script");
244
- /******/ if(scripts.length) {
245
- /******/ var i = scripts.length - 1;
246
- /******/ while (i > -1 && (!scriptUrl || !/^http(s?):/.test(scriptUrl))) scriptUrl = scripts[i--].src;
247
- /******/ }
248
- /******/ }
249
- /******/ }
250
- /******/ // When supporting browsers where an automatic publicPath is not supported you must specify an output.publicPath manually via configuration
251
- /******/ // or pass an empty string ("") and set the __webpack_public_path__ variable from your code to use your own logic.
252
- /******/ if (!scriptUrl) throw new Error("Automatic publicPath is not supported in this browser");
253
- /******/ scriptUrl = scriptUrl.replace(/^blob:/, "").replace(/#.*$/, "").replace(/\?.*$/, "").replace(/\/[^\/]+$/, "/");
254
- /******/ __webpack_require__.p = scriptUrl;
255
- /******/ })();
256
- /******/
257
- /******/ /* webpack/runtime/jsonp chunk loading */
258
- /******/ (() => {
259
- /******/ // no baseURI
260
- /******/
261
- /******/ // object to store loaded and loading chunks
262
- /******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched
263
- /******/ // [resolve, reject, Promise] = chunk loading, 0 = chunk loaded
264
- /******/ var installedChunks = {
265
- /******/ "tsparticles.plugin.infection": 0
266
- /******/ };
267
- /******/
268
- /******/ __webpack_require__.f.j = (chunkId, promises) => {
269
- /******/ // JSONP chunk loading for javascript
270
- /******/ var installedChunkData = __webpack_require__.o(installedChunks, chunkId) ? installedChunks[chunkId] : undefined;
271
- /******/ if(installedChunkData !== 0) { // 0 means "already installed".
272
- /******/
273
- /******/ // a Promise means "currently loading".
274
- /******/ if(installedChunkData) {
275
- /******/ promises.push(installedChunkData[2]);
276
- /******/ } else {
277
- /******/ if(true) { // all chunks have JS
278
- /******/ // setup Promise in chunk cache
279
- /******/ var promise = new Promise((resolve, reject) => (installedChunkData = installedChunks[chunkId] = [resolve, reject]));
280
- /******/ promises.push(installedChunkData[2] = promise);
281
- /******/
282
- /******/ // start chunk loading
283
- /******/ var url = __webpack_require__.p + __webpack_require__.u(chunkId);
284
- /******/ // create error before stack unwound to get useful stacktrace later
285
- /******/ var error = new Error();
286
- /******/ var loadingEnded = (event) => {
287
- /******/ if(__webpack_require__.o(installedChunks, chunkId)) {
288
- /******/ installedChunkData = installedChunks[chunkId];
289
- /******/ if(installedChunkData !== 0) installedChunks[chunkId] = undefined;
290
- /******/ if(installedChunkData) {
291
- /******/ var errorType = event && (event.type === 'load' ? 'missing' : event.type);
292
- /******/ var realSrc = event && event.target && event.target.src;
293
- /******/ error.message = 'Loading chunk ' + chunkId + ' failed.\n(' + errorType + ': ' + realSrc + ')';
294
- /******/ error.name = 'ChunkLoadError';
295
- /******/ error.type = errorType;
296
- /******/ error.request = realSrc;
297
- /******/ installedChunkData[1](error);
298
- /******/ }
299
- /******/ }
300
- /******/ };
301
- /******/ __webpack_require__.l(url, loadingEnded, "chunk-" + chunkId, chunkId);
302
- /******/ }
303
- /******/ }
304
- /******/ }
305
- /******/ };
306
- /******/
307
- /******/ // no prefetching
308
- /******/
309
- /******/ // no preloaded
310
- /******/
311
- /******/ // no HMR
312
- /******/
313
- /******/ // no HMR manifest
314
- /******/
315
- /******/ // no on chunks loaded
316
- /******/
317
- /******/ // install a JSONP callback for chunk loading
318
- /******/ var webpackJsonpCallback = (parentChunkLoadingFunction, data) => {
319
- /******/ var [chunkIds, moreModules, runtime] = data;
320
- /******/ // add "moreModules" to the modules object,
321
- /******/ // then flag all "chunkIds" as loaded and fire callback
322
- /******/ var moduleId, chunkId, i = 0;
323
- /******/ if(chunkIds.some((id) => (installedChunks[id] !== 0))) {
324
- /******/ for(moduleId in moreModules) {
325
- /******/ if(__webpack_require__.o(moreModules, moduleId)) {
326
- /******/ __webpack_require__.m[moduleId] = moreModules[moduleId];
327
- /******/ }
328
- /******/ }
329
- /******/ if(runtime) var result = runtime(__webpack_require__);
330
- /******/ }
331
- /******/ if(parentChunkLoadingFunction) parentChunkLoadingFunction(data);
332
- /******/ for(;i < chunkIds.length; i++) {
333
- /******/ chunkId = chunkIds[i];
334
- /******/ if(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {
335
- /******/ installedChunks[chunkId][0]();
336
- /******/ }
337
- /******/ installedChunks[chunkId] = 0;
338
- /******/ }
339
- /******/
340
- /******/ }
341
- /******/
342
- /******/ var chunkLoadingGlobal = this["webpackChunk_tsparticles_plugin_infection"] = this["webpackChunk_tsparticles_plugin_infection"] || [];
343
- /******/ chunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));
344
- /******/ chunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));
345
- /******/ })();
346
- /******/
347
- /************************************************************************/
348
- /******/
349
- /******/ // startup
350
- /******/ // Load entry module and return exports
351
- /******/ // This entry module can't be inlined because the eval devtool is used.
352
- /******/ var __webpack_exports__ = __webpack_require__("./dist/browser/index.js");
353
- /******/
354
- /******/ return __webpack_exports__;
355
- /******/ })()
356
- ;
357
- });
319
+ exports.loadInfectionPlugin = loadInfectionPlugin;
320
+
321
+ }));
322
+ Object.assign(globalThis.window || globalThis, { loadInfectionPlugin: (globalThis.__tsParticlesInternals.plugins.infection || {}).loadInfectionPlugin });
323
+ delete (globalThis.window || globalThis).tsparticlesInternalExports;