@pixerate/editor-react 0.140.0 → 0.142.0

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.
@@ -190,7 +190,7 @@ function useImageEffectsTools(registry, controller, options = {}) {
190
190
  }
191
191
 
192
192
  // src/image-editor/ImageEditor.tsx
193
- import React18, { useRef as useRef11, useEffect as useEffect16, useState as useState19 } from "react";
193
+ import React19, { useRef as useRef11, useEffect as useEffect17, useState as useState20 } from "react";
194
194
  import {
195
195
  normalizeProcessVersion,
196
196
  LATEST_PROCESS_VERSION,
@@ -3054,6 +3054,7 @@ var ContentAwareFillWorkspace = ({ controller, onClose, className = "" }) => {
3054
3054
  Math.round(zoom * 100),
3055
3055
  "%"
3056
3056
  ] }),
3057
+ !session.showsWholeImage && /* @__PURE__ */ jsx16("button", { type: "button", className: button2, title: "Show (and sample from) more of the image around the selection", onClick: () => session.expandView(), children: "Expand View" }),
3057
3058
  session.computing && /* @__PURE__ */ jsx16("span", { role: "status", className: "text-muted-foreground", children: "Updating preview\u2026" })
3058
3059
  ] }),
3059
3060
  /* @__PURE__ */ jsxs14("div", { className: "flex-1 grid grid-cols-2 gap-2 p-2 min-h-0", children: [
@@ -3125,7 +3126,8 @@ var ContentAwareFillWorkspace = ({ controller, onClose, className = "" }) => {
3125
3126
  value: settings.output,
3126
3127
  options: [
3127
3128
  { value: "new-layer", label: "New Layer" },
3128
- { value: "current", label: "Current Layer" }
3129
+ { value: "current", label: "Current Layer" },
3130
+ { value: "duplicate-layer", label: "Duplicate Layer" }
3129
3131
  ],
3130
3132
  onChange: (v) => set({ output: v })
3131
3133
  }
@@ -4037,14 +4039,121 @@ var ChannelsPanel = ({ controller, thumbnailSize = 32, className = "" }) => {
4037
4039
  ] });
4038
4040
  };
4039
4041
 
4040
- // src/image-editor/FreeTransformOptionsBar.tsx
4042
+ // src/image-editor/PathsPanel.tsx
4041
4043
  import { useEffect as useEffect13, useState as useState16 } from "react";
4042
- import { FREE_TRANSFORM_FIELDS, FREE_TRANSFORM_MODE_OPTIONS, INTERPOLATIONS, TRANSFORM_ANCHORS, WARP_GRID_OPTIONS, WARP_STYLE_OPTIONS } from "@pixerate/editor/image-editor";
4044
+ import { pathSvgData, selectionModeFromModifiers as selectionModeFromModifiers2 } from "@pixerate/editor/image-editor";
4043
4045
  import { jsx as jsx20, jsxs as jsxs18 } from "react/jsx-runtime";
4046
+ var btn3 = (on = false) => `px-2 py-1 rounded-md border text-[11px] transition-colors disabled:opacity-40 ${on ? "bg-primary border-primary text-primary-foreground" : "bg-background border-border text-foreground hover:bg-accent hover:text-accent-foreground"}`;
4047
+ var PathsPanel = ({ controller, thumbnailSize = 32, className = "" }) => {
4048
+ const [, setTick] = useState16(0);
4049
+ useEffect13(() => controller.subscribe(() => setTick((n) => n + 1)), [controller]);
4050
+ const [renaming, setRenaming] = useState16(null);
4051
+ const [color, setColor] = useState16("#000000");
4052
+ const [width, setWidth] = useState16(2);
4053
+ const [error, setError] = useState16(null);
4054
+ const paths = controller.getPaths();
4055
+ const activeId = controller.getState().activePathId ?? null;
4056
+ const active = paths.find((p) => p.id === activeId) ?? null;
4057
+ const hasSelection = Boolean(controller.getSelection());
4058
+ const { width: w, height: h } = controller.getState().imageDimensions;
4059
+ const attempt = (fn) => {
4060
+ setError(null);
4061
+ try {
4062
+ fn();
4063
+ } catch (err) {
4064
+ setError(err instanceof Error ? err.message : String(err));
4065
+ }
4066
+ };
4067
+ return /* @__PURE__ */ jsxs18("div", { "data-testid": "paths-panel", className: `flex flex-col gap-2 text-xs ${className}`, children: [
4068
+ /* @__PURE__ */ jsx20("span", { className: imageSectionTitleClass, children: "Paths" }),
4069
+ paths.length === 0 && /* @__PURE__ */ jsx20("p", { className: "text-muted-foreground", children: "No paths. Make a work path from a selection." }),
4070
+ /* @__PURE__ */ jsx20("ul", { role: "list", className: "flex flex-col gap-0.5", children: paths.map((p) => /* @__PURE__ */ jsxs18(
4071
+ "li",
4072
+ {
4073
+ "data-testid": "path-row",
4074
+ "aria-current": p.id === activeId ? "true" : void 0,
4075
+ className: `flex items-center gap-1.5 px-1.5 py-1 rounded cursor-pointer select-none ${p.id === activeId ? "bg-primary/30 ring-1 ring-primary" : "hover:bg-muted"}`,
4076
+ onClick: () => attempt(() => controller.setActivePath(p.id)),
4077
+ onDoubleClick: () => setRenaming(p.id),
4078
+ children: [
4079
+ /* @__PURE__ */ jsx20("svg", { "aria-hidden": "true", viewBox: `0 0 ${w || 1} ${h || 1}`, style: { width: thumbnailSize, height: thumbnailSize }, className: "shrink-0 rounded ring-1 ring-border bg-background", children: /* @__PURE__ */ jsx20("path", { d: pathSvgData(p), fill: "currentColor", fillOpacity: 0.25, stroke: "currentColor", strokeWidth: Math.max(w, h) / 64, fillRule: p.fillRule ?? "nonzero" }) }),
4080
+ renaming === p.id ? /* @__PURE__ */ jsx20(
4081
+ "input",
4082
+ {
4083
+ autoFocus: true,
4084
+ "aria-label": "Path name",
4085
+ defaultValue: p.work ? "" : p.name,
4086
+ placeholder: "Path name",
4087
+ className: "min-w-0 flex-1 bg-background border border-border rounded px-1 py-0.5 text-foreground",
4088
+ onClick: (e) => e.stopPropagation(),
4089
+ onBlur: (e) => {
4090
+ setRenaming(null);
4091
+ const name = e.currentTarget.value.trim();
4092
+ if (name && name !== p.name) attempt(() => controller.renamePath(p.id, name));
4093
+ },
4094
+ onKeyDown: (e) => {
4095
+ if (e.key === "Enter") e.currentTarget.blur();
4096
+ if (e.key === "Escape") setRenaming(null);
4097
+ }
4098
+ }
4099
+ ) : /* @__PURE__ */ jsx20("span", { className: `min-w-0 flex-1 truncate ${p.work ? "italic" : ""}`, children: p.name })
4100
+ ]
4101
+ },
4102
+ p.id
4103
+ )) }),
4104
+ /* @__PURE__ */ jsxs18("div", { className: "flex flex-wrap gap-1", children: [
4105
+ /* @__PURE__ */ jsx20(
4106
+ "button",
4107
+ {
4108
+ type: "button",
4109
+ className: btn3(),
4110
+ disabled: !active,
4111
+ title: "Load the path as the selection (Shift adds, Alt subtracts)",
4112
+ onClick: (e) => attempt(() => controller.loadPathAsSelection(active.id, { mode: selectionModeFromModifiers2(e, "replace") })),
4113
+ children: "Load as Selection"
4114
+ }
4115
+ ),
4116
+ /* @__PURE__ */ jsx20("button", { type: "button", className: btn3(), disabled: !hasSelection, onClick: () => attempt(() => controller.makeWorkPath()), children: "Make Work Path" }),
4117
+ active?.work && /* @__PURE__ */ jsx20("button", { type: "button", className: btn3(), onClick: () => setRenaming(active.id), children: "Save Path" }),
4118
+ /* @__PURE__ */ jsx20("button", { type: "button", className: btn3(), disabled: !active, onClick: () => attempt(() => controller.addVectorMaskFromPath(active.id)), children: "Add Vector Mask" })
4119
+ ] }),
4120
+ /* @__PURE__ */ jsxs18("div", { className: "flex flex-wrap items-center gap-1", children: [
4121
+ /* @__PURE__ */ jsx20("input", { type: "color", "aria-label": "Path paint colour", value: color, onChange: (e) => setColor(e.target.value), className: "h-6 w-8 bg-background border border-border rounded" }),
4122
+ /* @__PURE__ */ jsx20("button", { type: "button", className: btn3(), disabled: !active, onClick: () => attempt(() => controller.fillPath(active.id, { color })), children: "Fill Path" }),
4123
+ /* @__PURE__ */ jsxs18("label", { className: "flex items-center gap-1 text-muted-foreground", children: [
4124
+ /* @__PURE__ */ jsx20(
4125
+ "input",
4126
+ {
4127
+ type: "number",
4128
+ min: 0.5,
4129
+ max: 250,
4130
+ step: 0.5,
4131
+ "aria-label": "Stroke width",
4132
+ value: width,
4133
+ onChange: (e) => setWidth(Math.min(250, Math.max(0.5, Number(e.target.value) || 1))),
4134
+ className: "w-12 bg-background border border-border rounded px-1 py-0.5 text-foreground"
4135
+ }
4136
+ ),
4137
+ "px"
4138
+ ] }),
4139
+ /* @__PURE__ */ jsx20("button", { type: "button", className: btn3(), disabled: !active, onClick: () => attempt(() => controller.strokePath(active.id, { width, color })), children: "Stroke Path" })
4140
+ ] }),
4141
+ /* @__PURE__ */ jsxs18("div", { className: "flex flex-wrap gap-1", children: [
4142
+ /* @__PURE__ */ jsx20("button", { type: "button", className: btn3(), disabled: !active, onClick: () => attempt(() => controller.duplicatePath(active.id)), children: "Duplicate" }),
4143
+ /* @__PURE__ */ jsx20("button", { type: "button", className: btn3(), disabled: !active, onClick: () => attempt(() => controller.deletePath(active.id)), children: "Delete" })
4144
+ ] }),
4145
+ error && /* @__PURE__ */ jsx20("p", { role: "alert", className: "text-destructive", children: error })
4146
+ ] });
4147
+ };
4148
+
4149
+ // src/image-editor/FreeTransformOptionsBar.tsx
4150
+ import { useEffect as useEffect14, useState as useState17 } from "react";
4151
+ import { FREE_TRANSFORM_FIELDS, FREE_TRANSFORM_MODE_OPTIONS, INTERPOLATIONS, TRANSFORM_ANCHORS, WARP_GRID_OPTIONS, WARP_STYLE_OPTIONS } from "@pixerate/editor/image-editor";
4152
+ import { jsx as jsx21, jsxs as jsxs19 } from "react/jsx-runtime";
4044
4153
  var round = (v, unit) => unit === "px" ? Math.round(v * 10) / 10 : Math.round(v * 100) / 100;
4045
4154
  var FreeTransformOptionsBar = ({ tool, className }) => {
4046
- const [, setTick] = useState16(0);
4047
- useEffect13(() => tool.subscribe(() => setTick((n) => n + 1)), [tool]);
4155
+ const [, setTick] = useState17(0);
4156
+ useEffect14(() => tool.subscribe(() => setTick((n) => n + 1)), [tool]);
4048
4157
  const bar = tool.bar();
4049
4158
  if (!tool.active || !bar) return null;
4050
4159
  const warp = tool.warpBar();
@@ -4056,17 +4165,17 @@ var FreeTransformOptionsBar = ({ tool, className }) => {
4056
4165
  const v = Number(raw);
4057
4166
  if (raw.trim() !== "" && Number.isFinite(v) && Math.abs(v - bar[field]) > 1e-9) tool.setField(field, v);
4058
4167
  };
4059
- return /* @__PURE__ */ jsxs18("div", { className: `flex flex-wrap items-center gap-2 text-xs text-foreground ${className ?? ""}`, "data-testid": "free-transform-options", role: "toolbar", "aria-label": "Free Transform options", children: [
4060
- /* @__PURE__ */ jsx20("div", { className: "flex gap-1", role: "group", "aria-label": "Transform mode", children: FREE_TRANSFORM_MODE_OPTIONS.map((m) => /* @__PURE__ */ jsx20("button", { type: "button", title: m.title, "aria-pressed": tool.mode === m.id, className: imageChipClass(tool.mode === m.id), onClick: () => tool.setMode(m.id), children: m.label }, m.id)) }),
4061
- /* @__PURE__ */ jsx20("div", { className: "grid grid-cols-3 gap-px", role: "group", "aria-label": "Reference point", children: TRANSFORM_ANCHORS.map((a) => /* @__PURE__ */ jsx20("button", { type: "button", "aria-label": `Reference point ${a}`, title: `Reference point: ${a}`, className: "h-2.5 w-2.5 rounded-sm bg-accent hover:bg-primary/90", onClick: () => tool.setReference(a) }, a)) }),
4062
- tool.mode === "warp" && /* @__PURE__ */ jsxs18("div", { className: "flex flex-wrap items-center gap-2", role: "group", "aria-label": "Warp options", children: [
4063
- /* @__PURE__ */ jsxs18("label", { className: "flex items-center gap-1", children: [
4064
- /* @__PURE__ */ jsx20("span", { className: "text-muted-foreground", children: "Warp" }),
4065
- /* @__PURE__ */ jsx20("select", { "aria-label": "Warp style", value: warp.style, onChange: (e) => tool.setWarp({ style: e.target.value }), className: imageFieldClass, children: WARP_STYLE_OPTIONS.map((o) => /* @__PURE__ */ jsx20("option", { value: o.id, children: o.label }, o.id)) })
4168
+ return /* @__PURE__ */ jsxs19("div", { className: `flex flex-wrap items-center gap-2 text-xs text-foreground ${className ?? ""}`, "data-testid": "free-transform-options", role: "toolbar", "aria-label": "Free Transform options", children: [
4169
+ /* @__PURE__ */ jsx21("div", { className: "flex gap-1", role: "group", "aria-label": "Transform mode", children: FREE_TRANSFORM_MODE_OPTIONS.map((m) => /* @__PURE__ */ jsx21("button", { type: "button", title: m.title, "aria-pressed": tool.mode === m.id, className: imageChipClass(tool.mode === m.id), onClick: () => tool.setMode(m.id), children: m.label }, m.id)) }),
4170
+ /* @__PURE__ */ jsx21("div", { className: "grid grid-cols-3 gap-px", role: "group", "aria-label": "Reference point", children: TRANSFORM_ANCHORS.map((a) => /* @__PURE__ */ jsx21("button", { type: "button", "aria-label": `Reference point ${a}`, title: `Reference point: ${a}`, className: "h-2.5 w-2.5 rounded-sm bg-accent hover:bg-primary/90", onClick: () => tool.setReference(a) }, a)) }),
4171
+ tool.mode === "warp" && /* @__PURE__ */ jsxs19("div", { className: "flex flex-wrap items-center gap-2", role: "group", "aria-label": "Warp options", children: [
4172
+ /* @__PURE__ */ jsxs19("label", { className: "flex items-center gap-1", children: [
4173
+ /* @__PURE__ */ jsx21("span", { className: "text-muted-foreground", children: "Warp" }),
4174
+ /* @__PURE__ */ jsx21("select", { "aria-label": "Warp style", value: warp.style, onChange: (e) => tool.setWarp({ style: e.target.value }), className: imageFieldClass, children: WARP_STYLE_OPTIONS.map((o) => /* @__PURE__ */ jsx21("option", { value: o.id, children: o.label }, o.id)) })
4066
4175
  ] }),
4067
- ["bend", "horizontal", "vertical"].map((k) => /* @__PURE__ */ jsxs18("label", { className: "flex items-center gap-1", children: [
4068
- /* @__PURE__ */ jsx20("span", { className: "text-muted-foreground", children: k === "bend" ? "Bend" : k === "horizontal" ? "H" : "V" }),
4069
- /* @__PURE__ */ jsx20(
4176
+ ["bend", "horizontal", "vertical"].map((k) => /* @__PURE__ */ jsxs19("label", { className: "flex items-center gap-1", children: [
4177
+ /* @__PURE__ */ jsx21("span", { className: "text-muted-foreground", children: k === "bend" ? "Bend" : k === "horizontal" ? "H" : "V" }),
4178
+ /* @__PURE__ */ jsx21(
4070
4179
  "input",
4071
4180
  {
4072
4181
  type: "number",
@@ -4087,9 +4196,9 @@ var FreeTransformOptionsBar = ({ tool, className }) => {
4087
4196
  },
4088
4197
  `${k}:${warp[k]}`
4089
4198
  ),
4090
- /* @__PURE__ */ jsx20("span", { className: "text-muted-foreground", children: "%" })
4199
+ /* @__PURE__ */ jsx21("span", { className: "text-muted-foreground", children: "%" })
4091
4200
  ] }, k)),
4092
- /* @__PURE__ */ jsx20(
4201
+ /* @__PURE__ */ jsx21(
4093
4202
  "button",
4094
4203
  {
4095
4204
  type: "button",
@@ -4101,9 +4210,9 @@ var FreeTransformOptionsBar = ({ tool, className }) => {
4101
4210
  children: "Vertical"
4102
4211
  }
4103
4212
  ),
4104
- /* @__PURE__ */ jsxs18("label", { className: "flex items-center gap-1", children: [
4105
- /* @__PURE__ */ jsx20("span", { className: "text-muted-foreground", children: "Grid" }),
4106
- /* @__PURE__ */ jsx20(
4213
+ /* @__PURE__ */ jsxs19("label", { className: "flex items-center gap-1", children: [
4214
+ /* @__PURE__ */ jsx21("span", { className: "text-muted-foreground", children: "Grid" }),
4215
+ /* @__PURE__ */ jsx21(
4107
4216
  "select",
4108
4217
  {
4109
4218
  "aria-label": "Warp grid",
@@ -4113,14 +4222,14 @@ var FreeTransformOptionsBar = ({ tool, className }) => {
4113
4222
  tool.setWarp({ columns: g.columns, rows: g.rows });
4114
4223
  },
4115
4224
  className: imageFieldClass,
4116
- children: WARP_GRID_OPTIONS.map((g) => /* @__PURE__ */ jsx20("option", { value: g.id, children: g.label }, g.id))
4225
+ children: WARP_GRID_OPTIONS.map((g) => /* @__PURE__ */ jsx21("option", { value: g.id, children: g.label }, g.id))
4117
4226
  }
4118
4227
  )
4119
4228
  ] })
4120
4229
  ] }),
4121
- tool.mode !== "warp" && FREE_TRANSFORM_FIELDS.map((f) => /* @__PURE__ */ jsxs18("label", { className: "flex items-center gap-1", title: f.title, children: [
4122
- /* @__PURE__ */ jsx20("span", { className: "text-muted-foreground", children: f.label }),
4123
- /* @__PURE__ */ jsx20(
4230
+ tool.mode !== "warp" && FREE_TRANSFORM_FIELDS.map((f) => /* @__PURE__ */ jsxs19("label", { className: "flex items-center gap-1", title: f.title, children: [
4231
+ /* @__PURE__ */ jsx21("span", { className: "text-muted-foreground", children: f.label }),
4232
+ /* @__PURE__ */ jsx21(
4124
4233
  "input",
4125
4234
  {
4126
4235
  type: "number",
@@ -4140,8 +4249,8 @@ var FreeTransformOptionsBar = ({ tool, className }) => {
4140
4249
  },
4141
4250
  `${f.id}:${round(bar[f.id], f.unit)}`
4142
4251
  ),
4143
- /* @__PURE__ */ jsx20("span", { className: "text-muted-foreground", children: f.unit }),
4144
- f.id === "scaleX" && /* @__PURE__ */ jsx20(
4252
+ /* @__PURE__ */ jsx21("span", { className: "text-muted-foreground", children: f.unit }),
4253
+ f.id === "scaleX" && /* @__PURE__ */ jsx21(
4145
4254
  "button",
4146
4255
  {
4147
4256
  type: "button",
@@ -4156,33 +4265,33 @@ var FreeTransformOptionsBar = ({ tool, className }) => {
4156
4265
  }
4157
4266
  )
4158
4267
  ] }, f.id)),
4159
- /* @__PURE__ */ jsxs18("label", { className: "flex items-center gap-1", children: [
4160
- /* @__PURE__ */ jsx20("span", { className: "text-muted-foreground", children: "Interpolation" }),
4161
- /* @__PURE__ */ jsx20(
4268
+ /* @__PURE__ */ jsxs19("label", { className: "flex items-center gap-1", children: [
4269
+ /* @__PURE__ */ jsx21("span", { className: "text-muted-foreground", children: "Interpolation" }),
4270
+ /* @__PURE__ */ jsx21(
4162
4271
  "select",
4163
4272
  {
4164
4273
  "aria-label": "Interpolation",
4165
4274
  value: tool.interpolation,
4166
4275
  onChange: (e) => tool.setInterpolation(e.target.value),
4167
4276
  className: imageFieldClass,
4168
- children: INTERPOLATIONS.map((i) => /* @__PURE__ */ jsx20("option", { value: i, children: i[0].toUpperCase() + i.slice(1) }, i))
4277
+ children: INTERPOLATIONS.map((i) => /* @__PURE__ */ jsx21("option", { value: i, children: i[0].toUpperCase() + i.slice(1) }, i))
4169
4278
  }
4170
4279
  )
4171
4280
  ] }),
4172
- /* @__PURE__ */ jsx20("button", { type: "button", title: "Commit (Enter)", className: "px-2 py-1 rounded bg-primary text-primary-foreground hover:bg-primary/90", onClick: () => tool.commit(), children: "Commit" }),
4173
- /* @__PURE__ */ jsx20("button", { type: "button", title: "Cancel (Esc)", className: imageChipClass(false), onClick: () => tool.cancel(), children: "Cancel" }),
4174
- tool.error && /* @__PURE__ */ jsx20("span", { role: "alert", className: "text-destructive", children: tool.error })
4281
+ /* @__PURE__ */ jsx21("button", { type: "button", title: "Commit (Enter)", className: "px-2 py-1 rounded bg-primary text-primary-foreground hover:bg-primary/90", onClick: () => tool.commit(), children: "Commit" }),
4282
+ /* @__PURE__ */ jsx21("button", { type: "button", title: "Cancel (Esc)", className: imageChipClass(false), onClick: () => tool.cancel(), children: "Cancel" }),
4283
+ tool.error && /* @__PURE__ */ jsx21("span", { role: "alert", className: "text-destructive", children: tool.error })
4175
4284
  ] });
4176
4285
  };
4177
4286
 
4178
4287
  // src/image-editor/ShapeOptionsBar.tsx
4179
- import { useEffect as useEffect14, useState as useState17 } from "react";
4288
+ import { useEffect as useEffect15, useState as useState18 } from "react";
4180
4289
  import { LIVE_SHAPE_KINDS, SHAPE_KIND_LABELS, applyShapeOptions } from "@pixerate/editor/image-editor";
4181
- import { Fragment as Fragment5, jsx as jsx21, jsxs as jsxs19 } from "react/jsx-runtime";
4290
+ import { Fragment as Fragment5, jsx as jsx22, jsxs as jsxs20 } from "react/jsx-runtime";
4182
4291
  var ShapeOptionsBar = ({ controller, options, onChange, className }) => {
4183
- const [, setTick] = useState17(0);
4184
- useEffect14(() => controller.subscribe(() => setTick((n) => n + 1)), [controller]);
4185
- const [error, setError] = useState17(null);
4292
+ const [, setTick] = useState18(0);
4293
+ useEffect15(() => controller.subscribe(() => setTick((n) => n + 1)), [controller]);
4294
+ const [error, setError] = useState18(null);
4186
4295
  const active = controller.getActiveLayer();
4187
4296
  const shapeId = active?.type === "shape" ? active.id : null;
4188
4297
  const set = (change) => {
@@ -4196,22 +4305,22 @@ var ShapeOptionsBar = ({ controller, options, onChange, className }) => {
4196
4305
  }
4197
4306
  };
4198
4307
  const num = (v, min, max) => Math.max(min, Math.min(max, Number(v) || min));
4199
- return /* @__PURE__ */ jsxs19("div", { className: `flex flex-col gap-2 text-xs text-foreground ${className ?? ""}`, "data-testid": "shape-options", children: [
4200
- /* @__PURE__ */ jsx21("div", { className: "flex flex-wrap gap-1", role: "toolbar", "aria-label": "Shape kind", children: LIVE_SHAPE_KINDS.map((k) => /* @__PURE__ */ jsx21("button", { type: "button", "aria-pressed": options.kind === k, className: imageChipClass(options.kind === k), onClick: () => onChange({ ...options, kind: k }), children: SHAPE_KIND_LABELS[k] }, k)) }),
4201
- /* @__PURE__ */ jsxs19("div", { className: "flex flex-wrap items-center gap-3", children: [
4202
- /* @__PURE__ */ jsxs19("label", { className: "flex items-center gap-1", children: [
4203
- /* @__PURE__ */ jsx21(ImageCheckbox, { label: "Fill", checked: options.fill !== null, onChange: (on) => set({ fill: on ? "#4f46e5" : null }) }),
4308
+ return /* @__PURE__ */ jsxs20("div", { className: `flex flex-col gap-2 text-xs text-foreground ${className ?? ""}`, "data-testid": "shape-options", children: [
4309
+ /* @__PURE__ */ jsx22("div", { className: "flex flex-wrap gap-1", role: "toolbar", "aria-label": "Shape kind", children: LIVE_SHAPE_KINDS.map((k) => /* @__PURE__ */ jsx22("button", { type: "button", "aria-pressed": options.kind === k, className: imageChipClass(options.kind === k), onClick: () => onChange({ ...options, kind: k }), children: SHAPE_KIND_LABELS[k] }, k)) }),
4310
+ /* @__PURE__ */ jsxs20("div", { className: "flex flex-wrap items-center gap-3", children: [
4311
+ /* @__PURE__ */ jsxs20("label", { className: "flex items-center gap-1", children: [
4312
+ /* @__PURE__ */ jsx22(ImageCheckbox, { label: "Fill", checked: options.fill !== null, onChange: (on) => set({ fill: on ? "#4f46e5" : null }) }),
4204
4313
  "Fill",
4205
- /* @__PURE__ */ jsx21(ImageColor, { label: "Fill colour", disabled: options.fill === null, value: options.fill ?? "#4f46e5", onChange: (fill) => set({ fill }) })
4314
+ /* @__PURE__ */ jsx22(ImageColor, { label: "Fill colour", disabled: options.fill === null, value: options.fill ?? "#4f46e5", onChange: (fill) => set({ fill }) })
4206
4315
  ] }),
4207
- /* @__PURE__ */ jsxs19("label", { className: "flex items-center gap-1", children: [
4208
- /* @__PURE__ */ jsx21(ImageCheckbox, { label: "Stroke", checked: options.stroke !== null, onChange: (on) => set({ stroke: on ? "#000000" : null }) }),
4316
+ /* @__PURE__ */ jsxs20("label", { className: "flex items-center gap-1", children: [
4317
+ /* @__PURE__ */ jsx22(ImageCheckbox, { label: "Stroke", checked: options.stroke !== null, onChange: (on) => set({ stroke: on ? "#000000" : null }) }),
4209
4318
  "Stroke",
4210
- /* @__PURE__ */ jsx21(ImageColor, { label: "Stroke colour", disabled: options.stroke === null, value: options.stroke ?? "#000000", onChange: (stroke) => set({ stroke }) })
4319
+ /* @__PURE__ */ jsx22(ImageColor, { label: "Stroke colour", disabled: options.stroke === null, value: options.stroke ?? "#000000", onChange: (stroke) => set({ stroke }) })
4211
4320
  ] }),
4212
- /* @__PURE__ */ jsxs19("label", { className: "flex items-center gap-1", children: [
4321
+ /* @__PURE__ */ jsxs20("label", { className: "flex items-center gap-1", children: [
4213
4322
  "Width",
4214
- /* @__PURE__ */ jsx21(
4323
+ /* @__PURE__ */ jsx22(
4215
4324
  "input",
4216
4325
  {
4217
4326
  type: "number",
@@ -4225,52 +4334,52 @@ var ShapeOptionsBar = ({ controller, options, onChange, className }) => {
4225
4334
  )
4226
4335
  ] })
4227
4336
  ] }),
4228
- /* @__PURE__ */ jsxs19("div", { className: "flex flex-wrap items-center gap-3", children: [
4229
- options.kind === "rect" && /* @__PURE__ */ jsxs19("label", { className: "flex items-center gap-1", children: [
4337
+ /* @__PURE__ */ jsxs20("div", { className: "flex flex-wrap items-center gap-3", children: [
4338
+ options.kind === "rect" && /* @__PURE__ */ jsxs20("label", { className: "flex items-center gap-1", children: [
4230
4339
  "Radius",
4231
- /* @__PURE__ */ jsx21("input", { type: "number", "aria-label": "Corner radius", min: 0, max: 1e3, value: options.radius, onChange: (e) => set({ radius: num(e.target.value, 0, 1e3) }), className: `w-14 ${imageFieldClass}` })
4340
+ /* @__PURE__ */ jsx22("input", { type: "number", "aria-label": "Corner radius", min: 0, max: 1e3, value: options.radius, onChange: (e) => set({ radius: num(e.target.value, 0, 1e3) }), className: `w-14 ${imageFieldClass}` })
4232
4341
  ] }),
4233
- options.kind === "polygon" && /* @__PURE__ */ jsxs19("label", { className: "flex items-center gap-1", children: [
4342
+ options.kind === "polygon" && /* @__PURE__ */ jsxs20("label", { className: "flex items-center gap-1", children: [
4234
4343
  "Sides",
4235
- /* @__PURE__ */ jsx21("input", { type: "number", "aria-label": "Sides", min: 3, max: 100, value: options.sides, onChange: (e) => set({ sides: num(e.target.value, 3, 100) }), className: `w-14 ${imageFieldClass}` })
4344
+ /* @__PURE__ */ jsx22("input", { type: "number", "aria-label": "Sides", min: 3, max: 100, value: options.sides, onChange: (e) => set({ sides: num(e.target.value, 3, 100) }), className: `w-14 ${imageFieldClass}` })
4236
4345
  ] }),
4237
- options.kind === "star" && /* @__PURE__ */ jsxs19(Fragment5, { children: [
4238
- /* @__PURE__ */ jsxs19("label", { className: "flex items-center gap-1", children: [
4346
+ options.kind === "star" && /* @__PURE__ */ jsxs20(Fragment5, { children: [
4347
+ /* @__PURE__ */ jsxs20("label", { className: "flex items-center gap-1", children: [
4239
4348
  "Points",
4240
- /* @__PURE__ */ jsx21("input", { type: "number", "aria-label": "Points", min: 3, max: 100, value: options.points, onChange: (e) => set({ points: num(e.target.value, 3, 100) }), className: `w-14 ${imageFieldClass}` })
4349
+ /* @__PURE__ */ jsx22("input", { type: "number", "aria-label": "Points", min: 3, max: 100, value: options.points, onChange: (e) => set({ points: num(e.target.value, 3, 100) }), className: `w-14 ${imageFieldClass}` })
4241
4350
  ] }),
4242
- /* @__PURE__ */ jsxs19("label", { className: "flex items-center gap-1", children: [
4351
+ /* @__PURE__ */ jsxs20("label", { className: "flex items-center gap-1", children: [
4243
4352
  "Inner",
4244
- /* @__PURE__ */ jsx21(ImageRange, { label: "Inner radius", min: 0.05, max: 1, step: 0.05, value: options.innerRatio, onChange: (v) => set({ innerRatio: v }) })
4353
+ /* @__PURE__ */ jsx22(ImageRange, { label: "Inner radius", min: 0.05, max: 1, step: 0.05, value: options.innerRatio, onChange: (v) => set({ innerRatio: v }) })
4245
4354
  ] })
4246
4355
  ] }),
4247
- options.kind === "line" && /* @__PURE__ */ jsxs19(Fragment5, { children: [
4248
- /* @__PURE__ */ jsxs19("label", { className: "flex items-center gap-1", children: [
4356
+ options.kind === "line" && /* @__PURE__ */ jsxs20(Fragment5, { children: [
4357
+ /* @__PURE__ */ jsxs20("label", { className: "flex items-center gap-1", children: [
4249
4358
  "Weight",
4250
- /* @__PURE__ */ jsx21("input", { type: "number", "aria-label": "Line weight", min: 1, max: 200, value: options.weight, onChange: (e) => set({ weight: num(e.target.value, 1, 200) }), className: `w-14 ${imageFieldClass}` })
4359
+ /* @__PURE__ */ jsx22("input", { type: "number", "aria-label": "Line weight", min: 1, max: 200, value: options.weight, onChange: (e) => set({ weight: num(e.target.value, 1, 200) }), className: `w-14 ${imageFieldClass}` })
4251
4360
  ] }),
4252
- /* @__PURE__ */ jsxs19("label", { className: "flex items-center gap-1", children: [
4253
- /* @__PURE__ */ jsx21(ImageCheckbox, { label: "Arrowhead", checked: options.arrow, onChange: (on) => set({ arrow: on }) }),
4361
+ /* @__PURE__ */ jsxs20("label", { className: "flex items-center gap-1", children: [
4362
+ /* @__PURE__ */ jsx22(ImageCheckbox, { label: "Arrowhead", checked: options.arrow, onChange: (on) => set({ arrow: on }) }),
4254
4363
  "Arrowhead"
4255
4364
  ] })
4256
4365
  ] })
4257
4366
  ] }),
4258
- /* @__PURE__ */ jsx21("p", { className: "text-[10px] text-muted-foreground", children: "Drag on the image to draw. Shift: square, circle or 45\xB0 line. Alt: from the centre." }),
4259
- error && /* @__PURE__ */ jsx21("p", { role: "alert", className: "text-destructive", children: error })
4367
+ /* @__PURE__ */ jsx22("p", { className: "text-[10px] text-muted-foreground", children: "Drag on the image to draw. Shift: square, circle or 45\xB0 line. Alt: from the centre." }),
4368
+ error && /* @__PURE__ */ jsx22("p", { role: "alert", className: "text-destructive", children: error })
4260
4369
  ] });
4261
4370
  };
4262
4371
 
4263
4372
  // src/image-editor/TypeOptionsBar.tsx
4264
- import { useEffect as useEffect15, useState as useState18 } from "react";
4373
+ import { useEffect as useEffect16, useState as useState19 } from "react";
4265
4374
  import { TEXT_ALIGNS, TEXT_ORIENTATIONS } from "@pixerate/editor/image-editor";
4266
- import { jsx as jsx22, jsxs as jsxs20 } from "react/jsx-runtime";
4375
+ import { jsx as jsx23, jsxs as jsxs21 } from "react/jsx-runtime";
4267
4376
  var ALIGN_LABELS = { left: "Left", center: "Centre", right: "Right", justify: "Justify" };
4268
4377
  var ORIENTATION_LABELS = { horizontal: "Horizontal", vertical: "Vertical" };
4269
4378
  var TypeOptionsBar = ({ controller, options, onChange, session, className }) => {
4270
- const [, setTick] = useState18(0);
4271
- useEffect15(() => controller.subscribe(() => setTick((n) => n + 1)), [controller]);
4272
- useEffect15(() => session?.subscribe(() => setTick((n) => n + 1)), [session]);
4273
- const [error, setError] = useState18(null);
4379
+ const [, setTick] = useState19(0);
4380
+ useEffect16(() => controller.subscribe(() => setTick((n) => n + 1)), [controller]);
4381
+ useEffect16(() => session?.subscribe(() => setTick((n) => n + 1)), [session]);
4382
+ const [error, setError] = useState19(null);
4274
4383
  const active = controller.getActiveLayer();
4275
4384
  const typeId = !session && active?.type === "type" ? active.id : null;
4276
4385
  const here = session?.alive ? session.styleHere() : {};
@@ -4323,11 +4432,11 @@ var TypeOptionsBar = ({ controller, options, onChange, session, className }) =>
4323
4432
  setError(e instanceof Error ? e.message : String(e));
4324
4433
  }
4325
4434
  };
4326
- return /* @__PURE__ */ jsxs20("div", { className: `flex flex-col gap-2 text-xs text-foreground ${className ?? ""}`, "data-testid": "type-options", children: [
4327
- /* @__PURE__ */ jsxs20("div", { className: "flex flex-wrap items-center gap-2", children: [
4328
- /* @__PURE__ */ jsxs20("label", { className: "flex items-center gap-1", children: [
4435
+ return /* @__PURE__ */ jsxs21("div", { className: `flex flex-col gap-2 text-xs text-foreground ${className ?? ""}`, "data-testid": "type-options", children: [
4436
+ /* @__PURE__ */ jsxs21("div", { className: "flex flex-wrap items-center gap-2", children: [
4437
+ /* @__PURE__ */ jsxs21("label", { className: "flex items-center gap-1", children: [
4329
4438
  "Font",
4330
- /* @__PURE__ */ jsx22(
4439
+ /* @__PURE__ */ jsx23(
4331
4440
  "input",
4332
4441
  {
4333
4442
  list: "pixerate-type-fonts",
@@ -4337,11 +4446,11 @@ var TypeOptionsBar = ({ controller, options, onChange, session, className }) =>
4337
4446
  className: "w-32 rounded border border-border bg-background px-1 py-0.5"
4338
4447
  }
4339
4448
  ),
4340
- /* @__PURE__ */ jsx22("datalist", { id: "pixerate-type-fonts", children: fonts.map((f) => /* @__PURE__ */ jsx22("option", { value: f }, f)) })
4449
+ /* @__PURE__ */ jsx23("datalist", { id: "pixerate-type-fonts", children: fonts.map((f) => /* @__PURE__ */ jsx23("option", { value: f }, f)) })
4341
4450
  ] }),
4342
- /* @__PURE__ */ jsxs20("label", { className: "flex items-center gap-1", children: [
4451
+ /* @__PURE__ */ jsxs21("label", { className: "flex items-center gap-1", children: [
4343
4452
  "Size",
4344
- /* @__PURE__ */ jsx22(
4453
+ /* @__PURE__ */ jsx23(
4345
4454
  "input",
4346
4455
  {
4347
4456
  type: "number",
@@ -4354,14 +4463,14 @@ var TypeOptionsBar = ({ controller, options, onChange, session, className }) =>
4354
4463
  }
4355
4464
  )
4356
4465
  ] }),
4357
- /* @__PURE__ */ jsx22("button", { type: "button", "aria-pressed": shown.fontWeight >= 600, className: `${imageChipClass(shown.fontWeight >= 600)} font-bold`, onClick: () => style({ fontWeight: shown.fontWeight >= 600 ? 400 : 700 }), children: "B" }),
4358
- /* @__PURE__ */ jsx22("button", { type: "button", "aria-pressed": shown.italic, className: `${imageChipClass(shown.italic)} italic`, onClick: () => style({ italic: !shown.italic }), children: "I" }),
4359
- /* @__PURE__ */ jsx22(ImageColor, { label: "Text colour", value: shown.color, onChange: (color) => style({ color }) })
4466
+ /* @__PURE__ */ jsx23("button", { type: "button", "aria-pressed": shown.fontWeight >= 600, className: `${imageChipClass(shown.fontWeight >= 600)} font-bold`, onClick: () => style({ fontWeight: shown.fontWeight >= 600 ? 400 : 700 }), children: "B" }),
4467
+ /* @__PURE__ */ jsx23("button", { type: "button", "aria-pressed": shown.italic, className: `${imageChipClass(shown.italic)} italic`, onClick: () => style({ italic: !shown.italic }), children: "I" }),
4468
+ /* @__PURE__ */ jsx23(ImageColor, { label: "Text colour", value: shown.color, onChange: (color) => style({ color }) })
4360
4469
  ] }),
4361
- /* @__PURE__ */ jsx22("div", { className: "flex gap-1", role: "toolbar", "aria-label": "Alignment", children: TEXT_ALIGNS.map((a) => /* @__PURE__ */ jsx22("button", { type: "button", "aria-pressed": options.align === a, className: imageChipClass(options.align === a), onClick: () => style({ align: a }), children: ALIGN_LABELS[a] }, a)) }),
4362
- /* @__PURE__ */ jsxs20("div", { className: "flex gap-1", role: "toolbar", "aria-label": "Orientation", children: [
4363
- TEXT_ORIENTATIONS.map((o) => /* @__PURE__ */ jsx22("button", { type: "button", "aria-pressed": orientation === o, className: imageChipClass(orientation === o), onClick: () => orient(o), children: ORIENTATION_LABELS[o] }, o)),
4364
- orientation === "vertical" && editedId && /* @__PURE__ */ jsx22(
4470
+ /* @__PURE__ */ jsx23("div", { className: "flex gap-1", role: "toolbar", "aria-label": "Alignment", children: TEXT_ALIGNS.map((a) => /* @__PURE__ */ jsx23("button", { type: "button", "aria-pressed": options.align === a, className: imageChipClass(options.align === a), onClick: () => style({ align: a }), children: ALIGN_LABELS[a] }, a)) }),
4471
+ /* @__PURE__ */ jsxs21("div", { className: "flex gap-1", role: "toolbar", "aria-label": "Orientation", children: [
4472
+ TEXT_ORIENTATIONS.map((o) => /* @__PURE__ */ jsx23("button", { type: "button", "aria-pressed": orientation === o, className: imageChipClass(orientation === o), onClick: () => orient(o), children: ORIENTATION_LABELS[o] }, o)),
4473
+ orientation === "vertical" && editedId && /* @__PURE__ */ jsx23(
4365
4474
  "button",
4366
4475
  {
4367
4476
  type: "button",
@@ -4373,19 +4482,19 @@ var TypeOptionsBar = ({ controller, options, onChange, session, className }) =>
4373
4482
  }
4374
4483
  )
4375
4484
  ] }),
4376
- /* @__PURE__ */ jsx22("p", { className: "text-[10px] text-muted-foreground", children: "Click to type point text (vertical: a column down from the click), drag for a paragraph box, click text to edit it. Esc finishes." }),
4377
- missing.length > 0 && /* @__PURE__ */ jsxs20("p", { role: "status", className: "text-amber-600", "data-testid": "type-missing-fonts", children: [
4485
+ /* @__PURE__ */ jsx23("p", { className: "text-[10px] text-muted-foreground", children: "Click to type point text (vertical: a column down from the click), drag for a paragraph box, click text to edit it. Esc finishes." }),
4486
+ missing.length > 0 && /* @__PURE__ */ jsxs21("p", { role: "status", className: "text-amber-600", "data-testid": "type-missing-fonts", children: [
4378
4487
  "Missing ",
4379
4488
  missing.length === 1 ? "font" : "fonts",
4380
4489
  ": ",
4381
4490
  missing.join(", ")
4382
4491
  ] }),
4383
- error && /* @__PURE__ */ jsx22("p", { role: "alert", className: "text-destructive", children: error })
4492
+ error && /* @__PURE__ */ jsx23("p", { role: "alert", className: "text-destructive", children: error })
4384
4493
  ] });
4385
4494
  };
4386
4495
 
4387
4496
  // src/image-editor/ImageEditor.tsx
4388
- import { Fragment as Fragment6, jsx as jsx23, jsxs as jsxs21 } from "react/jsx-runtime";
4497
+ import { Fragment as Fragment6, jsx as jsx24, jsxs as jsxs22 } from "react/jsx-runtime";
4389
4498
  var ImageEditor = ({
4390
4499
  editor: externalEditor,
4391
4500
  src,
@@ -4410,7 +4519,7 @@ var ImageEditor = ({
4410
4519
  return l.type === "pixel" && !!l.generator || l.type === "smart" && !!l.smartFilters?.filters.some((f) => f.kind === "effect") || l.type === "group" && l.children.some(has);
4411
4520
  });
4412
4521
  const legacyProcess = normalizeProcessVersion(state.adjustments.process) < LATEST_PROCESS_VERSION;
4413
- const [activeTab, setActiveTab] = useState19("crop");
4522
+ const [activeTab, setActiveTab] = useState20("crop");
4414
4523
  const rootRef = useRef11(null);
4415
4524
  const canvasMode = activeTab === "crop" || activeTab === "select" || activeTab === "paint" || activeTab === "annotate" ? activeTab : "none";
4416
4525
  const activeTabRef = useRef11(activeTab);
@@ -4420,14 +4529,14 @@ var ImageEditor = ({
4420
4529
  rootRef.current?.querySelector(`[data-image-tab="${CSS.escape(ref.id)}"]`)?.click();
4421
4530
  await new Promise((resolve) => setTimeout(resolve, 60));
4422
4531
  };
4423
- const [activeCropRatio, setActiveCropRatio] = useState19(null);
4424
- const [selectionOptions, setSelectionOptions] = useState19(DEFAULT_SELECTION_TOOL_OPTIONS2);
4425
- const [shapeOptions, setShapeOptions] = useState19(DEFAULT_SHAPE_TOOL_OPTIONS2);
4426
- const [typeOptions, setTypeOptions] = useState19(DEFAULT_TYPE_TOOL_OPTIONS2);
4427
- const [typeSession, setTypeSession] = useState19(null);
4428
- const [selectionError, setSelectionError] = useState19(null);
4429
- const [paintError, setPaintError] = useState19(null);
4430
- const [shapeTypeError, setShapeTypeError] = useState19(null);
4532
+ const [activeCropRatio, setActiveCropRatio] = useState20(null);
4533
+ const [selectionOptions, setSelectionOptions] = useState20(DEFAULT_SELECTION_TOOL_OPTIONS2);
4534
+ const [shapeOptions, setShapeOptions] = useState20(DEFAULT_SHAPE_TOOL_OPTIONS2);
4535
+ const [typeOptions, setTypeOptions] = useState20(DEFAULT_TYPE_TOOL_OPTIONS2);
4536
+ const [typeSession, setTypeSession] = useState20(null);
4537
+ const [selectionError, setSelectionError] = useState20(null);
4538
+ const [paintError, setPaintError] = useState20(null);
4539
+ const [shapeTypeError, setShapeTypeError] = useState20(null);
4431
4540
  const handleCanvasError = (source, message) => {
4432
4541
  if (source === "paint") setPaintError(message);
4433
4542
  else if (source === "select") setSelectionError(message);
@@ -4444,16 +4553,16 @@ var ImageEditor = ({
4444
4553
  transformControllerRef.current = controller;
4445
4554
  }
4446
4555
  const transformTool = transformToolRef.current;
4447
- const [, setTransformTick] = useState19(0);
4448
- useEffect16(() => transformTool.subscribe(() => setTransformTick((n) => n + 1)), [transformTool]);
4449
- useEffect16(() => () => transformToolRef.current?.cancel(), []);
4450
- const [inpaintPrompt, setInpaintPrompt] = useState19("");
4451
- const [inpaintMaskMode, setInpaintMaskMode] = useState19("annotations");
4452
- const [isRemovingBg, setIsRemovingBg] = useState19(false);
4453
- const [isInpainting, setIsInpainting] = useState19(false);
4454
- const [aiError, setAiError] = useState19(null);
4455
- const [aiSuccess, setAiSuccess] = useState19(null);
4456
- const [aiTarget, setAiTarget] = useState19("auto");
4556
+ const [, setTransformTick] = useState20(0);
4557
+ useEffect17(() => transformTool.subscribe(() => setTransformTick((n) => n + 1)), [transformTool]);
4558
+ useEffect17(() => () => transformToolRef.current?.cancel(), []);
4559
+ const [inpaintPrompt, setInpaintPrompt] = useState20("");
4560
+ const [inpaintMaskMode, setInpaintMaskMode] = useState20("annotations");
4561
+ const [isRemovingBg, setIsRemovingBg] = useState20(false);
4562
+ const [isInpainting, setIsInpainting] = useState20(false);
4563
+ const [aiError, setAiError] = useState20(null);
4564
+ const [aiSuccess, setAiSuccess] = useState20(null);
4565
+ const [aiTarget, setAiTarget] = useState20("auto");
4457
4566
  const aiOptions = aiTarget === "auto" ? {} : { target: aiTarget };
4458
4567
  const effectiveOnInpaint = onInpaint || aiHooks?.onInpaint;
4459
4568
  const effectiveOnRemoveBg = onRemoveBackground || aiHooks?.onRemoveBackground;
@@ -4516,11 +4625,11 @@ var ImageEditor = ({
4516
4625
  setIsInpainting(false);
4517
4626
  }
4518
4627
  };
4519
- const [activeColor, setActiveColor] = useState19("#ef4444");
4520
- const [strokeWidth, setStrokeWidth] = useState19(3);
4521
- const [fontSize, setFontSize] = useState19(24);
4522
- const [textInput, setTextInput] = useState19("");
4523
- useEffect16(() => {
4628
+ const [activeColor, setActiveColor] = useState20("#ef4444");
4629
+ const [strokeWidth, setStrokeWidth] = useState20(3);
4630
+ const [fontSize, setFontSize] = useState20(24);
4631
+ const [textInput, setTextInput] = useState20("");
4632
+ useEffect17(() => {
4524
4633
  if (activeTab === "crop" && editor.state.activeTool !== "crop") {
4525
4634
  editor.setTool("crop");
4526
4635
  }
@@ -4548,16 +4657,16 @@ var ImageEditor = ({
4548
4657
  link.click();
4549
4658
  }
4550
4659
  };
4551
- return /* @__PURE__ */ jsxs21(
4660
+ return /* @__PURE__ */ jsxs22(
4552
4661
  "div",
4553
4662
  {
4554
4663
  ref: rootRef,
4555
4664
  className: `${imageEditorFrameClass} ${className}`,
4556
4665
  style,
4557
4666
  children: [
4558
- /* @__PURE__ */ jsxs21("div", { className: imageEditorHeaderClass, children: [
4559
- /* @__PURE__ */ jsxs21("div", { role: "tablist", className: imageTabListClass, children: [
4560
- /* @__PURE__ */ jsx23(
4667
+ /* @__PURE__ */ jsxs22("div", { className: imageEditorHeaderClass, children: [
4668
+ /* @__PURE__ */ jsxs22("div", { role: "tablist", className: imageTabListClass, children: [
4669
+ /* @__PURE__ */ jsx24(
4561
4670
  "button",
4562
4671
  {
4563
4672
  type: "button",
@@ -4572,7 +4681,7 @@ var ImageEditor = ({
4572
4681
  children: "Transform & Crop"
4573
4682
  }
4574
4683
  ),
4575
- /* @__PURE__ */ jsx23(
4684
+ /* @__PURE__ */ jsx24(
4576
4685
  "button",
4577
4686
  {
4578
4687
  type: "button",
@@ -4587,7 +4696,7 @@ var ImageEditor = ({
4587
4696
  children: "Adjustments"
4588
4697
  }
4589
4698
  ),
4590
- /* @__PURE__ */ jsx23(
4699
+ /* @__PURE__ */ jsx24(
4591
4700
  "button",
4592
4701
  {
4593
4702
  type: "button",
@@ -4602,7 +4711,7 @@ var ImageEditor = ({
4602
4711
  children: "Layers"
4603
4712
  }
4604
4713
  ),
4605
- /* @__PURE__ */ jsx23(
4714
+ /* @__PURE__ */ jsx24(
4606
4715
  "button",
4607
4716
  {
4608
4717
  type: "button",
@@ -4617,7 +4726,7 @@ var ImageEditor = ({
4617
4726
  children: "Paint"
4618
4727
  }
4619
4728
  ),
4620
- /* @__PURE__ */ jsx23(
4729
+ /* @__PURE__ */ jsx24(
4621
4730
  "button",
4622
4731
  {
4623
4732
  type: "button",
@@ -4632,7 +4741,7 @@ var ImageEditor = ({
4632
4741
  children: "Select & Mask"
4633
4742
  }
4634
4743
  ),
4635
- /* @__PURE__ */ jsx23(
4744
+ /* @__PURE__ */ jsx24(
4636
4745
  "button",
4637
4746
  {
4638
4747
  type: "button",
@@ -4647,7 +4756,7 @@ var ImageEditor = ({
4647
4756
  children: "Annotations"
4648
4757
  }
4649
4758
  ),
4650
- /* @__PURE__ */ jsx23(
4759
+ /* @__PURE__ */ jsx24(
4651
4760
  "button",
4652
4761
  {
4653
4762
  type: "button",
@@ -4662,7 +4771,7 @@ var ImageEditor = ({
4662
4771
  children: "Depth Mask"
4663
4772
  }
4664
4773
  ),
4665
- /* @__PURE__ */ jsxs21(
4774
+ /* @__PURE__ */ jsxs22(
4666
4775
  "button",
4667
4776
  {
4668
4777
  type: "button",
@@ -4675,14 +4784,14 @@ var ImageEditor = ({
4675
4784
  "aria-selected": activeTab === "ai",
4676
4785
  className: `${imageTabClass(activeTab === "ai")} flex items-center gap-1.5`,
4677
4786
  children: [
4678
- /* @__PURE__ */ jsx23("svg", { className: "w-3.5 h-3.5", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: /* @__PURE__ */ jsx23("path", { d: "M12 2v4M12 18v4M4.93 4.93l2.83 2.83M16.24 16.24l2.83 2.83M2 12h4M18 12h4M4.93 19.07l2.83-2.83M16.24 7.76l2.83-2.83" }) }),
4787
+ /* @__PURE__ */ jsx24("svg", { className: "w-3.5 h-3.5", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: /* @__PURE__ */ jsx24("path", { d: "M12 2v4M12 18v4M4.93 4.93l2.83 2.83M16.24 16.24l2.83 2.83M2 12h4M18 12h4M4.93 19.07l2.83-2.83M16.24 7.76l2.83-2.83" }) }),
4679
4788
  "AI Tools"
4680
4789
  ]
4681
4790
  }
4682
4791
  )
4683
4792
  ] }),
4684
- /* @__PURE__ */ jsxs21("div", { className: "flex items-center gap-2 text-xs", children: [
4685
- /* @__PURE__ */ jsx23(
4793
+ /* @__PURE__ */ jsxs22("div", { className: "flex items-center gap-2 text-xs", children: [
4794
+ /* @__PURE__ */ jsx24(
4686
4795
  "button",
4687
4796
  {
4688
4797
  type: "button",
@@ -4693,7 +4802,7 @@ var ImageEditor = ({
4693
4802
  children: "\u21A9"
4694
4803
  }
4695
4804
  ),
4696
- /* @__PURE__ */ jsx23(
4805
+ /* @__PURE__ */ jsx24(
4697
4806
  "button",
4698
4807
  {
4699
4808
  type: "button",
@@ -4704,7 +4813,7 @@ var ImageEditor = ({
4704
4813
  children: "\u21AA"
4705
4814
  }
4706
4815
  ),
4707
- /* @__PURE__ */ jsx23(
4816
+ /* @__PURE__ */ jsx24(
4708
4817
  "button",
4709
4818
  {
4710
4819
  type: "button",
@@ -4713,8 +4822,8 @@ var ImageEditor = ({
4713
4822
  children: "Reset"
4714
4823
  }
4715
4824
  ),
4716
- /* @__PURE__ */ jsx23("div", { className: "h-4 w-px bg-muted mx-1" }),
4717
- /* @__PURE__ */ jsx23(
4825
+ /* @__PURE__ */ jsx24("div", { className: "h-4 w-px bg-muted mx-1" }),
4826
+ /* @__PURE__ */ jsx24(
4718
4827
  "button",
4719
4828
  {
4720
4829
  type: "button",
@@ -4724,11 +4833,11 @@ var ImageEditor = ({
4724
4833
  children: "-"
4725
4834
  }
4726
4835
  ),
4727
- /* @__PURE__ */ jsxs21("span", { className: "font-mono text-muted-foreground w-10 text-center", children: [
4836
+ /* @__PURE__ */ jsxs22("span", { className: "font-mono text-muted-foreground w-10 text-center", children: [
4728
4837
  Math.round(state.zoom * 100),
4729
4838
  "%"
4730
4839
  ] }),
4731
- /* @__PURE__ */ jsx23(
4840
+ /* @__PURE__ */ jsx24(
4732
4841
  "button",
4733
4842
  {
4734
4843
  type: "button",
@@ -4738,8 +4847,8 @@ var ImageEditor = ({
4738
4847
  children: "+"
4739
4848
  }
4740
4849
  ),
4741
- /* @__PURE__ */ jsx23("div", { className: "h-4 w-px bg-muted mx-1" }),
4742
- /* @__PURE__ */ jsx23(
4850
+ /* @__PURE__ */ jsx24("div", { className: "h-4 w-px bg-muted mx-1" }),
4851
+ /* @__PURE__ */ jsx24(
4743
4852
  "button",
4744
4853
  {
4745
4854
  type: "button",
@@ -4750,7 +4859,7 @@ var ImageEditor = ({
4750
4859
  children: "Hold Compare"
4751
4860
  }
4752
4861
  ),
4753
- /* @__PURE__ */ jsx23(
4862
+ /* @__PURE__ */ jsx24(
4754
4863
  "button",
4755
4864
  {
4756
4865
  type: "button",
@@ -4761,10 +4870,10 @@ var ImageEditor = ({
4761
4870
  )
4762
4871
  ] })
4763
4872
  ] }),
4764
- transformTool.active && /* @__PURE__ */ jsx23(FreeTransformOptionsBar, { tool: transformTool, className: "border-b border-border bg-background/95 px-4 py-2" }),
4765
- !transformTool.active && transformTool.error && /* @__PURE__ */ jsx23("div", { role: "alert", className: imageErrorBannerClass, children: transformTool.error }),
4766
- /* @__PURE__ */ jsxs21("div", { className: "flex flex-col md:flex-row flex-1 min-h-[520px] md:h-[560px]", children: [
4767
- /* @__PURE__ */ jsx23(
4873
+ transformTool.active && /* @__PURE__ */ jsx24(FreeTransformOptionsBar, { tool: transformTool, className: "border-b border-border bg-background/95 px-4 py-2" }),
4874
+ !transformTool.active && transformTool.error && /* @__PURE__ */ jsx24("div", { role: "alert", className: imageErrorBannerClass, children: transformTool.error }),
4875
+ /* @__PURE__ */ jsxs22("div", { className: "flex flex-col md:flex-row flex-1 min-h-[520px] md:h-[560px]", children: [
4876
+ /* @__PURE__ */ jsx24(
4768
4877
  ImageEditorCanvas,
4769
4878
  {
4770
4879
  editor,
@@ -4788,11 +4897,11 @@ var ImageEditor = ({
4788
4897
  className: "flex-1 h-[360px] md:h-full min-h-[320px] bg-muted"
4789
4898
  }
4790
4899
  ),
4791
- /* @__PURE__ */ jsxs21("div", { className: imageSidebarClass, children: [
4792
- activeTab === "crop" && /* @__PURE__ */ jsxs21("div", { className: "flex flex-col gap-4 text-xs", children: [
4793
- /* @__PURE__ */ jsx23("span", { className: imageSectionTitleClass, children: "Aspect Ratio Presets" }),
4794
- /* @__PURE__ */ jsxs21("div", { className: "grid grid-cols-3 gap-2", children: [
4795
- /* @__PURE__ */ jsx23(
4900
+ /* @__PURE__ */ jsxs22("div", { className: imageSidebarClass, children: [
4901
+ activeTab === "crop" && /* @__PURE__ */ jsxs22("div", { className: "flex flex-col gap-4 text-xs", children: [
4902
+ /* @__PURE__ */ jsx24("span", { className: imageSectionTitleClass, children: "Aspect Ratio Presets" }),
4903
+ /* @__PURE__ */ jsxs22("div", { className: "grid grid-cols-3 gap-2", children: [
4904
+ /* @__PURE__ */ jsx24(
4796
4905
  "button",
4797
4906
  {
4798
4907
  type: "button",
@@ -4804,7 +4913,7 @@ var ImageEditor = ({
4804
4913
  children: "Freeform"
4805
4914
  }
4806
4915
  ),
4807
- /* @__PURE__ */ jsx23(
4916
+ /* @__PURE__ */ jsx24(
4808
4917
  "button",
4809
4918
  {
4810
4919
  type: "button",
@@ -4816,7 +4925,7 @@ var ImageEditor = ({
4816
4925
  children: "1:1 Square"
4817
4926
  }
4818
4927
  ),
4819
- /* @__PURE__ */ jsx23(
4928
+ /* @__PURE__ */ jsx24(
4820
4929
  "button",
4821
4930
  {
4822
4931
  type: "button",
@@ -4828,7 +4937,7 @@ var ImageEditor = ({
4828
4937
  children: "4:3 Standard"
4829
4938
  }
4830
4939
  ),
4831
- /* @__PURE__ */ jsx23(
4940
+ /* @__PURE__ */ jsx24(
4832
4941
  "button",
4833
4942
  {
4834
4943
  type: "button",
@@ -4840,7 +4949,7 @@ var ImageEditor = ({
4840
4949
  children: "16:9 Wide"
4841
4950
  }
4842
4951
  ),
4843
- /* @__PURE__ */ jsx23(
4952
+ /* @__PURE__ */ jsx24(
4844
4953
  "button",
4845
4954
  {
4846
4955
  type: "button",
@@ -4852,7 +4961,7 @@ var ImageEditor = ({
4852
4961
  children: "3:2 Photo"
4853
4962
  }
4854
4963
  ),
4855
- /* @__PURE__ */ jsx23(
4964
+ /* @__PURE__ */ jsx24(
4856
4965
  "button",
4857
4966
  {
4858
4967
  type: "button",
@@ -4865,10 +4974,10 @@ var ImageEditor = ({
4865
4974
  }
4866
4975
  )
4867
4976
  ] }),
4868
- /* @__PURE__ */ jsx23("div", { className: imageDividerClass }),
4869
- /* @__PURE__ */ jsx23("span", { className: imageSectionTitleClass, children: "Orientation & Flips" }),
4870
- /* @__PURE__ */ jsxs21("div", { className: "grid grid-cols-2 gap-2", children: [
4871
- /* @__PURE__ */ jsx23(
4977
+ /* @__PURE__ */ jsx24("div", { className: imageDividerClass }),
4978
+ /* @__PURE__ */ jsx24("span", { className: imageSectionTitleClass, children: "Orientation & Flips" }),
4979
+ /* @__PURE__ */ jsxs22("div", { className: "grid grid-cols-2 gap-2", children: [
4980
+ /* @__PURE__ */ jsx24(
4872
4981
  "button",
4873
4982
  {
4874
4983
  type: "button",
@@ -4877,7 +4986,7 @@ var ImageEditor = ({
4877
4986
  children: "Rotate -90\xB0"
4878
4987
  }
4879
4988
  ),
4880
- /* @__PURE__ */ jsx23(
4989
+ /* @__PURE__ */ jsx24(
4881
4990
  "button",
4882
4991
  {
4883
4992
  type: "button",
@@ -4886,7 +4995,7 @@ var ImageEditor = ({
4886
4995
  children: "Rotate +90\xB0"
4887
4996
  }
4888
4997
  ),
4889
- /* @__PURE__ */ jsx23(
4998
+ /* @__PURE__ */ jsx24(
4890
4999
  "button",
4891
5000
  {
4892
5001
  type: "button",
@@ -4895,7 +5004,7 @@ var ImageEditor = ({
4895
5004
  children: "Flip Horizontal"
4896
5005
  }
4897
5006
  ),
4898
- /* @__PURE__ */ jsx23(
5007
+ /* @__PURE__ */ jsx24(
4899
5008
  "button",
4900
5009
  {
4901
5010
  type: "button",
@@ -4906,10 +5015,10 @@ var ImageEditor = ({
4906
5015
  )
4907
5016
  ] })
4908
5017
  ] }),
4909
- activeTab === "adjust" && /* @__PURE__ */ jsxs21("div", { className: "flex flex-col gap-3 text-xs", children: [
4910
- /* @__PURE__ */ jsxs21("div", { className: "flex items-center justify-between", children: [
4911
- /* @__PURE__ */ jsx23("span", { className: imageSectionTitleClass, children: "Color Adjustments" }),
4912
- /* @__PURE__ */ jsx23(
5018
+ activeTab === "adjust" && /* @__PURE__ */ jsxs22("div", { className: "flex flex-col gap-3 text-xs", children: [
5019
+ /* @__PURE__ */ jsxs22("div", { className: "flex items-center justify-between", children: [
5020
+ /* @__PURE__ */ jsx24("span", { className: imageSectionTitleClass, children: "Color Adjustments" }),
5021
+ /* @__PURE__ */ jsx24(
4913
5022
  "button",
4914
5023
  {
4915
5024
  type: "button",
@@ -4919,9 +5028,9 @@ var ImageEditor = ({
4919
5028
  }
4920
5029
  )
4921
5030
  ] }),
4922
- /* @__PURE__ */ jsx23(Histogram, { histogram: editor.histogram }),
4923
- IMAGE_ADJUSTMENT_CONTROLS.map((spec) => /* @__PURE__ */ jsxs21(React18.Fragment, { children: [
4924
- /* @__PURE__ */ jsx23(
5031
+ /* @__PURE__ */ jsx24(Histogram, { histogram: editor.histogram }),
5032
+ IMAGE_ADJUSTMENT_CONTROLS.map((spec) => /* @__PURE__ */ jsxs22(React19.Fragment, { children: [
5033
+ /* @__PURE__ */ jsx24(
4925
5034
  ControlSlider,
4926
5035
  {
4927
5036
  spec,
@@ -4930,14 +5039,14 @@ var ImageEditor = ({
4930
5039
  onChange: (v) => editor.setAdjustments({ [spec.id]: v })
4931
5040
  }
4932
5041
  ),
4933
- spec.id === "tint" && legacyProcess && /* @__PURE__ */ jsxs21(
5042
+ spec.id === "tint" && legacyProcess && /* @__PURE__ */ jsxs22(
4934
5043
  "div",
4935
5044
  {
4936
5045
  className: "flex items-center justify-between gap-2 rounded border border-amber-500/30 bg-amber-500/10 px-2 py-1.5 text-[10px] text-amber-600",
4937
5046
  "data-testid": "image-editor-process-notice",
4938
5047
  children: [
4939
- /* @__PURE__ */ jsx23("span", { children: "Legacy rendering (process 1). Tint needs the current process." }),
4940
- /* @__PURE__ */ jsx23(
5048
+ /* @__PURE__ */ jsx24("span", { children: "Legacy rendering (process 1). Tint needs the current process." }),
5049
+ /* @__PURE__ */ jsx24(
4941
5050
  "button",
4942
5051
  {
4943
5052
  type: "button",
@@ -4950,7 +5059,7 @@ var ImageEditor = ({
4950
5059
  }
4951
5060
  )
4952
5061
  ] }, spec.id)),
4953
- /* @__PURE__ */ jsx23("div", { className: imageSectionClass, children: /* @__PURE__ */ jsx23(
5062
+ /* @__PURE__ */ jsx24("div", { className: imageSectionClass, children: /* @__PURE__ */ jsx24(
4954
5063
  AdjustmentLayersPanel,
4955
5064
  {
4956
5065
  controller,
@@ -4959,9 +5068,9 @@ var ImageEditor = ({
4959
5068
  }
4960
5069
  ) })
4961
5070
  ] }),
4962
- activeTab === "layers" && /* @__PURE__ */ jsxs21("div", { className: "flex flex-col gap-3 text-xs", children: [
4963
- /* @__PURE__ */ jsx23("span", { className: imageSectionTitleClass, children: "Layers" }),
4964
- /* @__PURE__ */ jsx23(
5071
+ activeTab === "layers" && /* @__PURE__ */ jsxs22("div", { className: "flex flex-col gap-3 text-xs", children: [
5072
+ /* @__PURE__ */ jsx24("span", { className: imageSectionTitleClass, children: "Layers" }),
5073
+ /* @__PURE__ */ jsx24(
4965
5074
  "button",
4966
5075
  {
4967
5076
  type: "button",
@@ -4972,15 +5081,15 @@ var ImageEditor = ({
4972
5081
  children: "Free Transform"
4973
5082
  }
4974
5083
  ),
4975
- /* @__PURE__ */ jsx23(LayersPanel, { controller }),
4976
- effectsShown && /* @__PURE__ */ jsx23(ImageProviderEffectsPanel, { controller, className: imageSectionClass }),
4977
- /* @__PURE__ */ jsx23("span", { className: imageSectionTitleClass, children: "Colour" }),
4978
- /* @__PURE__ */ jsx23(ColorProfilePanel, { controller })
5084
+ /* @__PURE__ */ jsx24(LayersPanel, { controller }),
5085
+ effectsShown && /* @__PURE__ */ jsx24(ImageProviderEffectsPanel, { controller, className: imageSectionClass }),
5086
+ /* @__PURE__ */ jsx24("span", { className: imageSectionTitleClass, children: "Colour" }),
5087
+ /* @__PURE__ */ jsx24(ColorProfilePanel, { controller })
4979
5088
  ] }),
4980
- activeTab === "paint" && /* @__PURE__ */ jsxs21("div", { className: "flex flex-col gap-3 text-xs", children: [
4981
- /* @__PURE__ */ jsx23("span", { className: imageSectionTitleClass, children: "Paint" }),
4982
- /* @__PURE__ */ jsx23(BrushOptionsBar, { controller }),
4983
- /* @__PURE__ */ jsx23(
5089
+ activeTab === "paint" && /* @__PURE__ */ jsxs22("div", { className: "flex flex-col gap-3 text-xs", children: [
5090
+ /* @__PURE__ */ jsx24("span", { className: imageSectionTitleClass, children: "Paint" }),
5091
+ /* @__PURE__ */ jsx24(BrushOptionsBar, { controller }),
5092
+ /* @__PURE__ */ jsx24(
4984
5093
  "button",
4985
5094
  {
4986
5095
  type: "button",
@@ -4991,12 +5100,12 @@ var ImageEditor = ({
4991
5100
  children: "Free Transform"
4992
5101
  }
4993
5102
  ),
4994
- paintError && /* @__PURE__ */ jsx23("p", { role: "alert", className: "text-destructive", "data-testid": "paint-error", children: paintError }),
4995
- /* @__PURE__ */ jsx23("div", { className: imageSectionClass, children: /* @__PURE__ */ jsx23(LayersPanel, { controller }) })
5103
+ paintError && /* @__PURE__ */ jsx24("p", { role: "alert", className: "text-destructive", "data-testid": "paint-error", children: paintError }),
5104
+ /* @__PURE__ */ jsx24("div", { className: imageSectionClass, children: /* @__PURE__ */ jsx24(LayersPanel, { controller }) })
4996
5105
  ] }),
4997
- activeTab === "annotate" && /* @__PURE__ */ jsxs21("div", { className: "flex flex-col gap-3 text-xs", children: [
4998
- /* @__PURE__ */ jsx23("span", { className: imageSectionTitleClass, children: "Shape & Type Layers" }),
4999
- /* @__PURE__ */ jsx23("div", { className: "grid grid-cols-2 gap-1.5", children: ["shape", "type"].map((t) => /* @__PURE__ */ jsx23(
5106
+ activeTab === "annotate" && /* @__PURE__ */ jsxs22("div", { className: "flex flex-col gap-3 text-xs", children: [
5107
+ /* @__PURE__ */ jsx24("span", { className: imageSectionTitleClass, children: "Shape & Type Layers" }),
5108
+ /* @__PURE__ */ jsx24("div", { className: "grid grid-cols-2 gap-1.5", children: ["shape", "type"].map((t) => /* @__PURE__ */ jsx24(
5000
5109
  "button",
5001
5110
  {
5002
5111
  type: "button",
@@ -5007,13 +5116,13 @@ var ImageEditor = ({
5007
5116
  },
5008
5117
  t
5009
5118
  )) }),
5010
- state.activeTool === "shape" && /* @__PURE__ */ jsx23(ShapeOptionsBar, { controller, options: shapeOptions, onChange: setShapeOptions }),
5011
- state.activeTool === "type" && /* @__PURE__ */ jsx23(TypeOptionsBar, { controller, options: typeOptions, onChange: setTypeOptions, session: typeSession }),
5012
- state.activeTool === "type" && typeSession && /* @__PURE__ */ jsx23("button", { type: "button", onClick: finishTyping, className: "self-start rounded bg-muted px-2 py-1 text-[11px] text-foreground hover:bg-accent", children: "Done editing text" }),
5013
- shapeTypeError && /* @__PURE__ */ jsx23("p", { role: "alert", className: "text-destructive", "data-testid": "shape-type-error", children: shapeTypeError }),
5014
- /* @__PURE__ */ jsx23("div", { className: imageDividerClass }),
5015
- /* @__PURE__ */ jsx23("span", { className: imageSectionTitleClass, children: "Draw & Annotate" }),
5016
- /* @__PURE__ */ jsx23("div", { className: "grid grid-cols-3 gap-1.5", children: ["pen", "rect", "circle", "arrow", "line"].map((t) => /* @__PURE__ */ jsx23(
5119
+ state.activeTool === "shape" && /* @__PURE__ */ jsx24(ShapeOptionsBar, { controller, options: shapeOptions, onChange: setShapeOptions }),
5120
+ state.activeTool === "type" && /* @__PURE__ */ jsx24(TypeOptionsBar, { controller, options: typeOptions, onChange: setTypeOptions, session: typeSession }),
5121
+ state.activeTool === "type" && typeSession && /* @__PURE__ */ jsx24("button", { type: "button", onClick: finishTyping, className: "self-start rounded bg-muted px-2 py-1 text-[11px] text-foreground hover:bg-accent", children: "Done editing text" }),
5122
+ shapeTypeError && /* @__PURE__ */ jsx24("p", { role: "alert", className: "text-destructive", "data-testid": "shape-type-error", children: shapeTypeError }),
5123
+ /* @__PURE__ */ jsx24("div", { className: imageDividerClass }),
5124
+ /* @__PURE__ */ jsx24("span", { className: imageSectionTitleClass, children: "Draw & Annotate" }),
5125
+ /* @__PURE__ */ jsx24("div", { className: "grid grid-cols-3 gap-1.5", children: ["pen", "rect", "circle", "arrow", "line"].map((t) => /* @__PURE__ */ jsx24(
5017
5126
  "button",
5018
5127
  {
5019
5128
  type: "button",
@@ -5023,18 +5132,18 @@ var ImageEditor = ({
5023
5132
  },
5024
5133
  t
5025
5134
  )) }),
5026
- /* @__PURE__ */ jsxs21("div", { className: "flex items-center gap-2 mt-2", children: [
5027
- /* @__PURE__ */ jsx23("label", { className: "text-muted-foreground", children: "Color:" }),
5028
- /* @__PURE__ */ jsx23(ImageColor, { label: "Annotation colour", value: activeColor, onChange: setActiveColor }),
5029
- /* @__PURE__ */ jsxs21("div", { className: "flex-1 ml-2", children: [
5030
- /* @__PURE__ */ jsxs21("div", { className: "flex justify-between text-muted-foreground mb-0.5", children: [
5031
- /* @__PURE__ */ jsx23("span", { children: "Width:" }),
5032
- /* @__PURE__ */ jsxs21("span", { className: "font-mono", children: [
5135
+ /* @__PURE__ */ jsxs22("div", { className: "flex items-center gap-2 mt-2", children: [
5136
+ /* @__PURE__ */ jsx24("label", { className: "text-muted-foreground", children: "Color:" }),
5137
+ /* @__PURE__ */ jsx24(ImageColor, { label: "Annotation colour", value: activeColor, onChange: setActiveColor }),
5138
+ /* @__PURE__ */ jsxs22("div", { className: "flex-1 ml-2", children: [
5139
+ /* @__PURE__ */ jsxs22("div", { className: "flex justify-between text-muted-foreground mb-0.5", children: [
5140
+ /* @__PURE__ */ jsx24("span", { children: "Width:" }),
5141
+ /* @__PURE__ */ jsxs22("span", { className: "font-mono", children: [
5033
5142
  strokeWidth,
5034
5143
  "px"
5035
5144
  ] })
5036
5145
  ] }),
5037
- /* @__PURE__ */ jsx23(
5146
+ /* @__PURE__ */ jsx24(
5038
5147
  "input",
5039
5148
  {
5040
5149
  type: "range",
@@ -5047,10 +5156,10 @@ var ImageEditor = ({
5047
5156
  )
5048
5157
  ] })
5049
5158
  ] }),
5050
- /* @__PURE__ */ jsx23("div", { className: imageDividerClass }),
5051
- /* @__PURE__ */ jsx23("span", { className: imageSectionTitleClass, children: "Add Text" }),
5052
- /* @__PURE__ */ jsxs21("div", { className: "flex gap-2", children: [
5053
- /* @__PURE__ */ jsx23(
5159
+ /* @__PURE__ */ jsx24("div", { className: imageDividerClass }),
5160
+ /* @__PURE__ */ jsx24("span", { className: imageSectionTitleClass, children: "Add Text" }),
5161
+ /* @__PURE__ */ jsxs22("div", { className: "flex gap-2", children: [
5162
+ /* @__PURE__ */ jsx24(
5054
5163
  "input",
5055
5164
  {
5056
5165
  type: "text",
@@ -5061,7 +5170,7 @@ var ImageEditor = ({
5061
5170
  className: "flex-1 bg-background border border-border rounded-lg px-2.5 py-1.5 text-xs text-foreground placeholder:text-muted-foreground focus:outline-none focus:border-primary"
5062
5171
  }
5063
5172
  ),
5064
- /* @__PURE__ */ jsx23(
5173
+ /* @__PURE__ */ jsx24(
5065
5174
  "button",
5066
5175
  {
5067
5176
  type: "button",
@@ -5071,14 +5180,14 @@ var ImageEditor = ({
5071
5180
  }
5072
5181
  )
5073
5182
  ] }),
5074
- /* @__PURE__ */ jsxs21("div", { className: "flex items-center justify-between text-muted-foreground", children: [
5075
- /* @__PURE__ */ jsx23("span", { children: "Font Size:" }),
5076
- /* @__PURE__ */ jsxs21("span", { className: "font-mono", children: [
5183
+ /* @__PURE__ */ jsxs22("div", { className: "flex items-center justify-between text-muted-foreground", children: [
5184
+ /* @__PURE__ */ jsx24("span", { children: "Font Size:" }),
5185
+ /* @__PURE__ */ jsxs22("span", { className: "font-mono", children: [
5077
5186
  fontSize,
5078
5187
  "px"
5079
5188
  ] })
5080
5189
  ] }),
5081
- /* @__PURE__ */ jsx23(
5190
+ /* @__PURE__ */ jsx24(
5082
5191
  "input",
5083
5192
  {
5084
5193
  type: "range",
@@ -5089,14 +5198,14 @@ var ImageEditor = ({
5089
5198
  className: imageRangeClass
5090
5199
  }
5091
5200
  ),
5092
- /* @__PURE__ */ jsx23("div", { className: imageDividerClass }),
5093
- /* @__PURE__ */ jsxs21("div", { className: "flex items-center justify-between", children: [
5094
- /* @__PURE__ */ jsxs21("span", { className: "text-muted-foreground", children: [
5201
+ /* @__PURE__ */ jsx24("div", { className: imageDividerClass }),
5202
+ /* @__PURE__ */ jsxs22("div", { className: "flex items-center justify-between", children: [
5203
+ /* @__PURE__ */ jsxs22("span", { className: "text-muted-foreground", children: [
5095
5204
  "Layers (",
5096
5205
  state.annotations.length,
5097
5206
  ")"
5098
5207
  ] }),
5099
- state.selectedAnnotationId && /* @__PURE__ */ jsx23(
5208
+ state.selectedAnnotationId && /* @__PURE__ */ jsx24(
5100
5209
  "button",
5101
5210
  {
5102
5211
  type: "button",
@@ -5105,7 +5214,7 @@ var ImageEditor = ({
5105
5214
  children: "Delete Selected"
5106
5215
  }
5107
5216
  ),
5108
- state.annotations.length > 0 && /* @__PURE__ */ jsx23(
5217
+ state.annotations.length > 0 && /* @__PURE__ */ jsx24(
5109
5218
  "button",
5110
5219
  {
5111
5220
  type: "button",
@@ -5116,10 +5225,10 @@ var ImageEditor = ({
5116
5225
  )
5117
5226
  ] })
5118
5227
  ] }),
5119
- activeTab === "depth" && /* @__PURE__ */ jsxs21("div", { className: "flex flex-col gap-3 text-xs", children: [
5120
- /* @__PURE__ */ jsxs21("div", { className: "flex items-center justify-between", children: [
5121
- /* @__PURE__ */ jsx23("span", { className: imageSectionTitleClass, children: "Depth Masking" }),
5122
- /* @__PURE__ */ jsx23(
5228
+ activeTab === "depth" && /* @__PURE__ */ jsxs22("div", { className: "flex flex-col gap-3 text-xs", children: [
5229
+ /* @__PURE__ */ jsxs22("div", { className: "flex items-center justify-between", children: [
5230
+ /* @__PURE__ */ jsx24("span", { className: imageSectionTitleClass, children: "Depth Masking" }),
5231
+ /* @__PURE__ */ jsx24(
5123
5232
  "button",
5124
5233
  {
5125
5234
  type: "button",
@@ -5129,8 +5238,8 @@ var ImageEditor = ({
5129
5238
  }
5130
5239
  )
5131
5240
  ] }),
5132
- /* @__PURE__ */ jsxs21("label", { className: "flex items-center gap-2 cursor-pointer text-foreground", children: [
5133
- /* @__PURE__ */ jsx23(
5241
+ /* @__PURE__ */ jsxs22("label", { className: "flex items-center gap-2 cursor-pointer text-foreground", children: [
5242
+ /* @__PURE__ */ jsx24(
5134
5243
  "input",
5135
5244
  {
5136
5245
  type: "checkbox",
@@ -5139,12 +5248,12 @@ var ImageEditor = ({
5139
5248
  className: "rounded accent-primary"
5140
5249
  }
5141
5250
  ),
5142
- /* @__PURE__ */ jsx23("span", { children: "Enable Depth / Alpha Mask" })
5251
+ /* @__PURE__ */ jsx24("span", { children: "Enable Depth / Alpha Mask" })
5143
5252
  ] }),
5144
- state.depthMask.enabled && /* @__PURE__ */ jsxs21(Fragment6, { children: [
5145
- /* @__PURE__ */ jsxs21("div", { children: [
5146
- /* @__PURE__ */ jsx23("label", { className: "text-muted-foreground block mb-1", children: "Mask Image URL:" }),
5147
- /* @__PURE__ */ jsx23(
5253
+ state.depthMask.enabled && /* @__PURE__ */ jsxs22(Fragment6, { children: [
5254
+ /* @__PURE__ */ jsxs22("div", { children: [
5255
+ /* @__PURE__ */ jsx24("label", { className: "text-muted-foreground block mb-1", children: "Mask Image URL:" }),
5256
+ /* @__PURE__ */ jsx24(
5148
5257
  "input",
5149
5258
  {
5150
5259
  type: "text",
@@ -5155,8 +5264,8 @@ var ImageEditor = ({
5155
5264
  }
5156
5265
  )
5157
5266
  ] }),
5158
- /* @__PURE__ */ jsxs21("div", { className: "flex gap-2", children: [
5159
- /* @__PURE__ */ jsx23(
5267
+ /* @__PURE__ */ jsxs22("div", { className: "flex gap-2", children: [
5268
+ /* @__PURE__ */ jsx24(
5160
5269
  "button",
5161
5270
  {
5162
5271
  type: "button",
@@ -5165,7 +5274,7 @@ var ImageEditor = ({
5165
5274
  children: "Threshold Mode"
5166
5275
  }
5167
5276
  ),
5168
- /* @__PURE__ */ jsx23(
5277
+ /* @__PURE__ */ jsx24(
5169
5278
  "button",
5170
5279
  {
5171
5280
  type: "button",
@@ -5175,12 +5284,12 @@ var ImageEditor = ({
5175
5284
  }
5176
5285
  )
5177
5286
  ] }),
5178
- /* @__PURE__ */ jsxs21("div", { children: [
5179
- /* @__PURE__ */ jsxs21("div", { className: "flex justify-between text-muted-foreground mb-1", children: [
5180
- /* @__PURE__ */ jsx23("span", { children: "Depth Start (Lower):" }),
5181
- /* @__PURE__ */ jsx23("span", { className: "font-mono", children: state.depthMask.depthRange[0] })
5287
+ /* @__PURE__ */ jsxs22("div", { children: [
5288
+ /* @__PURE__ */ jsxs22("div", { className: "flex justify-between text-muted-foreground mb-1", children: [
5289
+ /* @__PURE__ */ jsx24("span", { children: "Depth Start (Lower):" }),
5290
+ /* @__PURE__ */ jsx24("span", { className: "font-mono", children: state.depthMask.depthRange[0] })
5182
5291
  ] }),
5183
- /* @__PURE__ */ jsx23(
5292
+ /* @__PURE__ */ jsx24(
5184
5293
  "input",
5185
5294
  {
5186
5295
  type: "range",
@@ -5194,12 +5303,12 @@ var ImageEditor = ({
5194
5303
  }
5195
5304
  )
5196
5305
  ] }),
5197
- /* @__PURE__ */ jsxs21("div", { children: [
5198
- /* @__PURE__ */ jsxs21("div", { className: "flex justify-between text-muted-foreground mb-1", children: [
5199
- /* @__PURE__ */ jsx23("span", { children: "Depth Stop (Upper):" }),
5200
- /* @__PURE__ */ jsx23("span", { className: "font-mono", children: state.depthMask.depthRange[1] })
5306
+ /* @__PURE__ */ jsxs22("div", { children: [
5307
+ /* @__PURE__ */ jsxs22("div", { className: "flex justify-between text-muted-foreground mb-1", children: [
5308
+ /* @__PURE__ */ jsx24("span", { children: "Depth Stop (Upper):" }),
5309
+ /* @__PURE__ */ jsx24("span", { className: "font-mono", children: state.depthMask.depthRange[1] })
5201
5310
  ] }),
5202
- /* @__PURE__ */ jsx23(
5311
+ /* @__PURE__ */ jsx24(
5203
5312
  "input",
5204
5313
  {
5205
5314
  type: "range",
@@ -5213,12 +5322,12 @@ var ImageEditor = ({
5213
5322
  }
5214
5323
  )
5215
5324
  ] }),
5216
- /* @__PURE__ */ jsxs21("div", { children: [
5217
- /* @__PURE__ */ jsxs21("div", { className: "flex justify-between text-muted-foreground mb-1", children: [
5218
- /* @__PURE__ */ jsx23("span", { children: "Softness:" }),
5219
- /* @__PURE__ */ jsx23("span", { className: "font-mono", children: state.depthMask.softness })
5325
+ /* @__PURE__ */ jsxs22("div", { children: [
5326
+ /* @__PURE__ */ jsxs22("div", { className: "flex justify-between text-muted-foreground mb-1", children: [
5327
+ /* @__PURE__ */ jsx24("span", { children: "Softness:" }),
5328
+ /* @__PURE__ */ jsx24("span", { className: "font-mono", children: state.depthMask.softness })
5220
5329
  ] }),
5221
- /* @__PURE__ */ jsx23(
5330
+ /* @__PURE__ */ jsx24(
5222
5331
  "input",
5223
5332
  {
5224
5333
  type: "range",
@@ -5230,8 +5339,8 @@ var ImageEditor = ({
5230
5339
  }
5231
5340
  )
5232
5341
  ] }),
5233
- /* @__PURE__ */ jsxs21("label", { className: "flex items-center gap-2 cursor-pointer text-foreground mt-1", children: [
5234
- /* @__PURE__ */ jsx23(
5342
+ /* @__PURE__ */ jsxs22("label", { className: "flex items-center gap-2 cursor-pointer text-foreground mt-1", children: [
5343
+ /* @__PURE__ */ jsx24(
5235
5344
  "input",
5236
5345
  {
5237
5346
  type: "checkbox",
@@ -5240,12 +5349,12 @@ var ImageEditor = ({
5240
5349
  className: "rounded accent-primary"
5241
5350
  }
5242
5351
  ),
5243
- /* @__PURE__ */ jsx23("span", { children: "Invert Mask" })
5352
+ /* @__PURE__ */ jsx24("span", { children: "Invert Mask" })
5244
5353
  ] })
5245
5354
  ] })
5246
5355
  ] }),
5247
- activeTab === "select" && /* @__PURE__ */ jsxs21("div", { className: "flex flex-col gap-4 text-xs", children: [
5248
- /* @__PURE__ */ jsx23(
5356
+ activeTab === "select" && /* @__PURE__ */ jsxs22("div", { className: "flex flex-col gap-4 text-xs", children: [
5357
+ /* @__PURE__ */ jsx24(
5249
5358
  SelectionOptionsBar,
5250
5359
  {
5251
5360
  controller,
@@ -5256,9 +5365,9 @@ var ImageEditor = ({
5256
5365
  selectionDisplay: state.selectionDisplay
5257
5366
  }
5258
5367
  ),
5259
- selectionError && /* @__PURE__ */ jsx23("p", { role: "alert", className: "text-destructive", children: selectionError }),
5260
- /* @__PURE__ */ jsxs21("div", { className: "flex gap-1", children: [
5261
- /* @__PURE__ */ jsx23(
5368
+ selectionError && /* @__PURE__ */ jsx24("p", { role: "alert", className: "text-destructive", children: selectionError }),
5369
+ /* @__PURE__ */ jsxs22("div", { className: "flex gap-1", children: [
5370
+ /* @__PURE__ */ jsx24(
5262
5371
  "button",
5263
5372
  {
5264
5373
  type: "button",
@@ -5269,7 +5378,7 @@ var ImageEditor = ({
5269
5378
  children: "Transform Selection"
5270
5379
  }
5271
5380
  ),
5272
- /* @__PURE__ */ jsx23(
5381
+ /* @__PURE__ */ jsx24(
5273
5382
  "button",
5274
5383
  {
5275
5384
  type: "button",
@@ -5281,13 +5390,14 @@ var ImageEditor = ({
5281
5390
  }
5282
5391
  )
5283
5392
  ] }),
5284
- /* @__PURE__ */ jsx23(RefineEdgePanel, { controller, selection: state.selection ?? null, layers: state.adjustments.layers }),
5285
- /* @__PURE__ */ jsx23(ChannelsPanel, { controller })
5393
+ /* @__PURE__ */ jsx24(RefineEdgePanel, { controller, selection: state.selection ?? null, layers: state.adjustments.layers }),
5394
+ /* @__PURE__ */ jsx24(ChannelsPanel, { controller }),
5395
+ /* @__PURE__ */ jsx24(PathsPanel, { controller })
5286
5396
  ] }),
5287
- activeTab === "ai" && /* @__PURE__ */ jsxs21("div", { className: "flex flex-col gap-4 text-xs", children: [
5288
- /* @__PURE__ */ jsxs21("label", { className: "flex items-center justify-between gap-2 text-foreground", children: [
5289
- /* @__PURE__ */ jsx23("span", { children: "Results go to" }),
5290
- /* @__PURE__ */ jsxs21(
5397
+ activeTab === "ai" && /* @__PURE__ */ jsxs22("div", { className: "flex flex-col gap-4 text-xs", children: [
5398
+ /* @__PURE__ */ jsxs22("label", { className: "flex items-center justify-between gap-2 text-foreground", children: [
5399
+ /* @__PURE__ */ jsx24("span", { children: "Results go to" }),
5400
+ /* @__PURE__ */ jsxs22(
5291
5401
  "select",
5292
5402
  {
5293
5403
  "aria-label": "AI result target",
@@ -5295,54 +5405,54 @@ var ImageEditor = ({
5295
5405
  onChange: (e) => setAiTarget(e.target.value),
5296
5406
  className: imageSelectClass,
5297
5407
  children: [
5298
- /* @__PURE__ */ jsx23("option", { value: "auto", children: controller.isMultiLayer ? "Auto (new layer)" : "Auto (replace image)" }),
5299
- /* @__PURE__ */ jsx23("option", { value: "new-layer", children: "New layer / mask" }),
5300
- /* @__PURE__ */ jsx23("option", { value: "replace", children: "Replace image" })
5408
+ /* @__PURE__ */ jsx24("option", { value: "auto", children: controller.isMultiLayer ? "Auto (new layer)" : "Auto (replace image)" }),
5409
+ /* @__PURE__ */ jsx24("option", { value: "new-layer", children: "New layer / mask" }),
5410
+ /* @__PURE__ */ jsx24("option", { value: "replace", children: "Replace image" })
5301
5411
  ]
5302
5412
  }
5303
5413
  )
5304
5414
  ] }),
5305
- /* @__PURE__ */ jsxs21("div", { className: "p-3 rounded-lg bg-muted/40 border border-border flex flex-col gap-2.5", children: [
5306
- /* @__PURE__ */ jsxs21("div", { className: "flex items-center justify-between", children: [
5307
- /* @__PURE__ */ jsxs21("span", { className: "font-semibold text-foreground uppercase tracking-wider text-[11px] flex items-center gap-1.5", children: [
5308
- /* @__PURE__ */ jsx23("svg", { className: "w-3.5 h-3.5 text-primary", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: /* @__PURE__ */ jsx23("path", { d: "M6 3v12M18 9a3 3 0 1 0 0-6 3 3 0 0 0 0 6zM6 21a3 3 0 1 0 0-6 3 3 0 0 0 0 6z" }) }),
5415
+ /* @__PURE__ */ jsxs22("div", { className: "p-3 rounded-lg bg-muted/40 border border-border flex flex-col gap-2.5", children: [
5416
+ /* @__PURE__ */ jsxs22("div", { className: "flex items-center justify-between", children: [
5417
+ /* @__PURE__ */ jsxs22("span", { className: "font-semibold text-foreground uppercase tracking-wider text-[11px] flex items-center gap-1.5", children: [
5418
+ /* @__PURE__ */ jsx24("svg", { className: "w-3.5 h-3.5 text-primary", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: /* @__PURE__ */ jsx24("path", { d: "M6 3v12M18 9a3 3 0 1 0 0-6 3 3 0 0 0 0 6zM6 21a3 3 0 1 0 0-6 3 3 0 0 0 0 6z" }) }),
5309
5419
  "Background Removal"
5310
5420
  ] }),
5311
- isRemovingBg && /* @__PURE__ */ jsx23("span", { className: "inline-flex items-center px-1.5 py-0.5 rounded text-[10px] font-medium bg-primary/15 text-primary animate-pulse", children: "Removing..." })
5421
+ isRemovingBg && /* @__PURE__ */ jsx24("span", { className: "inline-flex items-center px-1.5 py-0.5 rounded text-[10px] font-medium bg-primary/15 text-primary animate-pulse", children: "Removing..." })
5312
5422
  ] }),
5313
- /* @__PURE__ */ jsx23("p", { className: "text-muted-foreground text-[11px] leading-relaxed", children: "Isolate foreground subject with AI alpha transparency segmentation." }),
5314
- /* @__PURE__ */ jsx23(
5423
+ /* @__PURE__ */ jsx24("p", { className: "text-muted-foreground text-[11px] leading-relaxed", children: "Isolate foreground subject with AI alpha transparency segmentation." }),
5424
+ /* @__PURE__ */ jsx24(
5315
5425
  "button",
5316
5426
  {
5317
5427
  type: "button",
5318
5428
  onClick: handleRemoveBackground,
5319
5429
  disabled: isRemovingBg || isInpainting,
5320
5430
  className: "mt-1 px-3 py-2 rounded-lg bg-primary hover:bg-primary/90 disabled:opacity-50 text-primary-foreground font-medium shadow transition-colors flex items-center justify-center gap-2",
5321
- children: isRemovingBg ? /* @__PURE__ */ jsxs21(Fragment6, { children: [
5322
- /* @__PURE__ */ jsx23("div", { className: imageSpinnerClass }),
5431
+ children: isRemovingBg ? /* @__PURE__ */ jsxs22(Fragment6, { children: [
5432
+ /* @__PURE__ */ jsx24("div", { className: imageSpinnerClass }),
5323
5433
  "Removing Background..."
5324
- ] }) : /* @__PURE__ */ jsxs21(Fragment6, { children: [
5325
- /* @__PURE__ */ jsx23("svg", { className: "w-3.5 h-3.5", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: /* @__PURE__ */ jsx23("path", { d: "M12 2v4M12 18v4M4.93 4.93l2.83 2.83M16.24 16.24l2.83 2.83M2 12h4M18 12h4M4.93 19.07l2.83-2.83M16.24 7.76l2.83-2.83" }) }),
5434
+ ] }) : /* @__PURE__ */ jsxs22(Fragment6, { children: [
5435
+ /* @__PURE__ */ jsx24("svg", { className: "w-3.5 h-3.5", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: /* @__PURE__ */ jsx24("path", { d: "M12 2v4M12 18v4M4.93 4.93l2.83 2.83M16.24 16.24l2.83 2.83M2 12h4M18 12h4M4.93 19.07l2.83-2.83M16.24 7.76l2.83-2.83" }) }),
5326
5436
  "Remove Background"
5327
5437
  ] })
5328
5438
  }
5329
5439
  )
5330
5440
  ] }),
5331
- /* @__PURE__ */ jsxs21("div", { className: "p-3 rounded-lg bg-muted/40 border border-border flex flex-col gap-2.5", children: [
5332
- /* @__PURE__ */ jsxs21("div", { className: "flex items-center justify-between", children: [
5333
- /* @__PURE__ */ jsxs21("span", { className: "font-semibold text-foreground uppercase tracking-wider text-[11px] flex items-center gap-1.5", children: [
5334
- /* @__PURE__ */ jsxs21("svg", { className: "w-3.5 h-3.5 text-primary", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [
5335
- /* @__PURE__ */ jsx23("path", { d: "m21.64 3.64-1.28-1.28a1.2 1.2 0 0 0-1.7 0l-9.72 9.72-1.94 4.86 4.86-1.94 9.72-9.72a1.2 1.2 0 0 0 .06-1.64z" }),
5336
- /* @__PURE__ */ jsx23("path", { d: "m14 7 3 3" })
5441
+ /* @__PURE__ */ jsxs22("div", { className: "p-3 rounded-lg bg-muted/40 border border-border flex flex-col gap-2.5", children: [
5442
+ /* @__PURE__ */ jsxs22("div", { className: "flex items-center justify-between", children: [
5443
+ /* @__PURE__ */ jsxs22("span", { className: "font-semibold text-foreground uppercase tracking-wider text-[11px] flex items-center gap-1.5", children: [
5444
+ /* @__PURE__ */ jsxs22("svg", { className: "w-3.5 h-3.5 text-primary", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [
5445
+ /* @__PURE__ */ jsx24("path", { d: "m21.64 3.64-1.28-1.28a1.2 1.2 0 0 0-1.7 0l-9.72 9.72-1.94 4.86 4.86-1.94 9.72-9.72a1.2 1.2 0 0 0 .06-1.64z" }),
5446
+ /* @__PURE__ */ jsx24("path", { d: "m14 7 3 3" })
5337
5447
  ] }),
5338
5448
  "Generative Inpainting"
5339
5449
  ] }),
5340
- isInpainting && /* @__PURE__ */ jsx23("span", { className: "inline-flex items-center px-1.5 py-0.5 rounded text-[10px] font-medium bg-primary/15 text-primary animate-pulse", children: "Inpainting..." })
5450
+ isInpainting && /* @__PURE__ */ jsx24("span", { className: "inline-flex items-center px-1.5 py-0.5 rounded text-[10px] font-medium bg-primary/15 text-primary animate-pulse", children: "Inpainting..." })
5341
5451
  ] }),
5342
- /* @__PURE__ */ jsx23("p", { className: "text-muted-foreground text-[11px] leading-relaxed", children: "Replace, modify, or fill selected regions using prompt-guided generative inpainting." }),
5343
- /* @__PURE__ */ jsxs21("div", { className: "flex flex-col gap-1", children: [
5344
- /* @__PURE__ */ jsx23("label", { htmlFor: "ai-inpaint-prompt-react", className: "text-foreground text-[11px] font-medium", children: "Prompt" }),
5345
- /* @__PURE__ */ jsx23(
5452
+ /* @__PURE__ */ jsx24("p", { className: "text-muted-foreground text-[11px] leading-relaxed", children: "Replace, modify, or fill selected regions using prompt-guided generative inpainting." }),
5453
+ /* @__PURE__ */ jsxs22("div", { className: "flex flex-col gap-1", children: [
5454
+ /* @__PURE__ */ jsx24("label", { htmlFor: "ai-inpaint-prompt-react", className: "text-foreground text-[11px] font-medium", children: "Prompt" }),
5455
+ /* @__PURE__ */ jsx24(
5346
5456
  "textarea",
5347
5457
  {
5348
5458
  id: "ai-inpaint-prompt-react",
@@ -5354,10 +5464,10 @@ var ImageEditor = ({
5354
5464
  }
5355
5465
  )
5356
5466
  ] }),
5357
- /* @__PURE__ */ jsxs21("div", { className: "flex flex-col gap-1", children: [
5358
- /* @__PURE__ */ jsx23("span", { className: "text-foreground text-[11px] font-medium", children: "Target Mask Region" }),
5359
- /* @__PURE__ */ jsxs21("div", { className: "grid grid-cols-2 gap-1.5", children: [
5360
- /* @__PURE__ */ jsxs21(
5467
+ /* @__PURE__ */ jsxs22("div", { className: "flex flex-col gap-1", children: [
5468
+ /* @__PURE__ */ jsx24("span", { className: "text-foreground text-[11px] font-medium", children: "Target Mask Region" }),
5469
+ /* @__PURE__ */ jsxs22("div", { className: "grid grid-cols-2 gap-1.5", children: [
5470
+ /* @__PURE__ */ jsxs22(
5361
5471
  "button",
5362
5472
  {
5363
5473
  type: "button",
@@ -5370,7 +5480,7 @@ var ImageEditor = ({
5370
5480
  ]
5371
5481
  }
5372
5482
  ),
5373
- /* @__PURE__ */ jsxs21(
5483
+ /* @__PURE__ */ jsxs22(
5374
5484
  "button",
5375
5485
  {
5376
5486
  type: "button",
@@ -5385,25 +5495,25 @@ var ImageEditor = ({
5385
5495
  )
5386
5496
  ] })
5387
5497
  ] }),
5388
- /* @__PURE__ */ jsx23(
5498
+ /* @__PURE__ */ jsx24(
5389
5499
  "button",
5390
5500
  {
5391
5501
  type: "button",
5392
5502
  onClick: handleInpaint,
5393
5503
  disabled: isInpainting || isRemovingBg || !inpaintPrompt.trim(),
5394
5504
  className: "mt-1 px-3 py-2 rounded-lg bg-primary hover:bg-primary/90 disabled:opacity-50 text-primary-foreground font-medium shadow transition-colors flex items-center justify-center gap-2",
5395
- children: isInpainting ? /* @__PURE__ */ jsxs21(Fragment6, { children: [
5396
- /* @__PURE__ */ jsx23("div", { className: imageSpinnerClass }),
5505
+ children: isInpainting ? /* @__PURE__ */ jsxs22(Fragment6, { children: [
5506
+ /* @__PURE__ */ jsx24("div", { className: imageSpinnerClass }),
5397
5507
  "Generating Inpaint..."
5398
- ] }) : /* @__PURE__ */ jsxs21(Fragment6, { children: [
5399
- /* @__PURE__ */ jsx23("svg", { className: "w-3.5 h-3.5", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: /* @__PURE__ */ jsx23("path", { d: "M12 2v4M12 18v4M4.93 4.93l2.83 2.83M16.24 16.24l2.83 2.83M2 12h4M18 12h4M4.93 19.07l2.83-2.83M16.24 7.76l2.83-2.83" }) }),
5508
+ ] }) : /* @__PURE__ */ jsxs22(Fragment6, { children: [
5509
+ /* @__PURE__ */ jsx24("svg", { className: "w-3.5 h-3.5", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: /* @__PURE__ */ jsx24("path", { d: "M12 2v4M12 18v4M4.93 4.93l2.83 2.83M16.24 16.24l2.83 2.83M2 12h4M18 12h4M4.93 19.07l2.83-2.83M16.24 7.76l2.83-2.83" }) }),
5400
5510
  "Apply Inpainting"
5401
5511
  ] })
5402
5512
  }
5403
5513
  )
5404
5514
  ] }),
5405
- aiError && /* @__PURE__ */ jsx23("div", { className: "p-2.5 rounded-lg bg-destructive/10 border border-destructive/40 text-destructive text-[11px]", children: aiError }),
5406
- aiSuccess && /* @__PURE__ */ jsx23("div", { className: "p-2.5 rounded-lg bg-emerald-500/10 border border-emerald-500/30 text-emerald-600 text-[11px]", children: aiSuccess })
5515
+ aiError && /* @__PURE__ */ jsx24("div", { className: "p-2.5 rounded-lg bg-destructive/10 border border-destructive/40 text-destructive text-[11px]", children: aiError }),
5516
+ aiSuccess && /* @__PURE__ */ jsx24("div", { className: "p-2.5 rounded-lg bg-emerald-500/10 border border-emerald-500/30 text-emerald-600 text-[11px]", children: aiSuccess })
5407
5517
  ] })
5408
5518
  ] })
5409
5519
  ] })
@@ -5439,6 +5549,7 @@ export {
5439
5549
  SelectionOptionsBar,
5440
5550
  RefineEdgePanel,
5441
5551
  ChannelsPanel,
5552
+ PathsPanel,
5442
5553
  FreeTransformOptionsBar,
5443
5554
  ShapeOptionsBar,
5444
5555
  TypeOptionsBar,