@orangecatai/adgen-canvas 0.0.24 → 0.0.26

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.
Files changed (28) hide show
  1. package/dist/dev/{chunk-3IT4IPF5.js → chunk-HAGQZMXY.js} +3 -3
  2. package/dist/dev/{chunk-T44CUBOH.js → chunk-M6SLPQMN.js} +2 -2
  3. package/dist/dev/data/{image-CVNEYNEF.js → image-TSTRTL65.js} +3 -3
  4. package/dist/dev/index.css.map +2 -2
  5. package/dist/dev/index.js +981 -332
  6. package/dist/dev/index.js.map +4 -4
  7. package/dist/dev/subset-shared.chunk.js +1 -1
  8. package/dist/dev/subset-worker.chunk.js +1 -1
  9. package/dist/prod/{chunk-MFGXKFLH.js → chunk-FABLWJ5B.js} +1 -1
  10. package/dist/prod/{chunk-ZXE5XSJO.js → chunk-PIJUOUUJ.js} +2 -2
  11. package/dist/prod/data/image-D6B2C7FH.js +1 -0
  12. package/dist/prod/index.js +57 -56
  13. package/dist/prod/subset-shared.chunk.js +1 -1
  14. package/dist/prod/subset-worker.chunk.js +1 -1
  15. package/dist/types/common/src/keys.d.ts +2 -0
  16. package/dist/types/excalidraw/actions/actionGenerators.d.ts +34 -0
  17. package/dist/types/excalidraw/actions/shortcuts.d.ts +1 -1
  18. package/dist/types/excalidraw/actions/types.d.ts +1 -1
  19. package/dist/types/excalidraw/components/App.d.ts +1 -0
  20. package/dist/types/excalidraw/components/VideoElement.d.ts +1 -1
  21. package/dist/types/excalidraw/components/auto-resize/AutoResizePanel.d.ts +3 -1
  22. package/dist/types/excalidraw/components/auto-resize/autoResizeEngine.d.ts +9 -0
  23. package/dist/types/excalidraw/types.d.ts +27 -0
  24. package/package.json +1 -1
  25. package/dist/prod/data/image-7TLJ6VAY.js +0 -1
  26. /package/dist/dev/{chunk-3IT4IPF5.js.map → chunk-HAGQZMXY.js.map} +0 -0
  27. /package/dist/dev/{chunk-T44CUBOH.js.map → chunk-M6SLPQMN.js.map} +0 -0
  28. /package/dist/dev/data/{image-CVNEYNEF.js.map → image-TSTRTL65.js.map} +0 -0
package/dist/dev/index.js CHANGED
@@ -66,10 +66,10 @@ import {
66
66
  serializeAsJSON,
67
67
  serializeLibraryAsJSON,
68
68
  strokeRectWithRotation_simple
69
- } from "./chunk-3IT4IPF5.js";
69
+ } from "./chunk-HAGQZMXY.js";
70
70
  import {
71
71
  define_import_meta_env_default
72
- } from "./chunk-T44CUBOH.js";
72
+ } from "./chunk-M6SLPQMN.js";
73
73
  import {
74
74
  en_default
75
75
  } from "./chunk-LIELFD5T.js";
@@ -111,7 +111,7 @@ import {
111
111
  shouldMaintainAspectRatio,
112
112
  shouldRotateWithDiscreteAngle as shouldRotateWithDiscreteAngle3,
113
113
  isArrowKey as isArrowKey2,
114
- KEYS as KEYS55,
114
+ KEYS as KEYS56,
115
115
  APP_NAME as APP_NAME2,
116
116
  CURSOR_TYPE as CURSOR_TYPE4,
117
117
  DEFAULT_MAX_IMAGE_WIDTH_OR_HEIGHT,
@@ -318,7 +318,7 @@ import {
318
318
  isNonDeletedElement,
319
319
  Scene,
320
320
  Store,
321
- CaptureUpdateAction as CaptureUpdateAction39,
321
+ CaptureUpdateAction as CaptureUpdateAction40,
322
322
  hitElementBoundingBox as hitElementBoundingBox2,
323
323
  isLineElement as isLineElement8,
324
324
  isSimpleArrow,
@@ -8793,6 +8793,7 @@ import {
8793
8793
  } from "@orangecatai/common";
8794
8794
  import { getNonDeletedElements as getNonDeletedElements7 } from "@orangecatai/element";
8795
8795
  import { CaptureUpdateAction as CaptureUpdateAction9 } from "@orangecatai/element";
8796
+ import { viewportCoordsToSceneCoords as viewportCoordsToSceneCoords2 } from "@orangecatai/common";
8796
8797
 
8797
8798
  // components/CheckboxItem.tsx
8798
8799
  import clsx17 from "clsx";
@@ -9795,7 +9796,7 @@ var exportCanvas = async (type, elements, appState, files, {
9795
9796
  let blob = canvasToBlob(tempCanvas);
9796
9797
  if (appState.exportEmbedScene) {
9797
9798
  blob = blob.then(
9798
- (blob2) => import("./data/image-CVNEYNEF.js").then(
9799
+ (blob2) => import("./data/image-TSTRTL65.js").then(
9799
9800
  ({ encodePngMetadata: encodePngMetadata2 }) => encodePngMetadata2({
9800
9801
  blob: blob2,
9801
9802
  metadata: serializeAsJSON(elements, appState, files, "local")
@@ -9836,9 +9837,6 @@ ${t(
9836
9837
  }
9837
9838
  };
9838
9839
 
9839
- // actions/actionExport.tsx
9840
- import { viewportCoordsToSceneCoords as viewportCoordsToSceneCoords2 } from "@orangecatai/common";
9841
-
9842
9840
  // data/resave.ts
9843
9841
  var resaveAsImageWithScene = async (elements, appState, files, name) => {
9844
9842
  const { exportBackground, viewBackgroundColor, fileHandle } = appState;
@@ -10071,15 +10069,24 @@ var actionLoadScene = register({
10071
10069
  },
10072
10070
  perform: async (elements, appState, _, app) => {
10073
10071
  try {
10074
- const file2 = await fileOpen({ description: "Excalidraw or video files" });
10072
+ const file2 = await fileOpen({
10073
+ description: "Excalidraw or video files"
10074
+ });
10075
10075
  if (isSupportedVideoFile(file2)) {
10076
10076
  const clientX = appState.width / 2 + appState.offsetLeft;
10077
10077
  const clientY = appState.height / 2 + appState.offsetTop;
10078
- const { x, y } = viewportCoordsToSceneCoords2({ clientX, clientY }, appState);
10078
+ const { x, y } = viewportCoordsToSceneCoords2(
10079
+ { clientX, clientY },
10080
+ appState
10081
+ );
10079
10082
  await app.insertVideos([file2], x, y);
10080
10083
  return false;
10081
10084
  }
10082
- const { elements: loadedElements, appState: loadedAppState, files } = await loadFromBlob(file2, appState, elements, file2.handle ?? null);
10085
+ const {
10086
+ elements: loadedElements,
10087
+ appState: loadedAppState,
10088
+ files
10089
+ } = await loadFromBlob(file2, appState, elements, file2.handle ?? null);
10083
10090
  return {
10084
10091
  elements: loadedElements,
10085
10092
  appState: loadedAppState,
@@ -13372,6 +13379,8 @@ var shortcutMap = {
13372
13379
  toggleHandTool: [getShortcutKey("H")],
13373
13380
  setFrameAsActiveTool: [getShortcutKey("F")],
13374
13381
  cycleThroughFrameChildren: [getShortcutKey("CtrlOrCmd+J")],
13382
+ openImageGenerator: [getShortcutKey("G")],
13383
+ openVideoGenerator: [getShortcutKey("M")],
13375
13384
  saveFileToDisk: [getShortcutKey("CtrlOrCmd+S")],
13376
13385
  saveToActiveFile: [getShortcutKey("CtrlOrCmd+S")],
13377
13386
  toggleShortcuts: [getShortcutKey("?")],
@@ -17850,8 +17859,8 @@ var ShapesSwitcher = ({
17850
17859
  icon: imageGeneratorToolIcon,
17851
17860
  checked: false,
17852
17861
  name: "editor-current-shape",
17853
- title: `Image Generator \u2014 A`,
17854
- keyBindingLabel: "A",
17862
+ title: `Image Generator \u2014 G`,
17863
+ keyBindingLabel: "G",
17855
17864
  "aria-label": "Image Generator",
17856
17865
  "data-testid": "toolbar-image-generator",
17857
17866
  onChange: () => {
@@ -17868,8 +17877,8 @@ var ShapesSwitcher = ({
17868
17877
  icon: videoGeneratorToolIcon,
17869
17878
  checked: false,
17870
17879
  name: "editor-current-shape",
17871
- title: "Video Generator \u2014 V",
17872
- keyBindingLabel: "V",
17880
+ title: "Video Generator \u2014 M",
17881
+ keyBindingLabel: "M",
17873
17882
  "aria-label": "Video Generator",
17874
17883
  "data-testid": "toolbar-video-generator",
17875
17884
  onChange: () => {
@@ -20759,21 +20768,57 @@ var actionWrapSelectionInFrame = register({
20759
20768
  }
20760
20769
  });
20761
20770
 
20771
+ // actions/actionGenerators.ts
20772
+ import { KEYS as KEYS42 } from "@orangecatai/common";
20773
+ import { CaptureUpdateAction as CaptureUpdateAction33 } from "@orangecatai/element";
20774
+ var actionOpenImageGenerator = register({
20775
+ name: "openImageGenerator",
20776
+ label: "Image Generator",
20777
+ icon: imageGeneratorToolIcon,
20778
+ viewMode: false,
20779
+ trackEvent: { category: "toolbar" },
20780
+ perform: (elements, appState, _, app) => {
20781
+ app.onImageGeneratorSelect();
20782
+ return {
20783
+ elements: null,
20784
+ appState: null,
20785
+ captureUpdate: CaptureUpdateAction33.EVENTUALLY
20786
+ };
20787
+ },
20788
+ keyTest: (event) => !event[KEYS42.CTRL_OR_CMD] && !event.shiftKey && !event.altKey && event.key.toLocaleLowerCase() === KEYS42.G
20789
+ });
20790
+ var actionOpenVideoGenerator = register({
20791
+ name: "openVideoGenerator",
20792
+ label: "Video Generator",
20793
+ icon: videoGeneratorToolIcon,
20794
+ viewMode: false,
20795
+ trackEvent: { category: "toolbar" },
20796
+ perform: (elements, appState, _, app) => {
20797
+ app.onVideoGeneratorSelect();
20798
+ return {
20799
+ elements: null,
20800
+ appState: null,
20801
+ captureUpdate: CaptureUpdateAction33.EVENTUALLY
20802
+ };
20803
+ },
20804
+ keyTest: (event) => !event[KEYS42.CTRL_OR_CMD] && !event.shiftKey && !event.altKey && event.key.toLocaleLowerCase() === KEYS42.M
20805
+ });
20806
+
20762
20807
  // actions/actionHistory.tsx
20763
20808
  import {
20764
20809
  isWindows,
20765
- KEYS as KEYS42,
20810
+ KEYS as KEYS43,
20766
20811
  matchKey,
20767
20812
  arrayToMap as arrayToMap21,
20768
20813
  MOBILE_ACTION_BUTTON_BG as MOBILE_ACTION_BUTTON_BG4
20769
20814
  } from "@orangecatai/common";
20770
- import { CaptureUpdateAction as CaptureUpdateAction34 } from "@orangecatai/element";
20815
+ import { CaptureUpdateAction as CaptureUpdateAction35 } from "@orangecatai/element";
20771
20816
  import { orderByFractionalIndex } from "@orangecatai/element";
20772
20817
 
20773
20818
  // history.ts
20774
20819
  import { Emitter as Emitter2 } from "@orangecatai/common";
20775
20820
  import {
20776
- CaptureUpdateAction as CaptureUpdateAction33,
20821
+ CaptureUpdateAction as CaptureUpdateAction34,
20777
20822
  StoreChange,
20778
20823
  StoreDelta
20779
20824
  } from "@orangecatai/element";
@@ -20887,7 +20932,7 @@ var History = class _History {
20887
20932
  if (historyDelta === null) {
20888
20933
  return;
20889
20934
  }
20890
- const action = CaptureUpdateAction33.IMMEDIATELY;
20935
+ const action = CaptureUpdateAction34.IMMEDIATELY;
20891
20936
  let prevSnapshot = this.store.snapshot;
20892
20937
  let nextElements = elements;
20893
20938
  let nextAppState = appState;
@@ -20968,7 +21013,7 @@ var executeHistoryAction = (app, appState, updater) => {
20968
21013
  if (!appState.multiElement && !appState.resizingElement && !appState.editingTextElement && !appState.newElement && !appState.selectedElementsAreBeingDragged && !appState.selectionElement && !app.flowChartCreator.isCreatingChart) {
20969
21014
  const result = updater();
20970
21015
  if (!result) {
20971
- return { captureUpdate: CaptureUpdateAction34.EVENTUALLY };
21016
+ return { captureUpdate: CaptureUpdateAction35.EVENTUALLY };
20972
21017
  }
20973
21018
  const [nextElementsMap, nextAppState] = result;
20974
21019
  const nextElements = orderByFractionalIndex(
@@ -20977,10 +21022,10 @@ var executeHistoryAction = (app, appState, updater) => {
20977
21022
  return {
20978
21023
  appState: nextAppState,
20979
21024
  elements: nextElements,
20980
- captureUpdate: CaptureUpdateAction34.NEVER
21025
+ captureUpdate: CaptureUpdateAction35.NEVER
20981
21026
  };
20982
21027
  }
20983
- return { captureUpdate: CaptureUpdateAction34.EVENTUALLY };
21028
+ return { captureUpdate: CaptureUpdateAction35.EVENTUALLY };
20984
21029
  };
20985
21030
  var createUndoAction = (history) => ({
20986
21031
  name: "undo",
@@ -20993,7 +21038,7 @@ var createUndoAction = (history) => ({
20993
21038
  appState,
20994
21039
  () => history.undo(arrayToMap21(elements), appState)
20995
21040
  ),
20996
- keyTest: (event) => event[KEYS42.CTRL_OR_CMD] && matchKey(event, KEYS42.Z) && !event.shiftKey,
21041
+ keyTest: (event) => event[KEYS43.CTRL_OR_CMD] && matchKey(event, KEYS43.Z) && !event.shiftKey,
20997
21042
  PanelComponent: ({ appState, updateData, data, app }) => {
20998
21043
  const { isUndoStackEmpty } = useEmitter(
20999
21044
  history.onHistoryChangedEmitter,
@@ -21031,7 +21076,7 @@ var createRedoAction = (history) => ({
21031
21076
  appState,
21032
21077
  () => history.redo(arrayToMap21(elements), appState)
21033
21078
  ),
21034
- keyTest: (event) => event[KEYS42.CTRL_OR_CMD] && event.shiftKey && matchKey(event, KEYS42.Z) || isWindows && event.ctrlKey && !event.shiftKey && matchKey(event, KEYS42.Y),
21079
+ keyTest: (event) => event[KEYS43.CTRL_OR_CMD] && event.shiftKey && matchKey(event, KEYS43.Z) || isWindows && event.ctrlKey && !event.shiftKey && matchKey(event, KEYS43.Y),
21035
21080
  PanelComponent: ({ appState, updateData, data, app }) => {
21036
21081
  const { isRedoStackEmpty } = useEmitter(
21037
21082
  history.onHistoryChangedEmitter,
@@ -21064,7 +21109,7 @@ import { getFontString as getFontString6 } from "@orangecatai/common";
21064
21109
  import { newElementWith as newElementWith10 } from "@orangecatai/element";
21065
21110
  import { measureText as measureText4 } from "@orangecatai/element";
21066
21111
  import { isTextElement as isTextElement9 } from "@orangecatai/element";
21067
- import { CaptureUpdateAction as CaptureUpdateAction35 } from "@orangecatai/element";
21112
+ import { CaptureUpdateAction as CaptureUpdateAction36 } from "@orangecatai/element";
21068
21113
  var actionTextAutoResize = register({
21069
21114
  name: "autoResize",
21070
21115
  label: "labels.autoResize",
@@ -21094,7 +21139,7 @@ var actionTextAutoResize = register({
21094
21139
  }
21095
21140
  return element;
21096
21141
  }),
21097
- captureUpdate: CaptureUpdateAction35.IMMEDIATELY
21142
+ captureUpdate: CaptureUpdateAction36.IMMEDIATELY
21098
21143
  };
21099
21144
  }
21100
21145
  });
@@ -21302,7 +21347,7 @@ import {
21302
21347
  rangeIntersection,
21303
21348
  rangesOverlap
21304
21349
  } from "@orangecatai/math";
21305
- import { TOOL_TYPE, KEYS as KEYS43 } from "@orangecatai/common";
21350
+ import { TOOL_TYPE, KEYS as KEYS44 } from "@orangecatai/common";
21306
21351
  import {
21307
21352
  getCommonBounds as getCommonBounds4,
21308
21353
  getDraggedElementsBounds,
@@ -21348,7 +21393,7 @@ var isSnappingEnabled = ({
21348
21393
  }) => {
21349
21394
  if (event) {
21350
21395
  const isLassoDragging = app.state.activeTool.type === "lasso" && app.state.selectedElementsAreBeingDragged;
21351
- return (app.state.activeTool.type !== "lasso" || isLassoDragging) && (app.state.objectsSnapModeEnabled && !event[KEYS43.CTRL_OR_CMD] || !app.state.objectsSnapModeEnabled && event[KEYS43.CTRL_OR_CMD] && !isGridModeEnabled(app));
21396
+ return (app.state.activeTool.type !== "lasso" || isLassoDragging) && (app.state.objectsSnapModeEnabled && !event[KEYS44.CTRL_OR_CMD] || !app.state.objectsSnapModeEnabled && event[KEYS44.CTRL_OR_CMD] && !isGridModeEnabled(app));
21352
21397
  }
21353
21398
  if (selectedElements.length === 1 && selectedElements[0].type === "arrow") {
21354
21399
  return false;
@@ -23970,6 +24015,70 @@ var GEMINI_RATIOS = {
23970
24015
  "8:1": 8 / 1,
23971
24016
  "1:8": 1 / 8
23972
24017
  };
24018
+ var CUSTOM_RESIZE_DELTA_THRESHOLD = 0.2;
24019
+ var EXTREME_AR_THRESHOLD = 4;
24020
+ function ratioLogDelta(a, b) {
24021
+ return Math.abs(Math.log(a / b));
24022
+ }
24023
+ function isBigAspectRatioDelta(targetW, targetH) {
24024
+ const targetAR = targetW / targetH;
24025
+ if (targetAR >= EXTREME_AR_THRESHOLD || targetAR <= 1 / EXTREME_AR_THRESHOLD) {
24026
+ return true;
24027
+ }
24028
+ let minDelta = Infinity;
24029
+ for (const value of Object.values(GEMINI_RATIOS)) {
24030
+ const delta = ratioLogDelta(value, targetAR);
24031
+ if (delta < minDelta) {
24032
+ minDelta = delta;
24033
+ }
24034
+ }
24035
+ return minDelta > CUSTOM_RESIZE_DELTA_THRESHOLD;
24036
+ }
24037
+ async function callCustomResizeProxy(customResizeUrl, sourceImageDataUrl, targetWidth, targetHeight, signal) {
24038
+ const res = await fetch(customResizeUrl, {
24039
+ method: "POST",
24040
+ headers: { "Content-Type": "application/json" },
24041
+ body: JSON.stringify({
24042
+ imageDataUrl: sourceImageDataUrl,
24043
+ targetWidth,
24044
+ targetHeight
24045
+ }),
24046
+ signal
24047
+ });
24048
+ if (!res.ok) {
24049
+ const body = await res.text().catch(() => "");
24050
+ throw new Error(
24051
+ `Custom resize failed ${res.status}: ${body.slice(0, 300)}`
24052
+ );
24053
+ }
24054
+ const data = await res.json();
24055
+ if (typeof data?.dataUrl !== "string") {
24056
+ throw new Error("Custom resize response missing dataUrl");
24057
+ }
24058
+ return data.dataUrl;
24059
+ }
24060
+ async function callTier1CropProxy(tier1CropUrl, generatedImageDataUrl, sourceImageDataUrl, targetWidth, targetHeight, signal) {
24061
+ const res = await fetch(tier1CropUrl, {
24062
+ method: "POST",
24063
+ headers: { "Content-Type": "application/json" },
24064
+ body: JSON.stringify({
24065
+ generatedImageDataUrl,
24066
+ sourceImageDataUrl,
24067
+ targetWidth,
24068
+ targetHeight
24069
+ }),
24070
+ signal
24071
+ });
24072
+ if (!res.ok) {
24073
+ const body = await res.text().catch(() => "");
24074
+ throw new Error(`Tier-1 crop failed ${res.status}: ${body.slice(0, 300)}`);
24075
+ }
24076
+ const data = await res.json();
24077
+ if (typeof data?.dataUrl !== "string") {
24078
+ throw new Error("Tier-1 crop response missing dataUrl");
24079
+ }
24080
+ return data.dataUrl;
24081
+ }
23973
24082
  function nearestGeminiAspectRatio(w, h) {
23974
24083
  const target = w / h;
23975
24084
  let best = "1:1";
@@ -24209,6 +24318,7 @@ HARD REQUIREMENTS:
24209
24318
  \u2022 LOGO INTEGRITY: The brand logo must appear exactly as supplied \u2014 same shape, colours, and proportions. Do NOT alter, recolour, distort, or replace it. Do NOT squish or stretch the logo horizontally or vertically.
24210
24319
  \u2022 Do NOT squish, stretch, or distort any element horizontally or vertically \u2014 maintain the natural aspect ratio of every visual, logo, product image, and text block.
24211
24320
  \u2022 RE-ARRANGE the composition to suit the new aspect ratio \u2014 reposition and rescale elements so the layout feels native to ${tgtW}\xD7${tgtH}. Do NOT simply stretch, squash, or letterbox the original. If the new aspect ratio leaves empty areas after placing all elements, those areas should be filled with the background colour or a natural extension of the background \u2014 never with repeated ad content.
24321
+ \u2022 NO BORDER OR FRAME: the ad's background must extend all the way to every edge of the ${tgtW}\xD7${tgtH} canvas. Do NOT add a decorative border, outline, frame, vignette, or dim band around the ad \u2014 even as a stylistic flourish. The output should look like a single continuous ad filling the canvas, not a smaller ad pasted onto a bordered/framed backdrop.
24212
24322
  \u2022 Maintain professional advertising quality: balanced layout, clear visual hierarchy, generous but purposeful spacing.
24213
24323
 
24214
24324
  Output ONLY the final recomposed ad image at ${tgtW}\xD7${tgtH}.`;
@@ -24221,6 +24331,8 @@ async function runAutoResizeForDimension(opts) {
24221
24331
  placementY,
24222
24332
  app,
24223
24333
  autoResizeUrl,
24334
+ customResizeUrl,
24335
+ tier1CropUrl,
24224
24336
  agentImageModel,
24225
24337
  sourceFrame,
24226
24338
  sourceScreenshot,
@@ -24259,34 +24371,65 @@ async function runAutoResizeForDimension(opts) {
24259
24371
  if (!sourceScreenshot) {
24260
24372
  throw new Error("Source frame screenshot unavailable");
24261
24373
  }
24262
- const aspectRatio = nearestGeminiAspectRatio(tgtW, tgtH);
24263
- const resolution = clampResolutionForModel(
24264
- selectOptimalResolution(tgtW, tgtH, aspectRatio),
24265
- imageModel
24266
- );
24267
- debug(
24268
- `[AutoResize] ${debugLabel} \u2014 image-gen recompose (model=${imageModel}, ar=${aspectRatio}, res=${resolution}, logo=${!!brandImages?.logo}, fontPreview=${!!brandImages?.fontPreview})`
24269
- );
24270
- onProgress?.("Generating ad\u2026");
24271
- const prompt = buildAutoResizeImagePrompt(
24272
- Math.round(sourceFrame.width),
24273
- Math.round(sourceFrame.height),
24274
- tgtW,
24275
- tgtH,
24276
- aspectRatio,
24277
- brandImages
24278
- );
24279
- const generatedDataUrl = await callOpenRouterImageAPI(
24280
- prompt,
24281
- imageModel,
24282
- aspectRatio,
24283
- resolution,
24284
- false,
24285
- autoResizeUrl,
24286
- sourceScreenshot,
24287
- signal,
24288
- brandImages
24289
- );
24374
+ const useBigDeltaPipeline = !!customResizeUrl && isBigAspectRatioDelta(tgtW, tgtH);
24375
+ let generatedDataUrl;
24376
+ let placedAtExactTargetSize = false;
24377
+ if (useBigDeltaPipeline) {
24378
+ debug(
24379
+ `[AutoResize] ${debugLabel} \u2014 big AR delta, routing to Tier-2 custom-resize`
24380
+ );
24381
+ onProgress?.("Recomposing for extreme aspect ratio\u2026");
24382
+ generatedDataUrl = await callCustomResizeProxy(
24383
+ customResizeUrl,
24384
+ sourceScreenshot,
24385
+ tgtW,
24386
+ tgtH,
24387
+ signal
24388
+ );
24389
+ placedAtExactTargetSize = true;
24390
+ } else {
24391
+ const aspectRatio = nearestGeminiAspectRatio(tgtW, tgtH);
24392
+ const resolution = clampResolutionForModel(
24393
+ selectOptimalResolution(tgtW, tgtH, aspectRatio),
24394
+ imageModel
24395
+ );
24396
+ debug(
24397
+ `[AutoResize] ${debugLabel} \u2014 image-gen recompose (model=${imageModel}, ar=${aspectRatio}, res=${resolution}, logo=${!!brandImages?.logo}, fontPreview=${!!brandImages?.fontPreview})`
24398
+ );
24399
+ onProgress?.("Generating ad\u2026");
24400
+ const prompt = buildAutoResizeImagePrompt(
24401
+ Math.round(sourceFrame.width),
24402
+ Math.round(sourceFrame.height),
24403
+ tgtW,
24404
+ tgtH,
24405
+ aspectRatio,
24406
+ brandImages
24407
+ );
24408
+ generatedDataUrl = await callOpenRouterImageAPI(
24409
+ prompt,
24410
+ imageModel,
24411
+ aspectRatio,
24412
+ resolution,
24413
+ false,
24414
+ autoResizeUrl,
24415
+ sourceScreenshot,
24416
+ signal,
24417
+ brandImages
24418
+ );
24419
+ if (tier1CropUrl) {
24420
+ debug(`[AutoResize] ${debugLabel} \u2014 Tier-1 element-aware crop`);
24421
+ onProgress?.("Fitting ad to frame\u2026");
24422
+ generatedDataUrl = await callTier1CropProxy(
24423
+ tier1CropUrl,
24424
+ generatedDataUrl,
24425
+ sourceScreenshot,
24426
+ tgtW,
24427
+ tgtH,
24428
+ signal
24429
+ );
24430
+ placedAtExactTargetSize = true;
24431
+ }
24432
+ }
24290
24433
  onProgress?.("Placing ad\u2026");
24291
24434
  const { width: imgNatW, height: imgNatH } = await getImageNaturalDimensions(
24292
24435
  generatedDataUrl
@@ -24296,7 +24439,7 @@ async function runAutoResizeForDimension(opts) {
24296
24439
  relY,
24297
24440
  width: imgW,
24298
24441
  height: imgH
24299
- } = fitImageToFrame(imgNatW, imgNatH, tgtW, tgtH);
24442
+ } = placedAtExactTargetSize ? { relX: 0, relY: 0, width: tgtW, height: tgtH } : fitImageToFrame(imgNatW, imgNatH, tgtW, tgtH);
24300
24443
  const currentPos = getCurrentFramePosition();
24301
24444
  const fileId = nanoid();
24302
24445
  const imgEl = newImageElement({
@@ -24372,6 +24515,8 @@ async function runAutoResize(opts) {
24372
24515
  targetDimensions,
24373
24516
  app,
24374
24517
  autoResizeUrl,
24518
+ customResizeUrl,
24519
+ tier1CropUrl,
24375
24520
  agentImageModel,
24376
24521
  onBeforeAutoResize,
24377
24522
  onAfterAutoResize,
@@ -24438,6 +24583,8 @@ async function runAutoResize(opts) {
24438
24583
  existingFrameId: preCreatedFrameInfos?.[i]?.frameId,
24439
24584
  app,
24440
24585
  autoResizeUrl,
24586
+ customResizeUrl,
24587
+ tier1CropUrl,
24441
24588
  agentImageModel,
24442
24589
  sourceFrame,
24443
24590
  sourceScreenshot,
@@ -24625,6 +24772,8 @@ var AutoResizePanel = ({
24625
24772
  onAfterAutoResize,
24626
24773
  onRunningChange,
24627
24774
  autoResizeUrl,
24775
+ customResizeUrl,
24776
+ tier1CropUrl,
24628
24777
  chatModel,
24629
24778
  agentImageModel
24630
24779
  }) => {
@@ -24733,6 +24882,8 @@ var AutoResizePanel = ({
24733
24882
  preCreatedFrameInfos: preCreatedFrames.length > 0 ? preCreatedFrames : void 0,
24734
24883
  app,
24735
24884
  autoResizeUrl,
24885
+ customResizeUrl,
24886
+ tier1CropUrl,
24736
24887
  chatModel,
24737
24888
  agentImageModel,
24738
24889
  customFontMap,
@@ -24781,6 +24932,8 @@ var AutoResizePanel = ({
24781
24932
  onBeforeAutoResize,
24782
24933
  onAfterAutoResize,
24783
24934
  autoResizeUrl,
24935
+ customResizeUrl,
24936
+ tier1CropUrl,
24784
24937
  chatModel,
24785
24938
  agentImageModel
24786
24939
  ]);
@@ -25063,6 +25216,8 @@ var AutoResizePanelHost = ({ app }) => {
25063
25216
  onBeforeAutoResize: app.props.onBeforeAutoResize,
25064
25217
  onAfterAutoResize: app.props.onAfterAutoResize,
25065
25218
  autoResizeUrl: app.props.autoResizeUrl ?? "",
25219
+ customResizeUrl: app.props.customResizeUrl,
25220
+ tier1CropUrl: app.props.tier1CropUrl,
25066
25221
  chatModel: app.props.chatModel ?? "google/gemini-3.1-flash-lite-preview",
25067
25222
  agentImageModel: app.props.agentImageModel
25068
25223
  }
@@ -25502,7 +25657,7 @@ var TemplateBuilderPanelHost = ({
25502
25657
  import { useCallback as useCallback16, useEffect as useEffect35, useRef as useRef28, useState as useState32 } from "react";
25503
25658
  import { sceneCoordsToViewportCoords as sceneCoordsToViewportCoords8 } from "@orangecatai/common";
25504
25659
  import {
25505
- CaptureUpdateAction as CaptureUpdateAction36,
25660
+ CaptureUpdateAction as CaptureUpdateAction37,
25506
25661
  getElementAbsoluteCoords as getElementAbsoluteCoords10
25507
25662
  } from "@orangecatai/element";
25508
25663
  import { ArrowUp, ImagePlus, X } from "lucide-react";
@@ -26679,7 +26834,7 @@ var ImageGeneratorPanel = ({
26679
26834
  ratio: newRatio,
26680
26835
  resolution: newRes
26681
26836
  });
26682
- app.syncActionResult({ captureUpdate: CaptureUpdateAction36.IMMEDIATELY });
26837
+ app.syncActionResult({ captureUpdate: CaptureUpdateAction37.IMMEDIATELY });
26683
26838
  }, [selectedModel, app, element, persistFrameSettings]);
26684
26839
  const [isGenerating, setIsGenerating] = useState32(
26685
26840
  () => hasPendingGeneration(element.id)
@@ -26744,7 +26899,7 @@ var ImageGeneratorPanel = ({
26744
26899
  }
26745
26900
  });
26746
26901
  appRef.current.syncActionResult({
26747
- captureUpdate: CaptureUpdateAction36.IMMEDIATELY
26902
+ captureUpdate: CaptureUpdateAction37.IMMEDIATELY
26748
26903
  });
26749
26904
  },
26750
26905
  [selectedModel, selectedResolution]
@@ -26767,7 +26922,7 @@ var ImageGeneratorPanel = ({
26767
26922
  }
26768
26923
  });
26769
26924
  appRef.current.syncActionResult({
26770
- captureUpdate: CaptureUpdateAction36.IMMEDIATELY
26925
+ captureUpdate: CaptureUpdateAction37.IMMEDIATELY
26771
26926
  });
26772
26927
  },
26773
26928
  [selectedModel, selectedRatio]
@@ -27124,7 +27279,7 @@ var ImageGeneratorPanel = ({
27124
27279
  import { useCallback as useCallback17, useEffect as useEffect36, useRef as useRef29, useState as useState33 } from "react";
27125
27280
  import { sceneCoordsToViewportCoords as sceneCoordsToViewportCoords9 } from "@orangecatai/common";
27126
27281
  import {
27127
- CaptureUpdateAction as CaptureUpdateAction37,
27282
+ CaptureUpdateAction as CaptureUpdateAction38,
27128
27283
  getElementAbsoluteCoords as getElementAbsoluteCoords11
27129
27284
  } from "@orangecatai/element";
27130
27285
  import { ArrowUp as ArrowUp2, Volume2, X as X2 } from "lucide-react";
@@ -27138,7 +27293,9 @@ async function submitVideoJob(params, videoGenUrl) {
27138
27293
  });
27139
27294
  if (!res.ok) {
27140
27295
  const data2 = await res.json().catch(() => ({}));
27141
- throw new Error(data2.error || `Submission failed (${res.status})`);
27296
+ throw new Error(
27297
+ data2.error || `Submission failed (${res.status})`
27298
+ );
27142
27299
  }
27143
27300
  const data = await res.json();
27144
27301
  return { jobId: data.jobId };
@@ -27155,14 +27312,18 @@ async function pollVideoJob(jobId, videoGenStatusUrl, onProgress, signal) {
27155
27312
  const timer = setTimeout(resolve, POLL_INTERVAL_MS);
27156
27313
  signal?.addEventListener("abort", () => {
27157
27314
  clearTimeout(timer);
27158
- reject(Object.assign(new Error("AbortError"), { name: "AbortError" }));
27315
+ reject(
27316
+ Object.assign(new Error("AbortError"), { name: "AbortError" })
27317
+ );
27159
27318
  });
27160
27319
  });
27161
27320
  }
27162
27321
  const res = await fetch(`${videoGenStatusUrl}/${jobId}`, { signal });
27163
27322
  if (!res.ok) {
27164
27323
  const data2 = await res.json().catch(() => ({}));
27165
- throw new Error(data2.error || `Status check failed (${res.status})`);
27324
+ throw new Error(
27325
+ data2.error || `Status check failed (${res.status})`
27326
+ );
27166
27327
  }
27167
27328
  const data = await res.json();
27168
27329
  if (data.status === "done" && data.videoPresignedUrl) {
@@ -27257,7 +27418,15 @@ var VIDEO_MODEL_CONFIG = {
27257
27418
  supportsResolution: true,
27258
27419
  supportedResolutions: ["480p", "720p", "1080p", "4K"],
27259
27420
  supportsNegativePrompt: false,
27260
- supportedRatios: ["16:9", "9:16", "1:1", "4:3", "3:4", "21:9", "9:21"],
27421
+ supportedRatios: [
27422
+ "16:9",
27423
+ "9:16",
27424
+ "1:1",
27425
+ "4:3",
27426
+ "3:4",
27427
+ "21:9",
27428
+ "9:21"
27429
+ ],
27261
27430
  frameInputMode: "dual-frame",
27262
27431
  supportsInputReferences: true,
27263
27432
  supportsSeed: true
@@ -27274,7 +27443,15 @@ var VIDEO_MODEL_CONFIG = {
27274
27443
  supportsResolution: true,
27275
27444
  supportedResolutions: ["480p", "720p"],
27276
27445
  supportsNegativePrompt: false,
27277
- supportedRatios: ["16:9", "9:16", "1:1", "4:3", "3:4", "21:9", "9:21"],
27446
+ supportedRatios: [
27447
+ "16:9",
27448
+ "9:16",
27449
+ "1:1",
27450
+ "4:3",
27451
+ "3:4",
27452
+ "21:9",
27453
+ "9:21"
27454
+ ],
27278
27455
  frameInputMode: "dual-frame",
27279
27456
  supportsInputReferences: true,
27280
27457
  supportsSeed: true
@@ -27291,7 +27468,15 @@ var VIDEO_MODEL_CONFIG = {
27291
27468
  supportsResolution: true,
27292
27469
  supportedResolutions: ["720p", "1080p"],
27293
27470
  supportsNegativePrompt: false,
27294
- supportedRatios: ["16:9", "9:16", "1:1", "4:3", "3:4", "21:9", "9:21"],
27471
+ supportedRatios: [
27472
+ "16:9",
27473
+ "9:16",
27474
+ "1:1",
27475
+ "4:3",
27476
+ "3:4",
27477
+ "21:9",
27478
+ "9:21"
27479
+ ],
27295
27480
  frameInputMode: "start-only",
27296
27481
  supportsInputReferences: false,
27297
27482
  supportsSeed: true
@@ -27308,13 +27493,23 @@ var VIDEO_MODEL_CONFIG = {
27308
27493
  supportsResolution: true,
27309
27494
  supportedResolutions: ["480p", "720p"],
27310
27495
  supportsNegativePrompt: false,
27311
- supportedRatios: ["16:9", "9:16", "1:1", "4:3", "3:4", "3:2", "2:3"],
27496
+ supportedRatios: [
27497
+ "16:9",
27498
+ "9:16",
27499
+ "1:1",
27500
+ "4:3",
27501
+ "3:4",
27502
+ "3:2",
27503
+ "2:3"
27504
+ ],
27312
27505
  frameInputMode: "start-only",
27313
27506
  supportsInputReferences: false,
27314
27507
  supportsSeed: true
27315
27508
  }
27316
27509
  };
27317
- var VIDEO_MODEL_NAMES = Object.keys(VIDEO_MODEL_CONFIG);
27510
+ var VIDEO_MODEL_NAMES = Object.keys(
27511
+ VIDEO_MODEL_CONFIG
27512
+ );
27318
27513
  var RATIO_DIMS = {
27319
27514
  "16:9": [1280, 720],
27320
27515
  "9:16": [720, 1280],
@@ -27334,41 +27529,252 @@ var CAMERA_MOVEMENTS = [
27334
27529
  { label: "Fixed lens", phrase: "static fixed camera, no camera movement" },
27335
27530
  { label: "Handheld", phrase: "handheld camera with natural subtle shake" },
27336
27531
  { label: "Zoom out", phrase: "camera slowly zooms out from the subject" },
27337
- { label: "Advance", phrase: "camera slowly moves forward toward the subject" },
27532
+ {
27533
+ label: "Advance",
27534
+ phrase: "camera slowly moves forward toward the subject"
27535
+ },
27338
27536
  { label: "Follow", phrase: "camera tracks and follows the subject" },
27339
27537
  { label: "Orbit", phrase: "camera slowly orbits around the subject" },
27340
- { label: "Surround", phrase: "camera circles the subject in a 360-degree sweep" },
27538
+ {
27539
+ label: "Surround",
27540
+ phrase: "camera circles the subject in a 360-degree sweep"
27541
+ },
27341
27542
  { label: "Shake right", phrase: "camera shakes and pans to the right" },
27342
27543
  { label: "Shake left", phrase: "camera shakes and pans to the left" },
27343
27544
  { label: "Shake up", phrase: "camera shakes upward" }
27344
27545
  ];
27345
- var ChevronDownIcon3 = () => /* @__PURE__ */ jsx94("svg", { width: "9", height: "9", viewBox: "0 0 10 10", fill: "none", children: /* @__PURE__ */ jsx94("path", { d: "M2.5 3.75L5 6.25L7.5 3.75", stroke: "currentColor", strokeWidth: "1.6", strokeLinecap: "round", strokeLinejoin: "round" }) });
27346
- var CheckIcon4 = () => /* @__PURE__ */ jsx94("svg", { width: "12", height: "12", viewBox: "0 0 14 14", fill: "none", children: /* @__PURE__ */ jsx94("path", { d: "M2.5 7.5L5.5 10.5L11.5 3.5", stroke: "currentColor", strokeWidth: "1.6", strokeLinecap: "round", strokeLinejoin: "round" }) });
27546
+ var ChevronDownIcon3 = () => /* @__PURE__ */ jsx94("svg", { width: "9", height: "9", viewBox: "0 0 10 10", fill: "none", children: /* @__PURE__ */ jsx94(
27547
+ "path",
27548
+ {
27549
+ d: "M2.5 3.75L5 6.25L7.5 3.75",
27550
+ stroke: "currentColor",
27551
+ strokeWidth: "1.6",
27552
+ strokeLinecap: "round",
27553
+ strokeLinejoin: "round"
27554
+ }
27555
+ ) });
27556
+ var CheckIcon4 = () => /* @__PURE__ */ jsx94("svg", { width: "12", height: "12", viewBox: "0 0 14 14", fill: "none", children: /* @__PURE__ */ jsx94(
27557
+ "path",
27558
+ {
27559
+ d: "M2.5 7.5L5.5 10.5L11.5 3.5",
27560
+ stroke: "currentColor",
27561
+ strokeWidth: "1.6",
27562
+ strokeLinecap: "round",
27563
+ strokeLinejoin: "round"
27564
+ }
27565
+ ) });
27347
27566
  var CameraMovementIcon = () => /* @__PURE__ */ jsxs51("svg", { width: "13", height: "13", viewBox: "0 0 16 16", fill: "none", children: [
27348
27567
  /* @__PURE__ */ jsx94("circle", { cx: "8", cy: "8", r: "2.5", stroke: "currentColor", strokeWidth: "1.5" }),
27349
- /* @__PURE__ */ jsx94("path", { d: "M8 2v1.5M8 12.5V14M2 8h1.5M12.5 8H14M3.93 3.93l1.06 1.06M11.01 11.01l1.06 1.06M3.93 12.07l1.06-1.06M11.01 4.99l1.06-1.06", stroke: "currentColor", strokeWidth: "1.4", strokeLinecap: "round" })
27568
+ /* @__PURE__ */ jsx94(
27569
+ "path",
27570
+ {
27571
+ d: "M8 2v1.5M8 12.5V14M2 8h1.5M12.5 8H14M3.93 3.93l1.06 1.06M11.01 11.01l1.06 1.06M3.93 12.07l1.06-1.06M11.01 4.99l1.06-1.06",
27572
+ stroke: "currentColor",
27573
+ strokeWidth: "1.4",
27574
+ strokeLinecap: "round"
27575
+ }
27576
+ )
27350
27577
  ] });
27351
- var ModelIcon2 = () => /* @__PURE__ */ jsx94("svg", { width: "13", height: "13", viewBox: "0 0 16 16", fill: "none", children: /* @__PURE__ */ jsx94("path", { d: "M8 2L10.5 5.5H13.5L11.5 8L13 11.5L8 9.5L3 11.5L4.5 8L2.5 5.5H5.5L8 2Z", stroke: "currentColor", strokeWidth: "1.3", strokeLinejoin: "round" }) });
27352
- var SpinnerIcon3 = () => /* @__PURE__ */ jsx94("svg", { width: "14", height: "14", viewBox: "0 0 14 14", fill: "none", className: "vgp-spinner", children: /* @__PURE__ */ jsx94("circle", { cx: "7", cy: "7", r: "5.5", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeDasharray: "20 14" }) });
27578
+ var ModelIcon2 = () => /* @__PURE__ */ jsx94("svg", { width: "13", height: "13", viewBox: "0 0 16 16", fill: "none", children: /* @__PURE__ */ jsx94(
27579
+ "path",
27580
+ {
27581
+ d: "M8 2L10.5 5.5H13.5L11.5 8L13 11.5L8 9.5L3 11.5L4.5 8L2.5 5.5H5.5L8 2Z",
27582
+ stroke: "currentColor",
27583
+ strokeWidth: "1.3",
27584
+ strokeLinejoin: "round"
27585
+ }
27586
+ ) });
27587
+ var SpinnerIcon3 = () => /* @__PURE__ */ jsx94(
27588
+ "svg",
27589
+ {
27590
+ width: "14",
27591
+ height: "14",
27592
+ viewBox: "0 0 14 14",
27593
+ fill: "none",
27594
+ className: "vgp-spinner",
27595
+ children: /* @__PURE__ */ jsx94(
27596
+ "circle",
27597
+ {
27598
+ cx: "7",
27599
+ cy: "7",
27600
+ r: "5.5",
27601
+ stroke: "currentColor",
27602
+ strokeWidth: "1.5",
27603
+ strokeLinecap: "round",
27604
+ strokeDasharray: "20 14"
27605
+ }
27606
+ )
27607
+ }
27608
+ );
27353
27609
  var ImageUploadIcon = () => /* @__PURE__ */ jsxs51("svg", { width: "14", height: "14", viewBox: "0 0 16 16", fill: "none", children: [
27354
- /* @__PURE__ */ jsx94("rect", { x: "2", y: "2", width: "12", height: "12", rx: "2", stroke: "currentColor", strokeWidth: "1.3" }),
27610
+ /* @__PURE__ */ jsx94(
27611
+ "rect",
27612
+ {
27613
+ x: "2",
27614
+ y: "2",
27615
+ width: "12",
27616
+ height: "12",
27617
+ rx: "2",
27618
+ stroke: "currentColor",
27619
+ strokeWidth: "1.3"
27620
+ }
27621
+ ),
27355
27622
  /* @__PURE__ */ jsx94("circle", { cx: "5.5", cy: "6", r: "1.2", fill: "currentColor" }),
27356
- /* @__PURE__ */ jsx94("path", { d: "M2 11l3.5-3.5 2.5 2.5 2-2 3 3", stroke: "currentColor", strokeWidth: "1.3", strokeLinecap: "round", strokeLinejoin: "round" })
27623
+ /* @__PURE__ */ jsx94(
27624
+ "path",
27625
+ {
27626
+ d: "M2 11l3.5-3.5 2.5 2.5 2-2 3 3",
27627
+ stroke: "currentColor",
27628
+ strokeWidth: "1.3",
27629
+ strokeLinecap: "round",
27630
+ strokeLinejoin: "round"
27631
+ }
27632
+ )
27357
27633
  ] });
27358
27634
  var FramesIcon = () => /* @__PURE__ */ jsxs51("svg", { width: "13", height: "13", viewBox: "0 0 16 16", fill: "none", children: [
27359
- /* @__PURE__ */ jsx94("rect", { x: "1", y: "3", width: "14", height: "10", rx: "2", stroke: "currentColor", strokeWidth: "1.3" }),
27360
- /* @__PURE__ */ jsx94("line", { x1: "5", y1: "3", x2: "5", y2: "13", stroke: "currentColor", strokeWidth: "1.3" }),
27361
- /* @__PURE__ */ jsx94("line", { x1: "11", y1: "3", x2: "11", y2: "13", stroke: "currentColor", strokeWidth: "1.3" })
27635
+ /* @__PURE__ */ jsx94(
27636
+ "rect",
27637
+ {
27638
+ x: "1",
27639
+ y: "3",
27640
+ width: "14",
27641
+ height: "10",
27642
+ rx: "2",
27643
+ stroke: "currentColor",
27644
+ strokeWidth: "1.3"
27645
+ }
27646
+ ),
27647
+ /* @__PURE__ */ jsx94(
27648
+ "line",
27649
+ {
27650
+ x1: "5",
27651
+ y1: "3",
27652
+ x2: "5",
27653
+ y2: "13",
27654
+ stroke: "currentColor",
27655
+ strokeWidth: "1.3"
27656
+ }
27657
+ ),
27658
+ /* @__PURE__ */ jsx94(
27659
+ "line",
27660
+ {
27661
+ x1: "11",
27662
+ y1: "3",
27663
+ x2: "11",
27664
+ y2: "13",
27665
+ stroke: "currentColor",
27666
+ strokeWidth: "1.3"
27667
+ }
27668
+ )
27362
27669
  ] });
27363
- var RatioIcon169 = () => /* @__PURE__ */ jsx94("svg", { width: "16", height: "11", viewBox: "0 0 16 11", fill: "none", children: /* @__PURE__ */ jsx94("rect", { x: "0.75", y: "0.75", width: "14.5", height: "9.5", rx: "1.5", stroke: "currentColor", strokeWidth: "1.5" }) });
27364
- var RatioIcon916 = () => /* @__PURE__ */ jsx94("svg", { width: "11", height: "16", viewBox: "0 0 11 16", fill: "none", children: /* @__PURE__ */ jsx94("rect", { x: "0.75", y: "0.75", width: "9.5", height: "14.5", rx: "1.5", stroke: "currentColor", strokeWidth: "1.5" }) });
27365
- var RatioIcon11 = () => /* @__PURE__ */ jsx94("svg", { width: "13", height: "13", viewBox: "0 0 13 13", fill: "none", children: /* @__PURE__ */ jsx94("rect", { x: "0.75", y: "0.75", width: "11.5", height: "11.5", rx: "1.5", stroke: "currentColor", strokeWidth: "1.5" }) });
27366
- var RatioIcon43 = () => /* @__PURE__ */ jsx94("svg", { width: "16", height: "12", viewBox: "0 0 16 12", fill: "none", children: /* @__PURE__ */ jsx94("rect", { x: "0.75", y: "0.75", width: "14.5", height: "10.5", rx: "1.5", stroke: "currentColor", strokeWidth: "1.5" }) });
27367
- var RatioIcon34 = () => /* @__PURE__ */ jsx94("svg", { width: "12", height: "16", viewBox: "0 0 12 16", fill: "none", children: /* @__PURE__ */ jsx94("rect", { x: "0.75", y: "0.75", width: "10.5", height: "14.5", rx: "1.5", stroke: "currentColor", strokeWidth: "1.5" }) });
27368
- var RatioIcon219 = () => /* @__PURE__ */ jsx94("svg", { width: "18", height: "8", viewBox: "0 0 18 8", fill: "none", children: /* @__PURE__ */ jsx94("rect", { x: "0.75", y: "0.75", width: "16.5", height: "6.5", rx: "1.5", stroke: "currentColor", strokeWidth: "1.5" }) });
27369
- var RatioIcon921 = () => /* @__PURE__ */ jsx94("svg", { width: "8", height: "18", viewBox: "0 0 8 18", fill: "none", children: /* @__PURE__ */ jsx94("rect", { x: "0.75", y: "0.75", width: "6.5", height: "16.5", rx: "1.5", stroke: "currentColor", strokeWidth: "1.5" }) });
27370
- var RatioIcon32 = () => /* @__PURE__ */ jsx94("svg", { width: "15", height: "10", viewBox: "0 0 15 10", fill: "none", children: /* @__PURE__ */ jsx94("rect", { x: "0.75", y: "0.75", width: "13.5", height: "8.5", rx: "1.5", stroke: "currentColor", strokeWidth: "1.5" }) });
27371
- var RatioIcon23 = () => /* @__PURE__ */ jsx94("svg", { width: "10", height: "15", viewBox: "0 0 10 15", fill: "none", children: /* @__PURE__ */ jsx94("rect", { x: "0.75", y: "0.75", width: "8.5", height: "13.5", rx: "1.5", stroke: "currentColor", strokeWidth: "1.5" }) });
27670
+ var RatioIcon169 = () => /* @__PURE__ */ jsx94("svg", { width: "16", height: "11", viewBox: "0 0 16 11", fill: "none", children: /* @__PURE__ */ jsx94(
27671
+ "rect",
27672
+ {
27673
+ x: "0.75",
27674
+ y: "0.75",
27675
+ width: "14.5",
27676
+ height: "9.5",
27677
+ rx: "1.5",
27678
+ stroke: "currentColor",
27679
+ strokeWidth: "1.5"
27680
+ }
27681
+ ) });
27682
+ var RatioIcon916 = () => /* @__PURE__ */ jsx94("svg", { width: "11", height: "16", viewBox: "0 0 11 16", fill: "none", children: /* @__PURE__ */ jsx94(
27683
+ "rect",
27684
+ {
27685
+ x: "0.75",
27686
+ y: "0.75",
27687
+ width: "9.5",
27688
+ height: "14.5",
27689
+ rx: "1.5",
27690
+ stroke: "currentColor",
27691
+ strokeWidth: "1.5"
27692
+ }
27693
+ ) });
27694
+ var RatioIcon11 = () => /* @__PURE__ */ jsx94("svg", { width: "13", height: "13", viewBox: "0 0 13 13", fill: "none", children: /* @__PURE__ */ jsx94(
27695
+ "rect",
27696
+ {
27697
+ x: "0.75",
27698
+ y: "0.75",
27699
+ width: "11.5",
27700
+ height: "11.5",
27701
+ rx: "1.5",
27702
+ stroke: "currentColor",
27703
+ strokeWidth: "1.5"
27704
+ }
27705
+ ) });
27706
+ var RatioIcon43 = () => /* @__PURE__ */ jsx94("svg", { width: "16", height: "12", viewBox: "0 0 16 12", fill: "none", children: /* @__PURE__ */ jsx94(
27707
+ "rect",
27708
+ {
27709
+ x: "0.75",
27710
+ y: "0.75",
27711
+ width: "14.5",
27712
+ height: "10.5",
27713
+ rx: "1.5",
27714
+ stroke: "currentColor",
27715
+ strokeWidth: "1.5"
27716
+ }
27717
+ ) });
27718
+ var RatioIcon34 = () => /* @__PURE__ */ jsx94("svg", { width: "12", height: "16", viewBox: "0 0 12 16", fill: "none", children: /* @__PURE__ */ jsx94(
27719
+ "rect",
27720
+ {
27721
+ x: "0.75",
27722
+ y: "0.75",
27723
+ width: "10.5",
27724
+ height: "14.5",
27725
+ rx: "1.5",
27726
+ stroke: "currentColor",
27727
+ strokeWidth: "1.5"
27728
+ }
27729
+ ) });
27730
+ var RatioIcon219 = () => /* @__PURE__ */ jsx94("svg", { width: "18", height: "8", viewBox: "0 0 18 8", fill: "none", children: /* @__PURE__ */ jsx94(
27731
+ "rect",
27732
+ {
27733
+ x: "0.75",
27734
+ y: "0.75",
27735
+ width: "16.5",
27736
+ height: "6.5",
27737
+ rx: "1.5",
27738
+ stroke: "currentColor",
27739
+ strokeWidth: "1.5"
27740
+ }
27741
+ ) });
27742
+ var RatioIcon921 = () => /* @__PURE__ */ jsx94("svg", { width: "8", height: "18", viewBox: "0 0 8 18", fill: "none", children: /* @__PURE__ */ jsx94(
27743
+ "rect",
27744
+ {
27745
+ x: "0.75",
27746
+ y: "0.75",
27747
+ width: "6.5",
27748
+ height: "16.5",
27749
+ rx: "1.5",
27750
+ stroke: "currentColor",
27751
+ strokeWidth: "1.5"
27752
+ }
27753
+ ) });
27754
+ var RatioIcon32 = () => /* @__PURE__ */ jsx94("svg", { width: "15", height: "10", viewBox: "0 0 15 10", fill: "none", children: /* @__PURE__ */ jsx94(
27755
+ "rect",
27756
+ {
27757
+ x: "0.75",
27758
+ y: "0.75",
27759
+ width: "13.5",
27760
+ height: "8.5",
27761
+ rx: "1.5",
27762
+ stroke: "currentColor",
27763
+ strokeWidth: "1.5"
27764
+ }
27765
+ ) });
27766
+ var RatioIcon23 = () => /* @__PURE__ */ jsx94("svg", { width: "10", height: "15", viewBox: "0 0 10 15", fill: "none", children: /* @__PURE__ */ jsx94(
27767
+ "rect",
27768
+ {
27769
+ x: "0.75",
27770
+ y: "0.75",
27771
+ width: "8.5",
27772
+ height: "13.5",
27773
+ rx: "1.5",
27774
+ stroke: "currentColor",
27775
+ strokeWidth: "1.5"
27776
+ }
27777
+ ) });
27372
27778
  var RATIO_ICONS = {
27373
27779
  "16:9": /* @__PURE__ */ jsx94(RatioIcon169, {}),
27374
27780
  "9:16": /* @__PURE__ */ jsx94(RatioIcon916, {}),
@@ -27391,8 +27797,9 @@ var VideoGeneratorPanel = ({
27391
27797
  const videoGenStatusUrl = app.props.videoGenStatusUrl;
27392
27798
  const getStoredSettings = (frame) => {
27393
27799
  const stored2 = frame.customData?.videoGenerator;
27394
- if (!stored2)
27800
+ if (!stored2) {
27395
27801
  return null;
27802
+ }
27396
27803
  return {
27397
27804
  model: stored2.model,
27398
27805
  ratio: stored2.ratio,
@@ -27407,20 +27814,25 @@ var VideoGeneratorPanel = ({
27407
27814
  const defaultRatio = stored?.ratio ?? "16:9";
27408
27815
  const defaultResolution = stored?.resolution ?? (modelCfg.supportsResolution ? VIDEO_MODEL_CONFIG[defaultModel].supportedResolutions?.[1] ?? void 0 : void 0);
27409
27816
  const defaultDuration = (() => {
27410
- if (stored?.duration != null)
27817
+ if (stored?.duration != null) {
27411
27818
  return stored.duration;
27412
- if (!modelCfg.supportsDuration)
27819
+ }
27820
+ if (!modelCfg.supportsDuration) {
27413
27821
  return void 0;
27822
+ }
27414
27823
  const cfg2 = modelCfg;
27415
- if (cfg2.durationMode === "choices")
27824
+ if (cfg2.durationMode === "choices") {
27416
27825
  return cfg2.durationValues?.[0];
27826
+ }
27417
27827
  return cfg2.minDuration ?? 5;
27418
27828
  })();
27419
27829
  const [prompt, setPrompt] = useState33("");
27420
27830
  const [selectedModel, setSelectedModel] = useState33(defaultModel);
27421
27831
  const [selectedRatio, setSelectedRatio] = useState33(defaultRatio);
27422
27832
  const [selectedResolution, setSelectedResolution] = useState33(defaultResolution);
27423
- const [selectedDuration, setSelectedDuration] = useState33(defaultDuration);
27833
+ const [selectedDuration, setSelectedDuration] = useState33(
27834
+ defaultDuration
27835
+ );
27424
27836
  const [generateAudio, setGenerateAudio] = useState33(true);
27425
27837
  const [negativePrompt, setNegativePrompt] = useState33("");
27426
27838
  const [firstFrame, setFirstFrame] = useState33(null);
@@ -27428,7 +27840,9 @@ var VideoGeneratorPanel = ({
27428
27840
  const [inputReferences, setInputReferences] = useState33([]);
27429
27841
  const [seed, setSeed] = useState33(void 0);
27430
27842
  const [inputMode, setInputMode] = useState33("frames");
27431
- const [cameraMovement, setCameraMovement] = useState33(stored?.cameraMovement ?? null);
27843
+ const [cameraMovement, setCameraMovement] = useState33(
27844
+ stored?.cameraMovement ?? null
27845
+ );
27432
27846
  const [genStatus, setGenStatus] = useState33("idle");
27433
27847
  const [progress, setProgress] = useState33(0);
27434
27848
  const [generateError, setGenerateError] = useState33(null);
@@ -27479,7 +27893,9 @@ var VideoGeneratorPanel = ({
27479
27893
  } else {
27480
27894
  const min = ncfg.minDuration ?? 3;
27481
27895
  const max = ncfg.maxDuration ?? 15;
27482
- setSelectedDuration(Math.min(max, Math.max(min, selectedDuration ?? min)));
27896
+ setSelectedDuration(
27897
+ Math.min(max, Math.max(min, selectedDuration ?? min))
27898
+ );
27483
27899
  }
27484
27900
  } else {
27485
27901
  setSelectedDuration(void 0);
@@ -27511,13 +27927,15 @@ var VideoGeneratorPanel = ({
27511
27927
  return () => document.removeEventListener("mousedown", handler);
27512
27928
  }, []);
27513
27929
  useEffect36(() => {
27514
- if (!element.customData?.videoGeneratorAutoFitPending)
27930
+ if (!element.customData?.videoGeneratorAutoFitPending) {
27515
27931
  return;
27932
+ }
27516
27933
  let frameId = 0;
27517
27934
  let cancelled = false;
27518
27935
  const run = () => {
27519
- if (cancelled)
27936
+ if (cancelled) {
27520
27937
  return;
27938
+ }
27521
27939
  app.scrollToContent(element, {
27522
27940
  fitToViewport: true,
27523
27941
  viewportZoomFactor: 0.8,
@@ -27546,12 +27964,19 @@ var VideoGeneratorPanel = ({
27546
27964
  videoGenerator: settings
27547
27965
  }
27548
27966
  });
27549
- appRef.current.syncActionResult({ captureUpdate: CaptureUpdateAction37.IMMEDIATELY });
27967
+ appRef.current.syncActionResult({
27968
+ captureUpdate: CaptureUpdateAction38.IMMEDIATELY
27969
+ });
27550
27970
  }, []);
27551
27971
  const applyRatioResize = useCallback17((newRatio) => {
27552
27972
  const [w, h] = RATIO_DIMS[newRatio] ?? [1280, 720];
27553
- appRef.current.scene.mutateElement(elementRef.current, { width: w, height: h });
27554
- appRef.current.syncActionResult({ captureUpdate: CaptureUpdateAction37.IMMEDIATELY });
27973
+ appRef.current.scene.mutateElement(elementRef.current, {
27974
+ width: w,
27975
+ height: h
27976
+ });
27977
+ appRef.current.syncActionResult({
27978
+ captureUpdate: CaptureUpdateAction38.IMMEDIATELY
27979
+ });
27555
27980
  window.requestAnimationFrame(() => {
27556
27981
  appRef.current.scrollToContent(elementRef.current, {
27557
27982
  fitToViewport: true,
@@ -27564,31 +27989,39 @@ var VideoGeneratorPanel = ({
27564
27989
  const handleFrameUpload = useCallback17(
27565
27990
  (which) => (e) => {
27566
27991
  const file2 = e.target.files?.[0];
27567
- if (!file2)
27992
+ if (!file2) {
27568
27993
  return;
27994
+ }
27569
27995
  const reader = new FileReader();
27570
27996
  reader.onload = () => {
27571
- if (which === "first")
27997
+ if (which === "first") {
27572
27998
  setFirstFrame(reader.result);
27573
- else
27999
+ } else {
27574
28000
  setLastFrame(reader.result);
28001
+ }
28002
+ };
28003
+ reader.readAsDataURL(file2);
28004
+ e.target.value = "";
28005
+ },
28006
+ []
28007
+ );
28008
+ const handleRefUpload = useCallback17(
28009
+ (e) => {
28010
+ const file2 = e.target.files?.[0];
28011
+ if (!file2) {
28012
+ return;
28013
+ }
28014
+ const reader = new FileReader();
28015
+ reader.onload = () => {
28016
+ setInputReferences(
28017
+ (prev) => [...prev, reader.result].slice(0, 3)
28018
+ );
27575
28019
  };
27576
28020
  reader.readAsDataURL(file2);
27577
28021
  e.target.value = "";
27578
28022
  },
27579
28023
  []
27580
28024
  );
27581
- const handleRefUpload = useCallback17((e) => {
27582
- const file2 = e.target.files?.[0];
27583
- if (!file2)
27584
- return;
27585
- const reader = new FileReader();
27586
- reader.onload = () => {
27587
- setInputReferences((prev) => [...prev, reader.result].slice(0, 3));
27588
- };
27589
- reader.readAsDataURL(file2);
27590
- e.target.value = "";
27591
- }, []);
27592
28025
  const isGenerating = genStatus === "submitting" || genStatus === "polling";
27593
28026
  const handleStop = useCallback17(() => {
27594
28027
  abortControllerRef.current?.abort();
@@ -27611,7 +28044,9 @@ var VideoGeneratorPanel = ({
27611
28044
  try {
27612
28045
  const { allowed, error } = await onBeforeVideoGen();
27613
28046
  if (!allowed) {
27614
- setGenerateError(error || "Insufficient credits for video generation");
28047
+ setGenerateError(
28048
+ error || "Insufficient credits for video generation"
28049
+ );
27615
28050
  setGenStatus("error");
27616
28051
  return;
27617
28052
  }
@@ -27635,7 +28070,9 @@ var VideoGeneratorPanel = ({
27635
28070
  ...selectedDuration != null && { duration: selectedDuration },
27636
28071
  ...selectedResolution != null && { resolution: selectedResolution },
27637
28072
  ...firstFrame && { firstFrameDataUrl: firstFrame },
27638
- ...lastFrame && currentCfg.supportsLastFrame && currentCfg.frameInputMode === "dual-frame" && { lastFrameDataUrl: lastFrame },
28073
+ ...lastFrame && currentCfg.supportsLastFrame && currentCfg.frameInputMode === "dual-frame" && {
28074
+ lastFrameDataUrl: lastFrame
28075
+ },
27639
28076
  ...currentCfg.audioMode === "toggle" && { audio: generateAudio },
27640
28077
  ...negativePrompt.trim() && currentCfg.supportsNegativePrompt && {
27641
28078
  negativePrompt: negativePrompt.trim()
@@ -27654,7 +28091,10 @@ var VideoGeneratorPanel = ({
27654
28091
  (p) => setProgress(p),
27655
28092
  controller.signal
27656
28093
  );
27657
- appRef.current.insertGeneratedVideoIntoFrame(videoPresignedUrl, elementRef.current);
28094
+ appRef.current.insertGeneratedVideoIntoFrame(
28095
+ videoPresignedUrl,
28096
+ elementRef.current
28097
+ );
27658
28098
  persistSettings({
27659
28099
  model: selectedModel,
27660
28100
  ratio: selectedRatio,
@@ -27671,7 +28111,9 @@ var VideoGeneratorPanel = ({
27671
28111
  if (err instanceof Error && err.name === "AbortError") {
27672
28112
  setGenStatus("idle");
27673
28113
  } else {
27674
- setGenerateError(err instanceof Error ? err.message : "Generation failed");
28114
+ setGenerateError(
28115
+ err instanceof Error ? err.message : "Generation failed"
28116
+ );
27675
28117
  setGenStatus("error");
27676
28118
  }
27677
28119
  } finally {
@@ -27743,9 +28185,36 @@ var VideoGeneratorPanel = ({
27743
28185
  const durationMax = cfgDuration.maxDuration ?? 15;
27744
28186
  const currentDuration = selectedDuration ?? (isDurationChoices ? durationChoices[0] : durationMin);
27745
28187
  return /* @__PURE__ */ jsxs51(Fragment15, { children: [
27746
- /* @__PURE__ */ jsx94("input", { ref: firstFrameInputRef, type: "file", accept: "image/*", onChange: handleFrameUpload("first"), style: { display: "none" } }),
27747
- /* @__PURE__ */ jsx94("input", { ref: lastFrameInputRef, type: "file", accept: "image/*", onChange: handleFrameUpload("last"), style: { display: "none" } }),
27748
- /* @__PURE__ */ jsx94("input", { ref: inputRefUploadRef, type: "file", accept: "image/*", onChange: handleRefUpload, style: { display: "none" } }),
28188
+ /* @__PURE__ */ jsx94(
28189
+ "input",
28190
+ {
28191
+ ref: firstFrameInputRef,
28192
+ type: "file",
28193
+ accept: "image/*",
28194
+ onChange: handleFrameUpload("first"),
28195
+ style: { display: "none" }
28196
+ }
28197
+ ),
28198
+ /* @__PURE__ */ jsx94(
28199
+ "input",
28200
+ {
28201
+ ref: lastFrameInputRef,
28202
+ type: "file",
28203
+ accept: "image/*",
28204
+ onChange: handleFrameUpload("last"),
28205
+ style: { display: "none" }
28206
+ }
28207
+ ),
28208
+ /* @__PURE__ */ jsx94(
28209
+ "input",
28210
+ {
28211
+ ref: inputRefUploadRef,
28212
+ type: "file",
28213
+ accept: "image/*",
28214
+ onChange: handleRefUpload,
28215
+ style: { display: "none" }
28216
+ }
28217
+ ),
27749
28218
  isGenerating && /* @__PURE__ */ jsx94(
27750
28219
  "div",
27751
28220
  {
@@ -27827,22 +28296,32 @@ var VideoGeneratorPanel = ({
27827
28296
  ))
27828
28297
  ] }),
27829
28298
  showRefChips && /* @__PURE__ */ jsxs51("div", { className: "vgp-chips-row", children: [
27830
- inputReferences.map((ref, i) => /* @__PURE__ */ jsxs51("div", { className: "vgp-chip vgp-chip--set", title: `Reference ${i + 1}`, children: [
27831
- /* @__PURE__ */ jsx94("img", { src: ref, alt: "", className: "vgp-chip-thumb" }),
27832
- /* @__PURE__ */ jsxs51("span", { className: "vgp-chip-label", children: [
27833
- "Ref ",
27834
- i + 1
27835
- ] }),
27836
- /* @__PURE__ */ jsx94(
27837
- "button",
27838
- {
27839
- className: "vgp-chip-remove",
27840
- onClick: () => setInputReferences((prev) => prev.filter((_, j) => j !== i)),
27841
- disabled: isGenerating,
27842
- children: /* @__PURE__ */ jsx94(X2, { size: 9 })
27843
- }
27844
- )
27845
- ] }, i)),
28299
+ inputReferences.map((ref, i) => /* @__PURE__ */ jsxs51(
28300
+ "div",
28301
+ {
28302
+ className: "vgp-chip vgp-chip--set",
28303
+ title: `Reference ${i + 1}`,
28304
+ children: [
28305
+ /* @__PURE__ */ jsx94("img", { src: ref, alt: "", className: "vgp-chip-thumb" }),
28306
+ /* @__PURE__ */ jsxs51("span", { className: "vgp-chip-label", children: [
28307
+ "Ref ",
28308
+ i + 1
28309
+ ] }),
28310
+ /* @__PURE__ */ jsx94(
28311
+ "button",
28312
+ {
28313
+ className: "vgp-chip-remove",
28314
+ onClick: () => setInputReferences(
28315
+ (prev) => prev.filter((_, j) => j !== i)
28316
+ ),
28317
+ disabled: isGenerating,
28318
+ children: /* @__PURE__ */ jsx94(X2, { size: 9 })
28319
+ }
28320
+ )
28321
+ ]
28322
+ },
28323
+ i
28324
+ )),
27846
28325
  inputReferences.length < 3 && /* @__PURE__ */ jsxs51(
27847
28326
  "button",
27848
28327
  {
@@ -27868,7 +28347,13 @@ var VideoGeneratorPanel = ({
27868
28347
  isGenerating && /* @__PURE__ */ jsxs51("div", { className: "vgp-status", children: [
27869
28348
  /* @__PURE__ */ jsx94(SpinnerIcon3, {}),
27870
28349
  /* @__PURE__ */ jsx94("span", { className: "vgp-status-text", children: genStatus === "submitting" ? "Submitting\u2026" : progress > 0 ? `Generating\u2026 ${Math.round(progress * 100)}%` : "Generating\u2026" }),
27871
- progress > 0 && /* @__PURE__ */ jsx94("div", { className: "vgp-progress-wrap", children: /* @__PURE__ */ jsx94("div", { className: "vgp-progress-bar", style: { width: `${Math.round(progress * 100)}%` } }) })
28350
+ progress > 0 && /* @__PURE__ */ jsx94("div", { className: "vgp-progress-wrap", children: /* @__PURE__ */ jsx94(
28351
+ "div",
28352
+ {
28353
+ className: "vgp-progress-bar",
28354
+ style: { width: `${Math.round(progress * 100)}%` }
28355
+ }
28356
+ ) })
27872
28357
  ] }),
27873
28358
  /* @__PURE__ */ jsxs51(PromptInputActions, { className: "vgp-actions", children: [
27874
28359
  /* @__PURE__ */ jsxs51("div", { className: "vgp-actions-left", children: [
@@ -27944,10 +28429,17 @@ var VideoGeneratorPanel = ({
27944
28429
  ]
27945
28430
  }
27946
28431
  ),
27947
- frameTypeOpen && /* @__PURE__ */ jsx94("div", { className: "vgp-dropdown vgp-dropdown--up vgp-dropdown--left", children: /* @__PURE__ */ jsxs51("button", { className: "vgp-dropdown-item", onClick: () => setFrameTypeOpen(false), children: [
27948
- /* @__PURE__ */ jsx94("span", { style: { flex: 1 }, children: frameTypeLabel }),
27949
- /* @__PURE__ */ jsx94("span", { className: "vgp-check", children: /* @__PURE__ */ jsx94(CheckIcon4, {}) })
27950
- ] }) })
28432
+ frameTypeOpen && /* @__PURE__ */ jsx94("div", { className: "vgp-dropdown vgp-dropdown--up vgp-dropdown--left", children: /* @__PURE__ */ jsxs51(
28433
+ "button",
28434
+ {
28435
+ className: "vgp-dropdown-item",
28436
+ onClick: () => setFrameTypeOpen(false),
28437
+ children: [
28438
+ /* @__PURE__ */ jsx94("span", { style: { flex: 1 }, children: frameTypeLabel }),
28439
+ /* @__PURE__ */ jsx94("span", { className: "vgp-check", children: /* @__PURE__ */ jsx94(CheckIcon4, {}) })
28440
+ ]
28441
+ }
28442
+ ) })
27951
28443
  ] }),
27952
28444
  /* @__PURE__ */ jsxs51("div", { className: "vgp-dropdown-root", ref: cameraDropdownRef, children: [
27953
28445
  /* @__PURE__ */ jsxs51(
@@ -27976,7 +28468,13 @@ var VideoGeneratorPanel = ({
27976
28468
  onClick: () => {
27977
28469
  setCameraMovement(null);
27978
28470
  setCameraOpen(false);
27979
- persistSettings({ model: selectedModel, ratio: selectedRatio, resolution: selectedResolution, duration: selectedDuration, cameraMovement: void 0 });
28471
+ persistSettings({
28472
+ model: selectedModel,
28473
+ ratio: selectedRatio,
28474
+ resolution: selectedResolution,
28475
+ duration: selectedDuration,
28476
+ cameraMovement: void 0
28477
+ });
27980
28478
  },
27981
28479
  children: [
27982
28480
  /* @__PURE__ */ jsx94("span", { style: { flex: 1 }, children: "None" }),
@@ -27992,7 +28490,13 @@ var VideoGeneratorPanel = ({
27992
28490
  onClick: () => {
27993
28491
  setCameraMovement(label);
27994
28492
  setCameraOpen(false);
27995
- persistSettings({ model: selectedModel, ratio: selectedRatio, resolution: selectedResolution, duration: selectedDuration, cameraMovement: label });
28493
+ persistSettings({
28494
+ model: selectedModel,
28495
+ ratio: selectedRatio,
28496
+ resolution: selectedResolution,
28497
+ duration: selectedDuration,
28498
+ cameraMovement: label
28499
+ });
27996
28500
  },
27997
28501
  children: [
27998
28502
  /* @__PURE__ */ jsx94("span", { style: { flex: 1 }, children: label }),
@@ -28031,7 +28535,12 @@ var VideoGeneratorPanel = ({
28031
28535
  className: `vgp-pill${selectedResolution === res ? " vgp-pill--active" : ""}`,
28032
28536
  onClick: () => {
28033
28537
  setSelectedResolution(res);
28034
- persistSettings({ model: selectedModel, ratio: selectedRatio, resolution: res, duration: selectedDuration });
28538
+ persistSettings({
28539
+ model: selectedModel,
28540
+ ratio: selectedRatio,
28541
+ resolution: res,
28542
+ duration: selectedDuration
28543
+ });
28035
28544
  },
28036
28545
  children: res
28037
28546
  },
@@ -28046,7 +28555,12 @@ var VideoGeneratorPanel = ({
28046
28555
  className: `vgp-pill vgp-pill--ratio${selectedRatio === r ? " vgp-pill--active" : ""}`,
28047
28556
  onClick: () => {
28048
28557
  setSelectedRatio(r);
28049
- persistSettings({ model: selectedModel, ratio: r, resolution: selectedResolution, duration: selectedDuration });
28558
+ persistSettings({
28559
+ model: selectedModel,
28560
+ ratio: r,
28561
+ resolution: selectedResolution,
28562
+ duration: selectedDuration
28563
+ });
28050
28564
  applyRatioResize(r);
28051
28565
  },
28052
28566
  children: [
@@ -28065,7 +28579,12 @@ var VideoGeneratorPanel = ({
28065
28579
  className: `vgp-pill${currentDuration === v ? " vgp-pill--active" : ""}`,
28066
28580
  onClick: () => {
28067
28581
  setSelectedDuration(v);
28068
- persistSettings({ model: selectedModel, ratio: selectedRatio, resolution: selectedResolution, duration: v });
28582
+ persistSettings({
28583
+ model: selectedModel,
28584
+ ratio: selectedRatio,
28585
+ resolution: selectedResolution,
28586
+ duration: v
28587
+ });
28069
28588
  },
28070
28589
  children: [
28071
28590
  v,
@@ -28094,7 +28613,12 @@ var VideoGeneratorPanel = ({
28094
28613
  onChange: (e) => {
28095
28614
  const v = Number(e.target.value);
28096
28615
  setSelectedDuration(v);
28097
- persistSettings({ model: selectedModel, ratio: selectedRatio, resolution: selectedResolution, duration: v });
28616
+ persistSettings({
28617
+ model: selectedModel,
28618
+ ratio: selectedRatio,
28619
+ resolution: selectedResolution,
28620
+ duration: v
28621
+ });
28098
28622
  }
28099
28623
  }
28100
28624
  )
@@ -28106,7 +28630,18 @@ var VideoGeneratorPanel = ({
28106
28630
  {
28107
28631
  className: "vgp-toggle-btn",
28108
28632
  onClick: () => setGenerateAudio((v) => !v),
28109
- children: /* @__PURE__ */ jsx94("div", { className: `vgp-toggle-track${generateAudio ? " vgp-toggle-track--on" : ""}`, children: /* @__PURE__ */ jsx94("div", { className: `vgp-toggle-thumb${generateAudio ? " vgp-toggle-thumb--on" : ""}` }) })
28633
+ children: /* @__PURE__ */ jsx94(
28634
+ "div",
28635
+ {
28636
+ className: `vgp-toggle-track${generateAudio ? " vgp-toggle-track--on" : ""}`,
28637
+ children: /* @__PURE__ */ jsx94(
28638
+ "div",
28639
+ {
28640
+ className: `vgp-toggle-thumb${generateAudio ? " vgp-toggle-thumb--on" : ""}`
28641
+ }
28642
+ )
28643
+ }
28644
+ )
28110
28645
  }
28111
28646
  )
28112
28647
  ] }),
@@ -28142,7 +28677,9 @@ var VideoGeneratorPanel = ({
28142
28677
  min: 0,
28143
28678
  onChange: (e) => {
28144
28679
  const v = e.target.value;
28145
- setSeed(v === "" ? void 0 : Math.max(0, parseInt(v, 10)));
28680
+ setSeed(
28681
+ v === "" ? void 0 : Math.max(0, parseInt(v, 10))
28682
+ );
28146
28683
  }
28147
28684
  }
28148
28685
  )
@@ -28184,7 +28721,12 @@ var VideoGeneratorPanel = ({
28184
28721
  className: "vgp-dropdown-item",
28185
28722
  onClick: () => {
28186
28723
  setSelectedModel(m);
28187
- persistSettings({ model: m, ratio: selectedRatio, resolution: selectedResolution, duration: selectedDuration });
28724
+ persistSettings({
28725
+ model: m,
28726
+ ratio: selectedRatio,
28727
+ resolution: selectedResolution,
28728
+ duration: selectedDuration
28729
+ });
28188
28730
  setModelOpen(false);
28189
28731
  },
28190
28732
  children: [
@@ -29467,7 +30009,7 @@ var isRenderThrottlingEnabled = (() => {
29467
30009
  // wysiwyg/textWysiwyg.tsx
29468
30010
  import {
29469
30011
  CODES as CODES12,
29470
- KEYS as KEYS44,
30012
+ KEYS as KEYS45,
29471
30013
  CLASSES as CLASSES7,
29472
30014
  POINTER_BUTTON,
29473
30015
  THEME as THEME11,
@@ -29782,7 +30324,7 @@ var textWysiwyg = ({
29782
30324
  app.actionManager.executeAction(actionDecreaseFontSize);
29783
30325
  } else if (actionIncreaseFontSize.keyTest(event)) {
29784
30326
  app.actionManager.executeAction(actionIncreaseFontSize);
29785
- } else if (event.key === KEYS44.ESCAPE) {
30327
+ } else if (event.key === KEYS45.ESCAPE) {
29786
30328
  event.preventDefault();
29787
30329
  submittedViaKeyboard = true;
29788
30330
  handleSubmit();
@@ -29790,14 +30332,14 @@ var textWysiwyg = ({
29790
30332
  event.preventDefault();
29791
30333
  handleSubmit();
29792
30334
  app.actionManager.executeAction(actionSaveToActiveFile);
29793
- } else if (event.key === KEYS44.ENTER && event[KEYS44.CTRL_OR_CMD]) {
30335
+ } else if (event.key === KEYS45.ENTER && event[KEYS45.CTRL_OR_CMD]) {
29794
30336
  event.preventDefault();
29795
30337
  if (event.isComposing || event.keyCode === 229) {
29796
30338
  return;
29797
30339
  }
29798
30340
  submittedViaKeyboard = true;
29799
30341
  handleSubmit();
29800
- } else if (event.key === KEYS44.TAB || event[KEYS44.CTRL_OR_CMD] && (event.code === CODES12.BRACKET_LEFT || event.code === CODES12.BRACKET_RIGHT)) {
30342
+ } else if (event.key === KEYS45.TAB || event[KEYS45.CTRL_OR_CMD] && (event.code === CODES12.BRACKET_LEFT || event.code === CODES12.BRACKET_RIGHT)) {
29801
30343
  event.preventDefault();
29802
30344
  if (event.isComposing) {
29803
30345
  return;
@@ -30639,7 +31181,7 @@ import React43 from "react";
30639
31181
  // components/Popover.tsx
30640
31182
  import { useLayoutEffect as useLayoutEffect5, useRef as useRef31, useEffect as useEffect38 } from "react";
30641
31183
  import { unstable_batchedUpdates as unstable_batchedUpdates2 } from "react-dom";
30642
- import { KEYS as KEYS45, queryFocusableElements as queryFocusableElements2 } from "@orangecatai/common";
31184
+ import { KEYS as KEYS46, queryFocusableElements as queryFocusableElements2 } from "@orangecatai/common";
30643
31185
  import clsx38 from "clsx";
30644
31186
  import { jsx as jsx98 } from "react/jsx-runtime";
30645
31187
  var Popover8 = ({
@@ -30664,7 +31206,7 @@ var Popover8 = ({
30664
31206
  container.focus();
30665
31207
  }
30666
31208
  const handleKeyDown = (event) => {
30667
- if (event.key === KEYS45.TAB) {
31209
+ if (event.key === KEYS46.TAB) {
30668
31210
  const focusableElements = queryFocusableElements2(container);
30669
31211
  const { activeElement } = document;
30670
31212
  const currentIndex = focusableElements.findIndex(
@@ -30965,11 +31507,11 @@ var LockButton = (props) => {
30965
31507
  // components/MobileToolBar.tsx
30966
31508
  import { useState as useState37, useEffect as useEffect40 } from "react";
30967
31509
  import clsx43 from "clsx";
30968
- import { KEYS as KEYS47, capitalizeString as capitalizeString4 } from "@orangecatai/common";
31510
+ import { KEYS as KEYS48, capitalizeString as capitalizeString4 } from "@orangecatai/common";
30969
31511
 
30970
31512
  // components/HandButton.tsx
30971
31513
  import clsx42 from "clsx";
30972
- import { KEYS as KEYS46 } from "@orangecatai/common";
31514
+ import { KEYS as KEYS47 } from "@orangecatai/common";
30973
31515
  import { jsx as jsx103 } from "react/jsx-runtime";
30974
31516
  var HandButton = (props) => {
30975
31517
  return /* @__PURE__ */ jsx103(
@@ -30981,9 +31523,9 @@ var HandButton = (props) => {
30981
31523
  name: "editor-current-shape",
30982
31524
  checked: props.checked,
30983
31525
  title: `${props.title} \u2014 H`,
30984
- keyBindingLabel: !props.isMobile ? KEYS46.H.toLocaleUpperCase() : void 0,
31526
+ keyBindingLabel: !props.isMobile ? KEYS47.H.toLocaleUpperCase() : void 0,
30985
31527
  "aria-label": `${props.title} \u2014 H`,
30986
- "aria-keyshortcuts": KEYS46.H,
31528
+ "aria-keyshortcuts": KEYS47.H,
30987
31529
  "data-testid": `toolbar-hand`,
30988
31530
  onChange: () => props.onChange?.()
30989
31531
  }
@@ -31301,7 +31843,7 @@ var MobileToolBar = ({
31301
31843
  {
31302
31844
  onSelect: () => app.setActiveTool({ type: "text" }),
31303
31845
  icon: TextIcon,
31304
- shortcut: KEYS47.T.toLocaleUpperCase(),
31846
+ shortcut: KEYS48.T.toLocaleUpperCase(),
31305
31847
  "data-testid": "toolbar-text",
31306
31848
  selected: activeTool.type === "text",
31307
31849
  children: t("toolBar.text")
@@ -31322,7 +31864,7 @@ var MobileToolBar = ({
31322
31864
  {
31323
31865
  onSelect: () => app.setActiveTool({ type: "frame" }),
31324
31866
  icon: frameToolIcon,
31325
- shortcut: KEYS47.F.toLocaleUpperCase(),
31867
+ shortcut: KEYS48.F.toLocaleUpperCase(),
31326
31868
  "data-testid": "toolbar-frame",
31327
31869
  selected: frameToolSelected,
31328
31870
  children: t("toolBar.frame")
@@ -31345,7 +31887,7 @@ var MobileToolBar = ({
31345
31887
  icon: laserPointerToolIcon,
31346
31888
  "data-testid": "toolbar-laser",
31347
31889
  selected: laserToolSelected,
31348
- shortcut: KEYS47.K.toLocaleUpperCase(),
31890
+ shortcut: KEYS48.K.toLocaleUpperCase(),
31349
31891
  children: t("toolBar.laser")
31350
31892
  }
31351
31893
  ),
@@ -32547,7 +33089,7 @@ import {
32547
33089
  CLASSES as CLASSES8,
32548
33090
  EVENT as EVENT10,
32549
33091
  isDevEnv as isDevEnv7,
32550
- KEYS as KEYS48,
33092
+ KEYS as KEYS49,
32551
33093
  updateObject
32552
33094
  } from "@orangecatai/common";
32553
33095
 
@@ -32787,7 +33329,7 @@ var SidebarInner = forwardRef6(
32787
33329
  );
32788
33330
  useEffect43(() => {
32789
33331
  const handleKeyDown = (event) => {
32790
- if (event.key === KEYS48.ESCAPE && (!docked || !editorInterface.canFitSidebar)) {
33332
+ if (event.key === KEYS49.ESCAPE && (!docked || !editorInterface.canFitSidebar)) {
32791
33333
  closeLibrary();
32792
33334
  }
32793
33335
  };
@@ -33748,7 +34290,7 @@ import {
33748
34290
  import { isElementCompletelyInViewport } from "@orangecatai/element";
33749
34291
  import { measureText as measureText5 } from "@orangecatai/element";
33750
34292
  import {
33751
- KEYS as KEYS49,
34293
+ KEYS as KEYS50,
33752
34294
  randomInteger as randomInteger3,
33753
34295
  addEventListener as addEventListener2,
33754
34296
  getFontString as getFontString8
@@ -33921,7 +34463,7 @@ var SearchMenu2 = () => {
33921
34463
  });
33922
34464
  useEffect44(() => {
33923
34465
  const eventHandler = (event) => {
33924
- if (event.key === KEYS49.ESCAPE && !app.state.openDialog && !app.state.openPopup) {
34466
+ if (event.key === KEYS50.ESCAPE && !app.state.openDialog && !app.state.openPopup) {
33925
34467
  event.preventDefault();
33926
34468
  event.stopPropagation();
33927
34469
  setAppState({
@@ -33929,7 +34471,7 @@ var SearchMenu2 = () => {
33929
34471
  });
33930
34472
  return;
33931
34473
  }
33932
- if (event[KEYS49.CTRL_OR_CMD] && event.key === KEYS49.F) {
34474
+ if (event[KEYS50.CTRL_OR_CMD] && event.key === KEYS50.F) {
33933
34475
  event.preventDefault();
33934
34476
  event.stopPropagation();
33935
34477
  if (app.state.openDialog) {
@@ -33947,14 +34489,14 @@ var SearchMenu2 = () => {
33947
34489
  }
33948
34490
  if (event.target instanceof HTMLElement && event.target.closest(".layer-ui__search")) {
33949
34491
  if (stableState.searchMatches.items.length) {
33950
- if (event.key === KEYS49.ENTER) {
34492
+ if (event.key === KEYS50.ENTER) {
33951
34493
  event.stopPropagation();
33952
34494
  stableState.goToNextItem();
33953
34495
  }
33954
- if (event.key === KEYS49.ARROW_UP) {
34496
+ if (event.key === KEYS50.ARROW_UP) {
33955
34497
  event.stopPropagation();
33956
34498
  stableState.goToPreviousItem();
33957
- } else if (event.key === KEYS49.ARROW_DOWN) {
34499
+ } else if (event.key === KEYS50.ARROW_DOWN) {
33958
34500
  event.stopPropagation();
33959
34501
  stableState.goToNextItem();
33960
34502
  }
@@ -34431,7 +34973,7 @@ import { EDITOR_LS_KEYS as EDITOR_LS_KEYS3, debounce as debounce3, isDevEnv as i
34431
34973
 
34432
34974
  // components/TTDDialog/TTDDialogInput.tsx
34433
34975
  import { useEffect as useEffect45, useRef as useRef38 } from "react";
34434
- import { EVENT as EVENT12, KEYS as KEYS50 } from "@orangecatai/common";
34976
+ import { EVENT as EVENT12, KEYS as KEYS51 } from "@orangecatai/common";
34435
34977
  import { jsx as jsx132 } from "react/jsx-runtime";
34436
34978
  var TTDDialogInput = ({
34437
34979
  input,
@@ -34449,7 +34991,7 @@ var TTDDialogInput = ({
34449
34991
  const textarea = ref.current;
34450
34992
  if (textarea) {
34451
34993
  const handleKeyDown = (event) => {
34452
- if (event[KEYS50.CTRL_OR_CMD] && event.key === KEYS50.ENTER) {
34994
+ if (event[KEYS51.CTRL_OR_CMD] && event.key === KEYS51.ENTER) {
34453
34995
  event.preventDefault();
34454
34996
  callbackRef.current?.();
34455
34997
  }
@@ -34840,7 +35382,7 @@ import { useRef as useRef44 } from "react";
34840
35382
 
34841
35383
  // components/TTDDialog/Chat/ChatInterface.tsx
34842
35384
  import { useRef as useRef40, useEffect as useEffect48, useLayoutEffect as useLayoutEffect10 } from "react";
34843
- import { KEYS as KEYS51 } from "@orangecatai/common";
35385
+ import { KEYS as KEYS52 } from "@orangecatai/common";
34844
35386
 
34845
35387
  // components/TTDDialog/TTDWelcomeMessage.tsx
34846
35388
  import { jsx as jsx138, jsxs as jsxs83 } from "react/jsx-runtime";
@@ -35053,7 +35595,7 @@ var ChatInterface = ({
35053
35595
  onPromptChange("");
35054
35596
  };
35055
35597
  const handleKeyDown = (event) => {
35056
- if (event.key === KEYS51.ENTER && !event.shiftKey) {
35598
+ if (event.key === KEYS52.ENTER && !event.shiftKey) {
35057
35599
  event.preventDefault();
35058
35600
  if (!isGenerating) {
35059
35601
  handleSubmit();
@@ -36403,9 +36945,9 @@ import { updateBindings as updateBindings3 } from "@orangecatai/element";
36403
36945
  // components/Stats/DragInput.tsx
36404
36946
  import clsx60 from "clsx";
36405
36947
  import { useEffect as useEffect52, useRef as useRef46, useState as useState48 } from "react";
36406
- import { EVENT as EVENT13, KEYS as KEYS52, cloneJSON as cloneJSON3 } from "@orangecatai/common";
36948
+ import { EVENT as EVENT13, KEYS as KEYS53, cloneJSON as cloneJSON3 } from "@orangecatai/common";
36407
36949
  import { deepCopyElement as deepCopyElement4 } from "@orangecatai/element";
36408
- import { CaptureUpdateAction as CaptureUpdateAction38 } from "@orangecatai/element";
36950
+ import { CaptureUpdateAction as CaptureUpdateAction39 } from "@orangecatai/element";
36409
36951
 
36410
36952
  // components/Stats/utils.ts
36411
36953
  import { pointFrom as pointFrom23, pointRotateRads as pointRotateRads16 } from "@orangecatai/math";
@@ -36615,7 +37157,7 @@ var StatsDragInput = ({
36615
37157
  setAppState
36616
37158
  });
36617
37159
  app.syncActionResult({
36618
- captureUpdate: CaptureUpdateAction38.IMMEDIATELY
37160
+ captureUpdate: CaptureUpdateAction39.IMMEDIATELY
36619
37161
  });
36620
37162
  }
36621
37163
  };
@@ -36723,7 +37265,7 @@ var StatsDragInput = ({
36723
37265
  false
36724
37266
  );
36725
37267
  app.syncActionResult({
36726
- captureUpdate: CaptureUpdateAction38.IMMEDIATELY
37268
+ captureUpdate: CaptureUpdateAction39.IMMEDIATELY
36727
37269
  });
36728
37270
  dragFinishedCallback?.({
36729
37271
  app,
@@ -36762,7 +37304,7 @@ var StatsDragInput = ({
36762
37304
  onKeyDown: (event) => {
36763
37305
  if (editable) {
36764
37306
  const eventTarget = event.target;
36765
- if (eventTarget instanceof HTMLInputElement && event.key === KEYS52.ENTER) {
37307
+ if (eventTarget instanceof HTMLInputElement && event.key === KEYS53.ENTER) {
36766
37308
  handleInputValue(eventTarget.value, elements, appState);
36767
37309
  app.focusContainer();
36768
37310
  }
@@ -38493,7 +39035,7 @@ var StatsInner = memo5(
38493
39035
 
38494
39036
  // components/ElementLinkDialog.tsx
38495
39037
  import { useCallback as useCallback26, useEffect as useEffect54, useState as useState50 } from "react";
38496
- import { normalizeLink as normalizeLink2, KEYS as KEYS53 } from "@orangecatai/common";
39038
+ import { normalizeLink as normalizeLink2, KEYS as KEYS54 } from "@orangecatai/common";
38497
39039
  import {
38498
39040
  defaultGetElementLinkFromSelection as defaultGetElementLinkFromSelection2,
38499
39041
  getLinkIdAndTypeFromSelection as getLinkIdAndTypeFromSelection2
@@ -38549,10 +39091,10 @@ var ElementLinkDialog = ({
38549
39091
  }, [sourceElementId, nextLink, elementsMap, linkEdited, scene, onClose]);
38550
39092
  useEffect54(() => {
38551
39093
  const handleKeyDown = (event) => {
38552
- if (appState.openDialog?.name === "elementLinkSelector" && event.key === KEYS53.ENTER) {
39094
+ if (appState.openDialog?.name === "elementLinkSelector" && event.key === KEYS54.ENTER) {
38553
39095
  handleConfirm();
38554
39096
  }
38555
- if (appState.openDialog?.name === "elementLinkSelector" && event.key === KEYS53.ESCAPE) {
39097
+ if (appState.openDialog?.name === "elementLinkSelector" && event.key === KEYS54.ESCAPE) {
38556
39098
  onClose?.();
38557
39099
  }
38558
39100
  };
@@ -38578,7 +39120,7 @@ var ElementLinkDialog = ({
38578
39120
  setNextLink(value);
38579
39121
  },
38580
39122
  onKeyDown: (event) => {
38581
- if (event.key === KEYS53.ENTER) {
39123
+ if (event.key === KEYS54.ENTER) {
38582
39124
  handleConfirm();
38583
39125
  }
38584
39126
  },
@@ -38658,7 +39200,7 @@ var ErrorDialog = ({
38658
39200
  // components/HelpDialog.tsx
38659
39201
  import React54 from "react";
38660
39202
  import { isDarwin as isDarwin4, isFirefox as isFirefox3, isWindows as isWindows2 } from "@orangecatai/common";
38661
- import { KEYS as KEYS54 } from "@orangecatai/common";
39203
+ import { KEYS as KEYS55 } from "@orangecatai/common";
38662
39204
  import { Fragment as Fragment32, jsx as jsx163, jsxs as jsxs93 } from "react/jsx-runtime";
38663
39205
  var Header = () => /* @__PURE__ */ jsxs93("div", { className: "HelpDialog__header", children: [
38664
39206
  /* @__PURE__ */ jsxs93(
@@ -38771,78 +39313,78 @@ var HelpDialog = ({ onClose }) => {
38771
39313
  className: "HelpDialog__island--tools",
38772
39314
  caption: t("helpDialog.tools"),
38773
39315
  children: [
38774
- /* @__PURE__ */ jsx163(Shortcut, { label: t("toolBar.hand"), shortcuts: [KEYS54.H] }),
39316
+ /* @__PURE__ */ jsx163(Shortcut, { label: t("toolBar.hand"), shortcuts: [KEYS55.H] }),
38775
39317
  /* @__PURE__ */ jsx163(
38776
39318
  Shortcut,
38777
39319
  {
38778
39320
  label: t("toolBar.selection"),
38779
- shortcuts: [KEYS54.V, KEYS54["1"]]
39321
+ shortcuts: [KEYS55.V, KEYS55["1"]]
38780
39322
  }
38781
39323
  ),
38782
39324
  /* @__PURE__ */ jsx163(
38783
39325
  Shortcut,
38784
39326
  {
38785
39327
  label: t("toolBar.rectangle"),
38786
- shortcuts: [KEYS54.R, KEYS54["2"]]
39328
+ shortcuts: [KEYS55.R, KEYS55["2"]]
38787
39329
  }
38788
39330
  ),
38789
39331
  /* @__PURE__ */ jsx163(
38790
39332
  Shortcut,
38791
39333
  {
38792
39334
  label: t("toolBar.diamond"),
38793
- shortcuts: [KEYS54.D, KEYS54["3"]]
39335
+ shortcuts: [KEYS55.D, KEYS55["3"]]
38794
39336
  }
38795
39337
  ),
38796
39338
  /* @__PURE__ */ jsx163(
38797
39339
  Shortcut,
38798
39340
  {
38799
39341
  label: t("toolBar.ellipse"),
38800
- shortcuts: [KEYS54.O, KEYS54["4"]]
39342
+ shortcuts: [KEYS55.O, KEYS55["4"]]
38801
39343
  }
38802
39344
  ),
38803
39345
  /* @__PURE__ */ jsx163(
38804
39346
  Shortcut,
38805
39347
  {
38806
39348
  label: t("toolBar.arrow"),
38807
- shortcuts: [KEYS54.A, KEYS54["5"]]
39349
+ shortcuts: [KEYS55.A, KEYS55["5"]]
38808
39350
  }
38809
39351
  ),
38810
39352
  /* @__PURE__ */ jsx163(
38811
39353
  Shortcut,
38812
39354
  {
38813
39355
  label: t("toolBar.line"),
38814
- shortcuts: [KEYS54.L, KEYS54["6"]]
39356
+ shortcuts: [KEYS55.L, KEYS55["6"]]
38815
39357
  }
38816
39358
  ),
38817
39359
  /* @__PURE__ */ jsx163(
38818
39360
  Shortcut,
38819
39361
  {
38820
39362
  label: t("toolBar.freedraw"),
38821
- shortcuts: [KEYS54.P, KEYS54["7"]]
39363
+ shortcuts: [KEYS55.P, KEYS55["7"]]
38822
39364
  }
38823
39365
  ),
38824
39366
  /* @__PURE__ */ jsx163(
38825
39367
  Shortcut,
38826
39368
  {
38827
39369
  label: t("toolBar.text"),
38828
- shortcuts: [KEYS54.T, KEYS54["8"]]
39370
+ shortcuts: [KEYS55.T, KEYS55["8"]]
38829
39371
  }
38830
39372
  ),
38831
- /* @__PURE__ */ jsx163(Shortcut, { label: t("toolBar.image"), shortcuts: [KEYS54["9"]] }),
39373
+ /* @__PURE__ */ jsx163(Shortcut, { label: t("toolBar.image"), shortcuts: [KEYS55["9"]] }),
38832
39374
  /* @__PURE__ */ jsx163(
38833
39375
  Shortcut,
38834
39376
  {
38835
39377
  label: t("toolBar.eraser"),
38836
- shortcuts: [KEYS54.E, KEYS54["0"]]
39378
+ shortcuts: [KEYS55.E, KEYS55["0"]]
38837
39379
  }
38838
39380
  ),
38839
- /* @__PURE__ */ jsx163(Shortcut, { label: t("toolBar.frame"), shortcuts: [KEYS54.F] }),
38840
- /* @__PURE__ */ jsx163(Shortcut, { label: t("toolBar.laser"), shortcuts: [KEYS54.K] }),
39381
+ /* @__PURE__ */ jsx163(Shortcut, { label: t("toolBar.frame"), shortcuts: [KEYS55.F] }),
39382
+ /* @__PURE__ */ jsx163(Shortcut, { label: t("toolBar.laser"), shortcuts: [KEYS55.K] }),
38841
39383
  /* @__PURE__ */ jsx163(
38842
39384
  Shortcut,
38843
39385
  {
38844
39386
  label: t("labels.eyeDropper"),
38845
- shortcuts: [KEYS54.I, "Shift+S", "Shift+G"]
39387
+ shortcuts: [KEYS55.I, "Shift+S", "Shift+G"]
38846
39388
  }
38847
39389
  ),
38848
39390
  /* @__PURE__ */ jsx163(
@@ -38921,7 +39463,7 @@ var HelpDialog = ({ onClose }) => {
38921
39463
  isOr: true
38922
39464
  }
38923
39465
  ),
38924
- /* @__PURE__ */ jsx163(Shortcut, { label: t("toolBar.lock"), shortcuts: [KEYS54.Q] }),
39466
+ /* @__PURE__ */ jsx163(Shortcut, { label: t("toolBar.lock"), shortcuts: [KEYS55.Q] }),
38925
39467
  /* @__PURE__ */ jsx163(
38926
39468
  Shortcut,
38927
39469
  {
@@ -40662,40 +41204,108 @@ var PauseIcon = () => /* @__PURE__ */ jsxs99("svg", { width: "15", height: "15",
40662
41204
  ] });
40663
41205
  var VolumeIcon = ({ level }) => {
40664
41206
  if (level === 0) {
40665
- return /* @__PURE__ */ jsxs99("svg", { width: "15", height: "15", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
40666
- /* @__PURE__ */ jsx172("polygon", { points: "11 5 6 9 2 9 2 15 6 15 11 19 11 5" }),
40667
- /* @__PURE__ */ jsx172("line", { x1: "23", y1: "9", x2: "17", y2: "15" }),
40668
- /* @__PURE__ */ jsx172("line", { x1: "17", y1: "9", x2: "23", y2: "15" })
40669
- ] });
41207
+ return /* @__PURE__ */ jsxs99(
41208
+ "svg",
41209
+ {
41210
+ width: "15",
41211
+ height: "15",
41212
+ viewBox: "0 0 24 24",
41213
+ fill: "none",
41214
+ stroke: "currentColor",
41215
+ strokeWidth: "2",
41216
+ strokeLinecap: "round",
41217
+ strokeLinejoin: "round",
41218
+ children: [
41219
+ /* @__PURE__ */ jsx172("polygon", { points: "11 5 6 9 2 9 2 15 6 15 11 19 11 5" }),
41220
+ /* @__PURE__ */ jsx172("line", { x1: "23", y1: "9", x2: "17", y2: "15" }),
41221
+ /* @__PURE__ */ jsx172("line", { x1: "17", y1: "9", x2: "23", y2: "15" })
41222
+ ]
41223
+ }
41224
+ );
40670
41225
  }
40671
41226
  if (level < 0.5) {
40672
- return /* @__PURE__ */ jsxs99("svg", { width: "15", height: "15", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
40673
- /* @__PURE__ */ jsx172("polygon", { points: "11 5 6 9 2 9 2 15 6 15 11 19 11 5" }),
40674
- /* @__PURE__ */ jsx172("path", { d: "M15.54 8.46a5 5 0 0 1 0 7.07" })
40675
- ] });
41227
+ return /* @__PURE__ */ jsxs99(
41228
+ "svg",
41229
+ {
41230
+ width: "15",
41231
+ height: "15",
41232
+ viewBox: "0 0 24 24",
41233
+ fill: "none",
41234
+ stroke: "currentColor",
41235
+ strokeWidth: "2",
41236
+ strokeLinecap: "round",
41237
+ strokeLinejoin: "round",
41238
+ children: [
41239
+ /* @__PURE__ */ jsx172("polygon", { points: "11 5 6 9 2 9 2 15 6 15 11 19 11 5" }),
41240
+ /* @__PURE__ */ jsx172("path", { d: "M15.54 8.46a5 5 0 0 1 0 7.07" })
41241
+ ]
41242
+ }
41243
+ );
40676
41244
  }
40677
- return /* @__PURE__ */ jsxs99("svg", { width: "15", height: "15", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
40678
- /* @__PURE__ */ jsx172("polygon", { points: "11 5 6 9 2 9 2 15 6 15 11 19 11 5" }),
40679
- /* @__PURE__ */ jsx172("path", { d: "M19.07 4.93a10 10 0 0 1 0 14.14" }),
40680
- /* @__PURE__ */ jsx172("path", { d: "M15.54 8.46a5 5 0 0 1 0 7.07" })
40681
- ] });
41245
+ return /* @__PURE__ */ jsxs99(
41246
+ "svg",
41247
+ {
41248
+ width: "15",
41249
+ height: "15",
41250
+ viewBox: "0 0 24 24",
41251
+ fill: "none",
41252
+ stroke: "currentColor",
41253
+ strokeWidth: "2",
41254
+ strokeLinecap: "round",
41255
+ strokeLinejoin: "round",
41256
+ children: [
41257
+ /* @__PURE__ */ jsx172("polygon", { points: "11 5 6 9 2 9 2 15 6 15 11 19 11 5" }),
41258
+ /* @__PURE__ */ jsx172("path", { d: "M19.07 4.93a10 10 0 0 1 0 14.14" }),
41259
+ /* @__PURE__ */ jsx172("path", { d: "M15.54 8.46a5 5 0 0 1 0 7.07" })
41260
+ ]
41261
+ }
41262
+ );
40682
41263
  };
40683
- var DownloadIcon3 = () => /* @__PURE__ */ jsxs99("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
40684
- /* @__PURE__ */ jsx172("path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" }),
40685
- /* @__PURE__ */ jsx172("polyline", { points: "7 10 12 15 17 10" }),
40686
- /* @__PURE__ */ jsx172("line", { x1: "12", y1: "15", x2: "12", y2: "3" })
40687
- ] });
40688
- var VideoFilmIcon = () => /* @__PURE__ */ jsxs99("svg", { width: "32", height: "32", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round", children: [
40689
- /* @__PURE__ */ jsx172("rect", { x: "2", y: "2", width: "20", height: "20", rx: "2" }),
40690
- /* @__PURE__ */ jsx172("line", { x1: "7", y1: "2", x2: "7", y2: "22" }),
40691
- /* @__PURE__ */ jsx172("line", { x1: "17", y1: "2", x2: "17", y2: "22" }),
40692
- /* @__PURE__ */ jsx172("line", { x1: "2", y1: "12", x2: "22", y2: "12" }),
40693
- /* @__PURE__ */ jsx172("line", { x1: "2", y1: "7", x2: "7", y2: "7" }),
40694
- /* @__PURE__ */ jsx172("line", { x1: "2", y1: "17", x2: "7", y2: "17" }),
40695
- /* @__PURE__ */ jsx172("line", { x1: "17", y1: "17", x2: "22", y2: "17" }),
40696
- /* @__PURE__ */ jsx172("line", { x1: "17", y1: "7", x2: "22", y2: "7" })
40697
- ] });
40698
- var VideoElement = ({ element, videoDownloadProxyUrl }) => {
41264
+ var DownloadIcon3 = () => /* @__PURE__ */ jsxs99(
41265
+ "svg",
41266
+ {
41267
+ width: "14",
41268
+ height: "14",
41269
+ viewBox: "0 0 24 24",
41270
+ fill: "none",
41271
+ stroke: "currentColor",
41272
+ strokeWidth: "2",
41273
+ strokeLinecap: "round",
41274
+ strokeLinejoin: "round",
41275
+ children: [
41276
+ /* @__PURE__ */ jsx172("path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" }),
41277
+ /* @__PURE__ */ jsx172("polyline", { points: "7 10 12 15 17 10" }),
41278
+ /* @__PURE__ */ jsx172("line", { x1: "12", y1: "15", x2: "12", y2: "3" })
41279
+ ]
41280
+ }
41281
+ );
41282
+ var VideoFilmIcon = () => /* @__PURE__ */ jsxs99(
41283
+ "svg",
41284
+ {
41285
+ width: "32",
41286
+ height: "32",
41287
+ viewBox: "0 0 24 24",
41288
+ fill: "none",
41289
+ stroke: "currentColor",
41290
+ strokeWidth: "1.5",
41291
+ strokeLinecap: "round",
41292
+ strokeLinejoin: "round",
41293
+ children: [
41294
+ /* @__PURE__ */ jsx172("rect", { x: "2", y: "2", width: "20", height: "20", rx: "2" }),
41295
+ /* @__PURE__ */ jsx172("line", { x1: "7", y1: "2", x2: "7", y2: "22" }),
41296
+ /* @__PURE__ */ jsx172("line", { x1: "17", y1: "2", x2: "17", y2: "22" }),
41297
+ /* @__PURE__ */ jsx172("line", { x1: "2", y1: "12", x2: "22", y2: "12" }),
41298
+ /* @__PURE__ */ jsx172("line", { x1: "2", y1: "7", x2: "7", y2: "7" }),
41299
+ /* @__PURE__ */ jsx172("line", { x1: "2", y1: "17", x2: "7", y2: "17" }),
41300
+ /* @__PURE__ */ jsx172("line", { x1: "17", y1: "17", x2: "22", y2: "17" }),
41301
+ /* @__PURE__ */ jsx172("line", { x1: "17", y1: "7", x2: "22", y2: "7" })
41302
+ ]
41303
+ }
41304
+ );
41305
+ var VideoElement = ({
41306
+ element,
41307
+ videoDownloadProxyUrl
41308
+ }) => {
40699
41309
  const {
40700
41310
  status,
40701
41311
  videoUrl,
@@ -40723,8 +41333,9 @@ var VideoElement = ({ element, videoDownloadProxyUrl }) => {
40723
41333
  }
40724
41334
  if (v.paused) {
40725
41335
  v.play().catch((err) => {
40726
- if (err.name !== "AbortError")
41336
+ if (err.name !== "AbortError") {
40727
41337
  throw err;
41338
+ }
40728
41339
  });
40729
41340
  setPaused(false);
40730
41341
  } else {
@@ -40755,15 +41366,19 @@ var VideoElement = ({ element, videoDownloadProxyUrl }) => {
40755
41366
  },
40756
41367
  []
40757
41368
  );
40758
- const playbackUrl = videoDownloadProxyUrl && videoUrl ? `${videoDownloadProxyUrl}?url=${encodeURIComponent(videoUrl)}` : videoUrl;
41369
+ const isBlobUrl = videoUrl?.startsWith("blob:") ?? false;
41370
+ const playbackUrl = videoDownloadProxyUrl && videoUrl && !isBlobUrl ? `${videoDownloadProxyUrl}?url=${encodeURIComponent(videoUrl)}` : videoUrl;
40759
41371
  const handleDownload = useCallback28(
40760
41372
  (e) => {
40761
41373
  e.stopPropagation();
40762
- if (!videoUrl)
41374
+ if (!videoUrl) {
40763
41375
  return;
41376
+ }
40764
41377
  const filename = `video.${element.mimeType === "video/quicktime" ? "mov" : "mp4"}`;
40765
- if (videoDownloadProxyUrl) {
40766
- const proxyHref = `${videoDownloadProxyUrl}?url=${encodeURIComponent(videoUrl)}&download=1`;
41378
+ if (videoDownloadProxyUrl && !isBlobUrl) {
41379
+ const proxyHref = `${videoDownloadProxyUrl}?url=${encodeURIComponent(
41380
+ videoUrl
41381
+ )}&download=1`;
40767
41382
  const a = document.createElement("a");
40768
41383
  a.href = proxyHref;
40769
41384
  a.download = filename;
@@ -40775,11 +41390,27 @@ var VideoElement = ({ element, videoDownloadProxyUrl }) => {
40775
41390
  a.click();
40776
41391
  }
40777
41392
  },
40778
- [videoUrl, element.mimeType, videoDownloadProxyUrl]
41393
+ [videoUrl, element.mimeType, videoDownloadProxyUrl, isBlobUrl]
40779
41394
  );
40780
41395
  const stopProp = (e) => e.stopPropagation();
40781
41396
  const totalDur = videoDuration || duration || 0;
40782
- const toolbar = /* @__PURE__ */ jsx172("div", { className: "video-el__toolbar", onClick: stopProp, onPointerDown: stopProp, children: /* @__PURE__ */ jsx172("button", { className: "video-el__tool-btn", onClick: handleDownload, title: "Download", children: /* @__PURE__ */ jsx172(DownloadIcon3, {}) }) });
41397
+ const toolbar = /* @__PURE__ */ jsx172(
41398
+ "div",
41399
+ {
41400
+ className: "video-el__toolbar",
41401
+ onClick: stopProp,
41402
+ onPointerDown: stopProp,
41403
+ children: /* @__PURE__ */ jsx172(
41404
+ "button",
41405
+ {
41406
+ className: "video-el__tool-btn",
41407
+ onClick: handleDownload,
41408
+ title: "Download",
41409
+ children: /* @__PURE__ */ jsx172(DownloadIcon3, {})
41410
+ }
41411
+ )
41412
+ }
41413
+ );
40783
41414
  if (status === "uploading" && !videoUrl) {
40784
41415
  return /* @__PURE__ */ jsxs99("div", { className: "video-el__uploading", children: [
40785
41416
  /* @__PURE__ */ jsx172("div", { className: "video-el__spinner" }),
@@ -40834,10 +41465,17 @@ var VideoElement = ({ element, videoDownloadProxyUrl }) => {
40834
41465
  onClick: stopProp,
40835
41466
  onPointerDown: stopProp,
40836
41467
  children: [
40837
- /* @__PURE__ */ jsx172("button", { className: "video-el__ctrl-btn", onClick: (e) => {
40838
- e.stopPropagation();
40839
- togglePlayPause();
40840
- }, children: paused ? /* @__PURE__ */ jsx172(PlayIcon, {}) : /* @__PURE__ */ jsx172(PauseIcon, {}) }),
41468
+ /* @__PURE__ */ jsx172(
41469
+ "button",
41470
+ {
41471
+ className: "video-el__ctrl-btn",
41472
+ onClick: (e) => {
41473
+ e.stopPropagation();
41474
+ togglePlayPause();
41475
+ },
41476
+ children: paused ? /* @__PURE__ */ jsx172(PlayIcon, {}) : /* @__PURE__ */ jsx172(PauseIcon, {})
41477
+ }
41478
+ ),
40841
41479
  /* @__PURE__ */ jsx172(
40842
41480
  "input",
40843
41481
  {
@@ -43446,7 +44084,7 @@ var App = class _App extends React61.Component {
43446
44084
  onFocus: (e) => e.target.select(),
43447
44085
  onBlur: () => this.resetEditingFrame(f),
43448
44086
  onKeyDown: (event) => {
43449
- if (event.key === KEYS55.ESCAPE || event.key === KEYS55.ENTER) {
44087
+ if (event.key === KEYS56.ESCAPE || event.key === KEYS56.ENTER) {
43450
44088
  this.resetEditingFrame(f);
43451
44089
  }
43452
44090
  },
@@ -43756,7 +44394,7 @@ var App = class _App extends React61.Component {
43756
44394
  this.scene.insertElement(videoEl);
43757
44395
  this.scene.mutateElement(videoEl, { frameId: frameElement.id });
43758
44396
  }
43759
- this.syncActionResult({ captureUpdate: CaptureUpdateAction39.IMMEDIATELY });
44397
+ this.syncActionResult({ captureUpdate: CaptureUpdateAction40.IMMEDIATELY });
43760
44398
  });
43761
44399
  /**
43762
44400
  * Inserts a generated image near a source element (≥ 25 px clearance).
@@ -43824,12 +44462,12 @@ var App = class _App extends React61.Component {
43824
44462
  if (shouldUpdateStrokeColor) {
43825
44463
  this.syncActionResult({
43826
44464
  appState: { ...this.state, currentItemStrokeColor: color },
43827
- captureUpdate: CaptureUpdateAction39.IMMEDIATELY
44465
+ captureUpdate: CaptureUpdateAction40.IMMEDIATELY
43828
44466
  });
43829
44467
  } else {
43830
44468
  this.syncActionResult({
43831
44469
  appState: { ...this.state, currentItemBackgroundColor: color },
43832
- captureUpdate: CaptureUpdateAction39.IMMEDIATELY
44470
+ captureUpdate: CaptureUpdateAction40.IMMEDIATELY
43833
44471
  });
43834
44472
  }
43835
44473
  } else {
@@ -43842,7 +44480,7 @@ var App = class _App extends React61.Component {
43842
44480
  }
43843
44481
  return el;
43844
44482
  }),
43845
- captureUpdate: CaptureUpdateAction39.IMMEDIATELY
44483
+ captureUpdate: CaptureUpdateAction40.IMMEDIATELY
43846
44484
  });
43847
44485
  }
43848
44486
  },
@@ -44045,7 +44683,7 @@ var App = class _App extends React61.Component {
44045
44683
  elements: restoredElements,
44046
44684
  appState: restoredAppState,
44047
44685
  files: initialData?.files,
44048
- captureUpdate: CaptureUpdateAction39.NEVER
44686
+ captureUpdate: CaptureUpdateAction40.NEVER
44049
44687
  });
44050
44688
  this.clearImageShapeCache();
44051
44689
  this.fonts.loadSceneFonts().then((fontFaces) => {
@@ -44722,7 +45360,7 @@ var App = class _App extends React61.Component {
44722
45360
  });
44723
45361
  }
44724
45362
  if (!isInputLike(event.target)) {
44725
- if ((event.key === KEYS55.ESCAPE || event.key === KEYS55.ENTER) && this.state.croppingElementId) {
45363
+ if ((event.key === KEYS56.ESCAPE || event.key === KEYS56.ENTER) && this.state.croppingElementId) {
44726
45364
  this.finishImageCropping();
44727
45365
  return;
44728
45366
  }
@@ -44730,13 +45368,13 @@ var App = class _App extends React61.Component {
44730
45368
  this.scene.getNonDeletedElementsMap(),
44731
45369
  this.state
44732
45370
  );
44733
- if (selectedElements.length === 1 && isImageElement9(selectedElements[0]) && event.key === KEYS55.ENTER) {
45371
+ if (selectedElements.length === 1 && isImageElement9(selectedElements[0]) && event.key === KEYS56.ENTER) {
44734
45372
  this.startImageCropping(selectedElements[0]);
44735
45373
  return;
44736
45374
  }
44737
- if (event.key === KEYS55.ESCAPE) {
45375
+ if (event.key === KEYS56.ESCAPE) {
44738
45376
  this.updateEditorAtom(convertElementTypePopupAtom, null);
44739
- } else if (event.key === KEYS55.TAB && (document.activeElement === this.excalidrawContainerRef?.current || document.activeElement?.classList.contains(
45377
+ } else if (event.key === KEYS56.TAB && (document.activeElement === this.excalidrawContainerRef?.current || document.activeElement?.classList.contains(
44740
45378
  CLASSES11.CONVERT_ELEMENT_TYPE_POPUP
44741
45379
  ))) {
44742
45380
  event.preventDefault();
@@ -44755,13 +45393,13 @@ var App = class _App extends React61.Component {
44755
45393
  });
44756
45394
  }
44757
45395
  }
44758
- if (event.key === KEYS55.ESCAPE && this.flowChartCreator.isCreatingChart) {
45396
+ if (event.key === KEYS56.ESCAPE && this.flowChartCreator.isCreatingChart) {
44759
45397
  this.flowChartCreator.clear();
44760
45398
  this.triggerRender(true);
44761
45399
  return;
44762
45400
  }
44763
45401
  const arrowKeyPressed = isArrowKey2(event.key);
44764
- if (event[KEYS55.CTRL_OR_CMD] && arrowKeyPressed && !event.shiftKey) {
45402
+ if (event[KEYS56.CTRL_OR_CMD] && arrowKeyPressed && !event.shiftKey) {
44765
45403
  event.preventDefault();
44766
45404
  const selectedElements2 = getSelectedElements(
44767
45405
  this.scene.getNonDeletedElementsMap(),
@@ -44845,7 +45483,7 @@ var App = class _App extends React61.Component {
44845
45483
  }
44846
45484
  }
44847
45485
  }
44848
- if (event[KEYS55.CTRL_OR_CMD] && event.key === KEYS55.P && !event.shiftKey && !event.altKey) {
45486
+ if (event[KEYS56.CTRL_OR_CMD] && event.key === KEYS56.P && !event.shiftKey && !event.altKey) {
44849
45487
  this.setToast({
44850
45488
  message: t("commandPalette.shortcutHint", {
44851
45489
  shortcut: getShortcutFromShortcutName("commandPalette")
@@ -44854,19 +45492,19 @@ var App = class _App extends React61.Component {
44854
45492
  event.preventDefault();
44855
45493
  return;
44856
45494
  }
44857
- if (event[KEYS55.CTRL_OR_CMD] && event.key.toLowerCase() === KEYS55.V) {
45495
+ if (event[KEYS56.CTRL_OR_CMD] && event.key.toLowerCase() === KEYS56.V) {
44858
45496
  IS_PLAIN_PASTE = event.shiftKey;
44859
45497
  clearTimeout(IS_PLAIN_PASTE_TIMER);
44860
45498
  IS_PLAIN_PASTE_TIMER = window.setTimeout(() => {
44861
45499
  IS_PLAIN_PASTE = false;
44862
45500
  }, 100);
44863
45501
  }
44864
- if (event[KEYS55.CTRL_OR_CMD] && event.shiftKey && event.key.toLowerCase() === KEYS55.V) {
45502
+ if (event[KEYS56.CTRL_OR_CMD] && event.shiftKey && event.key.toLowerCase() === KEYS56.V) {
44865
45503
  event.preventDefault();
44866
45504
  this.onVideoToolbarButtonClick();
44867
45505
  return;
44868
45506
  }
44869
- if (event[KEYS55.CTRL_OR_CMD] && isWritableElement5(event.target)) {
45507
+ if (event[KEYS56.CTRL_OR_CMD] && isWritableElement5(event.target)) {
44870
45508
  if (event.code === CODES13.MINUS || event.code === CODES13.EQUAL) {
44871
45509
  event.preventDefault();
44872
45510
  return;
@@ -44875,24 +45513,24 @@ var App = class _App extends React61.Component {
44875
45513
  if (
44876
45514
  // inside an input
44877
45515
  isWritableElement5(event.target) && // unless pressing escape (finalize action)
44878
- event.key !== KEYS55.ESCAPE || // or unless using arrows (to move between buttons)
45516
+ event.key !== KEYS56.ESCAPE || // or unless using arrows (to move between buttons)
44879
45517
  isArrowKey2(event.key) && isInputLike(event.target)
44880
45518
  ) {
44881
45519
  return;
44882
45520
  }
44883
- if (event.key === KEYS55.QUESTION_MARK) {
45521
+ if (event.key === KEYS56.QUESTION_MARK) {
44884
45522
  this.setState({
44885
45523
  openDialog: { name: "help" }
44886
45524
  });
44887
45525
  return;
44888
- } else if (event.key.toLowerCase() === KEYS55.E && event.shiftKey && event[KEYS55.CTRL_OR_CMD]) {
45526
+ } else if (event.key.toLowerCase() === KEYS56.E && event.shiftKey && event[KEYS56.CTRL_OR_CMD]) {
44889
45527
  event.preventDefault();
44890
45528
  this.setState({ openDialog: { name: "imageExport" } });
44891
45529
  return;
44892
45530
  }
44893
- if (event.key === KEYS55.PAGE_UP || event.key === KEYS55.PAGE_DOWN) {
45531
+ if (event.key === KEYS56.PAGE_UP || event.key === KEYS56.PAGE_DOWN) {
44894
45532
  let offset = (event.shiftKey ? this.state.width : this.state.height) / this.state.zoom.value;
44895
- if (event.key === KEYS55.PAGE_DOWN) {
45533
+ if (event.key === KEYS56.PAGE_DOWN) {
44896
45534
  offset = -offset;
44897
45535
  }
44898
45536
  if (event.shiftKey) {
@@ -44908,7 +45546,7 @@ var App = class _App extends React61.Component {
44908
45546
  if (this.state.openDialog?.name === "elementLinkSelector") {
44909
45547
  return;
44910
45548
  }
44911
- if (event.key === KEYS55.ALT) {
45549
+ if (event.key === KEYS56.ALT) {
44912
45550
  if (getFeatureFlag4("COMPLEX_BINDINGS")) {
44913
45551
  this.handleSkipBindMode();
44914
45552
  } else {
@@ -44919,7 +45557,7 @@ var App = class _App extends React61.Component {
44919
45557
  return;
44920
45558
  }
44921
45559
  const shouldPreventToolSwitching = this.props.viewModeEnabled === true;
44922
- if (!shouldPreventToolSwitching && this.state.viewModeEnabled && event.key === KEYS55.ESCAPE) {
45560
+ if (!shouldPreventToolSwitching && this.state.viewModeEnabled && event.key === KEYS56.ESCAPE) {
44923
45561
  this.setActiveTool({ type: "hand" });
44924
45562
  return;
44925
45563
  }
@@ -44950,7 +45588,7 @@ var App = class _App extends React61.Component {
44950
45588
  }
44951
45589
  event.stopPropagation();
44952
45590
  return;
44953
- } else if (event.key === KEYS55.Q) {
45591
+ } else if (event.key === KEYS56.Q) {
44954
45592
  this.toggleLock("keyboard");
44955
45593
  event.stopPropagation();
44956
45594
  return;
@@ -44959,7 +45597,7 @@ var App = class _App extends React61.Component {
44959
45597
  if (this.state.viewModeEnabled) {
44960
45598
  return;
44961
45599
  }
44962
- if (event[KEYS55.CTRL_OR_CMD] && this.state.isBindingEnabled) {
45600
+ if (event[KEYS56.CTRL_OR_CMD] && this.state.isBindingEnabled) {
44963
45601
  if (getFeatureFlag4("COMPLEX_BINDINGS")) {
44964
45602
  this.resetDelayedBindMode();
44965
45603
  }
@@ -44992,13 +45630,13 @@ var App = class _App extends React61.Component {
44992
45630
  const step = this.getEffectiveGridSize() && (event.shiftKey ? ELEMENT_TRANSLATE_AMOUNT : this.getEffectiveGridSize()) || (event.shiftKey ? ELEMENT_SHIFT_TRANSLATE_AMOUNT : ELEMENT_TRANSLATE_AMOUNT);
44993
45631
  let offsetX = 0;
44994
45632
  let offsetY = 0;
44995
- if (event.key === KEYS55.ARROW_LEFT) {
45633
+ if (event.key === KEYS56.ARROW_LEFT) {
44996
45634
  offsetX = -step;
44997
- } else if (event.key === KEYS55.ARROW_RIGHT) {
45635
+ } else if (event.key === KEYS56.ARROW_RIGHT) {
44998
45636
  offsetX = step;
44999
- } else if (event.key === KEYS55.ARROW_UP) {
45637
+ } else if (event.key === KEYS56.ARROW_UP) {
45000
45638
  offsetY = -step;
45001
- } else if (event.key === KEYS55.ARROW_DOWN) {
45639
+ } else if (event.key === KEYS56.ARROW_DOWN) {
45002
45640
  offsetY = step;
45003
45641
  }
45004
45642
  selectedElements.forEach((element) => {
@@ -45016,11 +45654,11 @@ var App = class _App extends React61.Component {
45016
45654
  });
45017
45655
  this.scene.triggerUpdate();
45018
45656
  event.preventDefault();
45019
- } else if (event.key === KEYS55.ENTER) {
45657
+ } else if (event.key === KEYS56.ENTER) {
45020
45658
  const selectedElements = this.scene.getSelectedElements(this.state);
45021
45659
  if (selectedElements.length === 1) {
45022
45660
  const selectedElement = selectedElements[0];
45023
- if (event[KEYS55.CTRL_OR_CMD] || isLineElement8(selectedElement)) {
45661
+ if (event[KEYS56.CTRL_OR_CMD] || isLineElement8(selectedElement)) {
45024
45662
  if (isLinearElement12(selectedElement)) {
45025
45663
  if (!this.state.selectedLinearElement?.isEditing || this.state.selectedLinearElement.elementId !== selectedElement.id) {
45026
45664
  this.store.scheduleCapture();
@@ -45055,26 +45693,26 @@ var App = class _App extends React61.Component {
45055
45693
  }
45056
45694
  }
45057
45695
  }
45058
- if (event.key === KEYS55.SPACE && gesture.pointers.size === 0) {
45696
+ if (event.key === KEYS56.SPACE && gesture.pointers.size === 0) {
45059
45697
  isHoldingSpace = true;
45060
45698
  setCursor(this.interactiveCanvas, CURSOR_TYPE4.GRAB);
45061
45699
  event.preventDefault();
45062
45700
  }
45063
- if ((event.key === KEYS55.G || event.key === KEYS55.S) && !event.altKey && !event[KEYS55.CTRL_OR_CMD]) {
45701
+ if ((event.key === KEYS56.G || event.key === KEYS56.S) && !event.altKey && !event[KEYS56.CTRL_OR_CMD]) {
45064
45702
  const selectedElements = this.scene.getSelectedElements(this.state);
45065
45703
  if (this.state.activeTool.type === "selection" && !selectedElements.length) {
45066
45704
  return;
45067
45705
  }
45068
- if (event.key === KEYS55.G && (hasBackground(this.state.activeTool.type) || selectedElements.some((element) => hasBackground(element.type)))) {
45706
+ if (event.key === KEYS56.G && (hasBackground(this.state.activeTool.type) || selectedElements.some((element) => hasBackground(element.type)))) {
45069
45707
  this.setState({ openPopup: "elementBackground" });
45070
45708
  event.stopPropagation();
45071
45709
  }
45072
- if (event.key === KEYS55.S) {
45710
+ if (event.key === KEYS56.S) {
45073
45711
  this.setState({ openPopup: "elementStroke" });
45074
45712
  event.stopPropagation();
45075
45713
  }
45076
45714
  }
45077
- if (!event[KEYS55.CTRL_OR_CMD] && event.shiftKey && event.key.toLowerCase() === KEYS55.F) {
45715
+ if (!event[KEYS56.CTRL_OR_CMD] && event.shiftKey && event.key.toLowerCase() === KEYS56.F) {
45078
45716
  const selectedElements = this.scene.getSelectedElements(this.state);
45079
45717
  if (this.state.activeTool.type === "selection" && !selectedElements.length) {
45080
45718
  return;
@@ -45089,12 +45727,12 @@ var App = class _App extends React61.Component {
45089
45727
  this.setState({ openPopup: "fontFamily" });
45090
45728
  }
45091
45729
  }
45092
- if (event[KEYS55.CTRL_OR_CMD] && (event.key === KEYS55.BACKSPACE || event.key === KEYS55.DELETE)) {
45730
+ if (event[KEYS56.CTRL_OR_CMD] && (event.key === KEYS56.BACKSPACE || event.key === KEYS56.DELETE)) {
45093
45731
  this.updateEditorAtom(activeConfirmDialogAtom, "clearCanvas");
45094
45732
  }
45095
45733
  const lowerCased = event.key.toLocaleLowerCase();
45096
- const isPickingStroke = lowerCased === KEYS55.S && event.shiftKey;
45097
- const isPickingBackground = event.key === KEYS55.I || lowerCased === KEYS55.G && event.shiftKey;
45734
+ const isPickingStroke = lowerCased === KEYS56.S && event.shiftKey;
45735
+ const isPickingBackground = event.key === KEYS56.I || lowerCased === KEYS56.G && event.shiftKey;
45098
45736
  if (isPickingStroke || isPickingBackground) {
45099
45737
  this.openEyeDropper({
45100
45738
  type: isPickingStroke ? "stroke" : "background"
@@ -45103,7 +45741,7 @@ var App = class _App extends React61.Component {
45103
45741
  }
45104
45742
  ));
45105
45743
  __publicField(this, "onKeyUp", withBatchedUpdates((event) => {
45106
- if (event.key === KEYS55.SPACE) {
45744
+ if (event.key === KEYS56.SPACE) {
45107
45745
  if (this.state.viewModeEnabled && this.state.activeTool.type !== "laser" || this.state.openDialog?.name === "elementLinkSelector") {
45108
45746
  setCursor(this.interactiveCanvas, CURSOR_TYPE4.GRAB);
45109
45747
  } else if (isSelectionLikeTool(this.state.activeTool.type)) {
@@ -45119,10 +45757,10 @@ var App = class _App extends React61.Component {
45119
45757
  }
45120
45758
  isHoldingSpace = false;
45121
45759
  }
45122
- if (event.key === KEYS55.ALT) {
45760
+ if (event.key === KEYS56.ALT) {
45123
45761
  maybeHandleArrowPointlikeDrag({ app: this, event });
45124
45762
  }
45125
- if (event.key === KEYS55.ALT && this.state.bindMode === "skip" || !event[KEYS55.CTRL_OR_CMD] && !isBindingEnabled2(this.state)) {
45763
+ if (event.key === KEYS56.ALT && this.state.bindMode === "skip" || !event[KEYS56.CTRL_OR_CMD] && !isBindingEnabled2(this.state)) {
45126
45764
  this.setState({
45127
45765
  bindMode: "orbit"
45128
45766
  });
@@ -45150,7 +45788,7 @@ var App = class _App extends React61.Component {
45150
45788
  }
45151
45789
  }
45152
45790
  }
45153
- if (!event[KEYS55.CTRL_OR_CMD] && !this.state.isBindingEnabled) {
45791
+ if (!event[KEYS56.CTRL_OR_CMD] && !this.state.isBindingEnabled) {
45154
45792
  flushSync3(() => {
45155
45793
  this.setState({ isBindingEnabled: true });
45156
45794
  });
@@ -45201,11 +45839,11 @@ var App = class _App extends React61.Component {
45201
45839
  if (this.flowChartNavigator.isExploring) {
45202
45840
  this.flowChartNavigator.clear();
45203
45841
  this.syncActionResult({
45204
- captureUpdate: CaptureUpdateAction39.IMMEDIATELY
45842
+ captureUpdate: CaptureUpdateAction40.IMMEDIATELY
45205
45843
  });
45206
45844
  }
45207
45845
  }
45208
- if (!event[KEYS55.CTRL_OR_CMD]) {
45846
+ if (!event[KEYS56.CTRL_OR_CMD]) {
45209
45847
  if (this.flowChartCreator.isCreatingChart) {
45210
45848
  if (this.flowChartCreator.pendingNodes?.length) {
45211
45849
  this.scene.insertElements(this.flowChartCreator.pendingNodes);
@@ -45243,7 +45881,7 @@ var App = class _App extends React61.Component {
45243
45881
  }
45244
45882
  this.flowChartCreator.clear();
45245
45883
  this.syncActionResult({
45246
- captureUpdate: CaptureUpdateAction39.IMMEDIATELY
45884
+ captureUpdate: CaptureUpdateAction40.IMMEDIATELY
45247
45885
  });
45248
45886
  }
45249
45887
  }
@@ -45534,7 +46172,7 @@ var App = class _App extends React61.Component {
45534
46172
  );
45535
46173
  if (selectedElements.length === 1 && isLinearElement12(selectedElements[0])) {
45536
46174
  const selectedLinearElement = selectedElements[0];
45537
- if ((event[KEYS55.CTRL_OR_CMD] && isSimpleArrow(selectedLinearElement) || isLineElement8(selectedLinearElement)) && (!this.state.selectedLinearElement?.isEditing || this.state.selectedLinearElement.elementId !== selectedLinearElement.id)) {
46175
+ if ((event[KEYS56.CTRL_OR_CMD] && isSimpleArrow(selectedLinearElement) || isLineElement8(selectedLinearElement)) && (!this.state.selectedLinearElement?.isEditing || this.state.selectedLinearElement.elementId !== selectedLinearElement.id)) {
45538
46176
  this.actionManager.executeAction(actionToggleLinearEditor);
45539
46177
  return;
45540
46178
  } else if (this.state.selectedLinearElement && isElbowArrow10(selectedElements[0])) {
@@ -45619,7 +46257,7 @@ var App = class _App extends React61.Component {
45619
46257
  }
45620
46258
  }
45621
46259
  resetCursor(this.interactiveCanvas);
45622
- if (!event[KEYS55.CTRL_OR_CMD] && !this.state.viewModeEnabled) {
46260
+ if (!event[KEYS56.CTRL_OR_CMD] && !this.state.viewModeEnabled) {
45623
46261
  const hitElement = this.getElementAtPosition(sceneX, sceneY);
45624
46262
  if (isIframeLikeElement2(hitElement)) {
45625
46263
  this.setState({
@@ -46168,7 +46806,7 @@ var App = class _App extends React61.Component {
46168
46806
  setCursor(this.interactiveCanvas, CURSOR_TYPE4.AUTO);
46169
46807
  } else if (
46170
46808
  // if using cmd/ctrl, we're not dragging
46171
- !event[KEYS55.CTRL_OR_CMD]
46809
+ !event[KEYS56.CTRL_OR_CMD]
46172
46810
  ) {
46173
46811
  if ((hitElement || this.isHittingCommonBoundingBoxOfSelectedElements(
46174
46812
  scenePointer,
@@ -46287,7 +46925,7 @@ var App = class _App extends React61.Component {
46287
46925
  this.state
46288
46926
  )
46289
46927
  },
46290
- captureUpdate: this.state.openDialog?.name === "elementLinkSelector" ? CaptureUpdateAction39.EVENTUALLY : CaptureUpdateAction39.NEVER
46928
+ captureUpdate: this.state.openDialog?.name === "elementLinkSelector" ? CaptureUpdateAction40.EVENTUALLY : CaptureUpdateAction40.NEVER
46291
46929
  });
46292
46930
  return;
46293
46931
  }
@@ -46841,7 +47479,7 @@ var App = class _App extends React61.Component {
46841
47479
  ) : makeNextSelectedElementIds2({}, prevState)
46842
47480
  }));
46843
47481
  } else if (hitElement != null) {
46844
- if (event[KEYS55.CTRL_OR_CMD]) {
47482
+ if (event[KEYS56.CTRL_OR_CMD]) {
46845
47483
  if (event.altKey) {
46846
47484
  if (this.state.openDialog?.name === "elementLinkSelector") {
46847
47485
  this.setOpenDialog(null);
@@ -47049,7 +47687,7 @@ var App = class _App extends React61.Component {
47049
47687
  const [gridX, gridY] = getGridPoint2(
47050
47688
  sceneX,
47051
47689
  sceneY,
47052
- this.lastPointerDownEvent?.[KEYS55.CTRL_OR_CMD] ? null : this.getEffectiveGridSize()
47690
+ this.lastPointerDownEvent?.[KEYS56.CTRL_OR_CMD] ? null : this.getEffectiveGridSize()
47053
47691
  );
47054
47692
  const element = newIframeElement({
47055
47693
  type: "iframe",
@@ -47079,7 +47717,7 @@ var App = class _App extends React61.Component {
47079
47717
  const [gridX, gridY] = getGridPoint2(
47080
47718
  sceneX,
47081
47719
  sceneY,
47082
- this.lastPointerDownEvent?.[KEYS55.CTRL_OR_CMD] ? null : this.getEffectiveGridSize()
47720
+ this.lastPointerDownEvent?.[KEYS56.CTRL_OR_CMD] ? null : this.getEffectiveGridSize()
47083
47721
  );
47084
47722
  const embedLink = getEmbedLink2(link);
47085
47723
  if (!embedLink) {
@@ -47119,7 +47757,7 @@ var App = class _App extends React61.Component {
47119
47757
  const [gridX, gridY] = getGridPoint2(
47120
47758
  sceneX,
47121
47759
  sceneY,
47122
- this.lastPointerDownEvent?.[KEYS55.CTRL_OR_CMD] ? null : this.getEffectiveGridSize()
47760
+ this.lastPointerDownEvent?.[KEYS56.CTRL_OR_CMD] ? null : this.getEffectiveGridSize()
47123
47761
  );
47124
47762
  const topLayerFrame = addToFrameUnderCursor ? this.getTopLayerFrameAtSceneCoords({
47125
47763
  x: gridX,
@@ -47223,7 +47861,7 @@ var App = class _App extends React61.Component {
47223
47861
  const [gridX, gridY] = getGridPoint2(
47224
47862
  pointerDownState.origin.x,
47225
47863
  pointerDownState.origin.y,
47226
- event[KEYS55.CTRL_OR_CMD] ? null : this.getEffectiveGridSize()
47864
+ event[KEYS56.CTRL_OR_CMD] ? null : this.getEffectiveGridSize()
47227
47865
  );
47228
47866
  const topLayerFrame = this.getTopLayerFrameAtSceneCoords({
47229
47867
  x: gridX,
@@ -47359,7 +47997,7 @@ var App = class _App extends React61.Component {
47359
47997
  const [gridX, gridY] = getGridPoint2(
47360
47998
  pointerDownState.origin.x,
47361
47999
  pointerDownState.origin.y,
47362
- this.lastPointerDownEvent?.[KEYS55.CTRL_OR_CMD] ? null : this.getEffectiveGridSize()
48000
+ this.lastPointerDownEvent?.[KEYS56.CTRL_OR_CMD] ? null : this.getEffectiveGridSize()
47363
48001
  );
47364
48002
  const topLayerFrame = this.getTopLayerFrameAtSceneCoords({
47365
48003
  x: gridX,
@@ -47407,7 +48045,7 @@ var App = class _App extends React61.Component {
47407
48045
  const [gridX, gridY] = getGridPoint2(
47408
48046
  pointerDownState.origin.x,
47409
48047
  pointerDownState.origin.y,
47410
- this.lastPointerDownEvent?.[KEYS55.CTRL_OR_CMD] ? null : this.getEffectiveGridSize()
48048
+ this.lastPointerDownEvent?.[KEYS56.CTRL_OR_CMD] ? null : this.getEffectiveGridSize()
47411
48049
  );
47412
48050
  const constructorOpts = {
47413
48051
  x: gridX,
@@ -47644,7 +48282,10 @@ var App = class _App extends React61.Component {
47644
48282
  }
47645
48283
  const clientX = this.state.width / 2 + this.state.offsetLeft;
47646
48284
  const clientY = this.state.height / 2 + this.state.offsetTop;
47647
- const { x, y } = viewportCoordsToSceneCoords5({ clientX, clientY }, this.state);
48285
+ const { x, y } = viewportCoordsToSceneCoords5(
48286
+ { clientX, clientY },
48287
+ this.state
48288
+ );
47648
48289
  await this.insertVideos(files, x, y);
47649
48290
  };
47650
48291
  input.click();
@@ -47676,7 +48317,7 @@ var App = class _App extends React61.Component {
47676
48317
  files
47677
48318
  });
47678
48319
  if (erroredFiles.size) {
47679
- this.store.scheduleAction(CaptureUpdateAction39.NEVER);
48320
+ this.store.scheduleAction(CaptureUpdateAction40.NEVER);
47680
48321
  this.scene.replaceAllElements(
47681
48322
  this.scene.getElementsIncludingDeleted().map((element) => {
47682
48323
  if (isInitializedImageElement3(element) && erroredFiles.has(element.fileId)) {
@@ -47786,7 +48427,7 @@ var App = class _App extends React61.Component {
47786
48427
  )
47787
48428
  },
47788
48429
  elements: nextElements,
47789
- captureUpdate: CaptureUpdateAction39.IMMEDIATELY
48430
+ captureUpdate: CaptureUpdateAction40.IMMEDIATELY
47790
48431
  });
47791
48432
  this.setState({}, () => {
47792
48433
  this.actionManager.executeAction(actionFinalize);
@@ -47806,7 +48447,7 @@ var App = class _App extends React61.Component {
47806
48447
  const [gridX, gridY] = getGridPoint2(
47807
48448
  sceneX,
47808
48449
  sceneY,
47809
- this.lastPointerDownEvent?.[KEYS55.CTRL_OR_CMD] ? null : this.getEffectiveGridSize()
48450
+ this.lastPointerDownEvent?.[KEYS56.CTRL_OR_CMD] ? null : this.getEffectiveGridSize()
47810
48451
  );
47811
48452
  const w = width ?? 320 / this.state.zoom.value;
47812
48453
  const h = height ?? 180 / this.state.zoom.value;
@@ -47923,7 +48564,7 @@ var App = class _App extends React61.Component {
47923
48564
  )
47924
48565
  },
47925
48566
  elements: nextElements,
47926
- captureUpdate: CaptureUpdateAction39.IMMEDIATELY
48567
+ captureUpdate: CaptureUpdateAction40.IMMEDIATELY
47927
48568
  });
47928
48569
  this.props.onAfterVideoUpload?.();
47929
48570
  });
@@ -47951,7 +48592,7 @@ var App = class _App extends React61.Component {
47951
48592
  isLoading: false
47952
48593
  },
47953
48594
  replaceFiles: true,
47954
- captureUpdate: CaptureUpdateAction39.IMMEDIATELY
48595
+ captureUpdate: CaptureUpdateAction40.IMMEDIATELY
47955
48596
  });
47956
48597
  return;
47957
48598
  } catch (error) {
@@ -48065,7 +48706,7 @@ var App = class _App extends React61.Component {
48065
48706
  if (ret.type === MIME_TYPES9.excalidraw) {
48066
48707
  syncInvalidIndices(elements.concat(ret.data.elements));
48067
48708
  this.store.scheduleMicroAction({
48068
- action: CaptureUpdateAction39.NEVER,
48709
+ action: CaptureUpdateAction40.NEVER,
48069
48710
  elements,
48070
48711
  appState: void 0
48071
48712
  });
@@ -48077,7 +48718,7 @@ var App = class _App extends React61.Component {
48077
48718
  isLoading: false
48078
48719
  },
48079
48720
  replaceFiles: true,
48080
- captureUpdate: CaptureUpdateAction39.IMMEDIATELY
48721
+ captureUpdate: CaptureUpdateAction40.IMMEDIATELY
48081
48722
  });
48082
48723
  } else if (ret.type === MIME_TYPES9.excalidrawlib) {
48083
48724
  await this.library.updateLibrary({
@@ -48170,7 +48811,7 @@ var App = class _App extends React61.Component {
48170
48811
  let [gridX, gridY] = getGridPoint2(
48171
48812
  pointerCoords.x,
48172
48813
  pointerCoords.y,
48173
- event[KEYS55.CTRL_OR_CMD] ? null : this.getEffectiveGridSize()
48814
+ event[KEYS56.CTRL_OR_CMD] ? null : this.getEffectiveGridSize()
48174
48815
  );
48175
48816
  const image = isInitializedImageElement3(newElement8) && this.imageCache.get(newElement8.fileId)?.image;
48176
48817
  const aspectRatio = image && !(image instanceof Promise) ? image.width / image.height : null;
@@ -48236,7 +48877,7 @@ var App = class _App extends React61.Component {
48236
48877
  const [x, y] = getGridPoint2(
48237
48878
  pointerCoords.x - pointerDownState.resize.offset.x,
48238
48879
  pointerCoords.y - pointerDownState.resize.offset.y,
48239
- event[KEYS55.CTRL_OR_CMD] ? null : this.getEffectiveGridSize()
48880
+ event[KEYS56.CTRL_OR_CMD] ? null : this.getEffectiveGridSize()
48240
48881
  );
48241
48882
  const croppingElement = this.scene.getNonDeletedElementsMap().get(this.state.croppingElementId);
48242
48883
  if (transformHandleType && croppingElement && isImageElement9(croppingElement)) {
@@ -48248,7 +48889,7 @@ var App = class _App extends React61.Component {
48248
48889
  const [gridX, gridY] = getGridPoint2(
48249
48890
  pointerCoords.x,
48250
48891
  pointerCoords.y,
48251
- event[KEYS55.CTRL_OR_CMD] ? null : this.getEffectiveGridSize()
48892
+ event[KEYS56.CTRL_OR_CMD] ? null : this.getEffectiveGridSize()
48252
48893
  );
48253
48894
  const dragOffset = {
48254
48895
  x: gridX - pointerDownState.originInGrid.x,
@@ -48312,7 +48953,7 @@ var App = class _App extends React61.Component {
48312
48953
  let [resizeX, resizeY] = getGridPoint2(
48313
48954
  pointerCoords.x - pointerDownState.resize.offset.x,
48314
48955
  pointerCoords.y - pointerDownState.resize.offset.y,
48315
- event[KEYS55.CTRL_OR_CMD] ? null : this.getEffectiveGridSize()
48956
+ event[KEYS56.CTRL_OR_CMD] ? null : this.getEffectiveGridSize()
48316
48957
  );
48317
48958
  const frameElementsOffsetsMap = /* @__PURE__ */ new Map();
48318
48959
  selectedFrames.forEach((frame) => {
@@ -48331,7 +48972,7 @@ var App = class _App extends React61.Component {
48331
48972
  const [gridX, gridY] = getGridPoint2(
48332
48973
  pointerCoords.x,
48333
48974
  pointerCoords.y,
48334
- event[KEYS55.CTRL_OR_CMD] ? null : this.getEffectiveGridSize()
48975
+ event[KEYS56.CTRL_OR_CMD] ? null : this.getEffectiveGridSize()
48335
48976
  );
48336
48977
  const dragOffset = {
48337
48978
  x: gridX - pointerDownState.originInGrid.x,
@@ -48467,7 +49108,7 @@ var App = class _App extends React61.Component {
48467
49108
  __publicField(this, "handleWheel", withBatchedUpdates(
48468
49109
  (event) => {
48469
49110
  if (!(event.target instanceof HTMLCanvasElement || event.target instanceof HTMLTextAreaElement || event.target instanceof HTMLIFrameElement || event.target instanceof HTMLElement && event.target.classList.contains(CLASSES11.FRAME_NAME))) {
48470
- if (event[KEYS55.CTRL_OR_CMD]) {
49111
+ if (event[KEYS56.CTRL_OR_CMD]) {
48471
49112
  event.preventDefault();
48472
49113
  }
48473
49114
  return;
@@ -49312,10 +49953,7 @@ var App = class _App extends React61.Component {
49312
49953
  pointerEvents: POINTER_EVENTS.enabled,
49313
49954
  opacity: getRenderOpacity(
49314
49955
  el,
49315
- getContainingFrame3(
49316
- el,
49317
- this.scene.getNonDeletedElementsMap()
49318
- ),
49956
+ getContainingFrame3(el, this.scene.getNonDeletedElementsMap()),
49319
49957
  this.elementsPendingErasure,
49320
49958
  null,
49321
49959
  this.state.openDialog?.name === "elementLinkSelector" ? DEFAULT_REDUCED_GLOBAL_ALPHA2 : 1
@@ -49331,7 +49969,14 @@ var App = class _App extends React61.Component {
49331
49969
  transform: `rotate(${el.angle}rad)`,
49332
49970
  pointerEvents: POINTER_EVENTS.enabled
49333
49971
  },
49334
- children: /* @__PURE__ */ jsx179(VideoElement, { element: el, isActive: true, videoDownloadProxyUrl: this.props.videoDownloadProxyUrl })
49972
+ children: /* @__PURE__ */ jsx179(
49973
+ VideoElement,
49974
+ {
49975
+ element: el,
49976
+ isActive: true,
49977
+ videoDownloadProxyUrl: this.props.videoDownloadProxyUrl
49978
+ }
49979
+ )
49335
49980
  }
49336
49981
  )
49337
49982
  },
@@ -50686,12 +51331,12 @@ var App = class _App extends React61.Component {
50686
51331
  const isElbowArrowOnly = selectedElements.findIndex(isElbowArrow10) === 0;
50687
51332
  return {
50688
51333
  origin,
50689
- withCmdOrCtrl: event[KEYS55.CTRL_OR_CMD],
51334
+ withCmdOrCtrl: event[KEYS56.CTRL_OR_CMD],
50690
51335
  originInGrid: tupleToCoors(
50691
51336
  getGridPoint2(
50692
51337
  origin.x,
50693
51338
  origin.y,
50694
- event[KEYS55.CTRL_OR_CMD] || isElbowArrowOnly ? null : this.getEffectiveGridSize()
51339
+ event[KEYS56.CTRL_OR_CMD] || isElbowArrowOnly ? null : this.getEffectiveGridSize()
50695
51340
  )
50696
51341
  ),
50697
51342
  scrollbars: isOverScrollBars(
@@ -50832,7 +51477,7 @@ var App = class _App extends React61.Component {
50832
51477
  }
50833
51478
  onKeyUpFromPointerDownHandler(pointerDownState) {
50834
51479
  return withBatchedUpdates((event) => {
50835
- event.key === KEYS55.ALT && event.preventDefault();
51480
+ event.key === KEYS56.ALT && event.preventDefault();
50836
51481
  if (this.maybeHandleResize(pointerDownState, event)) {
50837
51482
  return;
50838
51483
  }
@@ -50854,7 +51499,7 @@ var App = class _App extends React61.Component {
50854
51499
  const [gridX2, gridY2] = getGridPoint2(
50855
51500
  pointerCoords.x,
50856
51501
  pointerCoords.y,
50857
- event[KEYS55.CTRL_OR_CMD] ? null : this.getEffectiveGridSize()
51502
+ event[KEYS56.CTRL_OR_CMD] ? null : this.getEffectiveGridSize()
50858
51503
  );
50859
51504
  let index = this.state.selectedLinearElement.initialState.segmentMidpoint.index;
50860
51505
  if (index < 0) {
@@ -50919,7 +51564,7 @@ var App = class _App extends React61.Component {
50919
51564
  const [gridX, gridY] = getGridPoint2(
50920
51565
  pointerCoords.x,
50921
51566
  pointerCoords.y,
50922
- event[KEYS55.CTRL_OR_CMD] ? null : this.getEffectiveGridSize()
51567
+ event[KEYS56.CTRL_OR_CMD] ? null : this.getEffectiveGridSize()
50923
51568
  );
50924
51569
  if (pointerDownState.resize.isResizing) {
50925
51570
  pointerDownState.lastCoords.x = pointerCoords.x;
@@ -50967,7 +51612,7 @@ var App = class _App extends React61.Component {
50967
51612
  this.state.selectedLinearElement,
50968
51613
  pointerCoords,
50969
51614
  this,
50970
- !event[KEYS55.CTRL_OR_CMD],
51615
+ !event[KEYS56.CTRL_OR_CMD],
50971
51616
  this.scene
50972
51617
  );
50973
51618
  if (!ret) {
@@ -51165,7 +51810,7 @@ var App = class _App extends React61.Component {
51165
51810
  dragOffset,
51166
51811
  this.scene,
51167
51812
  snapOffset,
51168
- event[KEYS55.CTRL_OR_CMD] ? null : this.getEffectiveGridSize()
51813
+ event[KEYS56.CTRL_OR_CMD] ? null : this.getEffectiveGridSize()
51169
51814
  );
51170
51815
  }
51171
51816
  this.setState({
@@ -51783,7 +52428,7 @@ var App = class _App extends React61.Component {
51783
52428
  appState: {
51784
52429
  newElement: null
51785
52430
  },
51786
- captureUpdate: CaptureUpdateAction39.NEVER
52431
+ captureUpdate: CaptureUpdateAction40.NEVER
51787
52432
  });
51788
52433
  return;
51789
52434
  }
@@ -51910,7 +52555,7 @@ var App = class _App extends React61.Component {
51910
52555
  if (resizingElement && isInvisiblySmallElement3(resizingElement)) {
51911
52556
  this.updateScene({
51912
52557
  elements: this.scene.getElementsIncludingDeleted().filter((el) => el.id !== resizingElement.id),
51913
- captureUpdate: CaptureUpdateAction39.NEVER
52558
+ captureUpdate: CaptureUpdateAction40.NEVER
51914
52559
  });
51915
52560
  }
51916
52561
  if (pointerDownState.resize.isResizing) {
@@ -53280,7 +53925,7 @@ import {
53280
53925
  newElementWith as newElementWith12,
53281
53926
  bumpVersion
53282
53927
  } from "@orangecatai/element";
53283
- import { CaptureUpdateAction as CaptureUpdateAction40 } from "@orangecatai/element";
53928
+ import { CaptureUpdateAction as CaptureUpdateAction41 } from "@orangecatai/element";
53284
53929
 
53285
53930
  // components/TTDDialog/TTDDialogTrigger.tsx
53286
53931
  import { jsx as jsx188 } from "react/jsx-runtime";
@@ -58628,6 +59273,8 @@ var ExcalidrawBase = (props) => {
58628
59273
  showDeprecatedFonts,
58629
59274
  imageGenUrl,
58630
59275
  autoResizeUrl,
59276
+ customResizeUrl,
59277
+ tier1CropUrl,
58631
59278
  removeBgUrl,
58632
59279
  renderScrollbars,
58633
59280
  onBeforeImageGen,
@@ -58734,6 +59381,8 @@ var ExcalidrawBase = (props) => {
58734
59381
  showDeprecatedFonts,
58735
59382
  imageGenUrl,
58736
59383
  autoResizeUrl,
59384
+ customResizeUrl,
59385
+ tier1CropUrl,
58737
59386
  removeBgUrl,
58738
59387
  renderScrollbars,
58739
59388
  onBeforeImageGen,
@@ -58808,7 +59457,7 @@ Excalidraw.displayName = "Excalidraw";
58808
59457
  export {
58809
59458
  AIChatPanel,
58810
59459
  Button,
58811
- CaptureUpdateAction40 as CaptureUpdateAction,
59460
+ CaptureUpdateAction41 as CaptureUpdateAction,
58812
59461
  CommandPalette,
58813
59462
  DEFAULT_LASER_COLOR2 as DEFAULT_LASER_COLOR,
58814
59463
  DefaultSidebar,