@wordpress/media-editor 0.3.1-next.v.202602271551.0 → 0.3.1

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 (124) hide show
  1. package/build-types/components/media-editor/index.d.ts +42 -0
  2. package/build-types/components/media-editor/index.d.ts.map +1 -0
  3. package/build-types/components/media-editor/use-crop-options.d.ts +35 -0
  4. package/build-types/components/media-editor/use-crop-options.d.ts.map +1 -0
  5. package/build-types/components/media-editor/use-save-media-editor.d.ts +29 -0
  6. package/build-types/components/media-editor/use-save-media-editor.d.ts.map +1 -0
  7. package/build-types/components/media-editor-canvas/index.d.ts +26 -0
  8. package/build-types/components/media-editor-canvas/index.d.ts.map +1 -0
  9. package/build-types/components/media-editor-crop-panel/index.d.ts +31 -0
  10. package/build-types/components/media-editor-crop-panel/index.d.ts.map +1 -0
  11. package/build-types/components/media-editor-fine-rotation/index.d.ts +15 -0
  12. package/build-types/components/media-editor-fine-rotation/index.d.ts.map +1 -0
  13. package/build-types/components/media-editor-image-controls/index.d.ts +46 -0
  14. package/build-types/components/media-editor-image-controls/index.d.ts.map +1 -0
  15. package/build-types/components/media-editor-keyboard-shortcuts-modal/index.d.ts +6 -0
  16. package/build-types/components/media-editor-keyboard-shortcuts-modal/index.d.ts.map +1 -0
  17. package/build-types/components/media-editor-modal/build-modifiers.d.ts +83 -0
  18. package/build-types/components/media-editor-modal/build-modifiers.d.ts.map +1 -0
  19. package/build-types/components/media-editor-modal/index.d.ts +20 -0
  20. package/build-types/components/media-editor-modal/index.d.ts.map +1 -0
  21. package/build-types/components/rotation-ruler/index.d.ts +46 -0
  22. package/build-types/components/rotation-ruler/index.d.ts.map +1 -0
  23. package/build-types/components/rotation-ruler/stories/index.story.d.ts +14 -0
  24. package/build-types/components/rotation-ruler/stories/index.story.d.ts.map +1 -0
  25. package/build-types/components/rotation-ruler/use-ruler-drag.d.ts +61 -0
  26. package/build-types/components/rotation-ruler/use-ruler-drag.d.ts.map +1 -0
  27. package/build-types/hooks/use-crop-gesture-handlers.d.ts +41 -0
  28. package/build-types/hooks/use-crop-gesture-handlers.d.ts.map +1 -0
  29. package/build-types/image-editor/core/camera.d.ts +107 -0
  30. package/build-types/image-editor/core/camera.d.ts.map +1 -0
  31. package/build-types/image-editor/core/constants.d.ts +83 -0
  32. package/build-types/image-editor/core/constants.d.ts.map +1 -0
  33. package/build-types/image-editor/core/containment.d.ts +75 -0
  34. package/build-types/image-editor/core/containment.d.ts.map +1 -0
  35. package/build-types/image-editor/core/crop-rect.d.ts +19 -0
  36. package/build-types/image-editor/core/crop-rect.d.ts.map +1 -0
  37. package/build-types/image-editor/core/export/canvas-renderer.d.ts +106 -0
  38. package/build-types/image-editor/core/export/canvas-renderer.d.ts.map +1 -0
  39. package/build-types/image-editor/core/index.d.ts +10 -0
  40. package/build-types/image-editor/core/index.d.ts.map +1 -0
  41. package/build-types/image-editor/core/interaction-controller.d.ts +194 -0
  42. package/build-types/image-editor/core/interaction-controller.d.ts.map +1 -0
  43. package/build-types/image-editor/core/math/rotation.d.ts +18 -0
  44. package/build-types/image-editor/core/math/rotation.d.ts.map +1 -0
  45. package/build-types/image-editor/core/math/sanitize.d.ts +70 -0
  46. package/build-types/image-editor/core/math/sanitize.d.ts.map +1 -0
  47. package/build-types/image-editor/core/setter-helpers.d.ts +24 -0
  48. package/build-types/image-editor/core/setter-helpers.d.ts.map +1 -0
  49. package/build-types/image-editor/core/source-region.d.ts +75 -0
  50. package/build-types/image-editor/core/source-region.d.ts.map +1 -0
  51. package/build-types/image-editor/core/state.d.ts +54 -0
  52. package/build-types/image-editor/core/state.d.ts.map +1 -0
  53. package/build-types/image-editor/core/stencil-math.d.ts +97 -0
  54. package/build-types/image-editor/core/stencil-math.d.ts.map +1 -0
  55. package/build-types/image-editor/core/transform-style.d.ts +23 -0
  56. package/build-types/image-editor/core/transform-style.d.ts.map +1 -0
  57. package/build-types/image-editor/core/transforms/pipeline.d.ts +27 -0
  58. package/build-types/image-editor/core/transforms/pipeline.d.ts.map +1 -0
  59. package/build-types/image-editor/core/types.d.ts +255 -0
  60. package/build-types/image-editor/core/types.d.ts.map +1 -0
  61. package/build-types/image-editor/core/viewport-state.d.ts +7 -0
  62. package/build-types/image-editor/core/viewport-state.d.ts.map +1 -0
  63. package/build-types/image-editor/index.d.ts +16 -0
  64. package/build-types/image-editor/index.d.ts.map +1 -0
  65. package/build-types/image-editor/react/components/cropper-provider.d.ts +41 -0
  66. package/build-types/image-editor/react/components/cropper-provider.d.ts.map +1 -0
  67. package/build-types/image-editor/react/components/cropper.d.ts +62 -0
  68. package/build-types/image-editor/react/components/cropper.d.ts.map +1 -0
  69. package/build-types/image-editor/react/components/index.d.ts +4 -0
  70. package/build-types/image-editor/react/components/index.d.ts.map +1 -0
  71. package/build-types/image-editor/react/components/overlays/dimensions-overlay.d.ts +36 -0
  72. package/build-types/image-editor/react/components/overlays/dimensions-overlay.d.ts.map +1 -0
  73. package/build-types/image-editor/react/components/overlays/dimming-overlay.d.ts +20 -0
  74. package/build-types/image-editor/react/components/overlays/dimming-overlay.d.ts.map +1 -0
  75. package/build-types/image-editor/react/components/overlays/grid-overlay.d.ts +30 -0
  76. package/build-types/image-editor/react/components/overlays/grid-overlay.d.ts.map +1 -0
  77. package/build-types/image-editor/react/components/stencils/rectangle-stencil.d.ts +33 -0
  78. package/build-types/image-editor/react/components/stencils/rectangle-stencil.d.ts.map +1 -0
  79. package/build-types/image-editor/react/components/viewport-provider.d.ts +9 -0
  80. package/build-types/image-editor/react/components/viewport-provider.d.ts.map +1 -0
  81. package/build-types/image-editor/react/hooks/build-cropper-setters.d.ts +47 -0
  82. package/build-types/image-editor/react/hooks/build-cropper-setters.d.ts.map +1 -0
  83. package/build-types/image-editor/react/hooks/index.d.ts +5 -0
  84. package/build-types/image-editor/react/hooks/index.d.ts.map +1 -0
  85. package/build-types/image-editor/react/hooks/use-aria-announcer.d.ts +16 -0
  86. package/build-types/image-editor/react/hooks/use-aria-announcer.d.ts.map +1 -0
  87. package/build-types/image-editor/react/hooks/use-cropper-reducer.d.ts +58 -0
  88. package/build-types/image-editor/react/hooks/use-cropper-reducer.d.ts.map +1 -0
  89. package/build-types/image-editor/react/hooks/use-interaction.d.ts +63 -0
  90. package/build-types/image-editor/react/hooks/use-interaction.d.ts.map +1 -0
  91. package/build-types/image-editor/react/hooks/use-transform-style.d.ts +16 -0
  92. package/build-types/image-editor/react/hooks/use-transform-style.d.ts.map +1 -0
  93. package/build-types/image-editor/react/hooks/use-viewport-state.d.ts +19 -0
  94. package/build-types/image-editor/react/hooks/use-viewport-state.d.ts.map +1 -0
  95. package/build-types/image-editor/react/visually-hidden-style.d.ts +6 -0
  96. package/build-types/image-editor/react/visually-hidden-style.d.ts.map +1 -0
  97. package/build-types/image-editor/stories/rectangle-crop.story.d.ts +16 -0
  98. package/build-types/image-editor/stories/rectangle-crop.story.d.ts.map +1 -0
  99. package/build-types/lock-unlock.d.ts +2 -0
  100. package/build-types/lock-unlock.d.ts.map +1 -0
  101. package/build-types/private-apis.d.ts +2 -0
  102. package/build-types/private-apis.d.ts.map +1 -0
  103. package/build-types/state/composite-reducer.d.ts +39 -0
  104. package/build-types/state/composite-reducer.d.ts.map +1 -0
  105. package/build-types/state/index.d.ts +7 -0
  106. package/build-types/state/index.d.ts.map +1 -0
  107. package/build-types/state/media-editor-state-provider.d.ts +34 -0
  108. package/build-types/state/media-editor-state-provider.d.ts.map +1 -0
  109. package/build-types/state/types.d.ts +96 -0
  110. package/build-types/state/types.d.ts.map +1 -0
  111. package/build-types/state/use-media-editor-state.d.ts +101 -0
  112. package/build-types/state/use-media-editor-state.d.ts.map +1 -0
  113. package/build-types/store/actions.d.ts +29 -0
  114. package/build-types/store/actions.d.ts.map +1 -0
  115. package/build-types/store/constants.d.ts +2 -0
  116. package/build-types/store/constants.d.ts.map +1 -0
  117. package/build-types/store/index.d.ts +4 -0
  118. package/build-types/store/index.d.ts.map +1 -0
  119. package/build-types/store/reducer.d.ts +26 -0
  120. package/build-types/store/reducer.d.ts.map +1 -0
  121. package/build-types/store/selectors.d.ts +9 -0
  122. package/build-types/store/selectors.d.ts.map +1 -0
  123. package/package.json +6 -6
  124. package/tsconfig.tsbuildinfo +1 -1
@@ -0,0 +1,70 @@
1
+ /**
2
+ * Internal dependencies
3
+ */
4
+ import type { CropperState, NormalizedRect, Size } from '../types';
5
+ /**
6
+ * Returns `value` if it's finite and within `[-MAX_SAFE_MAGNITUDE,
7
+ * MAX_SAFE_MAGNITUDE]`, otherwise `fallback`. Stricter than `Number.isFinite`
8
+ * because extreme finite magnitudes (e.g. `Number.MAX_VALUE`) overflow
9
+ * downstream trig/matrix math even though the spec reports them as finite.
10
+ *
11
+ * Note: sub-normal denormals (e.g. `Number.MIN_VALUE`) are accepted by this
12
+ * function — they don't overflow on their own. Protection against divisions
13
+ * by sub-normal values lives in `sanitizeCropperState`'s zoom guard.
14
+ *
15
+ * @param value The candidate value.
16
+ * @param fallback The replacement to return when `value` is unsafe.
17
+ * @return Either `value` or `fallback`.
18
+ */
19
+ export declare function safeBoundedNumber(value: number, fallback: number): number;
20
+ /**
21
+ * Returns `true` when `value` is finite and within `[-MAX_SAFE_MAGNITUDE,
22
+ * MAX_SAFE_MAGNITUDE]`. The predicate companion to {@link safeBoundedNumber}
23
+ * for callers that need to short-circuit rather than substitute a fallback.
24
+ *
25
+ * @param value The candidate value.
26
+ * @return Whether `value` is safe to use in math.
27
+ */
28
+ export declare function isSafeNumber(value: number): boolean;
29
+ /**
30
+ * Returns `true` when both dimensions are finite and within the safe
31
+ * range `[Number.EPSILON, MAX_SAFE_MAGNITUDE]`. The lower bound matters
32
+ * because sub-normal dimensions (e.g. `Number.MIN_VALUE`) pass `> 0` but
33
+ * make `container / dim` overflow to `Infinity` downstream in
34
+ * `getImageFit` / `createCamera`. Use this to short-circuit math that
35
+ * would otherwise produce non-finite output.
36
+ *
37
+ * @param size The size to check.
38
+ * @return Whether `size` is safe to use in math.
39
+ */
40
+ export declare function isValidSize(size: Size): boolean;
41
+ /**
42
+ * Returns a copy of `rect` with every numeric field replaced by a safe
43
+ * value via {@link safeBoundedNumber}. Returns the same reference when no
44
+ * field needed substitution so callers can keep their reference-equality
45
+ * short-circuits intact for clean inputs.
46
+ *
47
+ * @param rect The rect to sanitize.
48
+ * @return A rect with all numeric fields finite.
49
+ */
50
+ export declare function sanitizeRect(rect: NormalizedRect): NormalizedRect;
51
+ /**
52
+ * Returns a copy of `state` with the cropper-math numeric fields replaced
53
+ * by safe defaults. Covers `pan`, `zoom`, `rotation`, the matching base
54
+ * pose, and `cropRect`. The `state.image` numeric fields (naturalWidth /
55
+ * naturalHeight) are intentionally NOT sanitized — image dimensions reach
56
+ * the math layer as a separate `imageSize` argument, and cloning the
57
+ * image object here would break the reducer's reference-equality
58
+ * short-circuit.
59
+ *
60
+ * Returns the same `state` reference when no field needed substitution
61
+ * so callers in hot paths (every pointermove via `restrictPanZoom`) can
62
+ * keep their reference-equality optimizations. Sub-object references
63
+ * (`pan`, `basePan`, `cropRect`) are also preserved when their fields
64
+ * are individually clean.
65
+ *
66
+ * @param state The cropper state to sanitize.
67
+ * @return A cropper state with the math-relevant numeric fields finite.
68
+ */
69
+ export declare function sanitizeCropperState(state: CropperState): CropperState;
70
+ //# sourceMappingURL=sanitize.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sanitize.d.ts","sourceRoot":"","sources":["../../../../src/image-editor/core/math/sanitize.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAUnE;;;;;;;;;;;;;GAaG;AACH,wBAAgB,iBAAiB,CAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAI,MAAM,CAQ3E;AAED;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAAE,KAAK,EAAE,MAAM,GAAI,OAAO,CAErD;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,WAAW,CAAE,IAAI,EAAE,IAAI,GAAI,OAAO,CASjD;AAED;;;;;;;;GAQG;AACH,wBAAgB,YAAY,CAAE,IAAI,EAAE,cAAc,GAAI,cAAc,CAcnE;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,oBAAoB,CAAE,KAAK,EAAE,YAAY,GAAI,YAAY,CA2CxE"}
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Internal dependencies
3
+ */
4
+ import type { CropperState, CropperAction } from './types';
5
+ /**
6
+ * Build the reducer action that produces a "cursorless" zoom — zoom
7
+ * anchored at the current crop-rect center, with pan clamped to keep
8
+ * the image covering the crop.
9
+ *
10
+ * The slider, the `+`/`-` keys, and the toolbar buttons have no
11
+ * natural focal point (unlike wheel/pinch zoom), so they default to
12
+ * the crop center. Returns `null` when the clamped zoom matches the
13
+ * current zoom (no-op).
14
+ *
15
+ * Extracted so multiple hooks (the pure `useCropperReducer` and the
16
+ * composite `useMediaEditorState`) can share the math without
17
+ * duplicating it.
18
+ *
19
+ * @param state The current cropper state.
20
+ * @param requestedZoom The zoom value the caller asked for.
21
+ * @return A `SET_ZOOM_AT_POINT` action, or `null` if no change is required.
22
+ */
23
+ export declare function buildFocalPointZoomAction(state: CropperState, requestedZoom: number): CropperAction | null;
24
+ //# sourceMappingURL=setter-helpers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"setter-helpers.d.ts","sourceRoot":"","sources":["../../../src/image-editor/core/setter-helpers.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,YAAY,EAAmB,aAAa,EAAE,MAAM,SAAS,CAAC;AAI5E;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,yBAAyB,CACxC,KAAK,EAAE,YAAY,EACnB,aAAa,EAAE,MAAM,GACnB,aAAa,GAAG,IAAI,CAqCtB"}
@@ -0,0 +1,75 @@
1
+ /**
2
+ * Internal dependencies
3
+ */
4
+ import type { CropperState, Size } from './types';
5
+ /**
6
+ * The selected image region in source-pixel coordinates.
7
+ */
8
+ export interface SourceRegion {
9
+ /** X offset in source pixels. */
10
+ x: number;
11
+ /** Y offset in source pixels. */
12
+ y: number;
13
+ /** Width in source pixels. */
14
+ width: number;
15
+ /** Height in source pixels. */
16
+ height: number;
17
+ /** Rotation in degrees (0-360). */
18
+ rotation: number;
19
+ /** Flip state. */
20
+ flip: {
21
+ horizontal: boolean;
22
+ vertical: boolean;
23
+ };
24
+ /** Zoom factor applied. */
25
+ zoom: number;
26
+ }
27
+ /**
28
+ * Get the selected image region in source-pixel coordinates.
29
+ *
30
+ * Converts the current crop state (normalized visual space) to the actual
31
+ * region of the original image that's selected. This is the bridge between
32
+ * the cropper's internal coordinate system and external tools (image
33
+ * processing libraries, AI APIs, server-side processing) that work in
34
+ * source-pixel coordinates.
35
+ *
36
+ * The returned rectangle accounts for pan, zoom, and the crop rect position,
37
+ * but expresses the crop in the unrotated image's coordinate space. Rotation
38
+ * and flip are included as separate fields since they represent transforms,
39
+ * not a region.
40
+ *
41
+ * @param state The current cropper state.
42
+ * @param imageSize The natural dimensions of the source image.
43
+ * @return The selected region in source pixels plus rotation/flip metadata.
44
+ */
45
+ export declare function getSourceRegion(state: CropperState, imageSize: Size): SourceRegion;
46
+ /**
47
+ * The selected crop region expressed as percentages of the source image.
48
+ */
49
+ export interface SourceRegionPercent {
50
+ /** X offset as a percentage (0–100) of the source image width. */
51
+ x: number;
52
+ /** Y offset as a percentage (0–100) of the source image height. */
53
+ y: number;
54
+ /** Width as a percentage (0–100) of the source image width. */
55
+ width: number;
56
+ /** Height as a percentage (0–100) of the source image height. */
57
+ height: number;
58
+ }
59
+ /**
60
+ * Get the selected image region as percentages of the source image dimensions.
61
+ *
62
+ * Returns `{ x, y, width, height }` where each value is a percentage (0–100)
63
+ * of the source image's natural width or height. This format is compatible
64
+ * with the WordPress REST API attachments `/edit` endpoint and CSS-based
65
+ * crop workflows.
66
+ *
67
+ * Internally delegates to `getSourceRegion` and divides by the image
68
+ * dimensions, so accuracy is identical.
69
+ *
70
+ * @param state The current cropper state.
71
+ * @param imageSize The natural dimensions of the source image.
72
+ * @return The crop region as percentages (0–100).
73
+ */
74
+ export declare function getSourceRegionPercent(state: CropperState, imageSize: Size): SourceRegionPercent;
75
+ //# sourceMappingURL=source-region.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"source-region.d.ts","sourceRoot":"","sources":["../../../src/image-editor/core/source-region.ts"],"names":[],"mappings":"AAKA;;GAEG;AACH,OAAO,KAAK,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAIlD;;GAEG;AACH,MAAM,WAAW,YAAY;IAC5B,iCAAiC;IACjC,CAAC,EAAE,MAAM,CAAC;IACV,iCAAiC;IACjC,CAAC,EAAE,MAAM,CAAC;IACV,8BAA8B;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,+BAA+B;IAC/B,MAAM,EAAE,MAAM,CAAC;IACf,mCAAmC;IACnC,QAAQ,EAAE,MAAM,CAAC;IACjB,kBAAkB;IAClB,IAAI,EAAE;QAAE,UAAU,EAAE,OAAO,CAAC;QAAC,QAAQ,EAAE,OAAO,CAAA;KAAE,CAAC;IACjD,2BAA2B;IAC3B,IAAI,EAAE,MAAM,CAAC;CACb;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,eAAe,CAC9B,KAAK,EAAE,YAAY,EACnB,SAAS,EAAE,IAAI,GACb,YAAY,CA0Ed;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IACnC,kEAAkE;IAClE,CAAC,EAAE,MAAM,CAAC;IACV,mEAAmE;IACnE,CAAC,EAAE,MAAM,CAAC;IACV,+DAA+D;IAC/D,KAAK,EAAE,MAAM,CAAC;IACd,iEAAiE;IACjE,MAAM,EAAE,MAAM,CAAC;CACf;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,sBAAsB,CACrC,KAAK,EAAE,YAAY,EACnB,SAAS,EAAE,IAAI,GACb,mBAAmB,CAWrB"}
@@ -0,0 +1,54 @@
1
+ /**
2
+ * Internal dependencies
3
+ */
4
+ import type { CropperAction, CropperState } from './types';
5
+ /**
6
+ * Value-equality check for two cropper states.
7
+ *
8
+ * Used by history machinery to dedup snapshots and detect no-op
9
+ * transitions. Compares every field that participates in the rendered
10
+ * output; ignores reference identity.
11
+ *
12
+ * @param a First cropper state.
13
+ * @param b Second cropper state.
14
+ * @return Whether the two states are value-equal across all tracked fields.
15
+ */
16
+ export declare function areCropperStatesEqual(a: CropperState, b: CropperState): boolean;
17
+ /**
18
+ * Enforces containment: restricts the crop rect to fit within the
19
+ * rotated image, computes minimum zoom, clamps zoom, and restricts
20
+ * the pan position so the image always covers the crop area.
21
+ * Called after every relevant state transition.
22
+ *
23
+ * @param state The state to enforce containment on.
24
+ * @return The state with cropRect, zoom, and position restricted.
25
+ */
26
+ export declare function enforceContainment(state: CropperState): CropperState;
27
+ /**
28
+ * Reducer function for cropper state management.
29
+ *
30
+ * Every state transition that could invalidate the containment invariant
31
+ * (crop, zoom, rotation, cropRect, flip) is followed by enforceContainment
32
+ * to ensure the image always covers the crop area.
33
+ *
34
+ * Committing actions (everything except SET_ROTATION) also call
35
+ * `commitBase` to snapshot the post-containment state as the new
36
+ * base pose. SET_ROTATION derives from that base without mutating
37
+ * it, which prevents accumulated-clamp drift during continuous fine
38
+ * rotation.
39
+ *
40
+ * @param state The current cropper state.
41
+ * @param action The action to process.
42
+ * @return The new cropper state.
43
+ */
44
+ export declare function cropperReducer(state: CropperState, action: CropperAction): CropperState;
45
+ /**
46
+ * Shallow comparison of key cropper state fields to determine if
47
+ * the state has been modified from an initial snapshot.
48
+ *
49
+ * @param current The current cropper state.
50
+ * @param initial The initial cropper state snapshot.
51
+ * @return True if any tracked field differs.
52
+ */
53
+ export declare function isStateDirty(current: CropperState, initial: CropperState): boolean;
54
+ //# sourceMappingURL=state.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"state.d.ts","sourceRoot":"","sources":["../../../src/image-editor/core/state.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,aAAa,EAAE,YAAY,EAAsB,MAAM,SAAS,CAAC;AAiB/E;;;;;;;;;;GAUG;AACH,wBAAgB,qBAAqB,CACpC,CAAC,EAAE,YAAY,EACf,CAAC,EAAE,YAAY,GACb,OAAO,CAkBT;AA6DD;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CAAE,KAAK,EAAE,YAAY,GAAI,YAAY,CAgDtE;AAgCD;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,cAAc,CAC7B,KAAK,EAAE,YAAY,EACnB,MAAM,EAAE,aAAa,GACnB,YAAY,CA8Od;AAED;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAC3B,OAAO,EAAE,YAAY,EACrB,OAAO,EAAE,YAAY,GACnB,OAAO,CAaT"}
@@ -0,0 +1,97 @@
1
+ import type { HandlePosition, NormalizedRect, Size } from './types';
2
+ export type { HandlePosition };
3
+ /**
4
+ * Resolve the minimum crop dimension, in source-image pixels, for the current
5
+ * display scale.
6
+ *
7
+ * Two floors compete: a fixed source-pixel floor (`MIN_CROP_PIXELS`) that
8
+ * avoids sub-pixel crops, and an on-screen floor (`MIN_CROP_SCREEN_PX`) that
9
+ * keeps the crop large enough to grab. The on-screen floor converted to source
10
+ * pixels is `MIN_CROP_SCREEN_PX / displayScale`; the binding constraint is the
11
+ * larger of the two. When zoomed out (small `displayScale`) the on-screen floor
12
+ * dominates; once the image is shown large enough the source-pixel floor takes
13
+ * over.
14
+ *
15
+ * @param displayScale CSS pixels rendered per source pixel (fit scale × zoom).
16
+ * @return Minimum crop dimension in source-image pixels.
17
+ */
18
+ export declare function getMinCropPixels(displayScale: number): number;
19
+ /**
20
+ * Default minimum crop rect dimension in normalized space, used when no
21
+ * explicit per-axis minimum is supplied (e.g. before the source image
22
+ * has loaded). Real usage derives a pixel-based min from the source
23
+ * image dimensions and `MIN_CROP_PIXELS` in `constants.ts`.
24
+ */
25
+ export declare const DEFAULT_MIN_CROP_SIZE: Size;
26
+ /**
27
+ * Bounds within which the crop rect must stay.
28
+ */
29
+ export interface CropBounds {
30
+ minX: number;
31
+ minY: number;
32
+ maxX: number;
33
+ maxY: number;
34
+ }
35
+ /**
36
+ * Drag state for tracking a resize interaction.
37
+ */
38
+ export interface ResizeDragState {
39
+ /** Which handle is being dragged. */
40
+ handle: HandlePosition;
41
+ /** The mouse position (pixels) when the drag started. */
42
+ startX: number;
43
+ startY: number;
44
+ /** The crop rect (normalized) when the drag started. */
45
+ startRect: NormalizedRect;
46
+ }
47
+ /**
48
+ * Compute the new crop rect for a free (no aspect ratio) resize.
49
+ *
50
+ * Each edge moves independently based on the handle being dragged.
51
+ * Edges are clamped to the provided bounds and maintain a minimum size.
52
+ *
53
+ * @param drag The current drag state.
54
+ * @param clientX Current mouse/touch X position in pixels.
55
+ * @param clientY Current mouse/touch Y position in pixels.
56
+ * @param imageSize The rendered image dimensions in pixels.
57
+ * @param bounds The allowed crop area bounds.
58
+ * @param minCropSize Minimum crop rect dimension in normalized space, per axis.
59
+ * @return The new crop rect in normalized coordinates.
60
+ */
61
+ export declare function computeFreeResizeRect(drag: ResizeDragState, clientX: number, clientY: number, imageSize: Size, bounds: CropBounds, minCropSize?: Size): NormalizedRect;
62
+ /**
63
+ * Compute the new crop rect for a locked-aspect-ratio corner resize.
64
+ *
65
+ * The opposite corner is the anchor. The dragged corner moves freely
66
+ * but the result is clamped to maintain the aspect ratio and stay
67
+ * within bounds.
68
+ *
69
+ * @param drag The current drag state.
70
+ * @param clientX Current mouse/touch X position in pixels.
71
+ * @param clientY Current mouse/touch Y position in pixels.
72
+ * @param imageSize The rendered image dimensions in pixels.
73
+ * @param bounds The allowed crop area bounds.
74
+ * @param normalizedRatio The locked aspect ratio (width / height in normalized space).
75
+ * @param minCropSize Minimum crop rect dimension in normalized space, per axis.
76
+ * @return The new crop rect in normalized coordinates.
77
+ */
78
+ export declare function computeLockedResizeRect(drag: ResizeDragState, clientX: number, clientY: number, imageSize: Size, bounds: CropBounds, normalizedRatio: number, minCropSize?: Size): NormalizedRect;
79
+ /**
80
+ * Compute the new crop rect for a resize that temporarily locks the
81
+ * aspect ratio to `drag.startRect`'s ratio (e.g. while Shift is held).
82
+ *
83
+ * Corner handles delegate to {@link computeLockedResizeRect}. Edge
84
+ * handles size the dragged axis freely, then expand the perpendicular
85
+ * axis symmetrically around the rect's center to preserve the ratio,
86
+ * clamping symmetrically so the rect stays within bounds.
87
+ *
88
+ * @param drag The current drag state.
89
+ * @param clientX Current mouse/touch X position in pixels.
90
+ * @param clientY Current mouse/touch Y position in pixels.
91
+ * @param imageSize The rendered image dimensions in pixels.
92
+ * @param bounds The allowed crop area bounds.
93
+ * @param minCropSize Minimum crop rect dimension in normalized space, per axis.
94
+ * @return The new crop rect in normalized coordinates.
95
+ */
96
+ export declare function computeShiftLockedResizeRect(drag: ResizeDragState, clientX: number, clientY: number, imageSize: Size, bounds: CropBounds, minCropSize?: Size): NormalizedRect;
97
+ //# sourceMappingURL=stencil-math.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stencil-math.d.ts","sourceRoot":"","sources":["../../../src/image-editor/core/stencil-math.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAEpE,YAAY,EAAE,cAAc,EAAE,CAAC;AAE/B;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,gBAAgB,CAAE,YAAY,EAAE,MAAM,GAAI,MAAM,CAK/D;AAED;;;;;GAKG;AACH,eAAO,MAAM,qBAAqB,EAAE,IAAoC,CAAC;AAEzE;;GAEG;AACH,MAAM,WAAW,UAAU;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACb;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC/B,qCAAqC;IACrC,MAAM,EAAE,cAAc,CAAC;IACvB,yDAAyD;IACzD,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,wDAAwD;IACxD,SAAS,EAAE,cAAc,CAAC;CAC1B;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,qBAAqB,CACpC,IAAI,EAAE,eAAe,EACrB,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,IAAI,EACf,MAAM,EAAE,UAAU,EAClB,WAAW,GAAE,IAA4B,GACvC,cAAc,CA6ChB;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,uBAAuB,CACtC,IAAI,EAAE,eAAe,EACrB,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,IAAI,EACf,MAAM,EAAE,UAAU,EAClB,eAAe,EAAE,MAAM,EACvB,WAAW,GAAE,IAA4B,GACvC,cAAc,CAuFhB;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,4BAA4B,CAC3C,IAAI,EAAE,eAAe,EACrB,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,IAAI,EACf,MAAM,EAAE,UAAU,EAClB,WAAW,GAAE,IAA4B,GACvC,cAAc,CA0GhB"}
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Internal dependencies
3
+ */
4
+ import type { CropperState, Size } from './types';
5
+ /**
6
+ * Computes a CSS matrix() transform string from the cropper state.
7
+ *
8
+ * The combined transform is: translate(tx, ty) * scale(sx, sy) * rotate(r) * scale(z)
9
+ * expressed as a 2D CSS matrix(a, b, c, d, tx, ty).
10
+ *
11
+ * Flip is composed outside rotation so it is viewport-relative — horizontal
12
+ * flip mirrors across the viewport's vertical axis regardless of rotation.
13
+ * Must match the matrix order in `createCamera` / `getImageCropBounds`.
14
+ *
15
+ * This is a pure function with no framework dependencies. The React hook
16
+ * `useTransformStyle` wraps this in `useMemo` for memoization.
17
+ *
18
+ * @param state The current cropper state.
19
+ * @param imageSize The rendered image dimensions in pixels.
20
+ * @return A CSS transform string.
21
+ */
22
+ export declare function computeTransformStyle(state: CropperState, imageSize: Size): string;
23
+ //# sourceMappingURL=transform-style.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"transform-style.d.ts","sourceRoot":"","sources":["../../../src/image-editor/core/transform-style.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAOlD;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,qBAAqB,CACpC,KAAK,EAAE,YAAY,EACnB,SAAS,EAAE,IAAI,GACb,MAAM,CA4BR"}
@@ -0,0 +1,27 @@
1
+ /**
2
+ * Internal dependencies
3
+ */
4
+ import type { TransformOperation, CropperState } from '../types';
5
+ /**
6
+ * Apply a single transform operation to a cropper state, returning
7
+ * a new state with the containment invariant enforced.
8
+ *
9
+ * Delegates to the reducer via APPLY_OPERATION so pipeline replay
10
+ * produces identical bounded state to UI interaction or setter
11
+ * calls. The same logical operation yields the same result
12
+ * regardless of entrypoint.
13
+ *
14
+ * @param state The current cropper state.
15
+ * @param op The operation to apply.
16
+ * @return A new cropper state with the operation applied.
17
+ */
18
+ export declare function applyOperationToState(state: CropperState, op: TransformOperation): CropperState;
19
+ /**
20
+ * Replay all operations from an initial state to produce the final state.
21
+ *
22
+ * @param pipeline The array of transform operations to replay.
23
+ * @param initialState The starting state. Defaults to DEFAULT_STATE.
24
+ * @return The resulting cropper state after all operations are applied.
25
+ */
26
+ export declare function stateFromPipeline(pipeline: TransformOperation[], initialState?: CropperState): CropperState;
27
+ //# sourceMappingURL=pipeline.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pipeline.d.ts","sourceRoot":"","sources":["../../../../src/image-editor/core/transforms/pipeline.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAIjE;;;;;;;;;;;;GAYG;AACH,wBAAgB,qBAAqB,CACpC,KAAK,EAAE,YAAY,EACnB,EAAE,EAAE,kBAAkB,GACpB,YAAY,CAEd;AAED;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAChC,QAAQ,EAAE,kBAAkB,EAAE,EAC9B,YAAY,GAAE,YAAmC,GAC/C,YAAY,CAKd"}
@@ -0,0 +1,255 @@
1
+ import type { mat2d } from 'gl-matrix';
2
+ /**
3
+ * A 2D camera represented as a 2×3 affine transformation matrix (`mat2d`).
4
+ *
5
+ * This is not a camera object with properties — it's a raw 6-element matrix
6
+ * `[a, b, c, d, tx, ty]` that maps normalized world coordinates [0,1] to
7
+ * screen pixels. It composes pan, rotation, flip, zoom, and contain-fit
8
+ * into a single transform.
9
+ *
10
+ * Use `createCamera()` to build one from `CropperState`, then pass it to
11
+ * `worldToScreen()` / `screenToWorld()` for coordinate conversion.
12
+ *
13
+ * A 3D camera would use `mat4`; this is strictly 2D (no perspective).
14
+ */
15
+ export type Camera = mat2d;
16
+ /**
17
+ * A point with normalized coordinates (0-1 range relative to image dimensions).
18
+ */
19
+ export interface NormalizedPoint {
20
+ x: number;
21
+ y: number;
22
+ }
23
+ /**
24
+ * A rectangle with normalized coordinates (0-1 range).
25
+ * Origin is the top-left corner of the image.
26
+ */
27
+ export interface NormalizedRect {
28
+ x: number;
29
+ y: number;
30
+ width: number;
31
+ height: number;
32
+ }
33
+ /**
34
+ * Width and height dimensions.
35
+ */
36
+ export interface Size {
37
+ width: number;
38
+ height: number;
39
+ }
40
+ /**
41
+ * Flip state for horizontal and vertical axes.
42
+ */
43
+ export interface Flip {
44
+ horizontal: boolean;
45
+ vertical: boolean;
46
+ }
47
+ /**
48
+ * A JSON-serializable transform operation for the non-destructive pipeline.
49
+ */
50
+ export type TransformOperation = {
51
+ type: 'crop';
52
+ rect: NormalizedRect;
53
+ } | {
54
+ type: 'rotate';
55
+ degrees: number;
56
+ } | {
57
+ type: 'flip';
58
+ direction: 'horizontal' | 'vertical';
59
+ } | {
60
+ type: 'zoom';
61
+ factor: number;
62
+ };
63
+ /**
64
+ * Full cropper state.
65
+ */
66
+ export interface CropperState {
67
+ /** The source image information. Null until an image is loaded. */
68
+ image: {
69
+ src: string;
70
+ naturalWidth: number;
71
+ naturalHeight: number;
72
+ } | null;
73
+ /**
74
+ * Image pan offset in normalized coordinates. Not the crop
75
+ * rectangle — that's `cropRect` below.
76
+ */
77
+ pan: NormalizedPoint;
78
+ /** Zoom level. 1 = no zoom. */
79
+ zoom: number;
80
+ /** Rotation in degrees, normalized to 0-360. */
81
+ rotation: number;
82
+ /**
83
+ * Base pan/zoom/rotation — the pose the user last explicitly set.
84
+ *
85
+ * During continuous fine rotation (SET_ROTATION), every tick
86
+ * re-derives the transient `pan`/`zoom` from these base values
87
+ * rather than compounding on the previous tick. This prevents
88
+ * drift from accumulated containment clamping near image edges:
89
+ * rotating 0°→30°→0° returns to the exact starting pan, not a
90
+ * slightly-nudged version of it.
91
+ *
92
+ * These are updated by every action except SET_ROTATION itself —
93
+ * explicit zoom, pan, crop-rect, flip, and 90° snap all commit
94
+ * the post-containment state into base. SET_ROTATION reads from
95
+ * `basePan` and `baseRotation` to compute the new pan, and reads
96
+ * `baseZoom` as the zoom floor (enforceContainment may bump it up
97
+ * to cover the rotated crop, but never leaves it above baseZoom).
98
+ */
99
+ basePan: NormalizedPoint;
100
+ baseZoom: number;
101
+ baseRotation: number;
102
+ /** Flip state. */
103
+ flip: Flip;
104
+ /** The crop rectangle in normalized coordinates. */
105
+ cropRect: NormalizedRect;
106
+ }
107
+ /**
108
+ * Internal reducer action union.
109
+ *
110
+ * This type is intentionally not exported from the image-editor public barrel.
111
+ * Consumers should drive state through the controller returned by
112
+ * `useCropperReducer()` (or a composite store) or through serializable
113
+ * `TransformOperation` values.
114
+ */
115
+ export type CropperAction =
116
+ /** Sets the loaded image metadata (natural size, src). */
117
+ {
118
+ type: 'SET_IMAGE';
119
+ payload: CropperState['image'];
120
+ }
121
+ /** Sets the image pan offset. (Crop rectangle is SET_CROP_RECT.) */
122
+ | {
123
+ type: 'SET_PAN';
124
+ payload: NormalizedPoint;
125
+ }
126
+ /** Sets the zoom level, clamped to [coverage-aware min, MAX_ZOOM]. */
127
+ | {
128
+ type: 'SET_ZOOM';
129
+ payload: number;
130
+ }
131
+ /**
132
+ * Sets zoom and pan together atomically. Used by focal-point
133
+ * zoom (wheel, pinch) to keep a target point stationary while
134
+ * zoom changes.
135
+ */
136
+ | {
137
+ type: 'SET_ZOOM_AT_POINT';
138
+ payload: {
139
+ zoom: number;
140
+ pan: NormalizedPoint;
141
+ };
142
+ }
143
+ /** Sets the absolute rotation angle in degrees. */
144
+ | {
145
+ type: 'SET_ROTATION';
146
+ payload: number;
147
+ }
148
+ /** Rotates by +/-90 degrees (snap). */
149
+ | {
150
+ type: 'SNAP_ROTATE_90';
151
+ payload: {
152
+ direction: 1 | -1;
153
+ };
154
+ }
155
+ /** Sets the flip state. */
156
+ | {
157
+ type: 'SET_FLIP';
158
+ payload: Flip;
159
+ }
160
+ /** Sets the crop rectangle. */
161
+ | {
162
+ type: 'SET_CROP_RECT';
163
+ payload: NormalizedRect;
164
+ }
165
+ /** Settle animation after resize drag, recentering the crop rect. */
166
+ | {
167
+ type: 'SETTLE_CROP';
168
+ }
169
+ /** Applies a single pipeline transform via the reducer. */
170
+ | {
171
+ type: 'APPLY_OPERATION';
172
+ payload: TransformOperation;
173
+ }
174
+ /** Resets to DEFAULT_STATE, optionally merging a partial override. */
175
+ | {
176
+ type: 'RESET';
177
+ payload?: Partial<CropperState>;
178
+ };
179
+ /**
180
+ * Viewport camera state — display-only, does not affect export or undo.
181
+ *
182
+ * Applied as a CSS transform on the inner stage div so the user can scroll
183
+ * the view independently of the crop. zoom > 1 magnifies; pan shifts in CSS px.
184
+ */
185
+ export interface ViewportState {
186
+ zoom: number;
187
+ pan: {
188
+ x: number;
189
+ y: number;
190
+ };
191
+ }
192
+ export type ViewportAction = {
193
+ type: 'SET_VIEWPORT_ZOOM';
194
+ payload: number;
195
+ } | {
196
+ type: 'SET_VIEWPORT_PAN';
197
+ payload: {
198
+ x: number;
199
+ y: number;
200
+ };
201
+ } | {
202
+ type: 'RESET_VIEWPORT';
203
+ };
204
+ /**
205
+ * Direction of a crop resize handle. Eight compass positions: four
206
+ * corners and four edge midpoints. Used by stencil callbacks and any
207
+ * overlay that needs to know which handle the user is dragging.
208
+ */
209
+ export type HandlePosition = 'n' | 's' | 'e' | 'w' | 'nw' | 'ne' | 'sw' | 'se';
210
+ /**
211
+ * The contract for a pluggable stencil component.
212
+ * Stencils render the crop area overlay and handle resize interactions.
213
+ */
214
+ export interface StencilProps {
215
+ /** The current crop rectangle in normalized coordinates. */
216
+ cropRect: NormalizedRect;
217
+ /** The container element dimensions in pixels. */
218
+ containerSize: Size;
219
+ /** The rendered image dimensions in pixels within the container. */
220
+ imageSize: Size;
221
+ /** Callback when the crop rectangle changes (during drag). */
222
+ onCropChange: (rect: NormalizedRect) => void;
223
+ /**
224
+ * Callback when a resize interaction starts — pointerdown on a handle
225
+ * or the first arrow-key press on a focused handle. The handle direction
226
+ * is passed so downstream overlays can anchor to it. The argument is
227
+ * optional to keep custom stencils that don't track a direction
228
+ * backward-compatible.
229
+ */
230
+ onResizeStart?: (handle?: HandlePosition) => void;
231
+ /** Callback when a resize drag ends (mouseup after handle drag). */
232
+ onResizeEnd?: () => void;
233
+ /** Optional fixed aspect ratio (width / height) in pixel space. */
234
+ aspectRatio?: number;
235
+ /** Whether the crop handles are shown for freeform resizing. */
236
+ freeformCrop?: boolean;
237
+ /** CSS transition string for settle animation. */
238
+ stencilTransition?: string;
239
+ /** Maximum crop rect bounds based on current zoom/rotation. */
240
+ cropBounds?: {
241
+ minX: number;
242
+ minY: number;
243
+ maxX: number;
244
+ maxY: number;
245
+ };
246
+ /** Called when Escape is pressed on a resize handle. */
247
+ onEscape?: () => void;
248
+ /**
249
+ * Minimum crop rect dimension in normalized space, per axis. Derived
250
+ * by the host from a pixel-based floor (see `MIN_CROP_PIXELS`) and
251
+ * the source image dimensions. Omit to use the stencil's default.
252
+ */
253
+ minCropSize?: Size;
254
+ }
255
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/image-editor/core/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAEvC;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,MAAM,GAAG,KAAK,CAAC;AAE3B;;GAEG;AACH,MAAM,WAAW,eAAe;IAC/B,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACV;AAED;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC9B,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CACf;AAED;;GAEG;AACH,MAAM,WAAW,IAAI;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CACf;AAED;;GAEG;AACH,MAAM,WAAW,IAAI;IACpB,UAAU,EAAE,OAAO,CAAC;IACpB,QAAQ,EAAE,OAAO,CAAC;CAClB;AAED;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAC3B;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,cAAc,CAAA;CAAE,GACtC;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,GACnC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,YAAY,GAAG,UAAU,CAAA;CAAE,GACtD;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AAEpC;;GAEG;AACH,MAAM,WAAW,YAAY;IAC5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