"use strict";
var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
  for (var name in all)
    __defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
  if (from && typeof from === "object" || typeof from === "function") {
    for (let key of __getOwnPropNames(from))
      if (!__hasOwnProp.call(to, key) && key !== except)
        __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  }
  return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
  // If the importer is in node compatibility mode or this is not an ESM
  // file that has been converted to a CommonJS file using a Babel-
  // compatible transform (i.e. "__esModule" has not been set), then set
  // "default" to the CommonJS "module.exports" for node compatibility.
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
  mod
));
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var loader_exports = {};
__export(loader_exports, {
  Loader: () => Loader
});
module.exports = __toCommonJS(loader_exports);
var import_wix_ui_icons_common = require("@wix/wix-ui-icons-common");
var import_classnames = __toESM(require("classnames"));
var import_react = __toESM(require("react"));
var import_loader_scss = __toESM(require("./loader-scss.js"));
const Loader = () => {
  return /* @__PURE__ */ import_react.default.createElement("div", { className: import_loader_scss.default.root }, /* @__PURE__ */ import_react.default.createElement("div", { className: import_loader_scss.default.leftSide }, /* @__PURE__ */ import_react.default.createElement(Line, null), /* @__PURE__ */ import_react.default.createElement(Circle, null)), /* @__PURE__ */ import_react.default.createElement("div", { className: import_loader_scss.default.scroller, "data-animated": "true" }, /* @__PURE__ */ import_react.default.createElement("div", { className: import_loader_scss.default.scrollerInner }, [...SCROLL_ITEMS, ...SCROLL_ITEMS].map((item, index) => /* @__PURE__ */ import_react.default.createElement(ScrollItem, { key: index, width: item.width, arrowPosition: item.arrowPosition })))));
};
const SCROLL_ITEMS = [
  { width: "75%" },
  { width: "100%" },
  { width: "75%", arrowPosition: "right" },
  { width: "100%" },
  { width: "75%" },
  { width: "100%", arrowPosition: "left" }
];
const ScrollItem = ({ width, arrowPosition }) => {
  if (!arrowPosition) {
    return /* @__PURE__ */ import_react.default.createElement(Bar, { width });
  }
  return /* @__PURE__ */ import_react.default.createElement("div", { style: { display: "flex", gap: "8px", alignItems: "center" } }, arrowPosition === "left" && /* @__PURE__ */ import_react.default.createElement(Arrow, { direction: "left" }), /* @__PURE__ */ import_react.default.createElement(Bar, { width }), arrowPosition === "right" && /* @__PURE__ */ import_react.default.createElement(Arrow, { direction: "right" }));
};
const Bar = ({ width }) => {
  return /* @__PURE__ */ import_react.default.createElement(
    "div",
    {
      style: {
        width,
        height: "13px",
        borderRadius: "1000px",
        background: "linear-gradient(90deg, #d6e6fe 0%, #e7f0ff 100%)"
      }
    }
  );
};
const Arrow = ({
  direction = "right",
  ...props
}) => {
  return /* @__PURE__ */ import_react.default.createElement(
    "svg",
    {
      xmlns: "http://www.w3.org/2000/svg",
      width: "7",
      height: "8",
      viewBox: "0 0 7 8",
      fill: "none",
      style: {
        transform: direction === "left" ? "rotate(180deg)" : "none"
      },
      ...props
    },
    /* @__PURE__ */ import_react.default.createElement(
      "path",
      {
        d: "M6.35205 2.816L5.10216e-05 0V1.456L5.23205 3.68L5.10216e-05 5.904V7.424L6.35205 4.592V2.816Z",
        fill: "#116DFF"
      }
    )
  );
};
const Circle = () => {
  const [currentIndex, setCurrentIndex] = import_react.default.useState(0);
  import_react.default.useEffect(() => {
    const interval = setInterval(() => {
      setCurrentIndex((prevIndex) => (prevIndex + 1) % ICONS.length);
    }, 1500);
    return () => clearInterval(interval);
  }, []);
  return /* @__PURE__ */ import_react.default.createElement(
    "div",
    {
      style: {
        width: "30px",
        height: "30px",
        borderRadius: "50%",
        background: "linear-gradient(45deg, #A8CAFF 0%, #FFF 100%)",
        display: "flex",
        alignItems: "center",
        justifyContent: "center",
        position: "relative"
      }
    },
    ICONS.map((Icon, index) => /* @__PURE__ */ import_react.default.createElement(
      Icon,
      {
        key: index,
        className: (0, import_classnames.default)(import_loader_scss.default.icon, index === currentIndex && import_loader_scss.default.visible)
      }
    ))
  );
};
const ICONS = [import_wix_ui_icons_common.SparklesFilledSmall, import_wix_ui_icons_common.DesignSmall, import_wix_ui_icons_common.RenameSmall, import_wix_ui_icons_common.CodeObjectSmall];
const Line = () => {
  return /* @__PURE__ */ import_react.default.createElement("div", { className: import_loader_scss.default.line });
};
//# sourceMappingURL=loader.js.map
