@techzyapp/ui-library 1.0.44 → 1.0.45

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 (377) hide show
  1. package/dist/{AdminRoot-9KE3ll-D.js → AdminRoot-BZ1v5vN9.js} +7 -7
  2. package/dist/{AdminRoot-9KE3ll-D.js.map → AdminRoot-BZ1v5vN9.js.map} +1 -1
  3. package/dist/{AdminRoot-BMzHo0n7.cjs → AdminRoot-DJ4-UMAB.cjs} +2 -2
  4. package/dist/{AdminRoot-BMzHo0n7.cjs.map → AdminRoot-DJ4-UMAB.cjs.map} +1 -1
  5. package/dist/{Alert-BFfzpPNd.js → Alert-BU7GlQna.js} +3 -3
  6. package/dist/{Alert-BFfzpPNd.js.map → Alert-BU7GlQna.js.map} +1 -1
  7. package/dist/{Alert-DS8TzpIS.cjs → Alert-CVQOjuEq.cjs} +2 -2
  8. package/dist/{Alert-DS8TzpIS.cjs.map → Alert-CVQOjuEq.cjs.map} +1 -1
  9. package/dist/{Breadcrumbs-CloqFpp1.js → Breadcrumbs-BMz_YVPa.js} +3 -3
  10. package/dist/{Breadcrumbs-CloqFpp1.js.map → Breadcrumbs-BMz_YVPa.js.map} +1 -1
  11. package/dist/{Breadcrumbs-N2-sZWW5.cjs → Breadcrumbs-BbC0o4JE.cjs} +2 -2
  12. package/dist/{Breadcrumbs-N2-sZWW5.cjs.map → Breadcrumbs-BbC0o4JE.cjs.map} +1 -1
  13. package/dist/{Button-5LQtDA9d.js → Button-C415LPw_.js} +2 -2
  14. package/dist/{Button-5LQtDA9d.js.map → Button-C415LPw_.js.map} +1 -1
  15. package/dist/{Button-Bxztlybi.cjs → Button-mBZOvgyZ.cjs} +2 -2
  16. package/dist/{Button-Bxztlybi.cjs.map → Button-mBZOvgyZ.cjs.map} +1 -1
  17. package/dist/{Calendar-BIKo_aus.js → Calendar-B0f6h9-A.js} +3 -3
  18. package/dist/{Calendar-BIKo_aus.js.map → Calendar-B0f6h9-A.js.map} +1 -1
  19. package/dist/{Calendar-CsBgaKZ-.cjs → Calendar-hO051hfk.cjs} +2 -2
  20. package/dist/{Calendar-CsBgaKZ-.cjs.map → Calendar-hO051hfk.cjs.map} +1 -1
  21. package/dist/{Card-Csn3FaMl.cjs → Card-BdNr5row.cjs} +2 -2
  22. package/dist/{Card-Csn3FaMl.cjs.map → Card-BdNr5row.cjs.map} +1 -1
  23. package/dist/{Card-DMwQ7rMk.js → Card-ssUNaOF_.js} +3 -3
  24. package/dist/{Card-DMwQ7rMk.js.map → Card-ssUNaOF_.js.map} +1 -1
  25. package/dist/{Chip-BdCZ44I8.cjs → Chip-BpJN4rzY.cjs} +2 -2
  26. package/dist/{Chip-BdCZ44I8.cjs.map → Chip-BpJN4rzY.cjs.map} +1 -1
  27. package/dist/{Chip-C7IkFuM1.js → Chip-C0x-6g2h.js} +2 -2
  28. package/dist/{Chip-C7IkFuM1.js.map → Chip-C0x-6g2h.js.map} +1 -1
  29. package/dist/{CodeBlock-C10JN6DR.js → CodeBlock-DKnWINdV.js} +3 -3
  30. package/dist/{CodeBlock-C10JN6DR.js.map → CodeBlock-DKnWINdV.js.map} +1 -1
  31. package/dist/{CodeBlock-BnXxxqAW.cjs → CodeBlock-DTrzN95i.cjs} +2 -2
  32. package/dist/{CodeBlock-BnXxxqAW.cjs.map → CodeBlock-DTrzN95i.cjs.map} +1 -1
  33. package/dist/{ColorPicker-z8_-77LO.js → ColorPicker-Bidev2DJ.js} +3 -3
  34. package/dist/{ColorPicker-z8_-77LO.js.map → ColorPicker-Bidev2DJ.js.map} +1 -1
  35. package/dist/{ColorPicker-CVddGc-n.cjs → ColorPicker-Doaegll4.cjs} +2 -2
  36. package/dist/{ColorPicker-CVddGc-n.cjs.map → ColorPicker-Doaegll4.cjs.map} +1 -1
  37. package/dist/{ColorPickerPanel-DJY6-EqO.cjs → ColorPickerPanel-048Fj7wv.cjs} +2 -2
  38. package/dist/{ColorPickerPanel-DJY6-EqO.cjs.map → ColorPickerPanel-048Fj7wv.cjs.map} +1 -1
  39. package/dist/{ColorPickerPanel-y4A2LLLf.js → ColorPickerPanel-DThSuUoz.js} +2 -2
  40. package/dist/{ColorPickerPanel-y4A2LLLf.js.map → ColorPickerPanel-DThSuUoz.js.map} +1 -1
  41. package/dist/{ColorRamp-DvRsdOWy.cjs → ColorRamp-CGw4D9bf.cjs} +2 -2
  42. package/dist/{ColorRamp-DvRsdOWy.cjs.map → ColorRamp-CGw4D9bf.cjs.map} +1 -1
  43. package/dist/{ColorRamp-Dvit8yoP.js → ColorRamp-Reb0q69d.js} +2 -2
  44. package/dist/{ColorRamp-Dvit8yoP.js.map → ColorRamp-Reb0q69d.js.map} +1 -1
  45. package/dist/{ConfigProvider-Cf-awvZs.cjs → ConfigProvider-DBU6rOIA.cjs} +2 -2
  46. package/dist/{ConfigProvider-Cf-awvZs.cjs.map → ConfigProvider-DBU6rOIA.cjs.map} +1 -1
  47. package/dist/{ConfigProvider-CYgmMH4j.js → ConfigProvider-DVDGtCUc.js} +2 -2
  48. package/dist/{ConfigProvider-CYgmMH4j.js.map → ConfigProvider-DVDGtCUc.js.map} +1 -1
  49. package/dist/{CopyButton-BOp7waEt.cjs → CopyButton-Cnab62vt.cjs} +2 -2
  50. package/dist/{CopyButton-BOp7waEt.cjs.map → CopyButton-Cnab62vt.cjs.map} +1 -1
  51. package/dist/{CopyButton-_iMBE4q_.js → CopyButton-Dm8-V4ku.js} +3 -3
  52. package/dist/{CopyButton-_iMBE4q_.js.map → CopyButton-Dm8-V4ku.js.map} +1 -1
  53. package/dist/{DatePicker-X5hZVSW6.js → DatePicker-C4MTCmDn.js} +4 -4
  54. package/dist/{DatePicker-X5hZVSW6.js.map → DatePicker-C4MTCmDn.js.map} +1 -1
  55. package/dist/{DatePicker-UQwpH-rw.cjs → DatePicker-CaGeW_-j.cjs} +2 -2
  56. package/dist/{DatePicker-UQwpH-rw.cjs.map → DatePicker-CaGeW_-j.cjs.map} +1 -1
  57. package/dist/{DateTimePicker-Ch1kUHEb.js → DateTimePicker-B0CjHKPV.js} +7 -7
  58. package/dist/{DateTimePicker-Ch1kUHEb.js.map → DateTimePicker-B0CjHKPV.js.map} +1 -1
  59. package/dist/{DateTimePicker-ClTZGMON.cjs → DateTimePicker-DXKaAYey.cjs} +2 -2
  60. package/dist/{DateTimePicker-ClTZGMON.cjs.map → DateTimePicker-DXKaAYey.cjs.map} +1 -1
  61. package/dist/{DescriptionList-IVAvgpEL.cjs → DescriptionList-BSDwobDc.cjs} +2 -2
  62. package/dist/{DescriptionList-IVAvgpEL.cjs.map → DescriptionList-BSDwobDc.cjs.map} +1 -1
  63. package/dist/{DescriptionList-Cque-iYk.js → DescriptionList-BkUS5egS.js} +4 -4
  64. package/dist/{DescriptionList-Cque-iYk.js.map → DescriptionList-BkUS5egS.js.map} +1 -1
  65. package/dist/{EmptyState-C84B-E8a.cjs → EmptyState-CkkFHKrh.cjs} +2 -2
  66. package/dist/{EmptyState-C84B-E8a.cjs.map → EmptyState-CkkFHKrh.cjs.map} +1 -1
  67. package/dist/{EmptyState-Yts_p-jZ.js → EmptyState-DXoaPC7o.js} +2 -2
  68. package/dist/{EmptyState-Yts_p-jZ.js.map → EmptyState-DXoaPC7o.js.map} +1 -1
  69. package/dist/{ErrorBoundary-BgMOPle0.js → ErrorBoundary-CSP_Ctg6.js} +3 -3
  70. package/dist/{ErrorBoundary-BgMOPle0.js.map → ErrorBoundary-CSP_Ctg6.js.map} +1 -1
  71. package/dist/{ErrorBoundary-DtYswKp3.cjs → ErrorBoundary-tZjKtO28.cjs} +2 -2
  72. package/dist/{ErrorBoundary-DtYswKp3.cjs.map → ErrorBoundary-tZjKtO28.cjs.map} +1 -1
  73. package/dist/{ErrorState-Aa8LVjkl.cjs → ErrorState-JH4JdrTI.cjs} +2 -2
  74. package/dist/{ErrorState-Aa8LVjkl.cjs.map → ErrorState-JH4JdrTI.cjs.map} +1 -1
  75. package/dist/{ErrorState-BE9Rcmht.js → ErrorState-WYsly5-i.js} +7 -7
  76. package/dist/{ErrorState-BE9Rcmht.js.map → ErrorState-WYsly5-i.js.map} +1 -1
  77. package/dist/{FileCard-Chfx0QdF.cjs → FileCard-BIfPqeek.cjs} +2 -2
  78. package/dist/{FileCard-Chfx0QdF.cjs.map → FileCard-BIfPqeek.cjs.map} +1 -1
  79. package/dist/{FileCard-m3i_8yKR.js → FileCard-D4TB3qGG.js} +3 -3
  80. package/dist/{FileCard-m3i_8yKR.js.map → FileCard-D4TB3qGG.js.map} +1 -1
  81. package/dist/FileUploader-DPVF76Ha.js +701 -0
  82. package/dist/FileUploader-DPVF76Ha.js.map +1 -0
  83. package/dist/FileUploader-YE_DfTNC.cjs +2 -0
  84. package/dist/FileUploader-YE_DfTNC.cjs.map +1 -0
  85. package/dist/{Flag-BvZB3295.cjs → Flag-B6OhgwZr.cjs} +2 -2
  86. package/dist/{Flag-BvZB3295.cjs.map → Flag-B6OhgwZr.cjs.map} +1 -1
  87. package/dist/{Flag-C1HwnZXJ.js → Flag-Q3vI7cgt.js} +2 -2
  88. package/dist/{Flag-C1HwnZXJ.js.map → Flag-Q3vI7cgt.js.map} +1 -1
  89. package/dist/{FullscreenToggle-B4ynXdCP.js → FullscreenToggle-CxwGPLdd.js} +3 -3
  90. package/dist/{FullscreenToggle-B4ynXdCP.js.map → FullscreenToggle-CxwGPLdd.js.map} +1 -1
  91. package/dist/{FullscreenToggle-CEFZQ5OC.cjs → FullscreenToggle-ipX55Nj4.cjs} +2 -2
  92. package/dist/{FullscreenToggle-CEFZQ5OC.cjs.map → FullscreenToggle-ipX55Nj4.cjs.map} +1 -1
  93. package/dist/{IconButton-wW1o4HHw.cjs → IconButton-U_sr2Ahy.cjs} +2 -2
  94. package/dist/{IconButton-wW1o4HHw.cjs.map → IconButton-U_sr2Ahy.cjs.map} +1 -1
  95. package/dist/{IconButton-EaExCXRq.js → IconButton-re6xITGO.js} +2 -2
  96. package/dist/{IconButton-EaExCXRq.js.map → IconButton-re6xITGO.js.map} +1 -1
  97. package/dist/ImageEditor-1n50vo_v.cjs +64 -0
  98. package/dist/ImageEditor-1n50vo_v.cjs.map +1 -0
  99. package/dist/{ImageEditor-DTFQZ6ON.js → ImageEditor-BwrG1fk7.js} +968 -948
  100. package/dist/ImageEditor-BwrG1fk7.js.map +1 -0
  101. package/dist/{Loader-D_Foo6Hj.js → Loader-7v1QBvHY.js} +2 -2
  102. package/dist/{Loader-D_Foo6Hj.js.map → Loader-7v1QBvHY.js.map} +1 -1
  103. package/dist/{Loader-DNR2_YHm.cjs → Loader-BE3SQr7W.cjs} +2 -2
  104. package/dist/{Loader-DNR2_YHm.cjs.map → Loader-BE3SQr7W.cjs.map} +1 -1
  105. package/dist/{LocationPicker-DGbnbTW9.js → LocationPicker-BvKtZFq0.js} +6 -6
  106. package/dist/{LocationPicker-DGbnbTW9.js.map → LocationPicker-BvKtZFq0.js.map} +1 -1
  107. package/dist/{LocationPicker-CdO37PKg.cjs → LocationPicker-CVJ4jVn2.cjs} +2 -2
  108. package/dist/{LocationPicker-CdO37PKg.cjs.map → LocationPicker-CVJ4jVn2.cjs.map} +1 -1
  109. package/dist/{Modal-Du-uVpYw.cjs → Modal-CxODxl81.cjs} +2 -2
  110. package/dist/{Modal-Du-uVpYw.cjs.map → Modal-CxODxl81.cjs.map} +1 -1
  111. package/dist/{Modal-1rIBMvKH.js → Modal-DpoiMMM3.js} +3 -3
  112. package/dist/{Modal-1rIBMvKH.js.map → Modal-DpoiMMM3.js.map} +1 -1
  113. package/dist/{MultiSelect-lAAaD0uL.cjs → MultiSelect-2GouMRTl.cjs} +2 -2
  114. package/dist/{MultiSelect-lAAaD0uL.cjs.map → MultiSelect-2GouMRTl.cjs.map} +1 -1
  115. package/dist/{MultiSelect-BoqunsM9.js → MultiSelect-B7KwEhL5.js} +4 -4
  116. package/dist/{MultiSelect-BoqunsM9.js.map → MultiSelect-B7KwEhL5.js.map} +1 -1
  117. package/dist/{NumberField-DHFGNQjZ.js → NumberField-ThojS4K3.js} +3 -3
  118. package/dist/{NumberField-DHFGNQjZ.js.map → NumberField-ThojS4K3.js.map} +1 -1
  119. package/dist/{NumberField-CyUA6eob.cjs → NumberField-o2z2QNK1.cjs} +2 -2
  120. package/dist/{NumberField-CyUA6eob.cjs.map → NumberField-o2z2QNK1.cjs.map} +1 -1
  121. package/dist/{OtpField-CIy5OtXI.cjs → OtpField-BhZq44vV.cjs} +2 -2
  122. package/dist/{OtpField-CIy5OtXI.cjs.map → OtpField-BhZq44vV.cjs.map} +1 -1
  123. package/dist/{OtpField-pL9nj4AW.js → OtpField-C3MlMZ2F.js} +2 -2
  124. package/dist/{OtpField-pL9nj4AW.js.map → OtpField-C3MlMZ2F.js.map} +1 -1
  125. package/dist/{PageError-C5SO0mVJ.js → PageError-63Gk6fVC.js} +5 -5
  126. package/dist/{PageError-C5SO0mVJ.js.map → PageError-63Gk6fVC.js.map} +1 -1
  127. package/dist/{PageError-DbokLmOY.cjs → PageError-CCKWbrc5.cjs} +2 -2
  128. package/dist/{PageError-DbokLmOY.cjs.map → PageError-CCKWbrc5.cjs.map} +1 -1
  129. package/dist/{PageLayout-Du-D6Pd4.js → PageLayout-BekkDBtT.js} +4 -4
  130. package/dist/{PageLayout-Du-D6Pd4.js.map → PageLayout-BekkDBtT.js.map} +1 -1
  131. package/dist/{PageLayout-B7ZDiNq8.cjs → PageLayout-CDPUYu6A.cjs} +2 -2
  132. package/dist/{PageLayout-B7ZDiNq8.cjs.map → PageLayout-CDPUYu6A.cjs.map} +1 -1
  133. package/dist/{PageNotFound-DSkoMfed.js → PageNotFound-BD3zX3cd.js} +5 -5
  134. package/dist/{PageNotFound-DSkoMfed.js.map → PageNotFound-BD3zX3cd.js.map} +1 -1
  135. package/dist/{PageNotFound-DfNwdtgJ.cjs → PageNotFound-CTR6htwa.cjs} +2 -2
  136. package/dist/{PageNotFound-DfNwdtgJ.cjs.map → PageNotFound-CTR6htwa.cjs.map} +1 -1
  137. package/dist/{Pagination-DO2Os4an.cjs → Pagination-BJvLUjQ0.cjs} +2 -2
  138. package/dist/{Pagination-DO2Os4an.cjs.map → Pagination-BJvLUjQ0.cjs.map} +1 -1
  139. package/dist/{Pagination-BH8ACaAC.js → Pagination-qKjISBJ9.js} +2 -2
  140. package/dist/{Pagination-BH8ACaAC.js.map → Pagination-qKjISBJ9.js.map} +1 -1
  141. package/dist/{PaletteField-BfvcJvGM.cjs → PaletteField-CDS9CJW9.cjs} +2 -2
  142. package/dist/{PaletteField-BfvcJvGM.cjs.map → PaletteField-CDS9CJW9.cjs.map} +1 -1
  143. package/dist/{PaletteField-BFb0PQ-S.js → PaletteField-y8KpR4Ap.js} +3 -3
  144. package/dist/{PaletteField-BFb0PQ-S.js.map → PaletteField-y8KpR4Ap.js.map} +1 -1
  145. package/dist/{PhoneField-C-wOm7g5.cjs → PhoneField-Df3J6Hhg.cjs} +2 -2
  146. package/dist/{PhoneField-C-wOm7g5.cjs.map → PhoneField-Df3J6Hhg.cjs.map} +1 -1
  147. package/dist/{PhoneField-DFhGWgbK.js → PhoneField-OjsuevPx.js} +4 -4
  148. package/dist/{PhoneField-DFhGWgbK.js.map → PhoneField-OjsuevPx.js.map} +1 -1
  149. package/dist/{Popconfirm-_53vtMI0.cjs → Popconfirm-BKzJ_EZy.cjs} +2 -2
  150. package/dist/{Popconfirm-_53vtMI0.cjs.map → Popconfirm-BKzJ_EZy.cjs.map} +1 -1
  151. package/dist/{Popconfirm-o5da44ra.js → Popconfirm-aCyniPnH.js} +3 -3
  152. package/dist/{Popconfirm-o5da44ra.js.map → Popconfirm-aCyniPnH.js.map} +1 -1
  153. package/dist/{Progress-BSinoQ8t.cjs → Progress-DWOoLd8u.cjs} +2 -2
  154. package/dist/{Progress-BSinoQ8t.cjs.map → Progress-DWOoLd8u.cjs.map} +1 -1
  155. package/dist/{Progress-CHzNwegP.js → Progress-DzxbkcaD.js} +2 -2
  156. package/dist/{Progress-CHzNwegP.js.map → Progress-DzxbkcaD.js.map} +1 -1
  157. package/dist/{QrCode-tNNnsbHM.cjs → QrCode-C8uAPiHq.cjs} +2 -2
  158. package/dist/{QrCode-tNNnsbHM.cjs.map → QrCode-C8uAPiHq.cjs.map} +1 -1
  159. package/dist/{QrCode-C3hAfNP6.js → QrCode-DaJYqBc1.js} +2 -2
  160. package/dist/{QrCode-C3hAfNP6.js.map → QrCode-DaJYqBc1.js.map} +1 -1
  161. package/dist/{RemoveDialog-Hi_gV-8A.cjs → RemoveDialog-BnOtR6-q.cjs} +2 -2
  162. package/dist/{RemoveDialog-Hi_gV-8A.cjs.map → RemoveDialog-BnOtR6-q.cjs.map} +1 -1
  163. package/dist/{RemoveDialog-CXy-PY-G.js → RemoveDialog-MhEU5Zl3.js} +5 -5
  164. package/dist/{RemoveDialog-CXy-PY-G.js.map → RemoveDialog-MhEU5Zl3.js.map} +1 -1
  165. package/dist/RichTextEditor-Cnrnvv1f.cjs +2 -0
  166. package/dist/RichTextEditor-Cnrnvv1f.cjs.map +1 -0
  167. package/dist/RichTextEditor-zkoxujnO.js +1148 -0
  168. package/dist/RichTextEditor-zkoxujnO.js.map +1 -0
  169. package/dist/{RootLayout-CjT5uHlt.js → RootLayout-C4r9i5Go.js} +15 -15
  170. package/dist/{RootLayout-CjT5uHlt.js.map → RootLayout-C4r9i5Go.js.map} +1 -1
  171. package/dist/{RootLayout-iSGY4MsS.cjs → RootLayout-Z9PuRfsa.cjs} +2 -2
  172. package/dist/{RootLayout-iSGY4MsS.cjs.map → RootLayout-Z9PuRfsa.cjs.map} +1 -1
  173. package/dist/{Select-DVoL547R.cjs → Select-CylqFHce.cjs} +2 -2
  174. package/dist/{Select-DVoL547R.cjs.map → Select-CylqFHce.cjs.map} +1 -1
  175. package/dist/{Select-DuLDLnnb.js → Select-jT94L1vq.js} +3 -3
  176. package/dist/{Select-DuLDLnnb.js.map → Select-jT94L1vq.js.map} +1 -1
  177. package/dist/{Sidebar-DvQmuBNK.js → Sidebar-B1O2RsbR.js} +3 -3
  178. package/dist/{Sidebar-DvQmuBNK.js.map → Sidebar-B1O2RsbR.js.map} +1 -1
  179. package/dist/{Sidebar-DRQo4zAF.cjs → Sidebar-Bcm0fgVm.cjs} +2 -2
  180. package/dist/{Sidebar-DRQo4zAF.cjs.map → Sidebar-Bcm0fgVm.cjs.map} +1 -1
  181. package/dist/{Slider-DxnCQRSH.cjs → Slider-CV7ug0WF.cjs} +2 -2
  182. package/dist/{Slider-DxnCQRSH.cjs.map → Slider-CV7ug0WF.cjs.map} +1 -1
  183. package/dist/{Slider-D-QjclQJ.js → Slider-DC-ugZwT.js} +2 -2
  184. package/dist/{Slider-D-QjclQJ.js.map → Slider-DC-ugZwT.js.map} +1 -1
  185. package/dist/{SpeedDial-BBQ9y6lm.js → SpeedDial-C6yiMUe8.js} +2 -2
  186. package/dist/{SpeedDial-BBQ9y6lm.js.map → SpeedDial-C6yiMUe8.js.map} +1 -1
  187. package/dist/{SpeedDial-37OMwj9C.cjs → SpeedDial-DOgm2DDX.cjs} +2 -2
  188. package/dist/{SpeedDial-37OMwj9C.cjs.map → SpeedDial-DOgm2DDX.cjs.map} +1 -1
  189. package/dist/{Stepper-CU5Y0kfj.js → Stepper-BZdYGpBN.js} +2 -2
  190. package/dist/{Stepper-CU5Y0kfj.js.map → Stepper-BZdYGpBN.js.map} +1 -1
  191. package/dist/{Stepper-WqkfGPnQ.cjs → Stepper-DqM86TGV.cjs} +2 -2
  192. package/dist/{Stepper-WqkfGPnQ.cjs.map → Stepper-DqM86TGV.cjs.map} +1 -1
  193. package/dist/{Table-BnlvrRMr.cjs → Table-BgaCwRDQ.cjs} +2 -2
  194. package/dist/{Table-BnlvrRMr.cjs.map → Table-BgaCwRDQ.cjs.map} +1 -1
  195. package/dist/{Table-BECUUZtf.js → Table-FZlVWoYi.js} +16 -16
  196. package/dist/{Table-BECUUZtf.js.map → Table-FZlVWoYi.js.map} +1 -1
  197. package/dist/{Tabs-BXAHddi7.js → Tabs-BqQPkorY.js} +2 -2
  198. package/dist/{Tabs-BXAHddi7.js.map → Tabs-BqQPkorY.js.map} +1 -1
  199. package/dist/{Tabs-DiL1vNW3.cjs → Tabs-kGeyFhJ6.cjs} +2 -2
  200. package/dist/{Tabs-DiL1vNW3.cjs.map → Tabs-kGeyFhJ6.cjs.map} +1 -1
  201. package/dist/{TagsField-BsV_6dff.cjs → TagsField-B_sjp48X.cjs} +2 -2
  202. package/dist/{TagsField-BsV_6dff.cjs.map → TagsField-B_sjp48X.cjs.map} +1 -1
  203. package/dist/{TagsField-C1SgykAj.js → TagsField-ByTx9JXK.js} +4 -4
  204. package/dist/{TagsField-C1SgykAj.js.map → TagsField-ByTx9JXK.js.map} +1 -1
  205. package/dist/{TextField-DUv689u2.cjs → TextField-CBYJIfau.cjs} +2 -2
  206. package/dist/{TextField-DUv689u2.cjs.map → TextField-CBYJIfau.cjs.map} +1 -1
  207. package/dist/{TextField-oZI7thoU.js → TextField-CyKIx-d-.js} +3 -3
  208. package/dist/{TextField-oZI7thoU.js.map → TextField-CyKIx-d-.js.map} +1 -1
  209. package/dist/{ThemeToggle-xn3roH0u.cjs → ThemeToggle-D2dIqiBa.cjs} +2 -2
  210. package/dist/{ThemeToggle-xn3roH0u.cjs.map → ThemeToggle-D2dIqiBa.cjs.map} +1 -1
  211. package/dist/{ThemeToggle-5uHCUsX7.js → ThemeToggle-Dg6IishB.js} +3 -3
  212. package/dist/{ThemeToggle-5uHCUsX7.js.map → ThemeToggle-Dg6IishB.js.map} +1 -1
  213. package/dist/{TimeColumns-lO33mhX7.js → TimeColumns-Cx8J5qzW.js} +2 -2
  214. package/dist/{TimeColumns-lO33mhX7.js.map → TimeColumns-Cx8J5qzW.js.map} +1 -1
  215. package/dist/{TimeColumns-By23LHZw.cjs → TimeColumns-DVmK_T_P.cjs} +2 -2
  216. package/dist/{TimeColumns-By23LHZw.cjs.map → TimeColumns-DVmK_T_P.cjs.map} +1 -1
  217. package/dist/{TimePicker-BHFNH8LR.cjs → TimePicker-0nZOPRKp.cjs} +2 -2
  218. package/dist/{TimePicker-BHFNH8LR.cjs.map → TimePicker-0nZOPRKp.cjs.map} +1 -1
  219. package/dist/{TimePicker-Dl5p833O.js → TimePicker-sAhtvqQ4.js} +5 -5
  220. package/dist/{TimePicker-Dl5p833O.js.map → TimePicker-sAhtvqQ4.js.map} +1 -1
  221. package/dist/{Toaster-BPBFZiTr.js → Toaster-BOW9rzLq.js} +3 -3
  222. package/dist/{Toaster-BPBFZiTr.js.map → Toaster-BOW9rzLq.js.map} +1 -1
  223. package/dist/{Toaster-D4T89N1S.cjs → Toaster-DYGo92ke.cjs} +2 -2
  224. package/dist/{Toaster-D4T89N1S.cjs.map → Toaster-DYGo92ke.cjs.map} +1 -1
  225. package/dist/{TranslatedFields-LdeJeHEp.cjs → TranslatedFields-C_DuLotV.cjs} +2 -2
  226. package/dist/{TranslatedFields-LdeJeHEp.cjs.map → TranslatedFields-C_DuLotV.cjs.map} +1 -1
  227. package/dist/{TranslatedFields-Clsr84XC.js → TranslatedFields-CcE0td9p.js} +5 -5
  228. package/dist/{TranslatedFields-Clsr84XC.js.map → TranslatedFields-CcE0td9p.js.map} +1 -1
  229. package/dist/{UserCard-CQOiWppq.cjs → UserCard-DLVptkLr.cjs} +2 -2
  230. package/dist/{UserCard-CQOiWppq.cjs.map → UserCard-DLVptkLr.cjs.map} +1 -1
  231. package/dist/{UserCard-Cr75RwZb.js → UserCard-DeONbaKj.js} +3 -3
  232. package/dist/{UserCard-Cr75RwZb.js.map → UserCard-DeONbaKj.js.map} +1 -1
  233. package/dist/components/Alert/index.cjs +1 -1
  234. package/dist/components/Alert/index.js +1 -1
  235. package/dist/components/Breadcrumbs/index.cjs +1 -1
  236. package/dist/components/Breadcrumbs/index.js +1 -1
  237. package/dist/components/Button/index.cjs +1 -1
  238. package/dist/components/Button/index.js +1 -1
  239. package/dist/components/Card/index.cjs +1 -1
  240. package/dist/components/Card/index.js +1 -1
  241. package/dist/components/Chip/index.cjs +1 -1
  242. package/dist/components/Chip/index.js +1 -1
  243. package/dist/components/CodeBlock/index.cjs +1 -1
  244. package/dist/components/CodeBlock/index.js +1 -1
  245. package/dist/components/ColorPicker/index.cjs +1 -1
  246. package/dist/components/ColorPicker/index.js +1 -1
  247. package/dist/components/ColorRamp/index.cjs +1 -1
  248. package/dist/components/ColorRamp/index.js +1 -1
  249. package/dist/components/CopyButton/index.cjs +1 -1
  250. package/dist/components/CopyButton/index.js +1 -1
  251. package/dist/components/DatePicker/index.cjs +1 -1
  252. package/dist/components/DatePicker/index.js +1 -1
  253. package/dist/components/DateTimePicker/index.cjs +1 -1
  254. package/dist/components/DateTimePicker/index.js +1 -1
  255. package/dist/components/DescriptionList/index.cjs +1 -1
  256. package/dist/components/DescriptionList/index.js +1 -1
  257. package/dist/components/EmptyState/index.cjs +1 -1
  258. package/dist/components/EmptyState/index.js +1 -1
  259. package/dist/components/ErrorState/index.cjs +1 -1
  260. package/dist/components/ErrorState/index.js +2 -2
  261. package/dist/components/FileCard/index.cjs +1 -1
  262. package/dist/components/FileCard/index.js +1 -1
  263. package/dist/components/FileUploader/index.cjs +1 -1
  264. package/dist/components/FileUploader/index.js +1 -1
  265. package/dist/components/Flag/index.cjs +1 -1
  266. package/dist/components/Flag/index.js +1 -1
  267. package/dist/components/FullscreenToggle/index.cjs +1 -1
  268. package/dist/components/FullscreenToggle/index.js +1 -1
  269. package/dist/components/IconButton/index.cjs +1 -1
  270. package/dist/components/IconButton/index.js +1 -1
  271. package/dist/components/ImageEditor/index.cjs +1 -1
  272. package/dist/components/ImageEditor/index.js +1 -1
  273. package/dist/components/Loader/index.cjs +1 -1
  274. package/dist/components/Loader/index.js +1 -1
  275. package/dist/components/LocationPicker/index.cjs +1 -1
  276. package/dist/components/LocationPicker/index.js +1 -1
  277. package/dist/components/Modal/index.cjs +1 -1
  278. package/dist/components/Modal/index.js +1 -1
  279. package/dist/components/MultiSelect/index.cjs +1 -1
  280. package/dist/components/MultiSelect/index.js +1 -1
  281. package/dist/components/NumberField/index.cjs +1 -1
  282. package/dist/components/NumberField/index.js +1 -1
  283. package/dist/components/OtpField/index.cjs +1 -1
  284. package/dist/components/OtpField/index.js +1 -1
  285. package/dist/components/PageError/index.cjs +1 -1
  286. package/dist/components/PageError/index.js +1 -1
  287. package/dist/components/PageLayout/index.cjs +1 -1
  288. package/dist/components/PageLayout/index.js +1 -1
  289. package/dist/components/PageNotFound/index.cjs +1 -1
  290. package/dist/components/PageNotFound/index.js +1 -1
  291. package/dist/components/Pagination/index.cjs +1 -1
  292. package/dist/components/Pagination/index.js +1 -1
  293. package/dist/components/PaletteField/index.cjs +1 -1
  294. package/dist/components/PaletteField/index.js +1 -1
  295. package/dist/components/PhoneField/index.cjs +1 -1
  296. package/dist/components/PhoneField/index.js +1 -1
  297. package/dist/components/Popconfirm/index.cjs +1 -1
  298. package/dist/components/Popconfirm/index.js +1 -1
  299. package/dist/components/Progress/index.cjs +1 -1
  300. package/dist/components/Progress/index.js +1 -1
  301. package/dist/components/QrCode/index.cjs +1 -1
  302. package/dist/components/QrCode/index.js +1 -1
  303. package/dist/components/RemoveDialog/index.cjs +1 -1
  304. package/dist/components/RemoveDialog/index.js +1 -1
  305. package/dist/components/RichTextEditor/index.cjs +1 -1
  306. package/dist/components/RichTextEditor/index.js +1 -1
  307. package/dist/components/RichTextEditor/nodes/ImageNode.d.cts +17 -5
  308. package/dist/components/RichTextEditor/nodes/ImageNode.d.ts +17 -5
  309. package/dist/components/RootLayout/index.cjs +1 -1
  310. package/dist/components/RootLayout/index.js +1 -1
  311. package/dist/components/Select/index.cjs +1 -1
  312. package/dist/components/Select/index.js +1 -1
  313. package/dist/components/Sidebar/index.cjs +1 -1
  314. package/dist/components/Sidebar/index.js +1 -1
  315. package/dist/components/Slider/index.cjs +1 -1
  316. package/dist/components/Slider/index.js +1 -1
  317. package/dist/components/SpeedDial/index.cjs +1 -1
  318. package/dist/components/SpeedDial/index.js +1 -1
  319. package/dist/components/Stepper/index.cjs +1 -1
  320. package/dist/components/Stepper/index.js +1 -1
  321. package/dist/components/Table/index.cjs +1 -1
  322. package/dist/components/Table/index.js +1 -1
  323. package/dist/components/Tabs/index.cjs +1 -1
  324. package/dist/components/Tabs/index.js +1 -1
  325. package/dist/components/TagsField/index.cjs +1 -1
  326. package/dist/components/TagsField/index.js +1 -1
  327. package/dist/components/TextField/index.cjs +1 -1
  328. package/dist/components/TextField/index.js +1 -1
  329. package/dist/components/ThemeToggle/index.cjs +1 -1
  330. package/dist/components/ThemeToggle/index.js +1 -1
  331. package/dist/components/TimePicker/index.cjs +1 -1
  332. package/dist/components/TimePicker/index.js +1 -1
  333. package/dist/components/Toast/index.cjs +1 -1
  334. package/dist/components/Toast/index.js +1 -1
  335. package/dist/components/TranslatedFields/index.cjs +1 -1
  336. package/dist/components/TranslatedFields/index.js +1 -1
  337. package/dist/components/UserCard/index.cjs +1 -1
  338. package/dist/components/UserCard/index.js +1 -1
  339. package/dist/entries/app.cjs +1 -1
  340. package/dist/entries/app.js +1 -1
  341. package/dist/entries/components.cjs +1 -1
  342. package/dist/entries/components.js +53 -53
  343. package/dist/entries/i18n.cjs +1 -1
  344. package/dist/entries/i18n.js +2 -2
  345. package/dist/entries/theme.cjs +1 -1
  346. package/dist/entries/theme.js +1 -1
  347. package/dist/i18n/messages.d.cts +5 -0
  348. package/dist/i18n/messages.d.ts +5 -0
  349. package/dist/index.cjs +1 -1
  350. package/dist/index.css +1 -1
  351. package/dist/index.js +56 -56
  352. package/dist/{messages-BZYBZ3GR.js → messages-DeQuvGln.js} +47 -12
  353. package/dist/messages-DeQuvGln.js.map +1 -0
  354. package/dist/{messages-CTHjpVJq.cjs → messages-dL9MkVze.cjs} +9 -9
  355. package/dist/messages-dL9MkVze.cjs.map +1 -0
  356. package/dist/{useHomeTo-Biyc-Un8.js → useHomeTo-BL3e8Sc6.js} +2 -2
  357. package/dist/{useHomeTo-Biyc-Un8.js.map → useHomeTo-BL3e8Sc6.js.map} +1 -1
  358. package/dist/{useHomeTo-D7wcH6aw.cjs → useHomeTo-W1PDW5CU.cjs} +2 -2
  359. package/dist/{useHomeTo-D7wcH6aw.cjs.map → useHomeTo-W1PDW5CU.cjs.map} +1 -1
  360. package/dist/{useOptionMenu-BTt8t9SM.js → useOptionMenu-BkKiZ6Ax.js} +3 -3
  361. package/dist/{useOptionMenu-BTt8t9SM.js.map → useOptionMenu-BkKiZ6Ax.js.map} +1 -1
  362. package/dist/{useOptionMenu-B40OOVsO.cjs → useOptionMenu-CVl7VHXl.cjs} +2 -2
  363. package/dist/{useOptionMenu-B40OOVsO.cjs.map → useOptionMenu-CVl7VHXl.cjs.map} +1 -1
  364. package/package.json +1 -1
  365. package/dist/FileUploader-B27Y4rak.js +0 -706
  366. package/dist/FileUploader-B27Y4rak.js.map +0 -1
  367. package/dist/FileUploader-DkvFO0N_.cjs +0 -2
  368. package/dist/FileUploader-DkvFO0N_.cjs.map +0 -1
  369. package/dist/ImageEditor-DTFQZ6ON.js.map +0 -1
  370. package/dist/ImageEditor-D_HKfDbx.cjs +0 -60
  371. package/dist/ImageEditor-D_HKfDbx.cjs.map +0 -1
  372. package/dist/RichTextEditor-BhVE1q4U.cjs +0 -2
  373. package/dist/RichTextEditor-BhVE1q4U.cjs.map +0 -1
  374. package/dist/RichTextEditor-DQz9jGD3.js +0 -1011
  375. package/dist/RichTextEditor-DQz9jGD3.js.map +0 -1
  376. package/dist/messages-BZYBZ3GR.js.map +0 -1
  377. package/dist/messages-CTHjpVJq.cjs.map +0 -1
@@ -1,15 +1,15 @@
1
- import { jsxs as B, jsx as w, Fragment as he } from "react/jsx-runtime";
2
- import { forwardRef as Ke, useRef as O, useState as Q, useEffect as q, useLayoutEffect as ue, useMemo as mn, useImperativeHandle as fn, useSyncExternalStore as pn, useCallback as gn } from "react";
3
- import { clsx as K } from "clsx";
4
- import { B as Me } from "./Button-5LQtDA9d.js";
1
+ import { jsxs as X, jsx as v, Fragment as ue } from "react/jsx-runtime";
2
+ import { forwardRef as Ke, useRef as F, useState as Q, useEffect as j, useLayoutEffect as de, useMemo as mn, useImperativeHandle as fn, useSyncExternalStore as pn, useCallback as gn } from "react";
3
+ import { clsx as W } from "clsx";
4
+ import { B as ye } from "./Button-C415LPw_.js";
5
5
  import { b as et } from "./Icon-B7DJn8Tw.js";
6
- import { I as Et } from "./IconButton-EaExCXRq.js";
7
- import { L as _n } from "./Loader-D_Foo6Hj.js";
8
- import { O as bn } from "./Overlay-DiL0ZARH.js";
9
- import { g as wn, a as re } from "./ConfigProvider-CYgmMH4j.js";
10
- import { D as vn } from "./Dropdown-D-D_Z1Jo.js";
11
- import { L as Ue } from "./ListItem-Ezmdk7q-.js";
12
- const Se = [
6
+ import { I as kt } from "./IconButton-re6xITGO.js";
7
+ import { L as _n } from "./Loader-7v1QBvHY.js";
8
+ import { O as wn } from "./Overlay-DiL0ZARH.js";
9
+ import { g as vn, a as oe } from "./ConfigProvider-DVDGtCUc.js";
10
+ import { D as bn } from "./Dropdown-D-D_Z1Jo.js";
11
+ import { L as De } from "./ListItem-Ezmdk7q-.js";
12
+ const Ae = [
13
13
  1,
14
14
  0,
15
15
  0,
@@ -30,7 +30,7 @@ const Se = [
30
30
  0,
31
31
  1,
32
32
  0
33
- ], de = 0.2126, me = 0.7152, fe = 0.0722;
33
+ ], me = 0.2126, fe = 0.7152, pe = 0.0722;
34
34
  function xn(t, e) {
35
35
  const n = new Array(20);
36
36
  for (let i = 0; i < 4; i++)
@@ -42,10 +42,10 @@ function xn(t, e) {
42
42
  return n;
43
43
  }
44
44
  function ot(...t) {
45
- return t.reduce((e, n) => xn(n, e), Se);
45
+ return t.reduce((e, n) => xn(n, e), Ae);
46
46
  }
47
47
  function Mn(t) {
48
- return !t || t.every((e, n) => Math.abs(e - Se[n]) < 1e-6);
48
+ return !t || t.every((e, n) => Math.abs(e - Ae[n]) < 1e-6);
49
49
  }
50
50
  const He = (t) => [
51
51
  1,
@@ -68,25 +68,25 @@ const He = (t) => [
68
68
  0,
69
69
  1,
70
70
  0
71
- ], vt = (t) => {
71
+ ], bt = (t) => {
72
72
  const e = 0.5 * (1 - t);
73
73
  return [t, 0, 0, 0, e, 0, t, 0, 0, e, 0, 0, t, 0, e, 0, 0, 0, 1, 0];
74
- }, St = (t) => {
74
+ }, Rt = (t) => {
75
75
  const e = 1 - t;
76
76
  return [
77
- de * e + t,
78
- me * e,
79
- fe * e,
80
- 0,
81
- 0,
82
- de * e,
83
77
  me * e + t,
84
78
  fe * e,
79
+ pe * e,
85
80
  0,
86
81
  0,
87
- de * e,
88
82
  me * e,
89
83
  fe * e + t,
84
+ pe * e,
85
+ 0,
86
+ 0,
87
+ me * e,
88
+ fe * e,
89
+ pe * e + t,
90
90
  0,
91
91
  0,
92
92
  0,
@@ -116,10 +116,10 @@ const He = (t) => [
116
116
  0,
117
117
  1,
118
118
  0
119
- ], pe = (t, e) => {
119
+ ], ge = (t, e) => {
120
120
  const n = e - t;
121
121
  return [n, 0, 0, 0, t, 0, n, 0, 0, t, 0, 0, n, 0, t, 0, 0, 0, 1, 0];
122
- }, Fe = [
122
+ }, Ue = [
123
123
  0.393,
124
124
  0.769,
125
125
  0.189,
@@ -140,38 +140,38 @@ const He = (t) => [
140
140
  0,
141
141
  1,
142
142
  0
143
- ], ye = [
143
+ ], Ee = [
144
144
  ["default"],
145
145
  ["chrome", "fade", "cold", "warm", "pastel"],
146
146
  ["mono", "noir", "stark", "wash"],
147
147
  ["sepia", "rust", "blues", "color"]
148
- ], Ut = St(0), Ce = {
148
+ ], Ft = Rt(0), Re = {
149
149
  default: null,
150
150
  // more contrast + saturation
151
- chrome: ot(St(1.3), vt(1.15)),
151
+ chrome: ot(Rt(1.3), bt(1.15)),
152
152
  // lifted blacks, softer whites, desaturated
153
- fade: ot(St(0.7), pe(0.12, 0.92)),
153
+ fade: ot(Rt(0.7), ge(0.12, 0.92)),
154
154
  // a blue shift
155
- cold: ot(Ct(0.9, 0.98, 1.12, 0, 0.01, 0.03), vt(1.04)),
155
+ cold: ot(Ct(0.9, 0.98, 1.12, 0, 0.01, 0.03), bt(1.04)),
156
156
  // a red / yellow shift
157
- warm: ot(Ct(1.1, 1.03, 0.86, 0.03, 0.01, 0), vt(1.04)),
157
+ warm: ot(Ct(1.1, 1.03, 0.86, 0.03, 0.01, 0), bt(1.04)),
158
158
  // brightened + desaturated
159
- pastel: ot(St(0.6), pe(0.16, 1)),
159
+ pastel: ot(Rt(0.6), ge(0.16, 1)),
160
160
  // luminance grayscale
161
- mono: Ut,
161
+ mono: Ft,
162
162
  // high-contrast grayscale
163
- noir: ot(Ut, vt(1.45), He(-0.04)),
163
+ noir: ot(Ft, bt(1.45), He(-0.04)),
164
164
  // very high-contrast grayscale
165
- stark: ot(Ut, vt(2.1)),
165
+ stark: ot(Ft, bt(2.1)),
166
166
  // low-contrast, bright grayscale
167
- wash: ot(Ut, pe(0.22, 0.98)),
168
- sepia: Fe,
167
+ wash: ot(Ft, ge(0.22, 0.98)),
168
+ sepia: Ue,
169
169
  // a warm, strong sepia
170
- rust: ot(Fe, Ct(1.12, 0.9, 0.7), vt(1.12)),
170
+ rust: ot(Ue, Ct(1.12, 0.9, 0.7), bt(1.12)),
171
171
  // blue-tinted monochrome
172
- blues: ot(Ut, Ct(0.72, 0.88, 1.08, 0, 0.02, 0.08)),
172
+ blues: ot(Ft, Ct(0.72, 0.88, 1.08, 0, 0.02, 0.08)),
173
173
  // boosted, vivid color
174
- color: ot(St(1.65), vt(1.06))
174
+ color: ot(Rt(1.65), bt(1.06))
175
175
  }, yn = [
176
176
  "brightness",
177
177
  "contrast",
@@ -217,15 +217,15 @@ function En(t) {
217
217
  ut.exposure(t.exposure)
218
218
  ),
219
219
  He(ut.brightness(t.brightness)),
220
- vt(ut.contrast(t.contrast)),
221
- St(ut.saturation(t.saturation)),
220
+ bt(ut.contrast(t.contrast)),
221
+ Rt(ut.saturation(t.saturation)),
222
222
  Ct(1 + 0.12 * e, 1 + 0.02 * e, 1 - 0.12 * e)
223
223
  );
224
224
  }
225
- function Tn(t, e) {
226
- return ot(t ?? Se, En(e));
225
+ function kn(t, e) {
226
+ return ot(t ?? Ae, En(e));
227
227
  }
228
- const ee = Math.PI / 2, Ze = 1e-6, ie = ([t, e], n) => {
228
+ const re = Math.PI / 2, Ze = 1e-6, ae = ([t, e], n) => {
229
229
  const i = Math.cos(n), o = Math.sin(n);
230
230
  return [t * i - e * o, t * o + e * i];
231
231
  };
@@ -233,27 +233,27 @@ function Je(t, e, n) {
233
233
  const i = Math.abs(Math.cos(n)), o = Math.abs(Math.sin(n));
234
234
  return [t / 2 * i + e / 2 * o, t / 2 * o + e / 2 * i];
235
235
  }
236
- const Vt = (t) => [
236
+ const $t = (t) => [
237
237
  t.x + t.width / 2,
238
238
  t.y + t.height / 2
239
239
  ];
240
- function oe(t, e, n, i) {
240
+ function se(t, e, n, i) {
241
241
  const [o, r] = Je(t, e, n);
242
242
  return Math.max(2 * o / i.width, 2 * r / i.height);
243
243
  }
244
- function $t(t, e) {
245
- const [n, i] = Vt(t.crop), [o, r] = ie([n - e.width / 2, i - e.height / 2], -t.rotation);
244
+ function jt(t, e) {
245
+ const [n, i] = $t(t.crop), [o, r] = ae([n - e.width / 2, i - e.height / 2], -t.rotation);
246
246
  return [o / t.scale, r / t.scale];
247
247
  }
248
- function Gt([t, e], n, i, o, r, a) {
248
+ function Wt([t, e], n, i, o, r, a) {
249
249
  const [s, _] = Je(n, i, o), c = Math.max(0, a.width / 2 - s / r), M = Math.max(0, a.height / 2 - _ / r);
250
250
  return [Math.min(c, Math.max(-c, t)), Math.min(M, Math.max(-M, e))];
251
251
  }
252
- function jt(t, e, n, i, o, r) {
253
- const [a, s] = ie([t[0] * o, t[1] * o], i), _ = r.width / 2 + a, c = r.height / 2 + s;
252
+ function Kt(t, e, n, i, o, r) {
253
+ const [a, s] = ae([t[0] * o, t[1] * o], i), _ = r.width / 2 + a, c = r.height / 2 + s;
254
254
  return { x: _ - e / 2, y: c - n / 2, width: e, height: n };
255
255
  }
256
- function In(t, e, n, i) {
256
+ function Tn(t, e, n, i) {
257
257
  const o = [
258
258
  [t.x, t.y],
259
259
  [t.x + t.width, t.y],
@@ -261,28 +261,28 @@ function In(t, e, n, i) {
261
261
  [t.x + t.width, t.y + t.height]
262
262
  ], r = 1e-6 * Math.max(i.width, i.height);
263
263
  return o.every(([a, s]) => {
264
- const [_, c] = ie([a - i.width / 2, s - i.height / 2], -e);
264
+ const [_, c] = ae([a - i.width / 2, s - i.height / 2], -e);
265
265
  return Math.abs(_ / n) <= i.width / 2 + r / n && Math.abs(c / n) <= i.height / 2 + r / n;
266
266
  });
267
267
  }
268
- function An(t, e) {
269
- const { width: n, height: i } = t.crop, o = Math.max(t.scale, oe(n, i, t.rotation, e)), r = Gt($t({ ...t, scale: o }, e), n, i, t.rotation, o, e);
270
- return { ...t, scale: o, crop: jt(r, n, i, t.rotation, o, e) };
268
+ function In(t, e) {
269
+ const { width: n, height: i } = t.crop, o = Math.max(t.scale, se(n, i, t.rotation, e)), r = Wt(jt({ ...t, scale: o }, e), n, i, t.rotation, o, e);
270
+ return { ...t, scale: o, crop: Kt(r, n, i, t.rotation, o, e) };
271
271
  }
272
- function kt(t) {
272
+ function qt(t) {
273
273
  return {
274
274
  width: Math.max(1, Math.round(t.crop.width / t.scale)),
275
275
  height: Math.max(1, Math.round(t.crop.height / t.scale))
276
276
  };
277
277
  }
278
- function Rt(t) {
279
- const e = kt(t);
278
+ function Lt(t) {
279
+ const e = qt(t);
280
280
  return t.resize ? {
281
281
  width: Math.max(1, Math.min(e.width, Math.round(t.resize.width))),
282
282
  height: Math.max(1, Math.min(e.height, Math.round(t.resize.height)))
283
283
  } : e;
284
284
  }
285
- function Xt(t) {
285
+ function Yt(t) {
286
286
  const { crop: e } = t, n = t.resize;
287
287
  if (!n) return e;
288
288
  const i = n.width / n.height, o = e.width / e.height;
@@ -296,19 +296,19 @@ function Xt(t) {
296
296
  }
297
297
  function Sn(t, e) {
298
298
  if (!e) return { ...t, resize: null };
299
- const n = kt(t), i = Math.max(1, Math.min(n.width, Math.round(e.width))), o = Math.max(1, Math.min(n.height, Math.round(e.height))), r = Math.round(i * n.height / n.width) === o || Math.round(o * n.width / n.height) === i;
299
+ const n = qt(t), i = Math.max(1, Math.min(n.width, Math.round(e.width))), o = Math.max(1, Math.min(n.height, Math.round(e.height))), r = Math.round(i * n.height / n.width) === o || Math.round(o * n.width / n.height) === i;
300
300
  let a = t;
301
301
  if (!r) {
302
- const c = Xt({ ...t, resize: { width: i, height: o } });
302
+ const c = Yt({ ...t, resize: { width: i, height: o } });
303
303
  a = { ...t, crop: c, cropRatio: null };
304
304
  }
305
- const s = kt(a), _ = i >= s.width && o >= s.height ? null : { width: Math.min(i, s.width), height: Math.min(o, s.height) };
305
+ const s = qt(a), _ = i >= s.width && o >= s.height ? null : { width: Math.min(i, s.width), height: Math.min(o, s.height) };
306
306
  return { ...a, resize: _ };
307
307
  }
308
- function Cn(t, e) {
308
+ function An(t, e) {
309
309
  const n = e.resize;
310
310
  if (!n) return n;
311
- const i = kt(t), o = kt(e);
311
+ const i = qt(t), o = qt(e);
312
312
  if (i.width === o.width && i.height === o.height) return n;
313
313
  const r = Math.max(
314
314
  1,
@@ -323,7 +323,7 @@ function Rn(t, e) {
323
323
  let n = t.width, i = t.height;
324
324
  return e && e > 0 && (n / i > e ? n = i * e : i = n / e), { x: (t.width - n) / 2, y: (t.height - i) / 2, width: n, height: i };
325
325
  }
326
- function Ln(t, e) {
326
+ function Cn(t, e) {
327
327
  return {
328
328
  crop: Rn(t, e),
329
329
  cropRatio: e && e > 0 ? e : null,
@@ -338,24 +338,24 @@ function Ln(t, e) {
338
338
  redact: { effect: "blur", amount: 0 }
339
339
  };
340
340
  }
341
- function ge(t, e) {
342
- const n = (Math.round(t / ee) % 4 + 4) % 4, i = e ?? n * ee;
341
+ function _e(t, e) {
342
+ const n = (Math.round(t / re) % 4 + 4) % 4, i = e ?? n * re;
343
343
  let o = t - i;
344
- return o = Math.atan2(Math.sin(o), Math.cos(o)), { quarter: Ee(i), fine: o };
344
+ return o = Math.atan2(Math.sin(o), Math.cos(o)), { quarter: ke(i), fine: o };
345
345
  }
346
- const Ee = (t) => {
346
+ const ke = (t) => {
347
347
  const e = t % (2 * Math.PI), n = e < 0 ? e + 2 * Math.PI : e;
348
348
  return Math.abs(n - 2 * Math.PI) < Ze ? 0 : n;
349
349
  };
350
- function Oe(t, e, n) {
351
- const { width: i, height: o } = t.crop, r = $t(t, n), a = Math.max(t.scale, oe(i, o, e, n)), s = Gt(r, i, o, e, a, n);
352
- return { ...t, rotation: e, scale: a, crop: jt(s, i, o, e, a, n) };
350
+ function Fe(t, e, n) {
351
+ const { width: i, height: o } = t.crop, r = jt(t, n), a = Math.max(t.scale, se(i, o, e, n)), s = Wt(r, i, o, e, a, n);
352
+ return { ...t, rotation: e, scale: a, crop: Kt(s, i, o, e, a, n) };
353
353
  }
354
- function kn(t, e) {
355
- const [n, i] = Vt(t.crop), o = e.width / 2, r = e.height / 2, [a, s] = ie([n - o, i - r], -ee), _ = t.crop.height, c = t.crop.width;
354
+ function Ln(t, e) {
355
+ const [n, i] = $t(t.crop), o = e.width / 2, r = e.height / 2, [a, s] = ae([n - o, i - r], -re), _ = t.crop.height, c = t.crop.width;
356
356
  return {
357
357
  ...t,
358
- rotation: t.rotation - ee,
358
+ rotation: t.rotation - re,
359
359
  crop: { x: o + a - _ / 2, y: r + s - c / 2, width: _, height: c },
360
360
  cropRatio: t.cropRatio ? 1 / t.cropRatio : t.cropRatio
361
361
  };
@@ -368,99 +368,99 @@ function Nn(t, e) {
368
368
  crop: { ...t.crop, x: e.width - t.crop.x - t.crop.width }
369
369
  };
370
370
  }
371
- function Jt(t, e) {
372
- return t.scale / oe(t.crop.width, t.crop.height, t.rotation, e);
371
+ function Bt(t, e) {
372
+ return t.scale / se(t.crop.width, t.crop.height, t.rotation, e);
373
373
  }
374
- const Bt = 5;
375
- function Yt(t, e, n) {
376
- const { width: i, height: o } = t.crop, r = $t(t, n), a = oe(i, o, t.rotation, n) * Math.min(Bt, Math.max(1, e)), s = Gt(r, i, o, t.rotation, a, n);
377
- return { ...t, scale: a, crop: jt(s, i, o, t.rotation, a, n) };
374
+ const Vt = 5;
375
+ function Gt(t, e, n) {
376
+ const { width: i, height: o } = t.crop, r = jt(t, n), a = se(i, o, t.rotation, n) * Math.min(Vt, Math.max(1, e)), s = Wt(r, i, o, t.rotation, a, n);
377
+ return { ...t, scale: a, crop: Kt(s, i, o, t.rotation, a, n) };
378
378
  }
379
- function Pn(t, e, n, i) {
380
- const { width: o, height: r } = t.crop, a = { ...t, crop: { ...t.crop, x: t.crop.x + e, y: t.crop.y + n } }, s = Gt($t(a, i), o, r, t.rotation, t.scale, i);
381
- return { ...t, crop: jt(s, o, r, t.rotation, t.scale, i) };
379
+ function qn(t, e, n, i) {
380
+ const { width: o, height: r } = t.crop, a = { ...t, crop: { ...t.crop, x: t.crop.x + e, y: t.crop.y + n } }, s = Wt(jt(a, i), o, r, t.rotation, t.scale, i);
381
+ return { ...t, crop: Kt(s, o, r, t.rotation, t.scale, i) };
382
382
  }
383
- function zn(t, e, n) {
383
+ function Pn(t, e, n) {
384
384
  if (!e || e <= 0) return { ...t, cropRatio: null };
385
385
  const i = Math.abs(Math.cos(t.rotation)), o = Math.abs(Math.sin(t.rotation)), r = Math.min(
386
386
  n.width * t.scale / (e * i + o),
387
387
  n.height * t.scale / (e * o + i)
388
- ), a = r * e, s = Gt($t(t, n), a, r, t.rotation, t.scale, n);
388
+ ), a = r * e, s = Wt(jt(t, n), a, r, t.rotation, t.scale, n);
389
389
  return {
390
390
  ...t,
391
391
  cropRatio: e,
392
- crop: jt(s, a, r, t.rotation, t.scale, n)
392
+ crop: Kt(s, a, r, t.rotation, t.scale, n)
393
393
  };
394
394
  }
395
- function Dn(t, e, n, i, o, { aspectRatio: r, minSize: a }) {
395
+ function zn(t, e, n, i, o, { aspectRatio: r, minSize: a }) {
396
396
  const s = t.crop;
397
- let _ = s.x, c = s.y, M = s.x + s.width, d = s.y + s.height;
398
- const T = e.includes("n"), f = e.includes("s"), A = e.includes("w"), S = e.includes("e");
399
- if (T && (c = Math.min(c + i, d - a)), f && (d = Math.max(d + i, c + a)), A && (_ = Math.min(_ + n, M - a)), S && (M = Math.max(M + n, _ + a)), r && r > 0) {
400
- let v = M - _, N = d - c;
401
- if ((T || f) && (A || S))
402
- v / N > r ? N = v / r : v = N * r, A ? _ = M - v : M = _ + v, T ? c = d - N : d = c + N;
403
- else if (T || f) {
404
- v = N * r;
397
+ let _ = s.x, c = s.y, M = s.x + s.width, m = s.y + s.height;
398
+ const k = e.includes("n"), f = e.includes("s"), I = e.includes("w"), S = e.includes("e");
399
+ if (k && (c = Math.min(c + i, m - a)), f && (m = Math.max(m + i, c + a)), I && (_ = Math.min(_ + n, M - a)), S && (M = Math.max(M + n, _ + a)), r && r > 0) {
400
+ let b = M - _, N = m - c;
401
+ if ((k || f) && (I || S))
402
+ b / N > r ? N = b / r : b = N * r, I ? _ = M - b : M = _ + b, k ? c = m - N : m = c + N;
403
+ else if (k || f) {
404
+ b = N * r;
405
405
  const G = s.x + s.width / 2;
406
- _ = G - v / 2, M = G + v / 2;
406
+ _ = G - b / 2, M = G + b / 2;
407
407
  } else {
408
- N = v / r;
408
+ N = b / r;
409
409
  const G = s.y + s.height / 2;
410
- c = G - N / 2, d = G + N / 2;
410
+ c = G - N / 2, m = G + N / 2;
411
411
  }
412
412
  }
413
- const y = { x: _, y: c, width: M - _, height: d - c }, x = (v) => In(v, t.rotation, t.scale, o);
413
+ const y = { x: _, y: c, width: M - _, height: m - c }, x = (b) => Tn(b, t.rotation, t.scale, o);
414
414
  if (x(y)) return { ...t, crop: y };
415
- if (!(!(r && r > 0) && (T || f) && (A || S))) return { ...t, crop: Ft(s, y, x) };
416
- const C = (v) => ({ ...v, x: _, width: M - _ }), u = (v) => ({ ...v, y: c, height: d - c }), R = Ft(Ft(s, C(s), x), u, x), m = Ft(Ft(s, u(s), x), C, x), E = (v) => Math.abs(v.x - y.x) + Math.abs(v.y - y.y) + Math.abs(v.width - y.width) + Math.abs(v.height - y.height);
417
- return { ...t, crop: E(R) <= E(m) ? R : m };
415
+ if (!(!(r && r > 0) && (k || f) && (I || S))) return { ...t, crop: Ot(s, y, x) };
416
+ const A = (b) => ({ ...b, x: _, width: M - _ }), u = (b) => ({ ...b, y: c, height: m - c }), R = Ot(Ot(s, A(s), x), u, x), d = Ot(Ot(s, u(s), x), A, x), E = (b) => Math.abs(b.x - y.x) + Math.abs(b.y - y.y) + Math.abs(b.width - y.width) + Math.abs(b.height - y.height);
417
+ return { ...t, crop: E(R) <= E(d) ? R : d };
418
418
  }
419
- function Ft(t, e, n) {
419
+ function Ot(t, e, n) {
420
420
  const i = typeof e == "function" ? e(t) : e;
421
421
  if (n(i)) return i;
422
422
  let o = 0, r = 1;
423
423
  for (let a = 0; a < 24; a++) {
424
424
  const s = (o + r) / 2;
425
- n(Xe(t, i, s)) ? o = s : r = s;
425
+ n(Oe(t, i, s)) ? o = s : r = s;
426
426
  }
427
- return Xe(t, i, o);
427
+ return Oe(t, i, o);
428
428
  }
429
- const Xe = (t, e, n) => ({
429
+ const Oe = (t, e, n) => ({
430
430
  x: t.x + (e.x - t.x) * n,
431
431
  y: t.y + (e.y - t.y) * n,
432
432
  width: t.width + (e.width - t.width) * n,
433
433
  height: t.height + (e.height - t.height) * n
434
434
  });
435
- function Be(t, e) {
435
+ function Xe(t, e) {
436
436
  const n = {
437
437
  ...t.crop,
438
438
  width: Math.max(1, t.crop.width),
439
439
  height: Math.max(1, t.crop.height)
440
440
  };
441
- return An({ ...t, crop: n, scale: Math.max(Ze, t.scale || 1) }, e);
441
+ return In({ ...t, crop: n, scale: Math.max(Ze, t.scale || 1) }, e);
442
442
  }
443
- const tn = 0.85, Un = (t, e, n) => {
443
+ const tn = 0.85, Dn = (t, e, n) => {
444
444
  const i = Math.min(1, Math.max(0, (n - t) / (e - t)));
445
445
  return i * i * (3 - 2 * i);
446
- }, Fn = (t, e) => Un(0.3, 1, Math.hypot(t, e) / Math.SQRT2);
447
- function Re(t, e, n, i, o, r) {
446
+ }, Un = (t, e) => Dn(0.3, 1, Math.hypot(t, e) / Math.SQRT2);
447
+ function Ce(t, e, n, i, o, r) {
448
448
  const a = i.matrix, s = 1 / i.gamma, _ = Math.abs(i.gamma - 1) > 1e-4, c = Math.abs(i.clarity) > 1e-4 && !!o, M = Math.abs(i.vignette) > 1e-4 && !!r;
449
- for (let d = 0; d < n; d++)
450
- for (let T = 0; T < e; T++) {
451
- const f = (d * e + T) * 4, A = t[f + 3] / 255;
452
- if (A === 0) continue;
449
+ for (let m = 0; m < n; m++)
450
+ for (let k = 0; k < e; k++) {
451
+ const f = (m * e + k) * 4, I = t[f + 3] / 255;
452
+ if (I === 0) continue;
453
453
  const S = t[f] / 255, y = t[f + 1] / 255, x = t[f + 2] / 255;
454
- let l = a[0] * S + a[1] * y + a[2] * x + a[3] * A + a[4], C = a[5] * S + a[6] * y + a[7] * x + a[8] * A + a[9], u = a[10] * S + a[11] * y + a[12] * x + a[13] * A + a[14];
454
+ let l = a[0] * S + a[1] * y + a[2] * x + a[3] * I + a[4], A = a[5] * S + a[6] * y + a[7] * x + a[8] * I + a[9], u = a[10] * S + a[11] * y + a[12] * x + a[13] * I + a[14];
455
455
  if (c) {
456
- const R = o[f] / 255, m = o[f + 1] / 255, E = o[f + 2] / 255, v = o[f + 3] / 255, N = a[0] * R + a[1] * m + a[2] * E + a[3] * v + a[4], j = a[5] * R + a[6] * m + a[7] * E + a[8] * v + a[9], G = a[10] * R + a[11] * m + a[12] * E + a[13] * v + a[14];
457
- l += i.clarity * (l - N), C += i.clarity * (C - j), u += i.clarity * (u - G);
456
+ const R = o[f] / 255, d = o[f + 1] / 255, E = o[f + 2] / 255, b = o[f + 3] / 255, N = a[0] * R + a[1] * d + a[2] * E + a[3] * b + a[4], $ = a[5] * R + a[6] * d + a[7] * E + a[8] * b + a[9], G = a[10] * R + a[11] * d + a[12] * E + a[13] * b + a[14];
457
+ l += i.clarity * (l - N), A += i.clarity * (A - $), u += i.clarity * (u - G);
458
458
  }
459
- if (_ && (l = Math.pow(Math.max(0, l), s), C = Math.pow(Math.max(0, C), s), u = Math.pow(Math.max(0, u), s)), M) {
460
- const R = T + 0.5, m = d + 0.5, E = r[0] * R + r[1] * m + r[2], v = r[3] * R + r[4] * m + r[5], N = Fn(E, v) * tn * Math.abs(i.vignette);
461
- i.vignette > 0 ? (l *= 1 - N, C *= 1 - N, u *= 1 - N) : (l += (1 - l) * N, C += (1 - C) * N, u += (1 - u) * N);
459
+ if (_ && (l = Math.pow(Math.max(0, l), s), A = Math.pow(Math.max(0, A), s), u = Math.pow(Math.max(0, u), s)), M) {
460
+ const R = k + 0.5, d = m + 0.5, E = r[0] * R + r[1] * d + r[2], b = r[3] * R + r[4] * d + r[5], N = Un(E, b) * tn * Math.abs(i.vignette);
461
+ i.vignette > 0 ? (l *= 1 - N, A *= 1 - N, u *= 1 - N) : (l += (1 - l) * N, A += (1 - A) * N, u += (1 - u) * N);
462
462
  }
463
- t[f] = l * 255, t[f + 1] = C * 255, t[f + 2] = u * 255;
463
+ t[f] = l * 255, t[f + 1] = A * 255, t[f + 2] = u * 255;
464
464
  }
465
465
  }
466
466
  function Le(t, e, n, i) {
@@ -468,30 +468,30 @@ function Le(t, e, n, i) {
468
468
  for (let _ = 0; _ < 3; _++)
469
469
  s(r, a, e, n, o, !0), s(a, r, e, n, o, !1);
470
470
  return r;
471
- function s(_, c, M, d, T, f) {
472
- const A = f ? d : M, S = f ? M : d, y = f ? 4 : M * 4, x = T * 2 + 1;
473
- for (let l = 0; l < A; l++) {
474
- const C = f ? l * M * 4 : l * 4;
471
+ function s(_, c, M, m, k, f) {
472
+ const I = f ? m : M, S = f ? M : m, y = f ? 4 : M * 4, x = k * 2 + 1;
473
+ for (let l = 0; l < I; l++) {
474
+ const A = f ? l * M * 4 : l * 4;
475
475
  for (let u = 0; u < 4; u++) {
476
476
  let R = 0;
477
- for (let m = -T; m <= T; m++) {
478
- const E = Math.min(S - 1, Math.max(0, m));
479
- R += _[C + E * y + u];
477
+ for (let d = -k; d <= k; d++) {
478
+ const E = Math.min(S - 1, Math.max(0, d));
479
+ R += _[A + E * y + u];
480
480
  }
481
- for (let m = 0; m < S; m++) {
482
- c[C + m * y + u] = R / x;
483
- const E = Math.max(0, m - T), v = Math.min(S - 1, m + T + 1);
484
- R += _[C + v * y + u] - _[C + E * y + u];
481
+ for (let d = 0; d < S; d++) {
482
+ c[A + d * y + u] = R / x;
483
+ const E = Math.max(0, d - k), b = Math.min(S - 1, d + k + 1);
484
+ R += _[A + b * y + u] - _[A + E * y + u];
485
485
  }
486
486
  }
487
487
  }
488
488
  }
489
489
  }
490
- const ke = 0.012, en = (t, e) => {
490
+ const Ne = 0.012, en = (t, e) => {
491
491
  const n = document.createElement("canvas");
492
492
  return n.width = Math.max(1, Math.round(t)), n.height = Math.max(1, Math.round(e)), n;
493
493
  };
494
- async function Ye(t) {
494
+ async function Be(t) {
495
495
  if (typeof createImageBitmap == "function")
496
496
  try {
497
497
  return await createImageBitmap(t, { imageOrientation: "from-image" });
@@ -510,27 +510,27 @@ function nn(t, e) {
510
510
  e && (o.crossOrigin = "anonymous"), o.decoding = "async", o.onload = () => n(o), o.onerror = () => i(new Error(`Could not load image: ${t.slice(0, 80)}`)), o.src = t;
511
511
  });
512
512
  }
513
- const On = (t) => t instanceof HTMLImageElement ? { width: t.naturalWidth, height: t.naturalHeight } : { width: t.width, height: t.height };
514
- async function Xn(t) {
513
+ const Fn = (t) => t instanceof HTMLImageElement ? { width: t.naturalWidth, height: t.naturalHeight } : { width: t.width, height: t.height };
514
+ async function On(t) {
515
515
  let e, n = "";
516
516
  if (typeof t == "string")
517
517
  try {
518
518
  const r = await fetch(t);
519
519
  if (!r.ok) throw new Error(String(r.status));
520
520
  const a = await r.blob();
521
- n = a.type, e = await Ye(a);
521
+ n = a.type, e = await Be(a);
522
522
  } catch {
523
523
  e = await nn(t, !t.startsWith("data:") && !t.startsWith("blob:"));
524
524
  const r = /^data:([^;,]+)/.exec(t) ?? /\.(png|jpe?g|webp|gif|avif)(?:[?#]|$)/i.exec(t);
525
525
  r && (n = r[1].includes("/") ? r[1] : `image/${r[1].toLowerCase().replace("jpg", "jpeg")}`);
526
526
  }
527
527
  else
528
- n = t.type, e = await Ye(t);
529
- const { width: i, height: o } = On(e);
528
+ n = t.type, e = await Be(t);
529
+ const { width: i, height: o } = Fn(e);
530
530
  if (!i || !o) throw new Error("The image has no size");
531
531
  return { image: e, width: i, height: o, type: n };
532
532
  }
533
- function te(t, e, n, i) {
533
+ function ne(t, e, n, i) {
534
534
  const o = Math.min(1, i / Math.max(e, n));
535
535
  if (o >= 1) return { canvas: t, width: e, height: n };
536
536
  const r = en(e * o, n * o), a = r.getContext("2d");
@@ -547,14 +547,14 @@ function rn(t, e, n, i, o = 384) {
547
547
  }
548
548
  return a;
549
549
  }
550
- function Bn(t, e) {
550
+ function Xn(t, e) {
551
551
  return t || (["image/jpeg", "image/png", "image/webp"].includes(e) ? e : "image/png");
552
552
  }
553
- const Yn = [1, 0, 0, 0, 1, 0], st = (t, e) => [1, 0, t, 0, 1, e], nt = (t, e = t) => [t, 0, 0, 0, e, 0], on = (t) => {
553
+ const Bn = [1, 0, 0, 0, 1, 0], st = (t, e) => [1, 0, t, 0, 1, e], nt = (t, e = t) => [t, 0, 0, 0, e, 0], on = (t) => {
554
554
  const e = Math.cos(t), n = Math.sin(t);
555
555
  return [e, -n, 0, n, e, 0];
556
556
  };
557
- function Vn(t, e) {
557
+ function Yn(t, e) {
558
558
  return [
559
559
  t[0] * e[0] + t[1] * e[3],
560
560
  t[0] * e[1] + t[1] * e[4],
@@ -564,19 +564,19 @@ function Vn(t, e) {
564
564
  t[3] * e[2] + t[4] * e[5] + t[5]
565
565
  ];
566
566
  }
567
- const at = (...t) => t.reduce((e, n) => Vn(n, e), Yn);
568
- function Lt([t, e, n, i, o, r]) {
567
+ const at = (...t) => t.reduce((e, n) => Yn(n, e), Bn);
568
+ function Nt([t, e, n, i, o, r]) {
569
569
  const a = t * o - e * i, s = Math.abs(a) < 1e-12 ? 1e12 : 1 / a;
570
570
  return [o * s, -e * s, (e * r - n * o) * s, -i * s, t * s, (n * i - t * r) * s];
571
571
  }
572
- const ne = ([t, e, n, i, o, r], a, s) => [
572
+ const ie = ([t, e, n, i, o, r], a, s) => [
573
573
  t * a + e * s + n,
574
574
  i * a + o * s + r
575
- ], $n = { blur: 0.015, pixelate: 0.05 };
575
+ ], Vn = { blur: 0.015, pixelate: 0.05 };
576
576
  function Te(t, e) {
577
577
  var o, r;
578
578
  const n = ((o = t.redact) == null ? void 0 : o.effect) ?? "blur";
579
- return Math.max(0, Math.min(100, ((r = t.redact) == null ? void 0 : r.amount) ?? 0)) / 100 * ($n[n] ?? 0) * Math.max(e.width, e.height);
579
+ return Math.max(0, Math.min(100, ((r = t.redact) == null ? void 0 : r.amount) ?? 0)) / 100 * (Vn[n] ?? 0) * Math.max(e.width, e.height);
580
580
  }
581
581
  function an(t, e) {
582
582
  const n = Math.max(1e-6, e);
@@ -585,12 +585,12 @@ function an(t, e) {
585
585
  rows: Math.max(1, Math.round(t.height / n))
586
586
  };
587
587
  }
588
- const Gn = 4, ae = (t, e) => {
588
+ const Gn = 4, ce = (t, e) => {
589
589
  const n = document.createElement("canvas");
590
590
  return n.width = Math.max(1, Math.round(t)), n.height = Math.max(1, Math.round(e)), n;
591
591
  };
592
592
  function sn(t, e, n, i, o) {
593
- const r = Math.min(1, Gn / Math.max(1, i), o / Math.max(e, n)), a = ae(e * r, n * r), s = a.getContext("2d", { willReadFrequently: !0 });
593
+ const r = Math.min(1, Gn / Math.max(1, i), o / Math.max(e, n)), a = ce(e * r, n * r), s = a.getContext("2d", { willReadFrequently: !0 });
594
594
  if (!s) return a;
595
595
  s.imageSmoothingQuality = "high", s.drawImage(t, 0, 0, a.width, a.height);
596
596
  try {
@@ -600,16 +600,16 @@ function sn(t, e, n, i, o) {
600
600
  }
601
601
  return a;
602
602
  }
603
- function jn(t, e, n, i) {
604
- const o = ae(e, n), r = o.getContext("2d");
603
+ function $n(t, e, n, i) {
604
+ const o = ce(e, n), r = o.getContext("2d");
605
605
  return r && (r.imageSmoothingQuality = "high", r.drawImage(sn(t, e, n, i, 1024), 0, 0, e, n)), o;
606
606
  }
607
607
  function cn(t, e, n) {
608
- const i = ae(e, n), o = i.getContext("2d"), r = t.getContext("2d");
608
+ const i = ce(e, n), o = i.getContext("2d"), r = t.getContext("2d");
609
609
  !o || !r || (o.imageSmoothingQuality = "high", o.drawImage(t, 0, 0, i.width, i.height), r.save(), r.setTransform(1, 0, 0, 1, 0, 0), r.globalCompositeOperation = "copy", r.imageSmoothingEnabled = !1, r.drawImage(i, 0, 0, t.width, t.height), r.restore());
610
610
  }
611
- function qn(t, e, n, i) {
612
- const o = ae(e, n), r = o.getContext("2d");
611
+ function jn(t, e, n, i) {
612
+ const o = ce(e, n), r = o.getContext("2d");
613
613
  return r && (r.drawImage(t, 0, 0, e, n), cn(
614
614
  o,
615
615
  Math.max(1, Math.round(e / Math.max(2, i))),
@@ -617,7 +617,7 @@ function qn(t, e, n, i) {
617
617
  )), o;
618
618
  }
619
619
  const ln = (t) => t.area ? [t.area.x + t.area.width / 2, t.area.y + t.area.height / 2] : [t.width / 2, t.height / 2];
620
- function Ne(t, e) {
620
+ function qe(t, e) {
621
621
  const n = e.width / 2, i = e.height / 2;
622
622
  return at(
623
623
  st(-n, -i),
@@ -637,21 +637,21 @@ function hn(t, e) {
637
637
  );
638
638
  }
639
639
  function Wn(t) {
640
- const [e, n] = Vt(t);
640
+ const [e, n] = $t(t);
641
641
  return at(st(-e, -n), nt(2 / t.width, 2 / t.height));
642
642
  }
643
643
  function Kn(t, e, n, i) {
644
- const o = at(nt(1 / i.dpr), Lt(hn(n, i))), r = at(
644
+ const o = at(nt(1 / i.dpr), Nt(hn(n, i))), r = at(
645
645
  o,
646
- Lt(Ne(t, e)),
646
+ Nt(qe(t, e)),
647
647
  nt(1 / e.width, 1 / e.height)
648
648
  );
649
649
  return { toUV: r, toBlurUV: r, toCrop: at(o, Wn(t.crop)) };
650
650
  }
651
- function Ve(t, e, n) {
651
+ function Ye(t, e, n) {
652
652
  const i = Math.max(1, e.width - n * 2), o = Math.max(1, e.height - n * 2);
653
653
  return {
654
- center: Vt(t),
654
+ center: $t(t),
655
655
  scale: Math.min(i / t.width, o / t.height),
656
656
  rotation: 0,
657
657
  flip: 1
@@ -684,7 +684,8 @@ vec3 grade(vec4 c) { return (u_cm * c + u_co).rgb; }
684
684
  void main() {
685
685
  vec3 px = vec3(gl_FragCoord.x, u_size.y - gl_FragCoord.y, 1.0);
686
686
  vec2 cn = vec2(dot(u_cropX, px), dot(u_cropY, px));
687
- if (u_clip && (abs(cn.x) > 1.0 || abs(cn.y) > 1.0)) { gl_FragColor = vec4(0.0); return; }
687
+ // the pixel's own place in the crop (before a pixelation snaps cn to its block) — for the clip
688
+ bool outsideCrop = abs(cn.x) > 1.0 || abs(cn.y) > 1.0;
688
689
  vec2 uv = vec2(dot(u_uvX, px), dot(u_uvY, px));
689
690
  vec2 buv = vec2(dot(u_blurX, px), dot(u_blurY, px));
690
691
  if (u_pixel.x > 0.0) {
@@ -698,25 +699,28 @@ void main() {
698
699
  uv = vec2(dot(u_cuvX, q), dot(u_cuvY, q));
699
700
  buv = uv;
700
701
  }
701
- if (uv.x < 0.0 || uv.y < 0.0 || uv.x > 1.0 || uv.y > 1.0) { gl_FragColor = vec4(0.0); return; }
702
+ // sample BEFORE any early return: a texture read in a branch only some pixels of a 2×2 quad take has no
703
+ // defined derivatives, so at the image's edge the GPU picked a far too coarse mip level — a blurred
704
+ // copy of the content showed through as a faint line along a transparent image's sides
702
705
  vec4 c = texture2D(u_image, uv);
703
- if (c.a <= 0.0) { gl_FragColor = vec4(0.0); return; }
704
- vec3 rgb = grade(c);
705
- if (u_clarity != 0.0) {
706
- vec4 bl = texture2D(u_blur, buv);
707
- rgb += u_clarity * (rgb - grade(bl));
706
+ vec4 bl = texture2D(u_blur, buv);
707
+ if ((u_clip && outsideCrop) || uv.x < 0.0 || uv.y < 0.0 || uv.x > 1.0 || uv.y > 1.0 || c.a <= 0.0) {
708
+ gl_FragColor = vec4(0.0);
709
+ return;
708
710
  }
711
+ vec3 rgb = grade(c);
712
+ if (u_clarity != 0.0) rgb += u_clarity * (rgb - grade(bl));
709
713
  if (u_gamma != 1.0) rgb = pow(max(rgb, 0.0), vec3(1.0 / u_gamma));
710
714
  if (u_vignette != 0.0) {
711
715
  float f = smoothstep(0.3, 1.0, length(cn) / 1.41421356) * ${tn.toFixed(2)} * abs(u_vignette);
712
716
  rgb = u_vignette > 0.0 ? rgb * (1.0 - f) : rgb + (1.0 - rgb) * f;
713
717
  }
714
718
  rgb = clamp(rgb, 0.0, 1.0);
715
- if (abs(cn.x) > 1.0 || abs(cn.y) > 1.0) rgb = mix(u_dimColor, rgb, u_dim);
719
+ if (outsideCrop) rgb = mix(u_dimColor, rgb, u_dim);
716
720
  gl_FragColor = vec4(rgb * c.a, c.a);
717
721
  }
718
722
  `;
719
- class se {
723
+ class le {
720
724
  constructor(e, n) {
721
725
  this.loc = {}, this.canvas = e, this.gl = n, this.maxTextureSize = n.getParameter(n.MAX_TEXTURE_SIZE), this.program = this.link(), n.useProgram(this.program);
722
726
  const i = n.createBuffer();
@@ -757,7 +761,7 @@ class se {
757
761
  antialias: !1,
758
762
  preserveDrawingBuffer: !0
759
763
  }, i = e.getContext("webgl2", n) ?? e.getContext("webgl", n);
760
- return i ? new se(e, i) : null;
764
+ return i ? new le(e, i) : null;
761
765
  } catch {
762
766
  return null;
763
767
  }
@@ -798,18 +802,18 @@ class se {
798
802
  render(e) {
799
803
  const n = this.gl, { width: i, height: o } = this.canvas;
800
804
  n.viewport(0, 0, i, o), n.clearColor(0, 0, 0, 0), n.clear(n.COLOR_BUFFER_BIT), n.uniform2f(this.loc.u_size, i, o);
801
- const r = (f, A, S) => {
802
- n.uniform3f(this.loc[A], f[0], f[1], f[2]), n.uniform3f(this.loc[S], f[3], f[4], f[5]);
805
+ const r = (f, I, S) => {
806
+ n.uniform3f(this.loc[I], f[0], f[1], f[2]), n.uniform3f(this.loc[S], f[3], f[4], f[5]);
803
807
  };
804
808
  r(e.toUV, "u_uvX", "u_uvY"), r(e.toBlurUV, "u_blurX", "u_blurY"), r(e.toCrop, "u_cropX", "u_cropY"), n.uniform1i(this.loc.u_clip, e.clip ? 1 : 0), n.uniform1f(this.loc.u_dim, e.dim ?? 1);
805
809
  const [a, s, _] = e.dimColor ?? [0, 0, 0];
806
810
  n.uniform3f(this.loc.u_dimColor, a, s, _);
807
811
  const c = e.matrix, M = new Float32Array(16);
808
812
  for (let f = 0; f < 4; f++)
809
- for (let A = 0; A < 4; A++) M[A * 4 + f] = c[f * 5 + A];
813
+ for (let I = 0; I < 4; I++) M[I * 4 + f] = c[f * 5 + I];
810
814
  n.uniformMatrix4fv(this.loc.u_cm, !1, M), n.uniform4f(this.loc.u_co, c[4], c[9], c[14], c[19]), n.uniform1f(this.loc.u_gamma, e.gamma), n.uniform1f(this.loc.u_clarity, e.clarity), n.uniform1f(this.loc.u_vignette, e.vignette);
811
- const [d, T] = e.pixel ?? [0, 0];
812
- n.uniform2f(this.loc.u_pixel, d, T), e.pixel && e.cropToUV && r(e.cropToUV, "u_cuvX", "u_cuvY"), n.drawArrays(n.TRIANGLE_STRIP, 0, 4);
815
+ const [m, k] = e.pixel ?? [0, 0];
816
+ n.uniform2f(this.loc.u_pixel, m, k), e.pixel && e.cropToUV && r(e.cropToUV, "u_cuvX", "u_cuvY"), n.drawArrays(n.TRIANGLE_STRIP, 0, 4);
813
817
  }
814
818
  /**
815
819
  * Release the GPU resources. `loseContext` also drops the context itself (a throwaway export canvas —
@@ -824,7 +828,7 @@ class se {
824
828
  function Pe(t, e = t.colorMatrix) {
825
829
  const n = t.finetune;
826
830
  return {
827
- matrix: Tn(e, n),
831
+ matrix: kn(e, n),
828
832
  gamma: ut.gamma(n.gamma),
829
833
  clarity: ut.clarity(n.clarity),
830
834
  vignette: ut.vignette(n.vignette)
@@ -839,46 +843,46 @@ function Zn(t, e, n, i, o, r) {
839
843
  if (!a) return;
840
844
  const { width: s, height: _ } = t;
841
845
  a.setTransform(1, 0, 0, 1, 0, 0), a.clearRect(0, 0, s, _);
842
- const c = (d, T, f, A) => {
843
- const S = at(nt(1 / f.width, 1 / f.height), Lt(A));
844
- if (d.save(), r.clip) {
845
- const y = Lt(r.toCrop);
846
- d.beginPath(), [
846
+ const c = (m, k, f, I) => {
847
+ const S = at(nt(1 / f.width, 1 / f.height), Nt(I));
848
+ if (m.save(), r.clip) {
849
+ const y = Nt(r.toCrop);
850
+ m.beginPath(), [
847
851
  [-1, -1],
848
852
  [1, -1],
849
853
  [1, 1],
850
854
  [-1, 1]
851
- ].forEach(([x, l], C) => {
852
- const [u, R] = ne(y, x, l);
853
- C === 0 ? d.moveTo(u, R) : d.lineTo(u, R);
854
- }), d.closePath(), d.clip();
855
+ ].forEach(([x, l], A) => {
856
+ const [u, R] = ie(y, x, l);
857
+ A === 0 ? m.moveTo(u, R) : m.lineTo(u, R);
858
+ }), m.closePath(), m.clip();
855
859
  }
856
- d.setTransform(S[0], S[3], S[1], S[4], S[2], S[5]), d.imageSmoothingQuality = "high", d.drawImage(T, 0, 0, f.width, f.height), d.restore();
860
+ m.setTransform(S[0], S[3], S[1], S[4], S[2], S[5]), m.imageSmoothingQuality = "high", m.drawImage(k, 0, 0, f.width, f.height), m.restore();
857
861
  };
858
862
  if (c(a, e, n, r.toUV), un(r) && M(), r.dim != null && r.dim < 1) {
859
- const d = Lt(r.toCrop);
863
+ const m = Nt(r.toCrop);
860
864
  a.save(), a.globalCompositeOperation = "source-atop", a.beginPath(), a.rect(0, 0, s, _), [
861
865
  [-1, -1],
862
866
  [1, -1],
863
867
  [1, 1],
864
868
  [-1, 1]
865
869
  ].forEach(([S, y], x) => {
866
- const [l, C] = ne(d, S, y);
867
- x === 0 ? a.moveTo(l, C) : a.lineTo(l, C);
870
+ const [l, A] = ie(m, S, y);
871
+ x === 0 ? a.moveTo(l, A) : a.lineTo(l, A);
868
872
  }), a.closePath();
869
- const [T, f, A] = (r.dimColor ?? [0, 0, 0]).map((S) => Math.round(S * 255));
870
- a.fillStyle = `rgba(${T}, ${f}, ${A}, ${1 - r.dim})`, a.fill("evenodd"), a.restore();
873
+ const [k, f, I] = (r.dimColor ?? [0, 0, 0]).map((S) => Math.round(S * 255));
874
+ a.fillStyle = `rgba(${k}, ${f}, ${I}, ${1 - r.dim})`, a.fill("evenodd"), a.restore();
871
875
  }
872
876
  function M() {
873
877
  if (a)
874
878
  try {
875
- const d = a.getImageData(0, 0, s, _);
876
- let T = null;
879
+ const m = a.getImageData(0, 0, s, _);
880
+ let k = null;
877
881
  if (r.clarity !== 0) {
878
- const A = ze(s, _).getContext("2d", { willReadFrequently: !0 });
879
- A && (c(A, i, o, r.toBlurUV), T = A.getImageData(0, 0, s, _).data);
882
+ const I = ze(s, _).getContext("2d", { willReadFrequently: !0 });
883
+ I && (c(I, i, o, r.toBlurUV), k = I.getImageData(0, 0, s, _).data);
880
884
  }
881
- Re(d.data, s, _, r, T, r.toCrop), a.putImageData(d, 0, 0);
885
+ Ce(m.data, s, _, r, k, r.toCrop), a.putImageData(m, 0, 0);
882
886
  } catch {
883
887
  }
884
888
  }
@@ -896,60 +900,60 @@ const Jn = 16384, tr = 16384 * 16384, er = (t, e, n) => new Promise((i, o) => {
896
900
  });
897
901
  async function nr(t, e, n, i, o) {
898
902
  var x;
899
- const r = Rt(n), a = Xt(n), s = Math.min(
903
+ const r = Lt(n), a = Yt(n), s = Math.min(
900
904
  1,
901
905
  Jn / Math.max(r.width, r.height),
902
906
  Math.sqrt(tr / (r.width * r.height))
903
- ), _ = Math.max(1, Math.round(r.width * s)), c = Math.max(1, Math.round(r.height * s)), M = ze(_, c), d = M.getContext("2d");
904
- if (!d) throw new Error("Canvas 2D is unavailable");
905
- const T = at(
906
- Ne(n, e),
907
+ ), _ = Math.max(1, Math.round(r.width * s)), c = Math.max(1, Math.round(r.height * s)), M = ze(_, c), m = M.getContext("2d");
908
+ if (!m) throw new Error("Canvas 2D is unavailable");
909
+ const k = at(
910
+ qe(n, e),
907
911
  st(-a.x, -a.y),
908
912
  nt(_ / a.width, c / a.height)
909
913
  );
910
- i === "image/jpeg" && (d.fillStyle = "#fff", d.fillRect(0, 0, _, c)), d.setTransform(T[0], T[3], T[1], T[4], T[2], T[5]), d.imageSmoothingEnabled = !0, d.imageSmoothingQuality = "high";
911
- const f = Te(n, e), A = (x = n.redact) == null ? void 0 : x.effect, S = f > 0 && A === "blur" ? jn(t, e.width, e.height, f) : t;
912
- d.drawImage(S, 0, 0, e.width, e.height), d.setTransform(1, 0, 0, 1, 0, 0);
914
+ i === "image/jpeg" && (m.fillStyle = "#fff", m.fillRect(0, 0, _, c)), m.setTransform(k[0], k[3], k[1], k[4], k[2], k[5]), m.imageSmoothingEnabled = !0, m.imageSmoothingQuality = "high";
915
+ const f = Te(n, e), I = (x = n.redact) == null ? void 0 : x.effect, S = f > 0 && I === "blur" ? $n(t, e.width, e.height, f) : t;
916
+ m.drawImage(S, 0, 0, e.width, e.height), m.setTransform(1, 0, 0, 1, 0, 0);
913
917
  const y = Pe(n);
914
918
  if (un(y)) {
915
- const l = ke * Math.max(e.width, e.height) * (_ / a.width) * n.scale, C = rn(M, _, c, l);
916
- rr(M, C, y);
919
+ const l = Ne * Math.max(e.width, e.height) * (_ / a.width) * n.scale, A = rn(M, _, c, l);
920
+ rr(M, A, y);
917
921
  }
918
- if (f > 0 && A === "pixelate") {
919
- const { cols: l, rows: C } = an(a, f * n.scale);
920
- cn(M, l, C);
922
+ if (f > 0 && I === "pixelate") {
923
+ const { cols: l, rows: A } = an(a, f * n.scale);
924
+ cn(M, l, A);
921
925
  }
922
926
  return er(M, i, o);
923
927
  }
924
928
  function rr(t, e, n) {
925
- const { width: i, height: o } = t, r = t.getContext("2d", { willReadFrequently: !0 }), a = document.createElement("canvas"), s = se.create(a), _ = s ? Math.min(2048, s.maxTextureSize) : 1024, c = ze(_, _), M = c.getContext("2d", { willReadFrequently: !0 });
929
+ const { width: i, height: o } = t, r = t.getContext("2d", { willReadFrequently: !0 }), a = document.createElement("canvas"), s = le.create(a), _ = s ? Math.min(2048, s.maxTextureSize) : 1024, c = ze(_, _), M = c.getContext("2d", { willReadFrequently: !0 });
926
930
  try {
927
- for (let d = 0; d < o; d += _)
928
- for (let T = 0; T < i; T += _) {
929
- const f = Math.min(_, i - T), A = Math.min(_, o - d), S = at(st(T, d), nt(2 / i, 2 / o), st(-1, -1)), y = at(st(T, d), nt(1 / i, 1 / o));
931
+ for (let m = 0; m < o; m += _)
932
+ for (let k = 0; k < i; k += _) {
933
+ const f = Math.min(_, i - k), I = Math.min(_, o - m), S = at(st(k, m), nt(2 / i, 2 / o), st(-1, -1)), y = at(st(k, m), nt(1 / i, 1 / o));
930
934
  if (s)
931
- c.width = f, c.height = A, M.clearRect(0, 0, f, A), M.drawImage(t, T, d, f, A, 0, 0, f, A), a.width = f, a.height = A, s.setImage(c, e, !1), s.render({ ...n, toUV: nt(1 / f, 1 / A), toBlurUV: y, toCrop: S, clip: !1 }), r.clearRect(T, d, f, A), r.drawImage(a, T, d);
935
+ c.width = f, c.height = I, M.clearRect(0, 0, f, I), M.drawImage(t, k, m, f, I, 0, 0, f, I), a.width = f, a.height = I, s.setImage(c, e, !1), s.render({ ...n, toUV: nt(1 / f, 1 / I), toBlurUV: y, toCrop: S, clip: !1 }), r.clearRect(k, m, f, I), r.drawImage(a, k, m);
932
936
  else {
933
- const x = r.getImageData(T, d, f, A);
937
+ const x = r.getImageData(k, m, f, I);
934
938
  let l = null;
935
- n.clarity !== 0 && (c.width = f, c.height = A, M.drawImage(
939
+ n.clarity !== 0 && (c.width = f, c.height = I, M.drawImage(
936
940
  e,
937
- T / i * e.width,
938
- d / o * e.height,
941
+ k / i * e.width,
942
+ m / o * e.height,
939
943
  f / i * e.width,
940
- A / o * e.height,
944
+ I / o * e.height,
941
945
  0,
942
946
  0,
943
947
  f,
944
- A
945
- ), l = M.getImageData(0, 0, f, A).data), Re(x.data, f, A, n, l, S), r.putImageData(x, T, d);
948
+ I
949
+ ), l = M.getImageData(0, 0, f, I).data), Ce(x.data, f, I, n, l, S), r.putImageData(x, k, m);
946
950
  }
947
951
  }
948
952
  } finally {
949
953
  s == null || s.dispose();
950
954
  }
951
955
  }
952
- const ir = 50, _e = (t, e) => JSON.stringify(t) === JSON.stringify(e), or = (t, e) => t === e || !!t && !!e && t.width === e.width && t.height === e.height, _t = (t) => JSON.parse(JSON.stringify(t));
956
+ const ir = 50, we = (t, e) => JSON.stringify(t) === JSON.stringify(e), or = (t, e) => t === e || !!t && !!e && t.width === e.width && t.height === e.height, _t = (t) => JSON.parse(JSON.stringify(t));
953
957
  class dn {
954
958
  constructor() {
955
959
  this.snapshot = {
@@ -972,7 +976,7 @@ class dn {
972
976
  ...e,
973
977
  canUndo: this.index > 0,
974
978
  canRedo: this.index < this.history.length - 1,
975
- canRevert: !!n && !!this.initial && !_e(n, this.initial)
979
+ canRevert: !!n && !!this.initial && !we(n, this.initial)
976
980
  }, this.storeListeners.forEach((i) => i());
977
981
  }
978
982
  on(e, n) {
@@ -1004,19 +1008,19 @@ class dn {
1004
1008
  ui: { ...this.snapshot.ui, util: e.util ?? "crop" }
1005
1009
  });
1006
1010
  try {
1007
- const i = await Xn(e.src);
1011
+ const i = await On(e.src);
1008
1012
  if (n !== this.openToken) return;
1009
1013
  this.loaded = i;
1010
- const o = { width: i.width, height: i.height }, r = Ln(o, e.cropAspectRatio), a = e.initialState ?? {}, s = {
1014
+ const o = { width: i.width, height: i.height }, r = Cn(o, e.cropAspectRatio), a = e.initialState ?? {}, s = {
1011
1015
  ...r,
1012
1016
  ...a,
1013
1017
  crop: { ...r.crop, ...a.crop },
1014
1018
  finetune: { ...Qe, ...a.finetune },
1015
1019
  redact: { ...r.redact, ...a.redact }
1016
1020
  };
1017
- s.filter && s.filter !== "default" && !s.colorMatrix && (s.colorMatrix = Ce[s.filter] ?? null);
1018
- const _ = Be(s, o);
1019
- this.initial = Be(r, o), this.history = [_t(_)], this.index = 0, this.patch({ status: "ready", state: _, size: o }), this.emit("load", { size: o });
1021
+ s.filter && s.filter !== "default" && !s.colorMatrix && (s.colorMatrix = Re[s.filter] ?? null);
1022
+ const _ = Xe(s, o);
1023
+ this.initial = Xe(r, o), this.history = [_t(_)], this.index = 0, this.patch({ status: "ready", state: _, size: o }), this.emit("load", { size: o });
1020
1024
  } catch (i) {
1021
1025
  if (n !== this.openToken) return;
1022
1026
  throw this.patch({ status: "error", error: i }), i;
@@ -1042,12 +1046,12 @@ class dn {
1042
1046
  const n = this.snapshot.state, i = this.snapshot.size;
1043
1047
  if (!n || !i) return;
1044
1048
  const o = { ...n, ...e }, r = this.index >= 0 ? this.history[this.index] : n;
1045
- "resize" in e && !or(e.resize ?? null, r.resize) || (o.resize = Cn(r, { ...o, resize: r.resize })), this.patch({ state: o });
1049
+ "resize" in e && !or(e.resize ?? null, r.resize) || (o.resize = An(r, { ...o, resize: r.resize })), this.patch({ state: o });
1046
1050
  }
1047
1051
  /** Push the current state onto the history (if it changed) and emit `update`. */
1048
1052
  commit() {
1049
1053
  const e = this.snapshot.state;
1050
- e && (this.index >= 0 && _e(e, this.history[this.index]) || (this.history = this.history.slice(0, this.index + 1), this.history.push(_t(e)), this.history.length > ir && this.history.shift(), this.index = this.history.length - 1, this.patch({}), this.emit("update", _t(e))));
1054
+ e && (this.index >= 0 && we(e, this.history[this.index]) || (this.history = this.history.slice(0, this.index + 1), this.history.push(_t(e)), this.history.length > ir && this.history.shift(), this.index = this.history.length - 1, this.patch({}), this.emit("update", _t(e))));
1051
1055
  }
1052
1056
  undo() {
1053
1057
  this.index <= 0 || (this.index--, this.patch({ state: _t(this.history[this.index]) }), this.emit("undo", this.getState()), this.emit("update", this.getState()));
@@ -1061,7 +1065,7 @@ class dn {
1061
1065
  */
1062
1066
  revert() {
1063
1067
  const e = this.snapshot.state;
1064
- !this.initial || !e || _e(e, this.initial) || (this.patch({ state: _t(this.initial) }), this.commit(), this.emit("revert", this.getState()));
1068
+ !this.initial || !e || we(e, this.initial) || (this.patch({ state: _t(this.initial) }), this.commit(), this.emit("revert", this.getState()));
1065
1069
  }
1066
1070
  setUi(e) {
1067
1071
  e.util && e.util !== this.snapshot.ui.util && this.commit(), this.patch({ ui: { ...this.snapshot.ui, ...e } });
@@ -1071,7 +1075,7 @@ class dn {
1071
1075
  var a, s;
1072
1076
  const e = this.loaded, n = this.snapshot.state;
1073
1077
  if (!e || !n) throw new Error("No image is open");
1074
- const i = Bn((a = this.options) == null ? void 0 : a.outputType, e.type), r = { dest: await nr(
1078
+ const i = Xn((a = this.options) == null ? void 0 : a.outputType, e.type), r = { dest: await nr(
1075
1079
  e.image,
1076
1080
  { width: e.width, height: e.height },
1077
1081
  n,
@@ -1081,8 +1085,8 @@ class dn {
1081
1085
  return this.emit("process", r), r;
1082
1086
  }
1083
1087
  }
1084
- const po = () => new dn(), ar = () => typeof window < "u" && typeof window.matchMedia == "function" && window.matchMedia("(prefers-reduced-motion: reduce)").matches;
1085
- function $e(t, e, n, { stiffness: i = 240, damping: o = 30 } = {}, r) {
1088
+ const _o = () => new dn(), ar = () => typeof window < "u" && typeof window.matchMedia == "function" && window.matchMedia("(prefers-reduced-motion: reduce)").matches;
1089
+ function Ve(t, e, n, { stiffness: i = 240, damping: o = 30 } = {}, r) {
1086
1090
  if (ar() || typeof requestAnimationFrame != "function") {
1087
1091
  n(e), r == null || r();
1088
1092
  const S = (() => {
@@ -1090,36 +1094,36 @@ function $e(t, e, n, { stiffness: i = 240, damping: o = 30 } = {}, r) {
1090
1094
  return S.retarget = (y) => n(y), S;
1091
1095
  }
1092
1096
  const a = [...e], s = [...t], _ = t.map(() => 0), c = t.map((S, y) => Math.max(1e-5, Math.abs(a[y] - S) * 1e-3));
1093
- let M = performance.now(), d = 0, T = !1;
1097
+ let M = performance.now(), m = 0, k = !1;
1094
1098
  const f = (S) => {
1095
- if (T) return;
1099
+ if (k) return;
1096
1100
  let y = Math.min(0.064, (S - M) / 1e3);
1097
1101
  for (M = S; y > 0; ) {
1098
1102
  const l = Math.min(y, 0.008333333333333333);
1099
- for (let C = 0; C < s.length; C++) {
1100
- const u = -i * (s[C] - a[C]) - o * _[C];
1101
- _[C] += u * l, s[C] += _[C] * l;
1103
+ for (let A = 0; A < s.length; A++) {
1104
+ const u = -i * (s[A] - a[A]) - o * _[A];
1105
+ _[A] += u * l, s[A] += _[A] * l;
1102
1106
  }
1103
1107
  y -= l;
1104
1108
  }
1105
1109
  if (s.every(
1106
- (l, C) => Math.abs(l - a[C]) < c[C] && Math.abs(_[C]) < c[C] * 10
1110
+ (l, A) => Math.abs(l - a[A]) < c[A] && Math.abs(_[A]) < c[A] * 10
1107
1111
  )) {
1108
1112
  n(a), r == null || r();
1109
1113
  return;
1110
1114
  }
1111
- n([...s]), d = requestAnimationFrame(f);
1115
+ n([...s]), m = requestAnimationFrame(f);
1112
1116
  };
1113
- d = requestAnimationFrame(f);
1114
- const A = (() => {
1115
- T = !0, cancelAnimationFrame(d);
1117
+ m = requestAnimationFrame(f);
1118
+ const I = (() => {
1119
+ k = !0, cancelAnimationFrame(m);
1116
1120
  });
1117
- return A.retarget = (S) => {
1121
+ return I.retarget = (S) => {
1118
1122
  for (let y = 0; y < a.length; y++)
1119
1123
  a[y] = S[y], c[y] = Math.max(c[y], 1e-5);
1120
- }, A;
1124
+ }, I;
1121
1125
  }
1122
- const sr = "_overlay_2796b_6", cr = "_editor_2796b_11", lr = "_header_2796b_61", hr = "_headerStart_2796b_70", ur = "_headerCenter_2796b_74", dr = "_headerEnd_2796b_79", mr = "_group_2796b_84", fr = "_zoomLabel_2796b_97", pr = "_done_2796b_105", gr = "_closeIcon_2796b_116", _r = "_groupDivider_2796b_120", br = "_main_2796b_148", wr = "_nav_2796b_159", vr = "_stage_2796b_160", xr = "_toolbar_2796b_161", Mr = "_canvasArea_2796b_162", yr = "_footer_2796b_163", Er = "_footerInner_2796b_164", Tr = "_navList_2796b_169", Ir = "_toolbarRow_2796b_170", Ar = "_tool_2796b_161", Sr = "_toolActive_2796b_217", Cr = "_shapeSlot_2796b_263", Rr = "_shapePreview_2796b_270", Lr = "_shapeCustom_2796b_276", kr = "_shapeOrientation_2796b_281", Nr = "_orientButton_2796b_290", Pr = "_orientActive_2796b_313", zr = "_viewport_2796b_330", Dr = "_viewportCrop_2796b_339", Ur = "_viewportPannable_2796b_342", Fr = "_canvas_2796b_162", Or = "_scene_2796b_355", Xr = "_cropBox_2796b_362", Br = "_grid_2796b_369", Yr = "_cropInteracting_2796b_398", Vr = "_sizeBadge_2796b_404", $r = "_sizeBadgeActive_2796b_430", Gr = "_sizeTimes_2796b_433", jr = "_sizeUnit_2796b_434", qr = "_handle_2796b_444", Wr = "_handle_nw_2796b_448", Kr = "_handle_ne_2796b_449", Hr = "_handle_sw_2796b_450", Qr = "_handle_se_2796b_451", Zr = "_handle_n_2796b_448", Jr = "_handle_s_2796b_450", ti = "_handle_w_2796b_511", ei = "_handle_e_2796b_512", ni = "_status_2796b_527", ri = "_toastError_2796b_538", ii = "_tabs_2796b_571", oi = "_tab_2796b_571", ai = "_tabActive_2796b_606", si = "_tabDot_2796b_617", ci = "_resizePanel_2796b_628", li = "_resizeFields_2796b_634", hi = "_dimField_2796b_640", ui = "_dimLabel_2796b_658", di = "_dimLabelShort_2796b_662", mi = "_dimInput_2796b_665", fi = "_dimUnit_2796b_681", pi = "_lockButton_2796b_686", gi = "_lockActive_2796b_703", _i = "_strip_2796b_715", bi = "_fadeStart_2796b_730", wi = "_fadeEnd_2796b_734", vi = "_stripGroup_2796b_754", xi = "_filterTile_2796b_759", Mi = "_filterThumb_2796b_773", yi = "_filterActive_2796b_804", Ei = "_filterLabel_2796b_814", Ti = "_fadeIn_2796b_819", Ii = "_toolbarIconOnPhone_2796b_861", Ai = "_toolbarLabel_2796b_873", Si = "_dimLabelFull_2796b_882", Ci = "_toolLabel_2796b_918", b = {
1126
+ const sr = "_overlay_1kmqm_6", cr = "_editor_1kmqm_11", lr = "_header_1kmqm_61", hr = "_headerStart_1kmqm_70", ur = "_headerCenter_1kmqm_74", dr = "_headerEnd_1kmqm_79", mr = "_group_1kmqm_84", fr = "_zoomLabel_1kmqm_97", pr = "_done_1kmqm_105", gr = "_closeIcon_1kmqm_116", _r = "_groupDivider_1kmqm_120", wr = "_zoomReadout_1kmqm_140", vr = "_main_1kmqm_155", br = "_nav_1kmqm_166", xr = "_stage_1kmqm_167", Mr = "_toolbar_1kmqm_168", yr = "_canvasArea_1kmqm_169", Er = "_footer_1kmqm_170", kr = "_footerInner_1kmqm_171", Tr = "_navList_1kmqm_176", Ir = "_toolbarRow_1kmqm_177", Sr = "_tool_1kmqm_168", Ar = "_toolActive_1kmqm_224", Rr = "_shapeSlot_1kmqm_270", Cr = "_shapePreview_1kmqm_277", Lr = "_shapeCustom_1kmqm_283", Nr = "_shapeOrientation_1kmqm_288", qr = "_orientButton_1kmqm_297", Pr = "_orientActive_1kmqm_320", zr = "_viewport_1kmqm_337", Dr = "_viewportCrop_1kmqm_346", Ur = "_viewportPannable_1kmqm_349", Fr = "_canvas_1kmqm_169", Or = "_scene_1kmqm_362", Xr = "_cropBox_1kmqm_369", Br = "_grid_1kmqm_381", Yr = "_cropInteracting_1kmqm_410", Vr = "_sizeBadge_1kmqm_420", Gr = "_sizeBadgeActive_1kmqm_446", $r = "_sizeTimes_1kmqm_449", jr = "_sizeUnit_1kmqm_450", Wr = "_handle_1kmqm_460", Kr = "_handle_nw_1kmqm_464", Hr = "_handle_ne_1kmqm_465", Qr = "_handle_sw_1kmqm_466", Zr = "_handle_se_1kmqm_467", Jr = "_handle_n_1kmqm_464", ti = "_handle_s_1kmqm_466", ei = "_handle_w_1kmqm_530", ni = "_handle_e_1kmqm_531", ri = "_status_1kmqm_546", ii = "_toastError_1kmqm_557", oi = "_tabs_1kmqm_590", ai = "_tab_1kmqm_590", si = "_tabActive_1kmqm_625", ci = "_tabDot_1kmqm_636", li = "_resizePanel_1kmqm_647", hi = "_resizeFields_1kmqm_653", ui = "_dimField_1kmqm_659", di = "_dimLabel_1kmqm_677", mi = "_dimLabelShort_1kmqm_681", fi = "_dimInput_1kmqm_684", pi = "_dimUnit_1kmqm_700", gi = "_lockButton_1kmqm_705", _i = "_lockActive_1kmqm_722", wi = "_strip_1kmqm_734", vi = "_fadeStart_1kmqm_749", bi = "_fadeEnd_1kmqm_753", xi = "_stripGroup_1kmqm_773", Mi = "_filterTile_1kmqm_778", yi = "_filterThumb_1kmqm_792", Ei = "_filterActive_1kmqm_823", ki = "_filterLabel_1kmqm_833", Ti = "_fadeIn_1kmqm_838", Ii = "_toolbarIconOnPhone_1kmqm_880", Si = "_toolbarLabel_1kmqm_892", Ai = "_dimLabelFull_1kmqm_901", Ri = "_toolLabel_1kmqm_937", w = {
1123
1127
  overlay: sr,
1124
1128
  editor: cr,
1125
1129
  header: lr,
@@ -1131,22 +1135,23 @@ const sr = "_overlay_2796b_6", cr = "_editor_2796b_11", lr = "_header_2796b_61",
1131
1135
  done: pr,
1132
1136
  closeIcon: gr,
1133
1137
  groupDivider: _r,
1134
- main: br,
1135
- nav: wr,
1136
- stage: vr,
1137
- toolbar: xr,
1138
- canvasArea: Mr,
1139
- footer: yr,
1140
- footerInner: Er,
1138
+ zoomReadout: wr,
1139
+ main: vr,
1140
+ nav: br,
1141
+ stage: xr,
1142
+ toolbar: Mr,
1143
+ canvasArea: yr,
1144
+ footer: Er,
1145
+ footerInner: kr,
1141
1146
  navList: Tr,
1142
1147
  toolbarRow: Ir,
1143
- tool: Ar,
1144
- toolActive: Sr,
1145
- shapeSlot: Cr,
1146
- shapePreview: Rr,
1148
+ tool: Sr,
1149
+ toolActive: Ar,
1150
+ shapeSlot: Rr,
1151
+ shapePreview: Cr,
1147
1152
  shapeCustom: Lr,
1148
- shapeOrientation: kr,
1149
- orientButton: Nr,
1153
+ shapeOrientation: Nr,
1154
+ orientButton: qr,
1150
1155
  orientActive: Pr,
1151
1156
  viewport: zr,
1152
1157
  viewportCrop: Dr,
@@ -1157,104 +1162,104 @@ const sr = "_overlay_2796b_6", cr = "_editor_2796b_11", lr = "_header_2796b_61",
1157
1162
  grid: Br,
1158
1163
  cropInteracting: Yr,
1159
1164
  sizeBadge: Vr,
1160
- "tz-ie-fade": "_tz-ie-fade_2796b_1",
1161
- sizeBadgeActive: $r,
1162
- sizeTimes: Gr,
1165
+ "tz-ie-fade": "_tz-ie-fade_1kmqm_1",
1166
+ sizeBadgeActive: Gr,
1167
+ sizeTimes: $r,
1163
1168
  sizeUnit: jr,
1164
- handle: qr,
1165
- handle_nw: Wr,
1166
- handle_ne: Kr,
1167
- handle_sw: Hr,
1168
- handle_se: Qr,
1169
- handle_n: Zr,
1170
- handle_s: Jr,
1171
- handle_w: ti,
1172
- handle_e: ei,
1173
- status: ni,
1174
- toastError: ri,
1175
- tabs: ii,
1176
- tab: oi,
1177
- tabActive: ai,
1178
- tabDot: si,
1179
- resizePanel: ci,
1180
- resizeFields: li,
1181
- dimField: hi,
1182
- dimLabel: ui,
1183
- dimLabelShort: di,
1184
- dimInput: mi,
1185
- dimUnit: fi,
1186
- lockButton: pi,
1187
- lockActive: gi,
1188
- strip: _i,
1189
- fadeStart: bi,
1190
- fadeEnd: wi,
1191
- stripGroup: vi,
1192
- filterTile: xi,
1193
- filterThumb: Mi,
1194
- filterActive: yi,
1195
- filterLabel: Ei,
1169
+ handle: Wr,
1170
+ handle_nw: Kr,
1171
+ handle_ne: Hr,
1172
+ handle_sw: Qr,
1173
+ handle_se: Zr,
1174
+ handle_n: Jr,
1175
+ handle_s: ti,
1176
+ handle_w: ei,
1177
+ handle_e: ni,
1178
+ status: ri,
1179
+ toastError: ii,
1180
+ tabs: oi,
1181
+ tab: ai,
1182
+ tabActive: si,
1183
+ tabDot: ci,
1184
+ resizePanel: li,
1185
+ resizeFields: hi,
1186
+ dimField: ui,
1187
+ dimLabel: di,
1188
+ dimLabelShort: mi,
1189
+ dimInput: fi,
1190
+ dimUnit: pi,
1191
+ lockButton: gi,
1192
+ lockActive: _i,
1193
+ strip: wi,
1194
+ fadeStart: vi,
1195
+ fadeEnd: bi,
1196
+ stripGroup: xi,
1197
+ filterTile: Mi,
1198
+ filterThumb: yi,
1199
+ filterActive: Ei,
1200
+ filterLabel: ki,
1196
1201
  fadeIn: Ti,
1197
1202
  toolbarIconOnPhone: Ii,
1198
- toolbarLabel: Ai,
1199
- dimLabelFull: Si,
1200
- toolLabel: Ci
1201
- }, Ri = 24, Li = 12, Ge = 4096, ki = 768, je = 0.35;
1202
- function Ni(t) {
1203
+ toolbarLabel: Si,
1204
+ dimLabelFull: Ai,
1205
+ toolLabel: Ri
1206
+ }, Ci = 24, Li = 12, Ge = 4096, Ni = 320, qi = 768, $e = 0.35;
1207
+ function Pi(t) {
1203
1208
  const e = t ? getComputedStyle(t).getPropertyValue("--tz-color-background-rgb") : "", [n, i, o] = e.split(",").map((r) => Number(r.trim()) / 255);
1204
1209
  return [n, i, o].every((r) => Number.isFinite(r)) ? [n, i, o] : [0, 0, 0];
1205
1210
  }
1206
- const Pi = 40, zi = ["nw", "ne", "sw", "se", "n", "s", "w", "e"], Ot = (t) => [t.center[0], t.center[1], Math.log(t.scale), t.rotation, t.flip], Di = (t) => ({
1211
+ const zi = 40, Di = ["nw", "ne", "sw", "se", "n", "s", "w", "e"], Xt = (t) => [t.center[0], t.center[1], Math.log(t.scale), t.rotation, t.flip], Ui = (t) => ({
1207
1212
  center: [t[0], t[1]],
1208
1213
  scale: Math.exp(t[2]),
1209
1214
  rotation: t[3],
1210
1215
  flip: t[4]
1211
- }), Ui = Ke(function({ core: e, snapshot: n, cropAspectRatio: i, viewZoom: o, onViewZoom: r, onZoomReport: a, areaRef: s }, _) {
1212
- const { state: c, size: M, ui: d } = n, T = wn(), f = d.util, A = O(null), S = O(null), [y, x] = Q(null), [l, C] = Q(null), u = O(null);
1216
+ }), Fi = Ke(function({ core: e, snapshot: n, cropAspectRatio: i, viewZoom: o, onViewZoom: r, onZoomReport: a, areaRef: s }, _) {
1217
+ const { state: c, size: M, ui: m } = n, k = vn(), f = m.util, I = F(null), S = F(null), [y, x] = Q(null), [l, A] = Q(null), u = F(null);
1213
1218
  u.current = l;
1214
- const [R, m] = Q([0, 0]), [E, v] = Q(!1), [N, j] = Q(0), G = O(!1), W = O(null), V = O(null), ct = O(null), Z = O(/* @__PURE__ */ new Map()), dt = O(void 0);
1215
- q(() => {
1216
- const g = A.current;
1219
+ const [R, d] = Q([0, 0]), [E, b] = Q(!1), [N, $] = Q(0), G = F(!1), K = F(null), Y = F(null), ct = F(null), Z = F(/* @__PURE__ */ new Map()), dt = F(void 0);
1220
+ j(() => {
1221
+ const g = I.current;
1217
1222
  if (!g) return;
1218
1223
  const p = () => {
1219
- var F;
1220
- const D = g.getBoundingClientRect(), Y = (F = s == null ? void 0 : s.current) == null ? void 0 : F.getBoundingClientRect();
1224
+ var U;
1225
+ const z = g.getBoundingClientRect(), B = (U = s == null ? void 0 : s.current) == null ? void 0 : U.getBoundingClientRect();
1221
1226
  x({
1222
- width: D.width,
1223
- height: D.height,
1227
+ width: z.width,
1228
+ height: z.height,
1224
1229
  dpr: window.devicePixelRatio || 1,
1225
1230
  // horizontally the area is mirrored to the wider side, so the crop sits in the middle of the
1226
1231
  // screen (not of the space right of the tool menu); vertically it's the space between the bars
1227
- area: Y ? Fi(D, Y) : void 0
1232
+ area: B ? Oi(z, B) : void 0
1228
1233
  });
1229
1234
  };
1230
- if (p(), k.current = p, typeof ResizeObserver > "u") return;
1235
+ if (p(), L.current = p, typeof ResizeObserver > "u") return;
1231
1236
  const P = new ResizeObserver(p);
1232
1237
  return P.observe(g), s != null && s.current && P.observe(s.current), () => P.disconnect();
1233
1238
  }, [s]);
1234
- const k = O(null);
1235
- ue(() => {
1239
+ const L = F(null);
1240
+ de(() => {
1236
1241
  var g;
1237
- (g = k.current) == null || g.call(k);
1242
+ (g = L.current) == null || g.call(L);
1238
1243
  }, [f, n.status]);
1239
- const z = n.status === "ready" ? e.image : null, [L, $] = Q(null);
1240
- q(() => {
1244
+ const q = n.status === "ready" ? e.image : null, [C, V] = Q(null);
1245
+ j(() => {
1241
1246
  const g = S.current;
1242
- if (!z || !g) return;
1243
- const p = se.create(g), P = Math.min(Ge, (p == null ? void 0 : p.maxTextureSize) ?? Ge), D = te(z.image, z.width, z.height, P), Y = ke * Math.max(z.width, z.height) * (D.width / z.width), F = rn(D.canvas, D.width, D.height, Y);
1244
- return p == null || p.setImage(D.canvas, F), $({ gl: p, tex: D, blur: F }), () => {
1245
- p == null || p.dispose(!1), $(null);
1247
+ if (!q || !g) return;
1248
+ const p = le.create(g), P = Math.min(Ge, (p == null ? void 0 : p.maxTextureSize) ?? Ge), z = ne(q.image, q.width, q.height, P), B = Ne * Math.max(q.width, q.height) * (z.width / q.width), U = rn(z.canvas, z.width, z.height, B);
1249
+ return p == null || p.setImage(z.canvas, U), V({ gl: p, tex: z, blur: U }), () => {
1250
+ p == null || p.dispose(!1), V(null);
1246
1251
  };
1247
- }, [z]);
1248
- const H = c && M ? Rt(c).width * c.scale / Xt(c).width : 1, mt = M ? Math.max(1, Math.round(M.width * H)) : 0, lt = (c == null ? void 0 : c.redact.effect) ?? "blur", xt = (c == null ? void 0 : c.redact.amount) ?? 0, [J, rt] = Q(null);
1249
- q(() => {
1250
- if (!L || !M) {
1252
+ }, [q]);
1253
+ const H = c && M ? Lt(c).width * c.scale / Yt(c).width : 1, mt = M ? Math.max(1, Math.round(M.width * H)) : 0, lt = (c == null ? void 0 : c.redact.effect) ?? "blur", xt = (c == null ? void 0 : c.redact.amount) ?? 0, [J, rt] = Q(null);
1254
+ j(() => {
1255
+ if (!C || !M) {
1251
1256
  rt(null);
1252
1257
  return;
1253
1258
  }
1254
1259
  const g = requestAnimationFrame(() => {
1255
- let p = { ...L.tex, mipmap: !0, pixelate: !1 };
1260
+ let p = { ...C.tex, mipmap: !0, pixelate: !1 };
1256
1261
  mt < p.width && (p = {
1257
- ...te(
1262
+ ...ne(
1258
1263
  p.canvas,
1259
1264
  p.width,
1260
1265
  p.height,
@@ -1265,166 +1270,169 @@ const Pi = 40, zi = ["nw", "ne", "sw", "se", "n", "s", "w", "e"], Ot = (t) => [t
1265
1270
  });
1266
1271
  const P = Te({ redact: { effect: lt, amount: xt } }, M);
1267
1272
  if (P <= 0) return rt(p);
1268
- const D = P * (p.width / M.width);
1273
+ const z = P * (p.width / M.width);
1269
1274
  if (lt === "blur") {
1270
- const F = sn(p.canvas, p.width, p.height, D, ki);
1275
+ const U = sn(p.canvas, p.width, p.height, z, qi);
1271
1276
  return rt({
1272
- canvas: F,
1273
- width: F.width,
1274
- height: F.height,
1277
+ canvas: U,
1278
+ width: U.width,
1279
+ height: U.height,
1275
1280
  mipmap: !0,
1276
1281
  pixelate: !1
1277
1282
  });
1278
1283
  }
1279
- if (!L.gl) {
1280
- const F = qn(p.canvas, p.width, p.height, D);
1284
+ if (!C.gl) {
1285
+ const U = jn(p.canvas, p.width, p.height, z);
1281
1286
  return rt({
1282
- canvas: F,
1283
- width: F.width,
1284
- height: F.height,
1287
+ canvas: U,
1288
+ width: U.width,
1289
+ height: U.height,
1285
1290
  mipmap: !1,
1286
1291
  pixelate: !1
1287
1292
  });
1288
1293
  }
1289
- const Y = te(
1294
+ const B = ne(
1290
1295
  p.canvas,
1291
1296
  p.width,
1292
1297
  p.height,
1293
- Math.max(p.width, p.height) / Math.max(1, D)
1298
+ Math.max(p.width, p.height) / Math.max(1, z)
1294
1299
  );
1295
- rt({ ...Y, mipmap: !1, pixelate: !0 });
1300
+ rt({ ...B, mipmap: !1, pixelate: !0 });
1296
1301
  });
1297
1302
  return () => cancelAnimationFrame(g);
1298
- }, [L, mt, lt, xt]), ue(() => {
1299
- L != null && L.gl && J && L.gl.setSource(J.canvas, J.mipmap);
1300
- }, [L, J]);
1303
+ }, [C, mt, lt, xt]), de(() => {
1304
+ C != null && C.gl && J && C.gl.setSource(J.canvas, J.mipmap);
1305
+ }, [C, J]);
1301
1306
  const tt = mn(() => {
1302
1307
  if (!c || !y) return null;
1303
1308
  const g = y.area ?? y;
1304
- if (f === "crop") return Ve(c.crop, g, Math.min(Ri, g.width * 0.06));
1305
- const p = Xt(c), P = Ve(p, g, Li), D = c.resize ? { ...P, scale: Math.min(P.scale, Rt(c).width / p.width) } : P;
1306
- if (o == null) return D;
1307
- const Y = o / c.scale, F = Math.max(0, p.width / 2 - g.width / 2 / Y), it = Math.max(0, p.height / 2 - g.height / 2 / Y), ht = Math.max(-F, Math.min(F, R[0])), yt = Math.max(-it, Math.min(it, R[1]));
1308
- return { ...D, scale: Y, center: [D.center[0] + ht, D.center[1] + yt] };
1309
- }, [c, y, f, o, R, N]), qt = O(f), It = O(!1), Mt = O({
1309
+ if (f === "crop") {
1310
+ const Dt = Ye(c.crop, g, Math.min(Ci, g.width * 0.06)), Et = M ? Bt(c, M) / c.scale : 1 / c.scale, Ut = Ni / Math.max(c.crop.width, c.crop.height);
1311
+ return { ...Dt, scale: Math.min(Dt.scale, Math.max(Et, Ut)) };
1312
+ }
1313
+ const p = Yt(c), P = Ye(p, g, Li), z = { ...P, scale: Math.min(P.scale, Lt(c).width / p.width) };
1314
+ if (o == null) return z;
1315
+ const B = o / c.scale, U = Math.max(0, p.width / 2 - g.width / 2 / B), it = Math.max(0, p.height / 2 - g.height / 2 / B), ht = Math.max(-U, Math.min(U, R[0])), yt = Math.max(-it, Math.min(it, R[1]));
1316
+ return { ...z, scale: B, center: [z.center[0] + ht, z.center[1] + yt] };
1317
+ }, [c, y, f, o, R, N]), Ht = F(f), It = F(!1), Mt = F({
1310
1318
  stage: y,
1311
1319
  state: c
1312
- }), Nt = (g, p) => {
1320
+ }), Pt = (g, p) => {
1313
1321
  var P;
1314
- (P = V.current) == null || P.call(V), It.current = !0, V.current = $e(
1315
- Ot(g),
1316
- Ot(p),
1317
- (D) => C(Di(D)),
1322
+ (P = Y.current) == null || P.call(Y), It.current = !0, Y.current = Ve(
1323
+ Xt(g),
1324
+ Xt(p),
1325
+ (z) => A(Ui(z)),
1318
1326
  void 0,
1319
1327
  () => {
1320
1328
  It.current = !1;
1321
1329
  }
1322
1330
  );
1323
- }, [ft, ce] = Q(f === "crop" ? je : 0), Wt = O(ft);
1324
- Wt.current = ft, q(() => {
1325
- const g = f === "crop" ? je : 0;
1326
- return $e([Wt.current], [g], ([p]) => ce(Math.max(0, p)));
1327
- }, [f]), ue(() => {
1328
- var it, ht, yt, De;
1331
+ }, [ft, he] = Q(f === "crop" ? $e : 0), Qt = F(ft);
1332
+ Qt.current = ft, j(() => {
1333
+ const g = f === "crop" ? $e : 0;
1334
+ return Ve([Qt.current], [g], ([p]) => he(Math.max(0, p)));
1335
+ }, [f]), de(() => {
1336
+ var it, ht, yt, Dt;
1329
1337
  if (!tt) return;
1330
- qt.current !== f && (qt.current = f, u.current && !W.current && (W.current = "jump"));
1331
- const g = y !== Mt.current.stage && c === Mt.current.state, p = (it = Mt.current.state) == null ? void 0 : it.resize, P = f === "resize" && (((ht = c == null ? void 0 : c.resize) == null ? void 0 : ht.width) !== (p == null ? void 0 : p.width) || ((yt = c == null ? void 0 : c.resize) == null ? void 0 : yt.height) !== (p == null ? void 0 : p.height)), D = Mt.current.target, Y = !!D && Ot(D).every((Dt, le) => Math.abs(Dt - Ot(tt)[le]) < 1e-9);
1338
+ Ht.current !== f && (Ht.current = f, u.current && !K.current && (K.current = "jump"));
1339
+ const g = y !== Mt.current.stage && c === Mt.current.state, p = (it = Mt.current.state) == null ? void 0 : it.resize, P = f === "resize" && (((ht = c == null ? void 0 : c.resize) == null ? void 0 : ht.width) !== (p == null ? void 0 : p.width) || ((yt = c == null ? void 0 : c.resize) == null ? void 0 : yt.height) !== (p == null ? void 0 : p.height)), z = Mt.current.target, B = !!z && Xt(z).every((Et, Ut) => Math.abs(Et - Xt(tt)[Ut]) < 1e-9);
1332
1340
  Mt.current = { stage: y, state: c, target: tt };
1333
- const F = W.current;
1334
- if (F) {
1335
- W.current = null;
1336
- const Dt = u.current ?? tt, le = F === "rotate" ? { center: tt.center, scale: Dt.scale, rotation: Math.PI / 2, flip: 1 } : F === "flip" ? { center: tt.center, scale: Dt.scale, rotation: 0, flip: -1 } : Dt;
1337
- Nt(le, tt);
1341
+ const U = K.current;
1342
+ if (U) {
1343
+ K.current = null;
1344
+ const Et = u.current ?? tt, Ut = U === "rotate" ? { center: tt.center, scale: Et.scale, rotation: Math.PI / 2, flip: 1 } : U === "flip" ? { center: tt.center, scale: Et.scale, rotation: 0, flip: -1 } : Et;
1345
+ Pt(Ut, tt);
1338
1346
  return;
1339
1347
  }
1340
- if ((g || P || Y) && It.current && V.current) {
1341
- V.current.retarget(Ot(tt));
1348
+ if ((g || P || B) && It.current && Y.current) {
1349
+ Y.current.retarget(Xt(tt));
1342
1350
  return;
1343
1351
  }
1344
1352
  if (P && u.current && !G.current) {
1345
- Nt(u.current, tt);
1353
+ Pt(u.current, tt);
1346
1354
  return;
1347
1355
  }
1348
- G.current || ((De = V.current) == null || De.call(V), V.current = null, It.current = !1, C(tt));
1349
- }, [tt]), q(() => () => {
1356
+ G.current || ((Dt = Y.current) == null || Dt.call(Y), Y.current = null, It.current = !1, A(tt));
1357
+ }, [tt]), j(() => () => {
1350
1358
  var g;
1351
- return (g = V.current) == null ? void 0 : g.call(V);
1352
- }, []), q(() => {
1359
+ return (g = Y.current) == null ? void 0 : g.call(Y);
1360
+ }, []), j(() => {
1353
1361
  l && c && a(l.scale * c.scale);
1354
- }, [l, c, a]), q(() => {
1362
+ }, [l, c, a]), j(() => {
1355
1363
  const g = S.current;
1356
1364
  if (!g || !y) return;
1357
1365
  const p = Math.max(1, Math.round(y.width * y.dpr)), P = Math.max(1, Math.round(y.height * y.dpr));
1358
1366
  g.width !== p && (g.width = p), g.height !== P && (g.height = P);
1359
- }, [y]), q(() => {
1360
- if (!L || !J || !c || !M || !l || !y) return;
1361
- const g = f === "crop" ? c : { ...c, crop: Xt(c) }, p = Kn(g, M, l, y), P = J.pixelate ? Te(c, M) : 0, D = P > 0 ? {
1362
- pixel: ((F) => [F.cols, F.rows])(
1367
+ }, [y]), j(() => {
1368
+ if (!C || !J || !c || !M || !l || !y) return;
1369
+ const g = f === "crop" ? c : { ...c, crop: Yt(c) }, p = Kn(g, M, l, y), P = J.pixelate ? Te(c, M) : 0, z = P > 0 ? {
1370
+ pixel: ((U) => [U.cols, U.rows])(
1363
1371
  an(g.crop, P * c.scale)
1364
1372
  ),
1365
- cropToUV: at(Lt(p.toCrop), p.toUV)
1366
- } : null, Y = requestAnimationFrame(() => {
1367
- const F = {
1373
+ cropToUV: at(Nt(p.toCrop), p.toUV)
1374
+ } : null, B = requestAnimationFrame(() => {
1375
+ const U = {
1368
1376
  ...Pe(c),
1369
1377
  ...p,
1370
- ...D,
1378
+ ...z,
1371
1379
  // the image around the crop: dimmed in the Crop view, gone (faded into the background) in the
1372
1380
  // others — `surround` springs between the two on a tool switch
1373
1381
  clip: ft <= 1e-3,
1374
1382
  dim: ft,
1375
- dimColor: Ni(A.current)
1383
+ dimColor: Pi(I.current)
1376
1384
  };
1377
- L.gl ? L.gl.render(F) : S.current && Zn(S.current, J.canvas, J, L.blur, L.blur, F);
1385
+ C.gl ? C.gl.render(U) : S.current && Zn(S.current, J.canvas, J, C.blur, C.blur, U);
1378
1386
  });
1379
- return () => cancelAnimationFrame(Y);
1380
- }, [L, J, c, M, l, y, ft, T, f]), fn(_, () => ({
1387
+ return () => cancelAnimationFrame(B);
1388
+ }, [C, J, c, M, l, y, ft, k, f]), fn(_, () => ({
1381
1389
  transition(g) {
1382
- W.current = g;
1390
+ K.current = g;
1383
1391
  }
1384
1392
  }));
1385
- const pt = (l == null ? void 0 : l.scale) ?? 1, Kt = O(r);
1386
- Kt.current = r;
1387
- const Pt = () => {
1393
+ const pt = (l == null ? void 0 : l.scale) ?? 1, Zt = F(r);
1394
+ Zt.current = r;
1395
+ const zt = () => {
1388
1396
  const [g, p] = [...Z.current.values()];
1389
1397
  return g && p ? Math.hypot(g.x - p.x, g.y - p.y) : 0;
1390
1398
  }, gt = (g) => {
1391
- var P, D;
1399
+ var P, z;
1392
1400
  if (!c || !M || g.pointerType === "mouse" && g.button !== 0 || g.target.closest("button")) return;
1393
- if (g.currentTarget.setPointerCapture(g.pointerId), Z.current.set(g.pointerId, { x: g.clientX, y: g.clientY }), (P = V.current) == null || P.call(V), Z.current.size === 2) {
1401
+ if (g.currentTarget.setPointerCapture(g.pointerId), Z.current.set(g.pointerId, { x: g.clientX, y: g.clientY }), (P = Y.current) == null || P.call(Y), Z.current.size === 2) {
1394
1402
  ct.current = {
1395
1403
  kind: "pinch",
1396
- dist: Pt(),
1404
+ dist: zt(),
1397
1405
  base: c,
1398
- zoom: Jt(c, M),
1406
+ zoom: Bt(c, M),
1399
1407
  viewZoom: ((l == null ? void 0 : l.scale) ?? 1) * c.scale
1400
1408
  };
1401
1409
  return;
1402
1410
  }
1403
- const p = (D = g.target.closest("[data-handle]")) == null ? void 0 : D.dataset.handle;
1404
- f === "crop" ? (ct.current = p ? { kind: "resize", id: g.pointerId, x: g.clientX, y: g.clientY, base: c, handle: p } : { kind: "pan", id: g.pointerId, x: g.clientX, y: g.clientY, base: c }, p && (G.current = !0), v(!0)) : o != null && (ct.current = { kind: "viewPan", id: g.pointerId, x: g.clientX, y: g.clientY, pan: R });
1405
- }, zt = (g) => {
1411
+ const p = (z = g.target.closest("[data-handle]")) == null ? void 0 : z.dataset.handle;
1412
+ f === "crop" ? (ct.current = p ? { kind: "resize", id: g.pointerId, x: g.clientX, y: g.clientY, base: c, handle: p } : { kind: "pan", id: g.pointerId, x: g.clientX, y: g.clientY, base: c }, p && (G.current = !0), b(!0)) : o != null && (ct.current = { kind: "viewPan", id: g.pointerId, x: g.clientX, y: g.clientY, pan: R });
1413
+ }, St = (g) => {
1406
1414
  if (!Z.current.has(g.pointerId) || !M) return;
1407
1415
  Z.current.set(g.pointerId, { x: g.clientX, y: g.clientY });
1408
1416
  const p = ct.current;
1409
1417
  if (!p) return;
1410
1418
  if (p.kind === "pinch") {
1411
- const Y = Pt() / Math.max(1, p.dist);
1412
- f === "crop" ? e.preview(Yt(p.base, Math.min(Bt, p.zoom * Y), M)) : r(be(p.viewZoom * Y));
1419
+ const B = zt() / Math.max(1, p.dist);
1420
+ f === "crop" ? e.preview(Gt(p.base, Math.min(Vt, p.zoom * B), M)) : r(ve(p.viewZoom * B));
1413
1421
  return;
1414
1422
  }
1415
1423
  if (p.id !== g.pointerId) return;
1416
- const P = (g.clientX - p.x) / pt, D = (g.clientY - p.y) / pt;
1417
- if (p.kind === "pan") e.preview(Pn(p.base, -P, -D, M));
1424
+ const P = (g.clientX - p.x) / pt, z = (g.clientY - p.y) / pt;
1425
+ if (p.kind === "pan") e.preview(qn(p.base, -P, -z, M));
1418
1426
  else if (p.kind === "resize") {
1419
- const Y = p.base.crop, it = i || p.base.cropRatio || g.shiftKey ? Y.width / Y.height : null;
1427
+ const B = p.base.crop, it = i || p.base.cropRatio || g.shiftKey ? B.width / B.height : null;
1420
1428
  e.preview(
1421
- Dn(p.base, p.handle, P, D, M, {
1429
+ zn(p.base, p.handle, P, z, M, {
1422
1430
  aspectRatio: it,
1423
- minSize: Math.max(p.base.scale, Pi / pt)
1431
+ minSize: Math.max(p.base.scale, zi / pt)
1424
1432
  })
1425
1433
  );
1426
- } else p.kind === "viewPan" && m([p.pan[0] - P, p.pan[1] - D]);
1427
- }, Ht = (g) => {
1434
+ } else p.kind === "viewPan" && d([p.pan[0] - P, p.pan[1] - z]);
1435
+ }, Jt = (g) => {
1428
1436
  if (!Z.current.has(g.pointerId)) return;
1429
1437
  Z.current.delete(g.pointerId);
1430
1438
  const p = ct.current;
@@ -1433,85 +1441,85 @@ const Pi = 40, zi = ["nw", "ne", "sw", "se", "n", "s", "w", "e"], Ot = (t) => [t
1433
1441
  Z.current.size === 0 && (ct.current = null, f === "crop" && e.commit());
1434
1442
  return;
1435
1443
  }
1436
- p.id === g.pointerId && (ct.current = null, v(!1), p.kind === "resize" ? (G.current = !1, W.current = "jump", e.commit(), j((P) => P + 1)) : p.kind === "pan" && e.commit());
1444
+ p.id === g.pointerId && (ct.current = null, b(!1), p.kind === "resize" ? (G.current = !1, K.current = "jump", e.commit(), $((P) => P + 1)) : p.kind === "pan" && e.commit());
1437
1445
  }
1438
1446
  }, h = (g) => {
1439
1447
  if (!c || !M) return;
1440
1448
  const p = g.ctrlKey || g.metaKey;
1441
- if (!(p && I.current)) {
1449
+ if (!(p && T.current)) {
1442
1450
  if (f === "crop") {
1443
1451
  const P = Math.exp(-g.deltaY * (p ? 0.01 : 2e-3));
1444
- e.preview(Yt(c, Math.min(Bt, Jt(c, M) * P), M)), clearTimeout(dt.current), dt.current = setTimeout(() => e.commit(), 250);
1452
+ e.preview(Gt(c, Math.min(Vt, Bt(c, M) * P), M)), clearTimeout(dt.current), dt.current = setTimeout(() => e.commit(), 250);
1445
1453
  return;
1446
1454
  }
1447
1455
  if (p) {
1448
1456
  const P = ((l == null ? void 0 : l.scale) ?? 1) * c.scale;
1449
- r(be(P * Math.exp(-g.deltaY * 0.01)));
1450
- } else o != null && m(([P, D]) => [P + g.deltaX / pt, D + g.deltaY / pt]);
1457
+ r(ve(P * Math.exp(-g.deltaY * 0.01)));
1458
+ } else o != null && d(([P, z]) => [P + g.deltaX / pt, z + g.deltaY / pt]);
1451
1459
  }
1452
1460
  };
1453
- q(() => () => clearTimeout(dt.current), []);
1454
- const I = O(null), U = O({ state: c, size: M, util: f, view: l });
1455
- U.current = { state: c, size: M, util: f, view: l }, q(() => {
1456
- const g = A.current;
1461
+ j(() => () => clearTimeout(dt.current), []);
1462
+ const T = F(null), D = F({ state: c, size: M, util: f, view: l });
1463
+ D.current = { state: c, size: M, util: f, view: l }, j(() => {
1464
+ const g = I.current;
1457
1465
  if (!g) return;
1458
- const p = (Y) => {
1459
- const { state: F, size: it, view: ht } = U.current;
1460
- Y.preventDefault(), !(!F || !it || Z.current.size > 0) && (I.current = { base: F, zoom: Jt(F, it), viewZoom: ((ht == null ? void 0 : ht.scale) ?? 1) * F.scale });
1461
- }, P = (Y) => {
1462
- const F = I.current, { size: it, util: ht } = U.current;
1463
- if (!F || !it) return;
1464
- Y.preventDefault();
1465
- const yt = Y.scale || 1;
1466
- ht === "crop" ? e.preview(Yt(F.base, Math.min(Bt, F.zoom * yt), it)) : Kt.current(be(F.viewZoom * yt));
1467
- }, D = (Y) => {
1468
- I.current && (Y.preventDefault(), I.current = null, U.current.util === "crop" && e.commit());
1466
+ const p = (B) => {
1467
+ const { state: U, size: it, view: ht } = D.current;
1468
+ B.preventDefault(), !(!U || !it || Z.current.size > 0) && (T.current = { base: U, zoom: Bt(U, it), viewZoom: ((ht == null ? void 0 : ht.scale) ?? 1) * U.scale });
1469
+ }, P = (B) => {
1470
+ const U = T.current, { size: it, util: ht } = D.current;
1471
+ if (!U || !it) return;
1472
+ B.preventDefault();
1473
+ const yt = B.scale || 1;
1474
+ ht === "crop" ? e.preview(Gt(U.base, Math.min(Vt, U.zoom * yt), it)) : Zt.current(ve(U.viewZoom * yt));
1475
+ }, z = (B) => {
1476
+ T.current && (B.preventDefault(), T.current = null, D.current.util === "crop" && e.commit());
1469
1477
  };
1470
- return g.addEventListener("gesturestart", p), g.addEventListener("gesturechange", P), g.addEventListener("gestureend", D), () => {
1471
- g.removeEventListener("gesturestart", p), g.removeEventListener("gesturechange", P), g.removeEventListener("gestureend", D);
1478
+ return g.addEventListener("gesturestart", p), g.addEventListener("gesturechange", P), g.addEventListener("gestureend", z), () => {
1479
+ g.removeEventListener("gesturestart", p), g.removeEventListener("gesturechange", P), g.removeEventListener("gestureend", z);
1472
1480
  };
1473
1481
  }, [e]);
1474
- let X = null;
1482
+ let O = null;
1475
1483
  if (f === "crop" && c && y && l) {
1476
- const g = hn({ ...l, rotation: 0, flip: 1 }, y), [p, P] = ne(g, c.crop.x, c.crop.y), [D, Y] = ne(
1484
+ const g = hn({ ...l, rotation: 0, flip: 1 }, y), [p, P] = ie(g, c.crop.x, c.crop.y), [z, B] = ie(
1477
1485
  g,
1478
1486
  c.crop.x + c.crop.width,
1479
1487
  c.crop.y + c.crop.height
1480
1488
  );
1481
- X = { left: p, top: P, width: D - p, height: Y - P };
1489
+ O = { left: p, top: P, width: z - p, height: B - P };
1482
1490
  }
1483
1491
  const At = l && y ? {
1484
1492
  transform: `scaleX(${l.flip}) rotate(${l.rotation}rad)`,
1485
1493
  transformOrigin: ln(y).map((g) => `${g}px`).join(" ")
1486
1494
  } : void 0;
1487
- return /* @__PURE__ */ B(
1495
+ return /* @__PURE__ */ X(
1488
1496
  "div",
1489
1497
  {
1490
- ref: A,
1491
- className: K(
1492
- b.viewport,
1493
- f === "crop" ? b.viewportCrop : o != null && b.viewportPannable
1498
+ ref: I,
1499
+ className: W(
1500
+ w.viewport,
1501
+ f === "crop" ? w.viewportCrop : o != null && w.viewportPannable
1494
1502
  ),
1495
1503
  "data-part": "viewport",
1496
1504
  onPointerDown: gt,
1497
- onPointerMove: zt,
1498
- onPointerUp: Ht,
1499
- onPointerCancel: Ht,
1505
+ onPointerMove: St,
1506
+ onPointerUp: Jt,
1507
+ onPointerCancel: Jt,
1500
1508
  onWheel: h,
1501
1509
  children: [
1502
- /* @__PURE__ */ w("canvas", { ref: S, className: b.canvas, "data-part": "canvas" }),
1503
- X && /* @__PURE__ */ w("div", { className: K(b.scene, b.fadeIn), style: At, children: /* @__PURE__ */ B(
1510
+ /* @__PURE__ */ v("canvas", { ref: S, className: w.canvas, "data-part": "canvas" }),
1511
+ O && /* @__PURE__ */ v("div", { className: W(w.scene, w.fadeIn), style: At, children: /* @__PURE__ */ X(
1504
1512
  "div",
1505
1513
  {
1506
- className: K(b.cropBox, E && b.cropInteracting),
1507
- style: X,
1514
+ className: W(w.cropBox, E && w.cropInteracting),
1515
+ style: O,
1508
1516
  "data-part": "crop",
1509
1517
  children: [
1510
- /* @__PURE__ */ w("span", { className: b.grid, "aria-hidden": "true" }),
1511
- zi.map((g) => /* @__PURE__ */ w(
1518
+ /* @__PURE__ */ v("span", { className: w.grid, "aria-hidden": "true" }),
1519
+ Di.map((g) => /* @__PURE__ */ v(
1512
1520
  "span",
1513
1521
  {
1514
- className: K(b.handle, b[`handle_${g}`]),
1522
+ className: W(w.handle, w[`handle_${g}`]),
1515
1523
  "data-handle": g,
1516
1524
  "aria-hidden": "true"
1517
1525
  },
@@ -1520,20 +1528,20 @@ const Pi = 40, zi = ["nw", "ne", "sw", "se", "n", "s", "w", "e"], Ot = (t) => [t
1520
1528
  ]
1521
1529
  }
1522
1530
  ) }),
1523
- X && c && l && l.rotation === 0 && l.flip === 1 && /* @__PURE__ */ B(
1531
+ O && c && l && l.rotation === 0 && l.flip === 1 && /* @__PURE__ */ X(
1524
1532
  "div",
1525
1533
  {
1526
- className: K(b.sizeBadge, E && b.sizeBadgeActive),
1534
+ className: W(w.sizeBadge, E && w.sizeBadgeActive),
1527
1535
  style: {
1528
- left: X.left + X.width / 2,
1529
- top: X.top + X.height
1536
+ left: O.left + O.width / 2,
1537
+ top: O.top + O.height
1530
1538
  },
1531
1539
  "data-part": "size",
1532
1540
  children: [
1533
- Rt(c).width,
1534
- /* @__PURE__ */ w("span", { className: b.sizeTimes, children: "×" }),
1535
- Rt(c).height,
1536
- /* @__PURE__ */ w("span", { className: b.sizeUnit, children: "px" })
1541
+ Lt(c).width,
1542
+ /* @__PURE__ */ v("span", { className: w.sizeTimes, children: "×" }),
1543
+ Lt(c).height,
1544
+ /* @__PURE__ */ v("span", { className: w.sizeUnit, children: "px" })
1537
1545
  ]
1538
1546
  }
1539
1547
  )
@@ -1541,7 +1549,7 @@ const Pi = 40, zi = ["nw", "ne", "sw", "se", "n", "s", "w", "e"], Ot = (t) => [t
1541
1549
  }
1542
1550
  );
1543
1551
  });
1544
- function Fi(t, e) {
1552
+ function Oi(t, e) {
1545
1553
  const n = Math.max(0, e.left - t.left, t.right - e.right);
1546
1554
  return {
1547
1555
  x: n,
@@ -1550,7 +1558,7 @@ function Fi(t, e) {
1550
1558
  height: e.height
1551
1559
  };
1552
1560
  }
1553
- const Ie = 0.02, Ae = 8, be = (t) => Math.min(Ae, Math.max(Ie, t)), Oi = [
1561
+ const Ie = 0.02, Se = 8, ve = (t) => Math.min(Se, Math.max(Ie, t)), Xi = [
1554
1562
  { label: "1:1", ratio: 1 },
1555
1563
  { label: "2:1", ratio: 2 },
1556
1564
  { label: "3:2", ratio: 3 / 2 },
@@ -1558,129 +1566,129 @@ const Ie = 0.02, Ae = 8, be = (t) => Math.min(Ae, Math.max(Ie, t)), Oi = [
1558
1566
  { label: "5:4", ratio: 5 / 4 },
1559
1567
  { label: "16:10", ratio: 16 / 10 },
1560
1568
  { label: "16:9", ratio: 16 / 9 }
1561
- ], Qt = (t, e) => Math.abs(t - e) < 1e-3, Xi = (t) => t.split(":").reverse().join(":");
1562
- function qe({ ratio: t }) {
1569
+ ], te = (t, e) => Math.abs(t - e) < 1e-3, Bi = (t) => t.split(":").reverse().join(":");
1570
+ function je({ ratio: t }) {
1563
1571
  const n = t == null || t >= 1 ? 16 : Math.max(6, 16 * t), i = t == null || t <= 1 ? 16 : Math.max(6, 16 / t);
1564
- return /* @__PURE__ */ w("span", { className: b.shapeSlot, children: /* @__PURE__ */ w(
1572
+ return /* @__PURE__ */ v("span", { className: w.shapeSlot, children: /* @__PURE__ */ v(
1565
1573
  "span",
1566
1574
  {
1567
- className: K(b.shapePreview, t == null && b.shapeCustom),
1575
+ className: W(w.shapePreview, t == null && w.shapeCustom),
1568
1576
  style: { width: n, height: i }
1569
1577
  }
1570
1578
  ) });
1571
1579
  }
1572
- function Bi({ ratio: t, options: e, onChange: n }) {
1573
- const i = re(), [o, r] = Q(!1), [a, s] = Q(!1), _ = t != null && !Qt(t, 1) ? t < 1 : a, c = (d) => {
1574
- n(d), r(!1);
1575
- }, M = (d) => {
1576
- s(d), t != null && !Qt(t, 1) && t < 1 !== d && n(1 / t);
1580
+ function Yi({ ratio: t, options: e, onChange: n }) {
1581
+ const i = oe(), [o, r] = Q(!1), [a, s] = Q(!1), _ = t != null && !te(t, 1) ? t < 1 : a, c = (m) => {
1582
+ n(m), r(!1);
1583
+ }, M = (m) => {
1584
+ s(m), t != null && !te(t, 1) && t < 1 !== m && n(1 / t);
1577
1585
  };
1578
- return /* @__PURE__ */ B(
1579
- vn,
1586
+ return /* @__PURE__ */ X(
1587
+ bn,
1580
1588
  {
1581
1589
  open: o,
1582
1590
  onOpenChange: r,
1583
1591
  closeOnSelect: !1,
1584
1592
  placement: "bottom-start",
1585
1593
  size: "sm",
1586
- trigger: /* @__PURE__ */ w(
1587
- Me,
1594
+ trigger: /* @__PURE__ */ v(
1595
+ ye,
1588
1596
  {
1589
1597
  variant: "text",
1590
1598
  color: "primary",
1591
1599
  size: "sm",
1592
- startIcon: /* @__PURE__ */ w(et, { name: "MaximizeFormat" }),
1600
+ startIcon: /* @__PURE__ */ v(et, { name: "MaximizeFormat" }),
1593
1601
  title: i("imageEditor.cropShape"),
1594
1602
  "aria-label": i("imageEditor.cropShape"),
1595
- className: b.toolbarIconOnPhone,
1596
- children: /* @__PURE__ */ w("span", { className: b.toolbarLabel, children: i("imageEditor.cropShape") })
1603
+ className: w.toolbarIconOnPhone,
1604
+ children: /* @__PURE__ */ v("span", { className: w.toolbarLabel, children: i("imageEditor.cropShape") })
1597
1605
  }
1598
1606
  ),
1599
1607
  children: [
1600
- /* @__PURE__ */ w(
1608
+ /* @__PURE__ */ v(
1601
1609
  "div",
1602
1610
  {
1603
- className: b.shapeOrientation,
1611
+ className: w.shapeOrientation,
1604
1612
  role: "group",
1605
1613
  "aria-label": i("imageEditor.orientation"),
1606
- children: [!1, !0].map((d) => /* @__PURE__ */ w(
1614
+ children: [!1, !0].map((m) => /* @__PURE__ */ v(
1607
1615
  "button",
1608
1616
  {
1609
1617
  type: "button",
1610
- className: K(b.orientButton, _ === d && b.orientActive),
1611
- "aria-pressed": _ === d,
1612
- "aria-label": i(d ? "imageEditor.portrait" : "imageEditor.landscape"),
1613
- title: i(d ? "imageEditor.portrait" : "imageEditor.landscape"),
1614
- onClick: () => M(d),
1615
- children: /* @__PURE__ */ w(et, { name: d ? "Mobile" : "Monitor", size: "sm" })
1618
+ className: W(w.orientButton, _ === m && w.orientActive),
1619
+ "aria-pressed": _ === m,
1620
+ "aria-label": i(m ? "imageEditor.portrait" : "imageEditor.landscape"),
1621
+ title: i(m ? "imageEditor.portrait" : "imageEditor.landscape"),
1622
+ onClick: () => M(m),
1623
+ children: /* @__PURE__ */ v(et, { name: m ? "Mobile" : "Monitor", size: "sm" })
1616
1624
  },
1617
- String(d)
1625
+ String(m)
1618
1626
  ))
1619
1627
  }
1620
1628
  ),
1621
- /* @__PURE__ */ w(
1622
- Ue,
1629
+ /* @__PURE__ */ v(
1630
+ De,
1623
1631
  {
1624
- icon: /* @__PURE__ */ w(qe, { ratio: null }),
1632
+ icon: /* @__PURE__ */ v(je, { ratio: null }),
1625
1633
  clickable: !0,
1626
1634
  selected: t == null,
1627
1635
  onClick: () => c(null),
1628
1636
  children: i("imageEditor.custom")
1629
1637
  }
1630
1638
  ),
1631
- e.map((d) => {
1632
- const T = _ ? 1 / d.ratio : d.ratio;
1633
- return /* @__PURE__ */ w(
1634
- Ue,
1639
+ e.map((m) => {
1640
+ const k = _ ? 1 / m.ratio : m.ratio;
1641
+ return /* @__PURE__ */ v(
1642
+ De,
1635
1643
  {
1636
- icon: /* @__PURE__ */ w(qe, { ratio: T }),
1644
+ icon: /* @__PURE__ */ v(je, { ratio: k }),
1637
1645
  clickable: !0,
1638
- selected: t != null && Qt(t, T),
1639
- onClick: () => c(T),
1640
- children: _ && !Qt(d.ratio, 1) ? Xi(d.label) : d.label
1646
+ selected: t != null && te(t, k),
1647
+ onClick: () => c(k),
1648
+ children: _ && !te(m.ratio, 1) ? Bi(m.label) : m.label
1641
1649
  },
1642
- d.label
1650
+ m.label
1643
1651
  );
1644
1652
  })
1645
1653
  ]
1646
1654
  }
1647
1655
  );
1648
1656
  }
1649
- const Yi = 52;
1650
- function Vi(t, e, n) {
1651
- const i = Math.min(2, typeof window < "u" && window.devicePixelRatio || 1), o = Math.round(Yi * i), r = document.createElement("canvas");
1657
+ const Vi = 52;
1658
+ function Gi(t, e, n) {
1659
+ const i = Math.min(2, typeof window < "u" && window.devicePixelRatio || 1), o = Math.round(Vi * i), r = document.createElement("canvas");
1652
1660
  r.width = r.height = o;
1653
1661
  const a = r.getContext("2d", { willReadFrequently: !0 });
1654
1662
  if (!a) return null;
1655
- const { crop: s } = n, _ = o / Math.min(s.width, s.height), [c, M] = Vt(s), d = at(
1656
- Ne(n, e),
1663
+ const { crop: s } = n, _ = o / Math.min(s.width, s.height), [c, M] = $t(s), m = at(
1664
+ qe(n, e),
1657
1665
  st(-c, -M),
1658
1666
  nt(_),
1659
1667
  st(o / 2, o / 2)
1660
1668
  );
1661
- a.setTransform(d[0], d[3], d[1], d[4], d[2], d[5]), a.imageSmoothingQuality = "high", a.drawImage(t, 0, 0, e.width, e.height), a.setTransform(1, 0, 0, 1, 0, 0);
1662
- let T;
1669
+ a.setTransform(m[0], m[3], m[1], m[4], m[2], m[5]), a.imageSmoothingQuality = "high", a.drawImage(t, 0, 0, e.width, e.height), a.setTransform(1, 0, 0, 1, 0, 0);
1670
+ let k;
1663
1671
  try {
1664
- T = a.getImageData(0, 0, o, o);
1672
+ k = a.getImageData(0, 0, o, o);
1665
1673
  } catch {
1666
1674
  return null;
1667
1675
  }
1668
- const f = ke * Math.max(e.width, e.height) * n.scale * _, A = n.finetune.clarity ? Le(T.data, o, o, f) : null, S = at(
1676
+ const f = Ne * Math.max(e.width, e.height) * n.scale * _, I = n.finetune.clarity ? Le(k.data, o, o, f) : null, S = at(
1669
1677
  st(-o / 2, -o / 2),
1670
1678
  nt(1 / _),
1671
1679
  nt(2 / s.width, 2 / s.height)
1672
1680
  ), y = {};
1673
- for (const x of ye.flat()) {
1674
- const l = new ImageData(new Uint8ClampedArray(T.data), o, o);
1675
- Re(l.data, o, o, Pe(n, Ce[x]), A, S), a.putImageData(l, 0, 0), y[x] = r.toDataURL();
1681
+ for (const x of Ee.flat()) {
1682
+ const l = new ImageData(new Uint8ClampedArray(k.data), o, o);
1683
+ Ce(l.data, o, o, Pe(n, Re[x]), I, S), a.putImageData(l, 0, 0), y[x] = r.toDataURL();
1676
1684
  }
1677
1685
  return y;
1678
1686
  }
1679
1687
  function $i({ image: t, size: e, state: n, onSelect: i }) {
1680
1688
  var R;
1681
- const o = re(), r = O(null), [a, s] = Q({}), [_, c] = Q({ start: !1, end: !1 }), M = n.filter ?? "default", d = O(null);
1682
- ((R = d.current) == null ? void 0 : R.image) !== t && (d.current = { image: t, source: te(t, e.width, e.height, 512).canvas });
1683
- const T = JSON.stringify([
1689
+ const o = oe(), r = F(null), [a, s] = Q({}), [_, c] = Q({ start: !1, end: !1 }), M = n.filter ?? "default", m = F(null);
1690
+ ((R = m.current) == null ? void 0 : R.image) !== t && (m.current = { image: t, source: ne(t, e.width, e.height, 512).canvas });
1691
+ const k = JSON.stringify([
1684
1692
  n.crop,
1685
1693
  n.rotation,
1686
1694
  n.flipX,
@@ -1688,84 +1696,84 @@ function $i({ image: t, size: e, state: n, onSelect: i }) {
1688
1696
  n.scale,
1689
1697
  n.finetune
1690
1698
  ]);
1691
- q(() => {
1692
- const m = setTimeout(() => {
1699
+ j(() => {
1700
+ const d = setTimeout(() => {
1693
1701
  var N;
1694
- const E = (N = d.current) == null ? void 0 : N.source;
1702
+ const E = (N = m.current) == null ? void 0 : N.source;
1695
1703
  if (!E) return;
1696
- const v = Vi(E, e, n);
1697
- v && s(v);
1704
+ const b = Gi(E, e, n);
1705
+ b && s(b);
1698
1706
  }, 120);
1699
- return () => clearTimeout(m);
1700
- }, [T, t]);
1707
+ return () => clearTimeout(d);
1708
+ }, [k, t]);
1701
1709
  const f = () => {
1702
- const m = r.current;
1703
- m && c({
1704
- start: m.scrollLeft > 2,
1705
- end: m.scrollLeft + m.clientWidth < m.scrollWidth - 2
1710
+ const d = r.current;
1711
+ d && c({
1712
+ start: d.scrollLeft > 2,
1713
+ end: d.scrollLeft + d.clientWidth < d.scrollWidth - 2
1706
1714
  });
1707
1715
  };
1708
- q(() => {
1716
+ j(() => {
1709
1717
  f();
1710
- const m = r.current;
1711
- if (!m || typeof ResizeObserver > "u") return;
1718
+ const d = r.current;
1719
+ if (!d || typeof ResizeObserver > "u") return;
1712
1720
  const E = new ResizeObserver(f);
1713
- return E.observe(m), () => E.disconnect();
1714
- }, []), q(() => {
1715
- var m, E, v;
1716
- (v = (E = (m = r.current) == null ? void 0 : m.querySelector(`[data-filter="${M}"]`)) == null ? void 0 : E.scrollIntoView) == null || v.call(E, { block: "nearest", inline: "nearest", behavior: "smooth" });
1717
- }, [M]), q(() => {
1718
- const m = r.current;
1719
- if (!m) return;
1720
- const E = (v) => {
1721
- Math.abs(v.deltaY) <= Math.abs(v.deltaX) || (v.preventDefault(), m.scrollLeft += v.deltaY);
1721
+ return E.observe(d), () => E.disconnect();
1722
+ }, []), j(() => {
1723
+ var d, E, b;
1724
+ (b = (E = (d = r.current) == null ? void 0 : d.querySelector(`[data-filter="${M}"]`)) == null ? void 0 : E.scrollIntoView) == null || b.call(E, { block: "nearest", inline: "nearest", behavior: "smooth" });
1725
+ }, [M]), j(() => {
1726
+ const d = r.current;
1727
+ if (!d) return;
1728
+ const E = (b) => {
1729
+ Math.abs(b.deltaY) <= Math.abs(b.deltaX) || (b.preventDefault(), d.scrollLeft += b.deltaY);
1722
1730
  };
1723
- return m.addEventListener("wheel", E, { passive: !1 }), () => m.removeEventListener("wheel", E);
1731
+ return d.addEventListener("wheel", E, { passive: !1 }), () => d.removeEventListener("wheel", E);
1724
1732
  }, []);
1725
- const A = O(
1733
+ const I = F(
1726
1734
  null
1727
- ), S = O(0), y = (m) => {
1728
- if (m.pointerType !== "mouse" || m.button !== 0) return;
1735
+ ), S = F(0), y = (d) => {
1736
+ if (d.pointerType !== "mouse" || d.button !== 0) return;
1729
1737
  cancelAnimationFrame(S.current);
1730
1738
  const E = r.current;
1731
- A.current = { x: m.clientX, left: E.scrollLeft, v: 0, t: performance.now(), moved: !1 };
1732
- }, x = (m) => {
1733
- const E = A.current;
1739
+ I.current = { x: d.clientX, left: E.scrollLeft, v: 0, t: performance.now(), moved: !1 };
1740
+ }, x = (d) => {
1741
+ const E = I.current;
1734
1742
  if (!E) return;
1735
- const v = r.current, N = m.clientX - E.x;
1736
- if (Math.abs(N) > 4 && !E.moved && (E.moved = !0, v.setPointerCapture(m.pointerId)), !E.moved) return;
1737
- const j = performance.now(), G = E.left - N;
1738
- E.v = (v.scrollLeft - G) / Math.max(1, j - E.t), E.t = j, v.scrollLeft = G;
1743
+ const b = r.current, N = d.clientX - E.x;
1744
+ if (Math.abs(N) > 4 && !E.moved && (E.moved = !0, b.setPointerCapture(d.pointerId)), !E.moved) return;
1745
+ const $ = performance.now(), G = E.left - N;
1746
+ E.v = (b.scrollLeft - G) / Math.max(1, $ - E.t), E.t = $, b.scrollLeft = G;
1739
1747
  }, l = () => {
1740
- const m = A.current;
1741
- if (A.current = null, !(m != null && m.moved)) return;
1748
+ const d = I.current;
1749
+ if (I.current = null, !(d != null && d.moved)) return;
1742
1750
  const E = r.current;
1743
- let v = -m.v, N = performance.now();
1744
- const j = (W) => {
1745
- const V = W - N;
1746
- N = W, E.scrollLeft += v * V, v *= Math.pow(0.995, V), Math.abs(v) > 0.02 && (S.current = requestAnimationFrame(j));
1751
+ let b = -d.v, N = performance.now();
1752
+ const $ = (K) => {
1753
+ const Y = K - N;
1754
+ N = K, E.scrollLeft += b * Y, b *= Math.pow(0.995, Y), Math.abs(b) > 0.02 && (S.current = requestAnimationFrame($));
1747
1755
  };
1748
- S.current = requestAnimationFrame(j);
1749
- const G = (W) => {
1750
- W.stopPropagation(), W.preventDefault();
1756
+ S.current = requestAnimationFrame($);
1757
+ const G = (K) => {
1758
+ K.stopPropagation(), K.preventDefault();
1751
1759
  };
1752
1760
  E.addEventListener("click", G, { capture: !0, once: !0 }), setTimeout(() => E.removeEventListener("click", G, { capture: !0 }), 0);
1753
1761
  };
1754
- q(() => () => cancelAnimationFrame(S.current), []);
1755
- const C = ye.flat(), u = (m) => {
1756
- var N, j;
1757
- if (m.key !== "ArrowLeft" && m.key !== "ArrowRight") return;
1758
- const E = C.indexOf(m.target.dataset.filter);
1762
+ j(() => () => cancelAnimationFrame(S.current), []);
1763
+ const A = Ee.flat(), u = (d) => {
1764
+ var N, $;
1765
+ if (d.key !== "ArrowLeft" && d.key !== "ArrowRight") return;
1766
+ const E = A.indexOf(d.target.dataset.filter);
1759
1767
  if (E === -1) return;
1760
- m.preventDefault();
1761
- const v = C[Math.min(C.length - 1, Math.max(0, E + (m.key === "ArrowRight" ? 1 : -1)))];
1762
- (j = (N = r.current) == null ? void 0 : N.querySelector(`[data-filter="${v}"]`)) == null || j.focus();
1768
+ d.preventDefault();
1769
+ const b = A[Math.min(A.length - 1, Math.max(0, E + (d.key === "ArrowRight" ? 1 : -1)))];
1770
+ ($ = (N = r.current) == null ? void 0 : N.querySelector(`[data-filter="${b}"]`)) == null || $.focus();
1763
1771
  };
1764
- return /* @__PURE__ */ w(
1772
+ return /* @__PURE__ */ v(
1765
1773
  "div",
1766
1774
  {
1767
1775
  ref: r,
1768
- className: K(b.strip, _.start && b.fadeStart, _.end && b.fadeEnd),
1776
+ className: W(w.strip, _.start && w.fadeStart, _.end && w.fadeEnd),
1769
1777
  "data-part": "filters",
1770
1778
  role: "group",
1771
1779
  "aria-label": o("imageEditor.filters"),
@@ -1775,26 +1783,26 @@ function $i({ image: t, size: e, state: n, onSelect: i }) {
1775
1783
  onPointerUp: l,
1776
1784
  onPointerCancel: l,
1777
1785
  onKeyDown: u,
1778
- children: ye.map((m, E) => /* @__PURE__ */ w("div", { className: b.stripGroup, children: m.map((v) => /* @__PURE__ */ B(
1786
+ children: Ee.map((d, E) => /* @__PURE__ */ v("div", { className: w.stripGroup, children: d.map((b) => /* @__PURE__ */ X(
1779
1787
  "button",
1780
1788
  {
1781
1789
  type: "button",
1782
- className: K(b.filterTile, v === M && b.filterActive),
1783
- "data-filter": v,
1784
- "aria-pressed": v === M,
1785
- onClick: () => i(v),
1790
+ className: W(w.filterTile, b === M && w.filterActive),
1791
+ "data-filter": b,
1792
+ "aria-pressed": b === M,
1793
+ onClick: () => i(b),
1786
1794
  children: [
1787
- /* @__PURE__ */ w("span", { className: b.filterThumb, children: a[v] && /* @__PURE__ */ w("img", { src: a[v], alt: "", draggable: !1 }) }),
1788
- /* @__PURE__ */ w("span", { className: b.filterLabel, children: o(`imageEditor.filter.${v}`) })
1795
+ /* @__PURE__ */ v("span", { className: w.filterThumb, children: a[b] && /* @__PURE__ */ v("img", { src: a[b], alt: "", draggable: !1 }) }),
1796
+ /* @__PURE__ */ v("span", { className: w.filterLabel, children: o(`imageEditor.filter.${b}`) })
1789
1797
  ]
1790
1798
  },
1791
- v
1799
+ b
1792
1800
  )) }, E))
1793
1801
  }
1794
1802
  );
1795
1803
  }
1796
- const Gi = [1, 0.75, 0.5, 0.25], bt = (t, e) => Math.max(1, Math.min(e, Math.round(t)));
1797
- function ji({
1804
+ const ji = [1, 0.75, 0.5, 0.25], wt = (t, e) => Math.max(1, Math.min(e, Math.round(t)));
1805
+ function Wi({
1798
1806
  max: t,
1799
1807
  value: e,
1800
1808
  locked: n,
@@ -1802,35 +1810,35 @@ function ji({
1802
1810
  onInput: o,
1803
1811
  onChange: r
1804
1812
  }) {
1805
- const a = re(), s = e, [_, c] = Q({ w: String(s.width), h: String(s.height) });
1806
- q(() => {
1813
+ const a = oe(), s = e, [_, c] = Q({ w: String(s.width), h: String(s.height) });
1814
+ j(() => {
1807
1815
  c({ w: String(s.width), h: String(s.height) });
1808
1816
  }, [s.width, s.height]);
1809
- const d = Math.round(s.width * t.height / t.width) === s.height || Math.round(s.height * t.width / t.height) === s.width ? t.width / t.height : s.width / s.height, T = O(null), f = T.current ?? d, A = (u, R) => {
1810
- const m = Number(R);
1811
- if (!R || !Number.isFinite(m) || m <= 0) return null;
1817
+ const m = Math.round(s.width * t.height / t.width) === s.height || Math.round(s.height * t.width / t.height) === s.width ? t.width / t.height : s.width / s.height, k = F(null), f = k.current ?? m, I = (u, R) => {
1818
+ const d = Number(R);
1819
+ if (!R || !Number.isFinite(d) || d <= 0) return null;
1812
1820
  if (u === "w") {
1813
- let N = bt(m, t.width);
1821
+ let N = wt(d, t.width);
1814
1822
  if (!n) return { width: N, height: s.height };
1815
- const j = bt(N / f, t.height);
1816
- return j < N / f - 0.5 && (N = bt(j * f, t.width)), { width: N, height: j };
1823
+ const $ = wt(N / f, t.height);
1824
+ return $ < N / f - 0.5 && (N = wt($ * f, t.width)), { width: N, height: $ };
1817
1825
  }
1818
- let E = bt(m, t.height);
1826
+ let E = wt(d, t.height);
1819
1827
  if (!n) return { width: s.width, height: E };
1820
- const v = bt(E * f, t.width);
1821
- return v < E * f - 0.5 && (E = bt(v / f, t.height)), { width: v, height: E };
1828
+ const b = wt(E * f, t.width);
1829
+ return b < E * f - 0.5 && (E = wt(b / f, t.height)), { width: b, height: E };
1822
1830
  }, S = (u) => u.width === t.width && u.height === t.height ? null : u, y = (u, R) => {
1823
- const m = R.replace(/[^\d]/g, ""), E = A(u, m);
1831
+ const d = R.replace(/[^\d]/g, ""), E = I(u, d);
1824
1832
  c(
1825
- (v) => E ? {
1826
- w: u === "w" ? m : String(E.width),
1827
- h: u === "h" ? m : String(E.height)
1828
- } : { ...v, [u]: m }
1833
+ (b) => E ? {
1834
+ w: u === "w" ? d : String(E.width),
1835
+ h: u === "h" ? d : String(E.height)
1836
+ } : { ...b, [u]: d }
1829
1837
  ), E && o(S(E));
1830
1838
  }, x = () => {
1831
1839
  const u = Number(_.w), R = Number(_.h);
1832
- let m = s;
1833
- u > 0 && R > 0 && (m = n ? A("w", _.w) ?? s : { width: bt(u, t.width), height: bt(R, t.height) }), c({ w: String(m.width), h: String(m.height) }), r(S(m));
1840
+ let d = s;
1841
+ u > 0 && R > 0 && (d = n ? I("w", _.w) ?? s : { width: wt(u, t.width), height: wt(R, t.height) }), c({ w: String(d.width), h: String(d.height) }), r(S(d));
1834
1842
  }, l = (u, R) => {
1835
1843
  if (u.key === "Enter") {
1836
1844
  u.preventDefault(), x();
@@ -1838,85 +1846,85 @@ function ji({
1838
1846
  }
1839
1847
  if (u.key !== "ArrowUp" && u.key !== "ArrowDown") return;
1840
1848
  u.preventDefault();
1841
- const m = (u.shiftKey ? 10 : 1) * (u.key === "ArrowUp" ? 1 : -1), E = R === "w" ? s.width : s.height, v = A(R, String(E + m));
1842
- v && (c({ w: String(v.width), h: String(v.height) }), r(S(v)));
1843
- }, C = (u) => s.width === Math.max(1, Math.round(t.width * u)) && s.height === Math.max(1, Math.round(t.height * u));
1844
- return /* @__PURE__ */ B("div", { className: b.resizePanel, "data-part": "resize", children: [
1845
- /* @__PURE__ */ B("div", { className: b.resizeFields, children: [
1846
- /* @__PURE__ */ B("label", { className: b.dimField, children: [
1847
- /* @__PURE__ */ B("span", { className: b.dimLabel, children: [
1848
- /* @__PURE__ */ w("span", { className: b.dimLabelFull, children: a("imageEditor.width") }),
1849
- /* @__PURE__ */ w("span", { className: b.dimLabelShort, "aria-hidden": "true", children: a("imageEditor.width").charAt(0) })
1849
+ const d = (u.shiftKey ? 10 : 1) * (u.key === "ArrowUp" ? 1 : -1), E = R === "w" ? s.width : s.height, b = I(R, String(E + d));
1850
+ b && (c({ w: String(b.width), h: String(b.height) }), r(S(b)));
1851
+ }, A = (u) => s.width === Math.max(1, Math.round(t.width * u)) && s.height === Math.max(1, Math.round(t.height * u));
1852
+ return /* @__PURE__ */ X("div", { className: w.resizePanel, "data-part": "resize", children: [
1853
+ /* @__PURE__ */ X("div", { className: w.resizeFields, children: [
1854
+ /* @__PURE__ */ X("label", { className: w.dimField, children: [
1855
+ /* @__PURE__ */ X("span", { className: w.dimLabel, children: [
1856
+ /* @__PURE__ */ v("span", { className: w.dimLabelFull, children: a("imageEditor.width") }),
1857
+ /* @__PURE__ */ v("span", { className: w.dimLabelShort, "aria-hidden": "true", children: a("imageEditor.width").charAt(0) })
1850
1858
  ] }),
1851
- /* @__PURE__ */ w(
1859
+ /* @__PURE__ */ v(
1852
1860
  "input",
1853
1861
  {
1854
- className: b.dimInput,
1862
+ className: w.dimInput,
1855
1863
  inputMode: "numeric",
1856
1864
  value: _.w,
1857
1865
  "aria-label": a("imageEditor.width"),
1858
1866
  onChange: (u) => y("w", u.target.value),
1859
1867
  onBlur: () => {
1860
- x(), T.current = null;
1868
+ x(), k.current = null;
1861
1869
  },
1862
1870
  onKeyDown: (u) => l(u, "w"),
1863
1871
  onFocus: (u) => {
1864
- T.current = d, u.target.select();
1872
+ k.current = m, u.target.select();
1865
1873
  }
1866
1874
  }
1867
1875
  ),
1868
- /* @__PURE__ */ w("span", { className: b.dimUnit, children: "px" })
1876
+ /* @__PURE__ */ v("span", { className: w.dimUnit, children: "px" })
1869
1877
  ] }),
1870
- /* @__PURE__ */ w(
1878
+ /* @__PURE__ */ v(
1871
1879
  "button",
1872
1880
  {
1873
1881
  type: "button",
1874
- className: K(b.lockButton, n && b.lockActive),
1882
+ className: W(w.lockButton, n && w.lockActive),
1875
1883
  "aria-pressed": n,
1876
1884
  "aria-label": a("imageEditor.lockRatio"),
1877
1885
  title: a("imageEditor.lockRatio"),
1878
1886
  onClick: () => i(!n),
1879
- children: /* @__PURE__ */ w(et, { name: n ? "Unlock" : "LockSlash", size: "sm" })
1887
+ children: /* @__PURE__ */ v(et, { name: n ? "Unlock" : "LockSlash", size: "sm" })
1880
1888
  }
1881
1889
  ),
1882
- /* @__PURE__ */ B("label", { className: b.dimField, children: [
1883
- /* @__PURE__ */ B("span", { className: b.dimLabel, children: [
1884
- /* @__PURE__ */ w("span", { className: b.dimLabelFull, children: a("imageEditor.height") }),
1885
- /* @__PURE__ */ w("span", { className: b.dimLabelShort, "aria-hidden": "true", children: a("imageEditor.height").charAt(0) })
1890
+ /* @__PURE__ */ X("label", { className: w.dimField, children: [
1891
+ /* @__PURE__ */ X("span", { className: w.dimLabel, children: [
1892
+ /* @__PURE__ */ v("span", { className: w.dimLabelFull, children: a("imageEditor.height") }),
1893
+ /* @__PURE__ */ v("span", { className: w.dimLabelShort, "aria-hidden": "true", children: a("imageEditor.height").charAt(0) })
1886
1894
  ] }),
1887
- /* @__PURE__ */ w(
1895
+ /* @__PURE__ */ v(
1888
1896
  "input",
1889
1897
  {
1890
- className: b.dimInput,
1898
+ className: w.dimInput,
1891
1899
  inputMode: "numeric",
1892
1900
  value: _.h,
1893
1901
  "aria-label": a("imageEditor.height"),
1894
1902
  onChange: (u) => y("h", u.target.value),
1895
1903
  onBlur: () => {
1896
- x(), T.current = null;
1904
+ x(), k.current = null;
1897
1905
  },
1898
1906
  onKeyDown: (u) => l(u, "h"),
1899
1907
  onFocus: (u) => {
1900
- T.current = d, u.target.select();
1908
+ k.current = m, u.target.select();
1901
1909
  }
1902
1910
  }
1903
1911
  ),
1904
- /* @__PURE__ */ w("span", { className: b.dimUnit, children: "px" })
1912
+ /* @__PURE__ */ v("span", { className: w.dimUnit, children: "px" })
1905
1913
  ] })
1906
1914
  ] }),
1907
- /* @__PURE__ */ w(
1915
+ /* @__PURE__ */ v(
1908
1916
  "div",
1909
1917
  {
1910
- className: b.tabs,
1918
+ className: w.tabs,
1911
1919
  role: "group",
1912
1920
  "aria-label": a("imageEditor.resize"),
1913
1921
  "data-part": "tabs",
1914
- children: Gi.map((u) => /* @__PURE__ */ w(
1922
+ children: ji.map((u) => /* @__PURE__ */ v(
1915
1923
  "button",
1916
1924
  {
1917
1925
  type: "button",
1918
- "aria-pressed": C(u),
1919
- className: K(b.tab, C(u) && b.tabActive),
1926
+ "aria-pressed": A(u),
1927
+ className: W(w.tab, A(u) && w.tabActive),
1920
1928
  onClick: () => r(
1921
1929
  S({
1922
1930
  width: Math.max(1, Math.round(t.width * u)),
@@ -1931,17 +1939,17 @@ function ji({
1931
1939
  )
1932
1940
  ] });
1933
1941
  }
1934
- const qi = "_ruler_j6c34_4", Wi = "_viewport_j6c34_21", Ki = "_value_j6c34_26", Hi = "_track_j6c34_50", Qi = "_tick_j6c34_57", Zi = "_major_j6c34_66", Ji = "_origin_j6c34_73", to = "_indicator_j6c34_78", wt = {
1935
- ruler: qi,
1936
- viewport: Wi,
1937
- value: Ki,
1938
- track: Hi,
1939
- tick: Qi,
1940
- major: Zi,
1941
- origin: Ji,
1942
- indicator: to
1943
- }, we = 9;
1944
- function Zt({
1942
+ const Ki = "_ruler_j6c34_4", Hi = "_viewport_j6c34_21", Qi = "_value_j6c34_26", Zi = "_track_j6c34_50", Ji = "_tick_j6c34_57", to = "_major_j6c34_66", eo = "_origin_j6c34_73", no = "_indicator_j6c34_78", vt = {
1943
+ ruler: Ki,
1944
+ viewport: Hi,
1945
+ value: Qi,
1946
+ track: Zi,
1947
+ tick: Ji,
1948
+ major: to,
1949
+ origin: eo,
1950
+ indicator: no
1951
+ }, be = 9;
1952
+ function ee({
1945
1953
  min: t,
1946
1954
  max: e,
1947
1955
  value: n,
@@ -1953,87 +1961,87 @@ function Zt({
1953
1961
  majorEvery: _ = 5,
1954
1962
  resetValue: c = 0,
1955
1963
  format: M = (S) => String(Math.round(S)),
1956
- onInput: d,
1957
- onChange: T,
1964
+ onInput: m,
1965
+ onChange: k,
1958
1966
  "aria-label": f,
1959
- className: A
1967
+ className: I
1960
1968
  }) {
1961
- const S = we / s, y = O(null), x = O(0), l = O(void 0), C = O(n);
1962
- C.current = n;
1963
- const u = O(!1), R = O(T);
1964
- R.current = T;
1965
- const m = (k) => {
1966
- u.current = !1, T(k);
1969
+ const S = be / s, y = F(null), x = F(0), l = F(void 0), A = F(n);
1970
+ A.current = n;
1971
+ const u = F(!1), R = F(k);
1972
+ R.current = k;
1973
+ const d = (L) => {
1974
+ u.current = !1, k(L);
1967
1975
  };
1968
- q(
1976
+ j(
1969
1977
  () => () => {
1970
- cancelAnimationFrame(x.current), clearTimeout(l.current), u.current && (u.current = !1, R.current(C.current));
1978
+ cancelAnimationFrame(x.current), clearTimeout(l.current), u.current && (u.current = !1, R.current(A.current));
1971
1979
  },
1972
1980
  []
1973
1981
  );
1974
- const E = (k, z = !0) => {
1975
- let L = Math.min(e, Math.max(t, k));
1976
- if (L = Math.round(L / i) * i, z) {
1977
- for (const $ of r)
1978
- if (Math.abs(L - $) <= a) {
1979
- L = $;
1982
+ const E = (L, q = !0) => {
1983
+ let C = Math.min(e, Math.max(t, L));
1984
+ if (C = Math.round(C / i) * i, q) {
1985
+ for (const V of r)
1986
+ if (Math.abs(C - V) <= a) {
1987
+ C = V;
1980
1988
  break;
1981
1989
  }
1982
1990
  }
1983
- return Number(L.toFixed(6));
1984
- }, v = (k) => {
1985
- k !== C.current && (C.current = k, u.current = !0, d(k));
1986
- }, N = (k) => {
1987
- k.button === 0 && (cancelAnimationFrame(x.current), k.currentTarget.setPointerCapture(k.pointerId), y.current = {
1988
- id: k.pointerId,
1989
- startX: k.clientX,
1991
+ return Number(C.toFixed(6));
1992
+ }, b = (L) => {
1993
+ L !== A.current && (A.current = L, u.current = !0, m(L));
1994
+ }, N = (L) => {
1995
+ L.button === 0 && (cancelAnimationFrame(x.current), L.currentTarget.setPointerCapture(L.pointerId), y.current = {
1996
+ id: L.pointerId,
1997
+ startX: L.clientX,
1990
1998
  startValue: n,
1991
- lastX: k.clientX,
1999
+ lastX: L.clientX,
1992
2000
  lastT: performance.now(),
1993
2001
  velocity: 0,
1994
2002
  moved: !1
1995
2003
  });
1996
- }, j = (k) => {
1997
- const z = y.current;
1998
- if (!z || z.id !== k.pointerId) return;
1999
- const L = performance.now(), $ = Math.max(1, L - z.lastT);
2000
- z.velocity = 0.7 * (-(k.clientX - z.lastX) / S / $) + 0.3 * z.velocity, z.lastX = k.clientX, z.lastT = L, Math.abs(k.clientX - z.startX) > 2 && (z.moved = !0), v(E(z.startValue - (k.clientX - z.startX) / S));
2001
- }, G = (k) => {
2002
- const z = y.current;
2003
- if (!z || z.id !== k.pointerId) return;
2004
+ }, $ = (L) => {
2005
+ const q = y.current;
2006
+ if (!q || q.id !== L.pointerId) return;
2007
+ const C = performance.now(), V = Math.max(1, C - q.lastT);
2008
+ q.velocity = 0.7 * (-(L.clientX - q.lastX) / S / V) + 0.3 * q.velocity, q.lastX = L.clientX, q.lastT = C, Math.abs(L.clientX - q.startX) > 2 && (q.moved = !0), b(E(q.startValue - (L.clientX - q.startX) / S));
2009
+ }, G = (L) => {
2010
+ const q = y.current;
2011
+ if (!q || q.id !== L.pointerId) return;
2004
2012
  y.current = null;
2005
- let L = C.current;
2006
- const $ = (e - t) / 1500;
2007
- let H = performance.now() - z.lastT < 80 ? Math.max(-$, Math.min($, z.velocity)) : 0;
2008
- if (!z.moved || Math.abs(H) < $ / 20) return m(E(L));
2013
+ let C = A.current;
2014
+ const V = (e - t) / 1500;
2015
+ let H = performance.now() - q.lastT < 80 ? Math.max(-V, Math.min(V, q.velocity)) : 0;
2016
+ if (!q.moved || Math.abs(H) < V / 20) return d(E(C));
2009
2017
  let mt = performance.now();
2010
2018
  const lt = (xt) => {
2011
2019
  const J = Math.min(32, Math.max(0, xt - mt));
2012
- mt = xt, L += H * J, H *= Math.pow(0.99, J);
2013
- const rt = E(L, Math.abs(H) < $ / 6);
2014
- if (v(rt), Math.abs(H) < $ / 40 || rt <= t || rt >= e) return m(rt);
2020
+ mt = xt, C += H * J, H *= Math.pow(0.99, J);
2021
+ const rt = E(C, Math.abs(H) < V / 6);
2022
+ if (b(rt), Math.abs(H) < V / 40 || rt <= t || rt >= e) return d(rt);
2015
2023
  x.current = requestAnimationFrame(lt);
2016
2024
  };
2017
2025
  x.current = requestAnimationFrame(lt);
2018
- }, W = (k) => {
2019
- const z = Math.abs(k.deltaX) > Math.abs(k.deltaY) ? k.deltaX : k.deltaY;
2020
- if (!z) return;
2021
- const L = E(C.current + z / S / 2);
2022
- v(L), clearTimeout(l.current), l.current = setTimeout(() => m(C.current), 220);
2023
- }, V = (k) => {
2024
- const z = k.shiftKey ? 10 : 1;
2025
- let L = null;
2026
- const $ = C.current;
2027
- if (k.key === "ArrowRight" || k.key === "ArrowUp" ? L = $ + o * z : k.key === "ArrowLeft" || k.key === "ArrowDown" ? L = $ - o * z : k.key === "Home" ? L = t : k.key === "End" && (L = e), L == null) return;
2028
- k.preventDefault();
2029
- const H = E(L, !1);
2030
- v(H), m(H);
2026
+ }, K = (L) => {
2027
+ const q = Math.abs(L.deltaX) > Math.abs(L.deltaY) ? L.deltaX : L.deltaY;
2028
+ if (!q) return;
2029
+ const C = E(A.current + q / S / 2);
2030
+ b(C), clearTimeout(l.current), l.current = setTimeout(() => d(A.current), 220);
2031
+ }, Y = (L) => {
2032
+ const q = L.shiftKey ? 10 : 1;
2033
+ let C = null;
2034
+ const V = A.current;
2035
+ if (L.key === "ArrowRight" || L.key === "ArrowUp" ? C = V + o * q : L.key === "ArrowLeft" || L.key === "ArrowDown" ? C = V - o * q : L.key === "Home" ? C = t : L.key === "End" && (C = e), C == null) return;
2036
+ L.preventDefault();
2037
+ const H = E(C, !1);
2038
+ b(H), d(H);
2031
2039
  }, ct = () => {
2032
2040
  cancelAnimationFrame(x.current);
2033
- const k = E(c, !1);
2034
- v(k), m(k);
2041
+ const L = E(c, !1);
2042
+ b(L), d(L);
2035
2043
  }, Z = Math.floor((e - t) / s), dt = M(n);
2036
- return /* @__PURE__ */ B(
2044
+ return /* @__PURE__ */ X(
2037
2045
  "div",
2038
2046
  {
2039
2047
  role: "slider",
@@ -2044,44 +2052,44 @@ function Zt({
2044
2052
  "aria-valuenow": n,
2045
2053
  "aria-valuetext": dt,
2046
2054
  "aria-orientation": "horizontal",
2047
- className: K(wt.ruler, A),
2055
+ className: W(vt.ruler, I),
2048
2056
  "data-part": "ruler",
2049
2057
  onPointerDown: N,
2050
- onPointerMove: j,
2058
+ onPointerMove: $,
2051
2059
  onPointerUp: G,
2052
2060
  onPointerCancel: G,
2053
- onWheel: W,
2054
- onKeyDown: V,
2061
+ onWheel: K,
2062
+ onKeyDown: Y,
2055
2063
  onDoubleClick: ct,
2056
2064
  children: [
2057
- /* @__PURE__ */ w("span", { className: wt.value, "aria-hidden": "true", children: dt }),
2058
- /* @__PURE__ */ B("span", { className: wt.viewport, "aria-hidden": "true", children: [
2059
- /* @__PURE__ */ w(
2065
+ /* @__PURE__ */ v("span", { className: vt.value, "aria-hidden": "true", children: dt }),
2066
+ /* @__PURE__ */ X("span", { className: vt.viewport, "aria-hidden": "true", children: [
2067
+ /* @__PURE__ */ v(
2060
2068
  "span",
2061
2069
  {
2062
- className: wt.track,
2070
+ className: vt.track,
2063
2071
  style: {
2064
- width: Z * we,
2072
+ width: Z * be,
2065
2073
  transform: `translateX(${-(n - t) * S}px)`
2066
2074
  },
2067
- children: Array.from({ length: Z + 1 }, (k, z) => {
2068
- const L = t + z * s;
2069
- return /* @__PURE__ */ w(
2075
+ children: Array.from({ length: Z + 1 }, (L, q) => {
2076
+ const C = t + q * s;
2077
+ return /* @__PURE__ */ v(
2070
2078
  "span",
2071
2079
  {
2072
- className: K(
2073
- wt.tick,
2074
- z % _ === 0 && wt.major,
2075
- Math.abs(L - c) < 1e-9 && wt.origin
2080
+ className: W(
2081
+ vt.tick,
2082
+ q % _ === 0 && vt.major,
2083
+ Math.abs(C - c) < 1e-9 && vt.origin
2076
2084
  ),
2077
- style: { left: z * we }
2085
+ style: { left: q * be }
2078
2086
  },
2079
- z
2087
+ q
2080
2088
  );
2081
2089
  })
2082
2090
  }
2083
2091
  ),
2084
- /* @__PURE__ */ w("span", { className: wt.indicator })
2092
+ /* @__PURE__ */ v("span", { className: vt.indicator })
2085
2093
  ] })
2086
2094
  ]
2087
2095
  }
@@ -2093,7 +2101,7 @@ const Tt = [
2093
2101
  { id: "finetune", icon: "Brush" },
2094
2102
  { id: "redact", icon: "Blur" },
2095
2103
  { id: "resize", icon: "Maximize3" }
2096
- ], eo = ["blur", "pixelate"], We = [0.05, 0.1, 0.15, 0.2, 0.25, 0.33, 0.5, 0.67, 0.75, 1, 1.5, 2, 3, 4, 6, 8], no = 'a[href]:not([tabindex="-1"]), button:not(:disabled):not([tabindex="-1"]), input:not(:disabled):not([tabindex="-1"]), [tabindex]:not([tabindex="-1"])', ve = Math.PI / 180, go = Ke(function({
2104
+ ], ro = ["blur", "pixelate"], We = [0.05, 0.1, 0.15, 0.2, 0.25, 0.33, 0.5, 0.67, 0.75, 1, 1.5, 2, 3, 4, 6, 8], io = 'a[href]:not([tabindex="-1"]), button:not(:disabled):not([tabindex="-1"]), input:not(:disabled):not([tabindex="-1"]), [tabindex]:not([tabindex="-1"])', xe = Math.PI / 180, wo = Ke(function({
2097
2105
  open: e,
2098
2106
  src: n,
2099
2107
  initialState: i,
@@ -2104,127 +2112,127 @@ const Tt = [
2104
2112
  outputQuality: _,
2105
2113
  onLoad: c,
2106
2114
  onUpdate: M,
2107
- onProcess: d,
2108
- onClose: T,
2115
+ onProcess: m,
2116
+ onClose: k,
2109
2117
  className: f,
2110
- onKeyDown: A,
2118
+ onKeyDown: I,
2111
2119
  ...S
2112
2120
  }, y) {
2113
- const x = re(), [l] = Q(() => new dn()), C = pn(l.subscribe, l.getSnapshot, l.getSnapshot), { state: u, size: R, ui: m, status: E } = C, v = O(null), N = O(null), j = O(null), [G, W] = Q(null), [V, ct] = Q(1), [Z, dt] = Q(!1), [k, z] = Q(!1), L = O(0), $ = O(null), H = O(null), mt = O(null);
2114
- m.util !== "resize" || !u ? H.current = null : (!H.current || u !== mt.current && u !== H.current) && (H.current = u);
2115
- const lt = O({ onLoad: c, onUpdate: M });
2116
- lt.current = { onLoad: c, onUpdate: M }, q(() => {
2121
+ const x = oe(), [l] = Q(() => new dn()), A = pn(l.subscribe, l.getSnapshot, l.getSnapshot), { state: u, size: R, ui: d, status: E } = A, b = F(null), N = F(null), $ = F(null), [G, K] = Q(null), [Y, ct] = Q(1), [Z, dt] = Q(!1), [L, q] = Q(!1), C = F(0), V = F(null), H = F(null), mt = F(null);
2122
+ d.util !== "resize" || !u ? H.current = null : (!H.current || u !== mt.current && u !== H.current) && (H.current = u);
2123
+ const lt = F({ onLoad: c, onUpdate: M });
2124
+ lt.current = { onLoad: c, onUpdate: M }, j(() => {
2117
2125
  const h = [
2118
2126
  l.on(
2119
2127
  "load",
2120
- (I) => {
2121
- var U, X;
2122
- return (X = (U = lt.current).onLoad) == null ? void 0 : X.call(U, I.size);
2128
+ (T) => {
2129
+ var D, O;
2130
+ return (O = (D = lt.current).onLoad) == null ? void 0 : O.call(D, T.size);
2123
2131
  }
2124
2132
  ),
2125
- l.on("update", (I) => {
2126
- var U, X;
2127
- return (X = (U = lt.current).onUpdate) == null ? void 0 : X.call(U, I);
2133
+ l.on("update", (T) => {
2134
+ var D, O;
2135
+ return (O = (D = lt.current).onUpdate) == null ? void 0 : O.call(D, T);
2128
2136
  }),
2129
2137
  // a rotation drag's base is stale once history moves under it
2130
2138
  ...["undo", "redo", "revert"].map(
2131
- (I) => l.on(I, () => {
2132
- $.current = null;
2139
+ (T) => l.on(T, () => {
2140
+ V.current = null;
2133
2141
  })
2134
2142
  )
2135
2143
  ];
2136
- return () => h.forEach((I) => I());
2137
- }, [l]), q(() => {
2144
+ return () => h.forEach((T) => T());
2145
+ }, [l]), j(() => {
2138
2146
  if (!(!e || !n))
2139
- return W(null), z(!1), l.open({ src: n, initialState: i, util: o, cropAspectRatio: r, outputType: s, outputQuality: _ }).then(() => {
2147
+ return K(null), q(!1), l.open({ src: n, initialState: i, util: o, cropAspectRatio: r, outputType: s, outputQuality: _ }).then(() => {
2140
2148
  const h = l.getSnapshot().state;
2141
- h && (L.current = ge(h.rotation).quarter);
2149
+ h && (C.current = _e(h.rotation).quarter);
2142
2150
  }).catch(() => {
2143
2151
  }), () => l.close();
2144
- }, [e, n, l]), q(() => {
2152
+ }, [e, n, l]), j(() => {
2145
2153
  if (!e) return;
2146
- const h = (X) => {
2147
- (X.ctrlKey || X.metaKey) && X.preventDefault();
2148
- }, I = (X) => X.preventDefault(), U = ["gesturestart", "gesturechange", "gestureend"];
2149
- return window.addEventListener("wheel", h, { passive: !1 }), U.forEach((X) => document.addEventListener(X, I)), () => {
2150
- window.removeEventListener("wheel", h), U.forEach((X) => document.removeEventListener(X, I));
2154
+ const h = (O) => {
2155
+ (O.ctrlKey || O.metaKey) && O.preventDefault();
2156
+ }, T = (O) => O.preventDefault(), D = ["gesturestart", "gesturechange", "gestureend"];
2157
+ return window.addEventListener("wheel", h, { passive: !1 }), D.forEach((O) => document.addEventListener(O, T)), () => {
2158
+ window.removeEventListener("wheel", h), D.forEach((O) => document.removeEventListener(O, T));
2151
2159
  };
2152
- }, [e]), q(() => {
2160
+ }, [e]), j(() => {
2153
2161
  if (!e) return;
2154
- const h = document.activeElement, I = requestAnimationFrame(() => {
2155
- var U;
2156
- return (U = N.current) == null ? void 0 : U.focus();
2162
+ const h = document.activeElement, T = requestAnimationFrame(() => {
2163
+ var D;
2164
+ return (D = N.current) == null ? void 0 : D.focus();
2157
2165
  });
2158
2166
  return () => {
2159
- var U;
2160
- cancelAnimationFrame(I), (U = h == null ? void 0 : h.focus) == null || U.call(h);
2167
+ var D;
2168
+ cancelAnimationFrame(T), (D = h == null ? void 0 : h.focus) == null || D.call(h);
2161
2169
  };
2162
2170
  }, [e]);
2163
2171
  const xt = (h) => {
2164
2172
  N.current = h, typeof y == "function" ? y(h) : y && (y.current = h);
2165
2173
  }, J = () => {
2166
2174
  const h = l.getSnapshot().state;
2167
- h && (L.current = ge(h.rotation).quarter);
2175
+ h && (C.current = _e(h.rotation).quarter);
2168
2176
  }, rt = () => {
2169
2177
  var h;
2170
- (h = v.current) == null || h.transition("jump"), l.undo(), J();
2178
+ (h = b.current) == null || h.transition("jump"), l.undo(), J();
2171
2179
  }, tt = () => {
2172
2180
  var h;
2173
- (h = v.current) == null || h.transition("jump"), l.redo(), J();
2174
- }, qt = () => {
2181
+ (h = b.current) == null || h.transition("jump"), l.redo(), J();
2182
+ }, Ht = () => {
2175
2183
  var h;
2176
- (h = v.current) == null || h.transition("jump"), l.revert(), J();
2184
+ (h = b.current) == null || h.transition("jump"), l.revert(), J();
2177
2185
  }, It = () => {
2178
2186
  var h;
2179
- !u || !R || ((h = v.current) == null || h.transition("rotate"), L.current = Ee(L.current - Math.PI / 2), l.setState(kn(u, R)));
2187
+ !u || !R || ((h = b.current) == null || h.transition("rotate"), C.current = ke(C.current - Math.PI / 2), l.setState(Ln(u, R)));
2180
2188
  }, Mt = () => {
2181
2189
  var h;
2182
- !u || !R || ((h = v.current) == null || h.transition("flip"), L.current = Ee(-L.current), l.setState(Nn(u, R)));
2183
- }, Nt = gn(() => T(), [T]), ft = () => {
2184
- Z || Nt();
2185
- }, ce = async () => {
2190
+ !u || !R || ((h = b.current) == null || h.transition("flip"), C.current = ke(-C.current), l.setState(Nn(u, R)));
2191
+ }, Pt = gn(() => k(), [k]), ft = () => {
2192
+ Z || Pt();
2193
+ }, he = async () => {
2186
2194
  if (!(!u || Z)) {
2187
- dt(!0), z(!1);
2195
+ dt(!0), q(!1);
2188
2196
  try {
2189
2197
  const h = await l.process();
2190
- d == null || d(h), Nt();
2198
+ m == null || m(h), Pt();
2191
2199
  } catch {
2192
- z(!0);
2200
+ q(!0);
2193
2201
  } finally {
2194
2202
  dt(!1);
2195
2203
  }
2196
2204
  }
2197
- }, Wt = (h) => {
2198
- if (A == null || A(h), h.defaultPrevented) return;
2199
- const I = h.metaKey || h.ctrlKey;
2200
- if (I && h.key.toLowerCase() === "z") {
2205
+ }, Qt = (h) => {
2206
+ if (I == null || I(h), h.defaultPrevented) return;
2207
+ const T = h.metaKey || h.ctrlKey;
2208
+ if (T && h.key.toLowerCase() === "z") {
2201
2209
  h.preventDefault(), h.shiftKey ? tt() : rt();
2202
2210
  return;
2203
2211
  }
2204
- if (I && h.key.toLowerCase() === "y") {
2212
+ if (T && h.key.toLowerCase() === "y") {
2205
2213
  h.preventDefault(), tt();
2206
2214
  return;
2207
2215
  }
2208
2216
  if (h.key !== "Tab" || !N.current) return;
2209
- const U = [...N.current.querySelectorAll(no)].filter(
2217
+ const D = [...N.current.querySelectorAll(io)].filter(
2210
2218
  (g) => g.offsetParent !== null
2211
2219
  );
2212
- if (U.length === 0) return;
2213
- const X = U[0], At = U[U.length - 1];
2214
- h.shiftKey && (document.activeElement === X || document.activeElement === N.current) ? (h.preventDefault(), At.focus()) : !h.shiftKey && document.activeElement === At && (h.preventDefault(), X.focus());
2220
+ if (D.length === 0) return;
2221
+ const O = D[0], At = D[D.length - 1];
2222
+ h.shiftKey && (document.activeElement === O || document.activeElement === N.current) ? (h.preventDefault(), At.focus()) : !h.shiftKey && document.activeElement === At && (h.preventDefault(), O.focus());
2215
2223
  }, pt = (h) => {
2216
- const I = V, U = h > 0 ? We.find((X) => X > I * 1.01) ?? Ae : [...We].reverse().find((X) => X < I * 0.99) ?? Ie;
2217
- W(U);
2218
- }, Kt = u ? ge(u.rotation, L.current).fine / ve : 0, Pt = (h) => {
2219
- const I = H.current ?? l.getSnapshot().state;
2220
- I && (l.preview(Sn(I, h)), mt.current = l.getSnapshot().state);
2224
+ const T = Y, D = h > 0 ? We.find((O) => O > T * 1.01) ?? Se : [...We].reverse().find((O) => O < T * 0.99) ?? Ie;
2225
+ K(D);
2226
+ }, Zt = u ? _e(u.rotation, C.current).fine / xe : 0, zt = (h) => {
2227
+ const T = H.current ?? l.getSnapshot().state;
2228
+ T && (l.preview(Sn(T, h)), mt.current = l.getSnapshot().state);
2221
2229
  };
2222
2230
  let gt = null;
2223
2231
  if (u && R) {
2224
- if (m.util === "crop")
2225
- gt = /* @__PURE__ */ B(he, { children: [
2226
- m.cropTab === "rotation" ? /* @__PURE__ */ w(
2227
- Zt,
2232
+ if (d.util === "crop")
2233
+ gt = /* @__PURE__ */ X(ue, { children: [
2234
+ d.cropTab === "rotation" ? /* @__PURE__ */ v(
2235
+ ee,
2228
2236
  {
2229
2237
  "aria-label": x("imageEditor.rotation"),
2230
2238
  min: -45,
@@ -2233,48 +2241,48 @@ const Tt = [
2233
2241
  tickStep: 1,
2234
2242
  majorEvery: 5,
2235
2243
  snapThreshold: 0.6,
2236
- value: Number(Kt.toFixed(1)),
2244
+ value: Number(Zt.toFixed(1)),
2237
2245
  format: (h) => `${Number(h.toFixed(1))}°`,
2238
2246
  onInput: (h) => {
2239
- const I = l.getSnapshot().state;
2240
- I && ($.current ?? ($.current = I), l.preview(Oe($.current, L.current + h * ve, R)));
2247
+ const T = l.getSnapshot().state;
2248
+ T && (V.current ?? (V.current = T), l.preview(Fe(V.current, C.current + h * xe, R)));
2241
2249
  },
2242
2250
  onChange: (h) => {
2243
- const I = $.current ?? l.getSnapshot().state;
2244
- $.current = null, I && (l.preview(Oe(I, L.current + h * ve, R)), l.commit());
2251
+ const T = V.current ?? l.getSnapshot().state;
2252
+ V.current = null, T && (l.preview(Fe(T, C.current + h * xe, R)), l.commit());
2245
2253
  }
2246
2254
  },
2247
2255
  "rotation"
2248
- ) : /* @__PURE__ */ w(
2249
- Zt,
2256
+ ) : /* @__PURE__ */ v(
2257
+ ee,
2250
2258
  {
2251
2259
  "aria-label": x("imageEditor.scale"),
2252
2260
  min: 100,
2253
- max: Bt * 100,
2261
+ max: Vt * 100,
2254
2262
  step: 1,
2255
2263
  tickStep: 10,
2256
2264
  majorEvery: 5,
2257
2265
  snapPoints: [100],
2258
2266
  snapThreshold: 4,
2259
2267
  resetValue: 100,
2260
- value: Math.round(Jt(u, R) * 100),
2268
+ value: Math.round(Bt(u, R) * 100),
2261
2269
  format: (h) => `${Math.round(h)}%`,
2262
2270
  onInput: (h) => {
2263
- const I = l.getSnapshot().state;
2264
- I && l.preview(Yt(I, h / 100, R));
2271
+ const T = l.getSnapshot().state;
2272
+ T && l.preview(Gt(T, h / 100, R));
2265
2273
  },
2266
2274
  onChange: (h) => {
2267
- const I = l.getSnapshot().state;
2268
- I && (l.preview(Yt(I, h / 100, R)), l.commit());
2275
+ const T = l.getSnapshot().state;
2276
+ T && (l.preview(Gt(T, h / 100, R)), l.commit());
2269
2277
  }
2270
2278
  },
2271
2279
  "scale"
2272
2280
  ),
2273
- /* @__PURE__ */ w(
2274
- xe,
2281
+ /* @__PURE__ */ v(
2282
+ Me,
2275
2283
  {
2276
2284
  label: x("imageEditor.crop"),
2277
- value: m.cropTab,
2285
+ value: d.cropTab,
2278
2286
  options: [
2279
2287
  { id: "rotation", label: x("imageEditor.rotation") },
2280
2288
  { id: "scale", label: x("imageEditor.scale") }
@@ -2283,8 +2291,8 @@ const Tt = [
2283
2291
  }
2284
2292
  )
2285
2293
  ] });
2286
- else if (m.util === "filter" && l.image)
2287
- gt = /* @__PURE__ */ w(
2294
+ else if (d.util === "filter" && l.image)
2295
+ gt = /* @__PURE__ */ v(
2288
2296
  $i,
2289
2297
  {
2290
2298
  image: l.image.image,
@@ -2292,29 +2300,29 @@ const Tt = [
2292
2300
  state: u,
2293
2301
  onSelect: (h) => l.setState({
2294
2302
  filter: h === "default" ? null : h,
2295
- colorMatrix: Ce[h]
2303
+ colorMatrix: Re[h]
2296
2304
  })
2297
2305
  }
2298
2306
  );
2299
- else if (m.util === "resize")
2300
- gt = /* @__PURE__ */ w(
2301
- ji,
2307
+ else if (d.util === "resize")
2308
+ gt = /* @__PURE__ */ v(
2309
+ Wi,
2302
2310
  {
2303
- max: kt(H.current ?? u),
2304
- value: Rt(u),
2305
- locked: m.resizeLocked,
2311
+ max: qt(H.current ?? u),
2312
+ value: Lt(u),
2313
+ locked: d.resizeLocked,
2306
2314
  onLockedChange: (h) => l.setUi({ resizeLocked: h }),
2307
- onInput: Pt,
2315
+ onInput: zt,
2308
2316
  onChange: (h) => {
2309
- Pt(h), l.commit();
2317
+ zt(h), l.commit();
2310
2318
  }
2311
2319
  }
2312
2320
  );
2313
- else if (m.util === "redact") {
2321
+ else if (d.util === "redact") {
2314
2322
  const h = u.redact;
2315
- gt = /* @__PURE__ */ B(he, { children: [
2316
- /* @__PURE__ */ w(
2317
- Zt,
2323
+ gt = /* @__PURE__ */ X(ue, { children: [
2324
+ /* @__PURE__ */ v(
2325
+ ee,
2318
2326
  {
2319
2327
  "aria-label": x(`imageEditor.redact.${h.effect}`),
2320
2328
  min: 0,
@@ -2324,32 +2332,32 @@ const Tt = [
2324
2332
  majorEvery: 4,
2325
2333
  snapThreshold: 0,
2326
2334
  value: h.amount,
2327
- format: (I) => String(Math.round(I)),
2328
- onInput: (I) => l.preview({ redact: { ...h, amount: I } }),
2329
- onChange: (I) => {
2330
- l.preview({ redact: { ...h, amount: I } }), l.commit();
2335
+ format: (T) => String(Math.round(T)),
2336
+ onInput: (T) => l.preview({ redact: { ...h, amount: T } }),
2337
+ onChange: (T) => {
2338
+ l.preview({ redact: { ...h, amount: T } }), l.commit();
2331
2339
  }
2332
2340
  },
2333
2341
  h.effect
2334
2342
  ),
2335
- /* @__PURE__ */ w(
2336
- xe,
2343
+ /* @__PURE__ */ v(
2344
+ Me,
2337
2345
  {
2338
2346
  label: x("imageEditor.redact"),
2339
2347
  value: h.effect,
2340
- options: eo.map((I) => ({
2341
- id: I,
2342
- label: x(`imageEditor.redact.${I}`)
2348
+ options: ro.map((T) => ({
2349
+ id: T,
2350
+ label: x(`imageEditor.redact.${T}`)
2343
2351
  })),
2344
- onChange: (I) => l.setState({ redact: { ...h, effect: I } })
2352
+ onChange: (T) => l.setState({ redact: { ...h, effect: T } })
2345
2353
  }
2346
2354
  )
2347
2355
  ] });
2348
- } else if (m.util === "finetune") {
2349
- const h = m.finetuneTab;
2350
- gt = /* @__PURE__ */ B(he, { children: [
2351
- /* @__PURE__ */ w(
2352
- Zt,
2356
+ } else if (d.util === "finetune") {
2357
+ const h = d.finetuneTab;
2358
+ gt = /* @__PURE__ */ X(ue, { children: [
2359
+ /* @__PURE__ */ v(
2360
+ ee,
2353
2361
  {
2354
2362
  "aria-label": x(`imageEditor.finetune.${h}`),
2355
2363
  min: -100,
@@ -2359,44 +2367,44 @@ const Tt = [
2359
2367
  majorEvery: 4,
2360
2368
  snapThreshold: 3,
2361
2369
  value: u.finetune[h],
2362
- format: (I) => String(Math.round(I)),
2363
- onInput: (I) => {
2364
- const U = l.getSnapshot().state;
2365
- U && l.preview({ finetune: { ...U.finetune, [h]: I } });
2370
+ format: (T) => String(Math.round(T)),
2371
+ onInput: (T) => {
2372
+ const D = l.getSnapshot().state;
2373
+ D && l.preview({ finetune: { ...D.finetune, [h]: T } });
2366
2374
  },
2367
- onChange: (I) => {
2368
- const U = l.getSnapshot().state;
2369
- U && (l.preview({ finetune: { ...U.finetune, [h]: I } }), l.commit());
2375
+ onChange: (T) => {
2376
+ const D = l.getSnapshot().state;
2377
+ D && (l.preview({ finetune: { ...D.finetune, [h]: T } }), l.commit());
2370
2378
  }
2371
2379
  },
2372
2380
  h
2373
2381
  ),
2374
- /* @__PURE__ */ w(
2375
- xe,
2382
+ /* @__PURE__ */ v(
2383
+ Me,
2376
2384
  {
2377
2385
  label: x("imageEditor.finetune"),
2378
2386
  value: h,
2379
- options: yn.map((I) => ({
2380
- id: I,
2381
- label: x(`imageEditor.finetune.${I}`),
2382
- dot: u.finetune[I] !== 0
2387
+ options: yn.map((T) => ({
2388
+ id: T,
2389
+ label: x(`imageEditor.finetune.${T}`),
2390
+ dot: u.finetune[T] !== 0
2383
2391
  })),
2384
- onChange: (I) => l.setUi({ finetuneTab: I })
2392
+ onChange: (T) => l.setUi({ finetuneTab: T })
2385
2393
  }
2386
2394
  )
2387
2395
  ] });
2388
2396
  }
2389
2397
  }
2390
- const zt = E === "ready" && !!u, Ht = zt && m.util !== "crop";
2391
- return /* @__PURE__ */ w(
2392
- bn,
2398
+ const St = E === "ready" && !!u, Jt = St && d.util !== "crop";
2399
+ return /* @__PURE__ */ v(
2400
+ wn,
2393
2401
  {
2394
2402
  open: e,
2395
2403
  onClose: ft,
2396
2404
  closeOnBackdrop: !1,
2397
2405
  dim: 0,
2398
- className: b.overlay,
2399
- children: /* @__PURE__ */ B(
2406
+ className: w.overlay,
2407
+ children: /* @__PURE__ */ X(
2400
2408
  "div",
2401
2409
  {
2402
2410
  ref: xt,
@@ -2404,28 +2412,28 @@ const Tt = [
2404
2412
  "aria-modal": "true",
2405
2413
  "aria-label": x("imageEditor.title"),
2406
2414
  tabIndex: -1,
2407
- className: K(b.editor, f),
2415
+ className: W(w.editor, f),
2408
2416
  "data-part": "editor",
2409
- onKeyDown: Wt,
2417
+ onKeyDown: Qt,
2410
2418
  ...S,
2411
2419
  children: [
2412
- /* @__PURE__ */ w(
2413
- Ui,
2420
+ /* @__PURE__ */ v(
2421
+ Fi,
2414
2422
  {
2415
- ref: v,
2423
+ ref: b,
2416
2424
  core: l,
2417
- snapshot: C,
2425
+ snapshot: A,
2418
2426
  cropAspectRatio: r,
2419
- viewZoom: m.util === "crop" ? null : G,
2420
- onViewZoom: W,
2427
+ viewZoom: d.util === "crop" ? null : G,
2428
+ onViewZoom: K,
2421
2429
  onZoomReport: ct,
2422
- areaRef: j
2430
+ areaRef: $
2423
2431
  }
2424
2432
  ),
2425
- /* @__PURE__ */ B("header", { className: b.header, "data-part": "header", children: [
2426
- /* @__PURE__ */ w("div", { className: b.headerStart, children: /* @__PURE__ */ B("div", { className: b.group, children: [
2427
- /* @__PURE__ */ w(
2428
- Et,
2433
+ /* @__PURE__ */ X("header", { className: w.header, "data-part": "header", children: [
2434
+ /* @__PURE__ */ v("div", { className: w.headerStart, children: /* @__PURE__ */ X("div", { className: w.group, children: [
2435
+ /* @__PURE__ */ v(
2436
+ kt,
2429
2437
  {
2430
2438
  variant: "text",
2431
2439
  color: "primary",
@@ -2433,146 +2441,158 @@ const Tt = [
2433
2441
  "aria-label": x("imageEditor.close"),
2434
2442
  title: x("imageEditor.close"),
2435
2443
  onClick: ft,
2436
- children: /* @__PURE__ */ w(et, { name: "Close", className: b.closeIcon })
2444
+ children: /* @__PURE__ */ v(et, { name: "Close", className: w.closeIcon })
2437
2445
  }
2438
2446
  ),
2439
- /* @__PURE__ */ w("span", { className: b.groupDivider, "aria-hidden": "true" }),
2440
- /* @__PURE__ */ w(
2441
- Et,
2447
+ /* @__PURE__ */ v("span", { className: w.groupDivider, "aria-hidden": "true" }),
2448
+ /* @__PURE__ */ v(
2449
+ kt,
2442
2450
  {
2443
2451
  variant: "text",
2444
2452
  color: "primary",
2445
2453
  size: "sm",
2446
2454
  "aria-label": x("imageEditor.revert"),
2447
2455
  title: x("imageEditor.revert"),
2448
- disabled: !C.canRevert,
2449
- onClick: qt,
2450
- children: /* @__PURE__ */ w(et, { name: "ReverseTimeArrow" })
2456
+ disabled: !A.canRevert,
2457
+ onClick: Ht,
2458
+ children: /* @__PURE__ */ v(et, { name: "ReverseTimeArrow" })
2451
2459
  }
2452
2460
  )
2453
2461
  ] }) }),
2454
- /* @__PURE__ */ B("div", { className: b.headerCenter, children: [
2455
- /* @__PURE__ */ B("div", { className: b.group, children: [
2456
- /* @__PURE__ */ w(
2457
- Et,
2462
+ /* @__PURE__ */ X("div", { className: w.headerCenter, children: [
2463
+ /* @__PURE__ */ X("div", { className: w.group, children: [
2464
+ /* @__PURE__ */ v(
2465
+ kt,
2458
2466
  {
2459
2467
  variant: "text",
2460
2468
  color: "primary",
2461
2469
  size: "sm",
2462
2470
  "aria-label": x("imageEditor.undo"),
2463
2471
  title: x("imageEditor.undo"),
2464
- disabled: !C.canUndo,
2472
+ disabled: !A.canUndo,
2465
2473
  onClick: rt,
2466
- children: /* @__PURE__ */ w(et, { name: "UndoArrow" })
2474
+ children: /* @__PURE__ */ v(et, { name: "UndoArrow" })
2467
2475
  }
2468
2476
  ),
2469
- /* @__PURE__ */ w("span", { className: b.groupDivider, "aria-hidden": "true" }),
2470
- /* @__PURE__ */ w(
2471
- Et,
2477
+ /* @__PURE__ */ v("span", { className: w.groupDivider, "aria-hidden": "true" }),
2478
+ /* @__PURE__ */ v(
2479
+ kt,
2472
2480
  {
2473
2481
  variant: "text",
2474
2482
  color: "primary",
2475
2483
  size: "sm",
2476
2484
  "aria-label": x("imageEditor.redo"),
2477
2485
  title: x("imageEditor.redo"),
2478
- disabled: !C.canRedo,
2486
+ disabled: !A.canRedo,
2479
2487
  onClick: tt,
2480
- children: /* @__PURE__ */ w(et, { name: "RedoArrow" })
2488
+ children: /* @__PURE__ */ v(et, { name: "RedoArrow" })
2481
2489
  }
2482
2490
  )
2483
2491
  ] }),
2484
- Ht && /* @__PURE__ */ B("div", { className: K(b.group, b.fadeIn), children: [
2485
- /* @__PURE__ */ w(
2486
- Et,
2492
+ St && d.util === "crop" && /* @__PURE__ */ v("div", { className: W(w.group, w.fadeIn), children: /* @__PURE__ */ X(
2493
+ "span",
2494
+ {
2495
+ className: W(w.zoomLabel, w.zoomReadout),
2496
+ role: "status",
2497
+ "aria-label": x("imageEditor.zoom"),
2498
+ children: [
2499
+ Math.round(Y * 100),
2500
+ "%"
2501
+ ]
2502
+ }
2503
+ ) }),
2504
+ Jt && /* @__PURE__ */ X("div", { className: W(w.group, w.fadeIn), children: [
2505
+ /* @__PURE__ */ v(
2506
+ kt,
2487
2507
  {
2488
2508
  variant: "text",
2489
2509
  color: "primary",
2490
2510
  size: "sm",
2491
2511
  "aria-label": x("imageEditor.zoomOut"),
2492
2512
  title: x("imageEditor.zoomOut"),
2493
- disabled: V <= Ie * 1.01,
2513
+ disabled: Y <= Ie * 1.01,
2494
2514
  onClick: () => pt(-1),
2495
- children: /* @__PURE__ */ w(et, { name: "Minus" })
2515
+ children: /* @__PURE__ */ v(et, { name: "Minus" })
2496
2516
  }
2497
2517
  ),
2498
- /* @__PURE__ */ w("span", { className: b.groupDivider, "aria-hidden": "true" }),
2499
- /* @__PURE__ */ B(
2518
+ /* @__PURE__ */ v("span", { className: w.groupDivider, "aria-hidden": "true" }),
2519
+ /* @__PURE__ */ X(
2500
2520
  "button",
2501
2521
  {
2502
2522
  type: "button",
2503
- className: b.zoomLabel,
2523
+ className: w.zoomLabel,
2504
2524
  "aria-label": x("imageEditor.zoom"),
2505
2525
  title: x("imageEditor.zoomFit"),
2506
- onClick: () => W(null),
2526
+ onClick: () => K(null),
2507
2527
  children: [
2508
- Math.round(V * 100),
2528
+ Math.round(Y * 100),
2509
2529
  "%"
2510
2530
  ]
2511
2531
  }
2512
2532
  ),
2513
- /* @__PURE__ */ w("span", { className: b.groupDivider, "aria-hidden": "true" }),
2514
- /* @__PURE__ */ w(
2515
- Et,
2533
+ /* @__PURE__ */ v("span", { className: w.groupDivider, "aria-hidden": "true" }),
2534
+ /* @__PURE__ */ v(
2535
+ kt,
2516
2536
  {
2517
2537
  variant: "text",
2518
2538
  color: "primary",
2519
2539
  size: "sm",
2520
2540
  "aria-label": x("imageEditor.zoomIn"),
2521
2541
  title: x("imageEditor.zoomIn"),
2522
- disabled: V >= Ae * 0.99,
2542
+ disabled: Y >= Se * 0.99,
2523
2543
  onClick: () => pt(1),
2524
- children: /* @__PURE__ */ w(et, { name: "Add" })
2544
+ children: /* @__PURE__ */ v(et, { name: "Add" })
2525
2545
  }
2526
2546
  )
2527
2547
  ] })
2528
2548
  ] }),
2529
- /* @__PURE__ */ w("div", { className: b.headerEnd, children: /* @__PURE__ */ w(
2530
- Et,
2549
+ /* @__PURE__ */ v("div", { className: w.headerEnd, children: /* @__PURE__ */ v(
2550
+ kt,
2531
2551
  {
2532
2552
  variant: "contained",
2533
2553
  color: "accent",
2534
2554
  size: "sm",
2535
2555
  loading: Z,
2536
- disabled: !zt,
2556
+ disabled: !St,
2537
2557
  "aria-label": x("imageEditor.done"),
2538
2558
  title: x("imageEditor.done"),
2539
- onClick: ce,
2540
- className: b.done,
2541
- children: /* @__PURE__ */ w(et, { name: "CheckMarkTick" })
2559
+ onClick: he,
2560
+ className: w.done,
2561
+ children: /* @__PURE__ */ v(et, { name: "CheckMarkTick" })
2542
2562
  }
2543
2563
  ) })
2544
2564
  ] }),
2545
- /* @__PURE__ */ B("div", { className: b.main, "data-part": "main", children: [
2546
- /* @__PURE__ */ w("nav", { className: b.nav, "data-part": "nav", children: /* @__PURE__ */ w(
2565
+ /* @__PURE__ */ X("div", { className: w.main, "data-part": "main", children: [
2566
+ /* @__PURE__ */ v("nav", { className: w.nav, "data-part": "nav", children: /* @__PURE__ */ v(
2547
2567
  "div",
2548
2568
  {
2549
2569
  role: "tablist",
2550
2570
  "aria-label": x("imageEditor.tools"),
2551
2571
  "aria-orientation": "vertical",
2552
- className: b.navList,
2572
+ className: w.navList,
2553
2573
  onKeyDown: (h) => {
2554
- var X;
2555
- const I = Tt.findIndex((At) => At.id === m.util), U = h.key === "ArrowDown" || h.key === "ArrowRight" ? Tt[(I + 1) % Tt.length] : h.key === "ArrowUp" || h.key === "ArrowLeft" ? Tt[(I + Tt.length - 1) % Tt.length] : null;
2556
- U && (h.preventDefault(), l.setUi({ util: U.id }), (X = h.currentTarget.querySelector(`[data-util="${U.id}"]`)) == null || X.focus());
2574
+ var O;
2575
+ const T = Tt.findIndex((At) => At.id === d.util), D = h.key === "ArrowDown" || h.key === "ArrowRight" ? Tt[(T + 1) % Tt.length] : h.key === "ArrowUp" || h.key === "ArrowLeft" ? Tt[(T + Tt.length - 1) % Tt.length] : null;
2576
+ D && (h.preventDefault(), l.setUi({ util: D.id }), (O = h.currentTarget.querySelector(`[data-util="${D.id}"]`)) == null || O.focus());
2557
2577
  },
2558
2578
  children: Tt.map((h) => {
2559
- const I = m.util === h.id;
2560
- return /* @__PURE__ */ B(
2579
+ const T = d.util === h.id;
2580
+ return /* @__PURE__ */ X(
2561
2581
  "button",
2562
2582
  {
2563
2583
  type: "button",
2564
2584
  role: "tab",
2565
2585
  id: `tz-ie-tab-${h.id}`,
2566
- "aria-selected": I,
2586
+ "aria-selected": T,
2567
2587
  "aria-controls": "tz-ie-panel",
2568
- tabIndex: I ? 0 : -1,
2588
+ tabIndex: T ? 0 : -1,
2569
2589
  title: x(`imageEditor.${h.id}`),
2570
- className: K(b.tool, I && b.toolActive),
2590
+ className: W(w.tool, T && w.toolActive),
2571
2591
  "data-util": h.id,
2572
2592
  onClick: () => l.setUi({ util: h.id }),
2573
2593
  children: [
2574
- /* @__PURE__ */ w(et, { name: h.icon, size: "sm" }),
2575
- /* @__PURE__ */ w("span", { className: b.toolLabel, children: x(`imageEditor.${h.id}`) })
2594
+ /* @__PURE__ */ v(et, { name: h.icon, size: "sm" }),
2595
+ /* @__PURE__ */ v("span", { className: w.toolLabel, children: x(`imageEditor.${h.id}`) })
2576
2596
  ]
2577
2597
  },
2578
2598
  h.id
@@ -2580,70 +2600,70 @@ const Tt = [
2580
2600
  })
2581
2601
  }
2582
2602
  ) }),
2583
- /* @__PURE__ */ B(
2603
+ /* @__PURE__ */ X(
2584
2604
  "section",
2585
2605
  {
2586
- className: b.stage,
2606
+ className: w.stage,
2587
2607
  id: "tz-ie-panel",
2588
2608
  role: "tabpanel",
2589
- "aria-labelledby": `tz-ie-tab-${m.util}`,
2609
+ "aria-labelledby": `tz-ie-tab-${d.util}`,
2590
2610
  "data-part": "stage",
2591
- "data-util": m.util,
2611
+ "data-util": d.util,
2592
2612
  children: [
2593
- /* @__PURE__ */ w("div", { className: b.toolbar, "data-part": "toolbar", children: zt && m.util === "crop" && /* @__PURE__ */ B("div", { className: K(b.toolbarRow, b.fadeIn), children: [
2594
- /* @__PURE__ */ w(
2595
- Me,
2613
+ /* @__PURE__ */ v("div", { className: w.toolbar, "data-part": "toolbar", children: St && d.util === "crop" && /* @__PURE__ */ X("div", { className: W(w.toolbarRow, w.fadeIn), children: [
2614
+ /* @__PURE__ */ v(
2615
+ ye,
2596
2616
  {
2597
2617
  variant: "text",
2598
2618
  color: "primary",
2599
2619
  size: "sm",
2600
- startIcon: /* @__PURE__ */ w(et, { name: "RotateLeft" }),
2620
+ startIcon: /* @__PURE__ */ v(et, { name: "RotateLeft" }),
2601
2621
  title: x("imageEditor.rotateLeft"),
2602
2622
  "aria-label": x("imageEditor.rotateLeft"),
2603
2623
  onClick: It,
2604
- className: b.toolbarIconOnPhone,
2605
- children: /* @__PURE__ */ w("span", { className: b.toolbarLabel, children: x("imageEditor.rotateLeft") })
2624
+ className: w.toolbarIconOnPhone,
2625
+ children: /* @__PURE__ */ v("span", { className: w.toolbarLabel, children: x("imageEditor.rotateLeft") })
2606
2626
  }
2607
2627
  ),
2608
- /* @__PURE__ */ w(
2609
- Me,
2628
+ /* @__PURE__ */ v(
2629
+ ye,
2610
2630
  {
2611
2631
  variant: "text",
2612
2632
  color: "primary",
2613
2633
  size: "sm",
2614
- startIcon: /* @__PURE__ */ w(et, { name: "FlipHorizontal" }),
2634
+ startIcon: /* @__PURE__ */ v(et, { name: "FlipHorizontal" }),
2615
2635
  title: x("imageEditor.flipHorizontal"),
2616
2636
  "aria-label": x("imageEditor.flipHorizontal"),
2617
2637
  onClick: Mt,
2618
- className: b.toolbarIconOnPhone,
2619
- children: /* @__PURE__ */ w("span", { className: b.toolbarLabel, children: x("imageEditor.flipHorizontal") })
2638
+ className: w.toolbarIconOnPhone,
2639
+ children: /* @__PURE__ */ v("span", { className: w.toolbarLabel, children: x("imageEditor.flipHorizontal") })
2620
2640
  }
2621
2641
  ),
2622
- !r && u && /* @__PURE__ */ w(
2623
- Bi,
2642
+ !r && u && /* @__PURE__ */ v(
2643
+ Yi,
2624
2644
  {
2625
2645
  ratio: u.cropRatio,
2626
- options: a ?? Oi,
2646
+ options: a ?? Xi,
2627
2647
  onChange: (h) => {
2628
- var U;
2629
- const I = l.getSnapshot().state;
2630
- !I || !R || ((U = v.current) == null || U.transition("jump"), l.setState(zn(I, h, R)));
2648
+ var D;
2649
+ const T = l.getSnapshot().state;
2650
+ !T || !R || ((D = b.current) == null || D.transition("jump"), l.setState(Pn(T, h, R)));
2631
2651
  }
2632
2652
  }
2633
2653
  )
2634
2654
  ] }, "crop-toolbar") }),
2635
- /* @__PURE__ */ B("div", { ref: j, className: b.canvasArea, "data-part": "area", children: [
2636
- E === "loading" && /* @__PURE__ */ B("div", { className: b.status, role: "status", children: [
2637
- /* @__PURE__ */ w(_n, { size: "lg" }),
2638
- /* @__PURE__ */ w("span", { children: x("imageEditor.loading") })
2655
+ /* @__PURE__ */ X("div", { ref: $, className: w.canvasArea, "data-part": "area", children: [
2656
+ E === "loading" && /* @__PURE__ */ X("div", { className: w.status, role: "status", children: [
2657
+ /* @__PURE__ */ v(_n, { size: "lg" }),
2658
+ /* @__PURE__ */ v("span", { children: x("imageEditor.loading") })
2639
2659
  ] }),
2640
- E === "error" && /* @__PURE__ */ B("div", { className: b.status, role: "alert", children: [
2641
- /* @__PURE__ */ w(et, { name: "Gallery", size: "lg" }),
2642
- /* @__PURE__ */ w("span", { children: x("imageEditor.loadError") })
2660
+ E === "error" && /* @__PURE__ */ X("div", { className: w.status, role: "alert", children: [
2661
+ /* @__PURE__ */ v(et, { name: "Gallery", size: "lg" }),
2662
+ /* @__PURE__ */ v("span", { children: x("imageEditor.loadError") })
2643
2663
  ] }),
2644
- k && /* @__PURE__ */ w("div", { className: b.toastError, role: "alert", children: x("imageEditor.processError") })
2664
+ L && /* @__PURE__ */ v("div", { className: w.toastError, role: "alert", children: x("imageEditor.processError") })
2645
2665
  ] }),
2646
- /* @__PURE__ */ w("div", { className: b.footer, "data-part": "footer", children: /* @__PURE__ */ w("div", { className: K(b.footerInner, b.fadeIn), children: gt }, m.util) })
2666
+ /* @__PURE__ */ v("div", { className: w.footer, "data-part": "footer", children: /* @__PURE__ */ v("div", { className: W(w.footerInner, w.fadeIn), children: gt }, d.util) })
2647
2667
  ]
2648
2668
  }
2649
2669
  )
@@ -2654,23 +2674,23 @@ const Tt = [
2654
2674
  }
2655
2675
  );
2656
2676
  });
2657
- function xe({
2677
+ function Me({
2658
2678
  label: t,
2659
2679
  value: e,
2660
2680
  options: n,
2661
2681
  onChange: i
2662
2682
  }) {
2663
- const o = O(null);
2664
- return q(() => {
2683
+ const o = F(null);
2684
+ return j(() => {
2665
2685
  var r, a, s;
2666
2686
  (s = (a = (r = o.current) == null ? void 0 : r.querySelector(`[data-tab="${e}"]`)) == null ? void 0 : a.scrollIntoView) == null || s.call(a, { block: "nearest", inline: "nearest", behavior: "smooth" });
2667
- }, [e]), /* @__PURE__ */ w(
2687
+ }, [e]), /* @__PURE__ */ v(
2668
2688
  "div",
2669
2689
  {
2670
2690
  ref: o,
2671
2691
  role: "tablist",
2672
2692
  "aria-label": t,
2673
- className: b.tabs,
2693
+ className: w.tabs,
2674
2694
  "data-part": "tabs",
2675
2695
  onKeyDown: (r) => {
2676
2696
  var c;
@@ -2680,19 +2700,19 @@ function xe({
2680
2700
  const _ = n[(a + s + n.length) % n.length];
2681
2701
  i(_.id), (c = r.currentTarget.querySelector(`[data-tab="${_.id}"]`)) == null || c.focus();
2682
2702
  },
2683
- children: n.map((r) => /* @__PURE__ */ B(
2703
+ children: n.map((r) => /* @__PURE__ */ X(
2684
2704
  "button",
2685
2705
  {
2686
2706
  type: "button",
2687
2707
  role: "tab",
2688
2708
  "aria-selected": r.id === e,
2689
2709
  tabIndex: r.id === e ? 0 : -1,
2690
- className: K(b.tab, r.id === e && b.tabActive),
2710
+ className: W(w.tab, r.id === e && w.tabActive),
2691
2711
  "data-tab": r.id,
2692
2712
  onClick: () => i(r.id),
2693
2713
  children: [
2694
2714
  r.label,
2695
- r.dot && /* @__PURE__ */ w("span", { className: b.tabDot, "aria-hidden": "true" })
2715
+ r.dot && /* @__PURE__ */ v("span", { className: w.tabDot, "aria-hidden": "true" })
2696
2716
  ]
2697
2717
  },
2698
2718
  r.id
@@ -2701,9 +2721,9 @@ function xe({
2701
2721
  );
2702
2722
  }
2703
2723
  export {
2704
- Ce as F,
2705
- go as I,
2724
+ Re as F,
2725
+ wo as I,
2706
2726
  dn as a,
2707
- po as c
2727
+ _o as c
2708
2728
  };
2709
- //# sourceMappingURL=ImageEditor-DTFQZ6ON.js.map
2729
+ //# sourceMappingURL=ImageEditor-BwrG1fk7.js.map