@pixerate/editor-react 0.140.0 → 0.141.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.
@@ -52,6 +52,7 @@ __export(image_editor_exports, {
52
52
  LayerEffectsPanel: () => LayerEffectsPanel,
53
53
  LayersPanel: () => LayersPanel,
54
54
  PaintGradientEditor: () => PaintGradientEditor,
55
+ PathsPanel: () => PathsPanel,
55
56
  RefineEdgePanel: () => RefineEdgePanel,
56
57
  SelectAndMaskWorkspace: () => SelectAndMaskWorkspace,
57
58
  SelectionOptionsBar: () => SelectionOptionsBar,
@@ -233,8 +234,8 @@ function useImageEffectsTools(registry, controller, options = {}) {
233
234
  }
234
235
 
235
236
  // src/image-editor/ImageEditor.tsx
236
- var import_react33 = __toESM(require("react"), 1);
237
- var import_image_editor22 = require("@pixerate/editor/image-editor");
237
+ var import_react34 = __toESM(require("react"), 1);
238
+ var import_image_editor23 = require("@pixerate/editor/image-editor");
238
239
 
239
240
  // src/image-editor/ImageEditorCanvas.tsx
240
241
  var import_react5 = require("react");
@@ -5964,14 +5965,121 @@ var ChannelsPanel = ({ controller, thumbnailSize = 32, className = "" }) => {
5964
5965
  ] });
5965
5966
  };
5966
5967
 
5967
- // src/image-editor/FreeTransformOptionsBar.tsx
5968
+ // src/image-editor/PathsPanel.tsx
5968
5969
  var import_react30 = require("react");
5969
5970
  var import_image_editor19 = require("@pixerate/editor/image-editor");
5970
5971
  var import_jsx_runtime30 = require("react/jsx-runtime");
5972
+ 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"}`;
5973
+ var PathsPanel = ({ controller, thumbnailSize = 32, className = "" }) => {
5974
+ const [, setTick] = (0, import_react30.useState)(0);
5975
+ (0, import_react30.useEffect)(() => controller.subscribe(() => setTick((n) => n + 1)), [controller]);
5976
+ const [renaming, setRenaming] = (0, import_react30.useState)(null);
5977
+ const [color, setColor] = (0, import_react30.useState)("#000000");
5978
+ const [width, setWidth] = (0, import_react30.useState)(2);
5979
+ const [error, setError] = (0, import_react30.useState)(null);
5980
+ const paths = controller.getPaths();
5981
+ const activeId = controller.getState().activePathId ?? null;
5982
+ const active = paths.find((p) => p.id === activeId) ?? null;
5983
+ const hasSelection = Boolean(controller.getSelection());
5984
+ const { width: w, height: h } = controller.getState().imageDimensions;
5985
+ const attempt = (fn) => {
5986
+ setError(null);
5987
+ try {
5988
+ fn();
5989
+ } catch (err) {
5990
+ setError(err instanceof Error ? err.message : String(err));
5991
+ }
5992
+ };
5993
+ return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { "data-testid": "paths-panel", className: `flex flex-col gap-2 text-xs ${className}`, children: [
5994
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { className: imageSectionTitleClass, children: "Paths" }),
5995
+ paths.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("p", { className: "text-muted-foreground", children: "No paths. Make a work path from a selection." }),
5996
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("ul", { role: "list", className: "flex flex-col gap-0.5", children: paths.map((p) => /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
5997
+ "li",
5998
+ {
5999
+ "data-testid": "path-row",
6000
+ "aria-current": p.id === activeId ? "true" : void 0,
6001
+ 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"}`,
6002
+ onClick: () => attempt(() => controller.setActivePath(p.id)),
6003
+ onDoubleClick: () => setRenaming(p.id),
6004
+ children: [
6005
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("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__ */ (0, import_jsx_runtime30.jsx)("path", { d: (0, import_image_editor19.pathSvgData)(p), fill: "currentColor", fillOpacity: 0.25, stroke: "currentColor", strokeWidth: Math.max(w, h) / 64, fillRule: p.fillRule ?? "nonzero" }) }),
6006
+ renaming === p.id ? /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
6007
+ "input",
6008
+ {
6009
+ autoFocus: true,
6010
+ "aria-label": "Path name",
6011
+ defaultValue: p.work ? "" : p.name,
6012
+ placeholder: "Path name",
6013
+ className: "min-w-0 flex-1 bg-background border border-border rounded px-1 py-0.5 text-foreground",
6014
+ onClick: (e) => e.stopPropagation(),
6015
+ onBlur: (e) => {
6016
+ setRenaming(null);
6017
+ const name = e.currentTarget.value.trim();
6018
+ if (name && name !== p.name) attempt(() => controller.renamePath(p.id, name));
6019
+ },
6020
+ onKeyDown: (e) => {
6021
+ if (e.key === "Enter") e.currentTarget.blur();
6022
+ if (e.key === "Escape") setRenaming(null);
6023
+ }
6024
+ }
6025
+ ) : /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { className: `min-w-0 flex-1 truncate ${p.work ? "italic" : ""}`, children: p.name })
6026
+ ]
6027
+ },
6028
+ p.id
6029
+ )) }),
6030
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "flex flex-wrap gap-1", children: [
6031
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
6032
+ "button",
6033
+ {
6034
+ type: "button",
6035
+ className: btn3(),
6036
+ disabled: !active,
6037
+ title: "Load the path as the selection (Shift adds, Alt subtracts)",
6038
+ onClick: (e) => attempt(() => controller.loadPathAsSelection(active.id, { mode: (0, import_image_editor19.selectionModeFromModifiers)(e, "replace") })),
6039
+ children: "Load as Selection"
6040
+ }
6041
+ ),
6042
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("button", { type: "button", className: btn3(), disabled: !hasSelection, onClick: () => attempt(() => controller.makeWorkPath()), children: "Make Work Path" }),
6043
+ active?.work && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("button", { type: "button", className: btn3(), onClick: () => setRenaming(active.id), children: "Save Path" }),
6044
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("button", { type: "button", className: btn3(), disabled: !active, onClick: () => attempt(() => controller.addVectorMaskFromPath(active.id)), children: "Add Vector Mask" })
6045
+ ] }),
6046
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "flex flex-wrap items-center gap-1", children: [
6047
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("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" }),
6048
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("button", { type: "button", className: btn3(), disabled: !active, onClick: () => attempt(() => controller.fillPath(active.id, { color })), children: "Fill Path" }),
6049
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("label", { className: "flex items-center gap-1 text-muted-foreground", children: [
6050
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
6051
+ "input",
6052
+ {
6053
+ type: "number",
6054
+ min: 0.5,
6055
+ max: 250,
6056
+ step: 0.5,
6057
+ "aria-label": "Stroke width",
6058
+ value: width,
6059
+ onChange: (e) => setWidth(Math.min(250, Math.max(0.5, Number(e.target.value) || 1))),
6060
+ className: "w-12 bg-background border border-border rounded px-1 py-0.5 text-foreground"
6061
+ }
6062
+ ),
6063
+ "px"
6064
+ ] }),
6065
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("button", { type: "button", className: btn3(), disabled: !active, onClick: () => attempt(() => controller.strokePath(active.id, { width, color })), children: "Stroke Path" })
6066
+ ] }),
6067
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "flex flex-wrap gap-1", children: [
6068
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("button", { type: "button", className: btn3(), disabled: !active, onClick: () => attempt(() => controller.duplicatePath(active.id)), children: "Duplicate" }),
6069
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("button", { type: "button", className: btn3(), disabled: !active, onClick: () => attempt(() => controller.deletePath(active.id)), children: "Delete" })
6070
+ ] }),
6071
+ error && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("p", { role: "alert", className: "text-destructive", children: error })
6072
+ ] });
6073
+ };
6074
+
6075
+ // src/image-editor/FreeTransformOptionsBar.tsx
6076
+ var import_react31 = require("react");
6077
+ var import_image_editor20 = require("@pixerate/editor/image-editor");
6078
+ var import_jsx_runtime31 = require("react/jsx-runtime");
5971
6079
  var round = (v, unit) => unit === "px" ? Math.round(v * 10) / 10 : Math.round(v * 100) / 100;
5972
6080
  var FreeTransformOptionsBar = ({ tool, className }) => {
5973
- const [, setTick] = (0, import_react30.useState)(0);
5974
- (0, import_react30.useEffect)(() => tool.subscribe(() => setTick((n) => n + 1)), [tool]);
6081
+ const [, setTick] = (0, import_react31.useState)(0);
6082
+ (0, import_react31.useEffect)(() => tool.subscribe(() => setTick((n) => n + 1)), [tool]);
5975
6083
  const bar = tool.bar();
5976
6084
  if (!tool.active || !bar) return null;
5977
6085
  const warp = tool.warpBar();
@@ -5983,17 +6091,17 @@ var FreeTransformOptionsBar = ({ tool, className }) => {
5983
6091
  const v = Number(raw);
5984
6092
  if (raw.trim() !== "" && Number.isFinite(v) && Math.abs(v - bar[field]) > 1e-9) tool.setField(field, v);
5985
6093
  };
5986
- return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("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: [
5987
- /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "flex gap-1", role: "group", "aria-label": "Transform mode", children: import_image_editor19.FREE_TRANSFORM_MODE_OPTIONS.map((m) => /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("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)) }),
5988
- /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "grid grid-cols-3 gap-px", role: "group", "aria-label": "Reference point", children: import_image_editor19.TRANSFORM_ANCHORS.map((a) => /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("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)) }),
5989
- tool.mode === "warp" && /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "flex flex-wrap items-center gap-2", role: "group", "aria-label": "Warp options", children: [
5990
- /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("label", { className: "flex items-center gap-1", children: [
5991
- /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { className: "text-muted-foreground", children: "Warp" }),
5992
- /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("select", { "aria-label": "Warp style", value: warp.style, onChange: (e) => tool.setWarp({ style: e.target.value }), className: imageFieldClass, children: import_image_editor19.WARP_STYLE_OPTIONS.map((o) => /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("option", { value: o.id, children: o.label }, o.id)) })
6094
+ return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("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: [
6095
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "flex gap-1", role: "group", "aria-label": "Transform mode", children: import_image_editor20.FREE_TRANSFORM_MODE_OPTIONS.map((m) => /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("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)) }),
6096
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "grid grid-cols-3 gap-px", role: "group", "aria-label": "Reference point", children: import_image_editor20.TRANSFORM_ANCHORS.map((a) => /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("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)) }),
6097
+ tool.mode === "warp" && /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "flex flex-wrap items-center gap-2", role: "group", "aria-label": "Warp options", children: [
6098
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("label", { className: "flex items-center gap-1", children: [
6099
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { className: "text-muted-foreground", children: "Warp" }),
6100
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("select", { "aria-label": "Warp style", value: warp.style, onChange: (e) => tool.setWarp({ style: e.target.value }), className: imageFieldClass, children: import_image_editor20.WARP_STYLE_OPTIONS.map((o) => /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("option", { value: o.id, children: o.label }, o.id)) })
5993
6101
  ] }),
5994
- ["bend", "horizontal", "vertical"].map((k) => /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("label", { className: "flex items-center gap-1", children: [
5995
- /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { className: "text-muted-foreground", children: k === "bend" ? "Bend" : k === "horizontal" ? "H" : "V" }),
5996
- /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
6102
+ ["bend", "horizontal", "vertical"].map((k) => /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("label", { className: "flex items-center gap-1", children: [
6103
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { className: "text-muted-foreground", children: k === "bend" ? "Bend" : k === "horizontal" ? "H" : "V" }),
6104
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
5997
6105
  "input",
5998
6106
  {
5999
6107
  type: "number",
@@ -6014,9 +6122,9 @@ var FreeTransformOptionsBar = ({ tool, className }) => {
6014
6122
  },
6015
6123
  `${k}:${warp[k]}`
6016
6124
  ),
6017
- /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { className: "text-muted-foreground", children: "%" })
6125
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { className: "text-muted-foreground", children: "%" })
6018
6126
  ] }, k)),
6019
- /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
6127
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
6020
6128
  "button",
6021
6129
  {
6022
6130
  type: "button",
@@ -6028,26 +6136,26 @@ var FreeTransformOptionsBar = ({ tool, className }) => {
6028
6136
  children: "Vertical"
6029
6137
  }
6030
6138
  ),
6031
- /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("label", { className: "flex items-center gap-1", children: [
6032
- /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { className: "text-muted-foreground", children: "Grid" }),
6033
- /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
6139
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("label", { className: "flex items-center gap-1", children: [
6140
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { className: "text-muted-foreground", children: "Grid" }),
6141
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
6034
6142
  "select",
6035
6143
  {
6036
6144
  "aria-label": "Warp grid",
6037
- value: import_image_editor19.WARP_GRID_OPTIONS.find((g) => g.columns === warp.columns && g.rows === warp.rows)?.id ?? "1x1",
6145
+ value: import_image_editor20.WARP_GRID_OPTIONS.find((g) => g.columns === warp.columns && g.rows === warp.rows)?.id ?? "1x1",
6038
6146
  onChange: (e) => {
6039
- const g = import_image_editor19.WARP_GRID_OPTIONS.find((o) => o.id === e.target.value);
6147
+ const g = import_image_editor20.WARP_GRID_OPTIONS.find((o) => o.id === e.target.value);
6040
6148
  tool.setWarp({ columns: g.columns, rows: g.rows });
6041
6149
  },
6042
6150
  className: imageFieldClass,
6043
- children: import_image_editor19.WARP_GRID_OPTIONS.map((g) => /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("option", { value: g.id, children: g.label }, g.id))
6151
+ children: import_image_editor20.WARP_GRID_OPTIONS.map((g) => /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("option", { value: g.id, children: g.label }, g.id))
6044
6152
  }
6045
6153
  )
6046
6154
  ] })
6047
6155
  ] }),
6048
- tool.mode !== "warp" && import_image_editor19.FREE_TRANSFORM_FIELDS.map((f) => /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("label", { className: "flex items-center gap-1", title: f.title, children: [
6049
- /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { className: "text-muted-foreground", children: f.label }),
6050
- /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
6156
+ tool.mode !== "warp" && import_image_editor20.FREE_TRANSFORM_FIELDS.map((f) => /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("label", { className: "flex items-center gap-1", title: f.title, children: [
6157
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { className: "text-muted-foreground", children: f.label }),
6158
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
6051
6159
  "input",
6052
6160
  {
6053
6161
  type: "number",
@@ -6067,8 +6175,8 @@ var FreeTransformOptionsBar = ({ tool, className }) => {
6067
6175
  },
6068
6176
  `${f.id}:${round(bar[f.id], f.unit)}`
6069
6177
  ),
6070
- /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { className: "text-muted-foreground", children: f.unit }),
6071
- f.id === "scaleX" && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
6178
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { className: "text-muted-foreground", children: f.unit }),
6179
+ f.id === "scaleX" && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
6072
6180
  "button",
6073
6181
  {
6074
6182
  type: "button",
@@ -6083,33 +6191,33 @@ var FreeTransformOptionsBar = ({ tool, className }) => {
6083
6191
  }
6084
6192
  )
6085
6193
  ] }, f.id)),
6086
- /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("label", { className: "flex items-center gap-1", children: [
6087
- /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { className: "text-muted-foreground", children: "Interpolation" }),
6088
- /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
6194
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("label", { className: "flex items-center gap-1", children: [
6195
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { className: "text-muted-foreground", children: "Interpolation" }),
6196
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
6089
6197
  "select",
6090
6198
  {
6091
6199
  "aria-label": "Interpolation",
6092
6200
  value: tool.interpolation,
6093
6201
  onChange: (e) => tool.setInterpolation(e.target.value),
6094
6202
  className: imageFieldClass,
6095
- children: import_image_editor19.INTERPOLATIONS.map((i) => /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("option", { value: i, children: i[0].toUpperCase() + i.slice(1) }, i))
6203
+ children: import_image_editor20.INTERPOLATIONS.map((i) => /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("option", { value: i, children: i[0].toUpperCase() + i.slice(1) }, i))
6096
6204
  }
6097
6205
  )
6098
6206
  ] }),
6099
- /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("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" }),
6100
- /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("button", { type: "button", title: "Cancel (Esc)", className: imageChipClass(false), onClick: () => tool.cancel(), children: "Cancel" }),
6101
- tool.error && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { role: "alert", className: "text-destructive", children: tool.error })
6207
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("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" }),
6208
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("button", { type: "button", title: "Cancel (Esc)", className: imageChipClass(false), onClick: () => tool.cancel(), children: "Cancel" }),
6209
+ tool.error && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { role: "alert", className: "text-destructive", children: tool.error })
6102
6210
  ] });
6103
6211
  };
6104
6212
 
6105
6213
  // src/image-editor/ShapeOptionsBar.tsx
6106
- var import_react31 = require("react");
6107
- var import_image_editor20 = require("@pixerate/editor/image-editor");
6108
- var import_jsx_runtime31 = require("react/jsx-runtime");
6214
+ var import_react32 = require("react");
6215
+ var import_image_editor21 = require("@pixerate/editor/image-editor");
6216
+ var import_jsx_runtime32 = require("react/jsx-runtime");
6109
6217
  var ShapeOptionsBar = ({ controller, options, onChange, className }) => {
6110
- const [, setTick] = (0, import_react31.useState)(0);
6111
- (0, import_react31.useEffect)(() => controller.subscribe(() => setTick((n) => n + 1)), [controller]);
6112
- const [error, setError] = (0, import_react31.useState)(null);
6218
+ const [, setTick] = (0, import_react32.useState)(0);
6219
+ (0, import_react32.useEffect)(() => controller.subscribe(() => setTick((n) => n + 1)), [controller]);
6220
+ const [error, setError] = (0, import_react32.useState)(null);
6113
6221
  const active = controller.getActiveLayer();
6114
6222
  const shapeId = active?.type === "shape" ? active.id : null;
6115
6223
  const set = (change) => {
@@ -6117,28 +6225,28 @@ var ShapeOptionsBar = ({ controller, options, onChange, className }) => {
6117
6225
  if (!shapeId) return;
6118
6226
  try {
6119
6227
  setError(null);
6120
- (0, import_image_editor20.applyShapeOptions)(controller, shapeId, change);
6228
+ (0, import_image_editor21.applyShapeOptions)(controller, shapeId, change);
6121
6229
  } catch (e) {
6122
6230
  setError(e instanceof Error ? e.message : String(e));
6123
6231
  }
6124
6232
  };
6125
6233
  const num = (v, min, max) => Math.max(min, Math.min(max, Number(v) || min));
6126
- return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: `flex flex-col gap-2 text-xs text-foreground ${className ?? ""}`, "data-testid": "shape-options", children: [
6127
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "flex flex-wrap gap-1", role: "toolbar", "aria-label": "Shape kind", children: import_image_editor20.LIVE_SHAPE_KINDS.map((k) => /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("button", { type: "button", "aria-pressed": options.kind === k, className: imageChipClass(options.kind === k), onClick: () => onChange({ ...options, kind: k }), children: import_image_editor20.SHAPE_KIND_LABELS[k] }, k)) }),
6128
- /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "flex flex-wrap items-center gap-3", children: [
6129
- /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("label", { className: "flex items-center gap-1", children: [
6130
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(ImageCheckbox, { label: "Fill", checked: options.fill !== null, onChange: (on) => set({ fill: on ? "#4f46e5" : null }) }),
6234
+ return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: `flex flex-col gap-2 text-xs text-foreground ${className ?? ""}`, "data-testid": "shape-options", children: [
6235
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: "flex flex-wrap gap-1", role: "toolbar", "aria-label": "Shape kind", children: import_image_editor21.LIVE_SHAPE_KINDS.map((k) => /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("button", { type: "button", "aria-pressed": options.kind === k, className: imageChipClass(options.kind === k), onClick: () => onChange({ ...options, kind: k }), children: import_image_editor21.SHAPE_KIND_LABELS[k] }, k)) }),
6236
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "flex flex-wrap items-center gap-3", children: [
6237
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("label", { className: "flex items-center gap-1", children: [
6238
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(ImageCheckbox, { label: "Fill", checked: options.fill !== null, onChange: (on) => set({ fill: on ? "#4f46e5" : null }) }),
6131
6239
  "Fill",
6132
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(ImageColor, { label: "Fill colour", disabled: options.fill === null, value: options.fill ?? "#4f46e5", onChange: (fill) => set({ fill }) })
6240
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(ImageColor, { label: "Fill colour", disabled: options.fill === null, value: options.fill ?? "#4f46e5", onChange: (fill) => set({ fill }) })
6133
6241
  ] }),
6134
- /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("label", { className: "flex items-center gap-1", children: [
6135
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(ImageCheckbox, { label: "Stroke", checked: options.stroke !== null, onChange: (on) => set({ stroke: on ? "#000000" : null }) }),
6242
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("label", { className: "flex items-center gap-1", children: [
6243
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(ImageCheckbox, { label: "Stroke", checked: options.stroke !== null, onChange: (on) => set({ stroke: on ? "#000000" : null }) }),
6136
6244
  "Stroke",
6137
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(ImageColor, { label: "Stroke colour", disabled: options.stroke === null, value: options.stroke ?? "#000000", onChange: (stroke) => set({ stroke }) })
6245
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(ImageColor, { label: "Stroke colour", disabled: options.stroke === null, value: options.stroke ?? "#000000", onChange: (stroke) => set({ stroke }) })
6138
6246
  ] }),
6139
- /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("label", { className: "flex items-center gap-1", children: [
6247
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("label", { className: "flex items-center gap-1", children: [
6140
6248
  "Width",
6141
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
6249
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
6142
6250
  "input",
6143
6251
  {
6144
6252
  type: "number",
@@ -6152,52 +6260,52 @@ var ShapeOptionsBar = ({ controller, options, onChange, className }) => {
6152
6260
  )
6153
6261
  ] })
6154
6262
  ] }),
6155
- /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "flex flex-wrap items-center gap-3", children: [
6156
- options.kind === "rect" && /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("label", { className: "flex items-center gap-1", children: [
6263
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "flex flex-wrap items-center gap-3", children: [
6264
+ options.kind === "rect" && /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("label", { className: "flex items-center gap-1", children: [
6157
6265
  "Radius",
6158
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("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}` })
6266
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("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}` })
6159
6267
  ] }),
6160
- options.kind === "polygon" && /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("label", { className: "flex items-center gap-1", children: [
6268
+ options.kind === "polygon" && /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("label", { className: "flex items-center gap-1", children: [
6161
6269
  "Sides",
6162
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("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}` })
6270
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("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}` })
6163
6271
  ] }),
6164
- options.kind === "star" && /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(import_jsx_runtime31.Fragment, { children: [
6165
- /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("label", { className: "flex items-center gap-1", children: [
6272
+ options.kind === "star" && /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(import_jsx_runtime32.Fragment, { children: [
6273
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("label", { className: "flex items-center gap-1", children: [
6166
6274
  "Points",
6167
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("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}` })
6275
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("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}` })
6168
6276
  ] }),
6169
- /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("label", { className: "flex items-center gap-1", children: [
6277
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("label", { className: "flex items-center gap-1", children: [
6170
6278
  "Inner",
6171
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(ImageRange, { label: "Inner radius", min: 0.05, max: 1, step: 0.05, value: options.innerRatio, onChange: (v) => set({ innerRatio: v }) })
6279
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(ImageRange, { label: "Inner radius", min: 0.05, max: 1, step: 0.05, value: options.innerRatio, onChange: (v) => set({ innerRatio: v }) })
6172
6280
  ] })
6173
6281
  ] }),
6174
- options.kind === "line" && /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(import_jsx_runtime31.Fragment, { children: [
6175
- /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("label", { className: "flex items-center gap-1", children: [
6282
+ options.kind === "line" && /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(import_jsx_runtime32.Fragment, { children: [
6283
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("label", { className: "flex items-center gap-1", children: [
6176
6284
  "Weight",
6177
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("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}` })
6285
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("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}` })
6178
6286
  ] }),
6179
- /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("label", { className: "flex items-center gap-1", children: [
6180
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(ImageCheckbox, { label: "Arrowhead", checked: options.arrow, onChange: (on) => set({ arrow: on }) }),
6287
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("label", { className: "flex items-center gap-1", children: [
6288
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(ImageCheckbox, { label: "Arrowhead", checked: options.arrow, onChange: (on) => set({ arrow: on }) }),
6181
6289
  "Arrowhead"
6182
6290
  ] })
6183
6291
  ] })
6184
6292
  ] }),
6185
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("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." }),
6186
- error && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("p", { role: "alert", className: "text-destructive", children: error })
6293
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("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." }),
6294
+ error && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("p", { role: "alert", className: "text-destructive", children: error })
6187
6295
  ] });
6188
6296
  };
6189
6297
 
6190
6298
  // src/image-editor/TypeOptionsBar.tsx
6191
- var import_react32 = require("react");
6192
- var import_image_editor21 = require("@pixerate/editor/image-editor");
6193
- var import_jsx_runtime32 = require("react/jsx-runtime");
6299
+ var import_react33 = require("react");
6300
+ var import_image_editor22 = require("@pixerate/editor/image-editor");
6301
+ var import_jsx_runtime33 = require("react/jsx-runtime");
6194
6302
  var ALIGN_LABELS = { left: "Left", center: "Centre", right: "Right", justify: "Justify" };
6195
6303
  var ORIENTATION_LABELS = { horizontal: "Horizontal", vertical: "Vertical" };
6196
6304
  var TypeOptionsBar = ({ controller, options, onChange, session, className }) => {
6197
- const [, setTick] = (0, import_react32.useState)(0);
6198
- (0, import_react32.useEffect)(() => controller.subscribe(() => setTick((n) => n + 1)), [controller]);
6199
- (0, import_react32.useEffect)(() => session?.subscribe(() => setTick((n) => n + 1)), [session]);
6200
- const [error, setError] = (0, import_react32.useState)(null);
6305
+ const [, setTick] = (0, import_react33.useState)(0);
6306
+ (0, import_react33.useEffect)(() => controller.subscribe(() => setTick((n) => n + 1)), [controller]);
6307
+ (0, import_react33.useEffect)(() => session?.subscribe(() => setTick((n) => n + 1)), [session]);
6308
+ const [error, setError] = (0, import_react33.useState)(null);
6201
6309
  const active = controller.getActiveLayer();
6202
6310
  const typeId = !session && active?.type === "type" ? active.id : null;
6203
6311
  const here = session?.alive ? session.styleHere() : {};
@@ -6250,11 +6358,11 @@ var TypeOptionsBar = ({ controller, options, onChange, session, className }) =>
6250
6358
  setError(e instanceof Error ? e.message : String(e));
6251
6359
  }
6252
6360
  };
6253
- return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: `flex flex-col gap-2 text-xs text-foreground ${className ?? ""}`, "data-testid": "type-options", children: [
6254
- /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "flex flex-wrap items-center gap-2", children: [
6255
- /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("label", { className: "flex items-center gap-1", children: [
6361
+ return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: `flex flex-col gap-2 text-xs text-foreground ${className ?? ""}`, "data-testid": "type-options", children: [
6362
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "flex flex-wrap items-center gap-2", children: [
6363
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("label", { className: "flex items-center gap-1", children: [
6256
6364
  "Font",
6257
- /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
6365
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
6258
6366
  "input",
6259
6367
  {
6260
6368
  list: "pixerate-type-fonts",
@@ -6264,11 +6372,11 @@ var TypeOptionsBar = ({ controller, options, onChange, session, className }) =>
6264
6372
  className: "w-32 rounded border border-border bg-background px-1 py-0.5"
6265
6373
  }
6266
6374
  ),
6267
- /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("datalist", { id: "pixerate-type-fonts", children: fonts.map((f) => /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("option", { value: f }, f)) })
6375
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("datalist", { id: "pixerate-type-fonts", children: fonts.map((f) => /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("option", { value: f }, f)) })
6268
6376
  ] }),
6269
- /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("label", { className: "flex items-center gap-1", children: [
6377
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("label", { className: "flex items-center gap-1", children: [
6270
6378
  "Size",
6271
- /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
6379
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
6272
6380
  "input",
6273
6381
  {
6274
6382
  type: "number",
@@ -6281,14 +6389,14 @@ var TypeOptionsBar = ({ controller, options, onChange, session, className }) =>
6281
6389
  }
6282
6390
  )
6283
6391
  ] }),
6284
- /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("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" }),
6285
- /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("button", { type: "button", "aria-pressed": shown.italic, className: `${imageChipClass(shown.italic)} italic`, onClick: () => style({ italic: !shown.italic }), children: "I" }),
6286
- /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(ImageColor, { label: "Text colour", value: shown.color, onChange: (color) => style({ color }) })
6392
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("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" }),
6393
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("button", { type: "button", "aria-pressed": shown.italic, className: `${imageChipClass(shown.italic)} italic`, onClick: () => style({ italic: !shown.italic }), children: "I" }),
6394
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(ImageColor, { label: "Text colour", value: shown.color, onChange: (color) => style({ color }) })
6287
6395
  ] }),
6288
- /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: "flex gap-1", role: "toolbar", "aria-label": "Alignment", children: import_image_editor21.TEXT_ALIGNS.map((a) => /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("button", { type: "button", "aria-pressed": options.align === a, className: imageChipClass(options.align === a), onClick: () => style({ align: a }), children: ALIGN_LABELS[a] }, a)) }),
6289
- /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "flex gap-1", role: "toolbar", "aria-label": "Orientation", children: [
6290
- import_image_editor21.TEXT_ORIENTATIONS.map((o) => /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("button", { type: "button", "aria-pressed": orientation === o, className: imageChipClass(orientation === o), onClick: () => orient(o), children: ORIENTATION_LABELS[o] }, o)),
6291
- orientation === "vertical" && editedId && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
6396
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "flex gap-1", role: "toolbar", "aria-label": "Alignment", children: import_image_editor22.TEXT_ALIGNS.map((a) => /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("button", { type: "button", "aria-pressed": options.align === a, className: imageChipClass(options.align === a), onClick: () => style({ align: a }), children: ALIGN_LABELS[a] }, a)) }),
6397
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "flex gap-1", role: "toolbar", "aria-label": "Orientation", children: [
6398
+ import_image_editor22.TEXT_ORIENTATIONS.map((o) => /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("button", { type: "button", "aria-pressed": orientation === o, className: imageChipClass(orientation === o), onClick: () => orient(o), children: ORIENTATION_LABELS[o] }, o)),
6399
+ orientation === "vertical" && editedId && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
6292
6400
  "button",
6293
6401
  {
6294
6402
  type: "button",
@@ -6300,19 +6408,19 @@ var TypeOptionsBar = ({ controller, options, onChange, session, className }) =>
6300
6408
  }
6301
6409
  )
6302
6410
  ] }),
6303
- /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("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." }),
6304
- missing.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("p", { role: "status", className: "text-amber-600", "data-testid": "type-missing-fonts", children: [
6411
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("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." }),
6412
+ missing.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("p", { role: "status", className: "text-amber-600", "data-testid": "type-missing-fonts", children: [
6305
6413
  "Missing ",
6306
6414
  missing.length === 1 ? "font" : "fonts",
6307
6415
  ": ",
6308
6416
  missing.join(", ")
6309
6417
  ] }),
6310
- error && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("p", { role: "alert", className: "text-destructive", children: error })
6418
+ error && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("p", { role: "alert", className: "text-destructive", children: error })
6311
6419
  ] });
6312
6420
  };
6313
6421
 
6314
6422
  // src/image-editor/ImageEditor.tsx
6315
- var import_jsx_runtime33 = require("react/jsx-runtime");
6423
+ var import_jsx_runtime34 = require("react/jsx-runtime");
6316
6424
  var ImageEditor = ({
6317
6425
  editor: externalEditor,
6318
6426
  src,
@@ -6336,51 +6444,51 @@ var ImageEditor = ({
6336
6444
  const effectsShown = !!controller.effectsProvider || state.layers.some(function has(l) {
6337
6445
  return l.type === "pixel" && !!l.generator || l.type === "smart" && !!l.smartFilters?.filters.some((f) => f.kind === "effect") || l.type === "group" && l.children.some(has);
6338
6446
  });
6339
- const legacyProcess = (0, import_image_editor22.normalizeProcessVersion)(state.adjustments.process) < import_image_editor22.LATEST_PROCESS_VERSION;
6340
- const [activeTab, setActiveTab] = (0, import_react33.useState)("crop");
6341
- const rootRef = (0, import_react33.useRef)(null);
6447
+ const legacyProcess = (0, import_image_editor23.normalizeProcessVersion)(state.adjustments.process) < import_image_editor23.LATEST_PROCESS_VERSION;
6448
+ const [activeTab, setActiveTab] = (0, import_react34.useState)("crop");
6449
+ const rootRef = (0, import_react34.useRef)(null);
6342
6450
  const canvasMode = activeTab === "crop" || activeTab === "select" || activeTab === "paint" || activeTab === "annotate" ? activeTab : "none";
6343
- const activeTabRef = (0, import_react33.useRef)(activeTab);
6451
+ const activeTabRef = (0, import_react34.useRef)(activeTab);
6344
6452
  activeTabRef.current = activeTab;
6345
6453
  const openPanel = async (ref) => {
6346
6454
  if (ref.kind !== "panel" || activeTabRef.current === ref.id) return;
6347
6455
  rootRef.current?.querySelector(`[data-image-tab="${CSS.escape(ref.id)}"]`)?.click();
6348
6456
  await new Promise((resolve) => setTimeout(resolve, 60));
6349
6457
  };
6350
- const [activeCropRatio, setActiveCropRatio] = (0, import_react33.useState)(null);
6351
- const [selectionOptions, setSelectionOptions] = (0, import_react33.useState)(import_image_editor22.DEFAULT_SELECTION_TOOL_OPTIONS);
6352
- const [shapeOptions, setShapeOptions] = (0, import_react33.useState)(import_image_editor22.DEFAULT_SHAPE_TOOL_OPTIONS);
6353
- const [typeOptions, setTypeOptions] = (0, import_react33.useState)(import_image_editor22.DEFAULT_TYPE_TOOL_OPTIONS);
6354
- const [typeSession, setTypeSession] = (0, import_react33.useState)(null);
6355
- const [selectionError, setSelectionError] = (0, import_react33.useState)(null);
6356
- const [paintError, setPaintError] = (0, import_react33.useState)(null);
6357
- const [shapeTypeError, setShapeTypeError] = (0, import_react33.useState)(null);
6458
+ const [activeCropRatio, setActiveCropRatio] = (0, import_react34.useState)(null);
6459
+ const [selectionOptions, setSelectionOptions] = (0, import_react34.useState)(import_image_editor23.DEFAULT_SELECTION_TOOL_OPTIONS);
6460
+ const [shapeOptions, setShapeOptions] = (0, import_react34.useState)(import_image_editor23.DEFAULT_SHAPE_TOOL_OPTIONS);
6461
+ const [typeOptions, setTypeOptions] = (0, import_react34.useState)(import_image_editor23.DEFAULT_TYPE_TOOL_OPTIONS);
6462
+ const [typeSession, setTypeSession] = (0, import_react34.useState)(null);
6463
+ const [selectionError, setSelectionError] = (0, import_react34.useState)(null);
6464
+ const [paintError, setPaintError] = (0, import_react34.useState)(null);
6465
+ const [shapeTypeError, setShapeTypeError] = (0, import_react34.useState)(null);
6358
6466
  const handleCanvasError = (source, message) => {
6359
6467
  if (source === "paint") setPaintError(message);
6360
6468
  else if (source === "select") setSelectionError(message);
6361
6469
  else setShapeTypeError(message);
6362
6470
  };
6363
6471
  const finishTyping = () => setTypeSession(null);
6364
- const transformToolRef = (0, import_react33.useRef)(null);
6365
- const transformControllerRef = (0, import_react33.useRef)(controller);
6472
+ const transformToolRef = (0, import_react34.useRef)(null);
6473
+ const transformControllerRef = (0, import_react34.useRef)(controller);
6366
6474
  if (!transformToolRef.current || transformControllerRef.current !== controller) {
6367
6475
  transformToolRef.current?.cancel();
6368
- transformToolRef.current = new import_image_editor22.FreeTransformTool(controller, {
6476
+ transformToolRef.current = new import_image_editor23.FreeTransformTool(controller, {
6369
6477
  schedule: (run) => typeof requestAnimationFrame !== "undefined" ? requestAnimationFrame(run) : run()
6370
6478
  });
6371
6479
  transformControllerRef.current = controller;
6372
6480
  }
6373
6481
  const transformTool = transformToolRef.current;
6374
- const [, setTransformTick] = (0, import_react33.useState)(0);
6375
- (0, import_react33.useEffect)(() => transformTool.subscribe(() => setTransformTick((n) => n + 1)), [transformTool]);
6376
- (0, import_react33.useEffect)(() => () => transformToolRef.current?.cancel(), []);
6377
- const [inpaintPrompt, setInpaintPrompt] = (0, import_react33.useState)("");
6378
- const [inpaintMaskMode, setInpaintMaskMode] = (0, import_react33.useState)("annotations");
6379
- const [isRemovingBg, setIsRemovingBg] = (0, import_react33.useState)(false);
6380
- const [isInpainting, setIsInpainting] = (0, import_react33.useState)(false);
6381
- const [aiError, setAiError] = (0, import_react33.useState)(null);
6382
- const [aiSuccess, setAiSuccess] = (0, import_react33.useState)(null);
6383
- const [aiTarget, setAiTarget] = (0, import_react33.useState)("auto");
6482
+ const [, setTransformTick] = (0, import_react34.useState)(0);
6483
+ (0, import_react34.useEffect)(() => transformTool.subscribe(() => setTransformTick((n) => n + 1)), [transformTool]);
6484
+ (0, import_react34.useEffect)(() => () => transformToolRef.current?.cancel(), []);
6485
+ const [inpaintPrompt, setInpaintPrompt] = (0, import_react34.useState)("");
6486
+ const [inpaintMaskMode, setInpaintMaskMode] = (0, import_react34.useState)("annotations");
6487
+ const [isRemovingBg, setIsRemovingBg] = (0, import_react34.useState)(false);
6488
+ const [isInpainting, setIsInpainting] = (0, import_react34.useState)(false);
6489
+ const [aiError, setAiError] = (0, import_react34.useState)(null);
6490
+ const [aiSuccess, setAiSuccess] = (0, import_react34.useState)(null);
6491
+ const [aiTarget, setAiTarget] = (0, import_react34.useState)("auto");
6384
6492
  const aiOptions = aiTarget === "auto" ? {} : { target: aiTarget };
6385
6493
  const effectiveOnInpaint = onInpaint || aiHooks?.onInpaint;
6386
6494
  const effectiveOnRemoveBg = onRemoveBackground || aiHooks?.onRemoveBackground;
@@ -6443,11 +6551,11 @@ var ImageEditor = ({
6443
6551
  setIsInpainting(false);
6444
6552
  }
6445
6553
  };
6446
- const [activeColor, setActiveColor] = (0, import_react33.useState)("#ef4444");
6447
- const [strokeWidth, setStrokeWidth] = (0, import_react33.useState)(3);
6448
- const [fontSize, setFontSize] = (0, import_react33.useState)(24);
6449
- const [textInput, setTextInput] = (0, import_react33.useState)("");
6450
- (0, import_react33.useEffect)(() => {
6554
+ const [activeColor, setActiveColor] = (0, import_react34.useState)("#ef4444");
6555
+ const [strokeWidth, setStrokeWidth] = (0, import_react34.useState)(3);
6556
+ const [fontSize, setFontSize] = (0, import_react34.useState)(24);
6557
+ const [textInput, setTextInput] = (0, import_react34.useState)("");
6558
+ (0, import_react34.useEffect)(() => {
6451
6559
  if (activeTab === "crop" && editor.state.activeTool !== "crop") {
6452
6560
  editor.setTool("crop");
6453
6561
  }
@@ -6475,16 +6583,16 @@ var ImageEditor = ({
6475
6583
  link.click();
6476
6584
  }
6477
6585
  };
6478
- return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
6586
+ return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
6479
6587
  "div",
6480
6588
  {
6481
6589
  ref: rootRef,
6482
6590
  className: `${imageEditorFrameClass} ${className}`,
6483
6591
  style,
6484
6592
  children: [
6485
- /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: imageEditorHeaderClass, children: [
6486
- /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { role: "tablist", className: imageTabListClass, children: [
6487
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
6593
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: imageEditorHeaderClass, children: [
6594
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { role: "tablist", className: imageTabListClass, children: [
6595
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
6488
6596
  "button",
6489
6597
  {
6490
6598
  type: "button",
@@ -6499,7 +6607,7 @@ var ImageEditor = ({
6499
6607
  children: "Transform & Crop"
6500
6608
  }
6501
6609
  ),
6502
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
6610
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
6503
6611
  "button",
6504
6612
  {
6505
6613
  type: "button",
@@ -6514,7 +6622,7 @@ var ImageEditor = ({
6514
6622
  children: "Adjustments"
6515
6623
  }
6516
6624
  ),
6517
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
6625
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
6518
6626
  "button",
6519
6627
  {
6520
6628
  type: "button",
@@ -6529,7 +6637,7 @@ var ImageEditor = ({
6529
6637
  children: "Layers"
6530
6638
  }
6531
6639
  ),
6532
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
6640
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
6533
6641
  "button",
6534
6642
  {
6535
6643
  type: "button",
@@ -6544,7 +6652,7 @@ var ImageEditor = ({
6544
6652
  children: "Paint"
6545
6653
  }
6546
6654
  ),
6547
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
6655
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
6548
6656
  "button",
6549
6657
  {
6550
6658
  type: "button",
@@ -6559,7 +6667,7 @@ var ImageEditor = ({
6559
6667
  children: "Select & Mask"
6560
6668
  }
6561
6669
  ),
6562
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
6670
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
6563
6671
  "button",
6564
6672
  {
6565
6673
  type: "button",
@@ -6574,7 +6682,7 @@ var ImageEditor = ({
6574
6682
  children: "Annotations"
6575
6683
  }
6576
6684
  ),
6577
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
6685
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
6578
6686
  "button",
6579
6687
  {
6580
6688
  type: "button",
@@ -6589,7 +6697,7 @@ var ImageEditor = ({
6589
6697
  children: "Depth Mask"
6590
6698
  }
6591
6699
  ),
6592
- /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
6700
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
6593
6701
  "button",
6594
6702
  {
6595
6703
  type: "button",
@@ -6602,14 +6710,14 @@ var ImageEditor = ({
6602
6710
  "aria-selected": activeTab === "ai",
6603
6711
  className: `${imageTabClass(activeTab === "ai")} flex items-center gap-1.5`,
6604
6712
  children: [
6605
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("svg", { className: "w-3.5 h-3.5", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("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" }) }),
6713
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("svg", { className: "w-3.5 h-3.5", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("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" }) }),
6606
6714
  "AI Tools"
6607
6715
  ]
6608
6716
  }
6609
6717
  )
6610
6718
  ] }),
6611
- /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "flex items-center gap-2 text-xs", children: [
6612
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
6719
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "flex items-center gap-2 text-xs", children: [
6720
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
6613
6721
  "button",
6614
6722
  {
6615
6723
  type: "button",
@@ -6620,7 +6728,7 @@ var ImageEditor = ({
6620
6728
  children: "\u21A9"
6621
6729
  }
6622
6730
  ),
6623
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
6731
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
6624
6732
  "button",
6625
6733
  {
6626
6734
  type: "button",
@@ -6631,7 +6739,7 @@ var ImageEditor = ({
6631
6739
  children: "\u21AA"
6632
6740
  }
6633
6741
  ),
6634
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
6742
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
6635
6743
  "button",
6636
6744
  {
6637
6745
  type: "button",
@@ -6640,8 +6748,8 @@ var ImageEditor = ({
6640
6748
  children: "Reset"
6641
6749
  }
6642
6750
  ),
6643
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "h-4 w-px bg-muted mx-1" }),
6644
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
6751
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: "h-4 w-px bg-muted mx-1" }),
6752
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
6645
6753
  "button",
6646
6754
  {
6647
6755
  type: "button",
@@ -6651,11 +6759,11 @@ var ImageEditor = ({
6651
6759
  children: "-"
6652
6760
  }
6653
6761
  ),
6654
- /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("span", { className: "font-mono text-muted-foreground w-10 text-center", children: [
6762
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("span", { className: "font-mono text-muted-foreground w-10 text-center", children: [
6655
6763
  Math.round(state.zoom * 100),
6656
6764
  "%"
6657
6765
  ] }),
6658
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
6766
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
6659
6767
  "button",
6660
6768
  {
6661
6769
  type: "button",
@@ -6665,8 +6773,8 @@ var ImageEditor = ({
6665
6773
  children: "+"
6666
6774
  }
6667
6775
  ),
6668
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "h-4 w-px bg-muted mx-1" }),
6669
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
6776
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: "h-4 w-px bg-muted mx-1" }),
6777
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
6670
6778
  "button",
6671
6779
  {
6672
6780
  type: "button",
@@ -6677,7 +6785,7 @@ var ImageEditor = ({
6677
6785
  children: "Hold Compare"
6678
6786
  }
6679
6787
  ),
6680
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
6788
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
6681
6789
  "button",
6682
6790
  {
6683
6791
  type: "button",
@@ -6688,10 +6796,10 @@ var ImageEditor = ({
6688
6796
  )
6689
6797
  ] })
6690
6798
  ] }),
6691
- transformTool.active && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(FreeTransformOptionsBar, { tool: transformTool, className: "border-b border-border bg-background/95 px-4 py-2" }),
6692
- !transformTool.active && transformTool.error && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { role: "alert", className: imageErrorBannerClass, children: transformTool.error }),
6693
- /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "flex flex-col md:flex-row flex-1 min-h-[520px] md:h-[560px]", children: [
6694
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
6799
+ transformTool.active && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(FreeTransformOptionsBar, { tool: transformTool, className: "border-b border-border bg-background/95 px-4 py-2" }),
6800
+ !transformTool.active && transformTool.error && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { role: "alert", className: imageErrorBannerClass, children: transformTool.error }),
6801
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "flex flex-col md:flex-row flex-1 min-h-[520px] md:h-[560px]", children: [
6802
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
6695
6803
  ImageEditorCanvas,
6696
6804
  {
6697
6805
  editor,
@@ -6715,11 +6823,11 @@ var ImageEditor = ({
6715
6823
  className: "flex-1 h-[360px] md:h-full min-h-[320px] bg-muted"
6716
6824
  }
6717
6825
  ),
6718
- /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: imageSidebarClass, children: [
6719
- activeTab === "crop" && /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "flex flex-col gap-4 text-xs", children: [
6720
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: imageSectionTitleClass, children: "Aspect Ratio Presets" }),
6721
- /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "grid grid-cols-3 gap-2", children: [
6722
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
6826
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: imageSidebarClass, children: [
6827
+ activeTab === "crop" && /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "flex flex-col gap-4 text-xs", children: [
6828
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: imageSectionTitleClass, children: "Aspect Ratio Presets" }),
6829
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "grid grid-cols-3 gap-2", children: [
6830
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
6723
6831
  "button",
6724
6832
  {
6725
6833
  type: "button",
@@ -6731,7 +6839,7 @@ var ImageEditor = ({
6731
6839
  children: "Freeform"
6732
6840
  }
6733
6841
  ),
6734
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
6842
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
6735
6843
  "button",
6736
6844
  {
6737
6845
  type: "button",
@@ -6743,7 +6851,7 @@ var ImageEditor = ({
6743
6851
  children: "1:1 Square"
6744
6852
  }
6745
6853
  ),
6746
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
6854
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
6747
6855
  "button",
6748
6856
  {
6749
6857
  type: "button",
@@ -6755,7 +6863,7 @@ var ImageEditor = ({
6755
6863
  children: "4:3 Standard"
6756
6864
  }
6757
6865
  ),
6758
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
6866
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
6759
6867
  "button",
6760
6868
  {
6761
6869
  type: "button",
@@ -6767,7 +6875,7 @@ var ImageEditor = ({
6767
6875
  children: "16:9 Wide"
6768
6876
  }
6769
6877
  ),
6770
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
6878
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
6771
6879
  "button",
6772
6880
  {
6773
6881
  type: "button",
@@ -6779,7 +6887,7 @@ var ImageEditor = ({
6779
6887
  children: "3:2 Photo"
6780
6888
  }
6781
6889
  ),
6782
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
6890
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
6783
6891
  "button",
6784
6892
  {
6785
6893
  type: "button",
@@ -6792,10 +6900,10 @@ var ImageEditor = ({
6792
6900
  }
6793
6901
  )
6794
6902
  ] }),
6795
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: imageDividerClass }),
6796
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: imageSectionTitleClass, children: "Orientation & Flips" }),
6797
- /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "grid grid-cols-2 gap-2", children: [
6798
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
6903
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: imageDividerClass }),
6904
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: imageSectionTitleClass, children: "Orientation & Flips" }),
6905
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "grid grid-cols-2 gap-2", children: [
6906
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
6799
6907
  "button",
6800
6908
  {
6801
6909
  type: "button",
@@ -6804,7 +6912,7 @@ var ImageEditor = ({
6804
6912
  children: "Rotate -90\xB0"
6805
6913
  }
6806
6914
  ),
6807
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
6915
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
6808
6916
  "button",
6809
6917
  {
6810
6918
  type: "button",
@@ -6813,7 +6921,7 @@ var ImageEditor = ({
6813
6921
  children: "Rotate +90\xB0"
6814
6922
  }
6815
6923
  ),
6816
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
6924
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
6817
6925
  "button",
6818
6926
  {
6819
6927
  type: "button",
@@ -6822,7 +6930,7 @@ var ImageEditor = ({
6822
6930
  children: "Flip Horizontal"
6823
6931
  }
6824
6932
  ),
6825
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
6933
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
6826
6934
  "button",
6827
6935
  {
6828
6936
  type: "button",
@@ -6833,10 +6941,10 @@ var ImageEditor = ({
6833
6941
  )
6834
6942
  ] })
6835
6943
  ] }),
6836
- activeTab === "adjust" && /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "flex flex-col gap-3 text-xs", children: [
6837
- /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "flex items-center justify-between", children: [
6838
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: imageSectionTitleClass, children: "Color Adjustments" }),
6839
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
6944
+ activeTab === "adjust" && /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "flex flex-col gap-3 text-xs", children: [
6945
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "flex items-center justify-between", children: [
6946
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: imageSectionTitleClass, children: "Color Adjustments" }),
6947
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
6840
6948
  "button",
6841
6949
  {
6842
6950
  type: "button",
@@ -6846,25 +6954,25 @@ var ImageEditor = ({
6846
6954
  }
6847
6955
  )
6848
6956
  ] }),
6849
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Histogram, { histogram: editor.histogram }),
6850
- import_image_editor22.IMAGE_ADJUSTMENT_CONTROLS.map((spec) => /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(import_react33.default.Fragment, { children: [
6851
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
6957
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Histogram, { histogram: editor.histogram }),
6958
+ import_image_editor23.IMAGE_ADJUSTMENT_CONTROLS.map((spec) => /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(import_react34.default.Fragment, { children: [
6959
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
6852
6960
  ControlSlider,
6853
6961
  {
6854
6962
  spec,
6855
- value: (0, import_image_editor22.readAdjustmentControls)(state.adjustments)[spec.id],
6963
+ value: (0, import_image_editor23.readAdjustmentControls)(state.adjustments)[spec.id],
6856
6964
  disabled: spec.requiresProcess !== void 0 && legacyProcess,
6857
6965
  onChange: (v) => editor.setAdjustments({ [spec.id]: v })
6858
6966
  }
6859
6967
  ),
6860
- spec.id === "tint" && legacyProcess && /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
6968
+ spec.id === "tint" && legacyProcess && /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
6861
6969
  "div",
6862
6970
  {
6863
6971
  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",
6864
6972
  "data-testid": "image-editor-process-notice",
6865
6973
  children: [
6866
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { children: "Legacy rendering (process 1). Tint needs the current process." }),
6867
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
6974
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { children: "Legacy rendering (process 1). Tint needs the current process." }),
6975
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
6868
6976
  "button",
6869
6977
  {
6870
6978
  type: "button",
@@ -6877,7 +6985,7 @@ var ImageEditor = ({
6877
6985
  }
6878
6986
  )
6879
6987
  ] }, spec.id)),
6880
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: imageSectionClass, children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
6988
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: imageSectionClass, children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
6881
6989
  AdjustmentLayersPanel,
6882
6990
  {
6883
6991
  controller,
@@ -6886,9 +6994,9 @@ var ImageEditor = ({
6886
6994
  }
6887
6995
  ) })
6888
6996
  ] }),
6889
- activeTab === "layers" && /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "flex flex-col gap-3 text-xs", children: [
6890
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: imageSectionTitleClass, children: "Layers" }),
6891
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
6997
+ activeTab === "layers" && /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "flex flex-col gap-3 text-xs", children: [
6998
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: imageSectionTitleClass, children: "Layers" }),
6999
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
6892
7000
  "button",
6893
7001
  {
6894
7002
  type: "button",
@@ -6899,15 +7007,15 @@ var ImageEditor = ({
6899
7007
  children: "Free Transform"
6900
7008
  }
6901
7009
  ),
6902
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(LayersPanel, { controller }),
6903
- effectsShown && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(ImageProviderEffectsPanel, { controller, className: imageSectionClass }),
6904
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: imageSectionTitleClass, children: "Colour" }),
6905
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(ColorProfilePanel, { controller })
7010
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(LayersPanel, { controller }),
7011
+ effectsShown && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(ImageProviderEffectsPanel, { controller, className: imageSectionClass }),
7012
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: imageSectionTitleClass, children: "Colour" }),
7013
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(ColorProfilePanel, { controller })
6906
7014
  ] }),
6907
- activeTab === "paint" && /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "flex flex-col gap-3 text-xs", children: [
6908
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: imageSectionTitleClass, children: "Paint" }),
6909
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(BrushOptionsBar, { controller }),
6910
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
7015
+ activeTab === "paint" && /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "flex flex-col gap-3 text-xs", children: [
7016
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: imageSectionTitleClass, children: "Paint" }),
7017
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(BrushOptionsBar, { controller }),
7018
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
6911
7019
  "button",
6912
7020
  {
6913
7021
  type: "button",
@@ -6918,12 +7026,12 @@ var ImageEditor = ({
6918
7026
  children: "Free Transform"
6919
7027
  }
6920
7028
  ),
6921
- paintError && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("p", { role: "alert", className: "text-destructive", "data-testid": "paint-error", children: paintError }),
6922
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: imageSectionClass, children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(LayersPanel, { controller }) })
7029
+ paintError && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("p", { role: "alert", className: "text-destructive", "data-testid": "paint-error", children: paintError }),
7030
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: imageSectionClass, children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(LayersPanel, { controller }) })
6923
7031
  ] }),
6924
- activeTab === "annotate" && /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "flex flex-col gap-3 text-xs", children: [
6925
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: imageSectionTitleClass, children: "Shape & Type Layers" }),
6926
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "grid grid-cols-2 gap-1.5", children: ["shape", "type"].map((t) => /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
7032
+ activeTab === "annotate" && /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "flex flex-col gap-3 text-xs", children: [
7033
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: imageSectionTitleClass, children: "Shape & Type Layers" }),
7034
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: "grid grid-cols-2 gap-1.5", children: ["shape", "type"].map((t) => /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
6927
7035
  "button",
6928
7036
  {
6929
7037
  type: "button",
@@ -6934,13 +7042,13 @@ var ImageEditor = ({
6934
7042
  },
6935
7043
  t
6936
7044
  )) }),
6937
- state.activeTool === "shape" && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(ShapeOptionsBar, { controller, options: shapeOptions, onChange: setShapeOptions }),
6938
- state.activeTool === "type" && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(TypeOptionsBar, { controller, options: typeOptions, onChange: setTypeOptions, session: typeSession }),
6939
- state.activeTool === "type" && typeSession && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("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" }),
6940
- shapeTypeError && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("p", { role: "alert", className: "text-destructive", "data-testid": "shape-type-error", children: shapeTypeError }),
6941
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: imageDividerClass }),
6942
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: imageSectionTitleClass, children: "Draw & Annotate" }),
6943
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "grid grid-cols-3 gap-1.5", children: ["pen", "rect", "circle", "arrow", "line"].map((t) => /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
7045
+ state.activeTool === "shape" && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(ShapeOptionsBar, { controller, options: shapeOptions, onChange: setShapeOptions }),
7046
+ state.activeTool === "type" && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(TypeOptionsBar, { controller, options: typeOptions, onChange: setTypeOptions, session: typeSession }),
7047
+ state.activeTool === "type" && typeSession && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("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" }),
7048
+ shapeTypeError && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("p", { role: "alert", className: "text-destructive", "data-testid": "shape-type-error", children: shapeTypeError }),
7049
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: imageDividerClass }),
7050
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: imageSectionTitleClass, children: "Draw & Annotate" }),
7051
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: "grid grid-cols-3 gap-1.5", children: ["pen", "rect", "circle", "arrow", "line"].map((t) => /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
6944
7052
  "button",
6945
7053
  {
6946
7054
  type: "button",
@@ -6950,18 +7058,18 @@ var ImageEditor = ({
6950
7058
  },
6951
7059
  t
6952
7060
  )) }),
6953
- /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "flex items-center gap-2 mt-2", children: [
6954
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("label", { className: "text-muted-foreground", children: "Color:" }),
6955
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(ImageColor, { label: "Annotation colour", value: activeColor, onChange: setActiveColor }),
6956
- /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "flex-1 ml-2", children: [
6957
- /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "flex justify-between text-muted-foreground mb-0.5", children: [
6958
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { children: "Width:" }),
6959
- /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("span", { className: "font-mono", children: [
7061
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "flex items-center gap-2 mt-2", children: [
7062
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("label", { className: "text-muted-foreground", children: "Color:" }),
7063
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(ImageColor, { label: "Annotation colour", value: activeColor, onChange: setActiveColor }),
7064
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "flex-1 ml-2", children: [
7065
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "flex justify-between text-muted-foreground mb-0.5", children: [
7066
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { children: "Width:" }),
7067
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("span", { className: "font-mono", children: [
6960
7068
  strokeWidth,
6961
7069
  "px"
6962
7070
  ] })
6963
7071
  ] }),
6964
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
7072
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
6965
7073
  "input",
6966
7074
  {
6967
7075
  type: "range",
@@ -6974,10 +7082,10 @@ var ImageEditor = ({
6974
7082
  )
6975
7083
  ] })
6976
7084
  ] }),
6977
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: imageDividerClass }),
6978
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: imageSectionTitleClass, children: "Add Text" }),
6979
- /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "flex gap-2", children: [
6980
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
7085
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: imageDividerClass }),
7086
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: imageSectionTitleClass, children: "Add Text" }),
7087
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "flex gap-2", children: [
7088
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
6981
7089
  "input",
6982
7090
  {
6983
7091
  type: "text",
@@ -6988,7 +7096,7 @@ var ImageEditor = ({
6988
7096
  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"
6989
7097
  }
6990
7098
  ),
6991
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
7099
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
6992
7100
  "button",
6993
7101
  {
6994
7102
  type: "button",
@@ -6998,14 +7106,14 @@ var ImageEditor = ({
6998
7106
  }
6999
7107
  )
7000
7108
  ] }),
7001
- /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "flex items-center justify-between text-muted-foreground", children: [
7002
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { children: "Font Size:" }),
7003
- /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("span", { className: "font-mono", children: [
7109
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "flex items-center justify-between text-muted-foreground", children: [
7110
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { children: "Font Size:" }),
7111
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("span", { className: "font-mono", children: [
7004
7112
  fontSize,
7005
7113
  "px"
7006
7114
  ] })
7007
7115
  ] }),
7008
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
7116
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
7009
7117
  "input",
7010
7118
  {
7011
7119
  type: "range",
@@ -7016,14 +7124,14 @@ var ImageEditor = ({
7016
7124
  className: imageRangeClass
7017
7125
  }
7018
7126
  ),
7019
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: imageDividerClass }),
7020
- /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "flex items-center justify-between", children: [
7021
- /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("span", { className: "text-muted-foreground", children: [
7127
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: imageDividerClass }),
7128
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "flex items-center justify-between", children: [
7129
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("span", { className: "text-muted-foreground", children: [
7022
7130
  "Layers (",
7023
7131
  state.annotations.length,
7024
7132
  ")"
7025
7133
  ] }),
7026
- state.selectedAnnotationId && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
7134
+ state.selectedAnnotationId && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
7027
7135
  "button",
7028
7136
  {
7029
7137
  type: "button",
@@ -7032,7 +7140,7 @@ var ImageEditor = ({
7032
7140
  children: "Delete Selected"
7033
7141
  }
7034
7142
  ),
7035
- state.annotations.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
7143
+ state.annotations.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
7036
7144
  "button",
7037
7145
  {
7038
7146
  type: "button",
@@ -7043,10 +7151,10 @@ var ImageEditor = ({
7043
7151
  )
7044
7152
  ] })
7045
7153
  ] }),
7046
- activeTab === "depth" && /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "flex flex-col gap-3 text-xs", children: [
7047
- /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "flex items-center justify-between", children: [
7048
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: imageSectionTitleClass, children: "Depth Masking" }),
7049
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
7154
+ activeTab === "depth" && /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "flex flex-col gap-3 text-xs", children: [
7155
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "flex items-center justify-between", children: [
7156
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: imageSectionTitleClass, children: "Depth Masking" }),
7157
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
7050
7158
  "button",
7051
7159
  {
7052
7160
  type: "button",
@@ -7056,8 +7164,8 @@ var ImageEditor = ({
7056
7164
  }
7057
7165
  )
7058
7166
  ] }),
7059
- /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("label", { className: "flex items-center gap-2 cursor-pointer text-foreground", children: [
7060
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
7167
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("label", { className: "flex items-center gap-2 cursor-pointer text-foreground", children: [
7168
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
7061
7169
  "input",
7062
7170
  {
7063
7171
  type: "checkbox",
@@ -7066,12 +7174,12 @@ var ImageEditor = ({
7066
7174
  className: "rounded accent-primary"
7067
7175
  }
7068
7176
  ),
7069
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { children: "Enable Depth / Alpha Mask" })
7177
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { children: "Enable Depth / Alpha Mask" })
7070
7178
  ] }),
7071
- state.depthMask.enabled && /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(import_jsx_runtime33.Fragment, { children: [
7072
- /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { children: [
7073
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("label", { className: "text-muted-foreground block mb-1", children: "Mask Image URL:" }),
7074
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
7179
+ state.depthMask.enabled && /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(import_jsx_runtime34.Fragment, { children: [
7180
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { children: [
7181
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("label", { className: "text-muted-foreground block mb-1", children: "Mask Image URL:" }),
7182
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
7075
7183
  "input",
7076
7184
  {
7077
7185
  type: "text",
@@ -7082,8 +7190,8 @@ var ImageEditor = ({
7082
7190
  }
7083
7191
  )
7084
7192
  ] }),
7085
- /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "flex gap-2", children: [
7086
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
7193
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "flex gap-2", children: [
7194
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
7087
7195
  "button",
7088
7196
  {
7089
7197
  type: "button",
@@ -7092,7 +7200,7 @@ var ImageEditor = ({
7092
7200
  children: "Threshold Mode"
7093
7201
  }
7094
7202
  ),
7095
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
7203
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
7096
7204
  "button",
7097
7205
  {
7098
7206
  type: "button",
@@ -7102,12 +7210,12 @@ var ImageEditor = ({
7102
7210
  }
7103
7211
  )
7104
7212
  ] }),
7105
- /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { children: [
7106
- /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "flex justify-between text-muted-foreground mb-1", children: [
7107
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { children: "Depth Start (Lower):" }),
7108
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "font-mono", children: state.depthMask.depthRange[0] })
7213
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { children: [
7214
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "flex justify-between text-muted-foreground mb-1", children: [
7215
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { children: "Depth Start (Lower):" }),
7216
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "font-mono", children: state.depthMask.depthRange[0] })
7109
7217
  ] }),
7110
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
7218
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
7111
7219
  "input",
7112
7220
  {
7113
7221
  type: "range",
@@ -7121,12 +7229,12 @@ var ImageEditor = ({
7121
7229
  }
7122
7230
  )
7123
7231
  ] }),
7124
- /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { children: [
7125
- /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "flex justify-between text-muted-foreground mb-1", children: [
7126
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { children: "Depth Stop (Upper):" }),
7127
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "font-mono", children: state.depthMask.depthRange[1] })
7232
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { children: [
7233
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "flex justify-between text-muted-foreground mb-1", children: [
7234
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { children: "Depth Stop (Upper):" }),
7235
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "font-mono", children: state.depthMask.depthRange[1] })
7128
7236
  ] }),
7129
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
7237
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
7130
7238
  "input",
7131
7239
  {
7132
7240
  type: "range",
@@ -7140,12 +7248,12 @@ var ImageEditor = ({
7140
7248
  }
7141
7249
  )
7142
7250
  ] }),
7143
- /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { children: [
7144
- /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "flex justify-between text-muted-foreground mb-1", children: [
7145
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { children: "Softness:" }),
7146
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "font-mono", children: state.depthMask.softness })
7251
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { children: [
7252
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "flex justify-between text-muted-foreground mb-1", children: [
7253
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { children: "Softness:" }),
7254
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "font-mono", children: state.depthMask.softness })
7147
7255
  ] }),
7148
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
7256
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
7149
7257
  "input",
7150
7258
  {
7151
7259
  type: "range",
@@ -7157,8 +7265,8 @@ var ImageEditor = ({
7157
7265
  }
7158
7266
  )
7159
7267
  ] }),
7160
- /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("label", { className: "flex items-center gap-2 cursor-pointer text-foreground mt-1", children: [
7161
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
7268
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("label", { className: "flex items-center gap-2 cursor-pointer text-foreground mt-1", children: [
7269
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
7162
7270
  "input",
7163
7271
  {
7164
7272
  type: "checkbox",
@@ -7167,12 +7275,12 @@ var ImageEditor = ({
7167
7275
  className: "rounded accent-primary"
7168
7276
  }
7169
7277
  ),
7170
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { children: "Invert Mask" })
7278
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { children: "Invert Mask" })
7171
7279
  ] })
7172
7280
  ] })
7173
7281
  ] }),
7174
- activeTab === "select" && /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "flex flex-col gap-4 text-xs", children: [
7175
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
7282
+ activeTab === "select" && /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "flex flex-col gap-4 text-xs", children: [
7283
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
7176
7284
  SelectionOptionsBar,
7177
7285
  {
7178
7286
  controller,
@@ -7183,9 +7291,9 @@ var ImageEditor = ({
7183
7291
  selectionDisplay: state.selectionDisplay
7184
7292
  }
7185
7293
  ),
7186
- selectionError && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("p", { role: "alert", className: "text-destructive", children: selectionError }),
7187
- /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "flex gap-1", children: [
7188
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
7294
+ selectionError && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("p", { role: "alert", className: "text-destructive", children: selectionError }),
7295
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "flex gap-1", children: [
7296
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
7189
7297
  "button",
7190
7298
  {
7191
7299
  type: "button",
@@ -7196,7 +7304,7 @@ var ImageEditor = ({
7196
7304
  children: "Transform Selection"
7197
7305
  }
7198
7306
  ),
7199
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
7307
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
7200
7308
  "button",
7201
7309
  {
7202
7310
  type: "button",
@@ -7208,13 +7316,14 @@ var ImageEditor = ({
7208
7316
  }
7209
7317
  )
7210
7318
  ] }),
7211
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(RefineEdgePanel, { controller, selection: state.selection ?? null, layers: state.adjustments.layers }),
7212
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(ChannelsPanel, { controller })
7319
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(RefineEdgePanel, { controller, selection: state.selection ?? null, layers: state.adjustments.layers }),
7320
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(ChannelsPanel, { controller }),
7321
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(PathsPanel, { controller })
7213
7322
  ] }),
7214
- activeTab === "ai" && /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "flex flex-col gap-4 text-xs", children: [
7215
- /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("label", { className: "flex items-center justify-between gap-2 text-foreground", children: [
7216
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { children: "Results go to" }),
7217
- /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
7323
+ activeTab === "ai" && /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "flex flex-col gap-4 text-xs", children: [
7324
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("label", { className: "flex items-center justify-between gap-2 text-foreground", children: [
7325
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { children: "Results go to" }),
7326
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
7218
7327
  "select",
7219
7328
  {
7220
7329
  "aria-label": "AI result target",
@@ -7222,54 +7331,54 @@ var ImageEditor = ({
7222
7331
  onChange: (e) => setAiTarget(e.target.value),
7223
7332
  className: imageSelectClass,
7224
7333
  children: [
7225
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("option", { value: "auto", children: controller.isMultiLayer ? "Auto (new layer)" : "Auto (replace image)" }),
7226
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("option", { value: "new-layer", children: "New layer / mask" }),
7227
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("option", { value: "replace", children: "Replace image" })
7334
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("option", { value: "auto", children: controller.isMultiLayer ? "Auto (new layer)" : "Auto (replace image)" }),
7335
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("option", { value: "new-layer", children: "New layer / mask" }),
7336
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("option", { value: "replace", children: "Replace image" })
7228
7337
  ]
7229
7338
  }
7230
7339
  )
7231
7340
  ] }),
7232
- /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "p-3 rounded-lg bg-muted/40 border border-border flex flex-col gap-2.5", children: [
7233
- /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "flex items-center justify-between", children: [
7234
- /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("span", { className: "font-semibold text-foreground uppercase tracking-wider text-[11px] flex items-center gap-1.5", children: [
7235
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("svg", { className: "w-3.5 h-3.5 text-primary", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("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" }) }),
7341
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "p-3 rounded-lg bg-muted/40 border border-border flex flex-col gap-2.5", children: [
7342
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "flex items-center justify-between", children: [
7343
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("span", { className: "font-semibold text-foreground uppercase tracking-wider text-[11px] flex items-center gap-1.5", children: [
7344
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("svg", { className: "w-3.5 h-3.5 text-primary", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("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" }) }),
7236
7345
  "Background Removal"
7237
7346
  ] }),
7238
- isRemovingBg && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("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..." })
7347
+ isRemovingBg && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("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..." })
7239
7348
  ] }),
7240
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("p", { className: "text-muted-foreground text-[11px] leading-relaxed", children: "Isolate foreground subject with AI alpha transparency segmentation." }),
7241
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
7349
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("p", { className: "text-muted-foreground text-[11px] leading-relaxed", children: "Isolate foreground subject with AI alpha transparency segmentation." }),
7350
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
7242
7351
  "button",
7243
7352
  {
7244
7353
  type: "button",
7245
7354
  onClick: handleRemoveBackground,
7246
7355
  disabled: isRemovingBg || isInpainting,
7247
7356
  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",
7248
- children: isRemovingBg ? /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(import_jsx_runtime33.Fragment, { children: [
7249
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: imageSpinnerClass }),
7357
+ children: isRemovingBg ? /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(import_jsx_runtime34.Fragment, { children: [
7358
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: imageSpinnerClass }),
7250
7359
  "Removing Background..."
7251
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(import_jsx_runtime33.Fragment, { children: [
7252
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("svg", { className: "w-3.5 h-3.5", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("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" }) }),
7360
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(import_jsx_runtime34.Fragment, { children: [
7361
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("svg", { className: "w-3.5 h-3.5", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("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" }) }),
7253
7362
  "Remove Background"
7254
7363
  ] })
7255
7364
  }
7256
7365
  )
7257
7366
  ] }),
7258
- /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "p-3 rounded-lg bg-muted/40 border border-border flex flex-col gap-2.5", children: [
7259
- /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "flex items-center justify-between", children: [
7260
- /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("span", { className: "font-semibold text-foreground uppercase tracking-wider text-[11px] flex items-center gap-1.5", children: [
7261
- /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("svg", { className: "w-3.5 h-3.5 text-primary", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [
7262
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("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" }),
7263
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("path", { d: "m14 7 3 3" })
7367
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "p-3 rounded-lg bg-muted/40 border border-border flex flex-col gap-2.5", children: [
7368
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "flex items-center justify-between", children: [
7369
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("span", { className: "font-semibold text-foreground uppercase tracking-wider text-[11px] flex items-center gap-1.5", children: [
7370
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("svg", { className: "w-3.5 h-3.5 text-primary", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [
7371
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("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" }),
7372
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("path", { d: "m14 7 3 3" })
7264
7373
  ] }),
7265
7374
  "Generative Inpainting"
7266
7375
  ] }),
7267
- isInpainting && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("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..." })
7376
+ isInpainting && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("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..." })
7268
7377
  ] }),
7269
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("p", { className: "text-muted-foreground text-[11px] leading-relaxed", children: "Replace, modify, or fill selected regions using prompt-guided generative inpainting." }),
7270
- /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "flex flex-col gap-1", children: [
7271
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("label", { htmlFor: "ai-inpaint-prompt-react", className: "text-foreground text-[11px] font-medium", children: "Prompt" }),
7272
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
7378
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("p", { className: "text-muted-foreground text-[11px] leading-relaxed", children: "Replace, modify, or fill selected regions using prompt-guided generative inpainting." }),
7379
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "flex flex-col gap-1", children: [
7380
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("label", { htmlFor: "ai-inpaint-prompt-react", className: "text-foreground text-[11px] font-medium", children: "Prompt" }),
7381
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
7273
7382
  "textarea",
7274
7383
  {
7275
7384
  id: "ai-inpaint-prompt-react",
@@ -7281,10 +7390,10 @@ var ImageEditor = ({
7281
7390
  }
7282
7391
  )
7283
7392
  ] }),
7284
- /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "flex flex-col gap-1", children: [
7285
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "text-foreground text-[11px] font-medium", children: "Target Mask Region" }),
7286
- /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "grid grid-cols-2 gap-1.5", children: [
7287
- /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
7393
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "flex flex-col gap-1", children: [
7394
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "text-foreground text-[11px] font-medium", children: "Target Mask Region" }),
7395
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "grid grid-cols-2 gap-1.5", children: [
7396
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
7288
7397
  "button",
7289
7398
  {
7290
7399
  type: "button",
@@ -7297,7 +7406,7 @@ var ImageEditor = ({
7297
7406
  ]
7298
7407
  }
7299
7408
  ),
7300
- /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
7409
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
7301
7410
  "button",
7302
7411
  {
7303
7412
  type: "button",
@@ -7312,25 +7421,25 @@ var ImageEditor = ({
7312
7421
  )
7313
7422
  ] })
7314
7423
  ] }),
7315
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
7424
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
7316
7425
  "button",
7317
7426
  {
7318
7427
  type: "button",
7319
7428
  onClick: handleInpaint,
7320
7429
  disabled: isInpainting || isRemovingBg || !inpaintPrompt.trim(),
7321
7430
  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",
7322
- children: isInpainting ? /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(import_jsx_runtime33.Fragment, { children: [
7323
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: imageSpinnerClass }),
7431
+ children: isInpainting ? /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(import_jsx_runtime34.Fragment, { children: [
7432
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: imageSpinnerClass }),
7324
7433
  "Generating Inpaint..."
7325
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(import_jsx_runtime33.Fragment, { children: [
7326
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("svg", { className: "w-3.5 h-3.5", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("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" }) }),
7434
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(import_jsx_runtime34.Fragment, { children: [
7435
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("svg", { className: "w-3.5 h-3.5", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("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" }) }),
7327
7436
  "Apply Inpainting"
7328
7437
  ] })
7329
7438
  }
7330
7439
  )
7331
7440
  ] }),
7332
- aiError && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "p-2.5 rounded-lg bg-destructive/10 border border-destructive/40 text-destructive text-[11px]", children: aiError }),
7333
- aiSuccess && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "p-2.5 rounded-lg bg-emerald-500/10 border border-emerald-500/30 text-emerald-600 text-[11px]", children: aiSuccess })
7441
+ aiError && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: "p-2.5 rounded-lg bg-destructive/10 border border-destructive/40 text-destructive text-[11px]", children: aiError }),
7442
+ aiSuccess && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: "p-2.5 rounded-lg bg-emerald-500/10 border border-emerald-500/30 text-emerald-600 text-[11px]", children: aiSuccess })
7334
7443
  ] })
7335
7444
  ] })
7336
7445
  ] })
@@ -7361,6 +7470,7 @@ var ImageEditor = ({
7361
7470
  LayerEffectsPanel,
7362
7471
  LayersPanel,
7363
7472
  PaintGradientEditor,
7473
+ PathsPanel,
7364
7474
  RefineEdgePanel,
7365
7475
  SelectAndMaskWorkspace,
7366
7476
  SelectionOptionsBar,