/* Voyage Fleet — icon set.
 * Built on the ANVOS icon style: filled/stroke 1.75, currentColor, 20px optical grid.
 * Extends the base JRNI glyphs with fleet-domain icons (git, cloud, module, deploy…).
 * Exported to window.Icons.
 */

const Icons = (function () {
  const stroke = (paths, viewBox = "0 0 20 20") => ({ size = 16, color = "currentColor", style } = {}) =>
    React.createElement("svg", {
      width: size, height: size, viewBox, fill: "none", stroke: color,
      strokeWidth: 1.75, strokeLinecap: "round", strokeLinejoin: "round", style,
    }, paths);

  const path = (d) => React.createElement("path", { d, key: d });
  const circle = (cx, cy, r) => React.createElement("circle", { cx, cy, r, key: `c${cx}${cy}${r}` });
  const rect = (x, y, w, h, rx = 0) => React.createElement("rect", { x, y, width: w, height: h, rx, key: `r${x}${y}${w}${h}` });
  const line = (x1, y1, x2, y2) => React.createElement("line", { x1, y1, x2, y2, key: `l${x1}${y1}${x2}${y2}` });

  return {
    /* ── chrome ── */
    Search:   stroke([circle(7,7,5), path("m11 11 3 3")], "0 0 16 16"),
    Bell:     stroke([path("M10 3a4 4 0 0 0-4 4v3l-2 3h12l-2-3V7a4 4 0 0 0-4-4z"), path("M8 16a2 2 0 0 0 4 0")]),
    Filter:   stroke([path("M2 4h12M4 8h8M6 12h4")], "0 0 16 16"),
    Sort:     stroke([path("M3 4h10M3 8h6M3 12h3M11 9l3 3-3 3M14 12V4")], "0 0 16 16"),
    Settings: stroke([circle(10,10,3), path("M10 2v3M10 15v3M2 10h3M15 10h3M4.2 4.2l2.1 2.1M13.7 13.7l2.1 2.1M4.2 15.8l2.1-2.1M13.7 6.3l2.1-2.1")]),
    Plus:     stroke([path("M8 3v10M3 8h10")], "0 0 16 16"),
    Minus:    stroke([path("M3 8h10")], "0 0 16 16"),
    X:        stroke([path("M4 4l8 8M12 4l-8 8")], "0 0 16 16"),
    Check:    stroke([path("m4 10 4 4 8-8")]),
    Check2:   stroke([path("M3 10l4 4 10-10")]),
    Refresh:  stroke([path("M2 8a6 6 0 0 1 10.5-4M14 8a6 6 0 0 1-10.5 4M12 3v3h-3M4 13v-3h3")], "0 0 16 16"),
    Dots:     stroke([circle(4,10,1.2), circle(10,10,1.2), circle(16,10,1.2)]),
    DotsV:    stroke([circle(10,4,1.2), circle(10,10,1.2), circle(10,16,1.2)]),
    Drag:     stroke([circle(7,5,1.2), circle(13,5,1.2), circle(7,10,1.2), circle(13,10,1.2), circle(7,15,1.2), circle(13,15,1.2)]),
    Download: stroke([path("M10 3v10m0 0-4-4m4 4 4-4M3 16h14")]),
    Upload:   stroke([path("M10 16V6m0 0-4 4m4-4 4 4M3 4h14")]),
    External: stroke([path("M7 4H4v12h12v-3M10 4h6v6M10 10l6-6")]),
    Copy:     stroke([rect(6,6,11,11,2), rect(3,3,11,11,2)]),
    Pencil:   stroke([path("M3 17l4-1L17 6l-3-3L4 13l-1 4z"), path("M13 4l3 3")]),
    Trash:    stroke([path("M3 5h14M8 5V3h4v2M5 5l1 12h8l1-12")]),
    HandHelp: stroke([circle(10,10,7), path("M8 8a2 2 0 1 1 3.5 1.3c-.6.5-1.5.9-1.5 1.7M10 14h.01")]),
    Eye:      stroke([path("M1 10s3-6 9-6 9 6 9 6-3 6-9 6-9-6-9-6z"), circle(10,10,2.5)]),
    Lock:     stroke([rect(4,9,12,9,2), path("M7 9V6a3 3 0 0 1 6 0v3")]),
    Logout:   stroke([path("M8 4H4v12h4M14 7l3 3-3 3M9 10h8")]),
    Info:     stroke([circle(10,10,7), path("M10 9v5M10 7h.01")]),
    Warning:  stroke([path("M10 2 18 17H2z"), path("M10 8v4M10 15h.01")]),
    Clock:    stroke([circle(10,10,7), path("M10 6v4l3 2")]),
    Star:     stroke([path("m10 2 2.5 5.5L18 8l-4 4 1 6-5-3-5 3 1-6-4-4 5.5-.5z")]),
    Pause:    stroke([rect(5,4,3,12,1), rect(12,4,3,12,1)]),
    Play:     stroke([path("M6 4l10 6-10 6z")]),
    Stop:     stroke([rect(5,5,10,10,2)]),
    Pin:      stroke([path("M10 18s6-6 6-11a6 6 0 0 0-12 0c0 5 6 11 6 11z"), circle(10,7,2)]),
    User:     stroke([circle(10,6,3), path("M3 18c0-3.5 3-6 7-6s7 2.5 7 6")]),
    Users:    stroke([circle(7,7,3), path("M2 17c0-2.5 2.2-4.5 5-4.5s5 2 5 4.5"), circle(14,7,2.5), path("M18 15.5c0-1.7-1.3-3-3-3")]),
    Csv:      stroke([path("M4 2h6l3 3v9a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V3a1 1 0 0 1 1-1z"), path("M10 2v3h3M5 11h6")], "0 0 16 16"),
    Send:     stroke([path("M3 10 17 3l-3 14-3-7-8 0z")]),
    Mail:     stroke([rect(2,4,16,12,2), path("m2 6 8 6 8-6")]),
    Chevron:  function ({ dir = "down", size = 14, color = "currentColor" } = {}) {
      const r = { left: 90, right: -90, down: 0, up: 180 }[dir];
      return React.createElement("svg", {
        width: size, height: size, viewBox: "0 0 16 16", fill: "none", stroke: color, strokeWidth: 1.75,
        strokeLinecap: "round", strokeLinejoin: "round", style: { transform: `rotate(${r}deg)`, flexShrink: 0 }
      }, path("m4 6 4 4 4-4"));
    },
    Caret: stroke([path("m5 7 5 5 5-5")], "0 0 20 20"),

    /* ── fleet domain ── */
    Fleet:    stroke([rect(2.5,3,6,6,1.5), rect(11.5,3,6,6,1.5), rect(2.5,11.5,6,6,1.5), rect(11.5,11.5,6,6,1.5)]),
    Gauge:    stroke([path("M3 15a7 7 0 1 1 14 0"), path("M10 15l4-4"), circle(10,15,1.2)]),
    Drift:    stroke([path("M3 6h7M3 10h5M3 14h9"), path("M14 4l3 3-3 3"), path("M17 7h-5")]),
    Layers:   stroke([path("M10 3 3 7l7 4 7-4-7-4z"), path("M3 11l7 4 7-4"), path("M3 14.5l7 4 7-4")]),
    Module:   stroke([path("M10 2.5 3.5 6v8L10 17.5 16.5 14V6L10 2.5z"), path("M3.5 6 10 9.5 16.5 6M10 9.5V17.5")]),
    Release:  stroke([path("M10 2.5c3 1.5 4.5 4.5 4.5 8 0 1.5-1 3-1.5 4l-6 0c-.5-1-1.5-2.5-1.5-4 0-3.5 1.5-6.5 4.5-8z"), circle(10,8,1.8), path("M7 15l-1.5 2.5M13 15l1.5 2.5")]),
    Git:      stroke([circle(5,5,2), circle(5,15,2), circle(14,8,2), path("M5 7v6M14 10v1c0 1.5-1 2-3 2H8.5")]),
    GitPr:    stroke([circle(5,5,2), circle(5,15,2), path("M5 7v6"), circle(14,15,2), path("M14 13V8a3 3 0 0 0-3-3H8M10 3 8 5l2 2")]),
    Github:   function ({ size = 16, color = "currentColor" } = {}) {
      return React.createElement("svg", { width: size, height: size, viewBox: "0 0 20 20", fill: color },
        React.createElement("path", { key: "gh", fillRule: "evenodd", clipRule: "evenodd", d: "M10 1.5a8.5 8.5 0 0 0-2.69 16.57c.43.08.58-.18.58-.4l-.01-1.49c-2.36.51-2.86-1.0-2.86-1.0-.39-.98-.95-1.24-.95-1.24-.77-.53.06-.52.06-.52.85.06 1.3.88 1.3.88.76 1.3 1.99.92 2.47.7.08-.55.3-.92.54-1.13-1.88-.21-3.86-.94-3.86-4.18 0-.92.33-1.68.87-2.27-.09-.21-.38-1.07.08-2.24 0 0 .71-.23 2.32.87a8.06 8.06 0 0 1 4.22 0c1.61-1.1 2.32-.87 2.32-.87.46 1.17.17 2.03.08 2.24.54.59.87 1.35.87 2.27 0 3.25-1.98 3.97-3.87 4.18.3.26.58.78.58 1.58l-.01 2.34c0 .23.15.49.59.4A8.5 8.5 0 0 0 10 1.5z" })
      );
    },
    Cloud:    stroke([path("M6 15a3.5 3.5 0 0 1-.4-6.98A4.5 4.5 0 0 1 14.5 9 3 3 0 0 1 14 15H6z")]),
    Cloudflare: stroke([path("M5 14a3 3 0 0 1 .2-5.99A4 4 0 0 1 13 8.5a2.6 2.6 0 0 1 .4 5.5H5z"), path("M13.5 11.5 18 11")]),
    Database: stroke([path("M4 5c0-1.1 2.7-2 6-2s6 .9 6 2-2.7 2-6 2-6-.9-6-2z"), path("M4 5v5c0 1.1 2.7 2 6 2s6-.9 6-2V5"), path("M4 10v5c0 1.1 2.7 2 6 2s6-.9 6-2v-5")]),
    Migration: stroke([path("M4 6h8M4 6l2-2M4 6l2 2"), path("M16 14H8M16 14l-2-2M16 14l-2 2")]),
    Server:   stroke([rect(3,3,14,5,1.5), rect(3,12,14,5,1.5), path("M6.5 5.5h.01M6.5 14.5h.01"), line(10,5.5,14,5.5), line(10,14.5,14,14.5)]),
    Deploy:   stroke([path("M10 2c2.5 1.5 4 4 4 7l-1.5 3h-5L6 9c0-3 1.5-5.5 4-7z"), circle(10,8,1.5), path("M8 15l-1 3M12 15l1 3M10 15v3")]),
    Bolt:     stroke([path("m11 2-7 10h5l-2 6 7-10h-5z")]),

    Audit:    stroke([rect(4,3,12,14,1.5), path("M7 7h6M7 10h6M7 13h3")]),
    Skill:    stroke([path("M10 2 3 5.5v5c0 4 3 6.5 7 7.5 4-1 7-3.5 7-7.5v-5L10 2z"), path("m7 10 2 2 4-4")]),
    Region:   stroke([circle(10,10,7), path("M3 10h14M10 3c2.2 2 2.2 12 0 14M10 3c-2.2 2-2.2 12 0 14")]),
    Key:      stroke([circle(6,10,3.5), path("M9.5 10H17l-1.5 2M14 10v2.5")]),
    Branch:   stroke([circle(6,5,2), circle(6,15,2), circle(14,5,2), path("M6 7v6M14 7v1c0 2-2 3-4 3H6")]),
    Tag:      stroke([path("M3 11V4h7l7 7-7 7z"), circle(7,8,1.5)]),
    List:     stroke([path("M3 5h14M3 10h14M3 15h14")]),
    Grid:     stroke([rect(3,3,5,5,1), rect(12,3,5,5,1), rect(3,12,5,5,1), rect(12,12,5,5,1)]),
    Rocket:   stroke([path("M10 2c3 2 4 5 4 8l-2 3H8l-2-3c0-3 1-6 4-8z"), circle(10,8,1.5), path("M7 14c-1.5.5-2 2-2 4 2 0 3.5-.5 4-2M13 14c1.5.5 2 2 2 4-2 0-3.5-.5-4-2")]),
    Plug:     stroke([path("M7 2v5M13 2v5"), rect(5,7,10,5,2), path("M10 12v4")]),
    Building: stroke([rect(4,3,12,15,1), path("M7 7h.01M10 7h.01M13 7h.01M7 10h.01M10 10h.01M13 10h.01M7 13h.01M10 13h.01M13 13h.01M8 18v-3h4v3")]),
    Box:      stroke([path("M10 2.5 3.5 6v8L10 17.5 16.5 14V6L10 2.5z"), path("M3.5 6 10 9.5 16.5 6M10 9.5V17.5")]),
    Shield:   stroke([path("M10 2 3.5 5v5c0 4 3 6.5 6.5 8 3.5-1.5 6.5-4 6.5-8V5L10 2z")]),
    Globe:    stroke([circle(10,10,7), path("M3 10h14M10 3c2.2 2 2.2 12 0 14M10 3c-2.2 2-2.2 12 0 14")]),
    Terminal: stroke([rect(2.5,4,15,12,2), path("M6 9l3 2-3 2M11 13h4")]),
    ChartBar: stroke([path("M3 16h14M5 16V9M9 16V5M13 16v-5M17 16v-8")]),
    Moon:     stroke([path("M16 11a6 6 0 1 1-7-7 5 5 0 0 0 7 7z")]),
    Bot:      stroke([rect(4,7,12,9,2.5), path("M10 4v3"), circle(10,3.2,1.3), circle(7.5,11,0.9), circle(12.5,11,0.9), path("M8 14h4")]),
    Park:     stroke([circle(10,10,7), path("M8 14V7h2.5a2 2 0 0 1 0 4H8")]),
    Skip:     stroke([path("M5 5l7 5-7 5zM14 5v10")]),
    Rollback: stroke([path("M5 8a6 6 0 1 1-1 3"), path("M3 5v3h3")]),
    DotLive:  stroke([circle(10,10,3)]),
    JrniDot:  function ({ size = 22 } = {}) {
      return React.createElement("svg", { width: size * 220/70, height: size, viewBox: "0 0 220 70", "aria-label": "JRNI" },
        React.createElement("g", { fill: "#262265", key: "g" },
          React.createElement("text", { key: "t", x: 0, y: 56, fontSize: 62, fontWeight: 800, letterSpacing: -2, fontFamily: "var(--jrni-font-family-sans)" }, "jrni"),
          React.createElement("circle", { key: "c", cx: 206, cy: 14, r: 6 })
        )
      );
    },
  };
})();

window.Icons = Icons;
