jodit-pro 4.13.5 → 4.13.8

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 (365) hide show
  1. package/es2015/jodit.css +2 -2
  2. package/es2015/jodit.fat.min.css +1 -1
  3. package/es2015/jodit.fat.min.js +22 -22
  4. package/es2015/jodit.js +9 -6
  5. package/es2015/jodit.min.css +1 -1
  6. package/es2015/jodit.min.js +3 -3
  7. package/es2015/plugins/ai-assistant-pro/ai-assistant-pro.css +1 -1
  8. package/es2015/plugins/ai-assistant-pro/ai-assistant-pro.js +1 -1
  9. package/es2015/plugins/ai-assistant-pro/ai-assistant-pro.min.js +1 -1
  10. package/es2015/plugins/autocomplete/autocomplete.css +1 -1
  11. package/es2015/plugins/autocomplete/autocomplete.js +1 -1
  12. package/es2015/plugins/autocomplete/autocomplete.min.js +1 -1
  13. package/es2015/plugins/backup/backup.css +1 -1
  14. package/es2015/plugins/backup/backup.js +1 -1
  15. package/es2015/plugins/backup/backup.min.js +1 -1
  16. package/es2015/plugins/button-generator/button-generator.css +1 -1
  17. package/es2015/plugins/button-generator/button-generator.js +1 -1
  18. package/es2015/plugins/button-generator/button-generator.min.js +1 -1
  19. package/es2015/plugins/change-case/change-case.js +1 -1
  20. package/es2015/plugins/change-case/change-case.min.js +1 -1
  21. package/es2015/plugins/color-picker/color-picker.css +1 -1
  22. package/es2015/plugins/color-picker/color-picker.js +1 -1
  23. package/es2015/plugins/color-picker/color-picker.min.js +1 -1
  24. package/es2015/plugins/emoji/emoji.css +1 -1
  25. package/es2015/plugins/emoji/emoji.js +1 -1
  26. package/es2015/plugins/emoji/emoji.min.js +1 -1
  27. package/es2015/plugins/export-docs/export-docs.js +1 -1
  28. package/es2015/plugins/export-docs/export-docs.min.js +1 -1
  29. package/es2015/plugins/finder/finder.css +4 -1
  30. package/es2015/plugins/finder/finder.js +513 -112
  31. package/es2015/plugins/finder/finder.min.css +1 -1
  32. package/es2015/plugins/finder/finder.min.js +7 -7
  33. package/es2015/plugins/google-maps/google-maps.css +1 -1
  34. package/es2015/plugins/google-maps/google-maps.js +1 -1
  35. package/es2015/plugins/google-maps/google-maps.min.js +1 -1
  36. package/es2015/plugins/google-search/google-search.js +1 -1
  37. package/es2015/plugins/google-search/google-search.min.js +1 -1
  38. package/es2015/plugins/highlight-signature/highlight-signature.js +1 -1
  39. package/es2015/plugins/highlight-signature/highlight-signature.min.js +1 -1
  40. package/es2015/plugins/iframe-editor/iframe-editor.css +1 -1
  41. package/es2015/plugins/iframe-editor/iframe-editor.js +1 -1
  42. package/es2015/plugins/iframe-editor/iframe-editor.min.js +1 -1
  43. package/es2015/plugins/image-editor-pro/image-editor-pro.css +1 -1
  44. package/es2015/plugins/image-editor-pro/image-editor-pro.js +29 -11
  45. package/es2015/plugins/image-editor-pro/image-editor-pro.min.js +2 -2
  46. package/es2015/plugins/keyboard/keyboard.css +1 -1
  47. package/es2015/plugins/keyboard/keyboard.js +1 -1
  48. package/es2015/plugins/keyboard/keyboard.min.js +1 -1
  49. package/es2015/plugins/mobile-view/mobile-view.js +1 -1
  50. package/es2015/plugins/mobile-view/mobile-view.min.js +1 -1
  51. package/es2015/plugins/page-break/page-break.js +1 -1
  52. package/es2015/plugins/page-break/page-break.min.js +1 -1
  53. package/es2015/plugins/paste-code/paste-code.css +1 -1
  54. package/es2015/plugins/paste-code/paste-code.js +1 -1
  55. package/es2015/plugins/paste-code/paste-code.min.js +1 -1
  56. package/es2015/plugins/paste-from-word/paste-from-word.js +1 -1
  57. package/es2015/plugins/paste-from-word/paste-from-word.min.js +1 -1
  58. package/es2015/plugins/show-blocks/show-blocks.js +1 -1
  59. package/es2015/plugins/show-blocks/show-blocks.min.js +1 -1
  60. package/es2015/plugins/style/style.css +1 -1
  61. package/es2015/plugins/style/style.js +1 -1
  62. package/es2015/plugins/style/style.min.js +1 -1
  63. package/es2015/plugins/templates/templates.css +1 -1
  64. package/es2015/plugins/templates/templates.js +1 -1
  65. package/es2015/plugins/templates/templates.min.js +1 -1
  66. package/es2015/plugins/todo-list/todo-list.css +1 -1
  67. package/es2015/plugins/todo-list/todo-list.js +1 -1
  68. package/es2015/plugins/todo-list/todo-list.min.js +1 -1
  69. package/es2015/plugins/translate/translate.css +1 -1
  70. package/es2015/plugins/translate/translate.js +1 -1
  71. package/es2015/plugins/translate/translate.min.js +1 -1
  72. package/es2015/plugins/tune-block/tune-block.css +1 -1
  73. package/es2015/plugins/tune-block/tune-block.js +1 -1
  74. package/es2015/plugins/tune-block/tune-block.min.js +1 -1
  75. package/es2018/jodit.fat.min.css +1 -1
  76. package/es2018/jodit.fat.min.js +16 -16
  77. package/es2018/jodit.min.css +1 -1
  78. package/es2018/jodit.min.js +3 -3
  79. package/es2018/plugins/ai-assistant-pro/ai-assistant-pro.min.js +1 -1
  80. package/es2018/plugins/autocomplete/autocomplete.min.js +1 -1
  81. package/es2018/plugins/backup/backup.min.js +1 -1
  82. package/es2018/plugins/button-generator/button-generator.min.js +1 -1
  83. package/es2018/plugins/change-case/change-case.min.js +1 -1
  84. package/es2018/plugins/color-picker/color-picker.min.js +1 -1
  85. package/es2018/plugins/emoji/emoji.min.js +1 -1
  86. package/es2018/plugins/export-docs/export-docs.min.js +1 -1
  87. package/es2018/plugins/finder/finder.min.css +1 -1
  88. package/es2018/plugins/finder/finder.min.js +13 -13
  89. package/es2018/plugins/google-maps/google-maps.min.js +1 -1
  90. package/es2018/plugins/google-search/google-search.min.js +1 -1
  91. package/es2018/plugins/highlight-signature/highlight-signature.min.js +1 -1
  92. package/es2018/plugins/iframe-editor/iframe-editor.min.js +1 -1
  93. package/es2018/plugins/image-editor-pro/image-editor-pro.min.js +2 -2
  94. package/es2018/plugins/keyboard/keyboard.min.js +1 -1
  95. package/es2018/plugins/mobile-view/mobile-view.min.js +1 -1
  96. package/es2018/plugins/page-break/page-break.min.js +1 -1
  97. package/es2018/plugins/paste-code/paste-code.min.js +1 -1
  98. package/es2018/plugins/paste-from-word/paste-from-word.min.js +1 -1
  99. package/es2018/plugins/show-blocks/show-blocks.min.js +1 -1
  100. package/es2018/plugins/style/style.min.js +1 -1
  101. package/es2018/plugins/templates/templates.min.js +1 -1
  102. package/es2018/plugins/todo-list/todo-list.min.js +1 -1
  103. package/es2018/plugins/translate/translate.min.js +1 -1
  104. package/es2018/plugins/tune-block/tune-block.min.js +1 -1
  105. package/es2021/jodit.css +2 -2
  106. package/es2021/jodit.fat.min.css +1 -1
  107. package/es2021/jodit.fat.min.js +19 -19
  108. package/es2021/jodit.js +9 -6
  109. package/es2021/jodit.min.css +1 -1
  110. package/es2021/jodit.min.js +3 -3
  111. package/es2021/plugins/ai-assistant-pro/ai-assistant-pro.css +1 -1
  112. package/es2021/plugins/ai-assistant-pro/ai-assistant-pro.js +1 -1
  113. package/es2021/plugins/ai-assistant-pro/ai-assistant-pro.min.js +1 -1
  114. package/es2021/plugins/autocomplete/autocomplete.css +1 -1
  115. package/es2021/plugins/autocomplete/autocomplete.js +1 -1
  116. package/es2021/plugins/autocomplete/autocomplete.min.js +1 -1
  117. package/es2021/plugins/backup/backup.css +1 -1
  118. package/es2021/plugins/backup/backup.js +1 -1
  119. package/es2021/plugins/backup/backup.min.js +1 -1
  120. package/es2021/plugins/button-generator/button-generator.css +1 -1
  121. package/es2021/plugins/button-generator/button-generator.js +1 -1
  122. package/es2021/plugins/button-generator/button-generator.min.js +1 -1
  123. package/es2021/plugins/change-case/change-case.js +1 -1
  124. package/es2021/plugins/change-case/change-case.min.js +1 -1
  125. package/es2021/plugins/color-picker/color-picker.css +1 -1
  126. package/es2021/plugins/color-picker/color-picker.js +1 -1
  127. package/es2021/plugins/color-picker/color-picker.min.js +1 -1
  128. package/es2021/plugins/emoji/emoji.css +1 -1
  129. package/es2021/plugins/emoji/emoji.js +1 -1
  130. package/es2021/plugins/emoji/emoji.min.js +1 -1
  131. package/es2021/plugins/export-docs/export-docs.js +1 -1
  132. package/es2021/plugins/export-docs/export-docs.min.js +1 -1
  133. package/es2021/plugins/finder/finder.css +4 -1
  134. package/es2021/plugins/finder/finder.js +511 -112
  135. package/es2021/plugins/finder/finder.min.css +1 -1
  136. package/es2021/plugins/finder/finder.min.js +13 -13
  137. package/es2021/plugins/google-maps/google-maps.css +1 -1
  138. package/es2021/plugins/google-maps/google-maps.js +1 -1
  139. package/es2021/plugins/google-maps/google-maps.min.js +1 -1
  140. package/es2021/plugins/google-search/google-search.js +1 -1
  141. package/es2021/plugins/google-search/google-search.min.js +1 -1
  142. package/es2021/plugins/highlight-signature/highlight-signature.js +1 -1
  143. package/es2021/plugins/highlight-signature/highlight-signature.min.js +1 -1
  144. package/es2021/plugins/iframe-editor/iframe-editor.css +1 -1
  145. package/es2021/plugins/iframe-editor/iframe-editor.js +1 -1
  146. package/es2021/plugins/iframe-editor/iframe-editor.min.js +1 -1
  147. package/es2021/plugins/image-editor-pro/image-editor-pro.css +1 -1
  148. package/es2021/plugins/image-editor-pro/image-editor-pro.js +29 -11
  149. package/es2021/plugins/image-editor-pro/image-editor-pro.min.js +4 -4
  150. package/es2021/plugins/keyboard/keyboard.css +1 -1
  151. package/es2021/plugins/keyboard/keyboard.js +1 -1
  152. package/es2021/plugins/keyboard/keyboard.min.js +1 -1
  153. package/es2021/plugins/mobile-view/mobile-view.js +1 -1
  154. package/es2021/plugins/mobile-view/mobile-view.min.js +1 -1
  155. package/es2021/plugins/page-break/page-break.js +1 -1
  156. package/es2021/plugins/page-break/page-break.min.js +1 -1
  157. package/es2021/plugins/paste-code/paste-code.css +1 -1
  158. package/es2021/plugins/paste-code/paste-code.js +1 -1
  159. package/es2021/plugins/paste-code/paste-code.min.js +1 -1
  160. package/es2021/plugins/paste-from-word/paste-from-word.js +1 -1
  161. package/es2021/plugins/paste-from-word/paste-from-word.min.js +1 -1
  162. package/es2021/plugins/show-blocks/show-blocks.js +1 -1
  163. package/es2021/plugins/show-blocks/show-blocks.min.js +1 -1
  164. package/es2021/plugins/style/style.css +1 -1
  165. package/es2021/plugins/style/style.js +1 -1
  166. package/es2021/plugins/style/style.min.js +1 -1
  167. package/es2021/plugins/templates/templates.css +1 -1
  168. package/es2021/plugins/templates/templates.js +1 -1
  169. package/es2021/plugins/templates/templates.min.js +1 -1
  170. package/es2021/plugins/todo-list/todo-list.css +1 -1
  171. package/es2021/plugins/todo-list/todo-list.js +1 -1
  172. package/es2021/plugins/todo-list/todo-list.min.js +1 -1
  173. package/es2021/plugins/translate/translate.css +1 -1
  174. package/es2021/plugins/translate/translate.js +1 -1
  175. package/es2021/plugins/translate/translate.min.js +1 -1
  176. package/es2021/plugins/tune-block/tune-block.css +1 -1
  177. package/es2021/plugins/tune-block/tune-block.js +1 -1
  178. package/es2021/plugins/tune-block/tune-block.min.js +1 -1
  179. package/es2021.en/jodit.css +2 -2
  180. package/es2021.en/jodit.fat.min.css +1 -1
  181. package/es2021.en/jodit.fat.min.js +10 -10
  182. package/es2021.en/jodit.js +9 -6
  183. package/es2021.en/jodit.min.css +1 -1
  184. package/es2021.en/jodit.min.js +3 -3
  185. package/es2021.en/plugins/ai-assistant-pro/ai-assistant-pro.css +1 -1
  186. package/es2021.en/plugins/ai-assistant-pro/ai-assistant-pro.js +1 -1
  187. package/es2021.en/plugins/ai-assistant-pro/ai-assistant-pro.min.js +1 -1
  188. package/es2021.en/plugins/autocomplete/autocomplete.css +1 -1
  189. package/es2021.en/plugins/autocomplete/autocomplete.js +1 -1
  190. package/es2021.en/plugins/autocomplete/autocomplete.min.js +1 -1
  191. package/es2021.en/plugins/backup/backup.css +1 -1
  192. package/es2021.en/plugins/backup/backup.js +1 -1
  193. package/es2021.en/plugins/backup/backup.min.js +1 -1
  194. package/es2021.en/plugins/button-generator/button-generator.css +1 -1
  195. package/es2021.en/plugins/button-generator/button-generator.js +1 -1
  196. package/es2021.en/plugins/button-generator/button-generator.min.js +1 -1
  197. package/es2021.en/plugins/change-case/change-case.js +1 -1
  198. package/es2021.en/plugins/change-case/change-case.min.js +1 -1
  199. package/es2021.en/plugins/color-picker/color-picker.css +1 -1
  200. package/es2021.en/plugins/color-picker/color-picker.js +1 -1
  201. package/es2021.en/plugins/color-picker/color-picker.min.js +1 -1
  202. package/es2021.en/plugins/emoji/emoji.css +1 -1
  203. package/es2021.en/plugins/emoji/emoji.js +1 -1
  204. package/es2021.en/plugins/emoji/emoji.min.js +1 -1
  205. package/es2021.en/plugins/export-docs/export-docs.js +1 -1
  206. package/es2021.en/plugins/export-docs/export-docs.min.js +1 -1
  207. package/es2021.en/plugins/finder/finder.css +4 -1
  208. package/es2021.en/plugins/finder/finder.js +491 -110
  209. package/es2021.en/plugins/finder/finder.min.css +1 -1
  210. package/es2021.en/plugins/finder/finder.min.js +13 -13
  211. package/es2021.en/plugins/google-maps/google-maps.css +1 -1
  212. package/es2021.en/plugins/google-maps/google-maps.js +1 -1
  213. package/es2021.en/plugins/google-maps/google-maps.min.js +1 -1
  214. package/es2021.en/plugins/google-search/google-search.js +1 -1
  215. package/es2021.en/plugins/google-search/google-search.min.js +1 -1
  216. package/es2021.en/plugins/highlight-signature/highlight-signature.js +1 -1
  217. package/es2021.en/plugins/highlight-signature/highlight-signature.min.js +1 -1
  218. package/es2021.en/plugins/iframe-editor/iframe-editor.css +1 -1
  219. package/es2021.en/plugins/iframe-editor/iframe-editor.js +1 -1
  220. package/es2021.en/plugins/iframe-editor/iframe-editor.min.js +1 -1
  221. package/es2021.en/plugins/image-editor-pro/image-editor-pro.css +1 -1
  222. package/es2021.en/plugins/image-editor-pro/image-editor-pro.js +29 -11
  223. package/es2021.en/plugins/image-editor-pro/image-editor-pro.min.js +4 -4
  224. package/es2021.en/plugins/keyboard/keyboard.css +1 -1
  225. package/es2021.en/plugins/keyboard/keyboard.js +1 -1
  226. package/es2021.en/plugins/keyboard/keyboard.min.js +1 -1
  227. package/es2021.en/plugins/mobile-view/mobile-view.js +1 -1
  228. package/es2021.en/plugins/mobile-view/mobile-view.min.js +1 -1
  229. package/es2021.en/plugins/page-break/page-break.js +1 -1
  230. package/es2021.en/plugins/page-break/page-break.min.js +1 -1
  231. package/es2021.en/plugins/paste-code/paste-code.css +1 -1
  232. package/es2021.en/plugins/paste-code/paste-code.js +1 -1
  233. package/es2021.en/plugins/paste-code/paste-code.min.js +1 -1
  234. package/es2021.en/plugins/paste-from-word/paste-from-word.js +1 -1
  235. package/es2021.en/plugins/paste-from-word/paste-from-word.min.js +1 -1
  236. package/es2021.en/plugins/show-blocks/show-blocks.js +1 -1
  237. package/es2021.en/plugins/show-blocks/show-blocks.min.js +1 -1
  238. package/es2021.en/plugins/style/style.css +1 -1
  239. package/es2021.en/plugins/style/style.js +1 -1
  240. package/es2021.en/plugins/style/style.min.js +1 -1
  241. package/es2021.en/plugins/templates/templates.css +1 -1
  242. package/es2021.en/plugins/templates/templates.js +1 -1
  243. package/es2021.en/plugins/templates/templates.min.js +1 -1
  244. package/es2021.en/plugins/todo-list/todo-list.css +1 -1
  245. package/es2021.en/plugins/todo-list/todo-list.js +1 -1
  246. package/es2021.en/plugins/todo-list/todo-list.min.js +1 -1
  247. package/es2021.en/plugins/translate/translate.css +1 -1
  248. package/es2021.en/plugins/translate/translate.js +1 -1
  249. package/es2021.en/plugins/translate/translate.min.js +1 -1
  250. package/es2021.en/plugins/tune-block/tune-block.css +1 -1
  251. package/es2021.en/plugins/tune-block/tune-block.js +1 -1
  252. package/es2021.en/plugins/tune-block/tune-block.min.js +1 -1
  253. package/es5/jodit.css +3 -3
  254. package/es5/jodit.fat.min.css +1 -1
  255. package/es5/jodit.fat.min.js +2 -2
  256. package/es5/jodit.js +9 -7
  257. package/es5/jodit.min.css +3 -3
  258. package/es5/jodit.min.js +2 -2
  259. package/es5/plugins/ai-assistant-pro/ai-assistant-pro.css +1 -1
  260. package/es5/plugins/ai-assistant-pro/ai-assistant-pro.js +1 -1
  261. package/es5/plugins/ai-assistant-pro/ai-assistant-pro.min.js +1 -1
  262. package/es5/plugins/autocomplete/autocomplete.css +1 -1
  263. package/es5/plugins/autocomplete/autocomplete.js +1 -1
  264. package/es5/plugins/autocomplete/autocomplete.min.js +1 -1
  265. package/es5/plugins/backup/backup.css +1 -1
  266. package/es5/plugins/backup/backup.js +1 -1
  267. package/es5/plugins/backup/backup.min.js +1 -1
  268. package/es5/plugins/button-generator/button-generator.css +1 -1
  269. package/es5/plugins/button-generator/button-generator.js +1 -1
  270. package/es5/plugins/button-generator/button-generator.min.js +1 -1
  271. package/es5/plugins/change-case/change-case.js +1 -1
  272. package/es5/plugins/change-case/change-case.min.js +1 -1
  273. package/es5/plugins/color-picker/color-picker.css +1 -1
  274. package/es5/plugins/color-picker/color-picker.js +1 -1
  275. package/es5/plugins/color-picker/color-picker.min.js +1 -1
  276. package/es5/plugins/emoji/emoji.css +1 -1
  277. package/es5/plugins/emoji/emoji.js +1 -1
  278. package/es5/plugins/emoji/emoji.min.js +1 -1
  279. package/es5/plugins/export-docs/export-docs.js +1 -1
  280. package/es5/plugins/export-docs/export-docs.min.js +1 -1
  281. package/es5/plugins/finder/finder.css +4 -1
  282. package/es5/plugins/finder/finder.js +701 -116
  283. package/es5/plugins/finder/finder.min.css +1 -1
  284. package/es5/plugins/finder/finder.min.js +2 -2
  285. package/es5/plugins/google-maps/google-maps.css +1 -1
  286. package/es5/plugins/google-maps/google-maps.js +1 -1
  287. package/es5/plugins/google-maps/google-maps.min.js +1 -1
  288. package/es5/plugins/google-search/google-search.js +1 -1
  289. package/es5/plugins/google-search/google-search.min.js +1 -1
  290. package/es5/plugins/highlight-signature/highlight-signature.js +1 -1
  291. package/es5/plugins/highlight-signature/highlight-signature.min.js +1 -1
  292. package/es5/plugins/iframe-editor/iframe-editor.css +1 -1
  293. package/es5/plugins/iframe-editor/iframe-editor.js +1 -1
  294. package/es5/plugins/iframe-editor/iframe-editor.min.js +1 -1
  295. package/es5/plugins/image-editor-pro/image-editor-pro.css +1 -1
  296. package/es5/plugins/image-editor-pro/image-editor-pro.js +30 -12
  297. package/es5/plugins/image-editor-pro/image-editor-pro.min.js +2 -2
  298. package/es5/plugins/keyboard/keyboard.css +1 -1
  299. package/es5/plugins/keyboard/keyboard.js +1 -1
  300. package/es5/plugins/keyboard/keyboard.min.js +1 -1
  301. package/es5/plugins/mobile-view/mobile-view.js +1 -1
  302. package/es5/plugins/mobile-view/mobile-view.min.js +1 -1
  303. package/es5/plugins/page-break/page-break.js +1 -1
  304. package/es5/plugins/page-break/page-break.min.js +1 -1
  305. package/es5/plugins/paste-code/paste-code.css +1 -1
  306. package/es5/plugins/paste-code/paste-code.js +1 -1
  307. package/es5/plugins/paste-code/paste-code.min.js +1 -1
  308. package/es5/plugins/paste-from-word/paste-from-word.js +1 -1
  309. package/es5/plugins/paste-from-word/paste-from-word.min.js +1 -1
  310. package/es5/plugins/show-blocks/show-blocks.js +1 -1
  311. package/es5/plugins/show-blocks/show-blocks.min.js +1 -1
  312. package/es5/plugins/style/style.css +1 -1
  313. package/es5/plugins/style/style.js +1 -1
  314. package/es5/plugins/style/style.min.js +1 -1
  315. package/es5/plugins/templates/templates.css +1 -1
  316. package/es5/plugins/templates/templates.js +1 -1
  317. package/es5/plugins/templates/templates.min.js +1 -1
  318. package/es5/plugins/todo-list/todo-list.css +1 -1
  319. package/es5/plugins/todo-list/todo-list.js +1 -1
  320. package/es5/plugins/todo-list/todo-list.min.js +1 -1
  321. package/es5/plugins/translate/translate.css +1 -1
  322. package/es5/plugins/translate/translate.js +1 -1
  323. package/es5/plugins/translate/translate.min.js +1 -1
  324. package/es5/plugins/tune-block/tune-block.css +1 -1
  325. package/es5/plugins/tune-block/tune-block.js +1 -1
  326. package/es5/plugins/tune-block/tune-block.min.js +1 -1
  327. package/es5/polyfills.fat.min.js +1 -1
  328. package/es5/polyfills.js +1 -1
  329. package/es5/polyfills.min.js +1 -1
  330. package/esm/plugins/finder/browser.d.ts +21 -3
  331. package/esm/plugins/finder/browser.js +1 -1
  332. package/esm/plugins/finder/config.js +1 -1
  333. package/esm/plugins/finder/helpers/context-menu.d.ts +6 -0
  334. package/esm/plugins/finder/helpers/context-menu.js +1 -1
  335. package/esm/plugins/finder/helpers/data-provider.d.ts +26 -0
  336. package/esm/plugins/finder/helpers/data-provider.js +1 -0
  337. package/esm/plugins/finder/helpers/helpers.d.ts +27 -0
  338. package/esm/plugins/finder/helpers/helpers.js +1 -1
  339. package/esm/plugins/finder/helpers/persistent-store.d.ts +13 -8
  340. package/esm/plugins/finder/helpers/persistent-store.js +1 -1
  341. package/esm/plugins/finder/interface.d.ts +24 -1
  342. package/esm/plugins/finder/langs/de.d.ts +9 -0
  343. package/esm/plugins/finder/langs/de.js +1 -1
  344. package/esm/plugins/finder/langs/ru.d.ts +9 -0
  345. package/esm/plugins/finder/langs/ru.js +1 -1
  346. package/esm/plugins/finder/ui/header/header.d.ts +7 -1
  347. package/esm/plugins/finder/ui/header/header.js +1 -1
  348. package/esm/plugins/finder/ui/panel/panel.d.ts +5 -0
  349. package/esm/plugins/finder/ui/panel/panel.js +2 -2
  350. package/esm/plugins/finder/ui/virtual-scroll/virtual-scroll.d.ts +5 -0
  351. package/esm/plugins/finder/ui/virtual-scroll/virtual-scroll.js +2 -2
  352. package/esm/plugins/image-editor-pro/adapter.js +1 -1
  353. package/esm/plugins/image-editor-pro/image-editor-pro.js +1 -1
  354. package/package.json +1 -1
  355. package/types/plugins/finder/browser.d.ts +21 -3
  356. package/types/plugins/finder/helpers/context-menu.d.ts +6 -0
  357. package/types/plugins/finder/helpers/data-provider.d.ts +26 -0
  358. package/types/plugins/finder/helpers/helpers.d.ts +27 -0
  359. package/types/plugins/finder/helpers/persistent-store.d.ts +13 -8
  360. package/types/plugins/finder/interface.d.ts +24 -1
  361. package/types/plugins/finder/langs/de.d.ts +9 -0
  362. package/types/plugins/finder/langs/ru.d.ts +9 -0
  363. package/types/plugins/finder/ui/header/header.d.ts +7 -1
  364. package/types/plugins/finder/ui/panel/panel.d.ts +5 -0
  365. package/types/plugins/finder/ui/virtual-scroll/virtual-scroll.d.ts +5 -0
@@ -1,8 +1,8 @@
1
1
  /*!
2
2
  * jodit-pro - PRO Version of Jodit Editor
3
3
  * Author: Chupurnov Valerii <chupurnov@gmail.com>
4
- * Version: v4.13.5
4
+ * Version: v4.13.8
5
5
  * Url: https://xdsoft.net/jodit/pro/
6
6
  * License(s): SEE LICENSE IN LICENSE.md
7
7
  */
8
- "use strict";!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var n=t();for(var i in n)("object"==typeof exports?exports:e)[i]=n[i]}}(self,function(){return(self.webpackChunkjodit_pro=self.webpackChunkjodit_pro||[]).push([[918],{76542:function(e,t,n){n.d(t,{ProImageEditor:function(){return m}});var i=n(77688),r=n(80294),a=n(20616),o=n(67709),s=n(82749),l=n(18766),u=n(2868),c=n(43284),h=n(62361),d=n(85013),f=n(6441),p=n(91907),g=n(10830),b=n(78584),m=function(e){function t(){var e;return(0,a._)(this,t),e=(0,r._)(this,t,arguments),(0,s._)(e,"isProImageEditor",!0),e}return(0,l._)(t,e),(0,o._)(t,[{key:"className",value:function(){return"ImageEditorPro"}},{key:"open",value:function(e,t){return(0,i._)(function(){var n,i,r,a,o,s,l,c,p,g;return(0,h._)(this,function(h){switch(h.label){case 0:n=this,i=this.j,r=f.Config.defaultOptions.imageEditorPro,(a=i.c.div("jodit-image-editor-pro")).style.width="100%",a.style.height="100%",(o=new b.Dialog({language:i.o.language})).setSize(r.dialog.width,r.dialog.height),o.setContent(a),o.open(),s=null,l=null,c=function(){null==l||l(),l=null,null==s||s.destroy(),s=null,o.close()},o.e.on("beforeClose",function(){null==l||l(),l=null,null==s||s.destroy(),s=null}),s=new d.ImageEditor({container:a,state:{showToolbar:!1,status:"loading"},onSave:function(i){n.persist(s,e,void 0,i,t,c)},onSaveAs:function(i){n.saveAs(s,e,i,t,c)}}),l=this.mountToolbar(o,s),h.label=1;case 1:return h.trys.push([1,4,,5]),[4,this.loadImage(e)];case 2:return p=h.sent(),[4,s.fromBlob(p)];case 3:return h.sent(),[3,5];case 4:return g=h.sent(),null==s||s.update({status:"error",error:(0,u._)(g,Error)?g.message:String(g)}),this.error(g),[3,5];case 5:return[2]}})}).call(this)}},{key:"mountToolbar",value:function(e,t){var n=this.j,i=(0,g.Button)(n,{icon:{name:"save"},text:n.i18n("Save")},"primary"),r=(0,g.Button)(n,{icon:{name:"save"},name:"save-as",text:n.i18n("Save as")}),a=n.c.span("jodit-image-editor-pro__size"),o=(0,g.Button)(n,d.ICONS.minus),s=n.c.span("jodit-image-editor-pro__zoom"),l=(0,g.Button)(n,d.ICONS.plus),u=(0,g.Button)(n,"update",n.i18n("Reset")),c=(0,g.Button)(n,"undo",n.i18n("Undo")),h=(0,g.Button)(n,"redo",n.i18n("Redo"));o.setState({tooltip:"Zoom out"}),l.setState({tooltip:"Zoom in"});var f=null;i.onAction(function(){f=i,t.save()}),r.onAction(function(){f=r,t.saveAs()}),o.onAction(function(){return t.update({zoom:t.state.zoom/1.2})}),l.onAction(function(){return t.update({zoom:1.2*t.state.zoom})}),u.onAction(function(){return t.reset()}),c.onAction(function(){return t.update({history:{step:-1}})}),h.onAction(function(){return t.update({history:{step:1}})});var p=function(){for(var e=arguments.length,t=Array(e),i=0;e>i;i++)t[i]=arguments[i];var r=n.c.div("jodit-image-editor-pro__group");return r.style.display="flex",r.style.alignItems="center",r.style.gap="4px",t.forEach(function(e){return r.appendChild(e)}),r},b=n.c.div("jodit-image-editor-pro__toolbar");b.style.display="flex",b.style.alignItems="center",b.style.gap="12px",b.style.width="100%",a.style.opacity="0.75",s.style.minWidth="3.5em",s.style.textAlign="center",b.appendChild(p(i.container,r.container)),b.appendChild(p(a,o.container,s,l.container));var m=p(u.container,c.container,h.container);m.style.marginLeft="auto",b.appendChild(m),e.setHeader(b);var y="jodit-image-editor-pro__button_busy",x=function(e){var t=d.selectors.selectOutputSize(e),n="exporting"===e.status,o=n||"loading"===e.status,l=e.busyVisible,p=n&&(null==l||l);n||(f=null),i.setState({disabled:!e.source||o}),r.setState({disabled:!e.source||o}),i.container.classList.toggle(y,p&&f!==r),r.container.classList.toggle(y,p&&f===r),u.setState({disabled:!d.selectors.selectIsDirty(e)}),c.setState({disabled:!d.selectors.selectCanUndo(e)}),h.setState({disabled:!d.selectors.selectCanRedo(e)}),a.textContent=t?"".concat(t.width," \xd7 ").concat(t.height):"";var g=d.selectors.selectViewportFit(e),b=g?Math.round(100*g.scale):Math.round(100*e.zoom);s.textContent="".concat(b,"%")};x(t.state);var w=t.store.subscribe(x);return function(){w(),[i,r,o,l,u,c,h].forEach(function(e){return e.destruct()})}}},{key:"saveAs",value:function(e,t,n,i,r){var a=this;this.j.prompt("Enter new name","Save in new file",function(o){var s=(o||"").trim();if(!s)return a.j.alert("The name should not be empty"),!1;a.persist(e,t,s,n,i,r)})}},{key:"persist",value:function(e,t,n,r,a,o){return(0,i._)(function(){var i,s,l,u,c,d,f;return(0,h._)(this,function(h){switch(h.label){case 0:i=this,null==e||e.update({status:"exporting"}),h.label=1;case 1:return h.trys.push([1,4,,5]),[4,this.blobSize(r)];case 2:return l=(s=h.sent()).w,u=s.h,[4,this.uploadEdited(t,r,n)];case 3:return c=h.sent(),d=function(){o(),i.j.e.fire("update.filebrowser")},a(n,this.coreSupportsSaved()?{action:"saved",box:{w:l,h:u},newPath:c||void 0}:{action:"resize",box:{w:l,h:u}},d,function(e){o(),i.error(e)}),[3,5];case 4:return f=h.sent(),o(),this.error(f),[3,5];case 5:return[2]}})}).call(this)}},{key:"uploadEdited",value:function(e,t,n){return(0,i._)(function(){var i,r,a,o,s,l,u,c,d,f,p;return(0,h._)(this,function(h){switch(h.label){case 0:return[4,this.j.dataProvider.getPathByUrl(e)];case 1:if(o=(a=h.sent()).source,s=a.path,l=a.name,!(u=this.connectorUrl()))throw Error("No connector configured for imageSave");return c=String(n||l||"image.png"),(d=new FormData).append("action","imageSave"),d.append("source",String(null!=o?o:"")),d.append("path",String(null!=s?s:"")),d.append("name",c),d.append("files[0]",t,c),f=u.includes("?")?"&":"?",[4,fetch("".concat(u).concat(f,"action=imageSave"),{method:"POST",body:d,credentials:"include"})];case 2:return[4,h.sent().json()];case 3:if(!(p=h.sent()).success)throw Error(p.message||"Failed to save the edited image");return[2,null!=(i=null==(r=p.data)?void 0:r.newPath)?i:""]}})}).call(this)}},{key:"coreSupportsSaved",value:function(){var e=this.j.getVersion?this.j.getVersion():"",t=(0,c._)(e.split(".").map(function(e){return parseInt(e,10)||0}),3),n=t[0],i=void 0===n?0:n,r=t[1],a=void 0===r?0:r,o=t[2];return i>4||4===i&&(a>12||12===a&&(void 0===o?0:o)>=34)}},{key:"connectorUrl",value:function(){var e,t,n=null==(e=this.j.o.ajax)?void 0:e.url,i=null==(t=this.j.o.uploader)?void 0:t.url;return"string"==typeof n&&n?n:"string"==typeof i&&i?i:""}},{key:"loadImage",value:function(e){return(0,i._)(function(){var t,n,i;return(0,h._)(this,function(r){switch(r.label){case 0:if(!(t=this.connectorUrl()))return[3,4];r.label=1;case 1:return r.trys.push([1,3,,4]),[4,this.loadViaConnector(t,e)];case 2:return[2,r.sent()];case 3:return r.sent(),[3,4];case 4:return n=e.includes("?")?"&":"?",[4,fetch("".concat(e).concat(n,"_tst=").concat(Date.now()),{credentials:"include"})];case 5:if(!(i=r.sent()).ok)throw Error("Failed to load image (".concat(i.status,")"));return[2,i.blob()]}})}).call(this)}},{key:"loadViaConnector",value:function(e,t){return(0,i._)(function(){var n,i,r,a,o,s,l,u;return(0,h._)(this,function(c){switch(c.label){case 0:return[4,this.j.dataProvider.getPathByUrl(t)];case 1:return r=(i=c.sent()).source,a=i.path,o=i.name,(s=new FormData).append("action","imageLoad"),s.append("source",String(null!=r?r:"")),s.append("path",String(null!=a?a:"")),s.append("name",String(null!=o?o:"")),l=e.includes("?")?"&":"?",[4,fetch("".concat(e).concat(l,"action=imageLoad"),{method:"POST",body:s,credentials:"include"})];case 2:return[4,c.sent().json()];case 3:if(!(u=c.sent()).success||!(null==(n=u.data)?void 0:n.content))throw Error(u.message||"Failed to load the image");return[4,fetch(u.data.content)];case 4:return[2,c.sent().blob()]}})}).call(this)}},{key:"blobSize",value:function(e){return(0,i._)(function(){var t,n;return(0,h._)(this,function(i){switch(i.label){case 0:return[4,createImageBitmap(e)];case 1:return n={w:(t=i.sent()).width,h:t.height},t.close(),[2,n]}})})()}},{key:"error",value:function(e){this.j.e.fire("errorMessage",e.message)}}]),t}(p.ViewComponent)},45719:function(e,t,n){n(6441).Config.prototype.imageEditorPro={dialog:{width:"90%",height:"90%"}}},98270:function(e,t,n){n.r(t),n.d(t,{imageEditorPro:function(){return d}});var i=n(80294),r=n(20616),a=n(67709),o=n(82749),s=n(18766),l=n(23078);n(45719);var u=n(76542),c=n(50911),h=n(2692),d=function(e){function t(){return(0,r._)(this,t),(0,i._)(this,t,arguments)}return(0,s._)(t,e),(0,a._)(t,[{key:"afterInit",value:function(e){h.JoditPro.modules.ImageEditor=u.ProImageEditor}},{key:"beforeDestruct",value:function(e){}}]),t}((0,l._)(c.Plugin));(0,o._)(d,"requires",["license"]),h.JoditPro.plugins.add("imageEditorPro",d)},85013:function(e,t,n){function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=Array(t);t>n;n++)i[n]=e[n];return i}function r(e,t,n,i,r,a,o){try{var s=e[a](o),l=s.value}catch(e){n(e);return}s.done?t(l):Promise.resolve(l).then(i,r)}function a(e){return function(){var t=this,n=arguments;return new Promise(function(i,a){var o=e.apply(t,n);function s(e){r(o,i,a,s,l,"next",e)}function l(e){r(o,i,a,s,l,"throw",e)}s(void 0)})}}function o(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}function s(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function l(e,t,n){return t&&s(e.prototype,t),n&&s(e,n),e}function u(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function c(e,t){return null!=t&&"u">typeof Symbol&&t[Symbol.hasInstance]?!!t[Symbol.hasInstance](e):e instanceof t}function h(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},i=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(i=i.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),i.forEach(function(t){u(e,t,n[t])})}return e}function d(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}function f(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,i,r=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var a=[],o=!0,s=!1;try{for(r=r.call(e);!(o=(n=r.next()).done)&&(a.push(n.value),!t||a.length!==t);o=!0);}catch(e){s=!0,i=e}finally{try{o||null==r.return||r.return()}finally{if(s)throw i}}return a}}(e,t)||b(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function p(e){return function(e){if(Array.isArray(e))return i(e)}(e)||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||b(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function g(e){return e&&"u">typeof Symbol&&e.constructor===Symbol?"symbol":typeof e}function b(e,t){if(e){if("string"==typeof e)return i(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return i(e,t)}}function m(e,t){var n,i,r,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]},o=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),s=Object.defineProperty;return s(o,"next",{value:l(0)}),s(o,"throw",{value:l(1)}),s(o,"return",{value:l(2)}),"function"==typeof Symbol&&s(o,Symbol.iterator,{value:function(){return this}}),o;function l(s){return function(l){var u=[s,l];if(n)throw TypeError("Generator is already executing.");for(;o&&(o=0,u[0]&&(a=0)),a;)try{if(n=1,i&&(r=2&u[0]?i.return:u[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,u[1])).done)return r;switch(i=0,r&&(u=[2&u[0],r.value]),u[0]){case 0:case 1:r=u;break;case 4:return a.label++,{value:u[1],done:!1};case 5:a.label++,i=u[1],u=[0];continue;case 7:u=a.ops.pop(),a.trys.pop();continue;default:if(!(r=(r=a.trys).length>0&&r[r.length-1])&&(6===u[0]||2===u[0])){a=0;continue}if(3===u[0]&&(!r||u[1]>r[0]&&u[1]<r[3])){a.label=u[1];break}if(6===u[0]&&a.label<r[1]){a.label=r[1],r=u;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(u);break}r[2]&&a.ops.pop(),a.trys.pop();continue}u=t.call(e,a)}catch(e){u=[6,e],i=0}finally{n=r=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}}n.d(t,{ICONS:function(){return eL},ImageEditor:function(){return e4},selectors:function(){return W}});try{if("u">typeof document){var y=document.createElement("style");y.appendChild(document.createTextNode("/*\n * Jodit Image Editor — design system & layout.\n *\n * Everything is scoped under `.jie` so the stylesheet can be injected into any\n * page without leaking. Tokens are CSS custom properties; switching `data-theme`\n * re-themes the whole tree. PostCSS handles nesting + autoprefixing.\n */\n\n.jie {\n /* palette */\n --jie-accent: #5b5fc7;\n --jie-accent-soft: #eceefb;\n --jie-bg: #ffffff;\n --jie-surface: #ffffff;\n --jie-stage: #f3f4f8;\n --jie-border: #e6e8ef;\n --jie-text: #1f2430;\n --jie-text-dim: #8a90a2;\n --jie-danger: #e0533d;\n --jie-shadow: 0 1px 2px rgba(20, 24, 40, 0.06), 0 8px 24px rgba(20, 24, 40, 0.06);\n\n /* sizing scale — one system for every control */\n --jie-control-h: 38px; /* shared height: buttons, inputs, selects, color, slider row */\n --jie-control-px: 12px; /* horizontal padding inside controls */\n --jie-icon: 20px; /* inline icon size (rail icons override to 24) */\n --jie-radius: 12px; /* cards / panels */\n --jie-radius-sm: 8px; /* controls */\n --jie-gap: 16px; /* between groups */\n --jie-gap-sm: 8px; /* between controls in a row */\n --jie-font-sm: 13px;\n --jie-font-md: 14px;\n --jie-rail-w: 92px;\n --jie-font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;\n\n position: relative;\n display: flex;\n flex-direction: column;\n width: 100%;\n height: 100%;\n min-height: 420px;\n box-sizing: border-box;\n font-family: var(--jie-font);\n color: var(--jie-text);\n background: var(--jie-bg);\n border: 1px solid var(--jie-border);\n border-radius: var(--jie-radius);\n overflow: hidden;\n -webkit-user-select: none;\n user-select: none;\n}\n\n.jie *,.jie *::before,.jie *::after {\n box-sizing: border-box;\n }\n\n.jie[data-theme='dark'] {\n --jie-accent: #8a8df0;\n --jie-accent-soft: #2a2d44;\n --jie-bg: #14161f;\n --jie-surface: #1b1e2a;\n --jie-stage: #0f1118;\n --jie-border: #2a2e3d;\n --jie-text: #e7e9f3;\n --jie-text-dim: #8b91a7;\n --jie-shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.4);\n }\n\n/* ---- top bar ------------------------------------------------------------ */\n.jie-topbar {\n display: flex;\n align-items: center;\n gap: var(--jie-gap);\n padding: 12px 16px;\n border-bottom: 1px solid var(--jie-border);\n background: var(--jie-surface);\n}\n\n.jie-topbar__save {\n display: flex;\n align-items: center;\n gap: 8px;\n}\n\n.jie-topbar__meta {\n display: flex;\n align-items: center;\n gap: 12px;\n margin: 0 auto;\n color: var(--jie-text-dim);\n font-size: 14px;\n}\n\n.jie-zoom {\n display: flex;\n align-items: center;\n gap: 6px;\n font-variant-numeric: tabular-nums;\n}\n\n.jie-topbar__actions {\n display: flex;\n align-items: center;\n gap: 4px;\n}\n\n/* ---- buttons ------------------------------------------------------------ */\n.jie-btn {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n gap: 6px;\n height: var(--jie-control-h);\n min-width: var(--jie-control-h); /* single-char buttons (B / I) stay square */\n padding: 0 var(--jie-control-px);\n font: inherit;\n font-size: var(--jie-font-md);\n font-weight: 600;\n line-height: 1;\n white-space: nowrap;\n color: var(--jie-text);\n background: transparent;\n border: 1px solid transparent;\n border-radius: var(--jie-radius-sm);\n cursor: pointer;\n transition:\n background 0.12s ease,\n color 0.12s ease,\n border-color 0.12s ease;\n}\n.jie-btn:hover:not(:disabled) {\n background: var(--jie-accent-soft);\n }\n.jie-btn:disabled {\n opacity: 0.4;\n cursor: default;\n }\n/* inline icons are smaller than the standalone rail icons */\n.jie-btn .jie-icon {\n width: var(--jie-icon);\n height: var(--jie-icon);\n }\n\n.jie-btn--primary {\n color: #fff;\n background: var(--jie-accent);\n padding-inline: 18px;\n}\n\n.jie-btn--primary:hover:not(:disabled) {\n background: color-mix(in srgb, var(--jie-accent) 88%, #000);\n }\n\n.jie-btn--icon {\n width: var(--jie-control-h);\n padding: 0;\n color: var(--jie-text-dim);\n}\n\n.jie-btn--icon:hover:not(:disabled) {\n color: var(--jie-text);\n }\n\n.jie-btn--active {\n color: var(--jie-accent);\n background: var(--jie-accent-soft);\n}\n\n/* text-style modifiers (the B / I annotation toggles) */\n.jie-btn--bold {\n font-weight: 800;\n}\n.jie-btn--italic {\n font-style: italic;\n font-family: Georgia, 'Times New Roman', serif;\n}\n\n.jie-icon {\n display: inline-flex;\n width: 24px;\n height: 24px;\n}\n\n.jie-icon svg {\n width: 100%;\n height: 100%;\n }\n\n/* ---- body / rail -------------------------------------------------------- */\n.jie-body {\n display: flex;\n flex: 1;\n min-height: 0;\n}\n\n.jie-rail {\n display: flex;\n flex-direction: column;\n gap: 6px;\n width: var(--jie-rail-w);\n padding: 14px 10px;\n border-right: 1px solid var(--jie-border);\n background: var(--jie-surface);\n overflow-y: auto;\n}\n\n.jie-tab {\n display: flex;\n flex-direction: column;\n align-items: center;\n gap: 6px;\n padding: 12px 6px;\n font-size: 12px;\n font-weight: 600;\n color: var(--jie-text-dim);\n background: transparent;\n border: 0;\n border-radius: var(--jie-radius-sm);\n cursor: pointer;\n transition:\n background 0.12s ease,\n color 0.12s ease;\n}\n\n.jie-tab:hover {\n background: var(--jie-accent-soft);\n }\n\n.jie-tab[aria-selected='true'] {\n color: var(--jie-accent);\n background: var(--jie-accent-soft);\n }\n\n/* ---- stage / preview ---------------------------------------------------- */\n.jie-stage {\n display: flex;\n flex: 1;\n flex-direction: column;\n min-width: 0;\n background: var(--jie-bg);\n}\n\n.jie-canvas-wrap {\n position: relative;\n flex: 1;\n margin: 16px;\n border-radius: var(--jie-radius);\n background: var(--jie-stage);\n overflow: hidden;\n touch-action: none;\n}\n\n.jie-canvas {\n position: absolute;\n inset: 0;\n width: 100%;\n height: 100%;\n display: block;\n}\n\n/* ---- transient status (loading / saving / error) ------------------------- */\n\n.jie-spinner {\n display: inline-block;\n flex: 0 0 auto;\n width: var(--jie-icon);\n height: var(--jie-icon);\n border: 2px solid currentColor;\n border-right-color: transparent;\n border-radius: 50%;\n animation: jie-spin 0.8s linear infinite;\n}\n\n@keyframes jie-spin {\n to {\n transform: rotate(360deg);\n }\n}\n\n/* Covers the canvas while the image is loading, or shows the load error. */\n.jie-overlay {\n position: absolute;\n inset: 0;\n z-index: 2;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n gap: var(--jie-gap-sm);\n font-size: var(--jie-font-md);\n color: var(--jie-text-dim);\n background: var(--jie-stage);\n}\n.jie-overlay .jie-spinner {\n width: 32px;\n height: 32px;\n border-width: 3px;\n color: var(--jie-accent);\n }\n\n.jie-overlay--error {\n color: var(--jie-danger);\n}\n\n.jie-overlay__detail {\n max-width: 80%;\n font-size: var(--jie-font-sm);\n text-align: center;\n color: var(--jie-text-dim);\n}\n\n/* crop overlay */\n.jie-crop {\n position: absolute;\n border: 1.5px dashed var(--jie-accent);\n box-shadow: 0 0 0 100vmax var(--jie-scrim, rgba(17, 24, 39, 0.45));\n transform-origin: center;\n cursor: move;\n}\n\n/*\n * Rotation knob, centred *above* the frame and connected by a short stem. The\n * preview keeps `VIEWPORT_PADDING` around the image, so the knob has room and is\n * never clipped — even for a full-image crop.\n */\n.jie-crop__rotate {\n position: absolute;\n left: 50%;\n top: -34px;\n width: 18px;\n height: 18px;\n margin-left: -9px;\n background: var(--jie-bg);\n border: 2px solid var(--jie-accent);\n border-radius: 50%;\n box-shadow: 0 1px 3px rgba(20, 24, 40, 0.3);\n cursor: grab;\n touch-action: none;\n\n /* stem runs from the knob's bottom (-16px) toward the frame, stopping ~5px\n short of the edge so it never touches/overlaps the dashed border */\n}\n.jie-crop__rotate::before {\n content: '';\n position: absolute;\n left: 50%;\n top: 18px;\n width: 2px;\n height: 11px;\n margin-left: -1px;\n background: var(--jie-accent);\n }\n.jie-crop__rotate:active {\n cursor: grabbing;\n }\n\n.jie-crop__handle {\n position: absolute;\n width: 14px;\n height: 14px;\n background: var(--jie-bg);\n border: 2px solid var(--jie-accent);\n border-radius: 50%;\n}\n\n.jie-crop__handle[data-h='nw'] {\n top: -7px;\n left: -7px;\n cursor: nwse-resize;\n }\n\n.jie-crop__handle[data-h='ne'] {\n top: -7px;\n right: -7px;\n cursor: nesw-resize;\n }\n\n.jie-crop__handle[data-h='sw'] {\n bottom: -7px;\n left: -7px;\n cursor: nesw-resize;\n }\n\n.jie-crop__handle[data-h='se'] {\n bottom: -7px;\n right: -7px;\n cursor: nwse-resize;\n }\n\n/* ---- bottom panel ------------------------------------------------------- */\n.jie-panel {\n display: flex;\n flex-direction: column;\n gap: 14px;\n align-items: center;\n padding: 14px 16px 20px;\n border-top: 1px solid var(--jie-border);\n background: var(--jie-surface);\n}\n\n/* a row of equal-height controls, centred on a shared baseline */\n.jie-toolrow {\n display: flex;\n flex-wrap: wrap;\n gap: var(--jie-gap-sm);\n align-items: center;\n justify-content: center;\n}\n\n/* a row of labelled (label-above) fields; inputs and buttons share a height,\n so aligning their bottoms keeps everything tidy */\n.jie-fieldrow {\n display: flex;\n flex-wrap: wrap;\n gap: var(--jie-gap);\n align-items: flex-end;\n justify-content: center;\n}\n\n.jie-field {\n display: flex;\n flex-direction: column;\n gap: 4px;\n font-size: var(--jie-font-sm);\n color: var(--jie-text-dim);\n}\n\n.jie-input,\n.jie-select {\n height: var(--jie-control-h);\n width: 120px;\n padding: 0 var(--jie-control-px);\n font: inherit;\n font-size: var(--jie-font-md);\n color: var(--jie-text);\n background: var(--jie-bg);\n border: 1px solid var(--jie-border);\n border-radius: var(--jie-radius-sm);\n}\n\n:is(.jie-input,.jie-select):focus {\n outline: 2px solid var(--jie-accent-soft);\n border-color: var(--jie-accent);\n }\n\n/* native colour input, normalised to the control height as a rounded swatch */\n/* colour picker: a swatch button that opens a popover of preset swatches */\n.jie-colorpicker {\n position: relative;\n display: inline-flex;\n}\n\n/* the trigger swatch (shows the current colour via inline `background`) */\n.jie-color {\n width: var(--jie-control-h);\n height: var(--jie-control-h);\n padding: 0;\n border: 1px solid var(--jie-border);\n border-radius: var(--jie-radius-sm);\n box-shadow: inset 0 0 0 2px var(--jie-bg);\n cursor: pointer;\n}\n\n.jie-popover__backdrop {\n position: fixed;\n inset: 0;\n z-index: 50;\n}\n\n.jie-popover {\n position: absolute;\n bottom: calc(100% + 8px);\n left: 50%;\n transform: translateX(-50%);\n z-index: 51;\n padding: 10px;\n background: var(--jie-surface);\n border: 1px solid var(--jie-border);\n border-radius: var(--jie-radius);\n box-shadow: var(--jie-shadow);\n}\n\n.jie-swatches {\n display: grid;\n grid-template-columns: repeat(6, 1fr);\n gap: 8px;\n}\n\n/* 3\xd73 position anchor grid */\n.jie-posgrid {\n display: grid;\n grid-template-columns: repeat(3, 1fr);\n gap: 2px;\n padding: 3px;\n background: var(--jie-bg);\n border: 1px solid var(--jie-border);\n border-radius: var(--jie-radius-sm);\n}\n\n.jie-posgrid__cell {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 22px;\n height: 22px;\n padding: 0;\n color: var(--jie-text-dim);\n background: transparent;\n border: 0;\n border-radius: 5px;\n cursor: pointer;\n}\n\n.jie-posgrid__cell .jie-icon {\n width: 16px;\n height: 16px;\n }\n\n.jie-posgrid__cell:hover {\n background: var(--jie-accent-soft);\n color: var(--jie-text);\n }\n\n.jie-posgrid__cell[aria-pressed='true'] {\n background: var(--jie-accent);\n color: #fff;\n }\n\n/* font selector */\n.jie-fontselect {\n position: relative;\n display: inline-flex;\n}\n\n.jie-fontselect__trigger {\n display: inline-flex;\n align-items: center;\n gap: 6px;\n height: var(--jie-control-h);\n min-width: 130px;\n padding: 0 10px;\n font: inherit;\n font-size: var(--jie-font-md);\n color: var(--jie-text);\n background: var(--jie-bg);\n border: 1px solid var(--jie-border);\n border-radius: var(--jie-radius-sm);\n cursor: pointer;\n}\n\n.jie-fontselect__trigger > span {\n flex: 1;\n text-align: left;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n\n.jie-fontselect__trigger .jie-icon {\n width: 16px;\n height: 16px;\n color: var(--jie-text-dim);\n flex: none;\n }\n\n.jie-fontlist {\n min-width: 180px;\n max-height: 260px;\n overflow-y: auto;\n padding: 6px;\n display: flex;\n flex-direction: column;\n gap: 2px;\n}\n\n.jie-fontlist__item {\n padding: 8px 10px;\n font-size: 15px;\n text-align: left;\n color: var(--jie-text);\n background: transparent;\n border: 0;\n border-radius: var(--jie-radius-sm);\n cursor: pointer;\n}\n\n.jie-fontlist__item:hover {\n background: var(--jie-accent-soft);\n }\n\n.jie-fontlist__item[aria-pressed='true'] {\n color: var(--jie-accent);\n background: var(--jie-accent-soft);\n }\n\n.jie-swatch {\n width: 28px;\n height: 28px;\n padding: 0;\n border: 1px solid var(--jie-border);\n border-radius: var(--jie-radius-sm);\n box-shadow: inset 0 0 0 2px var(--jie-surface);\n cursor: pointer;\n transition:\n transform 0.1s ease,\n box-shadow 0.1s ease;\n}\n\n.jie-swatch:hover {\n transform: scale(1.08);\n }\n\n.jie-swatch[aria-pressed='true'] {\n box-shadow:\n inset 0 0 0 2px var(--jie-surface),\n 0 0 0 2px var(--jie-accent);\n }\n\n/* slider — the whole control occupies the shared height and centres its track */\n.jie-slider {\n display: flex;\n align-items: center;\n gap: 10px;\n height: var(--jie-control-h);\n width: clamp(180px, 28vw, 300px);\n}\n\n.jie-slider__label {\n font-size: var(--jie-font-sm);\n color: var(--jie-text-dim);\n white-space: nowrap;\n}\n\n.jie-slider__value {\n min-width: 2.5ch;\n text-align: right;\n font-variant-numeric: tabular-nums;\n font-weight: 600;\n}\n\n/*\n * Fully custom range so it looks identical across evergreen browsers (the\n * native `accent-color` only themes the colour, not the track/thumb shapes).\n * The filled portion is driven by `--jie-range-fill` (set per render by the\n * slider component) on WebKit, and by the native `::-moz-range-progress` on\n * Firefox.\n */\n.jie-range {\n --jie-range-fill: 50%;\n appearance: none;\n flex: 1;\n min-width: 0;\n height: 16px; /* hit area */\n background: transparent;\n cursor: pointer;\n}\n.jie-range::-webkit-slider-runnable-track {\n height: 4px;\n border-radius: 999px;\n background: linear-gradient(\n to right,\n var(--jie-accent) var(--jie-range-fill),\n var(--jie-border) var(--jie-range-fill)\n );\n }\n.jie-range::-webkit-slider-thumb {\n appearance: none;\n margin-top: -6px; /* centre the 16px thumb on the 4px track */\n width: 16px;\n height: 16px;\n border-radius: 50%;\n background: var(--jie-accent);\n border: 2px solid var(--jie-bg);\n box-shadow: 0 1px 3px rgba(20, 24, 40, 0.25);\n }\n.jie-range::-moz-range-track {\n height: 4px;\n border-radius: 999px;\n background: var(--jie-border);\n }\n.jie-range::-moz-range-progress {\n height: 4px;\n border-radius: 999px;\n background: var(--jie-accent);\n }\n.jie-range::-moz-range-thumb {\n width: 16px;\n height: 16px;\n border-radius: 50%;\n background: var(--jie-accent);\n border: 2px solid var(--jie-bg);\n box-shadow: 0 1px 3px rgba(20, 24, 40, 0.25);\n }\n.jie-range:focus-visible {\n outline: none;\n }\n.jie-range:focus-visible::-webkit-slider-thumb {\n box-shadow: 0 0 0 4px var(--jie-accent-soft);\n }\n.jie-range:focus-visible::-moz-range-thumb {\n box-shadow: 0 0 0 4px var(--jie-accent-soft);\n }\n\n/* filter thumbnails */\n.jie-thumbs {\n display: flex;\n gap: 12px;\n width: 100%;\n padding-bottom: 4px;\n overflow-x: auto;\n justify-content: flex-start;\n}\n\n.jie-thumb {\n display: flex;\n flex-direction: column;\n gap: 6px;\n align-items: center;\n padding: 4px;\n font-size: 12px;\n color: var(--jie-text-dim);\n background: transparent;\n border: 0;\n cursor: pointer;\n}\n\n.jie-thumb canvas,.jie-thumb .jie-thumb__swatch {\n width: 76px;\n height: 56px;\n border-radius: var(--jie-radius-sm);\n border: 2px solid transparent;\n object-fit: cover;\n background: var(--jie-stage);\n }\n\n.jie-thumb[aria-pressed='true'] {\n color: var(--jie-accent);\n }\n\n.jie-thumb[aria-pressed='true'] canvas,.jie-thumb[aria-pressed='true'] .jie-thumb__swatch {\n border-color: var(--jie-accent);\n }\n\n/* ---- responsive / mobile ------------------------------------------------ */\n@media (max-width: 720px) {\n .jie {\n --jie-rail-w: 100%;\n }\n\n .jie-topbar__meta {\n display: none;\n }\n\n .jie-body {\n flex-direction: column-reverse;\n }\n\n .jie-rail {\n flex-direction: row;\n width: 100%;\n border-right: 0;\n border-top: 1px solid var(--jie-border);\n overflow-x: auto;\n }\n\n .jie-tab {\n flex: 0 0 auto;\n min-width: 72px;\n }\n\n .jie-canvas-wrap {\n margin: 10px;\n }\n\n .jie-input {\n width: 100px;\n }\n}\n\n@media (hover: none) {\n .jie-crop__handle {\n width: 22px;\n height: 22px;\n }\n}")),document.head.appendChild(y)}}catch(e){}var x=Object.freeze([{label:"Arial",value:"Arial, Helvetica, sans-serif"},{label:"Helvetica",value:"Helvetica, Arial, sans-serif"},{label:"Verdana",value:"Verdana, Geneva, sans-serif"},{label:"Tahoma",value:"Tahoma, Geneva, sans-serif"},{label:"Trebuchet MS",value:'"Trebuchet MS", Helvetica, sans-serif'},{label:"Times New Roman",value:'"Times New Roman", Times, serif'},{label:"Georgia",value:'Georgia, "Times New Roman", serif'},{label:"Courier New",value:'"Courier New", Courier, monospace'},{label:"Impact",value:"Impact, Haettenschweiler, sans-serif"}]),w=Object.freeze({brightness:0,contrast:0,saturation:0,warmth:0,blur:0}),j=Object.freeze(["#ffffff","#1a1a1a","#9e9689","#4a90e2","#54b98a","#f2c94c","#eb5757","#a29bfe","#8b5cf6","#f178b6","#f2994a","#b8e454","#7ec8f0","#5b6470","#d8d2c8","#eeeeee"]);function k(){return{flip:{horizontal:!1,vertical:!1},rotate:0,angle:0,crop:null,resize:null,finetune:h({},w),filter:"original",annotations:[],focus:null}}function S(){return{source:null,status:"idle",busyVisible:!1,error:null,activeTab:"adjust",activeTool:"crop",zoom:1,history:{entries:[k()],index:0},selectedAnnotationId:null,theme:"light",showToolbar:!0,locale:"en",minCropSize:8,minResizeSize:1,palette:p(j),fonts:x.map(function(e){return h({},e)}),activePopover:null,viewport:null}}function M(e){var t=e.entries[e.index];if(void 0===t)throw RangeError("history index ".concat(e.index," is out of bounds"));return t}function _(e,t){var n=e.entries.slice(0,e.index+1);n.push(t);var i=Math.max(0,n.length-100),r=i>0?n.slice(i):n;return{entries:r,index:r.length-1}}function C(e,t){var n=Math.min(Math.max(t,0),e.entries.length-1);return n===e.index?e:d(h({},e),{index:n})}function z(e,t){var n=e;if(void 0!==t.activeTab&&(n=T(n,{activeTab:t.activeTab})),void 0!==t.activeTool&&(n=T(n,{activeTool:t.activeTool})),void 0!==t.zoom&&(n=T(n,{zoom:!Number.isFinite(i=t.zoom)||i<=0?1:Math.min(Math.max(i,.01),64)})),void 0!==t.theme&&(n=T(n,{theme:t.theme})),void 0!==t.showToolbar&&(n=T(n,{showToolbar:t.showToolbar})),void 0!==t.locale&&(n=T(n,{locale:t.locale})),void 0!==t.minCropSize&&(n=T(n,{minCropSize:Math.max(1,t.minCropSize)})),void 0!==t.minResizeSize&&(n=T(n,{minResizeSize:Math.max(1,t.minResizeSize)})),void 0!==t.palette&&(n=T(n,{palette:t.palette})),void 0!==t.fonts&&(n=T(n,{fonts:t.fonts})),void 0!==t.activePopover&&(n=T(n,{activePopover:t.activePopover})),void 0!==t.status&&(n=T(n,{status:t.status}),"exporting"!==t.status&&n.busyVisible&&(n=T(n,{busyVisible:!1}))),void 0!==t.busyVisible&&(n=T(n,{busyVisible:t.busyVisible})),void 0!==t.error&&(n=T(n,{error:t.error})),void 0!==t.source&&(n=T(n,{source:t.source})),void 0!==t.viewport&&(n=T(n,{viewport:t.viewport})),void 0!==t.selectedAnnotationId&&(n=T(n,{selectedAnnotationId:t.selectedAnnotationId})),t.resetHistory&&(n=T(n,{history:{entries:[k()],index:0}})),t.resetDesign&&(n=T(n,{history:_(n.history,k())})),void 0!==t.design){var i,r,a,o,s,l=d(h({},r=M(n.history),a=t.design),{flip:a.flip?h({},r.flip,a.flip):r.flip,finetune:a.finetune?h({},r.finetune,a.finetune):r.finetune,rotate:void 0!==a.rotate?(90*Math.round(a.rotate/90)%360+360)%360:r.rotate}),u=!1===t.commit?((s=(o=n.history).entries.slice())[o.index]=l,{entries:s,index:o.index}):_(n.history,l);n=T(n,{history:u})}if(void 0!==t.history){var c,f,p=t.history,g="step"in p?(c=n.history,f=p.step,C(c,c.index+f)):C(n.history,p.index);n=T(n,{history:g})}return n}function T(e,t){var n=!0,i=!1,r=void 0;try{for(var a,o=Object.keys(t)[Symbol.iterator]();!(n=(a=o.next()).done);n=!0){var s=a.value;if(e[s]!==t[s])return h({},e,t)}}catch(e){i=!0,r=e}finally{try{n||null==o.return||o.return()}finally{if(i)throw r}}return e}var P=function(){function e(t,n){o(this,e),u(this,"pending",null),u(this,"handle",null),this.schedule=t,this.clear=n}return l(e,[{key:"request",value:function(e){var t=this;this.pending=e,null===this.handle&&(this.handle=this.schedule(function(){return t.flush()}))}},{key:"flush",value:function(){null!==this.handle&&(this.clear(this.handle),this.handle=null);var e=this.pending;this.pending=null,e&&e()}},{key:"cancel",value:function(){null!==this.handle&&(this.clear(this.handle),this.handle=null),this.pending=null}}]),e}(),A=function(){function e(){o(this,e),u(this,"pending",null)}return l(e,[{key:"request",value:function(e){this.pending=e,this.flush()}},{key:"flush",value:function(){var e=this.pending;this.pending=null,e&&e()}},{key:"cancel",value:function(){this.pending=null}}]),e}(),E=function(){function e(){var t,n,i,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};o(this,e),u(this,"state",void 0),u(this,"reducer",void 0),u(this,"scheduler",void 0),u(this,"listeners",new Set),u(this,"notifying",!1),this.state=null!=(t=r.initialState)?t:S(),this.reducer=null!=(n=r.reducer)?n:z,this.scheduler=null!=(i=r.scheduler)?i:new A}return l(e,[{key:"getState",value:function(){return this.state}},{key:"update",value:function(e){var t=this,n=this.reducer(this.state,e);return n!==this.state&&(this.state=n,this.scheduler.request(function(){return t.notify()})),this.state}},{key:"subscribe",value:function(e){var t=this;return this.listeners.add(e),function(){t.listeners.delete(e)}}},{key:"flush",value:function(){this.scheduler.flush()}},{key:"destroy",value:function(){this.scheduler.cancel(),this.listeners.clear()}},{key:"notify",value:function(){if(!this.notifying){this.notifying=!0;try{var e=!0,t=!1,n=void 0;try{for(var i,r=this.listeners[Symbol.iterator]();!(e=(i=r.next()).done);e=!0)(0,i.value)(this.state)}catch(e){t=!0,n=e}finally{try{e||null==r.return||r.return()}finally{if(t)throw n}}}finally{this.notifying=!1}}}}]),e}();function I(e,t,n){return Math.min(Math.max(e,t),n)}function O(e,t){var n=I(e.width,1,t.width),i=I(e.height,1,t.height);return{x:I(e.x,0,t.width-n),y:I(e.y,0,t.height-i),width:n,height:i}}function R(e){return M(e.history)}function B(e){return"adjust"===e.activeTab&&"crop"===e.activeTool}function D(e){var t=R(e);return B(e)?d(h({},t),{crop:null,angle:0}):t}function F(e){return e.history.index>0}function L(e){var t;return(t=e.history).index<t.entries.length-1}function V(e){return e.history.index>0||e.history.entries.length>1}function N(e){if(!e.source)return null;var t=R(e),n=e.source,i=n.width,r=n.height;return 90===t.rotate||270===t.rotate?{width:r,height:i}:{width:i,height:r}}function U(e){var t=R(e);return t.resize?t.resize:t.crop?{width:Math.round(t.crop.width),height:Math.round(t.crop.height)}:N(e)}function q(e){return B(e)?N(e):U(e)}function H(e){var t,n,i,r=q(e);if(!r||!e.viewport)return null;var a={width:Math.max(1,e.viewport.width-88),height:Math.max(1,e.viewport.height-88)},o=(t=Math.min(a.width/r.width,a.height/r.height)||0,n=r.width*t,i=r.height*t,{scale:t,width:n,height:i,offsetX:(a.width-n)/2,offsetY:(a.height-i)/2}).scale*e.zoom,s=r.width*o,l=r.height*o;return{scale:o,width:s,height:l,offsetX:(e.viewport.width-s)/2,offsetY:(e.viewport.height-l)/2,content:r}}function X(e){return R(e).angle}function Y(e){var t=R(e);if(t.crop)return t.crop;var n=N(e);return n?{x:0,y:0,width:n.width,height:n.height}:null}var W=Object.freeze(Object.defineProperty({__proto__:null,VIEWPORT_PADDING:44,selectCanRedo:L,selectCanUndo:F,selectCropAngle:X,selectDesign:R,selectEffectiveCrop:Y,selectIsCropping:B,selectIsDirty:V,selectOrientedSize:N,selectOutputSize:U,selectPreviewContentSize:q,selectPreviewDesign:D,selectViewportFit:H},Symbol.toStringTag,{value:"Module"})),Z=Math.PI/180,G={nw:[-1,-1],ne:[1,-1],sw:[-1,1],se:[1,1]};function K(e){return{x:e.x+e.width/2,y:e.y+e.height/2}}function J(e,t,n,i){var r=K(e),a=t*Z,o=Math.cos(a),s=Math.sin(a),l=n*e.width/2,u=i*e.height/2;return{x:r.x+l*o-u*s,y:r.y+l*s+u*o}}function $(e,t,n,i){return Math.atan2(i-t,n-e)/Z}function Q(e,t,n){et(e,"width"),et(t,"height");var i=e*t*4;if(n&&n.length!==i)throw RangeError("data length ".concat(n.length," does not match ").concat(e,"x").concat(t," (").concat(i,")"));return{width:e,height:t,data:null!=n?n:new Uint8ClampedArray(i)}}function ee(e,t,n){return(n*e.width+t)*4}function et(e,t){if(!Number.isInteger(e)||e<=0)throw RangeError("".concat(t," must be a positive integer, got ").concat(e))}function en(e,t){for(var n=Q(e.width,e.height),i=e.width,r=e.height,a=0;a<r;a++)for(var o=0;o<i;o++)er(e,ee(e,"horizontal"===t?i-1-o:o,"vertical"===t?r-1-a:a),n,ee(n,o,a));return n}function ei(e,t){var n=Math.max(1,Math.round(t.width)),i=Math.max(1,Math.round(t.height));if(n===e.width&&i===e.height)return Q(n,i,new Uint8ClampedArray(e.data));for(var r=e;r.width>=2*n;)r=function(e){for(var t=Math.ceil(e.width/2),n=Q(t,e.height),i=0;i<e.height;i++)for(var r=0;r<t;r++)for(var a=ee(e,2*r,i),o=ee(e,Math.min(2*r+1,e.width-1),i),s=ee(n,r,i),l=0;l<4;l++)n.data[s+l]=(e.data[a+l]+e.data[o+l])/2;return n}(r);for(;r.height>=2*i;)r=function(e){for(var t=Math.ceil(e.height/2),n=Q(e.width,t),i=0;i<t;i++)for(var r=0;r<e.width;r++)for(var a=ee(e,r,2*i),o=ee(e,r,Math.min(2*i+1,e.height-1)),s=ee(n,r,i),l=0;l<4;l++)n.data[s+l]=(e.data[a+l]+e.data[o+l])/2;return n}(r);return r.width===n&&r.height===i?Q(n,i,new Uint8ClampedArray(r.data)):function(e,t,n){for(var i=Q(t,n),r=e.width/t,a=e.height/n,o=0;o<n;o++)for(var s=(o+.5)*a-.5,l=Math.floor(s),u=s-l,c=ea(l,e.height),h=ea(l+1,e.height),d=0;d<t;d++)for(var f=(d+.5)*r-.5,p=Math.floor(f),g=f-p,b=ea(p,e.width),m=ea(p+1,e.width),y=ee(e,b,c),x=ee(e,m,c),w=ee(e,b,h),j=ee(e,m,h),k=ee(i,d,o),S=0;S<4;S++){var M,_,C,z,T,P=(M=e.data[y+S],_=e.data[x+S],M+(_-M)*g),A=(C=e.data[w+S],z=e.data[j+S],C+(z-C)*g);i.data[k+S]=(T=P)+(A-T)*u}return i}(r,n,i)}function er(e,t,n,i){n.data[i]=e.data[t],n.data[i+1]=e.data[t+1],n.data[i+2]=e.data[t+2],n.data[i+3]=e.data[t+3]}function ea(e,t){return e<0?0:e>=t?t-1:e}function eo(e,t){for(var n=Q(e.width,e.height,new Uint8ClampedArray(e.data)),i=0;i<n.data.length;i+=4)n.data[i]=t(n.data[i],0),n.data[i+1]=t(n.data[i+1],1),n.data[i+2]=t(n.data[i+2],2);return n}function es(e,t){if(0===t)return ev(e);var n=t/100*255;return eo(e,function(e){return e+n})}function el(e,t){if(0===t)return ev(e);var n=t/100*255,i=259*(n+255)/(255*(259-n));return eo(e,function(e){return i*(e-128)+128})}function eu(e,t){if(0===t)return ev(e);for(var n=1+t/100,i=Q(e.width,e.height,new Uint8ClampedArray(e.data)),r=0;r<i.data.length;r+=4){var a=i.data[r],o=i.data[r+1],s=i.data[r+2],l=.299*a+.587*o+.114*s;i.data[r]=l+(a-l)*n,i.data[r+1]=l+(o-l)*n,i.data[r+2]=l+(s-l)*n}return i}function ec(e,t){if(0===t)return ev(e);var n=t/100*40;return eo(e,function(e,t){return 0===t?e+n:2===t?e-n:e})}function eh(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:20,i=Math.round(Math.max(0,Math.min(100,t))/100*n);return i<=0?ev(e):ef(ef(e,i,"horizontal"),i,"vertical")}function ed(e,t){var n=e;return eh(n=ec(n=eu(n=el(n=es(n,t.brightness),t.contrast),t.saturation),t.warmth),t.blur)}function ef(e,t,n){for(var i=Q(e.width,e.height),r=e.width,a=e.height,o=e.data,s="horizontal"===n,l=s?a:r,u=s?r:a,c=2*t+1,h=0;l>h;h++)for(var d=0;d<4;d++){for(var f=0,p=-t;t>=p;p++)f+=ep(o,r,a,s,h,p,d);for(var g=0;u>g;g++){var b=(s?h*r+g:g*r+h)*4+d;i.data[b]=f/c;var m=ep(o,r,a,s,h,g-t,d);f+=ep(o,r,a,s,h,g+t+1,d)-m}}return i}function ep(e,t,n,i,r,a,o){var s=(i?t:n)-1,l=a<0?0:a>s?s:a;return e[(i?r*t+l:l*t+r)*4+o]}function ev(e){return Q(e.width,e.height,new Uint8ClampedArray(e.data))}function eg(e,t){for(var n=Q(e.width,e.height,new Uint8ClampedArray(e.data)),i=0;i<n.data.length;i+=4){var r=f(t(n.data[i],n.data[i+1],n.data[i+2]),3),a=r[0],o=r[1],s=r[2];n.data[i]=a,n.data[i+1]=o,n.data[i+2]=s}return n}Object.freeze(Object.defineProperty({__proto__:null,applyFinetune:ed,blur:eh,brightness:es,contrast:el,saturation:eu,warmth:ec},Symbol.toStringTag,{value:"Module"}));var eb=function(e){return Q(e.width,e.height,new Uint8ClampedArray(e.data))},em=new Map;function ey(e){return em.set(e.id,e),function(){em.get(e.id)===e&&em.delete(e.id)}}function ex(e,t){var n=em.get(t);return n?n.apply(e):eb(e)}function ew(e){return new ImageData(e.data,e.width,e.height)}[{id:"original",label:"Original",apply:eb},{id:"invert",label:"Invert",apply:function(e){return eg(e,function(e,t,n){return[255-e,255-t,255-n]})}},{id:"grayscale",label:"Black & White",apply:function(e){return eg(e,function(e,t,n){var i=.299*e+.587*t+.114*n;return[i,i,i]})}},{id:"sepia",label:"Sepia",apply:function(e){return eg(e,function(e,t,n){return[.393*e+.769*t+.189*n,.349*e+.686*t+.168*n,.272*e+.534*t+.131*n]})}},{id:"solarize",label:"Solarize",apply:function(e){return eg(e,function(e,t,n){return[e<128?e:255-e,t<128?t:255-t,n<128?n:255-n]})}},{id:"clarendon",label:"Clarendon",apply:function(e){return ec(eu(el(e,20),25),-10)}},{id:"gingham",label:"Gingham",apply:function(e){return ec(eu(el(e,-10),-15),12)}}].forEach(ey);var ej=function(){function e(){o(this,e),u(this,"locales",new Map)}return l(e,[{key:"register",value:function(e){var t=this,n=this.locales.get(e.id);return this.locales.set(e.id,h({},null!=n?n:{},e.messages)),function(){n?t.locales.set(e.id,n):t.locales.delete(e.id)}}},{key:"has",value:function(e){return this.locales.has(e)}},{key:"get",value:function(e){return this.locales.get(e)}},{key:"list",value:function(){return p(this.locales.keys())}},{key:"translator",value:function(e){var t;return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function(n,i){var r,a,o=null!=(r=null!=(a=e[n])?a:t[n])?r:n;return i?o.replace(/\{(\w+)\}/g,function(e,t){return t in i?String(i[t]):e}):o}}(null!=(t=this.locales.get(e))?t:{})}}]),e}(),ek=new Set(["value","checked","disabled","selected","innerHTML"]);function eS(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return{kind:"element",tag:e,key:t.key,props:t,children:function(e){var t=Array.isArray(e)?e:[e],n=[],i=!0,r=!1,a=void 0;try{for(var o,s=t[Symbol.iterator]();!(i=(o=s.next()).done);i=!0){var l=o.value;null!=l&&!1!==l&&!0!==l&&n.push((void 0===l?"undefined":g(l))==="object"?l:{kind:"text",text:String(l)})}}catch(e){r=!0,a=e}finally{try{i||null==s.return||s.return()}finally{if(r)throw a}}return n}(n)}}function eM(e){return"element"===e.kind}var e_={},eC=function(){function e(t,n){o(this,e),u(this,"events",new WeakMap),u(this,"prev",null),this.host=t,this.container=n}return l(e,[{key:"render",value:function(e){if(null===this.prev){var t=this.mount(e);this.host.insert(this.container,t,null)}else if(ez(this.prev,e))this.patch(this.prev,e);else{var n=this.mount(e),i=this.prev.node;this.host.insert(this.container,n,this.host.nextSibling(i)),this.host.remove(this.container,i)}this.prev=e}},{key:"unmount",value:function(){this.prev&&(this.host.remove(this.container,this.prev.node),this.prev=null)}},{key:"mount",value:function(e){if(!eM(e)){var t=this.host.createText(e.text);return e.node=t,t}var n=this.host.createElement(e.tag);e.node=n,this.applyProps(n,e_,e.props);var i=!0,r=!1,a=void 0;try{for(var o,s=e.children[Symbol.iterator]();!(i=(o=s.next()).done);i=!0){var l=o.value;this.host.insert(n,this.mount(l),null)}}catch(e){r=!0,a=e}finally{try{i||null==s.return||s.return()}finally{if(r)throw a}}return n}},{key:"patch",value:function(e,t){var n=e.node;return(t.node=n,eM(t)&&eM(e))?(this.applyProps(n,e.props,t.props),this.patchChildren(n,e.children,t.children)):eM(t)||t.text===e.text||this.host.setText(n,t.text),n}},{key:"applyProps",value:function(e,t,n){this.applyClass(e,t.class,n.class),this.applyStyle(e,null!=(o=t.style)?o:{},null!=(s=n.style)?s:{}),this.applyEvents(e,null!=(l=t.on)?l:{},null!=(u=n.on)?u:{});var i=!0,r=!1,a=void 0;try{for(var o,s,l,u,c,h=Object.keys(n)[Symbol.iterator]();!(i=(c=h.next()).done);i=!0){var d=c.value;if(!eT(d)){var f=n[d];f!==t[d]&&this.applyAttr(e,d,f)}}}catch(e){r=!0,a=e}finally{try{i||null==h.return||h.return()}finally{if(r)throw a}}var p=!0,g=!1,b=void 0;try{for(var m,y=Object.keys(t)[Symbol.iterator]();!(p=(m=y.next()).done);p=!0){var x=m.value;eT(x)||x in n||(ek.has(x)?this.host.setProperty(e,x,""):this.host.removeAttribute(e,x))}}catch(e){g=!0,b=e}finally{try{p||null==y.return||y.return()}finally{if(g)throw b}}}},{key:"applyAttr",value:function(e,t,n){var i;ek.has(t)?this.host.setProperty(e,t,n):!1===n||null==n?this.host.removeAttribute(e,t):this.host.setAttribute(e,t,!0===n?"":"string"==typeof n?n:"number"==typeof n||"boolean"==typeof n||(void 0===n?"undefined":g(n))==="bigint"?String(n):null!=(i=JSON.stringify(n))?i:"")}},{key:"applyClass",value:function(e,t,n){t!==n&&(n?this.host.setAttribute(e,"class",n):this.host.removeAttribute(e,"class"))}},{key:"applyStyle",value:function(e,t,n){var i=!0,r=!1,a=void 0;try{for(var o,s=Object.keys(n)[Symbol.iterator]();!(i=(o=s.next()).done);i=!0){var l=o.value;n[l]!==t[l]&&this.host.setStyle(e,l,String(n[l]))}}catch(e){r=!0,a=e}finally{try{i||null==s.return||s.return()}finally{if(r)throw a}}var u=!0,c=!1,h=void 0;try{for(var d,f=Object.keys(t)[Symbol.iterator]();!(u=(d=f.next()).done);u=!0){var p=d.value;p in n||this.host.removeStyle(e,p)}}catch(e){c=!0,h=e}finally{try{u||null==f.return||f.return()}finally{if(c)throw h}}}},{key:"applyEvents",value:function(e,t,n){var i=this.events.get(e),r=!0,a=!1,o=void 0;try{for(var s,l=Object.keys(t)[Symbol.iterator]();!(r=(s=l.next()).done);r=!0){var u=s.value;!(u in n)&&(null==i?void 0:i.has(u))&&(this.host.removeEventListener(e,u,i.get(u).wrapper),i.delete(u))}}catch(e){a=!0,o=e}finally{try{r||null==l.return||l.return()}finally{if(a)throw o}}var c=!0,h=!1,d=void 0;try{for(var f,p,g=Object.keys(n)[Symbol.iterator]();!(c=(p=g.next()).done);c=!0)f=this,function(){var t=p.value,r=n[t],a=null==i?void 0:i.get(t);if(a)return a.handler=r;i||(i=new Map,f.events.set(e,i));var o={handler:r,wrapper:function(e){return o.handler(e)}};i.set(t,o),f.host.addEventListener(e,t,o.wrapper)}()}catch(e){h=!0,d=e}finally{try{c||null==g.return||g.return()}finally{if(h)throw d}}}},{key:"patchChildren",value:function(e,t,n){for(var i=0,r=t.length-1,a=0,o=n.length-1,s=null;i<=r&&a<=o;){var l=t[i],u=t[r],c=n[a],h=n[o];if(ez(l,c)){this.patch(l,c),i++,a++;continue}if(ez(u,h)){this.patch(u,h),r--,o--;continue}if(ez(l,h)){this.patch(l,h),this.host.insert(e,l.node,this.host.nextSibling(u.node)),i++,o--;continue}if(ez(u,c)){this.patch(u,c),this.host.insert(e,u.node,l.node),r--,a++;continue}null!=s||(s=function(e,t,n){for(var i=new Map,r=t;r<=n;r++){var a=e[r].key;void 0!==a&&i.set(a,r)}return i}(t,i,r));var d=void 0!==c.key?s.get(c.key):void 0;if(void 0===d)this.host.insert(e,this.mount(c),l.node);else{var f=t[d];this.patch(f,c),f.node=void 0,this.host.insert(e,c.node,l.node)}a++}if(i>r)for(var p,g,b=null!=(p=null==(g=n[o+1])?void 0:g.node)?p:null,m=a;o>=m;m++)this.host.insert(e,this.mount(n[m]),b);else if(a>o)for(var y=i;r>=y;y++){var x=t[y].node;x&&this.host.remove(e,x)}}}]),e}();function ez(e,t){return e.kind===t.kind&&("text"===e.kind||e.tag===t.tag&&e.key===t.key)}function eT(e){return"key"===e||"class"===e||"style"===e||"on"===e}var eP=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document;o(this,e),this.doc=t}return l(e,[{key:"createElement",value:function(e){return this.doc.createElement(e)}},{key:"createText",value:function(e){return this.doc.createTextNode(e)}},{key:"setText",value:function(e,t){e.textContent=t}},{key:"insert",value:function(e,t,n){e.insertBefore(t,n)}},{key:"remove",value:function(e,t){t.parentNode===e&&e.removeChild(t)}},{key:"parent",value:function(e){return e.parentNode}},{key:"nextSibling",value:function(e){return e.nextSibling}},{key:"setAttribute",value:function(e,t,n){e.setAttribute(t,n)}},{key:"removeAttribute",value:function(e,t){e.removeAttribute(t)}},{key:"setProperty",value:function(e,t,n){e[t]=n}},{key:"setStyle",value:function(e,t,n){e.style.setProperty(t,n)}},{key:"removeStyle",value:function(e,t){e.style.removeProperty(t)}},{key:"addEventListener",value:function(e,t,n){e.addEventListener(t,n)}},{key:"removeEventListener",value:function(e,t,n){e.removeEventListener(t,n)}}]),e}(),eA=function(){function e(){o(this,e),u(this,"tools",new Map),u(this,"seq",0),u(this,"order",new Map)}return l(e,[{key:"register",value:function(t){var n,i=this;return this.tools.set(t.id,t),this.order.set(t.id,null!=(n=t.order)?n:e.UNORDERED_BASE+this.seq++),function(){i.tools.get(t.id)===t&&(i.tools.delete(t.id),i.order.delete(t.id))}}},{key:"get",value:function(e){return this.tools.get(e)}},{key:"has",value:function(e){return this.tools.has(e)}},{key:"list",value:function(){var e=this;return p(this.tools.values()).sort(function(t,n){var i,r;return(null!=(i=e.order.get(t.id))?i:0)-(null!=(r=e.order.get(n.id))?r:0)})}},{key:"first",value:function(){return this.list()[0]}}]),e}();function eE(e){return eS("span",{class:"jie-icon",innerHTML:e})}function eI(){return eS("span",{class:"jie-spinner"})}function eO(e){var t,n,i,r=["jie-btn"];"primary"===e.variant&&r.push("jie-btn--primary"),"icon"===e.variant&&r.push("jie-btn--icon"),e.active&&r.push("jie-btn--active"),e.busy&&r.push("jie-btn--busy"),e.className&&r.push(e.className);var a=[];return e.busy?a.push(eI()):e.icon&&a.push(eE(e.icon)),e.label&&a.push(eS("span",{},e.label)),eS("button",{key:e.key,class:r.join(" "),type:"button",disabled:null!=(t=e.disabled)&&t,title:null!=(n=null!=(i=e.title)?i:e.label)?n:"",on:{click:e.onClick}},a)}function eR(e){var t,n=e.onStart,i={input:function(t){return e.onInput(Number(t.target.value))}};n&&(i.pointerdown=function(){return n()});var r=e.max-e.min||1,a=Math.min(100,Math.max(0,(e.value-e.min)/r*100));return eS("div",{class:"jie-slider"},[eS("span",{class:"jie-slider__label"},e.label),eS("input",{class:"jie-range",type:"range",min:String(e.min),max:String(e.max),step:String(null!=(t=e.step)?t:1),value:String(e.value),style:{"--jie-range-fill":"".concat(a,"%")},on:i}),eS("span",{class:"jie-slider__value"},String(Math.round(e.value)))])}function eB(e){return eS("label",{class:"jie-field"},[eS("span",{},e.label),eS("span",{style:{display:"flex","align-items":"center",gap:"6px"}},[eS("input",{class:"jie-input",type:"number",value:String(e.value),on:{change:function(t){var n=Number(t.target.value);Number.isFinite(n)&&e.onChange(n)}}}),e.suffix?eS("span",{},e.suffix):null])])}function eD(e,t,n){return eS("div",{class:"jie-toolrow"},e.map(function(e){return eO({key:e.id,label:e.label,icon:e.icon,active:e.id===t,onClick:function(){return n(e.id)}})}))}u(eA,"UNORDERED_BASE",1e6);var eF=function(e){return'<svg viewBox="0 0 24 24" width="24" height="24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">'.concat(e,"</svg>")},eL={adjust:eF('<path d="M4 8h2M9 8h11M4 16h11M18 16h2"/><circle cx="7.5" cy="8" r="1.6"/><circle cx="16.5" cy="16" r="1.6"/>'),finetune:eF('<path d="M4 7h12M4 12h16M4 17h8"/><circle cx="18" cy="7" r="1.6"/><circle cx="12" cy="17" r="1.6"/>'),filters:eF('<circle cx="9" cy="9" r="5"/><circle cx="15" cy="9" r="5"/><circle cx="12" cy="15" r="5"/>'),watermark:eF('<rect x="3" y="5" width="18" height="14" rx="2"/><path d="M3 15l5-4 4 3 3-2 6 4"/><circle cx="8.5" cy="9.5" r="1.4"/>'),annotate:eF('<path d="M12 20h9"/><path d="M16.5 3.5a2.1 2.1 0 0 1 3 3L7 19l-4 1 1-4Z"/>'),resize:eF('<path d="M9 3H5a2 2 0 0 0-2 2v4M21 15v4a2 2 0 0 1-2 2h-4"/><path d="M8 16l8-8M16 8h-4M16 8v4"/>'),crop:eF('<path d="M6 2v14a2 2 0 0 0 2 2h14"/><path d="M2 6h14a2 2 0 0 1 2 2v14"/>'),rotate:eF('<path d="M3 12a9 9 0 1 0 3-6.7L3 8"/><path d="M3 3v5h5"/>'),flipX:eF('<path d="M12 3v18"/><path d="M8 7 4 12l4 5Z"/><path d="M16 7l4 5-4 5Z"/>'),flipY:eF('<path d="M3 12h18"/><path d="M7 8 12 4l5 4Z"/><path d="M7 16l5 4 5-4Z"/>'),undo:eF('<path d="M9 7 4 12l5 5"/><path d="M4 12h11a5 5 0 0 1 0 10h-1"/>'),redo:eF('<path d="m15 7 5 5-5 5"/><path d="M20 12H9a5 5 0 0 0 0 10h1"/>'),reset:eF('<path d="M3 12a9 9 0 1 1 2.6 6.3"/><path d="M3 21v-5h5"/>'),trash:eF('<path d="M4 7h16M9 7V5a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2v2M6 7l1 13a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1l1-13M10 11v6M14 11v6"/>'),plus:eF('<path d="M12 5v14M5 12h14"/>'),minus:eF('<path d="M5 12h14"/>'),zoomIn:eF('<circle cx="10.5" cy="10.5" r="7.5"/><path d="M21 21l-5.2-5.2M10.5 7.5v6M7.5 10.5h6"/>'),zoomOut:eF('<circle cx="10.5" cy="10.5" r="7.5"/><path d="M21 21l-5.2-5.2M7.5 10.5h6"/>'),posTopLeft:eF('<path d="M17 17 7 7M7 13V7h6"/>'),posTop:eF('<path d="M12 19V6M7 11l5-5 5 5"/>'),posTopRight:eF('<path d="M7 17 17 7M11 7h6v6"/>'),posLeft:eF('<path d="M19 12H6M11 7l-5 5 5 5"/>'),posCenter:eF('<circle cx="12" cy="12" r="6.5"/><circle cx="12" cy="12" r="2" fill="currentColor" stroke="none"/>'),posRight:eF('<path d="M5 12h13M13 7l5 5-5 5"/>'),posBottomLeft:eF('<path d="M17 7 7 17M7 11v6h6"/>'),posBottom:eF('<path d="M12 5v13M7 13l5 5 5-5"/>'),posBottomRight:eF('<path d="M7 7l10 10M17 11v6h-6"/>'),font:eF('<path d="M4 20 9.5 6h1L16 20M6 15h8M17 20l3-9h.5l3 9M18 17h4"/>'),focus:eF('<circle cx="12" cy="12" r="9"/><circle cx="12" cy="12" r="3.5"/>'),lock:eF('<rect x="5" y="11" width="14" height="9" rx="2"/><path d="M8 11V7a4 4 0 0 1 8 0v4"/>'),unlock:eF('<rect x="5" y="11" width="14" height="9" rx="2"/><path d="M8 11V7a4 4 0 0 1 7.5-2"/>'),text:eF('<path d="M5 5h14M12 5v14M9 19h6"/>'),brightness:eF('<circle cx="12" cy="12" r="4"/><path d="M12 2v2M12 20v2M2 12h2M20 12h2M5 5l1.5 1.5M17.5 17.5 19 19M19 5l-1.5 1.5M6.5 17.5 5 19"/>'),contrast:eF('<circle cx="12" cy="12" r="9"/><path d="M12 3a9 9 0 0 0 0 18Z" fill="currentColor" stroke="none"/>'),blur:eF('<path d="M12 3s6 6.5 6 11a6 6 0 0 1-12 0c0-4.5 6-11 6-11Z"/>'),book:eF('<path d="M4 5a2 2 0 0 1 2-2h5v18H6a2 2 0 0 1-2-2Z"/><path d="M20 5a2 2 0 0 0-2-2h-5v18h5a2 2 0 0 0 2-2Z"/>')},eV={id:"adjust",label:"Adjust",icon:eL.adjust,order:0,defaultTool:"crop",renderPanel:function(e){var t=e.state,n=e.update,i=e.t,r=R(t),a=B(t);return eS("div",{class:"jie-toolrow"},[eO({label:i("Crop"),icon:eL.crop,active:a,onClick:function(){return n({activeTab:"adjust",activeTool:a?null:"crop"})}}),eO({label:i("Rotate"),icon:eL.rotate,onClick:function(){return n({design:{rotate:r.rotate+90}})}}),eO({label:i("Flip X"),icon:eL.flipX,onClick:function(){return n({design:{flip:{horizontal:!r.flip.horizontal}}})}}),eO({label:i("Flip Y"),icon:eL.flipY,onClick:function(){return n({design:{flip:{vertical:!r.flip.vertical}}})}})])}},eN=[{id:"brightness",label:"Brightness",icon:eL.brightness,min:-100,max:100},{id:"contrast",label:"Contrast",icon:eL.contrast,min:-100,max:100},{id:"saturation",label:"Saturation",icon:eL.filters,min:-100,max:100},{id:"blur",label:"Blur",icon:eL.blur,min:0,max:100},{id:"warmth",label:"Warmth",icon:eL.brightness,min:-100,max:100}],eU={id:"finetune",label:"Finetune",icon:eL.finetune,order:1,defaultTool:"brightness",renderPanel:function(e){var t,n,i=e.state,r=e.update,a=e.t,o=(t=i.activeTool,null!=(n=eN.find(function(e){return e.id===t}))?n:eN[0]),s=R(i).finetune[o.id],l=function(e,t){r({design:{finetune:u({},o.id,e)},commit:t})};return eS("div",{class:"jie-panel-stack",style:{display:"contents"}},[eR({label:a(o.label),value:s,min:o.min,max:o.max,onStart:function(){return l(s,!0)},onInput:function(e){return l(e,!1)}}),eD(eN.map(function(e){return{id:e.id,label:a(e.label),icon:e.icon}}),o.id,function(e){return r({activeTab:"finetune",activeTool:e})})])}},eq={id:"filters",label:"Filters",icon:eL.filters,order:2,renderPanel:function(e){var t=e.state,n=e.update,i=e.t,r=R(t).filter;return eS("div",{class:"jie-thumbs"},p(em.values()).map(function(e){return eS("button",{key:e.id,class:"jie-thumb",type:"button","aria-pressed":String(e.id===r),on:{click:function(){return n({design:{filter:e.id}})}}},[eS("canvas",{class:"jie-thumb__swatch","data-jie-filter-thumb":e.id}),eS("span",{},i(e.label))])}))}},eH={id:"focus",label:"Focus",icon:eL.focus,order:3,defaultTool:"radial",renderPanel:function(e){var t,n=e.state,i=e.update,r=e.t,a=null!=(t=R(n).focus)?t:{shape:"radial",x:.5,y:.5,radius:.28,angle:0,amount:60},o=null!==R(n).focus,s=function(e,t){return i({design:{focus:h({},a,e)},commit:t})};return eS("div",{class:"jie-panel-stack",style:{display:"contents"}},[eS("div",{class:"jie-toolrow"},[eR({label:r("Intensity"),value:a.amount,min:0,max:100,onStart:function(){return s({amount:a.amount},!0)},onInput:function(e){return s({amount:e},!1)}}),eR({label:r("Radius"),value:Math.round(100*a.radius),min:5,max:90,onStart:function(){return s({radius:a.radius},!0)},onInput:function(e){return s({radius:e/100},!1)}}),o?eO({variant:"icon",icon:eL.trash,title:r("Reset"),onClick:function(){return i({design:{focus:null}})}}):null]),eD([{id:"radial",label:r("Radial")},{id:"linear",label:r("Linear")}],a.shape,function(e){return s({shape:e},!0)})])}},eX=[{align:"left",valign:"top",icon:eL.posTopLeft},{align:"center",valign:"top",icon:eL.posTop},{align:"right",valign:"top",icon:eL.posTopRight},{align:"left",valign:"middle",icon:eL.posLeft},{align:"center",valign:"middle",icon:eL.posCenter},{align:"right",valign:"middle",icon:eL.posRight},{align:"left",valign:"bottom",icon:eL.posBottomLeft},{align:"center",valign:"bottom",icon:eL.posBottom},{align:"right",valign:"bottom",icon:eL.posBottomRight}],eY=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"id",t=0;return function(){return"".concat(e,"-").concat(++t)}}("jie"),eW="text-color",eZ="text-font",eG={id:"annotate",label:"Text",icon:eL.text,order:4,defaultTool:"text",renderPanel:function(e){var t,n,i,r,a,o,s,l,u,c=e.state,d=e.update,f=e.t,p=R(c),g=p.annotations[0];if(!g)return eS("div",{class:"jie-toolrow"},[eO({label:f("Add text"),icon:eL.text,variant:"primary",onClick:function(){var e=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return h({id:e,type:"text",text:"Text",x:.5,y:.5,fontSize:.06,fontFamily:x[0].value,color:"#eb5757",bold:!1,italic:!1,align:"center",valign:"middle"},t)}(eY());d({design:{annotations:[e]},selectedAnnotationId:e.id})}})]);var b=function(e){var t,n;return d({design:{annotations:(t=p.annotations,n=g.id,t.map(function(t){return t.id===n?h({},t,e):t}))}})};return eS("div",{class:"jie-toolrow"},[eS("input",{class:"jie-input",type:"text",value:g.text,on:{input:function(e){return b({text:e.target.value})}}}),(r=(t={value:g.fontFamily,fonts:c.fonts,title:f("Font"),open:c.activePopover===eZ,onToggle:function(){return d({activePopover:c.activePopover===eZ?null:eZ})},onPick:function(e){b({fontFamily:e}),d({activePopover:null})}}).fonts.find(function(e){return e.value===t.value}),a=[eS("button",{class:"jie-fontselect__trigger",type:"button",title:null!=(n=t.title)?n:"Font","aria-haspopup":"listbox","aria-expanded":String(t.open),on:{click:function(){return t.onToggle()}}},[eE(eL.font),eS("span",{style:{"font-family":t.value}},null!=(i=null==r?void 0:r.label)?i:"Font"),eE(eL.book)])],t.open&&a.push(eS("div",{class:"jie-popover__backdrop",on:{click:function(){return t.onToggle()}}}),eS("div",{class:"jie-popover jie-fontlist",role:"listbox"},t.fonts.map(function(e){return eS("button",{key:e.value,class:"jie-fontlist__item",type:"button","aria-pressed":String(e.value===t.value),style:{"font-family":e.value},on:{click:function(){return t.onPick(e.value)}}},e.label)}))),eS("div",{class:"jie-fontselect"},a)),(l=[eS("button",{class:"jie-color",type:"button",title:null!=(s=(o={value:g.color,palette:c.palette,title:f("Colour"),open:c.activePopover===eW,onToggle:function(){return d({activePopover:c.activePopover===eW?null:eW})},onPick:function(e){b({color:e}),d({activePopover:null})}}).title)?s:"Colour",style:{background:o.value},"aria-haspopup":"true","aria-expanded":String(o.open),on:{click:function(){return o.onToggle()}}})],o.open&&l.push(eS("div",{class:"jie-popover__backdrop",on:{click:function(){return o.onToggle()}}}),eS("div",{class:"jie-popover jie-swatches",role:"listbox"},o.palette.map(function(e){return eS("button",{key:e,class:"jie-swatch",type:"button",title:e,style:{background:e},"aria-pressed":String(e.toLowerCase()===o.value.toLowerCase()),on:{click:function(){return o.onPick(e)}}})}))),eS("div",{class:"jie-colorpicker"},l)),eO({label:"B",className:"jie-btn--bold",active:g.bold,onClick:function(){return b({bold:!g.bold})}}),eO({label:"I",className:"jie-btn--italic",active:g.italic,onClick:function(){return b({italic:!g.italic})}}),eR({label:f("Size"),value:Math.round(100*g.fontSize),min:1,max:40,onInput:function(e){return b({fontSize:e/100})}}),(u={align:g.align,valign:g.valign,onPick:function(e,t){return b(h({align:e,valign:t},{x:"left"===e?.04:"right"===e?.96:.5,y:"top"===t?.04:"bottom"===t?.96:.5}))}},eS("div",{class:"jie-posgrid",role:"group"},eX.map(function(e){return eS("button",{key:"".concat(e.valign,"-").concat(e.align),class:"jie-posgrid__cell",type:"button","data-pos":"".concat(e.valign,"-").concat(e.align),"aria-pressed":String(e.align===u.align&&e.valign===u.valign),on:{click:function(){return u.onPick(e.align,e.valign)}}},[eE(e.icon)])}))),eO({variant:"icon",icon:eL.trash,title:f("Delete"),onClick:function(){var e,t;return d({design:{annotations:(e=p.annotations,t=g.id,e.filter(function(e){return e.id!==t}))},selectedAnnotationId:null})}})])}},eK={id:"resize",label:"Resize",icon:eL.resize,order:5,renderPanel:function(e){var t=e.state,n=e.update,i=e.t,r=U(t);if(!r)return null;var a="unlocked"!==t.activeTool,o=function(e){return n({design:{resize:function(e,t,n){var i,r,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,o=e.width/e.height;if(!n)return{width:Math.max(a,Math.round(null!=(i=t.width)?i:e.width)),height:Math.max(a,Math.round(null!=(r=t.height)?r:e.height))};if(void 0!==t.width){var s=Math.max(a,Math.round(t.width));return{width:s,height:Math.max(a,Math.round(s/o))}}if(void 0!==t.height){var l=Math.max(a,Math.round(t.height));return{width:Math.max(a,Math.round(l*o)),height:l}}return h({},e)}(r,e,a,t.minResizeSize)}})};return eS("div",{class:"jie-fieldrow"},[eB({label:i("Width"),value:r.width,suffix:i("px"),onChange:function(e){return o({width:e})}}),eO({variant:"icon",icon:a?eL.lock:eL.unlock,title:i(a?"Aspect ratio locked":"Aspect ratio unlocked"),onClick:function(){return n({activeTab:"resize",activeTool:a?"unlocked":"locked"})}}),eB({label:i("Height"),value:r.height,suffix:i("px"),onChange:function(e){return o({height:e})}}),eO({variant:"icon",icon:eL.reset,title:i("Reset size"),onClick:function(){return n({design:{resize:null}})}})])}};function eJ(e){return parseInt(e+e,16)}function e$(e,t){return parseInt(e.slice(t,t+2),16)}var eQ=/image\/(jpe?g|bmp)/i;function e0(e,t){if("u"<typeof document)throw Error("No DOM available: provide a CanvasFactory to the codec");var n=document.createElement("canvas");return n.width=e,n.height=t,{get width(){return n.width},set width(v){n.width=v},get height(){return n.height},set height(v){n.height=v},getContext:function(e){return n.getContext(e)},toBlobAsync:function(e,t){return new Promise(function(i,r){n.toBlob(function(e){return e?i(e):r(Error("canvas.toBlob returned null"))},e,t)})}}}var e1=function(){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:e0,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};o(this,e),u(this,"maxPixels",void 0),u(this,"maxSize",void 0),this.createCanvas=n,this.maxPixels=null!=(t=i.maxPixels)?t:0x1000000,this.maxSize=i.maxSize}return l(e,[{key:"decode",value:function(e){return a(function(){var t,n,i,r,a,o,s;return m(this,function(l){switch(l.label){case 0:return[4,this.toBitmap(e)];case 1:var u,c,h,d;return u=(t=l.sent()).width,c=t.height,h={maxSize:this.maxSize,maxPixels:this.maxPixels},d=1,h.maxSize&&h.maxSize>0&&(d=Math.min(d,h.maxSize/Math.max(u,c))),h.maxPixels&&h.maxPixels>0&&(d=Math.min(d,Math.sqrt(h.maxPixels/(u*c)))),n=Math.min(1,d),i=Math.max(1,Math.round(t.width*n)),r=Math.max(1,Math.round(t.height*n)),a=this.createCanvas(i,r),(o=this.context(a)).imageSmoothingEnabled=!0,o.imageSmoothingQuality="high",o.drawImage(t,0,0,i,r),"close"in t&&"function"==typeof t.close&&t.close(),[2,Q((s=o.getImageData(0,0,i,r)).width,s.height,s.data)]}})}).call(this)}},{key:"encode",value:function(e){return a(function(e){var t,n,i,r,a,o,s,l,u=arguments;return m(this,function(c){var h;return i=void 0===(n=(t=u.length>1&&void 0!==u[1]?u[1]:{}).type)?"image/png":n,a=void 0===(r=t.quality)?.92:r,s=void 0!==(o=t.background)||eQ.test(i)?function(e,t){for(var n=f(t,3),i=n[0],r=n[1],a=n[2],o=Q(e.width,e.height),s=0;s<e.data.length;s+=4){var l=e.data[s+3]/255,u=1-l;o.data[s]=e.data[s]*l+i*u,o.data[s+1]=e.data[s+1]*l+r*u,o.data[s+2]=e.data[s+2]*l+a*u,o.data[s+3]=255}return o}(e,(h=(null!=o?o:"#ffffff").trim().replace(/^#/,""),/^[0-9a-f]{3}$/i.test(h)?[eJ(h[0]),eJ(h[1]),eJ(h[2])]:/^[0-9a-f]{6}$/i.test(h)?[e$(h,0),e$(h,2),e$(h,4)]:[255,255,255])):e,l=this.createCanvas(s.width,s.height),this.context(l).putImageData(ew(s),0,0),[2,l.toBlobAsync(i,a)]})}).apply(this,arguments)}},{key:"context",value:function(e){var t=e.getContext("2d");if(!t)throw Error("Unable to acquire a 2D canvas context");return t}},{key:"toBitmap",value:function(e){return a(function(){return m(this,function(t){return"function"==typeof createImageBitmap?[2,createImageBitmap(e,{imageOrientation:"from-image"})]:[2,new Promise(function(t,n){var i=URL.createObjectURL(e),r=new Image;r.style.imageOrientation="from-image",r.onload=function(){URL.revokeObjectURL(i),t(r)},r.onerror=function(){URL.revokeObjectURL(i),n(Error("Failed to decode image blob"))},r.src=i})]})})()}}]),e}(),e2=function(){function e(t){o(this,e),u(this,"codec",void 0),u(this,"createCanvas",void 0),this.codec=t.codec,this.createCanvas=t.createCanvas}return l(e,[{key:"decode",value:function(e){return this.codec.decode(e)}},{key:"render",value:function(e,t){var n=function(e,t){var n=e;if(t.flip.horizontal&&(n=en(n,"horizontal")),t.flip.vertical&&(n=en(n,"vertical")),0!==t.rotate&&(n=function(e,t){var n=(Math.round(t/90)%4+4)%4;if(0===n)return Q(e.width,e.height,new Uint8ClampedArray(e.data));for(var i=e.width,r=e.height,a=1===n||3===n,o=Q(a?r:i,a?i:r),s=0;s<r;s++)for(var l=0;l<i;l++){var u=void 0,c=void 0;1===n?(u=r-1-s,c=l):2===n?(u=i-1-l,c=r-1-s):(u=s,c=i-1-l),er(e,ee(e,l,s),o,ee(o,u,c))}return o}(n,t.rotate)),0!==t.angle){var i,r=null!=(i=t.crop)?i:{x:0,y:0,width:n.width,height:n.height};n=function(e,t,n){for(var i=Math.max(1,Math.round(t.width)),r=Math.max(1,Math.round(t.height)),a=Q(i,r),o=t.x+t.width/2,s=t.y+t.height/2,l=n*Math.PI/180,u=Math.cos(l),c=Math.sin(l),h=0;h<r;h++)for(var d=h+.5-r/2,f=0;i>f;f++){var p=f+.5-i/2;!function(e,t,n,i,r){if(t<=-1||n<=-1||t>=e.width||n>=e.height){i.data[r]=0,i.data[r+1]=0,i.data[r+2]=0,i.data[r+3]=0;return}for(var a=Math.floor(t),o=Math.floor(n),s=t-a,l=n-o,u=ea(a,e.width),c=ea(a+1,e.width),h=ea(o,e.height),d=ea(o+1,e.height),f=ee(e,u,h),p=ee(e,c,h),g=ee(e,u,d),b=ee(e,c,d),m=0;m<4;m++){var y,x,w=(y=e.data[f+m],y+(e.data[p+m]-y)*s),j=(x=e.data[g+m],x+(e.data[b+m]-x)*s);i.data[r+m]=w+(j-w)*l}}(e,o+p*u-d*c-.5,s+p*c+d*u-.5,a,ee(a,f,h))}return a}(n,r,t.angle)}else t.crop&&(n=function(e,t){for(var n,i,r=O({x:n=Math.round(t.x),y:i=Math.round(t.y),width:Math.round(t.x+t.width)-n,height:Math.round(t.y+t.height)-i},e),a=Q(r.width,r.height),o=0;o<r.height;o++){var s=ee(e,r.x,r.y+o),l=ee(a,0,o);a.data.set(e.data.subarray(s,s+4*r.width),l)}return a}(n,t.crop));return t.resize&&(n=ei(n,t.resize)),n=ex(n=ed(n,t.finetune),t.filter),t.focus&&(n=function(e,t){if(t.amount<=0)return Q(e.width,e.height,new Uint8ClampedArray(e.data));for(var n=eh(e,t.amount,32),i=e.width,r=e.height,a=Q(i,r),o=Math.min(i,r),s=t.x*i,l=t.y*r,u=t.radius*o,c=Math.max(.06*o,.9*u),h=t.angle*Math.PI/180,d=-Math.sin(h),f=Math.cos(h),p=0;p<r;p++)for(var g=0;g<i;g++)for(var b=g-s,m=p-l,y=function(e,t,n){if(t<=e)return+(n>=t);var i=Math.min(1,Math.max(0,(n-e)/(t-e)));return i*i*(3-2*i)}(u,u+c,"radial"===t.shape?Math.hypot(b,m):Math.abs(b*d+m*f)),x=ee(a,g,p),w=0;w<4;w++)a.data[x+w]=e.data[x+w]+(n.data[x+w]-e.data[x+w])*y;return a}(n,t.focus)),n}(e,t);return function(e,t,n){if(0===n.length)return t;var i=e(t.width,t.height).getContext("2d");if(!i)throw Error("Unable to acquire a 2D canvas context");i.putImageData(ew(t),0,0);var r=!0,a=!1,o=void 0;try{for(var s,l=n[Symbol.iterator]();!(r=(s=l.next()).done);r=!0){var u=s.value;if("text"===u.type){var c=function(e,t){var n=Math.max(1,Math.round(e.fontSize*t.height)),i=e.bold?"bold":"normal",r=e.italic?"italic":"normal";return{text:e.text,x:Math.round(e.x*t.width),y:Math.round(e.y*t.height),fontPx:n,font:"".concat(r," ").concat(i," ").concat(n,"px ").concat(e.fontFamily),color:e.color,align:e.align,baseline:e.valign}}(u,t);i.font=c.font,i.fillStyle=c.color,i.textAlign=c.align,i.textBaseline=c.baseline,function(e,t){var n=t.text.split("\n"),i=1.2*t.fontPx,r=(n.length-1)*i,a="middle"===t.baseline?t.y-r/2:"bottom"===t.baseline?t.y-r:t.y;n.forEach(function(n,r){return e.fillText(n,t.x,a+r*i)})}(i,c)}}}catch(e){a=!0,o=e}finally{try{r||null==l.return||l.return()}finally{if(a)throw o}}var h=i.getImageData(0,0,t.width,t.height);return Q(h.width,h.height,h.data)}(this.createCanvas,n,t.annotations)}},{key:"toBlob",value:function(e,t,n){return a(function(){return m(this,function(i){return[2,this.codec.encode(this.render(e,t),n)]})}).call(this)}}]),e}();function e5(e,t,n){e.update({zoom:t.zoom*n})}var e4=function(){function e(t){var n=this;o(this,e),u(this,"store",void 0),u(this,"container",void 0),u(this,"renderer",void 0),u(this,"registry",new eA),u(this,"locales",new ej),u(this,"processor",void 0),u(this,"previewMaxSize",void 0),u(this,"spinnerDelay",void 0),u(this,"busyTimer",null),u(this,"onSaveCb",void 0),u(this,"onSaveAsCb",void 0),u(this,"confirm",void 0),u(this,"source",null),u(this,"previewSource",null),u(this,"thumbSource",null),u(this,"thumbVersion",0),u(this,"cachedRaster",null),u(this,"cachedRasterKey",""),u(this,"lastPaintKey",""),u(this,"disposers",[]),u(this,"resizeObserver",null),u(this,"observedWrap",null),u(this,"dragCleanup",null),u(this,"destroyed",!1),this.container=function(e){if("string"!=typeof e)return e;var t=document.querySelector(e);if(!t)throw Error("Container not found: ".concat(e));return t}(t.container),this.processor=null!=(s=t.processor)?s:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:e0,t=arguments.length>1?arguments[1]:void 0;return new e2({codec:new e1(e,t),createCanvas:e})}(void 0,{maxPixels:t.maxSourcePixels,maxSize:t.maxSourceSize}),this.previewMaxSize=null!=(l=t.previewMaxSize)?l:1600,this.spinnerDelay=Math.max(0,null!=(c=t.spinnerDelay)?c:250),this.onSaveCb=t.onSave,this.onSaveAsCb=t.onSaveAs,this.confirm=null!=(d=t.confirm)?d:function(e){return"u"<typeof window||window.confirm(e)};var i=!0,r=!1,a=void 0;try{for(var s,l,c,d,f,p,g,b,m,y=(null!=(f=t.locales)?f:[])[Symbol.iterator]();!(i=(m=y.next()).done);i=!0){var x=m.value;this.locales.register(x)}}catch(e){r=!0,a=e}finally{try{i||null==y.return||y.return()}finally{if(r)throw a}}this.store=new E({scheduler:null!=(p=t.scheduler)?p:function(){if("function"!=typeof requestAnimationFrame)return new P(function(e){return setTimeout(e,16)},function(e){return clearTimeout(e)});var e=function(e){cancelAnimationFrame(e.raf),null!==e.timer&&(clearTimeout(e.timer),e.timer=null)};return new P(function(t){var n={raf:0,timer:null},i=function(){e(n),t()};return n.raf=requestAnimationFrame(i),n.timer=setTimeout(i,100),n},e)}(),initialState:h({},S(),t.state,t.locale?{locale:t.locale}:{},void 0!==t.minCropSize?{minCropSize:Math.max(1,t.minCropSize)}:{},void 0!==t.minResizeSize?{minResizeSize:Math.max(1,t.minResizeSize)}:{},t.palette?{palette:t.palette}:{},t.fonts?{fonts:t.fonts}:{})});var w=!0,j=!1,k=void 0;try{for(var M,_=(null!=(g=t.tools)?g:[eV,eU,eq,eH,eG,eK])[Symbol.iterator]();!(w=(M=_.next()).done);w=!0){var C=M.value;this.registry.register(C)}}catch(e){j=!0,k=e}finally{try{w||null==_.return||_.return()}finally{if(j)throw k}}var z=!0,T=!1,A=void 0;try{for(var I,O=(null!=(b=t.plugins)?b:[])[Symbol.iterator]();!(z=(I=O.next()).done);z=!0){var R=I.value;this.use(R)}}catch(e){T=!0,A=e}finally{try{z||null==O.return||O.return()}finally{if(T)throw A}}this.renderer=new eC(new eP(document),this.container),this.disposers.push(this.store.subscribe(function(){return n.render()})),this.disposers.push(this.store.subscribe(function(e){return n.syncBusyTimer(e)})),this.render(),t.image&&this.fromBlob(t.image)}return l(e,[{key:"state",get:function(){return this.store.getState()}},{key:"update",value:function(e){return this.store.update(e),this}},{key:"save",value:function(){return a(function(){return m(this,function(e){return[2,this.handleSave()]})}).call(this)}},{key:"saveAs",value:function(){return a(function(){return m(this,function(e){return[2,this.handleSaveAs()]})}).call(this)}},{key:"reset",value:function(){return this.handleReset(),this}},{key:"use",value:function(e){var t=e.setup(this.api());return"function"==typeof t&&this.disposers.push(t),this}},{key:"fromBlob",value:function(e){return a(function(){var t,n;return m(this,function(i){switch(i.label){case 0:this.store.update({status:"loading",error:null}),i.label=1;case 1:return i.trys.push([1,3,,4]),[4,this.processor.decode(e)];case 2:if(t=i.sent(),this.destroyed)return[2,this];return this.source=t,this.previewSource=e6(t,this.previewMaxSize),this.thumbSource=e6(t,160),this.thumbVersion++,this.store.update({source:{width:t.width,height:t.height,name:c(e,File)?e.name:null,mimeType:e.type||"image/png"},resetHistory:!0,status:"ready"}),[3,4];case 3:return n=i.sent(),this.store.update({status:"error",error:c(n,Error)?n.message:String(n)}),[3,4];case 4:return[2,this]}})}).call(this)}},{key:"toBlob",value:function(e){return a(function(){var t;return m(this,function(n){switch(n.label){case 0:if(!this.source)throw Error("No image loaded — call fromBlob() first");t=R(this.store.getState()),this.store.update({status:"exporting"}),n.label=1;case 1:if(n.trys.push([1,,5,6]),!(t.annotations.length>0&&"u">typeof document&&document.fonts))return[3,3];return[4,document.fonts.ready];case 2:n.sent(),n.label=3;case 3:return[4,this.processor.toBlob(this.source,t,e)];case 4:return[2,n.sent()];case 5:return this.store.update({status:"ready"}),[7];case 6:return[2]}})}).call(this)}},{key:"destroy",value:function(){if(!this.destroyed){this.destroyed=!0,this.clearBusyTimer(),null==(i=this.dragCleanup)||i.call(this),null==(r=this.resizeObserver)||r.disconnect();var e=!0,t=!1,n=void 0;try{for(var i,r,a,o=this.disposers.splice(0)[Symbol.iterator]();!(e=(a=o.next()).done);e=!0)(0,a.value)()}catch(e){t=!0,n=e}finally{try{e||null==o.return||o.return()}finally{if(t)throw n}}this.renderer.unmount(),this.store.destroy()}}},{key:"api",value:function(){var e=this;return{registerTool:function(t){return e.registry.register(t)},registerFilter:function(e){return ey(e)},registerLocale:function(t){return e.locales.register(t)},getState:function(){return e.store.getState()},update:function(t){return e.store.update(t)}}}},{key:"translator",value:function(){return this.locales.translator(this.store.getState().locale)}},{key:"appContext",value:function(){var e=this;return{update:function(t){return e.store.update(t)},tools:this.registry.list(),t:this.translator(),onSave:function(){e.handleSave()},onSaveAs:function(){e.handleSaveAs()},onReset:function(){return e.handleReset()},beginCropDrag:function(t,n){return e.beginCropDrag(t,n)},beginCropRotate:function(t){return e.beginCropRotate(t)}}}},{key:"handleReset",value:function(){V(this.store.getState())&&this.confirm(this.translator()("Reset all changes? You can still undo afterwards."))&&this.store.update({resetDesign:!0})}},{key:"render",value:function(){if(!this.destroyed){var e,t,n,i,r,a,o,s,l,u,c,h;this.renderer.render((e=this.store.getState(),t=this.appContext(),eS("div",{class:"jie","data-theme":e.theme},[e.showToolbar?(n=U(e),r=(i=H(e))?Math.round(100*i.scale):Math.round(100*e.zoom),a=t.t,o="loading"===e.status||"exporting"===e.status,s="exporting"===e.status&&e.busyVisible,eS("header",{class:"jie-topbar"},[eS("div",{class:"jie-topbar__save"},[eO({label:a("Save"),variant:"primary",onClick:function(){return t.onSave()},disabled:!e.source||o,busy:s}),eO({label:a("Save as"),onClick:function(){return t.onSaveAs()},disabled:!e.source||o,busy:s})]),eS("div",{class:"jie-topbar__meta"},[n?eS("span",{},"".concat(n.width," x ").concat(n.height," px")):null,eE(eL.book),eS("div",{class:"jie-zoom"},[eO({variant:"icon",icon:eL.zoomOut,title:a("Zoom out"),onClick:function(){return e5(t,e,1/1.2)}}),eS("span",{},"".concat(r,"%")),eO({variant:"icon",icon:eL.zoomIn,title:a("Zoom in"),onClick:function(){return e5(t,e,1.2)}})])]),eS("div",{class:"jie-topbar__actions"},[eO({variant:"icon",icon:eL.reset,title:a("Reset"),disabled:!V(e),onClick:function(){return t.onReset()}}),eO({variant:"icon",icon:eL.undo,title:a("Undo"),disabled:!F(e),onClick:function(){return t.update({history:{step:-1}})}}),eO({variant:"icon",icon:eL.redo,title:a("Redo"),disabled:!L(e),onClick:function(){return t.update({history:{step:1}})}})])])):null,eS("div",{class:"jie-body"},[eS("nav",{class:"jie-rail"},t.tools.map(function(n){return eS("button",{key:n.id,class:"jie-tab",type:"button","aria-selected":String(e.activeTab===n.id),on:{click:function(){var e;return t.update({activeTab:n.id,activeTool:null!=(e=n.defaultTool)?e:null})}}},[eE(n.icon),eS("span",{},t.t(n.label))])})),(h=null!=(u=null==(c=null!=(l=t.tools.find(function(t){return t.id===e.activeTab}))?l:t.tools[0])?void 0:c.renderPanel({state:e,update:t.update,t:t.t}))?u:null,eS("div",{class:"jie-stage"},[eS("div",{class:"jie-canvas-wrap","data-jie-canvas-wrap":""},[eS("canvas",{class:"jie-canvas","data-jie-canvas":""}),function(e,t){if(!B(e))return null;var n=H(e),i=Y(e);if(!n||!i)return null;var r=X(e);return eS("div",{class:"jie-crop",style:{left:"".concat(n.offsetX+i.x*n.scale,"px"),top:"".concat(n.offsetY+i.y*n.scale,"px"),width:"".concat(i.width*n.scale,"px"),height:"".concat(i.height*n.scale,"px"),transform:"rotate(".concat(r,"deg)")},on:{pointerdown:function(e){return t.beginCropDrag("move",e)}}},[eS("div",{key:"rotate",class:"jie-crop__rotate",title:"Rotate",on:{pointerdown:function(e){e.stopPropagation(),t.beginCropRotate(e)}}})].concat(p(["nw","ne","sw","se"].map(function(e){return eS("div",{key:e,class:"jie-crop__handle","data-h":e,on:{pointerdown:function(n){n.stopPropagation(),t.beginCropDrag(e,n)}}})}))))}(e,t),"loading"===e.status?eS("div",{class:"jie-overlay","data-jie-loading":""},[eI()]):"error"===e.status&&e.error?eS("div",{class:"jie-overlay jie-overlay--error","data-jie-error":""},[eS("span",{},t.t("Failed to load the image")),eS("span",{class:"jie-overlay__detail"},e.error)]):null]),h?eS("div",{class:"jie-panel"},[h]):null]))])]))),this.ensureViewportObserver(),this.paint(),this.paintFilterThumbs()}}},{key:"handleSave",value:function(){return a(function(){var e,t,n;return m(this,function(i){switch(i.label){case 0:if(!this.canExport())return[2];return[4,this.toBlob()];case 1:return n=i.sent(),null==(e=(t=this).onSaveCb)||e.call(t,n,this),this.container.dispatchEvent(new CustomEvent("jie:save",{detail:{blob:n},bubbles:!0})),[2]}})}).call(this)}},{key:"handleSaveAs",value:function(){return a(function(){var e,t,n;return m(this,function(i){switch(i.label){case 0:if(!this.canExport())return[2];return[4,this.toBlob()];case 1:return n=i.sent(),null==(e=(t=this).onSaveAsCb)||e.call(t,n,this),this.container.dispatchEvent(new CustomEvent("jie:saveas",{detail:{blob:n},bubbles:!0})),[2]}})}).call(this)}},{key:"canExport",value:function(){var e=this.store.getState().status;return null!==this.source&&"exporting"!==e&&"loading"!==e}},{key:"syncBusyTimer",value:function(e){var t=this;"exporting"!==e.status?this.clearBusyTimer():e.busyVisible||null!==this.busyTimer||(this.busyTimer=setTimeout(function(){t.busyTimer=null,t.destroyed||"exporting"!==t.store.getState().status||t.store.update({busyVisible:!0})},this.spinnerDelay))}},{key:"clearBusyTimer",value:function(){null!==this.busyTimer&&(clearTimeout(this.busyTimer),this.busyTimer=null)}},{key:"ensureViewportObserver",value:function(){var e,t=this,n=this.container.querySelector("[data-jie-canvas-wrap]");if(n&&n!==this.observedWrap){if(null==(e=this.resizeObserver)||e.disconnect(),this.observedWrap=n,"u"<typeof ResizeObserver)return void this.measureViewport(n);this.resizeObserver=new ResizeObserver(function(){return t.measureViewport(n)}),this.resizeObserver.observe(n),this.measureViewport(n)}}},{key:"measureViewport",value:function(e){var t=e.clientWidth,n=e.clientHeight,i=this.store.getState().viewport;t<=0||n<=0||i&&i.width===t&&i.height===n||this.store.update({viewport:{width:t,height:n}})}},{key:"paint",value:function(){var e=this.store.getState(),t=this.container.querySelector("[data-jie-canvas]");if(t&&this.previewSource&&e.viewport){var n=H(e);if(n){var i=D(e),r="".concat(this.thumbVersion,":").concat(JSON.stringify(i));r===this.cachedRasterKey&&this.cachedRaster||(this.cachedRaster=this.processor.render(this.previewSource,i),this.cachedRasterKey=r);var a="".concat(r,"@").concat(e.viewport.width,"x").concat(e.viewport.height,":").concat(n.scale,":").concat(n.offsetX,",").concat(n.offsetY);a!==this.lastPaintKey&&(this.lastPaintKey=a,function(e,t,n,i){var r="u">typeof window&&window.devicePixelRatio||1;e.width=Math.max(1,Math.round(n.width*r)),e.height=Math.max(1,Math.round(n.height*r));var a=e.getContext("2d");if(a){a.setTransform(r,0,0,r,0,0),a.clearRect(0,0,n.width,n.height);var o=document.createElement("canvas");o.width=t.width,o.height=t.height;var s=o.getContext("2d");s&&(s.putImageData(ew(t),0,0),a.imageSmoothingEnabled=!0,a.imageSmoothingQuality="high",a.drawImage(o,i.offsetX,i.offsetY,i.width,i.height))}}(t,this.cachedRaster,e.viewport,n))}}}},{key:"paintFilterThumbs",value:function(){var e=this.thumbSource;if(e){var t=this.container.querySelectorAll("canvas[data-jie-filter-thumb]"),n=!0,i=!1,r=void 0;try{for(var a,o=t[Symbol.iterator]();!(n=(a=o.next()).done);n=!0){var s=a.value,l=s.dataset.jieFilterThumb;if(l){var u="".concat(this.thumbVersion,":").concat(l);if(s.dataset.key!==u){var c=ex(e,l);s.width=c.width,s.height=c.height;var h=s.getContext("2d");h&&(h.putImageData(ew(c),0,0),s.dataset.key=u)}}}}catch(e){i=!0,r=e}finally{try{n||null==o.return||o.return()}finally{if(i)throw r}}}}},{key:"beginCropDrag",value:function(e,t){var n=this.store.getState(),i=H(n),r=Y(n),a=N(n);if(i&&r&&a){var o=X(n),s=n.minCropSize,l=t.clientX,u=t.clientY;this.runPointerGesture(t,function(t){var n=(t.clientX-l)/i.scale,c=(t.clientY-u)/i.scale;return{crop:0!==o?function(e,t,n,i,r){var a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:8;if("move"===n)return d(h({},e),{x:e.x+i,y:e.y+r});var o=f(G[n],2),s=o[0],l=o[1],u=J(e,t,s,l),c=J(e,t,-s,-l),p={x:u.x+i,y:u.y+r},g=(p.x+c.x)/2,b=(p.y+c.y)/2,m=t*Z,y=Math.cos(m),x=Math.sin(m),w=p.x-c.x,j=p.y-c.y,k=Math.max(a,Math.abs(w*y+j*x)),S=Math.max(a,Math.abs(-(w*x)+j*y));return{x:g-k/2,y:b-S/2,width:k,height:S}}(r,o,e,n,c,s):function(e,t,n,i,r){var a,o,s,l=arguments.length>5&&void 0!==arguments[5]?arguments[5]:null,u=arguments.length>6&&void 0!==arguments[6]?arguments[6]:8;if("move"===t)return O(d(h({},e),{x:e.x+n,y:e.y+i}),r);var c=e.x,f=e.y,p=e.width,g=e.height;if("nw"===t||"sw"===t){var b=I(c+n,0,c+p-u);p+=c-b,c=b}else p=I(p+n,u,r.width-c);if("nw"===t||"ne"===t){var m=I(f+i,0,f+g-u);g+=f-m,f=m}else g=I(g+i,u,r.height-f);var y={x:c,y:f,width:p,height:g};return null!==l&&l>0&&(o=(a=y).width/l,s="sw"===t||"se"===t?a.y:a.y+a.height-o,y=d(h({},a),{height:o,y:s})),O(y,r)}(r,e,n,c,a,null,s)}})}}},{key:"beginCropRotate",value:function(e){var t,n=this.store.getState(),i=H(n),r=Y(n),a=null!=(t=this.observedWrap)?t:this.container.querySelector("[data-jie-canvas-wrap]");if(i&&r&&a){var o=a.getBoundingClientRect(),s=K(r),l=o.left+i.offsetX+s.x*i.scale,u=o.top+i.offsetY+s.y*i.scale,c=X(n),h=$(l,u,e.clientX,e.clientY);this.runPointerGesture(e,function(e){var t=c+($(l,u,e.clientX,e.clientY)-h);return 2>Math.abs(t)&&(t=0),{angle:Math.round(10*t)/10}})}}},{key:"runPointerGesture",value:function(e,t){var n=this;e.preventDefault();var i=!1,r=function(e){n.store.update({design:t(e),commit:!i}),i=!0},a=function(){window.removeEventListener("pointermove",r),window.removeEventListener("pointerup",a),n.dragCleanup=null};window.addEventListener("pointermove",r),window.addEventListener("pointerup",a),this.dragCleanup=a}}]),e}();function e6(e,t){var n=Math.max(e.width,e.height);if(t>=n)return e;var i=t/n;return ei(e,{width:Math.round(e.width*i),height:Math.round(e.height*i)})}},2868:function(e,t,n){n.d(t,{_:function(){return i}});function i(e,t){return null!=t&&"u">typeof Symbol&&t[Symbol.hasInstance]||null!=t&&"u">typeof Symbol&&t[Symbol.hasInstance]?!!t[Symbol.hasInstance](e):e instanceof t}}},function(e){return e(e.s=98270)}])});
8
+ "use strict";!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var n=t();for(var i in n)("object"==typeof exports?exports:e)[i]=n[i]}}(self,function(){return(self.webpackChunkjodit_pro=self.webpackChunkjodit_pro||[]).push([[918],{76542:function(e,t,n){n.d(t,{ProImageEditor:function(){return m}});var i=n(77688),r=n(80294),a=n(20616),o=n(67709),s=n(82749),l=n(18766),u=n(2868),c=n(43284),h=n(62361),d=n(85013),f=n(6441),p=n(91907),g=n(10830),b=n(78584),m=function(e){function t(){var e;return(0,a._)(this,t),e=(0,r._)(this,t,arguments),(0,s._)(e,"isProImageEditor",!0),e}return(0,l._)(t,e),(0,o._)(t,[{key:"className",value:function(){return"ImageEditorPro"}},{key:"open",value:function(e,t){return(0,i._)(function(){var n,i,r,a,o,s,l,c,p,g;return(0,h._)(this,function(h){switch(h.label){case 0:n=this,i=this.j,r=f.Config.defaultOptions.imageEditorPro,(a=i.c.div("jodit-image-editor-pro")).style.width="100%",a.style.height="100%",(o=new b.Dialog({language:i.o.language})).setSize(r.dialog.width,r.dialog.height),o.setContent(a),o.open(),s=null,l=null,c=function(){null==l||l(),l=null,null==s||s.destroy(),s=null,o.close()},o.e.on("beforeClose",function(){null==l||l(),l=null,null==s||s.destroy(),s=null}),s=new d.ImageEditor({container:a,state:{showToolbar:!1,status:"loading"},onSave:function(i){n.persist(s,e,void 0,i,t,c)},onSaveAs:function(i){n.saveAs(s,e,i,t,c)}}),l=this.mountToolbar(o,s),h.label=1;case 1:return h.trys.push([1,4,,5]),[4,this.loadImage(e)];case 2:return p=h.sent(),[4,s.fromBlob(p)];case 3:return h.sent(),i.e.fire("afterImageEditor"),[3,5];case 4:return g=h.sent(),null==s||s.update({status:"error",error:(0,u._)(g,Error)?g.message:String(g)}),this.error(g),[3,5];case 5:return[2]}})}).call(this)}},{key:"mountToolbar",value:function(e,t){var n=this.j,i=(0,g.Button)(n,{icon:{name:"save"},text:n.i18n("Save")},"primary"),r=(0,g.Button)(n,{icon:{name:"save"},name:"save-as",text:n.i18n("Save as")}),a=n.c.span("jodit-image-editor-pro__size"),o=(0,g.Button)(n,d.ICONS.minus),s=n.c.span("jodit-image-editor-pro__zoom"),l=(0,g.Button)(n,d.ICONS.plus),u=(0,g.Button)(n,"update",n.i18n("Reset")),c=(0,g.Button)(n,"undo",n.i18n("Undo")),h=(0,g.Button)(n,"redo",n.i18n("Redo"));o.setState({tooltip:"Zoom out"}),l.setState({tooltip:"Zoom in"});var f=null;i.onAction(function(){f=i,t.save()}),r.onAction(function(){f=r,t.saveAs()}),o.onAction(function(){return t.update({zoom:t.state.zoom/1.2})}),l.onAction(function(){return t.update({zoom:1.2*t.state.zoom})}),u.onAction(function(){return t.reset()}),c.onAction(function(){return t.update({history:{step:-1}})}),h.onAction(function(){return t.update({history:{step:1}})});var p=function(){for(var e=arguments.length,t=Array(e),i=0;e>i;i++)t[i]=arguments[i];var r=n.c.div("jodit-image-editor-pro__group");return r.style.display="flex",r.style.alignItems="center",r.style.gap="4px",t.forEach(function(e){return r.appendChild(e)}),r},b=n.c.div("jodit-image-editor-pro__toolbar");b.style.display="flex",b.style.alignItems="center",b.style.gap="12px",b.style.width="100%",a.style.opacity="0.75",s.style.minWidth="3.5em",s.style.textAlign="center",b.appendChild(p(i.container,r.container)),b.appendChild(p(a,o.container,s,l.container));var m=p(u.container,c.container,h.container);m.style.marginLeft="auto",b.appendChild(m),e.setHeader(b);var y="jodit-image-editor-pro__button_busy",x=function(e){var t=d.selectors.selectOutputSize(e),n="exporting"===e.status,o=n||"loading"===e.status,l=e.busyVisible,p=n&&(null==l||l);n||(f=null),i.setState({disabled:!e.source||o}),r.setState({disabled:!e.source||o}),i.container.classList.toggle(y,p&&f!==r),r.container.classList.toggle(y,p&&f===r),u.setState({disabled:!d.selectors.selectIsDirty(e)}),c.setState({disabled:!d.selectors.selectCanUndo(e)}),h.setState({disabled:!d.selectors.selectCanRedo(e)}),a.textContent=t?"".concat(t.width," \xd7 ").concat(t.height):"";var g=d.selectors.selectViewportFit(e),b=g?Math.round(100*g.scale):Math.round(100*e.zoom);s.textContent="".concat(b,"%")};x(t.state);var w=t.store.subscribe(x);return function(){w(),[i,r,o,l,u,c,h].forEach(function(e){return e.destruct()})}}},{key:"saveAs",value:function(e,t,n,i,r){var a=this;this.j.prompt("Enter new name","Save in new file",function(o){var s=(o||"").trim();if(!s)return a.j.alert("The name should not be empty"),!1;a.persist(e,t,s,n,i,r)})}},{key:"persist",value:function(e,t,n,r,a,o){return(0,i._)(function(){var i,s,l,u,c,d;return(0,h._)(this,function(h){switch(h.label){case 0:i=this,null==e||e.update({status:"exporting"}),h.label=1;case 1:return h.trys.push([1,4,,5]),[4,this.blobSize(r)];case 2:return s=h.sent(),l={action:this.coreSupportsSaved()?"saved":"resize",box:s},void 0!==n?this.j.e.fire("afterImageEditorSave",l,n):this.j.e.fire("afterImageEditorSave",l),[4,this.uploadEdited(t,r,n)];case 3:return u=h.sent(),c=function(){o(),i.j.e.fire("update.filebrowser")},a(n,this.coreSupportsSaved()?{action:"saved",box:s,newPath:u||void 0}:{action:"resize",box:s},c,function(e){o(),i.error(e)}),[3,5];case 4:return d=h.sent(),o(),this.error(d),[3,5];case 5:return[2]}})}).call(this)}},{key:"uploadEdited",value:function(e,t,n){return(0,i._)(function(){var i,r,a,o,s,l,u,c,d,f,p;return(0,h._)(this,function(h){switch(h.label){case 0:return[4,this.j.dataProvider.getPathByUrl(e)];case 1:if(o=(a=h.sent()).source,s=a.path,l=a.name,!(u=this.connectorUrl()))throw Error("No connector configured for imageSave");return c=String(n||l||"image.png"),(d=new FormData).append("action","imageSave"),d.append("source",String(null!=o?o:"")),d.append("path",String(null!=s?s:"")),d.append("name",c),d.append("files[0]",t,c),f=u.includes("?")?"&":"?",[4,fetch("".concat(u).concat(f,"action=imageSave"),{method:"POST",body:d,credentials:"include"})];case 2:return[4,h.sent().json()];case 3:if(!(p=h.sent()).success)throw Error(p.message||"Failed to save the edited image");return[2,null!=(i=null==(r=p.data)?void 0:r.newPath)?i:""]}})}).call(this)}},{key:"coreSupportsSaved",value:function(){var e=this.j.getVersion?this.j.getVersion():"",t=(0,c._)(e.split(".").map(function(e){return parseInt(e,10)||0}),3),n=t[0],i=void 0===n?0:n,r=t[1],a=void 0===r?0:r,o=t[2];return i>4||4===i&&(a>12||12===a&&(void 0===o?0:o)>=34)}},{key:"connectorUrl",value:function(){var e,t,n=null==(e=this.j.o.ajax)?void 0:e.url,i=null==(t=this.j.o.uploader)?void 0:t.url;return"string"==typeof n&&n?n:"string"==typeof i&&i?i:""}},{key:"loadImage",value:function(e){return(0,i._)(function(){var t,n,i;return(0,h._)(this,function(r){switch(r.label){case 0:if(!(t=this.connectorUrl()))return[3,4];r.label=1;case 1:return r.trys.push([1,3,,4]),[4,this.loadViaConnector(t,e)];case 2:return[2,r.sent()];case 3:return r.sent(),[3,4];case 4:return n=e.includes("?")?"&":"?",[4,fetch("".concat(e).concat(n,"_tst=").concat(Date.now()),{credentials:"include"})];case 5:if(!(i=r.sent()).ok)throw Error("Failed to load image (".concat(i.status,")"));return[2,i.blob()]}})}).call(this)}},{key:"loadViaConnector",value:function(e,t){return(0,i._)(function(){var n,i,r,a,o,s,l,u;return(0,h._)(this,function(c){switch(c.label){case 0:return[4,this.j.dataProvider.getPathByUrl(t)];case 1:return r=(i=c.sent()).source,a=i.path,o=i.name,(s=new FormData).append("action","imageLoad"),s.append("source",String(null!=r?r:"")),s.append("path",String(null!=a?a:"")),s.append("name",String(null!=o?o:"")),l=e.includes("?")?"&":"?",[4,fetch("".concat(e).concat(l,"action=imageLoad"),{method:"POST",body:s,credentials:"include"})];case 2:return[4,c.sent().json()];case 3:if(!(u=c.sent()).success||!(null==(n=u.data)?void 0:n.content))throw Error(u.message||"Failed to load the image");return[4,fetch(u.data.content)];case 4:return[2,c.sent().blob()]}})}).call(this)}},{key:"blobSize",value:function(e){return(0,i._)(function(){var t,n;return(0,h._)(this,function(i){switch(i.label){case 0:return[4,createImageBitmap(e)];case 1:return n={w:(t=i.sent()).width,h:t.height},t.close(),[2,n]}})})()}},{key:"error",value:function(e){this.j.e.fire("errorMessage",e.message)}}]),t}(p.ViewComponent)},45719:function(e,t,n){n(6441).Config.prototype.imageEditorPro={dialog:{width:"90%",height:"90%"}}},98270:function(e,t,n){n.r(t),n.d(t,{imageEditorPro:function(){return d}});var i=n(80294),r=n(20616),a=n(67709),o=n(82749),s=n(18766),l=n(23078);n(45719);var u=n(76542),c=n(50911),h=n(2692),d=function(e){function t(){return(0,r._)(this,t),(0,i._)(this,t,arguments)}return(0,s._)(t,e),(0,a._)(t,[{key:"afterInit",value:function(e){var t=u.ProImageEditor,n=h.JoditPro.modules;n.ImageEditorCore||n.ImageEditor===t||(n.ImageEditorCore=n.ImageEditor),n.ImageEditor=t}},{key:"beforeDestruct",value:function(e){}}]),t}((0,l._)(c.Plugin));(0,o._)(d,"requires",["license"]),h.JoditPro.plugins.add("imageEditorPro",d)},85013:function(e,t,n){function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=Array(t);t>n;n++)i[n]=e[n];return i}function r(e,t,n,i,r,a,o){try{var s=e[a](o),l=s.value}catch(e){n(e);return}s.done?t(l):Promise.resolve(l).then(i,r)}function a(e){return function(){var t=this,n=arguments;return new Promise(function(i,a){var o=e.apply(t,n);function s(e){r(o,i,a,s,l,"next",e)}function l(e){r(o,i,a,s,l,"throw",e)}s(void 0)})}}function o(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}function s(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function l(e,t,n){return t&&s(e.prototype,t),n&&s(e,n),e}function u(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function c(e,t){return null!=t&&"u">typeof Symbol&&t[Symbol.hasInstance]?!!t[Symbol.hasInstance](e):e instanceof t}function h(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},i=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(i=i.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),i.forEach(function(t){u(e,t,n[t])})}return e}function d(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}function f(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,i,r=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var a=[],o=!0,s=!1;try{for(r=r.call(e);!(o=(n=r.next()).done)&&(a.push(n.value),!t||a.length!==t);o=!0);}catch(e){s=!0,i=e}finally{try{o||null==r.return||r.return()}finally{if(s)throw i}}return a}}(e,t)||b(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function p(e){return function(e){if(Array.isArray(e))return i(e)}(e)||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||b(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function g(e){return e&&"u">typeof Symbol&&e.constructor===Symbol?"symbol":typeof e}function b(e,t){if(e){if("string"==typeof e)return i(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return i(e,t)}}function m(e,t){var n,i,r,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]},o=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),s=Object.defineProperty;return s(o,"next",{value:l(0)}),s(o,"throw",{value:l(1)}),s(o,"return",{value:l(2)}),"function"==typeof Symbol&&s(o,Symbol.iterator,{value:function(){return this}}),o;function l(s){return function(l){var u=[s,l];if(n)throw TypeError("Generator is already executing.");for(;o&&(o=0,u[0]&&(a=0)),a;)try{if(n=1,i&&(r=2&u[0]?i.return:u[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,u[1])).done)return r;switch(i=0,r&&(u=[2&u[0],r.value]),u[0]){case 0:case 1:r=u;break;case 4:return a.label++,{value:u[1],done:!1};case 5:a.label++,i=u[1],u=[0];continue;case 7:u=a.ops.pop(),a.trys.pop();continue;default:if(!(r=(r=a.trys).length>0&&r[r.length-1])&&(6===u[0]||2===u[0])){a=0;continue}if(3===u[0]&&(!r||u[1]>r[0]&&u[1]<r[3])){a.label=u[1];break}if(6===u[0]&&a.label<r[1]){a.label=r[1],r=u;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(u);break}r[2]&&a.ops.pop(),a.trys.pop();continue}u=t.call(e,a)}catch(e){u=[6,e],i=0}finally{n=r=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}}n.d(t,{ICONS:function(){return eL},ImageEditor:function(){return e4},selectors:function(){return W}});try{if("u">typeof document){var y=document.createElement("style");y.appendChild(document.createTextNode("/*\n * Jodit Image Editor — design system & layout.\n *\n * Everything is scoped under `.jie` so the stylesheet can be injected into any\n * page without leaking. Tokens are CSS custom properties; switching `data-theme`\n * re-themes the whole tree. PostCSS handles nesting + autoprefixing.\n */\n\n.jie {\n /* palette */\n --jie-accent: #5b5fc7;\n --jie-accent-soft: #eceefb;\n --jie-bg: #ffffff;\n --jie-surface: #ffffff;\n --jie-stage: #f3f4f8;\n --jie-border: #e6e8ef;\n --jie-text: #1f2430;\n --jie-text-dim: #8a90a2;\n --jie-danger: #e0533d;\n --jie-shadow: 0 1px 2px rgba(20, 24, 40, 0.06), 0 8px 24px rgba(20, 24, 40, 0.06);\n\n /* sizing scale — one system for every control */\n --jie-control-h: 38px; /* shared height: buttons, inputs, selects, color, slider row */\n --jie-control-px: 12px; /* horizontal padding inside controls */\n --jie-icon: 20px; /* inline icon size (rail icons override to 24) */\n --jie-radius: 12px; /* cards / panels */\n --jie-radius-sm: 8px; /* controls */\n --jie-gap: 16px; /* between groups */\n --jie-gap-sm: 8px; /* between controls in a row */\n --jie-font-sm: 13px;\n --jie-font-md: 14px;\n --jie-rail-w: 92px;\n --jie-font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;\n\n position: relative;\n display: flex;\n flex-direction: column;\n width: 100%;\n height: 100%;\n min-height: 420px;\n box-sizing: border-box;\n font-family: var(--jie-font);\n color: var(--jie-text);\n background: var(--jie-bg);\n border: 1px solid var(--jie-border);\n border-radius: var(--jie-radius);\n overflow: hidden;\n -webkit-user-select: none;\n user-select: none;\n}\n\n.jie *,.jie *::before,.jie *::after {\n box-sizing: border-box;\n }\n\n.jie[data-theme='dark'] {\n --jie-accent: #8a8df0;\n --jie-accent-soft: #2a2d44;\n --jie-bg: #14161f;\n --jie-surface: #1b1e2a;\n --jie-stage: #0f1118;\n --jie-border: #2a2e3d;\n --jie-text: #e7e9f3;\n --jie-text-dim: #8b91a7;\n --jie-shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.4);\n }\n\n/* ---- top bar ------------------------------------------------------------ */\n.jie-topbar {\n display: flex;\n align-items: center;\n gap: var(--jie-gap);\n padding: 12px 16px;\n border-bottom: 1px solid var(--jie-border);\n background: var(--jie-surface);\n}\n\n.jie-topbar__save {\n display: flex;\n align-items: center;\n gap: 8px;\n}\n\n.jie-topbar__meta {\n display: flex;\n align-items: center;\n gap: 12px;\n margin: 0 auto;\n color: var(--jie-text-dim);\n font-size: 14px;\n}\n\n.jie-zoom {\n display: flex;\n align-items: center;\n gap: 6px;\n font-variant-numeric: tabular-nums;\n}\n\n.jie-topbar__actions {\n display: flex;\n align-items: center;\n gap: 4px;\n}\n\n/* ---- buttons ------------------------------------------------------------ */\n.jie-btn {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n gap: 6px;\n height: var(--jie-control-h);\n min-width: var(--jie-control-h); /* single-char buttons (B / I) stay square */\n padding: 0 var(--jie-control-px);\n font: inherit;\n font-size: var(--jie-font-md);\n font-weight: 600;\n line-height: 1;\n white-space: nowrap;\n color: var(--jie-text);\n background: transparent;\n border: 1px solid transparent;\n border-radius: var(--jie-radius-sm);\n cursor: pointer;\n transition:\n background 0.12s ease,\n color 0.12s ease,\n border-color 0.12s ease;\n}\n.jie-btn:hover:not(:disabled) {\n background: var(--jie-accent-soft);\n }\n.jie-btn:disabled {\n opacity: 0.4;\n cursor: default;\n }\n/* inline icons are smaller than the standalone rail icons */\n.jie-btn .jie-icon {\n width: var(--jie-icon);\n height: var(--jie-icon);\n }\n\n.jie-btn--primary {\n color: #fff;\n background: var(--jie-accent);\n padding-inline: 18px;\n}\n\n.jie-btn--primary:hover:not(:disabled) {\n background: color-mix(in srgb, var(--jie-accent) 88%, #000);\n }\n\n.jie-btn--icon {\n width: var(--jie-control-h);\n padding: 0;\n color: var(--jie-text-dim);\n}\n\n.jie-btn--icon:hover:not(:disabled) {\n color: var(--jie-text);\n }\n\n.jie-btn--active {\n color: var(--jie-accent);\n background: var(--jie-accent-soft);\n}\n\n/* text-style modifiers (the B / I annotation toggles) */\n.jie-btn--bold {\n font-weight: 800;\n}\n.jie-btn--italic {\n font-style: italic;\n font-family: Georgia, 'Times New Roman', serif;\n}\n\n.jie-icon {\n display: inline-flex;\n width: 24px;\n height: 24px;\n}\n\n.jie-icon svg {\n width: 100%;\n height: 100%;\n }\n\n/* ---- body / rail -------------------------------------------------------- */\n.jie-body {\n display: flex;\n flex: 1;\n min-height: 0;\n}\n\n.jie-rail {\n display: flex;\n flex-direction: column;\n gap: 6px;\n width: var(--jie-rail-w);\n padding: 14px 10px;\n border-right: 1px solid var(--jie-border);\n background: var(--jie-surface);\n overflow-y: auto;\n}\n\n.jie-tab {\n display: flex;\n flex-direction: column;\n align-items: center;\n gap: 6px;\n padding: 12px 6px;\n font-size: 12px;\n font-weight: 600;\n color: var(--jie-text-dim);\n background: transparent;\n border: 0;\n border-radius: var(--jie-radius-sm);\n cursor: pointer;\n transition:\n background 0.12s ease,\n color 0.12s ease;\n}\n\n.jie-tab:hover {\n background: var(--jie-accent-soft);\n }\n\n.jie-tab[aria-selected='true'] {\n color: var(--jie-accent);\n background: var(--jie-accent-soft);\n }\n\n/* ---- stage / preview ---------------------------------------------------- */\n.jie-stage {\n display: flex;\n flex: 1;\n flex-direction: column;\n min-width: 0;\n background: var(--jie-bg);\n}\n\n.jie-canvas-wrap {\n position: relative;\n flex: 1;\n margin: 16px;\n border-radius: var(--jie-radius);\n background: var(--jie-stage);\n overflow: hidden;\n touch-action: none;\n}\n\n.jie-canvas {\n position: absolute;\n inset: 0;\n width: 100%;\n height: 100%;\n display: block;\n}\n\n/* ---- transient status (loading / saving / error) ------------------------- */\n\n.jie-spinner {\n display: inline-block;\n flex: 0 0 auto;\n width: var(--jie-icon);\n height: var(--jie-icon);\n border: 2px solid currentColor;\n border-right-color: transparent;\n border-radius: 50%;\n animation: jie-spin 0.8s linear infinite;\n}\n\n@keyframes jie-spin {\n to {\n transform: rotate(360deg);\n }\n}\n\n/* Covers the canvas while the image is loading, or shows the load error. */\n.jie-overlay {\n position: absolute;\n inset: 0;\n z-index: 2;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n gap: var(--jie-gap-sm);\n font-size: var(--jie-font-md);\n color: var(--jie-text-dim);\n background: var(--jie-stage);\n}\n.jie-overlay .jie-spinner {\n width: 32px;\n height: 32px;\n border-width: 3px;\n color: var(--jie-accent);\n }\n\n.jie-overlay--error {\n color: var(--jie-danger);\n}\n\n.jie-overlay__detail {\n max-width: 80%;\n font-size: var(--jie-font-sm);\n text-align: center;\n color: var(--jie-text-dim);\n}\n\n/* crop overlay */\n.jie-crop {\n position: absolute;\n border: 1.5px dashed var(--jie-accent);\n box-shadow: 0 0 0 100vmax var(--jie-scrim, rgba(17, 24, 39, 0.45));\n transform-origin: center;\n cursor: move;\n}\n\n/*\n * Rotation knob, centred *above* the frame and connected by a short stem. The\n * preview keeps `VIEWPORT_PADDING` around the image, so the knob has room and is\n * never clipped — even for a full-image crop.\n */\n.jie-crop__rotate {\n position: absolute;\n left: 50%;\n top: -34px;\n width: 18px;\n height: 18px;\n margin-left: -9px;\n background: var(--jie-bg);\n border: 2px solid var(--jie-accent);\n border-radius: 50%;\n box-shadow: 0 1px 3px rgba(20, 24, 40, 0.3);\n cursor: grab;\n touch-action: none;\n\n /* stem runs from the knob's bottom (-16px) toward the frame, stopping ~5px\n short of the edge so it never touches/overlaps the dashed border */\n}\n.jie-crop__rotate::before {\n content: '';\n position: absolute;\n left: 50%;\n top: 18px;\n width: 2px;\n height: 11px;\n margin-left: -1px;\n background: var(--jie-accent);\n }\n.jie-crop__rotate:active {\n cursor: grabbing;\n }\n\n.jie-crop__handle {\n position: absolute;\n width: 14px;\n height: 14px;\n background: var(--jie-bg);\n border: 2px solid var(--jie-accent);\n border-radius: 50%;\n}\n\n.jie-crop__handle[data-h='nw'] {\n top: -7px;\n left: -7px;\n cursor: nwse-resize;\n }\n\n.jie-crop__handle[data-h='ne'] {\n top: -7px;\n right: -7px;\n cursor: nesw-resize;\n }\n\n.jie-crop__handle[data-h='sw'] {\n bottom: -7px;\n left: -7px;\n cursor: nesw-resize;\n }\n\n.jie-crop__handle[data-h='se'] {\n bottom: -7px;\n right: -7px;\n cursor: nwse-resize;\n }\n\n/* ---- bottom panel ------------------------------------------------------- */\n.jie-panel {\n display: flex;\n flex-direction: column;\n gap: 14px;\n align-items: center;\n padding: 14px 16px 20px;\n border-top: 1px solid var(--jie-border);\n background: var(--jie-surface);\n}\n\n/* a row of equal-height controls, centred on a shared baseline */\n.jie-toolrow {\n display: flex;\n flex-wrap: wrap;\n gap: var(--jie-gap-sm);\n align-items: center;\n justify-content: center;\n}\n\n/* a row of labelled (label-above) fields; inputs and buttons share a height,\n so aligning their bottoms keeps everything tidy */\n.jie-fieldrow {\n display: flex;\n flex-wrap: wrap;\n gap: var(--jie-gap);\n align-items: flex-end;\n justify-content: center;\n}\n\n.jie-field {\n display: flex;\n flex-direction: column;\n gap: 4px;\n font-size: var(--jie-font-sm);\n color: var(--jie-text-dim);\n}\n\n.jie-input,\n.jie-select {\n height: var(--jie-control-h);\n width: 120px;\n padding: 0 var(--jie-control-px);\n font: inherit;\n font-size: var(--jie-font-md);\n color: var(--jie-text);\n background: var(--jie-bg);\n border: 1px solid var(--jie-border);\n border-radius: var(--jie-radius-sm);\n}\n\n:is(.jie-input,.jie-select):focus {\n outline: 2px solid var(--jie-accent-soft);\n border-color: var(--jie-accent);\n }\n\n/* native colour input, normalised to the control height as a rounded swatch */\n/* colour picker: a swatch button that opens a popover of preset swatches */\n.jie-colorpicker {\n position: relative;\n display: inline-flex;\n}\n\n/* the trigger swatch (shows the current colour via inline `background`) */\n.jie-color {\n width: var(--jie-control-h);\n height: var(--jie-control-h);\n padding: 0;\n border: 1px solid var(--jie-border);\n border-radius: var(--jie-radius-sm);\n box-shadow: inset 0 0 0 2px var(--jie-bg);\n cursor: pointer;\n}\n\n.jie-popover__backdrop {\n position: fixed;\n inset: 0;\n z-index: 50;\n}\n\n.jie-popover {\n position: absolute;\n bottom: calc(100% + 8px);\n left: 50%;\n transform: translateX(-50%);\n z-index: 51;\n padding: 10px;\n background: var(--jie-surface);\n border: 1px solid var(--jie-border);\n border-radius: var(--jie-radius);\n box-shadow: var(--jie-shadow);\n}\n\n.jie-swatches {\n display: grid;\n grid-template-columns: repeat(6, 1fr);\n gap: 8px;\n}\n\n/* 3\xd73 position anchor grid */\n.jie-posgrid {\n display: grid;\n grid-template-columns: repeat(3, 1fr);\n gap: 2px;\n padding: 3px;\n background: var(--jie-bg);\n border: 1px solid var(--jie-border);\n border-radius: var(--jie-radius-sm);\n}\n\n.jie-posgrid__cell {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 22px;\n height: 22px;\n padding: 0;\n color: var(--jie-text-dim);\n background: transparent;\n border: 0;\n border-radius: 5px;\n cursor: pointer;\n}\n\n.jie-posgrid__cell .jie-icon {\n width: 16px;\n height: 16px;\n }\n\n.jie-posgrid__cell:hover {\n background: var(--jie-accent-soft);\n color: var(--jie-text);\n }\n\n.jie-posgrid__cell[aria-pressed='true'] {\n background: var(--jie-accent);\n color: #fff;\n }\n\n/* font selector */\n.jie-fontselect {\n position: relative;\n display: inline-flex;\n}\n\n.jie-fontselect__trigger {\n display: inline-flex;\n align-items: center;\n gap: 6px;\n height: var(--jie-control-h);\n min-width: 130px;\n padding: 0 10px;\n font: inherit;\n font-size: var(--jie-font-md);\n color: var(--jie-text);\n background: var(--jie-bg);\n border: 1px solid var(--jie-border);\n border-radius: var(--jie-radius-sm);\n cursor: pointer;\n}\n\n.jie-fontselect__trigger > span {\n flex: 1;\n text-align: left;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n\n.jie-fontselect__trigger .jie-icon {\n width: 16px;\n height: 16px;\n color: var(--jie-text-dim);\n flex: none;\n }\n\n.jie-fontlist {\n min-width: 180px;\n max-height: 260px;\n overflow-y: auto;\n padding: 6px;\n display: flex;\n flex-direction: column;\n gap: 2px;\n}\n\n.jie-fontlist__item {\n padding: 8px 10px;\n font-size: 15px;\n text-align: left;\n color: var(--jie-text);\n background: transparent;\n border: 0;\n border-radius: var(--jie-radius-sm);\n cursor: pointer;\n}\n\n.jie-fontlist__item:hover {\n background: var(--jie-accent-soft);\n }\n\n.jie-fontlist__item[aria-pressed='true'] {\n color: var(--jie-accent);\n background: var(--jie-accent-soft);\n }\n\n.jie-swatch {\n width: 28px;\n height: 28px;\n padding: 0;\n border: 1px solid var(--jie-border);\n border-radius: var(--jie-radius-sm);\n box-shadow: inset 0 0 0 2px var(--jie-surface);\n cursor: pointer;\n transition:\n transform 0.1s ease,\n box-shadow 0.1s ease;\n}\n\n.jie-swatch:hover {\n transform: scale(1.08);\n }\n\n.jie-swatch[aria-pressed='true'] {\n box-shadow:\n inset 0 0 0 2px var(--jie-surface),\n 0 0 0 2px var(--jie-accent);\n }\n\n/* slider — the whole control occupies the shared height and centres its track */\n.jie-slider {\n display: flex;\n align-items: center;\n gap: 10px;\n height: var(--jie-control-h);\n width: clamp(180px, 28vw, 300px);\n}\n\n.jie-slider__label {\n font-size: var(--jie-font-sm);\n color: var(--jie-text-dim);\n white-space: nowrap;\n}\n\n.jie-slider__value {\n min-width: 2.5ch;\n text-align: right;\n font-variant-numeric: tabular-nums;\n font-weight: 600;\n}\n\n/*\n * Fully custom range so it looks identical across evergreen browsers (the\n * native `accent-color` only themes the colour, not the track/thumb shapes).\n * The filled portion is driven by `--jie-range-fill` (set per render by the\n * slider component) on WebKit, and by the native `::-moz-range-progress` on\n * Firefox.\n */\n.jie-range {\n --jie-range-fill: 50%;\n appearance: none;\n flex: 1;\n min-width: 0;\n height: 16px; /* hit area */\n background: transparent;\n cursor: pointer;\n}\n.jie-range::-webkit-slider-runnable-track {\n height: 4px;\n border-radius: 999px;\n background: linear-gradient(\n to right,\n var(--jie-accent) var(--jie-range-fill),\n var(--jie-border) var(--jie-range-fill)\n );\n }\n.jie-range::-webkit-slider-thumb {\n appearance: none;\n margin-top: -6px; /* centre the 16px thumb on the 4px track */\n width: 16px;\n height: 16px;\n border-radius: 50%;\n background: var(--jie-accent);\n border: 2px solid var(--jie-bg);\n box-shadow: 0 1px 3px rgba(20, 24, 40, 0.25);\n }\n.jie-range::-moz-range-track {\n height: 4px;\n border-radius: 999px;\n background: var(--jie-border);\n }\n.jie-range::-moz-range-progress {\n height: 4px;\n border-radius: 999px;\n background: var(--jie-accent);\n }\n.jie-range::-moz-range-thumb {\n width: 16px;\n height: 16px;\n border-radius: 50%;\n background: var(--jie-accent);\n border: 2px solid var(--jie-bg);\n box-shadow: 0 1px 3px rgba(20, 24, 40, 0.25);\n }\n.jie-range:focus-visible {\n outline: none;\n }\n.jie-range:focus-visible::-webkit-slider-thumb {\n box-shadow: 0 0 0 4px var(--jie-accent-soft);\n }\n.jie-range:focus-visible::-moz-range-thumb {\n box-shadow: 0 0 0 4px var(--jie-accent-soft);\n }\n\n/* filter thumbnails */\n.jie-thumbs {\n display: flex;\n gap: 12px;\n width: 100%;\n padding-bottom: 4px;\n overflow-x: auto;\n justify-content: flex-start;\n}\n\n.jie-thumb {\n display: flex;\n flex-direction: column;\n gap: 6px;\n align-items: center;\n padding: 4px;\n font-size: 12px;\n color: var(--jie-text-dim);\n background: transparent;\n border: 0;\n cursor: pointer;\n}\n\n.jie-thumb canvas,.jie-thumb .jie-thumb__swatch {\n width: 76px;\n height: 56px;\n border-radius: var(--jie-radius-sm);\n border: 2px solid transparent;\n object-fit: cover;\n background: var(--jie-stage);\n }\n\n.jie-thumb[aria-pressed='true'] {\n color: var(--jie-accent);\n }\n\n.jie-thumb[aria-pressed='true'] canvas,.jie-thumb[aria-pressed='true'] .jie-thumb__swatch {\n border-color: var(--jie-accent);\n }\n\n/* ---- responsive / mobile ------------------------------------------------ */\n@media (max-width: 720px) {\n .jie {\n --jie-rail-w: 100%;\n }\n\n .jie-topbar__meta {\n display: none;\n }\n\n .jie-body {\n flex-direction: column-reverse;\n }\n\n .jie-rail {\n flex-direction: row;\n width: 100%;\n border-right: 0;\n border-top: 1px solid var(--jie-border);\n overflow-x: auto;\n }\n\n .jie-tab {\n flex: 0 0 auto;\n min-width: 72px;\n }\n\n .jie-canvas-wrap {\n margin: 10px;\n }\n\n .jie-input {\n width: 100px;\n }\n}\n\n@media (hover: none) {\n .jie-crop__handle {\n width: 22px;\n height: 22px;\n }\n}")),document.head.appendChild(y)}}catch(e){}var x=Object.freeze([{label:"Arial",value:"Arial, Helvetica, sans-serif"},{label:"Helvetica",value:"Helvetica, Arial, sans-serif"},{label:"Verdana",value:"Verdana, Geneva, sans-serif"},{label:"Tahoma",value:"Tahoma, Geneva, sans-serif"},{label:"Trebuchet MS",value:'"Trebuchet MS", Helvetica, sans-serif'},{label:"Times New Roman",value:'"Times New Roman", Times, serif'},{label:"Georgia",value:'Georgia, "Times New Roman", serif'},{label:"Courier New",value:'"Courier New", Courier, monospace'},{label:"Impact",value:"Impact, Haettenschweiler, sans-serif"}]),w=Object.freeze({brightness:0,contrast:0,saturation:0,warmth:0,blur:0}),j=Object.freeze(["#ffffff","#1a1a1a","#9e9689","#4a90e2","#54b98a","#f2c94c","#eb5757","#a29bfe","#8b5cf6","#f178b6","#f2994a","#b8e454","#7ec8f0","#5b6470","#d8d2c8","#eeeeee"]);function k(){return{flip:{horizontal:!1,vertical:!1},rotate:0,angle:0,crop:null,resize:null,finetune:h({},w),filter:"original",annotations:[],focus:null}}function S(){return{source:null,status:"idle",busyVisible:!1,error:null,activeTab:"adjust",activeTool:"crop",zoom:1,history:{entries:[k()],index:0},selectedAnnotationId:null,theme:"light",showToolbar:!0,locale:"en",minCropSize:8,minResizeSize:1,palette:p(j),fonts:x.map(function(e){return h({},e)}),activePopover:null,viewport:null}}function M(e){var t=e.entries[e.index];if(void 0===t)throw RangeError("history index ".concat(e.index," is out of bounds"));return t}function C(e,t){var n=e.entries.slice(0,e.index+1);n.push(t);var i=Math.max(0,n.length-100),r=i>0?n.slice(i):n;return{entries:r,index:r.length-1}}function _(e,t){var n=Math.min(Math.max(t,0),e.entries.length-1);return n===e.index?e:d(h({},e),{index:n})}function z(e,t){var n=e;if(void 0!==t.activeTab&&(n=T(n,{activeTab:t.activeTab})),void 0!==t.activeTool&&(n=T(n,{activeTool:t.activeTool})),void 0!==t.zoom&&(n=T(n,{zoom:!Number.isFinite(i=t.zoom)||i<=0?1:Math.min(Math.max(i,.01),64)})),void 0!==t.theme&&(n=T(n,{theme:t.theme})),void 0!==t.showToolbar&&(n=T(n,{showToolbar:t.showToolbar})),void 0!==t.locale&&(n=T(n,{locale:t.locale})),void 0!==t.minCropSize&&(n=T(n,{minCropSize:Math.max(1,t.minCropSize)})),void 0!==t.minResizeSize&&(n=T(n,{minResizeSize:Math.max(1,t.minResizeSize)})),void 0!==t.palette&&(n=T(n,{palette:t.palette})),void 0!==t.fonts&&(n=T(n,{fonts:t.fonts})),void 0!==t.activePopover&&(n=T(n,{activePopover:t.activePopover})),void 0!==t.status&&(n=T(n,{status:t.status}),"exporting"!==t.status&&n.busyVisible&&(n=T(n,{busyVisible:!1}))),void 0!==t.busyVisible&&(n=T(n,{busyVisible:t.busyVisible})),void 0!==t.error&&(n=T(n,{error:t.error})),void 0!==t.source&&(n=T(n,{source:t.source})),void 0!==t.viewport&&(n=T(n,{viewport:t.viewport})),void 0!==t.selectedAnnotationId&&(n=T(n,{selectedAnnotationId:t.selectedAnnotationId})),t.resetHistory&&(n=T(n,{history:{entries:[k()],index:0}})),t.resetDesign&&(n=T(n,{history:C(n.history,k())})),void 0!==t.design){var i,r,a,o,s,l=d(h({},r=M(n.history),a=t.design),{flip:a.flip?h({},r.flip,a.flip):r.flip,finetune:a.finetune?h({},r.finetune,a.finetune):r.finetune,rotate:void 0!==a.rotate?(90*Math.round(a.rotate/90)%360+360)%360:r.rotate}),u=!1===t.commit?((s=(o=n.history).entries.slice())[o.index]=l,{entries:s,index:o.index}):C(n.history,l);n=T(n,{history:u})}if(void 0!==t.history){var c,f,p=t.history,g="step"in p?(c=n.history,f=p.step,_(c,c.index+f)):_(n.history,p.index);n=T(n,{history:g})}return n}function T(e,t){var n=!0,i=!1,r=void 0;try{for(var a,o=Object.keys(t)[Symbol.iterator]();!(n=(a=o.next()).done);n=!0){var s=a.value;if(e[s]!==t[s])return h({},e,t)}}catch(e){i=!0,r=e}finally{try{n||null==o.return||o.return()}finally{if(i)throw r}}return e}var P=function(){function e(t,n){o(this,e),u(this,"pending",null),u(this,"handle",null),this.schedule=t,this.clear=n}return l(e,[{key:"request",value:function(e){var t=this;this.pending=e,null===this.handle&&(this.handle=this.schedule(function(){return t.flush()}))}},{key:"flush",value:function(){null!==this.handle&&(this.clear(this.handle),this.handle=null);var e=this.pending;this.pending=null,e&&e()}},{key:"cancel",value:function(){null!==this.handle&&(this.clear(this.handle),this.handle=null),this.pending=null}}]),e}(),E=function(){function e(){o(this,e),u(this,"pending",null)}return l(e,[{key:"request",value:function(e){this.pending=e,this.flush()}},{key:"flush",value:function(){var e=this.pending;this.pending=null,e&&e()}},{key:"cancel",value:function(){this.pending=null}}]),e}(),I=function(){function e(){var t,n,i,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};o(this,e),u(this,"state",void 0),u(this,"reducer",void 0),u(this,"scheduler",void 0),u(this,"listeners",new Set),u(this,"notifying",!1),this.state=null!=(t=r.initialState)?t:S(),this.reducer=null!=(n=r.reducer)?n:z,this.scheduler=null!=(i=r.scheduler)?i:new E}return l(e,[{key:"getState",value:function(){return this.state}},{key:"update",value:function(e){var t=this,n=this.reducer(this.state,e);return n!==this.state&&(this.state=n,this.scheduler.request(function(){return t.notify()})),this.state}},{key:"subscribe",value:function(e){var t=this;return this.listeners.add(e),function(){t.listeners.delete(e)}}},{key:"flush",value:function(){this.scheduler.flush()}},{key:"destroy",value:function(){this.scheduler.cancel(),this.listeners.clear()}},{key:"notify",value:function(){if(!this.notifying){this.notifying=!0;try{var e=!0,t=!1,n=void 0;try{for(var i,r=this.listeners[Symbol.iterator]();!(e=(i=r.next()).done);e=!0)(0,i.value)(this.state)}catch(e){t=!0,n=e}finally{try{e||null==r.return||r.return()}finally{if(t)throw n}}}finally{this.notifying=!1}}}}]),e}();function A(e,t,n){return Math.min(Math.max(e,t),n)}function O(e,t){var n=A(e.width,1,t.width),i=A(e.height,1,t.height);return{x:A(e.x,0,t.width-n),y:A(e.y,0,t.height-i),width:n,height:i}}function R(e){return M(e.history)}function B(e){return"adjust"===e.activeTab&&"crop"===e.activeTool}function D(e){var t=R(e);return B(e)?d(h({},t),{crop:null,angle:0}):t}function F(e){return e.history.index>0}function L(e){var t;return(t=e.history).index<t.entries.length-1}function V(e){return e.history.index>0||e.history.entries.length>1}function N(e){if(!e.source)return null;var t=R(e),n=e.source,i=n.width,r=n.height;return 90===t.rotate||270===t.rotate?{width:r,height:i}:{width:i,height:r}}function U(e){var t=R(e);return t.resize?t.resize:t.crop?{width:Math.round(t.crop.width),height:Math.round(t.crop.height)}:N(e)}function q(e){return B(e)?N(e):U(e)}function H(e){var t,n,i,r=q(e);if(!r||!e.viewport)return null;var a={width:Math.max(1,e.viewport.width-88),height:Math.max(1,e.viewport.height-88)},o=(t=Math.min(a.width/r.width,a.height/r.height)||0,n=r.width*t,i=r.height*t,{scale:t,width:n,height:i,offsetX:(a.width-n)/2,offsetY:(a.height-i)/2}).scale*e.zoom,s=r.width*o,l=r.height*o;return{scale:o,width:s,height:l,offsetX:(e.viewport.width-s)/2,offsetY:(e.viewport.height-l)/2,content:r}}function X(e){return R(e).angle}function Y(e){var t=R(e);if(t.crop)return t.crop;var n=N(e);return n?{x:0,y:0,width:n.width,height:n.height}:null}var W=Object.freeze(Object.defineProperty({__proto__:null,VIEWPORT_PADDING:44,selectCanRedo:L,selectCanUndo:F,selectCropAngle:X,selectDesign:R,selectEffectiveCrop:Y,selectIsCropping:B,selectIsDirty:V,selectOrientedSize:N,selectOutputSize:U,selectPreviewContentSize:q,selectPreviewDesign:D,selectViewportFit:H},Symbol.toStringTag,{value:"Module"})),Z=Math.PI/180,G={nw:[-1,-1],ne:[1,-1],sw:[-1,1],se:[1,1]};function K(e){return{x:e.x+e.width/2,y:e.y+e.height/2}}function J(e,t,n,i){var r=K(e),a=t*Z,o=Math.cos(a),s=Math.sin(a),l=n*e.width/2,u=i*e.height/2;return{x:r.x+l*o-u*s,y:r.y+l*s+u*o}}function $(e,t,n,i){return Math.atan2(i-t,n-e)/Z}function Q(e,t,n){et(e,"width"),et(t,"height");var i=e*t*4;if(n&&n.length!==i)throw RangeError("data length ".concat(n.length," does not match ").concat(e,"x").concat(t," (").concat(i,")"));return{width:e,height:t,data:null!=n?n:new Uint8ClampedArray(i)}}function ee(e,t,n){return(n*e.width+t)*4}function et(e,t){if(!Number.isInteger(e)||e<=0)throw RangeError("".concat(t," must be a positive integer, got ").concat(e))}function en(e,t){for(var n=Q(e.width,e.height),i=e.width,r=e.height,a=0;a<r;a++)for(var o=0;o<i;o++)er(e,ee(e,"horizontal"===t?i-1-o:o,"vertical"===t?r-1-a:a),n,ee(n,o,a));return n}function ei(e,t){var n=Math.max(1,Math.round(t.width)),i=Math.max(1,Math.round(t.height));if(n===e.width&&i===e.height)return Q(n,i,new Uint8ClampedArray(e.data));for(var r=e;r.width>=2*n;)r=function(e){for(var t=Math.ceil(e.width/2),n=Q(t,e.height),i=0;i<e.height;i++)for(var r=0;r<t;r++)for(var a=ee(e,2*r,i),o=ee(e,Math.min(2*r+1,e.width-1),i),s=ee(n,r,i),l=0;l<4;l++)n.data[s+l]=(e.data[a+l]+e.data[o+l])/2;return n}(r);for(;r.height>=2*i;)r=function(e){for(var t=Math.ceil(e.height/2),n=Q(e.width,t),i=0;i<t;i++)for(var r=0;r<e.width;r++)for(var a=ee(e,r,2*i),o=ee(e,r,Math.min(2*i+1,e.height-1)),s=ee(n,r,i),l=0;l<4;l++)n.data[s+l]=(e.data[a+l]+e.data[o+l])/2;return n}(r);return r.width===n&&r.height===i?Q(n,i,new Uint8ClampedArray(r.data)):function(e,t,n){for(var i=Q(t,n),r=e.width/t,a=e.height/n,o=0;o<n;o++)for(var s=(o+.5)*a-.5,l=Math.floor(s),u=s-l,c=ea(l,e.height),h=ea(l+1,e.height),d=0;d<t;d++)for(var f=(d+.5)*r-.5,p=Math.floor(f),g=f-p,b=ea(p,e.width),m=ea(p+1,e.width),y=ee(e,b,c),x=ee(e,m,c),w=ee(e,b,h),j=ee(e,m,h),k=ee(i,d,o),S=0;S<4;S++){var M,C,_,z,T,P=(M=e.data[y+S],C=e.data[x+S],M+(C-M)*g),E=(_=e.data[w+S],z=e.data[j+S],_+(z-_)*g);i.data[k+S]=(T=P)+(E-T)*u}return i}(r,n,i)}function er(e,t,n,i){n.data[i]=e.data[t],n.data[i+1]=e.data[t+1],n.data[i+2]=e.data[t+2],n.data[i+3]=e.data[t+3]}function ea(e,t){return e<0?0:e>=t?t-1:e}function eo(e,t){for(var n=Q(e.width,e.height,new Uint8ClampedArray(e.data)),i=0;i<n.data.length;i+=4)n.data[i]=t(n.data[i],0),n.data[i+1]=t(n.data[i+1],1),n.data[i+2]=t(n.data[i+2],2);return n}function es(e,t){if(0===t)return ev(e);var n=t/100*255;return eo(e,function(e){return e+n})}function el(e,t){if(0===t)return ev(e);var n=t/100*255,i=259*(n+255)/(255*(259-n));return eo(e,function(e){return i*(e-128)+128})}function eu(e,t){if(0===t)return ev(e);for(var n=1+t/100,i=Q(e.width,e.height,new Uint8ClampedArray(e.data)),r=0;r<i.data.length;r+=4){var a=i.data[r],o=i.data[r+1],s=i.data[r+2],l=.299*a+.587*o+.114*s;i.data[r]=l+(a-l)*n,i.data[r+1]=l+(o-l)*n,i.data[r+2]=l+(s-l)*n}return i}function ec(e,t){if(0===t)return ev(e);var n=t/100*40;return eo(e,function(e,t){return 0===t?e+n:2===t?e-n:e})}function eh(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:20,i=Math.round(Math.max(0,Math.min(100,t))/100*n);return i<=0?ev(e):ef(ef(e,i,"horizontal"),i,"vertical")}function ed(e,t){var n=e;return eh(n=ec(n=eu(n=el(n=es(n,t.brightness),t.contrast),t.saturation),t.warmth),t.blur)}function ef(e,t,n){for(var i=Q(e.width,e.height),r=e.width,a=e.height,o=e.data,s="horizontal"===n,l=s?a:r,u=s?r:a,c=2*t+1,h=0;l>h;h++)for(var d=0;d<4;d++){for(var f=0,p=-t;t>=p;p++)f+=ep(o,r,a,s,h,p,d);for(var g=0;u>g;g++){var b=(s?h*r+g:g*r+h)*4+d;i.data[b]=f/c;var m=ep(o,r,a,s,h,g-t,d);f+=ep(o,r,a,s,h,g+t+1,d)-m}}return i}function ep(e,t,n,i,r,a,o){var s=(i?t:n)-1,l=a<0?0:a>s?s:a;return e[(i?r*t+l:l*t+r)*4+o]}function ev(e){return Q(e.width,e.height,new Uint8ClampedArray(e.data))}function eg(e,t){for(var n=Q(e.width,e.height,new Uint8ClampedArray(e.data)),i=0;i<n.data.length;i+=4){var r=f(t(n.data[i],n.data[i+1],n.data[i+2]),3),a=r[0],o=r[1],s=r[2];n.data[i]=a,n.data[i+1]=o,n.data[i+2]=s}return n}Object.freeze(Object.defineProperty({__proto__:null,applyFinetune:ed,blur:eh,brightness:es,contrast:el,saturation:eu,warmth:ec},Symbol.toStringTag,{value:"Module"}));var eb=function(e){return Q(e.width,e.height,new Uint8ClampedArray(e.data))},em=new Map;function ey(e){return em.set(e.id,e),function(){em.get(e.id)===e&&em.delete(e.id)}}function ex(e,t){var n=em.get(t);return n?n.apply(e):eb(e)}function ew(e){return new ImageData(e.data,e.width,e.height)}[{id:"original",label:"Original",apply:eb},{id:"invert",label:"Invert",apply:function(e){return eg(e,function(e,t,n){return[255-e,255-t,255-n]})}},{id:"grayscale",label:"Black & White",apply:function(e){return eg(e,function(e,t,n){var i=.299*e+.587*t+.114*n;return[i,i,i]})}},{id:"sepia",label:"Sepia",apply:function(e){return eg(e,function(e,t,n){return[.393*e+.769*t+.189*n,.349*e+.686*t+.168*n,.272*e+.534*t+.131*n]})}},{id:"solarize",label:"Solarize",apply:function(e){return eg(e,function(e,t,n){return[e<128?e:255-e,t<128?t:255-t,n<128?n:255-n]})}},{id:"clarendon",label:"Clarendon",apply:function(e){return ec(eu(el(e,20),25),-10)}},{id:"gingham",label:"Gingham",apply:function(e){return ec(eu(el(e,-10),-15),12)}}].forEach(ey);var ej=function(){function e(){o(this,e),u(this,"locales",new Map)}return l(e,[{key:"register",value:function(e){var t=this,n=this.locales.get(e.id);return this.locales.set(e.id,h({},null!=n?n:{},e.messages)),function(){n?t.locales.set(e.id,n):t.locales.delete(e.id)}}},{key:"has",value:function(e){return this.locales.has(e)}},{key:"get",value:function(e){return this.locales.get(e)}},{key:"list",value:function(){return p(this.locales.keys())}},{key:"translator",value:function(e){var t;return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function(n,i){var r,a,o=null!=(r=null!=(a=e[n])?a:t[n])?r:n;return i?o.replace(/\{(\w+)\}/g,function(e,t){return t in i?String(i[t]):e}):o}}(null!=(t=this.locales.get(e))?t:{})}}]),e}(),ek=new Set(["value","checked","disabled","selected","innerHTML"]);function eS(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return{kind:"element",tag:e,key:t.key,props:t,children:function(e){var t=Array.isArray(e)?e:[e],n=[],i=!0,r=!1,a=void 0;try{for(var o,s=t[Symbol.iterator]();!(i=(o=s.next()).done);i=!0){var l=o.value;null!=l&&!1!==l&&!0!==l&&n.push((void 0===l?"undefined":g(l))==="object"?l:{kind:"text",text:String(l)})}}catch(e){r=!0,a=e}finally{try{i||null==s.return||s.return()}finally{if(r)throw a}}return n}(n)}}function eM(e){return"element"===e.kind}var eC={},e_=function(){function e(t,n){o(this,e),u(this,"events",new WeakMap),u(this,"prev",null),this.host=t,this.container=n}return l(e,[{key:"render",value:function(e){if(null===this.prev){var t=this.mount(e);this.host.insert(this.container,t,null)}else if(ez(this.prev,e))this.patch(this.prev,e);else{var n=this.mount(e),i=this.prev.node;this.host.insert(this.container,n,this.host.nextSibling(i)),this.host.remove(this.container,i)}this.prev=e}},{key:"unmount",value:function(){this.prev&&(this.host.remove(this.container,this.prev.node),this.prev=null)}},{key:"mount",value:function(e){if(!eM(e)){var t=this.host.createText(e.text);return e.node=t,t}var n=this.host.createElement(e.tag);e.node=n,this.applyProps(n,eC,e.props);var i=!0,r=!1,a=void 0;try{for(var o,s=e.children[Symbol.iterator]();!(i=(o=s.next()).done);i=!0){var l=o.value;this.host.insert(n,this.mount(l),null)}}catch(e){r=!0,a=e}finally{try{i||null==s.return||s.return()}finally{if(r)throw a}}return n}},{key:"patch",value:function(e,t){var n=e.node;return(t.node=n,eM(t)&&eM(e))?(this.applyProps(n,e.props,t.props),this.patchChildren(n,e.children,t.children)):eM(t)||t.text===e.text||this.host.setText(n,t.text),n}},{key:"applyProps",value:function(e,t,n){this.applyClass(e,t.class,n.class),this.applyStyle(e,null!=(o=t.style)?o:{},null!=(s=n.style)?s:{}),this.applyEvents(e,null!=(l=t.on)?l:{},null!=(u=n.on)?u:{});var i=!0,r=!1,a=void 0;try{for(var o,s,l,u,c,h=Object.keys(n)[Symbol.iterator]();!(i=(c=h.next()).done);i=!0){var d=c.value;if(!eT(d)){var f=n[d];f!==t[d]&&this.applyAttr(e,d,f)}}}catch(e){r=!0,a=e}finally{try{i||null==h.return||h.return()}finally{if(r)throw a}}var p=!0,g=!1,b=void 0;try{for(var m,y=Object.keys(t)[Symbol.iterator]();!(p=(m=y.next()).done);p=!0){var x=m.value;eT(x)||x in n||(ek.has(x)?this.host.setProperty(e,x,""):this.host.removeAttribute(e,x))}}catch(e){g=!0,b=e}finally{try{p||null==y.return||y.return()}finally{if(g)throw b}}}},{key:"applyAttr",value:function(e,t,n){var i;ek.has(t)?this.host.setProperty(e,t,n):!1===n||null==n?this.host.removeAttribute(e,t):this.host.setAttribute(e,t,!0===n?"":"string"==typeof n?n:"number"==typeof n||"boolean"==typeof n||(void 0===n?"undefined":g(n))==="bigint"?String(n):null!=(i=JSON.stringify(n))?i:"")}},{key:"applyClass",value:function(e,t,n){t!==n&&(n?this.host.setAttribute(e,"class",n):this.host.removeAttribute(e,"class"))}},{key:"applyStyle",value:function(e,t,n){var i=!0,r=!1,a=void 0;try{for(var o,s=Object.keys(n)[Symbol.iterator]();!(i=(o=s.next()).done);i=!0){var l=o.value;n[l]!==t[l]&&this.host.setStyle(e,l,String(n[l]))}}catch(e){r=!0,a=e}finally{try{i||null==s.return||s.return()}finally{if(r)throw a}}var u=!0,c=!1,h=void 0;try{for(var d,f=Object.keys(t)[Symbol.iterator]();!(u=(d=f.next()).done);u=!0){var p=d.value;p in n||this.host.removeStyle(e,p)}}catch(e){c=!0,h=e}finally{try{u||null==f.return||f.return()}finally{if(c)throw h}}}},{key:"applyEvents",value:function(e,t,n){var i=this.events.get(e),r=!0,a=!1,o=void 0;try{for(var s,l=Object.keys(t)[Symbol.iterator]();!(r=(s=l.next()).done);r=!0){var u=s.value;!(u in n)&&(null==i?void 0:i.has(u))&&(this.host.removeEventListener(e,u,i.get(u).wrapper),i.delete(u))}}catch(e){a=!0,o=e}finally{try{r||null==l.return||l.return()}finally{if(a)throw o}}var c=!0,h=!1,d=void 0;try{for(var f,p,g=Object.keys(n)[Symbol.iterator]();!(c=(p=g.next()).done);c=!0)f=this,function(){var t=p.value,r=n[t],a=null==i?void 0:i.get(t);if(a)return a.handler=r;i||(i=new Map,f.events.set(e,i));var o={handler:r,wrapper:function(e){return o.handler(e)}};i.set(t,o),f.host.addEventListener(e,t,o.wrapper)}()}catch(e){h=!0,d=e}finally{try{c||null==g.return||g.return()}finally{if(h)throw d}}}},{key:"patchChildren",value:function(e,t,n){for(var i=0,r=t.length-1,a=0,o=n.length-1,s=null;i<=r&&a<=o;){var l=t[i],u=t[r],c=n[a],h=n[o];if(ez(l,c)){this.patch(l,c),i++,a++;continue}if(ez(u,h)){this.patch(u,h),r--,o--;continue}if(ez(l,h)){this.patch(l,h),this.host.insert(e,l.node,this.host.nextSibling(u.node)),i++,o--;continue}if(ez(u,c)){this.patch(u,c),this.host.insert(e,u.node,l.node),r--,a++;continue}null!=s||(s=function(e,t,n){for(var i=new Map,r=t;r<=n;r++){var a=e[r].key;void 0!==a&&i.set(a,r)}return i}(t,i,r));var d=void 0!==c.key?s.get(c.key):void 0;if(void 0===d)this.host.insert(e,this.mount(c),l.node);else{var f=t[d];this.patch(f,c),f.node=void 0,this.host.insert(e,c.node,l.node)}a++}if(i>r)for(var p,g,b=null!=(p=null==(g=n[o+1])?void 0:g.node)?p:null,m=a;o>=m;m++)this.host.insert(e,this.mount(n[m]),b);else if(a>o)for(var y=i;r>=y;y++){var x=t[y].node;x&&this.host.remove(e,x)}}}]),e}();function ez(e,t){return e.kind===t.kind&&("text"===e.kind||e.tag===t.tag&&e.key===t.key)}function eT(e){return"key"===e||"class"===e||"style"===e||"on"===e}var eP=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document;o(this,e),this.doc=t}return l(e,[{key:"createElement",value:function(e){return this.doc.createElement(e)}},{key:"createText",value:function(e){return this.doc.createTextNode(e)}},{key:"setText",value:function(e,t){e.textContent=t}},{key:"insert",value:function(e,t,n){e.insertBefore(t,n)}},{key:"remove",value:function(e,t){t.parentNode===e&&e.removeChild(t)}},{key:"parent",value:function(e){return e.parentNode}},{key:"nextSibling",value:function(e){return e.nextSibling}},{key:"setAttribute",value:function(e,t,n){e.setAttribute(t,n)}},{key:"removeAttribute",value:function(e,t){e.removeAttribute(t)}},{key:"setProperty",value:function(e,t,n){e[t]=n}},{key:"setStyle",value:function(e,t,n){e.style.setProperty(t,n)}},{key:"removeStyle",value:function(e,t){e.style.removeProperty(t)}},{key:"addEventListener",value:function(e,t,n){e.addEventListener(t,n)}},{key:"removeEventListener",value:function(e,t,n){e.removeEventListener(t,n)}}]),e}(),eE=function(){function e(){o(this,e),u(this,"tools",new Map),u(this,"seq",0),u(this,"order",new Map)}return l(e,[{key:"register",value:function(t){var n,i=this;return this.tools.set(t.id,t),this.order.set(t.id,null!=(n=t.order)?n:e.UNORDERED_BASE+this.seq++),function(){i.tools.get(t.id)===t&&(i.tools.delete(t.id),i.order.delete(t.id))}}},{key:"get",value:function(e){return this.tools.get(e)}},{key:"has",value:function(e){return this.tools.has(e)}},{key:"list",value:function(){var e=this;return p(this.tools.values()).sort(function(t,n){var i,r;return(null!=(i=e.order.get(t.id))?i:0)-(null!=(r=e.order.get(n.id))?r:0)})}},{key:"first",value:function(){return this.list()[0]}}]),e}();function eI(e){return eS("span",{class:"jie-icon",innerHTML:e})}function eA(){return eS("span",{class:"jie-spinner"})}function eO(e){var t,n,i,r=["jie-btn"];"primary"===e.variant&&r.push("jie-btn--primary"),"icon"===e.variant&&r.push("jie-btn--icon"),e.active&&r.push("jie-btn--active"),e.busy&&r.push("jie-btn--busy"),e.className&&r.push(e.className);var a=[];return e.busy?a.push(eA()):e.icon&&a.push(eI(e.icon)),e.label&&a.push(eS("span",{},e.label)),eS("button",{key:e.key,class:r.join(" "),type:"button",disabled:null!=(t=e.disabled)&&t,title:null!=(n=null!=(i=e.title)?i:e.label)?n:"",on:{click:e.onClick}},a)}function eR(e){var t,n=e.onStart,i={input:function(t){return e.onInput(Number(t.target.value))}};n&&(i.pointerdown=function(){return n()});var r=e.max-e.min||1,a=Math.min(100,Math.max(0,(e.value-e.min)/r*100));return eS("div",{class:"jie-slider"},[eS("span",{class:"jie-slider__label"},e.label),eS("input",{class:"jie-range",type:"range",min:String(e.min),max:String(e.max),step:String(null!=(t=e.step)?t:1),value:String(e.value),style:{"--jie-range-fill":"".concat(a,"%")},on:i}),eS("span",{class:"jie-slider__value"},String(Math.round(e.value)))])}function eB(e){return eS("label",{class:"jie-field"},[eS("span",{},e.label),eS("span",{style:{display:"flex","align-items":"center",gap:"6px"}},[eS("input",{class:"jie-input",type:"number",value:String(e.value),on:{change:function(t){var n=Number(t.target.value);Number.isFinite(n)&&e.onChange(n)}}}),e.suffix?eS("span",{},e.suffix):null])])}function eD(e,t,n){return eS("div",{class:"jie-toolrow"},e.map(function(e){return eO({key:e.id,label:e.label,icon:e.icon,active:e.id===t,onClick:function(){return n(e.id)}})}))}u(eE,"UNORDERED_BASE",1e6);var eF=function(e){return'<svg viewBox="0 0 24 24" width="24" height="24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">'.concat(e,"</svg>")},eL={adjust:eF('<path d="M4 8h2M9 8h11M4 16h11M18 16h2"/><circle cx="7.5" cy="8" r="1.6"/><circle cx="16.5" cy="16" r="1.6"/>'),finetune:eF('<path d="M4 7h12M4 12h16M4 17h8"/><circle cx="18" cy="7" r="1.6"/><circle cx="12" cy="17" r="1.6"/>'),filters:eF('<circle cx="9" cy="9" r="5"/><circle cx="15" cy="9" r="5"/><circle cx="12" cy="15" r="5"/>'),watermark:eF('<rect x="3" y="5" width="18" height="14" rx="2"/><path d="M3 15l5-4 4 3 3-2 6 4"/><circle cx="8.5" cy="9.5" r="1.4"/>'),annotate:eF('<path d="M12 20h9"/><path d="M16.5 3.5a2.1 2.1 0 0 1 3 3L7 19l-4 1 1-4Z"/>'),resize:eF('<path d="M9 3H5a2 2 0 0 0-2 2v4M21 15v4a2 2 0 0 1-2 2h-4"/><path d="M8 16l8-8M16 8h-4M16 8v4"/>'),crop:eF('<path d="M6 2v14a2 2 0 0 0 2 2h14"/><path d="M2 6h14a2 2 0 0 1 2 2v14"/>'),rotate:eF('<path d="M3 12a9 9 0 1 0 3-6.7L3 8"/><path d="M3 3v5h5"/>'),flipX:eF('<path d="M12 3v18"/><path d="M8 7 4 12l4 5Z"/><path d="M16 7l4 5-4 5Z"/>'),flipY:eF('<path d="M3 12h18"/><path d="M7 8 12 4l5 4Z"/><path d="M7 16l5 4 5-4Z"/>'),undo:eF('<path d="M9 7 4 12l5 5"/><path d="M4 12h11a5 5 0 0 1 0 10h-1"/>'),redo:eF('<path d="m15 7 5 5-5 5"/><path d="M20 12H9a5 5 0 0 0 0 10h1"/>'),reset:eF('<path d="M3 12a9 9 0 1 1 2.6 6.3"/><path d="M3 21v-5h5"/>'),trash:eF('<path d="M4 7h16M9 7V5a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2v2M6 7l1 13a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1l1-13M10 11v6M14 11v6"/>'),plus:eF('<path d="M12 5v14M5 12h14"/>'),minus:eF('<path d="M5 12h14"/>'),zoomIn:eF('<circle cx="10.5" cy="10.5" r="7.5"/><path d="M21 21l-5.2-5.2M10.5 7.5v6M7.5 10.5h6"/>'),zoomOut:eF('<circle cx="10.5" cy="10.5" r="7.5"/><path d="M21 21l-5.2-5.2M7.5 10.5h6"/>'),posTopLeft:eF('<path d="M17 17 7 7M7 13V7h6"/>'),posTop:eF('<path d="M12 19V6M7 11l5-5 5 5"/>'),posTopRight:eF('<path d="M7 17 17 7M11 7h6v6"/>'),posLeft:eF('<path d="M19 12H6M11 7l-5 5 5 5"/>'),posCenter:eF('<circle cx="12" cy="12" r="6.5"/><circle cx="12" cy="12" r="2" fill="currentColor" stroke="none"/>'),posRight:eF('<path d="M5 12h13M13 7l5 5-5 5"/>'),posBottomLeft:eF('<path d="M17 7 7 17M7 11v6h6"/>'),posBottom:eF('<path d="M12 5v13M7 13l5 5 5-5"/>'),posBottomRight:eF('<path d="M7 7l10 10M17 11v6h-6"/>'),font:eF('<path d="M4 20 9.5 6h1L16 20M6 15h8M17 20l3-9h.5l3 9M18 17h4"/>'),focus:eF('<circle cx="12" cy="12" r="9"/><circle cx="12" cy="12" r="3.5"/>'),lock:eF('<rect x="5" y="11" width="14" height="9" rx="2"/><path d="M8 11V7a4 4 0 0 1 8 0v4"/>'),unlock:eF('<rect x="5" y="11" width="14" height="9" rx="2"/><path d="M8 11V7a4 4 0 0 1 7.5-2"/>'),text:eF('<path d="M5 5h14M12 5v14M9 19h6"/>'),brightness:eF('<circle cx="12" cy="12" r="4"/><path d="M12 2v2M12 20v2M2 12h2M20 12h2M5 5l1.5 1.5M17.5 17.5 19 19M19 5l-1.5 1.5M6.5 17.5 5 19"/>'),contrast:eF('<circle cx="12" cy="12" r="9"/><path d="M12 3a9 9 0 0 0 0 18Z" fill="currentColor" stroke="none"/>'),blur:eF('<path d="M12 3s6 6.5 6 11a6 6 0 0 1-12 0c0-4.5 6-11 6-11Z"/>'),book:eF('<path d="M4 5a2 2 0 0 1 2-2h5v18H6a2 2 0 0 1-2-2Z"/><path d="M20 5a2 2 0 0 0-2-2h-5v18h5a2 2 0 0 0 2-2Z"/>')},eV={id:"adjust",label:"Adjust",icon:eL.adjust,order:0,defaultTool:"crop",renderPanel:function(e){var t=e.state,n=e.update,i=e.t,r=R(t),a=B(t);return eS("div",{class:"jie-toolrow"},[eO({label:i("Crop"),icon:eL.crop,active:a,onClick:function(){return n({activeTab:"adjust",activeTool:a?null:"crop"})}}),eO({label:i("Rotate"),icon:eL.rotate,onClick:function(){return n({design:{rotate:r.rotate+90}})}}),eO({label:i("Flip X"),icon:eL.flipX,onClick:function(){return n({design:{flip:{horizontal:!r.flip.horizontal}}})}}),eO({label:i("Flip Y"),icon:eL.flipY,onClick:function(){return n({design:{flip:{vertical:!r.flip.vertical}}})}})])}},eN=[{id:"brightness",label:"Brightness",icon:eL.brightness,min:-100,max:100},{id:"contrast",label:"Contrast",icon:eL.contrast,min:-100,max:100},{id:"saturation",label:"Saturation",icon:eL.filters,min:-100,max:100},{id:"blur",label:"Blur",icon:eL.blur,min:0,max:100},{id:"warmth",label:"Warmth",icon:eL.brightness,min:-100,max:100}],eU={id:"finetune",label:"Finetune",icon:eL.finetune,order:1,defaultTool:"brightness",renderPanel:function(e){var t,n,i=e.state,r=e.update,a=e.t,o=(t=i.activeTool,null!=(n=eN.find(function(e){return e.id===t}))?n:eN[0]),s=R(i).finetune[o.id],l=function(e,t){r({design:{finetune:u({},o.id,e)},commit:t})};return eS("div",{class:"jie-panel-stack",style:{display:"contents"}},[eR({label:a(o.label),value:s,min:o.min,max:o.max,onStart:function(){return l(s,!0)},onInput:function(e){return l(e,!1)}}),eD(eN.map(function(e){return{id:e.id,label:a(e.label),icon:e.icon}}),o.id,function(e){return r({activeTab:"finetune",activeTool:e})})])}},eq={id:"filters",label:"Filters",icon:eL.filters,order:2,renderPanel:function(e){var t=e.state,n=e.update,i=e.t,r=R(t).filter;return eS("div",{class:"jie-thumbs"},p(em.values()).map(function(e){return eS("button",{key:e.id,class:"jie-thumb",type:"button","aria-pressed":String(e.id===r),on:{click:function(){return n({design:{filter:e.id}})}}},[eS("canvas",{class:"jie-thumb__swatch","data-jie-filter-thumb":e.id}),eS("span",{},i(e.label))])}))}},eH={id:"focus",label:"Focus",icon:eL.focus,order:3,defaultTool:"radial",renderPanel:function(e){var t,n=e.state,i=e.update,r=e.t,a=null!=(t=R(n).focus)?t:{shape:"radial",x:.5,y:.5,radius:.28,angle:0,amount:60},o=null!==R(n).focus,s=function(e,t){return i({design:{focus:h({},a,e)},commit:t})};return eS("div",{class:"jie-panel-stack",style:{display:"contents"}},[eS("div",{class:"jie-toolrow"},[eR({label:r("Intensity"),value:a.amount,min:0,max:100,onStart:function(){return s({amount:a.amount},!0)},onInput:function(e){return s({amount:e},!1)}}),eR({label:r("Radius"),value:Math.round(100*a.radius),min:5,max:90,onStart:function(){return s({radius:a.radius},!0)},onInput:function(e){return s({radius:e/100},!1)}}),o?eO({variant:"icon",icon:eL.trash,title:r("Reset"),onClick:function(){return i({design:{focus:null}})}}):null]),eD([{id:"radial",label:r("Radial")},{id:"linear",label:r("Linear")}],a.shape,function(e){return s({shape:e},!0)})])}},eX=[{align:"left",valign:"top",icon:eL.posTopLeft},{align:"center",valign:"top",icon:eL.posTop},{align:"right",valign:"top",icon:eL.posTopRight},{align:"left",valign:"middle",icon:eL.posLeft},{align:"center",valign:"middle",icon:eL.posCenter},{align:"right",valign:"middle",icon:eL.posRight},{align:"left",valign:"bottom",icon:eL.posBottomLeft},{align:"center",valign:"bottom",icon:eL.posBottom},{align:"right",valign:"bottom",icon:eL.posBottomRight}],eY=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"id",t=0;return function(){return"".concat(e,"-").concat(++t)}}("jie"),eW="text-color",eZ="text-font",eG={id:"annotate",label:"Text",icon:eL.text,order:4,defaultTool:"text",renderPanel:function(e){var t,n,i,r,a,o,s,l,u,c=e.state,d=e.update,f=e.t,p=R(c),g=p.annotations[0];if(!g)return eS("div",{class:"jie-toolrow"},[eO({label:f("Add text"),icon:eL.text,variant:"primary",onClick:function(){var e=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return h({id:e,type:"text",text:"Text",x:.5,y:.5,fontSize:.06,fontFamily:x[0].value,color:"#eb5757",bold:!1,italic:!1,align:"center",valign:"middle"},t)}(eY());d({design:{annotations:[e]},selectedAnnotationId:e.id})}})]);var b=function(e){var t,n;return d({design:{annotations:(t=p.annotations,n=g.id,t.map(function(t){return t.id===n?h({},t,e):t}))}})};return eS("div",{class:"jie-toolrow"},[eS("input",{class:"jie-input",type:"text",value:g.text,on:{input:function(e){return b({text:e.target.value})}}}),(r=(t={value:g.fontFamily,fonts:c.fonts,title:f("Font"),open:c.activePopover===eZ,onToggle:function(){return d({activePopover:c.activePopover===eZ?null:eZ})},onPick:function(e){b({fontFamily:e}),d({activePopover:null})}}).fonts.find(function(e){return e.value===t.value}),a=[eS("button",{class:"jie-fontselect__trigger",type:"button",title:null!=(n=t.title)?n:"Font","aria-haspopup":"listbox","aria-expanded":String(t.open),on:{click:function(){return t.onToggle()}}},[eI(eL.font),eS("span",{style:{"font-family":t.value}},null!=(i=null==r?void 0:r.label)?i:"Font"),eI(eL.book)])],t.open&&a.push(eS("div",{class:"jie-popover__backdrop",on:{click:function(){return t.onToggle()}}}),eS("div",{class:"jie-popover jie-fontlist",role:"listbox"},t.fonts.map(function(e){return eS("button",{key:e.value,class:"jie-fontlist__item",type:"button","aria-pressed":String(e.value===t.value),style:{"font-family":e.value},on:{click:function(){return t.onPick(e.value)}}},e.label)}))),eS("div",{class:"jie-fontselect"},a)),(l=[eS("button",{class:"jie-color",type:"button",title:null!=(s=(o={value:g.color,palette:c.palette,title:f("Colour"),open:c.activePopover===eW,onToggle:function(){return d({activePopover:c.activePopover===eW?null:eW})},onPick:function(e){b({color:e}),d({activePopover:null})}}).title)?s:"Colour",style:{background:o.value},"aria-haspopup":"true","aria-expanded":String(o.open),on:{click:function(){return o.onToggle()}}})],o.open&&l.push(eS("div",{class:"jie-popover__backdrop",on:{click:function(){return o.onToggle()}}}),eS("div",{class:"jie-popover jie-swatches",role:"listbox"},o.palette.map(function(e){return eS("button",{key:e,class:"jie-swatch",type:"button",title:e,style:{background:e},"aria-pressed":String(e.toLowerCase()===o.value.toLowerCase()),on:{click:function(){return o.onPick(e)}}})}))),eS("div",{class:"jie-colorpicker"},l)),eO({label:"B",className:"jie-btn--bold",active:g.bold,onClick:function(){return b({bold:!g.bold})}}),eO({label:"I",className:"jie-btn--italic",active:g.italic,onClick:function(){return b({italic:!g.italic})}}),eR({label:f("Size"),value:Math.round(100*g.fontSize),min:1,max:40,onInput:function(e){return b({fontSize:e/100})}}),(u={align:g.align,valign:g.valign,onPick:function(e,t){return b(h({align:e,valign:t},{x:"left"===e?.04:"right"===e?.96:.5,y:"top"===t?.04:"bottom"===t?.96:.5}))}},eS("div",{class:"jie-posgrid",role:"group"},eX.map(function(e){return eS("button",{key:"".concat(e.valign,"-").concat(e.align),class:"jie-posgrid__cell",type:"button","data-pos":"".concat(e.valign,"-").concat(e.align),"aria-pressed":String(e.align===u.align&&e.valign===u.valign),on:{click:function(){return u.onPick(e.align,e.valign)}}},[eI(e.icon)])}))),eO({variant:"icon",icon:eL.trash,title:f("Delete"),onClick:function(){var e,t;return d({design:{annotations:(e=p.annotations,t=g.id,e.filter(function(e){return e.id!==t}))},selectedAnnotationId:null})}})])}},eK={id:"resize",label:"Resize",icon:eL.resize,order:5,renderPanel:function(e){var t=e.state,n=e.update,i=e.t,r=U(t);if(!r)return null;var a="unlocked"!==t.activeTool,o=function(e){return n({design:{resize:function(e,t,n){var i,r,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,o=e.width/e.height;if(!n)return{width:Math.max(a,Math.round(null!=(i=t.width)?i:e.width)),height:Math.max(a,Math.round(null!=(r=t.height)?r:e.height))};if(void 0!==t.width){var s=Math.max(a,Math.round(t.width));return{width:s,height:Math.max(a,Math.round(s/o))}}if(void 0!==t.height){var l=Math.max(a,Math.round(t.height));return{width:Math.max(a,Math.round(l*o)),height:l}}return h({},e)}(r,e,a,t.minResizeSize)}})};return eS("div",{class:"jie-fieldrow"},[eB({label:i("Width"),value:r.width,suffix:i("px"),onChange:function(e){return o({width:e})}}),eO({variant:"icon",icon:a?eL.lock:eL.unlock,title:i(a?"Aspect ratio locked":"Aspect ratio unlocked"),onClick:function(){return n({activeTab:"resize",activeTool:a?"unlocked":"locked"})}}),eB({label:i("Height"),value:r.height,suffix:i("px"),onChange:function(e){return o({height:e})}}),eO({variant:"icon",icon:eL.reset,title:i("Reset size"),onClick:function(){return n({design:{resize:null}})}})])}};function eJ(e){return parseInt(e+e,16)}function e$(e,t){return parseInt(e.slice(t,t+2),16)}var eQ=/image\/(jpe?g|bmp)/i;function e0(e,t){if("u"<typeof document)throw Error("No DOM available: provide a CanvasFactory to the codec");var n=document.createElement("canvas");return n.width=e,n.height=t,{get width(){return n.width},set width(v){n.width=v},get height(){return n.height},set height(v){n.height=v},getContext:function(e){return n.getContext(e)},toBlobAsync:function(e,t){return new Promise(function(i,r){n.toBlob(function(e){return e?i(e):r(Error("canvas.toBlob returned null"))},e,t)})}}}var e1=function(){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:e0,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};o(this,e),u(this,"maxPixels",void 0),u(this,"maxSize",void 0),this.createCanvas=n,this.maxPixels=null!=(t=i.maxPixels)?t:0x1000000,this.maxSize=i.maxSize}return l(e,[{key:"decode",value:function(e){return a(function(){var t,n,i,r,a,o,s;return m(this,function(l){switch(l.label){case 0:return[4,this.toBitmap(e)];case 1:var u,c,h,d;return u=(t=l.sent()).width,c=t.height,h={maxSize:this.maxSize,maxPixels:this.maxPixels},d=1,h.maxSize&&h.maxSize>0&&(d=Math.min(d,h.maxSize/Math.max(u,c))),h.maxPixels&&h.maxPixels>0&&(d=Math.min(d,Math.sqrt(h.maxPixels/(u*c)))),n=Math.min(1,d),i=Math.max(1,Math.round(t.width*n)),r=Math.max(1,Math.round(t.height*n)),a=this.createCanvas(i,r),(o=this.context(a)).imageSmoothingEnabled=!0,o.imageSmoothingQuality="high",o.drawImage(t,0,0,i,r),"close"in t&&"function"==typeof t.close&&t.close(),[2,Q((s=o.getImageData(0,0,i,r)).width,s.height,s.data)]}})}).call(this)}},{key:"encode",value:function(e){return a(function(e){var t,n,i,r,a,o,s,l,u=arguments;return m(this,function(c){var h;return i=void 0===(n=(t=u.length>1&&void 0!==u[1]?u[1]:{}).type)?"image/png":n,a=void 0===(r=t.quality)?.92:r,s=void 0!==(o=t.background)||eQ.test(i)?function(e,t){for(var n=f(t,3),i=n[0],r=n[1],a=n[2],o=Q(e.width,e.height),s=0;s<e.data.length;s+=4){var l=e.data[s+3]/255,u=1-l;o.data[s]=e.data[s]*l+i*u,o.data[s+1]=e.data[s+1]*l+r*u,o.data[s+2]=e.data[s+2]*l+a*u,o.data[s+3]=255}return o}(e,(h=(null!=o?o:"#ffffff").trim().replace(/^#/,""),/^[0-9a-f]{3}$/i.test(h)?[eJ(h[0]),eJ(h[1]),eJ(h[2])]:/^[0-9a-f]{6}$/i.test(h)?[e$(h,0),e$(h,2),e$(h,4)]:[255,255,255])):e,l=this.createCanvas(s.width,s.height),this.context(l).putImageData(ew(s),0,0),[2,l.toBlobAsync(i,a)]})}).apply(this,arguments)}},{key:"context",value:function(e){var t=e.getContext("2d");if(!t)throw Error("Unable to acquire a 2D canvas context");return t}},{key:"toBitmap",value:function(e){return a(function(){return m(this,function(t){return"function"==typeof createImageBitmap?[2,createImageBitmap(e,{imageOrientation:"from-image"})]:[2,new Promise(function(t,n){var i=URL.createObjectURL(e),r=new Image;r.style.imageOrientation="from-image",r.onload=function(){URL.revokeObjectURL(i),t(r)},r.onerror=function(){URL.revokeObjectURL(i),n(Error("Failed to decode image blob"))},r.src=i})]})})()}}]),e}(),e2=function(){function e(t){o(this,e),u(this,"codec",void 0),u(this,"createCanvas",void 0),this.codec=t.codec,this.createCanvas=t.createCanvas}return l(e,[{key:"decode",value:function(e){return this.codec.decode(e)}},{key:"render",value:function(e,t){var n=function(e,t){var n=e;if(t.flip.horizontal&&(n=en(n,"horizontal")),t.flip.vertical&&(n=en(n,"vertical")),0!==t.rotate&&(n=function(e,t){var n=(Math.round(t/90)%4+4)%4;if(0===n)return Q(e.width,e.height,new Uint8ClampedArray(e.data));for(var i=e.width,r=e.height,a=1===n||3===n,o=Q(a?r:i,a?i:r),s=0;s<r;s++)for(var l=0;l<i;l++){var u=void 0,c=void 0;1===n?(u=r-1-s,c=l):2===n?(u=i-1-l,c=r-1-s):(u=s,c=i-1-l),er(e,ee(e,l,s),o,ee(o,u,c))}return o}(n,t.rotate)),0!==t.angle){var i,r=null!=(i=t.crop)?i:{x:0,y:0,width:n.width,height:n.height};n=function(e,t,n){for(var i=Math.max(1,Math.round(t.width)),r=Math.max(1,Math.round(t.height)),a=Q(i,r),o=t.x+t.width/2,s=t.y+t.height/2,l=n*Math.PI/180,u=Math.cos(l),c=Math.sin(l),h=0;h<r;h++)for(var d=h+.5-r/2,f=0;i>f;f++){var p=f+.5-i/2;!function(e,t,n,i,r){if(t<=-1||n<=-1||t>=e.width||n>=e.height){i.data[r]=0,i.data[r+1]=0,i.data[r+2]=0,i.data[r+3]=0;return}for(var a=Math.floor(t),o=Math.floor(n),s=t-a,l=n-o,u=ea(a,e.width),c=ea(a+1,e.width),h=ea(o,e.height),d=ea(o+1,e.height),f=ee(e,u,h),p=ee(e,c,h),g=ee(e,u,d),b=ee(e,c,d),m=0;m<4;m++){var y,x,w=(y=e.data[f+m],y+(e.data[p+m]-y)*s),j=(x=e.data[g+m],x+(e.data[b+m]-x)*s);i.data[r+m]=w+(j-w)*l}}(e,o+p*u-d*c-.5,s+p*c+d*u-.5,a,ee(a,f,h))}return a}(n,r,t.angle)}else t.crop&&(n=function(e,t){for(var n,i,r=O({x:n=Math.round(t.x),y:i=Math.round(t.y),width:Math.round(t.x+t.width)-n,height:Math.round(t.y+t.height)-i},e),a=Q(r.width,r.height),o=0;o<r.height;o++){var s=ee(e,r.x,r.y+o),l=ee(a,0,o);a.data.set(e.data.subarray(s,s+4*r.width),l)}return a}(n,t.crop));return t.resize&&(n=ei(n,t.resize)),n=ex(n=ed(n,t.finetune),t.filter),t.focus&&(n=function(e,t){if(t.amount<=0)return Q(e.width,e.height,new Uint8ClampedArray(e.data));for(var n=eh(e,t.amount,32),i=e.width,r=e.height,a=Q(i,r),o=Math.min(i,r),s=t.x*i,l=t.y*r,u=t.radius*o,c=Math.max(.06*o,.9*u),h=t.angle*Math.PI/180,d=-Math.sin(h),f=Math.cos(h),p=0;p<r;p++)for(var g=0;g<i;g++)for(var b=g-s,m=p-l,y=function(e,t,n){if(t<=e)return+(n>=t);var i=Math.min(1,Math.max(0,(n-e)/(t-e)));return i*i*(3-2*i)}(u,u+c,"radial"===t.shape?Math.hypot(b,m):Math.abs(b*d+m*f)),x=ee(a,g,p),w=0;w<4;w++)a.data[x+w]=e.data[x+w]+(n.data[x+w]-e.data[x+w])*y;return a}(n,t.focus)),n}(e,t);return function(e,t,n){if(0===n.length)return t;var i=e(t.width,t.height).getContext("2d");if(!i)throw Error("Unable to acquire a 2D canvas context");i.putImageData(ew(t),0,0);var r=!0,a=!1,o=void 0;try{for(var s,l=n[Symbol.iterator]();!(r=(s=l.next()).done);r=!0){var u=s.value;if("text"===u.type){var c=function(e,t){var n=Math.max(1,Math.round(e.fontSize*t.height)),i=e.bold?"bold":"normal",r=e.italic?"italic":"normal";return{text:e.text,x:Math.round(e.x*t.width),y:Math.round(e.y*t.height),fontPx:n,font:"".concat(r," ").concat(i," ").concat(n,"px ").concat(e.fontFamily),color:e.color,align:e.align,baseline:e.valign}}(u,t);i.font=c.font,i.fillStyle=c.color,i.textAlign=c.align,i.textBaseline=c.baseline,function(e,t){var n=t.text.split("\n"),i=1.2*t.fontPx,r=(n.length-1)*i,a="middle"===t.baseline?t.y-r/2:"bottom"===t.baseline?t.y-r:t.y;n.forEach(function(n,r){return e.fillText(n,t.x,a+r*i)})}(i,c)}}}catch(e){a=!0,o=e}finally{try{r||null==l.return||l.return()}finally{if(a)throw o}}var h=i.getImageData(0,0,t.width,t.height);return Q(h.width,h.height,h.data)}(this.createCanvas,n,t.annotations)}},{key:"toBlob",value:function(e,t,n){return a(function(){return m(this,function(i){return[2,this.codec.encode(this.render(e,t),n)]})}).call(this)}}]),e}();function e5(e,t,n){e.update({zoom:t.zoom*n})}var e4=function(){function e(t){var n=this;o(this,e),u(this,"store",void 0),u(this,"container",void 0),u(this,"renderer",void 0),u(this,"registry",new eE),u(this,"locales",new ej),u(this,"processor",void 0),u(this,"previewMaxSize",void 0),u(this,"spinnerDelay",void 0),u(this,"busyTimer",null),u(this,"onSaveCb",void 0),u(this,"onSaveAsCb",void 0),u(this,"confirm",void 0),u(this,"source",null),u(this,"previewSource",null),u(this,"thumbSource",null),u(this,"thumbVersion",0),u(this,"cachedRaster",null),u(this,"cachedRasterKey",""),u(this,"lastPaintKey",""),u(this,"disposers",[]),u(this,"resizeObserver",null),u(this,"observedWrap",null),u(this,"dragCleanup",null),u(this,"destroyed",!1),this.container=function(e){if("string"!=typeof e)return e;var t=document.querySelector(e);if(!t)throw Error("Container not found: ".concat(e));return t}(t.container),this.processor=null!=(s=t.processor)?s:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:e0,t=arguments.length>1?arguments[1]:void 0;return new e2({codec:new e1(e,t),createCanvas:e})}(void 0,{maxPixels:t.maxSourcePixels,maxSize:t.maxSourceSize}),this.previewMaxSize=null!=(l=t.previewMaxSize)?l:1600,this.spinnerDelay=Math.max(0,null!=(c=t.spinnerDelay)?c:250),this.onSaveCb=t.onSave,this.onSaveAsCb=t.onSaveAs,this.confirm=null!=(d=t.confirm)?d:function(e){return"u"<typeof window||window.confirm(e)};var i=!0,r=!1,a=void 0;try{for(var s,l,c,d,f,p,g,b,m,y=(null!=(f=t.locales)?f:[])[Symbol.iterator]();!(i=(m=y.next()).done);i=!0){var x=m.value;this.locales.register(x)}}catch(e){r=!0,a=e}finally{try{i||null==y.return||y.return()}finally{if(r)throw a}}this.store=new I({scheduler:null!=(p=t.scheduler)?p:function(){if("function"!=typeof requestAnimationFrame)return new P(function(e){return setTimeout(e,16)},function(e){return clearTimeout(e)});var e=function(e){cancelAnimationFrame(e.raf),null!==e.timer&&(clearTimeout(e.timer),e.timer=null)};return new P(function(t){var n={raf:0,timer:null},i=function(){e(n),t()};return n.raf=requestAnimationFrame(i),n.timer=setTimeout(i,100),n},e)}(),initialState:h({},S(),t.state,t.locale?{locale:t.locale}:{},void 0!==t.minCropSize?{minCropSize:Math.max(1,t.minCropSize)}:{},void 0!==t.minResizeSize?{minResizeSize:Math.max(1,t.minResizeSize)}:{},t.palette?{palette:t.palette}:{},t.fonts?{fonts:t.fonts}:{})});var w=!0,j=!1,k=void 0;try{for(var M,C=(null!=(g=t.tools)?g:[eV,eU,eq,eH,eG,eK])[Symbol.iterator]();!(w=(M=C.next()).done);w=!0){var _=M.value;this.registry.register(_)}}catch(e){j=!0,k=e}finally{try{w||null==C.return||C.return()}finally{if(j)throw k}}var z=!0,T=!1,E=void 0;try{for(var A,O=(null!=(b=t.plugins)?b:[])[Symbol.iterator]();!(z=(A=O.next()).done);z=!0){var R=A.value;this.use(R)}}catch(e){T=!0,E=e}finally{try{z||null==O.return||O.return()}finally{if(T)throw E}}this.renderer=new e_(new eP(document),this.container),this.disposers.push(this.store.subscribe(function(){return n.render()})),this.disposers.push(this.store.subscribe(function(e){return n.syncBusyTimer(e)})),this.render(),t.image&&this.fromBlob(t.image)}return l(e,[{key:"state",get:function(){return this.store.getState()}},{key:"update",value:function(e){return this.store.update(e),this}},{key:"save",value:function(){return a(function(){return m(this,function(e){return[2,this.handleSave()]})}).call(this)}},{key:"saveAs",value:function(){return a(function(){return m(this,function(e){return[2,this.handleSaveAs()]})}).call(this)}},{key:"reset",value:function(){return this.handleReset(),this}},{key:"use",value:function(e){var t=e.setup(this.api());return"function"==typeof t&&this.disposers.push(t),this}},{key:"fromBlob",value:function(e){return a(function(){var t,n;return m(this,function(i){switch(i.label){case 0:this.store.update({status:"loading",error:null}),i.label=1;case 1:return i.trys.push([1,3,,4]),[4,this.processor.decode(e)];case 2:if(t=i.sent(),this.destroyed)return[2,this];return this.source=t,this.previewSource=e6(t,this.previewMaxSize),this.thumbSource=e6(t,160),this.thumbVersion++,this.store.update({source:{width:t.width,height:t.height,name:c(e,File)?e.name:null,mimeType:e.type||"image/png"},resetHistory:!0,status:"ready"}),[3,4];case 3:return n=i.sent(),this.store.update({status:"error",error:c(n,Error)?n.message:String(n)}),[3,4];case 4:return[2,this]}})}).call(this)}},{key:"toBlob",value:function(e){return a(function(){var t;return m(this,function(n){switch(n.label){case 0:if(!this.source)throw Error("No image loaded — call fromBlob() first");t=R(this.store.getState()),this.store.update({status:"exporting"}),n.label=1;case 1:if(n.trys.push([1,,5,6]),!(t.annotations.length>0&&"u">typeof document&&document.fonts))return[3,3];return[4,document.fonts.ready];case 2:n.sent(),n.label=3;case 3:return[4,this.processor.toBlob(this.source,t,e)];case 4:return[2,n.sent()];case 5:return this.store.update({status:"ready"}),[7];case 6:return[2]}})}).call(this)}},{key:"destroy",value:function(){if(!this.destroyed){this.destroyed=!0,this.clearBusyTimer(),null==(i=this.dragCleanup)||i.call(this),null==(r=this.resizeObserver)||r.disconnect();var e=!0,t=!1,n=void 0;try{for(var i,r,a,o=this.disposers.splice(0)[Symbol.iterator]();!(e=(a=o.next()).done);e=!0)(0,a.value)()}catch(e){t=!0,n=e}finally{try{e||null==o.return||o.return()}finally{if(t)throw n}}this.renderer.unmount(),this.store.destroy()}}},{key:"api",value:function(){var e=this;return{registerTool:function(t){return e.registry.register(t)},registerFilter:function(e){return ey(e)},registerLocale:function(t){return e.locales.register(t)},getState:function(){return e.store.getState()},update:function(t){return e.store.update(t)}}}},{key:"translator",value:function(){return this.locales.translator(this.store.getState().locale)}},{key:"appContext",value:function(){var e=this;return{update:function(t){return e.store.update(t)},tools:this.registry.list(),t:this.translator(),onSave:function(){e.handleSave()},onSaveAs:function(){e.handleSaveAs()},onReset:function(){return e.handleReset()},beginCropDrag:function(t,n){return e.beginCropDrag(t,n)},beginCropRotate:function(t){return e.beginCropRotate(t)}}}},{key:"handleReset",value:function(){V(this.store.getState())&&this.confirm(this.translator()("Reset all changes? You can still undo afterwards."))&&this.store.update({resetDesign:!0})}},{key:"render",value:function(){if(!this.destroyed){var e,t,n,i,r,a,o,s,l,u,c,h;this.renderer.render((e=this.store.getState(),t=this.appContext(),eS("div",{class:"jie","data-theme":e.theme},[e.showToolbar?(n=U(e),r=(i=H(e))?Math.round(100*i.scale):Math.round(100*e.zoom),a=t.t,o="loading"===e.status||"exporting"===e.status,s="exporting"===e.status&&e.busyVisible,eS("header",{class:"jie-topbar"},[eS("div",{class:"jie-topbar__save"},[eO({label:a("Save"),variant:"primary",onClick:function(){return t.onSave()},disabled:!e.source||o,busy:s}),eO({label:a("Save as"),onClick:function(){return t.onSaveAs()},disabled:!e.source||o,busy:s})]),eS("div",{class:"jie-topbar__meta"},[n?eS("span",{},"".concat(n.width," x ").concat(n.height," px")):null,eI(eL.book),eS("div",{class:"jie-zoom"},[eO({variant:"icon",icon:eL.zoomOut,title:a("Zoom out"),onClick:function(){return e5(t,e,1/1.2)}}),eS("span",{},"".concat(r,"%")),eO({variant:"icon",icon:eL.zoomIn,title:a("Zoom in"),onClick:function(){return e5(t,e,1.2)}})])]),eS("div",{class:"jie-topbar__actions"},[eO({variant:"icon",icon:eL.reset,title:a("Reset"),disabled:!V(e),onClick:function(){return t.onReset()}}),eO({variant:"icon",icon:eL.undo,title:a("Undo"),disabled:!F(e),onClick:function(){return t.update({history:{step:-1}})}}),eO({variant:"icon",icon:eL.redo,title:a("Redo"),disabled:!L(e),onClick:function(){return t.update({history:{step:1}})}})])])):null,eS("div",{class:"jie-body"},[eS("nav",{class:"jie-rail"},t.tools.map(function(n){return eS("button",{key:n.id,class:"jie-tab",type:"button","aria-selected":String(e.activeTab===n.id),on:{click:function(){var e;return t.update({activeTab:n.id,activeTool:null!=(e=n.defaultTool)?e:null})}}},[eI(n.icon),eS("span",{},t.t(n.label))])})),(h=null!=(u=null==(c=null!=(l=t.tools.find(function(t){return t.id===e.activeTab}))?l:t.tools[0])?void 0:c.renderPanel({state:e,update:t.update,t:t.t}))?u:null,eS("div",{class:"jie-stage"},[eS("div",{class:"jie-canvas-wrap","data-jie-canvas-wrap":""},[eS("canvas",{class:"jie-canvas","data-jie-canvas":""}),function(e,t){if(!B(e))return null;var n=H(e),i=Y(e);if(!n||!i)return null;var r=X(e);return eS("div",{class:"jie-crop",style:{left:"".concat(n.offsetX+i.x*n.scale,"px"),top:"".concat(n.offsetY+i.y*n.scale,"px"),width:"".concat(i.width*n.scale,"px"),height:"".concat(i.height*n.scale,"px"),transform:"rotate(".concat(r,"deg)")},on:{pointerdown:function(e){return t.beginCropDrag("move",e)}}},[eS("div",{key:"rotate",class:"jie-crop__rotate",title:"Rotate",on:{pointerdown:function(e){e.stopPropagation(),t.beginCropRotate(e)}}})].concat(p(["nw","ne","sw","se"].map(function(e){return eS("div",{key:e,class:"jie-crop__handle","data-h":e,on:{pointerdown:function(n){n.stopPropagation(),t.beginCropDrag(e,n)}}})}))))}(e,t),"loading"===e.status?eS("div",{class:"jie-overlay","data-jie-loading":""},[eA()]):"error"===e.status&&e.error?eS("div",{class:"jie-overlay jie-overlay--error","data-jie-error":""},[eS("span",{},t.t("Failed to load the image")),eS("span",{class:"jie-overlay__detail"},e.error)]):null]),h?eS("div",{class:"jie-panel"},[h]):null]))])]))),this.ensureViewportObserver(),this.paint(),this.paintFilterThumbs()}}},{key:"handleSave",value:function(){return a(function(){var e,t,n;return m(this,function(i){switch(i.label){case 0:if(!this.canExport())return[2];return[4,this.toBlob()];case 1:return n=i.sent(),null==(e=(t=this).onSaveCb)||e.call(t,n,this),this.container.dispatchEvent(new CustomEvent("jie:save",{detail:{blob:n},bubbles:!0})),[2]}})}).call(this)}},{key:"handleSaveAs",value:function(){return a(function(){var e,t,n;return m(this,function(i){switch(i.label){case 0:if(!this.canExport())return[2];return[4,this.toBlob()];case 1:return n=i.sent(),null==(e=(t=this).onSaveAsCb)||e.call(t,n,this),this.container.dispatchEvent(new CustomEvent("jie:saveas",{detail:{blob:n},bubbles:!0})),[2]}})}).call(this)}},{key:"canExport",value:function(){var e=this.store.getState().status;return null!==this.source&&"exporting"!==e&&"loading"!==e}},{key:"syncBusyTimer",value:function(e){var t=this;"exporting"!==e.status?this.clearBusyTimer():e.busyVisible||null!==this.busyTimer||(this.busyTimer=setTimeout(function(){t.busyTimer=null,t.destroyed||"exporting"!==t.store.getState().status||t.store.update({busyVisible:!0})},this.spinnerDelay))}},{key:"clearBusyTimer",value:function(){null!==this.busyTimer&&(clearTimeout(this.busyTimer),this.busyTimer=null)}},{key:"ensureViewportObserver",value:function(){var e,t=this,n=this.container.querySelector("[data-jie-canvas-wrap]");if(n&&n!==this.observedWrap){if(null==(e=this.resizeObserver)||e.disconnect(),this.observedWrap=n,"u"<typeof ResizeObserver)return void this.measureViewport(n);this.resizeObserver=new ResizeObserver(function(){return t.measureViewport(n)}),this.resizeObserver.observe(n),this.measureViewport(n)}}},{key:"measureViewport",value:function(e){var t=e.clientWidth,n=e.clientHeight,i=this.store.getState().viewport;t<=0||n<=0||i&&i.width===t&&i.height===n||this.store.update({viewport:{width:t,height:n}})}},{key:"paint",value:function(){var e=this.store.getState(),t=this.container.querySelector("[data-jie-canvas]");if(t&&this.previewSource&&e.viewport){var n=H(e);if(n){var i=D(e),r="".concat(this.thumbVersion,":").concat(JSON.stringify(i));r===this.cachedRasterKey&&this.cachedRaster||(this.cachedRaster=this.processor.render(this.previewSource,i),this.cachedRasterKey=r);var a="".concat(r,"@").concat(e.viewport.width,"x").concat(e.viewport.height,":").concat(n.scale,":").concat(n.offsetX,",").concat(n.offsetY);a!==this.lastPaintKey&&(this.lastPaintKey=a,function(e,t,n,i){var r="u">typeof window&&window.devicePixelRatio||1;e.width=Math.max(1,Math.round(n.width*r)),e.height=Math.max(1,Math.round(n.height*r));var a=e.getContext("2d");if(a){a.setTransform(r,0,0,r,0,0),a.clearRect(0,0,n.width,n.height);var o=document.createElement("canvas");o.width=t.width,o.height=t.height;var s=o.getContext("2d");s&&(s.putImageData(ew(t),0,0),a.imageSmoothingEnabled=!0,a.imageSmoothingQuality="high",a.drawImage(o,i.offsetX,i.offsetY,i.width,i.height))}}(t,this.cachedRaster,e.viewport,n))}}}},{key:"paintFilterThumbs",value:function(){var e=this.thumbSource;if(e){var t=this.container.querySelectorAll("canvas[data-jie-filter-thumb]"),n=!0,i=!1,r=void 0;try{for(var a,o=t[Symbol.iterator]();!(n=(a=o.next()).done);n=!0){var s=a.value,l=s.dataset.jieFilterThumb;if(l){var u="".concat(this.thumbVersion,":").concat(l);if(s.dataset.key!==u){var c=ex(e,l);s.width=c.width,s.height=c.height;var h=s.getContext("2d");h&&(h.putImageData(ew(c),0,0),s.dataset.key=u)}}}}catch(e){i=!0,r=e}finally{try{n||null==o.return||o.return()}finally{if(i)throw r}}}}},{key:"beginCropDrag",value:function(e,t){var n=this.store.getState(),i=H(n),r=Y(n),a=N(n);if(i&&r&&a){var o=X(n),s=n.minCropSize,l=t.clientX,u=t.clientY;this.runPointerGesture(t,function(t){var n=(t.clientX-l)/i.scale,c=(t.clientY-u)/i.scale;return{crop:0!==o?function(e,t,n,i,r){var a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:8;if("move"===n)return d(h({},e),{x:e.x+i,y:e.y+r});var o=f(G[n],2),s=o[0],l=o[1],u=J(e,t,s,l),c=J(e,t,-s,-l),p={x:u.x+i,y:u.y+r},g=(p.x+c.x)/2,b=(p.y+c.y)/2,m=t*Z,y=Math.cos(m),x=Math.sin(m),w=p.x-c.x,j=p.y-c.y,k=Math.max(a,Math.abs(w*y+j*x)),S=Math.max(a,Math.abs(-(w*x)+j*y));return{x:g-k/2,y:b-S/2,width:k,height:S}}(r,o,e,n,c,s):function(e,t,n,i,r){var a,o,s,l=arguments.length>5&&void 0!==arguments[5]?arguments[5]:null,u=arguments.length>6&&void 0!==arguments[6]?arguments[6]:8;if("move"===t)return O(d(h({},e),{x:e.x+n,y:e.y+i}),r);var c=e.x,f=e.y,p=e.width,g=e.height;if("nw"===t||"sw"===t){var b=A(c+n,0,c+p-u);p+=c-b,c=b}else p=A(p+n,u,r.width-c);if("nw"===t||"ne"===t){var m=A(f+i,0,f+g-u);g+=f-m,f=m}else g=A(g+i,u,r.height-f);var y={x:c,y:f,width:p,height:g};return null!==l&&l>0&&(o=(a=y).width/l,s="sw"===t||"se"===t?a.y:a.y+a.height-o,y=d(h({},a),{height:o,y:s})),O(y,r)}(r,e,n,c,a,null,s)}})}}},{key:"beginCropRotate",value:function(e){var t,n=this.store.getState(),i=H(n),r=Y(n),a=null!=(t=this.observedWrap)?t:this.container.querySelector("[data-jie-canvas-wrap]");if(i&&r&&a){var o=a.getBoundingClientRect(),s=K(r),l=o.left+i.offsetX+s.x*i.scale,u=o.top+i.offsetY+s.y*i.scale,c=X(n),h=$(l,u,e.clientX,e.clientY);this.runPointerGesture(e,function(e){var t=c+($(l,u,e.clientX,e.clientY)-h);return 2>Math.abs(t)&&(t=0),{angle:Math.round(10*t)/10}})}}},{key:"runPointerGesture",value:function(e,t){var n=this;e.preventDefault();var i=!1,r=function(e){n.store.update({design:t(e),commit:!i}),i=!0},a=function(){window.removeEventListener("pointermove",r),window.removeEventListener("pointerup",a),n.dragCleanup=null};window.addEventListener("pointermove",r),window.addEventListener("pointerup",a),this.dragCleanup=a}}]),e}();function e6(e,t){var n=Math.max(e.width,e.height);if(t>=n)return e;var i=t/n;return ei(e,{width:Math.round(e.width*i),height:Math.round(e.height*i)})}},2868:function(e,t,n){n.d(t,{_:function(){return i}});function i(e,t){return null!=t&&"u">typeof Symbol&&t[Symbol.hasInstance]||null!=t&&"u">typeof Symbol&&t[Symbol.hasInstance]?!!t[Symbol.hasInstance](e):e instanceof t}}},function(e){return e(e.s=98270)}])});
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * jodit-pro - PRO Version of Jodit Editor
3
3
  * Author: Chupurnov Valerii <chupurnov@gmail.com>
4
- * Version: v4.13.5
4
+ * Version: v4.13.8
5
5
  * Url: https://xdsoft.net/jodit/pro/
6
6
  * License(s): SEE LICENSE IN LICENSE.md
7
7
  */
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * jodit-pro - PRO Version of Jodit Editor
3
3
  * Author: Chupurnov Valerii <chupurnov@gmail.com>
4
- * Version: v4.13.5
4
+ * Version: v4.13.8
5
5
  * Url: https://xdsoft.net/jodit/pro/
6
6
  * License(s): SEE LICENSE IN LICENSE.md
7
7
  */
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * jodit-pro - PRO Version of Jodit Editor
3
3
  * Author: Chupurnov Valerii <chupurnov@gmail.com>
4
- * Version: v4.13.5
4
+ * Version: v4.13.8
5
5
  * Url: https://xdsoft.net/jodit/pro/
6
6
  * License(s): SEE LICENSE IN LICENSE.md
7
7
  */
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * jodit-pro - PRO Version of Jodit Editor
3
3
  * Author: Chupurnov Valerii <chupurnov@gmail.com>
4
- * Version: v4.13.5
4
+ * Version: v4.13.8
5
5
  * Url: https://xdsoft.net/jodit/pro/
6
6
  * License(s): SEE LICENSE IN LICENSE.md
7
7
  */
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * jodit-pro - PRO Version of Jodit Editor
3
3
  * Author: Chupurnov Valerii <chupurnov@gmail.com>
4
- * Version: v4.13.5
4
+ * Version: v4.13.8
5
5
  * Url: https://xdsoft.net/jodit/pro/
6
6
  * License(s): SEE LICENSE IN LICENSE.md
7
7
  */
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * jodit-pro - PRO Version of Jodit Editor
3
3
  * Author: Chupurnov Valerii <chupurnov@gmail.com>
4
- * Version: v4.13.5
4
+ * Version: v4.13.8
5
5
  * Url: https://xdsoft.net/jodit/pro/
6
6
  * License(s): SEE LICENSE IN LICENSE.md
7
7
  */
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * jodit-pro - PRO Version of Jodit Editor
3
3
  * Author: Chupurnov Valerii <chupurnov@gmail.com>
4
- * Version: v4.13.5
4
+ * Version: v4.13.8
5
5
  * Url: https://xdsoft.net/jodit/pro/
6
6
  * License(s): SEE LICENSE IN LICENSE.md
7
7
  */
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * jodit-pro - PRO Version of Jodit Editor
3
3
  * Author: Chupurnov Valerii <chupurnov@gmail.com>
4
- * Version: v4.13.5
4
+ * Version: v4.13.8
5
5
  * Url: https://xdsoft.net/jodit/pro/
6
6
  * License(s): SEE LICENSE IN LICENSE.md
7
7
  */
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * jodit-pro - PRO Version of Jodit Editor
3
3
  * Author: Chupurnov Valerii <chupurnov@gmail.com>
4
- * Version: v4.13.5
4
+ * Version: v4.13.8
5
5
  * Url: https://xdsoft.net/jodit/pro/
6
6
  * License(s): SEE LICENSE IN LICENSE.md
7
7
  */
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * jodit-pro - PRO Version of Jodit Editor
3
3
  * Author: Chupurnov Valerii <chupurnov@gmail.com>
4
- * Version: v4.13.5
4
+ * Version: v4.13.8
5
5
  * Url: https://xdsoft.net/jodit/pro/
6
6
  * License(s): SEE LICENSE IN LICENSE.md
7
7
  */
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * jodit-pro - PRO Version of Jodit Editor
3
3
  * Author: Chupurnov Valerii <chupurnov@gmail.com>
4
- * Version: v4.13.5
4
+ * Version: v4.13.8
5
5
  * Url: https://xdsoft.net/jodit/pro/
6
6
  * License(s): SEE LICENSE IN LICENSE.md
7
7
  */
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * jodit-pro - PRO Version of Jodit Editor
3
3
  * Author: Chupurnov Valerii <chupurnov@gmail.com>
4
- * Version: v4.13.5
4
+ * Version: v4.13.8
5
5
  * Url: https://xdsoft.net/jodit/pro/
6
6
  * License(s): SEE LICENSE IN LICENSE.md
7
7
  */
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * jodit-pro - PRO Version of Jodit Editor
3
3
  * Author: Chupurnov Valerii <chupurnov@gmail.com>
4
- * Version: v4.13.5
4
+ * Version: v4.13.8
5
5
  * Url: https://xdsoft.net/jodit/pro/
6
6
  * License(s): SEE LICENSE IN LICENSE.md
7
7
  */