import { a6 as n, j as a, r as Z, L as r, a7 as G } from "./index-CsBCemCF.js";
import { useContext as i, memo as m, useMemo as g } from "react";
import { createPortal as W } from "react-dom";
const v = ({
  children: l
}) => {
  const t = i(n)?.();
  return t ? W(l, t) : /* @__PURE__ */ a.jsx(a.Fragment, { children: l });
};
function B() {
  return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop).";
}
const u = /* @__PURE__ */ Z("div", process.env.NODE_ENV === "production" ? {
  target: "ecnfqzf0"
} : {
  target: "ecnfqzf0",
  label: "StyledParticles"
})(process.env.NODE_ENV === "production" ? {
  name: "my9yfq",
  styles: "@media print{display:none;}"
} : {
  name: "my9yfq",
  styles: "@media print{display:none;}/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi9ob21lL3J1bm5lci93b3JrL3N0bGl0ZS9zdGxpdGUvc3RyZWFtbGl0L2Zyb250ZW5kL2xpYi9zcmMvY29tcG9uZW50cy9lbGVtZW50cy9QYXJ0aWNsZXMvc3R5bGVkLWNvbXBvbmVudHMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBa0IrQiIsImZpbGUiOiIvaG9tZS9ydW5uZXIvd29yay9zdGxpdGUvc3RsaXRlL3N0cmVhbWxpdC9mcm9udGVuZC9saWIvc3JjL2NvbXBvbmVudHMvZWxlbWVudHMvUGFydGljbGVzL3N0eWxlZC1jb21wb25lbnRzLnRzIiwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4gKiBDb3B5cmlnaHQgKGMpIFN0cmVhbWxpdCBJbmMuICgyMDE4LTIwMjIpIFNub3dmbGFrZSBJbmMuICgyMDIyLTIwMjUpXG4gKlxuICogTGljZW5zZWQgdW5kZXIgdGhlIEFwYWNoZSBMaWNlbnNlLCBWZXJzaW9uIDIuMCAodGhlIFwiTGljZW5zZVwiKTtcbiAqIHlvdSBtYXkgbm90IHVzZSB0aGlzIGZpbGUgZXhjZXB0IGluIGNvbXBsaWFuY2Ugd2l0aCB0aGUgTGljZW5zZS5cbiAqIFlvdSBtYXkgb2J0YWluIGEgY29weSBvZiB0aGUgTGljZW5zZSBhdFxuICpcbiAqICAgICBodHRwOi8vd3d3LmFwYWNoZS5vcmcvbGljZW5zZXMvTElDRU5TRS0yLjBcbiAqXG4gKiBVbmxlc3MgcmVxdWlyZWQgYnkgYXBwbGljYWJsZSBsYXcgb3IgYWdyZWVkIHRvIGluIHdyaXRpbmcsIHNvZnR3YXJlXG4gKiBkaXN0cmlidXRlZCB1bmRlciB0aGUgTGljZW5zZSBpcyBkaXN0cmlidXRlZCBvbiBhbiBcIkFTIElTXCIgQkFTSVMsXG4gKiBXSVRIT1VUIFdBUlJBTlRJRVMgT1IgQ09ORElUSU9OUyBPRiBBTlkgS0lORCwgZWl0aGVyIGV4cHJlc3Mgb3IgaW1wbGllZC5cbiAqIFNlZSB0aGUgTGljZW5zZSBmb3IgdGhlIHNwZWNpZmljIGxhbmd1YWdlIGdvdmVybmluZyBwZXJtaXNzaW9ucyBhbmRcbiAqIGxpbWl0YXRpb25zIHVuZGVyIHRoZSBMaWNlbnNlLlxuICovXG5cbmltcG9ydCBzdHlsZWQgZnJvbSBcIkBlbW90aW9uL3N0eWxlZFwiXG5cbmV4cG9ydCBjb25zdCBTdHlsZWRQYXJ0aWNsZXMgPSBzdHlsZWQuZGl2KHtcbiAgXCJAbWVkaWEgcHJpbnRcIjoge1xuICAgIGRpc3BsYXk6IFwibm9uZVwiLFxuICB9LFxufSlcbiJdfQ== */",
  toString: B
}), p = ({
  className: l,
  scriptRunId: t,
  numParticles: e,
  numParticleTypes: c,
  ParticleComponent: b
}) => {
  const {
    libConfig: s
  } = i(r), o = g(() => G(e).map(() => Math.floor(Math.random() * c)), [e, c]);
  return (
    // Keys should be unique each time, so React replaces the images in the DOM and their animations
    // actually rerun.
    /* @__PURE__ */ a.jsx(u, { className: l, "data-testid": l, children: o.map((I, d) => /* @__PURE__ */ a.jsx(
      b,
      {
        particleType: I,
        resourceCrossOriginMode: s.resourceCrossOriginMode
      },
      t + d
    )) })
  );
}, C = m(p);
export {
  C as P,
  v as R
};
//# sourceMappingURL=Particles-g7RgLbWv.js.map
